@pixerate/editor 0.250.0 → 0.251.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 (123) hide show
  1. package/dist/agent/index.cjs +40 -41
  2. package/dist/agent/index.js +9 -10
  3. package/dist/animation/index.cjs +6 -7
  4. package/dist/animation/index.js +5 -6
  5. package/dist/animation-editor/index.cjs +70 -70
  6. package/dist/animation-editor/index.js +12 -12
  7. package/dist/brushes/index.cjs +1406 -0
  8. package/dist/brushes/index.d.cts +12 -0
  9. package/dist/brushes/index.d.ts +12 -0
  10. package/dist/brushes/index.js +1406 -0
  11. package/dist/brushes/migrate.d.cts +17 -0
  12. package/dist/brushes/migrate.d.ts +17 -0
  13. package/dist/brushes/normalize.d.cts +15 -0
  14. package/dist/brushes/normalize.d.ts +15 -0
  15. package/dist/brushes/presets.d.cts +12 -0
  16. package/dist/brushes/presets.d.ts +12 -0
  17. package/dist/brushes/resolve.d.cts +56 -0
  18. package/dist/brushes/resolve.d.ts +56 -0
  19. package/dist/brushes/schema.d.cts +29 -0
  20. package/dist/brushes/schema.d.ts +29 -0
  21. package/dist/brushes/types.d.cts +323 -0
  22. package/dist/brushes/types.d.ts +323 -0
  23. package/dist/{brushstrokeRender-2FHFLSEG.js → brushstrokeRender-5PYSKZIJ.js} +8 -8
  24. package/dist/{brushstrokeRender-QGRXOKDA.cjs → brushstrokeRender-7FLLSQEC.cjs} +14 -14
  25. package/dist/canvas/index.cjs +57 -58
  26. package/dist/canvas/index.js +31 -32
  27. package/dist/chart/index.cjs +159 -160
  28. package/dist/chart/index.js +9 -10
  29. package/dist/{chunk-NOHJP5TK.js → chunk-2ZJ4DT3M.js} +1 -1
  30. package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
  31. package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  32. package/dist/{chunk-SMSGP2HQ.js → chunk-5JNA6LLY.js} +1 -1
  33. package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
  34. package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
  35. package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
  36. package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
  37. package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
  38. package/dist/{chunk-NTRAVM2I.js → chunk-7P6VF3FG.js} +2 -2
  39. package/dist/chunk-APX63ILU.js +173 -0
  40. package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
  41. package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
  42. package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
  43. package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
  44. package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
  45. package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
  46. package/dist/{chunk-KDLBJ6QR.js → chunk-GYMMNCFT.js} +3 -3
  47. package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
  48. package/dist/chunk-HS6QDWDF.cjs +1029 -0
  49. package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
  50. package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
  51. package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
  52. package/dist/{chunk-M2VKFE5L.cjs → chunk-JFHBXNR2.cjs} +88 -88
  53. package/dist/{chunk-WPUXGDH4.cjs → chunk-JPEHXIB5.cjs} +10 -10
  54. package/dist/chunk-JSDND7DF.cjs +173 -0
  55. package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
  56. package/dist/{chunk-YW43M56C.cjs → chunk-LFMKWGFL.cjs} +1 -1
  57. package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
  58. package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
  59. package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
  60. package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
  61. package/dist/chunk-MTKY6K3Q.js +1029 -0
  62. package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
  63. package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
  64. package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
  65. package/dist/chunk-PXDIAYB6.cjs +594 -0
  66. package/dist/{chunk-3TWOCSCY.js → chunk-QC3OXRE4.js} +9 -9
  67. package/dist/{chunk-YM6ZBTXG.cjs → chunk-QLSGTCYT.cjs} +23 -23
  68. package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
  69. package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
  70. package/dist/{chunk-ATK6ABN3.cjs → chunk-SABJMH6M.cjs} +145 -12
  71. package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
  72. package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
  73. package/dist/{chunk-X7WRL5ZZ.cjs → chunk-TLOGFIIV.cjs} +37 -37
  74. package/dist/chunk-TXFWZ5ZJ.js +594 -0
  75. package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
  76. package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
  77. package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
  78. package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
  79. package/dist/{chunk-U4NUOKBT.js → chunk-WZOGDKCQ.js} +134 -1
  80. package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
  81. package/dist/color/index.cjs +4 -6
  82. package/dist/color/index.js +7 -9
  83. package/dist/export/index.cjs +7 -8
  84. package/dist/export/index.js +6 -7
  85. package/dist/extensions/index.cjs +10 -11
  86. package/dist/extensions/index.js +9 -10
  87. package/dist/gradient/index.cjs +33 -34
  88. package/dist/gradient/index.js +4 -5
  89. package/dist/image-editor/index.cjs +845 -844
  90. package/dist/image-editor/index.js +39 -38
  91. package/dist/index.cjs +16 -17
  92. package/dist/index.js +10 -11
  93. package/dist/paint/index.cjs +6 -4
  94. package/dist/paint/index.js +21 -19
  95. package/dist/paint-editor/brushes.d.cts +1 -2
  96. package/dist/paint-editor/brushes.d.ts +1 -2
  97. package/dist/paint-editor/index.cjs +2193 -694
  98. package/dist/paint-editor/index.js +1575 -76
  99. package/dist/paint-editor/mark-settings.d.cts +104 -0
  100. package/dist/paint-editor/mark-settings.d.ts +104 -0
  101. package/dist/paint-editor/procedural.d.cts +2 -75
  102. package/dist/paint-editor/procedural.d.ts +2 -75
  103. package/dist/paint-editor/stickers.d.cts +1 -22
  104. package/dist/paint-editor/stickers.d.ts +1 -22
  105. package/dist/raster/index.cjs +2 -2
  106. package/dist/raster/index.js +9 -9
  107. package/dist/stickers/index.cjs +10 -10
  108. package/dist/stickers/index.js +9 -9
  109. package/dist/tokens/index.cjs +3 -4
  110. package/dist/tokens/index.js +2 -3
  111. package/dist/typography/index.cjs +7 -8
  112. package/dist/typography/index.js +2 -3
  113. package/dist/vector/index.cjs +974 -974
  114. package/dist/vector/index.js +12 -12
  115. package/dist/video-editor/index.cjs +6 -7
  116. package/dist/video-editor/index.js +5 -6
  117. package/package.json +11 -1
  118. package/dist/chunk-4JNWA3VT.cjs +0 -302
  119. package/dist/chunk-7AHBW2CQ.cjs +0 -200
  120. package/dist/chunk-F67XMVDI.js +0 -200
  121. package/dist/chunk-GT77U7QG.cjs +0 -2637
  122. package/dist/chunk-OTEPAQJX.js +0 -2637
  123. package/dist/chunk-WKH5ZAUA.js +0 -302
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- var _chunk3R5P3DVYcjs = require('./chunk-3R5P3DVY.cjs');
11
+ var _chunkWRZ6C4TUcjs = require('./chunk-WRZ6C4TU.cjs');
12
12
 
