@pixerate/editor-react 0.143.0 → 0.145.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.
@@ -190,7 +190,7 @@ function useImageEffectsTools(registry, controller, options = {}) {
190
190
  }
191
191
 
192
192
  // src/image-editor/ImageEditor.tsx
193
- import React19, { useRef as useRef11, useEffect as useEffect17, useState as useState20 } from "react";
193
+ import React21, { useRef as useRef12, useEffect as useEffect17, useState as useState22 } from "react";
194
194
  import {
195
195
  normalizeProcessVersion,
196
196
  LATEST_PROCESS_VERSION,
@@ -1538,7 +1538,7 @@ var AdjustmentLayersPanel = ({ controller, layers: layersProp, histogram, classN
1538
1538
  };
1539
1539
 
1540
1540
  // src/image-editor/LayersPanel.tsx
1541
- import { useEffect as useEffect6, useRef as useRef5, useState as useState7 } from "react";
1541
+ import { useEffect as useEffect6, useRef as useRef6, useState as useState8 } from "react";
1542
1542
 
1543
1543
  // src/image-editor/LayerEffectsPanel.tsx
1544
1544
  import { useEffect as useEffect5, useRef as useRef4, useState as useState6 } from "react";
@@ -1696,6 +1696,92 @@ var LayerEffectsPanel = ({ controller, layerId, heading = true, className }) =>
1696
1696
  ] });
1697
1697
  };
1698
1698
 
1699
+ // src/image-editor/EdgeColorPanel.tsx
1700
+ import { useRef as useRef5, useState as useState7 } from "react";
1701
+ import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1702
+ var SLIDERS = [
1703
+ { key: "decontaminate", label: "Decontaminate", hint: "Unmix the old background from a soft-edged mask" },
1704
+ { key: "despill", label: "Despill", hint: "Take out the old background's hue at the edge" },
1705
+ { key: "ambient", label: "Cast", hint: "Tint the edge with what is behind the layer, live" }
1706
+ ];
1707
+ var EdgeColorPanel = ({ controller, layer, className = "" }) => {
1708
+ const [error, setError] = useState7(null);
1709
+ const commitNext = useRef5(true);
1710
+ const info = controller.getEdgeColor(layer.id);
1711
+ const fixed = info.ambientSource !== "auto";
1712
+ const set = (change) => {
1713
+ setError(null);
1714
+ try {
1715
+ controller.setEdgeColor(layer.id, change, commitNext.current);
1716
+ commitNext.current = false;
1717
+ } catch (err) {
1718
+ setError(err instanceof Error ? err.message : String(err));
1719
+ }
1720
+ };
1721
+ const sliderEvents = {
1722
+ onPointerDown: () => commitNext.current = true,
1723
+ onPointerUp: () => commitNext.current = true,
1724
+ onKeyDown: () => commitNext.current = true
1725
+ };
1726
+ return /* @__PURE__ */ jsxs8("details", { className: `text-xs ${className}`, "data-testid": "edge-color-panel", open: Boolean(info.decontaminate || info.despill || info.ambient) || void 0, children: [
1727
+ /* @__PURE__ */ jsx8("summary", { className: "cursor-pointer text-muted-foreground", children: "Edge Colour" }),
1728
+ /* @__PURE__ */ jsxs8("div", { className: "flex flex-col gap-1.5 pt-1", children: [
1729
+ SLIDERS.map((s) => /* @__PURE__ */ jsxs8("label", { className: "flex flex-col gap-0.5", title: s.hint, children: [
1730
+ /* @__PURE__ */ jsxs8("span", { className: "flex justify-between text-muted-foreground", children: [
1731
+ /* @__PURE__ */ jsx8("span", { children: s.label }),
1732
+ /* @__PURE__ */ jsxs8("span", { className: "font-mono", children: [
1733
+ info[s.key],
1734
+ "%"
1735
+ ] })
1736
+ ] }),
1737
+ /* @__PURE__ */ jsx8(
1738
+ "input",
1739
+ {
1740
+ type: "range",
1741
+ min: 0,
1742
+ max: 100,
1743
+ "aria-label": `Edge ${s.label.toLowerCase()}`,
1744
+ value: info[s.key],
1745
+ ...sliderEvents,
1746
+ onChange: (e) => set({ [s.key]: Number(e.target.value) }),
1747
+ className: "accent-primary"
1748
+ }
1749
+ )
1750
+ ] }, s.key)),
1751
+ /* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1.5 text-foreground", children: [
1752
+ /* @__PURE__ */ jsx8(
1753
+ "input",
1754
+ {
1755
+ type: "checkbox",
1756
+ "aria-label": "Fixed cast colour",
1757
+ checked: fixed,
1758
+ onChange: (e) => {
1759
+ commitNext.current = true;
1760
+ set({ ambientColor: e.target.checked ? "#808080" : "auto" });
1761
+ },
1762
+ className: "accent-primary"
1763
+ }
1764
+ ),
1765
+ "Fixed cast colour",
1766
+ fixed && /* @__PURE__ */ jsx8(
1767
+ "input",
1768
+ {
1769
+ type: "color",
1770
+ "aria-label": "Cast colour",
1771
+ value: info.ambientSource,
1772
+ onChange: (e) => {
1773
+ commitNext.current = true;
1774
+ set({ ambientColor: e.target.value });
1775
+ },
1776
+ className: "h-5 w-8 bg-background border border-border rounded"
1777
+ }
1778
+ )
1779
+ ] }),
1780
+ error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "text-destructive", children: error })
1781
+ ] })
1782
+ ] });
1783
+ };
1784
+
1699
1785
  // src/image-editor/LayersPanel.tsx
