@pixerate/editor-react 0.140.0 → 0.141.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 React18, { useRef as useRef11, useEffect as useEffect16, useState as useState19 } from "react";
193
+ import React19, { useRef as useRef11, useEffect as useEffect17, useState as useState20 } from "react";
194
194
  import {
195
195
  normalizeProcessVersion,
196
196
  LATEST_PROCESS_VERSION,
@@ -4037,14 +4037,121 @@ var ChannelsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4037
4037
  ] });
4038
4038
  };
4039
4039
 
4040
- // src/image-editor/FreeTransformOptionsBar.tsx
4040
+ // src/image-editor/PathsPanel.tsx
4041
4041
  import { useEffect as useEffect13, useState as useState16 } from "react";
4042
- import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
4042
+ import { pathSvgData, selectionModeFromModifiers as selectionModeFromModifiers2 } from "@pixerate/editor/image-editor";
4043
4043
  import { jsx as jsx20, jsxs as jsxs18 } from "react/jsx-runtime";
4044
+ var btn3 = (on = false) => `px-2 py-1 rounded-md border text-[11px] transition-colors disabled:opacity-40 ${on ? "bg-primary border-primary text-primary-foreground" : "bg-background border-border text-foreground hover:bg-accent hover:text-accent-foreground"}`;
4045
+ var PathsPanel = ({ controller, thumbnailSize = 32, className = "" }) => {
4046
+ const [, setTick] = useState16(0);
4047
+ useEffect13(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4048
+ const [renaming, setRenaming] = useState16(null);
4049
+ const [color, setColor] = useState16("#000000");
4050
+ const [width, setWidth] = useState16(2);
4051
+ const [error, setError] = useState16(null);
4052
+ const paths = controller.getPaths();
4053
+ const activeId = controller.getState().activePathId ?? null;
4054
+ const active = paths.find((p) => p.id === activeId) ?? null;
4055
+ const hasSelection = Boolean(controller.getSelection());
4056
+ const { width: w, height: h } = controller.getState().imageDimensions;
4057
+ const attempt = (fn) => {
4058
+ setError(null);
4059
+ try {
4060
+ fn();
4061
+ } catch (err) {
4062
+ setError(err instanceof Error ? err.message : String(err));
4063
+ }
4064
+ };
4065
+ return /* @__PURE__ */ jsxs18("div", { "data-testid": "paths-panel", className: `flex flex-col gap-2 text-xs ${className}`, children: [
4066
+ /* @__PURE__ */ jsx20("span", { className: imageSectionTitleClass, children: "Paths" }),
4067
+ paths.length === 0 && /* @__PURE__ */ jsx20("p", { className: "text-muted-foreground", children: "No paths. Make a work path from a selection." }),
4068
+ /* @__PURE__ */ jsx20("ul", { role: "list", className: "flex flex-col gap-0.5", children: paths.map((p) => /* @__PURE__ */ jsxs18(
4069
+ "li",
4070
+ {
4071
+ "data-testid": "path-row",
4072
+ "aria-current": p.id === activeId ? "true" : void 0,
4073
+ className: `flex items-center gap-1.5 px-1.5 py-1 rounded cursor-pointer select-none ${p.id === activeId ? "bg-primary/30 ring-1 ring-primary" : "hover:bg-muted"}`,
4074
+ onClick: () => attempt(() => controller.setActivePath(p.id)),
4075
+ onDoubleClick: () => setRenaming(p.id),
4076
+ children: [
4077
+ /* @__PURE__ */ jsx20("svg", { "aria-hidden": "true", viewBox: `0 0 ${w || 1} ${h || 1}`, style: { width: thumbnailSize, height: thumbnailSize }, className: "shrink-0 rounded ring-1 ring-border bg-background", children: /* @__PURE__ */ jsx20("path", { d: pathSvgData(p), fill: "currentColor", fillOpacity: 0.25, stroke: "currentColor", strokeWidth: Math.max(w, h) / 64, fillRule: p.fillRule ?? "nonzero" }) }),
4078
+ renaming === p.id ? /* @__PURE__ */ jsx20(
4079
+ "input",
4080
+ {
4081
+ autoFocus: true,
4082
+ "aria-label": "Path name",
4083
+ defaultValue: p.work ? "" : p.name,
4084
+ placeholder: "Path name",
4085
+ className: "min-w-0 flex-1 bg-background border border-border rounded px-1 py-0.5 text-foreground",
4086
+ onClick: (e) => e.stopPropagation(),
4087
+ onBlur: (e) => {
4088
+ setRenaming(null);
4089
+ const name = e.currentTarget.value.trim();
4090
+ if (name && name !== p.name) attempt(() => controller.renamePath(p.id, name));
4091
+ },
4092
+ onKeyDown: (e) => {
4093
+ if (e.key === "Enter") e.currentTarget.blur();
4094
+ if (e.key === "Escape") setRenaming(null);
4095
+ }
4096
+ }
4097
+ ) : /* @__PURE__ */ jsx20("span", { className: `min-w-0 flex-1 truncate ${p.work ? "italic" : ""}`, children: p.name })
4098
+ ]
4099
+ },
4100
+ p.id
4101
+ )) }),
4102
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4103
+ /* @__PURE__ */ jsx20(
4104
+ "button",
4105
+ {
4106
+ type: "button",
4107
+ className: btn3(),
4108
+ disabled: !active,
4109
+ title: "Load the path as the selection (Shift adds, Alt subtracts)",
4110
+ onClick: (e) => attempt(() => controller.loadPathAsSelection(active.id, { mode: selectionModeFromModifiers2(e, "replace") })),
4111
+ children: "Load as Selection"
4112
+ }
4113
+ ),
4114
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !hasSelection, onClick: () => attempt(() => controller.makeWorkPath()), children: "Make Work Path" }),
4115
+ active?.work && /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), onClick: () => setRenaming(active.id), children: "Save Path" }),
4116
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.addVectorMaskFromPath(active.id)), children: "Add Vector Mask" })
4117
+ ] }),
4118
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-1", children: [
4119
+ /* @__PURE__ */ jsx20("input", { type: "color", "aria-label": "Path paint colour", value: color, onChange: (e) => setColor(e.target.value), className: "h-6 w-8 bg-background border border-border rounded" }),
4120
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.fillPath(active.id, { color })), children: "Fill Path" }),
4121
+ /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1 text-muted-foreground", children: [
4122
+ /* @__PURE__ */ jsx20(
4123
+ "input",
4124
+ {
4125
+ type: "number",
4126
+ min: 0.5,
4127
+ max: 250,
4128
+ step: 0.5,
4129
+ "aria-label": "Stroke width",
4130
+ value: width,
4131
+ onChange: (e) => setWidth(Math.min(250, Math.max(0.5, Number(e.target.value) || 1))),
4132
+ className: "w-12 bg-background border border-border rounded px-1 py-0.5 text-foreground"
4133
+ }
4134
+ ),
4135
+ "px"
4136
+ ] }),
4137
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.strokePath(active.id, { width, color })), children: "Stroke Path" })
4138
+ ] }),
4139
+ /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap gap-1", children: [
4140
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.duplicatePath(active.id)), children: "Duplicate" }),
4141
+ /* @__PURE__ */ jsx20("button", { type: "button", className: btn3(), disabled: !active, onClick: () => attempt(() => controller.deletePath(active.id)), children: "Delete" })
4142
+ ] }),
4143
+ error && /* @__PURE__ */ jsx20("p", { role: "alert", className: "text-destructive", children: error })
4144
+ ] });
4145
+ };
4146
+
4147
+ // src/image-editor/FreeTransformOptionsBar.tsx
4148
+ import { useEffect as useEffect14, useState as useState17 } from "react";
4149
+ import { FREE_TRANSFORM_FIELDS, FREE_TRANSFORM_MODE_OPTIONS, INTERPOLATIONS, TRANSFORM_ANCHORS, WARP_GRID_OPTIONS, WARP_STYLE_OPTIONS } from "@pixerate/editor/image-editor";
4150
+ import { jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4044
4151
  var round = (v, unit) => unit === "px" ? Math.round(v * 10) / 10 : Math.round(v * 100) / 100;
4045
4152
  var FreeTransformOptionsBar = ({ tool, className }) => {
4046
- const [, setTick] = useState16(0);
4047
- useEffect13(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
4153
+ const [, setTick] = useState17(0);
4154
+ useEffect14(() => tool.subscribe(() => setTick((n) => n + 1)), [tool]);
4048
4155
  const bar = tool.bar();
4049
4156
  if (!tool.active || !bar) return null;
4050
4157
  const warp = tool.warpBar();
@@ -4056,17 +4163,17 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4056
4163
  const v = Number(raw);
4057
4164
  if (raw.trim() !== "" && Number.isFinite(v) && Math.abs(v - bar[field]) > 1e-9) tool.setField(field, v);
4058
4165
  };
4059
- return /* @__PURE__ */ jsxs18("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: [
4060
- /* @__PURE__ */ jsx20("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx20("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)) }),
4061
- /* @__PURE__ */ jsx20("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx20("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)) }),
4062
- tool.mode === "warp" && /* @__PURE__ */ jsxs18("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
4063
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4064
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "Warp" }),
4065
- /* @__PURE__ */ jsx20("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__ */ jsx20("option", { value: o.id, children: o.label }, o.id)) })
4166
+ return /* @__PURE__ */ jsxs19("div", { className: `flex flex-wrap items-center gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "free-transform-options", role: "toolbar", "aria-label": "Free Transform options", children: [
4167
+ /* @__PURE__ */ jsx21("div", { className: "flex gap-1", role: "group", "aria-label": "Transform mode", children: FREE_TRANSFORM_MODE_OPTIONS.map((m) => /* @__PURE__ */ jsx21("button", { type: "button", title: m.title, "aria-pressed": tool.mode === m.id, className: imageChipClass(tool.mode === m.id), onClick: () => tool.setMode(m.id), children: m.label }, m.id)) }),
4168
+ /* @__PURE__ */ jsx21("div", { className: "grid grid-cols-3 gap-px", role: "group", "aria-label": "Reference point", children: TRANSFORM_ANCHORS.map((a) => /* @__PURE__ */ jsx21("button", { type: "button", "aria-label": `Reference point ${a}`, title: `Reference point: ${a}`, className: "h-2.5 w-2.5 rounded-sm bg-accent hover:bg-primary/90", onClick: () => tool.setReference(a) }, a)) }),
4169
+ tool.mode === "warp" && /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": "Warp options", children: [
4170
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4171
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Warp" }),
4172
+ /* @__PURE__ */ jsx21("select", { "aria-label": "Warp style", value: warp.style, onChange: (e) => tool.setWarp({ style: e.target.value }), className: imageFieldClass, children: WARP_STYLE_OPTIONS.map((o) => /* @__PURE__ */ jsx21("option", { value: o.id, children: o.label }, o.id)) })
4066
4173
  ] }),
4067
- ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4068
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
4069
- /* @__PURE__ */ jsx20(
4174
+ ["bend", "horizontal", "vertical"].map((k) => /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4175
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: k === "bend" ? "Bend" : k === "horizontal" ? "H" : "V" }),
4176
+ /* @__PURE__ */ jsx21(
4070
4177
  "input",
4071
4178
  {
4072
4179
  type: "number",
@@ -4087,9 +4194,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4087
4194
  },
4088
4195
  `${k}:${warp[k]}`
4089
4196
  ),
4090
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "%" })
4197
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "%" })
4091
4198
  ] }, k)),
4092
- /* @__PURE__ */ jsx20(
4199
+ /* @__PURE__ */ jsx21(
4093
4200
  "button",
4094
4201
  {
4095
4202
  type: "button",
@@ -4101,9 +4208,9 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4101
4208
  children: "Vertical"
4102
4209
  }
4103
4210
  ),
4104
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4105
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "Grid" }),
4106
- /* @__PURE__ */ jsx20(
4211
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4212
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Grid" }),
4213
+ /* @__PURE__ */ jsx21(
4107
4214
  "select",
4108
4215
  {
4109
4216
  "aria-label": "Warp grid",
@@ -4113,14 +4220,14 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4113
4220
  tool.setWarp({ columns: g.columns, rows: g.rows });
4114
4221
  },
4115
4222
  className: imageFieldClass,
4116
- children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx20("option", { value: g.id, children: g.label }, g.id))
4223
+ children: WARP_GRID_OPTIONS.map((g) => /* @__PURE__ */ jsx21("option", { value: g.id, children: g.label }, g.id))
4117
4224
  }
4118
4225
  )
4119
4226
  ] })
4120
4227
  ] }),
4121
- tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", title: f.title, children: [
4122
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: f.label }),
4123
- /* @__PURE__ */ jsx20(
4228
+ tool.mode !== "warp" && FREE_TRANSFORM_FIELDS.map((f) => /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", title: f.title, children: [
4229
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: f.label }),
4230
+ /* @__PURE__ */ jsx21(
4124
4231
  "input",
4125
4232
  {
4126
4233
  type: "number",
@@ -4140,8 +4247,8 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4140
4247
  },
4141
4248
  `${f.id}:${round(bar[f.id], f.unit)}`
4142
4249
  ),
4143
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: f.unit }),
4144
- f.id === "scaleX" && /* @__PURE__ */ jsx20(
4250
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: f.unit }),
4251
+ f.id === "scaleX" && /* @__PURE__ */ jsx21(
4145
4252
  "button",
4146
4253
  {
4147
4254
  type: "button",
@@ -4156,33 +4263,33 @@ var FreeTransformOptionsBar = ({ tool, className }) => {
4156
4263
  }
4157
4264
  )
4158
4265
  ] }, f.id)),
4159
- /* @__PURE__ */ jsxs18("label", { className: "flex items-center gap-1", children: [
4160
- /* @__PURE__ */ jsx20("span", { className: "text-muted-foreground", children: "Interpolation" }),
4161
- /* @__PURE__ */ jsx20(
4266
+ /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4267
+ /* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: "Interpolation" }),
4268
+ /* @__PURE__ */ jsx21(
4162
4269
  "select",
4163
4270
  {
4164
4271
  "aria-label": "Interpolation",
4165
4272
  value: tool.interpolation,
4166
4273
  onChange: (e) => tool.setInterpolation(e.target.value),
4167
4274
  className: imageFieldClass,
4168
- children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx20("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
4275
+ children: INTERPOLATIONS.map((i) => /* @__PURE__ */ jsx21("option", { value: i, children: i[0].toUpperCase() + i.slice(1) }, i))
4169
4276
  }
4170
4277
  )
4171
4278
  ] }),
4172
- /* @__PURE__ */ jsx20("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" }),
4173
- /* @__PURE__ */ jsx20("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
4174
- tool.error && /* @__PURE__ */ jsx20("span", { role: "alert", className: "text-destructive", children: tool.error })
4279
+ /* @__PURE__ */ jsx21("button", { type: "button", title: "Commit (Enter)", className: "px-2 py-1 rounded bg-primary text-primary-foreground hover:bg-primary/90", onClick: () => tool.commit(), children: "Commit" }),
4280
+ /* @__PURE__ */ jsx21("button", { type: "button", title: "Cancel (Esc)", className: imageChipClass(false), onClick: () => tool.cancel(), children: "Cancel" }),
4281
+ tool.error && /* @__PURE__ */ jsx21("span", { role: "alert", className: "text-destructive", children: tool.error })
4175
4282
  ] });
4176
4283
  };
4177
4284
 
4178
4285
  // src/image-editor/ShapeOptionsBar.tsx
4179
- import { useEffect as useEffect14, useState as useState17 } from "react";
4286
+ import { useEffect as useEffect15, useState as useState18 } from "react";
4180
4287
  import { LIVE_SHAPE_KINDS, SHAPE_KIND_LABELS, applyShapeOptions } from "@pixerate/editor/image-editor";
4181
- import { Fragment as Fragment5, jsx as jsx21, jsxs as jsxs19 } from "react/jsx-runtime";
4288
+ import { Fragment as Fragment5, jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
4182
4289
  var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4183
- const [, setTick] = useState17(0);
4184
- useEffect14(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4185
- const [error, setError] = useState17(null);
4290
+ const [, setTick] = useState18(0);
4291
+ useEffect15(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4292
+ const [error, setError] = useState18(null);
4186
4293
  const active = controller.getActiveLayer();
4187
4294
  const shapeId = active?.type === "shape" ? active.id : null;
4188
4295
  const set = (change) => {
@@ -4196,22 +4303,22 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4196
4303
  }
4197
4304
  };
4198
4305
  const num = (v, min, max) => Math.max(min, Math.min(max, Number(v) || min));
4199
- return /* @__PURE__ */ jsxs19("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
4200
- /* @__PURE__ */ jsx21("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx21("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
4201
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-3", children: [
4202
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4203
- /* @__PURE__ */ jsx21(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
4306
+ return /* @__PURE__ */ jsxs20("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "shape-options", children: [
4307
+ /* @__PURE__ */ jsx22("div", { className: "flex flex-wrap gap-1", role: "toolbar", "aria-label": "Shape kind", children: LIVE_SHAPE_KINDS.map((k) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": options.kind === k, className: imageChipClass(options.kind === k), onClick: () => onChange({ ...options, kind: k }), children: SHAPE_KIND_LABELS[k] }, k)) }),
4308
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-3", children: [
4309
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4310
+ /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Fill", checked: options.fill !== null, onChange: (on) => set({ fill: on ? "#4f46e5" : null }) }),
4204
4311
  "Fill",
4205
- /* @__PURE__ */ jsx21(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
4312
+ /* @__PURE__ */ jsx22(ImageColor, { label: "Fill colour", disabled: options.fill === null, value: options.fill ?? "#4f46e5", onChange: (fill) => set({ fill }) })
4206
4313
  ] }),
4207
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4208
- /* @__PURE__ */ jsx21(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
4314
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4315
+ /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Stroke", checked: options.stroke !== null, onChange: (on) => set({ stroke: on ? "#000000" : null }) }),
4209
4316
  "Stroke",
4210
- /* @__PURE__ */ jsx21(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
4317
+ /* @__PURE__ */ jsx22(ImageColor, { label: "Stroke colour", disabled: options.stroke === null, value: options.stroke ?? "#000000", onChange: (stroke) => set({ stroke }) })
4211
4318
  ] }),
4212
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4319
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4213
4320
  "Width",
4214
- /* @__PURE__ */ jsx21(
4321
+ /* @__PURE__ */ jsx22(
4215
4322
  "input",
4216
4323
  {
4217
4324
  type: "number",
@@ -4225,52 +4332,52 @@ var ShapeOptionsBar = ({ controller, options, onChange, className }) => {
4225
4332
  )
4226
4333
  ] })
4227
4334
  ] }),
4228
- /* @__PURE__ */ jsxs19("div", { className: "flex flex-wrap items-center gap-3", children: [
4229
- options.kind === "rect" && /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4335
+ /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-3", children: [
4336
+ options.kind === "rect" && /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4230
4337
  "Radius",
4231
- /* @__PURE__ */ jsx21("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}` })
4338
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Corner radius", min: 0, max: 1e3, value: options.radius, onChange: (e) => set({ radius: num(e.target.value, 0, 1e3) }), className: `w-14 ${imageFieldClass}` })
4232
4339
  ] }),
