@pixerate/editor-react 0.119.0 → 0.122.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 React15, { useRef as useRef7, useEffect as useEffect13, useState as useState16 } from "react";
193
+ import React16, { useRef as useRef8, useEffect as useEffect14, useState as useState17 } from "react";
194
194
  import {
195
195
  normalizeProcessVersion,
196
196
  LATEST_PROCESS_VERSION,
@@ -223,6 +223,8 @@ import {
223
223
  measureCanvasViewport,
224
224
  watchCanvasViewport,
225
225
  startMarchingAnts,
226
+ handleSelectionShortcut,
227
+ handleQuickMaskKey,
226
228
  ShapeDrawGesture,
227
229
  TypeToolGesture,
228
230
  DEFAULT_SHAPE_TOOL_OPTIONS,
@@ -593,6 +595,30 @@ var ImageEditorCanvas = ({
593
595
  if (g.error) report("paint", g.error);
594
596
  }
595
597
  };
598
+ useEffect2(() => {
599
+ if (mode !== "select" || typeof window === "undefined") return;
600
+ const onKey = (e) => {
601
+ const target = e.target;
602
+ if (target?.closest?.('input, textarea, select, [contenteditable="true"]')) return;
603
+ if (window.getSelection?.()?.toString()) return;
604
+ const gesture = selectionGestureRef.current;
605
+ if (handleQuickMaskKey(controller, e)) {
606
+ e.preventDefault();
607
+ return;
608
+ }
609
+ if (handleSelectionShortcut(controller, e, (message) => report("select", message))) {
610
+ e.preventDefault();
611
+ return;
612
+ }
613
+ if (gesture?.key(e.key)) {
614
+ e.preventDefault();
615
+ selectionDraftRef.current = gesture.draftPath;
616
+ void renderCanvas();
617
+ }
618
+ };
619
+ window.addEventListener("keydown", onKey);
620
+ return () => window.removeEventListener("keydown", onKey);
621
+ });
596
622
  useEffect2(() => {
597
623
  if (mode !== "paint" || typeof window === "undefined") return;
598
624
  const onKey = (e) => {
@@ -608,7 +634,11 @@ var ImageEditorCanvas = ({
608
634
  if (mode === "select") {
609
635
  const gesture = selectionGestureRef.current;
610
636
  const imgPt = canvasToImagePoint(canvasPt, state, viewRef.current.width, viewRef.current.height, false);
611
- void gesture.begin(imgPt, e).then(() => report("select", gesture.error));
637
+ void gesture.begin(imgPt, e).then(() => {
638
+ report("select", gesture.error);
639
+ selectionDraftRef.current = gesture.draftPath;
640
+ void renderCanvas();
641
+ });
612
642
  return;
613
643
  }
614
644
  if (mode === "crop") {
@@ -690,7 +720,7 @@ var ImageEditorCanvas = ({
690
720
  const canvasPt = getCanvasEventPoint(e);
691
721
  if (mode === "select") {
692
722
  const gesture = selectionGestureRef.current;
693
- if (gesture.active && gesture.move(canvasToImagePoint(canvasPt, state, viewRef.current.width, viewRef.current.height, false))) {
723
+ if (gesture.active && gesture.move(canvasToImagePoint(canvasPt, state, viewRef.current.width, viewRef.current.height, false), e)) {
694
724
  selectionDraftRef.current = gesture.draftPath;
695
725
  renderCanvas();
696
726
  }
@@ -833,7 +863,7 @@ var ImageEditorCanvas = ({
833
863
  const gesture = selectionGestureRef.current;
834
864
  if (gesture.active) {
835
865
  gesture.end(canvasToImagePoint(canvasPt, state, viewRef.current.width, viewRef.current.height, false), e);
836
- selectionDraftRef.current = null;
866
+ selectionDraftRef.current = gesture.draftPath;
837
867
  renderCanvas();
838
868
  }
839
869
  return;
@@ -1361,7 +1391,7 @@ var AdjustmentLayersPanel = ({ controller, layers: layersProp, histogram, classN
1361
1391
  type: "button",
1362
1392
  className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90",
1363
1393
  onClick: () => {
1364
- setSelectedId(controller.addAdjustmentLayer(newKind));
1394
+ setSelectedId(controller.addAdjustmentLayer({ kind: newKind, useSelection: true }));
1365
1395
  setChannel("master");
1366
1396
  setRange(-1);
1367
1397
  },
@@ -1623,6 +1653,8 @@ import {
1623
1653
  downloadPsd,
1624
1654
  dropPlacement,
1625
1655
  dropZone,
1656
+ maskThumbnailClick,
1657
+ layerThumbnailClick,
1626
1658
  openPsdFile,
1627
1659
  layerBadge,
1628
1660
  layerHasThumbnail,
@@ -1929,7 +1961,14 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1929
1961
  pixels: thumb(layer),
1930
1962
  size: thumbnailSize,
1931
1963
  label: `${row.label} pixels`,
1932
- selected: row.active && state.activeTarget === "pixels" && Boolean(layer.mask)
1964
+ testId: "layer-thumbnail",
1965
+ selected: row.active && state.activeTarget === "pixels" && Boolean(layer.mask),
1966
+ onClick: (e) => {
1967
+ if (e.ctrlKey || e.metaKey) {
1968
+ e.stopPropagation();
1969
+ attempt(() => layerThumbnailClick(controller, layer, e));
1970
+ }
1971
+ }
1933
1972
  }
1934
1973
  ),
1935
1974
  layer.type !== "pixel" && /* @__PURE__ */ jsx8(
@@ -1974,8 +2013,7 @@ var LayersPanel = ({ controller, thumbnailSize = 32, psd = true, psdFileName = "
1974
2013
  selected: row.active && state.activeTarget === "mask",
1975
2014
  onClick: (e) => {
1976
2015
  e.stopPropagation();
1977
- if (e.shiftKey) attempt(() => controller.setLayerMaskProps(layer.id, { enabled: layer.mask.enabled === false }));
1978
- else attempt(() => controller.setActiveLayer(layer.id, "mask"));
2016
+ attempt(() => maskThumbnailClick(controller, layer, e));
1979
2017
  }
1980
2018
  }
1981
2019
  ),
@@ -2281,7 +2319,7 @@ function ImageProviderEffectsPanel({ controller, className = "", components }) {
2281
2319
  /* @__PURE__ */ jsx11("span", { className: "flex-1 font-semibold uppercase tracking-wider text-[11px] text-foreground", children: "Filters" }),
2282
2320
  /* @__PURE__ */ jsx11("button", { type: "button", className: imageOutlineButtonClass, "aria-pressed": browse === "filter", onClick: () => setBrowse(browse === "filter" ? null : "filter"), children: "Add filter\u2026" })
2283
2321
  ] }),
2284
- browse === "filter" && layer && /* @__PURE__ */ jsx11(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id))) }),
2322
+ browse === "filter" && layer && /* @__PURE__ */ jsx11(EffectsBrowser, { provider, uses: ["filter"], title: "Filters", onPick: (e) => (setBrowse(null), run(() => controller.applyEffectFilter(layer.id, e.id, { useSelection: true }))) }),
2285
2323
  filters.length > 0 && layer && /* @__PURE__ */ jsx11("ol", { className: "space-y-1", "data-effect-part": "filters", "aria-label": "Filters", children: filters.map((f) => {
2286
2324
  const label = f.kind === "effect" ? f.name ?? f.effect : f.kind;
2287
2325
  const all = layer.smartFilters.filters;
@@ -2605,6 +2643,8 @@ var ColorProfilePanel = ({ controller, className }) => {
2605
2643
  // src/image-editor/SelectionOptionsBar.tsx
2606
2644
  import { useState as useState11 } from "react";
2607
2645
  import {
2646
+ COLOR_RANGE_PRESETS,
2647
+ COLOR_RANGE_PRESET_LABELS,
2608
2648
  SELECTION_MODES,
2609
2649
  SELECTION_MODE_LABELS,
2610
2650
  SELECTION_TOOLS,
@@ -2612,12 +2652,18 @@ import {
2612
2652
  } from "@pixerate/editor/image-editor";
2613
2653
  import { jsx as jsx15, jsxs as jsxs13 } from "react/jsx-runtime";
2614
2654
  var MODIFY_OPS = [
2615
- { op: "grow", label: "Grow" },
2616
- { op: "shrink", label: "Shrink" },
2655
+ { op: "expand", label: "Expand" },
2656
+ { op: "contract", label: "Contract" },
2617
2657
  { op: "feather", label: "Feather" },
2618
2658
  { op: "border", label: "Border" },
2619
2659
  { op: "smooth", label: "Smooth" }
2620
2660
  ];
2661
+ var DISPLAYS = [
2662
+ { id: "ants", label: "Ants" },
2663
+ { id: "quickMask", label: "Quick Mask" },
2664
+ { id: "none", label: "Hidden" }
2665
+ ];
2666
+ var numberInput = "w-14 bg-background border border-border rounded px-1 py-0.5 text-foreground";
2621
2667
  var btn = (on) => `px-2 py-1 rounded-md border text-[11px] transition-colors ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
2622
2668
  var SelectionOptionsBar = ({
2623
2669
  controller,
@@ -2625,12 +2671,50 @@ var SelectionOptionsBar = ({
2625
2671
  onOptionsChange,
2626
2672
  selection,
2627
2673
  quickMask,
2674
+ selectionDisplay,
2628
2675
  className = ""
2629
2676
  }) => {
2630
2677
  const [radius, setRadius] = useState11(2);
2631
2678
  const set = (patch) => onOptionsChange({ ...options, ...patch });
2632
2679
  const sel = selection === void 0 ? controller.getSelection() : selection;
2633
- const qm = quickMask ?? Boolean(controller.getState().quickMask);
2680
+ const display = selectionDisplay ?? (quickMask === void 0 ? controller.getSelectionDisplay() : quickMask ? "quickMask" : "ants");
2681
+ const [preset, setPreset] = useState11("reds");
2682
+ const [rangeStatus, setRangeStatus] = useState11(null);
2683
+ const [colorStatus, setColorStatus] = useState11(null);
2684
+ const [strokeWidth, setStrokeWidth] = useState11(4);
2685
+ const [strokeLocation, setStrokeLocation] = useState11("outside");
2686
+ const edit = (fn) => {
2687
+ setColorStatus(null);
2688
+ try {
2689
+ fn();
2690
+ } catch (err) {
2691
+ setColorStatus(err instanceof Error ? err.message : String(err));
2692
+ }
2693
+ };
2694
+ const runColor = async (op) => {
2695
+ setColorStatus(null);
2696
+ const opts = { tolerance: options.tolerance, sampleMerged: options.sampleMerged, sample: options.sample };
2697
+ try {
2698
+ await (op === "grow" ? controller.growSelection(opts) : controller.selectSimilar(opts));
2699
+ } catch (err) {
2700
+ setColorStatus(err instanceof Error ? err.message : String(err));
2701
+ }
2702
+ };
2703
+ const applyPreset = async () => {
2704
+ setRangeStatus(null);
2705
+ try {
2706
+ await controller.selectColorRangePreset(preset, {
2707
+ mode: options.mode,
2708
+ feather: options.feather ?? 0,
2709
+ invert: options.rangeInvert ?? false,
2710
+ falloff: options.fuzziness ?? 20,
2711
+ sampleMerged: options.sampleMerged,
2712
+ sample: options.sample
2713
+ });
2714
+ } catch (err) {
2715
+ setRangeStatus(err instanceof Error ? err.message : String(err));
2716
+ }
2717
+ };
2634
2718
  const [subject, setSubject] = useState11("");
2635
2719
  const [segmenting, setSegmenting] = useState11(false);
2636
2720
  const [subjectStatus, setSubjectStatus] = useState11(null);
@@ -2663,6 +2747,21 @@ var SelectionOptionsBar = ({
2663
2747
  /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Contiguous", checked: options.contiguous, onChange: (on) => set({ contiguous: on }) }),
2664
2748
  "Contiguous"
2665
2749
  ] }),
2750
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2751
+ "Distance",
2752
+ /* @__PURE__ */ jsx15(
2753
+ ImageSelect,
2754
+ {
2755
+ label: "Colour distance",
2756
+ value: options.distance,
2757
+ options: [
2758
+ { value: "rgb", label: "RGB" },
2759
+ { value: "perceptual", label: "Perceptual" }
2760
+ ],
2761
+ onChange: (v) => set({ distance: v })
2762
+ }
2763
+ )
2764
+ ] }),
2666
2765
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2667
2766
  /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Sample adjusted image", checked: options.sampleMerged, onChange: (on) => set({ sampleMerged: on }) }),
2668
2767
  "Sample adjusted image"
@@ -2683,6 +2782,67 @@ var SelectionOptionsBar = ({
2683
2782
  )
2684
2783
  ] })
2685
2784
  ] }),
2785
+ options.tool === "polygon" && /* @__PURE__ */ jsx15("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." }),
2786
+ options.tool === "range" && /* @__PURE__ */ jsxs13("div", { "data-testid": "color-range-options", className: "flex flex-col gap-2", children: [
2787
+ /* @__PURE__ */ jsx15("p", { className: "text-muted-foreground", children: "Click a colour to select it; Shift-click adds a colour, Alt-click removes one." }),
2788
+ /* @__PURE__ */ jsxs13("label", { className: "flex flex-col gap-1", children: [
2789
+ /* @__PURE__ */ jsxs13("span", { className: "flex justify-between text-muted-foreground", children: [
2790
+ /* @__PURE__ */ jsx15("span", { children: "Fuzziness" }),
2791
+ /* @__PURE__ */ jsx15("span", { className: "font-mono", children: options.fuzziness ?? 40 })
2792
+ ] }),
2793
+ /* @__PURE__ */ jsx15(ImageRange, { label: "Fuzziness", min: 0, max: 200, step: 1, value: options.fuzziness ?? 40, onChange: (v) => set({ fuzziness: v }) })
2794
+ ] }),
2795
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
2796
+ "Localized radius",
2797
+ /* @__PURE__ */ jsx15(
2798
+ "input",
2799
+ {
2800
+ type: "number",
2801
+ min: 0,
2802
+ step: 1,
2803
+ "aria-label": "Localized radius",
2804
+ value: options.localized ?? 0,
2805
+ onChange: (e) => set({ localized: Math.max(0, Number(e.target.value) || 0) }),
2806
+ className: numberInput
2807
+ }
2808
+ ),
2809
+ "px"
2810
+ ] }),
2811
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-2 text-foreground", children: [
2812
+ /* @__PURE__ */ jsx15(ImageCheckbox, { label: "Invert", checked: options.rangeInvert ?? false, onChange: (on) => set({ rangeInvert: on }) }),
2813
+ "Invert"
2814
+ ] }),
2815
+ /* @__PURE__ */ jsxs13("div", { className: "flex items-center gap-1", children: [
2816
+ /* @__PURE__ */ jsx15(
2817
+ ImageSelect,
2818
+ {
2819
+ label: "Color Range preset",
2820
+ value: preset,
2821
+ options: COLOR_RANGE_PRESETS.map((p) => ({ value: p, label: COLOR_RANGE_PRESET_LABELS[p] })),
2822
+ onChange: (v) => setPreset(v)
2823
+ }
2824
+ ),
2825
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => void applyPreset(), children: "Select" })
2826
+ ] }),
2827
+ rangeStatus && /* @__PURE__ */ jsx15("p", { role: "status", className: "text-muted-foreground", children: rangeStatus })
2828
+ ] }),
2829
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
2830
+ "Feather",
2831
+ /* @__PURE__ */ jsx15(
2832
+ "input",
2833
+ {
2834
+ type: "number",
2835
+ min: 0,
2836
+ max: 1e3,
2837
+ step: 0.5,
2838
+ "aria-label": "Feather",
2839
+ value: options.feather ?? 0,
2840
+ onChange: (e) => set({ feather: Math.max(0, Number(e.target.value) || 0) }),
2841
+ className: numberInput
2842
+ }
2843
+ ),
2844
+ "px"
2845
+ ] }),
2686
2846
  controller.segmentationProvider && /* @__PURE__ */ jsxs13(
2687
2847
  "form",
2688
2848
  {
@@ -2720,7 +2880,13 @@ var SelectionOptionsBar = ({
2720
2880
  /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => controller.selectAll(), children: "Select All" }),
2721
2881
  /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.deselect(), children: "Deselect" }),
2722
2882
  /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => controller.invertSelection(), children: "Inverse" }),
2723
- /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": qm, className: btn(qm), onClick: () => controller.setQuickMask(!qm), children: "Quick Mask" })
2883
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !controller.canReselect(), onClick: () => controller.reselect(), children: "Reselect" }),
2884
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, title: "Add connected pixels of a selected colour (wand tolerance)", onClick: () => void runColor("grow"), children: "Grow" }),
2885
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, title: "Add every pixel of a selected colour (wand tolerance)", onClick: () => void runColor("similar"), children: "Similar" })
2886
+ ] }),
2887
+ /* @__PURE__ */ jsxs13("div", { role: "group", "aria-label": "Show selection", className: "flex flex-wrap items-center gap-1", children: [
2888
+ /* @__PURE__ */ jsx15("span", { className: "text-muted-foreground", children: "Show" }),
2889
+ DISPLAYS.map((d) => /* @__PURE__ */ jsx15("button", { type: "button", "aria-pressed": display === d.id, className: btn(display === d.id), onClick: () => controller.setSelectionDisplay(d.id), children: d.label }, d.id))
2724
2890
  ] }),
2725
2891
  /* @__PURE__ */ jsxs13("div", { className: "flex flex-wrap items-center gap-1", children: [
2726
2892
  /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
@@ -2735,12 +2901,57 @@ var SelectionOptionsBar = ({
2735
2901
  "aria-label": "Modify radius",
2736
2902
  value: radius,
2737
2903
  onChange: (e) => setRadius(Math.max(0, Number(e.target.value) || 0)),
2738
- className: "w-14 bg-background border border-border rounded px-1 py-0.5 text-foreground"
2904
+ className: numberInput
2739
2905
  }
2740
2906
  )
2741
2907
  ] }),
2742
2908
  MODIFY_OPS.map(({ op, label }) => /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => controller.modifySelection(op, radius), children: label }, op))
2743
2909
  ] }),
2910
+ /* @__PURE__ */ jsxs13("div", { role: "group", "aria-label": "Edit selection", className: "flex flex-wrap items-center gap-1", children: [
2911
+ /* @__PURE__ */ jsxs13("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
2912
+ "Stroke",
2913
+ /* @__PURE__ */ jsx15(
2914
+ "input",
2915
+ {
2916
+ type: "number",
2917
+ min: 1,
2918
+ max: 250,
2919
+ step: 1,
2920
+ "aria-label": "Stroke width",
2921
+ value: strokeWidth,
2922
+ onChange: (e) => setStrokeWidth(Math.min(250, Math.max(1, Number(e.target.value) || 1))),
2923
+ className: numberInput
2924
+ }
2925
+ ),
2926
+ "px"
2927
+ ] }),
2928
+ /* @__PURE__ */ jsx15(
2929
+ ImageSelect,
2930
+ {
2931
+ label: "Stroke location",
2932
+ value: strokeLocation,
2933
+ options: [
2934
+ { value: "outside", label: "Outside" },
2935
+ { value: "center", label: "Center" },
2936
+ { value: "inside", label: "Inside" }
2937
+ ],
2938
+ onChange: (v) => setStrokeLocation(v)
2939
+ }
2940
+ ),
2941
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.strokeSelection({ width: strokeWidth, location: strokeLocation })), children: "Stroke" }),
2942
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cropToSelection()), children: "Crop to Selection" }),
2943
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.contentAwareFill({ output: "new-layer" })), children: "Content-Aware Fill" })
2944
+ ] }),
2945
+ /* @__PURE__ */ jsxs13("div", { role: "group", "aria-label": "Clipboard", className: "flex flex-wrap gap-1", children: [
2946
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels()), children: "Copy" }),
2947
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.copyPixels({ merged: true })), children: "Copy Merged" }),
2948
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.cutPixels()), children: "Cut" }),
2949
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("new-layer")), children: "Paste" }),
2950
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), onClick: () => edit(() => controller.pastePixels("in-place")), children: "Paste in Place" }),
2951
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("into")), children: "Paste Into" }),
2952
+ /* @__PURE__ */ jsx15("button", { type: "button", className: btn(false), disabled: !sel, onClick: () => edit(() => controller.pastePixels("outside")), children: "Paste Outside" })
2953
+ ] }),
2954
+ colorStatus && /* @__PURE__ */ jsx15("p", { role: "status", className: "text-muted-foreground", children: colorStatus }),
2744
2955
  /* @__PURE__ */ jsx15("p", { "data-testid": "selection-status", className: "text-muted-foreground", children: describeSelection(sel) })
2745
2956
  ] });
2746
2957
  };
@@ -2901,14 +3112,129 @@ var RefineEdgePanel = ({ controller, selection, layers, className = "" }) => {
2901
3112
  ] });
2902
3113
  };
2903
3114
 
3115
+ // src/image-editor/ChannelsPanel.tsx
3116
+ import { useEffect as useEffect10, useRef as useRef7, useState as useState13 } from "react";
3117
+ import { channelThumbnail, selectionModeFromModifiers } from "@pixerate/editor/image-editor";
3118
+ import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
3119
+ 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"}`;
3120
+ var ChannelThumb = ({ channel, size }) => {
3121
+ const ref = useRef7(null);
3122
+ useEffect10(() => {
3123
+ const canvas = ref.current;
3124
+ const ctx = canvas?.getContext("2d");
3125
+ if (!canvas || !ctx || typeof ctx.createImageData !== "function") return;
3126
+ const px = channelThumbnail(channel, 64);
3127
+ canvas.width = px.width;
3128
+ canvas.height = px.height;
3129
+ const img = ctx.createImageData(px.width, px.height);
3130
+ img.data.set(px.data);
3131
+ ctx.putImageData(img, 0, 0);
3132
+ }, [channel.mask]);
3133
+ return /* @__PURE__ */ jsx17("canvas", { ref, "aria-hidden": "true", style: { width: size, height: size }, className: "shrink-0 rounded object-contain ring-1 ring-border bg-black" });
3134
+ };
3135
+ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
3136
+ const [, setTick] = useState13(0);
3137
+ useEffect10(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
3138
+ const [activeId, setActiveId] = useState13(null);
3139
+ const [renaming, setRenaming] = useState13(null);
3140
+ const [error, setError] = useState13(null);
3141
+ const channels = controller.getChannels();
3142
+ const active = channels.find((c) => c.id === activeId) ?? null;
3143
+ const hasSelection = Boolean(controller.getSelection());
3144
+ const quickMask = controller.quickMaskEditing;
3145
+ const attempt = (fn) => {
3146
+ setError(null);
3147
+ try {
3148
+ fn();
3149
+ } catch (err) {
3150
+ setError(err instanceof Error ? err.message : String(err));
3151
+ }
3152
+ };
3153
+ return /* @__PURE__ */ jsxs15("div", { "data-testid": "channels-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
3154
+ /* @__PURE__ */ jsxs15("div", { className: "flex items-center justify-between", children: [
3155
+ /* @__PURE__ */ jsx17("span", { className: imageSectionTitleClass, children: "Channels" }),
3156
+ /* @__PURE__ */ jsx17("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" })
3157
+ ] }),
3158
+ channels.length === 0 && /* @__PURE__ */ jsx17("p", { className: "text-muted-foreground", children: "No channels. Save a selection to keep it." }),
3159
+ /* @__PURE__ */ jsx17("ul", { role: "list", className: "flex flex-col gap-0.5", children: channels.map((c) => /* @__PURE__ */ jsxs15(
3160
+ "li",
3161
+ {
3162
+ "data-testid": "channel-row",
3163
+ "aria-current": c.id === activeId ? "true" : void 0,
3164
+ className: `flex items-center gap-1.5 px-1.5 py-1 rounded cursor-pointer select-none ${c.id === activeId ? "bg-primary/30 ring-1 ring-primary" : "hover:bg-muted"}`,
3165
+ onClick: (e) => {
3166
+ setActiveId(c.id);
3167
+ attempt(() => controller.loadSelectionFromChannel(c.id, { mode: selectionModeFromModifiers(e, "replace") }));
3168
+ },
3169
+ onDoubleClick: () => setRenaming(c.id),
3170
+ children: [
3171
+ /* @__PURE__ */ jsx17(
3172
+ "button",
3173
+ {
3174
+ type: "button",
3175
+ "aria-label": `${c.visible ? "Hide" : "Show"} ${c.name}`,
3176
+ "aria-pressed": c.visible,
3177
+ className: "w-4 text-muted-foreground",
3178
+ onClick: (e) => {
3179
+ e.stopPropagation();
3180
+ attempt(() => controller.setChannelProperties(c.id, { visible: !c.visible }));
3181
+ },
3182
+ children: c.visible ? "\u25CF" : "\u25CB"
3183
+ }
3184
+ ),
3185
+ /* @__PURE__ */ jsx17(ChannelThumb, { channel: c, size: thumbnailSize }),
3186
+ renaming === c.id ? /* @__PURE__ */ jsx17(
3187
+ "input",
3188
+ {
3189
+ autoFocus: true,
3190
+ "aria-label": "Channel name",
3191
+ defaultValue: c.name,
3192
+ className: "min-w-0 flex-1 bg-background border border-border rounded px-1 py-0.5 text-foreground",
3193
+ onClick: (e) => e.stopPropagation(),
3194
+ onBlur: (e) => {
3195
+ setRenaming(null);
3196
+ if (e.currentTarget.value.trim() && e.currentTarget.value !== c.name) attempt(() => controller.setChannelProperties(c.id, { name: e.currentTarget.value }));
3197
+ },
3198
+ onKeyDown: (e) => {
3199
+ if (e.key === "Enter") e.currentTarget.blur();
3200
+ if (e.key === "Escape") setRenaming(null);
3201
+ }
3202
+ }
3203
+ ) : /* @__PURE__ */ jsx17("span", { className: "min-w-0 flex-1 truncate", children: c.name })
3204
+ ]
3205
+ },
3206
+ c.id
3207
+ )) }),
3208
+ /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap gap-1", children: [
3209
+ /* @__PURE__ */ jsx17("button", { type: "button", className: btn2(), disabled: !hasSelection, onClick: () => attempt(() => setActiveId(controller.saveSelection().id)), children: "Save Selection" }),
3210
+ /* @__PURE__ */ jsx17("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" }),
3211
+ /* @__PURE__ */ jsx17("button", { type: "button", className: btn2(), disabled: !active, onClick: () => attempt(() => setActiveId(controller.duplicateChannel(active.id).id)), children: "Duplicate" }),
3212
+ /* @__PURE__ */ jsx17(
3213
+ "button",
3214
+ {
3215
+ type: "button",
3216
+ className: btn2(),
3217
+ disabled: !active,
3218
+ onClick: () => attempt(() => {
3219
+ controller.deleteChannel(active.id);
3220
+ setActiveId(null);
3221
+ }),
3222
+ children: "Delete"
3223
+ }
3224
+ )
3225
+ ] }),
3226
+ error && /* @__PURE__ */ jsx17("p", { role: "alert", className: "text-destructive", children: error })
3227
+ ] });
3228
+ };
3229
+
2904
3230
  // src/image-editor/FreeTransformOptionsBar.tsx
2905
- import { useEffect as useEffect10, useState as useState13 } from "react";
3231
+ import { useEffect as useEffect11, useState as useState14 } from "react";
2906
3232
  import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
2907
- import { jsx as jsx17, jsxs as jsxs15 } from "react/jsx-runtime";
3233
+ import { jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
2908
3234
  var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
2909
3235
  var FreeTransformOptionsBar = ({ tool, className }) => {
2910
- const [, setTick] = useState13(0);
2911
- useEffect10(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
3236
+ const [, setTick] = useState14(0);
3237
+ useEffect11(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
2912
3238
  const bar = tool.bar();
2913
3239
  if (!tool.active || !bar) return null;
2914
3240
  const warp = tool.warpBar();
@@ -2920,17 +3246,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2920
3246
  const v = Number(raw);
2921
3247
  if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
2922
3248
  };
2923
- return /* @__PURE__ */ jsxs15("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: [
2924
- /* @__PURE__ */ jsx17("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx17("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)) }),
2925
- /* @__PURE__ */ jsx17("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx17("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)) }),
2926
- tool.mode === "warp" && /* @__PURE__ */ jsxs15("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
2927
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2928
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Warp" }),
2929
- /* @__PURE__ */ jsx17("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__ */ jsx17("option", { value: o.id, children: o.label }, o.id)) })
3249
+ return /* @__PURE__ */ jsxs16("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: [
3250
+ /* @__PURE__ */ jsx18("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx18("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)) }),
3251
+ /* @__PURE__ */ jsx18("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx18("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)) }),
3252
+ tool.mode === "warp" && /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
3253
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3254
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Warp" }),
3255
+ /* @__PURE__ */ jsx18("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__ */ jsx18("option", { value: o.id, children: o.label }, o.id)) })
2930
3256
  ] }),
2931
- ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2932
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
2933
- /* @__PURE__ */ jsx17(
3257
+ ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3258
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
3259
+ /* @__PURE__ */ jsx18(
2934
3260
  "input",
2935
3261
  {
2936
3262
  type: "number",
@@ -2951,9 +3277,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2951
3277
  },
2952
3278
  `${k}:${warp[k]}`
2953
3279
  ),
2954
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "%" })
3280
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "%" })
2955
3281
  ] }, k)),