1700
1786
  import {
1701
1787
  BIT_DEPTH_OPTIONS,
@@ -1717,7 +1803,7 @@ import {
1717
1803
  layerPanelRows,
1718
1804
  runLayerMenuAction
1719
1805
  } from "@pixerate/editor/image-editor";
1720
- import { Fragment, jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
1806
+ import { Fragment, jsx as jsx9, jsxs as jsxs9 } from "react/jsx-runtime";
1721
1807
  var rowClass = (active) => `flex items-center gap-1.5 px-1.5 py-1 rounded cursor-pointer select-none ${active ? "bg-primary/30 ring-1 ring-primary" : "hover:bg-muted"}`;
1722
1808
  var Thumbnail = ({
1723
1809
  pixels,
@@ -1728,7 +1814,7 @@ var Thumbnail = ({
1728
1814
  selected,
1729
1815
  testId
1730
1816
  }) => {
1731
- const ref = useRef5(null);
1817
+ const ref = useRef6(null);
1732
1818
  useEffect6(() => {
1733
1819
  const canvas = ref.current;
1734
1820
  const ctx = canvas?.getContext("2d");
@@ -1739,7 +1825,7 @@ var Thumbnail = ({
1739
1825
  img.data.set(pixels.data);
1740
1826
  ctx.putImageData(img, 0, 0);
1741
1827
  }, [pixels]);
1742
- return /* @__PURE__ */ jsx8(
1828
+ return /* @__PURE__ */ jsx9(
1743
1829
  "canvas",
1744
1830
  {
1745
1831
  ref,
@@ -1754,14 +1840,14 @@ var Thumbnail = ({
1754
1840
  );
1755
1841
  };
1756
1842
  var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "image", effects = true, className }) => {
1757
- const [, setTick] = useState7(0);
1843
+ const [, setTick] = useState8(0);
1758
1844
  useEffect6(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
1759
- const [error, setError] = useState7(null);
1760
- const [renaming, setRenaming] = useState7(null);
1761
- const [menu, setMenu] = useState7(null);
1762
- const [drag, setDrag] = useState7(null);
1763
- const [psdNotes, setPsdNotes] = useState7([]);
1764
- const fileInput = useRef5(null);
1845
+ const [error, setError] = useState8(null);
1846
+ const [renaming, setRenaming] = useState8(null);
1847
+ const [menu, setMenu] = useState8(null);
1848
+ const [drag, setDrag] = useState8(null);
1849
+ const [psdNotes, setPsdNotes] = useState8([]);
1850
+ const fileInput = useRef6(null);
1765
1851
  const psdTask = async (fn) => {
1766
1852
  try {
1767
1853
  setError(null);
@@ -1770,7 +1856,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1770
1856
  setError(err instanceof Error ? err.message : String(err));
1771
1857
  }
1772
1858
  };
1773
- const commitNext = useRef5(true);
1859
+ const commitNext = useRef6(true);
1774
1860
  const state = controller.getState();
1775
1861
  const maskView = controller.getMaskView();
1776
1862
  const rows = layerPanelRows(state.layers, state.activeLayerId);
@@ -1810,14 +1896,14 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1810
1896
  const maskThumb = (layer) => layer.mask && !layer.mask.source ? controller.getLayerThumbnail(layer.id, { maxSide: 64, mask: true }) : null;
1811
1897
  const vectorThumb = (layer) => layer.vectorMask ? vectorMaskThumbnail(layer.vectorMask, state.imageDimensions.width, state.imageDimensions.height, 64) : null;
1812
1898
  const locked = (layer) => Boolean(layer.locks?.all || layer.locks?.pixels || layer.locks?.position || layer.locks?.transparency);
1813
- return /* @__PURE__ */ jsxs8("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "layers-panel", onClick: () => menu && setMenu(null), children: [
1814
- /* @__PURE__ */ jsxs8("div", { className: "flex flex-wrap items-center gap-1", role: "toolbar", "aria-label": "Layer actions", children: [
1815
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, onClick: () => run("new-layer"), children: "New Layer" }),
1816
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, onClick: () => run("new-group"), children: "New Group" }),
1817
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("duplicate"), children: "Duplicate" }),
1818
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("add-mask"), children: "Add Mask" }),
1819
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("delete"), children: "Delete" }),
1820
- /* @__PURE__ */ jsx8(
1899
+ return /* @__PURE__ */ jsxs9("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "layers-panel", onClick: () => menu && setMenu(null), children: [
1900
+ /* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap items-center gap-1", role: "toolbar", "aria-label": "Layer actions", children: [
1901
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => run("new-layer"), children: "New Layer" }),
1902
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => run("new-group"), children: "New Group" }),
1903
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("duplicate"), children: "Duplicate" }),
1904
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("add-mask"), children: "Add Mask" }),
1905
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, disabled: !active, onClick: () => run("delete"), children: "Delete" }),
1906
+ /* @__PURE__ */ jsx9(
1821
1907
  "button",
1822
1908
  {
1823
1909
  type: "button",
@@ -1832,7 +1918,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1832
1918
  children: "\u22EF"
1833
1919
  }
1834
1920
  ),
1835
- /* @__PURE__ */ jsx8(
1921
+ /* @__PURE__ */ jsx9(
1836
1922
  "select",
1837
1923
  {
1838
1924
  "aria-label": "Bits per channel",
@@ -1840,13 +1926,13 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1840
1926
  className: "rounded bg-muted px-1 py-0.5 text-[11px] text-foreground",
1841
1927
  value: controller.bitDepth,
1842
1928
  onChange: (e) => attempt(() => controller.setBitDepth(Number(e.target.value))),
1843
- children: BIT_DEPTH_OPTIONS.map((o) => /* @__PURE__ */ jsx8("option", { value: o.depth, title: o.title, children: o.label }, o.depth))
1929
+ children: BIT_DEPTH_OPTIONS.map((o) => /* @__PURE__ */ jsx9("option", { value: o.depth, title: o.title, children: o.label }, o.depth))
1844
1930
  }
1845
1931
  ),
1846
- psd && /* @__PURE__ */ jsxs8(Fragment, { children: [
1847
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, onClick: () => fileInput.current?.click(), children: "Open PSD\u2026" }),
1848
- /* @__PURE__ */ jsx8("button", { type: "button", className: imageIconButtonClass, onClick: () => psdTask(async () => (await downloadPsd(controller, psdFileName)).warnings), children: "Export PSD" }),
1849
- /* @__PURE__ */ jsx8(
1932
+ psd && /* @__PURE__ */ jsxs9(Fragment, { children: [
1933
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => fileInput.current?.click(), children: "Open PSD\u2026" }),
1934
+ /* @__PURE__ */ jsx9("button", { type: "button", className: imageIconButtonClass, onClick: () => psdTask(async () => (await downloadPsd(controller, psdFileName)).warnings), children: "Export PSD" }),
1935
+ /* @__PURE__ */ jsx9(
1850
1936
  "input",
1851
1937
  {
1852
1938
  ref: fileInput,
@@ -1864,18 +1950,18 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1864
1950
  )
1865
1951
  ] })
1866
1952
  ] }),
1867
- psdNotes.length > 0 && /* @__PURE__ */ jsxs8("ul", { className: "rounded bg-amber-500/10 text-amber-600 px-2 py-1 space-y-0.5", "data-testid": "psd-warnings", "aria-label": "PSD warnings", children: [
1868
- psdNotes.map((n) => /* @__PURE__ */ jsx8("li", { children: n }, n)),
1869
- /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsx8("button", { type: "button", className: "underline", onClick: () => setPsdNotes([]), children: "Dismiss" }) })
1953
+ psdNotes.length > 0 && /* @__PURE__ */ jsxs9("ul", { className: "rounded bg-amber-500/10 text-amber-600 px-2 py-1 space-y-0.5", "data-testid": "psd-warnings", "aria-label": "PSD warnings", children: [
1954
+ psdNotes.map((n) => /* @__PURE__ */ jsx9("li", { children: n }, n)),
1955
+ /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsx9("button", { type: "button", className: "underline", onClick: () => setPsdNotes([]), children: "Dismiss" }) })
1870
1956
  ] }),
1871
- active && /* @__PURE__ */ jsxs8("div", { className: "grid grid-cols-2 gap-x-2 gap-y-1 items-center", "data-testid": "layer-properties", children: [
1872
- /* @__PURE__ */ jsxs8("label", { className: "flex flex-col gap-0.5", children: [
1873
- /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground", children: [
1957
+ active && /* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-2 gap-x-2 gap-y-1 items-center", "data-testid": "layer-properties", children: [
1958
+ /* @__PURE__ */ jsxs9("label", { className: "flex flex-col gap-0.5", children: [
1959
+ /* @__PURE__ */ jsxs9("span", { className: "text-muted-foreground", children: [
1874
1960
  "Opacity ",
1875
1961
  Math.round(active.opacity * 100),
1876
1962
  "%"
1877
1963
  ] }),
1878
- /* @__PURE__ */ jsx8(
1964
+ /* @__PURE__ */ jsx9(
1879
1965
  "input",
1880
1966
  {
1881
1967
  type: "range",
@@ -1889,13 +1975,13 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1889
1975
  }
1890
1976
  )
1891
1977
  ] }),
1892
- /* @__PURE__ */ jsxs8("label", { className: "flex flex-col gap-0.5", children: [
1893
- /* @__PURE__ */ jsxs8("span", { className: "text-muted-foreground", children: [
1978
+ /* @__PURE__ */ jsxs9("label", { className: "flex flex-col gap-0.5", children: [
1979
+ /* @__PURE__ */ jsxs9("span", { className: "text-muted-foreground", children: [
1894
1980
  "Fill ",
1895
1981
  Math.round(((active.type === "pixel" ? active.fillOpacity : void 0) ?? 1) * 100),
1896
1982
  "%"
1897
1983
  ] }),
1898
- /* @__PURE__ */ jsx8(
1984
+ /* @__PURE__ */ jsx9(
1899
1985
  "input",
1900
1986
  {
1901
1987
  type: "range",
@@ -1910,7 +1996,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1910
1996
  }
1911
1997
  )
1912
1998
  ] }),
1913
- /* @__PURE__ */ jsxs8(
1999
+ /* @__PURE__ */ jsxs9(
1914
2000
  "select",
1915
2001
  {
1916
2002
  "aria-label": "Layer blend mode",
@@ -1918,13 +2004,13 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1918
2004
  value: active.blend,
1919
2005
  onChange: (e) => attempt(() => controller.setLayerProperties(active.id, { blend: e.target.value })),
1920
2006
  children: [
1921
- active.type === "group" && /* @__PURE__ */ jsx8("option", { value: "pass-through", children: "Pass Through" }),
1922
- BLEND_MODES2.map((m) => /* @__PURE__ */ jsx8("option", { value: m.id, children: m.label }, m.id))
2007
+ active.type === "group" && /* @__PURE__ */ jsx9("option", { value: "pass-through", children: "Pass Through" }),
2008
+ BLEND_MODES2.map((m) => /* @__PURE__ */ jsx9("option", { value: m.id, children: m.label }, m.id))
1923
2009
  ]
1924
2010
  }
1925
2011
  ),
1926
- /* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1.5 text-foreground", children: [
1927
- /* @__PURE__ */ jsx8(
2012
+ /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-1.5 text-foreground", children: [
2013
+ /* @__PURE__ */ jsx9(
1928
2014
  "input",
1929
2015
  {
1930
2016
  type: "checkbox",
@@ -1936,8 +2022,8 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1936
2022
  ),
1937
2023
  "Clip to below"
1938
2024
  ] }),
1939
- /* @__PURE__ */ jsx8("div", { className: "col-span-2 flex flex-wrap gap-2 text-muted-foreground", role: "group", "aria-label": "Layer locks", children: ["pixels", "transparency", "position", "all"].map((k) => /* @__PURE__ */ jsxs8("label", { className: "flex items-center gap-1", children: [
1940
- /* @__PURE__ */ jsx8(
2025
+ /* @__PURE__ */ jsx9("div", { className: "col-span-2 flex flex-wrap gap-2 text-muted-foreground", role: "group", "aria-label": "Layer locks", children: ["pixels", "transparency", "position", "all"].map((k) => /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-1", children: [
2026
+ /* @__PURE__ */ jsx9(
1941
2027
  "input",
1942
2028
  {
1943
2029
  type: "checkbox",
@@ -1950,10 +2036,11 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1950
2036
  k
1951
2037
  ] }, k)) })
1952
2038
  ] }),
1953
- effects && active && active.type !== "adjustment" && /* @__PURE__ */ jsx8(LayerEffectsPanel, { controller, className: "border-t border-border pt-1.5" }),
1954
- /* @__PURE__ */ jsx8("ul", { className: "flex flex-col gap-0.5", role: "tree", "aria-label": "Layers", children: rows.map((row) => {
2039
+ active && (active.type === "pixel" || active.type === "shape" || active.type === "type" || active.type === "smart") && /* @__PURE__ */ jsx9(EdgeColorPanel, { controller, layer: active, className: "border-t border-border pt-1.5" }, active.id),
2040
+ effects && active && active.type !== "adjustment" && /* @__PURE__ */ jsx9(LayerEffectsPanel, { controller, className: "border-t border-border pt-1.5" }),
2041
+ /* @__PURE__ */ jsx9("ul", { className: "flex flex-col gap-0.5", role: "tree", "aria-label": "Layers", children: rows.map((row) => {
1955
2042
  const { layer } = row;
1956
- return /* @__PURE__ */ jsxs8(
2043
+ return /* @__PURE__ */ jsxs9(
1957
2044
  "li",
1958
2045
  {
1959
2046
  role: "treeitem",
@@ -1983,7 +2070,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1983
2070
  className: rowClass(row.active),
1984
2071
  style: { paddingLeft: 6 + row.depth * 14 },
1985
2072
  children: [
1986
- /* @__PURE__ */ jsx8(
2073
+ /* @__PURE__ */ jsx9(
1987
2074
  "button",
1988
2075
  {
1989
2076
  type: "button",
@@ -1997,7 +2084,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1997
2084
  children: layer.visible ? "\u25CF" : "\u25CB"
1998
2085
  }
1999
2086
  ),
2000
- layer.type === "group" && /* @__PURE__ */ jsx8(
2087
+ layer.type === "group" && /* @__PURE__ */ jsx9(
2001
2088
  "button",
2002
2089
  {
2003
2090
  type: "button",
@@ -2010,9 +2097,9 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2010
2097
  children: layer.collapsed ? "\u25B8" : "\u25BE"
2011
2098
  }
2012
2099
  ),
2013
- row.clipped && /* @__PURE__ */ jsx8("span", { className: "text-muted-foreground", "aria-label": "Clipped", children: "\u21B3" }),
2014
- layerHasThumbnail(layer) ? /* @__PURE__ */ jsxs8("span", { className: "relative shrink-0", children: [
2015
- /* @__PURE__ */ jsx8(
2100
+ row.clipped && /* @__PURE__ */ jsx9("span", { className: "text-muted-foreground", "aria-label": "Clipped", children: "\u21B3" }),
2101
+ layerHasThumbnail(layer) ? /* @__PURE__ */ jsxs9("span", { className: "relative shrink-0", children: [
2102
+ /* @__PURE__ */ jsx9(
2016
2103
  Thumbnail,
2017
2104
  {
2018
2105
  pixels: thumb(layer),
@@ -2028,7 +2115,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2028
2115
  }
2029
2116
  }
2030
2117
  ),
2031
- layer.type !== "pixel" && /* @__PURE__ */ jsx8(
2118
+ layer.type !== "pixel" && /* @__PURE__ */ jsx9(
2032
2119
  "span",
2033
2120
  {
2034
2121
  "data-testid": "layer-kind-badge",
@@ -2036,7 +2123,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2036
2123
  children: layerBadge(layer)
2037
2124
  }
2038
2125
  )
2039
- ] }) : /* @__PURE__ */ jsx8(
2126
+ ] }) : /* @__PURE__ */ jsx9(
2040
2127
  "span",
2041
2128
  {
2042
2129
  className: "shrink-0 grid place-items-center rounded bg-muted text-[9px] text-muted-foreground ring-1 ring-border",
@@ -2044,7 +2131,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2044
2131
  children: layerBadge(layer)
2045
2132
  }
2046
2133
  ),
2047
- layer.mask && !layer.mask.source && layer.type === "pixel" && /* @__PURE__ */ jsx8(
2134
+ layer.mask && !layer.mask.source && layer.type === "pixel" && /* @__PURE__ */ jsx9(
2048
2135
  "button",
2049
2136
  {
2050
2137
  type: "button",
@@ -2060,7 +2147,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2060
2147
  children: layer.mask.linked === false ? "\u26D3\uFE0E\u0338" : "\u26D3\uFE0E"
2061
2148
  }
2062
2149
  ),
2063
- layer.mask && /* @__PURE__ */ jsx8(
2150
+ layer.mask && /* @__PURE__ */ jsx9(
2064
2151
  Thumbnail,
2065
2152
  {
2066
2153
  pixels: maskThumb(layer),
@@ -2075,7 +2162,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2075
2162
  }
2076
2163
  }
2077
2164
  ),
2078
- layer.vectorMask && /* @__PURE__ */ jsx8(
2165
+ layer.vectorMask && /* @__PURE__ */ jsx9(
2079
2166
  Thumbnail,
2080
2167
  {
2081
2168
  pixels: vectorThumb(layer),
@@ -2089,7 +2176,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2089
2176
  }
2090
2177
  }
2091
2178
  ),
2092
- renaming === layer.id ? /* @__PURE__ */ jsx8(
2179
+ renaming === layer.id ? /* @__PURE__ */ jsx9(
2093
2180
  "input",
2094
2181
  {
2095
2182
  autoFocus: true,
@@ -2106,7 +2193,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2106
2193
  if (e.key === "Escape") setRenaming(null);
2107
2194
  }
2108
2195
  }
2109
- ) : /* @__PURE__ */ jsx8(
2196
+ ) : /* @__PURE__ */ jsx9(
2110
2197
  "span",
2111
2198
  {
2112
2199
  className: `flex-1 min-w-0 truncate ${layer.visible ? "" : "text-muted-foreground"}`,
@@ -2117,8 +2204,8 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2117
2204
  children: row.label
2118
2205
  }
2119
2206
  ),
2120
- layerWarning(layer) && /* @__PURE__ */ jsx8("span", { role: "img", "data-testid": "layer-warning", "aria-label": layerWarning(layer), title: layerWarning(layer), className: "text-[10px] text-amber-600", children: "\u26A0" }),
2121
- layerEffectsBadge(layer) && /* @__PURE__ */ jsx8(
2207
+ layerWarning(layer) && /* @__PURE__ */ jsx9("span", { role: "img", "data-testid": "layer-warning", "aria-label": layerWarning(layer), title: layerWarning(layer), className: "text-[10px] text-amber-600", children: "\u26A0" }),
2208
+ layerEffectsBadge(layer) && /* @__PURE__ */ jsx9(
2122
2209
  "button",
2123
2210
  {
2124
2211
  type: "button",
@@ -2133,15 +2220,15 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2133
2220
  children: "fx"
2134
2221
  }
2135
2222
  ),
2136
- locked(layer) && /* @__PURE__ */ jsx8("span", { "aria-label": "Locked", className: "text-muted-foreground", children: "\u{1F512}" }),
2137
- layer.blend !== "normal" && layer.blend !== "pass-through" && /* @__PURE__ */ jsx8("span", { className: "text-[9px] text-muted-foreground", children: layer.blend })
2223
+ locked(layer) && /* @__PURE__ */ jsx9("span", { "aria-label": "Locked", className: "text-muted-foreground", children: "\u{1F512}" }),
2224
+ layer.blend !== "normal" && layer.blend !== "pass-through" && /* @__PURE__ */ jsx9("span", { className: "text-[9px] text-muted-foreground", children: layer.blend })
2138
2225
  ]
2139
2226
  },
2140
2227
  layer.id
2141
2228
  );
2142
2229
  }) }),
2143
- error && /* @__PURE__ */ jsx8("p", { role: "alert", className: "text-destructive", children: error }),
2144
- menu && /* @__PURE__ */ jsx8(
2230
+ error && /* @__PURE__ */ jsx9("p", { role: "alert", className: "text-destructive", children: error }),
2231
+ menu && /* @__PURE__ */ jsx9(
2145
2232
  "div",
2146
2233
  {
2147
2234
  role: "menu",
@@ -2150,7 +2237,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2150
2237
  style: { left: menu.x, top: menu.y },
2151
2238
  onClick: (e) => e.stopPropagation(),
2152
2239
  onKeyDown: (e) => e.key === "Escape" && setMenu(null),
2153
- children: layerMenu(controller).map((item) => /* @__PURE__ */ jsx8(
2240
+ children: layerMenu(controller).map((item) => /* @__PURE__ */ jsx9(
2154
2241
  "button",
2155
2242
  {
2156
2243
  type: "button",
@@ -2168,14 +2255,14 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
2168
2255
  };
2169
2256
 
2170
2257
  // src/image-editor/ImageProviderEffectsPanel.tsx
2171
- import { useEffect as useEffect7, useRef as useRef6, useState as useState8 } from "react";
2258
+ import { useEffect as useEffect7, useRef as useRef7, useState as useState9 } from "react";
2172
2259
  import { EFFECT_LAYER_USES, effectLayerTiming, findLayer } from "@pixerate/editor/image-editor";
2173
2260
 
2174
2261
  // src/image-editor/controls/parameterControls.tsx
2175
2262
  import { matchParameterOptionValue } from "@pixerate/editor/parameters";
2176
- import { jsx as jsx9 } from "react/jsx-runtime";
2263
+ import { jsx as jsx10 } from "react/jsx-runtime";
2177
2264
  function ImageParameterSlider({ value, min, max, step, label, disabled, className, onChange, onGestureStart, onGestureEnd }) {
2178
- return /* @__PURE__ */ jsx9(
2265
+ return /* @__PURE__ */ jsx10(
2179
2266
  ImageRange,
2180
2267
  {
2181
2268
  value,
@@ -2192,7 +2279,7 @@ function ImageParameterSlider({ value, min, max, step, label, disabled, classNam
2192
2279
  );
2193
2280
  }
2194
2281
  function ImageParameterSelect({ value, options, label, disabled, className, onChange }) {
2195
- return /* @__PURE__ */ jsx9(
2282
+ return /* @__PURE__ */ jsx10(
2196
2283
  ImageSelect,
2197
2284
  {
2198
2285
  value: String(value),
@@ -2205,7 +2292,7 @@ function ImageParameterSelect({ value, options, label, disabled, className, onCh
2205
2292
  );
2206
2293
  }
2207
2294
  function ImageParameterColor({ value, alpha, label, disabled, className, onChange, onGestureStart, onGestureEnd }) {
2208
- return /* @__PURE__ */ jsx9(
2295
+ return /* @__PURE__ */ jsx10(
2209
2296
  ImageColor,
2210
2297
  {
2211
2298
  value,
@@ -2228,33 +2315,33 @@ function imageEditorParameterComponents(controls) {
2228
2315
  }
2229
2316
 
2230
2317
  // src/image-editor/ImageEffectControls.tsx
2231
- import { jsx as jsx10, jsxs as jsxs9 } from "react/jsx-runtime";
2318
+ import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
2232
2319
  function ImageEffectControls({ provider, effect, name, values, onChange, onPreset, className, components }) {
2233
2320
  const { description, error } = useEffectDescription(provider, effect);
2234
2321
  const fallback = resolveParameterComponents(useParameterComponents(), imageEditorParameterComponents(useImageEditorControls()));
2235
2322
  const effectiveComponents = resolveParameterComponents(components, fallback);
2236
2323
  let body;
2237
- if (!provider) body = /* @__PURE__ */ jsxs9("p", { className: "text-[11px] text-muted-foreground", children: [
2324
+ if (!provider) body = /* @__PURE__ */ jsxs10("p", { className: "text-[11px] text-muted-foreground", children: [
2238
2325
  'No effects provider: "',
2239
2326
  name ?? effect,
2240
2327
  '" is kept but not drawn.'
2241
2328
  ] });
2242
- else if (error) body = /* @__PURE__ */ jsx10("p", { className: "text-[11px] text-amber-600", children: error });
2243
- else if (!description) body = /* @__PURE__ */ jsx10("p", { className: "text-[11px] text-muted-foreground", children: "Loading\u2026" });
2244
- else body = /* @__PURE__ */ jsx10(EffectParameters, { description, values, onChange, onReset: (k) => onChange(k, description.defaults[k], null), onPreset, components: effectiveComponents });
2245
- return /* @__PURE__ */ jsx10("div", { className, "data-testid": "image-effect-controls", children: body });
2329
+ else if (error) body = /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-amber-600", children: error });
2330
+ else if (!description) body = /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "Loading\u2026" });
2331
+ else body = /* @__PURE__ */ jsx11(EffectParameters, { description, values, onChange, onReset: (k) => onChange(k, description.defaults[k], null), onPreset, components: effectiveComponents });
2332
+ return /* @__PURE__ */ jsx11("div", { className, "data-testid": "image-effect-controls", children: body });
2246
2333
  }
2247
2334
 
2248
2335
  // src/image-editor/ImageProviderEffectsPanel.tsx
2249
- import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
2336
+ import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
2250
2337
  var fmt = (ms) => `${(ms / 1e3).toFixed(ms < 1e4 ? 2 : 1)} s`;
2251
2338
  function ImageProviderEffectsPanel({ controller, className = "", components }) {
2252
- const [, setTick] = useState8(0);
2339
+ const [, setTick] = useState9(0);
2253
2340
  useEffect7(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
2254
- const [browse, setBrowse] = useState8(null);
2255
- const [message, setMessage] = useState8(null);
2256
- const [open, setOpen] = useState8(null);
2257
- const [scrubbed, setScrubbed] = useState8(null);
2341
+ const [browse, setBrowse] = useState9(null);
2342
+ const [message, setMessage] = useState9(null);
2343
+ const [open, setOpen] = useState9(null);
2344
+ const [scrubbed, setScrubbed] = useState9(null);
2258
2345
  const provider = controller.effectsProvider;
2259
2346
  const state = controller.getState();
2260
2347
  const layer = state.activeLayerId ? findLayer(state.layers, state.activeLayerId)?.layer ?? null : null;
@@ -2262,7 +2349,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2262
2349
  setMessage(null);
2263
2350
  Promise.resolve().then(work).catch((e) => setMessage(e instanceof Error ? e.message : String(e)));
2264
2351
  };
2265
- const drags = useRef6(/* @__PURE__ */ new Set());
2352
+ const drags = useRef7(/* @__PURE__ */ new Set());
2266
2353
  const commit = (gesture) => {
2267
2354
  if (gesture) {
2268
2355
  if (!drags.current.has(gesture)) {
@@ -2278,7 +2365,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2278
2365
  const canFilter = !!provider && !!layer && layer.type !== "adjustment" && layer.type !== "annotation";
2279
2366
  const { description } = useEffectDescription(provider, generator?.effect);
2280
2367
  const timing = generator ? effectLayerTiming(generator, description) : null;
2281
- const scrub = useRef6({ next: null, busy: false, gesture: null });
2368
+ const scrub = useRef7({ next: null, busy: false, gesture: null });
2282
2369
  const scrubTo = (layerId, time) => {
2283
2370
  const s = scrub.current;
2284
2371
  setScrubbed(time);
@@ -2297,18 +2384,18 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2297
2384
  });
2298
2385
  };
2299
2386
  const shown = scrubbed ?? timing?.time ?? 0;
2300
- return /* @__PURE__ */ jsxs10("section", { className: `flex flex-col gap-2 text-xs ${className}`, "aria-label": "Effects", "data-image-provider-effects": "", children: [
2301
- !provider && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "No effects provider is registered. Effects in the document are kept." }),
2302
- generator && layer && /* @__PURE__ */ jsxs10("div", { className: "space-y-2", "data-effect-part": "generator", children: [
2303
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2304
- /* @__PURE__ */ jsx11("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", title: generator.name ?? generator.effect, children: generator.name ?? generator.effect }),
2305
- /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider, "aria-pressed": browse === "change", onClick: () => setBrowse(browse === "change" ? null : "change"), children: "Change\u2026" }),
2306
- /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, title: "Keep the pixels as a plain layer", onClick: () => run(() => controller.rasterizeEffectLayer(layer.id)), children: "Rasterize" })
2387
+ return /* @__PURE__ */ jsxs11("section", { className: `flex flex-col gap-2 text-xs ${className}`, "aria-label": "Effects", "data-image-provider-effects": "", children: [
2388
+ !provider && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground", children: "No effects provider is registered. Effects in the document are kept." }),
2389
+ generator && layer && /* @__PURE__ */ jsxs11("div", { className: "space-y-2", "data-effect-part": "generator", children: [
2390
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
2391
+ /* @__PURE__ */ jsx12("span", { className: "min-w-0 flex-1 truncate font-medium text-foreground", title: generator.name ?? generator.effect, children: generator.name ?? generator.effect }),
2392
+ /* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, disabled: !provider, "aria-pressed": browse === "change", onClick: () => setBrowse(browse === "change" ? null : "change"), children: "Change\u2026" }),
2393
+ /* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, title: "Keep the pixels as a plain layer", onClick: () => run(() => controller.rasterizeEffectLayer(layer.id)), children: "Rasterize" })
2307
2394
  ] }),
2308
- browse === "change" && /* @__PURE__ */ jsx11(EffectsBrowser, { provider, uses: EFFECT_LAYER_USES, title: "Change the effect to", onPick: (e) => (setBrowse(null), run(() => controller.updateEffectLayer(layer.id, { effect: e.id }))) }),
2309
- timing && /* @__PURE__ */ jsxs10("div", { className: "space-y-1.5 rounded border border-border p-1.5", "data-effect-part": "timing", role: "group", "aria-label": "Frames", children: [
2310
- /* @__PURE__ */ jsxs10("div", { className: "flex gap-1", role: "radiogroup", "aria-label": "Output", children: [
2311
- /* @__PURE__ */ jsx11(
2395
+ browse === "change" && /* @__PURE__ */ jsx12(EffectsBrowser, { provider, uses: EFFECT_LAYER_USES, title: "Change the effect to", onPick: (e) => (setBrowse(null), run(() => controller.updateEffectLayer(layer.id, { effect: e.id }))) }),
2396
+ timing && /* @__PURE__ */ jsxs11("div", { className: "space-y-1.5 rounded border border-border p-1.5", "data-effect-part": "timing", role: "group", "aria-label": "Frames", children: [
2397
+ /* @__PURE__ */ jsxs11("div", { className: "flex gap-1", role: "radiogroup", "aria-label": "Output", children: [
2398
+ /* @__PURE__ */ jsx12(
2312
2399
  "button",
2313
2400
  {
2314
2401
  type: "button",
@@ -2319,7 +2406,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2319
2406
  children: "Still frame"
2320
2407
  }
2321
2408
  ),
2322
- /* @__PURE__ */ jsx11(
2409
+ /* @__PURE__ */ jsx12(
2323
2410
  "button",
2324
2411
  {
2325
2412
  type: "button",
@@ -2331,9 +2418,9 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2331
2418
  }
2332
2419
  )
2333
2420
  ] }),
2334
- /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-1.5", children: [
2335
- /* @__PURE__ */ jsx11("span", { className: "w-16 shrink-0 text-[11px] text-foreground", children: timing.mode === "still" ? "Frame" : "Starts at" }),
2336
- /* @__PURE__ */ jsx11(
2421
+ /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2422
+ /* @__PURE__ */ jsx12("span", { className: "w-16 shrink-0 text-[11px] text-foreground", children: timing.mode === "still" ? "Frame" : "Starts at" }),
2423
+ /* @__PURE__ */ jsx12(
2337
2424
  ImageRange,
2338
2425
  {
2339
2426
  min: 0,
@@ -2347,11 +2434,11 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2347
2434
  onChange: (t) => scrubTo(layer.id, t)
2348
2435
  }
2349
2436
  ),
2350
- /* @__PURE__ */ jsx11("span", { className: "w-12 shrink-0 text-right tabular-nums text-muted-foreground", children: fmt(shown) })
2437
+ /* @__PURE__ */ jsx12("span", { className: "w-12 shrink-0 text-right tabular-nums text-muted-foreground", children: fmt(shown) })
2351
2438
  ] }),
2352
- timing.mode === "animate" && /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-1.5", children: [
2353
- /* @__PURE__ */ jsx11("span", { className: "w-16 shrink-0 text-[11px] text-foreground", children: "Length" }),
2354
- /* @__PURE__ */ jsx11(
2439
+ timing.mode === "animate" && /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2440
+ /* @__PURE__ */ jsx12("span", { className: "w-16 shrink-0 text-[11px] text-foreground", children: "Length" }),
2441
+ /* @__PURE__ */ jsx12(
2355
2442
  "input",
2356
2443
  {
2357
2444
  type: "number",
@@ -2368,13 +2455,13 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2368
2455
  },
2369
2456
  timing.duration
2370
2457
  ),
2371
- /* @__PURE__ */ jsxs10("span", { className: "text-muted-foreground", children: [
2458
+ /* @__PURE__ */ jsxs11("span", { className: "text-muted-foreground", children: [
2372
2459
  "s",
2373
2460
  timing.loops ? ` \xB7 loops every ${fmt(timing.range)}` : ""
2374
2461
  ] })
2375
2462
  ] })
2376
2463
  ] }),
2377
- /* @__PURE__ */ jsx11(
2464
+ /* @__PURE__ */ jsx12(
2378
2465
  ImageEffectControls,
2379
2466
  {
2380
2467
  provider,
@@ -2387,19 +2474,19 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2387
2474
  }
2388
2475
  )
2389
2476
  ] }),
2390
- layer && canFilter && /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", "data-effect-part": "applied", children: [
2391
- /* @__PURE__ */ jsx11("span", { className: "flex-1 font-semibold uppercase tracking-wider text-[11px] text-foreground", children: "Filters" }),
2392
- /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, "aria-pressed": browse === "filter", onClick: () => setBrowse(browse === "filter" ? null : "filter"), children: "Add filter\u2026" })
2477
+ layer && canFilter && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", "data-effect-part": "applied", children: [
2478
+ /* @__PURE__ */ jsx12("span", { className: "flex-1 font-semibold uppercase tracking-wider text-[11px] text-foreground", children: "Filters" }),
2479
+ /* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, "aria-pressed": browse === "filter", onClick: () => setBrowse(browse === "filter" ? null : "filter"), children: "Add filter\u2026" })
2393
2480
  ] }),
2394
- browse === "filter" && layer && /* @__PURE__ */ jsx11(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id, { useSelection: true }))) }),
2395
- filters.length > 0 && layer && /* @__PURE__ */ jsx11("ol", { className: "space-y-1", "data-effect-part": "filters", "aria-label": "Filters", children: filters.map((f) => {
2481
+ browse === "filter" && layer && /* @__PURE__ */ jsx12(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id, { useSelection: true }))) }),
2482
+ filters.length > 0 && layer && /* @__PURE__ */ jsx12("ol", { className: "space-y-1", "data-effect-part": "filters", "aria-label": "Filters", children: filters.map((f) => {
2396
2483
  const label = f.kind === "effect" ? f.name ?? f.effect : f.kind;
2397
2484
  const all = layer.smartFilters.filters;
2398
2485
  const index = all.indexOf(f);
2399
2486
  if (f.kind !== "effect") return null;
2400
- return /* @__PURE__ */ jsxs10("li", { className: "rounded border border-border p-1", "data-smart-effect": f.id, children: [
2401
- /* @__PURE__ */ jsxs10("div", { className: "flex items-center gap-1", children: [
2402
- /* @__PURE__ */ jsx11(
2487
+ return /* @__PURE__ */ jsxs11("li", { className: "rounded border border-border p-1", "data-smart-effect": f.id, children: [
2488
+ /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
2489
+ /* @__PURE__ */ jsx12(
2403
2490
  ImageCheckbox,
2404
2491
  {
2405
2492
  checked: f.enabled,
@@ -2407,15 +2494,15 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2407
2494
  onChange: (enabled) => run(() => controller.updateEffectFilter(layer.id, f.id, { enabled }))
2408
2495
  }
2409
2496
  ),
2410
- /* @__PURE__ */ jsx11("button", { type: "button", className: "min-w-0 flex-1 truncate text-left text-foreground", "aria-expanded": open === f.id, onClick: () => setOpen(open === f.id ? null : f.id), children: label }),
2411
- /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: index === all.length - 1, "aria-label": "Move up", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index + 1 })), children: "\u2191" }),
2412
- /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, disabled: index === 0, "aria-label": "Move down", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index - 1 })), children: "\u2193" }),
2413
- /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, "aria-label": `Remove ${label}`, onClick: () => run(() => controller.removeSmartFilter(layer.id, f.id)), children: "\u2715" })
2497
+ /* @__PURE__ */ jsx12("button", { type: "button", className: "min-w-0 flex-1 truncate text-left text-foreground", "aria-expanded": open === f.id, onClick: () => setOpen(open === f.id ? null : f.id), children: label }),
2498
+ /* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, disabled: index === all.length - 1, "aria-label": "Move up", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index + 1 })), children: "\u2191" }),
2499
+ /* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, disabled: index === 0, "aria-label": "Move down", onClick: () => run(() => controller.updateEffectFilter(layer.id, f.id, { index: index - 1 })), children: "\u2193" }),
2500
+ /* @__PURE__ */ jsx12("button", { type: "button", className: imageOutlineButtonClass, "aria-label": `Remove ${label}`, onClick: () => run(() => controller.removeSmartFilter(layer.id, f.id)), children: "\u2715" })
2414
2501
  ] }),
2415
- open === f.id && /* @__PURE__ */ jsxs10("div", { className: "mt-1 space-y-2", children: [
2416
- /* @__PURE__ */ jsxs10("label", { className: "flex items-center gap-1", children: [
2417
- /* @__PURE__ */ jsx11("span", { className: "w-14 text-[11px] text-foreground", children: "Opacity" }),
2418
- /* @__PURE__ */ jsx11(
2502
+ open === f.id && /* @__PURE__ */ jsxs11("div", { className: "mt-1 space-y-2", children: [
2503
+ /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
2504
+ /* @__PURE__ */ jsx12("span", { className: "w-14 text-[11px] text-foreground", children: "Opacity" }),
2505
+ /* @__PURE__ */ jsx12(
2419
2506
  ImageRange,
2420
2507
  {
2421
2508
  min: 0,
@@ -2428,7 +2515,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2428
2515
  }
2429
2516
  )
2430
2517
  ] }),
2431
- /* @__PURE__ */ jsx11(
2518
+ /* @__PURE__ */ jsx12(
2432
2519
  ImageEffectControls,
2433
2520
  {
2434
2521
  provider,
@@ -2443,14 +2530,14 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2443
2530
  ] })
2444
2531
  ] }, f.id);
2445
2532
  }) }),
2446
- layer && canFilter && !generator && filters.length === 0 && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "No filters yet. A filter changes the layer's pixels and stays editable. Layer styles such as a drop shadow are in the layer's properties; new effect layers are added from the layers panel." }),
2447
- !layer && /* @__PURE__ */ jsx11("p", { className: "text-[11px] text-muted-foreground", children: "Select a layer to apply effects to it." }),
2448
- message && /* @__PURE__ */ jsx11("p", { role: "alert", className: "text-[11px] text-destructive", children: message })
2533
+ layer && canFilter && !generator && filters.length === 0 && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground", children: "No filters yet. A filter changes the layer's pixels and stays editable. Layer styles such as a drop shadow are in the layer's properties; new effect layers are added from the layers panel." }),
2534
+ !layer && /* @__PURE__ */ jsx12("p", { className: "text-[11px] text-muted-foreground", children: "Select a layer to apply effects to it." }),
2535
+ message && /* @__PURE__ */ jsx12("p", { role: "alert", className: "text-[11px] text-destructive", children: message })
2449
2536
  ] });
2450
2537
  }
2451
2538
 
2452
2539
  // src/image-editor/BrushOptionsBar.tsx
2453
- import { useEffect as useEffect8, useState as useState9 } from "react";
2540
+ import { useEffect as useEffect8, useState as useState10 } from "react";
2454
2541
  import {
2455
2542
  BRUSH_OPTION_CONTROLS,
2456
2543
  MIXER_MIXING_OPTIONS,
@@ -2471,15 +2558,15 @@ import { DEFAULT_PAINT_GRADIENT, userErrorMessage } from "@pixerate/editor/image
2471
2558
 
2472
2559
  // src/image-editor/PaintGradientEditor.tsx
2473
2560
  import { PAINT_GRADIENT_KIT } from "@pixerate/editor/image-editor";
2474
- import { jsx as jsx12 } from "react/jsx-runtime";
2475
- var PaintGradientEditor = (props) => /* @__PURE__ */ jsx12(PaintGradientEditorView, { ...props, kit: PAINT_GRADIENT_KIT });
2561
+ import { jsx as jsx13 } from "react/jsx-runtime";
2562
+ var PaintGradientEditor = (props) => /* @__PURE__ */ jsx13(PaintGradientEditorView, { ...props, kit: PAINT_GRADIENT_KIT });
2476
2563
 
2477
2564
  // src/image-editor/BrushOptionsBar.tsx
2478
- import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
2565
+ import { jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
2479
2566
  var BrushOptionsBar = ({ controller, className }) => {
2480
- const [, setTick] = useState9(0);
2567
+ const [, setTick] = useState10(0);
2481
2568
  useEffect8(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
2482
- const [error, setError] = useState9(null);
2569
+ const [error, setError] = useState10(null);
2483
2570
  const state = controller.getState();
2484
2571
  const { brush, foreground, background, mixer, mixerLoad, retouch, cloneSource, paint } = state.paint;
2485
2572
  const tool = state.activeTool;
@@ -2491,8 +2578,8 @@ var BrushOptionsBar = ({ controller, className }) => {
2491
2578
  setError(userErrorMessage(err));
2492
2579
  }
2493
2580
  };
2494
- return /* @__PURE__ */ jsxs11("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "brush-options", children: [
2495
- /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Paint tools", children: PAINT_TOOLS.map((t) => /* @__PURE__ */ jsx13(
2581
+ return /* @__PURE__ */ jsxs12("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "brush-options", children: [
2582
+ /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Paint tools", children: PAINT_TOOLS.map((t) => /* @__PURE__ */ jsx14(
2496
2583
  "button",
2497
2584
  {
2498
2585
  type: "button",
@@ -2504,18 +2591,18 @@ var BrushOptionsBar = ({ controller, className }) => {
2504
2591
  },
2505
2592
  t.id
2506
2593
  )) }),
2507
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", role: "group", "aria-label": "Colours", children: [
2508
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
2509
- /* @__PURE__ */ jsx13(ImageColor, { label: "Foreground colour", value: foreground, onChange: (fg) => controller.setPaintOptions({ foreground: fg }) }),
2510
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "FG" })
2594
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", role: "group", "aria-label": "Colours", children: [
2595
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2596
+ /* @__PURE__ */ jsx14(ImageColor, { label: "Foreground colour", value: foreground, onChange: (fg) => controller.setPaintOptions({ foreground: fg }) }),
2597
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "FG" })
2511
2598
  ] }),
2512
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1", children: [
2513
- /* @__PURE__ */ jsx13(ImageColor, { label: "Background colour", value: background, onChange: (bg) => controller.setPaintOptions({ background: bg }) }),
2514
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: "BG" })
2599
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2600
+ /* @__PURE__ */ jsx14(ImageColor, { label: "Background colour", value: background, onChange: (bg) => controller.setPaintOptions({ background: bg }) }),
2601
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "BG" })
2515
2602
  ] }),
2516
- /* @__PURE__ */ jsx13("button", { type: "button", title: "Swap colours (X)", className: imageChipClass(false), onClick: () => controller.swapPaintColors(), children: "Swap" }),
2517
- /* @__PURE__ */ jsx13("button", { type: "button", title: "Default colours (D)", className: imageChipClass(false), onClick: () => controller.resetPaintColors(), children: "Default" }),
2518
- state.activeTool === "brush" && /* @__PURE__ */ jsx13(
2603
+ /* @__PURE__ */ jsx14("button", { type: "button", title: "Swap colours (X)", className: imageChipClass(false), onClick: () => controller.swapPaintColors(), children: "Swap" }),
2604
+ /* @__PURE__ */ jsx14("button", { type: "button", title: "Default colours (D)", className: imageChipClass(false), onClick: () => controller.resetPaintColors(), children: "Default" }),
2605
+ state.activeTool === "brush" && /* @__PURE__ */ jsx14(
2519
2606
  "button",
2520
2607
  {
2521
2608
  type: "button",
@@ -2527,8 +2614,8 @@ var BrushOptionsBar = ({ controller, className }) => {
2527
2614
  }
2528
2615
  )
2529
2616
  ] }),
2530
- state.activeTool === "brush" && paint.type === "gradient" && /* @__PURE__ */ jsx13(PaintGradientEditor, { value: paint, colors: { paint: foreground, secondary: background }, onChange: (g) => attempt(() => controller.setPaintOptions({ paint: g })) }),
2531
- BRUSH_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx13(
2617
+ state.activeTool === "brush" && paint.type === "gradient" && /* @__PURE__ */ jsx14(PaintGradientEditor, { value: paint, colors: { paint: foreground, secondary: background }, onChange: (g) => attempt(() => controller.setPaintOptions({ paint: g })) }),
2618
+ BRUSH_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx14(
2532
2619
  ControlSlider,
2533
2620
  {
2534
2621
  spec,
@@ -2537,9 +2624,9 @@ var BrushOptionsBar = ({ controller, className }) => {
2537
2624
  },
2538
2625
  spec.id
2539
2626
  )),
2540
- state.activeTool === "mixer" && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Mixer Brush", "data-testid": "mixer-options", children: [
2541
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
2542
- /* @__PURE__ */ jsx13(
2627
+ state.activeTool === "mixer" && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Mixer Brush", "data-testid": "mixer-options", children: [
2628
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
2629
+ /* @__PURE__ */ jsx14(
2543
2630
  "span",
2544
2631
  {
2545
2632
  "aria-label": "Brush load",
@@ -2548,10 +2635,10 @@ var BrushOptionsBar = ({ controller, className }) => {
2548
2635
  style: { background: mixerLoad.reservoir ? rgbUnitToHex(mixerLoad.reservoir) : "transparent" }
2549
2636
  }
2550
2637
  ),
2551
- /* @__PURE__ */ jsx13("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: imageChipClass(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
2552
- /* @__PURE__ */ jsx13("button", { type: "button", title: "Empty the picked-up colour", className: imageChipClass(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
2638
+ /* @__PURE__ */ jsx14("button", { type: "button", title: "Fill the reservoir with the foreground colour", className: imageChipClass(false), onClick: () => controller.loadMixerBrush(), children: "Load brush" }),
2639
+ /* @__PURE__ */ jsx14("button", { type: "button", title: "Empty the picked-up colour", className: imageChipClass(false), onClick: () => controller.cleanMixerBrush(), children: "Clean brush" })
2553
2640
  ] }),
2554
- /* @__PURE__ */ jsx13("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ jsx13(
2641
+ /* @__PURE__ */ jsx14("div", { className: "flex gap-1", role: "group", "aria-label": "Mixing", children: MIXER_MIXING_OPTIONS.map((m) => /* @__PURE__ */ jsx14(
2555
2642
  "button",
2556
2643
  {
2557
2644
  type: "button",
@@ -2563,34 +2650,34 @@ var BrushOptionsBar = ({ controller, className }) => {
2563
2650
  },
2564
2651
  m.id
2565
2652
  )) }),
2566
- MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx13(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
2567
- /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-3 text-foreground", children: [
2568
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2569
- /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Load the brush after each stroke", checked: mixer.loadEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { loadEachStroke: on } }) }),
2653
+ MIXER_OPTION_CONTROLS.map((spec) => /* @__PURE__ */ jsx14(ControlSlider, { spec, value: mixer[spec.id], onChange: (v) => controller.setPaintOptions({ mixer: { [spec.id]: v } }) }, spec.id)),
2654
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-3 text-foreground", children: [
2655
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
2656
+ /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Load the brush after each stroke", checked: mixer.loadEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { loadEachStroke: on } }) }),
2570
2657
  "Load each stroke"
2571
2658
  ] }),
2572
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2573
- /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Clean the brush after each stroke", checked: mixer.cleanEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { cleanEachStroke: on } }) }),
2659
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
2660
+ /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Clean the brush after each stroke", checked: mixer.cleanEachStroke, onChange: (on) => controller.setPaintOptions({ mixer: { cleanEachStroke: on } }) }),
2574
2661
  "Clean each stroke"
2575
2662
  ] })
2576
2663
  ] })
2577
2664
  ] }),
2578
- isRetouchPaintTool(tool) && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Retouch options", "data-testid": "retouch-options", children: [
2579
- (tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-2", children: [
2580
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", "data-testid": "clone-source", children: cloneSourceLabel(controller) }),
2581
- cloneSource && /* @__PURE__ */ jsx13("button", { type: "button", title: "Forget the source point", className: imageChipClass(false), onClick: () => controller.setCloneSource(null), children: "Clear source" })
2665
+ isRetouchPaintTool(tool) && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-2 border-t border-border pt-2", role: "group", "aria-label": "Retouch options", "data-testid": "retouch-options", children: [
2666
+ (tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
2667
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", "data-testid": "clone-source", children: cloneSourceLabel(controller) }),
2668
+ cloneSource && /* @__PURE__ */ jsx14("button", { type: "button", title: "Forget the source point", className: imageChipClass(false), onClick: () => controller.setCloneSource(null), children: "Clear source" })
2582
2669
  ] }),
2583
- (tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs11("div", { className: "flex flex-col gap-1", role: "group", "aria-label": "Clone source transform", "data-testid": "clone-transform", children: [
2584
- CLONE_TRANSFORM_CONTROLS.map((spec) => /* @__PURE__ */ jsx13(ControlSlider, { spec, value: cloneTransformView(controller)[spec.id], onChange: (v) => setCloneTransformValue(controller, spec.id, v) }, spec.id)),
2585
- /* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-1", children: [
2586
- /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipH, title: "Mirror the source left to right", className: imageChipClass(cloneTransformView(controller).flipH), onClick: () => setCloneTransformValue(controller, "flipH"), children: "Flip H" }),
2587
- /* @__PURE__ */ jsx13("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipV, title: "Mirror the source top to bottom", className: imageChipClass(cloneTransformView(controller).flipV), onClick: () => setCloneTransformValue(controller, "flipV"), children: "Flip V" }),
2588
- !cloneTransformView(controller).identity && /* @__PURE__ */ jsx13("button", { type: "button", title: "Back to 100 %, no flip, 0\xB0", className: imageChipClass(false), onClick: () => controller.setCloneTransform(null), children: "Reset transform" })
2670
+ (tool === "clone" || tool === "heal") && /* @__PURE__ */ jsxs12("div", { className: "flex flex-col gap-1", role: "group", "aria-label": "Clone source transform", "data-testid": "clone-transform", children: [
2671
+ CLONE_TRANSFORM_CONTROLS.map((spec) => /* @__PURE__ */ jsx14(ControlSlider, { spec, value: cloneTransformView(controller)[spec.id], onChange: (v) => setCloneTransformValue(controller, spec.id, v) }, spec.id)),
2672
+ /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-1", children: [
2673
+ /* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipH, title: "Mirror the source left to right", className: imageChipClass(cloneTransformView(controller).flipH), onClick: () => setCloneTransformValue(controller, "flipH"), children: "Flip H" }),
2674
+ /* @__PURE__ */ jsx14("button", { type: "button", "aria-pressed": cloneTransformView(controller).flipV, title: "Mirror the source top to bottom", className: imageChipClass(cloneTransformView(controller).flipV), onClick: () => setCloneTransformValue(controller, "flipV"), children: "Flip V" }),
2675
+ !cloneTransformView(controller).identity && /* @__PURE__ */ jsx14("button", { type: "button", title: "Back to 100 %, no flip, 0\xB0", className: imageChipClass(false), onClick: () => controller.setCloneTransform(null), children: "Reset transform" })
2589
2676
  ] })
2590
2677
  ] }),
2591
- RETOUCH_CHOICES.filter((c) => c.tools.includes(tool)).map((choice) => /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": choice.label, children: [
2592
- /* @__PURE__ */ jsx13("span", { className: "text-muted-foreground", children: choice.label }),
2593
- choice.options.map((o) => /* @__PURE__ */ jsx13(
2678
+ RETOUCH_CHOICES.filter((c) => c.tools.includes(tool)).map((choice) => /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": choice.label, children: [
2679
+ /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: choice.label }),
2680
+ choice.options.map((o) => /* @__PURE__ */ jsx14(
2594
2681
  "button",
2595
2682
  {
2596
2683
  type: "button",
@@ -2603,43 +2690,43 @@ var BrushOptionsBar = ({ controller, className }) => {
2603
2690
  o.id
2604
2691
  ))
2605
2692
  ] }, choice.id)),
2606
- RETOUCH_OPTION_CONTROLS.filter((c) => c.tools.includes(tool)).map((spec) => /* @__PURE__ */ jsx13(ControlSlider, { spec, value: retouch[spec.id], onChange: (v) => controller.setPaintOptions({ retouch: { [spec.id]: v } }) }, spec.id)),
2607
- /* @__PURE__ */ jsx13("div", { className: "flex flex-wrap gap-3 text-foreground", children: RETOUCH_TOGGLES.filter((t) => t.tools.includes(tool)).map((t) => /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2608
- /* @__PURE__ */ jsx13(ImageCheckbox, { label: t.label, checked: retouch[t.id], onChange: (on) => controller.setPaintOptions({ retouch: { [t.id]: on } }) }),
2693
+ RETOUCH_OPTION_CONTROLS.filter((c) => c.tools.includes(tool)).map((spec) => /* @__PURE__ */ jsx14(ControlSlider, { spec, value: retouch[spec.id], onChange: (v) => controller.setPaintOptions({ retouch: { [spec.id]: v } }) }, spec.id)),
2694
+ /* @__PURE__ */ jsx14("div", { className: "flex flex-wrap gap-3 text-foreground", children: RETOUCH_TOGGLES.filter((t) => t.tools.includes(tool)).map((t) => /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
2695
+ /* @__PURE__ */ jsx14(ImageCheckbox, { label: t.label, checked: retouch[t.id], onChange: (on) => controller.setPaintOptions({ retouch: { [t.id]: on } }) }),
2609
2696
  t.label
2610
2697
  ] }, t.id)) })
2611
2698
  ] }),
2612
- /* @__PURE__ */ jsxs11("div", { className: "flex flex-wrap gap-3 text-foreground", role: "group", "aria-label": "Pressure", children: [
2613
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2614
- /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Pressure controls size", checked: brush.pressureSize, onChange: (on) => controller.setPaintOptions({ brush: { pressureSize: on } }) }),
2699
+ /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap gap-3 text-foreground", role: "group", "aria-label": "Pressure", children: [
2700
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
2701
+ /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Pressure controls size", checked: brush.pressureSize, onChange: (on) => controller.setPaintOptions({ brush: { pressureSize: on } }) }),
2615
2702
  "Pressure size"
2616
2703
  ] }),
2617
- /* @__PURE__ */ jsxs11("label", { className: "flex items-center gap-1.5", children: [
2618
- /* @__PURE__ */ jsx13(ImageCheckbox, { label: "Pressure controls opacity", checked: brush.pressureOpacity, onChange: (on) => controller.setPaintOptions({ brush: { pressureOpacity: on } }) }),
2704
+ /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1.5", children: [
2705
+ /* @__PURE__ */ jsx14(ImageCheckbox, { label: "Pressure controls opacity", checked: brush.pressureOpacity, onChange: (on) => controller.setPaintOptions({ brush: { pressureOpacity: on } }) }),
2619
2706
  "Pressure opacity"
2620
2707
  ] })
2621
2708
  ] }),
2622
- /* @__PURE__ */ jsxs11("div", { className: "flex gap-1", children: [
2623
- /* @__PURE__ */ jsx13("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.fillPixels()), children: "Fill" }),
2624
- /* @__PURE__ */ jsx13("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.clearPixels()), children: "Clear" })
2709
+ /* @__PURE__ */ jsxs12("div", { className: "flex gap-1", children: [
2710
+ /* @__PURE__ */ jsx14("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.fillPixels()), children: "Fill" }),
2711
+ /* @__PURE__ */ jsx14("button", { type: "button", className: imageChipClass(false), onClick: () => attempt(() => controller.clearPixels()), children: "Clear" })
2625
2712
  ] }),
2626
- error && /* @__PURE__ */ jsx13("p", { role: "alert", className: "text-destructive", children: error })
2713
+ error && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-destructive", children: error })
2627
2714
  ] });
2628
2715
  };
2629
2716
 
2630
2717
  // src/image-editor/ColorProfilePanel.tsx
2631
- import { useEffect as useEffect9, useState as useState10 } from "react";
2718
+ import { useEffect as useEffect9, useState as useState11 } from "react";
2632
2719
  import { COLOR_MODE_OPTIONS, INTENT_OPTIONS, PROOF_PROFILE_OPTIONS, WORKING_SPACE_OPTIONS, colorPanelView } from "@pixerate/editor/image-editor";
2633
- import { Fragment as Fragment2, jsx as jsx14, jsxs as jsxs12 } from "react/jsx-runtime";
2720
+ import { Fragment as Fragment2, jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
2634
2721
  var chip = imageChipClass(false);
2635
2722
  var select = "rounded bg-muted px-1 py-0.5 text-[11px] text-foreground";
2636
2723
  var ColorProfilePanel = ({ controller, className }) => {
2637
- const [, setTick] = useState10(0);
2724
+ const [, setTick] = useState11(0);
2638
2725
  useEffect9(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
2639
- const [target, setTarget] = useState10("display-p3");
2640
- const [intent, setIntent] = useState10("relative");
2641
- const [bpc, setBpc] = useState10(true);
2642
- const [error, setError] = useState10(null);
2726
+ const [target, setTarget] = useState11("display-p3");
2727
+ const [intent, setIntent] = useState11("relative");
2728
+ const [bpc, setBpc] = useState11(true);
2729
+ const [error, setError] = useState11(null);
2643
2730
  const view = colorPanelView(controller);
2644
2731
  const attempt = (fn) => {
2645
2732
  try {
@@ -2661,29 +2748,29 @@ var ColorProfilePanel = ({ controller, className }) => {
2661
2748
  })
2662
2749
  );
2663
2750
  };
2664
- return /* @__PURE__ */ jsxs12("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "color-profile-panel", children: [
2665
- /* @__PURE__ */ jsxs12("div", { className: "flex items-center gap-2", children: [
2666
- /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Profile" }),
2667
- /* @__PURE__ */ jsx14("span", { "data-testid": "color-profile-name", children: view.profileName })
2751
+ return /* @__PURE__ */ jsxs13("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "color-profile-panel", children: [
2752
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-2", children: [
2753
+ /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Profile" }),
2754
+ /* @__PURE__ */ jsx15("span", { "data-testid": "color-profile-name", children: view.profileName })
2668
2755
  ] }),
2669
- /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Colour mode", children: [
2670
- /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Mode" }),
2671
- /* @__PURE__ */ jsx14("select", { "aria-label": "Colour mode", className: select, value: view.mode, onChange: (e) => attempt(() => controller.setColorMode(e.target.value)), children: COLOR_MODE_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2672
- view.cmykProfileName && /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: view.cmykProfileName })
2756
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Colour mode", children: [
2757
+ /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Mode" }),
2758
+ /* @__PURE__ */ jsx15("select", { "aria-label": "Colour mode", className: select, value: view.mode, onChange: (e) => attempt(() => controller.setColorMode(e.target.value)), children: COLOR_MODE_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2759
+ view.cmykProfileName && /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: view.cmykProfileName })
2673
2760
  ] }),
2674
- /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Assign or convert", children: [
2675
- /* @__PURE__ */ jsx14("select", { "aria-label": "Target profile", className: select, value: target, onChange: (e) => setTarget(e.target.value), children: WORKING_SPACE_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, children: o.label }, o.id)) }),
2676
- /* @__PURE__ */ jsx14("select", { "aria-label": "Rendering intent", className: select, value: intent, onChange: (e) => setIntent(e.target.value), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2677
- /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2678
- /* @__PURE__ */ jsx14("input", { type: "checkbox", "aria-label": "Black point compensation", checked: bpc, onChange: (e) => setBpc(e.target.checked), className: "accent-primary" }),
2761
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Assign or convert", children: [
2762
+ /* @__PURE__ */ jsx15("select", { "aria-label": "Target profile", className: select, value: target, onChange: (e) => setTarget(e.target.value), children: WORKING_SPACE_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, children: o.label }, o.id)) }),
2763
+ /* @__PURE__ */ jsx15("select", { "aria-label": "Rendering intent", className: select, value: intent, onChange: (e) => setIntent(e.target.value), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, title: o.title, children: o.label }, o.id)) }),
2764
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
2765
+ /* @__PURE__ */ jsx15("input", { type: "checkbox", "aria-label": "Black point compensation", checked: bpc, onChange: (e) => setBpc(e.target.checked), className: "accent-primary" }),
2679
2766
  "BPC"
2680
2767
  ] }),
2681
- /* @__PURE__ */ jsx14("button", { type: "button", className: chip, title: "Edit \u203A Assign Profile: keep the numbers", onClick: () => attempt(() => controller.assignProfile(target)), children: "Assign" }),
2682
- /* @__PURE__ */ jsx14("button", { type: "button", className: chip, title: "Edit \u203A Convert to Profile: keep the look", onClick: () => attempt(() => controller.convertToProfile(target, { intent, bpc })), children: "Convert" })
2768
+ /* @__PURE__ */ jsx15("button", { type: "button", className: chip, title: "Edit \u203A Assign Profile: keep the numbers", onClick: () => attempt(() => controller.assignProfile(target)), children: "Assign" }),
2769
+ /* @__PURE__ */ jsx15("button", { type: "button", className: chip, title: "Edit \u203A Convert to Profile: keep the look", onClick: () => attempt(() => controller.convertToProfile(target, { intent, bpc })), children: "Convert" })
2683
2770
  ] }),
2684
- /* @__PURE__ */ jsxs12("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Proof setup", children: [
2685
- /* @__PURE__ */ jsx14("span", { className: "text-muted-foreground", children: "Proof" }),
2686
- /* @__PURE__ */ jsxs12(
2771
+ /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", role: "group", "aria-label": "Proof setup", children: [
2772
+ /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Proof" }),
2773
+ /* @__PURE__ */ jsxs13(
2687
2774
  "select",
2688
2775
  {
2689
2776
  "aria-label": "Proof profile",
@@ -2691,29 +2778,29 @@ var ColorProfilePanel = ({ controller, className }) => {
2691
2778
  value: view.proof?.id ?? "",
2692
2779
  onChange: (e) => e.target.value ? proofWith({ id: e.target.value }) : attempt(() => controller.setProofSetup(null)),
2693
2780
  children: [
2694
- /* @__PURE__ */ jsx14("option", { value: "", children: "Off" }),
2695
- PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, children: o.label }, o.id))
2781
+ /* @__PURE__ */ jsx15("option", { value: "", children: "Off" }),
2782
+ PROOF_PROFILE_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, children: o.label }, o.id))
2696
2783
  ]
2697
2784
  }
2698
2785
  ),
2699
- view.proof && /* @__PURE__ */ jsxs12(Fragment2, { children: [
2700
- /* @__PURE__ */ jsx14("select", { "aria-label": "Proof intent", className: select, value: view.proof.intent, onChange: (e) => proofWith({ intent: e.target.value }), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx14("option", { value: o.id, children: o.label }, o.id)) }),
2701
- /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2702
- /* @__PURE__ */ jsx14("input", { type: "checkbox", "aria-label": "Simulate paper colour", checked: view.proof.simulatePaper, onChange: (e) => proofWith({ simulatePaper: e.target.checked }), className: "accent-primary" }),
2786
+ view.proof && /* @__PURE__ */ jsxs13(Fragment2, { children: [
2787
+ /* @__PURE__ */ jsx15("select", { "aria-label": "Proof intent", className: select, value: view.proof.intent, onChange: (e) => proofWith({ intent: e.target.value }), children: INTENT_OPTIONS.map((o) => /* @__PURE__ */ jsx15("option", { value: o.id, children: o.label }, o.id)) }),
2788
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
2789
+ /* @__PURE__ */ jsx15("input", { type: "checkbox", "aria-label": "Simulate paper colour", checked: view.proof.simulatePaper, onChange: (e) => proofWith({ simulatePaper: e.target.checked }), className: "accent-primary" }),
2703
2790
  "Paper"
2704
2791
  ] }),
2705
- /* @__PURE__ */ jsxs12("label", { className: "flex items-center gap-1", children: [
2706
- /* @__PURE__ */ jsx14("input", { type: "checkbox", "aria-label": "Gamut warning", checked: view.proof.gamutWarning, onChange: (e) => proofWith({ gamutWarning: e.target.checked }), className: "accent-primary" }),
2792
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1", children: [
2793
+ /* @__PURE__ */ jsx15("input", { type: "checkbox", "aria-label": "Gamut warning", checked: view.proof.gamutWarning, onChange: (e) => proofWith({ gamutWarning: e.target.checked }), className: "accent-primary" }),
2707
2794
  "Gamut warning"
2708
2795
  ] })
2709
2796
  ] })
2710
2797
  ] }),
2711
- error && /* @__PURE__ */ jsx14("p", { role: "alert", className: "text-destructive", children: error })
2798
+ error && /* @__PURE__ */ jsx15("p", { role: "alert", className: "text-destructive", children: error })
2712
2799
  ] });
2713
2800
  };
2714
2801
 
2715
2802
  // src/image-editor/SelectionOptionsBar.tsx
2716
- import { useRef as useRef9, useState as useState13 } from "react";
2803
+ import { useRef as useRef10, useState as useState14 } from "react";
2717
2804
  import {
2718
2805
  COLOR_RANGE_PRESETS,
2719
2806
  COLOR_RANGE_PRESET_LABELS,
@@ -2724,20 +2811,20 @@ import {
2724
2811
  } from "@pixerate/editor/image-editor";
2725
2812
 
2726
2813
  // src/image-editor/SelectAndMaskWorkspace.tsx
2727
- import { useEffect as useEffect10, useMemo as useMemo4, useRef as useRef7, useState as useState11 } from "react";
2814
+ import { useEffect as useEffect10, useMemo as useMemo4, useRef as useRef8, useState as useState12 } from "react";
2728
2815
  import { REFINE_EDGE_CONTROLS, REFINE_OUTPUTS, SELECT_AND_MASK_TOOLS, SELECT_AND_MASK_VIEWS, SelectAndMaskSession } from "@pixerate/editor/image-editor";
2729
- import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
2816
+ import { jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
2730
2817
  var button = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
2731
2818
  var toggle = (on) => `${button} ${on ? "bg-primary text-primary-foreground border-primary" : ""}`;
2732
2819
  var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2733
2820
  const session = useMemo4(() => new SelectAndMaskSession(controller), [controller]);
2734
- const [, setRevision] = useState11(0);
2735
- const [zoom, setZoom] = useState11(1);
2736
- const [pan, setPan] = useState11({ x: 0, y: 0 });
2737
- const [busy, setBusy] = useState11(false);
2738
- const [error, setError] = useState11(null);
2739
- const canvasRef = useRef7(null);
2740
- const panFrom = useRef7(null);
2821
+ const [, setRevision] = useState12(0);
2822
+ const [zoom, setZoom] = useState12(1);
2823
+ const [pan, setPan] = useState12({ x: 0, y: 0 });
2824
+ const [busy, setBusy] = useState12(false);
2825
+ const [error, setError] = useState12(null);
2826
+ const canvasRef = useRef8(null);
2827
+ const panFrom = useRef8(null);
2741
2828
  const settings = session.settings;
2742
2829
  const size = session.previewSize;
2743
2830
  useEffect10(() => {
@@ -2811,7 +2898,7 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2811
2898
  };
2812
2899
  const toLayer = settings.output !== "selection" && settings.output !== "layer-mask";
2813
2900
  const brushTool = settings.tool === "quick-select" || settings.tool === "brush" || settings.tool === "refine-brush";
2814
- return /* @__PURE__ */ jsxs13(
2901
+ return /* @__PURE__ */ jsxs14(
2815
2902
  "div",
2816
2903
  {
2817
2904
  "data-testid": "select-and-mask-workspace",
@@ -2819,12 +2906,12 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2819
2906
  "aria-label": "Select and Mask",
2820
2907
  className: `fixed inset-0 z-50 flex bg-background text-xs text-foreground ${className}`,
2821
2908
  children: [
2822
- /* @__PURE__ */ jsx15("div", { role: "group", "aria-label": "Select and Mask tool", className: "flex flex-col gap-1 p-2 border-r border-border", children: SELECT_AND_MASK_TOOLS.map((t) => /* @__PURE__ */ jsx15("button", { type: "button", title: `${t.label} (${t.key.toUpperCase()})`, "aria-pressed": settings.tool === t.id, className: toggle(settings.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
2823
- /* @__PURE__ */ jsxs13("div", { className: "flex-1 flex flex-col min-w-0", children: [
2824
- /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-2 p-2 border-b border-border", children: [
2825
- brushTool && /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
2909
+ /* @__PURE__ */ jsx16("div", { role: "group", "aria-label": "Select and Mask tool", className: "flex flex-col gap-1 p-2 border-r border-border", children: SELECT_AND_MASK_TOOLS.map((t) => /* @__PURE__ */ jsx16("button", { type: "button", title: `${t.label} (${t.key.toUpperCase()})`, "aria-pressed": settings.tool === t.id, className: toggle(settings.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
2910
+ /* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col min-w-0", children: [
2911
+ /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2 p-2 border-b border-border", children: [
2912
+ brushTool && /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
2826
2913
  "Size",
2827
- /* @__PURE__ */ jsx15(
2914
+ /* @__PURE__ */ jsx16(
2828
2915
  "input",
2829
2916
  {
2830
2917
  type: "number",
@@ -2837,22 +2924,22 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2837
2924
  ),
2838
2925
  "px"
2839
2926
  ] }),
2840
- settings.tool !== "refine-brush" && settings.tool !== "hand" && settings.tool !== "zoom" && /* @__PURE__ */ jsxs13("div", { role: "group", "aria-label": "Stroke mode", className: "flex gap-1", children: [
2841
- /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": settings.brushMode === "add", className: toggle(settings.brushMode === "add"), onClick: () => set({ brushMode: "add" }), children: "Add" }),
2842
- /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": settings.brushMode === "subtract", className: toggle(settings.brushMode === "subtract"), onClick: () => set({ brushMode: "subtract" }), children: "Subtract" })
2927
+ settings.tool !== "refine-brush" && settings.tool !== "hand" && settings.tool !== "zoom" && /* @__PURE__ */ jsxs14("div", { role: "group", "aria-label": "Stroke mode", className: "flex gap-1", children: [
2928
+ /* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.brushMode === "add", className: toggle(settings.brushMode === "add"), onClick: () => set({ brushMode: "add" }), children: "Add" }),
2929
+ /* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.brushMode === "subtract", className: toggle(settings.brushMode === "subtract"), onClick: () => set({ brushMode: "subtract" }), children: "Subtract" })
2843
2930
  ] }),
2844
- /* @__PURE__ */ jsxs13("span", { className: "text-muted-foreground", children: [
2931
+ /* @__PURE__ */ jsxs14("span", { className: "text-muted-foreground", children: [
2845
2932
  session.edits.length,
2846
2933
  " strokes"
2847
2934
  ] }),
2848
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, disabled: !session.edits.length, onClick: () => session.undoEdit(), children: "Undo Stroke" }),
2849
- /* @__PURE__ */ jsxs13("span", { className: "font-mono text-muted-foreground", children: [
2935
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, disabled: !session.edits.length, onClick: () => session.undoEdit(), children: "Undo Stroke" }),
2936
+ /* @__PURE__ */ jsxs14("span", { className: "font-mono text-muted-foreground", children: [
2850
2937
  Math.round(zoom * 100),
2851
2938
  "%"
2852
2939
  ] }),
2853
- session.computing && /* @__PURE__ */ jsx15("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
2940
+ session.computing && /* @__PURE__ */ jsx16("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
2854
2941
  ] }),
2855
- /* @__PURE__ */ jsx15("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx15(
2942
+ /* @__PURE__ */ jsx16("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx16(
2856
2943
  "canvas",
2857
2944
  {
2858
2945
  ref: canvasRef,
@@ -2871,11 +2958,11 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2871
2958
  }
2872
2959
  ) })
2873
2960
  ] }),
2874
- /* @__PURE__ */ jsxs13("div", { className: "w-64 flex flex-col gap-3 p-3 border-l border-border overflow-y-auto", children: [
2875
- /* @__PURE__ */ jsx15("span", { className: imageSectionTitleClass, children: "View Mode" }),
2876
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2961
+ /* @__PURE__ */ jsxs14("div", { className: "w-64 flex flex-col gap-3 p-3 border-l border-border overflow-y-auto", children: [
2962
+ /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "View Mode" }),
2963
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2877
2964
  "View",
2878
- /* @__PURE__ */ jsx15(
2965
+ /* @__PURE__ */ jsx16(
2879
2966
  ImageSelect,
2880
2967
  {
2881
2968
  label: "View",
@@ -2885,36 +2972,36 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2885
2972
  }
2886
2973
  )
2887
2974
  ] }),
2888
- /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
2889
- /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
2890
- /* @__PURE__ */ jsx15("span", { children: "Opacity" }),
2891
- /* @__PURE__ */ jsxs13("span", { className: "font-mono", children: [
2975
+ /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
2976
+ /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
2977
+ /* @__PURE__ */ jsx16("span", { children: "Opacity" }),
2978
+ /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
2892
2979
  Math.round(settings.opacity * 100),
2893
2980
  "%"
2894
2981
  ] })
2895
2982
  ] }),
2896
- /* @__PURE__ */ jsx15(ImageRange, { label: "View opacity", min: 0, max: 100, step: 1, value: Math.round(settings.opacity * 100), onChange: (v) => set({ opacity: v / 100 }) })
2983
+ /* @__PURE__ */ jsx16(ImageRange, { label: "View opacity", min: 0, max: 100, step: 1, value: Math.round(settings.opacity * 100), onChange: (v) => set({ opacity: v / 100 }) })
2897
2984
  ] }),
2898
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2899
- /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Show Edge", checked: settings.showEdge, onChange: (on) => set({ showEdge: on }) }),
2985
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2986
+ /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Show Edge", checked: settings.showEdge, onChange: (on) => set({ showEdge: on }) }),
2900
2987
  "Show Edge (J)"
2901
2988
  ] }),
2902
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2903
- /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Show Original", checked: settings.showOriginal, onChange: (on) => set({ showOriginal: on }) }),
2989
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2990
+ /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Show Original", checked: settings.showOriginal, onChange: (on) => set({ showOriginal: on }) }),
2904
2991
  "Show Original (P)"
2905
2992
  ] }),
2906
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2907
- /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Real-Time Refinement", checked: settings.realTime, onChange: (on) => set({ realTime: on }) }),
2993
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2994
+ /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Real-Time Refinement", checked: settings.realTime, onChange: (on) => set({ realTime: on }) }),
2908
2995
  "Real-Time Refinement"
2909
2996
  ] }),
2910
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2911
- /* @__PURE__ */ jsx15(ImageCheckbox, { label: "High Quality Preview", checked: settings.highQuality, onChange: (on) => set({ highQuality: on }) }),
2997
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2998
+ /* @__PURE__ */ jsx16(ImageCheckbox, { label: "High Quality Preview", checked: settings.highQuality, onChange: (on) => set({ highQuality: on }) }),
2912
2999
  "High Quality Preview"
2913
3000
  ] }),
2914
- /* @__PURE__ */ jsx15("span", { className: imageSectionTitleClass, children: "Edge Detection and Refinement" }),
2915
- controller.segmentationProvider && /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
3001
+ /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Edge Detection and Refinement" }),
3002
+ controller.segmentationProvider && /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2916
3003
  "Mode",
2917
- /* @__PURE__ */ jsx15(
3004
+ /* @__PURE__ */ jsx16(
2918
3005
  ImageSelect,
2919
3006
  {
2920
3007
  label: "Refine mode",
@@ -2927,37 +3014,37 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2927
3014
  }
2928
3015
  )
2929
3016
  ] }),
2930
- REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
2931
- /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
2932
- /* @__PURE__ */ jsx15("span", { children: c.label }),
2933
- /* @__PURE__ */ jsxs13("span", { className: "font-mono", children: [
3017
+ REFINE_EDGE_CONTROLS.map((c) => /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
3018
+ /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
3019
+ /* @__PURE__ */ jsx16("span", { children: c.label }),
3020
+ /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
2934
3021
  settings.params[c.id],
2935
3022
  c.unit
2936
3023
  ] })
2937
3024
  ] }),
2938
- /* @__PURE__ */ jsx15(ImageRange, { label: `Workspace ${c.label}`, min: c.min, max: c.max, step: c.step, value: settings.params[c.id], onChange: (v) => set({ params: { ...settings.params, [c.id]: v } }) })
3025
+ /* @__PURE__ */ jsx16(ImageRange, { label: `Workspace ${c.label}`, min: c.min, max: c.max, step: c.step, value: settings.params[c.id], onChange: (v) => set({ params: { ...settings.params, [c.id]: v } }) })
2939
3026
  ] }, c.id)),
2940
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2941
- /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Workspace Smart Radius", checked: settings.params.smartRadius, onChange: (on) => set({ params: { ...settings.params, smartRadius: on } }) }),
3027
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
3028
+ /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Workspace Smart Radius", checked: settings.params.smartRadius, onChange: (on) => set({ params: { ...settings.params, smartRadius: on } }) }),
2942
3029
  "Smart Radius"
2943
3030
  ] }),
2944
- /* @__PURE__ */ jsx15("span", { className: imageSectionTitleClass, children: "Output Settings" }),
2945
- /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
2946
- /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
2947
- /* @__PURE__ */ jsxs13("span", { children: [
3031
+ /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Output Settings" }),
3032
+ /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
3033
+ /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
3034
+ /* @__PURE__ */ jsxs14("span", { children: [
2948
3035
  "Decontaminate Colors",
2949
3036
  toLayer ? "" : " (new layer or document outputs)"
2950
3037
  ] }),
2951
- /* @__PURE__ */ jsxs13("span", { className: "font-mono", children: [
3038
+ /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
2952
3039
  settings.decontaminate,
2953
3040
  "%"
2954
3041
  ] })
2955
3042
  ] }),
2956
- /* @__PURE__ */ jsx15(ImageRange, { label: "Workspace decontaminate amount", min: 0, max: 100, step: 1, value: settings.decontaminate, disabled: !toLayer, onChange: (v) => set({ decontaminate: v }) })
3043
+ /* @__PURE__ */ jsx16(ImageRange, { label: "Workspace decontaminate amount", min: 0, max: 100, step: 1, value: settings.decontaminate, disabled: !toLayer, onChange: (v) => set({ decontaminate: v }) })
2957
3044
  ] }),
2958
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
3045
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
2959
3046
  "Output To",
2960
- /* @__PURE__ */ jsx15(
3047
+ /* @__PURE__ */ jsx16(
2961
3048
  ImageSelect,
2962
3049
  {
2963
3050
  label: "Output to",
@@ -2967,16 +3054,16 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2967
3054
  }
2968
3055
  )
2969
3056
  ] }),
