@pixerate/editor 0.205.0 → 0.207.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,4 +1,4 @@
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;
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;
2
2
 
3
3
 
4
4
 
@@ -4015,10 +4015,10 @@ function edgeWidth(guide, w, h, r) {
4015
4015
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
4016
4016
  return out;
4017
4017
  }
4018
- function refineCoverage(guide, m, w, h, params = {}) {
4018
+ function refineCoverage(guide, m, w, h, params = {}, band = null) {
4019
4019
  const p = normalizeRefineEdgeParams(params);
4020
4020
  let a = Float32Array.from(m);
4021
- if (p.radius > 0 && guide) {
4021
+ if ((p.radius > 0 || band) && guide) {
4022
4022
  const n = w * h;
4023
4023
  const boundary = new Uint8Array(n);
4024
4024
  let any = false;
@@ -4033,14 +4033,15 @@ function refineCoverage(guide, m, w, h, params = {}) {
4033
4033
  }
4034
4034
  }
4035
4035
  }
4036
- if (any) {
4036
+ if (any || band) {
4037
4037
  const dist = _chunkUYXL6ZWQcjs.distanceTransform.call(void 0, boundary, w, h);
4038
- const r = gfRadius(p);
4038
+ const r = band ? Math.max(4, gfRadius(p)) : gfRadius(p);
4039
4039
  const q = guidedFilterColor(guide, m, w, h, r);
4040
4040
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
4041
4041
  for (let i = 0; i < n; i++) {
4042
4042
  const reff = widths ? Math.min(Math.max(p.radius, 1.5), Math.max(1.5, widths[i])) : p.radius;
4043
- const wgt = Math.min(1, Math.max(0, reff + 1 - dist[i]));
4043
+ const edge = p.radius > 0 ? Math.min(1, Math.max(0, reff + 1 - dist[i])) : 0;
4044
+ const wgt = band ? Math.max(edge, Math.min(1, Math.max(0, band[i]))) : edge;
4044
4045
  if (wgt > 0) {
4045
4046
  const qi = Math.min(1, Math.max(0, q[i]));
4046
4047
  a[i] = m[i] + (qi - m[i]) * wgt;
@@ -4081,17 +4082,24 @@ function guidePlanes(pixels, win) {
4081
4082
  }
4082
4083
  return [r, g, b];
4083
4084
  }
4084
- function refineSelection(pixels, mask, params = {}) {
4085
+ function refineSelection(pixels, mask, params = {}, refineBrush = null) {
4085
4086
  const p = normalizeRefineEdgeParams(params);
4086
4087
  if (pixels && (pixels.width !== mask.width || pixels.height !== mask.height)) {
4087
4088
  throw new Error("Refine Edge needs pixels the size of the selection");
4088
4089
  }
4089
4090
  if (!mask.bounds) return mask;
4090
- const halo = refineEdgeHalo(p);
4091
- const x0 = Math.max(0, mask.bounds.x - halo);
4092
- const y0 = Math.max(0, mask.bounds.y - halo);
4093
- const x1 = Math.min(mask.width, mask.bounds.x + mask.bounds.width + halo);
4094
- const y1 = Math.min(mask.height, mask.bounds.y + mask.bounds.height + halo);
4091
+ const brush = _optionalChain([refineBrush, 'optionalAccess', _69 => _69.bounds]) ? refineBrush : null;
4092
+ const halo = refineEdgeHalo(p) + (brush ? 2 * Math.max(4, gfRadius(p)) : 0);
4093
+ const b = brush ? {
4094
+ x: Math.min(mask.bounds.x, brush.bounds.x),
4095
+ y: Math.min(mask.bounds.y, brush.bounds.y),
4096
+ r: Math.max(mask.bounds.x + mask.bounds.width, brush.bounds.x + brush.bounds.width),
4097
+ btm: Math.max(mask.bounds.y + mask.bounds.height, brush.bounds.y + brush.bounds.height)
4098
+ } : { x: mask.bounds.x, y: mask.bounds.y, r: mask.bounds.x + mask.bounds.width, btm: mask.bounds.y + mask.bounds.height };
4099
+ const x0 = Math.max(0, b.x - halo);
4100
+ const y0 = Math.max(0, b.y - halo);
4101
+ const x1 = Math.min(mask.width, b.r + halo);
4102
+ const y1 = Math.min(mask.height, b.btm + halo);
4095
4103
  const ww = x1 - x0;
4096
4104
  const wh = y1 - y0;
4097
4105
  const m = new Float32Array(ww * wh);
@@ -4099,8 +4107,17 @@ function refineSelection(pixels, mask, params = {}) {
4099
4107
  const src = (y0 + y) * mask.width + x0;
4100
4108
  for (let x = 0; x < ww; x++) m[y * ww + x] = mask.data[src + x] / 255;
4101
4109
  }
4102
- const guide = pixels && p.radius > 0 ? guidePlanes(pixels, { x: x0, y: y0, width: ww, height: wh }) : null;
4103
- const refined = refineCoverage(guide, m, ww, wh, p);
4110
+ const guide = pixels && (p.radius > 0 || brush) ? guidePlanes(pixels, { x: x0, y: y0, width: ww, height: wh }) : null;
4111
+ let band = null;
4112
+ if (brush) {
4113
+ band = new Float32Array(ww * wh);
4114
+ const bd = brush.data;
4115
+ for (let y = 0; y < wh; y++) {
4116
+ const src = (y0 + y) * mask.width + x0;
4117
+ for (let x = 0; x < ww; x++) band[y * ww + x] = bd[src + x] / 255;
4118
+ }
4119
+ }
4120
+ const refined = refineCoverage(guide, m, ww, wh, p, band);
4104
4121
  const out = new Uint8Array(mask.width * mask.height);
4105
4122
  for (let y = 0; y < wh; y++) {
4106
4123
  const dst = (y0 + y) * mask.width + x0;
@@ -4489,11 +4506,11 @@ function applyShapeOptions(controller, layerId, change) {
4489
4506
  const style = {};
4490
4507
  if ("fill" in change) style.fill = _nullishCoalesce(change.fill, () => ( null));
4491
4508
  if ("stroke" in change || "strokeWidth" in change) {
4492
- const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _69 => _69.stroke, 'optionalAccess', _70 => _70.paint, 'access', _71 => _71.type]) === "color" ? info.stroke.paint.color : null;
4493
- style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _72 => _72.stroke, 'optionalAccess', _73 => _73.width]))), () => ( 2)), paint: color } : null;
4509
+ const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _70 => _70.stroke, 'optionalAccess', _71 => _71.paint, 'access', _72 => _72.type]) === "color" ? info.stroke.paint.color : null;
4510
+ style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _73 => _73.stroke, 'optionalAccess', _74 => _74.width]))), () => ( 2)), paint: color } : null;
4494
4511
  }
4495
4512
  if (Object.keys(style).length) controller.setShapeStyle(layerId, style);
4496
- const live = _optionalChain([info, 'access', _74 => _74.components, 'access', _75 => _75[0], 'optionalAccess', _76 => _76.live]);
4513
+ const live = _optionalChain([info, 'access', _75 => _75.components, 'access', _76 => _76[0], 'optionalAccess', _77 => _77.live]);
4497
4514
  if (!live) return;
4498
4515
  const shape = {};
4499
4516
  if (live.kind === "rect" && change.radius !== void 0) shape.radius = change.radius;
@@ -4519,7 +4536,7 @@ var TextEditSession = (_class8 = class {
4519
4536
  __init42() {this.listeners = /* @__PURE__ */ new Set()}
4520
4537
  __init43() {this.error = null}
4521
4538
  get layer() {
4522
- const l = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _77 => _77.layer]);
4539
+ const l = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _78 => _78.layer]);
4523
4540
  if (!l || l.type !== "type") throw new Error("The type layer being edited is gone.");
4524
4541
  return l;
4525
4542
  }
@@ -4534,7 +4551,7 @@ var TextEditSession = (_class8 = class {
4534
4551
  }
4535
4552
  /** Whether the layer still exists (it can be deleted or undone away while editing). */
4536
4553
  get alive() {
4537
- return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _78 => _78.layer, 'access', _79 => _79.type]) === "type";
4554
+ return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _79 => _79.layer, 'access', _80 => _80.type]) === "type";
4538
4555
  }
4539
4556
  subscribe(fn) {
4540
4557
  this.listeners.add(fn);
@@ -4822,7 +4839,7 @@ var TypeToolGesture = (_class9 = class {
4822
4839
  finish() {
4823
4840
  const s = this.session;
4824
4841
  this.session = null;
4825
- _optionalChain([s, 'optionalAccess', _80 => _80.close, 'call', _81 => _81()]);
4842
+ _optionalChain([s, 'optionalAccess', _81 => _81.close, 'call', _82 => _82()]);
4826
4843
  }
4827
4844
  }, _class9);
4828
4845
 
@@ -5291,7 +5308,7 @@ function segmentToSelection(width, height, result) {
5291
5308
  const sized = raw.width === width && raw.height === height ? raw : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, raw, width, height);
5292
5309
  out = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, out, sized, "add");
5293
5310
  }
5294
- return _optionalChain([out, 'optionalAccess', _82 => _82.bounds]) ? out : null;
5311
+ return _optionalChain([out, 'optionalAccess', _83 => _83.bounds]) ? out : null;
5295
5312
  }
5296
5313
  function segmentsToSelection(width, height, results) {
5297
5314
  let out = null;
@@ -5302,6 +5319,78 @@ function segmentsToSelection(width, height, results) {
5302
5319
  return out;
5303
5320
  }
5304
5321
 
5322
+ // src/image-editor/selection/refine-edits.ts
5323
+ var REFINE_EDIT_KINDS = ["quick-select", "brush", "refine-brush", "lasso", "object"];
5324
+ function brushStrokeMask(width, height, points, size, hardness = 1) {
5325
+ const r = Math.max(0.5, size / 2);
5326
+ const solid = r * Math.min(1, Math.max(0, hardness));
5327
+ let x0 = Infinity, y0 = Infinity, x1 = -Infinity, y1 = -Infinity;
5328
+ for (const p of points) {
5329
+ x0 = Math.min(x0, p.x);
5330
+ y0 = Math.min(y0, p.y);
5331
+ x1 = Math.max(x1, p.x);
5332
+ y1 = Math.max(y1, p.y);
5333
+ }
5334
+ const bx = Math.max(0, Math.floor(x0 - r - 1));
5335
+ const by = Math.max(0, Math.floor(y0 - r - 1));
5336
+ const bw = Math.min(width, Math.ceil(x1 + r + 1)) - bx;
5337
+ const bh = Math.min(height, Math.ceil(y1 + r + 1)) - by;
5338
+ if (!(bw > 0 && bh > 0)) return _chunkUYXL6ZWQcjs.createSelectionMask.call(void 0, width, height);
5339
+ const out = new Uint8Array(bw * bh);
5340
+ const segs = points.length === 1 ? [[points[0], points[0]]] : points.slice(1).map((p, i) => [points[i], p]);
5341
+ for (let y = 0; y < bh; y++) {
5342
+ for (let x = 0; x < bw; x++) {
5343
+ const px2 = bx + x + 0.5;
5344
+ const py = by + y + 0.5;
5345
+ let d = Infinity;
5346
+ for (const [a, b] of segs) {
5347
+ const dx = b.x - a.x;
5348
+ const dy = b.y - a.y;
5349
+ const len2 = dx * dx + dy * dy;
5350
+ const t = len2 > 0 ? Math.min(1, Math.max(0, ((px2 - a.x) * dx + (py - a.y) * dy) / len2)) : 0;
5351
+ d = Math.min(d, Math.hypot(px2 - a.x - t * dx, py - a.y - t * dy));
5352
+ }
5353
+ let v = d <= solid ? 1 : solid >= r ? 0 : 1 - (d - solid) / (r - solid);
5354
+ v = Math.min(v, Math.min(1, Math.max(0, r + 0.5 - d)));
5355
+ out[y * bw + x] = Math.round(Math.max(0, v) * 255);
5356
+ }
5357
+ }
5358
+ return _chunkUYXL6ZWQcjs.selectionFromRegion.call(void 0, width, height, { x: bx, y: by, width: bw, height: bh }, out);
5359
+ }
5360
+ function applyRefineEdits(pixels, selection, edits, width, height) {
5361
+ let sel = _optionalChain([selection, 'optionalAccess', _84 => _84.bounds]) ? selection : null;
5362
+ let band = null;
5363
+ for (const e of edits) {
5364
+ if (e.kind === "object") {
5365
+ if (!pixels) throw new Error("Object Selection needs the image pixels.");
5366
+ if (!e.rect === !e.point) throw new Error("An object edit takes rect (a box around the object) or point (on it), not both.");
5367
+ const region2 = selectObjectIn(pixels, e.rect ? { rect: e.rect } : { point: e.point });
5368
+ sel = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, sel, region2, _nullishCoalesce(e.mode, () => ( "add")));
5369
+ continue;
5370
+ }
5371
+ if (!e.points.length) throw new Error(`A ${e.kind} stroke needs at least one point.`);
5372
+ if (e.kind === "lasso") {
5373
+ if (e.points.length < 3) throw new Error("A lasso edit needs at least 3 points.");
5374
+ sel = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, sel, polygonSelection(width, height, e.points, {}), _nullishCoalesce(e.mode, () => ( "add")));
5375
+ continue;
5376
+ }
5377
+ if (e.kind === "refine-brush") {
5378
+ band = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, band, brushStrokeMask(width, height, e.points, _nullishCoalesce(e.size, () => ( 40))), "add");
5379
+ continue;
5380
+ }
5381
+ const mode = _nullishCoalesce(e.mode, () => ( "add"));
5382
+ let region;
5383
+ if (e.kind === "quick-select") {
5384
+ if (!pixels) throw new Error("Quick Selection strokes need the image pixels.");
5385
+ region = quickSelectStroke(pixels, e.points, { size: e.size, selection: sel, grow: mode === "add" });
5386
+ } else {
5387
+ region = brushStrokeMask(width, height, e.points, _nullishCoalesce(e.size, () => ( 20)), _nullishCoalesce(e.hardness, () => ( 1)));
5388
+ }
5389
+ sel = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, sel, region, mode);
5390
+ }
5391
+ return { selection: sel, refineBrush: band };
5392
+ }
5393
+
5305
5394
  // src/image-editor/selection/stroke.ts
5306
5395
  function selectionRing(sel, width, location) {
5307
5396
  const half = location === "center" ? width / 2 : width;
@@ -5340,7 +5429,7 @@ function deserializeChannels(value, size, problems = []) {
5340
5429
  visible: v.visible === true
5341
5430
  });
5342
5431
  } catch (err) {
5343
- problems.push(`Alpha channel "${String(_nullishCoalesce(_optionalChain([v, 'optionalAccess', _83 => _83.name]), () => ( "?")))}" could not be read: ${err instanceof Error ? err.message : String(err)}.`);
5432
+ problems.push(`Alpha channel "${String(_nullishCoalesce(_optionalChain([v, 'optionalAccess', _85 => _85.name]), () => ( "?")))}" could not be read: ${err instanceof Error ? err.message : String(err)}.`);
5344
5433
  }
5345
5434
  }
5346
5435
  return out;
@@ -5378,16 +5467,16 @@ function checkEffectTime(time) {
5378
5467
  return time;
5379
5468
  }
5380
5469
  function checkEffectAnimation(animate) {
5381
- const duration = _optionalChain([animate, 'optionalAccess', _84 => _84.duration]);
5470
+ const duration = _optionalChain([animate, 'optionalAccess', _86 => _86.duration]);
5382
5471
  if (!(typeof duration === "number" && Number.isFinite(duration) && duration > 0 && duration <= _chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS)) {
5383
5472
  throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`animate.duration must be more than 0 and at most ${_chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS} ms.`);
5384
5473
  }
5385
5474
  return { duration: Math.round(duration) };
5386
5475
  }
5387
5476
  function effectLayerTiming(g, d) {
5388
- if (!_optionalChain([d, 'optionalAccess', _85 => _85.duration])) return null;
5477
+ if (!_optionalChain([d, 'optionalAccess', _87 => _87.duration])) return null;
5389
5478
  const time = _nullishCoalesce(g.time, () => ( 0));
5390
- return { mode: g.animate ? "animate" : "still", time, range: Math.max(d.duration, time), duration: _nullishCoalesce(_optionalChain([g, 'access', _86 => _86.animate, 'optionalAccess', _87 => _87.duration]), () => ( d.duration)), loops: d.loop };
5479
+ return { mode: g.animate ? "animate" : "still", time, range: Math.max(d.duration, time), duration: _nullishCoalesce(_optionalChain([g, 'access', _88 => _88.animate, 'optionalAccess', _89 => _89.duration]), () => ( d.duration)), loops: d.loop };
5391
5480
  }
5392
5481
 
5393
5482
  // src/image-editor/effects.ts
@@ -5640,14 +5729,14 @@ var FreeTransformSession = (_class11 = class {
5640
5729
  if (init.interpolation !== void 0 && !_chunkHGTDMKNEcjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
5641
5730
  this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
5642
5731
  const sel = host.selection();
5643
- const selected = Boolean(_optionalChain([sel, 'optionalAccess', _88 => _88.bounds]));
5732
+ const selected = Boolean(_optionalChain([sel, 'optionalAccess', _90 => _90.bounds]));
5644
5733
  let content = _nullishCoalesce(init.content, () => ( "auto"));
5645
5734
  if (!["auto", "layer", "selection", "selection-copy", "selection-outline"].includes(content)) {
5646
5735
  fail(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
5647
5736
  }
5648
5737
  const targetId = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
5649
- const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _89 => _89.layer]) : void 0;
5650
- const smartTarget = (_optionalChain([target, 'optionalAccess', _90 => _90.type]) === "smart" || _optionalChain([target, 'optionalAccess', _91 => _91.type]) === "shape" || _optionalChain([target, 'optionalAccess', _92 => _92.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
5738
+ const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _91 => _91.layer]) : void 0;
5739
+ const smartTarget = (_optionalChain([target, 'optionalAccess', _92 => _92.type]) === "smart" || _optionalChain([target, 'optionalAccess', _93 => _93.type]) === "shape" || _optionalChain([target, 'optionalAccess', _94 => _94.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
5651
5740
  if (content === "auto") content = selected && !smartTarget ? "selection" : "layer";
5652
5741
  this.content = content;
5653
5742
  if (content !== "layer" && !selected) fail(`Nothing is selected; ${content} needs a selection. Select first, or use content layer.`);
@@ -5671,9 +5760,9 @@ var FreeTransformSession = (_class11 = class {
5671
5760
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
5672
5761
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
5673
5762
  if (channel !== "pixels" && channel !== "mask") fail(`Unknown channel "${String(channel)}"; use pixels or mask.`);
5674
- const linked = _optionalChain([mask, 'optionalAccess', _93 => _93.linked]) !== false;
5763
+ const linked = _optionalChain([mask, 'optionalAccess', _95 => _95.linked]) !== false;
5675
5764
  const maskAlone = channel === "mask" && (!linked || layer.type !== "pixel");
5676
- if (channel === "mask" && !mask) fail(_optionalChain([layer, 'access', _94 => _94.mask, 'optionalAccess', _95 => _95.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
5765
+ if (channel === "mask" && !mask) fail(_optionalChain([layer, 'access', _96 => _96.mask, 'optionalAccess', _97 => _97.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
5677
5766
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
5678
5767
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
5679
5768
  if (content !== "selection-copy") {
@@ -5776,7 +5865,7 @@ var FreeTransformSession = (_class11 = class {
5776
5865
  };
5777
5866
  this.copyId = copy.id;
5778
5867
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, layer.id);
5779
- this.startLayers = _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _96 => _96.parent, 'optionalAccess', _97 => _97.id]), () => ( null)), loc.index + 1);
5868
+ this.startLayers = _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _98 => _98.parent, 'optionalAccess', _99 => _99.id]), () => ( null)), loc.index + 1);
5780
5869
  this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
5781
5870
  moves.push("pixels");
5782
5871
  }
@@ -5885,7 +5974,7 @@ var FreeTransformSession = (_class11 = class {
5885
5974
  moveVectorMask(layers) {
5886
5975
  const g = this.geometryValue;
5887
5976
  if (!this.layerId || this.copyId || !this.moves.includes("pixels") || _chunkUYXL6ZWQcjs.isIdentityTransform.call(void 0, g)) return layers;
5888
- const vm = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, this.layerId), 'optionalAccess', _98 => _98.layer, 'access', _99 => _99.vectorMask]);
5977
+ const vm = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, this.layerId), 'optionalAccess', _100 => _100.layer, 'access', _101 => _101.vectorMask]);
5889
5978
  if (!vm || vm.linked === false) return layers;
5890
5979
  const warp = _chunkUYXL6ZWQcjs.hasWarp.call(void 0, g);
5891
5980
  const f = warp ? _chunkUYXL6ZWQcjs.transformMap.call(void 0, g) : null;
@@ -6056,11 +6145,11 @@ var FreeTransformSession = (_class11 = class {
6056
6145
  result(changed, layers, selection) {
6057
6146
  let bounds = null;
6058
6147
  const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
6059
- const layer = id ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _100 => _100.layer]) : void 0;
6060
- if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _101 => _101.type]) === "pixel") bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
6061
- else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _102 => _102.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _103 => _103.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _104 => _104.type]) === "type")) bounds = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
6062
- else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _105 => _105.mask])) bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
6063
- else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _106 => _106.bounds]) ? { ...selection.bounds } : null;
6148
+ const layer = id ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _102 => _102.layer]) : void 0;
6149
+ if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _103 => _103.type]) === "pixel") bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
6150
+ else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _104 => _104.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _105 => _105.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _106 => _106.type]) === "type")) bounds = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
6151
+ else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _107 => _107.mask])) bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
6152
+ else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _108 => _108.bounds]) ? { ...selection.bounds } : null;
6064
6153
  return {
6065
6154
  layerId: _nullishCoalesce(this.copyId, () => ( this.layerId)),
6066
6155
  content: this.content,
@@ -6089,7 +6178,7 @@ function deserializeColorMode(raw, problems) {
6089
6178
  }
6090
6179
  function effectiveProof(proof, mode) {
6091
6180
  if (proof) return proof;
6092
- if (_optionalChain([mode, 'optionalAccess', _107 => _107.mode]) === "cmyk") return { ...DEFAULT_PROOF, profile: mode.profile, intent: mode.intent };
6181
+ if (_optionalChain([mode, 'optionalAccess', _109 => _109.mode]) === "cmyk") return { ...DEFAULT_PROOF, profile: mode.profile, intent: mode.intent };
6093
6182
  return null;
6094
6183
  }
6095
6184
  function colorModePlanes(doc, mode) {
@@ -6144,7 +6233,7 @@ function resolveProfile(doc) {
6144
6233
  return p;
6145
6234
  }
6146
6235
  function profileBytes(doc) {
6147
- if (_optionalChain([doc, 'optionalAccess', _108 => _108.icc])) return doc.icc;
6236
+ if (_optionalChain([doc, 'optionalAccess', _110 => _110.icc])) return doc.icc;
6148
6237
  const p = resolveProfile(doc);
6149
6238
  return _nullishCoalesce(p.bytes, () => ( _chunkBROJYMWUcjs.encodeProfile.call(void 0, p)));
6150
6239
  }
@@ -6306,7 +6395,7 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
6306
6395
  else tiles.delete(key);
6307
6396
  continue;
6308
6397
  }
6309
- const src = _nullishCoalesce(_optionalChain([base, 'access', _109 => _109.tiles, 'access', _110 => _110.get, 'call', _111 => _111(key), 'optionalAccess', _112 => _112.data]), () => ( defaultTile(base)));
6398
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _111 => _111.tiles, 'access', _112 => _112.get, 'call', _113 => _113(key), 'optionalAccess', _114 => _114.data]), () => ( defaultTile(base)));
6310
6399
  const data = _chunkEBDCRTZIcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
6311
6400
  const tile = _chunkCWM3CUUXcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
6312
6401
  if (tile) tiles.set(key, tile);
