monto-email-builder 1.4.4 → 1.4.5

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.
@@ -1,171 +1,172 @@
1
- import { jsx as r, jsxs as x, Fragment as Nt } from "react/jsx-runtime";
2
- import { forwardRef as ut, useState as V, useRef as $, useEffect as G, useCallback as L, useMemo as J, useImperativeHandle as Ot } from "react";
3
- import Pt from "@uiw/react-codemirror";
4
- import { html as _t } from "@codemirror/lang-html";
5
- import { xcodeDark as Wt, tomorrowNightBlue as jt, dracula as mt, basicDark as Gt, abcdef as qt, bbedit as Ut, noctisLilac as Yt, gruvboxLight as Kt, tokyoNightDay as Xt, vscodeLight as Jt, xcodeLight as Qt } from "@uiw/codemirror-themes-all";
1
+ import { jsx as r, jsxs as g, Fragment as Ot } from "react/jsx-runtime";
2
+ import { forwardRef as ut, useState as V, useRef as $, useEffect as G, useCallback as L, useMemo as J, useImperativeHandle as Pt } from "react";
3
+ import _t from "@uiw/react-codemirror";
4
+ import { html as Wt } from "@codemirror/lang-html";
5
+ import { xcodeDark as jt, tomorrowNightBlue as Gt, dracula as mt, basicDark as qt, abcdef as Ut, bbedit as Yt, noctisLilac as Kt, gruvboxLight as Xt, tokyoNightDay as Jt, vscodeLight as Qt, xcodeLight as Zt } from "@uiw/codemirror-themes-all";
6
6
  import Q from "@mui/material/ToggleButton";
7
7
  import et from "@mui/material/ToggleButtonGroup";
8
- import { ThemeProvider as Zt, ScopedCssBaseline as er, useTheme as tr, Box as h, Tooltip as q, FormControl as rr, InputLabel as or, Select as nr, ListSubheader as tt, MenuItem as rt, Button as Ie, Tabs as ar, Tab as ot, Typography as k, Accordion as ir, AccordionSummary as lr, AccordionDetails as sr, TextField as Ee, Divider as cr } from "@mui/material";
8
+ import { ThemeProvider as er, ScopedCssBaseline as tr, useTheme as rr, Box as h, Tooltip as q, FormControl as or, InputLabel as ar, Select as nr, ListSubheader as tt, MenuItem as rt, Button as Ie, Tabs as ir, Tab as ot, Typography as k, Accordion as lr, AccordionSummary as sr, AccordionDetails as cr, TextField as Ee, Divider as dr } from "@mui/material";
9
9
  import { alpha as de } from "@mui/material/styles";
10
- import * as dr from "@mui/icons-material/AddOutlined";
11
- import * as ur from "@mui/icons-material/Code";
12
- import * as mr from "@mui/icons-material/DataObjectOutlined";
13
- import * as hr from "@mui/icons-material/ExpandMoreOutlined";
14
- import * as br from "@mui/icons-material/HelpOutlined";
15
- import * as pr from "@mui/icons-material/Visibility";
16
- import * as fr from "@mui/icons-material/ViewColumn";
10
+ import * as ur from "@mui/icons-material/AddOutlined";
11
+ import * as mr from "@mui/icons-material/Code";
12
+ import * as hr from "@mui/icons-material/DataObjectOutlined";
13
+ import * as br from "@mui/icons-material/ExpandMoreOutlined";
14
+ import * as pr from "@mui/icons-material/HelpOutlined";
15
+ import * as fr from "@mui/icons-material/Visibility";
16
+ import * as gr from "@mui/icons-material/ViewColumn";
17
17
  import * as xr from "@mui/icons-material/MonitorOutlined";