2970
- /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2", children: [
2971
- /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Remember Settings", checked: settings.remember, onChange: (on) => set({ remember: on }) }),
3057
+ /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
3058
+ /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Remember Settings", checked: settings.remember, onChange: (on) => set({ remember: on }) }),
2972
3059
  "Remember Settings"
2973
3060
  ] }),
2974
- (error ?? session.error) && /* @__PURE__ */ jsx15("p", { role: "alert", className: "text-destructive", children: error ?? session.error }),
2975
- session.note && /* @__PURE__ */ jsx15("p", { className: "text-muted-foreground", children: session.note }),
2976
- /* @__PURE__ */ jsxs13("div", { className: "flex gap-1 mt-auto", children: [
2977
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, onClick: () => session.reset(), children: "Reset" }),
2978
- /* @__PURE__ */ jsx15("button", { type: "button", className: button, onClick: () => onClose(null), children: "Cancel" }),
2979
- /* @__PURE__ */ jsx15("button", { type: "button", className: toggle(true), disabled: busy, "aria-busy": busy, onClick: () => void ok(), children: "OK" })
3061
+ (error ?? session.error) && /* @__PURE__ */ jsx16("p", { role: "alert", className: "text-destructive", children: error ?? session.error }),
3062
+ session.note && /* @__PURE__ */ jsx16("p", { className: "text-muted-foreground", children: session.note }),
3063
+ /* @__PURE__ */ jsxs14("div", { className: "flex gap-1 mt-auto", children: [
3064
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => session.reset(), children: "Reset" }),
3065
+ /* @__PURE__ */ jsx16("button", { type: "button", className: button, onClick: () => onClose(null), children: "Cancel" }),
3066
+ /* @__PURE__ */ jsx16("button", { type: "button", className: toggle(true), disabled: busy, "aria-busy": busy, onClick: () => void ok(), children: "OK" })
2980
3067
  ] })