2956
- /* @__PURE__ */ jsx17(
3282
+ /* @__PURE__ */ jsx18(
2957
3283
  "button",
2958
3284
  {
2959
3285
  type: "button",
@@ -2965,9 +3291,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2965
3291
  children: "Vertical"
2966
3292
  }
2967
3293
  ),
2968
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
2969
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Grid" }),
2970
- /* @__PURE__ */ jsx17(
3294
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3295
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Grid" }),
3296
+ /* @__PURE__ */ jsx18(
2971
3297
  "select",
2972
3298
  {
2973
3299
  "aria-label": "Warp grid",
@@ -2977,14 +3303,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
2977
3303
  tool.setWarp({ columns: g.columns, rows: g.rows });
2978
3304
  },
2979
3305
  className: imageFieldClass,
2980
- children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx17("option", { value: g.id, children: g.label }, g.id))
3306
+ children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx18("option", { value: g.id, children: g.label }, g.id))
2981
3307
  }
2982
3308
  )
2983
3309
  ] })
2984
3310
  ] }),
2985
- tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", title: f.title, children: [
2986
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: f.label }),
2987
- /* @__PURE__ */ jsx17(
3311
+ tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", title: f.title, children: [
3312
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: f.label }),
3313
+ /* @__PURE__ */ jsx18(
2988
3314
  "input",
2989
3315
  {
2990
3316
  type: "number",
@@ -3004,8 +3330,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
3004
3330
  },
3005
3331
  `${f.id}:${round(bar[f.id], f.unit)}`
3006
3332
  ),