13
13
  // src/chart/ooxml.ts
14
14
  var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
@@ -111,11 +111,11 @@ function chartFromOoxml(xml, options = {}) {
111
111
  try {
112
112
  doc = new (parser(options))().parseFromString(xml, "application/xml");
113
113
  } catch (error) {
114
- return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
114
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
115
115
  }
116
116
  const root = doc.documentElement;
117
117
  if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
118
- return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
118
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
119
119
  }
120
120
  if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
121
121
  const chart = kid(root, "chart");
@@ -280,7 +280,7 @@ function chartFromOoxml(xml, options = {}) {
280
280
  }
281
281
  if (!types.length) {
282
282
  issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
283
- return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
283
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
284
284
  }
285
285
  const first = types[0];
286
286
  const combo = types.some((t) => t !== first);
@@ -290,14 +290,14 @@ function chartFromOoxml(xml, options = {}) {
290
290
  if (!combo) {
291
291
  for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
292
292
  }
293
- if (types.some((t) => !_chunk3R5P3DVYcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
293
+ if (types.some((t) => !_chunkWRZ6C4TUcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
294
294
  input.series = series;
295
295
  input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
296
296
  input.stacking = stacking;
297
297
  input.orientation = orientation;
298
298
  input.dataLabels = dataLabels;
299
299
  input.points = points || first !== "line";
300
- if (bool(val(groups[0], "varyColors")) && !combo && _chunk3R5P3DVYcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
300
+ if (bool(val(groups[0], "varyColors")) && !combo && _chunkWRZ6C4TUcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
301
301
  const readAxis = (a, fallback) => {
302
302
  const axis = { ...fallback, format: {} };
303
303
  if (!a) return axis;
@@ -324,12 +324,12 @@ function chartFromOoxml(xml, options = {}) {
324
324
  };
325
325
  const xy = first === "scatter" || first === "bubble";
326
326
  const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
327
- input.xAxis = readAxis(catAxis, _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, false));
327
+ input.xAxis = readAxis(catAxis, _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, false));
328
328
  if (kid(plot, "dateAx")) input.xAxis.kind = "date";
329
- input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, true));
329
+ input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, true));
330
330
  const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
331
- if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, false));
332
- const { spec, issues: specIssues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
331
+ if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunkWRZ6C4TUcjs.defaultChartAxis.call(void 0, false));
332
+ const { spec, issues: specIssues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
333
333
  issues.push(...specIssues);
334
334
  const uniq = [...new Set(unsupported)];
335
335
  return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
@@ -382,7 +382,7 @@ function readChartex(root, issues, unsupported) {
382
382
  const type = layouts[layout];
383
383
  if (!type) {
384
384
  issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
385
- return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
385
+ return { spec: _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
386
386
  }
387
387
  if (layout === "paretoLine") unsupported.push("pareto line");
388
388
  const series = [];
@@ -409,18 +409,18 @@ function readChartex(root, issues, unsupported) {
409
409
  const first = data.get(_nullishCoalesce(_optionalChain([kid, 'call', _35 => _35(seriesEls[0], "dataId"), 'optionalAccess', _36 => _36.getAttribute, 'call', _37 => _37("val")]), () => ( "0")));
410
410
  if ((type === "treemap" || type === "sunburst") && _optionalChain([first, 'optionalAccess', _38 => _38.paths])) {
411
411
  const treeIssues = [];
412
- input.tree = _chunk3R5P3DVYcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
412
+ input.tree = _chunkWRZ6C4TUcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
413
413
  for (const t of treeIssues) issues.push({ path: "chartData", message: t.message });
414
414
  }
415
- const { spec, issues: specIssues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
415
+ const { spec, issues: specIssues } = _chunkWRZ6C4TUcjs.normalizeChartSpec.call(void 0, input);
416
416
  issues.push(...specIssues);
417
417
  return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
418
418
  }
419
419
  var esc = (s) => s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
420
420
  var hex = (color) => {
421
421
  if (!color) return null;
422
- const rgb = _chunk3R5P3DVYcjs.parseChartColor.call(void 0, color);
423
- return rgb ? _chunk3R5P3DVYcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
422
+ const rgb = _chunkWRZ6C4TUcjs.parseChartColor.call(void 0, color);
423
+ return rgb ? _chunkWRZ6C4TUcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
424
424
  };
425
425
  var fillXml = (color, line = false) => {
426
426
  const h = hex(color);
@@ -464,7 +464,7 @@ function errBarsXml(bars, dir) {
464
464
  var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
465
465
  function chartToOoxml(spec) {
466
466
  const issues = [];
467
- const family = _chunk3R5P3DVYcjs.chartFamily.call(void 0, spec);
467
+ const family = _chunkWRZ6C4TUcjs.chartFamily.call(void 0, spec);
468
468
  let type = spec.type;
469
469
  if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
470
470
  issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
@@ -512,7 +512,7 @@ function chartToOoxml(spec) {
512
512
  const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
513
513
  const xy = family === "xy" || type === "scatter" || type === "bubble";
514
514
  const pieLike = type === "pie" || type === "donut";
515
- const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunk3R5P3DVYcjs.chartSeriesType.call(void 0, { type }, s);
515
+ const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunkWRZ6C4TUcjs.chartSeriesType.call(void 0, { type }, s);
516
516
  const groups = [];
517
517
  visible.forEach((s) => {
518
518
  const kind = typed(s);
@@ -575,7 +575,7 @@ function chartToOoxml(spec) {
575
575
  return `<c:ser>${parts.join("")}</c:ser>`;
576
576
  };
577
577
  const dLbls = `<c:dLbls><c:showLegendKey val="0"/><c:showVal val="${spec.dataLabels ? 1 : 0}"/><c:showCatName val="0"/><c:showSerName val="0"/><c:showPercent val="0"/><c:showBubbleSize val="0"/></c:dLbls>`;
578
- const vary = _chunk3R5P3DVYcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
578
+ const vary = _chunkWRZ6C4TUcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
579
579
  const groupXml = groups.map((g) => {
580
580
  const axes2 = g.secondary ? `<c:axId val="${ids.cat2}"/><c:axId val="${ids.val2}"/>` : `<c:axId val="${ids.cat}"/><c:axId val="${ids.val}"/>`;
581
581
  const sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join("");
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  contrastRatio,
10
10
  parseColor
11
- } from "./chunk-JEGJP4OW.js";
11
+ } from "./chunk-MHLU6GRJ.js";
12
12
 
13
13
  // src/tokens/types.ts
14
14
  var TOKEN_TYPES = ["color", "number", "string", "boolean"];
@@ -4,20 +4,18 @@
4
4
 
5
5
 
6
6
 
7
- var _chunk7PT4RJL5cjs = require('./chunk-7PT4RJL5.cjs');
7
+ var _chunkEUIDTZNQcjs = require('./chunk-EUIDTZNQ.cjs');
8
8
 
9
9
 
10
10
 
11
11
 
12
- var _chunkPPFJHTW5cjs = require('./chunk-PPFJHTW5.cjs');
12
+ var _chunkTFF2GTGNcjs = require('./chunk-TFF2GTGN.cjs');
13
13
 
14
14
 
15
15
 
16
- var _chunkRD7RX52Gcjs = require('./chunk-RD7RX52G.cjs');
17
16
 
18
17
 
19
-
20
- var _chunk7AHBW2CQcjs = require('./chunk-7AHBW2CQ.cjs');
18
+ var _chunk5UEFBM2Mcjs = require('./chunk-5UEFBM2M.cjs');
21
19
 
22
20
  // src/gradient/model.ts
23
21
  function clamp(v, min, max) {
@@ -72,9 +70,9 @@ function normalizeGradient(input) {
72
70
  const rawStop = s;
73
71
  let normColor = null;
74
72
  if (typeof rawStop.color === "string" || rawStop.color && typeof rawStop.color === "object") {
75
- const dual = _chunk7PT4RJL5cjs.normalizeDualColor.call(void 0, rawStop.color);
73
+ const dual = _chunkEUIDTZNQcjs.normalizeDualColor.call(void 0, rawStop.color);
76
74
  if (dual) {
77
- normColor = _chunk7PT4RJL5cjs.formatDualColor.call(void 0, dual);
75
+ normColor = _chunkEUIDTZNQcjs.formatDualColor.call(void 0, dual);
78
76
  }
79
77
  }
80
78
  if (!normColor) {
@@ -144,7 +142,7 @@ function createGradient(colorsOrOptions, options) {
144
142
  const stops = resolvedColors.map((color, i) => ({
145
143
  id: `s${i + 1}`,
146
144
  offset: i / (resolvedColors.length - 1),
147
- color: _chunk7PT4RJL5cjs.formatDualColor.call(void 0, _nullishCoalesce(_chunk7PT4RJL5cjs.normalizeDualColor.call(void 0, color), () => ( { light: "#000000", dark: "#000000" })))
145
+ color: _chunkEUIDTZNQcjs.formatDualColor.call(void 0, _nullishCoalesce(_chunkEUIDTZNQcjs.normalizeDualColor.call(void 0, color), () => ( { light: "#000000", dark: "#000000" })))
148
146
  }));
149
147
  const res2 = normalizeGradient({
150
148
  ...options,
@@ -196,7 +194,7 @@ function isDualColorValue(val) {
196
194
  if (typeof val === "string") {
197
195
  return val.trim().toLowerCase().startsWith("light-dark(");
198
196
  }
199
- if (_chunk7PT4RJL5cjs.isDualColor.call(void 0, val)) {
197
+ if (_chunkEUIDTZNQcjs.isDualColor.call(void 0, val)) {
200
198
  return val.light !== val.dark;
201
199
  }
202
200
  return false;
@@ -210,7 +208,7 @@ function resolveGradient(g, scheme) {
210
208
  center: g.center ? { ...g.center } : void 0,
211
209
  stops: g.stops.map((s) => ({
212
210
  ...s,
213
- color: _nullishCoalesce(_chunk7PT4RJL5cjs.resolveColor.call(void 0, s.color, scheme), () => ( s.color))
211
+ color: _nullishCoalesce(_chunkEUIDTZNQcjs.resolveColor.call(void 0, s.color, scheme), () => ( s.color))
214
212
  }))
215
213
  };
216
214
  }
@@ -238,7 +236,7 @@ function sampleGradient(g, t, scheme = "light") {
238
236
  if (s0.midpoint !== void 0) {
239
237
  u = gradientMidpointRemap(u, s0.midpoint);
240
238
  }
241
- const mixed = _chunk7PT4RJL5cjs.mixColors.call(void 0, s0.color, s1.color, u, { space: _nullishCoalesce(g.interpolation, () => ( "oklab")) });
239
+ const mixed = _chunkEUIDTZNQcjs.mixColors.call(void 0, s0.color, s1.color, u, { space: _nullishCoalesce(g.interpolation, () => ( "oklab")) });
242
240
  return _nullishCoalesce(mixed, () => ( s0.color));
243
241
  }
244
242
  function insertGradientStop(g, offset, color) {
@@ -577,12 +575,12 @@ ${stopsXml.join("\n")}
577
575
  </linearGradient>`;
578
576
  }
579
577
  function checkGradient(g, options = {}) {
580
- const dual = isDualGradient(g) || _chunk7PT4RJL5cjs.isDualColor.call(void 0, options.surface) || _chunk7PT4RJL5cjs.isDualColor.call(void 0, options.text);
578
+ const dual = isDualGradient(g) || _chunkEUIDTZNQcjs.isDualColor.call(void 0, options.surface) || _chunkEUIDTZNQcjs.isDualColor.call(void 0, options.text);
581
579
  if (dual) {
582
580
  const lightG = resolveGradient(g, "light");
583
581
  const darkG = resolveGradient(g, "dark");
584
- const lightText = options.text ? _nullishCoalesce(_chunk7PT4RJL5cjs.resolveColor.call(void 0, options.text, "light"), () => ( void 0)) : void 0;
585
- const darkText = options.text ? _nullishCoalesce(_chunk7PT4RJL5cjs.resolveColor.call(void 0, options.text, "dark"), () => ( void 0)) : void 0;
582
+ const lightText = options.text ? _nullishCoalesce(_chunkEUIDTZNQcjs.resolveColor.call(void 0, options.text, "light"), () => ( void 0)) : void 0;
583
+ const darkText = options.text ? _nullishCoalesce(_chunkEUIDTZNQcjs.resolveColor.call(void 0, options.text, "dark"), () => ( void 0)) : void 0;
586
584
  const checkScheme = (grad, txt, schemeName) => {
587
585
  const issues2 = [];
588
586
  for (let i = 0; i < grad.stops.length - 1; i++) {
@@ -590,10 +588,10 @@ function checkGradient(g, options = {}) {
590
588
  if (gap < 5e-3) {
591
589
  issues2.push(`[${schemeName}] Stops "${grad.stops[i].id}" and "${grad.stops[i + 1].id}" are too close (gap < 0.005).`);
592
590
  }
593
- const c1 = _chunkRD7RX52Gcjs.parseColor.call(void 0, grad.stops[i].color);
594
- const c2 = _chunkRD7RX52Gcjs.parseColor.call(void 0, grad.stops[i + 1].color);
591
+ const c1 = _chunk5UEFBM2Mcjs.parseColor.call(void 0, grad.stops[i].color);
592
+ const c2 = _chunk5UEFBM2Mcjs.parseColor.call(void 0, grad.stops[i + 1].color);
595
593
  if (c1 && c2 && gap < 0.05) {
596
- const dE = _chunkPPFJHTW5cjs.deltaEOK.call(void 0, c1, c2);
594
+ const dE = _chunkTFF2GTGNcjs.deltaEOK.call(void 0, c1, c2);
597
595
  if (dE > 0.5) {
598
596
  issues2.push(
599
597
  `[${schemeName}] Banding risk between stops "${grad.stops[i].id}" and "${grad.stops[i + 1].id}" (\u0394EOK = ${dE.toFixed(2)} across gap ${gap.toFixed(3)}).`
@@ -602,20 +600,20 @@ function checkGradient(g, options = {}) {
602
600
  }
603
601
  }
604
602
  for (const s of grad.stops) {
605
- const c = _chunkRD7RX52Gcjs.parseColor.call(void 0, s.color);
606
- if (c && !_chunkPPFJHTW5cjs.inSrgbGamut.call(void 0, c)) {
603
+ const c = _chunk5UEFBM2Mcjs.parseColor.call(void 0, s.color);
604
+ if (c && !_chunkTFF2GTGNcjs.inSrgbGamut.call(void 0, c)) {
607
605
  issues2.push(`[${schemeName}] Stop "${s.id}" colour ${s.color} is outside standard sRGB gamut.`);
608
606
  }
609
607
  }
610
608
  let lowest;
611
609
  if (txt) {
612
- const parsedTxt = _chunkRD7RX52Gcjs.parseColor.call(void 0, txt);
610
+ const parsedTxt = _chunk5UEFBM2Mcjs.parseColor.call(void 0, txt);
613
611
  if (parsedTxt) {
614
612
  let minRatio = Infinity;
615
613
  for (let step = 0; step <= 32; step++) {
616
- const sample = _chunkRD7RX52Gcjs.parseColor.call(void 0, sampleGradient(grad, step / 32, schemeName));
614
+ const sample = _chunk5UEFBM2Mcjs.parseColor.call(void 0, sampleGradient(grad, step / 32, schemeName));
617
615
  if (sample) {
618
- const r = _chunkRD7RX52Gcjs.contrastRatio.call(void 0, parsedTxt, sample);
616
+ const r = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, parsedTxt, sample);
619
617
  if (r < minRatio) minRatio = r;
620
618
  }
621
619
  }
@@ -637,10 +635,10 @@ function checkGradient(g, options = {}) {
637
635
  if (gap < 5e-3) {
638
636
  issues.push(`Stops "${g.stops[i].id}" and "${g.stops[i + 1].id}" are too close (gap < 0.005).`);
639
637
  }
640
- const c1 = _chunkRD7RX52Gcjs.parseColor.call(void 0, g.stops[i].color);
641
- const c2 = _chunkRD7RX52Gcjs.parseColor.call(void 0, g.stops[i + 1].color);
638
+ const c1 = _chunk5UEFBM2Mcjs.parseColor.call(void 0, g.stops[i].color);
639
+ const c2 = _chunk5UEFBM2Mcjs.parseColor.call(void 0, g.stops[i + 1].color);
642
640
  if (c1 && c2 && gap < 0.05) {
643
- const dE = _chunkPPFJHTW5cjs.deltaEOK.call(void 0, c1, c2);
641
+ const dE = _chunkTFF2GTGNcjs.deltaEOK.call(void 0, c1, c2);
644
642
  if (dE > 0.5) {
645
643
  issues.push(
646
644
  `Banding risk between stops "${g.stops[i].id}" and "${g.stops[i + 1].id}" (\u0394EOK = ${dE.toFixed(2)} across gap ${gap.toFixed(3)}).`
@@ -649,20 +647,20 @@ function checkGradient(g, options = {}) {
649
647
  }
650
648
  }
651
649
  for (const s of g.stops) {
652
- const c = _chunkRD7RX52Gcjs.parseColor.call(void 0, s.color);
653
- if (c && !_chunkPPFJHTW5cjs.inSrgbGamut.call(void 0, c)) {
650
+ const c = _chunk5UEFBM2Mcjs.parseColor.call(void 0, s.color);
651
+ if (c && !_chunkTFF2GTGNcjs.inSrgbGamut.call(void 0, c)) {
654
652
  issues.push(`Stop "${s.id}" colour ${s.color} is outside standard sRGB gamut.`);
655
653
  }
656
654
  }
657
655
  let lowestTextContrast;
658
656
  if (options.text) {
659
- const parsedTxt = _chunkRD7RX52Gcjs.parseColor.call(void 0, options.text);
657
+ const parsedTxt = _chunk5UEFBM2Mcjs.parseColor.call(void 0, options.text);
660
658
  if (parsedTxt) {
661
659
  let minRatio = Infinity;
662
660
  for (let step = 0; step <= 32; step++) {
663
- const sample = _chunkRD7RX52Gcjs.parseColor.call(void 0, sampleGradient(g, step / 32, "light"));
661
+ const sample = _chunk5UEFBM2Mcjs.parseColor.call(void 0, sampleGradient(g, step / 32, "light"));
664
662
  if (sample) {
665
- const r = _chunkRD7RX52Gcjs.contrastRatio.call(void 0, parsedTxt, sample);
663
+ const r = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, parsedTxt, sample);
666
664
  if (r < minRatio) minRatio = r;
667
665
  }
668
666
  }
@@ -804,7 +802,7 @@ function gradientTrackBackground(g) {
804
802
  // src/gradient/sample.ts
805
803
  var DEFAULT_TOLERANCE = 0.06;
806
804
  function toRgba(color) {
807
- if (typeof color === "string") return _chunkRD7RX52Gcjs.parseColor.call(void 0, color);
805
+ if (typeof color === "string") return _chunk5UEFBM2Mcjs.parseColor.call(void 0, color);
808
806
  if (Array.isArray(color) && color.length >= 4 && color.slice(0, 4).every((v) => Number.isFinite(v))) {
809
807
  return { r: color[0] / 255, g: color[1] / 255, b: color[2] / 255, a: color[3] / 255 };
810
808
  }
@@ -844,7 +842,7 @@ function fitGradientStops(samples, options = {}) {
844
842
  if (!s || !Number.isFinite(s.offset)) continue;
845
843
  const c = toRgba(s.color);
846
844
  if (!c) continue;
847
- const lab2 = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, { ...c, a: _nullishCoalesce(c.a, () => ( 1)) });
845
+ const lab2 = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, { ...c, a: _nullishCoalesce(c.a, () => ( 1)) });
848
846
  raw.push({ t: Math.min(1, Math.max(0, s.offset)), v: [lab2.l, lab2.a, lab2.b, _nullishCoalesce(c.a, () => ( 1))] });
849
847
  }
850
848
  if (raw.length < 2) throw new Error(`Need at least two readable samples to make a gradient; got ${raw.length}.`);
@@ -877,7 +875,7 @@ function fitGradientStops(samples, options = {}) {
877
875
  }
878
876
  const stops = at.map((i, k) => {
879
877
  const [l, a, b, alpha] = lab[i].v;
880
- const color = _chunkPPFJHTW5cjs.formatHex.call(void 0, _chunk7AHBW2CQcjs.oklabToRgb.call(void 0, { l, a, b, alpha: Math.min(1, Math.max(0, alpha)) }));
878
+ const color = _chunkTFF2GTGNcjs.formatHex.call(void 0, _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, { l, a, b, alpha: Math.min(1, Math.max(0, alpha)) }));
881
879
  return { id: `s${k + 1}`, offset: k === 0 ? 0 : k === at.length - 1 ? 1 : Math.round(lab[i].t * 1e3) / 1e3, color };
882
880
  });
883
881
  return { stops, maxError: Math.round(maxErrorOf(lab, at) * 1e4) / 1e4 };