2981
3068
  ] })
2982
3069
  ]
@@ -2985,21 +3072,21 @@ var SelectAndMaskWorkspace = ({ controller, onClose, className = "" }) => {
2985
3072
  };
2986
3073
 
2987
3074
  // src/image-editor/ContentAwareFillWorkspace.tsx
2988
- import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef8, useState as useState12 } from "react";
3075
+ import { useEffect as useEffect11, useMemo as useMemo5, useRef as useRef9, useState as useState13 } from "react";
2989
3076
  import { CONTENT_AWARE_FILL_SAMPLING, CONTENT_AWARE_FILL_TOOLS, ContentAwareFillSession } from "@pixerate/editor/image-editor";
2990
- import { Fragment as Fragment3, jsx as jsx16, jsxs as jsxs14 } from "react/jsx-runtime";
3077
+ import { Fragment as Fragment3, jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
2991
3078
  var button2 = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
2992
3079
  var toggle2 = (on) => `${button2} ${on ? "bg-primary text-primary-foreground border-primary" : ""}`;
2993
3080
  var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
2994
3081
  const session = useMemo5(() => new ContentAwareFillSession(controller), [controller]);
2995
- const [, setRevision] = useState12(0);
2996
- const [zoom, setZoom] = useState12(1);
2997
- const [pan, setPan] = useState12({ x: 0, y: 0 });
2998
- const [busy, setBusy] = useState12(false);
2999
- const [error, setError] = useState12(null);
3000
- const sourceRef = useRef8(null);
3001
- const previewRef = useRef8(null);
3002
- const panFrom = useRef8(null);
3082
+ const [, setRevision] = useState13(0);
3083
+ const [zoom, setZoom] = useState13(1);
3084
+ const [pan, setPan] = useState13({ x: 0, y: 0 });
3085
+ const [busy, setBusy] = useState13(false);
3086
+ const [error, setError] = useState13(null);
3087
+ const sourceRef = useRef9(null);
3088
+ const previewRef = useRef9(null);
3089
+ const panFrom = useRef9(null);
3003
3090
  const settings = session.settings;
3004
3091
  const win = session.window;
3005
3092
  useEffect11(() => {
@@ -3075,14 +3162,14 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3075
3162
  session.end();
3076
3163
  };
3077
3164
  const view = { maxWidth: "100%", maxHeight: "100%", transform: `translate(${pan.x}px, ${pan.y}px) scale(${zoom})`, imageRendering: zoom > 2 ? "pixelated" : void 0 };
3078
- return /* @__PURE__ */ jsxs14("div", { "data-testid": "content-aware-fill-workspace", role: "dialog", "aria-label": "Content-Aware Fill", className: `fixed inset-0 z-50 flex bg-background text-xs text-foreground ${className}`, children: [
3079
- /* @__PURE__ */ jsx16("div", { role: "group", "aria-label": "Content-Aware Fill tool", className: "flex flex-col gap-1 p-2 border-r border-border", children: CONTENT_AWARE_FILL_TOOLS.map((t) => /* @__PURE__ */ jsx16("button", { type: "button", title: `${t.label} (${t.key.toUpperCase()})`, "aria-pressed": settings.tool === t.id, className: toggle2(settings.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
3080
- /* @__PURE__ */ jsxs14("div", { className: "flex-1 flex flex-col min-w-0", children: [
3081
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-wrap items-center gap-2 p-2 border-b border-border", children: [
3082
- settings.tool === "sampling-brush" && /* @__PURE__ */ jsxs14(Fragment3, { children: [
3083
- /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3165
+ return /* @__PURE__ */ jsxs15("div", { "data-testid": "content-aware-fill-workspace", role: "dialog", "aria-label": "Content-Aware Fill", className: `fixed inset-0 z-50 flex bg-background text-xs text-foreground ${className}`, children: [
3166
+ /* @__PURE__ */ jsx17("div", { role: "group", "aria-label": "Content-Aware Fill tool", className: "flex flex-col gap-1 p-2 border-r border-border", children: CONTENT_AWARE_FILL_TOOLS.map((t) => /* @__PURE__ */ jsx17("button", { type: "button", title: `${t.label} (${t.key.toUpperCase()})`, "aria-pressed": settings.tool === t.id, className: toggle2(settings.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
3167
+ /* @__PURE__ */ jsxs15("div", { className: "flex-1 flex flex-col min-w-0", children: [
3168
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-2 p-2 border-b border-border", children: [
3169
+ settings.tool === "sampling-brush" && /* @__PURE__ */ jsxs15(Fragment3, { children: [
3170
+ /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3084
3171
  "Size",
3085
- /* @__PURE__ */ jsx16(
3172
+ /* @__PURE__ */ jsx17(
3086
3173
  "input",
3087
3174
  {
3088
3175
  type: "number",
@@ -3095,22 +3182,22 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3095
3182
  ),
3096
3183
  "px"
3097
3184
  ] }),
3098
- /* @__PURE__ */ jsxs14("div", { role: "group", "aria-label": "Sampling brush mode", className: "flex gap-1", children: [
3099
- /* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.brushMode === "add", className: toggle2(settings.brushMode === "add"), onClick: () => set({ brushMode: "add" }), children: "Add" }),
3100
- /* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.brushMode === "subtract", className: toggle2(settings.brushMode === "subtract"), onClick: () => set({ brushMode: "subtract" }), children: "Subtract" })
3185
+ /* @__PURE__ */ jsxs15("div", { role: "group", "aria-label": "Sampling brush mode", className: "flex gap-1", children: [
3186
+ /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": settings.brushMode === "add", className: toggle2(settings.brushMode === "add"), onClick: () => set({ brushMode: "add" }), children: "Add" }),
3187
+ /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": settings.brushMode === "subtract", className: toggle2(settings.brushMode === "subtract"), onClick: () => set({ brushMode: "subtract" }), children: "Subtract" })
3101
3188
  ] })
3102
3189
  ] }),
3103
- /* @__PURE__ */ jsxs14("span", { className: "font-mono text-muted-foreground", children: [
3190
+ /* @__PURE__ */ jsxs15("span", { className: "font-mono text-muted-foreground", children: [
3104
3191
  Math.round(zoom * 100),
3105
3192
  "%"
3106
3193
  ] }),
3107
- !session.showsWholeImage && /* @__PURE__ */ jsx16("button", { type: "button", className: button2, title: "Show (and sample from) more of the image around the selection", onClick: () => session.expandView(), children: "Expand View" }),
3108
- session.computing && /* @__PURE__ */ jsx16("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
3194
+ !session.showsWholeImage && /* @__PURE__ */ jsx17("button", { type: "button", className: button2, title: "Show (and sample from) more of the image around the selection", onClick: () => session.expandView(), children: "Expand View" }),
3195
+ session.computing && /* @__PURE__ */ jsx17("span", { role: "status", className: "text-muted-foreground", children: "Updating preview\u2026" })
3109
3196
  ] }),
3110
- /* @__PURE__ */ jsxs14("div", { className: "flex-1 grid grid-cols-2 gap-2 p-2 min-h-0", children: [
3111
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-col min-h-0", children: [
3112
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "Source (green: sampling area)" }),
3113
- /* @__PURE__ */ jsx16("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx16(
3197
+ /* @__PURE__ */ jsxs15("div", { className: "flex-1 grid grid-cols-2 gap-2 p-2 min-h-0", children: [
3198
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-col min-h-0", children: [
3199
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Source (green: sampling area)" }),
3200
+ /* @__PURE__ */ jsx17("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx17(
3114
3201
  "canvas",
3115
3202
  {
3116
3203
  ref: sourceRef,
@@ -3122,33 +3209,33 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3122
3209
  }
3123
3210
  ) })
3124
3211
  ] }),
3125
- /* @__PURE__ */ jsxs14("div", { className: "flex flex-col min-h-0", children: [
3126
- /* @__PURE__ */ jsx16("span", { className: "text-muted-foreground", children: "Preview" }),
3127
- /* @__PURE__ */ jsx16("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx16("canvas", { ref: previewRef, "data-testid": "content-aware-fill-preview", style: view }) })
3212
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-col min-h-0", children: [
3213
+ /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Preview" }),
3214
+ /* @__PURE__ */ jsx17("div", { className: "flex-1 overflow-hidden flex items-center justify-center bg-muted/30", children: /* @__PURE__ */ jsx17("canvas", { ref: previewRef, "data-testid": "content-aware-fill-preview", style: view }) })
3128
3215
  ] })
3129
3216
  ] })
3130
3217
  ] }),
3131
- /* @__PURE__ */ jsxs14("div", { className: "w-64 flex flex-col gap-3 p-3 border-l border-border overflow-y-auto", children: [
3132
- /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Sampling Area Options" }),
3133
- /* @__PURE__ */ jsx16("div", { role: "group", "aria-label": "Sampling area", className: "flex gap-1", children: CONTENT_AWARE_FILL_SAMPLING.map((m) => /* @__PURE__ */ jsx16("button", { type: "button", "aria-pressed": settings.sampling === m.id, className: toggle2(settings.sampling === m.id), onClick: () => set({ sampling: m.id }), children: m.label }, m.id)) }),
3134
- /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
3135
- /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Show Sampling Area", checked: settings.showSampling, onChange: (on) => set({ showSampling: on }) }),
3218
+ /* @__PURE__ */ jsxs15("div", { className: "w-64 flex flex-col gap-3 p-3 border-l border-border overflow-y-auto", children: [
3219
+ /* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Sampling Area Options" }),
3220
+ /* @__PURE__ */ jsx17("div", { role: "group", "aria-label": "Sampling area", className: "flex gap-1", children: CONTENT_AWARE_FILL_SAMPLING.map((m) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": settings.sampling === m.id, className: toggle2(settings.sampling === m.id), onClick: () => set({ sampling: m.id }), children: m.label }, m.id)) }),
3221
+ /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2", children: [
3222
+ /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Show Sampling Area", checked: settings.showSampling, onChange: (on) => set({ showSampling: on }) }),
3136
3223
  "Show Sampling Area"
3137
3224
  ] }),
3138
- /* @__PURE__ */ jsxs14("label", { className: "flex flex-col gap-1", children: [
3139
- /* @__PURE__ */ jsxs14("span", { className: "flex justify-between text-muted-foreground", children: [
3140
- /* @__PURE__ */ jsx16("span", { children: "Opacity" }),
3141
- /* @__PURE__ */ jsxs14("span", { className: "font-mono", children: [
3225
+ /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3226
+ /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3227
+ /* @__PURE__ */ jsx17("span", { children: "Opacity" }),
3228
+ /* @__PURE__ */ jsxs15("span", { className: "font-mono", children: [
3142
3229
  Math.round(settings.opacity * 100),
3143
3230
  "%"
3144
3231
  ] })
3145
3232
  ] }),
3146
- /* @__PURE__ */ jsx16(ImageRange, { label: "Sampling overlay opacity", min: 0, max: 100, step: 1, value: Math.round(settings.opacity * 100), onChange: (v) => set({ opacity: v / 100 }) })
3233
+ /* @__PURE__ */ jsx17(ImageRange, { label: "Sampling overlay opacity", min: 0, max: 100, step: 1, value: Math.round(settings.opacity * 100), onChange: (v) => set({ opacity: v / 100 }) })
3147
3234
  ] }),
3148
- /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Fill Settings" }),
3149
- /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
3235
+ /* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Fill Settings" }),
3236
+ /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
3150
3237
  "Seed",
3151
- /* @__PURE__ */ jsx16(
3238
+ /* @__PURE__ */ jsx17(
3152
3239
  "input",
3153
3240
  {
3154
3241
  type: "number",
@@ -3159,17 +3246,17 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3159
3246
  className: "w-16 bg-background border border-border rounded px-1 py-0.5 text-foreground"
3160
3247
  }
3161
3248
  ),
3162
- /* @__PURE__ */ jsx16("button", { type: "button", className: button2, onClick: () => set({ seed: settings.seed + 1 }), children: "Try Another" })
3249
+ /* @__PURE__ */ jsx17("button", { type: "button", className: button2, onClick: () => set({ seed: settings.seed + 1 }), children: "Try Another" })
3163
3250
  ] }),
3164
- /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
3165
- /* @__PURE__ */ jsx16(ImageCheckbox, { label: "Live Preview", checked: settings.livePreview, onChange: (on) => set({ livePreview: on }) }),
3251
+ /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2", children: [
3252
+ /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Live Preview", checked: settings.livePreview, onChange: (on) => set({ livePreview: on }) }),
3166
3253
  "Live Preview"
3167
3254
  ] }),
3168
- !settings.livePreview && /* @__PURE__ */ jsx16("button", { type: "button", className: button2, disabled: session.computing, onClick: () => void session.refresh(), children: "Preview" }),
3169
- /* @__PURE__ */ jsx16("span", { className: imageSectionTitleClass, children: "Output Settings" }),
3170
- /* @__PURE__ */ jsxs14("label", { className: "flex items-center gap-2", children: [
3255
+ !settings.livePreview && /* @__PURE__ */ jsx17("button", { type: "button", className: button2, disabled: session.computing, onClick: () => void session.refresh(), children: "Preview" }),
3256
+ /* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Output Settings" }),
3257
+ /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2", children: [
3171
3258
  "Output To",
3172
- /* @__PURE__ */ jsx16(
3259
+ /* @__PURE__ */ jsx17(
3173
3260
  ImageSelect,
3174
3261
  {
3175
3262
  label: "Fill output",
@@ -3183,18 +3270,18 @@ var ContentAwareFillWorkspace = ({ controller, onClose, className = "" }) => {
3183
3270
  }
3184
3271
  )
3185
3272
  ] }),
3186
- (error ?? session.error) && /* @__PURE__ */ jsx16("p", { role: "alert", className: "text-destructive", children: error ?? session.error }),
3187
- /* @__PURE__ */ jsxs14("div", { className: "flex gap-1 mt-auto", children: [
3188
- /* @__PURE__ */ jsx16("button", { type: "button", className: button2, onClick: () => session.reset(), children: "Reset" }),
3189
- /* @__PURE__ */ jsx16("button", { type: "button", className: button2, onClick: () => onClose(null), children: "Cancel" }),
3190
- /* @__PURE__ */ jsx16("button", { type: "button", className: toggle2(true), disabled: busy || !win, "aria-busy": busy, onClick: () => void ok(), children: "OK" })
3273
+ (error ?? session.error) && /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-destructive", children: error ?? session.error }),
3274
+ /* @__PURE__ */ jsxs15("div", { className: "flex gap-1 mt-auto", children: [
3275
+ /* @__PURE__ */ jsx17("button", { type: "button", className: button2, onClick: () => session.reset(), children: "Reset" }),
3276
+ /* @__PURE__ */ jsx17("button", { type: "button", className: button2, onClick: () => onClose(null), children: "Cancel" }),
3277
+ /* @__PURE__ */ jsx17("button", { type: "button", className: toggle2(true), disabled: busy || !win, "aria-busy": busy, onClick: () => void ok(), children: "OK" })
3191
3278
  ] })
3192
3279
  ] })
3193
3280
  ] });
3194
3281
  };
3195
3282
 
3196
3283
  // src/image-editor/SelectionOptionsBar.tsx
3197
- import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
3284
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
3198
3285
  var MODIFY_OPS = [
3199
3286
  { op: "expand", label: "Expand" },
3200
3287
  { op: "contract", label: "Contract" },
@@ -3218,15 +3305,15 @@ var SelectionOptionsBar = ({
3218
3305
  selectionDisplay,
3219
3306
  className = ""
3220
3307
  }) => {
3221
- const [radius, setRadius] = useState13(2);
3308
+ const [radius, setRadius] = useState14(2);
3222
3309
  const set = (patch) => onOptionsChange({ ...options, ...patch });
3223
3310
  const sel = selection === void 0 ? controller.getSelection() : selection;
3224
3311
  const display = selectionDisplay ?? (quickMask === void 0 ? controller.getSelectionDisplay() : quickMask ? "quickMask" : "ants");
3225
- const [preset, setPreset] = useState13("reds");
3226
- const [rangeStatus, setRangeStatus] = useState13(null);
3227
- const [colorStatus, setColorStatus] = useState13(null);
3228
- const [strokeWidth, setStrokeWidth] = useState13(4);
3229
- const [strokeLocation, setStrokeLocation] = useState13("outside");
3312
+ const [preset, setPreset] = useState14("reds");
3313
+ const [rangeStatus, setRangeStatus] = useState14(null);
3314
+ const [colorStatus, setColorStatus] = useState14(null);
3315
+ const [strokeWidth, setStrokeWidth] = useState14(4);
3316
+ const [strokeLocation, setStrokeLocation] = useState14("outside");
3230
3317
  const edit = (fn) => {
3231
3318
  setColorStatus(null);
3232
3319
  try {
@@ -3259,8 +3346,8 @@ var SelectionOptionsBar = ({
3259
3346
  setRangeStatus(err instanceof Error ? err.message : String(err));
3260
3347
  }
3261
3348
  };
3262
- const [task, setTask] = useState13(null);
3263
- const taskAbort = useRef9(null);
3349
+ const [task, setTask] = useState14(null);
3350
+ const taskAbort = useRef10(null);
3264
3351
  const tracked = () => {
3265
3352
  const abort = new AbortController();
3266
3353
  taskAbort.current = abort;
@@ -3272,9 +3359,9 @@ var SelectionOptionsBar = ({
3272
3359
  setTask(null);
3273
3360
  };
3274
3361
  const failure = (err) => err?.name === "AbortError" ? "Cancelled." : err instanceof Error ? err.message : String(err);
3275
- const [subject, setSubject] = useState13("");
3276
- const [segmenting, setSegmenting] = useState13(false);
3277
- const [subjectStatus, setSubjectStatus] = useState13(null);
3362
+ const [subject, setSubject] = useState14("");
3363
+ const [segmenting, setSegmenting] = useState14(false);
3364
+ const [subjectStatus, setSubjectStatus] = useState14(null);
3278
3365
  const selectSubject = async () => {
3279
3366
  const target = subject.trim();
3280
3367
  const canSegment = Boolean(controller.segmentationProvider);
@@ -3291,10 +3378,10 @@ var SelectionOptionsBar = ({
3291
3378
  setSegmenting(false);
3292
3379
  }
3293
3380
  };
3294
- const [workspace, setWorkspace] = useState13(false);
3295
- const [fillWorkspace, setFillWorkspace] = useState13(false);
3296
- const [skying, setSkying] = useState13(false);
3297
- const [skyStatus, setSkyStatus] = useState13(null);
3381
+ const [workspace, setWorkspace] = useState14(false);
3382
+ const [fillWorkspace, setFillWorkspace] = useState14(false);
3383
+ const [skying, setSkying] = useState14(false);
3384
+ const [skyStatus, setSkyStatus] = useState14(null);
3298
3385
  const selectSky = async () => {
3299
3386
  if (skying) return;
3300
3387
  setSkying(true);
@@ -3309,8 +3396,8 @@ var SelectionOptionsBar = ({
3309
3396
  setSkying(false);
3310
3397
  }
3311
3398
  };
3312
- const [focusing, setFocusing] = useState13(false);
3313
- const [focusStatus, setFocusStatus] = useState13(null);
3399
+ const [focusing, setFocusing] = useState14(false);
3400
+ const [focusStatus, setFocusStatus] = useState14(null);
3314
3401
  const selectFocusArea = async () => {
3315
3402
  if (focusing) return;
3316
3403
  setFocusing(true);
@@ -3331,24 +3418,24 @@ var SelectionOptionsBar = ({
3331
3418
  setFocusing(false);
3332
3419
  }
3333
3420
  };
3334
- return /* @__PURE__ */ jsxs15("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
3335
- /* @__PURE__ */ jsx17("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
3336
- /* @__PURE__ */ jsx17("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
3337
- options.tool === "wand" && /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-2", children: [
3338
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3339
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3340
- /* @__PURE__ */ jsx17("span", { children: "Tolerance" }),
3341
- /* @__PURE__ */ jsx17("span", { className: "font-mono", children: options.tolerance })
3421
+ return /* @__PURE__ */ jsxs16("div", { "data-testid": "selection-options-bar", className: `flex flex-col gap-3 text-xs ${className}`, children: [
3422
+ /* @__PURE__ */ jsx18("div", { role: "group", "aria-label": "Selection tool", className: "flex flex-wrap gap-1", children: SELECTION_TOOLS.map((t) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.tool === t.id, className: btn(options.tool === t.id), onClick: () => set({ tool: t.id }), children: t.label }, t.id)) }),
3423
+ /* @__PURE__ */ jsx18("div", { role: "group", "aria-label": "Selection mode", className: "flex flex-wrap gap-1", children: SELECTION_MODES.map((m) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.mode === m, className: btn(options.mode === m), onClick: () => set({ mode: m }), children: SELECTION_MODE_LABELS[m] }, m)) }),
3424
+ options.tool === "wand" && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2", children: [
3425
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3426
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3427
+ /* @__PURE__ */ jsx18("span", { children: "Tolerance" }),
3428
+ /* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.tolerance })
3342
3429
  ] }),
3343
- /* @__PURE__ */ jsx17(ImageRange, { label: "Tolerance", min: 0, max: 255, step: 1, value: options.tolerance, onChange: (v) => set({ tolerance: v }) })
3430
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Tolerance", min: 0, max: 255, step: 1, value: options.tolerance, onChange: (v) => set({ tolerance: v }) })
3344
3431
  ] }),
3345
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3346
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Contiguous", checked: options.contiguous, onChange: (on) => set({ contiguous: on }) }),
3432
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3433
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Contiguous", checked: options.contiguous, onChange: (on) => set({ contiguous: on }) }),
3347
3434
  "Contiguous"
3348
3435
  ] }),
3349
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3436
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3350
3437
  "Distance",
3351
- /* @__PURE__ */ jsx17(
3438
+ /* @__PURE__ */ jsx18(
3352
3439
  ImageSelect,
3353
3440
  {
3354
3441
  label: "Colour distance",
@@ -3361,13 +3448,13 @@ var SelectionOptionsBar = ({
3361
3448
  }
3362
3449
  )
3363
3450
  ] }),
3364
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3365
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Sample adjusted image", checked: options.sampleMerged, onChange: (on) => set({ sampleMerged: on }) }),
3451
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3452
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Sample adjusted image", checked: options.sampleMerged, onChange: (on) => set({ sampleMerged: on }) }),
3366
3453
  "Sample adjusted image"
3367
3454
  ] }),
3368
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3455
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3369
3456
  "Sample",
3370
- /* @__PURE__ */ jsx17(
3457
+ /* @__PURE__ */ jsx18(
3371
3458
  ImageSelect,
3372
3459
  {
3373
3460
  label: "Sample from",
@@ -3381,77 +3468,77 @@ var SelectionOptionsBar = ({
3381
3468
  )
3382
3469
  ] })
3383
3470
  ] }),
3384
- options.tool === "polygon" && /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "Click to add corners (Shift for 45\xB0), drag for a free-hand stretch; double-click, Enter or a click on the first corner closes it, Backspace removes a corner, Escape cancels." }),
3385
- options.tool === "magnetic" && /* @__PURE__ */ jsxs15("div", { "data-testid": "magnetic-lasso-options", className: "flex flex-col gap-2", children: [
3386
- /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "Click on an edge, then move along it: the outline snaps to the edge and adds points as it goes. Click to add a point; double-click, Enter or a click on the start closes it, Backspace removes the last point, Escape cancels." }),
3387
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3388
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3389
- /* @__PURE__ */ jsx17("span", { children: "Width" }),
3390
- /* @__PURE__ */ jsxs15("span", { className: "font-mono", children: [
3471
+ options.tool === "polygon" && /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Click to add corners (Shift for 45\xB0), drag for a free-hand stretch; double-click, Enter or a click on the first corner closes it, Backspace removes a corner, Escape cancels." }),
3472
+ options.tool === "magnetic" && /* @__PURE__ */ jsxs16("div", { "data-testid": "magnetic-lasso-options", className: "flex flex-col gap-2", children: [
3473
+ /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Click on an edge, then move along it: the outline snaps to the edge and adds points as it goes. Click to add a point; double-click, Enter or a click on the start closes it, Backspace removes the last point, Escape cancels." }),
3474
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3475
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3476
+ /* @__PURE__ */ jsx18("span", { children: "Width" }),
3477
+ /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
3391
3478
  options.magneticWidth ?? 10,
3392
3479
  " px"
3393
3480
  ] })
3394
3481
  ] }),
3395
- /* @__PURE__ */ jsx17(ImageRange, { label: "Magnetic lasso width", min: 1, max: 256, step: 1, value: options.magneticWidth ?? 10, onChange: (v) => set({ magneticWidth: v }) })
3482
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Magnetic lasso width", min: 1, max: 256, step: 1, value: options.magneticWidth ?? 10, onChange: (v) => set({ magneticWidth: v }) })
3396
3483
  ] }),
3397
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3398
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3399
- /* @__PURE__ */ jsx17("span", { children: "Contrast" }),
3400
- /* @__PURE__ */ jsxs15("span", { className: "font-mono", children: [
3484
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3485
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3486
+ /* @__PURE__ */ jsx18("span", { children: "Contrast" }),
3487
+ /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
3401
3488
  options.magneticContrast ?? 10,
3402
3489
  "%"
3403
3490
  ] })
3404
3491
  ] }),
3405
- /* @__PURE__ */ jsx17(ImageRange, { label: "Magnetic lasso contrast", min: 1, max: 100, step: 1, value: options.magneticContrast ?? 10, onChange: (v) => set({ magneticContrast: v }) })
3492
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Magnetic lasso contrast", min: 1, max: 100, step: 1, value: options.magneticContrast ?? 10, onChange: (v) => set({ magneticContrast: v }) })
3406
3493
  ] }),
3407
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3408
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3409
- /* @__PURE__ */ jsx17("span", { children: "Frequency" }),
3410
- /* @__PURE__ */ jsx17("span", { className: "font-mono", children: options.magneticFrequency ?? 57 })
3494
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3495
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3496
+ /* @__PURE__ */ jsx18("span", { children: "Frequency" }),
3497
+ /* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.magneticFrequency ?? 57 })
3411
3498
  ] }),
3412
- /* @__PURE__ */ jsx17(ImageRange, { label: "Magnetic lasso frequency", min: 0, max: 100, step: 1, value: options.magneticFrequency ?? 57, onChange: (v) => set({ magneticFrequency: v }) })
3499
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Magnetic lasso frequency", min: 0, max: 100, step: 1, value: options.magneticFrequency ?? 57, onChange: (v) => set({ magneticFrequency: v }) })
3413
3500
  ] })
3414
3501
  ] }),
3415
- options.tool === "quick" && /* @__PURE__ */ jsxs15("div", { "data-testid": "quick-selection-options", className: "flex flex-col gap-2", children: [
3416
- /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "Paint inside the area: the selection grows out to its edges. Each stroke adds (Alt-drag subtracts)." }),
3417
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3418
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3419
- /* @__PURE__ */ jsx17("span", { children: "Size" }),
3420
- /* @__PURE__ */ jsxs15("span", { className: "font-mono", children: [
3502
+ options.tool === "quick" && /* @__PURE__ */ jsxs16("div", { "data-testid": "quick-selection-options", className: "flex flex-col gap-2", children: [
3503
+ /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Paint inside the area: the selection grows out to its edges. Each stroke adds (Alt-drag subtracts)." }),
3504
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3505
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3506
+ /* @__PURE__ */ jsx18("span", { children: "Size" }),
3507
+ /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
3421
3508
  options.quickSize ?? 30,
3422
3509
  " px"
3423
3510
  ] })
3424
3511
  ] }),
3425
- /* @__PURE__ */ jsx17(ImageRange, { label: "Quick selection size", min: 1, max: 500, step: 1, value: options.quickSize ?? 30, onChange: (v) => set({ quickSize: v }) })
3512
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Quick selection size", min: 1, max: 500, step: 1, value: options.quickSize ?? 30, onChange: (v) => set({ quickSize: v }) })
3426
3513
  ] }),
3427
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3428
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Sample all layers", checked: options.quickSampleAll ?? true, onChange: (on) => set({ quickSampleAll: on }) }),
3514
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3515
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Sample all layers", checked: options.quickSampleAll ?? true, onChange: (on) => set({ quickSampleAll: on }) }),
3429
3516
  "Sample all layers"
3430
3517
  ] }),
3431
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3432
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Auto-enhance edges", checked: options.quickEnhance ?? false, onChange: (on) => set({ quickEnhance: on }) }),
3518
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3519
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Auto-enhance edges", checked: options.quickEnhance ?? false, onChange: (on) => set({ quickEnhance: on }) }),
3433
3520
  "Auto-enhance edges"
3434
3521
  ] })
3435
3522
  ] }),
3436
- options.tool === "object" && /* @__PURE__ */ jsxs15("div", { "data-testid": "object-selection-options", className: "flex flex-col gap-2", children: [
3437
- /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "Drag a box loosely around an object, or click on it. Shift adds, Alt subtracts." }),
3438
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3439
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Object sample all layers", checked: options.objectSampleAll ?? true, onChange: (on) => set({ objectSampleAll: on }) }),
3523
+ options.tool === "object" && /* @__PURE__ */ jsxs16("div", { "data-testid": "object-selection-options", className: "flex flex-col gap-2", children: [
3524
+ /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Drag a box loosely around an object, or click on it. Shift adds, Alt subtracts." }),
3525
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3526
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Object sample all layers", checked: options.objectSampleAll ?? true, onChange: (on) => set({ objectSampleAll: on }) }),
3440
3527
  "Sample all layers"
3441
3528
  ] }),
3442
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3443
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Object auto-enhance edges", checked: options.objectEnhance ?? false, onChange: (on) => set({ objectEnhance: on }) }),
3529
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3530
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Object auto-enhance edges", checked: options.objectEnhance ?? false, onChange: (on) => set({ objectEnhance: on }) }),
3444
3531
  "Auto-enhance edges"
3445
3532
  ] })