3007
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: f.unit }),
3008
- f.id === "scaleX" && /* @__PURE__ */ jsx17(
3333
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: f.unit }),
3334
+ f.id === "scaleX" && /* @__PURE__ */ jsx18(
3009
3335
  "button",
3010
3336
  {
3011
3337
  type: "button",
@@ -3020,33 +3346,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
3020
3346
  }
3021
3347
  )
3022
3348
  ] }, f.id)),
3023
- /* @__PURE__ */ jsxs15("label", { className: "flex items-center gap-1", children: [
3024
- /* @__PURE__ */ jsx17("span", { className: "text-muted-foreground", children: "Interpolation" }),
3025
- /* @__PURE__ */ jsx17(
3349
+ /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3350
+ /* @__PURE__ */ jsx18("span", { className: "text-muted-foreground", children: "Interpolation" }),
3351
+ /* @__PURE__ */ jsx18(
3026
3352
  "select",
3027
3353
  {
3028
3354
  "aria-label": "Interpolation",
3029
3355
  value: tool.interpolation,
3030
3356
  onChange: (e) => tool.setInterpolation(e.target.value),
3031
3357
  className: imageFieldClass,
3032
- children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx17("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
3358
+ children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx18("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
3033
3359
  }
3034
3360
  )
3035
3361
  ] }),
3036
- /* @__PURE__ */ jsx17("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" }),
3037
- /* @__PURE__ */ jsx17("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
3038
- tool.error && /* @__PURE__ */ jsx17("span", { role: "alert", className: "text-destructive", children: tool.error })
3362
+ /* @__PURE__ */ jsx18("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" }),
3363
+ /* @__PURE__ */ jsx18("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
3364
+ tool.error && /* @__PURE__ */ jsx18("span", { role: "alert", className: "text-destructive", children: tool.error })
3039
3365
  ] });