4233
- options.kind === "polygon" && /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4340
+ options.kind === "polygon" && /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4234
4341
  "Sides",
4235
- /* @__PURE__ */ jsx21("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}` })
4342
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Sides", min: 3, max: 100, value: options.sides, onChange: (e) => set({ sides: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4236
4343
  ] }),
4237
- options.kind === "star" && /* @__PURE__ */ jsxs19(Fragment5, { children: [
4238
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4344
+ options.kind === "star" && /* @__PURE__ */ jsxs20(Fragment5, { children: [
4345
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4239
4346
  "Points",
4240
- /* @__PURE__ */ jsx21("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}` })
4347
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Points", min: 3, max: 100, value: options.points, onChange: (e) => set({ points: num(e.target.value, 3, 100) }), className: `w-14 ${imageFieldClass}` })
4241
4348
  ] }),
4242
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4349
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4243
4350
  "Inner",
4244
- /* @__PURE__ */ jsx21(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
4351
+ /* @__PURE__ */ jsx22(ImageRange, { label: "Inner radius", min: 0.05, max: 1, step: 0.05, value: options.innerRatio, onChange: (v) => set({ innerRatio: v }) })
4245
4352
  ] })
4246
4353
  ] }),
4247
- options.kind === "line" && /* @__PURE__ */ jsxs19(Fragment5, { children: [
4248
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4354
+ options.kind === "line" && /* @__PURE__ */ jsxs20(Fragment5, { children: [
4355
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4249
4356
  "Weight",
4250
- /* @__PURE__ */ jsx21("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}` })
4357
+ /* @__PURE__ */ jsx22("input", { type: "number", "aria-label": "Line weight", min: 1, max: 200, value: options.weight, onChange: (e) => set({ weight: num(e.target.value, 1, 200) }), className: `w-14 ${imageFieldClass}` })
4251
4358
  ] }),
4252
- /* @__PURE__ */ jsxs19("label", { className: "flex items-center gap-1", children: [
4253
- /* @__PURE__ */ jsx21(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
4359
+ /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4360
+ /* @__PURE__ */ jsx22(ImageCheckbox, { label: "Arrowhead", checked: options.arrow, onChange: (on) => set({ arrow: on }) }),
4254
4361
  "Arrowhead"
4255
4362
  ] })
4256
4363
  ] })
4257
4364
  ] }),