3446
3533
  ] }),
3447
- (options.tool === "type" || options.tool === "type-vertical") && /* @__PURE__ */ jsxs15("div", { "data-testid": "type-mask-options", className: "flex flex-col gap-2", children: [
3448
- /* @__PURE__ */ jsxs15("p", { className: "text-muted-foreground", children: [
3534
+ (options.tool === "type" || options.tool === "type-vertical") && /* @__PURE__ */ jsxs16("div", { "data-testid": "type-mask-options", className: "flex flex-col gap-2", children: [
3535
+ /* @__PURE__ */ jsxs16("p", { className: "text-muted-foreground", children: [
3449
3536
  options.tool === "type-vertical" ? "Click where the column starts: the letters are stacked down from there, centred on the click." : "Click where the text starts (its baseline).",
3450
3537
  " Shift-click adds, Alt-click subtracts."
3451
3538
  ] }),
3452
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3539
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3453
3540
  "Text",
3454
- /* @__PURE__ */ jsx17(
3541
+ /* @__PURE__ */ jsx18(
3455
3542
  "input",
3456
3543
  {
3457
3544
  type: "text",
@@ -3462,9 +3549,9 @@ var SelectionOptionsBar = ({
3462
3549
  }
3463
3550
  )
3464
3551
  ] }),
3465
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3552
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3466
3553
  "Size",
3467
- /* @__PURE__ */ jsx17(
3554
+ /* @__PURE__ */ jsx18(
3468
3555
  "input",
3469
3556
  {
3470
3557
  type: "number",
@@ -3478,9 +3565,9 @@ var SelectionOptionsBar = ({
3478
3565
  ),
3479
3566
  "px"
3480
3567
  ] }),
3481
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3568
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3482
3569
  "Font",
3483
- /* @__PURE__ */ jsx17(
3570
+ /* @__PURE__ */ jsx18(
3484
3571
  "input",
3485
3572
  {
3486
3573
  type: "text",
@@ -3492,18 +3579,18 @@ var SelectionOptionsBar = ({
3492
3579
  )
3493
3580
  ] })
3494
3581
  ] }),
3495
- options.tool === "range" && /* @__PURE__ */ jsxs15("div", { "data-testid": "color-range-options", className: "flex flex-col gap-2", children: [
3496
- /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "Click a colour to select it; Shift-click adds a colour, Alt-click removes one." }),
3497
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3498
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3499
- /* @__PURE__ */ jsx17("span", { children: "Fuzziness" }),
3500
- /* @__PURE__ */ jsx17("span", { className: "font-mono", children: options.fuzziness ?? 40 })
3582
+ options.tool === "range" && /* @__PURE__ */ jsxs16("div", { "data-testid": "color-range-options", className: "flex flex-col gap-2", children: [
3583
+ /* @__PURE__ */ jsx18("p", { className: "text-muted-foreground", children: "Click a colour to select it; Shift-click adds a colour, Alt-click removes one." }),
3584
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3585
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3586
+ /* @__PURE__ */ jsx18("span", { children: "Fuzziness" }),
3587
+ /* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.fuzziness ?? 40 })
3501
3588
  ] }),
3502
- /* @__PURE__ */ jsx17(ImageRange, { label: "Fuzziness", min: 0, max: 200, step: 1, value: options.fuzziness ?? 40, onChange: (v) => set({ fuzziness: v }) })
3589
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Fuzziness", min: 0, max: 200, step: 1, value: options.fuzziness ?? 40, onChange: (v) => set({ fuzziness: v }) })
3503
3590
  ] }),
3504
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3591
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3505
3592
  "Localized radius",
3506
- /* @__PURE__ */ jsx17(
3593
+ /* @__PURE__ */ jsx18(
3507
3594
  "input",
3508
3595
  {
3509
3596
  type: "number",
@@ -3517,12 +3604,12 @@ var SelectionOptionsBar = ({
3517
3604
  ),
3518
3605
  "px"
3519
3606
  ] }),
3520
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3521
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Invert", checked: options.rangeInvert ?? false, onChange: (on) => set({ rangeInvert: on }) }),
3607
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3608
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Invert", checked: options.rangeInvert ?? false, onChange: (on) => set({ rangeInvert: on }) }),
3522
3609
  "Invert"
3523
3610
  ] }),
3524
- /* @__PURE__ */ jsxs15("div", { className: "flex items-center gap-1", children: [
3525
- /* @__PURE__ */ jsx17(
3611
+ /* @__PURE__ */ jsxs16("div", { className: "flex items-center gap-1", children: [
3612
+ /* @__PURE__ */ jsx18(
3526
3613
  ImageSelect,
3527
3614
  {
3528
3615
  label: "Color Range preset",
@@ -3531,13 +3618,13 @@ var SelectionOptionsBar = ({
3531
3618
  onChange: (v) => setPreset(v)
3532
3619
  }
3533
3620
  ),
3534
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => void applyPreset(), children: "Select" })
3621
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => void applyPreset(), children: "Select" })
3535
3622
  ] }),
3536
- rangeStatus && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-muted-foreground", children: rangeStatus })
3623
+ rangeStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: rangeStatus })
3537
3624
  ] }),
3538
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3625
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3539
3626
  "Feather",
3540
- /* @__PURE__ */ jsx17(
3627
+ /* @__PURE__ */ jsx18(
3541
3628
  "input",
3542
3629
  {
3543
3630
  type: "number",
@@ -3552,7 +3639,7 @@ var SelectionOptionsBar = ({
3552
3639
  ),
3553
3640
  "px"
3554
3641
  ] }),
3555
- /* @__PURE__ */ jsxs15(
3642
+ /* @__PURE__ */ jsxs16(
3556
3643
  "form",
3557
3644
  {
3558
3645
  "data-testid": "select-subject",
@@ -3562,8 +3649,8 @@ var SelectionOptionsBar = ({
3562
3649
  void selectSubject();
3563
3650
  },
3564
3651
  children: [
3565
- /* @__PURE__ */ jsxs15("div", { className: "flex gap-1", children: [
3566
- controller.segmentationProvider && /* @__PURE__ */ jsx17(
3652
+ /* @__PURE__ */ jsxs16("div", { className: "flex gap-1", children: [
3653
+ controller.segmentationProvider && /* @__PURE__ */ jsx18(
3567
3654
  "input",
3568
3655
  {
3569
3656
  type: "text",
@@ -3575,7 +3662,7 @@ var SelectionOptionsBar = ({
3575
3662
  className: "min-w-0 flex-1 bg-background border border-border rounded px-2 py-1 text-foreground"
3576
3663
  }
3577
3664
  ),
3578
- /* @__PURE__ */ jsx17(
3665
+ /* @__PURE__ */ jsx18(
3579
3666
  "button",
3580
3667
  {
3581
3668
  type: "submit",
@@ -3587,12 +3674,12 @@ var SelectionOptionsBar = ({
3587
3674
  }
3588
3675
  )
3589
3676
  ] }),
3590
- subjectStatus && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-muted-foreground", children: subjectStatus })
3677
+ subjectStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: subjectStatus })
3591
3678
  ]
3592
3679
  }
3593
3680
  ),
3594
- task && /* @__PURE__ */ jsxs15("div", { "data-testid": "selection-progress", className: "flex items-center gap-2", children: [
3595
- /* @__PURE__ */ jsx17(
3681
+ task && /* @__PURE__ */ jsxs16("div", { "data-testid": "selection-progress", className: "flex items-center gap-2", children: [
3682
+ /* @__PURE__ */ jsx18(
3596
3683
  "div",
3597
3684
  {
3598
3685
  role: "progressbar",
@@ -3601,69 +3688,69 @@ var SelectionOptionsBar = ({
3601
3688
  "aria-valuemax": 100,
3602
3689
  "aria-valuenow": Math.round(task.fraction * 100),
3603
3690
  className: "flex-1 h-1.5 rounded bg-muted overflow-hidden",
3604
- children: /* @__PURE__ */ jsx17("div", { className: "h-full bg-primary", style: { width: `${Math.round(task.fraction * 100)}%` } })
3691
+ children: /* @__PURE__ */ jsx18("div", { className: "h-full bg-primary", style: { width: `${Math.round(task.fraction * 100)}%` } })
3605
3692
  }
3606
3693
  ),
3607
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: task.stage }),
3608
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => taskAbort.current?.abort(), children: "Cancel" })
3694
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: task.stage }),
3695
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => taskAbort.current?.abort(), children: "Cancel" })
3609
3696
  ] }),
3610
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => setWorkspace(true), children: "Select and Mask\u2026" }),
3611
- workspace && /* @__PURE__ */ jsx17(SelectAndMaskWorkspace, { controller, onClose: () => setWorkspace(false) }),
3612
- /* @__PURE__ */ jsxs15("div", { "data-testid": "select-sky", className: "flex flex-col gap-1", children: [
3613
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: skying, "aria-busy": skying, onClick: () => void selectSky(), children: skying ? "Selecting\u2026" : "Select Sky" }),
3614
- skyStatus && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-muted-foreground", children: skyStatus })
3697
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => setWorkspace(true), children: "Select and Mask\u2026" }),
3698
+ workspace && /* @__PURE__ */ jsx18(SelectAndMaskWorkspace, { controller, onClose: () => setWorkspace(false) }),
3699
+ /* @__PURE__ */ jsxs16("div", { "data-testid": "select-sky", className: "flex flex-col gap-1", children: [
3700
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: skying, "aria-busy": skying, onClick: () => void selectSky(), children: skying ? "Selecting\u2026" : "Select Sky" }),
3701
+ skyStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: skyStatus })
3615
3702
  ] }),
3616
- /* @__PURE__ */ jsxs15("details", { "data-testid": "focus-area", className: "flex flex-col gap-2", children: [
3617
- /* @__PURE__ */ jsx17("summary", { className: "cursor-pointer text-foreground", children: "Focus Area" }),
3618
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-col gap-2 pt-2", children: [
3619
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3620
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3621
- /* @__PURE__ */ jsx17("span", { children: "In-focus range" }),
3622
- /* @__PURE__ */ jsx17("span", { className: "font-mono", children: options.focusRange ?? 50 })
3703
+ /* @__PURE__ */ jsxs16("details", { "data-testid": "focus-area", className: "flex flex-col gap-2", children: [
3704
+ /* @__PURE__ */ jsx18("summary", { className: "cursor-pointer text-foreground", children: "Focus Area" }),
3705
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2 pt-2", children: [
3706
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3707
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3708
+ /* @__PURE__ */ jsx18("span", { children: "In-focus range" }),
3709
+ /* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.focusRange ?? 50 })
3623
3710
  ] }),
3624
- /* @__PURE__ */ jsx17(ImageRange, { label: "In-focus range", min: 0, max: 100, step: 1, value: options.focusRange ?? 50, onChange: (v) => set({ focusRange: v }) })
3711
+ /* @__PURE__ */ jsx18(ImageRange, { label: "In-focus range", min: 0, max: 100, step: 1, value: options.focusRange ?? 50, onChange: (v) => set({ focusRange: v }) })
3625
3712
  ] }),
3626
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3627
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3628
- /* @__PURE__ */ jsx17("span", { children: "Image noise level" }),
3629
- /* @__PURE__ */ jsx17("span", { className: "font-mono", children: options.focusNoise ?? 0 })
3713
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3714
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3715
+ /* @__PURE__ */ jsx18("span", { children: "Image noise level" }),
3716
+ /* @__PURE__ */ jsx18("span", { className: "font-mono", children: options.focusNoise ?? 0 })
3630
3717
  ] }),
3631
- /* @__PURE__ */ jsx17(ImageRange, { label: "Image noise level", min: 0, max: 100, step: 1, value: options.focusNoise ?? 0, onChange: (v) => set({ focusNoise: v }) })
3718
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Image noise level", min: 0, max: 100, step: 1, value: options.focusNoise ?? 0, onChange: (v) => set({ focusNoise: v }) })
3632
3719
  ] }),
3633
- /* @__PURE__ */ jsxs15("label", { className: "flex flex-col gap-1", children: [
3634
- /* @__PURE__ */ jsxs15("span", { className: "flex justify-between text-muted-foreground", children: [
3635
- /* @__PURE__ */ jsx17("span", { children: "Soften edge" }),
3636
- /* @__PURE__ */ jsxs15("span", { className: "font-mono", children: [
3720
+ /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3721
+ /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3722
+ /* @__PURE__ */ jsx18("span", { children: "Soften edge" }),
3723
+ /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
3637
3724
  options.focusSoftness ?? 4,
3638
3725
  " px"
3639
3726
  ] })
3640
3727
  ] }),
3641
- /* @__PURE__ */ jsx17(ImageRange, { label: "Focus soften edge", min: 0, max: 50, step: 1, value: options.focusSoftness ?? 4, onChange: (v) => set({ focusSoftness: v }) })
3728
+ /* @__PURE__ */ jsx18(ImageRange, { label: "Focus soften edge", min: 0, max: 50, step: 1, value: options.focusSoftness ?? 4, onChange: (v) => set({ focusSoftness: v }) })
3642
3729
  ] }),
3643
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: focusing, "aria-busy": focusing, onClick: () => void selectFocusArea(), children: focusing ? "Selecting\u2026" : "Select Focus Area" }),
3644
- focusStatus && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-muted-foreground", children: focusStatus })
3730
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: focusing, "aria-busy": focusing, onClick: () => void selectFocusArea(), children: focusing ? "Selecting\u2026" : "Select Focus Area" }),
3731
+ focusStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: focusStatus })
3645
3732
  ] })
3646
3733
  ] }),
3647
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-2 text-foreground", children: [
3648
- /* @__PURE__ */ jsx17(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
3734
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3735
+ /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Anti-alias", checked: options.antiAlias, onChange: (on) => set({ antiAlias: on }) }),
3649
3736
  "Anti-alias"
3650
3737
  ] }),
3651
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1", children: [
3652
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
3653
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
3654
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
3655
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !controller.canReselect(), onClick: () => controller.reselect(), children: "Reselect" }),
3656
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, title: "Add connected pixels of a selected colour (wand tolerance)", onClick: () => void runColor("grow"), children: "Grow" }),
3657
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, title: "Add every pixel of a selected colour (wand tolerance)", onClick: () => void runColor("similar"), children: "Similar" })
3738
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1", children: [
3739
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
3740
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
3741
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
3742
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !controller.canReselect(), onClick: () => controller.reselect(), children: "Reselect" }),
3743
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, title: "Add connected pixels of a selected colour (wand tolerance)", onClick: () => void runColor("grow"), children: "Grow" }),
3744
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, title: "Add every pixel of a selected colour (wand tolerance)", onClick: () => void runColor("similar"), children: "Similar" })
3658
3745
  ] }),
3659
- /* @__PURE__ */ jsxs15("div", { role: "group", "aria-label": "Show selection", className: "flex flex-wrap items-center gap-1", children: [
3660
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Show" }),
3661
- DISPLAYS.map((d) => /* @__PURE__ */ jsx17("button", { type: "button", "aria-pressed": display === d.id, className: btn(display === d.id), onClick: () => controller.setSelectionDisplay(d.id), children: d.label }, d.id))
3746
+ /* @__PURE__ */ jsxs16("div", { role: "group", "aria-label": "Show selection", className: "flex flex-wrap items-center gap-1", children: [
3747
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Show" }),
3748
+ DISPLAYS.map((d) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": display === d.id, className: btn(display === d.id), onClick: () => controller.setSelectionDisplay(d.id), children: d.label }, d.id))
3662
3749
  ] }),
3663
- /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-1", children: [
3664
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3750
+ /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-1", children: [
3751
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3665
3752
  "Radius",
3666
- /* @__PURE__ */ jsx17(
3753
+ /* @__PURE__ */ jsx18(
3667
3754
  "input",
3668
3755
  {
3669
3756
  type: "number",
@@ -3677,12 +3764,12 @@ var SelectionOptionsBar = ({
3677
3764
  }
3678
3765
  )
3679
3766
  ] }),
3680
- MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
3767
+ MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
3681
3768
  ] }),
3682
- /* @__PURE__ */ jsxs15("div", { role: "group", "aria-label": "Edit selection", className: "flex flex-wrap items-center gap-1", children: [
3683
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3769
+ /* @__PURE__ */ jsxs16("div", { role: "group", "aria-label": "Edit selection", className: "flex flex-wrap items-center gap-1", children: [
3770
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
3684
3771
  "Stroke",
3685
- /* @__PURE__ */ jsx17(
3772
+ /* @__PURE__ */ jsx18(
3686
3773
  "input",
3687
3774
  {
3688
3775
  type: "number",
@@ -3697,7 +3784,7 @@ var SelectionOptionsBar = ({
3697
3784
  ),
3698
3785
  "px"
3699
3786
  ] }),
3700
- /* @__PURE__ */ jsx17(
3787
+ /* @__PURE__ */ jsx18(
3701
3788
  ImageSelect,
3702
3789
  {
3703
3790
  label: "Stroke location",
@@ -3710,28 +3797,28 @@ var SelectionOptionsBar = ({
3710
3797
  onChange: (v) => setStrokeLocation(v)
3711
3798
  }
3712
3799
  ),
3713
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.strokeSelection({ width: strokeWidth, location: strokeLocation })), children: "Stroke" }),
3714
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cropToSelection()), children: "Crop to Selection" }),
3715
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.contentAwareFill({ output: "new-layer" })), children: "Content-Aware Fill" }),
3716
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => setFillWorkspace(true), children: "Content-Aware Fill\u2026" }),
3717
- fillWorkspace && /* @__PURE__ */ jsx17(ContentAwareFillWorkspace, { controller, onClose: () => setFillWorkspace(false) })
3800
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.strokeSelection({ width: strokeWidth, location: strokeLocation })), children: "Stroke" }),
3801
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cropToSelection()), children: "Crop to Selection" }),
3802
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.contentAwareFill({ output: "new-layer" })), children: "Content-Aware Fill" }),
3803
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => setFillWorkspace(true), children: "Content-Aware Fill\u2026" }),
3804
+ fillWorkspace && /* @__PURE__ */ jsx18(ContentAwareFillWorkspace, { controller, onClose: () => setFillWorkspace(false) })
3718
3805
  ] }),
3719
- /* @__PURE__ */ jsxs15("div", { role: "group", "aria-label": "Clipboard", className: "flex flex-wrap gap-1", children: [
3720
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels()), children: "Copy" }),
3721
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels({ merged: true })), children: "Copy Merged" }),
3722
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cutPixels()), children: "Cut" }),
3723
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("new-layer")), children: "Paste" }),
3724
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("in-place")), children: "Paste in Place" }),
3725
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("into")), children: "Paste Into" }),
3726
- /* @__PURE__ */ jsx17("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("outside")), children: "Paste Outside" })
3806
+ /* @__PURE__ */ jsxs16("div", { role: "group", "aria-label": "Clipboard", className: "flex flex-wrap gap-1", children: [
3807
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels()), children: "Copy" }),
3808
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels({ merged: true })), children: "Copy Merged" }),
3809
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cutPixels()), children: "Cut" }),
3810
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("new-layer")), children: "Paste" }),
3811
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("in-place")), children: "Paste in Place" }),
3812
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("into")), children: "Paste Into" }),
3813
+ /* @__PURE__ */ jsx18("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("outside")), children: "Paste Outside" })
3727
3814
  ] }),
3728
- colorStatus && /* @__PURE__ */ jsx17("p", { role: "status", className: "text-muted-foreground", children: colorStatus }),
3729
- /* @__PURE__ */ jsx17("p", { "data-testid": "selection-status", className: "text-muted-foreground", children: describeSelection(sel) })
3815
+ colorStatus && /* @__PURE__ */ jsx18("p", { role: "status", className: "text-muted-foreground", children: colorStatus }),
3816
+ /* @__PURE__ */ jsx18("p", { "data-testid": "selection-status", className: "text-muted-foreground", children: describeSelection(sel) })
3730
3817
  ] });
3731
3818
  };
3732
3819
 
3733
3820
  // src/image-editor/RefineEdgePanel.tsx
3734
- import { useState as useState14 } from "react";
3821
+ import { useState as useState16 } from "react";
3735
3822
  import {
3736
3823
  ADJUSTMENT_KINDS as ADJUSTMENT_KINDS2,
3737
3824
  REFINE_EDGE_CONTROLS as REFINE_EDGE_CONTROLS2,
@@ -3739,18 +3826,67 @@ import {
3739
3826
  adjustmentKindLabel as adjustmentKindLabel2,
3740
3827
  layerMaskFromSelection
3741
3828
  } from "@pixerate/editor/image-editor";
3742
- import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
3743
- var DEFAULT_PARAMS = { radius: 8, smartRadius: false, smooth: 0, feather: 0, contrast: 0, shiftEdge: 0 };
3829
+
3830
+ // src/image-editor/MaskEdgeCheck.tsx
3831
+ import React14, { useState as useState15 } from "react";
3832
+ import { MASK_EDGE_THRESHOLDS } from "@pixerate/editor/image-editor";
3833
+ import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
3744
3834
  var button3 = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
3835
+ var MaskEdgeCheck = ({ controller, selection, target = "selection", layerId, className = "" }) => {
3836
+ const sel = selection === void 0 ? controller.getSelection() : selection;
3837
+ const [result, setResult] = useState15(null);
3838
+ const [error, setError] = useState15(null);
3839
+ const report = result && (target !== "selection" || result.for === sel) ? result.report : null;
3840
+ const check = () => {
3841
+ setError(null);
3842
+ try {
3843
+ setResult({ report: controller.inspectMaskEdge(target, { layerId }), for: sel });
3844
+ } catch (err) {
3845
+ setResult(null);
3846
+ setError(err instanceof Error ? err.message : String(err));
3847
+ }
3848
+ };
3849
+ const T = MASK_EDGE_THRESHOLDS;
3850
+ const rows = report ? [
3851
+ { label: "Halo", value: report.haloScore, bad: report.haloScore >= T.halo },
3852
+ { label: "Edge alignment", value: report.edgeAlignment, bad: report.edgeAlignment < T.alignment },
3853
+ { label: "Jaggedness", value: report.jaggedness, bad: report.jaggedness >= T.jaggedness },
3854
+ { label: "Soft edge", value: report.softFraction, bad: report.softFraction >= T.soft }
3855
+ ] : [];
3856
+ return /* @__PURE__ */ jsxs17("div", { "data-testid": "mask-edge-check", className: `flex flex-col gap-1.5 text-xs ${className}`, children: [
3857
+ /* @__PURE__ */ jsx19("button", { type: "button", className: `${button3} self-start`, disabled: target === "selection" && !sel, onClick: check, children: "Check Edge" }),
3858
+ report && /* @__PURE__ */ jsxs17(Fragment4, { children: [
3859
+ /* @__PURE__ */ jsxs17("dl", { className: "grid grid-cols-[1fr_auto] gap-x-2 gap-y-0.5", children: [
3860
+ rows.map((r) => /* @__PURE__ */ jsxs17(React14.Fragment, { children: [
3861
+ /* @__PURE__ */ jsx19("dt", { className: "text-muted-foreground", children: r.label }),
3862
+ /* @__PURE__ */ jsx19("dd", { className: `font-mono text-right ${r.bad ? "text-destructive" : "text-foreground"}`, children: r.value })
3863
+ ] }, r.label)),
3864
+ /* @__PURE__ */ jsx19("dt", { className: "text-muted-foreground", children: "Holes / islands" }),
3865
+ /* @__PURE__ */ jsxs17("dd", { className: `font-mono text-right ${report.holes.count || report.islands.count ? "text-destructive" : "text-foreground"}`, children: [
3866
+ report.holes.count,
3867
+ " / ",
3868
+ report.islands.count
3869
+ ] })
3870
+ ] }),
3871
+ report.issues.length ? /* @__PURE__ */ jsx19("ul", { "data-testid": "mask-edge-issues", className: "list-disc pl-4 flex flex-col gap-1 text-foreground", children: report.issues.map((s) => /* @__PURE__ */ jsx19("li", { children: s }, s)) }) : /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground", children: "The edge looks clean." })
3872
+ ] }),
3873
+ error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
3874
+ ] });
3875
+ };
3876
+
3877
+ // src/image-editor/RefineEdgePanel.tsx
3878
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
3879
+ var DEFAULT_PARAMS = { radius: 8, smartRadius: false, smooth: 0, feather: 0, contrast: 0, shiftEdge: 0 };
3880
+ var button4 = "px-2 py-1 rounded-md border border-border bg-background text-[11px] text-foreground hover:bg-accent hover:text-accent-foreground disabled:opacity-40";
3745
3881
  var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
3746
- const [params, setParams] = useState14(DEFAULT_PARAMS);
3747
- const [busy, setBusy] = useState14(false);
3748
- const [error, setError] = useState14(null);
3749
- const [layerId, setLayerId] = useState14("");
3750
- const [newKind, setNewKind] = useState14("hueSaturation");
3751
- const [output, setOutput] = useState14("selection");
3752
- const [decontaminate, setDecontaminate] = useState14(0);
3753
- const [objectAware, setObjectAware] = useState14(false);
3882
+ const [params, setParams] = useState16(DEFAULT_PARAMS);
3883
+ const [busy, setBusy] = useState16(false);
3884
+ const [error, setError] = useState16(null);
3885
+ const [layerId, setLayerId] = useState16("");
3886
+ const [newKind, setNewKind] = useState16("hueSaturation");
3887
+ const [output, setOutput] = useState16("selection");
3888
+ const [decontaminate, setDecontaminate] = useState16(0);
3889
+ const [objectAware, setObjectAware] = useState16(false);
3754
3890
  const canObject = Boolean(controller.segmentationProvider);
3755
3891
  const toLayer = output !== "selection" && output !== "layer-mask";
3756
3892
  const sel = selection === void 0 ? controller.getSelection() : selection;
@@ -3770,17 +3906,17 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
3770
3906
  setBusy(false);
3771
3907
  }