3040
3366
  };
3041
3367
 
3042
3368
  // src/image-editor/ShapeOptionsBar.tsx
3043
- import { useEffect as useEffect11, useState as useState14 } from "react";
3369
+ import { useEffect as useEffect12, useState as useState15 } from "react";
3044
3370
  import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
3045
- import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs16 } from "react/jsx-runtime";
3371
+ import { Fragment as Fragment4, jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
3046
3372
  var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
3047
- const [, setTick] = useState14(0);
3048
- useEffect11(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
3049
- const [error, setError] = useState14(null);
3373
+ const [, setTick] = useState15(0);
3374
+ useEffect12(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
3375
+ const [error, setError] = useState15(null);
3050
3376
  const active = controller.getActiveLayer();
3051
3377
  const shapeId = active?.type === "shape" ? active.id : null;
3052
3378
  const set = (change) => {
@@ -3060,22 +3386,22 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
3060
3386
  }
3061
3387
  };
3062
3388
  const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
3063
- return /* @__PURE__ */ jsxs16("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
3064
- /* @__PURE__ */ jsx18("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx18("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
3065
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-3", children: [
3066
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3067
- /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
3389
+ return /* @__PURE__ */ jsxs17("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
3390
+ /* @__PURE__ */ jsx19("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
3391
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-3", children: [
3392
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3393
+ /* @__PURE__ */ jsx19(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
3068
3394
  "Fill",
3069
- /* @__PURE__ */ jsx18(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
3395
+ /* @__PURE__ */ jsx19(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
3070
3396
  ] }),
3071
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3072
- /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
3397
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3398
+ /* @__PURE__ */ jsx19(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
3073
3399
  "Stroke",
3074
- /* @__PURE__ */ jsx18(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
3400
+ /* @__PURE__ */ jsx19(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
3075
3401
  ] }),
3076
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3402
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3077
3403
  "Width",
3078
- /* @__PURE__ */ jsx18(
3404
+ /* @__PURE__ */ jsx19(
3079
3405
  "input",
3080
3406
  {
3081
3407
  type: "number",
@@ -3089,51 +3415,51 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
3089
3415
  )
3090
3416
  ] })
3091
3417
  ] }),
3092
- /* @__PURE__ */ jsxs16("div", { className: "flex flex-wrap items-center gap-3", children: [
3093
- options.kind === "rect" && /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3418
+ /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-3", children: [
3419
+ options.kind === "rect" && /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3094
3420
  "Radius",
3095
- /* @__PURE__ */ jsx18("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}` })
3421
+ /* @__PURE__ */ jsx19("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}` })
3096
3422
  ] }),
3097
- options.kind === "polygon" && /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3423
+ options.kind === "polygon" && /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3098
3424
  "Sides",
3099
- /* @__PURE__ */ jsx18("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}` })
3425
+ /* @__PURE__ */ jsx19("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}` })
3100
3426
  ] }),
3101
- options.kind === "star" && /* @__PURE__ */ jsxs16(Fragment4, { children: [
3102
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3427
+ options.kind === "star" && /* @__PURE__ */ jsxs17(Fragment4, { children: [
3428
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3103
3429
  "Points",
3104
- /* @__PURE__ */ jsx18("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}` })
3430
+ /* @__PURE__ */ jsx19("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}` })
3105
3431
  ] }),
3106
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3432
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3107
3433
  "Inner",
3108
- /* @__PURE__ */ jsx18(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
3434
+ /* @__PURE__ */ jsx19(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
3109
3435
  ] })
3110
3436
  ] }),
3111
- options.kind === "line" && /* @__PURE__ */ jsxs16(Fragment4, { children: [
3112
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3437
+ options.kind === "line" && /* @__PURE__ */ jsxs17(Fragment4, { children: [
3438
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3113
3439
  "Weight",
3114
- /* @__PURE__ */ jsx18("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}` })
3440
+ /* @__PURE__ */ jsx19("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}` })
3115
3441
  ] }),
3116
- /* @__PURE__ */ jsxs16("label", { className: "flex items-center gap-1", children: [
3117
- /* @__PURE__ */ jsx18(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
3442
+ /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3443
+ /* @__PURE__ */ jsx19(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
3118
3444
  "Arrowhead"
3119
3445
  ] })
3120
3446
  ] })
3121
3447
  ] }),
3122
- /* @__PURE__ */ jsx18("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." }),
3123
- error && /* @__PURE__ */ jsx18("p", { role: "alert", className: "text-destructive", children: error })
3448
+ /* @__PURE__ */ jsx19("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." }),
3449
+ error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
3124
3450
  ] });
3125
3451
  };
3126
3452
 
3127
3453
  // src/image-editor/TypeOptionsBar.tsx
3128
- import { useEffect as useEffect12, useState as useState15 } from "react";
3454
+ import { useEffect as useEffect13, useState as useState16 } from "react";
3129
3455
  import { TEXT_ALIGNS } from "@pixerate/editor/image-editor";
3130
- import { jsx as jsx19, jsxs as jsxs17 } from "react/jsx-runtime";
3456
+ import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
3131
3457
  var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
3132
3458
  var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
3133
- const [, setTick] = useState15(0);
3134
- useEffect12(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
3135
- useEffect12(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
3136
- const [error, setError] = useState15(null);
3459
+ const [, setTick] = useState16(0);
3460
+ useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
3461
+ useEffect13(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
3462
+ const [error, setError] = useState16(null);
3137
3463
  const active = controller.getActiveLayer();
3138
3464
  const typeId = !session && active?.type === "type" ? active.id : null;
3139
3465
  const here = session?.alive ? session.styleHere() : {};
@@ -3165,11 +3491,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
3165
3491
  setError(e instanceof Error ? e.message : String(e));
3166
3492
  }
3167
3493
  };
3168
- return /* @__PURE__ */ jsxs17("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
3169
- /* @__PURE__ */ jsxs17("div", { className: "flex flex-wrap items-center gap-2", children: [
3170
- /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3494
+ return /* @__PURE__ */ jsxs18("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
3495
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2", children: [
3496
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
3171
3497
  "Font",
3172
- /* @__PURE__ */ jsx19(
3498
+ /* @__PURE__ */ jsx20(
3173
3499
  "input",
3174
3500
  {
3175
3501
  list: "pixerate-type-fonts",
@@ -3179,11 +3505,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
3179
3505
  className: "w-32 rounded border border-border bg-background px-1 py-0.5"
3180
3506
  }
3181
3507
  ),
3182
- /* @__PURE__ */ jsx19("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx19("option", { value: f }, f)) })
3508
+ /* @__PURE__ */ jsx20("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx20("option", { value: f }, f)) })
3183
3509
  ] }),
3184
- /* @__PURE__ */ jsxs17("label", { className: "flex items-center gap-1", children: [
3510
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
3185
3511
  "Size",
3186
- /* @__PURE__ */ jsx19(
3512
+ /* @__PURE__ */ jsx20(
3187
3513
  "input",
3188
3514
  {
3189
3515
  type: "number",
@@ -3196,24 +3522,24 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
3196
3522
  }
3197
3523
  )
3198
3524
  ] }),
3199
- /* @__PURE__ */ jsx19("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" }),
3200
- /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
3201
- /* @__PURE__ */ jsx19(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
3525
+ /* @__PURE__ */ jsx20("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" }),
3526
+ /* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
3527
+ /* @__PURE__ */ jsx20(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
3202
3528
  ] }),
3203
- /* @__PURE__ */ jsx19("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx19("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
3204
- /* @__PURE__ */ jsx19("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text, drag for a paragraph box, click text to edit it. Esc finishes." }),
3205
- missing.length > 0 && /* @__PURE__ */ jsxs17("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
3529
+ /* @__PURE__ */ jsx20("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx20("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
3530
+ /* @__PURE__ */ jsx20("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text, drag for a paragraph box, click text to edit it. Esc finishes." }),
3531
+ missing.length > 0 && /* @__PURE__ */ jsxs18("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
3206
3532
  "Missing ",
3207
3533
  missing.length === 1 ? "font" : "fonts",
3208
3534
  ": ",
3209
3535
  missing.join(", ")
3210
3536
  ] }),
3211
- error && /* @__PURE__ */ jsx19("p", { role: "alert", className: "text-destructive", children: error })
3537
+ error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error })
3212
3538
  ] });
3213
3539
  };
3214
3540
 
3215
3541
  // src/image-editor/ImageEditor.tsx
