@pixerate/editor 0.197.0 → 0.199.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16;
2
2
 
3
3
 
4
4
 
@@ -3045,7 +3045,7 @@ var GridGraph = class {
3045
3045
  }
3046
3046
  };
3047
3047
 
3048
- // src/image-editor/selection/segment/quick.ts
3048
+ // src/image-editor/selection/segment/work.ts
3049
3049
  var WORK_SIZE = 512;
3050
3050
  var workCache = /* @__PURE__ */ new WeakMap();
3051
3051
  function workImage(pixels, maxSide = WORK_SIZE) {
@@ -3082,6 +3082,155 @@ function workImage(pixels, maxSide = WORK_SIZE) {
3082
3082
  workCache.set(pixels.data, { maxSide, work });
3083
3083
  return work;
3084
3084
  }
3085
+ var GAMMA = 50;
3086
+ var UNITS = 64;
3087
+ function smoothnessWeights(work, roi) {
3088
+ const { width: w, rgb } = work;
3089
+ const { x: rx, y: ry, width: rw, height: rh } = roi;
3090
+ const right = new Float64Array(rw * rh);
3091
+ const down = new Float64Array(rw * rh);
3092
+ let sumSq = 0;
3093
+ let pairs = 0;
3094
+ for (let y = 0; y < rh; y++) {
3095
+ for (let x = 0; x < rw; x++) {
3096
+ const p = y * rw + x;
3097
+ const c = ((ry + y) * w + rx + x) * 3;
3098
+ if (x + 1 < rw) {
3099
+ right[p] = (rgb[c] - rgb[c + 3]) ** 2 + (rgb[c + 1] - rgb[c + 4]) ** 2 + (rgb[c + 2] - rgb[c + 5]) ** 2;
3100
+ sumSq += right[p];
3101
+ pairs++;
3102
+ }
3103
+ if (y + 1 < rh) {
3104
+ const k = c + w * 3;
3105
+ down[p] = (rgb[c] - rgb[k]) ** 2 + (rgb[c + 1] - rgb[k + 1]) ** 2 + (rgb[c + 2] - rgb[k + 2]) ** 2;
3106
+ sumSq += down[p];
3107
+ pairs++;
3108
+ }
3109
+ }
3110
+ }
3111
+ const beta = 1 / (2 * Math.max(1e-6, sumSq / Math.max(1, pairs)));
3112
+ for (let p = 0; p < right.length; p++) {
3113
+ right[p] = Math.round(GAMMA * UNITS * Math.exp(-beta * right[p]));
3114
+ down[p] = Math.round(GAMMA * UNITS * Math.exp(-beta * down[p]));
3115
+ }
3116
+ return { right, down };
3117
+ }
3118
+ function boxBlur(src, w, h, passes) {
3119
+ let a = src;
3120
+ for (let k = 0; k < passes; k++) {
3121
+ const b = new Float32Array(a.length);
3122
+ for (let y = 0; y < h; y++) {
3123
+ for (let x = 0; x < w; x++) {
3124
+ let s = 0;
3125
+ let c = 0;
3126
+ for (let j = Math.max(0, y - 1); j <= Math.min(h - 1, y + 1); j++) {
3127
+ for (let i = Math.max(0, x - 1); i <= Math.min(w - 1, x + 1); i++) {
3128
+ s += a[j * w + i];
3129
+ c++;
3130
+ }
3131
+ }
3132
+ b[y * w + x] = s / c;
3133
+ }
3134
+ }
3135
+ a = b;
3136
+ }
3137
+ return a;
3138
+ }
3139
+ function upscaleRegion(work, pixels, roi, label, enhance) {
3140
+ const { sourceWidth: W, sourceHeight: H, scale, rgb, width: ww } = work;
3141
+ const { x: rx, y: ry, width: rw, height: rh } = roi;
3142
+ let soft = Float32Array.from(label);
3143
+ if (enhance) {
3144
+ soft = boxBlur(soft, rw, rh, 2);
3145
+ for (let i = 0; i < soft.length; i++) soft[i] = Math.min(1, Math.max(0, (soft[i] - 0.5) * 3 + 0.5));
3146
+ }
3147
+ const X0 = Math.max(0, Math.floor(rx / scale));
3148
+ const Y0 = Math.max(0, Math.floor(ry / scale));
3149
+ const X1 = Math.min(W, Math.ceil((rx + rw) / scale));
3150
+ const Y1 = Math.min(H, Math.ceil((ry + rh) / scale));
3151
+ const RW = X1 - X0;
3152
+ const RH = Y1 - Y0;
3153
+ const out = new Uint8Array(RW * RH);
3154
+ const at = (x, y) => soft[Math.min(rh - 1, Math.max(0, y)) * rw + Math.min(rw - 1, Math.max(0, x))];
3155
+ const data = pixels.data;
3156
+ const colOf = new Int32Array(RW);
3157
+ const fxOf = new Float32Array(RW);
3158
+ for (let X = 0; X < RW; X++) {
3159
+ const u = (X0 + X + 0.5) * scale - 0.5 - rx;
3160
+ colOf[X] = Math.floor(u);
3161
+ fxOf[X] = u - colOf[X];
3162
+ }
3163
+ const cellState = (i, j) => {
3164
+ const a = at(i, j), b = at(i + 1, j), c = at(i, j + 1), d = at(i + 1, j + 1);
3165
+ if (a === 1 && b === 1 && c === 1 && d === 1) return 1;
3166
+ if (a === 0 && b === 0 && c === 0 && d === 0) return 0;
3167
+ return 2;
3168
+ };
3169
+ for (let Y = 0; Y < RH; Y++) {
3170
+ const v = (Y0 + Y + 0.5) * scale - 0.5 - ry;
3171
+ const j = Math.floor(v);
3172
+ const fy = v - j;
3173
+ for (let X = 0; X < RW; X++) {
3174
+ const i = colOf[X];
3175
+ const state = cellState(i, j);
3176
+ if (state !== 2) {
3177
+ let end = X + 1;
3178
+ while (end < RW && colOf[end] === i) end++;
3179
+ if (state === 1) out.fill(255, Y * RW + X, Y * RW + end);
3180
+ X = end - 1;
3181
+ continue;
3182
+ }
3183
+ const fx = fxOf[X];
3184
+ const m = (at(i, j) * (1 - fx) + at(i + 1, j) * fx) * (1 - fy) + (at(i, j + 1) * (1 - fx) + at(i + 1, j + 1) * fx) * fy;
3185
+ if (m <= 1e-3 || m >= 0.999) {
3186
+ out[Y * RW + X] = m >= 0.999 ? 255 : 0;
3187
+ continue;
3188
+ }
3189
+ let fr = 0, fg = 0, fb = 0, fn = 0, br = 0, bg = 0, bb = 0, bn = 0;
3190
+ for (let jj = j - 1; jj <= j + 2; jj++) {
3191
+ for (let ii = i - 1; ii <= i + 2; ii++) {
3192
+ if (ii < 0 || jj < 0 || ii >= rw || jj >= rh) continue;
3193
+ const k = ((ry + jj) * ww + rx + ii) * 3;
3194
+ if (soft[jj * rw + ii] >= 0.5) {
3195
+ fr += rgb[k];
3196
+ fg += rgb[k + 1];
3197
+ fb += rgb[k + 2];
3198
+ fn++;
3199
+ } else {
3200
+ br += rgb[k];
3201
+ bg += rgb[k + 1];
3202
+ bb += rgb[k + 2];
3203
+ bn++;
3204
+ }
3205
+ }
3206
+ }
3207
+ let alpha = m;
3208
+ if (fn && bn) {
3209
+ fr /= fn;
3210
+ fg /= fn;
3211
+ fb /= fn;
3212
+ br /= bn;
3213
+ bg /= bn;
3214
+ bb /= bn;
3215
+ const dr = fr - br, dg = fg - bg, db = fb - bb;
3216
+ const len2 = dr * dr + dg * dg + db * db;
3217
+ if (len2 > 400) {
3218
+ const p = ((Y0 + Y) * W + X0 + X) * 4;
3219
+ const a = data[p + 3] / 255;
3220
+ const cr = data[p] * a + 255 * (1 - a) - br;
3221
+ const cg = data[p + 1] * a + 255 * (1 - a) - bg;
3222
+ const cb = data[p + 2] * a + 255 * (1 - a) - bb;
3223
+ const proj = Math.min(1, Math.max(0, (cr * dr + cg * dg + cb * db) / len2));
3224
+ alpha = Math.min(1, Math.max(0, proj * 0.75 + m * 0.25));
3225
+ } else alpha = Math.min(1, Math.max(0, (m - 0.5) * 2 + 0.5));
3226
+ }
3227
+ out[Y * RW + X] = Math.round(alpha * 255);
3228
+ }
3229
+ }
3230
+ return _chunkUYXL6ZWQcjs.selectionFromRegion.call(void 0, W, H, { x: X0, y: Y0, width: RW, height: RH }, out);
3231
+ }
3232
+
3233
+ // src/image-editor/selection/segment/quick.ts
3085
3234
  var BINS = 16;
3086
3235
  var binOf = (rgb, i) => (Math.min(BINS - 1, rgb[i * 3] >> 4) * BINS + Math.min(BINS - 1, rgb[i * 3 + 1] >> 4)) * BINS + Math.min(BINS - 1, rgb[i * 3 + 2] >> 4);
3087
3236
  function costTable(hist, total) {
@@ -3102,8 +3251,6 @@ function costTable(hist, total) {
3102
3251
  for (let i = 0; i < a.length; i++) out[i] = -Math.log((a[i] + floor * Math.max(1, total)) / denom);
3103
3252
  return out;
3104
3253
  }
3105
- var GAMMA = 50;
3106
- var UNITS = 64;
3107
3254
  function strokePixels(points, r, w, h) {
3108
3255
  const mask = new Uint8Array(w * h);
3109
3256
  const list = [];
@@ -3161,23 +3308,7 @@ function segmentStroke(work, stroke, grown, start) {
3161
3308
  }
3162
3309
  const fgCost = costTable(fgHist, fgN);
3163
3310
  const bgCost = costTable(bgHist, bgN);
3164
- let sumSq = 0;
3165
- let pairs = 0;
3166
- for (let y = 0; y < rh; y++) {
3167
- for (let x = 0; x < rw; x++) {
3168
- const g = ((ry + y) * w + rx + x) * 3;
3169
- if (x + 1 < rw) {
3170
- sumSq += (rgb[g] - rgb[g + 3]) ** 2 + (rgb[g + 1] - rgb[g + 4]) ** 2 + (rgb[g + 2] - rgb[g + 5]) ** 2;
3171
- pairs++;
3172
- }
3173
- if (y + 1 < rh) {
3174
- const k = g + w * 3;
3175
- sumSq += (rgb[g] - rgb[k]) ** 2 + (rgb[g + 1] - rgb[k + 1]) ** 2 + (rgb[g + 2] - rgb[k + 2]) ** 2;
3176
- pairs++;
3177
- }
3178
- }
3179
- }
3180
- const beta = 1 / (2 * Math.max(1e-6, sumSq / Math.max(1, pairs)));
3311
+ const { right, down } = smoothnessWeights(work, roi);
3181
3312
  const graph = new GridGraph(rw, rh);
3182
3313
  const HARD = 1e9;
3183
3314
  for (let y = 0; y < rh; y++) {
@@ -3189,16 +3320,8 @@ function segmentStroke(work, stroke, grown, start) {
3189
3320
  const bin = binOf(rgb, g);
3190
3321
  graph.addTerminal(p, Math.round(bgCost[bin] * UNITS), Math.round(fgCost[bin] * UNITS));
3191
3322
  }
3192
- const c = g * 3;
3193
- if (x + 1 < rw) {
3194
- const d = (rgb[c] - rgb[c + 3]) ** 2 + (rgb[c + 1] - rgb[c + 4]) ** 2 + (rgb[c + 2] - rgb[c + 5]) ** 2;
3195
- graph.setEdge(p, 0, Math.round(GAMMA * UNITS * Math.exp(-beta * d)));
3196
- }
3197
- if (y + 1 < rh) {
3198
- const k = c + w * 3;
3199
- const d = (rgb[c] - rgb[k]) ** 2 + (rgb[c + 1] - rgb[k + 1]) ** 2 + (rgb[c + 2] - rgb[k + 2]) ** 2;
3200
- graph.setEdge(p, 1, Math.round(GAMMA * UNITS * Math.exp(-beta * d)));
3201
- }
3323
+ if (x + 1 < rw) graph.setEdge(p, 0, right[p]);
3324
+ if (y + 1 < rh) graph.setEdge(p, 1, down[p]);
3202
3325
  }
3203
3326
  }
3204
3327
  graph.maxflow();
@@ -3239,120 +3362,6 @@ function segmentStroke(work, stroke, grown, start) {
3239
3362
  if (roi.width * roi.height * 2.5 > w * h) roi = { x: 0, y: 0, width: w, height: h };
3240
3363
  }
3241
3364
  }
3242
- function boxBlur(src, w, h, passes) {
3243
- let a = src;
3244
- for (let k = 0; k < passes; k++) {
3245
- const b = new Float32Array(a.length);
3246
- for (let y = 0; y < h; y++) {
3247
- for (let x = 0; x < w; x++) {
3248
- let s = 0;
3249
- let c = 0;
3250
- for (let j = Math.max(0, y - 1); j <= Math.min(h - 1, y + 1); j++) {
3251
- for (let i = Math.max(0, x - 1); i <= Math.min(w - 1, x + 1); i++) {
3252
- s += a[j * w + i];
3253
- c++;
3254
- }
3255
- }
3256
- b[y * w + x] = s / c;
3257
- }
3258
- }
3259
- a = b;
3260
- }
3261
- return a;
3262
- }
3263
- function upscaleRegion(work, pixels, roi, label, enhance) {
3264
- const { sourceWidth: W, sourceHeight: H, scale, rgb, width: ww } = work;
3265
- const { x: rx, y: ry, width: rw, height: rh } = roi;
3266
- let soft = Float32Array.from(label);
3267
- if (enhance) {
3268
- soft = boxBlur(soft, rw, rh, 2);
3269
- for (let i = 0; i < soft.length; i++) soft[i] = Math.min(1, Math.max(0, (soft[i] - 0.5) * 3 + 0.5));
3270
- }
3271
- const X0 = Math.max(0, Math.floor(rx / scale));
3272
- const Y0 = Math.max(0, Math.floor(ry / scale));
3273
- const X1 = Math.min(W, Math.ceil((rx + rw) / scale));
3274
- const Y1 = Math.min(H, Math.ceil((ry + rh) / scale));
3275
- const RW = X1 - X0;
3276
- const RH = Y1 - Y0;
3277
- const out = new Uint8Array(RW * RH);
3278
- const at = (x, y) => soft[Math.min(rh - 1, Math.max(0, y)) * rw + Math.min(rw - 1, Math.max(0, x))];
3279
- const data = pixels.data;
3280
- const colOf = new Int32Array(RW);
3281
- const fxOf = new Float32Array(RW);
3282
- for (let X = 0; X < RW; X++) {
3283
- const u = (X0 + X + 0.5) * scale - 0.5 - rx;
3284
- colOf[X] = Math.floor(u);
3285
- fxOf[X] = u - colOf[X];
3286
- }
3287
- const cellState = (i, j) => {
3288
- const a = at(i, j), b = at(i + 1, j), c = at(i, j + 1), d = at(i + 1, j + 1);
3289
- if (a === 1 && b === 1 && c === 1 && d === 1) return 1;
3290
- if (a === 0 && b === 0 && c === 0 && d === 0) return 0;
3291
- return 2;
3292
- };
3293
- for (let Y = 0; Y < RH; Y++) {
3294
- const v = (Y0 + Y + 0.5) * scale - 0.5 - ry;
3295
- const j = Math.floor(v);
3296
- const fy = v - j;
3297
- for (let X = 0; X < RW; X++) {
3298
- const i = colOf[X];
3299
- const state = cellState(i, j);
3300
- if (state !== 2) {
3301
- let end = X + 1;
3302
- while (end < RW && colOf[end] === i) end++;
3303
- if (state === 1) out.fill(255, Y * RW + X, Y * RW + end);
3304
- X = end - 1;
3305
- continue;
3306
- }
3307
- const fx = fxOf[X];
3308
- const m = (at(i, j) * (1 - fx) + at(i + 1, j) * fx) * (1 - fy) + (at(i, j + 1) * (1 - fx) + at(i + 1, j + 1) * fx) * fy;
3309
- if (m <= 1e-3 || m >= 0.999) {
3310
- out[Y * RW + X] = m >= 0.999 ? 255 : 0;
3311
- continue;
3312
- }
3313
- let fr = 0, fg = 0, fb = 0, fn = 0, br = 0, bg = 0, bb = 0, bn = 0;
3314
- for (let jj = j - 1; jj <= j + 2; jj++) {
3315
- for (let ii = i - 1; ii <= i + 2; ii++) {
3316
- if (ii < 0 || jj < 0 || ii >= rw || jj >= rh) continue;
3317
- const k = ((ry + jj) * ww + rx + ii) * 3;
3318
- if (soft[jj * rw + ii] >= 0.5) {
3319
- fr += rgb[k];
3320
- fg += rgb[k + 1];
3321
- fb += rgb[k + 2];
3322
- fn++;
3323
- } else {
3324
- br += rgb[k];
3325
- bg += rgb[k + 1];
3326
- bb += rgb[k + 2];
3327
- bn++;
3328
- }
3329
- }
3330
- }
3331
- let alpha = m;
3332
- if (fn && bn) {
3333
- fr /= fn;
3334
- fg /= fn;
3335
- fb /= fn;
3336
- br /= bn;
3337
- bg /= bn;
3338
- bb /= bn;
3339
- const dr = fr - br, dg = fg - bg, db = fb - bb;
3340
- const len2 = dr * dr + dg * dg + db * db;
3341
- if (len2 > 400) {
3342
- const p = ((Y0 + Y) * W + X0 + X) * 4;
3343
- const a = data[p + 3] / 255;
3344
- const cr = data[p] * a + 255 * (1 - a) - br;
3345
- const cg = data[p + 1] * a + 255 * (1 - a) - bg;
3346
- const cb = data[p + 2] * a + 255 * (1 - a) - bb;
3347
- const proj = Math.min(1, Math.max(0, (cr * dr + cg * dg + cb * db) / len2));
3348
- alpha = Math.min(1, Math.max(0, proj * 0.75 + m * 0.25));
3349
- } else alpha = Math.min(1, Math.max(0, (m - 0.5) * 2 + 0.5));
3350
- }
3351
- out[Y * RW + X] = Math.round(alpha * 255);
3352
- }
3353
- }
3354
- return _chunkUYXL6ZWQcjs.selectionFromRegion.call(void 0, W, H, { x: X0, y: Y0, width: RW, height: RH }, out);
3355
- }
3356
3365
  function quickSelectStroke(pixels, stroke, options = {}) {
3357
3366
  if (!stroke.length) throw new Error("A stroke needs at least one point.");
3358
3367
  const work = workImage(pixels);
@@ -3386,6 +3395,486 @@ function quickSelectStroke(pixels, stroke, options = {}) {
3386
3395
  return upscaleRegion(work, pixels, done, label, _nullishCoalesce(options.enhanceEdge, () => ( false)));
3387
3396
  }
3388
3397
 
3398
+ // src/image-editor/selection/segment/grabcut.ts
3399
+ var K = 5;
3400
+ var ColorGmm = (_class6 = class {constructor() { _class6.prototype.__init34.call(this);_class6.prototype.__init35.call(this);_class6.prototype.__init36.call(this);_class6.prototype.__init37.call(this); }
3401
+ __init34() {this.logWeight = new Float64Array(K)}
3402
+ __init35() {this.mean = new Float64Array(K * 3)}
3403
+ /** Inverse covariances, row-major 3 × 3. */
3404
+ __init36() {this.inv = new Float64Array(K * 9)}
3405
+ /** ln(weight) − ½ ln((2π)³ |Σ|) per component; −∞ for an empty one. */
3406
+ __init37() {this.logNorm = new Float64Array(K).fill(-Infinity)}
3407
+ /** Fits the components to the pixels `ids` of `rgb`, each in component `comp[id]`. */
3408
+ fit(rgb, ids, comp) {
3409
+ const n = new Float64Array(K);
3410
+ const sum = new Float64Array(K * 3);
3411
+ const prod = new Float64Array(K * 9);
3412
+ for (let t = 0; t < ids.length; t++) {
3413
+ const i = ids[t];
3414
+ const k = comp[i];
3415
+ const c = [rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]];
3416
+ n[k]++;
3417
+ for (let a = 0; a < 3; a++) {
3418
+ sum[k * 3 + a] += c[a];
3419
+ for (let b = 0; b < 3; b++) prod[k * 9 + a * 3 + b] += c[a] * c[b];
3420
+ }
3421
+ }
3422
+ const total = ids.length || 1;
3423
+ for (let k = 0; k < K; k++) {
3424
+ if (!n[k]) {
3425
+ this.logNorm[k] = -Infinity;
3426
+ continue;
3427
+ }
3428
+ const m = [sum[k * 3] / n[k], sum[k * 3 + 1] / n[k], sum[k * 3 + 2] / n[k]];
3429
+ const cov = new Float64Array(9);
3430
+ for (let a = 0; a < 3; a++) {
3431
+ for (let b = 0; b < 3; b++) cov[a * 3 + b] = prod[k * 9 + a * 3 + b] / n[k] - m[a] * m[b];
3432
+ cov[a * 4] += 4;
3433
+ }
3434
+ const det = cov[0] * (cov[4] * cov[8] - cov[5] * cov[7]) - cov[1] * (cov[3] * cov[8] - cov[5] * cov[6]) + cov[2] * (cov[3] * cov[7] - cov[4] * cov[6]);
3435
+ const d = Math.max(det, 1e-6);
3436
+ const inv = [
3437
+ (cov[4] * cov[8] - cov[5] * cov[7]) / d,
3438
+ (cov[2] * cov[7] - cov[1] * cov[8]) / d,
3439
+ (cov[1] * cov[5] - cov[2] * cov[4]) / d,
3440
+ (cov[5] * cov[6] - cov[3] * cov[8]) / d,
3441
+ (cov[0] * cov[8] - cov[2] * cov[6]) / d,
3442
+ (cov[2] * cov[3] - cov[0] * cov[5]) / d,
3443
+ (cov[3] * cov[7] - cov[4] * cov[6]) / d,
3444
+ (cov[1] * cov[6] - cov[0] * cov[7]) / d,
3445
+ (cov[0] * cov[4] - cov[1] * cov[3]) / d
3446
+ ];
3447
+ this.mean.set(m, k * 3);
3448
+ this.inv.set(inv, k * 9);
3449
+ this.logWeight[k] = Math.log(n[k] / total);
3450
+ this.logNorm[k] = this.logWeight[k] - 0.5 * Math.log(Math.pow(2 * Math.PI, 3) * d);
3451
+ }
3452
+ }
3453
+ /** ln p(colour | component k), up to the shared constant. */
3454
+ componentLog(k, r, g, b) {
3455
+ const ln = this.logNorm[k];
3456
+ if (ln === -Infinity) return -Infinity;
3457
+ const dr = r - this.mean[k * 3];
3458
+ const dg = g - this.mean[k * 3 + 1];
3459
+ const db = b - this.mean[k * 3 + 2];
3460
+ const v = this.inv;
3461
+ const o = k * 9;
3462
+ const q = dr * (v[o] * dr + v[o + 1] * dg + v[o + 2] * db) + dg * (v[o + 3] * dr + v[o + 4] * dg + v[o + 5] * db) + db * (v[o + 6] * dr + v[o + 7] * dg + v[o + 8] * db);
3463
+ return ln - 0.5 * q;
3464
+ }
3465
+ /** −ln p(colour) under the mixture (large for colours the model hasn't seen). */
3466
+ cost(r, g, b) {
3467
+ let best = -Infinity;
3468
+ const logs = new Array(K);
3469
+ for (let k = 0; k < K; k++) {
3470
+ logs[k] = this.componentLog(k, r, g, b);
3471
+ if (logs[k] > best) best = logs[k];
3472
+ }
3473
+ if (best === -Infinity) return 50;
3474
+ let s = 0;
3475
+ for (let k = 0; k < K; k++) if (logs[k] > -Infinity) s += Math.exp(logs[k] - best);
3476
+ return Math.min(50, -(best + Math.log(s)));
3477
+ }
3478
+ /** The component most likely to have produced the colour. */
3479
+ nearest(r, g, b) {
3480
+ let best = 0;
3481
+ let bestLog = -Infinity;
3482
+ for (let k = 0; k < K; k++) {
3483
+ const l = this.componentLog(k, r, g, b);
3484
+ if (l > bestLog) {
3485
+ bestLog = l;
3486
+ best = k;
3487
+ }
3488
+ }
3489
+ return best;
3490
+ }
3491
+ }, _class6);
3492
+ function initialComponents(rgb, ids, comp) {
3493
+ if (!ids.length) return;
3494
+ const step = Math.max(1, Math.floor(ids.length / 6e3));
3495
+ const sample = [];
3496
+ for (let t = 0; t < ids.length; t += step) sample.push(ids[t]);
3497
+ const centres = [];
3498
+ const dist2 = (i, c) => (rgb[i * 3] - c[0]) ** 2 + (rgb[i * 3 + 1] - c[1]) ** 2 + (rgb[i * 3 + 2] - c[2]) ** 2;
3499
+ centres.push([rgb[sample[0] * 3], rgb[sample[0] * 3 + 1], rgb[sample[0] * 3 + 2]]);
3500
+ const near = sample.map((i) => dist2(i, centres[0]));
3501
+ while (centres.length < K) {
3502
+ let far = 0;
3503
+ for (let t = 1; t < sample.length; t++) if (near[t] > near[far]) far = t;
3504
+ const i = sample[far];
3505
+ const c = [rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]];
3506
+ centres.push(c);
3507
+ for (let t = 0; t < sample.length; t++) near[t] = Math.min(near[t], dist2(sample[t], c));
3508
+ }
3509
+ const closest = (i) => {
3510
+ let best = 0;
3511
+ for (let k = 1; k < K; k++) if (dist2(i, centres[k]) < dist2(i, centres[best])) best = k;
3512
+ return best;
3513
+ };
3514
+ for (let round6 = 0; round6 < 6; round6++) {
3515
+ const sum = Array.from({ length: K }, () => [0, 0, 0, 0]);
3516
+ for (const i of sample) {
3517
+ const s = sum[closest(i)];
3518
+ s[0] += rgb[i * 3];
3519
+ s[1] += rgb[i * 3 + 1];
3520
+ s[2] += rgb[i * 3 + 2];
3521
+ s[3]++;
3522
+ }
3523
+ for (let k = 0; k < K; k++) if (sum[k][3]) centres[k] = [sum[k][0] / sum[k][3], sum[k][1] / sum[k][3], sum[k][2] / sum[k][3]];
3524
+ }
3525
+ for (const i of ids) comp[i] = closest(i);
3526
+ }
3527
+ function grabCutLabels(work, setup, iterations) {
3528
+ const { width: w, rgb } = work;
3529
+ const { roi, hardBg, hardFg } = setup;
3530
+ const { x: rx, y: ry, width: rw, height: rh } = roi;
3531
+ const n = rw * rh;
3532
+ const label = setup.initial.slice();
3533
+ const global = new Int32Array(n);
3534
+ for (let y = 0; y < rh; y++) for (let x = 0; x < rw; x++) global[y * rw + x] = (ry + y) * w + rx + x;
3535
+ const comp = new Uint8Array(w * work.height);
3536
+ const fg = new ColorGmm();
3537
+ const bg = new ColorGmm();
3538
+ const { right, down } = smoothnessWeights(work, roi);
3539
+ const HARD = 1e9;
3540
+ for (let iter = 0; iter < iterations; iter++) {
3541
+ const fgIds = [];
3542
+ const bgIds = [];
3543
+ for (let p = 0; p < n; p++) (label[p] ? fgIds : bgIds).push(global[p]);
3544
+ if (!fgIds.length) return label;
3545
+ if (iter === 0) {
3546
+ initialComponents(rgb, fgIds, comp);
3547
+ initialComponents(rgb, bgIds, comp);
3548
+ } else {
3549
+ for (const i of fgIds) comp[i] = fg.nearest(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]);
3550
+ for (const i of bgIds) comp[i] = bg.nearest(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]);
3551
+ }
3552
+ fg.fit(rgb, fgIds, comp);
3553
+ bg.fit(rgb, bgIds, comp);
3554
+ const graph = new GridGraph(rw, rh);
3555
+ for (let p = 0; p < n; p++) {
3556
+ if (hardBg[p]) graph.addTerminal(p, 0, HARD);
3557
+ else if (_optionalChain([hardFg, 'optionalAccess', _66 => _66[p]])) graph.addTerminal(p, HARD, 0);
3558
+ else {
3559
+ const i = global[p] * 3;
3560
+ graph.addTerminal(p, Math.round(bg.cost(rgb[i], rgb[i + 1], rgb[i + 2]) * UNITS), Math.round(fg.cost(rgb[i], rgb[i + 1], rgb[i + 2]) * UNITS));
3561
+ }
3562
+ if (p % rw + 1 < rw) graph.setEdge(p, 0, right[p]);
3563
+ if (p + rw < n) graph.setEdge(p, 1, down[p]);
3564
+ }
3565
+ graph.maxflow();
3566
+ let changed = 0;
3567
+ for (let p = 0; p < n; p++) {
3568
+ const v = graph.inSource(p) ? 1 : 0;
3569
+ if (v !== label[p]) changed++;
3570
+ label[p] = v;
3571
+ }
3572
+ if (changed <= n * 1e-3) break;
3573
+ }
3574
+ return label;
3575
+ }
3576
+ function keepMainPieces(label, rw, rh, seed) {
3577
+ const n = rw * rh;
3578
+ const piece = new Int32Array(n).fill(-1);
3579
+ const sizes = [];
3580
+ const stack = [];
3581
+ for (let s = 0; s < n; s++) {
3582
+ if (!label[s] || piece[s] >= 0) continue;
3583
+ const id = sizes.length;
3584
+ let size = 0;
3585
+ piece[s] = id;
3586
+ stack.push(s);
3587
+ while (stack.length) {
3588
+ const p = stack.pop();
3589
+ size++;
3590
+ const x = p % rw;
3591
+ for (const q of [x + 1 < rw ? p + 1 : -1, x > 0 ? p - 1 : -1, p + rw < n ? p + rw : -1, p - rw]) {
3592
+ if (q >= 0 && label[q] && piece[q] < 0) {
3593
+ piece[q] = id;
3594
+ stack.push(q);
3595
+ }
3596
+ }
3597
+ }
3598
+ sizes.push(size);
3599
+ }
3600
+ if (!sizes.length) return;
3601
+ const largest = Math.max(...sizes);
3602
+ const keep = (id) => seed !== null && piece[seed] >= 0 ? id === piece[seed] : sizes[id] * 5 >= largest;
3603
+ for (let p = 0; p < n; p++) if (label[p] && !keep(piece[p])) label[p] = 0;
3604
+ }
3605
+ function selectObjectIn(pixels, target, options = {}) {
3606
+ const work = workImage(pixels);
3607
+ const { width: w, height: h, scale } = work;
3608
+ const iterations = Math.max(1, Math.round(_nullishCoalesce(options.iterations, () => ( 5))));
3609
+ const enhance = _nullishCoalesce(options.enhanceEdge, () => ( false));
3610
+ if ("rect" in target) {
3611
+ const r = target.rect;
3612
+ const bx0 = Math.max(0, Math.floor(r.x * scale));
3613
+ const by0 = Math.max(0, Math.floor(r.y * scale));
3614
+ const bx1 = Math.min(w, Math.ceil((r.x + r.width) * scale));
3615
+ const by1 = Math.min(h, Math.ceil((r.y + r.height) * scale));
3616
+ if (bx1 - bx0 < 2 || by1 - by0 < 2) return _chunkUYXL6ZWQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height);
3617
+ const m = Math.max(8, Math.round(0.25 * Math.max(bx1 - bx0, by1 - by0)));
3618
+ const rx = Math.max(0, bx0 - m);
3619
+ const ry = Math.max(0, by0 - m);
3620
+ const roi = { x: rx, y: ry, width: Math.min(w, bx1 + m) - rx, height: Math.min(h, by1 + m) - ry };
3621
+ const n = roi.width * roi.height;
3622
+ const initial = new Uint8Array(n);
3623
+ const hardBg = new Uint8Array(n);
3624
+ for (let y = 0; y < roi.height; y++) {
3625
+ for (let x = 0; x < roi.width; x++) {
3626
+ const gx = rx + x;
3627
+ const gy = ry + y;
3628
+ const inside = gx >= bx0 && gx < bx1 && gy >= by0 && gy < by1;
3629
+ initial[y * roi.width + x] = inside ? 1 : 0;
3630
+ hardBg[y * roi.width + x] = inside ? 0 : 1;
3631
+ }
3632
+ }
3633
+ const label = grabCutLabels(work, { roi, initial, hardBg, hardFg: null }, iterations);
3634
+ keepMainPieces(label, roi.width, roi.height, null);
3635
+ return upscaleRegion(work, pixels, roi, label, enhance);
3636
+ }
3637
+ const px2 = Math.min(w - 1, Math.max(0, Math.floor(target.point.x * scale)));
3638
+ const py = Math.min(h - 1, Math.max(0, Math.floor(target.point.y * scale)));
3639
+ let half = Math.max(24, Math.round(0.3 * Math.max(w, h)));
3640
+ for (; ; ) {
3641
+ const rx = Math.max(0, px2 - half);
3642
+ const ry = Math.max(0, py - half);
3643
+ const roi = { x: rx, y: ry, width: Math.min(w, px2 + half + 1) - rx, height: Math.min(h, py + half + 1) - ry };
3644
+ const whole = roi.width === w && roi.height === h;
3645
+ const band = Math.max(4, Math.round(0.15 * half));
3646
+ const n = roi.width * roi.height;
3647
+ const initial = new Uint8Array(n);
3648
+ const hardBg = new Uint8Array(n);
3649
+ const hardFg = new Uint8Array(n);
3650
+ const inBand = (x, y) => rx > 0 && x < band || ry > 0 && y < band || rx + roi.width < w && x >= roi.width - band || ry + roi.height < h && y >= roi.height - band;
3651
+ for (let y = 0; y < roi.height; y++) {
3652
+ for (let x = 0; x < roi.width; x++) {
3653
+ const p = y * roi.width + x;
3654
+ if (inBand(x, y)) hardBg[p] = 1;
3655
+ else initial[p] = 1;
3656
+ if (Math.hypot(rx + x - px2, ry + y - py) <= 1.5) hardFg[p] = 1;
3657
+ }
3658
+ }
3659
+ const label = grabCutLabels(work, { roi, initial, hardBg, hardFg }, iterations);
3660
+ keepMainPieces(label, roi.width, roi.height, (py - ry) * roi.width + (px2 - rx));
3661
+ let touches = false;
3662
+ for (let y = 0; y < roi.height && !touches; y++) {
3663
+ for (let x = 0; x < roi.width; x++) {
3664
+ if (label[y * roi.width + x] && (inBand(x - 1, y) || inBand(x + 1, y) || inBand(x, y - 1) || inBand(x, y + 1))) {
3665
+ touches = true;
3666
+ break;
3667
+ }
3668
+ }
3669
+ }
3670
+ if (!touches || whole) return upscaleRegion(work, pixels, roi, label, enhance);
3671
+ half = Math.round(half * 1.6);
3672
+ }
3673
+ }
3674
+
3675
+ // src/image-editor/selection/segment/subject.ts
3676
+ function toLab(r, g, b) {
3677
+ const lin = (v) => {
3678
+ v /= 255;
3679
+ return v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
3680
+ };
3681
+ const R = lin(r);
3682
+ const G = lin(g);
3683
+ const B = lin(b);
3684
+ const f = (t) => t > 8856e-6 ? Math.cbrt(t) : 7.787 * t + 16 / 116;
3685
+ const x = f((0.4124 * R + 0.3576 * G + 0.1805 * B) / 0.95047);
3686
+ const y = f(0.2126 * R + 0.7152 * G + 0.0722 * B);
3687
+ const z = f((0.0193 * R + 0.1192 * G + 0.9505 * B) / 1.08883);
3688
+ return [116 * y - 16, 500 * (x - y), 200 * (y - z)];
3689
+ }
3690
+ function slicSuperpixels(work, target = 400, compactness = 10, rounds = 5) {
3691
+ const { width: w, height: h, rgb } = work;
3692
+ const n = w * h;
3693
+ const lab = new Float32Array(n * 3);
3694
+ for (let i = 0; i < n; i++) lab.set(toLab(rgb[i * 3], rgb[i * 3 + 1], rgb[i * 3 + 2]), i * 3);
3695
+ const S = Math.max(2, Math.round(Math.sqrt(n / target)));
3696
+ const seeds = [];
3697
+ for (let y = Math.floor(S / 2); y < h; y += S) {
3698
+ for (let x = Math.floor(S / 2); x < w; x += S) {
3699
+ const i = y * w + x;
3700
+ seeds.push([lab[i * 3], lab[i * 3 + 1], lab[i * 3 + 2], x, y]);
3701
+ }
3702
+ }
3703
+ const k = seeds.length;
3704
+ const label = new Int32Array(n).fill(-1);
3705
+ const best = new Float64Array(n);
3706
+ const m2 = (compactness / S) ** 2;
3707
+ for (let round6 = 0; round6 < rounds; round6++) {
3708
+ best.fill(Infinity);
3709
+ for (let c = 0; c < k; c++) {
3710
+ const [L, A, B, cx, cy] = seeds[c];
3711
+ const x0 = Math.max(0, Math.floor(cx - S));
3712
+ const x1 = Math.min(w - 1, Math.ceil(cx + S));
3713
+ const y0 = Math.max(0, Math.floor(cy - S));
3714
+ const y1 = Math.min(h - 1, Math.ceil(cy + S));
3715
+ for (let y = y0; y <= y1; y++) {
3716
+ for (let x = x0; x <= x1; x++) {
3717
+ const i = y * w + x;
3718
+ const d = (lab[i * 3] - L) ** 2 + (lab[i * 3 + 1] - A) ** 2 + (lab[i * 3 + 2] - B) ** 2 + m2 * ((x - cx) ** 2 + (y - cy) ** 2);
3719
+ if (d < best[i]) {
3720
+ best[i] = d;
3721
+ label[i] = c;
3722
+ }
3723
+ }
3724
+ }
3725
+ }
3726
+ const sum = new Float64Array(k * 6);
3727
+ for (let i = 0; i < n; i++) {
3728
+ const c = label[i];
3729
+ sum[c * 6] += lab[i * 3];
3730
+ sum[c * 6 + 1] += lab[i * 3 + 1];
3731
+ sum[c * 6 + 2] += lab[i * 3 + 2];
3732
+ sum[c * 6 + 3] += i % w;
3733
+ sum[c * 6 + 4] += Math.floor(i / w);
3734
+ sum[c * 6 + 5]++;
3735
+ }
3736
+ for (let c = 0; c < k; c++) {
3737
+ const s = sum[c * 6 + 5];
3738
+ if (s) seeds[c] = [sum[c * 6] / s, sum[c * 6 + 1] / s, sum[c * 6 + 2] / s, sum[c * 6 + 3] / s, sum[c * 6 + 4] / s];
3739
+ }
3740
+ }
3741
+ const remap = new Int32Array(k).fill(-1);
3742
+ let count = 0;
3743
+ for (let i = 0; i < n; i++) if (remap[label[i]] < 0) remap[label[i]] = count++;
3744
+ const meanLab = new Float64Array(count * 3);
3745
+ const centre = new Float64Array(count * 2);
3746
+ const size = new Int32Array(count);
3747
+ for (let i = 0; i < n; i++) {
3748
+ const c = label[i] = remap[label[i]];
3749
+ meanLab[c * 3] += lab[i * 3];
3750
+ meanLab[c * 3 + 1] += lab[i * 3 + 1];
3751
+ meanLab[c * 3 + 2] += lab[i * 3 + 2];
3752
+ centre[c * 2] += i % w;
3753
+ centre[c * 2 + 1] += Math.floor(i / w);
3754
+ size[c]++;
3755
+ }
3756
+ for (let c = 0; c < count; c++) {
3757
+ for (let j = 0; j < 3; j++) meanLab[c * 3 + j] /= size[c];
3758
+ centre[c * 2] /= size[c];
3759
+ centre[c * 2 + 1] /= size[c];
3760
+ }
3761
+ return { label, count, lab: meanLab, centre, size };
3762
+ }
3763
+ function superpixelSaliency(sp, width, height) {
3764
+ const { count, lab, centre, size, label } = sp;
3765
+ const dist = (a, b) => Math.hypot(lab[a * 3] - lab[b * 3], lab[a * 3 + 1] - lab[b * 3 + 1], lab[a * 3 + 2] - lab[b * 3 + 2]);
3766
+ const onBorder = new Uint8Array(count);
3767
+ for (let x = 0; x < width; x++) {
3768
+ onBorder[label[x]] = 1;
3769
+ onBorder[label[(height - 1) * width + x]] = 1;
3770
+ }
3771
+ for (let y = 0; y < height; y++) {
3772
+ onBorder[label[y * width]] = 1;
3773
+ onBorder[label[y * width + width - 1]] = 1;
3774
+ }
3775
+ const border = [];
3776
+ for (let c = 0; c < count; c++) if (onBorder[c]) border.push(c);
3777
+ const diag = Math.hypot(width, height);
3778
+ const unlikeBorder = new Float64Array(count);
3779
+ const contrast = new Float64Array(count);
3780
+ const centreBias = new Float64Array(count);
3781
+ for (let i = 0; i < count; i++) {
3782
+ const ds = border.map((j) => dist(i, j)).sort((a, b) => a - b);
3783
+ unlikeBorder[i] = ds.length ? ds[Math.floor(ds.length * 0.25)] : 0;
3784
+ let s = 0;
3785
+ let wsum = 0;
3786
+ for (let j = 0; j < count; j++) {
3787
+ if (j === i) continue;
3788
+ const dx = (centre[i * 2] - centre[j * 2]) / diag;
3789
+ const dy = (centre[i * 2 + 1] - centre[j * 2 + 1]) / diag;
3790
+ const wgt = size[j] * Math.exp(-(dx * dx + dy * dy) / (2 * 0.25 * 0.25));
3791
+ s += wgt * dist(i, j);
3792
+ wsum += wgt;
3793
+ }
3794
+ contrast[i] = wsum ? s / wsum : 0;
3795
+ const cx = centre[i * 2] / width - 0.5;
3796
+ const cy = centre[i * 2 + 1] / height - 0.5;
3797
+ centreBias[i] = 0.4 + 0.6 * Math.exp(-(cx * cx + cy * cy) / (2 * 0.3 * 0.3));
3798
+ }
3799
+ let farthest = 0;
3800
+ for (const v of unlikeBorder) farthest = Math.max(farthest, v);
3801
+ if (farthest < 6) return new Float64Array(count);
3802
+ const norm = (a) => {
3803
+ let max = 0;
3804
+ for (const v of a) max = Math.max(max, v);
3805
+ if (max > 0) for (let i = 0; i < a.length; i++) a[i] /= max;
3806
+ };
3807
+ norm(unlikeBorder);
3808
+ norm(contrast);
3809
+ const out = new Float64Array(count);
3810
+ for (let i = 0; i < count; i++) out[i] = unlikeBorder[i] * (0.3 + 0.7 * contrast[i]) * centreBias[i];
3811
+ norm(out);
3812
+ return out;
3813
+ }
3814
+ function otsuThreshold(values, weights) {
3815
+ const BINS2 = 64;
3816
+ const hist = new Float64Array(BINS2);
3817
+ let total = 0;
3818
+ for (let i = 0; i < values.length; i++) {
3819
+ hist[Math.min(BINS2 - 1, Math.floor(values[i] * BINS2))] += weights[i];
3820
+ total += weights[i];
3821
+ }
3822
+ let sumAll = 0;
3823
+ for (let b = 0; b < BINS2; b++) sumAll += b * hist[b];
3824
+ let wB = 0;
3825
+ let sumB = 0;
3826
+ let best = 0;
3827
+ let bestT = 0.5;
3828
+ for (let b = 0; b < BINS2 - 1; b++) {
3829
+ wB += hist[b];
3830
+ if (!wB) continue;
3831
+ const wF = total - wB;
3832
+ if (!wF) break;
3833
+ sumB += b * hist[b];
3834
+ const between = wB * wF * (sumB / wB - (sumAll - sumB) / wF) ** 2;
3835
+ if (between > best) {
3836
+ best = between;
3837
+ bestT = (b + 1) / BINS2;
3838
+ }
3839
+ }
3840
+ return bestT;
3841
+ }
3842
+ function findSubject(pixels, options = {}) {
3843
+ const work = workImage(pixels);
3844
+ const { width: w, height: h } = work;
3845
+ const sp = slicSuperpixels(work);
3846
+ const sal = superpixelSaliency(sp, w, h);
3847
+ const t = otsuThreshold(sal, sp.size);
3848
+ const n = w * h;
3849
+ const initial = new Uint8Array(n);
3850
+ const hardBg = new Uint8Array(n);
3851
+ const hardFg = new Uint8Array(n);
3852
+ const strong = t + 0.6 * (1 - t);
3853
+ for (let i = 0; i < n; i++) {
3854
+ const s = sal[sp.label[i]];
3855
+ if (s >= t) initial[i] = 1;
3856
+ if (s >= strong) hardFg[i] = 1;
3857
+ }
3858
+ for (let x = 0; x < w; x++) {
3859
+ for (const y of [0, h - 1]) if (sal[sp.label[y * w + x]] < t * 0.5) hardBg[y * w + x] = 1;
3860
+ }
3861
+ for (let y = 0; y < h; y++) {
3862
+ for (const x of [0, w - 1]) if (sal[sp.label[y * w + x]] < t * 0.5) hardBg[y * w + x] = 1;
3863
+ }
3864
+ const empty = (reason) => ({ selection: _chunkUYXL6ZWQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height), reason });
3865
+ let guessed = 0;
3866
+ for (let i = 0; i < n; i++) guessed += initial[i];
3867
+ if (!guessed || guessed > n * 0.95) return empty("Nothing stands out from the background.");
3868
+ const roi = { x: 0, y: 0, width: w, height: h };
3869
+ const label = grabCutLabels(work, { roi, initial, hardBg, hardFg }, 5);
3870
+ keepMainPieces(label, w, h, null);
3871
+ let kept = 0;
3872
+ for (let i = 0; i < n; i++) kept += label[i];
3873
+ if (kept < n * 2e-3) return empty("Nothing stands out from the background.");
3874
+ if (kept > n * 0.97) return empty("The whole image looks like one subject; select it with select_all instead.");
3875
+ return { selection: upscaleRegion(work, pixels, roi, label, _nullishCoalesce(options.enhanceEdge, () => ( false))) };
3876
+ }
3877
+
3389
3878
  // src/image-editor/layers/shape-type-ui.ts