@@ -6419,7 +6508,7 @@ var PaintStrokeSession = (_class12 = class {
6419
6508
  writeTile: (tx, ty) => {
6420
6509
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty);
6421
6510
  if (!this.touched.has(key)) {
6422
- this.work.set(key, _nullishCoalesce(_optionalChain([read, 'call', _113 => _113(key), 'optionalAccess', _114 => _114.slice, 'call', _115 => _115()]), () => ( new Float32Array(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4))));
6511
+ this.work.set(key, _nullishCoalesce(_optionalChain([read, 'call', _115 => _115(key), 'optionalAccess', _116 => _116.slice, 'call', _117 => _117()]), () => ( new Float32Array(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4))));
6423
6512
  this.touched.add(key);
6424
6513
  }
6425
6514
  this.fresh.add(key);
@@ -6431,11 +6520,11 @@ var PaintStrokeSession = (_class12 = class {
6431
6520
  offset: a.offset,
6432
6521
  lockTransparency: a.lockTransparency,
6433
6522
  selection: a.selection,
6434
- readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.live, 'access', _117 => _117.get, 'call', _118 => _118(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _119 => _119.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
6523
+ readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _118 => _118.live, 'access', _119 => _119.get, 'call', _120 => _120(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _121 => _121.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
6435
6524
  writeTile: (tx, ty) => {
6436
6525
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty);
6437
6526
  if (!this.touched.has(key)) {
6438
- const src = _nullishCoalesce(_optionalChain([this, 'access', _120 => _120.base, 'access', _121 => _121.tiles, 'access', _122 => _122.get, 'call', _123 => _123(key), 'optionalAccess', _124 => _124.data]), () => ( defaultTile(this.base)));
6527
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _122 => _122.base, 'access', _123 => _123.tiles, 'access', _124 => _124.get, 'call', _125 => _125(key), 'optionalAccess', _126 => _126.data]), () => ( defaultTile(this.base)));
6439
6528
  this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
6440
6529
  this.touched.add(key);
6441
6530
  }
@@ -6452,11 +6541,11 @@ var PaintStrokeSession = (_class12 = class {
6452
6541
  if (this.closed || !points.length) return;
6453
6542
  if (!this.started) {
6454
6543
  this.started = true;
6455
- if (_optionalChain([this, 'access', _125 => _125.retouch, 'optionalAccess', _126 => _126.kind]) === "coverage") this.retouch.start(points[0]);
6544
+ if (_optionalChain([this, 'access', _127 => _127.retouch, 'optionalAccess', _128 => _128.kind]) === "coverage") this.retouch.start(points[0]);
6456
6545
  }
6457
6546
  this.last = points[points.length - 1];
6458
6547
  const rects = this.mixer ? this.mixer.push(points) : this.stroke.push(points);
6459
- _optionalChain([this, 'access', _127 => _127.flushView, 'optionalCall', _128 => _128()]);
6548
+ _optionalChain([this, 'access', _129 => _129.flushView, 'optionalCall', _130 => _130()]);
6460
6549
  this.update(rects);
6461
6550
  }
6462
6551
  update(rects) {
@@ -6486,7 +6575,7 @@ var PaintStrokeSession = (_class12 = class {
6486
6575
  for (const [key, { tx, ty, r }] of regions) {
6487
6576
  if (this.deep) {
6488
6577
  const rt = this.retouch;
6489
- const paint = _optionalChain([rt, 'optionalAccess', _129 => _129.kind]) === "coverage" ? rt.paint() : null;
6578
+ const paint = _optionalChain([rt, 'optionalAccess', _131 => _131.kind]) === "coverage" ? rt.paint() : null;
6490
6579
  if (paint && paint.kind !== "tone") {
6491
6580
  const prevWork = this.touched.has(key) ? this.work.get(key) : void 0;
6492
6581
  this.touched.add(key);
@@ -6497,13 +6586,13 @@ var PaintStrokeSession = (_class12 = class {
6497
6586
  const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
6498
6587
  this.touched.add(key);
6499
6588
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
6500
- const d = _optionalChain([rt, 'optionalAccess', _130 => _130.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _131 => _131.kind]) === "tone" ? _chunk7NW46N7Icjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkEBDCRTZIcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
6589
+ const d = _optionalChain([rt, 'optionalAccess', _132 => _132.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _133 => _133.kind]) === "tone" ? _chunk7NW46N7Icjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkEBDCRTZIcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
6501
6590
  this.liveDeep.set(key, d);
6502
6591
  this.live.set(key, { data: _chunkCWM3CUUXcjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
6503
6592
  continue;
6504
6593
  }
6505
- const src = _nullishCoalesce(_optionalChain([this, 'access', _132 => _132.base, 'access', _133 => _133.tiles, 'access', _134 => _134.get, 'call', _135 => _135(key), 'optionalAccess', _136 => _136.data]), () => ( defaultTile(this.base)));
6506
- const prev = this.touched.has(key) ? _optionalChain([this, 'access', _137 => _137.live, 'access', _138 => _138.get, 'call', _139 => _139(key), 'optionalAccess', _140 => _140.data]) : void 0;
6594
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _134 => _134.base, 'access', _135 => _135.tiles, 'access', _136 => _136.get, 'call', _137 => _137(key), 'optionalAccess', _138 => _138.data]), () => ( defaultTile(this.base)));
6595
+ const prev = this.touched.has(key) ? _optionalChain([this, 'access', _139 => _139.live, 'access', _140 => _140.get, 'call', _141 => _141(key), 'optionalAccess', _142 => _142.data]) : void 0;
6507
6596
  this.touched.add(key);
6508
6597
  const data = this.compositeTile(src, tx, ty, prev ? { into: prev, region: r } : {});
6509
6598
  this.live.set(key, { data, uniform: null });
@@ -6515,12 +6604,12 @@ var PaintStrokeSession = (_class12 = class {
6515
6604
  if (this.closed) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("This stroke has already ended.");
6516
6605
  const last = _nullishCoalesce(this.last, () => ( void 0));
6517
6606
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
6518
- _optionalChain([this, 'access', _141 => _141.flushView, 'optionalCall', _142 => _142()]);
6607
+ _optionalChain([this, 'access', _143 => _143.flushView, 'optionalCall', _144 => _144()]);
6519
6608
  this.update(rects);
6520
6609
  this.closed = true;
6521
6610
  const ch = this.base.channels;
6522
6611
  const r = this.retouch;
6523
- if (_optionalChain([r, 'optionalAccess', _143 => _143.kind]) === "coverage" && r.finalPaint) {
6612
+ if (_optionalChain([r, 'optionalAccess', _145 => _145.kind]) === "coverage" && r.finalPaint) {
6524
6613
  const final = r.finalPaint(this.stroke.coverage);
6525
6614
  if (final) {
6526
6615
  for (const key of this.touched) {
@@ -6529,7 +6618,7 @@ var PaintStrokeSession = (_class12 = class {
6529
6618
  this.retouchDeepTile(key, tx, ty, final, {});
6530
6619
  continue;
6531
6620
  }
6532
- const src = _nullishCoalesce(_optionalChain([this, 'access', _144 => _144.base, 'access', _145 => _145.tiles, 'access', _146 => _146.get, 'call', _147 => _147(key), 'optionalAccess', _148 => _148.data]), () => ( defaultTile(this.base)));
6621
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _146 => _146.base, 'access', _147 => _147.tiles, 'access', _148 => _148.get, 'call', _149 => _149(key), 'optionalAccess', _150 => _150.data]), () => ( defaultTile(this.base)));
6533
6622
  this.live.set(key, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
6534
6623
  }
6535
6624
  }
@@ -6551,7 +6640,7 @@ var PaintStrokeSession = (_class12 = class {
6551
6640
  const b = this.mixer ? this.mixer.bounds : this.stroke.coverage.bounds;
6552
6641
  const result = { layerId: this.target.id, channel: this.target.channel, bounds: changed ? b : null, dabs: (_nullishCoalesce(this.mixer, () => ( this.stroke))).dabCount };
6553
6642
  if (mixerLoad) result.mixerLoad = mixerLoad;
6554
- if (_optionalChain([r, 'optionalAccess', _149 => _149.result])) Object.assign(result, r.result());
6643
+ if (_optionalChain([r, 'optionalAccess', _151 => _151.result])) Object.assign(result, r.result());
6555
6644
  return result;
6556
6645
  }
6557
6646
  /** Abandons the stroke and restores the layer. */
@@ -6677,14 +6766,14 @@ function migrateSerializedImageEditorState(data) {
6677
6766
  const legacy = data;
6678
6767
  const adjustments = normalizeStoredAdjustments(legacy.adjustments);
6679
6768
  return {
6680
- version: _optionalChain([adjustments, 'access', _150 => _150.layers, 'optionalAccess', _151 => _151.length]) ? 2 : 1,
6769
+ version: _optionalChain([adjustments, 'access', _152 => _152.layers, 'optionalAccess', _153 => _153.length]) ? 2 : 1,
6681
6770
  crop: legacy.crop ? { ...legacy.crop } : null,
6682
6771
  transform: { ...DEFAULT_TRANSFORM, ...legacy.transform },
6683
6772
  adjustments: serializeAdjustments(adjustments),
6684
6773
  depthMask: {
6685
6774
  ...DEFAULT_DEPTH_MASK,
6686
6775
  ...legacy.depthMask,
6687
- depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _152 => _152.depthMask, 'optionalAccess', _153 => _153.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
6776
+ depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _154 => _154.depthMask, 'optionalAccess', _155 => _155.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
6688
6777
  },
6689
6778
  annotations: JSON.parse(JSON.stringify(_nullishCoalesce(legacy.annotations, () => ( [])))),
6690
6779
  ...legacy.selection ? { selection: { ...legacy.selection } } : {}
@@ -6760,7 +6849,7 @@ var ImageEditorController = (_class13 = class {
6760
6849
  sourceIsOpaque: () => this.sourceIsOpaque(),
6761
6850
  version: () => `${this.sourceVersion()}:${this.patternsVersion()}`,
6762
6851
  globalLight: () => this.state.globalLight,
6763
- pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _154 => _154.state, 'access', _155 => _155.patterns, 'optionalAccess', _156 => _156.find, 'call', _157 => _157((p) => p.id === id)]), () => ( null))
6852
+ pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _156 => _156.state, 'access', _157 => _157.patterns, 'optionalAccess', _158 => _158.find, 'call', _159 => _159((p) => p.id === id)]), () => ( null))
6764
6853
  };
6765
6854
  this.state = {
6766
6855
  sourceUrl: typeof options.image === "string" ? options.image : null,
@@ -6793,13 +6882,13 @@ var ImageEditorController = (_class13 = class {
6793
6882
  };
6794
6883
  }
6795
6884
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
6796
- if (_optionalChain([options, 'access', _158 => _158.initialState, 'optionalAccess', _159 => _159.selection])) {
6885
+ if (_optionalChain([options, 'access', _160 => _160.initialState, 'optionalAccess', _161 => _161.selection])) {
6797
6886
  try {
6798
6887
  this.state.selection = normalizeSelection(_chunkUYXL6ZWQcjs.deserializeSelection.call(void 0, options.initialState.selection));
6799
6888
  } catch (e20) {
6800
6889
  }
6801
6890
  }
6802
- if (_optionalChain([options, 'access', _160 => _160.initialState, 'optionalAccess', _161 => _161.channels])) {
6891
+ if (_optionalChain([options, 'access', _162 => _162.initialState, 'optionalAccess', _163 => _163.channels])) {
6803
6892
  const channels = deserializeChannels(options.initialState.channels, this.naturalSize, this.lastLoadProblems);
6804
6893
  if (channels.length) this.state.channels = channels;
6805
6894
  }
@@ -6883,7 +6972,7 @@ var ImageEditorController = (_class13 = class {
6883
6972
  this.syncViews();
6884
6973
  this.syncDisplay();
6885
6974
  const currentState = { ...this.state };
6886
- _optionalChain([this, 'access', _162 => _162.onStateChange, 'optionalCall', _163 => _163(currentState)]);
6975
+ _optionalChain([this, 'access', _164 => _164.onStateChange, 'optionalCall', _165 => _165(currentState)]);
6887
6976
  this.listeners.forEach((l) => l(currentState));
6888
6977
  if (this.effects.provider) this.queueEffectRefresh("incomplete");
6889
6978
  }
@@ -6912,7 +7001,7 @@ var ImageEditorController = (_class13 = class {
6912
7001
  if (l.type === "group") {
6913
7002
  const children = walk(l.children);
6914
7003
  if (children !== l.children) next2 = { ...l, children };
6915
- } else if (l.type === "smart" && _optionalChain([l, 'access', _164 => _164.smartFilters, 'optionalAccess', _165 => _165.filters, 'access', _166 => _166.some, 'call', _167 => _167((f) => f.kind === "effect")]) && (all || _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
7004
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _166 => _166.smartFilters, 'optionalAccess', _167 => _167.filters, 'access', _168 => _168.some, 'call', _169 => _169((f) => f.kind === "effect")]) && (all || _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
6916
7005
  try {
6917
7006
  const r = _chunkUYXL6ZWQcjs.rerender.call(void 0, l, canvas);
6918
7007
  if (all || !_chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
@@ -7008,8 +7097,8 @@ var ImageEditorController = (_class13 = class {
7008
7097
  */
7009
7098
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
7010
7099
  const layer = _chunkUYXL6ZWQcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
7011
- const was = _optionalChain([layer, 'access', _168 => _168.smartFilters, 'optionalAccess', _169 => _169.filters, 'access', _170 => _170.find, 'call', _171 => _171((f) => f.id === filterId)]);
7012
- if (!was || was.kind !== "effect") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _172 => _172.smartFilters, 'optionalAccess', _173 => _173.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
7100
+ const was = _optionalChain([layer, 'access', _170 => _170.smartFilters, 'optionalAccess', _171 => _171.filters, 'access', _172 => _172.find, 'call', _173 => _173((f) => f.id === filterId)]);
7101
+ if (!was || was.kind !== "effect") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _174 => _174.smartFilters, 'optionalAccess', _175 => _175.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
7013
7102
  const update = {};
7014
7103
  if (changes.values) {
7015
7104
  const d = await this.describeEffect(was.effect);
@@ -7051,7 +7140,7 @@ var ImageEditorController = (_class13 = class {
7051
7140
  const layer = {
7052
7141
  type: "pixel",
7053
7142
  id,
7054
- name: _optionalChain([options, 'access', _174 => _174.name, 'optionalAccess', _175 => _175.trim, 'call', _176 => _176()]) || d.name,
7143
+ name: _optionalChain([options, 'access', _176 => _176.name, 'optionalAccess', _177 => _177.trim, 'call', _178 => _178()]) || d.name,
7055
7144
  visible: true,
7056
7145
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
7057
7146
  blend: _nullishCoalesce(blend, () => ( "normal")),
@@ -7076,7 +7165,7 @@ var ImageEditorController = (_class13 = class {
7076
7165
  */
7077
7166
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
7078
7167
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
7079
- const layer = _optionalChain([found, 'optionalAccess', _177 => _177.layer]);
7168
+ const layer = _optionalChain([found, 'optionalAccess', _179 => _179.layer]);
7080
7169
  if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
7081
7170
  _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
7082
7171
  const g = layer.generator;
@@ -7105,7 +7194,7 @@ var ImageEditorController = (_class13 = class {
7105
7194
  * and how long it runs, the longest of theirs (ms). Null when none animates.
7106
7195
  */
7107
7196
  getAnimation() {
7108
- const layers = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" && l.visible && !!_optionalChain([l, 'access', _178 => _178.generator, 'optionalAccess', _179 => _179.animate]));
7197
+ const layers = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" && l.visible && !!_optionalChain([l, 'access', _180 => _180.generator, 'optionalAccess', _181 => _181.animate]));
7109
7198
  if (!layers.length) return null;
7110
7199
  return { duration: Math.max(...layers.map((l) => l.generator.animate.duration)), layerIds: layers.map((l) => l.id) };
7111
7200
  }
@@ -7122,7 +7211,7 @@ var ImageEditorController = (_class13 = class {
7122
7211
  const { width, height } = this.naturalSize;
7123
7212
  const surfaces = /* @__PURE__ */ new Map();
7124
7213
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
7125
- if (l.type !== "pixel" || !l.visible || !_optionalChain([l, 'access', _180 => _180.generator, 'optionalAccess', _181 => _181.animate])) continue;
7214
+ if (l.type !== "pixel" || !l.visible || !_optionalChain([l, 'access', _182 => _182.generator, 'optionalAccess', _183 => _183.animate])) continue;
7126
7215
  const g = l.generator;
7127
7216
  const pixels = await this.effectsEngine.renderLayer(g.effect, g.values, { width, height, depth: this.bitDepth, time: (_nullishCoalesce(g.time, () => ( 0))) + time });
7128
7217
  surfaces.set(l.id, effectPixelsToSurface(pixels, this.bitDepth));
@@ -7183,7 +7272,7 @@ var ImageEditorController = (_class13 = class {
7183
7272
  transform: { ...s.transform },
7184
7273
  outputOpacity: s.outputOpacity,
7185
7274
  selection: _nullishCoalesce(s.selection, () => ( null)),
7186
- ..._optionalChain([s, 'access', _182 => _182.channels, 'optionalAccess', _183 => _183.length]) ? { channels: s.channels } : {},
7275
+ ..._optionalChain([s, 'access', _184 => _184.channels, 'optionalAccess', _185 => _185.length]) ? { channels: s.channels } : {},
7187
7276
  source: {
7188
7277
  sourceUrl: s.sourceUrl,
7189
7278
  element: this.imageElement,
@@ -7219,7 +7308,7 @@ var ImageEditorController = (_class13 = class {
7219
7308
  if (entry.colorMode) s.colorMode = entry.colorMode;
7220
7309
  else delete s.colorMode;
7221
7310
  s.selection = entry.selection;
7222
- if (_optionalChain([entry, 'access', _184 => _184.channels, 'optionalAccess', _185 => _185.length])) s.channels = entry.channels;
7311
+ if (_optionalChain([entry, 'access', _186 => _186.channels, 'optionalAccess', _187 => _187.length])) s.channels = entry.channels;
7223
7312
  else delete s.channels;
7224
7313
  if (this.imageElement !== entry.source.element && !this.samplePixelsOverride) this.samplePixels = null;
7225
7314
  this.imageElement = entry.source.element;
@@ -7426,7 +7515,7 @@ var ImageEditorController = (_class13 = class {
7426
7515
  return this.state.layers;
7427
7516
  }
7428
7517
  getLayer(id) {
7429
- return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _186 => _186.layer]);
7518
+ return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _188 => _188.layer]);
7430
7519
  }
7431
7520
  /** The active layer, or `undefined`. */
7432
7521
  getActiveLayer() {
@@ -7439,7 +7528,7 @@ var ImageEditorController = (_class13 = class {
7439
7528
  setActiveLayer(id, target = "pixels") {
7440
7529
  if (id !== null && !this.getLayer(id)) return false;
7441
7530
  const layer = id ? this.getLayer(id) : void 0;
7442
- const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _187 => _187.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _188 => _188.type]) === "smart" && _optionalChain([layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.mask]) ? "filter-mask" : "pixels";
7531
+ const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _189 => _189.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _190 => _190.type]) === "smart" && _optionalChain([layer, 'access', _191 => _191.smartFilters, 'optionalAccess', _192 => _192.mask]) ? "filter-mask" : "pixels";
7443
7532
  if (this.state.activeLayerId === id && this.state.activeTarget === t) return true;
7444
7533
  this.state.activeLayerId = id;
7445
7534
  this.state.activeTarget = t;
@@ -7601,7 +7690,7 @@ var ImageEditorController = (_class13 = class {
7601
7690
  surfaceOf: (l) => this.surfaceOf(l),
7602
7691
  version: `${this.sourceVersion()}:${this.patternsVersion()}`,
7603
7692
  globalLight: this.state.globalLight,
7604
- pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _191 => _191.state, 'access', _192 => _192.patterns, 'optionalAccess', _193 => _193.find, 'call', _194 => _194((p) => p.id === id)]), () => ( null))
7693
+ pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _193 => _193.state, 'access', _194 => _194.patterns, 'optionalAccess', _195 => _195.find, 'call', _196 => _196((p) => p.id === id)]), () => ( null))
7605
7694
  };
7606
7695
  }
7607
7696
  __init95() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
@@ -7678,7 +7767,7 @@ var ImageEditorController = (_class13 = class {
7678
7767
  if (!ctx || typeof ctx.getImageData !== "function") return null;
7679
7768
  ctx.drawImage(el, 0, 0, width, height);
7680
7769
  const data = ctx.getImageData(0, 0, width, height);
7681
- if (!_optionalChain([data, 'optionalAccess', _195 => _195.data]) || data.data.length < width * height * 4) return null;
7770
+ if (!_optionalChain([data, 'optionalAccess', _197 => _197.data]) || data.data.length < width * height * 4) return null;
7682
7771
  return { width, height, data: data.data };
7683
7772
  } catch (e24) {
7684
7773
  return null;
@@ -7691,7 +7780,7 @@ var ImageEditorController = (_class13 = class {
7691
7780
  const prev = this.state.layers;
7692
7781
  const depth = this.bitDepth;
7693
7782
  this.state.layers = next;
7694
- _optionalChain([extra, 'optionalCall', _196 => _196()]);
7783
+ _optionalChain([extra, 'optionalCall', _198 => _198()]);
7695
7784
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
7696
7785
  if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
7697
7786
  this.state.activeLayerId = _chunkUYXL6ZWQcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
@@ -7729,7 +7818,7 @@ var ImageEditorController = (_class13 = class {
7729
7818
  const layer = {
7730
7819
  type: "pixel",
7731
7820
  id: init.id && !ids.has(init.id) ? init.id : _chunkUYXL6ZWQcjs.newLayerId.call(void 0, ),
7732
- name: _optionalChain([init, 'access', _197 => _197.name, 'optionalAccess', _198 => _198.trim, 'call', _199 => _199()]) || this.nextLayerName(),
7821
+ name: _optionalChain([init, 'access', _199 => _199.name, 'optionalAccess', _200 => _200.trim, 'call', _201 => _201()]) || this.nextLayerName(),
7733
7822
  visible: _nullishCoalesce(init.visible, () => ( true)),
7734
7823
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
7735
7824
  blend: _nullishCoalesce(blend, () => ( "normal")),
@@ -7756,7 +7845,7 @@ var ImageEditorController = (_class13 = class {
7756
7845
  async decodeImage(image) {
7757
7846
  const trimmed = image.trim();
7758
7847
  let png = null;
7759
- if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _200 => _200.bytes]), () => ( null));
7848
+ if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _202 => _202.bytes]), () => ( null));
7760
7849
  else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
7761
7850
  try {
7762
7851
  const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, trimmed);
@@ -7805,7 +7894,7 @@ var ImageEditorController = (_class13 = class {
7805
7894
  removeLayer(id) {
7806
7895
  const next = _chunkUYXL6ZWQcjs.removeLayer.call(void 0, this.state.layers, id);
7807
7896
  this.commitLayers(next, () => {
7808
- if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _201 => _201.id]) === this.state.selectedAnnotationId)) {
7897
+ if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _203 => _203.id]) === this.state.selectedAnnotationId)) {
7809
7898
  this.state.selectedAnnotationId = null;
7810
7899
  }
7811
7900
  });
@@ -7814,9 +7903,9 @@ var ImageEditorController = (_class13 = class {
7814
7903
  moveLayer(id, placement) {
7815
7904
  const next = _chunkUYXL6ZWQcjs.moveLayer.call(void 0, this.state.layers, id, placement);
7816
7905
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
7817
- if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)), index: loc.index };
7906
+ if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _204 => _204.parent, 'optionalAccess', _205 => _205.id]), () => ( null)), index: loc.index };
7818
7907
  this.commitLayers(next);
7819
- return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _204 => _204.parent, 'optionalAccess', _205 => _205.id]), () => ( null)), index: loc.index };
7908
+ return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _206 => _206.parent, 'optionalAccess', _207 => _207.id]), () => ( null)), index: loc.index };
7820
7909
  }
7821
7910
  /**
7822
7911
  * Changes name, visibility, opacity, fill, blend, clipping, locks or (groups) collapsed state, as
@@ -7833,7 +7922,7 @@ var ImageEditorController = (_class13 = class {
7833
7922
  const group = {
7834
7923
  type: "group",
7835
7924
  id: _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "group"),
7836
- name: _optionalChain([init, 'access', _206 => _206.name, 'optionalAccess', _207 => _207.trim, 'call', _208 => _208()]) || "Group",
7925
+ name: _optionalChain([init, 'access', _208 => _208.name, 'optionalAccess', _209 => _209.trim, 'call', _210 => _210()]) || "Group",
7837
7926
  visible: true,
7838
7927
  opacity: 1,
7839
7928
  blend,
@@ -7926,7 +8015,7 @@ var ImageEditorController = (_class13 = class {
7926
8015
  sel = this.layerTransparency(id);
7927
8016
  } else {
7928
8017
  const current = this.state.selection;
7929
- if (!_optionalChain([current, 'optionalAccess', _209 => _209.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
8018
+ if (!_optionalChain([current, 'optionalAccess', _211 => _211.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
7930
8019
  sel = from === "hide-selection" ? _chunkUYXL6ZWQcjs.invertSelection.call(void 0, current) : current;
7931
8020
  }
7932
8021
  mask = this.maskFromSelection(sel, props);
@@ -7957,7 +8046,7 @@ var ImageEditorController = (_class13 = class {
7957
8046
  const layer = _chunkUYXL6ZWQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7958
8047
  const name = layer.name || id;
7959
8048
  if (layer.type === "shape") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" is a shape layer, whose path already is its vector mask; change it with set_shape_component, or rasterize the layer first.`);
7960
- if (_optionalChain([layer, 'access', _210 => _210.mask, 'optionalAccess', _211 => _211.source])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which cannot be combined with a vector mask; remove the depth mask first.`);
8049
+ if (_optionalChain([layer, 'access', _212 => _212.mask, 'optionalAccess', _213 => _213.source])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which cannot be combined with a vector mask; remove the depth mask first.`);
7961
8050
  return layer;
7962
8051
  }
7963
8052
  requireVectorMask(id) {
@@ -7967,10 +8056,10 @@ var ImageEditorController = (_class13 = class {
7967
8056
  }
7968
8057
  /** Components from a path spec: `components`, or one `shape` / `subpaths`. */
7969
8058
  vectorMaskComponents(path) {
7970
- if (_optionalChain([path, 'access', _212 => _212.components, 'optionalAccess', _213 => _213.length]) && (path.shape !== void 0 || path.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
8059
+ if (_optionalChain([path, 'access', _214 => _214.components, 'optionalAccess', _215 => _215.length]) && (path.shape !== void 0 || path.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7971
8060
  if (path.fillRule !== void 0 && path.fillRule !== "nonzero" && path.fillRule !== "evenodd") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7972
- const specs = _optionalChain([path, 'access', _214 => _214.components, 'optionalAccess', _215 => _215.length]) ? path.components : [path];
7973
- return specs.map((c, i) => this.componentFrom(c, _optionalChain([path, 'access', _216 => _216.components, 'optionalAccess', _217 => _217.length]) ? `components[${i}].` : ""));
8061
+ const specs = _optionalChain([path, 'access', _216 => _216.components, 'optionalAccess', _217 => _217.length]) ? path.components : [path];
8062
+ return specs.map((c, i) => this.componentFrom(c, _optionalChain([path, 'access', _218 => _218.components, 'optionalAccess', _219 => _219.length]) ? `components[${i}].` : ""));
7974
8063
  }
7975
8064
  /**
7976
8065
  * Layer › Vector Mask: `reveal-all` (an empty path showing everything), `hide-all` (an empty path
@@ -7987,7 +8076,7 @@ var ImageEditorController = (_class13 = class {
7987
8076
  vm = { components: this.vectorMaskComponents(path) };
7988
8077
  if (path.fillRule === "evenodd") vm.fillRule = "evenodd";
7989
8078
  } else if (from === "reveal-all" || from === "hide-all") {
7990
- if (_optionalChain([path, 'access', _218 => _218.components, 'optionalAccess', _219 => _219.length]) || path.shape !== void 0 || path.subpaths !== void 0) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`A ${from} vector mask starts empty; use from path to give a path.`);
8079
+ if (_optionalChain([path, 'access', _220 => _220.components, 'optionalAccess', _221 => _221.length]) || path.shape !== void 0 || path.subpaths !== void 0) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`A ${from} vector mask starts empty; use from path to give a path.`);
7991
8080
  vm = { components: [], ...from === "reveal-all" ? { inverted: true } : {} };
7992
8081
  } else {
7993
8082
  throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Unknown vector mask source "${String(from)}". Use reveal-all, hide-all, path or selection.`);
@@ -7998,7 +8087,7 @@ var ImageEditorController = (_class13 = class {
7998
8087
  /** The selection's outline as subpaths; throws when nothing is selected or nothing is left to trace. */
7999
8088
  traceSelection(options) {
8000
8089
  const sel = this.state.selection;
8001
- if (!_optionalChain([sel, 'optionalAccess', _220 => _220.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then make a path from the selection.");
8090
+ if (!_optionalChain([sel, 'optionalAccess', _222 => _222.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then make a path from the selection.");
8002
8091
  if (options.tolerance !== void 0 && !(options.tolerance >= 0.1 && options.tolerance <= 10)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("tolerance must be from 0.1 to 10 px.");
8003
8092
  const subpaths = selectionToSubpaths(sel, options);
8004
8093
  if (!subpaths.length) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("The selection is too small or too faint to trace (below minArea, or under half selected); lower minArea or threshold.");
@@ -8179,7 +8268,7 @@ var ImageEditorController = (_class13 = class {
8179
8268
  const layer = loc.layer;
8180
8269
  if (layer.type !== "pixel") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
8181
8270
  const sel = this.state.selection;
8182
- if (!_optionalChain([sel, 'optionalAccess', _221 => _221.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
8271
+ if (!_optionalChain([sel, 'optionalAccess', _223 => _223.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
8183
8272
  if (options.cut) _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
8184
8273
  const surface = this.surfaceOf(layer);
8185
8274
  const sb = sel.bounds;
@@ -8197,14 +8286,14 @@ var ImageEditorController = (_class13 = class {
8197
8286
  const copy = {
8198
8287
  type: "pixel",
8199
8288
  id: _chunkUYXL6ZWQcjs.newLayerId.call(void 0, ),
8200
- name: _optionalChain([options, 'access', _222 => _222.name, 'optionalAccess', _223 => _223.trim, 'call', _224 => _224()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
8289
+ name: _optionalChain([options, 'access', _224 => _224.name, 'optionalAccess', _225 => _225.trim, 'call', _226 => _226()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
8201
8290
  visible: true,
8202
8291
  opacity: 1,
8203
8292
  blend: "normal",
8204
8293
  surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
8205
8294
  offset: { ...layer.offset }
8206
8295
  };
8207
- let next = _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _225 => _225.parent, 'optionalAccess', _226 => _226.id]), () => ( null)), loc.index + 1);
8296
+ let next = _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _227 => _227.parent, 'optionalAccess', _228 => _228.id]), () => ( null)), loc.index + 1);
8208
8297
  if (kept) {
8209
8298
  const cutLayer = { ...layer, surface: _chunkCWM3CUUXcjs.writeRegion.call(void 0, surface, src, kept) };
8210
8299
  delete cutLayer.source;
@@ -8228,7 +8317,7 @@ var ImageEditorController = (_class13 = class {
8228
8317
  layers: () => this.state.layers,
8229
8318
  activeLayerId: () => this.state.activeLayerId,
8230
8319
  activeTarget: () => this.state.activeTarget,
8231
- selection: () => _optionalChain([this, 'access', _227 => _227.state, 'access', _228 => _228.selection, 'optionalAccess', _229 => _229.bounds]) ? this.state.selection : null,
8320
+ selection: () => _optionalChain([this, 'access', _229 => _229.state, 'access', _230 => _230.selection, 'optionalAccess', _231 => _231.bounds]) ? this.state.selection : null,
8232
8321
  canvas: () => this.naturalSize,
8233
8322
  pixelsOf: (layer) => this.surfaceOf(layer),
8234
8323
  shapeEnv: () => this.shapeEnv(),
@@ -8376,7 +8465,7 @@ var ImageEditorController = (_class13 = class {
8376
8465
  * anything else nests as a layer document. Returns the smart object's id.
8377
8466
  */
8378
8467
  convertToSmartObject(ids, options = {}) {
8379
- const list = _optionalChain([ids, 'optionalAccess', _230 => _230.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
8468
+ const list = _optionalChain([ids, 'optionalAccess', _232 => _232.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
8380
8469
  if (!list.length) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
8381
8470
  const res = _chunkUYXL6ZWQcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
8382
8471
  this.commitLayers(res.layers, () => {
@@ -8409,8 +8498,8 @@ var ImageEditorController = (_class13 = class {
8409
8498
  width: c.width,
8410
8499
  height: c.height,
8411
8500
  decoded: _chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, c),
8412
- fileType: _nullishCoalesce(_optionalChain([c, 'access', _231 => _231.file, 'optionalAccess', _232 => _232.type]), () => ( null)),
8413
- linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _233 => _233.linked, 'optionalAccess', _234 => _234.path]), () => ( null)),
8501
+ fileType: _nullishCoalesce(_optionalChain([c, 'access', _233 => _233.file, 'optionalAccess', _234 => _234.type]), () => ( null)),
8502
+ linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _235 => _235.linked, 'optionalAccess', _236 => _236.path]), () => ( null)),
8414
8503
  instances: _chunkUYXL6ZWQcjs.instancesOf.call(void 0, this.state.layers, c.id),
8415
8504
  layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
8416
8505
  },
@@ -8427,9 +8516,9 @@ var ImageEditorController = (_class13 = class {
8427
8516
  bounds: _chunkUYXL6ZWQcjs.transformedBox.call(void 0, g)
8428
8517
  },
8429
8518
  smartFilters: {
8430
- enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _235 => _235.enabled]), () => ( true)),
8431
- filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _236 => _236.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
8432
- mask: _optionalChain([stack, 'optionalAccess', _237 => _237.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkCWM3CUUXcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
8519
+ enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _237 => _237.enabled]), () => ( true)),
8520
+ filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _238 => _238.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
8521
+ mask: _optionalChain([stack, 'optionalAccess', _239 => _239.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkCWM3CUUXcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
8433
8522
  },
8434
8523
  bounds: this.getLayerBounds(id)
8435
8524
  };
@@ -8568,7 +8657,7 @@ var ImageEditorController = (_class13 = class {
8568
8657
  * it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
8569
8658
  */
8570
8659
  maskFiltersWithSelection(id, useSelection) {
8571
- if (!useSelection || !_optionalChain([this, 'access', _238 => _238.state, 'access', _239 => _239.selection, 'optionalAccess', _240 => _240.bounds])) return false;
8660
+ if (!useSelection || !_optionalChain([this, 'access', _240 => _240.state, 'access', _241 => _241.selection, 'optionalAccess', _242 => _242.bounds])) return false;
8572
8661
  this.setSmartFilterMask(id, "selection", {}, false);
8573
8662
  return true;
8574
8663
  }
@@ -8582,19 +8671,19 @@ var ImageEditorController = (_class13 = class {
8582
8671
  removeSmartFilter(id, filterId) {
8583
8672
  const res = _chunkUYXL6ZWQcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
8584
8673
  this.commitLayers(res.layers);
8585
- return _nullishCoalesce(_optionalChain([res, 'access', _241 => _241.layer, 'access', _242 => _242.smartFilters, 'optionalAccess', _243 => _243.filters]), () => ( []));
8674
+ return _nullishCoalesce(_optionalChain([res, 'access', _243 => _243.layer, 'access', _244 => _244.smartFilters, 'optionalAccess', _245 => _245.filters]), () => ( []));
8586
8675
  }
8587
8676
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
8588
8677
  moveSmartFilter(id, filterId, index) {
8589
8678
  const res = _chunkUYXL6ZWQcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
8590
8679
  this.commitLayers(res.layers);
8591
- return _nullishCoalesce(_optionalChain([res, 'access', _244 => _244.layer, 'access', _245 => _245.smartFilters, 'optionalAccess', _246 => _246.filters]), () => ( []));
8680
+ return _nullishCoalesce(_optionalChain([res, 'access', _246 => _246.layer, 'access', _247 => _247.smartFilters, 'optionalAccess', _248 => _248.filters]), () => ( []));
8592
8681
  }
8593
8682
  /** Turns a smart object's whole filter stack on or off (one undo step). */
8594
8683
  setSmartFiltersEnabled(id, enabled) {
8595
8684
  const res = _chunkUYXL6ZWQcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
8596
8685
  this.commitLayers(res.layers);
8597
- return _nullishCoalesce(_optionalChain([res, 'access', _247 => _247.layer, 'access', _248 => _248.smartFilters, 'optionalAccess', _249 => _249.enabled]), () => ( true));
8686
+ return _nullishCoalesce(_optionalChain([res, 'access', _249 => _249.layer, 'access', _250 => _250.smartFilters, 'optionalAccess', _251 => _251.enabled]), () => ( true));
8598
8687
  }
8599
8688
  /**
8600
8689
  * Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
@@ -8606,11 +8695,11 @@ var ImageEditorController = (_class13 = class {
8606
8695
  let mask;
8607
8696
  if (from === "none") mask = null;
8608
8697
  else if (from === "keep") {
8609
- if (!_optionalChain([layer, 'access', _250 => _250.smartFilters, 'optionalAccess', _251 => _251.mask])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
8698
+ if (!_optionalChain([layer, 'access', _252 => _252.smartFilters, 'optionalAccess', _253 => _253.mask])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
8610
8699
  mask = withMaskProps(layer.smartFilters.mask, props);
8611
8700
  } else if (from === "selection") {
8612
8701
  const sel = this.state.selection;
8613
- if (!_optionalChain([sel, 'optionalAccess', _252 => _252.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
8702
+ if (!_optionalChain([sel, 'optionalAccess', _254 => _254.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
8614
8703
  mask = this.maskFromSelection(sel, props);
8615
8704
  } else {
8616
8705
  const v = from === "reveal-all" ? 255 : 0;
@@ -8622,7 +8711,7 @@ var ImageEditorController = (_class13 = class {
8622
8711
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
8623
8712
  else if (!mask && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
8624
8713
  }, commitToHistory);
8625
- return _nullishCoalesce(_optionalChain([res, 'access', _253 => _253.layer, 'access', _254 => _254.smartFilters, 'optionalAccess', _255 => _255.mask]), () => ( null));
8714
+ return _nullishCoalesce(_optionalChain([res, 'access', _255 => _255.layer, 'access', _256 => _256.smartFilters, 'optionalAccess', _257 => _257.mask]), () => ( null));
8626
8715
  }
8627
8716
  /**
8628
8717
  * Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
@@ -8670,7 +8759,7 @@ var ImageEditorController = (_class13 = class {
8670
8759
  if (this.getFreeTransform()) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
8671
8760
  const layer = _chunkUYXL6ZWQcjs.requireSmartObject.call(void 0, this.state.layers, id);
8672
8761
  const c = layer.contents;
8673
- if (!_chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _256 => _256.file, 'optionalAccess', _257 => _257.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
8762
+ if (!_chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _258 => _258.file, 'optionalAccess', _259 => _259.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
8674
8763
  const saved = {
8675
8764
  state: { ...this.state },
8676
8765
  undo: this.undoStack,
@@ -8701,9 +8790,9 @@ var ImageEditorController = (_class13 = class {
8701
8790
  editingContents: this.getEditingContents()
8702
8791
  };
8703
8792
  delete this.state.legacyOutputBlur;
8704
- if (_optionalChain([c, 'access', _258 => _258.document, 'optionalAccess', _259 => _259.globalLight])) this.state.globalLight = c.document.globalLight;
8793
+ if (_optionalChain([c, 'access', _260 => _260.document, 'optionalAccess', _261 => _261.globalLight])) this.state.globalLight = c.document.globalLight;
8705
8794
  else delete this.state.globalLight;
8706
- if (_optionalChain([c, 'access', _260 => _260.document, 'optionalAccess', _261 => _261.patterns, 'optionalAccess', _262 => _262.length])) this.state.patterns = c.document.patterns;
8795
+ if (_optionalChain([c, 'access', _262 => _262.document, 'optionalAccess', _263 => _263.patterns, 'optionalAccess', _264 => _264.length])) this.state.patterns = c.document.patterns;
8707
8796
  else delete this.state.patterns;
8708
8797
  this.imageElement = null;
8709
8798
  this.samplePixels = null;
@@ -8723,23 +8812,23 @@ var ImageEditorController = (_class13 = class {
8723
8812
  closeSmartObjectContents(save = true) {
8724
8813
  const top = this.contentsStack.pop();
8725
8814
  if (!top) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
8726
- if (_optionalChain([this, 'access', _263 => _263.openTransform, 'optionalAccess', _264 => _264.isOpen])) this.openTransform.cancel();
8815
+ if (_optionalChain([this, 'access', _265 => _265.openTransform, 'optionalAccess', _266 => _266.isOpen])) this.openTransform.cancel();
8727
8816
  this.openTransform = null;
8728
8817
  const edited = this.state;
8729
8818
  const changed = save && this.undoStack.length > 0;
8730
8819
  let next = null;
8731
8820
  if (changed) {
8732
- const layer = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _265 => _265.layer]);
8733
- const old = _optionalChain([layer, 'optionalAccess', _266 => _266.contents]);
8821
+ const layer = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _267 => _267.layer]);
8822
+ const old = _optionalChain([layer, 'optionalAccess', _268 => _268.contents]);
8734
8823
  const { width, height } = edited.imageDimensions;
8735
8824
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
8736
- const plain3 = _optionalChain([only, 'optionalAccess', _267 => _267.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _268 => _268.filters, 'optionalAccess', _269 => _269.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
8737
- if (_optionalChain([old, 'optionalAccess', _270 => _270.kind]) === "raster" && plain3) {
8825
+ const plain3 = _optionalChain([only, 'optionalAccess', _269 => _269.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _270 => _270.filters, 'optionalAccess', _271 => _271.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
8826
+ if (_optionalChain([old, 'optionalAccess', _272 => _272.kind]) === "raster" && plain3) {
8738
8827
  const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
8739
8828
  next = _chunkUYXL6ZWQcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
8740
8829
  } else {
8741
8830
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
8742
- next = _chunkUYXL6ZWQcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _271 => _271.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _272 => _272.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
8831
+ next = _chunkUYXL6ZWQcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _273 => _273.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _274 => _274.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
8743
8832
  }
8744
8833
  }
8745
8834
  const saved = top.saved;
@@ -8764,7 +8853,7 @@ var ImageEditorController = (_class13 = class {
8764
8853
  }
8765
8854
  /** The document's own layers (not the contents open for editing). */
8766
8855
  rootLayers() {
8767
- return _nullishCoalesce(_optionalChain([this, 'access', _273 => _273.contentsStack, 'access', _274 => _274[0], 'optionalAccess', _275 => _275.saved, 'access', _276 => _276.state, 'access', _277 => _277.layers]), () => ( this.state.layers));
8856
+ return _nullishCoalesce(_optionalChain([this, 'access', _275 => _275.contentsStack, 'access', _276 => _276[0], 'optionalAccess', _277 => _277.saved, 'access', _278 => _278.state, 'access', _279 => _279.layers]), () => ( this.state.layers));
8768
8857
  }
8769
8858
  /** Drops every open contents edit (loading another document). */
8770
8859
  abandonContents() {
@@ -8985,7 +9074,7 @@ var ImageEditorController = (_class13 = class {
8985
9074
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
8986
9075
  const key = `${tw}x${th}:${ox},${oy}`;
8987
9076
  let byKey = this.thumbCache.get(surface);
8988
- const hit = _optionalChain([byKey, 'optionalAccess', _278 => _278.get, 'call', _279 => _279(key)]);
9077
+ const hit = _optionalChain([byKey, 'optionalAccess', _280 => _280.get, 'call', _281 => _281(key)]);
8989
9078
  if (hit) return hit;
8990
9079
  const out = new Uint8ClampedArray(tw * th * 4);
8991
9080
  for (let y = 0; y < th; y++) {
@@ -9126,7 +9215,7 @@ var ImageEditorController = (_class13 = class {
9126
9215
  if (layer.mask.source) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
9127
9216
  _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "all", action);
9128
9217
  } else if (ch === "filter-mask") {
9129
- if (layer.type !== "smart" || !_optionalChain([layer, 'access', _280 => _280.smartFilters, 'optionalAccess', _281 => _281.mask])) {
9218
+ if (layer.type !== "smart" || !_optionalChain([layer, 'access', _282 => _282.smartFilters, 'optionalAccess', _283 => _283.mask])) {
9130
9219
  throw new (0, _chunkUYXL6ZWQcjs.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}.`);
9131
9220
  }
9132
9221
  if (!_chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkUYXL6ZWQcjs.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.`);
@@ -9141,7 +9230,7 @@ var ImageEditorController = (_class13 = class {
9141
9230
  if (!layer.visible) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
9142
9231
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
9143
9232
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
9144
- const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _282 => _282.locks, 'optionalAccess', _283 => _283.transparency]));
9233
+ const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _284 => _284.locks, 'optionalAccess', _285 => _285.transparency]));
9145
9234
  return { id, layer, channel: ch, offset, surface, lockTransparency };
9146
9235
  }
9147
9236
  /** The layer with its pixels (or mask) replaced by `surface`. */
@@ -9185,13 +9274,13 @@ var ImageEditorController = (_class13 = class {
9185
9274
  blend: target.channel !== "pixels" ? "normal" : brush.blend,
9186
9275
  lockTransparency: target.lockTransparency,
9187
9276
  // In Quick Mask mode the selection is what is painted, so it does not limit the stroke.
9188
- selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _284 => _284.state, 'access', _285 => _285.selection, 'optionalAccess', _286 => _286.bounds]) ? this.state.selection : null,
9277
+ selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _286 => _286.state, 'access', _287 => _287.selection, 'optionalAccess', _288 => _288.bounds]) ? this.state.selection : null,
9189
9278
  offset: target.offset
9190
9279
  };
9191
9280
  const depth = target.channel !== "filter-mask" && target.channel !== "quick-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
9192
9281
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
9193
9282
  if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
9194
- const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _287 => _287.type]) === "gradient" ? _chunkEBDCRTZIcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
9283
+ const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _289 => _289.type]) === "gradient" ? _chunkEBDCRTZIcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
9195
9284
  return new PaintStrokeSession(this, target, new (0, _chunkEBDCRTZIcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
9196
9285
  }
9197
9286
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
@@ -9238,9 +9327,9 @@ var ImageEditorController = (_class13 = class {
9238
9327
  const steps = settings.historySteps;
9239
9328
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
9240
9329
  if (!entry) throw new (0, _chunkUYXL6ZWQcjs.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.");
9241
- const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _288 => _288.layer]);
9330
+ const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _290 => _290.layer]);
9242
9331
  if (!then) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
9243
- const surface = target.channel === "mask" ? _optionalChain([then, 'access', _289 => _289.mask, 'optionalAccess', _290 => _290.surface]) : then.type === "pixel" ? then.surface : void 0;
9332
+ const surface = target.channel === "mask" ? _optionalChain([then, 'access', _291 => _291.mask, 'optionalAccess', _292 => _292.surface]) : then.type === "pixel" ? then.surface : void 0;
9244
9333
  if (!surface) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
9245
9334
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
9246
9335
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
@@ -9314,7 +9403,7 @@ var ImageEditorController = (_class13 = class {
9314
9403
  }
9315
9404
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
9316
9405
  surfaceSource(surface, offset) {
9317
- return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _291 => _291.tiles, 'access', _292 => _292.get, 'call', _293 => _293(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _294 => _294.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
9406
+ return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _293 => _293.tiles, 'access', _294 => _294.get, 'call', _295 => _295(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _296 => _296.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
9318
9407
  }
9319
9408
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
9320
9409
  compositeSource(throughId, depth = null) {
@@ -9390,7 +9479,7 @@ var ImageEditorController = (_class13 = class {
9390
9479
  paintStroke(init) {
9391
9480
  if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("points must hold at least one { x, y } point.");
9392
9481
  for (const p of init.points) {
9393
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _295 => _295.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _296 => _296.y]))) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
9482
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _297 => _297.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _298 => _298.y]))) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
9394
9483
  }
9395
9484
  const session = this.beginStroke(init);
9396
9485
  session.push(init.points);
@@ -9419,7 +9508,7 @@ var ImageEditorController = (_class13 = class {
9419
9508
  */
9420
9509
  strokeSelection(options) {
9421
9510
  const sel = this.state.selection;
9422
- if (!_optionalChain([sel, 'optionalAccess', _297 => _297.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
9511
+ if (!_optionalChain([sel, 'optionalAccess', _299 => _299.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
9423
9512
  const width = options.width;
9424
9513
  if (!(width > 0 && width <= 250)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
9425
9514
  const location = _nullishCoalesce(options.location, () => ( "outside"));
@@ -9436,7 +9525,7 @@ var ImageEditorController = (_class13 = class {
9436
9525
  */
9437
9526
  cropToSelection() {
9438
9527
  const sel = this.state.selection;
9439
- if (!_optionalChain([sel, 'optionalAccess', _298 => _298.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
9528
+ if (!_optionalChain([sel, 'optionalAccess', _300 => _300.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
9440
9529
  const crop = { ...sel.bounds };
9441
9530
  this.setCrop(crop);
9442
9531
  return crop;
@@ -9450,7 +9539,7 @@ var ImageEditorController = (_class13 = class {
9450
9539
  */
9451
9540
  contentAwareFill(options = {}) {
9452
9541
  const sel = this.state.selection;
9453
- if (!_optionalChain([sel, 'optionalAccess', _299 => _299.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
9542
+ if (!_optionalChain([sel, 'optionalAccess', _301 => _301.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
9454
9543
  if (this.bitDepth !== 8) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
9455
9544
  const output = _nullishCoalesce(options.output, () => ( "current"));
9456
9545
  if (output !== "current" && output !== "new-layer") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Unknown output "${String(output)}"; use current or new-layer.`);
@@ -9515,8 +9604,8 @@ var ImageEditorController = (_class13 = class {
9515
9604
  */
9516
9605
  copyPixels(options = {}) {
9517
9606
  const { width, height } = this.naturalSize;
9518
- const sel = _optionalChain([this, 'access', _300 => _300.state, 'access', _301 => _301.selection, 'optionalAccess', _302 => _302.bounds]) ? this.state.selection : null;
9519
- const rect = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _303 => _303.bounds]), () => ( { x: 0, y: 0, width, height }));
9607
+ const sel = _optionalChain([this, 'access', _302 => _302.state, 'access', _303 => _303.selection, 'optionalAccess', _304 => _304.bounds]) ? this.state.selection : null;
9608
+ const rect = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _305 => _305.bounds]), () => ( { x: 0, y: 0, width, height }));
9520
9609
  let data;
9521
9610
  if (options.merged) {
9522
9611
  data = new Uint8ClampedArray(this.compositePixels(rect).data);
@@ -9556,7 +9645,7 @@ var ImageEditorController = (_class13 = class {
9556
9645
  pastePixels(mode = "new-layer", image = this.clipboard) {
9557
9646
  if (!image) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
9558
9647
  if (!PASTE_MODES.includes(mode)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
9559
- const sel = _optionalChain([this, 'access', _304 => _304.state, 'access', _305 => _305.selection, 'optionalAccess', _306 => _306.bounds]) ? this.state.selection : null;
9648
+ const sel = _optionalChain([this, 'access', _306 => _306.state, 'access', _307 => _307.selection, 'optionalAccess', _308 => _308.bounds]) ? this.state.selection : null;
9560
9649
  if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
9561
9650
  const { width, height } = this.naturalSize;
9562
9651
  let x;
@@ -9565,7 +9654,7 @@ var ImageEditorController = (_class13 = class {
9565
9654
  x = image.x;
9566
9655
  y = image.y;
9567
9656
  } else {
9568
- const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _307 => _307.bounds]), () => ( { x: 0, y: 0, width, height }));
9657
+ const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _309 => _309.bounds]), () => ( { x: 0, y: 0, width, height }));
9569
9658
  x = Math.round(frame.x + (frame.width - image.width) / 2);
9570
9659
  y = Math.round(frame.y + (frame.height - image.height) / 2);
9571
9660
  }
@@ -9582,8 +9671,8 @@ var ImageEditorController = (_class13 = class {
9582
9671
  if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("opacity must be from 0 to 1.");
9583
9672
  const blend = _nullishCoalesce(_chunkUYXL6ZWQcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
9584
9673
  const quickMask = target.channel === "quick-mask";
9585
- const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _308 => _308.state, 'access', _309 => _309.selection, 'optionalAccess', _310 => _310.bounds]) ? this.state.selection : null)));
9586
- const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _311 => _311.bounds]), () => ( { x: 0, y: 0, width, height }));
9674
+ const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _310 => _310.state, 'access', _311 => _311.selection, 'optionalAccess', _312 => _312.bounds]) ? this.state.selection : null)));
9675
+ const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _313 => _313.bounds]), () => ( { x: 0, y: 0, width, height }));
9587
9676
  const coverage = new (0, _chunkEBDCRTZIcjs.CoverageMap)();
9588
9677
  const ones = new Float32Array(region.width * region.height);
9589
9678
  if (sel) {
@@ -9708,7 +9797,7 @@ var ImageEditorController = (_class13 = class {
9708
9797
  placeLayer(layers, node, where) {
9709
9798
  if (where.aboveId) {
9710
9799
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, where.aboveId);
9711
- if (loc) return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _312 => _312.parent, 'optionalAccess', _313 => _313.id]), () => ( null)), loc.index + 1);
9800
+ if (loc) return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _314 => _314.parent, 'optionalAccess', _315 => _315.id]), () => ( null)), loc.index + 1);
9712
9801
  }
9713
9802
  if (where.parentId) {
9714
9803
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, where.parentId);
@@ -9719,11 +9808,11 @@ var ImageEditorController = (_class13 = class {
9719
9808
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
9720
9809
  if (at < nodes.length) {
9721
9810
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, nodes[at].id);
9722
- return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _314 => _314.parent, 'optionalAccess', _315 => _315.id]), () => ( null)), loc.index);
9811
+ return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _316 => _316.parent, 'optionalAccess', _317 => _317.id]), () => ( null)), loc.index);
9723
9812
  }
9724
9813
  if (nodes.length) {
9725
9814
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
9726
- return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _316 => _316.parent, 'optionalAccess', _317 => _317.id]), () => ( null)), loc.index + 1);
9815
+ return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _318 => _318.parent, 'optionalAccess', _319 => _319.id]), () => ( null)), loc.index + 1);
9727
9816
  }
9728
9817
  }
9729
9818
  return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
@@ -9762,7 +9851,7 @@ var ImageEditorController = (_class13 = class {
9762
9851
  enabled: spec.enabled,
9763
9852
  opacity: spec.opacity,
9764
9853
  blend: spec.blend,
9765
- mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _318 => _318.state, 'access', _319 => _319.selection, 'optionalAccess', _320 => _320.bounds]) ? _chunkUYXL6ZWQcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
9854
+ mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _320 => _320.state, 'access', _321 => _321.selection, 'optionalAccess', _322 => _322.bounds]) ? _chunkUYXL6ZWQcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
9766
9855
  });
9767
9856
  while (ids.has(layer.id)) layer.id = _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "adj");
9768
9857
  const { width, height } = this.naturalSize;
@@ -9839,7 +9928,7 @@ var ImageEditorController = (_class13 = class {
9839
9928
  const anchor = nodes[to];
9840
9929
  const without = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, id, () => null);
9841
9930
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, without, anchor.id);
9842
- return _chunkHGTDMKNEcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _321 => _321.parent, 'optionalAccess', _322 => _322.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
9931
+ return _chunkHGTDMKNEcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _323 => _323.parent, 'optionalAccess', _324 => _324.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
9843
9932
  }
9844
9933
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
9845
9934
  moveAdjustmentLayer(id, toIndex) {
@@ -9880,7 +9969,7 @@ var ImageEditorController = (_class13 = class {
9880
9969
  return _nullishCoalesce(this.state.selection, () => ( null));
9881
9970
  }
9882
9971
  get hasSelection() {
9883
- return Boolean(_optionalChain([this, 'access', _323 => _323.state, 'access', _324 => _324.selection, 'optionalAccess', _325 => _325.bounds]));
9972
+ return Boolean(_optionalChain([this, 'access', _325 => _325.state, 'access', _326 => _326.selection, 'optionalAccess', _327 => _327.bounds]));
9884
9973
  }
9885
9974
  /** Returns the current canvas (composition) dimensions. */
9886
9975
  getCanvasSize() {
@@ -9972,7 +10061,7 @@ var ImageEditorController = (_class13 = class {
9972
10061
  const prev = normalizeSelection(_nullishCoalesce(this.state.selection, () => ( null)));
9973
10062
  if (prev === next || prev && next && sameSelection(prev, next)) return false;
9974
10063
  this.recordHistory();
9975
- if (!next && _optionalChain([prev, 'optionalAccess', _326 => _326.bounds])) this.lastSelection = prev;
10064
+ if (!next && _optionalChain([prev, 'optionalAccess', _328 => _328.bounds])) this.lastSelection = prev;
9976
10065
  this.state.selection = next;
9977
10066
  this.notify();
9978
10067
  return true;
@@ -10015,14 +10104,14 @@ var ImageEditorController = (_class13 = class {
10015
10104
  /** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
10016
10105
  async growSelection(options = {}) {
10017
10106
  const sel = this.state.selection;
10018
- if (!_optionalChain([sel, 'optionalAccess', _327 => _327.bounds])) return false;
10107
+ if (!_optionalChain([sel, 'optionalAccess', _329 => _329.bounds])) return false;
10019
10108
  const pixels = await this.requirePixels(options);
10020
10109
  return this.setSelection(growSelection(pixels, sel, options));
10021
10110
  }
10022
10111
  /** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
10023
10112
  async selectSimilar(options = {}) {
10024
10113
  const sel = this.state.selection;
10025
- if (!_optionalChain([sel, 'optionalAccess', _328 => _328.bounds])) return false;
10114
+ if (!_optionalChain([sel, 'optionalAccess', _330 => _330.bounds])) return false;
10026
10115
  const pixels = await this.requirePixels(options);
10027
10116
  return this.setSelection(selectSimilar(pixels, sel, options));
10028
10117
  }
@@ -10123,7 +10212,7 @@ var ImageEditorController = (_class13 = class {
10123
10212
  const { width, height } = this.naturalSize;
10124
10213
  const image = await this.toDataURL({ format: "image/png" });
10125
10214
  const results = await provider.segment({ ...request, image, width, height });
10126
- _optionalChain([request, 'access', _329 => _329.signal, 'optionalAccess', _330 => _330.throwIfAborted, 'call', _331 => _331()]);
10215
+ _optionalChain([request, 'access', _331 => _331.signal, 'optionalAccess', _332 => _332.throwIfAborted, 'call', _333 => _333()]);
10127
10216
  const decoded = [];
10128
10217
  for (const r of _nullishCoalesce(results, () => ( []))) decoded.push({ ...r, mask: r.mask !== void 0 ? await this.decodeMaskImage(r.mask) : void 0 });
10129
10218
  return decoded;
@@ -10140,7 +10229,7 @@ var ImageEditorController = (_class13 = class {
10140
10229
  let union = null;
10141
10230
  for (const r of decoded) {
10142
10231
  const one = segmentsToSelection(width, height, [r]);
10143
- if (!_optionalChain([one, 'optionalAccess', _332 => _332.bounds])) continue;
10232
+ if (!_optionalChain([one, 'optionalAccess', _334 => _334.bounds])) continue;
10144
10233
  if ("rect" in target) {
10145
10234
  const r0 = target.rect;
10146
10235
  const grow = 0.1 * Math.max(r0.width, r0.height);
@@ -10204,7 +10293,7 @@ var ImageEditorController = (_class13 = class {
10204
10293
  if (this.segmentation && options.useModel !== false) {
10205
10294
  const { width, height } = this.naturalSize;
10206
10295
  const sky = segmentsToSelection(width, height, await this.modelSegments({ target: "the sky", signal: options.signal }));
10207
- if (!_optionalChain([sky, 'optionalAccess', _333 => _333.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
10296
+ if (!_optionalChain([sky, 'optionalAccess', _335 => _335.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
10208
10297
  this.setSelection(sky, _nullishCoalesce(options.mode, () => ( "replace")));
10209
10298
  return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model" };
10210
10299
  }
@@ -10235,7 +10324,7 @@ var ImageEditorController = (_class13 = class {
10235
10324
  try {
10236
10325
  const canvas = await this.renderSource();
10237
10326
  const ctx = canvas.getContext("2d");
10238
- const data2 = _optionalChain([ctx, 'optionalAccess', _334 => _334.getImageData, 'optionalCall', _335 => _335(0, 0, width, height)]);
10327
+ const data2 = _optionalChain([ctx, 'optionalAccess', _336 => _336.getImageData, 'optionalCall', _337 => _337(0, 0, width, height)]);
10239
10328
  if (data2 && data2.data && data2.data.length >= width * height * 4) {
10240
10329
  base = { width, height, data: data2.data };
10241
10330
  this.samplePixels = base;
@@ -10310,7 +10399,7 @@ var ImageEditorController = (_class13 = class {
10310
10399
  /** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
10311
10400
  modifySelection(op, radius) {
10312
10401
  const sel = this.state.selection;
10313
- if (!_optionalChain([sel, 'optionalAccess', _336 => _336.bounds])) return false;
10402
+ if (!_optionalChain([sel, 'optionalAccess', _338 => _338.bounds])) return false;
10314
10403
  return this.setSelection(_chunkUYXL6ZWQcjs.modifySelection.call(void 0, sel, op, radius));
10315
10404
  }
10316
10405
  /**
@@ -10319,7 +10408,7 @@ var ImageEditorController = (_class13 = class {
10319
10408
  */
10320
10409
  async refineSelection(params, options = {}) {
10321
10410
  const sel = this.state.selection;
10322
- if (!_optionalChain([sel, 'optionalAccess', _337 => _337.bounds])) return false;
10411
+ if (!_optionalChain([sel, 'optionalAccess', _339 => _339.bounds])) return false;
10323
10412
  const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
10324
10413
  return this.setSelection(refineSelection(pixels, sel, params));
10325
10414
  }
@@ -10332,10 +10421,19 @@ var ImageEditorController = (_class13 = class {
10332
10421
  * - `new-layer-with-mask`: a copy of the layer masked by the selection, the source hidden.
10333
10422
  * `decontaminate` (0..100, new-layer outputs only) replaces the old background's colour in the
10334
10423
  * soft edge with the subject's own (see `decontaminateColors`).
10424
+ *
10425
+ * `edits` are the workspace's strokes, applied first in order (Quick Selection, Brush and
10426
+ * Refine Edge Brush; see `RefineEdit`); with them, an empty selection is a valid start.
10427
+ * `refineMode: 'object'` asks the segmentation provider for the object in the selection's
10428
+ * bounds and refines from its outline, kept to near the selection's edge.
10335
10429
  */
10336
10430
  async refineSelectionTo(params, output = "selection", options = {}) {
10337
- const sel = this.state.selection;
10338
- if (!_optionalChain([sel, 'optionalAccess', _338 => _338.bounds])) throw new Error("Nothing is selected; select first.");
10431
+ const edits = _nullishCoalesce(options.edits, () => ( []));
10432
+ const refineMode = _nullishCoalesce(options.refineMode, () => ( "color"));
10433
+ if (!_optionalChain([this, 'access', _340 => _340.state, 'access', _341 => _341.selection, 'optionalAccess', _342 => _342.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
10434
+ if (refineMode === "object" && !this.segmentation) {
10435
+ throw new Error("Object aware refinement needs a segmentation model (setSegmentationProvider); use refineMode color.");
10436
+ }
10339
10437
  const amount = Math.min(100, Math.max(0, _nullishCoalesce(options.decontaminate, () => ( 0)))) / 100;
10340
10438
  const toLayer = output === "new-layer" || output === "new-layer-with-mask";
10341
10439
  if (amount > 0 && !toLayer) throw new Error("Decontaminate colors writes the cleaned colours to a new layer: use output new-layer or new-layer-with-mask.");
@@ -10346,16 +10444,30 @@ var ImageEditorController = (_class13 = class {
10346
10444
  const layer = _chunkUYXL6ZWQcjs.requireLayer.call(void 0, this.state.layers, layerId).layer;
10347
10445
  if (toLayer && layer.type !== "pixel") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Output ${output} needs a pixel layer; "${layerId}" is a ${layer.type} layer.`);
10348
10446
  }
10349
- const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
10350
- const refined = refineSelection(pixels, sel, params);
10447
+ const needsPixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 || edits.some((e) => e.kind !== "brush");
10448
+ const pixels = needsPixels ? await this.requirePixels(options) : null;
10449
+ const { width, height } = this.naturalSize;
10450
+ const edited = applyRefineEdits(pixels, _nullishCoalesce(this.state.selection, () => ( null)), edits, width, height);
10451
+ let sel = edited.selection;
10452
+ if (!_optionalChain([sel, 'optionalAccess', _343 => _343.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
10453
+ if (refineMode === "object") {
10454
+ const b = sel.bounds;
10455
+ const found = await this.modelObject({ rect: b }, options.signal);
10456
+ if (!found) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
10457
+ const near = _chunkUYXL6ZWQcjs.modifySelection.call(void 0, sel, "expand", Math.max(4, _nullishCoalesce(params.radius, () => ( 8))));
10458
+ const clipped = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, found, near, "intersect");
10459
+ if (!_optionalChain([clipped, 'optionalAccess', _344 => _344.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
10460
+ sel = clipped;
10461
+ }
10462
+ const refined = refineSelection(pixels, sel, params, edited.refineBrush);
10351
10463
  if (!refined.bounds) throw new Error("Refining left nothing selected; use a smaller shiftEdge or contrast.");
10352
10464
  return this.asOneStep(() => {
10353
10465
  this.setSelection(refined);
10354
- if (output === "selection") return { output };
10466
+ if (output === "selection") return { output, refineMode };
10355
10467
  if (output === "layer-mask") {
10356
10468
  this.addLayerMask(layerId, "selection");
10357
10469
  this.setSelection(null);
10358
- return { output, layerId };
10470
+ return { output, layerId, refineMode };
10359
10471
  }
10360
10472
  let newLayerId2;
10361
10473
  if (output === "new-layer") newLayerId2 = this.layerViaCopy({ layerId });
@@ -10367,7 +10479,7 @@ var ImageEditorController = (_class13 = class {
10367
10479
  if (amount > 0) this.decontaminateLayer(newLayerId2, layerId, refined, amount, Math.max(4, _nullishCoalesce(params.radius, () => ( 0))));
10368
10480
  this.setLayerProperties(layerId, { visible: false });
10369
10481
  this.setSelection(null);
10370
- return { output, layerId, newLayerId: newLayerId2 };
10482
+ return { output, layerId, newLayerId: newLayerId2, refineMode };
10371
10483
  });
10372
10484
  }
10373
10485
  /**
@@ -10428,7 +10540,7 @@ var ImageEditorController = (_class13 = class {
10428
10540
  let mask;
10429
10541
  if (source === "selection") {
10430
10542
  const sel = this.state.selection;
10431
- if (!_optionalChain([sel, 'optionalAccess', _339 => _339.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
10543
+ if (!_optionalChain([sel, 'optionalAccess', _345 => _345.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
10432
10544
  mask = sel;
10433
10545
  } else if ("channelId" in source) {
10434
10546
  mask = this.requireChannel(source.channelId).mask;
@@ -10452,7 +10564,7 @@ var ImageEditorController = (_class13 = class {
10452
10564
  const canvas = this.renderer.createCanvas(w, h);
10453
10565
  const ctx = canvas.getContext("2d");
10454
10566
  if (ctx) ctx.drawImage(img, 0, 0, w, h);
10455
- const data = _optionalChain([ctx, 'optionalAccess', _340 => _340.getImageData, 'optionalCall', _341 => _341(0, 0, w, h)]);
10567
+ const data = _optionalChain([ctx, 'optionalAccess', _346 => _346.getImageData, 'optionalCall', _347 => _347(0, 0, w, h)]);
10456
10568
  if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
10457
10569
  return { width: w, height: h, data: data.data };
10458
10570
  }
@@ -10468,7 +10580,7 @@ var ImageEditorController = (_class13 = class {
10468
10580
  const provider = this.segmentation;
10469
10581
  if (!provider) {
10470
10582
  const pixels = await this.requirePixels({});
10471
- _optionalChain([options, 'access', _342 => _342.signal, 'optionalAccess', _343 => _343.throwIfAborted, 'call', _344 => _344()]);
10583
+ _optionalChain([options, 'access', _348 => _348.signal, 'optionalAccess', _349 => _349.throwIfAborted, 'call', _350 => _350()]);
10472
10584
  const { selection, reason } = findSubject(pixels, { enhanceEdge: options.enhanceEdge });
10473
10585
  if (selection.bounds) this.shapeCommand(selection, options);
10474
10586
  const unused = target.trim() ? ` "${target.trim()}" was not used to choose it.` : "";
@@ -10484,17 +10596,17 @@ var ImageEditorController = (_class13 = class {
10484
10596
  const decoded = await this.modelSegments({ target: description, maxSegments: options.maxSegments, signal: options.signal });
10485
10597
  const segments = decoded.map((r) => {
10486
10598
  const one = segmentsToSelection(width, height, [r]);
10487
- return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _345 => _345.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
10599
+ return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _351 => _351.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
10488
10600
  });
10489
10601
  const mask = segmentsToSelection(width, height, decoded);
10490
10602
  if (mask && options.beforeApply) {
10491
10603
  const outlines = decoded.flatMap((r, i) => {
10492
10604
  const rings = segmentationOutlines(r);
10493
- const b = _optionalChain([segments, 'access', _346 => _346[i], 'optionalAccess', _347 => _347.bounds]);
10605
+ const b = _optionalChain([segments, 'access', _352 => _352[i], 'optionalAccess', _353 => _353.bounds]);
10494
10606
  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 }]] : [];
10495
10607
  });
10496
10608
  await options.beforeApply(outlines);
10497
- _optionalChain([options, 'access', _348 => _348.signal, 'optionalAccess', _349 => _349.throwIfAborted, 'call', _350 => _350()]);
10609
+ _optionalChain([options, 'access', _354 => _354.signal, 'optionalAccess', _355 => _355.throwIfAborted, 'call', _356 => _356()]);
10498
10610
  }
10499
10611
  if (mask) this.shapeCommand(mask, options);
10500
10612
  return { segments: segments.filter((s) => s.bounds), method: "model" };
@@ -10527,7 +10639,7 @@ var ImageEditorController = (_class13 = class {
10527
10639
  const view = this.state.maskView;
10528
10640
  if (!view) return null;
10529
10641
  const layer = this.getLayer(view.layerId);
10530
- return _optionalChain([layer, 'optionalAccess', _351 => _351.mask]) && !layer.mask.source ? view : null;
10642
+ return _optionalChain([layer, 'optionalAccess', _357 => _357.mask]) && !layer.mask.source ? view : null;
10531
10643
  }
10532
10644
  /**
10533
10645
  * Shows a layer's mask on the canvas: `gray` alone in grey (Alt-click the mask thumbnail),
@@ -10550,7 +10662,7 @@ var ImageEditorController = (_class13 = class {
10550
10662
  if (!layer.mask) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to show; add one with add_layer_mask.`);
10551
10663
  if (layer.mask.source) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is computed, not painted, so it has no mask view.`);
10552
10664
  const cur = this.state.maskView;
10553
- if (_optionalChain([cur, 'optionalAccess', _352 => _352.layerId]) !== id || cur.mode !== mode) {
10665
+ if (_optionalChain([cur, 'optionalAccess', _358 => _358.layerId]) !== id || cur.mode !== mode) {
10554
10666
  this.state.maskView = { layerId: id, mode };
10555
10667
  this.notify();
10556
10668
  }
@@ -10562,7 +10674,7 @@ var ImageEditorController = (_class13 = class {
10562
10674
  return _nullishCoalesce(this.state.channels, () => ( []));
10563
10675
  }
10564
10676
  getChannel(id) {
10565
- return _nullishCoalesce(_optionalChain([this, 'access', _353 => _353.state, 'access', _354 => _354.channels, 'optionalAccess', _355 => _355.find, 'call', _356 => _356((c) => c.id === id)]), () => ( null));
10677
+ return _nullishCoalesce(_optionalChain([this, 'access', _359 => _359.state, 'access', _360 => _360.channels, 'optionalAccess', _361 => _361.find, 'call', _362 => _362((c) => c.id === id)]), () => ( null));
10566
10678
  }
10567
10679
  requireChannel(id) {
10568
10680
  const channel = this.getChannel(id);
@@ -10591,14 +10703,14 @@ var ImageEditorController = (_class13 = class {
10591
10703
  */
10592
10704
  saveSelection(options = {}) {
10593
10705
  const sel = this.state.selection;
10594
- if (!_optionalChain([sel, 'optionalAccess', _357 => _357.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
10706
+ if (!_optionalChain([sel, 'optionalAccess', _363 => _363.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
10595
10707
  const { width, height } = this.naturalSize;
10596
10708
  const sized = sel.width === width && sel.height === height ? sel : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, sel, width, height);
10597
10709
  const channels = [...this.getChannels()];
10598
10710
  if (options.channelId !== void 0) {
10599
10711
  const existing = this.requireChannel(options.channelId);
10600
10712
  const mask = _nullishCoalesce(_chunkUYXL6ZWQcjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkUYXL6ZWQcjs.createSelectionMask.call(void 0, width, height)));
10601
- const next = { ...existing, mask, ..._optionalChain([options, 'access', _358 => _358.name, 'optionalAccess', _359 => _359.trim, 'call', _360 => _360()]) ? { name: options.name.trim() } : {} };
10713
+ const next = { ...existing, mask, ..._optionalChain([options, 'access', _364 => _364.name, 'optionalAccess', _365 => _365.trim, 'call', _366 => _366()]) ? { name: options.name.trim() } : {} };
10602
10714
  this.setChannels(channels.map((c) => c.id === existing.id ? next : c));
10603
10715
  return next;
10604
10716
  }
@@ -10609,7 +10721,7 @@ var ImageEditorController = (_class13 = class {
10609
10721
  const channels = this.getChannels();
10610
10722
  const channel = {
10611
10723
  id: this.newChannelId(),
10612
- name: _optionalChain([name, 'optionalAccess', _361 => _361.trim, 'call', _362 => _362()]) || `Alpha ${channels.length + 1}`,
10724
+ name: _optionalChain([name, 'optionalAccess', _367 => _367.trim, 'call', _368 => _368()]) || `Alpha ${channels.length + 1}`,
10613
10725
  mask,
10614
10726
  color: DEFAULT_CHANNEL_COLOR,
10615
10727
  opacity: 0.5,
@@ -10654,7 +10766,7 @@ var ImageEditorController = (_class13 = class {
10654
10766
  /** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
10655
10767
  duplicateChannel(id, name) {
10656
10768
  const channel = this.requireChannel(id);
10657
- const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _363 => _363.trim, 'call', _364 => _364()]) || `${channel.name} copy` };
10769
+ const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _369 => _369.trim, 'call', _370 => _370()]) || `${channel.name} copy` };
10658
10770
  const channels = [...this.getChannels()];
10659
10771
  channels.splice(channels.findIndex((c) => c.id === id) + 1, 0, copy);
10660
10772
  this.setChannels(channels);
@@ -10685,7 +10797,7 @@ var ImageEditorController = (_class13 = class {
10685
10797
  quickMaskSurface() {
10686
10798
  const { width, height } = this.naturalSize;
10687
10799
  const sel = this.state.selection;
10688
- if (!_optionalChain([sel, 'optionalAccess', _365 => _365.bounds])) return _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, 0);
10800
+ if (!_optionalChain([sel, 'optionalAccess', _371 => _371.bounds])) return _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, 0);
10689
10801
  return (sel.width === width && sel.height === height ? sel : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, sel, width, height)).surface;
10690
10802
  }
10691
10803
  /** The selection a painted Quick Mask surface stands for (it shares the surface's tiles). */
@@ -10706,7 +10818,7 @@ var ImageEditorController = (_class13 = class {
10706
10818
  */
10707
10819
  applySelectionAsLayerMask(layerId, props = {}) {
10708
10820
  const sel = this.state.selection;
10709
- if (!_optionalChain([sel, 'optionalAccess', _366 => _366.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
10821
+ if (!_optionalChain([sel, 'optionalAccess', _372 => _372.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
10710
10822
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
10711
10823
  }
10712
10824
  setLayerMask(layerId, mask, commitToHistory = true) {
@@ -10746,7 +10858,7 @@ var ImageEditorController = (_class13 = class {
10746
10858
  /** A layer's painted mask over the canvas as a selection mask; null without one (or for a depth mask). */
10747
10859
  layerMaskCoverage(layerId) {
10748
10860
  const layer = this.getLayer(layerId);
10749
- if (!_optionalChain([layer, 'optionalAccess', _367 => _367.mask]) || layer.mask.source) return null;
10861
+ if (!_optionalChain([layer, 'optionalAccess', _373 => _373.mask]) || layer.mask.source) return null;
10750
10862
  const { width, height } = this.naturalSize;
10751
10863
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
10752
10864
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -10781,7 +10893,7 @@ var ImageEditorController = (_class13 = class {
10781
10893
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
10782
10894
  const next = { ...l };
10783
10895
  if (_chunkUYXL6ZWQcjs.isDefaultDepthMask.call(void 0, merged)) {
10784
- if (_optionalChain([next, 'access', _368 => _368.mask, 'optionalAccess', _369 => _369.source])) delete next.mask;
10896
+ if (_optionalChain([next, 'access', _374 => _374.mask, 'optionalAccess', _375 => _375.source])) delete next.mask;
10785
10897
  } else next.mask = _chunkUYXL6ZWQcjs.depthRasterMask.call(void 0, merged);
10786
10898
  return next;
10787
10899
  });
@@ -10791,7 +10903,7 @@ var ImageEditorController = (_class13 = class {
10791
10903
  resetDepthMask() {
10792
10904
  this.recordHistory();
10793
10905
  const target = this.developLayer();
10794
- if (_optionalChain([target, 'optionalAccess', _370 => _370.mask, 'optionalAccess', _371 => _371.source])) {
10906
+ if (_optionalChain([target, 'optionalAccess', _376 => _376.mask, 'optionalAccess', _377 => _377.source])) {
10795
10907
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
10796
10908
  const next = { ...l };
10797
10909
  delete next.mask;
@@ -10803,7 +10915,7 @@ var ImageEditorController = (_class13 = class {
10803
10915
  // --- Annotations & Layers ---
10804
10916
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
10805
10917
  annotationLayer(id) {
10806
- return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _372 => _372.id]) === id);
10918
+ return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _378 => _378.id]) === id);
10807
10919
  }
10808
10920
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
10809
10921
  annotationEnv() {
@@ -10821,7 +10933,7 @@ var ImageEditorController = (_class13 = class {
10821
10933
  const fullAnnotation = { ...annotation, id };
10822
10934
  const layer = _chunkUYXL6ZWQcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
10823
10935
  const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
10824
- this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _373 => _373.parent, 'optionalAccess', _374 => _374.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
10936
+ this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _379 => _379.parent, 'optionalAccess', _380 => _380.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
10825
10937
  this.state.selectedAnnotationId = id;
10826
10938
  this.notify();
10827
10939
  return id;
@@ -10944,7 +11056,7 @@ var ImageEditorController = (_class13 = class {
10944
11056
  await this.renderer.renderToCanvas(targetCanvas, source, this.state, {
10945
11057
  ...options,
10946
11058
  // The clone source follows the brush cursor (both editors pass it).
10947
- cloneSourceMarker: _optionalChain([options, 'optionalAccess', _375 => _375.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _376 => _376.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
11059
+ cloneSourceMarker: _optionalChain([options, 'optionalAccess', _381 => _381.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _382 => _382.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
10948
11060
  dirty: dirty === "all" ? void 0 : dirty,
10949
11061
  checkpointLayerId: this.state.activeLayerId
10950
11062
  });
@@ -10957,7 +11069,7 @@ var ImageEditorController = (_class13 = class {
10957
11069
  return this.renderer.createCanvas(1, 1);
10958
11070
  }
10959
11071
  this.syncViews();
10960
- if (_optionalChain([options, 'optionalAccess', _377 => _377.layerIds])) {
11072
+ if (_optionalChain([options, 'optionalAccess', _383 => _383.layerIds])) {
10961
11073
  const keep = new Set(options.layerIds);
10962
11074
  const layers = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
10963
11075
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
@@ -11111,7 +11223,7 @@ var ImageEditorController = (_class13 = class {
11111
11223
  let px2 = await this.decodeImage(newDataUrl);
11112
11224
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
11113
11225
  const data = new Uint8ClampedArray(px2.data);
11114
- const sel = _optionalChain([this, 'access', _378 => _378.state, 'access', _379 => _379.selection, 'optionalAccess', _380 => _380.bounds]) ? this.state.selection : null;
11226
+ const sel = _optionalChain([this, 'access', _384 => _384.state, 'access', _385 => _385.selection, 'optionalAccess', _386 => _386.bounds]) ? this.state.selection : null;
11115
11227
  if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
11116
11228
  return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
11117
11229
  }
@@ -11158,7 +11270,7 @@ var ImageEditorController = (_class13 = class {
11158
11270
  }
11159
11271
  /** Font families the shaper offers (generic families at least). */
11160
11272
  listFonts() {
11161
- return _nullishCoalesce(_optionalChain([this, 'access', _381 => _381.getTextShaper, 'call', _382 => _382(), 'optionalAccess', _383 => _383.families, 'optionalCall', _384 => _384()]), () => ( ["sans-serif", "serif", "monospace"]));
11273
+ return _nullishCoalesce(_optionalChain([this, 'access', _387 => _387.getTextShaper, 'call', _388 => _388(), 'optionalAccess', _389 => _389.families, 'optionalCall', _390 => _390()]), () => ( ["sans-serif", "serif", "monospace"]));
11162
11274
  }
11163
11275
  typeInfo(id) {
11164
11276
  const layer = _chunkUYXL6ZWQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
@@ -11232,8 +11344,8 @@ var ImageEditorController = (_class13 = class {
11232
11344
  const layer = this.layoutTypeLayer({ ...init, text, orientation: vertical ? "vertical" : "horizontal" });
11233
11345
  const { width, height } = this.naturalSize;
11234
11346
  const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
11235
- const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _385 => _385.x]), () => ( 0)));
11236
- const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _386 => _386.y]), () => ( 0)));
11347
+ const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _391 => _391.x]), () => ( 0)));
11348
+ const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _392 => _392.y]), () => ( 0)));
11237
11349
  const x1 = Math.min(width, b ? b.x + b.width : 0);
11238
11350
  const y1 = Math.min(height, b ? b.y + b.height : 0);
11239
11351
  let mask;
@@ -11410,7 +11522,7 @@ var ImageEditorController = (_class13 = class {
11410
11522
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
11411
11523
  const missing = _chunkBRKVNXDZcjs.layoutText.call(void 0, layer, shaper).missingFonts;
11412
11524
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
11413
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _387 => _387.runs, 'access', _388 => _388.find, 'call', _389 => _389((r) => r.length > 0), 'optionalAccess', _390 => _390.style]), () => ( _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE));
11525
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _393 => _393.runs, 'access', _394 => _394.find, 'call', _395 => _395((r) => r.length > 0), 'optionalAccess', _396 => _396.style]), () => ( _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE));
11414
11526
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
11415
11527
  const shape = _chunkUYXL6ZWQcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
11416
11528
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
@@ -11443,7 +11555,7 @@ var ImageEditorController = (_class13 = class {
11443
11555
  // --- Shape layers ---
11444
11556
  /** What shape rendering needs: the canvas size and the document's patterns. */
11445
11557
  shapeEnv() {
11446
- return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _391 => _391.state, 'access', _392 => _392.patterns, 'optionalAccess', _393 => _393.find, 'call', _394 => _394((p) => p.id === id)]), () => ( null)) };
11558
+ return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _397 => _397.state, 'access', _398 => _398.patterns, 'optionalAccess', _399 => _399.find, 'call', _400 => _400((p) => p.id === id)]), () => ( null)) };
11447
11559
  }
11448
11560
  /** One component from tool or UI input (validated). */
11449
11561
  componentFrom(spec, path) {
@@ -11486,9 +11598,9 @@ var ImageEditorController = (_class13 = class {
11486
11598
  * open path) and stroked with `stroke`. Goes above the active layer unless placed. Returns its id.
11487
11599
  */
11488
11600
  addShapeLayer(init) {
11489
- const specs = _optionalChain([init, 'access', _395 => _395.components, 'optionalAccess', _396 => _396.length]) ? init.components : [init];
11490
- if (_optionalChain([init, 'access', _397 => _397.components, 'optionalAccess', _398 => _398.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
11491
- const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _399 => _399.components, 'optionalAccess', _400 => _400.length]) ? `components[${i}].` : ""));
11601
+ const specs = _optionalChain([init, 'access', _401 => _401.components, 'optionalAccess', _402 => _402.length]) ? init.components : [init];
11602
+ if (_optionalChain([init, 'access', _403 => _403.components, 'optionalAccess', _404 => _404.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
11603
+ const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _405 => _405.components, 'optionalAccess', _406 => _406.length]) ? `components[${i}].` : ""));
11492
11604
  const stroke = init.stroke ? _chunkUYXL6ZWQcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
11493
11605
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
11494
11606
  const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkUYXL6ZWQcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkUYXL6ZWQcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
@@ -11599,7 +11711,7 @@ var ImageEditorController = (_class13 = class {
11599
11711
  if (layer.locks) next.locks = layer.locks;
11600
11712
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
11601
11713
  } else if (layer.type === "pixel") {
11602
- if (!_optionalChain([layer, 'access', _401 => _401.filters, 'optionalAccess', _402 => _402.length])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
11714
+ if (!_optionalChain([layer, 'access', _407 => _407.filters, 'optionalAccess', _408 => _408.length])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
11603
11715
  _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
11604
11716
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
11605
11717
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
@@ -11618,7 +11730,7 @@ var ImageEditorController = (_class13 = class {
11618
11730
  return this.rasterizeSmartObject(id);
11619
11731
  } else if (layer.type === "shape" || layer.type === "type") {
11620
11732
  next = layer.type === "shape" ? _chunkUYXL6ZWQcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkUYXL6ZWQcjs.typeAsPixelLayer.call(void 0, layer);
11621
- if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _403 => _403.annotation, 'optionalAccess', _404 => _404.id])) this.state.selectedAnnotationId = null;
11733
+ if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _409 => _409.annotation, 'optionalAccess', _410 => _410.id])) this.state.selectedAnnotationId = null;
11622
11734
  } else {
11623
11735
  throw new (0, _chunkUYXL6ZWQcjs.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.`);
11624
11736
  }
@@ -11632,8 +11744,8 @@ var ImageEditorController = (_class13 = class {
11632
11744
  const doc = this.state.colorProfile;
11633
11745
  const p = resolveProfile(doc);
11634
11746
  const m = this.state.colorMode;
11635
- const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _405 => _405.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _406 => _406.mode]), () => ( "rgb")) };
11636
- if (_optionalChain([m, 'optionalAccess', _407 => _407.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
11747
+ const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _411 => _411.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _412 => _412.mode]), () => ( "rgb")) };
11748
+ if (_optionalChain([m, 'optionalAccess', _413 => _413.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
11637
11749
  return out;
11638
11750
  }
11639
11751
  /**
@@ -11723,7 +11835,7 @@ var ImageEditorController = (_class13 = class {
11723
11835
  const textEnv = this.textEnv();
11724
11836
  const walk = (layers) => layers.map((l) => {
11725
11837
  let next2 = l;
11726
- if (_optionalChain([l, 'access', _408 => _408.effects, 'optionalAccess', _409 => _409.items, 'access', _410 => _410.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
11838
+ if (_optionalChain([l, 'access', _414 => _414.effects, 'optionalAccess', _415 => _415.items, 'access', _416 => _416.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
11727
11839
  if (l.type === "group") {
11728
11840
  if (next2 !== l) converted.push(l.id);
11729
11841
  return { ...next2, children: walk(l.children) };
@@ -11907,8 +12019,8 @@ var ImageEditorController = (_class13 = class {
11907
12019
  else delete s.bitDepth;
11908
12020
  delete s.colorProfile;
11909
12021
  delete s.colorMode;
11910
- if (_optionalChain([result, 'access', _411 => _411.sourceMode, 'optionalAccess', _412 => _412.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
11911
- else if (_optionalChain([result, 'access', _413 => _413.sourceMode, 'optionalAccess', _414 => _414.mode]) === "lab") s.colorMode = { mode: "lab" };
12022
+ if (_optionalChain([result, 'access', _417 => _417.sourceMode, 'optionalAccess', _418 => _418.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
12023
+ else if (_optionalChain([result, 'access', _419 => _419.sourceMode, 'optionalAccess', _420 => _420.mode]) === "lab") s.colorMode = { mode: "lab" };
11912
12024
  else if (result.iccProfile) {
11913
12025
  try {
11914
12026
  const doc = documentProfile(result.iccProfile);
@@ -11972,7 +12084,7 @@ var ImageEditorController = (_class13 = class {
11972
12084
  const compositor = new (0, _chunkUYXL6ZWQcjs.LayerCompositor)();
11973
12085
  const bakeMask = (layer) => {
11974
12086
  const mask = layer.mask;
11975
- if (!_optionalChain([mask, 'optionalAccess', _415 => _415.source])) return mask;
12087
+ if (!_optionalChain([mask, 'optionalAccess', _421 => _421.source])) return mask;
11976
12088
  add2("Parametric (depth) masks were baked into pixel masks", layer.name);
11977
12089
  const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
11978
12090
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
@@ -11989,7 +12101,7 @@ var ImageEditorController = (_class13 = class {
11989
12101
  };
11990
12102
  const prepare = async (layer) => {
11991
12103
  const p = await prepareLayer(layer);
11992
- if (_optionalChain([p, 'optionalAccess', _416 => _416.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
12104
+ if (_optionalChain([p, 'optionalAccess', _422 => _422.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
11993
12105
  return p;
11994
12106
  };
11995
12107
  const prepareLayer = async (layer) => {
@@ -12032,7 +12144,7 @@ var ImageEditorController = (_class13 = class {
12032
12144
  return out2;
12033
12145
  }
12034
12146
  if (layer.type === "shape" || layer.type === "type") {
12035
- if (layer.type === "type" && _optionalChain([layer, 'access', _417 => _417.missingFonts, 'optionalAccess', _418 => _418.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);
12147
+ if (layer.type === "type" && _optionalChain([layer, 'access', _423 => _423.missingFonts, 'optionalAccess', _424 => _424.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);
12036
12148
  const out2 = { ...layer };
12037
12149
  const mask2 = bakeMask(layer);
12038
12150
  if (mask2) out2.mask = mask2;
@@ -12051,7 +12163,7 @@ var ImageEditorController = (_class13 = class {
12051
12163
  out.surface = this.surfaceOf(layer);
12052
12164
  delete out.source;
12053
12165
  }
12054
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _419 => _419.filters, 'optionalAccess', _420 => _420.filter, 'call', _421 => _421(_chunkUYXL6ZWQcjs.isActiveFilter)]), () => ( []));
12166
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _425 => _425.filters, 'optionalAccess', _426 => _426.filter, 'call', _427 => _427(_chunkUYXL6ZWQcjs.isActiveFilter)]), () => ( []));
12055
12167
  if (active.length) {
12056
12168
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
12057
12169
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -12062,7 +12174,7 @@ var ImageEditorController = (_class13 = class {
12062
12174
  const data = compositor.composite([content], canvas, sources);
12063
12175
  out = { ...out, surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
12064
12176
  }
12065
- if (_optionalChain([layer, 'access', _422 => _422.filters, 'optionalAccess', _423 => _423.some, 'call', _424 => _424((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
12177
+ if (_optionalChain([layer, 'access', _428 => _428.filters, 'optionalAccess', _429 => _429.some, 'call', _430 => _430((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
12066
12178
  delete out.filters;
12067
12179
  const mask = bakeMask(layer);
12068
12180
  if (mask) out.mask = mask;
@@ -12126,7 +12238,7 @@ var ImageEditorController = (_class13 = class {
12126
12238
  );
12127
12239
  }
12128
12240
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
12129
- const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _425 => _425.state, 'access', _426 => _426.patterns, 'optionalAccess', _427 => _427.find, 'call', _428 => _428((p) => p.id === pid)]), () => ( null)) };
12241
+ const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _431 => _431.state, 'access', _432 => _432.patterns, 'optionalAccess', _433 => _433.find, 'call', _434 => _434((p) => p.id === pid)]), () => ( null)) };
12130
12242
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
12131
12243
  if (l.type === "annotation") {
12132
12244
  layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
@@ -12135,7 +12247,7 @@ var ImageEditorController = (_class13 = class {
12135
12247
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
12136
12248
  const fromAnnotation = scaled ? _chunkUYXL6ZWQcjs.shapeFromAnnotation.call(void 0, scaled) : null;
12137
12249
  const m = [sx, 0, 0, sy, 0, 0];
12138
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _429 => _429.components]), () => ( _chunkUYXL6ZWQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
12250
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _435 => _435.components]), () => ( _chunkUYXL6ZWQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
12139
12251
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
12140
12252
  if (scaled && fromAnnotation) moved.annotation = scaled;
12141
12253
  else delete moved.annotation;
@@ -12153,7 +12265,7 @@ var ImageEditorController = (_class13 = class {
12153
12265
  this.notify();
12154
12266
  }
12155
12267
  toJSON(options) {
12156
- const root = _optionalChain([this, 'access', _430 => _430.contentsStack, 'access', _431 => _431[0], 'optionalAccess', _432 => _432.saved]);
12268
+ const root = _optionalChain([this, 'access', _436 => _436.contentsStack, 'access', _437 => _437[0], 'optionalAccess', _438 => _438.saved]);
12157
12269
  const current = this.state;
12158
12270
  const element = this.imageElement;
12159
12271
  if (root) {
@@ -12164,8 +12276,8 @@ var ImageEditorController = (_class13 = class {
12164
12276
  let out;
12165
12277
  try {
12166
12278
  out = this.serializeState();
12167
- if (_optionalChain([this, 'access', _433 => _433.state, 'access', _434 => _434.selection, 'optionalAccess', _435 => _435.bounds])) out.selection = _chunkUYXL6ZWQcjs.serializeSelection.call(void 0, this.state.selection);
12168
- if (_optionalChain([this, 'access', _436 => _436.state, 'access', _437 => _437.channels, 'optionalAccess', _438 => _438.length])) out.channels = serializeChannels(this.state.channels);
12279
+ if (_optionalChain([this, 'access', _439 => _439.state, 'access', _440 => _440.selection, 'optionalAccess', _441 => _441.bounds])) out.selection = _chunkUYXL6ZWQcjs.serializeSelection.call(void 0, this.state.selection);
12280
+ if (_optionalChain([this, 'access', _442 => _442.state, 'access', _443 => _443.channels, 'optionalAccess', _444 => _444.length])) out.channels = serializeChannels(this.state.channels);
12169
12281
  } finally {
12170
12282
  if (root) {
12171
12283
  this.state = current;
@@ -12279,10 +12391,10 @@ var ImageEditorController = (_class13 = class {
12279
12391
  serializeState() {
12280
12392
  const { width, height } = this.naturalSize;
12281
12393
  const view = _chunkUYXL6ZWQcjs.legacyView.call(void 0, this.stack(), width, height, null);
12282
- if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _439 => _439.state, 'access', _440 => _440.patterns, 'optionalAccess', _441 => _441.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
12394
+ if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _445 => _445.state, 'access', _446 => _446.patterns, 'optionalAccess', _447 => _447.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
12283
12395
  return {
12284
12396
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
12285
- version: _optionalChain([view, 'access', _442 => _442.adjustments, 'access', _443 => _443.layers, 'optionalAccess', _444 => _444.length]) ? 2 : 1,
12397
+ version: _optionalChain([view, 'access', _448 => _448.adjustments, 'access', _449 => _449.layers, 'optionalAccess', _450 => _450.length]) ? 2 : 1,
12286
12398
  crop: this.state.crop ? { ...this.state.crop } : null,
12287
12399
  transform: { ...this.state.transform },
12288
12400
  adjustments: serializeAdjustments(view.adjustments),
@@ -12307,7 +12419,7 @@ var ImageEditorController = (_class13 = class {
12307
12419
  };
12308
12420
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
12309
12421
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
12310
- if (_optionalChain([this, 'access', _445 => _445.state, 'access', _446 => _446.patterns, 'optionalAccess', _447 => _447.length])) out.patterns = _chunkUYXL6ZWQcjs.serializePatterns.call(void 0, this.state.patterns);
12422
+ if (_optionalChain([this, 'access', _451 => _451.state, 'access', _452 => _452.patterns, 'optionalAccess', _453 => _453.length])) out.patterns = _chunkUYXL6ZWQcjs.serializePatterns.call(void 0, this.state.patterns);
12311
12423
  if (smartContents) out.smartContents = smartContents;
12312
12424
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
12313
12425
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -12317,7 +12429,7 @@ var ImageEditorController = (_class13 = class {
12317
12429
  }, _class13);
12318
12430
  function serializeAdjustments(adjustments) {
12319
12431
  const out = { ...adjustments };
12320
- if (_optionalChain([out, 'access', _448 => _448.layers, 'optionalAccess', _449 => _449.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
12432
+ if (_optionalChain([out, 'access', _454 => _454.layers, 'optionalAccess', _455 => _455.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
12321
12433
  else delete out.layers;
12322
12434
  if (_chunkUYXL6ZWQcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkUYXL6ZWQcjs.LEGACY_PROCESS_VERSION) {
12323
12435
  delete out.process;
@@ -12353,11 +12465,11 @@ function withDevelop(layer, partial) {
12353
12465
  return { ...layer, filters };
12354
12466
  }
12355
12467
  function withBlur(layer, radius) {
12356
- const existing = _optionalChain([layer, 'access', _450 => _450.filters, 'optionalAccess', _451 => _451.find, 'call', _452 => _452((f) => f.kind === "blur")]);
12468
+ const existing = _optionalChain([layer, 'access', _456 => _456.filters, 'optionalAccess', _457 => _457.find, 'call', _458 => _458((f) => f.kind === "blur")]);
12357
12469
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
12358
12470
  if (radius > 0) {
12359
12471
  filters.push({
12360
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _453 => _453.id]), () => ( (layer.source === "document" ? _chunkUYXL6ZWQcjs.BLUR_FILTER_ID : _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "flt")))),
12472
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _459 => _459.id]), () => ( (layer.source === "document" ? _chunkUYXL6ZWQcjs.BLUR_FILTER_ID : _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "flt")))),
12361
12473
  kind: "blur",
12362
12474
  enabled: true,
12363
12475
  radius
@@ -12453,7 +12565,7 @@ function collectStateTiles(layers, into) {
12453
12565
  if (l.type === "shape" || l.type === "type") _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.surface, into);
12454
12566
  if (l.type === "smart") {
12455
12567
  _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.surface, into);
12456
- if (_optionalChain([l, 'access', _454 => _454.smartFilters, 'optionalAccess', _455 => _455.mask])) _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
12568
+ if (_optionalChain([l, 'access', _460 => _460.smartFilters, 'optionalAccess', _461 => _461.mask])) _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
12457
12569
  if (l.contents.raster) _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.contents.raster, into);
12458
12570
  if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
12459
12571
  }
@@ -12485,7 +12597,7 @@ function pixelsOnly(layers) {
12485
12597
  for (const l of layers) {
12486
12598
  if (l.type === "adjustment") continue;
12487
12599
  if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
12488
- else if (l.type === "pixel" && _optionalChain([l, 'access', _456 => _456.filters, 'optionalAccess', _457 => _457.length])) {
12600
+ else if (l.type === "pixel" && _optionalChain([l, 'access', _462 => _462.filters, 'optionalAccess', _463 => _463.length])) {
12489
12601
  const p = { ...l };
12490
12602
  delete p.filters;
12491
12603
  out.push(p);
@@ -12551,7 +12663,7 @@ function toHex(c) {
12551
12663
  return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
12552
12664
  }
12553
12665
  function normalizeSelection(mask) {
12554
- return _optionalChain([mask, 'optionalAccess', _458 => _458.bounds]) ? mask : null;
12666
+ return _optionalChain([mask, 'optionalAccess', _464 => _464.bounds]) ? mask : null;
12555
12667
  }
12556
12668
  function sameSelection(a, b) {
12557
12669
  if (a.width !== b.width || a.height !== b.height) return false;
@@ -12761,7 +12873,7 @@ function loadImageEditorDocument(input) {
12761
12873
  }
12762
12874
  const state = { version: 1, ...result.value };
12763
12875
  if (isV2) {
12764
- if (_optionalChain([state, 'access', _459 => _459.adjustments, 'access', _460 => _460.layers, 'optionalAccess', _461 => _461.length])) state.version = 2;
12876
+ if (_optionalChain([state, 'access', _465 => _465.adjustments, 'access', _466 => _466.layers, 'optionalAccess', _467 => _467.length])) state.version = 2;
12765
12877
  result.report.version = 2;
12766
12878
  }
12767
12879
  if (state.selection === void 0) delete state.selection;
@@ -12969,7 +13081,7 @@ function findAdjustmentControl(id) {
12969
13081
  }
12970
13082
  function findLayerControl(kind, id) {
12971
13083
  if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
12972
- return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _462 => _462[kind], 'optionalAccess', _463 => _463.find, 'call', _464 => _464((c) => c.id === id)]);
13084
+ return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _468 => _468[kind], 'optionalAccess', _469 => _469.find, 'call', _470 => _470((c) => c.id === id)]);
12973
13085
  }
12974
13086
  function clampControlValue(spec, v) {
12975
13087
  if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
@@ -13433,7 +13545,7 @@ function summary(controller) {
13433
13545
  const area = _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel);
13434
13546
  return {
13435
13547
  empty: !sel,
13436
- bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _465 => _465.bounds]), () => ( null)),
13548
+ bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _471 => _471.bounds]), () => ( null)),
13437
13549
  /** Σ coverage in pixels. */
13438
13550
  area: Math.round(area),
13439
13551
  percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
@@ -13509,7 +13621,7 @@ function createImageSelectionTools(controller) {
13509
13621
  break;
13510
13622
  }
13511
13623
  case "polygon": {
13512
- const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _466 => _466.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _467 => _467.y]), NaN) })) : [];
13624
+ const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _472 => _472.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _473 => _473.y]), NaN) })) : [];
13513
13625
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
13514
13626
  throw new Error("polygon needs points: at least 3 { x, y } vertices.");
13515
13627
  }
@@ -13586,7 +13698,7 @@ function createImageSelectionTools(controller) {
13586
13698
  const refine = {
13587
13699
  name: "refine_selection",
13588
13700
  title: "Refine the selection edge",
13589
- description: "Select and Mask / Refine Edge: snaps the selection edge to the image within radius pixels (edge-aware guided filter), then smooth (0-100), feather (px), contrast (0-100) and shiftEdge (-100..100 %), and puts the result where output says: the selection (default), a layer-mask on layerId (default the active layer; then deselects), a new-layer of its selected pixels, or a new-layer-with-mask (a masked copy); the new-layer outputs hide the source layer. decontaminate (0-100, new-layer outputs only) replaces the old background colour in soft edges (hair, fur) with the subject's own. Use it after loading a coarse AI mask, or to cut a subject out cleanly. One undoable step. Returns the selection and, for layer outputs, layerId and newLayerId.",
13701
+ description: "Select and Mask / Refine Edge: snaps the selection edge to the image within radius pixels (edge-aware guided filter), then smooth (0-100), feather (px), contrast (0-100) and shiftEdge (-100..100 %), and puts the result where output says: the selection (default), a layer-mask on layerId (default the active layer; then deselects), a new-layer of its selected pixels, or a new-layer-with-mask (a masked copy); the new-layer outputs hide the source layer. decontaminate (0-100, new-layer outputs only) replaces the old background colour in soft edges (hair, fur) with the subject's own. Use it after loading a coarse AI mask, or to cut a subject out cleanly. edits are the Select and Mask workspace's strokes, applied first in order: quick-select (grows to the region's edges), brush (paints the selection in or out) and refine-brush (marks hair or fur for the edge to be re-estimated there); with edits, an empty selection is a valid start. refineMode object (needs a host segmentation model) refines from the model's outline of the object. One undoable step. Returns the selection, refineMode and, for layer outputs, layerId and newLayerId.",
13590
13702
  inputSchema: {
13591
13703
  type: "object",
13592
13704
  properties: {
@@ -13602,13 +13714,52 @@ function createImageSelectionTools(controller) {
13602
13714
  description: "Where the result goes (default selection). layer-mask keeps every pixel and is easiest to revise; new-layer-with-mask too, on a copy."
13603
13715
  },
13604
13716
  layerId: { type: "string", description: "The layer for layer outputs (default the active layer; see list_layers). New-layer outputs need a pixel layer." },
13605
- decontaminate: { type: "number", minimum: 0, maximum: 100, description: "Decontaminate Colors amount 0-100 (default 0), only with output new-layer or new-layer-with-mask." }
13717
+ decontaminate: { type: "number", minimum: 0, maximum: 100, description: "Decontaminate Colors amount 0-100 (default 0), only with output new-layer or new-layer-with-mask." },
13718
+ edits: {
13719
+ type: "array",
13720
+ description: "Strokes applied before refining, in order.",
13721
+ items: {
13722
+ type: "object",
13723
+ properties: {
13724
+ kind: {
13725
+ type: "string",
13726
+ enum: ["quick-select", "brush", "refine-brush", "lasso", "object"],
13727
+ description: "quick-select grows to edges; brush paints directly; refine-brush marks soft detail (hair) for the edge to be re-estimated; lasso adds or removes a polygon; object adds or removes the object in rect or under point."
13728
+ },
13729
+ points: { type: "array", minItems: 1, items: pointSchema, description: "The stroke path (or lasso outline, 3+ points) in natural image pixels; one point is a dab. Not for object." },
13730
+ rect: {
13731
+ type: "object",
13732
+ properties: rectProperties,
13733
+ required: ["x", "y", "width", "height"],
13734
+ additionalProperties: false,
13735
+ description: "object: a box around the object, in natural image pixels."
13736
+ },
13737
+ point: { ...pointSchema, description: "object: a point on the object, in natural image pixels." },
13738
+ size: { type: "number", minimum: 1, maximum: 2500, description: "Brush diameter in natural image pixels (default 30 quick-select, 20 brush, 40 refine-brush)." },
13739
+ mode: { type: "string", enum: ["add", "subtract"], description: "quick-select, brush, lasso and object: add (default) or subtract." },
13740
+ hardness: { type: "number", minimum: 0, maximum: 1, description: "brush: the solid share of the radius, 0..1 (default 1)." }
13741
+ },
13742
+ required: ["kind"],
13743
+ additionalProperties: false
13744
+ }
13745
+ },
13746
+ refineMode: { type: "string", enum: ["color", "object"], description: "color (default): refine from the image colours; object: from a host segmentation model's outline of the object (needs a model)." }
13606
13747
  },
13607
13748
  additionalProperties: false
13608
13749
  },
13609
13750
  annotations: writeAnnotations("Refine the selection edge"),
13610
13751
  handler: async (params) => {
13611
- if (!controller.getSelection()) throw new Error("Nothing is selected.");
13752
+ 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', _474 => _474.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _475 => _475.y]), NaN) })) }) : [];
13753
+ for (const e of edits) {
13754
+ if (e.kind === "object") {
13755
+ if (!e.rect === !e.point) throw new Error("An object edit takes rect (a box around the object) or point (on it).");
13756
+ continue;
13757
+ }
13758
+ if (!e.points.length) throw new Error(`A ${e.kind} edit needs points.`);
13759
+ if (!e.points.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) throw new Error("Each edit needs points of { x, y } in natural image pixels.");
13760
+ if (e.kind === "refine-brush" && e.mode !== void 0) throw new Error("refine-brush strokes have no mode; they mark where the edge is re-estimated.");
13761
+ }
13762
+ if (!controller.getSelection() && !edits.length) throw new Error("Nothing is selected.");
13612
13763
  const result = await controller.refineSelectionTo(
13613
13764
  {
13614
13765
  radius: num2(params.radius, 8),
@@ -13619,7 +13770,12 @@ function createImageSelectionTools(controller) {
13619
13770
  shiftEdge: num2(params.shiftEdge, 0)
13620
13771
  },
13621
13772
  _nullishCoalesce(params.output, () => ( "selection")),
13622
- { layerId: typeof params.layerId === "string" ? params.layerId : void 0, decontaminate: num2(params.decontaminate, 0) }
13773
+ {
13774
+ layerId: typeof params.layerId === "string" ? params.layerId : void 0,
13775
+ decontaminate: num2(params.decontaminate, 0),
13776
+ edits,
13777
+ refineMode: params.refineMode === "object" ? "object" : "color"
13778
+ }
13623
13779
  );
13624
13780
  return { ...summary(controller), ...result };
13625
13781
  }
@@ -13757,7 +13913,7 @@ function createImageSelectionTools(controller) {
13757
13913
  },
13758
13914
  annotations: writeAnnotations("Select a polygon (lasso)", true),
13759
13915
  handler: async (args) => {
13760
- const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _468 => _468.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _469 => _469.y]), NaN) })) : [];
13916
+ const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _476 => _476.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _477 => _477.y]), NaN) })) : [];
13761
13917
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
13762
13918
  throw new Error("points needs at least 3 { x, y } vertices in natural image pixels.");
13763
13919
  }
@@ -13794,7 +13950,7 @@ function createImageSelectionTools(controller) {
13794
13950
  },
13795
13951
  annotations: writeAnnotations("Quick Selection"),
13796
13952
  handler: async (args) => {
13797
- const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _470 => _470.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _471 => _471.y]), NaN) })) : []) : [];
13953
+ const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _478 => _478.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _479 => _479.y]), NaN) })) : []) : [];
13798
13954
  if (!strokes.length || strokes.some((s) => !s.length || !s.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y)))) {
13799
13955
  throw new Error("strokes needs at least one stroke of { x, y } points in natural image pixels.");
13800
13956
  }
@@ -13992,7 +14148,7 @@ function createImageSelectionTools(controller) {
13992
14148
  await controller.selectColorRangePreset(args.preset, { ...common, falloff: num2(args.fuzziness, 20) });
13993
14149
  } else {
13994
14150
  const samples = args.samples.map((s, i) => {
13995
- if (typeof _optionalChain([s, 'optionalAccess', _472 => _472.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
14151
+ if (typeof _optionalChain([s, 'optionalAccess', _480 => _480.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
13996
14152
  const at = typeof s.x === "number" && typeof s.y === "number" ? { x: s.x, y: s.y } : void 0;
13997
14153
  return at ? { color: s.color, at } : { color: s.color };
13998
14154
  });
@@ -14513,13 +14669,13 @@ function createImageSubjectSelectionTool(controller) {
14513
14669
  handler: async ({ target, maxSegments, mode, feather, enhanceEdge }, context) => {
14514
14670
  if (target !== void 0 && typeof target !== "string") throw new Error("target must be a description in words.");
14515
14671
  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).");
14516
- const perform = _optionalChain([context, 'optionalAccess', _473 => _473.perform]);
14672
+ const perform = _optionalChain([context, 'optionalAccess', _481 => _481.perform]);
14517
14673
  const { segments, method, note } = await controller.selectSubject(String(_nullishCoalesce(target, () => ( ""))), {
14518
14674
  mode: _chunkUYXL6ZWQcjs.parseSelectionMode.call(void 0, mode),
14519
14675
  feather: num2(feather, 0),
14520
14676
  maxSegments: typeof maxSegments === "number" ? Math.max(1, Math.round(maxSegments)) : void 0,
14521
14677
  enhanceEdge: enhanceEdge === true,
14522
- signal: _optionalChain([context, 'optionalAccess', _474 => _474.signal]),
14678
+ signal: _optionalChain([context, 'optionalAccess', _482 => _482.signal]),
14523
14679
  // Under playback the cursor traces what the model found, as a lasso, before it is selected.
14524
14680
  beforeApply: perform ? (outlines) => perform(planOutlineTrace(outlines)) : void 0
14525
14681
  });
@@ -14597,7 +14753,7 @@ async function renderImageRegion(controller, request) {
14597
14753
  const maskView = maskViewCanvas(controller, document);
14598
14754
  if (maskView) context.drawImage(maskView, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
14599
14755
  const selection = state.selection;
14600
- if (_optionalChain([selection, 'optionalAccess', _475 => _475.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
14756
+ if (_optionalChain([selection, 'optionalAccess', _483 => _483.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
14601
14757
  const shade = selectionShade(selection, document);
14602
14758
  if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
14603
14759
  }
@@ -14622,7 +14778,7 @@ function createImageCaptureSurface(controller) {
14622
14778
  return {
14623
14779
  units: "image pixels",
14624
14780
  content: whole,
14625
- selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _476 => _476.getState, 'call', _477 => _477(), 'access', _478 => _478.selection, 'optionalAccess', _479 => _479.bounds]), () => ( null)) }),
14781
+ selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _484 => _484.getState, 'call', _485 => _485(), 'access', _486 => _486.selection, 'optionalAccess', _487 => _487.bounds]), () => ( null)) }),
14626
14782
  overlays: "a shade over unselected pixels, the crop box outline and a layer mask view (set_mask_view)",
14627
14783
  maxScale: 8,
14628
14784
  render: (request) => renderImageRegion(controller, request)
@@ -14956,7 +15112,7 @@ function describeLayer(layer, activeId, boundsOf) {
14956
15112
  out.bounds = boundsOf(layer);
14957
15113
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
14958
15114
  out.shape = {
14959
- components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _480 => _480.live, 'optionalAccess', _481 => _481.kind]), () => ( "path")) })),
15115
+ components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _488 => _488.live, 'optionalAccess', _489 => _489.kind]), () => ( "path")) })),
14960
15116
  fill: layer.fill ? layer.fill.type : null,
14961
15117
  stroke: layer.stroke ? { width: layer.stroke.width, paint: layer.stroke.paint.type } : null
14962
15118
  };
@@ -14979,8 +15135,8 @@ function describeLayer(layer, activeId, boundsOf) {
14979
15135
  out.bounds = boundsOf(layer);
14980
15136
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
14981
15137
  out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
14982
- out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _482 => _482.smartFilters, 'optionalAccess', _483 => _483.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
14983
- out.filterMask = maskSummary(_optionalChain([layer, 'access', _484 => _484.smartFilters, 'optionalAccess', _485 => _485.mask]));
15138
+ out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _490 => _490.smartFilters, 'optionalAccess', _491 => _491.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
15139
+ out.filterMask = maskSummary(_optionalChain([layer, 'access', _492 => _492.smartFilters, 'optionalAccess', _493 => _493.mask]));
14984
15140
  break;
14985
15141
  }
14986
15142
  return out;
@@ -15008,7 +15164,7 @@ function createImageLayerTools(controller) {
15008
15164
  if (!loc) return null;
15009
15165
  return {
15010
15166
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
15011
- parentId: _nullishCoalesce(_optionalChain([loc, 'access', _486 => _486.parent, 'optionalAccess', _487 => _487.id]), () => ( null)),
15167
+ parentId: _nullishCoalesce(_optionalChain([loc, 'access', _494 => _494.parent, 'optionalAccess', _495 => _495.id]), () => ( null)),
15012
15168
  index: loc.index
15013
15169
  };
15014
15170
  };
@@ -15331,7 +15487,7 @@ function createImageLayerTools(controller) {
15331
15487
  if (view !== "gray" && view !== "overlay" && view !== "off") throw new Error(`Unknown view "${String(view)}". Use gray, overlay or off.`);
15332
15488
  const id = view === "off" || layerId === void 0 ? void 0 : exists(layerId);
15333
15489
  const shown = controller.setMaskView(view, id);
15334
- return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _488 => _488.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _489 => _489.layerId]), () => ( null)) };
15490
+ return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _496 => _496.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _497 => _497.layerId]), () => ( null)) };
15335
15491
  }
15336
15492
  };
15337
15493
  const maskProps = {
@@ -16193,7 +16349,7 @@ function handleSelectionShortcut(controller, e, onError) {
16193
16349
  try {
16194
16350
  fn();
16195
16351
  } catch (err) {
16196
- _optionalChain([onError, 'optionalCall', _490 => _490(err instanceof Error ? err.message : String(err))]);
16352
+ _optionalChain([onError, 'optionalCall', _498 => _498(err instanceof Error ? err.message : String(err))]);
16197
16353
  }
16198
16354
  return true;
16199
16355
  };
@@ -16208,9 +16364,9 @@ function handleMaskViewKey(controller, e) {
16208
16364
  if (e.ctrlKey || e.metaKey || e.altKey || e.key !== "\\") return false;
16209
16365
  const id = controller.getState().activeLayerId;
16210
16366
  const layer = id ? controller.getLayer(id) : null;
16211
- if (!_optionalChain([layer, 'optionalAccess', _491 => _491.mask]) || layer.mask.source) return false;
16367
+ if (!_optionalChain([layer, 'optionalAccess', _499 => _499.mask]) || layer.mask.source) return false;
16212
16368
  const view = controller.getMaskView();
16213
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _492 => _492.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
16369
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _500 => _500.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
16214
16370
  return true;
16215
16371
  }
16216
16372
  function handleQuickMaskKey(controller, e) {
@@ -16424,7 +16580,7 @@ var PaintGesture = (_class15 = class {
16424
16580
  const layer = this.controller.getActiveLayer();
16425
16581
  if (!layer) throw new Error("Select a layer to move in the Layers panel.");
16426
16582
  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.`);
16427
- if (_optionalChain([layer, 'access', _493 => _493.locks, 'optionalAccess', _494 => _494.all]) || _optionalChain([layer, 'access', _495 => _495.locks, 'optionalAccess', _496 => _496.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
16583
+ if (_optionalChain([layer, 'access', _501 => _501.locks, 'optionalAccess', _502 => _502.all]) || _optionalChain([layer, 'access', _503 => _503.locks, 'optionalAccess', _504 => _504.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
16428
16584
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
16429
16585
  const b = _chunkUYXL6ZWQcjs.shapeGeometryBounds.call(void 0, layer);
16430
16586
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
@@ -16481,7 +16637,7 @@ var PaintGesture = (_class15 = class {
16481
16637
  this.move = null;
16482
16638
  }
16483
16639
  cancel() {
16484
- _optionalChain([this, 'access', _497 => _497.stroke, 'optionalAccess', _498 => _498.cancel, 'call', _499 => _499()]);
16640
+ _optionalChain([this, 'access', _505 => _505.stroke, 'optionalAccess', _506 => _506.cancel, 'call', _507 => _507()]);
16485
16641
  this.stroke = null;
16486
16642
  this.move = null;
16487
16643
  }
@@ -17562,7 +17718,7 @@ function createImageSmartObjectTools(controller) {
17562
17718
  const layerSummary = (id) => {
17563
17719
  const s = controller.getState();
17564
17720
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, id);
17565
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _500 => _500.parent, 'optionalAccess', _501 => _501.id]), () => ( null)), index: loc.index } : null;
17721
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _508 => _508.parent, 'optionalAccess', _509 => _509.id]), () => ( null)), index: loc.index } : null;
17566
17722
  };
17567
17723
  const getSmart = {
17568
17724
  name: "get_smart_object",
@@ -18119,7 +18275,7 @@ function createImageShapeTools(controller) {
18119
18275
  const layerSummary = (id) => {
18120
18276
  const s = controller.getState();
18121
18277
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, id);
18122
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _502 => _502.parent, 'optionalAccess', _503 => _503.id]), () => ( null)), index: loc.index } : null;
18278
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _510 => _510.parent, 'optionalAccess', _511 => _511.id]), () => ( null)), index: loc.index } : null;
18123
18279
  };
18124
18280
  const get = {
18125
18281
  name: "get_shape_layer",
@@ -18336,7 +18492,7 @@ function createImageShapeTools(controller) {
18336
18492
  const mode = args.mode;
18337
18493
  controller.pathToSelection(pathSpec(args), { feather: args.feather, antiAlias: args.antiAlias, mode });
18338
18494
  const sel = controller.getSelection();
18339
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _504 => _504.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
18495
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _512 => _512.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
18340
18496
  }
18341
18497
  };
18342
18498
  const getVectorMask = {
@@ -18367,7 +18523,7 @@ function createImageShapeTools(controller) {
18367
18523
  handler: (args) => {
18368
18524
  const id = layerArg(args.layerId);
18369
18525
  const spec = pathSpec(args);
18370
- const hasPath = _optionalChain([spec, 'access', _505 => _505.components, 'optionalAccess', _506 => _506.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
18526
+ const hasPath = _optionalChain([spec, 'access', _513 => _513.components, 'optionalAccess', _514 => _514.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
18371
18527
  const from = _nullishCoalesce(args.from, () => ( (hasPath ? "path" : "reveal-all")));
18372
18528
  if (from !== "selection" && TRACE_KEYS.some((k) => args[k] !== void 0)) throw new Error("tolerance, cornerRoundness and minArea apply only to from selection.");
18373
18529
  controller.addVectorMask(id, from, spec, traceOptions(args));
@@ -18487,7 +18643,7 @@ function createImageTypeTools(controller) {
18487
18643
  const layerSummary = (id) => {
18488
18644
  const s = controller.getState();
18489
18645
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, id);
18490
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _507 => _507.parent, 'optionalAccess', _508 => _508.id]), () => ( null)), index: loc.index } : null;
18646
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _515 => _515.parent, 'optionalAccess', _516 => _516.id]), () => ( null)), index: loc.index } : null;
18491
18647
  };
18492
18648
  const range = (args) => ({ start: args.start, end: args.end });
18493
18649
  const listFonts = {
@@ -18496,7 +18652,7 @@ function createImageTypeTools(controller) {
18496
18652
  description: "Returns the font families type layers can use here (generic families such as sans-serif always work). Changes nothing.",
18497
18653
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
18498
18654
  annotations: { title: "List fonts", ...READ11 },
18499
- handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _509 => _509.getTextShaper, 'call', _510 => _510(), 'optionalAccess', _511 => _511.id]), () => ( null)) })
18655
+ handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _517 => _517.getTextShaper, 'call', _518 => _518(), 'optionalAccess', _519 => _519.id]), () => ( null)) })
18500
18656
  };
18501
18657
  const get = {
18502
18658
  name: "get_text_layer",
@@ -18652,7 +18808,7 @@ function createImageTypeTools(controller) {
18652
18808
  const init = pick2(args, ["text", "x", "y", "orientation", "box", "style", "paragraph", "rotation", "mode", "feather", "antiAlias"]);
18653
18809
  controller.selectTextShape(init);
18654
18810
  const sel = controller.getSelection();
18655
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _512 => _512.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
18811
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _520 => _520.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
18656
18812
  }
18657
18813
  };
18658
18814
  return [listFonts, get, add2, setText, setStyle, setParagraph, setFrame, setOrientation, toShape, typeMask];
@@ -18831,7 +18987,7 @@ function createImageEditorToolProvider(controller, options = {}) {
18831
18987
  for (const ref of [aboveId, parentId]) {
18832
18988
  if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
18833
18989
  }
18834
- if (parentId !== void 0 && _optionalChain([controller, 'access', _513 => _513.getLayer, 'call', _514 => _514(parentId), 'optionalAccess', _515 => _515.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
18990
+ if (parentId !== void 0 && _optionalChain([controller, 'access', _521 => _521.getLayer, 'call', _522 => _522(parentId), 'optionalAccess', _523 => _523.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
18835
18991
  const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId, useSelection: useSelection !== false });
18836
18992
  const layer = controller.getAdjustmentLayer(id);
18837
18993
  return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id), masked: Boolean(layer.mask) };
@@ -19000,6 +19156,374 @@ function downloadMaskImage(controller, source, name = "mask") {
19000
19156
  return { fileName, width, height };
19001
19157
  }
19002
19158
 
19159
+ // src/image-editor/selection/select-and-mask.ts
19160
+ var SELECT_AND_MASK_VIEWS = [
19161
+ { id: "onion-skin", label: "Onion Skin", key: "o", opacity: 0.5 },
19162
+ { id: "marching-ants", label: "Marching Ants", key: "m", opacity: 1 },
19163
+ { id: "overlay", label: "Overlay", key: "v", opacity: 0.5 },
19164
+ { id: "on-black", label: "On Black", key: "a", opacity: 1 },
19165
+ { id: "on-white", label: "On White", key: "t", opacity: 1 },
19166
+ { id: "black-white", label: "Black & White", key: "k", opacity: 1 },
19167
+ { id: "on-layers", label: "On Layers", key: "y", opacity: 1 }
19168
+ ];
19169
+ var SELECT_AND_MASK_TOOLS = [
19170
+ { id: "quick-select", label: "Quick Selection", key: "w" },
19171
+ { id: "refine-brush", label: "Refine Edge Brush", key: "r" },
19172
+ { id: "brush", label: "Brush", key: "b" },
19173
+ { id: "object", label: "Object Selection", key: "q" },
19174
+ { id: "lasso", label: "Lasso", key: "l" },
19175
+ { id: "hand", label: "Hand", key: "h" },
19176
+ { id: "zoom", label: "Zoom", key: "z" }
19177
+ ];
19178
+ var DEFAULT_SELECT_AND_MASK_SETTINGS = {
19179
+ params: { ...DEFAULT_REFINE_EDGE_PARAMS },
19180
+ output: "selection",
19181
+ decontaminate: 0,
19182
+ refineMode: "color",
19183
+ view: "onion-skin",
19184
+ opacity: 0.5,
19185
+ showEdge: false,
19186
+ showOriginal: false,
19187
+ realTime: true,
19188
+ highQuality: false,
19189
+ remember: false,
19190
+ tool: "quick-select",
19191
+ brushSize: 30,
19192
+ brushMode: "add"
19193
+ };
19194
+ var PREVIEW_SIZE = 1024;
19195
+ var remembered = null;
19196
+ function scalePixels(pixels, w, h) {
19197
+ if (w === pixels.width && h === pixels.height) return pixels;
19198
+ const { width: W, height: H, data } = pixels;
19199
+ const sum = new Float64Array(w * h * 4);
19200
+ const count = new Float64Array(w * h);
19201
+ for (let y = 0; y < H; y++) {
19202
+ const row = Math.min(h - 1, Math.floor(y * h / H)) * w;
19203
+ for (let x = 0; x < W; x++) {
19204
+ const o = row + Math.min(w - 1, Math.floor(x * w / W));
19205
+ const p = (y * W + x) * 4;
19206
+ for (let c = 0; c < 4; c++) sum[o * 4 + c] += data[p + c];
19207
+ count[o]++;
19208
+ }
19209
+ }
19210
+ const out = new Uint8ClampedArray(w * h * 4);
19211
+ for (let i = 0; i < w * h; i++) for (let c = 0; c < 4; c++) out[i * 4 + c] = sum[i * 4 + c] / (count[i] || 1);
19212
+ return { width: w, height: h, data: out };
19213
+ }
19214
+ function scaleEdit(edit, s) {
19215
+ const pt = (p) => ({ x: p.x * s, y: p.y * s });
19216
+ if (edit.kind === "object") {
19217
+ 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) };
19218
+ }
19219
+ const scaled = { ...edit, points: edit.points.map(pt) };
19220
+ if ("size" in edit && edit.size !== void 0) scaled.size = Math.max(1, edit.size * s);
19221
+ return scaled;
19222
+ }
19223
+ function scaleParams(p, s) {
19224
+ return { ...p, radius: p.radius * s, feather: p.feather * s };
19225
+ }
19226
+ var SelectAndMaskSession = (_class16 = class {
19227
+ constructor(controller) {;_class16.prototype.__init120.call(this);_class16.prototype.__init121.call(this);_class16.prototype.__init122.call(this);_class16.prototype.__init123.call(this);_class16.prototype.__init124.call(this);_class16.prototype.__init125.call(this);_class16.prototype.__init126.call(this);_class16.prototype.__init127.call(this);_class16.prototype.__init128.call(this);_class16.prototype.__init129.call(this);_class16.prototype.__init130.call(this);
19228
+ this.controller = controller;
19229
+ this.base = controller.getSelection();
19230
+ this.settingsValue = remembered ? { ...remembered, params: { ...remembered.params }, showOriginal: false } : { ...DEFAULT_SELECT_AND_MASK_SETTINGS, params: { ...DEFAULT_SELECT_AND_MASK_SETTINGS.params } };
19231
+ }
19232
+
19233
+
19234
+ __init120() {this.editsList = []}
19235
+ /** The edit being painted, shown in the preview but not yet in `edits`. */
19236
+ __init121() {this.live = null}
19237
+ __init122() {this.dragStart = null}
19238
+ __init123() {this.pixels = null}
19239
+ __init124() {this.previewPixels = null}
19240
+
19241
+ __init125() {this.previewMask = null}
19242
+ __init126() {this.baseMask = null}
19243
+ __init127() {this.listeners = /* @__PURE__ */ new Set()}
19244
+ /** Why the preview could not be made (no pixels), for the UI. */
19245
+ __init128() {this.error = null}
19246
+ /** A note for the UI, such as object aware refinement applying only on OK. */
19247
+ __init129() {this.note = null}
19248
+ /** Bumped each time the preview changes, so a UI can redraw. */
19249
+ __init130() {this.revision = 0}
19250
+ get settings() {
19251
+ return this.settingsValue;
19252
+ }
19253
+ get edits() {
19254
+ return this.editsList;
19255
+ }
19256
+ /** Reads the image and makes the first preview. Resolves to false when the pixels are unavailable. */
19257
+ async open() {
19258
+ try {
19259
+ this.pixels = await this.controller.getSamplePixels({});
19260
+ } catch (err) {
19261
+ this.error = err instanceof Error ? err.message : String(err);
19262
+ }
19263
+ if (!this.pixels) {
19264
+ this.error ??= "The image pixels are not available, so Select and Mask cannot preview.";
19265
+ this.emit();
19266
+ return false;
19267
+ }
19268
+ this.rescale();
19269
+ this.recompute();
19270
+ return true;
19271
+ }
19272
+ subscribe(listener) {
19273
+ this.listeners.add(listener);
19274
+ return () => this.listeners.delete(listener);
19275
+ }
19276
+ emit() {
19277
+ this.revision++;
19278
+ for (const l of this.listeners) l();
19279
+ }
19280
+ /** Preview size and the scale from natural pixels to it. */
19281
+ get previewSize() {
19282
+ const p = this.previewPixels;
19283
+ if (!p || !this.pixels) return { width: 0, height: 0, scale: 1 };
19284
+ return { width: p.width, height: p.height, scale: p.width / this.pixels.width };
19285
+ }
19286
+ /** Changes settings; the preview follows. Choosing a view also sets its usual opacity. */
19287
+ update(changes) {
19288
+ const next = { ...this.settingsValue, ...changes, params: { ...this.settingsValue.params, ..._nullishCoalesce(changes.params, () => ( {})) } };
19289
+ if (changes.view && changes.view !== this.settingsValue.view && changes.opacity === void 0) {
19290
+ next.opacity = SELECT_AND_MASK_VIEWS.find((v) => v.id === changes.view).opacity;
19291
+ }
19292
+ const rescale = next.highQuality !== this.settingsValue.highQuality;
19293
+ this.settingsValue = next;
19294
+ if (rescale) this.rescale();
19295
+ this.recompute();
19296
+ }
19297
+ rescale() {
19298
+ const px2 = this.pixels;
19299
+ if (!px2) return;
19300
+ const s = this.settingsValue.highQuality ? 1 : Math.min(1, PREVIEW_SIZE / Math.max(px2.width, px2.height));
19301
+ const w = Math.max(1, Math.round(px2.width * s));
19302
+ const h = Math.max(1, Math.round(px2.height * s));
19303
+ this.previewPixels = scalePixels(px2, w, h);
19304
+ this.baseMask = _optionalChain([this, 'access', _524 => _524.base, 'optionalAccess', _525 => _525.bounds]) ? s === 1 ? this.base : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, this.base, w, h) : null;
19305
+ }
19306
+ /** Recomputes the preview mask from the base selection, the strokes and the settings. */
19307
+ recompute() {
19308
+ const px2 = this.previewPixels;
19309
+ if (!px2) return;
19310
+ const { scale } = this.previewSize;
19311
+ const edits = [...this.editsList, ...this.live ? [this.live] : []].map((e) => scaleEdit(e, scale));
19312
+ this.note = this.settingsValue.refineMode === "object" ? "Object aware refinement asks the segmentation model on OK; the preview refines by colour." : null;
19313
+ try {
19314
+ const { selection, refineBrush } = applyRefineEdits(px2, this.baseMask, edits, px2.width, px2.height);
19315
+ this.previewMask = _optionalChain([selection, 'optionalAccess', _526 => _526.bounds]) ? refineSelection(px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
19316
+ this.error = null;
19317
+ } catch (err) {
19318
+ this.previewMask = null;
19319
+ this.error = err instanceof Error ? err.message : String(err);
19320
+ }
19321
+ this.emit();
19322
+ }
19323
+ /** Coverage 0..1 of the preview at (x, y) in preview pixels (for tests and hover readouts). */
19324
+ coverageAt(x, y) {
19325
+ const m = this.settingsValue.showOriginal ? this.baseMask : this.previewMask;
19326
+ if (!m) return 0;
19327
+ const xi = Math.floor(x);
19328
+ const yi = Math.floor(y);
19329
+ if (xi < 0 || yi < 0 || xi >= m.width || yi >= m.height) return 0;
19330
+ return m.data[yi * m.width + xi] / 255;
19331
+ }
19332
+ /** The preview drawn in the current view mode: RGBA at {@link previewSize}. */
19333
+ render() {
19334
+ const px2 = this.previewPixels;
19335
+ if (!px2) return new Uint8ClampedArray(0);
19336
+ const { width: w, height: h } = px2;
19337
+ const n = w * h;
19338
+ const s = this.settingsValue;
19339
+ const mask = _nullishCoalesce((s.showOriginal ? this.baseMask : this.previewMask), () => ( _chunkUYXL6ZWQcjs.createSelectionMask.call(void 0, w, h)));
19340
+ const m = mask.data;
19341
+ const out = new Uint8ClampedArray(n * 4);
19342
+ const k = Math.min(1, Math.max(0, s.opacity));
19343
+ let edgeBand = null;
19344
+ if (s.showEdge) {
19345
+ edgeBand = new Uint8Array(n);
19346
+ const r = Math.max(1, Math.round(Math.max(s.params.radius, 2) * this.previewSize.scale));
19347
+ for (let y = 0; y < h; y++) {
19348
+ for (let x = 0; x < w; x++) {
19349
+ const v = m[y * w + x];
19350
+ if (v <= 3 || v >= 252) continue;
19351
+ for (let j = Math.max(0, y - r); j <= Math.min(h - 1, y + r); j++) edgeBand.fill(1, j * w + Math.max(0, x - r), j * w + Math.min(w, x + r + 1));
19352
+ }
19353
+ }
19354
+ }
19355
+ for (let i = 0; i < n; i++) {
19356
+ const a = m[i] / 255;
19357
+ const p = i * 4;
19358
+ const r = px2.data[p];
19359
+ const g = px2.data[p + 1];
19360
+ const b = px2.data[p + 2];
19361
+ let o;
19362
+ const x = i % w;
19363
+ const y = (i - x) / w;
19364
+ const checker = ((x >> 3) + (y >> 3)) % 2 ? 204 : 255;
19365
+ const hide = (1 - a) * k;
19366
+ switch (s.view) {
19367
+ case "black-white":
19368
+ o = [m[i], m[i], m[i]];
19369
+ break;
19370
+ case "overlay":
19371
+ o = [r + (255 - r) * hide, g * (1 - hide), b * (1 - hide)];
19372
+ break;
19373
+ case "on-black":
19374
+ o = [r * (1 - hide), g * (1 - hide), b * (1 - hide)];
19375
+ break;
19376
+ case "on-white":
19377
+ o = [r + (255 - r) * hide, g + (255 - g) * hide, b + (255 - b) * hide];
19378
+ break;
19379
+ case "marching-ants": {
19380
+ o = [r, g, b];
19381
+ const inside = m[i] >= 128;
19382
+ const edge = x > 0 && m[i - 1] >= 128 !== inside || x + 1 < w && m[i + 1] >= 128 !== inside || y > 0 && m[i - w] >= 128 !== inside || y + 1 < h && m[i + w] >= 128 !== inside;
19383
+ if (edge) {
19384
+ const v = (x + y >> 2) % 2 ? 0 : 255;
19385
+ o = [v, v, v];
19386
+ }
19387
+ break;
19388
+ }
19389
+ default:
19390
+ o = [r + (checker - r) * hide, g + (checker - g) * hide, b + (checker - b) * hide];
19391
+ }
19392
+ if (edgeBand && !edgeBand[i]) o = [o[0] * 0.15, o[1] * 0.15, o[2] * 0.15];
19393
+ out[p] = o[0];
19394
+ out[p + 1] = o[1];
19395
+ out[p + 2] = o[2];
19396
+ out[p + 3] = 255;
19397
+ }
19398
+ return out;
19399
+ }
19400
+ /**
19401
+ * Pointer down at `point` (natural pixels) with the current tool: starts a stroke (Quick
19402
+ * Selection, brushes, lasso) or a box (Object Selection). Alt (or the subtract mode) removes.
19403
+ * Hand and Zoom are the UI's own; they return false here.
19404
+ */
19405
+ begin(point, modifiers = {}) {
19406
+ const s = this.settingsValue;
19407
+ const mode = modifiers.altKey ? s.brushMode === "add" ? "subtract" : "add" : s.brushMode;
19408
+ this.dragStart = point;
19409
+ switch (s.tool) {
19410
+ case "quick-select":
19411
+ this.live = { kind: "quick-select", points: [point], size: s.brushSize, mode };
19412
+ break;
19413
+ case "brush":
19414
+ this.live = { kind: "brush", points: [point], size: s.brushSize, mode };
19415
+ break;
19416
+ case "refine-brush":
19417
+ this.live = { kind: "refine-brush", points: [point], size: s.brushSize };
19418
+ break;
19419
+ case "lasso":
19420
+ this.live = { kind: "lasso", points: [point], mode };
19421
+ break;
19422
+ case "object":
19423
+ this.live = { kind: "object", point, mode };
19424
+ break;
19425
+ default:
19426
+ this.dragStart = null;
19427
+ return false;
19428
+ }
19429
+ if (s.realTime && s.tool !== "lasso" && s.tool !== "object") this.recompute();
19430
+ return true;
19431
+ }
19432
+ /** Pointer move while a stroke is down. */
19433
+ move(point) {
19434
+ const live = this.live;
19435
+ if (!live || !this.dragStart) return;
19436
+ if (live.kind === "object") {
19437
+ const a = this.dragStart;
19438
+ 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) };
19439
+ this.live = rect.width >= 4 && rect.height >= 4 ? { kind: "object", rect, mode: live.mode } : { kind: "object", point: a, mode: live.mode };
19440
+ return;
19441
+ }
19442
+ const last = live.points[live.points.length - 1];
19443
+ if (Math.hypot(point.x - last.x, point.y - last.y) < 1) return;
19444
+ live.points.push(point);
19445
+ if (this.settingsValue.realTime && live.kind !== "lasso") this.recompute();
19446
+ }
19447
+ /** Pointer up: the stroke becomes an edit (one step of the workspace's own undo). */
19448
+ end() {
19449
+ const live = this.live;
19450
+ this.live = null;
19451
+ this.dragStart = null;
19452
+ if (!live) return;
19453
+ if (live.kind === "lasso" && live.points.length < 3) return;
19454
+ this.editsList.push(live);
19455
+ this.recompute();
19456
+ }
19457
+ /** Removes the last stroke (Ctrl/⌘+Z in the workspace). Returns false when there is none. */
19458
+ undoEdit() {
19459
+ if (!this.editsList.length) return false;
19460
+ this.editsList.pop();
19461
+ this.recompute();
19462
+ return true;
19463
+ }
19464
+ /** Clears the strokes and goes back to the default settings (Reset). */
19465
+ reset() {
19466
+ this.editsList.length = 0;
19467
+ this.settingsValue = { ...DEFAULT_SELECT_AND_MASK_SETTINGS, params: { ...DEFAULT_SELECT_AND_MASK_SETTINGS.params }, tool: this.settingsValue.tool };
19468
+ this.rescale();
19469
+ this.recompute();
19470
+ }
19471
+ /**
19472
+ * Photoshop's keys in the workspace: a view letter, F (next view), X (all views off and on:
19473
+ * Show Original), J (Show Edge), P (Show Original), a tool letter, [ and ] (brush size).
19474
+ * Returns true when the key was used.
19475
+ */
19476
+ handleKey(key) {
19477
+ const k = key.toLowerCase();
19478
+ const view = SELECT_AND_MASK_VIEWS.find((v) => v.key === k);
19479
+ if (view) {
19480
+ this.update({ view: view.id });
19481
+ return true;
19482
+ }
19483
+ const tool = SELECT_AND_MASK_TOOLS.find((t) => t.key === k);
19484
+ if (tool) {
19485
+ this.update({ tool: tool.id });
19486
+ return true;
19487
+ }
19488
+ if (k === "f") {
19489
+ const i = SELECT_AND_MASK_VIEWS.findIndex((v) => v.id === this.settingsValue.view);
19490
+ this.update({ view: SELECT_AND_MASK_VIEWS[(i + 1) % SELECT_AND_MASK_VIEWS.length].id });
19491
+ return true;
19492
+ }
19493
+ if (k === "p" || k === "x") {
19494
+ this.update({ showOriginal: !this.settingsValue.showOriginal });
19495
+ return true;
19496
+ }
19497
+ if (k === "j") {
19498
+ this.update({ showEdge: !this.settingsValue.showEdge });
19499
+ return true;
19500
+ }
19501
+ if (k === "[" || k === "]") {
19502
+ const size = this.settingsValue.brushSize;
19503
+ this.settingsValue = { ...this.settingsValue, brushSize: Math.max(1, Math.round(k === "]" ? size * 1.25 : size / 1.25)) };
19504
+ this.emit();
19505
+ return true;
19506
+ }
19507
+ return false;
19508
+ }
19509
+ /**
19510
+ * OK: applies the strokes and settings to the image as one undo step (the same call an agent
19511
+ * makes) and remembers the settings when asked to.
19512
+ */
19513
+ async commit() {
19514
+ const s = this.settingsValue;
19515
+ remembered = s.remember ? { ...s, params: { ...s.params } } : null;
19516
+ return this.controller.refineSelectionTo(s.params, s.output, {
19517
+ edits: [...this.editsList],
19518
+ decontaminate: s.output === "new-layer" || s.output === "new-layer-with-mask" ? s.decontaminate : 0,
19519
+ refineMode: s.refineMode
19520
+ });
19521
+ }
19522
+ }, _class16);
19523
+ function forgetSelectAndMaskSettings() {
19524
+ remembered = null;
19525
+ }
19526
+
19003
19527
  // src/image-editor/mosaic-filter.ts
19004
19528
  function resolveMosaicRegionBounds(region, imgWidth, imgHeight) {
19005
19529
  if (imgWidth <= 0 || imgHeight <= 0 || region.width <= 0 || region.height <= 0) {
@@ -19145,7 +19669,7 @@ function maskThumbnailClick(controller, layer, e) {
19145
19669
  } else if (e.altKey && !layer.mask.source) {
19146
19670
  const mode = e.shiftKey ? "overlay" : "gray";
19147
19671
  const view = controller.getMaskView();
19148
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _516 => _516.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
19672
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _527 => _527.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
19149
19673
  } else if (e.shiftKey) {
19150
19674
  controller.setLayerMaskProps(layer.id, { enabled: layer.mask.enabled === false });
19151
19675
  } else {
@@ -19209,7 +19733,7 @@ function layerHasThumbnail(layer) {
19209
19733
  return layer.type === "pixel" || layer.type === "shape" || layer.type === "type";
19210
19734
  }
19211
19735
  function layerWarning(layer) {
19212
- if (layer.type === "type" && _optionalChain([layer, 'access', _517 => _517.missingFonts, 'optionalAccess', _518 => _518.length])) {
19736
+ if (layer.type === "type" && _optionalChain([layer, 'access', _528 => _528.missingFonts, 'optionalAccess', _529 => _529.length])) {
19213
19737
  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."}`;
19214
19738
  }
19215
19739
  return null;
@@ -19232,16 +19756,16 @@ function layerMenu(controller) {
19232
19756
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
19233
19757
  const below = loc ? siblings[loc.index - 1] : void 0;
19234
19758
  const hasSel = controller.hasSelection;
19235
- const isPixel = _optionalChain([active, 'optionalAccess', _519 => _519.type]) === "pixel";
19236
- const hasOwnPixels = _optionalChain([active, 'optionalAccess', _520 => _520.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _521 => _521.type]) === "shape" || _optionalChain([active, 'optionalAccess', _522 => _522.type]) === "type" || _optionalChain([active, 'optionalAccess', _523 => _523.type]) === "smart";
19759
+ const isPixel = _optionalChain([active, 'optionalAccess', _530 => _530.type]) === "pixel";
19760
+ const hasOwnPixels = _optionalChain([active, 'optionalAccess', _531 => _531.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _532 => _532.type]) === "shape" || _optionalChain([active, 'optionalAccess', _533 => _533.type]) === "type" || _optionalChain([active, 'optionalAccess', _534 => _534.type]) === "smart";
19237
19761
  return [
19238
19762
  { action: "new-layer", label: "New Layer", enabled: true },
19239
19763
  { action: "new-group", label: "New Group", enabled: true },
19240
19764
  { action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
19241
19765
  { action: "delete", label: "Delete Layer", enabled: Boolean(active) },
19242
19766
  { action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
19243
- { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _524 => _524.type]) === "group" },
19244
- { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _525 => _525.visible]) && _optionalChain([below, 'optionalAccess', _526 => _526.type]) === "pixel") },
19767
+ { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _535 => _535.type]) === "group" },
19768
+ { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _536 => _536.visible]) && _optionalChain([below, 'optionalAccess', _537 => _537.type]) === "pixel") },
19245
19769
  { action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
19246
19770
  { action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
19247
19771
  { action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
@@ -19251,27 +19775,27 @@ function layerMenu(controller) {
19251
19775
  { action: "add-mask-hide-selection", label: "Add Mask Hiding Selection", enabled: Boolean(active) && hasSel },
19252
19776
  { action: "add-mask-transparency", label: "Add Mask from Transparency", enabled: hasOwnPixels },
19253
19777
  { action: "select-transparency", label: "Select Layer Pixels", enabled: hasOwnPixels },
19254
- { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _527 => _527.mask])) },
19255
- { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _528 => _528.mask])) },
19256
- { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _529 => _529.mask, 'optionalAccess', _530 => _530.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _531 => _531.mask])) },
19257
- { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _532 => _532.mask, 'optionalAccess', _533 => _533.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _534 => _534.mask]) && !active.mask.source) },
19258
- { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _535 => _535.mask, 'optionalAccess', _536 => _536.source])) },
19259
- { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _537 => _537.mask, 'optionalAccess', _538 => _538.source])) },
19260
- { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _539 => _539.mask, 'optionalAccess', _540 => _540.source])) && hasSel },
19261
- { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _541 => _541.vectorMask])) },
19262
- { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _542 => _542.vectorMask, 'optionalAccess', _543 => _543.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _544 => _544.vectorMask])) },
19263
- { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _545 => _545.vectorMask])) },
19264
- { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _546 => _546.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _547 => _547.type]) === "smart" || _optionalChain([active, 'optionalAccess', _548 => _548.type]) === "shape" || _optionalChain([active, 'optionalAccess', _549 => _549.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _550 => _550.type]) === "pixel" && _optionalChain([active, 'access', _551 => _551.filters, 'optionalAccess', _552 => _552.length])) },
19778
+ { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _538 => _538.mask])) },
19779
+ { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _539 => _539.mask])) },
19780
+ { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _540 => _540.mask, 'optionalAccess', _541 => _541.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _542 => _542.mask])) },
19781
+ { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _543 => _543.mask, 'optionalAccess', _544 => _544.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _545 => _545.mask]) && !active.mask.source) },
19782
+ { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _546 => _546.mask, 'optionalAccess', _547 => _547.source])) },
19783
+ { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _548 => _548.mask, 'optionalAccess', _549 => _549.source])) },
19784
+ { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _550 => _550.mask, 'optionalAccess', _551 => _551.source])) && hasSel },
19785
+ { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _552 => _552.vectorMask])) },
19786
+ { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _553 => _553.vectorMask, 'optionalAccess', _554 => _554.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _555 => _555.vectorMask])) },
19787
+ { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _556 => _556.vectorMask])) },
19788
+ { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _557 => _557.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _558 => _558.type]) === "smart" || _optionalChain([active, 'optionalAccess', _559 => _559.type]) === "shape" || _optionalChain([active, 'optionalAccess', _560 => _560.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _561 => _561.type]) === "pixel" && _optionalChain([active, 'access', _562 => _562.filters, 'optionalAccess', _563 => _563.length])) },
19265
19789
  { action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
19266
- { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _553 => _553.type]) === "smart" },
19267
- { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _554 => _554.type]) === "smart" },
19268
- { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _555 => _555.type]) === "smart" && !_optionalChain([active, 'access', _556 => _556.smartFilters, 'optionalAccess', _557 => _557.mask]) },
19269
- { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _558 => _558.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
19790
+ { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _564 => _564.type]) === "smart" },
19791
+ { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _565 => _565.type]) === "smart" },
19792
+ { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _566 => _566.type]) === "smart" && !_optionalChain([active, 'access', _567 => _567.smartFilters, 'optionalAccess', _568 => _568.mask]) },
19793
+ { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _569 => _569.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
19270
19794
  ];