3216
- import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
3542
+ import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
3217
3543
  var ImageEditor = ({
3218
3544
  editor: externalEditor,
3219
3545
  src,
@@ -3238,32 +3564,32 @@ var ImageEditor = ({
3238
3564
  return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
3239
3565
  });
3240
3566
  const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
3241
- const [activeTab, setActiveTab] = useState16("crop");
3242
- const rootRef = useRef7(null);
3567
+ const [activeTab, setActiveTab] = useState17("crop");
3568
+ const rootRef = useRef8(null);
3243
3569
  const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
3244
- const activeTabRef = useRef7(activeTab);
3570
+ const activeTabRef = useRef8(activeTab);
3245
3571
  activeTabRef.current = activeTab;
3246
3572
  const openPanel = async (ref) => {
3247
3573
  if (ref.kind !== "panel" || activeTabRef.current === ref.id) return;
3248
3574
  rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
3249
3575
  await new Promise((resolve) => setTimeout(resolve, 60));
3250
3576
  };
3251
- const [activeCropRatio, setActiveCropRatio] = useState16(null);
3252
- const [selectionOptions, setSelectionOptions] = useState16(DEFAULT_SELECTION_TOOL_OPTIONS2);
3253
- const [shapeOptions, setShapeOptions] = useState16(DEFAULT_SHAPE_TOOL_OPTIONS2);
3254
- const [typeOptions, setTypeOptions] = useState16(DEFAULT_TYPE_TOOL_OPTIONS2);
3255
- const [typeSession, setTypeSession] = useState16(null);
3256
- const [selectionError, setSelectionError] = useState16(null);
3257
- const [paintError, setPaintError] = useState16(null);
3258
- const [shapeTypeError, setShapeTypeError] = useState16(null);
3577
+ const [activeCropRatio, setActiveCropRatio] = useState17(null);
3578
+ const [selectionOptions, setSelectionOptions] = useState17(DEFAULT_SELECTION_TOOL_OPTIONS2);
3579
+ const [shapeOptions, setShapeOptions] = useState17(DEFAULT_SHAPE_TOOL_OPTIONS2);
3580
+ const [typeOptions, setTypeOptions] = useState17(DEFAULT_TYPE_TOOL_OPTIONS2);
3581
+ const [typeSession, setTypeSession] = useState17(null);
3582
+ const [selectionError, setSelectionError] = useState17(null);
3583
+ const [paintError, setPaintError] = useState17(null);
3584
+ const [shapeTypeError, setShapeTypeError] = useState17(null);
3259
3585
  const handleCanvasError = (source, message) => {
3260
3586
  if (source === "paint") setPaintError(message);
3261
3587
  else if (source === "select") setSelectionError(message);
3262
3588
  else setShapeTypeError(message);
3263
3589
  };
3264
3590
  const finishTyping = () => setTypeSession(null);
3265
- const transformToolRef = useRef7(null);
3266
- const transformControllerRef = useRef7(controller);
3591
+ const transformToolRef = useRef8(null);
3592
+ const transformControllerRef = useRef8(controller);
3267
3593
  if (!transformToolRef.current || transformControllerRef.current !== controller) {
3268
3594
  transformToolRef.current?.cancel();
3269
3595
  transformToolRef.current = new FreeTransformTool2(controller, {
@@ -3272,16 +3598,16 @@ var ImageEditor = ({
3272
3598
  transformControllerRef.current = controller;
3273
3599
  }
3274
3600
  const transformTool = transformToolRef.current;
3275
- const [, setTransformTick] = useState16(0);
3276
- useEffect13(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
3277
- useEffect13(() => () => transformToolRef.current?.cancel(), []);
3278
- const [inpaintPrompt, setInpaintPrompt] = useState16("");
3279
- const [inpaintMaskMode, setInpaintMaskMode] = useState16("annotations");
3280
- const [isRemovingBg, setIsRemovingBg] = useState16(false);
3281
- const [isInpainting, setIsInpainting] = useState16(false);
3282
- const [aiError, setAiError] = useState16(null);
3283
- const [aiSuccess, setAiSuccess] = useState16(null);
3284
- const [aiTarget, setAiTarget] = useState16("auto");
3601
+ const [, setTransformTick] = useState17(0);
3602
+ useEffect14(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
3603
+ useEffect14(() => () => transformToolRef.current?.cancel(), []);
3604
+ const [inpaintPrompt, setInpaintPrompt] = useState17("");
3605
+ const [inpaintMaskMode, setInpaintMaskMode] = useState17("annotations");
3606
+ const [isRemovingBg, setIsRemovingBg] = useState17(false);
3607
+ const [isInpainting, setIsInpainting] = useState17(false);
3608
+ const [aiError, setAiError] = useState17(null);
3609
+ const [aiSuccess, setAiSuccess] = useState17(null);
3610
+ const [aiTarget, setAiTarget] = useState17("auto");
3285
3611
  const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
3286
3612
  const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
3287
3613
  const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
@@ -3344,11 +3670,11 @@ var ImageEditor = ({
3344
3670
  setIsInpainting(false);
3345
3671
  }
3346
3672
  };
3347
- const [activeColor, setActiveColor] = useState16("#ef4444");
3348
- const [strokeWidth, setStrokeWidth] = useState16(3);
3349
- const [fontSize, setFontSize] = useState16(24);
3350
- const [textInput, setTextInput] = useState16("");
3351
- useEffect13(() => {
3673
+ const [activeColor, setActiveColor] = useState17("#ef4444");
3674
+ const [strokeWidth, setStrokeWidth] = useState17(3);
3675
+ const [fontSize, setFontSize] = useState17(24);
3676
+ const [textInput, setTextInput] = useState17("");
3677
+ useEffect14(() => {
3352
3678
  if (activeTab === "crop" && editor.state.activeTool !== "crop") {
3353
3679
  editor.setTool("crop");
3354
3680
  }
@@ -3376,16 +3702,16 @@ var ImageEditor = ({
3376
3702
  link.click();
3377
3703
  }
3378
3704
  };
3379
- return /* @__PURE__ */ jsxs18(
3705
+ return /* @__PURE__ */ jsxs19(
3380
3706
  "div",
3381
3707
  {
3382
3708
  ref: rootRef,
3383
3709
  className: `${imageEditorFrameClass} ${className}`,
3384
3710
  style,
3385
3711
  children: [
3386
- /* @__PURE__ */ jsxs18("div", { className: imageEditorHeaderClass, children: [
3387
- /* @__PURE__ */ jsxs18("div", { role: "tablist", className: imageTabListClass, children: [
3388
- /* @__PURE__ */ jsx20(
3712
+ /* @__PURE__ */ jsxs19("div", { className: imageEditorHeaderClass, children: [
3713
+ /* @__PURE__ */ jsxs19("div", { role: "tablist", className: imageTabListClass, children: [
3714
+ /* @__PURE__ */ jsx21(
3389
3715
  "button",
3390
3716
  {
3391
3717
  type: "button",
@@ -3400,7 +3726,7 @@ var ImageEditor = ({
3400
3726
  children: "Transform & Crop"
3401
3727
  }
3402
3728
  ),
3403
- /* @__PURE__ */ jsx20(
3729
+ /* @__PURE__ */ jsx21(
3404
3730
  "button",
3405
3731
  {
3406
3732
  type: "button",
@@ -3415,7 +3741,7 @@ var ImageEditor = ({
3415
3741
  children: "Adjustments"
3416
3742
  }
3417
3743
  ),
3418
- /* @__PURE__ */ jsx20(
3744
+ /* @__PURE__ */ jsx21(
3419
3745
  "button",
3420
3746
  {
3421
3747
  type: "button",
@@ -3430,7 +3756,7 @@ var ImageEditor = ({
3430
3756
  children: "Layers"
3431
3757
  }
3432
3758
  ),
3433
- /* @__PURE__ */ jsx20(
3759
+ /* @__PURE__ */ jsx21(
3434
3760
  "button",
3435
3761
  {
3436
3762
  type: "button",
@@ -3445,7 +3771,7 @@ var ImageEditor = ({
3445
3771
  children: "Paint"
3446
3772
  }
3447
3773
  ),
3448
- /* @__PURE__ */ jsx20(
3774
+ /* @__PURE__ */ jsx21(
3449
3775
  "button",
3450
3776
  {
3451
3777
  type: "button",
@@ -3460,7 +3786,7 @@ var ImageEditor = ({
3460
3786
  children: "Select & Mask"
3461
3787
  }
3462
3788
  ),
3463
- /* @__PURE__ */ jsx20(
3789
+ /* @__PURE__ */ jsx21(
3464
3790
  "button",
3465
3791
  {
3466
3792
  type: "button",
@@ -3475,7 +3801,7 @@ var ImageEditor = ({
3475
3801
  children: "Annotations"
3476
3802
  }
3477
3803
  ),
3478
- /* @__PURE__ */ jsx20(
3804
+ /* @__PURE__ */ jsx21(
3479
3805
  "button",
3480
3806
  {
3481
3807
  type: "button",
@@ -3490,7 +3816,7 @@ var ImageEditor = ({
3490
3816
  children: "Depth Mask"
3491
3817
  }
3492
3818
  ),
3493
- /* @__PURE__ */ jsxs18(
3819
+ /* @__PURE__ */ jsxs19(
3494
3820
  "button",
3495
3821
  {
3496
3822
  type: "button",
@@ -3503,14 +3829,14 @@ var ImageEditor = ({
3503
3829
  "aria-selected": activeTab === "ai",
3504
3830
  className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
3505
3831
  children: [
3506
- /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("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" }) }),
3832
+ /* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
3507
3833
  "AI Tools"
3508
3834
  ]
3509
3835
  }
3510
3836
  )
3511
3837
  ] }),
3512
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 text-xs", children: [
3513
- /* @__PURE__ */ jsx20(
3838
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 text-xs", children: [
3839
+ /* @__PURE__ */ jsx21(
3514
3840
  "button",
3515
3841
  {
3516
3842
  type: "button",
@@ -3521,7 +3847,7 @@ var ImageEditor = ({
3521
3847
  children: "\u21A9"
3522
3848
  }
3523
3849
  ),
3524
- /* @__PURE__ */ jsx20(
3850
+ /* @__PURE__ */ jsx21(
3525
3851
  "button",
3526
3852
  {
3527
3853
  type: "button",
@@ -3532,7 +3858,7 @@ var ImageEditor = ({
3532
3858
  children: "\u21AA"
3533
3859
  }
3534
3860
  ),
3535
- /* @__PURE__ */ jsx20(
3861
+ /* @__PURE__ */ jsx21(
3536
3862
  "button",
3537
3863
  {
3538
3864
  type: "button",
@@ -3541,8 +3867,8 @@ var ImageEditor = ({
3541
3867
  children: "Reset"
3542
3868
  }
3543
3869
  ),
3544
- /* @__PURE__ */ jsx20("div", { className: "h-4 w-px bg-muted mx-1" }),
3545
- /* @__PURE__ */ jsx20(
3870
+ /* @__PURE__ */ jsx21("div", { className: "h-4 w-px bg-muted mx-1" }),
3871
+ /* @__PURE__ */ jsx21(
3546
3872
  "button",
3547
3873
  {
3548
3874
  type: "button",
@@ -3552,11 +3878,11 @@ var ImageEditor = ({
3552
3878
  children: "-"
3553
3879
  }
3554
3880
  ),
3555
- /* @__PURE__ */ jsxs18("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
3881
+ /* @__PURE__ */ jsxs19("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
3556
3882
  Math.round(state.zoom * 100),
3557
3883
  "%"
3558
3884
  ] }),
3559
- /* @__PURE__ */ jsx20(
3885
+ /* @__PURE__ */ jsx21(
3560
3886
  "button",
3561
3887
  {
3562
3888
  type: "button",
@@ -3566,8 +3892,8 @@ var ImageEditor = ({
3566
3892
  children: "+"
3567
3893
  }
3568
3894
  ),
3569
- /* @__PURE__ */ jsx20("div", { className: "h-4 w-px bg-muted mx-1" }),
3570
- /* @__PURE__ */ jsx20(
3895
+ /* @__PURE__ */ jsx21("div", { className: "h-4 w-px bg-muted mx-1" }),
3896
+ /* @__PURE__ */ jsx21(
3571
3897
  "button",
3572
3898
  {
3573
3899
  type: "button",
@@ -3578,7 +3904,7 @@ var ImageEditor = ({
3578
3904
  children: "Hold Compare"
3579
3905
  }
3580
3906
  ),
3581
- /* @__PURE__ */ jsx20(
3907
+ /* @__PURE__ */ jsx21(
3582
3908
  "button",
3583
3909
  {
3584
3910
  type: "button",
@@ -3589,10 +3915,10 @@ var ImageEditor = ({
3589
3915
  )
3590
3916
  ] })
3591
3917
  ] }),
3592
- transformTool.active && /* @__PURE__ */ jsx20(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
3593
- !transformTool.active && transformTool.error && /* @__PURE__ */ jsx20("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
3594
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
3595
- /* @__PURE__ */ jsx20(
3918
+ transformTool.active && /* @__PURE__ */ jsx21(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
3919
+ !transformTool.active && transformTool.error && /* @__PURE__ */ jsx21("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
3920
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
3921
+ /* @__PURE__ */ jsx21(
3596
3922
  ImageEditorCanvas,
3597
3923
  {
3598
3924
  editor,
@@ -3616,11 +3942,11 @@ var ImageEditor = ({
3616
3942
  className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
3617
3943
  }
3618
3944
  ),
3619
- /* @__PURE__ */ jsxs18("div", { className: imageSidebarClass, children: [
3620
- activeTab === "crop" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-4 text-xs", children: [
3621
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
3622
- /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-3 gap-2", children: [
3623
- /* @__PURE__ */ jsx20(
3945
+ /* @__PURE__ */ jsxs19("div", { className: imageSidebarClass, children: [
3946
+ activeTab === "crop" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 text-xs", children: [
3947
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
3948
+ /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-3 gap-2", children: [
3949
+ /* @__PURE__ */ jsx21(
3624
3950
  "button",
3625
3951
  {
3626
3952
  type: "button",
@@ -3632,7 +3958,7 @@ var ImageEditor = ({
3632
3958
  children: "Freeform"
3633
3959
  }
3634
3960
  ),
3635
- /* @__PURE__ */ jsx20(
3961
+ /* @__PURE__ */ jsx21(
3636
3962
  "button",
3637
3963
  {
3638
3964
  type: "button",
@@ -3644,7 +3970,7 @@ var ImageEditor = ({
3644
3970
  children: "1:1 Square"
3645
3971
  }
3646
3972
  ),
3647
- /* @__PURE__ */ jsx20(
3973
+ /* @__PURE__ */ jsx21(
3648
3974
  "button",
3649
3975
  {
3650
3976
  type: "button",
@@ -3656,7 +3982,7 @@ var ImageEditor = ({
3656
3982
  children: "4:3 Standard"
3657
3983
  }
3658
3984
  ),
3659
- /* @__PURE__ */ jsx20(
3985
+ /* @__PURE__ */ jsx21(
3660
3986
  "button",
3661
3987
  {
3662
3988
  type: "button",
@@ -3668,7 +3994,7 @@ var ImageEditor = ({
3668
3994
  children: "16:9 Wide"
3669
3995
  }
3670
3996
  ),
3671
- /* @__PURE__ */ jsx20(
3997
+ /* @__PURE__ */ jsx21(
3672
3998
  "button",
3673
3999
  {
3674
4000
  type: "button",
@@ -3680,7 +4006,7 @@ var ImageEditor = ({
3680
4006
  children: "3:2 Photo"
3681
4007
  }
3682
4008
  ),
3683
- /* @__PURE__ */ jsx20(
4009
+ /* @__PURE__ */ jsx21(
3684
4010
  "button",
3685
4011
  {
3686
4012
  type: "button",
@@ -3693,10 +4019,10 @@ var ImageEditor = ({
3693
4019
  }
3694
4020
  )
3695
4021
  ] }),
3696
- /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3697
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
3698
- /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-2", children: [
3699
- /* @__PURE__ */ jsx20(
4022
+ /* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
4023
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
4024
+ /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-2 gap-2", children: [
4025
+ /* @__PURE__ */ jsx21(
3700
4026
  "button",
3701
4027
  {
3702
4028
  type: "button",
@@ -3705,7 +4031,7 @@ var ImageEditor = ({
3705
4031
  children: "Rotate -90\xB0"
3706
4032
  }
3707
4033
  ),
3708
- /* @__PURE__ */ jsx20(
4034
+ /* @__PURE__ */ jsx21(
3709
4035
  "button",
3710
4036
  {
3711
4037
  type: "button",
@@ -3714,7 +4040,7 @@ var ImageEditor = ({
3714
4040
  children: "Rotate +90\xB0"
3715
4041
  }
3716
4042
  ),
3717
- /* @__PURE__ */ jsx20(
4043
+ /* @__PURE__ */ jsx21(
3718
4044
  "button",
3719
4045
  {
3720
4046
  type: "button",
@@ -3723,7 +4049,7 @@ var ImageEditor = ({
3723
4049
  children: "Flip Horizontal"
3724
4050
  }
3725
4051
  ),
3726
- /* @__PURE__ */ jsx20(
4052
+ /* @__PURE__ */ jsx21(
3727
4053
  "button",
3728
4054
  {
3729
4055
  type: "button",
@@ -3734,10 +4060,10 @@ var ImageEditor = ({
3734
4060
  )
3735
4061
  ] })
3736
4062
  ] }),
3737
- activeTab === "adjust" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3738
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3739
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
3740
- /* @__PURE__ */ jsx20(
4063
+ activeTab === "adjust" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
4064
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
4065
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
4066
+ /* @__PURE__ */ jsx21(
3741
4067
  "button",
3742
4068
  {
3743
4069
  type: "button",
@@ -3747,9 +4073,9 @@ var ImageEditor = ({
3747
4073
  }
3748
4074
  )
3749
4075
  ] }),
3750
- /* @__PURE__ */ jsx20(Histogram, { histogram: editor.histogram }),
3751
- IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs18(React15.Fragment, { children: [
3752
- /* @__PURE__ */ jsx20(
4076
+ /* @__PURE__ */ jsx21(Histogram, { histogram: editor.histogram }),
4077
+ IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs19(React16.Fragment, { children: [
4078
+ /* @__PURE__ */ jsx21(
3753
4079
  ControlSlider,
3754
4080
  {
3755
4081
  spec,
@@ -3758,14 +4084,14 @@ var ImageEditor = ({
3758
4084
  onChange: (v) => editor.setAdjustments({ [spec.id]: v })
3759
4085
  }
3760
4086
  ),
3761
- spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs18(
4087
+ spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs19(
3762
4088
  "div",
3763
4089
  {
3764
4090
  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",
3765
4091
  "data-testid": "image-editor-process-notice",
3766
4092
  children: [
3767
- /* @__PURE__ */ jsx20("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
3768
- /* @__PURE__ */ jsx20(
4093
+ /* @__PURE__ */ jsx21("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
4094
+ /* @__PURE__ */ jsx21(
3769
4095
  "button",
3770
4096
  {
3771
4097
  type: "button",
@@ -3778,7 +4104,7 @@ var ImageEditor = ({
3778
4104
  }
3779
4105
  )
3780
4106
  ] }, spec.id)),
3781
- /* @__PURE__ */ jsx20("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx20(
4107
+ /* @__PURE__ */ jsx21("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx21(
3782
4108
  AdjustmentLayersPanel,
3783
4109
  {
3784
4110
  controller,
@@ -3787,9 +4113,9 @@ var ImageEditor = ({
3787
4113
  }
3788
4114
  ) })
3789
4115
  ] }),
3790
- activeTab === "layers" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3791
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Layers" }),
3792
- /* @__PURE__ */ jsx20(
4116
+ activeTab === "layers" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
4117
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Layers" }),
4118
+ /* @__PURE__ */ jsx21(
3793
4119
  "button",
3794
4120
  {
3795
4121
  type: "button",
@@ -3800,15 +4126,15 @@ var ImageEditor = ({
3800
4126
  children: "Free Transform"
3801
4127
  }
3802
4128
  ),
3803
- /* @__PURE__ */ jsx20(LayersPanel, { controller }),
3804
- effectsShown && /* @__PURE__ */ jsx20(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
3805
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Colour" }),
3806
- /* @__PURE__ */ jsx20(ColorProfilePanel, { controller })
4129
+ /* @__PURE__ */ jsx21(LayersPanel, { controller }),
4130
+ effectsShown && /* @__PURE__ */ jsx21(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
4131
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Colour" }),
4132
+ /* @__PURE__ */ jsx21(ColorProfilePanel, { controller })
3807
4133
  ] }),
3808
- activeTab === "paint" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3809
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Paint" }),
3810
- /* @__PURE__ */ jsx20(BrushOptionsBar, { controller }),
3811
- /* @__PURE__ */ jsx20(
4134
+ activeTab === "paint" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
4135
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Paint" }),
4136
+ /* @__PURE__ */ jsx21(BrushOptionsBar, { controller }),
4137
+ /* @__PURE__ */ jsx21(
3812
4138
  "button",
3813
4139
  {
3814
4140
  type: "button",
@@ -3819,12 +4145,12 @@ var ImageEditor = ({
3819
4145
  children: "Free Transform"
3820
4146
  }
3821
4147
  ),
3822
- paintError && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
3823
- /* @__PURE__ */ jsx20("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx20(LayersPanel, { controller }) })
4148
+ paintError && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
4149
+ /* @__PURE__ */ jsx21("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx21(LayersPanel, { controller }) })
3824
4150
  ] }),
3825
- activeTab === "annotate" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3826
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
3827
- /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx20(
4151
+ activeTab === "annotate" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
4152
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
4153
+ /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx21(
3828
4154
  "button",
3829
4155
  {
3830
4156
  type: "button",
@@ -3835,13 +4161,13 @@ var ImageEditor = ({
3835
4161
  },
3836
4162
  t
3837
4163
  )) }),
3838
- state.activeTool === "shape" && /* @__PURE__ */ jsx20(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
3839
- state.activeTool === "type" && /* @__PURE__ */ jsx20(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
3840
- state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx20("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" }),
3841
- shapeTypeError && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
3842
- /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3843
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
3844
- /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx20(
4164
+ state.activeTool === "shape" && /* @__PURE__ */ jsx21(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
4165
+ state.activeTool === "type" && /* @__PURE__ */ jsx21(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
4166
+ state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx21("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" }),
4167
+ shapeTypeError && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
4168
+ /* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
4169
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
4170
+ /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx21(
3845
4171
  "button",
3846
4172
  {
3847
4173
  type: "button",
@@ -3851,18 +4177,18 @@ var ImageEditor = ({
3851
4177
  },
3852
4178
  t
3853
4179
  )) }),
3854
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center gap-2 mt-2", children: [
3855
- /* @__PURE__ */ jsx20("label", { className: "text-muted-foreground", children: "Color:" }),
3856
- /* @__PURE__ */ jsx20(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
3857
- /* @__PURE__ */ jsxs18("div", { className: "flex-1 ml-2", children: [
3858
- /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
3859
- /* @__PURE__ */ jsx20("span", { children: "Width:" }),
3860
- /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
4180
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 mt-2", children: [
4181
+ /* @__PURE__ */ jsx21("label", { className: "text-muted-foreground", children: "Color:" }),
4182
+ /* @__PURE__ */ jsx21(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
4183
+ /* @__PURE__ */ jsxs19("div", { className: "flex-1 ml-2", children: [
4184
+ /* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
4185
+ /* @__PURE__ */ jsx21("span", { children: "Width:" }),
4186
+ /* @__PURE__ */ jsxs19("span", { className: "font-mono", children: [
3861
4187
  strokeWidth,
3862
4188
  "px"
3863
4189
  ] })
3864
4190
  ] }),
3865
- /* @__PURE__ */ jsx20(
4191
+ /* @__PURE__ */ jsx21(
3866
4192
  "input",
3867
4193
  {
3868
4194
  type: "range",
@@ -3875,10 +4201,10 @@ var ImageEditor = ({
3875
4201
  )
3876
4202
  ] })
3877
4203
  ] }),
3878
- /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3879
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Add Text" }),
3880
- /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
3881
- /* @__PURE__ */ jsx20(
4204
+ /* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
4205
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Add Text" }),
4206
+ /* @__PURE__ */ jsxs19("div", { className: "flex gap-2", children: [
4207
+ /* @__PURE__ */ jsx21(
3882
4208
  "input",
3883
4209
  {
3884
4210
  type: "text",
@@ -3889,7 +4215,7 @@ var ImageEditor = ({
3889
4215
  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"
3890
4216
  }
3891
4217
  ),
3892
- /* @__PURE__ */ jsx20(
4218
+ /* @__PURE__ */ jsx21(
3893
4219
  "button",
3894
4220
  {
3895
4221
  type: "button",
@@ -3899,14 +4225,14 @@ var ImageEditor = ({
3899
4225
  }
3900
4226
  )
3901
4227
  ] }),
3902
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between text-muted-foreground", children: [
3903
- /* @__PURE__ */ jsx20("span", { children: "Font Size:" }),
3904
- /* @__PURE__ */ jsxs18("span", { className: "font-mono", children: [
4228
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between text-muted-foreground", children: [
4229
+ /* @__PURE__ */ jsx21("span", { children: "Font Size:" }),
4230
+ /* @__PURE__ */ jsxs19("span", { className: "font-mono", children: [
3905
4231
  fontSize,
3906
4232
  "px"
3907
4233
  ] })
3908
4234
  ] }),
3909
- /* @__PURE__ */ jsx20(
4235
+ /* @__PURE__ */ jsx21(
3910
4236
  "input",
3911
4237
  {
3912
4238
  type: "range",
@@ -3917,14 +4243,14 @@ var ImageEditor = ({
3917
4243
  className: imageRangeClass
3918
4244
  }
3919
4245
  ),
3920
- /* @__PURE__ */ jsx20("div", { className: imageDividerClass }),
3921
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3922
- /* @__PURE__ */ jsxs18("span", { className: "text-muted-foreground", children: [
4246
+ /* @__PURE__ */ jsx21("div", { className: imageDividerClass }),
4247
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
4248
+ /* @__PURE__ */ jsxs19("span", { className: "text-muted-foreground", children: [
3923
4249
  "Layers (",
3924
4250
  state.annotations.length,
3925
4251
  ")"
3926
4252
  ] }),
3927
- state.selectedAnnotationId && /* @__PURE__ */ jsx20(
4253
+ state.selectedAnnotationId && /* @__PURE__ */ jsx21(
3928
4254
  "button",
3929
4255
  {
3930
4256
  type: "button",
@@ -3933,7 +4259,7 @@ var ImageEditor = ({
3933
4259
  children: "Delete Selected"
3934
4260
  }
3935
4261
  ),
3936
- state.annotations.length > 0 && /* @__PURE__ */ jsx20(
4262
+ state.annotations.length > 0 && /* @__PURE__ */ jsx21(
3937
4263
  "button",
3938
4264
  {
3939
4265
  type: "button",
@@ -3944,10 +4270,10 @@ var ImageEditor = ({
3944
4270
  )
3945
4271
  ] })
3946
4272
  ] }),
3947
- activeTab === "depth" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-3 text-xs", children: [
3948
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
3949
- /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
3950
- /* @__PURE__ */ jsx20(
4273
+ activeTab === "depth" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-3 text-xs", children: [
4274
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
4275
+ /* @__PURE__ */ jsx21("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
4276
+ /* @__PURE__ */ jsx21(
3951
4277
  "button",
3952
4278
  {
3953
4279
  type: "button",
@@ -3957,8 +4283,8 @@ var ImageEditor = ({
3957
4283
  }
3958
4284
  )
3959
4285
  ] }),
3960
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
3961
- /* @__PURE__ */ jsx20(
4286
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
4287
+ /* @__PURE__ */ jsx21(
3962
4288
  "input",
3963
4289
  {
3964
4290
  type: "checkbox",
@@ -3967,12 +4293,12 @@ var ImageEditor = ({
3967
4293
  className: "rounded accent-primary"
3968
4294
  }
3969
4295
  ),
3970
- /* @__PURE__ */ jsx20("span", { children: "Enable Depth / Alpha Mask" })
4296
+ /* @__PURE__ */ jsx21("span", { children: "Enable Depth / Alpha Mask" })
3971
4297
  ] }),
3972
- state.depthMask.enabled && /* @__PURE__ */ jsxs18(Fragment5, { children: [
3973
- /* @__PURE__ */ jsxs18("div", { children: [
3974
- /* @__PURE__ */ jsx20("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
3975
- /* @__PURE__ */ jsx20(
4298
+ state.depthMask.enabled && /* @__PURE__ */ jsxs19(Fragment5, { children: [
4299
+ /* @__PURE__ */ jsxs19("div", { children: [
4300
+ /* @__PURE__ */ jsx21("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
4301
+ /* @__PURE__ */ jsx21(
3976
4302
  "input",
3977
4303
  {
3978
4304
  type: "text",
@@ -3983,8 +4309,8 @@ var ImageEditor = ({
3983
4309
  }
3984
4310
  )
3985
4311
  ] }),
3986
- /* @__PURE__ */ jsxs18("div", { className: "flex gap-2", children: [
3987
- /* @__PURE__ */ jsx20(
4312
+ /* @__PURE__ */ jsxs19("div", { className: "flex gap-2", children: [
4313
+ /* @__PURE__ */ jsx21(
3988
4314
  "button",
3989
4315
  {
3990
4316
  type: "button",
@@ -3993,7 +4319,7 @@ var ImageEditor = ({
3993
4319
  children: "Threshold Mode"
3994
4320
  }
3995
4321
  ),
3996
- /* @__PURE__ */ jsx20(
4322
+ /* @__PURE__ */ jsx21(
3997
4323
  "button",
3998
4324
  {
3999
4325
  type: "button",
@@ -4003,12 +4329,12 @@ var ImageEditor = ({
4003
4329
  }
4004
4330
  )
4005
4331
  ] }),
4006
- /* @__PURE__ */ jsxs18("div", { children: [
4007
- /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
4008
- /* @__PURE__ */ jsx20("span", { children: "Depth Start (Lower):" }),
4009
- /* @__PURE__ */ jsx20("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
4332
+ /* @__PURE__ */ jsxs19("div", { children: [
4333
+ /* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
4334
+ /* @__PURE__ */ jsx21("span", { children: "Depth Start (Lower):" }),
4335
+ /* @__PURE__ */ jsx21("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
4010
4336
  ] }),
4011
- /* @__PURE__ */ jsx20(
4337
+ /* @__PURE__ */ jsx21(
4012
4338
  "input",
4013
4339
  {
4014
4340
  type: "range",
@@ -4022,12 +4348,12 @@ var ImageEditor = ({
4022
4348
  }
4023
4349
  )
4024
4350
  ] }),
4025
- /* @__PURE__ */ jsxs18("div", { children: [
4026
- /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
4027
- /* @__PURE__ */ jsx20("span", { children: "Depth Stop (Upper):" }),
4028
- /* @__PURE__ */ jsx20("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
4351
+ /* @__PURE__ */ jsxs19("div", { children: [
4352
+ /* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
4353
+ /* @__PURE__ */ jsx21("span", { children: "Depth Stop (Upper):" }),
4354
+ /* @__PURE__ */ jsx21("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
4029
4355
  ] }),
4030
- /* @__PURE__ */ jsx20(
4356
+ /* @__PURE__ */ jsx21(
4031
4357
  "input",
4032
4358
  {
4033
4359
  type: "range",
@@ -4041,12 +4367,12 @@ var ImageEditor = ({
4041
4367
  }
4042
4368
  )
4043
4369
  ] }),
4044
- /* @__PURE__ */ jsxs18("div", { children: [
4045
- /* @__PURE__ */ jsxs18("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
4046
- /* @__PURE__ */ jsx20("span", { children: "Softness:" }),
4047
- /* @__PURE__ */ jsx20("span", { className: "font-mono", children: state.depthMask.softness })
4370
+ /* @__PURE__ */ jsxs19("div", { children: [
4371
+ /* @__PURE__ */ jsxs19("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
4372
+ /* @__PURE__ */ jsx21("span", { children: "Softness:" }),
4373
+ /* @__PURE__ */ jsx21("span", { className: "font-mono", children: state.depthMask.softness })
4048
4374
  ] }),
4049
- /* @__PURE__ */ jsx20(
4375
+ /* @__PURE__ */ jsx21(
4050
4376
  "input",
4051
4377
  {
4052
4378
  type: "range",
@@ -4058,8 +4384,8 @@ var ImageEditor = ({
4058
4384
  }
4059
4385
  )
4060
4386
  ] }),
4061
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
4062
- /* @__PURE__ */ jsx20(
4387
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
4388
+ /* @__PURE__ */ jsx21(
4063
4389
  "input",
4064
4390
  {
4065
4391
  type: "checkbox",
@@ -4068,24 +4394,25 @@ var ImageEditor = ({
4068
4394
  className: "rounded accent-primary"
4069
4395
  }
4070
4396
  ),
4071
- /* @__PURE__ */ jsx20("span", { children: "Invert Mask" })
4397
+ /* @__PURE__ */ jsx21("span", { children: "Invert Mask" })
4072
4398
  ] })
4073
4399
  ] })
4074
4400
  ] }),
4075
- activeTab === "select" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-4 text-xs", children: [
4076
- /* @__PURE__ */ jsx20(
4401
+ activeTab === "select" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 text-xs", children: [
4402
+ /* @__PURE__ */ jsx21(
4077
4403
  SelectionOptionsBar,
4078
4404
  {
4079
4405
  controller,
4080
4406
  options: selectionOptions,
4081
4407
  onOptionsChange: setSelectionOptions,
4082
4408
  selection: state.selection ?? null,
4083
- quickMask: Boolean(state.quickMask)
4409
+ quickMask: Boolean(state.quickMask),
4410
+ selectionDisplay: state.selectionDisplay
4084
4411
  }
4085
4412
  ),
4086
- selectionError && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: selectionError }),
4087
- /* @__PURE__ */ jsxs18("div", { className: "flex gap-1", children: [
4088
- /* @__PURE__ */ jsx20(
4413
+ selectionError && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", children: selectionError }),
4414
+ /* @__PURE__ */ jsxs19("div", { className: "flex gap-1", children: [
4415
+ /* @__PURE__ */ jsx21(
4089
4416
  "button",
4090
4417
  {
4091
4418
  type: "button",
@@ -4096,7 +4423,7 @@ var ImageEditor = ({
4096
4423
  children: "Transform Selection"
4097
4424
  }
4098
4425
  ),
4099
- /* @__PURE__ */ jsx20(
4426
+ /* @__PURE__ */ jsx21(
4100
4427
  "button",
4101
4428
  {
4102
4429
  type: "button",
@@ -4108,12 +4435,13 @@ var ImageEditor = ({
4108
4435
  }
4109
4436
  )
4110
4437
  ] }),
4111
- /* @__PURE__ */ jsx20(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers })
4438
+ /* @__PURE__ */ jsx21(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
4439
+ /* @__PURE__ */ jsx21(ChannelsPanel, { controller })
4112
4440
  ] }),
4113
- activeTab === "ai" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-4 text-xs", children: [
4114
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
4115
- /* @__PURE__ */ jsx20("span", { children: "Results go to" }),
4116
- /* @__PURE__ */ jsxs18(
4441
+ activeTab === "ai" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-4 text-xs", children: [
4442
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
4443
+ /* @__PURE__ */ jsx21("span", { children: "Results go to" }),
4444
+ /* @__PURE__ */ jsxs19(
4117
4445
  "select",
4118
4446
  {
4119
4447
  "aria-label": "AI result target",
@@ -4121,54 +4449,54 @@ var ImageEditor = ({
4121
4449
  onChange: (e) => setAiTarget(e.target.value),
4122
4450
  className: imageSelectClass,
4123
4451
  children: [
4124
- /* @__PURE__ */ jsx20("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
4125
- /* @__PURE__ */ jsx20("option", { value: "new-layer", children: "New layer / mask" }),
4126
- /* @__PURE__ */ jsx20("option", { value: "replace", children: "Replace image" })
4452
+ /* @__PURE__ */ jsx21("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
4453
+ /* @__PURE__ */ jsx21("option", { value: "new-layer", children: "New layer / mask" }),
4454
+ /* @__PURE__ */ jsx21("option", { value: "replace", children: "Replace image" })
4127
4455
  ]
4128
4456
  }
4129
4457
  )
4130
4458
  ] }),
4131
- /* @__PURE__ */ jsxs18("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
4132
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
4133
- /* @__PURE__ */ jsxs18("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
4134
- /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("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" }) }),
4459
+ /* @__PURE__ */ jsxs19("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
4460
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
4461
+ /* @__PURE__ */ jsxs19("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
4462
+ /* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
4135
4463
  "Background Removal"
4136
4464
  ] }),
4137
- isRemovingBg && /* @__PURE__ */ jsx20("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..." })
4465
+ isRemovingBg && /* @__PURE__ */ jsx21("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..." })
4138
4466
  ] }),
4139
- /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
4140
- /* @__PURE__ */ jsx20(
4467
+ /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
4468
+ /* @__PURE__ */ jsx21(
4141
4469
  "button",
4142
4470
  {
4143
4471
  type: "button",
4144
4472
  onClick: handleRemoveBackground,
4145
4473
  disabled: isRemovingBg || isInpainting,
4146
4474
  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",
4147
- children: isRemovingBg ? /* @__PURE__ */ jsxs18(Fragment5, { children: [
4148
- /* @__PURE__ */ jsx20("div", { className: imageSpinnerClass }),
4475
+ children: isRemovingBg ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
4476
+ /* @__PURE__ */ jsx21("div", { className: imageSpinnerClass }),
4149
4477
  "Removing Background..."
4150
- ] }) : /* @__PURE__ */ jsxs18(Fragment5, { children: [
4151
- /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("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" }) }),
4478
+ ] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
4479
+ /* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
4152
4480
  "Remove Background"
4153
4481
  ] })
4154
4482
  }
4155
4483
  )
4156
4484
  ] }),
4157
- /* @__PURE__ */ jsxs18("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
4158
- /* @__PURE__ */ jsxs18("div", { className: "flex items-center justify-between", children: [
4159
- /* @__PURE__ */ jsxs18("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
4160
- /* @__PURE__ */ jsxs18("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
4161
- /* @__PURE__ */ jsx20("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" }),
4162
- /* @__PURE__ */ jsx20("path", { d: "m14 7 3 3" })
4485
+ /* @__PURE__ */ jsxs19("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
4486
+ /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between", children: [
4487
+ /* @__PURE__ */ jsxs19("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
4488
+ /* @__PURE__ */ jsxs19("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
4489
+ /* @__PURE__ */ jsx21("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" }),
4490
+ /* @__PURE__ */ jsx21("path", { d: "m14 7 3 3" })
4163
4491
  ] }),
4164
4492
  "Generative Inpainting"
4165
4493
  ] }),
4166
- isInpainting && /* @__PURE__ */ jsx20("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..." })
4494
+ isInpainting && /* @__PURE__ */ jsx21("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..." })
4167
4495
  ] }),
4168
- /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
4169
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1", children: [
4170
- /* @__PURE__ */ jsx20("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
4171
- /* @__PURE__ */ jsx20(
4496
+ /* @__PURE__ */ jsx21("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
4497
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1", children: [
4498
+ /* @__PURE__ */ jsx21("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
4499
+ /* @__PURE__ */ jsx21(
4172
4500
  "textarea",
4173
4501
  {
4174
4502
  id: "ai-inpaint-prompt-react",
@@ -4180,10 +4508,10 @@ var ImageEditor = ({
4180
4508
  }
4181
4509
  )
4182
4510
  ] }),
4183
- /* @__PURE__ */ jsxs18("div", { className: "flex flex-col gap-1", children: [
4184
- /* @__PURE__ */ jsx20("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
4185
- /* @__PURE__ */ jsxs18("div", { className: "grid grid-cols-2 gap-1.5", children: [
4186
- /* @__PURE__ */ jsxs18(
4511
+ /* @__PURE__ */ jsxs19("div", { className: "flex flex-col gap-1", children: [
4512
+ /* @__PURE__ */ jsx21("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
4513
+ /* @__PURE__ */ jsxs19("div", { className: "grid grid-cols-2 gap-1.5", children: [
4514
+ /* @__PURE__ */ jsxs19(
4187
4515
  "button",
4188
4516
  {
4189
4517
  type: "button",
@@ -4196,7 +4524,7 @@ var ImageEditor = ({
4196
4524
  ]
4197
4525
  }
4198
4526
  ),
4199
- /* @__PURE__ */ jsxs18(
4527
+ /* @__PURE__ */ jsxs19(
4200
4528
  "button",
4201
4529
  {
4202
4530
  type: "button",
@@ -4211,25 +4539,25 @@ var ImageEditor = ({
4211
4539
  )
4212
4540
  ] })
4213
4541
  ] }),
4214
- /* @__PURE__ */ jsx20(
4542
+ /* @__PURE__ */ jsx21(
4215
4543
  "button",
4216
4544
  {
4217
4545
  type: "button",
4218
4546
  onClick: handleInpaint,
4219
4547
  disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
4220
4548
  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",
4221
- children: isInpainting ? /* @__PURE__ */ jsxs18(Fragment5, { children: [
4222
- /* @__PURE__ */ jsx20("div", { className: imageSpinnerClass }),
4549
+ children: isInpainting ? /* @__PURE__ */ jsxs19(Fragment5, { children: [
4550
+ /* @__PURE__ */ jsx21("div", { className: imageSpinnerClass }),
4223
4551
  "Generating Inpaint..."
4224
- ] }) : /* @__PURE__ */ jsxs18(Fragment5, { children: [
4225
- /* @__PURE__ */ jsx20("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx20("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" }) }),
4552
+ ] }) : /* @__PURE__ */ jsxs19(Fragment5, { children: [
4553
+ /* @__PURE__ */ jsx21("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx21("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" }) }),
4226
4554
  "Apply Inpainting"
4227
4555
  ] })
4228
4556
  }
4229
4557
  )
4230
4558
  ] }),
4231
- aiError && /* @__PURE__ */ jsx20("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
4232
- aiSuccess && /* @__PURE__ */ jsx20("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
4559
+ aiError && /* @__PURE__ */ jsx21("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
4560
+ aiSuccess && /* @__PURE__ */ jsx21("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
4233
4561
  ] })
4234
4562
  ] })
4235
4563
  ] })
@@ -4262,6 +4590,7 @@ export {
4262
4590
  ColorProfilePanel,
4263
4591
  SelectionOptionsBar,
4264
4592
  RefineEdgePanel,
4593
+ ChannelsPanel,
4265
4594
  FreeTransformOptionsBar,
4266
4595
  ShapeOptionsBar,
4267
4596
  TypeOptionsBar,