@pixerate/editor 0.150.0 → 0.151.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/agent/index.cjs +34 -34
  2. package/dist/agent/index.js +8 -8
  3. package/dist/animation-editor/editorDocument.d.cts +9 -0
  4. package/dist/animation-editor/editorDocument.d.ts +9 -0
  5. package/dist/animation-editor/index.cjs +33 -1
  6. package/dist/animation-editor/index.d.cts +1 -0
  7. package/dist/animation-editor/index.d.ts +1 -0
  8. package/dist/animation-editor/index.js +32 -0
  9. package/dist/bridge/cli.cjs +4 -4
  10. package/dist/bridge/cli.js +3 -3
  11. package/dist/bridge/index.cjs +4 -4
  12. package/dist/bridge/index.js +3 -3
  13. package/dist/chart/controller.d.cts +5 -0
  14. package/dist/chart/controller.d.ts +5 -0
  15. package/dist/chart/editorDocument.d.cts +10 -0
  16. package/dist/chart/editorDocument.d.ts +10 -0
  17. package/dist/chart/index.cjs +54 -18
  18. package/dist/chart/index.d.cts +1 -0
  19. package/dist/chart/index.d.ts +1 -0
  20. package/dist/chart/index.js +37 -1
  21. package/dist/{chunk-ENIZYNEF.cjs → chunk-24M7VD6M.cjs} +7 -7
  22. package/dist/{chunk-OET45HIR.js → chunk-4RF2H3N3.js} +10 -0
  23. package/dist/{chunk-KC7HB5GF.cjs → chunk-5H2C3QSF.cjs} +4 -3
  24. package/dist/{chunk-HRLT5BYO.js → chunk-GNV54DLO.js} +2 -1
  25. package/dist/{chunk-EAQ4BGNS.js → chunk-MKTDELCD.js} +1 -1
  26. package/dist/{chunk-X35BV5YT.cjs → chunk-ML2II3Y3.cjs} +10 -0
  27. package/dist/{chunk-QCEQIRJQ.cjs → chunk-PI45JMP7.cjs} +163 -136
  28. package/dist/{chunk-DVLMW3GB.cjs → chunk-R3PECGTQ.cjs} +44 -44
  29. package/dist/{chunk-2AQL4JHM.js → chunk-R6HNWN7B.js} +1 -1
  30. package/dist/{chunk-6QTON3VW.cjs → chunk-RZJCYJWO.cjs} +8 -8
  31. package/dist/{chunk-O5ML2I6O.js → chunk-SVINJIGK.js} +1 -1
  32. package/dist/{chunk-ZQUANEK4.js → chunk-Y64YPIFT.js} +28 -1
  33. package/dist/diagram/index.cjs +6 -6
  34. package/dist/diagram/index.js +5 -5
  35. package/dist/export/index.cjs +1 -1
  36. package/dist/export/index.js +1 -1
  37. package/dist/extensions/index.cjs +5 -5
  38. package/dist/extensions/index.js +4 -4
  39. package/dist/image-editor/canvas-viewport.d.cts +52 -0
  40. package/dist/image-editor/canvas-viewport.d.ts +52 -0
  41. package/dist/image-editor/index.cjs +666 -599
  42. package/dist/image-editor/index.d.cts +1 -0
  43. package/dist/image-editor/index.d.ts +1 -0
  44. package/dist/image-editor/index.js +100 -33
  45. package/dist/image-editor/layers/ops.d.cts +21 -3
  46. package/dist/image-editor/layers/ops.d.ts +21 -3
  47. package/dist/image-editor/renderer.d.cts +7 -0
  48. package/dist/image-editor/renderer.d.ts +7 -0
  49. package/dist/index.cjs +14 -14
  50. package/dist/index.js +8 -8
  51. package/dist/paint-editor/index.cjs +6 -6
  52. package/dist/paint-editor/index.js +1 -1
  53. package/dist/parameters/controller.d.cts +6 -0
  54. package/dist/parameters/controller.d.ts +6 -0
  55. package/dist/parameters/editorDocument.d.cts +9 -0
  56. package/dist/parameters/editorDocument.d.ts +9 -0
  57. package/dist/parameters/index.cjs +71 -1
  58. package/dist/parameters/index.d.cts +1 -0
  59. package/dist/parameters/index.d.ts +1 -0
  60. package/dist/parameters/index.js +70 -0
  61. package/dist/persistence/editorDocument.d.cts +6 -3
  62. package/dist/persistence/editorDocument.d.ts +6 -3
  63. package/dist/persistence/index.cjs +7 -7
  64. package/dist/persistence/index.js +1 -1
  65. package/dist/tools/index.cjs +5 -5
  66. package/dist/tools/index.js +6 -6
  67. package/dist/vector/editorDocument.d.cts +9 -0
  68. package/dist/vector/editorDocument.d.ts +9 -0
  69. package/dist/vector/index.cjs +45 -1
  70. package/dist/vector/index.d.cts +1 -0
  71. package/dist/vector/index.d.ts +1 -0
  72. package/dist/vector/index.js +44 -0
  73. package/dist/video-editor/editorDocument.d.cts +9 -0
  74. package/dist/video-editor/editorDocument.d.ts +9 -0
  75. package/dist/video-editor/index.cjs +33 -1
  76. package/dist/video-editor/index.d.cts +1 -0
  77. package/dist/video-editor/index.d.ts +1 -0
  78. package/dist/video-editor/index.js +32 -0
  79. package/package.json +2 -2
  80. package/skills/pixerate-animation-editor/SKILL.md +12 -0
  81. package/skills/pixerate-chart/SKILL.md +12 -0
  82. package/skills/pixerate-image-editor/SKILL.md +6 -6
  83. package/skills/pixerate-parameters/SKILL.md +12 -0
  84. package/skills/pixerate-vector/SKILL.md +14 -0
  85. package/skills/pixerate-video-editor/SKILL.md +12 -0
  86. package/dist/{chunk-Y4BWZB6J.cjs → chunk-462WGGXX.cjs} +2 -2
  87. package/dist/{chunk-RFBFTLVN.js → chunk-EVXQNQND.js} +3 -3
@@ -363,13 +363,14 @@ var _chunk5UEFNX24cjs = require('../chunk-5UEFNX24.cjs');
363
363
 
364
364
 
365
365
 
366
- var _chunkQCEQIRJQcjs = require('../chunk-QCEQIRJQ.cjs');
367
366
 
368
367
 
369
- var _chunkA2IS7EHEcjs = require('../chunk-A2IS7EHE.cjs');
370
368
 
371
369
 
372
- var _chunkL5OWG2NAcjs = require('../chunk-L5OWG2NA.cjs');
370
+ var _chunkPI45JMP7cjs = require('../chunk-PI45JMP7.cjs');
371
+
372
+
373
+ var _chunkA2IS7EHEcjs = require('../chunk-A2IS7EHE.cjs');
373
374
 
374
375
 
375
376
  var _chunkPY4GWSE2cjs = require('../chunk-PY4GWSE2.cjs');
@@ -583,7 +584,6 @@ var _chunkGNK7SESQcjs = require('../chunk-GNK7SESQ.cjs');
583
584
 
584
585
 
585
586
  var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
586
- require('../chunk-2BSBFBOA.cjs');
587
587
 
588
588
 
589
589
 
@@ -625,6 +625,9 @@ require('../chunk-2BSBFBOA.cjs');
625
625
  var _chunkRHXW4TA5cjs = require('../chunk-RHXW4TA5.cjs');
626
626
  require('../chunk-BXMIBMVG.cjs');
627
627
  require('../chunk-CVFAAZXE.cjs');
628
+
629
+
630
+ var _chunkL5OWG2NAcjs = require('../chunk-L5OWG2NA.cjs');
628
631
  require('../chunk-GF2RBSDM.cjs');
629
632
  require('../chunk-NM3G4VQT.cjs');
630
633
 
@@ -832,6 +835,7 @@ var _chunkCWM3CUUXcjs = require('../chunk-CWM3CUUX.cjs');
832
835
  var _chunkXFM3OCHUcjs = require('../chunk-XFM3OCHU.cjs');
833
836
  require('../chunk-NIBFDFYW.cjs');
834
837
  require('../chunk-UWEQ55MY.cjs');
838
+ require('../chunk-2BSBFBOA.cjs');
835
839
  require('../chunk-LEUZ4FRC.cjs');
836
840
  require('../chunk-A6QWKBJP.cjs');
837
841
  require('../chunk-UKCJ43YL.cjs');
@@ -940,7 +944,7 @@ function quickMaskPixels(mask, style = {}) {
940
944
 
941
945
  // src/image-editor/layers/render.ts
942
946
  function isQuarterTurn(rotate) {
943
- return _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
947
+ return _chunkPI45JMP7cjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
944
948
  }
945
949
  function isIntegerRect(r) {
946
950
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -948,7 +952,7 @@ function isIntegerRect(r) {
948
952
  function baseProjection(region, transform, baseW, baseH) {
949
953
  return {
950
954
  region,
951
- angle: _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate),
955
+ angle: _chunkPI45JMP7cjs.normalizeAngle.call(void 0, transform.rotate),
952
956
  flipH: transform.flipH,
953
957
  flipV: transform.flipV,
954
958
  scale: 1,
@@ -957,14 +961,14 @@ function baseProjection(region, transform, baseW, baseH) {
957
961
  };
958
962
  }
959
963
  function projectQuarterTurn(src, srcRect, region, transform) {
960
- const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
964
+ const rotated = _chunkPI45JMP7cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
961
965
  const w = Math.max(1, Math.round(rotated.width));
962
966
  const h = Math.max(1, Math.round(rotated.height));
963
967
  const out = new Uint8ClampedArray(w * h * 4);
964
968
  const p = baseProjection(region, transform, w, h);
965
- const o = _chunkQCEQIRJQcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
966
- const ox = _chunkQCEQIRJQcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
967
- const oy = _chunkQCEQIRJQcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
969
+ const o = _chunkPI45JMP7cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
970
+ const ox = _chunkPI45JMP7cjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
971
+ const oy = _chunkPI45JMP7cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
968
972
  const ux = Math.round(ox.x - o.x);
969
973
  const vx = Math.round(ox.y - o.y);
970
974
  const uy = Math.round(oy.x - o.x);
@@ -993,23 +997,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
993
997
  const d = img.data;
994
998
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
995
999
  }
996
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunkQCEQIRJQcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
1000
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkPI45JMP7cjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
997
1001
  }
998
1002
  function needsLegacyBase(input) {
999
1003
  const { stack, region, canvas, transform } = input;
1000
- if (!_chunkQCEQIRJQcjs.isLegacyShape.call(void 0, stack)) return false;
1004
+ if (!_chunkPI45JMP7cjs.isLegacyShape.call(void 0, stack)) return false;
1001
1005
  const bg = stack.layers[0];
1002
1006
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
1003
1007
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
1004
1008
  if (stack.outputOpacity < 1) return true;
1005
- const blur = _chunkQCEQIRJQcjs.blurFilter.call(void 0, bg);
1009
+ const blur = _chunkPI45JMP7cjs.blurFilter.call(void 0, bg);
1006
1010
  if (blur && blur.enabled && blur.radius > 0) {
1007
1011
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
1008
- const angle = _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate);
1012
+ const angle = _chunkPI45JMP7cjs.normalizeAngle.call(void 0, transform.rotate);
1009
1013
  if (!full || angle === 90 || angle === 270) return true;
1010
1014
  }
1011
1015
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
1012
- if (_chunkQCEQIRJQcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1016
+ if (_chunkPI45JMP7cjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1013
1017
  return false;
1014
1018
  }
1015
1019
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -1041,7 +1045,7 @@ function coveringRect(region) {
1041
1045
  const y = Math.floor(region.y);
1042
1046
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
1043
1047
  }
1044
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)()) {
1048
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkPI45JMP7cjs.LayerCompositor)()) {
1045
1049
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
1046
1050
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
1047
1051
  }
@@ -1175,8 +1179,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1175
1179
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1176
1180
  * trust dirty rectangles; exports use `exportCompositor`.
1177
1181
  */