19271
19795
  }
19272
19796
  async function runLayerMenuAction(controller, action) {
19273
19797
  const active = controller.getActiveLayer();
19274
- const id = _optionalChain([active, 'optionalAccess', _559 => _559.id]);
19798
+ const id = _optionalChain([active, 'optionalAccess', _570 => _570.id]);
19275
19799
  try {
19276
19800
  switch (action) {
19277
19801
  case "new-layer":
@@ -19327,10 +19851,10 @@ async function runLayerMenuAction(controller, action) {
19327
19851
  if (id) controller.removeLayerMask(id);
19328
19852
  break;
19329
19853
  case "toggle-mask":
19330
- if (id && _optionalChain([active, 'optionalAccess', _560 => _560.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
19854
+ if (id && _optionalChain([active, 'optionalAccess', _571 => _571.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
19331
19855
  break;
19332
19856
  case "toggle-mask-link":
19333
- if (id && _optionalChain([active, 'optionalAccess', _561 => _561.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
19857
+ if (id && _optionalChain([active, 'optionalAccess', _572 => _572.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
19334
19858
  break;
19335
19859
  case "add-vector-mask":
19336
19860
  case "add-vector-mask-hide":
@@ -19343,7 +19867,7 @@ async function runLayerMenuAction(controller, action) {
19343
19867
  if (id) controller.removeVectorMask(id);
19344
19868
  break;
19345
19869
  case "toggle-vector-mask":
19346
- if (id && _optionalChain([active, 'optionalAccess', _562 => _562.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
19870
+ if (id && _optionalChain([active, 'optionalAccess', _573 => _573.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
19347
19871
  break;
19348
19872
  case "rasterize-vector-mask":
19349
19873
  if (id) controller.rasterizeVectorMask(id);
@@ -19364,7 +19888,7 @@ async function runLayerMenuAction(controller, action) {
19364
19888
  if (id) controller.setSmartFilterMask(id, "reveal-all");
19365
19889
  break;
19366
19890
  case "toggle-clip":
19367
- if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _563 => _563.clipped]) });
19891
+ if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _574 => _574.clipped]) });
19368
19892
  break;
19369
19893
  }
19370
19894
  return null;
@@ -19374,7 +19898,7 @@ async function runLayerMenuAction(controller, action) {
19374
19898
  }
19375
19899
  function smartFilterRows(layer) {
19376
19900
  if (layer.type !== "smart") return [];
19377
- const list = _nullishCoalesce(_optionalChain([layer, 'access', _564 => _564.smartFilters, 'optionalAccess', _565 => _565.filters]), () => ( []));
19901
+ const list = _nullishCoalesce(_optionalChain([layer, 'access', _575 => _575.smartFilters, 'optionalAccess', _576 => _576.filters]), () => ( []));
19378
19902
  const rows = list.map((f, index) => ({
19379
19903
  filter: f,
19380
19904
  index,
@@ -19400,8 +19924,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
19400
19924
  };
19401
19925
  collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
19402
19926
  const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
19403
- const imgW = _optionalChain([state, 'access', _566 => _566.imageDimensions, 'optionalAccess', _567 => _567.width]) || 1;
19404
- const imgH = _optionalChain([state, 'access', _568 => _568.imageDimensions, 'optionalAccess', _569 => _569.height]) || 1;
19927
+ const imgW = _optionalChain([state, 'access', _577 => _577.imageDimensions, 'optionalAccess', _578 => _578.width]) || 1;
19928
+ const imgH = _optionalChain([state, 'access', _579 => _579.imageDimensions, 'optionalAccess', _580 => _580.height]) || 1;
19405
19929
  return ctrlLayers.map((l) => {
19406
19930
  const bounds = controller.getLayerBounds(l.id) || {
19407
19931
  x: 0,
@@ -19410,8 +19934,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
19410
19934
  height: imgH
19411
19935
  };
19412
19936
  const sLayer = sLayerMap.get(l.id);
19413
- const assetKey = _optionalChain([sLayer, 'optionalAccess', _570 => _570.asset]);
19414
- const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _571 => _571.source]) === "document" ? fallbackImageUrl : "");
19937
+ const assetKey = _optionalChain([sLayer, 'optionalAccess', _581 => _581.asset]);
19938
+ const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _582 => _582.source]) === "document" ? fallbackImageUrl : "");
19415
19939
  return {
19416
19940
  id: l.id,
19417
19941
  name: l.name || "Untitled Layer",
@@ -19465,9 +19989,9 @@ async function addLayerOfKind(controller, id, init) {
19465
19989
  const cx = Math.round(canvas.width / 2);
19466
19990
  const cy = Math.round(canvas.height / 2);
19467
19991
  return controller.addTextLayer({
19468
- text: _optionalChain([init, 'optionalAccess', _572 => _572.text]) || "New Text",
19469
- x: typeof _optionalChain([init, 'optionalAccess', _573 => _573.x]) === "number" ? init.x : cx - 100,
19470
- y: typeof _optionalChain([init, 'optionalAccess', _574 => _574.y]) === "number" ? init.y : cy,
19992
+ text: _optionalChain([init, 'optionalAccess', _583 => _583.text]) || "New Text",
19993
+ x: typeof _optionalChain([init, 'optionalAccess', _584 => _584.x]) === "number" ? init.x : cx - 100,
19994
+ y: typeof _optionalChain([init, 'optionalAccess', _585 => _585.y]) === "number" ? init.y : cy,
19471
19995
  ...init
19472
19996
  });
19473
19997
  }
@@ -19480,10 +20004,10 @@ async function addLayerOfKind(controller, id, init) {
19480
20004
  return controller.addShapeLayer({
19481
20005
  shape: {
19482
20006
  kind: "rect",
19483
- x: typeof _optionalChain([init, 'optionalAccess', _575 => _575.x]) === "number" ? init.x : cx - Math.round(w / 2),
19484
- y: typeof _optionalChain([init, 'optionalAccess', _576 => _576.y]) === "number" ? init.y : cy - Math.round(h / 2),
19485
- width: typeof _optionalChain([init, 'optionalAccess', _577 => _577.width]) === "number" ? init.width : w,
19486
- height: typeof _optionalChain([init, 'optionalAccess', _578 => _578.height]) === "number" ? init.height : h
20007
+ x: typeof _optionalChain([init, 'optionalAccess', _586 => _586.x]) === "number" ? init.x : cx - Math.round(w / 2),
20008
+ y: typeof _optionalChain([init, 'optionalAccess', _587 => _587.y]) === "number" ? init.y : cy - Math.round(h / 2),
20009
+ width: typeof _optionalChain([init, 'optionalAccess', _588 => _588.width]) === "number" ? init.width : w,
20010
+ height: typeof _optionalChain([init, 'optionalAccess', _589 => _589.height]) === "number" ? init.height : h
19487
20011
  },
19488
20012
  name: "Rectangle",
19489
20013
  ...init
@@ -19498,10 +20022,10 @@ async function addLayerOfKind(controller, id, init) {
19498
20022
  return controller.addShapeLayer({
19499
20023
  shape: {
19500
20024
  kind: "ellipse",
19501
- x: typeof _optionalChain([init, 'optionalAccess', _579 => _579.x]) === "number" ? init.x : cx - Math.round(w / 2),
19502
- y: typeof _optionalChain([init, 'optionalAccess', _580 => _580.y]) === "number" ? init.y : cy - Math.round(h / 2),
19503
- width: typeof _optionalChain([init, 'optionalAccess', _581 => _581.width]) === "number" ? init.width : w,
19504
- height: typeof _optionalChain([init, 'optionalAccess', _582 => _582.height]) === "number" ? init.height : h
20025
+ x: typeof _optionalChain([init, 'optionalAccess', _590 => _590.x]) === "number" ? init.x : cx - Math.round(w / 2),
20026
+ y: typeof _optionalChain([init, 'optionalAccess', _591 => _591.y]) === "number" ? init.y : cy - Math.round(h / 2),
20027
+ width: typeof _optionalChain([init, 'optionalAccess', _592 => _592.width]) === "number" ? init.width : w,
20028
+ height: typeof _optionalChain([init, 'optionalAccess', _593 => _593.height]) === "number" ? init.height : h
19505
20029
  },
19506
20030
  name: "Ellipse",
19507
20031
  ...init
@@ -19562,18 +20086,18 @@ function layerEffectsPanel(layer) {
19562
20086
  if (!layer) return { ...empty, available: false, reason: "Select a layer to add a layer style." };
19563
20087
  if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have a layer style." };
19564
20088
  const fx = layer.effects;
19565
- const readOnly = Boolean(_optionalChain([layer, 'access', _583 => _583.locks, 'optionalAccess', _584 => _584.all]));
20089
+ const readOnly = Boolean(_optionalChain([layer, 'access', _594 => _594.locks, 'optionalAccess', _595 => _595.all]));
19566
20090
  return {
19567
20091
  available: true,
19568
20092
  readOnly,
19569
20093
  reason: readOnly ? "The layer is locked; unlock it to change its layer style." : void 0,
19570
- enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _585 => _585.enabled]), () => ( true)),
19571
- scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _586 => _586.scale]), () => ( 1)),
19572
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _587 => _587.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkHGTDMKNEcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
20094
+ enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _596 => _596.enabled]), () => ( true)),
20095
+ scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _597 => _597.scale]), () => ( 1)),
20096
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _598 => _598.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkHGTDMKNEcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19573
20097
  };
19574
20098
  }
19575
20099
  function layerEffectsBadge(layer) {
19576
- if (!_optionalChain([layer, 'access', _588 => _588.effects, 'optionalAccess', _589 => _589.items, 'access', _590 => _590.length])) return null;
20100
+ if (!_optionalChain([layer, 'access', _599 => _599.effects, 'optionalAccess', _600 => _600.items, 'access', _601 => _601.length])) return null;
19577
20101
  return _chunkHGTDMKNEcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
19578
20102
  }
19579
20103
  var LAYER_EFFECT_MENU = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkHGTDMKNEcjs.layerEffectLabel.call(void 0, kind) }));
@@ -19618,8 +20142,8 @@ function fillControls(f, allowPattern, patterns) {
19618
20142
  }
19619
20143
  function gradientControls(prefix, g) {
19620
20144
  return [
19621
- { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _591 => _591.stops, 'access', _592 => _592[0], 'optionalAccess', _593 => _593.color]), () => ( "#000000")) },
19622
- { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _594 => _594.stops, 'access', _595 => _595[g.stops.length - 1], 'optionalAccess', _596 => _596.color]), () => ( "#ffffff")) },
20145
+ { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _602 => _602.stops, 'access', _603 => _603[0], 'optionalAccess', _604 => _604.color]), () => ( "#000000")) },
20146
+ { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _605 => _605.stops, 'access', _606 => _606[g.stops.length - 1], 'optionalAccess', _607 => _607.color]), () => ( "#ffffff")) },
19623
20147
  { key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
19624
20148
  { key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
19625
20149
  { key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
@@ -19711,19 +20235,19 @@ function layerEffectControls(e, patterns = []) {
19711
20235
  }
19712
20236
  function fillOfType(current, type, patterns) {
19713
20237
  if (type === "gradient") return { type: "gradient", gradient: _chunkHGTDMKNEcjs.defaultEffectGradient.call(void 0, ) };
19714
- if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _597 => _597[0], 'optionalAccess', _598 => _598.id]), () => ( "checker")), scale: 1 };
20238
+ if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _608 => _608[0], 'optionalAccess', _609 => _609.id]), () => ( "checker")), scale: 1 };
19715
20239
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
19716
20240
  }
