@pixerate/editor 0.212.0 → 0.213.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.
@@ -1,8 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18;
2
2
 
3
3
 
4
4
 
5
- var _chunk3T5VCDIVcjs = require('../chunk-3T5VCDIV.cjs');
5
+
6
+
7
+ var _chunkLCCMOWR7cjs = require('../chunk-LCCMOWR7.cjs');
6
8
 
7
9
 
8
10
 
@@ -693,6 +695,15 @@ var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
693
695
 
694
696
 
695
697
 
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
696
707
 
697
708
 
698
709
 
@@ -708,6 +719,8 @@ require('../chunk-ROVK6AXX.cjs');
708
719
  require('../chunk-CVFAAZXE.cjs');
709
720
 
710
721
 
722
+
723
+
711
724
  var _chunkGF2RBSDMcjs = require('../chunk-GF2RBSDM.cjs');
712
725
  require('../chunk-NM3G4VQT.cjs');
713
726
 
@@ -1175,10 +1188,10 @@ function emptyHistogram() {
1175
1188
  max: 0
1176
1189
  };
1177
1190
  }
1178
- function addToHistogram(h, data, stride, rect) {
1179
- for (let y = rect.y; y < rect.y + rect.height; y++) {
1180
- let i = (y * stride + rect.x) * 4;
1181
- for (let x = 0; x < rect.width; x++, i += 4) {
1191
+ function addToHistogram(h, data, stride, rect2) {
1192
+ for (let y = rect2.y; y < rect2.y + rect2.height; y++) {
1193
+ let i = (y * stride + rect2.x) * 4;
1194
+ for (let x = 0; x < rect2.width; x++, i += 4) {
1182
1195
  if (!(data[i + 3] > 0)) {
1183
1196
  h.transparent++;
1184
1197
  continue;
@@ -1639,6 +1652,63 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1639
1652
  }
1640
1653
  ctx.restore();
1641
1654
  }
1655
+ if (options.pathEdit) {
1656
+ const e = options.pathEdit;
1657
+ ctx.save();
1658
+ try {
1659
+ const scr = (p) => _chunkH65IBXFIcjs.projectImagePoint.call(void 0, p, projection);
1660
+ const trace2 = (c) => {
1661
+ const [a, b, d, f] = c.map(scr);
1662
+ ctx.moveTo(a.x, a.y);
1663
+ if (f) ctx.bezierCurveTo(b.x, b.y, d.x, d.y, f.x, f.y);
1664
+ else ctx.lineTo(b.x, b.y);
1665
+ };
1666
+ ctx.beginPath();
1667
+ e.curves.forEach(trace2);
1668
+ ctx.lineWidth = 1.5 * u;
1669
+ ctx.strokeStyle = OVERLAY_HANDLE_EDGE;
1670
+ ctx.stroke();
1671
+ if (e.preview) {
1672
+ ctx.beginPath();
1673
+ trace2(e.preview);
1674
+ ctx.setLineDash([4 * u, 3 * u]);
1675
+ ctx.stroke();
1676
+ ctx.setLineDash([]);
1677
+ }
1678
+ ctx.beginPath();
1679
+ for (const h of e.handles) {
1680
+ const a = scr(h.anchor);
1681
+ const q = scr(h.point);
1682
+ ctx.moveTo(a.x, a.y);
1683
+ ctx.lineTo(q.x, q.y);
1684
+ }
1685
+ ctx.lineWidth = 1 * u;
1686
+ ctx.stroke();
1687
+ for (const h of e.handles) {
1688
+ const q = scr(h.point);
1689
+ ctx.beginPath();
1690
+ ctx.arc(q.x, q.y, 3 * u, 0, Math.PI * 2);
1691
+ ctx.fillStyle = OVERLAY_HANDLE_EDGE;
1692
+ ctx.fill();
1693
+ }
1694
+ const size = 6 * u;
1695
+ ctx.lineWidth = 1 * u;
1696
+ for (const a of e.anchors) {
1697
+ const q = scr(a.point);
1698
+ ctx.fillStyle = a.selected ? OVERLAY_HANDLE_EDGE : "#ffffff";
1699
+ ctx.fillRect(q.x - size / 2, q.y - size / 2, size, size);
1700
+ ctx.strokeRect(q.x - size / 2, q.y - size / 2, size, size);
1701
+ }
1702
+ if (e.marquee) {
1703
+ const a = scr({ x: e.marquee.x, y: e.marquee.y });
1704
+ const b = scr({ x: e.marquee.x + e.marquee.width, y: e.marquee.y + e.marquee.height });
1705
+ ctx.setLineDash([4 * u, 3 * u]);
1706
+ ctx.strokeRect(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.abs(b.x - a.x), Math.abs(b.y - a.y));
1707
+ }
1708
+ } catch (e11) {
1709
+ }
1710
+ ctx.restore();
1711
+ }
1642
1712
  if (isActivelyCropping) {
1643
1713
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1644
1714
  this.drawCropOverlay(ctx, _chunkH65IBXFIcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop), u);
@@ -1703,7 +1773,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1703
1773
  _chunkH65IBXFIcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1704
1774
  }
1705
1775
  }
1706
- } catch (e11) {
1776
+ } catch (e12) {
1707
1777
  }
1708
1778
  }
1709
1779
  _optionalChain([onPixels, 'optionalCall', _27 => _27(imageData)]);
@@ -1742,7 +1812,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1742
1812
  if (!source.enabled || !source.maskSource) return null;
1743
1813
  return _nullishCoalesce(this.depthMaps.get(`${source.maskSource}|${width}x${height}`), () => ( null));
1744
1814
  },
1745
- rasterizeAnnotation: (annotation, rect) => this.rasterizeAnnotation(annotation, rect),
1815
+ rasterizeAnnotation: (annotation, rect2) => this.rasterizeAnnotation(annotation, rect2),
1746
1816
  version: `${_nullishCoalesce(_optionalChain([host, 'optionalAccess', _33 => _33.version, 'call', _34 => _34()]), () => ( ""))}:${this.assetVersion}`,
1747
1817
  globalLight: _optionalChain([host, 'optionalAccess', _35 => _35.globalLight, 'optionalCall', _36 => _36()]),
1748
1818
  pattern: _optionalChain([host, 'optionalAccess', _37 => _37.pattern]) ? (id) => host.pattern(id) : void 0
@@ -1754,25 +1824,25 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1754
1824
  for (const l of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers)) {
1755
1825
  const source = _optionalChain([l, 'access', _38 => _38.mask, 'optionalAccess', _39 => _39.source]);
1756
1826
  if (_optionalChain([source, 'optionalAccess', _40 => _40.enabled]) && source.maskSource) {
1757
- const key = `${source.maskSource}|${width}x${height}`;
1758
- if (this.depthMaps.has(key)) continue;
1827
+ const key2 = `${source.maskSource}|${width}x${height}`;
1828
+ if (this.depthMaps.has(key2)) continue;
1759
1829
  try {
1760
1830
  const maskImg = await this.imageCache.get(source.maskSource);
1761
1831
  const canvas = this.createCanvas(width, height);
1762
1832
  const mctx = canvas.getContext("2d");
1763
1833
  const data = mctx ? (mctx.drawImage(maskImg, 0, 0, width, height), _optionalChain([mctx, 'access', _41 => _41.getImageData, 'optionalCall', _42 => _42(0, 0, width, height)])) : null;
1764
1834
  if (data) {
1765
- this.depthMaps.set(key, { width, height, data: data.data });
1835
+ this.depthMaps.set(key2, { width, height, data: data.data });
1766
1836
  this.assetVersion++;
1767
1837
  }
1768
- } catch (e12) {
1838
+ } catch (e13) {
1769
1839
  }
1770
1840
  }
1771
1841
  if (l.type === "annotation" && l.annotation.type === "image" && !this.imageCache.peek(l.annotation.src)) {
1772
1842
  try {
1773
1843
  await this.imageCache.get(l.annotation.src);
1774
1844
  this.assetVersion++;
1775
- } catch (e13) {
1845
+ } catch (e14) {
1776
1846
  }
1777
1847
  }
1778
1848
  }
@@ -1783,34 +1853,34 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1783
1853
  return Boolean(ctx && typeof ctx.getImageData === "function");
1784
1854
  }
1785
1855
  /** One annotation drawn into a tile-sized RGBA buffer at `rect` (document space), or `null` without a canvas. */
1786
- rasterizeAnnotation(annotation, rect) {
1787
- if (!this.scratch) this.scratch = this.createCanvas(rect.width, rect.height);
1856
+ rasterizeAnnotation(annotation, rect2) {
1857
+ if (!this.scratch) this.scratch = this.createCanvas(rect2.width, rect2.height);
1788
1858
  const canvas = this.scratch;
1789
- if (canvas.width !== rect.width || canvas.height !== rect.height) {
1790
- canvas.width = rect.width;
1791
- canvas.height = rect.height;
1859
+ if (canvas.width !== rect2.width || canvas.height !== rect2.height) {
1860
+ canvas.width = rect2.width;
1861
+ canvas.height = rect2.height;
1792
1862
  }
1793
1863
  const ctx = canvas.getContext("2d");
1794
1864
  if (!ctx || typeof ctx.getImageData !== "function") return null;
1795
1865
  try {
1796
1866
  ctx.setTransform(1, 0, 0, 1, 0, 0);
1797
- ctx.clearRect(0, 0, rect.width, rect.height);
1798
- ctx.setTransform(1, 0, 0, 1, -rect.x, -rect.y);
1867
+ ctx.clearRect(0, 0, rect2.width, rect2.height);
1868
+ ctx.setTransform(1, 0, 0, 1, -rect2.x, -rect2.y);
1799
1869
  const img = annotation.type === "image" ? _nullishCoalesce(this.imageCache.peek(annotation.src), () => ( null)) : null;
1800
1870
  this.drawAnnotationShape(ctx, annotation, img);
1801
1871
  ctx.setTransform(1, 0, 0, 1, 0, 0);
1802
- return new Uint8ClampedArray(ctx.getImageData(0, 0, rect.width, rect.height).data);
1803
- } catch (e14) {
1872
+ return new Uint8ClampedArray(ctx.getImageData(0, 0, rect2.width, rect2.height).data);
1873
+ } catch (e15) {
1804
1874
  return null;
1805
1875
  }
1806
1876
  }
1807
- putTile(ctx, data, tx, ty, rect) {
1808
- const ox = tx * _chunk474IQG74cjs.TILE - rect.x;
1809
- const oy = ty * _chunk474IQG74cjs.TILE - rect.y;
1877
+ putTile(ctx, data, tx, ty, rect2) {
1878
+ const ox = tx * _chunk474IQG74cjs.TILE - rect2.x;
1879
+ const oy = ty * _chunk474IQG74cjs.TILE - rect2.y;
1810
1880
  const x0 = Math.max(0, -ox);
1811
1881
  const y0 = Math.max(0, -oy);
1812
- const x1 = Math.min(_chunk474IQG74cjs.TILE, rect.width - ox);
1813
- const y1 = Math.min(_chunk474IQG74cjs.TILE, rect.height - oy);
1882
+ const x1 = Math.min(_chunk474IQG74cjs.TILE, rect2.width - ox);
1883
+ const y1 = Math.min(_chunk474IQG74cjs.TILE, rect2.height - oy);
1814
1884
  if (x1 <= x0 || y1 <= y0) return;
1815
1885
  const img = ctx.createImageData(_chunk474IQG74cjs.TILE, _chunk474IQG74cjs.TILE);
1816
1886
  img.data.set(data);
@@ -1822,23 +1892,23 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1822
1892
  * uploading only the tiles that changed since the last render.
1823
1893
  */
1824
1894
  updateComposite(layers, region, width, height, options = {}) {
1825
- const rect = coveringRect(region);
1895
+ const rect2 = coveringRect(region);
1826
1896
  let comp = this.comp;
1827
1897
  let fresh = false;
1828
- if (!comp || comp.rect.x !== rect.x || comp.rect.y !== rect.y || comp.rect.width !== rect.width || comp.rect.height !== rect.height) {
1829
- const canvas = this.createCanvas(rect.width, rect.height);
1830
- comp = this.comp = new CompositeCanvas(canvas, rect);
1898
+ if (!comp || comp.rect.x !== rect2.x || comp.rect.y !== rect2.y || comp.rect.width !== rect2.width || comp.rect.height !== rect2.height) {
1899
+ const canvas = this.createCanvas(rect2.width, rect2.height);
1900
+ comp = this.comp = new CompositeCanvas(canvas, rect2);
1831
1901
  fresh = true;
1832
1902
  }
1833
1903
  const ctx = comp.canvas.getContext("2d");
1834
1904
  if (!ctx || typeof ctx.createImageData !== "function") return null;
1835
1905
  let changed = false;
1836
- this.compositor.compositeTiles(layers, rect, this.compositorSources(width, height), (tx, ty, data) => {
1837
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
1838
- if (comp.tiles.get(key) === data) return;
1839
- comp.tiles.set(key, data);
1840
- comp.histograms.delete(key);
1841
- this.putTile(ctx, data, tx, ty, rect);
1906
+ this.compositor.compositeTiles(layers, rect2, this.compositorSources(width, height), (tx, ty, data) => {
1907
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
1908
+ if (comp.tiles.get(key2) === data) return;
1909
+ comp.tiles.set(key2, data);
1910
+ comp.histograms.delete(key2);
1911
+ this.putTile(ctx, data, tx, ty, rect2);
1842
1912
  changed = true;
1843
1913
  }, { checkpointLayerId: options.checkpointLayerId, dirty: fresh ? void 0 : options.dirty });
1844
1914
  if (changed) comp.version++;
@@ -1857,8 +1927,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1857
1927
  const rotated = _chunkH65IBXFIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1858
1928
  const baseW = Math.max(1, Math.round(rotated.width));
1859
1929
  const baseH = Math.max(1, Math.round(rotated.height));
1860
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkH65IBXFIcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1861
- if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1930
+ const key2 = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkH65IBXFIcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1931
+ if (this.cachedPostCanvas && this.cachedPostKey === key2) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1862
1932
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1863
1933
  const ctx = canvas.getContext("2d");
1864
1934
  if (!ctx) return null;
@@ -1872,7 +1942,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1872
1942
  ctx.restore();
1873
1943
  const histogram = this.applyPost(ctx, baseW, baseH, state);
1874
1944
  this.cachedPostCanvas = canvas;
1875
- this.cachedPostKey = key;
1945
+ this.cachedPostKey = key2;
1876
1946
  this.cachedPostHistogram = histogram;
1877
1947
  return { canvas, histogram };
1878
1948
  }
@@ -1908,11 +1978,11 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1908
1978
  /** A layer's mask as canvas-sized coverage for its mask view, kept while the mask is unchanged. */
1909
1979
  maskViewSelection(layer, width, height) {
1910
1980
  if (!layer.mask || layer.mask.source || width < 1 || height < 1) return null;
1911
- const key = `${width}x${height}:${layer.type === "pixel" ? `${layer.offset.x},${layer.offset.y}` : ""}`;
1981
+ const key2 = `${width}x${height}:${layer.type === "pixel" ? `${layer.offset.x},${layer.offset.y}` : ""}`;
1912
1982
  const cached = this.maskViewCache.get(layer.mask.surface);
1913
- if (_optionalChain([cached, 'optionalAccess', _49 => _49.key]) === key) return cached.mask;
1983
+ if (_optionalChain([cached, 'optionalAccess', _49 => _49.key]) === key2) return cached.mask;
1914
1984
  const mask = _chunkH65IBXFIcjs.layerMaskSelection.call(void 0, layer, width, height);
1915
- if (mask) this.maskViewCache.set(layer.mask.surface, { key, mask });
1985
+ if (mask) this.maskViewCache.set(layer.mask.surface, { key: key2, mask });
1916
1986
  return mask;
1917
1987
  }
1918
1988
  /** A mask alone in grey (white = revealed), opaque, drawn in natural image space. */
@@ -1931,16 +2001,16 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1931
2001
  }
1932
2002
  /** A channel's tint (colour, opacity, masked or selected area), drawn in natural image space. */
1933
2003
  drawMaskOverlay(ctx, mask, style) {
1934
- const key = `${_optionalChain([style, 'access', _50 => _50.color, 'optionalAccess', _51 => _51.join, 'call', _52 => _52(",")])}|${style.opacity}|${style.indicates}`;
2004
+ const key2 = `${_optionalChain([style, 'access', _50 => _50.color, 'optionalAccess', _51 => _51.join, 'call', _52 => _52(",")])}|${style.opacity}|${style.indicates}`;
1935
2005
  let cached = this.overlayCache.get(mask);
1936
- if (!cached || cached.key !== key) {
2006
+ if (!cached || cached.key !== key2) {
1937
2007
  const canvas = this.createCanvas(mask.width, mask.height);
1938
2008
  const mctx = canvas.getContext("2d");
1939
2009
  if (!mctx || typeof mctx.createImageData !== "function") return;
1940
2010
  const img = mctx.createImageData(mask.width, mask.height);
1941
2011
  img.data.set(quickMaskPixels(mask, style));
1942
2012
  mctx.putImageData(img, 0, 0);
1943
- cached = { key, canvas };
2013
+ cached = { key: key2, canvas };
1944
2014
  this.overlayCache.set(mask, cached);
1945
2015
  }
1946
2016
  ctx.drawImage(cached.canvas, 0, 0, mask.width, mask.height);
@@ -2001,11 +2071,11 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2001
2071
  if (typeof ctx.setLineDash === "function") ctx.setLineDash([]);
2002
2072
  }
2003
2073
  getSourceId(img) {
2004
- const key = img;
2005
- let id = this.sourceIds.get(key);
2074
+ const key2 = img;
2075
+ let id = this.sourceIds.get(key2);
2006
2076
  if (id === void 0) {
2007
2077
  id = ++this.nextSourceId;
2008
- this.sourceIds.set(key, id);
2078
+ this.sourceIds.set(key2, id);
2009
2079
  }
2010
2080
  return id;
2011
2081
  }
@@ -2054,7 +2124,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2054
2124
  _chunkOLNIPTB3cjs.blendImageData.call(void 0, backdrop, source, _chunkOLNIPTB3cjs.normalizeBlendMode.call(void 0, ann.blend));
2055
2125
  lctx.setTransform(1, 0, 0, 1, 0, 0);
2056
2126
  lctx.putImageData(backdrop, 0, 0);
2057
- } catch (e15) {
2127
+ } catch (e16) {
2058
2128
  return false;
2059
2129
  }
2060
2130
  ctx.save();
@@ -2070,7 +2140,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2070
2140
  if (ann.type === "image") {
2071
2141
  try {
2072
2142
  img = await this.imageCache.get(ann.src);
2073
- } catch (e16) {
2143
+ } catch (e17) {
2074
2144
  }
2075
2145
  }
2076
2146
  this.drawAnnotationShape(ctx, ann, img);
@@ -2104,15 +2174,15 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2104
2174
  break;
2105
2175
  }
2106
2176
  case "rect": {
2107
- const rect = ann;
2108
- ctx.strokeStyle = rect.strokeColor;
2109
- ctx.lineWidth = rect.strokeWidth;
2110
- if (rect.fillColor) {
2111
- ctx.fillStyle = rect.fillColor;
2112
- ctx.fillRect(rect.x, rect.y, rect.width, rect.height);
2177
+ const rect2 = ann;
2178
+ ctx.strokeStyle = rect2.strokeColor;
2179
+ ctx.lineWidth = rect2.strokeWidth;
2180
+ if (rect2.fillColor) {
2181
+ ctx.fillStyle = rect2.fillColor;
2182
+ ctx.fillRect(rect2.x, rect2.y, rect2.width, rect2.height);
2113
2183
  }
2114
- if (rect.strokeWidth > 0) {
2115
- ctx.strokeRect(rect.x, rect.y, rect.width, rect.height);
2184
+ if (rect2.strokeWidth > 0) {
2185
+ ctx.strokeRect(rect2.x, rect2.y, rect2.width, rect2.height);
2116
2186
  }
2117
2187
  break;
2118
2188
  }
@@ -2303,12 +2373,12 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2303
2373
  const split = splitOverlayAnnotations(layers);
2304
2374
  overlay = split.overlay.map((l) => l.annotation);
2305
2375
  await this.prepareLayerAssets(split.composite, naturalWidth, naturalHeight);
2306
- const rect = coveringRect(region);
2307
- const comp = this.createCanvas(rect.width, rect.height);
2376
+ const rect2 = coveringRect(region);
2377
+ const comp = this.createCanvas(rect2.width, rect2.height);
2308
2378
  const cctx = comp.getContext("2d");
2309
2379
  if (cctx && typeof cctx.createImageData === "function") {
2310
- this.exportCompositor.compositeTiles(split.composite, rect, this.compositorSources(naturalWidth, naturalHeight), (tx, ty, data) => {
2311
- this.putTile(cctx, data, tx, ty, rect);
2380
+ this.exportCompositor.compositeTiles(split.composite, rect2, this.compositorSources(naturalWidth, naturalHeight), (tx, ty, data) => {
2381
+ this.putTile(cctx, data, tx, ty, rect2);
2312
2382
  });
2313
2383
  }
2314
2384
  baseCanvas = this.createCanvas(baseW, baseH);
@@ -2319,7 +2389,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2319
2389
  bctx.beginPath();
2320
2390
  bctx.rect(region.x, region.y, region.width, region.height);
2321
2391
  bctx.clip();
2322
- bctx.drawImage(comp, rect.x, rect.y);
2392
+ bctx.drawImage(comp, rect2.x, rect2.y);
2323
2393
  bctx.restore();
2324
2394
  this.applyPost(bctx, baseW, baseH, state);
2325
2395
  }
@@ -2447,10 +2517,10 @@ function getBaseProjection(region, transform, baseW, baseH) {
2447
2517
  };
2448
2518
  }
2449
2519
  var CompositeCanvas = (_class3 = class {
2450
- constructor(canvas, rect) {;_class3.prototype.__init27.call(this);_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);
2520
+ constructor(canvas, rect2) {;_class3.prototype.__init27.call(this);_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);
2451
2521
  this.canvas = canvas;
2452
- this.rect = rect;
2453
- this.region = rect;
2522
+ this.rect = rect2;
2523
+ this.region = rect2;
2454
2524
  }
2455
2525
 
2456
2526
 
@@ -2463,18 +2533,18 @@ var CompositeCanvas = (_class3 = class {
2463
2533
  if (!this.tiles.size) return null;
2464
2534
  const r = coveringRect(this.region);
2465
2535
  const parts = [];
2466
- for (const [key, data] of this.tiles) {
2467
- let h = this.histograms.get(key);
2536
+ for (const [key2, data] of this.tiles) {
2537
+ let h = this.histograms.get(key2);
2468
2538
  if (!h) {
2469
- const tx = key % 65536 - 32768;
2470
- const ty = Math.floor(key / 65536) - 32768;
2539
+ const tx = key2 % 65536 - 32768;
2540
+ const ty = Math.floor(key2 / 65536) - 32768;
2471
2541
  const x0 = Math.max(r.x, tx * _chunk474IQG74cjs.TILE);
2472
2542
  const y0 = Math.max(r.y, ty * _chunk474IQG74cjs.TILE);
2473
2543
  const x1 = Math.min(r.x + r.width, tx * _chunk474IQG74cjs.TILE + _chunk474IQG74cjs.TILE);
2474
2544
  const y1 = Math.min(r.y + r.height, ty * _chunk474IQG74cjs.TILE + _chunk474IQG74cjs.TILE);
2475
2545
  h = emptyHistogram();
2476
2546
  if (x1 > x0 && y1 > y0) addToHistogram(h, data, _chunk474IQG74cjs.TILE, { x: x0 - tx * _chunk474IQG74cjs.TILE, y: y0 - ty * _chunk474IQG74cjs.TILE, width: x1 - x0, height: y1 - y0 });
2477
- this.histograms.set(key, h);
2547
+ this.histograms.set(key2, h);
2478
2548
  }
2479
2549
  parts.push(h);
2480
2550
  }
@@ -2513,7 +2583,7 @@ function selectionToSubpaths(mask, options = {}) {
2513
2583
  for (let x = 0; x < w; x++) field[y * w + x] = data[row + x] / 255;
2514
2584
  }
2515
2585
  const threshold = Math.min(254, Math.max(1, _nullishCoalesce(options.threshold, () => ( 128)))) / 255;
2516
- const subpaths = _chunk3T5VCDIVcjs.traceField.call(void 0, field, w, h, threshold, {
2586
+ const subpaths = _chunkLCCMOWR7cjs.traceField.call(void 0, field, w, h, threshold, {
2517
2587
  tolerance: Math.max(0.1, _nullishCoalesce(options.tolerance, () => ( 0.5))),
2518
2588
  cornerRoundness: _nullishCoalesce(options.cornerRoundness, () => ( 0.5)),
2519
2589
  minArea: _nullishCoalesce(options.minArea, () => ( 4)),
@@ -2547,12 +2617,12 @@ function pathToSelection(components, width, height, options = {}) {
2547
2617
  const rx1 = Math.min(width, Math.ceil(x1));
2548
2618
  const ry1 = Math.min(height, Math.ceil(y1));
2549
2619
  if (!(rx1 > rx0 && ry1 > ry0)) return _chunkQYLWG22Ncjs.createSelectionMask.call(void 0, width, height);
2550
- const rect = { x: rx0, y: ry0, width: rx1 - rx0, height: ry1 - ry0 };
2551
- const cov = _chunkH65IBXFIcjs.componentsCoverage.call(void 0, components, rect, _nullishCoalesce(options.fillRule, () => ( "nonzero")));
2620
+ const rect2 = { x: rx0, y: ry0, width: rx1 - rx0, height: ry1 - ry0 };
2621
+ const cov = _chunkH65IBXFIcjs.componentsCoverage.call(void 0, components, rect2, _nullishCoalesce(options.fillRule, () => ( "nonzero")));
2552
2622
  const hard = options.antiAlias === false;
2553
2623
  const bytes = new Uint8Array(cov.length);
2554
2624
  for (let i = 0; i < cov.length; i++) bytes[i] = hard ? cov[i] >= 0.5 ? 255 : 0 : _chunkQYLWG22Ncjs.coverageToByte.call(void 0, cov[i]);
2555
- const mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect, bytes);
2625
+ const mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect2, bytes);
2556
2626
  const feather = _nullishCoalesce(options.feather, () => ( 0));
2557
2627
  return feather > 0 && mask.bounds ? _chunkQYLWG22Ncjs.modifySelection.call(void 0, mask, "feather", feather) : mask;
2558
2628
  }
@@ -2591,11 +2661,11 @@ var EdgeMap = (_class4 = class {
2591
2661
  block(x, y) {
2592
2662
  const bx = Math.floor(x / BLOCK);
2593
2663
  const by = Math.floor(y / BLOCK);
2594
- const key = by * 65536 + bx;
2595
- let b = this.blocks.get(key);
2664
+ const key2 = by * 65536 + bx;
2665
+ let b = this.blocks.get(key2);
2596
2666
  if (!b) {
2597
2667
  b = this.computeBlock(bx * BLOCK, by * BLOCK);
2598
- this.blocks.set(key, b);
2668
+ this.blocks.set(key2, b);
2599
2669
  }
2600
2670
  return b;
2601
2671
  }
@@ -2689,7 +2759,7 @@ var Heap = (_class5 = class {constructor() { _class5.prototype.__init31.call(thi
2689
2759
  __init31() {this.ids = new Int32Array(256)}
2690
2760
  __init32() {this.keys = new Float64Array(256)}
2691
2761
  __init33() {this.size = 0}
2692
- push(id, key) {
2762
+ push(id, key2) {
2693
2763
  if (this.size === this.ids.length) {
2694
2764
  const ids = new Int32Array(this.size * 2);
2695
2765
  ids.set(this.ids);
@@ -2701,31 +2771,31 @@ var Heap = (_class5 = class {constructor() { _class5.prototype.__init31.call(thi
2701
2771
  let i = this.size++;
2702
2772
  while (i > 0) {
2703
2773
  const p = i - 1 >> 1;
2704
- if (this.keys[p] <= key) break;
2774
+ if (this.keys[p] <= key2) break;
2705
2775
  this.ids[i] = this.ids[p];
2706
2776
  this.keys[i] = this.keys[p];
2707
2777
  i = p;
2708
2778
  }
2709
2779
  this.ids[i] = id;
2710
- this.keys[i] = key;
2780
+ this.keys[i] = key2;
2711
2781
  }
2712
2782
  /** Removes the cheapest entry; read it from `topId` / `topKey` first. */
2713
2783
  pop() {
2714
2784
  const n = --this.size;
2715
2785
  const id = this.ids[n];
2716
- const key = this.keys[n];
2786
+ const key2 = this.keys[n];
2717
2787
  let i = 0;
2718
2788
  for (; ; ) {
2719
2789
  let c = 2 * i + 1;
2720
2790
  if (c >= n) break;
2721
2791
  if (c + 1 < n && this.keys[c + 1] < this.keys[c]) c++;
2722
- if (this.keys[c] >= key) break;
2792
+ if (this.keys[c] >= key2) break;
2723
2793
  this.ids[i] = this.ids[c];
2724
2794
  this.keys[i] = this.keys[c];
2725
2795
  i = c;
2726
2796
  }
2727
2797
  this.ids[i] = id;
2728
- this.keys[i] = key;
2798
+ this.keys[i] = key2;
2729
2799
  }
2730
2800
  get topId() {
2731
2801
  return this.ids[0];
@@ -3258,14 +3328,14 @@ var TextEditSession = (_class7 = class {
3258
3328
  if (!this.text.trim().length) {
3259
3329
  try {
3260
3330
  this.controller.removeLayer(this.layerId);
3261
- } catch (e17) {
3331
+ } catch (e18) {
3262
3332
  }
3263
3333
  return false;
3264
3334
  }
3265
3335
  if (this.layer.name === "Text" && this.changed) {
3266
3336
  try {
3267
3337
  this.controller.setLayerProperties(this.layerId, { name: _chunkH65IBXFIcjs.typeLayerName.call(void 0, this.text) }, false);
3268
- } catch (e18) {
3338
+ } catch (e19) {
3269
3339
  }
3270
3340
  }
3271
3341
  return true;
@@ -3885,29 +3955,29 @@ var ImageEffectsEngine = (_class9 = class {
3885
3955
  return this.pending.size > 0;
3886
3956
  }
3887
3957
  /** See `SmartEffectResolver`. */
3888
- resolve(filter, input, width, height, key) {
3889
- const hit = this.cache.get(key);
3958
+ resolve(filter, input, width, height, key2) {
3959
+ const hit = this.cache.get(key2);
3890
3960
  if (hit) {
3891
- this.cache.delete(key);
3892
- this.cache.set(key, hit);
3961
+ this.cache.delete(key2);
3962
+ this.cache.set(key2, hit);
3893
3963
  return { result: hit, pending: false };
3894
3964
  }
3895
- if (this.pending.has(key)) return { result: null, pending: true };
3965
+ if (this.pending.has(key2)) return { result: null, pending: true };
3896
3966
  const provider = this.slot.provider;
3897
- if (!provider || this.failures.has(key)) return { result: null, pending: false };
3967
+ if (!provider || this.failures.has(key2)) return { result: null, pending: false };
3898
3968
  const generation = this.generation;
3899
3969
  const source = { width, height, data: new Uint8ClampedArray(input) };
3900
3970
  const run = this.filter(provider, filter.effect, filter.values, source).then((out) => {
3901
3971
  if (generation !== this.generation) return;
3902
- this.cache.set(key, out);
3972
+ this.cache.set(key2, out);
3903
3973
  while (this.cache.size > this.maxEntries) this.cache.delete(this.cache.keys().next().value);
3904
3974
  }).catch((error) => {
3905
- if (generation === this.generation) this.failures.set(key, error instanceof Error ? error : new Error(String(error)));
3975
+ if (generation === this.generation) this.failures.set(key2, error instanceof Error ? error : new Error(String(error)));
3906
3976
  }).finally(() => {
3907
- if (this.pending.get(key) === run) this.pending.delete(key);
3977
+ if (this.pending.get(key2) === run) this.pending.delete(key2);
3908
3978
  if (generation === this.generation) this.notify();
3909
3979
  });
3910
- this.pending.set(key, run);
3980
+ this.pending.set(key2, run);
3911
3981
  return { result: null, pending: true };
3912
3982
  }
3913
3983
  /** A filter effect over `source`: its result, or (for an overlay) the effect drawn over it. */
@@ -3928,12 +3998,12 @@ var ImageEffectsEngine = (_class9 = class {
3928
3998
  return out.width === size.width && out.height === size.height ? out : _chunkA3A5TI6Rcjs.createEffectPixels.call(void 0, size.width, size.height);
3929
3999
  }
3930
4000
  /** Why the result for `key` failed, if it did. */
3931
- failure(key) {
3932
- return this.failures.get(key);
4001
+ failure(key2) {
4002
+ return this.failures.get(key2);
3933
4003
  }
3934
4004
  /** Every failure so far. */
3935
4005
  failuresList() {
3936
- return [...this.failures].map(([key, error]) => ({ key, error }));
4006
+ return [...this.failures].map(([key2, error]) => ({ key: key2, error }));
3937
4007
  }
3938
4008
  /** Resolves when nothing is rendering. */
3939
4009
  async idle() {
@@ -4556,10 +4626,10 @@ function resolveProfile(doc) {
4556
4626
  let p;
4557
4627
  if (doc.builtin) p = _chunkBROJYMWUcjs.builtinProfile.call(void 0, doc.builtin);
4558
4628
  else if (doc.icc) {
4559
- const key = _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, doc.icc);
4560
- p = _nullishCoalesce(fromBytes.get(key), () => ( _chunkBROJYMWUcjs.parseProfile.call(void 0, doc.icc)));
4629
+ const key2 = _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, doc.icc);
4630
+ p = _nullishCoalesce(fromBytes.get(key2), () => ( _chunkBROJYMWUcjs.parseProfile.call(void 0, doc.icc)));
4561
4631
  if (fromBytes.size > 32) fromBytes.clear();
4562
- fromBytes.set(key, p);
4632
+ fromBytes.set(key2, p);
4563
4633
  } else p = _chunkBROJYMWUcjs.srgbProfile.call(void 0, );
4564
4634
  resolved.set(doc, p);
4565
4635
  return p;
@@ -4582,7 +4652,7 @@ function isSrgb(doc) {
4582
4652
  if (!doc || doc.builtin === "srgb") return true;
4583
4653
  try {
4584
4654
  return _chunkBROJYMWUcjs.sameColors.call(void 0, resolveProfile(doc), _chunkBROJYMWUcjs.srgbProfile.call(void 0, ), _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"));
4585
- } catch (e19) {
4655
+ } catch (e20) {
4586
4656
  return false;
4587
4657
  }
4588
4658
  }
@@ -4649,12 +4719,12 @@ function convertHex(hex, from, to, intent = "relative", bpc = true) {
4649
4719
  return `#${c(out[0])}${c(out[1])}${c(out[2])}`;
4650
4720
  }
4651
4721
  function convertColorFields(value, convert) {
4652
- const walk = (v, key) => {
4653
- if (typeof v === "string") return /color$/i.test(key) && /^#[0-9a-f]{6}$/i.test(v) ? convert(v) : v;
4722
+ const walk = (v, key2) => {
4723
+ if (typeof v === "string") return /color$/i.test(key2) && /^#[0-9a-f]{6}$/i.test(v) ? convert(v) : v;
4654
4724
  if (Array.isArray(v)) {
4655
4725
  let changed = false;
4656
4726
  const out = v.map((x) => {
4657
- const y = walk(x, key);
4727
+ const y = walk(x, key2);
4658
4728
  if (y !== x) changed = true;
4659
4729
  return y;
4660
4730
  });
@@ -4676,7 +4746,7 @@ function convertSurfaceColors(surface, t) {
4676
4746
  if (surface.channels !== 4 || t.inputs !== 3 || t.outputs !== 3) return surface;
4677
4747
  const tiles = /* @__PURE__ */ new Map();
4678
4748
  const memo = /* @__PURE__ */ new Map();
4679
- for (const [key, tile] of surface.tiles) {
4749
+ for (const [key2, tile] of surface.tiles) {
4680
4750
  let next = memo.get(tile);
4681
4751
  if (next === void 0) {
4682
4752
  if (tile.deep instanceof Uint16Array) {
@@ -4699,7 +4769,7 @@ function convertSurfaceColors(surface, t) {
4699
4769
  }
4700
4770
  memo.set(tile, next);
4701
4771
  }
4702
- if (next) tiles.set(key, next);
4772
+ if (next) tiles.set(key2, next);
4703
4773
  }
4704
4774
  return new (0, _chunk474IQG74cjs.TiledSurface)(4, tiles, surface.defaultValue);
4705
4775
  }
@@ -4716,22 +4786,22 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
4716
4786
  const done = /* @__PURE__ */ new Set();
4717
4787
  for (const r of rects) {
4718
4788
  for (const t of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: r.x - apply.offset.x, y: r.y - apply.offset.y, width: r.width, height: r.height })) {
4719
- const key = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4720
- if (done.has(key)) continue;
4721
- done.add(key);
4789
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4790
+ if (done.has(key2)) continue;
4791
+ done.add(key2);
4722
4792
  if (depth) {
4723
4793
  const ch = base.channels;
4724
- const d = _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkOLNIPTB3cjs.tileSamples.call(void 0, base.tiles.get(key), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
4794
+ const d = _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkOLNIPTB3cjs.tileSamples.call(void 0, base.tiles.get(key2), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
4725
4795
  const tile2 = _chunkOLNIPTB3cjs.deepTile.call(void 0, d, ch, base.defaultValue);
4726
- if (tile2) tiles.set(key, tile2);
4727
- else tiles.delete(key);
4796
+ if (tile2) tiles.set(key2, tile2);
4797
+ else tiles.delete(key2);
4728
4798
  continue;
4729
4799
  }
4730
- const src = _nullishCoalesce(_optionalChain([base, 'access', _105 => _105.tiles, 'access', _106 => _106.get, 'call', _107 => _107(key), 'optionalAccess', _108 => _108.data]), () => ( defaultTile(base)));
4800
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _105 => _105.tiles, 'access', _106 => _106.get, 'call', _107 => _107(key2), 'optionalAccess', _108 => _108.data]), () => ( defaultTile(base)));
4731
4801
  const data = _chunkPQ3H2AANcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
4732
4802
  const tile = _chunk474IQG74cjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
4733
- if (tile) tiles.set(key, tile);
4734
- else tiles.delete(key);
4803
+ if (tile) tiles.set(key2, tile);
4804
+ else tiles.delete(key2);
4735
4805
  }
4736
4806
  }
4737
4807
  return new (0, _chunk474IQG74cjs.TiledSurface)(base.channels, tiles, base.defaultValue);
@@ -4802,19 +4872,19 @@ var PaintStrokeSession = (_class11 = class {
4802
4872
  __init69() {this.work = /* @__PURE__ */ new Map()}
4803
4873
  __init70() {this.workRead = /* @__PURE__ */ new Map()}
4804
4874
  /** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
4805
- readWork(key) {
4806
- if (!this.workRead.has(key)) this.workRead.set(key, workTileOf(this.base.tiles.get(key)));
4807
- return this.workRead.get(key);
4875
+ readWork(key2) {
4876
+ if (!this.workRead.has(key2)) this.workRead.set(key2, workTileOf(this.base.tiles.get(key2)));
4877
+ return this.workRead.get(key2);
4808
4878
  }
4809
4879
  /** Clone, healing and the spot-heal trail at depth: `paint` through the coverage on the float working tile. */
4810
- retouchDeepTile(key, tx, ty, paint, options) {
4880
+ retouchDeepTile(key2, tx, ty, paint, options) {
4811
4881
  const r = this.retouch;
4812
- const read = this.readWork(key);
4882
+ const read = this.readWork(key2);
4813
4883
  const out = _chunkYF3YZZ6Gcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
4814
- this.work.set(key, out);
4815
- const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key));
4816
- this.liveDeep.set(key, d);
4817
- this.live.set(key, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4884
+ this.work.set(key2, out);
4885
+ const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key2));
4886
+ this.liveDeep.set(key2, d);
4887
+ this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4818
4888
  return d;
4819
4889
  }
4820
4890
  /** The new tile of a coverage stroke over the pre-stroke tile `src`. */
@@ -4828,23 +4898,23 @@ var PaintStrokeSession = (_class11 = class {
4828
4898
  const a = this.apply;
4829
4899
  const depth = this.dabDeep;
4830
4900
  if (depth) {
4831
- const read = (key) => this.readWork(key);
4901
+ const read = (key2) => this.readWork(key2);
4832
4902
  return {
4833
4903
  offset: a.offset,
4834
4904
  lockTransparency: a.lockTransparency,
4835
4905
  selection: a.selection,
4836
4906
  readTile: (tx, ty) => {
4837
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4838
- return _nullishCoalesce(this.work.get(key), () => ( read(key)));
4907
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4908
+ return _nullishCoalesce(this.work.get(key2), () => ( read(key2)));
4839
4909
  },
4840
4910
  writeTile: (tx, ty) => {
4841
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4842
- if (!this.touched.has(key)) {
4843
- this.work.set(key, _nullishCoalesce(_optionalChain([read, 'call', _109 => _109(key), 'optionalAccess', _110 => _110.slice, 'call', _111 => _111()]), () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))));
4844
- this.touched.add(key);
4911
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4912
+ if (!this.touched.has(key2)) {
4913
+ this.work.set(key2, _nullishCoalesce(_optionalChain([read, 'call', _109 => _109(key2), 'optionalAccess', _110 => _110.slice, 'call', _111 => _111()]), () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))));
4914
+ this.touched.add(key2);
4845
4915
  }
4846
- this.fresh.add(key);
4847
- return this.work.get(key);
4916
+ this.fresh.add(key2);
4917
+ return this.work.get(key2);
4848
4918
  }
4849
4919
  };
4850
4920
  }
@@ -4854,14 +4924,14 @@ var PaintStrokeSession = (_class11 = class {
4854
4924
  selection: a.selection,
4855
4925
  readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _112 => _112.live, 'access', _113 => _113.get, 'call', _114 => _114(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _115 => _115.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
4856
4926
  writeTile: (tx, ty) => {
4857
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4858
- if (!this.touched.has(key)) {
4859
- const src = _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.base, 'access', _117 => _117.tiles, 'access', _118 => _118.get, 'call', _119 => _119(key), 'optionalAccess', _120 => _120.data]), () => ( defaultTile(this.base)));
4860
- this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
4861
- this.touched.add(key);
4927
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4928
+ if (!this.touched.has(key2)) {
4929
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.base, 'access', _117 => _117.tiles, 'access', _118 => _118.get, 'call', _119 => _119(key2), 'optionalAccess', _120 => _120.data]), () => ( defaultTile(this.base)));
4930
+ this.live.set(key2, { data: new Uint8ClampedArray(src), uniform: null });
4931
+ this.touched.add(key2);
4862
4932
  }
4863
- this.fresh.add(key);
4864
- return this.live.get(key).data;
4933
+ this.fresh.add(key2);
4934
+ return this.live.get(key2).data;
4865
4935
  }
4866
4936
  };
4867
4937
  }
@@ -4885,12 +4955,12 @@ var PaintStrokeSession = (_class11 = class {
4885
4955
  const ch = this.base.channels;
4886
4956
  if (this.mixer) {
4887
4957
  if (this.dabDeep) {
4888
- for (const key of this.fresh) {
4889
- const d = deepOfWorkTile(this.work.get(key), this.dabDeep, _nullishCoalesce(this.workRead.get(key), () => ( null)), this.base.tiles.get(key));
4890
- this.liveDeep.set(key, d);
4891
- this.live.set(key, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4958
+ for (const key2 of this.fresh) {
4959
+ const d = deepOfWorkTile(this.work.get(key2), this.dabDeep, _nullishCoalesce(this.workRead.get(key2), () => ( null)), this.base.tiles.get(key2));
4960
+ this.liveDeep.set(key2, d);
4961
+ this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4892
4962
  }
4893
- } else for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
4963
+ } else for (const key2 of this.fresh) this.live.set(key2, { data: this.live.get(key2).data, uniform: null });
4894
4964
  this.fresh.clear();
4895
4965
  this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunk474IQG74cjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
4896
4966
  return;
@@ -4899,35 +4969,35 @@ var PaintStrokeSession = (_class11 = class {
4899
4969
  const regions = /* @__PURE__ */ new Map();
4900
4970
  for (const r of rects) {
4901
4971
  for (const t of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
4902
- const key = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4903
- const cur = regions.get(key);
4904
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkH65IBXFIcjs.unionRect.call(void 0, cur.r, r) : r });
4972
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4973
+ const cur = regions.get(key2);
4974
+ regions.set(key2, { tx: t.tx, ty: t.ty, r: cur ? _chunkH65IBXFIcjs.unionRect.call(void 0, cur.r, r) : r });
4905
4975
  }
4906
4976
  }
4907
- for (const [key, { tx, ty, r }] of regions) {
4977
+ for (const [key2, { tx, ty, r }] of regions) {
4908
4978
  if (this.deep) {
4909
4979
  const rt = this.retouch;
4910
4980
  const paint = _optionalChain([rt, 'optionalAccess', _125 => _125.kind]) === "coverage" ? rt.paint() : null;
4911
4981
  if (paint && paint.kind !== "tone") {
4912
- const prevWork = this.touched.has(key) ? this.work.get(key) : void 0;
4913
- this.touched.add(key);
4914
- this.retouchDeepTile(key, tx, ty, paint, prevWork ? { into: prevWork, region: r } : {});
4982
+ const prevWork = this.touched.has(key2) ? this.work.get(key2) : void 0;
4983
+ this.touched.add(key2);
4984
+ this.retouchDeepTile(key2, tx, ty, paint, prevWork ? { into: prevWork, region: r } : {});
4915
4985
  continue;
4916
4986
  }
4917
- const src2 = _chunkOLNIPTB3cjs.tileSamples.call(void 0, this.base.tiles.get(key), ch, this.deep, this.base.defaultValue);
4918
- const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
4919
- this.touched.add(key);
4987
+ const src2 = _chunkOLNIPTB3cjs.tileSamples.call(void 0, this.base.tiles.get(key2), ch, this.deep, this.base.defaultValue);
4988
+ const prev2 = this.touched.has(key2) ? this.liveDeep.get(key2) : void 0;
4989
+ this.touched.add(key2);
4920
4990
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
4921
4991
  const d = _optionalChain([rt, 'optionalAccess', _126 => _126.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _127 => _127.kind]) === "tone" ? _chunkYF3YZZ6Gcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
4922
- this.liveDeep.set(key, d);
4923
- this.live.set(key, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
4992
+ this.liveDeep.set(key2, d);
4993
+ this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
4924
4994
  continue;
4925
4995
  }
4926
- const src = _nullishCoalesce(_optionalChain([this, 'access', _128 => _128.base, 'access', _129 => _129.tiles, 'access', _130 => _130.get, 'call', _131 => _131(key), 'optionalAccess', _132 => _132.data]), () => ( defaultTile(this.base)));
4927
- const prev = this.touched.has(key) ? _optionalChain([this, 'access', _133 => _133.live, 'access', _134 => _134.get, 'call', _135 => _135(key), 'optionalAccess', _136 => _136.data]) : void 0;
4928
- this.touched.add(key);
4996
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _128 => _128.base, 'access', _129 => _129.tiles, 'access', _130 => _130.get, 'call', _131 => _131(key2), 'optionalAccess', _132 => _132.data]), () => ( defaultTile(this.base)));
4997
+ const prev = this.touched.has(key2) ? _optionalChain([this, 'access', _133 => _133.live, 'access', _134 => _134.get, 'call', _135 => _135(key2), 'optionalAccess', _136 => _136.data]) : void 0;
4998
+ this.touched.add(key2);
4929
4999
  const data = this.compositeTile(src, tx, ty, prev ? { into: prev, region: r } : {});
4930
- this.live.set(key, { data, uniform: null });
5000
+ this.live.set(key2, { data, uniform: null });
4931
5001
  }
4932
5002
  this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunk474IQG74cjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
4933
5003
  }
@@ -4944,26 +5014,26 @@ var PaintStrokeSession = (_class11 = class {
4944
5014
  if (_optionalChain([r, 'optionalAccess', _139 => _139.kind]) === "coverage" && r.finalPaint) {
4945
5015
  const final = r.finalPaint(this.stroke.coverage);
4946
5016
  if (final) {
4947
- for (const key of this.touched) {
4948
- const { tx, ty } = _chunk474IQG74cjs.tileCoord.call(void 0, key);
5017
+ for (const key2 of this.touched) {
5018
+ const { tx, ty } = _chunk474IQG74cjs.tileCoord.call(void 0, key2);
4949
5019
  if (this.deep) {
4950
- this.retouchDeepTile(key, tx, ty, final, {});
5020
+ this.retouchDeepTile(key2, tx, ty, final, {});
4951
5021
  continue;
4952
5022
  }
4953
- const src = _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.base, 'access', _141 => _141.tiles, 'access', _142 => _142.get, 'call', _143 => _143(key), 'optionalAccess', _144 => _144.data]), () => ( defaultTile(this.base)));
4954
- this.live.set(key, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
5023
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.base, 'access', _141 => _141.tiles, 'access', _142 => _142.get, 'call', _143 => _143(key2), 'optionalAccess', _144 => _144.data]), () => ( defaultTile(this.base)));
5024
+ this.live.set(key2, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
4955
5025
  }
4956
5026
  }
4957
5027
  }
4958
5028
  const tiles = new Map(this.base.tiles);
4959
5029
  let changed = false;
4960
- for (const key of this.touched) {
4961
- const live = this.live.get(key);
4962
- const deep = this.liveDeep.get(key);
5030
+ for (const key2 of this.touched) {
5031
+ const live = this.live.get(key2);
5032
+ const deep = this.liveDeep.get(key2);
4963
5033
  const tile = deep ? _chunkOLNIPTB3cjs.deepTile.call(void 0, deep, ch, this.base.defaultValue) : _chunk474IQG74cjs.finishTile.call(void 0, live.data, ch, this.base.defaultValue);
4964
- const prev = this.base.tiles.get(key);
4965
- if (tile) tiles.set(key, tile);
4966
- else tiles.delete(key);
5034
+ const prev = this.base.tiles.get(key2);
5035
+ if (tile) tiles.set(key2, tile);
5036
+ else tiles.delete(key2);
4967
5037
  if (!sameTile(prev, tile)) changed = true;
4968
5038
  }
4969
5039
  const surface = changed ? new (0, _chunk474IQG74cjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
@@ -4982,9 +5052,9 @@ var PaintStrokeSession = (_class11 = class {
4982
5052
  this.controller._strokeCommit(this.before, this.target.id, this.target.channel, null);
4983
5053
  }
4984
5054
  }, _class11);
4985
- function workRegionOf(surface, rect, depth) {
4986
- if (!depth) return Float32Array.from(_chunk474IQG74cjs.readRegion.call(void 0, surface, rect));
4987
- const d = _chunkOLNIPTB3cjs.readDeepRegion.call(void 0, surface, rect, depth);
5055
+ function workRegionOf(surface, rect2, depth) {
5056
+ if (!depth) return Float32Array.from(_chunk474IQG74cjs.readRegion.call(void 0, surface, rect2));
5057
+ const d = _chunkOLNIPTB3cjs.readDeepRegion.call(void 0, surface, rect2, depth);
4988
5058
  const out = new Float32Array(d.length);
4989
5059
  if (d instanceof Uint16Array) {
4990
5060
  for (let i = 0; i < d.length; i++) out[i] = d[i] / 257;
@@ -5221,7 +5291,7 @@ var ImageEditorController = (_class12 = class {
5221
5291
  if (_optionalChain([options, 'access', _154 => _154.initialState, 'optionalAccess', _155 => _155.selection])) {
5222
5292
  try {
5223
5293
  this.state.selection = normalizeSelection(_chunkQYLWG22Ncjs.deserializeSelection.call(void 0, options.initialState.selection));
5224
- } catch (e20) {
5294
+ } catch (e21) {
5225
5295
  }
5226
5296
  }
5227
5297
  if (_optionalChain([options, 'access', _156 => _156.initialState, 'optionalAccess', _157 => _157.channels])) {
@@ -5267,7 +5337,7 @@ var ImageEditorController = (_class12 = class {
5267
5337
  height: img.naturalHeight || img.height || 600
5268
5338
  }
5269
5339
  };
5270
- } catch (e21) {
5340
+ } catch (e22) {
5271
5341
  return { sourceUrl: src, element: null, dimensions: { ...this.state.imageDimensions } };
5272
5342
  }
5273
5343
  }
@@ -5341,7 +5411,7 @@ var ImageEditorController = (_class12 = class {
5341
5411
  try {
5342
5412
  const r = _chunkH65IBXFIcjs.rerender.call(void 0, l, canvas);
5343
5413
  if (all || !_chunkH65IBXFIcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
5344
- } catch (e22) {
5414
+ } catch (e23) {
5345
5415
  }
5346
5416
  }
5347
5417
  if (next2 !== l) {
@@ -5664,16 +5734,16 @@ var ImageEditorController = (_class12 = class {
5664
5734
  this.displayFor = [s.colorProfile, s.proofSetup, s.colorMode];
5665
5735
  try {
5666
5736
  this.renderer.setDisplayTransform(displayTransform(s.colorProfile, effectiveProof(s.proofSetup, s.colorMode)));
5667
- } catch (e23) {
5737
+ } catch (e24) {
5668
5738
  this.renderer.setDisplayTransform(null);
5669
5739
  }
5670
5740
  }
5671
5741
  /** Recomputes the compatibility views (`adjustments`, `depthMask`, `annotations`) when the stack changed. */
5672
5742
  syncViews() {
5673
5743
  const s = this.state;
5674
- const key = [s.layers, s.outputOpacity, s.legacyOutputBlur, s.activeLayerId, s.imageDimensions.width, s.imageDimensions.height];
5675
- if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
5676
- this.viewKey = key;
5744
+ const key2 = [s.layers, s.outputOpacity, s.legacyOutputBlur, s.activeLayerId, s.imageDimensions.width, s.imageDimensions.height];
5745
+ if (key2.length === this.viewKey.length && key2.every((v, i) => v === this.viewKey[i])) return;
5746
+ this.viewKey = key2;
5677
5747
  const { width, height } = this.naturalSize;
5678
5748
  const view = _chunkH65IBXFIcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
5679
5749
  s.adjustments = view.adjustments;
@@ -6000,7 +6070,7 @@ var ImageEditorController = (_class12 = class {
6000
6070
  getLayerFrame(id) {
6001
6071
  const layer = this.getLayer(id);
6002
6072
  if (!layer) return null;
6003
- const rect = (b2) => [
6073
+ const rect2 = (b2) => [
6004
6074
  { x: b2.x, y: b2.y },
6005
6075
  { x: b2.x + b2.width, y: b2.y },
6006
6076
  { x: b2.x + b2.width, y: b2.y + b2.height },
@@ -6015,10 +6085,10 @@ var ImageEditorController = (_class12 = class {
6015
6085
  }
6016
6086
  if (layer.type === "shape") {
6017
6087
  const g = _chunkH65IBXFIcjs.shapeGeometryBounds.call(void 0, layer);
6018
- return g ? rect(g) : null;
6088
+ return g ? rect2(g) : null;
6019
6089
  }
6020
6090
  const b = this.getLayerBounds(id);
6021
- return b ? rect(b) : null;
6091
+ return b ? rect2(b) : null;
6022
6092
  }
6023
6093
  /**
6024
6094
  * Hit-tests the layer stack at `point` (in document space) and returns the id of the topmost
@@ -6099,9 +6169,9 @@ var ImageEditorController = (_class12 = class {
6099
6169
  * and are left out): `rect` (default: the canvas) as RGBA, straight alpha. Crop, rotation and
6100
6170
  * output opacity are not applied. With `layerIds`, only those layers are composited.
6101
6171
  */
6102
- compositePixels(rect, options = {}) {
6172
+ compositePixels(rect2, options = {}) {
6103
6173
  const { width, height } = this.naturalSize;
6104
- const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
6174
+ const r = _nullishCoalesce(rect2, () => ( { x: 0, y: 0, width, height }));
6105
6175
  let layers = this.state.layers;
6106
6176
  if (options.layerIds) {
6107
6177
  const keep = new Set(options.layerIds);
@@ -6125,12 +6195,12 @@ var ImageEditorController = (_class12 = class {
6125
6195
  __init94() {this.nextSourceId = 1}
6126
6196
  /** Changes whenever the Background's source pixels can have changed. */
6127
6197
  sourceVersion() {
6128
- const key = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
6129
- if (!key) return "0";
6130
- let id = this.sourceIds.get(key);
6198
+ const key2 = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
6199
+ if (!key2) return "0";
6200
+ let id = this.sourceIds.get(key2);
6131
6201
  if (!id) {
6132
6202
  id = this.nextSourceId++;
6133
- this.sourceIds.set(key, id);
6203
+ this.sourceIds.set(key2, id);
6134
6204
  }
6135
6205
  return String(id);
6136
6206
  }
@@ -6197,7 +6267,7 @@ var ImageEditorController = (_class12 = class {
6197
6267
  const data = ctx.getImageData(0, 0, width, height);
6198
6268
  if (!_optionalChain([data, 'optionalAccess', _208 => _208.data]) || data.data.length < width * height * 4) return null;
6199
6269
  return { width, height, data: data.data };
6200
- } catch (e24) {
6270
+ } catch (e25) {
6201
6271
  return null;
6202
6272
  }
6203
6273
  }
@@ -6278,7 +6348,7 @@ var ImageEditorController = (_class12 = class {
6278
6348
  try {
6279
6349
  const bytes = _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, trimmed);
6280
6350
  if (_chunkOLNIPTB3cjs.isPng.call(void 0, bytes)) png = bytes;
6281
- } catch (e25) {
6351
+ } catch (e26) {
6282
6352
  png = null;
6283
6353
  }
6284
6354
  }
@@ -6286,14 +6356,14 @@ var ImageEditorController = (_class12 = class {
6286
6356
  try {
6287
6357
  const d = _chunkOLNIPTB3cjs.decodePng.call(void 0, png);
6288
6358
  return { width: d.width, height: d.height, data: d.data };
6289
- } catch (e26) {
6359
+ } catch (e27) {
6290
6360
  }
6291
6361
  }
6292
6362
  const src = png ? `data:image/png;base64,${_chunkOLNIPTB3cjs.bytesToBase64.call(void 0, png)}` : trimmed;
6293
6363
  let img;
6294
6364
  try {
6295
6365
  img = await this.renderer.imageCache.get(src);
6296
- } catch (e27) {
6366
+ } catch (e28) {
6297
6367
  throw new (0, _chunkH65IBXFIcjs.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.");
6298
6368
  }
6299
6369
  const w = img.naturalWidth || img.width;
@@ -6572,8 +6642,8 @@ var ImageEditorController = (_class12 = class {
6572
6642
  this.state.activePathId = id;
6573
6643
  this.notify();
6574
6644
  }
6575
- commitPaths(next, active) {
6576
- this.recordHistory();
6645
+ commitPaths(next, active, commitToHistory = true) {
6646
+ if (commitToHistory) this.recordHistory();
6577
6647
  if (next.length) this.state.paths = next;
6578
6648
  else delete this.state.paths;
6579
6649
  if (active !== void 0) this.state.activePathId = active;
@@ -6609,6 +6679,64 @@ var ImageEditorController = (_class12 = class {
6609
6679
  this.commitPaths(this.getPaths().map((p) => p.id === id ? path : p));
6610
6680
  return path;
6611
6681
  }
6682
+ /**
6683
+ * What the path tools (Path Selection, Direct Selection, Pen) edit: the active path in the Paths
6684
+ * panel, else the active layer when it is a shape, else the active layer's vector mask; null
6685
+ * when there is none of these (the Pen then starts a new Work Path).
6686
+ */
6687
+ pathEditTarget() {
6688
+ const id = this.state.activePathId;
6689
+ if (id && this.getPath(id)) return { kind: "path", id };
6690
+ const layer = this.getActiveLayer();
6691
+ if (!layer) return null;
6692
+ if (layer.type === "shape") return { kind: "shape", layerId: layer.id };
6693
+ if (layer.vectorMask) return { kind: "vector-mask", layerId: layer.id };
6694
+ return null;
6695
+ }
6696
+ /** The components a path tool target holds (document pixels). Throws for a target that is gone. */
6697
+ getPathEditComponents(target) {
6698
+ if (target.kind === "path") return this.requirePath(target.id).components;
6699
+ if (target.kind === "shape") return _chunkH65IBXFIcjs.requireShapeLayer.call(void 0, this.state.layers, target.layerId).components;
6700
+ return this.requireVectorMask(target.layerId).vm.components;
6701
+ }
6702
+ /**
6703
+ * Replaces a path tool target's components: one undo step, or none with `commitToHistory` false
6704
+ * (the later moves of a drag whose first move recorded one). A component that still has its
6705
+ * `live` shape is kept as given (drop `live` from one whose anchors changed); a shape layer keeps
6706
+ * at least one component.
6707
+ */
6708
+ setPathEditComponents(target, components, commitToHistory = true) {
6709
+ this.getPathEditComponents(target);
6710
+ const next = components.map(
6711
+ (c, i) => c.live ? { ...c } : this.componentFrom({ op: c.op, subpaths: c.subpaths.filter((sp) => sp.anchors.length) }, `components[${i}].`)
6712
+ );
6713
+ if (target.kind === "path") {
6714
+ this.commitPaths(this.getPaths().map((p) => p.id === target.id ? { ...p, components: next } : p), void 0, commitToHistory);
6715
+ } else if (target.kind === "shape") {
6716
+ if (!next.length) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("A shape needs at least one component; delete the layer instead (delete_layer).");
6717
+ const { layers } = _chunkH65IBXFIcjs.updateShapeLayer.call(void 0, this.state.layers, target.layerId, () => ({ components: next }), this.shapeEnv(), "edit its path");
6718
+ this.commitLayers(layers, void 0, commitToHistory);
6719
+ } else {
6720
+ const { vm } = this.requireVectorMask(target.layerId);
6721
+ this.commitLayers(_chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.layerId, (l) => ({ ...l, vectorMask: { ...vm, components: next } })), void 0, commitToHistory);
6722
+ }
6723
+ }
6724
+ /**
6725
+ * The Pen with no path to add to: a new Work Path from `components` (replacing the last one,
6726
+ * unless it was saved), made the active path. One undo step. Returns the path.
6727
+ */
6728
+ startWorkPath(components) {
6729
+ const paths = this.getPaths();
6730
+ const old = paths.find((p) => p.work);
6731
+ const work = {
6732
+ id: _nullishCoalesce(_optionalChain([old, 'optionalAccess', _242 => _242.id]), () => ( newPathId())),
6733
+ name: WORK_PATH_NAME,
6734
+ components: components.map((c, i) => this.componentFrom({ op: c.op, subpaths: c.subpaths }, `components[${i}].`)),
6735
+ work: true
6736
+ };
6737
+ this.commitPaths(old ? paths.map((p) => p === old ? work : p) : [...paths, work], work.id);
6738
+ return work;
6739
+ }
6612
6740
  /** Renames a path; renaming the Work Path saves it (Photoshop's Save Path). One undo step. */
6613
6741
  renamePath(id, name) {
6614
6742
  const old = this.requirePath(id);
@@ -6622,7 +6750,7 @@ var ImageEditorController = (_class12 = class {
6622
6750
  /** Duplicates a path as a saved path. One undo step. */
6623
6751
  duplicatePath(id, name) {
6624
6752
  const old = this.requirePath(id);
6625
- const copy = { ...old, id: newPathId(), name: _optionalChain([name, 'optionalAccess', _242 => _242.trim, 'call', _243 => _243()]) || `${old.name} copy`, components: JSON.parse(JSON.stringify(old.components)) };
6753
+ const copy = { ...old, id: newPathId(), name: _optionalChain([name, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]) || `${old.name} copy`, components: JSON.parse(JSON.stringify(old.components)) };
6626
6754
  delete copy.work;
6627
6755
  const paths = this.getPaths();
6628
6756
  this.commitPaths([...paths.filter((p) => !p.work), copy, ...paths.filter((p) => p.work)], copy.id);
@@ -6828,7 +6956,7 @@ var ImageEditorController = (_class12 = class {
6828
6956
  const layer = loc.layer;
6829
6957
  if (layer.type !== "pixel") throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
6830
6958
  const sel = this.state.selection;
6831
- if (!_optionalChain([sel, 'optionalAccess', _244 => _244.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
6959
+ if (!_optionalChain([sel, 'optionalAccess', _245 => _245.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
6832
6960
  if (options.cut) _chunkH65IBXFIcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
6833
6961
  const surface = this.surfaceOf(layer);
6834
6962
  const sb = sel.bounds;
@@ -6846,14 +6974,14 @@ var ImageEditorController = (_class12 = class {
6846
6974
  const copy = {
6847
6975
  type: "pixel",
6848
6976
  id: _chunkH65IBXFIcjs.newLayerId.call(void 0, ),
6849
- name: _optionalChain([options, 'access', _245 => _245.name, 'optionalAccess', _246 => _246.trim, 'call', _247 => _247()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
6977
+ name: _optionalChain([options, 'access', _246 => _246.name, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
6850
6978
  visible: true,
6851
6979
  opacity: 1,
6852
6980
  blend: "normal",
6853
6981
  surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
6854
6982
  offset: { ...layer.offset }
6855
6983
  };
6856
- let next = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _248 => _248.parent, 'optionalAccess', _249 => _249.id]), () => ( null)), loc.index + 1);
6984
+ let next = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _249 => _249.parent, 'optionalAccess', _250 => _250.id]), () => ( null)), loc.index + 1);
6857
6985
  if (kept) {
6858
6986
  const cutLayer = { ...layer, surface: _chunk474IQG74cjs.writeRegion.call(void 0, surface, src, kept) };
6859
6987
  delete cutLayer.source;
@@ -6877,7 +7005,7 @@ var ImageEditorController = (_class12 = class {
6877
7005
  layers: () => this.state.layers,
6878
7006
  activeLayerId: () => this.state.activeLayerId,
6879
7007
  activeTarget: () => this.state.activeTarget,
6880
- selection: () => _optionalChain([this, 'access', _250 => _250.state, 'access', _251 => _251.selection, 'optionalAccess', _252 => _252.bounds]) ? this.state.selection : null,
7008
+ selection: () => _optionalChain([this, 'access', _251 => _251.state, 'access', _252 => _252.selection, 'optionalAccess', _253 => _253.bounds]) ? this.state.selection : null,
6881
7009
  canvas: () => this.naturalSize,
6882
7010
  pixelsOf: (layer) => this.surfaceOf(layer),
6883
7011
  shapeEnv: () => this.shapeEnv(),
@@ -7025,7 +7153,7 @@ var ImageEditorController = (_class12 = class {
7025
7153
  * anything else nests as a layer document. Returns the smart object's id.
7026
7154
  */
7027
7155
  convertToSmartObject(ids, options = {}) {
7028
- const list = _optionalChain([ids, 'optionalAccess', _253 => _253.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7156
+ const list = _optionalChain([ids, 'optionalAccess', _254 => _254.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7029
7157
  if (!list.length) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
7030
7158
  const res = _chunkH65IBXFIcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
7031
7159
  this.commitLayers(res.layers, () => {
@@ -7058,8 +7186,8 @@ var ImageEditorController = (_class12 = class {
7058
7186
  width: c.width,
7059
7187
  height: c.height,
7060
7188
  decoded: _chunkH65IBXFIcjs.isContentsDecoded.call(void 0, c),
7061
- fileType: _nullishCoalesce(_optionalChain([c, 'access', _254 => _254.file, 'optionalAccess', _255 => _255.type]), () => ( null)),
7062
- linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _256 => _256.linked, 'optionalAccess', _257 => _257.path]), () => ( null)),
7189
+ fileType: _nullishCoalesce(_optionalChain([c, 'access', _255 => _255.file, 'optionalAccess', _256 => _256.type]), () => ( null)),
7190
+ linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _257 => _257.linked, 'optionalAccess', _258 => _258.path]), () => ( null)),
7063
7191
  instances: _chunkH65IBXFIcjs.instancesOf.call(void 0, this.state.layers, c.id),
7064
7192
  layerCount: c.document ? _chunkUOGKSVRQcjs.flattenLayers.call(void 0, c.document.layers).length : 0
7065
7193
  },
@@ -7076,9 +7204,9 @@ var ImageEditorController = (_class12 = class {
7076
7204
  bounds: _chunkH65IBXFIcjs.transformedBox.call(void 0, g)
7077
7205
  },
7078
7206
  smartFilters: {
7079
- enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _258 => _258.enabled]), () => ( true)),
7080
- filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _259 => _259.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7081
- mask: _optionalChain([stack, 'optionalAccess', _260 => _260.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunk474IQG74cjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7207
+ enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _259 => _259.enabled]), () => ( true)),
7208
+ filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _260 => _260.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7209
+ mask: _optionalChain([stack, 'optionalAccess', _261 => _261.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunk474IQG74cjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7082
7210
  },
7083
7211
  bounds: this.getLayerBounds(id)
7084
7212
  };
@@ -7217,7 +7345,7 @@ var ImageEditorController = (_class12 = class {
7217
7345
  * it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
7218
7346
  */
7219
7347
  maskFiltersWithSelection(id, useSelection) {
7220
- if (!useSelection || !_optionalChain([this, 'access', _261 => _261.state, 'access', _262 => _262.selection, 'optionalAccess', _263 => _263.bounds])) return false;
7348
+ if (!useSelection || !_optionalChain([this, 'access', _262 => _262.state, 'access', _263 => _263.selection, 'optionalAccess', _264 => _264.bounds])) return false;
7221
7349
  this.setSmartFilterMask(id, "selection", {}, false);
7222
7350
  return true;
7223
7351
  }
@@ -7231,19 +7359,19 @@ var ImageEditorController = (_class12 = class {
7231
7359
  removeSmartFilter(id, filterId) {
7232
7360
  const res = _chunkH65IBXFIcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
7233
7361
  this.commitLayers(res.layers);
7234
- return _nullishCoalesce(_optionalChain([res, 'access', _264 => _264.layer, 'access', _265 => _265.smartFilters, 'optionalAccess', _266 => _266.filters]), () => ( []));
7362
+ return _nullishCoalesce(_optionalChain([res, 'access', _265 => _265.layer, 'access', _266 => _266.smartFilters, 'optionalAccess', _267 => _267.filters]), () => ( []));
7235
7363
  }
7236
7364
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
7237
7365
  moveSmartFilter(id, filterId, index) {
7238
7366
  const res = _chunkH65IBXFIcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
7239
7367
  this.commitLayers(res.layers);
7240
- return _nullishCoalesce(_optionalChain([res, 'access', _267 => _267.layer, 'access', _268 => _268.smartFilters, 'optionalAccess', _269 => _269.filters]), () => ( []));
7368
+ return _nullishCoalesce(_optionalChain([res, 'access', _268 => _268.layer, 'access', _269 => _269.smartFilters, 'optionalAccess', _270 => _270.filters]), () => ( []));
7241
7369
  }
7242
7370
  /** Turns a smart object's whole filter stack on or off (one undo step). */
7243
7371
  setSmartFiltersEnabled(id, enabled) {
7244
7372
  const res = _chunkH65IBXFIcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
7245
7373
  this.commitLayers(res.layers);
7246
- return _nullishCoalesce(_optionalChain([res, 'access', _270 => _270.layer, 'access', _271 => _271.smartFilters, 'optionalAccess', _272 => _272.enabled]), () => ( true));
7374
+ return _nullishCoalesce(_optionalChain([res, 'access', _271 => _271.layer, 'access', _272 => _272.smartFilters, 'optionalAccess', _273 => _273.enabled]), () => ( true));
7247
7375
  }
7248
7376
  /**
7249
7377
  * Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
@@ -7255,11 +7383,11 @@ var ImageEditorController = (_class12 = class {
7255
7383
  let mask;
7256
7384
  if (from === "none") mask = null;
7257
7385
  else if (from === "keep") {
7258
- if (!_optionalChain([layer, 'access', _273 => _273.smartFilters, 'optionalAccess', _274 => _274.mask])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
7386
+ if (!_optionalChain([layer, 'access', _274 => _274.smartFilters, 'optionalAccess', _275 => _275.mask])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
7259
7387
  mask = withMaskProps(layer.smartFilters.mask, props);
7260
7388
  } else if (from === "selection") {
7261
7389
  const sel = this.state.selection;
7262
- if (!_optionalChain([sel, 'optionalAccess', _275 => _275.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
7390
+ if (!_optionalChain([sel, 'optionalAccess', _276 => _276.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
7263
7391
  mask = this.maskFromSelection(sel, props);
7264
7392
  } else {
7265
7393
  const v = from === "reveal-all" ? 255 : 0;
@@ -7271,7 +7399,7 @@ var ImageEditorController = (_class12 = class {
7271
7399
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
7272
7400
  else if (!mask && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
7273
7401
  }, commitToHistory);
7274
- return _nullishCoalesce(_optionalChain([res, 'access', _276 => _276.layer, 'access', _277 => _277.smartFilters, 'optionalAccess', _278 => _278.mask]), () => ( null));
7402
+ return _nullishCoalesce(_optionalChain([res, 'access', _277 => _277.layer, 'access', _278 => _278.smartFilters, 'optionalAccess', _279 => _279.mask]), () => ( null));
7275
7403
  }
7276
7404
  /**
7277
7405
  * Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
@@ -7296,7 +7424,7 @@ var ImageEditorController = (_class12 = class {
7296
7424
  };
7297
7425
  this.state.layers = swap(this.state.layers);
7298
7426
  for (const e of [...this.undoStack, ...this.redoStack]) e.layers = swap(e.layers);
7299
- } catch (e28) {
7427
+ } catch (e29) {
7300
7428
  left.push(cid);
7301
7429
  }
7302
7430
  }
@@ -7319,7 +7447,7 @@ var ImageEditorController = (_class12 = class {
7319
7447
  if (this.getFreeTransform()) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
7320
7448
  const layer = _chunkH65IBXFIcjs.requireSmartObject.call(void 0, this.state.layers, id);
7321
7449
  const c = layer.contents;
7322
- if (!_chunkH65IBXFIcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _279 => _279.file, 'optionalAccess', _280 => _280.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
7450
+ if (!_chunkH65IBXFIcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _280 => _280.file, 'optionalAccess', _281 => _281.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
7323
7451
  const saved = {
7324
7452
  state: { ...this.state },
7325
7453
  undo: this.undoStack,
@@ -7350,9 +7478,9 @@ var ImageEditorController = (_class12 = class {
7350
7478
  editingContents: this.getEditingContents()
7351
7479
  };
7352
7480
  delete this.state.legacyOutputBlur;
7353
- if (_optionalChain([c, 'access', _281 => _281.document, 'optionalAccess', _282 => _282.globalLight])) this.state.globalLight = c.document.globalLight;
7481
+ if (_optionalChain([c, 'access', _282 => _282.document, 'optionalAccess', _283 => _283.globalLight])) this.state.globalLight = c.document.globalLight;
7354
7482
  else delete this.state.globalLight;
7355
- if (_optionalChain([c, 'access', _283 => _283.document, 'optionalAccess', _284 => _284.patterns, 'optionalAccess', _285 => _285.length])) this.state.patterns = c.document.patterns;
7483
+ if (_optionalChain([c, 'access', _284 => _284.document, 'optionalAccess', _285 => _285.patterns, 'optionalAccess', _286 => _286.length])) this.state.patterns = c.document.patterns;
7356
7484
  else delete this.state.patterns;
7357
7485
  this.imageElement = null;
7358
7486
  this.samplePixels = null;
@@ -7372,23 +7500,23 @@ var ImageEditorController = (_class12 = class {
7372
7500
  closeSmartObjectContents(save = true) {
7373
7501
  const top = this.contentsStack.pop();
7374
7502
  if (!top) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
7375
- if (_optionalChain([this, 'access', _286 => _286.openTransform, 'optionalAccess', _287 => _287.isOpen])) this.openTransform.cancel();
7503
+ if (_optionalChain([this, 'access', _287 => _287.openTransform, 'optionalAccess', _288 => _288.isOpen])) this.openTransform.cancel();
7376
7504
  this.openTransform = null;
7377
7505
  const edited = this.state;
7378
7506
  const changed = save && this.undoStack.length > 0;
7379
7507
  let next = null;
7380
7508
  if (changed) {
7381
- const layer = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _288 => _288.layer]);
7382
- const old = _optionalChain([layer, 'optionalAccess', _289 => _289.contents]);
7509
+ const layer = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _289 => _289.layer]);
7510
+ const old = _optionalChain([layer, 'optionalAccess', _290 => _290.contents]);
7383
7511
  const { width, height } = edited.imageDimensions;
7384
7512
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
7385
- const plain3 = _optionalChain([only, 'optionalAccess', _290 => _290.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _291 => _291.filters, 'optionalAccess', _292 => _292.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
7386
- if (_optionalChain([old, 'optionalAccess', _293 => _293.kind]) === "raster" && plain3) {
7513
+ const plain3 = _optionalChain([only, 'optionalAccess', _291 => _291.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _292 => _292.filters, 'optionalAccess', _293 => _293.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
7514
+ if (_optionalChain([old, 'optionalAccess', _294 => _294.kind]) === "raster" && plain3) {
7387
7515
  const px2 = _chunk474IQG74cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
7388
7516
  next = _chunkH65IBXFIcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
7389
7517
  } else {
7390
7518
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
7391
- next = _chunkH65IBXFIcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _294 => _294.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _295 => _295.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
7519
+ next = _chunkH65IBXFIcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _295 => _295.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _296 => _296.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
7392
7520
  }
7393
7521
  }
7394
7522
  const saved = top.saved;
@@ -7413,7 +7541,7 @@ var ImageEditorController = (_class12 = class {
7413
7541
  }
7414
7542
  /** The document's own layers (not the contents open for editing). */
7415
7543
  rootLayers() {
7416
- return _nullishCoalesce(_optionalChain([this, 'access', _296 => _296.contentsStack, 'access', _297 => _297[0], 'optionalAccess', _298 => _298.saved, 'access', _299 => _299.state, 'access', _300 => _300.layers]), () => ( this.state.layers));
7544
+ return _nullishCoalesce(_optionalChain([this, 'access', _297 => _297.contentsStack, 'access', _298 => _298[0], 'optionalAccess', _299 => _299.saved, 'access', _300 => _300.state, 'access', _301 => _301.layers]), () => ( this.state.layers));
7417
7545
  }
7418
7546
  /** Drops every open contents edit (loading another document). */
7419
7547
  abandonContents() {
@@ -7485,7 +7613,7 @@ var ImageEditorController = (_class12 = class {
7485
7613
  return this.getGlobalLight();
7486
7614
  }
7487
7615
  /** Composites `layers` (in isolation) over `rect` into a surface, loading depth maps first. */
7488
- async compositeToSurface(layers, rect) {
7616
+ async compositeToSurface(layers, rect2) {
7489
7617
  const { width, height } = this.naturalSize;
7490
7618
  if (_chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
7491
7619
  throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
@@ -7494,20 +7622,20 @@ var ImageEditorController = (_class12 = class {
7494
7622
  const sources = this.renderer.compositorSources(width, height);
7495
7623
  const depth = this.bitDepth;
7496
7624
  if (depth !== 8) {
7497
- const samples = _chunkUOGKSVRQcjs.workingToSamples.call(void 0, _chunkH65IBXFIcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
7498
- return _chunkOLNIPTB3cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
7625
+ const samples = _chunkUOGKSVRQcjs.workingToSamples.call(void 0, _chunkH65IBXFIcjs.compositeDeep.call(void 0, layers, rect2, sources, depth), depth);
7626
+ return _chunkOLNIPTB3cjs.surfaceFromDeepPixels.call(void 0, { width: rect2.width, height: rect2.height, data: samples }, 4, rect2.x, rect2.y);
7499
7627
  }
7500
- const data = new (0, _chunkH65IBXFIcjs.LayerCompositor)().composite(layers, rect, sources);
7501
- return _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
7628
+ const data = new (0, _chunkH65IBXFIcjs.LayerCompositor)().composite(layers, rect2, sources);
7629
+ return _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: rect2.width, height: rect2.height, data }, 4, rect2.x, rect2.y);
7502
7630
  }
7503
7631
  /**
7504
7632
  * The composite of the layer stack at the document's bit depth (as `compositePixels`, no
7505
7633
  * canvas): 16-bit sRGB samples, or 32-bit linear float, over `rect` (default the canvas). At 8
7506
7634
  * bits, the 8-bit composite widened to 16 bits.
7507
7635
  */
7508
- compositeDeepPixels(rect) {
7636
+ compositeDeepPixels(rect2) {
7509
7637
  const { width, height } = this.naturalSize;
7510
- const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
7638
+ const r = _nullishCoalesce(rect2, () => ( { x: 0, y: 0, width, height }));
7511
7639
  const depth = this.bitDepth;
7512
7640
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkOLNIPTB3cjs.to16From8.call(void 0, this.compositePixels(r).data) };
7513
7641
  const data = _chunkUOGKSVRQcjs.workingToSamples.call(void 0, _chunkH65IBXFIcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
@@ -7545,12 +7673,12 @@ var ImageEditorController = (_class12 = class {
7545
7673
  if (!upper.visible) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
7546
7674
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
7547
7675
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
7548
- let rect = _nullishCoalesce(_chunkH65IBXFIcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
7676
+ let rect2 = _nullishCoalesce(_chunkH65IBXFIcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
7549
7677
  const reach = Math.max(_chunkUOGKSVRQcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkUOGKSVRQcjs.effectsMargin.call(void 0, upper.effects));
7550
- if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
7678
+ if (reach) rect2 = { x: rect2.x - reach, y: rect2.y - reach, width: rect2.width + 2 * reach, height: rect2.height + 2 * reach };
7551
7679
  const base = { ...lower, blend: "normal", opacity: 1 };
7552
7680
  delete base.clipped;
7553
- const surface = await this.compositeToSurface([base, upper], rect);
7681
+ const surface = await this.compositeToSurface([base, upper], rect2);
7554
7682
  const merged = { ...lower, surface, offset: { x: 0, y: 0 } };
7555
7683
  delete merged.mask;
7556
7684
  delete merged.fillOpacity;
@@ -7632,9 +7760,9 @@ var ImageEditorController = (_class12 = class {
7632
7760
  if (!surface) return null;
7633
7761
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
7634
7762
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
7635
- const key = `${tw}x${th}:${ox},${oy}`;
7763
+ const key2 = `${tw}x${th}:${ox},${oy}`;
7636
7764
  let byKey = this.thumbCache.get(surface);
7637
- const hit = _optionalChain([byKey, 'optionalAccess', _301 => _301.get, 'call', _302 => _302(key)]);
7765
+ const hit = _optionalChain([byKey, 'optionalAccess', _302 => _302.get, 'call', _303 => _303(key2)]);
7638
7766
  if (hit) return hit;
7639
7767
  const out = new Uint8ClampedArray(tw * th * 4);
7640
7768
  for (let y = 0; y < th; y++) {
@@ -7654,7 +7782,7 @@ var ImageEditorController = (_class12 = class {
7654
7782
  byKey = /* @__PURE__ */ new Map();
7655
7783
  this.thumbCache.set(surface, byKey);
7656
7784
  }
7657
- byKey.set(key, thumb);
7785
+ byKey.set(key2, thumb);
7658
7786
  return thumb;
7659
7787
  }
7660
7788
  /**
@@ -7775,7 +7903,7 @@ var ImageEditorController = (_class12 = class {
7775
7903
  if (layer.mask.source) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
7776
7904
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, layer, "all", action);
7777
7905
  } else if (ch === "filter-mask") {
7778
- if (layer.type !== "smart" || !_optionalChain([layer, 'access', _303 => _303.smartFilters, 'optionalAccess', _304 => _304.mask])) {
7906
+ if (layer.type !== "smart" || !_optionalChain([layer, 'access', _304 => _304.smartFilters, 'optionalAccess', _305 => _305.mask])) {
7779
7907
  throw new (0, _chunkH65IBXFIcjs.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}.`);
7780
7908
  }
7781
7909
  if (!_chunkH65IBXFIcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkH65IBXFIcjs.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.`);
@@ -7790,7 +7918,7 @@ var ImageEditorController = (_class12 = class {
7790
7918
  if (!layer.visible) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
7791
7919
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
7792
7920
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
7793
- const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _305 => _305.locks, 'optionalAccess', _306 => _306.transparency]));
7921
+ const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _306 => _306.locks, 'optionalAccess', _307 => _307.transparency]));
7794
7922
  return { id, layer, channel: ch, offset, surface, lockTransparency };
7795
7923
  }
7796
7924
  /** The layer with its pixels (or mask) replaced by `surface`. */
@@ -7834,13 +7962,13 @@ var ImageEditorController = (_class12 = class {
7834
7962
  blend: target.channel !== "pixels" ? "normal" : brush.blend,
7835
7963
  lockTransparency: target.lockTransparency,
7836
7964
  // In Quick Mask mode the selection is what is painted, so it does not limit the stroke.
7837
- selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _307 => _307.state, 'access', _308 => _308.selection, 'optionalAccess', _309 => _309.bounds]) ? this.state.selection : null,
7965
+ selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _308 => _308.state, 'access', _309 => _309.selection, 'optionalAccess', _310 => _310.bounds]) ? this.state.selection : null,
7838
7966
  offset: target.offset
7839
7967
  };
7840
7968
  const depth = target.channel !== "filter-mask" && target.channel !== "quick-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
7841
7969
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
7842
7970
  if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
7843
- const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _310 => _310.type]) === "gradient" ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
7971
+ const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _311 => _311.type]) === "gradient" ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
7844
7972
  return new PaintStrokeSession(this, target, new (0, _chunkPQ3H2AANcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
7845
7973
  }
7846
7974
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
@@ -7887,9 +8015,9 @@ var ImageEditorController = (_class12 = class {
7887
8015
  const steps = settings.historySteps;
7888
8016
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
7889
8017
  if (!entry) throw new (0, _chunkH65IBXFIcjs.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.");
7890
- const then = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _311 => _311.layer]);
8018
+ const then = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _312 => _312.layer]);
7891
8019
  if (!then) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
7892
- const surface = target.channel === "mask" ? _optionalChain([then, 'access', _312 => _312.mask, 'optionalAccess', _313 => _313.surface]) : then.type === "pixel" ? then.surface : void 0;
8020
+ const surface = target.channel === "mask" ? _optionalChain([then, 'access', _313 => _313.mask, 'optionalAccess', _314 => _314.surface]) : then.type === "pixel" ? then.surface : void 0;
7893
8021
  if (!surface) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
7894
8022
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
7895
8023
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
@@ -7963,7 +8091,7 @@ var ImageEditorController = (_class12 = class {
7963
8091
  }
7964
8092
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
7965
8093
  surfaceSource(surface, offset) {
7966
- return new (0, _chunkYF3YZZ6Gcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _314 => _314.tiles, 'access', _315 => _315.get, 'call', _316 => _316(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _317 => _317.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
8094
+ return new (0, _chunkYF3YZZ6Gcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _315 => _315.tiles, 'access', _316 => _316.get, 'call', _317 => _317(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _318 => _318.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
7967
8095
  }
7968
8096
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
7969
8097
  compositeSource(throughId, depth = null) {
@@ -8039,7 +8167,7 @@ var ImageEditorController = (_class12 = class {
8039
8167
  paintStroke(init) {
8040
8168
  if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("points must hold at least one { x, y } point.");
8041
8169
  for (const p of init.points) {
8042
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _318 => _318.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _319 => _319.y]))) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8170
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _319 => _319.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _320 => _320.y]))) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8043
8171
  }
8044
8172
  const session = this.beginStroke(init);
8045
8173
  session.push(init.points);
@@ -8068,7 +8196,7 @@ var ImageEditorController = (_class12 = class {
8068
8196
  */
8069
8197
  strokeSelection(options) {
8070
8198
  const sel = this.state.selection;
8071
- if (!_optionalChain([sel, 'optionalAccess', _320 => _320.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8199
+ if (!_optionalChain([sel, 'optionalAccess', _321 => _321.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8072
8200
  const width = options.width;
8073
8201
  if (!(width > 0 && width <= 250)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
8074
8202
  const location = _nullishCoalesce(options.location, () => ( "outside"));
@@ -8085,7 +8213,7 @@ var ImageEditorController = (_class12 = class {
8085
8213
  */
8086
8214
  cropToSelection() {
8087
8215
  const sel = this.state.selection;
8088
- if (!_optionalChain([sel, 'optionalAccess', _321 => _321.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8216
+ if (!_optionalChain([sel, 'optionalAccess', _322 => _322.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8089
8217
  const crop = { ...sel.bounds };
8090
8218
  this.setCrop(crop);
8091
8219
  return crop;
@@ -8136,7 +8264,7 @@ var ImageEditorController = (_class12 = class {
8136
8264
  */
8137
8265
  prepareContentAwareFill(options = {}) {
8138
8266
  const sel = this.state.selection;
8139
- if (!_optionalChain([sel, 'optionalAccess', _322 => _322.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
8267
+ if (!_optionalChain([sel, 'optionalAccess', _323 => _323.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
8140
8268
  if (this.bitDepth !== 8) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
8141
8269
  const output = _nullishCoalesce(options.output, () => ( "current"));
8142
8270
  if (output !== "current" && output !== "new-layer" && output !== "duplicate-layer") {
@@ -8147,12 +8275,12 @@ var ImageEditorController = (_class12 = class {
8147
8275
  const b = sel.bounds;
8148
8276
  let area = _nullishCoalesce(options.samplingArea, () => ( null));
8149
8277
  if (!area && options.samplingChannelId) area = this.requireChannel(options.samplingChannelId).mask;
8150
- if (!area && _optionalChain([options, 'access', _323 => _323.sampleRects, 'optionalAccess', _324 => _324.length])) {
8278
+ if (!area && _optionalChain([options, 'access', _324 => _324.sampleRects, 'optionalAccess', _325 => _325.length])) {
8151
8279
  for (const r of options.sampleRects) area = _chunkQYLWG22Ncjs.combineSelections.call(void 0, area, _chunkL52VMQZScjs.rectSelection.call(void 0, width, height, r, { antiAlias: false }), "add");
8152
8280
  }
8153
8281
  if (area && !area.bounds) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("The sampling area is empty; paint or give an area to sample from.");
8154
8282
  let win;
8155
- if (_optionalChain([area, 'optionalAccess', _325 => _325.bounds])) {
8283
+ if (_optionalChain([area, 'optionalAccess', _326 => _326.bounds])) {
8156
8284
  const a = area.bounds;
8157
8285
  const x0 = Math.max(0, Math.min(b.x - 8, a.x));
8158
8286
  const y0 = Math.max(0, Math.min(b.y - 8, a.y));
@@ -8177,7 +8305,7 @@ var ImageEditorController = (_class12 = class {
8177
8305
  }
8178
8306
  }
8179
8307
  let exclude = null;
8180
- if (area || _optionalChain([options, 'access', _326 => _326.excludeRects, 'optionalAccess', _327 => _327.length])) {
8308
+ if (area || _optionalChain([options, 'access', _327 => _327.excludeRects, 'optionalAccess', _328 => _328.length])) {
8181
8309
  exclude = new Uint8Array(n);
8182
8310
  if (area) {
8183
8311
  const ad = area.data;
@@ -8248,28 +8376,28 @@ var ImageEditorController = (_class12 = class {
8248
8376
  */
8249
8377
  copyPixels(options = {}) {
8250
8378
  const { width, height } = this.naturalSize;
8251
- const sel = _optionalChain([this, 'access', _328 => _328.state, 'access', _329 => _329.selection, 'optionalAccess', _330 => _330.bounds]) ? this.state.selection : null;
8252
- const rect = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _331 => _331.bounds]), () => ( { x: 0, y: 0, width, height }));
8379
+ const sel = _optionalChain([this, 'access', _329 => _329.state, 'access', _330 => _330.selection, 'optionalAccess', _331 => _331.bounds]) ? this.state.selection : null;
8380
+ const rect2 = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _332 => _332.bounds]), () => ( { x: 0, y: 0, width, height }));
8253
8381
  let data;
8254
8382
  if (options.merged) {
8255
- data = new Uint8ClampedArray(this.compositePixels(rect).data);
8383
+ data = new Uint8ClampedArray(this.compositePixels(rect2).data);
8256
8384
  } else {
8257
8385
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
8258
8386
  if (!id) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("No layer given and none is active; pass layerId, or merged: true to copy the visible image.");
8259
8387
  const layer = _chunkH65IBXFIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
8260
8388
  if (layer.type !== "pixel") throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" is not a pixel layer; copy merged, or rasterize it first.`);
8261
- data = _chunk474IQG74cjs.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 });
8389
+ data = _chunk474IQG74cjs.readRegion.call(void 0, this.surfaceOf(layer), { x: rect2.x - layer.offset.x, y: rect2.y - layer.offset.y, width: rect2.width, height: rect2.height });
8262
8390
  }
8263
8391
  if (sel) {
8264
- for (let y = 0; y < rect.height; y++) {
8265
- for (let x = 0; x < rect.width; x++) {
8266
- const k = sel.data[(rect.y + y) * sel.width + rect.x + x];
8267
- const p = (y * rect.width + x) * 4 + 3;
8392
+ for (let y = 0; y < rect2.height; y++) {
8393
+ for (let x = 0; x < rect2.width; x++) {
8394
+ const k = sel.data[(rect2.y + y) * sel.width + rect2.x + x];
8395
+ const p = (y * rect2.width + x) * 4 + 3;
8268
8396
  data[p] = Math.round(data[p] * k / 255);
8269
8397
  }
8270
8398
  }
8271
8399
  }
8272
- this.clipboard = { width: rect.width, height: rect.height, x: rect.x, y: rect.y, data };
8400
+ this.clipboard = { width: rect2.width, height: rect2.height, x: rect2.x, y: rect2.y, data };
8273
8401
  return this.clipboard;
8274
8402
  }
8275
8403
  /** Edit › Cut: Copy, then clear the selected pixels, as one undo step. */
@@ -8289,7 +8417,7 @@ var ImageEditorController = (_class12 = class {
8289
8417
  pastePixels(mode = "new-layer", image = this.clipboard) {
8290
8418
  if (!image) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
8291
8419
  if (!PASTE_MODES.includes(mode)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
8292
- const sel = _optionalChain([this, 'access', _332 => _332.state, 'access', _333 => _333.selection, 'optionalAccess', _334 => _334.bounds]) ? this.state.selection : null;
8420
+ const sel = _optionalChain([this, 'access', _333 => _333.state, 'access', _334 => _334.selection, 'optionalAccess', _335 => _335.bounds]) ? this.state.selection : null;
8293
8421
  if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
8294
8422
  const { width, height } = this.naturalSize;
8295
8423
  let x;
@@ -8298,7 +8426,7 @@ var ImageEditorController = (_class12 = class {
8298
8426
  x = image.x;
8299
8427
  y = image.y;
8300
8428
  } else {
8301
- const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _335 => _335.bounds]), () => ( { x: 0, y: 0, width, height }));
8429
+ const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _336 => _336.bounds]), () => ( { x: 0, y: 0, width, height }));
8302
8430
  x = Math.round(frame.x + (frame.width - image.width) / 2);
8303
8431
  y = Math.round(frame.y + (frame.height - image.height) / 2);
8304
8432
  }
@@ -8315,8 +8443,8 @@ var ImageEditorController = (_class12 = class {
8315
8443
  if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("opacity must be from 0 to 1.");
8316
8444
  const blend = _nullishCoalesce(_chunkH65IBXFIcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
8317
8445
  const quickMask = target.channel === "quick-mask";
8318
- const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.selection, 'optionalAccess', _338 => _338.bounds]) ? this.state.selection : null)));
8319
- const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _339 => _339.bounds]), () => ( { x: 0, y: 0, width, height }));
8446
+ const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _337 => _337.state, 'access', _338 => _338.selection, 'optionalAccess', _339 => _339.bounds]) ? this.state.selection : null)));
8447
+ const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _340 => _340.bounds]), () => ( { x: 0, y: 0, width, height }));
8320
8448
  const coverage = new (0, _chunkPQ3H2AANcjs.CoverageMap)();
8321
8449
  const ones = new Float32Array(region.width * region.height);
8322
8450
  if (sel) {
@@ -8441,7 +8569,7 @@ var ImageEditorController = (_class12 = class {
8441
8569
  placeLayer(layers, node, where) {
8442
8570
  if (where.aboveId) {
8443
8571
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, where.aboveId);
8444
- if (loc) return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _340 => _340.parent, 'optionalAccess', _341 => _341.id]), () => ( null)), loc.index + 1);
8572
+ if (loc) return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _341 => _341.parent, 'optionalAccess', _342 => _342.id]), () => ( null)), loc.index + 1);
8445
8573
  }
8446
8574
  if (where.parentId) {
8447
8575
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, where.parentId);
@@ -8452,11 +8580,11 @@ var ImageEditorController = (_class12 = class {
8452
8580
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
8453
8581
  if (at < nodes.length) {
8454
8582
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, nodes[at].id);
8455
- return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _342 => _342.parent, 'optionalAccess', _343 => _343.id]), () => ( null)), loc.index);
8583
+ return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _343 => _343.parent, 'optionalAccess', _344 => _344.id]), () => ( null)), loc.index);
8456
8584
  }
8457
8585
  if (nodes.length) {
8458
8586
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
8459
- return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _344 => _344.parent, 'optionalAccess', _345 => _345.id]), () => ( null)), loc.index + 1);
8587
+ return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _345 => _345.parent, 'optionalAccess', _346 => _346.id]), () => ( null)), loc.index + 1);
8460
8588
  }
8461
8589
  }
8462
8590
  return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
@@ -8495,7 +8623,7 @@ var ImageEditorController = (_class12 = class {
8495
8623
  enabled: spec.enabled,
8496
8624
  opacity: spec.opacity,
8497
8625
  blend: spec.blend,
8498
- mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _346 => _346.state, 'access', _347 => _347.selection, 'optionalAccess', _348 => _348.bounds]) ? _chunkH65IBXFIcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
8626
+ mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _347 => _347.state, 'access', _348 => _348.selection, 'optionalAccess', _349 => _349.bounds]) ? _chunkH65IBXFIcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
8499
8627
  });
8500
8628
  while (ids.has(layer.id)) layer.id = _chunkH65IBXFIcjs.newLayerId.call(void 0, "adj");
8501
8629
  const { width, height } = this.naturalSize;
@@ -8572,7 +8700,7 @@ var ImageEditorController = (_class12 = class {
8572
8700
  const anchor = nodes[to];
8573
8701
  const without = _chunkUOGKSVRQcjs.mapLayer.call(void 0, layers, id, () => null);
8574
8702
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, without, anchor.id);
8575
- return _chunkUOGKSVRQcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _349 => _349.parent, 'optionalAccess', _350 => _350.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
8703
+ return _chunkUOGKSVRQcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _350 => _350.parent, 'optionalAccess', _351 => _351.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
8576
8704
  }
8577
8705
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
8578
8706
  moveAdjustmentLayer(id, toIndex) {
@@ -8613,7 +8741,7 @@ var ImageEditorController = (_class12 = class {
8613
8741
  return _nullishCoalesce(this.state.selection, () => ( null));
8614
8742
  }
8615
8743
  get hasSelection() {
8616
- return Boolean(_optionalChain([this, 'access', _351 => _351.state, 'access', _352 => _352.selection, 'optionalAccess', _353 => _353.bounds]));
8744
+ return Boolean(_optionalChain([this, 'access', _352 => _352.state, 'access', _353 => _353.selection, 'optionalAccess', _354 => _354.bounds]));
8617
8745
  }
8618
8746
  /** Returns the current canvas (composition) dimensions. */
8619
8747
  getCanvasSize() {
@@ -8705,7 +8833,7 @@ var ImageEditorController = (_class12 = class {
8705
8833
  const prev = normalizeSelection(_nullishCoalesce(this.state.selection, () => ( null)));
8706
8834
  if (prev === next || prev && next && sameSelection(prev, next)) return false;
8707
8835
  this.recordHistory();
8708
- if (!next && _optionalChain([prev, 'optionalAccess', _354 => _354.bounds])) this.lastSelection = prev;
8836
+ if (!next && _optionalChain([prev, 'optionalAccess', _355 => _355.bounds])) this.lastSelection = prev;
8709
8837
  this.state.selection = next;
8710
8838
  this.notify();
8711
8839
  return true;
@@ -8753,20 +8881,20 @@ var ImageEditorController = (_class12 = class {
8753
8881
  if (!Number.isFinite(position) || at < 0 || at >= max) {
8754
8882
  throw new RangeError(`${orientation === "row" ? "y" : "x"} ${position} is outside the image (0..${max - 1}).`);
8755
8883
  }
8756
- const rect = orientation === "row" ? { x: 0, y: at, width, height: 1 } : { x: at, y: 0, width: 1, height };
8757
- return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect, { antiAlias: false }), options);
8884
+ const rect2 = orientation === "row" ? { x: 0, y: at, width, height: 1 } : { x: at, y: 0, width: 1, height };
8885
+ return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect2, { antiAlias: false }), options);
8758
8886
  }
8759
8887
  /** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
8760
8888
  async growSelection(options = {}) {
8761
8889
  const sel = this.state.selection;
8762
- if (!_optionalChain([sel, 'optionalAccess', _355 => _355.bounds])) return false;
8890
+ if (!_optionalChain([sel, 'optionalAccess', _356 => _356.bounds])) return false;
8763
8891
  const pixels = await this.requirePixels(options);
8764
8892
  return this.setSelection(growSelection(pixels, sel, options));
8765
8893
  }
8766
8894
  /** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
8767
8895
  async selectSimilar(options = {}) {
8768
8896
  const sel = this.state.selection;
8769
- if (!_optionalChain([sel, 'optionalAccess', _356 => _356.bounds])) return false;
8897
+ if (!_optionalChain([sel, 'optionalAccess', _357 => _357.bounds])) return false;
8770
8898
  const pixels = await this.requirePixels(options);
8771
8899
  return this.setSelection(selectSimilar(pixels, sel, options));
8772
8900
  }
@@ -8810,14 +8938,14 @@ var ImageEditorController = (_class12 = class {
8810
8938
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
8811
8939
  }
8812
8940
  /** Rectangular marquee in natural image pixels. */
8813
- selectRect(rect, options = {}) {
8941
+ selectRect(rect2, options = {}) {
8814
8942
  const { width, height } = this.naturalSize;
8815
- return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect, options), options);
8943
+ return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect2, options), options);
8816
8944
  }
8817
8945
  /** Elliptical marquee inscribed in `rect`. */
8818
- selectEllipse(rect, options = {}) {
8946
+ selectEllipse(rect2, options = {}) {
8819
8947
  const { width, height } = this.naturalSize;
8820
- return this.shapeCommand(_chunkL52VMQZScjs.ellipseSelection.call(void 0, width, height, rect, options), options);
8948
+ return this.shapeCommand(_chunkL52VMQZScjs.ellipseSelection.call(void 0, width, height, rect2, options), options);
8821
8949
  }
8822
8950
  /** Lasso / polygonal lasso. */
8823
8951
  selectPolygon(points, options = {}) {
@@ -8858,7 +8986,7 @@ var ImageEditorController = (_class12 = class {
8858
8986
  size: options.size,
8859
8987
  grow: m === "add",
8860
8988
  enhanceEdge: options.enhanceEdge,
8861
- selection: m === "add" && _optionalChain([sel, 'optionalAccess', _357 => _357.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, sel) : null
8989
+ selection: m === "add" && _optionalChain([sel, 'optionalAccess', _358 => _358.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, sel) : null
8862
8990
  };
8863
8991
  const { mask } = await this.runSelectionJob(job, pixels, {
8864
8992
  signal: options.signal,
@@ -8878,7 +9006,7 @@ var ImageEditorController = (_class12 = class {
8878
9006
  const { width, height } = this.naturalSize;
8879
9007
  const image = await this.toDataURL({ format: "image/png" });
8880
9008
  const results = await provider.segment({ ...request, image, width, height });
8881
- _optionalChain([request, 'access', _358 => _358.signal, 'optionalAccess', _359 => _359.throwIfAborted, 'call', _360 => _360()]);
9009
+ _optionalChain([request, 'access', _359 => _359.signal, 'optionalAccess', _360 => _360.throwIfAborted, 'call', _361 => _361()]);
8882
9010
  const decoded = [];
8883
9011
  for (const r of _nullishCoalesce(results, () => ( []))) decoded.push({ ...r, mask: r.mask !== void 0 ? await this.decodeMaskImage(r.mask) : void 0 });
8884
9012
  return decoded;
@@ -8895,7 +9023,7 @@ var ImageEditorController = (_class12 = class {
8895
9023
  let union = null;
8896
9024
  for (const r of decoded) {
8897
9025
  const one = segmentsToSelection(width, height, [r]);
8898
- if (!_optionalChain([one, 'optionalAccess', _361 => _361.bounds])) continue;
9026
+ if (!_optionalChain([one, 'optionalAccess', _362 => _362.bounds])) continue;
8899
9027
  if ("rect" in target) {
8900
9028
  const r0 = target.rect;
8901
9029
  const grow = 0.1 * Math.max(r0.width, r0.height);
@@ -8963,7 +9091,7 @@ var ImageEditorController = (_class12 = class {
8963
9091
  if (this.segmentation && options.useModel !== false) {
8964
9092
  const { width, height } = this.naturalSize;
8965
9093
  const sky = segmentsToSelection(width, height, await this.modelSegments({ target: "the sky", signal: options.signal }));
8966
- if (!_optionalChain([sky, 'optionalAccess', _362 => _362.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
9094
+ if (!_optionalChain([sky, 'optionalAccess', _363 => _363.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
8967
9095
  this.setSelection(sky, _nullishCoalesce(options.mode, () => ( "replace")));
8968
9096
  return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model" };
8969
9097
  }
@@ -8994,13 +9122,13 @@ var ImageEditorController = (_class12 = class {
8994
9122
  try {
8995
9123
  const canvas = await this.renderSource();
8996
9124
  const ctx = canvas.getContext("2d");
8997
- const data2 = _optionalChain([ctx, 'optionalAccess', _363 => _363.getImageData, 'optionalCall', _364 => _364(0, 0, width, height)]);
9125
+ const data2 = _optionalChain([ctx, 'optionalAccess', _364 => _364.getImageData, 'optionalCall', _365 => _365(0, 0, width, height)]);
8998
9126
  if (data2 && data2.data && data2.data.length >= width * height * 4) {
8999
9127
  base = { width, height, data: data2.data };
9000
9128
  this.samplePixels = base;
9001
9129
  this.samplePixelsOverride = false;
9002
9130
  }
9003
- } catch (e29) {
9131
+ } catch (e30) {
9004
9132
  base = null;
9005
9133
  }
9006
9134
  }
@@ -9069,7 +9197,7 @@ var ImageEditorController = (_class12 = class {
9069
9197
  /** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
9070
9198
  modifySelection(op, radius) {
9071
9199
  const sel = this.state.selection;
9072
- if (!_optionalChain([sel, 'optionalAccess', _365 => _365.bounds])) return false;
9200
+ if (!_optionalChain([sel, 'optionalAccess', _366 => _366.bounds])) return false;
9073
9201
  return this.setSelection(_chunkQYLWG22Ncjs.modifySelection.call(void 0, sel, op, radius));
9074
9202
  }
9075
9203
  /**
@@ -9078,7 +9206,7 @@ var ImageEditorController = (_class12 = class {
9078
9206
  */
9079
9207
  async refineSelection(params, options = {}) {
9080
9208
  const sel = this.state.selection;
9081
- if (!_optionalChain([sel, 'optionalAccess', _366 => _366.bounds])) return false;
9209
+ if (!_optionalChain([sel, 'optionalAccess', _367 => _367.bounds])) return false;
9082
9210
  const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
9083
9211
  return this.setSelection(_chunkL52VMQZScjs.refineSelection.call(void 0, pixels, sel, params));
9084
9212
  }
@@ -9100,7 +9228,7 @@ var ImageEditorController = (_class12 = class {
9100
9228
  async refineSelectionTo(params, output = "selection", options = {}) {
9101
9229
  const edits = _nullishCoalesce(options.edits, () => ( []));
9102
9230
  const refineMode = _nullishCoalesce(options.refineMode, () => ( "color"));
9103
- if (!_optionalChain([this, 'access', _367 => _367.state, 'access', _368 => _368.selection, 'optionalAccess', _369 => _369.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
9231
+ if (!_optionalChain([this, 'access', _368 => _368.state, 'access', _369 => _369.selection, 'optionalAccess', _370 => _370.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
9104
9232
  if (refineMode === "object" && !this.segmentation) {
9105
9233
  throw new Error("Object aware refinement needs a segmentation model (setSegmentationProvider); use refineMode color.");
9106
9234
  }
@@ -9123,14 +9251,14 @@ var ImageEditorController = (_class12 = class {
9123
9251
  const { width, height } = this.naturalSize;
9124
9252
  const edited = _chunkL52VMQZScjs.applyRefineEdits.call(void 0, pixels, _nullishCoalesce(this.state.selection, () => ( null)), edits, width, height);
9125
9253
  let sel = edited.selection;
9126
- if (!_optionalChain([sel, 'optionalAccess', _370 => _370.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
9254
+ if (!_optionalChain([sel, 'optionalAccess', _371 => _371.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
9127
9255
  if (refineMode === "object") {
9128
9256
  const b = sel.bounds;
9129
9257
  const found = await this.modelObject({ rect: b }, options.signal);
9130
9258
  if (!found) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9131
9259
  const near = _chunkQYLWG22Ncjs.modifySelection.call(void 0, sel, "expand", Math.max(4, _nullishCoalesce(params.radius, () => ( 8))));
9132
9260
  const clipped = _chunkQYLWG22Ncjs.combineSelections.call(void 0, found, near, "intersect");
9133
- if (!_optionalChain([clipped, 'optionalAccess', _371 => _371.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9261
+ if (!_optionalChain([clipped, 'optionalAccess', _372 => _372.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9134
9262
  sel = clipped;
9135
9263
  }
9136
9264
  const refined = _chunkL52VMQZScjs.refineSelection.call(void 0, pixels, sel, params, edited.refineBrush);
@@ -9225,7 +9353,7 @@ var ImageEditorController = (_class12 = class {
9225
9353
  let mask;
9226
9354
  if (source === "selection") {
9227
9355
  const sel = this.state.selection;
9228
- if (!_optionalChain([sel, 'optionalAccess', _372 => _372.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
9356
+ if (!_optionalChain([sel, 'optionalAccess', _373 => _373.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
9229
9357
  mask = sel;
9230
9358
  } else if ("channelId" in source) {
9231
9359
  mask = this.requireChannel(source.channelId).mask;
@@ -9249,7 +9377,7 @@ var ImageEditorController = (_class12 = class {
9249
9377
  const canvas = this.renderer.createCanvas(w, h);
9250
9378
  const ctx = canvas.getContext("2d");
9251
9379
  if (ctx) ctx.drawImage(img, 0, 0, w, h);
9252
- const data = _optionalChain([ctx, 'optionalAccess', _373 => _373.getImageData, 'optionalCall', _374 => _374(0, 0, w, h)]);
9380
+ const data = _optionalChain([ctx, 'optionalAccess', _374 => _374.getImageData, 'optionalCall', _375 => _375(0, 0, w, h)]);
9253
9381
  if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
9254
9382
  return { width: w, height: h, data: data.data };
9255
9383
  }
@@ -9265,7 +9393,7 @@ var ImageEditorController = (_class12 = class {
9265
9393
  const provider = this.segmentation;
9266
9394
  if (!provider) {
9267
9395
  const pixels = await this.requirePixels({});
9268
- _optionalChain([options, 'access', _375 => _375.signal, 'optionalAccess', _376 => _376.throwIfAborted, 'call', _377 => _377()]);
9396
+ _optionalChain([options, 'access', _376 => _376.signal, 'optionalAccess', _377 => _377.throwIfAborted, 'call', _378 => _378()]);
9269
9397
  const { mask: selection, reason } = await this.runSelectionJob({ op: "subject", enhanceEdge: options.enhanceEdge }, pixels, options);
9270
9398
  if (selection.bounds) this.shapeCommand(selection, options);
9271
9399
  const unused = target.trim() ? ` "${target.trim()}" was not used to choose it.` : "";
@@ -9281,17 +9409,17 @@ var ImageEditorController = (_class12 = class {
9281
9409
  const decoded = await this.modelSegments({ target: description, maxSegments: options.maxSegments, signal: options.signal });
9282
9410
  const segments = decoded.map((r) => {
9283
9411
  const one = segmentsToSelection(width, height, [r]);
9284
- return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _378 => _378.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
9412
+ return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _379 => _379.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
9285
9413
  });
9286
9414
  const mask = segmentsToSelection(width, height, decoded);
9287
9415
  if (mask && options.beforeApply) {
9288
9416
  const outlines = decoded.flatMap((r, i) => {
9289
9417
  const rings = segmentationOutlines(r);
9290
- const b = _optionalChain([segments, 'access', _379 => _379[i], 'optionalAccess', _380 => _380.bounds]);
9418
+ const b = _optionalChain([segments, 'access', _380 => _380[i], 'optionalAccess', _381 => _381.bounds]);
9291
9419
  return rings.length ? rings : b ? [[{ x: b.x, y: b.y }, { x: b.x + b.width, y: b.y }, { x: b.x + b.width, y: b.y + b.height }, { x: b.x, y: b.y + b.height }]] : [];
9292
9420
  });
9293
9421
  await options.beforeApply(outlines);
9294
- _optionalChain([options, 'access', _381 => _381.signal, 'optionalAccess', _382 => _382.throwIfAborted, 'call', _383 => _383()]);
9422
+ _optionalChain([options, 'access', _382 => _382.signal, 'optionalAccess', _383 => _383.throwIfAborted, 'call', _384 => _384()]);
9295
9423
  }
9296
9424
  if (mask) this.shapeCommand(mask, options);
9297
9425
  return { segments: segments.filter((s) => s.bounds), method: "model" };
@@ -9324,7 +9452,7 @@ var ImageEditorController = (_class12 = class {
9324
9452
  const view = this.state.maskView;
9325
9453
  if (!view) return null;
9326
9454
  const layer = this.getLayer(view.layerId);
9327
- return _optionalChain([layer, 'optionalAccess', _384 => _384.mask]) && !layer.mask.source ? view : null;
9455
+ return _optionalChain([layer, 'optionalAccess', _385 => _385.mask]) && !layer.mask.source ? view : null;
9328
9456
  }
9329
9457
  /**
9330
9458
  * Shows a layer's mask on the canvas: `gray` alone in grey (Alt-click the mask thumbnail),
@@ -9347,7 +9475,7 @@ var ImageEditorController = (_class12 = class {
9347
9475
  if (!layer.mask) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to show; add one with add_layer_mask.`);
9348
9476
  if (layer.mask.source) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is computed, not painted, so it has no mask view.`);
9349
9477
  const cur = this.state.maskView;
9350
- if (_optionalChain([cur, 'optionalAccess', _385 => _385.layerId]) !== id || cur.mode !== mode) {
9478
+ if (_optionalChain([cur, 'optionalAccess', _386 => _386.layerId]) !== id || cur.mode !== mode) {
9351
9479
  this.state.maskView = { layerId: id, mode };
9352
9480
  this.notify();
9353
9481
  }
@@ -9359,7 +9487,7 @@ var ImageEditorController = (_class12 = class {
9359
9487
  return _nullishCoalesce(this.state.channels, () => ( []));
9360
9488
  }
9361
9489
  getChannel(id) {
9362
- return _nullishCoalesce(_optionalChain([this, 'access', _386 => _386.state, 'access', _387 => _387.channels, 'optionalAccess', _388 => _388.find, 'call', _389 => _389((c) => c.id === id)]), () => ( null));
9490
+ return _nullishCoalesce(_optionalChain([this, 'access', _387 => _387.state, 'access', _388 => _388.channels, 'optionalAccess', _389 => _389.find, 'call', _390 => _390((c) => c.id === id)]), () => ( null));
9363
9491
  }
9364
9492
  requireChannel(id) {
9365
9493
  const channel = this.getChannel(id);
@@ -9388,14 +9516,14 @@ var ImageEditorController = (_class12 = class {
9388
9516
  */
9389
9517
  saveSelection(options = {}) {
9390
9518
  const sel = this.state.selection;
9391
- if (!_optionalChain([sel, 'optionalAccess', _390 => _390.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
9519
+ if (!_optionalChain([sel, 'optionalAccess', _391 => _391.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
9392
9520
  const { width, height } = this.naturalSize;
9393
9521
  const sized = sel.width === width && sel.height === height ? sel : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, sel, width, height);
9394
9522
  const channels = [...this.getChannels()];
9395
9523
  if (options.channelId !== void 0) {
9396
9524
  const existing = this.requireChannel(options.channelId);
9397
9525
  const mask = _nullishCoalesce(_chunkQYLWG22Ncjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkQYLWG22Ncjs.createSelectionMask.call(void 0, width, height)));
9398
- const next = { ...existing, mask, ..._optionalChain([options, 'access', _391 => _391.name, 'optionalAccess', _392 => _392.trim, 'call', _393 => _393()]) ? { name: options.name.trim() } : {} };
9526
+ const next = { ...existing, mask, ..._optionalChain([options, 'access', _392 => _392.name, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) ? { name: options.name.trim() } : {} };
9399
9527
  this.setChannels(channels.map((c) => c.id === existing.id ? next : c));
9400
9528
  return next;
9401
9529
  }
@@ -9406,7 +9534,7 @@ var ImageEditorController = (_class12 = class {
9406
9534
  const channels = this.getChannels();
9407
9535
  const channel = {
9408
9536
  id: this.newChannelId(),
9409
- name: _optionalChain([name, 'optionalAccess', _394 => _394.trim, 'call', _395 => _395()]) || `Alpha ${channels.length + 1}`,
9537
+ name: _optionalChain([name, 'optionalAccess', _395 => _395.trim, 'call', _396 => _396()]) || `Alpha ${channels.length + 1}`,
9410
9538
  mask,
9411
9539
  color: DEFAULT_CHANNEL_COLOR,
9412
9540
  opacity: 0.5,
@@ -9451,7 +9579,7 @@ var ImageEditorController = (_class12 = class {
9451
9579
  /** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
9452
9580
  duplicateChannel(id, name) {
9453
9581
  const channel = this.requireChannel(id);
9454
- const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _396 => _396.trim, 'call', _397 => _397()]) || `${channel.name} copy` };
9582
+ const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _397 => _397.trim, 'call', _398 => _398()]) || `${channel.name} copy` };
9455
9583
  const channels = [...this.getChannels()];
9456
9584
  channels.splice(channels.findIndex((c) => c.id === id) + 1, 0, copy);
9457
9585
  this.setChannels(channels);
@@ -9482,7 +9610,7 @@ var ImageEditorController = (_class12 = class {
9482
9610
  quickMaskSurface() {
9483
9611
  const { width, height } = this.naturalSize;
9484
9612
  const sel = this.state.selection;
9485
- if (!_optionalChain([sel, 'optionalAccess', _398 => _398.bounds])) return _chunk474IQG74cjs.emptySurface.call(void 0, 1, 0);
9613
+ if (!_optionalChain([sel, 'optionalAccess', _399 => _399.bounds])) return _chunk474IQG74cjs.emptySurface.call(void 0, 1, 0);
9486
9614
  return (sel.width === width && sel.height === height ? sel : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, sel, width, height)).surface;
9487
9615
  }
9488
9616
  /** The selection a painted Quick Mask surface stands for (it shares the surface's tiles). */
@@ -9503,7 +9631,7 @@ var ImageEditorController = (_class12 = class {
9503
9631
  */
9504
9632
  applySelectionAsLayerMask(layerId, props = {}) {
9505
9633
  const sel = this.state.selection;
9506
- if (!_optionalChain([sel, 'optionalAccess', _399 => _399.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
9634
+ if (!_optionalChain([sel, 'optionalAccess', _400 => _400.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
9507
9635
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
9508
9636
  }
9509
9637
  setLayerMask(layerId, mask, commitToHistory = true) {
@@ -9543,7 +9671,7 @@ var ImageEditorController = (_class12 = class {
9543
9671
  /** A layer's painted mask over the canvas as a selection mask; null without one (or for a depth mask). */
9544
9672
  layerMaskCoverage(layerId) {
9545
9673
  const layer = this.getLayer(layerId);
9546
- if (!_optionalChain([layer, 'optionalAccess', _400 => _400.mask]) || layer.mask.source) return null;
9674
+ if (!_optionalChain([layer, 'optionalAccess', _401 => _401.mask]) || layer.mask.source) return null;
9547
9675
  const { width, height } = this.naturalSize;
9548
9676
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
9549
9677
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -9578,7 +9706,7 @@ var ImageEditorController = (_class12 = class {
9578
9706
  this.state.layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
9579
9707
  const next = { ...l };
9580
9708
  if (_chunkH65IBXFIcjs.isDefaultDepthMask.call(void 0, merged)) {
9581
- if (_optionalChain([next, 'access', _401 => _401.mask, 'optionalAccess', _402 => _402.source])) delete next.mask;
9709
+ if (_optionalChain([next, 'access', _402 => _402.mask, 'optionalAccess', _403 => _403.source])) delete next.mask;
9582
9710
  } else next.mask = _chunkH65IBXFIcjs.depthRasterMask.call(void 0, merged);
9583
9711
  return next;
9584
9712
  });
@@ -9588,7 +9716,7 @@ var ImageEditorController = (_class12 = class {
9588
9716
  resetDepthMask() {
9589
9717
  this.recordHistory();
9590
9718
  const target = this.developLayer();
9591
- if (_optionalChain([target, 'optionalAccess', _403 => _403.mask, 'optionalAccess', _404 => _404.source])) {
9719
+ if (_optionalChain([target, 'optionalAccess', _404 => _404.mask, 'optionalAccess', _405 => _405.source])) {
9592
9720
  this.state.layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
9593
9721
  const next = { ...l };
9594
9722
  delete next.mask;
@@ -9600,7 +9728,7 @@ var ImageEditorController = (_class12 = class {
9600
9728
  // --- Annotations & Layers ---
9601
9729
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
9602
9730
  annotationLayer(id) {
9603
- return _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkH65IBXFIcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _405 => _405.id]) === id);
9731
+ return _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkH65IBXFIcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _406 => _406.id]) === id);
9604
9732
  }
9605
9733
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
9606
9734
  annotationEnv() {
@@ -9618,7 +9746,7 @@ var ImageEditorController = (_class12 = class {
9618
9746
  const fullAnnotation = { ...annotation, id };
9619
9747
  const layer = _chunkH65IBXFIcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
9620
9748
  const loc = placement.aboveId ? _chunkUOGKSVRQcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
9621
- this.state.layers = loc ? _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _406 => _406.parent, 'optionalAccess', _407 => _407.id]), () => ( null)), loc.index + 1) : _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, null);
9749
+ this.state.layers = loc ? _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _407 => _407.parent, 'optionalAccess', _408 => _408.id]), () => ( null)), loc.index + 1) : _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, null);
9622
9750
  this.state.selectedAnnotationId = id;
9623
9751
  this.notify();
9624
9752
  return id;
@@ -9741,11 +9869,11 @@ var ImageEditorController = (_class12 = class {
9741
9869
  await this.renderer.renderToCanvas(targetCanvas, source, this.state, {
9742
9870
  ...options,
9743
9871
  // The clone source follows the brush cursor (both editors pass it).
9744
- cloneSourceMarker: _optionalChain([options, 'optionalAccess', _408 => _408.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _409 => _409.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
9872
+ cloneSourceMarker: _optionalChain([options, 'optionalAccess', _409 => _409.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _410 => _410.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
9745
9873
  dirty: dirty === "all" ? void 0 : dirty,
9746
9874
  checkpointLayerId: this.state.activeLayerId
9747
9875
  });
9748
- } catch (e30) {
9876
+ } catch (e31) {
9749
9877
  }
9750
9878
  }
9751
9879
  async renderExport(options) {
@@ -9754,7 +9882,7 @@ var ImageEditorController = (_class12 = class {
9754
9882
  return this.renderer.createCanvas(1, 1);
9755
9883
  }
9756
9884
  this.syncViews();
9757
- if (_optionalChain([options, 'optionalAccess', _410 => _410.layerIds])) {
9885
+ if (_optionalChain([options, 'optionalAccess', _411 => _411.layerIds])) {
9758
9886
  const keep = new Set(options.layerIds);
9759
9887
  const layers = _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
9760
9888
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
@@ -9800,7 +9928,7 @@ var ImageEditorController = (_class12 = class {
9800
9928
  try {
9801
9929
  if (mime === "image/png") return _chunkBROJYMWUcjs.writePngIcc.call(void 0, bytes, icc, this.getColorProfile().name);
9802
9930
  if (mime === "image/jpeg") return _chunkBROJYMWUcjs.writeJpegIcc.call(void 0, bytes, icc);
9803
- } catch (e31) {
9931
+ } catch (e32) {
9804
9932
  }
9805
9933
  return bytes;
9806
9934
  }
@@ -9908,7 +10036,7 @@ var ImageEditorController = (_class12 = class {
9908
10036
  let px2 = await this.decodeImage(newDataUrl);
9909
10037
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
9910
10038
  const data = new Uint8ClampedArray(px2.data);
9911
- const sel = _optionalChain([this, 'access', _411 => _411.state, 'access', _412 => _412.selection, 'optionalAccess', _413 => _413.bounds]) ? this.state.selection : null;
10039
+ const sel = _optionalChain([this, 'access', _412 => _412.state, 'access', _413 => _413.selection, 'optionalAccess', _414 => _414.bounds]) ? this.state.selection : null;
9912
10040
  if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
9913
10041
  return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
9914
10042
  }
@@ -9955,7 +10083,7 @@ var ImageEditorController = (_class12 = class {
9955
10083
  }
9956
10084
  /** Font families the shaper offers (generic families at least). */
9957
10085
  listFonts() {
9958
- return _nullishCoalesce(_optionalChain([this, 'access', _414 => _414.getTextShaper, 'call', _415 => _415(), 'optionalAccess', _416 => _416.families, 'optionalCall', _417 => _417()]), () => ( ["sans-serif", "serif", "monospace"]));
10086
+ return _nullishCoalesce(_optionalChain([this, 'access', _415 => _415.getTextShaper, 'call', _416 => _416(), 'optionalAccess', _417 => _417.families, 'optionalCall', _418 => _418()]), () => ( ["sans-serif", "serif", "monospace"]));
9959
10087
  }
9960
10088
  typeInfo(id) {
9961
10089
  const layer = _chunkH65IBXFIcjs.requireTypeLayer.call(void 0, this.state.layers, id);
@@ -10029,22 +10157,22 @@ var ImageEditorController = (_class12 = class {
10029
10157
  const layer = this.layoutTypeLayer({ ...init, text, orientation: vertical ? "vertical" : "horizontal" });
10030
10158
  const { width, height } = this.naturalSize;
10031
10159
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
10032
- const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _418 => _418.x]), () => ( 0)));
10033
- const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _419 => _419.y]), () => ( 0)));
10160
+ const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _419 => _419.x]), () => ( 0)));
10161
+ const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _420 => _420.y]), () => ( 0)));
10034
10162
  const x1 = Math.min(width, b ? b.x + b.width : 0);
10035
10163
  const y1 = Math.min(height, b ? b.y + b.height : 0);
10036
10164
  let mask;
10037
10165
  if (!b || x1 <= x0 || y1 <= y0) mask = _chunkQYLWG22Ncjs.createSelectionMask.call(void 0, width, height);
10038
10166
  else {
10039
- const rect = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
10040
- const rgba = _chunk474IQG74cjs.readRegion.call(void 0, layer.surface, rect);
10041
- const bytes = new Uint8Array(rect.width * rect.height);
10167
+ const rect2 = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
10168
+ const rgba = _chunk474IQG74cjs.readRegion.call(void 0, layer.surface, rect2);
10169
+ const bytes = new Uint8Array(rect2.width * rect2.height);
10042
10170
  const hard = init.antiAlias === false;
10043
10171
  for (let i = 0; i < bytes.length; i++) {
10044
10172
  const a = rgba[i * 4 + 3];
10045
10173
  bytes[i] = hard ? a >= 128 ? 255 : 0 : a;
10046
10174
  }
10047
- mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect, bytes);
10175
+ mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect2, bytes);
10048
10176
  }
10049
10177
  if ((_nullishCoalesce(init.feather, () => ( 0))) > 0 && mask.bounds) mask = _chunkQYLWG22Ncjs.modifySelection.call(void 0, mask, "feather", init.feather);
10050
10178
  return this.setSelection(mask.bounds ? mask : null, _nullishCoalesce(init.mode, () => ( "replace")));
@@ -10207,7 +10335,7 @@ var ImageEditorController = (_class12 = class {
10207
10335
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
10208
10336
  const missing = _chunkQAUIZPYIcjs.layoutText.call(void 0, layer, shaper).missingFonts;
10209
10337
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
10210
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _420 => _420.runs, 'access', _421 => _421.find, 'call', _422 => _422((r) => r.length > 0), 'optionalAccess', _423 => _423.style]), () => ( _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE));
10338
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _421 => _421.runs, 'access', _422 => _422.find, 'call', _423 => _423((r) => r.length > 0), 'optionalAccess', _424 => _424.style]), () => ( _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE));
10211
10339
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
10212
10340
  const shape = _chunkH65IBXFIcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
10213
10341
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
@@ -10240,7 +10368,7 @@ var ImageEditorController = (_class12 = class {
10240
10368
  // --- Shape layers ---
10241
10369
  /** What shape rendering needs: the canvas size and the document's patterns. */
10242
10370
  shapeEnv() {
10243
- return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _424 => _424.state, 'access', _425 => _425.patterns, 'optionalAccess', _426 => _426.find, 'call', _427 => _427((p) => p.id === id)]), () => ( null)) };
10371
+ return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _425 => _425.state, 'access', _426 => _426.patterns, 'optionalAccess', _427 => _427.find, 'call', _428 => _428((p) => p.id === id)]), () => ( null)) };
10244
10372
  }
10245
10373
  /** One component from tool or UI input (validated). */
10246
10374
  componentFrom(spec, path) {
@@ -10283,9 +10411,9 @@ var ImageEditorController = (_class12 = class {
10283
10411
  * open path) and stroked with `stroke`. Goes above the active layer unless placed. Returns its id.
10284
10412
  */
10285
10413
  addShapeLayer(init) {
10286
- const specs = _optionalChain([init, 'access', _428 => _428.components, 'optionalAccess', _429 => _429.length]) ? init.components : [init];
10287
- if (_optionalChain([init, 'access', _430 => _430.components, 'optionalAccess', _431 => _431.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
10288
- const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _432 => _432.components, 'optionalAccess', _433 => _433.length]) ? `components[${i}].` : ""));
10414
+ const specs = _optionalChain([init, 'access', _429 => _429.components, 'optionalAccess', _430 => _430.length]) ? init.components : [init];
10415
+ if (_optionalChain([init, 'access', _431 => _431.components, 'optionalAccess', _432 => _432.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
10416
+ const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _433 => _433.components, 'optionalAccess', _434 => _434.length]) ? `components[${i}].` : ""));
10289
10417
  const stroke = init.stroke ? _chunkH65IBXFIcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
10290
10418
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
10291
10419
  const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkH65IBXFIcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkH65IBXFIcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
@@ -10396,15 +10524,15 @@ var ImageEditorController = (_class12 = class {
10396
10524
  if (layer.locks) next.locks = layer.locks;
10397
10525
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
10398
10526
  } else if (layer.type === "pixel") {
10399
- if (!_optionalChain([layer, 'access', _434 => _434.filters, 'optionalAccess', _435 => _435.length])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
10527
+ if (!_optionalChain([layer, 'access', _435 => _435.filters, 'optionalAccess', _436 => _436.length])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
10400
10528
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
10401
10529
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
10402
10530
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
10403
10531
  delete content.mask;
10404
10532
  delete content.clipped;
10405
10533
  delete content.fillOpacity;
10406
- const rect = spatial ? canvas : _nullishCoalesce(this.getLayerBounds(id), () => ( canvas));
10407
- const surface = await this.compositeToSurface([content], rect);
10534
+ const rect2 = spatial ? canvas : _nullishCoalesce(this.getLayerBounds(id), () => ( canvas));
10535
+ const surface = await this.compositeToSurface([content], rect2);
10408
10536
  next = { ...layer, surface, offset: { x: 0, y: 0 } };
10409
10537
  delete next.filters;
10410
10538
  delete next.source;
@@ -10415,7 +10543,7 @@ var ImageEditorController = (_class12 = class {
10415
10543
  return this.rasterizeSmartObject(id);
10416
10544
  } else if (layer.type === "shape" || layer.type === "type") {
10417
10545
  next = layer.type === "shape" ? _chunkH65IBXFIcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkH65IBXFIcjs.typeAsPixelLayer.call(void 0, layer);
10418
- if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _436 => _436.annotation, 'optionalAccess', _437 => _437.id])) this.state.selectedAnnotationId = null;
10546
+ if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _437 => _437.annotation, 'optionalAccess', _438 => _438.id])) this.state.selectedAnnotationId = null;
10419
10547
  } else {
10420
10548
  throw new (0, _chunkH65IBXFIcjs.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.`);
10421
10549
  }
@@ -10429,8 +10557,8 @@ var ImageEditorController = (_class12 = class {
10429
10557
  const doc = this.state.colorProfile;
10430
10558
  const p = resolveProfile(doc);
10431
10559
  const m = this.state.colorMode;
10432
- const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _438 => _438.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _439 => _439.mode]), () => ( "rgb")) };
10433
- if (_optionalChain([m, 'optionalAccess', _440 => _440.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
10560
+ const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _439 => _439.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _440 => _440.mode]), () => ( "rgb")) };
10561
+ if (_optionalChain([m, 'optionalAccess', _441 => _441.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
10434
10562
  return out;
10435
10563
  }
10436
10564
  /**
@@ -10520,7 +10648,7 @@ var ImageEditorController = (_class12 = class {
10520
10648
  const textEnv = this.textEnv();
10521
10649
  const walk = (layers) => layers.map((l) => {
10522
10650
  let next2 = l;
10523
- if (_optionalChain([l, 'access', _441 => _441.effects, 'optionalAccess', _442 => _442.items, 'access', _443 => _443.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
10651
+ if (_optionalChain([l, 'access', _442 => _442.effects, 'optionalAccess', _443 => _443.items, 'access', _444 => _444.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
10524
10652
  if (l.type === "group") {
10525
10653
  if (next2 !== l) converted.push(l.id);
10526
10654
  return { ...next2, children: walk(l.children) };
@@ -10534,7 +10662,7 @@ var ImageEditorController = (_class12 = class {
10534
10662
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
10535
10663
  try {
10536
10664
  next2 = _chunkH65IBXFIcjs.rerenderText.call(void 0, recoloured, textEnv);
10537
- } catch (e32) {
10665
+ } catch (e33) {
10538
10666
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
10539
10667
  }
10540
10668
  } else if (l.type === "annotation") next2 = { ...next2, annotation: convertColorFields(l.annotation, hex) };
@@ -10708,8 +10836,8 @@ var ImageEditorController = (_class12 = class {
10708
10836
  else delete s.bitDepth;
10709
10837
  delete s.colorProfile;
10710
10838
  delete s.colorMode;
10711
- if (_optionalChain([result, 'access', _444 => _444.sourceMode, 'optionalAccess', _445 => _445.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
10712
- else if (_optionalChain([result, 'access', _446 => _446.sourceMode, 'optionalAccess', _447 => _447.mode]) === "lab") s.colorMode = { mode: "lab" };
10839
+ if (_optionalChain([result, 'access', _445 => _445.sourceMode, 'optionalAccess', _446 => _446.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
10840
+ else if (_optionalChain([result, 'access', _447 => _447.sourceMode, 'optionalAccess', _448 => _448.mode]) === "lab") s.colorMode = { mode: "lab" };
10713
10841
  else if (result.iccProfile) {
10714
10842
  try {
10715
10843
  const doc = documentProfile(result.iccProfile);
@@ -10773,7 +10901,7 @@ var ImageEditorController = (_class12 = class {
10773
10901
  const compositor = new (0, _chunkH65IBXFIcjs.LayerCompositor)();
10774
10902
  const bakeMask = (layer) => {
10775
10903
  const mask = layer.mask;
10776
- if (!_optionalChain([mask, 'optionalAccess', _448 => _448.source])) return mask;
10904
+ if (!_optionalChain([mask, 'optionalAccess', _449 => _449.source])) return mask;
10777
10905
  add2("Parametric (depth) masks were baked into pixel masks", layer.name);
10778
10906
  const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
10779
10907
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
@@ -10790,7 +10918,7 @@ var ImageEditorController = (_class12 = class {
10790
10918
  };
10791
10919
  const prepare = async (layer) => {
10792
10920
  const p = await prepareLayer(layer);
10793
- if (_optionalChain([p, 'optionalAccess', _449 => _449.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
10921
+ if (_optionalChain([p, 'optionalAccess', _450 => _450.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
10794
10922
  return p;
10795
10923
  };
10796
10924
  const prepareLayer = async (layer) => {
@@ -10833,7 +10961,7 @@ var ImageEditorController = (_class12 = class {
10833
10961
  return out2;
10834
10962
  }
10835
10963
  if (layer.type === "shape" || layer.type === "type") {
10836
- if (layer.type === "type" && _optionalChain([layer, 'access', _450 => _450.missingFonts, 'optionalAccess', _451 => _451.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
10964
+ if (layer.type === "type" && _optionalChain([layer, 'access', _451 => _451.missingFonts, 'optionalAccess', _452 => _452.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
10837
10965
  const out2 = { ...layer };
10838
10966
  const mask2 = bakeMask(layer);
10839
10967
  if (mask2) out2.mask = mask2;
@@ -10852,7 +10980,7 @@ var ImageEditorController = (_class12 = class {
10852
10980
  out.surface = this.surfaceOf(layer);
10853
10981
  delete out.source;
10854
10982
  }
10855
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _452 => _452.filters, 'optionalAccess', _453 => _453.filter, 'call', _454 => _454(_chunkH65IBXFIcjs.isActiveFilter)]), () => ( []));
10983
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _453 => _453.filters, 'optionalAccess', _454 => _454.filter, 'call', _455 => _455(_chunkH65IBXFIcjs.isActiveFilter)]), () => ( []));
10856
10984
  if (active.length) {
10857
10985
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
10858
10986
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -10863,7 +10991,7 @@ var ImageEditorController = (_class12 = class {
10863
10991
  const data = compositor.composite([content], canvas, sources);
10864
10992
  out = { ...out, surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
10865
10993
  }
10866
- if (_optionalChain([layer, 'access', _455 => _455.filters, 'optionalAccess', _456 => _456.some, 'call', _457 => _457((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
10994
+ if (_optionalChain([layer, 'access', _456 => _456.filters, 'optionalAccess', _457 => _457.some, 'call', _458 => _458((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
10867
10995
  delete out.filters;
10868
10996
  const mask = bakeMask(layer);
10869
10997
  if (mask) out.mask = mask;
@@ -10927,7 +11055,7 @@ var ImageEditorController = (_class12 = class {
10927
11055
  );
10928
11056
  }
10929
11057
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
10930
- const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _458 => _458.state, 'access', _459 => _459.patterns, 'optionalAccess', _460 => _460.find, 'call', _461 => _461((p) => p.id === pid)]), () => ( null)) };
11058
+ const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _459 => _459.state, 'access', _460 => _460.patterns, 'optionalAccess', _461 => _461.find, 'call', _462 => _462((p) => p.id === pid)]), () => ( null)) };
10931
11059
  for (const l of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers)) {
10932
11060
  if (l.type === "annotation") {
10933
11061
  layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
@@ -10936,7 +11064,7 @@ var ImageEditorController = (_class12 = class {
10936
11064
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
10937
11065
  const fromAnnotation = scaled ? _chunkH65IBXFIcjs.shapeFromAnnotation.call(void 0, scaled) : null;
10938
11066
  const m = [sx, 0, 0, sy, 0, 0];
10939
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _462 => _462.components]), () => ( _chunkH65IBXFIcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
11067
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _463 => _463.components]), () => ( _chunkH65IBXFIcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
10940
11068
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
10941
11069
  if (scaled && fromAnnotation) moved.annotation = scaled;
10942
11070
  else delete moved.annotation;
@@ -10954,7 +11082,7 @@ var ImageEditorController = (_class12 = class {
10954
11082
  this.notify();
10955
11083
  }
10956
11084
  toJSON(options) {
10957
- const root = _optionalChain([this, 'access', _463 => _463.contentsStack, 'access', _464 => _464[0], 'optionalAccess', _465 => _465.saved]);
11085
+ const root = _optionalChain([this, 'access', _464 => _464.contentsStack, 'access', _465 => _465[0], 'optionalAccess', _466 => _466.saved]);
10958
11086
  const current = this.state;
10959
11087
  const element = this.imageElement;
10960
11088
  if (root) {
@@ -10965,9 +11093,9 @@ var ImageEditorController = (_class12 = class {
10965
11093
  let out;
10966
11094
  try {
10967
11095
  out = this.serializeState();
10968
- if (_optionalChain([this, 'access', _466 => _466.state, 'access', _467 => _467.selection, 'optionalAccess', _468 => _468.bounds])) out.selection = _chunkQYLWG22Ncjs.serializeSelection.call(void 0, this.state.selection);
10969
- if (_optionalChain([this, 'access', _469 => _469.state, 'access', _470 => _470.channels, 'optionalAccess', _471 => _471.length])) out.channels = serializeChannels(this.state.channels);
10970
- if (_optionalChain([this, 'access', _472 => _472.state, 'access', _473 => _473.paths, 'optionalAccess', _474 => _474.length])) out.paths = serializePaths(this.state.paths);
11096
+ if (_optionalChain([this, 'access', _467 => _467.state, 'access', _468 => _468.selection, 'optionalAccess', _469 => _469.bounds])) out.selection = _chunkQYLWG22Ncjs.serializeSelection.call(void 0, this.state.selection);
11097
+ if (_optionalChain([this, 'access', _470 => _470.state, 'access', _471 => _471.channels, 'optionalAccess', _472 => _472.length])) out.channels = serializeChannels(this.state.channels);
11098
+ if (_optionalChain([this, 'access', _473 => _473.state, 'access', _474 => _474.paths, 'optionalAccess', _475 => _475.length])) out.paths = serializePaths(this.state.paths);
10971
11099
  } finally {
10972
11100
  if (root) {
10973
11101
  this.state = current;
@@ -11002,7 +11130,7 @@ var ImageEditorController = (_class12 = class {
11002
11130
  if (data.selection) {
11003
11131
  try {
11004
11132
  selection = normalizeSelection(_chunkQYLWG22Ncjs.deserializeSelection.call(void 0, data.selection));
11005
- } catch (e33) {
11133
+ } catch (e34) {
11006
11134
  selection = null;
11007
11135
  }
11008
11136
  }
@@ -11085,10 +11213,10 @@ var ImageEditorController = (_class12 = class {
11085
11213
  serializeState() {
11086
11214
  const { width, height } = this.naturalSize;
11087
11215
  const view = _chunkH65IBXFIcjs.legacyView.call(void 0, this.stack(), width, height, null);
11088
- if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _475 => _475.state, 'access', _476 => _476.patterns, 'optionalAccess', _477 => _477.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11216
+ if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _476 => _476.state, 'access', _477 => _477.patterns, 'optionalAccess', _478 => _478.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11089
11217
  return {
11090
11218
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
11091
- version: _optionalChain([view, 'access', _478 => _478.adjustments, 'access', _479 => _479.layers, 'optionalAccess', _480 => _480.length]) ? 2 : 1,
11219
+ version: _optionalChain([view, 'access', _479 => _479.adjustments, 'access', _480 => _480.layers, 'optionalAccess', _481 => _481.length]) ? 2 : 1,
11092
11220
  crop: this.state.crop ? { ...this.state.crop } : null,
11093
11221
  transform: { ...this.state.transform },
11094
11222
  adjustments: serializeAdjustments(view.adjustments),
@@ -11113,7 +11241,7 @@ var ImageEditorController = (_class12 = class {
11113
11241
  };
11114
11242
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
11115
11243
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
11116
- if (_optionalChain([this, 'access', _481 => _481.state, 'access', _482 => _482.patterns, 'optionalAccess', _483 => _483.length])) out.patterns = _chunkH65IBXFIcjs.serializePatterns.call(void 0, this.state.patterns);
11244
+ if (_optionalChain([this, 'access', _482 => _482.state, 'access', _483 => _483.patterns, 'optionalAccess', _484 => _484.length])) out.patterns = _chunkH65IBXFIcjs.serializePatterns.call(void 0, this.state.patterns);
11117
11245
  if (smartContents) out.smartContents = smartContents;
11118
11246
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
11119
11247
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -11123,7 +11251,7 @@ var ImageEditorController = (_class12 = class {
11123
11251
  }, _class12);
11124
11252
  function serializeAdjustments(adjustments) {
11125
11253
  const out = { ...adjustments };
11126
- if (_optionalChain([out, 'access', _484 => _484.layers, 'optionalAccess', _485 => _485.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11254
+ if (_optionalChain([out, 'access', _485 => _485.layers, 'optionalAccess', _486 => _486.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11127
11255
  else delete out.layers;
11128
11256
  if (_chunkH65IBXFIcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkH65IBXFIcjs.LEGACY_PROCESS_VERSION) {
11129
11257
  delete out.process;
@@ -11159,11 +11287,11 @@ function withDevelop(layer, partial) {
11159
11287
  return { ...layer, filters };
11160
11288
  }
11161
11289
  function withBlur(layer, radius) {
11162
- const existing = _optionalChain([layer, 'access', _486 => _486.filters, 'optionalAccess', _487 => _487.find, 'call', _488 => _488((f) => f.kind === "blur")]);
11290
+ const existing = _optionalChain([layer, 'access', _487 => _487.filters, 'optionalAccess', _488 => _488.find, 'call', _489 => _489((f) => f.kind === "blur")]);
11163
11291
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
11164
11292
  if (radius > 0) {
11165
11293
  filters.push({
11166
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _489 => _489.id]), () => ( (layer.source === "document" ? _chunkH65IBXFIcjs.BLUR_FILTER_ID : _chunkH65IBXFIcjs.newLayerId.call(void 0, "flt")))),
11294
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _490 => _490.id]), () => ( (layer.source === "document" ? _chunkH65IBXFIcjs.BLUR_FILTER_ID : _chunkH65IBXFIcjs.newLayerId.call(void 0, "flt")))),
11167
11295
  kind: "blur",
11168
11296
  enabled: true,
11169
11297
  radius
@@ -11259,7 +11387,7 @@ function collectStateTiles(layers, into) {
11259
11387
  if (l.type === "shape" || l.type === "type") _chunk474IQG74cjs.collectTiles.call(void 0, l.surface, into);
11260
11388
  if (l.type === "smart") {
11261
11389
  _chunk474IQG74cjs.collectTiles.call(void 0, l.surface, into);
11262
- if (_optionalChain([l, 'access', _490 => _490.smartFilters, 'optionalAccess', _491 => _491.mask])) _chunk474IQG74cjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
11390
+ if (_optionalChain([l, 'access', _491 => _491.smartFilters, 'optionalAccess', _492 => _492.mask])) _chunk474IQG74cjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
11263
11391
  if (l.contents.raster) _chunk474IQG74cjs.collectTiles.call(void 0, l.contents.raster, into);
11264
11392
  if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
11265
11393
  }
@@ -11291,7 +11419,7 @@ function pixelsOnly(layers) {
11291
11419
  for (const l of layers) {
11292
11420
  if (l.type === "adjustment") continue;
11293
11421
  if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
11294
- else if (l.type === "pixel" && _optionalChain([l, 'access', _492 => _492.filters, 'optionalAccess', _493 => _493.length])) {
11422
+ else if (l.type === "pixel" && _optionalChain([l, 'access', _493 => _493.filters, 'optionalAccess', _494 => _494.length])) {
11295
11423
  const p = { ...l };
11296
11424
  delete p.filters;
11297
11425
  out.push(p);
@@ -11357,7 +11485,7 @@ function toHex(c) {
11357
11485
  return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
11358
11486
  }
11359
11487
  function normalizeSelection(mask) {
11360
- return _optionalChain([mask, 'optionalAccess', _494 => _494.bounds]) ? mask : null;
11488
+ return _optionalChain([mask, 'optionalAccess', _495 => _495.bounds]) ? mask : null;
11361
11489
  }
11362
11490
  function sameSelection(a, b) {
11363
11491
  if (a.width !== b.width || a.height !== b.height) return false;
@@ -11511,7 +11639,7 @@ function loadImageEditorDocument(input) {
11511
11639
  if (typeof input === "string") {
11512
11640
  try {
11513
11641
  parsed = JSON.parse(input);
11514
- } catch (e34) {
11642
+ } catch (e35) {
11515
11643
  parsed = input;
11516
11644
  }
11517
11645
  }
@@ -11567,7 +11695,7 @@ function loadImageEditorDocument(input) {
11567
11695
  }
11568
11696
  const state = { version: 1, ...result.value };
11569
11697
  if (isV2) {
11570
- if (_optionalChain([state, 'access', _495 => _495.adjustments, 'access', _496 => _496.layers, 'optionalAccess', _497 => _497.length])) state.version = 2;
11698
+ if (_optionalChain([state, 'access', _496 => _496.adjustments, 'access', _497 => _497.layers, 'optionalAccess', _498 => _498.length])) state.version = 2;
11571
11699
  result.report.version = 2;
11572
11700
  }
11573
11701
  if (state.selection === void 0) delete state.selection;
@@ -11775,7 +11903,7 @@ function findAdjustmentControl(id) {
11775
11903
  }
11776
11904
  function findLayerControl(kind, id) {
11777
11905
  if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
11778
- return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _498 => _498[kind], 'optionalAccess', _499 => _499.find, 'call', _500 => _500((c) => c.id === id)]);
11906
+ return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _499 => _499[kind], 'optionalAccess', _500 => _500.find, 'call', _501 => _501((c) => c.id === id)]);
11779
11907
  }
11780
11908
  function clampControlValue(spec, v) {
11781
11909
  if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
@@ -12046,7 +12174,7 @@ function layersOf(args) {
12046
12174
  add2(args.layerId);
12047
12175
  add2(args.id);
12048
12176
  add2(args.target);
12049
- for (const key of ["ids", "layerIds"]) if (Array.isArray(args[key])) args[key].forEach(add2);
12177
+ for (const key2 of ["ids", "layerIds"]) if (Array.isArray(args[key2])) args[key2].forEach(add2);
12050
12178
  return out.slice(0, 6);
12051
12179
  }
12052
12180
  function planImageToolPlayback(tool, args) {
@@ -12059,9 +12187,9 @@ function planImageToolPlayback(tool, args) {
12059
12187
  else if (box) steps.push({ type: "move", to: box.from }, { type: "press" }, { type: "drag", to: box.to }, { type: "release" });
12060
12188
  else if (num(args.x) && num(args.y)) steps.push({ type: "move", to: { x: args.x, y: args.y } }, { type: "press" }, { type: "release" });
12061
12189
  else if (tool === "set_adjustments" && args.values && typeof args.values === "object") {
12062
- for (const key of Object.keys(args.values).slice(0, 4)) {
12063
- const m = /^layers\.([^.]+)\.(.+)$/.exec(key);
12064
- steps.push({ type: "target", ref: m ? { kind: "control", id: m[2] } : { kind: "control", id: key } });
12190
+ for (const key2 of Object.keys(args.values).slice(0, 4)) {
12191
+ const m = /^layers\.([^.]+)\.(.+)$/.exec(key2);
12192
+ steps.push({ type: "target", ref: m ? { kind: "control", id: m[2] } : { kind: "control", id: key2 } });
12065
12193
  }
12066
12194
  } else for (const id of layersOf(args)) steps.push({ type: "target", ref: { kind: IMAGE_PLAYBACK_KIND, id } });
12067
12195
  if (typeof args.text === "string" && args.text.trim()) {
@@ -12237,10 +12365,10 @@ function sampleOptions(args) {
12237
12365
  return { sampleMerged: args.sampleMerged === true, sample: _nullishCoalesce(args.sample, () => ( "composite")) };
12238
12366
  }
12239
12367
  function rectOf(args) {
12240
- const rect = { x: num2(args.x, NaN), y: num2(args.y, NaN), width: num2(args.width, NaN), height: num2(args.height, NaN) };
12241
- if (![rect.x, rect.y, rect.width, rect.height].every(Number.isFinite)) throw new Error("Pass numeric x, y, width and height in natural image pixels.");
12242
- if (rect.width <= 0 || rect.height <= 0) throw new Error("width and height must be greater than 0.");
12243
- return rect;
12368
+ const rect2 = { x: num2(args.x, NaN), y: num2(args.y, NaN), width: num2(args.width, NaN), height: num2(args.height, NaN) };
12369
+ if (![rect2.x, rect2.y, rect2.width, rect2.height].every(Number.isFinite)) throw new Error("Pass numeric x, y, width and height in natural image pixels.");
12370
+ if (rect2.width <= 0 || rect2.height <= 0) throw new Error("width and height must be greater than 0.");
12371
+ return rect2;
12244
12372
  }
12245
12373
  function summary(controller) {
12246
12374
  const sel = controller.getSelection();
@@ -12248,7 +12376,7 @@ function summary(controller) {
12248
12376
  const area = _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel);
12249
12377
  return {
12250
12378
  empty: !sel,
12251
- bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _501 => _501.bounds]), () => ( null)),
12379
+ bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _502 => _502.bounds]), () => ( null)),
12252
12380
  /** Σ coverage in pixels. */
12253
12381
  area: Math.round(area),
12254
12382
  percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
@@ -12315,16 +12443,16 @@ function createImageSelectionTools(controller) {
12315
12443
  break;
12316
12444
  case "rect":
12317
12445
  case "ellipse": {
12318
- const rect = { x: num2(x, NaN), y: num2(y, NaN), width: num2(width, NaN), height: num2(height, NaN) };
12319
- if (![rect.x, rect.y, rect.width, rect.height].every(Number.isFinite)) {
12446
+ const rect2 = { x: num2(x, NaN), y: num2(y, NaN), width: num2(width, NaN), height: num2(height, NaN) };
12447
+ if (![rect2.x, rect2.y, rect2.width, rect2.height].every(Number.isFinite)) {
12320
12448
  throw new Error("rect and ellipse need numeric x, y, width and height.");
12321
12449
  }
12322
- if (shape === "rect") controller.selectRect(rect, opts);
12323
- else controller.selectEllipse(rect, opts);
12450
+ if (shape === "rect") controller.selectRect(rect2, opts);
12451
+ else controller.selectEllipse(rect2, opts);
12324
12452
  break;
12325
12453
  }
12326
12454
  case "polygon": {
12327
- const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _502 => _502.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _503 => _503.y]), NaN) })) : [];
12455
+ const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _503 => _503.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _504 => _504.y]), NaN) })) : [];
12328
12456
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
12329
12457
  throw new Error("polygon needs points: at least 3 { x, y } vertices.");
12330
12458
  }
@@ -12452,7 +12580,7 @@ function createImageSelectionTools(controller) {
12452
12580
  },
12453
12581
  annotations: writeAnnotations("Refine the selection edge"),
12454
12582
  handler: async (params) => {
12455
- const edits = Array.isArray(params.edits) ? params.edits.map((e) => e.kind === "object" ? { ...e } : { ...e, points: (_nullishCoalesce(e.points, () => ( []))).map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _504 => _504.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _505 => _505.y]), NaN) })) }) : [];
12583
+ const edits = Array.isArray(params.edits) ? params.edits.map((e) => e.kind === "object" ? { ...e } : { ...e, points: (_nullishCoalesce(e.points, () => ( []))).map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _505 => _505.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _506 => _506.y]), NaN) })) }) : [];
12456
12584
  for (const e of edits) {
12457
12585
  if (e.kind === "object") {
12458
12586
  if (!e.rect === !e.point) throw new Error("An object edit takes rect (a box around the object) or point (on it).");
@@ -12616,7 +12744,7 @@ function createImageSelectionTools(controller) {
12616
12744
  },
12617
12745
  annotations: writeAnnotations("Select a polygon (lasso)", true),
12618
12746
  handler: async (args) => {
12619
- const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _506 => _506.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _507 => _507.y]), NaN) })) : [];
12747
+ const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _507 => _507.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _508 => _508.y]), NaN) })) : [];
12620
12748
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
12621
12749
  throw new Error("points needs at least 3 { x, y } vertices in natural image pixels.");
12622
12750
  }
@@ -12653,7 +12781,7 @@ function createImageSelectionTools(controller) {
12653
12781
  },
12654
12782
  annotations: writeAnnotations("Quick Selection"),
12655
12783
  handler: async (args, context) => {
12656
- const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _508 => _508.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _509 => _509.y]), NaN) })) : []) : [];
12784
+ const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _509 => _509.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _510 => _510.y]), NaN) })) : []) : [];
12657
12785
  if (!strokes.length || strokes.some((s) => !s.length || !s.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y)))) {
12658
12786
  throw new Error("strokes needs at least one stroke of { x, y } points in natural image pixels.");
12659
12787
  }
@@ -12662,7 +12790,7 @@ function createImageSelectionTools(controller) {
12662
12790
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12663
12791
  sampleAllLayers: args.sampleAllLayers,
12664
12792
  enhanceEdge: args.enhanceEdge,
12665
- signal: _optionalChain([context, 'optionalAccess', _510 => _510.signal])
12793
+ signal: _optionalChain([context, 'optionalAccess', _511 => _511.signal])
12666
12794
  });
12667
12795
  return summary(controller);
12668
12796
  }
@@ -12691,18 +12819,18 @@ function createImageSelectionTools(controller) {
12691
12819
  },
12692
12820
  annotations: { ...writeAnnotations("Object Selection"), openWorldHint: true },
12693
12821
  handler: async (args, context) => {
12694
- const rect = args.rect;
12822
+ const rect2 = args.rect;
12695
12823
  const point = args.point;
12696
- if (!rect && !point) throw new Error("Pass rect (a box around the object) or point (a point on it).");
12697
- if (rect && point) throw new Error("Pass rect or point, not both.");
12824
+ if (!rect2 && !point) throw new Error("Pass rect (a box around the object) or point (a point on it).");
12825
+ if (rect2 && point) throw new Error("Pass rect or point, not both.");
12698
12826
  const options = {
12699
12827
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12700
12828
  sampleAllLayers: args.sampleAllLayers,
12701
12829
  enhanceEdge: args.enhanceEdge,
12702
12830
  useModel: args.useModel,
12703
- signal: _optionalChain([context, 'optionalAccess', _511 => _511.signal])
12831
+ signal: _optionalChain([context, 'optionalAccess', _512 => _512.signal])
12704
12832
  };
12705
- const { method } = rect ? await controller.selectObject({ rect: { x: num2(rect.x, NaN), y: num2(rect.y, NaN), width: num2(rect.width, NaN), height: num2(rect.height, NaN) } }, options) : await controller.selectObject({ point: { x: num2(point.x, NaN), y: num2(point.y, NaN) } }, options);
12833
+ const { method } = rect2 ? await controller.selectObject({ rect: { x: num2(rect2.x, NaN), y: num2(rect2.y, NaN), width: num2(rect2.width, NaN), height: num2(rect2.height, NaN) } }, options) : await controller.selectObject({ point: { x: num2(point.x, NaN), y: num2(point.y, NaN) } }, options);
12706
12834
  return { ...summary(controller), method };
12707
12835
  }
12708
12836
  };
@@ -12729,7 +12857,7 @@ function createImageSelectionTools(controller) {
12729
12857
  softness: args.softness === void 0 ? void 0 : num2(args.softness, 4),
12730
12858
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12731
12859
  sampleAllLayers: args.sampleAllLayers,
12732
- signal: _optionalChain([context, 'optionalAccess', _512 => _512.signal])
12860
+ signal: _optionalChain([context, 'optionalAccess', _513 => _513.signal])
12733
12861
  });
12734
12862
  return { ...summary(controller), noiseLevel };
12735
12863
  }
@@ -12757,7 +12885,7 @@ function createImageSelectionTools(controller) {
12757
12885
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12758
12886
  sampleAllLayers: args.sampleAllLayers,
12759
12887
  useModel: args.useModel,
12760
- signal: _optionalChain([context, 'optionalAccess', _513 => _513.signal])
12888
+ signal: _optionalChain([context, 'optionalAccess', _514 => _514.signal])
12761
12889
  });
12762
12890
  return { ...summary(controller), method, ...note ? { note } : {} };
12763
12891
  }
@@ -12855,7 +12983,7 @@ function createImageSelectionTools(controller) {
12855
12983
  await controller.selectColorRangePreset(args.preset, { ...common, falloff: num2(args.fuzziness, 20) });
12856
12984
  } else {
12857
12985
  const samples = args.samples.map((s, i) => {
12858
- if (typeof _optionalChain([s, 'optionalAccess', _514 => _514.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
12986
+ if (typeof _optionalChain([s, 'optionalAccess', _515 => _515.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
12859
12987
  const at = typeof s.x === "number" && typeof s.y === "number" ? { x: s.x, y: s.y } : void 0;
12860
12988
  return at ? { color: s.color, at } : { color: s.color };
12861
12989
  });
@@ -13097,7 +13225,7 @@ function createImageSelectionTools(controller) {
13097
13225
  annotations: writeAnnotations("Content-Aware Fill"),
13098
13226
  handler: async (args, context) => {
13099
13227
  if (!controller.getSelection()) throw new Error("Nothing is selected; select what to remove first.");
13100
- const rects = (v) => Array.isArray(v) ? v.map((r) => ({ x: num2(_optionalChain([r, 'optionalAccess', _515 => _515.x]), NaN), y: num2(_optionalChain([r, 'optionalAccess', _516 => _516.y]), NaN), width: num2(_optionalChain([r, 'optionalAccess', _517 => _517.width]), NaN), height: num2(_optionalChain([r, 'optionalAccess', _518 => _518.height]), NaN) })) : void 0;
13228
+ const rects = (v) => Array.isArray(v) ? v.map((r) => ({ x: num2(_optionalChain([r, 'optionalAccess', _516 => _516.x]), NaN), y: num2(_optionalChain([r, 'optionalAccess', _517 => _517.y]), NaN), width: num2(_optionalChain([r, 'optionalAccess', _518 => _518.width]), NaN), height: num2(_optionalChain([r, 'optionalAccess', _519 => _519.height]), NaN) })) : void 0;
13101
13229
  return controller.contentAwareFillAsync({
13102
13230
  output: args.output,
13103
13231
  sampleRadius: args.sampleRadius,
@@ -13106,7 +13234,7 @@ function createImageSelectionTools(controller) {
13106
13234
  sampleRects: rects(args.sampleRects),
13107
13235
  excludeRects: rects(args.excludeRects),
13108
13236
  samplingChannelId: typeof args.samplingChannelId === "string" ? args.samplingChannelId : void 0,
13109
- signal: _optionalChain([context, 'optionalAccess', _519 => _519.signal])
13237
+ signal: _optionalChain([context, 'optionalAccess', _520 => _520.signal])
13110
13238
  });
13111
13239
  }
13112
13240
  };
@@ -13384,13 +13512,13 @@ function createImageSubjectSelectionTool(controller) {
13384
13512
  handler: async ({ target, maxSegments, mode, feather, enhanceEdge }, context) => {
13385
13513
  if (target !== void 0 && typeof target !== "string") throw new Error("target must be a description in words.");
13386
13514
  if (controller.segmentationProvider && !String(_nullishCoalesce(target, () => ( ""))).trim()) throw new Error("target must describe what to select (a model is set, and it selects by description).");
13387
- const perform = _optionalChain([context, 'optionalAccess', _520 => _520.perform]);
13515
+ const perform = _optionalChain([context, 'optionalAccess', _521 => _521.perform]);
13388
13516
  const { segments, method, note } = await controller.selectSubject(String(_nullishCoalesce(target, () => ( ""))), {
13389
13517
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, mode),
13390
13518
  feather: num2(feather, 0),
13391
13519
  maxSegments: typeof maxSegments === "number" ? Math.max(1, Math.round(maxSegments)) : void 0,
13392
13520
  enhanceEdge: enhanceEdge === true,
13393
- signal: _optionalChain([context, 'optionalAccess', _521 => _521.signal]),
13521
+ signal: _optionalChain([context, 'optionalAccess', _522 => _522.signal]),
13394
13522
  // Under playback the cursor traces what the model found, as a lasso, before it is selected.
13395
13523
  beforeApply: perform ? (outlines) => perform(planOutlineTrace(outlines)) : void 0
13396
13524
  });
@@ -13454,7 +13582,7 @@ async function renderImageRegion(controller, request) {
13454
13582
  out.height = request.height;
13455
13583
  const context = out.getContext("2d");
13456
13584
  if (!context) throw new Error(NO_CANVAS);
13457
- const { rect } = request;
13585
+ const { rect: rect2 } = request;
13458
13586
  context.imageSmoothingEnabled = request.scale < 1;
13459
13587
  if (request.format === "jpeg") {
13460
13588
  context.fillStyle = "#ffffff";
@@ -13462,22 +13590,22 @@ async function renderImageRegion(controller, request) {
13462
13590
  }
13463
13591
  const kx = view.width / state.imageDimensions.width;
13464
13592
  const ky = view.height / state.imageDimensions.height;
13465
- context.drawImage(view, rect.x * kx, rect.y * ky, rect.width * kx, rect.height * ky, 0, 0, out.width, out.height);
13593
+ context.drawImage(view, rect2.x * kx, rect2.y * ky, rect2.width * kx, rect2.height * ky, 0, 0, out.width, out.height);
13466
13594
  if (request.includeOverlays) {
13467
13595
  const s = request.scale;
13468
13596
  const maskView = maskViewCanvas(controller, document);
13469
- if (maskView) context.drawImage(maskView, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
13597
+ if (maskView) context.drawImage(maskView, rect2.x, rect2.y, rect2.width, rect2.height, 0, 0, out.width, out.height);
13470
13598
  const selection = state.selection;
13471
- if (_optionalChain([selection, 'optionalAccess', _522 => _522.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
13599
+ if (_optionalChain([selection, 'optionalAccess', _523 => _523.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
13472
13600
  const shade = selectionShade(selection, document);
13473
- if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
13601
+ if (shade) context.drawImage(shade, rect2.x, rect2.y, rect2.width, rect2.height, 0, 0, out.width, out.height);
13474
13602
  }
13475
13603
  if (state.crop) {
13476
13604
  context.save();
13477
13605
  context.strokeStyle = "#ffd400";
13478
13606
  context.lineWidth = 2;
13479
13607
  context.setLineDash([6, 4]);
13480
- context.strokeRect((state.crop.x - rect.x) * s, (state.crop.y - rect.y) * s, state.crop.width * s, state.crop.height * s);
13608
+ context.strokeRect((state.crop.x - rect2.x) * s, (state.crop.y - rect2.y) * s, state.crop.width * s, state.crop.height * s);
13481
13609
  context.restore();
13482
13610
  }
13483
13611
  }
@@ -13493,7 +13621,7 @@ function createImageCaptureSurface(controller) {
13493
13621
  return {
13494
13622
  units: "image pixels",
13495
13623
  content: whole,
13496
- selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _523 => _523.getState, 'call', _524 => _524(), 'access', _525 => _525.selection, 'optionalAccess', _526 => _526.bounds]), () => ( null)) }),
13624
+ selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _524 => _524.getState, 'call', _525 => _525(), 'access', _526 => _526.selection, 'optionalAccess', _527 => _527.bounds]), () => ( null)) }),
13497
13625
  overlays: "a shade over unselected pixels, the crop box outline and a layer mask view (set_mask_view)",
13498
13626
  maxScale: 8,
13499
13627
  render: (request) => renderImageRegion(controller, request)
@@ -13827,7 +13955,7 @@ function describeLayer(layer, activeId, boundsOf) {
13827
13955
  out.bounds = boundsOf(layer);
13828
13956
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
13829
13957
  out.shape = {
13830
- components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _527 => _527.live, 'optionalAccess', _528 => _528.kind]), () => ( "path")) })),
13958
+ components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _528 => _528.live, 'optionalAccess', _529 => _529.kind]), () => ( "path")) })),
13831
13959
  fill: layer.fill ? layer.fill.type : null,
13832
13960
  stroke: layer.stroke ? { width: layer.stroke.width, paint: layer.stroke.paint.type } : null
13833
13961
  };
@@ -13850,8 +13978,8 @@ function describeLayer(layer, activeId, boundsOf) {
13850
13978
  out.bounds = boundsOf(layer);
13851
13979
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
13852
13980
  out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
13853
- out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _529 => _529.smartFilters, 'optionalAccess', _530 => _530.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
13854
- out.filterMask = maskSummary(_optionalChain([layer, 'access', _531 => _531.smartFilters, 'optionalAccess', _532 => _532.mask]));
13981
+ out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _530 => _530.smartFilters, 'optionalAccess', _531 => _531.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
13982
+ out.filterMask = maskSummary(_optionalChain([layer, 'access', _532 => _532.smartFilters, 'optionalAccess', _533 => _533.mask]));
13855
13983
  break;
13856
13984
  }
13857
13985
  return out;
@@ -13879,7 +14007,7 @@ function createImageLayerTools(controller) {
13879
14007
  if (!loc) return null;
13880
14008
  return {
13881
14009
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
13882
- parentId: _nullishCoalesce(_optionalChain([loc, 'access', _533 => _533.parent, 'optionalAccess', _534 => _534.id]), () => ( null)),
14010
+ parentId: _nullishCoalesce(_optionalChain([loc, 'access', _534 => _534.parent, 'optionalAccess', _535 => _535.id]), () => ( null)),
13883
14011
  index: loc.index
13884
14012
  };
13885
14013
  };
@@ -14202,7 +14330,7 @@ function createImageLayerTools(controller) {
14202
14330
  if (view !== "gray" && view !== "overlay" && view !== "off") throw new Error(`Unknown view "${String(view)}". Use gray, overlay or off.`);
14203
14331
  const id = view === "off" || layerId === void 0 ? void 0 : exists(layerId);
14204
14332
  const shown = controller.setMaskView(view, id);
14205
- return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _535 => _535.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _536 => _536.layerId]), () => ( null)) };
14333
+ return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _536 => _536.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _537 => _537.layerId]), () => ( null)) };
14206
14334
  }
14207
14335
  };
14208
14336
  const maskProps = {
@@ -14754,12 +14882,12 @@ var SelectionGesture = (_class13 = class {
14754
14882
  size: _nullishCoalesce(options.quickSize, () => ( 30)),
14755
14883
  grow: q.mode === "add",
14756
14884
  enhanceEdge: _nullishCoalesce(options.quickEnhance, () => ( false)),
14757
- selection: q.mode === "add" && _optionalChain([q, 'access', _537 => _537.base, 'optionalAccess', _538 => _538.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, q.base) : null
14885
+ selection: q.mode === "add" && _optionalChain([q, 'access', _538 => _538.base, 'optionalAccess', _539 => _539.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, q.base) : null
14758
14886
  },
14759
14887
  pixels
14760
14888
  );
14761
14889
  if (this.quick === q) this.controller.setSelectionPreview(_chunkQYLWG22Ncjs.combineSelections.call(void 0, q.base, mask, q.mode));
14762
- } catch (e35) {
14890
+ } catch (e36) {
14763
14891
  break;
14764
14892
  }
14765
14893
  } while (q.dirty && this.quick === q);
@@ -14779,19 +14907,19 @@ var SelectionGesture = (_class13 = class {
14779
14907
  const { tool } = this.getOptions();
14780
14908
  if (tool === "quick") return null;
14781
14909
  if (tool === "lasso") return this.points.length > 1 ? this.points.slice() : null;
14782
- const rect = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
14910
+ const rect2 = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
14783
14911
  x: this.start.x,
14784
14912
  y: this.start.y,
14785
14913
  width: this.current.x - this.start.x,
14786
14914
  height: this.current.y - this.start.y
14787
14915
  });
14788
- if (rect.width < 1 && rect.height < 1) return null;
14789
- if (tool === "ellipse") return _chunkL52VMQZScjs.ellipsePoints.call(void 0, rect);
14916
+ if (rect2.width < 1 && rect2.height < 1) return null;
14917
+ if (tool === "ellipse") return _chunkL52VMQZScjs.ellipsePoints.call(void 0, rect2);
14790
14918
  return [
14791
- { x: rect.x, y: rect.y },
14792
- { x: rect.x + rect.width, y: rect.y },
14793
- { x: rect.x + rect.width, y: rect.y + rect.height },
14794
- { x: rect.x, y: rect.y + rect.height }
14919
+ { x: rect2.x, y: rect2.y },
14920
+ { x: rect2.x + rect2.width, y: rect2.y },
14921
+ { x: rect2.x + rect2.width, y: rect2.y + rect2.height },
14922
+ { x: rect2.x, y: rect2.y + rect2.height }
14795
14923
  ];
14796
14924
  }
14797
14925
  /** Pointer down. Resolves once a wand click has been applied. */
@@ -14947,11 +15075,11 @@ var SelectionGesture = (_class13 = class {
14947
15075
  const options = this.getOptions();
14948
15076
  const mode = selectionModeFromModifiers(_nullishCoalesce(modifiers, () => ( this.modifiers)), options.mode);
14949
15077
  if (options.tool === "object") {
14950
- const rect2 = _chunkL52VMQZScjs.normalizeRect.call(void 0, { x: this.start.x, y: this.start.y, width: this.current.x - this.start.x, height: this.current.y - this.start.y });
15078
+ const rect3 = _chunkL52VMQZScjs.normalizeRect.call(void 0, { x: this.start.x, y: this.start.y, width: this.current.x - this.start.x, height: this.current.y - this.start.y });
14951
15079
  this.start = null;
14952
15080
  this.current = null;
14953
15081
  this.points = [];
14954
- const target = rect2.width >= 4 && rect2.height >= 4 ? { rect: rect2 } : { point: { x: rect2.x + rect2.width / 2, y: rect2.y + rect2.height / 2 } };
15082
+ const target = rect3.width >= 4 && rect3.height >= 4 ? { rect: rect3 } : { point: { x: rect3.x + rect3.width / 2, y: rect3.y + rect3.height / 2 } };
14955
15083
  this.pending = this.controller.selectObject(target, { mode, sampleAllLayers: _nullishCoalesce(options.objectSampleAll, () => ( true)), enhanceEdge: _nullishCoalesce(options.objectEnhance, () => ( false)) }).then(
14956
15084
  () => void 0,
14957
15085
  (err) => {
@@ -14965,7 +15093,7 @@ var SelectionGesture = (_class13 = class {
14965
15093
  this.start = null;
14966
15094
  this.current = null;
14967
15095
  this.points = [];
14968
- const strokeMode = _nullishCoalesce(_optionalChain([this, 'access', _539 => _539.quick, 'optionalAccess', _540 => _540.mode]), () => ( (mode === "replace" && this.controller.getSelection() ? "add" : mode)));
15096
+ const strokeMode = _nullishCoalesce(_optionalChain([this, 'access', _540 => _540.quick, 'optionalAccess', _541 => _541.mode]), () => ( (mode === "replace" && this.controller.getSelection() ? "add" : mode)));
14969
15097
  this.quick = null;
14970
15098
  this.pending = this.controller.quickSelect([stroke], {
14971
15099
  size: _nullishCoalesce(options.quickSize, () => ( 30)),
@@ -14981,7 +15109,7 @@ var SelectionGesture = (_class13 = class {
14981
15109
  return false;
14982
15110
  }
14983
15111
  const path = this.draftPath;
14984
- const rect = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
15112
+ const rect2 = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
14985
15113
  x: this.start.x,
14986
15114
  y: this.start.y,
14987
15115
  width: this.current.x - this.start.x,
@@ -14993,7 +15121,7 @@ var SelectionGesture = (_class13 = class {
14993
15121
  if (!path) return mode === "replace" ? this.controller.deselect() : false;
14994
15122
  const opts = { mode, antiAlias: options.antiAlias, feather: _nullishCoalesce(options.feather, () => ( 0)) };
14995
15123
  if (options.tool === "lasso") return path.length >= 3 ? this.controller.selectPolygon(path, opts) : false;
14996
- return options.tool === "ellipse" ? this.controller.selectEllipse(rect, opts) : this.controller.selectRect(rect, opts);
15124
+ return options.tool === "ellipse" ? this.controller.selectEllipse(rect2, opts) : this.controller.selectRect(rect2, opts);
14997
15125
  }
14998
15126
  /** Closes a polygonal lasso and selects it. Returns true when the selection changed. */
14999
15127
  close() {
@@ -15017,11 +15145,11 @@ var SelectionGesture = (_class13 = class {
15017
15145
  * Keys for a polygonal lasso being drawn: Enter closes it, Escape cancels, Backspace / Delete
15018
15146
  * removes the last corner. Returns true when the key was used (the host prevents its default).
15019
15147
  */
15020
- key(key) {
15148
+ key(key2) {
15021
15149
  if (!this.polygon && !this.magnetic) return false;
15022
- if (key === "Enter") this.close();
15023
- else if (key === "Escape") this.cancel();
15024
- else if (key === "Backspace" || key === "Delete") {
15150
+ if (key2 === "Enter") this.close();
15151
+ else if (key2 === "Escape") this.cancel();
15152
+ else if (key2 === "Backspace" || key2 === "Delete") {
15025
15153
  const m = this.magnetic;
15026
15154
  if (m) {
15027
15155
  m.anchors.pop();
@@ -15121,29 +15249,29 @@ var SelectionGesture = (_class13 = class {
15121
15249
  }, _class13);
15122
15250
  function handleSelectionShortcut(controller, e, onError) {
15123
15251
  if (!(e.ctrlKey || e.metaKey)) return false;
15124
- const key = e.key.toLowerCase();
15252
+ const key2 = e.key.toLowerCase();
15125
15253
  const run = (fn) => {
15126
15254
  try {
15127
15255
  fn();
15128
15256
  } catch (err) {
15129
- _optionalChain([onError, 'optionalCall', _541 => _541(err instanceof Error ? err.message : String(err))]);
15257
+ _optionalChain([onError, 'optionalCall', _542 => _542(err instanceof Error ? err.message : String(err))]);
15130
15258
  }
15131
15259
  return true;
15132
15260
  };
15133
- if (key === "c") return run(() => controller.copyPixels({ merged: Boolean(e.shiftKey) }));
15134
- if (key === "x" && !e.shiftKey) return run(() => controller.cutPixels());
15135
- if (key === "v") return run(() => controller.pastePixels(e.shiftKey && e.altKey ? "into" : e.shiftKey ? "in-place" : "new-layer"));
15136
- if (key === "d") return run(() => e.shiftKey ? controller.reselect() : controller.deselect());
15137
- if (key === "i" && e.shiftKey) return run(() => controller.invertSelection());
15261
+ if (key2 === "c") return run(() => controller.copyPixels({ merged: Boolean(e.shiftKey) }));
15262
+ if (key2 === "x" && !e.shiftKey) return run(() => controller.cutPixels());
15263
+ if (key2 === "v") return run(() => controller.pastePixels(e.shiftKey && e.altKey ? "into" : e.shiftKey ? "in-place" : "new-layer"));
15264
+ if (key2 === "d") return run(() => e.shiftKey ? controller.reselect() : controller.deselect());
15265
+ if (key2 === "i" && e.shiftKey) return run(() => controller.invertSelection());
15138
15266
  return false;
15139
15267
  }
15140
15268
  function handleMaskViewKey(controller, e) {
15141
15269
  if (e.ctrlKey || e.metaKey || e.altKey || e.key !== "\\") return false;
15142
15270
  const id = controller.getState().activeLayerId;
15143
15271
  const layer = id ? controller.getLayer(id) : null;
15144
- if (!_optionalChain([layer, 'optionalAccess', _542 => _542.mask]) || layer.mask.source) return false;
15272
+ if (!_optionalChain([layer, 'optionalAccess', _543 => _543.mask]) || layer.mask.source) return false;
15145
15273
  const view = controller.getMaskView();
15146
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _543 => _543.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15274
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _544 => _544.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15147
15275
  return true;
15148
15276
  }
15149
15277
  function handleQuickMaskKey(controller, e) {
@@ -15284,14 +15412,14 @@ function handlePaintShortcut(controller, e) {
15284
15412
  if (e.ctrlKey || e.metaKey || e.altKey || isTyping(e.target)) return false;
15285
15413
  const brush = controller.getState().paint.brush;
15286
15414
  const set = (b) => controller.setPaintOptions({ brush: b });
15287
- const key = e.key;
15415
+ const key2 = e.key;
15288
15416
  if (handleMaskViewKey(controller, e)) return true;
15289
- switch (key.toLowerCase()) {
15417
+ switch (key2.toLowerCase()) {
15290
15418
  case "q":
15291
15419
  controller.setQuickMaskMode(!controller.quickMaskEditing);
15292
15420
  return true;
15293
15421
  case "b":
15294
- controller.setTool(e.shiftKey || key === "B" ? "mixer" : "brush");
15422
+ controller.setTool(e.shiftKey || key2 === "B" ? "mixer" : "brush");
15295
15423
  return true;
15296
15424
  case "e":
15297
15425
  controller.setTool("eraser");
@@ -15303,11 +15431,11 @@ function handlePaintShortcut(controller, e) {
15303
15431
  controller.setTool("clone");
15304
15432
  return true;
15305
15433
  case "j":
15306
- controller.setTool(e.shiftKey || key === "J" ? controller.getState().activeTool === "heal" ? "spot-heal" : "heal" : "spot-heal");
15434
+ controller.setTool(e.shiftKey || key2 === "J" ? controller.getState().activeTool === "heal" ? "spot-heal" : "heal" : "spot-heal");
15307
15435
  return true;
15308
15436
  case "o": {
15309
15437
  const cur = controller.getState().activeTool;
15310
- const next = e.shiftKey || key === "O" ? cur === "dodge" ? "burn" : cur === "burn" ? "sponge" : "dodge" : "dodge";
15438
+ const next = e.shiftKey || key2 === "O" ? cur === "dodge" ? "burn" : cur === "burn" ? "sponge" : "dodge" : "dodge";
15311
15439
  controller.setTool(next);
15312
15440
  return true;
15313
15441
  }
@@ -15321,18 +15449,18 @@ function handlePaintShortcut(controller, e) {
15321
15449
  controller.swapPaintColors();
15322
15450
  return true;
15323
15451
  }
15324
- if (key === "[" || key === "{") {
15325
- if (e.shiftKey || key === "{") set({ hardness: Math.max(0, Math.round((brush.hardness - 0.25) * 4) / 4) });
15452
+ if (key2 === "[" || key2 === "{") {
15453
+ if (e.shiftKey || key2 === "{") set({ hardness: Math.max(0, Math.round((brush.hardness - 0.25) * 4) / 4) });
15326
15454
  else set({ size: Math.max(1, brush.size - sizeStep(brush.size - 1)) });
15327
15455
  return true;
15328
15456
  }
15329
- if (key === "]" || key === "}") {
15330
- if (e.shiftKey || key === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
15457
+ if (key2 === "]" || key2 === "}") {
15458
+ if (e.shiftKey || key2 === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
15331
15459
  else set({ size: Math.min(_chunkPQ3H2AANcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
15332
15460
  return true;
15333
15461
  }
15334
- if (/^[0-9]$/.test(key) && isPaintTool(controller.getState().activeTool)) {
15335
- set({ opacity: key === "0" ? 1 : Number(key) / 10 });
15462
+ if (/^[0-9]$/.test(key2) && isPaintTool(controller.getState().activeTool)) {
15463
+ set({ opacity: key2 === "0" ? 1 : Number(key2) / 10 });
15336
15464
  return true;
15337
15465
  }
15338
15466
  return false;
@@ -15357,7 +15485,7 @@ var PaintGesture = (_class14 = class {
15357
15485
  const layer = this.controller.getActiveLayer();
15358
15486
  if (!layer) throw new Error("Select a layer to move in the Layers panel.");
15359
15487
  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.`);
15360
- if (_optionalChain([layer, 'access', _544 => _544.locks, 'optionalAccess', _545 => _545.all]) || _optionalChain([layer, 'access', _546 => _546.locks, 'optionalAccess', _547 => _547.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
15488
+ if (_optionalChain([layer, 'access', _545 => _545.locks, 'optionalAccess', _546 => _546.all]) || _optionalChain([layer, 'access', _547 => _547.locks, 'optionalAccess', _548 => _548.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
15361
15489
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
15362
15490
  const b = _chunkH65IBXFIcjs.shapeGeometryBounds.call(void 0, layer);
15363
15491
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
@@ -15414,7 +15542,7 @@ var PaintGesture = (_class14 = class {
15414
15542
  this.move = null;
15415
15543
  }
15416
15544
  cancel() {
15417
- _optionalChain([this, 'access', _548 => _548.stroke, 'optionalAccess', _549 => _549.cancel, 'call', _550 => _550()]);
15545
+ _optionalChain([this, 'access', _549 => _549.stroke, 'optionalAccess', _550 => _550.cancel, 'call', _551 => _551()]);
15418
15546
  this.stroke = null;
15419
15547
  this.move = null;
15420
15548
  }
@@ -15649,7 +15777,7 @@ function profileArg(v) {
15649
15777
  if (s.startsWith("icc:")) {
15650
15778
  try {
15651
15779
  return _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, s.slice(4));
15652
- } catch (e36) {
15780
+ } catch (e37) {
15653
15781
  throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("The icc: value is not valid base64.");
15654
15782
  }
15655
15783
  }
@@ -16495,7 +16623,7 @@ function createImageSmartObjectTools(controller) {
16495
16623
  const layerSummary = (id) => {
16496
16624
  const s = controller.getState();
16497
16625
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, s.layers, id);
16498
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _551 => _551.parent, 'optionalAccess', _552 => _552.id]), () => ( null)), index: loc.index } : null;
16626
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _552 => _552.parent, 'optionalAccess', _553 => _553.id]), () => ( null)), index: loc.index } : null;
16499
16627
  };
16500
16628
  const getSmart = {
16501
16629
  name: "get_smart_object",
@@ -17052,7 +17180,7 @@ function createImageShapeTools(controller) {
17052
17180
  const layerSummary = (id) => {
17053
17181
  const s = controller.getState();
17054
17182
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, s.layers, id);
17055
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _553 => _553.parent, 'optionalAccess', _554 => _554.id]), () => ( null)), index: loc.index } : null;
17183
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _554 => _554.parent, 'optionalAccess', _555 => _555.id]), () => ( null)), index: loc.index } : null;
17056
17184
  };
17057
17185
  const get = {
17058
17186
  name: "get_shape_layer",
@@ -17283,7 +17411,7 @@ function createImageShapeTools(controller) {
17283
17411
  const mode = args.mode;
17284
17412
  controller.pathToSelection(_nullishCoalesce(fromPathId(args), () => ( pathSpec(args))), { feather: args.feather, antiAlias: args.antiAlias, mode });
17285
17413
  const sel = controller.getSelection();
17286
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _555 => _555.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17414
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _556 => _556.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17287
17415
  }
17288
17416
  };
17289
17417
  const getVectorMask = {
@@ -17315,7 +17443,7 @@ function createImageShapeTools(controller) {
17315
17443
  handler: (args) => {
17316
17444
  const id = layerArg(args.layerId);
17317
17445
  const spec = _nullishCoalesce(fromPathId(args), () => ( pathSpec(args)));
17318
- const hasPath = _optionalChain([spec, 'access', _556 => _556.components, 'optionalAccess', _557 => _557.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
17446
+ const hasPath = _optionalChain([spec, 'access', _557 => _557.components, 'optionalAccess', _558 => _558.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
17319
17447
  const from = _nullishCoalesce(args.from, () => ( (hasPath ? "path" : "reveal-all")));
17320
17448
  if (from !== "selection" && TRACE_KEYS.some((k) => args[k] !== void 0)) throw new Error("tolerance, cornerRoundness and minArea apply only to from selection.");
17321
17449
  controller.addVectorMask(id, from, spec, traceOptions(args));
@@ -17423,7 +17551,7 @@ function createImageShapeTools(controller) {
17423
17551
  annotations: { title: "Add a document path", ...WRITE8 },
17424
17552
  handler: (args) => {
17425
17553
  const spec = pathSpec(args);
17426
- if (!_optionalChain([spec, 'access', _558 => _558.components, 'optionalAccess', _559 => _559.length]) && spec.shape === void 0 && spec.subpaths === void 0) throw new Error("Give the path as shape, subpaths or components.");
17554
+ if (!_optionalChain([spec, 'access', _559 => _559.components, 'optionalAccess', _560 => _560.length]) && spec.shape === void 0 && spec.subpaths === void 0) throw new Error("Give the path as shape, subpaths or components.");
17427
17555
  return { path: pathSummary(controller.addPath({ ...spec, name: args.name }).id) };
17428
17556
  }
17429
17557
  };
@@ -17567,7 +17695,7 @@ function createImageTypeTools(controller) {
17567
17695
  const layerSummary = (id) => {
17568
17696
  const s = controller.getState();
17569
17697
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, s.layers, id);
17570
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _560 => _560.parent, 'optionalAccess', _561 => _561.id]), () => ( null)), index: loc.index } : null;
17698
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _561 => _561.parent, 'optionalAccess', _562 => _562.id]), () => ( null)), index: loc.index } : null;
17571
17699
  };
17572
17700
  const range = (args) => ({ start: args.start, end: args.end });
17573
17701
  const listFonts = {
@@ -17576,7 +17704,7 @@ function createImageTypeTools(controller) {
17576
17704
  description: "Returns the font families type layers can use here (generic families such as sans-serif always work). Changes nothing.",
17577
17705
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
17578
17706
  annotations: { title: "List fonts", ...READ11 },
17579
- handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _562 => _562.getTextShaper, 'call', _563 => _563(), 'optionalAccess', _564 => _564.id]), () => ( null)) })
17707
+ handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _563 => _563.getTextShaper, 'call', _564 => _564(), 'optionalAccess', _565 => _565.id]), () => ( null)) })
17580
17708
  };
17581
17709
  const get = {
17582
17710
  name: "get_text_layer",
@@ -17732,7 +17860,7 @@ function createImageTypeTools(controller) {
17732
17860
  const init = pick2(args, ["text", "x", "y", "orientation", "box", "style", "paragraph", "rotation", "mode", "feather", "antiAlias"]);
17733
17861
  controller.selectTextShape(init);
17734
17862
  const sel = controller.getSelection();
17735
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _565 => _565.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17863
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _566 => _566.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17736
17864
  }
17737
17865
  };
17738
17866
  return [listFonts, get, add2, setText, setStyle, setParagraph, setFrame, setOrientation, toShape, typeMask];
@@ -17911,7 +18039,7 @@ function createImageEditorToolProvider(controller, options = {}) {
17911
18039
  for (const ref of [aboveId, parentId]) {
17912
18040
  if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
17913
18041
  }
17914
- if (parentId !== void 0 && _optionalChain([controller, 'access', _566 => _566.getLayer, 'call', _567 => _567(parentId), 'optionalAccess', _568 => _568.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
18042
+ if (parentId !== void 0 && _optionalChain([controller, 'access', _567 => _567.getLayer, 'call', _568 => _568(parentId), 'optionalAccess', _569 => _569.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
17915
18043
  const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId, useSelection: useSelection !== false });
17916
18044
  const layer = controller.getAdjustmentLayer(id);
17917
18045
  return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id), masked: Boolean(layer.mask) };
@@ -18136,11 +18264,11 @@ function scalePixels(pixels, w, h) {
18136
18264
  return { width: w, height: h, data: out };
18137
18265
  }
18138
18266
  function scaleEdit(edit, s) {
18139
- const pt = (p) => ({ x: p.x * s, y: p.y * s });
18267
+ const pt2 = (p) => ({ x: p.x * s, y: p.y * s });
18140
18268
  if (edit.kind === "object") {
18141
- return { ...edit, rect: edit.rect && { x: edit.rect.x * s, y: edit.rect.y * s, width: edit.rect.width * s, height: edit.rect.height * s }, point: edit.point && pt(edit.point) };
18269
+ return { ...edit, rect: edit.rect && { x: edit.rect.x * s, y: edit.rect.y * s, width: edit.rect.width * s, height: edit.rect.height * s }, point: edit.point && pt2(edit.point) };
18142
18270
  }
18143
- const scaled = { ...edit, points: edit.points.map(pt) };
18271
+ const scaled = { ...edit, points: edit.points.map(pt2) };
18144
18272
  if ("size" in edit && edit.size !== void 0) scaled.size = Math.max(1, edit.size * s);
18145
18273
  return scaled;
18146
18274
  }
@@ -18209,7 +18337,7 @@ var SelectAndMaskSession = (_class15 = class {
18209
18337
  if (!ids.length) return null;
18210
18338
  try {
18211
18339
  return this.controller.compositePixels(void 0, { layerIds: ids });
18212
- } catch (e37) {
18340
+ } catch (e38) {
18213
18341
  return null;
18214
18342
  }
18215
18343
  }
@@ -18246,7 +18374,7 @@ var SelectAndMaskSession = (_class15 = class {
18246
18374
  const h = Math.max(1, Math.round(px2.height * s));
18247
18375
  this.previewPixels = scalePixels(px2, w, h);
18248
18376
  this.belowPreview = this.below ? scalePixels(this.below, w, h) : null;
18249
- this.baseMask = _optionalChain([this, 'access', _569 => _569.base, 'optionalAccess', _570 => _570.bounds]) ? s === 1 ? this.base : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, this.base, w, h) : null;
18377
+ this.baseMask = _optionalChain([this, 'access', _570 => _570.base, 'optionalAccess', _571 => _571.bounds]) ? s === 1 ? this.base : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, this.base, w, h) : null;
18250
18378
  }
18251
18379
  /**
18252
18380
  * Recomputes the preview mask from the base selection, the strokes and the settings: at once on
@@ -18264,7 +18392,7 @@ var SelectAndMaskSession = (_class15 = class {
18264
18392
  const edits = [...this.editsList, ...this.live ? [this.live] : []].map((e) => scaleEdit(e, scale));
18265
18393
  try {
18266
18394
  const { selection, refineBrush } = _chunkL52VMQZScjs.applyRefineEdits.call(void 0, px2, this.baseMask, edits, px2.width, px2.height);
18267
- this.previewMask = _optionalChain([selection, 'optionalAccess', _571 => _571.bounds]) ? _chunkL52VMQZScjs.refineSelection.call(void 0, px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
18395
+ this.previewMask = _optionalChain([selection, 'optionalAccess', _572 => _572.bounds]) ? _chunkL52VMQZScjs.refineSelection.call(void 0, px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
18268
18396
  this.error = null;
18269
18397
  } catch (err) {
18270
18398
  this.previewMask = null;
@@ -18370,7 +18498,7 @@ var SelectAndMaskSession = (_class15 = class {
18370
18498
  break;
18371
18499
  }
18372
18500
  case "on-layers": {
18373
- const under = _optionalChain([this, 'access', _572 => _572.belowPreview, 'optionalAccess', _573 => _573.data]);
18501
+ const under = _optionalChain([this, 'access', _573 => _573.belowPreview, 'optionalAccess', _574 => _574.data]);
18374
18502
  let ur = checker;
18375
18503
  let ug = checker;
18376
18504
  let ub = checker;
@@ -18432,8 +18560,8 @@ var SelectAndMaskSession = (_class15 = class {
18432
18560
  if (!live || !this.dragStart) return;
18433
18561
  if (live.kind === "object") {
18434
18562
  const a = this.dragStart;
18435
- const rect = { x: Math.min(a.x, point.x), y: Math.min(a.y, point.y), width: Math.abs(point.x - a.x), height: Math.abs(point.y - a.y) };
18436
- this.live = rect.width >= 4 && rect.height >= 4 ? { kind: "object", rect, mode: live.mode } : { kind: "object", point: a, mode: live.mode };
18563
+ const rect2 = { x: Math.min(a.x, point.x), y: Math.min(a.y, point.y), width: Math.abs(point.x - a.x), height: Math.abs(point.y - a.y) };
18564
+ this.live = rect2.width >= 4 && rect2.height >= 4 ? { kind: "object", rect: rect2, mode: live.mode } : { kind: "object", point: a, mode: live.mode };
18437
18565
  return;
18438
18566
  }
18439
18567
  const last = live.points[live.points.length - 1];
@@ -18470,8 +18598,8 @@ var SelectAndMaskSession = (_class15 = class {
18470
18598
  * Show Original), J (Show Edge), P (Show Original), a tool letter, [ and ] (brush size).
18471
18599
  * Returns true when the key was used.
18472
18600
  */
18473
- handleKey(key) {
18474
- const k = key.toLowerCase();
18601
+ handleKey(key2) {
18602
+ const k = key2.toLowerCase();
18475
18603
  const view = SELECT_AND_MASK_VIEWS.find((v) => v.key === k);
18476
18604
  if (view) {
18477
18605
  this.update({ view: view.id });
@@ -18666,7 +18794,7 @@ function maskThumbnailClick(controller, layer, e) {
18666
18794
  } else if (e.altKey && !layer.mask.source) {
18667
18795
  const mode = e.shiftKey ? "overlay" : "gray";
18668
18796
  const view = controller.getMaskView();
18669
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _574 => _574.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
18797
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _575 => _575.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
18670
18798
  } else if (e.shiftKey) {
18671
18799
  controller.setLayerMaskProps(layer.id, { enabled: layer.mask.enabled === false });
18672
18800
  } else {
@@ -18730,7 +18858,7 @@ function layerHasThumbnail(layer) {
18730
18858
  return layer.type === "pixel" || layer.type === "shape" || layer.type === "type";
18731
18859
  }
18732
18860
  function layerWarning(layer) {
18733
- if (layer.type === "type" && _optionalChain([layer, 'access', _575 => _575.missingFonts, 'optionalAccess', _576 => _576.length])) {
18861
+ if (layer.type === "type" && _optionalChain([layer, 'access', _576 => _576.missingFonts, 'optionalAccess', _577 => _577.length])) {
18734
18862
  return `Missing ${layer.missingFonts.length === 1 ? "font" : "fonts"}: ${layer.missingFonts.join(", ")}. ${layer.rendering === "stored" ? "Showing the saved pixels until the text is edited." : "Drawn with a fallback font."}`;
18735
18863
  }
18736
18864
  return null;
@@ -18753,16 +18881,16 @@ function layerMenu(controller) {
18753
18881
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
18754
18882
  const below = loc ? siblings[loc.index - 1] : void 0;
18755
18883
  const hasSel = controller.hasSelection;
18756
- const isPixel = _optionalChain([active, 'optionalAccess', _577 => _577.type]) === "pixel";
18757
- const hasOwnPixels = _optionalChain([active, 'optionalAccess', _578 => _578.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _579 => _579.type]) === "shape" || _optionalChain([active, 'optionalAccess', _580 => _580.type]) === "type" || _optionalChain([active, 'optionalAccess', _581 => _581.type]) === "smart";
18884
+ const isPixel = _optionalChain([active, 'optionalAccess', _578 => _578.type]) === "pixel";
18885
+ const hasOwnPixels = _optionalChain([active, 'optionalAccess', _579 => _579.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _580 => _580.type]) === "shape" || _optionalChain([active, 'optionalAccess', _581 => _581.type]) === "type" || _optionalChain([active, 'optionalAccess', _582 => _582.type]) === "smart";
18758
18886
  return [
18759
18887
  { action: "new-layer", label: "New Layer", enabled: true },
18760
18888
  { action: "new-group", label: "New Group", enabled: true },
18761
18889
  { action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
18762
18890
  { action: "delete", label: "Delete Layer", enabled: Boolean(active) },
18763
18891
  { action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
18764
- { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _582 => _582.type]) === "group" },
18765
- { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _583 => _583.visible]) && _optionalChain([below, 'optionalAccess', _584 => _584.type]) === "pixel") },
18892
+ { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _583 => _583.type]) === "group" },
18893
+ { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _584 => _584.visible]) && _optionalChain([below, 'optionalAccess', _585 => _585.type]) === "pixel") },
18766
18894
  { action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
18767
18895
  { action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
18768
18896
  { action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
@@ -18772,27 +18900,27 @@ function layerMenu(controller) {
18772
18900
  { action: "add-mask-hide-selection", label: "Add Mask Hiding Selection", enabled: Boolean(active) && hasSel },
18773
18901
  { action: "add-mask-transparency", label: "Add Mask from Transparency", enabled: hasOwnPixels },
18774
18902
  { action: "select-transparency", label: "Select Layer Pixels", enabled: hasOwnPixels },
18775
- { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _585 => _585.mask])) },
18776
- { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _586 => _586.mask])) },
18777
- { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _587 => _587.mask, 'optionalAccess', _588 => _588.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _589 => _589.mask])) },
18778
- { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _590 => _590.mask, 'optionalAccess', _591 => _591.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _592 => _592.mask]) && !active.mask.source) },
18779
- { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _593 => _593.mask, 'optionalAccess', _594 => _594.source])) },
18780
- { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _595 => _595.mask, 'optionalAccess', _596 => _596.source])) },
18781
- { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _597 => _597.mask, 'optionalAccess', _598 => _598.source])) && hasSel },
18782
- { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _599 => _599.vectorMask])) },
18783
- { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _600 => _600.vectorMask, 'optionalAccess', _601 => _601.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _602 => _602.vectorMask])) },
18784
- { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _603 => _603.vectorMask])) },
18785
- { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _604 => _604.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _605 => _605.type]) === "smart" || _optionalChain([active, 'optionalAccess', _606 => _606.type]) === "shape" || _optionalChain([active, 'optionalAccess', _607 => _607.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _608 => _608.type]) === "pixel" && _optionalChain([active, 'access', _609 => _609.filters, 'optionalAccess', _610 => _610.length])) },
18903
+ { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _586 => _586.mask])) },
18904
+ { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _587 => _587.mask])) },
18905
+ { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _588 => _588.mask, 'optionalAccess', _589 => _589.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _590 => _590.mask])) },
18906
+ { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _591 => _591.mask, 'optionalAccess', _592 => _592.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _593 => _593.mask]) && !active.mask.source) },
18907
+ { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _594 => _594.mask, 'optionalAccess', _595 => _595.source])) },
18908
+ { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _596 => _596.mask, 'optionalAccess', _597 => _597.source])) },
18909
+ { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _598 => _598.mask, 'optionalAccess', _599 => _599.source])) && hasSel },
18910
+ { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _600 => _600.vectorMask])) },
18911
+ { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _601 => _601.vectorMask, 'optionalAccess', _602 => _602.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _603 => _603.vectorMask])) },
18912
+ { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _604 => _604.vectorMask])) },
18913
+ { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _605 => _605.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _606 => _606.type]) === "smart" || _optionalChain([active, 'optionalAccess', _607 => _607.type]) === "shape" || _optionalChain([active, 'optionalAccess', _608 => _608.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _609 => _609.type]) === "pixel" && _optionalChain([active, 'access', _610 => _610.filters, 'optionalAccess', _611 => _611.length])) },
18786
18914
  { action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
18787
- { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _611 => _611.type]) === "smart" },
18788
- { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _612 => _612.type]) === "smart" },
18789
- { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _613 => _613.type]) === "smart" && !_optionalChain([active, 'access', _614 => _614.smartFilters, 'optionalAccess', _615 => _615.mask]) },
18790
- { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _616 => _616.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
18915
+ { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _612 => _612.type]) === "smart" },
18916
+ { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _613 => _613.type]) === "smart" },
18917
+ { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _614 => _614.type]) === "smart" && !_optionalChain([active, 'access', _615 => _615.smartFilters, 'optionalAccess', _616 => _616.mask]) },
18918
+ { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _617 => _617.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
18791
18919
  ];
18792
18920
  }
18793
18921
  async function runLayerMenuAction(controller, action) {
18794
18922
  const active = controller.getActiveLayer();
18795
- const id = _optionalChain([active, 'optionalAccess', _617 => _617.id]);
18923
+ const id = _optionalChain([active, 'optionalAccess', _618 => _618.id]);
18796
18924
  try {
18797
18925
  switch (action) {
18798
18926
  case "new-layer":
@@ -18848,10 +18976,10 @@ async function runLayerMenuAction(controller, action) {
18848
18976
  if (id) controller.removeLayerMask(id);
18849
18977
  break;
18850
18978
  case "toggle-mask":
18851
- if (id && _optionalChain([active, 'optionalAccess', _618 => _618.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
18979
+ if (id && _optionalChain([active, 'optionalAccess', _619 => _619.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
18852
18980
  break;
18853
18981
  case "toggle-mask-link":
18854
- if (id && _optionalChain([active, 'optionalAccess', _619 => _619.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
18982
+ if (id && _optionalChain([active, 'optionalAccess', _620 => _620.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
18855
18983
  break;
18856
18984
  case "add-vector-mask":
18857
18985
  case "add-vector-mask-hide":
@@ -18864,7 +18992,7 @@ async function runLayerMenuAction(controller, action) {
18864
18992
  if (id) controller.removeVectorMask(id);
18865
18993
  break;
18866
18994
  case "toggle-vector-mask":
18867
- if (id && _optionalChain([active, 'optionalAccess', _620 => _620.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
18995
+ if (id && _optionalChain([active, 'optionalAccess', _621 => _621.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
18868
18996
  break;
18869
18997
  case "rasterize-vector-mask":
18870
18998
  if (id) controller.rasterizeVectorMask(id);
@@ -18885,7 +19013,7 @@ async function runLayerMenuAction(controller, action) {
18885
19013
  if (id) controller.setSmartFilterMask(id, "reveal-all");
18886
19014
  break;
18887
19015
  case "toggle-clip":
18888
- if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _621 => _621.clipped]) });
19016
+ if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _622 => _622.clipped]) });
18889
19017
  break;
18890
19018
  }
18891
19019
  return null;
@@ -18895,7 +19023,7 @@ async function runLayerMenuAction(controller, action) {
18895
19023
  }
18896
19024
  function smartFilterRows(layer) {
18897
19025
  if (layer.type !== "smart") return [];
18898
- const list = _nullishCoalesce(_optionalChain([layer, 'access', _622 => _622.smartFilters, 'optionalAccess', _623 => _623.filters]), () => ( []));
19026
+ const list = _nullishCoalesce(_optionalChain([layer, 'access', _623 => _623.smartFilters, 'optionalAccess', _624 => _624.filters]), () => ( []));
18899
19027
  const rows = list.map((f, index) => ({
18900
19028
  filter: f,
18901
19029
  index,
@@ -18921,8 +19049,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
18921
19049
  };
18922
19050
  collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
18923
19051
  const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
18924
- const imgW = _optionalChain([state, 'access', _624 => _624.imageDimensions, 'optionalAccess', _625 => _625.width]) || 1;
18925
- const imgH = _optionalChain([state, 'access', _626 => _626.imageDimensions, 'optionalAccess', _627 => _627.height]) || 1;
19052
+ const imgW = _optionalChain([state, 'access', _625 => _625.imageDimensions, 'optionalAccess', _626 => _626.width]) || 1;
19053
+ const imgH = _optionalChain([state, 'access', _627 => _627.imageDimensions, 'optionalAccess', _628 => _628.height]) || 1;
18926
19054
  return ctrlLayers.map((l) => {
18927
19055
  const bounds = controller.getLayerBounds(l.id) || {
18928
19056
  x: 0,
@@ -18931,8 +19059,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
18931
19059
  height: imgH
18932
19060
  };
18933
19061
  const sLayer = sLayerMap.get(l.id);
18934
- const assetKey = _optionalChain([sLayer, 'optionalAccess', _628 => _628.asset]);
18935
- const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _629 => _629.source]) === "document" ? fallbackImageUrl : "");
19062
+ const assetKey = _optionalChain([sLayer, 'optionalAccess', _629 => _629.asset]);
19063
+ const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _630 => _630.source]) === "document" ? fallbackImageUrl : "");
18936
19064
  return {
18937
19065
  id: l.id,
18938
19066
  name: l.name || "Untitled Layer",
@@ -18986,9 +19114,9 @@ async function addLayerOfKind(controller, id, init) {
18986
19114
  const cx = Math.round(canvas.width / 2);
18987
19115
  const cy = Math.round(canvas.height / 2);
18988
19116
  return controller.addTextLayer({
18989
- text: _optionalChain([init, 'optionalAccess', _630 => _630.text]) || "New Text",
18990
- x: typeof _optionalChain([init, 'optionalAccess', _631 => _631.x]) === "number" ? init.x : cx - 100,
18991
- y: typeof _optionalChain([init, 'optionalAccess', _632 => _632.y]) === "number" ? init.y : cy,
19117
+ text: _optionalChain([init, 'optionalAccess', _631 => _631.text]) || "New Text",
19118
+ x: typeof _optionalChain([init, 'optionalAccess', _632 => _632.x]) === "number" ? init.x : cx - 100,
19119
+ y: typeof _optionalChain([init, 'optionalAccess', _633 => _633.y]) === "number" ? init.y : cy,
18992
19120
  ...init
18993
19121
  });
18994
19122
  }
@@ -19001,10 +19129,10 @@ async function addLayerOfKind(controller, id, init) {
19001
19129
  return controller.addShapeLayer({
19002
19130
  shape: {
19003
19131
  kind: "rect",
19004
- x: typeof _optionalChain([init, 'optionalAccess', _633 => _633.x]) === "number" ? init.x : cx - Math.round(w / 2),
19005
- y: typeof _optionalChain([init, 'optionalAccess', _634 => _634.y]) === "number" ? init.y : cy - Math.round(h / 2),
19006
- width: typeof _optionalChain([init, 'optionalAccess', _635 => _635.width]) === "number" ? init.width : w,
19007
- height: typeof _optionalChain([init, 'optionalAccess', _636 => _636.height]) === "number" ? init.height : h
19132
+ x: typeof _optionalChain([init, 'optionalAccess', _634 => _634.x]) === "number" ? init.x : cx - Math.round(w / 2),
19133
+ y: typeof _optionalChain([init, 'optionalAccess', _635 => _635.y]) === "number" ? init.y : cy - Math.round(h / 2),
19134
+ width: typeof _optionalChain([init, 'optionalAccess', _636 => _636.width]) === "number" ? init.width : w,
19135
+ height: typeof _optionalChain([init, 'optionalAccess', _637 => _637.height]) === "number" ? init.height : h
19008
19136
  },
19009
19137
  name: "Rectangle",
19010
19138
  ...init
@@ -19019,10 +19147,10 @@ async function addLayerOfKind(controller, id, init) {
19019
19147
  return controller.addShapeLayer({
19020
19148
  shape: {
19021
19149
  kind: "ellipse",
19022
- x: typeof _optionalChain([init, 'optionalAccess', _637 => _637.x]) === "number" ? init.x : cx - Math.round(w / 2),
19023
- y: typeof _optionalChain([init, 'optionalAccess', _638 => _638.y]) === "number" ? init.y : cy - Math.round(h / 2),
19024
- width: typeof _optionalChain([init, 'optionalAccess', _639 => _639.width]) === "number" ? init.width : w,
19025
- height: typeof _optionalChain([init, 'optionalAccess', _640 => _640.height]) === "number" ? init.height : h
19150
+ x: typeof _optionalChain([init, 'optionalAccess', _638 => _638.x]) === "number" ? init.x : cx - Math.round(w / 2),
19151
+ y: typeof _optionalChain([init, 'optionalAccess', _639 => _639.y]) === "number" ? init.y : cy - Math.round(h / 2),
19152
+ width: typeof _optionalChain([init, 'optionalAccess', _640 => _640.width]) === "number" ? init.width : w,
19153
+ height: typeof _optionalChain([init, 'optionalAccess', _641 => _641.height]) === "number" ? init.height : h
19026
19154
  },
19027
19155
  name: "Ellipse",
19028
19156
  ...init
@@ -19083,18 +19211,18 @@ function layerEffectsPanel(layer) {
19083
19211
  if (!layer) return { ...empty, available: false, reason: "Select a layer to add a layer style." };
19084
19212
  if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have a layer style." };
19085
19213
  const fx = layer.effects;
19086
- const readOnly = Boolean(_optionalChain([layer, 'access', _641 => _641.locks, 'optionalAccess', _642 => _642.all]));
19214
+ const readOnly = Boolean(_optionalChain([layer, 'access', _642 => _642.locks, 'optionalAccess', _643 => _643.all]));
19087
19215
  return {
19088
19216
  available: true,
19089
19217
  readOnly,
19090
19218
  reason: readOnly ? "The layer is locked; unlock it to change its layer style." : void 0,
19091
- enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _643 => _643.enabled]), () => ( true)),
19092
- scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _644 => _644.scale]), () => ( 1)),
19093
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _645 => _645.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkUOGKSVRQcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19219
+ enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _644 => _644.enabled]), () => ( true)),
19220
+ scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _645 => _645.scale]), () => ( 1)),
19221
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _646 => _646.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkUOGKSVRQcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19094
19222
  };
19095
19223
  }
19096
19224
  function layerEffectsBadge(layer) {
19097
- if (!_optionalChain([layer, 'access', _646 => _646.effects, 'optionalAccess', _647 => _647.items, 'access', _648 => _648.length])) return null;
19225
+ if (!_optionalChain([layer, 'access', _647 => _647.effects, 'optionalAccess', _648 => _648.items, 'access', _649 => _649.length])) return null;
19098
19226
  return _chunkUOGKSVRQcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
19099
19227
  }
19100
19228
  var LAYER_EFFECT_MENU = _chunkUOGKSVRQcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkUOGKSVRQcjs.layerEffectLabel.call(void 0, kind) }));
@@ -19139,8 +19267,8 @@ function fillControls(f, allowPattern, patterns) {
19139
19267
  }
19140
19268
  function gradientControls(prefix, g) {
19141
19269
  return [
19142
- { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _649 => _649.stops, 'access', _650 => _650[0], 'optionalAccess', _651 => _651.color]), () => ( "#000000")) },
19143
- { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _652 => _652.stops, 'access', _653 => _653[g.stops.length - 1], 'optionalAccess', _654 => _654.color]), () => ( "#ffffff")) },
19270
+ { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _650 => _650.stops, 'access', _651 => _651[0], 'optionalAccess', _652 => _652.color]), () => ( "#000000")) },
19271
+ { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _653 => _653.stops, 'access', _654 => _654[g.stops.length - 1], 'optionalAccess', _655 => _655.color]), () => ( "#ffffff")) },
19144
19272
  { key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
19145
19273
  { key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
19146
19274
  { key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
@@ -19148,9 +19276,9 @@ function gradientControls(prefix, g) {
19148
19276
  { key: `${prefix}.align`, label: "Align with layer", type: "checkbox", value: g.align }
19149
19277
  ];
19150
19278
  }
19151
- var px = (key, label, value, max = 250) => ({ key, label, type: "range", min: 0, max, step: 1, value, unit: "px" });
19152
- var pct = (key, label, value, min = 0, max = 1) => ({ key, label, type: "range", min, max, step: 0.01, value, percent: true, unit: "%" });
19153
- var deg = (key, label, value, min = -180, max = 180) => ({ key, label, type: "range", min, max, step: 1, value, unit: "\xB0" });
19279
+ var px = (key2, label, value, max = 250) => ({ key: key2, label, type: "range", min: 0, max, step: 1, value, unit: "px" });
19280
+ var pct = (key2, label, value, min = 0, max = 1) => ({ key: key2, label, type: "range", min, max, step: 0.01, value, percent: true, unit: "%" });
19281
+ var deg = (key2, label, value, min = -180, max = 180) => ({ key: key2, label, type: "range", min, max, step: 1, value, unit: "\xB0" });
19154
19282
  function layerEffectControls(e, patterns = []) {
19155
19283
  const blended = e.kind === "bevel-emboss" ? [] : [
19156
19284
  { key: "blend", label: "Blend mode", type: "select", value: e.blend, options: BLENDS },
@@ -19232,19 +19360,19 @@ function layerEffectControls(e, patterns = []) {
19232
19360
  }
19233
19361
  function fillOfType(current, type, patterns) {
19234
19362
  if (type === "gradient") return { type: "gradient", gradient: _chunkUOGKSVRQcjs.defaultEffectGradient.call(void 0, ) };
19235
- if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _655 => _655[0], 'optionalAccess', _656 => _656.id]), () => ( "checker")), scale: 1 };
19363
+ if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _656 => _656[0], 'optionalAccess', _657 => _657.id]), () => ( "checker")), scale: 1 };
19236
19364
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
19237
19365
  }
19238
- function effectControlChange(effect, key, value, patterns = []) {
19239
- const [top, ...rest] = key.split(".");
19366
+ function effectControlChange(effect, key2, value, patterns = []) {
19367
+ const [top, ...rest] = key2.split(".");
19240
19368
  if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
19241
19369
  if (top === "patternId" && !rest.length) {
19242
- const name = _optionalChain([patternOptions, 'call', _657 => _657(patterns), 'access', _658 => _658.find, 'call', _659 => _659((o) => o.value === value), 'optionalAccess', _660 => _660.label]);
19370
+ const name = _optionalChain([patternOptions, 'call', _658 => _658(patterns), 'access', _659 => _659.find, 'call', _660 => _660((o) => o.value === value), 'optionalAccess', _661 => _661.label]);
19243
19371
  return name ? { patternId: value, name } : { patternId: value };
19244
19372
  }
19245
19373
  if (!rest.length) return { [top]: value };
19246
19374
  if (top === "fill" && rest[0] === "patternId") {
19247
- const name = _optionalChain([patternOptions, 'call', _661 => _661(patterns), 'access', _662 => _662.find, 'call', _663 => _663((o) => o.value === value), 'optionalAccess', _664 => _664.label]);
19375
+ const name = _optionalChain([patternOptions, 'call', _662 => _662(patterns), 'access', _663 => _663.find, 'call', _664 => _664((o) => o.value === value), 'optionalAccess', _665 => _665.label]);
19248
19376
  return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
19249
19377
  }
19250
19378
  return { [top]: setPath(getPath(effect, top), rest, value) };
@@ -19271,7 +19399,7 @@ function colorPanelView(controller) {
19271
19399
  profileName: profile.name,
19272
19400
  workingSpace: profile.builtin,
19273
19401
  mode: profile.mode,
19274
- cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _665 => _665.cmykProfile, 'optionalAccess', _666 => _666.name]), () => ( null)),
19402
+ cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _666 => _666.cmykProfile, 'optionalAccess', _667 => _667.name]), () => ( null)),
19275
19403
  proof: proof ? { id: _nullishCoalesce(proof.profile.builtin, () => ( null)), name: proof.profile.name, intent: proof.intent, simulatePaper: proof.simulatePaper, gamutWarning: proof.gamutWarning, bpc: proof.bpc } : null
19276
19404
  };
19277
19405
  }
@@ -19479,7 +19607,7 @@ var FreeTransformTool = (_class16 = class {
19479
19607
  __init146() {this.error = null}
19480
19608
  __init147() {this.lastResult = null}
19481
19609
  get active() {
19482
- return Boolean(_optionalChain([this, 'access', _667 => _667.sessionRef, 'optionalAccess', _668 => _668.isOpen]));
19610
+ return Boolean(_optionalChain([this, 'access', _668 => _668.sessionRef, 'optionalAccess', _669 => _669.isOpen]));
19483
19611
  }
19484
19612
  get session() {
19485
19613
  return this.active ? this.sessionRef : null;
@@ -19488,7 +19616,7 @@ var FreeTransformTool = (_class16 = class {
19488
19616
  return this.modeValue;
19489
19617
  }
19490
19618
  get interpolation() {
19491
- return _nullishCoalesce(_optionalChain([this, 'access', _669 => _669.sessionRef, 'optionalAccess', _670 => _670.interpolation]), () => ( "bicubic"));
19619
+ return _nullishCoalesce(_optionalChain([this, 'access', _670 => _670.sessionRef, 'optionalAccess', _671 => _671.interpolation]), () => ( "bicubic"));
19492
19620
  }
19493
19621
  /** Whether the open transform has changed anything yet (a commit would add an undo step). */
19494
19622
  get modified() {
@@ -19507,7 +19635,7 @@ var FreeTransformTool = (_class16 = class {
19507
19635
  };
19508
19636
  }
19509
19637
  changed() {
19510
- _optionalChain([this, 'access', _671 => _671.options, 'access', _672 => _672.onChange, 'optionalCall', _673 => _673()]);
19638
+ _optionalChain([this, 'access', _672 => _672.options, 'access', _673 => _673.onChange, 'optionalCall', _674 => _674()]);
19511
19639
  for (const l of this.listeners) l();
19512
19640
  }
19513
19641
  /** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
@@ -19900,7 +20028,7 @@ var FreeTransformTool = (_class16 = class {
19900
20028
  }
19901
20029
  /** Abandons the transform and restores everything. */
19902
20030
  cancel() {
19903
- _optionalChain([this, 'access', _674 => _674.sessionRef, 'optionalAccess', _675 => _675.cancel, 'call', _676 => _676()]);
20031
+ _optionalChain([this, 'access', _675 => _675.sessionRef, 'optionalAccess', _676 => _676.cancel, 'call', _677 => _677()]);
19904
20032
  this.sessionRef = null;
19905
20033
  this.corners = null;
19906
20034
  this.mesh = null;
@@ -19956,7 +20084,7 @@ function imageLayerAppliedEffects(layer) {
19956
20084
  const ref = (r) => ({ effect: r.effect, ...r.name ? { name: r.name } : {}, ...r.provider ? { provider: r.provider } : {} });
19957
20085
  if (layer.type === "pixel" && layer.generator) out.push({ id: "generator", ...ref(layer.generator), role: "effect layer", enabled: true, values: layer.generator.values, ...layer.generator.time ? { time: layer.generator.time } : {}, ...layer.generator.animate ? { animate: layer.generator.animate } : {} });
19958
20086
  if (layer.type === "smart")
19959
- (_nullishCoalesce(_optionalChain([layer, 'access', _677 => _677.smartFilters, 'optionalAccess', _678 => _678.filters]), () => ( []))).forEach((f, index) => {
20087
+ (_nullishCoalesce(_optionalChain([layer, 'access', _678 => _678.smartFilters, 'optionalAccess', _679 => _679.filters]), () => ( []))).forEach((f, index) => {
19960
20088
  if (f.kind === "effect") out.push({ id: f.id, ...ref(f), role: "smart filter", enabled: f.enabled && layer.smartFilters.enabled, opacity: f.opacity, blend: f.blend, values: f.values, index });
19961
20089
  });
19962
20090
  return out;
@@ -20088,7 +20216,9 @@ var IMAGE_TOOL_GROUPS = [
20088
20216
  { id: "focus", label: "Blur & Sharpen", tools: ["blur", "sharpen", "smudge"] },
20089
20217
  { id: "tone", label: "Dodge & Burn", tools: ["dodge", "burn", "sponge"] },
20090
20218
  { id: "shape", label: "Shape", tools: ["shape"] },
20219
+ { id: "pen", label: "Pen", tools: ["path-pen"] },
20091
20220
  { id: "type", label: "Type", tools: ["type"] },
20221
+ { id: "path-select", label: "Path Selection", tools: ["path-select", "direct-select"] },
20092
20222
  { id: "annotate", label: "Annotate", tools: ["pen", "line", "arrow", "rect", "circle"] }
20093
20223
  ];
20094
20224
  function imageToolGroup(tool) {
@@ -20099,7 +20229,10 @@ var OTHER_TOOL_LABELS = {
20099
20229
  crop: "Crop",
20100
20230
  shape: "Shape",
20101
20231
  type: "Type",
20102
- pen: "Pen",
20232
+ "path-pen": "Pen",
20233
+ "path-select": "Path Selection",
20234
+ "direct-select": "Direct Selection",
20235
+ pen: "Freehand",
20103
20236
  line: "Line",
20104
20237
  arrow: "Arrow",
20105
20238
  rect: "Rectangle",
@@ -20108,17 +20241,20 @@ var OTHER_TOOL_LABELS = {
20108
20241
  watermark: "Watermark"
20109
20242
  };
20110
20243
  function imageToolLabel(tool) {
20111
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _679 => _679.find, 'call', _680 => _680((t) => t.id === tool), 'optionalAccess', _681 => _681.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20244
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _680 => _680.find, 'call', _681 => _681((t) => t.id === tool), 'optionalAccess', _682 => _682.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20112
20245
  }
20113
20246
  var IMAGE_TOOL_SHORTCUTS = {
20114
20247
  ...Object.fromEntries(PAINT_TOOLS.filter((t) => t.shortcut).map((t) => [t.id, t.shortcut])),
20115
20248
  select: "M",
20116
20249
  crop: "C",
20117
20250
  shape: "U",
20118
- type: "T"
20251
+ type: "T",
20252
+ "path-pen": "P",
20253
+ "path-select": "A",
20254
+ "direct-select": "Shift+A"
20119
20255
  };
20120
- function imageToolForShortcut(key, shift = false) {
20121
- const shortcut = `${shift ? "Shift+" : ""}${key.toUpperCase()}`;
20256
+ function imageToolForShortcut(key2, shift = false) {
20257
+ const shortcut = `${shift ? "Shift+" : ""}${key2.toUpperCase()}`;
20122
20258
  for (const group of IMAGE_TOOL_GROUPS) {
20123
20259
  for (const tool of group.tools) if (IMAGE_TOOL_SHORTCUTS[tool] === shortcut) return tool;
20124
20260
  }
@@ -20175,6 +20311,422 @@ function createImageEditorDocument(controller, options = {}) {
20175
20311
  });
20176
20312
  }
20177
20313
 
20314
+ // src/image-editor/path-edit.ts
20315
+ var PATH_EDIT_TOOLS = ["path-select", "direct-select", "path-pen"];
20316
+ function isPathEditTool(tool) {
20317
+ return PATH_EDIT_TOOLS.includes(tool);
20318
+ }
20319
+ var key = (r) => `${r.component}:${r.subpath}:${r.anchor}`;
20320
+ var parseKey = (k) => {
20321
+ const [component, subpath, anchor] = k.split(":").map(Number);
20322
+ return { component, subpath, anchor };
20323
+ };
20324
+ var pt = (p) => ({ x: p.x, y: p.y });
20325
+ var cloneComponents = (cs) => cs.map((c) => ({ op: c.op, subpaths: c.subpaths.map((sp) => ({ anchors: sp.anchors.map(_chunkQAUIZPYIcjs.cloneAnchor), closed: sp.closed })), ...c.live ? { live: c.live } : {} }));
20326
+ var sameTarget = (a, b) => !!a && !!b && a.kind === b.kind && (a.kind === "path" ? a.id === b.id : a.layerId === b.layerId);
20327
+ var PathEditGesture = (_class17 = class {
20328
+ constructor(controller) {;_class17.prototype.__init149.call(this);_class17.prototype.__init150.call(this);_class17.prototype.__init151.call(this);_class17.prototype.__init152.call(this);_class17.prototype.__init153.call(this);_class17.prototype.__init154.call(this);_class17.prototype.__init155.call(this);
20329
+ this.controller = controller;
20330
+ }
20331
+
20332
+ /** Selected anchors, as `component:subpath:anchor` keys. */
20333
+ __init149() {this.selected = /* @__PURE__ */ new Set()}
20334
+ __init150() {this.target = null}
20335
+ __init151() {this.drag = null}
20336
+ /** The Pen's open subpath being drawn. */
20337
+ __init152() {this.drawing = null}
20338
+ __init153() {this.pointer = null}
20339
+ __init154() {this.scale = 1}
20340
+ __init155() {this.error = null}
20341
+ /** Screen pixels per document pixel (the viewport projection's scale). */
20342
+ setView(scale) {
20343
+ if (scale > 0 && Number.isFinite(scale)) this.scale = scale;
20344
+ }
20345
+ get active() {
20346
+ return this.drag !== null;
20347
+ }
20348
+ /** The anchors selected now (on the current target). */
20349
+ get selection() {
20350
+ return [...this.selected].map(parseKey);
20351
+ }
20352
+ /** True while the Pen has an open subpath it adds to. */
20353
+ get isDrawing() {
20354
+ return this.drawing !== null;
20355
+ }
20356
+ get tolerance() {
20357
+ return 6 / this.scale;
20358
+ }
20359
+ /** The target's components, or null (and the selection dropped) when the target changed or is gone. */
20360
+ components() {
20361
+ const target = this.controller.pathEditTarget();
20362
+ if (!sameTarget(target, this.target)) {
20363
+ this.target = target;
20364
+ this.selected.clear();
20365
+ this.drawing = null;
20366
+ }
20367
+ if (!target) return null;
20368
+ let cs;
20369
+ try {
20370
+ cs = this.controller.getPathEditComponents(target);
20371
+ } catch (e39) {
20372
+ return null;
20373
+ }
20374
+ for (const k of [...this.selected]) {
20375
+ const r = parseKey(k);
20376
+ if (!_optionalChain([cs, 'access', _683 => _683[r.component], 'optionalAccess', _684 => _684.subpaths, 'access', _685 => _685[r.subpath], 'optionalAccess', _686 => _686.anchors, 'access', _687 => _687[r.anchor]])) this.selected.delete(k);
20377
+ }
20378
+ const d = this.drawing;
20379
+ if (d && (!_optionalChain([cs, 'access', _688 => _688[d.component], 'optionalAccess', _689 => _689.subpaths, 'access', _690 => _690[d.subpath]]) || cs[d.component].subpaths[d.subpath].closed)) this.drawing = null;
20380
+ return cs;
20381
+ }
20382
+ anchorAt(cs, p) {
20383
+ const tol = this.tolerance;
20384
+ let best = null;
20385
+ let bestD = tol;
20386
+ cs.forEach(
20387
+ (c, ci) => c.subpaths.forEach(
20388
+ (sp, si) => sp.anchors.forEach((a, ai) => {
20389
+ const d = Math.hypot(a.x - p.x, a.y - p.y);
20390
+ if (d <= bestD) {
20391
+ bestD = d;
20392
+ best = { component: ci, subpath: si, anchor: ai };
20393
+ }
20394
+ })
20395
+ )
20396
+ );
20397
+ return best;
20398
+ }
20399
+ /** A handle of a selected anchor near `p`. */
20400
+ handleAt(cs, p) {
20401
+ const tol = this.tolerance;
20402
+ for (const r of this.selection) {
20403
+ const a = cs[r.component].subpaths[r.subpath].anchors[r.anchor];
20404
+ for (const side of ["out", "in"]) {
20405
+ const h = a[side];
20406
+ if (h && Math.hypot(h.x - p.x, h.y - p.y) <= tol) return { ref: r, side };
20407
+ }
20408
+ }
20409
+ return null;
20410
+ }
20411
+ /** The segment near `p`: its first anchor (as `anchor`) and the parameter on it. */
20412
+ segmentAt(cs, p) {
20413
+ let best = null;
20414
+ let bestD = this.tolerance;
20415
+ cs.forEach(
20416
+ (c, ci) => c.subpaths.forEach((sp, si) => {
20417
+ for (let i = 0; i < _chunkQAUIZPYIcjs.subpathSegmentCount.call(void 0, sp); i++) {
20418
+ const { t, distance } = _chunkGF2RBSDMcjs.segmentNearest.call(void 0, _chunkQAUIZPYIcjs.subpathSegment.call(void 0, sp, i), [p.x, p.y]);
20419
+ if (distance <= bestD) {
20420
+ bestD = distance;
20421
+ best = { ref: { component: ci, subpath: si, anchor: i }, t };
20422
+ }
20423
+ }
20424
+ })
20425
+ );
20426
+ return best;
20427
+ }
20428
+ /** The component under `p`: on its outline, or inside its fill. */
20429
+ componentAt(cs, p) {
20430
+ const seg = _nullishCoalesce(this.segmentAt(cs, p), () => ( (this.anchorAt(cs, p) ? { ref: this.anchorAt(cs, p) } : null)));
20431
+ if (seg) return seg.ref.component;
20432
+ for (let i = cs.length - 1; i >= 0; i--) {
20433
+ const closed = cs[i].subpaths.filter((sp) => sp.anchors.length > 2);
20434
+ if (closed.length && _chunkGF2RBSDMcjs.pointInBezierPath.call(void 0, _chunkQAUIZPYIcjs.subpathsToBezier.call(void 0, closed), [p.x, p.y])) return i;
20435
+ }
20436
+ return null;
20437
+ }
20438
+ selectComponent(cs, ci) {
20439
+ cs[ci].subpaths.forEach((sp, si) => sp.anchors.forEach((_, ai) => this.selected.add(key({ component: ci, subpath: si, anchor: ai }))));
20440
+ }
20441
+ commit(cs, record) {
20442
+ if (!this.target) return false;
20443
+ try {
20444
+ this.controller.setPathEditComponents(this.target, cs, record);
20445
+ return true;
20446
+ } catch (e) {
20447
+ this.error = e instanceof Error ? e.message : String(e);
20448
+ return false;
20449
+ }
20450
+ }
20451
+ down(p, tool, mods = {}) {
20452
+ this.error = null;
20453
+ this.pointer = pt(p);
20454
+ const cs = this.components();
20455
+ if (tool === "path-pen") return this.penDown(cs, p, mods);
20456
+ if (!cs) {
20457
+ this.error = "There is no path to edit: pick a path in the Paths panel, a shape layer, or a layer with a vector mask (or draw one with the Pen).";
20458
+ return;
20459
+ }
20460
+ if (tool === "path-select") {
20461
+ const ci = this.componentAt(cs, p);
20462
+ if (ci === null) {
20463
+ this.drag = { kind: "marquee", start: pt(p), end: pt(p), keep: mods.shift ? new Set(this.selected) : /* @__PURE__ */ new Set() };
20464
+ if (!mods.shift) this.selected.clear();
20465
+ return;
20466
+ }
20467
+ const ref = { component: ci, subpath: 0, anchor: 0 };
20468
+ if (!mods.shift && !this.selected.has(key(ref))) this.selected.clear();
20469
+ this.selectComponent(cs, ci);
20470
+ this.drag = { kind: "anchors", start: pt(p), base: cloneComponents(cs), moved: false };
20471
+ return;
20472
+ }
20473
+ const handle = this.handleAt(cs, p);
20474
+ if (handle) {
20475
+ this.drag = { kind: "handle", ...handle, base: cloneComponents(cs), breakHandles: !!mods.alt, moved: false };
20476
+ return;
20477
+ }
20478
+ const anchor = this.anchorAt(cs, p);
20479
+ if (anchor) {
20480
+ if (mods.alt) return this.convert(cs, anchor);
20481
+ const k = key(anchor);
20482
+ if (mods.shift) {
20483
+ if (this.selected.has(k)) this.selected.delete(k);
20484
+ else this.selected.add(k);
20485
+ } else if (!this.selected.has(k)) {
20486
+ this.selected.clear();
20487
+ this.selected.add(k);
20488
+ }
20489
+ this.drag = { kind: "anchors", start: pt(p), base: cloneComponents(cs), moved: false };
20490
+ return;
20491
+ }
20492
+ const seg = this.segmentAt(cs, p);
20493
+ if (seg) {
20494
+ if (!mods.shift) this.selected.clear();
20495
+ this.drag = { kind: "segment", ...seg, base: cloneComponents(cs), moved: false };
20496
+ return;
20497
+ }
20498
+ this.drag = { kind: "marquee", start: pt(p), end: pt(p), keep: mods.shift ? new Set(this.selected) : /* @__PURE__ */ new Set() };
20499
+ if (!mods.shift) this.selected.clear();
20500
+ }
20501
+ /** Alt-click: a corner anchor becomes smooth, a smooth one a corner (one undo step). */
20502
+ convert(cs, r) {
20503
+ const next = cloneComponents(cs);
20504
+ const c = next[r.component];
20505
+ const sp = c.subpaths[r.subpath];
20506
+ const a = sp.anchors[r.anchor];
20507
+ const type = _chunkQAUIZPYIcjs.inferAnchorType.call(void 0, a) === "corner" && !a.in && !a.out ? "smooth" : "corner";
20508
+ c.subpaths[r.subpath] = _chunkQAUIZPYIcjs.convertAnchor.call(void 0, sp, r.anchor, type);
20509
+ delete c.live;
20510
+ this.selected.clear();
20511
+ this.selected.add(key(r));
20512
+ this.commit(next, true);
20513
+ }
20514
+ penDown(cs, p, mods) {
20515
+ const d = this.drawing;
20516
+ if (cs && d) {
20517
+ const next = cloneComponents(cs);
20518
+ const c = next[d.component];
20519
+ const sp = c.subpaths[d.subpath];
20520
+ const first = sp.anchors[0];
20521
+ delete c.live;
20522
+ if (sp.anchors.length > 1 && Math.hypot(first.x - p.x, first.y - p.y) <= this.tolerance) {
20523
+ sp.closed = true;
20524
+ this.drawing = null;
20525
+ const ref3 = { component: d.component, subpath: d.subpath, anchor: 0 };
20526
+ if (this.commit(next, true)) this.drag = { kind: "pen", ref: ref3, base: next };
20527
+ return;
20528
+ }
20529
+ sp.anchors.push({ x: p.x, y: p.y });
20530
+ const ref2 = { component: d.component, subpath: d.subpath, anchor: sp.anchors.length - 1 };
20531
+ this.selected = /* @__PURE__ */ new Set([key(ref2)]);
20532
+ if (this.commit(next, true)) this.drag = { kind: "pen", ref: ref2, base: next };
20533
+ return;
20534
+ }
20535
+ if (cs) {
20536
+ const anchor = this.anchorAt(cs, p);
20537
+ if (anchor && mods.alt) return this.convert(cs, anchor);
20538
+ if (anchor) {
20539
+ const next = cloneComponents(cs);
20540
+ const c = next[anchor.component];
20541
+ const sp = c.subpaths[anchor.subpath];
20542
+ delete c.live;
20543
+ c.subpaths[anchor.subpath] = sp.anchors.length > 2 ? _chunkLCCMOWR7cjs.removeAnchorsKeepingShape.call(void 0, sp, [anchor.anchor]) : _chunkQAUIZPYIcjs.removeAnchors.call(void 0, sp, [anchor.anchor]);
20544
+ this.selected.clear();
20545
+ this.commit(prune(next), true);
20546
+ return;
20547
+ }
20548
+ const seg = this.segmentAt(cs, p);
20549
+ if (seg) {
20550
+ const next = cloneComponents(cs);
20551
+ const c = next[seg.ref.component];
20552
+ const { subpath, index } = _chunkQAUIZPYIcjs.insertAnchor.call(void 0, c.subpaths[seg.ref.subpath], seg.ref.anchor, seg.t);
20553
+ c.subpaths[seg.ref.subpath] = subpath;
20554
+ delete c.live;
20555
+ this.selected = /* @__PURE__ */ new Set([key({ ...seg.ref, anchor: index })]);
20556
+ this.commit(next, true);
20557
+ return;
20558
+ }
20559
+ }
20560
+ const start = { anchors: [{ x: p.x, y: p.y }], closed: false };
20561
+ if (!this.target || !cs) {
20562
+ try {
20563
+ const path = this.controller.startWorkPath([{ op: "combine", subpaths: [start] }]);
20564
+ this.target = { kind: "path", id: path.id };
20565
+ } catch (e) {
20566
+ this.error = e instanceof Error ? e.message : String(e);
20567
+ return;
20568
+ }
20569
+ this.drawing = { component: 0, subpath: 0 };
20570
+ } else {
20571
+ const next = cloneComponents(cs);
20572
+ if (!next.length) next.push({ op: "combine", subpaths: [] });
20573
+ const ci = next.length - 1;
20574
+ delete next[ci].live;
20575
+ next[ci].subpaths.push(start);
20576
+ if (!this.commit(next, true)) return;
20577
+ this.drawing = { component: ci, subpath: next[ci].subpaths.length - 1 };
20578
+ }
20579
+ const ref = { component: this.drawing.component, subpath: this.drawing.subpath, anchor: 0 };
20580
+ this.selected = /* @__PURE__ */ new Set([key(ref)]);
20581
+ this.drag = { kind: "pen", ref, base: cloneComponents(this.controller.getPathEditComponents(this.target)) };
20582
+ }
20583
+ move(p, mods = {}) {
20584
+ this.pointer = pt(p);
20585
+ const g = this.drag;
20586
+ if (!g) return;
20587
+ if (g.kind === "marquee") {
20588
+ g.end = pt(p);
20589
+ const box = rect(g.start, g.end);
20590
+ const cs = this.target ? this.controller.getPathEditComponents(this.target) : [];
20591
+ this.selected = new Set(g.keep);
20592
+ cs.forEach(
20593
+ (c, ci) => c.subpaths.forEach(
20594
+ (sp, si) => sp.anchors.forEach((a, ai) => {
20595
+ if (a.x >= box.x && a.x <= box.x + box.width && a.y >= box.y && a.y <= box.y + box.height) this.selected.add(key({ component: ci, subpath: si, anchor: ai }));
20596
+ })
20597
+ )
20598
+ );
20599
+ return;
20600
+ }
20601
+ const next = cloneComponents(g.base);
20602
+ if (g.kind === "anchors") {
20603
+ let dx = p.x - g.start.x;
20604
+ let dy = p.y - g.start.y;
20605
+ if (!g.moved && Math.hypot(dx, dy) < 1 / this.scale) return;
20606
+ if (mods.shift) {
20607
+ if (Math.abs(dx) > Math.abs(dy)) dy = 0;
20608
+ else dx = 0;
20609
+ }
20610
+ for (const r of this.selection) {
20611
+ const c = next[r.component];
20612
+ c.subpaths[r.subpath].anchors[r.anchor] = _chunkQAUIZPYIcjs.translateAnchor.call(void 0, c.subpaths[r.subpath].anchors[r.anchor], dx, dy);
20613
+ delete c.live;
20614
+ }
20615
+ } else if (g.kind === "handle") {
20616
+ const c = next[g.ref.component];
20617
+ const a = c.subpaths[g.ref.subpath].anchors[g.ref.anchor];
20618
+ const typed = { ...a, type: _nullishCoalesce(a.type, () => ( _chunkQAUIZPYIcjs.inferAnchorType.call(void 0, a))) };
20619
+ const moved = _chunkQAUIZPYIcjs.moveAnchorHandle.call(void 0, typed, g.side, p, g.breakHandles);
20620
+ delete moved.type;
20621
+ c.subpaths[g.ref.subpath].anchors[g.ref.anchor] = moved;
20622
+ delete c.live;
20623
+ } else if (g.kind === "segment") {
20624
+ const c = next[g.ref.component];
20625
+ c.subpaths[g.ref.subpath] = _chunkLCCMOWR7cjs.bendSegment.call(void 0, c.subpaths[g.ref.subpath], g.ref.anchor, g.t, p);
20626
+ delete c.live;
20627
+ } else {
20628
+ const c = next[g.ref.component];
20629
+ const a = c.subpaths[g.ref.subpath].anchors[g.ref.anchor];
20630
+ if (Math.hypot(p.x - a.x, p.y - a.y) < 1 / this.scale) return;
20631
+ a.out = { x: p.x, y: p.y };
20632
+ a.in = { x: 2 * a.x - p.x, y: 2 * a.y - p.y };
20633
+ delete c.live;
20634
+ this.commit(next, false);
20635
+ return;
20636
+ }
20637
+ if (this.commit(next, !g.moved)) g.moved = true;
20638
+ }
20639
+ /** The pointer moving with no button down (the Pen's preview of its next segment). */
20640
+ hover(p) {
20641
+ this.pointer = pt(p);
20642
+ }
20643
+ up() {
20644
+ this.drag = null;
20645
+ }
20646
+ /** Ends the Pen's subpath (left open). */
20647
+ finish() {
20648
+ this.drawing = null;
20649
+ this.drag = null;
20650
+ }
20651
+ cancel() {
20652
+ this.drag = null;
20653
+ this.drawing = null;
20654
+ this.selected.clear();
20655
+ }
20656
+ /**
20657
+ * Keys: Delete / Backspace remove the selected anchors (one undo step), Enter and Escape end the
20658
+ * Pen's subpath, Escape also deselects. Returns true when the key was handled.
20659
+ */
20660
+ key(k) {
20661
+ if (k === "Enter" && this.drawing) {
20662
+ this.finish();
20663
+ return true;
20664
+ }
20665
+ if (k === "Escape") {
20666
+ if (!this.drawing && !this.selected.size) return false;
20667
+ this.drawing = null;
20668
+ this.selected.clear();
20669
+ return true;
20670
+ }
20671
+ if ((k === "Delete" || k === "Backspace") && this.selected.size && !this.drawing) {
20672
+ const cs = this.components();
20673
+ if (!cs) return false;
20674
+ const next = cloneComponents(cs);
20675
+ const bySub = /* @__PURE__ */ new Map();
20676
+ for (const r of this.selection) {
20677
+ const sk = `${r.component}:${r.subpath}`;
20678
+ bySub.set(sk, [..._nullishCoalesce(bySub.get(sk), () => ( [])), r.anchor]);
20679
+ }
20680
+ for (const [sk, indices] of bySub) {
20681
+ const [ci, si] = sk.split(":").map(Number);
20682
+ next[ci].subpaths[si] = _chunkQAUIZPYIcjs.removeAnchors.call(void 0, next[ci].subpaths[si], indices);
20683
+ delete next[ci].live;
20684
+ }
20685
+ this.selected.clear();
20686
+ this.commit(prune(next), true);
20687
+ return true;
20688
+ }
20689
+ return false;
20690
+ }
20691
+ /** What to draw (`RenderOptions.pathEdit`) for `tool`, or null when there is no target. */
20692
+ overlay(tool) {
20693
+ const cs = this.components();
20694
+ if (!cs) return null;
20695
+ const curves = [];
20696
+ const anchors = [];
20697
+ const handles = [];
20698
+ const selectedComponents = new Set(this.selection.map((r) => r.component));
20699
+ cs.forEach(
20700
+ (c, ci) => c.subpaths.forEach((sp, si) => {
20701
+ for (let i = 0; i < _chunkQAUIZPYIcjs.subpathSegmentCount.call(void 0, sp); i++) curves.push(_chunkQAUIZPYIcjs.subpathSegment.call(void 0, sp, i).map(([x, y]) => ({ x, y })));
20702
+ sp.anchors.forEach((a, ai) => {
20703
+ const selected = this.selected.has(key({ component: ci, subpath: si, anchor: ai }));
20704
+ if (tool === "path-select" && !selectedComponents.has(ci)) return;
20705
+ anchors.push({ point: pt(a), selected });
20706
+ if (!selected || tool === "path-select") return;
20707
+ for (const side of ["in", "out"]) if (a[side]) handles.push({ point: pt(a[side]), anchor: pt(a) });
20708
+ });
20709
+ })
20710
+ );
20711
+ let preview = null;
20712
+ const d = this.drawing;
20713
+ if (tool === "path-pen" && d && this.pointer && !this.drag) {
20714
+ const sp = _optionalChain([cs, 'access', _691 => _691[d.component], 'optionalAccess', _692 => _692.subpaths, 'access', _693 => _693[d.subpath]]);
20715
+ const last = _optionalChain([sp, 'optionalAccess', _694 => _694.anchors, 'access', _695 => _695[sp.anchors.length - 1]]);
20716
+ if (last) preview = last.out ? [pt(last), pt(last.out), this.pointer, this.pointer] : [pt(last), this.pointer];
20717
+ }
20718
+ const marquee = _optionalChain([this, 'access', _696 => _696.drag, 'optionalAccess', _697 => _697.kind]) === "marquee" ? rect(this.drag.start, this.drag.end) : null;
20719
+ return { curves, anchors, handles, marquee, preview };
20720
+ }
20721
+ }, _class17);
20722
+ function rect(a, b) {
20723
+ return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) };
20724
+ }
20725
+ function prune(cs) {
20726
+ for (const c of cs) c.subpaths = c.subpaths.filter((sp) => sp.anchors.length);
20727
+ return cs.filter((c) => c.subpaths.length);
20728
+ }
20729
+
20178
20730
  // src/image-editor/content-aware-fill-session.ts
20179
20731
  var CONTENT_AWARE_FILL_TOOLS = [
20180
20732
  { id: "sampling-brush", label: "Sampling Brush", key: "b" },
@@ -20197,27 +20749,27 @@ var DEFAULT_CONTENT_AWARE_FILL_SETTINGS = {
20197
20749
  output: "new-layer",
20198
20750
  livePreview: true
20199
20751
  };
20200
- var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20201
- constructor(controller) {;_class17.prototype.__init149.call(this);_class17.prototype.__init150.call(this);_class17.prototype.__init151.call(this);_class17.prototype.__init152.call(this);_class17.prototype.__init153.call(this);_class17.prototype.__init154.call(this);_class17.prototype.__init155.call(this);_class17.prototype.__init156.call(this);_class17.prototype.__init157.call(this);_class17.prototype.__init158.call(this);_class17.prototype.__init159.call(this);_class17.prototype.__init160.call(this);_class17.prototype.__init161.call(this);_class17.prototype.__init162.call(this);_class17.prototype.__init163.call(this);
20752
+ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
20753
+ constructor(controller) {;_class18.prototype.__init156.call(this);_class18.prototype.__init157.call(this);_class18.prototype.__init158.call(this);_class18.prototype.__init159.call(this);_class18.prototype.__init160.call(this);_class18.prototype.__init161.call(this);_class18.prototype.__init162.call(this);_class18.prototype.__init163.call(this);_class18.prototype.__init164.call(this);_class18.prototype.__init165.call(this);_class18.prototype.__init166.call(this);_class18.prototype.__init167.call(this);_class18.prototype.__init168.call(this);_class18.prototype.__init169.call(this);_class18.prototype.__init170.call(this);
20202
20754
  this.controller = controller;
20203
20755
  }
20204
20756
 
20205
- __init149() {this.settingsValue = { ...DEFAULT_CONTENT_AWARE_FILL_SETTINGS }}
20206
- __init150() {this.plan = null}
20757
+ __init156() {this.settingsValue = { ...DEFAULT_CONTENT_AWARE_FILL_SETTINGS }}
20758
+ __init157() {this.plan = null}
20207
20759
  /** The source view's window (document pixels): the selection with room around it to sample. */
20208
- __init151() {this.win = null}
20209
- __init152() {this.before = null}
20210
- __init153() {this.hole = null}
20760
+ __init158() {this.win = null}
20761
+ __init159() {this.before = null}
20762
+ __init160() {this.hole = null}
20211
20763
  /** 1 where the fill may copy from, per window pixel. */
20212
- __init154() {this.area = null}
20213
- __init155() {this.after = null}
20214
- __init156() {this.lastPoint = null}
20215
- __init157() {this.listeners = /* @__PURE__ */ new Set()}
20216
- __init158() {this.dirty = false}
20764
+ __init161() {this.area = null}
20765
+ __init162() {this.after = null}
20766
+ __init163() {this.lastPoint = null}
20767
+ __init164() {this.listeners = /* @__PURE__ */ new Set()}
20768
+ __init165() {this.dirty = false}
20217
20769
  /** Why the workspace can't fill (nothing selected, not a pixel layer), for the UI. */
20218
- __init159() {this.error = null}
20219
- __init160() {this.computing = false}
20220
- __init161() {this.revision = 0}
20770
+ __init166() {this.error = null}
20771
+ __init167() {this.computing = false}
20772
+ __init168() {this.revision = 0}
20221
20773
  get settings() {
20222
20774
  return this.settingsValue;
20223
20775
  }
@@ -20236,7 +20788,7 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20236
20788
  /** Images up to this many pixels show (and can be sampled) whole in the workspace. */
20237
20789
  static __initStatic() {this.WHOLE_IMAGE_PIXELS = 4e6}
20238
20790
  /** Room around the selection the window holds, in px each way. */
20239
- __init162() {this.margin = 0}
20791
+ __init169() {this.margin = 0}
20240
20792
  /**
20241
20793
  * Reads the layer and makes the first preview. The window is the whole image up to
20242
20794
  * {@link WHOLE_IMAGE_PIXELS}; on a larger one it holds the selection and room around it (twice
@@ -20245,8 +20797,8 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20245
20797
  async open() {
20246
20798
  try {
20247
20799
  const { width, height } = this.controller.getState().imageDimensions;
20248
- const b = _optionalChain([this, 'access', _682 => _682.controller, 'access', _683 => _683.getSelection, 'call', _684 => _684(), 'optionalAccess', _685 => _685.bounds]);
20249
- this.margin = width * height <= _ContentAwareFillSession.WHOLE_IMAGE_PIXELS ? Math.max(width, height) : Math.max(256, 2 * Math.max(_nullishCoalesce(_optionalChain([b, 'optionalAccess', _686 => _686.width]), () => ( 0)), _nullishCoalesce(_optionalChain([b, 'optionalAccess', _687 => _687.height]), () => ( 0))));
20800
+ const b = _optionalChain([this, 'access', _698 => _698.controller, 'access', _699 => _699.getSelection, 'call', _700 => _700(), 'optionalAccess', _701 => _701.bounds]);
20801
+ this.margin = width * height <= _ContentAwareFillSession.WHOLE_IMAGE_PIXELS ? Math.max(width, height) : Math.max(256, 2 * Math.max(_nullishCoalesce(_optionalChain([b, 'optionalAccess', _702 => _702.width]), () => ( 0)), _nullishCoalesce(_optionalChain([b, 'optionalAccess', _703 => _703.height]), () => ( 0))));
20250
20802
  this.plan = this.controller.prepareContentAwareFill({ sampleRadius: this.margin });
20251
20803
  } catch (err) {
20252
20804
  this.error = err instanceof Error ? err.message : String(err);
@@ -20378,7 +20930,7 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20378
20930
  this.emit();
20379
20931
  return true;
20380
20932
  }
20381
- __init163() {this.strokeAdds = true}
20933
+ __init170() {this.strokeAdds = true}
20382
20934
  move(point) {
20383
20935
  if (!this.lastPoint) return;
20384
20936
  this.paint(this.lastPoint, point, this.strokeAdds);
@@ -20404,7 +20956,7 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20404
20956
  this.dirty = false;
20405
20957
  try {
20406
20958
  const area = this.samplingMask();
20407
- if (!_optionalChain([area, 'optionalAccess', _688 => _688.bounds])) throw new Error("The sampling area is empty; paint where the fill may copy from.");
20959
+ if (!_optionalChain([area, 'optionalAccess', _704 => _704.bounds])) throw new Error("The sampling area is empty; paint where the fill may copy from.");
20408
20960
  const { plan, after } = await this.controller.previewContentAwareFill({ layerId: this.plan.layerId, samplingArea: area, seed: this.settingsValue.seed });
20409
20961
  const win = this.win;
20410
20962
  const out = Uint8ClampedArray.from(this.before);
@@ -20466,8 +21018,8 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20466
21018
  /**
20467
21019
  * Keys: B, H, Z for the tools, [ and ] for the brush size. Returns true when the key was used.
20468
21020
  */
20469
- handleKey(key) {
20470
- const k = key.toLowerCase();
21021
+ handleKey(key2) {
21022
+ const k = key2.toLowerCase();
20471
21023
  const tool = CONTENT_AWARE_FILL_TOOLS.find((t) => t.key === k);
20472
21024
  if (tool) {
20473
21025
  this.update({ tool: tool.id });
@@ -20483,10 +21035,13 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
20483
21035
  /** OK: fills with this sampling area, seed and output as one undo step. */
20484
21036
  async commit(options = {}) {
20485
21037
  const area = this.samplingMask();
20486
- if (!this.plan || !_optionalChain([area, 'optionalAccess', _689 => _689.bounds])) throw new Error(_nullishCoalesce(this.error, () => ( "The sampling area is empty; paint where the fill may copy from.")));
21038
+ if (!this.plan || !_optionalChain([area, 'optionalAccess', _705 => _705.bounds])) throw new Error(_nullishCoalesce(this.error, () => ( "The sampling area is empty; paint where the fill may copy from.")));
20487
21039
  return this.controller.contentAwareFillAsync({ layerId: this.plan.layerId, samplingArea: area, seed: this.settingsValue.seed, output: this.settingsValue.output, signal: options.signal });
20488
21040
  }
20489
- }, _class17.__initStatic(), _class17);
21041
+ }, _class18.__initStatic(), _class18);
21042
+
21043
+
21044
+
20490
21045
 
20491
21046
 
20492
21047
 
@@ -21585,4 +22140,4 @@ var ContentAwareFillSession = (_class17 = class _ContentAwareFillSession {
21585
22140
 
21586
22141
 
21587
22142
 
21588
- exports.ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkH65IBXFIcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkH65IBXFIcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkH65IBXFIcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkH65IBXFIcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkH65IBXFIcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkH65IBXFIcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkH65IBXFIcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkKWNMBMKGcjs.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 = _chunkPQ3H2AANcjs.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.CONTENT_AWARE_FILL_SAMPLING = CONTENT_AWARE_FILL_SAMPLING; exports.CONTENT_AWARE_FILL_TOOLS = CONTENT_AWARE_FILL_TOOLS; exports.ColorGmm = _chunkL52VMQZScjs.ColorGmm; exports.ContentAwareFillSession = ContentAwareFillSession; exports.CoverageMap = _chunkPQ3H2AANcjs.CoverageMap; exports.D50 = _chunkH65IBXFIcjs.D50; exports.D65 = _chunkH65IBXFIcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQAUIZPYIcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkPQ3H2AANcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkPQ3H2AANcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_CONTENT_AWARE_FILL_SETTINGS = DEFAULT_CONTENT_AWARE_FILL_SETTINGS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkUOGKSVRQcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkH65IBXFIcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkPQ3H2AANcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = _chunkL52VMQZScjs.DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYF3YZZ6Gcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkPQ3H2AANcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkKWNMBMKGcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkH65IBXFIcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkKWNMBMKGcjs.DRY_EPS; exports.DabWalker = _chunkPQ3H2AANcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkQYLWG22Ncjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkKWNMBMKGcjs.EX; exports.EY = _chunkKWNMBMKGcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkKWNMBMKGcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkKWNMBMKGcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkKWNMBMKGcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkKWNMBMKGcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkKWNMBMKGcjs.FLAG_TOP; exports.FLAG_WET = _chunkKWNMBMKGcjs.FLAG_WET; exports.FLAT = _chunkKWNMBMKGcjs.FLAT; exports.FREE_INTERVAL = _chunkKWNMBMKGcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkH65IBXFIcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = _chunkL52VMQZScjs.GAMMA; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = _chunkL52VMQZScjs.GUIDED_FILTER_EPS; exports.GridGraph = _chunkL52VMQZScjs.GridGraph; exports.HIDE = _chunkKWNMBMKGcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkH65IBXFIcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYF3YZZ6Gcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkH65IBXFIcjs.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.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkUOGKSVRQcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkH65IBXFIcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkH65IBXFIcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkUOGKSVRQcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkH65IBXFIcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkH65IBXFIcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkH65IBXFIcjs.LUMA_709; exports.LayerCompositor = _chunkH65IBXFIcjs.LayerCompositor; exports.LayerEffectError = _chunkUOGKSVRQcjs.LayerEffectError; exports.LayerOperationError = _chunkH65IBXFIcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkKWNMBMKGcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkH65IBXFIcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkUOGKSVRQcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkH65IBXFIcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkKWNMBMKGcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkUOGKSVRQcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkKWNMBMKGcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkKWNMBMKGcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkH65IBXFIcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkH65IBXFIcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPQ3H2AANcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPQ3H2AANcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPQ3H2AANcjs.MIXING_MODELS; exports.MixerStroke = _chunkPQ3H2AANcjs.MixerStroke; exports.OPP = _chunkKWNMBMKGcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkKWNMBMKGcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkH65IBXFIcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkKWNMBMKGcjs.PARAM; exports.PARAM_FLOATS = _chunkKWNMBMKGcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkH65IBXFIcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkOLNIPTB3cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkKWNMBMKGcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkKWNMBMKGcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkOLNIPTB3cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkKWNMBMKGcjs.PLANE; exports.PLANE_BYTES = _chunkKWNMBMKGcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkH65IBXFIcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkKWNMBMKGcjs.P_D0; exports.P_EDGE = _chunkKWNMBMKGcjs.P_EDGE; exports.P_FX = _chunkKWNMBMKGcjs.P_FX; exports.P_FY = _chunkKWNMBMKGcjs.P_FY; exports.P_H = _chunkKWNMBMKGcjs.P_H; exports.P_P0 = _chunkKWNMBMKGcjs.P_P0; exports.P_RHO = _chunkKWNMBMKGcjs.P_RHO; exports.P_SW = _chunkKWNMBMKGcjs.P_SW; exports.P_UX = _chunkKWNMBMKGcjs.P_UX; exports.P_UY = _chunkKWNMBMKGcjs.P_UY; exports.PaintExchange = _chunkPQ3H2AANcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.PatternPlacement = _chunkUOGKSVRQcjs.PatternPlacement; exports.PatternTile = _chunkUOGKSVRQcjs.PatternTile; exports.PsdError = _chunkH65IBXFIcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = _chunkL52VMQZScjs.REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYF3YZZ6Gcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYF3YZZ6Gcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYF3YZZ6Gcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkQYLWG22Ncjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkQYLWG22Ncjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SELECT_AND_MASK_TOOLS = SELECT_AND_MASK_TOOLS; exports.SELECT_AND_MASK_VIEWS = SELECT_AND_MASK_VIEWS; exports.SET_PLANES = _chunkKWNMBMKGcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkH65IBXFIcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkH65IBXFIcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkKWNMBMKGcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkKWNMBMKGcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkKWNMBMKGcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkH65IBXFIcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYF3YZZ6Gcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkKWNMBMKGcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.SelectionWorkerClient = _chunkL52VMQZScjs.SelectionWorkerClient; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkPQ3H2AANcjs.SmudgeTip; exports.StrokeCoverage = _chunkPQ3H2AANcjs.StrokeCoverage; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkH65IBXFIcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkH65IBXFIcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkH65IBXFIcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkH65IBXFIcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkH65IBXFIcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkPQ3H2AANcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkH65IBXFIcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYF3YZZ6Gcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkH65IBXFIcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkPQ3H2AANcjs.TileMedium; exports.TilePixelSource = _chunkYF3YZZ6Gcjs.TilePixelSource; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkUOGKSVRQcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYF3YZZ6Gcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = _chunkL52VMQZScjs.UNITS; exports.U_MAX = _chunkKWNMBMKGcjs.U_MAX; exports.VIBRANCE_GREY = _chunkH65IBXFIcjs.VIBRANCE_GREY; exports.W9 = _chunkKWNMBMKGcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQAUIZPYIcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQAUIZPYIcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkKWNMBMKGcjs.WET_TILE; exports.WGSL_HALO = _chunkKWNMBMKGcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkKWNMBMKGcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkKWNMBMKGcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_PATH_NAME = WORK_PATH_NAME; exports.WORK_SIZE = _chunkL52VMQZScjs.WORK_SIZE; exports.WetGpuEngine = _chunkKWNMBMKGcjs.WetGpuEngine; exports.WetMedium = _chunkKWNMBMKGcjs.WetMedium; exports.WetWorkerPool = _chunkKWNMBMKGcjs.WetWorkerPool; exports.WetWorld = _chunkKWNMBMKGcjs.WetWorld; exports.WetWorldError = _chunkKWNMBMKGcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkH65IBXFIcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkH65IBXFIcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkH65IBXFIcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkH65IBXFIcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkH65IBXFIcjs.activeSmartFilters; exports.addLayerEffect = _chunkH65IBXFIcjs.addLayerEffect; exports.addLayerFilter = _chunkH65IBXFIcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.addSmartFilter = _chunkH65IBXFIcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkH65IBXFIcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkH65IBXFIcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkH65IBXFIcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkH65IBXFIcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkH65IBXFIcjs.anchorPoint; exports.annotationBlend = _chunkH65IBXFIcjs.annotationBlend; exports.annotationLayerFor = _chunkH65IBXFIcjs.annotationLayerFor; exports.annotationLayerName = _chunkH65IBXFIcjs.annotationLayerName; exports.annotationOfLayer = _chunkH65IBXFIcjs.annotationOfLayer; exports.annotationOfShape = _chunkH65IBXFIcjs.annotationOfShape; exports.annotationOfType = _chunkH65IBXFIcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkH65IBXFIcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkH65IBXFIcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkH65IBXFIcjs.applyAdjustments; exports.applyBoxBlur = _chunkH65IBXFIcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkH65IBXFIcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkH65IBXFIcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkH65IBXFIcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkH65IBXFIcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkH65IBXFIcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkH65IBXFIcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkH65IBXFIcjs.applyParams; exports.applyProcess2Adjustments = _chunkH65IBXFIcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkH65IBXFIcjs.applyProcess2Float; exports.applyRefineEdits = _chunkL52VMQZScjs.applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYF3YZZ6Gcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkH65IBXFIcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkPQ3H2AANcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkPQ3H2AANcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYF3YZZ6Gcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkH65IBXFIcjs.backgroundLayer; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkMQDIP4CFcjs.bestOffset; exports.blackWhiteGray = _chunkH65IBXFIcjs.blackWhiteGray; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRadius = _chunkPQ3H2AANcjs.blendRadius; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkUOGKSVRQcjs.blendTile; exports.blenderDab = _chunkPQ3H2AANcjs.blenderDab; exports.blurFilter = _chunkH65IBXFIcjs.blurFilter; exports.borderCoverage = _chunkQYLWG22Ncjs.borderCoverage; exports.boxBlur = _chunkL52VMQZScjs.boxBlur; exports.boxBlurPixels = _chunkYF3YZZ6Gcjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = _chunkL52VMQZScjs.boxMean; exports.boxPointOf = _chunkH65IBXFIcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkH65IBXFIcjs.bradfordAdaptation; exports.brushStrokeMask = _chunkL52VMQZScjs.brushStrokeMask; exports.brushstrokeDataUrl = _chunkPQ3H2AANcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkPQ3H2AANcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkPQ3H2AANcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkPQ3H2AANcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkPQ3H2AANcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkH65IBXFIcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkH65IBXFIcjs.buildToneLut; exports.builtinPattern = _chunkUOGKSVRQcjs.builtinPattern; exports.builtinPatternIds = _chunkUOGKSVRQcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.calculateCropDrag = _chunkH65IBXFIcjs.calculateCropDrag; exports.canShareMemory = _chunkKWNMBMKGcjs.canShareMemory; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkH65IBXFIcjs.canvasToImagePoint; exports.caretAt = _chunkQAUIZPYIcjs.caretAt; exports.changedTiles = _chunkUOGKSVRQcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkH65IBXFIcjs.clampCropToImage; exports.cleanMixer = _chunkPQ3H2AANcjs.cleanMixer; exports.cloneSamplePoint = _chunkYF3YZZ6Gcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.colorBalanceChannel = _chunkH65IBXFIcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkQYLWG22Ncjs.combineSelections; exports.compileAdjustmentLayer = _chunkH65IBXFIcjs.compileAdjustmentLayer; exports.componentPath = _chunkH65IBXFIcjs.componentPath; exports.componentsCoverage = _chunkH65IBXFIcjs.componentsCoverage; exports.compositeDeep = _chunkH65IBXFIcjs.compositeDeep; exports.compositeSurfaceOver = _chunkUOGKSVRQcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkQYLWG22Ncjs.computeSelectionBounds; exports.contentAwareFill = _chunkMQDIP4CFcjs.contentAwareFill; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contentsBox = _chunkH65IBXFIcjs.contentsBox; exports.contentsSurface = _chunkH65IBXFIcjs.contentsSurface; exports.contractCoverage = _chunkQYLWG22Ncjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkH65IBXFIcjs.convertToSmartObject; exports.copySmartObject = _chunkH65IBXFIcjs.copySmartObject; exports.cornersFromMatrix = _chunkH65IBXFIcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPQ3H2AANcjs.coverageTileCoord; exports.coverageToByte = _chunkQYLWG22Ncjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkH65IBXFIcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkPQ3H2AANcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQAUIZPYIcjs.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 = _chunkQAUIZPYIcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQAUIZPYIcjs.createOutlineTextShaper; exports.createPigment = _chunkOLNIPTB3cjs.createPigment; exports.createPigmentTools = _chunkKWNMBMKGcjs.createPigmentTools; exports.createSelectionMask = _chunkQYLWG22Ncjs.createSelectionMask; exports.createShapeLayer = _chunkH65IBXFIcjs.createShapeLayer; exports.createTypeLayer = _chunkH65IBXFIcjs.createTypeLayer; exports.createWetGpuEngine = _chunkKWNMBMKGcjs.createWetGpuEngine; exports.cssFont = _chunkQAUIZPYIcjs.cssFont; exports.cssFontFamily = _chunkQAUIZPYIcjs.cssFontFamily; exports.curveLut = _chunkUOGKSVRQcjs.curveLut; exports.curveLutFromLevels = _chunkH65IBXFIcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPQ3H2AANcjs.dabCoverage; exports.dabRect = _chunkPQ3H2AANcjs.dabRect; exports.decodeDeepSurface = _chunkH65IBXFIcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkH65IBXFIcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkH65IBXFIcjs.decodeLayerMask; exports.decodeMergedImage = _chunkH65IBXFIcjs.decodeMergedImage; exports.decodePlanes = _chunkH65IBXFIcjs.decodePlanes; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.decodePngDataUrl = _chunkH65IBXFIcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkQYLWG22Ncjs.decodeSelectionRle; exports.decontaminateColors = _chunkL52VMQZScjs.decontaminateColors; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultActiveLayerId = _chunkH65IBXFIcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkH65IBXFIcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkUOGKSVRQcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkUOGKSVRQcjs.defaultLayerEffect; exports.defaultShapeName = _chunkH65IBXFIcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkH65IBXFIcjs.depthMaskAlpha; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.depthRasterMask = _chunkH65IBXFIcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkH65IBXFIcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkH65IBXFIcjs.deserializeEffects; exports.deserializeLayer = _chunkH65IBXFIcjs.deserializeLayer; exports.deserializeLayers = _chunkH65IBXFIcjs.deserializeLayers; exports.deserializeMask = _chunkL52VMQZScjs.deserializeMask; exports.deserializePatterns = _chunkH65IBXFIcjs.deserializePatterns; exports.deserializeSelection = _chunkQYLWG22Ncjs.deserializeSelection; exports.developFilter = _chunkH65IBXFIcjs.developFilter; exports.developFromAdjustments = _chunkH65IBXFIcjs.developFromAdjustments; exports.developTarget = _chunkH65IBXFIcjs.developTarget; exports.dexp = _chunkKWNMBMKGcjs.dexp; exports.dilateMask = _chunkMQDIP4CFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkQYLWG22Ncjs.distanceTransform; exports.dlog = _chunkKWNMBMKGcjs.dlog; exports.documentContents = _chunkH65IBXFIcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYF3YZZ6Gcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYF3YZZ6Gcjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkKWNMBMKGcjs.dpow; exports.dragWarpMeshPoint = _chunkQAUIZPYIcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkKWNMBMKGcjs.dsincos; exports.duplicateLayer = _chunkH65IBXFIcjs.duplicateLayer; exports.edgeBits = _chunkKWNMBMKGcjs.edgeBits; exports.edgeWidth = _chunkL52VMQZScjs.edgeWidth; exports.effectColorHex = _chunkUOGKSVRQcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkUOGKSVRQcjs.effectReach; exports.effectiveLayerMask = _chunkH65IBXFIcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkUOGKSVRQcjs.effectsFingerprint; exports.effectsMargin = _chunkUOGKSVRQcjs.effectsMargin; exports.effectsScale = _chunkUOGKSVRQcjs.effectsScale; exports.ellipsePoints = _chunkL52VMQZScjs.ellipsePoints; exports.ellipseSelection = _chunkL52VMQZScjs.ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodeDeepSurface = _chunkH65IBXFIcjs.encodeDeepSurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.encodeRle = _chunkH65IBXFIcjs.encodeRle; exports.encodeSelectionRle = _chunkQYLWG22Ncjs.encodeSelectionRle; exports.encodeSurface = _chunkH65IBXFIcjs.encodeSurface; exports.evalWarpMesh = _chunkQAUIZPYIcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkH65IBXFIcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkPQ3H2AANcjs.exchangeRates; exports.expNeg = _chunkKWNMBMKGcjs.expNeg; exports.expandCoverage = _chunkQYLWG22Ncjs.expandCoverage; exports.exportPsd = _chunkH65IBXFIcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkQYLWG22Ncjs.featherCoverage; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.filmPixel = _chunkKWNMBMKGcjs.filmPixel; exports.filmReflectance = _chunkKWNMBMKGcjs.filmReflectance; exports.filterMaskCoverage = _chunkH65IBXFIcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkUOGKSVRQcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = _chunkL52VMQZScjs.findSky; exports.findSubject = _chunkL52VMQZScjs.findSubject; exports.findWebGpu = _chunkKWNMBMKGcjs.findWebGpu; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.fitParagraphRuns = _chunkQAUIZPYIcjs.fitParagraphRuns; exports.fitRuns = _chunkQAUIZPYIcjs.fitRuns; exports.flattenLayers = _chunkUOGKSVRQcjs.flattenLayers; exports.flattenPath = _chunkH65IBXFIcjs.flattenPath; exports.flipCorners = _chunkH65IBXFIcjs.flipCorners; exports.flowField = _chunkKWNMBMKGcjs.flowField; exports.focusArea = _chunkL52VMQZScjs.focusArea; exports.followLayerMove = _chunkH65IBXFIcjs.followLayerMove; exports.fontOf = _chunkQAUIZPYIcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkQYLWG22Ncjs.fullSelection; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.geometryHomography = _chunkH65IBXFIcjs.geometryHomography; exports.getAnnotationBounds = _chunkH65IBXFIcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkH65IBXFIcjs.getCropCursor; exports.getRotatedSize = _chunkH65IBXFIcjs.getRotatedSize; exports.getViewportMetrics = _chunkH65IBXFIcjs.getViewportMetrics; exports.getViewportProjection = _chunkH65IBXFIcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = _chunkL52VMQZScjs.grabCutLabels; exports.gradientDabColor = _chunkPQ3H2AANcjs.gradientDabColor; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.greyMorphology = _chunkQYLWG22Ncjs.greyMorphology; exports.groupLayers = _chunkH65IBXFIcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = _chunkL52VMQZScjs.guidePlanes; exports.guidedFilterColor = _chunkL52VMQZScjs.guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkUOGKSVRQcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkH65IBXFIcjs.hasResampledLegacyMask; exports.hasSurface = _chunkH65IBXFIcjs.hasSurface; exports.hasWarp = _chunkH65IBXFIcjs.hasWarp; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hashMaskContent = _chunkQYLWG22Ncjs.hashMaskContent; exports.hashNoise = _chunkUOGKSVRQcjs.hashNoise; exports.healPixels = _chunkYF3YZZ6Gcjs.healPixels; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb = _chunkH65IBXFIcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkH65IBXFIcjs.hitTestAnnotation; exports.hitTestCrop = _chunkH65IBXFIcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkH65IBXFIcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkH65IBXFIcjs.hueRangeTables; exports.hueRangeWeight = _chunkH65IBXFIcjs.hueRangeWeight; exports.hueSaturation = _chunkH65IBXFIcjs.hueSaturation; exports.identityCurve = _chunkH65IBXFIcjs.identityCurve; exports.identityLevels = _chunkH65IBXFIcjs.identityLevels; exports.identityTransform = _chunkH65IBXFIcjs.identityTransform; exports.identityWarpMesh = _chunkQAUIZPYIcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkH65IBXFIcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkH65IBXFIcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkUOGKSVRQcjs.insertLayer; exports.instancesOf = _chunkH65IBXFIcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkH65IBXFIcjs.invertMatrix3; exports.invertSelection = _chunkQYLWG22Ncjs.invertSelection; exports.isActiveFilter = _chunkH65IBXFIcjs.isActiveFilter; exports.isActiveVectorMask = _chunkH65IBXFIcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkH65IBXFIcjs.isAdjustmentKind; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkPQ3H2AANcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkH65IBXFIcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkH65IBXFIcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYF3YZZ6Gcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkH65IBXFIcjs.isIdentityTransform; exports.isInterpolation = _chunkUOGKSVRQcjs.isInterpolation; exports.isLayerEffectKind = _chunkUOGKSVRQcjs.isLayerEffectKind; exports.isLayerLocked = _chunkUOGKSVRQcjs.isLayerLocked; exports.isLegacyShape = _chunkH65IBXFIcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkH65IBXFIcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkH65IBXFIcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkH65IBXFIcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkQYLWG22Ncjs.isSelectionEmpty; exports.isSelectionMode = _chunkQYLWG22Ncjs.isSelectionMode; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkH65IBXFIcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkH65IBXFIcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkH65IBXFIcjs.isTransformAnchor; exports.isValidWarp = _chunkH65IBXFIcjs.isValidWarp; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keepMainPieces = _chunkL52VMQZScjs.keepMainPieces; exports.kelvinToTemperature = _chunkH65IBXFIcjs.kelvinToTemperature; exports.keysWeight = _chunkUOGKSVRQcjs.keysWeight; exports.latticeViscosity = _chunkKWNMBMKGcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkUOGKSVRQcjs.layerEffectFields; exports.layerEffectLabel = _chunkUOGKSVRQcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkH65IBXFIcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkH65IBXFIcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkH65IBXFIcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkH65IBXFIcjs.layerMaskKey; exports.layerMaskSelection = _chunkH65IBXFIcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkH65IBXFIcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkH65IBXFIcjs.layerTree; exports.layerTypeLabel = _chunkH65IBXFIcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkH65IBXFIcjs.layersFromLegacy; exports.layoutText = _chunkQAUIZPYIcjs.layoutText; exports.legacyAdjustmentLayer = _chunkH65IBXFIcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkH65IBXFIcjs.legacyMaskOf; exports.legacyView = _chunkH65IBXFIcjs.legacyView; exports.lerpPigment = _chunkOLNIPTB3cjs.lerpPigment; exports.lerpPigmentInto = _chunkOLNIPTB3cjs.lerpPigmentInto; exports.levelsValue = _chunkH65IBXFIcjs.levelsValue; exports.linearSrgbToXy = _chunkH65IBXFIcjs.linearSrgbToXy; exports.linearToSrgb = _chunkH65IBXFIcjs.linearToSrgb; exports.linearToSrgb8 = _chunkKWNMBMKGcjs.linearToSrgb8; exports.liveComponent = _chunkH65IBXFIcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkH65IBXFIcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPQ3H2AANcjs.loadMixer; exports.loadOpenTypeFont = _chunk3T5VCDIVcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkKWNMBMKGcjs.loadWetKernel; exports.luma = _chunkYF3YZZ6Gcjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkH65IBXFIcjs.mapCropHandle; exports.mapLayer = _chunkUOGKSVRQcjs.mapLayer; exports.mapSubpaths = _chunkH65IBXFIcjs.mapSubpaths; exports.maskBounds = _chunkMQDIP4CFcjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkH65IBXFIcjs.matrixFromCorners; exports.matrixFromParams = _chunkH65IBXFIcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunkMQDIP4CFcjs.membraneFill; exports.mergeLayerEffect = _chunkUOGKSVRQcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkH65IBXFIcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.mixPigments = _chunkOLNIPTB3cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkPQ3H2AANcjs.mixerRates; exports.modifySelection = _chunkQYLWG22Ncjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkH65IBXFIcjs.moveLayer; exports.moveSmartFilter = _chunkH65IBXFIcjs.moveSmartFilter; exports.mulMatrix3 = _chunkH65IBXFIcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkH65IBXFIcjs.neutralHueRange; exports.newContentsId = _chunkH65IBXFIcjs.newContentsId; exports.newEffectId = _chunkUOGKSVRQcjs.newEffectId; exports.newLayerId = _chunkH65IBXFIcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.newPathId = newPathId; exports.normalizeAdjustmentLayer = _chunkH65IBXFIcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkH65IBXFIcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkH65IBXFIcjs.normalizeAngle; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeBlender = _chunkPQ3H2AANcjs.normalizeBlender; exports.normalizeBrush = _chunkPQ3H2AANcjs.normalizeBrush; exports.normalizeFilter = _chunkH65IBXFIcjs.normalizeFilter; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkUOGKSVRQcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkH65IBXFIcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkH65IBXFIcjs.normalizeLiveShape; exports.normalizeMixer = _chunkPQ3H2AANcjs.normalizeMixer; exports.normalizePlacement = _chunkH65IBXFIcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkH65IBXFIcjs.normalizeProcessVersion; exports.normalizeRect = _chunkL52VMQZScjs.normalizeRect; exports.normalizeRefineEdgeParams = _chunkL52VMQZScjs.normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYF3YZZ6Gcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkH65IBXFIcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkH65IBXFIcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkH65IBXFIcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkPQ3H2AANcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkH65IBXFIcjs.normalizeSubpaths; exports.normalizeText = _chunkH65IBXFIcjs.normalizeText; exports.normalizeTilt = _chunkKWNMBMKGcjs.normalizeTilt; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.offsetLayer = _chunkH65IBXFIcjs.offsetLayer; exports.offsetShape = _chunkH65IBXFIcjs.offsetShape; exports.offsetSmartObject = _chunkH65IBXFIcjs.offsetSmartObject; exports.offsetVectorMask = _chunkH65IBXFIcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = _chunkL52VMQZScjs.otsuThreshold; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.packWetParams = _chunkKWNMBMKGcjs.packWetParams; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkPQ3H2AANcjs.paintPathStroke; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paragraphRanges = _chunkQAUIZPYIcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkH65IBXFIcjs.parseAdjustmentBlock; exports.parseBlend = _chunkH65IBXFIcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkUOGKSVRQcjs.parseEffectColor; exports.parseLfx2 = _chunkH65IBXFIcjs.parseLfx2; exports.parseLrfx = _chunkH65IBXFIcjs.parseLrfx; exports.parseOpenTypeFont = _chunk3T5VCDIVcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.parsePatternBlock = _chunkH65IBXFIcjs.parsePatternBlock; exports.parseSelectionMode = _chunkQYLWG22Ncjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkH65IBXFIcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkH65IBXFIcjs.patchParagraphStyle; exports.patchTextStyle = _chunkH65IBXFIcjs.patchTextStyle; exports.pathAnchorCount = pathAnchorCount; exports.pathBounds = pathBounds; exports.pathStrokeCoverage = _chunkPQ3H2AANcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkPQ3H2AANcjs.pathStrokeDabs; exports.pathSvgData = pathSvgData; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunkYF3YZZ6Gcjs.perDabStrength; exports.photoFilterMatrix = _chunkH65IBXFIcjs.photoFilterMatrix; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pigmentColor = _chunkKWNMBMKGcjs.pigmentColor; exports.pigmentOf = _chunkKWNMBMKGcjs.pigmentOf; exports.pixelLayerBounds = _chunkH65IBXFIcjs.pixelLayerBounds; exports.pixelLayers = _chunkH65IBXFIcjs.pixelLayers; exports.pixelPigment = _chunkKWNMBMKGcjs.pixelPigment; exports.placeContents = _chunkH65IBXFIcjs.placeContents; exports.placeLayer = _chunkH65IBXFIcjs.placeLayer; exports.placementAt = _chunkH65IBXFIcjs.placementAt; exports.placementBounds = _chunkH65IBXFIcjs.placementBounds; exports.placementGeometry = _chunkH65IBXFIcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.pointerPressure = _chunkKWNMBMKGcjs.pointerPressure; exports.pointerStrokeSample = _chunkKWNMBMKGcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkKWNMBMKGcjs.pointerStrokeSamples; exports.polygonCoverage = _chunkL52VMQZScjs.polygonCoverage; exports.polygonCoverageBox = _chunkL52VMQZScjs.polygonCoverageBox; exports.polygonSelection = _chunkL52VMQZScjs.polygonSelection; exports.posterizeValue = _chunkH65IBXFIcjs.posterizeValue; exports.presetWarp = _chunkH65IBXFIcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkH65IBXFIcjs.projectImagePoint; exports.projectImageRect = _chunkH65IBXFIcjs.projectImageRect; exports.projectMaskCoverage = _chunkH65IBXFIcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkH65IBXFIcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkH65IBXFIcjs.psdToLayers; exports.pullWarpMesh = _chunkQAUIZPYIcjs.pullWarpMesh; exports.put255 = _chunkPQ3H2AANcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = _chunkL52VMQZScjs.quickSelectStroke; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.rangeLightness = _chunkH65IBXFIcjs.rangeLightness; exports.rasterContents = _chunkH65IBXFIcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkH65IBXFIcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkH65IBXFIcjs.rasterizeCoverage; exports.rasterizeDab = _chunkPQ3H2AANcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkH65IBXFIcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPaths = readPaths; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readPsd = _chunkH65IBXFIcjs.readPsd; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.readShapeComponents = _chunkH65IBXFIcjs.readShapeComponents; exports.readSourceRegion = _chunkYF3YZZ6Gcjs.readSourceRegion; exports.rectSelection = _chunkL52VMQZScjs.rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkUOGKSVRQcjs.reduceSurface; exports.referencePoint = _chunkH65IBXFIcjs.referencePoint; exports.refineCoverage = _chunkL52VMQZScjs.refineCoverage; exports.refineEdgeHalo = _chunkL52VMQZScjs.refineEdgeHalo; exports.refineSelection = _chunkL52VMQZScjs.refineSelection; exports.reflectanceToRgb = _chunkOLNIPTB3cjs.reflectanceToRgb; exports.removeAlpha = _chunkH65IBXFIcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkH65IBXFIcjs.removeLayer; exports.removeLayerEffect = _chunkH65IBXFIcjs.removeLayerEffect; exports.removeLayerFilter = _chunkH65IBXFIcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkH65IBXFIcjs.removeSmartFilter; exports.renderBrushstroke = _chunkPQ3H2AANcjs.renderBrushstroke; exports.renderLayerEffects = _chunkUOGKSVRQcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkH65IBXFIcjs.renderShape; exports.renderShapeRect = _chunkH65IBXFIcjs.renderShapeRect; exports.renderSmartObject = _chunkH65IBXFIcjs.renderSmartObject; exports.renderText = _chunkH65IBXFIcjs.renderText; exports.replaceContents = _chunkH65IBXFIcjs.replaceContents; exports.replaceTextRange = _chunkH65IBXFIcjs.replaceTextRange; exports.requireLayer = _chunkH65IBXFIcjs.requireLayer; exports.requireOperation = _chunkH65IBXFIcjs.requireOperation; exports.requireShapeLayer = _chunkH65IBXFIcjs.requireShapeLayer; exports.requireSmartObject = _chunkH65IBXFIcjs.requireSmartObject; exports.requireTypeLayer = _chunkH65IBXFIcjs.requireTypeLayer; exports.requireUnlocked = _chunkH65IBXFIcjs.requireUnlocked; exports.rerender = _chunkH65IBXFIcjs.rerender; exports.rerenderShape = _chunkH65IBXFIcjs.rerenderShape; exports.rerenderText = _chunkH65IBXFIcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkQYLWG22Ncjs.resizeSelection; exports.resizeWarpMesh = _chunkQAUIZPYIcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkH65IBXFIcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkH65IBXFIcjs.resolveVectorMasks; exports.restyleRange = _chunkQAUIZPYIcjs.restyleRange; exports.retouchFilter = _chunkYF3YZZ6Gcjs.retouchFilter; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToGray = _chunkH65IBXFIcjs.rgbToGray; exports.rgbToHsl = _chunkH65IBXFIcjs.rgbToHsl; exports.rgbToReflectance = _chunkOLNIPTB3cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYF3YZZ6Gcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkH65IBXFIcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkH65IBXFIcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.runSelectionJob = _chunkL52VMQZScjs.runSelectionJob; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkH65IBXFIcjs.sampleLut; exports.sampleToneLut = _chunkH65IBXFIcjs.sampleToneLut; exports.saturationOf = _chunkYF3YZZ6Gcjs.saturationOf; exports.scaleLayerEffect = _chunkUOGKSVRQcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.seamlessClone = _chunkMQDIP4CFcjs.seamlessClone; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = _chunkL52VMQZScjs.selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkQYLWG22Ncjs.selectionArea; exports.selectionFromCoverage = _chunkQYLWG22Ncjs.selectionFromCoverage; exports.selectionFromPixels = _chunkQYLWG22Ncjs.selectionFromPixels; exports.selectionFromRegion = _chunkQYLWG22Ncjs.selectionFromRegion; exports.selectionFromTiles = _chunkQYLWG22Ncjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkQYLWG22Ncjs.selectionToCoverage; exports.selectionToPixels = _chunkQYLWG22Ncjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkQYLWG22Ncjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkH65IBXFIcjs.serializeContents; exports.serializeEffects = _chunkH65IBXFIcjs.serializeEffects; exports.serializeLayer = _chunkH65IBXFIcjs.serializeLayer; exports.serializeLayers = _chunkH65IBXFIcjs.serializeLayers; exports.serializeLayersExternal = _chunkH65IBXFIcjs.serializeLayersExternal; exports.serializeMask = _chunkL52VMQZScjs.serializeMask; exports.serializePaths = serializePaths; exports.serializePatterns = _chunkH65IBXFIcjs.serializePatterns; exports.serializeSelection = _chunkQYLWG22Ncjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkH65IBXFIcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkH65IBXFIcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkH65IBXFIcjs.setLayerMask; exports.setLayerProperties = _chunkH65IBXFIcjs.setLayerProperties; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.setPigmentColor = _chunkOLNIPTB3cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkH65IBXFIcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkH65IBXFIcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkH65IBXFIcjs.setSmartPlacement; exports.shadeTile = _chunkKWNMBMKGcjs.shadeTile; exports.shapeAsPixelLayer = _chunkH65IBXFIcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkH65IBXFIcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkH65IBXFIcjs.shapeGeometryBounds; exports.shapeLayers = _chunkH65IBXFIcjs.shapeLayers; exports.shapeOutline = _chunkH65IBXFIcjs.shapeOutline; exports.shapeRenderClip = _chunkH65IBXFIcjs.shapeRenderClip; exports.shiftCoverage = _chunkQYLWG22Ncjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = _chunkL52VMQZScjs.slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkH65IBXFIcjs.smartObjectLayers; exports.smoothCoverage = _chunkQYLWG22Ncjs.smoothCoverage; exports.smoothPoints = _chunkPQ3H2AANcjs.smoothPoints; exports.smoothnessWeights = _chunkL52VMQZScjs.smoothnessWeights; exports.smudgeEffect = _chunkYF3YZZ6Gcjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = _chunkL52VMQZScjs.softMaskToSelection; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.solveMembrane = _chunkMQDIP4CFcjs.solveMembrane; exports.spliceRuns = _chunkQAUIZPYIcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYF3YZZ6Gcjs.sponge; exports.spongeEffect = _chunkYF3YZZ6Gcjs.spongeEffect; exports.spotHealPixels = _chunkYF3YZZ6Gcjs.spotHealPixels; exports.spotHealWindow = _chunkYF3YZZ6Gcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkKWNMBMKGcjs.srgbByteToLinear; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.srgbToLinear = _chunkH65IBXFIcjs.srgbToLinear; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.startSelectionWorker = _chunkL52VMQZScjs.startSelectionWorker; exports.stepSlotTs = _chunkKWNMBMKGcjs.stepSlotTs; exports.strokeGrainCatch = _chunkPQ3H2AANcjs.strokeGrainCatch; exports.styleAt = _chunkQAUIZPYIcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = _chunkL52VMQZScjs.superpixelSaliency; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tempTintToXy = _chunkH65IBXFIcjs.tempTintToXy; exports.temperatureToKelvin = _chunkH65IBXFIcjs.temperatureToKelvin; exports.textIndexAt = _chunkQAUIZPYIcjs.textIndexAt; exports.textMatrix = _chunkH65IBXFIcjs.textMatrix; exports.textOrientation = _chunkH65IBXFIcjs.textOrientation; exports.textOutlines = _chunkH65IBXFIcjs.textOutlines; exports.textRange = _chunkH65IBXFIcjs.textRange; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.tipFalloff = _chunkPQ3H2AANcjs.tipFalloff; exports.tipReach = _chunkPQ3H2AANcjs.tipReach; exports.tipShape = _chunkPQ3H2AANcjs.tipShape; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkH65IBXFIcjs.toTextSpace; exports.toneCurve = _chunkH65IBXFIcjs.toneCurve; exports.toneLuts = _chunkH65IBXFIcjs.toneLuts; exports.toneOf = _chunkYF3YZZ6Gcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkH65IBXFIcjs.transformHomography; exports.transformMap = _chunkH65IBXFIcjs.transformMap; exports.transformShapeComponents = _chunkH65IBXFIcjs.transformShapeComponents; exports.transformSurface = _chunkUOGKSVRQcjs.transformSurface; exports.transformTypeLayer = _chunkH65IBXFIcjs.transformTypeLayer; exports.transformVectorMask = _chunkH65IBXFIcjs.transformVectorMask; exports.transformedBounds = _chunkUOGKSVRQcjs.transformedBounds; exports.transformedBox = _chunkH65IBXFIcjs.transformedBox; exports.transformedPoint = _chunkH65IBXFIcjs.transformedPoint; exports.translateLayer = _chunkH65IBXFIcjs.translateLayer; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.typeAsPixelLayer = _chunkH65IBXFIcjs.typeAsPixelLayer; exports.typeFrame = _chunkH65IBXFIcjs.typeFrame; exports.typeFromAnnotation = _chunkH65IBXFIcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkH65IBXFIcjs.typeLayerName; exports.ungroupLayer = _chunkH65IBXFIcjs.ungroupLayer; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.unionRect = _chunkH65IBXFIcjs.unionRect; exports.unprojectCanvasPoint = _chunkH65IBXFIcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkH65IBXFIcjs.updateLayerEffect; exports.updateLayerFilter = _chunkH65IBXFIcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkH65IBXFIcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkH65IBXFIcjs.updateShapeLayer; exports.updateSmartFilter = _chunkH65IBXFIcjs.updateSmartFilter; exports.updateTypeLayer = _chunkH65IBXFIcjs.updateTypeLayer; exports.upscaleRegion = _chunkL52VMQZScjs.upscaleRegion; exports.userErrorMessage = _chunkH65IBXFIcjs.userErrorMessage; exports.uvToXy = _chunkH65IBXFIcjs.uvToXy; exports.validateEffectGradient = _chunkUOGKSVRQcjs.validateEffectGradient; exports.validateLayerEffect = _chunkUOGKSVRQcjs.validateLayerEffect; exports.validateLayerEffects = _chunkUOGKSVRQcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkH65IBXFIcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkH65IBXFIcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkH65IBXFIcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkH65IBXFIcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkH65IBXFIcjs.vibranceLinear; exports.vibrancePixel = _chunkH65IBXFIcjs.vibrancePixel; exports.walkDabs = _chunkPQ3H2AANcjs.walkDabs; exports.warpMeshEditPoints = _chunkQAUIZPYIcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQAUIZPYIcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQAUIZPYIcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQAUIZPYIcjs.warpPresetMesh; exports.warpSurface = _chunkUOGKSVRQcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkH65IBXFIcjs.wbMatrix; exports.wetGpuSupport = _chunkKWNMBMKGcjs.wetGpuSupport; exports.wetSimdSupported = _chunkKWNMBMKGcjs.wetSimdSupported; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.whiteBalanceFromSample = _chunkH65IBXFIcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkH65IBXFIcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkH65IBXFIcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkH65IBXFIcjs.withNewIds; exports.workImage = _chunkL52VMQZScjs.workImage; exports.workLuma = _chunkL52VMQZScjs.workLuma; exports.workPlanes = _chunkL52VMQZScjs.workPlanes; exports.writeAdjustmentBlock = _chunkH65IBXFIcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeLfx2 = _chunkH65IBXFIcjs.writeLfx2; exports.writePatternBlock = _chunkH65IBXFIcjs.writePatternBlock; exports.writePsd = _chunkH65IBXFIcjs.writePsd; exports.writeRegion = _chunk474IQG74cjs.writeRegion; exports.xyToTempTint = _chunkH65IBXFIcjs.xyToTempTint; exports.xyToUv = _chunkH65IBXFIcjs.xyToUv;
22143
+ exports.ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkH65IBXFIcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkH65IBXFIcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkH65IBXFIcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkH65IBXFIcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkH65IBXFIcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkH65IBXFIcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkH65IBXFIcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkKWNMBMKGcjs.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 = _chunkPQ3H2AANcjs.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.CONTENT_AWARE_FILL_SAMPLING = CONTENT_AWARE_FILL_SAMPLING; exports.CONTENT_AWARE_FILL_TOOLS = CONTENT_AWARE_FILL_TOOLS; exports.ColorGmm = _chunkL52VMQZScjs.ColorGmm; exports.ContentAwareFillSession = ContentAwareFillSession; exports.CoverageMap = _chunkPQ3H2AANcjs.CoverageMap; exports.D50 = _chunkH65IBXFIcjs.D50; exports.D65 = _chunkH65IBXFIcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQAUIZPYIcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkPQ3H2AANcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkPQ3H2AANcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_CONTENT_AWARE_FILL_SETTINGS = DEFAULT_CONTENT_AWARE_FILL_SETTINGS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkUOGKSVRQcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkH65IBXFIcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkPQ3H2AANcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = _chunkL52VMQZScjs.DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYF3YZZ6Gcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkPQ3H2AANcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkKWNMBMKGcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkH65IBXFIcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkKWNMBMKGcjs.DRY_EPS; exports.DabWalker = _chunkPQ3H2AANcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkQYLWG22Ncjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkKWNMBMKGcjs.EX; exports.EY = _chunkKWNMBMKGcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkKWNMBMKGcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkKWNMBMKGcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkKWNMBMKGcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkKWNMBMKGcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkKWNMBMKGcjs.FLAG_TOP; exports.FLAG_WET = _chunkKWNMBMKGcjs.FLAG_WET; exports.FLAT = _chunkKWNMBMKGcjs.FLAT; exports.FREE_INTERVAL = _chunkKWNMBMKGcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkH65IBXFIcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = _chunkL52VMQZScjs.GAMMA; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = _chunkL52VMQZScjs.GUIDED_FILTER_EPS; exports.GridGraph = _chunkL52VMQZScjs.GridGraph; exports.HIDE = _chunkKWNMBMKGcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkH65IBXFIcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYF3YZZ6Gcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkH65IBXFIcjs.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.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkUOGKSVRQcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkH65IBXFIcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkH65IBXFIcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkUOGKSVRQcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkH65IBXFIcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkH65IBXFIcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkH65IBXFIcjs.LUMA_709; exports.LayerCompositor = _chunkH65IBXFIcjs.LayerCompositor; exports.LayerEffectError = _chunkUOGKSVRQcjs.LayerEffectError; exports.LayerOperationError = _chunkH65IBXFIcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkKWNMBMKGcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkH65IBXFIcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkUOGKSVRQcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkH65IBXFIcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkKWNMBMKGcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkUOGKSVRQcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkKWNMBMKGcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkKWNMBMKGcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkH65IBXFIcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkH65IBXFIcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPQ3H2AANcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPQ3H2AANcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPQ3H2AANcjs.MIXING_MODELS; exports.MixerStroke = _chunkPQ3H2AANcjs.MixerStroke; exports.OPP = _chunkKWNMBMKGcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkKWNMBMKGcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkH65IBXFIcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkKWNMBMKGcjs.PARAM; exports.PARAM_FLOATS = _chunkKWNMBMKGcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATH_EDIT_TOOLS = PATH_EDIT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkH65IBXFIcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkOLNIPTB3cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkKWNMBMKGcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkKWNMBMKGcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkOLNIPTB3cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkKWNMBMKGcjs.PLANE; exports.PLANE_BYTES = _chunkKWNMBMKGcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkH65IBXFIcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkKWNMBMKGcjs.P_D0; exports.P_EDGE = _chunkKWNMBMKGcjs.P_EDGE; exports.P_FX = _chunkKWNMBMKGcjs.P_FX; exports.P_FY = _chunkKWNMBMKGcjs.P_FY; exports.P_H = _chunkKWNMBMKGcjs.P_H; exports.P_P0 = _chunkKWNMBMKGcjs.P_P0; exports.P_RHO = _chunkKWNMBMKGcjs.P_RHO; exports.P_SW = _chunkKWNMBMKGcjs.P_SW; exports.P_UX = _chunkKWNMBMKGcjs.P_UX; exports.P_UY = _chunkKWNMBMKGcjs.P_UY; exports.PaintExchange = _chunkPQ3H2AANcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.PathEditGesture = PathEditGesture; exports.PatternPlacement = _chunkUOGKSVRQcjs.PatternPlacement; exports.PatternTile = _chunkUOGKSVRQcjs.PatternTile; exports.PsdError = _chunkH65IBXFIcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = _chunkL52VMQZScjs.REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYF3YZZ6Gcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYF3YZZ6Gcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYF3YZZ6Gcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkQYLWG22Ncjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkQYLWG22Ncjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SELECT_AND_MASK_TOOLS = SELECT_AND_MASK_TOOLS; exports.SELECT_AND_MASK_VIEWS = SELECT_AND_MASK_VIEWS; exports.SET_PLANES = _chunkKWNMBMKGcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkH65IBXFIcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkH65IBXFIcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkKWNMBMKGcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkKWNMBMKGcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkKWNMBMKGcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkH65IBXFIcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYF3YZZ6Gcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkKWNMBMKGcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.SelectionWorkerClient = _chunkL52VMQZScjs.SelectionWorkerClient; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkPQ3H2AANcjs.SmudgeTip; exports.StrokeCoverage = _chunkPQ3H2AANcjs.StrokeCoverage; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkH65IBXFIcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkH65IBXFIcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkH65IBXFIcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkH65IBXFIcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkH65IBXFIcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkPQ3H2AANcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkH65IBXFIcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYF3YZZ6Gcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkH65IBXFIcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkPQ3H2AANcjs.TileMedium; exports.TilePixelSource = _chunkYF3YZZ6Gcjs.TilePixelSource; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkUOGKSVRQcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYF3YZZ6Gcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = _chunkL52VMQZScjs.UNITS; exports.U_MAX = _chunkKWNMBMKGcjs.U_MAX; exports.VIBRANCE_GREY = _chunkH65IBXFIcjs.VIBRANCE_GREY; exports.W9 = _chunkKWNMBMKGcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQAUIZPYIcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQAUIZPYIcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkKWNMBMKGcjs.WET_TILE; exports.WGSL_HALO = _chunkKWNMBMKGcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkKWNMBMKGcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkKWNMBMKGcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_PATH_NAME = WORK_PATH_NAME; exports.WORK_SIZE = _chunkL52VMQZScjs.WORK_SIZE; exports.WetGpuEngine = _chunkKWNMBMKGcjs.WetGpuEngine; exports.WetMedium = _chunkKWNMBMKGcjs.WetMedium; exports.WetWorkerPool = _chunkKWNMBMKGcjs.WetWorkerPool; exports.WetWorld = _chunkKWNMBMKGcjs.WetWorld; exports.WetWorldError = _chunkKWNMBMKGcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkH65IBXFIcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkH65IBXFIcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkH65IBXFIcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkH65IBXFIcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkH65IBXFIcjs.activeSmartFilters; exports.addLayerEffect = _chunkH65IBXFIcjs.addLayerEffect; exports.addLayerFilter = _chunkH65IBXFIcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.addSmartFilter = _chunkH65IBXFIcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkH65IBXFIcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkH65IBXFIcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkH65IBXFIcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkH65IBXFIcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkH65IBXFIcjs.anchorPoint; exports.annotationBlend = _chunkH65IBXFIcjs.annotationBlend; exports.annotationLayerFor = _chunkH65IBXFIcjs.annotationLayerFor; exports.annotationLayerName = _chunkH65IBXFIcjs.annotationLayerName; exports.annotationOfLayer = _chunkH65IBXFIcjs.annotationOfLayer; exports.annotationOfShape = _chunkH65IBXFIcjs.annotationOfShape; exports.annotationOfType = _chunkH65IBXFIcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkH65IBXFIcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkH65IBXFIcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkH65IBXFIcjs.applyAdjustments; exports.applyBoxBlur = _chunkH65IBXFIcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkH65IBXFIcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkH65IBXFIcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkH65IBXFIcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkH65IBXFIcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkH65IBXFIcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkH65IBXFIcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkH65IBXFIcjs.applyParams; exports.applyProcess2Adjustments = _chunkH65IBXFIcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkH65IBXFIcjs.applyProcess2Float; exports.applyRefineEdits = _chunkL52VMQZScjs.applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYF3YZZ6Gcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkH65IBXFIcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkPQ3H2AANcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkPQ3H2AANcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYF3YZZ6Gcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkH65IBXFIcjs.backgroundLayer; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkMQDIP4CFcjs.bestOffset; exports.blackWhiteGray = _chunkH65IBXFIcjs.blackWhiteGray; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRadius = _chunkPQ3H2AANcjs.blendRadius; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkUOGKSVRQcjs.blendTile; exports.blenderDab = _chunkPQ3H2AANcjs.blenderDab; exports.blurFilter = _chunkH65IBXFIcjs.blurFilter; exports.borderCoverage = _chunkQYLWG22Ncjs.borderCoverage; exports.boxBlur = _chunkL52VMQZScjs.boxBlur; exports.boxBlurPixels = _chunkYF3YZZ6Gcjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = _chunkL52VMQZScjs.boxMean; exports.boxPointOf = _chunkH65IBXFIcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkH65IBXFIcjs.bradfordAdaptation; exports.brushStrokeMask = _chunkL52VMQZScjs.brushStrokeMask; exports.brushstrokeDataUrl = _chunkPQ3H2AANcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkPQ3H2AANcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkPQ3H2AANcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkPQ3H2AANcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkPQ3H2AANcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkH65IBXFIcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkH65IBXFIcjs.buildToneLut; exports.builtinPattern = _chunkUOGKSVRQcjs.builtinPattern; exports.builtinPatternIds = _chunkUOGKSVRQcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.calculateCropDrag = _chunkH65IBXFIcjs.calculateCropDrag; exports.canShareMemory = _chunkKWNMBMKGcjs.canShareMemory; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkH65IBXFIcjs.canvasToImagePoint; exports.caretAt = _chunkQAUIZPYIcjs.caretAt; exports.changedTiles = _chunkUOGKSVRQcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkH65IBXFIcjs.clampCropToImage; exports.cleanMixer = _chunkPQ3H2AANcjs.cleanMixer; exports.cloneSamplePoint = _chunkYF3YZZ6Gcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.colorBalanceChannel = _chunkH65IBXFIcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkQYLWG22Ncjs.combineSelections; exports.compileAdjustmentLayer = _chunkH65IBXFIcjs.compileAdjustmentLayer; exports.componentPath = _chunkH65IBXFIcjs.componentPath; exports.componentsCoverage = _chunkH65IBXFIcjs.componentsCoverage; exports.compositeDeep = _chunkH65IBXFIcjs.compositeDeep; exports.compositeSurfaceOver = _chunkUOGKSVRQcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkQYLWG22Ncjs.computeSelectionBounds; exports.contentAwareFill = _chunkMQDIP4CFcjs.contentAwareFill; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contentsBox = _chunkH65IBXFIcjs.contentsBox; exports.contentsSurface = _chunkH65IBXFIcjs.contentsSurface; exports.contractCoverage = _chunkQYLWG22Ncjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkH65IBXFIcjs.convertToSmartObject; exports.copySmartObject = _chunkH65IBXFIcjs.copySmartObject; exports.cornersFromMatrix = _chunkH65IBXFIcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPQ3H2AANcjs.coverageTileCoord; exports.coverageToByte = _chunkQYLWG22Ncjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkH65IBXFIcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkPQ3H2AANcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQAUIZPYIcjs.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 = _chunkQAUIZPYIcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQAUIZPYIcjs.createOutlineTextShaper; exports.createPigment = _chunkOLNIPTB3cjs.createPigment; exports.createPigmentTools = _chunkKWNMBMKGcjs.createPigmentTools; exports.createSelectionMask = _chunkQYLWG22Ncjs.createSelectionMask; exports.createShapeLayer = _chunkH65IBXFIcjs.createShapeLayer; exports.createTypeLayer = _chunkH65IBXFIcjs.createTypeLayer; exports.createWetGpuEngine = _chunkKWNMBMKGcjs.createWetGpuEngine; exports.cssFont = _chunkQAUIZPYIcjs.cssFont; exports.cssFontFamily = _chunkQAUIZPYIcjs.cssFontFamily; exports.curveLut = _chunkUOGKSVRQcjs.curveLut; exports.curveLutFromLevels = _chunkH65IBXFIcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPQ3H2AANcjs.dabCoverage; exports.dabRect = _chunkPQ3H2AANcjs.dabRect; exports.decodeDeepSurface = _chunkH65IBXFIcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkH65IBXFIcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkH65IBXFIcjs.decodeLayerMask; exports.decodeMergedImage = _chunkH65IBXFIcjs.decodeMergedImage; exports.decodePlanes = _chunkH65IBXFIcjs.decodePlanes; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.decodePngDataUrl = _chunkH65IBXFIcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkQYLWG22Ncjs.decodeSelectionRle; exports.decontaminateColors = _chunkL52VMQZScjs.decontaminateColors; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultActiveLayerId = _chunkH65IBXFIcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkH65IBXFIcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkUOGKSVRQcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkUOGKSVRQcjs.defaultLayerEffect; exports.defaultShapeName = _chunkH65IBXFIcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkH65IBXFIcjs.depthMaskAlpha; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.depthRasterMask = _chunkH65IBXFIcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkH65IBXFIcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkH65IBXFIcjs.deserializeEffects; exports.deserializeLayer = _chunkH65IBXFIcjs.deserializeLayer; exports.deserializeLayers = _chunkH65IBXFIcjs.deserializeLayers; exports.deserializeMask = _chunkL52VMQZScjs.deserializeMask; exports.deserializePatterns = _chunkH65IBXFIcjs.deserializePatterns; exports.deserializeSelection = _chunkQYLWG22Ncjs.deserializeSelection; exports.developFilter = _chunkH65IBXFIcjs.developFilter; exports.developFromAdjustments = _chunkH65IBXFIcjs.developFromAdjustments; exports.developTarget = _chunkH65IBXFIcjs.developTarget; exports.dexp = _chunkKWNMBMKGcjs.dexp; exports.dilateMask = _chunkMQDIP4CFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkQYLWG22Ncjs.distanceTransform; exports.dlog = _chunkKWNMBMKGcjs.dlog; exports.documentContents = _chunkH65IBXFIcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYF3YZZ6Gcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYF3YZZ6Gcjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkKWNMBMKGcjs.dpow; exports.dragWarpMeshPoint = _chunkQAUIZPYIcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkKWNMBMKGcjs.dsincos; exports.duplicateLayer = _chunkH65IBXFIcjs.duplicateLayer; exports.edgeBits = _chunkKWNMBMKGcjs.edgeBits; exports.edgeWidth = _chunkL52VMQZScjs.edgeWidth; exports.effectColorHex = _chunkUOGKSVRQcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkUOGKSVRQcjs.effectReach; exports.effectiveLayerMask = _chunkH65IBXFIcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkUOGKSVRQcjs.effectsFingerprint; exports.effectsMargin = _chunkUOGKSVRQcjs.effectsMargin; exports.effectsScale = _chunkUOGKSVRQcjs.effectsScale; exports.ellipsePoints = _chunkL52VMQZScjs.ellipsePoints; exports.ellipseSelection = _chunkL52VMQZScjs.ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodeDeepSurface = _chunkH65IBXFIcjs.encodeDeepSurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.encodeRle = _chunkH65IBXFIcjs.encodeRle; exports.encodeSelectionRle = _chunkQYLWG22Ncjs.encodeSelectionRle; exports.encodeSurface = _chunkH65IBXFIcjs.encodeSurface; exports.evalWarpMesh = _chunkQAUIZPYIcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkH65IBXFIcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkPQ3H2AANcjs.exchangeRates; exports.expNeg = _chunkKWNMBMKGcjs.expNeg; exports.expandCoverage = _chunkQYLWG22Ncjs.expandCoverage; exports.exportPsd = _chunkH65IBXFIcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkQYLWG22Ncjs.featherCoverage; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.filmPixel = _chunkKWNMBMKGcjs.filmPixel; exports.filmReflectance = _chunkKWNMBMKGcjs.filmReflectance; exports.filterMaskCoverage = _chunkH65IBXFIcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkUOGKSVRQcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = _chunkL52VMQZScjs.findSky; exports.findSubject = _chunkL52VMQZScjs.findSubject; exports.findWebGpu = _chunkKWNMBMKGcjs.findWebGpu; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.fitParagraphRuns = _chunkQAUIZPYIcjs.fitParagraphRuns; exports.fitRuns = _chunkQAUIZPYIcjs.fitRuns; exports.flattenLayers = _chunkUOGKSVRQcjs.flattenLayers; exports.flattenPath = _chunkH65IBXFIcjs.flattenPath; exports.flipCorners = _chunkH65IBXFIcjs.flipCorners; exports.flowField = _chunkKWNMBMKGcjs.flowField; exports.focusArea = _chunkL52VMQZScjs.focusArea; exports.followLayerMove = _chunkH65IBXFIcjs.followLayerMove; exports.fontOf = _chunkQAUIZPYIcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkQYLWG22Ncjs.fullSelection; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.geometryHomography = _chunkH65IBXFIcjs.geometryHomography; exports.getAnnotationBounds = _chunkH65IBXFIcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkH65IBXFIcjs.getCropCursor; exports.getRotatedSize = _chunkH65IBXFIcjs.getRotatedSize; exports.getViewportMetrics = _chunkH65IBXFIcjs.getViewportMetrics; exports.getViewportProjection = _chunkH65IBXFIcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = _chunkL52VMQZScjs.grabCutLabels; exports.gradientDabColor = _chunkPQ3H2AANcjs.gradientDabColor; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.greyMorphology = _chunkQYLWG22Ncjs.greyMorphology; exports.groupLayers = _chunkH65IBXFIcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = _chunkL52VMQZScjs.guidePlanes; exports.guidedFilterColor = _chunkL52VMQZScjs.guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkUOGKSVRQcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkH65IBXFIcjs.hasResampledLegacyMask; exports.hasSurface = _chunkH65IBXFIcjs.hasSurface; exports.hasWarp = _chunkH65IBXFIcjs.hasWarp; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hashMaskContent = _chunkQYLWG22Ncjs.hashMaskContent; exports.hashNoise = _chunkUOGKSVRQcjs.hashNoise; exports.healPixels = _chunkYF3YZZ6Gcjs.healPixels; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb = _chunkH65IBXFIcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkH65IBXFIcjs.hitTestAnnotation; exports.hitTestCrop = _chunkH65IBXFIcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkH65IBXFIcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkH65IBXFIcjs.hueRangeTables; exports.hueRangeWeight = _chunkH65IBXFIcjs.hueRangeWeight; exports.hueSaturation = _chunkH65IBXFIcjs.hueSaturation; exports.identityCurve = _chunkH65IBXFIcjs.identityCurve; exports.identityLevels = _chunkH65IBXFIcjs.identityLevels; exports.identityTransform = _chunkH65IBXFIcjs.identityTransform; exports.identityWarpMesh = _chunkQAUIZPYIcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkH65IBXFIcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkH65IBXFIcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkUOGKSVRQcjs.insertLayer; exports.instancesOf = _chunkH65IBXFIcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkH65IBXFIcjs.invertMatrix3; exports.invertSelection = _chunkQYLWG22Ncjs.invertSelection; exports.isActiveFilter = _chunkH65IBXFIcjs.isActiveFilter; exports.isActiveVectorMask = _chunkH65IBXFIcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkH65IBXFIcjs.isAdjustmentKind; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkPQ3H2AANcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkH65IBXFIcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkH65IBXFIcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYF3YZZ6Gcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkH65IBXFIcjs.isIdentityTransform; exports.isInterpolation = _chunkUOGKSVRQcjs.isInterpolation; exports.isLayerEffectKind = _chunkUOGKSVRQcjs.isLayerEffectKind; exports.isLayerLocked = _chunkUOGKSVRQcjs.isLayerLocked; exports.isLegacyShape = _chunkH65IBXFIcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkH65IBXFIcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPathEditTool = isPathEditTool; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkH65IBXFIcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkH65IBXFIcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkQYLWG22Ncjs.isSelectionEmpty; exports.isSelectionMode = _chunkQYLWG22Ncjs.isSelectionMode; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkH65IBXFIcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkH65IBXFIcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkH65IBXFIcjs.isTransformAnchor; exports.isValidWarp = _chunkH65IBXFIcjs.isValidWarp; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keepMainPieces = _chunkL52VMQZScjs.keepMainPieces; exports.kelvinToTemperature = _chunkH65IBXFIcjs.kelvinToTemperature; exports.keysWeight = _chunkUOGKSVRQcjs.keysWeight; exports.latticeViscosity = _chunkKWNMBMKGcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkUOGKSVRQcjs.layerEffectFields; exports.layerEffectLabel = _chunkUOGKSVRQcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkH65IBXFIcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkH65IBXFIcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkH65IBXFIcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkH65IBXFIcjs.layerMaskKey; exports.layerMaskSelection = _chunkH65IBXFIcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkH65IBXFIcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkH65IBXFIcjs.layerTree; exports.layerTypeLabel = _chunkH65IBXFIcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkH65IBXFIcjs.layersFromLegacy; exports.layoutText = _chunkQAUIZPYIcjs.layoutText; exports.legacyAdjustmentLayer = _chunkH65IBXFIcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkH65IBXFIcjs.legacyMaskOf; exports.legacyView = _chunkH65IBXFIcjs.legacyView; exports.lerpPigment = _chunkOLNIPTB3cjs.lerpPigment; exports.lerpPigmentInto = _chunkOLNIPTB3cjs.lerpPigmentInto; exports.levelsValue = _chunkH65IBXFIcjs.levelsValue; exports.linearSrgbToXy = _chunkH65IBXFIcjs.linearSrgbToXy; exports.linearToSrgb = _chunkH65IBXFIcjs.linearToSrgb; exports.linearToSrgb8 = _chunkKWNMBMKGcjs.linearToSrgb8; exports.liveComponent = _chunkH65IBXFIcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkH65IBXFIcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPQ3H2AANcjs.loadMixer; exports.loadOpenTypeFont = _chunkLCCMOWR7cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkKWNMBMKGcjs.loadWetKernel; exports.luma = _chunkYF3YZZ6Gcjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkH65IBXFIcjs.mapCropHandle; exports.mapLayer = _chunkUOGKSVRQcjs.mapLayer; exports.mapSubpaths = _chunkH65IBXFIcjs.mapSubpaths; exports.maskBounds = _chunkMQDIP4CFcjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkH65IBXFIcjs.matrixFromCorners; exports.matrixFromParams = _chunkH65IBXFIcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunkMQDIP4CFcjs.membraneFill; exports.mergeLayerEffect = _chunkUOGKSVRQcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkH65IBXFIcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.mixPigments = _chunkOLNIPTB3cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkPQ3H2AANcjs.mixerRates; exports.modifySelection = _chunkQYLWG22Ncjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkH65IBXFIcjs.moveLayer; exports.moveSmartFilter = _chunkH65IBXFIcjs.moveSmartFilter; exports.mulMatrix3 = _chunkH65IBXFIcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkH65IBXFIcjs.neutralHueRange; exports.newContentsId = _chunkH65IBXFIcjs.newContentsId; exports.newEffectId = _chunkUOGKSVRQcjs.newEffectId; exports.newLayerId = _chunkH65IBXFIcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.newPathId = newPathId; exports.normalizeAdjustmentLayer = _chunkH65IBXFIcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkH65IBXFIcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkH65IBXFIcjs.normalizeAngle; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeBlender = _chunkPQ3H2AANcjs.normalizeBlender; exports.normalizeBrush = _chunkPQ3H2AANcjs.normalizeBrush; exports.normalizeFilter = _chunkH65IBXFIcjs.normalizeFilter; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkUOGKSVRQcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkH65IBXFIcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkH65IBXFIcjs.normalizeLiveShape; exports.normalizeMixer = _chunkPQ3H2AANcjs.normalizeMixer; exports.normalizePlacement = _chunkH65IBXFIcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkH65IBXFIcjs.normalizeProcessVersion; exports.normalizeRect = _chunkL52VMQZScjs.normalizeRect; exports.normalizeRefineEdgeParams = _chunkL52VMQZScjs.normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYF3YZZ6Gcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkH65IBXFIcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkH65IBXFIcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkH65IBXFIcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkPQ3H2AANcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkH65IBXFIcjs.normalizeSubpaths; exports.normalizeText = _chunkH65IBXFIcjs.normalizeText; exports.normalizeTilt = _chunkKWNMBMKGcjs.normalizeTilt; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.offsetLayer = _chunkH65IBXFIcjs.offsetLayer; exports.offsetShape = _chunkH65IBXFIcjs.offsetShape; exports.offsetSmartObject = _chunkH65IBXFIcjs.offsetSmartObject; exports.offsetVectorMask = _chunkH65IBXFIcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = _chunkL52VMQZScjs.otsuThreshold; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.packWetParams = _chunkKWNMBMKGcjs.packWetParams; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkPQ3H2AANcjs.paintPathStroke; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paragraphRanges = _chunkQAUIZPYIcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkH65IBXFIcjs.parseAdjustmentBlock; exports.parseBlend = _chunkH65IBXFIcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkUOGKSVRQcjs.parseEffectColor; exports.parseLfx2 = _chunkH65IBXFIcjs.parseLfx2; exports.parseLrfx = _chunkH65IBXFIcjs.parseLrfx; exports.parseOpenTypeFont = _chunkLCCMOWR7cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.parsePatternBlock = _chunkH65IBXFIcjs.parsePatternBlock; exports.parseSelectionMode = _chunkQYLWG22Ncjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkH65IBXFIcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkH65IBXFIcjs.patchParagraphStyle; exports.patchTextStyle = _chunkH65IBXFIcjs.patchTextStyle; exports.pathAnchorCount = pathAnchorCount; exports.pathBounds = pathBounds; exports.pathStrokeCoverage = _chunkPQ3H2AANcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkPQ3H2AANcjs.pathStrokeDabs; exports.pathSvgData = pathSvgData; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunkYF3YZZ6Gcjs.perDabStrength; exports.photoFilterMatrix = _chunkH65IBXFIcjs.photoFilterMatrix; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pigmentColor = _chunkKWNMBMKGcjs.pigmentColor; exports.pigmentOf = _chunkKWNMBMKGcjs.pigmentOf; exports.pixelLayerBounds = _chunkH65IBXFIcjs.pixelLayerBounds; exports.pixelLayers = _chunkH65IBXFIcjs.pixelLayers; exports.pixelPigment = _chunkKWNMBMKGcjs.pixelPigment; exports.placeContents = _chunkH65IBXFIcjs.placeContents; exports.placeLayer = _chunkH65IBXFIcjs.placeLayer; exports.placementAt = _chunkH65IBXFIcjs.placementAt; exports.placementBounds = _chunkH65IBXFIcjs.placementBounds; exports.placementGeometry = _chunkH65IBXFIcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.pointerPressure = _chunkKWNMBMKGcjs.pointerPressure; exports.pointerStrokeSample = _chunkKWNMBMKGcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkKWNMBMKGcjs.pointerStrokeSamples; exports.polygonCoverage = _chunkL52VMQZScjs.polygonCoverage; exports.polygonCoverageBox = _chunkL52VMQZScjs.polygonCoverageBox; exports.polygonSelection = _chunkL52VMQZScjs.polygonSelection; exports.posterizeValue = _chunkH65IBXFIcjs.posterizeValue; exports.presetWarp = _chunkH65IBXFIcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkH65IBXFIcjs.projectImagePoint; exports.projectImageRect = _chunkH65IBXFIcjs.projectImageRect; exports.projectMaskCoverage = _chunkH65IBXFIcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkH65IBXFIcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkH65IBXFIcjs.psdToLayers; exports.pullWarpMesh = _chunkQAUIZPYIcjs.pullWarpMesh; exports.put255 = _chunkPQ3H2AANcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = _chunkL52VMQZScjs.quickSelectStroke; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.rangeLightness = _chunkH65IBXFIcjs.rangeLightness; exports.rasterContents = _chunkH65IBXFIcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkH65IBXFIcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkH65IBXFIcjs.rasterizeCoverage; exports.rasterizeDab = _chunkPQ3H2AANcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkH65IBXFIcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPaths = readPaths; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readPsd = _chunkH65IBXFIcjs.readPsd; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.readShapeComponents = _chunkH65IBXFIcjs.readShapeComponents; exports.readSourceRegion = _chunkYF3YZZ6Gcjs.readSourceRegion; exports.rectSelection = _chunkL52VMQZScjs.rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkUOGKSVRQcjs.reduceSurface; exports.referencePoint = _chunkH65IBXFIcjs.referencePoint; exports.refineCoverage = _chunkL52VMQZScjs.refineCoverage; exports.refineEdgeHalo = _chunkL52VMQZScjs.refineEdgeHalo; exports.refineSelection = _chunkL52VMQZScjs.refineSelection; exports.reflectanceToRgb = _chunkOLNIPTB3cjs.reflectanceToRgb; exports.removeAlpha = _chunkH65IBXFIcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkH65IBXFIcjs.removeLayer; exports.removeLayerEffect = _chunkH65IBXFIcjs.removeLayerEffect; exports.removeLayerFilter = _chunkH65IBXFIcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkH65IBXFIcjs.removeSmartFilter; exports.renderBrushstroke = _chunkPQ3H2AANcjs.renderBrushstroke; exports.renderLayerEffects = _chunkUOGKSVRQcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkH65IBXFIcjs.renderShape; exports.renderShapeRect = _chunkH65IBXFIcjs.renderShapeRect; exports.renderSmartObject = _chunkH65IBXFIcjs.renderSmartObject; exports.renderText = _chunkH65IBXFIcjs.renderText; exports.replaceContents = _chunkH65IBXFIcjs.replaceContents; exports.replaceTextRange = _chunkH65IBXFIcjs.replaceTextRange; exports.requireLayer = _chunkH65IBXFIcjs.requireLayer; exports.requireOperation = _chunkH65IBXFIcjs.requireOperation; exports.requireShapeLayer = _chunkH65IBXFIcjs.requireShapeLayer; exports.requireSmartObject = _chunkH65IBXFIcjs.requireSmartObject; exports.requireTypeLayer = _chunkH65IBXFIcjs.requireTypeLayer; exports.requireUnlocked = _chunkH65IBXFIcjs.requireUnlocked; exports.rerender = _chunkH65IBXFIcjs.rerender; exports.rerenderShape = _chunkH65IBXFIcjs.rerenderShape; exports.rerenderText = _chunkH65IBXFIcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkQYLWG22Ncjs.resizeSelection; exports.resizeWarpMesh = _chunkQAUIZPYIcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkH65IBXFIcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkH65IBXFIcjs.resolveVectorMasks; exports.restyleRange = _chunkQAUIZPYIcjs.restyleRange; exports.retouchFilter = _chunkYF3YZZ6Gcjs.retouchFilter; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToGray = _chunkH65IBXFIcjs.rgbToGray; exports.rgbToHsl = _chunkH65IBXFIcjs.rgbToHsl; exports.rgbToReflectance = _chunkOLNIPTB3cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYF3YZZ6Gcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkH65IBXFIcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkH65IBXFIcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.runSelectionJob = _chunkL52VMQZScjs.runSelectionJob; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkH65IBXFIcjs.sampleLut; exports.sampleToneLut = _chunkH65IBXFIcjs.sampleToneLut; exports.saturationOf = _chunkYF3YZZ6Gcjs.saturationOf; exports.scaleLayerEffect = _chunkUOGKSVRQcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.seamlessClone = _chunkMQDIP4CFcjs.seamlessClone; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = _chunkL52VMQZScjs.selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkQYLWG22Ncjs.selectionArea; exports.selectionFromCoverage = _chunkQYLWG22Ncjs.selectionFromCoverage; exports.selectionFromPixels = _chunkQYLWG22Ncjs.selectionFromPixels; exports.selectionFromRegion = _chunkQYLWG22Ncjs.selectionFromRegion; exports.selectionFromTiles = _chunkQYLWG22Ncjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkQYLWG22Ncjs.selectionToCoverage; exports.selectionToPixels = _chunkQYLWG22Ncjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkQYLWG22Ncjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkH65IBXFIcjs.serializeContents; exports.serializeEffects = _chunkH65IBXFIcjs.serializeEffects; exports.serializeLayer = _chunkH65IBXFIcjs.serializeLayer; exports.serializeLayers = _chunkH65IBXFIcjs.serializeLayers; exports.serializeLayersExternal = _chunkH65IBXFIcjs.serializeLayersExternal; exports.serializeMask = _chunkL52VMQZScjs.serializeMask; exports.serializePaths = serializePaths; exports.serializePatterns = _chunkH65IBXFIcjs.serializePatterns; exports.serializeSelection = _chunkQYLWG22Ncjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkH65IBXFIcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkH65IBXFIcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkH65IBXFIcjs.setLayerMask; exports.setLayerProperties = _chunkH65IBXFIcjs.setLayerProperties; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.setPigmentColor = _chunkOLNIPTB3cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkH65IBXFIcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkH65IBXFIcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkH65IBXFIcjs.setSmartPlacement; exports.shadeTile = _chunkKWNMBMKGcjs.shadeTile; exports.shapeAsPixelLayer = _chunkH65IBXFIcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkH65IBXFIcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkH65IBXFIcjs.shapeGeometryBounds; exports.shapeLayers = _chunkH65IBXFIcjs.shapeLayers; exports.shapeOutline = _chunkH65IBXFIcjs.shapeOutline; exports.shapeRenderClip = _chunkH65IBXFIcjs.shapeRenderClip; exports.shiftCoverage = _chunkQYLWG22Ncjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = _chunkL52VMQZScjs.slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkH65IBXFIcjs.smartObjectLayers; exports.smoothCoverage = _chunkQYLWG22Ncjs.smoothCoverage; exports.smoothPoints = _chunkPQ3H2AANcjs.smoothPoints; exports.smoothnessWeights = _chunkL52VMQZScjs.smoothnessWeights; exports.smudgeEffect = _chunkYF3YZZ6Gcjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = _chunkL52VMQZScjs.softMaskToSelection; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.solveMembrane = _chunkMQDIP4CFcjs.solveMembrane; exports.spliceRuns = _chunkQAUIZPYIcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYF3YZZ6Gcjs.sponge; exports.spongeEffect = _chunkYF3YZZ6Gcjs.spongeEffect; exports.spotHealPixels = _chunkYF3YZZ6Gcjs.spotHealPixels; exports.spotHealWindow = _chunkYF3YZZ6Gcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkKWNMBMKGcjs.srgbByteToLinear; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.srgbToLinear = _chunkH65IBXFIcjs.srgbToLinear; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.startSelectionWorker = _chunkL52VMQZScjs.startSelectionWorker; exports.stepSlotTs = _chunkKWNMBMKGcjs.stepSlotTs; exports.strokeGrainCatch = _chunkPQ3H2AANcjs.strokeGrainCatch; exports.styleAt = _chunkQAUIZPYIcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = _chunkL52VMQZScjs.superpixelSaliency; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tempTintToXy = _chunkH65IBXFIcjs.tempTintToXy; exports.temperatureToKelvin = _chunkH65IBXFIcjs.temperatureToKelvin; exports.textIndexAt = _chunkQAUIZPYIcjs.textIndexAt; exports.textMatrix = _chunkH65IBXFIcjs.textMatrix; exports.textOrientation = _chunkH65IBXFIcjs.textOrientation; exports.textOutlines = _chunkH65IBXFIcjs.textOutlines; exports.textRange = _chunkH65IBXFIcjs.textRange; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.tipFalloff = _chunkPQ3H2AANcjs.tipFalloff; exports.tipReach = _chunkPQ3H2AANcjs.tipReach; exports.tipShape = _chunkPQ3H2AANcjs.tipShape; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkH65IBXFIcjs.toTextSpace; exports.toneCurve = _chunkH65IBXFIcjs.toneCurve; exports.toneLuts = _chunkH65IBXFIcjs.toneLuts; exports.toneOf = _chunkYF3YZZ6Gcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkH65IBXFIcjs.transformHomography; exports.transformMap = _chunkH65IBXFIcjs.transformMap; exports.transformShapeComponents = _chunkH65IBXFIcjs.transformShapeComponents; exports.transformSurface = _chunkUOGKSVRQcjs.transformSurface; exports.transformTypeLayer = _chunkH65IBXFIcjs.transformTypeLayer; exports.transformVectorMask = _chunkH65IBXFIcjs.transformVectorMask; exports.transformedBounds = _chunkUOGKSVRQcjs.transformedBounds; exports.transformedBox = _chunkH65IBXFIcjs.transformedBox; exports.transformedPoint = _chunkH65IBXFIcjs.transformedPoint; exports.translateLayer = _chunkH65IBXFIcjs.translateLayer; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.typeAsPixelLayer = _chunkH65IBXFIcjs.typeAsPixelLayer; exports.typeFrame = _chunkH65IBXFIcjs.typeFrame; exports.typeFromAnnotation = _chunkH65IBXFIcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkH65IBXFIcjs.typeLayerName; exports.ungroupLayer = _chunkH65IBXFIcjs.ungroupLayer; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.unionRect = _chunkH65IBXFIcjs.unionRect; exports.unprojectCanvasPoint = _chunkH65IBXFIcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkH65IBXFIcjs.updateLayerEffect; exports.updateLayerFilter = _chunkH65IBXFIcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkH65IBXFIcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkH65IBXFIcjs.updateShapeLayer; exports.updateSmartFilter = _chunkH65IBXFIcjs.updateSmartFilter; exports.updateTypeLayer = _chunkH65IBXFIcjs.updateTypeLayer; exports.upscaleRegion = _chunkL52VMQZScjs.upscaleRegion; exports.userErrorMessage = _chunkH65IBXFIcjs.userErrorMessage; exports.uvToXy = _chunkH65IBXFIcjs.uvToXy; exports.validateEffectGradient = _chunkUOGKSVRQcjs.validateEffectGradient; exports.validateLayerEffect = _chunkUOGKSVRQcjs.validateLayerEffect; exports.validateLayerEffects = _chunkUOGKSVRQcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkH65IBXFIcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkH65IBXFIcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkH65IBXFIcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkH65IBXFIcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkH65IBXFIcjs.vibranceLinear; exports.vibrancePixel = _chunkH65IBXFIcjs.vibrancePixel; exports.walkDabs = _chunkPQ3H2AANcjs.walkDabs; exports.warpMeshEditPoints = _chunkQAUIZPYIcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQAUIZPYIcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQAUIZPYIcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQAUIZPYIcjs.warpPresetMesh; exports.warpSurface = _chunkUOGKSVRQcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkH65IBXFIcjs.wbMatrix; exports.wetGpuSupport = _chunkKWNMBMKGcjs.wetGpuSupport; exports.wetSimdSupported = _chunkKWNMBMKGcjs.wetSimdSupported; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.whiteBalanceFromSample = _chunkH65IBXFIcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkH65IBXFIcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkH65IBXFIcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkH65IBXFIcjs.withNewIds; exports.workImage = _chunkL52VMQZScjs.workImage; exports.workLuma = _chunkL52VMQZScjs.workLuma; exports.workPlanes = _chunkL52VMQZScjs.workPlanes; exports.writeAdjustmentBlock = _chunkH65IBXFIcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeLfx2 = _chunkH65IBXFIcjs.writeLfx2; exports.writePatternBlock = _chunkH65IBXFIcjs.writePatternBlock; exports.writePsd = _chunkH65IBXFIcjs.writePsd; exports.writeRegion = _chunk474IQG74cjs.writeRegion; exports.xyToTempTint = _chunkH65IBXFIcjs.xyToTempTint; exports.xyToUv = _chunkH65IBXFIcjs.xyToUv;