3390
3879
  var DEFAULT_SHAPE_TOOL_OPTIONS = {
3391
3880
  kind: "rect",
@@ -3444,16 +3933,16 @@ function liveShapeForDrag(o, a, b, mods = {}) {
3444
3933
  }
3445
3934
  return null;
3446
3935
  }
3447
- var ShapeDrawGesture = (_class6 = class {
3448
- constructor(controller, options) {;_class6.prototype.__init34.call(this);_class6.prototype.__init35.call(this);_class6.prototype.__init36.call(this);
3936
+ var ShapeDrawGesture = (_class7 = class {
3937
+ constructor(controller, options) {;_class7.prototype.__init38.call(this);_class7.prototype.__init39.call(this);_class7.prototype.__init40.call(this);
3449
3938
  this.controller = controller;
3450
3939
  this.options = options;
3451
3940
  }
3452
3941
 
3453
3942
 
3454
- __init34() {this.start = null}
3455
- __init35() {this.layerId = null}
3456
- __init36() {this.error = null}
3943
+ __init38() {this.start = null}
3944
+ __init39() {this.layerId = null}
3945
+ __init40() {this.error = null}
3457
3946
  get active() {
3458
3947
  return this.start !== null;
3459
3948
  }
@@ -3492,17 +3981,17 @@ var ShapeDrawGesture = (_class6 = class {
3492
3981
  cancel() {
3493
3982
  this.start = null;
3494
3983
  }
3495
- }, _class6);
3984
+ }, _class7);
3496
3985
  function applyShapeOptions(controller, layerId, change) {
3497
3986
  const info = controller.getShapeLayer(layerId);
3498
3987
  const style = {};
3499
3988
  if ("fill" in change) style.fill = _nullishCoalesce(change.fill, () => ( null));
3500
3989
  if ("stroke" in change || "strokeWidth" in change) {
3501
- const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _66 => _66.stroke, 'optionalAccess', _67 => _67.paint, 'access', _68 => _68.type]) === "color" ? info.stroke.paint.color : null;
3502
- style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _69 => _69.stroke, 'optionalAccess', _70 => _70.width]))), () => ( 2)), paint: color } : null;
3990
+ const color = "stroke" in change ? change.stroke : _optionalChain([info, 'access', _67 => _67.stroke, 'optionalAccess', _68 => _68.paint, 'access', _69 => _69.type]) === "color" ? info.stroke.paint.color : null;
3991
+ style.stroke = color ? { width: _nullishCoalesce(_nullishCoalesce(change.strokeWidth, () => ( _optionalChain([info, 'access', _70 => _70.stroke, 'optionalAccess', _71 => _71.width]))), () => ( 2)), paint: color } : null;
3503
3992
  }
3504
3993
  if (Object.keys(style).length) controller.setShapeStyle(layerId, style);
3505
- const live = _optionalChain([info, 'access', _71 => _71.components, 'access', _72 => _72[0], 'optionalAccess', _73 => _73.live]);
3994
+ const live = _optionalChain([info, 'access', _72 => _72.components, 'access', _73 => _73[0], 'optionalAccess', _74 => _74.live]);
3506
3995
  if (!live) return;
3507
3996
  const shape = {};
3508
3997
  if (live.kind === "rect" && change.radius !== void 0) shape.radius = change.radius;
@@ -3513,8 +4002,8 @@ function applyShapeOptions(controller, layerId, change) {
3513
4002
  if (live.kind === "line" && change.arrow !== void 0) shape.endArrow = change.arrow ? { width: (live.weight || 1) * 4, length: (live.weight || 1) * 4 } : null;
3514
4003
  if (Object.keys(shape).length) controller.setShapeComponent(layerId, 0, { shape });
3515
4004
  }
3516
- var TextEditSession = (_class7 = class {
3517
- constructor(controller, layerId, index) {;_class7.prototype.__init37.call(this);_class7.prototype.__init38.call(this);_class7.prototype.__init39.call(this);
4005
+ var TextEditSession = (_class8 = class {
4006
+ constructor(controller, layerId, index) {;_class8.prototype.__init41.call(this);_class8.prototype.__init42.call(this);_class8.prototype.__init43.call(this);
3518
4007
  this.controller = controller;
3519
4008
  this.layerId = layerId;
3520
4009
  const n = this.text.length;
@@ -3524,11 +4013,11 @@ var TextEditSession = (_class7 = class {
3524
4013
 
3525
4014
 
3526
4015
 
3527
- __init37() {this.changed = false}
3528
- __init38() {this.listeners = /* @__PURE__ */ new Set()}
3529
- __init39() {this.error = null}
4016
+ __init41() {this.changed = false}
4017
+ __init42() {this.listeners = /* @__PURE__ */ new Set()}
4018
+ __init43() {this.error = null}
3530
4019
  get layer() {
3531
- const l = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _74 => _74.layer]);
4020
+ const l = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _75 => _75.layer]);
3532
4021
  if (!l || l.type !== "type") throw new Error("The type layer being edited is gone.");
3533
4022
  return l;
3534
4023
  }
@@ -3543,7 +4032,7 @@ var TextEditSession = (_class7 = class {
3543
4032
  }
3544
4033
  /** Whether the layer still exists (it can be deleted or undone away while editing). */
3545
4034
  get alive() {
3546
- return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _75 => _75.layer, 'access', _76 => _76.type]) === "type";
4035
+ return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.controller.getLayers(), this.layerId), 'optionalAccess', _76 => _76.layer, 'access', _77 => _77.type]) === "type";
3547
4036
  }
