@pixerate/editor 0.109.0 → 0.110.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 (61) hide show
  1. package/dist/blending-DXl06NSx.d.ts +486 -0
  2. package/dist/blending-aOE6Y3UE.d.cts +486 -0
  3. package/dist/chunk-7VOHOPLW.cjs +1136 -0
  4. package/dist/chunk-7VOHOPLW.cjs.map +1 -0
  5. package/dist/{chunk-RE77QYUF.js → chunk-DMRSJBJF.js} +3 -3
  6. package/dist/chunk-FTBZPI77.cjs +1 -0
  7. package/dist/chunk-FTBZPI77.cjs.map +1 -0
  8. package/dist/{chunk-WMBIJCHA.js → chunk-HNS7UHCM.js} +5 -1
  9. package/dist/{chunk-WMBIJCHA.js.map → chunk-HNS7UHCM.js.map} +1 -1
  10. package/dist/{chunk-CFMWALBM.js → chunk-LQEEDHOP.js} +2 -2
  11. package/dist/{chunk-D37BX2ZA.cjs → chunk-MGL4U5WA.cjs} +199 -199
  12. package/dist/{chunk-D37BX2ZA.cjs.map → chunk-MGL4U5WA.cjs.map} +1 -1
  13. package/dist/{chunk-AZTZRLDI.cjs → chunk-POGBUYWE.cjs} +92 -92
  14. package/dist/{chunk-AZTZRLDI.cjs.map → chunk-POGBUYWE.cjs.map} +1 -1
  15. package/dist/chunk-VKK5VS2T.js +1 -0
  16. package/dist/{chunk-SZ6KMZNM.cjs → chunk-XIOMMGPD.cjs} +6 -2
  17. package/dist/chunk-XIOMMGPD.cjs.map +1 -0
  18. package/dist/{chunk-3PHA3UKI.js → chunk-Z4BC6M74.js} +523 -121
  19. package/dist/chunk-Z4BC6M74.js.map +1 -0
  20. package/dist/{export-BLPLaE6Z.d.ts → export-CO2ryu3I.d.ts} +3 -3
  21. package/dist/{export-DSUc4fQD.d.cts → export-DRiLzP_j.d.cts} +3 -3
  22. package/dist/image-editor/index.cjs +722 -696
  23. package/dist/image-editor/index.cjs.map +1 -1
  24. package/dist/image-editor/index.d.cts +9 -9
  25. package/dist/image-editor/index.d.ts +9 -9
  26. package/dist/image-editor/index.js +31 -5
  27. package/dist/image-editor/index.js.map +1 -1
  28. package/dist/paint/index.cjs +28 -4
  29. package/dist/paint/index.cjs.map +1 -1
  30. package/dist/paint/index.d.cts +3 -89
  31. package/dist/paint/index.d.ts +3 -89
  32. package/dist/paint/index.js +27 -3
  33. package/dist/paint-editor/index.cjs +1052 -286
  34. package/dist/paint-editor/index.cjs.map +1 -1
  35. package/dist/paint-editor/index.d.cts +301 -22
  36. package/dist/paint-editor/index.d.ts +301 -22
  37. package/dist/paint-editor/index.js +848 -82
  38. package/dist/paint-editor/index.js.map +1 -1
  39. package/dist/raster/index.cjs +5 -3
  40. package/dist/raster/index.cjs.map +1 -1
  41. package/dist/raster/index.d.cts +2 -2
  42. package/dist/raster/index.d.ts +2 -2
  43. package/dist/raster/index.js +4 -2
  44. package/dist/{render-C-fO_mes.d.cts → render-BEriFuqK.d.cts} +1 -1
  45. package/dist/{render-OLIMk_v0.d.ts → render-tjzKaik-.d.ts} +1 -1
  46. package/dist/{surface-CkKOHGPm.d.cts → surface-C8RRg_Bh.d.cts} +109 -1
  47. package/dist/{surface-CkKOHGPm.d.ts → surface-C8RRg_Bh.d.ts} +109 -1
  48. package/package.json +1 -1
  49. package/skills/pixerate-paint-editor/SKILL.md +49 -13
  50. package/dist/chunk-3PHA3UKI.js.map +0 -1
  51. package/dist/chunk-6BU5WU4R.cjs +0 -1
  52. package/dist/chunk-6BU5WU4R.cjs.map +0 -1
  53. package/dist/chunk-HUFQD4CB.cjs +0 -734
  54. package/dist/chunk-HUFQD4CB.cjs.map +0 -1
  55. package/dist/chunk-SZ6KMZNM.cjs.map +0 -1
  56. package/dist/chunk-XYBJKUAU.js +0 -1
  57. package/dist/mixer-5ziHU8OS.d.cts +0 -282
  58. package/dist/mixer-DNqiYXYQ.d.ts +0 -282
  59. /package/dist/{chunk-RE77QYUF.js.map → chunk-DMRSJBJF.js.map} +0 -0
  60. /package/dist/{chunk-CFMWALBM.js.map → chunk-LQEEDHOP.js.map} +0 -0
  61. /package/dist/{chunk-XYBJKUAU.js.map → chunk-VKK5VS2T.js.map} +0 -0
@@ -4,7 +4,7 @@ var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
4
4
 
5
5
 
6
6
  var _chunkVJUVNERTcjs = require('../chunk-VJUVNERT.cjs');
7
- require('../chunk-6BU5WU4R.cjs');
7
+ require('../chunk-FTBZPI77.cjs');
8
8
 
9
9
 
10
10
 
@@ -334,7 +334,7 @@ require('../chunk-6BU5WU4R.cjs');
334
334
 
335
335
 
336
336
 
337
- var _chunkD37BX2ZAcjs = require('../chunk-D37BX2ZA.cjs');
337
+ var _chunkMGL4U5WAcjs = require('../chunk-MGL4U5WA.cjs');
338
338
 
339
339
 
340
340
 
@@ -398,7 +398,7 @@ var _chunkD37BX2ZAcjs = require('../chunk-D37BX2ZA.cjs');
398
398
 
399
399
 
400
400
 
401
- var _chunkAZTZRLDIcjs = require('../chunk-AZTZRLDI.cjs');
401
+ var _chunkPOGBUYWEcjs = require('../chunk-POGBUYWE.cjs');
402
402
 
403
403
 
404
404
 
@@ -435,7 +435,6 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
435
435
 
436
436
 
437
437
 
438
- var _chunkHUFQD4CBcjs = require('../chunk-HUFQD4CB.cjs');
439
438
 
440
439
 
441
440
 
@@ -448,6 +447,7 @@ var _chunkHUFQD4CBcjs = require('../chunk-HUFQD4CB.cjs');
448
447
 
449
448
 
450
449
 
450
+ var _chunk7VOHOPLWcjs = require('../chunk-7VOHOPLW.cjs');
451
451
 
452
452
 
453
453
 
@@ -488,7 +488,20 @@ var _chunkHUFQD4CBcjs = require('../chunk-HUFQD4CB.cjs');
488
488
 
489
489
 
490
490
 
491
- var _chunkSZ6KMZNMcjs = require('../chunk-SZ6KMZNM.cjs');
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+ var _chunkXIOMMGPDcjs = require('../chunk-XIOMMGPD.cjs');
492
505
 
493
506
 
494
507
 
@@ -615,7 +628,7 @@ function quickMaskPixels(mask, style = {}) {
615
628
 
616
629
  // src/image-editor/layers/render.ts
617
630
  function isQuarterTurn(rotate) {
618
- return _chunkD37BX2ZAcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
631
+ return _chunkMGL4U5WAcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
619
632
  }
620
633
  function isIntegerRect(r) {
621
634
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -623,7 +636,7 @@ function isIntegerRect(r) {
623
636
  function baseProjection(region, transform, baseW, baseH) {
624
637
  return {
625
638
  region,
626
- angle: _chunkD37BX2ZAcjs.normalizeAngle.call(void 0, transform.rotate),
639
+ angle: _chunkMGL4U5WAcjs.normalizeAngle.call(void 0, transform.rotate),
627
640
  flipH: transform.flipH,
628
641
  flipV: transform.flipV,
629
642
  scale: 1,
@@ -632,14 +645,14 @@ function baseProjection(region, transform, baseW, baseH) {
632
645
  };
633
646
  }
634
647
  function projectQuarterTurn(src, srcRect, region, transform) {
635
- const rotated = _chunkD37BX2ZAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
648
+ const rotated = _chunkMGL4U5WAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
636
649
  const w = Math.max(1, Math.round(rotated.width));
637
650
  const h = Math.max(1, Math.round(rotated.height));
638
651
  const out = new Uint8ClampedArray(w * h * 4);
639
652
  const p = baseProjection(region, transform, w, h);
640
- const o = _chunkD37BX2ZAcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
641
- const ox = _chunkD37BX2ZAcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
642
- const oy = _chunkD37BX2ZAcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
653
+ const o = _chunkMGL4U5WAcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
654
+ const ox = _chunkMGL4U5WAcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
655
+ const oy = _chunkMGL4U5WAcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
643
656
  const ux = Math.round(ox.x - o.x);
644
657
  const vx = Math.round(ox.y - o.y);
645
658
  const uy = Math.round(oy.x - o.x);
@@ -668,23 +681,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
668
681
  const d = img.data;
669
682
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
670
683
  }
671
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunkD37BX2ZAcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
684
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkMGL4U5WAcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
672
685
  }
673
686
  function needsLegacyBase(input) {
674
687
  const { stack, region, canvas, transform } = input;
675
- if (!_chunkD37BX2ZAcjs.isLegacyShape.call(void 0, stack)) return false;
688
+ if (!_chunkMGL4U5WAcjs.isLegacyShape.call(void 0, stack)) return false;
676
689
  const bg = stack.layers[0];
677
690
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
678
691
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
679
692
  if (stack.outputOpacity < 1) return true;
680
- const blur = _chunkD37BX2ZAcjs.blurFilter.call(void 0, bg);
693
+ const blur = _chunkMGL4U5WAcjs.blurFilter.call(void 0, bg);
681
694
  if (blur && blur.enabled && blur.radius > 0) {
682
695
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
683
- const angle = _chunkD37BX2ZAcjs.normalizeAngle.call(void 0, transform.rotate);
696
+ const angle = _chunkMGL4U5WAcjs.normalizeAngle.call(void 0, transform.rotate);
684
697
  if (!full || angle === 90 || angle === 270) return true;
685
698
  }
686
699
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
687
- if (_chunkD37BX2ZAcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
700
+ if (_chunkMGL4U5WAcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
688
701
  return false;
689
702
  }
690
703
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : l.type === "shape" && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -716,7 +729,7 @@ function coveringRect(region) {
716
729
  const y = Math.floor(region.y);
717
730
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
718
731
  }
719
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkD37BX2ZAcjs.LayerCompositor)()) {
732
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkMGL4U5WAcjs.LayerCompositor)()) {
720
733
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
721
734
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
722
735
  }
@@ -850,8 +863,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
850
863
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
851
864
  * trust dirty rectangles; exports use `exportCompositor`.
852
865
  */
853
- __init8() {this.compositor = new (0, _chunkD37BX2ZAcjs.LayerCompositor)()}
854
- __init9() {this.exportCompositor = new (0, _chunkD37BX2ZAcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
866
+ __init8() {this.compositor = new (0, _chunkMGL4U5WAcjs.LayerCompositor)()}
867
+ __init9() {this.exportCompositor = new (0, _chunkMGL4U5WAcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
855
868
  /** How the host resolves layer pixels (set by the controller). */
856
869
 
857
870
  /**
@@ -917,9 +930,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
917
930
  return;
918
931
  }
919
932
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
920
- const projection = _chunkD37BX2ZAcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
933
+ const projection = _chunkMGL4U5WAcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
921
934
  const { region } = projection;
922
- const rotated = _chunkD37BX2ZAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
935
+ const rotated = _chunkMGL4U5WAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
923
936
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
924
937
  let overlay = annotations;
925
938
  if (route === "legacy") {
@@ -929,8 +942,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
929
942
  `${naturalWidth}x${naturalHeight}`,
930
943
  `${region.x},${region.y},${region.width},${region.height}`,
931
944
  `${projection.angle},${transform.flipH},${transform.flipV}`,
932
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
933
- _chunkD37BX2ZAcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
945
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
946
+ _chunkMGL4U5WAcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
934
947
  `${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}`
935
948
  ].join("|");
936
949
  let baseCanvas = this.cachedBaseCanvas;
@@ -962,7 +975,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
962
975
  }
963
976
  if (overlay.length > 0 || options.draftAnnotation) {
964
977
  ctx.save();
965
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
978
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
966
979
  ctx.beginPath();
967
980
  ctx.rect(region.x, region.y, region.width, region.height);
968
981
  ctx.clip();
@@ -985,7 +998,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
985
998
  if (_optionalChain([state, 'access', _13 => _13.selection, 'optionalAccess', _14 => _14.bounds]) && display !== "none" || _optionalChain([options, 'access', _15 => _15.draftSelectionPath, 'optionalAccess', _16 => _16.length])) {
986
999
  ctx.save();
987
1000
  try {
988
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1001
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
989
1002
  ctx.beginPath();
990
1003
  ctx.rect(region.x, region.y, region.width, region.height);
991
1004
  ctx.clip();
@@ -1000,7 +1013,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1000
1013
  const b = options.brushCursor;
1001
1014
  ctx.save();
1002
1015
  try {
1003
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1016
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1004
1017
  const px2 = 1 / (projection.scale || 1);
1005
1018
  ctx.beginPath();
1006
1019
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1018,7 +1031,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1018
1031
  const t = options.freeTransform;
1019
1032
  ctx.save();
1020
1033
  try {
1021
- const scr = (p) => _chunkD37BX2ZAcjs.projectImagePoint.call(void 0, p, projection);
1034
+ const scr = (p) => _chunkMGL4U5WAcjs.projectImagePoint.call(void 0, p, projection);
1022
1035
  ctx.beginPath();
1023
1036
  if (t.warp) {
1024
1037
  for (const c of t.warp.curves) {
@@ -1076,7 +1089,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1076
1089
  }
1077
1090
  if (isActivelyCropping) {
1078
1091
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1079
- this.drawCropOverlay(ctx, _chunkD37BX2ZAcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1092
+ this.drawCropOverlay(ctx, _chunkMGL4U5WAcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1080
1093
  }
1081
1094
  }
1082
1095
  /**
@@ -1085,7 +1098,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1085
1098
  */
1086
1099
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1087
1100
  const { adjustments, depthMask } = state;
1088
- const rotated = _chunkD37BX2ZAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1101
+ const rotated = _chunkMGL4U5WAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1089
1102
  const baseW = Math.max(1, Math.round(rotated.width));
1090
1103
  const baseH = Math.max(1, Math.round(rotated.height));
1091
1104
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1093,7 +1106,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1093
1106
  if (!baseCtx) return baseCanvas;
1094
1107
  const projection = getBaseProjection(region, transform, baseW, baseH);
1095
1108
  baseCtx.save();
1096
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1109
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1097
1110
  baseCtx.drawImage(
1098
1111
  img,
1099
1112
  region.x,
@@ -1108,8 +1121,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1108
1121
  baseCtx.restore();
1109
1122
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1110
1123
  if (imageData) {
1111
- const layerMasks = _chunkD37BX2ZAcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1112
- _chunkD37BX2ZAcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1124
+ const layerMasks = _chunkMGL4U5WAcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1125
+ _chunkMGL4U5WAcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1113
1126
  if (depthMask.enabled && depthMask.maskSource) {
1114
1127
  try {
1115
1128
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1120,7 +1133,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1120
1133
  const maskCtx = maskCanvas.getContext("2d");
1121
1134
  if (maskCtx) {
1122
1135
  maskCtx.save();
1123
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1136
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1124
1137
  maskCtx.drawImage(
1125
1138
  maskImg,
1126
1139
  region.x * sx,
@@ -1135,7 +1148,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1135
1148
  maskCtx.restore();
1136
1149
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1137
1150
  if (maskData) {
1138
- _chunkD37BX2ZAcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1151
+ _chunkMGL4U5WAcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1139
1152
  }
1140
1153
  }
1141
1154
  } catch (e6) {
@@ -1154,7 +1167,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1154
1167
  else if (this.baseRoute === "layers") route = "layers";
1155
1168
  else {
1156
1169
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1157
- const shaped = this.baseRoute === "legacy" && _chunkD37BX2ZAcjs.isLegacyShape.call(void 0, stack);
1170
+ const shaped = this.baseRoute === "legacy" && _chunkMGL4U5WAcjs.isLegacyShape.call(void 0, stack);
1158
1171
  route = shaped || needsLegacyBase({
1159
1172
  stack,
1160
1173
  region,
@@ -1186,7 +1199,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1186
1199
  /** Loads what the compositor reads synchronously: depth maps (at canvas size) and annotation images. */
1187
1200
  /** Loads depth maps and annotation images the compositor reads synchronously. */
1188
1201
  async prepareLayerAssets(layers, width, height) {
1189
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) {
1202
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) {
1190
1203
  const source = _optionalChain([l, 'access', _38 => _38.mask, 'optionalAccess', _39 => _39.source]);
1191
1204
  if (_optionalChain([source, 'optionalAccess', _40 => _40.enabled]) && source.maskSource) {
1192
1205
  const key = `${source.maskSource}|${width}x${height}`;
@@ -1240,14 +1253,14 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1240
1253
  }
1241
1254
  }
1242
1255
  putTile(ctx, data, tx, ty, rect) {
1243
- const ox = tx * _chunkSZ6KMZNMcjs.TILE - rect.x;
1244
- const oy = ty * _chunkSZ6KMZNMcjs.TILE - rect.y;
1256
+ const ox = tx * _chunkXIOMMGPDcjs.TILE - rect.x;
1257
+ const oy = ty * _chunkXIOMMGPDcjs.TILE - rect.y;
1245
1258
  const x0 = Math.max(0, -ox);
1246
1259
  const y0 = Math.max(0, -oy);
1247
- const x1 = Math.min(_chunkSZ6KMZNMcjs.TILE, rect.width - ox);
1248
- const y1 = Math.min(_chunkSZ6KMZNMcjs.TILE, rect.height - oy);
1260
+ const x1 = Math.min(_chunkXIOMMGPDcjs.TILE, rect.width - ox);
1261
+ const y1 = Math.min(_chunkXIOMMGPDcjs.TILE, rect.height - oy);
1249
1262
  if (x1 <= x0 || y1 <= y0) return;
1250
- const img = ctx.createImageData(_chunkSZ6KMZNMcjs.TILE, _chunkSZ6KMZNMcjs.TILE);
1263
+ const img = ctx.createImageData(_chunkXIOMMGPDcjs.TILE, _chunkXIOMMGPDcjs.TILE);
1251
1264
  img.data.set(data);
1252
1265
  ctx.putImageData(img, ox, oy, x0, y0, x1 - x0, y1 - y0);
1253
1266
  }
@@ -1268,7 +1281,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1268
1281
  if (!ctx || typeof ctx.createImageData !== "function") return null;
1269
1282
  let changed = false;
1270
1283
  this.compositor.compositeTiles(layers, rect, this.compositorSources(width, height), (tx, ty, data) => {
1271
- const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty);
1284
+ const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty);
1272
1285
  if (comp.tiles.get(key) === data) return;
1273
1286
  comp.tiles.set(key, data);
1274
1287
  comp.histograms.delete(key);
@@ -1288,17 +1301,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1288
1301
  if (!comp) return null;
1289
1302
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1290
1303
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1291
- const rotated = _chunkD37BX2ZAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1304
+ const rotated = _chunkMGL4U5WAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1292
1305
  const baseW = Math.max(1, Math.round(rotated.width));
1293
1306
  const baseH = Math.max(1, Math.round(rotated.height));
1294
- const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkD37BX2ZAcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1307
+ const key = `${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkMGL4U5WAcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1295
1308
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1296
1309
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1297
1310
  const ctx = canvas.getContext("2d");
1298
1311
  if (!ctx) return null;
1299
1312
  ctx.clearRect(0, 0, baseW, baseH);
1300
1313
  ctx.save();
1301
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1314
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1302
1315
  ctx.beginPath();
1303
1316
  ctx.rect(region.x, region.y, region.width, region.height);
1304
1317
  ctx.clip();
@@ -1393,12 +1406,12 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1393
1406
  * Draws an individual annotation onto the canvas.
1394
1407
  */
1395
1408
  async drawAnnotation(ctx, ann) {
1396
- const blend = _chunkSZ6KMZNMcjs.normalizeBlendMode.call(void 0, ann.blend);
1409
+ const blend = _chunkXIOMMGPDcjs.normalizeBlendMode.call(void 0, ann.blend);
1397
1410
  if (blend === "normal") {
1398
1411
  await this.drawAnnotationContent(ctx, ann);
1399
1412
  return;
1400
1413
  }
1401
- const op = _chunkSZ6KMZNMcjs.canvasCompositeOperation.call(void 0, blend);
1414
+ const op = _chunkXIOMMGPDcjs.canvasCompositeOperation.call(void 0, blend);
1402
1415
  if (op) {
1403
1416
  ctx.save();
1404
1417
  ctx.globalCompositeOperation = op;
@@ -1431,7 +1444,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1431
1444
  const backdrop = ctx.getImageData(0, 0, w, h);
1432
1445
  const source = lctx.getImageData(0, 0, w, h);
1433
1446
  if (!backdrop || !source) return false;
1434
- _chunkSZ6KMZNMcjs.blendImageData.call(void 0, backdrop, source, _chunkSZ6KMZNMcjs.normalizeBlendMode.call(void 0, ann.blend));
1447
+ _chunkXIOMMGPDcjs.blendImageData.call(void 0, backdrop, source, _chunkXIOMMGPDcjs.normalizeBlendMode.call(void 0, ann.blend));
1435
1448
  lctx.setTransform(1, 0, 0, 1, 0, 0);
1436
1449
  lctx.putImageData(backdrop, 0, 0);
1437
1450
  } catch (e10) {
@@ -1570,7 +1583,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1570
1583
  ctx.strokeStyle = "#3b82f6";
1571
1584
  ctx.lineWidth = 1.5;
1572
1585
  ctx.setLineDash([4, 4]);
1573
- const bounds = _chunkD37BX2ZAcjs.getAnnotationBounds.call(void 0, ann);
1586
+ const bounds = _chunkMGL4U5WAcjs.getAnnotationBounds.call(void 0, ann);
1574
1587
  const pad = 4;
1575
1588
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1576
1589
  ctx.fillStyle = "#ffffff";
@@ -1591,7 +1604,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1591
1604
  }
1592
1605
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1593
1606
  getAnnotationBounds(ann) {
1594
- return _chunkD37BX2ZAcjs.getAnnotationBounds.call(void 0, ann);
1607
+ return _chunkMGL4U5WAcjs.getAnnotationBounds.call(void 0, ann);
1595
1608
  }
1596
1609
  /**
1597
1610
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -1673,8 +1686,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1673
1686
  }
1674
1687
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
1675
1688
  const { crop, transform, annotations } = state;
1676
- const region = crop ? _chunkD37BX2ZAcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
1677
- const rotated = _chunkD37BX2ZAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1689
+ const region = crop ? _chunkMGL4U5WAcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
1690
+ const rotated = _chunkMGL4U5WAcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1678
1691
  const baseW = Math.max(1, Math.round(rotated.width));
1679
1692
  const baseH = Math.max(1, Math.round(rotated.height));
1680
1693
  const exportW = options.width || baseW;
@@ -1703,7 +1716,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1703
1716
  const bctx = baseCanvas.getContext("2d");
1704
1717
  if (bctx) {
1705
1718
  bctx.save();
1706
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
1719
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
1707
1720
  bctx.beginPath();
1708
1721
  bctx.rect(region.x, region.y, region.width, region.height);
1709
1722
  bctx.clip();
@@ -1716,7 +1729,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1716
1729
  if (options.includeAnnotations !== false && overlay.length > 0) {
1717
1730
  ctx.save();
1718
1731
  ctx.scale(exportW / baseW, exportH / baseH);
1719
- _chunkD37BX2ZAcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
1732
+ _chunkMGL4U5WAcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
1720
1733
  for (const ann of overlay) {
1721
1734
  await this.drawAnnotation(ctx, ann);
1722
1735
  }
@@ -1806,7 +1819,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1806
1819
  case "rect":
1807
1820
  case "image":
1808
1821
  case "text": {
1809
- const b = _chunkD37BX2ZAcjs.getAnnotationBounds.call(void 0, ann);
1822
+ const b = _chunkMGL4U5WAcjs.getAnnotationBounds.call(void 0, ann);
1810
1823
  ctx.fillRect(b.x, b.y, b.width, b.height);
1811
1824
  break;
1812
1825
  }
@@ -1826,7 +1839,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
1826
1839
  function getBaseProjection(region, transform, baseW, baseH) {
1827
1840
  return {
1828
1841
  region,
1829
- angle: _chunkD37BX2ZAcjs.normalizeAngle.call(void 0, transform.rotate),
1842
+ angle: _chunkMGL4U5WAcjs.normalizeAngle.call(void 0, transform.rotate),
1830
1843
  flipH: transform.flipH,
1831
1844
  flipV: transform.flipV,
1832
1845
  scale: 1,
@@ -1856,12 +1869,12 @@ var CompositeCanvas = (_class3 = class {
1856
1869
  if (!h) {
1857
1870
  const tx = key % 65536 - 32768;
1858
1871
  const ty = Math.floor(key / 65536) - 32768;
1859
- const x0 = Math.max(r.x, tx * _chunkSZ6KMZNMcjs.TILE);
1860
- const y0 = Math.max(r.y, ty * _chunkSZ6KMZNMcjs.TILE);
1861
- const x1 = Math.min(r.x + r.width, tx * _chunkSZ6KMZNMcjs.TILE + _chunkSZ6KMZNMcjs.TILE);
1862
- const y1 = Math.min(r.y + r.height, ty * _chunkSZ6KMZNMcjs.TILE + _chunkSZ6KMZNMcjs.TILE);
1872
+ const x0 = Math.max(r.x, tx * _chunkXIOMMGPDcjs.TILE);
1873
+ const y0 = Math.max(r.y, ty * _chunkXIOMMGPDcjs.TILE);
1874
+ const x1 = Math.min(r.x + r.width, tx * _chunkXIOMMGPDcjs.TILE + _chunkXIOMMGPDcjs.TILE);
1875
+ const y1 = Math.min(r.y + r.height, ty * _chunkXIOMMGPDcjs.TILE + _chunkXIOMMGPDcjs.TILE);
1863
1876
  h = emptyHistogram();
1864
- if (x1 > x0 && y1 > y0) addToHistogram(h, data, _chunkSZ6KMZNMcjs.TILE, { x: x0 - tx * _chunkSZ6KMZNMcjs.TILE, y: y0 - ty * _chunkSZ6KMZNMcjs.TILE, width: x1 - x0, height: y1 - y0 });
1877
+ if (x1 > x0 && y1 > y0) addToHistogram(h, data, _chunkXIOMMGPDcjs.TILE, { x: x0 - tx * _chunkXIOMMGPDcjs.TILE, y: y0 - ty * _chunkXIOMMGPDcjs.TILE, width: x1 - x0, height: y1 - y0 });
1865
1878
  this.histograms.set(key, h);
1866
1879
  }
1867
1880
  parts.push(h);
@@ -1930,8 +1943,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
1930
1943
  }
1931
1944
  function toMask(width, height, coverage) {
1932
1945
  const out = new Uint8Array(coverage.length);
1933
- for (let i = 0; i < out.length; i++) out[i] = _chunkD37BX2ZAcjs.coverageToByte.call(void 0, coverage[i]);
1934
- return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, width, height, out);
1946
+ for (let i = 0; i < out.length; i++) out[i] = _chunkMGL4U5WAcjs.coverageToByte.call(void 0, coverage[i]);
1947
+ return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, width, height, out);
1935
1948
  }
1936
1949
  function polygonSelection(width, height, points, options = {}) {
1937
1950
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2058,7 +2071,7 @@ function magicWand(pixels, seed, options = {}) {
2058
2071
  const { width: w, height: h } = pixels;
2059
2072
  const sx = Math.floor(seed.x);
2060
2073
  const sy = Math.floor(seed.y);
2061
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, w, h);
2074
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, w, h);
2062
2075
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2063
2076
  const marks = new Uint8Array(n);
2064
2077
  let bx0 = w;
@@ -2106,9 +2119,9 @@ function magicWand(pixels, seed, options = {}) {
2106
2119
  }
2107
2120
  }
2108
2121
  }
2109
- if (bx1 < 0) return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, w, h);
2110
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, w, h, marks);
2111
- return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0,
2122
+ if (bx1 < 0) return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, w, h);
2123
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, w, h, marks);
2124
+ return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0,
2112
2125
  w,
2113
2126
  h,
2114
2127
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2130,7 +2143,7 @@ function colorRange(pixels, samples, options = {}) {
2130
2143
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2131
2144
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2132
2145
  const out = new Uint8Array(n);
2133
- if (!parsed.length) return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, w, h, out);
2146
+ if (!parsed.length) return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, w, h, out);
2134
2147
  for (let i = 0; i < n; i++) {
2135
2148
  const p = i * 4;
2136
2149
  if (data[p + 3] <= 0) continue;
@@ -2146,9 +2159,9 @@ function colorRange(pixels, samples, options = {}) {
2146
2159
  }
2147
2160
  if (k > best) best = k;
2148
2161
  }
2149
- out[i] = _chunkD37BX2ZAcjs.coverageToByte.call(void 0, best);
2162
+ out[i] = _chunkMGL4U5WAcjs.coverageToByte.call(void 0, best);
2150
2163
  }
2151
- return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, w, h, out);
2164
+ return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, w, h, out);
2152
2165
  }
2153
2166
  var TONE_RANGE_PRESETS = {
2154
2167
  shadows: [0, 65],
@@ -2166,9 +2179,9 @@ function toneRange(pixels, range, falloff = 20) {
2166
2179
  if (d[p + 3] <= 0) continue;
2167
2180
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2168
2181
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2169
- out[i] = _chunkD37BX2ZAcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2182
+ out[i] = _chunkMGL4U5WAcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2170
2183
  }
2171
- return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2184
+ return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2172
2185
  }
2173
2186
  function hueRange(pixels, center) {
2174
2187
  const n = checkPixels(pixels);
@@ -2191,9 +2204,9 @@ function hueRange(pixels, center) {
2191
2204
  hue *= 60;
2192
2205
  let dh = ((hue - center) % 360 + 360) % 360;
2193
2206
  dh = Math.min(dh, 360 - dh);
2194
- out[i] = _chunkD37BX2ZAcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2207
+ out[i] = _chunkMGL4U5WAcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2195
2208
  }
2196
- return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2209
+ return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2197
2210
  }
2198
2211
 
2199
2212
  // src/image-editor/selection/refine.ts
@@ -2327,9 +2340,9 @@ function edgeWidth(guide, w, h, r) {
2327
2340
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2328
2341
  }
2329
2342
  }
2330
- const gm = _chunkD37BX2ZAcjs.greyMorphology.call(void 0, g, w, h, r, true);
2331
- const hi = _chunkD37BX2ZAcjs.greyMorphology.call(void 0, y, w, h, r, true);
2332
- const lo = _chunkD37BX2ZAcjs.greyMorphology.call(void 0, y, w, h, r, false);
2343
+ const gm = _chunkMGL4U5WAcjs.greyMorphology.call(void 0, g, w, h, r, true);
2344
+ const hi = _chunkMGL4U5WAcjs.greyMorphology.call(void 0, y, w, h, r, true);
2345
+ const lo = _chunkMGL4U5WAcjs.greyMorphology.call(void 0, y, w, h, r, false);
2333
2346
  const out = new Float32Array(n);
2334
2347
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2335
2348
  return out;
@@ -2353,7 +2366,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2353
2366
  }
2354
2367
  }
2355
2368
  if (any) {
2356
- const dist = _chunkD37BX2ZAcjs.distanceTransform.call(void 0, boundary, w, h);
2369
+ const dist = _chunkMGL4U5WAcjs.distanceTransform.call(void 0, boundary, w, h);
2357
2370
  const r = gfRadius(p);
2358
2371
  const q = guidedFilterColor(guide, m, w, h, r);
2359
2372
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2369,17 +2382,17 @@ function refineCoverage(guide, m, w, h, params = {}) {
2369
2382
  }
2370
2383
  const ss = smoothSigma(p);
2371
2384
  if (ss >= 0.3) {
2372
- a = _chunkAZTZRLDIcjs.gaussianBlur.call(void 0, a, w, h, ss, "clamp");
2385
+ a = _chunkPOGBUYWEcjs.gaussianBlur.call(void 0, a, w, h, ss, "clamp");
2373
2386
  const gain = 1 + ss;
2374
2387
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2375
2388
  }
2376
- a = _chunkAZTZRLDIcjs.gaussianBlur.call(void 0, a, w, h, featherSigma(p), "clamp");
2389
+ a = _chunkPOGBUYWEcjs.gaussianBlur.call(void 0, a, w, h, featherSigma(p), "clamp");
2377
2390
  if (p.contrast > 0) {
2378
2391
  const gain = 1 / (1 - 0.99 * p.contrast / 100);
2379
2392
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2380
2393
  }
2381
2394
  const amount = shiftAmount(p);
2382
- if (Math.abs(amount) >= 1e-4) a = _chunkD37BX2ZAcjs.shiftCoverage.call(void 0, a, w, h, amount);
2395
+ if (Math.abs(amount) >= 1e-4) a = _chunkMGL4U5WAcjs.shiftCoverage.call(void 0, a, w, h, amount);
2383
2396
  return a;
2384
2397
  }
2385
2398
  function guidePlanes(pixels, win) {
@@ -2423,15 +2436,15 @@ function refineSelection(pixels, mask, params = {}) {
2423
2436
  const out = new Uint8Array(mask.width * mask.height);
2424
2437
  for (let y = 0; y < wh; y++) {
2425
2438
  const dst = (y0 + y) * mask.width + x0;
2426
- for (let x = 0; x < ww; x++) out[dst + x] = _chunkD37BX2ZAcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2439
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkMGL4U5WAcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2427
2440
  }
2428
- return _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2441
+ return _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2429
2442
  }
2430
2443
 
2431
2444
  // src/image-editor/free-transform.ts
2432
2445
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2433
2446
  var fail = (message) => {
2434
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(message);
2447
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(message);
2435
2448
  };
2436
2449
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
2437
2450
  function previewStep(scale) {
@@ -2442,12 +2455,12 @@ function toDoc(r, o) {
2442
2455
  return r ? { x: r.x + o.x, y: r.y + o.y, width: r.width, height: r.height } : null;
2443
2456
  }
2444
2457
  function selectionSurface(sel) {
2445
- return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: sel.width, height: sel.height, data: sel.data }, 1, 0, 0, 0);
2458
+ return _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: sel.width, height: sel.height, data: sel.data }, 1, 0, 0, 0);
2446
2459
  }
2447
2460
  function liftPixels(surface, sel, o) {
2448
2461
  const sb = sel.bounds;
2449
2462
  const area = { x: sb.x - o.x, y: sb.y - o.y, width: sb.width, height: sb.height };
2450
- const px2 = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, area);
2463
+ const px2 = _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, area);
2451
2464
  const kept = new Uint8ClampedArray(px2);
2452
2465
  for (let y = 0; y < area.height; y++) {
2453
2466
  for (let x = 0; x < area.width; x++) {
@@ -2463,12 +2476,12 @@ function liftPixels(surface, sel, o) {
2463
2476
  if (!kept[i + 3]) kept[i] = kept[i + 1] = kept[i + 2] = 0;
2464
2477
  }
2465
2478
  }
2466
- return { lifted: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: px2 }, 4, area.x, area.y), rest: _chunkSZ6KMZNMcjs.writeRegion.call(void 0, surface, area, kept) };
2479
+ return { lifted: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: px2 }, 4, area.x, area.y), rest: _chunkXIOMMGPDcjs.writeRegion.call(void 0, surface, area, kept) };
2467
2480
  }
2468
2481
  function liftMask(mask, sel, o) {
2469
2482
  const sb = sel.bounds;
2470
2483
  const area = { x: sb.x - o.x, y: sb.y - o.y, width: sb.width, height: sb.height };
2471
- const v = _chunkSZ6KMZNMcjs.readRegion.call(void 0, mask, area);
2484
+ const v = _chunkXIOMMGPDcjs.readRegion.call(void 0, mask, area);
2472
2485
  const def = mask.defaultValue;
2473
2486
  const lifted = new Uint8ClampedArray(area.width * area.height * 4);
2474
2487
  const rest = new Uint8ClampedArray(v.length);
@@ -2484,12 +2497,12 @@ function liftMask(mask, sel, o) {
2484
2497
  rest[i] = g * (1 - k) + def * k;
2485
2498
  }
2486
2499
  }
2487
- return { lifted: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: lifted }, 4, area.x, area.y), rest: _chunkSZ6KMZNMcjs.writeRegion.call(void 0, mask, area, rest) };
2500
+ return { lifted: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: lifted }, 4, area.x, area.y), rest: _chunkXIOMMGPDcjs.writeRegion.call(void 0, mask, area, rest) };
2488
2501
  }
2489
2502
  var FreeTransformSession = (_class4 = class {
2490
2503
  constructor(host, init = {}) {;_class4.prototype.__init24.call(this);_class4.prototype.__init25.call(this);_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);
2491
2504
  this.host = host;
2492
- if (init.interpolation !== void 0 && !_chunkAZTZRLDIcjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
2505
+ if (init.interpolation !== void 0 && !_chunkPOGBUYWEcjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
2493
2506
  this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
2494
2507
  const sel = host.selection();
2495
2508
  const selected = Boolean(_optionalChain([sel, 'optionalAccess', _54 => _54.bounds]));
@@ -2498,7 +2511,7 @@ var FreeTransformSession = (_class4 = class {
2498
2511
  fail(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
2499
2512
  }
2500
2513
  const targetId = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
2501
- const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkAZTZRLDIcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _55 => _55.layer]) : void 0;
2514
+ const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _55 => _55.layer]) : void 0;
2502
2515
  const smartTarget = (_optionalChain([target, 'optionalAccess', _56 => _56.type]) === "smart" || _optionalChain([target, 'optionalAccess', _57 => _57.type]) === "shape") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
2503
2516
  if (content === "auto") content = selected && !smartTarget ? "selection" : "layer";
2504
2517
  this.content = content;
@@ -2518,7 +2531,7 @@ var FreeTransformSession = (_class4 = class {
2518
2531
  } else {
2519
2532
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
2520
2533
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
2521
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, layers, id).layer;
2534
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, layers, id).layer;
2522
2535
  this.layerId = layer.id;
2523
2536
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
2524
2537
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -2529,20 +2542,20 @@ var FreeTransformSession = (_class4 = class {
2529
2542
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape and smart object layers, layer masks (channel mask) and selections.`);
2530
2543
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
2531
2544
  if (content !== "selection-copy") {
2532
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
2533
- if (!maskAlone) _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
2545
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
2546
+ if (!maskAlone) _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
2534
2547
  }
2535
2548
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
2536
2549
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
2537
2550
  if (layer.type === "smart" && !maskAlone) {
2538
2551
  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).`);
2539
- if (!_chunkD37BX2ZAcjs.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.`);
2552
+ if (!_chunkMGL4U5WAcjs.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.`);
2540
2553
  this.smart = layer;
2541
2554
  this.smartObject = true;
2542
- this.startGeometry = _chunkD37BX2ZAcjs.placementGeometry.call(void 0, layer);
2555
+ this.startGeometry = _chunkMGL4U5WAcjs.placementGeometry.call(void 0, layer);
2543
2556
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
2544
2557
  this.startInterp = this.interp;
2545
- this.box = _chunkD37BX2ZAcjs.contentsBox.call(void 0, layer.contents);
2558
+ this.box = _chunkMGL4U5WAcjs.contentsBox.call(void 0, layer.contents);
2546
2559
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
2547
2560
  this.geometryValue = this.startGeometry;
2548
2561
  this.shown = this.startLayers;
@@ -2550,7 +2563,7 @@ var FreeTransformSession = (_class4 = class {
2550
2563
  }
2551
2564
  if (layer.type === "shape" && !maskAlone) {
2552
2565
  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).`);
2553
- const g = _chunkD37BX2ZAcjs.shapeGeometryBounds.call(void 0, layer);
2566
+ const g = _chunkMGL4U5WAcjs.shapeGeometryBounds.call(void 0, layer);
2554
2567
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
2555
2568
  const w = Math.max(g.width, 1);
2556
2569
  const h = Math.max(g.height, 1);
@@ -2567,26 +2580,26 @@ var FreeTransformSession = (_class4 = class {
2567
2580
  if (content === "selection") {
2568
2581
  const { lifted, rest } = liftMask(mask.surface, sel, o);
2569
2582
  this.parts.push({ what: "mask", offset: o, moving: lifted, base: rest, reduced: /* @__PURE__ */ new Map() });
2570
- box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, lifted), o);
2583
+ box = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, lifted), o);
2571
2584
  } else {
2572
2585
  this.parts.push({ what: "mask", offset: o, moving: mask.surface, base: null, reduced: /* @__PURE__ */ new Map() });
2573
- box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface), o);
2586
+ box = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, mask.surface), o);
2574
2587
  }
2575
2588
  moves.push("mask");
2576
2589
  } else if (content === "layer") {
2577
2590
  this.parts.push({ what: "pixels", offset: o, moving: pixels, base: null, reduced: /* @__PURE__ */ new Map() });
2578
2591
  moves.push("pixels");
2579
- box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, pixels), o);
2592
+ box = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, pixels), o);
2580
2593
  if (mask && linked) {
2581
2594
  this.parts.push({ what: "mask", offset: o, moving: mask.surface, base: null, reduced: /* @__PURE__ */ new Map() });
2582
2595
  moves.push("mask");
2583
- if (!box) box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface), o);
2596
+ if (!box) box = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, mask.surface), o);
2584
2597
  }