18
- import * as gr from "@mui/icons-material/PhoneIphoneOutlined";
19
- import { B as vr, V as F, r as B, T as yr, a as nt, t as Ir } from "./chunks/chunk-CT9uNEVC.js";
20
- const Ve = vr, at = "unsubscribe_link", Te = /\{\{\s*([^{}]+?)\s*\}\}/g, it = /\{%\s*([^{}%]+?)\s*%\}/g;
21
- function Ce(n, a, s, u, d) {
22
- return n[a - 1] !== u && n[s] !== d;
18
+ import * as vr from "@mui/icons-material/PhoneIphoneOutlined";
19
+ import { B as yr, V as F, i as ht, r as B, T as Ir, a as at, t as Er } from "./chunks/chunk-BN0O7D8l.js";
20
+ const Ve = yr, nt = "unsubscribe_link", Ce = /\{\{\s*([^{}]+?)\s*\}\}/g, it = /\{%\s*([^{}%]+?)\s*%\}/g;
21
+ function Te(a, n, l, u, d) {
22
+ return a[n - 1] !== u && a[l] !== d;
23
23
  }
24
- function ht(n, a = "user") {
25
- return a === "builtin" || a === "system" ? `{%${n}%}` : `{{${n}}}`;
24
+ function bt(a, n = "user") {
25
+ return n === "builtin" || n === "system" ? `{%${a}%}` : `{{${a}}}`;
26
26
  }
27
- function Er(n) {
28
- const a = typeof n == "string" ? n.trim() : "";
29
- if (a.startsWith("{{") && a.endsWith("}}")) {
30
- const s = a.slice(2, -2).trim();
31
- if (F.test(s)) return { attribute: s, type: "user" };
27
+ function Vr(a) {
28
+ const n = typeof a == "string" ? a.trim() : "";
29
+ if (n.startsWith("{{") && n.endsWith("}}")) {
30
+ const l = n.slice(2, -2).trim();
31
+ if (F.test(l))
32
+ return { attribute: l, type: ht(l) ? "system" : "user" };
32
33
  }
33
- if (a.startsWith("{%") && a.endsWith("%}")) {
34
- const s = a.slice(2, -2).trim();
35
- if (F.test(s)) return { attribute: s, type: "system" };
34
+ if (n.startsWith("{%") && n.endsWith("%}")) {
35
+ const l = n.slice(2, -2).trim();
36
+ if (F.test(l)) return { attribute: l, type: "system" };
36
37
  }
37
38
  return null;
38
39
  }
39
- function Vr(n, a) {
40
- const s = n.variable ?? n.Variable ?? n.key ?? "", u = Er(s), g = (n.type ?? n.Type ?? (u == null ? void 0 : u.type) ?? "user") === "system" ? "system" : "user", i = n.attribute ?? n.Attribute ?? (u == null ? void 0 : u.attribute) ?? "", m = String(i).trim();
40
+ function Cr(a, n) {
41
+ const l = a.variable ?? a.Variable ?? a.key ?? "", u = Vr(l), x = (a.type ?? a.Type ?? (u == null ? void 0 : u.type) ?? (ht(String(a.attribute ?? a.Attribute ?? (u == null ? void 0 : u.attribute) ?? "")) ? "system" : "user")) === "system" ? "system" : "user", i = a.attribute ?? a.Attribute ?? (u == null ? void 0 : u.attribute) ?? "", m = String(i).trim();
41
42
  return !m || !F.test(m) ? null : {
42
- id: Number(n.id) || a + 1,
43
- variableInstanceId: n.variableInstanceId ?? n.VariableInstanceId,
44
- variable: g === "system" ? `{%${m}%}` : `{{${m}}}`,
45
- type: g,
43
+ id: Number(a.id) || n + 1,
44
+ variableInstanceId: a.variableInstanceId ?? a.VariableInstanceId,
45
+ variable: x === "system" ? `{%${m}%}` : `{{${m}}}`,
46
+ type: x,
46
47
  attribute: m,
47
- default: String(n.default ?? n.Default ?? n.value ?? "")
48
+ default: String(a.default ?? a.Default ?? a.value ?? "")
48
49
  };
49
50
  }
50
- function lt(n) {
51
- return Array.isArray(n) ? n.map((a, s) => Vr(a, s)).filter((a) => !!a).map((a, s) => ({
52
- ...a,
53
- id: s + 1,
54
- variableInstanceId: a.variableInstanceId || He(a.type, a.attribute, s)
51
+ function lt(a) {
52
+ return Array.isArray(a) ? a.map((n, l) => Cr(n, l)).filter((n) => !!n).map((n, l) => ({
53
+ ...n,
54
+ id: l + 1,
55
+ variableInstanceId: n.variableInstanceId || He(n.type, n.attribute, l)
55
56
  })) : [];
56
57
  }
57
- function Z(n) {
58
- const a = n || "", s = [], u = (i, m, f) => {
59
- s.push({ attribute: i, type: m, start: f });
58
+ function Z(a) {
59
+ const n = a || "", l = [], u = (i, m, f) => {
60
+ l.push({ attribute: i, type: m, start: f });
60
61
  };
61
62
  let d;
62
- for (Te.lastIndex = 0; d = Te.exec(a); ) {
63
+ for (Ce.lastIndex = 0; d = Ce.exec(n); ) {
63
64
  const i = d.index, m = i + d[0].length;
64
- if (!Ce(a, i, m, "{", "}")) continue;
65
+ if (!Te(n, i, m, "{", "}")) continue;
65
66
  const f = d[1].trim();
66
67
  !f || !F.test(f) || u(f, "user", i);
67
68
  }
68
- let g;
69
- for (it.lastIndex = 0; g = it.exec(a); ) {
70
- const i = g.index, m = i + g[0].length;
71
- if (!Ce(a, i, m, "{", "}")) continue;
72
- const f = g[1].trim();
69
+ let x;
70
+ for (it.lastIndex = 0; x = it.exec(n); ) {
71
+ const i = x.index, m = i + x[0].length;
72
+ if (!Te(n, i, m, "{", "}")) continue;
73
+ const f = x[1].trim();
73
74
  !f || !F.test(f) || u(f, "system", i);
74
75
  }
75
- return s.sort((i, m) => i.start - m.start), s.map((i, m) => ({
76
+ return l.sort((i, m) => i.start - m.start), l.map((i, m) => ({
76
77
  id: m + 1,
77
- variableInstanceId: Hr(i.type, i.attribute, i.start),
78
+ variableInstanceId: Sr(i.type, i.attribute, i.start),
78
79
  variable: i.type === "system" ? `{%${i.attribute}%}` : `{{${i.attribute}}}`,
79
80
  type: i.type,
80
81
  attribute: i.attribute,
81
82
  default: ""
82
83
  }));
83
84
  }
84
- function ue(n, a) {
85
- const s = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
86
- return a.forEach((d) => {
87
- const g = { item: d, consumed: !1 };
85
+ function ue(a, n) {
86
+ const l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
87
+ return n.forEach((d) => {
88
+ const x = { item: d, consumed: !1 };
88
89
  if (d.variableInstanceId) {
89
- const f = s.get(d.variableInstanceId) ?? [];
90
- f.push(g), s.set(d.variableInstanceId, f);
90
+ const f = l.get(d.variableInstanceId) ?? [];
91
+ f.push(x), l.set(d.variableInstanceId, f);
91
92
  }
92
93
  const i = `${d.type}:${d.attribute}`, m = u.get(i) ?? [];
93
- m.push(g), u.set(i, m);
94
- }), n.map((d, g) => {
95
- var z;
96
- const i = `${d.type}:${d.attribute}`, m = d.variableInstanceId ? (z = s.get(d.variableInstanceId)) == null ? void 0 : z.find((v) => !v.consumed) : void 0, f = (u.get(i) ?? []).find((v) => !v.consumed), H = m ?? f;
94
+ m.push(x), u.set(i, m);
95
+ }), a.map((d, x) => {
96
+ var N;
97
+ const i = `${d.type}:${d.attribute}`, m = d.variableInstanceId ? (N = l.get(d.variableInstanceId)) == null ? void 0 : N.find((v) => !v.consumed) : void 0, f = (u.get(i) ?? []).find((v) => !v.consumed), H = m ?? f;
97
98
  return H && (H.consumed = !0), {
98
99
  ...d,
99
- id: g + 1,
100
- variableInstanceId: d.variableInstanceId || He(d.type, d.attribute, g),
100
+ id: x + 1,
101
+ variableInstanceId: d.variableInstanceId || He(d.type, d.attribute, x),
101
102
  default: d.type === "system" ? "" : (H == null ? void 0 : H.item.default) ?? d.default ?? ""
102
103
  };
103
104
  });
104
105
  }
105
- function Tr(n) {
106
- return n.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
106
+ function Tr(a) {
107
+ return a.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
107
108
  }
108
- function st(n, a) {
109
- const s = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
110
- a.forEach((i) => {
111
- i.type === "user" && (i.variableInstanceId && s.set(i.variableInstanceId, i.default ?? ""), u.has(i.attribute) || u.set(i.attribute, i.default ?? ""));
109
+ function st(a, n) {
110
+ const l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map();
111
+ n.forEach((i) => {
112
+ i.type === "user" && (i.variableInstanceId && l.set(i.variableInstanceId, i.default ?? ""), u.has(i.attribute) || u.set(i.attribute, i.default ?? ""));
112
113
  });
113
- const d = Z(n), g = /* @__PURE__ */ new Map();
114
+ const d = Z(a), x = /* @__PURE__ */ new Map();
114
115
  return d.forEach((i) => {
115
116
  const m = Number(String(i.variableInstanceId ?? "").split("-at-")[1]);
116
- Number.isFinite(m) && g.set(m, i);
117
- }), (n || "").replace(Te, (i, m, f, H) => {
117
+ Number.isFinite(m) && x.set(m, i);
118
+ }), (a || "").replace(Ce, (i, m, f, H) => {
118
119
  var ee;
119
- const z = f + i.length;
120
- if (!Ce(H, f, z, "{", "}")) return i;
120
+ const N = f + i.length;
121
+ if (!Te(H, f, N, "{", "}")) return i;
121
122
  const v = String(m).trim();
122
123
  if (!v || !F.test(v)) return i;
123
- const R = (ee = g.get(f)) == null ? void 0 : ee.variableInstanceId, N = (R ? s.get(R) : void 0) ?? (a.filter((l) => l.type === "user" && l.attribute === v).length === 1 ? u.get(v) : void 0);
124
- return N === void 0 || N === "" ? i : Tr(N);
124
+ const R = (ee = x.get(f)) == null ? void 0 : ee.variableInstanceId, z = (R ? l.get(R) : void 0) ?? (n.filter((s) => s.type === "user" && s.attribute === v).length === 1 ? u.get(v) : void 0);
125
+ return z === void 0 || z === "" ? i : Tr(z);
125
126
  });
126
127
  }
127
- function ct(n, a, s = "") {
128
- const u = n.trim();
128
+ function ct(a, n, l = "") {
129
+ const u = a.trim();
129
130
  if (!u || !F.test(u)) return null;
130
- const d = a === "builtin" ? "system" : "user";
131
+ const d = n === "builtin" ? "system" : "user";
131
132
  return {
132
133
  id: 1,
133
134
  variableInstanceId: He(d, u, 0),
134
- variable: ht(u, a),
135
+ variable: bt(u, n),
135
136
  type: d,
136
137
  attribute: u,
137
- default: d === "system" ? "" : s
138
+ default: d === "system" ? "" : l
138
139
  };
139
140
  }
140
- function Cr(n) {
141
- const a = n.trim();
142
- return a ? Ve.some((s) => s.items.some((u) => u.name === a)) : !1;
141
+ function wr(a) {
142
+ const n = a.trim();
143
+ return n ? Ve.some((l) => l.items.some((u) => u.name === n)) : !1;
143
144
  }
144
- function wr(n, a) {
145
- const s = n.trim();
146
- return a === "user" && s === at ? `<a href="{{${at}}}">Unsubscribe Link</a>` : ht(s, a);
145
+ function Hr(a, n) {
146
+ const l = a.trim();
147
+ return n === "builtin" && l === nt ? `<a href="{%${nt}%}">Unsubscribe Link</a>` : bt(l, n);
147
148
  }
148
- function He(n, a, s) {
149
- return `html-${n}-${a}-${s + 1}`;
149
+ function He(a, n, l) {
150
+ return `html-${a}-${n}-${l + 1}`;
150
151
  }
151
- function Hr(n, a, s) {
152
- return `html-${n}-${a}-at-${s}`;
152
+ function Sr(a, n, l) {
153
+ return `html-${a}-${n}-at-${l}`;
153
154
  }
154
- const Sr = B(dr), Dr = B(ur), Mr = B(mr), Lr = B(hr), kr = B(br), Br = B(pr), Ar = B(fr), Fr = B(xr), Rr = B(gr), we = {
155
+ const Dr = B(ur), Mr = B(mr), Lr = B(hr), kr = B(br), Br = B(pr), Ar = B(fr), Fr = B(gr), Rr = B(xr), $r = B(vr), we = {
155
156
  // 浅色主题
156
- xcodeLight: Qt,
157
- vscodeLight: Jt,
158
- tokyoNightDay: Xt,
159
- gruvboxLight: Kt,
160
- noctisLilac: Yt,
161
- bbedit: Ut,
157
+ xcodeLight: Zt,
158
+ vscodeLight: Qt,
159
+ tokyoNightDay: Jt,
160
+ gruvboxLight: Xt,
161
+ noctisLilac: Kt,
162
+ bbedit: Yt,
162
163
  // 深色主题
163
- abcdef: qt,
164
- basicDark: Gt,
164
+ abcdef: Ut,
165
+ basicDark: qt,
165
166
  dracula: mt,
166
- tomorrowNightBlue: jt,
167
- xcodeDark: Wt
168
- }, $r = {
167
+ tomorrowNightBlue: Gt,
168
+ xcodeDark: jt
169
+ }, Nr = {
169
170
  xcodeLight: "Xcode Light (Light)",
170
171
  vscodeLight: "VSCode Light (Light)",
171
172
  tokyoNightDay: "Tokyo Night Day (Light)",
@@ -178,56 +179,56 @@ const Sr = B(dr), Dr = B(ur), Mr = B(mr), Lr = B(hr), kr = B(br), Br = B(pr), Ar
178
179
  dracula: "Dracula (Dark)",
179
180
  tomorrowNightBlue: "Tomorrow Night Blue (Dark)",
180
181
  xcodeDark: "Xcode Dark (Dark)"
181
- }, bt = "html-editor-theme", dt = "dracula";
182
- function Nr(n = dt) {
183
- const a = n && we[n] ? n : dt;
184
- if (typeof window > "u") return a;
182
+ }, pt = "html-editor-theme", dt = "dracula";
183
+ function Or(a = dt) {
184
+ const n = a && we[a] ? a : dt;
185
+ if (typeof window > "u") return n;
185
186
  try {
186
- const s = localStorage.getItem(bt);
187
- if (s && we[s]) return s;
187
+ const l = localStorage.getItem(pt);
188
+ if (l && we[l]) return l;
188
189
  } catch {
189
190
  console.error("Failed to get HTML Editor stored theme");
190
191
  }
191
- return a;
192
+ return n;
192
193
  }
193
- function Or(n) {
194
+ function Pr(a) {
194
195
  try {
195
- localStorage.setItem(bt, n);
196
+ localStorage.setItem(pt, a);
196
197
  } catch {
197
- console.error("Failed to set HTML Editor stored theme", n);
198
+ console.error("Failed to set HTML Editor stored theme", a);
198
199
  }
199
200
  }
200
- function Pr({
201
- value: n,
202
- onChange: a,
203
- language: s = "zh",
201
+ function _r({
202
+ value: a,
203
+ onChange: n,
204
+ language: l = "zh",
204
205
  initialMode: u = "split",
205
206
  initialDevice: d = "desktop",
206
- codeEditorHeight: g = "100%",
207
+ codeEditorHeight: x = "100%",
207
208
  previewHeight: i = "100%",
208
209
  sx: m,
209
210
  showToolbar: f = !0,
210
211
  initialTheme: H,
211
- initialRightTab: z = "preview",
212
+ initialRightTab: N = "preview",
212
213
  variables: v,
213
214
  onVariablesChange: R,
214
- requireVariableDefaults: N = !0
215
+ requireVariableDefaults: z = !0
215
216
  }, ee) {
216
- var Re, $e, ze, Ne, Oe, Pe, _e, We, je, Ge, qe, Ue, Ye, Ke, Xe, Je, Qe, Ze;
217
- const l = (e, t) => Ir(e, t, s), [S, ft] = V(u), [O, xt] = V(d), [Se, gt] = V(() => Nr(H)), [E, me] = V(n), [te, P] = V(z), [w, he] = V(() => lt(v)), [vt, yt] = V(!1), [It, Et] = V(null), [_, De] = V(""), [W, Me] = V(""), [be, re] = V(!1), [pe, oe] = V(!1), U = $(null), fe = $(null), T = $(w), Le = $(null), ke = $(null), xe = $(!1), ne = $(null);
217
+ var Re, $e, Ne, ze, Oe, Pe, _e, We, je, Ge, qe, Ue, Ye, Ke, Xe, Je, Qe, Ze;
218
+ const s = (e, t) => Er(e, t, l), [S, gt] = V(u), [O, xt] = V(d), [Se, vt] = V(() => Or(H)), [E, me] = V(a), [te, P] = V(N), [w, he] = V(() => lt(v)), [yt, It] = V(!1), [Et, Vt] = V(null), [_, De] = V(""), [W, Me] = V(""), [be, re] = V(!1), [pe, oe] = V(!1), U = $(null), fe = $(null), C = $(w), Le = $(null), ke = $(null), ge = $(!1), ae = $(null);
218
219
  G(() => {
219
- n !== E && me(n);
220
- }, [n]), G(() => {
220
+ a !== E && me(a);
221
+ }, [a]), G(() => {
221
222
  if (v === void 0) return;
222
223
  const e = lt(v);
223
- T.current = e, he(e);
224
+ C.current = e, he(e);
224
225
  }, [v]), G(() => {
225
226
  if (v !== void 0) return;
226
- const e = Z(E), t = ue(e, T.current);
227
- (t.length !== T.current.length || t.some((c, y) => {
228
- const b = T.current[y];
227
+ const e = Z(E), t = ue(e, C.current);
228
+ (t.length !== C.current.length || t.some((c, y) => {
229
+ const b = C.current[y];
229
230
  return !b || b.variableInstanceId !== c.variableInstanceId || b.attribute !== c.attribute || b.type !== c.type || b.default !== c.default;
230
- })) && (T.current = t, he(t));
231
+ })) && (C.current = t, he(t));
231
232
  }, [E, v]);
232
233
  const A = L(
233
234
  (e) => {
@@ -236,45 +237,45 @@ function Pr({
236
237
  id: c + 1,
237
238
  default: o.type === "system" ? "" : o.default ?? ""
238
239
  }));
239
- return T.current = t, he(t), R == null || R(t), t;
240
+ return C.current = t, he(t), R == null || R(t), t;
240
241
  },
241
242
  [R]
242
243
  ), D = L(() => {
243
244
  var t, o;
244
245
  const e = (o = (t = fe.current) == null ? void 0 : t.state) == null ? void 0 : o.doc;
245
246
  return e && typeof e.toString == "function" ? e.toString() : E;
246
- }, [E]), ge = (e) => {
247
+ }, [E]), xe = (e) => {
247
248
  me(e), U.current && clearTimeout(U.current), U.current = setTimeout(() => {
248
- a == null || a(e);
249
+ n == null || n(e);
249
250
  }, 300);
250
251
  }, Y = L(
251
252
  (e) => {
252
- const t = Z(e ?? D()), o = ue(t, T.current);
253
+ const t = Z(e ?? D()), o = ue(t, C.current);
253
254
  return A(o);
254
255
  },
255
256
  [D, A]
256
- ), ae = L(() => {
257
+ ), ne = L(() => {
257
258
  const e = D();
258
259
  e !== E && me(e);
259
- const t = Y(e), o = N ? t.filter(
260
- (c) => c.type === "user" && nt(c.attribute, "user") && c.default.trim() === ""
260
+ const t = Y(e), o = z ? t.filter(
261
+ (c) => c.type === "user" && at(c.attribute, "user") && c.default.trim() === ""
261
262
  ) : [];
262
- return yt(o.length > 0), o.length > 0 && P("variables"), {
263
+ return It(o.length > 0), o.length > 0 && P("variables"), {
263
264
  valid: o.length === 0,
264
265
  variables: t,
265
266
  missing: o
266
267
  };
267
- }, [D, E, N, Y]), Vt = L(() => {
268
- xe.current = !0, ae(), P("variables");
269
- }, [ae]);
268
+ }, [D, E, z, Y]), Ct = L(() => {
269
+ ge.current = !0, ne(), P("variables");
270
+ }, [ne]);
270
271
  G(() => {
271
- if (te !== "variables" || !xe.current) return;
272
+ if (te !== "variables" || !ge.current) return;
272
273
  const e = window.requestAnimationFrame(() => {
273
274
  const t = Le.current, o = ke.current;
274
275
  t && o && t.scrollTo({
275
276
  top: Math.max(o.offsetTop - 8, 0),
276
277
  behavior: "auto"
277
- }), xe.current = !1;
278
+ }), ge.current = !1;
278
279
  });
279
280
  return () => window.cancelAnimationFrame(e);
280
281
  }, [te, w.length]), G(() => () => {
@@ -287,8 +288,8 @@ function Pr({
287
288
  if (!t.trim())
288
289
  o = "<!DOCTYPE html><html><head></head><body></body></html>";
289
290
  else {
290
- const M = new DOMParser().parseFromString(t, "text/html"), ye = ((p = M.documentElement) == null ? void 0 : p.tagName.toLowerCase()) === "html", Rt = ((I = M.head) == null ? void 0 : I.tagName.toLowerCase()) === "head", $t = ((K = M.body) == null ? void 0 : K.tagName.toLowerCase()) === "body";
291
- if (!ye || !Rt || !$t) {
291
+ const M = new DOMParser().parseFromString(t, "text/html"), ye = ((p = M.documentElement) == null ? void 0 : p.tagName.toLowerCase()) === "html", $t = ((I = M.head) == null ? void 0 : I.tagName.toLowerCase()) === "head", Nt = ((K = M.body) == null ? void 0 : K.tagName.toLowerCase()) === "body";
292
+ if (!ye || !$t || !Nt) {
292
293
  const zt = M.body ? M.body.innerHTML : t;
293
294
  o = `<!DOCTYPE html><html><head>${M.head ? M.head.innerHTML : ""}</head><body>${zt}</body></html>`;
294
295
  } else
@@ -302,26 +303,26 @@ function Pr({
302
303
  () => st(E, w),
303
304
  [w, E]
304
305
  ), ie = J(() => Tt(Be), [Be]);
305
- Ot(
306
+ Pt(
306
307
  ee,
307
308
  () => ({
308
309
  getValue: () => D(),
309
- getPreviewHtml: () => st(D(), T.current),
310
+ getPreviewHtml: () => st(D(), C.current),
310
311
  scanVariables: () => Y(D()),
311
312
  getVariables: (e) => {
312
313
  const t = Y(D());
313
314
  return e == null || e(t), t;
314
315
  },
315
- validateVariables: ae,
316
+ validateVariables: ne,
316
317
  showVariables: () => P("variables")
317
318
  }),
318
- [D, Y, ae]
319
+ [D, Y, ne]
319
320
  ), G(() => {
320
- ne.current && ne.current.srcdoc !== ie && (ne.current.srcdoc = ie);
321
+ ae.current && ae.current.srcdoc !== ie && (ae.current.srcdoc = ie);
321
322
  }, [ie]);
322
- const Ct = (e, t) => {
323
- t !== null && ft(t);
324
- }, wt = (e, t) => {
323
+ const wt = (e, t) => {
324
+ t !== null && gt(t);
325
+ }, Ht = (e, t) => {
325
326
  (t === "desktop" || t === "mobile") && xt(t);
326
327
  }, le = L(
327
328
  (e) => {
@@ -332,15 +333,15 @@ function Pr({
332
333
  return t.dispatch({
333
334
  changes: { from: I, to: K, insert: e },
334
335
  selection: { anchor: I + e.length }
335
- }), (y = t.focus) == null || y.call(t), ge(X), X;
336
+ }), (y = t.focus) == null || y.call(t), xe(X), X;
336
337
  }
337
338
  const o = `${E}${e}`;
338
- return ge(o), o;
339
+ return xe(o), o;
339
340
  },
340
341
  [E]
341
- ), Ht = L(
342
+ ), St = L(
342
343
  (e, t) => {
343
- const o = T.current;
344
+ const o = C.current;
344
345
  A(
345
346
  o.map(
346
347
  (c) => c.variableInstanceId === e ? { ...c, default: t } : c
@@ -348,22 +349,22 @@ function Pr({
348
349
  );
349
350
  },
350
351
  [A]
351
- ), St = L(
352
+ ), Dt = L(
352
353
  (e, t) => {
353
354
  if (!ct(e, t)) return;
354
- const c = le(wr(e, t)), y = Z(c), b = ue(y, T.current);
355
+ const c = le(Hr(e, t)), y = Z(c), b = ue(y, C.current);
355
356
  A(b), P("variables");
356
357
  },
357
358
  [le, A]
358
359
  ), se = J(() => {
359
360
  const e = _.trim();
360
- return e ? F.test(e) ? Cr(e) || w.some((t) => t.type === "user" && t.attribute === e) ? l("text.variables.customVariableNameDuplicate") : "" : l("text.variables.customVariableNameInvalid") : l("text.variables.customVariableNameRequired");
361
- }, [_, w]), Dt = L(() => {
361
+ return e ? F.test(e) ? wr(e) || w.some((t) => t.type === "user" && t.attribute === e) ? s("text.variables.customVariableNameDuplicate") : "" : s("text.variables.customVariableNameInvalid") : s("text.variables.customVariableNameRequired");
362
+ }, [_, w]), Mt = L(() => {
362
363
  const e = W.trim();
363
364
  if (re(!0), oe(!0), se || e === "") return;
364
365
  const t = ct(_.trim(), "user", e);
365
366
  if (!t) return;
366
- const o = le(t.variable), c = Z(o), y = ue(c, T.current);
367
+ const o = le(t.variable), c = Z(o), y = ue(c, C.current);
367
368
  let b = -1;
368
369
  for (let p = y.length - 1; p >= 0; p -= 1) {
369
370
  const I = y[p];
@@ -377,7 +378,7 @@ function Pr({
377
378
  (p, I) => I === b ? { ...p, default: t.default } : p
378
379
  )
379
380
  ), De(""), Me(""), re(!1), oe(!1), P("variables");
380
- }, [W, _, se, le, A]), Mt = J(() => {
381
+ }, [W, _, se, le, A]), Lt = J(() => {
381
382
  const e = /* @__PURE__ */ new Set();
382
383
  return [{ id: "custom", items: w.filter((o) => o.type === "user").filter((o) => !Ve.some((c) => c.items.some((y) => y.name === o.attribute))).filter((o) => e.has(o.attribute) ? !1 : (e.add(o.attribute), !0)).map((o) => ({
383
384
  name: o.attribute,
@@ -387,8 +388,8 @@ function Pr({
387
388
  }, [w]), ce = J(
388
389
  () => w.filter((e) => e.type !== "system"),
389
390
  [w]
390
- ), Lt = (e) => e === "custom" ? "text.variables.groupCustom" : e === "contacts" ? "text.variables.groupContacts" : e === "email" ? "text.variables.groupEmail" : e === "organization" ? "text.variables.groupOrganization" : e === "date" ? "text.variables.groupDate" : "text.variables.groupLinks", C = tr(), kt = O === "desktop" || O === "mobile" ? O : "desktop", Bt = S === "split" || S === "code" || S === "preview" ? S : "split";
391
- ($e = (Re = C.palette) == null ? void 0 : Re.action) == null || $e.selected, (Ne = (ze = C.palette) == null ? void 0 : ze.primary) == null || Ne.main, (Pe = (Oe = C.palette) == null ? void 0 : Oe.action) == null || Pe.selected, (We = (_e = C.palette) == null ? void 0 : _e.background) == null || We.paper, (Ge = (je = C.palette) == null ? void 0 : je.text) == null || Ge.primary, (Ue = (qe = C.palette) == null ? void 0 : qe.action) == null || Ue.hover;
391
+ ), kt = (e) => e === "custom" ? "text.variables.groupCustom" : e === "contacts" ? "text.variables.groupContacts" : e === "email" ? "text.variables.groupEmail" : e === "organization" ? "text.variables.groupOrganization" : e === "date" ? "text.variables.groupDate" : "text.variables.groupLinks", T = rr(), Bt = O === "desktop" || O === "mobile" ? O : "desktop", At = S === "split" || S === "code" || S === "preview" ? S : "split";
392
+ ($e = (Re = T.palette) == null ? void 0 : Re.action) == null || $e.selected, (ze = (Ne = T.palette) == null ? void 0 : Ne.primary) == null || ze.main, (Pe = (Oe = T.palette) == null ? void 0 : Oe.action) == null || Pe.selected, (We = (_e = T.palette) == null ? void 0 : _e.background) == null || We.paper, (Ge = (je = T.palette) == null ? void 0 : je.text) == null || Ge.primary, (Ue = (qe = T.palette) == null ? void 0 : qe.action) == null || Ue.hover;
392
393
  const j = {
393
394
  tooltip: {
394
395
  sx: {
@@ -396,12 +397,12 @@ function Pr({
396
397
  fontWeight: 400,
397
398
  lineHeight: 1.45,
398
399
  maxWidth: 360,
399
- backgroundColor: de(((Ke = (Ye = C.palette) == null ? void 0 : Ye.text) == null ? void 0 : Ke.primary) ?? "#1F1F21", 0.9),
400
- color: ((Je = (Xe = C.palette) == null ? void 0 : Xe.common) == null ? void 0 : Je.white) ?? "#fff"
400
+ backgroundColor: de(((Ke = (Ye = T.palette) == null ? void 0 : Ye.text) == null ? void 0 : Ke.primary) ?? "#1F1F21", 0.9),
401
+ color: ((Je = (Xe = T.palette) == null ? void 0 : Xe.common) == null ? void 0 : Je.white) ?? "#fff"
401
402
  }
402
403
  },
403
404
  arrow: {
404
- sx: { color: de(((Ze = (Qe = C.palette) == null ? void 0 : Qe.text) == null ? void 0 : Ze.primary) ?? "#1F1F21", 0.9) }
405
+ sx: { color: de(((Ze = (Qe = T.palette) == null ? void 0 : Qe.text) == null ? void 0 : Ze.primary) ?? "#1F1F21", 0.9) }
405
406
  }
406
407
  }, ve = {
407
408
  component: "div",
@@ -411,11 +412,11 @@ function Pr({
411
412
  minHeight: 18,
412
413
  lineHeight: 1.5
413
414
  }
414
- }, Ae = () => /* @__PURE__ */ x(
415
+ }, Ae = () => /* @__PURE__ */ g(
415
416
  h,
416
417
  {
417
418
  sx: {
418
- height: g,
419
+ height: x,
419
420
  minHeight: 0,
420
421
  display: "flex",
421
422
  flexDirection: "column",
@@ -456,13 +457,13 @@ function Pr({
456
457
  }
457
458
  },
458
459
  children: /* @__PURE__ */ r(
459
- Pt,
460
+ _t,
460
461
  {
461
462
  value: E,
462
463
  height: "100%",
463
- extensions: [_t()],
464
+ extensions: [Wt()],
464
465
  theme: we[Se] || mt,
465
- onChange: ge,
466
+ onChange: xe,
466
467
  onCreateEditor: (e) => {
467
468
  fe.current = e;
468
469
  },
@@ -481,8 +482,8 @@ function Pr({
481
482
  {
482
483
  size: "small",
483
484
  variant: "contained",
484
- startIcon: /* @__PURE__ */ r(Mr, { fontSize: "small" }),
485
- onClick: Vt,
485
+ startIcon: /* @__PURE__ */ r(Lr, { fontSize: "small" }),
486
+ onClick: Ct,
486
487
  sx: {
487
488
  position: "absolute",
488
489
  right: 16,
@@ -491,12 +492,12 @@ function Pr({
491
492
  textTransform: "none",
492
493
  boxShadow: 3
493
494
  },
494
- children: l("common.save")
495
+ children: s("common.save")
495
496
  }
496
497
  )
497
498
  ]
498
499
  }
499
- ), At = () => /* @__PURE__ */ r(h, { sx: {
500
+ ), Ft = () => /* @__PURE__ */ r(h, { sx: {
500
501
  height: i,
501
502
  overflow: "auto",
502
503
  backgroundColor: "#F5F5F5",
@@ -516,7 +517,7 @@ function Pr({
516
517
  children: /* @__PURE__ */ r(
517
518
  "iframe",
518
519
  {
519
- ref: ne,
520
+ ref: ae,
520
521
  srcDoc: ie,
521
522
  style: {
522
523
  width: "100%",
@@ -529,7 +530,7 @@ function Pr({
529
530
  }
530
531
  )
531
532
  }
532
- ) }), Ft = () => /* @__PURE__ */ x(
533
+ ) }), Rt = () => /* @__PURE__ */ g(
533
534
  h,
534
535
  {
535
536
  ref: Le,
@@ -544,23 +545,23 @@ function Pr({
544
545
  pb: 6
545
546
  },
546
547
  children: [
547
- /* @__PURE__ */ r(h, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: /* @__PURE__ */ x(h, { sx: { minWidth: 0 }, children: [
548
- /* @__PURE__ */ x(h, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
549
- /* @__PURE__ */ r(k, { variant: "subtitle1", sx: { fontWeight: 700 }, children: l("htmlEditor.variables.title") }),
550
- /* @__PURE__ */ r(q, { title: l("htmlEditor.variables.help"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(h, { component: "span", sx: { display: "inline-flex", color: "text.secondary", cursor: "help" }, children: /* @__PURE__ */ r(kr, { fontSize: "small" }) }) })
548
+ /* @__PURE__ */ r(h, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: /* @__PURE__ */ g(h, { sx: { minWidth: 0 }, children: [
549
+ /* @__PURE__ */ g(h, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
550
+ /* @__PURE__ */ r(k, { variant: "subtitle1", sx: { fontWeight: 700 }, children: s("htmlEditor.variables.title") }),
551
+ /* @__PURE__ */ r(q, { title: s("htmlEditor.variables.help"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(h, { component: "span", sx: { display: "inline-flex", color: "text.secondary", cursor: "help" }, children: /* @__PURE__ */ r(Br, { fontSize: "small" }) }) })
551
552
  ] }),
552
- /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.secondary", children: l("htmlEditor.variables.scanHint") })
553
+ /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.secondary", children: s("htmlEditor.variables.scanHint") })
553
554
  ] }) }),
554
- /* @__PURE__ */ r(h, { sx: { mb: 2 }, children: Mt.map((e) => {
555
- const t = It === e.id;
556
- return /* @__PURE__ */ x(
557
- ir,
555
+ /* @__PURE__ */ r(h, { sx: { mb: 2 }, children: Lt.map((e) => {
556
+ const t = Et === e.id;
557
+ return /* @__PURE__ */ g(
558
+ lr,
558
559
  {
559
560
  disableGutters: !0,
560
561
  square: !0,
561
562
  elevation: 0,
562
563
  expanded: t,
563
- onChange: (o, c) => Et(c ? e.id : null),
564
+ onChange: (o, c) => Vt(c ? e.id : null),
564
565
  sx: {
565
566
  "&:before": { display: "none" },
566
567
  border: 1,
@@ -571,24 +572,24 @@ function Pr({
571
572
  },
572
573
  children: [
573
574
  /* @__PURE__ */ r(
574
- lr,
575
+ sr,
575
576
  {
576
- expandIcon: /* @__PURE__ */ r(Lr, { fontSize: "small" }),
577
+ expandIcon: /* @__PURE__ */ r(kr, { fontSize: "small" }),
577
578
  sx: {
578
579
  minHeight: 44,
579
580
  "& .MuiAccordionSummary-content": { my: 1 }
580
581
  },
581
- children: /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.primary", children: l(Lt(e.id)) })
582
+ children: /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.primary", children: s(kt(e.id)) })
582
583
  }
583
584
  ),
584
- /* @__PURE__ */ x(sr, { sx: { pt: 0, pb: 1.25 }, children: [
585
- e.id === "custom" && /* @__PURE__ */ x(h, { sx: { mb: 1 }, children: [
585
+ /* @__PURE__ */ g(cr, { sx: { pt: 0, pb: 1.25 }, children: [
586
+ e.id === "custom" && /* @__PURE__ */ g(h, { sx: { mb: 1 }, children: [
586
587
  /* @__PURE__ */ r(
587
588
  Ee,
588
589
  {
589
590
  size: "small",
590
591
  fullWidth: !0,
591
- label: l("text.variables.customVariableName"),
592
+ label: s("text.variables.customVariableName"),
592
593
  value: _,
593
594
  placeholder: "e.g. order_id",
594
595
  onChange: (o) => {
@@ -608,9 +609,9 @@ function Pr({
608
609
  {
609
610
  size: "small",
610
611
  fullWidth: !0,
611
- label: l("text.variables.defaultValueLabel"),
612
+ label: s("text.variables.defaultValueLabel"),
612
613
  value: W,
613
- placeholder: l("text.variables.defaultPlaceholder"),
614
+ placeholder: s("text.variables.defaultPlaceholder"),
614
615
  onChange: (o) => {
615
616
  Me(o.target.value), !pe && o.target.value.trim() !== "" && oe(!0);
616
617
  },
@@ -618,7 +619,7 @@ function Pr({
618
619
  W.trim() !== "" && oe(!0);
619
620
  },
620
621
  error: pe && W.trim() === "",
621
- helperText: pe && W.trim() === "" ? l("text.variables.defaultRequired") : " ",
622
+ helperText: pe && W.trim() === "" ? s("text.variables.defaultRequired") : " ",
622
623
  FormHelperTextProps: ve
623
624
  }
624
625
  ),
@@ -628,8 +629,8 @@ function Pr({
628
629
  fullWidth: !0,
629
630
  size: "small",
630
631
  variant: "outlined",
631
- startIcon: /* @__PURE__ */ r(Sr, { fontSize: "small" }),
632
- onClick: Dt,
632
+ startIcon: /* @__PURE__ */ r(Dr, { fontSize: "small" }),
633
+ onClick: Mt,
633
634
  sx: {
634
635
  justifyContent: "center",
635
636
  borderColor: "divider",
@@ -637,7 +638,7 @@ function Pr({
637
638
  color: "text.secondary",
638
639
  textTransform: "none"
639
640
  },
640
- children: l("text.variables.addCustomVariable")
641
+ children: s("text.variables.addCustomVariable")
641
642
  }
642
643
  )
643
644
  ] }),
@@ -646,15 +647,15 @@ function Pr({
646
647
  {
647
648
  size: "small",
648
649
  variant: "outlined",
649
- onClick: () => St(o.name, o.kind),
650
+ onClick: () => Dt(o.name, o.kind),
650
651
  sx: {
651
652
  justifyContent: "flex-start",
652
653
  borderColor: "divider",
653
654
  color: "text.secondary",
654
655
  textTransform: "none"
655
656
  },
656
- children: /* @__PURE__ */ x(h, { sx: { textAlign: "left", minWidth: 0 }, children: [
657
- /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.primary", children: e.id === "custom" ? o.name : l(o.labelKey) }),
657
+ children: /* @__PURE__ */ g(h, { sx: { textAlign: "left", minWidth: 0 }, children: [
658
+ /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.primary", children: e.id === "custom" ? o.name : s(o.labelKey) }),
658
659
  /* @__PURE__ */ r(
659
660
  k,
660
661
  {
@@ -675,9 +676,9 @@ function Pr({
675
676
  e.id
676
677
  );
677
678
  }) }),
678
- /* @__PURE__ */ r(cr, { sx: { my: 2 } }),
679
- /* @__PURE__ */ r(k, { component: "div", ref: ke, variant: "subtitle2", sx: { mb: 0.5 }, children: l("htmlEditor.variables.detected") }),
680
- /* @__PURE__ */ r(k, { component: "div", variant: "caption", color: "text.secondary", sx: { display: "block", mb: 1 }, children: l("htmlEditor.variables.defaultHelp") }),
679
+ /* @__PURE__ */ r(dr, { sx: { my: 2 } }),
680
+ /* @__PURE__ */ r(k, { component: "div", ref: ke, variant: "subtitle2", sx: { mb: 0.5 }, children: s("htmlEditor.variables.detected") }),
681
+ /* @__PURE__ */ r(k, { component: "div", variant: "caption", color: "text.secondary", sx: { display: "block", mb: 1 }, children: s("htmlEditor.variables.defaultHelp") }),
681
682
  ce.length === 0 ? /* @__PURE__ */ r(
682
683
  h,
683
684
  {
@@ -690,11 +691,11 @@ function Pr({
690
691
  fontSize: 14,
691
692
  textAlign: "center"
692
693
  },
693
- children: l("htmlEditor.variables.empty")
694
+ children: s("htmlEditor.variables.empty")
694
695
  }
695
696
  ) : /* @__PURE__ */ r(h, { sx: { display: "grid", gap: 0.75 }, children: ce.map((e, t) => {
696
- const o = e.type === "user" && nt(e.attribute, "user"), c = vt && o && e.default.trim() === "", y = ce.filter((p) => p.type === e.type && p.attribute === e.attribute).length, b = ce.slice(0, t + 1).filter((p) => p.type === e.type && p.attribute === e.attribute).length;
697
- return /* @__PURE__ */ x(
697
+ const o = e.type === "user" && at(e.attribute, "user"), c = yt && o && e.default.trim() === "", y = ce.filter((p) => p.type === e.type && p.attribute === e.attribute).length, b = ce.slice(0, t + 1).filter((p) => p.type === e.type && p.attribute === e.attribute).length;
698
+ return /* @__PURE__ */ g(
698
699
  h,
699
700
  {
700
701
  sx: {
@@ -708,10 +709,10 @@ function Pr({
708
709
  borderColor: c ? "error.main" : "transparent",
709
710
  borderRadius: 1,
710
711
  borderBottomColor: c ? "error.main" : "divider",
711
- backgroundColor: c ? de(C.palette.error.main, 0.04) : "transparent",
712
+ backgroundColor: c ? de(T.palette.error.main, 0.04) : "transparent",
712
713
  transition: "background-color 120ms ease, border-color 120ms ease",
713
714
  "&:hover": {
714
- backgroundColor: c ? de(C.palette.error.main, 0.04) : "action.hover",
715
+ backgroundColor: c ? de(T.palette.error.main, 0.04) : "action.hover",
715
716
  borderColor: c ? "error.main" : "divider"
716
717
  }
717
718
  },
@@ -737,12 +738,12 @@ function Pr({
737
738
  size: "small",
738
739
  fullWidth: !0,
739
740
  value: e.default,
740
- label: c ? l("text.variables.defaultValueLabel") : void 0,
741
- placeholder: l("text.variables.defaultPlaceholder"),
741
+ label: c ? s("text.variables.defaultValueLabel") : void 0,
742
+ placeholder: s("text.variables.defaultPlaceholder"),
742
743
  error: c,
743
- helperText: c ? l("text.variables.defaultRequired") : " ",
744
+ helperText: c ? s("text.variables.defaultRequired") : " ",
744
745
  FormHelperTextProps: ve,
745
- onChange: (p) => Ht(e.variableInstanceId, p.target.value),
746
+ onChange: (p) => St(e.variableInstanceId, p.target.value),
746
747
  sx: {
747
748
  "& .MuiOutlinedInput-root": {
748
749
  minHeight: 40,
@@ -754,7 +755,7 @@ function Pr({
754
755
  }
755
756
  }
756
757
  }
757
- ) : /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.secondary", sx: { fontSize: 13 }, children: l("htmlEditor.variables.systemDefault") })
758
+ ) : /* @__PURE__ */ r(k, { component: "div", variant: "body2", color: "text.secondary", sx: { fontSize: 13 }, children: s("htmlEditor.variables.systemDefault") })
758
759
  ]
759
760
  },
760
761
  e.variableInstanceId || `${e.type}:${e.attribute}:${e.id}`
@@ -762,9 +763,9 @@ function Pr({
762
763
  }) })
763
764
  ]
764
765
  }
765
- ), Fe = () => /* @__PURE__ */ x(h, { sx: { height: i, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
766
- /* @__PURE__ */ x(
767
- ar,
766
+ ), Fe = () => /* @__PURE__ */ g(h, { sx: { height: i, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
767
+ /* @__PURE__ */ g(
768
+ ir,
768
769
  {
769
770
  value: te,
770
771
  onChange: (e, t) => P(t),
@@ -779,14 +780,14 @@ function Pr({
779
780
  }
780
781
  },
781
782
  children: [
782
- /* @__PURE__ */ r(ot, { value: "preview", label: l("htmlEditor.tabs.preview") }),
783
- /* @__PURE__ */ r(ot, { value: "variables", label: l("htmlEditor.tabs.variables") })
783
+ /* @__PURE__ */ r(ot, { value: "preview", label: s("htmlEditor.tabs.preview") }),
784
+ /* @__PURE__ */ r(ot, { value: "variables", label: s("htmlEditor.tabs.variables") })
784
785
  ]
785
786
  }
786
787
  ),
787
- /* @__PURE__ */ r(h, { sx: { flex: 1, minHeight: 0, overflow: "hidden", display: "flex", flexDirection: "column" }, children: te === "preview" ? At() : Ft() })
788
+ /* @__PURE__ */ r(h, { sx: { flex: 1, minHeight: 0, overflow: "hidden", display: "flex", flexDirection: "column" }, children: te === "preview" ? Ft() : Rt() })
788
789
  ] });
789
- return /* @__PURE__ */ x(
790
+ return /* @__PURE__ */ g(
790
791
  h,
791
792
  {
792
793
  sx: {
@@ -799,7 +800,7 @@ function Pr({
799
800
  ...m
800
801
  },
801
802
  children: [
802
- f && /* @__PURE__ */ x(
803
+ f && /* @__PURE__ */ g(
803
804
  h,
804
805
  {
805
806
  sx: {
@@ -812,55 +813,55 @@ function Pr({
812
813
  backgroundColor: "background.paper"
813
814
  },
814
815
  children: [
815
- /* @__PURE__ */ x(h, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
816
- /* @__PURE__ */ x(
816
+ /* @__PURE__ */ g(h, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
817
+ /* @__PURE__ */ g(
817
818
  et,
818
819
  {
819
- value: Bt,
820
+ value: At,
820
821
  exclusive: !0,
821
- onChange: Ct,
822
+ onChange: wt,
822
823
  size: "small",
823
- "aria-label": l("htmlEditor.mode.split"),
824
+ "aria-label": s("htmlEditor.mode.split"),
824
825
  children: [
825
- /* @__PURE__ */ r(q, { title: l("htmlEditor.tooltips.splitView"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
826
+ /* @__PURE__ */ r(q, { title: s("htmlEditor.tooltips.splitView"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
826
827
  Q,
827
828
  {
828
829
  value: "split",
829
- "aria-label": l("htmlEditor.mode.split"),
830
- children: /* @__PURE__ */ r(Ar, { fontSize: "small" })
830
+ "aria-label": s("htmlEditor.mode.split"),
831
+ children: /* @__PURE__ */ r(Fr, { fontSize: "small" })
831
832
  }
832
833
  ) }),
833
- /* @__PURE__ */ r(q, { title: l("htmlEditor.tooltips.codeOnly"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
834
+ /* @__PURE__ */ r(q, { title: s("htmlEditor.tooltips.codeOnly"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
834
835
  Q,
835
836
  {
836
837
  value: "code",
837
- "aria-label": l("htmlEditor.mode.code"),
838
- children: /* @__PURE__ */ r(Dr, { fontSize: "small" })
838
+ "aria-label": s("htmlEditor.mode.code"),
839
+ children: /* @__PURE__ */ r(Mr, { fontSize: "small" })
839
840
  }
840
841
  ) }),
841
- /* @__PURE__ */ r(q, { title: l("htmlEditor.tooltips.previewOnly"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
842
+ /* @__PURE__ */ r(q, { title: s("htmlEditor.tooltips.previewOnly"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
842
843
  Q,
843
844
  {
844
845
  value: "preview",
845
- "aria-label": l("htmlEditor.mode.preview"),
846
- children: /* @__PURE__ */ r(Br, { fontSize: "small" })
846
+ "aria-label": s("htmlEditor.mode.preview"),
847
+ children: /* @__PURE__ */ r(Ar, { fontSize: "small" })
847
848
  }
848
849
  ) })
849
850
  ]
850
851
  }
851
852
  ),
852
- /* @__PURE__ */ x(rr, { size: "small", sx: { minWidth: 140 }, children: [
853
- /* @__PURE__ */ r(or, { id: "theme-select-label", children: l("htmlEditor.theme") }),
854
- /* @__PURE__ */ x(
853
+ /* @__PURE__ */ g(or, { size: "small", sx: { minWidth: 140 }, children: [
854
+ /* @__PURE__ */ r(ar, { id: "theme-select-label", children: s("htmlEditor.theme") }),
855
+ /* @__PURE__ */ g(
855
856
  nr,
856
857
  {
857
858
  labelId: "theme-select-label",
858
859
  id: "theme-select",
859
860
  value: Se,
860
- label: l("htmlEditor.theme"),
861
+ label: s("htmlEditor.theme"),
861
862
  onChange: (e) => {
862
863
  const t = e.target.value;
863
- gt(t), Or(t);
864
+ vt(t), Pr(t);
864
865
  },
865
866
  sx: {
866
867
  // fontSize: '0.875rem',
@@ -869,38 +870,38 @@ function Pr({
869
870
  }
870
871
  },
871
872
  children: [
872
- /* @__PURE__ */ r(tt, { children: l("htmlEditor.lightThemes") }),
873
- Object.entries($r).map(([e, t]) => /* @__PURE__ */ r(rt, { value: e, children: t }, e)),
874
- /* @__PURE__ */ r(tt, { children: l("htmlEditor.darkThemes") }),
873
+ /* @__PURE__ */ r(tt, { children: s("htmlEditor.lightThemes") }),
874
+ Object.entries(Nr).map(([e, t]) => /* @__PURE__ */ r(rt, { value: e, children: t }, e)),
875
+ /* @__PURE__ */ r(tt, { children: s("htmlEditor.darkThemes") }),
875
876
  Object.entries(zr).map(([e, t]) => /* @__PURE__ */ r(rt, { value: e, children: t }, e))
876
877
  ]
877
878
  }
878
879
  )
879
880
  ] })
880
881
  ] }),
881
- /* @__PURE__ */ r(h, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: S !== "code" && /* @__PURE__ */ x(
882
+ /* @__PURE__ */ r(h, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: S !== "code" && /* @__PURE__ */ g(
882
883
  et,
883
884
  {
884
- value: kt,
885
+ value: Bt,
885
886
  exclusive: !0,
886
- onChange: wt,
887
+ onChange: Ht,
887
888
  size: "small",
888
- "aria-label": l("htmlEditor.device.desktop"),
889
+ "aria-label": s("htmlEditor.device.desktop"),
889
890
  children: [
890
- /* @__PURE__ */ r(q, { title: l("htmlEditor.tooltips.desktopView"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
891
+ /* @__PURE__ */ r(q, { title: s("htmlEditor.tooltips.desktopView"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
891
892
  Q,
892
893
  {
893
894
  value: "desktop",
894
- "aria-label": l("htmlEditor.device.desktop"),
895
- children: /* @__PURE__ */ r(Fr, { fontSize: "small" })
895
+ "aria-label": s("htmlEditor.device.desktop"),
896
+ children: /* @__PURE__ */ r(Rr, { fontSize: "small" })
896
897
  }
897
898
  ) }),
898
- /* @__PURE__ */ r(q, { title: l("htmlEditor.tooltips.mobileView"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
899
+ /* @__PURE__ */ r(q, { title: s("htmlEditor.tooltips.mobileView"), arrow: !0, slotProps: j, children: /* @__PURE__ */ r(
899
900
  Q,
900
901
  {
901
902
  value: "mobile",
902
- "aria-label": l("htmlEditor.device.mobile"),
903
- children: /* @__PURE__ */ r(Rr, { fontSize: "small" })
903
+ "aria-label": s("htmlEditor.device.mobile"),
904
+ children: /* @__PURE__ */ r($r, { fontSize: "small" })
904
905
  }
905
906
  ) })
906
907
  ]
@@ -909,7 +910,7 @@ function Pr({
909
910
  ]
910
911
  }
911
912
  ),
912
- /* @__PURE__ */ x(
913
+ /* @__PURE__ */ g(
913
914
  h,
914
915
  {
915
916
  sx: {
@@ -920,7 +921,7 @@ function Pr({
920
921
  overflow: "hidden"
921
922
  },
922
923
  children: [
923
- S === "split" && /* @__PURE__ */ x(Nt, { children: [
924
+ S === "split" && /* @__PURE__ */ g(Ot, { children: [
924
925
  /* @__PURE__ */ r(h, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: Ae() }),
925
926
  /* @__PURE__ */ r(h, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: Fe() })
926
927
  ] }),
@@ -933,10 +934,10 @@ function Pr({
933
934
  }
934
935
  );
935
936
  }
936
- const pt = ut(Pr);
937
- pt.displayName = "HtmlEditorContent";
938
- const _r = ut((n, a) => /* @__PURE__ */ r(Zt, { theme: yr, children: /* @__PURE__ */ r(
939
- er,
937
+ const ft = ut(_r);
938
+ ft.displayName = "HtmlEditorContent";
939
+ const Wr = ut((a, n) => /* @__PURE__ */ r(er, { theme: Ir, children: /* @__PURE__ */ r(
940
+ tr,
940
941
  {
941
942
  sx: {
942
943
  height: "100%",
@@ -946,11 +947,11 @@ const _r = ut((n, a) => /* @__PURE__ */ r(Zt, { theme: yr, children: /* @__PURE_
946
947
  display: "flex",
947
948
  flexDirection: "column"
948
949
  },
949
- children: /* @__PURE__ */ r(pt, { ref: a, ...n })
950
+ children: /* @__PURE__ */ r(ft, { ref: n, ...a })
950
951
  }
951
952
  ) }));
952
- _r.displayName = "HtmlEditor";
953
+ Wr.displayName = "HtmlEditor";
953
954
  export {
954
- _r as HtmlEditor,
955
- _r as default
955
+ Wr as HtmlEditor,
956
+ Wr as default
956
957
  };