@pixerate/editor 0.187.0 → 0.188.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.
@@ -370,7 +370,9 @@ var _chunk5UEFNX24cjs = require('../chunk-5UEFNX24.cjs');
370
370
 
371
371
 
372
372
 
373
- var _chunkX2KQQZBTcjs = require('../chunk-X2KQQZBT.cjs');
373
+
374
+
375
+ var _chunkJYV4R62Mcjs = require('../chunk-JYV4R62M.cjs');
374
376
 
375
377
 
376
378
  var _chunkA2IS7EHEcjs = require('../chunk-A2IS7EHE.cjs');
@@ -970,7 +972,7 @@ function startMarchingAnts(tick, stepMs = MARCHING_ANTS_STEP_MS) {
970
972
 
971
973
  // src/image-editor/layers/render.ts
972
974
  function isQuarterTurn(rotate) {
973
- return _chunkX2KQQZBTcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
975
+ return _chunkJYV4R62Mcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
974
976
  }
975
977
  function isIntegerRect(r) {
976
978
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -978,7 +980,7 @@ function isIntegerRect(r) {
978
980
  function baseProjection(region, transform, baseW, baseH) {
979
981
  return {
980
982
  region,
981
- angle: _chunkX2KQQZBTcjs.normalizeAngle.call(void 0, transform.rotate),
983
+ angle: _chunkJYV4R62Mcjs.normalizeAngle.call(void 0, transform.rotate),
982
984
  flipH: transform.flipH,
983
985
  flipV: transform.flipV,
984
986
  scale: 1,
@@ -987,14 +989,14 @@ function baseProjection(region, transform, baseW, baseH) {
987
989
  };
988
990
  }
989
991
  function projectQuarterTurn(src, srcRect, region, transform) {
990
- const rotated = _chunkX2KQQZBTcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
992
+ const rotated = _chunkJYV4R62Mcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
991
993
  const w = Math.max(1, Math.round(rotated.width));
992
994
  const h = Math.max(1, Math.round(rotated.height));
993
995
  const out = new Uint8ClampedArray(w * h * 4);
994
996
  const p = baseProjection(region, transform, w, h);
995
- const o = _chunkX2KQQZBTcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
996
- const ox = _chunkX2KQQZBTcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
997
- const oy = _chunkX2KQQZBTcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
997
+ const o = _chunkJYV4R62Mcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
998
+ const ox = _chunkJYV4R62Mcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
999
+ const oy = _chunkJYV4R62Mcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
998
1000
  const ux = Math.round(ox.x - o.x);
999
1001
  const vx = Math.round(ox.y - o.y);
1000
1002
  const uy = Math.round(oy.x - o.x);
@@ -1023,23 +1025,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
1023
1025
  const d = img.data;
1024
1026
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
1025
1027
  }
1026
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunkX2KQQZBTcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
1028
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkJYV4R62Mcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
1027
1029
  }
1028
1030
  function needsLegacyBase(input) {
1029
1031
  const { stack, region, canvas, transform } = input;
1030
- if (!_chunkX2KQQZBTcjs.isLegacyShape.call(void 0, stack)) return false;
1032
+ if (!_chunkJYV4R62Mcjs.isLegacyShape.call(void 0, stack)) return false;
1031
1033
  const bg = stack.layers[0];
1032
1034
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
1033
1035
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
1034
1036
  if (stack.outputOpacity < 1) return true;
1035
- const blur = _chunkX2KQQZBTcjs.blurFilter.call(void 0, bg);
1037
+ const blur = _chunkJYV4R62Mcjs.blurFilter.call(void 0, bg);
1036
1038
  if (blur && blur.enabled && blur.radius > 0) {
1037
1039
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
1038
- const angle = _chunkX2KQQZBTcjs.normalizeAngle.call(void 0, transform.rotate);
1040
+ const angle = _chunkJYV4R62Mcjs.normalizeAngle.call(void 0, transform.rotate);
1039
1041
  if (!full || angle === 90 || angle === 270) return true;
1040
1042
  }
1041
1043
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
1042
- if (_chunkX2KQQZBTcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1044
+ if (_chunkJYV4R62Mcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1043
1045
  return false;
1044
1046
  }
1045
1047
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -1071,7 +1073,7 @@ function coveringRect(region) {
1071
1073
  const y = Math.floor(region.y);
1072
1074
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
1073
1075
  }
1074
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkX2KQQZBTcjs.LayerCompositor)()) {
1076
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkJYV4R62Mcjs.LayerCompositor)()) {
1075
1077
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
1076
1078
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
1077
1079
  }
@@ -1216,8 +1218,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1216
1218
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1217
1219
  * trust dirty rectangles; exports use `exportCompositor`.
1218
1220
  */
1219
- __init8() {this.compositor = new (0, _chunkX2KQQZBTcjs.LayerCompositor)()}
1220
- __init9() {this.exportCompositor = new (0, _chunkX2KQQZBTcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1221
+ __init8() {this.compositor = new (0, _chunkJYV4R62Mcjs.LayerCompositor)()}
1222
+ __init9() {this.exportCompositor = new (0, _chunkJYV4R62Mcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1221
1223
  /** How the host resolves layer pixels (set by the controller). */
1222
1224
 
1223
1225
  /**
@@ -1297,9 +1299,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1297
1299
  return;
1298
1300
  }
1299
1301
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1300
- const projection = _chunkX2KQQZBTcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1302
+ const projection = _chunkJYV4R62Mcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1301
1303
  const { region } = projection;
1302
- const rotated = _chunkX2KQQZBTcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1304
+ const rotated = _chunkJYV4R62Mcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1303
1305
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1304
1306
  let overlay = annotations;
1305
1307
  if (route === "legacy") {
@@ -1309,8 +1311,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1309
1311
  `${naturalWidth}x${naturalHeight}`,
1310
1312
  `${region.x},${region.y},${region.width},${region.height}`,
1311
1313
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1312
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1313
- _chunkX2KQQZBTcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1314
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1315
+ _chunkJYV4R62Mcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1314
1316
  `${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}`,
1315
1317
  `d${this.displayKey}`
1316
1318
  ].join("|");
@@ -1344,7 +1346,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1344
1346
  }
1345
1347
  if (overlay.length > 0 || options.draftAnnotation) {
1346
1348
  ctx.save();
1347
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1349
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1348
1350
  ctx.beginPath();
1349
1351
  ctx.rect(region.x, region.y, region.width, region.height);
1350
1352
  ctx.clip();
@@ -1368,7 +1370,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1368
1370
  if (shownChannels.length) {
1369
1371
  ctx.save();
1370
1372
  try {
1371
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1373
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1372
1374
  ctx.beginPath();
1373
1375
  ctx.rect(region.x, region.y, region.width, region.height);
1374
1376
  ctx.clip();
@@ -1382,7 +1384,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1382
1384
  if (_optionalChain([state, 'access', _17 => _17.selection, 'optionalAccess', _18 => _18.bounds]) && display !== "none" || quickMaskSel || _optionalChain([options, 'access', _19 => _19.draftSelectionPath, 'optionalAccess', _20 => _20.length])) {
1383
1385
  ctx.save();
1384
1386
  try {
1385
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1387
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1386
1388
  ctx.beginPath();
1387
1389
  ctx.rect(region.x, region.y, region.width, region.height);
1388
1390
  ctx.clip();
@@ -1398,7 +1400,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1398
1400
  const b = options.brushCursor;
1399
1401
  ctx.save();
1400
1402
  try {
1401
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1403
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1402
1404
  const px2 = u / (projection.scale || 1);
1403
1405
  ctx.beginPath();
1404
1406
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1413,7 +1415,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1413
1415
  ctx.restore();
1414
1416
  }
1415
1417
  if (options.cloneSourceMarker) {
1416
- const m = _chunkX2KQQZBTcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1418
+ const m = _chunkJYV4R62Mcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1417
1419
  ctx.save();
1418
1420
  try {
1419
1421
  const r = 7 * u;
@@ -1437,7 +1439,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1437
1439
  const t = options.textEdit;
1438
1440
  ctx.save();
1439
1441
  try {
1440
- const scr = (p) => _chunkX2KQQZBTcjs.projectImagePoint.call(void 0, p, projection);
1442
+ const scr = (p) => _chunkJYV4R62Mcjs.projectImagePoint.call(void 0, p, projection);
1441
1443
  const poly = (pts) => {
1442
1444
  ctx.beginPath();
1443
1445
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1476,7 +1478,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1476
1478
  const t = options.freeTransform;
1477
1479
  ctx.save();
1478
1480
  try {
1479
- const scr = (p) => _chunkX2KQQZBTcjs.projectImagePoint.call(void 0, p, projection);
1481
+ const scr = (p) => _chunkJYV4R62Mcjs.projectImagePoint.call(void 0, p, projection);
1480
1482
  ctx.beginPath();
1481
1483
  if (t.warp) {
1482
1484
  for (const c of t.warp.curves) {
@@ -1540,7 +1542,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1540
1542
  }
1541
1543
  if (isActivelyCropping) {
1542
1544
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1543
- this.drawCropOverlay(ctx, _chunkX2KQQZBTcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop), u);
1545
+ this.drawCropOverlay(ctx, _chunkJYV4R62Mcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop), u);
1544
1546
  }
1545
1547
  }
1546
1548
  /**
@@ -1549,7 +1551,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1549
1551
  */
1550
1552
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1551
1553
  const { adjustments, depthMask } = state;
1552
- const rotated = _chunkX2KQQZBTcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1554
+ const rotated = _chunkJYV4R62Mcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1553
1555
  const baseW = Math.max(1, Math.round(rotated.width));
1554
1556
  const baseH = Math.max(1, Math.round(rotated.height));
1555
1557
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1557,7 +1559,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1557
1559
  if (!baseCtx) return baseCanvas;
1558
1560
  const projection = getBaseProjection(region, transform, baseW, baseH);
1559
1561
  baseCtx.save();
1560
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1562
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1561
1563
  baseCtx.drawImage(
1562
1564
  img,
1563
1565
  region.x,
@@ -1572,8 +1574,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1572
1574
  baseCtx.restore();
1573
1575
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1574
1576
  if (imageData) {
1575
- const layerMasks = _chunkX2KQQZBTcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1576
- _chunkX2KQQZBTcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1577
+ const layerMasks = _chunkJYV4R62Mcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1578
+ _chunkJYV4R62Mcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1577
1579
  if (depthMask.enabled && depthMask.maskSource) {
1578
1580
  try {
1579
1581
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1584,7 +1586,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1584
1586
  const maskCtx = maskCanvas.getContext("2d");
1585
1587
  if (maskCtx) {
1586
1588
  maskCtx.save();
1587
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1589
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1588
1590
  maskCtx.drawImage(
1589
1591
  maskImg,
1590
1592
  region.x * sx,
@@ -1599,7 +1601,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1599
1601
  maskCtx.restore();
1600
1602
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1601
1603
  if (maskData) {
1602
- _chunkX2KQQZBTcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1604
+ _chunkJYV4R62Mcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1603
1605
  }
1604
1606
  }
1605
1607
  } catch (e10) {
@@ -1618,7 +1620,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1618
1620
  else if (this.baseRoute === "layers") route = "layers";
1619
1621
  else {
1620
1622
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1621
- const shaped = this.baseRoute === "legacy" && _chunkX2KQQZBTcjs.isLegacyShape.call(void 0, stack);
1623
+ const shaped = this.baseRoute === "legacy" && _chunkJYV4R62Mcjs.isLegacyShape.call(void 0, stack);
1622
1624
  route = shaped || needsLegacyBase({
1623
1625
  stack,
1624
1626
  region,
@@ -1753,17 +1755,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1753
1755
  if (!comp) return null;
1754
1756
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1755
1757
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1756
- const rotated = _chunkX2KQQZBTcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1758
+ const rotated = _chunkJYV4R62Mcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1757
1759
  const baseW = Math.max(1, Math.round(rotated.width));
1758
1760
  const baseH = Math.max(1, Math.round(rotated.height));
1759
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkX2KQQZBTcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1761
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkJYV4R62Mcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1760
1762
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1761
1763
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1762
1764
  const ctx = canvas.getContext("2d");
1763
1765
  if (!ctx) return null;
1764
1766
  ctx.clearRect(0, 0, baseW, baseH);
1765
1767
  ctx.save();
1766
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1768
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1767
1769
  ctx.beginPath();
1768
1770
  ctx.rect(region.x, region.y, region.width, region.height);
1769
1771
  ctx.clip();
@@ -1798,7 +1800,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1798
1800
  emptyMask(width, height) {
1799
1801
  const m = this.emptyMaskCache;
1800
1802
  if (m && m.width === width && m.height === height) return m;
1801
- this.emptyMaskCache = _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, Math.max(1, width), Math.max(1, height));
1803
+ this.emptyMaskCache = _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, Math.max(1, width), Math.max(1, height));
1802
1804
  return this.emptyMaskCache;
1803
1805
  }
1804
1806
  __init24() {this.overlayCache = /* @__PURE__ */ new WeakMap()}
@@ -2063,7 +2065,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2063
2065
  ctx.strokeStyle = "#3b82f6";
2064
2066
  ctx.lineWidth = 1.5;
2065
2067
  ctx.setLineDash([4, 4]);
2066
- const bounds = _chunkX2KQQZBTcjs.getAnnotationBounds.call(void 0, ann);
2068
+ const bounds = _chunkJYV4R62Mcjs.getAnnotationBounds.call(void 0, ann);
2067
2069
  const pad = 4;
2068
2070
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
2069
2071
  ctx.fillStyle = "#ffffff";
@@ -2084,7 +2086,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2084
2086
  }
2085
2087
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
2086
2088
  getAnnotationBounds(ann) {
2087
- return _chunkX2KQQZBTcjs.getAnnotationBounds.call(void 0, ann);
2089
+ return _chunkJYV4R62Mcjs.getAnnotationBounds.call(void 0, ann);
2088
2090
  }
2089
2091
  /**
2090
2092
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -2158,8 +2160,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2158
2160
  }
2159
2161
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
2160
2162
  const { crop, transform, annotations } = state;
2161
- const region = crop ? _chunkX2KQQZBTcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2162
- const rotated = _chunkX2KQQZBTcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2163
+ const region = crop ? _chunkJYV4R62Mcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2164
+ const rotated = _chunkJYV4R62Mcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2163
2165
  const baseW = Math.max(1, Math.round(rotated.width));
2164
2166
  const baseH = Math.max(1, Math.round(rotated.height));
2165
2167
  const exportW = options.width || baseW;
@@ -2188,7 +2190,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2188
2190
  const bctx = baseCanvas.getContext("2d");
2189
2191
  if (bctx) {
2190
2192
  bctx.save();
2191
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2193
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2192
2194
  bctx.beginPath();
2193
2195
  bctx.rect(region.x, region.y, region.width, region.height);
2194
2196
  bctx.clip();
@@ -2201,7 +2203,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2201
2203
  if (options.includeAnnotations !== false && overlay.length > 0) {
2202
2204
  ctx.save();
2203
2205
  ctx.scale(exportW / baseW, exportH / baseH);
2204
- _chunkX2KQQZBTcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2206
+ _chunkJYV4R62Mcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2205
2207
  for (const ann of overlay) {
2206
2208
  await this.drawAnnotation(ctx, ann);
2207
2209
  }
@@ -2291,7 +2293,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2291
2293
  case "rect":
2292
2294
  case "image":
2293
2295
  case "text": {
2294
- const b = _chunkX2KQQZBTcjs.getAnnotationBounds.call(void 0, ann);
2296
+ const b = _chunkJYV4R62Mcjs.getAnnotationBounds.call(void 0, ann);
2295
2297
  ctx.fillRect(b.x, b.y, b.width, b.height);
2296
2298
  break;
2297
2299
  }
@@ -2311,7 +2313,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2311
2313
  function getBaseProjection(region, transform, baseW, baseH) {
2312
2314
  return {
2313
2315
  region,
2314
- angle: _chunkX2KQQZBTcjs.normalizeAngle.call(void 0, transform.rotate),
2316
+ angle: _chunkJYV4R62Mcjs.normalizeAngle.call(void 0, transform.rotate),
2315
2317
  flipH: transform.flipH,
2316
2318
  flipV: transform.flipV,
2317
2319
  scale: 1,
@@ -2698,7 +2700,7 @@ var TextEditSession = (_class5 = class {
2698
2700
  overlay() {
2699
2701
  const layer = this.layer;
2700
2702
  const layout = this.layout();
2701
- const m = _chunkX2KQQZBTcjs.textMatrix.call(void 0, layer);
2703
+ const m = _chunkJYV4R62Mcjs.textMatrix.call(void 0, layer);
2702
2704
  const at = (x, y) => _chunkEGZM52EOcjs.applyMatrix.call(void 0, m, { x, y });
2703
2705
  let frame = null;
2704
2706
  if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
@@ -2734,7 +2736,7 @@ var TextEditSession = (_class5 = class {
2734
2736
  }
2735
2737
  if (this.layer.name === "Text" && this.changed) {
2736
2738
  try {
2737
- this.controller.setLayerProperties(this.layerId, { name: _chunkX2KQQZBTcjs.typeLayerName.call(void 0, this.text) }, false);
2739
+ this.controller.setLayerProperties(this.layerId, { name: _chunkJYV4R62Mcjs.typeLayerName.call(void 0, this.text) }, false);
2738
2740
  } catch (e17) {
2739
2741
  }
2740
2742
  }
@@ -2745,7 +2747,7 @@ function typeLayerAt(controller, p, slop = 4) {
2745
2747
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
2746
2748
  for (const l of layers) {
2747
2749
  if (!l.visible) continue;
2748
- const inv = invert(_chunkX2KQQZBTcjs.textMatrix.call(void 0, l));
2750
+ const inv = invert(_chunkJYV4R62Mcjs.textMatrix.call(void 0, l));
2749
2751
  const q = _chunkEGZM52EOcjs.applyMatrix.call(void 0, inv, p);
2750
2752
  let b = null;
2751
2753
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
@@ -2835,8 +2837,33 @@ var TypeToolGesture = (_class6 = class {
2835
2837
 
2836
2838
  // src/image-editor/selection/shapes.ts
2837
2839
  function polygonCoverage(points, width, height, antiAlias = true) {
2840
+ const { box, coverage } = polygonCoverageBox(points, width, height, antiAlias);
2841
+ if (!box || box.width === width && box.height === height) return box ? coverage : new Float32Array(width * height);
2838
2842
  const m = new Float32Array(width * height);
2839
- if (points.length < 3 || width <= 0 || height <= 0) return m;
2843
+ for (let y = 0; y < box.height; y++) m.set(coverage.subarray(y * box.width, (y + 1) * box.width), (box.y + y) * width + box.x);
2844
+ return m;
2845
+ }
2846
+ function polygonCoverageBox(points, width, height, antiAlias = true) {
2847
+ const none = { box: null, coverage: new Float32Array(0) };
2848
+ if (points.length < 3 || width <= 0 || height <= 0) return none;
2849
+ let minX = Infinity;
2850
+ let minY = Infinity;
2851
+ let maxX = -Infinity;
2852
+ let maxY = -Infinity;
2853
+ for (const p of points) {
2854
+ if (!Number.isFinite(p.x) || !Number.isFinite(p.y)) continue;
2855
+ minX = Math.min(minX, p.x);
2856
+ minY = Math.min(minY, p.y);
2857
+ maxX = Math.max(maxX, p.x);
2858
+ maxY = Math.max(maxY, p.y);
2859
+ }
2860
+ const bx0 = Math.max(0, Math.floor(minX));
2861
+ const by0 = Math.max(0, Math.floor(minY));
2862
+ const bx1 = Math.min(width, Math.ceil(maxX));
2863
+ const by1 = Math.min(height, Math.ceil(maxY));
2864
+ if (!(bx1 > bx0 && by1 > by0)) return none;
2865
+ const bw = bx1 - bx0;
2866
+ const m = new Float32Array(bw * (by1 - by0));
2840
2867
  const sub2 = antiAlias ? 4 : 1;
2841
2868
  const edges = [];
2842
2869
  for (let i = 0; i < points.length; i++) {
@@ -2850,8 +2877,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2850
2877
  let next = 0;
2851
2878
  let active = [];
2852
2879
  const xs = [];
2853
- for (let py = 0; py < height; py++) {
2854
- const row = py * width;
2880
+ for (let py = by0; py < by1; py++) {
2881
+ const row = (py - by0) * bw - bx0;
2855
2882
  for (let s = 0; s < sub2; s++) {
2856
2883
  const y = py + (s + 0.5) / sub2;
2857
2884
  while (next < edges.length && edges[next].top <= y) active.push(edges[next++]);
@@ -2881,15 +2908,14 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2881
2908
  }
2882
2909
  }
2883
2910
  for (let i = 0; i < m.length; i++) if (m[i] > 1) m[i] = 1;
2884
- return m;
2885
- }
2886
- function toMask(width, height, coverage) {
2887
- const out = new Uint8Array(coverage.length);
2888
- for (let i = 0; i < out.length; i++) out[i] = _chunkX2KQQZBTcjs.coverageToByte.call(void 0, coverage[i]);
2889
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height, out);
2911
+ return { box: { x: bx0, y: by0, width: bw, height: by1 - by0 }, coverage: m };
2890
2912
  }
2891
2913
  function polygonSelection(width, height, points, options = {}) {
2892
- return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
2914
+ const { box, coverage } = polygonCoverageBox(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true)));
2915
+ if (!box) return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, width, height);
2916
+ const out = new Uint8Array(coverage.length);
2917
+ for (let i = 0; i < out.length; i++) out[i] = _chunkJYV4R62Mcjs.coverageToByte.call(void 0, coverage[i]);
2918
+ return _chunkJYV4R62Mcjs.selectionFromRegion.call(void 0, width, height, box, out);
2893
2919
  }
2894
2920
  function normalizeRect(rect) {
2895
2921
  const x = rect.width < 0 ? rect.x + rect.width : rect.x;
@@ -3013,7 +3039,7 @@ function magicWand(pixels, seed, options = {}) {
3013
3039
  const { width: w, height: h } = pixels;
3014
3040
  const sx = Math.floor(seed.x);
3015
3041
  const sy = Math.floor(seed.y);
3016
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, w, h);
3042
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, w, h);
3017
3043
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
3018
3044
  const marks = new Uint8Array(n);
3019
3045
  let bx0 = w;
@@ -3061,9 +3087,9 @@ function magicWand(pixels, seed, options = {}) {
3061
3087
  }
3062
3088
  }
3063
3089
  }
3064
- if (bx1 < 0) return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, w, h);
3065
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, w, h, marks);
3066
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0,
3090
+ if (bx1 < 0) return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, w, h);
3091
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, w, h, marks);
3092
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0,
3067
3093
  w,
3068
3094
  h,
3069
3095
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -3085,7 +3111,7 @@ function colorRange(pixels, samples, options = {}) {
3085
3111
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
3086
3112
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
3087
3113
  const out = new Uint8Array(n);
3088
- if (!parsed.length) return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, w, h, out);
3114
+ if (!parsed.length) return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, w, h, out);
3089
3115
  for (let i = 0; i < n; i++) {
3090
3116
  const p = i * 4;
3091
3117
  if (data[p + 3] <= 0) continue;
@@ -3101,9 +3127,9 @@ function colorRange(pixels, samples, options = {}) {
3101
3127
  }
3102
3128
  if (k > best) best = k;
3103
3129
  }
3104
- out[i] = _chunkX2KQQZBTcjs.coverageToByte.call(void 0, best);
3130
+ out[i] = _chunkJYV4R62Mcjs.coverageToByte.call(void 0, best);
3105
3131
  }
3106
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, w, h, out);
3132
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, w, h, out);
3107
3133
  }
3108
3134
  var TONE_RANGE_PRESETS = {
3109
3135
  shadows: [0, 65],
@@ -3121,9 +3147,9 @@ function toneRange(pixels, range, falloff = 20) {
3121
3147
  if (d[p + 3] <= 0) continue;
3122
3148
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
3123
3149
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
3124
- out[i] = _chunkX2KQQZBTcjs.coverageToByte.call(void 0, 1 - outside / ramp2);
3150
+ out[i] = _chunkJYV4R62Mcjs.coverageToByte.call(void 0, 1 - outside / ramp2);
3125
3151
  }
3126
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3152
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3127
3153
  }
3128
3154
  function hueRange(pixels, center) {
3129
3155
  const n = checkPixels(pixels);
@@ -3146,9 +3172,9 @@ function hueRange(pixels, center) {
3146
3172
  hue *= 60;
3147
3173
  let dh = ((hue - center) % 360 + 360) % 360;
3148
3174
  dh = Math.min(dh, 360 - dh);
3149
- out[i] = _chunkX2KQQZBTcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
3175
+ out[i] = _chunkJYV4R62Mcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
3150
3176
  }
3151
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3177
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3152
3178
  }
3153
3179
  var HUE_RANGE_PRESETS = { reds: 0, yellows: 60, greens: 120, cyans: 180, blues: 240, magentas: 300 };
3154
3180
  var COLOR_RANGE_PRESETS = [
@@ -3183,9 +3209,9 @@ function skinToneRange(pixels) {
3183
3209
  hue *= 60;
3184
3210
  if (hue > 180) hue -= 360;
3185
3211
  const k = ramp(hue, 5, 40, 20) * ramp(chroma / mx, 0.12, 0.8, 0.1) * ramp(mx, 0.3, 1, 0.15);
3186
- out[i] = _chunkX2KQQZBTcjs.coverageToByte.call(void 0, k);
3212
+ out[i] = _chunkJYV4R62Mcjs.coverageToByte.call(void 0, k);
3187
3213
  }
3188
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3214
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3189
3215
  }
3190
3216
  function colorRangePreset(pixels, preset, options = {}) {
3191
3217
  if (preset === "skinTones") return skinToneRange(pixels);
@@ -3246,14 +3272,14 @@ function growSelection(pixels, sel, options = {}) {
3246
3272
  if (y > 0) visit(i - w);
3247
3273
  if (y < h - 1) visit(i + w);
3248
3274
  }
3249
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, w, h, out);
3275
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, w, h, out);
3250
3276
  }
3251
3277
  function selectSimilar(pixels, sel, options = {}) {
3252
3278
  const n = checkPixels(pixels);
3253
3279
  const match = matcher(pixels, sel, options);
3254
3280
  const out = new Uint8Array(sel.data);
3255
3281
  for (let i = 0; i < n; i++) if (match(i)) out[i] = 255;
3256
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3282
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3257
3283
  }
3258
3284
 
3259
3285
  // src/image-editor/selection/segmentation.ts
@@ -3267,12 +3293,12 @@ function segmentationOutlines(result) {
3267
3293
  function segmentToSelection(width, height, result) {
3268
3294
  let out = null;
3269
3295
  for (const ring of segmentationOutlines(result)) {
3270
- out = _chunkX2KQQZBTcjs.combineSelections.call(void 0, out, polygonSelection(width, height, ring), "add");
3296
+ out = _chunkJYV4R62Mcjs.combineSelections.call(void 0, out, polygonSelection(width, height, ring), "add");
3271
3297
  }
3272
3298
  if (result.mask && result.mask.width > 0 && result.mask.height > 0) {
3273
- const raw = _chunkX2KQQZBTcjs.selectionFromPixels.call(void 0, result.mask, { channel: "luminance" });
3274
- const sized = raw.width === width && raw.height === height ? raw : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, raw, width, height);
3275
- out = _chunkX2KQQZBTcjs.combineSelections.call(void 0, out, sized, "add");
3299
+ const raw = _chunkJYV4R62Mcjs.selectionFromPixels.call(void 0, result.mask, { channel: "luminance" });
3300
+ const sized = raw.width === width && raw.height === height ? raw : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, raw, width, height);
3301
+ out = _chunkJYV4R62Mcjs.combineSelections.call(void 0, out, sized, "add");
3276
3302
  }
3277
3303
  return _optionalChain([out, 'optionalAccess', _76 => _76.bounds]) ? out : null;
3278
3304
  }
@@ -3280,7 +3306,7 @@ function segmentsToSelection(width, height, results) {
3280
3306
  let out = null;
3281
3307
  for (const r of results) {
3282
3308
  const sel = segmentToSelection(width, height, r);
3283
- if (sel) out = _chunkX2KQQZBTcjs.combineSelections.call(void 0, out, sel, "add");
3309
+ if (sel) out = _chunkJYV4R62Mcjs.combineSelections.call(void 0, out, sel, "add");
3284
3310
  }
3285
3311
  return out;
3286
3312
  }
@@ -3416,9 +3442,9 @@ function edgeWidth(guide, w, h, r) {
3416
3442
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
3417
3443
  }
3418
3444
  }
3419
- const gm = _chunkX2KQQZBTcjs.greyMorphology.call(void 0, g, w, h, r, true);
3420
- const hi = _chunkX2KQQZBTcjs.greyMorphology.call(void 0, y, w, h, r, true);
3421
- const lo = _chunkX2KQQZBTcjs.greyMorphology.call(void 0, y, w, h, r, false);
3445
+ const gm = _chunkJYV4R62Mcjs.greyMorphology.call(void 0, g, w, h, r, true);
3446
+ const hi = _chunkJYV4R62Mcjs.greyMorphology.call(void 0, y, w, h, r, true);
3447
+ const lo = _chunkJYV4R62Mcjs.greyMorphology.call(void 0, y, w, h, r, false);
3422
3448
  const out = new Float32Array(n);
3423
3449
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
3424
3450
  return out;
@@ -3442,7 +3468,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
3442
3468
  }
3443
3469
  }
3444
3470
  if (any) {
3445
- const dist = _chunkX2KQQZBTcjs.distanceTransform.call(void 0, boundary, w, h);
3471
+ const dist = _chunkJYV4R62Mcjs.distanceTransform.call(void 0, boundary, w, h);
3446
3472
  const r = gfRadius(p);
3447
3473
  const q = guidedFilterColor(guide, m, w, h, r);
3448
3474
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -3468,7 +3494,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
3468
3494
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
3469
3495
  }
3470
3496
  const amount = shiftAmount(p);
3471
- if (Math.abs(amount) >= 1e-4) a = _chunkX2KQQZBTcjs.shiftCoverage.call(void 0, a, w, h, amount);
3497
+ if (Math.abs(amount) >= 1e-4) a = _chunkJYV4R62Mcjs.shiftCoverage.call(void 0, a, w, h, amount);
3472
3498
  return a;
3473
3499
  }
3474
3500
  function guidePlanes(pixels, win) {
@@ -3512,32 +3538,30 @@ function refineSelection(pixels, mask, params = {}) {
3512
3538
  const out = new Uint8Array(mask.width * mask.height);
3513
3539
  for (let y = 0; y < wh; y++) {
3514
3540
  const dst = (y0 + y) * mask.width + x0;
3515
- for (let x = 0; x < ww; x++) out[dst + x] = _chunkX2KQQZBTcjs.coverageToByte.call(void 0, refined[y * ww + x]);
3541
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkJYV4R62Mcjs.coverageToByte.call(void 0, refined[y * ww + x]);
3516
3542
  }
3517
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
3543
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
3518
3544
  }
3519
3545
 
3520
3546
  // src/image-editor/selection/stroke.ts
3521
3547
  function selectionRing(sel, width, location) {
3522
3548
  const half = location === "center" ? width / 2 : width;
3523
- const outer = location === "inside" ? sel : _chunkX2KQQZBTcjs.modifySelection.call(void 0, sel, "expand", half);
3524
- const inner = location === "outside" ? sel : _chunkX2KQQZBTcjs.modifySelection.call(void 0, sel, "contract", half);
3549
+ const outer = location === "inside" ? sel : _chunkJYV4R62Mcjs.modifySelection.call(void 0, sel, "expand", half);
3550
+ const inner = location === "outside" ? sel : _chunkJYV4R62Mcjs.modifySelection.call(void 0, sel, "contract", half);
3525
3551
  const out = new Uint8Array(sel.data.length);
3526
3552
  for (let i = 0; i < out.length; i++) out[i] = Math.max(0, outer.data[i] - inner.data[i]);
3527
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, sel.width, sel.height, out);
3553
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, sel.width, sel.height, out);
3528
3554
  }
3529
3555
 
3530
3556
  // src/image-editor/selection/channels.ts
3531
3557
  var DEFAULT_CHANNEL_COLOR = "#ff0000";
3532
3558
  function describeChannel(channel) {
3533
3559
  const { mask, ...rest } = channel;
3534
- let sum = 0;
3535
- for (let i = 0; i < mask.data.length; i++) sum += mask.data[i];
3536
- const percent = Math.round(sum / 255 / Math.max(1, mask.data.length) * 1e4) / 100;
3560
+ const percent = Math.round(_chunkJYV4R62Mcjs.selectionArea.call(void 0, mask) / Math.max(1, mask.width * mask.height) * 1e4) / 100;
3537
3561
  return { ...rest, bounds: mask.bounds, percent };
3538
3562
  }
3539
3563
  function serializeChannels(channels) {
3540
- return channels.map((c) => ({ ...c, mask: _chunkX2KQQZBTcjs.serializeSelection.call(void 0, c.mask) }));
3564
+ return channels.map((c) => ({ ...c, mask: _chunkJYV4R62Mcjs.serializeSelection.call(void 0, c.mask) }));
3541
3565
  }
3542
3566
  function deserializeChannels(value, size, problems = []) {
3543
3567
  if (!Array.isArray(value)) return [];
@@ -3545,7 +3569,7 @@ function deserializeChannels(value, size, problems = []) {
3545
3569
  for (const raw of value) {
3546
3570
  const v = raw;
3547
3571
  try {
3548
- const mask = _chunkX2KQQZBTcjs.deserializeSelection.call(void 0, v.mask);
3572
+ const mask = _chunkJYV4R62Mcjs.deserializeSelection.call(void 0, v.mask);
3549
3573
  if (mask.width !== size.width || mask.height !== size.height) throw new Error("the channel is a different size from the canvas");
3550
3574
  out.push({
3551
3575
  id: typeof v.id === "string" && v.id ? v.id : `ch_${out.length + 1}`,
@@ -3591,13 +3615,13 @@ function withBackgroundOpacity(d, values, below) {
3591
3615
  }
3592
3616
  function checkEffectTime(time) {
3593
3617
  if (time === void 0) return 0;
3594
- if (!(typeof time === "number" && Number.isFinite(time) && time >= 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("time must be a number of ms from 0.");
3618
+ if (!(typeof time === "number" && Number.isFinite(time) && time >= 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("time must be a number of ms from 0.");
3595
3619
  return time;
3596
3620
  }
3597
3621
  function checkEffectAnimation(animate) {
3598
3622
  const duration = _optionalChain([animate, 'optionalAccess', _78 => _78.duration]);
3599
- if (!(typeof duration === "number" && Number.isFinite(duration) && duration > 0 && duration <= _chunkX2KQQZBTcjs.MAX_EFFECT_ANIMATION_MS)) {
3600
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`animate.duration must be more than 0 and at most ${_chunkX2KQQZBTcjs.MAX_EFFECT_ANIMATION_MS} ms.`);
3623
+ if (!(typeof duration === "number" && Number.isFinite(duration) && duration > 0 && duration <= _chunkJYV4R62Mcjs.MAX_EFFECT_ANIMATION_MS)) {
3624
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`animate.duration must be more than 0 and at most ${_chunkJYV4R62Mcjs.MAX_EFFECT_ANIMATION_MS} ms.`);
3601
3625
  }
3602
3626
  return { duration: Math.round(duration) };
3603
3627
  }
@@ -3774,7 +3798,7 @@ var ImageEffectsEngine = (_class7 = class {
3774
3798
  // src/image-editor/free-transform.ts
3775
3799
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
3776
3800
  var fail = (message) => {
3777
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(message);
3801
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(message);
3778
3802
  };
3779
3803
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
3780
3804
  function previewStep(scale) {
@@ -3883,7 +3907,7 @@ var FreeTransformSession = (_class8 = class {
3883
3907
  } else {
3884
3908
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
3885
3909
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
3886
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, layers, id).layer;
3910
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, layers, id).layer;
3887
3911
  this.layerId = layer.id;
3888
3912
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
3889
3913
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -3894,20 +3918,20 @@ var FreeTransformSession = (_class8 = class {
3894
3918
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
3895
3919
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
3896
3920
  if (content !== "selection-copy") {
3897
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3898
- if (!maskAlone) _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3921
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3922
+ if (!maskAlone) _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3899
3923
  }
3900
3924
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3901
3925
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
3902
3926
  if (layer.type === "smart" && !maskAlone) {
3903
3927
  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).`);
3904
- if (!_chunkX2KQQZBTcjs.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.`);
3928
+ if (!_chunkJYV4R62Mcjs.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.`);
3905
3929
  this.smart = layer;
3906
3930
  this.smartObject = true;
3907
- this.startGeometry = _chunkX2KQQZBTcjs.placementGeometry.call(void 0, layer);
3931
+ this.startGeometry = _chunkJYV4R62Mcjs.placementGeometry.call(void 0, layer);
3908
3932
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
3909
3933
  this.startInterp = this.interp;
3910
- this.box = _chunkX2KQQZBTcjs.contentsBox.call(void 0, layer.contents);
3934
+ this.box = _chunkJYV4R62Mcjs.contentsBox.call(void 0, layer.contents);
3911
3935
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
3912
3936
  this.geometryValue = this.startGeometry;
3913
3937
  this.shown = this.startLayers;
@@ -3915,8 +3939,8 @@ var FreeTransformSession = (_class8 = class {
3915
3939
  }
3916
3940
  if (layer.type === "type" && !maskAlone) {
3917
3941
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3918
- const frame = _chunkX2KQQZBTcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3919
- const m = _chunkX2KQQZBTcjs.textMatrix.call(void 0, layer);
3942
+ const frame = _chunkJYV4R62Mcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3943
+ const m = _chunkJYV4R62Mcjs.textMatrix.call(void 0, layer);
3920
3944
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
3921
3945
  this.typeTarget = layer;
3922
3946
  this.typeLayer = true;
@@ -3935,7 +3959,7 @@ var FreeTransformSession = (_class8 = class {
3935
3959
  }
3936
3960
  if (layer.type === "shape" && !maskAlone) {
3937
3961
  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).`);
3938
- const g = _chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, layer);
3962
+ const g = _chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, layer);
3939
3963
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
3940
3964
  const w = Math.max(g.width, 1);
3941
3965
  const h = Math.max(g.height, 1);
@@ -3983,7 +4007,7 @@ var FreeTransformSession = (_class8 = class {
3983
4007
  if (box) {
3984
4008
  const copy = {
3985
4009
  type: "pixel",
3986
- id: _chunkX2KQQZBTcjs.newLayerId.call(void 0, ),
4010
+ id: _chunkJYV4R62Mcjs.newLayerId.call(void 0, ),
3987
4011
  name: `${layer.name || "Layer"} copy`,
3988
4012
  visible: true,
3989
4013
  opacity: 1,
@@ -4007,7 +4031,7 @@ var FreeTransformSession = (_class8 = class {
4007
4031
  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).");
4008
4032
  this.box = box;
4009
4033
  this.moves = moves;
4010
- this.startGeometry = _chunkX2KQQZBTcjs.identityTransform.call(void 0, box);
4034
+ this.startGeometry = _chunkJYV4R62Mcjs.identityTransform.call(void 0, box);
4011
4035
  this.startInterp = this.interp;
4012
4036
  this.geometryValue = this.startGeometry;
4013
4037
  this.shown = this.startLayers;
@@ -4085,8 +4109,8 @@ var FreeTransformSession = (_class8 = class {
4085
4109
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
4086
4110
  };
4087
4111
  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.");
4088
- if (!_chunkX2KQQZBTcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
4089
- if (this.typeTarget && (_chunkX2KQQZBTcjs.hasWarp.call(void 0, next) || !_chunkX2KQQZBTcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
4112
+ if (!_chunkJYV4R62Mcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
4113
+ if (this.typeTarget && (_chunkJYV4R62Mcjs.hasWarp.call(void 0, next) || !_chunkJYV4R62Mcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
4090
4114
  fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
4091
4115
  }
4092
4116
  this.geometryValue = next;
@@ -4098,10 +4122,10 @@ var FreeTransformSession = (_class8 = class {
4098
4122
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
4099
4123
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
4100
4124
  const g = this.geometryValue;
4101
- const identity = _chunkX2KQQZBTcjs.isIdentityTransform.call(void 0, g);
4102
- const warp = _chunkX2KQQZBTcjs.hasWarp.call(void 0, g);
4103
- const h = warp ? null : _chunkX2KQQZBTcjs.geometryHomography.call(void 0, g);
4104
- const f = warp ? _chunkX2KQQZBTcjs.transformMap.call(void 0, g) : null;
4125
+ const identity = _chunkJYV4R62Mcjs.isIdentityTransform.call(void 0, g);
4126
+ const warp = _chunkJYV4R62Mcjs.hasWarp.call(void 0, g);
4127
+ const h = warp ? null : _chunkJYV4R62Mcjs.geometryHomography.call(void 0, g);
4128
+ const f = warp ? _chunkJYV4R62Mcjs.transformMap.call(void 0, g) : null;
4105
4129
  const step = final ? 1 : previewStep(preview.scale);
4106
4130
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
4107
4131
  let layers = this.startLayers;
@@ -4144,8 +4168,7 @@ var FreeTransformSession = (_class8 = class {
4144
4168
  const result = part.base ? _chunkHGTDMKNEcjs.compositeSurfaceOver.call(void 0, part.base, moved) : moved;
4145
4169
  if (part.what === "selection") {
4146
4170
  const { width, height } = this.host.canvas();
4147
- const data = new Uint8Array(_chunkCWM3CUUXcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
4148
- const next = _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height, data);
4171
+ const next = _chunkJYV4R62Mcjs.selectionFromTiles.call(void 0, width, height, result);
4149
4172
  selection = next.bounds ? next : null;
4150
4173
  } else if (part.what === "pixels") {
4151
4174
  layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -4167,14 +4190,14 @@ var FreeTransformSession = (_class8 = class {
4167
4190
  resampleShape(final, preview, warpMap, h) {
4168
4191
  const layer = this.shape;
4169
4192
  let components = layer.components;
4170
- if (!_chunkX2KQQZBTcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
4193
+ if (!_chunkJYV4R62Mcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
4171
4194
  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;
4172
4195
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p) : p)));
4173
- components = _chunkX2KQQZBTcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
4196
+ components = _chunkJYV4R62Mcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
4174
4197
  }
4175
4198
  const moved = { ...layer, components };
4176
4199
  delete moved.annotation;
4177
- const surface = _chunkX2KQQZBTcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
4200
+ const surface = _chunkJYV4R62Mcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
4178
4201
  return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
4179
4202
  }
4180
4203
  /**
@@ -4184,13 +4207,13 @@ var FreeTransformSession = (_class8 = class {
4184
4207
  resampleType() {
4185
4208
  const layer = this.typeTarget;
4186
4209
  const g = this.geometryValue;
4187
- if (_chunkX2KQQZBTcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
4188
- const m = _chunkX2KQQZBTcjs.matrixFromCorners.call(void 0, g.box, g.corners);
4210
+ if (_chunkJYV4R62Mcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
4211
+ const m = _chunkJYV4R62Mcjs.matrixFromCorners.call(void 0, g.box, g.corners);
4189
4212
  if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
4190
4213
  const next = { ...layer, transform: m };
4191
4214
  delete next.annotation;
4192
- let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkX2KQQZBTcjs.rerenderText.call(void 0, next, this.host.textEnv()));
4193
- const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkEGZM52EOcjs.invertMatrix.call(void 0, _chunkX2KQQZBTcjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
4215
+ let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkJYV4R62Mcjs.rerenderText.call(void 0, next, this.host.textEnv()));
4216
+ const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkEGZM52EOcjs.invertMatrix.call(void 0, _chunkJYV4R62Mcjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
4194
4217
  for (const part of this.parts) {
4195
4218
  if (part.what !== "mask") continue;
4196
4219
  const surface = _chunkHGTDMKNEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -4206,12 +4229,12 @@ var FreeTransformSession = (_class8 = class {
4206
4229
  const canvas = this.host.canvas();
4207
4230
  try {
4208
4231
  if (final) {
4209
- const res = _chunkX2KQQZBTcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
4232
+ const res = _chunkJYV4R62Mcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
4210
4233
  this.smartMasksMoved = res.masksMoved;
4211
4234
  return res.layers;
4212
4235
  }
4213
4236
  const step = previewStep(preview.scale);
4214
- const surface = _chunkX2KQQZBTcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
4237
+ const surface = _chunkJYV4R62Mcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
4215
4238
  return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
4216
4239
  } catch (e) {
4217
4240
  if (e instanceof _chunkHGTDMKNEcjs.TransformTooLargeError) fail(e.message);
@@ -4221,10 +4244,10 @@ var FreeTransformSession = (_class8 = class {
4221
4244
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
4222
4245
  isChanged() {
4223
4246
  const g = this.geometryValue;
4224
- if (!this.smart && !this.typeTarget) return !_chunkX2KQQZBTcjs.isIdentityTransform.call(void 0, g);
4247
+ if (!this.smart && !this.typeTarget) return !_chunkJYV4R62Mcjs.isIdentityTransform.call(void 0, g);
4225
4248
  const a = this.startGeometry;
4226
4249
  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);
4227
- const warp = (w, box) => w && _chunkX2KQQZBTcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
4250
+ const warp = (w, box) => w && _chunkJYV4R62Mcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
4228
4251
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
4229
4252
  }
4230
4253
  render(preview) {
@@ -4484,7 +4507,7 @@ function convertSurfaceColors(surface, t) {
4484
4507
  }
4485
4508
 
4486
4509
  // src/image-editor/controller.ts
4487
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION;
4510
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION;
4488
4511
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
4489
4512
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
4490
4513
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -4680,7 +4703,7 @@ var PaintStrokeSession = (_class9 = class {
4680
4703
  for (const t of _chunkCWM3CUUXcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
4681
4704
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, t.tx, t.ty);
4682
4705
  const cur = regions.get(key);
4683
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkX2KQQZBTcjs.unionRect.call(void 0, cur.r, r) : r });
4706
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkJYV4R62Mcjs.unionRect.call(void 0, cur.r, r) : r });
4684
4707
  }
4685
4708
  }
4686
4709
  for (const [key, { tx, ty, r }] of regions) {
@@ -4712,7 +4735,7 @@ var PaintStrokeSession = (_class9 = class {
4712
4735
  }
4713
4736
  /** Finishes the stroke (one undo step) and returns what changed. */
4714
4737
  end() {
4715
- if (this.closed) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("This stroke has already ended.");
4738
+ if (this.closed) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("This stroke has already ended.");
4716
4739
  const last = _nullishCoalesce(this.last, () => ( void 0));
4717
4740
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
4718
4741
  _optionalChain([this, 'access', _133 => _133.flushView, 'optionalCall', _134 => _134()]);
@@ -4848,20 +4871,20 @@ function sameTile(a, b) {
4848
4871
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
4849
4872
  return true;
4850
4873
  }
4851
- var DEFAULT_ADJUSTMENTS = _chunkX2KQQZBTcjs.DEFAULT_ADJUSTMENTS_VALUES;
4874
+ var DEFAULT_ADJUSTMENTS = _chunkJYV4R62Mcjs.DEFAULT_ADJUSTMENTS_VALUES;
4852
4875
  function normalizeStoredAdjustments(stored) {
4853
4876
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
4854
4877
  const out = {
4855
4878
  ...DEFAULT_ADJUSTMENTS,
4856
4879
  ...stored,
4857
- process: _chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, stored.process)
4880
+ process: _chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, stored.process)
4858
4881
  };
4859
- const layers = _chunkX2KQQZBTcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4882
+ const layers = _chunkJYV4R62Mcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4860
4883
  if (layers.length) out.layers = layers;
4861
4884
  else delete out.layers;
4862
4885
  return out;
4863
4886
  }
4864
- var isLayered = (data) => Boolean(data && data.version === _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4887
+ var isLayered = (data) => Boolean(data && data.version === _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4865
4888
  function migrateSerializedImageEditorState(data) {
4866
4889
  if (isLayered(data)) {
4867
4890
  const out = {
@@ -4893,10 +4916,10 @@ function migrateSerializedImageEditorState(data) {
4893
4916
  function migrateToLayeredState(data, size) {
4894
4917
  const clean = migrateSerializedImageEditorState(data);
4895
4918
  if (isLayered(clean)) return clean;
4896
- const stack = _chunkX2KQQZBTcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4897
- const { layers, assets } = _chunkX2KQQZBTcjs.serializeLayers.call(void 0, stack.layers);
4919
+ const stack = _chunkJYV4R62Mcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4920
+ const { layers, assets } = _chunkJYV4R62Mcjs.serializeLayers.call(void 0, stack.layers);
4898
4921
  const out = {
4899
- version: _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION,
4922
+ version: _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION,
4900
4923
  width: Math.round(size.width),
4901
4924
  height: Math.round(size.height),
4902
4925
  layers,
@@ -4910,8 +4933,8 @@ function migrateToLayeredState(data, size) {
4910
4933
  if (clean.selection) out.selection = clean.selection;
4911
4934
  return out;
4912
4935
  }
4913
- var DEFAULT_TRANSFORM = _chunkX2KQQZBTcjs.DEFAULT_TRANSFORM_VALUES;
4914
- var DEFAULT_DEPTH_MASK = _chunkX2KQQZBTcjs.DEFAULT_DEPTH_MASK_VALUES;
4936
+ var DEFAULT_TRANSFORM = _chunkJYV4R62Mcjs.DEFAULT_TRANSFORM_VALUES;
4937
+ var DEFAULT_DEPTH_MASK = _chunkJYV4R62Mcjs.DEFAULT_DEPTH_MASK_VALUES;
4915
4938
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
4916
4939
  var ImageEditorController = (_class10 = class {
4917
4940
 
@@ -4934,7 +4957,7 @@ var ImageEditorController = (_class10 = class {
4934
4957
  __init73() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
4935
4958
  __init74() {this.viewKey = []}
4936
4959
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
4937
- __init75() {this.compositor = new (0, _chunkX2KQQZBTcjs.LayerCompositor)()}
4960
+ __init75() {this.compositor = new (0, _chunkJYV4R62Mcjs.LayerCompositor)()}
4938
4961
  /** The segmentation provider behind `selectSubject` (see `setSegmentationProvider`). */
4939
4962
  __init76() {this.segmentation = null}
4940
4963
  /** The effects provider slot (see `setEffectsProvider`). */
@@ -4995,7 +5018,7 @@ var ImageEditorController = (_class10 = class {
4995
5018
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
4996
5019
  if (_optionalChain([options, 'access', _150 => _150.initialState, 'optionalAccess', _151 => _151.selection])) {
4997
5020
  try {
4998
- this.state.selection = normalizeSelection(_chunkX2KQQZBTcjs.deserializeSelection.call(void 0, options.initialState.selection));
5021
+ this.state.selection = normalizeSelection(_chunkJYV4R62Mcjs.deserializeSelection.call(void 0, options.initialState.selection));
4999
5022
  } catch (e19) {
5000
5023
  }
5001
5024
  }
@@ -5112,10 +5135,10 @@ var ImageEditorController = (_class10 = class {
5112
5135
  if (l.type === "group") {
5113
5136
  const children = walk(l.children);
5114
5137
  if (children !== l.children) next2 = { ...l, children };
5115
- } else if (l.type === "smart" && _optionalChain([l, 'access', _156 => _156.smartFilters, 'optionalAccess', _157 => _157.filters, 'access', _158 => _158.some, 'call', _159 => _159((f) => f.kind === "effect")]) && (all || _chunkX2KQQZBTcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
5138
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _156 => _156.smartFilters, 'optionalAccess', _157 => _157.filters, 'access', _158 => _158.some, 'call', _159 => _159((f) => f.kind === "effect")]) && (all || _chunkJYV4R62Mcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
5116
5139
  try {
5117
- const r = _chunkX2KQQZBTcjs.rerender.call(void 0, l, canvas);
5118
- if (all || !_chunkX2KQQZBTcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
5140
+ const r = _chunkJYV4R62Mcjs.rerender.call(void 0, l, canvas);
5141
+ if (all || !_chunkJYV4R62Mcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
5119
5142
  } catch (e21) {
5120
5143
  }
5121
5144
  }
@@ -5181,19 +5204,19 @@ var ImageEditorController = (_class10 = class {
5181
5204
  const d = await this.describeEffect(effect, "filter");
5182
5205
  const values = _chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, d, options.values);
5183
5206
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
5184
- if (!found) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
5207
+ if (!found) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
5185
5208
  let layers = this.state.layers;
5186
5209
  let id = layerId;
5187
5210
  let converted = false;
5188
5211
  if (found.layer.type !== "smart") {
5189
- if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
5190
- const res2 = _chunkX2KQQZBTcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
5212
+ if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
5213
+ const res2 = _chunkJYV4R62Mcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
5191
5214
  layers = res2.layers;
5192
5215
  id = res2.layer.id;
5193
5216
  converted = true;
5194
5217
  }
5195
- const filter = _chunkX2KQQZBTcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
5196
- const res = _chunkX2KQQZBTcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
5218
+ const filter = _chunkJYV4R62Mcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
5219
+ const res = _chunkJYV4R62Mcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
5197
5220
  const masked = this.asOneStep(() => {
5198
5221
  this.commitLayers(res.layers);
5199
5222
  return this.maskFiltersWithSelection(id, options.useSelection);
@@ -5207,9 +5230,9 @@ var ImageEditorController = (_class10 = class {
5207
5230
  * false, during a drag).
5208
5231
  */
5209
5232
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
5210
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
5233
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
5211
5234
  const was = _optionalChain([layer, 'access', _160 => _160.smartFilters, 'optionalAccess', _161 => _161.filters, 'access', _162 => _162.find, 'call', _163 => _163((f) => f.id === filterId)]);
5212
- if (!was || was.kind !== "effect") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _164 => _164.smartFilters, 'optionalAccess', _165 => _165.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
5235
+ if (!was || was.kind !== "effect") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _164 => _164.smartFilters, 'optionalAccess', _165 => _165.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
5213
5236
  const update = {};
5214
5237
  if (changes.values) {
5215
5238
  const d = await this.describeEffect(was.effect);
@@ -5218,15 +5241,15 @@ var ImageEditorController = (_class10 = class {
5218
5241
  for (const [k, v] of Object.entries(changes.values)) {
5219
5242
  if (v !== null) given[k] = v;
5220
5243
  else if (k in d.controls.properties) base[k] = d.defaults[k];
5221
- else throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
5244
+ else throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
5222
5245
  }
5223
5246
  update.values = { ...base, ..._chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
5224
5247
  }
5225
5248
  for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
5226
- let res = _chunkX2KQQZBTcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
5227
- if (changes.index !== void 0) res = { ...res, layers: _chunkX2KQQZBTcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
5249
+ let res = _chunkJYV4R62Mcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
5250
+ if (changes.index !== void 0) res = { ...res, layers: _chunkJYV4R62Mcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
5228
5251
  this.commitLayers(res.layers, void 0, commitToHistory);
5229
- return _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
5252
+ return _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
5230
5253
  }
5231
5254
  /**
5232
5255
  * Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
@@ -5238,13 +5261,13 @@ var ImageEditorController = (_class10 = class {
5238
5261
  */
5239
5262
  async addEffectLayer(effect, options = {}) {
5240
5263
  const d = await this.describeEffect(effect, "layer");
5241
- const blend = _chunkX2KQQZBTcjs.parseBlend.call(void 0, options.blend);
5242
- if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("opacity must be from 0 to 1.");
5264
+ const blend = _chunkJYV4R62Mcjs.parseBlend.call(void 0, options.blend);
5265
+ if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("opacity must be from 0 to 1.");
5243
5266
  const time = checkEffectTime(options.time);
5244
5267
  const animate = options.animate === void 0 ? void 0 : checkEffectAnimation(options.animate);
5245
5268
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5246
- const id = options.id && !ids.has(options.id) ? options.id : _chunkX2KQQZBTcjs.newLayerId.call(void 0, );
5247
- const placed = _chunkX2KQQZBTcjs.placeLayer.call(void 0, this.state.layers, { type: "pixel", id, name: "", visible: true, opacity: 1, blend: "normal", surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }, this.newLayerPlacement(options));
5269
+ const id = options.id && !ids.has(options.id) ? options.id : _chunkJYV4R62Mcjs.newLayerId.call(void 0, );
5270
+ const placed = _chunkJYV4R62Mcjs.placeLayer.call(void 0, this.state.layers, { type: "pixel", id, name: "", visible: true, opacity: 1, blend: "normal", surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 4), offset: { x: 0, y: 0 } }, this.newLayerPlacement(options));
5248
5271
  const values = _chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, d, withBackgroundOpacity(d, options.values, hasLayersBelow(placed, id)));
5249
5272
  const { width, height } = this.naturalSize;
5250
5273
  const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time });
@@ -5277,8 +5300,8 @@ var ImageEditorController = (_class10 = class {
5277
5300
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
5278
5301
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
5279
5302
  const layer = _optionalChain([found, 'optionalAccess', _169 => _169.layer]);
5280
- if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
5281
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
5303
+ if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
5304
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
5282
5305
  const g = layer.generator;
5283
5306
  const swap = changes.effect !== void 0 && changes.effect !== g.effect;
5284
5307
  const d = swap ? await this.describeEffect(changes.effect, "layer") : await this.describeEffect(g.effect);
@@ -5287,7 +5310,7 @@ var ImageEditorController = (_class10 = class {
5287
5310
  for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
5288
5311
  if (v !== null) given[k] = v;
5289
5312
  else if (k in d.controls.properties) base[k] = d.defaults[k];
5290
- else throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
5313
+ else throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
5291
5314
  }
5292
5315
  const values = { ...base, ..._chunkA3A5TI6Rcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
5293
5316
  const time = changes.time === void 0 ? _nullishCoalesce(g.time, () => ( 0)) : checkEffectTime(changes.time);
@@ -5315,7 +5338,7 @@ var ImageEditorController = (_class10 = class {
5315
5338
  * looping past its duration), every other layer as it is. Nothing in the document changes.
5316
5339
  */
5317
5340
  async renderAnimationFrame(time, options) {
5318
- if (!(Number.isFinite(time) && time >= 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("time must be a number of ms from 0.");
5341
+ if (!(Number.isFinite(time) && time >= 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("time must be a number of ms from 0.");
5319
5342
  const source = this.drawSource();
5320
5343
  if (!source) return this.renderer.createCanvas(1, 1);
5321
5344
  this.syncViews();
@@ -5334,7 +5357,7 @@ var ImageEditorController = (_class10 = class {
5334
5357
  /** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
5335
5358
  rasterizeEffectLayer(layerId) {
5336
5359
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
5337
- if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
5360
+ if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
5338
5361
  this.commitLayers(
5339
5362
  _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
5340
5363
  const { generator: _g, ...rest } = l;
@@ -5362,7 +5385,7 @@ var ImageEditorController = (_class10 = class {
5362
5385
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
5363
5386
  this.viewKey = key;
5364
5387
  const { width, height } = this.naturalSize;
5365
- const view = _chunkX2KQQZBTcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
5388
+ const view = _chunkJYV4R62Mcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
5366
5389
  s.adjustments = view.adjustments;
5367
5390
  s.depthMask = view.depthMask;
5368
5391
  s.annotations = view.annotations;
@@ -5471,14 +5494,18 @@ var ImageEditorController = (_class10 = class {
5471
5494
  this.trimHistoryBytes();
5472
5495
  }
5473
5496
  /**
5474
- * Bytes of pixel tiles held only by undo / redo steps (not by the current state). The oldest
5475
- * undo steps are dropped while it exceeds `maxHistoryBytes`.
5497
+ * Bytes of pixel, selection and channel tiles held only by undo / redo steps (not by the
5498
+ * current state). The oldest undo steps are dropped while it exceeds `maxHistoryBytes`.
5476
5499
  */
5477
5500
  get historyBytes() {
5478
5501
  const live = /* @__PURE__ */ new Set();
5479
5502
  collectStateTiles(this.state.layers, live);
5503
+ collectSelectionTiles(this.state.selection, this.state.channels, live);
5480
5504
  const held = /* @__PURE__ */ new Set();
5481
- for (const e of [...this.undoStack, ...this.redoStack]) collectStateTiles(e.layers, held);
5505
+ for (const e of [...this.undoStack, ...this.redoStack]) {
5506
+ collectStateTiles(e.layers, held);
5507
+ collectSelectionTiles(e.selection, e.channels, held);
5508
+ }
5482
5509
  let n = 0;
5483
5510
  for (const t of held) if (!live.has(t)) n += t.data.byteLength;
5484
5511
  return n;
@@ -5566,7 +5593,7 @@ var ImageEditorController = (_class10 = class {
5566
5593
  applyCropPreset(ratio) {
5567
5594
  this.recordHistory();
5568
5595
  const { width, height } = this.state.imageDimensions;
5569
- if (ratio && _chunkX2KQQZBTcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
5596
+ if (ratio && _chunkJYV4R62Mcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
5570
5597
  ratio = 1 / ratio;
5571
5598
  }
5572
5599
  if (!ratio) {
@@ -5648,7 +5675,7 @@ var ImageEditorController = (_class10 = class {
5648
5675
  */
5649
5676
  getLayerPixels(id) {
5650
5677
  const layer = this.getLayer(id);
5651
- if (!layer || !_chunkX2KQQZBTcjs.hasSurface.call(void 0, layer)) return null;
5678
+ if (!layer || !_chunkJYV4R62Mcjs.hasSurface.call(void 0, layer)) return null;
5652
5679
  const surface = this.surfaceOf(layer);
5653
5680
  const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, surface);
5654
5681
  if (!b) return null;
@@ -5661,7 +5688,7 @@ var ImageEditorController = (_class10 = class {
5661
5688
  */
5662
5689
  getLayerBounds(id) {
5663
5690
  const layer = this.getLayer(id);
5664
- if (!layer || !_chunkX2KQQZBTcjs.hasSurface.call(void 0, layer)) return null;
5691
+ if (!layer || !_chunkJYV4R62Mcjs.hasSurface.call(void 0, layer)) return null;
5665
5692
  const surface = this.surfaceOf(layer);
5666
5693
  let b = this.boundsCache.get(surface);
5667
5694
  if (b === void 0) {
@@ -5685,15 +5712,15 @@ var ImageEditorController = (_class10 = class {
5685
5712
  { x: b2.x + b2.width, y: b2.y + b2.height },
5686
5713
  { x: b2.x, y: b2.y + b2.height }
5687
5714
  ];
5688
- if (layer.type === "smart") return _chunkX2KQQZBTcjs.placementGeometry.call(void 0, layer).corners.map((p) => ({ x: p.x, y: p.y }));
5715
+ if (layer.type === "smart") return _chunkJYV4R62Mcjs.placementGeometry.call(void 0, layer).corners.map((p) => ({ x: p.x, y: p.y }));
5689
5716
  if (layer.type === "type") {
5690
- const f = _chunkX2KQQZBTcjs.typeFrame.call(void 0, layer, this.textEnv().shaper);
5691
- const m = _chunkX2KQQZBTcjs.textMatrix.call(void 0, layer);
5717
+ const f = _chunkJYV4R62Mcjs.typeFrame.call(void 0, layer, this.textEnv().shaper);
5718
+ const m = _chunkJYV4R62Mcjs.textMatrix.call(void 0, layer);
5692
5719
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
5693
5720
  return [at(f.x, f.y), at(f.x + f.width, f.y), at(f.x + f.width, f.y + f.height), at(f.x, f.y + f.height)];
5694
5721
  }
5695
5722
  if (layer.type === "shape") {
5696
- const g = _chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, layer);
5723
+ const g = _chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, layer);
5697
5724
  return g ? rect(g) : null;
5698
5725
  }
5699
5726
  const b = this.getLayerBounds(id);
@@ -5725,7 +5752,7 @@ var ImageEditorController = (_class10 = class {
5725
5752
  return null;
5726
5753
  }
5727
5754
  if (layer.type === "annotation") {
5728
- if (_chunkX2KQQZBTcjs.hitTestAnnotation.call(void 0, point, layer.annotation)) return layer.id;
5755
+ if (_chunkJYV4R62Mcjs.hitTestAnnotation.call(void 0, point, layer.annotation)) return layer.id;
5729
5756
  return null;
5730
5757
  }
5731
5758
  if (layer.type === "shape") {
@@ -5768,9 +5795,9 @@ var ImageEditorController = (_class10 = class {
5768
5795
  */
5769
5796
  getLayerDataURL(id) {
5770
5797
  const layer = this.getLayer(id);
5771
- if (!layer || !_chunkX2KQQZBTcjs.hasSurface.call(void 0, layer)) return null;
5798
+ if (!layer || !_chunkJYV4R62Mcjs.hasSurface.call(void 0, layer)) return null;
5772
5799
  const surface = this.surfaceOf(layer);
5773
- const enc = _chunkX2KQQZBTcjs.encodeSurface.call(void 0, surface);
5800
+ const enc = _chunkJYV4R62Mcjs.encodeSurface.call(void 0, surface);
5774
5801
  return enc ? enc.url : null;
5775
5802
  }
5776
5803
  /**
@@ -5890,7 +5917,7 @@ var ImageEditorController = (_class10 = class {
5890
5917
  _optionalChain([extra, 'optionalCall', _188 => _188()]);
5891
5918
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
5892
5919
  if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
5893
- this.state.activeLayerId = _chunkX2KQQZBTcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
5920
+ this.state.activeLayerId = _chunkJYV4R62Mcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
5894
5921
  this.state.activeTarget = "pixels";
5895
5922
  }
5896
5923
  this.notify();
@@ -5912,19 +5939,19 @@ var ImageEditorController = (_class10 = class {
5912
5939
  if (init.pixels) {
5913
5940
  const px2 = init.pixels;
5914
5941
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
5915
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
5942
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
5916
5943
  }
5917
5944
  surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, px2, 4);
5918
5945
  } else if (init.color !== void 0) {
5919
5946
  const c = parseColor(init.color);
5920
5947
  surface = _chunkCWM3CUUXcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkCWM3CUUXcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
5921
5948
  }
5922
- const blend = _chunkX2KQQZBTcjs.parseBlend.call(void 0, init.blend);
5923
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("opacity must be from 0 to 1.");
5949
+ const blend = _chunkJYV4R62Mcjs.parseBlend.call(void 0, init.blend);
5950
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("opacity must be from 0 to 1.");
5924
5951
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5925
5952
  const layer = {
5926
5953
  type: "pixel",
5927
- id: init.id && !ids.has(init.id) ? init.id : _chunkX2KQQZBTcjs.newLayerId.call(void 0, ),
5954
+ id: init.id && !ids.has(init.id) ? init.id : _chunkJYV4R62Mcjs.newLayerId.call(void 0, ),
5928
5955
  name: _optionalChain([init, 'access', _189 => _189.name, 'optionalAccess', _190 => _190.trim, 'call', _191 => _191()]) || this.nextLayerName(),
5929
5956
  visible: _nullishCoalesce(init.visible, () => ( true)),
5930
5957
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -5933,7 +5960,7 @@ var ImageEditorController = (_class10 = class {
5933
5960
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
5934
5961
  };
5935
5962
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
5936
- const next = _chunkX2KQQZBTcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
5963
+ const next = _chunkJYV4R62Mcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
5937
5964
  this.commitLayers(next, () => {
5938
5965
  this.state.activeLayerId = layer.id;
5939
5966
  this.state.activeTarget = "pixels";
@@ -5973,12 +6000,12 @@ var ImageEditorController = (_class10 = class {
5973
6000
  try {
5974
6001
  img = await this.renderer.imageCache.get(src);
5975
6002
  } catch (e26) {
5976
- throw new (0, _chunkX2KQQZBTcjs.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.");
6003
+ throw new (0, _chunkJYV4R62Mcjs.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.");
5977
6004
  }
5978
6005
  const w = img.naturalWidth || img.width;
5979
6006
  const h = img.naturalHeight || img.height;
5980
6007
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
5981
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
6008
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
5982
6009
  ctx.drawImage(img, 0, 0, w, h);
5983
6010
  const data = ctx.getImageData(0, 0, w, h);
5984
6011
  return { width: w, height: h, data: data.data };
@@ -5991,7 +6018,7 @@ var ImageEditorController = (_class10 = class {
5991
6018
  }
5992
6019
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
5993
6020
  duplicateLayer(id, name) {
5994
- const res = _chunkX2KQQZBTcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
6021
+ const res = _chunkJYV4R62Mcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
5995
6022
  this.commitLayers(res.layers, () => {
5996
6023
  this.state.activeLayerId = res.id;
5997
6024
  });
@@ -5999,16 +6026,16 @@ var ImageEditorController = (_class10 = class {
5999
6026
  }
6000
6027
  /** Deletes a layer (refused when locked), as one undo step. */
6001
6028
  removeLayer(id) {
6002
- const next = _chunkX2KQQZBTcjs.removeLayer.call(void 0, this.state.layers, id);
6029
+ const next = _chunkJYV4R62Mcjs.removeLayer.call(void 0, this.state.layers, id);
6003
6030
  this.commitLayers(next, () => {
6004
- if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkX2KQQZBTcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _193 => _193.id]) === this.state.selectedAnnotationId)) {
6031
+ if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkJYV4R62Mcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _193 => _193.id]) === this.state.selectedAnnotationId)) {
6005
6032
  this.state.selectedAnnotationId = null;
6006
6033
  }
6007
6034
  });
6008
6035
  }
6009
6036
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
6010
6037
  moveLayer(id, placement) {
6011
- const next = _chunkX2KQQZBTcjs.moveLayer.call(void 0, this.state.layers, id, placement);
6038
+ const next = _chunkJYV4R62Mcjs.moveLayer.call(void 0, this.state.layers, id, placement);
6012
6039
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
6013
6040
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _194 => _194.parent, 'optionalAccess', _195 => _195.id]), () => ( null)), index: loc.index };
6014
6041
  this.commitLayers(next);
@@ -6019,23 +6046,23 @@ var ImageEditorController = (_class10 = class {
6019
6046
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
6020
6047
  */
6021
6048
  setLayerProperties(id, props, commitToHistory = true) {
6022
- const next = _chunkX2KQQZBTcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
6049
+ const next = _chunkJYV4R62Mcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
6023
6050
  this.commitLayers(next, void 0, commitToHistory);
6024
6051
  return _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer;
6025
6052
  }
6026
6053
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
6027
6054
  addGroup(init = {}) {
6028
- const blend = init.blend === void 0 ? "pass-through" : _chunkX2KQQZBTcjs.parseBlend.call(void 0, init.blend, true);
6055
+ const blend = init.blend === void 0 ? "pass-through" : _chunkJYV4R62Mcjs.parseBlend.call(void 0, init.blend, true);
6029
6056
  const group = {
6030
6057
  type: "group",
6031
- id: _chunkX2KQQZBTcjs.newLayerId.call(void 0, "group"),
6058
+ id: _chunkJYV4R62Mcjs.newLayerId.call(void 0, "group"),
6032
6059
  name: _optionalChain([init, 'access', _198 => _198.name, 'optionalAccess', _199 => _199.trim, 'call', _200 => _200()]) || "Group",
6033
6060
  visible: true,
6034
6061
  opacity: 1,
6035
6062
  blend,
6036
6063
  children: []
6037
6064
  };
6038
- const next = _chunkX2KQQZBTcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
6065
+ const next = _chunkJYV4R62Mcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
6039
6066
  this.commitLayers(next, () => {
6040
6067
  this.state.activeLayerId = group.id;
6041
6068
  this.state.activeTarget = "pixels";
@@ -6044,7 +6071,7 @@ var ImageEditorController = (_class10 = class {
6044
6071
  }
6045
6072
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
6046
6073
  groupLayers(ids, name) {
6047
- const res = _chunkX2KQQZBTcjs.groupLayers.call(void 0, this.state.layers, ids, name);
6074
+ const res = _chunkJYV4R62Mcjs.groupLayers.call(void 0, this.state.layers, ids, name);
6048
6075
  this.commitLayers(res.layers, () => {
6049
6076
  this.state.activeLayerId = res.id;
6050
6077
  });
@@ -6052,7 +6079,7 @@ var ImageEditorController = (_class10 = class {
6052
6079
  }
6053
6080
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
6054
6081
  ungroupLayer(id) {
6055
- const res = _chunkX2KQQZBTcjs.ungroupLayer.call(void 0, this.state.layers, id);
6082
+ const res = _chunkJYV4R62Mcjs.ungroupLayer.call(void 0, this.state.layers, id);
6056
6083
  this.commitLayers(res.layers);
6057
6084
  return res.ids;
6058
6085
  }
@@ -6061,38 +6088,38 @@ var ImageEditorController = (_class10 = class {
6061
6088
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
6062
6089
  */
6063
6090
  offsetLayer(id, move, commitToHistory = true) {
6064
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6091
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6065
6092
  if (layer.type === "smart") {
6066
6093
  const tl = layer.placement.corners[0];
6067
6094
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
6068
6095
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
6069
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("x and y must be numbers.");
6070
- this.commitLayers(_chunkX2KQQZBTcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
6096
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("x and y must be numbers.");
6097
+ this.commitLayers(_chunkJYV4R62Mcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
6071
6098
  const moved = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id).layer;
6072
6099
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
6073
6100
  }
6074
6101
  if (layer.type === "shape") {
6075
- const g = _nullishCoalesce(_chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
6102
+ const g = _nullishCoalesce(_chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
6076
6103
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
6077
6104
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
6078
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("x and y must be numbers.");
6079
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "position", "move it");
6080
- let moved = _chunkX2KQQZBTcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
6105
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("x and y must be numbers.");
6106
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "position", "move it");
6107
+ let moved = _chunkJYV4R62Mcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
6081
6108
  const mask = layer.mask;
6082
6109
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
6083
6110
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
6084
- const b = _nullishCoalesce(_chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
6111
+ const b = _nullishCoalesce(_chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
6085
6112
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
6086
6113
  }
6087
6114
  if (layer.type === "type") {
6088
6115
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
6089
6116
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
6090
6117
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
6091
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("x and y must be numbers.");
6092
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "position", "move it");
6118
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("x and y must be numbers.");
6119
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "position", "move it");
6093
6120
  const mx = Math.round(dx);
6094
6121
  const my = Math.round(dy);
6095
- let moved = { ..._chunkX2KQQZBTcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
6122
+ let moved = { ..._chunkJYV4R62Mcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
6096
6123
  const mask = layer.mask;
6097
6124
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
6098
6125
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -6102,7 +6129,7 @@ var ImageEditorController = (_class10 = class {
6102
6129
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
6103
6130
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
6104
6131
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
6105
- const next = _chunkX2KQQZBTcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
6132
+ const next = _chunkJYV4R62Mcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
6106
6133
  this.commitLayers(next, void 0, commitToHistory);
6107
6134
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
6108
6135
  }
@@ -6113,7 +6140,7 @@ var ImageEditorController = (_class10 = class {
6113
6140
  * target when the layer is active.
6114
6141
  */
6115
6142
  addLayerMask(id, from = "reveal-all", props = {}) {
6116
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6143
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6117
6144
  let mask;
6118
6145
  if (from === "selection" || from === "hide-selection" || from === "transparency") {
6119
6146
  let sel;
@@ -6121,8 +6148,8 @@ var ImageEditorController = (_class10 = class {
6121
6148
  sel = this.layerTransparency(id);
6122
6149
  } else {
6123
6150
  const current = this.state.selection;
6124
- if (!_optionalChain([current, 'optionalAccess', _201 => _201.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
6125
- sel = from === "hide-selection" ? _chunkX2KQQZBTcjs.invertSelection.call(void 0, current) : current;
6151
+ if (!_optionalChain([current, 'optionalAccess', _201 => _201.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
6152
+ sel = from === "hide-selection" ? _chunkJYV4R62Mcjs.invertSelection.call(void 0, current) : current;
6126
6153
  }
6127
6154
  mask = this.maskFromSelection(sel, props);
6128
6155
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
@@ -6132,7 +6159,7 @@ var ImageEditorController = (_class10 = class {
6132
6159
  const v = from === "reveal-all" ? 255 : 0;
6133
6160
  mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
6134
6161
  }
6135
- const next = _chunkX2KQQZBTcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
6162
+ const next = _chunkJYV4R62Mcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
6136
6163
  this.commitLayers(next, () => {
6137
6164
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
6138
6165
  });
@@ -6140,18 +6167,18 @@ var ImageEditorController = (_class10 = class {
6140
6167
  }
6141
6168
  /** Removes a layer's mask (one undo step). */
6142
6169
  removeLayerMask(id) {
6143
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6144
- if (!layer.mask) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
6145
- this.commitLayers(_chunkX2KQQZBTcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
6170
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6171
+ if (!layer.mask) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
6172
+ this.commitLayers(_chunkJYV4R62Mcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
6146
6173
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
6147
6174
  });
6148
6175
  }
6149
6176
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
6150
6177
  setLayerMaskProps(id, props, commitToHistory = true) {
6151
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6152
- if (!layer.mask) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
6178
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6179
+ if (!layer.mask) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
6153
6180
  const mask = withMaskProps(layer.mask, props);
6154
- this.commitLayers(_chunkX2KQQZBTcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
6181
+ this.commitLayers(_chunkJYV4R62Mcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
6155
6182
  return mask;
6156
6183
  }
6157
6184
  /**
@@ -6159,11 +6186,11 @@ var ImageEditorController = (_class10 = class {
6159
6186
  * the depth map) and removes the mask, as one undo step.
6160
6187
  */
6161
6188
  async applyLayerMask(id) {
6162
- const loc = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id);
6189
+ const loc = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id);
6163
6190
  const layer = loc.layer;
6164
- if (layer.type !== "pixel") throw new (0, _chunkX2KQQZBTcjs.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.`);
6165
- if (!layer.mask) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
6166
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
6191
+ if (layer.type !== "pixel") throw new (0, _chunkJYV4R62Mcjs.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.`);
6192
+ if (!layer.mask) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
6193
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
6167
6194
  const { width, height } = this.naturalSize;
6168
6195
  await this.renderer.prepareLayerAssets([layer], width, height);
6169
6196
  const sources = this.renderer.compositorSources(width, height);
@@ -6196,13 +6223,13 @@ var ImageEditorController = (_class10 = class {
6196
6223
  */
6197
6224
  layerViaCopy(options = {}) {
6198
6225
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
6199
- if (!id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
6200
- const loc = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id);
6226
+ if (!id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
6227
+ const loc = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id);
6201
6228
  const layer = loc.layer;
6202
- if (layer.type !== "pixel") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
6229
+ if (layer.type !== "pixel") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
6203
6230
  const sel = this.state.selection;
6204
- if (!_optionalChain([sel, 'optionalAccess', _202 => _202.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
6205
- if (options.cut) _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
6231
+ if (!_optionalChain([sel, 'optionalAccess', _202 => _202.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
6232
+ if (options.cut) _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
6206
6233
  const surface = this.surfaceOf(layer);
6207
6234
  const sb = sel.bounds;
6208
6235
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -6218,7 +6245,7 @@ var ImageEditorController = (_class10 = class {
6218
6245
  }
6219
6246
  const copy = {
6220
6247
  type: "pixel",
6221
- id: _chunkX2KQQZBTcjs.newLayerId.call(void 0, ),
6248
+ id: _chunkJYV4R62Mcjs.newLayerId.call(void 0, ),
6222
6249
  name: _optionalChain([options, 'access', _203 => _203.name, 'optionalAccess', _204 => _204.trim, 'call', _205 => _205()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
6223
6250
  visible: true,
6224
6251
  opacity: 1,
@@ -6291,7 +6318,7 @@ var ImageEditorController = (_class10 = class {
6291
6318
  * Refused while another transform is open.
6292
6319
  */
6293
6320
  beginFreeTransform(init = {}) {
6294
- if (this.getFreeTransform()) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
6321
+ if (this.getFreeTransform()) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
6295
6322
  const session = new FreeTransformSession(this.transformHost(), init);
6296
6323
  this.openTransform = session;
6297
6324
  this.notify();
@@ -6305,26 +6332,26 @@ var ImageEditorController = (_class10 = class {
6305
6332
  */
6306
6333
  transformLayer(spec) {
6307
6334
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
6308
- if (given > 1) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give only one of matrix, corners and params.");
6309
- if (!given && spec.warp === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
6335
+ if (given > 1) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give only one of matrix, corners and params.");
6336
+ if (!given && spec.warp === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
6310
6337
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
6311
- throw new (0, _chunkX2KQQZBTcjs.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).");
6338
+ throw new (0, _chunkJYV4R62Mcjs.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).");
6312
6339
  }
6313
6340
  if (spec.matrix) {
6314
6341
  const [a, b, c, d] = spec.matrix;
6315
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
6342
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
6316
6343
  }
6317
6344
  const session = this.beginFreeTransform(spec);
6318
6345
  try {
6319
6346
  const g = session.startGeometry;
6320
- const corners = spec.matrix ? g.corners.map((p) => _chunkEGZM52EOcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkX2KQQZBTcjs.applyParams.call(void 0, g, spec.params) : g.corners;
6347
+ const corners = spec.matrix ? g.corners.map((p) => _chunkEGZM52EOcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkJYV4R62Mcjs.applyParams.call(void 0, g, spec.params) : g.corners;
6321
6348
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
6322
6349
  if (spec.warp) {
6323
6350
  if ("style" in spec.warp) {
6324
- if (!_chunkEGZM52EOcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkEGZM52EOcjs.WARP_STYLES.join(", ")}.`);
6325
- warp = _chunkX2KQQZBTcjs.presetWarp.call(void 0, session.box, spec.warp);
6351
+ if (!_chunkEGZM52EOcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkEGZM52EOcjs.WARP_STYLES.join(", ")}.`);
6352
+ warp = _chunkJYV4R62Mcjs.presetWarp.call(void 0, session.box, spec.warp);
6326
6353
  } else {
6327
- if (!_chunkX2KQQZBTcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkX2KQQZBTcjs.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.");
6354
+ if (!_chunkJYV4R62Mcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkJYV4R62Mcjs.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.");
6328
6355
  warp = spec.warp;
6329
6356
  }
6330
6357
  }
@@ -6337,10 +6364,10 @@ var ImageEditorController = (_class10 = class {
6337
6364
  }
6338
6365
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
6339
6366
  flipLayer(axis, init = {}) {
6340
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
6367
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
6341
6368
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
6342
6369
  try {
6343
- session.update({ corners: _chunkX2KQQZBTcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
6370
+ session.update({ corners: _chunkJYV4R62Mcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
6344
6371
  return session.commit();
6345
6372
  } catch (e) {
6346
6373
  session.cancel();
@@ -6352,10 +6379,10 @@ var ImageEditorController = (_class10 = class {
6352
6379
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
6353
6380
  */
6354
6381
  rotateLayer90(turn, init = {}) {
6355
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
6382
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
6356
6383
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
6357
6384
  try {
6358
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkX2KQQZBTcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
6385
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkJYV4R62Mcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
6359
6386
  const cx = b.x + b.width / 2;
6360
6387
  const cy = b.y + b.height / 2;
6361
6388
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
@@ -6370,20 +6397,20 @@ var ImageEditorController = (_class10 = class {
6370
6397
  }
6371
6398
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
6372
6399
  addLayerFilter(id, filter) {
6373
- const f = _chunkX2KQQZBTcjs.normalizeFilter.call(void 0, filter);
6374
- const next = _chunkX2KQQZBTcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
6400
+ const f = _chunkJYV4R62Mcjs.normalizeFilter.call(void 0, filter);
6401
+ const next = _chunkJYV4R62Mcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
6375
6402
  this.commitLayers(next);
6376
6403
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
6377
6404
  }
6378
6405
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
6379
6406
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
6380
- const next = _chunkX2KQQZBTcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
6407
+ const next = _chunkJYV4R62Mcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
6381
6408
  this.commitLayers(next, void 0, commitToHistory);
6382
6409
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
6383
6410
  }
6384
6411
  /** Removes one filter (one undo step). Returns the remaining filters. */
6385
6412
  removeLayerFilter(id, filterId) {
6386
- const next = _chunkX2KQQZBTcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
6413
+ const next = _chunkJYV4R62Mcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
6387
6414
  this.commitLayers(next);
6388
6415
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
6389
6416
  }
@@ -6399,8 +6426,8 @@ var ImageEditorController = (_class10 = class {
6399
6426
  */
6400
6427
  convertToSmartObject(ids, options = {}) {
6401
6428
  const list = _optionalChain([ids, 'optionalAccess', _211 => _211.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
6402
- if (!list.length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
6403
- const res = _chunkX2KQQZBTcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
6429
+ if (!list.length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
6430
+ const res = _chunkJYV4R62Mcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
6404
6431
  this.commitLayers(res.layers, () => {
6405
6432
  this.state.activeLayerId = res.layer.id;
6406
6433
  this.state.activeTarget = "pixels";
@@ -6409,7 +6436,7 @@ var ImageEditorController = (_class10 = class {
6409
6436
  }
6410
6437
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
6411
6438
  rasterizeSmartObject(id) {
6412
- const res = _chunkX2KQQZBTcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
6439
+ const res = _chunkJYV4R62Mcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
6413
6440
  this.commitLayers(res.layers, () => {
6414
6441
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
6415
6442
  });
@@ -6417,10 +6444,10 @@ var ImageEditorController = (_class10 = class {
6417
6444
  }
6418
6445
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
6419
6446
  getSmartObject(id) {
6420
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, id);
6447
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, id);
6421
6448
  const c = layer.contents;
6422
- const g = _chunkX2KQQZBTcjs.placementGeometry.call(void 0, layer);
6423
- const readout = _chunkX2KQQZBTcjs.describeTransform.call(void 0, g);
6449
+ const g = _chunkJYV4R62Mcjs.placementGeometry.call(void 0, layer);
6450
+ const readout = _chunkJYV4R62Mcjs.describeTransform.call(void 0, g);
6424
6451
  const stack = layer.smartFilters;
6425
6452
  return {
6426
6453
  layerId: layer.id,
@@ -6430,10 +6457,10 @@ var ImageEditorController = (_class10 = class {
6430
6457
  kind: c.kind,
6431
6458
  width: c.width,
6432
6459
  height: c.height,
6433
- decoded: _chunkX2KQQZBTcjs.isContentsDecoded.call(void 0, c),
6460
+ decoded: _chunkJYV4R62Mcjs.isContentsDecoded.call(void 0, c),
6434
6461
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _212 => _212.file, 'optionalAccess', _213 => _213.type]), () => ( null)),
6435
6462
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _214 => _214.linked, 'optionalAccess', _215 => _215.path]), () => ( null)),
6436
- instances: _chunkX2KQQZBTcjs.instancesOf.call(void 0, this.state.layers, c.id),
6463
+ instances: _chunkJYV4R62Mcjs.instancesOf.call(void 0, this.state.layers, c.id),
6437
6464
  layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
6438
6465
  },
6439
6466
  placement: {
@@ -6445,8 +6472,8 @@ var ImageEditorController = (_class10 = class {
6445
6472
  scaleY: readout.scaleY,
6446
6473
  rotate: readout.rotate,
6447
6474
  skewX: readout.skewX,
6448
- center: _chunkX2KQQZBTcjs.anchorPoint.call(void 0, g, "center"),
6449
- bounds: _chunkX2KQQZBTcjs.transformedBox.call(void 0, g)
6475
+ center: _chunkJYV4R62Mcjs.anchorPoint.call(void 0, g, "center"),
6476
+ bounds: _chunkJYV4R62Mcjs.transformedBox.call(void 0, g)
6450
6477
  },
6451
6478
  smartFilters: {
6452
6479
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _216 => _216.enabled]), () => ( true)),
@@ -6463,7 +6490,7 @@ var ImageEditorController = (_class10 = class {
6463
6490
  * change. Returns the new placement summary.
6464
6491
  */
6465
6492
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
6466
- const res = _chunkX2KQQZBTcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
6493
+ const res = _chunkJYV4R62Mcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
6467
6494
  this.commitLayers(res.layers, void 0, commitToHistory);
6468
6495
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
6469
6496
  }
@@ -6476,23 +6503,23 @@ var ImageEditorController = (_class10 = class {
6476
6503
  * nothing is relative to the current transform.
6477
6504
  */
6478
6505
  setSmartObjectTransform(id, spec) {
6479
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, id);
6480
- const g = _chunkX2KQQZBTcjs.placementGeometry.call(void 0, layer);
6506
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, id);
6507
+ const g = _chunkJYV4R62Mcjs.placementGeometry.call(void 0, layer);
6481
6508
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
6482
6509
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
6483
- if (ways > 1) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
6510
+ if (ways > 1) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
6484
6511
  let corners = g.corners;
6485
6512
  if (spec.corners) corners = spec.corners;
6486
6513
  else if (spec.matrix) {
6487
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkX2KQQZBTcjs.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).");
6514
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkJYV4R62Mcjs.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).");
6488
6515
  const [a, b, c, d] = spec.matrix;
6489
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
6490
- corners = _chunkX2KQQZBTcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
6516
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
6517
+ corners = _chunkJYV4R62Mcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
6491
6518
  } else if (numeric.length) {
6492
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
6493
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`${k} must be a finite number.`);
6494
- const now = _chunkX2KQQZBTcjs.describeTransform.call(void 0, g);
6495
- const centre = _chunkX2KQQZBTcjs.anchorPoint.call(void 0, g, "center");
6519
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
6520
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`${k} must be a finite number.`);
6521
+ const now = _chunkJYV4R62Mcjs.describeTransform.call(void 0, g);
6522
+ const centre = _chunkJYV4R62Mcjs.anchorPoint.call(void 0, g, "center");
6496
6523
  const params = {
6497
6524
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
6498
6525
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -6500,20 +6527,20 @@ var ImageEditorController = (_class10 = class {
6500
6527
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
6501
6528
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
6502
6529
  };
6503
- const m = _chunkX2KQQZBTcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
6530
+ const m = _chunkJYV4R62Mcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
6504
6531
  const cx = g.box.width / 2;
6505
6532
  const cy = g.box.height / 2;
6506
6533
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
6507
- corners = _chunkX2KQQZBTcjs.cornersFromMatrix.call(void 0, g.box, _chunkEGZM52EOcjs.multiplyMatrices.call(void 0, m, _chunkEGZM52EOcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
6534
+ corners = _chunkJYV4R62Mcjs.cornersFromMatrix.call(void 0, g.box, _chunkEGZM52EOcjs.multiplyMatrices.call(void 0, m, _chunkEGZM52EOcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
6508
6535
  }
6509
6536
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
6510
6537
  if (spec.warp === null) warp = null;
6511
6538
  else if (spec.warp) {
6512
6539
  if ("style" in spec.warp) {
6513
- if (!_chunkEGZM52EOcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkEGZM52EOcjs.WARP_STYLES.join(", ")}.`);
6514
- warp = _chunkX2KQQZBTcjs.presetWarp.call(void 0, g.box, spec.warp);
6540
+ if (!_chunkEGZM52EOcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkEGZM52EOcjs.WARP_STYLES.join(", ")}.`);
6541
+ warp = _chunkJYV4R62Mcjs.presetWarp.call(void 0, g.box, spec.warp);
6515
6542
  } else {
6516
- if (!_chunkX2KQQZBTcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkX2KQQZBTcjs.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.");
6543
+ if (!_chunkJYV4R62Mcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkJYV4R62Mcjs.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.");
6517
6544
  warp = spec.warp;
6518
6545
  }
6519
6546
  }
@@ -6527,16 +6554,16 @@ var ImageEditorController = (_class10 = class {
6527
6554
  * the layers that changed.
6528
6555
  */
6529
6556
  replaceSmartObjectContents(id, source) {
6530
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, id);
6557
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, id);
6531
6558
  let contents;
6532
6559
  if ("contents" in source) contents = source.contents;
6533
- else if ("pixels" in source) contents = _chunkX2KQQZBTcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
6560
+ else if ("pixels" in source) contents = _chunkJYV4R62Mcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
6534
6561
  else {
6535
- const psd = _chunkX2KQQZBTcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkX2KQQZBTcjs.newLayerId.call(void 0, ) });
6536
- contents = _chunkX2KQQZBTcjs.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`)));
6562
+ const psd = _chunkJYV4R62Mcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkJYV4R62Mcjs.newLayerId.call(void 0, ) });
6563
+ contents = _chunkJYV4R62Mcjs.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`)));
6537
6564
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
6538
6565
  }
6539
- const res = _chunkX2KQQZBTcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
6566
+ const res = _chunkJYV4R62Mcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
6540
6567
  this.commitLayers(res.layers);
6541
6568
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
6542
6569
  }
@@ -6551,16 +6578,16 @@ var ImageEditorController = (_class10 = class {
6551
6578
  * and bytes.
6552
6579
  */
6553
6580
  exportSmartObjectContents(id) {
6554
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, id);
6581
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, id);
6555
6582
  const c = layer.contents;
6556
6583
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
6557
6584
  if (c.file) {
6558
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkX2KQQZBTcjs.BROWSER_IMAGE_TYPES };
6585
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkJYV4R62Mcjs.BROWSER_IMAGE_TYPES };
6559
6586
  const ext = c.file.type.toLowerCase();
6560
6587
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
6561
6588
  }
6562
- if (!_chunkX2KQQZBTcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
6563
- const f = _chunkX2KQQZBTcjs.smartContentsFile.call(void 0, c);
6589
+ if (!_chunkJYV4R62Mcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
6590
+ const f = _chunkJYV4R62Mcjs.smartContentsFile.call(void 0, c);
6564
6591
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
6565
6592
  }
6566
6593
  /**
@@ -6569,7 +6596,7 @@ var ImageEditorController = (_class10 = class {
6569
6596
  * undo step. Returns the copy's id.
6570
6597
  */
6571
6598
  copySmartObject(id, linked = false, name) {
6572
- const res = _chunkX2KQQZBTcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
6599
+ const res = _chunkJYV4R62Mcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
6573
6600
  this.commitLayers(res.layers, () => {
6574
6601
  this.state.activeLayerId = res.layer.id;
6575
6602
  this.state.activeTarget = "pixels";
@@ -6578,7 +6605,7 @@ var ImageEditorController = (_class10 = class {
6578
6605
  }
6579
6606
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
6580
6607
  addSmartFilter(id, filter, index, options = {}) {
6581
- const res = _chunkX2KQQZBTcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkX2KQQZBTcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
6608
+ const res = _chunkJYV4R62Mcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkJYV4R62Mcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
6582
6609
  return this.asOneStep(() => {
6583
6610
  this.commitLayers(res.layers);
6584
6611
  this.maskFiltersWithSelection(id, options.useSelection);
@@ -6596,25 +6623,25 @@ var ImageEditorController = (_class10 = class {
6596
6623
  }
6597
6624
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
6598
6625
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
6599
- const res = _chunkX2KQQZBTcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
6626
+ const res = _chunkJYV4R62Mcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
6600
6627
  this.commitLayers(res.layers, void 0, commitToHistory);
6601
6628
  return res.filter;
6602
6629
  }
6603
6630
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
6604
6631
  removeSmartFilter(id, filterId) {
6605
- const res = _chunkX2KQQZBTcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
6632
+ const res = _chunkJYV4R62Mcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
6606
6633
  this.commitLayers(res.layers);
6607
6634
  return _nullishCoalesce(_optionalChain([res, 'access', _222 => _222.layer, 'access', _223 => _223.smartFilters, 'optionalAccess', _224 => _224.filters]), () => ( []));
6608
6635
  }
6609
6636
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
6610
6637
  moveSmartFilter(id, filterId, index) {
6611
- const res = _chunkX2KQQZBTcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
6638
+ const res = _chunkJYV4R62Mcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
6612
6639
  this.commitLayers(res.layers);
6613
6640
  return _nullishCoalesce(_optionalChain([res, 'access', _225 => _225.layer, 'access', _226 => _226.smartFilters, 'optionalAccess', _227 => _227.filters]), () => ( []));
6614
6641
  }
6615
6642
  /** Turns a smart object's whole filter stack on or off (one undo step). */
6616
6643
  setSmartFiltersEnabled(id, enabled) {
6617
- const res = _chunkX2KQQZBTcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
6644
+ const res = _chunkJYV4R62Mcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
6618
6645
  this.commitLayers(res.layers);
6619
6646
  return _nullishCoalesce(_optionalChain([res, 'access', _228 => _228.layer, 'access', _229 => _229.smartFilters, 'optionalAccess', _230 => _230.enabled]), () => ( true));
6620
6647
  }
@@ -6624,21 +6651,21 @@ var ImageEditorController = (_class10 = class {
6624
6651
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
6625
6652
  */
6626
6653
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
6627
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, id);
6654
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, id);
6628
6655
  let mask;
6629
6656
  if (from === "none") mask = null;
6630
6657
  else if (from === "keep") {
6631
- if (!_optionalChain([layer, 'access', _231 => _231.smartFilters, 'optionalAccess', _232 => _232.mask])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
6658
+ if (!_optionalChain([layer, 'access', _231 => _231.smartFilters, 'optionalAccess', _232 => _232.mask])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
6632
6659
  mask = withMaskProps(layer.smartFilters.mask, props);
6633
6660
  } else if (from === "selection") {
6634
6661
  const sel = this.state.selection;
6635
- if (!_optionalChain([sel, 'optionalAccess', _233 => _233.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
6662
+ if (!_optionalChain([sel, 'optionalAccess', _233 => _233.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
6636
6663
  mask = this.maskFromSelection(sel, props);
6637
6664
  } else {
6638
6665
  const v = from === "reveal-all" ? 255 : 0;
6639
6666
  mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
6640
6667
  }
6641
- const res = _chunkX2KQQZBTcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
6668
+ const res = _chunkJYV4R62Mcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
6642
6669
  this.commitLayers(res.layers, () => {
6643
6670
  if (this.state.activeLayerId !== id) return;
6644
6671
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -6654,14 +6681,14 @@ var ImageEditorController = (_class10 = class {
6654
6681
  async prepareSmartObjects() {
6655
6682
  const pending = /* @__PURE__ */ new Map();
6656
6683
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
6657
- if (l.type === "smart" && !_chunkX2KQQZBTcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkX2KQQZBTcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
6684
+ if (l.type === "smart" && !_chunkJYV4R62Mcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkJYV4R62Mcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
6658
6685
  }
6659
6686
  const left = [];
6660
6687
  for (const [cid, c] of pending) {
6661
6688
  try {
6662
- const url = `data:${_chunkX2KQQZBTcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
6689
+ const url = `data:${_chunkJYV4R62Mcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
6663
6690
  const px2 = await this.decodeImage(url);
6664
- const decoded = { ...c, kind: "raster", raster: _chunkX2KQQZBTcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
6691
+ const decoded = { ...c, kind: "raster", raster: _chunkJYV4R62Mcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
6665
6692
  const swap = (layers) => {
6666
6693
  let out = layers;
6667
6694
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -6689,10 +6716,10 @@ var ImageEditorController = (_class10 = class {
6689
6716
  * Contents can nest. Returns the contents' size and layer ids.
6690
6717
  */
6691
6718
  editSmartObjectContents(id) {
6692
- if (this.getFreeTransform()) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
6693
- const layer = _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, this.state.layers, id);
6719
+ if (this.getFreeTransform()) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
6720
+ const layer = _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, this.state.layers, id);
6694
6721
  const c = layer.contents;
6695
- if (!_chunkX2KQQZBTcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _237 => _237.file, 'optionalAccess', _238 => _238.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
6722
+ if (!_chunkJYV4R62Mcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _237 => _237.file, 'optionalAccess', _238 => _238.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
6696
6723
  const saved = {
6697
6724
  state: { ...this.state },
6698
6725
  undo: this.undoStack,
@@ -6703,7 +6730,7 @@ var ImageEditorController = (_class10 = class {
6703
6730
  samplePixelsOverride: this.samplePixelsOverride,
6704
6731
  psdResolution: this.psdResolution
6705
6732
  };
6706
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkX2KQQZBTcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
6733
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkJYV4R62Mcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
6707
6734
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
6708
6735
  const s = this.state;
6709
6736
  this.state = {
@@ -6711,7 +6738,7 @@ var ImageEditorController = (_class10 = class {
6711
6738
  sourceUrl: null,
6712
6739
  imageDimensions: { width: c.width, height: c.height },
6713
6740
  crop: null,
6714
- transform: { ..._chunkX2KQQZBTcjs.DEFAULT_TRANSFORM_VALUES },
6741
+ transform: { ..._chunkJYV4R62Mcjs.DEFAULT_TRANSFORM_VALUES },
6715
6742
  layers,
6716
6743
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
6717
6744
  activeTarget: "pixels",
@@ -6744,7 +6771,7 @@ var ImageEditorController = (_class10 = class {
6744
6771
  */
6745
6772
  closeSmartObjectContents(save = true) {
6746
6773
  const top = this.contentsStack.pop();
6747
- if (!top) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
6774
+ if (!top) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
6748
6775
  if (_optionalChain([this, 'access', _244 => _244.openTransform, 'optionalAccess', _245 => _245.isOpen])) this.openTransform.cancel();
6749
6776
  this.openTransform = null;
6750
6777
  const edited = this.state;
@@ -6758,10 +6785,10 @@ var ImageEditorController = (_class10 = class {
6758
6785
  const plain3 = _optionalChain([only, 'optionalAccess', _248 => _248.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _249 => _249.filters, 'optionalAccess', _250 => _250.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
6759
6786
  if (_optionalChain([old, 'optionalAccess', _251 => _251.kind]) === "raster" && plain3) {
6760
6787
  const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
6761
- next = _chunkX2KQQZBTcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
6788
+ next = _chunkJYV4R62Mcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
6762
6789
  } else {
6763
6790
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
6764
- next = _chunkX2KQQZBTcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _252 => _252.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _253 => _253.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
6791
+ next = _chunkJYV4R62Mcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _252 => _252.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _253 => _253.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
6765
6792
  }
6766
6793
  }
6767
6794
  const saved = top.saved;
@@ -6780,7 +6807,7 @@ var ImageEditorController = (_class10 = class {
6780
6807
  this.notify();
6781
6808
  return { layerId: top.layerId, changed: false, layerIds: [] };
6782
6809
  }
6783
- const res = _chunkX2KQQZBTcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
6810
+ const res = _chunkJYV4R62Mcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
6784
6811
  this.commitLayers(res.layers);
6785
6812
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
6786
6813
  }
@@ -6795,35 +6822,35 @@ var ImageEditorController = (_class10 = class {
6795
6822
  // --- Layer effects ---
6796
6823
  /** A layer's effects (an empty, enabled list when it has none). */
6797
6824
  getLayerEffects(id) {
6798
- return _chunkX2KQQZBTcjs.layerEffectsOf.call(void 0, _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer);
6825
+ return _chunkJYV4R62Mcjs.layerEffectsOf.call(void 0, _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer);
6799
6826
  }
6800
6827
  /**
6801
6828
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
6802
6829
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
6803
6830
  */
6804
6831
  addLayerEffect(id, kind, params = {}, index) {
6805
- const res = _chunkX2KQQZBTcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
6832
+ const res = _chunkJYV4R62Mcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
6806
6833
  this.commitLayers(res.layers);
6807
6834
  return { effect: res.effect, effects: this.getLayerEffects(id) };
6808
6835
  }
6809
6836
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
6810
6837
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
6811
- this.commitLayers(_chunkX2KQQZBTcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
6838
+ this.commitLayers(_chunkJYV4R62Mcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
6812
6839
  return this.getLayerEffects(id);
6813
6840
  }
6814
6841
  /** Removes one effect (one undo step). Returns the remaining effects. */
6815
6842
  removeLayerEffect(id, effectId) {
6816
- this.commitLayers(_chunkX2KQQZBTcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
6843
+ this.commitLayers(_chunkJYV4R62Mcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
6817
6844
  return this.getLayerEffects(id);
6818
6845
  }
6819
6846
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
6820
6847
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
6821
- this.commitLayers(_chunkX2KQQZBTcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
6848
+ this.commitLayers(_chunkJYV4R62Mcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
6822
6849
  return this.getLayerEffects(id);
6823
6850
  }
6824
6851
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
6825
6852
  setLayerEffects(id, effects, commitToHistory = true) {
6826
- this.commitLayers(_chunkX2KQQZBTcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
6853
+ this.commitLayers(_chunkJYV4R62Mcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
6827
6854
  return this.getLayerEffects(id);
6828
6855
  }
6829
6856
  __init90() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -6849,8 +6876,8 @@ var ImageEditorController = (_class10 = class {
6849
6876
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
6850
6877
  setGlobalLight(light, commitToHistory = true) {
6851
6878
  const next = { ...this.getGlobalLight(), ...light };
6852
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
6853
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
6879
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
6880
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
6854
6881
  if (commitToHistory) this.recordHistory();
6855
6882
  if (next.angle === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
6856
6883
  else this.state.globalLight = next;
@@ -6861,16 +6888,16 @@ var ImageEditorController = (_class10 = class {
6861
6888
  async compositeToSurface(layers, rect) {
6862
6889
  const { width, height } = this.naturalSize;
6863
6890
  if (_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
6864
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
6891
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
6865
6892
  }
6866
6893
  await this.renderer.prepareLayerAssets(layers, width, height);
6867
6894
  const sources = this.renderer.compositorSources(width, height);
6868
6895
  const depth = this.bitDepth;
6869
6896
  if (depth !== 8) {
6870
- const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkX2KQQZBTcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
6897
+ const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkJYV4R62Mcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
6871
6898
  return _chunkCWM3CUUXcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
6872
6899
  }
6873
- const data = new (0, _chunkX2KQQZBTcjs.LayerCompositor)().composite(layers, rect, sources);
6900
+ const data = new (0, _chunkJYV4R62Mcjs.LayerCompositor)().composite(layers, rect, sources);
6874
6901
  return _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
6875
6902
  }
6876
6903
  /**
@@ -6883,22 +6910,22 @@ var ImageEditorController = (_class10 = class {
6883
6910
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
6884
6911
  const depth = this.bitDepth;
6885
6912
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkCWM3CUUXcjs.to16From8.call(void 0, this.compositePixels(r).data) };
6886
- const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkX2KQQZBTcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
6913
+ const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkJYV4R62Mcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
6887
6914
  return { width: r.width, height: r.height, depth, data };
6888
6915
  }
6889
6916
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
6890
6917
  paintBounds(layer) {
6891
6918
  const { width, height } = this.naturalSize;
6892
6919
  const canvas = { x: 0, y: 0, width, height };
6893
- if (_chunkX2KQQZBTcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
6920
+ if (_chunkJYV4R62Mcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
6894
6921
  if (layer.type === "annotation") {
6895
- const b = _chunkX2KQQZBTcjs.getAnnotationBounds.call(void 0, layer.annotation);
6922
+ const b = _chunkJYV4R62Mcjs.getAnnotationBounds.call(void 0, layer.annotation);
6896
6923
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
6897
6924
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
6898
6925
  }
6899
6926
  if (layer.type === "group") {
6900
6927
  let r = null;
6901
- for (const c of layer.children) r = _chunkX2KQQZBTcjs.unionRect.call(void 0, r, this.paintBounds(c));
6928
+ for (const c of layer.children) r = _chunkJYV4R62Mcjs.unionRect.call(void 0, r, this.paintBounds(c));
6902
6929
  return _nullishCoalesce(r, () => ( canvas));
6903
6930
  }
6904
6931
  return canvas;
@@ -6909,16 +6936,16 @@ var ImageEditorController = (_class10 = class {
6909
6936
  * Returns the merged id.
6910
6937
  */
6911
6938
  async mergeDown(id) {
6912
- const loc = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id);
6939
+ const loc = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id);
6913
6940
  const upper = loc.layer;
6914
6941
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
6915
6942
  const lower = siblings[loc.index - 1];
6916
- if (!lower) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
6917
- if (lower.type !== "pixel") throw new (0, _chunkX2KQQZBTcjs.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.`);
6918
- if (!upper.visible) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
6919
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
6920
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
6921
- let rect = _nullishCoalesce(_chunkX2KQQZBTcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
6943
+ if (!lower) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
6944
+ if (lower.type !== "pixel") throw new (0, _chunkJYV4R62Mcjs.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.`);
6945
+ if (!upper.visible) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
6946
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
6947
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
6948
+ let rect = _nullishCoalesce(_chunkJYV4R62Mcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
6922
6949
  const reach = Math.max(_chunkHGTDMKNEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkHGTDMKNEcjs.effectsMargin.call(void 0, upper.effects));
6923
6950
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
6924
6951
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -6944,12 +6971,12 @@ var ImageEditorController = (_class10 = class {
6944
6971
  */
6945
6972
  async mergeVisible() {
6946
6973
  const visible = this.state.layers.filter((l) => l.visible);
6947
- if (!visible.length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("No layer is visible.");
6974
+ if (!visible.length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("No layer is visible.");
6948
6975
  const { width, height } = this.naturalSize;
6949
6976
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
6950
6977
  const merged = {
6951
6978
  type: "pixel",
6952
- id: _chunkX2KQQZBTcjs.newLayerId.call(void 0, ),
6979
+ id: _chunkJYV4R62Mcjs.newLayerId.call(void 0, ),
6953
6980
  name: "Merged",
6954
6981
  visible: true,
6955
6982
  opacity: 1,
@@ -6973,8 +7000,8 @@ var ImageEditorController = (_class10 = class {
6973
7000
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
6974
7001
  const bg = {
6975
7002
  type: "pixel",
6976
- id: _chunkX2KQQZBTcjs.BACKGROUND_LAYER_ID,
6977
- name: _chunkX2KQQZBTcjs.BACKGROUND_LAYER_NAME,
7003
+ id: _chunkJYV4R62Mcjs.BACKGROUND_LAYER_ID,
7004
+ name: _chunkJYV4R62Mcjs.BACKGROUND_LAYER_NAME,
6978
7005
  visible: true,
6979
7006
  opacity: 1,
6980
7007
  blend: "normal",
@@ -7001,7 +7028,7 @@ var ImageEditorController = (_class10 = class {
7001
7028
  const k = Math.min(1, side / Math.max(width, height));
7002
7029
  const tw = Math.max(1, Math.round(width * k));
7003
7030
  const th = Math.max(1, Math.round(height * k));
7004
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkX2KQQZBTcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
7031
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkJYV4R62Mcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
7005
7032
  if (!surface) return null;
7006
7033
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
7007
7034
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -7097,7 +7124,7 @@ var ImageEditorController = (_class10 = class {
7097
7124
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
7098
7125
  */
7099
7126
  setCloneSource(point) {
7100
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
7127
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
7101
7128
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
7102
7129
  this.state.paint = { ...this.state.paint, cloneSource: source };
7103
7130
  this.notify();
@@ -7113,9 +7140,9 @@ var ImageEditorController = (_class10 = class {
7113
7140
  const next = t ? { ...cur, ...t } : { ..._chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM };
7114
7141
  for (const k of ["scaleX", "scaleY"]) {
7115
7142
  const v = next[k];
7116
- if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
7143
+ if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
7117
7144
  }
7118
- if (!Number.isFinite(next.rotate)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("rotate must be a number of degrees.");
7145
+ if (!Number.isFinite(next.rotate)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("rotate must be a number of degrees.");
7119
7146
  next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
7120
7147
  this.state.paint = { ...this.state.paint, cloneTransform: next };
7121
7148
  this.notify();
@@ -7134,33 +7161,33 @@ var ImageEditorController = (_class10 = class {
7134
7161
  paintTarget(layerId, channel, action) {
7135
7162
  if (channel === "quick-mask" || channel === void 0 && layerId === void 0 && this.state.quickMaskEditing) {
7136
7163
  if (!this.state.quickMaskEditing) {
7137
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Quick Mask is off; turn it on (set_quick_mask) to ${action} on the selection, or target a layer.`, `Turn on Quick Mask (Q) to ${action} on the selection.`);
7164
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Quick Mask is off; turn it on (set_quick_mask) to ${action} on the selection, or target a layer.`, `Turn on Quick Mask (Q) to ${action} on the selection.`);
7138
7165
  }
7139
7166
  return { id: QUICK_MASK_TARGET, layer: null, channel: "quick-mask", offset: { x: 0, y: 0 }, surface: this.quickMaskSurface(), lockTransparency: false };
7140
7167
  }
7141
7168
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
7142
- if (!id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`, `Pick a layer to ${action} on in the Layers panel.`);
7143
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7169
+ if (!id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`, `Pick a layer to ${action} on in the Layers panel.`);
7170
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7144
7171
  const name = layer.name || id;
7145
7172
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
7146
7173
  if (ch === "mask") {
7147
- if (!layer.mask) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`, `Layer "${name}" has no mask; add a mask or ${action} on its pixels.`);
7148
- if (layer.mask.source) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
7149
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "all", action);
7174
+ if (!layer.mask) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`, `Layer "${name}" has no mask; add a mask or ${action} on its pixels.`);
7175
+ if (layer.mask.source) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
7176
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "all", action);
7150
7177
  } else if (ch === "filter-mask") {
7151
7178
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _261 => _261.smartFilters, 'optionalAccess', _262 => _262.mask])) {
7152
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`, `Layer "${name}" has no smart filter mask to ${action}.`);
7179
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`, `Layer "${name}" has no smart filter mask to ${action}.`);
7153
7180
  }
7154
- if (!_chunkX2KQQZBTcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`The contents of "${name}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`, `The smart object "${name}" is still loading; try again in a moment.`);
7155
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "all", action);
7181
+ if (!_chunkJYV4R62Mcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`The contents of "${name}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`, `The smart object "${name}" is still loading; try again in a moment.`);
7182
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "all", action);
7156
7183
  } else {
7157
- if (layer.type === "smart") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" 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.`, `"${name}" is a smart object; rasterize it or edit its contents to ${action} on it.`);
7158
- if (layer.type === "shape") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a shape layer; rasterize it to ${action} on it.`);
7159
- if (layer.type === "type") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a type layer; rasterize it to ${action} on it.`);
7160
- if (layer.type !== "pixel") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`, `"${name}" is not a pixel layer; pick a pixel layer to ${action} on.`);
7161
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "pixels", action);
7184
+ if (layer.type === "smart") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" 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.`, `"${name}" is a smart object; rasterize it or edit its contents to ${action} on it.`);
7185
+ if (layer.type === "shape") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a shape layer; rasterize it to ${action} on it.`);
7186
+ if (layer.type === "type") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a type layer; rasterize it to ${action} on it.`);
7187
+ if (layer.type !== "pixel") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`, `"${name}" is not a pixel layer; pick a pixel layer to ${action} on.`);
7188
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "pixels", action);
7162
7189
  }
7163
- if (!layer.visible) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
7190
+ if (!layer.visible) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
7164
7191
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
7165
7192
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
7166
7193
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _263 => _263.locks, 'optionalAccess', _264 => _264.transparency]));
@@ -7169,7 +7196,7 @@ var ImageEditorController = (_class10 = class {
7169
7196
  /** The layer with its pixels (or mask) replaced by `surface`. */
7170
7197
  withSurface(layer, channel, surface) {
7171
7198
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
7172
- if (channel === "filter-mask") return _chunkX2KQQZBTcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
7199
+ if (channel === "filter-mask") return _chunkJYV4R62Mcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
7173
7200
  const next = { ...layer, surface };
7174
7201
  delete next.source;
7175
7202
  return next;
@@ -7182,10 +7209,10 @@ var ImageEditorController = (_class10 = class {
7182
7209
  */
7183
7210
  beginStroke(init = {}) {
7184
7211
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
7185
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
7212
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
7186
7213
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
7187
7214
  if (tool === "mixer" && target.channel !== "pixels") {
7188
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.", "The Mixer Brush paints on pixels, not masks; target the layer's pixels, or paint the mask with the Brush.");
7215
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.", "The Mixer Brush paints on pixels, not masks; target the layer's pixels, or paint the mask with the Brush.");
7189
7216
  }
7190
7217
  const brush = _chunkEBDCRTZIcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
7191
7218
  let strokePaint = null;
@@ -7220,7 +7247,7 @@ var ImageEditorController = (_class10 = class {
7220
7247
  retouchStroke(tool, init, brush, target, apply) {
7221
7248
  const settings = _chunk7NW46N7Icjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
7222
7249
  const mask = target.channel !== "pixels";
7223
- if (tool === "sponge" && mask) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
7250
+ if (tool === "sponge" && mask) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
7224
7251
  if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunk7NW46N7Icjs.RetouchDabStroke)(brush, pixels, _chunk7NW46N7Icjs.smudgeEffect.call(void 0, brush, settings.strength)) };
7225
7252
  if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunk7NW46N7Icjs.RetouchDabStroke)(brush, pixels, _chunk7NW46N7Icjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
7226
7253
  const retouchApply = {
@@ -7259,11 +7286,11 @@ var ImageEditorController = (_class10 = class {
7259
7286
  if (tool === "history") {
7260
7287
  const steps = settings.historySteps;
7261
7288
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
7262
- if (!entry) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
7289
+ if (!entry) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
7263
7290
  const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _269 => _269.layer]);
7264
- if (!then) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
7291
+ if (!then) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
7265
7292
  const surface = target.channel === "mask" ? _optionalChain([then, 'access', _270 => _270.mask, 'optionalAccess', _271 => _271.surface]) : then.type === "pixel" ? then.surface : void 0;
7266
- if (!surface) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
7293
+ if (!surface) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
7267
7294
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
7268
7295
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
7269
7296
  const source2 = depth ? new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
@@ -7308,7 +7335,7 @@ var ImageEditorController = (_class10 = class {
7308
7335
  }
7309
7336
  if (init.source) this.setCloneSource(init.source);
7310
7337
  const cs = this.state.paint.cloneSource;
7311
- if (!cs) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
7338
+ if (!cs) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
7312
7339
  let offset = { x: 0, y: 0 };
7313
7340
  let first = { x: 0, y: 0 };
7314
7341
  const xf = this.state.paint.cloneTransform;
@@ -7345,7 +7372,7 @@ var ImageEditorController = (_class10 = class {
7345
7372
  const sources = this.compositorSources();
7346
7373
  if (depth) {
7347
7374
  return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => {
7348
- const w = _chunkX2KQQZBTcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
7375
+ const w = _chunkJYV4R62Mcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
7349
7376
  for (let i = 0; i < w.length; i += 4) {
7350
7377
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkCWM3CUUXcjs.srgbEncode.call(void 0, w[i + c]);
7351
7378
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -7353,7 +7380,7 @@ var ImageEditorController = (_class10 = class {
7353
7380
  return w;
7354
7381
  }, 4);
7355
7382
  }
7356
- const compositor = new (0, _chunkX2KQQZBTcjs.LayerCompositor)();
7383
+ const compositor = new (0, _chunkJYV4R62Mcjs.LayerCompositor)();
7357
7384
  return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
7358
7385
  }
7359
7386
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
@@ -7376,7 +7403,7 @@ var ImageEditorController = (_class10 = class {
7376
7403
  /** @internal Shows a stroke's live surface (no history). */
7377
7404
  _strokeUpdate(layerId, channel, surface, rects) {
7378
7405
  if (channel === "quick-mask") {
7379
- this.state.selection = this.selectionFromSurface(surface, _nullishCoalesce(this.state.selection, () => ( null)), rects);
7406
+ this.state.selection = this.selectionFromSurface(surface);
7380
7407
  this.notify();
7381
7408
  return;
7382
7409
  }
@@ -7410,9 +7437,9 @@ var ImageEditorController = (_class10 = class {
7410
7437
  * document bounds and the number of dabs.
7411
7438
  */
7412
7439
  paintStroke(init) {
7413
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("points must hold at least one { x, y } point.");
7440
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("points must hold at least one { x, y } point.");
7414
7441
  for (const p of init.points) {
7415
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _276 => _276.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _277 => _277.y]))) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
7442
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _276 => _276.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _277 => _277.y]))) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
7416
7443
  }
7417
7444
  const session = this.beginStroke(init);
7418
7445
  session.push(init.points);
@@ -7441,12 +7468,12 @@ var ImageEditorController = (_class10 = class {
7441
7468
  */
7442
7469
  strokeSelection(options) {
7443
7470
  const sel = this.state.selection;
7444
- if (!_optionalChain([sel, 'optionalAccess', _278 => _278.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
7471
+ if (!_optionalChain([sel, 'optionalAccess', _278 => _278.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
7445
7472
  const width = options.width;
7446
- if (!(width > 0 && width <= 250)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
7473
+ if (!(width > 0 && width <= 250)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
7447
7474
  const location = _nullishCoalesce(options.location, () => ( "outside"));
7448
7475
  if (location !== "inside" && location !== "center" && location !== "outside") {
7449
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown location "${String(location)}"; use inside, center or outside.`);
7476
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown location "${String(location)}"; use inside, center or outside.`);
7450
7477
  }
7451
7478
  const ring = selectionRing(sel, width, location);
7452
7479
  if (!ring.bounds) return { layerId: _nullishCoalesce(_nullishCoalesce(options.layerId, () => ( this.state.activeLayerId)), () => ( "")), channel: "pixels", bounds: null, dabs: 0 };
@@ -7458,7 +7485,7 @@ var ImageEditorController = (_class10 = class {
7458
7485
  */
7459
7486
  cropToSelection() {
7460
7487
  const sel = this.state.selection;
7461
- if (!_optionalChain([sel, 'optionalAccess', _279 => _279.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
7488
+ if (!_optionalChain([sel, 'optionalAccess', _279 => _279.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
7462
7489
  const crop = { ...sel.bounds };
7463
7490
  this.setCrop(crop);
7464
7491
  return crop;
@@ -7472,10 +7499,10 @@ var ImageEditorController = (_class10 = class {
7472
7499
  */
7473
7500
  contentAwareFill(options = {}) {
7474
7501
  const sel = this.state.selection;
7475
- if (!_optionalChain([sel, 'optionalAccess', _280 => _280.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
7476
- if (this.bitDepth !== 8) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
7502
+ if (!_optionalChain([sel, 'optionalAccess', _280 => _280.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
7503
+ if (this.bitDepth !== 8) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
7477
7504
  const output = _nullishCoalesce(options.output, () => ( "current"));
7478
- if (output !== "current" && output !== "new-layer") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown output "${String(output)}"; use current or new-layer.`);
7505
+ if (output !== "current" && output !== "new-layer") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown output "${String(output)}"; use current or new-layer.`);
7479
7506
  const target = this.paintTarget(options.layerId, "pixels", "fill");
7480
7507
  const { width, height } = this.naturalSize;
7481
7508
  const b = sel.bounds;
@@ -7483,7 +7510,7 @@ var ImageEditorController = (_class10 = class {
7483
7510
  const x0 = Math.max(0, b.x - margin);
7484
7511
  const y0 = Math.max(0, b.y - margin);
7485
7512
  const win = { x: x0, y: y0, width: Math.min(width, b.x + b.width + margin) - x0, height: Math.min(height, b.y + b.height + margin) - y0 };
7486
- if (win.width * win.height > 16e6) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The area to fill and sample is too large (over 16 MP); fill a smaller selection or lower sampleRadius.");
7513
+ if (win.width * win.height > 16e6) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The area to fill and sample is too large (over 16 MP); fill a smaller selection or lower sampleRadius.");
7487
7514
  const layerRect = { x: win.x - target.offset.x, y: win.y - target.offset.y, width: win.width, height: win.height };
7488
7515
  const before = _chunkCWM3CUUXcjs.readRegion.call(void 0, target.surface, layerRect);
7489
7516
  const img = new Float32Array(before.length);
@@ -7526,7 +7553,7 @@ var ImageEditorController = (_class10 = class {
7526
7553
  /** Puts pixels on the editor's clipboard (e.g. an image pasted from the system clipboard). */
7527
7554
  setClipboard(image) {
7528
7555
  if (image && (image.data.length !== image.width * image.height * 4 || image.width < 1 || image.height < 1)) {
7529
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Clipboard pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
7556
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Clipboard pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
7530
7557
  }
7531
7558
  this.clipboard = image;
7532
7559
  }
@@ -7544,9 +7571,9 @@ var ImageEditorController = (_class10 = class {
7544
7571
  data = new Uint8ClampedArray(this.compositePixels(rect).data);
7545
7572
  } else {
7546
7573
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
7547
- if (!id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("No layer given and none is active; pass layerId, or merged: true to copy the visible image.");
7548
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7549
- if (layer.type !== "pixel") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" is not a pixel layer; copy merged, or rasterize it first.`);
7574
+ if (!id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("No layer given and none is active; pass layerId, or merged: true to copy the visible image.");
7575
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7576
+ if (layer.type !== "pixel") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" is not a pixel layer; copy merged, or rasterize it first.`);
7550
7577
  data = _chunkCWM3CUUXcjs.readRegion.call(void 0, this.surfaceOf(layer), { x: rect.x - layer.offset.x, y: rect.y - layer.offset.y, width: rect.width, height: rect.height });
7551
7578
  }
7552
7579
  if (sel) {
@@ -7576,10 +7603,10 @@ var ImageEditorController = (_class10 = class {
7576
7603
  * (Paste Outside). Returns the new layer id and where it went.
7577
7604
  */
7578
7605
  pastePixels(mode = "new-layer", image = this.clipboard) {
7579
- if (!image) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
7580
- if (!PASTE_MODES.includes(mode)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
7606
+ if (!image) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
7607
+ if (!PASTE_MODES.includes(mode)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
7581
7608
  const sel = _optionalChain([this, 'access', _285 => _285.state, 'access', _286 => _286.selection, 'optionalAccess', _287 => _287.bounds]) ? this.state.selection : null;
7582
- if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
7609
+ if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
7583
7610
  const { width, height } = this.naturalSize;
7584
7611
  let x;
7585
7612
  let y;
@@ -7601,8 +7628,8 @@ var ImageEditorController = (_class10 = class {
7601
7628
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? coverageMask ? "stroke" : "fill" : "clear");
7602
7629
  const { width, height } = this.naturalSize;
7603
7630
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
7604
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("opacity must be from 0 to 1.");
7605
- const blend = _nullishCoalesce(_chunkX2KQQZBTcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
7631
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("opacity must be from 0 to 1.");
7632
+ const blend = _nullishCoalesce(_chunkJYV4R62Mcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
7606
7633
  const quickMask = target.channel === "quick-mask";
7607
7634
  const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _289 => _289.state, 'access', _290 => _290.selection, 'optionalAccess', _291 => _291.bounds]) ? this.state.selection : null)));
7608
7635
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _292 => _292.bounds]), () => ( { x: 0, y: 0, width, height }));
@@ -7645,7 +7672,7 @@ var ImageEditorController = (_class10 = class {
7645
7672
  // --- Adjustments ---
7646
7673
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
7647
7674
  developLayer() {
7648
- return _chunkX2KQQZBTcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
7675
+ return _chunkJYV4R62Mcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
7649
7676
  }
7650
7677
  /**
7651
7678
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -7671,7 +7698,7 @@ var ImageEditorController = (_class10 = class {
7671
7698
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
7672
7699
  }
7673
7700
  if ("layers" in partial) {
7674
- layers = this.replaceAdjustmentNodes(layers, _chunkX2KQQZBTcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
7701
+ layers = this.replaceAdjustmentNodes(layers, _chunkJYV4R62Mcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
7675
7702
  }
7676
7703
  this.state.layers = layers;
7677
7704
  this.notify();
@@ -7679,7 +7706,7 @@ var ImageEditorController = (_class10 = class {
7679
7706
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
7680
7707
  get isProcessOutdated() {
7681
7708
  this.syncViews();
7682
- return _chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkX2KQQZBTcjs.LATEST_PROCESS_VERSION;
7709
+ return _chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkJYV4R62Mcjs.LATEST_PROCESS_VERSION;
7683
7710
  }
7684
7711
  /**
7685
7712
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -7687,7 +7714,7 @@ var ImageEditorController = (_class10 = class {
7687
7714
  */
7688
7715
  upgradeProcess() {
7689
7716
  if (!this.isProcessOutdated) return false;
7690
- this.setAdjustments({ process: _chunkX2KQQZBTcjs.LATEST_PROCESS_VERSION });
7717
+ this.setAdjustments({ process: _chunkJYV4R62Mcjs.LATEST_PROCESS_VERSION });
7691
7718
  return true;
7692
7719
  }
7693
7720
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -7698,7 +7725,7 @@ var ImageEditorController = (_class10 = class {
7698
7725
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0,
7699
7726
  this.state.layers,
7700
7727
  target.id,
7701
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkX2KQQZBTcjs.LATEST_PROCESS_VERSION }), 0)
7728
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkJYV4R62Mcjs.LATEST_PROCESS_VERSION }), 0)
7702
7729
  );
7703
7730
  }
7704
7731
  delete this.state.legacyOutputBlur;
@@ -7762,7 +7789,7 @@ var ImageEditorController = (_class10 = class {
7762
7789
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
7763
7790
  for (const l of next) {
7764
7791
  if (existing.has(l.id)) continue;
7765
- out = this.placeLayer(out, _chunkX2KQQZBTcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
7792
+ out = this.placeLayer(out, _chunkJYV4R62Mcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
7766
7793
  }
7767
7794
  const order = next.map((l) => l.id);
7768
7795
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -7777,19 +7804,19 @@ var ImageEditorController = (_class10 = class {
7777
7804
  addAdjustmentLayer(init, index) {
7778
7805
  const spec = typeof init === "string" ? { kind: init } : init;
7779
7806
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
7780
- const layer = _chunkX2KQQZBTcjs.createAdjustmentLayer.call(void 0, spec.kind, {
7807
+ const layer = _chunkJYV4R62Mcjs.createAdjustmentLayer.call(void 0, spec.kind, {
7781
7808
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
7782
7809
  name: spec.name,
7783
7810
  params: spec.params,
7784
7811
  enabled: spec.enabled,
7785
7812
  opacity: spec.opacity,
7786
7813
  blend: spec.blend,
7787
- mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _299 => _299.state, 'access', _300 => _300.selection, 'optionalAccess', _301 => _301.bounds]) ? _chunkX2KQQZBTcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
7814
+ mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _299 => _299.state, 'access', _300 => _300.selection, 'optionalAccess', _301 => _301.bounds]) ? _chunkJYV4R62Mcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
7788
7815
  });
7789
- while (ids.has(layer.id)) layer.id = _chunkX2KQQZBTcjs.newLayerId.call(void 0, "adj");
7816
+ while (ids.has(layer.id)) layer.id = _chunkJYV4R62Mcjs.newLayerId.call(void 0, "adj");
7790
7817
  const { width, height } = this.naturalSize;
7791
7818
  this.recordHistory();
7792
- const node = _chunkX2KQQZBTcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
7819
+ const node = _chunkJYV4R62Mcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
7793
7820
  const positioned = Boolean(spec.aboveId || spec.parentId);
7794
7821
  this.state.layers = this.placeLayer(this.state.layers, node, {
7795
7822
  aboveId: spec.aboveId,
@@ -7809,7 +7836,7 @@ var ImageEditorController = (_class10 = class {
7809
7836
  if (!loc || loc.layer.type !== "adjustment") return false;
7810
7837
  const { width, height } = this.naturalSize;
7811
7838
  const node = loc.layer;
7812
- const merged = _chunkX2KQQZBTcjs.normalizeAdjustmentLayer.call(void 0, {
7839
+ const merged = _chunkJYV4R62Mcjs.normalizeAdjustmentLayer.call(void 0, {
7813
7840
  id: node.id,
7814
7841
  kind: node.kind,
7815
7842
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -7829,7 +7856,7 @@ var ImageEditorController = (_class10 = class {
7829
7856
  params: merged.params
7830
7857
  };
7831
7858
  if (update.mask !== void 0) {
7832
- const mask = update.mask ? _chunkX2KQQZBTcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
7859
+ const mask = update.mask ? _chunkJYV4R62Mcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
7833
7860
  if (mask) next.mask = mask;
7834
7861
  else delete next.mask;
7835
7862
  }
@@ -7845,7 +7872,7 @@ var ImageEditorController = (_class10 = class {
7845
7872
  const prev = this.state.layers;
7846
7873
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, prev, id, () => null);
7847
7874
  if (this.state.activeLayerId === id) {
7848
- this.state.activeLayerId = _chunkX2KQQZBTcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, id);
7875
+ this.state.activeLayerId = _chunkJYV4R62Mcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, id);
7849
7876
  this.state.activeTarget = "pixels";
7850
7877
  }
7851
7878
  this.notify();
@@ -7891,7 +7918,7 @@ var ImageEditorController = (_class10 = class {
7891
7918
  this.state.layers = layers;
7892
7919
  const active = this.state.activeLayerId;
7893
7920
  if (active && nodes.some((n) => n.id === active)) {
7894
- this.state.activeLayerId = _chunkX2KQQZBTcjs.activeLayerAfterRemoval.call(void 0, prev, layers, active);
7921
+ this.state.activeLayerId = _chunkJYV4R62Mcjs.activeLayerAfterRemoval.call(void 0, prev, layers, active);
7895
7922
  this.state.activeTarget = "pixels";
7896
7923
  }
7897
7924
  this.notify();
@@ -7915,14 +7942,14 @@ var ImageEditorController = (_class10 = class {
7915
7942
  resizeCanvas(options) {
7916
7943
  const { width, height, anchor = "center" } = options;
7917
7944
  if (!Number.isFinite(width) || width < 1 || !Number.isFinite(height) || height < 1) {
7918
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Canvas width and height must be numbers at least 1 pixel.");
7945
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Canvas width and height must be numbers at least 1 pixel.");
7919
7946
  }
7920
7947
  const targetWidth = Math.round(width);
7921
7948
  const targetHeight = Math.round(height);
7922
7949
  const prev = this.naturalSize;
7923
7950
  if (prev.width === targetWidth && prev.height === targetHeight) return;
7924
7951
  this.recordHistory();
7925
- const [fx, fy] = _chunkX2KQQZBTcjs.ANCHOR_FRACTION[anchor];
7952
+ const [fx, fy] = _chunkJYV4R62Mcjs.ANCHOR_FRACTION[anchor];
7926
7953
  const dx = Math.round((targetWidth - prev.width) * fx);
7927
7954
  const dy = Math.round((targetHeight - prev.height) * fy);
7928
7955
  this.state.layers = this.state.layers.map((l) => {
@@ -7958,10 +7985,10 @@ var ImageEditorController = (_class10 = class {
7958
7985
  }
7959
7986
  }
7960
7987
  this.state.selection = normalizeSelection(
7961
- _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, targetWidth, targetHeight, nextData)
7988
+ _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, targetWidth, targetHeight, nextData)
7962
7989
  );
7963
7990
  }
7964
- this.state.layers = this.state.layers.map((l) => _chunkX2KQQZBTcjs.translateLayer.call(void 0, l, dx, dy));
7991
+ this.state.layers = this.state.layers.map((l) => _chunkJYV4R62Mcjs.translateLayer.call(void 0, l, dx, dy));
7965
7992
  this.docRevision++;
7966
7993
  this.notify();
7967
7994
  }
@@ -7986,8 +8013,8 @@ var ImageEditorController = (_class10 = class {
7986
8013
  const { width, height } = this.naturalSize;
7987
8014
  let next = null;
7988
8015
  if (mask) {
7989
- const sized = mask.width === width && mask.height === height ? mask : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, mask, width, height);
7990
- next = _chunkX2KQQZBTcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
8016
+ const sized = mask.width === width && mask.height === height ? mask : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, mask, width, height);
8017
+ next = _chunkJYV4R62Mcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
7991
8018
  } else if (mode !== "replace") {
7992
8019
  return false;
7993
8020
  }
@@ -8002,7 +8029,7 @@ var ImageEditorController = (_class10 = class {
8002
8029
  /** Select › All. */
8003
8030
  selectAll() {
8004
8031
  const { width, height } = this.naturalSize;
8005
- return this.setSelection(_chunkX2KQQZBTcjs.fullSelection.call(void 0, width, height));
8032
+ return this.setSelection(_chunkJYV4R62Mcjs.fullSelection.call(void 0, width, height));
8006
8033
  }
8007
8034
  /** Select › Deselect. */
8008
8035
  deselect() {
@@ -8057,14 +8084,14 @@ var ImageEditorController = (_class10 = class {
8057
8084
  return this.shapeCommand(mask, options);
8058
8085
  }
8059
8086
  layerTransparency(id) {
8060
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
8061
- if (!_chunkX2KQQZBTcjs.hasSurface.call(void 0, layer)) {
8062
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" has no pixels of its own; only pixel, shape, type and smart object layers do.`);
8087
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
8088
+ if (!_chunkJYV4R62Mcjs.hasSurface.call(void 0, layer)) {
8089
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" has no pixels of its own; only pixel, shape, type and smart object layers do.`);
8063
8090
  }
8064
8091
  const { width, height } = this.naturalSize;
8065
8092
  const out = new Uint8Array(width * height);
8066
8093
  const pixels = this.getLayerPixels(id);
8067
- if (!pixels) return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height, out);
8094
+ if (!pixels) return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, width, height, out);
8068
8095
  for (let y = 0; y < pixels.height; y++) {
8069
8096
  const dy = y + pixels.y;
8070
8097
  if (dy < 0 || dy >= height) continue;
@@ -8074,17 +8101,17 @@ var ImageEditorController = (_class10 = class {
8074
8101
  out[dy * width + dx] = pixels.data[(y * pixels.width + x) * 4 + 3];
8075
8102
  }
8076
8103
  }
8077
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height, out);
8104
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, width, height, out);
8078
8105
  }
8079
8106
  /** Select › Inverse (with nothing selected, selects everything). */
8080
8107
  invertSelection() {
8081
8108
  const { width, height } = this.naturalSize;
8082
- const current = _nullishCoalesce(this.state.selection, () => ( _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height)));
8083
- return this.setSelection(_chunkX2KQQZBTcjs.invertSelection.call(void 0, current));
8109
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, width, height)));
8110
+ return this.setSelection(_chunkJYV4R62Mcjs.invertSelection.call(void 0, current));
8084
8111
  }
8085
8112
  shapeCommand(mask, options) {
8086
- const feathered = options.feather && options.feather > 0 ? _chunkX2KQQZBTcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
8087
- const shaped = options.invert ? _chunkX2KQQZBTcjs.invertSelection.call(void 0, feathered) : feathered;
8113
+ const feathered = options.feather && options.feather > 0 ? _chunkJYV4R62Mcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
8114
+ const shaped = options.invert ? _chunkJYV4R62Mcjs.invertSelection.call(void 0, feathered) : feathered;
8088
8115
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
8089
8116
  }
8090
8117
  /** Rectangular marquee in natural image pixels. */
@@ -8138,11 +8165,11 @@ var ImageEditorController = (_class10 = class {
8138
8165
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
8139
8166
  return null;
8140
8167
  }
8141
- const legacy = _chunkX2KQQZBTcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
8168
+ const legacy = _chunkJYV4R62Mcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
8142
8169
  if (options.sample === "active-layer") {
8143
8170
  const layer = this.getActiveLayer();
8144
8171
  if (!layer || layer.type !== "pixel") {
8145
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
8172
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
8146
8173
  }
8147
8174
  const surface = layer.source === "document" && options.pixels ? _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
8148
8175
  return { width, height, data: _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -8151,7 +8178,7 @@ var ImageEditorController = (_class10 = class {
8151
8178
  this.syncViews();
8152
8179
  if (legacy && !options.pixels) {
8153
8180
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
8154
- _chunkX2KQQZBTcjs.applyAdjustments.call(void 0, copy, _chunkX2KQQZBTcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
8181
+ _chunkJYV4R62Mcjs.applyAdjustments.call(void 0, copy, _chunkJYV4R62Mcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
8155
8182
  return copy;
8156
8183
  }
8157
8184
  const pixels = options.pixels;
@@ -8163,7 +8190,7 @@ var ImageEditorController = (_class10 = class {
8163
8190
  };
8164
8191
  const stack = withoutAnnotations(this.state.layers);
8165
8192
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
8166
- const data = new (0, _chunkX2KQQZBTcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
8193
+ const data = new (0, _chunkJYV4R62Mcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
8167
8194
  return { width, height, data };
8168
8195
  }
8169
8196
  async requirePixels(options) {
@@ -8199,7 +8226,7 @@ var ImageEditorController = (_class10 = class {
8199
8226
  modifySelection(op, radius) {
8200
8227
  const sel = this.state.selection;
8201
8228
  if (!_optionalChain([sel, 'optionalAccess', _312 => _312.bounds])) return false;
8202
- return this.setSelection(_chunkX2KQQZBTcjs.modifySelection.call(void 0, sel, op, radius));
8229
+ return this.setSelection(_chunkJYV4R62Mcjs.modifySelection.call(void 0, sel, op, radius));
8203
8230
  }
8204
8231
  /**
8205
8232
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -8217,7 +8244,7 @@ var ImageEditorController = (_class10 = class {
8217
8244
  */
8218
8245
  async loadSelectionFromImage(source, options = {}) {
8219
8246
  const pixels = await this.decodeMaskImage(source);
8220
- this.setSelection(_chunkX2KQQZBTcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
8247
+ this.setSelection(_chunkJYV4R62Mcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
8221
8248
  return this.getSelection();
8222
8249
  }
8223
8250
  /**
@@ -8225,9 +8252,9 @@ var ImageEditorController = (_class10 = class {
8225
8252
  * channel, read like `loadSelectionFromImage`. The selection does not change. One undo step.
8226
8253
  */
8227
8254
  async loadChannelFromImage(source, options = {}) {
8228
- const mask = _chunkX2KQQZBTcjs.selectionFromPixels.call(void 0, await this.decodeMaskImage(source), options);
8255
+ const mask = _chunkJYV4R62Mcjs.selectionFromPixels.call(void 0, await this.decodeMaskImage(source), options);
8229
8256
  const { width, height } = this.naturalSize;
8230
- return this.addChannel(mask.width === width && mask.height === height ? mask : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, mask, width, height), options.name);
8257
+ return this.addChannel(mask.width === width && mask.height === height ? mask : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, mask, width, height), options.name);
8231
8258
  }
8232
8259
  /**
8233
8260
  * A full-size greyscale PNG (white = selected / revealed) of the selection, an alpha channel or
@@ -8238,19 +8265,19 @@ var ImageEditorController = (_class10 = class {
8238
8265
  let mask;
8239
8266
  if (source === "selection") {
8240
8267
  const sel = this.state.selection;
8241
- if (!_optionalChain([sel, 'optionalAccess', _314 => _314.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
8268
+ if (!_optionalChain([sel, 'optionalAccess', _314 => _314.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
8242
8269
  mask = sel;
8243
8270
  } else if ("channelId" in source) {
8244
8271
  mask = this.requireChannel(source.channelId).mask;
8245
8272
  } else {
8246
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, source.layerId).layer;
8273
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, source.layerId).layer;
8247
8274
  const coverage = this.layerMaskCoverage(source.layerId);
8248
- if (!coverage) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || source.layerId}" has no painted mask to export.`);
8275
+ if (!coverage) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || source.layerId}" has no painted mask to export.`);
8249
8276
  mask = coverage;
8250
8277
  }
8251
8278
  const k = options.maxSide ? Math.min(1, options.maxSide / Math.max(mask.width, mask.height)) : 1;
8252
- if (k < 1) mask = _chunkX2KQQZBTcjs.resizeSelection.call(void 0, mask, Math.max(1, Math.round(mask.width * k)), Math.max(1, Math.round(mask.height * k)));
8253
- if (options.invert) mask = _chunkX2KQQZBTcjs.invertSelection.call(void 0, mask);
8279
+ if (k < 1) mask = _chunkJYV4R62Mcjs.resizeSelection.call(void 0, mask, Math.max(1, Math.round(mask.width * k)), Math.max(1, Math.round(mask.height * k)));
8280
+ if (options.invert) mask = _chunkJYV4R62Mcjs.invertSelection.call(void 0, mask);
8254
8281
  return { width: mask.width, height: mask.height, dataUrl: _chunkCWM3CUUXcjs.pngDataUrl.call(void 0, mask.width, mask.height, mask.data, 1) };
8255
8282
  }
8256
8283
  /** A mask image (data URL / URL, or pixels as they are) as RGBA pixels. */
@@ -8336,7 +8363,7 @@ var ImageEditorController = (_class10 = class {
8336
8363
  const channel = this.getChannel(id);
8337
8364
  if (!channel) {
8338
8365
  const ids = this.getChannels().map((c) => `${c.id} (${c.name})`);
8339
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`There is no alpha channel "${id}"; the channels are ${ids.join(", ") || "none (save a selection first)"}.`);
8366
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`There is no alpha channel "${id}"; the channels are ${ids.join(", ") || "none (save a selection first)"}.`);
8340
8367
  }
8341
8368
  return channel;
8342
8369
  }
@@ -8359,13 +8386,13 @@ var ImageEditorController = (_class10 = class {
8359
8386
  */
8360
8387
  saveSelection(options = {}) {
8361
8388
  const sel = this.state.selection;
8362
- if (!_optionalChain([sel, 'optionalAccess', _330 => _330.bounds])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
8389
+ if (!_optionalChain([sel, 'optionalAccess', _330 => _330.bounds])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
8363
8390
  const { width, height } = this.naturalSize;
8364
- const sized = sel.width === width && sel.height === height ? sel : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, sel, width, height);
8391
+ const sized = sel.width === width && sel.height === height ? sel : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, sel, width, height);
8365
8392
  const channels = [...this.getChannels()];
8366
8393
  if (options.channelId !== void 0) {
8367
8394
  const existing = this.requireChannel(options.channelId);
8368
- const mask = _nullishCoalesce(_chunkX2KQQZBTcjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height)));
8395
+ const mask = _nullishCoalesce(_chunkJYV4R62Mcjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, width, height)));
8369
8396
  const next = { ...existing, mask, ..._optionalChain([options, 'access', _331 => _331.name, 'optionalAccess', _332 => _332.trim, 'call', _333 => _333()]) ? { name: options.name.trim() } : {} };
8370
8397
  this.setChannels(channels.map((c) => c.id === existing.id ? next : c));
8371
8398
  return next;
@@ -8393,16 +8420,16 @@ var ImageEditorController = (_class10 = class {
8393
8420
  */
8394
8421
  loadSelectionFromChannel(id, options = {}) {
8395
8422
  const channel = this.requireChannel(id);
8396
- const mask = options.invert ? _chunkX2KQQZBTcjs.invertSelection.call(void 0, channel.mask) : channel.mask;
8423
+ const mask = options.invert ? _chunkJYV4R62Mcjs.invertSelection.call(void 0, channel.mask) : channel.mask;
8397
8424
  return this.setSelection(mask.bounds ? mask : null, _nullishCoalesce(options.mode, () => ( "replace")));
8398
8425
  }
8399
8426
  /** Changes a channel's name, overlay colour, opacity, what it indicates or visibility (one undo step). */
8400
8427
  setChannelProperties(id, props) {
8401
8428
  const channel = this.requireChannel(id);
8402
- if (props.name !== void 0 && !props.name.trim()) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("A channel name cannot be empty.");
8403
- if (props.color !== void 0 && !/^#[0-9a-f]{6}$/i.test(props.color)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("color must be #rrggbb.");
8404
- if (props.opacity !== void 0 && !(props.opacity >= 0 && props.opacity <= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("opacity must be from 0 to 1.");
8405
- if (props.indicates !== void 0 && props.indicates !== "masked" && props.indicates !== "selected") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("indicates must be masked or selected.");
8429
+ if (props.name !== void 0 && !props.name.trim()) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("A channel name cannot be empty.");
8430
+ if (props.color !== void 0 && !/^#[0-9a-f]{6}$/i.test(props.color)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("color must be #rrggbb.");
8431
+ if (props.opacity !== void 0 && !(props.opacity >= 0 && props.opacity <= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("opacity must be from 0 to 1.");
8432
+ if (props.indicates !== void 0 && props.indicates !== "masked" && props.indicates !== "selected") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("indicates must be masked or selected.");
8406
8433
  const next = {
8407
8434
  ...channel,
8408
8435
  ...props.name !== void 0 ? { name: props.name.trim() } : {},
@@ -8454,35 +8481,18 @@ var ImageEditorController = (_class10 = class {
8454
8481
  const { width, height } = this.naturalSize;
8455
8482
  const sel = this.state.selection;
8456
8483
  if (!_optionalChain([sel, 'optionalAccess', _338 => _338.bounds])) return _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, 0);
8457
- const sized = sel.width === width && sel.height === height ? sel : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, sel, width, height);
8458
- return _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0);
8484
+ return (sel.width === width && sel.height === height ? sel : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, sel, width, height)).surface;
8459
8485
  }
8460
- /** The selection a painted Quick Mask surface stands for (`rects` changed since `base`). */
8461
- selectionFromSurface(surface, base = null, rects) {
8486
+ /** The selection a painted Quick Mask surface stands for (it shares the surface's tiles). */
8487
+ selectionFromSurface(surface) {
8462
8488
  const { width, height } = this.naturalSize;
8463
- let data;
8464
- if (base && rects && base.width === width && base.height === height) {
8465
- data = new Uint8Array(base.data);
8466
- for (const r of rects) {
8467
- const x0 = Math.max(0, Math.floor(r.x));
8468
- const y0 = Math.max(0, Math.floor(r.y));
8469
- const x1 = Math.min(width, Math.ceil(r.x + r.width));
8470
- const y1 = Math.min(height, Math.ceil(r.y + r.height));
8471
- if (x1 <= x0 || y1 <= y0) continue;
8472
- const part = _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: x0, y: y0, width: x1 - x0, height: y1 - y0 });
8473
- for (let y = y0; y < y1; y++) data.set(part.subarray((y - y0) * (x1 - x0), (y - y0 + 1) * (x1 - x0)), y * width + x0);
8474
- }
8475
- } else {
8476
- const all = _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: 0, y: 0, width, height });
8477
- data = new Uint8Array(all.buffer, all.byteOffset, all.length);
8478
- }
8479
- return normalizeSelection(_chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height, data));
8489
+ return normalizeSelection(_chunkJYV4R62Mcjs.selectionFromTiles.call(void 0, width, height, surface));
8480
8490
  }
8481
8491
  // --- Layer masks ---
8482
8492
  maskFromSelection(sel, props = {}) {
8483
8493
  const { width, height } = this.naturalSize;
8484
- const sized = sel.width === width && sel.height === height ? sel : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, sel, width, height);
8485
- const mask = { surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
8494
+ const sized = sel.width === width && sel.height === height ? sel : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, sel, width, height);
8495
+ const mask = { surface: sized.surface, defaultValue: 0 };
8486
8496
  return withMaskProps(mask, props);
8487
8497
  }
8488
8498
  /**
@@ -8526,7 +8536,7 @@ var ImageEditorController = (_class10 = class {
8526
8536
  selectionFromLayerMask(layerId, mode = "replace", invert2 = false) {
8527
8537
  const sel = this.layerMaskCoverage(layerId);
8528
8538
  if (!sel) return false;
8529
- return this.setSelection(invert2 ? _chunkX2KQQZBTcjs.invertSelection.call(void 0, sel) : sel, mode);
8539
+ return this.setSelection(invert2 ? _chunkJYV4R62Mcjs.invertSelection.call(void 0, sel) : sel, mode);
8530
8540
  }
8531
8541
  /** A layer's painted mask over the canvas as a selection mask; null without one (or for a depth mask). */
8532
8542
  layerMaskCoverage(layerId) {
@@ -8536,7 +8546,7 @@ var ImageEditorController = (_class10 = class {
8536
8546
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
8537
8547
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
8538
8548
  const data = _chunkCWM3CUUXcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
8539
- return _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
8549
+ return _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
8540
8550
  }
8541
8551
  // --- Histogram ---
8542
8552
  /**
@@ -8565,9 +8575,9 @@ var ImageEditorController = (_class10 = class {
8565
8575
  merged.depthRange = [...merged.depthRange];
8566
8576
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
8567
8577
  const next = { ...l };
8568
- if (_chunkX2KQQZBTcjs.isDefaultDepthMask.call(void 0, merged)) {
8578
+ if (_chunkJYV4R62Mcjs.isDefaultDepthMask.call(void 0, merged)) {
8569
8579
  if (_optionalChain([next, 'access', _341 => _341.mask, 'optionalAccess', _342 => _342.source])) delete next.mask;
8570
- } else next.mask = _chunkX2KQQZBTcjs.depthRasterMask.call(void 0, merged);
8580
+ } else next.mask = _chunkJYV4R62Mcjs.depthRasterMask.call(void 0, merged);
8571
8581
  return next;
8572
8582
  });
8573
8583
  }
@@ -8588,7 +8598,7 @@ var ImageEditorController = (_class10 = class {
8588
8598
  // --- Annotations & Layers ---
8589
8599
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
8590
8600
  annotationLayer(id) {
8591
- return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkX2KQQZBTcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _345 => _345.id]) === id);
8601
+ return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkJYV4R62Mcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _345 => _345.id]) === id);
8592
8602
  }
8593
8603
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
8594
8604
  annotationEnv() {
@@ -8604,7 +8614,7 @@ var ImageEditorController = (_class10 = class {
8604
8614
  this.recordHistory();
8605
8615
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
8606
8616
  const fullAnnotation = { ...annotation, id };
8607
- const layer = _chunkX2KQQZBTcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
8617
+ const layer = _chunkJYV4R62Mcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
8608
8618
  const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
8609
8619
  this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _346 => _346.parent, 'optionalAccess', _347 => _347.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
8610
8620
  this.state.selectedAnnotationId = id;
@@ -8616,17 +8626,17 @@ var ImageEditorController = (_class10 = class {
8616
8626
  this.recordHistory();
8617
8627
  }
8618
8628
  const layer = this.annotationLayer(id);
8619
- const current = layer ? _chunkX2KQQZBTcjs.annotationOfLayer.call(void 0, layer) : null;
8629
+ const current = layer ? _chunkJYV4R62Mcjs.annotationOfLayer.call(void 0, layer) : null;
8620
8630
  if (layer && current) {
8621
8631
  const annotation = { ...current, ...partial, id };
8622
- const name = layer.name === _chunkX2KQQZBTcjs.annotationLayerName.call(void 0, current) ? _chunkX2KQQZBTcjs.annotationLayerName.call(void 0, annotation) : layer.name;
8632
+ const name = layer.name === _chunkJYV4R62Mcjs.annotationLayerName.call(void 0, current) ? _chunkJYV4R62Mcjs.annotationLayerName.call(void 0, annotation) : layer.name;
8623
8633
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
8624
8634
  }
8625
8635
  this.notify();
8626
8636
  }
8627
8637
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
8628
8638
  layerForAnnotation(layer, annotation, name) {
8629
- const fresh = _chunkX2KQQZBTcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
8639
+ const fresh = _chunkJYV4R62Mcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
8630
8640
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
8631
8641
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
8632
8642
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -8913,8 +8923,8 @@ var ImageEditorController = (_class10 = class {
8913
8923
  return;
8914
8924
  }
8915
8925
  const target = this.developLayer();
8916
- if (!target) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("There is no pixel layer to mask.");
8917
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, target, "all", "mask it");
8926
+ if (!target) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("There is no pixel layer to mask.");
8927
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, target, "all", "mask it");
8918
8928
  const { width, height } = this.naturalSize;
8919
8929
  let px2 = await this.decodeImage(newDataUrl);
8920
8930
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -8922,7 +8932,7 @@ var ImageEditorController = (_class10 = class {
8922
8932
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
8923
8933
  let surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
8924
8934
  if (target.offset.x || target.offset.y) surface = _chunkCWM3CUUXcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
8925
- this.commitLayers(_chunkX2KQQZBTcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
8935
+ this.commitLayers(_chunkJYV4R62Mcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
8926
8936
  return target.id;
8927
8937
  }
8928
8938
  // --- Type layers ---
@@ -8946,7 +8956,7 @@ var ImageEditorController = (_class10 = class {
8946
8956
  return _nullishCoalesce(_optionalChain([this, 'access', _354 => _354.getTextShaper, 'call', _355 => _355(), 'optionalAccess', _356 => _356.families, 'optionalCall', _357 => _357()]), () => ( ["sans-serif", "serif", "monospace"]));
8947
8957
  }
8948
8958
  typeInfo(id) {
8949
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8959
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8950
8960
  const ranges = (runs) => {
8951
8961
  let at = 0;
8952
8962
  return runs.map((r) => {
@@ -8989,25 +8999,25 @@ var ImageEditorController = (_class10 = class {
8989
8999
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
8990
9000
  */
8991
9001
  addTextLayer(init) {
8992
- const text = _chunkX2KQQZBTcjs.normalizeText.call(void 0, init.text);
8993
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("x and y must be numbers (document pixels).");
8994
- const style = _chunkX2KQQZBTcjs.patchTextStyle.call(void 0, { ..._chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
8995
- const paragraph = _chunkX2KQQZBTcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
9002
+ const text = _chunkJYV4R62Mcjs.normalizeText.call(void 0, init.text);
9003
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("x and y must be numbers (document pixels).");
9004
+ const style = _chunkJYV4R62Mcjs.patchTextStyle.call(void 0, { ..._chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
9005
+ const paragraph = _chunkJYV4R62Mcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
8996
9006
  let frame = { kind: "point" };
8997
9007
  if (init.box) {
8998
9008
  const { width, height } = init.box;
8999
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
9009
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
9000
9010
  frame = { kind: "box", width, height };
9001
9011
  }
9002
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("rotation must be a number of degrees.");
9003
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("opacity must be between 0 and 1.");
9004
- if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
9012
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("rotation must be a number of degrees.");
9013
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("opacity must be between 0 and 1.");
9014
+ if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
9005
9015
  const t = [1, 0, 0, 1, init.x, init.y];
9006
9016
  const transform = init.rotation ? _chunkEGZM52EOcjs.multiplyMatrices.call(void 0, t, _chunkEGZM52EOcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
9007
- const layer = _chunkX2KQQZBTcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkX2KQQZBTcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
9017
+ const layer = _chunkJYV4R62Mcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkJYV4R62Mcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
9008
9018
  if (init.opacity !== void 0) layer.opacity = init.opacity;
9009
9019
  if (init.blend !== void 0) layer.blend = init.blend;
9010
- const next = _chunkX2KQQZBTcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
9020
+ const next = _chunkJYV4R62Mcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
9011
9021
  this.commitLayers(next, () => {
9012
9022
  this.state.activeLayerId = layer.id;
9013
9023
  this.state.activeTarget = "pixels";
@@ -9019,28 +9029,28 @@ var ImageEditorController = (_class10 = class {
9019
9029
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
9020
9030
  */
9021
9031
  setText(id, text, range = {}, commitToHistory = true) {
9022
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9023
- const insert = _chunkX2KQQZBTcjs.normalizeText.call(void 0, text);
9024
- const [start, end] = _chunkX2KQQZBTcjs.textRange.call(void 0, layer.text, range.start, range.end);
9025
- const { layers } = _chunkX2KQQZBTcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkX2KQQZBTcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
9032
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9033
+ const insert = _chunkJYV4R62Mcjs.normalizeText.call(void 0, text);
9034
+ const [start, end] = _chunkJYV4R62Mcjs.textRange.call(void 0, layer.text, range.start, range.end);
9035
+ const { layers } = _chunkJYV4R62Mcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkJYV4R62Mcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
9026
9036
  this.commitLayers(layers, void 0, commitToHistory);
9027
9037
  return this.typeInfo(id);
9028
9038
  }
9029
9039
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
9030
9040
  setTextStyle(id, style, range = {}, commitToHistory = true) {
9031
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9032
- const [start, end] = _chunkX2KQQZBTcjs.textRange.call(void 0, layer.text, range.start, range.end);
9033
- if (!Object.keys(style).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give at least one style field to set.");
9034
- _chunkX2KQQZBTcjs.patchTextStyle.call(void 0, _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE, style);
9035
- const { layers } = _chunkX2KQQZBTcjs.updateTypeLayer.call(void 0,
9041
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9042
+ const [start, end] = _chunkJYV4R62Mcjs.textRange.call(void 0, layer.text, range.start, range.end);
9043
+ if (!Object.keys(style).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give at least one style field to set.");
9044
+ _chunkJYV4R62Mcjs.patchTextStyle.call(void 0, _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE, style);
9045
+ const { layers } = _chunkJYV4R62Mcjs.updateTypeLayer.call(void 0,
9036
9046
  this.state.layers,
9037
9047
  id,
9038
9048
  (l) => {
9039
9049
  if (start === end) {
9040
- if (l.text.length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
9041
- return { runs: [{ length: 0, style: _chunkX2KQQZBTcjs.patchTextStyle.call(void 0, _chunkEGZM52EOcjs.styleAt.call(void 0, l.runs, 0, _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE), style) }] };
9050
+ if (l.text.length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
9051
+ return { runs: [{ length: 0, style: _chunkJYV4R62Mcjs.patchTextStyle.call(void 0, _chunkEGZM52EOcjs.styleAt.call(void 0, l.runs, 0, _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE), style) }] };
9042
9052
  }
9043
- return { runs: _chunkEGZM52EOcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkX2KQQZBTcjs.patchTextStyle.call(void 0, s, style)) };
9053
+ return { runs: _chunkEGZM52EOcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkJYV4R62Mcjs.patchTextStyle.call(void 0, s, style)) };
9044
9054
  },
9045
9055
  this.textEnv(),
9046
9056
  "restyle its text"
@@ -9050,11 +9060,11 @@ var ImageEditorController = (_class10 = class {
9050
9060
  }
9051
9061
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
9052
9062
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
9053
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9054
- const [start, end] = _chunkX2KQQZBTcjs.textRange.call(void 0, layer.text, range.start, range.end);
9055
- if (!Object.keys(style).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give at least one paragraph field to set.");
9056
- _chunkX2KQQZBTcjs.patchParagraphStyle.call(void 0, {}, style);
9057
- const { layers } = _chunkX2KQQZBTcjs.updateTypeLayer.call(void 0,
9063
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9064
+ const [start, end] = _chunkJYV4R62Mcjs.textRange.call(void 0, layer.text, range.start, range.end);
9065
+ if (!Object.keys(style).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give at least one paragraph field to set.");
9066
+ _chunkJYV4R62Mcjs.patchParagraphStyle.call(void 0, {}, style);
9067
+ const { layers } = _chunkJYV4R62Mcjs.updateTypeLayer.call(void 0,
9058
9068
  this.state.layers,
9059
9069
  id,
9060
9070
  (l) => {
@@ -9063,7 +9073,7 @@ var ImageEditorController = (_class10 = class {
9063
9073
  const a = at;
9064
9074
  at += p.length;
9065
9075
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
9066
- return touches || !l.text.length ? { length: p.length, style: _chunkX2KQQZBTcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
9076
+ return touches || !l.text.length ? { length: p.length, style: _chunkJYV4R62Mcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
9067
9077
  });
9068
9078
  return { paragraphs };
9069
9079
  },
@@ -9079,21 +9089,21 @@ var ImageEditorController = (_class10 = class {
9079
9089
  * paragraph. Also resizes a box. One undo step.
9080
9090
  */
9081
9091
  setTextFrame(id, frame, commitToHistory = true) {
9082
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9083
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("width and height must be at least 1 pixel.");
9084
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("kind must be point or box.");
9092
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9093
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("width and height must be at least 1 pixel.");
9094
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("kind must be point or box.");
9085
9095
  const shaper = this.getTextShaper();
9086
- const { layers } = _chunkX2KQQZBTcjs.updateTypeLayer.call(void 0,
9096
+ const { layers } = _chunkJYV4R62Mcjs.updateTypeLayer.call(void 0,
9087
9097
  this.state.layers,
9088
9098
  id,
9089
9099
  (l) => {
9090
9100
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
9091
- if (!shaper) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
9101
+ if (!shaper) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
9092
9102
  const lines = _chunkEGZM52EOcjs.layoutText.call(void 0, l, shaper).lines;
9093
9103
  const first = lines[0];
9094
9104
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
9095
9105
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
9096
- const m = _chunkX2KQQZBTcjs.textMatrix.call(void 0, l);
9106
+ const m = _chunkJYV4R62Mcjs.textMatrix.call(void 0, l);
9097
9107
  const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
9098
9108
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
9099
9109
  return { frame: nextFrame, transform: shifted };
@@ -9110,13 +9120,13 @@ var ImageEditorController = (_class10 = class {
9110
9120
  * `warnings` says when other colours were dropped. One undo step.
9111
9121
  */
9112
9122
  convertTextToShape(id) {
9113
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9114
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
9123
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9124
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
9115
9125
  const shaper = this.getTextShaper();
9116
- if (!shaper) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
9117
- const parts = _chunkX2KQQZBTcjs.textOutlines.call(void 0, layer, shaper);
9126
+ if (!shaper) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
9127
+ const parts = _chunkJYV4R62Mcjs.textOutlines.call(void 0, layer, shaper);
9118
9128
  const subpaths = parts.flatMap((p) => _chunkEGZM52EOcjs.bezierToSubpaths.call(void 0, p.path));
9119
- if (!subpaths.length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
9129
+ if (!subpaths.length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
9120
9130
  const warnings = [];
9121
9131
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
9122
9132
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
@@ -9124,7 +9134,7 @@ var ImageEditorController = (_class10 = class {
9124
9134
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
9125
9135
  const first = _nullishCoalesce(_optionalChain([layer, 'access', _358 => _358.runs, 'access', _359 => _359.find, 'call', _360 => _360((r) => r.length > 0), 'optionalAccess', _361 => _361.style]), () => ( _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE));
9126
9136
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
9127
- const shape = _chunkX2KQQZBTcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
9137
+ const shape = _chunkJYV4R62Mcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
9128
9138
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
9129
9139
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
9130
9140
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -9132,23 +9142,23 @@ var ImageEditorController = (_class10 = class {
9132
9142
  }
9133
9143
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
9134
9144
  getTextLayout(id) {
9135
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9145
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9136
9146
  const shaper = this.getTextShaper();
9137
9147
  return shaper ? _chunkEGZM52EOcjs.layoutText.call(void 0, layer, shaper) : null;
9138
9148
  }
9139
9149
  /** The text index nearest a document point (for clicks on a type layer). */
9140
9150
  textIndexAt(id, point) {
9141
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9151
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9142
9152
  const layout = this.getTextLayout(id);
9143
- return layout ? _chunkEGZM52EOcjs.textIndexAt.call(void 0, layout, _chunkX2KQQZBTcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
9153
+ return layout ? _chunkEGZM52EOcjs.textIndexAt.call(void 0, layout, _chunkJYV4R62Mcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
9144
9154
  }
9145
9155
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
9146
9156
  textCaret(id, index) {
9147
- const layer = _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9157
+ const layer = _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, this.state.layers, id);
9148
9158
  const layout = this.getTextLayout(id);
9149
9159
  if (!layout) return null;
9150
9160
  const c = _chunkEGZM52EOcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
9151
- const m = _chunkX2KQQZBTcjs.textMatrix.call(void 0, layer);
9161
+ const m = _chunkJYV4R62Mcjs.textMatrix.call(void 0, layer);
9152
9162
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
9153
9163
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
9154
9164
  }
@@ -9159,14 +9169,14 @@ var ImageEditorController = (_class10 = class {
9159
9169
  }
9160
9170
  /** One component from tool or UI input (validated). */
9161
9171
  componentFrom(spec, path) {
9162
- const op = _chunkX2KQQZBTcjs.requireOperation.call(void 0, spec.op, `${path}op`);
9163
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
9164
- if (spec.shape !== void 0) return _chunkX2KQQZBTcjs.liveComponent.call(void 0, _chunkX2KQQZBTcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
9165
- if (spec.subpaths !== void 0) return { op, subpaths: _chunkX2KQQZBTcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
9166
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
9172
+ const op = _chunkJYV4R62Mcjs.requireOperation.call(void 0, spec.op, `${path}op`);
9173
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
9174
+ if (spec.shape !== void 0) return _chunkJYV4R62Mcjs.liveComponent.call(void 0, _chunkJYV4R62Mcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
9175
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkJYV4R62Mcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
9176
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
9167
9177
  }
9168
9178
  shapeInfo(id) {
9169
- const layer = _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9179
+ const layer = _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9170
9180
  const r = (n) => Math.round(n * 1e3) / 1e3;
9171
9181
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
9172
9182
  const info = {
@@ -9177,12 +9187,12 @@ var ImageEditorController = (_class10 = class {
9177
9187
  op: c.op,
9178
9188
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
9179
9189
  subpaths: _chunkEGZM52EOcjs.roundSubpaths.call(void 0, c.subpaths),
9180
- bounds: box(_chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
9190
+ bounds: box(_chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
9181
9191
  })),
9182
9192
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
9183
9193
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
9184
9194
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
9185
- geometryBounds: box(_chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, layer)),
9195
+ geometryBounds: box(_chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, layer)),
9186
9196
  bounds: this.getLayerBounds(id)
9187
9197
  };
9188
9198
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -9199,17 +9209,17 @@ var ImageEditorController = (_class10 = class {
9199
9209
  */
9200
9210
  addShapeLayer(init) {
9201
9211
  const specs = _optionalChain([init, 'access', _366 => _366.components, 'optionalAccess', _367 => _367.length]) ? init.components : [init];
9202
- if (_optionalChain([init, 'access', _368 => _368.components, 'optionalAccess', _369 => _369.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
9212
+ if (_optionalChain([init, 'access', _368 => _368.components, 'optionalAccess', _369 => _369.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
9203
9213
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _370 => _370.components, 'optionalAccess', _371 => _371.length]) ? `components[${i}].` : ""));
9204
- const stroke = init.stroke ? _chunkX2KQQZBTcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
9214
+ const stroke = init.stroke ? _chunkJYV4R62Mcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
9205
9215
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
9206
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkX2KQQZBTcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkX2KQQZBTcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
9207
- if (!fill && !stroke) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
9208
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
9209
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("opacity must be between 0 and 1.");
9210
- if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
9211
- const layer = _chunkX2KQQZBTcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
9212
- const next = _chunkX2KQQZBTcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
9216
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkJYV4R62Mcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkJYV4R62Mcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
9217
+ if (!fill && !stroke) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
9218
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
9219
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("opacity must be between 0 and 1.");
9220
+ if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
9221
+ const layer = _chunkJYV4R62Mcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
9222
+ const next = _chunkJYV4R62Mcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
9213
9223
  this.commitLayers(next, () => {
9214
9224
  this.state.activeLayerId = layer.id;
9215
9225
  this.state.activeTarget = "pixels";
@@ -9222,18 +9232,18 @@ var ImageEditorController = (_class10 = class {
9222
9232
  * only those settings of the current stroke. Returns the shape.
9223
9233
  */
9224
9234
  setShapeStyle(id, changes, commitToHistory = true) {
9225
- const layer = _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9226
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkX2KQQZBTcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
9227
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkX2KQQZBTcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
9228
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
9235
+ const layer = _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9236
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkJYV4R62Mcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
9237
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkJYV4R62Mcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
9238
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
9229
9239
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
9230
- const { layers } = _chunkX2KQQZBTcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
9240
+ const { layers } = _chunkJYV4R62Mcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
9231
9241
  this.commitLayers(layers, void 0, commitToHistory);
9232
9242
  return this.shapeInfo(id);
9233
9243
  }
9234
9244
  componentIndex(layer, index) {
9235
9245
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
9236
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
9246
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
9237
9247
  }
9238
9248
  return index;
9239
9249
  }
@@ -9243,36 +9253,36 @@ var ImageEditorController = (_class10 = class {
9243
9253
  * the live shape) or its operation. Returns the shape.
9244
9254
  */
9245
9255
  setShapeComponent(id, index, change, commitToHistory = true) {
9246
- const layer = _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9256
+ const layer = _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9247
9257
  const i = this.componentIndex(layer, index);
9248
9258
  const current = layer.components[i];
9249
9259
  let shape = change.shape;
9250
9260
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
9251
9261
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
9252
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkX2KQQZBTcjs.requireOperation.call(void 0, change.op) };
9262
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkJYV4R62Mcjs.requireOperation.call(void 0, change.op) };
9253
9263
  const components = layer.components.map((c, k) => k === i ? next : c);
9254
- const { layers } = _chunkX2KQQZBTcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
9264
+ const { layers } = _chunkJYV4R62Mcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
9255
9265
  this.commitLayers(layers, void 0, commitToHistory);
9256
9266
  return this.shapeInfo(id);
9257
9267
  }
9258
9268
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
9259
9269
  addShapeComponent(id, spec, index) {
9260
- const layer = _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9270
+ const layer = _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9261
9271
  const c = this.componentFrom(spec, "");
9262
9272
  const at = index === void 0 ? layer.components.length : index;
9263
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
9273
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
9264
9274
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
9265
- const { layers } = _chunkX2KQQZBTcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
9275
+ const { layers } = _chunkJYV4R62Mcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
9266
9276
  this.commitLayers(layers);
9267
9277
  return this.shapeInfo(id);
9268
9278
  }
9269
9279
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
9270
9280
  removeShapeComponent(id, index) {
9271
- const layer = _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9281
+ const layer = _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9272
9282
  const i = this.componentIndex(layer, index);
9273
- if (layer.components.length === 1) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
9283
+ if (layer.components.length === 1) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
9274
9284
  const components = layer.components.filter((_, k) => k !== i);
9275
- const { layers } = _chunkX2KQQZBTcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
9285
+ const { layers } = _chunkJYV4R62Mcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
9276
9286
  this.commitLayers(layers);
9277
9287
  return this.shapeInfo(id);
9278
9288
  }
@@ -9281,10 +9291,10 @@ var ImageEditorController = (_class10 = class {
9281
9291
  * shapes become paths), as one undo step. Returns the shape.
9282
9292
  */
9283
9293
  mergeShapeComponents(id) {
9284
- const layer = _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9285
- if (layer.components.length < 2) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
9286
- const components = _chunkX2KQQZBTcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
9287
- const { layers } = _chunkX2KQQZBTcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
9294
+ const layer = _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, this.state.layers, id);
9295
+ if (layer.components.length < 2) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
9296
+ const components = _chunkJYV4R62Mcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
9297
+ const { layers } = _chunkJYV4R62Mcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
9288
9298
  this.commitLayers(layers);
9289
9299
  return this.shapeInfo(id);
9290
9300
  }
@@ -9294,8 +9304,8 @@ var ImageEditorController = (_class10 = class {
9294
9304
  * step. Returns the layer id.
9295
9305
  */
9296
9306
  async rasterizeLayer(id) {
9297
- const layer = _chunkX2KQQZBTcjs.requireLayer.call(void 0, this.state.layers, id).layer;
9298
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
9307
+ const layer = _chunkJYV4R62Mcjs.requireLayer.call(void 0, this.state.layers, id).layer;
9308
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
9299
9309
  const { width, height } = this.naturalSize;
9300
9310
  const canvas = { x: 0, y: 0, width, height };
9301
9311
  let next;
@@ -9311,8 +9321,8 @@ var ImageEditorController = (_class10 = class {
9311
9321
  if (layer.locks) next.locks = layer.locks;
9312
9322
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
9313
9323
  } else if (layer.type === "pixel") {
9314
- if (!_optionalChain([layer, 'access', _372 => _372.filters, 'optionalAccess', _373 => _373.length])) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
9315
- _chunkX2KQQZBTcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
9324
+ if (!_optionalChain([layer, 'access', _372 => _372.filters, 'optionalAccess', _373 => _373.length])) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
9325
+ _chunkJYV4R62Mcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
9316
9326
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
9317
9327
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
9318
9328
  delete content.mask;
@@ -9329,10 +9339,10 @@ var ImageEditorController = (_class10 = class {
9329
9339
  } else if (layer.type === "smart") {
9330
9340
  return this.rasterizeSmartObject(id);
9331
9341
  } else if (layer.type === "shape" || layer.type === "type") {
9332
- next = layer.type === "shape" ? _chunkX2KQQZBTcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkX2KQQZBTcjs.typeAsPixelLayer.call(void 0, layer);
9342
+ next = layer.type === "shape" ? _chunkJYV4R62Mcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkJYV4R62Mcjs.typeAsPixelLayer.call(void 0, layer);
9333
9343
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _374 => _374.annotation, 'optionalAccess', _375 => _375.id])) this.state.selectedAnnotationId = null;
9334
9344
  } else {
9335
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
9345
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
9336
9346
  }
9337
9347
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
9338
9348
  return id;
@@ -9357,7 +9367,7 @@ var ImageEditorController = (_class10 = class {
9357
9367
  setColorMode(mode, options = {}) {
9358
9368
  let next;
9359
9369
  if (mode === "rgb") {
9360
- if (options.profile !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
9370
+ if (options.profile !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
9361
9371
  next = null;
9362
9372
  } else if (mode === "lab") next = { mode: "lab" };
9363
9373
  else if (mode === "cmyk") {
@@ -9365,14 +9375,14 @@ var ImageEditorController = (_class10 = class {
9365
9375
  try {
9366
9376
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
9367
9377
  } catch (e) {
9368
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9378
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9369
9379
  }
9370
9380
  const cs = resolveProfile(doc).colorSpace;
9371
- if (cs !== "cmyk") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
9381
+ if (cs !== "cmyk") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
9372
9382
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
9373
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
9383
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
9374
9384
  next = { mode: "cmyk", profile: doc, intent };
9375
- } else throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
9385
+ } else throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
9376
9386
  this.recordHistory();
9377
9387
  if (next) this.state.colorMode = next;
9378
9388
  else delete this.state.colorMode;
@@ -9385,10 +9395,10 @@ var ImageEditorController = (_class10 = class {
9385
9395
  try {
9386
9396
  doc = documentProfile(profile);
9387
9397
  } catch (e) {
9388
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9398
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9389
9399
  }
9390
9400
  const cs = resolveProfile(doc).colorSpace;
9391
- if (cs !== "rgb") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
9401
+ if (cs !== "rgb") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
9392
9402
  return doc;
9393
9403
  }
9394
9404
  /**
@@ -9414,7 +9424,7 @@ var ImageEditorController = (_class10 = class {
9414
9424
  convertToProfile(profile, options = {}) {
9415
9425
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
9416
9426
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
9417
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
9427
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
9418
9428
  const t = _chunkBROJYMWUcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
9419
9429
  const converted = [];
9420
9430
  const unconverted = [];
@@ -9444,11 +9454,11 @@ var ImageEditorController = (_class10 = class {
9444
9454
  else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
9445
9455
  else if (l.type === "shape") {
9446
9456
  const s = next2;
9447
- next2 = _chunkX2KQQZBTcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
9457
+ next2 = _chunkJYV4R62Mcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
9448
9458
  } else if (l.type === "type") {
9449
9459
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
9450
9460
  try {
9451
- next2 = _chunkX2KQQZBTcjs.rerenderText.call(void 0, recoloured, textEnv);
9461
+ next2 = _chunkJYV4R62Mcjs.rerenderText.call(void 0, recoloured, textEnv);
9452
9462
  } catch (e31) {
9453
9463
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
9454
9464
  }
@@ -9478,12 +9488,12 @@ var ImageEditorController = (_class10 = class {
9478
9488
  try {
9479
9489
  doc = documentProfile(setup.profile);
9480
9490
  } catch (e) {
9481
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9491
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9482
9492
  }
9483
9493
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
9484
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
9494
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
9485
9495
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
9486
- if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
9496
+ if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
9487
9497
  this.state.proofSetup = next;
9488
9498
  this.notify();
9489
9499
  return next;
@@ -9500,14 +9510,14 @@ var ImageEditorController = (_class10 = class {
9500
9510
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
9501
9511
  dst = resolveProfile(documentProfile(to));
9502
9512
  } catch (e) {
9503
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9513
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
9504
9514
  }
9505
- if (src.colorSpace !== "rgb") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
9515
+ if (src.colorSpace !== "rgb") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
9506
9516
  const t = _chunkBROJYMWUcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
9507
9517
  const toLab = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
9508
9518
  return colors.map((input) => {
9509
9519
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
9510
- if (!m) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
9520
+ if (!m) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
9511
9521
  const n = parseInt(m[1], 16);
9512
9522
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
9513
9523
  const out = new Float32Array(16);
@@ -9533,7 +9543,7 @@ var ImageEditorController = (_class10 = class {
9533
9543
  * the ids of the layers whose pixels changed.
9534
9544
  */
9535
9545
  setBitDepth(depth) {
9536
- if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
9546
+ if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
9537
9547
  const changed = [];
9538
9548
  const withMask = (l) => {
9539
9549
  const m = l.mask;
@@ -9582,7 +9592,7 @@ var ImageEditorController = (_class10 = class {
9582
9592
  * Throws `PsdError` for files that cannot be read at all.
9583
9593
  */
9584
9594
  loadPsd(bytes) {
9585
- const result = _chunkX2KQQZBTcjs.importPsd.call(void 0, bytes, { newId: () => _chunkX2KQQZBTcjs.newLayerId.call(void 0, ) });
9595
+ const result = _chunkJYV4R62Mcjs.importPsd.call(void 0, bytes, { newId: () => _chunkJYV4R62Mcjs.newLayerId.call(void 0, ) });
9586
9596
  this.abandonContents();
9587
9597
  this.recordHistory();
9588
9598
  const s = this.state;
@@ -9592,14 +9602,14 @@ var ImageEditorController = (_class10 = class {
9592
9602
  if (!this.samplePixelsOverride) this.samplePixels = null;
9593
9603
  s.layers = this.checkPsdFonts(result);
9594
9604
  s.crop = null;
9595
- s.transform = { ..._chunkX2KQQZBTcjs.DEFAULT_TRANSFORM_VALUES };
9605
+ s.transform = { ..._chunkJYV4R62Mcjs.DEFAULT_TRANSFORM_VALUES };
9596
9606
  s.outputOpacity = 1;
9597
9607
  delete s.legacyOutputBlur;
9598
9608
  s.selection = null;
9599
9609
  const psdChannels = (_nullishCoalesce(result.alphaChannels, () => ( []))).map((c, k) => ({
9600
9610
  id: `ch_${k + 1}`,
9601
9611
  name: c.name,
9602
- mask: _chunkX2KQQZBTcjs.createSelectionMask.call(void 0, result.width, result.height, c.data),
9612
+ mask: _chunkJYV4R62Mcjs.createSelectionMask.call(void 0, result.width, result.height, c.data),
9603
9613
  color: c.color,
9604
9614
  opacity: c.opacity,
9605
9615
  indicates: c.indicates,
@@ -9608,7 +9618,7 @@ var ImageEditorController = (_class10 = class {
9608
9618
  if (psdChannels.length) s.channels = psdChannels;
9609
9619
  else delete s.channels;
9610
9620
  s.selectedAnnotationId = null;
9611
- s.activeLayerId = _chunkX2KQQZBTcjs.defaultActiveLayerId.call(void 0, s.layers);
9621
+ s.activeLayerId = _chunkJYV4R62Mcjs.defaultActiveLayerId.call(void 0, s.layers);
9612
9622
  s.activeTarget = "pixels";
9613
9623
  this.psdResolution = result.resolution;
9614
9624
  if (result.patterns.length) s.patterns = result.patterns;
@@ -9681,7 +9691,7 @@ var ImageEditorController = (_class10 = class {
9681
9691
  const canRasterize = this.renderer.canRasterize();
9682
9692
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
9683
9693
  const sources = this.renderer.compositorSources(width, height);
9684
- const compositor = new (0, _chunkX2KQQZBTcjs.LayerCompositor)();
9694
+ const compositor = new (0, _chunkJYV4R62Mcjs.LayerCompositor)();
9685
9695
  const bakeMask = (layer) => {
9686
9696
  const mask = layer.mask;
9687
9697
  if (!_optionalChain([mask, 'optionalAccess', _386 => _386.source])) return mask;
@@ -9763,7 +9773,7 @@ var ImageEditorController = (_class10 = class {
9763
9773
  out.surface = this.surfaceOf(layer);
9764
9774
  delete out.source;
9765
9775
  }
9766
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _390 => _390.filters, 'optionalAccess', _391 => _391.filter, 'call', _392 => _392(_chunkX2KQQZBTcjs.isActiveFilter)]), () => ( []));
9776
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _390 => _390.filters, 'optionalAccess', _391 => _391.filter, 'call', _392 => _392(_chunkJYV4R62Mcjs.isActiveFilter)]), () => ( []));
9767
9777
  if (active.length) {
9768
9778
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
9769
9779
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -9796,15 +9806,15 @@ var ImageEditorController = (_class10 = class {
9796
9806
  const color = this.psdColorOptions(warnings);
9797
9807
  if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
9798
9808
  const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
9799
- const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkX2KQQZBTcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
9809
+ const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkJYV4R62Mcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
9800
9810
  const alphaChannels = this.getChannels().map((c) => ({
9801
9811
  name: c.name,
9802
- data: c.mask.width === width && c.mask.height === height ? c.mask.data : _chunkX2KQQZBTcjs.resizeSelection.call(void 0, c.mask, width, height).data,
9812
+ data: c.mask.width === width && c.mask.height === height ? c.mask.data : _chunkJYV4R62Mcjs.resizeSelection.call(void 0, c.mask, width, height).data,
9803
9813
  color: c.color,
9804
9814
  opacity: c.opacity,
9805
9815
  indicates: c.indicates
9806
9816
  }));
9807
- const result = _chunkX2KQQZBTcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, alphaChannels, ...color });
9817
+ const result = _chunkJYV4R62Mcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, alphaChannels, ...color });
9808
9818
  warnings.push(...result.warnings);
9809
9819
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
9810
9820
  }
@@ -9820,13 +9830,13 @@ var ImageEditorController = (_class10 = class {
9820
9830
  if (!this.samplePixelsOverride) this.samplePixels = null;
9821
9831
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
9822
9832
  this.state.selection = normalizeSelection(
9823
- _chunkX2KQQZBTcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
9833
+ _chunkJYV4R62Mcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
9824
9834
  );
9825
9835
  }
9826
9836
  let layers = this.state.layers;
9827
9837
  if (sx !== 1 || sy !== 1) {
9828
9838
  if (this.state.crop) {
9829
- this.state.crop = _chunkX2KQQZBTcjs.clampCropToImage.call(void 0,
9839
+ this.state.crop = _chunkJYV4R62Mcjs.clampCropToImage.call(void 0,
9830
9840
  {
9831
9841
  x: Math.round(this.state.crop.x * sx),
9832
9842
  y: Math.round(this.state.crop.y * sy),
@@ -9845,17 +9855,17 @@ var ImageEditorController = (_class10 = class {
9845
9855
  } else if (l.type === "shape") {
9846
9856
  const a = l.annotation;
9847
9857
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
9848
- const fromAnnotation = scaled ? _chunkX2KQQZBTcjs.shapeFromAnnotation.call(void 0, scaled) : null;
9858
+ const fromAnnotation = scaled ? _chunkJYV4R62Mcjs.shapeFromAnnotation.call(void 0, scaled) : null;
9849
9859
  const m = [sx, 0, 0, sy, 0, 0];
9850
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _400 => _400.components]), () => ( _chunkX2KQQZBTcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
9860
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _400 => _400.components]), () => ( _chunkJYV4R62Mcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
9851
9861
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
9852
9862
  if (scaled && fromAnnotation) moved.annotation = scaled;
9853
9863
  else delete moved.annotation;
9854
- layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkX2KQQZBTcjs.rerenderShape.call(void 0, moved, env));
9864
+ layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkJYV4R62Mcjs.rerenderShape.call(void 0, moved, env));
9855
9865
  }
9856
9866
  }
9857
9867
  }
9858
- const bg = _chunkX2KQQZBTcjs.developTarget.call(void 0, layers, null);
9868
+ const bg = _chunkJYV4R62Mcjs.developTarget.call(void 0, layers, null);
9859
9869
  if (bg && bg.source !== "document") layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
9860
9870
  if (clearAnnotations) {
9861
9871
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -9876,7 +9886,7 @@ var ImageEditorController = (_class10 = class {
9876
9886
  let out;
9877
9887
  try {
9878
9888
  out = this.serializeState();
9879
- if (_optionalChain([this, 'access', _404 => _404.state, 'access', _405 => _405.selection, 'optionalAccess', _406 => _406.bounds])) out.selection = _chunkX2KQQZBTcjs.serializeSelection.call(void 0, this.state.selection);
9889
+ if (_optionalChain([this, 'access', _404 => _404.state, 'access', _405 => _405.selection, 'optionalAccess', _406 => _406.bounds])) out.selection = _chunkJYV4R62Mcjs.serializeSelection.call(void 0, this.state.selection);
9880
9890
  if (_optionalChain([this, 'access', _407 => _407.state, 'access', _408 => _408.channels, 'optionalAccess', _409 => _409.length])) out.channels = serializeChannels(this.state.channels);
9881
9891
  } finally {
9882
9892
  if (root) {
@@ -9885,8 +9895,8 @@ var ImageEditorController = (_class10 = class {
9885
9895
  this.viewKey = [];
9886
9896
  }
9887
9897
  }
9888
- if (!options || out.version !== _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
9889
- return _chunkX2KQQZBTcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
9898
+ if (!options || out.version !== _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
9899
+ return _chunkJYV4R62Mcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
9890
9900
  }
9891
9901
  /**
9892
9902
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -9894,12 +9904,12 @@ var ImageEditorController = (_class10 = class {
9894
9904
  * out and listed in `lastLoadProblems`.
9895
9905
  */
9896
9906
  async loadJSONAsync(data, options = {}) {
9897
- if (data.version !== _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
9907
+ if (data.version !== _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
9898
9908
  this.loadJSON(data);
9899
9909
  return;
9900
9910
  }
9901
9911
  const problems = [];
9902
- const assets = await _chunkX2KQQZBTcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
9912
+ const assets = await _chunkJYV4R62Mcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
9903
9913
  this.loadJSON({ ...data, assets });
9904
9914
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
9905
9915
  }
@@ -9911,7 +9921,7 @@ var ImageEditorController = (_class10 = class {
9911
9921
  let selection = null;
9912
9922
  if (data.selection) {
9913
9923
  try {
9914
- selection = normalizeSelection(_chunkX2KQQZBTcjs.deserializeSelection.call(void 0, data.selection));
9924
+ selection = normalizeSelection(_chunkJYV4R62Mcjs.deserializeSelection.call(void 0, data.selection));
9915
9925
  } catch (e32) {
9916
9926
  selection = null;
9917
9927
  }
@@ -9934,8 +9944,8 @@ var ImageEditorController = (_class10 = class {
9934
9944
  if (isLayered(data)) {
9935
9945
  const problems = [];
9936
9946
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
9937
- const storedPatterns = _chunkX2KQQZBTcjs.deserializePatterns.call(void 0, data.patterns, []);
9938
- s.layers = _chunkX2KQQZBTcjs.deserializeLayers.call(void 0, data.layers, {
9947
+ const storedPatterns = _chunkJYV4R62Mcjs.deserializePatterns.call(void 0, data.patterns, []);
9948
+ s.layers = _chunkJYV4R62Mcjs.deserializeLayers.call(void 0, data.layers, {
9939
9949
  assets: _nullishCoalesce(data.assets, () => ( {})),
9940
9950
  problems,
9941
9951
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -9949,11 +9959,11 @@ var ImageEditorController = (_class10 = class {
9949
9959
  s.outputOpacity = data.opacity;
9950
9960
  if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
9951
9961
  else delete s.legacyOutputBlur;
9952
- s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : _chunkX2KQQZBTcjs.defaultActiveLayerId.call(void 0, s.layers);
9962
+ s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : _chunkJYV4R62Mcjs.defaultActiveLayerId.call(void 0, s.layers);
9953
9963
  const light = data.globalLight;
9954
9964
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
9955
9965
  else delete s.globalLight;
9956
- const patterns = _chunkX2KQQZBTcjs.deserializePatterns.call(void 0, data.patterns, problems);
9966
+ const patterns = _chunkJYV4R62Mcjs.deserializePatterns.call(void 0, data.patterns, problems);
9957
9967
  if (patterns.length) s.patterns = patterns;
9958
9968
  else delete s.patterns;
9959
9969
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -9969,14 +9979,14 @@ var ImageEditorController = (_class10 = class {
9969
9979
  }
9970
9980
  } else {
9971
9981
  const { width, height } = this.naturalSize;
9972
- const stack = _chunkX2KQQZBTcjs.layersFromLegacy.call(void 0, data, width, height);
9982
+ const stack = _chunkJYV4R62Mcjs.layersFromLegacy.call(void 0, data, width, height);
9973
9983
  s.layers = stack.layers;
9974
9984
  s.outputOpacity = stack.outputOpacity;
9975
9985
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
9976
9986
  else delete s.legacyOutputBlur;
9977
9987
  s.crop = data.crop ? { ...data.crop } : null;
9978
9988
  s.transform = { ...data.transform };
9979
- s.activeLayerId = _chunkX2KQQZBTcjs.defaultActiveLayerId.call(void 0, s.layers);
9989
+ s.activeLayerId = _chunkJYV4R62Mcjs.defaultActiveLayerId.call(void 0, s.layers);
9980
9990
  delete s.globalLight;
9981
9991
  delete s.patterns;
9982
9992
  delete s.bitDepth;
@@ -9990,7 +10000,7 @@ var ImageEditorController = (_class10 = class {
9990
10000
  }
9991
10001
  serializeState() {
9992
10002
  const { width, height } = this.naturalSize;
9993
- const view = _chunkX2KQQZBTcjs.legacyView.call(void 0, this.stack(), width, height, null);
10003
+ const view = _chunkJYV4R62Mcjs.legacyView.call(void 0, this.stack(), width, height, null);
9994
10004
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _410 => _410.state, 'access', _411 => _411.patterns, 'optionalAccess', _412 => _412.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
9995
10005
  return {
9996
10006
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -10005,9 +10015,9 @@ var ImageEditorController = (_class10 = class {
10005
10015
  annotations: JSON.parse(JSON.stringify(view.annotations))
10006
10016
  };
10007
10017
  }
10008
- const { layers, assets, smartContents } = _chunkX2KQQZBTcjs.serializeLayers.call(void 0, this.state.layers);
10018
+ const { layers, assets, smartContents } = _chunkJYV4R62Mcjs.serializeLayers.call(void 0, this.state.layers);
10009
10019
  const out = {
10010
- version: _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION,
10020
+ version: _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION,
10011
10021
  width,
10012
10022
  height,
10013
10023
  layers,
@@ -10019,7 +10029,7 @@ var ImageEditorController = (_class10 = class {
10019
10029
  };
10020
10030
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
10021
10031
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
10022
- if (_optionalChain([this, 'access', _416 => _416.state, 'access', _417 => _417.patterns, 'optionalAccess', _418 => _418.length])) out.patterns = _chunkX2KQQZBTcjs.serializePatterns.call(void 0, this.state.patterns);
10032
+ if (_optionalChain([this, 'access', _416 => _416.state, 'access', _417 => _417.patterns, 'optionalAccess', _418 => _418.length])) out.patterns = _chunkJYV4R62Mcjs.serializePatterns.call(void 0, this.state.patterns);
10023
10033
  if (smartContents) out.smartContents = smartContents;
10024
10034
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
10025
10035
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -10031,7 +10041,7 @@ function serializeAdjustments(adjustments) {
10031
10041
  const out = { ...adjustments };
10032
10042
  if (_optionalChain([out, 'access', _419 => _419.layers, 'optionalAccess', _420 => _420.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
10033
10043
  else delete out.layers;
10034
- if (_chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkX2KQQZBTcjs.LEGACY_PROCESS_VERSION) {
10044
+ if (_chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkJYV4R62Mcjs.LEGACY_PROCESS_VERSION) {
10035
10045
  delete out.process;
10036
10046
  if (!out.tint) delete out.tint;
10037
10047
  }
@@ -10042,7 +10052,7 @@ function withDevelop(layer, partial) {
10042
10052
  let i = filters.findIndex((f) => f.kind === "develop");
10043
10053
  if (i === -1) {
10044
10054
  filters.unshift({
10045
- id: layer.source === "document" ? _chunkX2KQQZBTcjs.DEVELOP_FILTER_ID : _chunkX2KQQZBTcjs.newLayerId.call(void 0, "flt"),
10055
+ id: layer.source === "document" ? _chunkJYV4R62Mcjs.DEVELOP_FILTER_ID : _chunkJYV4R62Mcjs.newLayerId.call(void 0, "flt"),
10046
10056
  kind: "develop",
10047
10057
  enabled: true,
10048
10058
  brightness: 0,
@@ -10051,7 +10061,7 @@ function withDevelop(layer, partial) {
10051
10061
  exposure: 0,
10052
10062
  temperature: 0,
10053
10063
  tint: 0,
10054
- process: _chunkX2KQQZBTcjs.LATEST_PROCESS_VERSION
10064
+ process: _chunkJYV4R62Mcjs.LATEST_PROCESS_VERSION
10055
10065
  });
10056
10066
  i = 0;
10057
10067
  }
@@ -10060,7 +10070,7 @@ function withDevelop(layer, partial) {
10060
10070
  const v = partial[k];
10061
10071
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
10062
10072
  }
10063
- if ("process" in partial) next.process = _chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, partial.process);
10073
+ if ("process" in partial) next.process = _chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, partial.process);
10064
10074
  filters[i] = next;
10065
10075
  return { ...layer, filters };
10066
10076
  }
@@ -10069,7 +10079,7 @@ function withBlur(layer, radius) {
10069
10079
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
10070
10080
  if (radius > 0) {
10071
10081
  filters.push({
10072
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _424 => _424.id]), () => ( (layer.source === "document" ? _chunkX2KQQZBTcjs.BLUR_FILTER_ID : _chunkX2KQQZBTcjs.newLayerId.call(void 0, "flt")))),
10082
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _424 => _424.id]), () => ( (layer.source === "document" ? _chunkJYV4R62Mcjs.BLUR_FILTER_ID : _chunkJYV4R62Mcjs.newLayerId.call(void 0, "flt")))),
10073
10083
  kind: "blur",
10074
10084
  enabled: true,
10075
10085
  radius
@@ -10093,7 +10103,7 @@ function mergeAdjustmentNode(node, update, width, height) {
10093
10103
  if (!update.mask) delete next.mask;
10094
10104
  else {
10095
10105
  const current = node.mask && !node.mask.source ? node.mask : null;
10096
- const memo = current ? _chunkX2KQQZBTcjs.legacyMaskOf.call(void 0, current, width, height) : null;
10106
+ const memo = current ? _chunkJYV4R62Mcjs.legacyMaskOf.call(void 0, current, width, height) : null;
10097
10107
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
10098
10108
  next.mask = withMaskProps(current, {
10099
10109
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -10101,7 +10111,7 @@ function mergeAdjustmentNode(node, update, width, height) {
10101
10111
  enabled: update.mask.enabled !== false
10102
10112
  });
10103
10113
  } else {
10104
- const m = _chunkX2KQQZBTcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
10114
+ const m = _chunkJYV4R62Mcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
10105
10115
  if (m) next.mask = m;
10106
10116
  else delete next.mask;
10107
10117
  }
@@ -10140,7 +10150,7 @@ function resizeLegacyMasks(layers, from, to) {
10140
10150
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
10141
10151
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
10142
10152
  const old = l.mask;
10143
- const mask = _chunkX2KQQZBTcjs.rasterMaskFromLegacy.call(void 0, _chunkX2KQQZBTcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
10153
+ const mask = _chunkJYV4R62Mcjs.rasterMaskFromLegacy.call(void 0, _chunkJYV4R62Mcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
10144
10154
  if (!mask) continue;
10145
10155
  out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
10146
10156
  }
@@ -10154,6 +10164,10 @@ function isOpaqueInside(surface, width, height) {
10154
10164
  }
10155
10165
  return true;
10156
10166
  }
10167
+ function collectSelectionTiles(selection, channels, into) {
10168
+ if (selection) _chunkCWM3CUUXcjs.collectTiles.call(void 0, selection.surface, into);
10169
+ for (const c of _nullishCoalesce(channels, () => ( []))) _chunkCWM3CUUXcjs.collectTiles.call(void 0, c.mask.surface, into);
10170
+ }
10157
10171
  function collectStateTiles(layers, into) {
10158
10172
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
10159
10173
  if (l.type === "pixel" && l.source !== "document") _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.surface, into);
@@ -10236,12 +10250,12 @@ function withoutAnnotations(layers) {
10236
10250
  function parseColor(value) {
10237
10251
  if (Array.isArray(value)) {
10238
10252
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
10239
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
10253
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
10240
10254
  }
10241
10255
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
10242
10256
  }
10243
10257
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
10244
- if (!m) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
10258
+ if (!m) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
10245
10259
  let hex = m[1];
10246
10260
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
10247
10261
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -10251,7 +10265,7 @@ function readImagePaint(raw) {
10251
10265
  try {
10252
10266
  return _chunkEBDCRTZIcjs.parsePaintSource.call(void 0, raw);
10253
10267
  } catch (e) {
10254
- if (e instanceof _chunkEBDCRTZIcjs.PaintSourceError) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(e.message);
10268
+ if (e instanceof _chunkEBDCRTZIcjs.PaintSourceError) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(e.message);
10255
10269
  throw e;
10256
10270
  }
10257
10271
  }
@@ -10448,7 +10462,7 @@ function loadImageEditorDocument(input) {
10448
10462
  // Optional: only present when something was selected when saving.
10449
10463
  selection: {
10450
10464
  parse: (value) => {
10451
- const mask = _chunkX2KQQZBTcjs.deserializeSelection.call(void 0, value);
10465
+ const mask = _chunkJYV4R62Mcjs.deserializeSelection.call(void 0, value);
10452
10466
  const v = value;
10453
10467
  return { width: mask.width, height: mask.height, rle: v.rle };
10454
10468
  },
@@ -10536,7 +10550,7 @@ function loadLayeredDocument(doc) {
10536
10550
  },
10537
10551
  selection: {
10538
10552
  parse: (value) => {
10539
- const mask = _chunkX2KQQZBTcjs.deserializeSelection.call(void 0, value);
10553
+ const mask = _chunkJYV4R62Mcjs.deserializeSelection.call(void 0, value);
10540
10554
  const v = value;
10541
10555
  return { width: mask.width, height: mask.height, rle: v.rle };
10542
10556
  },
@@ -11063,9 +11077,7 @@ var REFINE_EDGE_CONTROLS = [
11063
11077
  ];
11064
11078
  function describeSelection(mask) {
11065
11079
  if (!mask || !mask.bounds) return "No selection";
11066
- let sum = 0;
11067
- for (let i = 0; i < mask.data.length; i++) sum += mask.data[i];
11068
- const pct2 = sum / 255 / mask.data.length * 100;
11080
+ const pct2 = _chunkJYV4R62Mcjs.selectionArea.call(void 0, mask) / (mask.width * mask.height) * 100;
11069
11081
  const shown = pct2 >= 10 ? Math.round(pct2) : Math.round(pct2 * 10) / 10;
11070
11082
  return `${mask.bounds.width} \xD7 ${mask.bounds.height} px selected (${shown}% of the image)`;
11071
11083
  }
@@ -11073,7 +11085,7 @@ function describeSelection(mask) {
11073
11085
  // src/image-editor/selection-tools.ts
11074
11086
  var modeSchema = {
11075
11087
  type: "string",
11076
- enum: [..._chunkX2KQQZBTcjs.SELECTION_MODES],
11088
+ enum: [..._chunkJYV4R62Mcjs.SELECTION_MODES],
11077
11089
  description: "How the result combines with the current selection (default replace)."
11078
11090
  };
11079
11091
  var num2 = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
@@ -11098,7 +11110,7 @@ var rectProperties = {
11098
11110
  height: { type: "number", exclusiveMinimum: 0, description: "Height in natural image pixels." }
11099
11111
  };
11100
11112
  function shapeOptions(args) {
11101
- return { mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode), feather: num2(args.feather, 0), antiAlias: args.antiAlias !== false };
11113
+ return { mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode), feather: num2(args.feather, 0), antiAlias: args.antiAlias !== false };
11102
11114
  }
11103
11115
  function sampleOptions(args) {
11104
11116
  if (args.sample !== void 0 && args.sample !== "composite" && args.sample !== "active-layer") {
@@ -11115,7 +11127,7 @@ function rectOf(args) {
11115
11127
  function summary(controller) {
11116
11128
  const sel = controller.getSelection();
11117
11129
  const { width, height } = controller.getState().imageDimensions;
11118
- const area = _chunkX2KQQZBTcjs.selectionArea.call(void 0, sel);
11130
+ const area = _chunkJYV4R62Mcjs.selectionArea.call(void 0, sel);
11119
11131
  return {
11120
11132
  empty: !sel,
11121
11133
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _436 => _436.bounds]), () => ( null)),
@@ -11172,7 +11184,7 @@ function createImageSelectionTools(controller) {
11172
11184
  },
11173
11185
  annotations: writeAnnotations("Select a region", true),
11174
11186
  handler: ({ shape, x, y, width, height, points, mode, feather }) => {
11175
- const opts = { mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
11187
+ const opts = { mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
11176
11188
  switch (shape) {
11177
11189
  case "all":
11178
11190
  controller.selectAll();
@@ -11233,7 +11245,7 @@ function createImageSelectionTools(controller) {
11233
11245
  annotations: writeAnnotations("Select by colour", true),
11234
11246
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
11235
11247
  const common = {
11236
- mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, mode),
11248
+ mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, mode),
11237
11249
  sampleMerged: sampleMerged === true,
11238
11250
  sample: _nullishCoalesce(sample, () => ( "composite"))
11239
11251
  };
@@ -11254,7 +11266,7 @@ function createImageSelectionTools(controller) {
11254
11266
  inputSchema: {
11255
11267
  type: "object",
11256
11268
  properties: {
11257
- op: { type: "string", enum: [..._chunkX2KQQZBTcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
11269
+ op: { type: "string", enum: [..._chunkJYV4R62Mcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
11258
11270
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
11259
11271
  },
11260
11272
  required: ["op", "radius"],
@@ -11262,7 +11274,7 @@ function createImageSelectionTools(controller) {
11262
11274
  },
11263
11275
  annotations: writeAnnotations("Modify the selection"),
11264
11276
  handler: ({ op, radius }) => {
11265
- if (!_chunkX2KQQZBTcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
11277
+ if (!_chunkJYV4R62Mcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
11266
11278
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
11267
11279
  controller.modifySelection(op, Math.min(500, Math.max(0, num2(radius, 0))));
11268
11280
  return summary(controller);
@@ -11306,7 +11318,7 @@ function createImageSelectionTools(controller) {
11306
11318
  type: "object",
11307
11319
  properties: {
11308
11320
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
11309
- kind: { type: "string", enum: _chunkX2KQQZBTcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
11321
+ kind: { type: "string", enum: _chunkJYV4R62Mcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
11310
11322
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
11311
11323
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
11312
11324
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -11326,11 +11338,11 @@ function createImageSelectionTools(controller) {
11326
11338
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
11327
11339
  controller.applySelectionAsLayerMask(layerId, props);
11328
11340
  id = layerId;
11329
- } else if (_chunkX2KQQZBTcjs.isAdjustmentKind.call(void 0, kind)) {
11341
+ } else if (_chunkJYV4R62Mcjs.isAdjustmentKind.call(void 0, kind)) {
11330
11342
  id = controller.addAdjustmentLayer({
11331
11343
  kind,
11332
11344
  params,
11333
- mask: _chunkX2KQQZBTcjs.layerMaskFromSelection.call(void 0, sel, props)
11345
+ mask: _chunkJYV4R62Mcjs.layerMaskFromSelection.call(void 0, sel, props)
11334
11346
  });
11335
11347
  } else {
11336
11348
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -11517,7 +11529,7 @@ function createImageSelectionTools(controller) {
11517
11529
  handler: async (args) => {
11518
11530
  const hasSamples = Array.isArray(args.samples) && args.samples.length > 0;
11519
11531
  if (hasSamples === (args.preset !== void 0)) throw new Error("Pass samples (colours to match) or preset, not both.");
11520
- const common = { ...sampleOptions(args), mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode), feather: num2(args.feather, 0), invert: args.invert === true };
11532
+ const common = { ...sampleOptions(args), mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode), feather: num2(args.feather, 0), invert: args.invert === true };
11521
11533
  if (!hasSamples) {
11522
11534
  if (!isColorRangePreset(args.preset)) throw new Error(`Unknown preset "${String(args.preset)}". Use one of ${COLOR_RANGE_PRESETS.join(", ")}.`);
11523
11535
  await controller.selectColorRangePreset(args.preset, { ...common, falloff: num2(args.fuzziness, 20) });
@@ -11558,7 +11570,7 @@ function createImageSelectionTools(controller) {
11558
11570
  channel,
11559
11571
  invert: args.invert === true,
11560
11572
  threshold: typeof args.threshold === "number" ? Math.min(255, Math.max(0, args.threshold)) : void 0,
11561
- mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode)
11573
+ mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode)
11562
11574
  });
11563
11575
  return summary(controller);
11564
11576
  }
@@ -11584,7 +11596,7 @@ function createImageSelectionTools(controller) {
11584
11596
  if (!layer) throw new Error(`No layer "${id}". Call list_layers for ids.`);
11585
11597
  if (!layer.mask) throw new Error(`Layer "${id}" has no mask. Add one with add_layer_mask, or pick a layer with a mask.`);
11586
11598
  if (layer.mask.source) throw new Error(`Layer "${id}" has a computed (depth) mask, not a painted one, so it cannot be loaded as a selection.`);
11587
- controller.selectionFromLayerMask(id, _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode), args.invert === true);
11599
+ controller.selectionFromLayerMask(id, _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode), args.invert === true);
11588
11600
  return summary(controller);
11589
11601
  }
11590
11602
  };
@@ -11650,7 +11662,7 @@ function createImageSelectionTools(controller) {
11650
11662
  annotations: writeAnnotations("Select a single row or column", true),
11651
11663
  handler: (args) => {
11652
11664
  if (args.orientation !== "row" && args.orientation !== "column") throw new Error("orientation must be row or column.");
11653
- controller.selectLine(args.orientation, num2(args.position, NaN), { mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode) });
11665
+ controller.selectLine(args.orientation, num2(args.position, NaN), { mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode) });
11654
11666
  return summary(controller);
11655
11667
  }
11656
11668
  };
@@ -11684,7 +11696,7 @@ function createImageSelectionTools(controller) {
11684
11696
  handler: (args) => {
11685
11697
  const id = String(_nullishCoalesce(args.layerId, () => ( "")));
11686
11698
  if (!controller.getLayer(id)) throw new Error(`No layer "${id}". Call list_layers for ids.`);
11687
- controller.selectLayerTransparency(id, { mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode), feather: num2(args.feather, 0) });
11699
+ controller.selectLayerTransparency(id, { mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode), feather: num2(args.feather, 0) });
11688
11700
  return summary(controller);
11689
11701
  }
11690
11702
  };
@@ -11825,7 +11837,7 @@ function createImageSelectionTools(controller) {
11825
11837
  annotations: writeAnnotations("Save the selection to a channel"),
11826
11838
  handler: (args) => {
11827
11839
  if (!controller.getSelection()) throw new Error("Nothing is selected; select first, then save it.");
11828
- const c = controller.saveSelection({ channelId: args.channelId, name: args.name, mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode) });
11840
+ const c = controller.saveSelection({ channelId: args.channelId, name: args.name, mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode) });
11829
11841
  return { channel: channelResult(c.id) };
11830
11842
  }
11831
11843
  };
@@ -11841,7 +11853,7 @@ function createImageSelectionTools(controller) {
11841
11853
  },
11842
11854
  annotations: writeAnnotations("Load a selection from a channel", true),
11843
11855
  handler: (args) => {
11844
- controller.loadSelectionFromChannel(String(args.channelId), { mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, args.mode), invert: args.invert === true });
11856
+ controller.loadSelectionFromChannel(String(args.channelId), { mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, args.mode), invert: args.invert === true });
11845
11857
  return summary(controller);
11846
11858
  }
11847
11859
  };
@@ -12034,7 +12046,7 @@ function createImageSubjectSelectionTool(controller) {
12034
12046
  if (typeof target !== "string" || !target.trim()) throw new Error("target must describe what to select.");
12035
12047
  const perform = _optionalChain([context, 'optionalAccess', _442 => _442.perform]);
12036
12048
  const { segments } = await controller.selectSubject(target, {
12037
- mode: _chunkX2KQQZBTcjs.parseSelectionMode.call(void 0, mode),
12049
+ mode: _chunkJYV4R62Mcjs.parseSelectionMode.call(void 0, mode),
12038
12050
  feather: num2(feather, 0),
12039
12051
  maxSegments: typeof maxSegments === "number" ? Math.max(1, Math.round(maxSegments)) : void 0,
12040
12052
  signal: _optionalChain([context, 'optionalAccess', _443 => _443.signal]),
@@ -12184,11 +12196,11 @@ function createImageEditTools(controller) {
12184
12196
  const geometry2 = () => {
12185
12197
  const s = controller.getState();
12186
12198
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
12187
- const out = _chunkX2KQQZBTcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
12199
+ const out = _chunkJYV4R62Mcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
12188
12200
  return {
12189
12201
  image: { ...s.imageDimensions },
12190
12202
  crop: s.crop ? { ...s.crop } : null,
12191
- rotation: _chunkX2KQQZBTcjs.normalizeAngle.call(void 0, s.transform.rotate),
12203
+ rotation: _chunkJYV4R62Mcjs.normalizeAngle.call(void 0, s.transform.rotate),
12192
12204
  flipH: s.transform.flipH,
12193
12205
  flipV: s.transform.flipV,
12194
12206
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -12423,7 +12435,7 @@ function describeLayer(layer, activeId, boundsOf) {
12423
12435
  const out = {
12424
12436
  id: layer.id,
12425
12437
  type: layer.type,
12426
- name: layer.name || (layer.type === "adjustment" ? _chunkX2KQQZBTcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
12438
+ name: layer.name || (layer.type === "adjustment" ? _chunkJYV4R62Mcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
12427
12439
  visible: layer.visible,
12428
12440
  opacity: round3(layer.opacity),
12429
12441
  blend: layer.blend,
@@ -12512,8 +12524,8 @@ function createImageLayerTools(controller) {
12512
12524
  };
12513
12525
  };
12514
12526
  const exists = (id, what = "layerId") => {
12515
- if (typeof id !== "string" || !id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
12516
- _chunkX2KQQZBTcjs.requireLayer.call(void 0, controller.getLayers(), id);
12527
+ if (typeof id !== "string" || !id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
12528
+ _chunkJYV4R62Mcjs.requireLayer.call(void 0, controller.getLayers(), id);
12517
12529
  return id;
12518
12530
  };
12519
12531
  const listLayers = {
@@ -12549,7 +12561,7 @@ function createImageLayerTools(controller) {
12549
12561
  handler: ({ layerId, target }) => {
12550
12562
  const id = exists(layerId);
12551
12563
  const layer = controller.getLayer(id);
12552
- if (target === "mask" && !layer.mask) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
12564
+ if (target === "mask" && !layer.mask) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
12553
12565
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
12554
12566
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
12555
12567
  }
@@ -12574,7 +12586,7 @@ function createImageLayerTools(controller) {
12574
12586
  },
12575
12587
  annotations: { title: "Add a pixel layer", ...WRITE2 },
12576
12588
  handler: async (args) => {
12577
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give color or image, not both.");
12589
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give color or image, not both.");
12578
12590
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
12579
12591
  const init = {
12580
12592
  name: args.name,
@@ -12664,7 +12676,7 @@ function createImageLayerTools(controller) {
12664
12676
  const id = exists(args.layerId);
12665
12677
  const props = {};
12666
12678
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
12667
- if (!Object.keys(props).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give at least one property to change.");
12679
+ if (!Object.keys(props).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give at least one property to change.");
12668
12680
  controller.setLayerProperties(id, props);
12669
12681
  return { layer: describe(id) };
12670
12682
  }
@@ -12758,8 +12770,8 @@ function createImageLayerTools(controller) {
12758
12770
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
12759
12771
  handler: ({ layerId, x, y, dx, dy }) => {
12760
12772
  const id = exists(layerId);
12761
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give x and y, or dx and dy.");
12762
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
12773
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give x and y, or dx and dy.");
12774
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
12763
12775
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
12764
12776
  }
12765
12777
  };
@@ -12831,7 +12843,7 @@ function createImageLayerTools(controller) {
12831
12843
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
12832
12844
  handler: ({ layerId, density, feather, enabled, linked }) => {
12833
12845
  const id = exists(layerId);
12834
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give density, feather, enabled or linked.");
12846
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give density, feather, enabled or linked.");
12835
12847
  const mask = controller.setLayerMaskProps(id, {
12836
12848
  density,
12837
12849
  feather,
@@ -12914,7 +12926,7 @@ function createImageLayerTools(controller) {
12914
12926
  handler: (args) => {
12915
12927
  const id = exists(args.layerId);
12916
12928
  const changes = filterValues(args);
12917
- if (!Object.keys(changes).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give at least one value to change.");
12929
+ if (!Object.keys(changes).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give at least one value to change.");
12918
12930
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
12919
12931
  }
12920
12932
  };
@@ -13178,8 +13190,8 @@ function describeLayerEffects(effects) {
13178
13190
  }
13179
13191
  function createImageEffectTools(controller) {
13180
13192
  const layerArg = (id) => {
13181
- if (typeof id !== "string" || !id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
13182
- _chunkX2KQQZBTcjs.requireLayer.call(void 0, controller.getLayers(), id);
13193
+ if (typeof id !== "string" || !id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
13194
+ _chunkJYV4R62Mcjs.requireLayer.call(void 0, controller.getLayers(), id);
13183
13195
  return id;
13184
13196
  };
13185
13197
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -13210,7 +13222,7 @@ function createImageEffectTools(controller) {
13210
13222
  annotations: { title: "Add a layer effect", ...WRITE3 },
13211
13223
  handler: ({ layerId, kind, settings, index }) => {
13212
13224
  const id = layerArg(layerId);
13213
- if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
13225
+ if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
13214
13226
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
13215
13227
  return result(id, { effectId: effect.id });
13216
13228
  }
@@ -13230,7 +13242,7 @@ function createImageEffectTools(controller) {
13230
13242
  handler: ({ layerId, effectId, settings }) => {
13231
13243
  const id = layerArg(layerId);
13232
13244
  const changes = _nullishCoalesce(settings, () => ( {}));
13233
- if (!Object.keys(changes).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give at least one setting to change.");
13245
+ if (!Object.keys(changes).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give at least one setting to change.");
13234
13246
  controller.updateLayerEffect(id, effectId, changes);
13235
13247
  return result(id);
13236
13248
  }
@@ -13282,7 +13294,7 @@ function createImageEffectTools(controller) {
13282
13294
  },
13283
13295
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
13284
13296
  handler: ({ angle, altitude }) => {
13285
- if (angle === void 0 && altitude === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give angle, altitude or both.");
13297
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give angle, altitude or both.");
13286
13298
  const next = {};
13287
13299
  if (angle !== void 0) next.angle = angle;
13288
13300
  if (altitude !== void 0) next.altitude = altitude;
@@ -13498,7 +13510,7 @@ var PaintGesture = (_class11 = class {
13498
13510
  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.`);
13499
13511
  if (_optionalChain([layer, 'access', _457 => _457.locks, 'optionalAccess', _458 => _458.all]) || _optionalChain([layer, 'access', _459 => _459.locks, 'optionalAccess', _460 => _460.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
13500
13512
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
13501
- const b = _chunkX2KQQZBTcjs.shapeGeometryBounds.call(void 0, layer);
13513
+ const b = _chunkJYV4R62Mcjs.shapeGeometryBounds.call(void 0, layer);
13502
13514
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
13503
13515
  })();
13504
13516
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -13514,7 +13526,7 @@ var PaintGesture = (_class11 = class {
13514
13526
  return null;
13515
13527
  }
13516
13528
  } catch (err) {
13517
- this.error = _chunkX2KQQZBTcjs.userErrorMessage.call(void 0, err);
13529
+ this.error = _chunkJYV4R62Mcjs.userErrorMessage.call(void 0, err);
13518
13530
  this.stroke = null;
13519
13531
  this.move = null;
13520
13532
  }
@@ -13536,7 +13548,7 @@ var PaintGesture = (_class11 = class {
13536
13548
  this.controller.offsetLayer(m.id, { x, y }, !m.moved);
13537
13549
  m.moved = true;
13538
13550
  } catch (err) {
13539
- this.error = _chunkX2KQQZBTcjs.userErrorMessage.call(void 0, err);
13551
+ this.error = _chunkJYV4R62Mcjs.userErrorMessage.call(void 0, err);
13540
13552
  this.move = null;
13541
13553
  }
13542
13554
  }
@@ -13546,7 +13558,7 @@ var PaintGesture = (_class11 = class {
13546
13558
  try {
13547
13559
  this.stroke.end();
13548
13560
  } catch (err) {
13549
- this.error = _chunkX2KQQZBTcjs.userErrorMessage.call(void 0, err);
13561
+ this.error = _chunkJYV4R62Mcjs.userErrorMessage.call(void 0, err);
13550
13562
  }
13551
13563
  }
13552
13564
  this.stroke = null;
@@ -13656,9 +13668,9 @@ function createImagePaintTools(controller) {
13656
13668
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
13657
13669
  handler: (args) => {
13658
13670
  const tool = args.tool;
13659
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
13660
- if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
13661
- if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give color or paint, not both.");
13671
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
13672
+ if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
13673
+ if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give color or paint, not both.");
13662
13674
  const result = controller.paintStroke({
13663
13675
  tool,
13664
13676
  points: args.points,
@@ -13789,7 +13801,7 @@ function profileArg(v) {
13789
13801
  try {
13790
13802
  return _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, s.slice(4));
13791
13803
  } catch (e34) {
13792
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("The icc: value is not valid base64.");
13804
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("The icc: value is not valid base64.");
13793
13805
  }
13794
13806
  }
13795
13807
  return s;
@@ -13854,10 +13866,10 @@ function createImageColorTools(controller) {
13854
13866
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
13855
13867
  handler: (args) => {
13856
13868
  if (args.off === true) {
13857
- if (args.profile !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give either off true or a profile, not both.");
13869
+ if (args.profile !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give either off true or a profile, not both.");
13858
13870
  return controller.setProofSetup(null);
13859
13871
  }
13860
- if (args.profile === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
13872
+ if (args.profile === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
13861
13873
  const s = controller.setProofSetup({
13862
13874
  profile: profileArg(args.profile),
13863
13875
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -13909,7 +13921,7 @@ function createImageColorTools(controller) {
13909
13921
  },
13910
13922
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
13911
13923
  handler: (args) => {
13912
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
13924
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
13913
13925
  return controller.setColorMode(args.mode, {
13914
13926
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
13915
13927
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -13974,7 +13986,7 @@ function checkSource(controller, source) {
13974
13986
  const p = source;
13975
13987
  const { width, height } = controller.getState().imageDimensions;
13976
13988
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
13977
- throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
13989
+ throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
13978
13990
  }
13979
13991
  return p;
13980
13992
  }
@@ -14214,10 +14226,10 @@ function createImageRetouchTools(controller) {
14214
14226
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
14215
14227
  handler: (args) => {
14216
14228
  if (args.clear === true) {
14217
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give either clear true or x and y, not both.");
14229
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give either clear true or x and y, not both.");
14218
14230
  return controller.setCloneSource(null);
14219
14231
  }
14220
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
14232
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
14221
14233
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
14222
14234
  }
14223
14235
  };
@@ -14240,7 +14252,7 @@ function createImageRetouchTools(controller) {
14240
14252
  annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
14241
14253
  handler: (args) => {
14242
14254
  if (args.reset === true) {
14243
- if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give either reset true or transform values, not both.");
14255
+ if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give either reset true or transform values, not both.");
14244
14256
  return controller.setCloneTransform(null);
14245
14257
  }
14246
14258
  const cur = controller.getState().paint.cloneTransform;
@@ -14250,7 +14262,7 @@ function createImageRetouchTools(controller) {
14250
14262
  if (args.rotate !== void 0) next.rotate = args.rotate;
14251
14263
  if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
14252
14264
  if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
14253
- if (!Object.keys(next).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
14265
+ if (!Object.keys(next).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
14254
14266
  return controller.setCloneTransform(next);
14255
14267
  }
14256
14268
  };
@@ -14271,11 +14283,11 @@ var DATA = {
14271
14283
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
14272
14284
  };
14273
14285
  function psdBytesFromBase64(data) {
14274
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunkX2KQQZBTcjs.PsdError)("data is required: the PSD file as base64.");
14286
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkJYV4R62Mcjs.PsdError)("data is required: the PSD file as base64.");
14275
14287
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
14276
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkX2KQQZBTcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
14288
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkJYV4R62Mcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
14277
14289
  const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, body);
14278
- if (bytes.length < 26) throw new (0, _chunkX2KQQZBTcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
14290
+ if (bytes.length < 26) throw new (0, _chunkJYV4R62Mcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
14279
14291
  return bytes;
14280
14292
  }
14281
14293
  function createImagePsdTools(controller) {
@@ -14286,7 +14298,7 @@ function createImagePsdTools(controller) {
14286
14298
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
14287
14299
  annotations: { title: "Inspect a PSD", ...READ7 },
14288
14300
  handler: ({ data }) => {
14289
- const res = _chunkX2KQQZBTcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
14301
+ const res = _chunkJYV4R62Mcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
14290
14302
  return {
14291
14303
  width: res.width,
14292
14304
  height: res.height,
@@ -14373,7 +14385,7 @@ var GEOMETRY = {
14373
14385
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
14374
14386
  reference: {
14375
14387
  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}.",
14376
- anyOf: [{ type: "string", enum: _chunkX2KQQZBTcjs.TRANSFORM_ANCHORS }, POINT]
14388
+ anyOf: [{ type: "string", enum: _chunkJYV4R62Mcjs.TRANSFORM_ANCHORS }, POINT]
14377
14389
  },
14378
14390
  matrix: {
14379
14391
  type: "array",
@@ -14394,14 +14406,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
14394
14406
  function geometryFrom(args) {
14395
14407
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
14396
14408
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
14397
- if (ways === 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
14398
- if (ways > 1) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
14409
+ if (ways === 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
14410
+ if (ways > 1) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
14399
14411
  if (args.matrix !== void 0) return { matrix: args.matrix };
14400
14412
  if (args.corners !== void 0) return { corners: args.corners };
14401
14413
  const params = {};
14402
14414
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
14403
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
14404
- if (typeof params.reference === "string" && !_chunkX2KQQZBTcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkX2KQQZBTcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
14415
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
14416
+ if (typeof params.reference === "string" && !_chunkJYV4R62Mcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkJYV4R62Mcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
14405
14417
  return { params };
14406
14418
  }
14407
14419
  function targetFrom(args) {
@@ -14450,7 +14462,7 @@ function createImageTransformTools(controller) {
14450
14462
  moved: [...s.moves],
14451
14463
  frame: { ...s.box },
14452
14464
  corners: s.startGeometry.corners.map(roundPoint),
14453
- center: roundPoint(_chunkX2KQQZBTcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
14465
+ center: roundPoint(_chunkJYV4R62Mcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
14454
14466
  };
14455
14467
  if (s.smartObject) out.smartObject = true;
14456
14468
  s.cancel();
@@ -14505,11 +14517,11 @@ function createImageTransformTools(controller) {
14505
14517
  annotations: { title: "Warp a layer", ...WRITE6 },
14506
14518
  handler: (args) => {
14507
14519
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
14508
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
14509
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give a preset style or a mesh.");
14520
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
14521
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give a preset style or a mesh.");
14510
14522
  let warp;
14511
14523
  if (hasPreset) {
14512
- if (args.style === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkEGZM52EOcjs.WARP_STYLES.join(", ")}.`);
14524
+ if (args.style === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkEGZM52EOcjs.WARP_STYLES.join(", ")}.`);
14513
14525
  warp = {
14514
14526
  style: args.style,
14515
14527
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -14520,7 +14532,7 @@ function createImageTransformTools(controller) {
14520
14532
  } else {
14521
14533
  const m = args.mesh;
14522
14534
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
14523
- if (m.points.length !== want) throw new (0, _chunkX2KQQZBTcjs.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}.`);
14535
+ if (m.points.length !== want) throw new (0, _chunkJYV4R62Mcjs.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}.`);
14524
14536
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
14525
14537
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
14526
14538
  }
@@ -14615,13 +14627,13 @@ function settingsFrom(args) {
14615
14627
  return out;
14616
14628
  }
14617
14629
  function imageArg(image) {
14618
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
14630
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
14619
14631
  return image.trim();
14620
14632
  }
14621
14633
  function createImageSmartObjectTools(controller) {
14622
14634
  const smartId = (id) => {
14623
- if (typeof id !== "string" || !id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
14624
- _chunkX2KQQZBTcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
14635
+ if (typeof id !== "string" || !id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
14636
+ _chunkJYV4R62Mcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
14625
14637
  return id;
14626
14638
  };
14627
14639
  const info = (id) => {
@@ -14658,7 +14670,7 @@ function createImageSmartObjectTools(controller) {
14658
14670
  },
14659
14671
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
14660
14672
  handler: ({ layerIds, name }) => {
14661
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkX2KQQZBTcjs.requireLayer.call(void 0, controller.getLayers(), id2);
14673
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkJYV4R62Mcjs.requireLayer.call(void 0, controller.getLayers(), id2);
14662
14674
  const id = controller.convertToSmartObject(layerIds, { name });
14663
14675
  return { layer: layerSummary(id), smartObject: info(id) };
14664
14676
  }
@@ -14731,12 +14743,12 @@ function createImageSmartObjectTools(controller) {
14731
14743
  else if (w) {
14732
14744
  const m = w;
14733
14745
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
14734
- if (m.points.length !== want) throw new (0, _chunkX2KQQZBTcjs.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}.`);
14746
+ if (m.points.length !== want) throw new (0, _chunkJYV4R62Mcjs.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}.`);
14735
14747
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
14736
14748
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
14737
14749
  }
14738
14750
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
14739
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
14751
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
14740
14752
  const res = controller.setSmartObjectTransform(id, {
14741
14753
  corners: args.corners,
14742
14754
  matrix: args.matrix,
@@ -14863,7 +14875,7 @@ function createImageSmartObjectTools(controller) {
14863
14875
  handler: (args) => {
14864
14876
  const id = smartId(args.layerId);
14865
14877
  const changes = settingsFrom(args);
14866
- if (!Object.keys(changes).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give at least one value to change.");
14878
+ if (!Object.keys(changes).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give at least one value to change.");
14867
14879
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
14868
14880
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
14869
14881
  }
@@ -15184,8 +15196,8 @@ function geometry(args) {
15184
15196
  }
15185
15197
  function createImageShapeTools(controller) {
15186
15198
  const shapeId = (id) => {
15187
- if (typeof id !== "string" || !id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
15188
- _chunkX2KQQZBTcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
15199
+ if (typeof id !== "string" || !id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
15200
+ _chunkJYV4R62Mcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
15189
15201
  return id;
15190
15202
  };
15191
15203
  const layerSummary = (id) => {
@@ -15260,7 +15272,7 @@ function createImageShapeTools(controller) {
15260
15272
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
15261
15273
  handler: ({ layerId, fill, stroke, fillRule }) => {
15262
15274
  const id = shapeId(layerId);
15263
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
15275
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
15264
15276
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
15265
15277
  }
15266
15278
  };
@@ -15309,7 +15321,7 @@ function createImageShapeTools(controller) {
15309
15321
  handler: ({ layerId, componentIndex, ...rest }) => {
15310
15322
  const id = shapeId(layerId);
15311
15323
  const change = geometry(rest);
15312
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("Give shape, subpaths or op to change.");
15324
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("Give shape, subpaths or op to change.");
15313
15325
  return controller.setShapeComponent(id, componentIndex, change);
15314
15326
  }
15315
15327
  };
@@ -15383,8 +15395,8 @@ function pick2(args, keys) {
15383
15395
  }
15384
15396
  function createImageTypeTools(controller) {
15385
15397
  const typeId = (id) => {
15386
- if (typeof id !== "string" || !id) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
15387
- _chunkX2KQQZBTcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
15398
+ if (typeof id !== "string" || !id) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
15399
+ _chunkJYV4R62Mcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
15388
15400
  return id;
15389
15401
  };
15390
15402
  const layerSummary = (id) => {
@@ -15464,7 +15476,7 @@ function createImageTypeTools(controller) {
15464
15476
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
15465
15477
  handler: (args) => {
15466
15478
  const style = pick2(args, Object.keys(STYLE));
15467
- if (!Object.keys(style).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
15479
+ if (!Object.keys(style).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
15468
15480
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
15469
15481
  }
15470
15482
  };
@@ -15476,7 +15488,7 @@ function createImageTypeTools(controller) {
15476
15488
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
15477
15489
  handler: (args) => {
15478
15490
  const style = pick2(args, Object.keys(PARAGRAPH));
15479
- if (!Object.keys(style).length) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
15491
+ if (!Object.keys(style).length) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
15480
15492
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
15481
15493
  }
15482
15494
  };
@@ -15498,7 +15510,7 @@ function createImageTypeTools(controller) {
15498
15510
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
15499
15511
  handler: ({ layerId, kind, width, height }) => {
15500
15512
  const id = typeId(layerId);
15501
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkX2KQQZBTcjs.LayerOperationError)("kind box needs width and height in pixels.");
15513
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkJYV4R62Mcjs.LayerOperationError)("kind box needs width and height in pixels.");
15502
15514
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
15503
15515
  }
15504
15516
  };
@@ -15520,7 +15532,7 @@ function createImageTypeTools(controller) {
15520
15532
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
15521
15533
  function adjustmentsSummary(adjustments) {
15522
15534
  return {
15523
- process: _chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, adjustments.process),
15535
+ process: _chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, adjustments.process),
15524
15536
  values: readAdjustmentControls(adjustments),
15525
15537
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
15526
15538
  };
@@ -15563,7 +15575,7 @@ function createImageEditorToolProvider(controller, options = {}) {
15563
15575
  default: def,
15564
15576
  ...requiresProcess ? { requiresProcess } : {}
15565
15577
  })),
15566
- layerKinds: _chunkX2KQQZBTcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
15578
+ layerKinds: _chunkJYV4R62Mcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
15567
15579
  kind,
15568
15580
  label,
15569
15581
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -15649,7 +15661,7 @@ function createImageEditorToolProvider(controller, options = {}) {
15649
15661
  const result = { applied, clamped };
15650
15662
  if (typeof label === "string" && label) result.label = label;
15651
15663
  const notes = [];
15652
- if ("tint" in applied && _chunkX2KQQZBTcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
15664
+ if ("tint" in applied && _chunkJYV4R62Mcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
15653
15665
  notes.push("Tint has no effect on process 1 edits.");
15654
15666
  }
15655
15667
  if (notes.length) result.notes = notes;
@@ -15659,11 +15671,11 @@ function createImageEditorToolProvider(controller, options = {}) {
15659
15671
  const addLayer = {
15660
15672
  name: "add_adjustment_layer",
15661
15673
  title: "Add an adjustment layer",
15662
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it; with a selection it is masked by it (useSelection, default true; masked in the result says so). Kinds: " + _chunkX2KQQZBTcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
15674
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it; with a selection it is masked by it (useSelection, default true; masked in the result says so). Kinds: " + _chunkJYV4R62Mcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
15663
15675
  inputSchema: {
15664
15676
  type: "object",
15665
15677
  properties: {
15666
- kind: { type: "string", enum: _chunkX2KQQZBTcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
15678
+ kind: { type: "string", enum: _chunkJYV4R62Mcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
15667
15679
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
15668
15680
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
15669
15681
  blend: { type: "string", enum: _chunkCWM3CUUXcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -15683,7 +15695,7 @@ function createImageEditorToolProvider(controller, options = {}) {
15683
15695
  openWorldHint: false
15684
15696
  },
15685
15697
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId, useSelection }) => {
15686
- if (!_chunkX2KQQZBTcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
15698
+ if (!_chunkJYV4R62Mcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
15687
15699
  if (blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
15688
15700
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
15689
15701
  for (const ref of [aboveId, parentId]) {
@@ -15780,7 +15792,7 @@ function boxToCurvePoint(x, y, width, height) {
15780
15792
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
15781
15793
  }
15782
15794
  function curveSvgPath(points, width, height, samples = 64) {
15783
- const lut = _chunkX2KQQZBTcjs.curveLutFromLevels.call(void 0, points);
15795
+ const lut = _chunkJYV4R62Mcjs.curveLutFromLevels.call(void 0, points);
15784
15796
  const n = lut.length - 1;
15785
15797
  let d = "";
15786
15798
  for (let i = 0; i <= samples; i++) {
@@ -16274,7 +16286,7 @@ function layerPanelRows(layers, activeId) {
16274
16286
  }
16275
16287
  function layerLabel(layer) {
16276
16288
  if (layer.name) return layer.name;
16277
- if (layer.type === "adjustment") return _chunkX2KQQZBTcjs.adjustmentKindLabel.call(void 0, layer.kind);
16289
+ if (layer.type === "adjustment") return _chunkJYV4R62Mcjs.adjustmentKindLabel.call(void 0, layer.kind);
16278
16290
  return layer.type === "group" ? "Group" : "Layer";
16279
16291
  }
16280
16292
  function layerBadge(layer) {
@@ -16508,7 +16520,7 @@ function newLayerOptions(controller) {
16508
16520
  { id: "shape-ellipse", label: "Ellipse Shape", icon: "circle", group: "Shapes" },
16509
16521
  { id: "group", label: "Group Folder", icon: "folder", group: "Basic" }
16510
16522
  ];
16511
- for (const { kind, label } of _chunkX2KQQZBTcjs.ADJUSTMENT_KINDS) {
16523
+ for (const { kind, label } of _chunkJYV4R62Mcjs.ADJUSTMENT_KINDS) {
16512
16524
  options.push({
16513
16525
  id: `adjustment-${kind}`,
16514
16526
  label,
@@ -16582,7 +16594,7 @@ async function addLayerOfKind(controller, id, init) {
16582
16594
  }
16583
16595
  if (id.startsWith("adjustment-")) {
16584
16596
  const kind = id.slice("adjustment-".length);
16585
- if (_chunkX2KQQZBTcjs.isAdjustmentKind.call(void 0, kind)) {
16597
+ if (_chunkJYV4R62Mcjs.isAdjustmentKind.call(void 0, kind)) {
16586
16598
  return controller.addAdjustmentLayer({
16587
16599
  kind,
16588
16600
  useSelection: true,
@@ -16607,7 +16619,7 @@ function layerPanels(layer, options = {}) {
16607
16619
  effects();
16608
16620
  panels.push({ id: "paint", title: "Brush Options" });
16609
16621
  } else if (layer.type === "adjustment") {
16610
- panels.push({ id: "adjustment", title: _chunkX2KQQZBTcjs.adjustmentKindLabel.call(void 0, layer.kind) });
16622
+ panels.push({ id: "adjustment", title: _chunkJYV4R62Mcjs.adjustmentKindLabel.call(void 0, layer.kind) });
16611
16623
  } else if (layer.type === "type") {
16612
16624
  panels.push({ id: "type", title: "Typography" });
16613
16625
  effects();
@@ -17388,7 +17400,7 @@ var FreeTransformTool = (_class13 = class {
17388
17400
  bar() {
17389
17401
  const s = this.session;
17390
17402
  if (!s || !this.corners) return null;
17391
- const read = _chunkX2KQQZBTcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
17403
+ const read = _chunkJYV4R62Mcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
17392
17404
  return {
17393
17405
  affine: read.affine,
17394
17406
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -17413,7 +17425,7 @@ var FreeTransformTool = (_class13 = class {
17413
17425
  this.changed();
17414
17426
  return;
17415
17427
  }
17416
- const m = _chunkX2KQQZBTcjs.matrixFromParams.call(void 0, s.box, {
17428
+ const m = _chunkJYV4R62Mcjs.matrixFromParams.call(void 0, s.box, {
17417
17429
  scaleX: next.scaleX,
17418
17430
  scaleY: next.scaleY,
17419
17431
  rotate: next.rotate,
@@ -17423,7 +17435,7 @@ var FreeTransformTool = (_class13 = class {
17423
17435
  dx: next.x - this.refBox.x,
17424
17436
  dy: next.y - this.refBox.y
17425
17437
  });
17426
- this.setCorners(_chunkX2KQQZBTcjs.cornersFromMatrix.call(void 0, s.box, m));
17438
+ this.setCorners(_chunkJYV4R62Mcjs.cornersFromMatrix.call(void 0, s.box, m));
17427
17439
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
17428
17440
  this.changed();
17429
17441
  }
@@ -17493,7 +17505,7 @@ var FreeTransformTool = (_class13 = class {
17493
17505
  // src/image-editor/provider-effect-tools.ts
17494
17506
  var ANIMATE_SCHEMA = {
17495
17507
  type: "object",
17496
- properties: { duration: { type: "number", exclusiveMinimum: 0, maximum: _chunkX2KQQZBTcjs.MAX_EFFECT_ANIMATION_MS, description: `How long it plays in ms (at most ${_chunkX2KQQZBTcjs.MAX_EFFECT_ANIMATION_MS}).` } },
17508
+ properties: { duration: { type: "number", exclusiveMinimum: 0, maximum: _chunkJYV4R62Mcjs.MAX_EFFECT_ANIMATION_MS, description: `How long it plays in ms (at most ${_chunkJYV4R62Mcjs.MAX_EFFECT_ANIMATION_MS}).` } },
17497
17509
  required: ["duration"],
17498
17510
  additionalProperties: false,
17499
17511
  description: "Play when the document is output as an animation, for duration ms from time (the longest animating layer sets the animation's length)."
@@ -18664,4 +18676,7 @@ function createImageEditorDocument(controller, options = {}) {
18664
18676
 
18665
18677
 
18666
18678
 
18667
- exports.ADJUSTMENT_KEYS = _chunkX2KQQZBTcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkX2KQQZBTcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkX2KQQZBTcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkX2KQQZBTcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkX2KQQZBTcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkX2KQQZBTcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkX2KQQZBTcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkX2KQQZBTcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkV7GWZIZKcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkX2KQQZBTcjs.D50; exports.D65 = _chunkX2KQQZBTcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkEGZM52EOcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkX2KQQZBTcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkV7GWZIZKcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkX2KQQZBTcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkV7GWZIZKcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkX2KQQZBTcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkV7GWZIZKcjs.EX; exports.EY = _chunkV7GWZIZKcjs.EY; exports.FLAG_ALIVE = _chunkV7GWZIZKcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkV7GWZIZKcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkV7GWZIZKcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkV7GWZIZKcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkV7GWZIZKcjs.FLAG_TOP; exports.FLAG_WET = _chunkV7GWZIZKcjs.FLAG_WET; exports.FLAT = _chunkV7GWZIZKcjs.FLAT; exports.FREE_INTERVAL = _chunkV7GWZIZKcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkX2KQQZBTcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkV7GWZIZKcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkX2KQQZBTcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkX2KQQZBTcjs.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_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkX2KQQZBTcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkX2KQQZBTcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkX2KQQZBTcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkX2KQQZBTcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkX2KQQZBTcjs.LUMA_709; exports.LayerCompositor = _chunkX2KQQZBTcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkX2KQQZBTcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkV7GWZIZKcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkX2KQQZBTcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkX2KQQZBTcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkV7GWZIZKcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkV7GWZIZKcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkV7GWZIZKcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkX2KQQZBTcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkX2KQQZBTcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkV7GWZIZKcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkV7GWZIZKcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkX2KQQZBTcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkV7GWZIZKcjs.PARAM; exports.PARAM_FLOATS = _chunkV7GWZIZKcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkX2KQQZBTcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkV7GWZIZKcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkV7GWZIZKcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkV7GWZIZKcjs.PLANE; exports.PLANE_BYTES = _chunkV7GWZIZKcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkX2KQQZBTcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkV7GWZIZKcjs.P_D0; exports.P_EDGE = _chunkV7GWZIZKcjs.P_EDGE; exports.P_FX = _chunkV7GWZIZKcjs.P_FX; exports.P_FY = _chunkV7GWZIZKcjs.P_FY; exports.P_H = _chunkV7GWZIZKcjs.P_H; exports.P_P0 = _chunkV7GWZIZKcjs.P_P0; exports.P_RHO = _chunkV7GWZIZKcjs.P_RHO; exports.P_SW = _chunkV7GWZIZKcjs.P_SW; exports.P_UX = _chunkV7GWZIZKcjs.P_UX; exports.P_UY = _chunkV7GWZIZKcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkX2KQQZBTcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkX2KQQZBTcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkX2KQQZBTcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkV7GWZIZKcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkX2KQQZBTcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkX2KQQZBTcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkV7GWZIZKcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkV7GWZIZKcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkV7GWZIZKcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkX2KQQZBTcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkV7GWZIZKcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkV7GWZIZKcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkX2KQQZBTcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkX2KQQZBTcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkX2KQQZBTcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkX2KQQZBTcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkX2KQQZBTcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkX2KQQZBTcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkX2KQQZBTcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkV7GWZIZKcjs.U_MAX; exports.VIBRANCE_GREY = _chunkX2KQQZBTcjs.VIBRANCE_GREY; exports.W9 = _chunkV7GWZIZKcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkEGZM52EOcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkEGZM52EOcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkV7GWZIZKcjs.WET_TILE; exports.WGSL_HALO = _chunkV7GWZIZKcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkV7GWZIZKcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkV7GWZIZKcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkV7GWZIZKcjs.WetGpuEngine; exports.WetMedium = _chunkV7GWZIZKcjs.WetMedium; exports.WetWorkerPool = _chunkV7GWZIZKcjs.WetWorkerPool; exports.WetWorld = _chunkV7GWZIZKcjs.WetWorld; exports.WetWorldError = _chunkV7GWZIZKcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkX2KQQZBTcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkX2KQQZBTcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkX2KQQZBTcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkX2KQQZBTcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkX2KQQZBTcjs.activeSmartFilters; exports.addLayerEffect = _chunkX2KQQZBTcjs.addLayerEffect; exports.addLayerFilter = _chunkX2KQQZBTcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkX2KQQZBTcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkX2KQQZBTcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkX2KQQZBTcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkX2KQQZBTcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkX2KQQZBTcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkX2KQQZBTcjs.anchorPoint; exports.annotationBlend = _chunkX2KQQZBTcjs.annotationBlend; exports.annotationLayerFor = _chunkX2KQQZBTcjs.annotationLayerFor; exports.annotationLayerName = _chunkX2KQQZBTcjs.annotationLayerName; exports.annotationOfLayer = _chunkX2KQQZBTcjs.annotationOfLayer; exports.annotationOfShape = _chunkX2KQQZBTcjs.annotationOfShape; exports.annotationOfType = _chunkX2KQQZBTcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkX2KQQZBTcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkX2KQQZBTcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkX2KQQZBTcjs.applyAdjustments; exports.applyBoxBlur = _chunkX2KQQZBTcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkX2KQQZBTcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkX2KQQZBTcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkX2KQQZBTcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkX2KQQZBTcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkX2KQQZBTcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkX2KQQZBTcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkX2KQQZBTcjs.applyParams; exports.applyProcess2Adjustments = _chunkX2KQQZBTcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkX2KQQZBTcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkX2KQQZBTcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkX2KQQZBTcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkX2KQQZBTcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkX2KQQZBTcjs.blurFilter; exports.borderCoverage = _chunkX2KQQZBTcjs.borderCoverage; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunkX2KQQZBTcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkX2KQQZBTcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkX2KQQZBTcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkX2KQQZBTcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkX2KQQZBTcjs.calculateCropDrag; exports.canShareMemory = _chunkV7GWZIZKcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkX2KQQZBTcjs.canvasToImagePoint; exports.caretAt = _chunkEGZM52EOcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkX2KQQZBTcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkX2KQQZBTcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkX2KQQZBTcjs.combineSelections; exports.compileAdjustmentLayer = _chunkX2KQQZBTcjs.compileAdjustmentLayer; exports.componentPath = _chunkX2KQQZBTcjs.componentPath; exports.compositeDeep = _chunkX2KQQZBTcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkX2KQQZBTcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkX2KQQZBTcjs.contentsBox; exports.contentsSurface = _chunkX2KQQZBTcjs.contentsSurface; exports.contractCoverage = _chunkX2KQQZBTcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkX2KQQZBTcjs.convertToSmartObject; exports.copySmartObject = _chunkX2KQQZBTcjs.copySmartObject; exports.cornersFromMatrix = _chunkX2KQQZBTcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkX2KQQZBTcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkX2KQQZBTcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkEGZM52EOcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkEGZM52EOcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkEGZM52EOcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkV7GWZIZKcjs.createPigmentTools; exports.createSelectionMask = _chunkX2KQQZBTcjs.createSelectionMask; exports.createShapeLayer = _chunkX2KQQZBTcjs.createShapeLayer; exports.createTypeLayer = _chunkX2KQQZBTcjs.createTypeLayer; exports.createWetGpuEngine = _chunkV7GWZIZKcjs.createWetGpuEngine; exports.cssFont = _chunkEGZM52EOcjs.cssFont; exports.cssFontFamily = _chunkEGZM52EOcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkX2KQQZBTcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkX2KQQZBTcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkX2KQQZBTcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkX2KQQZBTcjs.decodeLayerMask; exports.decodeMergedImage = _chunkX2KQQZBTcjs.decodeMergedImage; exports.decodePlanes = _chunkX2KQQZBTcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkX2KQQZBTcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkX2KQQZBTcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkX2KQQZBTcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkX2KQQZBTcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkX2KQQZBTcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkX2KQQZBTcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkX2KQQZBTcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkX2KQQZBTcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkX2KQQZBTcjs.deserializeEffects; exports.deserializeLayer = _chunkX2KQQZBTcjs.deserializeLayer; exports.deserializeLayers = _chunkX2KQQZBTcjs.deserializeLayers; exports.deserializePatterns = _chunkX2KQQZBTcjs.deserializePatterns; exports.deserializeSelection = _chunkX2KQQZBTcjs.deserializeSelection; exports.developFilter = _chunkX2KQQZBTcjs.developFilter; exports.developFromAdjustments = _chunkX2KQQZBTcjs.developFromAdjustments; exports.developTarget = _chunkX2KQQZBTcjs.developTarget; exports.dexp = _chunkV7GWZIZKcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkX2KQQZBTcjs.distanceTransform; exports.dlog = _chunkV7GWZIZKcjs.dlog; exports.documentContents = _chunkX2KQQZBTcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkV7GWZIZKcjs.dpow; exports.dragWarpMeshPoint = _chunkEGZM52EOcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkV7GWZIZKcjs.dsincos; exports.duplicateLayer = _chunkX2KQQZBTcjs.duplicateLayer; exports.edgeBits = _chunkV7GWZIZKcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkX2KQQZBTcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkX2KQQZBTcjs.encodeRle; exports.encodeSelectionRle = _chunkX2KQQZBTcjs.encodeSelectionRle; exports.encodeSurface = _chunkX2KQQZBTcjs.encodeSurface; exports.evalWarpMesh = _chunkEGZM52EOcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkX2KQQZBTcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkV7GWZIZKcjs.expNeg; exports.expandCoverage = _chunkX2KQQZBTcjs.expandCoverage; exports.exportPsd = _chunkX2KQQZBTcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkX2KQQZBTcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkV7GWZIZKcjs.filmPixel; exports.filmReflectance = _chunkV7GWZIZKcjs.filmReflectance; exports.filterMaskCoverage = _chunkX2KQQZBTcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkV7GWZIZKcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkEGZM52EOcjs.fitParagraphRuns; exports.fitRuns = _chunkEGZM52EOcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkX2KQQZBTcjs.flattenPath; exports.flipCorners = _chunkX2KQQZBTcjs.flipCorners; exports.flowField = _chunkV7GWZIZKcjs.flowField; exports.fontOf = _chunkEGZM52EOcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkX2KQQZBTcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkX2KQQZBTcjs.geometryHomography; exports.getAnnotationBounds = _chunkX2KQQZBTcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkX2KQQZBTcjs.getCropCursor; exports.getRotatedSize = _chunkX2KQQZBTcjs.getRotatedSize; exports.getViewportMetrics = _chunkX2KQQZBTcjs.getViewportMetrics; exports.getViewportProjection = _chunkX2KQQZBTcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkX2KQQZBTcjs.greyMorphology; exports.groupLayers = _chunkX2KQQZBTcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkX2KQQZBTcjs.hasResampledLegacyMask; exports.hasSurface = _chunkX2KQQZBTcjs.hasSurface; exports.hasWarp = _chunkX2KQQZBTcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkX2KQQZBTcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkX2KQQZBTcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkX2KQQZBTcjs.hitTestAnnotation; exports.hitTestCrop = _chunkX2KQQZBTcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkX2KQQZBTcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkX2KQQZBTcjs.hueRangeTables; exports.hueRangeWeight = _chunkX2KQQZBTcjs.hueRangeWeight; exports.hueSaturation = _chunkX2KQQZBTcjs.hueSaturation; exports.identityCurve = _chunkX2KQQZBTcjs.identityCurve; exports.identityLevels = _chunkX2KQQZBTcjs.identityLevels; exports.identityTransform = _chunkX2KQQZBTcjs.identityTransform; exports.identityWarpMesh = _chunkEGZM52EOcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkX2KQQZBTcjs.imageToCanvasPoint; exports.importPsd = _chunkX2KQQZBTcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkX2KQQZBTcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkX2KQQZBTcjs.invertMatrix3; exports.invertSelection = _chunkX2KQQZBTcjs.invertSelection; exports.isActiveFilter = _chunkX2KQQZBTcjs.isActiveFilter; exports.isAdjustmentKind = _chunkX2KQQZBTcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkX2KQQZBTcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkX2KQQZBTcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkX2KQQZBTcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkX2KQQZBTcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkX2KQQZBTcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkX2KQQZBTcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkX2KQQZBTcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkX2KQQZBTcjs.isSelectionEmpty; exports.isSelectionMode = _chunkX2KQQZBTcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkX2KQQZBTcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkX2KQQZBTcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkX2KQQZBTcjs.isTransformAnchor; exports.isValidWarp = _chunkX2KQQZBTcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkX2KQQZBTcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkV7GWZIZKcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkX2KQQZBTcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkX2KQQZBTcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkX2KQQZBTcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkX2KQQZBTcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkX2KQQZBTcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkX2KQQZBTcjs.layerTree; exports.layerTypeLabel = _chunkX2KQQZBTcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkX2KQQZBTcjs.layersFromLegacy; exports.layoutText = _chunkEGZM52EOcjs.layoutText; exports.legacyAdjustmentLayer = _chunkX2KQQZBTcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkX2KQQZBTcjs.legacyMaskOf; exports.legacyView = _chunkX2KQQZBTcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkX2KQQZBTcjs.levelsValue; exports.linearSrgbToXy = _chunkX2KQQZBTcjs.linearSrgbToXy; exports.linearToSrgb = _chunkX2KQQZBTcjs.linearToSrgb; exports.linearToSrgb8 = _chunkV7GWZIZKcjs.linearToSrgb8; exports.liveComponent = _chunkX2KQQZBTcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkX2KQQZBTcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkV7GWZIZKcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkX2KQQZBTcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkX2KQQZBTcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkX2KQQZBTcjs.matrixFromCorners; exports.matrixFromParams = _chunkX2KQQZBTcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkX2KQQZBTcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkX2KQQZBTcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkX2KQQZBTcjs.moveLayer; exports.moveSmartFilter = _chunkX2KQQZBTcjs.moveSmartFilter; exports.mulMatrix3 = _chunkX2KQQZBTcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkX2KQQZBTcjs.neutralHueRange; exports.newContentsId = _chunkX2KQQZBTcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkX2KQQZBTcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunkX2KQQZBTcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkX2KQQZBTcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkX2KQQZBTcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkX2KQQZBTcjs.normalizeFilter; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkX2KQQZBTcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkX2KQQZBTcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkX2KQQZBTcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkX2KQQZBTcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkX2KQQZBTcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkX2KQQZBTcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkX2KQQZBTcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkX2KQQZBTcjs.normalizeSubpaths; exports.normalizeText = _chunkX2KQQZBTcjs.normalizeText; exports.normalizeTilt = _chunkV7GWZIZKcjs.normalizeTilt; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.offsetLayer = _chunkX2KQQZBTcjs.offsetLayer; exports.offsetShape = _chunkX2KQQZBTcjs.offsetShape; exports.offsetSmartObject = _chunkX2KQQZBTcjs.offsetSmartObject; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkV7GWZIZKcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkEGZM52EOcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkX2KQQZBTcjs.parseAdjustmentBlock; exports.parseBlend = _chunkX2KQQZBTcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkX2KQQZBTcjs.parseLfx2; exports.parseLrfx = _chunkX2KQQZBTcjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkX2KQQZBTcjs.parsePatternBlock; exports.parseSelectionMode = _chunkX2KQQZBTcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkX2KQQZBTcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkX2KQQZBTcjs.patchParagraphStyle; exports.patchTextStyle = _chunkX2KQQZBTcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkX2KQQZBTcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkV7GWZIZKcjs.pigmentColor; exports.pigmentOf = _chunkV7GWZIZKcjs.pigmentOf; exports.pixelLayerBounds = _chunkX2KQQZBTcjs.pixelLayerBounds; exports.pixelLayers = _chunkX2KQQZBTcjs.pixelLayers; exports.pixelPigment = _chunkV7GWZIZKcjs.pixelPigment; exports.placeContents = _chunkX2KQQZBTcjs.placeContents; exports.placeLayer = _chunkX2KQQZBTcjs.placeLayer; exports.placementAt = _chunkX2KQQZBTcjs.placementAt; exports.placementBounds = _chunkX2KQQZBTcjs.placementBounds; exports.placementGeometry = _chunkX2KQQZBTcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkV7GWZIZKcjs.pointerPressure; exports.pointerStrokeSample = _chunkV7GWZIZKcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkV7GWZIZKcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkX2KQQZBTcjs.posterizeValue; exports.presetWarp = _chunkX2KQQZBTcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkX2KQQZBTcjs.projectImagePoint; exports.projectImageRect = _chunkX2KQQZBTcjs.projectImageRect; exports.projectMaskCoverage = _chunkX2KQQZBTcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkX2KQQZBTcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkX2KQQZBTcjs.psdToLayers; exports.pullWarpMesh = _chunkEGZM52EOcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkX2KQQZBTcjs.rangeLightness; exports.rasterContents = _chunkX2KQQZBTcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkX2KQQZBTcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkX2KQQZBTcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkX2KQQZBTcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkX2KQQZBTcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkX2KQQZBTcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkX2KQQZBTcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkX2KQQZBTcjs.removeLayer; exports.removeLayerEffect = _chunkX2KQQZBTcjs.removeLayerEffect; exports.removeLayerFilter = _chunkX2KQQZBTcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkX2KQQZBTcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkX2KQQZBTcjs.renderShape; exports.renderShapeRect = _chunkX2KQQZBTcjs.renderShapeRect; exports.renderSmartObject = _chunkX2KQQZBTcjs.renderSmartObject; exports.renderText = _chunkX2KQQZBTcjs.renderText; exports.replaceContents = _chunkX2KQQZBTcjs.replaceContents; exports.replaceTextRange = _chunkX2KQQZBTcjs.replaceTextRange; exports.requireLayer = _chunkX2KQQZBTcjs.requireLayer; exports.requireOperation = _chunkX2KQQZBTcjs.requireOperation; exports.requireShapeLayer = _chunkX2KQQZBTcjs.requireShapeLayer; exports.requireSmartObject = _chunkX2KQQZBTcjs.requireSmartObject; exports.requireTypeLayer = _chunkX2KQQZBTcjs.requireTypeLayer; exports.requireUnlocked = _chunkX2KQQZBTcjs.requireUnlocked; exports.rerender = _chunkX2KQQZBTcjs.rerender; exports.rerenderShape = _chunkX2KQQZBTcjs.rerenderShape; exports.rerenderText = _chunkX2KQQZBTcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkX2KQQZBTcjs.resizeSelection; exports.resizeWarpMesh = _chunkEGZM52EOcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkX2KQQZBTcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkEGZM52EOcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkX2KQQZBTcjs.rgbToGray; exports.rgbToHsl = _chunkX2KQQZBTcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkX2KQQZBTcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkX2KQQZBTcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkX2KQQZBTcjs.sampleLut; exports.sampleToneLut = _chunkX2KQQZBTcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkX2KQQZBTcjs.selectionArea; exports.selectionFromCoverage = _chunkX2KQQZBTcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkX2KQQZBTcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkX2KQQZBTcjs.selectionToCoverage; exports.selectionToPixels = _chunkX2KQQZBTcjs.selectionToPixels; exports.selectionValueAt = _chunkX2KQQZBTcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkX2KQQZBTcjs.serializeContents; exports.serializeEffects = _chunkX2KQQZBTcjs.serializeEffects; exports.serializeLayer = _chunkX2KQQZBTcjs.serializeLayer; exports.serializeLayers = _chunkX2KQQZBTcjs.serializeLayers; exports.serializeLayersExternal = _chunkX2KQQZBTcjs.serializeLayersExternal; exports.serializePatterns = _chunkX2KQQZBTcjs.serializePatterns; exports.serializeSelection = _chunkX2KQQZBTcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkX2KQQZBTcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkX2KQQZBTcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkX2KQQZBTcjs.setLayerMask; exports.setLayerProperties = _chunkX2KQQZBTcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkX2KQQZBTcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkX2KQQZBTcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkX2KQQZBTcjs.setSmartPlacement; exports.shadeTile = _chunkV7GWZIZKcjs.shadeTile; exports.shapeAsPixelLayer = _chunkX2KQQZBTcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkX2KQQZBTcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkX2KQQZBTcjs.shapeGeometryBounds; exports.shapeLayers = _chunkX2KQQZBTcjs.shapeLayers; exports.shapeOutline = _chunkX2KQQZBTcjs.shapeOutline; exports.shapeRenderClip = _chunkX2KQQZBTcjs.shapeRenderClip; exports.shiftCoverage = _chunkX2KQQZBTcjs.shiftCoverage; exports.skinToneRange = skinToneRange; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkX2KQQZBTcjs.smartObjectLayers; exports.smoothCoverage = _chunkX2KQQZBTcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.snapTo45 = snapTo45; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkEGZM52EOcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkV7GWZIZKcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkX2KQQZBTcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.stepSlotTs = _chunkV7GWZIZKcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkEGZM52EOcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkX2KQQZBTcjs.tempTintToXy; exports.temperatureToKelvin = _chunkX2KQQZBTcjs.temperatureToKelvin; exports.textIndexAt = _chunkEGZM52EOcjs.textIndexAt; exports.textMatrix = _chunkX2KQQZBTcjs.textMatrix; exports.textOutlines = _chunkX2KQQZBTcjs.textOutlines; exports.textRange = _chunkX2KQQZBTcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkX2KQQZBTcjs.toTextSpace; exports.toneCurve = _chunkX2KQQZBTcjs.toneCurve; exports.toneLuts = _chunkX2KQQZBTcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkX2KQQZBTcjs.transformHomography; exports.transformMap = _chunkX2KQQZBTcjs.transformMap; exports.transformShapeComponents = _chunkX2KQQZBTcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkX2KQQZBTcjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkX2KQQZBTcjs.transformedBox; exports.transformedPoint = _chunkX2KQQZBTcjs.transformedPoint; exports.translateLayer = _chunkX2KQQZBTcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkX2KQQZBTcjs.typeAsPixelLayer; exports.typeFrame = _chunkX2KQQZBTcjs.typeFrame; exports.typeFromAnnotation = _chunkX2KQQZBTcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkX2KQQZBTcjs.typeLayerName; exports.ungroupLayer = _chunkX2KQQZBTcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkX2KQQZBTcjs.unionRect; exports.unprojectCanvasPoint = _chunkX2KQQZBTcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkX2KQQZBTcjs.updateLayerEffect; exports.updateLayerFilter = _chunkX2KQQZBTcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkX2KQQZBTcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkX2KQQZBTcjs.updateShapeLayer; exports.updateSmartFilter = _chunkX2KQQZBTcjs.updateSmartFilter; exports.updateTypeLayer = _chunkX2KQQZBTcjs.updateTypeLayer; exports.userErrorMessage = _chunkX2KQQZBTcjs.userErrorMessage; exports.uvToXy = _chunkX2KQQZBTcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkX2KQQZBTcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkX2KQQZBTcjs.vibranceLinear; exports.vibrancePixel = _chunkX2KQQZBTcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkEGZM52EOcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkEGZM52EOcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkEGZM52EOcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkEGZM52EOcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkX2KQQZBTcjs.wbMatrix; exports.wetGpuSupport = _chunkV7GWZIZKcjs.wetGpuSupport; exports.wetSimdSupported = _chunkV7GWZIZKcjs.wetSimdSupported; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.whiteBalanceFromSample = _chunkX2KQQZBTcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkX2KQQZBTcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkX2KQQZBTcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkX2KQQZBTcjs.withNewIds; exports.writeAdjustmentBlock = _chunkX2KQQZBTcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkX2KQQZBTcjs.writeLfx2; exports.writePatternBlock = _chunkX2KQQZBTcjs.writePatternBlock; exports.writePsd = _chunkX2KQQZBTcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkX2KQQZBTcjs.xyToTempTint; exports.xyToUv = _chunkX2KQQZBTcjs.xyToUv;
18679
+
18680
+
18681
+
18682
+ exports.ADJUSTMENT_KEYS = _chunkJYV4R62Mcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkJYV4R62Mcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkJYV4R62Mcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkJYV4R62Mcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkJYV4R62Mcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkJYV4R62Mcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkJYV4R62Mcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkJYV4R62Mcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkV7GWZIZKcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkJYV4R62Mcjs.D50; exports.D65 = _chunkJYV4R62Mcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkEGZM52EOcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkJYV4R62Mcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkEGZM52EOcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkV7GWZIZKcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkJYV4R62Mcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkV7GWZIZKcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkJYV4R62Mcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkV7GWZIZKcjs.EX; exports.EY = _chunkV7GWZIZKcjs.EY; exports.FLAG_ALIVE = _chunkV7GWZIZKcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkV7GWZIZKcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkV7GWZIZKcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkV7GWZIZKcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkV7GWZIZKcjs.FLAG_TOP; exports.FLAG_WET = _chunkV7GWZIZKcjs.FLAG_WET; exports.FLAT = _chunkV7GWZIZKcjs.FLAT; exports.FREE_INTERVAL = _chunkV7GWZIZKcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkJYV4R62Mcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkV7GWZIZKcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkJYV4R62Mcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkJYV4R62Mcjs.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_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkJYV4R62Mcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkJYV4R62Mcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkJYV4R62Mcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkJYV4R62Mcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkJYV4R62Mcjs.LUMA_709; exports.LayerCompositor = _chunkJYV4R62Mcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkJYV4R62Mcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkV7GWZIZKcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkJYV4R62Mcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkJYV4R62Mcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkV7GWZIZKcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkV7GWZIZKcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkV7GWZIZKcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkJYV4R62Mcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkJYV4R62Mcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkV7GWZIZKcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkV7GWZIZKcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkJYV4R62Mcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkV7GWZIZKcjs.PARAM; exports.PARAM_FLOATS = _chunkV7GWZIZKcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkJYV4R62Mcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkV7GWZIZKcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkV7GWZIZKcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkV7GWZIZKcjs.PLANE; exports.PLANE_BYTES = _chunkV7GWZIZKcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkJYV4R62Mcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkV7GWZIZKcjs.P_D0; exports.P_EDGE = _chunkV7GWZIZKcjs.P_EDGE; exports.P_FX = _chunkV7GWZIZKcjs.P_FX; exports.P_FY = _chunkV7GWZIZKcjs.P_FY; exports.P_H = _chunkV7GWZIZKcjs.P_H; exports.P_P0 = _chunkV7GWZIZKcjs.P_P0; exports.P_RHO = _chunkV7GWZIZKcjs.P_RHO; exports.P_SW = _chunkV7GWZIZKcjs.P_SW; exports.P_UX = _chunkV7GWZIZKcjs.P_UX; exports.P_UY = _chunkV7GWZIZKcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkJYV4R62Mcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkJYV4R62Mcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkJYV4R62Mcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkV7GWZIZKcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkJYV4R62Mcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkJYV4R62Mcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkV7GWZIZKcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkV7GWZIZKcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkV7GWZIZKcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkJYV4R62Mcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkV7GWZIZKcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkV7GWZIZKcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkJYV4R62Mcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkJYV4R62Mcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkJYV4R62Mcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkJYV4R62Mcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkJYV4R62Mcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkJYV4R62Mcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkJYV4R62Mcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkV7GWZIZKcjs.U_MAX; exports.VIBRANCE_GREY = _chunkJYV4R62Mcjs.VIBRANCE_GREY; exports.W9 = _chunkV7GWZIZKcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkEGZM52EOcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkEGZM52EOcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkV7GWZIZKcjs.WET_TILE; exports.WGSL_HALO = _chunkV7GWZIZKcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkV7GWZIZKcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkV7GWZIZKcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkV7GWZIZKcjs.WetGpuEngine; exports.WetMedium = _chunkV7GWZIZKcjs.WetMedium; exports.WetWorkerPool = _chunkV7GWZIZKcjs.WetWorkerPool; exports.WetWorld = _chunkV7GWZIZKcjs.WetWorld; exports.WetWorldError = _chunkV7GWZIZKcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkJYV4R62Mcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkJYV4R62Mcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkJYV4R62Mcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkJYV4R62Mcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkJYV4R62Mcjs.activeSmartFilters; exports.addLayerEffect = _chunkJYV4R62Mcjs.addLayerEffect; exports.addLayerFilter = _chunkJYV4R62Mcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkJYV4R62Mcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkJYV4R62Mcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkJYV4R62Mcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkJYV4R62Mcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkJYV4R62Mcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkJYV4R62Mcjs.anchorPoint; exports.annotationBlend = _chunkJYV4R62Mcjs.annotationBlend; exports.annotationLayerFor = _chunkJYV4R62Mcjs.annotationLayerFor; exports.annotationLayerName = _chunkJYV4R62Mcjs.annotationLayerName; exports.annotationOfLayer = _chunkJYV4R62Mcjs.annotationOfLayer; exports.annotationOfShape = _chunkJYV4R62Mcjs.annotationOfShape; exports.annotationOfType = _chunkJYV4R62Mcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkJYV4R62Mcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkJYV4R62Mcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkJYV4R62Mcjs.applyAdjustments; exports.applyBoxBlur = _chunkJYV4R62Mcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkJYV4R62Mcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkJYV4R62Mcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkJYV4R62Mcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkJYV4R62Mcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkJYV4R62Mcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkJYV4R62Mcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkJYV4R62Mcjs.applyParams; exports.applyProcess2Adjustments = _chunkJYV4R62Mcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkJYV4R62Mcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkJYV4R62Mcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkJYV4R62Mcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkJYV4R62Mcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkJYV4R62Mcjs.blurFilter; exports.borderCoverage = _chunkJYV4R62Mcjs.borderCoverage; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunkJYV4R62Mcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkJYV4R62Mcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkJYV4R62Mcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkJYV4R62Mcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkJYV4R62Mcjs.calculateCropDrag; exports.canShareMemory = _chunkV7GWZIZKcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkJYV4R62Mcjs.canvasToImagePoint; exports.caretAt = _chunkEGZM52EOcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkJYV4R62Mcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkJYV4R62Mcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkJYV4R62Mcjs.combineSelections; exports.compileAdjustmentLayer = _chunkJYV4R62Mcjs.compileAdjustmentLayer; exports.componentPath = _chunkJYV4R62Mcjs.componentPath; exports.compositeDeep = _chunkJYV4R62Mcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkJYV4R62Mcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkJYV4R62Mcjs.contentsBox; exports.contentsSurface = _chunkJYV4R62Mcjs.contentsSurface; exports.contractCoverage = _chunkJYV4R62Mcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkJYV4R62Mcjs.convertToSmartObject; exports.copySmartObject = _chunkJYV4R62Mcjs.copySmartObject; exports.cornersFromMatrix = _chunkJYV4R62Mcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkJYV4R62Mcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkJYV4R62Mcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkEGZM52EOcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkEGZM52EOcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkEGZM52EOcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkV7GWZIZKcjs.createPigmentTools; exports.createSelectionMask = _chunkJYV4R62Mcjs.createSelectionMask; exports.createShapeLayer = _chunkJYV4R62Mcjs.createShapeLayer; exports.createTypeLayer = _chunkJYV4R62Mcjs.createTypeLayer; exports.createWetGpuEngine = _chunkV7GWZIZKcjs.createWetGpuEngine; exports.cssFont = _chunkEGZM52EOcjs.cssFont; exports.cssFontFamily = _chunkEGZM52EOcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkJYV4R62Mcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkJYV4R62Mcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkJYV4R62Mcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkJYV4R62Mcjs.decodeLayerMask; exports.decodeMergedImage = _chunkJYV4R62Mcjs.decodeMergedImage; exports.decodePlanes = _chunkJYV4R62Mcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkJYV4R62Mcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkJYV4R62Mcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkJYV4R62Mcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkJYV4R62Mcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkJYV4R62Mcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkJYV4R62Mcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkJYV4R62Mcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkJYV4R62Mcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkJYV4R62Mcjs.deserializeEffects; exports.deserializeLayer = _chunkJYV4R62Mcjs.deserializeLayer; exports.deserializeLayers = _chunkJYV4R62Mcjs.deserializeLayers; exports.deserializePatterns = _chunkJYV4R62Mcjs.deserializePatterns; exports.deserializeSelection = _chunkJYV4R62Mcjs.deserializeSelection; exports.developFilter = _chunkJYV4R62Mcjs.developFilter; exports.developFromAdjustments = _chunkJYV4R62Mcjs.developFromAdjustments; exports.developTarget = _chunkJYV4R62Mcjs.developTarget; exports.dexp = _chunkV7GWZIZKcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkJYV4R62Mcjs.distanceTransform; exports.dlog = _chunkV7GWZIZKcjs.dlog; exports.documentContents = _chunkJYV4R62Mcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkV7GWZIZKcjs.dpow; exports.dragWarpMeshPoint = _chunkEGZM52EOcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkV7GWZIZKcjs.dsincos; exports.duplicateLayer = _chunkJYV4R62Mcjs.duplicateLayer; exports.edgeBits = _chunkV7GWZIZKcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkJYV4R62Mcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkJYV4R62Mcjs.encodeRle; exports.encodeSelectionRle = _chunkJYV4R62Mcjs.encodeSelectionRle; exports.encodeSurface = _chunkJYV4R62Mcjs.encodeSurface; exports.evalWarpMesh = _chunkEGZM52EOcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkJYV4R62Mcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkV7GWZIZKcjs.expNeg; exports.expandCoverage = _chunkJYV4R62Mcjs.expandCoverage; exports.exportPsd = _chunkJYV4R62Mcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkJYV4R62Mcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkV7GWZIZKcjs.filmPixel; exports.filmReflectance = _chunkV7GWZIZKcjs.filmReflectance; exports.filterMaskCoverage = _chunkJYV4R62Mcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkV7GWZIZKcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkEGZM52EOcjs.fitParagraphRuns; exports.fitRuns = _chunkEGZM52EOcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkJYV4R62Mcjs.flattenPath; exports.flipCorners = _chunkJYV4R62Mcjs.flipCorners; exports.flowField = _chunkV7GWZIZKcjs.flowField; exports.fontOf = _chunkEGZM52EOcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkJYV4R62Mcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkJYV4R62Mcjs.geometryHomography; exports.getAnnotationBounds = _chunkJYV4R62Mcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkJYV4R62Mcjs.getCropCursor; exports.getRotatedSize = _chunkJYV4R62Mcjs.getRotatedSize; exports.getViewportMetrics = _chunkJYV4R62Mcjs.getViewportMetrics; exports.getViewportProjection = _chunkJYV4R62Mcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkJYV4R62Mcjs.greyMorphology; exports.groupLayers = _chunkJYV4R62Mcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkJYV4R62Mcjs.hasResampledLegacyMask; exports.hasSurface = _chunkJYV4R62Mcjs.hasSurface; exports.hasWarp = _chunkJYV4R62Mcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkJYV4R62Mcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkJYV4R62Mcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkJYV4R62Mcjs.hitTestAnnotation; exports.hitTestCrop = _chunkJYV4R62Mcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkJYV4R62Mcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkJYV4R62Mcjs.hueRangeTables; exports.hueRangeWeight = _chunkJYV4R62Mcjs.hueRangeWeight; exports.hueSaturation = _chunkJYV4R62Mcjs.hueSaturation; exports.identityCurve = _chunkJYV4R62Mcjs.identityCurve; exports.identityLevels = _chunkJYV4R62Mcjs.identityLevels; exports.identityTransform = _chunkJYV4R62Mcjs.identityTransform; exports.identityWarpMesh = _chunkEGZM52EOcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkJYV4R62Mcjs.imageToCanvasPoint; exports.importPsd = _chunkJYV4R62Mcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkJYV4R62Mcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkJYV4R62Mcjs.invertMatrix3; exports.invertSelection = _chunkJYV4R62Mcjs.invertSelection; exports.isActiveFilter = _chunkJYV4R62Mcjs.isActiveFilter; exports.isAdjustmentKind = _chunkJYV4R62Mcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkJYV4R62Mcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkJYV4R62Mcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkJYV4R62Mcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkJYV4R62Mcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkJYV4R62Mcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkJYV4R62Mcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkJYV4R62Mcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkJYV4R62Mcjs.isSelectionEmpty; exports.isSelectionMode = _chunkJYV4R62Mcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkJYV4R62Mcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkJYV4R62Mcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkJYV4R62Mcjs.isTransformAnchor; exports.isValidWarp = _chunkJYV4R62Mcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkJYV4R62Mcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkV7GWZIZKcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkJYV4R62Mcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkJYV4R62Mcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkJYV4R62Mcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkJYV4R62Mcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkJYV4R62Mcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkJYV4R62Mcjs.layerTree; exports.layerTypeLabel = _chunkJYV4R62Mcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkJYV4R62Mcjs.layersFromLegacy; exports.layoutText = _chunkEGZM52EOcjs.layoutText; exports.legacyAdjustmentLayer = _chunkJYV4R62Mcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkJYV4R62Mcjs.legacyMaskOf; exports.legacyView = _chunkJYV4R62Mcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkJYV4R62Mcjs.levelsValue; exports.linearSrgbToXy = _chunkJYV4R62Mcjs.linearSrgbToXy; exports.linearToSrgb = _chunkJYV4R62Mcjs.linearToSrgb; exports.linearToSrgb8 = _chunkV7GWZIZKcjs.linearToSrgb8; exports.liveComponent = _chunkJYV4R62Mcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkJYV4R62Mcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkV7GWZIZKcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkJYV4R62Mcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkJYV4R62Mcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkJYV4R62Mcjs.matrixFromCorners; exports.matrixFromParams = _chunkJYV4R62Mcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkJYV4R62Mcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkJYV4R62Mcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkJYV4R62Mcjs.moveLayer; exports.moveSmartFilter = _chunkJYV4R62Mcjs.moveSmartFilter; exports.mulMatrix3 = _chunkJYV4R62Mcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkJYV4R62Mcjs.neutralHueRange; exports.newContentsId = _chunkJYV4R62Mcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkJYV4R62Mcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunkJYV4R62Mcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkJYV4R62Mcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkJYV4R62Mcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkJYV4R62Mcjs.normalizeFilter; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkJYV4R62Mcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkJYV4R62Mcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkJYV4R62Mcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkJYV4R62Mcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkJYV4R62Mcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkJYV4R62Mcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkJYV4R62Mcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkJYV4R62Mcjs.normalizeSubpaths; exports.normalizeText = _chunkJYV4R62Mcjs.normalizeText; exports.normalizeTilt = _chunkV7GWZIZKcjs.normalizeTilt; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.offsetLayer = _chunkJYV4R62Mcjs.offsetLayer; exports.offsetShape = _chunkJYV4R62Mcjs.offsetShape; exports.offsetSmartObject = _chunkJYV4R62Mcjs.offsetSmartObject; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkV7GWZIZKcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkEGZM52EOcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkJYV4R62Mcjs.parseAdjustmentBlock; exports.parseBlend = _chunkJYV4R62Mcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkJYV4R62Mcjs.parseLfx2; exports.parseLrfx = _chunkJYV4R62Mcjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkJYV4R62Mcjs.parsePatternBlock; exports.parseSelectionMode = _chunkJYV4R62Mcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkJYV4R62Mcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkJYV4R62Mcjs.patchParagraphStyle; exports.patchTextStyle = _chunkJYV4R62Mcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkJYV4R62Mcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkV7GWZIZKcjs.pigmentColor; exports.pigmentOf = _chunkV7GWZIZKcjs.pigmentOf; exports.pixelLayerBounds = _chunkJYV4R62Mcjs.pixelLayerBounds; exports.pixelLayers = _chunkJYV4R62Mcjs.pixelLayers; exports.pixelPigment = _chunkV7GWZIZKcjs.pixelPigment; exports.placeContents = _chunkJYV4R62Mcjs.placeContents; exports.placeLayer = _chunkJYV4R62Mcjs.placeLayer; exports.placementAt = _chunkJYV4R62Mcjs.placementAt; exports.placementBounds = _chunkJYV4R62Mcjs.placementBounds; exports.placementGeometry = _chunkJYV4R62Mcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkV7GWZIZKcjs.pointerPressure; exports.pointerStrokeSample = _chunkV7GWZIZKcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkV7GWZIZKcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonCoverageBox = polygonCoverageBox; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkJYV4R62Mcjs.posterizeValue; exports.presetWarp = _chunkJYV4R62Mcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkJYV4R62Mcjs.projectImagePoint; exports.projectImageRect = _chunkJYV4R62Mcjs.projectImageRect; exports.projectMaskCoverage = _chunkJYV4R62Mcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkJYV4R62Mcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkJYV4R62Mcjs.psdToLayers; exports.pullWarpMesh = _chunkEGZM52EOcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkJYV4R62Mcjs.rangeLightness; exports.rasterContents = _chunkJYV4R62Mcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkJYV4R62Mcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkJYV4R62Mcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkJYV4R62Mcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkJYV4R62Mcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkJYV4R62Mcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkJYV4R62Mcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkJYV4R62Mcjs.removeLayer; exports.removeLayerEffect = _chunkJYV4R62Mcjs.removeLayerEffect; exports.removeLayerFilter = _chunkJYV4R62Mcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkJYV4R62Mcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkJYV4R62Mcjs.renderShape; exports.renderShapeRect = _chunkJYV4R62Mcjs.renderShapeRect; exports.renderSmartObject = _chunkJYV4R62Mcjs.renderSmartObject; exports.renderText = _chunkJYV4R62Mcjs.renderText; exports.replaceContents = _chunkJYV4R62Mcjs.replaceContents; exports.replaceTextRange = _chunkJYV4R62Mcjs.replaceTextRange; exports.requireLayer = _chunkJYV4R62Mcjs.requireLayer; exports.requireOperation = _chunkJYV4R62Mcjs.requireOperation; exports.requireShapeLayer = _chunkJYV4R62Mcjs.requireShapeLayer; exports.requireSmartObject = _chunkJYV4R62Mcjs.requireSmartObject; exports.requireTypeLayer = _chunkJYV4R62Mcjs.requireTypeLayer; exports.requireUnlocked = _chunkJYV4R62Mcjs.requireUnlocked; exports.rerender = _chunkJYV4R62Mcjs.rerender; exports.rerenderShape = _chunkJYV4R62Mcjs.rerenderShape; exports.rerenderText = _chunkJYV4R62Mcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkJYV4R62Mcjs.resizeSelection; exports.resizeWarpMesh = _chunkEGZM52EOcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkJYV4R62Mcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkEGZM52EOcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkJYV4R62Mcjs.rgbToGray; exports.rgbToHsl = _chunkJYV4R62Mcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkJYV4R62Mcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkJYV4R62Mcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkJYV4R62Mcjs.sampleLut; exports.sampleToneLut = _chunkJYV4R62Mcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkJYV4R62Mcjs.selectionArea; exports.selectionFromCoverage = _chunkJYV4R62Mcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkJYV4R62Mcjs.selectionFromPixels; exports.selectionFromRegion = _chunkJYV4R62Mcjs.selectionFromRegion; exports.selectionFromTiles = _chunkJYV4R62Mcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkJYV4R62Mcjs.selectionToCoverage; exports.selectionToPixels = _chunkJYV4R62Mcjs.selectionToPixels; exports.selectionValueAt = _chunkJYV4R62Mcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkJYV4R62Mcjs.serializeContents; exports.serializeEffects = _chunkJYV4R62Mcjs.serializeEffects; exports.serializeLayer = _chunkJYV4R62Mcjs.serializeLayer; exports.serializeLayers = _chunkJYV4R62Mcjs.serializeLayers; exports.serializeLayersExternal = _chunkJYV4R62Mcjs.serializeLayersExternal; exports.serializePatterns = _chunkJYV4R62Mcjs.serializePatterns; exports.serializeSelection = _chunkJYV4R62Mcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkJYV4R62Mcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkJYV4R62Mcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkJYV4R62Mcjs.setLayerMask; exports.setLayerProperties = _chunkJYV4R62Mcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkJYV4R62Mcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkJYV4R62Mcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkJYV4R62Mcjs.setSmartPlacement; exports.shadeTile = _chunkV7GWZIZKcjs.shadeTile; exports.shapeAsPixelLayer = _chunkJYV4R62Mcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkJYV4R62Mcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkJYV4R62Mcjs.shapeGeometryBounds; exports.shapeLayers = _chunkJYV4R62Mcjs.shapeLayers; exports.shapeOutline = _chunkJYV4R62Mcjs.shapeOutline; exports.shapeRenderClip = _chunkJYV4R62Mcjs.shapeRenderClip; exports.shiftCoverage = _chunkJYV4R62Mcjs.shiftCoverage; exports.skinToneRange = skinToneRange; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkJYV4R62Mcjs.smartObjectLayers; exports.smoothCoverage = _chunkJYV4R62Mcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.snapTo45 = snapTo45; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkEGZM52EOcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkV7GWZIZKcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkJYV4R62Mcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.stepSlotTs = _chunkV7GWZIZKcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkEGZM52EOcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkJYV4R62Mcjs.tempTintToXy; exports.temperatureToKelvin = _chunkJYV4R62Mcjs.temperatureToKelvin; exports.textIndexAt = _chunkEGZM52EOcjs.textIndexAt; exports.textMatrix = _chunkJYV4R62Mcjs.textMatrix; exports.textOutlines = _chunkJYV4R62Mcjs.textOutlines; exports.textRange = _chunkJYV4R62Mcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkJYV4R62Mcjs.toTextSpace; exports.toneCurve = _chunkJYV4R62Mcjs.toneCurve; exports.toneLuts = _chunkJYV4R62Mcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkJYV4R62Mcjs.transformHomography; exports.transformMap = _chunkJYV4R62Mcjs.transformMap; exports.transformShapeComponents = _chunkJYV4R62Mcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkJYV4R62Mcjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkJYV4R62Mcjs.transformedBox; exports.transformedPoint = _chunkJYV4R62Mcjs.transformedPoint; exports.translateLayer = _chunkJYV4R62Mcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkJYV4R62Mcjs.typeAsPixelLayer; exports.typeFrame = _chunkJYV4R62Mcjs.typeFrame; exports.typeFromAnnotation = _chunkJYV4R62Mcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkJYV4R62Mcjs.typeLayerName; exports.ungroupLayer = _chunkJYV4R62Mcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkJYV4R62Mcjs.unionRect; exports.unprojectCanvasPoint = _chunkJYV4R62Mcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkJYV4R62Mcjs.updateLayerEffect; exports.updateLayerFilter = _chunkJYV4R62Mcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkJYV4R62Mcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkJYV4R62Mcjs.updateShapeLayer; exports.updateSmartFilter = _chunkJYV4R62Mcjs.updateSmartFilter; exports.updateTypeLayer = _chunkJYV4R62Mcjs.updateTypeLayer; exports.userErrorMessage = _chunkJYV4R62Mcjs.userErrorMessage; exports.uvToXy = _chunkJYV4R62Mcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkJYV4R62Mcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkJYV4R62Mcjs.vibranceLinear; exports.vibrancePixel = _chunkJYV4R62Mcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkEGZM52EOcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkEGZM52EOcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkEGZM52EOcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkEGZM52EOcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkJYV4R62Mcjs.wbMatrix; exports.wetGpuSupport = _chunkV7GWZIZKcjs.wetGpuSupport; exports.wetSimdSupported = _chunkV7GWZIZKcjs.wetSimdSupported; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.whiteBalanceFromSample = _chunkJYV4R62Mcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkJYV4R62Mcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkJYV4R62Mcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkJYV4R62Mcjs.withNewIds; exports.writeAdjustmentBlock = _chunkJYV4R62Mcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkJYV4R62Mcjs.writeLfx2; exports.writePatternBlock = _chunkJYV4R62Mcjs.writePatternBlock; exports.writePsd = _chunkJYV4R62Mcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkJYV4R62Mcjs.xyToTempTint; exports.xyToUv = _chunkJYV4R62Mcjs.xyToUv;