4258
- /* @__PURE__ */ jsx21("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." }),
4259
- error && /* @__PURE__ */ jsx21("p", { role: "alert", className: "text-destructive", children: error })
4365
+ /* @__PURE__ */ jsx22("p", { className: "text-[10px] text-muted-foreground", children: "Drag on the image to draw. Shift: square, circle or 45\xB0 line. Alt: from the centre." }),
4366
+ error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
4260
4367
  ] });
4261
4368
  };
4262
4369
 
4263
4370
  // src/image-editor/TypeOptionsBar.tsx
4264
- import { useEffect as useEffect15, useState as useState18 } from "react";
4371
+ import { useEffect as useEffect16, useState as useState19 } from "react";
4265
4372
  import { TEXT_ALIGNS, TEXT_ORIENTATIONS } from "@pixerate/editor/image-editor";
4266
- import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
4373
+ import { jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
4267
4374
  var ALIGN_LABELS = { left: "Left", center: "Centre", right: "Right", justify: "Justify" };
4268
4375
  var ORIENTATION_LABELS = { horizontal: "Horizontal", vertical: "Vertical" };
4269
4376
  var TypeOptionsBar = ({ controller, options, onChange, session, className }) => {
4270
- const [, setTick] = useState18(0);
4271
- useEffect15(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4272
- useEffect15(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
4273
- const [error, setError] = useState18(null);
4377
+ const [, setTick] = useState19(0);
4378
+ useEffect16(() => controller.subscribe(() => setTick((n) => n + 1)), [controller]);
4379
+ useEffect16(() => session?.subscribe(() => setTick((n) => n + 1)), [session]);
4380
+ const [error, setError] = useState19(null);
4274
4381
  const active = controller.getActiveLayer();
4275
4382
  const typeId = !session && active?.type === "type" ? active.id : null;
4276
4383
  const here = session?.alive ? session.styleHere() : {};
@@ -4323,11 +4430,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4323
4430
  setError(e instanceof Error ? e.message : String(e));
4324
4431
  }
4325
4432
  };
4326
- return /* @__PURE__ */ jsxs20("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
4327
- /* @__PURE__ */ jsxs20("div", { className: "flex flex-wrap items-center gap-2", children: [
4328
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4433
+ return /* @__PURE__ */ jsxs21("div", { className: `flex flex-col gap-2 text-xs text-foreground ${className ?? ""}`, "data-testid": "type-options", children: [
4434
+ /* @__PURE__ */ jsxs21("div", { className: "flex flex-wrap items-center gap-2", children: [
4435
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4329
4436
  "Font",
4330
- /* @__PURE__ */ jsx22(
4437
+ /* @__PURE__ */ jsx23(
4331
4438
  "input",
4332
4439
  {
4333
4440
  list: "pixerate-type-fonts",
@@ -4337,11 +4444,11 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4337
4444
  className: "w-32 rounded border border-border bg-background px-1 py-0.5"
4338
4445
  }
4339
4446
  ),
4340
- /* @__PURE__ */ jsx22("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx22("option", { value: f }, f)) })
4447
+ /* @__PURE__ */ jsx23("datalist", { id: "pixerate-type-fonts", children: fonts.map((f) => /* @__PURE__ */ jsx23("option", { value: f }, f)) })
4341
4448
  ] }),
4342
- /* @__PURE__ */ jsxs20("label", { className: "flex items-center gap-1", children: [
4449
+ /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-1", children: [
4343
4450
  "Size",
4344
- /* @__PURE__ */ jsx22(
4451
+ /* @__PURE__ */ jsx23(
4345
4452
  "input",
4346
4453
  {
4347
4454
  type: "number",
@@ -4354,14 +4461,14 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4354
4461
  }
4355
4462
  )
4356
4463
  ] }),
4357
- /* @__PURE__ */ jsx22("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" }),
4358
- /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
4359
- /* @__PURE__ */ jsx22(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
4464
+ /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": shown.fontWeight >= 600, className: `${imageChipClass(shown.fontWeight >= 600)} font-bold`, onClick: () => style({ fontWeight: shown.fontWeight >= 600 ? 400 : 700 }), children: "B" }),
4465
+ /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": shown.italic, className: `${imageChipClass(shown.italic)} italic`, onClick: () => style({ italic: !shown.italic }), children: "I" }),
4466
+ /* @__PURE__ */ jsx23(ImageColor, { label: "Text colour", value: shown.color, onChange: (color) => style({ color }) })
4360
4467
  ] }),
4361
- /* @__PURE__ */ jsx22("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
4362
- /* @__PURE__ */ jsxs20("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
4363
- TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx22("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
4364
- orientation === "vertical" && editedId && /* @__PURE__ */ jsx22(
4468
+ /* @__PURE__ */ jsx23("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Alignment", children: TEXT_ALIGNS.map((a) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": options.align === a, className: imageChipClass(options.align === a), onClick: () => style({ align: a }), children: ALIGN_LABELS[a] }, a)) }),
4469
+ /* @__PURE__ */ jsxs21("div", { className: "flex gap-1", role: "toolbar", "aria-label": "Orientation", children: [
4470
+ TEXT_ORIENTATIONS.map((o) => /* @__PURE__ */ jsx23("button", { type: "button", "aria-pressed": orientation === o, className: imageChipClass(orientation === o), onClick: () => orient(o), children: ORIENTATION_LABELS[o] }, o)),
4471
+ orientation === "vertical" && editedId && /* @__PURE__ */ jsx23(
4365
4472
  "button",
4366
4473
  {
4367
4474
  type: "button",
@@ -4373,19 +4480,19 @@ var TypeOptionsBar = ({ controller, options, onChange, session, className }) =>
4373
4480
  }
4374
4481
  )
4375
4482
  ] }),
4376
- /* @__PURE__ */ jsx22("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
4377
- missing.length > 0 && /* @__PURE__ */ jsxs20("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
4483
+ /* @__PURE__ */ jsx23("p", { className: "text-[10px] text-muted-foreground", children: "Click to type point text (vertical: a column down from the click), drag for a paragraph box, click text to edit it. Esc finishes." }),
4484
+ missing.length > 0 && /* @__PURE__ */ jsxs21("p", { role: "status", className: "text-amber-600", "data-testid": "type-missing-fonts", children: [
4378
4485
  "Missing ",
4379
4486
  missing.length === 1 ? "font" : "fonts",
4380
4487
  ": ",
4381
4488
  missing.join(", ")
4382
4489
  ] }),
4383
- error && /* @__PURE__ */ jsx22("p", { role: "alert", className: "text-destructive", children: error })
4490
+ error && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", children: error })
4384
4491
  ] });
4385
4492
  };
4386
4493
 
4387
4494
  // src/image-editor/ImageEditor.tsx
4388
- import { Fragment as Fragment6, jsx as jsx23, jsxs as jsxs21 } from "react/jsx-runtime";
4495
+ import { Fragment as Fragment6, jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
4389
4496
  var ImageEditor = ({
4390
4497
  editor: externalEditor,
4391
4498
  src,
@@ -4410,7 +4517,7 @@ var ImageEditor = ({
4410
4517
  return l.type === "pixel" && !!l.generator || l.type === "smart" && !!l.smartFilters?.filters.some((f) => f.kind === "effect") || l.type === "group" && l.children.some(has);
4411
4518
  });
4412
4519
  const legacyProcess = normalizeProcessVersion(state.adjustments.process) < LATEST_PROCESS_VERSION;
4413
- const [activeTab, setActiveTab] = useState19("crop");
4520
+ const [activeTab, setActiveTab] = useState20("crop");
4414
4521
  const rootRef = useRef11(null);
4415
4522
  const canvasMode = activeTab === "crop" || activeTab === "select" || activeTab === "paint" || activeTab === "annotate" ? activeTab : "none";
4416
4523
  const activeTabRef = useRef11(activeTab);
@@ -4420,14 +4527,14 @@ var ImageEditor = ({
4420
4527
  rootRef.current?.querySelector(`[data-image-tab="${CSS.escape(ref.id)}"]`)?.click();
4421
4528
  await new Promise((resolve) => setTimeout(resolve, 60));
4422
4529
  };
4423
- const [activeCropRatio, setActiveCropRatio] = useState19(null);
4424
- const [selectionOptions, setSelectionOptions] = useState19(DEFAULT_SELECTION_TOOL_OPTIONS2);
4425
- const [shapeOptions, setShapeOptions] = useState19(DEFAULT_SHAPE_TOOL_OPTIONS2);
4426
- const [typeOptions, setTypeOptions] = useState19(DEFAULT_TYPE_TOOL_OPTIONS2);
4427
- const [typeSession, setTypeSession] = useState19(null);
4428
- const [selectionError, setSelectionError] = useState19(null);
4429
- const [paintError, setPaintError] = useState19(null);
4430
- const [shapeTypeError, setShapeTypeError] = useState19(null);
4530
+ const [activeCropRatio, setActiveCropRatio] = useState20(null);
4531
+ const [selectionOptions, setSelectionOptions] = useState20(DEFAULT_SELECTION_TOOL_OPTIONS2);
4532
+ const [shapeOptions, setShapeOptions] = useState20(DEFAULT_SHAPE_TOOL_OPTIONS2);
4533
+ const [typeOptions, setTypeOptions] = useState20(DEFAULT_TYPE_TOOL_OPTIONS2);
4534
+ const [typeSession, setTypeSession] = useState20(null);
4535
+ const [selectionError, setSelectionError] = useState20(null);
4536
+ const [paintError, setPaintError] = useState20(null);
4537
+ const [shapeTypeError, setShapeTypeError] = useState20(null);
4431
4538
  const handleCanvasError = (source, message) => {
4432
4539
  if (source === "paint") setPaintError(message);
4433
4540
  else if (source === "select") setSelectionError(message);
@@ -4444,16 +4551,16 @@ var ImageEditor = ({
4444
4551
  transformControllerRef.current = controller;
4445
4552
  }
4446
4553
  const transformTool = transformToolRef.current;
4447
- const [, setTransformTick] = useState19(0);
4448
- useEffect16(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
4449
- useEffect16(() => () => transformToolRef.current?.cancel(), []);
4450
- const [inpaintPrompt, setInpaintPrompt] = useState19("");
4451
- const [inpaintMaskMode, setInpaintMaskMode] = useState19("annotations");
4452
- const [isRemovingBg, setIsRemovingBg] = useState19(false);
4453
- const [isInpainting, setIsInpainting] = useState19(false);
4454
- const [aiError, setAiError] = useState19(null);
4455
- const [aiSuccess, setAiSuccess] = useState19(null);
4456
- const [aiTarget, setAiTarget] = useState19("auto");
4554
+ const [, setTransformTick] = useState20(0);
4555
+ useEffect17(() => transformTool.subscribe(() => setTransformTick((n) => n + 1)), [transformTool]);
4556
+ useEffect17(() => () => transformToolRef.current?.cancel(), []);
4557
+ const [inpaintPrompt, setInpaintPrompt] = useState20("");
4558
+ const [inpaintMaskMode, setInpaintMaskMode] = useState20("annotations");
4559
+ const [isRemovingBg, setIsRemovingBg] = useState20(false);
4560
+ const [isInpainting, setIsInpainting] = useState20(false);
4561
+ const [aiError, setAiError] = useState20(null);
4562
+ const [aiSuccess, setAiSuccess] = useState20(null);
4563
+ const [aiTarget, setAiTarget] = useState20("auto");
4457
4564
  const aiOptions = aiTarget === "auto" ? {} : { target: aiTarget };
4458
4565
  const effectiveOnInpaint = onInpaint || aiHooks?.onInpaint;
4459
4566
  const effectiveOnRemoveBg = onRemoveBackground || aiHooks?.onRemoveBackground;
@@ -4516,11 +4623,11 @@ var ImageEditor = ({
4516
4623
  setIsInpainting(false);
4517
4624
  }
4518
4625
  };
4519
- const [activeColor, setActiveColor] = useState19("#ef4444");
4520
- const [strokeWidth, setStrokeWidth] = useState19(3);
4521
- const [fontSize, setFontSize] = useState19(24);
4522
- const [textInput, setTextInput] = useState19("");
4523
- useEffect16(() => {
4626
+ const [activeColor, setActiveColor] = useState20("#ef4444");
4627
+ const [strokeWidth, setStrokeWidth] = useState20(3);
4628
+ const [fontSize, setFontSize] = useState20(24);
4629
+ const [textInput, setTextInput] = useState20("");
4630
+ useEffect17(() => {
4524
4631
  if (activeTab === "crop" && editor.state.activeTool !== "crop") {
4525
4632
  editor.setTool("crop");
4526
4633
  }
@@ -4548,16 +4655,16 @@ var ImageEditor = ({
4548
4655
  link.click();
4549
4656
  }
4550
4657
  };
4551
- return /* @__PURE__ */ jsxs21(
4658
+ return /* @__PURE__ */ jsxs22(
4552
4659
  "div",
4553
4660
  {
4554
4661
  ref: rootRef,
4555
4662
  className: `${imageEditorFrameClass} ${className}`,
4556
4663
  style,
4557
4664
  children: [
4558
- /* @__PURE__ */ jsxs21("div", { className: imageEditorHeaderClass, children: [
4559
- /* @__PURE__ */ jsxs21("div", { role: "tablist", className: imageTabListClass, children: [
4560
- /* @__PURE__ */ jsx23(
4665
+ /* @__PURE__ */ jsxs22("div", { className: imageEditorHeaderClass, children: [
4666
+ /* @__PURE__ */ jsxs22("div", { role: "tablist", className: imageTabListClass, children: [
4667
+ /* @__PURE__ */ jsx24(
4561
4668
  "button",
4562
4669
  {
4563
4670
  type: "button",
@@ -4572,7 +4679,7 @@ var ImageEditor = ({
4572
4679
  children: "Transform & Crop"
4573
4680
  }
4574
4681
  ),
4575
- /* @__PURE__ */ jsx23(
4682
+ /* @__PURE__ */ jsx24(
4576
4683
  "button",
4577
4684
  {
4578
4685
  type: "button",
@@ -4587,7 +4694,7 @@ var ImageEditor = ({
4587
4694
  children: "Adjustments"
4588
4695
  }
4589
4696
  ),
4590
- /* @__PURE__ */ jsx23(
4697
+ /* @__PURE__ */ jsx24(
4591
4698
  "button",
4592
4699
  {
4593
4700
  type: "button",
@@ -4602,7 +4709,7 @@ var ImageEditor = ({
4602
4709
  children: "Layers"
4603
4710
  }
4604
4711
  ),
4605
- /* @__PURE__ */ jsx23(
4712
+ /* @__PURE__ */ jsx24(
4606
4713
  "button",
4607
4714
  {
4608
4715
  type: "button",
@@ -4617,7 +4724,7 @@ var ImageEditor = ({
4617
4724
  children: "Paint"
4618
4725
  }
4619
4726
  ),
4620
- /* @__PURE__ */ jsx23(
4727
+ /* @__PURE__ */ jsx24(
4621
4728
  "button",
4622
4729
  {
4623
4730
  type: "button",
@@ -4632,7 +4739,7 @@ var ImageEditor = ({
4632
4739
  children: "Select & Mask"
4633
4740
  }
4634
4741
  ),
4635
- /* @__PURE__ */ jsx23(
4742
+ /* @__PURE__ */ jsx24(
4636
4743
  "button",
4637
4744
  {
4638
4745
  type: "button",
@@ -4647,7 +4754,7 @@ var ImageEditor = ({
4647
4754
  children: "Annotations"
4648
4755
  }
4649
4756
  ),
4650
- /* @__PURE__ */ jsx23(
4757
+ /* @__PURE__ */ jsx24(
4651
4758
  "button",
4652
4759
  {
4653
4760
  type: "button",
@@ -4662,7 +4769,7 @@ var ImageEditor = ({
4662
4769
  children: "Depth Mask"
4663
4770
  }
4664
4771
  ),
4665
- /* @__PURE__ */ jsxs21(
4772
+ /* @__PURE__ */ jsxs22(
4666
4773
  "button",
4667
4774
  {
4668
4775
  type: "button",
@@ -4675,14 +4782,14 @@ var ImageEditor = ({
4675
4782
  "aria-selected": activeTab === "ai",
4676
4783
  className: `${imageTabClass(activeTab === "ai")} flex items-center gap-1.5`,
4677
4784
  children: [
4678
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("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" }) }),
4785
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
4679
4786
  "AI Tools"
4680
4787
  ]
4681
4788
  }
4682
4789
  )
4683
4790
  ] }),
4684
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 text-xs", children: [
4685
- /* @__PURE__ */ jsx23(
4791
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 text-xs", children: [
4792
+ /* @__PURE__ */ jsx24(
4686
4793
  "button",
4687
4794
  {
4688
4795
  type: "button",
@@ -4693,7 +4800,7 @@ var ImageEditor = ({
4693
4800
  children: "\u21A9"
4694
4801
  }
4695
4802
  ),
4696
- /* @__PURE__ */ jsx23(
4803
+ /* @__PURE__ */ jsx24(
4697
4804
  "button",
4698
4805
  {
4699
4806
  type: "button",
@@ -4704,7 +4811,7 @@ var ImageEditor = ({
4704
4811
  children: "\u21AA"
4705
4812
  }
4706
4813
  ),
4707
- /* @__PURE__ */ jsx23(
4814
+ /* @__PURE__ */ jsx24(
4708
4815
  "button",
4709
4816
  {
4710
4817
  type: "button",
@@ -4713,8 +4820,8 @@ var ImageEditor = ({
4713
4820
  children: "Reset"
4714
4821
  }
4715
4822
  ),
4716
- /* @__PURE__ */ jsx23("div", { className: "h-4 w-px bg-muted mx-1" }),
4717
- /* @__PURE__ */ jsx23(
4823
+ /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-muted mx-1" }),
4824
+ /* @__PURE__ */ jsx24(
4718
4825
  "button",
4719
4826
  {
4720
4827
  type: "button",
@@ -4724,11 +4831,11 @@ var ImageEditor = ({
4724
4831
  children: "-"
4725
4832
  }
4726
4833
  ),
4727
- /* @__PURE__ */ jsxs21("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
4834
+ /* @__PURE__ */ jsxs22("span", { className: "font-mono text-muted-foreground w-10 text-center", children: [
4728
4835
  Math.round(state.zoom * 100),
4729
4836
  "%"
4730
4837
  ] }),
4731
- /* @__PURE__ */ jsx23(
4838
+ /* @__PURE__ */ jsx24(
4732
4839
  "button",
4733
4840
  {
4734
4841
  type: "button",
@@ -4738,8 +4845,8 @@ var ImageEditor = ({
4738
4845
  children: "+"
4739
4846
  }
4740
4847
  ),
4741
- /* @__PURE__ */ jsx23("div", { className: "h-4 w-px bg-muted mx-1" }),
4742
- /* @__PURE__ */ jsx23(
4848
+ /* @__PURE__ */ jsx24("div", { className: "h-4 w-px bg-muted mx-1" }),
4849
+ /* @__PURE__ */ jsx24(
4743
4850
  "button",
4744
4851
  {
4745
4852
  type: "button",
@@ -4750,7 +4857,7 @@ var ImageEditor = ({
4750
4857
  children: "Hold Compare"
4751
4858
  }
4752
4859
  ),
4753
- /* @__PURE__ */ jsx23(
4860
+ /* @__PURE__ */ jsx24(
4754
4861
  "button",
4755
4862
  {
4756
4863
  type: "button",
@@ -4761,10 +4868,10 @@ var ImageEditor = ({
4761
4868
  )
4762
4869
  ] })
4763
4870
  ] }),
4764
- transformTool.active && /* @__PURE__ */ jsx23(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
4765
- !transformTool.active && transformTool.error && /* @__PURE__ */ jsx23("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
4766
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
4767
- /* @__PURE__ */ jsx23(
4871
+ transformTool.active && /* @__PURE__ */ jsx24(FreeTransformOptionsBar, { tool: transformTool, className: "border-b border-border bg-background/95 px-4 py-2" }),
4872
+ !transformTool.active && transformTool.error && /* @__PURE__ */ jsx24("div", { role: "alert", className: imageErrorBannerClass, children: transformTool.error }),
4873
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col md:flex-row flex-1 min-h-[520px] md:h-[560px]", children: [
4874
+ /* @__PURE__ */ jsx24(
4768
4875
  ImageEditorCanvas,
4769
4876
  {
4770
4877
  editor,
@@ -4788,11 +4895,11 @@ var ImageEditor = ({
4788
4895
  className: "flex-1 h-[360px] md:h-full min-h-[320px] bg-muted"
4789
4896
  }
4790
4897
  ),
4791
- /* @__PURE__ */ jsxs21("div", { className: imageSidebarClass, children: [
4792
- activeTab === "crop" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 text-xs", children: [
4793
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
4794
- /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-3 gap-2", children: [
4795
- /* @__PURE__ */ jsx23(
4898
+ /* @__PURE__ */ jsxs22("div", { className: imageSidebarClass, children: [
4899
+ activeTab === "crop" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
4900
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Aspect Ratio Presets" }),
4901
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-3 gap-2", children: [
4902
+ /* @__PURE__ */ jsx24(
4796
4903
  "button",
4797
4904
  {
4798
4905
  type: "button",
@@ -4804,7 +4911,7 @@ var ImageEditor = ({
4804
4911
  children: "Freeform"
4805
4912
  }
4806
4913
  ),
4807
- /* @__PURE__ */ jsx23(
4914
+ /* @__PURE__ */ jsx24(
4808
4915
  "button",
4809
4916
  {
4810
4917
  type: "button",
@@ -4816,7 +4923,7 @@ var ImageEditor = ({
4816
4923
  children: "1:1 Square"
4817
4924
  }
4818
4925
  ),
4819
- /* @__PURE__ */ jsx23(
4926
+ /* @__PURE__ */ jsx24(
4820
4927
  "button",
4821
4928
  {
4822
4929
  type: "button",
@@ -4828,7 +4935,7 @@ var ImageEditor = ({
4828
4935
  children: "4:3 Standard"
4829
4936
  }
4830
4937
  ),
4831
- /* @__PURE__ */ jsx23(
4938
+ /* @__PURE__ */ jsx24(
4832
4939
  "button",
4833
4940
  {
4834
4941
  type: "button",
@@ -4840,7 +4947,7 @@ var ImageEditor = ({
4840
4947
  children: "16:9 Wide"
4841
4948
  }
4842
4949
  ),
4843
- /* @__PURE__ */ jsx23(
4950
+ /* @__PURE__ */ jsx24(
4844
4951
  "button",
4845
4952
  {
4846
4953
  type: "button",
@@ -4852,7 +4959,7 @@ var ImageEditor = ({
4852
4959
  children: "3:2 Photo"
4853
4960
  }
4854
4961
  ),
4855
- /* @__PURE__ */ jsx23(
4962
+ /* @__PURE__ */ jsx24(
4856
4963
  "button",
4857
4964
  {
4858
4965
  type: "button",
@@ -4865,10 +4972,10 @@ var ImageEditor = ({
4865
4972
  }
4866
4973
  )
4867
4974
  ] }),
4868
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
4869
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
4870
- /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-2 gap-2", children: [
4871
- /* @__PURE__ */ jsx23(
4975
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
4976
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Orientation & Flips" }),
4977
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-2", children: [
4978
+ /* @__PURE__ */ jsx24(
4872
4979
  "button",
4873
4980
  {
4874
4981
  type: "button",
@@ -4877,7 +4984,7 @@ var ImageEditor = ({
4877
4984
  children: "Rotate -90\xB0"
4878
4985
  }
4879
4986
  ),
4880
- /* @__PURE__ */ jsx23(
4987
+ /* @__PURE__ */ jsx24(
4881
4988
  "button",
4882
4989
  {
4883
4990
  type: "button",
@@ -4886,7 +4993,7 @@ var ImageEditor = ({
4886
4993
  children: "Rotate +90\xB0"
4887
4994
  }
4888
4995
  ),
4889
- /* @__PURE__ */ jsx23(
4996
+ /* @__PURE__ */ jsx24(
4890
4997
  "button",
4891
4998
  {
4892
4999
  type: "button",
@@ -4895,7 +5002,7 @@ var ImageEditor = ({
4895
5002
  children: "Flip Horizontal"
4896
5003
  }
4897
5004
  ),
4898
- /* @__PURE__ */ jsx23(
5005
+ /* @__PURE__ */ jsx24(
4899
5006
  "button",
4900
5007
  {
4901
5008
  type: "button",
@@ -4906,10 +5013,10 @@ var ImageEditor = ({
4906
5013
  )
4907
5014
  ] })
4908
5015
  ] }),
4909
- activeTab === "adjust" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4910
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
4911
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
4912
- /* @__PURE__ */ jsx23(
5016
+ activeTab === "adjust" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5017
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5018
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Color Adjustments" }),
5019
+ /* @__PURE__ */ jsx24(
4913
5020
  "button",
4914
5021
  {
4915
5022
  type: "button",
@@ -4919,9 +5026,9 @@ var ImageEditor = ({
4919
5026
  }
4920
5027
  )
4921
5028
  ] }),
4922
- /* @__PURE__ */ jsx23(Histogram, { histogram: editor.histogram }),
4923
- IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs21(React18.Fragment, { children: [
4924
- /* @__PURE__ */ jsx23(
5029
+ /* @__PURE__ */ jsx24(Histogram, { histogram: editor.histogram }),
5030
+ IMAGE_ADJUSTMENT_CONTROLS.map((spec) => /* @__PURE__ */ jsxs22(React19.Fragment, { children: [
5031
+ /* @__PURE__ */ jsx24(
4925
5032
  ControlSlider,
4926
5033
  {
4927
5034
  spec,
@@ -4930,14 +5037,14 @@ var ImageEditor = ({
4930
5037
  onChange: (v) => editor.setAdjustments({ [spec.id]: v })
4931
5038
  }
4932
5039
  ),
4933
- spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs21(
5040
+ spec.id === "tint" && legacyProcess && /* @__PURE__ */ jsxs22(
4934
5041
  "div",
4935
5042
  {
4936
5043
  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",
4937
5044
  "data-testid": "image-editor-process-notice",
4938
5045
  children: [
4939
- /* @__PURE__ */ jsx23("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
4940
- /* @__PURE__ */ jsx23(
5046
+ /* @__PURE__ */ jsx24("span", { children: "Legacy rendering (process 1). Tint needs the current process." }),
5047
+ /* @__PURE__ */ jsx24(
4941
5048
  "button",
4942
5049
  {
4943
5050
  type: "button",
@@ -4950,7 +5057,7 @@ var ImageEditor = ({
4950
5057
  }
4951
5058
  )
4952
5059
  ] }, spec.id)),
4953
- /* @__PURE__ */ jsx23("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx23(
5060
+ /* @__PURE__ */ jsx24("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx24(
4954
5061
  AdjustmentLayersPanel,
4955
5062
  {
4956
5063
  controller,
@@ -4959,9 +5066,9 @@ var ImageEditor = ({
4959
5066
  }
4960
5067
  ) })
4961
5068
  ] }),
4962
- activeTab === "layers" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4963
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Layers" }),
4964
- /* @__PURE__ */ jsx23(
5069
+ activeTab === "layers" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5070
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Layers" }),
5071
+ /* @__PURE__ */ jsx24(
4965
5072
  "button",
4966
5073
  {
4967
5074
  type: "button",
@@ -4972,15 +5079,15 @@ var ImageEditor = ({
4972
5079
  children: "Free Transform"
4973
5080
  }
4974
5081
  ),
4975
- /* @__PURE__ */ jsx23(LayersPanel, { controller }),
4976
- effectsShown && /* @__PURE__ */ jsx23(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
4977
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Colour" }),
4978
- /* @__PURE__ */ jsx23(ColorProfilePanel, { controller })
5082
+ /* @__PURE__ */ jsx24(LayersPanel, { controller }),
5083
+ effectsShown && /* @__PURE__ */ jsx24(ImageProviderEffectsPanel, { controller, className: imageSectionClass }),
5084
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Colour" }),
5085
+ /* @__PURE__ */ jsx24(ColorProfilePanel, { controller })
4979
5086
  ] }),
4980
- activeTab === "paint" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4981
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Paint" }),
4982
- /* @__PURE__ */ jsx23(BrushOptionsBar, { controller }),
4983
- /* @__PURE__ */ jsx23(
5087
+ activeTab === "paint" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5088
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Paint" }),
5089
+ /* @__PURE__ */ jsx24(BrushOptionsBar, { controller }),
5090
+ /* @__PURE__ */ jsx24(
4984
5091
  "button",
4985
5092
  {
4986
5093
  type: "button",
@@ -4991,12 +5098,12 @@ var ImageEditor = ({
4991
5098
  children: "Free Transform"
4992
5099
  }
4993
5100
  ),
4994
- paintError && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
4995
- /* @__PURE__ */ jsx23("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx23(LayersPanel, { controller }) })
5101
+ paintError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", "data-testid": "paint-error", children: paintError }),
5102
+ /* @__PURE__ */ jsx24("div", { className: imageSectionClass, children: /* @__PURE__ */ jsx24(LayersPanel, { controller }) })
4996
5103
  ] }),
4997
- activeTab === "annotate" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
4998
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
4999
- /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx23(
5104
+ activeTab === "annotate" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5105
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Shape & Type Layers" }),
5106
+ /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-2 gap-1.5", children: ["shape", "type"].map((t) => /* @__PURE__ */ jsx24(
5000
5107
  "button",
5001
5108
  {
5002
5109
  type: "button",
@@ -5007,13 +5114,13 @@ var ImageEditor = ({
5007
5114
  },
5008
5115
  t
5009
5116
  )) }),
5010
- state.activeTool === "shape" && /* @__PURE__ */ jsx23(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
5011
- state.activeTool === "type" && /* @__PURE__ */ jsx23(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
5012
- state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx23("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" }),
5013
- shapeTypeError && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
5014
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
5015
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
5016
- /* @__PURE__ */ jsx23("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx23(
5117
+ state.activeTool === "shape" && /* @__PURE__ */ jsx24(ShapeOptionsBar, { controller, options: shapeOptions, onChange: setShapeOptions }),
5118
+ state.activeTool === "type" && /* @__PURE__ */ jsx24(TypeOptionsBar, { controller, options: typeOptions, onChange: setTypeOptions, session: typeSession }),
5119
+ state.activeTool === "type" && typeSession && /* @__PURE__ */ jsx24("button", { type: "button", onClick: finishTyping, className: "self-start rounded bg-muted px-2 py-1 text-[11px] text-foreground hover:bg-accent", children: "Done editing text" }),
5120
+ shapeTypeError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", "data-testid": "shape-type-error", children: shapeTypeError }),
5121
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5122
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Draw & Annotate" }),
5123
+ /* @__PURE__ */ jsx24("div", { className: "grid grid-cols-3 gap-1.5", children: ["pen", "rect", "circle", "arrow", "line"].map((t) => /* @__PURE__ */ jsx24(
5017
5124
  "button",
5018
5125
  {
5019
5126
  type: "button",
@@ -5023,18 +5130,18 @@ var ImageEditor = ({
5023
5130
  },
5024
5131
  t
5025
5132
  )) }),
5026
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2 mt-2", children: [
5027
- /* @__PURE__ */ jsx23("label", { className: "text-muted-foreground", children: "Color:" }),
5028
- /* @__PURE__ */ jsx23(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
5029
- /* @__PURE__ */ jsxs21("div", { className: "flex-1 ml-2", children: [
5030
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
5031
- /* @__PURE__ */ jsx23("span", { children: "Width:" }),
5032
- /* @__PURE__ */ jsxs21("span", { className: "font-mono", children: [
5133
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2 mt-2", children: [
5134
+ /* @__PURE__ */ jsx24("label", { className: "text-muted-foreground", children: "Color:" }),
5135
+ /* @__PURE__ */ jsx24(ImageColor, { label: "Annotation colour", value: activeColor, onChange: setActiveColor }),
5136
+ /* @__PURE__ */ jsxs22("div", { className: "flex-1 ml-2", children: [
5137
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-0.5", children: [
5138
+ /* @__PURE__ */ jsx24("span", { children: "Width:" }),
5139
+ /* @__PURE__ */ jsxs22("span", { className: "font-mono", children: [
5033
5140
  strokeWidth,
5034
5141
  "px"
5035
5142
  ] })
5036
5143
  ] }),
5037
- /* @__PURE__ */ jsx23(
5144
+ /* @__PURE__ */ jsx24(
5038
5145
  "input",
5039
5146
  {
5040
5147
  type: "range",
@@ -5047,10 +5154,10 @@ var ImageEditor = ({
5047
5154
  )
5048
5155
  ] })
5049
5156
  ] }),
5050
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
5051
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Add Text" }),
5052
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
5053
- /* @__PURE__ */ jsx23(
5157
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5158
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Add Text" }),
5159
+ /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
5160
+ /* @__PURE__ */ jsx24(
5054
5161
  "input",
5055
5162
  {
5056
5163
  type: "text",
@@ -5061,7 +5168,7 @@ var ImageEditor = ({
5061
5168
  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"
5062
5169
  }
5063
5170
  ),
5064
- /* @__PURE__ */ jsx23(
5171
+ /* @__PURE__ */ jsx24(
5065
5172
  "button",
5066
5173
  {
5067
5174
  type: "button",
@@ -5071,14 +5178,14 @@ var ImageEditor = ({
5071
5178
  }
5072
5179
  )
5073
5180
  ] }),
5074
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between text-muted-foreground", children: [
5075
- /* @__PURE__ */ jsx23("span", { children: "Font Size:" }),
5076
- /* @__PURE__ */ jsxs21("span", { className: "font-mono", children: [
5181
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between text-muted-foreground", children: [
5182
+ /* @__PURE__ */ jsx24("span", { children: "Font Size:" }),
5183
+ /* @__PURE__ */ jsxs22("span", { className: "font-mono", children: [
5077
5184
  fontSize,
5078
5185
  "px"
5079
5186
  ] })
5080
5187
  ] }),
5081
- /* @__PURE__ */ jsx23(
5188
+ /* @__PURE__ */ jsx24(
5082
5189
  "input",
5083
5190
  {
5084
5191
  type: "range",
@@ -5089,14 +5196,14 @@ var ImageEditor = ({
5089
5196
  className: imageRangeClass
5090
5197
  }
5091
5198
  ),
5092
- /* @__PURE__ */ jsx23("div", { className: imageDividerClass }),
5093
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5094
- /* @__PURE__ */ jsxs21("span", { className: "text-muted-foreground", children: [
5199
+ /* @__PURE__ */ jsx24("div", { className: imageDividerClass }),
5200
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5201
+ /* @__PURE__ */ jsxs22("span", { className: "text-muted-foreground", children: [
5095
5202
  "Layers (",
5096
5203
  state.annotations.length,
5097
5204
  ")"
5098
5205
  ] }),
5099
- state.selectedAnnotationId && /* @__PURE__ */ jsx23(
5206
+ state.selectedAnnotationId && /* @__PURE__ */ jsx24(
5100
5207
  "button",
5101
5208
  {
5102
5209
  type: "button",
@@ -5105,7 +5212,7 @@ var ImageEditor = ({
5105
5212
  children: "Delete Selected"
5106
5213
  }
5107
5214
  ),
5108
- state.annotations.length > 0 && /* @__PURE__ */ jsx23(
5215
+ state.annotations.length > 0 && /* @__PURE__ */ jsx24(
5109
5216
  "button",
5110
5217
  {
5111
5218
  type: "button",
@@ -5116,10 +5223,10 @@ var ImageEditor = ({
5116
5223
  )
5117
5224
  ] })
5118
5225
  ] }),
5119
- activeTab === "depth" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-3 text-xs", children: [
5120
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5121
- /* @__PURE__ */ jsx23("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
5122
- /* @__PURE__ */ jsx23(
5226
+ activeTab === "depth" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-3 text-xs", children: [
5227
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5228
+ /* @__PURE__ */ jsx24("span", { className: imageSectionTitleClass, children: "Depth Masking" }),
5229
+ /* @__PURE__ */ jsx24(
5123
5230
  "button",
5124
5231
  {
5125
5232
  type: "button",
@@ -5129,8 +5236,8 @@ var ImageEditor = ({
5129
5236
  }
5130
5237
  )
5131
5238
  ] }),
5132
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
5133
- /* @__PURE__ */ jsx23(
5239
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 cursor-pointer text-foreground", children: [
5240
+ /* @__PURE__ */ jsx24(
5134
5241
  "input",
5135
5242
  {
5136
5243
  type: "checkbox",
@@ -5139,12 +5246,12 @@ var ImageEditor = ({
5139
5246
  className: "rounded accent-primary"
5140
5247
  }
5141
5248
  ),
5142
- /* @__PURE__ */ jsx23("span", { children: "Enable Depth / Alpha Mask" })
5249
+ /* @__PURE__ */ jsx24("span", { children: "Enable Depth / Alpha Mask" })
5143
5250
  ] }),
5144
- state.depthMask.enabled && /* @__PURE__ */ jsxs21(Fragment6, { children: [
5145
- /* @__PURE__ */ jsxs21("div", { children: [
5146
- /* @__PURE__ */ jsx23("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
5147
- /* @__PURE__ */ jsx23(
5251
+ state.depthMask.enabled && /* @__PURE__ */ jsxs22(Fragment6, { children: [
5252
+ /* @__PURE__ */ jsxs22("div", { children: [
5253
+ /* @__PURE__ */ jsx24("label", { className: "text-muted-foreground block mb-1", children: "Mask Image URL:" }),
5254
+ /* @__PURE__ */ jsx24(
5148
5255
  "input",
5149
5256
  {
5150
5257
  type: "text",
@@ -5155,8 +5262,8 @@ var ImageEditor = ({
5155
5262
  }
5156
5263
  )
5157
5264
  ] }),
5158
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
5159
- /* @__PURE__ */ jsx23(
5265
+ /* @__PURE__ */ jsxs22("div", { className: "flex gap-2", children: [
5266
+ /* @__PURE__ */ jsx24(
5160
5267
  "button",
5161
5268
  {
5162
5269
  type: "button",
@@ -5165,7 +5272,7 @@ var ImageEditor = ({
5165
5272
  children: "Threshold Mode"
5166
5273
  }
5167
5274
  ),
5168
- /* @__PURE__ */ jsx23(
5275
+ /* @__PURE__ */ jsx24(
5169
5276
  "button",
5170
5277
  {
5171
5278
  type: "button",
@@ -5175,12 +5282,12 @@ var ImageEditor = ({
5175
5282
  }
5176
5283
  )
5177
5284
  ] }),
5178
- /* @__PURE__ */ jsxs21("div", { children: [
5179
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5180
- /* @__PURE__ */ jsx23("span", { children: "Depth Start (Lower):" }),
5181
- /* @__PURE__ */ jsx23("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
5285
+ /* @__PURE__ */ jsxs22("div", { children: [
5286
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5287
+ /* @__PURE__ */ jsx24("span", { children: "Depth Start (Lower):" }),
5288
+ /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.depthRange[0] })
5182
5289
  ] }),
5183
- /* @__PURE__ */ jsx23(
5290
+ /* @__PURE__ */ jsx24(
5184
5291
  "input",
5185
5292
  {
5186
5293
  type: "range",
@@ -5194,12 +5301,12 @@ var ImageEditor = ({
5194
5301
  }
5195
5302
  )
5196
5303
  ] }),
5197
- /* @__PURE__ */ jsxs21("div", { children: [
5198
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5199
- /* @__PURE__ */ jsx23("span", { children: "Depth Stop (Upper):" }),
5200
- /* @__PURE__ */ jsx23("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
5304
+ /* @__PURE__ */ jsxs22("div", { children: [
5305
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5306
+ /* @__PURE__ */ jsx24("span", { children: "Depth Stop (Upper):" }),
5307
+ /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.depthRange[1] })
5201
5308
  ] }),
5202
- /* @__PURE__ */ jsx23(
5309
+ /* @__PURE__ */ jsx24(
5203
5310
  "input",
5204
5311
  {
5205
5312
  type: "range",
@@ -5213,12 +5320,12 @@ var ImageEditor = ({
5213
5320
  }
5214
5321
  )
5215
5322
  ] }),
5216
- /* @__PURE__ */ jsxs21("div", { children: [
5217
- /* @__PURE__ */ jsxs21("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5218
- /* @__PURE__ */ jsx23("span", { children: "Softness:" }),
5219
- /* @__PURE__ */ jsx23("span", { className: "font-mono", children: state.depthMask.softness })
5323
+ /* @__PURE__ */ jsxs22("div", { children: [
5324
+ /* @__PURE__ */ jsxs22("div", { className: "flex justify-between text-muted-foreground mb-1", children: [
5325
+ /* @__PURE__ */ jsx24("span", { children: "Softness:" }),
5326
+ /* @__PURE__ */ jsx24("span", { className: "font-mono", children: state.depthMask.softness })
5220
5327
  ] }),
5221
- /* @__PURE__ */ jsx23(
5328
+ /* @__PURE__ */ jsx24(
5222
5329
  "input",
5223
5330
  {
5224
5331
  type: "range",
@@ -5230,8 +5337,8 @@ var ImageEditor = ({
5230
5337
  }
5231
5338
  )
5232
5339
  ] }),
5233
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
5234
- /* @__PURE__ */ jsx23(
5340
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center gap-2 cursor-pointer text-foreground mt-1", children: [
5341
+ /* @__PURE__ */ jsx24(
5235
5342
  "input",
5236
5343
  {
5237
5344
  type: "checkbox",
@@ -5240,12 +5347,12 @@ var ImageEditor = ({
5240
5347
  className: "rounded accent-primary"
5241
5348
  }
5242
5349
  ),
5243
- /* @__PURE__ */ jsx23("span", { children: "Invert Mask" })
5350
+ /* @__PURE__ */ jsx24("span", { children: "Invert Mask" })
5244
5351
  ] })
5245
5352
  ] })
5246
5353
  ] }),
5247
- activeTab === "select" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 text-xs", children: [
5248
- /* @__PURE__ */ jsx23(
5354
+ activeTab === "select" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
5355
+ /* @__PURE__ */ jsx24(
5249
5356
  SelectionOptionsBar,
5250
5357
  {
5251
5358
  controller,
@@ -5256,9 +5363,9 @@ var ImageEditor = ({
5256
5363
  selectionDisplay: state.selectionDisplay
5257
5364
  }
5258
5365
  ),
5259
- selectionError && /* @__PURE__ */ jsx23("p", { role: "alert", className: "text-destructive", children: selectionError }),
5260
- /* @__PURE__ */ jsxs21("div", { className: "flex gap-1", children: [
5261
- /* @__PURE__ */ jsx23(
5366
+ selectionError && /* @__PURE__ */ jsx24("p", { role: "alert", className: "text-destructive", children: selectionError }),
5367
+ /* @__PURE__ */ jsxs22("div", { className: "flex gap-1", children: [
5368
+ /* @__PURE__ */ jsx24(
5262
5369
  "button",
5263
5370
  {
5264
5371
  type: "button",
@@ -5269,7 +5376,7 @@ var ImageEditor = ({
5269
5376
  children: "Transform Selection"
5270
5377
  }
5271
5378
  ),
5272
- /* @__PURE__ */ jsx23(
5379
+ /* @__PURE__ */ jsx24(
5273
5380
  "button",
5274
5381
  {
5275
5382
  type: "button",
@@ -5281,13 +5388,14 @@ var ImageEditor = ({
5281
5388
  }
5282
5389
  )
5283
5390
  ] }),
5284
- /* @__PURE__ */ jsx23(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
5285
- /* @__PURE__ */ jsx23(ChannelsPanel, { controller })
5391
+ /* @__PURE__ */ jsx24(RefineEdgePanel, { controller, selection: state.selection ?? null, layers: state.adjustments.layers }),
5392
+ /* @__PURE__ */ jsx24(ChannelsPanel, { controller }),
5393
+ /* @__PURE__ */ jsx24(PathsPanel, { controller })
5286
5394
  ] }),
5287
- activeTab === "ai" && /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-4 text-xs", children: [
5288
- /* @__PURE__ */ jsxs21("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
5289
- /* @__PURE__ */ jsx23("span", { children: "Results go to" }),
5290
- /* @__PURE__ */ jsxs21(
5395
+ activeTab === "ai" && /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-4 text-xs", children: [
5396
+ /* @__PURE__ */ jsxs22("label", { className: "flex items-center justify-between gap-2 text-foreground", children: [
5397
+ /* @__PURE__ */ jsx24("span", { children: "Results go to" }),
5398
+ /* @__PURE__ */ jsxs22(
5291
5399
  "select",
5292
5400
  {
5293
5401
  "aria-label": "AI result target",
@@ -5295,54 +5403,54 @@ var ImageEditor = ({
5295
5403
  onChange: (e) => setAiTarget(e.target.value),
5296
5404
  className: imageSelectClass,
5297
5405
  children: [
5298
- /* @__PURE__ */ jsx23("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
5299
- /* @__PURE__ */ jsx23("option", { value: "new-layer", children: "New layer / mask" }),
5300
- /* @__PURE__ */ jsx23("option", { value: "replace", children: "Replace image" })
5406
+ /* @__PURE__ */ jsx24("option", { value: "auto", children: controller.isMultiLayer ? "Auto (new layer)" : "Auto (replace image)" }),
5407
+ /* @__PURE__ */ jsx24("option", { value: "new-layer", children: "New layer / mask" }),
5408
+ /* @__PURE__ */ jsx24("option", { value: "replace", children: "Replace image" })
5301
5409
  ]
5302
5410
  }
5303
5411
  )
5304
5412
  ] }),
5305
- /* @__PURE__ */ jsxs21("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5306
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5307
- /* @__PURE__ */ jsxs21("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5308
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("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" }) }),
5413
+ /* @__PURE__ */ jsxs22("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5414
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5415
+ /* @__PURE__ */ jsxs22("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5416
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6z" }) }),
5309
5417
  "Background Removal"
5310
5418
  ] }),
5311
- isRemovingBg && /* @__PURE__ */ jsx23("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..." })
5419
+ isRemovingBg && /* @__PURE__ */ jsx24("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Removing..." })
5312
5420
  ] }),
5313
- /* @__PURE__ */ jsx23("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
5314
- /* @__PURE__ */ jsx23(
5421
+ /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Isolate foreground subject with AI alpha transparency segmentation." }),
5422
+ /* @__PURE__ */ jsx24(
5315
5423
  "button",
5316
5424
  {
5317
5425
  type: "button",
5318
5426
  onClick: handleRemoveBackground,
5319
5427
  disabled: isRemovingBg || isInpainting,
5320
5428
  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",
5321
- children: isRemovingBg ? /* @__PURE__ */ jsxs21(Fragment6, { children: [
5322
- /* @__PURE__ */ jsx23("div", { className: imageSpinnerClass }),
5429
+ children: isRemovingBg ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
5430
+ /* @__PURE__ */ jsx24("div", { className: imageSpinnerClass }),
5323
5431
  "Removing Background..."
5324
- ] }) : /* @__PURE__ */ jsxs21(Fragment6, { children: [
5325
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("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" }) }),
5432
+ ] }) : /* @__PURE__ */ jsxs22(Fragment6, { children: [
5433
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5326
5434
  "Remove Background"
5327
5435
  ] })
5328
5436
  }
5329
5437
  )
5330
5438
  ] }),
5331
- /* @__PURE__ */ jsxs21("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5332
- /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
5333
- /* @__PURE__ */ jsxs21("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5334
- /* @__PURE__ */ jsxs21("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
5335
- /* @__PURE__ */ jsx23("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" }),
5336
- /* @__PURE__ */ jsx23("path", { d: "m14 7 3 3" })
5439
+ /* @__PURE__ */ jsxs22("div", { className: "p-3 rounded-lg bg-muted/40 border border-border flex flex-col gap-2.5", children: [
5440
+ /* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between", children: [
5441
+ /* @__PURE__ */ jsxs22("span", { className: "font-semibold text-foreground uppercase tracking-wider text-[11px] flex items-center gap-1.5", children: [
5442
+ /* @__PURE__ */ jsxs22("svg", { className: "w-3.5 h-3.5 text-primary", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
5443
+ /* @__PURE__ */ jsx24("path", { d: "m21.64 3.64-1.28-1.28a1.2 1.2 0 0 0-1.7 0l-9.72 9.72-1.94 4.86 4.86-1.94 9.72-9.72a1.2 1.2 0 0 0 .06-1.64z" }),
5444
+ /* @__PURE__ */ jsx24("path", { d: "m14 7 3 3" })
5337
5445
  ] }),
5338
5446
  "Generative Inpainting"
5339
5447
  ] }),
5340
- isInpainting && /* @__PURE__ */ jsx23("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..." })
5448
+ isInpainting && /* @__PURE__ */ jsx24("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded text-[10px] font-medium bg-primary/15 text-primary animate-pulse", children: "Inpainting..." })
5341
5449
  ] }),
5342
- /* @__PURE__ */ jsx23("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
5343
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1", children: [
5344
- /* @__PURE__ */ jsx23("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
5345
- /* @__PURE__ */ jsx23(
5450
+ /* @__PURE__ */ jsx24("p", { className: "text-muted-foreground text-[11px] leading-relaxed", children: "Replace, modify, or fill selected regions using prompt-guided generative inpainting." }),
5451
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
5452
+ /* @__PURE__ */ jsx24("label", { htmlFor: "ai-inpaint-prompt-react", className: "text-foreground text-[11px] font-medium", children: "Prompt" }),
5453
+ /* @__PURE__ */ jsx24(
5346
5454
  "textarea",
5347
5455
  {
5348
5456
  id: "ai-inpaint-prompt-react",
@@ -5354,10 +5462,10 @@ var ImageEditor = ({
5354
5462
  }
5355
5463
  )
5356
5464
  ] }),
5357
- /* @__PURE__ */ jsxs21("div", { className: "flex flex-col gap-1", children: [
5358
- /* @__PURE__ */ jsx23("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
5359
- /* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-2 gap-1.5", children: [
5360
- /* @__PURE__ */ jsxs21(
5465
+ /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1", children: [
5466
+ /* @__PURE__ */ jsx24("span", { className: "text-foreground text-[11px] font-medium", children: "Target Mask Region" }),
5467
+ /* @__PURE__ */ jsxs22("div", { className: "grid grid-cols-2 gap-1.5", children: [
5468
+ /* @__PURE__ */ jsxs22(
5361
5469
  "button",
5362
5470
  {
5363
5471
  type: "button",
@@ -5370,7 +5478,7 @@ var ImageEditor = ({
5370
5478
  ]
5371
5479
  }
5372
5480
  ),
5373
- /* @__PURE__ */ jsxs21(
5481
+ /* @__PURE__ */ jsxs22(
5374
5482
  "button",
5375
5483
  {
5376
5484
  type: "button",
@@ -5385,25 +5493,25 @@ var ImageEditor = ({
5385
5493
  )
5386
5494
  ] })
5387
5495
  ] }),
5388
- /* @__PURE__ */ jsx23(
5496
+ /* @__PURE__ */ jsx24(
5389
5497
  "button",
5390
5498
  {
5391
5499
  type: "button",
5392
5500
  onClick: handleInpaint,
5393
5501
  disabled: isInpainting || isRemovingBg || !inpaintPrompt.trim(),
5394
5502
  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",
5395
- children: isInpainting ? /* @__PURE__ */ jsxs21(Fragment6, { children: [
5396
- /* @__PURE__ */ jsx23("div", { className: imageSpinnerClass }),
5503
+ children: isInpainting ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
5504
+ /* @__PURE__ */ jsx24("div", { className: imageSpinnerClass }),
5397
5505
  "Generating Inpaint..."
5398
- ] }) : /* @__PURE__ */ jsxs21(Fragment6, { children: [
5399
- /* @__PURE__ */ jsx23("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx23("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" }) }),
5506
+ ] }) : /* @__PURE__ */ jsxs22(Fragment6, { children: [
5507
+ /* @__PURE__ */ jsx24("svg", { className: "w-3.5 h-3.5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ jsx24("path", { d: "M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83" }) }),
5400
5508
  "Apply Inpainting"
5401
5509
  ] })
5402
5510
  }
5403
5511
  )
5404
5512
  ] }),
5405
- aiError && /* @__PURE__ */ jsx23("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
5406
- aiSuccess && /* @__PURE__ */ jsx23("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
5513
+ aiError && /* @__PURE__ */ jsx24("div", { className: "p-2.5 rounded-lg bg-destructive/10 border border-destructive/40 text-destructive text-[11px]", children: aiError }),
5514
+ aiSuccess && /* @__PURE__ */ jsx24("div", { className: "p-2.5 rounded-lg bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 text-[11px]", children: aiSuccess })
5407
5515
  ] })
5408
5516
  ] })
5409
5517
  ] })
@@ -5439,6 +5547,7 @@ export {
5439
5547
  SelectionOptionsBar,
5440
5548
  RefineEdgePanel,
5441
5549
  ChannelsPanel,
5550
+ PathsPanel,
5442
5551
  FreeTransformOptionsBar,
5443
5552
  ShapeOptionsBar,
5444
5553
  TypeOptionsBar,