@pixerate/editor 0.240.0 → 0.242.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/dist/animation-editor/controller.d.cts +10 -0
  2. package/dist/animation-editor/controller.d.ts +10 -0
  3. package/dist/animation-editor/effects.d.cts +1 -1
  4. package/dist/animation-editor/effects.d.ts +1 -1
  5. package/dist/animation-editor/index.cjs +195 -146
  6. package/dist/animation-editor/index.js +63 -14
  7. package/dist/{brushstrokeRender-WB67GMUP.js → brushstrokeRender-MOYGEXOC.js} +2 -2
  8. package/dist/{brushstrokeRender-MPOM7BFW.cjs → brushstrokeRender-UKADOV5D.cjs} +5 -5
  9. package/dist/canvas/index.cjs +15 -15
  10. package/dist/canvas/index.js +2 -2
  11. package/dist/{chunk-NKTNLJUJ.cjs → chunk-5BR7LC24.cjs} +99 -11
  12. package/dist/{chunk-ZXNO3ZOX.cjs → chunk-7F4G74UQ.cjs} +35 -35
  13. package/dist/{chunk-A7PQNIBX.cjs → chunk-7V7QMFTI.cjs} +14 -14
  14. package/dist/{chunk-AD7GA3TL.cjs → chunk-AFLMXITL.cjs} +23 -23
  15. package/dist/{chunk-JAOSL334.cjs → chunk-GHCSC2WP.cjs} +38 -16
  16. package/dist/{chunk-PP6BXVRL.cjs → chunk-HGGJ36HR.cjs} +1 -1
  17. package/dist/{chunk-BBUE3UJL.cjs → chunk-HW72ABGR.cjs} +86 -86
  18. package/dist/{chunk-7YGBSFC6.js → chunk-ILM6GYAX.js} +1 -1
  19. package/dist/{chunk-JWCKJNDR.cjs → chunk-K5DS2JTA.cjs} +6 -6
  20. package/dist/{chunk-THXFU3JB.cjs → chunk-KCMV2534.cjs} +2 -2
  21. package/dist/{chunk-WDDUPWVG.js → chunk-L3JFOTBQ.js} +1 -1
  22. package/dist/{chunk-3E36VDMJ.js → chunk-NE6OOKWJ.js} +1 -1
  23. package/dist/{chunk-SIK3LT6M.js → chunk-OFH6Q67U.js} +28 -6
  24. package/dist/{chunk-RV5DKZHU.js → chunk-QP2B3MID.js} +1 -1
  25. package/dist/{chunk-G3RUKJ5C.js → chunk-RXZL4NG5.js} +1 -1
  26. package/dist/{chunk-UUBO6RB5.js → chunk-UDBDYZET.js} +1 -1
  27. package/dist/{chunk-TEFQISBY.js → chunk-X3ZINLIP.js} +1 -1
  28. package/dist/{chunk-PJYG6FCF.js → chunk-XBZK47LV.js} +98 -10
  29. package/dist/{chunk-ZQIWBJGH.cjs → chunk-XNZFVYC2.cjs} +7 -7
  30. package/dist/{chunk-XK4SST43.js → chunk-ZDPLZDTT.js} +1 -1
  31. package/dist/effects/fake.d.cts +4 -0
  32. package/dist/effects/fake.d.ts +4 -0
  33. package/dist/effects/helpers.d.cts +6 -0
  34. package/dist/effects/helpers.d.ts +6 -0
  35. package/dist/effects/index.cjs +222 -94
  36. package/dist/effects/index.js +131 -3
  37. package/dist/effects/types.d.cts +31 -0
  38. package/dist/effects/types.d.ts +31 -0
  39. package/dist/image-editor/index.cjs +788 -788
  40. package/dist/image-editor/index.js +5 -5
  41. package/dist/paint-editor/controller.d.cts +67 -0
  42. package/dist/paint-editor/controller.d.ts +67 -0
  43. package/dist/paint-editor/effect-paint.d.cts +60 -3
  44. package/dist/paint-editor/effect-paint.d.ts +60 -3
  45. package/dist/paint-editor/index.cjs +682 -436
  46. package/dist/paint-editor/index.js +284 -38
  47. package/dist/paint-editor/stickers.d.cts +6 -0
  48. package/dist/paint-editor/stickers.d.ts +6 -0
  49. package/dist/paint-editor/thick.d.cts +4 -0
  50. package/dist/paint-editor/thick.d.ts +4 -0
  51. package/dist/paint-editor/wet.d.cts +8 -0
  52. package/dist/paint-editor/wet.d.ts +8 -0
  53. package/dist/vector/index.cjs +968 -968
  54. package/dist/vector/index.js +5 -5
  55. package/dist/video-editor/controller.d.cts +49 -1
  56. package/dist/video-editor/controller.d.ts +49 -1
  57. package/dist/video-editor/effect-path.d.cts +66 -0
  58. package/dist/video-editor/effect-path.d.ts +66 -0
  59. package/dist/video-editor/index.cjs +616 -427
  60. package/dist/video-editor/index.d.cts +1 -0
  61. package/dist/video-editor/index.d.ts +1 -0
  62. package/dist/video-editor/index.js +193 -4
  63. package/package.json +1 -1
  64. package/skills/pixerate-animation-editor/SKILL.md +1 -1
  65. package/skills/pixerate-paint-editor/SKILL.md +17 -21
  66. package/skills/pixerate-paint-editor/references/effect-paint.md +25 -0
  67. package/skills/pixerate-video-editor/SKILL.md +9 -2
@@ -104,7 +104,7 @@ var _chunkBROJYMWUcjs = require('./chunk-BROJYMWU.cjs');
104
104
 
105
105
 
106
106
 
107
- var _chunkTHXFU3JBcjs = require('./chunk-THXFU3JB.cjs');
107
+ var _chunkKCMV2534cjs = require('./chunk-KCMV2534.cjs');
108
108
 
109
109
 
110
110
 
@@ -2323,7 +2323,7 @@ function mapAnchor(a, f) {
2323
2323
  return out;
2324
2324
  }
2325
2325
  function mapSubpaths(subpaths, f) {
2326
- return _chunkTHXFU3JBcjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
2326
+ return _chunkKCMV2534cjs.expandVectorCorners.call(void 0, subpaths).map((sp) => ({ closed: sp.closed, anchors: sp.anchors.map((a) => mapAnchor(a, f)) }));
2327
2327
  }