3548
4037
  subscribe(fn) {
3549
4038
  this.listeners.add(fn);
@@ -3741,7 +4230,7 @@ var TextEditSession = (_class7 = class {
3741
4230
  }
3742
4231
  return true;
3743
4232
  }
3744
- }, _class7);
4233
+ }, _class8);
3745
4234
  function typeLayerAt(controller, p, slop = 4) {
3746
4235
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
3747
4236
  for (const l of layers) {
@@ -3774,16 +4263,16 @@ function invert(m) {
3774
4263
  const det = a * d - b * c || 1;
3775
4264
  return [d / det, -b / det, -c / det, a / det, (c * f - d * e) / det, (b * e - a * f) / det];
3776
4265
  }
3777
- var TypeToolGesture = (_class8 = class {
3778
- constructor(controller, options) {;_class8.prototype.__init40.call(this);_class8.prototype.__init41.call(this);_class8.prototype.__init42.call(this);
4266
+ var TypeToolGesture = (_class9 = class {
4267
+ constructor(controller, options) {;_class9.prototype.__init44.call(this);_class9.prototype.__init45.call(this);_class9.prototype.__init46.call(this);
3779
4268
  this.controller = controller;
3780
4269
  this.options = options;
3781
4270
  }
3782
4271
 
3783
4272
 
3784
- __init40() {this.session = null}
3785
- __init41() {this.dragStart = null}
3786
- __init42() {this.error = null}
4273
+ __init44() {this.session = null}
4274
+ __init45() {this.dragStart = null}
4275
+ __init46() {this.error = null}
3787
4276
  down(p, mods = {}) {
3788
4277
  this.error = null;
3789
4278
  const hit = typeLayerAt(this.controller, p);
@@ -3831,9 +4320,9 @@ var TypeToolGesture = (_class8 = class {
3831
4320
  finish() {
3832
4321
  const s = this.session;
3833
4322
  this.session = null;
3834
- _optionalChain([s, 'optionalAccess', _77 => _77.close, 'call', _78 => _78()]);
4323
+ _optionalChain([s, 'optionalAccess', _78 => _78.close, 'call', _79 => _79()]);
3835
4324
  }
3836
- }, _class8);
4325
+ }, _class9);
3837
4326
 
3838
4327
  // src/image-editor/selection/shapes.ts
3839
4328
  function polygonCoverage(points, width, height, antiAlias = true) {
@@ -4300,7 +4789,7 @@ function segmentToSelection(width, height, result) {
4300
4789
  const sized = raw.width === width && raw.height === height ? raw : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, raw, width, height);
4301
4790
  out = _chunkUYXL6ZWQcjs.combineSelections.call(void 0, out, sized, "add");
4302
4791
  }
4303
- return _optionalChain([out, 'optionalAccess', _79 => _79.bounds]) ? out : null;
4792
+ return _optionalChain([out, 'optionalAccess', _80 => _80.bounds]) ? out : null;
4304
4793
  }
4305
4794
  function segmentsToSelection(width, height, results) {
4306
4795
  let out = null;
@@ -4581,7 +5070,7 @@ function deserializeChannels(value, size, problems = []) {
4581
5070
  visible: v.visible === true
4582
5071
  });
4583
5072
  } catch (err) {
4584
- problems.push(`Alpha channel "${String(_nullishCoalesce(_optionalChain([v, 'optionalAccess', _80 => _80.name]), () => ( "?")))}" could not be read: ${err instanceof Error ? err.message : String(err)}.`);
5073
+ problems.push(`Alpha channel "${String(_nullishCoalesce(_optionalChain([v, 'optionalAccess', _81 => _81.name]), () => ( "?")))}" could not be read: ${err instanceof Error ? err.message : String(err)}.`);
4585
5074
  }
4586
5075
  }
4587
5076
  return out;
@@ -4619,16 +5108,16 @@ function checkEffectTime(time) {
4619
5108
  return time;
4620
5109
  }
4621
5110
  function checkEffectAnimation(animate) {
4622
- const duration = _optionalChain([animate, 'optionalAccess', _81 => _81.duration]);
5111
+ const duration = _optionalChain([animate, 'optionalAccess', _82 => _82.duration]);
4623
5112
  if (!(typeof duration === "number" && Number.isFinite(duration) && duration > 0 && duration <= _chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS)) {
4624
5113
  throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`animate.duration must be more than 0 and at most ${_chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS} ms.`);
4625
5114
  }
4626
5115
  return { duration: Math.round(duration) };
4627
5116
  }
4628
5117
  function effectLayerTiming(g, d) {
4629
- if (!_optionalChain([d, 'optionalAccess', _82 => _82.duration])) return null;
5118
+ if (!_optionalChain([d, 'optionalAccess', _83 => _83.duration])) return null;
4630
5119
  const time = _nullishCoalesce(g.time, () => ( 0));
4631
- return { mode: g.animate ? "animate" : "still", time, range: Math.max(d.duration, time), duration: _nullishCoalesce(_optionalChain([g, 'access', _83 => _83.animate, 'optionalAccess', _84 => _84.duration]), () => ( d.duration)), loops: d.loop };
5120
+ return { mode: g.animate ? "animate" : "still", time, range: Math.max(d.duration, time), duration: _nullishCoalesce(_optionalChain([g, 'access', _84 => _84.animate, 'optionalAccess', _85 => _85.duration]), () => ( d.duration)), loops: d.loop };
4632
5121
  }
4633
5122
 
4634
5123
  // src/image-editor/effects.ts
@@ -4673,18 +5162,18 @@ function effectPixelsToSurface(p, depth) {
4673
5162
  }
4674
5163
  return _chunkCWM3CUUXcjs.surfaceFromDeepPixels.call(void 0, { width: p.width, height: p.height, data: d }, 4);
4675
5164
  }
4676
- var ImageEffectsEngine = (_class9 = class {
5165
+ var ImageEffectsEngine = (_class10 = class {
4677
5166
 
4678
- __init43() {this.cache = /* @__PURE__ */ new Map()}
4679
- __init44() {this.pending = /* @__PURE__ */ new Map()}
4680
- __init45() {this.failures = /* @__PURE__ */ new Map()}
5167
+ __init47() {this.cache = /* @__PURE__ */ new Map()}
5168
+ __init48() {this.pending = /* @__PURE__ */ new Map()}
5169
+ __init49() {this.failures = /* @__PURE__ */ new Map()}
4681
5170
 
4682
- __init46() {this.descriptions = /* @__PURE__ */ new Map()}
4683
- __init47() {this.listeners = /* @__PURE__ */ new Set()}
5171
+ __init50() {this.descriptions = /* @__PURE__ */ new Map()}
5172
+ __init51() {this.listeners = /* @__PURE__ */ new Set()}
4684
5173
 
4685
- __init48() {this.generation = 0}
5174
+ __init52() {this.generation = 0}
4686
5175
 
4687
- constructor(options = {}) {;_class9.prototype.__init43.call(this);_class9.prototype.__init44.call(this);_class9.prototype.__init45.call(this);_class9.prototype.__init46.call(this);_class9.prototype.__init47.call(this);_class9.prototype.__init48.call(this);
5176
+ constructor(options = {}) {;_class10.prototype.__init47.call(this);_class10.prototype.__init48.call(this);_class10.prototype.__init49.call(this);_class10.prototype.__init50.call(this);_class10.prototype.__init51.call(this);_class10.prototype.__init52.call(this);
4688
5177
  this.slot = _nullishCoalesce(options.slot, () => ( new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()));
4689
5178
  this.maxEntries = _nullishCoalesce(options.maxEntries, () => ( 24));
4690
5179
  this.pool = new (0, _chunkPY4GWSE2cjs.EffectRendererPool)({ maxRenderers: options.maxRenderers });
@@ -4793,7 +5282,7 @@ var ImageEffectsEngine = (_class9 = class {
4793
5282
  this.detach();
4794
5283
  this.listeners.clear();
4795
5284
  }
4796
- }, _class9);
5285
+ }, _class10);
4797
5286
 
4798
5287
  // src/image-editor/free-transform.ts
4799
5288
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
@@ -4875,20 +5364,20 @@ function liftMask(mask, sel, o) {
4875
5364
  }
4876
5365
  return { lifted: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: area.width, height: area.height, data: lifted }, 4, area.x, area.y), rest: _chunkCWM3CUUXcjs.writeRegion.call(void 0, mask, area, rest) };
4877
5366
  }
4878
- var FreeTransformSession = (_class10 = class {
4879
- constructor(host, init = {}) {;_class10.prototype.__init49.call(this);_class10.prototype.__init50.call(this);_class10.prototype.__init51.call(this);_class10.prototype.__init52.call(this);_class10.prototype.__init53.call(this);_class10.prototype.__init54.call(this);_class10.prototype.__init55.call(this);_class10.prototype.__init56.call(this);_class10.prototype.__init57.call(this);_class10.prototype.__init58.call(this);_class10.prototype.__init59.call(this);
5367
+ var FreeTransformSession = (_class11 = class {
5368
+ constructor(host, init = {}) {;_class11.prototype.__init53.call(this);_class11.prototype.__init54.call(this);_class11.prototype.__init55.call(this);_class11.prototype.__init56.call(this);_class11.prototype.__init57.call(this);_class11.prototype.__init58.call(this);_class11.prototype.__init59.call(this);_class11.prototype.__init60.call(this);_class11.prototype.__init61.call(this);_class11.prototype.__init62.call(this);_class11.prototype.__init63.call(this);
4880
5369
  this.host = host;
4881
5370
  if (init.interpolation !== void 0 && !_chunkHGTDMKNEcjs.isInterpolation.call(void 0, init.interpolation)) fail(`Unknown interpolation "${String(init.interpolation)}"; use nearest, bilinear or bicubic.`);
4882
5371
  this.interp = _nullishCoalesce(init.interpolation, () => ( "bicubic"));
4883
5372
  const sel = host.selection();
4884
- const selected = Boolean(_optionalChain([sel, 'optionalAccess', _85 => _85.bounds]));
5373
+ const selected = Boolean(_optionalChain([sel, 'optionalAccess', _86 => _86.bounds]));
4885
5374
  let content = _nullishCoalesce(init.content, () => ( "auto"));
4886
5375
  if (!["auto", "layer", "selection", "selection-copy", "selection-outline"].includes(content)) {
4887
5376
  fail(`Unknown content "${String(content)}"; use auto, layer, selection, selection-copy or selection-outline.`);
4888
5377
  }
4889
5378
  const targetId = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
4890
- const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _86 => _86.layer]) : void 0;
4891
- const smartTarget = (_optionalChain([target, 'optionalAccess', _87 => _87.type]) === "smart" || _optionalChain([target, 'optionalAccess', _88 => _88.type]) === "shape" || _optionalChain([target, 'optionalAccess', _89 => _89.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
5379
+ const target = targetId && content !== "selection-outline" ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, host.layers(), targetId), 'optionalAccess', _87 => _87.layer]) : void 0;
5380
+ const smartTarget = (_optionalChain([target, 'optionalAccess', _88 => _88.type]) === "smart" || _optionalChain([target, 'optionalAccess', _89 => _89.type]) === "shape" || _optionalChain([target, 'optionalAccess', _90 => _90.type]) === "type") && (_nullishCoalesce(init.channel, () => ( (target.id === host.activeLayerId() ? host.activeTarget() : "pixels")))) !== "mask";
4892
5381
  if (content === "auto") content = selected && !smartTarget ? "selection" : "layer";
4893
5382
  this.content = content;
4894
5383
  if (content !== "layer" && !selected) fail(`Nothing is selected; ${content} needs a selection. Select first, or use content layer.`);
@@ -4912,9 +5401,9 @@ var FreeTransformSession = (_class10 = class {
4912
5401
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
4913
5402
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
4914
5403
  if (channel !== "pixels" && channel !== "mask") fail(`Unknown channel "${String(channel)}"; use pixels or mask.`);
4915
- const linked = _optionalChain([mask, 'optionalAccess', _90 => _90.linked]) !== false;
5404
+ const linked = _optionalChain([mask, 'optionalAccess', _91 => _91.linked]) !== false;
4916
5405
  const maskAlone = channel === "mask" && (!linked || layer.type !== "pixel");
4917
- if (channel === "mask" && !mask) fail(_optionalChain([layer, 'access', _91 => _91.mask, 'optionalAccess', _92 => _92.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
5406
+ if (channel === "mask" && !mask) fail(_optionalChain([layer, 'access', _92 => _92.mask, 'optionalAccess', _93 => _93.source]) ? `Layer "${layer.name || id}" has a depth mask, which is generated, not transformed.` : `Layer "${layer.name || id}" has no mask to transform; add one with add_layer_mask, or transform its pixels.`);
4918
5407
  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.`);
4919
5408
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
4920
5409
  if (content !== "selection-copy") {
@@ -5017,7 +5506,7 @@ var FreeTransformSession = (_class10 = class {
5017
5506
  };
5018
5507
  this.copyId = copy.id;
5019
5508
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, layer.id);
5020
- this.startLayers = _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _93 => _93.parent, 'optionalAccess', _94 => _94.id]), () => ( null)), loc.index + 1);
5509
+ this.startLayers = _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _94 => _94.parent, 'optionalAccess', _95 => _95.id]), () => ( null)), loc.index + 1);
5021
5510
  this.parts.push({ what: "pixels", offset: o, moving: lifted, base: null, reduced: /* @__PURE__ */ new Map() });
5022
5511
  moves.push("pixels");
5023
5512
  }
@@ -5043,7 +5532,7 @@ var FreeTransformSession = (_class10 = class {
5043
5532
  /** The layer being transformed (`null` for `selection-outline`). */
5044
5533
 
5045
5534
  /** The new layer of a `selection-copy`. */
5046
- __init49() {this.copyId = null}
5535
+ __init53() {this.copyId = null}
5047
5536
  /** The frame (document pixels). */
5048
5537
 
5049
5538
  /** What moves. */
@@ -5055,27 +5544,27 @@ var FreeTransformSession = (_class10 = class {
5055
5544
  */
5056
5545
 
5057
5546
  /** True when the layer is a smart object (the transform sets its placement). */
5058
- __init50() {this.smartObject = false}
5547
+ __init54() {this.smartObject = false}
5059
5548
  /** True when the layer is a shape layer (the transform maps its paths and renders them again). */
5060
- __init51() {this.shapeLayer = false}
5061
- __init52() {this.shape = null}
5549
+ __init55() {this.shapeLayer = false}
5550
+ __init56() {this.shape = null}
5062
5551
  /** True when the layer is a type layer (the transform sets its text matrix; affine only). */
5063
- __init53() {this.typeLayer = false}
5064
- __init54() {this.typeTarget = null}
5552
+ __init57() {this.typeLayer = false}
5553
+ __init58() {this.typeTarget = null}
5065
5554
 
5066
- __init55() {this.smart = null}
5067
- __init56() {this.smartReduced = /* @__PURE__ */ new Map()}
5555
+ __init59() {this.smart = null}
5556
+ __init60() {this.smartReduced = /* @__PURE__ */ new Map()}
5068
5557
 
5069
- __init57() {this.smartMasksMoved = false}
5558
+ __init61() {this.smartMasksMoved = false}
5070
5559
 
5071
- __init58() {this.parts = []}
5560
+ __init62() {this.parts = []}
5072
5561
 
5073
5562
 
5074
5563
 
5075
5564
 
5076
5565
  /** The stack this session last showed: anything else means the document changed under it. */
5077
5566
 
5078
- __init59() {this.closed = false}
5567
+ __init63() {this.closed = false}
5079
5568
  /** The current geometry. */
5080
5569
  get geometry() {
5081
5570
  return this.geometryValue;
@@ -5126,7 +5615,7 @@ var FreeTransformSession = (_class10 = class {
5126
5615
  moveVectorMask(layers) {
5127
5616
  const g = this.geometryValue;
5128
5617
  if (!this.layerId || this.copyId || !this.moves.includes("pixels") || _chunkUYXL6ZWQcjs.isIdentityTransform.call(void 0, g)) return layers;
5129
- const vm = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, this.layerId), 'optionalAccess', _95 => _95.layer, 'access', _96 => _96.vectorMask]);
5618
+ const vm = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, this.layerId), 'optionalAccess', _96 => _96.layer, 'access', _97 => _97.vectorMask]);
5130
5619
  if (!vm || vm.linked === false) return layers;
5131
5620
  const warp = _chunkUYXL6ZWQcjs.hasWarp.call(void 0, g);
5132
5621
  const f = warp ? _chunkUYXL6ZWQcjs.transformMap.call(void 0, g) : null;
@@ -5297,11 +5786,11 @@ var FreeTransformSession = (_class10 = class {
5297
5786
  result(changed, layers, selection) {
5298
5787
  let bounds = null;
5299
5788
  const id = _nullishCoalesce(this.copyId, () => ( this.layerId));
5300
- const layer = id ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _97 => _97.layer]) : void 0;
5301
- if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _98 => _98.type]) === "pixel") bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
5302
- else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _99 => _99.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _100 => _100.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _101 => _101.type]) === "type")) bounds = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
5303
- else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _102 => _102.mask])) bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
5304
- else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _103 => _103.bounds]) ? { ...selection.bounds } : null;
5789
+ const layer = id ? _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _98 => _98.layer]) : void 0;
5790
+ if (this.moves.includes("pixels") && _optionalChain([layer, 'optionalAccess', _99 => _99.type]) === "pixel") bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, this.host.pixelsOf(layer)), layer.offset);
5791
+ else if (this.moves.includes("pixels") && (_optionalChain([layer, 'optionalAccess', _100 => _100.type]) === "smart" || _optionalChain([layer, 'optionalAccess', _101 => _101.type]) === "shape" || _optionalChain([layer, 'optionalAccess', _102 => _102.type]) === "type")) bounds = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
5792
+ else if (this.moves.includes("mask") && _optionalChain([layer, 'optionalAccess', _103 => _103.mask])) bounds = toDoc(_chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.mask.surface), layer.type === "pixel" ? layer.offset : { x: 0, y: 0 });
5793
+ else if (this.moves.includes("selection")) bounds = _optionalChain([selection, 'optionalAccess', _104 => _104.bounds]) ? { ...selection.bounds } : null;
5305
5794
  return {
5306
5795
  layerId: _nullishCoalesce(this.copyId, () => ( this.layerId)),
5307
5796
  content: this.content,
@@ -5312,7 +5801,7 @@ var FreeTransformSession = (_class10 = class {
5312
5801
  changed
5313
5802
  };
5314
5803
  }
5315
- }, _class10);
5804
+ }, _class11);
5316
5805
 
5317
5806
  // src/image-editor/color-management.ts
5318
5807
  var DEFAULT_PROOF = { intent: "relative", bpc: true, simulatePaper: false, gamutWarning: false };
@@ -5330,7 +5819,7 @@ function deserializeColorMode(raw, problems) {
5330
5819
  }
5331
5820
  function effectiveProof(proof, mode) {
5332
5821
  if (proof) return proof;
5333
- if (_optionalChain([mode, 'optionalAccess', _104 => _104.mode]) === "cmyk") return { ...DEFAULT_PROOF, profile: mode.profile, intent: mode.intent };
5822
+ if (_optionalChain([mode, 'optionalAccess', _105 => _105.mode]) === "cmyk") return { ...DEFAULT_PROOF, profile: mode.profile, intent: mode.intent };
5334
5823
  return null;
5335
5824
  }
5336
5825
  function colorModePlanes(doc, mode) {
@@ -5385,7 +5874,7 @@ function resolveProfile(doc) {
5385
5874
  return p;
5386
5875
  }
5387
5876
  function profileBytes(doc) {
5388
- if (_optionalChain([doc, 'optionalAccess', _105 => _105.icc])) return doc.icc;
5877
+ if (_optionalChain([doc, 'optionalAccess', _106 => _106.icc])) return doc.icc;
5389
5878
  const p = resolveProfile(doc);
5390
5879
  return _nullishCoalesce(p.bytes, () => ( _chunkBROJYMWUcjs.encodeProfile.call(void 0, p)));
5391
5880
  }
@@ -5547,7 +6036,7 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
5547
6036
  else tiles.delete(key);
5548
6037
  continue;
5549
6038
  }
5550
- const src = _nullishCoalesce(_optionalChain([base, 'access', _106 => _106.tiles, 'access', _107 => _107.get, 'call', _108 => _108(key), 'optionalAccess', _109 => _109.data]), () => ( defaultTile(base)));
6039
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _107 => _107.tiles, 'access', _108 => _108.get, 'call', _109 => _109(key), 'optionalAccess', _110 => _110.data]), () => ( defaultTile(base)));
5551
6040
  const data = _chunkEBDCRTZIcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
5552
6041
  const tile = _chunkCWM3CUUXcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
5553
6042
  if (tile) tiles.set(key, tile);
@@ -5561,8 +6050,8 @@ function defaultTile(s) {
5561
6050
  if (s.defaultValue) d.fill(s.defaultValue);
5562
6051
  return d;
5563
6052
  }
5564
- var PaintStrokeSession = (_class11 = class {
5565
- constructor(controller, target, stroke, apply, depth = null) {;_class11.prototype.__init60.call(this);_class11.prototype.__init61.call(this);_class11.prototype.__init62.call(this);_class11.prototype.__init63.call(this);_class11.prototype.__init64.call(this);_class11.prototype.__init65.call(this);_class11.prototype.__init66.call(this);_class11.prototype.__init67.call(this);_class11.prototype.__init68.call(this);_class11.prototype.__init69.call(this);_class11.prototype.__init70.call(this);
6053
+ var PaintStrokeSession = (_class12 = class {
6054
+ constructor(controller, target, stroke, apply, depth = null) {;_class12.prototype.__init64.call(this);_class12.prototype.__init65.call(this);_class12.prototype.__init66.call(this);_class12.prototype.__init67.call(this);_class12.prototype.__init68.call(this);_class12.prototype.__init69.call(this);_class12.prototype.__init70.call(this);_class12.prototype.__init71.call(this);_class12.prototype.__init72.call(this);_class12.prototype.__init73.call(this);_class12.prototype.__init74.call(this);
5566
6055
  this.controller = controller;
5567
6056
  this.target = target;
5568
6057
  this.apply = apply;
@@ -5599,28 +6088,28 @@ var PaintStrokeSession = (_class11 = class {
5599
6088
 
5600
6089
 
5601
6090
 
5602
- __init60() {this.touched = /* @__PURE__ */ new Set()}
6091
+ __init64() {this.touched = /* @__PURE__ */ new Set()}
5603
6092
 
5604
6093
 
5605
- __init61() {this.mixerInit = null}
5606
- __init62() {this.retouch = null}
6094
+ __init65() {this.mixerInit = null}
6095
+ __init66() {this.retouch = null}
5607
6096
  /** Writes a mask's RGBA view back (sequential retouching on a mask). */
5608
- __init63() {this.flushView = null}
5609
- __init64() {this.started = false}
6097
+ __init67() {this.flushView = null}
6098
+ __init68() {this.started = false}
5610
6099
  /** Mixer tiles written since the last update: they get new tile objects so the compositor sees them change. */
5611
- __init65() {this.fresh = /* @__PURE__ */ new Set()}
5612
- __init66() {this.last = null}
5613
- __init67() {this.closed = false}
6100
+ __init69() {this.fresh = /* @__PURE__ */ new Set()}
6101
+ __init70() {this.last = null}
6102
+ __init71() {this.closed = false}
5614
6103
  /** Brush and eraser strokes on a 16- or 32-bit document: the deep samples of each touched tile. */
5615
6104
 
5616
- __init68() {this.liveDeep = /* @__PURE__ */ new Map()}
6105
+ __init72() {this.liveDeep = /* @__PURE__ */ new Map()}
5617
6106
  /**
5618
6107
  * Mixer Brush, Smudge and Sponge on a 16- or 32-bit layer: they read and write float working
5619
6108
  * tiles on the 8-bit 0..255 sRGB-encoded scale, which keep the fractions bytes would round away.
5620
6109
  */
5621
6110
 
5622
- __init69() {this.work = /* @__PURE__ */ new Map()}
5623
- __init70() {this.workRead = /* @__PURE__ */ new Map()}
6111
+ __init73() {this.work = /* @__PURE__ */ new Map()}
6112
+ __init74() {this.workRead = /* @__PURE__ */ new Map()}
5624
6113
  /** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
5625
6114
  readWork(key) {
5626
6115
  if (!this.workRead.has(key)) this.workRead.set(key, workTileOf(this.base.tiles.get(key)));
@@ -5660,7 +6149,7 @@ var PaintStrokeSession = (_class11 = class {
5660
6149
  writeTile: (tx, ty) => {
5661
6150
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty);
5662
6151
  if (!this.touched.has(key)) {
5663
- this.work.set(key, _nullishCoalesce(_optionalChain([read, 'call', _110 => _110(key), 'optionalAccess', _111 => _111.slice, 'call', _112 => _112()]), () => ( new Float32Array(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4))));
6152
+ this.work.set(key, _nullishCoalesce(_optionalChain([read, 'call', _111 => _111(key), 'optionalAccess', _112 => _112.slice, 'call', _113 => _113()]), () => ( new Float32Array(_chunkCWM3CUUXcjs.TILE * _chunkCWM3CUUXcjs.TILE * 4))));
5664
6153
  this.touched.add(key);
5665
6154
  }
5666
6155
  this.fresh.add(key);
@@ -5672,11 +6161,11 @@ var PaintStrokeSession = (_class11 = class {
5672
6161
  offset: a.offset,
5673
6162
  lockTransparency: a.lockTransparency,
5674
6163
  selection: a.selection,
5675
- readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _113 => _113.live, 'access', _114 => _114.get, 'call', _115 => _115(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _116 => _116.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
6164
+ readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _114 => _114.live, 'access', _115 => _115.get, 'call', _116 => _116(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _117 => _117.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
5676
6165
  writeTile: (tx, ty) => {
5677
6166
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty);
5678
6167
  if (!this.touched.has(key)) {
5679
- const src = _nullishCoalesce(_optionalChain([this, 'access', _117 => _117.base, 'access', _118 => _118.tiles, 'access', _119 => _119.get, 'call', _120 => _120(key), 'optionalAccess', _121 => _121.data]), () => ( defaultTile(this.base)));
6168
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _118 => _118.base, 'access', _119 => _119.tiles, 'access', _120 => _120.get, 'call', _121 => _121(key), 'optionalAccess', _122 => _122.data]), () => ( defaultTile(this.base)));
5680
6169
  this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
5681
6170
  this.touched.add(key);
5682
6171
  }
@@ -5693,11 +6182,11 @@ var PaintStrokeSession = (_class11 = class {
5693
6182
  if (this.closed || !points.length) return;
5694
6183
  if (!this.started) {
5695
6184
  this.started = true;
5696
- if (_optionalChain([this, 'access', _122 => _122.retouch, 'optionalAccess', _123 => _123.kind]) === "coverage") this.retouch.start(points[0]);
6185
+ if (_optionalChain([this, 'access', _123 => _123.retouch, 'optionalAccess', _124 => _124.kind]) === "coverage") this.retouch.start(points[0]);
5697
6186
  }
5698
6187
  this.last = points[points.length - 1];
5699
6188
  const rects = this.mixer ? this.mixer.push(points) : this.stroke.push(points);
5700
- _optionalChain([this, 'access', _124 => _124.flushView, 'optionalCall', _125 => _125()]);
6189
+ _optionalChain([this, 'access', _125 => _125.flushView, 'optionalCall', _126 => _126()]);
5701
6190
  this.update(rects);
5702
6191
  }
5703
6192
  update(rects) {
@@ -5727,7 +6216,7 @@ var PaintStrokeSession = (_class11 = class {
5727
6216
  for (const [key, { tx, ty, r }] of regions) {
5728
6217
  if (this.deep) {
5729
6218
  const rt = this.retouch;
5730
- const paint = _optionalChain([rt, 'optionalAccess', _126 => _126.kind]) === "coverage" ? rt.paint() : null;
6219
+ const paint = _optionalChain([rt, 'optionalAccess', _127 => _127.kind]) === "coverage" ? rt.paint() : null;
5731
6220
  if (paint && paint.kind !== "tone") {
5732
6221
  const prevWork = this.touched.has(key) ? this.work.get(key) : void 0;
5733
6222
  this.touched.add(key);
@@ -5738,13 +6227,13 @@ var PaintStrokeSession = (_class11 = class {
5738
6227
  const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
5739
6228
  this.touched.add(key);
5740
6229
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
5741
- const d = _optionalChain([rt, 'optionalAccess', _127 => _127.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _128 => _128.kind]) === "tone" ? _chunk7NW46N7Icjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkEBDCRTZIcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
6230
+ const d = _optionalChain([rt, 'optionalAccess', _128 => _128.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _129 => _129.kind]) === "tone" ? _chunk7NW46N7Icjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkEBDCRTZIcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
5742
6231
  this.liveDeep.set(key, d);
5743
6232
  this.live.set(key, { data: _chunkCWM3CUUXcjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
5744
6233
  continue;
5745
6234
  }
5746
- const src = _nullishCoalesce(_optionalChain([this, 'access', _129 => _129.base, 'access', _130 => _130.tiles, 'access', _131 => _131.get, 'call', _132 => _132(key), 'optionalAccess', _133 => _133.data]), () => ( defaultTile(this.base)));
5747
- const prev = this.touched.has(key) ? _optionalChain([this, 'access', _134 => _134.live, 'access', _135 => _135.get, 'call', _136 => _136(key), 'optionalAccess', _137 => _137.data]) : void 0;
6235
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _130 => _130.base, 'access', _131 => _131.tiles, 'access', _132 => _132.get, 'call', _133 => _133(key), 'optionalAccess', _134 => _134.data]), () => ( defaultTile(this.base)));
6236
+ const prev = this.touched.has(key) ? _optionalChain([this, 'access', _135 => _135.live, 'access', _136 => _136.get, 'call', _137 => _137(key), 'optionalAccess', _138 => _138.data]) : void 0;
5748
6237
  this.touched.add(key);
5749
6238
  const data = this.compositeTile(src, tx, ty, prev ? { into: prev, region: r } : {});
5750
6239
  this.live.set(key, { data, uniform: null });
@@ -5756,12 +6245,12 @@ var PaintStrokeSession = (_class11 = class {
5756
6245
  if (this.closed) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("This stroke has already ended.");
5757
6246
  const last = _nullishCoalesce(this.last, () => ( void 0));
5758
6247
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
5759
- _optionalChain([this, 'access', _138 => _138.flushView, 'optionalCall', _139 => _139()]);
6248
+ _optionalChain([this, 'access', _139 => _139.flushView, 'optionalCall', _140 => _140()]);
5760
6249
  this.update(rects);
5761
6250
  this.closed = true;
5762
6251
  const ch = this.base.channels;
5763
6252
  const r = this.retouch;
5764
- if (_optionalChain([r, 'optionalAccess', _140 => _140.kind]) === "coverage" && r.finalPaint) {
6253
+ if (_optionalChain([r, 'optionalAccess', _141 => _141.kind]) === "coverage" && r.finalPaint) {
5765
6254
  const final = r.finalPaint(this.stroke.coverage);
5766
6255
  if (final) {
5767
6256
  for (const key of this.touched) {
@@ -5770,7 +6259,7 @@ var PaintStrokeSession = (_class11 = class {
5770
6259
  this.retouchDeepTile(key, tx, ty, final, {});
5771
6260
  continue;
5772
6261
  }
5773
- const src = _nullishCoalesce(_optionalChain([this, 'access', _141 => _141.base, 'access', _142 => _142.tiles, 'access', _143 => _143.get, 'call', _144 => _144(key), 'optionalAccess', _145 => _145.data]), () => ( defaultTile(this.base)));
6262
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _142 => _142.base, 'access', _143 => _143.tiles, 'access', _144 => _144.get, 'call', _145 => _145(key), 'optionalAccess', _146 => _146.data]), () => ( defaultTile(this.base)));
5774
6263
  this.live.set(key, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
5775
6264
  }
5776
6265
  }
@@ -5792,7 +6281,7 @@ var PaintStrokeSession = (_class11 = class {
5792
6281
  const b = this.mixer ? this.mixer.bounds : this.stroke.coverage.bounds;
5793
6282
  const result = { layerId: this.target.id, channel: this.target.channel, bounds: changed ? b : null, dabs: (_nullishCoalesce(this.mixer, () => ( this.stroke))).dabCount };
5794
6283
  if (mixerLoad) result.mixerLoad = mixerLoad;
5795
- if (_optionalChain([r, 'optionalAccess', _146 => _146.result])) Object.assign(result, r.result());
6284
+ if (_optionalChain([r, 'optionalAccess', _147 => _147.result])) Object.assign(result, r.result());
5796
6285
  return result;
5797
6286
  }
5798
6287
  /** Abandons the stroke and restores the layer. */
@@ -5801,7 +6290,7 @@ var PaintStrokeSession = (_class11 = class {
5801
6290
  this.closed = true;
5802
6291
  this.controller._strokeCommit(this.before, this.target.id, this.target.channel, null);
5803
6292
  }
5804
- }, _class11);
6293
+ }, _class12);
5805
6294
  function workRegionOf(surface, rect, depth) {
5806
6295
  if (!depth) return Float32Array.from(_chunkCWM3CUUXcjs.readRegion.call(void 0, surface, rect));
5807
6296
  const d = _chunkCWM3CUUXcjs.readDeepRegion.call(void 0, surface, rect, depth);
@@ -5918,14 +6407,14 @@ function migrateSerializedImageEditorState(data) {
5918
6407
  const legacy = data;
5919
6408
  const adjustments = normalizeStoredAdjustments(legacy.adjustments);
5920
6409
  return {
5921
- version: _optionalChain([adjustments, 'access', _147 => _147.layers, 'optionalAccess', _148 => _148.length]) ? 2 : 1,
6410
+ version: _optionalChain([adjustments, 'access', _148 => _148.layers, 'optionalAccess', _149 => _149.length]) ? 2 : 1,
5922
6411
  crop: legacy.crop ? { ...legacy.crop } : null,
5923
6412
  transform: { ...DEFAULT_TRANSFORM, ...legacy.transform },
5924
6413
  adjustments: serializeAdjustments(adjustments),
5925
6414
  depthMask: {
5926
6415
  ...DEFAULT_DEPTH_MASK,
5927
6416
  ...legacy.depthMask,
5928
- depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _149 => _149.depthMask, 'optionalAccess', _150 => _150.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
6417
+ depthRange: [..._nullishCoalesce(_optionalChain([legacy, 'access', _150 => _150.depthMask, 'optionalAccess', _151 => _151.depthRange]), () => ( DEFAULT_DEPTH_MASK.depthRange))]
5929
6418
  },
5930
6419
  annotations: JSON.parse(JSON.stringify(_nullishCoalesce(legacy.annotations, () => ( [])))),
5931
6420
  ...legacy.selection ? { selection: { ...legacy.selection } } : {}
@@ -5954,36 +6443,36 @@ function migrateToLayeredState(data, size) {
5954
6443
  var DEFAULT_TRANSFORM = _chunkUYXL6ZWQcjs.DEFAULT_TRANSFORM_VALUES;
5955
6444
  var DEFAULT_DEPTH_MASK = _chunkUYXL6ZWQcjs.DEFAULT_DEPTH_MASK_VALUES;
5956
6445
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
5957
- var ImageEditorController = (_class12 = class {
6446
+ var ImageEditorController = (_class13 = class {
5958
6447
 
5959
6448
 
5960
- __init71() {this.imageElement = null}
5961
- __init72() {this.listeners = /* @__PURE__ */ new Set()}
5962
- __init73() {this.histogramListeners = /* @__PURE__ */ new Set()}
6449
+ __init75() {this.imageElement = null}
6450
+ __init76() {this.listeners = /* @__PURE__ */ new Set()}
6451
+ __init77() {this.histogramListeners = /* @__PURE__ */ new Set()}
5963
6452
 
5964
6453
  // History stacks
5965
- __init74() {this.undoStack = []}
5966
- __init75() {this.redoStack = []}
6454
+ __init78() {this.undoStack = []}
6455
+ __init79() {this.redoStack = []}
5967
6456
 
5968
6457
 
5969
- __init76() {this.isApplyingHistory = false}
6458
+ __init80() {this.isApplyingHistory = false}
5970
6459
 
5971
6460
  /** Pixels the selection tools sample (host-provided or read back from the source). */
5972
- __init77() {this.samplePixels = null}
5973
- __init78() {this.samplePixelsOverride = false}
6461
+ __init81() {this.samplePixels = null}
6462
+ __init82() {this.samplePixelsOverride = false}
5974
6463
  /** Decoded source pixels (the Background's surface), by the buffer or element they came from. */
5975
- __init79() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
5976
- __init80() {this.viewKey = []}
6464
+ __init83() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
6465
+ __init84() {this.viewKey = []}
5977
6466
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
5978
- __init81() {this.compositor = new (0, _chunkUYXL6ZWQcjs.LayerCompositor)()}
6467
+ __init85() {this.compositor = new (0, _chunkUYXL6ZWQcjs.LayerCompositor)()}
5979
6468
  /** The segmentation provider behind `selectSubject` (see `setSegmentationProvider`). */
5980
- __init82() {this.segmentation = null}
6469
+ __init86() {this.segmentation = null}
5981
6470
  /** The effects provider slot (see `setEffectsProvider`). */
5982
- __init83() {this.effects = new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()}
6471
+ __init87() {this.effects = new (0, _chunkA3A5TI6Rcjs.EffectsSlot)()}
5983
6472
  /** Renders provider effects: effect smart filter results and effect layers. */
5984
- __init84() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
5985
- __init85() {this.effectRefresh = "none"}
5986
- constructor(options = {}) {;_class12.prototype.__init71.call(this);_class12.prototype.__init72.call(this);_class12.prototype.__init73.call(this);_class12.prototype.__init74.call(this);_class12.prototype.__init75.call(this);_class12.prototype.__init76.call(this);_class12.prototype.__init77.call(this);_class12.prototype.__init78.call(this);_class12.prototype.__init79.call(this);_class12.prototype.__init80.call(this);_class12.prototype.__init81.call(this);_class12.prototype.__init82.call(this);_class12.prototype.__init83.call(this);_class12.prototype.__init84.call(this);_class12.prototype.__init85.call(this);_class12.prototype.__init86.call(this);_class12.prototype.__init87.call(this);_class12.prototype.__init88.call(this);_class12.prototype.__init89.call(this);_class12.prototype.__init90.call(this);_class12.prototype.__init91.call(this);_class12.prototype.__init92.call(this);_class12.prototype.__init93.call(this);_class12.prototype.__init94.call(this);_class12.prototype.__init95.call(this);_class12.prototype.__init96.call(this);_class12.prototype.__init97.call(this);_class12.prototype.__init98.call(this);_class12.prototype.__init99.call(this);_class12.prototype.__init100.call(this);_class12.prototype.__init101.call(this);
6473
+ __init88() {this.effectsEngine = new ImageEffectsEngine({ slot: this.effects })}
6474
+ __init89() {this.effectRefresh = "none"}
6475
+ constructor(options = {}) {;_class13.prototype.__init75.call(this);_class13.prototype.__init76.call(this);_class13.prototype.__init77.call(this);_class13.prototype.__init78.call(this);_class13.prototype.__init79.call(this);_class13.prototype.__init80.call(this);_class13.prototype.__init81.call(this);_class13.prototype.__init82.call(this);_class13.prototype.__init83.call(this);_class13.prototype.__init84.call(this);_class13.prototype.__init85.call(this);_class13.prototype.__init86.call(this);_class13.prototype.__init87.call(this);_class13.prototype.__init88.call(this);_class13.prototype.__init89.call(this);_class13.prototype.__init90.call(this);_class13.prototype.__init91.call(this);_class13.prototype.__init92.call(this);_class13.prototype.__init93.call(this);_class13.prototype.__init94.call(this);_class13.prototype.__init95.call(this);_class13.prototype.__init96.call(this);_class13.prototype.__init97.call(this);_class13.prototype.__init98.call(this);_class13.prototype.__init99.call(this);_class13.prototype.__init100.call(this);_class13.prototype.__init101.call(this);_class13.prototype.__init102.call(this);_class13.prototype.__init103.call(this);_class13.prototype.__init104.call(this);_class13.prototype.__init105.call(this);
5987
6476
  this.effects.subscribe(() => this.queueEffectRefresh("all"));
5988
6477
  this.effectsEngine.subscribe(() => this.queueEffectRefresh("incomplete"));
5989
6478
  if (options.effects) this.effects.set(options.effects);
@@ -6001,7 +6490,7 @@ var ImageEditorController = (_class12 = class {
6001
6490
  sourceIsOpaque: () => this.sourceIsOpaque(),
6002
6491
  version: () => `${this.sourceVersion()}:${this.patternsVersion()}`,
6003
6492
  globalLight: () => this.state.globalLight,
6004
- pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _151 => _151.state, 'access', _152 => _152.patterns, 'optionalAccess', _153 => _153.find, 'call', _154 => _154((p) => p.id === id)]), () => ( null))
6493
+ pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _152 => _152.state, 'access', _153 => _153.patterns, 'optionalAccess', _154 => _154.find, 'call', _155 => _155((p) => p.id === id)]), () => ( null))
6005
6494
  };
6006
6495
  this.state = {
6007
6496
  sourceUrl: typeof options.image === "string" ? options.image : null,
@@ -6034,13 +6523,13 @@ var ImageEditorController = (_class12 = class {
6034
6523
  };
6035
6524
  }
6036
6525
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
6037
- if (_optionalChain([options, 'access', _155 => _155.initialState, 'optionalAccess', _156 => _156.selection])) {
6526
+ if (_optionalChain([options, 'access', _156 => _156.initialState, 'optionalAccess', _157 => _157.selection])) {
6038
6527
  try {
6039
6528
  this.state.selection = normalizeSelection(_chunkUYXL6ZWQcjs.deserializeSelection.call(void 0, options.initialState.selection));
6040
6529
  } catch (e20) {
6041
6530
  }
6042
6531
  }
6043
- if (_optionalChain([options, 'access', _157 => _157.initialState, 'optionalAccess', _158 => _158.channels])) {
6532
+ if (_optionalChain([options, 'access', _158 => _158.initialState, 'optionalAccess', _159 => _159.channels])) {
6044
6533
  const channels = deserializeChannels(options.initialState.channels, this.naturalSize, this.lastLoadProblems);
6045
6534
  if (channels.length) this.state.channels = channels;
6046
6535
  }
@@ -6116,7 +6605,7 @@ var ImageEditorController = (_class12 = class {
6116
6605
  * Where layer pixels changed since the last viewport render, when only strokes changed them
6117
6606
  * (the renderer then recomposites just those rectangles); `'all'` after any other change.
6118
6607
  */
6119
- __init86() {this.pendingDirty = "all"}
6608
+ __init90() {this.pendingDirty = "all"}
6120
6609
  notify(strokeRects) {
6121
6610
  if (strokeRects) this.docRevision++;
6122
6611
  if (strokeRects && this.pendingDirty !== "all") this.pendingDirty.push(...strokeRects);
@@ -6124,7 +6613,7 @@ var ImageEditorController = (_class12 = class {
6124
6613
  this.syncViews();
6125
6614
  this.syncDisplay();
6126
6615
  const currentState = { ...this.state };
6127
- _optionalChain([this, 'access', _159 => _159.onStateChange, 'optionalCall', _160 => _160(currentState)]);
6616
+ _optionalChain([this, 'access', _160 => _160.onStateChange, 'optionalCall', _161 => _161(currentState)]);
6128
6617
  this.listeners.forEach((l) => l(currentState));
6129
6618
  if (this.effects.provider) this.queueEffectRefresh("incomplete");
6130
6619
  }
@@ -6153,7 +6642,7 @@ var ImageEditorController = (_class12 = class {
6153
6642
  if (l.type === "group") {
6154
6643
  const children = walk(l.children);
6155
6644
  if (children !== l.children) next2 = { ...l, children };
6156
- } else if (l.type === "smart" && _optionalChain([l, 'access', _161 => _161.smartFilters, 'optionalAccess', _162 => _162.filters, 'access', _163 => _163.some, 'call', _164 => _164((f) => f.kind === "effect")]) && (all || _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
6645
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _162 => _162.smartFilters, 'optionalAccess', _163 => _163.filters, 'access', _164 => _164.some, 'call', _165 => _165((f) => f.kind === "effect")]) && (all || _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
6157
6646
  try {
6158
6647
  const r = _chunkUYXL6ZWQcjs.rerender.call(void 0, l, canvas);
6159
6648
  if (all || !_chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
@@ -6173,7 +6662,7 @@ var ImageEditorController = (_class12 = class {
6173
6662
  this.state.layers = next;
6174
6663
  this.notify();
6175
6664
  }
6176
- /** The registered segmentation provider, or `null` (then `selectSubject` is unavailable). */
6665
+ /** The registered segmentation provider, or `null` (then `selectSubject` finds the most salient subject without a model). */
6177
6666
  get segmentationProvider() {
6178
6667
  return this.segmentation;
6179
6668
  }
@@ -6249,8 +6738,8 @@ var ImageEditorController = (_class12 = class {
6249
6738
  */
6250
6739
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
6251
6740
  const layer = _chunkUYXL6ZWQcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
6252
- const was = _optionalChain([layer, 'access', _165 => _165.smartFilters, 'optionalAccess', _166 => _166.filters, 'access', _167 => _167.find, 'call', _168 => _168((f) => f.id === filterId)]);
6253
- if (!was || was.kind !== "effect") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _169 => _169.smartFilters, 'optionalAccess', _170 => _170.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
6741
+ const was = _optionalChain([layer, 'access', _166 => _166.smartFilters, 'optionalAccess', _167 => _167.filters, 'access', _168 => _168.find, 'call', _169 => _169((f) => f.id === filterId)]);
6742
+ if (!was || was.kind !== "effect") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _170 => _170.smartFilters, 'optionalAccess', _171 => _171.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
6254
6743
  const update = {};
6255
6744
  if (changes.values) {
6256
6745
  const d = await this.describeEffect(was.effect);
@@ -6292,7 +6781,7 @@ var ImageEditorController = (_class12 = class {
6292
6781
  const layer = {
6293
6782
  type: "pixel",
6294
6783
  id,
6295
- name: _optionalChain([options, 'access', _171 => _171.name, 'optionalAccess', _172 => _172.trim, 'call', _173 => _173()]) || d.name,
6784
+ name: _optionalChain([options, 'access', _172 => _172.name, 'optionalAccess', _173 => _173.trim, 'call', _174 => _174()]) || d.name,
6296
6785
  visible: true,
6297
6786
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
6298
6787
  blend: _nullishCoalesce(blend, () => ( "normal")),
@@ -6317,7 +6806,7 @@ var ImageEditorController = (_class12 = class {
6317
6806
  */
6318
6807
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
6319
6808
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
6320
- const layer = _optionalChain([found, 'optionalAccess', _174 => _174.layer]);
6809
+ const layer = _optionalChain([found, 'optionalAccess', _175 => _175.layer]);
6321
6810
  if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
6322
6811
  _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
6323
6812
  const g = layer.generator;
@@ -6346,7 +6835,7 @@ var ImageEditorController = (_class12 = class {
6346
6835
  * and how long it runs, the longest of theirs (ms). Null when none animates.
6347
6836
  */
6348
6837
  getAnimation() {
6349
- const layers = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" && l.visible && !!_optionalChain([l, 'access', _175 => _175.generator, 'optionalAccess', _176 => _176.animate]));
6838
+ const layers = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => l.type === "pixel" && l.visible && !!_optionalChain([l, 'access', _176 => _176.generator, 'optionalAccess', _177 => _177.animate]));
6350
6839
  if (!layers.length) return null;
6351
6840
  return { duration: Math.max(...layers.map((l) => l.generator.animate.duration)), layerIds: layers.map((l) => l.id) };
6352
6841
  }
@@ -6363,7 +6852,7 @@ var ImageEditorController = (_class12 = class {
6363
6852
  const { width, height } = this.naturalSize;
6364
6853
  const surfaces = /* @__PURE__ */ new Map();
6365
6854
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
6366
- if (l.type !== "pixel" || !l.visible || !_optionalChain([l, 'access', _177 => _177.generator, 'optionalAccess', _178 => _178.animate])) continue;
6855
+ if (l.type !== "pixel" || !l.visible || !_optionalChain([l, 'access', _178 => _178.generator, 'optionalAccess', _179 => _179.animate])) continue;
6367
6856
  const g = l.generator;
6368
6857
  const pixels = await this.effectsEngine.renderLayer(g.effect, g.values, { width, height, depth: this.bitDepth, time: (_nullishCoalesce(g.time, () => ( 0))) + time });
6369
6858
  surfaces.set(l.id, effectPixelsToSurface(pixels, this.bitDepth));
@@ -6383,7 +6872,7 @@ var ImageEditorController = (_class12 = class {
6383
6872
  })
6384
6873
  );
6385
6874
  }
6386
- __init87() {this.displayFor = null}
6875
+ __init91() {this.displayFor = null}
6387
6876
  /** Keeps the renderer's display transform in step with the document profile, mode and Proof Setup. */
6388
6877
  syncDisplay() {
6389
6878
  const s = this.state;
@@ -6424,7 +6913,7 @@ var ImageEditorController = (_class12 = class {
6424
6913
  transform: { ...s.transform },
6425
6914
  outputOpacity: s.outputOpacity,
6426
6915
  selection: _nullishCoalesce(s.selection, () => ( null)),
6427
- ..._optionalChain([s, 'access', _179 => _179.channels, 'optionalAccess', _180 => _180.length]) ? { channels: s.channels } : {},
6916
+ ..._optionalChain([s, 'access', _180 => _180.channels, 'optionalAccess', _181 => _181.length]) ? { channels: s.channels } : {},
6428
6917
  source: {
6429
6918
  sourceUrl: s.sourceUrl,
6430
6919
  element: this.imageElement,
@@ -6460,7 +6949,7 @@ var ImageEditorController = (_class12 = class {
6460
6949
  if (entry.colorMode) s.colorMode = entry.colorMode;
6461
6950
  else delete s.colorMode;
6462
6951
  s.selection = entry.selection;
6463
- if (_optionalChain([entry, 'access', _181 => _181.channels, 'optionalAccess', _182 => _182.length])) s.channels = entry.channels;
6952
+ if (_optionalChain([entry, 'access', _182 => _182.channels, 'optionalAccess', _183 => _183.length])) s.channels = entry.channels;
6464
6953
  else delete s.channels;
6465
6954
  if (this.imageElement !== entry.source.element && !this.samplePixelsOverride) this.samplePixels = null;
6466
6955
  this.imageElement = entry.source.element;
@@ -6472,7 +6961,7 @@ var ImageEditorController = (_class12 = class {
6472
6961
  }
6473
6962
  }
6474
6963
  /** Set while `asOneStep` runs: the step is already recorded, so nested commands add none. */
6475
- __init88() {this.historyGrouped = false}
6964
+ __init92() {this.historyGrouped = false}
6476
6965
  /**
6477
6966
  * Runs `fn` as one undo step: history is recorded once, before it, and the commands it calls
6478
6967
  * record none. If `fn` throws, the step is dropped and the state goes back to before it, so a
@@ -6535,7 +7024,7 @@ var ImageEditorController = (_class12 = class {
6535
7024
  get canUndo() {
6536
7025
  return this.undoStack.length > 0;
6537
7026
  }
6538
- __init89() {this.docRevision = 0}
7027
+ __init93() {this.docRevision = 0}
6539
7028
  /**
6540
7029
  * Bumped on every change to the document (an undoable edit, a stroke, undo, redo), not on view
6541
7030
  * or tool changes, nor on `loadImage` (the source image is the host's, not part of the document). `createImageEditorDocument` uses it to tell document changes apart.
@@ -6667,7 +7156,7 @@ var ImageEditorController = (_class12 = class {
6667
7156
  return this.state.layers;
6668
7157
  }
6669
7158
  getLayer(id) {
6670
- return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _183 => _183.layer]);
7159
+ return _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id), 'optionalAccess', _184 => _184.layer]);
6671
7160
  }
6672
7161
  /** The active layer, or `undefined`. */
6673
7162
  getActiveLayer() {
@@ -6680,7 +7169,7 @@ var ImageEditorController = (_class12 = class {
6680
7169
  setActiveLayer(id, target = "pixels") {
6681
7170
  if (id !== null && !this.getLayer(id)) return false;
6682
7171
  const layer = id ? this.getLayer(id) : void 0;
6683
- const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _184 => _184.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _185 => _185.type]) === "smart" && _optionalChain([layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.mask]) ? "filter-mask" : "pixels";
7172
+ const t = target === "mask" && _optionalChain([layer, 'optionalAccess', _185 => _185.mask]) ? "mask" : target === "filter-mask" && _optionalChain([layer, 'optionalAccess', _186 => _186.type]) === "smart" && _optionalChain([layer, 'access', _187 => _187.smartFilters, 'optionalAccess', _188 => _188.mask]) ? "filter-mask" : "pixels";
6684
7173
  if (this.state.activeLayerId === id && this.state.activeTarget === t) return true;
6685
7174
  this.state.activeLayerId = id;
6686
7175
  this.state.activeTarget = t;
@@ -6699,7 +7188,7 @@ var ImageEditorController = (_class12 = class {
6699
7188
  if (!b) return null;
6700
7189
  return { x: b.x + layer.offset.x, y: b.y + layer.offset.y, width: b.width, height: b.height, data: _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, b) };
6701
7190
  }
6702
- __init90() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
7191
+ __init94() {this.boundsCache = /* @__PURE__ */ new WeakMap()}
6703
7192
  /**
6704
7193
  * Document bounds of a layer's non-transparent pixels (pixel layers; the Background's source
6705
7194
  * included), or `null` for an empty or non-pixel layer.
@@ -6842,11 +7331,11 @@ var ImageEditorController = (_class12 = class {
6842
7331
  surfaceOf: (l) => this.surfaceOf(l),
6843
7332
  version: `${this.sourceVersion()}:${this.patternsVersion()}`,
6844
7333
  globalLight: this.state.globalLight,
6845
- pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _188 => _188.state, 'access', _189 => _189.patterns, 'optionalAccess', _190 => _190.find, 'call', _191 => _191((p) => p.id === id)]), () => ( null))
7334
+ pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _189 => _189.state, 'access', _190 => _190.patterns, 'optionalAccess', _191 => _191.find, 'call', _192 => _192((p) => p.id === id)]), () => ( null))
6846
7335
  };
6847
7336
  }
6848
- __init91() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
6849
- __init92() {this.nextSourceId = 1}
7337
+ __init95() {this.sourceIds = /* @__PURE__ */ new WeakMap()}
7338
+ __init96() {this.nextSourceId = 1}
6850
7339
  /** Changes whenever the Background's source pixels can have changed. */
6851
7340
  sourceVersion() {
6852
7341
  const key = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
@@ -6895,7 +7384,7 @@ var ImageEditorController = (_class12 = class {
6895
7384
  }
6896
7385
  return fits ? fromPixels(px2) : null;
6897
7386
  }
6898
- __init93() {this.opaqueCache = /* @__PURE__ */ new WeakMap()}
7387
+ __init97() {this.opaqueCache = /* @__PURE__ */ new WeakMap()}
6899
7388
  /** Whether every source pixel is opaque (some legacy renders depend on it). */
6900
7389
  sourceIsOpaque() {
6901
7390
  const s = this.sourceSurface();
@@ -6919,7 +7408,7 @@ var ImageEditorController = (_class12 = class {
6919
7408
  if (!ctx || typeof ctx.getImageData !== "function") return null;
6920
7409
  ctx.drawImage(el, 0, 0, width, height);
6921
7410
  const data = ctx.getImageData(0, 0, width, height);
6922
- if (!_optionalChain([data, 'optionalAccess', _192 => _192.data]) || data.data.length < width * height * 4) return null;
7411
+ if (!_optionalChain([data, 'optionalAccess', _193 => _193.data]) || data.data.length < width * height * 4) return null;
6923
7412
  return { width, height, data: data.data };
6924
7413
  } catch (e24) {
6925
7414
  return null;
@@ -6932,7 +7421,7 @@ var ImageEditorController = (_class12 = class {
6932
7421
  const prev = this.state.layers;
6933
7422
  const depth = this.bitDepth;
6934
7423
  this.state.layers = next;
6935
- _optionalChain([extra, 'optionalCall', _193 => _193()]);
7424
+ _optionalChain([extra, 'optionalCall', _194 => _194()]);
6936
7425
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
6937
7426
  if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
6938
7427
  this.state.activeLayerId = _chunkUYXL6ZWQcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
@@ -6970,7 +7459,7 @@ var ImageEditorController = (_class12 = class {
6970
7459
  const layer = {
6971
7460
  type: "pixel",
6972
7461
  id: init.id && !ids.has(init.id) ? init.id : _chunkUYXL6ZWQcjs.newLayerId.call(void 0, ),
6973
- name: _optionalChain([init, 'access', _194 => _194.name, 'optionalAccess', _195 => _195.trim, 'call', _196 => _196()]) || this.nextLayerName(),
7462
+ name: _optionalChain([init, 'access', _195 => _195.name, 'optionalAccess', _196 => _196.trim, 'call', _197 => _197()]) || this.nextLayerName(),
6974
7463
  visible: _nullishCoalesce(init.visible, () => ( true)),
6975
7464
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
6976
7465
  blend: _nullishCoalesce(blend, () => ( "normal")),
@@ -6997,7 +7486,7 @@ var ImageEditorController = (_class12 = class {
6997
7486
  async decodeImage(image) {
6998
7487
  const trimmed = image.trim();
6999
7488
  let png = null;
7000
- if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _197 => _197.bytes]), () => ( null));
7489
+ if (/^data:image\/png/i.test(trimmed)) png = _nullishCoalesce(_optionalChain([_chunkCWM3CUUXcjs.parseDataUrl.call(void 0, trimmed), 'optionalAccess', _198 => _198.bytes]), () => ( null));
7001
7490
  else if (/^[A-Za-z0-9+/=\s]+$/.test(trimmed) && trimmed.length > 16) {
7002
7491
  try {
7003
7492
  const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, trimmed);
@@ -7046,7 +7535,7 @@ var ImageEditorController = (_class12 = class {
7046
7535
  removeLayer(id) {
7047
7536
  const next = _chunkUYXL6ZWQcjs.removeLayer.call(void 0, this.state.layers, id);
7048
7537
  this.commitLayers(next, () => {
7049
- if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _198 => _198.id]) === this.state.selectedAnnotationId)) {
7538
+ if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _199 => _199.id]) === this.state.selectedAnnotationId)) {
7050
7539
  this.state.selectedAnnotationId = null;
7051
7540
  }
7052
7541
  });
@@ -7055,9 +7544,9 @@ var ImageEditorController = (_class12 = class {
7055
7544
  moveLayer(id, placement) {
7056
7545
  const next = _chunkUYXL6ZWQcjs.moveLayer.call(void 0, this.state.layers, id, placement);
7057
7546
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
7058
- if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _199 => _199.parent, 'optionalAccess', _200 => _200.id]), () => ( null)), index: loc.index };
7547
+ if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _200 => _200.parent, 'optionalAccess', _201 => _201.id]), () => ( null)), index: loc.index };
7059
7548
  this.commitLayers(next);
7060
- return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _201 => _201.parent, 'optionalAccess', _202 => _202.id]), () => ( null)), index: loc.index };
7549
+ return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)), index: loc.index };
7061
7550
  }
7062
7551
  /**
7063
7552
  * Changes name, visibility, opacity, fill, blend, clipping, locks or (groups) collapsed state, as
@@ -7074,7 +7563,7 @@ var ImageEditorController = (_class12 = class {
7074
7563
  const group = {
7075
7564
  type: "group",
7076
7565
  id: _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "group"),
7077
- name: _optionalChain([init, 'access', _203 => _203.name, 'optionalAccess', _204 => _204.trim, 'call', _205 => _205()]) || "Group",
7566
+ name: _optionalChain([init, 'access', _204 => _204.name, 'optionalAccess', _205 => _205.trim, 'call', _206 => _206()]) || "Group",
7078
7567
  visible: true,
7079
7568
  opacity: 1,
7080
7569
  blend,
@@ -7167,7 +7656,7 @@ var ImageEditorController = (_class12 = class {
7167
7656
  sel = this.layerTransparency(id);
7168
7657
  } else {
7169
7658
  const current = this.state.selection;
7170
- if (!_optionalChain([current, 'optionalAccess', _206 => _206.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
7659
+ if (!_optionalChain([current, 'optionalAccess', _207 => _207.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all / transparency.");
7171
7660
  sel = from === "hide-selection" ? _chunkUYXL6ZWQcjs.invertSelection.call(void 0, current) : current;
7172
7661
  }
7173
7662
  mask = this.maskFromSelection(sel, props);
@@ -7198,7 +7687,7 @@ var ImageEditorController = (_class12 = class {
7198
7687
  const layer = _chunkUYXL6ZWQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7199
7688
  const name = layer.name || id;
7200
7689
  if (layer.type === "shape") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" is a shape layer, whose path already is its vector mask; change it with set_shape_component, or rasterize the layer first.`);
7201
- if (_optionalChain([layer, 'access', _207 => _207.mask, 'optionalAccess', _208 => _208.source])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which cannot be combined with a vector mask; remove the depth mask first.`);
7690
+ if (_optionalChain([layer, 'access', _208 => _208.mask, 'optionalAccess', _209 => _209.source])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which cannot be combined with a vector mask; remove the depth mask first.`);
7202
7691
  return layer;
7203
7692
  }
7204
7693
  requireVectorMask(id) {
@@ -7208,10 +7697,10 @@ var ImageEditorController = (_class12 = class {
7208
7697
  }
7209
7698
  /** Components from a path spec: `components`, or one `shape` / `subpaths`. */
7210
7699
  vectorMaskComponents(path) {
7211
- if (_optionalChain([path, 'access', _209 => _209.components, 'optionalAccess', _210 => _210.length]) && (path.shape !== void 0 || path.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7700
+ if (_optionalChain([path, 'access', _210 => _210.components, 'optionalAccess', _211 => _211.length]) && (path.shape !== void 0 || path.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7212
7701
  if (path.fillRule !== void 0 && path.fillRule !== "nonzero" && path.fillRule !== "evenodd") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7213
- const specs = _optionalChain([path, 'access', _211 => _211.components, 'optionalAccess', _212 => _212.length]) ? path.components : [path];
7214
- return specs.map((c, i) => this.componentFrom(c, _optionalChain([path, 'access', _213 => _213.components, 'optionalAccess', _214 => _214.length]) ? `components[${i}].` : ""));
7702
+ const specs = _optionalChain([path, 'access', _212 => _212.components, 'optionalAccess', _213 => _213.length]) ? path.components : [path];
7703
+ return specs.map((c, i) => this.componentFrom(c, _optionalChain([path, 'access', _214 => _214.components, 'optionalAccess', _215 => _215.length]) ? `components[${i}].` : ""));
7215
7704
  }
7216
7705
  /**
7217
7706
  * Layer › Vector Mask: `reveal-all` (an empty path showing everything), `hide-all` (an empty path
@@ -7228,7 +7717,7 @@ var ImageEditorController = (_class12 = class {
7228
7717
  vm = { components: this.vectorMaskComponents(path) };
7229
7718
  if (path.fillRule === "evenodd") vm.fillRule = "evenodd";
7230
7719
  } else if (from === "reveal-all" || from === "hide-all") {
7231
- if (_optionalChain([path, 'access', _215 => _215.components, 'optionalAccess', _216 => _216.length]) || path.shape !== void 0 || path.subpaths !== void 0) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`A ${from} vector mask starts empty; use from path to give a path.`);
7720
+ if (_optionalChain([path, 'access', _216 => _216.components, 'optionalAccess', _217 => _217.length]) || path.shape !== void 0 || path.subpaths !== void 0) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`A ${from} vector mask starts empty; use from path to give a path.`);
7232
7721
  vm = { components: [], ...from === "reveal-all" ? { inverted: true } : {} };
7233
7722
  } else {
7234
7723
  throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Unknown vector mask source "${String(from)}". Use reveal-all, hide-all, path or selection.`);
@@ -7239,7 +7728,7 @@ var ImageEditorController = (_class12 = class {
7239
7728
  /** The selection's outline as subpaths; throws when nothing is selected or nothing is left to trace. */
7240
7729
  traceSelection(options) {
7241
7730
  const sel = this.state.selection;
7242
- if (!_optionalChain([sel, 'optionalAccess', _217 => _217.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then make a path from the selection.");
7731
+ if (!_optionalChain([sel, 'optionalAccess', _218 => _218.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then make a path from the selection.");
7243
7732
  if (options.tolerance !== void 0 && !(options.tolerance >= 0.1 && options.tolerance <= 10)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("tolerance must be from 0.1 to 10 px.");
7244
7733
  const subpaths = selectionToSubpaths(sel, options);
7245
7734
  if (!subpaths.length) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("The selection is too small or too faint to trace (below minArea, or under half selected); lower minArea or threshold.");
@@ -7420,7 +7909,7 @@ var ImageEditorController = (_class12 = class {
7420
7909
  const layer = loc.layer;
7421
7910
  if (layer.type !== "pixel") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
7422
7911
  const sel = this.state.selection;
7423
- if (!_optionalChain([sel, 'optionalAccess', _218 => _218.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
7912
+ if (!_optionalChain([sel, 'optionalAccess', _219 => _219.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
7424
7913
  if (options.cut) _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
7425
7914
  const surface = this.surfaceOf(layer);
7426
7915
  const sb = sel.bounds;
@@ -7438,14 +7927,14 @@ var ImageEditorController = (_class12 = class {
7438
7927
  const copy = {
7439
7928
  type: "pixel",
7440
7929
  id: _chunkUYXL6ZWQcjs.newLayerId.call(void 0, ),
7441
- name: _optionalChain([options, 'access', _219 => _219.name, 'optionalAccess', _220 => _220.trim, 'call', _221 => _221()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
7930
+ name: _optionalChain([options, 'access', _220 => _220.name, 'optionalAccess', _221 => _221.trim, 'call', _222 => _222()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
7442
7931
  visible: true,
7443
7932
  opacity: 1,
7444
7933
  blend: "normal",
7445
7934
  surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
7446
7935
  offset: { ...layer.offset }
7447
7936
  };
7448
- let next = _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _222 => _222.parent, 'optionalAccess', _223 => _223.id]), () => ( null)), loc.index + 1);
7937
+ let next = _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _223 => _223.parent, 'optionalAccess', _224 => _224.id]), () => ( null)), loc.index + 1);
7449
7938
  if (kept) {
7450
7939
  const cutLayer = { ...layer, surface: _chunkCWM3CUUXcjs.writeRegion.call(void 0, surface, src, kept) };
7451
7940
  delete cutLayer.source;
@@ -7458,7 +7947,7 @@ var ImageEditorController = (_class12 = class {
7458
7947
  return copy.id;
7459
7948
  }
7460
7949
  // --- Free Transform ---
7461
- __init94() {this.openTransform = null}
7950
+ __init98() {this.openTransform = null}
7462
7951
  /** The Free Transform in progress (see `beginFreeTransform`), or `null`. */
7463
7952
  getFreeTransform() {
7464
7953
  if (this.openTransform && !this.openTransform.isOpen) this.openTransform = null;
@@ -7469,7 +7958,7 @@ var ImageEditorController = (_class12 = class {
7469
7958
  layers: () => this.state.layers,
7470
7959
  activeLayerId: () => this.state.activeLayerId,
7471
7960
  activeTarget: () => this.state.activeTarget,
7472
- selection: () => _optionalChain([this, 'access', _224 => _224.state, 'access', _225 => _225.selection, 'optionalAccess', _226 => _226.bounds]) ? this.state.selection : null,
7961
+ selection: () => _optionalChain([this, 'access', _225 => _225.state, 'access', _226 => _226.selection, 'optionalAccess', _227 => _227.bounds]) ? this.state.selection : null,
7473
7962
  canvas: () => this.naturalSize,
7474
7963
  pixelsOf: (layer) => this.surfaceOf(layer),
7475
7964
  shapeEnv: () => this.shapeEnv(),
@@ -7617,7 +8106,7 @@ var ImageEditorController = (_class12 = class {
7617
8106
  * anything else nests as a layer document. Returns the smart object's id.
7618
8107
  */
7619
8108
  convertToSmartObject(ids, options = {}) {
7620
- const list = _optionalChain([ids, 'optionalAccess', _227 => _227.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
8109
+ const list = _optionalChain([ids, 'optionalAccess', _228 => _228.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7621
8110
  if (!list.length) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
7622
8111
  const res = _chunkUYXL6ZWQcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
7623
8112
  this.commitLayers(res.layers, () => {
@@ -7650,8 +8139,8 @@ var ImageEditorController = (_class12 = class {
7650
8139
  width: c.width,
7651
8140
  height: c.height,
7652
8141
  decoded: _chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, c),
7653
- fileType: _nullishCoalesce(_optionalChain([c, 'access', _228 => _228.file, 'optionalAccess', _229 => _229.type]), () => ( null)),
7654
- linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _230 => _230.linked, 'optionalAccess', _231 => _231.path]), () => ( null)),
8142
+ fileType: _nullishCoalesce(_optionalChain([c, 'access', _229 => _229.file, 'optionalAccess', _230 => _230.type]), () => ( null)),
8143
+ linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _231 => _231.linked, 'optionalAccess', _232 => _232.path]), () => ( null)),
7655
8144
  instances: _chunkUYXL6ZWQcjs.instancesOf.call(void 0, this.state.layers, c.id),
7656
8145
  layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
7657
8146
  },
@@ -7668,9 +8157,9 @@ var ImageEditorController = (_class12 = class {
7668
8157
  bounds: _chunkUYXL6ZWQcjs.transformedBox.call(void 0, g)
7669
8158
  },
7670
8159
  smartFilters: {
7671
- enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _232 => _232.enabled]), () => ( true)),
7672
- filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _233 => _233.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7673
- mask: _optionalChain([stack, 'optionalAccess', _234 => _234.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkCWM3CUUXcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
8160
+ enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _233 => _233.enabled]), () => ( true)),
8161
+ filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _234 => _234.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
8162
+ mask: _optionalChain([stack, 'optionalAccess', _235 => _235.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunkCWM3CUUXcjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7674
8163
  },
7675
8164
  bounds: this.getLayerBounds(id)
7676
8165
  };
@@ -7809,7 +8298,7 @@ var ImageEditorController = (_class12 = class {
7809
8298
  * it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
7810
8299
  */
7811
8300
  maskFiltersWithSelection(id, useSelection) {
7812
- if (!useSelection || !_optionalChain([this, 'access', _235 => _235.state, 'access', _236 => _236.selection, 'optionalAccess', _237 => _237.bounds])) return false;
8301
+ if (!useSelection || !_optionalChain([this, 'access', _236 => _236.state, 'access', _237 => _237.selection, 'optionalAccess', _238 => _238.bounds])) return false;
7813
8302
  this.setSmartFilterMask(id, "selection", {}, false);
7814
8303
  return true;
7815
8304
  }
@@ -7823,19 +8312,19 @@ var ImageEditorController = (_class12 = class {
7823
8312
  removeSmartFilter(id, filterId) {
7824
8313
  const res = _chunkUYXL6ZWQcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
7825
8314
  this.commitLayers(res.layers);
7826
- return _nullishCoalesce(_optionalChain([res, 'access', _238 => _238.layer, 'access', _239 => _239.smartFilters, 'optionalAccess', _240 => _240.filters]), () => ( []));
8315
+ return _nullishCoalesce(_optionalChain([res, 'access', _239 => _239.layer, 'access', _240 => _240.smartFilters, 'optionalAccess', _241 => _241.filters]), () => ( []));
7827
8316
  }
7828
8317
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
7829
8318
  moveSmartFilter(id, filterId, index) {
7830
8319
  const res = _chunkUYXL6ZWQcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
7831
8320
  this.commitLayers(res.layers);
7832
- return _nullishCoalesce(_optionalChain([res, 'access', _241 => _241.layer, 'access', _242 => _242.smartFilters, 'optionalAccess', _243 => _243.filters]), () => ( []));
8321
+ return _nullishCoalesce(_optionalChain([res, 'access', _242 => _242.layer, 'access', _243 => _243.smartFilters, 'optionalAccess', _244 => _244.filters]), () => ( []));
7833
8322
  }
7834
8323
  /** Turns a smart object's whole filter stack on or off (one undo step). */
7835
8324
  setSmartFiltersEnabled(id, enabled) {
7836
8325
  const res = _chunkUYXL6ZWQcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
7837
8326
  this.commitLayers(res.layers);
7838
- return _nullishCoalesce(_optionalChain([res, 'access', _244 => _244.layer, 'access', _245 => _245.smartFilters, 'optionalAccess', _246 => _246.enabled]), () => ( true));
8327
+ return _nullishCoalesce(_optionalChain([res, 'access', _245 => _245.layer, 'access', _246 => _246.smartFilters, 'optionalAccess', _247 => _247.enabled]), () => ( true));
7839
8328
  }
7840
8329
  /**
7841
8330
  * Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
@@ -7847,11 +8336,11 @@ var ImageEditorController = (_class12 = class {
7847
8336
  let mask;
7848
8337
  if (from === "none") mask = null;
7849
8338
  else if (from === "keep") {
7850
- if (!_optionalChain([layer, 'access', _247 => _247.smartFilters, 'optionalAccess', _248 => _248.mask])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
8339
+ if (!_optionalChain([layer, 'access', _248 => _248.smartFilters, 'optionalAccess', _249 => _249.mask])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
7851
8340
  mask = withMaskProps(layer.smartFilters.mask, props);
7852
8341
  } else if (from === "selection") {
7853
8342
  const sel = this.state.selection;
7854
- if (!_optionalChain([sel, 'optionalAccess', _249 => _249.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
8343
+ if (!_optionalChain([sel, 'optionalAccess', _250 => _250.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
7855
8344
  mask = this.maskFromSelection(sel, props);
7856
8345
  } else {
7857
8346
  const v = from === "reveal-all" ? 255 : 0;
@@ -7863,7 +8352,7 @@ var ImageEditorController = (_class12 = class {
7863
8352
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
7864
8353
  else if (!mask && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
7865
8354
  }, commitToHistory);
7866
- return _nullishCoalesce(_optionalChain([res, 'access', _250 => _250.layer, 'access', _251 => _251.smartFilters, 'optionalAccess', _252 => _252.mask]), () => ( null));
8355
+ return _nullishCoalesce(_optionalChain([res, 'access', _251 => _251.layer, 'access', _252 => _252.smartFilters, 'optionalAccess', _253 => _253.mask]), () => ( null));
7867
8356
  }
7868
8357
  /**
7869
8358
  * Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
@@ -7896,7 +8385,7 @@ var ImageEditorController = (_class12 = class {
7896
8385
  return left;
7897
8386
  }
7898
8387
  // --- Smart object contents (Edit Contents) ---
7899
- __init95() {this.contentsStack = []}
8388
+ __init99() {this.contentsStack = []}
7900
8389
  /** The smart objects whose contents are open (outermost first); empty when the document itself is shown. */
7901
8390
  getEditingContents() {
7902
8391
  return this.contentsStack.map((e) => ({ layerId: e.layerId, name: e.name }));
@@ -7911,7 +8400,7 @@ var ImageEditorController = (_class12 = class {
7911
8400
  if (this.getFreeTransform()) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
7912
8401
  const layer = _chunkUYXL6ZWQcjs.requireSmartObject.call(void 0, this.state.layers, id);
7913
8402
  const c = layer.contents;
7914
- if (!_chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _253 => _253.file, 'optionalAccess', _254 => _254.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
8403
+ if (!_chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _254 => _254.file, 'optionalAccess', _255 => _255.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
7915
8404
  const saved = {
7916
8405
  state: { ...this.state },
7917
8406
  undo: this.undoStack,
@@ -7942,9 +8431,9 @@ var ImageEditorController = (_class12 = class {
7942
8431
  editingContents: this.getEditingContents()
7943
8432
  };
7944
8433
  delete this.state.legacyOutputBlur;
7945
- if (_optionalChain([c, 'access', _255 => _255.document, 'optionalAccess', _256 => _256.globalLight])) this.state.globalLight = c.document.globalLight;
8434
+ if (_optionalChain([c, 'access', _256 => _256.document, 'optionalAccess', _257 => _257.globalLight])) this.state.globalLight = c.document.globalLight;
7946
8435
  else delete this.state.globalLight;
7947
- if (_optionalChain([c, 'access', _257 => _257.document, 'optionalAccess', _258 => _258.patterns, 'optionalAccess', _259 => _259.length])) this.state.patterns = c.document.patterns;
8436
+ if (_optionalChain([c, 'access', _258 => _258.document, 'optionalAccess', _259 => _259.patterns, 'optionalAccess', _260 => _260.length])) this.state.patterns = c.document.patterns;
7948
8437
  else delete this.state.patterns;
7949
8438
  this.imageElement = null;
7950
8439
  this.samplePixels = null;
@@ -7964,23 +8453,23 @@ var ImageEditorController = (_class12 = class {
7964
8453
  closeSmartObjectContents(save = true) {
7965
8454
  const top = this.contentsStack.pop();
7966
8455
  if (!top) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
7967
- if (_optionalChain([this, 'access', _260 => _260.openTransform, 'optionalAccess', _261 => _261.isOpen])) this.openTransform.cancel();
8456
+ if (_optionalChain([this, 'access', _261 => _261.openTransform, 'optionalAccess', _262 => _262.isOpen])) this.openTransform.cancel();
7968
8457
  this.openTransform = null;
7969
8458
  const edited = this.state;
7970
8459
  const changed = save && this.undoStack.length > 0;
7971
8460
  let next = null;
7972
8461
  if (changed) {
7973
- const layer = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _262 => _262.layer]);
7974
- const old = _optionalChain([layer, 'optionalAccess', _263 => _263.contents]);
8462
+ const layer = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _263 => _263.layer]);
8463
+ const old = _optionalChain([layer, 'optionalAccess', _264 => _264.contents]);
7975
8464
  const { width, height } = edited.imageDimensions;
7976
8465
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
7977
- const plain3 = _optionalChain([only, 'optionalAccess', _264 => _264.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _265 => _265.filters, 'optionalAccess', _266 => _266.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
7978
- if (_optionalChain([old, 'optionalAccess', _267 => _267.kind]) === "raster" && plain3) {
8466
+ const plain3 = _optionalChain([only, 'optionalAccess', _265 => _265.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _266 => _266.filters, 'optionalAccess', _267 => _267.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
8467
+ if (_optionalChain([old, 'optionalAccess', _268 => _268.kind]) === "raster" && plain3) {
7979
8468
  const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
7980
8469
  next = _chunkUYXL6ZWQcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
7981
8470
  } else {
7982
8471
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
7983
- next = _chunkUYXL6ZWQcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _268 => _268.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _269 => _269.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
8472
+ next = _chunkUYXL6ZWQcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _269 => _269.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _270 => _270.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
7984
8473
  }
7985
8474
  }
7986
8475
  const saved = top.saved;
@@ -8005,7 +8494,7 @@ var ImageEditorController = (_class12 = class {
8005
8494
  }
8006
8495
  /** The document's own layers (not the contents open for editing). */
8007
8496
  rootLayers() {
8008
- return _nullishCoalesce(_optionalChain([this, 'access', _270 => _270.contentsStack, 'access', _271 => _271[0], 'optionalAccess', _272 => _272.saved, 'access', _273 => _273.state, 'access', _274 => _274.layers]), () => ( this.state.layers));
8497
+ return _nullishCoalesce(_optionalChain([this, 'access', _271 => _271.contentsStack, 'access', _272 => _272[0], 'optionalAccess', _273 => _273.saved, 'access', _274 => _274.state, 'access', _275 => _275.layers]), () => ( this.state.layers));
8009
8498
  }
8010
8499
  /** Drops every open contents edit (loading another document). */
8011
8500
  abandonContents() {
@@ -8045,7 +8534,7 @@ var ImageEditorController = (_class12 = class {
8045
8534
  this.commitLayers(_chunkUYXL6ZWQcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
8046
8535
  return this.getLayerEffects(id);
8047
8536
  }
8048
- __init96() {this.patternIds = /* @__PURE__ */ new WeakMap()}
8537
+ __init100() {this.patternIds = /* @__PURE__ */ new WeakMap()}
8049
8538
  /** Changes whenever the document's pattern list is replaced (the compositor then drops its caches). */
8050
8539
  patternsVersion() {
8051
8540
  const list = this.state.patterns;
@@ -8207,7 +8696,7 @@ var ImageEditorController = (_class12 = class {
8207
8696
  });
8208
8697
  return bg.id;
8209
8698
  }
8210
- __init97() {this.thumbCache = /* @__PURE__ */ new WeakMap()}
8699
+ __init101() {this.thumbCache = /* @__PURE__ */ new WeakMap()}
8211
8700
  /**
8212
8701
  * A small RGBA preview of a pixel layer over the canvas (or of its mask with `mask: true`),
8213
8702
  * longest side `maxSide` px, point-sampled; `null` for layers without pixels.
@@ -8226,7 +8715,7 @@ var ImageEditorController = (_class12 = class {
8226
8715
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
8227
8716
  const key = `${tw}x${th}:${ox},${oy}`;
8228
8717
  let byKey = this.thumbCache.get(surface);
8229
- const hit = _optionalChain([byKey, 'optionalAccess', _275 => _275.get, 'call', _276 => _276(key)]);
8718
+ const hit = _optionalChain([byKey, 'optionalAccess', _276 => _276.get, 'call', _277 => _277(key)]);
8230
8719
  if (hit) return hit;
8231
8720
  const out = new Uint8ClampedArray(tw * th * 4);
8232
8721
  for (let y = 0; y < th; y++) {
@@ -8367,7 +8856,7 @@ var ImageEditorController = (_class12 = class {
8367
8856
  if (layer.mask.source) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
8368
8857
  _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "all", action);
8369
8858
  } else if (ch === "filter-mask") {
8370
- if (layer.type !== "smart" || !_optionalChain([layer, 'access', _277 => _277.smartFilters, 'optionalAccess', _278 => _278.mask])) {
8859
+ if (layer.type !== "smart" || !_optionalChain([layer, 'access', _278 => _278.smartFilters, 'optionalAccess', _279 => _279.mask])) {
8371
8860
  throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`, `Layer "${name}" has no smart filter mask to ${action}.`);
8372
8861
  }
8373
8862
  if (!_chunkUYXL6ZWQcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`The contents of "${name}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`, `The smart object "${name}" is still loading; try again in a moment.`);
@@ -8382,7 +8871,7 @@ var ImageEditorController = (_class12 = class {
8382
8871
  if (!layer.visible) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
8383
8872
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
8384
8873
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
8385
- const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _279 => _279.locks, 'optionalAccess', _280 => _280.transparency]));
8874
+ const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _280 => _280.locks, 'optionalAccess', _281 => _281.transparency]));
8386
8875
  return { id, layer, channel: ch, offset, surface, lockTransparency };
8387
8876
  }
8388
8877
  /** The layer with its pixels (or mask) replaced by `surface`. */
@@ -8426,13 +8915,13 @@ var ImageEditorController = (_class12 = class {
8426
8915
  blend: target.channel !== "pixels" ? "normal" : brush.blend,
8427
8916
  lockTransparency: target.lockTransparency,
8428
8917
  // In Quick Mask mode the selection is what is painted, so it does not limit the stroke.
8429
- selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _281 => _281.state, 'access', _282 => _282.selection, 'optionalAccess', _283 => _283.bounds]) ? this.state.selection : null,
8918
+ selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _282 => _282.state, 'access', _283 => _283.selection, 'optionalAccess', _284 => _284.bounds]) ? this.state.selection : null,
8430
8919
  offset: target.offset
8431
8920
  };
8432
8921
  const depth = target.channel !== "filter-mask" && target.channel !== "quick-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
8433
8922
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
8434
8923
  if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
8435
- const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _284 => _284.type]) === "gradient" ? _chunkEBDCRTZIcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
8924
+ const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _285 => _285.type]) === "gradient" ? _chunkEBDCRTZIcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
8436
8925
  return new PaintStrokeSession(this, target, new (0, _chunkEBDCRTZIcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
8437
8926
  }
8438
8927
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
@@ -8479,9 +8968,9 @@ var ImageEditorController = (_class12 = class {
8479
8968
  const steps = settings.historySteps;
8480
8969
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
8481
8970
  if (!entry) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
8482
- const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _285 => _285.layer]);
8971
+ const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _286 => _286.layer]);
8483
8972
  if (!then) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
8484
- const surface = target.channel === "mask" ? _optionalChain([then, 'access', _286 => _286.mask, 'optionalAccess', _287 => _287.surface]) : then.type === "pixel" ? then.surface : void 0;
8973
+ const surface = target.channel === "mask" ? _optionalChain([then, 'access', _287 => _287.mask, 'optionalAccess', _288 => _288.surface]) : then.type === "pixel" ? then.surface : void 0;
8485
8974
  if (!surface) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
8486
8975
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
8487
8976
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
@@ -8555,7 +9044,7 @@ var ImageEditorController = (_class12 = class {
8555
9044
  }
8556
9045
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
8557
9046
  surfaceSource(surface, offset) {
8558
- return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _288 => _288.tiles, 'access', _289 => _289.get, 'call', _290 => _290(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _291 => _291.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
9047
+ return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _289 => _289.tiles, 'access', _290 => _290.get, 'call', _291 => _291(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _292 => _292.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
8559
9048
  }
8560
9049
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
8561
9050
  compositeSource(throughId, depth = null) {
@@ -8631,7 +9120,7 @@ var ImageEditorController = (_class12 = class {
8631
9120
  paintStroke(init) {
8632
9121
  if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("points must hold at least one { x, y } point.");
8633
9122
  for (const p of init.points) {
8634
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _292 => _292.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _293 => _293.y]))) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
9123
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _293 => _293.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _294 => _294.y]))) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8635
9124
  }
8636
9125
  const session = this.beginStroke(init);
8637
9126
  session.push(init.points);
@@ -8660,7 +9149,7 @@ var ImageEditorController = (_class12 = class {
8660
9149
  */
8661
9150
  strokeSelection(options) {
8662
9151
  const sel = this.state.selection;
8663
- if (!_optionalChain([sel, 'optionalAccess', _294 => _294.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
9152
+ if (!_optionalChain([sel, 'optionalAccess', _295 => _295.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8664
9153
  const width = options.width;
8665
9154
  if (!(width > 0 && width <= 250)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
8666
9155
  const location = _nullishCoalesce(options.location, () => ( "outside"));
@@ -8677,7 +9166,7 @@ var ImageEditorController = (_class12 = class {
8677
9166
  */
8678
9167
  cropToSelection() {
8679
9168
  const sel = this.state.selection;
8680
- if (!_optionalChain([sel, 'optionalAccess', _295 => _295.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
9169
+ if (!_optionalChain([sel, 'optionalAccess', _296 => _296.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8681
9170
  const crop = { ...sel.bounds };
8682
9171
  this.setCrop(crop);
8683
9172
  return crop;
@@ -8691,7 +9180,7 @@ var ImageEditorController = (_class12 = class {
8691
9180
  */
8692
9181
  contentAwareFill(options = {}) {
8693
9182
  const sel = this.state.selection;
8694
- if (!_optionalChain([sel, 'optionalAccess', _296 => _296.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
9183
+ if (!_optionalChain([sel, 'optionalAccess', _297 => _297.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
8695
9184
  if (this.bitDepth !== 8) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
8696
9185
  const output = _nullishCoalesce(options.output, () => ( "current"));
8697
9186
  if (output !== "current" && output !== "new-layer") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Unknown output "${String(output)}"; use current or new-layer.`);
@@ -8737,7 +9226,7 @@ var ImageEditorController = (_class12 = class {
8737
9226
  return { layerId: target.id, bounds: { ...b }, output };
8738
9227
  }
8739
9228
  /** The pixel clipboard (Copy / Cut), or null. */
8740
- __init98() {this.clipboard = null}
9229
+ __init102() {this.clipboard = null}
8741
9230
  /** What Copy or Cut last put on the editor's clipboard, or null. */
8742
9231
  getClipboard() {
8743
9232
  return this.clipboard;
@@ -8756,8 +9245,8 @@ var ImageEditorController = (_class12 = class {
8756
9245
  */
8757
9246
  copyPixels(options = {}) {
8758
9247
  const { width, height } = this.naturalSize;
8759
- const sel = _optionalChain([this, 'access', _297 => _297.state, 'access', _298 => _298.selection, 'optionalAccess', _299 => _299.bounds]) ? this.state.selection : null;
8760
- const rect = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _300 => _300.bounds]), () => ( { x: 0, y: 0, width, height }));
9248
+ const sel = _optionalChain([this, 'access', _298 => _298.state, 'access', _299 => _299.selection, 'optionalAccess', _300 => _300.bounds]) ? this.state.selection : null;
9249
+ const rect = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _301 => _301.bounds]), () => ( { x: 0, y: 0, width, height }));
8761
9250
  let data;
8762
9251
  if (options.merged) {
8763
9252
  data = new Uint8ClampedArray(this.compositePixels(rect).data);
@@ -8797,7 +9286,7 @@ var ImageEditorController = (_class12 = class {
8797
9286
  pastePixels(mode = "new-layer", image = this.clipboard) {
8798
9287
  if (!image) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
8799
9288
  if (!PASTE_MODES.includes(mode)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
8800
- const sel = _optionalChain([this, 'access', _301 => _301.state, 'access', _302 => _302.selection, 'optionalAccess', _303 => _303.bounds]) ? this.state.selection : null;
9289
+ const sel = _optionalChain([this, 'access', _302 => _302.state, 'access', _303 => _303.selection, 'optionalAccess', _304 => _304.bounds]) ? this.state.selection : null;
8801
9290
  if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
8802
9291
  const { width, height } = this.naturalSize;
8803
9292
  let x;
@@ -8806,7 +9295,7 @@ var ImageEditorController = (_class12 = class {
8806
9295
  x = image.x;
8807
9296
  y = image.y;
8808
9297
  } else {
8809
- const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _304 => _304.bounds]), () => ( { x: 0, y: 0, width, height }));
9298
+ const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _305 => _305.bounds]), () => ( { x: 0, y: 0, width, height }));
8810
9299
  x = Math.round(frame.x + (frame.width - image.width) / 2);
8811
9300
  y = Math.round(frame.y + (frame.height - image.height) / 2);
8812
9301
  }
@@ -8823,8 +9312,8 @@ var ImageEditorController = (_class12 = class {
8823
9312
  if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("opacity must be from 0 to 1.");
8824
9313
  const blend = _nullishCoalesce(_chunkUYXL6ZWQcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
8825
9314
  const quickMask = target.channel === "quick-mask";
8826
- const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _305 => _305.state, 'access', _306 => _306.selection, 'optionalAccess', _307 => _307.bounds]) ? this.state.selection : null)));
8827
- const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _308 => _308.bounds]), () => ( { x: 0, y: 0, width, height }));
9315
+ const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _306 => _306.state, 'access', _307 => _307.selection, 'optionalAccess', _308 => _308.bounds]) ? this.state.selection : null)));
9316
+ const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _309 => _309.bounds]), () => ( { x: 0, y: 0, width, height }));
8828
9317
  const coverage = new (0, _chunkEBDCRTZIcjs.CoverageMap)();
8829
9318
  const ones = new Float32Array(region.width * region.height);
8830
9319
  if (sel) {
@@ -8949,7 +9438,7 @@ var ImageEditorController = (_class12 = class {
8949
9438
  placeLayer(layers, node, where) {
8950
9439
  if (where.aboveId) {
8951
9440
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, where.aboveId);
8952
- if (loc) return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _309 => _309.parent, 'optionalAccess', _310 => _310.id]), () => ( null)), loc.index + 1);
9441
+ if (loc) return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _310 => _310.parent, 'optionalAccess', _311 => _311.id]), () => ( null)), loc.index + 1);
8953
9442
  }
8954
9443
  if (where.parentId) {
8955
9444
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, where.parentId);
@@ -8960,11 +9449,11 @@ var ImageEditorController = (_class12 = class {
8960
9449
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
8961
9450
  if (at < nodes.length) {
8962
9451
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, nodes[at].id);
8963
- return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _311 => _311.parent, 'optionalAccess', _312 => _312.id]), () => ( null)), loc.index);
9452
+ return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _312 => _312.parent, 'optionalAccess', _313 => _313.id]), () => ( null)), loc.index);
8964
9453
  }
8965
9454
  if (nodes.length) {
8966
9455
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
8967
- return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _313 => _313.parent, 'optionalAccess', _314 => _314.id]), () => ( null)), loc.index + 1);
9456
+ return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _314 => _314.parent, 'optionalAccess', _315 => _315.id]), () => ( null)), loc.index + 1);
8968
9457
  }
8969
9458
  }
8970
9459
  return _chunkHGTDMKNEcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
@@ -9003,7 +9492,7 @@ var ImageEditorController = (_class12 = class {
9003
9492
  enabled: spec.enabled,
9004
9493
  opacity: spec.opacity,
9005
9494
  blend: spec.blend,
9006
- mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _315 => _315.state, 'access', _316 => _316.selection, 'optionalAccess', _317 => _317.bounds]) ? _chunkUYXL6ZWQcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
9495
+ mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _316 => _316.state, 'access', _317 => _317.selection, 'optionalAccess', _318 => _318.bounds]) ? _chunkUYXL6ZWQcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
9007
9496
  });
9008
9497
  while (ids.has(layer.id)) layer.id = _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "adj");
9009
9498
  const { width, height } = this.naturalSize;
@@ -9080,7 +9569,7 @@ var ImageEditorController = (_class12 = class {
9080
9569
  const anchor = nodes[to];
9081
9570
  const without = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, id, () => null);
9082
9571
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, without, anchor.id);
9083
- return _chunkHGTDMKNEcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _318 => _318.parent, 'optionalAccess', _319 => _319.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
9572
+ return _chunkHGTDMKNEcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _319 => _319.parent, 'optionalAccess', _320 => _320.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
9084
9573
  }
9085
9574
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
9086
9575
  moveAdjustmentLayer(id, toIndex) {
@@ -9121,7 +9610,7 @@ var ImageEditorController = (_class12 = class {
9121
9610
  return _nullishCoalesce(this.state.selection, () => ( null));
9122
9611
  }
9123
9612
  get hasSelection() {
9124
- return Boolean(_optionalChain([this, 'access', _320 => _320.state, 'access', _321 => _321.selection, 'optionalAccess', _322 => _322.bounds]));
9613
+ return Boolean(_optionalChain([this, 'access', _321 => _321.state, 'access', _322 => _322.selection, 'optionalAccess', _323 => _323.bounds]));
9125
9614
  }
9126
9615
  /** Returns the current canvas (composition) dimensions. */
9127
9616
  getCanvasSize() {
@@ -9213,7 +9702,7 @@ var ImageEditorController = (_class12 = class {
9213
9702
  const prev = normalizeSelection(_nullishCoalesce(this.state.selection, () => ( null)));
9214
9703
  if (prev === next || prev && next && sameSelection(prev, next)) return false;
9215
9704
  this.recordHistory();
9216
- if (!next && _optionalChain([prev, 'optionalAccess', _323 => _323.bounds])) this.lastSelection = prev;
9705
+ if (!next && _optionalChain([prev, 'optionalAccess', _324 => _324.bounds])) this.lastSelection = prev;
9217
9706
  this.state.selection = next;
9218
9707
  this.notify();
9219
9708
  return true;
@@ -9228,7 +9717,7 @@ var ImageEditorController = (_class12 = class {
9228
9717
  return this.setSelection(null);
9229
9718
  }
9230
9719
  /** The selection a Deselect cleared, for `reselect` (not saved, not part of history). */
9231
- __init99() {this.lastSelection = null}
9720
+ __init103() {this.lastSelection = null}
9232
9721
  /** Whether `reselect` has a selection to bring back. */
9233
9722
  canReselect() {
9234
9723
  const { width, height } = this.naturalSize;
@@ -9256,14 +9745,14 @@ var ImageEditorController = (_class12 = class {
9256
9745
  /** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
9257
9746
  async growSelection(options = {}) {
9258
9747
  const sel = this.state.selection;
9259
- if (!_optionalChain([sel, 'optionalAccess', _324 => _324.bounds])) return false;
9748
+ if (!_optionalChain([sel, 'optionalAccess', _325 => _325.bounds])) return false;
9260
9749
  const pixels = await this.requirePixels(options);
9261
9750
  return this.setSelection(growSelection(pixels, sel, options));
9262
9751
  }
9263
9752
  /** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
9264
9753
  async selectSimilar(options = {}) {
9265
9754
  const sel = this.state.selection;
9266
- if (!_optionalChain([sel, 'optionalAccess', _325 => _325.bounds])) return false;
9755
+ if (!_optionalChain([sel, 'optionalAccess', _326 => _326.bounds])) return false;
9267
9756
  const pixels = await this.requirePixels(options);
9268
9757
  return this.setSelection(selectSimilar(pixels, sel, options));
9269
9758
  }
@@ -9355,6 +9844,28 @@ var ImageEditorController = (_class12 = class {
9355
9844
  this.setSelection(sel, "replace");
9356
9845
  return _nullishCoalesce(this.state.selection, () => ( null));
9357
9846
  }
9847
+ /**
9848
+ * Object Selection: the object inside `target.rect` (natural pixels; what is outside the box is
9849
+ * background) or under `target.point`, found by GrabCut (colour models of object and background
9850
+ * plus a graph cut along edges), combined with the selection by `mode` as one undo step.
9851
+ * Resolves to the resulting selection.
9852
+ */
9853
+ async selectObject(target, options = {}) {
9854
+ const { width, height } = this.naturalSize;
9855
+ if ("rect" in target) {
9856
+ const r = target.rect;
9857
+ if (!(r.width > 0 && r.height > 0)) throw new Error("The box needs a positive width and height.");
9858
+ if (r.x >= width || r.y >= height || r.x + r.width <= 0 || r.y + r.height <= 0) {
9859
+ throw new Error(`The box lies outside the image (0..${width}, 0..${height}); draw it around the object.`);
9860
+ }
9861
+ } else if (!(target.point.x >= 0 && target.point.y >= 0 && target.point.x < width && target.point.y < height)) {
9862
+ throw new Error(`(${target.point.x}, ${target.point.y}) is outside the image (0..${width - 1}, 0..${height - 1}); click on the object.`);
9863
+ }
9864
+ const pixels = await this.requirePixels({ sample: options.sampleAllLayers === false ? "active-layer" : "composite" });
9865
+ const region = selectObjectIn(pixels, target, { enhanceEdge: options.enhanceEdge });
9866
+ this.setSelection(region, _nullishCoalesce(options.mode, () => ( "replace")));
9867
+ return _nullishCoalesce(this.state.selection, () => ( null));
9868
+ }
9358
9869
  /**
9359
9870
  * Supplies the pixels the selection tools sample (natural size RGBA), e.g. decoded in a worker
9360
9871
  * or in a test; `null` goes back to reading the source image. Without a canvas (Node, workers)
@@ -9376,7 +9887,7 @@ var ImageEditorController = (_class12 = class {
9376
9887
  try {
9377
9888
  const canvas = await this.renderSource();
9378
9889
  const ctx = canvas.getContext("2d");
9379
- const data2 = _optionalChain([ctx, 'optionalAccess', _326 => _326.getImageData, 'optionalCall', _327 => _327(0, 0, width, height)]);
9890
+ const data2 = _optionalChain([ctx, 'optionalAccess', _327 => _327.getImageData, 'optionalCall', _328 => _328(0, 0, width, height)]);
9380
9891
  if (data2 && data2.data && data2.data.length >= width * height * 4) {
9381
9892
  base = { width, height, data: data2.data };
9382
9893
  this.samplePixels = base;
@@ -9451,7 +9962,7 @@ var ImageEditorController = (_class12 = class {
9451
9962
  /** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
9452
9963
  modifySelection(op, radius) {
9453
9964
  const sel = this.state.selection;
9454
- if (!_optionalChain([sel, 'optionalAccess', _328 => _328.bounds])) return false;
9965
+ if (!_optionalChain([sel, 'optionalAccess', _329 => _329.bounds])) return false;
9455
9966
  return this.setSelection(_chunkUYXL6ZWQcjs.modifySelection.call(void 0, sel, op, radius));
9456
9967
  }
9457
9968
  /**
@@ -9460,7 +9971,7 @@ var ImageEditorController = (_class12 = class {
9460
9971
  */
9461
9972
  async refineSelection(params, options = {}) {
9462
9973
  const sel = this.state.selection;
9463
- if (!_optionalChain([sel, 'optionalAccess', _329 => _329.bounds])) return false;
9974
+ if (!_optionalChain([sel, 'optionalAccess', _330 => _330.bounds])) return false;
9464
9975
  const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
9465
9976
  return this.setSelection(refineSelection(pixels, sel, params));
9466
9977
  }
@@ -9491,7 +10002,7 @@ var ImageEditorController = (_class12 = class {
9491
10002
  let mask;
9492
10003
  if (source === "selection") {
9493
10004
  const sel = this.state.selection;
9494
- if (!_optionalChain([sel, 'optionalAccess', _330 => _330.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
10005
+ if (!_optionalChain([sel, 'optionalAccess', _331 => _331.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
9495
10006
  mask = sel;
9496
10007
  } else if ("channelId" in source) {
9497
10008
  mask = this.requireChannel(source.channelId).mask;
@@ -9515,7 +10026,7 @@ var ImageEditorController = (_class12 = class {
9515
10026
  const canvas = this.renderer.createCanvas(w, h);
9516
10027
  const ctx = canvas.getContext("2d");
9517
10028
  if (ctx) ctx.drawImage(img, 0, 0, w, h);
9518
- const data = _optionalChain([ctx, 'optionalAccess', _331 => _331.getImageData, 'optionalCall', _332 => _332(0, 0, w, h)]);
10029
+ const data = _optionalChain([ctx, 'optionalAccess', _332 => _332.getImageData, 'optionalCall', _333 => _333(0, 0, w, h)]);
9519
10030
  if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
9520
10031
  return { width: w, height: h, data: data.data };
9521
10032
  }
@@ -9523,37 +10034,50 @@ var ImageEditorController = (_class12 = class {
9523
10034
  * Select › Subject: asks the segmentation provider for the objects matching `target` ("the
9524
10035
  * dog", "the sky") in the flattened image and selects their shapes, combined with the
9525
10036
  * selection by `mode`, as one undo step. Returns what was found (labels and bounds in natural
9526
- * pixels); an empty list leaves the selection as it was. Throws without a provider.
10037
+ * pixels); an empty list leaves the selection as it was. Without a provider, the subject that
10038
+ * stands out most is found classically (superpixels, saliency, Otsu, GrabCut): `target` can't
10039
+ * choose it, and `method: 'saliency'` and a `note` say so.
9527
10040
  */
9528
- async selectSubject(target, options = {}) {
10041
+ async selectSubject(target = "", options = {}) {
9529
10042
  const provider = this.segmentation;
9530
- if (!provider) throw new Error("Select Subject needs a segmentation provider (setSegmentationProvider).");
10043
+ if (!provider) {
10044
+ const pixels = await this.requirePixels({});
10045
+ _optionalChain([options, 'access', _334 => _334.signal, 'optionalAccess', _335 => _335.throwIfAborted, 'call', _336 => _336()]);
10046
+ const { selection, reason } = findSubject(pixels, { enhanceEdge: options.enhanceEdge });
10047
+ if (selection.bounds) this.shapeCommand(selection, options);
10048
+ const unused = target.trim() ? ` "${target.trim()}" was not used to choose it.` : "";
10049
+ return {
10050
+ segments: selection.bounds ? [{ label: "subject", bounds: selection.bounds }] : [],
10051
+ method: "saliency",
10052
+ note: _nullishCoalesce(reason, () => ( `No segmentation model is set, so the subject that stands out most was selected.${unused}`))
10053
+ };
10054
+ }
9531
10055
  const description = target.trim();
9532
10056
  if (!description) throw new Error("Describe the subject to select.");
9533
10057
  const { width, height } = this.naturalSize;
9534
10058
  const image = await this.toDataURL({ format: "image/png" });
9535
10059
  const results = await provider.segment({ image, width, height, target: description, maxSegments: options.maxSegments, signal: options.signal });
9536
- _optionalChain([options, 'access', _333 => _333.signal, 'optionalAccess', _334 => _334.throwIfAborted, 'call', _335 => _335()]);
10060
+ _optionalChain([options, 'access', _337 => _337.signal, 'optionalAccess', _338 => _338.throwIfAborted, 'call', _339 => _339()]);
9537
10061
  const decoded = [];
9538
10062
  for (const r of _nullishCoalesce(results, () => ( []))) {
9539
10063
  decoded.push({ ...r, mask: r.mask !== void 0 ? await this.decodeMaskImage(r.mask) : void 0 });
9540
10064
  }
9541
10065
  const segments = decoded.map((r) => {
9542
10066
  const one = segmentsToSelection(width, height, [r]);
9543
- return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _336 => _336.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
10067
+ return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _340 => _340.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
9544
10068
  });
9545
10069
  const mask = segmentsToSelection(width, height, decoded);
9546
10070
  if (mask && options.beforeApply) {
9547
10071
  const outlines = decoded.flatMap((r, i) => {
9548
10072
  const rings = segmentationOutlines(r);
9549
- const b = _optionalChain([segments, 'access', _337 => _337[i], 'optionalAccess', _338 => _338.bounds]);
10073
+ const b = _optionalChain([segments, 'access', _341 => _341[i], 'optionalAccess', _342 => _342.bounds]);
9550
10074
  return rings.length ? rings : b ? [[{ x: b.x, y: b.y }, { x: b.x + b.width, y: b.y }, { x: b.x + b.width, y: b.y + b.height }, { x: b.x, y: b.y + b.height }]] : [];
9551
10075
  });
9552
10076
  await options.beforeApply(outlines);
9553
- _optionalChain([options, 'access', _339 => _339.signal, 'optionalAccess', _340 => _340.throwIfAborted, 'call', _341 => _341()]);
10077
+ _optionalChain([options, 'access', _343 => _343.signal, 'optionalAccess', _344 => _344.throwIfAborted, 'call', _345 => _345()]);
9554
10078
  }
9555
10079
  if (mask) this.shapeCommand(mask, options);
9556
- return { segments: segments.filter((s) => s.bounds) };
10080
+ return { segments: segments.filter((s) => s.bounds), method: "model" };
9557
10081
  }
9558
10082
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
9559
10083
  setQuickMask(on) {
@@ -9583,7 +10107,7 @@ var ImageEditorController = (_class12 = class {
9583
10107
  const view = this.state.maskView;
9584
10108
  if (!view) return null;
9585
10109
  const layer = this.getLayer(view.layerId);
9586
- return _optionalChain([layer, 'optionalAccess', _342 => _342.mask]) && !layer.mask.source ? view : null;
10110
+ return _optionalChain([layer, 'optionalAccess', _346 => _346.mask]) && !layer.mask.source ? view : null;
9587
10111
  }
9588
10112
  /**
9589
10113
  * Shows a layer's mask on the canvas: `gray` alone in grey (Alt-click the mask thumbnail),
@@ -9606,7 +10130,7 @@ var ImageEditorController = (_class12 = class {
9606
10130
  if (!layer.mask) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to show; add one with add_layer_mask.`);
9607
10131
  if (layer.mask.source) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is computed, not painted, so it has no mask view.`);
9608
10132
  const cur = this.state.maskView;
9609
- if (_optionalChain([cur, 'optionalAccess', _343 => _343.layerId]) !== id || cur.mode !== mode) {
10133
+ if (_optionalChain([cur, 'optionalAccess', _347 => _347.layerId]) !== id || cur.mode !== mode) {
9610
10134
  this.state.maskView = { layerId: id, mode };
9611
10135
  this.notify();
9612
10136
  }
@@ -9618,7 +10142,7 @@ var ImageEditorController = (_class12 = class {
9618
10142
  return _nullishCoalesce(this.state.channels, () => ( []));
9619
10143
  }
9620
10144
  getChannel(id) {
9621
- return _nullishCoalesce(_optionalChain([this, 'access', _344 => _344.state, 'access', _345 => _345.channels, 'optionalAccess', _346 => _346.find, 'call', _347 => _347((c) => c.id === id)]), () => ( null));
10145
+ return _nullishCoalesce(_optionalChain([this, 'access', _348 => _348.state, 'access', _349 => _349.channels, 'optionalAccess', _350 => _350.find, 'call', _351 => _351((c) => c.id === id)]), () => ( null));
9622
10146
  }
9623
10147
  requireChannel(id) {
9624
10148
  const channel = this.getChannel(id);
@@ -9647,14 +10171,14 @@ var ImageEditorController = (_class12 = class {
9647
10171
  */
9648
10172
  saveSelection(options = {}) {
9649
10173
  const sel = this.state.selection;
9650
- if (!_optionalChain([sel, 'optionalAccess', _348 => _348.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
10174
+ if (!_optionalChain([sel, 'optionalAccess', _352 => _352.bounds])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
9651
10175
  const { width, height } = this.naturalSize;
9652
10176
  const sized = sel.width === width && sel.height === height ? sel : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, sel, width, height);
9653
10177
  const channels = [...this.getChannels()];
9654
10178
  if (options.channelId !== void 0) {
9655
10179
  const existing = this.requireChannel(options.channelId);
9656
10180
  const mask = _nullishCoalesce(_chunkUYXL6ZWQcjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkUYXL6ZWQcjs.createSelectionMask.call(void 0, width, height)));
9657
- const next = { ...existing, mask, ..._optionalChain([options, 'access', _349 => _349.name, 'optionalAccess', _350 => _350.trim, 'call', _351 => _351()]) ? { name: options.name.trim() } : {} };
10181
+ const next = { ...existing, mask, ..._optionalChain([options, 'access', _353 => _353.name, 'optionalAccess', _354 => _354.trim, 'call', _355 => _355()]) ? { name: options.name.trim() } : {} };
9658
10182
  this.setChannels(channels.map((c) => c.id === existing.id ? next : c));
9659
10183
  return next;
9660
10184
  }
@@ -9665,7 +10189,7 @@ var ImageEditorController = (_class12 = class {
9665
10189
  const channels = this.getChannels();
9666
10190
  const channel = {
9667
10191
  id: this.newChannelId(),
9668
- name: _optionalChain([name, 'optionalAccess', _352 => _352.trim, 'call', _353 => _353()]) || `Alpha ${channels.length + 1}`,
10192
+ name: _optionalChain([name, 'optionalAccess', _356 => _356.trim, 'call', _357 => _357()]) || `Alpha ${channels.length + 1}`,
9669
10193
  mask,
9670
10194
  color: DEFAULT_CHANNEL_COLOR,
9671
10195
  opacity: 0.5,
@@ -9710,7 +10234,7 @@ var ImageEditorController = (_class12 = class {
9710
10234
  /** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
9711
10235
  duplicateChannel(id, name) {
9712
10236
  const channel = this.requireChannel(id);
9713
- const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _354 => _354.trim, 'call', _355 => _355()]) || `${channel.name} copy` };
10237
+ const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _358 => _358.trim, 'call', _359 => _359()]) || `${channel.name} copy` };
9714
10238
  const channels = [...this.getChannels()];
9715
10239
  channels.splice(channels.findIndex((c) => c.id === id) + 1, 0, copy);
9716
10240
  this.setChannels(channels);
@@ -9741,7 +10265,7 @@ var ImageEditorController = (_class12 = class {
9741
10265
  quickMaskSurface() {
9742
10266
  const { width, height } = this.naturalSize;
9743
10267
  const sel = this.state.selection;
9744
- if (!_optionalChain([sel, 'optionalAccess', _356 => _356.bounds])) return _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, 0);
10268
+ if (!_optionalChain([sel, 'optionalAccess', _360 => _360.bounds])) return _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, 0);
9745
10269
  return (sel.width === width && sel.height === height ? sel : _chunkUYXL6ZWQcjs.resizeSelection.call(void 0, sel, width, height)).surface;
9746
10270
  }
9747
10271
  /** The selection a painted Quick Mask surface stands for (it shares the surface's tiles). */
@@ -9762,7 +10286,7 @@ var ImageEditorController = (_class12 = class {
9762
10286
  */
9763
10287
  applySelectionAsLayerMask(layerId, props = {}) {
9764
10288
  const sel = this.state.selection;
9765
- if (!_optionalChain([sel, 'optionalAccess', _357 => _357.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
10289
+ if (!_optionalChain([sel, 'optionalAccess', _361 => _361.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
9766
10290
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
9767
10291
  }
9768
10292
  setLayerMask(layerId, mask, commitToHistory = true) {
@@ -9802,7 +10326,7 @@ var ImageEditorController = (_class12 = class {
9802
10326
  /** A layer's painted mask over the canvas as a selection mask; null without one (or for a depth mask). */
9803
10327
  layerMaskCoverage(layerId) {
9804
10328
  const layer = this.getLayer(layerId);
9805
- if (!_optionalChain([layer, 'optionalAccess', _358 => _358.mask]) || layer.mask.source) return null;
10329
+ if (!_optionalChain([layer, 'optionalAccess', _362 => _362.mask]) || layer.mask.source) return null;
9806
10330
  const { width, height } = this.naturalSize;
9807
10331
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
9808
10332
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -9837,7 +10361,7 @@ var ImageEditorController = (_class12 = class {
9837
10361
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
9838
10362
  const next = { ...l };
9839
10363
  if (_chunkUYXL6ZWQcjs.isDefaultDepthMask.call(void 0, merged)) {
9840
- if (_optionalChain([next, 'access', _359 => _359.mask, 'optionalAccess', _360 => _360.source])) delete next.mask;
10364
+ if (_optionalChain([next, 'access', _363 => _363.mask, 'optionalAccess', _364 => _364.source])) delete next.mask;
9841
10365
  } else next.mask = _chunkUYXL6ZWQcjs.depthRasterMask.call(void 0, merged);
9842
10366
  return next;
9843
10367
  });
@@ -9847,7 +10371,7 @@ var ImageEditorController = (_class12 = class {
9847
10371
  resetDepthMask() {
9848
10372
  this.recordHistory();
9849
10373
  const target = this.developLayer();
9850
- if (_optionalChain([target, 'optionalAccess', _361 => _361.mask, 'optionalAccess', _362 => _362.source])) {
10374
+ if (_optionalChain([target, 'optionalAccess', _365 => _365.mask, 'optionalAccess', _366 => _366.source])) {
9851
10375
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
9852
10376
  const next = { ...l };
9853
10377
  delete next.mask;
@@ -9859,7 +10383,7 @@ var ImageEditorController = (_class12 = class {
9859
10383
  // --- Annotations & Layers ---
9860
10384
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
9861
10385
  annotationLayer(id) {
9862
- return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _363 => _363.id]) === id);
10386
+ return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkUYXL6ZWQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _367 => _367.id]) === id);
9863
10387
  }
9864
10388
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
9865
10389
  annotationEnv() {
@@ -9877,7 +10401,7 @@ var ImageEditorController = (_class12 = class {
9877
10401
  const fullAnnotation = { ...annotation, id };
9878
10402
  const layer = _chunkUYXL6ZWQcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
9879
10403
  const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
9880
- this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _364 => _364.parent, 'optionalAccess', _365 => _365.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
10404
+ this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _368 => _368.parent, 'optionalAccess', _369 => _369.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
9881
10405
  this.state.selectedAnnotationId = id;
9882
10406
  this.notify();
9883
10407
  return id;
@@ -9957,7 +10481,7 @@ var ImageEditorController = (_class12 = class {
9957
10481
  this.notify();
9958
10482
  }
9959
10483
  // --- Rendering & Export ---
9960
- __init100() {this.blankSource = null}
10484
+ __init104() {this.blankSource = null}
9961
10485
  /**
9962
10486
  * What the renderer draws from: the source image, or, for a document without one (an opened
9963
10487
  * PSD, a v3 document loaded on its own), a transparent canvas of the document size, since every
@@ -10000,7 +10524,7 @@ var ImageEditorController = (_class12 = class {
10000
10524
  await this.renderer.renderToCanvas(targetCanvas, source, this.state, {
10001
10525
  ...options,
10002
10526
  // The clone source follows the brush cursor (both editors pass it).
10003
- cloneSourceMarker: _optionalChain([options, 'optionalAccess', _366 => _366.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _367 => _367.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
10527
+ cloneSourceMarker: _optionalChain([options, 'optionalAccess', _370 => _370.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _371 => _371.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
10004
10528
  dirty: dirty === "all" ? void 0 : dirty,
10005
10529
  checkpointLayerId: this.state.activeLayerId
10006
10530
  });
@@ -10013,7 +10537,7 @@ var ImageEditorController = (_class12 = class {
10013
10537
  return this.renderer.createCanvas(1, 1);
10014
10538
  }
10015
10539
  this.syncViews();
10016
- if (_optionalChain([options, 'optionalAccess', _368 => _368.layerIds])) {
10540
+ if (_optionalChain([options, 'optionalAccess', _372 => _372.layerIds])) {
10017
10541
  const keep = new Set(options.layerIds);
10018
10542
  const layers = _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
10019
10543
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
@@ -10167,7 +10691,7 @@ var ImageEditorController = (_class12 = class {
10167
10691
  let px2 = await this.decodeImage(newDataUrl);
10168
10692
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
10169
10693
  const data = new Uint8ClampedArray(px2.data);
10170
- const sel = _optionalChain([this, 'access', _369 => _369.state, 'access', _370 => _370.selection, 'optionalAccess', _371 => _371.bounds]) ? this.state.selection : null;
10694
+ const sel = _optionalChain([this, 'access', _373 => _373.state, 'access', _374 => _374.selection, 'optionalAccess', _375 => _375.bounds]) ? this.state.selection : null;
10171
10695
  if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
10172
10696
  return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
10173
10697
  }
@@ -10214,7 +10738,7 @@ var ImageEditorController = (_class12 = class {
10214
10738
  }
10215
10739
  /** Font families the shaper offers (generic families at least). */
10216
10740
  listFonts() {
10217
- return _nullishCoalesce(_optionalChain([this, 'access', _372 => _372.getTextShaper, 'call', _373 => _373(), 'optionalAccess', _374 => _374.families, 'optionalCall', _375 => _375()]), () => ( ["sans-serif", "serif", "monospace"]));
10741
+ return _nullishCoalesce(_optionalChain([this, 'access', _376 => _376.getTextShaper, 'call', _377 => _377(), 'optionalAccess', _378 => _378.families, 'optionalCall', _379 => _379()]), () => ( ["sans-serif", "serif", "monospace"]));
10218
10742
  }
10219
10743
  typeInfo(id) {
10220
10744
  const layer = _chunkUYXL6ZWQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
@@ -10288,8 +10812,8 @@ var ImageEditorController = (_class12 = class {
10288
10812
  const layer = this.layoutTypeLayer({ ...init, text, orientation: vertical ? "vertical" : "horizontal" });
10289
10813
  const { width, height } = this.naturalSize;
10290
10814
  const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, layer.surface);
10291
- const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _376 => _376.x]), () => ( 0)));
10292
- const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _377 => _377.y]), () => ( 0)));
10815
+ const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _380 => _380.x]), () => ( 0)));
10816
+ const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _381 => _381.y]), () => ( 0)));
10293
10817
  const x1 = Math.min(width, b ? b.x + b.width : 0);
10294
10818
  const y1 = Math.min(height, b ? b.y + b.height : 0);
10295
10819
  let mask;
@@ -10466,7 +10990,7 @@ var ImageEditorController = (_class12 = class {
10466
10990
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
10467
10991
  const missing = _chunkBRKVNXDZcjs.layoutText.call(void 0, layer, shaper).missingFonts;
10468
10992
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
10469
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _378 => _378.runs, 'access', _379 => _379.find, 'call', _380 => _380((r) => r.length > 0), 'optionalAccess', _381 => _381.style]), () => ( _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE));
10993
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _382 => _382.runs, 'access', _383 => _383.find, 'call', _384 => _384((r) => r.length > 0), 'optionalAccess', _385 => _385.style]), () => ( _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE));
10470
10994
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
10471
10995
  const shape = _chunkUYXL6ZWQcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
10472
10996
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
@@ -10499,7 +11023,7 @@ var ImageEditorController = (_class12 = class {
10499
11023
  // --- Shape layers ---
10500
11024
  /** What shape rendering needs: the canvas size and the document's patterns. */
10501
11025
  shapeEnv() {
10502
- return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _382 => _382.state, 'access', _383 => _383.patterns, 'optionalAccess', _384 => _384.find, 'call', _385 => _385((p) => p.id === id)]), () => ( null)) };
11026
+ return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _386 => _386.state, 'access', _387 => _387.patterns, 'optionalAccess', _388 => _388.find, 'call', _389 => _389((p) => p.id === id)]), () => ( null)) };
10503
11027
  }
10504
11028
  /** One component from tool or UI input (validated). */
10505
11029
  componentFrom(spec, path) {
@@ -10542,9 +11066,9 @@ var ImageEditorController = (_class12 = class {
10542
11066
  * open path) and stroked with `stroke`. Goes above the active layer unless placed. Returns its id.
10543
11067
  */
10544
11068
  addShapeLayer(init) {
10545
- const specs = _optionalChain([init, 'access', _386 => _386.components, 'optionalAccess', _387 => _387.length]) ? init.components : [init];
10546
- if (_optionalChain([init, 'access', _388 => _388.components, 'optionalAccess', _389 => _389.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
10547
- const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _390 => _390.components, 'optionalAccess', _391 => _391.length]) ? `components[${i}].` : ""));
11069
+ const specs = _optionalChain([init, 'access', _390 => _390.components, 'optionalAccess', _391 => _391.length]) ? init.components : [init];
11070
+ if (_optionalChain([init, 'access', _392 => _392.components, 'optionalAccess', _393 => _393.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
11071
+ const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _394 => _394.components, 'optionalAccess', _395 => _395.length]) ? `components[${i}].` : ""));
10548
11072
  const stroke = init.stroke ? _chunkUYXL6ZWQcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
10549
11073
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
10550
11074
  const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkUYXL6ZWQcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkUYXL6ZWQcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
@@ -10655,7 +11179,7 @@ var ImageEditorController = (_class12 = class {
10655
11179
  if (layer.locks) next.locks = layer.locks;
10656
11180
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
10657
11181
  } else if (layer.type === "pixel") {
10658
- if (!_optionalChain([layer, 'access', _392 => _392.filters, 'optionalAccess', _393 => _393.length])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
11182
+ if (!_optionalChain([layer, 'access', _396 => _396.filters, 'optionalAccess', _397 => _397.length])) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
10659
11183
  _chunkUYXL6ZWQcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
10660
11184
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
10661
11185
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
@@ -10674,7 +11198,7 @@ var ImageEditorController = (_class12 = class {
10674
11198
  return this.rasterizeSmartObject(id);
10675
11199
  } else if (layer.type === "shape" || layer.type === "type") {
10676
11200
  next = layer.type === "shape" ? _chunkUYXL6ZWQcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkUYXL6ZWQcjs.typeAsPixelLayer.call(void 0, layer);
10677
- if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _394 => _394.annotation, 'optionalAccess', _395 => _395.id])) this.state.selectedAnnotationId = null;
11201
+ if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _398 => _398.annotation, 'optionalAccess', _399 => _399.id])) this.state.selectedAnnotationId = null;
10678
11202
  } else {
10679
11203
  throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Only shape, type and annotation layers, smart objects and pixel layers with filters rasterize; "${layer.name || id}" is a ${layer.type} layer. Merge it down or flatten instead.`);
10680
11204
  }
@@ -10688,8 +11212,8 @@ var ImageEditorController = (_class12 = class {
10688
11212
  const doc = this.state.colorProfile;
10689
11213
  const p = resolveProfile(doc);
10690
11214
  const m = this.state.colorMode;
10691
- const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _396 => _396.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _397 => _397.mode]), () => ( "rgb")) };
10692
- if (_optionalChain([m, 'optionalAccess', _398 => _398.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
11215
+ const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _400 => _400.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _401 => _401.mode]), () => ( "rgb")) };
11216
+ if (_optionalChain([m, 'optionalAccess', _402 => _402.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
10693
11217
  return out;
10694
11218
  }
10695
11219
  /**
@@ -10779,7 +11303,7 @@ var ImageEditorController = (_class12 = class {
10779
11303
  const textEnv = this.textEnv();
10780
11304
  const walk = (layers) => layers.map((l) => {
10781
11305
  let next2 = l;
10782
- if (_optionalChain([l, 'access', _399 => _399.effects, 'optionalAccess', _400 => _400.items, 'access', _401 => _401.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
11306
+ if (_optionalChain([l, 'access', _403 => _403.effects, 'optionalAccess', _404 => _404.items, 'access', _405 => _405.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
10783
11307
  if (l.type === "group") {
10784
11308
  if (next2 !== l) converted.push(l.id);
10785
11309
  return { ...next2, children: walk(l.children) };
@@ -10848,7 +11372,7 @@ var ImageEditorController = (_class12 = class {
10848
11372
  }
10849
11373
  if (src.colorSpace !== "rgb") throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
10850
11374
  const t = _chunkBROJYMWUcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
10851
- const toLab = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
11375
+ const toLab2 = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
10852
11376
  return colors.map((input) => {
10853
11377
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
10854
11378
  if (!m) throw new (0, _chunkUYXL6ZWQcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
@@ -10858,7 +11382,7 @@ var ImageEditorController = (_class12 = class {
10858
11382
  t.eval(rgb, out);
10859
11383
  const values = Array.from(out.subarray(0, t.outputs), (v) => Math.round(Math.min(1, Math.max(0, v)) * 1e4) / 1e4);
10860
11384
  const l = new Float32Array(3);
10861
- toLab.eval(rgb, l);
11385
+ toLab2.eval(rgb, l);
10862
11386
  const lab = [Math.round(l[0] * 1e4) / 100, Math.round((l[1] * 255 - 128) * 100) / 100, Math.round((l[2] * 255 - 128) * 100) / 100];
10863
11387
  const res = { input, values, lab };
10864
11388
  if (dst.colorSpace === "rgb") res.hex = `#${values.map((v) => Math.round(v * 255).toString(16).padStart(2, "0")).join("")}`;
@@ -10963,8 +11487,8 @@ var ImageEditorController = (_class12 = class {
10963
11487
  else delete s.bitDepth;
10964
11488
  delete s.colorProfile;
10965
11489
  delete s.colorMode;
10966
- if (_optionalChain([result, 'access', _402 => _402.sourceMode, 'optionalAccess', _403 => _403.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
10967
- else if (_optionalChain([result, 'access', _404 => _404.sourceMode, 'optionalAccess', _405 => _405.mode]) === "lab") s.colorMode = { mode: "lab" };
11490
+ if (_optionalChain([result, 'access', _406 => _406.sourceMode, 'optionalAccess', _407 => _407.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
11491
+ else if (_optionalChain([result, 'access', _408 => _408.sourceMode, 'optionalAccess', _409 => _409.mode]) === "lab") s.colorMode = { mode: "lab" };
10968
11492
  else if (result.iccProfile) {
10969
11493
  try {
10970
11494
  const doc = documentProfile(result.iccProfile);
@@ -11028,7 +11552,7 @@ var ImageEditorController = (_class12 = class {
11028
11552
  const compositor = new (0, _chunkUYXL6ZWQcjs.LayerCompositor)();
11029
11553
  const bakeMask = (layer) => {
11030
11554
  const mask = layer.mask;
11031
- if (!_optionalChain([mask, 'optionalAccess', _406 => _406.source])) return mask;
11555
+ if (!_optionalChain([mask, 'optionalAccess', _410 => _410.source])) return mask;
11032
11556
  add2("Parametric (depth) masks were baked into pixel masks", layer.name);
11033
11557
  const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
11034
11558
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
@@ -11045,7 +11569,7 @@ var ImageEditorController = (_class12 = class {
11045
11569
  };
11046
11570
  const prepare = async (layer) => {
11047
11571
  const p = await prepareLayer(layer);
11048
- if (_optionalChain([p, 'optionalAccess', _407 => _407.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
11572
+ if (_optionalChain([p, 'optionalAccess', _411 => _411.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
11049
11573
  return p;
11050
11574
  };
11051
11575
  const prepareLayer = async (layer) => {
@@ -11088,7 +11612,7 @@ var ImageEditorController = (_class12 = class {
11088
11612
  return out2;
11089
11613
  }
11090
11614
  if (layer.type === "shape" || layer.type === "type") {
11091
- if (layer.type === "type" && _optionalChain([layer, 'access', _408 => _408.missingFonts, 'optionalAccess', _409 => _409.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
11615
+ if (layer.type === "type" && _optionalChain([layer, 'access', _412 => _412.missingFonts, 'optionalAccess', _413 => _413.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
11092
11616
  const out2 = { ...layer };
11093
11617
  const mask2 = bakeMask(layer);
11094
11618
  if (mask2) out2.mask = mask2;
@@ -11107,7 +11631,7 @@ var ImageEditorController = (_class12 = class {
11107
11631
  out.surface = this.surfaceOf(layer);
11108
11632
  delete out.source;
11109
11633
  }
11110
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _410 => _410.filters, 'optionalAccess', _411 => _411.filter, 'call', _412 => _412(_chunkUYXL6ZWQcjs.isActiveFilter)]), () => ( []));
11634
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _414 => _414.filters, 'optionalAccess', _415 => _415.filter, 'call', _416 => _416(_chunkUYXL6ZWQcjs.isActiveFilter)]), () => ( []));
11111
11635
  if (active.length) {
11112
11636
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
11113
11637
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -11118,7 +11642,7 @@ var ImageEditorController = (_class12 = class {
11118
11642
  const data = compositor.composite([content], canvas, sources);
11119
11643
  out = { ...out, surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
11120
11644
  }
11121
- if (_optionalChain([layer, 'access', _413 => _413.filters, 'optionalAccess', _414 => _414.some, 'call', _415 => _415((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
11645
+ if (_optionalChain([layer, 'access', _417 => _417.filters, 'optionalAccess', _418 => _418.some, 'call', _419 => _419((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
11122
11646
  delete out.filters;
11123
11647
  const mask = bakeMask(layer);
11124
11648
  if (mask) out.mask = mask;
@@ -11182,7 +11706,7 @@ var ImageEditorController = (_class12 = class {
11182
11706
  );
11183
11707
  }
11184
11708
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
11185
- const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _416 => _416.state, 'access', _417 => _417.patterns, 'optionalAccess', _418 => _418.find, 'call', _419 => _419((p) => p.id === pid)]), () => ( null)) };
11709
+ const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _420 => _420.state, 'access', _421 => _421.patterns, 'optionalAccess', _422 => _422.find, 'call', _423 => _423((p) => p.id === pid)]), () => ( null)) };
11186
11710
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
11187
11711
  if (l.type === "annotation") {
11188
11712
  layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
@@ -11191,7 +11715,7 @@ var ImageEditorController = (_class12 = class {
11191
11715
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
11192
11716
  const fromAnnotation = scaled ? _chunkUYXL6ZWQcjs.shapeFromAnnotation.call(void 0, scaled) : null;
11193
11717
  const m = [sx, 0, 0, sy, 0, 0];
11194
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _420 => _420.components]), () => ( _chunkUYXL6ZWQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
11718
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _424 => _424.components]), () => ( _chunkUYXL6ZWQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
11195
11719
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
11196
11720
  if (scaled && fromAnnotation) moved.annotation = scaled;
11197
11721
  else delete moved.annotation;
@@ -11209,7 +11733,7 @@ var ImageEditorController = (_class12 = class {
11209
11733
  this.notify();
11210
11734
  }
11211
11735
  toJSON(options) {
11212
- const root = _optionalChain([this, 'access', _421 => _421.contentsStack, 'access', _422 => _422[0], 'optionalAccess', _423 => _423.saved]);
11736
+ const root = _optionalChain([this, 'access', _425 => _425.contentsStack, 'access', _426 => _426[0], 'optionalAccess', _427 => _427.saved]);
11213
11737
  const current = this.state;
11214
11738
  const element = this.imageElement;
11215
11739
  if (root) {
@@ -11220,8 +11744,8 @@ var ImageEditorController = (_class12 = class {
11220
11744
  let out;
11221
11745
  try {
11222
11746
  out = this.serializeState();
11223
- if (_optionalChain([this, 'access', _424 => _424.state, 'access', _425 => _425.selection, 'optionalAccess', _426 => _426.bounds])) out.selection = _chunkUYXL6ZWQcjs.serializeSelection.call(void 0, this.state.selection);
11224
- if (_optionalChain([this, 'access', _427 => _427.state, 'access', _428 => _428.channels, 'optionalAccess', _429 => _429.length])) out.channels = serializeChannels(this.state.channels);
11747
+ if (_optionalChain([this, 'access', _428 => _428.state, 'access', _429 => _429.selection, 'optionalAccess', _430 => _430.bounds])) out.selection = _chunkUYXL6ZWQcjs.serializeSelection.call(void 0, this.state.selection);
11748
+ if (_optionalChain([this, 'access', _431 => _431.state, 'access', _432 => _432.channels, 'optionalAccess', _433 => _433.length])) out.channels = serializeChannels(this.state.channels);
11225
11749
  } finally {
11226
11750
  if (root) {
11227
11751
  this.state = current;
@@ -11270,7 +11794,7 @@ var ImageEditorController = (_class12 = class {
11270
11794
  this.notify();
11271
11795
  }
11272
11796
  /** Problems found by the last `loadJSON` / `initialState` of a v3 document (unreadable layers or assets). */
11273
- __init101() {this.lastLoadProblems = []}
11797
+ __init105() {this.lastLoadProblems = []}
11274
11798
  applyStored(raw) {
11275
11799
  const s = this.state;
11276
11800
  const data = migrateSerializedImageEditorState(raw);
@@ -11335,10 +11859,10 @@ var ImageEditorController = (_class12 = class {
11335
11859
  serializeState() {
11336
11860
  const { width, height } = this.naturalSize;
11337
11861
  const view = _chunkUYXL6ZWQcjs.legacyView.call(void 0, this.stack(), width, height, null);
11338
- if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _430 => _430.state, 'access', _431 => _431.patterns, 'optionalAccess', _432 => _432.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11862
+ if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _434 => _434.state, 'access', _435 => _435.patterns, 'optionalAccess', _436 => _436.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11339
11863
  return {
11340
11864
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
11341
- version: _optionalChain([view, 'access', _433 => _433.adjustments, 'access', _434 => _434.layers, 'optionalAccess', _435 => _435.length]) ? 2 : 1,
11865
+ version: _optionalChain([view, 'access', _437 => _437.adjustments, 'access', _438 => _438.layers, 'optionalAccess', _439 => _439.length]) ? 2 : 1,
11342
11866
  crop: this.state.crop ? { ...this.state.crop } : null,
11343
11867
  transform: { ...this.state.transform },
11344
11868
  adjustments: serializeAdjustments(view.adjustments),
@@ -11363,17 +11887,17 @@ var ImageEditorController = (_class12 = class {
11363
11887
  };
11364
11888
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
11365
11889
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
11366
- if (_optionalChain([this, 'access', _436 => _436.state, 'access', _437 => _437.patterns, 'optionalAccess', _438 => _438.length])) out.patterns = _chunkUYXL6ZWQcjs.serializePatterns.call(void 0, this.state.patterns);
11890
+ if (_optionalChain([this, 'access', _440 => _440.state, 'access', _441 => _441.patterns, 'optionalAccess', _442 => _442.length])) out.patterns = _chunkUYXL6ZWQcjs.serializePatterns.call(void 0, this.state.patterns);
11367
11891
  if (smartContents) out.smartContents = smartContents;
11368
11892
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
11369
11893
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
11370
11894
  if (this.state.colorMode) out.colorMode = serializeColorMode(this.state.colorMode);
11371
11895
  return out;
11372
11896
  }
11373
- }, _class12);
11897
+ }, _class13);
11374
11898
  function serializeAdjustments(adjustments) {
11375
11899
  const out = { ...adjustments };
11376
- if (_optionalChain([out, 'access', _439 => _439.layers, 'optionalAccess', _440 => _440.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11900
+ if (_optionalChain([out, 'access', _443 => _443.layers, 'optionalAccess', _444 => _444.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11377
11901
  else delete out.layers;
11378
11902
  if (_chunkUYXL6ZWQcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkUYXL6ZWQcjs.LEGACY_PROCESS_VERSION) {
11379
11903
  delete out.process;
@@ -11409,11 +11933,11 @@ function withDevelop(layer, partial) {
11409
11933
  return { ...layer, filters };
11410
11934
  }
11411
11935
  function withBlur(layer, radius) {
11412
- const existing = _optionalChain([layer, 'access', _441 => _441.filters, 'optionalAccess', _442 => _442.find, 'call', _443 => _443((f) => f.kind === "blur")]);
11936
+ const existing = _optionalChain([layer, 'access', _445 => _445.filters, 'optionalAccess', _446 => _446.find, 'call', _447 => _447((f) => f.kind === "blur")]);
11413
11937
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
11414
11938
  if (radius > 0) {
11415
11939
  filters.push({
11416
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _444 => _444.id]), () => ( (layer.source === "document" ? _chunkUYXL6ZWQcjs.BLUR_FILTER_ID : _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "flt")))),
11940
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _448 => _448.id]), () => ( (layer.source === "document" ? _chunkUYXL6ZWQcjs.BLUR_FILTER_ID : _chunkUYXL6ZWQcjs.newLayerId.call(void 0, "flt")))),
11417
11941
  kind: "blur",
11418
11942
  enabled: true,
11419
11943
  radius
@@ -11509,7 +12033,7 @@ function collectStateTiles(layers, into) {
11509
12033
  if (l.type === "shape" || l.type === "type") _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.surface, into);
11510
12034
  if (l.type === "smart") {
11511
12035
  _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.surface, into);
11512
- if (_optionalChain([l, 'access', _445 => _445.smartFilters, 'optionalAccess', _446 => _446.mask])) _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
12036
+ if (_optionalChain([l, 'access', _449 => _449.smartFilters, 'optionalAccess', _450 => _450.mask])) _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
11513
12037
  if (l.contents.raster) _chunkCWM3CUUXcjs.collectTiles.call(void 0, l.contents.raster, into);
11514
12038
  if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
11515
12039
  }
@@ -11541,7 +12065,7 @@ function pixelsOnly(layers) {
11541
12065
  for (const l of layers) {
11542
12066
  if (l.type === "adjustment") continue;
11543
12067
  if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
11544
- else if (l.type === "pixel" && _optionalChain([l, 'access', _447 => _447.filters, 'optionalAccess', _448 => _448.length])) {
12068
+ else if (l.type === "pixel" && _optionalChain([l, 'access', _451 => _451.filters, 'optionalAccess', _452 => _452.length])) {
11545
12069
  const p = { ...l };
11546
12070
  delete p.filters;
11547
12071
  out.push(p);
@@ -11607,7 +12131,7 @@ function toHex(c) {
11607
12131
  return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
11608
12132
  }
11609
12133
  function normalizeSelection(mask) {
11610
- return _optionalChain([mask, 'optionalAccess', _449 => _449.bounds]) ? mask : null;
12134
+ return _optionalChain([mask, 'optionalAccess', _453 => _453.bounds]) ? mask : null;
11611
12135
  }
11612
12136
  function sameSelection(a, b) {
11613
12137
  if (a.width !== b.width || a.height !== b.height) return false;
@@ -11817,7 +12341,7 @@ function loadImageEditorDocument(input) {
11817
12341
  }
11818
12342
  const state = { version: 1, ...result.value };
11819
12343
  if (isV2) {
11820
- if (_optionalChain([state, 'access', _450 => _450.adjustments, 'access', _451 => _451.layers, 'optionalAccess', _452 => _452.length])) state.version = 2;
12344
+ if (_optionalChain([state, 'access', _454 => _454.adjustments, 'access', _455 => _455.layers, 'optionalAccess', _456 => _456.length])) state.version = 2;
11821
12345
  result.report.version = 2;
11822
12346
  }
11823
12347
  if (state.selection === void 0) delete state.selection;
@@ -12025,7 +12549,7 @@ function findAdjustmentControl(id) {
12025
12549
  }
12026
12550
  function findLayerControl(kind, id) {
12027
12551
  if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
12028
- return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _453 => _453[kind], 'optionalAccess', _454 => _454.find, 'call', _455 => _455((c) => c.id === id)]);
12552
+ return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _457 => _457[kind], 'optionalAccess', _458 => _458.find, 'call', _459 => _459((c) => c.id === id)]);
12029
12553
  }
12030
12554
  function clampControlValue(spec, v) {
12031
12555
  if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
@@ -12242,7 +12766,7 @@ var DEPTH_MASK_CONTROLS = [
12242
12766
  // src/image-editor/playback.ts
12243
12767
  var IMAGE_PLAYBACK_KIND = "layer";
12244
12768
  var PAINT = /^(paint_stroke|clone_stamp|heal_brush|spot_heal|dodge|burn|sponge|smudge|blur_stroke|sharpen_stroke|history_brush|set_clone_source|set_clone_transform|fill_pixels|clear_pixels|set_paint|set_retouch_options|load_mixer_brush|clean_mixer_brush)$/;
12245
- var SELECT = /^(select_region|select_subject|select_by_color|select_all|deselect|invert_selection|select_rect|select_ellipse|select_polygon|quick_select|select_line|magic_wand|grow_selection|select_similar|reselect|select_layer_transparency|select_color_range|load_selection_from_image|load_selection_from_mask|set_selection_display|modify_selection|refine_selection|transform_selection|apply_selection_as_mask|layer_via_copy|stroke_selection|content_aware_fill|copy_pixels|cut_pixels|paste_pixels|save_selection|load_selection_from_channel|set_channel_properties|duplicate_channel|delete_channel|load_channel_from_image|set_quick_mask|path_to_selection|select_text_shape)$/;
12769
+ var SELECT = /^(select_region|select_subject|select_by_color|select_all|deselect|invert_selection|select_rect|select_ellipse|select_polygon|quick_select|select_object|select_line|magic_wand|grow_selection|select_similar|reselect|select_layer_transparency|select_color_range|load_selection_from_image|load_selection_from_mask|set_selection_display|modify_selection|refine_selection|transform_selection|apply_selection_as_mask|layer_via_copy|stroke_selection|content_aware_fill|copy_pixels|cut_pixels|paste_pixels|save_selection|load_selection_from_channel|set_channel_properties|duplicate_channel|delete_channel|load_channel_from_image|set_quick_mask|path_to_selection|select_text_shape)$/;
12246
12770
  var ANNOTATE = /^(add_shape_layer|update_shape|add_shape_component|set_shape_component|remove_shape_component|merge_shape_components|add_text_layer|set_text|set_text_style|set_paragraph_style|set_text_frame|set_text_orientation|convert_text_to_shape)$/;
12247
12771
  var CROP = /^(set_crop|crop_to_selection|reset_crop|set_rotation|flip_image|transform_layer|warp_layer|flip_layer|offset_layer)$/;
12248
12772
  var ADJUST = /^(set_adjustments|add_adjustment_layer|update_adjustment_layer|remove_adjustment_layer|move_adjustment_layer)$/;
@@ -12365,6 +12889,7 @@ var SELECTION_TOOLS = [
12365
12889
  { id: "polygon", label: "Polygonal Lasso" },
12366
12890
  { id: "magnetic", label: "Magnetic Lasso" },
12367
12891
  { id: "quick", label: "Quick Selection" },
12892
+ { id: "object", label: "Object Selection" },
12368
12893
  { id: "range", label: "Color Range" },
12369
12894
  { id: "type", label: "Type Mask" },
12370
12895
  { id: "type-vertical", label: "Vertical Type Mask" }
@@ -12405,6 +12930,8 @@ var DEFAULT_SELECTION_TOOL_OPTIONS = {
12405
12930
  quickSize: 30,
12406
12931
  quickSampleAll: true,
12407
12932
  quickEnhance: false,
12933
+ objectSampleAll: true,
12934
+ objectEnhance: false,
12408
12935
  typeText: "Type",
12409
12936
  typeSize: 72,
12410
12937
  typeFamily: "sans-serif"
@@ -12477,7 +13004,7 @@ function summary(controller) {
12477
13004
  const area = _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel);
12478
13005
  return {
12479
13006
  empty: !sel,
12480
- bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _456 => _456.bounds]), () => ( null)),
13007
+ bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _460 => _460.bounds]), () => ( null)),
12481
13008
  /** Σ coverage in pixels. */
12482
13009
  area: Math.round(area),
12483
13010
  percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
@@ -12553,7 +13080,7 @@ function createImageSelectionTools(controller) {
12553
13080
  break;
12554
13081
  }
12555
13082
  case "polygon": {
12556
- const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _457 => _457.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _458 => _458.y]), NaN) })) : [];
13083
+ const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _461 => _461.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _462 => _462.y]), NaN) })) : [];
12557
13084
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
12558
13085
  throw new Error("polygon needs points: at least 3 { x, y } vertices.");
12559
13086
  }
@@ -12790,7 +13317,7 @@ function createImageSelectionTools(controller) {
12790
13317
  },
12791
13318
  annotations: writeAnnotations("Select a polygon (lasso)", true),
12792
13319
  handler: async (args) => {
12793
- const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _459 => _459.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _460 => _460.y]), NaN) })) : [];
13320
+ const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _463 => _463.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _464 => _464.y]), NaN) })) : [];
12794
13321
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
12795
13322
  throw new Error("points needs at least 3 { x, y } vertices in natural image pixels.");
12796
13323
  }
@@ -12827,7 +13354,7 @@ function createImageSelectionTools(controller) {
12827
13354
  },
12828
13355
  annotations: writeAnnotations("Quick Selection"),
12829
13356
  handler: async (args) => {
12830
- const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _461 => _461.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _462 => _462.y]), NaN) })) : []) : [];
13357
+ const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _465 => _465.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _466 => _466.y]), NaN) })) : []) : [];
12831
13358
  if (!strokes.length || strokes.some((s) => !s.length || !s.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y)))) {
12832
13359
  throw new Error("strokes needs at least one stroke of { x, y } points in natural image pixels.");
12833
13360
  }
@@ -12840,6 +13367,39 @@ function createImageSelectionTools(controller) {
12840
13367
  return summary(controller);
12841
13368
  }
12842
13369
  };
13370
+ const selectObjectTool = {
13371
+ name: "select_object",
13372
+ title: "Object Selection",
13373
+ description: "Object Selection: selects the object inside rect (a box drawn loosely around it, natural image pixels; what lies outside the box is treated as background) or the object under point, found from the colours of object and background and the edges between them (GrabCut). Combined with the selection by mode. A box is more reliable than a point: make it a little larger than the object on every side. Check with get_selection and capture_view, then fix with quick_select strokes or select_object with mode add / subtract. One undoable step. Returns the selection.",
13374
+ inputSchema: {
13375
+ type: "object",
13376
+ properties: {
13377
+ rect: {
13378
+ type: "object",
13379
+ properties: rectProperties,
13380
+ required: ["x", "y", "width", "height"],
13381
+ additionalProperties: false,
13382
+ description: "A box around the object (x, y, width, height in natural image pixels). Pass this or point."
13383
+ },
13384
+ point: { ...pointSchema, description: "A point on the object (natural image pixels). Pass this or rect." },
13385
+ mode: modeSchema,
13386
+ sampleAllLayers: { type: "boolean", description: "Read every layer (default true); false reads only the active pixel layer." },
13387
+ enhanceEdge: { type: "boolean", description: "Smoother, less blocky edges (Auto-Enhance; default false)." }
13388
+ },
13389
+ additionalProperties: false
13390
+ },
13391
+ annotations: writeAnnotations("Object Selection"),
13392
+ handler: async (args) => {
13393
+ const rect = args.rect;
13394
+ const point = args.point;
13395
+ if (!rect && !point) throw new Error("Pass rect (a box around the object) or point (a point on it).");
13396
+ if (rect && point) throw new Error("Pass rect or point, not both.");
13397
+ const options = { mode: _chunkUYXL6ZWQcjs.parseSelectionMode.call(void 0, args.mode), sampleAllLayers: args.sampleAllLayers, enhanceEdge: args.enhanceEdge };
13398
+ if (rect) await controller.selectObject({ rect: { x: num2(rect.x, NaN), y: num2(rect.y, NaN), width: num2(rect.width, NaN), height: num2(rect.height, NaN) } }, options);
13399
+ else await controller.selectObject({ point: { x: num2(point.x, NaN), y: num2(point.y, NaN) } }, options);
13400
+ return summary(controller);
13401
+ }
13402
+ };
12843
13403
  const magicWandTool = {
12844
13404
  name: "magic_wand",
12845
13405
  title: "Magic wand",
@@ -12933,7 +13493,7 @@ function createImageSelectionTools(controller) {
12933
13493
  await controller.selectColorRangePreset(args.preset, { ...common, falloff: num2(args.fuzziness, 20) });
12934
13494
  } else {
12935
13495
  const samples = args.samples.map((s, i) => {
12936
- if (typeof _optionalChain([s, 'optionalAccess', _463 => _463.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
13496
+ if (typeof _optionalChain([s, 'optionalAccess', _467 => _467.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
12937
13497
  const at = typeof s.x === "number" && typeof s.y === "number" ? { x: s.x, y: s.y } : void 0;
12938
13498
  return at ? { color: s.color, at } : { color: s.color };
12939
13499
  });
@@ -13393,6 +13953,8 @@ function createImageSelectionTools(controller) {
13393
13953
  selectEllipse,
13394
13954
  selectPolygonTool,
13395
13955
  quickSelectTool,
13956
+ selectObjectTool,
13957
+ createImageSubjectSelectionTool(controller),
13396
13958
  lineTool,
13397
13959
  magicWandTool,
13398
13960
  colorRangeTool,
@@ -13429,49 +13991,50 @@ function createImageSubjectSelectionTool(controller) {
13429
13991
  return {
13430
13992
  name: "select_subject",
13431
13993
  title: "Select a subject",
13432
- description: 'Select \u203A Subject: an AI segmentation model finds the objects matching target (a description such as "the dog", "the house", "the sky") in the flattened image and selects their outlines, combined with the selection by mode. Use it to cut a subject out by its contour (then layer_via_copy for a layer of just that subject); describe one object precisely to get only that one. One undoable step. Returns the selection and the objects found (label, bounds); none found leaves the selection unchanged.',
13994
+ description: 'Select \u203A Subject: selects the main subject of the flattened image, combined with the selection by mode. With a segmentation model set by the host, target (a description such as "the dog" or "the house") chooses which objects; describe one object precisely to get only that one. Without a model, the subject that stands out most from the background is found classically (superpixel saliency and GrabCut): target cannot choose it, and method "saliency" and a note say so. Then check it with capture_view and fix it with quick_select or select_object. One undoable step. Returns the selection, the objects found (label, bounds), method ("model" or "saliency") and any note; none found leaves the selection unchanged.',
13433
13995
  inputSchema: {
13434
13996
  type: "object",
13435
13997
  properties: {
13436
- target: { type: "string", minLength: 1, description: "What to select, in words." },
13998
+ target: { type: "string", description: "What to select, in words. Needed with a model; ignored without one." },
13437
13999
  maxSegments: {
13438
14000
  type: "integer",
13439
14001
  minimum: 1,
13440
14002
  maximum: 32,
13441
- description: "Select at most this many matching objects (default the model\u2019s; 1 for a single subject)."
14003
+ description: "With a model: select at most this many matching objects (default the model\u2019s; 1 for a single subject)."
13442
14004
  },
13443
14005
  mode: modeSchema,
13444
- feather: { type: "number", minimum: 0, description: "Feather radius in pixels (default 0)." }
14006
+ feather: { type: "number", minimum: 0, description: "Feather radius in pixels (default 0)." },
14007
+ enhanceEdge: { type: "boolean", description: "Without a model: smoother, less blocky edges (Auto-Enhance; default false)." }
13445
14008
  },
13446
- required: ["target"],
13447
14009
  additionalProperties: false
13448
14010
  },
13449
14011
  annotations: { ...writeAnnotations("Select a subject"), openWorldHint: true },
13450
- handler: async ({ target, maxSegments, mode, feather }, context) => {
13451
- if (typeof target !== "string" || !target.trim()) throw new Error("target must describe what to select.");
13452
- const perform = _optionalChain([context, 'optionalAccess', _464 => _464.perform]);
13453
- const { segments } = await controller.selectSubject(target, {
14012
+ handler: async ({ target, maxSegments, mode, feather, enhanceEdge }, context) => {
14013
+ if (target !== void 0 && typeof target !== "string") throw new Error("target must be a description in words.");
14014
+ if (controller.segmentationProvider && !String(_nullishCoalesce(target, () => ( ""))).trim()) throw new Error("target must describe what to select (a model is set, and it selects by description).");
14015
+ const perform = _optionalChain([context, 'optionalAccess', _468 => _468.perform]);
14016
+ const { segments, method, note } = await controller.selectSubject(String(_nullishCoalesce(target, () => ( ""))), {
13454
14017
  mode: _chunkUYXL6ZWQcjs.parseSelectionMode.call(void 0, mode),
13455
14018
  feather: num2(feather, 0),
13456
14019
  maxSegments: typeof maxSegments === "number" ? Math.max(1, Math.round(maxSegments)) : void 0,
13457
- signal: _optionalChain([context, 'optionalAccess', _465 => _465.signal]),
14020
+ enhanceEdge: enhanceEdge === true,
14021
+ signal: _optionalChain([context, 'optionalAccess', _469 => _469.signal]),
13458
14022
  // Under playback the cursor traces what the model found, as a lasso, before it is selected.
13459
14023
  beforeApply: perform ? (outlines) => perform(planOutlineTrace(outlines)) : void 0
13460
14024
  });
13461
- return { ...summary(controller), found: segments };
14025
+ return { ...summary(controller), found: segments, method, ...note ? { note } : {} };
13462
14026
  }
13463
14027
  };
13464
14028
  }
13465
14029
  function createImageSegmentationToolProvider(controller, options = {}) {
13466
- const tool = createImageSubjectSelectionTool(controller);
13467
14030
  return withImagePlayback(
13468
14031
  {
13469
14032
  id: _nullishCoalesce(options.id, () => ( "image-segmentation")),
13470
14033
  namespace: options.namespace,
13471
14034
  title: "Image segmentation",
13472
- description: "Select \u203A Subject: select objects in the image by description through an AI segmentation model.",
14035
+ description: "Deprecated: select_subject is in the image editor tool provider.",
13473
14036
  skill: "pixerate-image-editor",
13474
- tools: () => controller.segmentationProvider ? [tool] : []
14037
+ tools: () => []
13475
14038
  },
13476
14039
  options.playbackSurface
13477
14040
  );
@@ -13533,7 +14096,7 @@ async function renderImageRegion(controller, request) {
13533
14096
  const maskView = maskViewCanvas(controller, document);
13534
14097
  if (maskView) context.drawImage(maskView, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
13535
14098
  const selection = state.selection;
13536
- if (_optionalChain([selection, 'optionalAccess', _466 => _466.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
14099
+ if (_optionalChain([selection, 'optionalAccess', _470 => _470.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
13537
14100
  const shade = selectionShade(selection, document);
13538
14101
  if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
13539
14102
  }
@@ -13558,7 +14121,7 @@ function createImageCaptureSurface(controller) {
13558
14121
  return {
13559
14122
  units: "image pixels",
13560
14123
  content: whole,
13561
- selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _467 => _467.getState, 'call', _468 => _468(), 'access', _469 => _469.selection, 'optionalAccess', _470 => _470.bounds]), () => ( null)) }),
14124
+ selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _471 => _471.getState, 'call', _472 => _472(), 'access', _473 => _473.selection, 'optionalAccess', _474 => _474.bounds]), () => ( null)) }),
13562
14125
  overlays: "a shade over unselected pixels, the crop box outline and a layer mask view (set_mask_view)",
13563
14126
  maxScale: 8,
13564
14127
  render: (request) => renderImageRegion(controller, request)
@@ -13892,7 +14455,7 @@ function describeLayer(layer, activeId, boundsOf) {
13892
14455
  out.bounds = boundsOf(layer);
13893
14456
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
13894
14457
  out.shape = {
13895
- components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _471 => _471.live, 'optionalAccess', _472 => _472.kind]), () => ( "path")) })),
14458
+ components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _475 => _475.live, 'optionalAccess', _476 => _476.kind]), () => ( "path")) })),
13896
14459
  fill: layer.fill ? layer.fill.type : null,
13897
14460
  stroke: layer.stroke ? { width: layer.stroke.width, paint: layer.stroke.paint.type } : null
13898
14461
  };
@@ -13915,8 +14478,8 @@ function describeLayer(layer, activeId, boundsOf) {
13915
14478
  out.bounds = boundsOf(layer);
13916
14479
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
13917
14480
  out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
13918
- out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _473 => _473.smartFilters, 'optionalAccess', _474 => _474.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
13919
- out.filterMask = maskSummary(_optionalChain([layer, 'access', _475 => _475.smartFilters, 'optionalAccess', _476 => _476.mask]));
14481
+ out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _477 => _477.smartFilters, 'optionalAccess', _478 => _478.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
14482
+ out.filterMask = maskSummary(_optionalChain([layer, 'access', _479 => _479.smartFilters, 'optionalAccess', _480 => _480.mask]));
13920
14483
  break;
13921
14484
  }
13922
14485
  return out;
@@ -13944,7 +14507,7 @@ function createImageLayerTools(controller) {
13944
14507
  if (!loc) return null;
13945
14508
  return {
13946
14509
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
13947
- parentId: _nullishCoalesce(_optionalChain([loc, 'access', _477 => _477.parent, 'optionalAccess', _478 => _478.id]), () => ( null)),
14510
+ parentId: _nullishCoalesce(_optionalChain([loc, 'access', _481 => _481.parent, 'optionalAccess', _482 => _482.id]), () => ( null)),
13948
14511
  index: loc.index
13949
14512
  };
13950
14513
  };
@@ -14267,7 +14830,7 @@ function createImageLayerTools(controller) {
14267
14830
  if (view !== "gray" && view !== "overlay" && view !== "off") throw new Error(`Unknown view "${String(view)}". Use gray, overlay or off.`);
14268
14831
  const id = view === "off" || layerId === void 0 ? void 0 : exists(layerId);
14269
14832
  const shown = controller.setMaskView(view, id);
14270
- return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _479 => _479.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _480 => _480.layerId]), () => ( null)) };
14833
+ return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _483 => _483.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _484 => _484.layerId]), () => ( null)) };
14271
14834
  }
14272
14835
  };
14273
14836
  const maskProps = {
@@ -14760,31 +15323,31 @@ function snapTo45(from, point) {
14760
15323
  const a = Math.round(Math.atan2(dy, dx) / (Math.PI / 4)) * (Math.PI / 4);
14761
15324
  return { x: from.x + Math.cos(a) * len, y: from.y + Math.sin(a) * len };
14762
15325
  }
14763
- var SelectionGesture = (_class13 = class {
14764
- constructor(controller, getOptions) {;_class13.prototype.__init102.call(this);_class13.prototype.__init103.call(this);_class13.prototype.__init104.call(this);_class13.prototype.__init105.call(this);_class13.prototype.__init106.call(this);_class13.prototype.__init107.call(this);_class13.prototype.__init108.call(this);_class13.prototype.__init109.call(this);_class13.prototype.__init110.call(this);_class13.prototype.__init111.call(this);_class13.prototype.__init112.call(this);
15326
+ var SelectionGesture = (_class14 = class {
15327
+ constructor(controller, getOptions) {;_class14.prototype.__init106.call(this);_class14.prototype.__init107.call(this);_class14.prototype.__init108.call(this);_class14.prototype.__init109.call(this);_class14.prototype.__init110.call(this);_class14.prototype.__init111.call(this);_class14.prototype.__init112.call(this);_class14.prototype.__init113.call(this);_class14.prototype.__init114.call(this);_class14.prototype.__init115.call(this);_class14.prototype.__init116.call(this);
14765
15328
  this.controller = controller;
14766
15329
  this.getOptions = getOptions;
14767
15330
  }
14768
15331
 
14769
15332
 
14770
- __init102() {this.start = null}
14771
- __init103() {this.points = []}
14772
- __init104() {this.current = null}
14773
- __init105() {this.modifiers = {}}
15333
+ __init106() {this.start = null}
15334
+ __init107() {this.points = []}
15335
+ __init108() {this.current = null}
15336
+ __init109() {this.modifiers = {}}
14774
15337
  /** Polygonal lasso corners while one is being drawn. */
14775
- __init106() {this.polygon = null}
14776
- __init107() {this.pressedAt = null}
14777
- __init108() {this.freehand = false}
14778
- __init109() {this.magnetic = null}
15338
+ __init110() {this.polygon = null}
15339
+ __init111() {this.pressedAt = null}
15340
+ __init112() {this.freehand = false}
15341
+ __init113() {this.magnetic = null}
14779
15342
  /** A click this close to the first corner (natural pixels) closes a polygonal lasso. */
14780
- __init110() {this.closeRadius = 8}
15343
+ __init114() {this.closeRadius = 8}
14781
15344
  /** The last error (e.g. pixels unavailable for the wand), for the UI to show. */
14782
- __init111() {this.error = null}
14783
- __init112() {this.pending = Promise.resolve()}
15345
+ __init115() {this.error = null}
15346
+ __init116() {this.pending = Promise.resolve()}
14784
15347
  get active() {
14785
15348
  return this.start !== null || this.polygon !== null || this.magnetic !== null;
14786
15349
  }
14787
- /** Resolves once a Quick Selection stroke has been applied. */
15350
+ /** Resolves once a Quick Selection stroke or an Object Selection has been applied. */
14788
15351
  get settled() {
14789
15352
  return this.pending;
14790
15353
  }
@@ -14954,6 +15517,20 @@ var SelectionGesture = (_class13 = class {
14954
15517
  if (point) this.move(point);
14955
15518
  const options = this.getOptions();
14956
15519
  const mode = selectionModeFromModifiers(_nullishCoalesce(modifiers, () => ( this.modifiers)), options.mode);
15520
+ if (options.tool === "object") {
15521
+ const rect2 = normalizeRect({ x: this.start.x, y: this.start.y, width: this.current.x - this.start.x, height: this.current.y - this.start.y });
15522
+ this.start = null;
15523
+ this.current = null;
15524
+ this.points = [];
15525
+ const target = rect2.width >= 4 && rect2.height >= 4 ? { rect: rect2 } : { point: { x: rect2.x + rect2.width / 2, y: rect2.y + rect2.height / 2 } };
15526
+ this.pending = this.controller.selectObject(target, { mode, sampleAllLayers: _nullishCoalesce(options.objectSampleAll, () => ( true)), enhanceEdge: _nullishCoalesce(options.objectEnhance, () => ( false)) }).then(
15527
+ () => void 0,
15528
+ (err) => {
15529
+ this.error = err instanceof Error ? err.message : String(err);
15530
+ }
15531
+ );
15532
+ return false;
15533
+ }
14957
15534
  if (options.tool === "quick") {
14958
15535
  const stroke = this.points;
14959
15536
  this.start = null;
@@ -15107,7 +15684,7 @@ var SelectionGesture = (_class13 = class {
15107
15684
  this.pressedAt = null;
15108
15685
  this.freehand = false;
15109
15686
  }
15110
- }, _class13);
15687
+ }, _class14);
15111
15688
  function handleSelectionShortcut(controller, e, onError) {
15112
15689
  if (!(e.ctrlKey || e.metaKey)) return false;
15113
15690
  const key = e.key.toLowerCase();
@@ -15115,7 +15692,7 @@ function handleSelectionShortcut(controller, e, onError) {
15115
15692
  try {
15116
15693
  fn();
15117
15694
  } catch (err) {
15118
- _optionalChain([onError, 'optionalCall', _481 => _481(err instanceof Error ? err.message : String(err))]);
15695
+ _optionalChain([onError, 'optionalCall', _485 => _485(err instanceof Error ? err.message : String(err))]);
15119
15696
  }
15120
15697
  return true;
15121
15698
  };
@@ -15130,9 +15707,9 @@ function handleMaskViewKey(controller, e) {
15130
15707
  if (e.ctrlKey || e.metaKey || e.altKey || e.key !== "\\") return false;
15131
15708
  const id = controller.getState().activeLayerId;
15132
15709
  const layer = id ? controller.getLayer(id) : null;
15133
- if (!_optionalChain([layer, 'optionalAccess', _482 => _482.mask]) || layer.mask.source) return false;
15710
+ if (!_optionalChain([layer, 'optionalAccess', _486 => _486.mask]) || layer.mask.source) return false;
15134
15711
  const view = controller.getMaskView();
15135
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _483 => _483.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15712
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _487 => _487.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15136
15713
  return true;
15137
15714
  }
15138
15715
  function handleQuickMaskKey(controller, e) {
@@ -15326,15 +15903,15 @@ function handlePaintShortcut(controller, e) {
15326
15903
  }
15327
15904
  return false;
15328
15905
  }
15329
- var PaintGesture = (_class14 = class {
15330
- constructor(controller) {;_class14.prototype.__init113.call(this);_class14.prototype.__init114.call(this);_class14.prototype.__init115.call(this);
15906
+ var PaintGesture = (_class15 = class {
15907
+ constructor(controller) {;_class15.prototype.__init117.call(this);_class15.prototype.__init118.call(this);_class15.prototype.__init119.call(this);
15331
15908
  this.controller = controller;
15332
15909
  }
15333
15910
 
15334
- __init113() {this.stroke = null}
15335
- __init114() {this.move = null}
15911
+ __init117() {this.stroke = null}
15912
+ __init118() {this.move = null}
15336
15913
  /** The last refusal (e.g. "layer is locked"), for the editor to show. */
15337
- __init115() {this.error = null}
15914
+ __init119() {this.error = null}
15338
15915
  get active() {
15339
15916
  return Boolean(this.stroke || this.move);
15340
15917
  }
@@ -15346,7 +15923,7 @@ var PaintGesture = (_class14 = class {
15346
15923
  const layer = this.controller.getActiveLayer();
15347
15924
  if (!layer) throw new Error("Select a layer to move in the Layers panel.");
15348
15925
  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.`);
15349
- if (_optionalChain([layer, 'access', _484 => _484.locks, 'optionalAccess', _485 => _485.all]) || _optionalChain([layer, 'access', _486 => _486.locks, 'optionalAccess', _487 => _487.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
15926
+ if (_optionalChain([layer, 'access', _488 => _488.locks, 'optionalAccess', _489 => _489.all]) || _optionalChain([layer, 'access', _490 => _490.locks, 'optionalAccess', _491 => _491.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
15350
15927
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
15351
15928
  const b = _chunkUYXL6ZWQcjs.shapeGeometryBounds.call(void 0, layer);
15352
15929
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
@@ -15403,11 +15980,11 @@ var PaintGesture = (_class14 = class {
15403
15980
  this.move = null;
15404
15981
  }
15405
15982
  cancel() {
15406
- _optionalChain([this, 'access', _488 => _488.stroke, 'optionalAccess', _489 => _489.cancel, 'call', _490 => _490()]);
15983
+ _optionalChain([this, 'access', _492 => _492.stroke, 'optionalAccess', _493 => _493.cancel, 'call', _494 => _494()]);
15407
15984
  this.stroke = null;
15408
15985
  this.move = null;
15409
15986
  }
15410
- }, _class14);
15987
+ }, _class15);
15411
15988
 
15412
15989
  // src/image-editor/paint-tools.ts
15413
15990
  var READ4 = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
@@ -16484,7 +17061,7 @@ function createImageSmartObjectTools(controller) {
16484
17061
  const layerSummary = (id) => {
16485
17062
  const s = controller.getState();
16486
17063
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, id);
16487
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _491 => _491.parent, 'optionalAccess', _492 => _492.id]), () => ( null)), index: loc.index } : null;
17064
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _495 => _495.parent, 'optionalAccess', _496 => _496.id]), () => ( null)), index: loc.index } : null;
16488
17065
  };
16489
17066
  const getSmart = {
16490
17067
  name: "get_smart_object",
@@ -17041,7 +17618,7 @@ function createImageShapeTools(controller) {
17041
17618
  const layerSummary = (id) => {
17042
17619
  const s = controller.getState();
17043
17620
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, id);
17044
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _493 => _493.parent, 'optionalAccess', _494 => _494.id]), () => ( null)), index: loc.index } : null;
17621
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _497 => _497.parent, 'optionalAccess', _498 => _498.id]), () => ( null)), index: loc.index } : null;
17045
17622
  };
17046
17623
  const get = {
17047
17624
  name: "get_shape_layer",
@@ -17258,7 +17835,7 @@ function createImageShapeTools(controller) {
17258
17835
  const mode = args.mode;
17259
17836
  controller.pathToSelection(pathSpec(args), { feather: args.feather, antiAlias: args.antiAlias, mode });
17260
17837
  const sel = controller.getSelection();
17261
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _495 => _495.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
17838
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _499 => _499.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
17262
17839
  }
17263
17840
  };
17264
17841
  const getVectorMask = {
@@ -17289,7 +17866,7 @@ function createImageShapeTools(controller) {
17289
17866
  handler: (args) => {
17290
17867
  const id = layerArg(args.layerId);
17291
17868
  const spec = pathSpec(args);
17292
- const hasPath = _optionalChain([spec, 'access', _496 => _496.components, 'optionalAccess', _497 => _497.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
17869
+ const hasPath = _optionalChain([spec, 'access', _500 => _500.components, 'optionalAccess', _501 => _501.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
17293
17870
  const from = _nullishCoalesce(args.from, () => ( (hasPath ? "path" : "reveal-all")));
17294
17871
  if (from !== "selection" && TRACE_KEYS.some((k) => args[k] !== void 0)) throw new Error("tolerance, cornerRoundness and minArea apply only to from selection.");
17295
17872
  controller.addVectorMask(id, from, spec, traceOptions(args));
@@ -17409,7 +17986,7 @@ function createImageTypeTools(controller) {
17409
17986
  const layerSummary = (id) => {
17410
17987
  const s = controller.getState();
17411
17988
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, id);
17412
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _498 => _498.parent, 'optionalAccess', _499 => _499.id]), () => ( null)), index: loc.index } : null;
17989
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _502 => _502.parent, 'optionalAccess', _503 => _503.id]), () => ( null)), index: loc.index } : null;
17413
17990
  };
17414
17991
  const range = (args) => ({ start: args.start, end: args.end });
17415
17992
  const listFonts = {
@@ -17418,7 +17995,7 @@ function createImageTypeTools(controller) {
17418
17995
  description: "Returns the font families type layers can use here (generic families such as sans-serif always work). Changes nothing.",
17419
17996
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
17420
17997
  annotations: { title: "List fonts", ...READ11 },
17421
- handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _500 => _500.getTextShaper, 'call', _501 => _501(), 'optionalAccess', _502 => _502.id]), () => ( null)) })
17998
+ handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _504 => _504.getTextShaper, 'call', _505 => _505(), 'optionalAccess', _506 => _506.id]), () => ( null)) })
17422
17999
  };
17423
18000
  const get = {
17424
18001
  name: "get_text_layer",
@@ -17574,7 +18151,7 @@ function createImageTypeTools(controller) {
17574
18151
  const init = pick2(args, ["text", "x", "y", "orientation", "box", "style", "paragraph", "rotation", "mode", "feather", "antiAlias"]);
17575
18152
  controller.selectTextShape(init);
17576
18153
  const sel = controller.getSelection();
17577
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _503 => _503.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
18154
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _507 => _507.bounds]), () => ( null)), area: Math.round(sel ? _chunkUYXL6ZWQcjs.selectionArea.call(void 0, sel) : 0) };
17578
18155
  }
17579
18156
  };
17580
18157
  return [listFonts, get, add2, setText, setStyle, setParagraph, setFrame, setOrientation, toShape, typeMask];
@@ -17753,7 +18330,7 @@ function createImageEditorToolProvider(controller, options = {}) {
17753
18330
  for (const ref of [aboveId, parentId]) {
17754
18331
  if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
17755
18332
  }
17756
- if (parentId !== void 0 && _optionalChain([controller, 'access', _504 => _504.getLayer, 'call', _505 => _505(parentId), 'optionalAccess', _506 => _506.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
18333
+ if (parentId !== void 0 && _optionalChain([controller, 'access', _508 => _508.getLayer, 'call', _509 => _509(parentId), 'optionalAccess', _510 => _510.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
17757
18334
  const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId, useSelection: useSelection !== false });
17758
18335
  const layer = controller.getAdjustmentLayer(id);
17759
18336
  return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id), masked: Boolean(layer.mask) };
@@ -18067,7 +18644,7 @@ function maskThumbnailClick(controller, layer, e) {
18067
18644
  } else if (e.altKey && !layer.mask.source) {
18068
18645
  const mode = e.shiftKey ? "overlay" : "gray";
18069
18646
  const view = controller.getMaskView();
18070
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _507 => _507.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
18647
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _511 => _511.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
18071
18648
  } else if (e.shiftKey) {
18072
18649
  controller.setLayerMaskProps(layer.id, { enabled: layer.mask.enabled === false });
18073
18650
  } else {
@@ -18131,7 +18708,7 @@ function layerHasThumbnail(layer) {
18131
18708
  return layer.type === "pixel" || layer.type === "shape" || layer.type === "type";
18132
18709
  }
18133
18710
  function layerWarning(layer) {
18134
- if (layer.type === "type" && _optionalChain([layer, 'access', _508 => _508.missingFonts, 'optionalAccess', _509 => _509.length])) {
18711
+ if (layer.type === "type" && _optionalChain([layer, 'access', _512 => _512.missingFonts, 'optionalAccess', _513 => _513.length])) {
18135
18712
  return `Missing ${layer.missingFonts.length === 1 ? "font" : "fonts"}: ${layer.missingFonts.join(", ")}. ${layer.rendering === "stored" ? "Showing the saved pixels until the text is edited." : "Drawn with a fallback font."}`;
18136
18713
  }
18137
18714
  return null;
@@ -18154,16 +18731,16 @@ function layerMenu(controller) {
18154
18731
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
18155
18732
  const below = loc ? siblings[loc.index - 1] : void 0;
18156
18733
  const hasSel = controller.hasSelection;
18157
- const isPixel = _optionalChain([active, 'optionalAccess', _510 => _510.type]) === "pixel";
18158
- const hasOwnPixels = _optionalChain([active, 'optionalAccess', _511 => _511.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _512 => _512.type]) === "shape" || _optionalChain([active, 'optionalAccess', _513 => _513.type]) === "type" || _optionalChain([active, 'optionalAccess', _514 => _514.type]) === "smart";
18734
+ const isPixel = _optionalChain([active, 'optionalAccess', _514 => _514.type]) === "pixel";
18735
+ const hasOwnPixels = _optionalChain([active, 'optionalAccess', _515 => _515.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _516 => _516.type]) === "shape" || _optionalChain([active, 'optionalAccess', _517 => _517.type]) === "type" || _optionalChain([active, 'optionalAccess', _518 => _518.type]) === "smart";
18159
18736
  return [
18160
18737
  { action: "new-layer", label: "New Layer", enabled: true },
18161
18738
  { action: "new-group", label: "New Group", enabled: true },
18162
18739
  { action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
18163
18740
  { action: "delete", label: "Delete Layer", enabled: Boolean(active) },
18164
18741
  { action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
18165
- { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _515 => _515.type]) === "group" },
18166
- { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _516 => _516.visible]) && _optionalChain([below, 'optionalAccess', _517 => _517.type]) === "pixel") },
18742
+ { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _519 => _519.type]) === "group" },
18743
+ { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _520 => _520.visible]) && _optionalChain([below, 'optionalAccess', _521 => _521.type]) === "pixel") },
18167
18744
  { action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
18168
18745
  { action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
18169
18746
  { action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
@@ -18173,27 +18750,27 @@ function layerMenu(controller) {
18173
18750
  { action: "add-mask-hide-selection", label: "Add Mask Hiding Selection", enabled: Boolean(active) && hasSel },
18174
18751
  { action: "add-mask-transparency", label: "Add Mask from Transparency", enabled: hasOwnPixels },
18175
18752
  { action: "select-transparency", label: "Select Layer Pixels", enabled: hasOwnPixels },
18176
- { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _518 => _518.mask])) },
18177
- { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _519 => _519.mask])) },
18178
- { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _520 => _520.mask, 'optionalAccess', _521 => _521.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _522 => _522.mask])) },
18179
- { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _523 => _523.mask, 'optionalAccess', _524 => _524.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _525 => _525.mask]) && !active.mask.source) },
18180
- { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _526 => _526.mask, 'optionalAccess', _527 => _527.source])) },
18181
- { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _528 => _528.mask, 'optionalAccess', _529 => _529.source])) },
18182
- { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _530 => _530.mask, 'optionalAccess', _531 => _531.source])) && hasSel },
18183
- { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _532 => _532.vectorMask])) },
18184
- { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _533 => _533.vectorMask, 'optionalAccess', _534 => _534.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _535 => _535.vectorMask])) },
18185
- { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _536 => _536.vectorMask])) },
18186
- { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _537 => _537.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _538 => _538.type]) === "smart" || _optionalChain([active, 'optionalAccess', _539 => _539.type]) === "shape" || _optionalChain([active, 'optionalAccess', _540 => _540.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _541 => _541.type]) === "pixel" && _optionalChain([active, 'access', _542 => _542.filters, 'optionalAccess', _543 => _543.length])) },
18753
+ { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _522 => _522.mask])) },
18754
+ { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _523 => _523.mask])) },
18755
+ { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _524 => _524.mask, 'optionalAccess', _525 => _525.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _526 => _526.mask])) },
18756
+ { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _527 => _527.mask, 'optionalAccess', _528 => _528.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _529 => _529.mask]) && !active.mask.source) },
18757
+ { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _530 => _530.mask, 'optionalAccess', _531 => _531.source])) },
18758
+ { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _532 => _532.mask, 'optionalAccess', _533 => _533.source])) },
18759
+ { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _534 => _534.mask, 'optionalAccess', _535 => _535.source])) && hasSel },
18760
+ { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _536 => _536.vectorMask])) },
18761
+ { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _537 => _537.vectorMask, 'optionalAccess', _538 => _538.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _539 => _539.vectorMask])) },
18762
+ { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _540 => _540.vectorMask])) },
18763
+ { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _541 => _541.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _542 => _542.type]) === "smart" || _optionalChain([active, 'optionalAccess', _543 => _543.type]) === "shape" || _optionalChain([active, 'optionalAccess', _544 => _544.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _545 => _545.type]) === "pixel" && _optionalChain([active, 'access', _546 => _546.filters, 'optionalAccess', _547 => _547.length])) },
18187
18764
  { action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
18188
- { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _544 => _544.type]) === "smart" },
18189
- { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _545 => _545.type]) === "smart" },
18190
- { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _546 => _546.type]) === "smart" && !_optionalChain([active, 'access', _547 => _547.smartFilters, 'optionalAccess', _548 => _548.mask]) },
18191
- { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _549 => _549.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
18765
+ { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _548 => _548.type]) === "smart" },
18766
+ { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _549 => _549.type]) === "smart" },
18767
+ { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _550 => _550.type]) === "smart" && !_optionalChain([active, 'access', _551 => _551.smartFilters, 'optionalAccess', _552 => _552.mask]) },
18768
+ { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _553 => _553.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
18192
18769
  ];
18193
18770
  }
18194
18771
  async function runLayerMenuAction(controller, action) {
18195
18772
  const active = controller.getActiveLayer();
18196
- const id = _optionalChain([active, 'optionalAccess', _550 => _550.id]);
18773
+ const id = _optionalChain([active, 'optionalAccess', _554 => _554.id]);
18197
18774
  try {
18198
18775
  switch (action) {
18199
18776
  case "new-layer":
@@ -18249,10 +18826,10 @@ async function runLayerMenuAction(controller, action) {
18249
18826
  if (id) controller.removeLayerMask(id);
18250
18827
  break;
18251
18828
  case "toggle-mask":
18252
- if (id && _optionalChain([active, 'optionalAccess', _551 => _551.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
18829
+ if (id && _optionalChain([active, 'optionalAccess', _555 => _555.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
18253
18830
  break;
18254
18831
  case "toggle-mask-link":
18255
- if (id && _optionalChain([active, 'optionalAccess', _552 => _552.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
18832
+ if (id && _optionalChain([active, 'optionalAccess', _556 => _556.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
18256
18833
  break;
18257
18834
  case "add-vector-mask":
18258
18835
  case "add-vector-mask-hide":
@@ -18265,7 +18842,7 @@ async function runLayerMenuAction(controller, action) {
18265
18842
  if (id) controller.removeVectorMask(id);
18266
18843
  break;
18267
18844
  case "toggle-vector-mask":
18268
- if (id && _optionalChain([active, 'optionalAccess', _553 => _553.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
18845
+ if (id && _optionalChain([active, 'optionalAccess', _557 => _557.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
18269
18846
  break;
18270
18847
  case "rasterize-vector-mask":
18271
18848
  if (id) controller.rasterizeVectorMask(id);
@@ -18286,7 +18863,7 @@ async function runLayerMenuAction(controller, action) {
18286
18863
  if (id) controller.setSmartFilterMask(id, "reveal-all");
18287
18864
  break;
18288
18865
  case "toggle-clip":
18289
- if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _554 => _554.clipped]) });
18866
+ if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _558 => _558.clipped]) });
18290
18867
  break;
18291
18868
  }
18292
18869
  return null;
@@ -18296,7 +18873,7 @@ async function runLayerMenuAction(controller, action) {
18296
18873
  }
18297
18874
  function smartFilterRows(layer) {
18298
18875
  if (layer.type !== "smart") return [];
18299
- const list = _nullishCoalesce(_optionalChain([layer, 'access', _555 => _555.smartFilters, 'optionalAccess', _556 => _556.filters]), () => ( []));
18876
+ const list = _nullishCoalesce(_optionalChain([layer, 'access', _559 => _559.smartFilters, 'optionalAccess', _560 => _560.filters]), () => ( []));
18300
18877
  const rows = list.map((f, index) => ({
18301
18878
  filter: f,
18302
18879
  index,
@@ -18322,8 +18899,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
18322
18899
  };
18323
18900
  collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
18324
18901
  const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
18325
- const imgW = _optionalChain([state, 'access', _557 => _557.imageDimensions, 'optionalAccess', _558 => _558.width]) || 1;
18326
- const imgH = _optionalChain([state, 'access', _559 => _559.imageDimensions, 'optionalAccess', _560 => _560.height]) || 1;
18902
+ const imgW = _optionalChain([state, 'access', _561 => _561.imageDimensions, 'optionalAccess', _562 => _562.width]) || 1;
18903
+ const imgH = _optionalChain([state, 'access', _563 => _563.imageDimensions, 'optionalAccess', _564 => _564.height]) || 1;
18327
18904
  return ctrlLayers.map((l) => {
18328
18905
  const bounds = controller.getLayerBounds(l.id) || {
18329
18906
  x: 0,
@@ -18332,8 +18909,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
18332
18909
  height: imgH
18333
18910
  };
18334
18911
  const sLayer = sLayerMap.get(l.id);
18335
- const assetKey = _optionalChain([sLayer, 'optionalAccess', _561 => _561.asset]);
18336
- const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _562 => _562.source]) === "document" ? fallbackImageUrl : "");
18912
+ const assetKey = _optionalChain([sLayer, 'optionalAccess', _565 => _565.asset]);
18913
+ const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _566 => _566.source]) === "document" ? fallbackImageUrl : "");
18337
18914
  return {
18338
18915
  id: l.id,
18339
18916
  name: l.name || "Untitled Layer",
@@ -18387,9 +18964,9 @@ async function addLayerOfKind(controller, id, init) {
18387
18964
  const cx = Math.round(canvas.width / 2);
18388
18965
  const cy = Math.round(canvas.height / 2);
18389
18966
  return controller.addTextLayer({
18390
- text: _optionalChain([init, 'optionalAccess', _563 => _563.text]) || "New Text",
18391
- x: typeof _optionalChain([init, 'optionalAccess', _564 => _564.x]) === "number" ? init.x : cx - 100,
18392
- y: typeof _optionalChain([init, 'optionalAccess', _565 => _565.y]) === "number" ? init.y : cy,
18967
+ text: _optionalChain([init, 'optionalAccess', _567 => _567.text]) || "New Text",
18968
+ x: typeof _optionalChain([init, 'optionalAccess', _568 => _568.x]) === "number" ? init.x : cx - 100,
18969
+ y: typeof _optionalChain([init, 'optionalAccess', _569 => _569.y]) === "number" ? init.y : cy,
18393
18970
  ...init
18394
18971
  });
18395
18972
  }
@@ -18402,10 +18979,10 @@ async function addLayerOfKind(controller, id, init) {
18402
18979
  return controller.addShapeLayer({
18403
18980
  shape: {
18404
18981
  kind: "rect",
18405
- x: typeof _optionalChain([init, 'optionalAccess', _566 => _566.x]) === "number" ? init.x : cx - Math.round(w / 2),
18406
- y: typeof _optionalChain([init, 'optionalAccess', _567 => _567.y]) === "number" ? init.y : cy - Math.round(h / 2),
18407
- width: typeof _optionalChain([init, 'optionalAccess', _568 => _568.width]) === "number" ? init.width : w,
18408
- height: typeof _optionalChain([init, 'optionalAccess', _569 => _569.height]) === "number" ? init.height : h
18982
+ x: typeof _optionalChain([init, 'optionalAccess', _570 => _570.x]) === "number" ? init.x : cx - Math.round(w / 2),
18983
+ y: typeof _optionalChain([init, 'optionalAccess', _571 => _571.y]) === "number" ? init.y : cy - Math.round(h / 2),
18984
+ width: typeof _optionalChain([init, 'optionalAccess', _572 => _572.width]) === "number" ? init.width : w,
18985
+ height: typeof _optionalChain([init, 'optionalAccess', _573 => _573.height]) === "number" ? init.height : h
18409
18986
  },
18410
18987
  name: "Rectangle",
18411
18988
  ...init
@@ -18420,10 +18997,10 @@ async function addLayerOfKind(controller, id, init) {
18420
18997
  return controller.addShapeLayer({
18421
18998
  shape: {
18422
18999
  kind: "ellipse",
18423
- x: typeof _optionalChain([init, 'optionalAccess', _570 => _570.x]) === "number" ? init.x : cx - Math.round(w / 2),
18424
- y: typeof _optionalChain([init, 'optionalAccess', _571 => _571.y]) === "number" ? init.y : cy - Math.round(h / 2),
18425
- width: typeof _optionalChain([init, 'optionalAccess', _572 => _572.width]) === "number" ? init.width : w,
18426
- height: typeof _optionalChain([init, 'optionalAccess', _573 => _573.height]) === "number" ? init.height : h
19000
+ x: typeof _optionalChain([init, 'optionalAccess', _574 => _574.x]) === "number" ? init.x : cx - Math.round(w / 2),
19001
+ y: typeof _optionalChain([init, 'optionalAccess', _575 => _575.y]) === "number" ? init.y : cy - Math.round(h / 2),
19002
+ width: typeof _optionalChain([init, 'optionalAccess', _576 => _576.width]) === "number" ? init.width : w,
19003
+ height: typeof _optionalChain([init, 'optionalAccess', _577 => _577.height]) === "number" ? init.height : h
18427
19004
  },
18428
19005
  name: "Ellipse",
18429
19006
  ...init
@@ -18484,18 +19061,18 @@ function layerEffectsPanel(layer) {
18484
19061
  if (!layer) return { ...empty, available: false, reason: "Select a layer to add a layer style." };
18485
19062
  if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have a layer style." };
18486
19063
  const fx = layer.effects;
18487
- const readOnly = Boolean(_optionalChain([layer, 'access', _574 => _574.locks, 'optionalAccess', _575 => _575.all]));
19064
+ const readOnly = Boolean(_optionalChain([layer, 'access', _578 => _578.locks, 'optionalAccess', _579 => _579.all]));
18488
19065
  return {
18489
19066
  available: true,
18490
19067
  readOnly,
18491
19068
  reason: readOnly ? "The layer is locked; unlock it to change its layer style." : void 0,
18492
- enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _576 => _576.enabled]), () => ( true)),
18493
- scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _577 => _577.scale]), () => ( 1)),
18494
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _578 => _578.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkHGTDMKNEcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19069
+ enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _580 => _580.enabled]), () => ( true)),
19070
+ scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _581 => _581.scale]), () => ( 1)),
19071
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _582 => _582.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkHGTDMKNEcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
18495
19072
  };
18496
19073
  }
18497
19074
  function layerEffectsBadge(layer) {
18498
- if (!_optionalChain([layer, 'access', _579 => _579.effects, 'optionalAccess', _580 => _580.items, 'access', _581 => _581.length])) return null;
19075
+ if (!_optionalChain([layer, 'access', _583 => _583.effects, 'optionalAccess', _584 => _584.items, 'access', _585 => _585.length])) return null;
18499
19076
  return _chunkHGTDMKNEcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
18500
19077
  }
18501
19078
  var LAYER_EFFECT_MENU = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkHGTDMKNEcjs.layerEffectLabel.call(void 0, kind) }));
@@ -18540,8 +19117,8 @@ function fillControls(f, allowPattern, patterns) {
18540
19117
  }
18541
19118
  function gradientControls(prefix, g) {
18542
19119
  return [
18543
- { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _582 => _582.stops, 'access', _583 => _583[0], 'optionalAccess', _584 => _584.color]), () => ( "#000000")) },
18544
- { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _585 => _585.stops, 'access', _586 => _586[g.stops.length - 1], 'optionalAccess', _587 => _587.color]), () => ( "#ffffff")) },
19120
+ { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _586 => _586.stops, 'access', _587 => _587[0], 'optionalAccess', _588 => _588.color]), () => ( "#000000")) },
19121
+ { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _589 => _589.stops, 'access', _590 => _590[g.stops.length - 1], 'optionalAccess', _591 => _591.color]), () => ( "#ffffff")) },
18545
19122
  { key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
18546
19123
  { key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
18547
19124
  { key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
@@ -18633,19 +19210,19 @@ function layerEffectControls(e, patterns = []) {
18633
19210
  }
18634
19211
  function fillOfType(current, type, patterns) {
18635
19212
  if (type === "gradient") return { type: "gradient", gradient: _chunkHGTDMKNEcjs.defaultEffectGradient.call(void 0, ) };
18636
- if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _588 => _588[0], 'optionalAccess', _589 => _589.id]), () => ( "checker")), scale: 1 };
19213
+ if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _592 => _592[0], 'optionalAccess', _593 => _593.id]), () => ( "checker")), scale: 1 };
18637
19214
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
18638
19215
  }
18639
19216
  function effectControlChange(effect, key, value, patterns = []) {
18640
19217
  const [top, ...rest] = key.split(".");
18641
19218
  if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
18642
19219
  if (top === "patternId" && !rest.length) {
18643
- const name = _optionalChain([patternOptions, 'call', _590 => _590(patterns), 'access', _591 => _591.find, 'call', _592 => _592((o) => o.value === value), 'optionalAccess', _593 => _593.label]);
19220
+ const name = _optionalChain([patternOptions, 'call', _594 => _594(patterns), 'access', _595 => _595.find, 'call', _596 => _596((o) => o.value === value), 'optionalAccess', _597 => _597.label]);
18644
19221
  return name ? { patternId: value, name } : { patternId: value };
18645
19222
  }
18646
19223
  if (!rest.length) return { [top]: value };
18647
19224
  if (top === "fill" && rest[0] === "patternId") {
18648
- const name = _optionalChain([patternOptions, 'call', _594 => _594(patterns), 'access', _595 => _595.find, 'call', _596 => _596((o) => o.value === value), 'optionalAccess', _597 => _597.label]);
19225
+ const name = _optionalChain([patternOptions, 'call', _598 => _598(patterns), 'access', _599 => _599.find, 'call', _600 => _600((o) => o.value === value), 'optionalAccess', _601 => _601.label]);
18649
19226
  return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
18650
19227
  }
18651
19228
  return { [top]: setPath(getPath(effect, top), rest, value) };
@@ -18672,7 +19249,7 @@ function colorPanelView(controller) {
18672
19249
  profileName: profile.name,
18673
19250
  workingSpace: profile.builtin,
18674
19251
  mode: profile.mode,
18675
- cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _598 => _598.cmykProfile, 'optionalAccess', _599 => _599.name]), () => ( null)),
19252
+ cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _602 => _602.cmykProfile, 'optionalAccess', _603 => _603.name]), () => ( null)),
18676
19253
  proof: proof ? { id: _nullishCoalesce(proof.profile.builtin, () => ( null)), name: proof.profile.name, intent: proof.intent, simulatePaper: proof.simulatePaper, gamutWarning: proof.gamutWarning, bpc: proof.bpc } : null
18677
19254
  };
18678
19255
  }
@@ -18854,33 +19431,33 @@ function boxFrameHit(overlay, p, tolerance, band) {
18854
19431
  }
18855
19432
  return null;
18856
19433
  }
18857
- var FreeTransformTool = (_class15 = class {
18858
- constructor(controller, options = {}) {;_class15.prototype.__init116.call(this);_class15.prototype.__init117.call(this);_class15.prototype.__init118.call(this);_class15.prototype.__init119.call(this);_class15.prototype.__init120.call(this);_class15.prototype.__init121.call(this);_class15.prototype.__init122.call(this);_class15.prototype.__init123.call(this);_class15.prototype.__init124.call(this);_class15.prototype.__init125.call(this);_class15.prototype.__init126.call(this);_class15.prototype.__init127.call(this);_class15.prototype.__init128.call(this);_class15.prototype.__init129.call(this);
19434
+ var FreeTransformTool = (_class16 = class {
19435
+ constructor(controller, options = {}) {;_class16.prototype.__init120.call(this);_class16.prototype.__init121.call(this);_class16.prototype.__init122.call(this);_class16.prototype.__init123.call(this);_class16.prototype.__init124.call(this);_class16.prototype.__init125.call(this);_class16.prototype.__init126.call(this);_class16.prototype.__init127.call(this);_class16.prototype.__init128.call(this);_class16.prototype.__init129.call(this);_class16.prototype.__init130.call(this);_class16.prototype.__init131.call(this);_class16.prototype.__init132.call(this);_class16.prototype.__init133.call(this);
18859
19436
  this.controller = controller;
18860
19437
  this.options = options;
18861
19438
  }
18862
19439
 
18863
19440
 
18864
- __init116() {this.sessionRef = null}
18865
- __init117() {this.modeValue = "scale"}
19441
+ __init120() {this.sessionRef = null}
19442
+ __init121() {this.modeValue = "scale"}
18866
19443
  /** The reference point in the untransformed frame's space (follows the transform). */
18867
- __init118() {this.refBox = { x: 0, y: 0 }}
18868
- __init119() {this.corners = null}
18869
- __init120() {this.drag = null}
19444
+ __init122() {this.refBox = { x: 0, y: 0 }}
19445
+ __init123() {this.corners = null}
19446
+ __init124() {this.drag = null}
18870
19447
  /** The warp mesh in the frame's own space (null: no warp). */
18871
- __init121() {this.mesh = null}
18872
- __init122() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
18873
- __init123() {this.pending = false}
18874
- __init124() {this.viewScale = 1}
19448
+ __init125() {this.mesh = null}
19449
+ __init126() {this.warpSettings = { style: "custom", bend: 50, horizontal: 0, vertical: 0, orientation: "horizontal", columns: 1, rows: 1 }}
19450
+ __init127() {this.pending = false}
19451
+ __init128() {this.viewScale = 1}
18875
19452
 
18876
19453
  /** Values typed into the options bar since the last drag (V skew is not recovered from the shape). */
18877
- __init125() {this.typed = {}}
19454
+ __init129() {this.typed = {}}
18878
19455
  /** Width and height scale together when typed (the chain icon). */
18879
- __init126() {this.proportional = true}
18880
- __init127() {this.error = null}
18881
- __init128() {this.lastResult = null}
19456
+ __init130() {this.proportional = true}
19457
+ __init131() {this.error = null}
19458
+ __init132() {this.lastResult = null}
18882
19459
  get active() {
18883
- return Boolean(_optionalChain([this, 'access', _600 => _600.sessionRef, 'optionalAccess', _601 => _601.isOpen]));
19460
+ return Boolean(_optionalChain([this, 'access', _604 => _604.sessionRef, 'optionalAccess', _605 => _605.isOpen]));
18884
19461
  }
18885
19462
  get session() {
18886
19463
  return this.active ? this.sessionRef : null;
@@ -18889,7 +19466,7 @@ var FreeTransformTool = (_class15 = class {
18889
19466
  return this.modeValue;
18890
19467
  }
18891
19468
  get interpolation() {
18892
- return _nullishCoalesce(_optionalChain([this, 'access', _602 => _602.sessionRef, 'optionalAccess', _603 => _603.interpolation]), () => ( "bicubic"));
19469
+ return _nullishCoalesce(_optionalChain([this, 'access', _606 => _606.sessionRef, 'optionalAccess', _607 => _607.interpolation]), () => ( "bicubic"));
18893
19470
  }
18894
19471
  /** Whether the open transform has changed anything yet (a commit would add an undo step). */
18895
19472
  get modified() {
@@ -18899,7 +19476,7 @@ var FreeTransformTool = (_class15 = class {
18899
19476
  const start = s.startGeometry.corners;
18900
19477
  return this.corners.some((p, i) => p.x !== start[i].x || p.y !== start[i].y);
18901
19478
  }
18902
- __init129() {this.listeners = /* @__PURE__ */ new Set()}
19479
+ __init133() {this.listeners = /* @__PURE__ */ new Set()}
18903
19480
  /** Calls `listener` whenever the overlay, readout, mode or error changes. Returns the unsubscribe. */
18904
19481
  subscribe(listener) {
18905
19482
  this.listeners.add(listener);
@@ -18908,7 +19485,7 @@ var FreeTransformTool = (_class15 = class {
18908
19485
  };
18909
19486
  }
18910
19487
  changed() {
18911
- _optionalChain([this, 'access', _604 => _604.options, 'access', _605 => _605.onChange, 'optionalCall', _606 => _606()]);
19488
+ _optionalChain([this, 'access', _608 => _608.options, 'access', _609 => _609.onChange, 'optionalCall', _610 => _610()]);
18912
19489
  for (const l of this.listeners) l();
18913
19490
  }
18914
19491
  /** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
@@ -19301,7 +19878,7 @@ var FreeTransformTool = (_class15 = class {
19301
19878
  }
19302
19879
  /** Abandons the transform and restores everything. */
19303
19880
  cancel() {
19304
- _optionalChain([this, 'access', _607 => _607.sessionRef, 'optionalAccess', _608 => _608.cancel, 'call', _609 => _609()]);
19881
+ _optionalChain([this, 'access', _611 => _611.sessionRef, 'optionalAccess', _612 => _612.cancel, 'call', _613 => _613()]);
19305
19882
  this.sessionRef = null;
19306
19883
  this.corners = null;
19307
19884
  this.mesh = null;
@@ -19342,7 +19919,7 @@ var FreeTransformTool = (_class15 = class {
19342
19919
  }
19343
19920
  return false;
19344
19921
  }
19345
- }, _class15);
19922
+ }, _class16);
19346
19923
 
19347
19924
  // src/image-editor/provider-effect-tools.ts
19348
19925
  var ANIMATE_SCHEMA = {
@@ -19357,7 +19934,7 @@ function imageLayerAppliedEffects(layer) {
19357
19934
  const ref = (r) => ({ effect: r.effect, ...r.name ? { name: r.name } : {}, ...r.provider ? { provider: r.provider } : {} });
19358
19935
  if (layer.type === "pixel" && layer.generator) out.push({ id: "generator", ...ref(layer.generator), role: "effect layer", enabled: true, values: layer.generator.values, ...layer.generator.time ? { time: layer.generator.time } : {}, ...layer.generator.animate ? { animate: layer.generator.animate } : {} });
19359
19936
  if (layer.type === "smart")
19360
- (_nullishCoalesce(_optionalChain([layer, 'access', _610 => _610.smartFilters, 'optionalAccess', _611 => _611.filters]), () => ( []))).forEach((f, index) => {
19937
+ (_nullishCoalesce(_optionalChain([layer, 'access', _614 => _614.smartFilters, 'optionalAccess', _615 => _615.filters]), () => ( []))).forEach((f, index) => {
19361
19938
  if (f.kind === "effect") out.push({ id: f.id, ...ref(f), role: "smart filter", enabled: f.enabled && layer.smartFilters.enabled, opacity: f.opacity, blend: f.blend, values: f.values, index });
19362
19939
  });
19363
19940
  return out;
@@ -19509,7 +20086,7 @@ var OTHER_TOOL_LABELS = {
19509
20086
  watermark: "Watermark"
19510
20087
  };
19511
20088
  function imageToolLabel(tool) {
19512
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _612 => _612.find, 'call', _613 => _613((t) => t.id === tool), 'optionalAccess', _614 => _614.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20089
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _616 => _616.find, 'call', _617 => _617((t) => t.id === tool), 'optionalAccess', _618 => _618.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
19513
20090
  }
19514
20091
  var IMAGE_TOOL_SHORTCUTS = {
19515
20092
  ...Object.fromEntries(PAINT_TOOLS.filter((t) => t.shortcut).map((t) => [t.id, t.shortcut])),
@@ -20627,4 +21204,17 @@ function createImageEditorDocument(controller, options = {}) {
20627
21204
 
20628
21205
 
20629
21206
 
20630
- exports.ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkUYXL6ZWQcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkUYXL6ZWQcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkUYXL6ZWQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkUYXL6ZWQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkV7GWZIZKcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkUYXL6ZWQcjs.D50; exports.D65 = _chunkUYXL6ZWQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkBRKVNXDZcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkUYXL6ZWQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkV7GWZIZKcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkUYXL6ZWQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkV7GWZIZKcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkUYXL6ZWQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkV7GWZIZKcjs.EX; exports.EY = _chunkV7GWZIZKcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkV7GWZIZKcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkV7GWZIZKcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkV7GWZIZKcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkV7GWZIZKcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkV7GWZIZKcjs.FLAG_TOP; exports.FLAG_WET = _chunkV7GWZIZKcjs.FLAG_WET; exports.FLAT = _chunkV7GWZIZKcjs.FLAT; exports.FREE_INTERVAL = _chunkV7GWZIZKcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkUYXL6ZWQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.GridGraph = GridGraph; exports.HIDE = _chunkV7GWZIZKcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkUYXL6ZWQcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkUYXL6ZWQcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkUYXL6ZWQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkUYXL6ZWQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkUYXL6ZWQcjs.LUMA_709; exports.LayerCompositor = _chunkUYXL6ZWQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkUYXL6ZWQcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkV7GWZIZKcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkUYXL6ZWQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkV7GWZIZKcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkV7GWZIZKcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkV7GWZIZKcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkUYXL6ZWQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkUYXL6ZWQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkV7GWZIZKcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkV7GWZIZKcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkUYXL6ZWQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkV7GWZIZKcjs.PARAM; exports.PARAM_FLOATS = _chunkV7GWZIZKcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkUYXL6ZWQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkV7GWZIZKcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkV7GWZIZKcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkV7GWZIZKcjs.PLANE; exports.PLANE_BYTES = _chunkV7GWZIZKcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkUYXL6ZWQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkV7GWZIZKcjs.P_D0; exports.P_EDGE = _chunkV7GWZIZKcjs.P_EDGE; exports.P_FX = _chunkV7GWZIZKcjs.P_FX; exports.P_FY = _chunkV7GWZIZKcjs.P_FY; exports.P_H = _chunkV7GWZIZKcjs.P_H; exports.P_P0 = _chunkV7GWZIZKcjs.P_P0; exports.P_RHO = _chunkV7GWZIZKcjs.P_RHO; exports.P_SW = _chunkV7GWZIZKcjs.P_SW; exports.P_UX = _chunkV7GWZIZKcjs.P_UX; exports.P_UY = _chunkV7GWZIZKcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkUYXL6ZWQcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkUYXL6ZWQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkUYXL6ZWQcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkV7GWZIZKcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkUYXL6ZWQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkV7GWZIZKcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkV7GWZIZKcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkV7GWZIZKcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkV7GWZIZKcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkV7GWZIZKcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkUYXL6ZWQcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkUYXL6ZWQcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkUYXL6ZWQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkUYXL6ZWQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkUYXL6ZWQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkUYXL6ZWQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkUYXL6ZWQcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkV7GWZIZKcjs.U_MAX; exports.VIBRANCE_GREY = _chunkUYXL6ZWQcjs.VIBRANCE_GREY; exports.W9 = _chunkV7GWZIZKcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkBRKVNXDZcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkBRKVNXDZcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkV7GWZIZKcjs.WET_TILE; exports.WGSL_HALO = _chunkV7GWZIZKcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkV7GWZIZKcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkV7GWZIZKcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_SIZE = WORK_SIZE; exports.WetGpuEngine = _chunkV7GWZIZKcjs.WetGpuEngine; exports.WetMedium = _chunkV7GWZIZKcjs.WetMedium; exports.WetWorkerPool = _chunkV7GWZIZKcjs.WetWorkerPool; exports.WetWorld = _chunkV7GWZIZKcjs.WetWorld; exports.WetWorldError = _chunkV7GWZIZKcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkUYXL6ZWQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkUYXL6ZWQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkUYXL6ZWQcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkUYXL6ZWQcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkUYXL6ZWQcjs.activeSmartFilters; exports.addLayerEffect = _chunkUYXL6ZWQcjs.addLayerEffect; exports.addLayerFilter = _chunkUYXL6ZWQcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkUYXL6ZWQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkUYXL6ZWQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkUYXL6ZWQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkUYXL6ZWQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkUYXL6ZWQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkUYXL6ZWQcjs.anchorPoint; exports.annotationBlend = _chunkUYXL6ZWQcjs.annotationBlend; exports.annotationLayerFor = _chunkUYXL6ZWQcjs.annotationLayerFor; exports.annotationLayerName = _chunkUYXL6ZWQcjs.annotationLayerName; exports.annotationOfLayer = _chunkUYXL6ZWQcjs.annotationOfLayer; exports.annotationOfShape = _chunkUYXL6ZWQcjs.annotationOfShape; exports.annotationOfType = _chunkUYXL6ZWQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkUYXL6ZWQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkUYXL6ZWQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkUYXL6ZWQcjs.applyAdjustments; exports.applyBoxBlur = _chunkUYXL6ZWQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkUYXL6ZWQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkUYXL6ZWQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkUYXL6ZWQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkUYXL6ZWQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkUYXL6ZWQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkUYXL6ZWQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkUYXL6ZWQcjs.applyParams; exports.applyProcess2Adjustments = _chunkUYXL6ZWQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkUYXL6ZWQcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkUYXL6ZWQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkUYXL6ZWQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkUYXL6ZWQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkUYXL6ZWQcjs.blurFilter; exports.borderCoverage = _chunkUYXL6ZWQcjs.borderCoverage; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunkUYXL6ZWQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkUYXL6ZWQcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkUYXL6ZWQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkUYXL6ZWQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkUYXL6ZWQcjs.calculateCropDrag; exports.canShareMemory = _chunkV7GWZIZKcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkUYXL6ZWQcjs.canvasToImagePoint; exports.caretAt = _chunkBRKVNXDZcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkUYXL6ZWQcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkUYXL6ZWQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkUYXL6ZWQcjs.combineSelections; exports.compileAdjustmentLayer = _chunkUYXL6ZWQcjs.compileAdjustmentLayer; exports.componentPath = _chunkUYXL6ZWQcjs.componentPath; exports.componentsCoverage = _chunkUYXL6ZWQcjs.componentsCoverage; exports.compositeDeep = _chunkUYXL6ZWQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkUYXL6ZWQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkUYXL6ZWQcjs.contentsBox; exports.contentsSurface = _chunkUYXL6ZWQcjs.contentsSurface; exports.contractCoverage = _chunkUYXL6ZWQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkUYXL6ZWQcjs.convertToSmartObject; exports.copySmartObject = _chunkUYXL6ZWQcjs.copySmartObject; exports.cornersFromMatrix = _chunkUYXL6ZWQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkUYXL6ZWQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkUYXL6ZWQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkBRKVNXDZcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkBRKVNXDZcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkBRKVNXDZcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkV7GWZIZKcjs.createPigmentTools; exports.createSelectionMask = _chunkUYXL6ZWQcjs.createSelectionMask; exports.createShapeLayer = _chunkUYXL6ZWQcjs.createShapeLayer; exports.createTypeLayer = _chunkUYXL6ZWQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkV7GWZIZKcjs.createWetGpuEngine; exports.cssFont = _chunkBRKVNXDZcjs.cssFont; exports.cssFontFamily = _chunkBRKVNXDZcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkUYXL6ZWQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkUYXL6ZWQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkUYXL6ZWQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkUYXL6ZWQcjs.decodeLayerMask; exports.decodeMergedImage = _chunkUYXL6ZWQcjs.decodeMergedImage; exports.decodePlanes = _chunkUYXL6ZWQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkUYXL6ZWQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkUYXL6ZWQcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkUYXL6ZWQcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkUYXL6ZWQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkUYXL6ZWQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkUYXL6ZWQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkUYXL6ZWQcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkUYXL6ZWQcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkUYXL6ZWQcjs.deserializeEffects; exports.deserializeLayer = _chunkUYXL6ZWQcjs.deserializeLayer; exports.deserializeLayers = _chunkUYXL6ZWQcjs.deserializeLayers; exports.deserializePatterns = _chunkUYXL6ZWQcjs.deserializePatterns; exports.deserializeSelection = _chunkUYXL6ZWQcjs.deserializeSelection; exports.developFilter = _chunkUYXL6ZWQcjs.developFilter; exports.developFromAdjustments = _chunkUYXL6ZWQcjs.developFromAdjustments; exports.developTarget = _chunkUYXL6ZWQcjs.developTarget; exports.dexp = _chunkV7GWZIZKcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkUYXL6ZWQcjs.distanceTransform; exports.dlog = _chunkV7GWZIZKcjs.dlog; exports.documentContents = _chunkUYXL6ZWQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkV7GWZIZKcjs.dpow; exports.dragWarpMeshPoint = _chunkBRKVNXDZcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkV7GWZIZKcjs.dsincos; exports.duplicateLayer = _chunkUYXL6ZWQcjs.duplicateLayer; exports.edgeBits = _chunkV7GWZIZKcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveLayerMask = _chunkUYXL6ZWQcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkUYXL6ZWQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkUYXL6ZWQcjs.encodeRle; exports.encodeSelectionRle = _chunkUYXL6ZWQcjs.encodeSelectionRle; exports.encodeSurface = _chunkUYXL6ZWQcjs.encodeSurface; exports.evalWarpMesh = _chunkBRKVNXDZcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkUYXL6ZWQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkV7GWZIZKcjs.expNeg; exports.expandCoverage = _chunkUYXL6ZWQcjs.expandCoverage; exports.exportPsd = _chunkUYXL6ZWQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkUYXL6ZWQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkV7GWZIZKcjs.filmPixel; exports.filmReflectance = _chunkV7GWZIZKcjs.filmReflectance; exports.filterMaskCoverage = _chunkUYXL6ZWQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkV7GWZIZKcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkBRKVNXDZcjs.fitParagraphRuns; exports.fitRuns = _chunkBRKVNXDZcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkUYXL6ZWQcjs.flattenPath; exports.flipCorners = _chunkUYXL6ZWQcjs.flipCorners; exports.flowField = _chunkV7GWZIZKcjs.flowField; exports.followLayerMove = _chunkUYXL6ZWQcjs.followLayerMove; exports.fontOf = _chunkBRKVNXDZcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkUYXL6ZWQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkUYXL6ZWQcjs.geometryHomography; exports.getAnnotationBounds = _chunkUYXL6ZWQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkUYXL6ZWQcjs.getCropCursor; exports.getRotatedSize = _chunkUYXL6ZWQcjs.getRotatedSize; exports.getViewportMetrics = _chunkUYXL6ZWQcjs.getViewportMetrics; exports.getViewportProjection = _chunkUYXL6ZWQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkUYXL6ZWQcjs.greyMorphology; exports.groupLayers = _chunkUYXL6ZWQcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkUYXL6ZWQcjs.hasResampledLegacyMask; exports.hasSurface = _chunkUYXL6ZWQcjs.hasSurface; exports.hasWarp = _chunkUYXL6ZWQcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkUYXL6ZWQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkUYXL6ZWQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkUYXL6ZWQcjs.hitTestAnnotation; exports.hitTestCrop = _chunkUYXL6ZWQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkUYXL6ZWQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkUYXL6ZWQcjs.hueRangeTables; exports.hueRangeWeight = _chunkUYXL6ZWQcjs.hueRangeWeight; exports.hueSaturation = _chunkUYXL6ZWQcjs.hueSaturation; exports.identityCurve = _chunkUYXL6ZWQcjs.identityCurve; exports.identityLevels = _chunkUYXL6ZWQcjs.identityLevels; exports.identityTransform = _chunkUYXL6ZWQcjs.identityTransform; exports.identityWarpMesh = _chunkBRKVNXDZcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkUYXL6ZWQcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkUYXL6ZWQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkUYXL6ZWQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkUYXL6ZWQcjs.invertMatrix3; exports.invertSelection = _chunkUYXL6ZWQcjs.invertSelection; exports.isActiveFilter = _chunkUYXL6ZWQcjs.isActiveFilter; exports.isActiveVectorMask = _chunkUYXL6ZWQcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkUYXL6ZWQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkUYXL6ZWQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkUYXL6ZWQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkUYXL6ZWQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkUYXL6ZWQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkUYXL6ZWQcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkUYXL6ZWQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkUYXL6ZWQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkUYXL6ZWQcjs.isSelectionEmpty; exports.isSelectionMode = _chunkUYXL6ZWQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkUYXL6ZWQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkUYXL6ZWQcjs.isTransformAnchor; exports.isValidWarp = _chunkUYXL6ZWQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkUYXL6ZWQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkV7GWZIZKcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkUYXL6ZWQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkUYXL6ZWQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkUYXL6ZWQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkUYXL6ZWQcjs.layerMaskKey; exports.layerMaskSelection = _chunkUYXL6ZWQcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkUYXL6ZWQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkUYXL6ZWQcjs.layerTree; exports.layerTypeLabel = _chunkUYXL6ZWQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkUYXL6ZWQcjs.layersFromLegacy; exports.layoutText = _chunkBRKVNXDZcjs.layoutText; exports.legacyAdjustmentLayer = _chunkUYXL6ZWQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkUYXL6ZWQcjs.legacyMaskOf; exports.legacyView = _chunkUYXL6ZWQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkUYXL6ZWQcjs.levelsValue; exports.linearSrgbToXy = _chunkUYXL6ZWQcjs.linearSrgbToXy; exports.linearToSrgb = _chunkUYXL6ZWQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkV7GWZIZKcjs.linearToSrgb8; exports.liveComponent = _chunkUYXL6ZWQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkUYXL6ZWQcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk3T5VCDIVcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkV7GWZIZKcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkUYXL6ZWQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkUYXL6ZWQcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkUYXL6ZWQcjs.matrixFromCorners; exports.matrixFromParams = _chunkUYXL6ZWQcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkUYXL6ZWQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkUYXL6ZWQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkUYXL6ZWQcjs.moveLayer; exports.moveSmartFilter = _chunkUYXL6ZWQcjs.moveSmartFilter; exports.mulMatrix3 = _chunkUYXL6ZWQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkUYXL6ZWQcjs.neutralHueRange; exports.newContentsId = _chunkUYXL6ZWQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkUYXL6ZWQcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkUYXL6ZWQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkUYXL6ZWQcjs.normalizeFilter; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkUYXL6ZWQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkUYXL6ZWQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkUYXL6ZWQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkUYXL6ZWQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkUYXL6ZWQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkUYXL6ZWQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkUYXL6ZWQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkUYXL6ZWQcjs.normalizeSubpaths; exports.normalizeText = _chunkUYXL6ZWQcjs.normalizeText; exports.normalizeTilt = _chunkV7GWZIZKcjs.normalizeTilt; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.offsetLayer = _chunkUYXL6ZWQcjs.offsetLayer; exports.offsetShape = _chunkUYXL6ZWQcjs.offsetShape; exports.offsetSmartObject = _chunkUYXL6ZWQcjs.offsetSmartObject; exports.offsetVectorMask = _chunkUYXL6ZWQcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkV7GWZIZKcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkBRKVNXDZcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkUYXL6ZWQcjs.parseAdjustmentBlock; exports.parseBlend = _chunkUYXL6ZWQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkUYXL6ZWQcjs.parseLfx2; exports.parseLrfx = _chunkUYXL6ZWQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk3T5VCDIVcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkUYXL6ZWQcjs.parsePatternBlock; exports.parseSelectionMode = _chunkUYXL6ZWQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkUYXL6ZWQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkUYXL6ZWQcjs.patchParagraphStyle; exports.patchTextStyle = _chunkUYXL6ZWQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkUYXL6ZWQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkV7GWZIZKcjs.pigmentColor; exports.pigmentOf = _chunkV7GWZIZKcjs.pigmentOf; exports.pixelLayerBounds = _chunkUYXL6ZWQcjs.pixelLayerBounds; exports.pixelLayers = _chunkUYXL6ZWQcjs.pixelLayers; exports.pixelPigment = _chunkV7GWZIZKcjs.pixelPigment; exports.placeContents = _chunkUYXL6ZWQcjs.placeContents; exports.placeLayer = _chunkUYXL6ZWQcjs.placeLayer; exports.placementAt = _chunkUYXL6ZWQcjs.placementAt; exports.placementBounds = _chunkUYXL6ZWQcjs.placementBounds; exports.placementGeometry = _chunkUYXL6ZWQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkV7GWZIZKcjs.pointerPressure; exports.pointerStrokeSample = _chunkV7GWZIZKcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkV7GWZIZKcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonCoverageBox = polygonCoverageBox; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkUYXL6ZWQcjs.posterizeValue; exports.presetWarp = _chunkUYXL6ZWQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkUYXL6ZWQcjs.projectImagePoint; exports.projectImageRect = _chunkUYXL6ZWQcjs.projectImageRect; exports.projectMaskCoverage = _chunkUYXL6ZWQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkUYXL6ZWQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkUYXL6ZWQcjs.psdToLayers; exports.pullWarpMesh = _chunkBRKVNXDZcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = quickSelectStroke; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkUYXL6ZWQcjs.rangeLightness; exports.rasterContents = _chunkUYXL6ZWQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkUYXL6ZWQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkUYXL6ZWQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkUYXL6ZWQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkUYXL6ZWQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkUYXL6ZWQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkUYXL6ZWQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkUYXL6ZWQcjs.removeLayer; exports.removeLayerEffect = _chunkUYXL6ZWQcjs.removeLayerEffect; exports.removeLayerFilter = _chunkUYXL6ZWQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkUYXL6ZWQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkUYXL6ZWQcjs.renderShape; exports.renderShapeRect = _chunkUYXL6ZWQcjs.renderShapeRect; exports.renderSmartObject = _chunkUYXL6ZWQcjs.renderSmartObject; exports.renderText = _chunkUYXL6ZWQcjs.renderText; exports.replaceContents = _chunkUYXL6ZWQcjs.replaceContents; exports.replaceTextRange = _chunkUYXL6ZWQcjs.replaceTextRange; exports.requireLayer = _chunkUYXL6ZWQcjs.requireLayer; exports.requireOperation = _chunkUYXL6ZWQcjs.requireOperation; exports.requireShapeLayer = _chunkUYXL6ZWQcjs.requireShapeLayer; exports.requireSmartObject = _chunkUYXL6ZWQcjs.requireSmartObject; exports.requireTypeLayer = _chunkUYXL6ZWQcjs.requireTypeLayer; exports.requireUnlocked = _chunkUYXL6ZWQcjs.requireUnlocked; exports.rerender = _chunkUYXL6ZWQcjs.rerender; exports.rerenderShape = _chunkUYXL6ZWQcjs.rerenderShape; exports.rerenderText = _chunkUYXL6ZWQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkUYXL6ZWQcjs.resizeSelection; exports.resizeWarpMesh = _chunkBRKVNXDZcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkUYXL6ZWQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkUYXL6ZWQcjs.resolveVectorMasks; exports.restyleRange = _chunkBRKVNXDZcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkUYXL6ZWQcjs.rgbToGray; exports.rgbToHsl = _chunkUYXL6ZWQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkUYXL6ZWQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkUYXL6ZWQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkUYXL6ZWQcjs.sampleLut; exports.sampleToneLut = _chunkUYXL6ZWQcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkUYXL6ZWQcjs.selectionArea; exports.selectionFromCoverage = _chunkUYXL6ZWQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkUYXL6ZWQcjs.selectionFromPixels; exports.selectionFromRegion = _chunkUYXL6ZWQcjs.selectionFromRegion; exports.selectionFromTiles = _chunkUYXL6ZWQcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkUYXL6ZWQcjs.selectionToCoverage; exports.selectionToPixels = _chunkUYXL6ZWQcjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkUYXL6ZWQcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkUYXL6ZWQcjs.serializeContents; exports.serializeEffects = _chunkUYXL6ZWQcjs.serializeEffects; exports.serializeLayer = _chunkUYXL6ZWQcjs.serializeLayer; exports.serializeLayers = _chunkUYXL6ZWQcjs.serializeLayers; exports.serializeLayersExternal = _chunkUYXL6ZWQcjs.serializeLayersExternal; exports.serializePatterns = _chunkUYXL6ZWQcjs.serializePatterns; exports.serializeSelection = _chunkUYXL6ZWQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkUYXL6ZWQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkUYXL6ZWQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkUYXL6ZWQcjs.setLayerMask; exports.setLayerProperties = _chunkUYXL6ZWQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkUYXL6ZWQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkUYXL6ZWQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkUYXL6ZWQcjs.setSmartPlacement; exports.shadeTile = _chunkV7GWZIZKcjs.shadeTile; exports.shapeAsPixelLayer = _chunkUYXL6ZWQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkUYXL6ZWQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkUYXL6ZWQcjs.shapeGeometryBounds; exports.shapeLayers = _chunkUYXL6ZWQcjs.shapeLayers; exports.shapeOutline = _chunkUYXL6ZWQcjs.shapeOutline; exports.shapeRenderClip = _chunkUYXL6ZWQcjs.shapeRenderClip; exports.shiftCoverage = _chunkUYXL6ZWQcjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkUYXL6ZWQcjs.smartObjectLayers; exports.smoothCoverage = _chunkUYXL6ZWQcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkBRKVNXDZcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkV7GWZIZKcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkUYXL6ZWQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.stepSlotTs = _chunkV7GWZIZKcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkBRKVNXDZcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkUYXL6ZWQcjs.tempTintToXy; exports.temperatureToKelvin = _chunkUYXL6ZWQcjs.temperatureToKelvin; exports.textIndexAt = _chunkBRKVNXDZcjs.textIndexAt; exports.textMatrix = _chunkUYXL6ZWQcjs.textMatrix; exports.textOrientation = _chunkUYXL6ZWQcjs.textOrientation; exports.textOutlines = _chunkUYXL6ZWQcjs.textOutlines; exports.textRange = _chunkUYXL6ZWQcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkUYXL6ZWQcjs.toTextSpace; exports.toneCurve = _chunkUYXL6ZWQcjs.toneCurve; exports.toneLuts = _chunkUYXL6ZWQcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkUYXL6ZWQcjs.transformHomography; exports.transformMap = _chunkUYXL6ZWQcjs.transformMap; exports.transformShapeComponents = _chunkUYXL6ZWQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkUYXL6ZWQcjs.transformTypeLayer; exports.transformVectorMask = _chunkUYXL6ZWQcjs.transformVectorMask; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkUYXL6ZWQcjs.transformedBox; exports.transformedPoint = _chunkUYXL6ZWQcjs.transformedPoint; exports.translateLayer = _chunkUYXL6ZWQcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkUYXL6ZWQcjs.typeAsPixelLayer; exports.typeFrame = _chunkUYXL6ZWQcjs.typeFrame; exports.typeFromAnnotation = _chunkUYXL6ZWQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkUYXL6ZWQcjs.typeLayerName; exports.ungroupLayer = _chunkUYXL6ZWQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkUYXL6ZWQcjs.unionRect; exports.unprojectCanvasPoint = _chunkUYXL6ZWQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkUYXL6ZWQcjs.updateLayerEffect; exports.updateLayerFilter = _chunkUYXL6ZWQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkUYXL6ZWQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkUYXL6ZWQcjs.updateShapeLayer; exports.updateSmartFilter = _chunkUYXL6ZWQcjs.updateSmartFilter; exports.updateTypeLayer = _chunkUYXL6ZWQcjs.updateTypeLayer; exports.userErrorMessage = _chunkUYXL6ZWQcjs.userErrorMessage; exports.uvToXy = _chunkUYXL6ZWQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkUYXL6ZWQcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkUYXL6ZWQcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkUYXL6ZWQcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkUYXL6ZWQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkUYXL6ZWQcjs.vibranceLinear; exports.vibrancePixel = _chunkUYXL6ZWQcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkBRKVNXDZcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkBRKVNXDZcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkBRKVNXDZcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkBRKVNXDZcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkUYXL6ZWQcjs.wbMatrix; exports.wetGpuSupport = _chunkV7GWZIZKcjs.wetGpuSupport; exports.wetSimdSupported = _chunkV7GWZIZKcjs.wetSimdSupported; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.whiteBalanceFromSample = _chunkUYXL6ZWQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkUYXL6ZWQcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkUYXL6ZWQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkUYXL6ZWQcjs.withNewIds; exports.workImage = workImage; exports.writeAdjustmentBlock = _chunkUYXL6ZWQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkUYXL6ZWQcjs.writeLfx2; exports.writePatternBlock = _chunkUYXL6ZWQcjs.writePatternBlock; exports.writePsd = _chunkUYXL6ZWQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkUYXL6ZWQcjs.xyToTempTint; exports.xyToUv = _chunkUYXL6ZWQcjs.xyToUv;
21207
+
21208
+
21209
+
21210
+
21211
+
21212
+
21213
+
21214
+
21215
+
21216
+
21217
+
21218
+
21219
+
21220
+ exports.ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkUYXL6ZWQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkUYXL6ZWQcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkUYXL6ZWQcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkUYXL6ZWQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkUYXL6ZWQcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkUYXL6ZWQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkV7GWZIZKcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.ColorGmm = ColorGmm; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunkUYXL6ZWQcjs.D50; exports.D65 = _chunkUYXL6ZWQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkBRKVNXDZcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkV7GWZIZKcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkUYXL6ZWQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkBRKVNXDZcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkV7GWZIZKcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkV7GWZIZKcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkUYXL6ZWQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkV7GWZIZKcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkUYXL6ZWQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkV7GWZIZKcjs.EX; exports.EY = _chunkV7GWZIZKcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkV7GWZIZKcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkV7GWZIZKcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkV7GWZIZKcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkV7GWZIZKcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkV7GWZIZKcjs.FLAG_TOP; exports.FLAG_WET = _chunkV7GWZIZKcjs.FLAG_WET; exports.FLAT = _chunkV7GWZIZKcjs.FLAT; exports.FREE_INTERVAL = _chunkV7GWZIZKcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkUYXL6ZWQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = GAMMA; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.GridGraph = GridGraph; exports.HIDE = _chunkV7GWZIZKcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkUYXL6ZWQcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkUYXL6ZWQcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkUYXL6ZWQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkUYXL6ZWQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkUYXL6ZWQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkUYXL6ZWQcjs.LUMA_709; exports.LayerCompositor = _chunkUYXL6ZWQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunkUYXL6ZWQcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkV7GWZIZKcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkUYXL6ZWQcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkUYXL6ZWQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkV7GWZIZKcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkV7GWZIZKcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkV7GWZIZKcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkUYXL6ZWQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkUYXL6ZWQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkV7GWZIZKcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkV7GWZIZKcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkUYXL6ZWQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkV7GWZIZKcjs.PARAM; exports.PARAM_FLOATS = _chunkV7GWZIZKcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkUYXL6ZWQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkV7GWZIZKcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkV7GWZIZKcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkV7GWZIZKcjs.PLANE; exports.PLANE_BYTES = _chunkV7GWZIZKcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkUYXL6ZWQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkV7GWZIZKcjs.P_D0; exports.P_EDGE = _chunkV7GWZIZKcjs.P_EDGE; exports.P_FX = _chunkV7GWZIZKcjs.P_FX; exports.P_FY = _chunkV7GWZIZKcjs.P_FY; exports.P_H = _chunkV7GWZIZKcjs.P_H; exports.P_P0 = _chunkV7GWZIZKcjs.P_P0; exports.P_RHO = _chunkV7GWZIZKcjs.P_RHO; exports.P_SW = _chunkV7GWZIZKcjs.P_SW; exports.P_UX = _chunkV7GWZIZKcjs.P_UX; exports.P_UY = _chunkV7GWZIZKcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunkUYXL6ZWQcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkUYXL6ZWQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkUYXL6ZWQcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkV7GWZIZKcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkUYXL6ZWQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkV7GWZIZKcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkV7GWZIZKcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkV7GWZIZKcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkUYXL6ZWQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkV7GWZIZKcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkV7GWZIZKcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkUYXL6ZWQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkUYXL6ZWQcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkUYXL6ZWQcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkUYXL6ZWQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkUYXL6ZWQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkUYXL6ZWQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkUYXL6ZWQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkUYXL6ZWQcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = UNITS; exports.U_MAX = _chunkV7GWZIZKcjs.U_MAX; exports.VIBRANCE_GREY = _chunkUYXL6ZWQcjs.VIBRANCE_GREY; exports.W9 = _chunkV7GWZIZKcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkBRKVNXDZcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkBRKVNXDZcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkV7GWZIZKcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkV7GWZIZKcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkV7GWZIZKcjs.WET_TILE; exports.WGSL_HALO = _chunkV7GWZIZKcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkV7GWZIZKcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkV7GWZIZKcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_SIZE = WORK_SIZE; exports.WetGpuEngine = _chunkV7GWZIZKcjs.WetGpuEngine; exports.WetMedium = _chunkV7GWZIZKcjs.WetMedium; exports.WetWorkerPool = _chunkV7GWZIZKcjs.WetWorkerPool; exports.WetWorld = _chunkV7GWZIZKcjs.WetWorld; exports.WetWorldError = _chunkV7GWZIZKcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkUYXL6ZWQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkUYXL6ZWQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkUYXL6ZWQcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkUYXL6ZWQcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkUYXL6ZWQcjs.activeSmartFilters; exports.addLayerEffect = _chunkUYXL6ZWQcjs.addLayerEffect; exports.addLayerFilter = _chunkUYXL6ZWQcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunkUYXL6ZWQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkUYXL6ZWQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkUYXL6ZWQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkUYXL6ZWQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkUYXL6ZWQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkUYXL6ZWQcjs.anchorPoint; exports.annotationBlend = _chunkUYXL6ZWQcjs.annotationBlend; exports.annotationLayerFor = _chunkUYXL6ZWQcjs.annotationLayerFor; exports.annotationLayerName = _chunkUYXL6ZWQcjs.annotationLayerName; exports.annotationOfLayer = _chunkUYXL6ZWQcjs.annotationOfLayer; exports.annotationOfShape = _chunkUYXL6ZWQcjs.annotationOfShape; exports.annotationOfType = _chunkUYXL6ZWQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkUYXL6ZWQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkUYXL6ZWQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkUYXL6ZWQcjs.applyAdjustments; exports.applyBoxBlur = _chunkUYXL6ZWQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkUYXL6ZWQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkUYXL6ZWQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkUYXL6ZWQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkUYXL6ZWQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkUYXL6ZWQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkUYXL6ZWQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkUYXL6ZWQcjs.applyParams; exports.applyProcess2Adjustments = _chunkUYXL6ZWQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkUYXL6ZWQcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkUYXL6ZWQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunkUYXL6ZWQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunkUYXL6ZWQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunkUYXL6ZWQcjs.blurFilter; exports.borderCoverage = _chunkUYXL6ZWQcjs.borderCoverage; exports.boxBlur = boxBlur; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunkUYXL6ZWQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkUYXL6ZWQcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkUYXL6ZWQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkUYXL6ZWQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunkUYXL6ZWQcjs.calculateCropDrag; exports.canShareMemory = _chunkV7GWZIZKcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkUYXL6ZWQcjs.canvasToImagePoint; exports.caretAt = _chunkBRKVNXDZcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkUYXL6ZWQcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunkUYXL6ZWQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkUYXL6ZWQcjs.combineSelections; exports.compileAdjustmentLayer = _chunkUYXL6ZWQcjs.compileAdjustmentLayer; exports.componentPath = _chunkUYXL6ZWQcjs.componentPath; exports.componentsCoverage = _chunkUYXL6ZWQcjs.componentsCoverage; exports.compositeDeep = _chunkUYXL6ZWQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkUYXL6ZWQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunkUYXL6ZWQcjs.contentsBox; exports.contentsSurface = _chunkUYXL6ZWQcjs.contentsSurface; exports.contractCoverage = _chunkUYXL6ZWQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkUYXL6ZWQcjs.convertToSmartObject; exports.copySmartObject = _chunkUYXL6ZWQcjs.copySmartObject; exports.cornersFromMatrix = _chunkUYXL6ZWQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunkUYXL6ZWQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkUYXL6ZWQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkBRKVNXDZcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkBRKVNXDZcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkBRKVNXDZcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkV7GWZIZKcjs.createPigmentTools; exports.createSelectionMask = _chunkUYXL6ZWQcjs.createSelectionMask; exports.createShapeLayer = _chunkUYXL6ZWQcjs.createShapeLayer; exports.createTypeLayer = _chunkUYXL6ZWQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkV7GWZIZKcjs.createWetGpuEngine; exports.cssFont = _chunkBRKVNXDZcjs.cssFont; exports.cssFontFamily = _chunkBRKVNXDZcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunkUYXL6ZWQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunkUYXL6ZWQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkUYXL6ZWQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkUYXL6ZWQcjs.decodeLayerMask; exports.decodeMergedImage = _chunkUYXL6ZWQcjs.decodeMergedImage; exports.decodePlanes = _chunkUYXL6ZWQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunkUYXL6ZWQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkUYXL6ZWQcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunkUYXL6ZWQcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkUYXL6ZWQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunkUYXL6ZWQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkUYXL6ZWQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunkUYXL6ZWQcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkUYXL6ZWQcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkUYXL6ZWQcjs.deserializeEffects; exports.deserializeLayer = _chunkUYXL6ZWQcjs.deserializeLayer; exports.deserializeLayers = _chunkUYXL6ZWQcjs.deserializeLayers; exports.deserializePatterns = _chunkUYXL6ZWQcjs.deserializePatterns; exports.deserializeSelection = _chunkUYXL6ZWQcjs.deserializeSelection; exports.developFilter = _chunkUYXL6ZWQcjs.developFilter; exports.developFromAdjustments = _chunkUYXL6ZWQcjs.developFromAdjustments; exports.developTarget = _chunkUYXL6ZWQcjs.developTarget; exports.dexp = _chunkV7GWZIZKcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkUYXL6ZWQcjs.distanceTransform; exports.dlog = _chunkV7GWZIZKcjs.dlog; exports.documentContents = _chunkUYXL6ZWQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkV7GWZIZKcjs.dpow; exports.dragWarpMeshPoint = _chunkBRKVNXDZcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkV7GWZIZKcjs.dsincos; exports.duplicateLayer = _chunkUYXL6ZWQcjs.duplicateLayer; exports.edgeBits = _chunkV7GWZIZKcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveLayerMask = _chunkUYXL6ZWQcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunkUYXL6ZWQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunkUYXL6ZWQcjs.encodeRle; exports.encodeSelectionRle = _chunkUYXL6ZWQcjs.encodeSelectionRle; exports.encodeSurface = _chunkUYXL6ZWQcjs.encodeSurface; exports.evalWarpMesh = _chunkBRKVNXDZcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkUYXL6ZWQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkV7GWZIZKcjs.expNeg; exports.expandCoverage = _chunkUYXL6ZWQcjs.expandCoverage; exports.exportPsd = _chunkUYXL6ZWQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkUYXL6ZWQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkV7GWZIZKcjs.filmPixel; exports.filmReflectance = _chunkV7GWZIZKcjs.filmReflectance; exports.filterMaskCoverage = _chunkUYXL6ZWQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSubject = findSubject; exports.findWebGpu = _chunkV7GWZIZKcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkBRKVNXDZcjs.fitParagraphRuns; exports.fitRuns = _chunkBRKVNXDZcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunkUYXL6ZWQcjs.flattenPath; exports.flipCorners = _chunkUYXL6ZWQcjs.flipCorners; exports.flowField = _chunkV7GWZIZKcjs.flowField; exports.followLayerMove = _chunkUYXL6ZWQcjs.followLayerMove; exports.fontOf = _chunkBRKVNXDZcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkUYXL6ZWQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunkUYXL6ZWQcjs.geometryHomography; exports.getAnnotationBounds = _chunkUYXL6ZWQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkUYXL6ZWQcjs.getCropCursor; exports.getRotatedSize = _chunkUYXL6ZWQcjs.getRotatedSize; exports.getViewportMetrics = _chunkUYXL6ZWQcjs.getViewportMetrics; exports.getViewportProjection = _chunkUYXL6ZWQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = grabCutLabels; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunkUYXL6ZWQcjs.greyMorphology; exports.groupLayers = _chunkUYXL6ZWQcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkUYXL6ZWQcjs.hasResampledLegacyMask; exports.hasSurface = _chunkUYXL6ZWQcjs.hasSurface; exports.hasWarp = _chunkUYXL6ZWQcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunkUYXL6ZWQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunkUYXL6ZWQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkUYXL6ZWQcjs.hitTestAnnotation; exports.hitTestCrop = _chunkUYXL6ZWQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkUYXL6ZWQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkUYXL6ZWQcjs.hueRangeTables; exports.hueRangeWeight = _chunkUYXL6ZWQcjs.hueRangeWeight; exports.hueSaturation = _chunkUYXL6ZWQcjs.hueSaturation; exports.identityCurve = _chunkUYXL6ZWQcjs.identityCurve; exports.identityLevels = _chunkUYXL6ZWQcjs.identityLevels; exports.identityTransform = _chunkUYXL6ZWQcjs.identityTransform; exports.identityWarpMesh = _chunkBRKVNXDZcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkUYXL6ZWQcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkUYXL6ZWQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunkUYXL6ZWQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkUYXL6ZWQcjs.invertMatrix3; exports.invertSelection = _chunkUYXL6ZWQcjs.invertSelection; exports.isActiveFilter = _chunkUYXL6ZWQcjs.isActiveFilter; exports.isActiveVectorMask = _chunkUYXL6ZWQcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkUYXL6ZWQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkUYXL6ZWQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkUYXL6ZWQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkUYXL6ZWQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunkUYXL6ZWQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkUYXL6ZWQcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkUYXL6ZWQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkUYXL6ZWQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkUYXL6ZWQcjs.isSelectionEmpty; exports.isSelectionMode = _chunkUYXL6ZWQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkUYXL6ZWQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkUYXL6ZWQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkUYXL6ZWQcjs.isTransformAnchor; exports.isValidWarp = _chunkUYXL6ZWQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.keepMainPieces = keepMainPieces; exports.kelvinToTemperature = _chunkUYXL6ZWQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkV7GWZIZKcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkUYXL6ZWQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkUYXL6ZWQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkUYXL6ZWQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkUYXL6ZWQcjs.layerMaskKey; exports.layerMaskSelection = _chunkUYXL6ZWQcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkUYXL6ZWQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkUYXL6ZWQcjs.layerTree; exports.layerTypeLabel = _chunkUYXL6ZWQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkUYXL6ZWQcjs.layersFromLegacy; exports.layoutText = _chunkBRKVNXDZcjs.layoutText; exports.legacyAdjustmentLayer = _chunkUYXL6ZWQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkUYXL6ZWQcjs.legacyMaskOf; exports.legacyView = _chunkUYXL6ZWQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunkUYXL6ZWQcjs.levelsValue; exports.linearSrgbToXy = _chunkUYXL6ZWQcjs.linearSrgbToXy; exports.linearToSrgb = _chunkUYXL6ZWQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkV7GWZIZKcjs.linearToSrgb8; exports.liveComponent = _chunkUYXL6ZWQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkUYXL6ZWQcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk3T5VCDIVcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkV7GWZIZKcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkUYXL6ZWQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunkUYXL6ZWQcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkUYXL6ZWQcjs.matrixFromCorners; exports.matrixFromParams = _chunkUYXL6ZWQcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkUYXL6ZWQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunkUYXL6ZWQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkUYXL6ZWQcjs.moveLayer; exports.moveSmartFilter = _chunkUYXL6ZWQcjs.moveSmartFilter; exports.mulMatrix3 = _chunkUYXL6ZWQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkUYXL6ZWQcjs.neutralHueRange; exports.newContentsId = _chunkUYXL6ZWQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunkUYXL6ZWQcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkUYXL6ZWQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkUYXL6ZWQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunkUYXL6ZWQcjs.normalizeFilter; exports.normalizeFlow = _chunkV7GWZIZKcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkUYXL6ZWQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkUYXL6ZWQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunkUYXL6ZWQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkUYXL6ZWQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunkUYXL6ZWQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkUYXL6ZWQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkUYXL6ZWQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkUYXL6ZWQcjs.normalizeSubpaths; exports.normalizeText = _chunkUYXL6ZWQcjs.normalizeText; exports.normalizeTilt = _chunkV7GWZIZKcjs.normalizeTilt; exports.normalizeWetParams = _chunkV7GWZIZKcjs.normalizeWetParams; exports.offsetLayer = _chunkUYXL6ZWQcjs.offsetLayer; exports.offsetShape = _chunkUYXL6ZWQcjs.offsetShape; exports.offsetSmartObject = _chunkUYXL6ZWQcjs.offsetSmartObject; exports.offsetVectorMask = _chunkUYXL6ZWQcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = otsuThreshold; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkV7GWZIZKcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkBRKVNXDZcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkUYXL6ZWQcjs.parseAdjustmentBlock; exports.parseBlend = _chunkUYXL6ZWQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunkUYXL6ZWQcjs.parseLfx2; exports.parseLrfx = _chunkUYXL6ZWQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk3T5VCDIVcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunkUYXL6ZWQcjs.parsePatternBlock; exports.parseSelectionMode = _chunkUYXL6ZWQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkUYXL6ZWQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkUYXL6ZWQcjs.patchParagraphStyle; exports.patchTextStyle = _chunkUYXL6ZWQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunkUYXL6ZWQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkV7GWZIZKcjs.pigmentColor; exports.pigmentOf = _chunkV7GWZIZKcjs.pigmentOf; exports.pixelLayerBounds = _chunkUYXL6ZWQcjs.pixelLayerBounds; exports.pixelLayers = _chunkUYXL6ZWQcjs.pixelLayers; exports.pixelPigment = _chunkV7GWZIZKcjs.pixelPigment; exports.placeContents = _chunkUYXL6ZWQcjs.placeContents; exports.placeLayer = _chunkUYXL6ZWQcjs.placeLayer; exports.placementAt = _chunkUYXL6ZWQcjs.placementAt; exports.placementBounds = _chunkUYXL6ZWQcjs.placementBounds; exports.placementGeometry = _chunkUYXL6ZWQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkV7GWZIZKcjs.pointerPressure; exports.pointerStrokeSample = _chunkV7GWZIZKcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkV7GWZIZKcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonCoverageBox = polygonCoverageBox; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkUYXL6ZWQcjs.posterizeValue; exports.presetWarp = _chunkUYXL6ZWQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkUYXL6ZWQcjs.projectImagePoint; exports.projectImageRect = _chunkUYXL6ZWQcjs.projectImageRect; exports.projectMaskCoverage = _chunkUYXL6ZWQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkUYXL6ZWQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkUYXL6ZWQcjs.psdToLayers; exports.pullWarpMesh = _chunkBRKVNXDZcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = quickSelectStroke; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunkUYXL6ZWQcjs.rangeLightness; exports.rasterContents = _chunkUYXL6ZWQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkUYXL6ZWQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkUYXL6ZWQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkUYXL6ZWQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunkUYXL6ZWQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunkUYXL6ZWQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunkUYXL6ZWQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkUYXL6ZWQcjs.removeLayer; exports.removeLayerEffect = _chunkUYXL6ZWQcjs.removeLayerEffect; exports.removeLayerFilter = _chunkUYXL6ZWQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkUYXL6ZWQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkUYXL6ZWQcjs.renderShape; exports.renderShapeRect = _chunkUYXL6ZWQcjs.renderShapeRect; exports.renderSmartObject = _chunkUYXL6ZWQcjs.renderSmartObject; exports.renderText = _chunkUYXL6ZWQcjs.renderText; exports.replaceContents = _chunkUYXL6ZWQcjs.replaceContents; exports.replaceTextRange = _chunkUYXL6ZWQcjs.replaceTextRange; exports.requireLayer = _chunkUYXL6ZWQcjs.requireLayer; exports.requireOperation = _chunkUYXL6ZWQcjs.requireOperation; exports.requireShapeLayer = _chunkUYXL6ZWQcjs.requireShapeLayer; exports.requireSmartObject = _chunkUYXL6ZWQcjs.requireSmartObject; exports.requireTypeLayer = _chunkUYXL6ZWQcjs.requireTypeLayer; exports.requireUnlocked = _chunkUYXL6ZWQcjs.requireUnlocked; exports.rerender = _chunkUYXL6ZWQcjs.rerender; exports.rerenderShape = _chunkUYXL6ZWQcjs.rerenderShape; exports.rerenderText = _chunkUYXL6ZWQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkUYXL6ZWQcjs.resizeSelection; exports.resizeWarpMesh = _chunkBRKVNXDZcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkUYXL6ZWQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkUYXL6ZWQcjs.resolveVectorMasks; exports.restyleRange = _chunkBRKVNXDZcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunkUYXL6ZWQcjs.rgbToGray; exports.rgbToHsl = _chunkUYXL6ZWQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkUYXL6ZWQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkUYXL6ZWQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkUYXL6ZWQcjs.sampleLut; exports.sampleToneLut = _chunkUYXL6ZWQcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkUYXL6ZWQcjs.selectionArea; exports.selectionFromCoverage = _chunkUYXL6ZWQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkUYXL6ZWQcjs.selectionFromPixels; exports.selectionFromRegion = _chunkUYXL6ZWQcjs.selectionFromRegion; exports.selectionFromTiles = _chunkUYXL6ZWQcjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkUYXL6ZWQcjs.selectionToCoverage; exports.selectionToPixels = _chunkUYXL6ZWQcjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkUYXL6ZWQcjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkUYXL6ZWQcjs.serializeContents; exports.serializeEffects = _chunkUYXL6ZWQcjs.serializeEffects; exports.serializeLayer = _chunkUYXL6ZWQcjs.serializeLayer; exports.serializeLayers = _chunkUYXL6ZWQcjs.serializeLayers; exports.serializeLayersExternal = _chunkUYXL6ZWQcjs.serializeLayersExternal; exports.serializePatterns = _chunkUYXL6ZWQcjs.serializePatterns; exports.serializeSelection = _chunkUYXL6ZWQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkUYXL6ZWQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkUYXL6ZWQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkUYXL6ZWQcjs.setLayerMask; exports.setLayerProperties = _chunkUYXL6ZWQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkUYXL6ZWQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkUYXL6ZWQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkUYXL6ZWQcjs.setSmartPlacement; exports.shadeTile = _chunkV7GWZIZKcjs.shadeTile; exports.shapeAsPixelLayer = _chunkUYXL6ZWQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkUYXL6ZWQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkUYXL6ZWQcjs.shapeGeometryBounds; exports.shapeLayers = _chunkUYXL6ZWQcjs.shapeLayers; exports.shapeOutline = _chunkUYXL6ZWQcjs.shapeOutline; exports.shapeRenderClip = _chunkUYXL6ZWQcjs.shapeRenderClip; exports.shiftCoverage = _chunkUYXL6ZWQcjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkUYXL6ZWQcjs.smartObjectLayers; exports.smoothCoverage = _chunkUYXL6ZWQcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smoothnessWeights = smoothnessWeights; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkBRKVNXDZcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkV7GWZIZKcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunkUYXL6ZWQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.stepSlotTs = _chunkV7GWZIZKcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkBRKVNXDZcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = superpixelSaliency; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunkUYXL6ZWQcjs.tempTintToXy; exports.temperatureToKelvin = _chunkUYXL6ZWQcjs.temperatureToKelvin; exports.textIndexAt = _chunkBRKVNXDZcjs.textIndexAt; exports.textMatrix = _chunkUYXL6ZWQcjs.textMatrix; exports.textOrientation = _chunkUYXL6ZWQcjs.textOrientation; exports.textOutlines = _chunkUYXL6ZWQcjs.textOutlines; exports.textRange = _chunkUYXL6ZWQcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkUYXL6ZWQcjs.toTextSpace; exports.toneCurve = _chunkUYXL6ZWQcjs.toneCurve; exports.toneLuts = _chunkUYXL6ZWQcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkUYXL6ZWQcjs.transformHomography; exports.transformMap = _chunkUYXL6ZWQcjs.transformMap; exports.transformShapeComponents = _chunkUYXL6ZWQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunkUYXL6ZWQcjs.transformTypeLayer; exports.transformVectorMask = _chunkUYXL6ZWQcjs.transformVectorMask; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunkUYXL6ZWQcjs.transformedBox; exports.transformedPoint = _chunkUYXL6ZWQcjs.transformedPoint; exports.translateLayer = _chunkUYXL6ZWQcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunkUYXL6ZWQcjs.typeAsPixelLayer; exports.typeFrame = _chunkUYXL6ZWQcjs.typeFrame; exports.typeFromAnnotation = _chunkUYXL6ZWQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkUYXL6ZWQcjs.typeLayerName; exports.ungroupLayer = _chunkUYXL6ZWQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunkUYXL6ZWQcjs.unionRect; exports.unprojectCanvasPoint = _chunkUYXL6ZWQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkUYXL6ZWQcjs.updateLayerEffect; exports.updateLayerFilter = _chunkUYXL6ZWQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkUYXL6ZWQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkUYXL6ZWQcjs.updateShapeLayer; exports.updateSmartFilter = _chunkUYXL6ZWQcjs.updateSmartFilter; exports.updateTypeLayer = _chunkUYXL6ZWQcjs.updateTypeLayer; exports.upscaleRegion = upscaleRegion; exports.userErrorMessage = _chunkUYXL6ZWQcjs.userErrorMessage; exports.uvToXy = _chunkUYXL6ZWQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkUYXL6ZWQcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkUYXL6ZWQcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkUYXL6ZWQcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkUYXL6ZWQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkUYXL6ZWQcjs.vibranceLinear; exports.vibrancePixel = _chunkUYXL6ZWQcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkBRKVNXDZcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkBRKVNXDZcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkBRKVNXDZcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkBRKVNXDZcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkUYXL6ZWQcjs.wbMatrix; exports.wetGpuSupport = _chunkV7GWZIZKcjs.wetGpuSupport; exports.wetSimdSupported = _chunkV7GWZIZKcjs.wetSimdSupported; exports.wetSupport = _chunkV7GWZIZKcjs.wetSupport; exports.whiteBalanceFromSample = _chunkUYXL6ZWQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkUYXL6ZWQcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkUYXL6ZWQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkUYXL6ZWQcjs.withNewIds; exports.workImage = workImage; exports.writeAdjustmentBlock = _chunkUYXL6ZWQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunkUYXL6ZWQcjs.writeLfx2; exports.writePatternBlock = _chunkUYXL6ZWQcjs.writePatternBlock; exports.writePsd = _chunkUYXL6ZWQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunkUYXL6ZWQcjs.xyToTempTint; exports.xyToUv = _chunkUYXL6ZWQcjs.xyToUv;