@one-million-lines/email-builder 0.2.0 → 0.2.2

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.
@@ -2,7 +2,7 @@ import { createRoot as e } from "react-dom/client";
2
2
  import t, { createContext as n, createElement as r, memo as i, useCallback as a, useContext as o, useEffect as s, useLayoutEffect as c, useMemo as l, useReducer as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
3
3
  import { z as m } from "zod";
4
4
  import { create as h } from "zustand";
5
- import { AlertTriangle as g, AlignVerticalJustifyEnd as _, ArrowDown as v, ArrowUp as y, ChevronDown as b, ChevronUp as x, Copy as S, Download as C, Eye as w, FileCode as T, GripVertical as ee, Images as te, Layers as ne, LayoutTemplate as re, Loader2 as ie, Menu as ae, Monitor as oe, MousePointer2 as se, MousePointerClick as ce, Palette as le, Plus as ue, Receipt as de, Redo2 as fe, RotateCcw as pe, Save as me, Search as he, Send as ge, Share2 as E, ShoppingCart as _e, Smartphone as ve, Sparkles as ye, Square as D, Star as O, Trash2 as be, Type as xe, Undo2 as Se, Upload as Ce, X as we } from "lucide-react";
5
+ import { AlertTriangle as g, AlignVerticalJustifyEnd as _, ArrowDown as v, ArrowUp as y, Check as b, ChevronDown as x, ChevronUp as S, Copy as C, Download as w, Eye as T, FileCode as ee, GripVertical as te, Layers as ne, LayoutTemplate as re, Loader2 as ie, Menu as ae, Monitor as oe, MousePointer2 as se, MousePointerClick as ce, Palette as le, Plus as ue, Receipt as de, Redo2 as fe, RotateCcw as pe, Save as me, Search as he, Send as ge, Share2 as E, ShoppingCart as _e, Smartphone as ve, Sparkles as ye, Square as D, Star as O, Trash2 as be, Type as xe, Undo2 as Se, Upload as Ce, X as we } from "lucide-react";
6
6
  import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
7
7
  import { createPortal as Te, unstable_batchedUpdates as Ee } from "react-dom";
8
8
  //#region src/core/validation.ts
@@ -1934,18 +1934,21 @@ function mt() {
1934
1934
  a.href = i, a.download = e, a.click(), URL.revokeObjectURL(i);
1935
1935
  };
1936
1936
  return /* @__PURE__ */ j("div", {
1937
- className: "flex items-center gap-2 h-12 px-4 bg-white border-b border-gray-200 shrink-0",
1937
+ className: "flex items-center h-12 px-4 bg-white border-b border-gray-200 shrink-0",
1938
1938
  children: [
1939
- /* @__PURE__ */ A("input", {
1940
- className: "font-medium text-sm px-2 py-1 rounded hover:bg-gray-50 focus:bg-gray-50 outline-none w-64",
1941
- value: e.meta.name,
1942
- onChange: (e) => t({ name: e.target.value })
1939
+ /* @__PURE__ */ A("div", {
1940
+ className: "shrink-0 w-48",
1941
+ children: /* @__PURE__ */ A("input", {
1942
+ className: "font-medium text-sm px-2 py-1 rounded hover:bg-gray-50 focus:bg-gray-50 outline-none w-full",
1943
+ value: e.meta.name,
1944
+ onChange: (e) => t({ name: e.target.value })
1945
+ })
1943
1946
  }),
1944
1947
  /* @__PURE__ */ j("div", {
1945
- className: "ml-auto flex items-center gap-1",
1948
+ className: "flex-1 flex items-center justify-center gap-1",
1946
1949
  children: [
1947
1950
  /* @__PURE__ */ j("div", {
1948
- className: "inline-flex items-center bg-gray-100 rounded p-0.5 mr-2",
1951
+ className: "inline-flex items-center bg-gray-100 rounded p-0.5 mr-1",
1949
1952
  children: [/* @__PURE__ */ j("button", {
1950
1953
  title: "Desktop preview",
1951
1954
  onClick: () => p("desktop"),
@@ -1958,85 +1961,75 @@ function mt() {
1958
1961
  children: [/* @__PURE__ */ A(ve, { size: 14 }), " Mobile"]
1959
1962
  })]
1960
1963
  }),
1961
- /* @__PURE__ */ j(ht, {
1964
+ /* @__PURE__ */ j(_t, {
1962
1965
  title: "Browse templates",
1963
1966
  onClick: () => y(!0),
1964
1967
  children: [/* @__PURE__ */ A(re, { size: 16 }), " Templates"]
1965
1968
  }),
1966
- /* @__PURE__ */ j(ht, {
1969
+ /* @__PURE__ */ j(_t, {
1967
1970
  title: "Reset editor",
1968
1971
  onClick: b,
1969
1972
  disabled: e.modules.length === 0,
1970
1973
  children: [/* @__PURE__ */ A(pe, { size: 16 }), " Reset"]
1971
1974
  }),
1972
- /* @__PURE__ */ A(gt, {}),
1973
- /* @__PURE__ */ A(ht, {
1975
+ /* @__PURE__ */ A(vt, {}),
1976
+ /* @__PURE__ */ A(_t, {
1974
1977
  title: "Undo",
1975
1978
  onClick: n,
1976
1979
  disabled: i.length === 0,
1977
1980
  children: /* @__PURE__ */ A(Se, { size: 16 })
1978
1981
  }),
1979
- /* @__PURE__ */ A(ht, {
1982
+ /* @__PURE__ */ A(_t, {
1980
1983
  title: "Redo",
1981
1984
  onClick: r,
1982
1985
  disabled: a.length === 0,
1983
1986
  children: /* @__PURE__ */ A(fe, { size: 16 })
1984
1987
  }),
1985
- /* @__PURE__ */ A(gt, {}),
1986
- /* @__PURE__ */ A(ht, {
1988
+ /* @__PURE__ */ A(vt, {}),
1989
+ /* @__PURE__ */ A(_t, {
1987
1990
  title: "Save draft (local)",
1988
1991
  onClick: l,
1989
1992
  children: /* @__PURE__ */ A(me, { size: 16 })
1990
1993
  }),
1991
- /* @__PURE__ */ j(ht, {
1994
+ /* @__PURE__ */ j(_t, {
1992
1995
  title: "Preview",
1993
1996
  onClick: () => {
1994
1997
  let e = c(), t = window.open("", "_blank");
1995
1998
  t && (t.document.write(e), t.document.close()), _(!0), setTimeout(() => _(!1), 600);
1996
1999
  },
1997
2000
  children: [
1998
- /* @__PURE__ */ A(w, { size: 16 }),
2001
+ /* @__PURE__ */ A(T, { size: 16 }),
1999
2002
  " ",
2000
2003
  g ? "Opened" : "Preview"
2001
2004
  ]
2002
- }),
2003
- /* @__PURE__ */ A(gt, {}),
2004
- /* @__PURE__ */ j(ht, {
2005
- title: "Import JSON",
2006
- onClick: () => h.current?.click(),
2007
- children: [/* @__PURE__ */ A(Ce, { size: 16 }), " Import"]
2008
- }),
2009
- /* @__PURE__ */ A("input", {
2010
- ref: h,
2011
- type: "file",
2012
- accept: ".json",
2013
- hidden: !0,
2014
- onChange: (e) => {
2015
- let t = e.target.files?.[0];
2016
- t && (t.text().then((e) => {
2017
- let t = s(e);
2018
- t.ok || alert(`Import failed: ${t.error}`);
2019
- }), e.target.value = "");
2020
- }
2021
- }),
2022
- /* @__PURE__ */ j(ht, {
2023
- title: "Export JSON",
2024
- onClick: () => {
2025
- x(`${e.meta.name || "email"}.json`, o(), "application/json");
2026
- },
2027
- children: [/* @__PURE__ */ A(C, { size: 16 }), " JSON"]
2028
- }),
2029
- /* @__PURE__ */ j(ht, {
2030
- title: "Export HTML",
2031
- onClick: () => {
2032
- let t = c();
2033
- x(`${e.meta.name || "email"}.html`, t, "text/html");
2034
- },
2035
- primary: !0,
2036
- children: [/* @__PURE__ */ A(T, { size: 16 }), " Export HTML"]
2037
2005
  })
2038
2006
  ]
2039
2007
  }),
2008
+ /* @__PURE__ */ j("div", {
2009
+ className: "shrink-0 flex justify-end w-48",
2010
+ children: [/* @__PURE__ */ A("input", {
2011
+ ref: h,
2012
+ type: "file",
2013
+ accept: ".json",
2014
+ hidden: !0,
2015
+ onChange: (e) => {
2016
+ let t = e.target.files?.[0];
2017
+ t && (t.text().then((e) => {
2018
+ let t = s(e);
2019
+ t.ok || alert(`Import failed: ${t.error}`);
2020
+ }), e.target.value = "");
2021
+ }
2022
+ }), /* @__PURE__ */ A(ht, {
2023
+ onImport: () => h.current?.click(),
2024
+ onExportJson: () => {
2025
+ x(`${e.meta.name || "email"}.json`, o(), "application/json");
2026
+ },
2027
+ onExportHtml: () => {
2028
+ let t = c();
2029
+ x(`${e.meta.name || "email"}.html`, t, "text/html");
2030
+ }
2031
+ })]
2032
+ }),
2040
2033
  /* @__PURE__ */ A(ft, {
2041
2034
  open: v,
2042
2035
  onClose: () => y(!1)
@@ -2044,7 +2037,66 @@ function mt() {
2044
2037
  ]
2045
2038
  });
2046
2039
  }
2047
- function ht({ children: e, onClick: t, disabled: n, title: r, primary: i }) {
2040
+ function ht({ onImport: e, onExportJson: t, onExportHtml: n }) {
2041
+ let [r, i] = f(!1), a = d(null);
2042
+ return s(() => {
2043
+ if (!r) return;
2044
+ let e = (e) => {
2045
+ a.current && !a.current.contains(e.target) && i(!1);
2046
+ };
2047
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
2048
+ }, [r]), /* @__PURE__ */ j("div", {
2049
+ ref: a,
2050
+ className: "relative",
2051
+ children: [/* @__PURE__ */ j("button", {
2052
+ onClick: () => i((e) => !e),
2053
+ className: "flex items-center gap-1.5 px-2.5 py-1.5 rounded text-sm text-gray-700 hover:bg-gray-100 border border-gray-200 transition-colors",
2054
+ title: "Import / Export",
2055
+ children: [
2056
+ /* @__PURE__ */ A(ee, { size: 16 }),
2057
+ "Export",
2058
+ /* @__PURE__ */ A(x, {
2059
+ size: 14,
2060
+ className: `transition-transform ${r ? "rotate-180" : ""}`
2061
+ })
2062
+ ]
2063
+ }), r && /* @__PURE__ */ j("div", {
2064
+ className: "absolute right-0 top-full mt-1 w-48 bg-white border border-gray-200 rounded-lg shadow-lg z-50 py-1 text-sm",
2065
+ children: [
2066
+ /* @__PURE__ */ A(gt, {
2067
+ icon: /* @__PURE__ */ A(Ce, { size: 14 }),
2068
+ label: "Import JSON",
2069
+ onClick: () => {
2070
+ e(), i(!1);
2071
+ }
2072
+ }),
2073
+ /* @__PURE__ */ A("div", { className: "mx-2 my-1 border-t border-gray-100" }),
2074
+ /* @__PURE__ */ A(gt, {
2075
+ icon: /* @__PURE__ */ A(w, { size: 14 }),
2076
+ label: "Export JSON",
2077
+ onClick: () => {
2078
+ t(), i(!1);
2079
+ }
2080
+ }),
2081
+ /* @__PURE__ */ A(gt, {
2082
+ icon: /* @__PURE__ */ A(ee, { size: 14 }),
2083
+ label: "Export HTML",
2084
+ onClick: () => {
2085
+ n(), i(!1);
2086
+ }
2087
+ })
2088
+ ]
2089
+ })]
2090
+ });
2091
+ }
2092
+ function gt({ icon: e, label: t, onClick: n, highlight: r }) {
2093
+ return /* @__PURE__ */ j("button", {
2094
+ onClick: n,
2095
+ className: `w-full flex items-center gap-2 px-3 py-2 hover:bg-gray-50 transition-colors text-left ${r ? "text-blue-600 font-medium" : "text-gray-700"}`,
2096
+ children: [e, t]
2097
+ });
2098
+ }
2099
+ function _t({ children: e, onClick: t, disabled: n, title: r, primary: i }) {
2048
2100
  return /* @__PURE__ */ A("button", {
2049
2101
  title: r,
2050
2102
  disabled: n,
@@ -2053,10 +2105,10 @@ function ht({ children: e, onClick: t, disabled: n, title: r, primary: i }) {
2053
2105
  children: e
2054
2106
  });
2055
2107
  }
2056
- function gt() {
2108
+ function vt() {
2057
2109
  return /* @__PURE__ */ A("div", { className: "w-px h-5 bg-gray-200 mx-1" });
2058
2110
  }
2059
- var _t = new class {
2111
+ var yt = new class {
2060
2112
  modules = /* @__PURE__ */ new Map();
2061
2113
  register(e) {
2062
2114
  this.modules.set(e.type, e);
@@ -2070,7 +2122,7 @@ var _t = new class {
2070
2122
  byCategory(e) {
2071
2123
  return this.list().filter((t) => t.category === e);
2072
2124
  }
2073
- }(), vt = {
2125
+ }(), bt = {
2074
2126
  basic: "Basic",
2075
2127
  menu: "Menu",
2076
2128
  header: "Header",
@@ -2081,82 +2133,24 @@ var _t = new class {
2081
2133
  transactional: "Transactional",
2082
2134
  social: "Social",
2083
2135
  footer: "Footer"
2084
- }, yt = new class {
2085
- galleries = /* @__PURE__ */ new Map();
2086
- items = [];
2087
- listeners = /* @__PURE__ */ new Set();
2088
- version = 0;
2089
- registerGallery(e) {
2090
- this.galleries.has(e.id) && this.removeGallery(e.id, !1), this.galleries.set(e.id, e);
2091
- for (let t of e.items) this.items.push({
2092
- ...t,
2093
- galleryId: e.id,
2094
- badge: e.badge
2095
- });
2096
- this.emit();
2097
- }
2098
- registerItem(e, t, n) {
2099
- this.galleries.has(e) || this.galleries.set(e, {
2100
- id: e,
2101
- name: e,
2102
- items: []
2103
- });
2104
- let r = this.galleries.get(e);
2105
- r.items.push(t), this.items.push({
2106
- ...t,
2107
- galleryId: e,
2108
- badge: n ?? r.badge
2109
- }), this.emit();
2110
- }
2111
- removeGallery(e, t = !0) {
2112
- this.galleries.delete(e), this.items = this.items.filter((t) => t.galleryId !== e), t && this.emit();
2113
- }
2114
- list() {
2115
- return this.items;
2116
- }
2117
- byCategory(e) {
2118
- return this.items.filter((t) => t.category === e);
2119
- }
2120
- listGalleries() {
2121
- return Array.from(this.galleries.values());
2122
- }
2123
- get(e) {
2124
- return this.items.find((t) => t.type === e);
2125
- }
2126
- subscribe = (e) => (this.listeners.add(e), () => {
2127
- this.listeners.delete(e);
2128
- });
2129
- getSnapshot = () => this.version;
2130
- emit() {
2131
- this.version += 1;
2132
- for (let e of this.listeners) e();
2133
- }
2134
- }(), bt = null, xt = /* @__PURE__ */ new Set(), St = 0;
2135
- function Ct() {
2136
- St += 1;
2137
- for (let e of xt) e();
2136
+ }, xt = null, St = /* @__PURE__ */ new Set(), Ct = 0;
2137
+ function wt() {
2138
+ Ct += 1;
2139
+ for (let e of St) e();
2138
2140
  }
2139
- function wt(e) {
2140
- bt !== e && (bt = e, Ct());
2141
+ function Tt(e) {
2142
+ xt !== e && (xt = e, wt());
2141
2143
  }
2142
- function Tt() {
2143
- return bt;
2144
+ function Et() {
2145
+ return xt;
2144
2146
  }
2145
- var Et = (e) => (xt.add(e), () => {
2146
- xt.delete(e);
2147
- }), Dt = () => St;
2147
+ var Dt = (e) => (St.add(e), () => {
2148
+ St.delete(e);
2149
+ }), Ot = () => Ct;
2148
2150
  //#endregion
2149
2151
  //#region src/ai/catalog.ts
2150
- function Ot() {
2151
- let e = yt.list().map((e) => ({
2152
- type: e.type,
2153
- category: e.category,
2154
- name: e.name,
2155
- description: e.description,
2156
- tags: e.tags ?? [],
2157
- source: "gallery",
2158
- sample: e.create()
2159
- })), t = new Set(e.map((e) => e.type)), n = _t.list().filter((e) => !t.has(e.type)).map((e) => ({
2152
+ function kt() {
2153
+ return yt.list().map((e) => ({
2160
2154
  type: e.type,
2161
2155
  category: e.category,
2162
2156
  name: e.name,
@@ -2165,16 +2159,15 @@ function Ot() {
2165
2159
  source: "module",
2166
2160
  sample: e.create()
2167
2161
  }));
2168
- return [...e, ...n];
2169
2162
  }
2170
2163
  //#endregion
2171
2164
  //#region src/core/aiActions.ts
2172
- function kt(e, t) {
2165
+ function At(e, t) {
2173
2166
  let n = e;
2174
- for (let e of t) n = At(n, e);
2167
+ for (let e of t) n = jt(n, e);
2175
2168
  return n;
2176
2169
  }
2177
- function At(e, t) {
2170
+ function jt(e, t) {
2178
2171
  switch (t.type) {
2179
2172
  case "update_meta": return {
2180
2173
  ...e,
@@ -2224,7 +2217,7 @@ function At(e, t) {
2224
2217
  };
2225
2218
  }
2226
2219
  }
2227
- function jt(e) {
2220
+ function Mt(e) {
2228
2221
  let t = Me.safeParse(e);
2229
2222
  return t.success ? {
2230
2223
  ok: !0,
@@ -2234,16 +2227,16 @@ function jt(e) {
2234
2227
  error: t.error.message
2235
2228
  };
2236
2229
  }
2237
- var Mt = { async generate(e) {
2230
+ var Nt = { async generate(e) {
2238
2231
  return e.task === "rewrite_text" && e.instruction ? { text: `[AI rewrite] ${e.instruction}` } : e.task === "generate_subject" ? { text: "Your weekly insight is here ✨" } : e.task === "generate_preview" ? { text: "A short summary that nudges readers to open." } : { actions: [] };
2239
2232
  } };
2240
2233
  //#endregion
2241
2234
  //#region src/ai/applyResponse.ts
2242
- function Nt(e) {
2235
+ function Pt(e) {
2243
2236
  return JSON.parse(JSON.stringify(e));
2244
2237
  }
2245
- function Pt(e) {
2246
- let t = Nt(e);
2238
+ function Ft(e) {
2239
+ let t = Pt(e);
2247
2240
  return {
2248
2241
  ...t,
2249
2242
  id: N("module"),
@@ -2253,15 +2246,15 @@ function Pt(e) {
2253
2246
  }))
2254
2247
  };
2255
2248
  }
2256
- function Ft(e) {
2249
+ function It(e) {
2257
2250
  return e.map((e) => e.type === "insert_module" ? {
2258
2251
  ...e,
2259
- module: Pt(e.module)
2252
+ module: Ft(e.module)
2260
2253
  } : e);
2261
2254
  }
2262
- function It(e, t) {
2255
+ function Lt(e, t) {
2263
2256
  if (t.document) {
2264
- let e = jt(Nt(t.document));
2257
+ let e = Mt(Pt(t.document));
2265
2258
  return e.ok ? {
2266
2259
  ok: !0,
2267
2260
  result: {
@@ -2275,13 +2268,13 @@ function It(e, t) {
2275
2268
  };
2276
2269
  }
2277
2270
  if (t.actions && t.actions.length > 0) {
2278
- let n = jt(Nt(kt(e, Ft(t.actions))));
2271
+ let n = Mt(Pt(At(e, It(t.actions))));
2279
2272
  return n.ok ? {
2280
2273
  ok: !0,
2281
2274
  result: {
2282
2275
  document: n.document,
2283
2276
  text: t.text,
2284
- summary: Lt(t.actions)
2277
+ summary: Rt(t.actions)
2285
2278
  }
2286
2279
  } : {
2287
2280
  ok: !1,
@@ -2297,7 +2290,7 @@ function It(e, t) {
2297
2290
  }
2298
2291
  };
2299
2292
  }
2300
- function Lt(e) {
2293
+ function Rt(e) {
2301
2294
  let t = {};
2302
2295
  for (let n of e) t[n.type] = (t[n.type] ?? 0) + 1;
2303
2296
  let n = {
@@ -2316,21 +2309,21 @@ function Lt(e) {
2316
2309
  }
2317
2310
  //#endregion
2318
2311
  //#region src/ai/AIChatPanel.tsx
2319
- var Rt = [
2312
+ var zt = [
2320
2313
  "Create a welcome email for new subscribers",
2321
2314
  "Build a flash sale announcement with a product grid",
2322
2315
  "Write a weekly newsletter with a lead story and footer"
2323
2316
  ];
2324
- function zt() {
2325
- return p(Et, Dt, Dt), Tt() !== null;
2326
- }
2327
2317
  function Bt() {
2318
+ return p(Dt, Ot, Ot), Et() !== null;
2319
+ }
2320
+ function Vt() {
2328
2321
  let { doc: e, applyDoc: t } = I(), [n, r] = f([]), [i, a] = f(""), [o, c] = f(!1), l = d(null);
2329
2322
  s(() => {
2330
2323
  l.current?.scrollTo({ top: l.current.scrollHeight });
2331
2324
  }, [n, o]);
2332
2325
  let u = async (n) => {
2333
- let i = Tt();
2326
+ let i = Et();
2334
2327
  if (!i || !n.trim() || o) return;
2335
2328
  let s = {
2336
2329
  id: crypto.randomUUID(),
@@ -2342,10 +2335,10 @@ function Bt() {
2342
2335
  task: "create_email",
2343
2336
  document: e,
2344
2337
  instruction: n,
2345
- context: { catalog: Ot() }
2338
+ context: { catalog: kt() }
2346
2339
  };
2347
2340
  try {
2348
- let n = await i.generate(l), r = It(e, n);
2341
+ let n = await i.generate(l), r = Lt(e, n);
2349
2342
  if (!r.ok) p(`I produced an invalid document and stopped. (${r.error})`, !0);
2350
2343
  else {
2351
2344
  let { document: n, text: i, summary: a } = r.result;
@@ -2386,7 +2379,7 @@ function Bt() {
2386
2379
  children: "Describe the email you want and I'll assemble it from the available blocks."
2387
2380
  }), /* @__PURE__ */ A("div", {
2388
2381
  className: "flex flex-col gap-1.5",
2389
- children: Rt.map((e) => /* @__PURE__ */ A("button", {
2382
+ children: zt.map((e) => /* @__PURE__ */ A("button", {
2390
2383
  onClick: () => u(e),
2391
2384
  className: "text-left text-xs px-2.5 py-2 rounded border border-gray-200 bg-white hover:border-blue-400 hover:bg-blue-50 transition-colors",
2392
2385
  children: e
@@ -2440,7 +2433,7 @@ function Bt() {
2440
2433
  }
2441
2434
  //#endregion
2442
2435
  //#region src/editor/LeftSidebar.tsx
2443
- var Vt = [
2436
+ var Ht = [
2444
2437
  {
2445
2438
  id: "basic",
2446
2439
  icon: D
@@ -2482,59 +2475,51 @@ var Vt = [
2482
2475
  icon: _
2483
2476
  }
2484
2477
  ];
2485
- function Ht() {
2486
- let [e, t] = f("layers"), { addModule: n, themes: r, applyTheme: i, doc: a } = I(), o = zt();
2487
- p(yt.subscribe, yt.getSnapshot, yt.getSnapshot);
2488
- let s = yt.list().length > 0;
2478
+ function Ut() {
2479
+ let [e, t] = f("layers"), { addModule: n, themes: r, applyTheme: i, doc: a } = I();
2489
2480
  return /* @__PURE__ */ j("div", {
2490
2481
  className: "flex h-full bg-white border-r border-gray-200 shrink-0",
2491
2482
  children: [/* @__PURE__ */ j("div", {
2492
- className: "w-16 border-r border-gray-200 flex flex-col items-center py-2 gap-1 overflow-y-auto",
2483
+ className: "w-16 border-r border-gray-200 flex flex-col items-center py-2 gap-1",
2493
2484
  children: [
2494
- o && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(Ut, {
2495
- id: "ai",
2496
- label: "AI",
2497
- icon: ye,
2498
- active: e === "ai",
2485
+ Bt() && /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ j("button", {
2499
2486
  onClick: () => t("ai"),
2500
- accent: !0
2487
+ title: "AI Assistant",
2488
+ className: `flex flex-col items-center gap-0.5 w-14 py-2 rounded text-[10px] transition-colors ${e === "ai" ? "bg-blue-50 text-blue-700" : "text-blue-600 hover:bg-blue-50"}`,
2489
+ children: [/* @__PURE__ */ A(ye, { size: 20 }), /* @__PURE__ */ A("span", { children: "AI" })]
2501
2490
  }), /* @__PURE__ */ A("div", { className: "h-px w-10 bg-gray-200 my-1" })] }),
2502
- /* @__PURE__ */ A(Ut, {
2503
- id: "layers",
2504
- label: "Layers",
2505
- icon: ne,
2506
- active: e === "layers",
2507
- onClick: () => t("layers")
2508
- }),
2509
- s && /* @__PURE__ */ A(Ut, {
2510
- id: "gallery",
2511
- label: "Gallery",
2512
- icon: te,
2513
- active: e === "gallery",
2514
- onClick: () => t("gallery")
2491
+ /* @__PURE__ */ j("button", {
2492
+ onClick: () => t("layers"),
2493
+ title: "Layout overview",
2494
+ className: `flex flex-col items-center gap-0.5 w-14 py-2 rounded text-[10px] transition-colors ${e === "layers" ? "bg-blue-50 text-blue-700" : "text-gray-600 hover:bg-gray-50"}`,
2495
+ children: [/* @__PURE__ */ A(ne, { size: 20 }), /* @__PURE__ */ A("span", { children: "Layers" })]
2515
2496
  }),
2516
2497
  /* @__PURE__ */ A("div", { className: "h-px w-10 bg-gray-200 my-1" }),
2517
- Vt.map((n) => /* @__PURE__ */ A(Ut, {
2518
- id: n.id,
2519
- label: vt[n.id],
2520
- icon: n.icon,
2521
- active: e === n.id,
2522
- onClick: () => t(n.id)
2523
- }, n.id)),
2498
+ Ht.map((n) => {
2499
+ let r = n.icon, i = e === n.id;
2500
+ return /* @__PURE__ */ j("button", {
2501
+ onClick: () => t(n.id),
2502
+ title: bt[n.id],
2503
+ className: `flex flex-col items-center gap-0.5 w-14 py-2 rounded text-[10px] transition-colors ${i ? "bg-blue-50 text-blue-700" : "text-gray-600 hover:bg-gray-50"}`,
2504
+ children: [/* @__PURE__ */ A(r, { size: 20 }), /* @__PURE__ */ A("span", {
2505
+ className: "leading-tight text-center",
2506
+ children: bt[n.id]
2507
+ })]
2508
+ }, n.id);
2509
+ }),
2524
2510
  /* @__PURE__ */ A("div", {
2525
2511
  className: "mt-auto",
2526
- children: /* @__PURE__ */ A(Ut, {
2527
- id: "themes",
2528
- label: "Themes",
2529
- icon: le,
2530
- active: e === "themes",
2531
- onClick: () => t("themes")
2512
+ children: /* @__PURE__ */ j("button", {
2513
+ onClick: () => t("themes"),
2514
+ title: "Themes",
2515
+ className: `flex flex-col items-center gap-0.5 w-14 py-2 rounded text-[10px] transition-colors ${e === "themes" ? "bg-blue-50 text-blue-700" : "text-gray-600 hover:bg-gray-50"}`,
2516
+ children: [/* @__PURE__ */ A(le, { size: 20 }), /* @__PURE__ */ A("span", { children: "Themes" })]
2532
2517
  })
2533
2518
  })
2534
2519
  ]
2535
2520
  }), /* @__PURE__ */ A("div", {
2536
2521
  className: "w-64 overflow-y-auto p-3",
2537
- children: e === "layers" ? /* @__PURE__ */ A(qt, {}) : e === "ai" ? /* @__PURE__ */ A(Bt, {}) : e === "gallery" ? /* @__PURE__ */ A(Gt, { onAdd: (e) => n(e.create()) }) : e === "themes" ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("h3", {
2522
+ children: e === "layers" ? /* @__PURE__ */ A(Wt, {}) : e === "ai" ? /* @__PURE__ */ A(Vt, {}) : e === "themes" ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("h3", {
2538
2523
  className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
2539
2524
  children: "Themes"
2540
2525
  }), /* @__PURE__ */ A("div", {
@@ -2563,118 +2548,30 @@ function Ht() {
2563
2548
  children: e.name
2564
2549
  })]
2565
2550
  }, e.id))
2566
- })] }) : /* @__PURE__ */ A(Wt, {
2567
- category: e,
2568
- onAdd: (e) => n(e())
2569
- })
2570
- })]
2571
- });
2572
- }
2573
- function Ut({ label: e, icon: t, active: n, onClick: r, accent: i }) {
2574
- return /* @__PURE__ */ j("button", {
2575
- onClick: r,
2576
- title: e,
2577
- className: `flex flex-col items-center gap-0.5 w-14 py-2 rounded text-[10px] transition-colors ${n ? "bg-blue-50 text-blue-700" : i ? "text-blue-600 hover:bg-blue-50" : "text-gray-600 hover:bg-gray-50"}`,
2578
- children: [/* @__PURE__ */ A(t, { size: 20 }), /* @__PURE__ */ A("span", {
2579
- className: "leading-tight text-center",
2580
- children: e
2551
+ })] }) : /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("h3", {
2552
+ className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
2553
+ children: bt[e]
2554
+ }), /* @__PURE__ */ j("div", {
2555
+ className: "grid grid-cols-1 gap-2",
2556
+ children: [yt.byCategory(e).map((e) => /* @__PURE__ */ j("button", {
2557
+ onClick: () => n(e.create()),
2558
+ className: "text-left p-3 rounded border border-gray-200 bg-white hover:border-blue-400 hover:shadow-sm transition-all",
2559
+ children: [/* @__PURE__ */ A("div", {
2560
+ className: "h-12 bg-gray-50 rounded mb-2 flex items-center justify-center text-xs text-gray-400",
2561
+ children: e.name
2562
+ }), /* @__PURE__ */ A("div", {
2563
+ className: "text-xs font-medium text-gray-700",
2564
+ children: e.name
2565
+ })]
2566
+ }, e.type)), yt.byCategory(e).length === 0 && /* @__PURE__ */ A("div", {
2567
+ className: "text-xs text-gray-400 italic py-4 text-center",
2568
+ children: "No modules in this category yet."
2569
+ })]
2570
+ })] })
2581
2571
  })]
2582
2572
  });
2583
2573
  }
2584
- function Wt({ category: e, onAdd: t }) {
2585
- let n = yt.byCategory(e), r = _t.byCategory(e);
2586
- return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("h3", {
2587
- className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
2588
- children: vt[e]
2589
- }), /* @__PURE__ */ j("div", {
2590
- className: "grid grid-cols-1 gap-2",
2591
- children: [
2592
- n.map((e) => /* @__PURE__ */ A(Kt, {
2593
- name: e.name,
2594
- badge: e.badge ?? "New",
2595
- onClick: () => t(e.create)
2596
- }, e.type)),
2597
- r.map((e) => /* @__PURE__ */ A(Kt, {
2598
- name: e.name,
2599
- onClick: () => t(e.create)
2600
- }, e.type)),
2601
- n.length === 0 && r.length === 0 && /* @__PURE__ */ A("div", {
2602
- className: "text-xs text-gray-400 italic py-4 text-center",
2603
- children: "No modules in this category yet."
2604
- })
2605
- ]
2606
- })] });
2607
- }
2608
- function Gt({ onAdd: e }) {
2609
- let t = yt.listGalleries(), n = yt.list();
2610
- return n.length === 0 ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("h3", {
2611
- className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
2612
- children: "Gallery"
2613
- }), /* @__PURE__ */ A("p", {
2614
- className: "text-xs text-gray-400 italic",
2615
- children: "No galleries loaded."
2616
- })] }) : /* @__PURE__ */ j(k, { children: [
2617
- /* @__PURE__ */ A("h3", {
2618
- className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-1",
2619
- children: "Gallery"
2620
- }),
2621
- /* @__PURE__ */ j("p", {
2622
- className: "text-[10px] text-gray-400 mb-3",
2623
- children: [
2624
- n.length,
2625
- " element",
2626
- n.length === 1 ? "" : "s",
2627
- " across ",
2628
- t.length,
2629
- " ",
2630
- t.length === 1 ? "gallery" : "galleries"
2631
- ]
2632
- }),
2633
- /* @__PURE__ */ A("div", {
2634
- className: "flex flex-col gap-4",
2635
- children: t.map((t) => {
2636
- let r = n.filter((e) => e.galleryId === t.id);
2637
- return r.length === 0 ? null : /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("div", {
2638
- className: "text-[11px] font-medium text-gray-600 mb-1.5",
2639
- children: t.name
2640
- }), /* @__PURE__ */ A("div", {
2641
- className: "grid grid-cols-1 gap-2",
2642
- children: r.map((t) => /* @__PURE__ */ A(Kt, {
2643
- name: t.name,
2644
- badge: t.badge ?? "New",
2645
- sub: vt[t.category],
2646
- onClick: () => e(t)
2647
- }, t.type))
2648
- })] }, t.id);
2649
- })
2650
- })
2651
- ] });
2652
- }
2653
- function Kt({ name: e, onClick: t, badge: n, sub: r }) {
2654
- return /* @__PURE__ */ j("button", {
2655
- onClick: t,
2656
- className: "relative text-left p-3 rounded border border-gray-200 bg-white hover:border-blue-400 hover:shadow-sm transition-all",
2657
- children: [
2658
- n && /* @__PURE__ */ A("span", {
2659
- className: "absolute top-1.5 right-1.5 text-[9px] font-semibold uppercase tracking-wide bg-blue-100 text-blue-700 px-1.5 py-0.5 rounded",
2660
- children: n
2661
- }),
2662
- /* @__PURE__ */ A("div", {
2663
- className: "h-12 bg-gray-50 rounded mb-2 flex items-center justify-center text-xs text-gray-400 px-2 text-center",
2664
- children: e
2665
- }),
2666
- /* @__PURE__ */ A("div", {
2667
- className: "text-xs font-medium text-gray-700",
2668
- children: e
2669
- }),
2670
- r && /* @__PURE__ */ A("div", {
2671
- className: "text-[10px] text-gray-400",
2672
- children: r
2673
- })
2674
- ]
2675
- });
2676
- }
2677
- function qt() {
2574
+ function Wt() {
2678
2575
  let { doc: e, selection: t, setSelection: n, reorderModules: r, deleteModule: i, duplicateModule: a } = I();
2679
2576
  return e.modules.length === 0 ? /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A("h3", {
2680
2577
  className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
@@ -2744,7 +2641,7 @@ function qt() {
2744
2641
  },
2745
2642
  className: "p-0.5 text-gray-500 hover:text-blue-600",
2746
2643
  title: "Duplicate",
2747
- children: /* @__PURE__ */ A(S, { size: 12 })
2644
+ children: /* @__PURE__ */ A(C, { size: 12 })
2748
2645
  }),
2749
2646
  /* @__PURE__ */ A("button", {
2750
2647
  onClick: (e) => {
@@ -2761,47 +2658,47 @@ function qt() {
2761
2658
  }
2762
2659
  //#endregion
2763
2660
  //#region node_modules/@dnd-kit/utilities/dist/utilities.esm.js
2764
- function Jt() {
2661
+ function Gt() {
2765
2662
  var e = [...arguments];
2766
2663
  return l(() => (t) => {
2767
2664
  e.forEach((e) => e(t));
2768
2665
  }, e);
2769
2666
  }
2770
- var Yt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
2771
- function Xt(e) {
2667
+ var Kt = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0;
2668
+ function qt(e) {
2772
2669
  let t = Object.prototype.toString.call(e);
2773
2670
  return t === "[object Window]" || t === "[object global]";
2774
2671
  }
2775
- function Zt(e) {
2672
+ function Jt(e) {
2776
2673
  return "nodeType" in e;
2777
2674
  }
2778
- function Qt(e) {
2779
- return e ? Xt(e) ? e : Zt(e) ? e.ownerDocument?.defaultView ?? window : window : window;
2675
+ function Yt(e) {
2676
+ return e ? qt(e) ? e : Jt(e) ? e.ownerDocument?.defaultView ?? window : window : window;
2780
2677
  }
2781
- function $t(e) {
2782
- let { Document: t } = Qt(e);
2678
+ function Xt(e) {
2679
+ let { Document: t } = Yt(e);
2783
2680
  return e instanceof t;
2784
2681
  }
2785
- function en(e) {
2786
- return Xt(e) ? !1 : e instanceof Qt(e).HTMLElement;
2682
+ function Zt(e) {
2683
+ return qt(e) ? !1 : e instanceof Yt(e).HTMLElement;
2787
2684
  }
2788
- function tn(e) {
2789
- return e instanceof Qt(e).SVGElement;
2685
+ function Qt(e) {
2686
+ return e instanceof Yt(e).SVGElement;
2790
2687
  }
2791
- function nn(e) {
2792
- return e ? Xt(e) ? e.document : Zt(e) ? $t(e) ? e : en(e) || tn(e) ? e.ownerDocument : document : document : document;
2688
+ function $t(e) {
2689
+ return e ? qt(e) ? e.document : Jt(e) ? Xt(e) ? e : Zt(e) || Qt(e) ? e.ownerDocument : document : document : document;
2793
2690
  }
2794
- var rn = Yt ? c : s;
2795
- function an(e) {
2691
+ var en = Kt ? c : s;
2692
+ function tn(e) {
2796
2693
  let t = d(e);
2797
- return rn(() => {
2694
+ return en(() => {
2798
2695
  t.current = e;
2799
2696
  }), a(function() {
2800
2697
  var e = [...arguments];
2801
2698
  return t.current == null ? void 0 : t.current(...e);
2802
2699
  }, []);
2803
2700
  }
2804
- function on() {
2701
+ function nn() {
2805
2702
  let e = d(null);
2806
2703
  return [a((t, n) => {
2807
2704
  e.current = setInterval(t, n);
@@ -2809,41 +2706,41 @@ function on() {
2809
2706
  e.current !== null && (clearInterval(e.current), e.current = null);
2810
2707
  }, [])];
2811
2708
  }
2812
- function sn(e, t) {
2709
+ function rn(e, t) {
2813
2710
  t === void 0 && (t = [e]);
2814
2711
  let n = d(e);
2815
- return rn(() => {
2712
+ return en(() => {
2816
2713
  n.current !== e && (n.current = e);
2817
2714
  }, t), n;
2818
2715
  }
2819
- function cn(e, t) {
2716
+ function an(e, t) {
2820
2717
  let n = d();
2821
2718
  return l(() => {
2822
2719
  let t = e(n.current);
2823
2720
  return n.current = t, t;
2824
2721
  }, [...t]);
2825
2722
  }
2826
- function ln(e) {
2827
- let t = an(e), n = d(null);
2723
+ function on(e) {
2724
+ let t = tn(e), n = d(null);
2828
2725
  return [n, a((e) => {
2829
2726
  e !== n.current && t?.(e, n.current), n.current = e;
2830
2727
  }, [])];
2831
2728
  }
2832
- function un(e) {
2729
+ function sn(e) {
2833
2730
  let t = d();
2834
2731
  return s(() => {
2835
2732
  t.current = e;
2836
2733
  }, [e]), t.current;
2837
2734
  }
2838
- var dn = {};
2839
- function fn(e, t) {
2735
+ var cn = {};
2736
+ function ln(e, t) {
2840
2737
  return l(() => {
2841
2738
  if (t) return t;
2842
- let n = dn[e] == null ? 0 : dn[e] + 1;
2843
- return dn[e] = n, e + "-" + n;
2739
+ let n = cn[e] == null ? 0 : cn[e] + 1;
2740
+ return cn[e] = n, e + "-" + n;
2844
2741
  }, [e, t]);
2845
2742
  }
2846
- function pn(e) {
2743
+ function un(e) {
2847
2744
  return function(t) {
2848
2745
  return [...arguments].slice(1).reduce((t, n) => {
2849
2746
  let r = Object.entries(n);
@@ -2855,22 +2752,22 @@ function pn(e) {
2855
2752
  }, { ...t });
2856
2753
  };
2857
2754
  }
2858
- var mn = /*#__PURE__*/ pn(1), hn = /*#__PURE__*/ pn(-1);
2859
- function gn(e) {
2755
+ var dn = /*#__PURE__*/ un(1), fn = /*#__PURE__*/ un(-1);
2756
+ function pn(e) {
2860
2757
  return "clientX" in e && "clientY" in e;
2861
2758
  }
2862
- function _n(e) {
2759
+ function mn(e) {
2863
2760
  if (!e) return !1;
2864
- let { KeyboardEvent: t } = Qt(e.target);
2761
+ let { KeyboardEvent: t } = Yt(e.target);
2865
2762
  return t && e instanceof t;
2866
2763
  }
2867
- function vn(e) {
2764
+ function hn(e) {
2868
2765
  if (!e) return !1;
2869
- let { TouchEvent: t } = Qt(e.target);
2766
+ let { TouchEvent: t } = Yt(e.target);
2870
2767
  return t && e instanceof t;
2871
2768
  }
2872
- function yn(e) {
2873
- if (vn(e)) {
2769
+ function gn(e) {
2770
+ if (hn(e)) {
2874
2771
  if (e.touches && e.touches.length) {
2875
2772
  let { clientX: t, clientY: n } = e.touches[0];
2876
2773
  return {
@@ -2885,12 +2782,12 @@ function yn(e) {
2885
2782
  };
2886
2783
  }
2887
2784
  }
2888
- return gn(e) ? {
2785
+ return pn(e) ? {
2889
2786
  x: e.clientX,
2890
2787
  y: e.clientY
2891
2788
  } : null;
2892
2789
  }
2893
- var bn = /*#__PURE__*/ Object.freeze({
2790
+ var _n = /*#__PURE__*/ Object.freeze({
2894
2791
  Translate: { toString(e) {
2895
2792
  if (!e) return;
2896
2793
  let { x: t, y: n } = e;
@@ -2902,27 +2799,27 @@ var bn = /*#__PURE__*/ Object.freeze({
2902
2799
  return "scaleX(" + t + ") scaleY(" + n + ")";
2903
2800
  } },
2904
2801
  Transform: { toString(e) {
2905
- if (e) return [bn.Translate.toString(e), bn.Scale.toString(e)].join(" ");
2802
+ if (e) return [_n.Translate.toString(e), _n.Scale.toString(e)].join(" ");
2906
2803
  } },
2907
2804
  Transition: { toString(e) {
2908
2805
  let { property: t, duration: n, easing: r } = e;
2909
2806
  return t + " " + n + "ms " + r;
2910
2807
  } }
2911
- }), xn = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
2912
- function Sn(e) {
2913
- return e.matches(xn) ? e : e.querySelector(xn);
2808
+ }), vn = "a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";
2809
+ function yn(e) {
2810
+ return e.matches(vn) ? e : e.querySelector(vn);
2914
2811
  }
2915
2812
  //#endregion
2916
2813
  //#region node_modules/@dnd-kit/accessibility/dist/accessibility.esm.js
2917
- var Cn = { display: "none" };
2918
- function wn(e) {
2814
+ var bn = { display: "none" };
2815
+ function xn(e) {
2919
2816
  let { id: n, value: r } = e;
2920
2817
  return t.createElement("div", {
2921
2818
  id: n,
2922
- style: Cn
2819
+ style: bn
2923
2820
  }, r);
2924
2821
  }
2925
- function Tn(e) {
2822
+ function Sn(e) {
2926
2823
  let { id: n, announcement: r, ariaLiveType: i = "assertive" } = e;
2927
2824
  return t.createElement("div", {
2928
2825
  id: n,
@@ -2945,7 +2842,7 @@ function Tn(e) {
2945
2842
  "aria-atomic": !0
2946
2843
  }, r);
2947
2844
  }
2948
- function En() {
2845
+ function Cn() {
2949
2846
  let [e, t] = f("");
2950
2847
  return {
2951
2848
  announce: a((e) => {
@@ -2956,22 +2853,22 @@ function En() {
2956
2853
  }
2957
2854
  //#endregion
2958
2855
  //#region node_modules/@dnd-kit/core/dist/core.esm.js
2959
- var Dn = /*#__PURE__*/ n(null);
2960
- function On(e) {
2961
- let t = o(Dn);
2856
+ var wn = /*#__PURE__*/ n(null);
2857
+ function Tn(e) {
2858
+ let t = o(wn);
2962
2859
  s(() => {
2963
2860
  if (!t) throw Error("useDndMonitor must be used within a children of <DndContext>");
2964
2861
  return t(e);
2965
2862
  }, [e, t]);
2966
2863
  }
2967
- function kn() {
2864
+ function En() {
2968
2865
  let [e] = f(() => /* @__PURE__ */ new Set()), t = a((t) => (e.add(t), () => e.delete(t)), [e]);
2969
2866
  return [a((t) => {
2970
2867
  let { type: n, event: r } = t;
2971
2868
  e.forEach((e) => e[n]?.call(e, r));
2972
2869
  }, [e]), t];
2973
2870
  }
2974
- var An = { draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " }, jn = {
2871
+ var Dn = { draggable: "\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n " }, On = {
2975
2872
  onDragStart(e) {
2976
2873
  let { active: t } = e;
2977
2874
  return "Picked up draggable item " + t.id + ".";
@@ -2989,11 +2886,11 @@ var An = { draggable: "\n To pick up a draggable item, press the space bar.\n
2989
2886
  return "Dragging was cancelled. Draggable item " + t.id + " was dropped.";
2990
2887
  }
2991
2888
  };
2992
- function Mn(e) {
2993
- let { announcements: n = jn, container: r, hiddenTextDescribedById: i, screenReaderInstructions: a = An } = e, { announce: o, announcement: c } = En(), u = fn("DndLiveRegion"), [d, p] = f(!1);
2889
+ function kn(e) {
2890
+ let { announcements: n = On, container: r, hiddenTextDescribedById: i, screenReaderInstructions: a = Dn } = e, { announce: o, announcement: c } = Cn(), u = ln("DndLiveRegion"), [d, p] = f(!1);
2994
2891
  if (s(() => {
2995
2892
  p(!0);
2996
- }, []), On(l(() => ({
2893
+ }, []), Tn(l(() => ({
2997
2894
  onDragStart(e) {
2998
2895
  let { active: t } = e;
2999
2896
  o(n.onDragStart({ active: t }));
@@ -3027,10 +2924,10 @@ function Mn(e) {
3027
2924
  }));
3028
2925
  }
3029
2926
  }), [o, n])), !d) return null;
3030
- let m = t.createElement(t.Fragment, null, t.createElement(wn, {
2927
+ let m = t.createElement(t.Fragment, null, t.createElement(xn, {
3031
2928
  id: i,
3032
2929
  value: a.draggable
3033
- }), t.createElement(Tn, {
2930
+ }), t.createElement(Sn, {
3034
2931
  id: u,
3035
2932
  announcement: c
3036
2933
  }));
@@ -3040,33 +2937,33 @@ var J;
3040
2937
  (function(e) {
3041
2938
  e.DragStart = "dragStart", e.DragMove = "dragMove", e.DragEnd = "dragEnd", e.DragCancel = "dragCancel", e.DragOver = "dragOver", e.RegisterDroppable = "registerDroppable", e.SetDroppableDisabled = "setDroppableDisabled", e.UnregisterDroppable = "unregisterDroppable";
3042
2939
  })(J ||= {});
3043
- function Nn() {}
3044
- function Pn(e, t) {
2940
+ function An() {}
2941
+ function jn(e, t) {
3045
2942
  return l(() => ({
3046
2943
  sensor: e,
3047
2944
  options: t ?? {}
3048
2945
  }), [e, t]);
3049
2946
  }
3050
- function Fn() {
2947
+ function Mn() {
3051
2948
  var e = [...arguments];
3052
2949
  return l(() => [...e].filter((e) => e != null), [...e]);
3053
2950
  }
3054
- var In = /*#__PURE__*/ Object.freeze({
2951
+ var Nn = /*#__PURE__*/ Object.freeze({
3055
2952
  x: 0,
3056
2953
  y: 0
3057
2954
  });
3058
- function Ln(e, t) {
2955
+ function Pn(e, t) {
3059
2956
  return Math.sqrt((e.x - t.x) ** 2 + (e.y - t.y) ** 2);
3060
2957
  }
3061
- function Rn(e, t) {
2958
+ function Fn(e, t) {
3062
2959
  let { data: { value: n } } = e, { data: { value: r } } = t;
3063
2960
  return n - r;
3064
2961
  }
3065
- function zn(e, t) {
2962
+ function In(e, t) {
3066
2963
  let { data: { value: n } } = e, { data: { value: r } } = t;
3067
2964
  return r - n;
3068
2965
  }
3069
- function Bn(e) {
2966
+ function Ln(e) {
3070
2967
  let { left: t, top: n, height: r, width: i } = e;
3071
2968
  return [
3072
2969
  {
@@ -3087,23 +2984,23 @@ function Bn(e) {
3087
2984
  }
3088
2985
  ];
3089
2986
  }
3090
- function Vn(e, t) {
2987
+ function Rn(e, t) {
3091
2988
  if (!e || e.length === 0) return null;
3092
2989
  let [n] = e;
3093
2990
  return t ? n[t] : n;
3094
2991
  }
3095
- function Hn(e, t, n) {
2992
+ function zn(e, t, n) {
3096
2993
  return t === void 0 && (t = e.left), n === void 0 && (n = e.top), {
3097
2994
  x: t + e.width * .5,
3098
2995
  y: n + e.height * .5
3099
2996
  };
3100
2997
  }
3101
- var Un = (e) => {
3102
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = Hn(t, t.left, t.top), a = [];
2998
+ var Bn = (e) => {
2999
+ let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = zn(t, t.left, t.top), a = [];
3103
3000
  for (let e of r) {
3104
3001
  let { id: t } = e, r = n.get(t);
3105
3002
  if (r) {
3106
- let n = Ln(Hn(r), i);
3003
+ let n = Pn(zn(r), i);
3107
3004
  a.push({
3108
3005
  id: t,
3109
3006
  data: {
@@ -3113,13 +3010,13 @@ var Un = (e) => {
3113
3010
  });
3114
3011
  }
3115
3012
  }
3116
- return a.sort(Rn);
3117
- }, Wn = (e) => {
3118
- let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = Bn(t), a = [];
3013
+ return a.sort(Fn);
3014
+ }, Vn = (e) => {
3015
+ let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = Ln(t), a = [];
3119
3016
  for (let e of r) {
3120
3017
  let { id: t } = e, r = n.get(t);
3121
3018
  if (r) {
3122
- let n = Bn(r), o = i.reduce((e, t, r) => e + Ln(n[r], t), 0), s = Number((o / 4).toFixed(4));
3019
+ let n = Ln(r), o = i.reduce((e, t, r) => e + Pn(n[r], t), 0), s = Number((o / 4).toFixed(4));
3123
3020
  a.push({
3124
3021
  id: t,
3125
3022
  data: {
@@ -3129,9 +3026,9 @@ var Un = (e) => {
3129
3026
  });
3130
3027
  }
3131
3028
  }
3132
- return a.sort(Rn);
3029
+ return a.sort(Fn);
3133
3030
  };
3134
- function Gn(e, t) {
3031
+ function Hn(e, t) {
3135
3032
  let n = Math.max(t.top, e.top), r = Math.max(t.left, e.left), i = Math.min(t.left + t.width, e.left + e.width), a = Math.min(t.top + t.height, e.top + e.height), o = i - r, s = a - n;
3136
3033
  if (r < i && n < a) {
3137
3034
  let n = t.width * t.height, r = e.width * e.height, i = o * s, a = i / (n + r - i);
@@ -3139,12 +3036,12 @@ function Gn(e, t) {
3139
3036
  }
3140
3037
  return 0;
3141
3038
  }
3142
- var Kn = (e) => {
3039
+ var Un = (e) => {
3143
3040
  let { collisionRect: t, droppableRects: n, droppableContainers: r } = e, i = [];
3144
3041
  for (let e of r) {
3145
3042
  let { id: r } = e, a = n.get(r);
3146
3043
  if (a) {
3147
- let n = Gn(a, t);
3044
+ let n = Hn(a, t);
3148
3045
  n > 0 && i.push({
3149
3046
  id: r,
3150
3047
  data: {
@@ -3154,22 +3051,22 @@ var Kn = (e) => {
3154
3051
  });
3155
3052
  }
3156
3053
  }
3157
- return i.sort(zn);
3054
+ return i.sort(In);
3158
3055
  };
3159
- function qn(e, t, n) {
3056
+ function Wn(e, t, n) {
3160
3057
  return {
3161
3058
  ...e,
3162
3059
  scaleX: t && n ? t.width / n.width : 1,
3163
3060
  scaleY: t && n ? t.height / n.height : 1
3164
3061
  };
3165
3062
  }
3166
- function Jn(e, t) {
3063
+ function Gn(e, t) {
3167
3064
  return e && t ? {
3168
3065
  x: e.left - t.left,
3169
3066
  y: e.top - t.top
3170
- } : In;
3067
+ } : Nn;
3171
3068
  }
3172
- function Yn(e) {
3069
+ function Kn(e) {
3173
3070
  return function(t) {
3174
3071
  return [...arguments].slice(1).reduce((t, n) => ({
3175
3072
  ...t,
@@ -3180,8 +3077,8 @@ function Yn(e) {
3180
3077
  }), { ...t });
3181
3078
  };
3182
3079
  }
3183
- var Xn = /*#__PURE__*/ Yn(1);
3184
- function Zn(e) {
3080
+ var qn = /*#__PURE__*/ Kn(1);
3081
+ function Jn(e) {
3185
3082
  if (e.startsWith("matrix3d(")) {
3186
3083
  let t = e.slice(9, -1).split(/, /);
3187
3084
  return {
@@ -3201,8 +3098,8 @@ function Zn(e) {
3201
3098
  }
3202
3099
  return null;
3203
3100
  }
3204
- function Qn(e, t, n) {
3205
- let r = Zn(t);
3101
+ function Yn(e, t, n) {
3102
+ let r = Jn(t);
3206
3103
  if (!r) return e;
3207
3104
  let { scaleX: i, scaleY: a, x: o, y: s } = r, c = e.left - o - (1 - i) * parseFloat(n), l = e.top - s - (1 - a) * parseFloat(n.slice(n.indexOf(" ") + 1)), u = i ? e.width / i : e.width, d = a ? e.height / a : e.height;
3208
3105
  return {
@@ -3214,13 +3111,13 @@ function Qn(e, t, n) {
3214
3111
  left: c
3215
3112
  };
3216
3113
  }
3217
- var $n = { ignoreTransform: !1 };
3218
- function er(e, t) {
3219
- t === void 0 && (t = $n);
3114
+ var Xn = { ignoreTransform: !1 };
3115
+ function Zn(e, t) {
3116
+ t === void 0 && (t = Xn);
3220
3117
  let n = e.getBoundingClientRect();
3221
3118
  if (t.ignoreTransform) {
3222
- let { transform: t, transformOrigin: r } = Qt(e).getComputedStyle(e);
3223
- t && (n = Qn(n, t, r));
3119
+ let { transform: t, transformOrigin: r } = Yt(e).getComputedStyle(e);
3120
+ t && (n = Yn(n, t, r));
3224
3121
  }
3225
3122
  let { top: r, left: i, width: a, height: o, bottom: s, right: c } = n;
3226
3123
  return {
@@ -3232,10 +3129,10 @@ function er(e, t) {
3232
3129
  right: c
3233
3130
  };
3234
3131
  }
3235
- function tr(e) {
3236
- return er(e, { ignoreTransform: !0 });
3132
+ function Qn(e) {
3133
+ return Zn(e, { ignoreTransform: !0 });
3237
3134
  }
3238
- function nr(e) {
3135
+ function $n(e) {
3239
3136
  let t = e.innerWidth, n = e.innerHeight;
3240
3137
  return {
3241
3138
  top: 0,
@@ -3246,11 +3143,11 @@ function nr(e) {
3246
3143
  height: n
3247
3144
  };
3248
3145
  }
3249
- function rr(e, t) {
3250
- return t === void 0 && (t = Qt(e).getComputedStyle(e)), t.position === "fixed";
3146
+ function er(e, t) {
3147
+ return t === void 0 && (t = Yt(e).getComputedStyle(e)), t.position === "fixed";
3251
3148
  }
3252
- function ir(e, t) {
3253
- t === void 0 && (t = Qt(e).getComputedStyle(e));
3149
+ function tr(e, t) {
3150
+ t === void 0 && (t = Yt(e).getComputedStyle(e));
3254
3151
  let n = /(auto|scroll|overlay)/;
3255
3152
  return [
3256
3153
  "overflow",
@@ -3261,48 +3158,48 @@ function ir(e, t) {
3261
3158
  return typeof r == "string" ? n.test(r) : !1;
3262
3159
  });
3263
3160
  }
3264
- function ar(e, t) {
3161
+ function nr(e, t) {
3265
3162
  let n = [];
3266
3163
  function r(i) {
3267
3164
  if (t != null && n.length >= t || !i) return n;
3268
- if ($t(i) && i.scrollingElement != null && !n.includes(i.scrollingElement)) return n.push(i.scrollingElement), n;
3269
- if (!en(i) || tn(i) || n.includes(i)) return n;
3270
- let a = Qt(e).getComputedStyle(i);
3271
- return i !== e && ir(i, a) && n.push(i), rr(i, a) ? n : r(i.parentNode);
3165
+ if (Xt(i) && i.scrollingElement != null && !n.includes(i.scrollingElement)) return n.push(i.scrollingElement), n;
3166
+ if (!Zt(i) || Qt(i) || n.includes(i)) return n;
3167
+ let a = Yt(e).getComputedStyle(i);
3168
+ return i !== e && tr(i, a) && n.push(i), er(i, a) ? n : r(i.parentNode);
3272
3169
  }
3273
3170
  return e ? r(e) : n;
3274
3171
  }
3275
- function or(e) {
3276
- let [t] = ar(e, 1);
3172
+ function rr(e) {
3173
+ let [t] = nr(e, 1);
3277
3174
  return t ?? null;
3278
3175
  }
3279
- function sr(e) {
3280
- return !Yt || !e ? null : Xt(e) ? e : Zt(e) ? $t(e) || e === nn(e).scrollingElement ? window : en(e) ? e : null : null;
3176
+ function ir(e) {
3177
+ return !Kt || !e ? null : qt(e) ? e : Jt(e) ? Xt(e) || e === $t(e).scrollingElement ? window : Zt(e) ? e : null : null;
3281
3178
  }
3282
- function cr(e) {
3283
- return Xt(e) ? e.scrollX : e.scrollLeft;
3179
+ function ar(e) {
3180
+ return qt(e) ? e.scrollX : e.scrollLeft;
3284
3181
  }
3285
- function lr(e) {
3286
- return Xt(e) ? e.scrollY : e.scrollTop;
3182
+ function or(e) {
3183
+ return qt(e) ? e.scrollY : e.scrollTop;
3287
3184
  }
3288
- function ur(e) {
3185
+ function sr(e) {
3289
3186
  return {
3290
- x: cr(e),
3291
- y: lr(e)
3187
+ x: ar(e),
3188
+ y: or(e)
3292
3189
  };
3293
3190
  }
3294
3191
  var Y;
3295
3192
  (function(e) {
3296
3193
  e[e.Forward = 1] = "Forward", e[e.Backward = -1] = "Backward";
3297
3194
  })(Y ||= {});
3298
- function dr(e) {
3299
- return !Yt || !e ? !1 : e === document.scrollingElement;
3195
+ function cr(e) {
3196
+ return !Kt || !e ? !1 : e === document.scrollingElement;
3300
3197
  }
3301
- function fr(e) {
3198
+ function lr(e) {
3302
3199
  let t = {
3303
3200
  x: 0,
3304
3201
  y: 0
3305
- }, n = dr(e) ? {
3202
+ }, n = cr(e) ? {
3306
3203
  height: window.innerHeight,
3307
3204
  width: window.innerWidth
3308
3205
  } : {
@@ -3321,14 +3218,14 @@ function fr(e) {
3321
3218
  minScroll: t
3322
3219
  };
3323
3220
  }
3324
- var pr = {
3221
+ var ur = {
3325
3222
  x: .2,
3326
3223
  y: .2
3327
3224
  };
3328
- function mr(e, t, n, r, i) {
3225
+ function dr(e, t, n, r, i) {
3329
3226
  let { top: a, left: o, right: s, bottom: c } = n;
3330
- r === void 0 && (r = 10), i === void 0 && (i = pr);
3331
- let { isTop: l, isBottom: u, isLeft: d, isRight: f } = fr(e), p = {
3227
+ r === void 0 && (r = 10), i === void 0 && (i = ur);
3228
+ let { isTop: l, isBottom: u, isLeft: d, isRight: f } = lr(e), p = {
3332
3229
  x: 0,
3333
3230
  y: 0
3334
3231
  }, m = {
@@ -3343,7 +3240,7 @@ function mr(e, t, n, r, i) {
3343
3240
  speed: m
3344
3241
  };
3345
3242
  }
3346
- function hr(e) {
3243
+ function fr(e) {
3347
3244
  if (e === document.scrollingElement) {
3348
3245
  let { innerWidth: e, innerHeight: t } = window;
3349
3246
  return {
@@ -3365,37 +3262,37 @@ function hr(e) {
3365
3262
  height: e.clientHeight
3366
3263
  };
3367
3264
  }
3368
- function gr(e) {
3369
- return e.reduce((e, t) => mn(e, ur(t)), In);
3265
+ function pr(e) {
3266
+ return e.reduce((e, t) => dn(e, sr(t)), Nn);
3370
3267
  }
3371
- function _r(e) {
3372
- return e.reduce((e, t) => e + cr(t), 0);
3268
+ function mr(e) {
3269
+ return e.reduce((e, t) => e + ar(t), 0);
3373
3270
  }
3374
- function vr(e) {
3375
- return e.reduce((e, t) => e + lr(t), 0);
3271
+ function hr(e) {
3272
+ return e.reduce((e, t) => e + or(t), 0);
3376
3273
  }
3377
- function yr(e, t) {
3378
- if (t === void 0 && (t = er), !e) return;
3274
+ function gr(e, t) {
3275
+ if (t === void 0 && (t = Zn), !e) return;
3379
3276
  let { top: n, left: r, bottom: i, right: a } = t(e);
3380
- or(e) && (i <= 0 || a <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
3277
+ rr(e) && (i <= 0 || a <= 0 || n >= window.innerHeight || r >= window.innerWidth) && e.scrollIntoView({
3381
3278
  block: "center",
3382
3279
  inline: "center"
3383
3280
  });
3384
3281
  }
3385
- var br = [[
3282
+ var _r = [[
3386
3283
  "x",
3387
3284
  ["left", "right"],
3388
- _r
3285
+ mr
3389
3286
  ], [
3390
3287
  "y",
3391
3288
  ["top", "bottom"],
3392
- vr
3393
- ]], xr = class {
3289
+ hr
3290
+ ]], vr = class {
3394
3291
  constructor(e, t) {
3395
3292
  this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
3396
- let n = ar(t), r = gr(n);
3293
+ let n = nr(t), r = pr(n);
3397
3294
  this.rect = { ...e }, this.width = e.width, this.height = e.height;
3398
- for (let [e, t, i] of br) for (let a of t) Object.defineProperty(this, a, {
3295
+ for (let [e, t, i] of _r) for (let a of t) Object.defineProperty(this, a, {
3399
3296
  get: () => {
3400
3297
  let t = i(n), o = r[e] - t;
3401
3298
  return this.rect[a] + o;
@@ -3404,7 +3301,7 @@ var br = [[
3404
3301
  });
3405
3302
  Object.defineProperty(this, "rect", { enumerable: !1 });
3406
3303
  }
3407
- }, Sr = class {
3304
+ }, yr = class {
3408
3305
  constructor(e) {
3409
3306
  this.target = void 0, this.listeners = [], this.removeAll = () => {
3410
3307
  this.listeners.forEach((e) => this.target?.removeEventListener(...e));
@@ -3419,29 +3316,29 @@ var br = [[
3419
3316
  ]);
3420
3317
  }
3421
3318
  };
3422
- function Cr(e) {
3423
- let { EventTarget: t } = Qt(e);
3424
- return e instanceof t ? e : nn(e);
3319
+ function br(e) {
3320
+ let { EventTarget: t } = Yt(e);
3321
+ return e instanceof t ? e : $t(e);
3425
3322
  }
3426
- function wr(e, t) {
3323
+ function xr(e, t) {
3427
3324
  let n = Math.abs(e.x), r = Math.abs(e.y);
3428
3325
  return typeof t == "number" ? Math.sqrt(n ** 2 + r ** 2) > t : "x" in t && "y" in t ? n > t.x && r > t.y : "x" in t ? n > t.x : "y" in t ? r > t.y : !1;
3429
3326
  }
3430
- var Tr;
3327
+ var Sr;
3431
3328
  (function(e) {
3432
3329
  e.Click = "click", e.DragStart = "dragstart", e.Keydown = "keydown", e.ContextMenu = "contextmenu", e.Resize = "resize", e.SelectionChange = "selectionchange", e.VisibilityChange = "visibilitychange";
3433
- })(Tr ||= {});
3434
- function Er(e) {
3330
+ })(Sr ||= {});
3331
+ function Cr(e) {
3435
3332
  e.preventDefault();
3436
3333
  }
3437
- function Dr(e) {
3334
+ function wr(e) {
3438
3335
  e.stopPropagation();
3439
3336
  }
3440
3337
  var X;
3441
3338
  (function(e) {
3442
3339
  e.Space = "Space", e.Down = "ArrowDown", e.Right = "ArrowRight", e.Left = "ArrowLeft", e.Up = "ArrowUp", e.Esc = "Escape", e.Enter = "Enter", e.Tab = "Tab";
3443
3340
  })(X ||= {});
3444
- var Or = {
3341
+ var Tr = {
3445
3342
  start: [X.Space, X.Enter],
3446
3343
  cancel: [X.Esc],
3447
3344
  end: [
@@ -3449,7 +3346,7 @@ var Or = {
3449
3346
  X.Enter,
3450
3347
  X.Tab
3451
3348
  ]
3452
- }, kr = (e, t) => {
3349
+ }, Er = (e, t) => {
3453
3350
  let { currentCoordinates: n } = t;
3454
3351
  switch (e.code) {
3455
3352
  case X.Right: return {
@@ -3469,22 +3366,22 @@ var Or = {
3469
3366
  y: n.y - 25
3470
3367
  };
3471
3368
  }
3472
- }, Ar = class {
3369
+ }, Dr = class {
3473
3370
  constructor(e) {
3474
3371
  this.props = void 0, this.autoScrollEnabled = !1, this.referenceCoordinates = void 0, this.listeners = void 0, this.windowListeners = void 0, this.props = e;
3475
3372
  let { event: { target: t } } = e;
3476
- this.props = e, this.listeners = new Sr(nn(t)), this.windowListeners = new Sr(Qt(t)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
3373
+ this.props = e, this.listeners = new yr($t(t)), this.windowListeners = new yr(Yt(t)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
3477
3374
  }
3478
3375
  attach() {
3479
- this.handleStart(), this.windowListeners.add(Tr.Resize, this.handleCancel), this.windowListeners.add(Tr.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Tr.Keydown, this.handleKeyDown));
3376
+ this.handleStart(), this.windowListeners.add(Sr.Resize, this.handleCancel), this.windowListeners.add(Sr.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Sr.Keydown, this.handleKeyDown));
3480
3377
  }
3481
3378
  handleStart() {
3482
3379
  let { activeNode: e, onStart: t } = this.props, n = e.node.current;
3483
- n && yr(n), t(In);
3380
+ n && gr(n), t(Nn);
3484
3381
  }
3485
3382
  handleKeyDown(e) {
3486
- if (_n(e)) {
3487
- let { active: t, context: n, options: r } = this.props, { keyboardCodes: i = Or, coordinateGetter: a = kr, scrollBehavior: o = "smooth" } = r, { code: s } = e;
3383
+ if (mn(e)) {
3384
+ let { active: t, context: n, options: r } = this.props, { keyboardCodes: i = Tr, coordinateGetter: a = Er, scrollBehavior: o = "smooth" } = r, { code: s } = e;
3488
3385
  if (i.end.includes(s)) {
3489
3386
  this.handleEnd(e);
3490
3387
  return;
@@ -3496,7 +3393,7 @@ var Or = {
3496
3393
  let { collisionRect: c } = n.current, l = c ? {
3497
3394
  x: c.left,
3498
3395
  y: c.top
3499
- } : In;
3396
+ } : Nn;
3500
3397
  this.referenceCoordinates ||= l;
3501
3398
  let u = a(e, {
3502
3399
  active: t,
@@ -3504,12 +3401,12 @@ var Or = {
3504
3401
  currentCoordinates: l
3505
3402
  });
3506
3403
  if (u) {
3507
- let t = hn(u, l), r = {
3404
+ let t = fn(u, l), r = {
3508
3405
  x: 0,
3509
3406
  y: 0
3510
3407
  }, { scrollableAncestors: i } = n.current;
3511
3408
  for (let n of i) {
3512
- let i = e.code, { isTop: a, isRight: s, isLeft: c, isBottom: l, maxScroll: d, minScroll: f } = fr(n), p = hr(n), m = {
3409
+ let i = e.code, { isTop: a, isRight: s, isLeft: c, isBottom: l, maxScroll: d, minScroll: f } = lr(n), p = fr(n), m = {
3513
3410
  x: Math.min(i === X.Right ? p.right - p.width / 2 : p.right, Math.max(i === X.Right ? p.left : p.left + p.width / 2, u.x)),
3514
3411
  y: Math.min(i === X.Down ? p.bottom - p.height / 2 : p.bottom, Math.max(i === X.Down ? p.top : p.top + p.height / 2, u.y))
3515
3412
  }, h = i === X.Right && !s || i === X.Left && !c, g = i === X.Down && !l || i === X.Up && !a;
@@ -3543,7 +3440,7 @@ var Or = {
3543
3440
  break;
3544
3441
  }
3545
3442
  }
3546
- this.handleMove(e, mn(hn(u, this.referenceCoordinates), r));
3443
+ this.handleMove(e, dn(fn(u, this.referenceCoordinates), r));
3547
3444
  }
3548
3445
  }
3549
3446
  }
@@ -3563,10 +3460,10 @@ var Or = {
3563
3460
  this.listeners.removeAll(), this.windowListeners.removeAll();
3564
3461
  }
3565
3462
  };
3566
- Ar.activators = [{
3463
+ Dr.activators = [{
3567
3464
  eventName: "onKeyDown",
3568
3465
  handler: (e, t, n) => {
3569
- let { keyboardCodes: r = Or, onActivation: i } = t, { active: a } = n, { code: o } = e.nativeEvent;
3466
+ let { keyboardCodes: r = Tr, onActivation: i } = t, { active: a } = n, { code: o } = e.nativeEvent;
3570
3467
  if (r.start.includes(o)) {
3571
3468
  let t = a.activatorNode.current;
3572
3469
  return t && e.target !== t ? !1 : (e.preventDefault(), i?.({ event: e.nativeEvent }), !0);
@@ -3574,31 +3471,31 @@ Ar.activators = [{
3574
3471
  return !1;
3575
3472
  }
3576
3473
  }];
3577
- function jr(e) {
3474
+ function Or(e) {
3578
3475
  return !!(e && "distance" in e);
3579
3476
  }
3580
- function Mr(e) {
3477
+ function kr(e) {
3581
3478
  return !!(e && "delay" in e);
3582
3479
  }
3583
- var Nr = class {
3480
+ var Ar = class {
3584
3481
  constructor(e, t, n) {
3585
- n === void 0 && (n = Cr(e.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = e, this.events = t;
3482
+ n === void 0 && (n = br(e.event.target)), this.props = void 0, this.events = void 0, this.autoScrollEnabled = !0, this.document = void 0, this.activated = !1, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = e, this.events = t;
3586
3483
  let { event: r } = e, { target: i } = r;
3587
- this.props = e, this.events = t, this.document = nn(i), this.documentListeners = new Sr(this.document), this.listeners = new Sr(n), this.windowListeners = new Sr(Qt(i)), this.initialCoordinates = yn(r) ?? In, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
3484
+ this.props = e, this.events = t, this.document = $t(i), this.documentListeners = new yr(this.document), this.listeners = new yr(n), this.windowListeners = new yr(Yt(i)), this.initialCoordinates = gn(r) ?? Nn, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
3588
3485
  }
3589
3486
  attach() {
3590
3487
  let { events: e, props: { options: { activationConstraint: t, bypassActivationConstraint: n } } } = this;
3591
- if (this.listeners.add(e.move.name, this.handleMove, { passive: !1 }), this.listeners.add(e.end.name, this.handleEnd), e.cancel && this.listeners.add(e.cancel.name, this.handleCancel), this.windowListeners.add(Tr.Resize, this.handleCancel), this.windowListeners.add(Tr.DragStart, Er), this.windowListeners.add(Tr.VisibilityChange, this.handleCancel), this.windowListeners.add(Tr.ContextMenu, Er), this.documentListeners.add(Tr.Keydown, this.handleKeydown), t) {
3488
+ if (this.listeners.add(e.move.name, this.handleMove, { passive: !1 }), this.listeners.add(e.end.name, this.handleEnd), e.cancel && this.listeners.add(e.cancel.name, this.handleCancel), this.windowListeners.add(Sr.Resize, this.handleCancel), this.windowListeners.add(Sr.DragStart, Cr), this.windowListeners.add(Sr.VisibilityChange, this.handleCancel), this.windowListeners.add(Sr.ContextMenu, Cr), this.documentListeners.add(Sr.Keydown, this.handleKeydown), t) {
3592
3489
  if (n != null && n({
3593
3490
  event: this.props.event,
3594
3491
  activeNode: this.props.activeNode,
3595
3492
  options: this.props.options
3596
3493
  })) return this.handleStart();
3597
- if (Mr(t)) {
3494
+ if (kr(t)) {
3598
3495
  this.timeoutId = setTimeout(this.handleStart, t.delay), this.handlePending(t);
3599
3496
  return;
3600
3497
  }
3601
- if (jr(t)) {
3498
+ if (Or(t)) {
3602
3499
  this.handlePending(t);
3603
3500
  return;
3604
3501
  }
@@ -3614,18 +3511,18 @@ var Nr = class {
3614
3511
  }
3615
3512
  handleStart() {
3616
3513
  let { initialCoordinates: e } = this, { onStart: t } = this.props;
3617
- e && (this.activated = !0, this.documentListeners.add(Tr.Click, Dr, { capture: !0 }), this.removeTextSelection(), this.documentListeners.add(Tr.SelectionChange, this.removeTextSelection), t(e));
3514
+ e && (this.activated = !0, this.documentListeners.add(Sr.Click, wr, { capture: !0 }), this.removeTextSelection(), this.documentListeners.add(Sr.SelectionChange, this.removeTextSelection), t(e));
3618
3515
  }
3619
3516
  handleMove(e) {
3620
3517
  let { activated: t, initialCoordinates: n, props: r } = this, { onMove: i, options: { activationConstraint: a } } = r;
3621
3518
  if (!n) return;
3622
- let o = yn(e) ?? In, s = hn(n, o);
3519
+ let o = gn(e) ?? Nn, s = fn(n, o);
3623
3520
  if (!t && a) {
3624
- if (jr(a)) {
3625
- if (a.tolerance != null && wr(s, a.tolerance)) return this.handleCancel();
3626
- if (wr(s, a.distance)) return this.handleStart();
3521
+ if (Or(a)) {
3522
+ if (a.tolerance != null && xr(s, a.tolerance)) return this.handleCancel();
3523
+ if (xr(s, a.distance)) return this.handleStart();
3627
3524
  }
3628
- if (Mr(a) && wr(s, a.tolerance)) return this.handleCancel();
3525
+ if (kr(a) && xr(s, a.tolerance)) return this.handleCancel();
3629
3526
  this.handlePending(a, s);
3630
3527
  return;
3631
3528
  }
@@ -3646,80 +3543,80 @@ var Nr = class {
3646
3543
  var e;
3647
3544
  (e = this.document.getSelection()) == null || e.removeAllRanges();
3648
3545
  }
3649
- }, Pr = {
3546
+ }, jr = {
3650
3547
  cancel: { name: "pointercancel" },
3651
3548
  move: { name: "pointermove" },
3652
3549
  end: { name: "pointerup" }
3653
- }, Fr = class extends Nr {
3550
+ }, Mr = class extends Ar {
3654
3551
  constructor(e) {
3655
- let { event: t } = e, n = nn(t.target);
3656
- super(e, Pr, n);
3552
+ let { event: t } = e, n = $t(t.target);
3553
+ super(e, jr, n);
3657
3554
  }
3658
3555
  };
3659
- Fr.activators = [{
3556
+ Mr.activators = [{
3660
3557
  eventName: "onPointerDown",
3661
3558
  handler: (e, t) => {
3662
3559
  let { nativeEvent: n } = e, { onActivation: r } = t;
3663
3560
  return !n.isPrimary || n.button !== 0 ? !1 : (r?.({ event: n }), !0);
3664
3561
  }
3665
3562
  }];
3666
- var Ir = {
3563
+ var Nr = {
3667
3564
  move: { name: "mousemove" },
3668
3565
  end: { name: "mouseup" }
3669
- }, Lr;
3566
+ }, Pr;
3670
3567
  (function(e) {
3671
3568
  e[e.RightClick = 2] = "RightClick";
3672
- })(Lr ||= {});
3673
- var Rr = class extends Nr {
3569
+ })(Pr ||= {});
3570
+ var Fr = class extends Ar {
3674
3571
  constructor(e) {
3675
- super(e, Ir, nn(e.event.target));
3572
+ super(e, Nr, $t(e.event.target));
3676
3573
  }
3677
3574
  };
3678
- Rr.activators = [{
3575
+ Fr.activators = [{
3679
3576
  eventName: "onMouseDown",
3680
3577
  handler: (e, t) => {
3681
3578
  let { nativeEvent: n } = e, { onActivation: r } = t;
3682
- return n.button === Lr.RightClick ? !1 : (r?.({ event: n }), !0);
3579
+ return n.button === Pr.RightClick ? !1 : (r?.({ event: n }), !0);
3683
3580
  }
3684
3581
  }];
3685
- var zr = {
3582
+ var Ir = {
3686
3583
  cancel: { name: "touchcancel" },
3687
3584
  move: { name: "touchmove" },
3688
3585
  end: { name: "touchend" }
3689
- }, Br = class extends Nr {
3586
+ }, Lr = class extends Ar {
3690
3587
  constructor(e) {
3691
- super(e, zr);
3588
+ super(e, Ir);
3692
3589
  }
3693
3590
  static setup() {
3694
- return window.addEventListener(zr.move.name, e, {
3591
+ return window.addEventListener(Ir.move.name, e, {
3695
3592
  capture: !1,
3696
3593
  passive: !1
3697
3594
  }), function() {
3698
- window.removeEventListener(zr.move.name, e);
3595
+ window.removeEventListener(Ir.move.name, e);
3699
3596
  };
3700
3597
  function e() {}
3701
3598
  }
3702
3599
  };
3703
- Br.activators = [{
3600
+ Lr.activators = [{
3704
3601
  eventName: "onTouchStart",
3705
3602
  handler: (e, t) => {
3706
3603
  let { nativeEvent: n } = e, { onActivation: r } = t, { touches: i } = n;
3707
3604
  return i.length > 1 ? !1 : (r?.({ event: n }), !0);
3708
3605
  }
3709
3606
  }];
3710
- var Vr;
3607
+ var Rr;
3711
3608
  (function(e) {
3712
3609
  e[e.Pointer = 0] = "Pointer", e[e.DraggableRect = 1] = "DraggableRect";
3713
- })(Vr ||= {});
3714
- var Hr;
3610
+ })(Rr ||= {});
3611
+ var zr;
3715
3612
  (function(e) {
3716
3613
  e[e.TreeOrder = 0] = "TreeOrder", e[e.ReversedTreeOrder = 1] = "ReversedTreeOrder";
3717
- })(Hr ||= {});
3718
- function Ur(e) {
3719
- let { acceleration: t, activator: n = Vr.Pointer, canScroll: r, draggingRect: i, enabled: o, interval: c = 5, order: u = Hr.TreeOrder, pointerCoordinates: f, scrollableAncestors: p, scrollableAncestorRects: m, delta: h, threshold: g } = e, _ = Gr({
3614
+ })(zr ||= {});
3615
+ function Br(e) {
3616
+ let { acceleration: t, activator: n = Rr.Pointer, canScroll: r, draggingRect: i, enabled: o, interval: c = 5, order: u = zr.TreeOrder, pointerCoordinates: f, scrollableAncestors: p, scrollableAncestorRects: m, delta: h, threshold: g } = e, _ = Hr({
3720
3617
  delta: h,
3721
3618
  disabled: !o
3722
- }), [v, y] = on(), b = d({
3619
+ }), [v, y] = nn(), b = d({
3723
3620
  x: 0,
3724
3621
  y: 0
3725
3622
  }), x = d({
@@ -3727,13 +3624,13 @@ function Ur(e) {
3727
3624
  y: 0
3728
3625
  }), S = l(() => {
3729
3626
  switch (n) {
3730
- case Vr.Pointer: return f ? {
3627
+ case Rr.Pointer: return f ? {
3731
3628
  top: f.y,
3732
3629
  bottom: f.y,
3733
3630
  left: f.x,
3734
3631
  right: f.x
3735
3632
  } : null;
3736
- case Vr.DraggableRect: return i;
3633
+ case Rr.DraggableRect: return i;
3737
3634
  }
3738
3635
  }, [
3739
3636
  n,
@@ -3744,7 +3641,7 @@ function Ur(e) {
3744
3641
  if (!e) return;
3745
3642
  let t = b.current.x * x.current.x, n = b.current.y * x.current.y;
3746
3643
  e.scrollBy(t, n);
3747
- }, []), T = l(() => u === Hr.TreeOrder ? [...p].reverse() : p, [u, p]);
3644
+ }, []), T = l(() => u === zr.TreeOrder ? [...p].reverse() : p, [u, p]);
3748
3645
  s(() => {
3749
3646
  if (!o || !p.length || !S) {
3750
3647
  y();
@@ -3754,7 +3651,7 @@ function Ur(e) {
3754
3651
  if (r?.(e) === !1) continue;
3755
3652
  let n = p.indexOf(e), i = m[n];
3756
3653
  if (!i) continue;
3757
- let { direction: a, speed: o } = mr(e, i, S, t, g);
3654
+ let { direction: a, speed: o } = dr(e, i, S, t, g);
3758
3655
  for (let e of ["x", "y"]) _[e][a[e]] || (o[e] = 0, a[e] = 0);
3759
3656
  if (o.x > 0 || o.y > 0) {
3760
3657
  y(), C.current = e, v(w, c), b.current = o, x.current = a;
@@ -3784,7 +3681,7 @@ function Ur(e) {
3784
3681
  JSON.stringify(g)
3785
3682
  ]);
3786
3683
  }
3787
- var Wr = {
3684
+ var Vr = {
3788
3685
  x: {
3789
3686
  [Y.Backward]: !1,
3790
3687
  [Y.Forward]: !1
@@ -3794,10 +3691,10 @@ var Wr = {
3794
3691
  [Y.Forward]: !1
3795
3692
  }
3796
3693
  };
3797
- function Gr(e) {
3798
- let { delta: t, disabled: n } = e, r = un(t);
3799
- return cn((e) => {
3800
- if (n || !r || !e) return Wr;
3694
+ function Hr(e) {
3695
+ let { delta: t, disabled: n } = e, r = sn(t);
3696
+ return an((e) => {
3697
+ if (n || !r || !e) return Vr;
3801
3698
  let i = {
3802
3699
  x: Math.sign(t.x - r.x),
3803
3700
  y: Math.sign(t.y - r.y)
@@ -3818,11 +3715,11 @@ function Gr(e) {
3818
3715
  r
3819
3716
  ]);
3820
3717
  }
3821
- function Kr(e, t) {
3718
+ function Ur(e, t) {
3822
3719
  let n = t == null ? void 0 : e.get(t), r = n ? n.node.current : null;
3823
- return cn((e) => t == null ? null : r ?? e ?? null, [r, t]);
3720
+ return an((e) => t == null ? null : r ?? e ?? null, [r, t]);
3824
3721
  }
3825
- function qr(e, t) {
3722
+ function Wr(e, t) {
3826
3723
  return l(() => e.reduce((e, n) => {
3827
3724
  let { sensor: r } = n, i = r.activators.map((e) => ({
3828
3725
  eventName: e.eventName,
@@ -3831,21 +3728,21 @@ function qr(e, t) {
3831
3728
  return [...e, ...i];
3832
3729
  }, []), [e, t]);
3833
3730
  }
3834
- var Jr;
3731
+ var Gr;
3835
3732
  (function(e) {
3836
3733
  e[e.Always = 0] = "Always", e[e.BeforeDragging = 1] = "BeforeDragging", e[e.WhileDragging = 2] = "WhileDragging";
3837
- })(Jr ||= {});
3838
- var Yr;
3734
+ })(Gr ||= {});
3735
+ var Kr;
3839
3736
  (function(e) {
3840
3737
  e.Optimized = "optimized";
3841
- })(Yr ||= {});
3842
- var Xr = /*#__PURE__*/ new Map();
3843
- function Zr(e, t) {
3844
- let { dragging: n, dependencies: r, config: i } = t, [o, c] = f(null), { frequency: l, measure: u, strategy: p } = i, m = d(e), h = b(), g = sn(h), _ = a(function(e) {
3738
+ })(Kr ||= {});
3739
+ var qr = /*#__PURE__*/ new Map();
3740
+ function Jr(e, t) {
3741
+ let { dragging: n, dependencies: r, config: i } = t, [o, c] = f(null), { frequency: l, measure: u, strategy: p } = i, m = d(e), h = b(), g = rn(h), _ = a(function(e) {
3845
3742
  e === void 0 && (e = []), !g.current && c((t) => t === null ? e : t.concat(e.filter((e) => !t.includes(e))));
3846
- }, [g]), v = d(null), y = cn((t) => {
3847
- if (h && !n) return Xr;
3848
- if (!t || t === Xr || m.current !== e || o != null) {
3743
+ }, [g]), v = d(null), y = an((t) => {
3744
+ if (h && !n) return qr;
3745
+ if (!t || t === qr || m.current !== e || o != null) {
3849
3746
  let t = /* @__PURE__ */ new Map();
3850
3747
  for (let n of e) {
3851
3748
  if (!n) continue;
@@ -3853,7 +3750,7 @@ function Zr(e, t) {
3853
3750
  t.set(n.id, n.rect.current);
3854
3751
  continue;
3855
3752
  }
3856
- let e = n.node.current, r = e ? new xr(u(e), e) : null;
3753
+ let e = n.node.current, r = e ? new vr(u(e), e) : null;
3857
3754
  n.rect.current = r, r && t.set(n.id, r);
3858
3755
  }
3859
3756
  return t;
@@ -3888,39 +3785,39 @@ function Zr(e, t) {
3888
3785
  };
3889
3786
  function b() {
3890
3787
  switch (p) {
3891
- case Jr.Always: return !1;
3892
- case Jr.BeforeDragging: return n;
3788
+ case Gr.Always: return !1;
3789
+ case Gr.BeforeDragging: return n;
3893
3790
  default: return !n;
3894
3791
  }
3895
3792
  }
3896
3793
  }
3897
- function Qr(e, t) {
3898
- return cn((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
3794
+ function Yr(e, t) {
3795
+ return an((n) => e ? n || (typeof t == "function" ? t(e) : e) : null, [t, e]);
3899
3796
  }
3900
- function $r(e, t) {
3901
- return Qr(e, t);
3797
+ function Xr(e, t) {
3798
+ return Yr(e, t);
3902
3799
  }
3903
- function ei(e) {
3904
- let { callback: t, disabled: n } = e, r = an(t), i = l(() => {
3800
+ function Zr(e) {
3801
+ let { callback: t, disabled: n } = e, r = tn(t), i = l(() => {
3905
3802
  if (n || typeof window > "u" || window.MutationObserver === void 0) return;
3906
3803
  let { MutationObserver: e } = window;
3907
3804
  return new e(r);
3908
3805
  }, [r, n]);
3909
3806
  return s(() => () => i?.disconnect(), [i]), i;
3910
3807
  }
3911
- function ti(e) {
3912
- let { callback: t, disabled: n } = e, r = an(t), i = l(() => {
3808
+ function Qr(e) {
3809
+ let { callback: t, disabled: n } = e, r = tn(t), i = l(() => {
3913
3810
  if (n || typeof window > "u" || window.ResizeObserver === void 0) return;
3914
3811
  let { ResizeObserver: e } = window;
3915
3812
  return new e(r);
3916
3813
  }, [n]);
3917
3814
  return s(() => () => i?.disconnect(), [i]), i;
3918
3815
  }
3919
- function ni(e) {
3920
- return new xr(er(e), e);
3816
+ function $r(e) {
3817
+ return new vr(Zn(e), e);
3921
3818
  }
3922
- function ri(e, t, n) {
3923
- t === void 0 && (t = ni);
3819
+ function ei(e, t, n) {
3820
+ t === void 0 && (t = $r);
3924
3821
  let [r, i] = f(null);
3925
3822
  function a() {
3926
3823
  i((r) => {
@@ -3930,7 +3827,7 @@ function ri(e, t, n) {
3930
3827
  return JSON.stringify(r) === JSON.stringify(i) ? r : i;
3931
3828
  });
3932
3829
  }
3933
- let o = ei({ callback(t) {
3830
+ let o = Zr({ callback(t) {
3934
3831
  if (e) for (let n of t) {
3935
3832
  let { type: t, target: r } = n;
3936
3833
  if (t === "childList" && r instanceof HTMLElement && r.contains(e)) {
@@ -3938,36 +3835,36 @@ function ri(e, t, n) {
3938
3835
  break;
3939
3836
  }
3940
3837
  }
3941
- } }), s = ti({ callback: a });
3942
- return rn(() => {
3838
+ } }), s = Qr({ callback: a });
3839
+ return en(() => {
3943
3840
  a(), e ? (s?.observe(e), o?.observe(document.body, {
3944
3841
  childList: !0,
3945
3842
  subtree: !0
3946
3843
  })) : (s?.disconnect(), o?.disconnect());
3947
3844
  }, [e]), r;
3948
3845
  }
3949
- function ii(e) {
3950
- return Jn(e, Qr(e));
3846
+ function ti(e) {
3847
+ return Gn(e, Yr(e));
3951
3848
  }
3952
- var ai = [];
3953
- function oi(e) {
3954
- let t = d(e), n = cn((n) => e ? n && n !== ai && e && t.current && e.parentNode === t.current.parentNode ? n : ar(e) : ai, [e]);
3849
+ var ni = [];
3850
+ function ri(e) {
3851
+ let t = d(e), n = an((n) => e ? n && n !== ni && e && t.current && e.parentNode === t.current.parentNode ? n : nr(e) : ni, [e]);
3955
3852
  return s(() => {
3956
3853
  t.current = e;
3957
3854
  }, [e]), n;
3958
3855
  }
3959
- function si(e) {
3856
+ function ii(e) {
3960
3857
  let [t, n] = f(null), r = d(e), i = a((e) => {
3961
- let t = sr(e.target);
3962
- t && n((e) => e ? (e.set(t, ur(t)), new Map(e)) : null);
3858
+ let t = ir(e.target);
3859
+ t && n((e) => e ? (e.set(t, sr(t)), new Map(e)) : null);
3963
3860
  }, []);
3964
3861
  return s(() => {
3965
3862
  let t = r.current;
3966
3863
  if (e !== t) {
3967
3864
  a(t);
3968
3865
  let o = e.map((e) => {
3969
- let t = sr(e);
3970
- return t ? (t.addEventListener("scroll", i, { passive: !0 }), [t, ur(t)]) : null;
3866
+ let t = ir(e);
3867
+ return t ? (t.addEventListener("scroll", i, { passive: !0 }), [t, sr(t)]) : null;
3971
3868
  }).filter((e) => e != null);
3972
3869
  n(o.length ? new Map(o) : null), r.current = e;
3973
3870
  }
@@ -3976,24 +3873,24 @@ function si(e) {
3976
3873
  };
3977
3874
  function a(e) {
3978
3875
  e.forEach((e) => {
3979
- sr(e)?.removeEventListener("scroll", i);
3876
+ ir(e)?.removeEventListener("scroll", i);
3980
3877
  });
3981
3878
  }
3982
- }, [i, e]), l(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => mn(e, t), In) : gr(e) : In, [e, t]);
3879
+ }, [i, e]), l(() => e.length ? t ? Array.from(t.values()).reduce((e, t) => dn(e, t), Nn) : pr(e) : Nn, [e, t]);
3983
3880
  }
3984
- function ci(e, t) {
3881
+ function ai(e, t) {
3985
3882
  t === void 0 && (t = []);
3986
3883
  let n = d(null);
3987
3884
  return s(() => {
3988
3885
  n.current = null;
3989
3886
  }, t), s(() => {
3990
- let t = e !== In;
3887
+ let t = e !== Nn;
3991
3888
  t && !n.current && (n.current = e), !t && n.current && (n.current = null);
3992
- }, [e]), n.current ? hn(e, n.current) : In;
3889
+ }, [e]), n.current ? fn(e, n.current) : Nn;
3993
3890
  }
3994
- function li(e) {
3891
+ function oi(e) {
3995
3892
  s(() => {
3996
- if (!Yt) return;
3893
+ if (!Kt) return;
3997
3894
  let t = e.map((e) => {
3998
3895
  let { sensor: t } = e;
3999
3896
  return t.setup == null ? void 0 : t.setup();
@@ -4006,7 +3903,7 @@ function li(e) {
4006
3903
  return t;
4007
3904
  }));
4008
3905
  }
4009
- function ui(e, t) {
3906
+ function si(e, t) {
4010
3907
  return l(() => e.reduce((e, n) => {
4011
3908
  let { eventName: r, handler: i } = n;
4012
3909
  return e[r] = (e) => {
@@ -4014,30 +3911,30 @@ function ui(e, t) {
4014
3911
  }, e;
4015
3912
  }, {}), [e, t]);
4016
3913
  }
4017
- function di(e) {
4018
- return l(() => e ? nr(e) : null, [e]);
3914
+ function ci(e) {
3915
+ return l(() => e ? $n(e) : null, [e]);
4019
3916
  }
4020
- var fi = [];
4021
- function pi(e, t) {
4022
- t === void 0 && (t = er);
4023
- let [n] = e, r = di(n ? Qt(n) : null), [i, a] = f(fi);
3917
+ var li = [];
3918
+ function ui(e, t) {
3919
+ t === void 0 && (t = Zn);
3920
+ let [n] = e, r = ci(n ? Yt(n) : null), [i, a] = f(li);
4024
3921
  function o() {
4025
- a(() => e.length ? e.map((e) => dr(e) ? r : new xr(t(e), e)) : fi);
3922
+ a(() => e.length ? e.map((e) => cr(e) ? r : new vr(t(e), e)) : li);
4026
3923
  }
4027
- let s = ti({ callback: o });
4028
- return rn(() => {
3924
+ let s = Qr({ callback: o });
3925
+ return en(() => {
4029
3926
  s?.disconnect(), o(), e.forEach((e) => s?.observe(e));
4030
3927
  }, [e]), i;
4031
3928
  }
4032
- function mi(e) {
3929
+ function di(e) {
4033
3930
  if (!e) return null;
4034
3931
  if (e.children.length > 1) return e;
4035
3932
  let t = e.children[0];
4036
- return en(t) ? t : e;
3933
+ return Zt(t) ? t : e;
4037
3934
  }
4038
- function hi(e) {
4039
- let { measure: t } = e, [n, r] = f(null), i = ti({ callback: a((e) => {
4040
- for (let { target: n } of e) if (en(n)) {
3935
+ function fi(e) {
3936
+ let { measure: t } = e, [n, r] = f(null), i = Qr({ callback: a((e) => {
3937
+ for (let { target: n } of e) if (Zt(n)) {
4041
3938
  r((e) => {
4042
3939
  let r = t(n);
4043
3940
  return e ? {
@@ -4048,8 +3945,8 @@ function hi(e) {
4048
3945
  });
4049
3946
  break;
4050
3947
  }
4051
- }, [t]) }), [o, s] = ln(a((e) => {
4052
- let n = mi(e);
3948
+ }, [t]) }), [o, s] = on(a((e) => {
3949
+ let n = di(e);
4053
3950
  i?.disconnect(), n && i?.observe(n), r(n ? t(n) : null);
4054
3951
  }, [t, i]));
4055
3952
  return l(() => ({
@@ -4062,21 +3959,21 @@ function hi(e) {
4062
3959
  s
4063
3960
  ]);
4064
3961
  }
4065
- var gi = [{
4066
- sensor: Fr,
3962
+ var pi = [{
3963
+ sensor: Mr,
4067
3964
  options: {}
4068
3965
  }, {
4069
- sensor: Ar,
3966
+ sensor: Dr,
4070
3967
  options: {}
4071
- }], _i = { current: {} }, vi = {
4072
- draggable: { measure: tr },
3968
+ }], mi = { current: {} }, hi = {
3969
+ draggable: { measure: Qn },
4073
3970
  droppable: {
4074
- measure: tr,
4075
- strategy: Jr.WhileDragging,
4076
- frequency: Yr.Optimized
3971
+ measure: Qn,
3972
+ strategy: Gr.WhileDragging,
3973
+ frequency: Kr.Optimized
4077
3974
  },
4078
- dragOverlay: { measure: er }
4079
- }, yi = class extends Map {
3975
+ dragOverlay: { measure: Zn }
3976
+ }, gi = class extends Map {
4080
3977
  get(e) {
4081
3978
  return e == null ? void 0 : super.get(e) ?? void 0;
4082
3979
  }
@@ -4092,7 +3989,7 @@ var gi = [{
4092
3989
  getNodeFor(e) {
4093
3990
  return this.get(e)?.node.current ?? void 0;
4094
3991
  }
4095
- }, bi = {
3992
+ }, _i = {
4096
3993
  activatorEvent: null,
4097
3994
  active: null,
4098
3995
  activeNode: null,
@@ -4101,31 +3998,31 @@ var gi = [{
4101
3998
  containerNodeRect: null,
4102
3999
  draggableNodes: /*#__PURE__*/ new Map(),
4103
4000
  droppableRects: /*#__PURE__*/ new Map(),
4104
- droppableContainers: /*#__PURE__*/ new yi(),
4001
+ droppableContainers: /*#__PURE__*/ new gi(),
4105
4002
  over: null,
4106
4003
  dragOverlay: {
4107
4004
  nodeRef: { current: null },
4108
4005
  rect: null,
4109
- setRef: Nn
4006
+ setRef: An
4110
4007
  },
4111
4008
  scrollableAncestors: [],
4112
4009
  scrollableAncestorRects: [],
4113
- measuringConfiguration: vi,
4114
- measureDroppableContainers: Nn,
4010
+ measuringConfiguration: hi,
4011
+ measureDroppableContainers: An,
4115
4012
  windowRect: null,
4116
4013
  measuringScheduled: !1
4117
- }, xi = /*#__PURE__*/ n({
4014
+ }, vi = /*#__PURE__*/ n({
4118
4015
  activatorEvent: null,
4119
4016
  activators: [],
4120
4017
  active: null,
4121
4018
  activeNodeRect: null,
4122
4019
  ariaDescribedById: { draggable: "" },
4123
- dispatch: Nn,
4020
+ dispatch: An,
4124
4021
  draggableNodes: /*#__PURE__*/ new Map(),
4125
4022
  over: null,
4126
- measureDroppableContainers: Nn
4127
- }), Si = /*#__PURE__*/ n(bi);
4128
- function Ci() {
4023
+ measureDroppableContainers: An
4024
+ }), yi = /*#__PURE__*/ n(_i);
4025
+ function bi() {
4129
4026
  return {
4130
4027
  draggable: {
4131
4028
  active: null,
@@ -4139,10 +4036,10 @@ function Ci() {
4139
4036
  y: 0
4140
4037
  }
4141
4038
  },
4142
- droppable: { containers: new yi() }
4039
+ droppable: { containers: new gi() }
4143
4040
  };
4144
4041
  }
4145
- function wi(e, t) {
4042
+ function xi(e, t) {
4146
4043
  switch (t.type) {
4147
4044
  case J.DragStart: return {
4148
4045
  ...e,
@@ -4179,7 +4076,7 @@ function wi(e, t) {
4179
4076
  }
4180
4077
  };
4181
4078
  case J.RegisterDroppable: {
4182
- let { element: n } = t, { id: r } = n, i = new yi(e.droppable.containers);
4079
+ let { element: n } = t, { id: r } = n, i = new gi(e.droppable.containers);
4183
4080
  return i.set(r, n), {
4184
4081
  ...e,
4185
4082
  droppable: {
@@ -4191,7 +4088,7 @@ function wi(e, t) {
4191
4088
  case J.SetDroppableDisabled: {
4192
4089
  let { id: n, key: r, disabled: i } = t, a = e.droppable.containers.get(n);
4193
4090
  if (!a || r !== a.key) return e;
4194
- let o = new yi(e.droppable.containers);
4091
+ let o = new gi(e.droppable.containers);
4195
4092
  return o.set(n, {
4196
4093
  ...a,
4197
4094
  disabled: i
@@ -4206,7 +4103,7 @@ function wi(e, t) {
4206
4103
  case J.UnregisterDroppable: {
4207
4104
  let { id: n, key: r } = t, i = e.droppable.containers.get(n);
4208
4105
  if (!i || r !== i.key) return e;
4209
- let a = new yi(e.droppable.containers);
4106
+ let a = new gi(e.droppable.containers);
4210
4107
  return a.delete(n), {
4211
4108
  ...e,
4212
4109
  droppable: {
@@ -4218,11 +4115,11 @@ function wi(e, t) {
4218
4115
  default: return e;
4219
4116
  }
4220
4117
  }
4221
- function Ti(e) {
4222
- let { disabled: t } = e, { active: n, activatorEvent: r, draggableNodes: i } = o(xi), a = un(r), c = un(n?.id);
4118
+ function Si(e) {
4119
+ let { disabled: t } = e, { active: n, activatorEvent: r, draggableNodes: i } = o(vi), a = sn(r), c = sn(n?.id);
4223
4120
  return s(() => {
4224
4121
  if (!t && !r && a && c != null) {
4225
- if (!_n(a) || document.activeElement === a.target) return;
4122
+ if (!mn(a) || document.activeElement === a.target) return;
4226
4123
  let e = i.get(c);
4227
4124
  if (!e) return;
4228
4125
  let { activatorNode: t, node: n } = e;
@@ -4230,7 +4127,7 @@ function Ti(e) {
4230
4127
  requestAnimationFrame(() => {
4231
4128
  for (let e of [t.current, n.current]) {
4232
4129
  if (!e) continue;
4233
- let t = Sn(e);
4130
+ let t = yn(e);
4234
4131
  if (t) {
4235
4132
  t.focus();
4236
4133
  break;
@@ -4246,25 +4143,25 @@ function Ti(e) {
4246
4143
  a
4247
4144
  ]), null;
4248
4145
  }
4249
- function Ei(e, t) {
4146
+ function Ci(e, t) {
4250
4147
  let { transform: n, ...r } = t;
4251
4148
  return e != null && e.length ? e.reduce((e, t) => t({
4252
4149
  transform: e,
4253
4150
  ...r
4254
4151
  }), n) : n;
4255
4152
  }
4256
- function Di(e) {
4153
+ function wi(e) {
4257
4154
  return l(() => ({
4258
4155
  draggable: {
4259
- ...vi.draggable,
4156
+ ...hi.draggable,
4260
4157
  ...e?.draggable
4261
4158
  },
4262
4159
  droppable: {
4263
- ...vi.droppable,
4160
+ ...hi.droppable,
4264
4161
  ...e?.droppable
4265
4162
  },
4266
4163
  dragOverlay: {
4267
- ...vi.dragOverlay,
4164
+ ...hi.dragOverlay,
4268
4165
  ...e?.dragOverlay
4269
4166
  }
4270
4167
  }), [
@@ -4273,12 +4170,12 @@ function Di(e) {
4273
4170
  e?.dragOverlay
4274
4171
  ]);
4275
4172
  }
4276
- function Oi(e) {
4173
+ function Ti(e) {
4277
4174
  let { activeNode: t, measure: n, initialRect: r, config: i = !0 } = e, a = d(!1), { x: o, y: s } = typeof i == "boolean" ? {
4278
4175
  x: i,
4279
4176
  y: i
4280
4177
  } : i;
4281
- rn(() => {
4178
+ en(() => {
4282
4179
  if (!o && !s || !t) {
4283
4180
  a.current = !1;
4284
4181
  return;
@@ -4286,9 +4183,9 @@ function Oi(e) {
4286
4183
  if (a.current || !r) return;
4287
4184
  let e = t?.node.current;
4288
4185
  if (!e || e.isConnected === !1) return;
4289
- let i = Jn(n(e), r);
4186
+ let i = Gn(n(e), r);
4290
4187
  if (o || (i.x = 0), s || (i.y = 0), a.current = !0, Math.abs(i.x) > 0 || Math.abs(i.y) > 0) {
4291
- let t = or(e);
4188
+ let t = rr(e);
4292
4189
  t && t.scrollBy({
4293
4190
  top: i.y,
4294
4191
  left: i.x
@@ -4302,34 +4199,34 @@ function Oi(e) {
4302
4199
  n
4303
4200
  ]);
4304
4201
  }
4305
- var ki = /*#__PURE__*/ n({
4306
- ...In,
4202
+ var Ei = /*#__PURE__*/ n({
4203
+ ...Nn,
4307
4204
  scaleX: 1,
4308
4205
  scaleY: 1
4309
- }), Ai;
4206
+ }), Di;
4310
4207
  (function(e) {
4311
4208
  e[e.Uninitialized = 0] = "Uninitialized", e[e.Initializing = 1] = "Initializing", e[e.Initialized = 2] = "Initialized";
4312
- })(Ai ||= {});
4313
- var ji = /*#__PURE__*/ i(function(e) {
4314
- let { id: n, accessibility: r, autoScroll: i = !0, children: o, sensors: c = gi, collisionDetection: p = Kn, measuring: m, modifiers: h, ...g } = e, [_, v] = u(wi, void 0, Ci), [y, b] = kn(), [x, S] = f(Ai.Uninitialized), C = x === Ai.Initialized, { draggable: { active: w, nodes: T, translate: ee }, droppable: { containers: te } } = _, ne = w == null ? null : T.get(w), re = d({
4209
+ })(Di ||= {});
4210
+ var Oi = /*#__PURE__*/ i(function(e) {
4211
+ let { id: n, accessibility: r, autoScroll: i = !0, children: o, sensors: c = pi, collisionDetection: p = Un, measuring: m, modifiers: h, ...g } = e, [_, v] = u(xi, void 0, bi), [y, b] = En(), [x, S] = f(Di.Uninitialized), C = x === Di.Initialized, { draggable: { active: w, nodes: T, translate: ee }, droppable: { containers: te } } = _, ne = w == null ? null : T.get(w), re = d({
4315
4212
  initial: null,
4316
4213
  translated: null
4317
4214
  }), ie = l(() => w == null ? null : {
4318
4215
  id: w,
4319
- data: ne?.data ?? _i,
4216
+ data: ne?.data ?? mi,
4320
4217
  rect: re
4321
- }, [w, ne]), ae = d(null), [oe, se] = f(null), [ce, le] = f(null), ue = sn(g, Object.values(g)), de = fn("DndDescribedBy", n), fe = l(() => te.getEnabled(), [te]), pe = Di(m), { droppableRects: me, measureDroppableContainers: he, measuringScheduled: ge } = Zr(fe, {
4218
+ }, [w, ne]), ae = d(null), [oe, se] = f(null), [ce, le] = f(null), ue = rn(g, Object.values(g)), de = ln("DndDescribedBy", n), fe = l(() => te.getEnabled(), [te]), pe = wi(m), { droppableRects: me, measureDroppableContainers: he, measuringScheduled: ge } = Jr(fe, {
4322
4219
  dragging: C,
4323
4220
  dependencies: [ee.x, ee.y],
4324
4221
  config: pe.droppable
4325
- }), E = Kr(T, w), _e = l(() => ce ? yn(ce) : null, [ce]), ve = Ve(), ye = $r(E, pe.draggable.measure);
4326
- Oi({
4222
+ }), E = Ur(T, w), _e = l(() => ce ? gn(ce) : null, [ce]), ve = Ve(), ye = Xr(E, pe.draggable.measure);
4223
+ Ti({
4327
4224
  activeNode: w == null ? null : T.get(w),
4328
4225
  config: ve.layoutShiftCompensation,
4329
4226
  initialRect: ye,
4330
4227
  measure: pe.draggable.measure
4331
4228
  });
4332
- let D = ri(E, pe.draggable.measure, ye), O = ri(E ? E.parentElement : null), be = d({
4229
+ let D = ei(E, pe.draggable.measure, ye), O = ei(E ? E.parentElement : null), be = d({
4333
4230
  activatorEvent: null,
4334
4231
  active: null,
4335
4232
  activeNode: E,
@@ -4343,7 +4240,7 @@ var ji = /*#__PURE__*/ i(function(e) {
4343
4240
  over: null,
4344
4241
  scrollableAncestors: [],
4345
4242
  scrollAdjustedTranslate: null
4346
- }), xe = te.getNodeFor(be.current.over?.id), Se = hi({ measure: pe.dragOverlay.measure }), Ce = Se.nodeRef.current ?? E, we = C ? Se.rect ?? D : null, k = !!(Se.nodeRef.current && Se.rect), A = ii(k ? null : D), j = di(Ce ? Qt(Ce) : null), Te = oi(C ? xe ?? E : null), De = pi(Te), Oe = Ei(h, {
4243
+ }), xe = te.getNodeFor(be.current.over?.id), Se = fi({ measure: pe.dragOverlay.measure }), Ce = Se.nodeRef.current ?? E, we = C ? Se.rect ?? D : null, k = !!(Se.nodeRef.current && Se.rect), A = ti(k ? null : D), j = ci(Ce ? Yt(Ce) : null), Te = ri(C ? xe ?? E : null), De = ui(Te), Oe = Ci(h, {
4347
4244
  transform: {
4348
4245
  x: ee.x - A.x,
4349
4246
  y: ee.y - A.y,
@@ -4360,13 +4257,13 @@ var ji = /*#__PURE__*/ i(function(e) {
4360
4257
  scrollableAncestors: Te,
4361
4258
  scrollableAncestorRects: De,
4362
4259
  windowRect: j
4363
- }), ke = _e ? mn(_e, ee) : null, Ae = si(Te), je = ci(Ae), Me = ci(Ae, [D]), Ne = mn(Oe, je), M = we ? Xn(we, Oe) : null, N = ie && M ? p({
4260
+ }), ke = _e ? dn(_e, ee) : null, Ae = ii(Te), je = ai(Ae), Me = ai(Ae, [D]), Ne = dn(Oe, je), M = we ? qn(we, Oe) : null, N = ie && M ? p({
4364
4261
  active: ie,
4365
4262
  collisionRect: M,
4366
4263
  droppableRects: me,
4367
4264
  droppableContainers: fe,
4368
4265
  pointerCoordinates: ke
4369
- }) : null, P = Vn(N, "id"), [Pe, F] = f(null), Fe = qn(k ? Oe : mn(Oe, Me), Pe?.rect ?? null, D), Ie = d(null), Le = a((e, t) => {
4266
+ }) : null, P = Rn(N, "id"), [Pe, F] = f(null), Fe = Wn(k ? Oe : dn(Oe, Me), Pe?.rect ?? null, D), Ie = d(null), Le = a((e, t) => {
4370
4267
  let { sensor: n, options: r } = t;
4371
4268
  if (ae.current == null) return;
4372
4269
  let i = T.get(ae.current);
@@ -4412,7 +4309,7 @@ var ji = /*#__PURE__*/ i(function(e) {
4412
4309
  }
4413
4310
  };
4414
4311
  Ee(() => {
4415
- r?.(i), S(Ai.Initializing), v({
4312
+ r?.(i), S(Di.Initializing), v({
4416
4313
  type: J.DragStart,
4417
4314
  initialCoordinates: e,
4418
4315
  active: t
@@ -4446,7 +4343,7 @@ var ji = /*#__PURE__*/ i(function(e) {
4446
4343
  }, e === J.DragEnd && typeof s == "function" && await Promise.resolve(s(o)) && (e = J.DragCancel);
4447
4344
  }
4448
4345
  ae.current = null, Ee(() => {
4449
- v({ type: e }), S(Ai.Uninitialized), F(null), se(null), le(null), Ie.current = null;
4346
+ v({ type: e }), S(Di.Uninitialized), F(null), se(null), le(null), Ie.current = null;
4450
4347
  let t = e === J.DragEnd ? "onDragEnd" : "onDragCancel";
4451
4348
  if (o) {
4452
4349
  let e = ue.current[t];
@@ -4458,14 +4355,14 @@ var ji = /*#__PURE__*/ i(function(e) {
4458
4355
  });
4459
4356
  };
4460
4357
  }
4461
- }, [T]), Re = qr(c, a((e, t) => (n, r) => {
4358
+ }, [T]), Re = Wr(c, a((e, t) => (n, r) => {
4462
4359
  let i = n.nativeEvent, a = T.get(r);
4463
4360
  if (ae.current !== null || !a || i.dndKit || i.defaultPrevented) return;
4464
4361
  let o = { active: a };
4465
4362
  e(n, t.options, o) === !0 && (i.dndKit = { capturedBy: t.sensor }, ae.current = r, Le(n, t));
4466
4363
  }, [T, Le]));
4467
- li(c), rn(() => {
4468
- D && x === Ai.Initializing && S(Ai.Initialized);
4364
+ oi(c), en(() => {
4365
+ D && x === Di.Initializing && S(Di.Initialized);
4469
4366
  }, [D, x]), s(() => {
4470
4367
  let { onDragMove: e } = ue.current, { active: t, activatorEvent: n, collisions: r, over: i } = be.current;
4471
4368
  if (!t || !n) return;
@@ -4509,7 +4406,7 @@ var ji = /*#__PURE__*/ i(function(e) {
4509
4406
  event: c
4510
4407
  });
4511
4408
  });
4512
- }, [P]), rn(() => {
4409
+ }, [P]), en(() => {
4513
4410
  be.current = {
4514
4411
  activatorEvent: ce,
4515
4412
  active: ie,
@@ -4541,7 +4438,7 @@ var ji = /*#__PURE__*/ i(function(e) {
4541
4438
  Pe,
4542
4439
  Te,
4543
4440
  Ne
4544
- ]), Ur({
4441
+ ]), Br({
4545
4442
  ...ve,
4546
4443
  delta: ee,
4547
4444
  draggingRect: M,
@@ -4606,7 +4503,7 @@ var ji = /*#__PURE__*/ i(function(e) {
4606
4503
  Pe,
4607
4504
  he
4608
4505
  ]);
4609
- return t.createElement(Dn.Provider, { value: b }, t.createElement(xi.Provider, { value: Be }, t.createElement(Si.Provider, { value: ze }, t.createElement(ki.Provider, { value: Fe }, o)), t.createElement(Ti, { disabled: r?.restoreFocus === !1 })), t.createElement(Mn, {
4506
+ return t.createElement(wn.Provider, { value: b }, t.createElement(vi.Provider, { value: Be }, t.createElement(yi.Provider, { value: ze }, t.createElement(Ei.Provider, { value: Fe }, o)), t.createElement(Si, { disabled: r?.restoreFocus === !1 })), t.createElement(kn, {
4610
4507
  ...r,
4611
4508
  hiddenTextDescribedById: de
4612
4509
  }));
@@ -4617,10 +4514,10 @@ var ji = /*#__PURE__*/ i(function(e) {
4617
4514
  enabled: n
4618
4515
  } : { enabled: n };
4619
4516
  }
4620
- }), Mi = /*#__PURE__*/ n(null), Ni = "button", Pi = "Draggable";
4621
- function Fi(e) {
4622
- let { id: t, data: n, disabled: r = !1, attributes: i } = e, a = fn(Pi), { activators: s, activatorEvent: c, active: u, activeNodeRect: d, ariaDescribedById: f, draggableNodes: p, over: m } = o(xi), { role: h = Ni, roleDescription: g = "draggable", tabIndex: _ = 0 } = i ?? {}, v = u?.id === t, y = o(v ? ki : Mi), [b, x] = ln(), [S, C] = ln(), w = ui(s, t), T = sn(n);
4623
- return rn(() => (p.set(t, {
4517
+ }), ki = /*#__PURE__*/ n(null), Ai = "button", ji = "Draggable";
4518
+ function Mi(e) {
4519
+ let { id: t, data: n, disabled: r = !1, attributes: i } = e, a = ln(ji), { activators: s, activatorEvent: c, active: u, activeNodeRect: d, ariaDescribedById: f, draggableNodes: p, over: m } = o(vi), { role: h = Ai, roleDescription: g = "draggable", tabIndex: _ = 0 } = i ?? {}, v = u?.id === t, y = o(v ? Ei : ki), [b, x] = on(), [S, C] = on(), w = si(s, t), T = rn(n);
4520
+ return en(() => (p.set(t, {
4624
4521
  id: t,
4625
4522
  key: a,
4626
4523
  node: b,
@@ -4637,7 +4534,7 @@ function Fi(e) {
4637
4534
  role: h,
4638
4535
  tabIndex: _,
4639
4536
  "aria-disabled": r,
4640
- "aria-pressed": v && h === Ni ? !0 : void 0,
4537
+ "aria-pressed": v && h === Ai ? !0 : void 0,
4641
4538
  "aria-roledescription": g,
4642
4539
  "aria-describedby": f.draggable
4643
4540
  }), [
@@ -4657,15 +4554,15 @@ function Fi(e) {
4657
4554
  transform: y
4658
4555
  };
4659
4556
  }
4660
- function Ii() {
4661
- return o(Si);
4557
+ function Ni() {
4558
+ return o(yi);
4662
4559
  }
4663
- var Li = "Droppable", Ri = { timeout: 25 };
4664
- function zi(e) {
4665
- let { data: t, disabled: n = !1, id: r, resizeObserverConfig: i } = e, c = fn(Li), { active: l, dispatch: u, over: f, measureDroppableContainers: p } = o(xi), m = d({ disabled: n }), h = d(!1), g = d(null), _ = d(null), { disabled: v, updateMeasurementsFor: y, timeout: b } = {
4666
- ...Ri,
4560
+ var Pi = "Droppable", Fi = { timeout: 25 };
4561
+ function Ii(e) {
4562
+ let { data: t, disabled: n = !1, id: r, resizeObserverConfig: i } = e, c = ln(Pi), { active: l, dispatch: u, over: f, measureDroppableContainers: p } = o(vi), m = d({ disabled: n }), h = d(!1), g = d(null), _ = d(null), { disabled: v, updateMeasurementsFor: y, timeout: b } = {
4563
+ ...Fi,
4667
4564
  ...i
4668
- }, x = sn(y ?? r), S = ti({
4565
+ }, x = rn(y ?? r), S = Qr({
4669
4566
  callback: a(() => {
4670
4567
  if (!h.current) {
4671
4568
  h.current = !0;
@@ -4676,9 +4573,9 @@ function zi(e) {
4676
4573
  }, b);
4677
4574
  }, [b]),
4678
4575
  disabled: v || !l
4679
- }), [C, w] = ln(a((e, t) => {
4576
+ }), [C, w] = on(a((e, t) => {
4680
4577
  S && (t && (S.unobserve(t), h.current = !1), e && S.observe(e));
4681
- }, [S])), T = sn(t);
4578
+ }, [S])), T = rn(t);
4682
4579
  return s(() => {
4683
4580
  !S || !C.current || (S.disconnect(), h.current = !1, S.observe(C.current));
4684
4581
  }, [C, S]), s(() => (u({
@@ -4718,43 +4615,43 @@ function zi(e) {
4718
4615
  }
4719
4616
  //#endregion
4720
4617
  //#region node_modules/@dnd-kit/sortable/dist/sortable.esm.js
4721
- function Bi(e, t, n) {
4618
+ function Li(e, t, n) {
4722
4619
  let r = e.slice();
4723
4620
  return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
4724
4621
  }
4725
- function Vi(e, t) {
4622
+ function Ri(e, t) {
4726
4623
  return e.reduce((e, n, r) => {
4727
4624
  let i = t.get(n);
4728
4625
  return i && (e[r] = i), e;
4729
4626
  }, Array(e.length));
4730
4627
  }
4731
- function Hi(e) {
4628
+ function zi(e) {
4732
4629
  return e !== null && e >= 0;
4733
4630
  }
4734
- function Ui(e, t) {
4631
+ function Bi(e, t) {
4735
4632
  if (e === t) return !0;
4736
4633
  if (e.length !== t.length) return !1;
4737
4634
  for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
4738
4635
  return !0;
4739
4636
  }
4740
- function Wi(e) {
4637
+ function Vi(e) {
4741
4638
  return typeof e == "boolean" ? {
4742
4639
  draggable: e,
4743
4640
  droppable: e
4744
4641
  } : e;
4745
4642
  }
4746
- var Gi = (e) => {
4747
- let { rects: t, activeIndex: n, overIndex: r, index: i } = e, a = Bi(t, r, n), o = t[i], s = a[i];
4643
+ var Hi = (e) => {
4644
+ let { rects: t, activeIndex: n, overIndex: r, index: i } = e, a = Li(t, r, n), o = t[i], s = a[i];
4748
4645
  return !s || !o ? null : {
4749
4646
  x: s.left - o.left,
4750
4647
  y: s.top - o.top,
4751
4648
  scaleX: s.width / o.width,
4752
4649
  scaleY: s.height / o.height
4753
4650
  };
4754
- }, Ki = {
4651
+ }, Ui = {
4755
4652
  scaleX: 1,
4756
4653
  scaleY: 1
4757
- }, qi = (e) => {
4654
+ }, Wi = (e) => {
4758
4655
  let { activeIndex: t, activeNodeRect: n, index: r, rects: i, overIndex: a } = e, o = i[t] ?? n;
4759
4656
  if (!o) return null;
4760
4657
  if (r === t) {
@@ -4762,45 +4659,45 @@ var Gi = (e) => {
4762
4659
  return e ? {
4763
4660
  x: 0,
4764
4661
  y: t < a ? e.top + e.height - (o.top + o.height) : e.top - o.top,
4765
- ...Ki
4662
+ ...Ui
4766
4663
  } : null;
4767
4664
  }
4768
- let s = Ji(i, r, t);
4665
+ let s = Gi(i, r, t);
4769
4666
  return r > t && r <= a ? {
4770
4667
  x: 0,
4771
4668
  y: -o.height - s,
4772
- ...Ki
4669
+ ...Ui
4773
4670
  } : r < t && r >= a ? {
4774
4671
  x: 0,
4775
4672
  y: o.height + s,
4776
- ...Ki
4673
+ ...Ui
4777
4674
  } : {
4778
4675
  x: 0,
4779
4676
  y: 0,
4780
- ...Ki
4677
+ ...Ui
4781
4678
  };
4782
4679
  };
4783
- function Ji(e, t, n) {
4680
+ function Gi(e, t, n) {
4784
4681
  let r = e[t], i = e[t - 1], a = e[t + 1];
4785
4682
  return r ? n < t ? i ? r.top - (i.top + i.height) : a ? a.top - (r.top + r.height) : 0 : a ? a.top - (r.top + r.height) : i ? r.top - (i.top + i.height) : 0 : 0;
4786
4683
  }
4787
- var Yi = "Sortable", Xi = /*#__PURE__*/ t.createContext({
4684
+ var Ki = "Sortable", qi = /*#__PURE__*/ t.createContext({
4788
4685
  activeIndex: -1,
4789
- containerId: Yi,
4686
+ containerId: Ki,
4790
4687
  disableTransforms: !1,
4791
4688
  items: [],
4792
4689
  overIndex: -1,
4793
4690
  useDragOverlay: !1,
4794
4691
  sortedRects: [],
4795
- strategy: Gi,
4692
+ strategy: Hi,
4796
4693
  disabled: {
4797
4694
  draggable: !1,
4798
4695
  droppable: !1
4799
4696
  }
4800
4697
  });
4801
- function Zi(e) {
4802
- let { children: n, id: r, items: i, strategy: a = Gi, disabled: o = !1 } = e, { active: c, dragOverlay: u, droppableRects: f, over: p, measureDroppableContainers: m } = Ii(), h = fn(Yi, r), g = u.rect !== null, _ = l(() => i.map((e) => typeof e == "object" && "id" in e ? e.id : e), [i]), v = c != null, y = c ? _.indexOf(c.id) : -1, b = p ? _.indexOf(p.id) : -1, x = d(_), S = !Ui(_, x.current), C = b !== -1 && y === -1 || S, w = Wi(o);
4803
- rn(() => {
4698
+ function Ji(e) {
4699
+ let { children: n, id: r, items: i, strategy: a = Hi, disabled: o = !1 } = e, { active: c, dragOverlay: u, droppableRects: f, over: p, measureDroppableContainers: m } = Ni(), h = ln(Ki, r), g = u.rect !== null, _ = l(() => i.map((e) => typeof e == "object" && "id" in e ? e.id : e), [i]), v = c != null, y = c ? _.indexOf(c.id) : -1, b = p ? _.indexOf(p.id) : -1, x = d(_), S = !Bi(_, x.current), C = b !== -1 && y === -1 || S, w = Vi(o);
4700
+ en(() => {
4804
4701
  S && v && m(_);
4805
4702
  }, [
4806
4703
  S,
@@ -4818,7 +4715,7 @@ function Zi(e) {
4818
4715
  items: _,
4819
4716
  overIndex: b,
4820
4717
  useDragOverlay: g,
4821
- sortedRects: Vi(_, f),
4718
+ sortedRects: Ri(_, f),
4822
4719
  strategy: a
4823
4720
  }), [
4824
4721
  y,
@@ -4832,29 +4729,29 @@ function Zi(e) {
4832
4729
  g,
4833
4730
  a
4834
4731
  ]);
4835
- return t.createElement(Xi.Provider, { value: T }, n);
4732
+ return t.createElement(qi.Provider, { value: T }, n);
4836
4733
  }
4837
- var Qi = (e) => {
4734
+ var Yi = (e) => {
4838
4735
  let { id: t, items: n, activeIndex: r, overIndex: i } = e;
4839
- return Bi(n, r, i).indexOf(t);
4840
- }, $i = (e) => {
4736
+ return Li(n, r, i).indexOf(t);
4737
+ }, Xi = (e) => {
4841
4738
  let { containerId: t, isSorting: n, wasDragging: r, index: i, items: a, newIndex: o, previousItems: s, previousContainerId: c, transition: l } = e;
4842
4739
  return !l || !r || s !== a && i === o ? !1 : n ? !0 : o !== i && t === c;
4843
- }, ea = {
4740
+ }, Zi = {
4844
4741
  duration: 200,
4845
4742
  easing: "ease"
4846
- }, ta = "transform", na = /*#__PURE__*/ bn.Transition.toString({
4847
- property: ta,
4743
+ }, Qi = "transform", $i = /*#__PURE__*/ _n.Transition.toString({
4744
+ property: Qi,
4848
4745
  duration: 0,
4849
4746
  easing: "linear"
4850
- }), ra = { roleDescription: "sortable" };
4851
- function ia(e) {
4747
+ }), ea = { roleDescription: "sortable" };
4748
+ function ta(e) {
4852
4749
  let { disabled: t, index: n, node: r, rect: i } = e, [a, o] = f(null), c = d(n);
4853
- return rn(() => {
4750
+ return en(() => {
4854
4751
  if (!t && n !== c.current && r.current) {
4855
4752
  let e = i.current;
4856
4753
  if (e) {
4857
- let t = er(r.current, { ignoreTransform: !0 }), n = {
4754
+ let t = Zn(r.current, { ignoreTransform: !0 }), n = {
4858
4755
  x: e.left - t.left,
4859
4756
  y: e.top - t.top,
4860
4757
  scaleX: e.width / t.width,
@@ -4873,8 +4770,8 @@ function ia(e) {
4873
4770
  a && o(null);
4874
4771
  }, [a]), a;
4875
4772
  }
4876
- function aa(e) {
4877
- let { animateLayoutChanges: t = $i, attributes: n, disabled: r, data: i, getNewIndex: a = Qi, id: c, strategy: u, resizeObserverConfig: f, transition: p = ea } = e, { items: m, containerId: h, activeIndex: g, disabled: _, disableTransforms: v, sortedRects: y, overIndex: b, useDragOverlay: x, strategy: S } = o(Xi), C = oa(r, _), w = m.indexOf(c), T = l(() => ({
4773
+ function na(e) {
4774
+ let { animateLayoutChanges: t = Xi, attributes: n, disabled: r, data: i, getNewIndex: a = Yi, id: c, strategy: u, resizeObserverConfig: f, transition: p = Zi } = e, { items: m, containerId: h, activeIndex: g, disabled: _, disableTransforms: v, sortedRects: y, overIndex: b, useDragOverlay: x, strategy: S } = o(qi), C = ra(r, _), w = m.indexOf(c), T = l(() => ({
4878
4775
  sortable: {
4879
4776
  containerId: h,
4880
4777
  index: w,
@@ -4886,7 +4783,7 @@ function aa(e) {
4886
4783
  i,
4887
4784
  w,
4888
4785
  m
4889
- ]), ee = l(() => m.slice(m.indexOf(c)), [m, c]), { rect: te, node: ne, isOver: re, setNodeRef: ie } = zi({
4786
+ ]), ee = l(() => m.slice(m.indexOf(c)), [m, c]), { rect: te, node: ne, isOver: re, setNodeRef: ie } = Ii({
4890
4787
  id: c,
4891
4788
  data: T,
4892
4789
  disabled: C.droppable,
@@ -4894,21 +4791,21 @@ function aa(e) {
4894
4791
  updateMeasurementsFor: ee,
4895
4792
  ...f
4896
4793
  }
4897
- }), { active: ae, activatorEvent: oe, activeNodeRect: se, attributes: ce, setNodeRef: le, listeners: ue, isDragging: de, over: fe, setActivatorNodeRef: pe, transform: me } = Fi({
4794
+ }), { active: ae, activatorEvent: oe, activeNodeRect: se, attributes: ce, setNodeRef: le, listeners: ue, isDragging: de, over: fe, setActivatorNodeRef: pe, transform: me } = Mi({
4898
4795
  id: c,
4899
4796
  data: T,
4900
4797
  attributes: {
4901
- ...ra,
4798
+ ...ea,
4902
4799
  ...n
4903
4800
  },
4904
4801
  disabled: C.draggable
4905
- }), he = Jt(ie, le), ge = !!ae, E = ge && !v && Hi(g) && Hi(b), _e = !x && de, ve = E ? (_e && E ? me : null) ?? (u ?? S)({
4802
+ }), he = Gt(ie, le), ge = !!ae, E = ge && !v && zi(g) && zi(b), _e = !x && de, ve = E ? (_e && E ? me : null) ?? (u ?? S)({
4906
4803
  rects: y,
4907
4804
  activeNodeRect: se,
4908
4805
  activeIndex: g,
4909
4806
  overIndex: b,
4910
4807
  index: w
4911
- }) : null, ye = Hi(g) && Hi(b) ? a({
4808
+ }) : null, ye = zi(g) && zi(b) ? a({
4912
4809
  id: c,
4913
4810
  items: m,
4914
4811
  activeIndex: g,
@@ -4931,7 +4828,7 @@ function aa(e) {
4931
4828
  previousContainerId: O.current.containerId,
4932
4829
  transition: p,
4933
4830
  wasDragging: O.current.activeId != null
4934
- }), Se = ia({
4831
+ }), Se = ta({
4935
4832
  disabled: !xe,
4936
4833
  index: w,
4937
4834
  node: ne,
@@ -4978,14 +4875,14 @@ function aa(e) {
4978
4875
  transition: Ce()
4979
4876
  };
4980
4877
  function Ce() {
4981
- if (Se || be && O.current.newIndex === w) return na;
4982
- if (!(_e && !_n(oe) || !p) && (ge || xe)) return bn.Transition.toString({
4878
+ if (Se || be && O.current.newIndex === w) return $i;
4879
+ if (!(_e && !mn(oe) || !p) && (ge || xe)) return _n.Transition.toString({
4983
4880
  ...p,
4984
- property: ta
4881
+ property: Qi
4985
4882
  });
4986
4883
  }
4987
4884
  }
4988
- function oa(e, t) {
4885
+ function ra(e, t) {
4989
4886
  return typeof e == "boolean" ? {
4990
4887
  draggable: e,
4991
4888
  droppable: !1
@@ -4994,19 +4891,19 @@ function oa(e, t) {
4994
4891
  droppable: e?.droppable ?? t.droppable
4995
4892
  };
4996
4893
  }
4997
- function sa(e) {
4894
+ function ia(e) {
4998
4895
  if (!e) return !1;
4999
4896
  let t = e.data.current;
5000
4897
  return !!(t && "sortable" in t && typeof t.sortable == "object" && "containerId" in t.sortable && "items" in t.sortable && "index" in t.sortable);
5001
4898
  }
5002
- var ca = [
4899
+ var aa = [
5003
4900
  X.Down,
5004
4901
  X.Right,
5005
4902
  X.Up,
5006
4903
  X.Left
5007
- ], la = (e, t) => {
4904
+ ], oa = (e, t) => {
5008
4905
  let { context: { active: n, collisionRect: r, droppableRects: i, droppableContainers: a, over: o, scrollableAncestors: s } } = t;
5009
- if (ca.includes(e.code)) {
4906
+ if (aa.includes(e.code)) {
5010
4907
  if (e.preventDefault(), !n || !r) return;
5011
4908
  let t = [];
5012
4909
  a.getEnabled().forEach((n) => {
@@ -5027,17 +4924,17 @@ var ca = [
5027
4924
  break;
5028
4925
  }
5029
4926
  });
5030
- let c = Wn({
4927
+ let c = Vn({
5031
4928
  active: n,
5032
4929
  collisionRect: r,
5033
4930
  droppableRects: i,
5034
4931
  droppableContainers: t,
5035
4932
  pointerCoordinates: null
5036
- }), l = Vn(c, "id");
4933
+ }), l = Rn(c, "id");
5037
4934
  if (l === o?.id && c.length > 1 && (l = c[1].id), l != null) {
5038
4935
  let e = a.get(n.id), t = a.get(l), o = t ? i.get(t.id) : null, c = t?.node.current;
5039
4936
  if (c && o && e && t) {
5040
- let n = ar(c).some((e, t) => s[t] !== e), i = ua(e, t), a = da(e, t), l = n || !i ? {
4937
+ let n = nr(c).some((e, t) => s[t] !== e), i = sa(e, t), a = ca(e, t), l = n || !i ? {
5041
4938
  x: 0,
5042
4939
  y: 0
5043
4940
  } : {
@@ -5047,27 +4944,27 @@ var ca = [
5047
4944
  x: o.left,
5048
4945
  y: o.top
5049
4946
  };
5050
- return l.x && l.y ? u : hn(u, l);
4947
+ return l.x && l.y ? u : fn(u, l);
5051
4948
  }
5052
4949
  }
5053
4950
  }
5054
4951
  };
5055
- function ua(e, t) {
5056
- return !sa(e) || !sa(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
4952
+ function sa(e, t) {
4953
+ return !ia(e) || !ia(t) ? !1 : e.data.current.sortable.containerId === t.data.current.sortable.containerId;
5057
4954
  }
5058
- function da(e, t) {
5059
- return !sa(e) || !sa(t) || !ua(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
4955
+ function ca(e, t) {
4956
+ return !ia(e) || !ia(t) || !sa(e, t) ? !1 : e.data.current.sortable.index < t.data.current.sortable.index;
5060
4957
  }
5061
4958
  //#endregion
5062
4959
  //#region src/editor/Canvas.tsx
5063
- var fa = 375;
5064
- function pa(e) {
4960
+ var la = 375;
4961
+ function ua(e) {
5065
4962
  let t = e.replace("#", "");
5066
4963
  if (t.length !== 3 && t.length !== 6) return e === "white" || e === "#fff" || e === "#ffffff";
5067
4964
  let n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t, r = parseInt(n.slice(0, 2), 16) / 255, i = parseInt(n.slice(2, 4), 16) / 255, a = parseInt(n.slice(4, 6), 16) / 255;
5068
4965
  return .2126 * r + .7152 * i + .0722 * a > .82;
5069
4966
  }
5070
- function ma(e, t) {
4967
+ function da(e, t) {
5071
4968
  let n = e ?? {};
5072
4969
  if (t !== "mobile") return n;
5073
4970
  let r = n.mobile ?? {};
@@ -5076,8 +4973,8 @@ function ma(e, t) {
5076
4973
  ...r
5077
4974
  };
5078
4975
  }
5079
- function ha() {
5080
- let { doc: e, selection: t, setSelection: n, reorderModules: r, deleteModule: i, duplicateModule: a, deleteElement: o, moveElement: c, viewMode: l } = I(), u = Fn(Pn(Fr, { activationConstraint: { distance: 5 } }), Pn(Ar, { coordinateGetter: la })), d = (t) => {
4976
+ function fa() {
4977
+ let { doc: e, selection: t, setSelection: n, reorderModules: r, deleteModule: i, duplicateModule: a, deleteElement: o, moveElement: c, viewMode: l } = I(), u = Mn(jn(Mr, { activationConstraint: { distance: 5 } }), jn(Dr, { coordinateGetter: oa })), d = (t) => {
5081
4978
  let { active: n, over: i } = t;
5082
4979
  if (!i || n.id === i.id) return;
5083
4980
  let a = e.modules.findIndex((e) => e.id === n.id), o = e.modules.findIndex((e) => e.id === i.id);
@@ -5095,7 +4992,7 @@ function ha() {
5095
4992
  i,
5096
4993
  o
5097
4994
  ]);
5098
- let f = Ne(e.settings.backgroundColor, e.theme), p = Ne(e.settings.contentBackgroundColor, e.theme), m = e.modules.map((e) => e.id), h = l === "mobile" ? fa : e.settings.width;
4995
+ let f = Ne(e.settings.backgroundColor, e.theme), p = Ne(e.settings.contentBackgroundColor, e.theme), m = e.modules.map((e) => e.id), h = l === "mobile" ? la : e.settings.width;
5099
4996
  return /* @__PURE__ */ A("div", {
5100
4997
  className: "flex-1 overflow-y-auto",
5101
4998
  style: { background: f },
@@ -5113,14 +5010,14 @@ function ha() {
5113
5010
  children: [e.modules.length === 0 && /* @__PURE__ */ A("div", {
5114
5011
  className: "p-12 text-center text-gray-400 text-sm",
5115
5012
  children: "Add modules from the left sidebar to start building your email."
5116
- }), /* @__PURE__ */ A(ji, {
5013
+ }), /* @__PURE__ */ A(Oi, {
5117
5014
  sensors: u,
5118
- collisionDetection: Un,
5015
+ collisionDetection: Bn,
5119
5016
  onDragEnd: d,
5120
- children: /* @__PURE__ */ A(Zi, {
5017
+ children: /* @__PURE__ */ A(Ji, {
5121
5018
  items: m,
5122
- strategy: qi,
5123
- children: e.modules.map((r, o) => /* @__PURE__ */ A(ga, {
5019
+ strategy: Wi,
5020
+ children: e.modules.map((r, o) => /* @__PURE__ */ A(pa, {
5124
5021
  mod: r,
5125
5022
  index: o,
5126
5023
  viewMode: l,
@@ -5145,18 +5042,18 @@ function ha() {
5145
5042
  })
5146
5043
  });
5147
5044
  }
5148
- function ga(e) {
5149
- let { attributes: t, listeners: n, setNodeRef: r, transform: i, transition: a, isDragging: o } = aa({ id: e.mod.id });
5045
+ function pa(e) {
5046
+ let { attributes: t, listeners: n, setNodeRef: r, transform: i, transition: a, isDragging: o } = na({ id: e.mod.id });
5150
5047
  return /* @__PURE__ */ A("div", {
5151
5048
  ref: r,
5152
5049
  style: {
5153
- transform: bn.Transform.toString(i),
5050
+ transform: _n.Transform.toString(i),
5154
5051
  transition: a,
5155
5052
  opacity: o ? .5 : 1,
5156
5053
  position: "relative",
5157
5054
  zIndex: e.selected ? 10 : "auto"
5158
5055
  },
5159
- children: /* @__PURE__ */ A(_a, {
5056
+ children: /* @__PURE__ */ A(ma, {
5160
5057
  mod: e.mod,
5161
5058
  viewMode: e.viewMode,
5162
5059
  selected: e.selected,
@@ -5172,15 +5069,15 @@ function ga(e) {
5172
5069
  className: "bg-blue-600 text-white p-1 rounded cursor-grab active:cursor-grabbing",
5173
5070
  title: "Drag to reorder",
5174
5071
  onClick: (e) => e.stopPropagation(),
5175
- children: /* @__PURE__ */ A(ee, { size: 14 })
5072
+ children: /* @__PURE__ */ A(te, { size: 14 })
5176
5073
  })
5177
5074
  })
5178
5075
  });
5179
5076
  }
5180
- function _a({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSelectModule: a, onSelectElement: o, onDuplicate: s, onDelete: c, dragHandle: l }) {
5077
+ function ma({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSelectModule: a, onSelectElement: o, onDuplicate: s, onDelete: c, dragHandle: l }) {
5181
5078
  let u = e.style ?? {};
5182
5079
  if (u.hideOn === t) return null;
5183
- let d = M(ma(u, t), i), [p, m] = f(!1);
5080
+ let d = M(da(u, t), i), [p, m] = f(!1);
5184
5081
  return /* @__PURE__ */ j("div", {
5185
5082
  style: {
5186
5083
  backgroundColor: d.backgroundColor,
@@ -5215,7 +5112,7 @@ function _a({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSele
5215
5112
  },
5216
5113
  className: "text-white p-1 rounded hover:bg-blue-700",
5217
5114
  title: "Duplicate",
5218
- children: /* @__PURE__ */ A(S, { size: 14 })
5115
+ children: /* @__PURE__ */ A(C, { size: 14 })
5219
5116
  }),
5220
5117
  /* @__PURE__ */ A("button", {
5221
5118
  onClick: (e) => {
@@ -5231,7 +5128,7 @@ function _a({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSele
5231
5128
  })
5232
5129
  ]
5233
5130
  }),
5234
- e.children.map((s, c) => /* @__PURE__ */ A(va, {
5131
+ e.children.map((s, c) => /* @__PURE__ */ A(ha, {
5235
5132
  el: s,
5236
5133
  index: c,
5237
5134
  totalElements: e.children.length,
@@ -5246,7 +5143,7 @@ function _a({ mod: e, viewMode: t, selected: n, selectionEl: r, theme: i, onSele
5246
5143
  ]
5247
5144
  });
5248
5145
  }
5249
- function va({ el: e, index: t, totalElements: n, viewMode: r, theme: i, moduleId: a, moduleSelected: o, selected: s, onSelect: c, onSelectModule: l }) {
5146
+ function ha({ el: e, index: t, totalElements: n, viewMode: r, theme: i, moduleId: a, moduleSelected: o, selected: s, onSelect: c, onSelectModule: l }) {
5250
5147
  let u = I((e) => e.moveElement), d = I((e) => e.deleteElement);
5251
5148
  if (e.style?.hideOn === r) return null;
5252
5149
  let f = {
@@ -5300,37 +5197,37 @@ function va({ el: e, index: t, totalElements: n, viewMode: r, theme: i, moduleId
5300
5197
  children: [m, e]
5301
5198
  });
5302
5199
  switch (e.type) {
5303
- case "text": return h(/* @__PURE__ */ A(ya, {
5200
+ case "text": return h(/* @__PURE__ */ A(ga, {
5304
5201
  el: e,
5305
5202
  viewMode: r,
5306
5203
  theme: i,
5307
5204
  moduleId: a
5308
5205
  }));
5309
- case "image": return h(/* @__PURE__ */ A(ba, {
5206
+ case "image": return h(/* @__PURE__ */ A(_a, {
5310
5207
  el: e,
5311
5208
  viewMode: r,
5312
5209
  theme: i
5313
5210
  }));
5314
- case "button": return h(/* @__PURE__ */ A(xa, {
5211
+ case "button": return h(/* @__PURE__ */ A(va, {
5315
5212
  el: e,
5316
5213
  viewMode: r,
5317
5214
  theme: i
5318
5215
  }));
5319
- case "spacer": return h(/* @__PURE__ */ A(Sa, { el: e }));
5320
- case "divider": return h(/* @__PURE__ */ A(Ca, {
5216
+ case "spacer": return h(/* @__PURE__ */ A(ya, { el: e }));
5217
+ case "divider": return h(/* @__PURE__ */ A(ba, {
5321
5218
  el: e,
5322
5219
  viewMode: r,
5323
5220
  theme: i
5324
5221
  }));
5325
- case "productGrid": return h(/* @__PURE__ */ A(wa, {
5222
+ case "productGrid": return h(/* @__PURE__ */ A(xa, {
5326
5223
  el: e,
5327
5224
  viewMode: r,
5328
5225
  theme: i
5329
5226
  }));
5330
5227
  }
5331
5228
  }
5332
- function ya({ el: e, viewMode: t, theme: n, moduleId: r }) {
5333
- let i = I((e) => e.updateElement), a = M(ma(e.style, t), n), o = a.color ?? "#000000", s = pa(o);
5229
+ function ga({ el: e, viewMode: t, theme: n, moduleId: r }) {
5230
+ let i = I((e) => e.updateElement), a = M(da(e.style, t), n), o = a.color ?? "#000000", s = ua(o);
5334
5231
  return /* @__PURE__ */ A("div", {
5335
5232
  style: {
5336
5233
  fontFamily: a.fontFamily,
@@ -5357,8 +5254,8 @@ function ya({ el: e, viewMode: t, theme: n, moduleId: r }) {
5357
5254
  dangerouslySetInnerHTML: { __html: e.content }
5358
5255
  });
5359
5256
  }
5360
- function ba({ el: e, viewMode: t, theme: n }) {
5361
- let r = M(ma(e.style, t), n), i = {
5257
+ function _a({ el: e, viewMode: t, theme: n }) {
5258
+ let r = M(da(e.style, t), n), i = {
5362
5259
  textAlign: r.align ?? "center",
5363
5260
  paddingTop: r.paddingTop ?? 0,
5364
5261
  paddingBottom: r.paddingBottom ?? 0,
@@ -5380,8 +5277,8 @@ function ba({ el: e, viewMode: t, theme: n }) {
5380
5277
  })
5381
5278
  });
5382
5279
  }
5383
- function xa({ el: e, viewMode: t, theme: n }) {
5384
- let r = M(ma(e.style, t), n);
5280
+ function va({ el: e, viewMode: t, theme: n }) {
5281
+ let r = M(da(e.style, t), n);
5385
5282
  return /* @__PURE__ */ A("div", {
5386
5283
  style: {
5387
5284
  textAlign: r.align ?? "center",
@@ -5406,14 +5303,14 @@ function xa({ el: e, viewMode: t, theme: n }) {
5406
5303
  })
5407
5304
  });
5408
5305
  }
5409
- function Sa({ el: e }) {
5306
+ function ya({ el: e }) {
5410
5307
  return /* @__PURE__ */ A("div", { style: {
5411
5308
  height: e.height,
5412
5309
  background: "rgba(0,0,0,0.02)"
5413
5310
  } });
5414
5311
  }
5415
- function Ca({ el: e, viewMode: t, theme: n }) {
5416
- let r = M(ma(e.style, t), n);
5312
+ function ba({ el: e, viewMode: t, theme: n }) {
5313
+ let r = M(da(e.style, t), n);
5417
5314
  return /* @__PURE__ */ A("div", {
5418
5315
  style: {
5419
5316
  paddingTop: r.paddingTop ?? 8,
@@ -5426,8 +5323,8 @@ function Ca({ el: e, viewMode: t, theme: n }) {
5426
5323
  } })
5427
5324
  });
5428
5325
  }
5429
- function wa({ el: e, viewMode: t, theme: n }) {
5430
- let r = M(ma(e.style, t), n), i = t === "mobile", a = e.columns, o = r.cardBackgroundColor ?? r.backgroundColor ?? "transparent", s = r.nameColor ?? "#111827", c = r.finalPriceColor ?? "#3A7D52", l = r.oldPriceColor ?? "#9CA3AF", u = r.buttonBackgroundColor ?? "#3A7D52", d = r.buttonColor ?? "#FFFFFF", f = r.borderRadius ?? 0;
5326
+ function xa({ el: e, viewMode: t, theme: n }) {
5327
+ let r = M(da(e.style, t), n), i = t === "mobile", a = e.columns, o = r.cardBackgroundColor ?? r.backgroundColor ?? "transparent", s = r.nameColor ?? "#111827", c = r.finalPriceColor ?? "#3A7D52", l = r.oldPriceColor ?? "#9CA3AF", u = r.buttonBackgroundColor ?? "#3A7D52", d = r.buttonColor ?? "#FFFFFF", f = r.borderRadius ?? 0;
5431
5328
  return /* @__PURE__ */ A("div", {
5432
5329
  style: {
5433
5330
  paddingTop: r.paddingTop ?? 16,
@@ -5529,25 +5426,25 @@ function wa({ el: e, viewMode: t, theme: n }) {
5529
5426
  }
5530
5427
  //#endregion
5531
5428
  //#region src/core/plugins.ts
5532
- var Ta = [], Ea = null, Da = {
5533
- registerModule: (e) => _t.register(e),
5534
- registerTheme: (e) => Ta.push(e),
5429
+ var Sa = [], Ca = null, wa = {
5430
+ registerModule: (e) => yt.register(e),
5431
+ registerTheme: (e) => Sa.push(e),
5535
5432
  registerAssetProvider: (e) => {
5536
- Ea = e;
5433
+ Ca = e;
5537
5434
  },
5538
5435
  setAIProvider: (e) => {
5539
- wt(e);
5436
+ Tt(e);
5540
5437
  }
5541
5438
  };
5542
- function Oa(e) {
5543
- e.setup(Da);
5439
+ function Ta(e) {
5440
+ e.setup(wa);
5544
5441
  }
5545
- function ka() {
5546
- return Ea;
5442
+ function Ea() {
5443
+ return Ca;
5547
5444
  }
5548
5445
  //#endregion
5549
5446
  //#region src/recommendations/logic.ts
5550
- var Aa = {
5447
+ var Da = {
5551
5448
  key: "days",
5552
5449
  label: "Time window",
5553
5450
  type: "select",
@@ -5566,7 +5463,7 @@ var Aa = {
5566
5463
  label: "Last 30 days"
5567
5464
  }
5568
5465
  ]
5569
- }, ja = [
5466
+ }, Oa = [
5570
5467
  {
5571
5468
  id: "abandoned-cart",
5572
5469
  label: "Abandoned basket products",
@@ -5576,19 +5473,19 @@ var Aa = {
5576
5473
  id: "bestseller-conversion",
5577
5474
  label: "Best seller by Conversion",
5578
5475
  group: "catalog",
5579
- params: [Aa]
5476
+ params: [Da]
5580
5477
  },
5581
5478
  {
5582
5479
  id: "bestseller-units",
5583
5480
  label: "Best seller by Units",
5584
5481
  group: "catalog",
5585
- params: [Aa]
5482
+ params: [Da]
5586
5483
  },
5587
5484
  {
5588
5485
  id: "new-products",
5589
5486
  label: "New items added",
5590
5487
  group: "catalog",
5591
- params: [Aa]
5488
+ params: [Da]
5592
5489
  },
5593
5490
  {
5594
5491
  id: "cross-sell",
@@ -5650,7 +5547,7 @@ var Aa = {
5650
5547
  label: "Similar items",
5651
5548
  group: "contextual"
5652
5549
  }
5653
- ], Ma = Object.fromEntries(ja.map((e) => [e.id, e])), Na = [
5550
+ ], ka = Object.fromEntries(Oa.map((e) => [e.id, e])), Aa = [
5654
5551
  {
5655
5552
  value: "smart-reccs",
5656
5553
  label: "Smart Recommendations",
@@ -5672,7 +5569,7 @@ var Aa = {
5672
5569
  description: "Don't render the email if the slot can't be filled."
5673
5570
  }
5674
5571
  ];
5675
- function Pa(e = 2) {
5572
+ function ja(e = 2) {
5676
5573
  return {
5677
5574
  mode: "recommender",
5678
5575
  noProducts: e,
@@ -5696,21 +5593,21 @@ function Pa(e = 2) {
5696
5593
  }
5697
5594
  };
5698
5595
  }
5699
- function Fa(e) {
5596
+ function Ma(e) {
5700
5597
  if (!e) return null;
5701
5598
  let t = e.recommendations;
5702
5599
  return !t || typeof t != "object" ? null : t;
5703
5600
  }
5704
- function Ia(e) {
5601
+ function Na(e) {
5705
5602
  return e?.children ? e.children.some((e) => e.type === "productGrid") : !1;
5706
5603
  }
5707
- function La(e) {
5604
+ function Pa(e) {
5708
5605
  if (!e?.children) return 0;
5709
5606
  let t = 0;
5710
5607
  for (let n of e.children) n.type === "productGrid" && (t += n.products.length);
5711
5608
  return t;
5712
5609
  }
5713
- function Ra(e) {
5610
+ function Fa(e) {
5714
5611
  return {
5715
5612
  params: {
5716
5613
  selection: e.mode === "manual" ? "manual" : "recommender",
@@ -5740,8 +5637,8 @@ function Ra(e) {
5740
5637
  }
5741
5638
  //#endregion
5742
5639
  //#region src/editor/RecommendationsPanel.tsx
5743
- function za({ mod: e }) {
5744
- let t = I((e) => e.updateModule), n = La(e) || 2, r = Fa(e.data) ?? Pa(n), i = (n) => {
5640
+ function Ia({ mod: e }) {
5641
+ let t = I((e) => e.updateModule), n = Pa(e) || 2, r = Ma(e.data) ?? ja(n), i = (n) => {
5745
5642
  let i = {
5746
5643
  ...r,
5747
5644
  ...n
@@ -5768,12 +5665,12 @@ function za({ mod: e }) {
5768
5665
  className: "p-3 bg-white border-b border-blue-100",
5769
5666
  children: /* @__PURE__ */ j("div", {
5770
5667
  className: "grid grid-cols-2 gap-2",
5771
- children: [/* @__PURE__ */ A(Ua, {
5668
+ children: [/* @__PURE__ */ A(Ba, {
5772
5669
  active: r.mode === "manual",
5773
5670
  title: "Select Items",
5774
5671
  subtitle: "Hand-pick from a feed",
5775
5672
  onClick: () => i({ mode: "manual" })
5776
- }), /* @__PURE__ */ A(Ua, {
5673
+ }), /* @__PURE__ */ A(Ba, {
5777
5674
  active: r.mode === "recommender",
5778
5675
  title: "Recommender",
5779
5676
  subtitle: "Algorithms + filters",
@@ -5784,7 +5681,7 @@ function za({ mod: e }) {
5784
5681
  /* @__PURE__ */ j("div", {
5785
5682
  className: "p-3 bg-white space-y-3",
5786
5683
  children: [
5787
- /* @__PURE__ */ j(Ga, {
5684
+ /* @__PURE__ */ j(Ha, {
5788
5685
  label: "Number of products",
5789
5686
  children: [/* @__PURE__ */ A("input", {
5790
5687
  type: "number",
@@ -5792,7 +5689,7 @@ function za({ mod: e }) {
5792
5689
  max: 20,
5793
5690
  value: r.noProducts,
5794
5691
  onChange: (e) => i({ noProducts: Number(e.target.value) || 1 }),
5795
- className: Ha
5692
+ className: za
5796
5693
  }), /* @__PURE__ */ j("div", {
5797
5694
  className: "text-[11px] text-gray-500 mt-1",
5798
5695
  children: [
@@ -5804,10 +5701,10 @@ function za({ mod: e }) {
5804
5701
  ]
5805
5702
  })]
5806
5703
  }),
5807
- r.mode === "manual" ? /* @__PURE__ */ A(Ba, {
5704
+ r.mode === "manual" ? /* @__PURE__ */ A(La, {
5808
5705
  logic: r,
5809
5706
  update: i
5810
- }) : /* @__PURE__ */ A(Va, {
5707
+ }) : /* @__PURE__ */ A(Ra, {
5811
5708
  logic: r,
5812
5709
  update: i,
5813
5710
  updateFilters: (e) => i({ filters: {
@@ -5830,21 +5727,21 @@ function za({ mod: e }) {
5830
5727
  ]
5831
5728
  });
5832
5729
  }
5833
- function Ba({ logic: e, update: t }) {
5730
+ function La({ logic: e, update: t }) {
5834
5731
  return /* @__PURE__ */ j(k, { children: [
5835
- /* @__PURE__ */ A(Ga, {
5732
+ /* @__PURE__ */ A(Ha, {
5836
5733
  label: "Source feed",
5837
5734
  children: /* @__PURE__ */ A("input", {
5838
5735
  type: "text",
5839
5736
  placeholder: "e.g. main-catalog",
5840
5737
  value: e.sourceFeed ?? "",
5841
5738
  onChange: (e) => t({ sourceFeed: e.target.value }),
5842
- className: Ha
5739
+ className: za
5843
5740
  })
5844
5741
  }),
5845
- /* @__PURE__ */ A(Ga, {
5742
+ /* @__PURE__ */ A(Ha, {
5846
5743
  label: "Items to include (product IDs / SKUs)",
5847
- children: /* @__PURE__ */ A(Xa, {
5744
+ children: /* @__PURE__ */ A(qa, {
5848
5745
  value: e.manualProducts,
5849
5746
  onChange: (e) => t({ manualProducts: e }),
5850
5747
  placeholder: "Add product id"
@@ -5856,7 +5753,7 @@ function Ba({ logic: e, update: t }) {
5856
5753
  })
5857
5754
  ] });
5858
5755
  }
5859
- function Va({ logic: e, update: t, updateFilters: n }) {
5756
+ function Ra({ logic: e, update: t, updateFilters: n }) {
5860
5757
  let [r, i] = f(!1);
5861
5758
  return /* @__PURE__ */ j(k, { children: [
5862
5759
  /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ j("div", {
@@ -5868,72 +5765,72 @@ function Va({ logic: e, update: t, updateFilters: n }) {
5868
5765
  3,
5869
5766
  ")"
5870
5767
  ]
5871
- }), /* @__PURE__ */ A(Ya, {
5768
+ }), /* @__PURE__ */ A(Ka, {
5872
5769
  disabled: e.stack.length >= 3,
5873
5770
  existing: e.stack.map((e) => e.algorithm),
5874
5771
  onPick: (n) => t({ stack: [...e.stack, { algorithm: n }] })
5875
5772
  })]
5876
- }), /* @__PURE__ */ A(Ja, {
5773
+ }), /* @__PURE__ */ A(Ga, {
5877
5774
  stack: e.stack,
5878
5775
  onChange: (e) => t({ stack: e })
5879
5776
  })] }),
5880
- /* @__PURE__ */ j(Ga, {
5777
+ /* @__PURE__ */ j(Ha, {
5881
5778
  label: "Fallback",
5882
5779
  children: [/* @__PURE__ */ A("select", {
5883
5780
  value: e.fallback,
5884
5781
  onChange: (e) => t({ fallback: e.target.value }),
5885
- className: Ha,
5886
- children: Na.map((e) => /* @__PURE__ */ A("option", {
5782
+ className: za,
5783
+ children: Aa.map((e) => /* @__PURE__ */ A("option", {
5887
5784
  value: e.value,
5888
5785
  children: e.label
5889
5786
  }, e.value))
5890
5787
  }), /* @__PURE__ */ A("div", {
5891
5788
  className: "text-[11px] text-gray-500 mt-1",
5892
- children: Na.find((t) => t.value === e.fallback)?.description
5789
+ children: Aa.find((t) => t.value === e.fallback)?.description
5893
5790
  })]
5894
5791
  }),
5895
- /* @__PURE__ */ A(Wa, {
5792
+ /* @__PURE__ */ A(Va, {
5896
5793
  title: "Include & Exclude filters",
5897
5794
  right: /* @__PURE__ */ j("div", {
5898
5795
  className: "flex items-center gap-1",
5899
- children: [/* @__PURE__ */ A(Ka, {
5796
+ children: [/* @__PURE__ */ A(Ua, {
5900
5797
  active: !r,
5901
5798
  onClick: () => i(!1),
5902
5799
  children: "Basic"
5903
- }), /* @__PURE__ */ A(Ka, {
5800
+ }), /* @__PURE__ */ A(Ua, {
5904
5801
  active: r,
5905
5802
  onClick: () => i(!0),
5906
5803
  children: "Advanced"
5907
5804
  })]
5908
5805
  })
5909
5806
  }),
5910
- /* @__PURE__ */ A(Ga, {
5807
+ /* @__PURE__ */ A(Ha, {
5911
5808
  label: "Exclude products",
5912
- children: /* @__PURE__ */ A(Xa, {
5809
+ children: /* @__PURE__ */ A(qa, {
5913
5810
  value: e.filters.excludeProducts,
5914
5811
  onChange: (e) => n({ excludeProducts: e }),
5915
5812
  placeholder: "Add product id"
5916
5813
  })
5917
5814
  }),
5918
- /* @__PURE__ */ A(Ga, {
5815
+ /* @__PURE__ */ A(Ha, {
5919
5816
  label: "Include products",
5920
- children: /* @__PURE__ */ A(Xa, {
5817
+ children: /* @__PURE__ */ A(qa, {
5921
5818
  value: e.filters.includeProducts,
5922
5819
  onChange: (e) => n({ includeProducts: e }),
5923
5820
  placeholder: "Add product id"
5924
5821
  })
5925
5822
  }),
5926
- /* @__PURE__ */ A(Ga, {
5823
+ /* @__PURE__ */ A(Ha, {
5927
5824
  label: "Exclude categories",
5928
- children: /* @__PURE__ */ A(Xa, {
5825
+ children: /* @__PURE__ */ A(qa, {
5929
5826
  value: e.filters.excludeCategories,
5930
5827
  onChange: (e) => n({ excludeCategories: e }),
5931
5828
  placeholder: "Add category"
5932
5829
  })
5933
5830
  }),
5934
- /* @__PURE__ */ A(Ga, {
5831
+ /* @__PURE__ */ A(Ha, {
5935
5832
  label: "Include categories",
5936
- children: /* @__PURE__ */ A(Xa, {
5833
+ children: /* @__PURE__ */ A(qa, {
5937
5834
  value: e.filters.includeCategories,
5938
5835
  onChange: (e) => n({ includeCategories: e }),
5939
5836
  placeholder: "Add category"
@@ -5941,72 +5838,72 @@ function Va({ logic: e, update: t, updateFilters: n }) {
5941
5838
  }),
5942
5839
  /* @__PURE__ */ j("div", {
5943
5840
  className: "grid grid-cols-2 gap-2",
5944
- children: [/* @__PURE__ */ A(Ga, {
5841
+ children: [/* @__PURE__ */ A(Ha, {
5945
5842
  label: "Minimum stock",
5946
5843
  children: /* @__PURE__ */ A("input", {
5947
5844
  type: "number",
5948
5845
  min: 0,
5949
5846
  value: e.filters.minStock ?? 0,
5950
5847
  onChange: (e) => n({ minStock: Number(e.target.value) || 0 }),
5951
- className: Ha
5848
+ className: za
5952
5849
  })
5953
- }), /* @__PURE__ */ A(Ga, {
5850
+ }), /* @__PURE__ */ A(Ha, {
5954
5851
  label: "Minimum price",
5955
5852
  children: /* @__PURE__ */ A("input", {
5956
5853
  type: "number",
5957
5854
  min: 0,
5958
5855
  value: e.filters.minPrice ?? 0,
5959
5856
  onChange: (e) => n({ minPrice: Number(e.target.value) || 0 }),
5960
- className: Ha
5857
+ className: za
5961
5858
  })
5962
5859
  })]
5963
5860
  }),
5964
- /* @__PURE__ */ A(qa, {
5861
+ /* @__PURE__ */ A(Wa, {
5965
5862
  label: "Only main items",
5966
5863
  checked: !!e.filters.mainOnly,
5967
5864
  onChange: (e) => n({ mainOnly: e })
5968
5865
  }),
5969
- /* @__PURE__ */ A(qa, {
5866
+ /* @__PURE__ */ A(Wa, {
5970
5867
  label: "Higher price than current item (upsell)",
5971
5868
  checked: !!e.filters.higherPrice,
5972
5869
  onChange: (e) => n({ higherPrice: e })
5973
5870
  }),
5974
- /* @__PURE__ */ A(qa, {
5871
+ /* @__PURE__ */ A(Wa, {
5975
5872
  label: "On sale only",
5976
5873
  checked: !!e.filters.salesPrice,
5977
5874
  onChange: (e) => n({ salesPrice: e })
5978
5875
  }),
5979
- /* @__PURE__ */ A(qa, {
5876
+ /* @__PURE__ */ A(Wa, {
5980
5877
  label: "Same category as current",
5981
5878
  checked: !!e.filters.sameCategory,
5982
5879
  onChange: (e) => n({ sameCategory: e })
5983
5880
  }),
5984
- /* @__PURE__ */ A(qa, {
5881
+ /* @__PURE__ */ A(Wa, {
5985
5882
  label: "Match title keywords",
5986
5883
  checked: !!e.filters.matchTitle,
5987
5884
  onChange: (e) => n({ matchTitle: e })
5988
5885
  }),
5989
- /* @__PURE__ */ A(Ga, {
5886
+ /* @__PURE__ */ A(Ha, {
5990
5887
  label: "Match same fields (comma-separated)",
5991
5888
  children: /* @__PURE__ */ A("input", {
5992
5889
  type: "text",
5993
5890
  placeholder: "brand, color",
5994
5891
  value: e.filters.sameField ?? "",
5995
5892
  onChange: (e) => n({ sameField: e.target.value }),
5996
- className: Ha
5893
+ className: za
5997
5894
  })
5998
5895
  }),
5999
- r && /* @__PURE__ */ A(Ga, {
5896
+ r && /* @__PURE__ */ A(Ha, {
6000
5897
  label: "Advanced JSON overrides",
6001
- children: /* @__PURE__ */ A(Za, {
5898
+ children: /* @__PURE__ */ A(Ja, {
6002
5899
  value: e.filters.advanced ?? {},
6003
5900
  onChange: (e) => n({ advanced: e })
6004
5901
  })
6005
5902
  })
6006
5903
  ] });
6007
5904
  }
6008
- var Ha = "w-full px-2 py-1.5 text-sm border border-gray-200 rounded focus:border-blue-500 focus:outline-none bg-white";
6009
- function Ua({ active: e, icon: t, title: n, subtitle: r, onClick: i }) {
5905
+ var za = "w-full px-2 py-1.5 text-sm border border-gray-200 rounded focus:border-blue-500 focus:outline-none bg-white";
5906
+ function Ba({ active: e, icon: t, title: n, subtitle: r, onClick: i }) {
6010
5907
  return /* @__PURE__ */ j("button", {
6011
5908
  onClick: i,
6012
5909
  className: "flex flex-col items-start gap-0.5 p-2.5 rounded border text-left transition " + (e ? "border-teal-600 bg-teal-50 ring-1 ring-teal-600" : "border-gray-200 bg-white hover:border-gray-300"),
@@ -6022,7 +5919,7 @@ function Ua({ active: e, icon: t, title: n, subtitle: r, onClick: i }) {
6022
5919
  })]
6023
5920
  });
6024
5921
  }
6025
- function Wa({ title: e, right: t }) {
5922
+ function Va({ title: e, right: t }) {
6026
5923
  return /* @__PURE__ */ j("div", {
6027
5924
  className: "flex items-center justify-between border-t border-gray-200 pt-3 mt-3",
6028
5925
  children: [/* @__PURE__ */ A("div", {
@@ -6031,20 +5928,20 @@ function Wa({ title: e, right: t }) {
6031
5928
  }), t]
6032
5929
  });
6033
5930
  }
6034
- function Ga({ label: e, children: t }) {
5931
+ function Ha({ label: e, children: t }) {
6035
5932
  return /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("label", {
6036
5933
  className: "block text-xs font-medium text-gray-700 mb-1",
6037
5934
  children: e
6038
5935
  }), t] });
6039
5936
  }
6040
- function Ka({ active: e, onClick: t, children: n }) {
5937
+ function Ua({ active: e, onClick: t, children: n }) {
6041
5938
  return /* @__PURE__ */ A("button", {
6042
5939
  onClick: t,
6043
5940
  className: "px-2 py-0.5 rounded text-[10px] font-semibold uppercase tracking-wide " + (e ? "bg-teal-600 text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"),
6044
5941
  children: n
6045
5942
  });
6046
5943
  }
6047
- function qa({ label: e, checked: t, onChange: n }) {
5944
+ function Wa({ label: e, checked: t, onChange: n }) {
6048
5945
  return /* @__PURE__ */ j("label", {
6049
5946
  className: "flex items-center justify-between gap-2 text-xs text-gray-700 py-1",
6050
5947
  children: [/* @__PURE__ */ A("span", { children: e }), /* @__PURE__ */ A("input", {
@@ -6055,7 +5952,7 @@ function qa({ label: e, checked: t, onChange: n }) {
6055
5952
  })]
6056
5953
  });
6057
5954
  }
6058
- function Ja({ stack: e, onChange: t }) {
5955
+ function Ga({ stack: e, onChange: t }) {
6059
5956
  if (e.length === 0) return /* @__PURE__ */ j("div", {
6060
5957
  className: "text-[11px] text-gray-500 italic border border-dashed border-gray-300 rounded px-2 py-3 text-center",
6061
5958
  children: [
@@ -6082,7 +5979,7 @@ function Ja({ stack: e, onChange: t }) {
6082
5979
  return /* @__PURE__ */ A("div", {
6083
5980
  className: "space-y-1.5",
6084
5981
  children: e.map((t, a) => {
6085
- let o = Ma[t.algorithm];
5982
+ let o = ka[t.algorithm];
6086
5983
  return /* @__PURE__ */ j("div", {
6087
5984
  className: "border border-gray-200 rounded px-2 py-1.5 bg-white flex flex-col gap-1",
6088
5985
  children: [/* @__PURE__ */ j("div", {
@@ -6097,14 +5994,14 @@ function Ja({ stack: e, onChange: t }) {
6097
5994
  onClick: () => n(a, -1),
6098
5995
  disabled: a === 0,
6099
5996
  className: "p-1 text-gray-400 hover:text-gray-700 disabled:opacity-30",
6100
- children: /* @__PURE__ */ A(x, { size: 13 })
5997
+ children: /* @__PURE__ */ A(S, { size: 13 })
6101
5998
  }),
6102
5999
  /* @__PURE__ */ A("button", {
6103
6000
  title: "Move down",
6104
6001
  onClick: () => n(a, 1),
6105
6002
  disabled: a === e.length - 1,
6106
6003
  className: "p-1 text-gray-400 hover:text-gray-700 disabled:opacity-30",
6107
- children: /* @__PURE__ */ A(b, { size: 13 })
6004
+ children: /* @__PURE__ */ A(x, { size: 13 })
6108
6005
  }),
6109
6006
  /* @__PURE__ */ A("button", {
6110
6007
  title: "Remove",
@@ -6137,7 +6034,7 @@ function Ja({ stack: e, onChange: t }) {
6137
6034
  })
6138
6035
  });
6139
6036
  }
6140
- function Ya({ disabled: e, existing: t, onPick: n }) {
6037
+ function Ka({ disabled: e, existing: t, onPick: n }) {
6141
6038
  let [r, i] = f(!1);
6142
6039
  return /* @__PURE__ */ j("div", {
6143
6040
  className: "relative",
@@ -6151,7 +6048,7 @@ function Ya({ disabled: e, existing: t, onPick: n }) {
6151
6048
  onClick: () => i(!1)
6152
6049
  }), /* @__PURE__ */ A("div", {
6153
6050
  className: "absolute right-0 top-full mt-1 w-64 max-h-80 overflow-auto bg-white border border-gray-200 rounded shadow-lg z-20",
6154
- children: ja.map((e) => {
6051
+ children: Oa.map((e) => {
6155
6052
  let r = t.includes(e.id);
6156
6053
  return /* @__PURE__ */ j("button", {
6157
6054
  disabled: r,
@@ -6168,7 +6065,7 @@ function Ya({ disabled: e, existing: t, onPick: n }) {
6168
6065
  })] })]
6169
6066
  });
6170
6067
  }
6171
- function Xa({ value: e, onChange: t, placeholder: n }) {
6068
+ function qa({ value: e, onChange: t, placeholder: n }) {
6172
6069
  let [r, i] = f(""), a = () => {
6173
6070
  let n = r.trim();
6174
6071
  n && (e.includes(n) || (t([...e, n]), i("")));
@@ -6194,7 +6091,7 @@ function Xa({ value: e, onChange: t, placeholder: n }) {
6194
6091
  })]
6195
6092
  });
6196
6093
  }
6197
- function Za({ value: e, onChange: t }) {
6094
+ function Ja({ value: e, onChange: t }) {
6198
6095
  let [n, r] = f(() => JSON.stringify(e, null, 2)), [i, a] = f(null);
6199
6096
  return /* @__PURE__ */ j("div", { children: [/* @__PURE__ */ A("textarea", {
6200
6097
  value: n,
@@ -6218,7 +6115,7 @@ function Za({ value: e, onChange: t }) {
6218
6115
  }
6219
6116
  //#endregion
6220
6117
  //#region src/editor/RightSidebar.tsx
6221
- function Qa() {
6118
+ function Ya() {
6222
6119
  let { selection: e, doc: t, viewMode: n } = I();
6223
6120
  return /* @__PURE__ */ j("div", {
6224
6121
  className: "w-72 bg-white border-l border-gray-200 shrink-0 overflow-y-auto",
@@ -6232,26 +6129,26 @@ function Qa() {
6232
6129
  ]
6233
6130
  }), /* @__PURE__ */ A("div", {
6234
6131
  className: "p-4",
6235
- children: !e || e.kind === "email" ? /* @__PURE__ */ A(co, {}) : e.kind === "module" ? (() => {
6132
+ children: !e || e.kind === "email" ? /* @__PURE__ */ A(ao, {}) : e.kind === "module" ? (() => {
6236
6133
  let n = t.modules.find((t) => t.id === e.moduleId);
6237
- return n ? /* @__PURE__ */ A(lo, { mod: n }) : /* @__PURE__ */ A($a, {});
6134
+ return n ? /* @__PURE__ */ A(co, { mod: n }) : /* @__PURE__ */ A(Xa, {});
6238
6135
  })() : (() => {
6239
6136
  let n = t.modules.find((t) => t.id === e.moduleId), r = n?.children.find((t) => t.id === e.elementId);
6240
- return n && r ? /* @__PURE__ */ A(uo, {
6137
+ return n && r ? /* @__PURE__ */ A(lo, {
6241
6138
  mod: n,
6242
6139
  el: r
6243
- }) : /* @__PURE__ */ A($a, {});
6140
+ }) : /* @__PURE__ */ A(Xa, {});
6244
6141
  })()
6245
6142
  })]
6246
6143
  });
6247
6144
  }
6248
- function $a() {
6145
+ function Xa() {
6249
6146
  return /* @__PURE__ */ A("div", {
6250
6147
  className: "text-xs text-gray-400",
6251
6148
  children: "Nothing selected."
6252
6149
  });
6253
6150
  }
6254
- function eo(e, t) {
6151
+ function Za(e, t) {
6255
6152
  if (t !== "mobile") return e;
6256
6153
  let n = e.mobile ?? {};
6257
6154
  return {
@@ -6259,7 +6156,7 @@ function eo(e, t) {
6259
6156
  ...n
6260
6157
  };
6261
6158
  }
6262
- function to(e, t, n) {
6159
+ function Qa(e, t, n) {
6263
6160
  if (n !== "mobile") return {
6264
6161
  ...e,
6265
6162
  ...t
@@ -6273,16 +6170,16 @@ function to(e, t, n) {
6273
6170
  }
6274
6171
  };
6275
6172
  }
6276
- function no({ overridden: e }) {
6173
+ function $a({ overridden: e }) {
6277
6174
  return e ? /* @__PURE__ */ A("span", {
6278
6175
  className: "ml-1 text-[9px] uppercase tracking-wide bg-amber-100 text-amber-800 px-1 rounded",
6279
6176
  children: "mobile"
6280
6177
  }) : null;
6281
6178
  }
6282
- function ro({ hideOn: e, onChange: t }) {
6179
+ function eo({ hideOn: e, onChange: t }) {
6283
6180
  return /* @__PURE__ */ A(Z, {
6284
6181
  label: "Visibility",
6285
- children: /* @__PURE__ */ j(so, {
6182
+ children: /* @__PURE__ */ j(io, {
6286
6183
  value: e ?? "",
6287
6184
  onChange: (e) => {
6288
6185
  let n = e.target.value;
@@ -6305,7 +6202,7 @@ function ro({ hideOn: e, onChange: t }) {
6305
6202
  })
6306
6203
  });
6307
6204
  }
6308
- function io({ children: e }) {
6205
+ function to({ children: e }) {
6309
6206
  return /* @__PURE__ */ A("h3", {
6310
6207
  className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-3",
6311
6208
  children: e
@@ -6332,8 +6229,8 @@ function $(e) {
6332
6229
  ...e
6333
6230
  });
6334
6231
  }
6335
- function ao({ value: e, onChange: t, onAlt: n }) {
6336
- let r = ka(), i = d(null), [a, o] = f(!1), [s, c] = f(null), l = async (e) => {
6232
+ function no({ value: e, onChange: t, onAlt: n }) {
6233
+ let r = Ea(), i = d(null), [a, o] = f(!1), [s, c] = f(null), l = async (e) => {
6337
6234
  if (r) {
6338
6235
  o(!0), c(null);
6339
6236
  try {
@@ -6383,7 +6280,7 @@ function ao({ value: e, onChange: t, onAlt: n }) {
6383
6280
  })
6384
6281
  ] });
6385
6282
  }
6386
- function oo({ value: e, onChange: t, defaultValue: n }) {
6283
+ function ro({ value: e, onChange: t, defaultValue: n }) {
6387
6284
  let r = I((e) => e.doc.theme), i = typeof e == "string" && e.startsWith("{"), a = d(n && n.startsWith("{") ? n : i ? e : void 0);
6388
6285
  s(() => {
6389
6286
  i ? a.current = e : n && n.startsWith("{") && (a.current = n);
@@ -6432,16 +6329,16 @@ function oo({ value: e, onChange: t, defaultValue: n }) {
6432
6329
  ]
6433
6330
  });
6434
6331
  }
6435
- function so(e) {
6332
+ function io(e) {
6436
6333
  return /* @__PURE__ */ A("select", {
6437
6334
  ...e,
6438
6335
  className: "w-full px-2 py-1.5 text-sm border border-gray-200 rounded focus:border-blue-500 focus:outline-none bg-white"
6439
6336
  });
6440
6337
  }
6441
- function co() {
6338
+ function ao() {
6442
6339
  let { doc: e, updateMeta: t, updateSettings: n } = I();
6443
6340
  return /* @__PURE__ */ j(k, { children: [
6444
- /* @__PURE__ */ A(io, { children: "Email" }),
6341
+ /* @__PURE__ */ A(to, { children: "Email" }),
6445
6342
  /* @__PURE__ */ A(Z, {
6446
6343
  label: "Name",
6447
6344
  children: /* @__PURE__ */ A(Q, {
@@ -6465,104 +6362,198 @@ function co() {
6465
6362
  }),
6466
6363
  /* @__PURE__ */ A(Z, {
6467
6364
  label: "Background color",
6468
- children: /* @__PURE__ */ A(oo, {
6365
+ children: /* @__PURE__ */ A(ro, {
6469
6366
  value: e.settings.backgroundColor,
6470
6367
  onChange: (e) => n({ backgroundColor: e })
6471
6368
  })
6472
6369
  }),
6473
6370
  /* @__PURE__ */ A(Z, {
6474
6371
  label: "Content background color",
6475
- children: /* @__PURE__ */ A(oo, {
6372
+ children: /* @__PURE__ */ A(ro, {
6476
6373
  value: e.settings.contentBackgroundColor,
6477
6374
  onChange: (e) => n({ contentBackgroundColor: e })
6478
6375
  })
6479
6376
  }),
6480
- /* @__PURE__ */ j("div", {
6377
+ /* @__PURE__ */ A("div", {
6481
6378
  className: "mt-6 pt-4 border-t border-gray-100",
6482
- children: [/* @__PURE__ */ A(io, { children: "Theme tokens (read-only preview)" }), /* @__PURE__ */ j("div", {
6483
- className: "text-xs space-y-1",
6484
- children: [/* @__PURE__ */ A("div", {
6485
- className: "font-medium",
6486
- children: e.theme.name
6487
- }), /* @__PURE__ */ A("div", {
6488
- className: "grid grid-cols-2 gap-1 text-gray-500",
6489
- children: Object.entries(e.theme.tokens.colors).map(([e, t]) => /* @__PURE__ */ j("div", {
6490
- className: "flex items-center gap-1",
6491
- children: [/* @__PURE__ */ A("span", {
6492
- className: "w-3 h-3 rounded",
6493
- style: { background: t }
6494
- }), /* @__PURE__ */ A("span", {
6495
- className: "truncate",
6496
- children: e
6497
- })]
6498
- }, e))
6499
- })]
6379
+ children: /* @__PURE__ */ A(oo, {})
6380
+ })
6381
+ ] });
6382
+ }
6383
+ function oo() {
6384
+ let { doc: e, themes: t, applyTheme: n } = I(), r = e.theme, i = t.find((e) => e.id === r.id), a = i != null && Object.entries(r.tokens.colors).some(([e, t]) => i.tokens.colors[e] !== t), o = (e, t) => {
6385
+ n({
6386
+ ...r,
6387
+ tokens: {
6388
+ ...r.tokens,
6389
+ colors: {
6390
+ ...r.tokens.colors,
6391
+ [e]: t
6392
+ }
6393
+ }
6394
+ });
6395
+ };
6396
+ return /* @__PURE__ */ j(k, { children: [
6397
+ /* @__PURE__ */ j("div", {
6398
+ className: "flex items-center justify-between mb-2",
6399
+ children: [/* @__PURE__ */ A(to, { children: "Theme" }), a && /* @__PURE__ */ A("button", {
6400
+ onClick: () => i && n(i),
6401
+ className: "text-[10px] text-blue-600 hover:underline mb-3",
6402
+ title: "Discard color changes and restore the preset",
6403
+ children: "Reset to preset"
6404
+ })]
6405
+ }),
6406
+ /* @__PURE__ */ A("div", {
6407
+ className: "flex flex-col gap-1.5 mb-4",
6408
+ children: t.map((e) => {
6409
+ let t = e.id === r.id;
6410
+ return /* @__PURE__ */ j("button", {
6411
+ onClick: () => n(e),
6412
+ title: e.name,
6413
+ className: `flex items-center gap-2 px-2.5 py-2 rounded border text-xs transition-colors ${t ? "border-blue-500 bg-blue-50 text-blue-700" : "border-gray-200 bg-white hover:border-gray-300 text-gray-700"}`,
6414
+ children: [
6415
+ /* @__PURE__ */ A("span", {
6416
+ className: "w-3 h-3 rounded-full shrink-0 ring-1 ring-black/10",
6417
+ style: { background: e.tokens.colors.primary }
6418
+ }),
6419
+ /* @__PURE__ */ A("span", {
6420
+ className: "w-3 h-3 rounded-full shrink-0 ring-1 ring-black/10",
6421
+ style: { background: e.tokens.colors.background }
6422
+ }),
6423
+ /* @__PURE__ */ A("span", {
6424
+ className: "w-3 h-3 rounded-full shrink-0 ring-1 ring-black/10",
6425
+ style: { background: e.tokens.colors.text }
6426
+ }),
6427
+ /* @__PURE__ */ A("span", {
6428
+ className: "flex-1 text-left",
6429
+ children: e.name
6430
+ }),
6431
+ t && /* @__PURE__ */ A(b, {
6432
+ size: 12,
6433
+ className: "text-blue-600 shrink-0"
6434
+ })
6435
+ ]
6436
+ }, e.id);
6437
+ })
6438
+ }),
6439
+ /* @__PURE__ */ j("div", {
6440
+ className: "text-xs font-semibold uppercase tracking-wide text-gray-500 mb-2",
6441
+ children: ["Colors", a && /* @__PURE__ */ A("span", {
6442
+ className: "ml-2 normal-case font-normal text-[10px] bg-amber-100 text-amber-700 px-1.5 py-0.5 rounded",
6443
+ children: "customised"
6500
6444
  })]
6445
+ }),
6446
+ /* @__PURE__ */ A("div", {
6447
+ className: "flex flex-col gap-2",
6448
+ children: Object.entries(r.tokens.colors).map(([e, t]) => /* @__PURE__ */ A(so, {
6449
+ label: e,
6450
+ value: t,
6451
+ onChange: (t) => o(e, t)
6452
+ }, e))
6501
6453
  })
6502
6454
  ] });
6503
6455
  }
6504
- function lo({ mod: e }) {
6505
- let t = I((e) => e.updateModule), n = I((e) => e.viewMode), r = e.style ?? {}, i = eo(r, n), a = new Set(Object.keys(r.mobile ?? {})), o = (i) => t(e.id, { style: to(r, i, n) });
6456
+ function so({ label: e, value: t, onChange: n }) {
6457
+ let [r, i] = f(t);
6458
+ s(() => i(t), [t]);
6459
+ let a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(t) ? t.length === 4 ? "#" + t.slice(1).split("").map((e) => e + e).join("") : t : "#000000", o = (e) => {
6460
+ let t = e.trim();
6461
+ t && n(t);
6462
+ };
6463
+ return /* @__PURE__ */ j("div", {
6464
+ className: "flex items-center gap-2",
6465
+ children: [
6466
+ /* @__PURE__ */ A("span", {
6467
+ className: "text-xs text-gray-500 w-28 shrink-0 truncate",
6468
+ title: e,
6469
+ children: e
6470
+ }),
6471
+ /* @__PURE__ */ A("label", {
6472
+ className: "relative w-7 h-7 rounded border border-gray-200 cursor-pointer overflow-hidden shrink-0",
6473
+ style: { background: a },
6474
+ title: `Pick ${e} color`,
6475
+ children: /* @__PURE__ */ A("input", {
6476
+ type: "color",
6477
+ value: a,
6478
+ onChange: (e) => n(e.target.value),
6479
+ className: "absolute inset-0 opacity-0 cursor-pointer w-full h-full"
6480
+ })
6481
+ }),
6482
+ /* @__PURE__ */ A("input", {
6483
+ value: r,
6484
+ onChange: (e) => i(e.target.value),
6485
+ onBlur: () => o(r),
6486
+ onKeyDown: (e) => {
6487
+ e.key === "Enter" && e.target.blur();
6488
+ },
6489
+ className: "flex-1 min-w-0 px-2 py-1 text-xs border border-gray-200 rounded focus:border-blue-500 focus:outline-none font-mono",
6490
+ spellCheck: !1
6491
+ })
6492
+ ]
6493
+ });
6494
+ }
6495
+ function co({ mod: e }) {
6496
+ let t = I((e) => e.updateModule), n = I((e) => e.viewMode), r = e.style ?? {}, i = Za(r, n), a = new Set(Object.keys(r.mobile ?? {})), o = (i) => t(e.id, { style: Qa(r, i, n) });
6506
6497
  return /* @__PURE__ */ j(k, { children: [
6507
- /* @__PURE__ */ A(io, { children: e.name }),
6498
+ /* @__PURE__ */ A(to, { children: e.name }),
6508
6499
  /* @__PURE__ */ A(Z, {
6509
- label: /* @__PURE__ */ j(k, { children: ["Background color", /* @__PURE__ */ A(no, { overridden: a.has("backgroundColor") })] }),
6510
- children: /* @__PURE__ */ A(oo, {
6500
+ label: /* @__PURE__ */ j(k, { children: ["Background color", /* @__PURE__ */ A($a, { overridden: a.has("backgroundColor") })] }),
6501
+ children: /* @__PURE__ */ A(ro, {
6511
6502
  value: i.backgroundColor ?? "",
6512
6503
  onChange: (e) => o({ backgroundColor: e })
6513
6504
  })
6514
6505
  }),
6515
- /* @__PURE__ */ A(fo, {
6506
+ /* @__PURE__ */ A(uo, {
6516
6507
  style: i,
6517
6508
  mobileKeys: a,
6518
6509
  onSet: o
6519
6510
  }),
6520
6511
  /* @__PURE__ */ A(Z, {
6521
- label: /* @__PURE__ */ j(k, { children: ["Border radius", /* @__PURE__ */ A(no, { overridden: a.has("borderRadius") })] }),
6512
+ label: /* @__PURE__ */ j(k, { children: ["Border radius", /* @__PURE__ */ A($a, { overridden: a.has("borderRadius") })] }),
6522
6513
  children: /* @__PURE__ */ A($, {
6523
6514
  value: i.borderRadius ?? 0,
6524
6515
  onChange: (e) => o({ borderRadius: Number(e.target.value) })
6525
6516
  })
6526
6517
  }),
6527
- /* @__PURE__ */ A(ro, {
6518
+ /* @__PURE__ */ A(eo, {
6528
6519
  hideOn: r.hideOn,
6529
6520
  onChange: (n) => t(e.id, { style: {
6530
6521
  ...r,
6531
6522
  hideOn: n
6532
6523
  } })
6533
6524
  }),
6534
- Ia(e) && /* @__PURE__ */ A(za, { mod: e })
6525
+ Na(e) && /* @__PURE__ */ A(Ia, { mod: e })
6535
6526
  ] });
6536
6527
  }
6537
- function uo({ mod: e, el: t }) {
6528
+ function lo({ mod: e, el: t }) {
6538
6529
  switch (t.type) {
6539
- case "text": return /* @__PURE__ */ A(mo, {
6530
+ case "text": return /* @__PURE__ */ A(po, {
6540
6531
  mod: e,
6541
6532
  el: t
6542
6533
  });
6543
- case "image": return /* @__PURE__ */ A(ho, {
6534
+ case "image": return /* @__PURE__ */ A(mo, {
6544
6535
  mod: e,
6545
6536
  el: t
6546
6537
  });
6547
- case "button": return /* @__PURE__ */ A(go, {
6538
+ case "button": return /* @__PURE__ */ A(ho, {
6548
6539
  mod: e,
6549
6540
  el: t
6550
6541
  });
6551
- case "spacer": return /* @__PURE__ */ A(_o, {
6542
+ case "spacer": return /* @__PURE__ */ A(go, {
6552
6543
  mod: e,
6553
6544
  el: t
6554
6545
  });
6555
- case "divider": return /* @__PURE__ */ A(vo, {
6546
+ case "divider": return /* @__PURE__ */ A(_o, {
6556
6547
  mod: e,
6557
6548
  el: t
6558
6549
  });
6559
- case "productGrid": return /* @__PURE__ */ A(bo, {
6550
+ case "productGrid": return /* @__PURE__ */ A(yo, {
6560
6551
  mod: e,
6561
6552
  el: t
6562
6553
  });
6563
6554
  }
6564
6555
  }
6565
- function fo({ style: e, mobileKeys: t, onSet: n }) {
6556
+ function uo({ style: e, mobileKeys: t, onSet: n }) {
6566
6557
  return /* @__PURE__ */ A("div", {
6567
6558
  className: "grid grid-cols-2 gap-2 mb-3",
6568
6559
  children: [
@@ -6571,7 +6562,7 @@ function fo({ style: e, mobileKeys: t, onSet: n }) {
6571
6562
  "paddingLeft",
6572
6563
  "paddingRight"
6573
6564
  ].map((r) => /* @__PURE__ */ A(Z, {
6574
- label: /* @__PURE__ */ j(k, { children: [r.replace("padding", "Pad "), /* @__PURE__ */ A(no, { overridden: !!t?.has(r) })] }),
6565
+ label: /* @__PURE__ */ j(k, { children: [r.replace("padding", "Pad "), /* @__PURE__ */ A($a, { overridden: !!t?.has(r) })] }),
6575
6566
  children: /* @__PURE__ */ A($, {
6576
6567
  value: e[r] ?? 0,
6577
6568
  onChange: (e) => n({ [r]: Number(e.target.value) })
@@ -6579,14 +6570,14 @@ function fo({ style: e, mobileKeys: t, onSet: n }) {
6579
6570
  }, r))
6580
6571
  });
6581
6572
  }
6582
- function po(e, t) {
6573
+ function fo(e, t) {
6583
6574
  let n = I((e) => e.updateElement);
6584
6575
  return (r) => n(e.id, t.id, r);
6585
6576
  }
6586
- function mo({ mod: e, el: t }) {
6587
- let n = po(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = eo(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: to(i, e, r) });
6577
+ function po({ mod: e, el: t }) {
6578
+ let n = fo(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = Za(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: Qa(i, e, r) });
6588
6579
  return /* @__PURE__ */ j(k, { children: [
6589
- /* @__PURE__ */ A(io, { children: "Text" }),
6580
+ /* @__PURE__ */ A(to, { children: "Text" }),
6590
6581
  /* @__PURE__ */ A(Z, {
6591
6582
  label: "Content",
6592
6583
  children: /* @__PURE__ */ A("textarea", {
@@ -6639,14 +6630,14 @@ function mo({ mod: e, el: t }) {
6639
6630
  }),
6640
6631
  /* @__PURE__ */ A(Z, {
6641
6632
  label: "Color",
6642
- children: /* @__PURE__ */ A(oo, {
6633
+ children: /* @__PURE__ */ A(ro, {
6643
6634
  value: a.color ?? "#000000",
6644
6635
  onChange: (e) => s({ color: e })
6645
6636
  })
6646
6637
  }),
6647
6638
  /* @__PURE__ */ A(Z, {
6648
6639
  label: "Align",
6649
- children: /* @__PURE__ */ j(so, {
6640
+ children: /* @__PURE__ */ j(io, {
6650
6641
  value: a.align ?? "left",
6651
6642
  onChange: (e) => s({ align: e.target.value }),
6652
6643
  children: [
@@ -6672,12 +6663,12 @@ function mo({ mod: e, el: t }) {
6672
6663
  onChange: (e) => s({ link: e.target.value })
6673
6664
  })
6674
6665
  }),
6675
- /* @__PURE__ */ A(fo, {
6666
+ /* @__PURE__ */ A(uo, {
6676
6667
  style: a,
6677
6668
  mobileKeys: o,
6678
6669
  onSet: s
6679
6670
  }),
6680
- /* @__PURE__ */ A(ro, {
6671
+ /* @__PURE__ */ A(eo, {
6681
6672
  hideOn: i.hideOn,
6682
6673
  onChange: (e) => n({ style: {
6683
6674
  ...i,
@@ -6691,13 +6682,13 @@ function mo({ mod: e, el: t }) {
6691
6682
  })
6692
6683
  ] });
6693
6684
  }
6694
- function ho({ mod: e, el: t }) {
6695
- let n = po(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = eo(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: to(i, e, r) });
6685
+ function mo({ mod: e, el: t }) {
6686
+ let n = fo(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = Za(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: Qa(i, e, r) });
6696
6687
  return /* @__PURE__ */ j(k, { children: [
6697
- /* @__PURE__ */ A(io, { children: "Image" }),
6688
+ /* @__PURE__ */ A(to, { children: "Image" }),
6698
6689
  /* @__PURE__ */ A(Z, {
6699
6690
  label: "Image URL",
6700
- children: /* @__PURE__ */ A(ao, {
6691
+ children: /* @__PURE__ */ A(no, {
6701
6692
  value: t.src,
6702
6693
  onChange: (e) => n({ src: e }),
6703
6694
  onAlt: (e) => n({ alt: e })
@@ -6720,13 +6711,13 @@ function ho({ mod: e, el: t }) {
6720
6711
  /* @__PURE__ */ j("div", {
6721
6712
  className: "grid grid-cols-2 gap-2",
6722
6713
  children: [/* @__PURE__ */ A(Z, {
6723
- label: /* @__PURE__ */ j(k, { children: ["Width", /* @__PURE__ */ A(no, { overridden: o.has("width") })] }),
6714
+ label: /* @__PURE__ */ j(k, { children: ["Width", /* @__PURE__ */ A($a, { overridden: o.has("width") })] }),
6724
6715
  children: /* @__PURE__ */ A($, {
6725
6716
  value: a.width ?? 0,
6726
6717
  onChange: (e) => s({ width: Number(e.target.value) })
6727
6718
  })
6728
6719
  }), /* @__PURE__ */ A(Z, {
6729
- label: /* @__PURE__ */ j(k, { children: ["Height", /* @__PURE__ */ A(no, { overridden: o.has("height") })] }),
6720
+ label: /* @__PURE__ */ j(k, { children: ["Height", /* @__PURE__ */ A($a, { overridden: o.has("height") })] }),
6730
6721
  children: /* @__PURE__ */ A($, {
6731
6722
  value: a.height ?? 0,
6732
6723
  onChange: (e) => s({ height: Number(e.target.value) || void 0 })
@@ -6742,7 +6733,7 @@ function ho({ mod: e, el: t }) {
6742
6733
  }),
6743
6734
  /* @__PURE__ */ A(Z, {
6744
6735
  label: "Align",
6745
- children: /* @__PURE__ */ j(so, {
6736
+ children: /* @__PURE__ */ j(io, {
6746
6737
  value: a.align ?? "center",
6747
6738
  onChange: (e) => s({ align: e.target.value }),
6748
6739
  children: [
@@ -6761,12 +6752,12 @@ function ho({ mod: e, el: t }) {
6761
6752
  ]
6762
6753
  })
6763
6754
  }),
6764
- /* @__PURE__ */ A(fo, {
6755
+ /* @__PURE__ */ A(uo, {
6765
6756
  style: a,
6766
6757
  mobileKeys: o,
6767
6758
  onSet: s
6768
6759
  }),
6769
- /* @__PURE__ */ A(ro, {
6760
+ /* @__PURE__ */ A(eo, {
6770
6761
  hideOn: i.hideOn,
6771
6762
  onChange: (e) => n({ style: {
6772
6763
  ...i,
@@ -6775,10 +6766,10 @@ function ho({ mod: e, el: t }) {
6775
6766
  })
6776
6767
  ] });
6777
6768
  }
6778
- function go({ mod: e, el: t }) {
6779
- let n = po(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = eo(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: to(i, e, r) });
6769
+ function ho({ mod: e, el: t }) {
6770
+ let n = fo(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = Za(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: Qa(i, e, r) });
6780
6771
  return /* @__PURE__ */ j(k, { children: [
6781
- /* @__PURE__ */ A(io, { children: "Button" }),
6772
+ /* @__PURE__ */ A(to, { children: "Button" }),
6782
6773
  /* @__PURE__ */ A(Z, {
6783
6774
  label: "Label",
6784
6775
  children: /* @__PURE__ */ A(Q, {
@@ -6795,14 +6786,14 @@ function go({ mod: e, el: t }) {
6795
6786
  }),
6796
6787
  /* @__PURE__ */ A(Z, {
6797
6788
  label: "Background color",
6798
- children: /* @__PURE__ */ A(oo, {
6789
+ children: /* @__PURE__ */ A(ro, {
6799
6790
  value: a.backgroundColor ?? "",
6800
6791
  onChange: (e) => s({ backgroundColor: e })
6801
6792
  })
6802
6793
  }),
6803
6794
  /* @__PURE__ */ A(Z, {
6804
6795
  label: "Text color",
6805
- children: /* @__PURE__ */ A(oo, {
6796
+ children: /* @__PURE__ */ A(ro, {
6806
6797
  value: a.color ?? "#FFFFFF",
6807
6798
  onChange: (e) => s({ color: e })
6808
6799
  })
@@ -6825,7 +6816,7 @@ function go({ mod: e, el: t }) {
6825
6816
  }),
6826
6817
  /* @__PURE__ */ A(Z, {
6827
6818
  label: "Align",
6828
- children: /* @__PURE__ */ j(so, {
6819
+ children: /* @__PURE__ */ j(io, {
6829
6820
  value: a.align ?? "center",
6830
6821
  onChange: (e) => s({ align: e.target.value }),
6831
6822
  children: [
@@ -6844,12 +6835,12 @@ function go({ mod: e, el: t }) {
6844
6835
  ]
6845
6836
  })
6846
6837
  }),
6847
- /* @__PURE__ */ A(fo, {
6838
+ /* @__PURE__ */ A(uo, {
6848
6839
  style: a,
6849
6840
  mobileKeys: o,
6850
6841
  onSet: s
6851
6842
  }),
6852
- /* @__PURE__ */ A(ro, {
6843
+ /* @__PURE__ */ A(eo, {
6853
6844
  hideOn: i.hideOn,
6854
6845
  onChange: (e) => n({ style: {
6855
6846
  ...i,
@@ -6858,9 +6849,9 @@ function go({ mod: e, el: t }) {
6858
6849
  })
6859
6850
  ] });
6860
6851
  }
6861
- function _o({ mod: e, el: t }) {
6862
- let n = po(e, t);
6863
- return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(io, { children: "Spacer" }), /* @__PURE__ */ A(Z, {
6852
+ function go({ mod: e, el: t }) {
6853
+ let n = fo(e, t);
6854
+ return /* @__PURE__ */ j(k, { children: [/* @__PURE__ */ A(to, { children: "Spacer" }), /* @__PURE__ */ A(Z, {
6864
6855
  label: "Height (px)",
6865
6856
  children: /* @__PURE__ */ A($, {
6866
6857
  value: t.height,
@@ -6868,13 +6859,13 @@ function _o({ mod: e, el: t }) {
6868
6859
  })
6869
6860
  })] });
6870
6861
  }
6871
- function vo({ mod: e, el: t }) {
6872
- let n = po(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = eo(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: to(i, e, r) });
6862
+ function _o({ mod: e, el: t }) {
6863
+ let n = fo(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = Za(i, r), o = new Set(Object.keys(i.mobile ?? {})), s = (e) => n({ style: Qa(i, e, r) });
6873
6864
  return /* @__PURE__ */ j(k, { children: [
6874
- /* @__PURE__ */ A(io, { children: "Divider" }),
6865
+ /* @__PURE__ */ A(to, { children: "Divider" }),
6875
6866
  /* @__PURE__ */ A(Z, {
6876
6867
  label: "Color",
6877
- children: /* @__PURE__ */ A(oo, {
6868
+ children: /* @__PURE__ */ A(ro, {
6878
6869
  value: a.color ?? "#E5E7EB",
6879
6870
  onChange: (e) => s({ color: e })
6880
6871
  })
@@ -6886,12 +6877,12 @@ function vo({ mod: e, el: t }) {
6886
6877
  onChange: (e) => s({ thickness: Number(e.target.value) })
6887
6878
  })
6888
6879
  }),
6889
- /* @__PURE__ */ A(fo, {
6880
+ /* @__PURE__ */ A(uo, {
6890
6881
  style: a,
6891
6882
  mobileKeys: o,
6892
6883
  onSet: s
6893
6884
  }),
6894
- /* @__PURE__ */ A(ro, {
6885
+ /* @__PURE__ */ A(eo, {
6895
6886
  hideOn: i.hideOn,
6896
6887
  onChange: (e) => n({ style: {
6897
6888
  ...i,
@@ -6900,7 +6891,7 @@ function vo({ mod: e, el: t }) {
6900
6891
  })
6901
6892
  ] });
6902
6893
  }
6903
- function yo(e = 0) {
6894
+ function vo(e = 0) {
6904
6895
  let t = e + 1;
6905
6896
  return {
6906
6897
  id: `p_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`,
@@ -6913,17 +6904,17 @@ function yo(e = 0) {
6913
6904
  link: "#"
6914
6905
  };
6915
6906
  }
6916
- function bo({ mod: e, el: t }) {
6917
- let n = po(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = eo(i, r), o = (e) => n({ style: to(i, e, r) }), s = (e) => n({ products: e }), c = (e) => {
6907
+ function yo({ mod: e, el: t }) {
6908
+ let n = fo(e, t), r = I((e) => e.viewMode), i = t.style ?? {}, a = Za(i, r), o = (e) => n({ style: Qa(i, e, r) }), s = (e) => n({ products: e }), c = (e) => {
6918
6909
  let r = e, i = t.products.slice();
6919
- if (i.length < r) for (; i.length < r;) i.push(yo(i.length));
6910
+ if (i.length < r) for (; i.length < r;) i.push(vo(i.length));
6920
6911
  n({
6921
6912
  columns: e,
6922
6913
  products: i
6923
6914
  });
6924
6915
  };
6925
6916
  return /* @__PURE__ */ j(k, { children: [
6926
- /* @__PURE__ */ A(io, { children: "Product Grid" }),
6917
+ /* @__PURE__ */ A(to, { children: "Product Grid" }),
6927
6918
  /* @__PURE__ */ j(Z, {
6928
6919
  label: "Columns (desktop)",
6929
6920
  children: [/* @__PURE__ */ A("div", {
@@ -6948,21 +6939,21 @@ function bo({ mod: e, el: t }) {
6948
6939
  }),
6949
6940
  /* @__PURE__ */ A(Z, {
6950
6941
  label: "Show old price",
6951
- children: /* @__PURE__ */ A(xo, {
6942
+ children: /* @__PURE__ */ A(bo, {
6952
6943
  checked: t.showOldPrice,
6953
6944
  onChange: (e) => n({ showOldPrice: e })
6954
6945
  })
6955
6946
  }),
6956
6947
  /* @__PURE__ */ A(Z, {
6957
6948
  label: "Show description",
6958
- children: /* @__PURE__ */ A(xo, {
6949
+ children: /* @__PURE__ */ A(bo, {
6959
6950
  checked: t.showDescription,
6960
6951
  onChange: (e) => n({ showDescription: e })
6961
6952
  })
6962
6953
  }),
6963
6954
  /* @__PURE__ */ A(Z, {
6964
6955
  label: "Show button",
6965
- children: /* @__PURE__ */ A(xo, {
6956
+ children: /* @__PURE__ */ A(bo, {
6966
6957
  checked: t.showButton,
6967
6958
  onChange: (e) => n({ showButton: e })
6968
6959
  })
@@ -6979,17 +6970,17 @@ function bo({ mod: e, el: t }) {
6979
6970
  className: "mt-4 pt-3 border-t border-gray-100",
6980
6971
  children: [/* @__PURE__ */ j("div", {
6981
6972
  className: "flex items-center justify-between mb-2",
6982
- children: [/* @__PURE__ */ j(io, { children: [
6973
+ children: [/* @__PURE__ */ j(to, { children: [
6983
6974
  "Products (",
6984
6975
  t.products.length,
6985
6976
  ")"
6986
6977
  ] }), /* @__PURE__ */ j("button", {
6987
- onClick: () => s([...t.products, yo(t.products.length)]),
6978
+ onClick: () => s([...t.products, vo(t.products.length)]),
6988
6979
  className: "flex items-center gap-1 px-1.5 py-0.5 text-[11px] text-blue-600 hover:bg-blue-50 rounded",
6989
6980
  title: "Add product",
6990
6981
  children: [/* @__PURE__ */ A(ue, { size: 12 }), " Add"]
6991
6982
  })]
6992
- }), t.products.map((e, n) => /* @__PURE__ */ A(So, {
6983
+ }), t.products.map((e, n) => /* @__PURE__ */ A(xo, {
6993
6984
  index: n,
6994
6985
  product: e,
6995
6986
  showOldPrice: t.showOldPrice,
@@ -7005,45 +6996,45 @@ function bo({ mod: e, el: t }) {
7005
6996
  /* @__PURE__ */ j("div", {
7006
6997
  className: "mt-4 pt-3 border-t border-gray-100",
7007
6998
  children: [
7008
- /* @__PURE__ */ A(io, { children: "Style" }),
6999
+ /* @__PURE__ */ A(to, { children: "Style" }),
7009
7000
  /* @__PURE__ */ A(Z, {
7010
7001
  label: "Card background",
7011
- children: /* @__PURE__ */ A(oo, {
7002
+ children: /* @__PURE__ */ A(ro, {
7012
7003
  value: a.cardBackgroundColor ?? "",
7013
7004
  onChange: (e) => o({ cardBackgroundColor: e })
7014
7005
  })
7015
7006
  }),
7016
7007
  /* @__PURE__ */ A(Z, {
7017
7008
  label: "Name color",
7018
- children: /* @__PURE__ */ A(oo, {
7009
+ children: /* @__PURE__ */ A(ro, {
7019
7010
  value: a.nameColor ?? "",
7020
7011
  onChange: (e) => o({ nameColor: e })
7021
7012
  })
7022
7013
  }),
7023
7014
  /* @__PURE__ */ A(Z, {
7024
7015
  label: "Final price color",
7025
- children: /* @__PURE__ */ A(oo, {
7016
+ children: /* @__PURE__ */ A(ro, {
7026
7017
  value: a.finalPriceColor ?? "",
7027
7018
  onChange: (e) => o({ finalPriceColor: e })
7028
7019
  })
7029
7020
  }),
7030
7021
  /* @__PURE__ */ A(Z, {
7031
7022
  label: "Old price color",
7032
- children: /* @__PURE__ */ A(oo, {
7023
+ children: /* @__PURE__ */ A(ro, {
7033
7024
  value: a.oldPriceColor ?? "",
7034
7025
  onChange: (e) => o({ oldPriceColor: e })
7035
7026
  })
7036
7027
  }),
7037
7028
  /* @__PURE__ */ A(Z, {
7038
7029
  label: "Button background",
7039
- children: /* @__PURE__ */ A(oo, {
7030
+ children: /* @__PURE__ */ A(ro, {
7040
7031
  value: a.buttonBackgroundColor ?? "",
7041
7032
  onChange: (e) => o({ buttonBackgroundColor: e })
7042
7033
  })
7043
7034
  }),
7044
7035
  /* @__PURE__ */ A(Z, {
7045
7036
  label: "Button text color",
7046
- children: /* @__PURE__ */ A(oo, {
7037
+ children: /* @__PURE__ */ A(ro, {
7047
7038
  value: a.buttonColor ?? "",
7048
7039
  onChange: (e) => o({ buttonColor: e })
7049
7040
  })
@@ -7055,7 +7046,7 @@ function bo({ mod: e, el: t }) {
7055
7046
  onChange: (e) => o({ borderRadius: Number(e.target.value) })
7056
7047
  })
7057
7048
  }),
7058
- /* @__PURE__ */ A(fo, {
7049
+ /* @__PURE__ */ A(uo, {
7059
7050
  style: a,
7060
7051
  onSet: o
7061
7052
  })
@@ -7063,14 +7054,14 @@ function bo({ mod: e, el: t }) {
7063
7054
  })
7064
7055
  ] });
7065
7056
  }
7066
- function xo({ checked: e, onChange: t }) {
7057
+ function bo({ checked: e, onChange: t }) {
7067
7058
  return /* @__PURE__ */ A("button", {
7068
7059
  onClick: () => t(!e),
7069
7060
  className: `relative inline-flex h-5 w-9 items-center rounded-full transition-colors ${e ? "bg-blue-600" : "bg-gray-300"}`,
7070
7061
  children: /* @__PURE__ */ A("span", { className: `inline-block h-4 w-4 transform rounded-full bg-white transition-transform ${e ? "translate-x-4" : "translate-x-0.5"}` })
7071
7062
  });
7072
7063
  }
7073
- function So({ index: e, product: t, showOldPrice: n, showDescription: r, showButton: i, onChange: a, onDelete: o }) {
7064
+ function xo({ index: e, product: t, showOldPrice: n, showDescription: r, showButton: i, onChange: a, onDelete: o }) {
7074
7065
  let s = (e) => a({
7075
7066
  ...t,
7076
7067
  ...e
@@ -7099,7 +7090,7 @@ function So({ index: e, product: t, showOldPrice: n, showDescription: r, showBut
7099
7090
  }),
7100
7091
  /* @__PURE__ */ A(Z, {
7101
7092
  label: "Image URL",
7102
- children: /* @__PURE__ */ A(ao, {
7093
+ children: /* @__PURE__ */ A(no, {
7103
7094
  value: t.image,
7104
7095
  onChange: (e) => s({ image: e }),
7105
7096
  onAlt: (e) => s({ imageAlt: e })
@@ -7148,7 +7139,7 @@ function So({ index: e, product: t, showOldPrice: n, showDescription: r, showBut
7148
7139
  }
7149
7140
  //#endregion
7150
7141
  //#region src/modules/basic.ts
7151
- var Co = [
7142
+ var So = [
7152
7143
  {
7153
7144
  type: "basic.text",
7154
7145
  category: "basic",
@@ -7235,7 +7226,7 @@ var Co = [
7235
7226
  ],
7236
7227
  create: () => H("basic.divider", "Divider", [V()])
7237
7228
  }
7238
- ], wo = [
7229
+ ], Co = [
7239
7230
  {
7240
7231
  type: "header.logo",
7241
7232
  category: "header",
@@ -7509,7 +7500,7 @@ var Co = [
7509
7500
  lineHeight: 1.2
7510
7501
  })])
7511
7502
  }
7512
- ], To = [
7503
+ ], wo = [
7513
7504
  {
7514
7505
  type: "menu.horizontal",
7515
7506
  category: "menu",
@@ -7633,7 +7624,7 @@ var Co = [
7633
7624
  paddingBottom: 12
7634
7625
  })])
7635
7626
  }
7636
- ], Eo = [
7627
+ ], To = [
7637
7628
  {
7638
7629
  type: "content.headline_body",
7639
7630
  category: "content",
@@ -8243,7 +8234,7 @@ var Co = [
8243
8234
  paddingRight: 16
8244
8235
  })
8245
8236
  }
8246
- ], Do = [
8237
+ ], Eo = [
8247
8238
  {
8248
8239
  type: "feature.list",
8249
8240
  category: "feature",
@@ -8423,8 +8414,137 @@ var Co = [
8423
8414
  paddingTop: 8,
8424
8415
  paddingBottom: 16
8425
8416
  })])
8417
+ },
8418
+ {
8419
+ type: "feature.gradient_hero",
8420
+ category: "feature",
8421
+ name: "Gradient Hero CTA",
8422
+ description: "Bold centered hero with an eyebrow, oversized headline and a primary CTA button. Great for launch announcements and campaign openers.",
8423
+ tags: [
8424
+ "hero",
8425
+ "launch",
8426
+ "cta",
8427
+ "bold",
8428
+ "announcement"
8429
+ ],
8430
+ create: () => H("feature.gradient_hero", "Gradient Hero CTA", [
8431
+ W("Introducing", { align: "center" }),
8432
+ U("Something new is here", {
8433
+ level: 1,
8434
+ align: "center",
8435
+ paddingTop: 4,
8436
+ paddingBottom: 8
8437
+ }),
8438
+ L("A fresh way to reach your audience — crafted for the inbox.", {
8439
+ align: "center",
8440
+ color: "{colors.muted}",
8441
+ fontSize: 16,
8442
+ paddingBottom: 20
8443
+ }),
8444
+ z("Explore now", "#", { align: "center" })
8445
+ ], {
8446
+ backgroundColor: "{colors.surface}",
8447
+ paddingTop: 40,
8448
+ paddingBottom: 40
8449
+ })
8450
+ },
8451
+ {
8452
+ type: "feature.pull_quote",
8453
+ category: "feature",
8454
+ name: "Pull Quote",
8455
+ description: "Large centered quotation with an attribution line. Use to highlight a testimonial or a memorable line.",
8456
+ tags: [
8457
+ "quote",
8458
+ "testimonial",
8459
+ "highlight",
8460
+ "pull-quote"
8461
+ ],
8462
+ create: () => H("feature.pull_quote", "Pull Quote", [L("“This is the fastest we’ve ever shipped a campaign.”", {
8463
+ fontFamily: "{fonts.heading}",
8464
+ fontSize: 24,
8465
+ align: "center",
8466
+ lineHeight: 1.4,
8467
+ paddingTop: 28,
8468
+ paddingBottom: 8
8469
+ }), G("— A very happy customer", {
8470
+ align: "center",
8471
+ paddingBottom: 28
8472
+ })])
8473
+ },
8474
+ {
8475
+ type: "feature.stat_row",
8476
+ category: "feature",
8477
+ name: "Stat Row",
8478
+ description: "Three short number + label pairs in a row. Use to show traction, metrics or highlights.",
8479
+ tags: [
8480
+ "stats",
8481
+ "metrics",
8482
+ "numbers",
8483
+ "row",
8484
+ "kpi"
8485
+ ],
8486
+ create: () => H("feature.stat_row", "Stat Row", [U("By the numbers", {
8487
+ align: "center",
8488
+ paddingTop: 24
8489
+ }), L("<b>10k+</b> subscribers &nbsp;·&nbsp; <b>98%</b> delivery &nbsp;·&nbsp; <b>4.9★</b> rating", {
8490
+ align: "center",
8491
+ color: "{colors.muted}",
8492
+ paddingBottom: 24
8493
+ })])
8494
+ },
8495
+ {
8496
+ type: "feature.single_product_spotlight",
8497
+ category: "feature",
8498
+ name: "Single Product Spotlight",
8499
+ description: "One product with image, name, price and buy button. Use to feature a hero product in a feature-focused email.",
8500
+ tags: [
8501
+ "product",
8502
+ "spotlight",
8503
+ "single",
8504
+ "buy",
8505
+ "shop",
8506
+ "ecommerce"
8507
+ ],
8508
+ create: () => H("feature.single_product_spotlight", "Product Spotlight", [ot([q({
8509
+ name: "The Signature Bag",
8510
+ finalPrice: "$129",
8511
+ oldPrice: "$159",
8512
+ description: "Handmade, built to last.",
8513
+ image: K(520, 520, "Product")
8514
+ })], {
8515
+ columns: 1,
8516
+ showDescription: !0,
8517
+ buttonLabel: "Buy now"
8518
+ })])
8519
+ },
8520
+ {
8521
+ type: "feature.pill_nav",
8522
+ category: "feature",
8523
+ name: "Pill Navigation",
8524
+ description: "Centered row of navigation links with a divider below. Compact feature nav block for use inside email content sections.",
8525
+ tags: [
8526
+ "menu",
8527
+ "nav",
8528
+ "links",
8529
+ "pill"
8530
+ ],
8531
+ create: () => H("feature.pill_nav", "Pill Navigation", [
8532
+ R(K(120, 32, "LOGO"), "Logo", {
8533
+ width: 120,
8534
+ paddingBottom: 8
8535
+ }),
8536
+ L("<a href=\"#\">Shop</a> &nbsp; <a href=\"#\">New</a> &nbsp; <a href=\"#\">Sale</a> &nbsp; <a href=\"#\">About</a>", {
8537
+ align: "center",
8538
+ color: "{colors.primary}",
8539
+ paddingBottom: 8
8540
+ }),
8541
+ V({
8542
+ paddingTop: 4,
8543
+ paddingBottom: 0
8544
+ })
8545
+ ])
8426
8546
  }
8427
- ], Oo = [
8547
+ ], Do = [
8428
8548
  {
8429
8549
  type: "cta.simple",
8430
8550
  category: "call_to_action",
@@ -8651,7 +8771,7 @@ var Co = [
8651
8771
  lineHeight: 1.6
8652
8772
  })])
8653
8773
  }
8654
- ], ko = [
8774
+ ], Oo = [
8655
8775
  {
8656
8776
  type: "ecom.product_single",
8657
8777
  category: "ecommerce",
@@ -8933,7 +9053,7 @@ var Co = [
8933
9053
  showOldPrice: !0
8934
9054
  })])
8935
9055
  }
8936
- ], Ao = [
9056
+ ], ko = [
8937
9057
  {
8938
9058
  type: "tx.order_summary",
8939
9059
  category: "transactional",
@@ -9136,7 +9256,7 @@ var Co = [
9136
9256
  B(16)
9137
9257
  ])
9138
9258
  }
9139
- ], jo = [
9259
+ ], Ao = [
9140
9260
  {
9141
9261
  type: "social.icons",
9142
9262
  category: "social",
@@ -9254,11 +9374,11 @@ var Co = [
9254
9374
  B(8)
9255
9375
  ])
9256
9376
  }
9257
- ], Mo = {
9377
+ ], jo = {
9258
9378
  backgroundColor: "{colors.background}",
9259
9379
  paddingTop: 0,
9260
9380
  paddingBottom: 0
9261
- }, No = [
9381
+ }, Mo = [
9262
9382
  {
9263
9383
  type: "footer.simple",
9264
9384
  category: "footer",
@@ -9287,7 +9407,7 @@ var Co = [
9287
9407
  paddingBottom: 24
9288
9408
  })
9289
9409
  ], {
9290
- ...Mo,
9410
+ ...jo,
9291
9411
  paddingTop: 24
9292
9412
  })
9293
9413
  },
@@ -9320,7 +9440,7 @@ var Co = [
9320
9440
  align: "center",
9321
9441
  paddingBottom: 24
9322
9442
  })
9323
- ], Mo)
9443
+ ], jo)
9324
9444
  },
9325
9445
  {
9326
9446
  type: "footer.legal",
@@ -9344,7 +9464,7 @@ var Co = [
9344
9464
  color: "{colors.muted}",
9345
9465
  fontSize: 11,
9346
9466
  paddingBottom: 24
9347
- })], Mo)
9467
+ })], jo)
9348
9468
  },
9349
9469
  {
9350
9470
  type: "footer.publisher",
@@ -9391,7 +9511,7 @@ var Co = [
9391
9511
  paddingTop: 4,
9392
9512
  paddingBottom: 24
9393
9513
  })
9394
- ], Mo)
9514
+ ], jo)
9395
9515
  },
9396
9516
  {
9397
9517
  type: "footer.app_links",
@@ -9433,7 +9553,7 @@ var Co = [
9433
9553
  align: "center",
9434
9554
  paddingBottom: 24
9435
9555
  })
9436
- ], Mo)
9556
+ ], jo)
9437
9557
  },
9438
9558
  {
9439
9559
  type: "footer.address_only",
@@ -9453,7 +9573,7 @@ var Co = [
9453
9573
  align: "center",
9454
9574
  paddingBottom: 16
9455
9575
  })], {
9456
- ...Mo,
9576
+ ...jo,
9457
9577
  paddingTop: 16
9458
9578
  })
9459
9579
  },
@@ -9489,7 +9609,7 @@ var Co = [
9489
9609
  align: "center",
9490
9610
  paddingBottom: 24
9491
9611
  })
9492
- ], Mo)
9612
+ ], jo)
9493
9613
  },
9494
9614
  {
9495
9615
  type: "footer.signature",
@@ -9523,11 +9643,12 @@ var Co = [
9523
9643
  paddingBottom: 24
9524
9644
  })
9525
9645
  ], {
9526
- ...Mo,
9646
+ ...jo,
9527
9647
  paddingTop: 0
9528
9648
  })
9529
9649
  }
9530
- ], Po = [
9650
+ ], No = [
9651
+ ...So,
9531
9652
  ...Co,
9532
9653
  ...wo,
9533
9654
  ...To,
@@ -9536,19 +9657,18 @@ var Co = [
9536
9657
  ...Oo,
9537
9658
  ...ko,
9538
9659
  ...Ao,
9539
- ...jo,
9540
- ...No
9541
- ], Fo = !1;
9542
- function Io() {
9543
- if (!Fo) {
9544
- for (let e of Po) _t.register(e);
9545
- Fo = !0;
9660
+ ...Mo
9661
+ ], Po = !1;
9662
+ function Fo() {
9663
+ if (!Po) {
9664
+ for (let e of No) yt.register(e);
9665
+ Po = !0;
9546
9666
  }
9547
9667
  }
9548
9668
  //#endregion
9549
9669
  //#region src/App.tsx
9550
- Io();
9551
- function Lo() {
9670
+ Fo();
9671
+ function Io() {
9552
9672
  let { doc: e, addModule: t, loadFromLocalStorage: n } = I();
9553
9673
  return s(() => {
9554
9674
  if (n(), I.getState().doc.modules.length === 0) {
@@ -9558,7 +9678,7 @@ function Lo() {
9558
9678
  "cta.simple",
9559
9679
  "footer.simple"
9560
9680
  ]) {
9561
- let n = _t.get(e);
9681
+ let n = yt.get(e);
9562
9682
  n && t(n.create());
9563
9683
  }
9564
9684
  I.setState({
@@ -9575,170 +9695,21 @@ function Lo() {
9575
9695
  children: [/* @__PURE__ */ A(mt, {}), /* @__PURE__ */ j("div", {
9576
9696
  className: "flex flex-1 overflow-hidden",
9577
9697
  children: [
9578
- /* @__PURE__ */ A(Ht, {}),
9579
- /* @__PURE__ */ A(ha, {}),
9580
- /* @__PURE__ */ A(Qa, {})
9698
+ /* @__PURE__ */ A(Ut, {}),
9699
+ /* @__PURE__ */ A(fa, {}),
9700
+ /* @__PURE__ */ A(Ya, {})
9581
9701
  ]
9582
9702
  })]
9583
9703
  });
9584
9704
  }
9585
9705
  //#endregion
9586
- //#region src/gallery/sampleGallery.ts
9587
- var Ro = {
9588
- id: "starter-gallery",
9589
- name: "Starter Gallery",
9590
- description: "A curated set of extra header, content, ecommerce and menu styles to showcase how galleries extend the builder.",
9591
- badge: "New",
9592
- items: [
9593
- {
9594
- type: "gallery.header.gradient_hero",
9595
- category: "header",
9596
- name: "Gradient Hero",
9597
- description: "Bold centered hero with an eyebrow, oversized headline and a primary button on a tinted background. Great for launch announcements.",
9598
- tags: [
9599
- "hero",
9600
- "gradient",
9601
- "launch",
9602
- "cta",
9603
- "bold"
9604
- ],
9605
- create: () => H("gallery.header.gradient_hero", "Gradient Hero", [
9606
- W("Introducing", { align: "center" }),
9607
- U("Something new is here", {
9608
- level: 1,
9609
- align: "center",
9610
- paddingTop: 4,
9611
- paddingBottom: 8
9612
- }),
9613
- L("A fresh way to reach your audience — crafted for the inbox.", {
9614
- align: "center",
9615
- color: "{colors.muted}",
9616
- fontSize: 16,
9617
- paddingBottom: 20
9618
- }),
9619
- z("Explore now", "#", { align: "center" })
9620
- ], {
9621
- backgroundColor: "{colors.surface}",
9622
- paddingTop: 40,
9623
- paddingBottom: 40
9624
- })
9625
- },
9626
- {
9627
- type: "gallery.content.quote",
9628
- category: "content",
9629
- name: "Pull Quote",
9630
- description: "Large centered quotation with an attribution line. Use to highlight a testimonial or a memorable line.",
9631
- tags: [
9632
- "quote",
9633
- "testimonial",
9634
- "highlight",
9635
- "pull-quote"
9636
- ],
9637
- create: () => H("gallery.content.quote", "Pull Quote", [L("“This is the fastest we've ever shipped a campaign.”", {
9638
- fontFamily: "{fonts.heading}",
9639
- fontSize: 24,
9640
- align: "center",
9641
- lineHeight: 1.4,
9642
- paddingTop: 28,
9643
- paddingBottom: 8
9644
- }), G("— A very happy customer", {
9645
- align: "center",
9646
- paddingBottom: 28
9647
- })])
9648
- },
9649
- {
9650
- type: "gallery.content.stat_row",
9651
- category: "content",
9652
- name: "Stat Row",
9653
- description: "Three short number + label pairs in a row. Use to show traction, metrics or highlights.",
9654
- tags: [
9655
- "stats",
9656
- "metrics",
9657
- "numbers",
9658
- "row",
9659
- "kpi"
9660
- ],
9661
- create: () => H("gallery.content.stat_row", "Stat Row", [U("By the numbers", {
9662
- align: "center",
9663
- paddingTop: 24
9664
- }), L("<b>10k+</b> subscribers &nbsp;·&nbsp; <b>98%</b> delivery &nbsp;·&nbsp; <b>4.9★</b> rating", {
9665
- align: "center",
9666
- color: "{colors.muted}",
9667
- paddingBottom: 24
9668
- })])
9669
- },
9670
- {
9671
- type: "gallery.ecommerce.single_product",
9672
- category: "ecommerce",
9673
- name: "Single Product Spotlight",
9674
- description: "One product with image, name, price and buy button. Use to feature a hero product.",
9675
- tags: [
9676
- "product",
9677
- "spotlight",
9678
- "single",
9679
- "buy",
9680
- "shop"
9681
- ],
9682
- create: () => H("gallery.ecommerce.single_product", "Product Spotlight", [ot([q({
9683
- name: "The Signature Bag",
9684
- finalPrice: "$129",
9685
- oldPrice: "$159",
9686
- description: "Handmade, built to last.",
9687
- image: K(520, 520, "Product")
9688
- })], {
9689
- columns: 1,
9690
- showDescription: !0,
9691
- buttonLabel: "Buy now"
9692
- })])
9693
- },
9694
- {
9695
- type: "gallery.menu.pill_nav",
9696
- category: "menu",
9697
- name: "Pill Navigation",
9698
- description: "Centered row of navigation links with a divider below. Compact top-of-email menu.",
9699
- tags: [
9700
- "menu",
9701
- "nav",
9702
- "links",
9703
- "pill"
9704
- ],
9705
- create: () => H("gallery.menu.pill_nav", "Pill Navigation", [
9706
- R(K(120, 32, "LOGO"), "Logo", {
9707
- width: 120,
9708
- paddingBottom: 8
9709
- }),
9710
- L("<a href=\"#\">Shop</a> &nbsp; <a href=\"#\">New</a> &nbsp; <a href=\"#\">Sale</a> &nbsp; <a href=\"#\">About</a>", {
9711
- align: "center",
9712
- color: "{colors.primary}",
9713
- paddingBottom: 8
9714
- }),
9715
- V({
9716
- paddingTop: 4,
9717
- paddingBottom: 0
9718
- })
9719
- ])
9720
- }
9721
- ]
9722
- };
9723
- //#endregion
9724
- //#region src/gallery/index.ts
9725
- function zo(...e) {
9726
- return {
9727
- name: "gallery",
9728
- type: "modules",
9729
- setup(t) {
9730
- for (let t of e) yt.registerGallery(t);
9731
- }
9732
- };
9733
- }
9734
- //#endregion
9735
9706
  //#region src/ai/provider.ts
9736
- var Bo = (e) => {
9707
+ var Lo = (e) => {
9737
9708
  if (e && typeof e == "object") return e;
9738
9709
  throw Error("AI server returned a non-object response.");
9739
9710
  };
9740
- function Vo(e) {
9741
- let t = e.transformResponse ?? Bo, n = e.timeoutMs ?? 6e4;
9711
+ function Ro(e) {
9712
+ let t = e.transformResponse ?? Lo, n = e.timeoutMs ?? 6e4;
9742
9713
  return { async generate(r) {
9743
9714
  let i = new AbortController(), a = setTimeout(() => i.abort(), n);
9744
9715
  try {
@@ -9769,8 +9740,8 @@ function Vo(e) {
9769
9740
  }
9770
9741
  //#endregion
9771
9742
  //#region src/ai/index.ts
9772
- function Ho(e) {
9773
- let t = Vo(e);
9743
+ function zo(e) {
9744
+ let t = Ro(e);
9774
9745
  return {
9775
9746
  name: "ai-assistant",
9776
9747
  type: "ai-provider",
@@ -9781,7 +9752,7 @@ function Ho(e) {
9781
9752
  }
9782
9753
  //#endregion
9783
9754
  //#region src/plugins/imageUploader/index.ts
9784
- var Uo = (e) => {
9755
+ var Bo = (e) => {
9785
9756
  if (e && typeof e == "object" && "url" in e && typeof e.url == "string") {
9786
9757
  let t = e;
9787
9758
  return {
@@ -9791,8 +9762,8 @@ var Uo = (e) => {
9791
9762
  }
9792
9763
  throw Error("Server response missing \"url\" string field.");
9793
9764
  };
9794
- function Wo(e) {
9795
- let t = e.fieldName ?? "file", n = (e.maxSizeMB ?? 10) * 1024 * 1024, r = e.transformResponse ?? Uo;
9765
+ function Vo(e) {
9766
+ let t = e.fieldName ?? "file", n = (e.maxSizeMB ?? 10) * 1024 * 1024, r = e.transformResponse ?? Bo;
9796
9767
  return { upload(i) {
9797
9768
  return i.type.startsWith("image/") ? i.size > n ? Promise.reject(/* @__PURE__ */ Error(`File too large: ${(i.size / 1024 / 1024).toFixed(2)} MB > ${e.maxSizeMB ?? 10} MB`)) : new Promise((n, a) => {
9798
9769
  let o = new XMLHttpRequest(), s = new FormData();
@@ -9817,25 +9788,24 @@ function Wo(e) {
9817
9788
  }) : Promise.reject(/* @__PURE__ */ Error(`Not an image: ${i.type || "unknown"}`));
9818
9789
  } };
9819
9790
  }
9820
- function Go(e) {
9791
+ function Ho(e) {
9821
9792
  return {
9822
9793
  name: "image-uploader",
9823
9794
  type: "asset-provider",
9824
9795
  setup(t) {
9825
- t.registerAssetProvider(Wo(e));
9796
+ t.registerAssetProvider(Vo(e));
9826
9797
  }
9827
9798
  };
9828
9799
  }
9829
9800
  //#endregion
9830
9801
  //#region src/index.ts
9831
- function Ko(e) {
9802
+ function Uo(e) {
9832
9803
  return s(() => {
9833
- if (Io(), e.modules) for (let t of e.modules) _t.register(t);
9834
- if (e.galleries) for (let t of e.galleries) yt.registerGallery(t);
9835
- if (e.themes && I.setState({ themes: e.themes }), e.aiProvider) Da.setAIProvider(e.aiProvider);
9804
+ if (Fo(), e.modules) for (let t of e.modules) yt.register(t);
9805
+ if (e.themes && I.setState({ themes: e.themes }), e.aiProvider) wa.setAIProvider(e.aiProvider);
9836
9806
  else if (e.aiEndpoint) {
9837
9807
  let t = typeof e.aiEndpoint == "string" ? { endpoint: e.aiEndpoint } : e.aiEndpoint;
9838
- Da.setAIProvider(Vo(t));
9808
+ wa.setAIProvider(Ro(t));
9839
9809
  }
9840
9810
  if (e.initialDocument) {
9841
9811
  let t = Me.safeParse(e.initialDocument);
@@ -9849,11 +9819,11 @@ function Ko(e) {
9849
9819
  if (e.onExportHtml) return I.subscribe((t, n) => {
9850
9820
  t.doc !== n.doc && e.onExportHtml?.(Je(t.doc));
9851
9821
  });
9852
- }, [e.onExportHtml]), r(Lo);
9822
+ }, [e.onExportHtml]), r(Io);
9853
9823
  }
9854
- function qo(t) {
9824
+ function Wo(t) {
9855
9825
  let n = e(t.container);
9856
- return n.render(r(Ko, t)), {
9826
+ return n.render(r(Uo, t)), {
9857
9827
  destroy: () => n.unmount(),
9858
9828
  getDocument: () => I.getState().doc,
9859
9829
  exportHtml: () => I.getState().exportHtml(),
@@ -9861,6 +9831,6 @@ function qo(t) {
9861
9831
  };
9862
9832
  }
9863
9833
  //#endregion
9864
- export { ja as ALGORITHMS, Ma as ALGORITHM_BY_ID, Ko as EmailBuilder, Na as FALLBACK_OPTIONS, it as TEMPLATE_CATEGORY_LABELS, Ho as aiAssistantPlugin, kt as applyAIActions, It as applyAIResponse, Ot as buildCatalog, qo as createEmailBuilder, Vo as createHttpAIProvider, Pa as defaultRecommendationsLogic, Me as documentSchema, zo as galleryPlugin, yt as galleryRegistry, Go as imageUploaderPlugin, Mt as mockAIProvider, Fa as readRecommendationsLogic, Ra as recommendationsToLegacyShape, Oa as registerPlugin, Je as renderEmailHtml, Ro as sampleGallery, rt as templateRegistry, jt as validateAIDocument };
9834
+ export { Oa as ALGORITHMS, ka as ALGORITHM_BY_ID, Uo as EmailBuilder, Aa as FALLBACK_OPTIONS, it as TEMPLATE_CATEGORY_LABELS, zo as aiAssistantPlugin, At as applyAIActions, Lt as applyAIResponse, kt as buildCatalog, Wo as createEmailBuilder, Ro as createHttpAIProvider, ja as defaultRecommendationsLogic, Me as documentSchema, Ho as imageUploaderPlugin, Nt as mockAIProvider, Ma as readRecommendationsLogic, Fa as recommendationsToLegacyShape, Ta as registerPlugin, Je as renderEmailHtml, rt as templateRegistry, Mt as validateAIDocument };
9865
9835
 
9866
9836
  //# sourceMappingURL=email-builder.js.map