2585
2598
  } else if (content === "selection") {
2586
2599
  const { lifted, rest } = liftPixels(pixels, sel, o);
2587
2600
  this.parts.push({ what: "pixels", offset: o, moving: lifted, base: rest, reduced: /* @__PURE__ */ new Map() });
2588
2601
  moves.push("pixels");
2589
- box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, lifted), o);
2602
+ box = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, lifted), o);
2590
2603
  if (mask && linked) {
2591
2604
  const m = liftMask(mask.surface, sel, o);
2592
2605
  this.parts.push({ what: "mask", offset: o, moving: m.lifted, base: m.rest, reduced: /* @__PURE__ */ new Map() });
@@ -2594,11 +2607,11 @@ var FreeTransformSession = (_class4 = class {
2594
2607
  }
2595
2608
  } else {
2596
2609
  const { lifted } = liftPixels(pixels, sel, o);
2597
- box = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, lifted), o);
2610
+ box = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, lifted), o);
2598
2611
  if (box) {
2599
2612
  const copy = {
2600
2613
  type: "pixel",
2601
- id: _chunkD37BX2ZAcjs.newLayerId.call(void 0, ),
2614
+ id: _chunkMGL4U5WAcjs.newLayerId.call(void 0, ),
2602
2615
  name: `${layer.name || "Layer"} copy`,
2603
2616
  visible: true,
2604
2617
  opacity: 1,
@@ -2607,8 +2620,8 @@ var FreeTransformSession = (_class4 = class {
2607
2620
  offset: { ...o }
2608
2621
  };
2609
2622
  this.copyId = copy.id;
2610
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, layers, layer.id);
2611
- this.startLayers = _chunkAZTZRLDIcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _61 => _61.parent, 'optionalAccess', _62 => _62.id]), () => ( null)), loc.index + 1);
2623
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, layer.id);
2624
+ this.startLayers = _chunkPOGBUYWEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _61 => _61.parent, 'optionalAccess', _62 => _62.id]), () => ( null)), loc.index + 1);
2612
2625
  this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
2613
2626
  moves.push("pixels");
2614
2627
  }
@@ -2622,7 +2635,7 @@ var FreeTransformSession = (_class4 = class {
2622
2635
  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).");
2623
2636
  this.box = box;
2624
2637
  this.moves = moves;
2625
- this.startGeometry = _chunkD37BX2ZAcjs.identityTransform.call(void 0, box);
2638
+ this.startGeometry = _chunkMGL4U5WAcjs.identityTransform.call(void 0, box);
2626
2639
  this.startInterp = this.interp;
2627
2640
  this.geometryValue = this.startGeometry;
2628
2641
  this.shown = this.startLayers;
@@ -2688,7 +2701,7 @@ var FreeTransformSession = (_class4 = class {
2688
2701
  update(changes, preview = {}) {
2689
2702
  this.check();
2690
2703
  if (changes.interpolation !== void 0) {
2691
- if (!_chunkAZTZRLDIcjs.isInterpolation.call(void 0, changes.interpolation)) fail(`Unknown interpolation "${String(changes.interpolation)}"; use nearest, bilinear or bicubic.`);
2704
+ if (!_chunkPOGBUYWEcjs.isInterpolation.call(void 0, changes.interpolation)) fail(`Unknown interpolation "${String(changes.interpolation)}"; use nearest, bilinear or bicubic.`);
2692
2705
  this.interp = changes.interpolation;
2693
2706
  }
2694
2707
  const next = {
@@ -2697,7 +2710,7 @@ var FreeTransformSession = (_class4 = class {
2697
2710
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
2698
2711
  };
2699
2712
  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.");
2700
- if (!_chunkD37BX2ZAcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
2713
+ if (!_chunkMGL4U5WAcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
2701
2714
  this.geometryValue = next;
2702
2715
  if (preview !== false) this.render(preview);
2703
2716
  return next;
@@ -2706,10 +2719,10 @@ var FreeTransformSession = (_class4 = class {
2706
2719
  resample(final, preview = {}) {
2707
2720
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
2708
2721
  const g = this.geometryValue;
2709
- const identity = _chunkD37BX2ZAcjs.isIdentityTransform.call(void 0, g);
2710
- const warp = _chunkD37BX2ZAcjs.hasWarp.call(void 0, g);
2711
- const h = warp ? null : _chunkD37BX2ZAcjs.geometryHomography.call(void 0, g);
2712
- const f = warp ? _chunkD37BX2ZAcjs.transformMap.call(void 0, g) : null;
2722
+ const identity = _chunkMGL4U5WAcjs.isIdentityTransform.call(void 0, g);
2723
+ const warp = _chunkMGL4U5WAcjs.hasWarp.call(void 0, g);
2724
+ const h = warp ? null : _chunkMGL4U5WAcjs.geometryHomography.call(void 0, g);
2725
+ const f = warp ? _chunkMGL4U5WAcjs.transformMap.call(void 0, g) : null;
2713
2726
  const step = final ? 1 : previewStep(preview.scale);
2714
2727
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
2715
2728
  let layers = this.startLayers;
@@ -2727,7 +2740,7 @@ var FreeTransformSession = (_class4 = class {
2727
2740
  k = step;
2728
2741
  let r = part.reduced.get(k);
2729
2742
  if (!r) {
2730
- r = _chunkAZTZRLDIcjs.reduceSurface.call(void 0, part.moving, k);
2743
+ r = _chunkPOGBUYWEcjs.reduceSurface.call(void 0, part.moving, k);
2731
2744
  part.reduced.set(k, r);
2732
2745
  }
2733
2746
  src = r;
@@ -2736,33 +2749,33 @@ var FreeTransformSession = (_class4 = class {
2736
2749
  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 };
2737
2750
  try {
2738
2751
  if (f) {
2739
- moved = _chunkAZTZRLDIcjs.warpSurface.call(void 0, src, (p) => {
2752
+ moved = _chunkPOGBUYWEcjs.warpSurface.call(void 0, src, (p) => {
2740
2753
  const q = f({ x: p.x * k + o.x, y: p.y * k + o.y });
2741
2754
  return q && { x: q.x - o.x, y: q.y - o.y };
2742
2755
  }, opts);
2743
2756
  } else {
2744
2757
  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));
2745
- moved = _chunkAZTZRLDIcjs.transformSurface.call(void 0, src, hl, opts);
2758
+ moved = _chunkPOGBUYWEcjs.transformSurface.call(void 0, src, hl, opts);
2746
2759
  }
2747
2760
  } catch (e) {
2748
- if (e instanceof _chunkAZTZRLDIcjs.TransformTooLargeError) fail(e.message);
2761
+ if (e instanceof _chunkPOGBUYWEcjs.TransformTooLargeError) fail(e.message);
2749
2762
  throw e;
2750
2763
  }
2751
2764
  }
2752
- const result = part.base ? _chunkAZTZRLDIcjs.compositeSurfaceOver.call(void 0, part.base, moved) : moved;
2765
+ const result = part.base ? _chunkPOGBUYWEcjs.compositeSurfaceOver.call(void 0, part.base, moved) : moved;
2753
2766
  if (part.what === "selection") {
2754
2767
  const { width, height } = this.host.canvas();
2755
- const data = new Uint8Array(_chunkSZ6KMZNMcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
2756
- const next = _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, width, height, data);
2768
+ const data = new Uint8Array(_chunkXIOMMGPDcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
2769
+ const next = _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, width, height, data);
2757
2770
  selection = next.bounds ? next : null;
2758
2771
  } else if (part.what === "pixels") {
2759
- layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, targetId, (l) => {
2772
+ layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
2760
2773
  const next = { ...l, surface: result };
2761
2774
  delete next.source;
2762
2775
  return next;
2763
2776
  });
2764
2777
  } else {
2765
- layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, targetId, (l) => ({ ...l, mask: { ...l.mask, surface: result } }));
2778
+ layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, targetId, (l) => ({ ...l, mask: { ...l.mask, surface: result } }));
2766
2779
  }
2767
2780
  }
2768
2781
  return { layers, selection };
@@ -2775,15 +2788,15 @@ var FreeTransformSession = (_class4 = class {
2775
2788
  resampleShape(final, preview, warpMap, h) {
2776
2789
  const layer = this.shape;
2777
2790
  let components = layer.components;
2778
- if (!_chunkD37BX2ZAcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
2791
+ if (!_chunkMGL4U5WAcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
2779
2792
  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;
2780
2793
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
2781
- components = _chunkD37BX2ZAcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
2794
+ components = _chunkMGL4U5WAcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
2782
2795
  }
2783
2796
  const moved = { ...layer, components };
2784
2797
  delete moved.annotation;
2785
- const surface = _chunkD37BX2ZAcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
2786
- return _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
2798
+ const surface = _chunkMGL4U5WAcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
2799
+ return _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
2787
2800
  }
2788
2801
  /** A smart object re-rendered from its contents for the current geometry (previews leave the smart filters out). */
2789
2802
  resampleSmart(final, preview) {
@@ -2793,25 +2806,25 @@ var FreeTransformSession = (_class4 = class {
2793
2806
  const canvas = this.host.canvas();
2794
2807
  try {
2795
2808
  if (final) {
2796
- const res = _chunkD37BX2ZAcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
2809
+ const res = _chunkMGL4U5WAcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
2797
2810
  this.smartMasksMoved = res.masksMoved;
2798
2811
  return res.layers;
2799
2812
  }
2800
2813
  const step = previewStep(preview.scale);
2801
- const surface = _chunkD37BX2ZAcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
2802
- return _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
2814
+ const surface = _chunkMGL4U5WAcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
2815
+ return _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
2803
2816
  } catch (e) {
2804
- if (e instanceof _chunkAZTZRLDIcjs.TransformTooLargeError) fail(e.message);
2817
+ if (e instanceof _chunkPOGBUYWEcjs.TransformTooLargeError) fail(e.message);
2805
2818
  throw e;
2806
2819
  }
2807
2820
  }
2808
2821
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
2809
2822
  isChanged() {
2810
2823
  const g = this.geometryValue;
2811
- if (!this.smart) return !_chunkD37BX2ZAcjs.isIdentityTransform.call(void 0, g);
2824
+ if (!this.smart) return !_chunkMGL4U5WAcjs.isIdentityTransform.call(void 0, g);
2812
2825
  const a = this.startGeometry;
2813
2826
  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);
2814
- const warp = (w, box) => w && _chunkD37BX2ZAcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
2827
+ const warp = (w, box) => w && _chunkMGL4U5WAcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
2815
2828
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
2816
2829
  }
2817
2830
  render(preview) {
@@ -2843,10 +2856,10 @@ var FreeTransformSession = (_class4 = class {
2843
2856
  result(changed, layers, selection) {
2844
2857
  let bounds = null;
2845
2858
  const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
2846
- const layer = id ? _optionalChain([_chunkAZTZRLDIcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _63 => _63.layer]) : void 0;
2847
- if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _64 => _64.type]) === "pixel") bounds = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
2848
- else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _65 => _65.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _66 => _66.type]) === "shape")) bounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.surface);
2849
- else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _67 => _67.mask])) bounds = toDoc(_chunkSZ6KMZNMcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
2859
+ const layer = id ? _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _63 => _63.layer]) : void 0;
2860
+ if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _64 => _64.type]) === "pixel") bounds = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
2861
+ else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _65 => _65.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _66 => _66.type]) === "shape")) bounds = _chunkXIOMMGPDcjs.contentBounds.call(void 0, layer.surface);
2862
+ else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _67 => _67.mask])) bounds = toDoc(_chunkXIOMMGPDcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
2850
2863
  else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _68 => _68.bounds]) ? { ...selection.bounds } : null;
2851
2864
  return {
2852
2865
  layerId: _nullishCoalesce(this.copyId, () => ( this.layerId)),
@@ -2861,26 +2874,26 @@ var FreeTransformSession = (_class4 = class {
2861
2874
  }, _class4);
2862
2875
 
2863
2876
  // src/image-editor/controller.ts
2864
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION;
2877
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION;
2865
2878
  function paintCoverageInto(base, coverage, apply, rects) {
2866
2879
  const tiles = new Map(base.tiles);
2867
2880
  const done = /* @__PURE__ */ new Set();
2868
2881
  for (const r of rects) {
2869
- for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, { x: r.x - apply.offset.x, y: r.y - apply.offset.y, width: r.width, height: r.height })) {
2870
- const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, t.tx, t.ty);
2882
+ for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, { x: r.x - apply.offset.x, y: r.y - apply.offset.y, width: r.width, height: r.height })) {
2883
+ const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, t.tx, t.ty);
2871
2884
  if (done.has(key)) continue;
2872
2885
  done.add(key);
2873
2886
  const src = _nullishCoalesce(_optionalChain([base, 'access', _69 => _69.tiles, 'access', _70 => _70.get, 'call', _71 => _71(key), 'optionalAccess', _72 => _72.data]), () => ( defaultTile(base)));
2874
- const data = _chunkHUFQD4CBcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
2875
- const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
2887
+ const data = _chunk7VOHOPLWcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
2888
+ const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
2876
2889
  if (tile) tiles.set(key, tile);
2877
2890
  else tiles.delete(key);
2878
2891
  }
2879
2892
  }
2880
- return new (0, _chunkSZ6KMZNMcjs.TiledSurface)(base.channels, tiles, base.defaultValue);
2893
+ return new (0, _chunkXIOMMGPDcjs.TiledSurface)(base.channels, tiles, base.defaultValue);
2881
2894
  }
2882
2895
  function defaultTile(s) {
2883
- const d = new Uint8ClampedArray(_chunkSZ6KMZNMcjs.TILE * _chunkSZ6KMZNMcjs.TILE * s.channels);
2896
+ const d = new Uint8ClampedArray(_chunkXIOMMGPDcjs.TILE * _chunkXIOMMGPDcjs.TILE * s.channels);
2884
2897
  if (s.defaultValue) d.fill(s.defaultValue);
2885
2898
  return d;
2886
2899
  }