19717
20241
  function effectControlChange(effect, key, value, patterns = []) {
19718
20242
  const [top, ...rest] = key.split(".");
19719
20243
  if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
19720
20244
  if (top === "patternId" && !rest.length) {
19721
- const name = _optionalChain([patternOptions, 'call', _599 => _599(patterns), 'access', _600 => _600.find, 'call', _601 => _601((o) => o.value === value), 'optionalAccess', _602 => _602.label]);
20245
+ const name = _optionalChain([patternOptions, 'call', _610 => _610(patterns), 'access', _611 => _611.find, 'call', _612 => _612((o) => o.value === value), 'optionalAccess', _613 => _613.label]);
19722
20246
  return name ? { patternId: value, name } : { patternId: value };
19723
20247
  }
19724
20248
  if (!rest.length) return { [top]: value };
19725
20249
  if (top === "fill" && rest[0] === "patternId") {
19726
- const name = _optionalChain([patternOptions, 'call', _603 => _603(patterns), 'access', _604 => _604.find, 'call', _605 => _605((o) => o.value === value), 'optionalAccess', _606 => _606.label]);
20250
+ const name = _optionalChain([patternOptions, 'call', _614 => _614(patterns), 'access', _615 => _615.find, 'call', _616 => _616((o) => o.value === value), 'optionalAccess', _617 => _617.label]);
19727
20251
  return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
19728
20252
  }
19729
20253
  return { [top]: setPath(getPath(effect, top), rest, value) };
@@ -19750,7 +20274,7 @@ function colorPanelView(controller) {
19750
20274
  profileName: profile.name,
19751
20275
  workingSpace: profile.builtin,
19752
20276
  mode: profile.mode,
19753
- cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _607 => _607.cmykProfile, 'optionalAccess', _608 => _608.name]), () => ( null)),
20277
+ cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _618 => _618.cmykProfile, 'optionalAccess', _619 => _619.name]), () => ( null)),
19754
20278
  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