3772
3908
  };
3773
- return /* @__PURE__ */ jsxs16("div", { "data-testid": "refine-edge-panel", className: `flex flex-col gap-3 text-xs ${className}`, children: [
3774
- /* @__PURE__ */ jsx18("span", { className: imageSectionTitleClass, children: "Refine Edge" }),
3775
- REFINE_EDGE_CONTROLS2.map((c) => /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3776
- /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3777
- /* @__PURE__ */ jsx18("span", { children: c.label }),
3778
- /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
3909
+ return /* @__PURE__ */ jsxs18("div", { "data-testid": "refine-edge-panel", className: `flex flex-col gap-3 text-xs ${className}`, children: [
3910
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Refine Edge" }),
3911
+ REFINE_EDGE_CONTROLS2.map((c) => /* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
3912
+ /* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
3913
+ /* @__PURE__ */ jsx20("span", { children: c.label }),
3914
+ /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
3779
3915
  params[c.id],
3780
3916
  c.unit
3781
3917
  ] })
3782
3918
  ] }),
3783
- /* @__PURE__ */ jsx18(
3919
+ /* @__PURE__ */ jsx20(
3784
3920
  "input",
3785
3921
  {
3786
3922
  type: "range",
@@ -3794,39 +3930,39 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
3794
3930
  }
3795
3931
  )
3796
3932
  ] }, c.id)),
3797
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3798
- /* @__PURE__ */ jsx18("input", { type: "checkbox", checked: params.smartRadius, onChange: (e) => setParams({ ...params, smartRadius: e.target.checked }) }),
3933
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-foreground", children: [
3934
+ /* @__PURE__ */ jsx20("input", { type: "checkbox", checked: params.smartRadius, onChange: (e) => setParams({ ...params, smartRadius: e.target.checked }) }),
3799
3935
  "Smart Radius"
3800
3936
  ] }),
3801
- canObject && /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-foreground", children: [
3802
- /* @__PURE__ */ jsx18("input", { type: "checkbox", "aria-label": "Object aware", checked: objectAware, onChange: (e) => setObjectAware(e.target.checked) }),
3937
+ canObject && /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-foreground", children: [
3938
+ /* @__PURE__ */ jsx20("input", { type: "checkbox", "aria-label": "Object aware", checked: objectAware, onChange: (e) => setObjectAware(e.target.checked) }),
3803
3939
  "Object aware (segmentation model)"
3804
3940
  ] }),
3805
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
3941
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 text-muted-foreground", children: [
3806
3942
  "Output to",
3807
- /* @__PURE__ */ jsx18(
3943
+ /* @__PURE__ */ jsx20(
3808
3944
  "select",
3809
3945
  {
3810
3946
  "aria-label": "Refine output",
3811
3947
  value: output,
3812
3948
  onChange: (e) => setOutput(e.target.value),
3813
3949
  className: "flex-1 bg-background border border-border rounded px-1 py-1 text-foreground",
3814
- children: REFINE_OUTPUTS2.filter((o) => !o.needsDocuments || controller.canOpenDocuments).map((o) => /* @__PURE__ */ jsx18("option", { value: o.id, children: o.label }, o.id))
3950
+ children: REFINE_OUTPUTS2.filter((o) => !o.needsDocuments || controller.canOpenDocuments).map((o) => /* @__PURE__ */ jsx20("option", { value: o.id, children: o.label }, o.id))
3815
3951
  }
3816
3952
  )
3817
3953
  ] }),
3818
- /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3819
- /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3820
- /* @__PURE__ */ jsxs16("span", { children: [
3954
+ /* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
3955
+ /* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
3956
+ /* @__PURE__ */ jsxs18("span", { children: [
3821
3957
  "Decontaminate colors",
3822
3958
  toLayer ? "" : " (new layer or document outputs)"
3823
3959
  ] }),
3824
- /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
3960
+ /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
3825
3961
  decontaminate,
3826
3962
  "%"
3827
3963
  ] })
3828
3964
  ] }),
3829
- /* @__PURE__ */ jsx18(
3965
+ /* @__PURE__ */ jsx20(
3830
3966
  "input",
3831
3967
  {
3832
3968
  type: "range",
@@ -3841,63 +3977,64 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
3841
3977
  }
3842
3978
  )
3843
3979
  ] }),
3844
- /* @__PURE__ */ jsxs16("div", { className: "flex gap-1", children: [
3845
- /* @__PURE__ */ jsx18("button", { type: "button", className: button3, disabled: !sel || busy, onClick: refine, children: "Refine Edge" }),
3846
- /* @__PURE__ */ jsx18("button", { type: "button", className: button3, onClick: () => setParams(DEFAULT_PARAMS), children: "Reset" })
3980
+ /* @__PURE__ */ jsxs18("div", { className: "flex gap-1", children: [
3981
+ /* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !sel || busy, onClick: refine, children: "Refine Edge" }),
3982
+ /* @__PURE__ */ jsx20("button", { type: "button", className: button4, onClick: () => setParams(DEFAULT_PARAMS), children: "Reset" })
3847
3983
  ] }),
3848
- error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "text-destructive", children: error }),
3849
- /* @__PURE__ */ jsx18("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] mt-2", children: "Layer Mask" }),
3850
- /* @__PURE__ */ jsxs16("div", { className: "flex gap-1 items-center", children: [
3851
- /* @__PURE__ */ jsx18(
3984
+ error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error }),
3985
+ /* @__PURE__ */ jsx20(MaskEdgeCheck, { controller, selection: sel }),
3986
+ /* @__PURE__ */ jsx20("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] mt-2", children: "Layer Mask" }),
3987
+ /* @__PURE__ */ jsxs18("div", { className: "flex gap-1 items-center", children: [
3988
+ /* @__PURE__ */ jsx20(
3852
3989
  "select",
3853
3990
  {
3854
3991
  "aria-label": "New masked layer kind",
3855
3992
  value: newKind,
3856
3993
  onChange: (e) => setNewKind(e.target.value),
3857
3994
  className: "flex-1 bg-background border border-border rounded px-1 py-1 text-foreground",
3858
- children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */ jsx18("option", { value: k.kind, children: k.label }, k.kind))
3995
+ children: ADJUSTMENT_KINDS2.map((k) => /* @__PURE__ */ jsx20("option", { value: k.kind, children: k.label }, k.kind))
3859
3996
  }
3860
3997
  ),
3861
- /* @__PURE__ */ jsx18(
3998
+ /* @__PURE__ */ jsx20(
3862
3999
  "button",
3863
4000
  {
3864
4001
  type: "button",
3865
- className: button3,
4002
+ className: button4,
3866
4003
  disabled: !sel,
3867
4004
  onClick: () => sel && setLayerId(controller.addAdjustmentLayer({ kind: newKind, mask: layerMaskFromSelection(sel) })),
3868
4005
  children: "New Masked Layer"
3869
4006
  }
3870
4007
  )
3871
4008
  ] }),
3872
- list.length > 0 && target && /* @__PURE__ */ jsxs16("div", { className: "flex flex-col gap-2", children: [
3873
- /* @__PURE__ */ jsx18(
4009
+ list.length > 0 && target && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-2", children: [
4010
+ /* @__PURE__ */ jsx20(
3874
4011
  "select",
3875
4012
  {
3876
4013
  "aria-label": "Mask layer",
3877
4014
  value: target.id,
3878
4015
  onChange: (e) => setLayerId(e.target.value),
3879
4016
  className: "bg-background border border-border rounded px-1 py-1 text-foreground",
3880
- children: list.map((l) => /* @__PURE__ */ jsxs16("option", { value: l.id, children: [
4017
+ children: list.map((l) => /* @__PURE__ */ jsxs18("option", { value: l.id, children: [
3881
4018
  l.name || adjustmentKindLabel2(l.kind),
3882
4019
  l.mask ? " (masked)" : ""
3883
4020
  ] }, l.id))
3884
4021
  }
3885
4022
  ),
3886
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap gap-1", children: [
3887
- /* @__PURE__ */ jsx18("button", { type: "button", className: button3, disabled: !sel, onClick: () => controller.applySelectionAsLayerMask(target.id), children: "Mask with Selection" }),
3888
- /* @__PURE__ */ jsx18("button", { type: "button", className: button3, disabled: !target.mask, onClick: () => controller.selectionFromLayerMask(target.id), children: "Load as Selection" }),
3889
- /* @__PURE__ */ jsx18("button", { type: "button", className: button3, disabled: !target.mask, onClick: () => controller.setAdjustmentLayerMask(target.id, null), children: "Remove Mask" })
4023
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4024
+ /* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !sel, onClick: () => controller.applySelectionAsLayerMask(target.id), children: "Mask with Selection" }),
4025
+ /* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !target.mask, onClick: () => controller.selectionFromLayerMask(target.id), children: "Load as Selection" }),
4026
+ /* @__PURE__ */ jsx20("button", { type: "button", className: button4, disabled: !target.mask, onClick: () => controller.setAdjustmentLayerMask(target.id, null), children: "Remove Mask" })
3890
4027
  ] }),
3891
- target.mask && /* @__PURE__ */ jsxs16(Fragment4, { children: [
3892
- /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3893
- /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3894
- /* @__PURE__ */ jsx18("span", { children: "Density" }),
3895
- /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
4028
+ target.mask && /* @__PURE__ */ jsxs18(Fragment5, { children: [
4029
+ /* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
4030
+ /* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
4031
+ /* @__PURE__ */ jsx20("span", { children: "Density" }),
4032
+ /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
3896
4033
  Math.round((target.mask.density ?? 1) * 100),
3897
4034
  "%"
3898
4035
  ] })
3899
4036
  ] }),
3900
- /* @__PURE__ */ jsx18(
4037
+ /* @__PURE__ */ jsx20(
3901
4038
  "input",
3902
4039
  {
3903
4040
  type: "range",
@@ -3911,15 +4048,15 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
3911
4048
  }
3912
4049
  )
3913
4050
  ] }),
3914
- /* @__PURE__ */ jsxs16("label", { className: "flex flex-col gap-1", children: [
3915
- /* @__PURE__ */ jsxs16("span", { className: "flex justify-between text-muted-foreground", children: [
3916
- /* @__PURE__ */ jsx18("span", { children: "Mask Feather" }),
3917
- /* @__PURE__ */ jsxs16("span", { className: "font-mono", children: [
4051
+ /* @__PURE__ */ jsxs18("label", { className: "flex flex-col gap-1", children: [
4052
+ /* @__PURE__ */ jsxs18("span", { className: "flex justify-between text-muted-foreground", children: [
4053
+ /* @__PURE__ */ jsx20("span", { children: "Mask Feather" }),
4054
+ /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
3918
4055
  target.mask.feather ?? 0,
3919
4056
  "px"
3920
4057
  ] })
3921
4058
  ] }),
3922
- /* @__PURE__ */ jsx18(
4059
+ /* @__PURE__ */ jsx20(
3923
4060
  "input",
3924
4061
  {
3925
4062
  type: "range",
@@ -3939,12 +4076,12 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
3939
4076
  };
3940
4077
 
3941
4078
  // src/image-editor/ChannelsPanel.tsx
3942
- import { useEffect as useEffect12, useRef as useRef10, useState as useState15 } from "react";
4079
+ import { useEffect as useEffect12, useRef as useRef11, useState as useState17 } from "react";
3943
4080
  import { MASK_FILE_ACCEPT, channelThumbnail, downloadMaskImage, openMaskFile, selectionModeFromModifiers } from "@pixerate/editor/image-editor";
3944
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
4081
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
3945
4082
  var btn2 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
3946
4083
  var ChannelThumb = ({ channel, size }) => {
3947
- const ref = useRef10(null);
4084
+ const ref = useRef11(null);
3948
4085
  useEffect12(() => {
3949
4086
  const canvas = ref.current;
3950
4087
  const ctx = canvas?.getContext("2d");
@@ -3956,15 +4093,15 @@ var ChannelThumb = ({ channel, size }) => {
3956
4093
  img.data.set(px.data);
3957
4094
  ctx.putImageData(img, 0, 0);
3958
4095
  }, [channel.mask]);
3959
- return /* @__PURE__ */ jsx19("canvas", { ref, "aria-hidden": "true", style: { width: size, height: size }, className: "shrink-0 rounded object-contain ring-1 ring-border bg-black" });
4096
+ return /* @__PURE__ */ jsx21("canvas", { ref, "aria-hidden": "true", style: { width: size, height: size }, className: "shrink-0 rounded object-contain ring-1 ring-border bg-black" });
3960
4097
  };
3961
4098
  var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
3962
- const [, setTick] = useState15(0);
4099
+ const [, setTick] = useState17(0);
3963
4100
  useEffect12(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
3964
- const [activeId, setActiveId] = useState15(null);
3965
- const [renaming, setRenaming] = useState15(null);
3966
- const [error, setError] = useState15(null);
3967
- const fileInput = useRef10(null);
4101
+ const [activeId, setActiveId] = useState17(null);
4102
+ const [renaming, setRenaming] = useState17(null);
4103
+ const [error, setError] = useState17(null);
4104
+ const fileInput = useRef11(null);
3968
4105
  const channels = controller.getChannels();
3969
4106
  const active = channels.find((c) => c.id === activeId) ?? null;
3970
4107
  const hasSelection = Boolean(controller.getSelection());
@@ -3986,13 +4123,13 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
3986
4123
  setError(err instanceof Error ? err.message : String(err));
3987
4124
  }
3988
4125
  };
3989
- return /* @__PURE__ */ jsxs17("div", { "data-testid": "channels-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
3990
- /* @__PURE__ */ jsxs17("div", { className: "flex items-center justify-between", children: [
3991
- /* @__PURE__ */ jsx19("span", { className: imageSectionTitleClass, children: "Channels" }),
3992
- /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": quickMask, className: btn2(quickMask), title: "Paint the selection: white selects, black deselects (Q)", onClick: () => controller.setQuickMaskMode(!quickMask), children: "Quick Mask" })
4126
+ return /* @__PURE__ */ jsxs19("div", { "data-testid": "channels-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
4127
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
4128
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Channels" }),
4129
+ /* @__PURE__ */ jsx21("button", { type: "button", "aria-pressed": quickMask, className: btn2(quickMask), title: "Paint the selection: white selects, black deselects (Q)", onClick: () => controller.setQuickMaskMode(!quickMask), children: "Quick Mask" })
3993
4130
  ] }),
3994
- channels.length === 0 && /* @__PURE__ */ jsx19("p", { className: "text-muted-foreground", children: "No channels. Save a selection to keep it." }),
3995
- /* @__PURE__ */ jsx19("ul", { role: "list", className: "flex flex-col gap-0.5", children: channels.map((c) => /* @__PURE__ */ jsxs17(
4131
+ channels.length === 0 && /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground", children: "No channels. Save a selection to keep it." }),
4132
+ /* @__PURE__ */ jsx21("ul", { role: "list", className: "flex flex-col gap-0.5", children: channels.map((c) => /* @__PURE__ */ jsxs19(
3996
4133
  "li",
3997
4134
  {
3998
4135
  "data-testid": "channel-row",
@@ -4004,7 +4141,7 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4004
4141
  },
4005
4142
  onDoubleClick: () => setRenaming(c.id),
4006
4143
  children: [
4007
- /* @__PURE__ */ jsx19(
4144
+ /* @__PURE__ */ jsx21(
4008
4145
  "button",
4009
4146
  {
4010
4147
  type: "button",
@@ -4018,8 +4155,8 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4018
4155
  children: c.visible ? "\u25CF" : "\u25CB"
4019
4156
  }
4020
4157
  ),
4021
- /* @__PURE__ */ jsx19(ChannelThumb, { channel: c, size: thumbnailSize }),
4022
- renaming === c.id ? /* @__PURE__ */ jsx19(
4158
+ /* @__PURE__ */ jsx21(ChannelThumb, { channel: c, size: thumbnailSize }),
4159
+ renaming === c.id ? /* @__PURE__ */ jsx21(
4023
4160
  "input",
4024
4161
  {
4025
4162
  autoFocus: true,
@@ -4036,16 +4173,16 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4036
4173
  if (e.key === "Escape") setRenaming(null);
4037
4174
  }
4038
4175
  }
4039
- ) : /* @__PURE__ */ jsx19("span", { className: "min-w-0 flex-1 truncate", children: c.name })
4176
+ ) : /* @__PURE__ */ jsx21("span", { className: "min-w-0 flex-1 truncate", children: c.name })
4040
4177
  ]
4041
4178
  },
4042
4179
  c.id
4043
4180
  )) }),
4044
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap gap-1", children: [
4045
- /* @__PURE__ */ jsx19("button", { type: "button", className: btn2(), disabled: !hasSelection, onClick: () => attempt(() => setActiveId(controller.saveSelection().id)), children: "Save Selection" }),
4046
- /* @__PURE__ */ jsx19("button", { type: "button", className: btn2(), disabled: !active || !hasSelection, title: "Add the selection to the channel", onClick: () => attempt(() => controller.saveSelection({ channelId: active.id, mode: "add" })), children: "Add to Channel" }),
4047
- /* @__PURE__ */ jsx19("button", { type: "button", className: btn2(), disabled: !active, onClick: () => attempt(() => setActiveId(controller.duplicateChannel(active.id).id)), children: "Duplicate" }),
4048
- /* @__PURE__ */ jsx19(
4181
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap gap-1", children: [
4182
+ /* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), disabled: !hasSelection, onClick: () => attempt(() => setActiveId(controller.saveSelection().id)), children: "Save Selection" }),
4183
+ /* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), disabled: !active || !hasSelection, title: "Add the selection to the channel", onClick: () => attempt(() => controller.saveSelection({ channelId: active.id, mode: "add" })), children: "Add to Channel" }),
4184
+ /* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), disabled: !active, onClick: () => attempt(() => setActiveId(controller.duplicateChannel(active.id).id)), children: "Duplicate" }),
4185
+ /* @__PURE__ */ jsx21(
4049
4186
  "button",
4050
4187
  {
4051
4188
  type: "button",
@@ -4058,8 +4195,8 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4058
4195
  children: "Delete"
4059
4196
  }
4060
4197
  ),
4061
- /* @__PURE__ */ jsx19("button", { type: "button", className: btn2(), title: "Load a mask image (white = selected) into a new channel", onClick: () => fileInput.current?.click(), children: "Import\u2026" }),
4062
- /* @__PURE__ */ jsx19(
4198
+ /* @__PURE__ */ jsx21("button", { type: "button", className: btn2(), title: "Load a mask image (white = selected) into a new channel", onClick: () => fileInput.current?.click(), children: "Import\u2026" }),
4199
+ /* @__PURE__ */ jsx21(
4063
4200
  "button",
4064
4201
  {
4065
4202
  type: "button",
@@ -4070,7 +4207,7 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4070
4207
  children: "Export PNG"
4071
4208
  }
4072
4209
  ),
4073
- /* @__PURE__ */ jsx19(
4210
+ /* @__PURE__ */ jsx21(
4074
4211
  "input",
4075
4212
  {
4076
4213
  ref: fileInput,
@@ -4085,22 +4222,22 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4085
4222
  }
4086
4223
  )
4087
4224
  ] }),
4088
- error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
4225
+ error && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", children: error })
4089
4226
  ] });
4090
4227
  };
4091
4228
 
4092
4229
  // src/image-editor/PathsPanel.tsx
4093
- import { useEffect as useEffect13, useState as useState16 } from "react";
4230
+ import { useEffect as useEffect13, useState as useState18 } from "react";
4094
4231
  import { pathSvgData, selectionModeFromModifiers as selectionModeFromModifiers2 } from "@pixerate/editor/image-editor";
4095
- import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
4232
+ import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
4096
4233
  var btn3 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
4097
4234
  var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4098
- const [, setTick] = useState16(0);
4235
+ const [, setTick] = useState18(0);
4099
4236
  useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4100
- const [renaming, setRenaming] = useState16(null);
4101
- const [color, setColor] = useState16("#000000");
4102
- const [width, setWidth] = useState16(2);
4103
- const [error, setError] = useState16(null);
4237
+ const [renaming, setRenaming] = useState18(null);
4238
+ const [color, setColor] = useState18("#000000");
4239
+ const [width, setWidth] = useState18(2);
4240
+ const [error, setError] = useState18(null);
4104
4241
  const paths = controller.getPaths();
4105
4242
  const activeId = controller.getState().activePathId ?? null;
4106
4243
  const active = paths.find((p) => p.id === activeId) ?? null;
@@ -4116,10 +4253,10 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4116
4253
  };
4117
4254
  return (
4118
4255
  // Clicking the panel's empty space deselects the path (the path tools then edit the active layer).
4119
- /* @__PURE__ */ jsxs18("div", { "data-testid": "paths-panel", className: `flex flex-col gap-2 text-xs ${className}`, onClick: (e) => e.target === e.currentTarget && attempt(() => controller.setActivePath(null)), children: [
4120
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Paths" }),
4121
- paths.length === 0 && /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground", children: "No paths. Make a work path from a selection." }),
4122
- /* @__PURE__ */ jsx20("ul", { role: "list", className: "flex flex-col gap-0.5 min-h-4", onClick: (e) => e.target === e.currentTarget && attempt(() => controller.setActivePath(null)), children: paths.map((p) => /* @__PURE__ */ jsxs18(
4256
+ /* @__PURE__ */ jsxs20("div", { "data-testid": "paths-panel", className: `flex flex-col gap-2 text-xs ${className}`, onClick: (e) => e.target === e.currentTarget && attempt(() => controller.setActivePath(null)), children: [
4257
+ /* @__PURE__ */ jsx22("span", { className: imageSectionTitleClass, children: "Paths" }),
4258
+ paths.length === 0 && /* @__PURE__ */ jsx22("p", { className: "text-muted-foreground", children: "No paths. Make a work path from a selection." }),
4259
+ /* @__PURE__ */ jsx22("ul", { role: "list", className: "flex flex-col gap-0.5 min-h-4", onClick: (e) => e.target === e.currentTarget && attempt(() => controller.setActivePath(null)), children: paths.map((p) => /* @__PURE__ */ jsxs20(
4123
4260
  "li",
4124
4261
  {
4125
4262
  "data-testid": "path-row",
@@ -4128,8 +4265,8 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4128
4265
  onClick: () => attempt(() => controller.setActivePath(p.id)),
4129
4266
  onDoubleClick: () => setRenaming(p.id),
4130
4267
  children: [
4131
- /* @__PURE__ */ jsx20("svg", { "aria-hidden": "true", viewBox: `0 0 ${w || 1} ${h || 1}`, style: { width: thumbnailSize, height: thumbnailSize }, className: "shrink-0 rounded ring-1 ring-border bg-background", children: /* @__PURE__ */ jsx20("path", { d: pathSvgData(p), fill: "currentColor", fillOpacity: 0.25, stroke: "currentColor", strokeWidth: Math.max(w, h) / 64, fillRule: p.fillRule ?? "nonzero" }) }),
4132
- renaming === p.id ? /* @__PURE__ */ jsx20(
4268
+ /* @__PURE__ */ jsx22("svg", { "aria-hidden": "true", viewBox: `0 0 ${w || 1} ${h || 1}`, style: { width: thumbnailSize, height: thumbnailSize }, className: "shrink-0 rounded ring-1 ring-border bg-background", children: /* @__PURE__ */ jsx22("path", { d: pathSvgData(p), fill: "currentColor", fillOpacity: 0.25, stroke: "currentColor", strokeWidth: Math.max(w, h) / 64, fillRule: p.fillRule ?? "nonzero" }) }),
4269
+ renaming === p.id ? /* @__PURE__ */ jsx22(
4133
4270
  "input",
4134
4271
  {
4135
4272
  autoFocus: true,
@@ -4148,13 +4285,13 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4148
4285
  if (e.key === "Escape") setRenaming(null);
4149
4286
  }
4150
4287
  }
4151
- ) : /* @__PURE__ */ jsx20("span", { className: `min-w-0 flex-1 truncate ${p.work ? "italic" : ""}`, children: p.name })
4288
+ ) : /* @__PURE__ */ jsx22("span", { className: `min-w-0 flex-1 truncate ${p.work ? "italic" : ""}`, children: p.name })
4152
4289
  ]
4153
4290
  },
4154
4291
  p.id
4155
4292
  )) }),
4156
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4157
- /* @__PURE__ */ jsx20(
4293
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap gap-1", children: [
4294
+ /* @__PURE__ */ jsx22(
4158
4295
  "button",
4159
4296
  {
4160
4297
  type: "button",
@@ -4165,15 +4302,15 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4165
4302
  children: "Load as Selection"
4166
4303
  }
4167
4304
  ),
4168
- /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !hasSelection, onClick: () => attempt(() => controller.makeWorkPath()), children: "Make Work Path" }),
4169
- active?.work && /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), onClick: () => setRenaming(active.id), children: "Save Path" }),
4170
- /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.addVectorMaskFromPath(active.id)), children: "Add Vector Mask" })
4305
+ /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !hasSelection, onClick: () => attempt(() => controller.makeWorkPath()), children: "Make Work Path" }),
4306
+ active?.work && /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), onClick: () => setRenaming(active.id), children: "Save Path" }),
4307
+ /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.addVectorMaskFromPath(active.id)), children: "Add Vector Mask" })
4171
4308
  ] }),
4172
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-1", children: [
4173
- /* @__PURE__ */ jsx20("input", { type: "color", "aria-label": "Path paint colour", value: color, onChange: (e) => setColor(e.target.value), className: "h-6 w-8 bg-background border border-border rounded" }),
4174
- /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.fillPath(active.id, { color })), children: "Fill Path" }),
4175
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
4176
- /* @__PURE__ */ jsx20(
4309
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-1", children: [
4310
+ /* @__PURE__ */ jsx22("input", { type: "color", "aria-label": "Path paint colour", value: color, onChange: (e) => setColor(e.target.value), className: "h-6 w-8 bg-background border border-border rounded" }),
4311
+ /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.fillPath(active.id, { color })), children: "Fill Path" }),
4312
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
4313
+ /* @__PURE__ */ jsx22(
4177
4314
  "input",
4178
4315
  {
4179
4316
  type: "number",
@@ -4188,24 +4325,24 @@ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4188
4325
  ),
4189
4326
  "px"
4190
4327
  ] }),
4191
- /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.strokePath(active.id, { width, color })), children: "Stroke Path" })
4328
+ /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.strokePath(active.id, { width, color })), children: "Stroke Path" })
4192
4329
  ] }),