@@ -2892,7 +2905,7 @@ var PaintStrokeSession = (_class5 = class {
2892
2905
  this.before = controller._captureForStroke();
2893
2906
  this.base = target.surface;
2894
2907
  this.live = new Map(this.base.tiles);
2895
- if (stroke instanceof _chunkHUFQD4CBcjs.StrokeCoverage) {
2908
+ if (stroke instanceof _chunk7VOHOPLWcjs.StrokeCoverage) {
2896
2909
  this.stroke = stroke;
2897
2910
  this.mixer = null;
2898
2911
  } else {
@@ -2922,9 +2935,9 @@ var PaintStrokeSession = (_class5 = class {
2922
2935
  offset: a.offset,
2923
2936
  lockTransparency: a.lockTransparency,
2924
2937
  selection: a.selection,
2925
- readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _73 => _73.live, 'access', _74 => _74.get, 'call', _75 => _75(_chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _76 => _76.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
2938
+ readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _73 => _73.live, 'access', _74 => _74.get, 'call', _75 => _75(_chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _76 => _76.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
2926
2939
  writeTile: (tx, ty) => {
2927
- const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, tx, ty);
2940
+ const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, tx, ty);
2928
2941
  if (!this.touched.has(key)) {
2929
2942
  const src = _nullishCoalesce(_optionalChain([this, 'access', _77 => _77.base, 'access', _78 => _78.tiles, 'access', _79 => _79.get, 'call', _80 => _80(key), 'optionalAccess', _81 => _81.data]), () => ( defaultTile(this.base)));
2930
2943
  this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
@@ -2950,30 +2963,30 @@ var PaintStrokeSession = (_class5 = class {
2950
2963
  if (this.mixer) {
2951
2964
  for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
2952
2965
  this.fresh.clear();
2953
- this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
2966
+ this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
2954
2967
  return;
2955
2968
  }
2956
2969
  const stroke = this.stroke;
2957
2970
  const regions = /* @__PURE__ */ new Map();
2958
2971
  for (const r of rects) {
2959
- for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
2960
- const key = _chunkSZ6KMZNMcjs.tileKey.call(void 0, t.tx, t.ty);
2972
+ for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
2973
+ const key = _chunkXIOMMGPDcjs.tileKey.call(void 0, t.tx, t.ty);
2961
2974
  const cur = regions.get(key);
2962
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkD37BX2ZAcjs.unionRect.call(void 0, cur.r, r) : r });
2975
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkMGL4U5WAcjs.unionRect.call(void 0, cur.r, r) : r });
2963
2976
  }
2964
2977
  }
2965
2978
  for (const [key, { tx, ty, r }] of regions) {
2966
2979
  const src = _nullishCoalesce(_optionalChain([this, 'access', _82 => _82.base, 'access', _83 => _83.tiles, 'access', _84 => _84.get, 'call', _85 => _85(key), 'optionalAccess', _86 => _86.data]), () => ( defaultTile(this.base)));
2967
2980
  const prev = this.touched.has(key) ? _optionalChain([this, 'access', _87 => _87.live, 'access', _88 => _88.get, 'call', _89 => _89(key), 'optionalAccess', _90 => _90.data]) : void 0;
2968
2981
  this.touched.add(key);
2969
- const data = _chunkHUFQD4CBcjs.applyStrokeToTile.call(void 0, stroke.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
2982
+ const data = _chunk7VOHOPLWcjs.applyStrokeToTile.call(void 0, stroke.coverage, src, ch, tx, ty, this.apply, prev ? { into: prev, region: r } : {});
2970
2983
  this.live.set(key, { data, uniform: null });
2971
2984
  }
2972
- this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
2985
+ this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
2973
2986
  }
2974
2987
  /** Finishes the stroke (one undo step) and returns what changed. */
2975
2988
  end() {
2976
- if (this.closed) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("This stroke has already ended.");
2989
+ if (this.closed) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("This stroke has already ended.");
2977
2990
  const last = _nullishCoalesce(this.last, () => ( void 0));
2978
2991
  this.update(this.mixer ? this.mixer.finish(last) : this.stroke.finish(last));
2979
2992
  this.closed = true;
@@ -2982,13 +2995,13 @@ var PaintStrokeSession = (_class5 = class {
2982
2995
  let changed = false;
2983
2996
  for (const key of this.touched) {
2984
2997
  const live = this.live.get(key);
2985
- const tile = _chunkSZ6KMZNMcjs.finishTile.call(void 0, live.data, ch, this.base.defaultValue);
2998
+ const tile = _chunkXIOMMGPDcjs.finishTile.call(void 0, live.data, ch, this.base.defaultValue);
2986
2999
  const prev = this.base.tiles.get(key);
2987
3000
  if (tile) tiles.set(key, tile);
2988
3001
  else tiles.delete(key);
2989
3002
  if (!sameTile(prev, tile)) changed = true;
2990
3003
  }
2991
- const surface = changed ? new (0, _chunkSZ6KMZNMcjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
3004
+ const surface = changed ? new (0, _chunkXIOMMGPDcjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
2992
3005
  const mixerLoad = this.mixer ? this.mixerInit.end(this.mixer.load) : void 0;
2993
3006
  this.controller._strokeCommit(this.before, this.target.id, this.target.channel, surface);
2994
3007
  const b = this.mixer ? this.mixer.bounds : this.stroke.coverage.bounds;
@@ -3010,20 +3023,20 @@ function sameTile(a, b) {
3010
3023
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
3011
3024
  return true;
3012
3025
  }
3013
- var DEFAULT_ADJUSTMENTS = _chunkD37BX2ZAcjs.DEFAULT_ADJUSTMENTS_VALUES;
3026
+ var DEFAULT_ADJUSTMENTS = _chunkMGL4U5WAcjs.DEFAULT_ADJUSTMENTS_VALUES;
3014
3027
  function normalizeStoredAdjustments(stored) {
3015
3028
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
3016
3029
  const out = {
3017
3030
  ...DEFAULT_ADJUSTMENTS,
3018
3031
  ...stored,
3019
- process: _chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, stored.process)
3032
+ process: _chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, stored.process)
3020
3033
  };
3021
- const layers = _chunkD37BX2ZAcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
3034
+ const layers = _chunkMGL4U5WAcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
3022
3035
  if (layers.length) out.layers = layers;
3023
3036
  else delete out.layers;
3024
3037
  return out;
3025
3038
  }
3026
- var isLayered = (data) => Boolean(data && data.version === _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
3039
+ var isLayered = (data) => Boolean(data && data.version === _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
3027
3040
  function migrateSerializedImageEditorState(data) {
3028
3041
  if (isLayered(data)) {
3029
3042
  const out = {
@@ -3055,10 +3068,10 @@ function migrateSerializedImageEditorState(data) {
3055
3068
  function migrateToLayeredState(data, size) {
3056
3069
  const clean = migrateSerializedImageEditorState(data);
3057
3070
  if (isLayered(clean)) return clean;
3058
- const stack = _chunkD37BX2ZAcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
3059
- const { layers, assets } = _chunkD37BX2ZAcjs.serializeLayers.call(void 0, stack.layers);
3071
+ const stack = _chunkMGL4U5WAcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
3072
+ const { layers, assets } = _chunkMGL4U5WAcjs.serializeLayers.call(void 0, stack.layers);
3060
3073
  const out = {
3061
- version: _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION,
3074
+ version: _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION,
3062
3075
  width: Math.round(size.width),
3063
3076
  height: Math.round(size.height),
3064
3077
  layers,
@@ -3072,8 +3085,8 @@ function migrateToLayeredState(data, size) {
3072
3085
  if (clean.selection) out.selection = clean.selection;
3073
3086
  return out;
3074
3087
  }
3075
- var DEFAULT_TRANSFORM = _chunkD37BX2ZAcjs.DEFAULT_TRANSFORM_VALUES;
3076
- var DEFAULT_DEPTH_MASK = _chunkD37BX2ZAcjs.DEFAULT_DEPTH_MASK_VALUES;
3088
+ var DEFAULT_TRANSFORM = _chunkMGL4U5WAcjs.DEFAULT_TRANSFORM_VALUES;
3089
+ var DEFAULT_DEPTH_MASK = _chunkMGL4U5WAcjs.DEFAULT_DEPTH_MASK_VALUES;
3077
3090
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
3078
3091
  var ImageEditorController = (_class6 = class {
3079
3092
 
@@ -3096,7 +3109,7 @@ var ImageEditorController = (_class6 = class {
3096
3109
  __init46() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
3097
3110
  __init47() {this.viewKey = []}
3098
3111
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
3099
- __init48() {this.compositor = new (0, _chunkD37BX2ZAcjs.LayerCompositor)()}
3112
+ __init48() {this.compositor = new (0, _chunkMGL4U5WAcjs.LayerCompositor)()}
3100
3113
  constructor(options = {}) {;_class6.prototype.__init38.call(this);_class6.prototype.__init39.call(this);_class6.prototype.__init40.call(this);_class6.prototype.__init41.call(this);_class6.prototype.__init42.call(this);_class6.prototype.__init43.call(this);_class6.prototype.__init44.call(this);_class6.prototype.__init45.call(this);_class6.prototype.__init46.call(this);_class6.prototype.__init47.call(this);_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);
3101
3114
  this.maxHistoryDepth = _nullishCoalesce(options.maxHistoryDepth, () => ( 50));
3102
3115
  this.maxHistoryBytes = _nullishCoalesce(options.maxHistoryBytes, () => ( 512 * 1024 * 1024));
@@ -3131,7 +3144,7 @@ var ImageEditorController = (_class6 = class {
3131
3144
  activeLayerId: null,
3132
3145
  activeTarget: "pixels",
3133
3146
  outputOpacity: 1,
3134
- paint: { brush: { ..._chunkHUFQD4CBcjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", mixer: { ..._chunkHUFQD4CBcjs.DEFAULT_MIXER }, mixerLoad: _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD },
3147
+ paint: { brush: { ..._chunk7VOHOPLWcjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", mixer: { ..._chunk7VOHOPLWcjs.DEFAULT_MIXER }, mixerLoad: _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD },
3135
3148
  fit: _nullishCoalesce(options.fit, () => ( "margin"))
3136
3149
  };
3137
3150
  if (options.image instanceof Object && "width" in options.image) {
@@ -3145,7 +3158,7 @@ var ImageEditorController = (_class6 = class {
3145
3158
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
3146
3159
  if (_optionalChain([options, 'access', _99 => _99.initialState, 'optionalAccess', _100 => _100.selection])) {
3147
3160
  try {
3148
- this.state.selection = normalizeSelection(_chunkD37BX2ZAcjs.deserializeSelection.call(void 0, options.initialState.selection));
3161
+ this.state.selection = normalizeSelection(_chunkMGL4U5WAcjs.deserializeSelection.call(void 0, options.initialState.selection));
3149
3162
  } catch (e12) {
3150
3163
  }
3151
3164
  }
@@ -3237,7 +3250,7 @@ var ImageEditorController = (_class6 = class {
3237
3250
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
3238
3251
  this.viewKey = key;
3239
3252
  const { width, height } = this.naturalSize;
3240
- const view = _chunkD37BX2ZAcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
3253
+ const view = _chunkMGL4U5WAcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
3241
3254
  s.adjustments = view.adjustments;
3242
3255
  s.depthMask = view.depthMask;
3243
3256
  s.annotations = view.annotations;
@@ -3382,7 +3395,7 @@ var ImageEditorController = (_class6 = class {
3382
3395
  applyCropPreset(ratio) {
3383
3396
  this.recordHistory();
3384
3397
  const { width, height } = this.state.imageDimensions;
3385
- if (ratio && _chunkD37BX2ZAcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
3398
+ if (ratio && _chunkMGL4U5WAcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
3386
3399
  ratio = 1 / ratio;
3387
3400
  }
3388
3401
  if (!ratio) {
@@ -3438,7 +3451,7 @@ var ImageEditorController = (_class6 = class {
3438
3451
  return this.state.layers;
3439
3452
  }
3440
3453
  getLayer(id) {
3441
- return _optionalChain([_chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _103 => _103.layer]);
3454
+ return _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _103 => _103.layer]);
3442
3455
  }
3443
3456
  /** The active layer, or `undefined`. */
3444
3457
  getActiveLayer() {
@@ -3464,11 +3477,11 @@ var ImageEditorController = (_class6 = class {
3464
3477
  */
3465
3478
  getLayerPixels(id) {
3466
3479
  const layer = this.getLayer(id);
3467
- if (!layer || !_chunkD37BX2ZAcjs.hasSurface.call(void 0, layer)) return null;
3480
+ if (!layer || !_chunkMGL4U5WAcjs.hasSurface.call(void 0, layer)) return null;
3468
3481
  const surface = this.surfaceOf(layer);
3469
- const b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, surface);
3482
+ const b = _chunkXIOMMGPDcjs.contentBounds.call(void 0, surface);
3470
3483
  if (!b) return null;
3471
- return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data: _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, b) };
3484
+ return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data: _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, b) };
3472
3485
  }
3473
3486
  __init50() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
3474
3487
  /**
@@ -3477,11 +3490,11 @@ var ImageEditorController = (_class6 = class {
3477
3490
  */
3478
3491
  getLayerBounds(id) {
3479
3492
  const layer = this.getLayer(id);
3480
- if (!layer || !_chunkD37BX2ZAcjs.hasSurface.call(void 0, layer)) return null;
3493
+ if (!layer || !_chunkMGL4U5WAcjs.hasSurface.call(void 0, layer)) return null;
3481
3494
  const surface = this.surfaceOf(layer);
3482
3495
  let b = this.boundsCache.get(surface);
3483
3496
  if (b === void 0) {
3484
- b = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, surface);
3497
+ b = _chunkXIOMMGPDcjs.contentBounds.call(void 0, surface);
3485
3498
  this.boundsCache.set(surface, b);
3486
3499
  }
3487
3500
  return b ? { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height } : null;
@@ -3492,9 +3505,9 @@ var ImageEditorController = (_class6 = class {
3492
3505
  */
3493
3506
  getLayerDataURL(id) {
3494
3507
  const layer = this.getLayer(id);
3495
- if (!layer || !_chunkD37BX2ZAcjs.hasSurface.call(void 0, layer)) return null;
3508
+ if (!layer || !_chunkMGL4U5WAcjs.hasSurface.call(void 0, layer)) return null;
3496
3509
  const surface = this.surfaceOf(layer);
3497
- const enc = _chunkD37BX2ZAcjs.encodeSurface.call(void 0, surface);
3510
+ const enc = _chunkMGL4U5WAcjs.encodeSurface.call(void 0, surface);
3498
3511
  return enc ? enc.url : null;
3499
3512
  }
3500
3513
  /**
@@ -3508,7 +3521,7 @@ var ImageEditorController = (_class6 = class {
3508
3521
  let layers = this.state.layers;
3509
3522
  if (options.layerIds) {
3510
3523
  const keep = new Set(options.layerIds);
3511
- layers = _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers).filter((l) => keep.has(l.id) && l.type !== "group");
3524
+ layers = _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers).filter((l) => keep.has(l.id) && l.type !== "group");
3512
3525
  }
3513
3526
  const data = this.compositor.composite(layers, r, this.compositorSources());
3514
3527
  return { width: r.width, height: r.height, data };
@@ -3551,7 +3564,7 @@ var ImageEditorController = (_class6 = class {
3551
3564
  const fromPixels = (px3) => {
3552
3565
  let s = this.sourceSurfaces.get(px3);
3553
3566
  if (!s) {
3554
- s = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, px3, 4);
3567
+ s = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, px3, 4);
3555
3568
  this.sourceSurfaces.set(px3, s);
3556
3569
  }
3557
3570
  return s;
@@ -3566,7 +3579,7 @@ var ImageEditorController = (_class6 = class {
3566
3579
  const decoded = this.decodeSource();
3567
3580
  if (decoded) {
3568
3581
  if (!this.samplePixelsOverride) this.samplePixels = decoded;
3569
- const s = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, decoded, 4);
3582
+ const s = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, decoded, 4);
3570
3583
  this.sourceSurfaces.set(el, s);
3571
3584
  this.sourceSurfaces.set(decoded, s);
3572
3585
  return s;
@@ -3610,7 +3623,7 @@ var ImageEditorController = (_class6 = class {
3610
3623
  if (commitToHistory) this.recordHistory();
3611
3624
  this.state.layers = next;
3612
3625
  _optionalChain([extra, 'optionalCall', _113 => _113()]);
3613
- if (this.state.activeLayerId && !_chunkAZTZRLDIcjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
3626
+ if (this.state.activeLayerId && !_chunkPOGBUYWEcjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
3614
3627
  this.state.activeLayerId = null;
3615
3628
  this.state.activeTarget = "pixels";
3616
3629
  }
@@ -3619,7 +3632,7 @@ var ImageEditorController = (_class6 = class {
3619
3632
  /** The default position of a new layer: above the active layer, else the top of the stack. */
3620
3633
  newLayerPlacement(placement) {
3621
3634
  if (placement.aboveId || placement.belowId || placement.parentId || placement.index !== void 0) return placement;
3622
- const active = this.state.activeLayerId ? _chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId) : null;
3635
+ const active = this.state.activeLayerId ? _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId) : null;
3623
3636
  return active ? { aboveId: active.layer.id } : {};
3624
3637
  }
3625
3638
  /**
@@ -3629,23 +3642,23 @@ var ImageEditorController = (_class6 = class {
3629
3642
  */
3630
3643
  addPixelLayer(init = {}) {
3631
3644
  const { width, height } = this.naturalSize;
3632
- let surface = _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 4);
3645
+ let surface = _chunkXIOMMGPDcjs.emptySurface.call(void 0, 4);
3633
3646
  if (init.pixels) {
3634
3647
  const px2 = init.pixels;
3635
3648
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
3636
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
3649
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
3637
3650
  }
3638
- surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, px2, 4);
3651
+ surface = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, px2, 4);
3639
3652
  } else if (init.color !== void 0) {
3640
3653
  const c = parseColor(init.color);
3641
- surface = _chunkSZ6KMZNMcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkSZ6KMZNMcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
3654
+ surface = _chunkXIOMMGPDcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkXIOMMGPDcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
3642
3655
  }
3643
- const blend = _chunkD37BX2ZAcjs.parseBlend.call(void 0, init.blend);
3644
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("opacity must be from 0 to 1.");
3645
- const ids = new Set(_chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
3656
+ const blend = _chunkMGL4U5WAcjs.parseBlend.call(void 0, init.blend);
3657
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("opacity must be from 0 to 1.");
3658
+ const ids = new Set(_chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
3646
3659
  const layer = {
3647
3660
  type: "pixel",
3648
- id: init.id && !ids.has(init.id) ? init.id : _chunkD37BX2ZAcjs.newLayerId.call(void 0, ),
3661
+ id: init.id && !ids.has(init.id) ? init.id : _chunkMGL4U5WAcjs.newLayerId.call(void 0, ),
3649
3662
  name: _optionalChain([init, 'access', _114 => _114.name, 'optionalAccess', _115 => _115.trim, 'call', _116 => _116()]) || this.nextLayerName(),
3650
3663
  visible: _nullishCoalesce(init.visible, () => ( true)),
3651
3664
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -3654,7 +3667,7 @@ var ImageEditorController = (_class6 = class {
3654
3667
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
3655
3668
  };
3656
3669
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
3657
- const next = _chunkD37BX2ZAcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
3670
+ const next = _chunkMGL4U5WAcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
3658
3671
  this.commitLayers(next, () => {
3659
3672
  this.state.activeLayerId = layer.id;
3660
3673
  this.state.activeTarget = "pixels";
@@ -3673,46 +3686,46 @@ var ImageEditorController = (_class6 = class {
3673
3686
  async decodeImage(image) {
3674
3687
  const trimmed = image.trim();
3675
3688
  let png = null;
3676
- if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkAZTZRLDIcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _117 => _117.bytes]), () => ( null));
3689
+ if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkPOGBUYWEcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _117 => _117.bytes]), () => ( null));
3677
3690
  else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
3678
3691
  try {
3679
- const bytes = _chunkAZTZRLDIcjs.base64ToBytes.call(void 0, trimmed);
3680
- if (_chunkAZTZRLDIcjs.isPng.call(void 0, bytes)) png = bytes;
3692
+ const bytes = _chunkPOGBUYWEcjs.base64ToBytes.call(void 0, trimmed);
3693
+ if (_chunkPOGBUYWEcjs.isPng.call(void 0, bytes)) png = bytes;
3681
3694
  } catch (e15) {
3682
3695
  png = null;
3683
3696
  }
3684
3697
  }
3685
3698
  if (png) {
3686
3699
  try {
3687
- const d = _chunkAZTZRLDIcjs.decodePng.call(void 0, png);
3700
+ const d = _chunkPOGBUYWEcjs.decodePng.call(void 0, png);
3688
3701
  return { width: d.width, height: d.height, data: d.data };
3689
3702
  } catch (e16) {
3690
3703
  }
3691
3704
  }
3692
- const src = png ? `data:image/png;base64,${_chunkAZTZRLDIcjs.bytesToBase64.call(void 0, png)}` : trimmed;
3705
+ const src = png ? `data:image/png;base64,${_chunkPOGBUYWEcjs.bytesToBase64.call(void 0, png)}` : trimmed;
3693
3706
  let img;
3694
3707
  try {
3695
3708
  img = await this.renderer.imageCache.get(src);
3696
3709
  } catch (e17) {
3697
- throw new (0, _chunkD37BX2ZAcjs.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.");
3710
+ throw new (0, _chunkMGL4U5WAcjs.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.");
3698
3711
  }
3699
3712
  const w = img.naturalWidth || img.width;
3700
3713
  const h = img.naturalHeight || img.height;
3701
3714
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
3702
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
3715
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
3703
3716
  ctx.drawImage(img, 0, 0, w, h);
3704
3717
  const data = ctx.getImageData(0, 0, w, h);
3705
3718
  return { width: w, height: h, data: data.data };
3706
3719
  }
3707
3720
  nextLayerName() {
3708
- const names = new Set(_chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.name));
3721
+ const names = new Set(_chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.name));
3709
3722
  let n = 1;
3710
3723
  while (names.has(`Layer ${n}`)) n++;
3711
3724
  return `Layer ${n}`;
3712
3725
  }
3713
3726
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
3714
3727
  duplicateLayer(id, name) {
3715
- const res = _chunkD37BX2ZAcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
3728
+ const res = _chunkMGL4U5WAcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
3716
3729
  this.commitLayers(res.layers, () => {
3717
3730
  this.state.activeLayerId = res.id;
3718
3731
  });
@@ -3720,17 +3733,17 @@ var ImageEditorController = (_class6 = class {
3720
3733
  }
3721
3734
  /** Deletes a layer (refused when locked), as one undo step. */
3722
3735
  removeLayer(id) {
3723
- const next = _chunkD37BX2ZAcjs.removeLayer.call(void 0, this.state.layers, id);
3736
+ const next = _chunkMGL4U5WAcjs.removeLayer.call(void 0, this.state.layers, id);
3724
3737
  this.commitLayers(next, () => {
3725
- if (this.state.selectedAnnotationId && !_chunkAZTZRLDIcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkD37BX2ZAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _118 => _118.id]) === this.state.selectedAnnotationId)) {
3738
+ if (this.state.selectedAnnotationId && !_chunkPOGBUYWEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkMGL4U5WAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _118 => _118.id]) === this.state.selectedAnnotationId)) {
3726
3739
  this.state.selectedAnnotationId = null;
3727
3740
  }
3728
3741
  });
3729
3742
  }
3730
3743
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
3731
3744
  moveLayer(id, placement) {
3732
- const next = _chunkD37BX2ZAcjs.moveLayer.call(void 0, this.state.layers, id, placement);
3733
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, next, id);
3745
+ const next = _chunkMGL4U5WAcjs.moveLayer.call(void 0, this.state.layers, id, placement);
3746
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, next, id);
3734
3747
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _119 => _119.parent, 'optionalAccess', _120 => _120.id]), () => ( null)), index: loc.index };
3735
3748
  this.commitLayers(next);
3736
3749
  return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _121 => _121.parent, 'optionalAccess', _122 => _122.id]), () => ( null)), index: loc.index };
@@ -3740,23 +3753,23 @@ var ImageEditorController = (_class6 = class {
3740
3753
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
3741
3754
  */
3742
3755
  setLayerProperties(id, props, commitToHistory = true) {
3743
- const next = _chunkD37BX2ZAcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
3756
+ const next = _chunkMGL4U5WAcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
3744
3757
  this.commitLayers(next, void 0, commitToHistory);
3745
- return _chunkAZTZRLDIcjs.findLayer.call(void 0, next, id).layer;
3758
+ return _chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer;
3746
3759
  }
3747
3760
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
3748
3761
  addGroup(init = {}) {
3749
- const blend = init.blend === void 0 ? "pass-through" : _chunkD37BX2ZAcjs.parseBlend.call(void 0, init.blend, true);
3762
+ const blend = init.blend === void 0 ? "pass-through" : _chunkMGL4U5WAcjs.parseBlend.call(void 0, init.blend, true);
3750
3763
  const group = {
3751
3764
  type: "group",
3752
- id: _chunkD37BX2ZAcjs.newLayerId.call(void 0, "group"),
3765
+ id: _chunkMGL4U5WAcjs.newLayerId.call(void 0, "group"),
3753
3766
  name: _optionalChain([init, 'access', _123 => _123.name, 'optionalAccess', _124 => _124.trim, 'call', _125 => _125()]) || "Group",
3754
3767
  visible: true,
3755
3768
  opacity: 1,
3756
3769
  blend,
3757
3770
  children: []
3758
3771
  };
3759
- const next = _chunkD37BX2ZAcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
3772
+ const next = _chunkMGL4U5WAcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
3760
3773
  this.commitLayers(next, () => {
3761
3774
  this.state.activeLayerId = group.id;
3762
3775
  this.state.activeTarget = "pixels";
@@ -3765,7 +3778,7 @@ var ImageEditorController = (_class6 = class {
3765
3778
  }
3766
3779
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
3767
3780
  groupLayers(ids, name) {
3768
- const res = _chunkD37BX2ZAcjs.groupLayers.call(void 0, this.state.layers, ids, name);
3781
+ const res = _chunkMGL4U5WAcjs.groupLayers.call(void 0, this.state.layers, ids, name);
3769
3782
  this.commitLayers(res.layers, () => {
3770
3783
  this.state.activeLayerId = res.id;
3771
3784
  });
@@ -3773,7 +3786,7 @@ var ImageEditorController = (_class6 = class {
3773
3786
  }
3774
3787
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
3775
3788
  ungroupLayer(id) {
3776
- const res = _chunkD37BX2ZAcjs.ungroupLayer.call(void 0, this.state.layers, id);
3789
+ const res = _chunkMGL4U5WAcjs.ungroupLayer.call(void 0, this.state.layers, id);
3777
3790
  this.commitLayers(res.layers);
3778
3791
  return res.ids;
3779
3792
  }
@@ -3782,33 +3795,33 @@ var ImageEditorController = (_class6 = class {
3782
3795
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
3783
3796
  */
3784
3797
  offsetLayer(id, move, commitToHistory = true) {
3785
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3798
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3786
3799
  if (layer.type === "smart") {
3787
3800
  const tl = layer.placement.corners[0];
3788
3801
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
3789
3802
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
3790
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("x and y must be numbers.");
3791
- this.commitLayers(_chunkD37BX2ZAcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
3792
- const moved = _chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, id).layer;
3803
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("x and y must be numbers.");
3804
+ this.commitLayers(_chunkMGL4U5WAcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
3805
+ const moved = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, id).layer;
3793
3806
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
3794
3807
  }
3795
3808
  if (layer.type === "shape") {
3796
- const g = _nullishCoalesce(_chunkD37BX2ZAcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
3809
+ const g = _nullishCoalesce(_chunkMGL4U5WAcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
3797
3810
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
3798
3811
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
3799
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("x and y must be numbers.");
3800
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "position", "move it");
3801
- let moved = _chunkD37BX2ZAcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
3812
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("x and y must be numbers.");
3813
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "position", "move it");
3814
+ let moved = _chunkMGL4U5WAcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
3802
3815
  const mask = layer.mask;
3803
- if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
3804
- this.commitLayers(_chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
3805
- const b = _nullishCoalesce(_chunkD37BX2ZAcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
3816
+ if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
3817
+ this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
3818
+ const b = _nullishCoalesce(_chunkMGL4U5WAcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
3806
3819
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
3807
3820
  }
3808
3821
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3809
3822
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
3810
3823
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
3811
- const next = _chunkD37BX2ZAcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
3824
+ const next = _chunkMGL4U5WAcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
3812
3825
  this.commitLayers(next, void 0, commitToHistory);
3813
3826
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
3814
3827
  }
@@ -3818,20 +3831,20 @@ var ImageEditorController = (_class6 = class {
3818
3831
  * target when the layer is active.
3819
3832
  */
3820
3833
  addLayerMask(id, from = "reveal-all", props = {}) {
3821
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3834
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3822
3835
  let mask;
3823
3836
  if (from === "selection") {
3824
3837
  const sel = this.state.selection;
3825
- if (!_optionalChain([sel, 'optionalAccess', _126 => _126.bounds])) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
3838
+ if (!_optionalChain([sel, 'optionalAccess', _126 => _126.bounds])) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
3826
3839
  mask = this.maskFromSelection(sel, props);
3827
3840
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
3828
- mask = { ...mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
3841
+ mask = { ...mask, surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
3829
3842
  }
3830
3843
  } else {
3831
3844
  const v = from === "reveal-all" ? 255 : 0;
3832
- mask = withMaskProps({ surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
3845
+ mask = withMaskProps({ surface: _chunkXIOMMGPDcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
3833
3846
  }
3834
- const next = _chunkD37BX2ZAcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
3847
+ const next = _chunkMGL4U5WAcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
3835
3848
  this.commitLayers(next, () => {
3836
3849
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
3837
3850
  });
@@ -3839,18 +3852,18 @@ var ImageEditorController = (_class6 = class {
3839
3852
  }
3840
3853
  /** Removes a layer's mask (one undo step). */
3841
3854
  removeLayerMask(id) {
3842
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3843
- if (!layer.mask) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
3844
- this.commitLayers(_chunkD37BX2ZAcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
3855
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3856
+ if (!layer.mask) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
3857
+ this.commitLayers(_chunkMGL4U5WAcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
3845
3858
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
3846
3859
  });
3847
3860
  }
3848
3861
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
3849
3862
  setLayerMaskProps(id, props, commitToHistory = true) {
3850
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3851
- if (!layer.mask) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
3863
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
3864
+ if (!layer.mask) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
3852
3865
  const mask = withMaskProps(layer.mask, props);
3853
- this.commitLayers(_chunkD37BX2ZAcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
3866
+ this.commitLayers(_chunkMGL4U5WAcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
3854
3867
  return mask;
3855
3868
  }
3856
3869
  /**
@@ -3858,11 +3871,11 @@ var ImageEditorController = (_class6 = class {
3858
3871
  * the depth map) and removes the mask, as one undo step.
3859
3872
  */
3860
3873
  async applyLayerMask(id) {
3861
- const loc = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id);
3874
+ const loc = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id);
3862
3875
  const layer = loc.layer;
3863
- if (layer.type !== "pixel") throw new (0, _chunkD37BX2ZAcjs.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.`);
3864
- if (!layer.mask) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
3865
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
3876
+ if (layer.type !== "pixel") throw new (0, _chunkMGL4U5WAcjs.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.`);
3877
+ if (!layer.mask) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
3878
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
3866
3879
  const { width, height } = this.naturalSize;
3867
3880
  await this.renderer.prepareLayerAssets([layer], width, height);
3868
3881
  const sources = this.renderer.compositorSources(width, height);
@@ -3870,11 +3883,11 @@ var ImageEditorController = (_class6 = class {
3870
3883
  let out = surface;
3871
3884
  const b = surface.bounds;
3872
3885
  if (b) {
3873
- const draft = new (0, _chunkSZ6KMZNMcjs.SurfaceDraft)(surface);
3874
- for (const t of _chunkSZ6KMZNMcjs.tilesInRect.call(void 0, b)) {
3886
+ const draft = new (0, _chunkXIOMMGPDcjs.SurfaceDraft)(surface);
3887
+ for (const t of _chunkXIOMMGPDcjs.tilesInRect.call(void 0, b)) {
3875
3888
  const data = draft.peek(t.tx, t.ty);
3876
3889
  if (!data) continue;
3877
- const r = { x: t.tx * _chunkSZ6KMZNMcjs.TILE + layer.offset.x, y: t.ty * _chunkSZ6KMZNMcjs.TILE + layer.offset.y, width: _chunkSZ6KMZNMcjs.TILE, height: _chunkSZ6KMZNMcjs.TILE };
3890
+ const r = { x: t.tx * _chunkXIOMMGPDcjs.TILE + layer.offset.x, y: t.ty * _chunkXIOMMGPDcjs.TILE + layer.offset.y, width: _chunkXIOMMGPDcjs.TILE, height: _chunkXIOMMGPDcjs.TILE };
3878
3891
  const cov = this.compositor.maskCoverage(layer, r, sources);
3879
3892
  if (!cov) continue;
3880
3893
  const d = draft.tile(t.tx, t.ty);
@@ -3885,7 +3898,7 @@ var ImageEditorController = (_class6 = class {
3885
3898
  const next = { ...layer, surface: out };
3886
3899
  delete next.mask;
3887
3900
  delete next.source;
3888
- this.commitLayers(_chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, id, () => next), () => {
3901
+ this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => next), () => {
3889
3902
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
3890
3903
  });
3891
3904
  }
@@ -3895,17 +3908,17 @@ var ImageEditorController = (_class6 = class {
3895
3908
  */
3896
3909
  layerViaCopy(options = {}) {
3897
3910
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
3898
- if (!id) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
3899
- const loc = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id);
3911
+ if (!id) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
3912
+ const loc = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id);
3900
3913
  const layer = loc.layer;
3901
- if (layer.type !== "pixel") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
3914
+ if (layer.type !== "pixel") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
3902
3915
  const sel = this.state.selection;
3903
- if (!_optionalChain([sel, 'optionalAccess', _127 => _127.bounds])) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
3904
- if (options.cut) _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
3916
+ if (!_optionalChain([sel, 'optionalAccess', _127 => _127.bounds])) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
3917
+ if (options.cut) _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
3905
3918
  const surface = this.surfaceOf(layer);
3906
3919
  const sb = sel.bounds;
3907
3920
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
3908
- const px2 = _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, src);
3921
+ const px2 = _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, src);
3909
3922
  const kept = options.cut ? new Uint8ClampedArray(px2) : null;
3910
3923
  for (let y = 0; y < sb.height; y++) {
3911
3924
  for (let x = 0; x < sb.width; x++) {
@@ -3917,19 +3930,19 @@ var ImageEditorController = (_class6 = class {
3917
3930
  }
3918
3931
  const copy = {
3919
3932
  type: "pixel",
3920
- id: _chunkD37BX2ZAcjs.newLayerId.call(void 0, ),
3933
+ id: _chunkMGL4U5WAcjs.newLayerId.call(void 0, ),
3921
3934
  name: _optionalChain([options, 'access', _128 => _128.name, 'optionalAccess', _129 => _129.trim, 'call', _130 => _130()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
3922
3935
  visible: true,
3923
3936
  opacity: 1,
3924
3937
  blend: "normal",
3925
- surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
3938
+ surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
3926
3939
  offset: { ...layer.offset }
3927
3940
  };
3928
- let next = _chunkAZTZRLDIcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _131 => _131.parent, 'optionalAccess', _132 => _132.id]), () => ( null)), loc.index + 1);
3941
+ let next = _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _131 => _131.parent, 'optionalAccess', _132 => _132.id]), () => ( null)), loc.index + 1);
3929
3942
  if (kept) {
3930
- const cutLayer = { ...layer, surface: _chunkSZ6KMZNMcjs.writeRegion.call(void 0, surface, src, kept) };
3943
+ const cutLayer = { ...layer, surface: _chunkXIOMMGPDcjs.writeRegion.call(void 0, surface, src, kept) };
3931
3944
  delete cutLayer.source;
3932
- next = _chunkAZTZRLDIcjs.mapLayer.call(void 0, next, id, () => cutLayer);
3945
+ next = _chunkPOGBUYWEcjs.mapLayer.call(void 0, next, id, () => cutLayer);
3933
3946
  }
3934
3947
  this.commitLayers(next, () => {
3935
3948
  this.state.activeLayerId = copy.id;
@@ -3989,7 +4002,7 @@ var ImageEditorController = (_class6 = class {
3989
4002
  * Refused while another transform is open.
3990
4003
  */
3991
4004
  beginFreeTransform(init = {}) {
3992
- if (this.getFreeTransform()) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
4005
+ if (this.getFreeTransform()) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
3993
4006
  const session = new FreeTransformSession(this.transformHost(), init);
3994
4007
  this.openTransform = session;
3995
4008
  this.notify();
@@ -4003,26 +4016,26 @@ var ImageEditorController = (_class6 = class {
4003
4016
  */
4004
4017
  transformLayer(spec) {
4005
4018
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
4006
- if (given > 1) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give only one of matrix, corners and params.");
4007
- if (!given && spec.warp === void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
4019
+ if (given > 1) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give only one of matrix, corners and params.");
4020
+ if (!given && spec.warp === void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
4008
4021
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
4009
- throw new (0, _chunkD37BX2ZAcjs.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).");
4022
+ throw new (0, _chunkMGL4U5WAcjs.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).");
4010
4023
  }
4011
4024
  if (spec.matrix) {
4012
4025
  const [a, b, c, d] = spec.matrix;
4013
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
4026
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
4014
4027
  }
4015
4028
  const session = this.beginFreeTransform(spec);
4016
4029
  try {
4017
4030
  const g = session.startGeometry;
4018
- const corners = spec.matrix ? g.corners.map((p) => _chunkW3GXSUSQcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkD37BX2ZAcjs.applyParams.call(void 0, g, spec.params) : g.corners;
4031
+ const corners = spec.matrix ? g.corners.map((p) => _chunkW3GXSUSQcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkMGL4U5WAcjs.applyParams.call(void 0, g, spec.params) : g.corners;
4019
4032
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
4020
4033
  if (spec.warp) {
4021
4034
  if ("style" in spec.warp) {
4022
- if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
4023
- warp = _chunkD37BX2ZAcjs.presetWarp.call(void 0, session.box, spec.warp);
4035
+ if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
4036
+ warp = _chunkMGL4U5WAcjs.presetWarp.call(void 0, session.box, spec.warp);
4024
4037
  } else {
4025
- if (!_chunkD37BX2ZAcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkD37BX2ZAcjs.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.");
4038
+ if (!_chunkMGL4U5WAcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkMGL4U5WAcjs.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.");
4026
4039
  warp = spec.warp;
4027
4040
  }
4028
4041
  }
@@ -4035,10 +4048,10 @@ var ImageEditorController = (_class6 = class {
4035
4048
  }
4036
4049
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
4037
4050
  flipLayer(axis, init = {}) {
4038
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
4051
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
4039
4052
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
4040
4053
  try {
4041
- session.update({ corners: _chunkD37BX2ZAcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
4054
+ session.update({ corners: _chunkMGL4U5WAcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
4042
4055
  return session.commit();
4043
4056
  } catch (e) {
4044
4057
  session.cancel();
@@ -4050,10 +4063,10 @@ var ImageEditorController = (_class6 = class {
4050
4063
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
4051
4064
  */
4052
4065
  rotateLayer90(turn, init = {}) {
4053
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
4066
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
4054
4067
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
4055
4068
  try {
4056
- const b = session.smartObject ? _nullishCoalesce(_chunkD37BX2ZAcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
4069
+ const b = session.smartObject ? _nullishCoalesce(_chunkMGL4U5WAcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
4057
4070
  const cx = b.x + b.width / 2;
4058
4071
  const cy = b.y + b.height / 2;
4059
4072
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
@@ -4068,22 +4081,22 @@ var ImageEditorController = (_class6 = class {
4068
4081
  }
4069
4082
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
4070
4083
  addLayerFilter(id, filter) {
4071
- const f = _chunkD37BX2ZAcjs.normalizeFilter.call(void 0, filter);
4072
- const next = _chunkD37BX2ZAcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
4084
+ const f = _chunkMGL4U5WAcjs.normalizeFilter.call(void 0, filter);
4085
+ const next = _chunkMGL4U5WAcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
4073
4086
  this.commitLayers(next);
4074
- return _nullishCoalesce(_chunkAZTZRLDIcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4087
+ return _nullishCoalesce(_chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4075
4088
  }
4076
4089
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
4077
4090
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
4078
- const next = _chunkD37BX2ZAcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
4091
+ const next = _chunkMGL4U5WAcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
4079
4092
  this.commitLayers(next, void 0, commitToHistory);
4080
- return _nullishCoalesce(_chunkAZTZRLDIcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4093
+ return _nullishCoalesce(_chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4081
4094
  }
4082
4095
  /** Removes one filter (one undo step). Returns the remaining filters. */
4083
4096
  removeLayerFilter(id, filterId) {
4084
- const next = _chunkD37BX2ZAcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
4097
+ const next = _chunkMGL4U5WAcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
4085
4098
  this.commitLayers(next);
4086
- return _nullishCoalesce(_chunkAZTZRLDIcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4099
+ return _nullishCoalesce(_chunkPOGBUYWEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4087
4100
  }
4088
4101
  // --- Smart objects ---
4089
4102
  get canvasSize() {
@@ -4097,8 +4110,8 @@ var ImageEditorController = (_class6 = class {
4097
4110
  */
4098
4111
  convertToSmartObject(ids, options = {}) {
4099
4112
  const list = _optionalChain([ids, 'optionalAccess', _136 => _136.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
4100
- if (!list.length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
4101
- const res = _chunkD37BX2ZAcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
4113
+ if (!list.length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
4114
+ const res = _chunkMGL4U5WAcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
4102
4115
  this.commitLayers(res.layers, () => {
4103
4116
  this.state.activeLayerId = res.layer.id;
4104
4117
  this.state.activeTarget = "pixels";
@@ -4107,7 +4120,7 @@ var ImageEditorController = (_class6 = class {
4107
4120
  }
4108
4121
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
4109
4122
  rasterizeSmartObject(id) {
4110
- const res = _chunkD37BX2ZAcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
4123
+ const res = _chunkMGL4U5WAcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
4111
4124
  this.commitLayers(res.layers, () => {
4112
4125
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
4113
4126
  });
@@ -4115,10 +4128,10 @@ var ImageEditorController = (_class6 = class {
4115
4128
  }
4116
4129
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
4117
4130
  getSmartObject(id) {
4118
- const layer = _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4131
+ const layer = _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4119
4132
  const c = layer.contents;
4120
- const g = _chunkD37BX2ZAcjs.placementGeometry.call(void 0, layer);
4121
- const readout = _chunkD37BX2ZAcjs.describeTransform.call(void 0, g);
4133
+ const g = _chunkMGL4U5WAcjs.placementGeometry.call(void 0, layer);
4134
+ const readout = _chunkMGL4U5WAcjs.describeTransform.call(void 0, g);
4122
4135
  const stack = layer.smartFilters;
4123
4136
  return {
4124
4137
  layerId: layer.id,
@@ -4128,11 +4141,11 @@ var ImageEditorController = (_class6 = class {
4128
4141
  kind: c.kind,
4129
4142
  width: c.width,
4130
4143
  height: c.height,
4131
- decoded: _chunkD37BX2ZAcjs.isContentsDecoded.call(void 0, c),
4144
+ decoded: _chunkMGL4U5WAcjs.isContentsDecoded.call(void 0, c),
4132
4145
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _137 => _137.file, 'optionalAccess', _138 => _138.type]), () => ( null)),
4133
4146
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _139 => _139.linked, 'optionalAccess', _140 => _140.path]), () => ( null)),
4134
- instances: _chunkD37BX2ZAcjs.instancesOf.call(void 0, this.state.layers, c.id),
4135
- layerCount: c.document ? _chunkAZTZRLDIcjs.flattenLayers.call(void 0, c.document.layers).length : 0
4147
+ instances: _chunkMGL4U5WAcjs.instancesOf.call(void 0, this.state.layers, c.id),
4148
+ layerCount: c.document ? _chunkPOGBUYWEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
4136
4149
  },
4137
4150
  placement: {
4138
4151
  corners: g.corners.map((p) => ({ x: p.x, y: p.y })),
@@ -4143,13 +4156,13 @@ var ImageEditorController = (_class6 = class {
4143
4156
  scaleY: readout.scaleY,
4144
4157
  rotate: readout.rotate,
4145
4158
  skewX: readout.skewX,
4146
- center: _chunkD37BX2ZAcjs.anchorPoint.call(void 0, g, "center"),
4147
- bounds: _chunkD37BX2ZAcjs.transformedBox.call(void 0, g)
4159
+ center: _chunkMGL4U5WAcjs.anchorPoint.call(void 0, g, "center"),
4160
+ bounds: _chunkMGL4U5WAcjs.transformedBox.call(void 0, g)
4148
4161
  },
4149
4162
  smartFilters: {
4150
4163
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _141 => _141.enabled]), () => ( true)),
4151
4164
  filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _142 => _142.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
4152
- mask: _optionalChain([stack, 'optionalAccess', _143 => _143.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkSZ6KMZNMcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
4165
+ mask: _optionalChain([stack, 'optionalAccess', _143 => _143.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkXIOMMGPDcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
4153
4166
  },
4154
4167
  bounds: this.getLayerBounds(id)
4155
4168
  };
@@ -4161,7 +4174,7 @@ var ImageEditorController = (_class6 = class {
4161
4174
  * change. Returns the new placement summary.
4162
4175
  */
4163
4176
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
4164
- const res = _chunkD37BX2ZAcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
4177
+ const res = _chunkMGL4U5WAcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
4165
4178
  this.commitLayers(res.layers, void 0, commitToHistory);
4166
4179
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
4167
4180
  }
@@ -4174,23 +4187,23 @@ var ImageEditorController = (_class6 = class {
4174
4187
  * nothing is relative to the current transform.
4175
4188
  */
4176
4189
  setSmartObjectTransform(id, spec) {
4177
- const layer = _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4178
- const g = _chunkD37BX2ZAcjs.placementGeometry.call(void 0, layer);
4190
+ const layer = _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4191
+ const g = _chunkMGL4U5WAcjs.placementGeometry.call(void 0, layer);
4179
4192
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
4180
4193
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
4181
- if (ways > 1) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
4194
+ if (ways > 1) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
4182
4195
  let corners = g.corners;
4183
4196
  if (spec.corners) corners = spec.corners;
4184
4197
  else if (spec.matrix) {
4185
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkD37BX2ZAcjs.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).");
4198
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkMGL4U5WAcjs.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).");
4186
4199
  const [a, b, c, d] = spec.matrix;
4187
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
4188
- corners = _chunkD37BX2ZAcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
4200
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
4201
+ corners = _chunkMGL4U5WAcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
4189
4202
  } else if (numeric.length) {
4190
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
4191
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`${k} must be a finite number.`);
4192
- const now = _chunkD37BX2ZAcjs.describeTransform.call(void 0, g);
4193
- const centre = _chunkD37BX2ZAcjs.anchorPoint.call(void 0, g, "center");
4203
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
4204
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`${k} must be a finite number.`);
4205
+ const now = _chunkMGL4U5WAcjs.describeTransform.call(void 0, g);
4206
+ const centre = _chunkMGL4U5WAcjs.anchorPoint.call(void 0, g, "center");
4194
4207
  const params = {
4195
4208
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
4196
4209
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -4198,20 +4211,20 @@ var ImageEditorController = (_class6 = class {
4198
4211
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
4199
4212
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
4200
4213
  };
4201
- const m = _chunkD37BX2ZAcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
4214
+ const m = _chunkMGL4U5WAcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
4202
4215
  const cx = g.box.width / 2;
4203
4216
  const cy = g.box.height / 2;
4204
4217
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
4205
- corners = _chunkD37BX2ZAcjs.cornersFromMatrix.call(void 0, g.box, _chunkW3GXSUSQcjs.multiplyMatrices.call(void 0, m, _chunkW3GXSUSQcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
4218
+ corners = _chunkMGL4U5WAcjs.cornersFromMatrix.call(void 0, g.box, _chunkW3GXSUSQcjs.multiplyMatrices.call(void 0, m, _chunkW3GXSUSQcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
4206
4219
  }
4207
4220
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
4208
4221
  if (spec.warp === null) warp = null;
4209
4222
  else if (spec.warp) {
4210
4223
  if ("style" in spec.warp) {
4211
- if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
4212
- warp = _chunkD37BX2ZAcjs.presetWarp.call(void 0, g.box, spec.warp);
4224
+ if (!_chunkW3GXSUSQcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
4225
+ warp = _chunkMGL4U5WAcjs.presetWarp.call(void 0, g.box, spec.warp);
4213
4226
  } else {
4214
- if (!_chunkD37BX2ZAcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkD37BX2ZAcjs.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.");
4227
+ if (!_chunkMGL4U5WAcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkMGL4U5WAcjs.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.");
4215
4228
  warp = spec.warp;
4216
4229
  }
4217
4230
  }
@@ -4225,16 +4238,16 @@ var ImageEditorController = (_class6 = class {
4225
4238
  * the layers that changed.
4226
4239
  */
4227
4240
  replaceSmartObjectContents(id, source) {
4228
- const layer = _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4241
+ const layer = _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4229
4242
  let contents;
4230
4243
  if ("contents" in source) contents = source.contents;
4231
- else if ("pixels" in source) contents = _chunkD37BX2ZAcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
4244
+ else if ("pixels" in source) contents = _chunkMGL4U5WAcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
4232
4245
  else {
4233
- const psd = _chunkD37BX2ZAcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkD37BX2ZAcjs.newLayerId.call(void 0, ) });
4234
- contents = _chunkD37BX2ZAcjs.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`)));
4246
+ const psd = _chunkMGL4U5WAcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkMGL4U5WAcjs.newLayerId.call(void 0, ) });
4247
+ contents = _chunkMGL4U5WAcjs.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`)));
4235
4248
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
4236
4249
  }
4237
- const res = _chunkD37BX2ZAcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
4250
+ const res = _chunkMGL4U5WAcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
4238
4251
  this.commitLayers(res.layers);
4239
4252
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
4240
4253
  }
@@ -4249,16 +4262,16 @@ var ImageEditorController = (_class6 = class {
4249
4262
  * and bytes.
4250
4263
  */
4251
4264
  exportSmartObjectContents(id) {
4252
- const layer = _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4265
+ const layer = _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4253
4266
  const c = layer.contents;
4254
4267
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
4255
4268
  if (c.file) {
4256
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkD37BX2ZAcjs.BROWSER_IMAGE_TYPES };
4269
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkMGL4U5WAcjs.BROWSER_IMAGE_TYPES };
4257
4270
  const ext = c.file.type.toLowerCase();
4258
4271
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
4259
4272
  }
4260
- if (!_chunkD37BX2ZAcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
4261
- const f = _chunkD37BX2ZAcjs.smartContentsFile.call(void 0, c);
4273
+ if (!_chunkMGL4U5WAcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
4274
+ const f = _chunkMGL4U5WAcjs.smartContentsFile.call(void 0, c);
4262
4275
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
4263
4276
  }
4264
4277
  /**
@@ -4267,7 +4280,7 @@ var ImageEditorController = (_class6 = class {
4267
4280
  * undo step. Returns the copy's id.
4268
4281
  */
4269
4282
  copySmartObject(id, linked = false, name) {
4270
- const res = _chunkD37BX2ZAcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
4283
+ const res = _chunkMGL4U5WAcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
4271
4284
  this.commitLayers(res.layers, () => {
4272
4285
  this.state.activeLayerId = res.layer.id;
4273
4286
  this.state.activeTarget = "pixels";
@@ -4276,31 +4289,31 @@ var ImageEditorController = (_class6 = class {
4276
4289
  }
4277
4290
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
4278
4291
  addSmartFilter(id, filter, index) {
4279
- const res = _chunkD37BX2ZAcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkD37BX2ZAcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
4292
+ const res = _chunkMGL4U5WAcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkMGL4U5WAcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
4280
4293
  this.commitLayers(res.layers);
4281
4294
  return res.filter;
4282
4295
  }
4283
4296
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
4284
4297
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
4285
- const res = _chunkD37BX2ZAcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
4298
+ const res = _chunkMGL4U5WAcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
4286
4299
  this.commitLayers(res.layers, void 0, commitToHistory);
4287
4300
  return res.filter;
4288
4301
  }
4289
4302
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
4290
4303
  removeSmartFilter(id, filterId) {
4291
- const res = _chunkD37BX2ZAcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
4304
+ const res = _chunkMGL4U5WAcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
4292
4305
  this.commitLayers(res.layers);
4293
4306
  return _nullishCoalesce(_optionalChain([res, 'access', _144 => _144.layer, 'access', _145 => _145.smartFilters, 'optionalAccess', _146 => _146.filters]), () => ( []));
4294
4307
  }
4295
4308
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
4296
4309
  moveSmartFilter(id, filterId, index) {
4297
- const res = _chunkD37BX2ZAcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
4310
+ const res = _chunkMGL4U5WAcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
4298
4311
  this.commitLayers(res.layers);
4299
4312
  return _nullishCoalesce(_optionalChain([res, 'access', _147 => _147.layer, 'access', _148 => _148.smartFilters, 'optionalAccess', _149 => _149.filters]), () => ( []));
4300
4313
  }
4301
4314
  /** Turns a smart object's whole filter stack on or off (one undo step). */
4302
4315
  setSmartFiltersEnabled(id, enabled) {
4303
- const res = _chunkD37BX2ZAcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
4316
+ const res = _chunkMGL4U5WAcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
4304
4317
  this.commitLayers(res.layers);
4305
4318
  return _nullishCoalesce(_optionalChain([res, 'access', _150 => _150.layer, 'access', _151 => _151.smartFilters, 'optionalAccess', _152 => _152.enabled]), () => ( true));
4306
4319
  }
@@ -4310,21 +4323,21 @@ var ImageEditorController = (_class6 = class {
4310
4323
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
4311
4324
  */
4312
4325
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
4313
- const layer = _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4326
+ const layer = _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4314
4327
  let mask;
4315
4328
  if (from === "none") mask = null;
4316
4329
  else if (from === "keep") {
4317
- if (!_optionalChain([layer, 'access', _153 => _153.smartFilters, 'optionalAccess', _154 => _154.mask])) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
4330
+ if (!_optionalChain([layer, 'access', _153 => _153.smartFilters, 'optionalAccess', _154 => _154.mask])) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
4318
4331
  mask = withMaskProps(layer.smartFilters.mask, props);
4319
4332
  } else if (from === "selection") {
4320
4333
  const sel = this.state.selection;
4321
- if (!_optionalChain([sel, 'optionalAccess', _155 => _155.bounds])) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
4334
+ if (!_optionalChain([sel, 'optionalAccess', _155 => _155.bounds])) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
4322
4335
  mask = this.maskFromSelection(sel, props);
4323
4336
  } else {
4324
4337
  const v = from === "reveal-all" ? 255 : 0;
4325
- mask = withMaskProps({ surface: _chunkSZ6KMZNMcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
4338
+ mask = withMaskProps({ surface: _chunkXIOMMGPDcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
4326
4339
  }
4327
- const res = _chunkD37BX2ZAcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
4340
+ const res = _chunkMGL4U5WAcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
4328
4341
  this.commitLayers(res.layers, () => {
4329
4342
  if (this.state.activeLayerId !== id) return;
4330
4343
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -4339,18 +4352,18 @@ var ImageEditorController = (_class6 = class {
4339
4352
  */
4340
4353
  async prepareSmartObjects() {
4341
4354
  const pending = /* @__PURE__ */ new Map();
4342
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers)) {
4343
- if (l.type === "smart" && !_chunkD37BX2ZAcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkD37BX2ZAcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
4355
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers)) {
4356
+ if (l.type === "smart" && !_chunkMGL4U5WAcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkMGL4U5WAcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
4344
4357
  }
4345
4358
  const left = [];
4346
4359
  for (const [cid, c] of pending) {
4347
4360
  try {
4348
- const url = `data:${_chunkD37BX2ZAcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkAZTZRLDIcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
4361
+ const url = `data:${_chunkMGL4U5WAcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkPOGBUYWEcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
4349
4362
  const px2 = await this.decodeImage(url);
4350
- const decoded = { ...c, kind: "raster", raster: _chunkD37BX2ZAcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
4363
+ const decoded = { ...c, kind: "raster", raster: _chunkMGL4U5WAcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
4351
4364
  const swap = (layers) => {
4352
4365
  let out = layers;
4353
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkAZTZRLDIcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
4366
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkPOGBUYWEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
4354
4367
  return out;
4355
4368
  };
4356
4369
  this.state.layers = swap(this.state.layers);
@@ -4375,10 +4388,10 @@ var ImageEditorController = (_class6 = class {
4375
4388
  * Contents can nest. Returns the contents' size and layer ids.
4376
4389
  */
4377
4390
  editSmartObjectContents(id) {
4378
- if (this.getFreeTransform()) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
4379
- const layer = _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4391
+ if (this.getFreeTransform()) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
4392
+ const layer = _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, this.state.layers, id);
4380
4393
  const c = layer.contents;
4381
- if (!_chunkD37BX2ZAcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _159 => _159.file, 'optionalAccess', _160 => _160.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
4394
+ if (!_chunkMGL4U5WAcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _159 => _159.file, 'optionalAccess', _160 => _160.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
4382
4395
  const saved = {
4383
4396
  state: { ...this.state },
4384
4397
  undo: this.undoStack,
@@ -4389,7 +4402,7 @@ var ImageEditorController = (_class6 = class {
4389
4402
  samplePixelsOverride: this.samplePixelsOverride,
4390
4403
  psdResolution: this.psdResolution
4391
4404
  };
4392
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkD37BX2ZAcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
4405
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkMGL4U5WAcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
4393
4406
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
4394
4407
  const s = this.state;
4395
4408
  this.state = {
@@ -4397,7 +4410,7 @@ var ImageEditorController = (_class6 = class {
4397
4410
  sourceUrl: null,
4398
4411
  imageDimensions: { width: c.width, height: c.height },
4399
4412
  crop: null,
4400
- transform: { ..._chunkD37BX2ZAcjs.DEFAULT_TRANSFORM_VALUES },
4413
+ transform: { ..._chunkMGL4U5WAcjs.DEFAULT_TRANSFORM_VALUES },
4401
4414
  layers,
4402
4415
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
4403
4416
  activeTarget: "pixels",
@@ -4421,7 +4434,7 @@ var ImageEditorController = (_class6 = class {
4421
4434
  this.viewKey = [];
4422
4435
  this.initialSnapshot = this.captureHistoryEntry();
4423
4436
  this.notify();
4424
- return { layerId: layer.id, depth: this.contentsStack.length, width: c.width, height: c.height, layerIds: _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers).map((l) => l.id) };
4437
+ return { layerId: layer.id, depth: this.contentsStack.length, width: c.width, height: c.height, layerIds: _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers).map((l) => l.id) };
4425
4438
  }
4426
4439
  /**
4427
4440
  * Closes the innermost open contents: with `save` (default) the edited layers become the smart
@@ -4430,24 +4443,24 @@ var ImageEditorController = (_class6 = class {
4430
4443
  */
4431
4444
  closeSmartObjectContents(save = true) {
4432
4445
  const top = this.contentsStack.pop();
4433
- if (!top) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
4446
+ if (!top) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
4434
4447
  if (_optionalChain([this, 'access', _166 => _166.openTransform, 'optionalAccess', _167 => _167.isOpen])) this.openTransform.cancel();
4435
4448
  this.openTransform = null;
4436
4449
  const edited = this.state;
4437
4450
  const changed = save && this.undoStack.length > 0;
4438
4451
  let next = null;
4439
4452
  if (changed) {
4440
- const layer = _optionalChain([_chunkAZTZRLDIcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _168 => _168.layer]);
4453
+ const layer = _optionalChain([_chunkPOGBUYWEcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _168 => _168.layer]);
4441
4454
  const old = _optionalChain([layer, 'optionalAccess', _169 => _169.contents]);
4442
4455
  const { width, height } = edited.imageDimensions;
4443
4456
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
4444
4457
  const plain3 = _optionalChain([only, 'optionalAccess', _170 => _170.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _171 => _171.filters, 'optionalAccess', _172 => _172.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
4445
4458
  if (_optionalChain([old, 'optionalAccess', _173 => _173.kind]) === "raster" && plain3) {
4446
- const px2 = _chunkSZ6KMZNMcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
4447
- next = _chunkD37BX2ZAcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
4459
+ const px2 = _chunkXIOMMGPDcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
4460
+ next = _chunkMGL4U5WAcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
4448
4461
  } else {
4449
4462
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
4450
- next = _chunkD37BX2ZAcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _174 => _174.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _175 => _175.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
4463
+ next = _chunkMGL4U5WAcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _174 => _174.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _175 => _175.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
4451
4464
  }
4452
4465
  }
4453
4466
  const saved = top.saved;
@@ -4466,7 +4479,7 @@ var ImageEditorController = (_class6 = class {
4466
4479
  this.notify();
4467
4480
  return { layerId: top.layerId, changed: false, layerIds: [] };
4468
4481
  }
4469
- const res = _chunkD37BX2ZAcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
4482
+ const res = _chunkMGL4U5WAcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
4470
4483
  this.commitLayers(res.layers);
4471
4484
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
4472
4485
  }
@@ -4481,35 +4494,35 @@ var ImageEditorController = (_class6 = class {
4481
4494
  // --- Layer effects ---
4482
4495
  /** A layer's effects (an empty, enabled list when it has none). */
4483
4496
  getLayerEffects(id) {
4484
- return _chunkD37BX2ZAcjs.layerEffectsOf.call(void 0, _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer);
4497
+ return _chunkMGL4U5WAcjs.layerEffectsOf.call(void 0, _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer);
4485
4498
  }
4486
4499
  /**
4487
4500
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
4488
4501
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
4489
4502
  */
4490
4503
  addLayerEffect(id, kind, params = {}, index) {
4491
- const res = _chunkD37BX2ZAcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
4504
+ const res = _chunkMGL4U5WAcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
4492
4505
  this.commitLayers(res.layers);
4493
4506
  return { effect: res.effect, effects: this.getLayerEffects(id) };
4494
4507
  }
4495
4508
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
4496
4509
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
4497
- this.commitLayers(_chunkD37BX2ZAcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
4510
+ this.commitLayers(_chunkMGL4U5WAcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
4498
4511
  return this.getLayerEffects(id);
4499
4512
  }
4500
4513
  /** Removes one effect (one undo step). Returns the remaining effects. */
4501
4514
  removeLayerEffect(id, effectId) {
4502
- this.commitLayers(_chunkD37BX2ZAcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
4515
+ this.commitLayers(_chunkMGL4U5WAcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
4503
4516
  return this.getLayerEffects(id);
4504
4517
  }
4505
4518
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
4506
4519
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
4507
- this.commitLayers(_chunkD37BX2ZAcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
4520
+ this.commitLayers(_chunkMGL4U5WAcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
4508
4521
  return this.getLayerEffects(id);
4509
4522
  }
4510
4523
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
4511
4524
  setLayerEffects(id, effects, commitToHistory = true) {
4512
- this.commitLayers(_chunkD37BX2ZAcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
4525
+ this.commitLayers(_chunkMGL4U5WAcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
4513
4526
  return this.getLayerEffects(id);
4514
4527
  }
4515
4528
  __init56() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -4530,15 +4543,15 @@ var ImageEditorController = (_class6 = class {
4530
4543
  }
4531
4544
  /** The light effects with "use global light" follow. */
4532
4545
  getGlobalLight() {
4533
- return { ..._nullishCoalesce(this.state.globalLight, () => ( _chunkAZTZRLDIcjs.DEFAULT_GLOBAL_LIGHT)) };
4546
+ return { ..._nullishCoalesce(this.state.globalLight, () => ( _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT)) };
4534
4547
  }
4535
4548
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
4536
4549
  setGlobalLight(light, commitToHistory = true) {
4537
4550
  const next = { ...this.getGlobalLight(), ...light };
4538
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
4539
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
4551
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
4552
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
4540
4553
  if (commitToHistory) this.recordHistory();
4541
- if (next.angle === _chunkAZTZRLDIcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkAZTZRLDIcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
4554
+ if (next.angle === _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
4542
4555
  else this.state.globalLight = next;
4543
4556
  this.notify();
4544
4557
  return this.getGlobalLight();
@@ -4546,26 +4559,26 @@ var ImageEditorController = (_class6 = class {
4546
4559
  /** Composites `layers` (in isolation) over `rect` into a surface, loading depth maps first. */
4547
4560
  async compositeToSurface(layers, rect) {
4548
4561
  const { width, height } = this.naturalSize;
4549
- if (_chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
4550
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
4562
+ if (_chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
4563
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
4551
4564
  }
4552
4565
  await this.renderer.prepareLayerAssets(layers, width, height);
4553
- const data = new (0, _chunkD37BX2ZAcjs.LayerCompositor)().composite(layers, rect, this.renderer.compositorSources(width, height));
4554
- return _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
4566
+ const data = new (0, _chunkMGL4U5WAcjs.LayerCompositor)().composite(layers, rect, this.renderer.compositorSources(width, height));
4567
+ return _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
4555
4568
  }
4556
4569
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
4557
4570
  paintBounds(layer) {
4558
4571
  const { width, height } = this.naturalSize;
4559
4572
  const canvas = { x: 0, y: 0, width, height };
4560
- if (_chunkD37BX2ZAcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
4573
+ if (_chunkMGL4U5WAcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
4561
4574
  if (layer.type === "annotation") {
4562
- const b = _chunkD37BX2ZAcjs.getAnnotationBounds.call(void 0, layer.annotation);
4575
+ const b = _chunkMGL4U5WAcjs.getAnnotationBounds.call(void 0, layer.annotation);
4563
4576
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
4564
4577
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
4565
4578
  }
4566
4579
  if (layer.type === "group") {
4567
4580
  let r = null;
4568
- for (const c of layer.children) r = _chunkD37BX2ZAcjs.unionRect.call(void 0, r, this.paintBounds(c));
4581
+ for (const c of layer.children) r = _chunkMGL4U5WAcjs.unionRect.call(void 0, r, this.paintBounds(c));
4569
4582
  return _nullishCoalesce(r, () => ( canvas));
4570
4583
  }
4571
4584
  return canvas;
@@ -4576,17 +4589,17 @@ var ImageEditorController = (_class6 = class {
4576
4589
  * Returns the merged id.
4577
4590
  */
4578
4591
  async mergeDown(id) {
4579
- const loc = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id);
4592
+ const loc = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id);
4580
4593
  const upper = loc.layer;
4581
4594
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
4582
4595
  const lower = siblings[loc.index - 1];
4583
- if (!lower) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
4584
- if (lower.type !== "pixel") throw new (0, _chunkD37BX2ZAcjs.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.`);
4585
- if (!upper.visible) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
4586
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
4587
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
4588
- let rect = _nullishCoalesce(_chunkD37BX2ZAcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
4589
- const reach = Math.max(_chunkAZTZRLDIcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkAZTZRLDIcjs.effectsMargin.call(void 0, upper.effects));
4596
+ if (!lower) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
4597
+ if (lower.type !== "pixel") throw new (0, _chunkMGL4U5WAcjs.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.`);
4598
+ if (!upper.visible) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
4599
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
4600
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
4601
+ let rect = _nullishCoalesce(_chunkMGL4U5WAcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
4602
+ const reach = Math.max(_chunkPOGBUYWEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkPOGBUYWEcjs.effectsMargin.call(void 0, upper.effects));
4590
4603
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
4591
4604
  const base = { ...lower, blend: "normal", opacity: 1 };
4592
4605
  delete base.clipped;
@@ -4597,8 +4610,8 @@ var ImageEditorController = (_class6 = class {
4597
4610
  delete merged.filters;
4598
4611
  delete merged.source;
4599
4612
  delete merged.effects;
4600
- let next = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, id, () => null);
4601
- next = _chunkAZTZRLDIcjs.mapLayer.call(void 0, next, lower.id, () => merged);
4613
+ let next = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => null);
4614
+ next = _chunkPOGBUYWEcjs.mapLayer.call(void 0, next, lower.id, () => merged);
4602
4615
  this.commitLayers(next, () => {
4603
4616
  this.state.activeLayerId = merged.id;
4604
4617
  this.state.activeTarget = "pixels";
@@ -4611,12 +4624,12 @@ var ImageEditorController = (_class6 = class {
4611
4624
  */
4612
4625
  async mergeVisible() {
4613
4626
  const visible = this.state.layers.filter((l) => l.visible);
4614
- if (!visible.length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("No layer is visible.");
4627
+ if (!visible.length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("No layer is visible.");
4615
4628
  const { width, height } = this.naturalSize;
4616
4629
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
4617
4630
  const merged = {
4618
4631
  type: "pixel",
4619
- id: _chunkD37BX2ZAcjs.newLayerId.call(void 0, ),
4632
+ id: _chunkMGL4U5WAcjs.newLayerId.call(void 0, ),
4620
4633
  name: "Merged",
4621
4634
  visible: true,
4622
4635
  opacity: 1,
@@ -4640,8 +4653,8 @@ var ImageEditorController = (_class6 = class {
4640
4653
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
4641
4654
  const bg = {
4642
4655
  type: "pixel",
4643
- id: _chunkD37BX2ZAcjs.BACKGROUND_LAYER_ID,
4644
- name: _chunkD37BX2ZAcjs.BACKGROUND_LAYER_NAME,
4656
+ id: _chunkMGL4U5WAcjs.BACKGROUND_LAYER_ID,
4657
+ name: _chunkMGL4U5WAcjs.BACKGROUND_LAYER_NAME,
4645
4658
  visible: true,
4646
4659
  opacity: 1,
4647
4660
  blend: "normal",
@@ -4668,7 +4681,7 @@ var ImageEditorController = (_class6 = class {
4668
4681
  const k = Math.min(1, side / Math.max(width, height));
4669
4682
  const tw = Math.max(1, Math.round(width * k));
4670
4683
  const th = Math.max(1, Math.round(height * k));
4671
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkD37BX2ZAcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
4684
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkMGL4U5WAcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
4672
4685
  if (!surface) return null;
4673
4686
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
4674
4687
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -4681,7 +4694,7 @@ var ImageEditorController = (_class6 = class {
4681
4694
  const dy = Math.min(height - 1, Math.floor((y + 0.5) * height / th)) - oy;
4682
4695
  for (let x = 0; x < tw; x++) {
4683
4696
  const dx = Math.min(width - 1, Math.floor((x + 0.5) * width / tw)) - ox;
4684
- const v = _chunkSZ6KMZNMcjs.readPixel.call(void 0, surface, dx, dy);
4697
+ const v = _chunkXIOMMGPDcjs.readPixel.call(void 0, surface, dx, dy);
4685
4698
  const i = (y * tw + x) * 4;
4686
4699
  if (surface.channels === 1) {
4687
4700
  out[i] = out[i + 1] = out[i + 2] = v[0];
@@ -4704,17 +4717,17 @@ var ImageEditorController = (_class6 = class {
4704
4717
  getLayerThumbnailDataURL(id, options = {}) {
4705
4718
  const thumb = this.getLayerThumbnail(id, options);
4706
4719
  if (!thumb) return null;
4707
- return _chunkAZTZRLDIcjs.pngDataUrl.call(void 0, thumb.width, thumb.height, thumb.data, 4);
4720
+ return _chunkPOGBUYWEcjs.pngDataUrl.call(void 0, thumb.width, thumb.height, thumb.data, 4);
4708
4721
  }
4709
4722
  // --- Painting ---
4710
4723
  /** Brush settings, colours and tool options of the paint tools (view state, no undo). */
4711
4724
  setPaintOptions(options) {
4712
4725
  const cur = this.state.paint;
4713
4726
  const next = {
4714
- brush: options.brush ? _chunkHUFQD4CBcjs.normalizeBrush.call(void 0, { ...cur.brush, ...options.brush }) : cur.brush,
4727
+ brush: options.brush ? _chunk7VOHOPLWcjs.normalizeBrush.call(void 0, { ...cur.brush, ...options.brush }) : cur.brush,
4715
4728
  foreground: options.foreground !== void 0 ? toHex(parseColor(options.foreground)) : cur.foreground,
4716
4729
  background: options.background !== void 0 ? toHex(parseColor(options.background)) : cur.background,
4717
- mixer: options.mixer ? _chunkHUFQD4CBcjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
4730
+ mixer: options.mixer ? _chunk7VOHOPLWcjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
4718
4731
  mixerLoad: cur.mixerLoad
4719
4732
  };
4720
4733
  this.state.paint = next;
@@ -4727,23 +4740,23 @@ var ImageEditorController = (_class6 = class {
4727
4740
  */
4728
4741
  loadMixerBrush(color) {
4729
4742
  const c = parseColor(_nullishCoalesce(color, () => ( this.state.paint.foreground)));
4730
- const load = _chunkHUFQD4CBcjs.loadMixer.call(void 0, this.state.paint.mixerLoad, [c[0] / 255, c[1] / 255, c[2] / 255]);
4743
+ const load = _chunk7VOHOPLWcjs.loadMixer.call(void 0, this.state.paint.mixerLoad, [c[0] / 255, c[1] / 255, c[2] / 255]);
4731
4744
  this.state.paint = { ...this.state.paint, mixerLoad: load };
4732
4745
  this.notify();
4733
4746
  return load;
4734
4747
  }
4735
4748
  /** Cleans the Mixer Brush: empties the pickup well (the reservoir is kept). Returns the brush load. */
4736
4749
  cleanMixerBrush() {
4737
- const load = _chunkHUFQD4CBcjs.cleanMixer.call(void 0, this.state.paint.mixerLoad);
4750
+ const load = _chunk7VOHOPLWcjs.cleanMixer.call(void 0, this.state.paint.mixerLoad);
4738
4751
  this.state.paint = { ...this.state.paint, mixerLoad: load };
4739
4752
  this.notify();
4740
4753
  return load;
4741
4754
  }
4742
4755
  /** Empties the Mixer Brush entirely (no reservoir, nothing picked up). Returns the brush load. */
4743
4756
  emptyMixerBrush() {
4744
- this.state.paint = { ...this.state.paint, mixerLoad: _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD };
4757
+ this.state.paint = { ...this.state.paint, mixerLoad: _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD };
4745
4758
  this.notify();
4746
- return _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD;
4759
+ return _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD;
4747
4760
  }
4748
4761
  /** D: black foreground, white background. */
4749
4762
  resetPaintColors() {
@@ -4757,26 +4770,26 @@ var ImageEditorController = (_class6 = class {
4757
4770
  /** Resolves and validates what a stroke, fill or clear paints into. */
4758
4771
  paintTarget(layerId, channel, action) {
4759
4772
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
4760
- if (!id) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
4761
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4773
+ if (!id) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
4774
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4762
4775
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
4763
4776
  if (ch === "mask") {
4764
- if (!layer.mask) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
4765
- if (layer.mask.source) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
4766
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "all", action);
4777
+ if (!layer.mask) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
4778
+ if (layer.mask.source) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
4779
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "all", action);
4767
4780
  } else if (ch === "filter-mask") {
4768
4781
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _183 => _183.smartFilters, 'optionalAccess', _184 => _184.mask])) {
4769
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
4782
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
4770
4783
  }
4771
- if (!_chunkD37BX2ZAcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
4772
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "all", action);
4784
+ if (!_chunkMGL4U5WAcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
4785
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "all", action);
4773
4786
  } else {
4774
- if (layer.type === "smart") throw new (0, _chunkD37BX2ZAcjs.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.`);
4775
- if (layer.type === "shape") throw new (0, _chunkD37BX2ZAcjs.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).`);
4776
- if (layer.type !== "pixel") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
4777
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "pixels", action);
4787
+ if (layer.type === "smart") throw new (0, _chunkMGL4U5WAcjs.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.`);
4788
+ if (layer.type === "shape") throw new (0, _chunkMGL4U5WAcjs.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).`);
4789
+ if (layer.type !== "pixel") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
4790
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "pixels", action);
4778
4791
  }
4779
- if (!layer.visible) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
4792
+ if (!layer.visible) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
4780
4793
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
4781
4794
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
4782
4795
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _185 => _185.locks, 'optionalAccess', _186 => _186.transparency]));
@@ -4785,7 +4798,7 @@ var ImageEditorController = (_class6 = class {
4785
4798
  /** The layer with its pixels (or mask) replaced by `surface`. */
4786
4799
  withSurface(layer, channel, surface) {
4787
4800
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
4788
- if (channel === "filter-mask") return _chunkD37BX2ZAcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
4801
+ if (channel === "filter-mask") return _chunkMGL4U5WAcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
4789
4802
  const next = { ...layer, surface };
4790
4803
  delete next.source;
4791
4804
  return next;
@@ -4798,12 +4811,12 @@ var ImageEditorController = (_class6 = class {
4798
4811
  */
4799
4812
  beginStroke(init = {}) {
4800
4813
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
4801
- if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use brush, eraser or mixer.`);
4814
+ if (tool !== "brush" && tool !== "eraser" && tool !== "mixer") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use brush, eraser or mixer.`);
4802
4815
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : "paint");
4803
4816
  if (tool === "mixer" && target.channel !== "pixels") {
4804
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
4817
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
4805
4818
  }
4806
- const brush = _chunkHUFQD4CBcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
4819
+ const brush = _chunk7VOHOPLWcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
4807
4820
  const color = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
4808
4821
  const background = parseColor(_nullishCoalesce(init.background, () => ( this.state.paint.background)));
4809
4822
  const toMaskGrey = (c) => {
@@ -4821,20 +4834,20 @@ var ImageEditorController = (_class6 = class {
4821
4834
  offset: target.offset
4822
4835
  };
4823
4836
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply);
4824
- return new PaintStrokeSession(this, target, new (0, _chunkHUFQD4CBcjs.StrokeCoverage)(brush), apply);
4837
+ return new PaintStrokeSession(this, target, new (0, _chunk7VOHOPLWcjs.StrokeCoverage)(brush), apply);
4825
4838
  }
4826
4839
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
4827
4840
  mixerStroke(init, brush) {
4828
- const settings = _chunkHUFQD4CBcjs.normalizeMixer.call(void 0, { ...this.state.paint.mixer, ..._nullishCoalesce(init.mixer, () => ( {})) });
4841
+ const settings = _chunk7VOHOPLWcjs.normalizeMixer.call(void 0, { ...this.state.paint.mixer, ..._nullishCoalesce(init.mixer, () => ( {})) });
4829
4842
  let load = this.state.paint.mixerLoad;
4830
4843
  if (init.color !== void 0 || settings.loadEachStroke) {
4831
4844
  const c = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
4832
- load = _chunkHUFQD4CBcjs.loadMixer.call(void 0, load, [c[0] / 255, c[1] / 255, c[2] / 255]);
4845
+ load = _chunk7VOHOPLWcjs.loadMixer.call(void 0, load, [c[0] / 255, c[1] / 255, c[2] / 255]);
4833
4846
  }
4834
4847
  return {
4835
- create: (pixels) => new (0, _chunkHUFQD4CBcjs.MixerStroke)(brush, settings, load, pixels),
4848
+ create: (pixels) => new (0, _chunk7VOHOPLWcjs.MixerStroke)(brush, settings, load, pixels),
4836
4849
  end: (after) => {
4837
- const next = settings.cleanEachStroke ? _chunkHUFQD4CBcjs.cleanMixer.call(void 0, after) : after;
4850
+ const next = settings.cleanEachStroke ? _chunk7VOHOPLWcjs.cleanMixer.call(void 0, after) : after;
4838
4851
  this.state.paint = { ...this.state.paint, mixerLoad: next };
4839
4852
  return next;
4840
4853
  }
@@ -4842,12 +4855,12 @@ var ImageEditorController = (_class6 = class {
4842
4855
  }
4843
4856
  /** @internal Shows a stroke's live surface (no history). */
4844
4857
  _strokeUpdate(layerId, channel, surface, rects) {
4845
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
4858
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
4846
4859
  this.notify(channel === "filter-mask" ? void 0 : rects);
4847
4860
  }
4848
4861
  /** @internal Commits a finished stroke as one undo step (`before` is the pre-stroke state). */
4849
4862
  _strokeCommit(before, layerId, channel, surface) {
4850
- if (surface) this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
4863
+ if (surface) this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => this.withSurface(l, channel, surface));
4851
4864
  else this.state.layers = before.layers;
4852
4865
  if (surface && !this.isApplyingHistory) {
4853
4866
  this.undoStack.push(before);
@@ -4867,9 +4880,9 @@ var ImageEditorController = (_class6 = class {
4867
4880
  * document bounds and the number of dabs.
4868
4881
  */
4869
4882
  paintStroke(init) {
4870
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("points must hold at least one { x, y } point.");
4883
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("points must hold at least one { x, y } point.");
4871
4884
  for (const p of init.points) {
4872
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _190 => _190.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _191 => _191.y]))) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
4885
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _190 => _190.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _191 => _191.y]))) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
4873
4886
  }
4874
4887
  const session = this.beginStroke(init);
4875
4888
  session.push(init.points);
@@ -4895,11 +4908,11 @@ var ImageEditorController = (_class6 = class {
4895
4908
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
4896
4909
  const { width, height } = this.naturalSize;
4897
4910
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
4898
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("opacity must be from 0 to 1.");
4899
- const blend = _nullishCoalesce(_chunkD37BX2ZAcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
4911
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("opacity must be from 0 to 1.");
4912
+ const blend = _nullishCoalesce(_chunkMGL4U5WAcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
4900
4913
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _192 => _192.state, 'access', _193 => _193.selection, 'optionalAccess', _194 => _194.bounds]) ? this.state.selection : null;
4901
4914
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _195 => _195.bounds]), () => ( { x: 0, y: 0, width, height }));
4902
- const coverage = new (0, _chunkHUFQD4CBcjs.CoverageMap)();
4915
+ const coverage = new (0, _chunk7VOHOPLWcjs.CoverageMap)();
4903
4916
  const ones = new Float32Array(region.width * region.height);
4904
4917
  if (sel) {
4905
4918
  for (let y = 0; y < region.height; y++) {
@@ -4924,14 +4937,14 @@ var ImageEditorController = (_class6 = class {
4924
4937
  offset: target.offset
4925
4938
  };
4926
4939
  const surface = paintCoverageInto(target.surface, coverage, apply, [region]);
4927
- const next = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => this.withSurface(l, target.channel, surface));
4940
+ const next = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => this.withSurface(l, target.channel, surface));
4928
4941
  this.commitLayers(next);
4929
4942
  return { layerId: target.id, channel: target.channel, bounds: region, dabs: 0 };
4930
4943
  }
4931
4944
  // --- Adjustments ---
4932
4945
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
4933
4946
  developLayer() {
4934
- return _chunkD37BX2ZAcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
4947
+ return _chunkMGL4U5WAcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
4935
4948
  }
4936
4949
  /**
4937
4950
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -4946,18 +4959,18 @@ var ImageEditorController = (_class6 = class {
4946
4959
  const target = this.developLayer();
4947
4960
  let layers = this.state.layers;
4948
4961
  if (target && (DEVELOP_KEYS.some((k) => k in partial) || "process" in partial)) {
4949
- layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, target.id, (l) => withDevelop(l, partial));
4962
+ layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, target.id, (l) => withDevelop(l, partial));
4950
4963
  }
4951
4964
  if ("blur" in partial && typeof partial.blur === "number") {
4952
4965
  const blur = Math.max(0, partial.blur);
4953
4966
  if (this.state.legacyOutputBlur !== void 0) this.state.legacyOutputBlur = blur;
4954
- else if (target) layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, target.id, (l) => withBlur(l, blur));
4967
+ else if (target) layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, target.id, (l) => withBlur(l, blur));
4955
4968
  }
4956
4969
  if ("opacity" in partial && typeof partial.opacity === "number") {
4957
4970
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
4958
4971
  }
4959
4972
  if ("layers" in partial) {
4960
- layers = this.replaceAdjustmentNodes(layers, _chunkD37BX2ZAcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
4973
+ layers = this.replaceAdjustmentNodes(layers, _chunkMGL4U5WAcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
4961
4974
  }
4962
4975
  this.state.layers = layers;
4963
4976
  this.notify();
@@ -4965,7 +4978,7 @@ var ImageEditorController = (_class6 = class {
4965
4978
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
4966
4979
  get isProcessOutdated() {
4967
4980
  this.syncViews();
4968
- return _chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkD37BX2ZAcjs.LATEST_PROCESS_VERSION;
4981
+ return _chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkMGL4U5WAcjs.LATEST_PROCESS_VERSION;
4969
4982
  }
4970
4983
  /**
4971
4984
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -4973,7 +4986,7 @@ var ImageEditorController = (_class6 = class {
4973
4986
  */
4974
4987
  upgradeProcess() {
4975
4988
  if (!this.isProcessOutdated) return false;
4976
- this.setAdjustments({ process: _chunkD37BX2ZAcjs.LATEST_PROCESS_VERSION });
4989
+ this.setAdjustments({ process: _chunkMGL4U5WAcjs.LATEST_PROCESS_VERSION });
4977
4990
  return true;
4978
4991
  }
4979
4992
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -4981,10 +4994,10 @@ var ImageEditorController = (_class6 = class {
4981
4994
  this.recordHistory();
4982
4995
  const target = this.developLayer();
4983
4996
  if (target) {
4984
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0,
4997
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0,
4985
4998
  this.state.layers,
4986
4999
  target.id,
4987
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkD37BX2ZAcjs.LATEST_PROCESS_VERSION }), 0)
5000
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkMGL4U5WAcjs.LATEST_PROCESS_VERSION }), 0)
4988
5001
  );
4989
5002
  }
4990
5003
  delete this.state.legacyOutputBlur;
@@ -5001,7 +5014,7 @@ var ImageEditorController = (_class6 = class {
5001
5014
  return this.getAdjustmentLayers().find((l) => l.id === id);
5002
5015
  }
5003
5016
  adjustmentNodes(layers = this.state.layers) {
5004
- return _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "adjustment");
5017
+ return _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers).filter((l) => l.type === "adjustment");
5005
5018
  }
5006
5019
  /**
5007
5020
  * Where a new layer goes when no position is given: directly above the topmost layer that is
@@ -5015,26 +5028,26 @@ var ImageEditorController = (_class6 = class {
5015
5028
  /** Inserts `node` by `aboveId` / `parentId` / adjustment index / default position. */
5016
5029
  placeLayer(layers, node, where) {
5017
5030
  if (where.aboveId) {
5018
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, layers, where.aboveId);
5019
- if (loc) return _chunkAZTZRLDIcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _196 => _196.parent, 'optionalAccess', _197 => _197.id]), () => ( null)), loc.index + 1);
5031
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, where.aboveId);
5032
+ if (loc) return _chunkPOGBUYWEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _196 => _196.parent, 'optionalAccess', _197 => _197.id]), () => ( null)), loc.index + 1);
5020
5033
  }
5021
5034
  if (where.parentId) {
5022
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, layers, where.parentId);
5023
- if (loc && loc.layer.type === "group") return _chunkAZTZRLDIcjs.insertLayer.call(void 0, layers, node, loc.layer.id);
5035
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, where.parentId);
5036
+ if (loc && loc.layer.type === "group") return _chunkPOGBUYWEcjs.insertLayer.call(void 0, layers, node, loc.layer.id);
5024
5037
  }
5025
5038
  if (where.adjustmentIndex !== void 0) {
5026
5039
  const nodes = this.adjustmentNodes(layers);
5027
5040
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
5028
5041
  if (at < nodes.length) {
5029
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, layers, nodes[at].id);
5030
- return _chunkAZTZRLDIcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _198 => _198.parent, 'optionalAccess', _199 => _199.id]), () => ( null)), loc.index);
5042
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, nodes[at].id);
5043
+ return _chunkPOGBUYWEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _198 => _198.parent, 'optionalAccess', _199 => _199.id]), () => ( null)), loc.index);
5031
5044
  }
5032
5045
  if (nodes.length) {
5033
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
5034
- return _chunkAZTZRLDIcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _200 => _200.parent, 'optionalAccess', _201 => _201.id]), () => ( null)), loc.index + 1);
5046
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
5047
+ return _chunkPOGBUYWEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _200 => _200.parent, 'optionalAccess', _201 => _201.id]), () => ( null)), loc.index + 1);
5035
5048
  }
5036
5049
  }
5037
- return _chunkAZTZRLDIcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
5050
+ return _chunkPOGBUYWEcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
5038
5051
  }
5039
5052
  /** `setAdjustments({ layers })`: updates nodes by id in place, removes missing ones, adds new ones. */
5040
5053
  replaceAdjustmentNodes(layers, next) {
@@ -5043,12 +5056,12 @@ var ImageEditorController = (_class6 = class {
5043
5056
  let out = layers;
5044
5057
  for (const node of this.adjustmentNodes(layers)) {
5045
5058
  const update = byId.get(node.id);
5046
- out = _chunkAZTZRLDIcjs.mapLayer.call(void 0, out, node.id, () => update ? mergeAdjustmentNode(node, update, width, height) : null);
5059
+ out = _chunkPOGBUYWEcjs.mapLayer.call(void 0, out, node.id, () => update ? mergeAdjustmentNode(node, update, width, height) : null);
5047
5060
  }
5048
5061
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
5049
5062
  for (const l of next) {
5050
5063
  if (existing.has(l.id)) continue;
5051
- out = this.placeLayer(out, _chunkD37BX2ZAcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
5064
+ out = this.placeLayer(out, _chunkMGL4U5WAcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
5052
5065
  }
5053
5066
  const order = next.map((l) => l.id);
5054
5067
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -5062,8 +5075,8 @@ var ImageEditorController = (_class6 = class {
5062
5075
  */
5063
5076
  addAdjustmentLayer(init, index) {
5064
5077
  const spec = typeof init === "string" ? { kind: init } : init;
5065
- const ids = new Set(_chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5066
- const layer = _chunkD37BX2ZAcjs.createAdjustmentLayer.call(void 0, spec.kind, {
5078
+ const ids = new Set(_chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5079
+ const layer = _chunkMGL4U5WAcjs.createAdjustmentLayer.call(void 0, spec.kind, {
5067
5080
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
5068
5081
  name: spec.name,
5069
5082
  params: spec.params,
@@ -5072,10 +5085,10 @@ var ImageEditorController = (_class6 = class {
5072
5085
  blend: spec.blend,
5073
5086
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
5074
5087
  });
5075
- while (ids.has(layer.id)) layer.id = _chunkD37BX2ZAcjs.newLayerId.call(void 0, "adj");
5088
+ while (ids.has(layer.id)) layer.id = _chunkMGL4U5WAcjs.newLayerId.call(void 0, "adj");
5076
5089
  const { width, height } = this.naturalSize;
5077
5090
  this.recordHistory();
5078
- const node = _chunkD37BX2ZAcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
5091
+ const node = _chunkMGL4U5WAcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
5079
5092
  const positioned = Boolean(spec.aboveId || spec.parentId);
5080
5093
  this.state.layers = this.placeLayer(this.state.layers, node, {
5081
5094
  aboveId: spec.aboveId,
@@ -5091,11 +5104,11 @@ var ImageEditorController = (_class6 = class {
5091
5104
  * Returns false for an unknown id.
5092
5105
  */
5093
5106
  updateAdjustmentLayer(id, update, commitToHistory = true) {
5094
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, id);
5107
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, id);
5095
5108
  if (!loc || loc.layer.type !== "adjustment") return false;
5096
5109
  const { width, height } = this.naturalSize;
5097
5110
  const node = loc.layer;
5098
- const merged = _chunkD37BX2ZAcjs.normalizeAdjustmentLayer.call(void 0, {
5111
+ const merged = _chunkMGL4U5WAcjs.normalizeAdjustmentLayer.call(void 0, {
5099
5112
  id: node.id,
5100
5113
  kind: node.kind,
5101
5114
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -5115,20 +5128,20 @@ var ImageEditorController = (_class6 = class {
5115
5128
  params: merged.params
5116
5129
  };
5117
5130
  if (update.mask !== void 0) {
5118
- const mask = update.mask ? _chunkD37BX2ZAcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
5131
+ const mask = update.mask ? _chunkMGL4U5WAcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
5119
5132
  if (mask) next.mask = mask;
5120
5133
  else delete next.mask;
5121
5134
  }
5122
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, id, () => next);
5135
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => next);
5123
5136
  this.notify();
5124
5137
  return true;
5125
5138
  }
5126
5139
  /** Removes a layer as one undo step. Returns false for an unknown id. */
5127
5140
  removeAdjustmentLayer(id) {
5128
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, id);
5141
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, id);
5129
5142
  if (!loc || loc.layer.type !== "adjustment") return false;
5130
5143
  this.recordHistory();
5131
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, id, () => null);
5144
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => null);
5132
5145
  if (this.state.activeLayerId === id) this.state.activeLayerId = null;
5133
5146
  this.notify();
5134
5147
  return true;
@@ -5141,9 +5154,9 @@ var ImageEditorController = (_class6 = class {
5141
5154
  if (to === from) return layers;
5142
5155
  const node = nodes[from];
5143
5156
  const anchor = nodes[to];
5144
- const without = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, id, () => null);
5145
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, without, anchor.id);
5146
- return _chunkAZTZRLDIcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
5157
+ const without = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, id, () => null);
5158
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, without, anchor.id);
5159
+ return _chunkPOGBUYWEcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
5147
5160
  }
5148
5161
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
5149
5162
  moveAdjustmentLayer(id, toIndex) {
@@ -5168,7 +5181,7 @@ var ImageEditorController = (_class6 = class {
5168
5181
  if (!nodes.length) return;
5169
5182
  this.recordHistory();
5170
5183
  let layers = this.state.layers;
5171
- for (const n of nodes) layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, n.id, () => null);
5184
+ for (const n of nodes) layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, n.id, () => null);
5172
5185
  this.state.layers = layers;
5173
5186
  if (nodes.some((n) => n.id === this.state.activeLayerId)) this.state.activeLayerId = null;
5174
5187
  this.notify();
@@ -5202,8 +5215,8 @@ var ImageEditorController = (_class6 = class {
5202
5215
  const { width, height } = this.naturalSize;
5203
5216
  let next = null;
5204
5217
  if (mask) {
5205
- const sized = mask.width === width && mask.height === height ? mask : _chunkD37BX2ZAcjs.resizeSelection.call(void 0, mask, width, height);
5206
- next = _chunkD37BX2ZAcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
5218
+ const sized = mask.width === width && mask.height === height ? mask : _chunkMGL4U5WAcjs.resizeSelection.call(void 0, mask, width, height);
5219
+ next = _chunkMGL4U5WAcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
5207
5220
  } else if (mode !== "replace") {
5208
5221
  return false;
5209
5222
  }
@@ -5217,7 +5230,7 @@ var ImageEditorController = (_class6 = class {
5217
5230
  /** Select › All. */
5218
5231
  selectAll() {
5219
5232
  const { width, height } = this.naturalSize;
5220
- return this.setSelection(_chunkD37BX2ZAcjs.fullSelection.call(void 0, width, height));
5233
+ return this.setSelection(_chunkMGL4U5WAcjs.fullSelection.call(void 0, width, height));
5221
5234
  }
5222
5235
  /** Select › Deselect. */
5223
5236
  deselect() {
@@ -5226,11 +5239,11 @@ var ImageEditorController = (_class6 = class {
5226
5239
  /** Select › Inverse (with nothing selected, selects everything). */
5227
5240
  invertSelection() {
5228
5241
  const { width, height } = this.naturalSize;
5229
- const current = _nullishCoalesce(this.state.selection, () => ( _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, width, height)));
5230
- return this.setSelection(_chunkD37BX2ZAcjs.invertSelection.call(void 0, current));
5242
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, width, height)));
5243
+ return this.setSelection(_chunkMGL4U5WAcjs.invertSelection.call(void 0, current));
5231
5244
  }
5232
5245
  shapeCommand(mask, options) {
5233
- const shaped = options.feather && options.feather > 0 ? _chunkD37BX2ZAcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
5246
+ const shaped = options.feather && options.feather > 0 ? _chunkMGL4U5WAcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
5234
5247
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
5235
5248
  }
5236
5249
  /** Rectangular marquee in natural image pixels. */
@@ -5284,32 +5297,32 @@ var ImageEditorController = (_class6 = class {
5284
5297
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
5285
5298
  return null;
5286
5299
  }
5287
- const legacy = _chunkD37BX2ZAcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
5300
+ const legacy = _chunkMGL4U5WAcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
5288
5301
  if (options.sample === "active-layer") {
5289
5302
  const layer = this.getActiveLayer();
5290
5303
  if (!layer || layer.type !== "pixel") {
5291
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
5304
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
5292
5305
  }
5293
- const surface = layer.source === "document" && options.pixels ? _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
5294
- return { width, height, data: _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
5306
+ const surface = layer.source === "document" && options.pixels ? _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
5307
+ return { width, height, data: _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
5295
5308
  }
5296
5309
  if (legacy && !options.sampleMerged) return base;
5297
5310
  this.syncViews();
5298
5311
  if (legacy && !options.pixels) {
5299
5312
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
5300
- _chunkD37BX2ZAcjs.applyAdjustments.call(void 0, copy, _chunkD37BX2ZAcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
5313
+ _chunkMGL4U5WAcjs.applyAdjustments.call(void 0, copy, _chunkMGL4U5WAcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
5301
5314
  return copy;
5302
5315
  }
5303
5316
  const pixels = options.pixels;
5304
5317
  const sources = {
5305
5318
  width,
5306
5319
  height,
5307
- surfaceOf: (l) => l.type === "pixel" && l.source === "document" && pixels ? _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, pixels, 4) : this.surfaceOf(l),
5320
+ surfaceOf: (l) => l.type === "pixel" && l.source === "document" && pixels ? _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, pixels, 4) : this.surfaceOf(l),
5308
5321
  version: pixels ? "pixels" : this.sourceVersion()
5309
5322
  };
5310
5323
  const stack = withoutAnnotations(this.state.layers);
5311
5324
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
5312
- const data = new (0, _chunkD37BX2ZAcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
5325
+ const data = new (0, _chunkMGL4U5WAcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
5313
5326
  return { width, height, data };
5314
5327
  }
5315
5328
  async requirePixels(options) {
@@ -5336,7 +5349,7 @@ var ImageEditorController = (_class6 = class {
5336
5349
  modifySelection(op, radius) {
5337
5350
  const sel = this.state.selection;
5338
5351
  if (!_optionalChain([sel, 'optionalAccess', _209 => _209.bounds])) return false;
5339
- return this.setSelection(_chunkD37BX2ZAcjs.modifySelection.call(void 0, sel, op, radius));
5352
+ return this.setSelection(_chunkMGL4U5WAcjs.modifySelection.call(void 0, sel, op, radius));
5340
5353
  }
5341
5354
  /**
5342
5355
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -5367,7 +5380,7 @@ var ImageEditorController = (_class6 = class {
5367
5380
  } else {
5368
5381
  pixels = source;
5369
5382
  }
5370
- this.setSelection(_chunkD37BX2ZAcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
5383
+ this.setSelection(_chunkMGL4U5WAcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
5371
5384
  return this.getSelection();
5372
5385
  }
5373
5386
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -5379,8 +5392,8 @@ var ImageEditorController = (_class6 = class {
5379
5392
  // --- Layer masks ---
5380
5393
  maskFromSelection(sel, props = {}) {
5381
5394
  const { width, height } = this.naturalSize;
5382
- const sized = sel.width === width && sel.height === height ? sel : _chunkD37BX2ZAcjs.resizeSelection.call(void 0, sel, width, height);
5383
- const mask = { surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
5395
+ const sized = sel.width === width && sel.height === height ? sel : _chunkMGL4U5WAcjs.resizeSelection.call(void 0, sel, width, height);
5396
+ const mask = { surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
5384
5397
  return withMaskProps(mask, props);
5385
5398
  }
5386
5399
  /**
@@ -5393,10 +5406,10 @@ var ImageEditorController = (_class6 = class {
5393
5406
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
5394
5407
  }
5395
5408
  setLayerMask(layerId, mask, commitToHistory = true) {
5396
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, layerId);
5409
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, layerId);
5397
5410
  if (!loc) return false;
5398
5411
  if (commitToHistory) this.recordHistory();
5399
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
5412
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
5400
5413
  const next = { ...l };
5401
5414
  if (mask) next.mask = mask;
5402
5415
  else delete next.mask;
@@ -5424,8 +5437,8 @@ var ImageEditorController = (_class6 = class {
5424
5437
  const { width, height } = this.naturalSize;
5425
5438
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
5426
5439
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
5427
- const data = _chunkSZ6KMZNMcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
5428
- const sel = _chunkD37BX2ZAcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
5440
+ const data = _chunkXIOMMGPDcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
5441
+ const sel = _chunkMGL4U5WAcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
5429
5442
  return this.setSelection(sel, mode);
5430
5443
  }
5431
5444
  // --- Histogram ---
@@ -5453,11 +5466,11 @@ var ImageEditorController = (_class6 = class {
5453
5466
  if (target) {
5454
5467
  const merged = { ...this.state.depthMask, ...partial };
5455
5468
  merged.depthRange = [...merged.depthRange];
5456
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
5469
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
5457
5470
  const next = { ...l };
5458
- if (_chunkD37BX2ZAcjs.isDefaultDepthMask.call(void 0, merged)) {
5471
+ if (_chunkMGL4U5WAcjs.isDefaultDepthMask.call(void 0, merged)) {
5459
5472
  if (_optionalChain([next, 'access', _215 => _215.mask, 'optionalAccess', _216 => _216.source])) delete next.mask;
5460
- } else next.mask = _chunkD37BX2ZAcjs.depthRasterMask.call(void 0, merged);
5473
+ } else next.mask = _chunkMGL4U5WAcjs.depthRasterMask.call(void 0, merged);
5461
5474
  return next;
5462
5475
  });
5463
5476
  }
@@ -5467,7 +5480,7 @@ var ImageEditorController = (_class6 = class {
5467
5480
  this.recordHistory();
5468
5481
  const target = this.developLayer();
5469
5482
  if (_optionalChain([target, 'optionalAccess', _217 => _217.mask, 'optionalAccess', _218 => _218.source])) {
5470
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
5483
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
5471
5484
  const next = { ...l };
5472
5485
  delete next.mask;
5473
5486
  return next;
@@ -5478,7 +5491,7 @@ var ImageEditorController = (_class6 = class {
5478
5491
  // --- Annotations & Layers ---
5479
5492
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
5480
5493
  annotationLayer(id) {
5481
- return _chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape") && _optionalChain([_chunkD37BX2ZAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _219 => _219.id]) === id);
5494
+ return _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape") && _optionalChain([_chunkMGL4U5WAcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _219 => _219.id]) === id);
5482
5495
  }
5483
5496
  /**
5484
5497
  * Adds an annotation as its own layer (top of the stack unless `aboveId` is given). Pen,
@@ -5490,9 +5503,9 @@ var ImageEditorController = (_class6 = class {
5490
5503
  this.recordHistory();
5491
5504
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
5492
5505
  const fullAnnotation = { ...annotation, id };
5493
- const layer = _chunkD37BX2ZAcjs.annotationLayerFor.call(void 0, fullAnnotation, this.shapeEnv());
5494
- const loc = placement.aboveId ? _chunkAZTZRLDIcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
5495
- this.state.layers = loc ? _chunkAZTZRLDIcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _220 => _220.parent, 'optionalAccess', _221 => _221.id]), () => ( null)), loc.index + 1) : _chunkAZTZRLDIcjs.insertLayer.call(void 0, this.state.layers, layer, null);
5506
+ const layer = _chunkMGL4U5WAcjs.annotationLayerFor.call(void 0, fullAnnotation, this.shapeEnv());
5507
+ const loc = placement.aboveId ? _chunkPOGBUYWEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
5508
+ this.state.layers = loc ? _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _220 => _220.parent, 'optionalAccess', _221 => _221.id]), () => ( null)), loc.index + 1) : _chunkPOGBUYWEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
5496
5509
  this.state.selectedAnnotationId = id;
5497
5510
  this.notify();
5498
5511
  return id;
@@ -5502,27 +5515,27 @@ var ImageEditorController = (_class6 = class {
5502
5515
  this.recordHistory();
5503
5516
  }
5504
5517
  const layer = this.annotationLayer(id);
5505
- const current = layer ? _chunkD37BX2ZAcjs.annotationOfLayer.call(void 0, layer) : null;
5518
+ const current = layer ? _chunkMGL4U5WAcjs.annotationOfLayer.call(void 0, layer) : null;
5506
5519
  if (layer && current) {
5507
5520
  const annotation = { ...current, ...partial, id };
5508
- const name = layer.name === _chunkD37BX2ZAcjs.annotationLayerName.call(void 0, current) ? _chunkD37BX2ZAcjs.annotationLayerName.call(void 0, annotation) : layer.name;
5509
- this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
5521
+ const name = layer.name === _chunkMGL4U5WAcjs.annotationLayerName.call(void 0, current) ? _chunkMGL4U5WAcjs.annotationLayerName.call(void 0, annotation) : layer.name;
5522
+ this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
5510
5523
  }
5511
5524
  this.notify();
5512
5525
  }
5513
5526
  /** `layer` (an annotation or migrated shape layer) showing `annotation` instead, keeping its other properties. */
5514
5527
  layerForAnnotation(layer, annotation, name) {
5515
- const shape = _chunkD37BX2ZAcjs.shapeFromAnnotation.call(void 0, annotation);
5528
+ const shape = _chunkMGL4U5WAcjs.shapeFromAnnotation.call(void 0, annotation);
5516
5529
  const { annotation: _old, ...props } = layer;
5517
5530
  const blend = annotation.blend && annotation.blend !== "normal" ? annotation.blend : "normal";
5518
5531
  if (shape) {
5519
5532
  const base = { ...props, name, blend: layer.type === "annotation" && layer.blend !== "normal" ? layer.blend : blend };
5520
5533
  if (layer.type === "shape") {
5521
- const fresh = _chunkD37BX2ZAcjs.rerenderShape.call(void 0, { ...base, components: shape.components, fill: shape.fill, stroke: shape.stroke }, this.shapeEnv());
5534
+ const fresh = _chunkMGL4U5WAcjs.rerenderShape.call(void 0, { ...base, components: shape.components, fill: shape.fill, stroke: shape.stroke }, this.shapeEnv());
5522
5535
  delete fresh.fillRule;
5523
5536
  return { ...fresh, annotation };
5524
5537
  }
5525
- const created = _chunkD37BX2ZAcjs.createShapeLayer.call(void 0, { ...shape, name, blend: base.blend }, this.shapeEnv(), layer.id);
5538
+ const created = _chunkMGL4U5WAcjs.createShapeLayer.call(void 0, { ...shape, name, blend: base.blend }, this.shapeEnv(), layer.id);
5526
5539
  const { type: _t2, ...rest2 } = base;
5527
5540
  return { ...rest2, ...created, annotation };
5528
5541
  }
@@ -5532,7 +5545,7 @@ var ImageEditorController = (_class6 = class {
5532
5545
  removeAnnotation(id) {
5533
5546
  this.recordHistory();
5534
5547
  const layer = this.annotationLayer(id);
5535
- if (layer) this.state.layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => null);
5548
+ if (layer) this.state.layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => null);
5536
5549
  if (this.state.selectedAnnotationId === id) {
5537
5550
  this.state.selectedAnnotationId = null;
5538
5551
  }
@@ -5542,7 +5555,7 @@ var ImageEditorController = (_class6 = class {
5542
5555
  clearAnnotations() {
5543
5556
  this.recordHistory();
5544
5557
  let layers = this.state.layers;
5545
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || l.type === "shape" && l.annotation) layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, l.id, () => null);
5558
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || l.type === "shape" && l.annotation) layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => null);
5546
5559
  this.state.layers = layers;
5547
5560
  this.state.selectedAnnotationId = null;
5548
5561
  this.notify();
@@ -5621,7 +5634,7 @@ var ImageEditorController = (_class6 = class {
5621
5634
  this.syncViews();
5622
5635
  if (_optionalChain([options, 'optionalAccess', _222 => _222.layerIds])) {
5623
5636
  const keep = new Set(options.layerIds);
5624
- const layers = _chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
5637
+ const layers = _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
5625
5638
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
5626
5639
  }
5627
5640
  return this.renderer.renderExport(source, this.state, options);
@@ -5731,10 +5744,10 @@ var ImageEditorController = (_class6 = class {
5731
5744
  /** No source image, and no layer reading one (an opened PSD): the layers are the whole document. */
5732
5745
  isSourceless() {
5733
5746
  if (this.imageElement || this.state.sourceUrl || !this.state.layers.length) return false;
5734
- return !_chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "pixel" && l.source === "document");
5747
+ return !_chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).some((l) => l.type === "pixel" && l.source === "document");
5735
5748
  }
5736
5749
  get isMultiLayer() {
5737
- return _chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" || l.type === "group").length > 1;
5750
+ return _chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" || l.type === "group").length > 1;
5738
5751
  }
5739
5752
  /**
5740
5753
  * Applies an inpainted result (natural image space, see `toSourceDataURL`) as ONE undoable step.
@@ -5769,16 +5782,16 @@ var ImageEditorController = (_class6 = class {
5769
5782
  return;
5770
5783
  }
5771
5784
  const target = this.developLayer();
5772
- if (!target) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("There is no pixel layer to mask.");
5773
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, target, "all", "mask it");
5785
+ if (!target) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("There is no pixel layer to mask.");
5786
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, target, "all", "mask it");
5774
5787
  const { width, height } = this.naturalSize;
5775
5788
  let px2 = await this.decodeImage(newDataUrl);
5776
5789
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
5777
5790
  const alpha = new Uint8ClampedArray(width * height);
5778
5791
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
5779
- let surface = _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
5780
- if (target.offset.x || target.offset.y) surface = _chunkSZ6KMZNMcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
5781
- this.commitLayers(_chunkD37BX2ZAcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
5792
+ let surface = _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
5793
+ if (target.offset.x || target.offset.y) surface = _chunkXIOMMGPDcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
5794
+ this.commitLayers(_chunkMGL4U5WAcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
5782
5795
  return target.id;
5783
5796
  }
5784
5797
  // --- Shape layers ---
@@ -5788,14 +5801,14 @@ var ImageEditorController = (_class6 = class {
5788
5801
  }
5789
5802
  /** One component from tool or UI input (validated). */
5790
5803
  componentFrom(spec, path) {
5791
- const op = _chunkD37BX2ZAcjs.requireOperation.call(void 0, spec.op, `${path}op`);
5792
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
5793
- if (spec.shape !== void 0) return _chunkD37BX2ZAcjs.liveComponent.call(void 0, _chunkD37BX2ZAcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
5794
- if (spec.subpaths !== void 0) return { op, subpaths: _chunkD37BX2ZAcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
5795
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
5804
+ const op = _chunkMGL4U5WAcjs.requireOperation.call(void 0, spec.op, `${path}op`);
5805
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
5806
+ if (spec.shape !== void 0) return _chunkMGL4U5WAcjs.liveComponent.call(void 0, _chunkMGL4U5WAcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
5807
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkMGL4U5WAcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
5808
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
5796
5809
  }
5797
5810
  shapeInfo(id) {
5798
- const layer = _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5811
+ const layer = _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5799
5812
  const r = (n) => Math.round(n * 1e3) / 1e3;
5800
5813
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
5801
5814
  const info = {
@@ -5806,12 +5819,12 @@ var ImageEditorController = (_class6 = class {
5806
5819
  op: c.op,
5807
5820
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
5808
5821
  subpaths: _chunkW3GXSUSQcjs.roundSubpaths.call(void 0, c.subpaths),
5809
- bounds: box(_chunkD37BX2ZAcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
5822
+ bounds: box(_chunkMGL4U5WAcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
5810
5823
  })),
5811
5824
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
5812
5825
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
5813
5826
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
5814
- geometryBounds: box(_chunkD37BX2ZAcjs.shapeGeometryBounds.call(void 0, layer)),
5827
+ geometryBounds: box(_chunkMGL4U5WAcjs.shapeGeometryBounds.call(void 0, layer)),
5815
5828
  bounds: this.getLayerBounds(id)
5816
5829
  };
5817
5830
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -5828,17 +5841,17 @@ var ImageEditorController = (_class6 = class {
5828
5841
  */
5829
5842
  addShapeLayer(init) {
5830
5843
  const specs = _optionalChain([init, 'access', _230 => _230.components, 'optionalAccess', _231 => _231.length]) ? init.components : [init];
5831
- if (_optionalChain([init, 'access', _232 => _232.components, 'optionalAccess', _233 => _233.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
5844
+ if (_optionalChain([init, 'access', _232 => _232.components, 'optionalAccess', _233 => _233.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
5832
5845
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _234 => _234.components, 'optionalAccess', _235 => _235.length]) ? `components[${i}].` : ""));
5833
- const stroke = init.stroke ? _chunkD37BX2ZAcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
5846
+ const stroke = init.stroke ? _chunkMGL4U5WAcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
5834
5847
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
5835
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkD37BX2ZAcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkD37BX2ZAcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
5836
- if (!fill && !stroke) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
5837
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
5838
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("opacity must be between 0 and 1.");
5839
- if (init.blend !== void 0 && !_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
5840
- const layer = _chunkD37BX2ZAcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
5841
- const next = _chunkD37BX2ZAcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
5848
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkMGL4U5WAcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkMGL4U5WAcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
5849
+ if (!fill && !stroke) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
5850
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
5851
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("opacity must be between 0 and 1.");
5852
+ if (init.blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
5853
+ const layer = _chunkMGL4U5WAcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
5854
+ const next = _chunkMGL4U5WAcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
5842
5855
  this.commitLayers(next, () => {
5843
5856
  this.state.activeLayerId = layer.id;
5844
5857
  this.state.activeTarget = "pixels";
@@ -5851,18 +5864,18 @@ var ImageEditorController = (_class6 = class {
5851
5864
  * only those settings of the current stroke. Returns the shape.
5852
5865
  */
5853
5866
  setShapeStyle(id, changes, commitToHistory = true) {
5854
- const layer = _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5855
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkD37BX2ZAcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
5856
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkD37BX2ZAcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
5857
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
5867
+ const layer = _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5868
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkMGL4U5WAcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
5869
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkMGL4U5WAcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
5870
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
5858
5871
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
5859
- const { layers } = _chunkD37BX2ZAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
5872
+ const { layers } = _chunkMGL4U5WAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
5860
5873
  this.commitLayers(layers, void 0, commitToHistory);
5861
5874
  return this.shapeInfo(id);
5862
5875
  }
5863
5876
  componentIndex(layer, index) {
5864
5877
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
5865
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
5878
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
5866
5879
  }
5867
5880
  return index;
5868
5881
  }
@@ -5872,36 +5885,36 @@ var ImageEditorController = (_class6 = class {
5872
5885
  * the live shape) or its operation. Returns the shape.
5873
5886
  */
5874
5887
  setShapeComponent(id, index, change, commitToHistory = true) {
5875
- const layer = _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5888
+ const layer = _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5876
5889
  const i = this.componentIndex(layer, index);
5877
5890
  const current = layer.components[i];
5878
5891
  let shape = change.shape;
5879
5892
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
5880
5893
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
5881
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkD37BX2ZAcjs.requireOperation.call(void 0, change.op) };
5894
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkMGL4U5WAcjs.requireOperation.call(void 0, change.op) };
5882
5895
  const components = layer.components.map((c, k) => k === i ? next : c);
5883
- const { layers } = _chunkD37BX2ZAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
5896
+ const { layers } = _chunkMGL4U5WAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
5884
5897
  this.commitLayers(layers, void 0, commitToHistory);
5885
5898
  return this.shapeInfo(id);
5886
5899
  }
5887
5900
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
5888
5901
  addShapeComponent(id, spec, index) {
5889
- const layer = _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5902
+ const layer = _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5890
5903
  const c = this.componentFrom(spec, "");
5891
5904
  const at = index === void 0 ? layer.components.length : index;
5892
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
5905
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
5893
5906
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
5894
- const { layers } = _chunkD37BX2ZAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
5907
+ const { layers } = _chunkMGL4U5WAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
5895
5908
  this.commitLayers(layers);
5896
5909
  return this.shapeInfo(id);
5897
5910
  }
5898
5911
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
5899
5912
  removeShapeComponent(id, index) {
5900
- const layer = _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5913
+ const layer = _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5901
5914
  const i = this.componentIndex(layer, index);
5902
- if (layer.components.length === 1) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
5915
+ if (layer.components.length === 1) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
5903
5916
  const components = layer.components.filter((_, k) => k !== i);
5904
- const { layers } = _chunkD37BX2ZAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
5917
+ const { layers } = _chunkMGL4U5WAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
5905
5918
  this.commitLayers(layers);
5906
5919
  return this.shapeInfo(id);
5907
5920
  }
@@ -5910,10 +5923,10 @@ var ImageEditorController = (_class6 = class {
5910
5923
  * shapes become paths), as one undo step. Returns the shape.
5911
5924
  */
5912
5925
  mergeShapeComponents(id) {
5913
- const layer = _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5914
- if (layer.components.length < 2) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
5915
- const components = _chunkD37BX2ZAcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
5916
- const { layers } = _chunkD37BX2ZAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
5926
+ const layer = _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, this.state.layers, id);
5927
+ if (layer.components.length < 2) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
5928
+ const components = _chunkMGL4U5WAcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
5929
+ const { layers } = _chunkMGL4U5WAcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
5917
5930
  this.commitLayers(layers);
5918
5931
  return this.shapeInfo(id);
5919
5932
  }
@@ -5923,8 +5936,8 @@ var ImageEditorController = (_class6 = class {
5923
5936
  * step. Returns the layer id.
5924
5937
  */
5925
5938
  async rasterizeLayer(id) {
5926
- const layer = _chunkD37BX2ZAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5927
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
5939
+ const layer = _chunkMGL4U5WAcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5940
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
5928
5941
  const { width, height } = this.naturalSize;
5929
5942
  const canvas = { x: 0, y: 0, width, height };
5930
5943
  let next;
@@ -5940,8 +5953,8 @@ var ImageEditorController = (_class6 = class {
5940
5953
  if (layer.locks) next.locks = layer.locks;
5941
5954
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
5942
5955
  } else if (layer.type === "pixel") {
5943
- if (!_optionalChain([layer, 'access', _236 => _236.filters, 'optionalAccess', _237 => _237.length])) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
5944
- _chunkD37BX2ZAcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
5956
+ if (!_optionalChain([layer, 'access', _236 => _236.filters, 'optionalAccess', _237 => _237.length])) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
5957
+ _chunkMGL4U5WAcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
5945
5958
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
5946
5959
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
5947
5960
  delete content.mask;
@@ -5953,17 +5966,17 @@ var ImageEditorController = (_class6 = class {
5953
5966
  delete next.filters;
5954
5967
  delete next.source;
5955
5968
  if (layer.mask && (layer.offset.x || layer.offset.y)) {
5956
- next.mask = { ...layer.mask, surface: _chunkSZ6KMZNMcjs.translateSurface.call(void 0, layer.mask.surface, layer.offset.x, layer.offset.y) };
5969
+ next.mask = { ...layer.mask, surface: _chunkXIOMMGPDcjs.translateSurface.call(void 0, layer.mask.surface, layer.offset.x, layer.offset.y) };
5957
5970
  }
5958
5971
  } else if (layer.type === "smart") {
5959
5972
  return this.rasterizeSmartObject(id);
5960
5973
  } else if (layer.type === "shape") {
5961
- next = _chunkD37BX2ZAcjs.shapeAsPixelLayer.call(void 0, layer);
5974
+ next = _chunkMGL4U5WAcjs.shapeAsPixelLayer.call(void 0, layer);
5962
5975
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _238 => _238.annotation, 'optionalAccess', _239 => _239.id])) this.state.selectedAnnotationId = null;
5963
5976
  } else {
5964
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Only shape 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.`);
5977
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Only shape 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.`);
5965
5978
  }
5966
- this.commitLayers(_chunkAZTZRLDIcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
5979
+ this.commitLayers(_chunkPOGBUYWEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
5967
5980
  return id;
5968
5981
  }
5969
5982
  // --- PSD ---
@@ -5976,7 +5989,7 @@ var ImageEditorController = (_class6 = class {
5976
5989
  * Throws `PsdError` for files that cannot be read at all.
5977
5990
  */
5978
5991
  loadPsd(bytes) {
5979
- const result = _chunkD37BX2ZAcjs.importPsd.call(void 0, bytes, { newId: () => _chunkD37BX2ZAcjs.newLayerId.call(void 0, ) });
5992
+ const result = _chunkMGL4U5WAcjs.importPsd.call(void 0, bytes, { newId: () => _chunkMGL4U5WAcjs.newLayerId.call(void 0, ) });
5980
5993
  this.abandonContents();
5981
5994
  this.recordHistory();
5982
5995
  const s = this.state;
@@ -5986,12 +5999,12 @@ var ImageEditorController = (_class6 = class {
5986
5999
  if (!this.samplePixelsOverride) this.samplePixels = null;
5987
6000
  s.layers = result.layers;
5988
6001
  s.crop = null;
5989
- s.transform = { ..._chunkD37BX2ZAcjs.DEFAULT_TRANSFORM_VALUES };
6002
+ s.transform = { ..._chunkMGL4U5WAcjs.DEFAULT_TRANSFORM_VALUES };
5990
6003
  s.outputOpacity = 1;
5991
6004
  delete s.legacyOutputBlur;
5992
6005
  s.selection = null;
5993
6006
  s.selectedAnnotationId = null;
5994
- const pixels = _chunkAZTZRLDIcjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "pixel");
6007
+ const pixels = _chunkPOGBUYWEcjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "pixel");
5995
6008
  s.activeLayerId = pixels.length ? pixels[pixels.length - 1].id : null;
5996
6009
  s.activeTarget = "pixels";
5997
6010
  this.psdResolution = result.resolution;
@@ -6002,7 +6015,7 @@ var ImageEditorController = (_class6 = class {
6002
6015
  this.lastLoadProblems = result.warnings;
6003
6016
  this.notify();
6004
6017
  return {
6005
- layerIds: _chunkAZTZRLDIcjs.flattenLayers.call(void 0, result.layers).map((l) => l.id),
6018
+ layerIds: _chunkPOGBUYWEcjs.flattenLayers.call(void 0, result.layers).map((l) => l.id),
6006
6019
  warnings: result.warnings,
6007
6020
  width: result.width,
6008
6021
  height: result.height,
@@ -6024,7 +6037,7 @@ var ImageEditorController = (_class6 = class {
6024
6037
  const canRasterize = this.renderer.canRasterize();
6025
6038
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
6026
6039
  const sources = this.renderer.compositorSources(width, height);
6027
- const compositor = new (0, _chunkD37BX2ZAcjs.LayerCompositor)();
6040
+ const compositor = new (0, _chunkMGL4U5WAcjs.LayerCompositor)();
6028
6041
  const bakeMask = (layer) => {
6029
6042
  const mask = layer.mask;
6030
6043
  if (!_optionalChain([mask, 'optionalAccess', _240 => _240.source])) return mask;
@@ -6036,7 +6049,7 @@ var ImageEditorController = (_class6 = class {
6036
6049
  const bytes = new Uint8ClampedArray(width * height);
6037
6050
  if (coverage) for (let i = 0; i < bytes.length; i++) bytes[i] = Math.round(coverage[i] * 255);
6038
6051
  else bytes.fill(255);
6039
- const baked = { surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data: bytes }, 1, -ox, -oy), defaultValue: 0 };
6052
+ const baked = { surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data: bytes }, 1, -ox, -oy), defaultValue: 0 };
6040
6053
  if (mask.density !== void 0 && mask.density < 1) baked.density = mask.density;
6041
6054
  if (mask.feather) baked.feather = mask.feather;
6042
6055
  if (mask.enabled === false) baked.enabled = false;
@@ -6076,7 +6089,7 @@ var ImageEditorController = (_class6 = class {
6076
6089
  visible: layer.visible,
6077
6090
  opacity: layer.opacity,
6078
6091
  blend,
6079
- surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4),
6092
+ surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4),
6080
6093
  offset: { x: 0, y: 0 }
6081
6094
  };
6082
6095
  if (layer.clipped) out2.clipped = true;
@@ -6088,7 +6101,7 @@ var ImageEditorController = (_class6 = class {
6088
6101
  }
6089
6102
  if (layer.type === "shape") {
6090
6103
  add2("Shape layers were written as pixel layers", layer.name);
6091
- const out2 = _chunkD37BX2ZAcjs.shapeAsPixelLayer.call(void 0, layer);
6104
+ const out2 = _chunkMGL4U5WAcjs.shapeAsPixelLayer.call(void 0, layer);
6092
6105
  const mask2 = bakeMask(layer);
6093
6106
  if (mask2) out2.mask = mask2;
6094
6107
  else delete out2.mask;
@@ -6106,7 +6119,7 @@ var ImageEditorController = (_class6 = class {
6106
6119
  out.surface = this.surfaceOf(layer);
6107
6120
  delete out.source;
6108
6121
  }
6109
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _242 => _242.filters, 'optionalAccess', _243 => _243.filter, 'call', _244 => _244(_chunkD37BX2ZAcjs.isActiveFilter)]), () => ( []));
6122
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _242 => _242.filters, 'optionalAccess', _243 => _243.filter, 'call', _244 => _244(_chunkMGL4U5WAcjs.isActiveFilter)]), () => ( []));
6110
6123
  if (active.length) {
6111
6124
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
6112
6125
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -6115,7 +6128,7 @@ var ImageEditorController = (_class6 = class {
6115
6128
  delete content.fillOpacity;
6116
6129
  delete content.effects;
6117
6130
  const data = compositor.composite([content], canvas, sources);
6118
- out = { ...out, surface: _chunkSZ6KMZNMcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
6131
+ out = { ...out, surface: _chunkXIOMMGPDcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
6119
6132
  }
6120
6133
  if (_optionalChain([layer, 'access', _245 => _245.filters, 'optionalAccess', _246 => _246.some, 'call', _247 => _247((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
6121
6134
  delete out.filters;
@@ -6136,7 +6149,7 @@ var ImageEditorController = (_class6 = class {
6136
6149
  if (s.legacyOutputBlur) warnings.push("The document-level blur of an old document is not written.");
6137
6150
  for (const [msg, names] of note) warnings.push(`${msg} (${names.length === 1 ? "layer" : "layers"} ${names.map((n) => `"${n}"`).join(", ")}).`);
6138
6151
  const merged = compositor.composite(prepared, canvas, { ...sources, version: `psd:${Date.now()}` });
6139
- const result = _chunkD37BX2ZAcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight });
6152
+ const result = _chunkMGL4U5WAcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight });
6140
6153
  warnings.push(...result.warnings);
6141
6154
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
6142
6155
  }
@@ -6152,13 +6165,13 @@ var ImageEditorController = (_class6 = class {
6152
6165
  if (!this.samplePixelsOverride) this.samplePixels = null;
6153
6166
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
6154
6167
  this.state.selection = normalizeSelection(
6155
- _chunkD37BX2ZAcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
6168
+ _chunkMGL4U5WAcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
6156
6169
  );
6157
6170
  }
6158
6171
  let layers = this.state.layers;
6159
6172
  if (sx !== 1 || sy !== 1) {
6160
6173
  if (this.state.crop) {
6161
- this.state.crop = _chunkD37BX2ZAcjs.clampCropToImage.call(void 0,
6174
+ this.state.crop = _chunkMGL4U5WAcjs.clampCropToImage.call(void 0,
6162
6175
  {
6163
6176
  x: Math.round(this.state.crop.x * sx),
6164
6177
  y: Math.round(this.state.crop.y * sy),
@@ -6171,26 +6184,26 @@ var ImageEditorController = (_class6 = class {
6171
6184
  }
6172
6185
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
6173
6186
  const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _248 => _248.state, 'access', _249 => _249.patterns, 'optionalAccess', _250 => _250.find, 'call', _251 => _251((p) => p.id === pid)]), () => ( null)) };
6174
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) {
6187
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) {
6175
6188
  if (l.type === "annotation") {
6176
- layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
6189
+ layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
6177
6190
  } else if (l.type === "shape") {
6178
6191
  const a = l.annotation;
6179
6192
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
6180
- const fromAnnotation = scaled ? _chunkD37BX2ZAcjs.shapeFromAnnotation.call(void 0, scaled) : null;
6193
+ const fromAnnotation = scaled ? _chunkMGL4U5WAcjs.shapeFromAnnotation.call(void 0, scaled) : null;
6181
6194
  const m = [sx, 0, 0, sy, 0, 0];
6182
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _252 => _252.components]), () => ( _chunkD37BX2ZAcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
6195
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _252 => _252.components]), () => ( _chunkMGL4U5WAcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
6183
6196
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
6184
6197
  if (scaled && fromAnnotation) moved.annotation = scaled;
6185
6198
  else delete moved.annotation;
6186
- layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, l.id, () => _chunkD37BX2ZAcjs.rerenderShape.call(void 0, moved, env));
6199
+ layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkMGL4U5WAcjs.rerenderShape.call(void 0, moved, env));
6187
6200
  }
6188
6201
  }
6189
6202
  }
6190
- const bg = _chunkD37BX2ZAcjs.developTarget.call(void 0, layers, null);
6191
- if (bg && bg.source !== "document") layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
6203
+ const bg = _chunkMGL4U5WAcjs.developTarget.call(void 0, layers, null);
6204
+ if (bg && bg.source !== "document") layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
6192
6205
  if (clearAnnotations) {
6193
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || l.type === "shape" && l.annotation) layers = _chunkAZTZRLDIcjs.mapLayer.call(void 0, layers, l.id, () => null);
6206
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || l.type === "shape" && l.annotation) layers = _chunkPOGBUYWEcjs.mapLayer.call(void 0, layers, l.id, () => null);
6194
6207
  this.state.selectedAnnotationId = null;
6195
6208
  }
6196
6209
  this.state.layers = layers;
@@ -6208,7 +6221,7 @@ var ImageEditorController = (_class6 = class {
6208
6221
  let out;
6209
6222
  try {
6210
6223
  out = this.serializeState();
6211
- if (_optionalChain([this, 'access', _256 => _256.state, 'access', _257 => _257.selection, 'optionalAccess', _258 => _258.bounds])) out.selection = _chunkD37BX2ZAcjs.serializeSelection.call(void 0, this.state.selection);
6224
+ if (_optionalChain([this, 'access', _256 => _256.state, 'access', _257 => _257.selection, 'optionalAccess', _258 => _258.bounds])) out.selection = _chunkMGL4U5WAcjs.serializeSelection.call(void 0, this.state.selection);
6212
6225
  } finally {
6213
6226
  if (root) {
6214
6227
  this.state = current;
@@ -6216,8 +6229,8 @@ var ImageEditorController = (_class6 = class {
6216
6229
  this.viewKey = [];
6217
6230
  }
6218
6231
  }
6219
- if (!options || out.version !== _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
6220
- return _chunkD37BX2ZAcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
6232
+ if (!options || out.version !== _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
6233
+ return _chunkMGL4U5WAcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
6221
6234
  }
6222
6235
  /**
6223
6236
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -6225,12 +6238,12 @@ var ImageEditorController = (_class6 = class {
6225
6238
  * out and listed in `lastLoadProblems`.
6226
6239
  */
6227
6240
  async loadJSONAsync(data, options = {}) {
6228
- if (data.version !== _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
6241
+ if (data.version !== _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
6229
6242
  this.loadJSON(data);
6230
6243
  return;
6231
6244
  }
6232
6245
  const problems = [];
6233
- const assets = await _chunkD37BX2ZAcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
6246
+ const assets = await _chunkMGL4U5WAcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
6234
6247
  this.loadJSON({ ...data, assets });
6235
6248
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
6236
6249
  }
@@ -6242,7 +6255,7 @@ var ImageEditorController = (_class6 = class {
6242
6255
  let selection = null;
6243
6256
  if (data.selection) {
6244
6257
  try {
6245
- selection = normalizeSelection(_chunkD37BX2ZAcjs.deserializeSelection.call(void 0, data.selection));
6258
+ selection = normalizeSelection(_chunkMGL4U5WAcjs.deserializeSelection.call(void 0, data.selection));
6246
6259
  } catch (e21) {
6247
6260
  selection = null;
6248
6261
  }
@@ -6260,8 +6273,8 @@ var ImageEditorController = (_class6 = class {
6260
6273
  if (isLayered(data)) {
6261
6274
  const problems = [];
6262
6275
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
6263
- const storedPatterns = _chunkD37BX2ZAcjs.deserializePatterns.call(void 0, data.patterns, []);
6264
- s.layers = _chunkD37BX2ZAcjs.deserializeLayers.call(void 0, data.layers, {
6276
+ const storedPatterns = _chunkMGL4U5WAcjs.deserializePatterns.call(void 0, data.patterns, []);
6277
+ s.layers = _chunkMGL4U5WAcjs.deserializeLayers.call(void 0, data.layers, {
6265
6278
  assets: _nullishCoalesce(data.assets, () => ( {})),
6266
6279
  problems,
6267
6280
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -6274,11 +6287,11 @@ var ImageEditorController = (_class6 = class {
6274
6287
  s.outputOpacity = data.opacity;
6275
6288
  if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
6276
6289
  else delete s.legacyOutputBlur;
6277
- s.activeLayerId = data.activeLayerId && _chunkAZTZRLDIcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : null;
6290
+ s.activeLayerId = data.activeLayerId && _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : null;
6278
6291
  const light = data.globalLight;
6279
6292
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
6280
6293
  else delete s.globalLight;
6281
- const patterns = _chunkD37BX2ZAcjs.deserializePatterns.call(void 0, data.patterns, problems);
6294
+ const patterns = _chunkMGL4U5WAcjs.deserializePatterns.call(void 0, data.patterns, problems);
6282
6295
  if (patterns.length) s.patterns = patterns;
6283
6296
  else delete s.patterns;
6284
6297
  if (!this.imageElement && typeof data.width === "number" && typeof data.height === "number" && data.width > 0 && data.height > 0) {
@@ -6286,7 +6299,7 @@ var ImageEditorController = (_class6 = class {
6286
6299
  }
6287
6300
  } else {
6288
6301
  const { width, height } = this.naturalSize;
6289
- const stack = _chunkD37BX2ZAcjs.layersFromLegacy.call(void 0, data, width, height);
6302
+ const stack = _chunkMGL4U5WAcjs.layersFromLegacy.call(void 0, data, width, height);
6290
6303
  s.layers = stack.layers;
6291
6304
  s.outputOpacity = stack.outputOpacity;
6292
6305
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
@@ -6304,7 +6317,7 @@ var ImageEditorController = (_class6 = class {
6304
6317
  }
6305
6318
  serializeState() {
6306
6319
  const { width, height } = this.naturalSize;
6307
- const view = _chunkD37BX2ZAcjs.legacyView.call(void 0, this.stack(), width, height, null);
6320
+ const view = _chunkMGL4U5WAcjs.legacyView.call(void 0, this.stack(), width, height, null);
6308
6321
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _259 => _259.state, 'access', _260 => _260.patterns, 'optionalAccess', _261 => _261.length])) {
6309
6322
  return {
6310
6323
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -6319,9 +6332,9 @@ var ImageEditorController = (_class6 = class {
6319
6332
  annotations: JSON.parse(JSON.stringify(view.annotations))
6320
6333
  };
6321
6334
  }
6322
- const { layers, assets, smartContents } = _chunkD37BX2ZAcjs.serializeLayers.call(void 0, this.state.layers);
6335
+ const { layers, assets, smartContents } = _chunkMGL4U5WAcjs.serializeLayers.call(void 0, this.state.layers);
6323
6336
  const out = {
6324
- version: _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION,
6337
+ version: _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION,
6325
6338
  width,
6326
6339
  height,
6327
6340
  layers,
@@ -6333,7 +6346,7 @@ var ImageEditorController = (_class6 = class {
6333
6346
  };
6334
6347
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
6335
6348
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
6336
- if (_optionalChain([this, 'access', _265 => _265.state, 'access', _266 => _266.patterns, 'optionalAccess', _267 => _267.length])) out.patterns = _chunkD37BX2ZAcjs.serializePatterns.call(void 0, this.state.patterns);
6349
+ if (_optionalChain([this, 'access', _265 => _265.state, 'access', _266 => _266.patterns, 'optionalAccess', _267 => _267.length])) out.patterns = _chunkMGL4U5WAcjs.serializePatterns.call(void 0, this.state.patterns);
6337
6350
  if (smartContents) out.smartContents = smartContents;
6338
6351
  return out;
6339
6352
  }
@@ -6342,7 +6355,7 @@ function serializeAdjustments(adjustments) {
6342
6355
  const out = { ...adjustments };
6343
6356
  if (_optionalChain([out, 'access', _268 => _268.layers, 'optionalAccess', _269 => _269.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
6344
6357
  else delete out.layers;
6345
- if (_chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkD37BX2ZAcjs.LEGACY_PROCESS_VERSION) {
6358
+ if (_chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkMGL4U5WAcjs.LEGACY_PROCESS_VERSION) {
6346
6359
  delete out.process;
6347
6360
  if (!out.tint) delete out.tint;
6348
6361
  }
@@ -6353,7 +6366,7 @@ function withDevelop(layer, partial) {
6353
6366
  let i = filters.findIndex((f) => f.kind === "develop");
6354
6367
  if (i === -1) {
6355
6368
  filters.unshift({
6356
- id: layer.source === "document" ? _chunkD37BX2ZAcjs.DEVELOP_FILTER_ID : _chunkD37BX2ZAcjs.newLayerId.call(void 0, "flt"),
6369
+ id: layer.source === "document" ? _chunkMGL4U5WAcjs.DEVELOP_FILTER_ID : _chunkMGL4U5WAcjs.newLayerId.call(void 0, "flt"),
6357
6370
  kind: "develop",
6358
6371
  enabled: true,
6359
6372
  brightness: 0,
@@ -6362,7 +6375,7 @@ function withDevelop(layer, partial) {
6362
6375
  exposure: 0,
6363
6376
  temperature: 0,
6364
6377
  tint: 0,
6365
- process: _chunkD37BX2ZAcjs.LATEST_PROCESS_VERSION
6378
+ process: _chunkMGL4U5WAcjs.LATEST_PROCESS_VERSION
6366
6379
  });
6367
6380
  i = 0;
6368
6381
  }
@@ -6371,7 +6384,7 @@ function withDevelop(layer, partial) {
6371
6384
  const v = partial[k];
6372
6385
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
6373
6386
  }
6374
- if ("process" in partial) next.process = _chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, partial.process);
6387
+ if ("process" in partial) next.process = _chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, partial.process);
6375
6388
  filters[i] = next;
6376
6389
  return { ...layer, filters };
6377
6390
  }
@@ -6380,7 +6393,7 @@ function withBlur(layer, radius) {
6380
6393
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
6381
6394
  if (radius > 0) {
6382
6395
  filters.push({
6383
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _273 => _273.id]), () => ( (layer.source === "document" ? _chunkD37BX2ZAcjs.BLUR_FILTER_ID : _chunkD37BX2ZAcjs.newLayerId.call(void 0, "flt")))),
6396
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _273 => _273.id]), () => ( (layer.source === "document" ? _chunkMGL4U5WAcjs.BLUR_FILTER_ID : _chunkMGL4U5WAcjs.newLayerId.call(void 0, "flt")))),
6384
6397
  kind: "blur",
6385
6398
  enabled: true,
6386
6399
  radius
@@ -6404,7 +6417,7 @@ function mergeAdjustmentNode(node, update, width, height) {
6404
6417
  if (!update.mask) delete next.mask;
6405
6418
  else {
6406
6419
  const current = node.mask && !node.mask.source ? node.mask : null;
6407
- const memo = current ? _chunkD37BX2ZAcjs.legacyMaskOf.call(void 0, current, width, height) : null;
6420
+ const memo = current ? _chunkMGL4U5WAcjs.legacyMaskOf.call(void 0, current, width, height) : null;
6408
6421
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
6409
6422
  next.mask = withMaskProps(current, {
6410
6423
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -6412,7 +6425,7 @@ function mergeAdjustmentNode(node, update, width, height) {
6412
6425
  enabled: update.mask.enabled !== false
6413
6426
  });
6414
6427
  } else {
6415
- const m = _chunkD37BX2ZAcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
6428
+ const m = _chunkMGL4U5WAcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
6416
6429
  if (m) next.mask = m;
6417
6430
  else delete next.mask;
6418
6431
  }
@@ -6448,32 +6461,32 @@ function resizeLegacyMasks(layers, from, to) {
6448
6461
  const th = Math.max(1, Math.round(to.height));
6449
6462
  if (fw === tw && fh === th) return layers;
6450
6463
  let out = layers;
6451
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) {
6464
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) {
6452
6465
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
6453
6466
  const old = l.mask;
6454
- const mask = _chunkD37BX2ZAcjs.rasterMaskFromLegacy.call(void 0, _chunkD37BX2ZAcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
6467
+ const mask = _chunkMGL4U5WAcjs.rasterMaskFromLegacy.call(void 0, _chunkMGL4U5WAcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
6455
6468
  if (!mask) continue;
6456
- out = _chunkAZTZRLDIcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
6469
+ out = _chunkPOGBUYWEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
6457
6470
  }
6458
6471
  return out;
6459
6472
  }
6460
6473
  function isOpaqueInside(surface, width, height) {
6461
6474
  const row = new Uint8ClampedArray(width * 4);
6462
6475
  for (let y = 0; y < height; y++) {
6463
- _chunkSZ6KMZNMcjs.readRegion.call(void 0, surface, { x: 0, y, width, height: 1 }, row);
6476
+ _chunkXIOMMGPDcjs.readRegion.call(void 0, surface, { x: 0, y, width, height: 1 }, row);
6464
6477
  for (let i = 3; i < row.length; i += 4) if (row[i] !== 255) return false;
6465
6478
  }
6466
6479
  return true;
6467
6480
  }
6468
6481
  function collectStateTiles(layers, into) {
6469
- for (const l of _chunkAZTZRLDIcjs.flattenLayers.call(void 0, layers)) {
6470
- if (l.type === "pixel" && l.source !== "document") _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.surface, into);
6471
- if (l.mask && !l.mask.source) _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.mask.surface, into);
6472
- if (l.type === "shape") _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.surface, into);
6482
+ for (const l of _chunkPOGBUYWEcjs.flattenLayers.call(void 0, layers)) {
6483
+ if (l.type === "pixel" && l.source !== "document") _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.surface, into);
6484
+ if (l.mask && !l.mask.source) _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.mask.surface, into);
6485
+ if (l.type === "shape") _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.surface, into);
6473
6486
  if (l.type === "smart") {
6474
- _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.surface, into);
6475
- if (_optionalChain([l, 'access', _274 => _274.smartFilters, 'optionalAccess', _275 => _275.mask])) _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
6476
- if (l.contents.raster) _chunkSZ6KMZNMcjs.collectTiles.call(void 0, l.contents.raster, into);
6487
+ _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.surface, into);
6488
+ if (_optionalChain([l, 'access', _274 => _274.smartFilters, 'optionalAccess', _275 => _275.mask])) _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
6489
+ if (l.contents.raster) _chunkXIOMMGPDcjs.collectTiles.call(void 0, l.contents.raster, into);
6477
6490
  if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
6478
6491
  }
6479
6492
  }
@@ -6526,12 +6539,12 @@ function withoutAnnotations(layers) {
6526
6539
  function parseColor(value) {
6527
6540
  if (Array.isArray(value)) {
6528
6541
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
6529
- throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
6542
+ throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
6530
6543
  }
6531
6544
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
6532
6545
  }
6533
6546
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
6534
- if (!m) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
6547
+ if (!m) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
6535
6548
  let hex = m[1];
6536
6549
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
6537
6550
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -6681,7 +6694,7 @@ function loadImageEditorDocument(input) {
6681
6694
  // Optional: only present when something was selected when saving.
6682
6695
  selection: {
6683
6696
  parse: (value) => {
6684
- const mask = _chunkD37BX2ZAcjs.deserializeSelection.call(void 0, value);
6697
+ const mask = _chunkMGL4U5WAcjs.deserializeSelection.call(void 0, value);
6685
6698
  const v = value;
6686
6699
  return { width: mask.width, height: mask.height, rle: v.rle };
6687
6700
  },
@@ -6769,7 +6782,7 @@ function loadLayeredDocument(doc) {
6769
6782
  },
6770
6783
  selection: {
6771
6784
  parse: (value) => {
6772
- const mask = _chunkD37BX2ZAcjs.deserializeSelection.call(void 0, value);
6785
+ const mask = _chunkMGL4U5WAcjs.deserializeSelection.call(void 0, value);
6773
6786
  const v = value;
6774
6787
  return { width: mask.width, height: mask.height, rle: v.rle };
6775
6788
  },
@@ -7163,14 +7176,14 @@ function describeSelection(mask) {
7163
7176
  // src/image-editor/selection-tools.ts
7164
7177
  var modeSchema = {
7165
7178
  type: "string",
7166
- enum: [..._chunkD37BX2ZAcjs.SELECTION_MODES],
7179
+ enum: [..._chunkMGL4U5WAcjs.SELECTION_MODES],
7167
7180
  description: "How the result combines with the current selection (default replace)."
7168
7181
  };
7169
7182
  var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
7170
7183
  function summary(controller) {
7171
7184
  const sel = controller.getSelection();
7172
7185
  const { width, height } = controller.getState().imageDimensions;
7173
- const area = _chunkD37BX2ZAcjs.selectionArea.call(void 0, sel);
7186
+ const area = _chunkMGL4U5WAcjs.selectionArea.call(void 0, sel);
7174
7187
  return {
7175
7188
  empty: !sel,
7176
7189
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _285 => _285.bounds]), () => ( null)),
@@ -7216,7 +7229,7 @@ function createImageSelectionTools(controller) {
7216
7229
  },
7217
7230
  annotations: writeAnnotations("Select a region", true),
7218
7231
  handler: ({ shape, x, y, width, height, mode, feather }) => {
7219
- const opts = { mode: _chunkD37BX2ZAcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
7232
+ const opts = { mode: _chunkMGL4U5WAcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
7220
7233
  switch (shape) {
7221
7234
  case "all":
7222
7235
  controller.selectAll();
@@ -7269,7 +7282,7 @@ function createImageSelectionTools(controller) {
7269
7282
  annotations: writeAnnotations("Select by colour", true),
7270
7283
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
7271
7284
  const common = {
7272
- mode: _chunkD37BX2ZAcjs.parseSelectionMode.call(void 0, mode),
7285
+ mode: _chunkMGL4U5WAcjs.parseSelectionMode.call(void 0, mode),
7273
7286
  sampleMerged: sampleMerged === true,
7274
7287
  sample: _nullishCoalesce(sample, () => ( "composite"))
7275
7288
  };
@@ -7290,7 +7303,7 @@ function createImageSelectionTools(controller) {
7290
7303
  inputSchema: {
7291
7304
  type: "object",
7292
7305
  properties: {
7293
- op: { type: "string", enum: [..._chunkD37BX2ZAcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
7306
+ op: { type: "string", enum: [..._chunkMGL4U5WAcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
7294
7307
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
7295
7308
  },
7296
7309
  required: ["op", "radius"],
@@ -7298,7 +7311,7 @@ function createImageSelectionTools(controller) {
7298
7311
  },
7299
7312
  annotations: writeAnnotations("Modify the selection"),
7300
7313
  handler: ({ op, radius }) => {
7301
- if (!_chunkD37BX2ZAcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
7314
+ if (!_chunkMGL4U5WAcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
7302
7315
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
7303
7316
  controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
7304
7317
  return summary(controller);
@@ -7342,7 +7355,7 @@ function createImageSelectionTools(controller) {
7342
7355
  type: "object",
7343
7356
  properties: {
7344
7357
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
7345
- kind: { type: "string", enum: _chunkD37BX2ZAcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
7358
+ kind: { type: "string", enum: _chunkMGL4U5WAcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
7346
7359
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
7347
7360
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
7348
7361
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -7362,11 +7375,11 @@ function createImageSelectionTools(controller) {
7362
7375
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
7363
7376
  controller.applySelectionAsLayerMask(layerId, props);
7364
7377
  id = layerId;
7365
- } else if (_chunkD37BX2ZAcjs.isAdjustmentKind.call(void 0, kind)) {
7378
+ } else if (_chunkMGL4U5WAcjs.isAdjustmentKind.call(void 0, kind)) {
7366
7379
  id = controller.addAdjustmentLayer({
7367
7380
  kind,
7368
7381
  params,
7369
- mask: _chunkD37BX2ZAcjs.layerMaskFromSelection.call(void 0, sel, props)
7382
+ mask: _chunkMGL4U5WAcjs.layerMaskFromSelection.call(void 0, sel, props)
7370
7383
  });
7371
7384
  } else {
7372
7385
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -7503,11 +7516,11 @@ function createImageEditTools(controller) {
7503
7516
  const geometry2 = () => {
7504
7517
  const s = controller.getState();
7505
7518
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
7506
- const out = _chunkD37BX2ZAcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
7519
+ const out = _chunkMGL4U5WAcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
7507
7520
  return {
7508
7521
  image: { ...s.imageDimensions },
7509
7522
  crop: s.crop ? { ...s.crop } : null,
7510
- rotation: _chunkD37BX2ZAcjs.normalizeAngle.call(void 0, s.transform.rotate),
7523
+ rotation: _chunkMGL4U5WAcjs.normalizeAngle.call(void 0, s.transform.rotate),
7511
7524
  flipH: s.transform.flipH,
7512
7525
  flipV: s.transform.flipV,
7513
7526
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -7554,7 +7567,7 @@ function createImageEditTools(controller) {
7554
7567
  properties: {
7555
7568
  layer: LAYER_ID,
7556
7569
  enabled: { type: "boolean", description: "false hides the layer without deleting it." },
7557
- blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (see list_controls)." },
7570
+ blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (see list_controls)." },
7558
7571
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1." },
7559
7572
  name: { type: "string", description: "Layer name shown in the layers panel." }
7560
7573
  },
@@ -7567,7 +7580,7 @@ function createImageEditTools(controller) {
7567
7580
  if (enabled === void 0 && blend === void 0 && opacity === void 0 && name === void 0) {
7568
7581
  throw new Error("Nothing to change. Pass enabled, blend, opacity or name.");
7569
7582
  }
7570
- if (blend !== void 0 && !_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
7583
+ if (blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
7571
7584
  controller.updateAdjustmentLayer(layer, { enabled, blend, opacity, name });
7572
7585
  return { layer: layerJson(layer) };
7573
7586
  }
@@ -7721,7 +7734,7 @@ function maskSummary(mask) {
7721
7734
  };
7722
7735
  if (!mask.source) {
7723
7736
  out.defaultValue = mask.defaultValue;
7724
- out.paintedBounds = _chunkSZ6KMZNMcjs.contentBounds.call(void 0, mask.surface);
7737
+ out.paintedBounds = _chunkXIOMMGPDcjs.contentBounds.call(void 0, mask.surface);
7725
7738
  }
7726
7739
  return out;
7727
7740
  }
@@ -7729,7 +7742,7 @@ function describeLayer(layer, activeId, boundsOf) {
7729
7742
  const out = {
7730
7743
  id: layer.id,
7731
7744
  type: layer.type,
7732
- name: layer.name || (layer.type === "adjustment" ? _chunkD37BX2ZAcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
7745
+ name: layer.name || (layer.type === "adjustment" ? _chunkMGL4U5WAcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
7733
7746
  visible: layer.visible,
7734
7747
  opacity: round3(layer.opacity),
7735
7748
  blend: layer.blend,
@@ -7785,7 +7798,7 @@ var PLACEMENT = {
7785
7798
  parentId: { type: "string", description: "Put the layer inside this group (at index, default its top)." },
7786
7799
  index: { type: "integer", minimum: 0, description: "Position among the siblings, 0 = bottom (with parentId, or at the top level)." }
7787
7800
  };
7788
- var BLEND = { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." };
7801
+ var BLEND = { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." };
7789
7802
  function placementFrom(args) {
7790
7803
  const p = {};
7791
7804
  if (typeof args.aboveId === "string") p.aboveId = args.aboveId;
@@ -7797,7 +7810,7 @@ function placementFrom(args) {
7797
7810
  function createImageLayerTools(controller) {
7798
7811
  const describe = (id) => {
7799
7812
  const s = controller.getState();
7800
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, s.layers, id);
7813
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, id);
7801
7814
  if (!loc) return null;
7802
7815
  return {
7803
7816
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
@@ -7806,8 +7819,8 @@ function createImageLayerTools(controller) {
7806
7819
  };
7807
7820
  };
7808
7821
  const exists = (id, what = "layerId") => {
7809
- if (typeof id !== "string" || !id) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
7810
- _chunkD37BX2ZAcjs.requireLayer.call(void 0, controller.getLayers(), id);
7822
+ if (typeof id !== "string" || !id) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
7823
+ _chunkMGL4U5WAcjs.requireLayer.call(void 0, controller.getLayers(), id);
7811
7824
  return id;
7812
7825
  };
7813
7826
  const listLayers = {
@@ -7843,7 +7856,7 @@ function createImageLayerTools(controller) {
7843
7856
  handler: ({ layerId, target }) => {
7844
7857
  const id = exists(layerId);
7845
7858
  const layer = controller.getLayer(id);
7846
- if (target === "mask" && !layer.mask) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
7859
+ if (target === "mask" && !layer.mask) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
7847
7860
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
7848
7861
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
7849
7862
  }
@@ -7868,7 +7881,7 @@ function createImageLayerTools(controller) {
7868
7881
  },
7869
7882
  annotations: { title: "Add a pixel layer", ...WRITE2 },
7870
7883
  handler: async (args) => {
7871
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give color or image, not both.");
7884
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give color or image, not both.");
7872
7885
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
7873
7886
  const init = {
7874
7887
  name: args.name,
@@ -7935,7 +7948,7 @@ function createImageLayerTools(controller) {
7935
7948
  visible: { type: "boolean", description: "Show (true) or hide (false)." },
7936
7949
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0..1." },
7937
7950
  fillOpacity: { type: "number", minimum: 0, maximum: 1, description: "Fill 0..1 (pixel layers)." },
7938
- blend: { type: "string", enum: [..._chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), "pass-through"], description: "Blend mode; pass-through for groups only." },
7951
+ blend: { type: "string", enum: [..._chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), "pass-through"], description: "Blend mode; pass-through for groups only." },
7939
7952
  clipped: { type: "boolean", description: "Clip to the nearest unclipped layer below." },
7940
7953
  locks: {
7941
7954
  type: "object",
@@ -7958,7 +7971,7 @@ function createImageLayerTools(controller) {
7958
7971
  const id = exists(args.layerId);
7959
7972
  const props = {};
7960
7973
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
7961
- if (!Object.keys(props).length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give at least one property to change.");
7974
+ if (!Object.keys(props).length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give at least one property to change.");
7962
7975
  controller.setLayerProperties(id, props);
7963
7976
  return { layer: describe(id) };
7964
7977
  }
@@ -7990,7 +8003,7 @@ function createImageLayerTools(controller) {
7990
8003
  type: "object",
7991
8004
  properties: {
7992
8005
  name: { type: "string", description: 'Group name (default "Group").' },
7993
- blend: { type: "string", enum: [..._chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), "pass-through"], description: "Blend mode (default pass-through)." },
8006
+ blend: { type: "string", enum: [..._chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), "pass-through"], description: "Blend mode (default pass-through)." },
7994
8007
  ...PLACEMENT
7995
8008
  },
7996
8009
  additionalProperties: false
@@ -8052,8 +8065,8 @@ function createImageLayerTools(controller) {
8052
8065
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
8053
8066
  handler: ({ layerId, x, y, dx, dy }) => {
8054
8067
  const id = exists(layerId);
8055
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give x and y, or dx and dy.");
8056
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
8068
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give x and y, or dx and dy.");
8069
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
8057
8070
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
8058
8071
  }
8059
8072
  };
@@ -8125,7 +8138,7 @@ function createImageLayerTools(controller) {
8125
8138
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
8126
8139
  handler: ({ layerId, density, feather, enabled, linked }) => {
8127
8140
  const id = exists(layerId);
8128
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give density, feather, enabled or linked.");
8141
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give density, feather, enabled or linked.");
8129
8142
  const mask = controller.setLayerMaskProps(id, {
8130
8143
  density,
8131
8144
  feather,
@@ -8208,7 +8221,7 @@ function createImageLayerTools(controller) {
8208
8221
  handler: (args) => {
8209
8222
  const id = exists(args.layerId);
8210
8223
  const changes = filterValues(args);
8211
- if (!Object.keys(changes).length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give at least one value to change.");
8224
+ if (!Object.keys(changes).length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give at least one value to change.");
8212
8225
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
8213
8226
  }
8214
8227
  };
@@ -8262,7 +8275,7 @@ var WRITE_IDEMPOTENT3 = { readOnlyHint: false, destructiveHint: false, idempoten
8262
8275
  var DESTRUCTIVE2 = { readOnlyHint: false, destructiveHint: true, idempotentHint: false, openWorldHint: false };
8263
8276
  var LAYER_ID3 = { type: "string", description: "Layer id from list_layers (a pixel, shape, smart object, annotation or group layer)." };
8264
8277
  var EFFECT_ID = { type: "string", description: "Effect id from list_layer_effects or add_layer_effect." };
8265
- var BLEND_IDS = _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id).filter((id) => id !== "pigment");
8278
+ var BLEND_IDS = _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id).filter((id) => id !== "pigment");
8266
8279
  var DEFS = {
8267
8280
  color: { type: "string", pattern: "^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$", description: "Colour as #rrggbb." },
8268
8281
  contour: {
@@ -8455,8 +8468,8 @@ function settingsSchema(forUpdate) {
8455
8468
  }
8456
8469
  function patternList(controller) {
8457
8470
  const doc = controller.getDocumentPatterns().map((p) => ({ id: p.id, name: p.name, width: p.width, height: p.height, builtin: false }));
8458
- const builtins = _chunkAZTZRLDIcjs.builtinPatternIds.call(void 0, ).map((id) => {
8459
- const p = _chunkAZTZRLDIcjs.builtinPattern.call(void 0, id);
8471
+ const builtins = _chunkPOGBUYWEcjs.builtinPatternIds.call(void 0, ).map((id) => {
8472
+ const p = _chunkPOGBUYWEcjs.builtinPattern.call(void 0, id);
8460
8473
  return { id, name: p.name, width: p.width, height: p.height, builtin: true };
8461
8474
  });
8462
8475
  return [...doc, ...builtins];
@@ -8465,15 +8478,15 @@ function describeLayerEffects(effects) {
8465
8478
  return {
8466
8479
  enabled: effects.enabled,
8467
8480
  scale: _nullishCoalesce(effects.scale, () => ( 1)),
8468
- margin: _chunkAZTZRLDIcjs.effectsMargin.call(void 0, effects),
8481
+ margin: _chunkPOGBUYWEcjs.effectsMargin.call(void 0, effects),
8469
8482
  fromPsd: Boolean(effects.psd),
8470
- effects: effects.items.map((e) => ({ ...JSON.parse(JSON.stringify(e)), label: _chunkAZTZRLDIcjs.layerEffectLabel.call(void 0, e.kind) }))
8483
+ effects: effects.items.map((e) => ({ ...JSON.parse(JSON.stringify(e)), label: _chunkPOGBUYWEcjs.layerEffectLabel.call(void 0, e.kind) }))
8471
8484
  };
8472
8485
  }
8473
8486
  function createImageEffectTools(controller) {
8474
8487
  const layerArg = (id) => {
8475
- if (typeof id !== "string" || !id) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
8476
- _chunkD37BX2ZAcjs.requireLayer.call(void 0, controller.getLayers(), id);
8488
+ if (typeof id !== "string" || !id) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
8489
+ _chunkMGL4U5WAcjs.requireLayer.call(void 0, controller.getLayers(), id);
8477
8490
  return id;
8478
8491
  };
8479
8492
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -8483,7 +8496,7 @@ function createImageEffectTools(controller) {
8483
8496
  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.",
8484
8497
  inputSchema: { type: "object", properties: { layerId: LAYER_ID3 }, required: ["layerId"], additionalProperties: false },
8485
8498
  annotations: { title: "List layer effects", ...READ3 },
8486
- handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [..._chunkAZTZRLDIcjs.LAYER_EFFECT_KINDS] })
8499
+ handler: ({ layerId }) => result(layerArg(layerId), { globalLight: controller.getGlobalLight(), patterns: patternList(controller), kinds: [..._chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS] })
8487
8500
  };
8488
8501
  const add2 = {
8489
8502
  name: "add_layer_effect",
@@ -8494,7 +8507,7 @@ function createImageEffectTools(controller) {
8494
8507
  $defs: DEFS,
8495
8508
  properties: {
8496
8509
  layerId: LAYER_ID3,
8497
- kind: { type: "string", enum: [..._chunkAZTZRLDIcjs.LAYER_EFFECT_KINDS], description: "Effect kind." },
8510
+ kind: { type: "string", enum: [..._chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS], description: "Effect kind." },
8498
8511
  settings: settingsSchema(false),
8499
8512
  index: { type: "integer", minimum: 0, description: "Position in the layer's effect list (default the end)." }
8500
8513
  },
@@ -8504,7 +8517,7 @@ function createImageEffectTools(controller) {
8504
8517
  annotations: { title: "Add a layer effect", ...WRITE3 },
8505
8518
  handler: ({ layerId, kind, settings, index }) => {
8506
8519
  const id = layerArg(layerId);
8507
- if (!_chunkAZTZRLDIcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`kind must be one of ${_chunkAZTZRLDIcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
8520
+ if (!_chunkPOGBUYWEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`kind must be one of ${_chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
8508
8521
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
8509
8522
  return result(id, { effectId: effect.id });
8510
8523
  }
@@ -8524,7 +8537,7 @@ function createImageEffectTools(controller) {
8524
8537
  handler: ({ layerId, effectId, settings }) => {
8525
8538
  const id = layerArg(layerId);
8526
8539
  const changes = _nullishCoalesce(settings, () => ( {}));
8527
- if (!Object.keys(changes).length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give at least one setting to change.");
8540
+ if (!Object.keys(changes).length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give at least one setting to change.");
8528
8541
  controller.updateLayerEffect(id, effectId, changes);
8529
8542
  return result(id);
8530
8543
  }
@@ -8576,7 +8589,7 @@ function createImageEffectTools(controller) {
8576
8589
  },
8577
8590
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
8578
8591
  handler: ({ angle, altitude }) => {
8579
- if (angle === void 0 && altitude === void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give angle, altitude or both.");
8592
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give angle, altitude or both.");
8580
8593
  const next = {};
8581
8594
  if (angle !== void 0) next.angle = angle;
8582
8595
  if (altitude !== void 0) next.altitude = altitude;
@@ -8650,7 +8663,7 @@ function handlePaintShortcut(controller, e) {
8650
8663
  }
8651
8664
  if (key === "]" || key === "}") {
8652
8665
  if (e.shiftKey || key === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
8653
- else set({ size: Math.min(_chunkHUFQD4CBcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
8666
+ else set({ size: Math.min(_chunk7VOHOPLWcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
8654
8667
  return true;
8655
8668
  }
8656
8669
  if (/^[0-9]$/.test(key) && isPaintTool(controller.getState().activeTool)) {
@@ -8685,7 +8698,7 @@ var PaintGesture = (_class7 = class {
8685
8698
  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.`);
8686
8699
  if (_optionalChain([layer, 'access', _299 => _299.locks, 'optionalAccess', _300 => _300.all]) || _optionalChain([layer, 'access', _301 => _301.locks, 'optionalAccess', _302 => _302.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
8687
8700
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
8688
- const b = _chunkD37BX2ZAcjs.shapeGeometryBounds.call(void 0, layer);
8701
+ const b = _chunkMGL4U5WAcjs.shapeGeometryBounds.call(void 0, layer);
8689
8702
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
8690
8703
  })();
8691
8704
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -8758,7 +8771,7 @@ var BRUSH = {
8758
8771
  type: "object",
8759
8772
  description: "Brush settings; missing fields use the current paint options (default round, hard, 20 px).",
8760
8773
  properties: {
8761
- size: { type: "number", minimum: 1, maximum: _chunkHUFQD4CBcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
8774
+ size: { type: "number", minimum: 1, maximum: _chunk7VOHOPLWcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
8762
8775
  hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness 0 (soft) .. 1 (hard, default)." },
8763
8776
  spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (default 0.1)." },
8764
8777
  angle: { type: "number", minimum: -360, maximum: 360, description: "Tip angle in degrees (default 0)." },
@@ -8768,7 +8781,7 @@ var BRUSH = {
8768
8781
  smoothing: { type: "number", minimum: 0, maximum: 0.95, description: "Point smoothing 0..0.95 (default 0)." },
8769
8782
  pressureSize: { type: "boolean", description: "Point pressure scales the size (default true)." },
8770
8783
  pressureOpacity: { type: "boolean", description: "Point pressure scales the opacity (default false)." },
8771
- blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "How paint combines with the layer (default normal). pigment mixes it in like real paint (blue into yellow gives green) instead of laying it over." }
8784
+ blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "How paint combines with the layer (default normal). pigment mixes it in like real paint (blue into yellow gives green) instead of laying it over." }
8772
8785
  },
8773
8786
  additionalProperties: false
8774
8787
  };
@@ -8781,7 +8794,7 @@ var MIXER = {
8781
8794
  mix: { type: "number", minimum: 0, maximum: 1, description: "How far each dab's paint moves from the reservoir towards the picked-up colour, 0 .. 1 (default 0.5)." },
8782
8795
  loadEachStroke: { type: "boolean", description: "Refill the reservoir with `color` (or the foreground) before the stroke (default true). Off, the brush keeps what is left of its last load." },
8783
8796
  cleanEachStroke: { type: "boolean", description: "Empty the pickup well after the stroke (default true). Off, the next stroke starts with the colour this one picked up." },
8784
- mixing: { type: "string", enum: [..._chunkHUFQD4CBcjs.MIXING_MODELS], description: "rgb (default): RGB averages. pigment: mixes like paint (Kubelka-Munk), so blue dragged through yellow makes green." }
8797
+ mixing: { type: "string", enum: [..._chunk7VOHOPLWcjs.MIXING_MODELS], description: "rgb (default): RGB averages. pigment: mixes like paint (Kubelka-Munk), so blue dragged through yellow makes green." }
8785
8798
  },
8786
8799
  additionalProperties: false
8787
8800
  };
@@ -8834,7 +8847,7 @@ function createImagePaintTools(controller) {
8834
8847
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
8835
8848
  handler: (args) => {
8836
8849
  const tool = args.tool;
8837
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
8850
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
8838
8851
  const result = controller.paintStroke({
8839
8852
  tool,
8840
8853
  points: args.points,
@@ -8890,7 +8903,7 @@ function createImagePaintTools(controller) {
8890
8903
  properties: {
8891
8904
  color: { type: "string", description: "Fill colour #rrggbb or #rrggbbaa (default the foreground)." },
8892
8905
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Fill opacity 0..1 (default 1)." },
8893
- blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal). pigment mixes the colour into the pixels like paint, opacity being the share of new paint." },
8906
+ blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal). pigment mixes the colour into the pixels like paint, opacity being the share of new paint." },
8894
8907
  useSelection: { type: "boolean", description: "Limit to the selection when there is one (default true)." },
8895
8908
  ...TARGET
8896
8909
  },
@@ -8933,11 +8946,11 @@ var DATA = {
8933
8946
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
8934
8947
  };
8935
8948
  function psdBytesFromBase64(data) {
8936
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunkD37BX2ZAcjs.PsdError)("data is required: the PSD file as base64.");
8949
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkMGL4U5WAcjs.PsdError)("data is required: the PSD file as base64.");
8937
8950
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
8938
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkD37BX2ZAcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
8939
- const bytes = _chunkAZTZRLDIcjs.base64ToBytes.call(void 0, body);
8940
- if (bytes.length < 26) throw new (0, _chunkD37BX2ZAcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
8951
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkMGL4U5WAcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
8952
+ const bytes = _chunkPOGBUYWEcjs.base64ToBytes.call(void 0, body);
8953
+ if (bytes.length < 26) throw new (0, _chunkMGL4U5WAcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
8941
8954
  return bytes;
8942
8955
  }
8943
8956
  function createImagePsdTools(controller) {
@@ -8948,7 +8961,7 @@ function createImagePsdTools(controller) {
8948
8961
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
8949
8962
  annotations: { title: "Inspect a PSD", ...READ5 },
8950
8963
  handler: ({ data }) => {
8951
- const res = _chunkD37BX2ZAcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
8964
+ const res = _chunkMGL4U5WAcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
8952
8965
  return {
8953
8966
  width: res.width,
8954
8967
  height: res.height,
@@ -8987,7 +9000,7 @@ function createImagePsdTools(controller) {
8987
9000
  handler: async () => {
8988
9001
  const res = await controller.toPsd();
8989
9002
  return {
8990
- data: _chunkAZTZRLDIcjs.bytesToBase64.call(void 0, res.bytes),
9003
+ data: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, res.bytes),
8991
9004
  mimeType: "image/vnd.adobe.photoshop",
8992
9005
  size: res.bytes.length,
8993
9006
  psb: res.psb,
@@ -9023,7 +9036,7 @@ var TARGET2 = {
9023
9036
  enum: ["pixels", "mask"],
9024
9037
  description: "pixels (default) moves the pixels and a linked mask; mask moves an unlinked mask alone (a linked mask always moves with its pixels)."
9025
9038
  },
9026
- interpolation: { type: "string", enum: _chunkAZTZRLDIcjs.INTERPOLATIONS, description: "Resampling: nearest (hard pixels), bilinear or bicubic (default, Photoshop\u2019s Bicubic)." }
9039
+ interpolation: { type: "string", enum: _chunkPOGBUYWEcjs.INTERPOLATIONS, description: "Resampling: nearest (hard pixels), bilinear or bicubic (default, Photoshop\u2019s Bicubic)." }
9027
9040
  };
9028
9041
  var GEOMETRY = {
9029
9042
  scaleX: { type: "number", description: "Width in percent of the frame (default 100; negative flips horizontally)." },
@@ -9035,7 +9048,7 @@ var GEOMETRY = {
9035
9048
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
9036
9049
  reference: {
9037
9050
  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}.",
9038
- anyOf: [{ type: "string", enum: _chunkD37BX2ZAcjs.TRANSFORM_ANCHORS }, POINT]
9051
+ anyOf: [{ type: "string", enum: _chunkMGL4U5WAcjs.TRANSFORM_ANCHORS }, POINT]
9039
9052
  },
9040
9053
  matrix: {
9041
9054
  type: "array",
@@ -9056,14 +9069,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
9056
9069
  function geometryFrom(args) {
9057
9070
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
9058
9071
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
9059
- if (ways === 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
9060
- if (ways > 1) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
9072
+ if (ways === 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
9073
+ if (ways > 1) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
9061
9074
  if (args.matrix !== void 0) return { matrix: args.matrix };
9062
9075
  if (args.corners !== void 0) return { corners: args.corners };
9063
9076
  const params = {};
9064
9077
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
9065
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
9066
- if (typeof params.reference === "string" && !_chunkD37BX2ZAcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkD37BX2ZAcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
9078
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
9079
+ if (typeof params.reference === "string" && !_chunkMGL4U5WAcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkMGL4U5WAcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
9067
9080
  return { params };
9068
9081
  }
9069
9082
  function targetFrom(args) {
@@ -9112,7 +9125,7 @@ function createImageTransformTools(controller) {
9112
9125
  moved: [...s.moves],
9113
9126
  frame: { ...s.box },
9114
9127
  corners: s.startGeometry.corners.map(roundPoint),
9115
- center: roundPoint(_chunkD37BX2ZAcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
9128
+ center: roundPoint(_chunkMGL4U5WAcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
9116
9129
  };
9117
9130
  if (s.smartObject) out.smartObject = true;
9118
9131
  s.cancel();
@@ -9167,11 +9180,11 @@ function createImageTransformTools(controller) {
9167
9180
  annotations: { title: "Warp a layer", ...WRITE5 },
9168
9181
  handler: (args) => {
9169
9182
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
9170
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
9171
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give a preset style or a mesh.");
9183
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
9184
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give a preset style or a mesh.");
9172
9185
  let warp;
9173
9186
  if (hasPreset) {
9174
- if (args.style === void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
9187
+ if (args.style === void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkW3GXSUSQcjs.WARP_STYLES.join(", ")}.`);
9175
9188
  warp = {
9176
9189
  style: args.style,
9177
9190
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -9182,7 +9195,7 @@ function createImageTransformTools(controller) {
9182
9195
  } else {
9183
9196
  const m = args.mesh;
9184
9197
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
9185
- if (m.points.length !== want) throw new (0, _chunkD37BX2ZAcjs.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}.`);
9198
+ if (m.points.length !== want) throw new (0, _chunkMGL4U5WAcjs.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}.`);
9186
9199
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
9187
9200
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
9188
9201
  }
@@ -9258,7 +9271,7 @@ var POINT2 = {
9258
9271
  required: ["x", "y"],
9259
9272
  additionalProperties: false
9260
9273
  };
9261
- var FILTER_BLENDS = _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id).filter((m) => m !== "pigment");
9274
+ var FILTER_BLENDS = _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id).filter((m) => m !== "pigment");
9262
9275
  var FILTER_SETTINGS = {
9263
9276
  enabled: { type: "boolean", description: "false keeps the filter but skips it (the eye in the Layers panel; default true)." },
9264
9277
  blend: { type: "string", enum: FILTER_BLENDS, description: "How the filter\u2019s result blends with the result below it (Blending Options; default normal)." },
@@ -9277,13 +9290,13 @@ function settingsFrom(args) {
9277
9290
  return out;
9278
9291
  }
9279
9292
  function imageArg(image) {
9280
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
9293
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
9281
9294
  return image.trim();
9282
9295
  }
9283
9296
  function createImageSmartObjectTools(controller) {
9284
9297
  const smartId = (id) => {
9285
- if (typeof id !== "string" || !id) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
9286
- _chunkD37BX2ZAcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
9298
+ if (typeof id !== "string" || !id) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
9299
+ _chunkMGL4U5WAcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
9287
9300
  return id;
9288
9301
  };
9289
9302
  const info = (id) => {
@@ -9295,7 +9308,7 @@ function createImageSmartObjectTools(controller) {
9295
9308
  };
9296
9309
  const layerSummary = (id) => {
9297
9310
  const s = controller.getState();
9298
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, s.layers, id);
9311
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, id);
9299
9312
  return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _306 => _306.parent, 'optionalAccess', _307 => _307.id]), () => ( null)), index: loc.index } : null;
9300
9313
  };
9301
9314
  const getSmart = {
@@ -9320,7 +9333,7 @@ function createImageSmartObjectTools(controller) {
9320
9333
  },
9321
9334
  annotations: { title: "Convert to Smart Object", ...WRITE6 },
9322
9335
  handler: ({ layerIds, name }) => {
9323
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkD37BX2ZAcjs.requireLayer.call(void 0, controller.getLayers(), id2);
9336
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkMGL4U5WAcjs.requireLayer.call(void 0, controller.getLayers(), id2);
9324
9337
  const id = controller.convertToSmartObject(layerIds, { name });
9325
9338
  return { layer: layerSummary(id), smartObject: info(id) };
9326
9339
  }
@@ -9378,7 +9391,7 @@ function createImageSmartObjectTools(controller) {
9378
9391
  }
9379
9392
  ]
9380
9393
  },
9381
- interpolation: { type: "string", enum: _chunkAZTZRLDIcjs.INTERPOLATIONS, description: "Resampling: nearest, bilinear or bicubic (default: as before, bicubic for new smart objects)." }
9394
+ interpolation: { type: "string", enum: _chunkPOGBUYWEcjs.INTERPOLATIONS, description: "Resampling: nearest, bilinear or bicubic (default: as before, bicubic for new smart objects)." }
9382
9395
  },
9383
9396
  required: ["layerId"],
9384
9397
  additionalProperties: false
@@ -9393,12 +9406,12 @@ function createImageSmartObjectTools(controller) {
9393
9406
  else if (w) {
9394
9407
  const m = w;
9395
9408
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
9396
- if (m.points.length !== want) throw new (0, _chunkD37BX2ZAcjs.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}.`);
9409
+ if (m.points.length !== want) throw new (0, _chunkMGL4U5WAcjs.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}.`);
9397
9410
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
9398
9411
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
9399
9412
  }
9400
9413
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
9401
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
9414
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
9402
9415
  const res = controller.setSmartObjectTransform(id, {
9403
9416
  corners: args.corners,
9404
9417
  matrix: args.matrix,
@@ -9440,7 +9453,7 @@ function createImageSmartObjectTools(controller) {
9440
9453
  annotations: { title: "Export a smart object\u2019s contents", ...READ7 },
9441
9454
  handler: ({ layerId }) => {
9442
9455
  const f = controller.exportSmartObjectContents(smartId(layerId));
9443
- return { name: f.name, mimeType: f.mimeType, byteLength: f.bytes.length, base64: _chunkAZTZRLDIcjs.bytesToBase64.call(void 0, f.bytes) };
9456
+ return { name: f.name, mimeType: f.mimeType, byteLength: f.bytes.length, base64: _chunkPOGBUYWEcjs.bytesToBase64.call(void 0, f.bytes) };
9444
9457
  }
9445
9458
  };
9446
9459
  const copy = {
@@ -9523,7 +9536,7 @@ function createImageSmartObjectTools(controller) {
9523
9536
  handler: (args) => {
9524
9537
  const id = smartId(args.layerId);
9525
9538
  const changes = settingsFrom(args);
9526
- if (!Object.keys(changes).length) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give at least one value to change.");
9539
+ if (!Object.keys(changes).length) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give at least one value to change.");
9527
9540
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
9528
9541
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
9529
9542
  }
@@ -9844,13 +9857,13 @@ function geometry(args) {
9844
9857
  }
9845
9858
  function createImageShapeTools(controller) {
9846
9859
  const shapeId = (id) => {
9847
- if (typeof id !== "string" || !id) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
9848
- _chunkD37BX2ZAcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
9860
+ if (typeof id !== "string" || !id) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
9861
+ _chunkMGL4U5WAcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
9849
9862
  return id;
9850
9863
  };
9851
9864
  const layerSummary = (id) => {
9852
9865
  const s = controller.getState();
9853
- const loc = _chunkAZTZRLDIcjs.findLayer.call(void 0, s.layers, id);
9866
+ const loc = _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, id);
9854
9867
  return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _308 => _308.parent, 'optionalAccess', _309 => _309.id]), () => ( null)), index: loc.index } : null;
9855
9868
  };
9856
9869
  const get = {
@@ -9881,7 +9894,7 @@ function createImageShapeTools(controller) {
9881
9894
  fillRule: { type: "string", enum: ["nonzero", "evenodd"], description: "Winding rule within a component (default nonzero)." },
9882
9895
  name: { type: "string", description: "Layer name (default by kind: Rectangle, Ellipse, \u2026)." },
9883
9896
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0..1 (default 1)." },
9884
- blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
9897
+ blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
9885
9898
  aboveId: { type: "string", description: "Put the layer directly above this layer (default above the active layer)." },
9886
9899
  belowId: { type: "string", description: "Put the layer directly below this layer." },
9887
9900
  parentId: { type: "string", description: "Put the layer inside this group." },
@@ -9920,7 +9933,7 @@ function createImageShapeTools(controller) {
9920
9933
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
9921
9934
  handler: ({ layerId, fill, stroke, fillRule }) => {
9922
9935
  const id = shapeId(layerId);
9923
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
9936
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
9924
9937
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
9925
9938
  }
9926
9939
  };
@@ -9969,7 +9982,7 @@ function createImageShapeTools(controller) {
9969
9982
  handler: ({ layerId, componentIndex, ...rest }) => {
9970
9983
  const id = shapeId(layerId);
9971
9984
  const change = geometry(rest);
9972
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkD37BX2ZAcjs.LayerOperationError)("Give shape, subpaths or op to change.");
9985
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkMGL4U5WAcjs.LayerOperationError)("Give shape, subpaths or op to change.");
9973
9986
  return controller.setShapeComponent(id, componentIndex, change);
9974
9987
  }
9975
9988
  };
@@ -10010,7 +10023,7 @@ function createImageShapeTools(controller) {
10010
10023
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
10011
10024
  function adjustmentsSummary(adjustments) {
10012
10025
  return {
10013
- process: _chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, adjustments.process),
10026
+ process: _chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, adjustments.process),
10014
10027
  values: readAdjustmentControls(adjustments),
10015
10028
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
10016
10029
  };
@@ -10053,7 +10066,7 @@ function createImageEditorToolProvider(controller, options = {}) {
10053
10066
  default: def,
10054
10067
  ...requiresProcess ? { requiresProcess } : {}
10055
10068
  })),
10056
- layerKinds: _chunkD37BX2ZAcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
10069
+ layerKinds: _chunkMGL4U5WAcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
10057
10070
  kind,
10058
10071
  label,
10059
10072
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -10065,7 +10078,7 @@ function createImageEditorToolProvider(controller, options = {}) {
10065
10078
  default: def
10066
10079
  }))
10067
10080
  })),
10068
- blendModes: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id),
10081
+ blendModes: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id),
10069
10082
  layerPathFormat: "layers.<layerId>.<controlId>"
10070
10083
  })
10071
10084
  };
@@ -10139,7 +10152,7 @@ function createImageEditorToolProvider(controller, options = {}) {
10139
10152
  const result = { applied, clamped };
10140
10153
  if (typeof label === "string" && label) result.label = label;
10141
10154
  const notes = [];
10142
- if ("tint" in applied && _chunkD37BX2ZAcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
10155
+ if ("tint" in applied && _chunkMGL4U5WAcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
10143
10156
  notes.push("Tint has no effect on process 1 edits.");
10144
10157
  }
10145
10158
  if (notes.length) result.notes = notes;
@@ -10149,14 +10162,14 @@ function createImageEditorToolProvider(controller, options = {}) {
10149
10162
  const addLayer = {
10150
10163
  name: "add_adjustment_layer",
10151
10164
  title: "Add an adjustment layer",
10152
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkD37BX2ZAcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
10165
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkMGL4U5WAcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
10153
10166
  inputSchema: {
10154
10167
  type: "object",
10155
10168
  properties: {
10156
- kind: { type: "string", enum: _chunkD37BX2ZAcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
10169
+ kind: { type: "string", enum: _chunkMGL4U5WAcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
10157
10170
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
10158
10171
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
10159
- blend: { type: "string", enum: _chunkSZ6KMZNMcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
10172
+ blend: { type: "string", enum: _chunkXIOMMGPDcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
10160
10173
  name: { type: "string", description: "Layer name shown in the layers panel." },
10161
10174
  aboveId: { type: "string", description: "Put the layer directly above this layer (from list_layers). Default: above the other adjustment layers, below annotations." },
10162
10175
  parentId: { type: "string", description: "Put the layer at the top of this group (from list_layers)." }
@@ -10172,8 +10185,8 @@ function createImageEditorToolProvider(controller, options = {}) {
10172
10185
  openWorldHint: false
10173
10186
  },
10174
10187
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
10175
- if (!_chunkD37BX2ZAcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
10176
- if (blend !== void 0 && !_chunkSZ6KMZNMcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
10188
+ if (!_chunkMGL4U5WAcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
10189
+ if (blend !== void 0 && !_chunkXIOMMGPDcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
10177
10190
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
10178
10191
  for (const ref of [aboveId, parentId]) {
10179
10192
  if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
@@ -10248,7 +10261,7 @@ function createImageEditorToolProvider(controller, options = {}) {
10248
10261
  ...createImageShapeTools(controller),
10249
10262
  ...createImageEffectTools(controller),
10250
10263
  ...createImagePaintTools(controller),
10251
- ..._chunkHUFQD4CBcjs.createPigmentTools.call(void 0, ),
10264
+ ..._chunk7VOHOPLWcjs.createPigmentTools.call(void 0, ),
10252
10265
  ...createImagePsdTools(controller)
10253
10266
  ]
10254
10267
  };
@@ -10263,7 +10276,7 @@ function boxToCurvePoint(x, y, width, height) {
10263
10276
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
10264
10277
  }
10265
10278
  function curveSvgPath(points, width, height, samples = 64) {
10266
- const lut = _chunkD37BX2ZAcjs.curveLutFromLevels.call(void 0, points);
10279
+ const lut = _chunkMGL4U5WAcjs.curveLutFromLevels.call(void 0, points);
10267
10280
  const n = lut.length - 1;
10268
10281
  let d = "";
10269
10282
  for (let i = 0; i <= samples; i++) {
@@ -10571,7 +10584,7 @@ function layerPanelRows(layers, activeId) {
10571
10584
  }
10572
10585
  function layerLabel(layer) {
10573
10586
  if (layer.name) return layer.name;
10574
- if (layer.type === "adjustment") return _chunkD37BX2ZAcjs.adjustmentKindLabel.call(void 0, layer.kind);
10587
+ if (layer.type === "adjustment") return _chunkMGL4U5WAcjs.adjustmentKindLabel.call(void 0, layer.kind);
10575
10588
  return layer.type === "group" ? "Group" : "Layer";
10576
10589
  }
10577
10590
  function layerBadge(layer) {
@@ -10596,7 +10609,7 @@ function dropZone(fraction, isGroup) {
10596
10609
  }
10597
10610
  function dropPlacement(layers, dragId, targetId, zone) {
10598
10611
  if (dragId === targetId) return null;
10599
- const target = _chunkAZTZRLDIcjs.findLayer.call(void 0, layers, targetId);
10612
+ const target = _chunkPOGBUYWEcjs.findLayer.call(void 0, layers, targetId);
10600
10613
  if (!target) return null;
10601
10614
  if (zone === "inside" && target.layer.type === "group") return { parentId: targetId };
10602
10615
  return zone === "above" ? { aboveId: targetId } : { belowId: targetId };
@@ -10604,7 +10617,7 @@ function dropPlacement(layers, dragId, targetId, zone) {
10604
10617
  function layerMenu(controller) {
10605
10618
  const s = controller.getState();
10606
10619
  const active = controller.getActiveLayer();
10607
- const loc = active ? _chunkAZTZRLDIcjs.findLayer.call(void 0, s.layers, active.id) : null;
10620
+ const loc = active ? _chunkPOGBUYWEcjs.findLayer.call(void 0, s.layers, active.id) : null;
10608
10621
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
10609
10622
  const below = loc ? siblings[loc.index - 1] : void 0;
10610
10623
  const hasSel = controller.hasSelection;
@@ -10781,18 +10794,18 @@ function layerEffectsPanel(layer) {
10781
10794
  reason: readOnly ? "The layer is locked; unlock it to change its effects." : void 0,
10782
10795
  enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _351 => _351.enabled]), () => ( true)),
10783
10796
  scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _352 => _352.scale]), () => ( 1)),
10784
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _353 => _353.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkAZTZRLDIcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
10797
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _353 => _353.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkPOGBUYWEcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
10785
10798
  };
10786
10799
  }
10787
10800
  function layerEffectsBadge(layer) {
10788
10801
  if (!_optionalChain([layer, 'access', _354 => _354.effects, 'optionalAccess', _355 => _355.items, 'access', _356 => _356.length])) return null;
10789
- return _chunkAZTZRLDIcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
10802
+ return _chunkPOGBUYWEcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
10790
10803
  }
10791
- var LAYER_EFFECT_MENU = _chunkAZTZRLDIcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkAZTZRLDIcjs.layerEffectLabel.call(void 0, kind) }));
10792
- var BLENDS = _chunkSZ6KMZNMcjs.BLEND_MODES.filter((m) => m.id !== "pigment").map((m) => ({ value: m.id, label: m.label }));
10804
+ var LAYER_EFFECT_MENU = _chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkPOGBUYWEcjs.layerEffectLabel.call(void 0, kind) }));
10805
+ var BLENDS = _chunkXIOMMGPDcjs.BLEND_MODES.filter((m) => m.id !== "pigment").map((m) => ({ value: m.id, label: m.label }));
10793
10806
  var opt = (...pairs) => pairs.map(([value, label]) => ({ value, label }));
10794
10807
  function patternOptions(patterns) {
10795
- return [...patterns.map((p) => ({ value: p.id, label: p.name || p.id })), ..._chunkAZTZRLDIcjs.builtinPatternIds.call(void 0, ).map((id) => ({ value: id, label: _chunkAZTZRLDIcjs.builtinPattern.call(void 0, id).name }))];
10808
+ return [...patterns.map((p) => ({ value: p.id, label: p.name || p.id })), ..._chunkPOGBUYWEcjs.builtinPatternIds.call(void 0, ).map((id) => ({ value: id, label: _chunkPOGBUYWEcjs.builtinPattern.call(void 0, id).name }))];
10796
10809
  }
10797
10810
  function getPath(o, path) {
10798
10811
  let v = o;
@@ -10922,7 +10935,7 @@ function layerEffectControls(e, patterns = []) {
10922
10935
  }
10923
10936
  }
10924
10937
  function fillOfType(current, type, patterns) {
10925
- if (type === "gradient") return { type: "gradient", gradient: _chunkAZTZRLDIcjs.defaultEffectGradient.call(void 0, ) };
10938
+ if (type === "gradient") return { type: "gradient", gradient: _chunkPOGBUYWEcjs.defaultEffectGradient.call(void 0, ) };
10926
10939
  if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _363 => _363[0], 'optionalAccess', _364 => _364.id]), () => ( "checker")), scale: 1 };
10927
10940
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
10928
10941
  }
@@ -11116,7 +11129,7 @@ var FreeTransformTool = (_class9 = class {
11116
11129
  if (this.active) return null;
11117
11130
  try {
11118
11131
  if (!init.layerId && init.content !== "selection-outline" && !this.controller.getState().activeLayerId) {
11119
- const top = [..._chunkAZTZRLDIcjs.flattenLayers.call(void 0, this.controller.getState().layers)].reverse().find((l) => l.type === "pixel" && l.visible);
11132
+ const top = [..._chunkPOGBUYWEcjs.flattenLayers.call(void 0, this.controller.getState().layers)].reverse().find((l) => l.type === "pixel" && l.visible);
11120
11133
  if (top) this.controller.setActiveLayer(top.id);
11121
11134
  }
11122
11135
  const s = this.controller.beginFreeTransform(init);
@@ -11443,7 +11456,7 @@ var FreeTransformTool = (_class9 = class {
11443
11456
  bar() {
11444
11457
  const s = this.session;
11445
11458
  if (!s || !this.corners) return null;
11446
- const read = _chunkD37BX2ZAcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
11459
+ const read = _chunkMGL4U5WAcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
11447
11460
  return {
11448
11461
  affine: read.affine,
11449
11462
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -11468,7 +11481,7 @@ var FreeTransformTool = (_class9 = class {
11468
11481
  this.changed();
11469
11482
  return;
11470
11483
  }
11471
- const m = _chunkD37BX2ZAcjs.matrixFromParams.call(void 0, s.box, {
11484
+ const m = _chunkMGL4U5WAcjs.matrixFromParams.call(void 0, s.box, {
11472
11485
  scaleX: next.scaleX,
11473
11486
  scaleY: next.scaleY,
11474
11487
  rotate: next.rotate,
@@ -11478,7 +11491,7 @@ var FreeTransformTool = (_class9 = class {
11478
11491
  dx: next.x - this.refBox.x,
11479
11492
  dy: next.y - this.refBox.y
11480
11493
  });
11481
- this.setCorners(_chunkD37BX2ZAcjs.cornersFromMatrix.call(void 0, s.box, m));
11494
+ this.setCorners(_chunkMGL4U5WAcjs.cornersFromMatrix.call(void 0, s.box, m));
11482
11495
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
11483
11496
  this.changed();
11484
11497
  }
@@ -12162,5 +12175,18 @@ var FreeTransformTool = (_class9 = class {
12162
12175
 
12163
12176
 
12164
12177
 
12165
- exports.ADJUSTMENT_KEYS = _chunkD37BX2ZAcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkD37BX2ZAcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkD37BX2ZAcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkD37BX2ZAcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkD37BX2ZAcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkD37BX2ZAcjs.BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkSZ6KMZNMcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkD37BX2ZAcjs.BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunkHUFQD4CBcjs.CoverageMap; exports.D50 = _chunkD37BX2ZAcjs.D50; exports.D65 = _chunkD37BX2ZAcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_BRUSH = _chunkHUFQD4CBcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkAZTZRLDIcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkD37BX2ZAcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkHUFQD4CBcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkD37BX2ZAcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkAZTZRLDIcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunkHUFQD4CBcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkD37BX2ZAcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkHUFQD4CBcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkD37BX2ZAcjs.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.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkD37BX2ZAcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkD37BX2ZAcjs.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.INTERPOLATIONS = _chunkAZTZRLDIcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkD37BX2ZAcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkD37BX2ZAcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkAZTZRLDIcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkD37BX2ZAcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkD37BX2ZAcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkD37BX2ZAcjs.LUMA_709; exports.LayerCompositor = _chunkD37BX2ZAcjs.LayerCompositor; exports.LayerEffectError = _chunkAZTZRLDIcjs.LayerEffectError; exports.LayerOperationError = _chunkD37BX2ZAcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunkHUFQD4CBcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkAZTZRLDIcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkD37BX2ZAcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkAZTZRLDIcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkD37BX2ZAcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkD37BX2ZAcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkHUFQD4CBcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkHUFQD4CBcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkHUFQD4CBcjs.MIXING_MODELS; exports.MixerStroke = _chunkHUFQD4CBcjs.MixerStroke; exports.PAINTERLY_BLEND_MODES = _chunkSZ6KMZNMcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkD37BX2ZAcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkSZ6KMZNMcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkSZ6KMZNMcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkSZ6KMZNMcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkSZ6KMZNMcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = _chunkD37BX2ZAcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkAZTZRLDIcjs.PatternPlacement; exports.PatternTile = _chunkAZTZRLDIcjs.PatternTile; exports.PsdError = _chunkD37BX2ZAcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkD37BX2ZAcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkD37BX2ZAcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SHADOW_AMBIENT = _chunkSZ6KMZNMcjs.SHADOW_AMBIENT; exports.SHAPE_OPERATIONS = _chunkD37BX2ZAcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkD37BX2ZAcjs.SHAPE_RENDER_MARGIN; exports.SMART_RENDER_MARGIN = _chunkD37BX2ZAcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkD37BX2ZAcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.StrokeCoverage = _chunkHUFQD4CBcjs.StrokeCoverage; exports.SurfaceDraft = _chunkSZ6KMZNMcjs.SurfaceDraft; exports.TILE = _chunkSZ6KMZNMcjs.TILE; exports.TILE_SHIFT = _chunkSZ6KMZNMcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkD37BX2ZAcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkD37BX2ZAcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkD37BX2ZAcjs.TRANSFORM_ANCHORS; exports.TiledSurface = _chunkSZ6KMZNMcjs.TiledSurface; exports.TransformTooLargeError = _chunkAZTZRLDIcjs.TransformTooLargeError; exports.VIBRANCE_GREY = _chunkD37BX2ZAcjs.VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkW3GXSUSQcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkW3GXSUSQcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = _chunkD37BX2ZAcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkAZTZRLDIcjs.ZlibError; exports.activeAdjustmentLayers = _chunkD37BX2ZAcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkD37BX2ZAcjs.activeSmartFilters; exports.addLayerEffect = _chunkD37BX2ZAcjs.addLayerEffect; exports.addLayerFilter = _chunkD37BX2ZAcjs.addLayerFilter; exports.addSmartFilter = _chunkD37BX2ZAcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkD37BX2ZAcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkD37BX2ZAcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkD37BX2ZAcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkD37BX2ZAcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkAZTZRLDIcjs.adler32; exports.anchorPoint = _chunkD37BX2ZAcjs.anchorPoint; exports.annotationBlend = _chunkD37BX2ZAcjs.annotationBlend; exports.annotationLayerFor = _chunkD37BX2ZAcjs.annotationLayerFor; exports.annotationLayerName = _chunkD37BX2ZAcjs.annotationLayerName; exports.annotationOfLayer = _chunkD37BX2ZAcjs.annotationOfLayer; exports.annotationOfShape = _chunkD37BX2ZAcjs.annotationOfShape; exports.applyAdjustmentLayers = _chunkD37BX2ZAcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkD37BX2ZAcjs.applyAdjustments; exports.applyBoxBlur = _chunkD37BX2ZAcjs.applyBoxBlur; exports.applyDepthMask = _chunkD37BX2ZAcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkD37BX2ZAcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkD37BX2ZAcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkD37BX2ZAcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkD37BX2ZAcjs.applyParams; exports.applyProcess2Adjustments = _chunkD37BX2ZAcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applySmartFilters = _chunkD37BX2ZAcjs.applySmartFilters; exports.applyStrokeToTile = _chunkHUFQD4CBcjs.applyStrokeToTile; exports.backgroundLayer = _chunkD37BX2ZAcjs.backgroundLayer; exports.base64ToBytes = _chunkAZTZRLDIcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkD37BX2ZAcjs.blackWhiteGray; exports.blendChannel = _chunkSZ6KMZNMcjs.blendChannel; exports.blendImageData = _chunkSZ6KMZNMcjs.blendImageData; exports.blendLum = _chunkSZ6KMZNMcjs.blendLum; exports.blendPixel = _chunkSZ6KMZNMcjs.blendPixel; exports.blendRgb = _chunkSZ6KMZNMcjs.blendRgb; exports.blendTile = _chunkAZTZRLDIcjs.blendTile; exports.blurFilter = _chunkD37BX2ZAcjs.blurFilter; exports.borderCoverage = _chunkD37BX2ZAcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkD37BX2ZAcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkD37BX2ZAcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkD37BX2ZAcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkD37BX2ZAcjs.buildToneLut; exports.builtinPattern = _chunkAZTZRLDIcjs.builtinPattern; exports.builtinPatternIds = _chunkAZTZRLDIcjs.builtinPatternIds; exports.bytesToBase64 = _chunkAZTZRLDIcjs.bytesToBase64; exports.calculateCropDrag = _chunkD37BX2ZAcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkSZ6KMZNMcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkD37BX2ZAcjs.canvasToImagePoint; exports.changedTiles = _chunkAZTZRLDIcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkD37BX2ZAcjs.clampCropToImage; exports.cleanMixer = _chunkHUFQD4CBcjs.cleanMixer; exports.collectTiles = _chunkSZ6KMZNMcjs.collectTiles; exports.colorBalanceChannel = _chunkD37BX2ZAcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkD37BX2ZAcjs.combineSelections; exports.compileAdjustmentLayer = _chunkD37BX2ZAcjs.compileAdjustmentLayer; exports.componentPath = _chunkD37BX2ZAcjs.componentPath; exports.compositeSurfaceOver = _chunkAZTZRLDIcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkD37BX2ZAcjs.computeSelectionBounds; exports.contentBounds = _chunkSZ6KMZNMcjs.contentBounds; exports.contentsBox = _chunkD37BX2ZAcjs.contentsBox; exports.contentsSurface = _chunkD37BX2ZAcjs.contentsSurface; exports.contractCoverage = _chunkD37BX2ZAcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkD37BX2ZAcjs.convertToSmartObject; exports.copySmartObject = _chunkD37BX2ZAcjs.copySmartObject; exports.cornersFromMatrix = _chunkD37BX2ZAcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkHUFQD4CBcjs.coverageTileCoord; exports.coverageToByte = _chunkD37BX2ZAcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkD37BX2ZAcjs.createAdjustmentLayer; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createPigment = _chunkSZ6KMZNMcjs.createPigment; exports.createPigmentTools = _chunkHUFQD4CBcjs.createPigmentTools; exports.createSelectionMask = _chunkD37BX2ZAcjs.createSelectionMask; exports.createShapeLayer = _chunkD37BX2ZAcjs.createShapeLayer; exports.curveLut = _chunkAZTZRLDIcjs.curveLut; exports.curveLutFromLevels = _chunkD37BX2ZAcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkHUFQD4CBcjs.dabCoverage; exports.dabRect = _chunkHUFQD4CBcjs.dabRect; exports.decodeLayerChannel = _chunkD37BX2ZAcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkD37BX2ZAcjs.decodeLayerMask; exports.decodeMergedImage = _chunkD37BX2ZAcjs.decodeMergedImage; exports.decodePlanes = _chunkD37BX2ZAcjs.decodePlanes; exports.decodePng = _chunkAZTZRLDIcjs.decodePng; exports.decodePngDataUrl = _chunkD37BX2ZAcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkD37BX2ZAcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkD37BX2ZAcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkAZTZRLDIcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkAZTZRLDIcjs.defaultLayerEffect; exports.defaultShapeName = _chunkD37BX2ZAcjs.defaultShapeName; exports.deflate = _chunkAZTZRLDIcjs.deflate; exports.deflateRaw = _chunkAZTZRLDIcjs.deflateRaw; exports.depthMaskAlpha = _chunkD37BX2ZAcjs.depthMaskAlpha; exports.depthRasterMask = _chunkD37BX2ZAcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkD37BX2ZAcjs.describeTransform; exports.deserializeEffects = _chunkD37BX2ZAcjs.deserializeEffects; exports.deserializeLayer = _chunkD37BX2ZAcjs.deserializeLayer; exports.deserializeLayers = _chunkD37BX2ZAcjs.deserializeLayers; exports.deserializePatterns = _chunkD37BX2ZAcjs.deserializePatterns; exports.deserializeSelection = _chunkD37BX2ZAcjs.deserializeSelection; exports.developFilter = _chunkD37BX2ZAcjs.developFilter; exports.developFromAdjustments = _chunkD37BX2ZAcjs.developFromAdjustments; exports.developTarget = _chunkD37BX2ZAcjs.developTarget; exports.distanceTransform = _chunkD37BX2ZAcjs.distanceTransform; exports.documentContents = _chunkD37BX2ZAcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkW3GXSUSQcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkD37BX2ZAcjs.duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkAZTZRLDIcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkAZTZRLDIcjs.effectReach; exports.effectsFingerprint = _chunkAZTZRLDIcjs.effectsFingerprint; exports.effectsMargin = _chunkAZTZRLDIcjs.effectsMargin; exports.effectsScale = _chunkAZTZRLDIcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkSZ6KMZNMcjs.emptySurface; exports.encodePng = _chunkAZTZRLDIcjs.encodePng; exports.encodeRle = _chunkD37BX2ZAcjs.encodeRle; exports.encodeSelectionRle = _chunkD37BX2ZAcjs.encodeSelectionRle; exports.encodeSurface = _chunkD37BX2ZAcjs.encodeSurface; exports.evalWarpMesh = _chunkW3GXSUSQcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkD37BX2ZAcjs.evaluateAdjustmentLayers; exports.expandCoverage = _chunkD37BX2ZAcjs.expandCoverage; exports.exportPsd = _chunkD37BX2ZAcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkD37BX2ZAcjs.featherCoverage; exports.fillRect = _chunkSZ6KMZNMcjs.fillRect; exports.filterMaskCoverage = _chunkD37BX2ZAcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkAZTZRLDIcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkSZ6KMZNMcjs.finishTile; exports.flattenLayers = _chunkAZTZRLDIcjs.flattenLayers; exports.flattenPath = _chunkD37BX2ZAcjs.flattenPath; exports.flipCorners = _chunkD37BX2ZAcjs.flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkD37BX2ZAcjs.fullSelection; exports.gaussianBlur = _chunkAZTZRLDIcjs.gaussianBlur; exports.geometryHomography = _chunkD37BX2ZAcjs.geometryHomography; exports.getAnnotationBounds = _chunkD37BX2ZAcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkD37BX2ZAcjs.getCropCursor; exports.getRotatedSize = _chunkD37BX2ZAcjs.getRotatedSize; exports.getViewportMetrics = _chunkD37BX2ZAcjs.getViewportMetrics; exports.getViewportProjection = _chunkD37BX2ZAcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkD37BX2ZAcjs.greyMorphology; exports.groupLayers = _chunkD37BX2ZAcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkAZTZRLDIcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkD37BX2ZAcjs.hasResampledLegacyMask; exports.hasSurface = _chunkD37BX2ZAcjs.hasSurface; exports.hasWarp = _chunkD37BX2ZAcjs.hasWarp; exports.hashMaskContent = _chunkD37BX2ZAcjs.hashMaskContent; exports.hashNoise = _chunkAZTZRLDIcjs.hashNoise; exports.hexToRgb = _chunkD37BX2ZAcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkD37BX2ZAcjs.hitTestAnnotation; exports.hitTestCrop = _chunkD37BX2ZAcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkD37BX2ZAcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkD37BX2ZAcjs.hueRangeTables; exports.hueRangeWeight = _chunkD37BX2ZAcjs.hueRangeWeight; exports.hueSaturation = _chunkD37BX2ZAcjs.hueSaturation; exports.identityCurve = _chunkD37BX2ZAcjs.identityCurve; exports.identityLevels = _chunkD37BX2ZAcjs.identityLevels; exports.identityTransform = _chunkD37BX2ZAcjs.identityTransform; exports.identityWarpMesh = _chunkW3GXSUSQcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkD37BX2ZAcjs.imageToCanvasPoint; exports.importPsd = _chunkD37BX2ZAcjs.importPsd; exports.inflate = _chunkAZTZRLDIcjs.inflate; exports.inflateRaw = _chunkAZTZRLDIcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkAZTZRLDIcjs.insertLayer; exports.instancesOf = _chunkD37BX2ZAcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkD37BX2ZAcjs.invertMatrix3; exports.invertSelection = _chunkD37BX2ZAcjs.invertSelection; exports.isActiveFilter = _chunkD37BX2ZAcjs.isActiveFilter; exports.isAdjustmentKind = _chunkD37BX2ZAcjs.isAdjustmentKind; exports.isBlendMode = _chunkSZ6KMZNMcjs.isBlendMode; exports.isContentsDecoded = _chunkD37BX2ZAcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkD37BX2ZAcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunkD37BX2ZAcjs.isIdentityTransform; exports.isInterpolation = _chunkAZTZRLDIcjs.isInterpolation; exports.isLayerEffectKind = _chunkAZTZRLDIcjs.isLayerEffectKind; exports.isLayerLocked = _chunkAZTZRLDIcjs.isLayerLocked; exports.isLegacyShape = _chunkD37BX2ZAcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkSZ6KMZNMcjs.isPainterlyBlendMode; exports.isPng = _chunkAZTZRLDIcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkD37BX2ZAcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkD37BX2ZAcjs.isRenderedLayer; exports.isSelectionEmpty = _chunkD37BX2ZAcjs.isSelectionEmpty; exports.isSelectionMode = _chunkD37BX2ZAcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkSZ6KMZNMcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkD37BX2ZAcjs.isSpatialFilter; exports.isTransformAnchor = _chunkD37BX2ZAcjs.isTransformAnchor; exports.isValidWarp = _chunkD37BX2ZAcjs.isValidWarp; exports.kelvinToTemperature = _chunkD37BX2ZAcjs.kelvinToTemperature; exports.keysWeight = _chunkAZTZRLDIcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkAZTZRLDIcjs.layerEffectFields; exports.layerEffectLabel = _chunkAZTZRLDIcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkD37BX2ZAcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkD37BX2ZAcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkD37BX2ZAcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkD37BX2ZAcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkD37BX2ZAcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkD37BX2ZAcjs.layerTree; exports.layerTypeLabel = _chunkD37BX2ZAcjs.layerTypeLabel; exports.layersFromLegacy = _chunkD37BX2ZAcjs.layersFromLegacy; exports.legacyAdjustmentLayer = _chunkD37BX2ZAcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkD37BX2ZAcjs.legacyMaskOf; exports.legacyView = _chunkD37BX2ZAcjs.legacyView; exports.lerpPigment = _chunkSZ6KMZNMcjs.lerpPigment; exports.lerpPigmentInto = _chunkSZ6KMZNMcjs.lerpPigmentInto; exports.levelsValue = _chunkD37BX2ZAcjs.levelsValue; exports.linearSrgbToXy = _chunkD37BX2ZAcjs.linearSrgbToXy; exports.linearToSrgb = _chunkD37BX2ZAcjs.linearToSrgb; exports.liveComponent = _chunkD37BX2ZAcjs.liveComponent; exports.liveShapeSubpaths = _chunkD37BX2ZAcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkHUFQD4CBcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkD37BX2ZAcjs.mapCropHandle; exports.mapLayer = _chunkAZTZRLDIcjs.mapLayer; exports.mapSubpaths = _chunkD37BX2ZAcjs.mapSubpaths; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkD37BX2ZAcjs.matrixFromCorners; exports.matrixFromParams = _chunkD37BX2ZAcjs.matrixFromParams; exports.mergeLayerEffect = _chunkAZTZRLDIcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkD37BX2ZAcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkSZ6KMZNMcjs.mixPigment8; exports.mixPigmentRgb = _chunkSZ6KMZNMcjs.mixPigmentRgb; exports.mixPigments = _chunkSZ6KMZNMcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.modifySelection = _chunkD37BX2ZAcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkD37BX2ZAcjs.moveLayer; exports.moveSmartFilter = _chunkD37BX2ZAcjs.moveSmartFilter; exports.mulMatrix3 = _chunkD37BX2ZAcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkD37BX2ZAcjs.neutralHueRange; exports.newContentsId = _chunkD37BX2ZAcjs.newContentsId; exports.newEffectId = _chunkAZTZRLDIcjs.newEffectId; exports.newLayerId = _chunkD37BX2ZAcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkD37BX2ZAcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkD37BX2ZAcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkD37BX2ZAcjs.normalizeAngle; exports.normalizeBlendMode = _chunkSZ6KMZNMcjs.normalizeBlendMode; exports.normalizeBrush = _chunkHUFQD4CBcjs.normalizeBrush; exports.normalizeFilter = _chunkD37BX2ZAcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkAZTZRLDIcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkD37BX2ZAcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkD37BX2ZAcjs.normalizeLiveShape; exports.normalizeMixer = _chunkHUFQD4CBcjs.normalizeMixer; exports.normalizePlacement = _chunkD37BX2ZAcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkD37BX2ZAcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeShapePaint = _chunkD37BX2ZAcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkD37BX2ZAcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkD37BX2ZAcjs.normalizeSmartFilter; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkD37BX2ZAcjs.normalizeSubpaths; exports.offsetLayer = _chunkD37BX2ZAcjs.offsetLayer; exports.offsetShape = _chunkD37BX2ZAcjs.offsetShape; exports.offsetSmartObject = _chunkD37BX2ZAcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkSZ6KMZNMcjs.packRgba; exports.parseAdjustmentBlock = _chunkD37BX2ZAcjs.parseAdjustmentBlock; exports.parseBlend = _chunkD37BX2ZAcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkD37BX2ZAcjs.parseCssColor; exports.parseDataUrl = _chunkAZTZRLDIcjs.parseDataUrl; exports.parseEffectColor = _chunkAZTZRLDIcjs.parseEffectColor; exports.parseLfx2 = _chunkD37BX2ZAcjs.parseLfx2; exports.parseLrfx = _chunkD37BX2ZAcjs.parseLrfx; exports.parsePatternBlock = _chunkD37BX2ZAcjs.parsePatternBlock; exports.parseSelectionMode = _chunkD37BX2ZAcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkD37BX2ZAcjs.parseVersionedDescriptor; exports.photoFilterMatrix = _chunkD37BX2ZAcjs.photoFilterMatrix; exports.pixelLayerBounds = _chunkD37BX2ZAcjs.pixelLayerBounds; exports.pixelLayers = _chunkD37BX2ZAcjs.pixelLayers; exports.placeContents = _chunkD37BX2ZAcjs.placeContents; exports.placeLayer = _chunkD37BX2ZAcjs.placeLayer; exports.placementAt = _chunkD37BX2ZAcjs.placementAt; exports.placementBounds = _chunkD37BX2ZAcjs.placementBounds; exports.placementGeometry = _chunkD37BX2ZAcjs.placementGeometry; exports.pngDataUrl = _chunkAZTZRLDIcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkD37BX2ZAcjs.posterizeValue; exports.presetWarp = _chunkD37BX2ZAcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkD37BX2ZAcjs.projectImagePoint; exports.projectImageRect = _chunkD37BX2ZAcjs.projectImageRect; exports.projectMaskCoverage = _chunkD37BX2ZAcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkD37BX2ZAcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkD37BX2ZAcjs.psdToLayers; exports.pullWarpMesh = _chunkW3GXSUSQcjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkD37BX2ZAcjs.rangeLightness; exports.rasterContents = _chunkD37BX2ZAcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkD37BX2ZAcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkD37BX2ZAcjs.rasterizeCoverage; exports.rasterizeDab = _chunkHUFQD4CBcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkD37BX2ZAcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkSZ6KMZNMcjs.readPixel; exports.readPsd = _chunkD37BX2ZAcjs.readPsd; exports.readRegion = _chunkSZ6KMZNMcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkAZTZRLDIcjs.reduceSurface; exports.referencePoint = _chunkD37BX2ZAcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkSZ6KMZNMcjs.reflectanceToRgb; exports.removeAlpha = _chunkD37BX2ZAcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkD37BX2ZAcjs.removeLayer; exports.removeLayerEffect = _chunkD37BX2ZAcjs.removeLayerEffect; exports.removeLayerFilter = _chunkD37BX2ZAcjs.removeLayerFilter; exports.removeSmartFilter = _chunkD37BX2ZAcjs.removeSmartFilter; exports.renderLayerEffects = _chunkAZTZRLDIcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkD37BX2ZAcjs.renderShape; exports.renderShapeRect = _chunkD37BX2ZAcjs.renderShapeRect; exports.renderSmartObject = _chunkD37BX2ZAcjs.renderSmartObject; exports.replaceContents = _chunkD37BX2ZAcjs.replaceContents; exports.requireLayer = _chunkD37BX2ZAcjs.requireLayer; exports.requireOperation = _chunkD37BX2ZAcjs.requireOperation; exports.requireShapeLayer = _chunkD37BX2ZAcjs.requireShapeLayer; exports.requireSmartObject = _chunkD37BX2ZAcjs.requireSmartObject; exports.requireUnlocked = _chunkD37BX2ZAcjs.requireUnlocked; exports.rerender = _chunkD37BX2ZAcjs.rerender; exports.rerenderShape = _chunkD37BX2ZAcjs.rerenderShape; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkD37BX2ZAcjs.resizeSelection; exports.resizeWarpMesh = _chunkW3GXSUSQcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkD37BX2ZAcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = _chunkD37BX2ZAcjs.rgbToGray; exports.rgbToHsl = _chunkD37BX2ZAcjs.rgbToHsl; exports.rgbToReflectance = _chunkSZ6KMZNMcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkD37BX2ZAcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkD37BX2ZAcjs.sampleLut; exports.sampleToneLut = _chunkD37BX2ZAcjs.sampleToneLut; exports.scaleLayerEffect = _chunkAZTZRLDIcjs.scaleLayerEffect; exports.selectionArea = _chunkD37BX2ZAcjs.selectionArea; exports.selectionFromCoverage = _chunkD37BX2ZAcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkD37BX2ZAcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkD37BX2ZAcjs.selectionToCoverage; exports.selectionToPixels = _chunkD37BX2ZAcjs.selectionToPixels; exports.selectionValueAt = _chunkD37BX2ZAcjs.selectionValueAt; exports.serializeContents = _chunkD37BX2ZAcjs.serializeContents; exports.serializeEffects = _chunkD37BX2ZAcjs.serializeEffects; exports.serializeLayer = _chunkD37BX2ZAcjs.serializeLayer; exports.serializeLayers = _chunkD37BX2ZAcjs.serializeLayers; exports.serializeLayersExternal = _chunkD37BX2ZAcjs.serializeLayersExternal; exports.serializePatterns = _chunkD37BX2ZAcjs.serializePatterns; exports.serializeSelection = _chunkD37BX2ZAcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkD37BX2ZAcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkD37BX2ZAcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkD37BX2ZAcjs.setLayerMask; exports.setLayerProperties = _chunkD37BX2ZAcjs.setLayerProperties; exports.setLum = _chunkSZ6KMZNMcjs.setLum; exports.setPigmentColor = _chunkSZ6KMZNMcjs.setPigmentColor; exports.setSmartFilterMask = _chunkD37BX2ZAcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkD37BX2ZAcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkD37BX2ZAcjs.setSmartPlacement; exports.shapeAsPixelLayer = _chunkD37BX2ZAcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkD37BX2ZAcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkD37BX2ZAcjs.shapeGeometryBounds; exports.shapeLayers = _chunkD37BX2ZAcjs.shapeLayers; exports.shapeOutline = _chunkD37BX2ZAcjs.shapeOutline; exports.shapeRenderClip = _chunkD37BX2ZAcjs.shapeRenderClip; exports.shiftCoverage = _chunkD37BX2ZAcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkD37BX2ZAcjs.smartObjectLayers; exports.smoothCoverage = _chunkD37BX2ZAcjs.smoothCoverage; exports.smoothPoints = _chunkHUFQD4CBcjs.smoothPoints; exports.solidSurface = _chunkSZ6KMZNMcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkD37BX2ZAcjs.srgbToLinear; exports.standardBlendMode = _chunkSZ6KMZNMcjs.standardBlendMode; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkSZ6KMZNMcjs.surfaceBytes; exports.surfaceFromPixels = _chunkSZ6KMZNMcjs.surfaceFromPixels; exports.surfacesEqual = _chunkSZ6KMZNMcjs.surfacesEqual; exports.tempTintToXy = _chunkD37BX2ZAcjs.tempTintToXy; exports.temperatureToKelvin = _chunkD37BX2ZAcjs.temperatureToKelvin; exports.tileCoord = _chunkSZ6KMZNMcjs.tileCoord; exports.tileKey = _chunkSZ6KMZNMcjs.tileKey; exports.tileRect = _chunkSZ6KMZNMcjs.tileRect; exports.tilesInRect = _chunkSZ6KMZNMcjs.tilesInRect; exports.tipFalloff = _chunkHUFQD4CBcjs.tipFalloff; exports.tipReach = _chunkHUFQD4CBcjs.tipReach; exports.tipShape = _chunkHUFQD4CBcjs.tipShape; exports.toHex = toHex; exports.toneCurve = _chunkD37BX2ZAcjs.toneCurve; exports.toneLuts = _chunkD37BX2ZAcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkD37BX2ZAcjs.transformHomography; exports.transformMap = _chunkD37BX2ZAcjs.transformMap; exports.transformShapeComponents = _chunkD37BX2ZAcjs.transformShapeComponents; exports.transformSurface = _chunkAZTZRLDIcjs.transformSurface; exports.transformedBounds = _chunkAZTZRLDIcjs.transformedBounds; exports.transformedBox = _chunkD37BX2ZAcjs.transformedBox; exports.transformedPoint = _chunkD37BX2ZAcjs.transformedPoint; exports.translateSurface = _chunkSZ6KMZNMcjs.translateSurface; exports.ungroupLayer = _chunkD37BX2ZAcjs.ungroupLayer; exports.uniformTile = _chunkSZ6KMZNMcjs.uniformTile; exports.unionRect = _chunkD37BX2ZAcjs.unionRect; exports.unprojectCanvasPoint = _chunkD37BX2ZAcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkD37BX2ZAcjs.updateLayerEffect; exports.updateLayerFilter = _chunkD37BX2ZAcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkD37BX2ZAcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunkD37BX2ZAcjs.updateShapeLayer; exports.updateSmartFilter = _chunkD37BX2ZAcjs.updateSmartFilter; exports.uvToXy = _chunkD37BX2ZAcjs.uvToXy; exports.validateEffectGradient = _chunkAZTZRLDIcjs.validateEffectGradient; exports.validateLayerEffect = _chunkAZTZRLDIcjs.validateLayerEffect; exports.validateLayerEffects = _chunkAZTZRLDIcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkD37BX2ZAcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkD37BX2ZAcjs.vibranceLinear; exports.vibrancePixel = _chunkD37BX2ZAcjs.vibrancePixel; exports.walkDabs = _chunkHUFQD4CBcjs.walkDabs; exports.warpMeshEditPoints = _chunkW3GXSUSQcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkW3GXSUSQcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkW3GXSUSQcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkW3GXSUSQcjs.warpPresetMesh; exports.warpSurface = _chunkAZTZRLDIcjs.warpSurface; exports.wbMatrix = _chunkD37BX2ZAcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkD37BX2ZAcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkD37BX2ZAcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkD37BX2ZAcjs.withFilterMaskSurface; exports.withNewIds = _chunkD37BX2ZAcjs.withNewIds; exports.writeAdjustmentBlock = _chunkD37BX2ZAcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkD37BX2ZAcjs.writeLfx2; exports.writePatternBlock = _chunkD37BX2ZAcjs.writePatternBlock; exports.writePsd = _chunkD37BX2ZAcjs.writePsd; exports.writeRegion = _chunkSZ6KMZNMcjs.writeRegion; exports.xyToTempTint = _chunkD37BX2ZAcjs.xyToTempTint; exports.xyToUv = _chunkD37BX2ZAcjs.xyToUv;
12178
+
12179
+
12180
+
12181
+
12182
+
12183
+
12184
+
12185
+
12186
+
12187
+
12188
+
12189
+
12190
+
12191
+ exports.ADJUSTMENT_KEYS = _chunkMGL4U5WAcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkMGL4U5WAcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkMGL4U5WAcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkMGL4U5WAcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkMGL4U5WAcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkMGL4U5WAcjs.BACKGROUND_LAYER_NAME; exports.BLEND_MODES = _chunkXIOMMGPDcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkMGL4U5WAcjs.BLUR_FILTER_ID; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.CoverageMap = _chunk7VOHOPLWcjs.CoverageMap; exports.D50 = _chunkMGL4U5WAcjs.D50; exports.D65 = _chunkMGL4U5WAcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_BLENDER = _chunk7VOHOPLWcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk7VOHOPLWcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_GLOBAL_LIGHT = _chunkPOGBUYWEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkMGL4U5WAcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk7VOHOPLWcjs.DEFAULT_MIXER; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk7VOHOPLWcjs.DEFAULT_SMUDGE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkMGL4U5WAcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkPOGBUYWEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DabWalker = _chunk7VOHOPLWcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkMGL4U5WAcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk7VOHOPLWcjs.EMPTY_MIXER_LOAD; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkMGL4U5WAcjs.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.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkMGL4U5WAcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkMGL4U5WAcjs.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.INTERPOLATIONS = _chunkPOGBUYWEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkMGL4U5WAcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkMGL4U5WAcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkPOGBUYWEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkMGL4U5WAcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkMGL4U5WAcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkMGL4U5WAcjs.LUMA_709; exports.LayerCompositor = _chunkMGL4U5WAcjs.LayerCompositor; exports.LayerEffectError = _chunkPOGBUYWEcjs.LayerEffectError; exports.LayerOperationError = _chunkMGL4U5WAcjs.LayerOperationError; exports.MAX_BRUSH_SIZE = _chunk7VOHOPLWcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkPOGBUYWEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkMGL4U5WAcjs.MAX_KELVIN; exports.MAX_TRANSFORM_PIXELS = _chunkPOGBUYWEcjs.MAX_TRANSFORM_PIXELS; exports.MIN_KELVIN = _chunkMGL4U5WAcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkMGL4U5WAcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk7VOHOPLWcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk7VOHOPLWcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk7VOHOPLWcjs.MIXING_MODELS; exports.MixerStroke = _chunk7VOHOPLWcjs.MixerStroke; exports.PAINTERLY_BLEND_MODES = _chunkXIOMMGPDcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkMGL4U5WAcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkXIOMMGPDcjs.PIGMENT_BANDS; exports.PIGMENT_LAMBDA_MIN = _chunkXIOMMGPDcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkXIOMMGPDcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_WAVELENGTHS = _chunkXIOMMGPDcjs.PIGMENT_WAVELENGTHS; exports.PSD_BLEND_KEYS = _chunkMGL4U5WAcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.PaintExchange = _chunk7VOHOPLWcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkPOGBUYWEcjs.PatternPlacement; exports.PatternTile = _chunkPOGBUYWEcjs.PatternTile; exports.PsdError = _chunkMGL4U5WAcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.SELECTION_MODES = _chunkMGL4U5WAcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkMGL4U5WAcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SHADOW_AMBIENT = _chunkXIOMMGPDcjs.SHADOW_AMBIENT; exports.SHAPE_OPERATIONS = _chunkMGL4U5WAcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkMGL4U5WAcjs.SHAPE_RENDER_MARGIN; exports.SMART_RENDER_MARGIN = _chunkMGL4U5WAcjs.SMART_RENDER_MARGIN; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkMGL4U5WAcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.SmudgeTip = _chunk7VOHOPLWcjs.SmudgeTip; exports.StrokeCoverage = _chunk7VOHOPLWcjs.StrokeCoverage; exports.SurfaceDraft = _chunkXIOMMGPDcjs.SurfaceDraft; exports.TILE = _chunkXIOMMGPDcjs.TILE; exports.TILE_SHIFT = _chunkXIOMMGPDcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkMGL4U5WAcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkMGL4U5WAcjs.TONE_LUT_SIZE; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkMGL4U5WAcjs.TRANSFORM_ANCHORS; exports.TileMedium = _chunk7VOHOPLWcjs.TileMedium; exports.TiledSurface = _chunkXIOMMGPDcjs.TiledSurface; exports.TransformTooLargeError = _chunkPOGBUYWEcjs.TransformTooLargeError; exports.VIBRANCE_GREY = _chunkMGL4U5WAcjs.VIBRANCE_GREY; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkW3GXSUSQcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkW3GXSUSQcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.XYZ_D50_TO_SRGB = _chunkMGL4U5WAcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkPOGBUYWEcjs.ZlibError; exports.activeAdjustmentLayers = _chunkMGL4U5WAcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkMGL4U5WAcjs.activeSmartFilters; exports.addLayerEffect = _chunkMGL4U5WAcjs.addLayerEffect; exports.addLayerFilter = _chunkMGL4U5WAcjs.addLayerFilter; exports.addSmartFilter = _chunkMGL4U5WAcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkMGL4U5WAcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkMGL4U5WAcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkMGL4U5WAcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkMGL4U5WAcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkPOGBUYWEcjs.adler32; exports.anchorPoint = _chunkMGL4U5WAcjs.anchorPoint; exports.annotationBlend = _chunkMGL4U5WAcjs.annotationBlend; exports.annotationLayerFor = _chunkMGL4U5WAcjs.annotationLayerFor; exports.annotationLayerName = _chunkMGL4U5WAcjs.annotationLayerName; exports.annotationOfLayer = _chunkMGL4U5WAcjs.annotationOfLayer; exports.annotationOfShape = _chunkMGL4U5WAcjs.annotationOfShape; exports.applyAdjustmentLayers = _chunkMGL4U5WAcjs.applyAdjustmentLayers; exports.applyAdjustments = _chunkMGL4U5WAcjs.applyAdjustments; exports.applyBoxBlur = _chunkMGL4U5WAcjs.applyBoxBlur; exports.applyDepthMask = _chunkMGL4U5WAcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkMGL4U5WAcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkMGL4U5WAcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkMGL4U5WAcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkMGL4U5WAcjs.applyParams; exports.applyProcess2Adjustments = _chunkMGL4U5WAcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applySmartFilters = _chunkMGL4U5WAcjs.applySmartFilters; exports.applyStrokeToTile = _chunk7VOHOPLWcjs.applyStrokeToTile; exports.backgroundLayer = _chunkMGL4U5WAcjs.backgroundLayer; exports.base64ToBytes = _chunkPOGBUYWEcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.blackWhiteGray = _chunkMGL4U5WAcjs.blackWhiteGray; exports.blendChannel = _chunkXIOMMGPDcjs.blendChannel; exports.blendImageData = _chunkXIOMMGPDcjs.blendImageData; exports.blendLum = _chunkXIOMMGPDcjs.blendLum; exports.blendPixel = _chunkXIOMMGPDcjs.blendPixel; exports.blendRadius = _chunk7VOHOPLWcjs.blendRadius; exports.blendRgb = _chunkXIOMMGPDcjs.blendRgb; exports.blendTile = _chunkPOGBUYWEcjs.blendTile; exports.blenderDab = _chunk7VOHOPLWcjs.blenderDab; exports.blurFilter = _chunkMGL4U5WAcjs.blurFilter; exports.borderCoverage = _chunkMGL4U5WAcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkMGL4U5WAcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkMGL4U5WAcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkMGL4U5WAcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkMGL4U5WAcjs.buildToneLut; exports.builtinPattern = _chunkPOGBUYWEcjs.builtinPattern; exports.builtinPatternIds = _chunkPOGBUYWEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkPOGBUYWEcjs.bytesToBase64; exports.calculateCropDrag = _chunkMGL4U5WAcjs.calculateCropDrag; exports.canvasCompositeOperation = _chunkXIOMMGPDcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkMGL4U5WAcjs.canvasToImagePoint; exports.changedTiles = _chunkPOGBUYWEcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkMGL4U5WAcjs.clampCropToImage; exports.cleanMixer = _chunk7VOHOPLWcjs.cleanMixer; exports.collectTiles = _chunkXIOMMGPDcjs.collectTiles; exports.colorBalanceChannel = _chunkMGL4U5WAcjs.colorBalanceChannel; exports.colorRange = colorRange; exports.combineSelections = _chunkMGL4U5WAcjs.combineSelections; exports.compileAdjustmentLayer = _chunkMGL4U5WAcjs.compileAdjustmentLayer; exports.componentPath = _chunkMGL4U5WAcjs.componentPath; exports.compositeSurfaceOver = _chunkPOGBUYWEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkMGL4U5WAcjs.computeSelectionBounds; exports.contentBounds = _chunkXIOMMGPDcjs.contentBounds; exports.contentsBox = _chunkMGL4U5WAcjs.contentsBox; exports.contentsSurface = _chunkMGL4U5WAcjs.contentsSurface; exports.contractCoverage = _chunkMGL4U5WAcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertToSmartObject = _chunkMGL4U5WAcjs.convertToSmartObject; exports.copySmartObject = _chunkMGL4U5WAcjs.copySmartObject; exports.cornersFromMatrix = _chunkMGL4U5WAcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk7VOHOPLWcjs.coverageTileCoord; exports.coverageToByte = _chunkMGL4U5WAcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkMGL4U5WAcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk7VOHOPLWcjs.createBlenderScratch; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createPigment = _chunkXIOMMGPDcjs.createPigment; exports.createPigmentTools = _chunk7VOHOPLWcjs.createPigmentTools; exports.createSelectionMask = _chunkMGL4U5WAcjs.createSelectionMask; exports.createShapeLayer = _chunkMGL4U5WAcjs.createShapeLayer; exports.curveLut = _chunkPOGBUYWEcjs.curveLut; exports.curveLutFromLevels = _chunkMGL4U5WAcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk7VOHOPLWcjs.dabCoverage; exports.dabRect = _chunk7VOHOPLWcjs.dabRect; exports.decodeLayerChannel = _chunkMGL4U5WAcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkMGL4U5WAcjs.decodeLayerMask; exports.decodeMergedImage = _chunkMGL4U5WAcjs.decodeMergedImage; exports.decodePlanes = _chunkMGL4U5WAcjs.decodePlanes; exports.decodePng = _chunkPOGBUYWEcjs.decodePng; exports.decodePngDataUrl = _chunkMGL4U5WAcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkMGL4U5WAcjs.decodeSelectionRle; exports.defaultAdjustmentParams = _chunkMGL4U5WAcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkPOGBUYWEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkPOGBUYWEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkMGL4U5WAcjs.defaultShapeName; exports.deflate = _chunkPOGBUYWEcjs.deflate; exports.deflateRaw = _chunkPOGBUYWEcjs.deflateRaw; exports.depthMaskAlpha = _chunkMGL4U5WAcjs.depthMaskAlpha; exports.depthRasterMask = _chunkMGL4U5WAcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkMGL4U5WAcjs.describeTransform; exports.deserializeEffects = _chunkMGL4U5WAcjs.deserializeEffects; exports.deserializeLayer = _chunkMGL4U5WAcjs.deserializeLayer; exports.deserializeLayers = _chunkMGL4U5WAcjs.deserializeLayers; exports.deserializePatterns = _chunkMGL4U5WAcjs.deserializePatterns; exports.deserializeSelection = _chunkMGL4U5WAcjs.deserializeSelection; exports.developFilter = _chunkMGL4U5WAcjs.developFilter; exports.developFromAdjustments = _chunkMGL4U5WAcjs.developFromAdjustments; exports.developTarget = _chunkMGL4U5WAcjs.developTarget; exports.distanceTransform = _chunkMGL4U5WAcjs.distanceTransform; exports.documentContents = _chunkMGL4U5WAcjs.documentContents; exports.downloadPsd = downloadPsd; exports.dragWarpMeshPoint = _chunkW3GXSUSQcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.duplicateLayer = _chunkMGL4U5WAcjs.duplicateLayer; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkPOGBUYWEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkPOGBUYWEcjs.effectReach; exports.effectsFingerprint = _chunkPOGBUYWEcjs.effectsFingerprint; exports.effectsMargin = _chunkPOGBUYWEcjs.effectsMargin; exports.effectsScale = _chunkPOGBUYWEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkXIOMMGPDcjs.emptySurface; exports.encodePng = _chunkPOGBUYWEcjs.encodePng; exports.encodeRle = _chunkMGL4U5WAcjs.encodeRle; exports.encodeSelectionRle = _chunkMGL4U5WAcjs.encodeSelectionRle; exports.encodeSurface = _chunkMGL4U5WAcjs.encodeSurface; exports.evalWarpMesh = _chunkW3GXSUSQcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkMGL4U5WAcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk7VOHOPLWcjs.exchangeRates; exports.expandCoverage = _chunkMGL4U5WAcjs.expandCoverage; exports.exportPsd = _chunkMGL4U5WAcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkMGL4U5WAcjs.featherCoverage; exports.fillRect = _chunkXIOMMGPDcjs.fillRect; exports.filterMaskCoverage = _chunkMGL4U5WAcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkPOGBUYWEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunkXIOMMGPDcjs.finishTile; exports.flattenLayers = _chunkPOGBUYWEcjs.flattenLayers; exports.flattenPath = _chunkMGL4U5WAcjs.flattenPath; exports.flipCorners = _chunkMGL4U5WAcjs.flipCorners; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkMGL4U5WAcjs.fullSelection; exports.gaussianBlur = _chunkPOGBUYWEcjs.gaussianBlur; exports.geometryHomography = _chunkMGL4U5WAcjs.geometryHomography; exports.getAnnotationBounds = _chunkMGL4U5WAcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkMGL4U5WAcjs.getCropCursor; exports.getRotatedSize = _chunkMGL4U5WAcjs.getRotatedSize; exports.getViewportMetrics = _chunkMGL4U5WAcjs.getViewportMetrics; exports.getViewportProjection = _chunkMGL4U5WAcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkMGL4U5WAcjs.greyMorphology; exports.groupLayers = _chunkMGL4U5WAcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkPOGBUYWEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkMGL4U5WAcjs.hasResampledLegacyMask; exports.hasSurface = _chunkMGL4U5WAcjs.hasSurface; exports.hasWarp = _chunkMGL4U5WAcjs.hasWarp; exports.hashMaskContent = _chunkMGL4U5WAcjs.hashMaskContent; exports.hashNoise = _chunkPOGBUYWEcjs.hashNoise; exports.hexToRgb = _chunkMGL4U5WAcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkMGL4U5WAcjs.hitTestAnnotation; exports.hitTestCrop = _chunkMGL4U5WAcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkMGL4U5WAcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkMGL4U5WAcjs.hueRangeTables; exports.hueRangeWeight = _chunkMGL4U5WAcjs.hueRangeWeight; exports.hueSaturation = _chunkMGL4U5WAcjs.hueSaturation; exports.identityCurve = _chunkMGL4U5WAcjs.identityCurve; exports.identityLevels = _chunkMGL4U5WAcjs.identityLevels; exports.identityTransform = _chunkMGL4U5WAcjs.identityTransform; exports.identityWarpMesh = _chunkW3GXSUSQcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkMGL4U5WAcjs.imageToCanvasPoint; exports.importPsd = _chunkMGL4U5WAcjs.importPsd; exports.inflate = _chunkPOGBUYWEcjs.inflate; exports.inflateRaw = _chunkPOGBUYWEcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkPOGBUYWEcjs.insertLayer; exports.instancesOf = _chunkMGL4U5WAcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkMGL4U5WAcjs.invertMatrix3; exports.invertSelection = _chunkMGL4U5WAcjs.invertSelection; exports.isActiveFilter = _chunkMGL4U5WAcjs.isActiveFilter; exports.isAdjustmentKind = _chunkMGL4U5WAcjs.isAdjustmentKind; exports.isBlendMode = _chunkXIOMMGPDcjs.isBlendMode; exports.isContentsDecoded = _chunkMGL4U5WAcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkMGL4U5WAcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunkMGL4U5WAcjs.isIdentityTransform; exports.isInterpolation = _chunkPOGBUYWEcjs.isInterpolation; exports.isLayerEffectKind = _chunkPOGBUYWEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkPOGBUYWEcjs.isLayerLocked; exports.isLegacyShape = _chunkMGL4U5WAcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkXIOMMGPDcjs.isPainterlyBlendMode; exports.isPng = _chunkPOGBUYWEcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkMGL4U5WAcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkMGL4U5WAcjs.isRenderedLayer; exports.isSelectionEmpty = _chunkMGL4U5WAcjs.isSelectionEmpty; exports.isSelectionMode = _chunkMGL4U5WAcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkXIOMMGPDcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkMGL4U5WAcjs.isSpatialFilter; exports.isTransformAnchor = _chunkMGL4U5WAcjs.isTransformAnchor; exports.isValidWarp = _chunkMGL4U5WAcjs.isValidWarp; exports.kelvinToTemperature = _chunkMGL4U5WAcjs.kelvinToTemperature; exports.keysWeight = _chunkPOGBUYWEcjs.keysWeight; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkPOGBUYWEcjs.layerEffectFields; exports.layerEffectLabel = _chunkPOGBUYWEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkMGL4U5WAcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkMGL4U5WAcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkMGL4U5WAcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkMGL4U5WAcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkMGL4U5WAcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkMGL4U5WAcjs.layerTree; exports.layerTypeLabel = _chunkMGL4U5WAcjs.layerTypeLabel; exports.layersFromLegacy = _chunkMGL4U5WAcjs.layersFromLegacy; exports.legacyAdjustmentLayer = _chunkMGL4U5WAcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkMGL4U5WAcjs.legacyMaskOf; exports.legacyView = _chunkMGL4U5WAcjs.legacyView; exports.lerpPigment = _chunkXIOMMGPDcjs.lerpPigment; exports.lerpPigmentInto = _chunkXIOMMGPDcjs.lerpPigmentInto; exports.levelsValue = _chunkMGL4U5WAcjs.levelsValue; exports.linearSrgbToXy = _chunkMGL4U5WAcjs.linearSrgbToXy; exports.linearToSrgb = _chunkMGL4U5WAcjs.linearToSrgb; exports.liveComponent = _chunkMGL4U5WAcjs.liveComponent; exports.liveShapeSubpaths = _chunkMGL4U5WAcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk7VOHOPLWcjs.loadMixer; exports.magicWand = magicWand; exports.mapCropHandle = _chunkMGL4U5WAcjs.mapCropHandle; exports.mapLayer = _chunkPOGBUYWEcjs.mapLayer; exports.mapSubpaths = _chunkMGL4U5WAcjs.mapSubpaths; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkMGL4U5WAcjs.matrixFromCorners; exports.matrixFromParams = _chunkMGL4U5WAcjs.matrixFromParams; exports.mergeLayerEffect = _chunkPOGBUYWEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkMGL4U5WAcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunkXIOMMGPDcjs.mixPigment8; exports.mixPigmentRgb = _chunkXIOMMGPDcjs.mixPigmentRgb; exports.mixPigments = _chunkXIOMMGPDcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk7VOHOPLWcjs.mixerRates; exports.modifySelection = _chunkMGL4U5WAcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkMGL4U5WAcjs.moveLayer; exports.moveSmartFilter = _chunkMGL4U5WAcjs.moveSmartFilter; exports.mulMatrix3 = _chunkMGL4U5WAcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkMGL4U5WAcjs.neutralHueRange; exports.newContentsId = _chunkMGL4U5WAcjs.newContentsId; exports.newEffectId = _chunkPOGBUYWEcjs.newEffectId; exports.newLayerId = _chunkMGL4U5WAcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkMGL4U5WAcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkMGL4U5WAcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkMGL4U5WAcjs.normalizeAngle; exports.normalizeBlendMode = _chunkXIOMMGPDcjs.normalizeBlendMode; exports.normalizeBlender = _chunk7VOHOPLWcjs.normalizeBlender; exports.normalizeBrush = _chunk7VOHOPLWcjs.normalizeBrush; exports.normalizeFilter = _chunkMGL4U5WAcjs.normalizeFilter; exports.normalizeLayerEffects = _chunkPOGBUYWEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkMGL4U5WAcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkMGL4U5WAcjs.normalizeLiveShape; exports.normalizeMixer = _chunk7VOHOPLWcjs.normalizeMixer; exports.normalizePlacement = _chunkMGL4U5WAcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkMGL4U5WAcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeShapePaint = _chunkMGL4U5WAcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkMGL4U5WAcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkMGL4U5WAcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk7VOHOPLWcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkMGL4U5WAcjs.normalizeSubpaths; exports.offsetLayer = _chunkMGL4U5WAcjs.offsetLayer; exports.offsetShape = _chunkMGL4U5WAcjs.offsetShape; exports.offsetSmartObject = _chunkMGL4U5WAcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkXIOMMGPDcjs.packRgba; exports.parseAdjustmentBlock = _chunkMGL4U5WAcjs.parseAdjustmentBlock; exports.parseBlend = _chunkMGL4U5WAcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkMGL4U5WAcjs.parseCssColor; exports.parseDataUrl = _chunkPOGBUYWEcjs.parseDataUrl; exports.parseEffectColor = _chunkPOGBUYWEcjs.parseEffectColor; exports.parseLfx2 = _chunkMGL4U5WAcjs.parseLfx2; exports.parseLrfx = _chunkMGL4U5WAcjs.parseLrfx; exports.parsePatternBlock = _chunkMGL4U5WAcjs.parsePatternBlock; exports.parseSelectionMode = _chunkMGL4U5WAcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkMGL4U5WAcjs.parseVersionedDescriptor; exports.photoFilterMatrix = _chunkMGL4U5WAcjs.photoFilterMatrix; exports.pigment8 = _chunkXIOMMGPDcjs.pigment8; exports.pixelLayerBounds = _chunkMGL4U5WAcjs.pixelLayerBounds; exports.pixelLayers = _chunkMGL4U5WAcjs.pixelLayers; exports.placeContents = _chunkMGL4U5WAcjs.placeContents; exports.placeLayer = _chunkMGL4U5WAcjs.placeLayer; exports.placementAt = _chunkMGL4U5WAcjs.placementAt; exports.placementBounds = _chunkMGL4U5WAcjs.placementBounds; exports.placementGeometry = _chunkMGL4U5WAcjs.placementGeometry; exports.pngDataUrl = _chunkPOGBUYWEcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkMGL4U5WAcjs.posterizeValue; exports.presetWarp = _chunkMGL4U5WAcjs.presetWarp; exports.previewStep = previewStep; exports.projectImagePoint = _chunkMGL4U5WAcjs.projectImagePoint; exports.projectImageRect = _chunkMGL4U5WAcjs.projectImageRect; exports.projectMaskCoverage = _chunkMGL4U5WAcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkMGL4U5WAcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkMGL4U5WAcjs.psdToLayers; exports.pullWarpMesh = _chunkW3GXSUSQcjs.pullWarpMesh; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkMGL4U5WAcjs.rangeLightness; exports.rasterContents = _chunkMGL4U5WAcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkMGL4U5WAcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkMGL4U5WAcjs.rasterizeCoverage; exports.rasterizeDab = _chunk7VOHOPLWcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkMGL4U5WAcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readPixel = _chunkXIOMMGPDcjs.readPixel; exports.readPsd = _chunkMGL4U5WAcjs.readPsd; exports.readRegion = _chunkXIOMMGPDcjs.readRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkPOGBUYWEcjs.reduceSurface; exports.referencePoint = _chunkMGL4U5WAcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkXIOMMGPDcjs.reflectanceToRgb; exports.removeAlpha = _chunkMGL4U5WAcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkMGL4U5WAcjs.removeLayer; exports.removeLayerEffect = _chunkMGL4U5WAcjs.removeLayerEffect; exports.removeLayerFilter = _chunkMGL4U5WAcjs.removeLayerFilter; exports.removeSmartFilter = _chunkMGL4U5WAcjs.removeSmartFilter; exports.renderLayerEffects = _chunkPOGBUYWEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkMGL4U5WAcjs.renderShape; exports.renderShapeRect = _chunkMGL4U5WAcjs.renderShapeRect; exports.renderSmartObject = _chunkMGL4U5WAcjs.renderSmartObject; exports.replaceContents = _chunkMGL4U5WAcjs.replaceContents; exports.requireLayer = _chunkMGL4U5WAcjs.requireLayer; exports.requireOperation = _chunkMGL4U5WAcjs.requireOperation; exports.requireShapeLayer = _chunkMGL4U5WAcjs.requireShapeLayer; exports.requireSmartObject = _chunkMGL4U5WAcjs.requireSmartObject; exports.requireUnlocked = _chunkMGL4U5WAcjs.requireUnlocked; exports.rerender = _chunkMGL4U5WAcjs.rerender; exports.rerenderShape = _chunkMGL4U5WAcjs.rerenderShape; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkMGL4U5WAcjs.resizeSelection; exports.resizeWarpMesh = _chunkW3GXSUSQcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkMGL4U5WAcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.rgbToGray = _chunkMGL4U5WAcjs.rgbToGray; exports.rgbToHsl = _chunkMGL4U5WAcjs.rgbToHsl; exports.rgbToReflectance = _chunkXIOMMGPDcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.runLayerFilters = _chunkMGL4U5WAcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkMGL4U5WAcjs.sampleLut; exports.sampleToneLut = _chunkMGL4U5WAcjs.sampleToneLut; exports.scaleLayerEffect = _chunkPOGBUYWEcjs.scaleLayerEffect; exports.selectionArea = _chunkMGL4U5WAcjs.selectionArea; exports.selectionFromCoverage = _chunkMGL4U5WAcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkMGL4U5WAcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkMGL4U5WAcjs.selectionToCoverage; exports.selectionToPixels = _chunkMGL4U5WAcjs.selectionToPixels; exports.selectionValueAt = _chunkMGL4U5WAcjs.selectionValueAt; exports.serializeContents = _chunkMGL4U5WAcjs.serializeContents; exports.serializeEffects = _chunkMGL4U5WAcjs.serializeEffects; exports.serializeLayer = _chunkMGL4U5WAcjs.serializeLayer; exports.serializeLayers = _chunkMGL4U5WAcjs.serializeLayers; exports.serializeLayersExternal = _chunkMGL4U5WAcjs.serializeLayersExternal; exports.serializePatterns = _chunkMGL4U5WAcjs.serializePatterns; exports.serializeSelection = _chunkMGL4U5WAcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkMGL4U5WAcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkMGL4U5WAcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkMGL4U5WAcjs.setLayerMask; exports.setLayerProperties = _chunkMGL4U5WAcjs.setLayerProperties; exports.setLum = _chunkXIOMMGPDcjs.setLum; exports.setPigmentColor = _chunkXIOMMGPDcjs.setPigmentColor; exports.setSmartFilterMask = _chunkMGL4U5WAcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkMGL4U5WAcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkMGL4U5WAcjs.setSmartPlacement; exports.shapeAsPixelLayer = _chunkMGL4U5WAcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkMGL4U5WAcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkMGL4U5WAcjs.shapeGeometryBounds; exports.shapeLayers = _chunkMGL4U5WAcjs.shapeLayers; exports.shapeOutline = _chunkMGL4U5WAcjs.shapeOutline; exports.shapeRenderClip = _chunkMGL4U5WAcjs.shapeRenderClip; exports.shiftCoverage = _chunkMGL4U5WAcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkMGL4U5WAcjs.smartObjectLayers; exports.smoothCoverage = _chunkMGL4U5WAcjs.smoothCoverage; exports.smoothPoints = _chunk7VOHOPLWcjs.smoothPoints; exports.solidSurface = _chunkXIOMMGPDcjs.solidSurface; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.srgb8ToLab = srgb8ToLab; exports.srgbToLinear = _chunkMGL4U5WAcjs.srgbToLinear; exports.standardBlendMode = _chunkXIOMMGPDcjs.standardBlendMode; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkXIOMMGPDcjs.surfaceBytes; exports.surfaceFromPixels = _chunkXIOMMGPDcjs.surfaceFromPixels; exports.surfacesEqual = _chunkXIOMMGPDcjs.surfacesEqual; exports.tempTintToXy = _chunkMGL4U5WAcjs.tempTintToXy; exports.temperatureToKelvin = _chunkMGL4U5WAcjs.temperatureToKelvin; exports.tileCoord = _chunkXIOMMGPDcjs.tileCoord; exports.tileKey = _chunkXIOMMGPDcjs.tileKey; exports.tileRect = _chunkXIOMMGPDcjs.tileRect; exports.tilesInRect = _chunkXIOMMGPDcjs.tilesInRect; exports.tipFalloff = _chunk7VOHOPLWcjs.tipFalloff; exports.tipReach = _chunk7VOHOPLWcjs.tipReach; exports.tipShape = _chunk7VOHOPLWcjs.tipShape; exports.toHex = toHex; exports.toneCurve = _chunkMGL4U5WAcjs.toneCurve; exports.toneLuts = _chunkMGL4U5WAcjs.toneLuts; exports.toneRange = toneRange; exports.transformHomography = _chunkMGL4U5WAcjs.transformHomography; exports.transformMap = _chunkMGL4U5WAcjs.transformMap; exports.transformShapeComponents = _chunkMGL4U5WAcjs.transformShapeComponents; exports.transformSurface = _chunkPOGBUYWEcjs.transformSurface; exports.transformedBounds = _chunkPOGBUYWEcjs.transformedBounds; exports.transformedBox = _chunkMGL4U5WAcjs.transformedBox; exports.transformedPoint = _chunkMGL4U5WAcjs.transformedPoint; exports.translateSurface = _chunkXIOMMGPDcjs.translateSurface; exports.ungroupLayer = _chunkMGL4U5WAcjs.ungroupLayer; exports.uniformTile = _chunkXIOMMGPDcjs.uniformTile; exports.unionRect = _chunkMGL4U5WAcjs.unionRect; exports.unprojectCanvasPoint = _chunkMGL4U5WAcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkMGL4U5WAcjs.updateLayerEffect; exports.updateLayerFilter = _chunkMGL4U5WAcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkMGL4U5WAcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunkMGL4U5WAcjs.updateShapeLayer; exports.updateSmartFilter = _chunkMGL4U5WAcjs.updateSmartFilter; exports.uvToXy = _chunkMGL4U5WAcjs.uvToXy; exports.validateEffectGradient = _chunkPOGBUYWEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkPOGBUYWEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkPOGBUYWEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkMGL4U5WAcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkMGL4U5WAcjs.vibranceLinear; exports.vibrancePixel = _chunkMGL4U5WAcjs.vibrancePixel; exports.walkDabs = _chunk7VOHOPLWcjs.walkDabs; exports.warpMeshEditPoints = _chunkW3GXSUSQcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkW3GXSUSQcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkW3GXSUSQcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkW3GXSUSQcjs.warpPresetMesh; exports.warpSurface = _chunkPOGBUYWEcjs.warpSurface; exports.wbMatrix = _chunkMGL4U5WAcjs.wbMatrix; exports.whiteBalanceFromSample = _chunkMGL4U5WAcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkMGL4U5WAcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkMGL4U5WAcjs.withFilterMaskSurface; exports.withNewIds = _chunkMGL4U5WAcjs.withNewIds; exports.writeAdjustmentBlock = _chunkMGL4U5WAcjs.writeAdjustmentBlock; exports.writeLfx2 = _chunkMGL4U5WAcjs.writeLfx2; exports.writePatternBlock = _chunkMGL4U5WAcjs.writePatternBlock; exports.writePsd = _chunkMGL4U5WAcjs.writePsd; exports.writeRegion = _chunkXIOMMGPDcjs.writeRegion; exports.xyToTempTint = _chunkMGL4U5WAcjs.xyToTempTint; exports.xyToUv = _chunkMGL4U5WAcjs.xyToUv;
12166
12192
  //# sourceMappingURL=index.cjs.map