19755
20279
  };
19756
20280
  }
@@ -19932,33 +20456,33 @@ function boxFrameHit(overlay, p, tolerance, band) {
19932
20456
  }
19933
20457
  return null;
19934
20458
  }
19935
- var FreeTransformTool = (_class16 = class {
19936
- constructor(controller, options = {}) {;_class16.prototype.__init120.call(this);_class16.prototype.__init121.call(this);_class16.prototype.__init122.call(this);_class16.prototype.__init123.call(this);_class16.prototype.__init124.call(this);_class16.prototype.__init125.call(this);_class16.prototype.__init126.call(this);_class16.prototype.__init127.call(this);_class16.prototype.__init128.call(this);_class16.prototype.__init129.call(this);_class16.prototype.__init130.call(this);_class16.prototype.__init131.call(this);_class16.prototype.__init132.call(this);_class16.prototype.__init133.call(this);
20459
+ var FreeTransformTool = (_class17 = class {
20460
+ constructor(controller, options = {}) {;_class17.prototype.__init131.call(this);_class17.prototype.__init132.call(this);_class17.prototype.__init133.call(this);_class17.prototype.__init134.call(this);_class17.prototype.__init135.call(this);_class17.prototype.__init136.call(this);_class17.prototype.__init137.call(this);_class17.prototype.__init138.call(this);_class17.prototype.__init139.call(this);_class17.prototype.__init140.call(this);_class17.prototype.__init141.call(this);_class17.prototype.__init142.call(this);_class17.prototype.__init143.call(this);_class17.prototype.__init144.call(this);
19937
20461
  this.controller = controller;
19938
20462
  this.options = options;
19939
20463
  }
19940
20464
 
19941
20465
 
19942
- __init120() {this.sessionRef = null}
19943
- __init121() {this.modeValue = "scale"}
20466
+ __init131() {this.sessionRef = null}
20467
+ __init132() {this.modeValue = "scale"}
19944
20468
  /** The reference point in the untransformed frame's space (follows the transform). */
19945
- __init122() {this.refBox = { x: 0, y: 0 }}
19946
- __init123() {this.corners = null}
19947
- __init124() {this.drag = null}
20469
+ __init133() {this.refBox = { x: 0, y: 0 }}
20470
+ __init134() {this.corners = null}
20471
+ __init135() {this.drag = null}
19948
20472
  /** The warp mesh in the frame's own space (null: no warp). */
19949
- __init125() {this.mesh = null}
19950
- __init126() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
19951
- __init127() {this.pending = false}
19952
- __init128() {this.viewScale = 1}
20473
+ __init136() {this.mesh = null}
20474
+ __init137() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
20475
+ __init138() {this.pending = false}
20476
+ __init139() {this.viewScale = 1}
19953
20477
 
19954
20478
  /** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
19955
- __init129() {this.typed = {}}
20479
+ __init140() {this.typed = {}}
19956
20480
  /** Width and height scale together when typed (the chain icon). */
19957
- __init130() {this.proportional = true}
19958
- __init131() {this.error = null}
19959
- __init132() {this.lastResult = null}
20481
+ __init141() {this.proportional = true}
20482
+ __init142() {this.error = null}
20483
+ __init143() {this.lastResult = null}
19960
20484
  get active() {
19961
- return Boolean(_optionalChain([this, 'access', _609 => _609.sessionRef, 'optionalAccess', _610 => _610.isOpen]));
20485
+ return Boolean(_optionalChain([this, 'access', _620 => _620.sessionRef, 'optionalAccess', _621 => _621.isOpen]));
19962
20486
  }
19963
20487
  get session() {
19964
20488
  return this.active ? this.sessionRef : null;
@@ -19967,7 +20491,7 @@ var FreeTransformTool = (_class16 = class {
19967
20491
  return this.modeValue;
19968
20492
  }
19969
20493
  get interpolation() {
19970
- return _nullishCoalesce(_optionalChain([this, 'access', _611 => _611.sessionRef, 'optionalAccess', _612 => _612.interpolation]), () => ( "bicubic"));
20494
+ return _nullishCoalesce(_optionalChain([this, 'access', _622 => _622.sessionRef, 'optionalAccess', _623 => _623.interpolation]), () => ( "bicubic"));
19971
20495
  }
19972
20496
  /** Whether the open transform has changed anything yet (a commit would add an undo step). */
19973
20497
  get modified() {
@@ -19977,7 +20501,7 @@ var FreeTransformTool = (_class16 = class {
19977
20501
  const start = s.startGeometry.corners;
19978
20502
  return this.corners.some((p, i) => p.x !== start[i].x || p.y !== start[i].y);
19979
20503
  }
19980
- __init133() {this.listeners = /* @__PURE__ */ new Set()}
20504
+ __init144() {this.listeners = /* @__PURE__ */ new Set()}
19981
20505
  /** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
19982
20506
  subscribe(listener) {
19983
20507
  this.listeners.add(listener);
@@ -19986,7 +20510,7 @@ var FreeTransformTool = (_class16 = class {
19986
20510
  };
19987
20511
  }
19988
20512
  changed() {
19989
- _optionalChain([this, 'access', _613 => _613.options, 'access', _614 => _614.onChange, 'optionalCall', _615 => _615()]);
20513
+ _optionalChain([this, 'access', _624 => _624.options, 'access', _625 => _625.onChange, 'optionalCall', _626 => _626()]);
19990
20514
  for (const l of this.listeners) l();
19991
20515
  }
19992
20516
  /** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
@@ -20379,7 +20903,7 @@ var FreeTransformTool = (_class16 = class {
20379
20903
  }
20380
20904
  /** Abandons the transform and restores everything. */
20381
20905
  cancel() {
20382
- _optionalChain([this, 'access', _616 => _616.sessionRef, 'optionalAccess', _617 => _617.cancel, 'call', _618 => _618()]);
20906
+ _optionalChain([this, 'access', _627 => _627.sessionRef, 'optionalAccess', _628 => _628.cancel, 'call', _629 => _629()]);
20383
20907
  this.sessionRef = null;
20384
20908
  this.corners = null;
20385
20909
  this.mesh = null;
@@ -20420,7 +20944,7 @@ var FreeTransformTool = (_class16 = class {
20420
20944
  }
20421
20945
  return false;
20422
20946
  }
20423
- }, _class16);
20947
+ }, _class17);
20424
20948
 
20425
20949
  // src/image-editor/provider-effect-tools.ts
20426
20950
  var ANIMATE_SCHEMA = {
@@ -20435,7 +20959,7 @@ function imageLayerAppliedEffects(layer) {
20435
20959
  const ref = (r) => ({ effect: r.effect, ...r.name ? { name: r.name } : {}, ...r.provider ? { provider: r.provider } : {} });
20436
20960
  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 } : {} });
20437
20961
  if (layer.type === "smart")
20438
- (_nullishCoalesce(_optionalChain([layer, 'access', _619 => _619.smartFilters, 'optionalAccess', _620 => _620.filters]), () => ( []))).forEach((f, index) => {
20962
+ (_nullishCoalesce(_optionalChain([layer, 'access', _630 => _630.smartFilters, 'optionalAccess', _631 => _631.filters]), () => ( []))).forEach((f, index) => {
20439
20963
  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 });
20440
20964
  });
20441
20965
  return out;
@@ -20587,7 +21111,7 @@ var OTHER_TOOL_LABELS = {
20587
21111
  watermark: "Watermark"
20588
21112
  };
20589
21113
  function imageToolLabel(tool) {
20590
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _621 => _621.find, 'call', _622 => _622((t) => t.id === tool), 'optionalAccess', _623 => _623.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
21114
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _632 => _632.find, 'call', _633 => _633((t) => t.id === tool), 'optionalAccess', _634 => _634.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20591
21115
  }
20592
21116
  var IMAGE_TOOL_SHORTCUTS = {
20593
21117
  ...Object.fromEntries(PAINT_TOOLS.filter((t) => t.shortcut).map((t) => [t.id, t.shortcut])),
@@ -21725,4 +22249,13 @@ function createImageEditorDocument(controller, options = {}) {
21725
22249
 
21726
22250
 
21727
22251
 
21728
- exports.ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkUYXL6ZWQcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkUYXL6ZWQcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkUYXL6ZWQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkUYXL6ZWQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkV7GWZIZKcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.ColorGmm = ColorGmm; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkUYXL6ZWQcjs.D50; exports.D65 = _chunkUYXL6ZWQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkBRKVNXDZcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkUYXL6ZWQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkV7GWZIZKcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkUYXL6ZWQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkV7GWZIZKcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkUYXL6ZWQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkV7GWZIZKcjs.EX; exports.EY = _chunkV7GWZIZKcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkV7GWZIZKcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkV7GWZIZKcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkV7GWZIZKcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkV7GWZIZKcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkV7GWZIZKcjs.FLAG_TOP; exports.FLAG_WET = _chunkV7GWZIZKcjs.FLAG_WET; exports.FLAT = _chunkV7GWZIZKcjs.FLAT; exports.FREE_INTERVAL = _chunkV7GWZIZKcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkUYXL6ZWQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = GAMMA; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.GridGraph = GridGraph; exports.HIDE = _chunkV7GWZIZKcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkUYXL6ZWQcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkUYXL6ZWQcjs.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 = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkUYXL6ZWQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkUYXL6ZWQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkUYXL6ZWQcjs.LUMA_709; exports.LayerCompositor = _chunkUYXL6ZWQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkUYXL6ZWQcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkV7GWZIZKcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkUYXL6ZWQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkV7GWZIZKcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkV7GWZIZKcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkV7GWZIZKcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkUYXL6ZWQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkUYXL6ZWQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkV7GWZIZKcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkV7GWZIZKcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkUYXL6ZWQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkV7GWZIZKcjs.PARAM; exports.PARAM_FLOATS = _chunkV7GWZIZKcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkUYXL6ZWQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkV7GWZIZKcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkV7GWZIZKcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkV7GWZIZKcjs.PLANE; exports.PLANE_BYTES = _chunkV7GWZIZKcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkUYXL6ZWQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkV7GWZIZKcjs.P_D0; exports.P_EDGE = _chunkV7GWZIZKcjs.P_EDGE; exports.P_FX = _chunkV7GWZIZKcjs.P_FX; exports.P_FY = _chunkV7GWZIZKcjs.P_FY; exports.P_H = _chunkV7GWZIZKcjs.P_H; exports.P_P0 = _chunkV7GWZIZKcjs.P_P0; exports.P_RHO = _chunkV7GWZIZKcjs.P_RHO; exports.P_SW = _chunkV7GWZIZKcjs.P_SW; exports.P_UX = _chunkV7GWZIZKcjs.P_UX; exports.P_UY = _chunkV7GWZIZKcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkUYXL6ZWQcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkUYXL6ZWQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkUYXL6ZWQcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkV7GWZIZKcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkUYXL6ZWQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkV7GWZIZKcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkV7GWZIZKcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkV7GWZIZKcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkV7GWZIZKcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkV7GWZIZKcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkUYXL6ZWQcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkUYXL6ZWQcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkUYXL6ZWQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkUYXL6ZWQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkUYXL6ZWQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkUYXL6ZWQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkUYXL6ZWQcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = UNITS; exports.U_MAX = _chunkV7GWZIZKcjs.U_MAX; exports.VIBRANCE_GREY = _chunkUYXL6ZWQcjs.VIBRANCE_GREY; exports.W9 = _chunkV7GWZIZKcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkBRKVNXDZcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkBRKVNXDZcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkV7GWZIZKcjs.WET_TILE; exports.WGSL_HALO = _chunkV7GWZIZKcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkV7GWZIZKcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkV7GWZIZKcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_SIZE = WORK_SIZE; exports.WetGpuEngine = _chunkV7GWZIZKcjs.WetGpuEngine; exports.WetMedium = _chunkV7GWZIZKcjs.WetMedium; exports.WetWorkerPool = _chunkV7GWZIZKcjs.WetWorkerPool; exports.WetWorld = _chunkV7GWZIZKcjs.WetWorld; exports.WetWorldError = _chunkV7GWZIZKcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkUYXL6ZWQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkUYXL6ZWQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkUYXL6ZWQcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkUYXL6ZWQcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkUYXL6ZWQcjs.activeSmartFilters; exports.addLayerEffect = _chunkUYXL6ZWQcjs.addLayerEffect; exports.addLayerFilter = _chunkUYXL6ZWQcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkUYXL6ZWQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkUYXL6ZWQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkUYXL6ZWQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkUYXL6ZWQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkUYXL6ZWQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkUYXL6ZWQcjs.anchorPoint; exports.annotationBlend = _chunkUYXL6ZWQcjs.annotationBlend; exports.annotationLayerFor = _chunkUYXL6ZWQcjs.annotationLayerFor; exports.annotationLayerName = _chunkUYXL6ZWQcjs.annotationLayerName; exports.annotationOfLayer = _chunkUYXL6ZWQcjs.annotationOfLayer; exports.annotationOfShape = _chunkUYXL6ZWQcjs.annotationOfShape; exports.annotationOfType = _chunkUYXL6ZWQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkUYXL6ZWQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkUYXL6ZWQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkUYXL6ZWQcjs.applyAdjustments; exports.applyBoxBlur = _chunkUYXL6ZWQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkUYXL6ZWQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkUYXL6ZWQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkUYXL6ZWQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkUYXL6ZWQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkUYXL6ZWQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkUYXL6ZWQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkUYXL6ZWQcjs.applyParams; exports.applyProcess2Adjustments = _chunkUYXL6ZWQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkUYXL6ZWQcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkUYXL6ZWQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkUYXL6ZWQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkUYXL6ZWQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkUYXL6ZWQcjs.blurFilter; exports.borderCoverage = _chunkUYXL6ZWQcjs.borderCoverage; exports.boxBlur = boxBlur; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunkUYXL6ZWQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkUYXL6ZWQcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkUYXL6ZWQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkUYXL6ZWQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkUYXL6ZWQcjs.calculateCropDrag; exports.canShareMemory = _chunkV7GWZIZKcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkUYXL6ZWQcjs.canvasToImagePoint; exports.caretAt = _chunkBRKVNXDZcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkUYXL6ZWQcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkUYXL6ZWQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkUYXL6ZWQcjs.combineSelections; exports.compileAdjustmentLayer = _chunkUYXL6ZWQcjs.compileAdjustmentLayer; exports.componentPath = _chunkUYXL6ZWQcjs.componentPath; exports.componentsCoverage = _chunkUYXL6ZWQcjs.componentsCoverage; exports.compositeDeep = _chunkUYXL6ZWQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkUYXL6ZWQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkUYXL6ZWQcjs.contentsBox; exports.contentsSurface = _chunkUYXL6ZWQcjs.contentsSurface; exports.contractCoverage = _chunkUYXL6ZWQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkUYXL6ZWQcjs.convertToSmartObject; exports.copySmartObject = _chunkUYXL6ZWQcjs.copySmartObject; exports.cornersFromMatrix = _chunkUYXL6ZWQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkUYXL6ZWQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkUYXL6ZWQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkBRKVNXDZcjs.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 = _chunkBRKVNXDZcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkBRKVNXDZcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkV7GWZIZKcjs.createPigmentTools; exports.createSelectionMask = _chunkUYXL6ZWQcjs.createSelectionMask; exports.createShapeLayer = _chunkUYXL6ZWQcjs.createShapeLayer; exports.createTypeLayer = _chunkUYXL6ZWQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkV7GWZIZKcjs.createWetGpuEngine; exports.cssFont = _chunkBRKVNXDZcjs.cssFont; exports.cssFontFamily = _chunkBRKVNXDZcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkUYXL6ZWQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkUYXL6ZWQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkUYXL6ZWQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkUYXL6ZWQcjs.decodeLayerMask; exports.decodeMergedImage = _chunkUYXL6ZWQcjs.decodeMergedImage; exports.decodePlanes = _chunkUYXL6ZWQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkUYXL6ZWQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkUYXL6ZWQcjs.decodeSelectionRle; exports.decontaminateColors = decontaminateColors; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkUYXL6ZWQcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkUYXL6ZWQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkUYXL6ZWQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkUYXL6ZWQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkUYXL6ZWQcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkUYXL6ZWQcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkUYXL6ZWQcjs.deserializeEffects; exports.deserializeLayer = _chunkUYXL6ZWQcjs.deserializeLayer; exports.deserializeLayers = _chunkUYXL6ZWQcjs.deserializeLayers; exports.deserializePatterns = _chunkUYXL6ZWQcjs.deserializePatterns; exports.deserializeSelection = _chunkUYXL6ZWQcjs.deserializeSelection; exports.developFilter = _chunkUYXL6ZWQcjs.developFilter; exports.developFromAdjustments = _chunkUYXL6ZWQcjs.developFromAdjustments; exports.developTarget = _chunkUYXL6ZWQcjs.developTarget; exports.dexp = _chunkV7GWZIZKcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkUYXL6ZWQcjs.distanceTransform; exports.dlog = _chunkV7GWZIZKcjs.dlog; exports.documentContents = _chunkUYXL6ZWQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkV7GWZIZKcjs.dpow; exports.dragWarpMeshPoint = _chunkBRKVNXDZcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkV7GWZIZKcjs.dsincos; exports.duplicateLayer = _chunkUYXL6ZWQcjs.duplicateLayer; exports.edgeBits = _chunkV7GWZIZKcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveLayerMask = _chunkUYXL6ZWQcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkUYXL6ZWQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkUYXL6ZWQcjs.encodeRle; exports.encodeSelectionRle = _chunkUYXL6ZWQcjs.encodeSelectionRle; exports.encodeSurface = _chunkUYXL6ZWQcjs.encodeSurface; exports.evalWarpMesh = _chunkBRKVNXDZcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkUYXL6ZWQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkV7GWZIZKcjs.expNeg; exports.expandCoverage = _chunkUYXL6ZWQcjs.expandCoverage; exports.exportPsd = _chunkUYXL6ZWQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkUYXL6ZWQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkV7GWZIZKcjs.filmPixel; exports.filmReflectance = _chunkV7GWZIZKcjs.filmReflectance; exports.filterMaskCoverage = _chunkUYXL6ZWQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = findSky; exports.findSubject = findSubject; exports.findWebGpu = _chunkV7GWZIZKcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkBRKVNXDZcjs.fitParagraphRuns; exports.fitRuns = _chunkBRKVNXDZcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkUYXL6ZWQcjs.flattenPath; exports.flipCorners = _chunkUYXL6ZWQcjs.flipCorners; exports.flowField = _chunkV7GWZIZKcjs.flowField; exports.focusArea = focusArea; exports.followLayerMove = _chunkUYXL6ZWQcjs.followLayerMove; exports.fontOf = _chunkBRKVNXDZcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkUYXL6ZWQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkUYXL6ZWQcjs.geometryHomography; exports.getAnnotationBounds = _chunkUYXL6ZWQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkUYXL6ZWQcjs.getCropCursor; exports.getRotatedSize = _chunkUYXL6ZWQcjs.getRotatedSize; exports.getViewportMetrics = _chunkUYXL6ZWQcjs.getViewportMetrics; exports.getViewportProjection = _chunkUYXL6ZWQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = grabCutLabels; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkUYXL6ZWQcjs.greyMorphology; exports.groupLayers = _chunkUYXL6ZWQcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkUYXL6ZWQcjs.hasResampledLegacyMask; exports.hasSurface = _chunkUYXL6ZWQcjs.hasSurface; exports.hasWarp = _chunkUYXL6ZWQcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkUYXL6ZWQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkUYXL6ZWQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkUYXL6ZWQcjs.hitTestAnnotation; exports.hitTestCrop = _chunkUYXL6ZWQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkUYXL6ZWQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkUYXL6ZWQcjs.hueRangeTables; exports.hueRangeWeight = _chunkUYXL6ZWQcjs.hueRangeWeight; exports.hueSaturation = _chunkUYXL6ZWQcjs.hueSaturation; exports.identityCurve = _chunkUYXL6ZWQcjs.identityCurve; exports.identityLevels = _chunkUYXL6ZWQcjs.identityLevels; exports.identityTransform = _chunkUYXL6ZWQcjs.identityTransform; exports.identityWarpMesh = _chunkBRKVNXDZcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkUYXL6ZWQcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkUYXL6ZWQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkUYXL6ZWQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkUYXL6ZWQcjs.invertMatrix3; exports.invertSelection = _chunkUYXL6ZWQcjs.invertSelection; exports.isActiveFilter = _chunkUYXL6ZWQcjs.isActiveFilter; exports.isActiveVectorMask = _chunkUYXL6ZWQcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkUYXL6ZWQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkUYXL6ZWQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkUYXL6ZWQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkUYXL6ZWQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkUYXL6ZWQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkUYXL6ZWQcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkUYXL6ZWQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkUYXL6ZWQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkUYXL6ZWQcjs.isSelectionEmpty; exports.isSelectionMode = _chunkUYXL6ZWQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkUYXL6ZWQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkUYXL6ZWQcjs.isTransformAnchor; exports.isValidWarp = _chunkUYXL6ZWQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.keepMainPieces = keepMainPieces; exports.kelvinToTemperature = _chunkUYXL6ZWQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkV7GWZIZKcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkUYXL6ZWQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkUYXL6ZWQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkUYXL6ZWQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkUYXL6ZWQcjs.layerMaskKey; exports.layerMaskSelection = _chunkUYXL6ZWQcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkUYXL6ZWQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkUYXL6ZWQcjs.layerTree; exports.layerTypeLabel = _chunkUYXL6ZWQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkUYXL6ZWQcjs.layersFromLegacy; exports.layoutText = _chunkBRKVNXDZcjs.layoutText; exports.legacyAdjustmentLayer = _chunkUYXL6ZWQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkUYXL6ZWQcjs.legacyMaskOf; exports.legacyView = _chunkUYXL6ZWQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkUYXL6ZWQcjs.levelsValue; exports.linearSrgbToXy = _chunkUYXL6ZWQcjs.linearSrgbToXy; exports.linearToSrgb = _chunkUYXL6ZWQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkV7GWZIZKcjs.linearToSrgb8; exports.liveComponent = _chunkUYXL6ZWQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkUYXL6ZWQcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk3T5VCDIVcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkV7GWZIZKcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkUYXL6ZWQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkUYXL6ZWQcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkUYXL6ZWQcjs.matrixFromCorners; exports.matrixFromParams = _chunkUYXL6ZWQcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkUYXL6ZWQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkUYXL6ZWQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkUYXL6ZWQcjs.moveLayer; exports.moveSmartFilter = _chunkUYXL6ZWQcjs.moveSmartFilter; exports.mulMatrix3 = _chunkUYXL6ZWQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkUYXL6ZWQcjs.neutralHueRange; exports.newContentsId = _chunkUYXL6ZWQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkUYXL6ZWQcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkUYXL6ZWQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkUYXL6ZWQcjs.normalizeFilter; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkUYXL6ZWQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkUYXL6ZWQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkUYXL6ZWQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkUYXL6ZWQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkUYXL6ZWQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkUYXL6ZWQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkUYXL6ZWQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkUYXL6ZWQcjs.normalizeSubpaths; exports.normalizeText = _chunkUYXL6ZWQcjs.normalizeText; exports.normalizeTilt = _chunkV7GWZIZKcjs.normalizeTilt; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.offsetLayer = _chunkUYXL6ZWQcjs.offsetLayer; exports.offsetShape = _chunkUYXL6ZWQcjs.offsetShape; exports.offsetSmartObject = _chunkUYXL6ZWQcjs.offsetSmartObject; exports.offsetVectorMask = _chunkUYXL6ZWQcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = otsuThreshold; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkV7GWZIZKcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkBRKVNXDZcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkUYXL6ZWQcjs.parseAdjustmentBlock; exports.parseBlend = _chunkUYXL6ZWQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkUYXL6ZWQcjs.parseLfx2; exports.parseLrfx = _chunkUYXL6ZWQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk3T5VCDIVcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkUYXL6ZWQcjs.parsePatternBlock; exports.parseSelectionMode = _chunkUYXL6ZWQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkUYXL6ZWQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkUYXL6ZWQcjs.patchParagraphStyle; exports.patchTextStyle = _chunkUYXL6ZWQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkUYXL6ZWQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkV7GWZIZKcjs.pigmentColor; exports.pigmentOf = _chunkV7GWZIZKcjs.pigmentOf; exports.pixelLayerBounds = _chunkUYXL6ZWQcjs.pixelLayerBounds; exports.pixelLayers = _chunkUYXL6ZWQcjs.pixelLayers; exports.pixelPigment = _chunkV7GWZIZKcjs.pixelPigment; exports.placeContents = _chunkUYXL6ZWQcjs.placeContents; exports.placeLayer = _chunkUYXL6ZWQcjs.placeLayer; exports.placementAt = _chunkUYXL6ZWQcjs.placementAt; exports.placementBounds = _chunkUYXL6ZWQcjs.placementBounds; exports.placementGeometry = _chunkUYXL6ZWQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkV7GWZIZKcjs.pointerPressure; exports.pointerStrokeSample = _chunkV7GWZIZKcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkV7GWZIZKcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonCoverageBox = polygonCoverageBox; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkUYXL6ZWQcjs.posterizeValue; exports.presetWarp = _chunkUYXL6ZWQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkUYXL6ZWQcjs.projectImagePoint; exports.projectImageRect = _chunkUYXL6ZWQcjs.projectImageRect; exports.projectMaskCoverage = _chunkUYXL6ZWQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkUYXL6ZWQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkUYXL6ZWQcjs.psdToLayers; exports.pullWarpMesh = _chunkBRKVNXDZcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = quickSelectStroke; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkUYXL6ZWQcjs.rangeLightness; exports.rasterContents = _chunkUYXL6ZWQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkUYXL6ZWQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkUYXL6ZWQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkUYXL6ZWQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkUYXL6ZWQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkUYXL6ZWQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkUYXL6ZWQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkUYXL6ZWQcjs.removeLayer; exports.removeLayerEffect = _chunkUYXL6ZWQcjs.removeLayerEffect; exports.removeLayerFilter = _chunkUYXL6ZWQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkUYXL6ZWQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkUYXL6ZWQcjs.renderShape; exports.renderShapeRect = _chunkUYXL6ZWQcjs.renderShapeRect; exports.renderSmartObject = _chunkUYXL6ZWQcjs.renderSmartObject; exports.renderText = _chunkUYXL6ZWQcjs.renderText; exports.replaceContents = _chunkUYXL6ZWQcjs.replaceContents; exports.replaceTextRange = _chunkUYXL6ZWQcjs.replaceTextRange; exports.requireLayer = _chunkUYXL6ZWQcjs.requireLayer; exports.requireOperation = _chunkUYXL6ZWQcjs.requireOperation; exports.requireShapeLayer = _chunkUYXL6ZWQcjs.requireShapeLayer; exports.requireSmartObject = _chunkUYXL6ZWQcjs.requireSmartObject; exports.requireTypeLayer = _chunkUYXL6ZWQcjs.requireTypeLayer; exports.requireUnlocked = _chunkUYXL6ZWQcjs.requireUnlocked; exports.rerender = _chunkUYXL6ZWQcjs.rerender; exports.rerenderShape = _chunkUYXL6ZWQcjs.rerenderShape; exports.rerenderText = _chunkUYXL6ZWQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkUYXL6ZWQcjs.resizeSelection; exports.resizeWarpMesh = _chunkBRKVNXDZcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkUYXL6ZWQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkUYXL6ZWQcjs.resolveVectorMasks; exports.restyleRange = _chunkBRKVNXDZcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkUYXL6ZWQcjs.rgbToGray; exports.rgbToHsl = _chunkUYXL6ZWQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkUYXL6ZWQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkUYXL6ZWQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkUYXL6ZWQcjs.sampleLut; exports.sampleToneLut = _chunkUYXL6ZWQcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkUYXL6ZWQcjs.selectionArea; exports.selectionFromCoverage = _chunkUYXL6ZWQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkUYXL6ZWQcjs.selectionFromPixels; exports.selectionFromRegion = _chunkUYXL6ZWQcjs.selectionFromRegion; exports.selectionFromTiles = _chunkUYXL6ZWQcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkUYXL6ZWQcjs.selectionToCoverage; exports.selectionToPixels = _chunkUYXL6ZWQcjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkUYXL6ZWQcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkUYXL6ZWQcjs.serializeContents; exports.serializeEffects = _chunkUYXL6ZWQcjs.serializeEffects; exports.serializeLayer = _chunkUYXL6ZWQcjs.serializeLayer; exports.serializeLayers = _chunkUYXL6ZWQcjs.serializeLayers; exports.serializeLayersExternal = _chunkUYXL6ZWQcjs.serializeLayersExternal; exports.serializePatterns = _chunkUYXL6ZWQcjs.serializePatterns; exports.serializeSelection = _chunkUYXL6ZWQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkUYXL6ZWQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkUYXL6ZWQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkUYXL6ZWQcjs.setLayerMask; exports.setLayerProperties = _chunkUYXL6ZWQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkUYXL6ZWQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkUYXL6ZWQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkUYXL6ZWQcjs.setSmartPlacement; exports.shadeTile = _chunkV7GWZIZKcjs.shadeTile; exports.shapeAsPixelLayer = _chunkUYXL6ZWQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkUYXL6ZWQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkUYXL6ZWQcjs.shapeGeometryBounds; exports.shapeLayers = _chunkUYXL6ZWQcjs.shapeLayers; exports.shapeOutline = _chunkUYXL6ZWQcjs.shapeOutline; exports.shapeRenderClip = _chunkUYXL6ZWQcjs.shapeRenderClip; exports.shiftCoverage = _chunkUYXL6ZWQcjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkUYXL6ZWQcjs.smartObjectLayers; exports.smoothCoverage = _chunkUYXL6ZWQcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smoothnessWeights = smoothnessWeights; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = softMaskToSelection; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkBRKVNXDZcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkV7GWZIZKcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkUYXL6ZWQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.stepSlotTs = _chunkV7GWZIZKcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkBRKVNXDZcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = superpixelSaliency; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkUYXL6ZWQcjs.tempTintToXy; exports.temperatureToKelvin = _chunkUYXL6ZWQcjs.temperatureToKelvin; exports.textIndexAt = _chunkBRKVNXDZcjs.textIndexAt; exports.textMatrix = _chunkUYXL6ZWQcjs.textMatrix; exports.textOrientation = _chunkUYXL6ZWQcjs.textOrientation; exports.textOutlines = _chunkUYXL6ZWQcjs.textOutlines; exports.textRange = _chunkUYXL6ZWQcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkUYXL6ZWQcjs.toTextSpace; exports.toneCurve = _chunkUYXL6ZWQcjs.toneCurve; exports.toneLuts = _chunkUYXL6ZWQcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkUYXL6ZWQcjs.transformHomography; exports.transformMap = _chunkUYXL6ZWQcjs.transformMap; exports.transformShapeComponents = _chunkUYXL6ZWQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkUYXL6ZWQcjs.transformTypeLayer; exports.transformVectorMask = _chunkUYXL6ZWQcjs.transformVectorMask; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkUYXL6ZWQcjs.transformedBox; exports.transformedPoint = _chunkUYXL6ZWQcjs.transformedPoint; exports.translateLayer = _chunkUYXL6ZWQcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkUYXL6ZWQcjs.typeAsPixelLayer; exports.typeFrame = _chunkUYXL6ZWQcjs.typeFrame; exports.typeFromAnnotation = _chunkUYXL6ZWQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkUYXL6ZWQcjs.typeLayerName; exports.ungroupLayer = _chunkUYXL6ZWQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkUYXL6ZWQcjs.unionRect; exports.unprojectCanvasPoint = _chunkUYXL6ZWQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkUYXL6ZWQcjs.updateLayerEffect; exports.updateLayerFilter = _chunkUYXL6ZWQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkUYXL6ZWQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkUYXL6ZWQcjs.updateShapeLayer; exports.updateSmartFilter = _chunkUYXL6ZWQcjs.updateSmartFilter; exports.updateTypeLayer = _chunkUYXL6ZWQcjs.updateTypeLayer; exports.upscaleRegion = upscaleRegion; exports.userErrorMessage = _chunkUYXL6ZWQcjs.userErrorMessage; exports.uvToXy = _chunkUYXL6ZWQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkUYXL6ZWQcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkUYXL6ZWQcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkUYXL6ZWQcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkUYXL6ZWQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkUYXL6ZWQcjs.vibranceLinear; exports.vibrancePixel = _chunkUYXL6ZWQcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkBRKVNXDZcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkBRKVNXDZcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkBRKVNXDZcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkBRKVNXDZcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkUYXL6ZWQcjs.wbMatrix; exports.wetGpuSupport = _chunkV7GWZIZKcjs.wetGpuSupport; exports.wetSimdSupported = _chunkV7GWZIZKcjs.wetSimdSupported; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.whiteBalanceFromSample = _chunkUYXL6ZWQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkUYXL6ZWQcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkUYXL6ZWQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkUYXL6ZWQcjs.withNewIds; exports.workImage = workImage; exports.workLuma = workLuma; exports.workPlanes = workPlanes; exports.writeAdjustmentBlock = _chunkUYXL6ZWQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkUYXL6ZWQcjs.writeLfx2; exports.writePatternBlock = _chunkUYXL6ZWQcjs.writePatternBlock; exports.writePsd = _chunkUYXL6ZWQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkUYXL6ZWQcjs.xyToTempTint; exports.xyToUv = _chunkUYXL6ZWQcjs.xyToUv;
22252
+
22253
+
22254
+
22255
+
22256
+
22257
+
22258
+
22259
+
22260
+
22261
+ exports.ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkUYXL6ZWQcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkUYXL6ZWQcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkUYXL6ZWQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkUYXL6ZWQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkV7GWZIZKcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.ColorGmm = ColorGmm; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkUYXL6ZWQcjs.D50; exports.D65 = _chunkUYXL6ZWQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkBRKVNXDZcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkUYXL6ZWQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkV7GWZIZKcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkUYXL6ZWQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkV7GWZIZKcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkUYXL6ZWQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkV7GWZIZKcjs.EX; exports.EY = _chunkV7GWZIZKcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkV7GWZIZKcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkV7GWZIZKcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkV7GWZIZKcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkV7GWZIZKcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkV7GWZIZKcjs.FLAG_TOP; exports.FLAG_WET = _chunkV7GWZIZKcjs.FLAG_WET; exports.FLAT = _chunkV7GWZIZKcjs.FLAT; exports.FREE_INTERVAL = _chunkV7GWZIZKcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkUYXL6ZWQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = GAMMA; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.GridGraph = GridGraph; exports.HIDE = _chunkV7GWZIZKcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkUYXL6ZWQcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkUYXL6ZWQcjs.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 = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkUYXL6ZWQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkUYXL6ZWQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkUYXL6ZWQcjs.LUMA_709; exports.LayerCompositor = _chunkUYXL6ZWQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkUYXL6ZWQcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkV7GWZIZKcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkUYXL6ZWQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkV7GWZIZKcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkV7GWZIZKcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkV7GWZIZKcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkUYXL6ZWQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkUYXL6ZWQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkV7GWZIZKcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkV7GWZIZKcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkUYXL6ZWQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkV7GWZIZKcjs.PARAM; exports.PARAM_FLOATS = _chunkV7GWZIZKcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkUYXL6ZWQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkV7GWZIZKcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkV7GWZIZKcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkV7GWZIZKcjs.PLANE; exports.PLANE_BYTES = _chunkV7GWZIZKcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkUYXL6ZWQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkV7GWZIZKcjs.P_D0; exports.P_EDGE = _chunkV7GWZIZKcjs.P_EDGE; exports.P_FX = _chunkV7GWZIZKcjs.P_FX; exports.P_FY = _chunkV7GWZIZKcjs.P_FY; exports.P_H = _chunkV7GWZIZKcjs.P_H; exports.P_P0 = _chunkV7GWZIZKcjs.P_P0; exports.P_RHO = _chunkV7GWZIZKcjs.P_RHO; exports.P_SW = _chunkV7GWZIZKcjs.P_SW; exports.P_UX = _chunkV7GWZIZKcjs.P_UX; exports.P_UY = _chunkV7GWZIZKcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkUYXL6ZWQcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkUYXL6ZWQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkUYXL6ZWQcjs.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 = _chunkV7GWZIZKcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkUYXL6ZWQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkV7GWZIZKcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkV7GWZIZKcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkV7GWZIZKcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkV7GWZIZKcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkV7GWZIZKcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkUYXL6ZWQcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkUYXL6ZWQcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkUYXL6ZWQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkUYXL6ZWQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkUYXL6ZWQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkUYXL6ZWQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkUYXL6ZWQcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = UNITS; exports.U_MAX = _chunkV7GWZIZKcjs.U_MAX; exports.VIBRANCE_GREY = _chunkUYXL6ZWQcjs.VIBRANCE_GREY; exports.W9 = _chunkV7GWZIZKcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkBRKVNXDZcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkBRKVNXDZcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkV7GWZIZKcjs.WET_TILE; exports.WGSL_HALO = _chunkV7GWZIZKcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkV7GWZIZKcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkV7GWZIZKcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_SIZE = WORK_SIZE; exports.WetGpuEngine = _chunkV7GWZIZKcjs.WetGpuEngine; exports.WetMedium = _chunkV7GWZIZKcjs.WetMedium; exports.WetWorkerPool = _chunkV7GWZIZKcjs.WetWorkerPool; exports.WetWorld = _chunkV7GWZIZKcjs.WetWorld; exports.WetWorldError = _chunkV7GWZIZKcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkUYXL6ZWQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkUYXL6ZWQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkUYXL6ZWQcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkUYXL6ZWQcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkUYXL6ZWQcjs.activeSmartFilters; exports.addLayerEffect = _chunkUYXL6ZWQcjs.addLayerEffect; exports.addLayerFilter = _chunkUYXL6ZWQcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkUYXL6ZWQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkUYXL6ZWQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkUYXL6ZWQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkUYXL6ZWQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkUYXL6ZWQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkUYXL6ZWQcjs.anchorPoint; exports.annotationBlend = _chunkUYXL6ZWQcjs.annotationBlend; exports.annotationLayerFor = _chunkUYXL6ZWQcjs.annotationLayerFor; exports.annotationLayerName = _chunkUYXL6ZWQcjs.annotationLayerName; exports.annotationOfLayer = _chunkUYXL6ZWQcjs.annotationOfLayer; exports.annotationOfShape = _chunkUYXL6ZWQcjs.annotationOfShape; exports.annotationOfType = _chunkUYXL6ZWQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkUYXL6ZWQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkUYXL6ZWQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkUYXL6ZWQcjs.applyAdjustments; exports.applyBoxBlur = _chunkUYXL6ZWQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkUYXL6ZWQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkUYXL6ZWQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkUYXL6ZWQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkUYXL6ZWQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkUYXL6ZWQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkUYXL6ZWQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkUYXL6ZWQcjs.applyParams; exports.applyProcess2Adjustments = _chunkUYXL6ZWQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkUYXL6ZWQcjs.applyProcess2Float; exports.applyRefineEdits = applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkUYXL6ZWQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkUYXL6ZWQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkUYXL6ZWQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkUYXL6ZWQcjs.blurFilter; exports.borderCoverage = _chunkUYXL6ZWQcjs.borderCoverage; exports.boxBlur = boxBlur; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunkUYXL6ZWQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkUYXL6ZWQcjs.bradfordAdaptation; exports.brushStrokeMask = brushStrokeMask; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkUYXL6ZWQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkUYXL6ZWQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkUYXL6ZWQcjs.calculateCropDrag; exports.canShareMemory = _chunkV7GWZIZKcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkUYXL6ZWQcjs.canvasToImagePoint; exports.caretAt = _chunkBRKVNXDZcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkUYXL6ZWQcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkUYXL6ZWQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkUYXL6ZWQcjs.combineSelections; exports.compileAdjustmentLayer = _chunkUYXL6ZWQcjs.compileAdjustmentLayer; exports.componentPath = _chunkUYXL6ZWQcjs.componentPath; exports.componentsCoverage = _chunkUYXL6ZWQcjs.componentsCoverage; exports.compositeDeep = _chunkUYXL6ZWQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkUYXL6ZWQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkUYXL6ZWQcjs.contentsBox; exports.contentsSurface = _chunkUYXL6ZWQcjs.contentsSurface; exports.contractCoverage = _chunkUYXL6ZWQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkUYXL6ZWQcjs.convertToSmartObject; exports.copySmartObject = _chunkUYXL6ZWQcjs.copySmartObject; exports.cornersFromMatrix = _chunkUYXL6ZWQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkUYXL6ZWQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkUYXL6ZWQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkBRKVNXDZcjs.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 = _chunkBRKVNXDZcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkBRKVNXDZcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkV7GWZIZKcjs.createPigmentTools; exports.createSelectionMask = _chunkUYXL6ZWQcjs.createSelectionMask; exports.createShapeLayer = _chunkUYXL6ZWQcjs.createShapeLayer; exports.createTypeLayer = _chunkUYXL6ZWQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkV7GWZIZKcjs.createWetGpuEngine; exports.cssFont = _chunkBRKVNXDZcjs.cssFont; exports.cssFontFamily = _chunkBRKVNXDZcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkUYXL6ZWQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkUYXL6ZWQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkUYXL6ZWQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkUYXL6ZWQcjs.decodeLayerMask; exports.decodeMergedImage = _chunkUYXL6ZWQcjs.decodeMergedImage; exports.decodePlanes = _chunkUYXL6ZWQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkUYXL6ZWQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkUYXL6ZWQcjs.decodeSelectionRle; exports.decontaminateColors = decontaminateColors; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkUYXL6ZWQcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkUYXL6ZWQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkUYXL6ZWQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkUYXL6ZWQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkUYXL6ZWQcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkUYXL6ZWQcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkUYXL6ZWQcjs.deserializeEffects; exports.deserializeLayer = _chunkUYXL6ZWQcjs.deserializeLayer; exports.deserializeLayers = _chunkUYXL6ZWQcjs.deserializeLayers; exports.deserializePatterns = _chunkUYXL6ZWQcjs.deserializePatterns; exports.deserializeSelection = _chunkUYXL6ZWQcjs.deserializeSelection; exports.developFilter = _chunkUYXL6ZWQcjs.developFilter; exports.developFromAdjustments = _chunkUYXL6ZWQcjs.developFromAdjustments; exports.developTarget = _chunkUYXL6ZWQcjs.developTarget; exports.dexp = _chunkV7GWZIZKcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkUYXL6ZWQcjs.distanceTransform; exports.dlog = _chunkV7GWZIZKcjs.dlog; exports.documentContents = _chunkUYXL6ZWQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkV7GWZIZKcjs.dpow; exports.dragWarpMeshPoint = _chunkBRKVNXDZcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkV7GWZIZKcjs.dsincos; exports.duplicateLayer = _chunkUYXL6ZWQcjs.duplicateLayer; exports.edgeBits = _chunkV7GWZIZKcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveLayerMask = _chunkUYXL6ZWQcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkUYXL6ZWQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkUYXL6ZWQcjs.encodeRle; exports.encodeSelectionRle = _chunkUYXL6ZWQcjs.encodeSelectionRle; exports.encodeSurface = _chunkUYXL6ZWQcjs.encodeSurface; exports.evalWarpMesh = _chunkBRKVNXDZcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkUYXL6ZWQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkV7GWZIZKcjs.expNeg; exports.expandCoverage = _chunkUYXL6ZWQcjs.expandCoverage; exports.exportPsd = _chunkUYXL6ZWQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkUYXL6ZWQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkV7GWZIZKcjs.filmPixel; exports.filmReflectance = _chunkV7GWZIZKcjs.filmReflectance; exports.filterMaskCoverage = _chunkUYXL6ZWQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = findSky; exports.findSubject = findSubject; exports.findWebGpu = _chunkV7GWZIZKcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkBRKVNXDZcjs.fitParagraphRuns; exports.fitRuns = _chunkBRKVNXDZcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkUYXL6ZWQcjs.flattenPath; exports.flipCorners = _chunkUYXL6ZWQcjs.flipCorners; exports.flowField = _chunkV7GWZIZKcjs.flowField; exports.focusArea = focusArea; exports.followLayerMove = _chunkUYXL6ZWQcjs.followLayerMove; exports.fontOf = _chunkBRKVNXDZcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkUYXL6ZWQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkUYXL6ZWQcjs.geometryHomography; exports.getAnnotationBounds = _chunkUYXL6ZWQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkUYXL6ZWQcjs.getCropCursor; exports.getRotatedSize = _chunkUYXL6ZWQcjs.getRotatedSize; exports.getViewportMetrics = _chunkUYXL6ZWQcjs.getViewportMetrics; exports.getViewportProjection = _chunkUYXL6ZWQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = grabCutLabels; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkUYXL6ZWQcjs.greyMorphology; exports.groupLayers = _chunkUYXL6ZWQcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkUYXL6ZWQcjs.hasResampledLegacyMask; exports.hasSurface = _chunkUYXL6ZWQcjs.hasSurface; exports.hasWarp = _chunkUYXL6ZWQcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkUYXL6ZWQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkUYXL6ZWQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkUYXL6ZWQcjs.hitTestAnnotation; exports.hitTestCrop = _chunkUYXL6ZWQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkUYXL6ZWQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkUYXL6ZWQcjs.hueRangeTables; exports.hueRangeWeight = _chunkUYXL6ZWQcjs.hueRangeWeight; exports.hueSaturation = _chunkUYXL6ZWQcjs.hueSaturation; exports.identityCurve = _chunkUYXL6ZWQcjs.identityCurve; exports.identityLevels = _chunkUYXL6ZWQcjs.identityLevels; exports.identityTransform = _chunkUYXL6ZWQcjs.identityTransform; exports.identityWarpMesh = _chunkBRKVNXDZcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkUYXL6ZWQcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkUYXL6ZWQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkUYXL6ZWQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkUYXL6ZWQcjs.invertMatrix3; exports.invertSelection = _chunkUYXL6ZWQcjs.invertSelection; exports.isActiveFilter = _chunkUYXL6ZWQcjs.isActiveFilter; exports.isActiveVectorMask = _chunkUYXL6ZWQcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkUYXL6ZWQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkUYXL6ZWQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkUYXL6ZWQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkUYXL6ZWQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkUYXL6ZWQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkUYXL6ZWQcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkUYXL6ZWQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkUYXL6ZWQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkUYXL6ZWQcjs.isSelectionEmpty; exports.isSelectionMode = _chunkUYXL6ZWQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkUYXL6ZWQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkUYXL6ZWQcjs.isTransformAnchor; exports.isValidWarp = _chunkUYXL6ZWQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.keepMainPieces = keepMainPieces; exports.kelvinToTemperature = _chunkUYXL6ZWQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkV7GWZIZKcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkUYXL6ZWQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkUYXL6ZWQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkUYXL6ZWQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkUYXL6ZWQcjs.layerMaskKey; exports.layerMaskSelection = _chunkUYXL6ZWQcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkUYXL6ZWQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkUYXL6ZWQcjs.layerTree; exports.layerTypeLabel = _chunkUYXL6ZWQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkUYXL6ZWQcjs.layersFromLegacy; exports.layoutText = _chunkBRKVNXDZcjs.layoutText; exports.legacyAdjustmentLayer = _chunkUYXL6ZWQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkUYXL6ZWQcjs.legacyMaskOf; exports.legacyView = _chunkUYXL6ZWQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkUYXL6ZWQcjs.levelsValue; exports.linearSrgbToXy = _chunkUYXL6ZWQcjs.linearSrgbToXy; exports.linearToSrgb = _chunkUYXL6ZWQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkV7GWZIZKcjs.linearToSrgb8; exports.liveComponent = _chunkUYXL6ZWQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkUYXL6ZWQcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk3T5VCDIVcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkV7GWZIZKcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkUYXL6ZWQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkUYXL6ZWQcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkUYXL6ZWQcjs.matrixFromCorners; exports.matrixFromParams = _chunkUYXL6ZWQcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkUYXL6ZWQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkUYXL6ZWQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkUYXL6ZWQcjs.moveLayer; exports.moveSmartFilter = _chunkUYXL6ZWQcjs.moveSmartFilter; exports.mulMatrix3 = _chunkUYXL6ZWQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkUYXL6ZWQcjs.neutralHueRange; exports.newContentsId = _chunkUYXL6ZWQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkUYXL6ZWQcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkUYXL6ZWQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkUYXL6ZWQcjs.normalizeFilter; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkUYXL6ZWQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkUYXL6ZWQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkUYXL6ZWQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkUYXL6ZWQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkUYXL6ZWQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkUYXL6ZWQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkUYXL6ZWQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkUYXL6ZWQcjs.normalizeSubpaths; exports.normalizeText = _chunkUYXL6ZWQcjs.normalizeText; exports.normalizeTilt = _chunkV7GWZIZKcjs.normalizeTilt; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.offsetLayer = _chunkUYXL6ZWQcjs.offsetLayer; exports.offsetShape = _chunkUYXL6ZWQcjs.offsetShape; exports.offsetSmartObject = _chunkUYXL6ZWQcjs.offsetSmartObject; exports.offsetVectorMask = _chunkUYXL6ZWQcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = otsuThreshold; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkV7GWZIZKcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkBRKVNXDZcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkUYXL6ZWQcjs.parseAdjustmentBlock; exports.parseBlend = _chunkUYXL6ZWQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkUYXL6ZWQcjs.parseLfx2; exports.parseLrfx = _chunkUYXL6ZWQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk3T5VCDIVcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkUYXL6ZWQcjs.parsePatternBlock; exports.parseSelectionMode = _chunkUYXL6ZWQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkUYXL6ZWQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkUYXL6ZWQcjs.patchParagraphStyle; exports.patchTextStyle = _chunkUYXL6ZWQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkUYXL6ZWQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkV7GWZIZKcjs.pigmentColor; exports.pigmentOf = _chunkV7GWZIZKcjs.pigmentOf; exports.pixelLayerBounds = _chunkUYXL6ZWQcjs.pixelLayerBounds; exports.pixelLayers = _chunkUYXL6ZWQcjs.pixelLayers; exports.pixelPigment = _chunkV7GWZIZKcjs.pixelPigment; exports.placeContents = _chunkUYXL6ZWQcjs.placeContents; exports.placeLayer = _chunkUYXL6ZWQcjs.placeLayer; exports.placementAt = _chunkUYXL6ZWQcjs.placementAt; exports.placementBounds = _chunkUYXL6ZWQcjs.placementBounds; exports.placementGeometry = _chunkUYXL6ZWQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkV7GWZIZKcjs.pointerPressure; exports.pointerStrokeSample = _chunkV7GWZIZKcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkV7GWZIZKcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonCoverageBox = polygonCoverageBox; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkUYXL6ZWQcjs.posterizeValue; exports.presetWarp = _chunkUYXL6ZWQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkUYXL6ZWQcjs.projectImagePoint; exports.projectImageRect = _chunkUYXL6ZWQcjs.projectImageRect; exports.projectMaskCoverage = _chunkUYXL6ZWQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkUYXL6ZWQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkUYXL6ZWQcjs.psdToLayers; exports.pullWarpMesh = _chunkBRKVNXDZcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = quickSelectStroke; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkUYXL6ZWQcjs.rangeLightness; exports.rasterContents = _chunkUYXL6ZWQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkUYXL6ZWQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkUYXL6ZWQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkUYXL6ZWQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkUYXL6ZWQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkUYXL6ZWQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkUYXL6ZWQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkUYXL6ZWQcjs.removeLayer; exports.removeLayerEffect = _chunkUYXL6ZWQcjs.removeLayerEffect; exports.removeLayerFilter = _chunkUYXL6ZWQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkUYXL6ZWQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkUYXL6ZWQcjs.renderShape; exports.renderShapeRect = _chunkUYXL6ZWQcjs.renderShapeRect; exports.renderSmartObject = _chunkUYXL6ZWQcjs.renderSmartObject; exports.renderText = _chunkUYXL6ZWQcjs.renderText; exports.replaceContents = _chunkUYXL6ZWQcjs.replaceContents; exports.replaceTextRange = _chunkUYXL6ZWQcjs.replaceTextRange; exports.requireLayer = _chunkUYXL6ZWQcjs.requireLayer; exports.requireOperation = _chunkUYXL6ZWQcjs.requireOperation; exports.requireShapeLayer = _chunkUYXL6ZWQcjs.requireShapeLayer; exports.requireSmartObject = _chunkUYXL6ZWQcjs.requireSmartObject; exports.requireTypeLayer = _chunkUYXL6ZWQcjs.requireTypeLayer; exports.requireUnlocked = _chunkUYXL6ZWQcjs.requireUnlocked; exports.rerender = _chunkUYXL6ZWQcjs.rerender; exports.rerenderShape = _chunkUYXL6ZWQcjs.rerenderShape; exports.rerenderText = _chunkUYXL6ZWQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkUYXL6ZWQcjs.resizeSelection; exports.resizeWarpMesh = _chunkBRKVNXDZcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkUYXL6ZWQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkUYXL6ZWQcjs.resolveVectorMasks; exports.restyleRange = _chunkBRKVNXDZcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkUYXL6ZWQcjs.rgbToGray; exports.rgbToHsl = _chunkUYXL6ZWQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkUYXL6ZWQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkUYXL6ZWQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkUYXL6ZWQcjs.sampleLut; exports.sampleToneLut = _chunkUYXL6ZWQcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkUYXL6ZWQcjs.selectionArea; exports.selectionFromCoverage = _chunkUYXL6ZWQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkUYXL6ZWQcjs.selectionFromPixels; exports.selectionFromRegion = _chunkUYXL6ZWQcjs.selectionFromRegion; exports.selectionFromTiles = _chunkUYXL6ZWQcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkUYXL6ZWQcjs.selectionToCoverage; exports.selectionToPixels = _chunkUYXL6ZWQcjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkUYXL6ZWQcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkUYXL6ZWQcjs.serializeContents; exports.serializeEffects = _chunkUYXL6ZWQcjs.serializeEffects; exports.serializeLayer = _chunkUYXL6ZWQcjs.serializeLayer; exports.serializeLayers = _chunkUYXL6ZWQcjs.serializeLayers; exports.serializeLayersExternal = _chunkUYXL6ZWQcjs.serializeLayersExternal; exports.serializePatterns = _chunkUYXL6ZWQcjs.serializePatterns; exports.serializeSelection = _chunkUYXL6ZWQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkUYXL6ZWQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkUYXL6ZWQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkUYXL6ZWQcjs.setLayerMask; exports.setLayerProperties = _chunkUYXL6ZWQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkUYXL6ZWQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkUYXL6ZWQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkUYXL6ZWQcjs.setSmartPlacement; exports.shadeTile = _chunkV7GWZIZKcjs.shadeTile; exports.shapeAsPixelLayer = _chunkUYXL6ZWQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkUYXL6ZWQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkUYXL6ZWQcjs.shapeGeometryBounds; exports.shapeLayers = _chunkUYXL6ZWQcjs.shapeLayers; exports.shapeOutline = _chunkUYXL6ZWQcjs.shapeOutline; exports.shapeRenderClip = _chunkUYXL6ZWQcjs.shapeRenderClip; exports.shiftCoverage = _chunkUYXL6ZWQcjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkUYXL6ZWQcjs.smartObjectLayers; exports.smoothCoverage = _chunkUYXL6ZWQcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smoothnessWeights = smoothnessWeights; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = softMaskToSelection; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkBRKVNXDZcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkV7GWZIZKcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkUYXL6ZWQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.stepSlotTs = _chunkV7GWZIZKcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkBRKVNXDZcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = superpixelSaliency; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkUYXL6ZWQcjs.tempTintToXy; exports.temperatureToKelvin = _chunkUYXL6ZWQcjs.temperatureToKelvin; exports.textIndexAt = _chunkBRKVNXDZcjs.textIndexAt; exports.textMatrix = _chunkUYXL6ZWQcjs.textMatrix; exports.textOrientation = _chunkUYXL6ZWQcjs.textOrientation; exports.textOutlines = _chunkUYXL6ZWQcjs.textOutlines; exports.textRange = _chunkUYXL6ZWQcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkUYXL6ZWQcjs.toTextSpace; exports.toneCurve = _chunkUYXL6ZWQcjs.toneCurve; exports.toneLuts = _chunkUYXL6ZWQcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkUYXL6ZWQcjs.transformHomography; exports.transformMap = _chunkUYXL6ZWQcjs.transformMap; exports.transformShapeComponents = _chunkUYXL6ZWQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkUYXL6ZWQcjs.transformTypeLayer; exports.transformVectorMask = _chunkUYXL6ZWQcjs.transformVectorMask; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkUYXL6ZWQcjs.transformedBox; exports.transformedPoint = _chunkUYXL6ZWQcjs.transformedPoint; exports.translateLayer = _chunkUYXL6ZWQcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkUYXL6ZWQcjs.typeAsPixelLayer; exports.typeFrame = _chunkUYXL6ZWQcjs.typeFrame; exports.typeFromAnnotation = _chunkUYXL6ZWQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkUYXL6ZWQcjs.typeLayerName; exports.ungroupLayer = _chunkUYXL6ZWQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkUYXL6ZWQcjs.unionRect; exports.unprojectCanvasPoint = _chunkUYXL6ZWQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkUYXL6ZWQcjs.updateLayerEffect; exports.updateLayerFilter = _chunkUYXL6ZWQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkUYXL6ZWQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkUYXL6ZWQcjs.updateShapeLayer; exports.updateSmartFilter = _chunkUYXL6ZWQcjs.updateSmartFilter; exports.updateTypeLayer = _chunkUYXL6ZWQcjs.updateTypeLayer; exports.upscaleRegion = upscaleRegion; exports.userErrorMessage = _chunkUYXL6ZWQcjs.userErrorMessage; exports.uvToXy = _chunkUYXL6ZWQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkUYXL6ZWQcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkUYXL6ZWQcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkUYXL6ZWQcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkUYXL6ZWQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkUYXL6ZWQcjs.vibranceLinear; exports.vibrancePixel = _chunkUYXL6ZWQcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkBRKVNXDZcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkBRKVNXDZcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkBRKVNXDZcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkBRKVNXDZcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkUYXL6ZWQcjs.wbMatrix; exports.wetGpuSupport = _chunkV7GWZIZKcjs.wetGpuSupport; exports.wetSimdSupported = _chunkV7GWZIZKcjs.wetSimdSupported; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.whiteBalanceFromSample = _chunkUYXL6ZWQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkUYXL6ZWQcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkUYXL6ZWQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkUYXL6ZWQcjs.withNewIds; exports.workImage = workImage; exports.workLuma = workLuma; exports.workPlanes = workPlanes; exports.writeAdjustmentBlock = _chunkUYXL6ZWQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkUYXL6ZWQcjs.writeLfx2; exports.writePatternBlock = _chunkUYXL6ZWQcjs.writePatternBlock; exports.writePsd = _chunkUYXL6ZWQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkUYXL6ZWQcjs.xyToTempTint; exports.xyToUv = _chunkUYXL6ZWQcjs.xyToUv;