4193
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4194
- /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.duplicatePath(active.id)), children: "Duplicate" }),
4195
- /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.deletePath(active.id)), children: "Delete" })
4330
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap gap-1", children: [
4331
+ /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.duplicatePath(active.id)), children: "Duplicate" }),
4332
+ /* @__PURE__ */ jsx22("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.deletePath(active.id)), children: "Delete" })
4196
4333
  ] }),
4197
- error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error })
4334
+ error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
4198
4335
  ] })
4199
4336
  );
4200
4337
  };
4201
4338
 
4202
4339
  // src/image-editor/FreeTransformOptionsBar.tsx
4203
- import { useEffect as useEffect14, useState as useState17 } from "react";
4340
+ import { useEffect as useEffect14, useState as useState19 } from "react";
4204
4341
  import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
4205
- import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4342
+ import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
4206
4343
  var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
4207
4344
  var FreeTransformOptionsBar = ({ tool, className }) => {
4208
- const [, setTick] = useState17(0);
4345
+ const [, setTick] = useState19(0);
4209
4346
  useEffect14(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
4210
4347
  const bar = tool.bar();
4211
4348
  if (!tool.active || !bar) return null;
@@ -4218,17 +4355,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4218
4355
  const v = Number(raw);
4219
4356
  if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
4220
4357
  };
4221
- return /* @__PURE__ */ jsxs19("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
4222
- /* @__PURE__ */ jsx21("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx21("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
4223
- /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx21("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
4224
- tool.mode === "warp" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
4225
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4226
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Warp" }),
4227
- /* @__PURE__ */ jsx21("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx21("option", { value: o.id, children: o.label }, o.id)) })
4358
+ return /* @__PURE__ */ jsxs21("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
4359
+ /* @__PURE__ */ jsx23("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx23("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
4360
+ /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
4361
+ tool.mode === "warp" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
4362
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4363
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "Warp" }),
4364
+ /* @__PURE__ */ jsx23("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx23("option", { value: o.id, children: o.label }, o.id)) })
4228
4365
  ] }),
4229
- ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4230
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
4231
- /* @__PURE__ */ jsx21(
4366
+ ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4367
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
4368
+ /* @__PURE__ */ jsx23(
4232
4369
  "input",
4233
4370
  {
4234
4371
  type: "number",
@@ -4249,9 +4386,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4249
4386
  },
4250
4387
  `${k}:${warp[k]}`
4251
4388
  ),
4252
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "%" })
4389
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "%" })
4253
4390
  ] }, k)),
4254
- /* @__PURE__ */ jsx21(
4391
+ /* @__PURE__ */ jsx23(
4255
4392
  "button",
4256
4393
  {
4257
4394
  type: "button",
@@ -4263,9 +4400,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4263
4400
  children: "Vertical"
4264
4401
  }
4265
4402
  ),
4266
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4267
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Grid" }),
4268
- /* @__PURE__ */ jsx21(
4403
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4404
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "Grid" }),
4405
+ /* @__PURE__ */ jsx23(
4269
4406
  "select",
4270
4407
  {
4271
4408
  "aria-label": "Warp grid",
@@ -4275,14 +4412,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4275
4412
  tool.setWarp({ columns: g.columns, rows: g.rows });
4276
4413
  },
4277
4414
  className: imageFieldClass,
4278
- children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx21("option", { value: g.id, children: g.label }, g.id))
4415
+ children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx23("option", { value: g.id, children: g.label }, g.id))
4279
4416
  }
4280
4417
  )
4281
4418
  ] })
4282
4419
  ] }),
4283
- tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", title: f.title, children: [
4284
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: f.label }),
4285
- /* @__PURE__ */ jsx21(
4420
+ tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", title: f.title, children: [
4421
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: f.label }),
4422
+ /* @__PURE__ */ jsx23(
4286
4423
  "input",
4287
4424
  {
4288
4425
  type: "number",
@@ -4302,8 +4439,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4302
4439
  },
4303
4440
  `${f.id}:${round(bar[f.id], f.unit)}`
4304
4441
  ),
4305
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: f.unit }),
4306
- f.id === "scaleX" && /* @__PURE__ */ jsx21(
4442
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: f.unit }),
4443
+ f.id === "scaleX" && /* @__PURE__ */ jsx23(
4307
4444
  "button",
4308
4445
  {
4309
4446
  type: "button",
@@ -4318,33 +4455,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4318
4455
  }
4319
4456
  )
4320
4457
  ] }, f.id)),
4321
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4322
- /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Interpolation" }),
4323
- /* @__PURE__ */ jsx21(
4458
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4459
+ /* @__PURE__ */ jsx23("span", { className: "text-muted-foreground", children: "Interpolation" }),
4460
+ /* @__PURE__ */ jsx23(
4324
4461
  "select",
4325
4462
  {
4326
4463
  "aria-label": "Interpolation",
4327
4464
  value: tool.interpolation,
4328
4465
  onChange: (e) => tool.setInterpolation(e.target.value),
4329
4466
  className: imageFieldClass,
4330
- children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx21("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
4467
+ children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx23("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
4331
4468
  }
4332
4469
  )
4333
4470
  ] }),
4334
- /* @__PURE__ */ jsx21("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
4335
- /* @__PURE__ */ jsx21("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
4336
- tool.error && /* @__PURE__ */ jsx21("span", { role: "alert", className: "text-destructive", children: tool.error })
4471
+ /* @__PURE__ */ jsx23("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
4472
+ /* @__PURE__ */ jsx23("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
4473
+ tool.error && /* @__PURE__ */ jsx23("span", { role: "alert", className: "text-destructive", children: tool.error })
4337
4474
  ] });
4338
4475
  };
4339
4476
 
4340
4477
  // src/image-editor/ShapeOptionsBar.tsx
4341
- import { useEffect as useEffect15, useState as useState18 } from "react";
4478
+ import { useEffect as useEffect15, useState as useState20 } from "react";
4342
4479
  import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
4343
- import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
4480
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
4344
4481
  var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4345
- const [, setTick] = useState18(0);
4482
+ const [, setTick] = useState20(0);
4346
4483
  useEffect15(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4347
- const [error, setError] = useState18(null);
4484
+ const [error, setError] = useState20(null);
4348
4485
  const active = controller.getActiveLayer();
4349
4486
  const shapeId = active?.type === "shape" ? active.id : null;
4350
4487
  const set = (change) => {
@@ -4358,22 +4495,22 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4358
4495
  }
4359
4496
  };
4360
4497
  const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
4361
- return /* @__PURE__ */ jsxs20("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
4362
- /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
4363
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-3", children: [
4364
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4365
- /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
4498
+ return /* @__PURE__ */ jsxs22("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
4499
+ /* @__PURE__ */ jsx24("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx24("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
4500
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-3", children: [
4501
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4502
+ /* @__PURE__ */ jsx24(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
4366
4503
  "Fill",
4367
- /* @__PURE__ */ jsx22(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
4504
+ /* @__PURE__ */ jsx24(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
4368
4505
  ] }),
4369
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4370
- /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
4506
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4507
+ /* @__PURE__ */ jsx24(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
4371
4508
  "Stroke",
4372
- /* @__PURE__ */ jsx22(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
4509
+ /* @__PURE__ */ jsx24(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
4373
4510
  ] }),
4374
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4511
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4375
4512
  "Width",
4376
- /* @__PURE__ */ jsx22(
4513
+ /* @__PURE__ */ jsx24(
4377
4514
  "input",
4378
4515
  {
4379
4516
  type: "number",
@@ -4387,52 +4524,52 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4387
4524
  )
4388
4525
  ] })
4389
4526
  ] }),
4390
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-3", children: [
4391
- options.kind === "rect" && /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4527
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-3", children: [
4528
+ options.kind === "rect" && /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4392
4529
  "Radius",
4393
- /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
4530
+ /* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
4394
4531
  ] }),
4395
- options.kind === "polygon" && /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4532
+ options.kind === "polygon" && /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4396
4533
  "Sides",
4397
- /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4534
+ /* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4398
4535
  ] }),
4399
- options.kind === "star" && /* @__PURE__ */ jsxs20(Fragment5, { children: [
4400
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4536
+ options.kind === "star" && /* @__PURE__ */ jsxs22(Fragment6, { children: [
4537
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4401
4538
  "Points",
4402
- /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4539
+ /* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4403
4540
  ] }),
4404
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4541
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4405
4542
  "Inner",
4406
- /* @__PURE__ */ jsx22(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
4543
+ /* @__PURE__ */ jsx24(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
4407
4544
  ] })
4408
4545
  ] }),
4409
- options.kind === "line" && /* @__PURE__ */ jsxs20(Fragment5, { children: [
4410
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4546
+ options.kind === "line" && /* @__PURE__ */ jsxs22(Fragment6, { children: [
4547
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4411
4548
  "Weight",
4412
- /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
4549
+ /* @__PURE__ */ jsx24("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
4413
4550
  ] }),
4414
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4415
- /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
4551
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-1", children: [
4552
+ /* @__PURE__ */ jsx24(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
4416
4553
  "Arrowhead"
4417
4554
  ] })
4418
4555
  ] })
4419
4556
  ] }),
4420
- /* @__PURE__ */ jsx22("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
4421
- error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
4557
+ /* @__PURE__ */ jsx24("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
4558
+ error && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: error })
4422
4559
  ] });
4423
4560
  };
4424
4561
 
4425
4562
  // src/image-editor/TypeOptionsBar.tsx
4426
- import { useEffect as useEffect16, useState as useState19 } from "react";
4563
+ import { useEffect as useEffect16, useState as useState21 } from "react";
4427
4564
  import { TEXT_ALIGNS, TEXT_ORIENTATIONS } from "@pixerate/editor/image-editor";
4428
- import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
4565
+ import { jsx as jsx25, jsxs as jsxs23 } from "react/jsx-runtime";
4429
4566
  var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
4430
4567
  var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
4431
4568
  var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
4432
- const [, setTick] = useState19(0);
4569
+ const [, setTick] = useState21(0);
4433
4570
  useEffect16(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4434
4571
  useEffect16(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
4435
- const [error, setError] = useState19(null);
4572
+ const [error, setError] = useState21(null);
4436
4573
  const active = controller.getActiveLayer();
4437
4574
  const typeId = !session && active?.type === "type" ? active.id : null;
4438
4575
  const here = session?.alive ? session.styleHere() : {};
@@ -4485,11 +4622,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4485
4622
  setError(e instanceof Error ? e.message : String(e));
4486
4623
  }
4487
4624
  };