1178
- __init8() {this.compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)()}
1179
- __init9() {this.exportCompositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1182
+ __init8() {this.compositor = new (0, _chunkPI45JMP7cjs.LayerCompositor)()}
1183
+ __init9() {this.exportCompositor = new (0, _chunkPI45JMP7cjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1180
1184
  /** How the host resolves layer pixels (set by the controller). */
1181
1185
 
1182
1186
  /**
@@ -1245,17 +1249,19 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1245
1249
  const { crop, transform, adjustments, depthMask, annotations, selectedAnnotationId, zoom, pan, isOriginalCompared } = state;
1246
1250
  const vpWidth = options.viewportWidth || targetCanvas.width;
1247
1251
  const vpHeight = options.viewportHeight || targetCanvas.height;
1248
- targetCanvas.width = vpWidth;
1249
- targetCanvas.height = vpHeight;
1252
+ const ratio = options.pixelRatio && Number.isFinite(options.pixelRatio) && options.pixelRatio > 0 ? options.pixelRatio : 1;
1253
+ targetCanvas.width = Math.max(1, Math.round(vpWidth * ratio));
1254
+ targetCanvas.height = Math.max(1, Math.round(vpHeight * ratio));
1255
+ if (ratio !== 1 && typeof ctx.setTransform === "function") ctx.setTransform(targetCanvas.width / vpWidth, 0, 0, targetCanvas.height / vpHeight, 0, 0);
1250
1256
  ctx.clearRect(0, 0, vpWidth, vpHeight);
1251
1257
  if (isOriginalCompared) {
1252
1258
  this.drawFittedImage(ctx, img, naturalWidth, naturalHeight, vpWidth, vpHeight, zoom, pan, fit);
1253
1259
  return;
1254
1260
  }
1255
1261
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1256
- const projection = _chunkQCEQIRJQcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1262
+ const projection = _chunkPI45JMP7cjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1257
1263
  const { region } = projection;
1258
- const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1264
+ const rotated = _chunkPI45JMP7cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1259
1265
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1260
1266
  let overlay = annotations;
1261
1267
  if (route === "legacy") {
@@ -1265,8 +1271,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1265
1271
  `${naturalWidth}x${naturalHeight}`,
1266
1272
  `${region.x},${region.y},${region.width},${region.height}`,
1267
1273
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1268
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1269
- _chunkQCEQIRJQcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1274
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1275
+ _chunkPI45JMP7cjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1270
1276
  `${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _5 => _5.depthRange, 'optionalAccess', _6 => _6[0]])}-${_optionalChain([depthMask, 'access', _7 => _7.depthRange, 'optionalAccess', _8 => _8[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`,
1271
1277
  `d${this.displayKey}`
1272
1278
  ].join("|");
@@ -1300,7 +1306,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1300
1306
  }
1301
1307
  if (overlay.length > 0 || options.draftAnnotation) {
1302
1308
  ctx.save();
1303
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1309
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1304
1310
  ctx.beginPath();
1305
1311
  ctx.rect(region.x, region.y, region.width, region.height);
1306
1312
  ctx.clip();
@@ -1323,7 +1329,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1323
1329
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1324
1330
  ctx.save();
1325
1331
  try {
1326
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1332
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1327
1333
  ctx.beginPath();
1328
1334
  ctx.rect(region.x, region.y, region.width, region.height);
1329
1335
  ctx.clip();
@@ -1338,7 +1344,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1338
1344
  const b = options.brushCursor;
1339
1345
  ctx.save();
1340
1346
  try {
1341
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1347
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1342
1348
  const px2 = 1 / (projection.scale || 1);
1343
1349
  ctx.beginPath();
1344
1350
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1353,7 +1359,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1353
1359
  ctx.restore();
1354
1360
  }
1355
1361
  if (options.cloneSourceMarker) {
1356
- const m = _chunkQCEQIRJQcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1362
+ const m = _chunkPI45JMP7cjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1357
1363
  ctx.save();
1358
1364
  try {
1359
1365
  const r = 7;
@@ -1377,7 +1383,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1377
1383
  const t = options.textEdit;
1378
1384
  ctx.save();
1379
1385
  try {
1380
- const scr = (p) => _chunkQCEQIRJQcjs.projectImagePoint.call(void 0, p, projection);
1386
+ const scr = (p) => _chunkPI45JMP7cjs.projectImagePoint.call(void 0, p, projection);
1381
1387
  const poly = (pts) => {
1382
1388
  ctx.beginPath();
1383
1389
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1416,7 +1422,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1416
1422
  const t = options.freeTransform;
1417
1423
  ctx.save();
1418
1424
  try {
1419
- const scr = (p) => _chunkQCEQIRJQcjs.projectImagePoint.call(void 0, p, projection);
1425
+ const scr = (p) => _chunkPI45JMP7cjs.projectImagePoint.call(void 0, p, projection);
1420
1426
  ctx.beginPath();
1421
1427
  if (t.warp) {
1422
1428
  for (const c of t.warp.curves) {
@@ -1474,7 +1480,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1474
1480
  }
1475
1481
  if (isActivelyCropping) {
1476
1482
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1477
- this.drawCropOverlay(ctx, _chunkQCEQIRJQcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1483
+ this.drawCropOverlay(ctx, _chunkPI45JMP7cjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1478
1484
  }
1479
1485
  }
1480
1486
  /**
@@ -1483,7 +1489,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1483
1489
  */
1484
1490
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1485
1491
  const { adjustments, depthMask } = state;
1486
- const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1492
+ const rotated = _chunkPI45JMP7cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1487
1493
  const baseW = Math.max(1, Math.round(rotated.width));
1488
1494
  const baseH = Math.max(1, Math.round(rotated.height));
1489
1495
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1491,7 +1497,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1491
1497
  if (!baseCtx) return baseCanvas;
1492
1498
  const projection = getBaseProjection(region, transform, baseW, baseH);
1493
1499
  baseCtx.save();
1494
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1500
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1495
1501
  baseCtx.drawImage(
1496
1502
  img,
1497
1503
  region.x,
@@ -1506,8 +1512,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1506
1512
  baseCtx.restore();
1507
1513
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1508
1514
  if (imageData) {
1509
- const layerMasks = _chunkQCEQIRJQcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1510
- _chunkQCEQIRJQcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1515
+ const layerMasks = _chunkPI45JMP7cjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1516
+ _chunkPI45JMP7cjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1511
1517
  if (depthMask.enabled && depthMask.maskSource) {
1512
1518
  try {
1513
1519
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1518,7 +1524,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1518
1524
  const maskCtx = maskCanvas.getContext("2d");
1519
1525
  if (maskCtx) {
1520
1526
  maskCtx.save();
1521
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1527
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1522
1528
  maskCtx.drawImage(
1523
1529
  maskImg,
1524
1530
  region.x * sx,
@@ -1533,7 +1539,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1533
1539
  maskCtx.restore();
1534
1540
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1535
1541
  if (maskData) {
1536
- _chunkQCEQIRJQcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1542
+ _chunkPI45JMP7cjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1537
1543
  }
1538
1544
  }
1539
1545
  } catch (e8) {
@@ -1552,7 +1558,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1552
1558
  else if (this.baseRoute === "layers") route = "layers";
1553
1559
  else {
1554
1560
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1555
- const shaped = this.baseRoute === "legacy" && _chunkQCEQIRJQcjs.isLegacyShape.call(void 0, stack);
1561
+ const shaped = this.baseRoute === "legacy" && _chunkPI45JMP7cjs.isLegacyShape.call(void 0, stack);
1556
1562
  route = shaped || needsLegacyBase({
1557
1563
  stack,
1558
1564
  region,
@@ -1687,17 +1693,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1687
1693
  if (!comp) return null;
1688
1694
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1689
1695
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1690
- const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1696
+ const rotated = _chunkPI45JMP7cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1691
1697
  const baseW = Math.max(1, Math.round(rotated.width));
1692
1698
  const baseH = Math.max(1, Math.round(rotated.height));
1693
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1699
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkPI45JMP7cjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1694
1700
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1695
1701
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1696
1702
  const ctx = canvas.getContext("2d");
1697
1703
  if (!ctx) return null;
1698
1704
  ctx.clearRect(0, 0, baseW, baseH);
1699
1705
  ctx.save();
1700
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1706
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1701
1707
  ctx.beginPath();
1702
1708
  ctx.rect(region.x, region.y, region.width, region.height);
1703
1709
  ctx.clip();
@@ -1969,7 +1975,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1969
1975
  ctx.strokeStyle = "#3b82f6";
1970
1976
  ctx.lineWidth = 1.5;
1971
1977
  ctx.setLineDash([4, 4]);
1972
- const bounds = _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, ann);
1978
+ const bounds = _chunkPI45JMP7cjs.getAnnotationBounds.call(void 0, ann);
1973
1979
  const pad = 4;
1974
1980
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1975
1981
  ctx.fillStyle = "#ffffff";
@@ -1990,7 +1996,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1990
1996
  }
1991
1997
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1992
1998
  getAnnotationBounds(ann) {
1993
- return _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, ann);
1999
+ return _chunkPI45JMP7cjs.getAnnotationBounds.call(void 0, ann);
1994
2000
  }
1995
2001
  /**
1996
2002
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -2072,8 +2078,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2072
2078
  }
2073
2079
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
2074
2080
  const { crop, transform, annotations } = state;
2075
- const region = crop ? _chunkQCEQIRJQcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2076
- const rotated = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2081
+ const region = crop ? _chunkPI45JMP7cjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2082
+ const rotated = _chunkPI45JMP7cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2077
2083
  const baseW = Math.max(1, Math.round(rotated.width));
2078
2084
  const baseH = Math.max(1, Math.round(rotated.height));
2079
2085
  const exportW = options.width || baseW;
@@ -2102,7 +2108,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2102
2108
  const bctx = baseCanvas.getContext("2d");
2103
2109
  if (bctx) {
2104
2110
  bctx.save();
2105
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2111
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2106
2112
  bctx.beginPath();
2107
2113
  bctx.rect(region.x, region.y, region.width, region.height);
2108
2114
  bctx.clip();
@@ -2115,7 +2121,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2115
2121
  if (options.includeAnnotations !== false && overlay.length > 0) {
2116
2122
  ctx.save();
2117
2123
  ctx.scale(exportW / baseW, exportH / baseH);
2118
- _chunkQCEQIRJQcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2124
+ _chunkPI45JMP7cjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2119
2125
  for (const ann of overlay) {
2120
2126
  await this.drawAnnotation(ctx, ann);
2121
2127
  }
@@ -2205,7 +2211,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2205
2211
  case "rect":
2206
2212
  case "image":
2207
2213
  case "text": {
2208
- const b = _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, ann);
2214
+ const b = _chunkPI45JMP7cjs.getAnnotationBounds.call(void 0, ann);
2209
2215
  ctx.fillRect(b.x, b.y, b.width, b.height);
2210
2216
  break;
2211
2217
  }
@@ -2225,7 +2231,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2225
2231
  function getBaseProjection(region, transform, baseW, baseH) {
2226
2232
  return {
2227
2233
  region,
2228
- angle: _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, transform.rotate),
2234
+ angle: _chunkPI45JMP7cjs.normalizeAngle.call(void 0, transform.rotate),
2229
2235
  flipH: transform.flipH,
2230
2236
  flipV: transform.flipV,
2231
2237
  scale: 1,
@@ -2329,8 +2335,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2329
2335
  }
2330
2336
  function toMask(width, height, coverage) {
2331
2337
  const out = new Uint8Array(coverage.length);
2332
- for (let i = 0; i < out.length; i++) out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, coverage[i]);
2333
- return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height, out);
2338
+ for (let i = 0; i < out.length; i++) out[i] = _chunkPI45JMP7cjs.coverageToByte.call(void 0, coverage[i]);
2339
+ return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, width, height, out);
2334
2340
  }
2335
2341
  function polygonSelection(width, height, points, options = {}) {
2336
2342
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2457,7 +2463,7 @@ function magicWand(pixels, seed, options = {}) {
2457
2463
  const { width: w, height: h } = pixels;
2458
2464
  const sx = Math.floor(seed.x);
2459
2465
  const sy = Math.floor(seed.y);
2460
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h);
2466
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, w, h);
2461
2467
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2462
2468
  const marks = new Uint8Array(n);
2463
2469
  let bx0 = w;
@@ -2505,9 +2511,9 @@ function magicWand(pixels, seed, options = {}) {
2505
2511
  }
2506
2512
  }
2507
2513
  }
2508
- if (bx1 < 0) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h);
2509
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h, marks);
2510
- return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0,
2514
+ if (bx1 < 0) return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, w, h);
2515
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, w, h, marks);
2516
+ return _chunkPI45JMP7cjs.createSelectionMask.call(void 0,
2511
2517
  w,
2512
2518
  h,
2513
2519
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2529,7 +2535,7 @@ function colorRange(pixels, samples, options = {}) {
2529
2535
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2530
2536
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2531
2537
  const out = new Uint8Array(n);
2532
- if (!parsed.length) return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h, out);
2538
+ if (!parsed.length) return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, w, h, out);
2533
2539
  for (let i = 0; i < n; i++) {
2534
2540
  const p = i * 4;
2535
2541
  if (data[p + 3] <= 0) continue;
@@ -2545,9 +2551,9 @@ function colorRange(pixels, samples, options = {}) {
2545
2551
  }
2546
2552
  if (k > best) best = k;
2547
2553
  }
2548
- out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, best);
2554
+ out[i] = _chunkPI45JMP7cjs.coverageToByte.call(void 0, best);
2549
2555
  }
2550
- return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, w, h, out);
2556
+ return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, w, h, out);
2551
2557
  }
2552
2558
  var TONE_RANGE_PRESETS = {
2553
2559
  shadows: [0, 65],
@@ -2565,9 +2571,9 @@ function toneRange(pixels, range, falloff = 20) {
2565
2571
  if (d[p + 3] <= 0) continue;
2566
2572
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2567
2573
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2568
- out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2574
+ out[i] = _chunkPI45JMP7cjs.coverageToByte.call(void 0, 1 - outside / ramp);
2569
2575
  }
2570
- return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2576
+ return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2571
2577
  }
2572
2578
  function hueRange(pixels, center) {
2573
2579
  const n = checkPixels(pixels);
@@ -2590,9 +2596,9 @@ function hueRange(pixels, center) {
2590
2596
  hue *= 60;
2591
2597
  let dh = ((hue - center) % 360 + 360) % 360;
2592
2598
  dh = Math.min(dh, 360 - dh);
2593
- out[i] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2599
+ out[i] = _chunkPI45JMP7cjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2594
2600
  }
2595
- return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2601
+ return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2596
2602
  }
2597
2603
 
2598
2604
  // src/image-editor/selection/refine.ts
@@ -2726,9 +2732,9 @@ function edgeWidth(guide, w, h, r) {
2726
2732
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2727
2733
  }
2728
2734
  }
2729
- const gm = _chunkQCEQIRJQcjs.greyMorphology.call(void 0, g, w, h, r, true);
2730
- const hi = _chunkQCEQIRJQcjs.greyMorphology.call(void 0, y, w, h, r, true);
2731
- const lo = _chunkQCEQIRJQcjs.greyMorphology.call(void 0, y, w, h, r, false);
2735
+ const gm = _chunkPI45JMP7cjs.greyMorphology.call(void 0, g, w, h, r, true);
2736
+ const hi = _chunkPI45JMP7cjs.greyMorphology.call(void 0, y, w, h, r, true);
2737
+ const lo = _chunkPI45JMP7cjs.greyMorphology.call(void 0, y, w, h, r, false);
2732
2738
  const out = new Float32Array(n);
2733
2739
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2734
2740
  return out;
@@ -2752,7 +2758,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2752
2758
  }
2753
2759
  }
2754
2760
  if (any) {
2755
- const dist = _chunkQCEQIRJQcjs.distanceTransform.call(void 0, boundary, w, h);
2761
+ const dist = _chunkPI45JMP7cjs.distanceTransform.call(void 0, boundary, w, h);
2756
2762
  const r = gfRadius(p);
2757
2763
  const q = guidedFilterColor(guide, m, w, h, r);
2758
2764
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2778,7 +2784,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2778
2784
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2779
2785
  }
2780
2786
  const amount = shiftAmount(p);
2781
- if (Math.abs(amount) >= 1e-4) a = _chunkQCEQIRJQcjs.shiftCoverage.call(void 0, a, w, h, amount);
2787
+ if (Math.abs(amount) >= 1e-4) a = _chunkPI45JMP7cjs.shiftCoverage.call(void 0, a, w, h, amount);
2782
2788
  return a;
2783
2789
  }
2784
2790
  function guidePlanes(pixels, win) {
@@ -2822,9 +2828,9 @@ function refineSelection(pixels, mask, params = {}) {
2822
2828
  const out = new Uint8Array(mask.width * mask.height);
2823
2829
  for (let y = 0; y < wh; y++) {
2824
2830
  const dst = (y0 + y) * mask.width + x0;
2825
- for (let x = 0; x < ww; x++) out[dst + x] = _chunkQCEQIRJQcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2831
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkPI45JMP7cjs.coverageToByte.call(void 0, refined[y * ww + x]);
2826
2832
  }
2827
- return _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2833
+ return _chunkPI45JMP7cjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2828
2834
  }
2829
2835
 
2830
2836
  // src/image-editor/effects.ts
@@ -2994,7 +3000,7 @@ var ImageEffectsEngine = (_class4 = class {
2994
3000
  // src/image-editor/free-transform.ts
2995
3001
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2996
3002
  var fail = (message) => {
2997
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(message);
3003
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(message);
2998
3004
  };
2999
3005
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
3000
3006
  function previewStep(scale) {
@@ -3103,7 +3109,7 @@ var FreeTransformSession = (_class5 = class {
3103
3109
  } else {
3104
3110
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
3105
3111
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
3106
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, layers, id).layer;
3112
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, layers, id).layer;
3107
3113
  this.layerId = layer.id;
3108
3114
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
3109
3115
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -3114,20 +3120,20 @@ var FreeTransformSession = (_class5 = class {
3114
3120
  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.`);
3115
3121
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
3116
3122
  if (content !== "selection-copy") {
3117
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3118
- if (!maskAlone) _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3123
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3124
+ if (!maskAlone) _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3119
3125
  }
3120
3126
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3121
3127
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
3122
3128
  if (layer.type === "smart" && !maskAlone) {
3123
3129
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a smart object, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3124
- if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3130
+ if (!_chunkPI45JMP7cjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3125
3131
  this.smart = layer;
3126
3132
  this.smartObject = true;
3127
- this.startGeometry = _chunkQCEQIRJQcjs.placementGeometry.call(void 0, layer);
3133
+ this.startGeometry = _chunkPI45JMP7cjs.placementGeometry.call(void 0, layer);
3128
3134
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
3129
3135
  this.startInterp = this.interp;
3130
- this.box = _chunkQCEQIRJQcjs.contentsBox.call(void 0, layer.contents);
3136
+ this.box = _chunkPI45JMP7cjs.contentsBox.call(void 0, layer.contents);
3131
3137
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
3132
3138
  this.geometryValue = this.startGeometry;
3133
3139
  this.shown = this.startLayers;
@@ -3135,8 +3141,8 @@ var FreeTransformSession = (_class5 = class {
3135
3141
  }
3136
3142
  if (layer.type === "type" && !maskAlone) {
3137
3143
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3138
- const frame = _chunkQCEQIRJQcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3139
- const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer);
3144
+ const frame = _chunkPI45JMP7cjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3145
+ const m = _chunkPI45JMP7cjs.textMatrix.call(void 0, layer);
3140
3146
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
3141
3147
  this.typeTarget = layer;
3142
3148
  this.typeLayer = true;
@@ -3155,7 +3161,7 @@ var FreeTransformSession = (_class5 = class {
3155
3161
  }
3156
3162
  if (layer.type === "shape" && !maskAlone) {
3157
3163
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a shape layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3158
- const g = _chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer);
3164
+ const g = _chunkPI45JMP7cjs.shapeGeometryBounds.call(void 0, layer);
3159
3165
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
3160
3166
  const w = Math.max(g.width, 1);
3161
3167
  const h = Math.max(g.height, 1);
@@ -3203,7 +3209,7 @@ var FreeTransformSession = (_class5 = class {
3203
3209
  if (box) {
3204
3210
  const copy = {
3205
3211
  type: "pixel",
3206
- id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
3212
+ id: _chunkPI45JMP7cjs.newLayerId.call(void 0, ),
3207
3213
  name: `${layer.name || "Layer"} copy`,
3208
3214
  visible: true,
3209
3215
  opacity: 1,
@@ -3227,7 +3233,7 @@ var FreeTransformSession = (_class5 = class {
3227
3233
  if (!box) fail(content === "layer" ? "The layer has no pixels to transform." : "The selection holds no pixels of this layer; select some, or transform the outline (content selection-outline).");
3228
3234
  this.box = box;
3229
3235
  this.moves = moves;
3230
- this.startGeometry = _chunkQCEQIRJQcjs.identityTransform.call(void 0, box);
3236
+ this.startGeometry = _chunkPI45JMP7cjs.identityTransform.call(void 0, box);
3231
3237
  this.startInterp = this.interp;
3232
3238
  this.geometryValue = this.startGeometry;
3233
3239
  this.shown = this.startLayers;
@@ -3305,8 +3311,8 @@ var FreeTransformSession = (_class5 = class {
3305
3311
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3306
3312
  };
3307
3313
  if (next.corners.length !== 4 || !next.corners.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) fail("corners must be four finite points: top-left, top-right, bottom-right, bottom-left.");
3308
- if (!_chunkQCEQIRJQcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3309
- if (this.typeTarget && (_chunkQCEQIRJQcjs.hasWarp.call(void 0, next) || !_chunkQCEQIRJQcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3314
+ if (!_chunkPI45JMP7cjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3315
+ if (this.typeTarget && (_chunkPI45JMP7cjs.hasWarp.call(void 0, next) || !_chunkPI45JMP7cjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3310
3316
  fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
3311
3317
  }
3312
3318
  this.geometryValue = next;
@@ -3318,10 +3324,10 @@ var FreeTransformSession = (_class5 = class {
3318
3324
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3319
3325
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3320
3326
  const g = this.geometryValue;
3321
- const identity = _chunkQCEQIRJQcjs.isIdentityTransform.call(void 0, g);
3322
- const warp = _chunkQCEQIRJQcjs.hasWarp.call(void 0, g);
3323
- const h = warp ? null : _chunkQCEQIRJQcjs.geometryHomography.call(void 0, g);
3324
- const f = warp ? _chunkQCEQIRJQcjs.transformMap.call(void 0, g) : null;
3327
+ const identity = _chunkPI45JMP7cjs.isIdentityTransform.call(void 0, g);
3328
+ const warp = _chunkPI45JMP7cjs.hasWarp.call(void 0, g);
3329
+ const h = warp ? null : _chunkPI45JMP7cjs.geometryHomography.call(void 0, g);
3330
+ const f = warp ? _chunkPI45JMP7cjs.transformMap.call(void 0, g) : null;
3325
3331
  const step = final ? 1 : previewStep(preview.scale);
3326
3332
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3327
3333
  let layers = this.startLayers;
@@ -3365,7 +3371,7 @@ var FreeTransformSession = (_class5 = class {
3365
3371
  if (part.what === "selection") {
3366
3372
  const { width, height } = this.host.canvas();
3367
3373
  const data = new Uint8Array(_chunkCWM3CUUXcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3368
- const next = _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height, data);
3374
+ const next = _chunkPI45JMP7cjs.createSelectionMask.call(void 0, width, height, data);
3369
3375
  selection = next.bounds ? next : null;
3370
3376
  } else if (part.what === "pixels") {
3371
3377
  layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -3387,14 +3393,14 @@ var FreeTransformSession = (_class5 = class {
3387
3393
  resampleShape(final, preview, warpMap, h) {
3388
3394
  const layer = this.shape;
3389
3395
  let components = layer.components;
3390
- if (!_chunkQCEQIRJQcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3396
+ if (!_chunkPI45JMP7cjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3391
3397
  const affine = !warpMap && h && Math.abs(h[6]) < 1e-12 && Math.abs(h[7]) < 1e-12 && Math.abs(h[8] - 1) < 1e-12 ? [h[0], h[3], h[1], h[4], h[2], h[5]] : void 0;
3392
3398
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p) : p)));
3393
- components = _chunkQCEQIRJQcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3399
+ components = _chunkPI45JMP7cjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3394
3400
  }
3395
3401
  const moved = { ...layer, components };
3396
3402
  delete moved.annotation;
3397
- const surface = _chunkQCEQIRJQcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3403
+ const surface = _chunkPI45JMP7cjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3398
3404
  return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3399
3405
  }
3400
3406
  /**
@@ -3404,13 +3410,13 @@ var FreeTransformSession = (_class5 = class {
3404
3410
  resampleType() {
3405
3411
  const layer = this.typeTarget;
3406
3412
  const g = this.geometryValue;
3407
- if (_chunkQCEQIRJQcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3408
- const m = _chunkQCEQIRJQcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3413
+ if (_chunkPI45JMP7cjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3414
+ const m = _chunkPI45JMP7cjs.matrixFromCorners.call(void 0, g.box, g.corners);
3409
3415
  if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
3410
3416
  const next = { ...layer, transform: m };
3411
3417
  delete next.annotation;
3412
- let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkQCEQIRJQcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3413
- const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkRHXW4TA5cjs.invertMatrix.call(void 0, _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
3418
+ let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkPI45JMP7cjs.rerenderText.call(void 0, next, this.host.textEnv()));
3419
+ const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkRHXW4TA5cjs.invertMatrix.call(void 0, _chunkPI45JMP7cjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
3414
3420
  for (const part of this.parts) {
3415
3421
  if (part.what !== "mask") continue;
3416
3422
  const surface = _chunkHGTDMKNEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -3426,12 +3432,12 @@ var FreeTransformSession = (_class5 = class {
3426
3432
  const canvas = this.host.canvas();
3427
3433
  try {
3428
3434
  if (final) {
3429
- const res = _chunkQCEQIRJQcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3435
+ const res = _chunkPI45JMP7cjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3430
3436
  this.smartMasksMoved = res.masksMoved;
3431
3437
  return res.layers;
3432
3438
  }
3433
3439
  const step = previewStep(preview.scale);
3434
- const surface = _chunkQCEQIRJQcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3440
+ const surface = _chunkPI45JMP7cjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3435
3441
  return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3436
3442
  } catch (e) {
3437
3443
  if (e instanceof _chunkHGTDMKNEcjs.TransformTooLargeError) fail(e.message);
@@ -3441,10 +3447,10 @@ var FreeTransformSession = (_class5 = class {
3441
3447
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3442
3448
  isChanged() {
3443
3449
  const g = this.geometryValue;
3444
- if (!this.smart && !this.typeTarget) return !_chunkQCEQIRJQcjs.isIdentityTransform.call(void 0, g);
3450
+ if (!this.smart && !this.typeTarget) return !_chunkPI45JMP7cjs.isIdentityTransform.call(void 0, g);
3445
3451
  const a = this.startGeometry;
3446
3452
  const same = g.corners.every((c, i) => Math.abs(c.x - a.corners[i].x) < 1e-9 && Math.abs(c.y - a.corners[i].y) < 1e-9);
3447
- const warp = (w, box) => w && _chunkQCEQIRJQcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3453
+ const warp = (w, box) => w && _chunkPI45JMP7cjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3448
3454
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3449
3455
  }
3450
3456
  render(preview) {
@@ -3704,7 +3710,7 @@ function convertSurfaceColors(surface, t) {
3704
3710
  }
3705
3711
 
3706
3712
  // src/image-editor/controller.ts
3707
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION;
3713
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION;
3708
3714
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
3709
3715
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3710
3716
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -3898,7 +3904,7 @@ var PaintStrokeSession = (_class6 = class {
3898
3904
  for (const t of _chunkCWM3CUUXcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
3899
3905
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, t.tx, t.ty);
3900
3906
  const cur = regions.get(key);
3901
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkQCEQIRJQcjs.unionRect.call(void 0, cur.r, r) : r });
3907
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkPI45JMP7cjs.unionRect.call(void 0, cur.r, r) : r });
3902
3908
  }
3903
3909
  }
3904
3910
  for (const [key, { tx, ty, r }] of regions) {
@@ -3930,7 +3936,7 @@ var PaintStrokeSession = (_class6 = class {
3930
3936
  }
3931
3937
  /** Finishes the stroke (one undo step) and returns what changed. */
3932
3938
  end() {
3933
- if (this.closed) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("This stroke has already ended.");
3939
+ if (this.closed) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("This stroke has already ended.");
3934
3940
  const last = _nullishCoalesce(this.last, () => ( void 0));
3935
3941
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
3936
3942
  _optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
@@ -4066,20 +4072,20 @@ function sameTile(a, b) {
4066
4072
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
4067
4073
  return true;
4068
4074
  }
4069
- var DEFAULT_ADJUSTMENTS = _chunkQCEQIRJQcjs.DEFAULT_ADJUSTMENTS_VALUES;
4075
+ var DEFAULT_ADJUSTMENTS = _chunkPI45JMP7cjs.DEFAULT_ADJUSTMENTS_VALUES;
4070
4076
  function normalizeStoredAdjustments(stored) {
4071
4077
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
4072
4078
  const out = {
4073
4079
  ...DEFAULT_ADJUSTMENTS,
4074
4080
  ...stored,
4075
- process: _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, stored.process)
4081
+ process: _chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, stored.process)
4076
4082
  };
4077
- const layers = _chunkQCEQIRJQcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4083
+ const layers = _chunkPI45JMP7cjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4078
4084
  if (layers.length) out.layers = layers;
4079
4085
  else delete out.layers;
4080
4086
  return out;
4081
4087
  }
4082
- var isLayered = (data) => Boolean(data && data.version === _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4088
+ var isLayered = (data) => Boolean(data && data.version === _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4083
4089
  function migrateSerializedImageEditorState(data) {
4084
4090
  if (isLayered(data)) {
4085
4091
  const out = {
@@ -4111,10 +4117,10 @@ function migrateSerializedImageEditorState(data) {
4111
4117
  function migrateToLayeredState(data, size) {
4112
4118
  const clean = migrateSerializedImageEditorState(data);
4113
4119
  if (isLayered(clean)) return clean;
4114
- const stack = _chunkQCEQIRJQcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4115
- const { layers, assets } = _chunkQCEQIRJQcjs.serializeLayers.call(void 0, stack.layers);
4120
+ const stack = _chunkPI45JMP7cjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4121
+ const { layers, assets } = _chunkPI45JMP7cjs.serializeLayers.call(void 0, stack.layers);
4116
4122
  const out = {
4117
- version: _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION,
4123
+ version: _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION,
4118
4124
  width: Math.round(size.width),
4119
4125
  height: Math.round(size.height),
4120
4126
  layers,
@@ -4128,8 +4134,8 @@ function migrateToLayeredState(data, size) {
4128
4134
  if (clean.selection) out.selection = clean.selection;
4129
4135
  return out;
4130
4136
  }
4131
- var DEFAULT_TRANSFORM = _chunkQCEQIRJQcjs.DEFAULT_TRANSFORM_VALUES;
4132
- var DEFAULT_DEPTH_MASK = _chunkQCEQIRJQcjs.DEFAULT_DEPTH_MASK_VALUES;
4137
+ var DEFAULT_TRANSFORM = _chunkPI45JMP7cjs.DEFAULT_TRANSFORM_VALUES;
4138
+ var DEFAULT_DEPTH_MASK = _chunkPI45JMP7cjs.DEFAULT_DEPTH_MASK_VALUES;
4133
4139
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
4134
4140
  var ImageEditorController = (_class7 = class {
4135
4141
 
@@ -4152,7 +4158,7 @@ var ImageEditorController = (_class7 = class {
4152
4158
  __init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
4153
4159
  __init63() {this.viewKey = []}
4154
4160
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
4155
- __init64() {this.compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)()}
4161
+ __init64() {this.compositor = new (0, _chunkPI45JMP7cjs.LayerCompositor)()}
4156
4162
  /** The effects provider slot (see `setEffectsProvider`). */
4157
4163
  __init65() {this.effects = new (0, _chunkRUZQMYXHcjs.EffectsSlot)()}
4158
4164
  /** Renders provider effects: effect smart filter results and effect layers. */
@@ -4210,7 +4216,7 @@ var ImageEditorController = (_class7 = class {
4210
4216
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
4211
4217
  if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
4212
4218
  try {
4213
- this.state.selection = normalizeSelection(_chunkQCEQIRJQcjs.deserializeSelection.call(void 0, options.initialState.selection));
4219
+ this.state.selection = normalizeSelection(_chunkPI45JMP7cjs.deserializeSelection.call(void 0, options.initialState.selection));
4214
4220
  } catch (e15) {
4215
4221
  }
4216
4222
  }
@@ -4322,10 +4328,10 @@ var ImageEditorController = (_class7 = class {
4322
4328
  if (l.type === "group") {
4323
4329
  const children = walk(l.children);
4324
4330
  if (children !== l.children) next2 = { ...l, children };
4325
- } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkQCEQIRJQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4331
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkPI45JMP7cjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4326
4332
  try {
4327
- const r = _chunkQCEQIRJQcjs.rerender.call(void 0, l, canvas);
4328
- if (all || !_chunkQCEQIRJQcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4333
+ const r = _chunkPI45JMP7cjs.rerender.call(void 0, l, canvas);
4334
+ if (all || !_chunkPI45JMP7cjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4329
4335
  } catch (e17) {
4330
4336
  }
4331
4337
  }
@@ -4381,19 +4387,19 @@ var ImageEditorController = (_class7 = class {
4381
4387
  const d = await this.describeEffect(effect, "filter");
4382
4388
  const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
4383
4389
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
4384
- if (!found) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4390
+ if (!found) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4385
4391
  let layers = this.state.layers;
4386
4392
  let id = layerId;
4387
4393
  let converted = false;
4388
4394
  if (found.layer.type !== "smart") {
4389
- if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4390
- const res2 = _chunkQCEQIRJQcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4395
+ if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4396
+ const res2 = _chunkPI45JMP7cjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4391
4397
  layers = res2.layers;
4392
4398
  id = res2.layer.id;
4393
4399
  converted = true;
4394
4400
  }
4395
- const filter = _chunkQCEQIRJQcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4396
- const res = _chunkQCEQIRJQcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4401
+ const filter = _chunkPI45JMP7cjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4402
+ const res = _chunkPI45JMP7cjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4397
4403
  this.commitLayers(res.layers);
4398
4404
  return { layerId: id, filter: res.filter, converted };
4399
4405
  }
@@ -4404,9 +4410,9 @@ var ImageEditorController = (_class7 = class {
4404
4410
  * false, during a drag).
4405
4411
  */
4406
4412
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
4407
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4413
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4408
4414
  const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
4409
- if (!was || was.kind !== "effect") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4415
+ if (!was || was.kind !== "effect") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4410
4416
  const update = {};
4411
4417
  if (changes.values) {
4412
4418
  const d = await this.describeEffect(was.effect);
@@ -4415,15 +4421,15 @@ var ImageEditorController = (_class7 = class {
4415
4421
  for (const [k, v] of Object.entries(changes.values)) {
4416
4422
  if (v !== null) given[k] = v;
4417
4423
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4418
- else throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4424
+ else throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4419
4425
  }
4420
4426
  update.values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4421
4427
  }
4422
4428
  for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
4423
- let res = _chunkQCEQIRJQcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4424
- if (changes.index !== void 0) res = { ...res, layers: _chunkQCEQIRJQcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4429
+ let res = _chunkPI45JMP7cjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4430
+ if (changes.index !== void 0) res = { ...res, layers: _chunkPI45JMP7cjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4425
4431
  this.commitLayers(res.layers, void 0, commitToHistory);
4426
- return _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4432
+ return _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4427
4433
  }
4428
4434
  /**
4429
4435
  * Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
@@ -4435,12 +4441,12 @@ var ImageEditorController = (_class7 = class {
4435
4441
  const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
4436
4442
  const { width, height } = this.naturalSize;
4437
4443
  const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
4438
- const blend = _chunkQCEQIRJQcjs.parseBlend.call(void 0, options.blend);
4439
- if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be from 0 to 1.");
4444
+ const blend = _chunkPI45JMP7cjs.parseBlend.call(void 0, options.blend);
4445
+ if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("opacity must be from 0 to 1.");
4440
4446
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4441
4447
  const layer = {
4442
4448
  type: "pixel",
4443
- id: options.id && !ids.has(options.id) ? options.id : _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
4449
+ id: options.id && !ids.has(options.id) ? options.id : _chunkPI45JMP7cjs.newLayerId.call(void 0, ),
4444
4450
  name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
4445
4451
  visible: true,
4446
4452
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
@@ -4449,7 +4455,7 @@ var ImageEditorController = (_class7 = class {
4449
4455
  offset: { x: 0, y: 0 },
4450
4456
  generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
4451
4457
  };
4452
- const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4458
+ const next = _chunkPI45JMP7cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4453
4459
  this.commitLayers(next, () => {
4454
4460
  this.state.activeLayerId = layer.id;
4455
4461
  this.state.activeTarget = "pixels";
@@ -4464,8 +4470,8 @@ var ImageEditorController = (_class7 = class {
4464
4470
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
4465
4471
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
4466
4472
  const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
4467
- if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4468
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4473
+ if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4474
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4469
4475
  const g = layer.generator;
4470
4476
  const d = await this.describeEffect(g.effect);
4471
4477
  const base = { ...g.values };
@@ -4473,7 +4479,7 @@ var ImageEditorController = (_class7 = class {
4473
4479
  for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
4474
4480
  if (v !== null) given[k] = v;
4475
4481
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4476
- else throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4482
+ else throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4477
4483
  }
4478
4484
  const values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4479
4485
  const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
@@ -4488,7 +4494,7 @@ var ImageEditorController = (_class7 = class {
4488
4494
  /** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
4489
4495
  rasterizeEffectLayer(layerId) {
4490
4496
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
4491
- if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4497
+ if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4492
4498
  this.commitLayers(
4493
4499
  _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
4494
4500
  const { generator: _g, ...rest } = l;
@@ -4516,7 +4522,7 @@ var ImageEditorController = (_class7 = class {
4516
4522
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
4517
4523
  this.viewKey = key;
4518
4524
  const { width, height } = this.naturalSize;
4519
- const view = _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4525
+ const view = _chunkPI45JMP7cjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4520
4526
  s.adjustments = view.adjustments;
4521
4527
  s.depthMask = view.depthMask;
4522
4528
  s.annotations = view.annotations;
@@ -4670,7 +4676,7 @@ var ImageEditorController = (_class7 = class {
4670
4676
  applyCropPreset(ratio) {
4671
4677
  this.recordHistory();
4672
4678
  const { width, height } = this.state.imageDimensions;
4673
- if (ratio && _chunkQCEQIRJQcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4679
+ if (ratio && _chunkPI45JMP7cjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4674
4680
  ratio = 1 / ratio;
4675
4681
  }
4676
4682
  if (!ratio) {
@@ -4752,7 +4758,7 @@ var ImageEditorController = (_class7 = class {
4752
4758
  */
4753
4759
  getLayerPixels(id) {
4754
4760
  const layer = this.getLayer(id);
4755
- if (!layer || !_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return null;
4761
+ if (!layer || !_chunkPI45JMP7cjs.hasSurface.call(void 0, layer)) return null;
4756
4762
  const surface = this.surfaceOf(layer);
4757
4763
  const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, surface);
4758
4764
  if (!b) return null;
@@ -4765,7 +4771,7 @@ var ImageEditorController = (_class7 = class {
4765
4771
  */
4766
4772
  getLayerBounds(id) {
4767
4773
  const layer = this.getLayer(id);
4768
- if (!layer || !_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return null;
4774
+ if (!layer || !_chunkPI45JMP7cjs.hasSurface.call(void 0, layer)) return null;
4769
4775
  const surface = this.surfaceOf(layer);
4770
4776
  let b = this.boundsCache.get(surface);
4771
4777
  if (b === void 0) {
@@ -4780,9 +4786,9 @@ var ImageEditorController = (_class7 = class {
4780
4786
  */
4781
4787
  getLayerDataURL(id) {
4782
4788
  const layer = this.getLayer(id);
4783
- if (!layer || !_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return null;
4789
+ if (!layer || !_chunkPI45JMP7cjs.hasSurface.call(void 0, layer)) return null;
4784
4790
  const surface = this.surfaceOf(layer);
4785
- const enc = _chunkQCEQIRJQcjs.encodeSurface.call(void 0, surface);
4791
+ const enc = _chunkPI45JMP7cjs.encodeSurface.call(void 0, surface);
4786
4792
  return enc ? enc.url : null;
4787
4793
  }
4788
4794
  /**
@@ -4901,8 +4907,8 @@ var ImageEditorController = (_class7 = class {
4901
4907
  this.state.layers = next;
4902
4908
  _optionalChain([extra, 'optionalCall', _154 => _154()]);
4903
4909
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
4904
- if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, next, this.state.activeLayerId)) {
4905
- this.state.activeLayerId = null;
4910
+ if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
4911
+ this.state.activeLayerId = _chunkPI45JMP7cjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
4906
4912
  this.state.activeTarget = "pixels";
4907
4913
  }
4908
4914
  this.notify();
@@ -4924,19 +4930,19 @@ var ImageEditorController = (_class7 = class {
4924
4930
  if (init.pixels) {
4925
4931
  const px2 = init.pixels;
4926
4932
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
4927
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4933
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4928
4934
  }
4929
4935
  surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, px2, 4);
4930
4936
  } else if (init.color !== void 0) {
4931
4937
  const c = parseColor(init.color);
4932
4938
  surface = _chunkCWM3CUUXcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkCWM3CUUXcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
4933
4939
  }
4934
- const blend = _chunkQCEQIRJQcjs.parseBlend.call(void 0, init.blend);
4935
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be from 0 to 1.");
4940
+ const blend = _chunkPI45JMP7cjs.parseBlend.call(void 0, init.blend);
4941
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("opacity must be from 0 to 1.");
4936
4942
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4937
4943
  const layer = {
4938
4944
  type: "pixel",
4939
- id: init.id && !ids.has(init.id) ? init.id : _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
4945
+ id: init.id && !ids.has(init.id) ? init.id : _chunkPI45JMP7cjs.newLayerId.call(void 0, ),
4940
4946
  name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
4941
4947
  visible: _nullishCoalesce(init.visible, () => ( true)),
4942
4948
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -4945,7 +4951,7 @@ var ImageEditorController = (_class7 = class {
4945
4951
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
4946
4952
  };
4947
4953
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
4948
- const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4954
+ const next = _chunkPI45JMP7cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4949
4955
  this.commitLayers(next, () => {
4950
4956
  this.state.activeLayerId = layer.id;
4951
4957
  this.state.activeTarget = "pixels";
@@ -4985,12 +4991,12 @@ var ImageEditorController = (_class7 = class {
4985
4991
  try {
4986
4992
  img = await this.renderer.imageCache.get(src);
4987
4993
  } catch (e22) {
4988
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4994
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The image could not be decoded here. Pass a PNG (data URL or base64), or run in a browser for other formats and URLs.");
4989
4995
  }
4990
4996
  const w = img.naturalWidth || img.width;
4991
4997
  const h = img.naturalHeight || img.height;
4992
4998
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
4993
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4999
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4994
5000
  ctx.drawImage(img, 0, 0, w, h);
4995
5001
  const data = ctx.getImageData(0, 0, w, h);
4996
5002
  return { width: w, height: h, data: data.data };
@@ -5003,7 +5009,7 @@ var ImageEditorController = (_class7 = class {
5003
5009
  }
5004
5010
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
5005
5011
  duplicateLayer(id, name) {
5006
- const res = _chunkQCEQIRJQcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
5012
+ const res = _chunkPI45JMP7cjs.duplicateLayer.call(void 0, this.state.layers, id, name);
5007
5013
  this.commitLayers(res.layers, () => {
5008
5014
  this.state.activeLayerId = res.id;
5009
5015
  });
@@ -5011,16 +5017,16 @@ var ImageEditorController = (_class7 = class {
5011
5017
  }
5012
5018
  /** Deletes a layer (refused when locked), as one undo step. */
5013
5019
  removeLayer(id) {
5014
- const next = _chunkQCEQIRJQcjs.removeLayer.call(void 0, this.state.layers, id);
5020
+ const next = _chunkPI45JMP7cjs.removeLayer.call(void 0, this.state.layers, id);
5015
5021
  this.commitLayers(next, () => {
5016
- if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkQCEQIRJQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5022
+ if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkPI45JMP7cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5017
5023
  this.state.selectedAnnotationId = null;
5018
5024
  }
5019
5025
  });
5020
5026
  }
5021
5027
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
5022
5028
  moveLayer(id, placement) {
5023
- const next = _chunkQCEQIRJQcjs.moveLayer.call(void 0, this.state.layers, id, placement);
5029
+ const next = _chunkPI45JMP7cjs.moveLayer.call(void 0, this.state.layers, id, placement);
5024
5030
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
5025
5031
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
5026
5032
  this.commitLayers(next);
@@ -5031,23 +5037,23 @@ var ImageEditorController = (_class7 = class {
5031
5037
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
5032
5038
  */
5033
5039
  setLayerProperties(id, props, commitToHistory = true) {
5034
- const next = _chunkQCEQIRJQcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5040
+ const next = _chunkPI45JMP7cjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5035
5041
  this.commitLayers(next, void 0, commitToHistory);
5036
5042
  return _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer;
5037
5043
  }
5038
5044
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
5039
5045
  addGroup(init = {}) {
5040
- const blend = init.blend === void 0 ? "pass-through" : _chunkQCEQIRJQcjs.parseBlend.call(void 0, init.blend, true);
5046
+ const blend = init.blend === void 0 ? "pass-through" : _chunkPI45JMP7cjs.parseBlend.call(void 0, init.blend, true);
5041
5047
  const group = {
5042
5048
  type: "group",
5043
- id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, "group"),
5049
+ id: _chunkPI45JMP7cjs.newLayerId.call(void 0, "group"),
5044
5050
  name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
5045
5051
  visible: true,
5046
5052
  opacity: 1,
5047
5053
  blend,
5048
5054
  children: []
5049
5055
  };
5050
- const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5056
+ const next = _chunkPI45JMP7cjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5051
5057
  this.commitLayers(next, () => {
5052
5058
  this.state.activeLayerId = group.id;
5053
5059
  this.state.activeTarget = "pixels";
@@ -5056,7 +5062,7 @@ var ImageEditorController = (_class7 = class {
5056
5062
  }
5057
5063
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
5058
5064
  groupLayers(ids, name) {
5059
- const res = _chunkQCEQIRJQcjs.groupLayers.call(void 0, this.state.layers, ids, name);
5065
+ const res = _chunkPI45JMP7cjs.groupLayers.call(void 0, this.state.layers, ids, name);
5060
5066
  this.commitLayers(res.layers, () => {
5061
5067
  this.state.activeLayerId = res.id;
5062
5068
  });
@@ -5064,7 +5070,7 @@ var ImageEditorController = (_class7 = class {
5064
5070
  }
5065
5071
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
5066
5072
  ungroupLayer(id) {
5067
- const res = _chunkQCEQIRJQcjs.ungroupLayer.call(void 0, this.state.layers, id);
5073
+ const res = _chunkPI45JMP7cjs.ungroupLayer.call(void 0, this.state.layers, id);
5068
5074
  this.commitLayers(res.layers);
5069
5075
  return res.ids;
5070
5076
  }
@@ -5073,38 +5079,38 @@ var ImageEditorController = (_class7 = class {
5073
5079
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
5074
5080
  */
5075
5081
  offsetLayer(id, move, commitToHistory = true) {
5076
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5082
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5077
5083
  if (layer.type === "smart") {
5078
5084
  const tl = layer.placement.corners[0];
5079
5085
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
5080
5086
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
5081
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers.");
5082
- this.commitLayers(_chunkQCEQIRJQcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5087
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("x and y must be numbers.");
5088
+ this.commitLayers(_chunkPI45JMP7cjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5083
5089
  const moved = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id).layer;
5084
5090
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
5085
5091
  }
5086
5092
  if (layer.type === "shape") {
5087
- const g = _nullishCoalesce(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5093
+ const g = _nullishCoalesce(_chunkPI45JMP7cjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5088
5094
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
5089
5095
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
5090
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers.");
5091
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5092
- let moved = _chunkQCEQIRJQcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5096
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("x and y must be numbers.");
5097
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5098
+ let moved = _chunkPI45JMP7cjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5093
5099
  const mask = layer.mask;
5094
5100
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
5095
5101
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
5096
- const b = _nullishCoalesce(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5102
+ const b = _nullishCoalesce(_chunkPI45JMP7cjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5097
5103
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
5098
5104
  }
5099
5105
  if (layer.type === "type") {
5100
5106
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
5101
5107
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
5102
5108
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
5103
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers.");
5104
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5109
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("x and y must be numbers.");
5110
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5105
5111
  const mx = Math.round(dx);
5106
5112
  const my = Math.round(dy);
5107
- let moved = { ..._chunkQCEQIRJQcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
5113
+ let moved = { ..._chunkPI45JMP7cjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
5108
5114
  const mask = layer.mask;
5109
5115
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
5110
5116
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -5114,7 +5120,7 @@ var ImageEditorController = (_class7 = class {
5114
5120
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5115
5121
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
5116
5122
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
5117
- const next = _chunkQCEQIRJQcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5123
+ const next = _chunkPI45JMP7cjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5118
5124
  this.commitLayers(next, void 0, commitToHistory);
5119
5125
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
5120
5126
  }
@@ -5124,11 +5130,11 @@ var ImageEditorController = (_class7 = class {
5124
5130
  * target when the layer is active.
5125
5131
  */
5126
5132
  addLayerMask(id, from = "reveal-all", props = {}) {
5127
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5133
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5128
5134
  let mask;
5129
5135
  if (from === "selection") {
5130
5136
  const sel = this.state.selection;
5131
- if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5137
+ if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5132
5138
  mask = this.maskFromSelection(sel, props);
5133
5139
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
5134
5140
  mask = { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -5137,7 +5143,7 @@ var ImageEditorController = (_class7 = class {
5137
5143
  const v = from === "reveal-all" ? 255 : 0;
5138
5144
  mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5139
5145
  }
5140
- const next = _chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5146
+ const next = _chunkPI45JMP7cjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5141
5147
  this.commitLayers(next, () => {
5142
5148
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
5143
5149
  });
@@ -5145,18 +5151,18 @@ var ImageEditorController = (_class7 = class {
5145
5151
  }
5146
5152
  /** Removes a layer's mask (one undo step). */
5147
5153
  removeLayerMask(id) {
5148
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5149
- if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5150
- this.commitLayers(_chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5154
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5155
+ if (!layer.mask) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5156
+ this.commitLayers(_chunkPI45JMP7cjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5151
5157
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
5152
5158
  });
5153
5159
  }
5154
5160
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
5155
5161
  setLayerMaskProps(id, props, commitToHistory = true) {
5156
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5157
- if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5162
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5163
+ if (!layer.mask) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5158
5164
  const mask = withMaskProps(layer.mask, props);
5159
- this.commitLayers(_chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5165
+ this.commitLayers(_chunkPI45JMP7cjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5160
5166
  return mask;
5161
5167
  }
5162
5168
  /**
@@ -5164,11 +5170,11 @@ var ImageEditorController = (_class7 = class {
5164
5170
  * the depth map) and removes the mask, as one undo step.
5165
5171
  */
5166
5172
  async applyLayerMask(id) {
5167
- const loc = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id);
5173
+ const loc = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id);
5168
5174
  const layer = loc.layer;
5169
- if (layer.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5170
- if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5171
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5175
+ if (layer.type !== "pixel") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5176
+ if (!layer.mask) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5177
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5172
5178
  const { width, height } = this.naturalSize;
5173
5179
  await this.renderer.prepareLayerAssets([layer], width, height);
5174
5180
  const sources = this.renderer.compositorSources(width, height);
@@ -5201,13 +5207,13 @@ var ImageEditorController = (_class7 = class {
5201
5207
  */
5202
5208
  layerViaCopy(options = {}) {
5203
5209
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
5204
- if (!id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5205
- const loc = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id);
5210
+ if (!id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5211
+ const loc = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id);
5206
5212
  const layer = loc.layer;
5207
- if (layer.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5213
+ if (layer.type !== "pixel") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5208
5214
  const sel = this.state.selection;
5209
- if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5210
- if (options.cut) _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5215
+ if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5216
+ if (options.cut) _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5211
5217
  const surface = this.surfaceOf(layer);
5212
5218
  const sb = sel.bounds;
5213
5219
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -5223,7 +5229,7 @@ var ImageEditorController = (_class7 = class {
5223
5229
  }
5224
5230
  const copy = {
5225
5231
  type: "pixel",
5226
- id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
5232
+ id: _chunkPI45JMP7cjs.newLayerId.call(void 0, ),
5227
5233
  name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
5228
5234
  visible: true,
5229
5235
  opacity: 1,
@@ -5296,7 +5302,7 @@ var ImageEditorController = (_class7 = class {
5296
5302
  * Refused while another transform is open.
5297
5303
  */
5298
5304
  beginFreeTransform(init = {}) {
5299
- if (this.getFreeTransform()) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5305
+ if (this.getFreeTransform()) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5300
5306
  const session = new FreeTransformSession(this.transformHost(), init);
5301
5307
  this.openTransform = session;
5302
5308
  this.notify();
@@ -5310,26 +5316,26 @@ var ImageEditorController = (_class7 = class {
5310
5316
  */
5311
5317
  transformLayer(spec) {
5312
5318
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
5313
- if (given > 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give only one of matrix, corners and params.");
5314
- if (!given && spec.warp === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5319
+ if (given > 1) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give only one of matrix, corners and params.");
5320
+ if (!given && spec.warp === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5315
5321
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
5316
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5322
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5317
5323
  }
5318
5324
  if (spec.matrix) {
5319
5325
  const [a, b, c, d] = spec.matrix;
5320
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5326
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5321
5327
  }
5322
5328
  const session = this.beginFreeTransform(spec);
5323
5329
  try {
5324
5330
  const g = session.startGeometry;
5325
- const corners = spec.matrix ? g.corners.map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkQCEQIRJQcjs.applyParams.call(void 0, g, spec.params) : g.corners;
5331
+ const corners = spec.matrix ? g.corners.map((p) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkPI45JMP7cjs.applyParams.call(void 0, g, spec.params) : g.corners;
5326
5332
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
5327
5333
  if (spec.warp) {
5328
5334
  if ("style" in spec.warp) {
5329
- if (!_chunkRHXW4TA5cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
5330
- warp = _chunkQCEQIRJQcjs.presetWarp.call(void 0, session.box, spec.warp);
5335
+ if (!_chunkRHXW4TA5cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
5336
+ warp = _chunkPI45JMP7cjs.presetWarp.call(void 0, session.box, spec.warp);
5331
5337
  } else {
5332
- if (!_chunkQCEQIRJQcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5338
+ if (!_chunkPI45JMP7cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5333
5339
  warp = spec.warp;
5334
5340
  }
5335
5341
  }
@@ -5342,10 +5348,10 @@ var ImageEditorController = (_class7 = class {
5342
5348
  }
5343
5349
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
5344
5350
  flipLayer(axis, init = {}) {
5345
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5351
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5346
5352
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5347
5353
  try {
5348
- session.update({ corners: _chunkQCEQIRJQcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5354
+ session.update({ corners: _chunkPI45JMP7cjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5349
5355
  return session.commit();
5350
5356
  } catch (e) {
5351
5357
  session.cancel();
@@ -5357,10 +5363,10 @@ var ImageEditorController = (_class7 = class {
5357
5363
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
5358
5364
  */
5359
5365
  rotateLayer90(turn, init = {}) {
5360
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5366
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5361
5367
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5362
5368
  try {
5363
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkQCEQIRJQcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5369
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkPI45JMP7cjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5364
5370
  const cx = b.x + b.width / 2;
5365
5371
  const cy = b.y + b.height / 2;
5366
5372
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
@@ -5375,20 +5381,20 @@ var ImageEditorController = (_class7 = class {
5375
5381
  }
5376
5382
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
5377
5383
  addLayerFilter(id, filter) {
5378
- const f = _chunkQCEQIRJQcjs.normalizeFilter.call(void 0, filter);
5379
- const next = _chunkQCEQIRJQcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5384
+ const f = _chunkPI45JMP7cjs.normalizeFilter.call(void 0, filter);
5385
+ const next = _chunkPI45JMP7cjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5380
5386
  this.commitLayers(next);
5381
5387
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5382
5388
  }
5383
5389
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
5384
5390
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
5385
- const next = _chunkQCEQIRJQcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5391
+ const next = _chunkPI45JMP7cjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5386
5392
  this.commitLayers(next, void 0, commitToHistory);
5387
5393
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5388
5394
  }
5389
5395
  /** Removes one filter (one undo step). Returns the remaining filters. */
5390
5396
  removeLayerFilter(id, filterId) {
5391
- const next = _chunkQCEQIRJQcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5397
+ const next = _chunkPI45JMP7cjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5392
5398
  this.commitLayers(next);
5393
5399
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5394
5400
  }
@@ -5404,8 +5410,8 @@ var ImageEditorController = (_class7 = class {
5404
5410
  */
5405
5411
  convertToSmartObject(ids, options = {}) {
5406
5412
  const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
5407
- if (!list.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5408
- const res = _chunkQCEQIRJQcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5413
+ if (!list.length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5414
+ const res = _chunkPI45JMP7cjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5409
5415
  this.commitLayers(res.layers, () => {
5410
5416
  this.state.activeLayerId = res.layer.id;
5411
5417
  this.state.activeTarget = "pixels";
@@ -5414,7 +5420,7 @@ var ImageEditorController = (_class7 = class {
5414
5420
  }
5415
5421
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
5416
5422
  rasterizeSmartObject(id) {
5417
- const res = _chunkQCEQIRJQcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5423
+ const res = _chunkPI45JMP7cjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5418
5424
  this.commitLayers(res.layers, () => {
5419
5425
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
5420
5426
  });
@@ -5422,10 +5428,10 @@ var ImageEditorController = (_class7 = class {
5422
5428
  }
5423
5429
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
5424
5430
  getSmartObject(id) {
5425
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
5431
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, id);
5426
5432
  const c = layer.contents;
5427
- const g = _chunkQCEQIRJQcjs.placementGeometry.call(void 0, layer);
5428
- const readout = _chunkQCEQIRJQcjs.describeTransform.call(void 0, g);
5433
+ const g = _chunkPI45JMP7cjs.placementGeometry.call(void 0, layer);
5434
+ const readout = _chunkPI45JMP7cjs.describeTransform.call(void 0, g);
5429
5435
  const stack = layer.smartFilters;
5430
5436
  return {
5431
5437
  layerId: layer.id,
@@ -5435,10 +5441,10 @@ var ImageEditorController = (_class7 = class {
5435
5441
  kind: c.kind,
5436
5442
  width: c.width,
5437
5443
  height: c.height,
5438
- decoded: _chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, c),
5444
+ decoded: _chunkPI45JMP7cjs.isContentsDecoded.call(void 0, c),
5439
5445
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
5440
5446
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
5441
- instances: _chunkQCEQIRJQcjs.instancesOf.call(void 0, this.state.layers, c.id),
5447
+ instances: _chunkPI45JMP7cjs.instancesOf.call(void 0, this.state.layers, c.id),
5442
5448
  layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
5443
5449
  },
5444
5450
  placement: {
@@ -5450,8 +5456,8 @@ var ImageEditorController = (_class7 = class {
5450
5456
  scaleY: readout.scaleY,
5451
5457
  rotate: readout.rotate,
5452
5458
  skewX: readout.skewX,
5453
- center: _chunkQCEQIRJQcjs.anchorPoint.call(void 0, g, "center"),
5454
- bounds: _chunkQCEQIRJQcjs.transformedBox.call(void 0, g)
5459
+ center: _chunkPI45JMP7cjs.anchorPoint.call(void 0, g, "center"),
5460
+ bounds: _chunkPI45JMP7cjs.transformedBox.call(void 0, g)
5455
5461
  },
5456
5462
  smartFilters: {
5457
5463
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
@@ -5468,7 +5474,7 @@ var ImageEditorController = (_class7 = class {
5468
5474
  * change. Returns the new placement summary.
5469
5475
  */
5470
5476
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
5471
- const res = _chunkQCEQIRJQcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5477
+ const res = _chunkPI45JMP7cjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5472
5478
  this.commitLayers(res.layers, void 0, commitToHistory);
5473
5479
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
5474
5480
  }
@@ -5481,23 +5487,23 @@ var ImageEditorController = (_class7 = class {
5481
5487
  * nothing is relative to the current transform.
5482
5488
  */
5483
5489
  setSmartObjectTransform(id, spec) {
5484
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
5485
- const g = _chunkQCEQIRJQcjs.placementGeometry.call(void 0, layer);
5490
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, id);
5491
+ const g = _chunkPI45JMP7cjs.placementGeometry.call(void 0, layer);
5486
5492
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
5487
5493
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
5488
- if (ways > 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5494
+ if (ways > 1) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5489
5495
  let corners = g.corners;
5490
5496
  if (spec.corners) corners = spec.corners;
5491
5497
  else if (spec.matrix) {
5492
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5498
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5493
5499
  const [a, b, c, d] = spec.matrix;
5494
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5495
- corners = _chunkQCEQIRJQcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5500
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5501
+ corners = _chunkPI45JMP7cjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5496
5502
  } else if (numeric.length) {
5497
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5498
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${k} must be a finite number.`);
5499
- const now = _chunkQCEQIRJQcjs.describeTransform.call(void 0, g);
5500
- const centre = _chunkQCEQIRJQcjs.anchorPoint.call(void 0, g, "center");
5503
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5504
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`${k} must be a finite number.`);
5505
+ const now = _chunkPI45JMP7cjs.describeTransform.call(void 0, g);
5506
+ const centre = _chunkPI45JMP7cjs.anchorPoint.call(void 0, g, "center");
5501
5507
  const params = {
5502
5508
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
5503
5509
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -5505,20 +5511,20 @@ var ImageEditorController = (_class7 = class {
5505
5511
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
5506
5512
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
5507
5513
  };
5508
- const m = _chunkQCEQIRJQcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5514
+ const m = _chunkPI45JMP7cjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5509
5515
  const cx = g.box.width / 2;
5510
5516
  const cy = g.box.height / 2;
5511
5517
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
5512
- corners = _chunkQCEQIRJQcjs.cornersFromMatrix.call(void 0, g.box, _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, m, _chunkRHXW4TA5cjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5518
+ corners = _chunkPI45JMP7cjs.cornersFromMatrix.call(void 0, g.box, _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, m, _chunkRHXW4TA5cjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5513
5519
  }
5514
5520
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
5515
5521
  if (spec.warp === null) warp = null;
5516
5522
  else if (spec.warp) {
5517
5523
  if ("style" in spec.warp) {
5518
- if (!_chunkRHXW4TA5cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
5519
- warp = _chunkQCEQIRJQcjs.presetWarp.call(void 0, g.box, spec.warp);
5524
+ if (!_chunkRHXW4TA5cjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
5525
+ warp = _chunkPI45JMP7cjs.presetWarp.call(void 0, g.box, spec.warp);
5520
5526
  } else {
5521
- if (!_chunkQCEQIRJQcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
5527
+ if (!_chunkPI45JMP7cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
5522
5528
  warp = spec.warp;
5523
5529
  }
5524
5530
  }
@@ -5532,16 +5538,16 @@ var ImageEditorController = (_class7 = class {
5532
5538
  * the layers that changed.
5533
5539
  */
5534
5540
  replaceSmartObjectContents(id, source) {
5535
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
5541
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, id);
5536
5542
  let contents;
5537
5543
  if ("contents" in source) contents = source.contents;
5538
- else if ("pixels" in source) contents = _chunkQCEQIRJQcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5544
+ else if ("pixels" in source) contents = _chunkPI45JMP7cjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5539
5545
  else {
5540
- const psd = _chunkQCEQIRJQcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkQCEQIRJQcjs.newLayerId.call(void 0, ) });
5541
- contents = _chunkQCEQIRJQcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5546
+ const psd = _chunkPI45JMP7cjs.importPsd.call(void 0, source.psd, { newId: () => _chunkPI45JMP7cjs.newLayerId.call(void 0, ) });
5547
+ contents = _chunkPI45JMP7cjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
5542
5548
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
5543
5549
  }
5544
- const res = _chunkQCEQIRJQcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5550
+ const res = _chunkPI45JMP7cjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5545
5551
  this.commitLayers(res.layers);
5546
5552
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
5547
5553
  }
@@ -5556,16 +5562,16 @@ var ImageEditorController = (_class7 = class {
5556
5562
  * and bytes.
5557
5563
  */
5558
5564
  exportSmartObjectContents(id) {
5559
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
5565
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, id);
5560
5566
  const c = layer.contents;
5561
5567
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
5562
5568
  if (c.file) {
5563
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkQCEQIRJQcjs.BROWSER_IMAGE_TYPES };
5569
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkPI45JMP7cjs.BROWSER_IMAGE_TYPES };
5564
5570
  const ext = c.file.type.toLowerCase();
5565
5571
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
5566
5572
  }
5567
- if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5568
- const f = _chunkQCEQIRJQcjs.smartContentsFile.call(void 0, c);
5573
+ if (!_chunkPI45JMP7cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5574
+ const f = _chunkPI45JMP7cjs.smartContentsFile.call(void 0, c);
5569
5575
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
5570
5576
  }
5571
5577
  /**
@@ -5574,7 +5580,7 @@ var ImageEditorController = (_class7 = class {
5574
5580
  * undo step. Returns the copy's id.
5575
5581
  */
5576
5582
  copySmartObject(id, linked = false, name) {
5577
- const res = _chunkQCEQIRJQcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5583
+ const res = _chunkPI45JMP7cjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5578
5584
  this.commitLayers(res.layers, () => {
5579
5585
  this.state.activeLayerId = res.layer.id;
5580
5586
  this.state.activeTarget = "pixels";
@@ -5583,31 +5589,31 @@ var ImageEditorController = (_class7 = class {
5583
5589
  }
5584
5590
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
5585
5591
  addSmartFilter(id, filter, index) {
5586
- const res = _chunkQCEQIRJQcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkQCEQIRJQcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5592
+ const res = _chunkPI45JMP7cjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkPI45JMP7cjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5587
5593
  this.commitLayers(res.layers);
5588
5594
  return res.filter;
5589
5595
  }
5590
5596
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
5591
5597
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
5592
- const res = _chunkQCEQIRJQcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5598
+ const res = _chunkPI45JMP7cjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5593
5599
  this.commitLayers(res.layers, void 0, commitToHistory);
5594
5600
  return res.filter;
5595
5601
  }
5596
5602
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
5597
5603
  removeSmartFilter(id, filterId) {
5598
- const res = _chunkQCEQIRJQcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5604
+ const res = _chunkPI45JMP7cjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5599
5605
  this.commitLayers(res.layers);
5600
5606
  return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
5601
5607
  }
5602
5608
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
5603
5609
  moveSmartFilter(id, filterId, index) {
5604
- const res = _chunkQCEQIRJQcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5610
+ const res = _chunkPI45JMP7cjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5605
5611
  this.commitLayers(res.layers);
5606
5612
  return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
5607
5613
  }
5608
5614
  /** Turns a smart object's whole filter stack on or off (one undo step). */
5609
5615
  setSmartFiltersEnabled(id, enabled) {
5610
- const res = _chunkQCEQIRJQcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5616
+ const res = _chunkPI45JMP7cjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5611
5617
  this.commitLayers(res.layers);
5612
5618
  return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
5613
5619
  }
@@ -5617,21 +5623,21 @@ var ImageEditorController = (_class7 = class {
5617
5623
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
5618
5624
  */
5619
5625
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
5620
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
5626
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, id);
5621
5627
  let mask;
5622
5628
  if (from === "none") mask = null;
5623
5629
  else if (from === "keep") {
5624
- if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5630
+ if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5625
5631
  mask = withMaskProps(layer.smartFilters.mask, props);
5626
5632
  } else if (from === "selection") {
5627
5633
  const sel = this.state.selection;
5628
- if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5634
+ if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5629
5635
  mask = this.maskFromSelection(sel, props);
5630
5636
  } else {
5631
5637
  const v = from === "reveal-all" ? 255 : 0;
5632
5638
  mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5633
5639
  }
5634
- const res = _chunkQCEQIRJQcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5640
+ const res = _chunkPI45JMP7cjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5635
5641
  this.commitLayers(res.layers, () => {
5636
5642
  if (this.state.activeLayerId !== id) return;
5637
5643
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -5647,14 +5653,14 @@ var ImageEditorController = (_class7 = class {
5647
5653
  async prepareSmartObjects() {
5648
5654
  const pending = /* @__PURE__ */ new Map();
5649
5655
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
5650
- if (l.type === "smart" && !_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkQCEQIRJQcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5656
+ if (l.type === "smart" && !_chunkPI45JMP7cjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkPI45JMP7cjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5651
5657
  }
5652
5658
  const left = [];
5653
5659
  for (const [cid, c] of pending) {
5654
5660
  try {
5655
- const url = `data:${_chunkQCEQIRJQcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5661
+ const url = `data:${_chunkPI45JMP7cjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5656
5662
  const px2 = await this.decodeImage(url);
5657
- const decoded = { ...c, kind: "raster", raster: _chunkQCEQIRJQcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5663
+ const decoded = { ...c, kind: "raster", raster: _chunkPI45JMP7cjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5658
5664
  const swap = (layers) => {
5659
5665
  let out = layers;
5660
5666
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -5682,10 +5688,10 @@ var ImageEditorController = (_class7 = class {
5682
5688
  * Contents can nest. Returns the contents' size and layer ids.
5683
5689
  */
5684
5690
  editSmartObjectContents(id) {
5685
- if (this.getFreeTransform()) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5686
- const layer = _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, this.state.layers, id);
5691
+ if (this.getFreeTransform()) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5692
+ const layer = _chunkPI45JMP7cjs.requireSmartObject.call(void 0, this.state.layers, id);
5687
5693
  const c = layer.contents;
5688
- if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5694
+ if (!_chunkPI45JMP7cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5689
5695
  const saved = {
5690
5696
  state: { ...this.state },
5691
5697
  undo: this.undoStack,
@@ -5696,7 +5702,7 @@ var ImageEditorController = (_class7 = class {
5696
5702
  samplePixelsOverride: this.samplePixelsOverride,
5697
5703
  psdResolution: this.psdResolution
5698
5704
  };
5699
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5705
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkPI45JMP7cjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5700
5706
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
5701
5707
  const s = this.state;
5702
5708
  this.state = {
@@ -5704,7 +5710,7 @@ var ImageEditorController = (_class7 = class {
5704
5710
  sourceUrl: null,
5705
5711
  imageDimensions: { width: c.width, height: c.height },
5706
5712
  crop: null,
5707
- transform: { ..._chunkQCEQIRJQcjs.DEFAULT_TRANSFORM_VALUES },
5713
+ transform: { ..._chunkPI45JMP7cjs.DEFAULT_TRANSFORM_VALUES },
5708
5714
  layers,
5709
5715
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
5710
5716
  activeTarget: "pixels",
@@ -5737,7 +5743,7 @@ var ImageEditorController = (_class7 = class {
5737
5743
  */
5738
5744
  closeSmartObjectContents(save = true) {
5739
5745
  const top = this.contentsStack.pop();
5740
- if (!top) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5746
+ if (!top) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5741
5747
  if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
5742
5748
  this.openTransform = null;
5743
5749
  const edited = this.state;
@@ -5751,10 +5757,10 @@ var ImageEditorController = (_class7 = class {
5751
5757
  const plain3 = _optionalChain([only, 'optionalAccess', _211 => _211.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _212 => _212.filters, 'optionalAccess', _213 => _213.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
5752
5758
  if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
5753
5759
  const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
5754
- next = _chunkQCEQIRJQcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5760
+ next = _chunkPI45JMP7cjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5755
5761
  } else {
5756
5762
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
5757
- next = _chunkQCEQIRJQcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5763
+ next = _chunkPI45JMP7cjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5758
5764
  }
5759
5765
  }
5760
5766
  const saved = top.saved;
@@ -5773,7 +5779,7 @@ var ImageEditorController = (_class7 = class {
5773
5779
  this.notify();
5774
5780
  return { layerId: top.layerId, changed: false, layerIds: [] };
5775
5781
  }
5776
- const res = _chunkQCEQIRJQcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5782
+ const res = _chunkPI45JMP7cjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5777
5783
  this.commitLayers(res.layers);
5778
5784
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
5779
5785
  }
@@ -5788,35 +5794,35 @@ var ImageEditorController = (_class7 = class {
5788
5794
  // --- Layer effects ---
5789
5795
  /** A layer's effects (an empty, enabled list when it has none). */
5790
5796
  getLayerEffects(id) {
5791
- return _chunkQCEQIRJQcjs.layerEffectsOf.call(void 0, _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5797
+ return _chunkPI45JMP7cjs.layerEffectsOf.call(void 0, _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer);
5792
5798
  }
5793
5799
  /**
5794
5800
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
5795
5801
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
5796
5802
  */
5797
5803
  addLayerEffect(id, kind, params = {}, index) {
5798
- const res = _chunkQCEQIRJQcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5804
+ const res = _chunkPI45JMP7cjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5799
5805
  this.commitLayers(res.layers);
5800
5806
  return { effect: res.effect, effects: this.getLayerEffects(id) };
5801
5807
  }
5802
5808
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
5803
5809
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
5804
- this.commitLayers(_chunkQCEQIRJQcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5810
+ this.commitLayers(_chunkPI45JMP7cjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5805
5811
  return this.getLayerEffects(id);
5806
5812
  }
5807
5813
  /** Removes one effect (one undo step). Returns the remaining effects. */
5808
5814
  removeLayerEffect(id, effectId) {
5809
- this.commitLayers(_chunkQCEQIRJQcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5815
+ this.commitLayers(_chunkPI45JMP7cjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5810
5816
  return this.getLayerEffects(id);
5811
5817
  }
5812
5818
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
5813
5819
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
5814
- this.commitLayers(_chunkQCEQIRJQcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5820
+ this.commitLayers(_chunkPI45JMP7cjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5815
5821
  return this.getLayerEffects(id);
5816
5822
  }
5817
5823
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
5818
5824
  setLayerEffects(id, effects, commitToHistory = true) {
5819
- this.commitLayers(_chunkQCEQIRJQcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5825
+ this.commitLayers(_chunkPI45JMP7cjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5820
5826
  return this.getLayerEffects(id);
5821
5827
  }
5822
5828
  __init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -5842,8 +5848,8 @@ var ImageEditorController = (_class7 = class {
5842
5848
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
5843
5849
  setGlobalLight(light, commitToHistory = true) {
5844
5850
  const next = { ...this.getGlobalLight(), ...light };
5845
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5846
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5851
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5852
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5847
5853
  if (commitToHistory) this.recordHistory();
5848
5854
  if (next.angle === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5849
5855
  else this.state.globalLight = next;
@@ -5854,16 +5860,16 @@ var ImageEditorController = (_class7 = class {
5854
5860
  async compositeToSurface(layers, rect) {
5855
5861
  const { width, height } = this.naturalSize;
5856
5862
  if (_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5857
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5863
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5858
5864
  }
5859
5865
  await this.renderer.prepareLayerAssets(layers, width, height);
5860
5866
  const sources = this.renderer.compositorSources(width, height);
5861
5867
  const depth = this.bitDepth;
5862
5868
  if (depth !== 8) {
5863
- const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkQCEQIRJQcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5869
+ const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkPI45JMP7cjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5864
5870
  return _chunkCWM3CUUXcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
5865
5871
  }
5866
- const data = new (0, _chunkQCEQIRJQcjs.LayerCompositor)().composite(layers, rect, sources);
5872
+ const data = new (0, _chunkPI45JMP7cjs.LayerCompositor)().composite(layers, rect, sources);
5867
5873
  return _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
5868
5874
  }
5869
5875
  /**
@@ -5876,22 +5882,22 @@ var ImageEditorController = (_class7 = class {
5876
5882
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
5877
5883
  const depth = this.bitDepth;
5878
5884
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkCWM3CUUXcjs.to16From8.call(void 0, this.compositePixels(r).data) };
5879
- const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkQCEQIRJQcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5885
+ const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkPI45JMP7cjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5880
5886
  return { width: r.width, height: r.height, depth, data };
5881
5887
  }
5882
5888
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
5883
5889
  paintBounds(layer) {
5884
5890
  const { width, height } = this.naturalSize;
5885
5891
  const canvas = { x: 0, y: 0, width, height };
5886
- if (_chunkQCEQIRJQcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5892
+ if (_chunkPI45JMP7cjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5887
5893
  if (layer.type === "annotation") {
5888
- const b = _chunkQCEQIRJQcjs.getAnnotationBounds.call(void 0, layer.annotation);
5894
+ const b = _chunkPI45JMP7cjs.getAnnotationBounds.call(void 0, layer.annotation);
5889
5895
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
5890
5896
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
5891
5897
  }
5892
5898
  if (layer.type === "group") {
5893
5899
  let r = null;
5894
- for (const c of layer.children) r = _chunkQCEQIRJQcjs.unionRect.call(void 0, r, this.paintBounds(c));
5900
+ for (const c of layer.children) r = _chunkPI45JMP7cjs.unionRect.call(void 0, r, this.paintBounds(c));
5895
5901
  return _nullishCoalesce(r, () => ( canvas));
5896
5902
  }
5897
5903
  return canvas;
@@ -5902,16 +5908,16 @@ var ImageEditorController = (_class7 = class {
5902
5908
  * Returns the merged id.
5903
5909
  */
5904
5910
  async mergeDown(id) {
5905
- const loc = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id);
5911
+ const loc = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id);
5906
5912
  const upper = loc.layer;
5907
5913
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
5908
5914
  const lower = siblings[loc.index - 1];
5909
- if (!lower) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5910
- if (lower.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5911
- if (!upper.visible) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5912
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5913
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5914
- let rect = _nullishCoalesce(_chunkQCEQIRJQcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5915
+ if (!lower) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5916
+ if (lower.type !== "pixel") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5917
+ if (!upper.visible) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5918
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5919
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5920
+ let rect = _nullishCoalesce(_chunkPI45JMP7cjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5915
5921
  const reach = Math.max(_chunkHGTDMKNEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkHGTDMKNEcjs.effectsMargin.call(void 0, upper.effects));
5916
5922
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
5917
5923
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -5937,12 +5943,12 @@ var ImageEditorController = (_class7 = class {
5937
5943
  */
5938
5944
  async mergeVisible() {
5939
5945
  const visible = this.state.layers.filter((l) => l.visible);
5940
- if (!visible.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("No layer is visible.");
5946
+ if (!visible.length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("No layer is visible.");
5941
5947
  const { width, height } = this.naturalSize;
5942
5948
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
5943
5949
  const merged = {
5944
5950
  type: "pixel",
5945
- id: _chunkQCEQIRJQcjs.newLayerId.call(void 0, ),
5951
+ id: _chunkPI45JMP7cjs.newLayerId.call(void 0, ),
5946
5952
  name: "Merged",
5947
5953
  visible: true,
5948
5954
  opacity: 1,
@@ -5966,8 +5972,8 @@ var ImageEditorController = (_class7 = class {
5966
5972
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
5967
5973
  const bg = {
5968
5974
  type: "pixel",
5969
- id: _chunkQCEQIRJQcjs.BACKGROUND_LAYER_ID,
5970
- name: _chunkQCEQIRJQcjs.BACKGROUND_LAYER_NAME,
5975
+ id: _chunkPI45JMP7cjs.BACKGROUND_LAYER_ID,
5976
+ name: _chunkPI45JMP7cjs.BACKGROUND_LAYER_NAME,
5971
5977
  visible: true,
5972
5978
  opacity: 1,
5973
5979
  blend: "normal",
@@ -5994,7 +6000,7 @@ var ImageEditorController = (_class7 = class {
5994
6000
  const k = Math.min(1, side / Math.max(width, height));
5995
6001
  const tw = Math.max(1, Math.round(width * k));
5996
6002
  const th = Math.max(1, Math.round(height * k));
5997
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkQCEQIRJQcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
6003
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkPI45JMP7cjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5998
6004
  if (!surface) return null;
5999
6005
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6000
6006
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -6090,7 +6096,7 @@ var ImageEditorController = (_class7 = class {
6090
6096
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
6091
6097
  */
6092
6098
  setCloneSource(point) {
6093
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6099
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6094
6100
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
6095
6101
  this.state.paint = { ...this.state.paint, cloneSource: source };
6096
6102
  this.notify();
@@ -6106,9 +6112,9 @@ var ImageEditorController = (_class7 = class {
6106
6112
  const next = t ? { ...cur, ...t } : { ..._chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM };
6107
6113
  for (const k of ["scaleX", "scaleY"]) {
6108
6114
  const v = next[k];
6109
- if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6115
+ if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6110
6116
  }
6111
- if (!Number.isFinite(next.rotate)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("rotate must be a number of degrees.");
6117
+ if (!Number.isFinite(next.rotate)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("rotate must be a number of degrees.");
6112
6118
  next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
6113
6119
  this.state.paint = { ...this.state.paint, cloneTransform: next };
6114
6120
  this.notify();
@@ -6126,27 +6132,28 @@ var ImageEditorController = (_class7 = class {
6126
6132
  /** Resolves and validates what a stroke, fill or clear paints into. */
6127
6133
  paintTarget(layerId, channel, action) {
6128
6134
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
6129
- if (!id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6130
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6135
+ if (!id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`, `Pick a layer to ${action} on in the Layers panel.`);
6136
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer;
6137
+ const name = layer.name || id;
6131
6138
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
6132
6139
  if (ch === "mask") {
6133
- if (!layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6134
- if (layer.mask.source) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6135
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", action);
6140
+ if (!layer.mask) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`, `Layer "${name}" has no mask; add a mask or ${action} on its pixels.`);
6141
+ if (layer.mask.source) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
6142
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "all", action);
6136
6143
  } else if (ch === "filter-mask") {
6137
6144
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
6138
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6145
+ throw new (0, _chunkPI45JMP7cjs.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}.`);
6139
6146
  }
6140
- if (!_chunkQCEQIRJQcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6141
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", action);
6147
+ if (!_chunkPI45JMP7cjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkPI45JMP7cjs.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.`);
6148
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "all", action);
6142
6149
  } else {
6143
- if (layer.type === "smart") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6144
- if (layer.type === "shape") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6145
- if (layer.type === "type") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6146
- if (layer.type !== "pixel") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6147
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", action);
6150
+ if (layer.type === "smart") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`, `"${name}" is a smart object; rasterize it or edit its contents to ${action} on it.`);
6151
+ if (layer.type === "shape") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a shape layer; rasterize it to ${action} on it.`);
6152
+ if (layer.type === "type") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a type layer; rasterize it to ${action} on it.`);
6153
+ if (layer.type !== "pixel") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`, `"${name}" is not a pixel layer; pick a pixel layer to ${action} on.`);
6154
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "pixels", action);
6148
6155
  }
6149
- if (!layer.visible) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6156
+ if (!layer.visible) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
6150
6157
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
6151
6158
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
6152
6159
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
@@ -6155,7 +6162,7 @@ var ImageEditorController = (_class7 = class {
6155
6162
  /** The layer with its pixels (or mask) replaced by `surface`. */
6156
6163
  withSurface(layer, channel, surface) {
6157
6164
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
6158
- if (channel === "filter-mask") return _chunkQCEQIRJQcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6165
+ if (channel === "filter-mask") return _chunkPI45JMP7cjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6159
6166
  const next = { ...layer, surface };
6160
6167
  delete next.source;
6161
6168
  return next;
@@ -6168,10 +6175,10 @@ var ImageEditorController = (_class7 = class {
6168
6175
  */
6169
6176
  beginStroke(init = {}) {
6170
6177
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
6171
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6178
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6172
6179
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
6173
6180
  if (tool === "mixer" && target.channel !== "pixels") {
6174
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6181
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.", "The Mixer Brush paints on pixels, not masks; target the layer's pixels, or paint the mask with the Brush.");
6175
6182
  }
6176
6183
  const brush = _chunkLRRCMRSLcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
6177
6184
  let strokePaint = null;
@@ -6205,7 +6212,7 @@ var ImageEditorController = (_class7 = class {
6205
6212
  retouchStroke(tool, init, brush, target, apply) {
6206
6213
  const settings = _chunk6FUAHCVIcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6207
6214
  const mask = target.channel !== "pixels";
6208
- if (tool === "sponge" && mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6215
+ if (tool === "sponge" && mask) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6209
6216
  if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunk6FUAHCVIcjs.RetouchDabStroke)(brush, pixels, _chunk6FUAHCVIcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6210
6217
  if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunk6FUAHCVIcjs.RetouchDabStroke)(brush, pixels, _chunk6FUAHCVIcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6211
6218
  const retouchApply = {
@@ -6244,11 +6251,11 @@ var ImageEditorController = (_class7 = class {
6244
6251
  if (tool === "history") {
6245
6252
  const steps = settings.historySteps;
6246
6253
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
6247
- if (!entry) throw new (0, _chunkQCEQIRJQcjs.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.");
6254
+ if (!entry) throw new (0, _chunkPI45JMP7cjs.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.");
6248
6255
  const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
6249
- if (!then) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6256
+ if (!then) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6250
6257
  const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
6251
- if (!surface) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6258
+ if (!surface) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6252
6259
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
6253
6260
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6254
6261
  const source2 = depth ? new (0, _chunk6FUAHCVIcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
@@ -6293,7 +6300,7 @@ var ImageEditorController = (_class7 = class {
6293
6300
  }
6294
6301
  if (init.source) this.setCloneSource(init.source);
6295
6302
  const cs = this.state.paint.cloneSource;
6296
- if (!cs) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6303
+ if (!cs) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6297
6304
  let offset = { x: 0, y: 0 };
6298
6305
  let first = { x: 0, y: 0 };
6299
6306
  const xf = this.state.paint.cloneTransform;
@@ -6330,7 +6337,7 @@ var ImageEditorController = (_class7 = class {
6330
6337
  const sources = this.compositorSources();
6331
6338
  if (depth) {
6332
6339
  return new (0, _chunk6FUAHCVIcjs.TilePixelSource)((tx, ty) => {
6333
- const w = _chunkQCEQIRJQcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
6340
+ const w = _chunkPI45JMP7cjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
6334
6341
  for (let i = 0; i < w.length; i += 4) {
6335
6342
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkCWM3CUUXcjs.srgbEncode.call(void 0, w[i + c]);
6336
6343
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -6338,7 +6345,7 @@ var ImageEditorController = (_class7 = class {
6338
6345
  return w;
6339
6346
  }, 4);
6340
6347
  }
6341
- const compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)();
6348
+ const compositor = new (0, _chunkPI45JMP7cjs.LayerCompositor)();
6342
6349
  return new (0, _chunk6FUAHCVIcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6343
6350
  }
6344
6351
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
@@ -6388,9 +6395,9 @@ var ImageEditorController = (_class7 = class {
6388
6395
  * document bounds and the number of dabs.
6389
6396
  */
6390
6397
  paintStroke(init) {
6391
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("points must hold at least one { x, y } point.");
6398
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("points must hold at least one { x, y } point.");
6392
6399
  for (const p of init.points) {
6393
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6400
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6394
6401
  }
6395
6402
  const session = this.beginStroke(init);
6396
6403
  session.push(init.points);
@@ -6416,8 +6423,8 @@ var ImageEditorController = (_class7 = class {
6416
6423
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
6417
6424
  const { width, height } = this.naturalSize;
6418
6425
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
6419
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be from 0 to 1.");
6420
- const blend = _nullishCoalesce(_chunkQCEQIRJQcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6426
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("opacity must be from 0 to 1.");
6427
+ const blend = _nullishCoalesce(_chunkPI45JMP7cjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6421
6428
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
6422
6429
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
6423
6430
  const coverage = new (0, _chunkLRRCMRSLcjs.CoverageMap)();
@@ -6453,7 +6460,7 @@ var ImageEditorController = (_class7 = class {
6453
6460
  // --- Adjustments ---
6454
6461
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
6455
6462
  developLayer() {
6456
- return _chunkQCEQIRJQcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6463
+ return _chunkPI45JMP7cjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6457
6464
  }
6458
6465
  /**
6459
6466
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -6479,7 +6486,7 @@ var ImageEditorController = (_class7 = class {
6479
6486
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
6480
6487
  }
6481
6488
  if ("layers" in partial) {
6482
- layers = this.replaceAdjustmentNodes(layers, _chunkQCEQIRJQcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6489
+ layers = this.replaceAdjustmentNodes(layers, _chunkPI45JMP7cjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6483
6490
  }
6484
6491
  this.state.layers = layers;
6485
6492
  this.notify();
@@ -6487,7 +6494,7 @@ var ImageEditorController = (_class7 = class {
6487
6494
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
6488
6495
  get isProcessOutdated() {
6489
6496
  this.syncViews();
6490
- return _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION;
6497
+ return _chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkPI45JMP7cjs.LATEST_PROCESS_VERSION;
6491
6498
  }
6492
6499
  /**
6493
6500
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -6495,7 +6502,7 @@ var ImageEditorController = (_class7 = class {
6495
6502
  */
6496
6503
  upgradeProcess() {
6497
6504
  if (!this.isProcessOutdated) return false;
6498
- this.setAdjustments({ process: _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION });
6505
+ this.setAdjustments({ process: _chunkPI45JMP7cjs.LATEST_PROCESS_VERSION });
6499
6506
  return true;
6500
6507
  }
6501
6508
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -6506,7 +6513,7 @@ var ImageEditorController = (_class7 = class {
6506
6513
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0,
6507
6514
  this.state.layers,
6508
6515
  target.id,
6509
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION }), 0)
6516
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkPI45JMP7cjs.LATEST_PROCESS_VERSION }), 0)
6510
6517
  );
6511
6518
  }
6512
6519
  delete this.state.legacyOutputBlur;
@@ -6570,7 +6577,7 @@ var ImageEditorController = (_class7 = class {
6570
6577
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
6571
6578
  for (const l of next) {
6572
6579
  if (existing.has(l.id)) continue;
6573
- out = this.placeLayer(out, _chunkQCEQIRJQcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6580
+ out = this.placeLayer(out, _chunkPI45JMP7cjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6574
6581
  }
6575
6582
  const order = next.map((l) => l.id);
6576
6583
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -6585,7 +6592,7 @@ var ImageEditorController = (_class7 = class {
6585
6592
  addAdjustmentLayer(init, index) {
6586
6593
  const spec = typeof init === "string" ? { kind: init } : init;
6587
6594
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
6588
- const layer = _chunkQCEQIRJQcjs.createAdjustmentLayer.call(void 0, spec.kind, {
6595
+ const layer = _chunkPI45JMP7cjs.createAdjustmentLayer.call(void 0, spec.kind, {
6589
6596
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
6590
6597
  name: spec.name,
6591
6598
  params: spec.params,
@@ -6594,10 +6601,10 @@ var ImageEditorController = (_class7 = class {
6594
6601
  blend: spec.blend,
6595
6602
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
6596
6603
  });
6597
- while (ids.has(layer.id)) layer.id = _chunkQCEQIRJQcjs.newLayerId.call(void 0, "adj");
6604
+ while (ids.has(layer.id)) layer.id = _chunkPI45JMP7cjs.newLayerId.call(void 0, "adj");
6598
6605
  const { width, height } = this.naturalSize;
6599
6606
  this.recordHistory();
6600
- const node = _chunkQCEQIRJQcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6607
+ const node = _chunkPI45JMP7cjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6601
6608
  const positioned = Boolean(spec.aboveId || spec.parentId);
6602
6609
  this.state.layers = this.placeLayer(this.state.layers, node, {
6603
6610
  aboveId: spec.aboveId,
@@ -6617,7 +6624,7 @@ var ImageEditorController = (_class7 = class {
6617
6624
  if (!loc || loc.layer.type !== "adjustment") return false;
6618
6625
  const { width, height } = this.naturalSize;
6619
6626
  const node = loc.layer;
6620
- const merged = _chunkQCEQIRJQcjs.normalizeAdjustmentLayer.call(void 0, {
6627
+ const merged = _chunkPI45JMP7cjs.normalizeAdjustmentLayer.call(void 0, {
6621
6628
  id: node.id,
6622
6629
  kind: node.kind,
6623
6630
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -6637,7 +6644,7 @@ var ImageEditorController = (_class7 = class {
6637
6644
  params: merged.params
6638
6645
  };
6639
6646
  if (update.mask !== void 0) {
6640
- const mask = update.mask ? _chunkQCEQIRJQcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6647
+ const mask = update.mask ? _chunkPI45JMP7cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6641
6648
  if (mask) next.mask = mask;
6642
6649
  else delete next.mask;
6643
6650
  }
@@ -6650,8 +6657,12 @@ var ImageEditorController = (_class7 = class {
6650
6657
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id);
6651
6658
  if (!loc || loc.layer.type !== "adjustment") return false;
6652
6659
  this.recordHistory();
6653
- this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => null);
6654
- if (this.state.activeLayerId === id) this.state.activeLayerId = null;
6660
+ const prev = this.state.layers;
6661
+ this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, prev, id, () => null);
6662
+ if (this.state.activeLayerId === id) {
6663
+ this.state.activeLayerId = _chunkPI45JMP7cjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, id);
6664
+ this.state.activeTarget = "pixels";
6665
+ }
6655
6666
  this.notify();
6656
6667
  return true;
6657
6668
  }
@@ -6689,10 +6700,15 @@ var ImageEditorController = (_class7 = class {
6689
6700
  const nodes = this.adjustmentNodes();
6690
6701
  if (!nodes.length) return;
6691
6702
  this.recordHistory();
6692
- let layers = this.state.layers;
6703
+ const prev = this.state.layers;
6704
+ let layers = prev;
6693
6705
  for (const n of nodes) layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, n.id, () => null);
6694
6706
  this.state.layers = layers;
6695
- if (nodes.some((n) => n.id === this.state.activeLayerId)) this.state.activeLayerId = null;
6707
+ const active = this.state.activeLayerId;
6708
+ if (active && nodes.some((n) => n.id === active)) {
6709
+ this.state.activeLayerId = _chunkPI45JMP7cjs.activeLayerAfterRemoval.call(void 0, prev, layers, active);
6710
+ this.state.activeTarget = "pixels";
6711
+ }
6696
6712
  this.notify();
6697
6713
  }
6698
6714
  // --- Selection ---
@@ -6724,8 +6740,8 @@ var ImageEditorController = (_class7 = class {
6724
6740
  const { width, height } = this.naturalSize;
6725
6741
  let next = null;
6726
6742
  if (mask) {
6727
- const sized = mask.width === width && mask.height === height ? mask : _chunkQCEQIRJQcjs.resizeSelection.call(void 0, mask, width, height);
6728
- next = _chunkQCEQIRJQcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6743
+ const sized = mask.width === width && mask.height === height ? mask : _chunkPI45JMP7cjs.resizeSelection.call(void 0, mask, width, height);
6744
+ next = _chunkPI45JMP7cjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6729
6745
  } else if (mode !== "replace") {
6730
6746
  return false;
6731
6747
  }
@@ -6739,7 +6755,7 @@ var ImageEditorController = (_class7 = class {
6739
6755
  /** Select › All. */
6740
6756
  selectAll() {
6741
6757
  const { width, height } = this.naturalSize;
6742
- return this.setSelection(_chunkQCEQIRJQcjs.fullSelection.call(void 0, width, height));
6758
+ return this.setSelection(_chunkPI45JMP7cjs.fullSelection.call(void 0, width, height));
6743
6759
  }
6744
6760
  /** Select › Deselect. */
6745
6761
  deselect() {
@@ -6748,11 +6764,11 @@ var ImageEditorController = (_class7 = class {
6748
6764
  /** Select › Inverse (with nothing selected, selects everything). */
6749
6765
  invertSelection() {
6750
6766
  const { width, height } = this.naturalSize;
6751
- const current = _nullishCoalesce(this.state.selection, () => ( _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height)));
6752
- return this.setSelection(_chunkQCEQIRJQcjs.invertSelection.call(void 0, current));
6767
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkPI45JMP7cjs.createSelectionMask.call(void 0, width, height)));
6768
+ return this.setSelection(_chunkPI45JMP7cjs.invertSelection.call(void 0, current));
6753
6769
  }
6754
6770
  shapeCommand(mask, options) {
6755
- const shaped = options.feather && options.feather > 0 ? _chunkQCEQIRJQcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6771
+ const shaped = options.feather && options.feather > 0 ? _chunkPI45JMP7cjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6756
6772
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
6757
6773
  }
6758
6774
  /** Rectangular marquee in natural image pixels. */
@@ -6806,11 +6822,11 @@ var ImageEditorController = (_class7 = class {
6806
6822
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
6807
6823
  return null;
6808
6824
  }
6809
- const legacy = _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6825
+ const legacy = _chunkPI45JMP7cjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6810
6826
  if (options.sample === "active-layer") {
6811
6827
  const layer = this.getActiveLayer();
6812
6828
  if (!layer || layer.type !== "pixel") {
6813
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6829
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6814
6830
  }
6815
6831
  const surface = layer.source === "document" && options.pixels ? _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
6816
6832
  return { width, height, data: _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -6819,7 +6835,7 @@ var ImageEditorController = (_class7 = class {
6819
6835
  this.syncViews();
6820
6836
  if (legacy && !options.pixels) {
6821
6837
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
6822
- _chunkQCEQIRJQcjs.applyAdjustments.call(void 0, copy, _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6838
+ _chunkPI45JMP7cjs.applyAdjustments.call(void 0, copy, _chunkPI45JMP7cjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6823
6839
  return copy;
6824
6840
  }
6825
6841
  const pixels = options.pixels;
@@ -6831,7 +6847,7 @@ var ImageEditorController = (_class7 = class {
6831
6847
  };
6832
6848
  const stack = withoutAnnotations(this.state.layers);
6833
6849
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
6834
- const data = new (0, _chunkQCEQIRJQcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6850
+ const data = new (0, _chunkPI45JMP7cjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6835
6851
  return { width, height, data };
6836
6852
  }
6837
6853
  async requirePixels(options) {
@@ -6858,7 +6874,7 @@ var ImageEditorController = (_class7 = class {
6858
6874
  modifySelection(op, radius) {
6859
6875
  const sel = this.state.selection;
6860
6876
  if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
6861
- return this.setSelection(_chunkQCEQIRJQcjs.modifySelection.call(void 0, sel, op, radius));
6877
+ return this.setSelection(_chunkPI45JMP7cjs.modifySelection.call(void 0, sel, op, radius));
6862
6878
  }
6863
6879
  /**
6864
6880
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -6889,7 +6905,7 @@ var ImageEditorController = (_class7 = class {
6889
6905
  } else {
6890
6906
  pixels = source;
6891
6907
  }
6892
- this.setSelection(_chunkQCEQIRJQcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6908
+ this.setSelection(_chunkPI45JMP7cjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6893
6909
  return this.getSelection();
6894
6910
  }
6895
6911
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -6901,7 +6917,7 @@ var ImageEditorController = (_class7 = class {
6901
6917
  // --- Layer masks ---
6902
6918
  maskFromSelection(sel, props = {}) {
6903
6919
  const { width, height } = this.naturalSize;
6904
- const sized = sel.width === width && sel.height === height ? sel : _chunkQCEQIRJQcjs.resizeSelection.call(void 0, sel, width, height);
6920
+ const sized = sel.width === width && sel.height === height ? sel : _chunkPI45JMP7cjs.resizeSelection.call(void 0, sel, width, height);
6905
6921
  const mask = { surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
6906
6922
  return withMaskProps(mask, props);
6907
6923
  }
@@ -6947,7 +6963,7 @@ var ImageEditorController = (_class7 = class {
6947
6963
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6948
6964
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
6949
6965
  const data = _chunkCWM3CUUXcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
6950
- const sel = _chunkQCEQIRJQcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6966
+ const sel = _chunkPI45JMP7cjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6951
6967
  return this.setSelection(sel, mode);
6952
6968
  }
6953
6969
  // --- Histogram ---
@@ -6977,9 +6993,9 @@ var ImageEditorController = (_class7 = class {
6977
6993
  merged.depthRange = [...merged.depthRange];
6978
6994
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6979
6995
  const next = { ...l };
6980
- if (_chunkQCEQIRJQcjs.isDefaultDepthMask.call(void 0, merged)) {
6996
+ if (_chunkPI45JMP7cjs.isDefaultDepthMask.call(void 0, merged)) {
6981
6997
  if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
6982
- } else next.mask = _chunkQCEQIRJQcjs.depthRasterMask.call(void 0, merged);
6998
+ } else next.mask = _chunkPI45JMP7cjs.depthRasterMask.call(void 0, merged);
6983
6999
  return next;
6984
7000
  });
6985
7001
  }
@@ -7000,7 +7016,7 @@ var ImageEditorController = (_class7 = class {
7000
7016
  // --- Annotations & Layers ---
7001
7017
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
7002
7018
  annotationLayer(id) {
7003
- return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkQCEQIRJQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
7019
+ return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkPI45JMP7cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
7004
7020
  }
7005
7021
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
7006
7022
  annotationEnv() {
@@ -7016,7 +7032,7 @@ var ImageEditorController = (_class7 = class {
7016
7032
  this.recordHistory();
7017
7033
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
7018
7034
  const fullAnnotation = { ...annotation, id };
7019
- const layer = _chunkQCEQIRJQcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7035
+ const layer = _chunkPI45JMP7cjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7020
7036
  const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
7021
7037
  this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
7022
7038
  this.state.selectedAnnotationId = id;
@@ -7028,17 +7044,17 @@ var ImageEditorController = (_class7 = class {
7028
7044
  this.recordHistory();
7029
7045
  }
7030
7046
  const layer = this.annotationLayer(id);
7031
- const current = layer ? _chunkQCEQIRJQcjs.annotationOfLayer.call(void 0, layer) : null;
7047
+ const current = layer ? _chunkPI45JMP7cjs.annotationOfLayer.call(void 0, layer) : null;
7032
7048
  if (layer && current) {
7033
7049
  const annotation = { ...current, ...partial, id };
7034
- const name = layer.name === _chunkQCEQIRJQcjs.annotationLayerName.call(void 0, current) ? _chunkQCEQIRJQcjs.annotationLayerName.call(void 0, annotation) : layer.name;
7050
+ const name = layer.name === _chunkPI45JMP7cjs.annotationLayerName.call(void 0, current) ? _chunkPI45JMP7cjs.annotationLayerName.call(void 0, annotation) : layer.name;
7035
7051
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
7036
7052
  }
7037
7053
  this.notify();
7038
7054
  }
7039
7055
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
7040
7056
  layerForAnnotation(layer, annotation, name) {
7041
- const fresh = _chunkQCEQIRJQcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7057
+ const fresh = _chunkPI45JMP7cjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7042
7058
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
7043
7059
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
7044
7060
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -7325,8 +7341,8 @@ var ImageEditorController = (_class7 = class {
7325
7341
  return;
7326
7342
  }
7327
7343
  const target = this.developLayer();
7328
- if (!target) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("There is no pixel layer to mask.");
7329
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, target, "all", "mask it");
7344
+ if (!target) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("There is no pixel layer to mask.");
7345
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, target, "all", "mask it");
7330
7346
  const { width, height } = this.naturalSize;
7331
7347
  let px2 = await this.decodeImage(newDataUrl);
7332
7348
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -7334,7 +7350,7 @@ var ImageEditorController = (_class7 = class {
7334
7350
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
7335
7351
  let surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
7336
7352
  if (target.offset.x || target.offset.y) surface = _chunkCWM3CUUXcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
7337
- this.commitLayers(_chunkQCEQIRJQcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7353
+ this.commitLayers(_chunkPI45JMP7cjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7338
7354
  return target.id;
7339
7355
  }
7340
7356
  // --- Type layers ---
@@ -7358,7 +7374,7 @@ var ImageEditorController = (_class7 = class {
7358
7374
  return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
7359
7375
  }
7360
7376
  typeInfo(id) {
7361
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7377
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7362
7378
  const ranges = (runs) => {
7363
7379
  let at = 0;
7364
7380
  return runs.map((r) => {
@@ -7401,25 +7417,25 @@ var ImageEditorController = (_class7 = class {
7401
7417
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
7402
7418
  */
7403
7419
  addTextLayer(init) {
7404
- const text = _chunkQCEQIRJQcjs.normalizeText.call(void 0, init.text);
7405
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("x and y must be numbers (document pixels).");
7406
- const style = _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, { ..._chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7407
- const paragraph = _chunkQCEQIRJQcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7420
+ const text = _chunkPI45JMP7cjs.normalizeText.call(void 0, init.text);
7421
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("x and y must be numbers (document pixels).");
7422
+ const style = _chunkPI45JMP7cjs.patchTextStyle.call(void 0, { ..._chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7423
+ const paragraph = _chunkPI45JMP7cjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7408
7424
  let frame = { kind: "point" };
7409
7425
  if (init.box) {
7410
7426
  const { width, height } = init.box;
7411
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7427
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7412
7428
  frame = { kind: "box", width, height };
7413
7429
  }
7414
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("rotation must be a number of degrees.");
7415
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be between 0 and 1.");
7416
- if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7430
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("rotation must be a number of degrees.");
7431
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("opacity must be between 0 and 1.");
7432
+ if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7417
7433
  const t = [1, 0, 0, 1, init.x, init.y];
7418
7434
  const transform = init.rotation ? _chunkRHXW4TA5cjs.multiplyMatrices.call(void 0, t, _chunkRHXW4TA5cjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7419
- const layer = _chunkQCEQIRJQcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkQCEQIRJQcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7435
+ const layer = _chunkPI45JMP7cjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkPI45JMP7cjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7420
7436
  if (init.opacity !== void 0) layer.opacity = init.opacity;
7421
7437
  if (init.blend !== void 0) layer.blend = init.blend;
7422
- const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7438
+ const next = _chunkPI45JMP7cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7423
7439
  this.commitLayers(next, () => {
7424
7440
  this.state.activeLayerId = layer.id;
7425
7441
  this.state.activeTarget = "pixels";
@@ -7431,28 +7447,28 @@ var ImageEditorController = (_class7 = class {
7431
7447
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
7432
7448
  */
7433
7449
  setText(id, text, range = {}, commitToHistory = true) {
7434
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7435
- const insert = _chunkQCEQIRJQcjs.normalizeText.call(void 0, text);
7436
- const [start, end] = _chunkQCEQIRJQcjs.textRange.call(void 0, layer.text, range.start, range.end);
7437
- const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkQCEQIRJQcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7450
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7451
+ const insert = _chunkPI45JMP7cjs.normalizeText.call(void 0, text);
7452
+ const [start, end] = _chunkPI45JMP7cjs.textRange.call(void 0, layer.text, range.start, range.end);
7453
+ const { layers } = _chunkPI45JMP7cjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkPI45JMP7cjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7438
7454
  this.commitLayers(layers, void 0, commitToHistory);
7439
7455
  return this.typeInfo(id);
7440
7456
  }
7441
7457
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
7442
7458
  setTextStyle(id, style, range = {}, commitToHistory = true) {
7443
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7444
- const [start, end] = _chunkQCEQIRJQcjs.textRange.call(void 0, layer.text, range.start, range.end);
7445
- if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one style field to set.");
7446
- _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, style);
7447
- const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0,
7459
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7460
+ const [start, end] = _chunkPI45JMP7cjs.textRange.call(void 0, layer.text, range.start, range.end);
7461
+ if (!Object.keys(style).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give at least one style field to set.");
7462
+ _chunkPI45JMP7cjs.patchTextStyle.call(void 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE, style);
7463
+ const { layers } = _chunkPI45JMP7cjs.updateTypeLayer.call(void 0,
7448
7464
  this.state.layers,
7449
7465
  id,
7450
7466
  (l) => {
7451
7467
  if (start === end) {
7452
- if (l.text.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7453
- return { runs: [{ length: 0, style: _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, _chunkRHXW4TA5cjs.styleAt.call(void 0, l.runs, 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE), style) }] };
7468
+ if (l.text.length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7469
+ return { runs: [{ length: 0, style: _chunkPI45JMP7cjs.patchTextStyle.call(void 0, _chunkRHXW4TA5cjs.styleAt.call(void 0, l.runs, 0, _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE), style) }] };
7454
7470
  }
7455
- return { runs: _chunkRHXW4TA5cjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkQCEQIRJQcjs.patchTextStyle.call(void 0, s, style)) };
7471
+ return { runs: _chunkRHXW4TA5cjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkPI45JMP7cjs.patchTextStyle.call(void 0, s, style)) };
7456
7472
  },
7457
7473
  this.textEnv(),
7458
7474
  "restyle its text"
@@ -7462,11 +7478,11 @@ var ImageEditorController = (_class7 = class {
7462
7478
  }
7463
7479
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
7464
7480
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
7465
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7466
- const [start, end] = _chunkQCEQIRJQcjs.textRange.call(void 0, layer.text, range.start, range.end);
7467
- if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one paragraph field to set.");
7468
- _chunkQCEQIRJQcjs.patchParagraphStyle.call(void 0, {}, style);
7469
- const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0,
7481
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7482
+ const [start, end] = _chunkPI45JMP7cjs.textRange.call(void 0, layer.text, range.start, range.end);
7483
+ if (!Object.keys(style).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give at least one paragraph field to set.");
7484
+ _chunkPI45JMP7cjs.patchParagraphStyle.call(void 0, {}, style);
7485
+ const { layers } = _chunkPI45JMP7cjs.updateTypeLayer.call(void 0,
7470
7486
  this.state.layers,
7471
7487
  id,
7472
7488
  (l) => {
@@ -7475,7 +7491,7 @@ var ImageEditorController = (_class7 = class {
7475
7491
  const a = at;
7476
7492
  at += p.length;
7477
7493
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
7478
- return touches || !l.text.length ? { length: p.length, style: _chunkQCEQIRJQcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7494
+ return touches || !l.text.length ? { length: p.length, style: _chunkPI45JMP7cjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7479
7495
  });
7480
7496
  return { paragraphs };
7481
7497
  },
@@ -7491,21 +7507,21 @@ var ImageEditorController = (_class7 = class {
7491
7507
  * paragraph. Also resizes a box. One undo step.
7492
7508
  */
7493
7509
  setTextFrame(id, frame, commitToHistory = true) {
7494
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7495
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("width and height must be at least 1 pixel.");
7496
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("kind must be point or box.");
7510
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7511
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("width and height must be at least 1 pixel.");
7512
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("kind must be point or box.");
7497
7513
  const shaper = this.getTextShaper();
7498
- const { layers } = _chunkQCEQIRJQcjs.updateTypeLayer.call(void 0,
7514
+ const { layers } = _chunkPI45JMP7cjs.updateTypeLayer.call(void 0,
7499
7515
  this.state.layers,
7500
7516
  id,
7501
7517
  (l) => {
7502
7518
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
7503
- if (!shaper) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7519
+ if (!shaper) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7504
7520
  const lines = _chunkRHXW4TA5cjs.layoutText.call(void 0, l, shaper).lines;
7505
7521
  const first = lines[0];
7506
7522
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
7507
7523
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
7508
- const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, l);
7524
+ const m = _chunkPI45JMP7cjs.textMatrix.call(void 0, l);
7509
7525
  const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
7510
7526
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
7511
7527
  return { frame: nextFrame, transform: shifted };
@@ -7522,13 +7538,13 @@ var ImageEditorController = (_class7 = class {
7522
7538
  * `warnings` says when other colours were dropped. One undo step.
7523
7539
  */
7524
7540
  convertTextToShape(id) {
7525
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7526
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7541
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7542
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7527
7543
  const shaper = this.getTextShaper();
7528
- if (!shaper) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7529
- const parts = _chunkQCEQIRJQcjs.textOutlines.call(void 0, layer, shaper);
7544
+ if (!shaper) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7545
+ const parts = _chunkPI45JMP7cjs.textOutlines.call(void 0, layer, shaper);
7530
7546
  const subpaths = parts.flatMap((p) => _chunkRHXW4TA5cjs.bezierToSubpaths.call(void 0, p.path));
7531
- if (!subpaths.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7547
+ if (!subpaths.length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7532
7548
  const warnings = [];
7533
7549
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
7534
7550
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
@@ -7536,7 +7552,7 @@ var ImageEditorController = (_class7 = class {
7536
7552
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
7537
7553
  const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE));
7538
7554
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
7539
- const shape = _chunkQCEQIRJQcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7555
+ const shape = _chunkPI45JMP7cjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7540
7556
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
7541
7557
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
7542
7558
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -7544,23 +7560,23 @@ var ImageEditorController = (_class7 = class {
7544
7560
  }
7545
7561
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
7546
7562
  getTextLayout(id) {
7547
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7563
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7548
7564
  const shaper = this.getTextShaper();
7549
7565
  return shaper ? _chunkRHXW4TA5cjs.layoutText.call(void 0, layer, shaper) : null;
7550
7566
  }
7551
7567
  /** The text index nearest a document point (for clicks on a type layer). */
7552
7568
  textIndexAt(id, point) {
7553
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7569
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7554
7570
  const layout = this.getTextLayout(id);
7555
- return layout ? _chunkRHXW4TA5cjs.textIndexAt.call(void 0, layout, _chunkQCEQIRJQcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7571
+ return layout ? _chunkRHXW4TA5cjs.textIndexAt.call(void 0, layout, _chunkPI45JMP7cjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7556
7572
  }
7557
7573
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
7558
7574
  textCaret(id, index) {
7559
- const layer = _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7575
+ const layer = _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7560
7576
  const layout = this.getTextLayout(id);
7561
7577
  if (!layout) return null;
7562
7578
  const c = _chunkRHXW4TA5cjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7563
- const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer);
7579
+ const m = _chunkPI45JMP7cjs.textMatrix.call(void 0, layer);
7564
7580
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
7565
7581
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
7566
7582
  }
@@ -7571,14 +7587,14 @@ var ImageEditorController = (_class7 = class {
7571
7587
  }
7572
7588
  /** One component from tool or UI input (validated). */
7573
7589
  componentFrom(spec, path) {
7574
- const op = _chunkQCEQIRJQcjs.requireOperation.call(void 0, spec.op, `${path}op`);
7575
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7576
- if (spec.shape !== void 0) return _chunkQCEQIRJQcjs.liveComponent.call(void 0, _chunkQCEQIRJQcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7577
- if (spec.subpaths !== void 0) return { op, subpaths: _chunkQCEQIRJQcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7578
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7590
+ const op = _chunkPI45JMP7cjs.requireOperation.call(void 0, spec.op, `${path}op`);
7591
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7592
+ if (spec.shape !== void 0) return _chunkPI45JMP7cjs.liveComponent.call(void 0, _chunkPI45JMP7cjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7593
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkPI45JMP7cjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7594
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7579
7595
  }
7580
7596
  shapeInfo(id) {
7581
- const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7597
+ const layer = _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7582
7598
  const r = (n) => Math.round(n * 1e3) / 1e3;
7583
7599
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
7584
7600
  const info = {
@@ -7589,12 +7605,12 @@ var ImageEditorController = (_class7 = class {
7589
7605
  op: c.op,
7590
7606
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
7591
7607
  subpaths: _chunkRHXW4TA5cjs.roundSubpaths.call(void 0, c.subpaths),
7592
- bounds: box(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7608
+ bounds: box(_chunkPI45JMP7cjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7593
7609
  })),
7594
7610
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
7595
7611
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
7596
7612
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
7597
- geometryBounds: box(_chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer)),
7613
+ geometryBounds: box(_chunkPI45JMP7cjs.shapeGeometryBounds.call(void 0, layer)),
7598
7614
  bounds: this.getLayerBounds(id)
7599
7615
  };
7600
7616
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -7611,17 +7627,17 @@ var ImageEditorController = (_class7 = class {
7611
7627
  */
7612
7628
  addShapeLayer(init) {
7613
7629
  const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
7614
- if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7630
+ if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7615
7631
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
7616
- const stroke = init.stroke ? _chunkQCEQIRJQcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7632
+ const stroke = init.stroke ? _chunkPI45JMP7cjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7617
7633
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
7618
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkQCEQIRJQcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkQCEQIRJQcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7619
- if (!fill && !stroke) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7620
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7621
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("opacity must be between 0 and 1.");
7622
- if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7623
- const layer = _chunkQCEQIRJQcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7624
- const next = _chunkQCEQIRJQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7634
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkPI45JMP7cjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkPI45JMP7cjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7635
+ if (!fill && !stroke) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7636
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7637
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("opacity must be between 0 and 1.");
7638
+ if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7639
+ const layer = _chunkPI45JMP7cjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7640
+ const next = _chunkPI45JMP7cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7625
7641
  this.commitLayers(next, () => {
7626
7642
  this.state.activeLayerId = layer.id;
7627
7643
  this.state.activeTarget = "pixels";
@@ -7634,18 +7650,18 @@ var ImageEditorController = (_class7 = class {
7634
7650
  * only those settings of the current stroke. Returns the shape.
7635
7651
  */
7636
7652
  setShapeStyle(id, changes, commitToHistory = true) {
7637
- const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7638
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkQCEQIRJQcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7639
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkQCEQIRJQcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7640
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7653
+ const layer = _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7654
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkPI45JMP7cjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7655
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkPI45JMP7cjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7656
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7641
7657
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
7642
- const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7658
+ const { layers } = _chunkPI45JMP7cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7643
7659
  this.commitLayers(layers, void 0, commitToHistory);
7644
7660
  return this.shapeInfo(id);
7645
7661
  }
7646
7662
  componentIndex(layer, index) {
7647
7663
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
7648
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7664
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7649
7665
  }
7650
7666
  return index;
7651
7667
  }
@@ -7655,36 +7671,36 @@ var ImageEditorController = (_class7 = class {
7655
7671
  * the live shape) or its operation. Returns the shape.
7656
7672
  */
7657
7673
  setShapeComponent(id, index, change, commitToHistory = true) {
7658
- const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7674
+ const layer = _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7659
7675
  const i = this.componentIndex(layer, index);
7660
7676
  const current = layer.components[i];
7661
7677
  let shape = change.shape;
7662
7678
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
7663
7679
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
7664
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkQCEQIRJQcjs.requireOperation.call(void 0, change.op) };
7680
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkPI45JMP7cjs.requireOperation.call(void 0, change.op) };
7665
7681
  const components = layer.components.map((c, k) => k === i ? next : c);
7666
- const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7682
+ const { layers } = _chunkPI45JMP7cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7667
7683
  this.commitLayers(layers, void 0, commitToHistory);
7668
7684
  return this.shapeInfo(id);
7669
7685
  }
7670
7686
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
7671
7687
  addShapeComponent(id, spec, index) {
7672
- const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7688
+ const layer = _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7673
7689
  const c = this.componentFrom(spec, "");
7674
7690
  const at = index === void 0 ? layer.components.length : index;
7675
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7691
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7676
7692
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
7677
- const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7693
+ const { layers } = _chunkPI45JMP7cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7678
7694
  this.commitLayers(layers);
7679
7695
  return this.shapeInfo(id);
7680
7696
  }
7681
7697
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
7682
7698
  removeShapeComponent(id, index) {
7683
- const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7699
+ const layer = _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7684
7700
  const i = this.componentIndex(layer, index);
7685
- if (layer.components.length === 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7701
+ if (layer.components.length === 1) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7686
7702
  const components = layer.components.filter((_, k) => k !== i);
7687
- const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7703
+ const { layers } = _chunkPI45JMP7cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7688
7704
  this.commitLayers(layers);
7689
7705
  return this.shapeInfo(id);
7690
7706
  }
@@ -7693,10 +7709,10 @@ var ImageEditorController = (_class7 = class {
7693
7709
  * shapes become paths), as one undo step. Returns the shape.
7694
7710
  */
7695
7711
  mergeShapeComponents(id) {
7696
- const layer = _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7697
- if (layer.components.length < 2) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7698
- const components = _chunkQCEQIRJQcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7699
- const { layers } = _chunkQCEQIRJQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7712
+ const layer = _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7713
+ if (layer.components.length < 2) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7714
+ const components = _chunkPI45JMP7cjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7715
+ const { layers } = _chunkPI45JMP7cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7700
7716
  this.commitLayers(layers);
7701
7717
  return this.shapeInfo(id);
7702
7718
  }
@@ -7706,8 +7722,8 @@ var ImageEditorController = (_class7 = class {
7706
7722
  * step. Returns the layer id.
7707
7723
  */
7708
7724
  async rasterizeLayer(id) {
7709
- const layer = _chunkQCEQIRJQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7710
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7725
+ const layer = _chunkPI45JMP7cjs.requireLayer.call(void 0, this.state.layers, id).layer;
7726
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7711
7727
  const { width, height } = this.naturalSize;
7712
7728
  const canvas = { x: 0, y: 0, width, height };
7713
7729
  let next;
@@ -7723,8 +7739,8 @@ var ImageEditorController = (_class7 = class {
7723
7739
  if (layer.locks) next.locks = layer.locks;
7724
7740
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
7725
7741
  } else if (layer.type === "pixel") {
7726
- if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7727
- _chunkQCEQIRJQcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7742
+ if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7743
+ _chunkPI45JMP7cjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7728
7744
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
7729
7745
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
7730
7746
  delete content.mask;
@@ -7741,10 +7757,10 @@ var ImageEditorController = (_class7 = class {
7741
7757
  } else if (layer.type === "smart") {
7742
7758
  return this.rasterizeSmartObject(id);
7743
7759
  } else if (layer.type === "shape" || layer.type === "type") {
7744
- next = layer.type === "shape" ? _chunkQCEQIRJQcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkQCEQIRJQcjs.typeAsPixelLayer.call(void 0, layer);
7760
+ next = layer.type === "shape" ? _chunkPI45JMP7cjs.shapeAsPixelLayer.call(void 0, layer) : _chunkPI45JMP7cjs.typeAsPixelLayer.call(void 0, layer);
7745
7761
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
7746
7762
  } else {
7747
- throw new (0, _chunkQCEQIRJQcjs.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.`);
7763
+ throw new (0, _chunkPI45JMP7cjs.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.`);
7748
7764
  }
7749
7765
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7750
7766
  return id;
@@ -7769,7 +7785,7 @@ var ImageEditorController = (_class7 = class {
7769
7785
  setColorMode(mode, options = {}) {
7770
7786
  let next;
7771
7787
  if (mode === "rgb") {
7772
- if (options.profile !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7788
+ if (options.profile !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7773
7789
  next = null;
7774
7790
  } else if (mode === "lab") next = { mode: "lab" };
7775
7791
  else if (mode === "cmyk") {
@@ -7777,14 +7793,14 @@ var ImageEditorController = (_class7 = class {
7777
7793
  try {
7778
7794
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
7779
7795
  } catch (e) {
7780
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7796
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7781
7797
  }
7782
7798
  const cs = resolveProfile(doc).colorSpace;
7783
- if (cs !== "cmyk") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7799
+ if (cs !== "cmyk") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7784
7800
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7785
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
7801
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
7786
7802
  next = { mode: "cmyk", profile: doc, intent };
7787
- } else throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7803
+ } else throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7788
7804
  this.recordHistory();
7789
7805
  if (next) this.state.colorMode = next;
7790
7806
  else delete this.state.colorMode;
@@ -7797,10 +7813,10 @@ var ImageEditorController = (_class7 = class {
7797
7813
  try {
7798
7814
  doc = documentProfile(profile);
7799
7815
  } catch (e) {
7800
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7816
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7801
7817
  }
7802
7818
  const cs = resolveProfile(doc).colorSpace;
7803
- if (cs !== "rgb") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7819
+ if (cs !== "rgb") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
7804
7820
  return doc;
7805
7821
  }
7806
7822
  /**
@@ -7826,7 +7842,7 @@ var ImageEditorController = (_class7 = class {
7826
7842
  convertToProfile(profile, options = {}) {
7827
7843
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
7828
7844
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7829
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
7845
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
7830
7846
  const t = _chunkBROJYMWUcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7831
7847
  const converted = [];
7832
7848
  const unconverted = [];
@@ -7856,11 +7872,11 @@ var ImageEditorController = (_class7 = class {
7856
7872
  else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
7857
7873
  else if (l.type === "shape") {
7858
7874
  const s = next2;
7859
- next2 = _chunkQCEQIRJQcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7875
+ next2 = _chunkPI45JMP7cjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7860
7876
  } else if (l.type === "type") {
7861
7877
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
7862
7878
  try {
7863
- next2 = _chunkQCEQIRJQcjs.rerenderText.call(void 0, recoloured, textEnv);
7879
+ next2 = _chunkPI45JMP7cjs.rerenderText.call(void 0, recoloured, textEnv);
7864
7880
  } catch (e27) {
7865
7881
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
7866
7882
  }
@@ -7890,12 +7906,12 @@ var ImageEditorController = (_class7 = class {
7890
7906
  try {
7891
7907
  doc = documentProfile(setup.profile);
7892
7908
  } catch (e) {
7893
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7909
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7894
7910
  }
7895
7911
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
7896
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
7912
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
7897
7913
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
7898
- if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7914
+ if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7899
7915
  this.state.proofSetup = next;
7900
7916
  this.notify();
7901
7917
  return next;
@@ -7912,14 +7928,14 @@ var ImageEditorController = (_class7 = class {
7912
7928
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
7913
7929
  dst = resolveProfile(documentProfile(to));
7914
7930
  } catch (e) {
7915
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7931
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7916
7932
  }
7917
- if (src.colorSpace !== "rgb") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7933
+ if (src.colorSpace !== "rgb") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7918
7934
  const t = _chunkBROJYMWUcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7919
7935
  const toLab = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
7920
7936
  return colors.map((input) => {
7921
7937
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
7922
- if (!m) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7938
+ if (!m) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7923
7939
  const n = parseInt(m[1], 16);
7924
7940
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
7925
7941
  const out = new Float32Array(16);
@@ -7945,7 +7961,7 @@ var ImageEditorController = (_class7 = class {
7945
7961
  * the ids of the layers whose pixels changed.
7946
7962
  */
7947
7963
  setBitDepth(depth) {
7948
- if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7964
+ if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7949
7965
  const changed = [];
7950
7966
  const withMask = (l) => {
7951
7967
  const m = l.mask;
@@ -7994,7 +8010,7 @@ var ImageEditorController = (_class7 = class {
7994
8010
  * Throws `PsdError` for files that cannot be read at all.
7995
8011
  */
7996
8012
  loadPsd(bytes) {
7997
- const result = _chunkQCEQIRJQcjs.importPsd.call(void 0, bytes, { newId: () => _chunkQCEQIRJQcjs.newLayerId.call(void 0, ) });
8013
+ const result = _chunkPI45JMP7cjs.importPsd.call(void 0, bytes, { newId: () => _chunkPI45JMP7cjs.newLayerId.call(void 0, ) });
7998
8014
  this.abandonContents();
7999
8015
  this.recordHistory();
8000
8016
  const s = this.state;
@@ -8004,13 +8020,12 @@ var ImageEditorController = (_class7 = class {
8004
8020
  if (!this.samplePixelsOverride) this.samplePixels = null;
8005
8021
  s.layers = this.checkPsdFonts(result);
8006
8022
  s.crop = null;
8007
- s.transform = { ..._chunkQCEQIRJQcjs.DEFAULT_TRANSFORM_VALUES };
8023
+ s.transform = { ..._chunkPI45JMP7cjs.DEFAULT_TRANSFORM_VALUES };
8008
8024
  s.outputOpacity = 1;
8009
8025
  delete s.legacyOutputBlur;
8010
8026
  s.selection = null;
8011
8027
  s.selectedAnnotationId = null;
8012
- const pixels = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, result.layers).filter((l) => l.type === "pixel");
8013
- s.activeLayerId = pixels.length ? pixels[pixels.length - 1].id : null;
8028
+ s.activeLayerId = _chunkPI45JMP7cjs.defaultActiveLayerId.call(void 0, s.layers);
8014
8029
  s.activeTarget = "pixels";
8015
8030
  this.psdResolution = result.resolution;
8016
8031
  if (result.patterns.length) s.patterns = result.patterns;
@@ -8083,7 +8098,7 @@ var ImageEditorController = (_class7 = class {
8083
8098
  const canRasterize = this.renderer.canRasterize();
8084
8099
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
8085
8100
  const sources = this.renderer.compositorSources(width, height);
8086
- const compositor = new (0, _chunkQCEQIRJQcjs.LayerCompositor)();
8101
+ const compositor = new (0, _chunkPI45JMP7cjs.LayerCompositor)();
8087
8102
  const bakeMask = (layer) => {
8088
8103
  const mask = layer.mask;
8089
8104
  if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
@@ -8165,7 +8180,7 @@ var ImageEditorController = (_class7 = class {
8165
8180
  out.surface = this.surfaceOf(layer);
8166
8181
  delete out.source;
8167
8182
  }
8168
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkQCEQIRJQcjs.isActiveFilter)]), () => ( []));
8183
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkPI45JMP7cjs.isActiveFilter)]), () => ( []));
8169
8184
  if (active.length) {
8170
8185
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
8171
8186
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -8198,8 +8213,8 @@ var ImageEditorController = (_class7 = class {
8198
8213
  const color = this.psdColorOptions(warnings);
8199
8214
  if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
8200
8215
  const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
8201
- const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkQCEQIRJQcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8202
- const result = _chunkQCEQIRJQcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8216
+ const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunkPI45JMP7cjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8217
+ const result = _chunkPI45JMP7cjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8203
8218
  warnings.push(...result.warnings);
8204
8219
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
8205
8220
  }
@@ -8215,13 +8230,13 @@ var ImageEditorController = (_class7 = class {
8215
8230
  if (!this.samplePixelsOverride) this.samplePixels = null;
8216
8231
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
8217
8232
  this.state.selection = normalizeSelection(
8218
- _chunkQCEQIRJQcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8233
+ _chunkPI45JMP7cjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8219
8234
  );
8220
8235
  }
8221
8236
  let layers = this.state.layers;
8222
8237
  if (sx !== 1 || sy !== 1) {
8223
8238
  if (this.state.crop) {
8224
- this.state.crop = _chunkQCEQIRJQcjs.clampCropToImage.call(void 0,
8239
+ this.state.crop = _chunkPI45JMP7cjs.clampCropToImage.call(void 0,
8225
8240
  {
8226
8241
  x: Math.round(this.state.crop.x * sx),
8227
8242
  y: Math.round(this.state.crop.y * sy),
@@ -8240,17 +8255,17 @@ var ImageEditorController = (_class7 = class {
8240
8255
  } else if (l.type === "shape") {
8241
8256
  const a = l.annotation;
8242
8257
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
8243
- const fromAnnotation = scaled ? _chunkQCEQIRJQcjs.shapeFromAnnotation.call(void 0, scaled) : null;
8258
+ const fromAnnotation = scaled ? _chunkPI45JMP7cjs.shapeFromAnnotation.call(void 0, scaled) : null;
8244
8259
  const m = [sx, 0, 0, sy, 0, 0];
8245
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkQCEQIRJQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8260
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkPI45JMP7cjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8246
8261
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
8247
8262
  if (scaled && fromAnnotation) moved.annotation = scaled;
8248
8263
  else delete moved.annotation;
8249
- layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkQCEQIRJQcjs.rerenderShape.call(void 0, moved, env));
8264
+ layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunkPI45JMP7cjs.rerenderShape.call(void 0, moved, env));
8250
8265
  }
8251
8266
  }
8252
8267
  }
8253
- const bg = _chunkQCEQIRJQcjs.developTarget.call(void 0, layers, null);
8268
+ const bg = _chunkPI45JMP7cjs.developTarget.call(void 0, layers, null);
8254
8269
  if (bg && bg.source !== "document") layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
8255
8270
  if (clearAnnotations) {
8256
8271
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -8271,7 +8286,7 @@ var ImageEditorController = (_class7 = class {
8271
8286
  let out;
8272
8287
  try {
8273
8288
  out = this.serializeState();
8274
- if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkQCEQIRJQcjs.serializeSelection.call(void 0, this.state.selection);
8289
+ if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkPI45JMP7cjs.serializeSelection.call(void 0, this.state.selection);
8275
8290
  } finally {
8276
8291
  if (root) {
8277
8292
  this.state = current;
@@ -8279,8 +8294,8 @@ var ImageEditorController = (_class7 = class {
8279
8294
  this.viewKey = [];
8280
8295
  }
8281
8296
  }
8282
- if (!options || out.version !== _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8283
- return _chunkQCEQIRJQcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8297
+ if (!options || out.version !== _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8298
+ return _chunkPI45JMP7cjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8284
8299
  }
8285
8300
  /**
8286
8301
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -8288,12 +8303,12 @@ var ImageEditorController = (_class7 = class {
8288
8303
  * out and listed in `lastLoadProblems`.
8289
8304
  */
8290
8305
  async loadJSONAsync(data, options = {}) {
8291
- if (data.version !== _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8306
+ if (data.version !== _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8292
8307
  this.loadJSON(data);
8293
8308
  return;
8294
8309
  }
8295
8310
  const problems = [];
8296
- const assets = await _chunkQCEQIRJQcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8311
+ const assets = await _chunkPI45JMP7cjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8297
8312
  this.loadJSON({ ...data, assets });
8298
8313
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
8299
8314
  }
@@ -8305,7 +8320,7 @@ var ImageEditorController = (_class7 = class {
8305
8320
  let selection = null;
8306
8321
  if (data.selection) {
8307
8322
  try {
8308
- selection = normalizeSelection(_chunkQCEQIRJQcjs.deserializeSelection.call(void 0, data.selection));
8323
+ selection = normalizeSelection(_chunkPI45JMP7cjs.deserializeSelection.call(void 0, data.selection));
8309
8324
  } catch (e28) {
8310
8325
  selection = null;
8311
8326
  }
@@ -8323,8 +8338,8 @@ var ImageEditorController = (_class7 = class {
8323
8338
  if (isLayered(data)) {
8324
8339
  const problems = [];
8325
8340
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
8326
- const storedPatterns = _chunkQCEQIRJQcjs.deserializePatterns.call(void 0, data.patterns, []);
8327
- s.layers = _chunkQCEQIRJQcjs.deserializeLayers.call(void 0, data.layers, {
8341
+ const storedPatterns = _chunkPI45JMP7cjs.deserializePatterns.call(void 0, data.patterns, []);
8342
+ s.layers = _chunkPI45JMP7cjs.deserializeLayers.call(void 0, data.layers, {
8328
8343
  assets: _nullishCoalesce(data.assets, () => ( {})),
8329
8344
  problems,
8330
8345
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -8338,11 +8353,11 @@ var ImageEditorController = (_class7 = class {
8338
8353
  s.outputOpacity = data.opacity;
8339
8354
  if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
8340
8355
  else delete s.legacyOutputBlur;
8341
- s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : null;
8356
+ s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : _chunkPI45JMP7cjs.defaultActiveLayerId.call(void 0, s.layers);
8342
8357
  const light = data.globalLight;
8343
8358
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
8344
8359
  else delete s.globalLight;
8345
- const patterns = _chunkQCEQIRJQcjs.deserializePatterns.call(void 0, data.patterns, problems);
8360
+ const patterns = _chunkPI45JMP7cjs.deserializePatterns.call(void 0, data.patterns, problems);
8346
8361
  if (patterns.length) s.patterns = patterns;
8347
8362
  else delete s.patterns;
8348
8363
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -8358,14 +8373,14 @@ var ImageEditorController = (_class7 = class {
8358
8373
  }
8359
8374
  } else {
8360
8375
  const { width, height } = this.naturalSize;
8361
- const stack = _chunkQCEQIRJQcjs.layersFromLegacy.call(void 0, data, width, height);
8376
+ const stack = _chunkPI45JMP7cjs.layersFromLegacy.call(void 0, data, width, height);
8362
8377
  s.layers = stack.layers;
8363
8378
  s.outputOpacity = stack.outputOpacity;
8364
8379
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
8365
8380
  else delete s.legacyOutputBlur;
8366
8381
  s.crop = data.crop ? { ...data.crop } : null;
8367
8382
  s.transform = { ...data.transform };
8368
- s.activeLayerId = null;
8383
+ s.activeLayerId = _chunkPI45JMP7cjs.defaultActiveLayerId.call(void 0, s.layers);
8369
8384
  delete s.globalLight;
8370
8385
  delete s.patterns;
8371
8386
  delete s.bitDepth;
@@ -8379,7 +8394,7 @@ var ImageEditorController = (_class7 = class {
8379
8394
  }
8380
8395
  serializeState() {
8381
8396
  const { width, height } = this.naturalSize;
8382
- const view = _chunkQCEQIRJQcjs.legacyView.call(void 0, this.stack(), width, height, null);
8397
+ const view = _chunkPI45JMP7cjs.legacyView.call(void 0, this.stack(), width, height, null);
8383
8398
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _330 => _330.state, 'access', _331 => _331.patterns, 'optionalAccess', _332 => _332.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
8384
8399
  return {
8385
8400
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -8394,9 +8409,9 @@ var ImageEditorController = (_class7 = class {
8394
8409
  annotations: JSON.parse(JSON.stringify(view.annotations))
8395
8410
  };
8396
8411
  }
8397
- const { layers, assets, smartContents } = _chunkQCEQIRJQcjs.serializeLayers.call(void 0, this.state.layers);
8412
+ const { layers, assets, smartContents } = _chunkPI45JMP7cjs.serializeLayers.call(void 0, this.state.layers);
8398
8413
  const out = {
8399
- version: _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION,
8414
+ version: _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION,
8400
8415
  width,
8401
8416
  height,
8402
8417
  layers,
@@ -8408,7 +8423,7 @@ var ImageEditorController = (_class7 = class {
8408
8423
  };
8409
8424
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
8410
8425
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
8411
- if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkQCEQIRJQcjs.serializePatterns.call(void 0, this.state.patterns);
8426
+ if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkPI45JMP7cjs.serializePatterns.call(void 0, this.state.patterns);
8412
8427
  if (smartContents) out.smartContents = smartContents;
8413
8428
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
8414
8429
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -8420,7 +8435,7 @@ function serializeAdjustments(adjustments) {
8420
8435
  const out = { ...adjustments };
8421
8436
  if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
8422
8437
  else delete out.layers;
8423
- if (_chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkQCEQIRJQcjs.LEGACY_PROCESS_VERSION) {
8438
+ if (_chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, out.process) === _chunkPI45JMP7cjs.LEGACY_PROCESS_VERSION) {
8424
8439
  delete out.process;
8425
8440
  if (!out.tint) delete out.tint;
8426
8441
  }
@@ -8431,7 +8446,7 @@ function withDevelop(layer, partial) {
8431
8446
  let i = filters.findIndex((f) => f.kind === "develop");
8432
8447
  if (i === -1) {
8433
8448
  filters.unshift({
8434
- id: layer.source === "document" ? _chunkQCEQIRJQcjs.DEVELOP_FILTER_ID : _chunkQCEQIRJQcjs.newLayerId.call(void 0, "flt"),
8449
+ id: layer.source === "document" ? _chunkPI45JMP7cjs.DEVELOP_FILTER_ID : _chunkPI45JMP7cjs.newLayerId.call(void 0, "flt"),
8435
8450
  kind: "develop",
8436
8451
  enabled: true,
8437
8452
  brightness: 0,
@@ -8440,7 +8455,7 @@ function withDevelop(layer, partial) {
8440
8455
  exposure: 0,
8441
8456
  temperature: 0,
8442
8457
  tint: 0,
8443
- process: _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION
8458
+ process: _chunkPI45JMP7cjs.LATEST_PROCESS_VERSION
8444
8459
  });
8445
8460
  i = 0;
8446
8461
  }
@@ -8449,7 +8464,7 @@ function withDevelop(layer, partial) {
8449
8464
  const v = partial[k];
8450
8465
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
8451
8466
  }
8452
- if ("process" in partial) next.process = _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, partial.process);
8467
+ if ("process" in partial) next.process = _chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, partial.process);
8453
8468
  filters[i] = next;
8454
8469
  return { ...layer, filters };
8455
8470
  }
@@ -8458,7 +8473,7 @@ function withBlur(layer, radius) {
8458
8473
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
8459
8474
  if (radius > 0) {
8460
8475
  filters.push({
8461
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkQCEQIRJQcjs.BLUR_FILTER_ID : _chunkQCEQIRJQcjs.newLayerId.call(void 0, "flt")))),
8476
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkPI45JMP7cjs.BLUR_FILTER_ID : _chunkPI45JMP7cjs.newLayerId.call(void 0, "flt")))),
8462
8477
  kind: "blur",
8463
8478
  enabled: true,
8464
8479
  radius
@@ -8482,7 +8497,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8482
8497
  if (!update.mask) delete next.mask;
8483
8498
  else {
8484
8499
  const current = node.mask && !node.mask.source ? node.mask : null;
8485
- const memo = current ? _chunkQCEQIRJQcjs.legacyMaskOf.call(void 0, current, width, height) : null;
8500
+ const memo = current ? _chunkPI45JMP7cjs.legacyMaskOf.call(void 0, current, width, height) : null;
8486
8501
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
8487
8502
  next.mask = withMaskProps(current, {
8488
8503
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -8490,7 +8505,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8490
8505
  enabled: update.mask.enabled !== false
8491
8506
  });
8492
8507
  } else {
8493
- const m = _chunkQCEQIRJQcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8508
+ const m = _chunkPI45JMP7cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8494
8509
  if (m) next.mask = m;
8495
8510
  else delete next.mask;
8496
8511
  }
@@ -8529,7 +8544,7 @@ function resizeLegacyMasks(layers, from, to) {
8529
8544
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
8530
8545
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
8531
8546
  const old = l.mask;
8532
- const mask = _chunkQCEQIRJQcjs.rasterMaskFromLegacy.call(void 0, _chunkQCEQIRJQcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8547
+ const mask = _chunkPI45JMP7cjs.rasterMaskFromLegacy.call(void 0, _chunkPI45JMP7cjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8533
8548
  if (!mask) continue;
8534
8549
  out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
8535
8550
  }
@@ -8625,12 +8640,12 @@ function withoutAnnotations(layers) {
8625
8640
  function parseColor(value) {
8626
8641
  if (Array.isArray(value)) {
8627
8642
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
8628
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8643
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8629
8644
  }
8630
8645
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
8631
8646
  }
8632
8647
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
8633
- if (!m) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8648
+ if (!m) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8634
8649
  let hex = m[1];
8635
8650
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
8636
8651
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -8640,7 +8655,7 @@ function readImagePaint(raw) {
8640
8655
  try {
8641
8656
  return _chunkLRRCMRSLcjs.parsePaintSource.call(void 0, raw);
8642
8657
  } catch (e) {
8643
- if (e instanceof _chunkLRRCMRSLcjs.PaintSourceError) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(e.message);
8658
+ if (e instanceof _chunkLRRCMRSLcjs.PaintSourceError) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(e.message);
8644
8659
  throw e;
8645
8660
  }
8646
8661
  }
@@ -8677,6 +8692,49 @@ function scaleAnnotation(ann, sx, sy) {
8677
8692
  }
8678
8693
  }
8679
8694
 
8695
+ // src/image-editor/canvas-viewport.ts
8696
+ var DEFAULT_CANVAS_VIEWPORT = { width: 800, height: 500 };
8697
+ var MAX_CANVAS_BACKING_SIDE = 8192;
8698
+ var currentDevicePixelRatio = () => typeof window !== "undefined" && window.devicePixelRatio > 0 ? window.devicePixelRatio : 1;
8699
+ function measureCanvasViewport(el, devicePixelRatio = currentDevicePixelRatio(), fallback = DEFAULT_CANVAS_VIEWPORT) {
8700
+ const width = el.clientWidth || fallback.width;
8701
+ const height = el.clientHeight || fallback.height;
8702
+ const dpr = Number.isFinite(devicePixelRatio) && devicePixelRatio > 0 ? devicePixelRatio : 1;
8703
+ const box = el.getBoundingClientRect();
8704
+ const layoutW = el.offsetWidth || el.clientWidth;
8705
+ const layoutH = el.offsetHeight || el.clientHeight;
8706
+ const sx = layoutW > 0 && box.width > 0 ? box.width / layoutW : 1;
8707
+ const sy = layoutH > 0 && box.height > 0 ? box.height / layoutH : 1;
8708
+ let pixelRatio = dpr * Math.max(sx, sy);
8709
+ pixelRatio = Math.min(pixelRatio, MAX_CANVAS_BACKING_SIDE / Math.max(width, height));
8710
+ return { width, height, pixelRatio: Number.isFinite(pixelRatio) && pixelRatio > 0 ? pixelRatio : 1 };
8711
+ }
8712
+ function sameCanvasViewport(a, b) {
8713
+ return a.width === b.width && a.height === b.height && Math.abs(a.pixelRatio - b.pixelRatio) < 1e-3;
8714
+ }
8715
+ function watchCanvasViewport(el, onChange) {
8716
+ let last = measureCanvasViewport(el);
8717
+ const check = () => {
8718
+ const next = measureCanvasViewport(el);
8719
+ if (sameCanvasViewport(next, last)) return;
8720
+ last = next;
8721
+ onChange(next);
8722
+ };
8723
+ const stops = [];
8724
+ if (typeof ResizeObserver !== "undefined" && typeof Element !== "undefined" && el instanceof Element) {
8725
+ const observer = new ResizeObserver(check);
8726
+ observer.observe(el);
8727
+ stops.push(() => observer.disconnect());
8728
+ }
8729
+ if (typeof window !== "undefined" && typeof window.addEventListener === "function") {
8730
+ for (const type of ["resize", "transitionend", "animationend"]) {
8731
+ window.addEventListener(type, check, true);
8732
+ stops.push(() => window.removeEventListener(type, check, true));
8733
+ }
8734
+ }
8735
+ return () => stops.forEach((stop) => stop());
8736
+ }
8737
+
8680
8738
  // src/image-editor/document.ts
8681
8739
  var IMAGE_EDITOR_STATE_VERSION = 3;
8682
8740
  var imageEditorStateMigrations = {};
@@ -8788,7 +8846,7 @@ function loadImageEditorDocument(input) {
8788
8846
  // Optional: only present when something was selected when saving.
8789
8847
  selection: {
8790
8848
  parse: (value) => {
8791
- const mask = _chunkQCEQIRJQcjs.deserializeSelection.call(void 0, value);
8849
+ const mask = _chunkPI45JMP7cjs.deserializeSelection.call(void 0, value);
8792
8850
  const v = value;
8793
8851
  return { width: mask.width, height: mask.height, rle: v.rle };
8794
8852
  },
@@ -8876,7 +8934,7 @@ function loadLayeredDocument(doc) {
8876
8934
  },
8877
8935
  selection: {
8878
8936
  parse: (value) => {
8879
- const mask = _chunkQCEQIRJQcjs.deserializeSelection.call(void 0, value);
8937
+ const mask = _chunkPI45JMP7cjs.deserializeSelection.call(void 0, value);
8880
8938
  const v = value;
8881
8939
  return { width: mask.width, height: mask.height, rle: v.rle };
8882
8940
  },
@@ -9380,14 +9438,14 @@ function describeSelection(mask) {
9380
9438
  // src/image-editor/selection-tools.ts
9381
9439
  var modeSchema = {
9382
9440
  type: "string",
9383
- enum: [..._chunkQCEQIRJQcjs.SELECTION_MODES],
9441
+ enum: [..._chunkPI45JMP7cjs.SELECTION_MODES],
9384
9442
  description: "How the result combines with the current selection (default replace)."
9385
9443
  };
9386
9444
  var num2 = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
9387
9445
  function summary(controller) {
9388
9446
  const sel = controller.getSelection();
9389
9447
  const { width, height } = controller.getState().imageDimensions;
9390
- const area = _chunkQCEQIRJQcjs.selectionArea.call(void 0, sel);
9448
+ const area = _chunkPI45JMP7cjs.selectionArea.call(void 0, sel);
9391
9449
  return {
9392
9450
  empty: !sel,
9393
9451
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
@@ -9433,7 +9491,7 @@ function createImageSelectionTools(controller) {
9433
9491
  },
9434
9492
  annotations: writeAnnotations("Select a region", true),
9435
9493
  handler: ({ shape, x, y, width, height, mode, feather }) => {
9436
- const opts = { mode: _chunkQCEQIRJQcjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
9494
+ const opts = { mode: _chunkPI45JMP7cjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
9437
9495
  switch (shape) {
9438
9496
  case "all":
9439
9497
  controller.selectAll();
@@ -9486,7 +9544,7 @@ function createImageSelectionTools(controller) {
9486
9544
  annotations: writeAnnotations("Select by colour", true),
9487
9545
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
9488
9546
  const common = {
9489
- mode: _chunkQCEQIRJQcjs.parseSelectionMode.call(void 0, mode),
9547
+ mode: _chunkPI45JMP7cjs.parseSelectionMode.call(void 0, mode),
9490
9548
  sampleMerged: sampleMerged === true,
9491
9549
  sample: _nullishCoalesce(sample, () => ( "composite"))
9492
9550
  };
@@ -9507,7 +9565,7 @@ function createImageSelectionTools(controller) {
9507
9565
  inputSchema: {
9508
9566
  type: "object",
9509
9567
  properties: {
9510
- op: { type: "string", enum: [..._chunkQCEQIRJQcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9568
+ op: { type: "string", enum: [..._chunkPI45JMP7cjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9511
9569
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
9512
9570
  },
9513
9571
  required: ["op", "radius"],
@@ -9515,7 +9573,7 @@ function createImageSelectionTools(controller) {
9515
9573
  },
9516
9574
  annotations: writeAnnotations("Modify the selection"),
9517
9575
  handler: ({ op, radius }) => {
9518
- if (!_chunkQCEQIRJQcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9576
+ if (!_chunkPI45JMP7cjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9519
9577
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
9520
9578
  controller.modifySelection(op, Math.min(500, Math.max(0, num2(radius, 0))));
9521
9579
  return summary(controller);
@@ -9559,7 +9617,7 @@ function createImageSelectionTools(controller) {
9559
9617
  type: "object",
9560
9618
  properties: {
9561
9619
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
9562
- kind: { type: "string", enum: _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9620
+ kind: { type: "string", enum: _chunkPI45JMP7cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9563
9621
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
9564
9622
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
9565
9623
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -9579,11 +9637,11 @@ function createImageSelectionTools(controller) {
9579
9637
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
9580
9638
  controller.applySelectionAsLayerMask(layerId, props);
9581
9639
  id = layerId;
9582
- } else if (_chunkQCEQIRJQcjs.isAdjustmentKind.call(void 0, kind)) {
9640
+ } else if (_chunkPI45JMP7cjs.isAdjustmentKind.call(void 0, kind)) {
9583
9641
  id = controller.addAdjustmentLayer({
9584
9642
  kind,
9585
9643
  params,
9586
- mask: _chunkQCEQIRJQcjs.layerMaskFromSelection.call(void 0, sel, props)
9644
+ mask: _chunkPI45JMP7cjs.layerMaskFromSelection.call(void 0, sel, props)
9587
9645
  });
9588
9646
  } else {
9589
9647
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -9720,11 +9778,11 @@ function createImageEditTools(controller) {
9720
9778
  const geometry2 = () => {
9721
9779
  const s = controller.getState();
9722
9780
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
9723
- const out = _chunkQCEQIRJQcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9781
+ const out = _chunkPI45JMP7cjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9724
9782
  return {
9725
9783
  image: { ...s.imageDimensions },
9726
9784
  crop: s.crop ? { ...s.crop } : null,
9727
- rotation: _chunkQCEQIRJQcjs.normalizeAngle.call(void 0, s.transform.rotate),
9785
+ rotation: _chunkPI45JMP7cjs.normalizeAngle.call(void 0, s.transform.rotate),
9728
9786
  flipH: s.transform.flipH,
9729
9787
  flipV: s.transform.flipV,
9730
9788
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -9959,7 +10017,7 @@ function describeLayer(layer, activeId, boundsOf) {
9959
10017
  const out = {
9960
10018
  id: layer.id,
9961
10019
  type: layer.type,
9962
- name: layer.name || (layer.type === "adjustment" ? _chunkQCEQIRJQcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
10020
+ name: layer.name || (layer.type === "adjustment" ? _chunkPI45JMP7cjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9963
10021
  visible: layer.visible,
9964
10022
  opacity: round3(layer.opacity),
9965
10023
  blend: layer.blend,
@@ -10048,8 +10106,8 @@ function createImageLayerTools(controller) {
10048
10106
  };
10049
10107
  };
10050
10108
  const exists = (id, what = "layerId") => {
10051
- if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
10052
- _chunkQCEQIRJQcjs.requireLayer.call(void 0, controller.getLayers(), id);
10109
+ if (typeof id !== "string" || !id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
10110
+ _chunkPI45JMP7cjs.requireLayer.call(void 0, controller.getLayers(), id);
10053
10111
  return id;
10054
10112
  };
10055
10113
  const listLayers = {
@@ -10085,7 +10143,7 @@ function createImageLayerTools(controller) {
10085
10143
  handler: ({ layerId, target }) => {
10086
10144
  const id = exists(layerId);
10087
10145
  const layer = controller.getLayer(id);
10088
- if (target === "mask" && !layer.mask) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
10146
+ if (target === "mask" && !layer.mask) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
10089
10147
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
10090
10148
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
10091
10149
  }
@@ -10110,7 +10168,7 @@ function createImageLayerTools(controller) {
10110
10168
  },
10111
10169
  annotations: { title: "Add a pixel layer", ...WRITE2 },
10112
10170
  handler: async (args) => {
10113
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give color or image, not both.");
10171
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give color or image, not both.");
10114
10172
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
10115
10173
  const init = {
10116
10174
  name: args.name,
@@ -10140,13 +10198,13 @@ function createImageLayerTools(controller) {
10140
10198
  const remove = {
10141
10199
  name: "remove_layer",
10142
10200
  title: "Delete a layer",
10143
- description: "Deletes a layer (a group with its children). Refused for a layer locked with all. Prefer hiding it (set_layer_properties visible false) when it may be wanted back. One undo step. Returns the removed id and the remaining top-level ids.",
10201
+ description: "Deletes a layer (a group with its children). Refused for a layer locked with all. Prefer hiding it (set_layer_properties visible false) when it may be wanted back. Deleting the active layer makes the nearest paintable pixel layer below it active (else the topmost one). One undo step. Returns the removed id, the remaining top-level ids and the active layer id afterwards.",
10144
10202
  inputSchema: { type: "object", properties: { layerId: LAYER_ID2 }, required: ["layerId"], additionalProperties: false },
10145
10203
  annotations: { title: "Delete a layer", ...DESTRUCTIVE },
10146
10204
  handler: ({ layerId }) => {
10147
10205
  const id = exists(layerId);
10148
10206
  controller.removeLayer(id);
10149
- return { removed: id, layers: controller.getLayers().map((l) => l.id) };
10207
+ return { removed: id, layers: controller.getLayers().map((l) => l.id), activeLayerId: controller.getState().activeLayerId };
10150
10208
  }
10151
10209
  };
10152
10210
  const move = {
@@ -10200,7 +10258,7 @@ function createImageLayerTools(controller) {
10200
10258
  const id = exists(args.layerId);
10201
10259
  const props = {};
10202
10260
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
10203
- if (!Object.keys(props).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one property to change.");
10261
+ if (!Object.keys(props).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give at least one property to change.");
10204
10262
  controller.setLayerProperties(id, props);
10205
10263
  return { layer: describe(id) };
10206
10264
  }
@@ -10294,8 +10352,8 @@ function createImageLayerTools(controller) {
10294
10352
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
10295
10353
  handler: ({ layerId, x, y, dx, dy }) => {
10296
10354
  const id = exists(layerId);
10297
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give x and y, or dx and dy.");
10298
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10355
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give x and y, or dx and dy.");
10356
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10299
10357
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
10300
10358
  }
10301
10359
  };
@@ -10367,7 +10425,7 @@ function createImageLayerTools(controller) {
10367
10425
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
10368
10426
  handler: ({ layerId, density, feather, enabled, linked }) => {
10369
10427
  const id = exists(layerId);
10370
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give density, feather, enabled or linked.");
10428
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give density, feather, enabled or linked.");
10371
10429
  const mask = controller.setLayerMaskProps(id, {
10372
10430
  density,
10373
10431
  feather,
@@ -10450,7 +10508,7 @@ function createImageLayerTools(controller) {
10450
10508
  handler: (args) => {
10451
10509
  const id = exists(args.layerId);
10452
10510
  const changes = filterValues(args);
10453
- if (!Object.keys(changes).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one value to change.");
10511
+ if (!Object.keys(changes).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give at least one value to change.");
10454
10512
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
10455
10513
  }
10456
10514
  };
@@ -10714,8 +10772,8 @@ function describeLayerEffects(effects) {
10714
10772
  }
10715
10773
  function createImageEffectTools(controller) {
10716
10774
  const layerArg = (id) => {
10717
- if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10718
- _chunkQCEQIRJQcjs.requireLayer.call(void 0, controller.getLayers(), id);
10775
+ if (typeof id !== "string" || !id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10776
+ _chunkPI45JMP7cjs.requireLayer.call(void 0, controller.getLayers(), id);
10719
10777
  return id;
10720
10778
  };
10721
10779
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -10746,7 +10804,7 @@ function createImageEffectTools(controller) {
10746
10804
  annotations: { title: "Add a layer effect", ...WRITE3 },
10747
10805
  handler: ({ layerId, kind, settings, index }) => {
10748
10806
  const id = layerArg(layerId);
10749
- if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10807
+ if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10750
10808
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
10751
10809
  return result(id, { effectId: effect.id });
10752
10810
  }
@@ -10766,7 +10824,7 @@ function createImageEffectTools(controller) {
10766
10824
  handler: ({ layerId, effectId, settings }) => {
10767
10825
  const id = layerArg(layerId);
10768
10826
  const changes = _nullishCoalesce(settings, () => ( {}));
10769
- if (!Object.keys(changes).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one setting to change.");
10827
+ if (!Object.keys(changes).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give at least one setting to change.");
10770
10828
  controller.updateLayerEffect(id, effectId, changes);
10771
10829
  return result(id);
10772
10830
  }
@@ -10818,7 +10876,7 @@ function createImageEffectTools(controller) {
10818
10876
  },
10819
10877
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
10820
10878
  handler: ({ angle, altitude }) => {
10821
- if (angle === void 0 && altitude === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give angle, altitude or both.");
10879
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give angle, altitude or both.");
10822
10880
  const next = {};
10823
10881
  if (angle !== void 0) next.angle = angle;
10824
10882
  if (altitude !== void 0) next.altitude = altitude;
@@ -11031,7 +11089,7 @@ var PaintGesture = (_class8 = class {
11031
11089
  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.`);
11032
11090
  if (_optionalChain([layer, 'access', _370 => _370.locks, 'optionalAccess', _371 => _371.all]) || _optionalChain([layer, 'access', _372 => _372.locks, 'optionalAccess', _373 => _373.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
11033
11091
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
11034
- const b = _chunkQCEQIRJQcjs.shapeGeometryBounds.call(void 0, layer);
11092
+ const b = _chunkPI45JMP7cjs.shapeGeometryBounds.call(void 0, layer);
11035
11093
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
11036
11094
  })();
11037
11095
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -11047,7 +11105,7 @@ var PaintGesture = (_class8 = class {
11047
11105
  return null;
11048
11106
  }
11049
11107
  } catch (err) {
11050
- this.error = err instanceof Error ? err.message : String(err);
11108
+ this.error = _chunkPI45JMP7cjs.userErrorMessage.call(void 0, err);
11051
11109
  this.stroke = null;
11052
11110
  this.move = null;
11053
11111
  }
@@ -11069,7 +11127,7 @@ var PaintGesture = (_class8 = class {
11069
11127
  this.controller.offsetLayer(m.id, { x, y }, !m.moved);
11070
11128
  m.moved = true;
11071
11129
  } catch (err) {
11072
- this.error = err instanceof Error ? err.message : String(err);
11130
+ this.error = _chunkPI45JMP7cjs.userErrorMessage.call(void 0, err);
11073
11131
  this.move = null;
11074
11132
  }
11075
11133
  }
@@ -11079,7 +11137,7 @@ var PaintGesture = (_class8 = class {
11079
11137
  try {
11080
11138
  this.stroke.end();
11081
11139
  } catch (err) {
11082
- this.error = err instanceof Error ? err.message : String(err);
11140
+ this.error = _chunkPI45JMP7cjs.userErrorMessage.call(void 0, err);
11083
11141
  }
11084
11142
  }
11085
11143
  this.stroke = null;
@@ -11189,9 +11247,9 @@ function createImagePaintTools(controller) {
11189
11247
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
11190
11248
  handler: (args) => {
11191
11249
  const tool = args.tool;
11192
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11193
- if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11194
- if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give color or paint, not both.");
11250
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11251
+ if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11252
+ if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give color or paint, not both.");
11195
11253
  const result = controller.paintStroke({
11196
11254
  tool,
11197
11255
  points: args.points,
@@ -11322,7 +11380,7 @@ function profileArg(v) {
11322
11380
  try {
11323
11381
  return _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, s.slice(4));
11324
11382
  } catch (e30) {
11325
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("The icc: value is not valid base64.");
11383
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("The icc: value is not valid base64.");
11326
11384
  }
11327
11385
  }
11328
11386
  return s;
@@ -11387,10 +11445,10 @@ function createImageColorTools(controller) {
11387
11445
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11388
11446
  handler: (args) => {
11389
11447
  if (args.off === true) {
11390
- if (args.profile !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give either off true or a profile, not both.");
11448
+ if (args.profile !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give either off true or a profile, not both.");
11391
11449
  return controller.setProofSetup(null);
11392
11450
  }
11393
- if (args.profile === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11451
+ if (args.profile === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11394
11452
  const s = controller.setProofSetup({
11395
11453
  profile: profileArg(args.profile),
11396
11454
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -11442,7 +11500,7 @@ function createImageColorTools(controller) {
11442
11500
  },
11443
11501
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11444
11502
  handler: (args) => {
11445
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11503
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11446
11504
  return controller.setColorMode(args.mode, {
11447
11505
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
11448
11506
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -11507,7 +11565,7 @@ function checkSource(controller, source) {
11507
11565
  const p = source;
11508
11566
  const { width, height } = controller.getState().imageDimensions;
11509
11567
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
11510
- throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11568
+ throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11511
11569
  }
11512
11570
  return p;
11513
11571
  }
@@ -11747,10 +11805,10 @@ function createImageRetouchTools(controller) {
11747
11805
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
11748
11806
  handler: (args) => {
11749
11807
  if (args.clear === true) {
11750
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give either clear true or x and y, not both.");
11808
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give either clear true or x and y, not both.");
11751
11809
  return controller.setCloneSource(null);
11752
11810
  }
11753
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11811
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11754
11812
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
11755
11813
  }
11756
11814
  };
@@ -11773,7 +11831,7 @@ function createImageRetouchTools(controller) {
11773
11831
  annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
11774
11832
  handler: (args) => {
11775
11833
  if (args.reset === true) {
11776
- if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give either reset true or transform values, not both.");
11834
+ if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give either reset true or transform values, not both.");
11777
11835
  return controller.setCloneTransform(null);
11778
11836
  }
11779
11837
  const cur = controller.getState().paint.cloneTransform;
@@ -11783,7 +11841,7 @@ function createImageRetouchTools(controller) {
11783
11841
  if (args.rotate !== void 0) next.rotate = args.rotate;
11784
11842
  if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
11785
11843
  if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
11786
- if (!Object.keys(next).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
11844
+ if (!Object.keys(next).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
11787
11845
  return controller.setCloneTransform(next);
11788
11846
  }
11789
11847
  };
@@ -11804,11 +11862,11 @@ var DATA = {
11804
11862
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
11805
11863
  };
11806
11864
  function psdBytesFromBase64(data) {
11807
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunkQCEQIRJQcjs.PsdError)("data is required: the PSD file as base64.");
11865
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkPI45JMP7cjs.PsdError)("data is required: the PSD file as base64.");
11808
11866
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
11809
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkQCEQIRJQcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11867
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkPI45JMP7cjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11810
11868
  const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, body);
11811
- if (bytes.length < 26) throw new (0, _chunkQCEQIRJQcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11869
+ if (bytes.length < 26) throw new (0, _chunkPI45JMP7cjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11812
11870
  return bytes;
11813
11871
  }
11814
11872
  function createImagePsdTools(controller) {
@@ -11819,7 +11877,7 @@ function createImagePsdTools(controller) {
11819
11877
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
11820
11878
  annotations: { title: "Inspect a PSD", ...READ7 },
11821
11879
  handler: ({ data }) => {
11822
- const res = _chunkQCEQIRJQcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11880
+ const res = _chunkPI45JMP7cjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11823
11881
  return {
11824
11882
  width: res.width,
11825
11883
  height: res.height,
@@ -11906,7 +11964,7 @@ var GEOMETRY = {
11906
11964
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
11907
11965
  reference: {
11908
11966
  description: "Fixed point of scale, skew and rotate: an anchor of the frame (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right; default center) or a document point {x, y}.",
11909
- anyOf: [{ type: "string", enum: _chunkQCEQIRJQcjs.TRANSFORM_ANCHORS }, POINT]
11967
+ anyOf: [{ type: "string", enum: _chunkPI45JMP7cjs.TRANSFORM_ANCHORS }, POINT]
11910
11968
  },
11911
11969
  matrix: {
11912
11970
  type: "array",
@@ -11927,14 +11985,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
11927
11985
  function geometryFrom(args) {
11928
11986
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
11929
11987
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
11930
- if (ways === 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11931
- if (ways > 1) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11988
+ if (ways === 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11989
+ if (ways > 1) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11932
11990
  if (args.matrix !== void 0) return { matrix: args.matrix };
11933
11991
  if (args.corners !== void 0) return { corners: args.corners };
11934
11992
  const params = {};
11935
11993
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
11936
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11937
- if (typeof params.reference === "string" && !_chunkQCEQIRJQcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkQCEQIRJQcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11994
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11995
+ if (typeof params.reference === "string" && !_chunkPI45JMP7cjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkPI45JMP7cjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11938
11996
  return { params };
11939
11997
  }
11940
11998
  function targetFrom(args) {
@@ -11983,7 +12041,7 @@ function createImageTransformTools(controller) {
11983
12041
  moved: [...s.moves],
11984
12042
  frame: { ...s.box },
11985
12043
  corners: s.startGeometry.corners.map(roundPoint),
11986
- center: roundPoint(_chunkQCEQIRJQcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
12044
+ center: roundPoint(_chunkPI45JMP7cjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11987
12045
  };
11988
12046
  if (s.smartObject) out.smartObject = true;
11989
12047
  s.cancel();
@@ -12038,11 +12096,11 @@ function createImageTransformTools(controller) {
12038
12096
  annotations: { title: "Warp a layer", ...WRITE6 },
12039
12097
  handler: (args) => {
12040
12098
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
12041
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
12042
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give a preset style or a mesh.");
12099
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
12100
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give a preset style or a mesh.");
12043
12101
  let warp;
12044
12102
  if (hasPreset) {
12045
- if (args.style === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
12103
+ if (args.style === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkRHXW4TA5cjs.WARP_STYLES.join(", ")}.`);
12046
12104
  warp = {
12047
12105
  style: args.style,
12048
12106
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -12053,7 +12111,7 @@ function createImageTransformTools(controller) {
12053
12111
  } else {
12054
12112
  const m = args.mesh;
12055
12113
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12056
- if (m.points.length !== want) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12114
+ if (m.points.length !== want) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12057
12115
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12058
12116
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12059
12117
  }
@@ -12148,13 +12206,13 @@ function settingsFrom(args) {
12148
12206
  return out;
12149
12207
  }
12150
12208
  function imageArg(image) {
12151
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12209
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12152
12210
  return image.trim();
12153
12211
  }
12154
12212
  function createImageSmartObjectTools(controller) {
12155
12213
  const smartId = (id) => {
12156
- if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12157
- _chunkQCEQIRJQcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12214
+ if (typeof id !== "string" || !id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12215
+ _chunkPI45JMP7cjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12158
12216
  return id;
12159
12217
  };
12160
12218
  const info = (id) => {
@@ -12191,7 +12249,7 @@ function createImageSmartObjectTools(controller) {
12191
12249
  },
12192
12250
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
12193
12251
  handler: ({ layerIds, name }) => {
12194
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkQCEQIRJQcjs.requireLayer.call(void 0, controller.getLayers(), id2);
12252
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkPI45JMP7cjs.requireLayer.call(void 0, controller.getLayers(), id2);
12195
12253
  const id = controller.convertToSmartObject(layerIds, { name });
12196
12254
  return { layer: layerSummary(id), smartObject: info(id) };
12197
12255
  }
@@ -12264,12 +12322,12 @@ function createImageSmartObjectTools(controller) {
12264
12322
  else if (w) {
12265
12323
  const m = w;
12266
12324
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12267
- if (m.points.length !== want) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12325
+ if (m.points.length !== want) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12268
12326
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12269
12327
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12270
12328
  }
12271
12329
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
12272
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12330
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12273
12331
  const res = controller.setSmartObjectTransform(id, {
12274
12332
  corners: args.corners,
12275
12333
  matrix: args.matrix,
@@ -12394,7 +12452,7 @@ function createImageSmartObjectTools(controller) {
12394
12452
  handler: (args) => {
12395
12453
  const id = smartId(args.layerId);
12396
12454
  const changes = settingsFrom(args);
12397
- if (!Object.keys(changes).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give at least one value to change.");
12455
+ if (!Object.keys(changes).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give at least one value to change.");
12398
12456
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
12399
12457
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
12400
12458
  }
@@ -12715,8 +12773,8 @@ function geometry(args) {
12715
12773
  }
12716
12774
  function createImageShapeTools(controller) {
12717
12775
  const shapeId = (id) => {
12718
- if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12719
- _chunkQCEQIRJQcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12776
+ if (typeof id !== "string" || !id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12777
+ _chunkPI45JMP7cjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12720
12778
  return id;
12721
12779
  };
12722
12780
  const layerSummary = (id) => {
@@ -12791,7 +12849,7 @@ function createImageShapeTools(controller) {
12791
12849
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
12792
12850
  handler: ({ layerId, fill, stroke, fillRule }) => {
12793
12851
  const id = shapeId(layerId);
12794
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12852
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12795
12853
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
12796
12854
  }
12797
12855
  };
@@ -12840,7 +12898,7 @@ function createImageShapeTools(controller) {
12840
12898
  handler: ({ layerId, componentIndex, ...rest }) => {
12841
12899
  const id = shapeId(layerId);
12842
12900
  const change = geometry(rest);
12843
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("Give shape, subpaths or op to change.");
12901
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("Give shape, subpaths or op to change.");
12844
12902
  return controller.setShapeComponent(id, componentIndex, change);
12845
12903
  }
12846
12904
  };
@@ -12914,8 +12972,8 @@ function pick2(args, keys) {
12914
12972
  }
12915
12973
  function createImageTypeTools(controller) {
12916
12974
  const typeId = (id) => {
12917
- if (typeof id !== "string" || !id) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12918
- _chunkQCEQIRJQcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12975
+ if (typeof id !== "string" || !id) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12976
+ _chunkPI45JMP7cjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12919
12977
  return id;
12920
12978
  };
12921
12979
  const layerSummary = (id) => {
@@ -12995,7 +13053,7 @@ function createImageTypeTools(controller) {
12995
13053
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
12996
13054
  handler: (args) => {
12997
13055
  const style = pick2(args, Object.keys(STYLE));
12998
- if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
13056
+ if (!Object.keys(style).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12999
13057
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
13000
13058
  }
13001
13059
  };
@@ -13007,7 +13065,7 @@ function createImageTypeTools(controller) {
13007
13065
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
13008
13066
  handler: (args) => {
13009
13067
  const style = pick2(args, Object.keys(PARAGRAPH));
13010
- if (!Object.keys(style).length) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
13068
+ if (!Object.keys(style).length) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
13011
13069
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
13012
13070
  }
13013
13071
  };
@@ -13029,7 +13087,7 @@ function createImageTypeTools(controller) {
13029
13087
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
13030
13088
  handler: ({ layerId, kind, width, height }) => {
13031
13089
  const id = typeId(layerId);
13032
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkQCEQIRJQcjs.LayerOperationError)("kind box needs width and height in pixels.");
13090
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkPI45JMP7cjs.LayerOperationError)("kind box needs width and height in pixels.");
13033
13091
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
13034
13092
  }
13035
13093
  };
@@ -13051,7 +13109,7 @@ function createImageTypeTools(controller) {
13051
13109
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
13052
13110
  function adjustmentsSummary(adjustments) {
13053
13111
  return {
13054
- process: _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, adjustments.process),
13112
+ process: _chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, adjustments.process),
13055
13113
  values: readAdjustmentControls(adjustments),
13056
13114
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
13057
13115
  };
@@ -13094,7 +13152,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13094
13152
  default: def,
13095
13153
  ...requiresProcess ? { requiresProcess } : {}
13096
13154
  })),
13097
- layerKinds: _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
13155
+ layerKinds: _chunkPI45JMP7cjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
13098
13156
  kind,
13099
13157
  label,
13100
13158
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -13180,7 +13238,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13180
13238
  const result = { applied, clamped };
13181
13239
  if (typeof label === "string" && label) result.label = label;
13182
13240
  const notes = [];
13183
- if ("tint" in applied && _chunkQCEQIRJQcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13241
+ if ("tint" in applied && _chunkPI45JMP7cjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13184
13242
  notes.push("Tint has no effect on process 1 edits.");
13185
13243
  }
13186
13244
  if (notes.length) result.notes = notes;
@@ -13190,11 +13248,11 @@ function createImageEditorToolProvider(controller, options = {}) {
13190
13248
  const addLayer = {
13191
13249
  name: "add_adjustment_layer",
13192
13250
  title: "Add an adjustment layer",
13193
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13251
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkPI45JMP7cjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13194
13252
  inputSchema: {
13195
13253
  type: "object",
13196
13254
  properties: {
13197
- kind: { type: "string", enum: _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13255
+ kind: { type: "string", enum: _chunkPI45JMP7cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13198
13256
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
13199
13257
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
13200
13258
  blend: { type: "string", enum: _chunkCWM3CUUXcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -13213,7 +13271,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13213
13271
  openWorldHint: false
13214
13272
  },
13215
13273
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
13216
- if (!_chunkQCEQIRJQcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13274
+ if (!_chunkPI45JMP7cjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13217
13275
  if (blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
13218
13276
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
13219
13277
  for (const ref of [aboveId, parentId]) {
@@ -13310,7 +13368,7 @@ function boxToCurvePoint(x, y, width, height) {
13310
13368
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
13311
13369
  }
13312
13370
  function curveSvgPath(points, width, height, samples = 64) {
13313
- const lut = _chunkQCEQIRJQcjs.curveLutFromLevels.call(void 0, points);
13371
+ const lut = _chunkPI45JMP7cjs.curveLutFromLevels.call(void 0, points);
13314
13372
  const n = lut.length - 1;
13315
13373
  let d = "";
13316
13374
  for (let i = 0; i <= samples; i++) {
@@ -13924,7 +13982,7 @@ var TextEditSession = (_class11 = class {
13924
13982
  overlay() {
13925
13983
  const layer = this.layer;
13926
13984
  const layout = this.layout();
13927
- const m = _chunkQCEQIRJQcjs.textMatrix.call(void 0, layer);
13985
+ const m = _chunkPI45JMP7cjs.textMatrix.call(void 0, layer);
13928
13986
  const at = (x, y) => _chunkRHXW4TA5cjs.applyMatrix.call(void 0, m, { x, y });
13929
13987
  let frame = null;
13930
13988
  if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
@@ -13960,7 +14018,7 @@ var TextEditSession = (_class11 = class {
13960
14018
  }
13961
14019
  if (this.layer.name === "Text" && this.changed) {
13962
14020
  try {
13963
- this.controller.setLayerProperties(this.layerId, { name: _chunkQCEQIRJQcjs.typeLayerName.call(void 0, this.text) }, false);
14021
+ this.controller.setLayerProperties(this.layerId, { name: _chunkPI45JMP7cjs.typeLayerName.call(void 0, this.text) }, false);
13964
14022
  } catch (e32) {
13965
14023
  }
13966
14024
  }
@@ -13971,7 +14029,7 @@ function typeLayerAt(controller, p, slop = 4) {
13971
14029
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
13972
14030
  for (const l of layers) {
13973
14031
  if (!l.visible) continue;
13974
- const inv = invert(_chunkQCEQIRJQcjs.textMatrix.call(void 0, l));
14032
+ const inv = invert(_chunkPI45JMP7cjs.textMatrix.call(void 0, l));
13975
14033
  const q = _chunkRHXW4TA5cjs.applyMatrix.call(void 0, inv, p);
13976
14034
  let b = null;
13977
14035
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
@@ -14082,7 +14140,7 @@ function layerPanelRows(layers, activeId) {
14082
14140
  }
14083
14141
  function layerLabel(layer) {
14084
14142
  if (layer.name) return layer.name;
14085
- if (layer.type === "adjustment") return _chunkQCEQIRJQcjs.adjustmentKindLabel.call(void 0, layer.kind);
14143
+ if (layer.type === "adjustment") return _chunkPI45JMP7cjs.adjustmentKindLabel.call(void 0, layer.kind);
14086
14144
  return layer.type === "group" ? "Group" : "Layer";
14087
14145
  }
14088
14146
  function layerBadge(layer) {
@@ -14996,7 +15054,7 @@ var FreeTransformTool = (_class13 = class {
14996
15054
  bar() {
14997
15055
  const s = this.session;
14998
15056
  if (!s || !this.corners) return null;
14999
- const read = _chunkQCEQIRJQcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
15057
+ const read = _chunkPI45JMP7cjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
15000
15058
  return {
15001
15059
  affine: read.affine,
15002
15060
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -15021,7 +15079,7 @@ var FreeTransformTool = (_class13 = class {
15021
15079
  this.changed();
15022
15080
  return;
15023
15081
  }
15024
- const m = _chunkQCEQIRJQcjs.matrixFromParams.call(void 0, s.box, {
15082
+ const m = _chunkPI45JMP7cjs.matrixFromParams.call(void 0, s.box, {
15025
15083
  scaleX: next.scaleX,
15026
15084
  scaleY: next.scaleY,
15027
15085
  rotate: next.rotate,
@@ -15031,7 +15089,7 @@ var FreeTransformTool = (_class13 = class {
15031
15089
  dx: next.x - this.refBox.x,
15032
15090
  dy: next.y - this.refBox.y
15033
15091
  });
15034
- this.setCorners(_chunkQCEQIRJQcjs.cornersFromMatrix.call(void 0, s.box, m));
15092
+ this.setCorners(_chunkPI45JMP7cjs.cornersFromMatrix.call(void 0, s.box, m));
15035
15093
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
15036
15094
  this.changed();
15037
15095
  }
@@ -16149,4 +16207,13 @@ function createImageEffectsToolProvider(controller, options = {}) {
16149
16207
 
16150
16208
 
16151
16209
 
16152
- exports.ADJUSTMENT_KEYS = _chunkQCEQIRJQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkQCEQIRJQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkQCEQIRJQcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkQCEQIRJQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkQCEQIRJQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkQCEQIRJQcjs.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 = _chunkQCEQIRJQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.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 = _chunkLRRCMRSLcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkLRRCMRSLcjs.CoverageMap; exports.D50 = _chunkQCEQIRJQcjs.D50; exports.D65 = _chunkQCEQIRJQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkRHXW4TA5cjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkLRRCMRSLcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkLRRCMRSLcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkQCEQIRJQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkLRRCMRSLcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk6FUAHCVIcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkLRRCMRSLcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkQCEQIRJQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkLRRCMRSLcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkQCEQIRJQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkLRRCMRSLcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkQCEQIRJQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkLRRCMRSLcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkLRRCMRSLcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkQCEQIRJQcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkQCEQIRJQcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkQCEQIRJQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkQCEQIRJQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkQCEQIRJQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkQCEQIRJQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkQCEQIRJQcjs.LUMA_709; exports.LayerCompositor = _chunkQCEQIRJQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkQCEQIRJQcjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkLRRCMRSLcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkQCEQIRJQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkQCEQIRJQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkQCEQIRJQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkLRRCMRSLcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkLRRCMRSLcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkLRRCMRSLcjs.MIXING_MODELS; exports.MixerStroke = _chunkLRRCMRSLcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkLRRCMRSLcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkLRRCMRSLcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkQCEQIRJQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkQCEQIRJQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkQCEQIRJQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkLRRCMRSLcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkLRRCMRSLcjs.PaintGradientSampler; exports.PaintSourceError = _chunkLRRCMRSLcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkLRRCMRSLcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkQCEQIRJQcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk6FUAHCVIcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk6FUAHCVIcjs.RegionPixelSource; exports.RetouchDabStroke = _chunk6FUAHCVIcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkQCEQIRJQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkQCEQIRJQcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkQCEQIRJQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkQCEQIRJQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkQCEQIRJQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk6FUAHCVIcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkQCEQIRJQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkLRRCMRSLcjs.SmudgeTip; exports.StrokeCoverage = _chunkLRRCMRSLcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkQCEQIRJQcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkQCEQIRJQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkQCEQIRJQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkQCEQIRJQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkLRRCMRSLcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkQCEQIRJQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk6FUAHCVIcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkQCEQIRJQcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkLRRCMRSLcjs.TileMedium; exports.TilePixelSource = _chunk6FUAHCVIcjs.TilePixelSource; exports.TileableNoise = _chunkLRRCMRSLcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk6FUAHCVIcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunkQCEQIRJQcjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkRHXW4TA5cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkRHXW4TA5cjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkQCEQIRJQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkQCEQIRJQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkQCEQIRJQcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkQCEQIRJQcjs.activeSmartFilters; exports.addLayerEffect = _chunkQCEQIRJQcjs.addLayerEffect; exports.addLayerFilter = _chunkQCEQIRJQcjs.addLayerFilter; exports.addPaintGradientStop = _chunkLRRCMRSLcjs.addPaintGradientStop; exports.addSmartFilter = _chunkQCEQIRJQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkQCEQIRJQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkQCEQIRJQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkQCEQIRJQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkQCEQIRJQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkQCEQIRJQcjs.anchorPoint; exports.annotationBlend = _chunkQCEQIRJQcjs.annotationBlend; exports.annotationLayerFor = _chunkQCEQIRJQcjs.annotationLayerFor; exports.annotationLayerName = _chunkQCEQIRJQcjs.annotationLayerName; exports.annotationOfLayer = _chunkQCEQIRJQcjs.annotationOfLayer; exports.annotationOfShape = _chunkQCEQIRJQcjs.annotationOfShape; exports.annotationOfType = _chunkQCEQIRJQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkQCEQIRJQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkQCEQIRJQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkQCEQIRJQcjs.applyAdjustments; exports.applyBoxBlur = _chunkQCEQIRJQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkQCEQIRJQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkQCEQIRJQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkQCEQIRJQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkQCEQIRJQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkQCEQIRJQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkQCEQIRJQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkQCEQIRJQcjs.applyParams; exports.applyProcess2Adjustments = _chunkQCEQIRJQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkQCEQIRJQcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk6FUAHCVIcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkQCEQIRJQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkLRRCMRSLcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkLRRCMRSLcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk6FUAHCVIcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkQCEQIRJQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk6FUAHCVIcjs.bestOffset; exports.blackWhiteGray = _chunkQCEQIRJQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkLRRCMRSLcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkLRRCMRSLcjs.blenderDab; exports.blurFilter = _chunkQCEQIRJQcjs.blurFilter; exports.borderCoverage = _chunkQCEQIRJQcjs.borderCoverage; exports.boxBlurPixels = _chunk6FUAHCVIcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkQCEQIRJQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkQCEQIRJQcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkLRRCMRSLcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkLRRCMRSLcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkLRRCMRSLcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkLRRCMRSLcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkLRRCMRSLcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkQCEQIRJQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkQCEQIRJQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkQCEQIRJQcjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkQCEQIRJQcjs.canvasToImagePoint; exports.caretAt = _chunkRHXW4TA5cjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkQCEQIRJQcjs.clampCropToImage; exports.cleanMixer = _chunkLRRCMRSLcjs.cleanMixer; exports.cloneSamplePoint = _chunk6FUAHCVIcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkQCEQIRJQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkQCEQIRJQcjs.combineSelections; exports.compileAdjustmentLayer = _chunkQCEQIRJQcjs.compileAdjustmentLayer; exports.componentPath = _chunkQCEQIRJQcjs.componentPath; exports.compositeDeep = _chunkQCEQIRJQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkQCEQIRJQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk6FUAHCVIcjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkQCEQIRJQcjs.contentsBox; exports.contentsSurface = _chunkQCEQIRJQcjs.contentsSurface; exports.contractCoverage = _chunkQCEQIRJQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkQCEQIRJQcjs.convertToSmartObject; exports.copySmartObject = _chunkQCEQIRJQcjs.copySmartObject; exports.cornersFromMatrix = _chunkQCEQIRJQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkLRRCMRSLcjs.coverageTileCoord; exports.coverageToByte = _chunkQCEQIRJQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkQCEQIRJQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkLRRCMRSLcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkRHXW4TA5cjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; 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.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkRHXW4TA5cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkRHXW4TA5cjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunkQCEQIRJQcjs.createSelectionMask; exports.createShapeLayer = _chunkQCEQIRJQcjs.createShapeLayer; exports.createTypeLayer = _chunkQCEQIRJQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkRHXW4TA5cjs.cssFont; exports.cssFontFamily = _chunkRHXW4TA5cjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkQCEQIRJQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkLRRCMRSLcjs.dabCoverage; exports.dabRect = _chunkLRRCMRSLcjs.dabRect; exports.decodeDeepSurface = _chunkQCEQIRJQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkQCEQIRJQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkQCEQIRJQcjs.decodeLayerMask; exports.decodeMergedImage = _chunkQCEQIRJQcjs.decodeMergedImage; exports.decodePlanes = _chunkQCEQIRJQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkQCEQIRJQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkQCEQIRJQcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultAdjustmentParams = _chunkQCEQIRJQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkQCEQIRJQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkQCEQIRJQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkQCEQIRJQcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkQCEQIRJQcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkQCEQIRJQcjs.deserializeEffects; exports.deserializeLayer = _chunkQCEQIRJQcjs.deserializeLayer; exports.deserializeLayers = _chunkQCEQIRJQcjs.deserializeLayers; exports.deserializePatterns = _chunkQCEQIRJQcjs.deserializePatterns; exports.deserializeSelection = _chunkQCEQIRJQcjs.deserializeSelection; exports.developFilter = _chunkQCEQIRJQcjs.developFilter; exports.developFromAdjustments = _chunkQCEQIRJQcjs.developFromAdjustments; exports.developTarget = _chunkQCEQIRJQcjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk6FUAHCVIcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkQCEQIRJQcjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunkQCEQIRJQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk6FUAHCVIcjs.dodgeBurn; exports.dodgeBurnCurve = _chunk6FUAHCVIcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkRHXW4TA5cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunkQCEQIRJQcjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkQCEQIRJQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkQCEQIRJQcjs.encodeRle; exports.encodeSelectionRle = _chunkQCEQIRJQcjs.encodeSelectionRle; exports.encodeSurface = _chunkQCEQIRJQcjs.encodeSurface; exports.evalWarpMesh = _chunkRHXW4TA5cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkQCEQIRJQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkLRRCMRSLcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunkQCEQIRJQcjs.expandCoverage; exports.exportPsd = _chunkQCEQIRJQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkQCEQIRJQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunkQCEQIRJQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkRHXW4TA5cjs.fitParagraphRuns; exports.fitRuns = _chunkRHXW4TA5cjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkQCEQIRJQcjs.flattenPath; exports.flipCorners = _chunkQCEQIRJQcjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkRHXW4TA5cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkQCEQIRJQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkQCEQIRJQcjs.geometryHomography; exports.getAnnotationBounds = _chunkQCEQIRJQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkQCEQIRJQcjs.getCropCursor; exports.getRotatedSize = _chunkQCEQIRJQcjs.getRotatedSize; exports.getViewportMetrics = _chunkQCEQIRJQcjs.getViewportMetrics; exports.getViewportProjection = _chunkQCEQIRJQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkLRRCMRSLcjs.gradientDabColor; exports.grainCatch = _chunkLRRCMRSLcjs.grainCatch; exports.grainHeights = _chunkLRRCMRSLcjs.grainHeights; exports.greyMorphology = _chunkQCEQIRJQcjs.greyMorphology; exports.groupLayers = _chunkQCEQIRJQcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkQCEQIRJQcjs.hasResampledLegacyMask; exports.hasSurface = _chunkQCEQIRJQcjs.hasSurface; exports.hasWarp = _chunkQCEQIRJQcjs.hasWarp; exports.hash2 = _chunkLRRCMRSLcjs.hash2; exports.hashMaskContent = _chunkQCEQIRJQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk6FUAHCVIcjs.healPixels; exports.hexToPaintRgb = _chunkLRRCMRSLcjs.hexToPaintRgb; exports.hexToRgb = _chunkQCEQIRJQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkQCEQIRJQcjs.hitTestAnnotation; exports.hitTestCrop = _chunkQCEQIRJQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkQCEQIRJQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkQCEQIRJQcjs.hueRangeTables; exports.hueRangeWeight = _chunkQCEQIRJQcjs.hueRangeWeight; exports.hueSaturation = _chunkQCEQIRJQcjs.hueSaturation; exports.identityCurve = _chunkQCEQIRJQcjs.identityCurve; exports.identityLevels = _chunkQCEQIRJQcjs.identityLevels; exports.identityTransform = _chunkQCEQIRJQcjs.identityTransform; exports.identityWarpMesh = _chunkRHXW4TA5cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkQCEQIRJQcjs.imageToCanvasPoint; exports.importPsd = _chunkQCEQIRJQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkQCEQIRJQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkQCEQIRJQcjs.invertMatrix3; exports.invertSelection = _chunkQCEQIRJQcjs.invertSelection; exports.isActiveFilter = _chunkQCEQIRJQcjs.isActiveFilter; exports.isAdjustmentKind = _chunkQCEQIRJQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkLRRCMRSLcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkQCEQIRJQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkQCEQIRJQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkLRRCMRSLcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk6FUAHCVIcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkQCEQIRJQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkQCEQIRJQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkQCEQIRJQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkQCEQIRJQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkQCEQIRJQcjs.isSelectionEmpty; exports.isSelectionMode = _chunkQCEQIRJQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkQCEQIRJQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkQCEQIRJQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkQCEQIRJQcjs.isTransformAnchor; exports.isValidWarp = _chunkQCEQIRJQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkQCEQIRJQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkQCEQIRJQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkQCEQIRJQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkQCEQIRJQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkQCEQIRJQcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkQCEQIRJQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkQCEQIRJQcjs.layerTree; exports.layerTypeLabel = _chunkQCEQIRJQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkQCEQIRJQcjs.layersFromLegacy; exports.layoutText = _chunkRHXW4TA5cjs.layoutText; exports.legacyAdjustmentLayer = _chunkQCEQIRJQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkQCEQIRJQcjs.legacyMaskOf; exports.legacyView = _chunkQCEQIRJQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkQCEQIRJQcjs.levelsValue; exports.linearSrgbToXy = _chunkQCEQIRJQcjs.linearSrgbToXy; exports.linearToSrgb = _chunkQCEQIRJQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunkQCEQIRJQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkQCEQIRJQcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkLRRCMRSLcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk6FUAHCVIcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkQCEQIRJQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkQCEQIRJQcjs.mapSubpaths; exports.maskBounds = _chunk6FUAHCVIcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkQCEQIRJQcjs.matrixFromCorners; exports.matrixFromParams = _chunkQCEQIRJQcjs.matrixFromParams; exports.membraneFill = _chunk6FUAHCVIcjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkQCEQIRJQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkLRRCMRSLcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkLRRCMRSLcjs.mixerRates; exports.modifySelection = _chunkQCEQIRJQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkQCEQIRJQcjs.moveLayer; exports.moveSmartFilter = _chunkQCEQIRJQcjs.moveSmartFilter; exports.mulMatrix3 = _chunkQCEQIRJQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkQCEQIRJQcjs.neutralHueRange; exports.newContentsId = _chunkQCEQIRJQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkQCEQIRJQcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkQCEQIRJQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkQCEQIRJQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkQCEQIRJQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkLRRCMRSLcjs.normalizeBlender; exports.normalizeBrush = _chunkLRRCMRSLcjs.normalizeBrush; exports.normalizeFilter = _chunkQCEQIRJQcjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkLRRCMRSLcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkQCEQIRJQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkQCEQIRJQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkLRRCMRSLcjs.normalizeMixer; exports.normalizePlacement = _chunkQCEQIRJQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkQCEQIRJQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk6FUAHCVIcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkQCEQIRJQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkQCEQIRJQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkQCEQIRJQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkLRRCMRSLcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkQCEQIRJQcjs.normalizeSubpaths; exports.normalizeText = _chunkQCEQIRJQcjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunkQCEQIRJQcjs.offsetLayer; exports.offsetShape = _chunkQCEQIRJQcjs.offsetShape; exports.offsetSmartObject = _chunkQCEQIRJQcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkLRRCMRSLcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkLRRCMRSLcjs.paintPathStroke; exports.paintSourceColor = _chunkLRRCMRSLcjs.paintSourceColor; exports.paintSourceCss = _chunkLRRCMRSLcjs.paintSourceCss; exports.paragraphRanges = _chunkRHXW4TA5cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkQCEQIRJQcjs.parseAdjustmentBlock; exports.parseBlend = _chunkQCEQIRJQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkQCEQIRJQcjs.parseLfx2; exports.parseLrfx = _chunkQCEQIRJQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkLRRCMRSLcjs.parsePaintSource; exports.parsePatternBlock = _chunkQCEQIRJQcjs.parsePatternBlock; exports.parseSelectionMode = _chunkQCEQIRJQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkQCEQIRJQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkQCEQIRJQcjs.patchParagraphStyle; exports.patchTextStyle = _chunkQCEQIRJQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkLRRCMRSLcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkLRRCMRSLcjs.pathStrokeDabs; exports.perDabStrength = _chunk6FUAHCVIcjs.perDabStrength; exports.photoFilterMatrix = _chunkQCEQIRJQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunkQCEQIRJQcjs.pixelLayerBounds; exports.pixelLayers = _chunkQCEQIRJQcjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunkQCEQIRJQcjs.placeContents; exports.placeLayer = _chunkQCEQIRJQcjs.placeLayer; exports.placementAt = _chunkQCEQIRJQcjs.placementAt; exports.placementBounds = _chunkQCEQIRJQcjs.placementBounds; exports.placementGeometry = _chunkQCEQIRJQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkQCEQIRJQcjs.posterizeValue; exports.presetWarp = _chunkQCEQIRJQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkQCEQIRJQcjs.projectImagePoint; exports.projectImageRect = _chunkQCEQIRJQcjs.projectImageRect; exports.projectMaskCoverage = _chunkQCEQIRJQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkQCEQIRJQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkQCEQIRJQcjs.psdToLayers; exports.pullWarpMesh = _chunkRHXW4TA5cjs.pullWarpMesh; exports.put255 = _chunkLRRCMRSLcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkLRRCMRSLcjs.rand01; exports.randSigned = _chunkLRRCMRSLcjs.randSigned; exports.rangeLightness = _chunkQCEQIRJQcjs.rangeLightness; exports.rasterContents = _chunkQCEQIRJQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkQCEQIRJQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkQCEQIRJQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkLRRCMRSLcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkQCEQIRJQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkLRRCMRSLcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkQCEQIRJQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk6FUAHCVIcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkQCEQIRJQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkQCEQIRJQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkQCEQIRJQcjs.removeLayer; exports.removeLayerEffect = _chunkQCEQIRJQcjs.removeLayerEffect; exports.removeLayerFilter = _chunkQCEQIRJQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkLRRCMRSLcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkQCEQIRJQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkLRRCMRSLcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkQCEQIRJQcjs.renderShape; exports.renderShapeRect = _chunkQCEQIRJQcjs.renderShapeRect; exports.renderSmartObject = _chunkQCEQIRJQcjs.renderSmartObject; exports.renderText = _chunkQCEQIRJQcjs.renderText; exports.replaceContents = _chunkQCEQIRJQcjs.replaceContents; exports.replaceTextRange = _chunkQCEQIRJQcjs.replaceTextRange; exports.requireLayer = _chunkQCEQIRJQcjs.requireLayer; exports.requireOperation = _chunkQCEQIRJQcjs.requireOperation; exports.requireShapeLayer = _chunkQCEQIRJQcjs.requireShapeLayer; exports.requireSmartObject = _chunkQCEQIRJQcjs.requireSmartObject; exports.requireTypeLayer = _chunkQCEQIRJQcjs.requireTypeLayer; exports.requireUnlocked = _chunkQCEQIRJQcjs.requireUnlocked; exports.rerender = _chunkQCEQIRJQcjs.rerender; exports.rerenderShape = _chunkQCEQIRJQcjs.rerenderShape; exports.rerenderText = _chunkQCEQIRJQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkQCEQIRJQcjs.resizeSelection; exports.resizeWarpMesh = _chunkRHXW4TA5cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkQCEQIRJQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkLRRCMRSLcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkRHXW4TA5cjs.restyleRange; exports.retouchFilter = _chunk6FUAHCVIcjs.retouchFilter; exports.reversePaintGradient = _chunkLRRCMRSLcjs.reversePaintGradient; exports.rgbToGray = _chunkQCEQIRJQcjs.rgbToGray; exports.rgbToHsl = _chunkQCEQIRJQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk6FUAHCVIcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkQCEQIRJQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkQCEQIRJQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkQCEQIRJQcjs.sampleLut; exports.sampleToneLut = _chunkQCEQIRJQcjs.sampleToneLut; exports.saturationOf = _chunk6FUAHCVIcjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkLRRCMRSLcjs.scalePaintGradient; exports.seamlessClone = _chunk6FUAHCVIcjs.seamlessClone; exports.seedFromString = _chunkLRRCMRSLcjs.seedFromString; exports.selectionArea = _chunkQCEQIRJQcjs.selectionArea; exports.selectionFromCoverage = _chunkQCEQIRJQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkQCEQIRJQcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkQCEQIRJQcjs.selectionToCoverage; exports.selectionToPixels = _chunkQCEQIRJQcjs.selectionToPixels; exports.selectionValueAt = _chunkQCEQIRJQcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkQCEQIRJQcjs.serializeContents; exports.serializeEffects = _chunkQCEQIRJQcjs.serializeEffects; exports.serializeLayer = _chunkQCEQIRJQcjs.serializeLayer; exports.serializeLayers = _chunkQCEQIRJQcjs.serializeLayers; exports.serializeLayersExternal = _chunkQCEQIRJQcjs.serializeLayersExternal; exports.serializePatterns = _chunkQCEQIRJQcjs.serializePatterns; exports.serializeSelection = _chunkQCEQIRJQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkQCEQIRJQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkQCEQIRJQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkQCEQIRJQcjs.setLayerMask; exports.setLayerProperties = _chunkQCEQIRJQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkQCEQIRJQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkQCEQIRJQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkQCEQIRJQcjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunkQCEQIRJQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkQCEQIRJQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkQCEQIRJQcjs.shapeGeometryBounds; exports.shapeLayers = _chunkQCEQIRJQcjs.shapeLayers; exports.shapeOutline = _chunkQCEQIRJQcjs.shapeOutline; exports.shapeRenderClip = _chunkQCEQIRJQcjs.shapeRenderClip; exports.shiftCoverage = _chunkQCEQIRJQcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkQCEQIRJQcjs.smartObjectLayers; exports.smoothCoverage = _chunkQCEQIRJQcjs.smoothCoverage; exports.smoothPoints = _chunkLRRCMRSLcjs.smoothPoints; exports.smudgeEffect = _chunk6FUAHCVIcjs.smudgeEffect; exports.solidPaint = _chunkLRRCMRSLcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk6FUAHCVIcjs.solveMembrane; exports.spliceRuns = _chunkRHXW4TA5cjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk6FUAHCVIcjs.sponge; exports.spongeEffect = _chunk6FUAHCVIcjs.spongeEffect; exports.spotHealPixels = _chunk6FUAHCVIcjs.spotHealPixels; exports.spotHealWindow = _chunk6FUAHCVIcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkQCEQIRJQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkLRRCMRSLcjs.strokeGrainCatch; exports.styleAt = _chunkRHXW4TA5cjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkQCEQIRJQcjs.tempTintToXy; exports.temperatureToKelvin = _chunkQCEQIRJQcjs.temperatureToKelvin; exports.textIndexAt = _chunkRHXW4TA5cjs.textIndexAt; exports.textMatrix = _chunkQCEQIRJQcjs.textMatrix; exports.textOutlines = _chunkQCEQIRJQcjs.textOutlines; exports.textRange = _chunkQCEQIRJQcjs.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 = _chunkLRRCMRSLcjs.tipFalloff; exports.tipReach = _chunkLRRCMRSLcjs.tipReach; exports.tipShape = _chunkLRRCMRSLcjs.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 = _chunkQCEQIRJQcjs.toTextSpace; exports.toneCurve = _chunkQCEQIRJQcjs.toneCurve; exports.toneLuts = _chunkQCEQIRJQcjs.toneLuts; exports.toneOf = _chunk6FUAHCVIcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkQCEQIRJQcjs.transformHomography; exports.transformMap = _chunkQCEQIRJQcjs.transformMap; exports.transformShapeComponents = _chunkQCEQIRJQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkQCEQIRJQcjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkQCEQIRJQcjs.transformedBox; exports.transformedPoint = _chunkQCEQIRJQcjs.transformedPoint; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkQCEQIRJQcjs.typeAsPixelLayer; exports.typeFrame = _chunkQCEQIRJQcjs.typeFrame; exports.typeFromAnnotation = _chunkQCEQIRJQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkQCEQIRJQcjs.typeLayerName; exports.ungroupLayer = _chunkQCEQIRJQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkQCEQIRJQcjs.unionRect; exports.unprojectCanvasPoint = _chunkQCEQIRJQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkQCEQIRJQcjs.updateLayerEffect; exports.updateLayerFilter = _chunkQCEQIRJQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkQCEQIRJQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkLRRCMRSLcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkQCEQIRJQcjs.updateShapeLayer; exports.updateSmartFilter = _chunkQCEQIRJQcjs.updateSmartFilter; exports.updateTypeLayer = _chunkQCEQIRJQcjs.updateTypeLayer; exports.uvToXy = _chunkQCEQIRJQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkQCEQIRJQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkQCEQIRJQcjs.vibranceLinear; exports.vibrancePixel = _chunkQCEQIRJQcjs.vibrancePixel; exports.walkDabs = _chunkLRRCMRSLcjs.walkDabs; exports.warpMeshEditPoints = _chunkRHXW4TA5cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkRHXW4TA5cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkRHXW4TA5cjs.warpMeshParamAt; exports.warpPresetMesh = _chunkRHXW4TA5cjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.wbMatrix = _chunkQCEQIRJQcjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunkQCEQIRJQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkQCEQIRJQcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkQCEQIRJQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkQCEQIRJQcjs.withNewIds; exports.writeAdjustmentBlock = _chunkQCEQIRJQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkQCEQIRJQcjs.writeLfx2; exports.writePatternBlock = _chunkQCEQIRJQcjs.writePatternBlock; exports.writePsd = _chunkQCEQIRJQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkQCEQIRJQcjs.xyToTempTint; exports.xyToUv = _chunkQCEQIRJQcjs.xyToUv;
16210
+
16211
+
16212
+
16213
+
16214
+
16215
+
16216
+
16217
+
16218
+
16219
+ exports.ADJUSTMENT_KEYS = _chunkPI45JMP7cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPI45JMP7cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPI45JMP7cjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPI45JMP7cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPI45JMP7cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPI45JMP7cjs.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 = _chunkPI45JMP7cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.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 = _chunkLRRCMRSLcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkLRRCMRSLcjs.CoverageMap; exports.D50 = _chunkPI45JMP7cjs.D50; exports.D65 = _chunkPI45JMP7cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkRHXW4TA5cjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkLRRCMRSLcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkLRRCMRSLcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkPI45JMP7cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkLRRCMRSLcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkLRRCMRSLcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk6FUAHCVIcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkLRRCMRSLcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkRHXW4TA5cjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkPI45JMP7cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkLRRCMRSLcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkPI45JMP7cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkLRRCMRSLcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkPI45JMP7cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkLRRCMRSLcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkLRRCMRSLcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkPI45JMP7cjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk6FUAHCVIcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkPI45JMP7cjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkPI45JMP7cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPI45JMP7cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPI45JMP7cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPI45JMP7cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPI45JMP7cjs.LUMA_709; exports.LayerCompositor = _chunkPI45JMP7cjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkPI45JMP7cjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkLRRCMRSLcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkPI45JMP7cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkPI45JMP7cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPI45JMP7cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkLRRCMRSLcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkLRRCMRSLcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkLRRCMRSLcjs.MIXING_MODELS; exports.MixerStroke = _chunkLRRCMRSLcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkLRRCMRSLcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkLRRCMRSLcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkLRRCMRSLcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkLRRCMRSLcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkPI45JMP7cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkPI45JMP7cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkPI45JMP7cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkLRRCMRSLcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkLRRCMRSLcjs.PaintGradientSampler; exports.PaintSourceError = _chunkLRRCMRSLcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkLRRCMRSLcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkPI45JMP7cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk6FUAHCVIcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk6FUAHCVIcjs.RegionPixelSource; exports.RetouchDabStroke = _chunk6FUAHCVIcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkPI45JMP7cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPI45JMP7cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkPI45JMP7cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPI45JMP7cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkPI45JMP7cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk6FUAHCVIcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkPI45JMP7cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkLRRCMRSLcjs.SmudgeTip; exports.StrokeCoverage = _chunkLRRCMRSLcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPI45JMP7cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPI45JMP7cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPI45JMP7cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPI45JMP7cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkLRRCMRSLcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkPI45JMP7cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk6FUAHCVIcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPI45JMP7cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkLRRCMRSLcjs.TileMedium; exports.TilePixelSource = _chunk6FUAHCVIcjs.TilePixelSource; exports.TileableNoise = _chunkLRRCMRSLcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk6FUAHCVIcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunkPI45JMP7cjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkRHXW4TA5cjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkRHXW4TA5cjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkPI45JMP7cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPI45JMP7cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkPI45JMP7cjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkPI45JMP7cjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkPI45JMP7cjs.activeSmartFilters; exports.addLayerEffect = _chunkPI45JMP7cjs.addLayerEffect; exports.addLayerFilter = _chunkPI45JMP7cjs.addLayerFilter; exports.addPaintGradientStop = _chunkLRRCMRSLcjs.addPaintGradientStop; exports.addSmartFilter = _chunkPI45JMP7cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPI45JMP7cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPI45JMP7cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPI45JMP7cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPI45JMP7cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkPI45JMP7cjs.anchorPoint; exports.annotationBlend = _chunkPI45JMP7cjs.annotationBlend; exports.annotationLayerFor = _chunkPI45JMP7cjs.annotationLayerFor; exports.annotationLayerName = _chunkPI45JMP7cjs.annotationLayerName; exports.annotationOfLayer = _chunkPI45JMP7cjs.annotationOfLayer; exports.annotationOfShape = _chunkPI45JMP7cjs.annotationOfShape; exports.annotationOfType = _chunkPI45JMP7cjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPI45JMP7cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkPI45JMP7cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkPI45JMP7cjs.applyAdjustments; exports.applyBoxBlur = _chunkPI45JMP7cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkPI45JMP7cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkPI45JMP7cjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkPI45JMP7cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPI45JMP7cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkPI45JMP7cjs.applyLegacyFloat; exports.applyMatrix3 = _chunkPI45JMP7cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPI45JMP7cjs.applyParams; exports.applyProcess2Adjustments = _chunkPI45JMP7cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkPI45JMP7cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk6FUAHCVIcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkPI45JMP7cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkLRRCMRSLcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkLRRCMRSLcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk6FUAHCVIcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkPI45JMP7cjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk6FUAHCVIcjs.bestOffset; exports.blackWhiteGray = _chunkPI45JMP7cjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkLRRCMRSLcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkLRRCMRSLcjs.blenderDab; exports.blurFilter = _chunkPI45JMP7cjs.blurFilter; exports.borderCoverage = _chunkPI45JMP7cjs.borderCoverage; exports.boxBlurPixels = _chunk6FUAHCVIcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkPI45JMP7cjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPI45JMP7cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkLRRCMRSLcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkLRRCMRSLcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkLRRCMRSLcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkLRRCMRSLcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkLRRCMRSLcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkPI45JMP7cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPI45JMP7cjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkPI45JMP7cjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPI45JMP7cjs.canvasToImagePoint; exports.caretAt = _chunkRHXW4TA5cjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPI45JMP7cjs.clampCropToImage; exports.cleanMixer = _chunkLRRCMRSLcjs.cleanMixer; exports.cloneSamplePoint = _chunk6FUAHCVIcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkPI45JMP7cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkPI45JMP7cjs.combineSelections; exports.compileAdjustmentLayer = _chunkPI45JMP7cjs.compileAdjustmentLayer; exports.componentPath = _chunkPI45JMP7cjs.componentPath; exports.compositeDeep = _chunkPI45JMP7cjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPI45JMP7cjs.computeSelectionBounds; exports.contentAwareFill = _chunk6FUAHCVIcjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkPI45JMP7cjs.contentsBox; exports.contentsSurface = _chunkPI45JMP7cjs.contentsSurface; exports.contractCoverage = _chunkPI45JMP7cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkPI45JMP7cjs.convertToSmartObject; exports.copySmartObject = _chunkPI45JMP7cjs.copySmartObject; exports.cornersFromMatrix = _chunkPI45JMP7cjs.cornersFromMatrix; exports.coverageTileCoord = _chunkLRRCMRSLcjs.coverageTileCoord; exports.coverageToByte = _chunkPI45JMP7cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPI45JMP7cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkLRRCMRSLcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkRHXW4TA5cjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; 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.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkRHXW4TA5cjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkRHXW4TA5cjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunkPI45JMP7cjs.createSelectionMask; exports.createShapeLayer = _chunkPI45JMP7cjs.createShapeLayer; exports.createTypeLayer = _chunkPI45JMP7cjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkRHXW4TA5cjs.cssFont; exports.cssFontFamily = _chunkRHXW4TA5cjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkPI45JMP7cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkLRRCMRSLcjs.dabCoverage; exports.dabRect = _chunkLRRCMRSLcjs.dabRect; exports.decodeDeepSurface = _chunkPI45JMP7cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkPI45JMP7cjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPI45JMP7cjs.decodeLayerMask; exports.decodeMergedImage = _chunkPI45JMP7cjs.decodeMergedImage; exports.decodePlanes = _chunkPI45JMP7cjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkPI45JMP7cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPI45JMP7cjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkPI45JMP7cjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkPI45JMP7cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPI45JMP7cjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkPI45JMP7cjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkPI45JMP7cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPI45JMP7cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkPI45JMP7cjs.deserializeEffects; exports.deserializeLayer = _chunkPI45JMP7cjs.deserializeLayer; exports.deserializeLayers = _chunkPI45JMP7cjs.deserializeLayers; exports.deserializePatterns = _chunkPI45JMP7cjs.deserializePatterns; exports.deserializeSelection = _chunkPI45JMP7cjs.deserializeSelection; exports.developFilter = _chunkPI45JMP7cjs.developFilter; exports.developFromAdjustments = _chunkPI45JMP7cjs.developFromAdjustments; exports.developTarget = _chunkPI45JMP7cjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk6FUAHCVIcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkPI45JMP7cjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunkPI45JMP7cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk6FUAHCVIcjs.dodgeBurn; exports.dodgeBurnCurve = _chunk6FUAHCVIcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkRHXW4TA5cjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunkPI45JMP7cjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkPI45JMP7cjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkPI45JMP7cjs.encodeRle; exports.encodeSelectionRle = _chunkPI45JMP7cjs.encodeSelectionRle; exports.encodeSurface = _chunkPI45JMP7cjs.encodeSurface; exports.evalWarpMesh = _chunkRHXW4TA5cjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPI45JMP7cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkLRRCMRSLcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunkPI45JMP7cjs.expandCoverage; exports.exportPsd = _chunkPI45JMP7cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPI45JMP7cjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunkPI45JMP7cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkRHXW4TA5cjs.fitParagraphRuns; exports.fitRuns = _chunkRHXW4TA5cjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkPI45JMP7cjs.flattenPath; exports.flipCorners = _chunkPI45JMP7cjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkRHXW4TA5cjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPI45JMP7cjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkPI45JMP7cjs.geometryHomography; exports.getAnnotationBounds = _chunkPI45JMP7cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPI45JMP7cjs.getCropCursor; exports.getRotatedSize = _chunkPI45JMP7cjs.getRotatedSize; exports.getViewportMetrics = _chunkPI45JMP7cjs.getViewportMetrics; exports.getViewportProjection = _chunkPI45JMP7cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkLRRCMRSLcjs.gradientDabColor; exports.grainCatch = _chunkLRRCMRSLcjs.grainCatch; exports.grainHeights = _chunkLRRCMRSLcjs.grainHeights; exports.greyMorphology = _chunkPI45JMP7cjs.greyMorphology; exports.groupLayers = _chunkPI45JMP7cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPI45JMP7cjs.hasResampledLegacyMask; exports.hasSurface = _chunkPI45JMP7cjs.hasSurface; exports.hasWarp = _chunkPI45JMP7cjs.hasWarp; exports.hash2 = _chunkLRRCMRSLcjs.hash2; exports.hashMaskContent = _chunkPI45JMP7cjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk6FUAHCVIcjs.healPixels; exports.hexToPaintRgb = _chunkLRRCMRSLcjs.hexToPaintRgb; exports.hexToRgb = _chunkPI45JMP7cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPI45JMP7cjs.hitTestAnnotation; exports.hitTestCrop = _chunkPI45JMP7cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkPI45JMP7cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPI45JMP7cjs.hueRangeTables; exports.hueRangeWeight = _chunkPI45JMP7cjs.hueRangeWeight; exports.hueSaturation = _chunkPI45JMP7cjs.hueSaturation; exports.identityCurve = _chunkPI45JMP7cjs.identityCurve; exports.identityLevels = _chunkPI45JMP7cjs.identityLevels; exports.identityTransform = _chunkPI45JMP7cjs.identityTransform; exports.identityWarpMesh = _chunkRHXW4TA5cjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkPI45JMP7cjs.imageToCanvasPoint; exports.importPsd = _chunkPI45JMP7cjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkPI45JMP7cjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkPI45JMP7cjs.invertMatrix3; exports.invertSelection = _chunkPI45JMP7cjs.invertSelection; exports.isActiveFilter = _chunkPI45JMP7cjs.isActiveFilter; exports.isAdjustmentKind = _chunkPI45JMP7cjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkLRRCMRSLcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkPI45JMP7cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPI45JMP7cjs.isDefaultDepthMask; exports.isGradientPaint = _chunkLRRCMRSLcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk6FUAHCVIcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkPI45JMP7cjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkPI45JMP7cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkPI45JMP7cjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPI45JMP7cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPI45JMP7cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkPI45JMP7cjs.isSelectionEmpty; exports.isSelectionMode = _chunkPI45JMP7cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkPI45JMP7cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkPI45JMP7cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkPI45JMP7cjs.isTransformAnchor; exports.isValidWarp = _chunkPI45JMP7cjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkPI45JMP7cjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkPI45JMP7cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPI45JMP7cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPI45JMP7cjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPI45JMP7cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPI45JMP7cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPI45JMP7cjs.layerTree; exports.layerTypeLabel = _chunkPI45JMP7cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkPI45JMP7cjs.layersFromLegacy; exports.layoutText = _chunkRHXW4TA5cjs.layoutText; exports.legacyAdjustmentLayer = _chunkPI45JMP7cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPI45JMP7cjs.legacyMaskOf; exports.legacyView = _chunkPI45JMP7cjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkPI45JMP7cjs.levelsValue; exports.linearSrgbToXy = _chunkPI45JMP7cjs.linearSrgbToXy; exports.linearToSrgb = _chunkPI45JMP7cjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunkPI45JMP7cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkPI45JMP7cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkLRRCMRSLcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk6FUAHCVIcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkPI45JMP7cjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkPI45JMP7cjs.mapSubpaths; exports.maskBounds = _chunk6FUAHCVIcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPI45JMP7cjs.matrixFromCorners; exports.matrixFromParams = _chunkPI45JMP7cjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk6FUAHCVIcjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPI45JMP7cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkLRRCMRSLcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkLRRCMRSLcjs.mixerRates; exports.modifySelection = _chunkPI45JMP7cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPI45JMP7cjs.moveLayer; exports.moveSmartFilter = _chunkPI45JMP7cjs.moveSmartFilter; exports.mulMatrix3 = _chunkPI45JMP7cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPI45JMP7cjs.neutralHueRange; exports.newContentsId = _chunkPI45JMP7cjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkPI45JMP7cjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPI45JMP7cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPI45JMP7cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPI45JMP7cjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkLRRCMRSLcjs.normalizeBlender; exports.normalizeBrush = _chunkLRRCMRSLcjs.normalizeBrush; exports.normalizeFilter = _chunkPI45JMP7cjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkLRRCMRSLcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPI45JMP7cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPI45JMP7cjs.normalizeLiveShape; exports.normalizeMixer = _chunkLRRCMRSLcjs.normalizeMixer; exports.normalizePlacement = _chunkPI45JMP7cjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPI45JMP7cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk6FUAHCVIcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkPI45JMP7cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPI45JMP7cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPI45JMP7cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkLRRCMRSLcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPI45JMP7cjs.normalizeSubpaths; exports.normalizeText = _chunkPI45JMP7cjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunkPI45JMP7cjs.offsetLayer; exports.offsetShape = _chunkPI45JMP7cjs.offsetShape; exports.offsetSmartObject = _chunkPI45JMP7cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkLRRCMRSLcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkLRRCMRSLcjs.paintPathStroke; exports.paintSourceColor = _chunkLRRCMRSLcjs.paintSourceColor; exports.paintSourceCss = _chunkLRRCMRSLcjs.paintSourceCss; exports.paragraphRanges = _chunkRHXW4TA5cjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPI45JMP7cjs.parseAdjustmentBlock; exports.parseBlend = _chunkPI45JMP7cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkPI45JMP7cjs.parseLfx2; exports.parseLrfx = _chunkPI45JMP7cjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkLRRCMRSLcjs.parsePaintSource; exports.parsePatternBlock = _chunkPI45JMP7cjs.parsePatternBlock; exports.parseSelectionMode = _chunkPI45JMP7cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPI45JMP7cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPI45JMP7cjs.patchParagraphStyle; exports.patchTextStyle = _chunkPI45JMP7cjs.patchTextStyle; exports.pathStrokeCoverage = _chunkLRRCMRSLcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkLRRCMRSLcjs.pathStrokeDabs; exports.perDabStrength = _chunk6FUAHCVIcjs.perDabStrength; exports.photoFilterMatrix = _chunkPI45JMP7cjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunkPI45JMP7cjs.pixelLayerBounds; exports.pixelLayers = _chunkPI45JMP7cjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunkPI45JMP7cjs.placeContents; exports.placeLayer = _chunkPI45JMP7cjs.placeLayer; exports.placementAt = _chunkPI45JMP7cjs.placementAt; exports.placementBounds = _chunkPI45JMP7cjs.placementBounds; exports.placementGeometry = _chunkPI45JMP7cjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkPI45JMP7cjs.posterizeValue; exports.presetWarp = _chunkPI45JMP7cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkPI45JMP7cjs.projectImagePoint; exports.projectImageRect = _chunkPI45JMP7cjs.projectImageRect; exports.projectMaskCoverage = _chunkPI45JMP7cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPI45JMP7cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPI45JMP7cjs.psdToLayers; exports.pullWarpMesh = _chunkRHXW4TA5cjs.pullWarpMesh; exports.put255 = _chunkLRRCMRSLcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkLRRCMRSLcjs.rand01; exports.randSigned = _chunkLRRCMRSLcjs.randSigned; exports.rangeLightness = _chunkPI45JMP7cjs.rangeLightness; exports.rasterContents = _chunkPI45JMP7cjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPI45JMP7cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPI45JMP7cjs.rasterizeCoverage; exports.rasterizeDab = _chunkLRRCMRSLcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPI45JMP7cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkLRRCMRSLcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkPI45JMP7cjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk6FUAHCVIcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkPI45JMP7cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkPI45JMP7cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPI45JMP7cjs.removeLayer; exports.removeLayerEffect = _chunkPI45JMP7cjs.removeLayerEffect; exports.removeLayerFilter = _chunkPI45JMP7cjs.removeLayerFilter; exports.removePaintGradientStop = _chunkLRRCMRSLcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkPI45JMP7cjs.removeSmartFilter; exports.renderBrushstroke = _chunkLRRCMRSLcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPI45JMP7cjs.renderShape; exports.renderShapeRect = _chunkPI45JMP7cjs.renderShapeRect; exports.renderSmartObject = _chunkPI45JMP7cjs.renderSmartObject; exports.renderText = _chunkPI45JMP7cjs.renderText; exports.replaceContents = _chunkPI45JMP7cjs.replaceContents; exports.replaceTextRange = _chunkPI45JMP7cjs.replaceTextRange; exports.requireLayer = _chunkPI45JMP7cjs.requireLayer; exports.requireOperation = _chunkPI45JMP7cjs.requireOperation; exports.requireShapeLayer = _chunkPI45JMP7cjs.requireShapeLayer; exports.requireSmartObject = _chunkPI45JMP7cjs.requireSmartObject; exports.requireTypeLayer = _chunkPI45JMP7cjs.requireTypeLayer; exports.requireUnlocked = _chunkPI45JMP7cjs.requireUnlocked; exports.rerender = _chunkPI45JMP7cjs.rerender; exports.rerenderShape = _chunkPI45JMP7cjs.rerenderShape; exports.rerenderText = _chunkPI45JMP7cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPI45JMP7cjs.resizeSelection; exports.resizeWarpMesh = _chunkRHXW4TA5cjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPI45JMP7cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkLRRCMRSLcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkRHXW4TA5cjs.restyleRange; exports.retouchFilter = _chunk6FUAHCVIcjs.retouchFilter; exports.reversePaintGradient = _chunkLRRCMRSLcjs.reversePaintGradient; exports.rgbToGray = _chunkPI45JMP7cjs.rgbToGray; exports.rgbToHsl = _chunkPI45JMP7cjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk6FUAHCVIcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkPI45JMP7cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkPI45JMP7cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkPI45JMP7cjs.sampleLut; exports.sampleToneLut = _chunkPI45JMP7cjs.sampleToneLut; exports.saturationOf = _chunk6FUAHCVIcjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkLRRCMRSLcjs.scalePaintGradient; exports.seamlessClone = _chunk6FUAHCVIcjs.seamlessClone; exports.seedFromString = _chunkLRRCMRSLcjs.seedFromString; exports.selectionArea = _chunkPI45JMP7cjs.selectionArea; exports.selectionFromCoverage = _chunkPI45JMP7cjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPI45JMP7cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPI45JMP7cjs.selectionToCoverage; exports.selectionToPixels = _chunkPI45JMP7cjs.selectionToPixels; exports.selectionValueAt = _chunkPI45JMP7cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkPI45JMP7cjs.serializeContents; exports.serializeEffects = _chunkPI45JMP7cjs.serializeEffects; exports.serializeLayer = _chunkPI45JMP7cjs.serializeLayer; exports.serializeLayers = _chunkPI45JMP7cjs.serializeLayers; exports.serializeLayersExternal = _chunkPI45JMP7cjs.serializeLayersExternal; exports.serializePatterns = _chunkPI45JMP7cjs.serializePatterns; exports.serializeSelection = _chunkPI45JMP7cjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPI45JMP7cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPI45JMP7cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPI45JMP7cjs.setLayerMask; exports.setLayerProperties = _chunkPI45JMP7cjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkPI45JMP7cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPI45JMP7cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPI45JMP7cjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunkPI45JMP7cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPI45JMP7cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPI45JMP7cjs.shapeGeometryBounds; exports.shapeLayers = _chunkPI45JMP7cjs.shapeLayers; exports.shapeOutline = _chunkPI45JMP7cjs.shapeOutline; exports.shapeRenderClip = _chunkPI45JMP7cjs.shapeRenderClip; exports.shiftCoverage = _chunkPI45JMP7cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPI45JMP7cjs.smartObjectLayers; exports.smoothCoverage = _chunkPI45JMP7cjs.smoothCoverage; exports.smoothPoints = _chunkLRRCMRSLcjs.smoothPoints; exports.smudgeEffect = _chunk6FUAHCVIcjs.smudgeEffect; exports.solidPaint = _chunkLRRCMRSLcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk6FUAHCVIcjs.solveMembrane; exports.spliceRuns = _chunkRHXW4TA5cjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk6FUAHCVIcjs.sponge; exports.spongeEffect = _chunk6FUAHCVIcjs.spongeEffect; exports.spotHealPixels = _chunk6FUAHCVIcjs.spotHealPixels; exports.spotHealWindow = _chunk6FUAHCVIcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkPI45JMP7cjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkLRRCMRSLcjs.strokeGrainCatch; exports.styleAt = _chunkRHXW4TA5cjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkPI45JMP7cjs.tempTintToXy; exports.temperatureToKelvin = _chunkPI45JMP7cjs.temperatureToKelvin; exports.textIndexAt = _chunkRHXW4TA5cjs.textIndexAt; exports.textMatrix = _chunkPI45JMP7cjs.textMatrix; exports.textOutlines = _chunkPI45JMP7cjs.textOutlines; exports.textRange = _chunkPI45JMP7cjs.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 = _chunkLRRCMRSLcjs.tipFalloff; exports.tipReach = _chunkLRRCMRSLcjs.tipReach; exports.tipShape = _chunkLRRCMRSLcjs.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 = _chunkPI45JMP7cjs.toTextSpace; exports.toneCurve = _chunkPI45JMP7cjs.toneCurve; exports.toneLuts = _chunkPI45JMP7cjs.toneLuts; exports.toneOf = _chunk6FUAHCVIcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkPI45JMP7cjs.transformHomography; exports.transformMap = _chunkPI45JMP7cjs.transformMap; exports.transformShapeComponents = _chunkPI45JMP7cjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkPI45JMP7cjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkPI45JMP7cjs.transformedBox; exports.transformedPoint = _chunkPI45JMP7cjs.transformedPoint; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkPI45JMP7cjs.typeAsPixelLayer; exports.typeFrame = _chunkPI45JMP7cjs.typeFrame; exports.typeFromAnnotation = _chunkPI45JMP7cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkPI45JMP7cjs.typeLayerName; exports.ungroupLayer = _chunkPI45JMP7cjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkPI45JMP7cjs.unionRect; exports.unprojectCanvasPoint = _chunkPI45JMP7cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPI45JMP7cjs.updateLayerEffect; exports.updateLayerFilter = _chunkPI45JMP7cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPI45JMP7cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkLRRCMRSLcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkPI45JMP7cjs.updateShapeLayer; exports.updateSmartFilter = _chunkPI45JMP7cjs.updateSmartFilter; exports.updateTypeLayer = _chunkPI45JMP7cjs.updateTypeLayer; exports.userErrorMessage = _chunkPI45JMP7cjs.userErrorMessage; exports.uvToXy = _chunkPI45JMP7cjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPI45JMP7cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPI45JMP7cjs.vibranceLinear; exports.vibrancePixel = _chunkPI45JMP7cjs.vibrancePixel; exports.walkDabs = _chunkLRRCMRSLcjs.walkDabs; exports.warpMeshEditPoints = _chunkRHXW4TA5cjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkRHXW4TA5cjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkRHXW4TA5cjs.warpMeshParamAt; exports.warpPresetMesh = _chunkRHXW4TA5cjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkPI45JMP7cjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunkPI45JMP7cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPI45JMP7cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPI45JMP7cjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkPI45JMP7cjs.withNewIds; exports.writeAdjustmentBlock = _chunkPI45JMP7cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkPI45JMP7cjs.writeLfx2; exports.writePatternBlock = _chunkPI45JMP7cjs.writePatternBlock; exports.writePsd = _chunkPI45JMP7cjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkPI45JMP7cjs.xyToTempTint; exports.xyToUv = _chunkPI45JMP7cjs.xyToUv;