2328
2328
  function liveShapeSubpaths(live) {
2329
2329
  let out;
@@ -2331,19 +2331,19 @@ function liveShapeSubpaths(live) {
2331
2331
  case "rect": {
2332
2332
  const x = Math.min(live.x, live.x + live.width);
2333
2333
  const y = Math.min(live.y, live.y + live.height);
2334
- const sp = _chunkTHXFU3JBcjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
2334
+ const sp = _chunkKCMV2534cjs.rectSubpath.call(void 0, { x, y, width: Math.abs(live.width), height: Math.abs(live.height) });
2335
2335
  const r = _nullishCoalesce(live.radii, () => ( [0, 0, 0, 0]));
2336
- out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkTHXFU3JBcjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
2336
+ out = [{ closed: true, anchors: sp.anchors.map((a, i) => r[i] > 0 ? _chunkKCMV2534cjs.setAnchorCorner.call(void 0, a, r[i]) : a) }];
2337
2337
  break;
2338
2338
  }
2339
2339
  case "ellipse":
2340
- out = [_chunkTHXFU3JBcjs.ellipseSubpath.call(void 0, normBox(live))];
2340
+ out = [_chunkKCMV2534cjs.ellipseSubpath.call(void 0, normBox(live))];
2341
2341
  break;
2342
2342
  case "polygon":
2343
- out = [_chunkTHXFU3JBcjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
2343
+ out = [_chunkKCMV2534cjs.polygonSubpath.call(void 0, normBox(live), live.sides)];
2344
2344
  break;
2345
2345
  case "star":
2346
- out = [_chunkTHXFU3JBcjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
2346
+ out = [_chunkKCMV2534cjs.starSubpath.call(void 0, normBox(live), live.points, Math.max(0, Math.min(1, live.innerRatio)))];
2347
2347
  break;
2348
2348
  case "line": {
2349
2349
  const a = { x: live.x1, y: live.y1 };
@@ -2366,7 +2366,7 @@ function liveShapeSubpaths(live) {
2366
2366
  }
2367
2367
  }
2368
2368
  const m = live.transform;
2369
- return m && !_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, p)) : out;
2369
+ return m && !_chunkKCMV2534cjs.isIdentityMatrix.call(void 0, m) ? mapSubpaths(out, (p) => _chunkKCMV2534cjs.applyMatrix.call(void 0, m, p)) : out;
2370
2370
  }
2371
2371
  function normBox(b) {
2372
2372
  return { x: Math.min(b.x, b.x + b.width), y: Math.min(b.y, b.y + b.height), width: Math.abs(b.width), height: Math.abs(b.height) };
@@ -2378,7 +2378,7 @@ var pathCache = /* @__PURE__ */ new WeakMap();
2378
2378
  function componentPath(c) {
2379
2379
  let p = pathCache.get(c.subpaths);
2380
2380
  if (!p) {
2381
- p = _chunkTHXFU3JBcjs.subpathsToBezier.call(void 0, c.subpaths);
2381
+ p = _chunkKCMV2534cjs.subpathsToBezier.call(void 0, c.subpaths);
2382
2382
  pathCache.set(c.subpaths, p);
2383
2383
  }
2384
2384
  return p;
@@ -2705,7 +2705,7 @@ function matrixArg(v, path) {
2705
2705
  if (!Array.isArray(v) || v.length !== 6 || !v.every(isNum)) fail(`${path} must be six numbers [a, b, c, d, e, f].`);
2706
2706
  const m = v;
2707
2707
  if (Math.abs(m[0] * m[3] - m[1] * m[2]) < 1e-12) fail(`${path} is singular.`);
2708
- return _chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
2708
+ return _chunkKCMV2534cjs.isIdentityMatrix.call(void 0, m) ? void 0 : [...m];
2709
2709
  }
2710
2710
  function normalizeLiveShape(v, path = "shape") {
2711
2711
  if (!v || typeof v !== "object") return fail(`${path} must be an object with kind ${LIVE_SHAPE_KINDS.join(", ")}.`);
@@ -2766,7 +2766,7 @@ function normalizeSubpaths(v, path = "subpaths") {
2766
2766
  if (typeof v === "string") {
2767
2767
  let subs;
2768
2768
  try {
2769
- subs = _chunkTHXFU3JBcjs.bezierToSubpaths.call(void 0, v);
2769
+ subs = _chunkKCMV2534cjs.bezierToSubpaths.call(void 0, v);
2770
2770
  } catch (e5) {
2771
2771
  return fail(`${path}: could not read the SVG path data.`);
2772
2772
  }
@@ -2852,15 +2852,15 @@ function updateShapeLayer(layers, id, change, env, action = "edit it") {
2852
2852
  function transformShapeComponents(components, f, affine) {
2853
2853
  return components.map((c) => {
2854
2854
  if (affine && c.live) {
2855
- const live = { ...c.live, transform: _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkTHXFU3JBcjs.IDENTITY_MATRIX)), affine) };
2856
- if (_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
2855
+ const live = { ...c.live, transform: _chunkKCMV2534cjs.multiplyMatrices.call(void 0, _nullishCoalesce(c.live.transform, () => ( _chunkKCMV2534cjs.IDENTITY_MATRIX)), affine) };
2856
+ if (_chunkKCMV2534cjs.isIdentityMatrix.call(void 0, live.transform)) delete live.transform;
2857
2857
  return { op: c.op, subpaths: liveShapeSubpaths(live), live };
2858
2858
  }
2859
2859
  return { op: c.op, subpaths: mapSubpaths(c.subpaths, f) };
2860
2860
  });
2861
2861
  }
2862
2862
  function offsetShape(layer, dx, dy, env) {
2863
- const m = _chunkTHXFU3JBcjs.translateMatrix.call(void 0, dx, dy);
2863
+ const m = _chunkKCMV2534cjs.translateMatrix.call(void 0, dx, dy);
2864
2864
  const next = { ...layer, components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), m) };
2865
2865
  delete next.annotation;
2866
2866
  return rerenderShape(next, env);
@@ -2868,7 +2868,7 @@ function offsetShape(layer, dx, dy, env) {
2868
2868
  function mergeShapeComponents(components, fillRule = "nonzero") {
2869
2869
  if (components.length < 2) return [...components];
2870
2870
  const path = shapeOutline(components, fillRule);
2871
- const subpaths = _chunkTHXFU3JBcjs.bezierToSubpaths.call(void 0, path);
2871
+ const subpaths = _chunkKCMV2534cjs.bezierToSubpaths.call(void 0, path);
2872
2872
  if (!subpaths.length) fail("The components combine to nothing (the operations remove every area), so there is nothing to merge into.");
2873
2873
  return [{ op: "combine", subpaths }];
2874
2874
  }
@@ -2885,7 +2885,7 @@ function annotationPaint(color, opacity) {
2885
2885
  function shapeFromAnnotation(a) {
2886
2886
  const opacity = _nullishCoalesce(a.opacity, () => ( 1));
2887
2887
  const lineWidth = "strokeWidth" in a && a.strokeWidth > 0 ? a.strokeWidth : 1;
2888
- const rotation = a.rotation ? _chunkTHXFU3JBcjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
2888
+ const rotation = a.rotation ? _chunkKCMV2534cjs.rotateMatrix.call(void 0, a.rotation, { x: a.x, y: a.y }) : void 0;
2889
2889
  const t = rotation ? { transform: rotation } : {};
2890
2890
  const live = (l) => liveComponent(l);
2891
2891
  switch (a.type) {
@@ -2928,7 +2928,7 @@ function shapeFromAnnotation(a) {
2928
2928
  case "pen": {
2929
2929
  const paint = annotationPaint(a.strokeColor, opacity);
2930
2930
  if (!paint) return null;
2931
- const pts = rotation ? a.points.map((p) => _chunkTHXFU3JBcjs.applyMatrix.call(void 0, rotation, p)) : a.points;
2931
+ const pts = rotation ? a.points.map((p) => _chunkKCMV2534cjs.applyMatrix.call(void 0, rotation, p)) : a.points;
2932
2932
  const subpaths = pts.length > 1 ? [{ closed: false, anchors: pts.map((p) => ({ x: p.x, y: p.y })) }] : [];
2933
2933
  return {
2934
2934
  components: [{ op: "combine", subpaths }],
@@ -2961,7 +2961,7 @@ var JOIN_SIGMA = 2;
2961
2961
  function vectorMaskSegments(components) {
2962
2962
  const out = [];
2963
2963
  components.forEach((c, ci) => c.subpaths.forEach((sp, si) => {
2964
- for (let k = 0; k < _chunkTHXFU3JBcjs.subpathSegmentCount.call(void 0, sp); k++) out.push({ component: ci, subpath: si, segment: k });
2964
+ for (let k = 0; k < _chunkKCMV2534cjs.subpathSegmentCount.call(void 0, sp); k++) out.push({ component: ci, subpath: si, segment: k });
2965
2965
  }));
2966
2966
  return out;
2967
2967
  }
@@ -2969,7 +2969,7 @@ function validVectorMaskEdges(edges, components) {
2969
2969
  if (!_optionalChain([edges, 'optionalAccess', _34 => _34.length])) return [];
2970
2970
  return edges.filter((e) => {
2971
2971
  const sp = _optionalChain([components, 'access', _35 => _35[e.component], 'optionalAccess', _36 => _36.subpaths, 'access', _37 => _37[e.subpath]]);
2972
- return Boolean(sp) && e.segment >= 0 && e.segment < _chunkTHXFU3JBcjs.subpathSegmentCount.call(void 0, sp);
2972
+ return Boolean(sp) && e.segment >= 0 && e.segment < _chunkKCMV2534cjs.subpathSegmentCount.call(void 0, sp);
2973
2973
  });
2974
2974
  }
2975
2975
  function reach(e) {
@@ -2992,8 +2992,8 @@ function hybridVectorMaskCoverage(vm, hard, width, height, guide) {
2992
2992
  const seedClass = [];
2993
2993
  vm.components.forEach(
2994
2994
  (c, ci) => c.subpaths.forEach((sp, si) => {
2995
- for (let k = 0; k < _chunkTHXFU3JBcjs.subpathSegmentCount.call(void 0, sp); k++) {
2996
- const seg = _chunkTHXFU3JBcjs.subpathSegment.call(void 0, sp, k);
2995
+ for (let k = 0; k < _chunkKCMV2534cjs.subpathSegmentCount.call(void 0, sp); k++) {
2996
+ const seg = _chunkKCMV2534cjs.subpathSegment.call(void 0, sp, k);
2997
2997
  let len = 0;
2998
2998
  for (let i = 1; i < seg.length; i++) len += Math.hypot(seg[i][0] - seg[i - 1][0], seg[i][1] - seg[i - 1][1]);
2999
2999
  const steps = Math.max(2, Math.ceil(len * 2));
@@ -3893,7 +3893,7 @@ var fail3 = (message) => {
3893
3893
  };
3894
3894
  var TEXT_RENDER_MARGIN = _chunkHB4ICNNAcjs.MAX_EFFECT_REACH;
3895
3895
  function textMatrix(layer) {
3896
- return _nullishCoalesce(layer.transform, () => ( _chunkTHXFU3JBcjs.IDENTITY_MATRIX));
3896
+ return _nullishCoalesce(layer.transform, () => ( _chunkKCMV2534cjs.IDENTITY_MATRIX));
3897
3897
  }
3898
3898
  function rectCorners(r) {
3899
3899
  return [
@@ -3904,7 +3904,7 @@ function rectCorners(r) {
3904
3904
  ];
3905
3905
  }
3906
3906
  function docRect(r, m) {
3907
- const pts = rectCorners(r).map((p) => _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, p));
3907
+ const pts = rectCorners(r).map((p) => _chunkKCMV2534cjs.applyMatrix.call(void 0, m, p));
3908
3908
  const x0 = Math.floor(Math.min(...pts.map((p) => p.x)));
3909
3909
  const y0 = Math.floor(Math.min(...pts.map((p) => p.y)));
3910
3910
  const x1 = Math.ceil(Math.max(...pts.map((p) => p.x)));
@@ -3924,7 +3924,7 @@ function inkBounds(layout) {
3924
3924
  for (const f of l.fragments) {
3925
3925
  const pad = f.style.fontSize * (l.matrix ? 1 : 0.5);
3926
3926
  const w = f.carets[f.carets.length - 1];
3927
- const r = _chunkTHXFU3JBcjs.transformTextRect.call(void 0, l.matrix, { x: f.x - pad, y: l.baseline - l.ascent - pad + Math.min(0, f.y - l.baseline), width: w + 2 * pad, height: l.ascent + l.descent + 2 * pad + Math.abs(f.y - l.baseline) });
3927
+ const r = _chunkKCMV2534cjs.transformTextRect.call(void 0, l.matrix, { x: f.x - pad, y: l.baseline - l.ascent - pad + Math.min(0, f.y - l.baseline), width: w + 2 * pad, height: l.ascent + l.descent + 2 * pad + Math.abs(f.y - l.baseline) });
3928
3928
  if (!b) b = r;
3929
3929
  else {
3930
3930
  const x0 = Math.min(b.x, r.x);
@@ -3937,14 +3937,14 @@ function inkBounds(layout) {
3937
3937
  }
3938
3938
  function textOutlines(layer, shaper) {
3939
3939
  if (!shaper.outline) fail3(`The text shaper "${shaper.id}" cannot give glyph outlines; plug in an outline shaper (createOutlineTextShaper) to convert text to shapes.`);
3940
- const layout = _chunkTHXFU3JBcjs.layoutText.call(void 0, layer, shaper);
3940
+ const layout = _chunkKCMV2534cjs.layoutText.call(void 0, layer, shaper);
3941
3941
  const m = textMatrix(layer);
3942
3942
  const out = [];
3943
3943
  for (const l of layout.lines) {
3944
3944
  for (const f of l.fragments) {
3945
- let path = _chunkTHXFU3JBcjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3946
- for (const r of _chunkTHXFU3JBcjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkTHXFU3JBcjs.textRectPath.call(void 0, r)];
3947
- out.push({ fragment: f, path: _chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3945
+ let path = _chunkKCMV2534cjs.textFragmentOutline.call(void 0, shaper, layer.text, f);
3946
+ for (const r of _chunkKCMV2534cjs.textDecorations.call(void 0, f, l)) path = [...path, ..._chunkKCMV2534cjs.textRectPath.call(void 0, r)];
3947
+ out.push({ fragment: f, path: _chunkKCMV2534cjs.isIdentityMatrix.call(void 0, m) ? path : _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, path, m) });
3948
3948
  }
3949
3949
  }
3950
3950
  return out;
@@ -4000,7 +4000,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4000
4000
  const canvas = env.createCanvas(region.width, region.height);
4001
4001
  const ctx = canvas.getContext("2d");
4002
4002
  if (!ctx || typeof ctx.getImageData !== "function") return null;
4003
- const layout = _chunkTHXFU3JBcjs.layoutText.call(void 0, layer, shaper);
4003
+ const layout = _chunkKCMV2534cjs.layoutText.call(void 0, layer, shaper);
4004
4004
  const m = textMatrix(layer);
4005
4005
  ctx.setTransform(1, 0, 0, 1, 0, 0);
4006
4006
  ctx.clearRect(0, 0, region.width, region.height);
@@ -4010,8 +4010,8 @@ function renderOnCanvas(layer, shaper, region, env) {
4010
4010
  const [r, g, b] = rgbOf(f.style.color);
4011
4011
  ctx.fillStyle = `rgb(${r}, ${g}, ${b})`;
4012
4012
  ctx.globalAlpha = _nullishCoalesce(f.style.opacity, () => ( 1));
4013
- _chunkTHXFU3JBcjs.drawTextFragment.call(void 0, ctx, shaper, layer.text, f);
4014
- for (const d of _chunkTHXFU3JBcjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4013
+ _chunkKCMV2534cjs.drawTextFragment.call(void 0, ctx, shaper, layer.text, f);
4014
+ for (const d of _chunkKCMV2534cjs.textDecorations.call(void 0, f, l)) ctx.fillRect(d.x, d.y, d.width, d.height);
4015
4015
  }
4016
4016
  }
4017
4017
  ctx.globalAlpha = 1;
@@ -4022,7 +4022,7 @@ function renderOnCanvas(layer, shaper, region, env) {
4022
4022
  function renderText(layer, env) {
4023
4023
  const shaper = env.shaper;
4024
4024
  if (!shaper || !shaper.outline && !shaper.draw) return null;
4025
- const layout = _chunkTHXFU3JBcjs.layoutText.call(void 0, layer, shaper);
4025
+ const layout = _chunkKCMV2534cjs.layoutText.call(void 0, layer, shaper);
4026
4026
  const ink = inkBounds(layout);
4027
4027
  const clip = { x: -TEXT_RENDER_MARGIN, y: -TEXT_RENDER_MARGIN, width: env.width + 2 * TEXT_RENDER_MARGIN, height: env.height + 2 * TEXT_RENDER_MARGIN };
4028
4028
  const region = ink ? intersect2(docRect(ink, textMatrix(layer)), clip) : null;
@@ -4123,7 +4123,7 @@ function patchParagraphStyle(base, patch, path = "paragraph") {
4123
4123
  continue;
4124
4124
  }
4125
4125
  const value = k === "autoLeading" ? num(v, `${path}.${k}`, 0.1, 10) : num(v, `${path}.${k}`, -1e4, 1e4);
4126
- if (k === "autoLeading" && value === _chunkTHXFU3JBcjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4126
+ if (k === "autoLeading" && value === _chunkKCMV2534cjs.DEFAULT_AUTO_LEADING || k !== "autoLeading" && value === 0) delete o[k];
4127
4127
  else o[k] = value;
4128
4128
  } else fail3(`${path}.${k} is not a paragraph style field; use ${PARAGRAPH_STYLE_FIELDS.join(", ")}.`);
4129
4129
  }
@@ -4164,15 +4164,15 @@ function createTypeLayer(init, env, id = newLayerId(), lenient = false) {
4164
4164
  opacity: 1,
4165
4165
  blend: "normal",
4166
4166
  text: text3,
4167
- runs: _chunkTHXFU3JBcjs.fitRuns.call(void 0, init.runs, text3.length, _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE),
4168
- paragraphs: _chunkTHXFU3JBcjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4167
+ runs: _chunkKCMV2534cjs.fitRuns.call(void 0, init.runs, text3.length, _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE),
4168
+ paragraphs: _chunkKCMV2534cjs.fitParagraphRuns.call(void 0, _nullishCoalesce(init.paragraphs, () => ( [{ length: text3.length, style: {} }])), text3),
4169
4169
  frame: init.frame,
4170
4170
  ...init.orientation === "vertical" ? { orientation: "vertical" } : {},
4171
4171
  surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4),
4172
4172
  offset: { x: 0, y: 0 }
4173
4173
  };
4174
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _79 => _79.runs, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.style]), () => ( _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE)) }];
4175
- if (init.transform && !_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4174
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([init, 'access', _79 => _79.runs, 'access', _80 => _80[0], 'optionalAccess', _81 => _81.style]), () => ( _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE)) }];
4175
+ if (init.transform && !_chunkKCMV2534cjs.isIdentityMatrix.call(void 0, init.transform)) layer.transform = init.transform;
4176
4176
  if (lenient && !renderText(layer, env)) return { ...layer, rendering: "stored" };
4177
4177
  return rerenderText(layer, env);
4178
4178
  }
@@ -4183,24 +4183,24 @@ function updateTypeLayer(layers, id, change, env, action = "edit it") {
4183
4183
  const next = { ...current, ...patch };
4184
4184
  if (!("annotation" in patch)) delete next.annotation;
4185
4185
  if (next.orientation !== "vertical") delete next.orientation;
4186
- if ("text" in patch || "runs" in patch) next.runs = _chunkTHXFU3JBcjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _82 => _82.runs, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.style]), () => ( _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE)));
4187
- if (!next.runs.length) next.runs = [{ length: 0, style: _chunkTHXFU3JBcjs.styleAt.call(void 0, current.runs, 0, _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE) }];
4188
- if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkTHXFU3JBcjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4186
+ if ("text" in patch || "runs" in patch) next.runs = _chunkKCMV2534cjs.fitRuns.call(void 0, next.runs, next.text.length, _nullishCoalesce(_optionalChain([current, 'access', _82 => _82.runs, 'access', _83 => _83[0], 'optionalAccess', _84 => _84.style]), () => ( _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE)));
4187
+ if (!next.runs.length) next.runs = [{ length: 0, style: _chunkKCMV2534cjs.styleAt.call(void 0, current.runs, 0, _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE) }];
4188
+ if ("text" in patch || "paragraphs" in patch) next.paragraphs = _chunkKCMV2534cjs.fitParagraphRuns.call(void 0, next.paragraphs, next.text);
4189
4189
  const rendered = rerenderText(next, env);
4190
4190
  return { layers: _chunkHB4ICNNAcjs.mapLayer.call(void 0, layers, id, () => rendered), layer: rendered };
4191
4191
  }
4192
4192
  function replaceTextRange(layer, start, end, insert) {
4193
4193
  const text3 = layer.text.slice(0, start) + insert + layer.text.slice(end);
4194
- const style = _chunkTHXFU3JBcjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE);
4195
- const runs = _chunkTHXFU3JBcjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4196
- const pstyle = _chunkTHXFU3JBcjs.styleAt.call(void 0, layer.paragraphs, start, {});
4197
- const paragraphs = _chunkTHXFU3JBcjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4198
- return { text: text3, runs, paragraphs: _chunkTHXFU3JBcjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4194
+ const style = _chunkKCMV2534cjs.styleAt.call(void 0, layer.runs, start > 0 && start === layer.text.length ? start - 1 : start, _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE);
4195
+ const runs = _chunkKCMV2534cjs.spliceRuns.call(void 0, layer.runs, start, end, insert.length, style);
4196
+ const pstyle = _chunkKCMV2534cjs.styleAt.call(void 0, layer.paragraphs, start, {});
4197
+ const paragraphs = _chunkKCMV2534cjs.spliceRuns.call(void 0, layer.paragraphs, start, end, insert.length, pstyle);
4198
+ return { text: text3, runs, paragraphs: _chunkKCMV2534cjs.fitParagraphRuns.call(void 0, paragraphs, text3) };
4199
4199
  }
4200
4200
  function transformTypeLayer(layer, m) {
4201
- const t = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4201
+ const t = _chunkKCMV2534cjs.multiplyMatrices.call(void 0, textMatrix(layer), m);
4202
4202
  const next = { ...layer };
4203
- if (_chunkTHXFU3JBcjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4203
+ if (_chunkKCMV2534cjs.isIdentityMatrix.call(void 0, t)) delete next.transform;
4204
4204
  else next.transform = t;
4205
4205
  delete next.annotation;
4206
4206
  return next;
@@ -4208,7 +4208,7 @@ function transformTypeLayer(layer, m) {
4208
4208
  function typeFrame(layer, shaper) {
4209
4209
  if (layer.frame.kind === "box") return { x: 0, y: 0, width: layer.frame.width, height: layer.frame.height };
4210
4210
  if (!shaper) return fail3("Type layers need a text shaper to be measured; none is set here.");
4211
- const b = _chunkTHXFU3JBcjs.layoutText.call(void 0, layer, shaper).bounds;
4211
+ const b = _chunkKCMV2534cjs.layoutText.call(void 0, layer, shaper).bounds;
4212
4212
  return { x: b.x, y: b.y, width: Math.max(b.width, 1), height: Math.max(b.height, 1) };
4213
4213
  }
4214
4214
  function typeAsPixelLayer(layer) {
@@ -4216,7 +4216,7 @@ function typeAsPixelLayer(layer) {
4216
4216
  return { ...rest, type: "pixel", surface: layer.surface, offset: { x: 0, y: 0 } };
4217
4217
  }
4218
4218
  function toTextSpace(layer, p) {
4219
- return _chunkTHXFU3JBcjs.applyMatrix.call(void 0, _chunkTHXFU3JBcjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4219
+ return _chunkKCMV2534cjs.applyMatrix.call(void 0, _chunkKCMV2534cjs.invertMatrix.call(void 0, textMatrix(layer)), p);
4220
4220
  }
4221
4221
  function typeFromAnnotation(a) {
4222
4222
  if (a.type !== "text") return null;
@@ -4230,7 +4230,7 @@ function typeFromAnnotation(a) {
4230
4230
  if (op !== 1) style.opacity = op;
4231
4231
  const text3 = t.text.replace(/\r?\n|\r/g, " ");
4232
4232
  const translate = [1, 0, 0, 1, t.x, t.y];
4233
- const transform = t.rotation ? _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, translate, _chunkTHXFU3JBcjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4233
+ const transform = t.rotation ? _chunkKCMV2534cjs.multiplyMatrices.call(void 0, translate, _chunkKCMV2534cjs.rotateMatrix.call(void 0, t.rotation, { x: t.x, y: t.y })) : translate;
4234
4234
  return { text: text3, runs: [{ length: text3.length, style }], frame: { kind: "point", origin: "top" }, transform };
4235
4235
  }
4236
4236
  function annotationOfType(layer) {
@@ -4564,7 +4564,7 @@ function identityTransform(box2) {
4564
4564
  }
4565
4565
  function cornersFromMatrix(box2, m) {
4566
4566
  const q2 = _chunkQT26RHKKcjs.boxQuad.call(void 0, box2);
4567
- return [_chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[0]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[1]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[2]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[3])];
4567
+ return [_chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[0]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[1]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[2]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[3])];
4568
4568
  }
4569
4569
  function matrixFromCorners(box2, corners, eps = 1e-6) {
4570
4570
  const [tl, tr, br, bl] = corners;
@@ -4581,7 +4581,7 @@ function transformHomography(geometry) {
4581
4581
  function hasWarp(geometry) {
4582
4582
  const w = geometry.warp;
4583
4583
  if (!w) return false;
4584
- const id = _chunkTHXFU3JBcjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4584
+ const id = _chunkKCMV2534cjs.identityWarpMesh.call(void 0, geometry.box, w.us.length - 1, w.vs.length - 1);
4585
4585
  if (id.points.length !== w.points.length || id.us.some((u, i) => Math.abs(u - w.us[i]) > 1e-12) || id.vs.some((v, i) => Math.abs(v - w.vs[i]) > 1e-12)) return true;
4586
4586
  return w.points.some((p, i) => Math.abs(p.x - id.points[i].x) > 1e-6 || Math.abs(p.y - id.points[i].y) > 1e-6);
4587
4587
  }
@@ -4596,7 +4596,7 @@ function transformMap(geometry) {
4596
4596
  const { box: box2 } = geometry;
4597
4597
  const warp = hasWarp(geometry) ? geometry.warp : null;
4598
4598
  if (!warp) return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p);
4599
- return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkTHXFU3JBcjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4599
+ return (p) => _chunkQT26RHKKcjs.applyHomography.call(void 0, h, _chunkKCMV2534cjs.evalWarpMesh.call(void 0, warp, (p.x - box2.x) / box2.width, (p.y - box2.y) / box2.height));
4600
4600
  }
4601
4601
  function transformedPoint(geometry, fx, fy) {
4602
4602
  const f = transformMap(geometry);
@@ -4640,8 +4640,8 @@ function matrixFromParams(box2, params) {
4640
4640
  const tx = Math.tan((_nullishCoalesce(params.skewX, () => ( 0))) * Math.PI / 180);
4641
4641
  const ty = Math.tan((_nullishCoalesce(params.skewY, () => ( 0))) * Math.PI / 180);
4642
4642
  const ref = referencePoint(box2, params.reference);
4643
- const linear = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkTHXFU3JBcjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4644
- return _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, _chunkTHXFU3JBcjs.matrixAbout.call(void 0, linear, ref), _chunkTHXFU3JBcjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4643
+ const linear = _chunkKCMV2534cjs.multiplyMatrices.call(void 0, _chunkKCMV2534cjs.multiplyMatrices.call(void 0, [1, ty, tx, 1, 0, 0], [sx, 0, 0, sy, 0, 0]), _chunkKCMV2534cjs.rotateMatrix.call(void 0, _nullishCoalesce(params.rotate, () => ( 0))));
4644
+ return _chunkKCMV2534cjs.multiplyMatrices.call(void 0, _chunkKCMV2534cjs.matrixAbout.call(void 0, linear, ref), _chunkKCMV2534cjs.translateMatrix.call(void 0, _nullishCoalesce(params.dx, () => ( 0)), _nullishCoalesce(params.dy, () => ( 0))));
4645
4645
  }
4646
4646
  function describeTransform(geometry, reference = "center") {
4647
4647
  const m = hasWarp(geometry) ? null : matrixFromCorners(geometry.box, geometry.corners);
@@ -4658,7 +4658,7 @@ function describeTransform(geometry, reference = "center") {
4658
4658
  const shear = sxAbs ? (a * c + b * d) / sxAbs : 0;
4659
4659
  const sy = sxAbs ? (a * d - b * c) / sxAbs : 0;
4660
4660
  const skew = sxAbs ? Math.atan(shear / sxAbs) * 180 / Math.PI : 0;
4661
- const at = _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, ref);
4661
+ const at = _chunkKCMV2534cjs.applyMatrix.call(void 0, m, ref);
4662
4662
  const clean = (v) => Math.abs(v) < 1e-9 ? 0 : v;
4663
4663
  return {
4664
4664
  affine: true,
@@ -4676,24 +4676,24 @@ function applyParams(geometry, params) {
4676
4676
  const ref = params.reference && typeof params.reference === "object" ? params.reference : anchorPoint(geometry, _nullishCoalesce(params.reference, () => ( "center")));
4677
4677
  const m = matrixFromParams({ x: ref.x, y: ref.y, width: 0, height: 0 }, { ...params, reference: ref });
4678
4678
  const c = geometry.corners;
4679
- return [_chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, c[0]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, c[1]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, c[2]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, c[3])];
4679
+ return [_chunkKCMV2534cjs.applyMatrix.call(void 0, m, c[0]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, c[1]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, c[2]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, c[3])];
4680
4680
  }
4681
4681
  function flipCorners(geometry, axis) {
4682
4682
  const c = anchorPoint(geometry, "center");
4683
4683
  const m = axis === "horizontal" ? [-1, 0, 0, 1, 2 * c.x, 0] : [1, 0, 0, -1, 0, 2 * c.y];
4684
4684
  const q2 = geometry.corners;
4685
- return [_chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[0]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[1]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[2]), _chunkTHXFU3JBcjs.applyMatrix.call(void 0, m, q2[3])];
4685
+ return [_chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[0]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[1]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[2]), _chunkKCMV2534cjs.applyMatrix.call(void 0, m, q2[3])];
4686
4686
  }
4687
4687
  function boxPointOf(geometry, p) {
4688
4688
  const m = matrixFromCorners(geometry.box, geometry.corners);
4689
- if (m) return _chunkTHXFU3JBcjs.applyMatrix.call(void 0, _chunkTHXFU3JBcjs.invertMatrix.call(void 0, m), p);
4689
+ if (m) return _chunkKCMV2534cjs.applyMatrix.call(void 0, _chunkKCMV2534cjs.invertMatrix.call(void 0, m), p);
4690
4690
  return null;
4691
4691
  }
4692
4692
  function presetWarp(box2, preset) {
4693
- return _chunkTHXFU3JBcjs.warpPresetMesh.call(void 0, preset, box2);
4693
+ return _chunkKCMV2534cjs.warpPresetMesh.call(void 0, preset, box2);
4694
4694
  }
4695
4695
  function isValidWarp(mesh) {
4696
- return _chunkTHXFU3JBcjs.isValidWarpMesh.call(void 0, mesh);
4696
+ return _chunkKCMV2534cjs.isValidWarpMesh.call(void 0, mesh);
4697
4697
  }
4698
4698
  function geometryHomography(geometry) {
4699
4699
  const m = matrixFromCorners(geometry.box, geometry.corners);
@@ -4972,7 +4972,7 @@ function normalizePlacement(raw, contents) {
4972
4972
  }
4973
4973
  const out = { corners: c.map((p) => ({ x: p.x, y: p.y })) };
4974
4974
  if (raw.warp) {
4975
- if (!_chunkTHXFU3JBcjs.isValidWarpMesh.call(void 0, raw.warp)) fail4("warp must be a mesh with us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels.");
4975
+ if (!_chunkKCMV2534cjs.isValidWarpMesh.call(void 0, raw.warp)) fail4("warp must be a mesh with us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels.");
4976
4976
  out.warp = { us: [...raw.warp.us], vs: [...raw.warp.vs], points: raw.warp.points.map((p) => ({ x: p.x, y: p.y })) };
4977
4977
  }
4978
4978
  if (raw.interpolation !== void 0) {
@@ -5076,7 +5076,7 @@ function translateLayer(layer, dx, dy) {
5076
5076
  case "shape": {
5077
5077
  const next = {
5078
5078
  ...layer,
5079
- components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkTHXFU3JBcjs.translateMatrix.call(void 0, dx, dy)),
5079
+ components: transformShapeComponents(layer.components, (p) => ({ x: p.x + dx, y: p.y + dy }), _chunkKCMV2534cjs.translateMatrix.call(void 0, dx, dy)),
5080
5080
  surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy),
5081
5081
  mask: moveMask(layer.mask)
5082
5082
  };
@@ -5085,7 +5085,7 @@ function translateLayer(layer, dx, dy) {
5085
5085
  return next;
5086
5086
  }
5087
5087
  case "type": {
5088
- const next = { ...transformTypeLayer(layer, _chunkTHXFU3JBcjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5088
+ const next = { ...transformTypeLayer(layer, _chunkKCMV2534cjs.translateMatrix.call(void 0, dx, dy)), surface: _chunk474IQG74cjs.translateSurface.call(void 0, layer.surface, dx, dy), mask: moveMask(layer.mask) };
5089
5089
  if (!next.mask) delete next.mask;
5090
5090
  return next;
5091
5091
  }
@@ -5271,7 +5271,7 @@ function refitPlacement(layer, contents) {
5271
5271
  });
5272
5272
  const out = { corners: pts };
5273
5273
  if (layer.placement.interpolation) out.interpolation = layer.placement.interpolation;
5274
- if (layer.placement.warp) out.warp = _chunkTHXFU3JBcjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5274
+ if (layer.placement.warp) out.warp = _chunkKCMV2534cjs.mapWarpMeshPoints.call(void 0, layer.placement.warp, (p) => ({ x: p.x * W1 / W0, y: p.y * H1 / H0 }));
5275
5275
  return out;
5276
5276
  }
5277
5277
  function normalizeSmartFilter(raw, id = newLayerId("flt")) {
@@ -5648,7 +5648,7 @@ function readType(r, base, ctx) {
5648
5648
  const text3 = normalizeText(_nullishCoalesce(r.text, () => ( "")));
5649
5649
  const runs = (Array.isArray(r.runs) ? r.runs : []).map((run, i) => ({
5650
5650
  length: Math.max(0, Math.floor(num2(_optionalChain([run, 'optionalAccess', _166 => _166.length]), 0, 1e9, 0))),
5651
- style: patchTextStyle(_chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _167 => _167.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5651
+ style: patchTextStyle(_chunkKCMV2534cjs.DEFAULT_TEXT_STYLE, _optionalChain([run, 'optionalAccess', _167 => _167.style]) && typeof run.style === "object" ? run.style : {}, `runs[${i}].style`)
5652
5652
  }));
5653
5653
  const paragraphs = (Array.isArray(r.paragraphs) ? r.paragraphs : []).map((p, i) => ({
5654
5654
  length: Math.max(0, Math.floor(num2(_optionalChain([p, 'optionalAccess', _168 => _168.length]), 0, 1e9, 0))),
@@ -5661,13 +5661,13 @@ function readType(r, base, ctx) {
5661
5661
  ...base,
5662
5662
  type: "type",
5663
5663
  text: text3,
5664
- runs: _chunkTHXFU3JBcjs.fitRuns.call(void 0, runs, text3.length, _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE),
5665
- paragraphs: _chunkTHXFU3JBcjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5664
+ runs: _chunkKCMV2534cjs.fitRuns.call(void 0, runs, text3.length, _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE),
5665
+ paragraphs: _chunkKCMV2534cjs.fitParagraphRuns.call(void 0, paragraphs.length ? paragraphs : [{ length: text3.length, style: {} }], text3),
5666
5666
  frame,
5667
5667
  surface: _chunk474IQG74cjs.emptySurface.call(void 0, 4),
5668
5668
  offset: { x: 0, y: 0 }
5669
5669
  };
5670
- if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _172 => _172[0], 'optionalAccess', _173 => _173.style]), () => ( _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE)) }];
5670
+ if (!layer.runs.length) layer.runs = [{ length: 0, style: _nullishCoalesce(_optionalChain([runs, 'access', _172 => _172[0], 'optionalAccess', _173 => _173.style]), () => ( _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE)) }];
5671
5671
  if (m) layer.transform = m;
5672
5672
  if (r.orientation === "vertical") layer.orientation = "vertical";
5673
5673
  if (r.antiAlias === false) layer.antiAlias = false;
@@ -6137,7 +6137,7 @@ function readSmartObject(r, base, ctx) {
6137
6137
  let placement;
6138
6138
  try {
6139
6139
  const raw = { corners: p.corners };
6140
- if (p.warp && _chunkTHXFU3JBcjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6140
+ if (p.warp && _chunkKCMV2534cjs.isValidWarpMesh.call(void 0, p.warp)) raw.warp = p.warp;
6141
6141
  if (_chunkHB4ICNNAcjs.isInterpolation.call(void 0, p.interpolation)) raw.interpolation = p.interpolation;
6142
6142
  placement = normalizePlacement(raw, contents);
6143
6143
  } catch (e) {
@@ -7308,7 +7308,7 @@ function vectorBlockForComponents(components, inverted, width, height, flags = 0
7308
7308
  const fr = (p) => ({ x: p.x / w, y: p.y / h });
7309
7309
  const subpaths = [];
7310
7310
  components.forEach((c, ci) => {
7311
- _chunkTHXFU3JBcjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7311
+ _chunkKCMV2534cjs.expandVectorCorners.call(void 0, c.subpaths).forEach((sp, si) => {
7312
7312
  if (!sp.anchors.length) return;
7313
7313
  subpaths.push({
7314
7314
  closed: sp.closed,
@@ -8134,7 +8134,7 @@ function merged(levels) {
8134
8134
  function charStyle(d, fonts, notes, vertical = false) {
8135
8135
  const n = (k) => eNum(eGet(d, k));
8136
8136
  const flag = (k) => eBool(eGet(d, k));
8137
- const s = { ..._chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE };
8137
+ const s = { ..._chunkKCMV2534cjs.DEFAULT_TEXT_STYLE };
8138
8138
  const fi = n("Font");
8139
8139
  const ps = fi !== void 0 ? fonts[fi] : void 0;
8140
8140
  if (ps) {
@@ -8219,7 +8219,7 @@ function typeFromTySh(data, notes) {
8219
8219
  }
8220
8220
  const edText = _nullishCoalesce(eStr(ePath(_nullishCoalesce(engine, () => ( void 0)), ["EngineDict", "Editor", "Text"])), () => ( ""));
8221
8221
  const text3 = (_nullishCoalesce(txt, () => ( edText.replace(/\r$/, "")))).replace(/\r\n?/g, "\n");
8222
- let runs = [{ length: text3.length, style: { ..._chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE } }];
8222
+ let runs = [{ length: text3.length, style: { ..._chunkKCMV2534cjs.DEFAULT_TEXT_STYLE } }];
8223
8223
  let paragraphs = [{ length: text3.length, style: {} }];
8224
8224
  let frame = { kind: "point" };
8225
8225
  let transform = t.transform;
@@ -8275,14 +8275,14 @@ function typeFromTySh(data, notes) {
8275
8275
  const b = eArray(ePath(shape, ["Cookie", "Photoshop", "BoxBounds"])).map((v) => _nullishCoalesce(eNum(v), () => ( 0)));
8276
8276
  if (b.length === 4 && b[2] > b[0] && b[3] > b[1]) {
8277
8277
  frame = { kind: "box", width: b[2] - b[0], height: b[3] - b[1] };
8278
- transform = _chunkTHXFU3JBcjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
8278
+ transform = _chunkKCMV2534cjs.multiplyMatrices.call(void 0, [1, 0, 0, 1, b[0], b[1]], t.transform);
8279
8279
  }
8280
8280
  }
8281
8281
  }
8282
8282
  return {
8283
8283
  text: text3,
8284
- runs: _chunkTHXFU3JBcjs.fitRuns.call(void 0, runs, text3.length, _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE),
8285
- paragraphs: _chunkTHXFU3JBcjs.fitParagraphRuns.call(void 0, paragraphs, text3),
8284
+ runs: _chunkKCMV2534cjs.fitRuns.call(void 0, runs, text3.length, _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE),
8285
+ paragraphs: _chunkKCMV2534cjs.fitParagraphRuns.call(void 0, paragraphs, text3),
8286
8286
  frame,
8287
8287
  orientation: vertical ? "vertical" : "horizontal",
8288
8288
  transform,
@@ -8358,7 +8358,7 @@ function buildEngineData(layer, template) {
8358
8358
  fonts.push(ps);
8359
8359
  return fonts.length - 1;
8360
8360
  };
8361
- const runs = _chunkTHXFU3JBcjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE);
8361
+ const runs = _chunkKCMV2534cjs.fitRuns.call(void 0, layer.runs, layer.text.length, _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE);
8362
8362
  const vertical = layer.orientation === "vertical";
8363
8363
  const sruns = [];
8364
8364
  const slens = [];
@@ -8367,10 +8367,10 @@ function buildEngineData(layer, template) {
8367
8367
  slens.push(E.int(r.length + (i === runs.length - 1 ? 1 : 0)));
8368
8368
  });
8369
8369
  if (!runs.length) {
8370
- sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE)))]])]]));
8370
+ sruns.push(E.dict([["StyleSheet", E.dict([["StyleSheetData", styleSheetData(_chunkKCMV2534cjs.DEFAULT_TEXT_STYLE, fontIndex(postScriptFor(_chunkKCMV2534cjs.DEFAULT_TEXT_STYLE)))]])]]));
8371
8371
  slens.push(E.int(1));
8372
8372
  }
8373
- const paras = _chunkTHXFU3JBcjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
8373
+ const paras = _chunkKCMV2534cjs.fitParagraphRuns.call(void 0, layer.paragraphs, layer.text);
8374
8374
  const pruns = [];
8375
8375
  const plens = [];
8376
8376
  paras.forEach((p, i) => {
@@ -8426,7 +8426,7 @@ function buildEngineData(layer, template) {
8426
8426
  eSet(e, key, rd);
8427
8427
  }
8428
8428
  eSet(rd, "FontSet", fontSet);
8429
- if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _248 => _248[0], 'optionalAccess', _249 => _249.style]), () => ( _chunkTHXFU3JBcjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8429
+ if (!eGet(rd, "StyleSheetSet")) eSet(rd, "StyleSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["StyleSheetData", styleSheetData(_nullishCoalesce(_optionalChain([runs, 'access', _248 => _248[0], 'optionalAccess', _249 => _249.style]), () => ( _chunkKCMV2534cjs.DEFAULT_TEXT_STYLE)), 0)]])]));
8430
8430
  if (!eGet(rd, "ParagraphSheetSet")) eSet(rd, "ParagraphSheetSet", E.array([E.dict([["Name", E.str("Normal RGB")], ["DefaultStyleSheet", E.int(0)], ["Properties", paragraphProperties({})]])]));
8431
8431
  if (!eGet(rd, "TheNormalStyleSheet")) eSet(rd, "TheNormalStyleSheet", E.int(0));
8432
8432
  if (!eGet(rd, "TheNormalParagraphSheet")) eSet(rd, "TheNormalParagraphSheet", E.int(0));
@@ -8437,13 +8437,13 @@ function inkBounds2(layer) {
8437
8437
  if (layer.frame.kind === "box") return [0, 0, layer.frame.width, layer.frame.height];
8438
8438
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
8439
8439
  if (!b) return [0, 0, 0, 0];
8440
- const inv = _chunkTHXFU3JBcjs.invertMatrix.call(void 0, textMatrix(layer));
8440
+ const inv = _chunkKCMV2534cjs.invertMatrix.call(void 0, textMatrix(layer));
8441
8441
  const pts = [
8442
8442
  { x: b.x, y: b.y },
8443
8443
  { x: b.x + b.width, y: b.y },
8444
8444
  { x: b.x + b.width, y: b.y + b.height },
8445
8445
  { x: b.x, y: b.y + b.height }
8446
- ].map((p) => _chunkTHXFU3JBcjs.applyMatrix.call(void 0, inv, p));
8446
+ ].map((p) => _chunkKCMV2534cjs.applyMatrix.call(void 0, inv, p));
8447
8447
  return [Math.min(...pts.map((p) => p.x)), Math.min(...pts.map((p) => p.y)), Math.max(...pts.map((p) => p.x)), Math.max(...pts.map((p) => p.y))];
8448
8448
  }
8449
8449
  function tyShForLayer(layer) {
@@ -8724,7 +8724,7 @@ function filterMaskItem(placed, mask, area) {
8724
8724
  var warpStyleOf = (name) => {
8725
8725
  if (!name.startsWith("warp")) return null;
8726
8726
  const s = _optionalChain([name, 'access', _263 => _263[4], 'optionalAccess', _264 => _264.toLowerCase, 'call', _265 => _265()]) + name.slice(5);
8727
- return _chunkTHXFU3JBcjs.WARP_STYLES.includes(s) ? s : null;
8727
+ return _chunkKCMV2534cjs.WARP_STYLES.includes(s) ? s : null;
8728
8728
  };
8729
8729
  function warpFromDescriptor(w, contents) {
8730
8730
  const full = { x: 0, y: 0, width: contents.width, height: contents.height };
@@ -8754,7 +8754,7 @@ function warpFromDescriptor(w, contents) {
8754
8754
  } else {
8755
8755
  const style = warpStyleOf(styleName);
8756
8756
  if (!style) return void 0;
8757
- mesh = _chunkTHXFU3JBcjs.warpPresetMesh.call(void 0,
8757
+ mesh = _chunkKCMV2534cjs.warpPresetMesh.call(void 0,
8758
8758
  {
8759
8759
  style,
8760
8760
  bend: _nullishCoalesce(descNumber(w, "warpValue"), () => ( 0)),
@@ -8769,7 +8769,7 @@ function warpFromDescriptor(w, contents) {
8769
8769
  const same = Math.abs(bounds.x) < 1e-6 && Math.abs(bounds.y) < 1e-6 && Math.abs(bounds.width - contents.width) < 1e-6 && Math.abs(bounds.height - contents.height) < 1e-6;
8770
8770
  if (!same) {
8771
8771
  const m = mesh;
8772
- mesh = _chunkTHXFU3JBcjs.fitWarpMesh.call(void 0, (s, t) => _chunkTHXFU3JBcjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
8772
+ mesh = _chunkKCMV2534cjs.fitWarpMesh.call(void 0, (s, t) => _chunkKCMV2534cjs.evalWarpMesh.call(void 0, m, (s * contents.width - bounds.x) / bounds.width, (t * contents.height - bounds.y) / bounds.height), [0, 1], [0, 1]);
8773
8773
  }
8774
8774
  return { mesh, frame };
8775
8775
  }
@@ -10361,7 +10361,7 @@ function importSmart(ctx, rec, name, notes, props) {
10361
10361
  if (placement && (size.width !== contents.width || size.height !== contents.height)) {
10362
10362
  const kx = contents.width / size.width;
10363
10363
  const ky = contents.height / size.height;
10364
- if (placement.warp) placement = { ...placement, warp: _chunkTHXFU3JBcjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10364
+ if (placement.warp) placement = { ...placement, warp: _chunkKCMV2534cjs.mapWarpMeshPoints.call(void 0, placement.warp, (p) => ({ x: p.x * kx, y: p.y * ky })) };
10365
10365
  }
10366
10366
  }
10367
10367
  if (!contents || !placement) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BUILTIN_BRUSHES
3
- } from "./chunk-PJYG6FCF.js";
3
+ } from "./chunk-XBZK47LV.js";
4
4
  import {
5
5
  parseProvenance
6
6
  } from "./chunk-M6DNZNVY.js";