4488
- return /* @__PURE__ */ jsxs21("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
4489
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2", children: [
4490
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4625
+ return /* @__PURE__ */ jsxs23("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
4626
+ /* @__PURE__ */ jsxs23("div", { className: "flex flex-wrap items-center gap-2", children: [
4627
+ /* @__PURE__ */ jsxs23("label", { className: "flex items-center gap-1", children: [
4491
4628
  "Font",
4492
- /* @__PURE__ */ jsx23(
4629
+ /* @__PURE__ */ jsx25(
4493
4630
  "input",
4494
4631
  {
4495
4632
  list: "pixerate-type-fonts",
@@ -4499,11 +4636,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4499
4636
  className: "w-32 rounded border border-border bg-background px-1 py-0.5"
4500
4637
  }
4501
4638
  ),
4502
- /* @__PURE__ */ jsx23("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx23("option", { value: f }, f)) })
4639
+ /* @__PURE__ */ jsx25("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx25("option", { value: f }, f)) })
4503
4640
  ] }),
4504
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4641
+ /* @__PURE__ */ jsxs23("label", { className: "flex items-center gap-1", children: [
4505
4642
  "Size",
4506
- /* @__PURE__ */ jsx23(
4643
+ /* @__PURE__ */ jsx25(
4507
4644
  "input",
4508
4645
  {
4509
4646
  type: "number",
@@ -4516,14 +4653,14 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4516
4653
  }
4517
4654
  )
4518
4655
  ] }),
4519
- /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
4520
- /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
4521
- /* @__PURE__ */ jsx23(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
4656
+ /* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
4657
+ /* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
4658
+ /* @__PURE__ */ jsx25(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
4522
4659
  ] }),
4523
- /* @__PURE__ */ jsx23("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
4524
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
4525
- TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
4526
- orientation === "vertical" && editedId && /* @__PURE__ */ jsx23(
4660
+ /* @__PURE__ */ jsx25("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
4661
+ /* @__PURE__ */ jsxs23("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
4662
+ TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx25("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
4663
+ orientation === "vertical" && editedId && /* @__PURE__ */ jsx25(
4527
4664
  "button",
4528
4665
  {
4529
4666
  type: "button",
@@ -4535,19 +4672,19 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4535
4672
  }
4536
4673
  )
4537
4674
  ] }),
4538
- /* @__PURE__ */ jsx23("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
4539
- missing.length > 0 && /* @__PURE__ */ jsxs21("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
4675
+ /* @__PURE__ */ jsx25("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
4676
+ missing.length > 0 && /* @__PURE__ */ jsxs23("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
4540
4677
  "Missing ",
4541
4678
  missing.length === 1 ? "font" : "fonts",
4542
4679
  ": ",
4543
4680
  missing.join(", ")
4544
4681
  ] }),
4545
- error && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", children: error })
4682
+ error && /* @__PURE__ */ jsx25("p", { role: "alert", className: "text-destructive", children: error })
4546
4683
  ] });
4547
4684
  };
4548
4685
 
4549
4686
  // src/image-editor/ImageEditor.tsx
4550
- import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
4687
+ import { Fragment as Fragment7, jsx as jsx26, jsxs as jsxs24 } from "react/jsx-runtime";
4551
4688
  var ImageEditor = ({
4552
4689
  editor: externalEditor,
4553
4690
  src,
@@ -4572,32 +4709,32 @@ var ImageEditor = ({
4572
4709
  return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
4573
4710
  });
4574
4711
  const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
4575
- const [activeTab, setActiveTab] = useState20("crop");
4576
- const rootRef = useRef11(null);
4712
+ const [activeTab, setActiveTab] = useState22("crop");
4713
+ const rootRef = useRef12(null);
4577
4714
  const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
4578
- const activeTabRef = useRef11(activeTab);
4715
+ const activeTabRef = useRef12(activeTab);
4579
4716
  activeTabRef.current = activeTab;
4580
4717
  const openPanel = async (ref) => {
4581
4718
  if (ref.kind !== "panel" || activeTabRef.current === ref.id) return;
4582
4719
  rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
4583
4720
  await new Promise((resolve) => setTimeout(resolve, 60));
4584
4721
  };
4585
- const [activeCropRatio, setActiveCropRatio] = useState20(null);
4586
- const [selectionOptions, setSelectionOptions] = useState20(DEFAULT_SELECTION_TOOL_OPTIONS2);
4587
- const [shapeOptions, setShapeOptions] = useState20(DEFAULT_SHAPE_TOOL_OPTIONS2);
4588
- const [typeOptions, setTypeOptions] = useState20(DEFAULT_TYPE_TOOL_OPTIONS2);
4589
- const [typeSession, setTypeSession] = useState20(null);
4590
- const [selectionError, setSelectionError] = useState20(null);
4591
- const [paintError, setPaintError] = useState20(null);
4592
- const [shapeTypeError, setShapeTypeError] = useState20(null);
4722
+ const [activeCropRatio, setActiveCropRatio] = useState22(null);
4723
+ const [selectionOptions, setSelectionOptions] = useState22(DEFAULT_SELECTION_TOOL_OPTIONS2);
4724
+ const [shapeOptions, setShapeOptions] = useState22(DEFAULT_SHAPE_TOOL_OPTIONS2);
4725
+ const [typeOptions, setTypeOptions] = useState22(DEFAULT_TYPE_TOOL_OPTIONS2);
4726
+ const [typeSession, setTypeSession] = useState22(null);
4727
+ const [selectionError, setSelectionError] = useState22(null);
4728
+ const [paintError, setPaintError] = useState22(null);
4729
+ const [shapeTypeError, setShapeTypeError] = useState22(null);
4593
4730
  const handleCanvasError = (source, message) => {
4594
4731
  if (source === "paint") setPaintError(message);
4595
4732
  else if (source === "select") setSelectionError(message);
4596
4733
  else setShapeTypeError(message);
4597
4734
  };
4598
4735
  const finishTyping = () => setTypeSession(null);
4599
- const transformToolRef = useRef11(null);
4600
- const transformControllerRef = useRef11(controller);
4736
+ const transformToolRef = useRef12(null);
4737
+ const transformControllerRef = useRef12(controller);
4601
4738
  if (!transformToolRef.current || transformControllerRef.current !== controller) {
4602
4739
  transformToolRef.current?.cancel();
4603
4740
  transformToolRef.current = new FreeTransformTool2(controller, {
@@ -4606,16 +4743,16 @@ var ImageEditor = ({
4606
4743
  transformControllerRef.current = controller;
4607
4744
  }
4608
4745
  const transformTool = transformToolRef.current;
4609
- const [, setTransformTick] = useState20(0);
4746
+ const [, setTransformTick] = useState22(0);
4610
4747
  useEffect17(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
4611
4748
  useEffect17(() => () => transformToolRef.current?.cancel(), []);
4612
- const [inpaintPrompt, setInpaintPrompt] = useState20("");
4613
- const [inpaintMaskMode, setInpaintMaskMode] = useState20("annotations");
4614
- const [isRemovingBg, setIsRemovingBg] = useState20(false);
4615
- const [isInpainting, setIsInpainting] = useState20(false);
4616
- const [aiError, setAiError] = useState20(null);
4617
- const [aiSuccess, setAiSuccess] = useState20(null);
4618
- const [aiTarget, setAiTarget] = useState20("auto");
4749
+ const [inpaintPrompt, setInpaintPrompt] = useState22("");
4750
+ const [inpaintMaskMode, setInpaintMaskMode] = useState22("annotations");
4751
+ const [isRemovingBg, setIsRemovingBg] = useState22(false);
4752
+ const [isInpainting, setIsInpainting] = useState22(false);
4753
+ const [aiError, setAiError] = useState22(null);
4754
+ const [aiSuccess, setAiSuccess] = useState22(null);
4755
+ const [aiTarget, setAiTarget] = useState22("auto");
4619
4756
  const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
4620
4757
  const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
4621
4758
  const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
@@ -4678,10 +4815,10 @@ var ImageEditor = ({
4678
4815
  setIsInpainting(false);
4679
4816
  }
4680
4817
  };
4681
- const [activeColor, setActiveColor] = useState20("#ef4444");
4682
- const [strokeWidth, setStrokeWidth] = useState20(3);
4683
- const [fontSize, setFontSize] = useState20(24);
4684
- const [textInput, setTextInput] = useState20("");
4818
+ const [activeColor, setActiveColor] = useState22("#ef4444");
4819
+ const [strokeWidth, setStrokeWidth] = useState22(3);
4820
+ const [fontSize, setFontSize] = useState22(24);
4821
+ const [textInput, setTextInput] = useState22("");
4685
4822
  useEffect17(() => {
4686
4823
  if (activeTab === "crop" && editor.state.activeTool !== "crop") {
4687
4824
  editor.setTool("crop");
@@ -4710,16 +4847,16 @@ var ImageEditor = ({
4710
4847
  link.click();
4711
4848
  }
4712
4849
  };
4713
- return /* @__PURE__ */ jsxs22(
4850
+ return /* @__PURE__ */ jsxs24(
4714
4851
  "div",
4715
4852
  {
4716
4853
  ref: rootRef,
4717
4854
  className: `${imageEditorFrameClass} ${className}`,
4718
4855
  style,
4719
4856
  children: [
4720
- /* @__PURE__ */ jsxs22("div", { className: imageEditorHeaderClass, children: [
4721
- /* @__PURE__ */ jsxs22("div", { role: "tablist", className: imageTabListClass, children: [
4722
- /* @__PURE__ */ jsx24(
4857
+ /* @__PURE__ */ jsxs24("div", { className: imageEditorHeaderClass, children: [
4858
+ /* @__PURE__ */ jsxs24("div", { role: "tablist", className: imageTabListClass, children: [
4859
+ /* @__PURE__ */ jsx26(
4723
4860
  "button",
4724
4861
  {
4725
4862
  type: "button",
@@ -4734,7 +4871,7 @@ var ImageEditor = ({
4734
4871
  children: "Transform & Crop"
4735
4872
  }
4736
4873
  ),
4737
- /* @__PURE__ */ jsx24(
4874
+ /* @__PURE__ */ jsx26(
4738
4875
  "button",
4739
4876
  {
4740
4877
  type: "button",
@@ -4749,7 +4886,7 @@ var ImageEditor = ({
4749
4886
  children: "Adjustments"
4750
4887
  }
4751
4888
  ),
4752
- /* @__PURE__ */ jsx24(
4889
+ /* @__PURE__ */ jsx26(
4753
4890
  "button",
4754
4891
  {
4755
4892
  type: "button",
@@ -4764,7 +4901,7 @@ var ImageEditor = ({
4764
4901
  children: "Layers"
4765
4902
  }
4766
4903
  ),
4767
- /* @__PURE__ */ jsx24(
4904
+ /* @__PURE__ */ jsx26(
4768
4905
  "button",
4769
4906
  {
4770
4907
  type: "button",
@@ -4779,7 +4916,7 @@ var ImageEditor = ({
4779
4916
  children: "Paint"
4780
4917
  }
4781
4918
  ),
4782
- /* @__PURE__ */ jsx24(
4919
+ /* @__PURE__ */ jsx26(
4783
4920
  "button",
4784
4921
  {
4785
4922
  type: "button",
@@ -4794,7 +4931,7 @@ var ImageEditor = ({
4794
4931
  children: "Select & Mask"
4795
4932
  }
4796
4933
  ),
4797
- /* @__PURE__ */ jsx24(
4934
+ /* @__PURE__ */ jsx26(
4798
4935
  "button",
4799
4936
  {
4800
4937
  type: "button",
@@ -4809,7 +4946,7 @@ var ImageEditor = ({
4809
4946
  children: "Annotations"
4810
4947
  }
4811
4948
  ),
4812
- /* @__PURE__ */ jsx24(
4949
+ /* @__PURE__ */ jsx26(
4813
4950
  "button",
4814
4951
  {
4815
4952
  type: "button",
@@ -4824,7 +4961,7 @@ var ImageEditor = ({
4824
4961
  children: "Depth Mask"
4825
4962
  }
4826
4963
  ),
4827
- /* @__PURE__ */ jsxs22(
4964
+ /* @__PURE__ */ jsxs24(
4828
4965
  "button",
4829
4966
  {
4830
4967
  type: "button",
@@ -4837,14 +4974,14 @@ var ImageEditor = ({
4837
4974
  "aria-selected": activeTab === "ai",
4838
4975
  className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
4839
4976
  children: [
4840
- /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4977
+ /* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4841
4978
  "AI Tools"
4842
4979
  ]
4843
4980
  }
4844
4981
  )
4845
4982
  ] }),
4846
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 text-xs", children: [
4847
- /* @__PURE__ */ jsx24(
4983
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 text-xs", children: [
4984
+ /* @__PURE__ */ jsx26(
4848
4985
  "button",
4849
4986
  {
4850
4987
  type: "button",
@@ -4855,7 +4992,7 @@ var ImageEditor = ({
4855
4992
  children: "\u21A9"
4856
4993
  }
4857
4994
  ),
4858
- /* @__PURE__ */ jsx24(
4995
+ /* @__PURE__ */ jsx26(
4859
4996
  "button",
4860
4997
  {
4861
4998
  type: "button",
@@ -4866,7 +5003,7 @@ var ImageEditor = ({
4866
5003
  children: "\u21AA"
4867
5004
  }
4868
5005
  ),
4869
- /* @__PURE__ */ jsx24(
5006
+ /* @__PURE__ */ jsx26(
4870
5007
  "button",
4871
5008
  {
4872
5009
  type: "button",
@@ -4875,8 +5012,8 @@ var ImageEditor = ({
4875
5012
  children: "Reset"
4876
5013
  }
4877
5014
  ),
4878
- /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-muted mx-1" }),
4879
- /* @__PURE__ */ jsx24(
5015
+ /* @__PURE__ */ jsx26("div", { className: "h-4 w-px bg-muted mx-1" }),
5016
+ /* @__PURE__ */ jsx26(
4880
5017
  "button",
4881
5018
  {
4882
5019
  type: "button",
@@ -4886,11 +5023,11 @@ var ImageEditor = ({
4886
5023
  children: "-"
4887
5024
  }
4888
5025
  ),
4889
- /* @__PURE__ */ jsxs22("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
5026
+ /* @__PURE__ */ jsxs24("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
4890
5027
  Math.round(state.zoom * 100),
4891
5028
  "%"
4892
5029
  ] }),
4893
- /* @__PURE__ */ jsx24(
5030
+ /* @__PURE__ */ jsx26(
4894
5031
  "button",
4895
5032
  {
4896
5033
  type: "button",
@@ -4900,8 +5037,8 @@ var ImageEditor = ({
4900
5037
  children: "+"
4901
5038
  }
4902
5039
  ),
4903
- /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-muted mx-1" }),
4904
- /* @__PURE__ */ jsx24(
5040
+ /* @__PURE__ */ jsx26("div", { className: "h-4 w-px bg-muted mx-1" }),
5041
+ /* @__PURE__ */ jsx26(
4905
5042
  "button",
4906
5043
  {
4907
5044
  type: "button",
@@ -4912,7 +5049,7 @@ var ImageEditor = ({
4912
5049
  children: "Hold Compare"
4913
5050
  }
4914
5051
  ),
4915
- /* @__PURE__ */ jsx24(
5052
+ /* @__PURE__ */ jsx26(
4916
5053
  "button",
4917
5054
  {
4918
5055
  type: "button",
@@ -4923,10 +5060,10 @@ var ImageEditor = ({
4923
5060
  )
4924
5061
  ] })
4925
5062
  ] }),
4926
- transformTool.active && /* @__PURE__ */ jsx24(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
4927
- !transformTool.active && transformTool.error && /* @__PURE__ */ jsx24("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
4928
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
4929
- /* @__PURE__ */ jsx24(
5063
+ transformTool.active && /* @__PURE__ */ jsx26(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
5064
+ !transformTool.active && transformTool.error && /* @__PURE__ */ jsx26("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
5065
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
5066
+ /* @__PURE__ */ jsx26(
4930
5067
  ImageEditorCanvas,
4931
5068
  {
4932
5069
  editor,
@@ -4950,11 +5087,11 @@ var ImageEditor = ({
4950
5087
  className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
4951
5088
  }
4952
5089
  ),
4953
- /* @__PURE__ */ jsxs22("div", { className: imageSidebarClass, children: [
4954
- activeTab === "crop" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
4955
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
4956
- /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-3 gap-2", children: [
4957
- /* @__PURE__ */ jsx24(
5090
+ /* @__PURE__ */ jsxs24("div", { className: imageSidebarClass, children: [
5091
+ activeTab === "crop" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 text-xs", children: [
5092
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
5093
+ /* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-3 gap-2", children: [
5094
+ /* @__PURE__ */ jsx26(
4958
5095
  "button",
4959
5096
  {
4960
5097
  type: "button",
@@ -4966,7 +5103,7 @@ var ImageEditor = ({
4966
5103
  children: "Freeform"
4967
5104
  }
4968
5105
  ),
4969
- /* @__PURE__ */ jsx24(
5106
+ /* @__PURE__ */ jsx26(
4970
5107
  "button",
4971
5108
  {
4972
5109
  type: "button",
@@ -4978,7 +5115,7 @@ var ImageEditor = ({
4978
5115
  children: "1:1 Square"
4979
5116
  }
4980
5117
  ),
4981
- /* @__PURE__ */ jsx24(
5118
+ /* @__PURE__ */ jsx26(
4982
5119
  "button",
4983
5120
  {
4984
5121
  type: "button",
@@ -4990,7 +5127,7 @@ var ImageEditor = ({
4990
5127
  children: "4:3 Standard"
4991
5128
  }
4992
5129
  ),
4993
- /* @__PURE__ */ jsx24(
5130
+ /* @__PURE__ */ jsx26(
4994
5131
  "button",
4995
5132
  {
4996
5133
  type: "button",
@@ -5002,7 +5139,7 @@ var ImageEditor = ({
5002
5139
  children: "16:9 Wide"
5003
5140
  }
5004
5141
  ),
5005
- /* @__PURE__ */ jsx24(
5142
+ /* @__PURE__ */ jsx26(
5006
5143
  "button",
5007
5144
  {
5008
5145
  type: "button",
@@ -5014,7 +5151,7 @@ var ImageEditor = ({
5014
5151
  children: "3:2 Photo"
5015
5152
  }
5016
5153
  ),
5017
- /* @__PURE__ */ jsx24(
5154
+ /* @__PURE__ */ jsx26(
5018
5155
  "button",
5019
5156
  {
5020
5157
  type: "button",
@@ -5027,10 +5164,10 @@ var ImageEditor = ({
5027
5164
  }
5028
5165
  )
5029
5166
  ] }),
5030
- /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5031
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
5032
- /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-2", children: [
5033
- /* @__PURE__ */ jsx24(
5167
+ /* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
5168
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
5169
+ /* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-2 gap-2", children: [
5170
+ /* @__PURE__ */ jsx26(
5034
5171
  "button",
5035
5172
  {
5036
5173
  type: "button",
@@ -5039,7 +5176,7 @@ var ImageEditor = ({
5039
5176
  children: "Rotate -90\xB0"
5040
5177
  }
5041
5178
  ),
5042
- /* @__PURE__ */ jsx24(
5179
+ /* @__PURE__ */ jsx26(
5043
5180
  "button",
5044
5181
  {
5045
5182
  type: "button",
@@ -5048,7 +5185,7 @@ var ImageEditor = ({
5048
5185
  children: "Rotate +90\xB0"
5049
5186
  }
5050
5187
  ),
5051
- /* @__PURE__ */ jsx24(
5188
+ /* @__PURE__ */ jsx26(
5052
5189
  "button",
5053
5190
  {
5054
5191
  type: "button",
@@ -5057,7 +5194,7 @@ var ImageEditor = ({
5057
5194
  children: "Flip Horizontal"
5058
5195
  }
5059
5196
  ),
5060
- /* @__PURE__ */ jsx24(
5197
+ /* @__PURE__ */ jsx26(
5061
5198
  "button",
5062
5199
  {
5063
5200
  type: "button",
@@ -5068,10 +5205,10 @@ var ImageEditor = ({
5068
5205
  )
5069
5206
  ] })
5070
5207
  ] }),
5071
- activeTab === "adjust" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5072
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5073
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
5074
- /* @__PURE__ */ jsx24(
5208
+ activeTab === "adjust" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
5209
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
5210
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
5211
+ /* @__PURE__ */ jsx26(
5075
5212
  "button",
5076
5213
  {
5077
5214
  type: "button",
@@ -5081,9 +5218,9 @@ var ImageEditor = ({
5081
5218
  }
5082
5219
  )
5083
5220
  ] }),
5084
- /* @__PURE__ */ jsx24(Histogram, { histogram: editor.histogram }),
5085
- IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs22(React19.Fragment, { children: [
5086
- /* @__PURE__ */ jsx24(
5221
+ /* @__PURE__ */ jsx26(Histogram, { histogram: editor.histogram }),
5222
+ IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs24(React21.Fragment, { children: [
5223
+ /* @__PURE__ */ jsx26(
5087
5224
  ControlSlider,
5088
5225
  {
5089
5226
  spec,
@@ -5092,14 +5229,14 @@ var ImageEditor = ({
5092
5229
  onChange: (v) => editor.setAdjustments({ [spec.id]: v })
5093
5230
  }
5094
5231
  ),
5095
- spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs22(
5232
+ spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs24(
5096
5233
  "div",
5097
5234
  {
5098
5235
  className: "flex items-center justify-between gap-2 rounded border border-amber-500/30 bg-amber-500/10 px-2 py-1.5 text-[10px] text-amber-600",
5099
5236
  "data-testid": "image-editor-process-notice",
5100
5237
  children: [
5101
- /* @__PURE__ */ jsx24("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
5102
- /* @__PURE__ */ jsx24(
5238
+ /* @__PURE__ */ jsx26("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
5239
+ /* @__PURE__ */ jsx26(
5103
5240
  "button",
5104
5241
  {
5105
5242
  type: "button",
@@ -5112,7 +5249,7 @@ var ImageEditor = ({
5112
5249
  }
5113
5250
  )
5114
5251
  ] }, spec.id)),
5115
- /* @__PURE__ */ jsx24("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx24(
5252
+ /* @__PURE__ */ jsx26("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx26(
5116
5253
  AdjustmentLayersPanel,
5117
5254
  {
5118
5255
  controller,
@@ -5121,9 +5258,9 @@ var ImageEditor = ({
5121
5258
  }
5122
5259
  ) })
5123
5260
  ] }),
5124
- activeTab === "layers" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5125
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Layers" }),
5126
- /* @__PURE__ */ jsx24(
5261
+ activeTab === "layers" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
5262
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Layers" }),
5263
+ /* @__PURE__ */ jsx26(
5127
5264
  "button",
5128
5265
  {
5129
5266
  type: "button",
@@ -5134,15 +5271,15 @@ var ImageEditor = ({
5134
5271
  children: "Free Transform"
5135
5272
  }
5136
5273
  ),
5137
- /* @__PURE__ */ jsx24(LayersPanel, { controller }),
5138
- effectsShown && /* @__PURE__ */ jsx24(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
5139
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Colour" }),
5140
- /* @__PURE__ */ jsx24(ColorProfilePanel, { controller })
5274
+ /* @__PURE__ */ jsx26(LayersPanel, { controller }),
5275
+ effectsShown && /* @__PURE__ */ jsx26(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
5276
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Colour" }),
5277
+ /* @__PURE__ */ jsx26(ColorProfilePanel, { controller })
5141
5278
  ] }),
5142
- activeTab === "paint" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5143
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Paint" }),
5144
- /* @__PURE__ */ jsx24(BrushOptionsBar, { controller }),
5145
- /* @__PURE__ */ jsx24(
5279
+ activeTab === "paint" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
5280
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Paint" }),
5281
+ /* @__PURE__ */ jsx26(BrushOptionsBar, { controller }),
5282
+ /* @__PURE__ */ jsx26(
5146
5283
  "button",
5147
5284
  {
5148
5285
  type: "button",
@@ -5153,12 +5290,12 @@ var ImageEditor = ({
5153
5290
  children: "Free Transform"
5154
5291
  }
5155
5292
  ),
5156
- paintError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
5157
- /* @__PURE__ */ jsx24("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx24(LayersPanel, { controller }) })
5293
+ paintError && /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
5294
+ /* @__PURE__ */ jsx26("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx26(LayersPanel, { controller }) })
5158
5295
  ] }),
5159
- activeTab === "annotate" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5160
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Shape & Type Layers, Paths" }),
5161
- /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type", "path-pen", "path-select", "direct-select"].map((t) => /* @__PURE__ */ jsx24(
5296
+ activeTab === "annotate" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
5297
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Shape & Type Layers, Paths" }),
5298
+ /* @__PURE__ */ jsx26("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type", "path-pen", "path-select", "direct-select"].map((t) => /* @__PURE__ */ jsx26(
5162
5299
  "button",
5163
5300
  {
5164
5301
  type: "button",
@@ -5169,13 +5306,13 @@ var ImageEditor = ({
5169
5306
  },
5170
5307
  t
5171
5308
  )) }),
5172
- state.activeTool === "shape" && /* @__PURE__ */ jsx24(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
5173
- state.activeTool === "type" && /* @__PURE__ */ jsx24(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
5174
- state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx24("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
5175
- shapeTypeError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
5176
- /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5177
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
5178
- /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx24(
5309
+ state.activeTool === "shape" && /* @__PURE__ */ jsx26(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
5310
+ state.activeTool === "type" && /* @__PURE__ */ jsx26(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
5311
+ state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx26("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
5312
+ shapeTypeError && /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
5313
+ /* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
5314
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
5315
+ /* @__PURE__ */ jsx26("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx26(
5179
5316
  "button",
5180
5317
  {
5181
5318
  type: "button",
@@ -5185,18 +5322,18 @@ var ImageEditor = ({
5185
5322
  },
5186
5323
  t
5187
5324
  )) }),
5188
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 mt-2", children: [
5189
- /* @__PURE__ */ jsx24("label", { className: "text-muted-foreground", children: "Color:" }),
5190
- /* @__PURE__ */ jsx24(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
5191
- /* @__PURE__ */ jsxs22("div", { className: "flex-1 ml-2", children: [
5192
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
5193
- /* @__PURE__ */ jsx24("span", { children: "Width:" }),
5194
- /* @__PURE__ */ jsxs22("span", { className: "font-mono", children: [
5325
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center gap-2 mt-2", children: [
5326
+ /* @__PURE__ */ jsx26("label", { className: "text-muted-foreground", children: "Color:" }),
5327
+ /* @__PURE__ */ jsx26(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
5328
+ /* @__PURE__ */ jsxs24("div", { className: "flex-1 ml-2", children: [
5329
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
5330
+ /* @__PURE__ */ jsx26("span", { children: "Width:" }),
5331
+ /* @__PURE__ */ jsxs24("span", { className: "font-mono", children: [
5195
5332
  strokeWidth,
5196
5333
  "px"
5197
5334
  ] })
5198
5335
  ] }),
5199
- /* @__PURE__ */ jsx24(
5336
+ /* @__PURE__ */ jsx26(
5200
5337
  "input",
5201
5338
  {
5202
5339
  type: "range",
@@ -5209,10 +5346,10 @@ var ImageEditor = ({
5209
5346
  )
5210
5347
  ] })
5211
5348
  ] }),
5212
- /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5213
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Add Text" }),
5214
- /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
5215
- /* @__PURE__ */ jsx24(
5349
+ /* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
5350
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Add Text" }),
5351
+ /* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
5352
+ /* @__PURE__ */ jsx26(
5216
5353
  "input",
5217
5354
  {
5218
5355
  type: "text",
@@ -5223,7 +5360,7 @@ var ImageEditor = ({
5223
5360
  className: "flex-1 bg-background border border-border rounded-lg px-2.5 py-1.5 text-xs text-foreground placeholder:text-muted-foreground focus:outline-none focus:border-primary"
5224
5361
  }
5225
5362
  ),
5226
- /* @__PURE__ */ jsx24(
5363
+ /* @__PURE__ */ jsx26(
5227
5364
  "button",
5228
5365
  {
5229
5366
  type: "button",
@@ -5233,14 +5370,14 @@ var ImageEditor = ({
5233
5370
  }
5234
5371
  )
5235
5372
  ] }),
5236
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between text-muted-foreground", children: [
5237
- /* @__PURE__ */ jsx24("span", { children: "Font Size:" }),
5238
- /* @__PURE__ */ jsxs22("span", { className: "font-mono", children: [
5373
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between text-muted-foreground", children: [
5374
+ /* @__PURE__ */ jsx26("span", { children: "Font Size:" }),
5375
+ /* @__PURE__ */ jsxs24("span", { className: "font-mono", children: [
5239
5376
  fontSize,
5240
5377
  "px"
5241
5378
  ] })
5242
5379
  ] }),
5243
- /* @__PURE__ */ jsx24(
5380
+ /* @__PURE__ */ jsx26(
5244
5381
  "input",
5245
5382
  {
5246
5383
  type: "range",
@@ -5251,14 +5388,14 @@ var ImageEditor = ({
5251
5388
  className: imageRangeClass
5252
5389
  }
5253
5390
  ),
5254
- /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5255
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5256
- /* @__PURE__ */ jsxs22("span", { className: "text-muted-foreground", children: [
5391
+ /* @__PURE__ */ jsx26("div", { className: imageDividerClass }),
5392
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
5393
+ /* @__PURE__ */ jsxs24("span", { className: "text-muted-foreground", children: [
5257
5394
  "Layers (",
5258
5395
  state.annotations.length,
5259
5396
  ")"
5260
5397
  ] }),
5261
- state.selectedAnnotationId && /* @__PURE__ */ jsx24(
5398
+ state.selectedAnnotationId && /* @__PURE__ */ jsx26(
5262
5399
  "button",
5263
5400
  {
5264
5401
  type: "button",
@@ -5267,7 +5404,7 @@ var ImageEditor = ({
5267
5404
  children: "Delete Selected"
5268
5405
  }
5269
5406
  ),
5270
- state.annotations.length > 0 && /* @__PURE__ */ jsx24(
5407
+ state.annotations.length > 0 && /* @__PURE__ */ jsx26(
5271
5408
  "button",
5272
5409
  {
5273
5410
  type: "button",
@@ -5278,10 +5415,10 @@ var ImageEditor = ({
5278
5415
  )
5279
5416
  ] })
5280
5417
  ] }),
5281
- activeTab === "depth" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5282
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5283
- /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
5284
- /* @__PURE__ */ jsx24(
5418
+ activeTab === "depth" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-3 text-xs", children: [
5419
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
5420
+ /* @__PURE__ */ jsx26("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
5421
+ /* @__PURE__ */ jsx26(
5285
5422
  "button",
5286
5423
  {
5287
5424
  type: "button",
@@ -5291,8 +5428,8 @@ var ImageEditor = ({
5291
5428
  }
5292
5429
  )
5293
5430
  ] }),
5294
- /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
5295
- /* @__PURE__ */ jsx24(
5431
+ /* @__PURE__ */ jsxs24("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
5432
+ /* @__PURE__ */ jsx26(
5296
5433
  "input",
5297
5434
  {
5298
5435
  type: "checkbox",
@@ -5301,12 +5438,12 @@ var ImageEditor = ({
5301
5438
  className: "rounded accent-primary"
5302
5439
  }
5303
5440
  ),
5304
- /* @__PURE__ */ jsx24("span", { children: "Enable Depth / Alpha Mask" })
5441
+ /* @__PURE__ */ jsx26("span", { children: "Enable Depth / Alpha Mask" })
5305
5442
  ] }),
5306
- state.depthMask.enabled && /* @__PURE__ */ jsxs22(Fragment6, { children: [
5307
- /* @__PURE__ */ jsxs22("div", { children: [
5308
- /* @__PURE__ */ jsx24("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
5309
- /* @__PURE__ */ jsx24(
5443
+ state.depthMask.enabled && /* @__PURE__ */ jsxs24(Fragment7, { children: [
5444
+ /* @__PURE__ */ jsxs24("div", { children: [
5445
+ /* @__PURE__ */ jsx26("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
5446
+ /* @__PURE__ */ jsx26(
5310
5447
  "input",
5311
5448
  {
5312
5449
  type: "text",
@@ -5317,8 +5454,8 @@ var ImageEditor = ({
5317
5454
  }
5318
5455
  )
5319
5456
  ] }),
5320
- /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
5321
- /* @__PURE__ */ jsx24(
5457
+ /* @__PURE__ */ jsxs24("div", { className: "flex gap-2", children: [
5458
+ /* @__PURE__ */ jsx26(
5322
5459
  "button",
5323
5460
  {
5324
5461
  type: "button",
@@ -5327,7 +5464,7 @@ var ImageEditor = ({
5327
5464
  children: "Threshold Mode"
5328
5465
  }
5329
5466
  ),
5330
- /* @__PURE__ */ jsx24(
5467
+ /* @__PURE__ */ jsx26(
5331
5468
  "button",
5332
5469
  {
5333
5470
  type: "button",
@@ -5337,12 +5474,12 @@ var ImageEditor = ({
5337
5474
  }
5338
5475
  )
5339
5476
  ] }),
5340
- /* @__PURE__ */ jsxs22("div", { children: [
5341
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5342
- /* @__PURE__ */ jsx24("span", { children: "Depth Start (Lower):" }),
5343
- /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
5477
+ /* @__PURE__ */ jsxs24("div", { children: [
5478
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5479
+ /* @__PURE__ */ jsx26("span", { children: "Depth Start (Lower):" }),
5480
+ /* @__PURE__ */ jsx26("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
5344
5481
  ] }),
5345
- /* @__PURE__ */ jsx24(
5482
+ /* @__PURE__ */ jsx26(
5346
5483
  "input",
5347
5484
  {
5348
5485
  type: "range",
@@ -5356,12 +5493,12 @@ var ImageEditor = ({
5356
5493
  }
5357
5494
  )
5358
5495
  ] }),
5359
- /* @__PURE__ */ jsxs22("div", { children: [
5360
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5361
- /* @__PURE__ */ jsx24("span", { children: "Depth Stop (Upper):" }),
5362
- /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
5496
+ /* @__PURE__ */ jsxs24("div", { children: [
5497
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5498
+ /* @__PURE__ */ jsx26("span", { children: "Depth Stop (Upper):" }),
5499
+ /* @__PURE__ */ jsx26("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
5363
5500
  ] }),
5364
- /* @__PURE__ */ jsx24(
5501
+ /* @__PURE__ */ jsx26(
5365
5502
  "input",
5366
5503
  {
5367
5504
  type: "range",
@@ -5375,12 +5512,12 @@ var ImageEditor = ({
5375
5512
  }
5376
5513
  )
5377
5514
  ] }),
5378
- /* @__PURE__ */ jsxs22("div", { children: [
5379
- /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5380
- /* @__PURE__ */ jsx24("span", { children: "Softness:" }),
5381
- /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.softness })
5515
+ /* @__PURE__ */ jsxs24("div", { children: [
5516
+ /* @__PURE__ */ jsxs24("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5517
+ /* @__PURE__ */ jsx26("span", { children: "Softness:" }),
5518
+ /* @__PURE__ */ jsx26("span", { className: "font-mono", children: state.depthMask.softness })
5382
5519
  ] }),
5383
- /* @__PURE__ */ jsx24(
5520
+ /* @__PURE__ */ jsx26(
5384
5521
  "input",
5385
5522
  {
5386
5523
  type: "range",
@@ -5392,8 +5529,8 @@ var ImageEditor = ({
5392
5529
  }
5393
5530
  )
5394
5531
  ] }),
5395
- /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
5396
- /* @__PURE__ */ jsx24(
5532
+ /* @__PURE__ */ jsxs24("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
5533
+ /* @__PURE__ */ jsx26(
5397
5534
  "input",
5398
5535
  {
5399
5536
  type: "checkbox",
@@ -5402,12 +5539,12 @@ var ImageEditor = ({
5402
5539
  className: "rounded accent-primary"
5403
5540
  }
5404
5541
  ),
5405
- /* @__PURE__ */ jsx24("span", { children: "Invert Mask" })
5542
+ /* @__PURE__ */ jsx26("span", { children: "Invert Mask" })
5406
5543
  ] })
5407
5544
  ] })
5408
5545
  ] }),
5409
- activeTab === "select" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
5410
- /* @__PURE__ */ jsx24(
5546
+ activeTab === "select" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 text-xs", children: [
5547
+ /* @__PURE__ */ jsx26(
5411
5548
  SelectionOptionsBar,
5412
5549
  {
5413
5550
  controller,
@@ -5418,9 +5555,9 @@ var ImageEditor = ({
5418
5555
  selectionDisplay: state.selectionDisplay
5419
5556
  }
5420
5557
  ),
5421
- selectionError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: selectionError }),
5422
- /* @__PURE__ */ jsxs22("div", { className: "flex gap-1", children: [
5423
- /* @__PURE__ */ jsx24(
5558
+ selectionError && /* @__PURE__ */ jsx26("p", { role: "alert", className: "text-destructive", children: selectionError }),
5559
+ /* @__PURE__ */ jsxs24("div", { className: "flex gap-1", children: [
5560
+ /* @__PURE__ */ jsx26(
5424
5561
  "button",
5425
5562
  {
5426
5563
  type: "button",
@@ -5431,7 +5568,7 @@ var ImageEditor = ({
5431
5568
  children: "Transform Selection"
5432
5569
  }
5433
5570
  ),
5434
- /* @__PURE__ */ jsx24(
5571
+ /* @__PURE__ */ jsx26(
5435
5572
  "button",
5436
5573
  {
5437
5574
  type: "button",
@@ -5443,14 +5580,14 @@ var ImageEditor = ({
5443
5580
  }
5444
5581
  )
5445
5582
  ] }),
5446
- /* @__PURE__ */ jsx24(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
5447
- /* @__PURE__ */ jsx24(ChannelsPanel, { controller }),
5448
- /* @__PURE__ */ jsx24(PathsPanel, { controller })
5583
+ /* @__PURE__ */ jsx26(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
5584
+ /* @__PURE__ */ jsx26(ChannelsPanel, { controller }),
5585
+ /* @__PURE__ */ jsx26(PathsPanel, { controller })
5449
5586
  ] }),
5450
- activeTab === "ai" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
5451
- /* @__PURE__ */ jsxs22("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
5452
- /* @__PURE__ */ jsx24("span", { children: "Results go to" }),
5453
- /* @__PURE__ */ jsxs22(
5587
+ activeTab === "ai" && /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-4 text-xs", children: [
5588
+ /* @__PURE__ */ jsxs24("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
5589
+ /* @__PURE__ */ jsx26("span", { children: "Results go to" }),
5590
+ /* @__PURE__ */ jsxs24(
5454
5591
  "select",
5455
5592
  {
5456
5593
  "aria-label": "AI result target",
@@ -5458,54 +5595,54 @@ var ImageEditor = ({
5458
5595
  onChange: (e) => setAiTarget(e.target.value),
5459
5596
  className: imageSelectClass,
5460
5597
  children: [
5461
- /* @__PURE__ */ jsx24("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
5462
- /* @__PURE__ */ jsx24("option", { value: "new-layer", children: "New layer / mask" }),
5463
- /* @__PURE__ */ jsx24("option", { value: "replace", children: "Replace image" })
5598
+ /* @__PURE__ */ jsx26("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
5599
+ /* @__PURE__ */ jsx26("option", { value: "new-layer", children: "New layer / mask" }),
5600
+ /* @__PURE__ */ jsx26("option", { value: "replace", children: "Replace image" })
5464
5601
  ]
5465
5602
  }
5466
5603
  )
5467
5604
  ] }),
5468
- /* @__PURE__ */ jsxs22("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5469
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5470
- /* @__PURE__ */ jsxs22("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5471
- /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
5605
+ /* @__PURE__ */ jsxs24("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5606
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
5607
+ /* @__PURE__ */ jsxs24("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5608
+ /* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
5472
5609
  "Background Removal"
5473
5610
  ] }),
5474
- isRemovingBg && /* @__PURE__ */ jsx24("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
5611
+ isRemovingBg && /* @__PURE__ */ jsx26("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
5475
5612
  ] }),
5476
- /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
5477
- /* @__PURE__ */ jsx24(
5613
+ /* @__PURE__ */ jsx26("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
5614
+ /* @__PURE__ */ jsx26(
5478
5615
  "button",
5479
5616
  {
5480
5617
  type: "button",
5481
5618
  onClick: handleRemoveBackground,
5482
5619
  disabled: isRemovingBg || isInpainting,
5483
5620
  className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
5484
- children: isRemovingBg ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
5485
- /* @__PURE__ */ jsx24("div", { className: imageSpinnerClass }),
5621
+ children: isRemovingBg ? /* @__PURE__ */ jsxs24(Fragment7, { children: [
5622
+ /* @__PURE__ */ jsx26("div", { className: imageSpinnerClass }),
5486
5623
  "Removing Background..."
5487
- ] }) : /* @__PURE__ */ jsxs22(Fragment6, { children: [
5488
- /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5624
+ ] }) : /* @__PURE__ */ jsxs24(Fragment7, { children: [
5625
+ /* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5489
5626
  "Remove Background"
5490
5627
  ] })
5491
5628
  }
5492
5629
  )
5493
5630
  ] }),
5494
- /* @__PURE__ */ jsxs22("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5495
- /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5496
- /* @__PURE__ */ jsxs22("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5497
- /* @__PURE__ */ jsxs22("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
5498
- /* @__PURE__ */ jsx24("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
5499
- /* @__PURE__ */ jsx24("path", { d: "m14 7 3 3" })
5631
+ /* @__PURE__ */ jsxs24("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5632
+ /* @__PURE__ */ jsxs24("div", { className: "flex items-center justify-between", children: [
5633
+ /* @__PURE__ */ jsxs24("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5634
+ /* @__PURE__ */ jsxs24("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
5635
+ /* @__PURE__ */ jsx26("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
5636
+ /* @__PURE__ */ jsx26("path", { d: "m14 7 3 3" })
5500
5637
  ] }),
5501
5638
  "Generative Inpainting"
5502
5639
  ] }),
5503
- isInpainting && /* @__PURE__ */ jsx24("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
5640
+ isInpainting && /* @__PURE__ */ jsx26("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
5504
5641
  ] }),
5505
- /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
5506
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
5507
- /* @__PURE__ */ jsx24("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
5508
- /* @__PURE__ */ jsx24(
5642
+ /* @__PURE__ */ jsx26("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
5643
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
5644
+ /* @__PURE__ */ jsx26("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
5645
+ /* @__PURE__ */ jsx26(
5509
5646
  "textarea",
5510
5647
  {
5511
5648
  id: "ai-inpaint-prompt-react",
@@ -5517,10 +5654,10 @@ var ImageEditor = ({
5517
5654
  }
5518
5655
  )
5519
5656
  ] }),
5520
- /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
5521
- /* @__PURE__ */ jsx24("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
5522
- /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-1.5", children: [
5523
- /* @__PURE__ */ jsxs22(
5657
+ /* @__PURE__ */ jsxs24("div", { className: "flex flex-col gap-1", children: [
5658
+ /* @__PURE__ */ jsx26("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
5659
+ /* @__PURE__ */ jsxs24("div", { className: "grid grid-cols-2 gap-1.5", children: [
5660
+ /* @__PURE__ */ jsxs24(
5524
5661
  "button",
5525
5662
  {
5526
5663
  type: "button",
@@ -5533,7 +5670,7 @@ var ImageEditor = ({
5533
5670
  ]
5534
5671
  }
5535
5672
  ),
5536
- /* @__PURE__ */ jsxs22(
5673
+ /* @__PURE__ */ jsxs24(
5537
5674
  "button",
5538
5675
  {
5539
5676
  type: "button",
@@ -5548,25 +5685,25 @@ var ImageEditor = ({
5548
5685
  )
5549
5686
  ] })
5550
5687
  ] }),
5551
- /* @__PURE__ */ jsx24(
5688
+ /* @__PURE__ */ jsx26(
5552
5689
  "button",
5553
5690
  {
5554
5691
  type: "button",
5555
5692
  onClick: handleInpaint,
5556
5693
  disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
5557
5694
  className: "mt-1 px-3 py-2 rounded-lg bg-primary hover:bg-primary/90 disabled:opacity-50 text-primary-foreground font-medium shadow transition-colors flex items-center justify-center gap-2",
5558
- children: isInpainting ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
5559
- /* @__PURE__ */ jsx24("div", { className: imageSpinnerClass }),
5695
+ children: isInpainting ? /* @__PURE__ */ jsxs24(Fragment7, { children: [
5696
+ /* @__PURE__ */ jsx26("div", { className: imageSpinnerClass }),
5560
5697
  "Generating Inpaint..."
5561
- ] }) : /* @__PURE__ */ jsxs22(Fragment6, { children: [
5562
- /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5698
+ ] }) : /* @__PURE__ */ jsxs24(Fragment7, { children: [
5699
+ /* @__PURE__ */ jsx26("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx26("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5563
5700
  "Apply Inpainting"
5564
5701
  ] })
5565
5702
  }
5566
5703
  )
5567
5704
  ] }),
5568
- aiError && /* @__PURE__ */ jsx24("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
5569
- aiSuccess && /* @__PURE__ */ jsx24("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
5705
+ aiError && /* @__PURE__ */ jsx26("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
5706
+ aiSuccess && /* @__PURE__ */ jsx26("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
5570
5707
  ] })
5571
5708
  ] })
5572
5709
  ] })
@@ -5591,6 +5728,7 @@ export {
5591
5728
  CurvesEditor,
5592
5729
  AdjustmentLayersPanel,
5593
5730
  LayerEffectsPanel,
5731
+ EdgeColorPanel,
5594
5732
  LayersPanel,
5595
5733
  ImageEffectControls,
5596
5734
  ImageProviderEffectsPanel,
@@ -5600,6 +5738,7 @@ export {
5600
5738
  SelectAndMaskWorkspace,
5601
5739
  ContentAwareFillWorkspace,
5602
5740
  SelectionOptionsBar,
5741
+ MaskEdgeCheck,
5603
5742
  RefineEdgePanel,
5604
5743
  ChannelsPanel,
5605
5744
  PathsPanel,