monto-email-builder 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,212 +1,442 @@
1
- import { jsxs as s, jsx as e, Fragment as De } from "react/jsx-runtime";
2
- import { useState as E, useRef as Z, useEffect as T, useMemo as Me } from "react";
3
- import Se from "@uiw/react-codemirror";
4
- import { html as Fe } from "@codemirror/lang-html";
5
- import { xcodeDark as He, tomorrowNightBlue as Ie, dracula as le, basicDark as Pe, abcdef as Oe, bbedit as Ne, noctisLilac as ze, gruvboxLight as Be, tokyoNightDay as Ve, vscodeLight as We, xcodeLight as je } from "@uiw/codemirror-themes-all";
6
- import g from "@mui/material/ToggleButton";
7
- import ee from "@mui/material/ToggleButtonGroup";
8
- import { useTheme as _e, Box as i, Tooltip as b, FormControl as Re, InputLabel as Ye, Select as Ae, ListSubheader as te, MenuItem as oe } from "@mui/material";
9
- import { alpha as re } from "@mui/material/styles";
10
- import * as Ge from "@mui/icons-material/Code";
11
- import * as $e from "@mui/icons-material/Visibility";
12
- import * as Xe from "@mui/icons-material/ViewColumn";
13
- import * as qe from "@mui/icons-material/MonitorOutlined";
14
- import * as Ke from "@mui/icons-material/PhoneIphoneOutlined";
15
- import { r as x, t as Ue } from "./chunks/chunk-kYwVqyDL.js";
16
- const Je = x(Ge), Qe = x($e), Ze = x(Xe), et = x(qe), tt = x(Ke), C = {
1
+ import { jsxs as m, jsx as r, Fragment as wt } from "react/jsx-runtime";
2
+ import { forwardRef as St, useState as y, useRef as oe, useEffect as J, useCallback as w, useMemo as Q, useImperativeHandle as Ht } from "react";
3
+ import Lt from "@uiw/react-codemirror";
4
+ import { html as Dt } from "@codemirror/lang-html";
5
+ import { xcodeDark as Mt, tomorrowNightBlue as It, dracula as Je, basicDark as kt, abcdef as At, bbedit as zt, noctisLilac as Ot, gruvboxLight as Rt, tokyoNightDay as Bt, vscodeLight as Ft, xcodeLight as Nt } from "@uiw/codemirror-themes-all";
6
+ import F from "@mui/material/ToggleButton";
7
+ import _e from "@mui/material/ToggleButtonGroup";
8
+ import { useTheme as $t, Box as d, Tooltip as O, FormControl as _t, InputLabel as Pt, Select as Wt, ListSubheader as Pe, MenuItem as We, Button as ie, Tabs as jt, Tab as je, Typography as S, Accordion as Gt, AccordionSummary as Kt, AccordionDetails as Ut, TextField as le, Divider as Yt } from "@mui/material";
9
+ import { alpha as Ge } from "@mui/material/styles";
10
+ import * as qt from "@mui/icons-material/AddOutlined";
11
+ import * as Xt from "@mui/icons-material/Code";
12
+ import * as Jt from "@mui/icons-material/DataObjectOutlined";
13
+ import * as Qt from "@mui/icons-material/ExpandMoreOutlined";
14
+ import * as Zt from "@mui/icons-material/HelpOutlined";
15
+ import * as er from "@mui/icons-material/Visibility";
16
+ import * as tr from "@mui/icons-material/ViewColumn";
17
+ import * as rr from "@mui/icons-material/MonitorOutlined";
18
+ import * as or from "@mui/icons-material/PhoneIphoneOutlined";
19
+ import { B as ir, V as H, r as V, t as lr } from "./chunks/chunk-CF4KXMbF.js";
20
+ const ae = ir, Ke = "unsubscribe_link", ne = /\{\{\s*([^{}]+?)\s*\}\}/g, Ue = /\{%\s*([^{}%]+?)\s*%\}/g;
21
+ function se(o, a, s, l, c) {
22
+ return o[a - 1] !== l && o[s] !== c;
23
+ }
24
+ function Qe(o, a = "user") {
25
+ return a === "builtin" || a === "system" ? `{%${o}%}` : `{{${o}}}`;
26
+ }
27
+ function ar(o) {
28
+ const a = typeof o == "string" ? o.trim() : "";
29
+ if (a.startsWith("{{") && a.endsWith("}}")) {
30
+ const s = a.slice(2, -2).trim();
31
+ if (H.test(s)) return { attribute: s, type: "user" };
32
+ }
33
+ if (a.startsWith("{%") && a.endsWith("%}")) {
34
+ const s = a.slice(2, -2).trim();
35
+ if (H.test(s)) return { attribute: s, type: "system" };
36
+ }
37
+ return null;
38
+ }
39
+ function nr(o, a) {
40
+ const s = o.variable ?? o.Variable ?? o.key ?? "", l = ar(s), g = (o.type ?? o.Type ?? (l == null ? void 0 : l.type) ?? "user") === "system" ? "system" : "user", h = o.attribute ?? o.Attribute ?? (l == null ? void 0 : l.attribute) ?? "", p = String(h).trim();
41
+ return !p || !H.test(p) ? null : {
42
+ id: Number(o.id) || a + 1,
43
+ variable: g === "system" ? `{%${p}%}` : `{{${p}}}`,
44
+ type: g,
45
+ attribute: p,
46
+ default: String(o.default ?? o.Default ?? o.value ?? "")
47
+ };
48
+ }
49
+ function Ye(o) {
50
+ if (!Array.isArray(o)) return [];
51
+ const a = /* @__PURE__ */ new Map();
52
+ return o.forEach((s, l) => {
53
+ const c = nr(s, l);
54
+ c && a.set(`${c.type}:${c.attribute}`, c);
55
+ }), Array.from(a.values()).map((s, l) => ({
56
+ ...s,
57
+ id: l + 1
58
+ }));
59
+ }
60
+ function sr(o) {
61
+ const a = o || "", s = /* @__PURE__ */ new Map(), l = (h, p) => {
62
+ const f = `${p}:${h}`;
63
+ s.has(f) || s.set(f, {
64
+ id: s.size + 1,
65
+ variable: p === "system" ? `{%${h}%}` : `{{${h}}}`,
66
+ type: p,
67
+ attribute: h,
68
+ default: ""
69
+ });
70
+ };
71
+ let c;
72
+ for (ne.lastIndex = 0; c = ne.exec(a); ) {
73
+ const h = c.index, p = h + c[0].length;
74
+ if (!se(a, h, p, "{", "}")) continue;
75
+ const f = c[1].trim();
76
+ !f || !H.test(f) || l(f, "user");
77
+ }
78
+ let g;
79
+ for (Ue.lastIndex = 0; g = Ue.exec(a); ) {
80
+ const h = g.index, p = h + g[0].length;
81
+ if (!se(a, h, p, "{", "}")) continue;
82
+ const f = g[1].trim();
83
+ !f || !H.test(f) || l(f, "system");
84
+ }
85
+ return Array.from(s.values());
86
+ }
87
+ function dr(o, a) {
88
+ const s = /* @__PURE__ */ new Map();
89
+ return a.forEach((l) => {
90
+ s.set(`${l.type}:${l.attribute}`, l.default ?? "");
91
+ }), o.map((l, c) => ({
92
+ ...l,
93
+ id: c + 1,
94
+ default: s.get(`${l.type}:${l.attribute}`) ?? l.default ?? ""
95
+ }));
96
+ }
97
+ function cr(o) {
98
+ return o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#39;");
99
+ }
100
+ function ur(o, a) {
101
+ const s = /* @__PURE__ */ new Map();
102
+ return a.forEach((l) => {
103
+ l.type === "user" && s.set(l.attribute, l.default ?? "");
104
+ }), (o || "").replace(ne, (l, c, g, h) => {
105
+ const p = g + l.length;
106
+ if (!se(h, g, p, "{", "}")) return l;
107
+ const f = String(c).trim();
108
+ if (!f || !H.test(f)) return l;
109
+ const R = s.get(f);
110
+ return R === void 0 || R === "" ? l : cr(R);
111
+ });
112
+ }
113
+ function qe(o, a, s = "") {
114
+ const l = o.trim();
115
+ if (!l || !H.test(l)) return null;
116
+ const c = a === "builtin" ? "system" : "user";
117
+ return {
118
+ id: 1,
119
+ variable: Qe(l, a),
120
+ type: c,
121
+ attribute: l,
122
+ default: c === "system" ? "" : s
123
+ };
124
+ }
125
+ function mr(o) {
126
+ const a = o.trim();
127
+ return a ? ae.some((s) => s.items.some((l) => l.name === a)) : !1;
128
+ }
129
+ function hr(o, a) {
130
+ const s = o.trim();
131
+ return a === "user" && s === Ke ? `<a href="{{${Ke}}">Unsubscribe Link</a>` : Qe(s, a);
132
+ }
133
+ const br = V(qt), pr = V(Xt), fr = V(Jt), xr = V(Qt), gr = V(Zt), yr = V(er), vr = V(tr), Er = V(rr), Tr = V(or), de = {
17
134
  // 浅色主题
18
- xcodeLight: je,
19
- vscodeLight: We,
20
- tokyoNightDay: Ve,
21
- gruvboxLight: Be,
22
- noctisLilac: ze,
23
- bbedit: Ne,
135
+ xcodeLight: Nt,
136
+ vscodeLight: Ft,
137
+ tokyoNightDay: Bt,
138
+ gruvboxLight: Rt,
139
+ noctisLilac: Ot,
140
+ bbedit: zt,
24
141
  // 深色主题
25
- abcdef: Oe,
26
- basicDark: Pe,
27
- dracula: le,
28
- tomorrowNightBlue: Ie,
29
- xcodeDark: He
30
- }, ot = {
142
+ abcdef: At,
143
+ basicDark: kt,
144
+ dracula: Je,
145
+ tomorrowNightBlue: It,
146
+ xcodeDark: Mt
147
+ }, Vr = {
31
148
  xcodeLight: "Xcode Light (Light)",
32
149
  vscodeLight: "VSCode Light (Light)",
33
150
  tokyoNightDay: "Tokyo Night Day (Light)",
34
151
  gruvboxLight: "Gruvbox Light (Light)",
35
152
  noctisLilac: "Noctis Lilac (Light)",
36
153
  bbedit: "BBEdit (Light)"
37
- }, rt = {
154
+ }, Cr = {
38
155
  abcdef: "ABCDEF (Dark)",
39
156
  basicDark: "Basic Dark (Dark)",
40
157
  dracula: "Dracula (Dark)",
41
158
  tomorrowNightBlue: "Tomorrow Night Blue (Dark)",
42
159
  xcodeDark: "Xcode Dark (Dark)"
43
- }, ne = "html-editor-theme", ie = "dracula";
44
- function it(l = ie) {
45
- const c = l && C[l] ? l : ie;
46
- if (typeof window > "u") return c;
160
+ }, Ze = "html-editor-theme", Xe = "dracula";
161
+ function wr(o = Xe) {
162
+ const a = o && de[o] ? o : Xe;
163
+ if (typeof window > "u") return a;
47
164
  try {
48
- const p = localStorage.getItem(ne);
49
- if (p && C[p]) return p;
165
+ const s = localStorage.getItem(Ze);
166
+ if (s && de[s]) return s;
50
167
  } catch {
51
168
  console.error("Failed to get HTML Editor stored theme");
52
169
  }
53
- return c;
170
+ return a;
54
171
  }
55
- function lt(l) {
172
+ function Sr(o) {
56
173
  try {
57
- localStorage.setItem(ne, l);
174
+ localStorage.setItem(Ze, o);
58
175
  } catch {
59
- console.error("Failed to set HTML Editor stored theme", l);
176
+ console.error("Failed to set HTML Editor stored theme", o);
60
177
  }
61
178
  }
62
- function xt({
63
- value: l,
64
- onChange: c,
65
- language: p = "zh",
66
- initialMode: de = "split",
67
- initialDevice: ae = "desktop",
68
- codeEditorHeight: se = "100%",
69
- previewHeight: ce = "100%",
70
- sx: me,
71
- showToolbar: he = !0,
72
- initialTheme: pe
73
- }) {
74
- var F, H, I, P, O, N, z, B, V, W, j, _, R, Y, A, G, $, X;
75
- const r = (o, t) => Ue(o, t, p), [n, ue] = E(de), [m, fe] = E(ae), [k, ge] = E(() => it(pe)), [v, D] = E(l), u = Z(null), y = Z(null);
76
- T(() => {
77
- l !== v && D(l);
78
- }, [l]);
79
- const be = (o) => {
80
- D(o), u.current && clearTimeout(u.current), u.current = setTimeout(() => {
81
- c == null || c(o);
179
+ function Hr({
180
+ value: o,
181
+ onChange: a,
182
+ language: s = "zh",
183
+ initialMode: l = "split",
184
+ initialDevice: c = "desktop",
185
+ codeEditorHeight: g = "100%",
186
+ previewHeight: h = "100%",
187
+ sx: p,
188
+ showToolbar: f = !0,
189
+ initialTheme: R,
190
+ initialRightTab: et = "preview",
191
+ variables: N,
192
+ onVariablesChange: $,
193
+ requireVariableDefaults: ce = !0
194
+ }, tt) {
195
+ var ve, Ee, Te, Ve, Ce, we, Se, He, Le, De, Me, Ie, ke, Ae, ze, Oe, Re, Be;
196
+ const n = (e, t) => lr(e, t, s), [v, rt] = y(l), [D, ot] = y(c), [ue, it] = y(() => wr(R)), [x, me] = y(o), [he, M] = y(et), [u, be] = y(() => Ye(N)), [lt, at] = y(!1), [nt, st] = y("custom"), [I, pe] = y(""), [k, fe] = y(""), [Z, _] = y(!1), [ee, P] = y(!1), B = oe(null), xe = oe(null), W = oe(null);
197
+ J(() => {
198
+ o !== x && me(o);
199
+ }, [o]), J(() => {
200
+ N !== void 0 && be(Ye(N));
201
+ }, [N]);
202
+ const C = w(
203
+ (e) => {
204
+ const t = e.map((i, b) => ({
205
+ ...i,
206
+ id: b + 1,
207
+ default: i.type === "system" ? "" : i.default ?? ""
208
+ }));
209
+ return be(t), $ == null || $(t), t;
210
+ },
211
+ [$]
212
+ ), te = (e) => {
213
+ me(e), B.current && clearTimeout(B.current), B.current = setTimeout(() => {
214
+ a == null || a(e);
82
215
  }, 300);
83
- };
84
- T(() => () => {
85
- u.current && clearTimeout(u.current);
216
+ }, j = w(
217
+ (e = x) => {
218
+ const t = sr(e), i = dr(t, u);
219
+ return C(i);
220
+ },
221
+ [u, x, C]
222
+ ), G = w(() => {
223
+ const e = j(x), t = ce ? e.filter((i) => i.type === "user" && i.default.trim() === "") : [];
224
+ return at(t.length > 0), t.length > 0 && M("variables"), {
225
+ valid: t.length === 0,
226
+ variables: e,
227
+ missing: t
228
+ };
229
+ }, [x, ce, j]), dt = w(() => {
230
+ G(), M("variables");
231
+ }, [G]);
232
+ J(() => () => {
233
+ B.current && clearTimeout(B.current);
86
234
  }, []);
87
- const xe = (o) => {
88
- var K, U, J;
89
- const t = o || "";
90
- let h = t;
235
+ const ct = (e) => {
236
+ var X, Fe, Ne;
237
+ const t = e || "";
238
+ let i = t;
91
239
  if (!t.trim())
92
- h = "<!DOCTYPE html><html><head></head><body></body></html>";
240
+ i = "<!DOCTYPE html><html><head></head><body></body></html>";
93
241
  else {
94
- const a = new DOMParser().parseFromString(t, "text/html"), L = ((K = a.documentElement) == null ? void 0 : K.tagName.toLowerCase()) === "html", Te = ((U = a.head) == null ? void 0 : U.tagName.toLowerCase()) === "head", Ce = ((J = a.body) == null ? void 0 : J.tagName.toLowerCase()) === "body";
95
- if (!L || !Te || !Ce) {
96
- const ke = a.body ? a.body.innerHTML : t;
97
- h = `<!DOCTYPE html><html><head>${a.head ? a.head.innerHTML : ""}</head><body>${ke}</body></html>`;
242
+ const T = new DOMParser().parseFromString(t, "text/html"), re = ((X = T.documentElement) == null ? void 0 : X.tagName.toLowerCase()) === "html", Tt = ((Fe = T.head) == null ? void 0 : Fe.tagName.toLowerCase()) === "head", Vt = ((Ne = T.body) == null ? void 0 : Ne.tagName.toLowerCase()) === "body";
243
+ if (!re || !Tt || !Vt) {
244
+ const Ct = T.body ? T.body.innerHTML : t;
245
+ i = `<!DOCTYPE html><html><head>${T.head ? T.head.innerHTML : ""}</head><body>${Ct}</body></html>`;
98
246
  } else
99
- h = `<!DOCTYPE html>${a.documentElement.outerHTML}`;
247
+ i = `<!DOCTYPE html>${T.documentElement.outerHTML}`;
100
248
  }
101
- const Le = ["script", "iframe", "object", "embed", "canvas"], q = new DOMParser().parseFromString(h, "text/html");
102
- return Le.forEach((Q) => {
103
- q.querySelectorAll(Q).forEach((L) => L.remove());
104
- }), h = `<!DOCTYPE html>${q.documentElement.outerHTML}`, h;
105
- }, w = Me(() => xe(v), [v]);
106
- T(() => {
107
- y.current && y.current.srcdoc !== w && (y.current.srcdoc = w);
108
- }, [w]);
109
- const ve = (o, t) => {
110
- t !== null && ue(t);
111
- }, ye = (o, t) => {
112
- (t === "desktop" || t === "mobile") && fe(t);
113
- }, d = _e(), we = m === "desktop" || m === "mobile" ? m : "desktop", Ee = n === "split" || n === "code" || n === "preview" ? n : "split";
114
- (H = (F = d.palette) == null ? void 0 : F.action) == null || H.selected, (P = (I = d.palette) == null ? void 0 : I.primary) == null || P.main, (N = (O = d.palette) == null ? void 0 : O.action) == null || N.selected, (B = (z = d.palette) == null ? void 0 : z.background) == null || B.paper, (W = (V = d.palette) == null ? void 0 : V.text) == null || W.primary, (_ = (j = d.palette) == null ? void 0 : j.action) == null || _.hover;
115
- const f = {
249
+ const b = ["script", "iframe", "object", "embed", "canvas"], z = new DOMParser().parseFromString(i, "text/html");
250
+ return b.forEach(($e) => {
251
+ z.querySelectorAll($e).forEach((re) => re.remove());
252
+ }), i = `<!DOCTYPE html>${z.documentElement.outerHTML}`, i;
253
+ }, K = Q(
254
+ () => ur(x, u),
255
+ [u, x]
256
+ ), U = Q(() => ct(K), [K]);
257
+ Ht(
258
+ tt,
259
+ () => ({
260
+ getValue: () => x,
261
+ getPreviewHtml: () => K,
262
+ scanVariables: () => j(x),
263
+ getVariables: (e) => (e == null || e(u), u),
264
+ validateVariables: G,
265
+ showVariables: () => M("variables")
266
+ }),
267
+ [u, x, K, j, G]
268
+ ), J(() => {
269
+ W.current && W.current.srcdoc !== U && (W.current.srcdoc = U);
270
+ }, [U]);
271
+ const ut = (e, t) => {
272
+ t !== null && rt(t);
273
+ }, mt = (e, t) => {
274
+ (t === "desktop" || t === "mobile") && ot(t);
275
+ }, Y = w(
276
+ (e) => {
277
+ var i, b;
278
+ const t = xe.current;
279
+ if (t != null && t.state && (t != null && t.dispatch)) {
280
+ const L = (i = t.state.selection) == null ? void 0 : i.main, z = (L == null ? void 0 : L.from) ?? t.state.doc.length, X = (L == null ? void 0 : L.to) ?? z;
281
+ t.dispatch({
282
+ changes: { from: z, to: X, insert: e },
283
+ selection: { anchor: z + e.length }
284
+ }), (b = t.focus) == null || b.call(t), te(t.state.doc.toString());
285
+ return;
286
+ }
287
+ te(`${x}${e}`);
288
+ },
289
+ [x]
290
+ ), ht = w(
291
+ (e, t, i) => {
292
+ C(
293
+ u.map(
294
+ (b) => b.attribute === e && b.type === t ? { ...b, default: i } : b
295
+ )
296
+ );
297
+ },
298
+ [u, C]
299
+ ), bt = w(
300
+ (e, t) => {
301
+ const i = qe(e, t);
302
+ i && (Y(hr(e, t)), u.some((b) => b.attribute === i.attribute && b.type === i.type) || C([...u, i]), M("variables"));
303
+ },
304
+ [u, Y, C]
305
+ ), q = Q(() => {
306
+ const e = I.trim();
307
+ return e ? H.test(e) ? mr(e) || u.some((t) => t.type === "user" && t.attribute === e) ? n("text.variables.customVariableNameDuplicate") : "" : n("text.variables.customVariableNameInvalid") : n("text.variables.customVariableNameRequired");
308
+ }, [I, u]), pt = w(() => {
309
+ const e = k.trim();
310
+ if (_(!0), P(!0), q || e === "") return;
311
+ const t = qe(I.trim(), "user", e);
312
+ t && (Y(t.variable), C([...u, t]), pe(""), fe(""), _(!1), P(!1), M("variables"));
313
+ }, [k, I, q, u, Y, C]), ft = Q(() => [{ id: "custom", items: u.filter((t) => t.type === "user").filter((t) => !ae.some((i) => i.items.some((b) => b.name === t.attribute))).map((t) => ({
314
+ name: t.attribute,
315
+ labelKey: t.attribute,
316
+ kind: "user"
317
+ })) }, ...ae], [u]), xt = (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", E = $t(), gt = D === "desktop" || D === "mobile" ? D : "desktop", yt = v === "split" || v === "code" || v === "preview" ? v : "split";
318
+ (Ee = (ve = E.palette) == null ? void 0 : ve.action) == null || Ee.selected, (Ve = (Te = E.palette) == null ? void 0 : Te.primary) == null || Ve.main, (we = (Ce = E.palette) == null ? void 0 : Ce.action) == null || we.selected, (He = (Se = E.palette) == null ? void 0 : Se.background) == null || He.paper, (De = (Le = E.palette) == null ? void 0 : Le.text) == null || De.primary, (Ie = (Me = E.palette) == null ? void 0 : Me.action) == null || Ie.hover;
319
+ const A = {
116
320
  tooltip: {
117
321
  sx: {
118
- fontSize: "11px",
119
- fontWeight: 300,
120
- backgroundColor: re(((Y = (R = d.palette) == null ? void 0 : R.text) == null ? void 0 : Y.primary) ?? "#1F1F21", 0.9),
121
- color: ((G = (A = d.palette) == null ? void 0 : A.common) == null ? void 0 : G.white) ?? "#fff"
322
+ fontSize: "13px",
323
+ fontWeight: 400,
324
+ lineHeight: 1.45,
325
+ maxWidth: 360,
326
+ backgroundColor: Ge(((Ae = (ke = E.palette) == null ? void 0 : ke.text) == null ? void 0 : Ae.primary) ?? "#1F1F21", 0.9),
327
+ color: ((Oe = (ze = E.palette) == null ? void 0 : ze.common) == null ? void 0 : Oe.white) ?? "#fff"
122
328
  }
123
329
  },
124
330
  arrow: {
125
- sx: { color: re(((X = ($ = d.palette) == null ? void 0 : $.text) == null ? void 0 : X.primary) ?? "#1F1F21", 0.9) }
331
+ sx: { color: Ge(((Be = (Re = E.palette) == null ? void 0 : Re.text) == null ? void 0 : Be.primary) ?? "#1F1F21", 0.9) }
126
332
  }
127
- }, M = () => /* @__PURE__ */ e(
128
- i,
333
+ }, ge = () => /* @__PURE__ */ m(
334
+ d,
129
335
  {
130
336
  sx: {
131
- height: se,
337
+ height: g,
132
338
  minHeight: 0,
133
339
  display: "flex",
134
340
  flexDirection: "column",
135
- borderRight: n === "split" ? "1px solid" : "none",
341
+ position: "relative",
342
+ borderRight: v === "split" ? "1px solid" : "none",
136
343
  borderColor: "divider"
137
344
  },
138
- children: /* @__PURE__ */ e(
139
- i,
140
- {
141
- sx: {
142
- flex: 1,
143
- minHeight: 0,
144
- overflow: "hidden",
145
- display: "flex",
146
- flexDirection: "column",
147
- "& .cm-editor": {
148
- fontSize: "14px"
149
- },
150
- "& .cm-scroller": {
151
- fontFamily: "monospace"
152
- },
153
- "& .cm-theme": {
154
- height: "100%"
155
- },
156
- // 自定义光标样式,使其更粗、更显眼
157
- "& .cm-cursor": {
158
- borderLeftWidth: "2px !important",
159
- borderLeftStyle: "solid !important",
160
- marginLeft: "-1px"
161
- // 补偿增加的宽度,保持位置居中
345
+ children: [
346
+ /* @__PURE__ */ r(
347
+ d,
348
+ {
349
+ sx: {
350
+ flex: 1,
351
+ minHeight: 0,
352
+ overflow: "hidden",
353
+ display: "flex",
354
+ flexDirection: "column",
355
+ "& .cm-editor": {
356
+ fontSize: "14px"
357
+ },
358
+ "& .cm-scroller": {
359
+ fontFamily: "monospace"
360
+ },
361
+ "& .cm-theme": {
362
+ height: "100%"
363
+ },
364
+ // 自定义光标样式,使其更粗、更显眼
365
+ "& .cm-cursor": {
366
+ borderLeftWidth: "2px !important",
367
+ borderLeftStyle: "solid !important",
368
+ marginLeft: "-1px"
369
+ // 补偿增加的宽度,保持位置居中
370
+ },
371
+ "& .cm-focused .cm-cursor": {
372
+ borderLeftWidth: "2px !important",
373
+ borderLeftStyle: "solid !important",
374
+ opacity: 1
375
+ }
162
376
  },
163
- "& .cm-focused .cm-cursor": {
164
- borderLeftWidth: "2px !important",
165
- borderLeftStyle: "solid !important",
166
- opacity: 1
167
- }
168
- },
169
- children: /* @__PURE__ */ e(
170
- Se,
171
- {
172
- value: v,
173
- height: "100%",
174
- extensions: [Fe()],
175
- theme: C[k] || le,
176
- onChange: be,
177
- basicSetup: {
178
- lineNumbers: !0,
179
- foldGutter: !0,
180
- dropCursor: !0,
181
- allowMultipleSelections: !0
377
+ children: /* @__PURE__ */ r(
378
+ Lt,
379
+ {
380
+ value: x,
381
+ height: "100%",
382
+ extensions: [Dt()],
383
+ theme: de[ue] || Je,
384
+ onChange: te,
385
+ onCreateEditor: (e) => {
386
+ xe.current = e;
387
+ },
388
+ basicSetup: {
389
+ lineNumbers: !0,
390
+ foldGutter: !0,
391
+ dropCursor: !0,
392
+ allowMultipleSelections: !0
393
+ }
182
394
  }
183
- }
184
- )
185
- }
186
- )
395
+ )
396
+ }
397
+ ),
398
+ /* @__PURE__ */ r(
399
+ ie,
400
+ {
401
+ size: "small",
402
+ variant: "contained",
403
+ startIcon: /* @__PURE__ */ r(fr, { fontSize: "small" }),
404
+ onClick: dt,
405
+ sx: {
406
+ position: "absolute",
407
+ right: 16,
408
+ bottom: 16,
409
+ zIndex: 2,
410
+ textTransform: "none",
411
+ boxShadow: 3
412
+ },
413
+ children: n("common.save")
414
+ }
415
+ )
416
+ ]
187
417
  }
188
- ), S = () => /* @__PURE__ */ e(i, { sx: {
189
- height: ce,
418
+ ), vt = () => /* @__PURE__ */ r(d, { sx: {
419
+ height: h,
190
420
  overflow: "auto",
191
421
  backgroundColor: "#F5F5F5",
192
- padding: m === "mobile" ? "32px 16px" : "16px",
422
+ padding: D === "mobile" ? "32px 16px" : "16px",
193
423
  display: "flex",
194
424
  justifyContent: "center"
195
- }, children: /* @__PURE__ */ e(
196
- i,
425
+ }, children: /* @__PURE__ */ r(
426
+ d,
197
427
  {
198
428
  sx: {
199
429
  width: "100%",
200
- maxWidth: m === "mobile" ? "370px" : "100%",
201
- height: m === "mobile" ? "800px" : "100%",
430
+ maxWidth: D === "mobile" ? "370px" : "100%",
431
+ height: D === "mobile" ? "800px" : "100%",
202
432
  border: "none",
203
433
  overflow: "hidden"
204
434
  },
205
- children: /* @__PURE__ */ e(
435
+ children: /* @__PURE__ */ r(
206
436
  "iframe",
207
437
  {
208
- ref: y,
209
- srcDoc: w,
438
+ ref: W,
439
+ srcDoc: U,
210
440
  style: {
211
441
  width: "100%",
212
442
  height: "100%",
@@ -218,9 +448,215 @@ function xt({
218
448
  }
219
449
  )
220
450
  }
221
- ) });
222
- return /* @__PURE__ */ s(
223
- i,
451
+ ) }), Et = () => /* @__PURE__ */ m(
452
+ d,
453
+ {
454
+ sx: {
455
+ height: h,
456
+ overflow: "auto",
457
+ backgroundColor: "background.paper",
458
+ p: 2
459
+ },
460
+ children: [
461
+ /* @__PURE__ */ r(d, { sx: { display: "flex", alignItems: "center", justifyContent: "space-between", gap: 1, mb: 1.5 }, children: /* @__PURE__ */ m(d, { sx: { minWidth: 0 }, children: [
462
+ /* @__PURE__ */ m(d, { sx: { display: "flex", alignItems: "center", gap: 0.75 }, children: [
463
+ /* @__PURE__ */ r(S, { variant: "subtitle1", sx: { fontWeight: 700 }, children: n("htmlEditor.variables.title") }),
464
+ /* @__PURE__ */ r(O, { title: n("htmlEditor.variables.help"), arrow: !0, slotProps: A, children: /* @__PURE__ */ r(d, { component: "span", sx: { display: "inline-flex", color: "text.secondary", cursor: "help" }, children: /* @__PURE__ */ r(gr, { fontSize: "small" }) }) })
465
+ ] }),
466
+ /* @__PURE__ */ r(S, { variant: "body2", color: "text.secondary", children: n("htmlEditor.variables.scanHint") })
467
+ ] }) }),
468
+ /* @__PURE__ */ r(d, { sx: { mb: 2 }, children: ft.map((e) => {
469
+ const t = nt === e.id;
470
+ return /* @__PURE__ */ m(
471
+ Gt,
472
+ {
473
+ disableGutters: !0,
474
+ square: !0,
475
+ elevation: 0,
476
+ expanded: t,
477
+ onChange: (i, b) => st(b ? e.id : null),
478
+ sx: {
479
+ "&:before": { display: "none" },
480
+ border: 1,
481
+ borderColor: "divider",
482
+ borderRadius: 1,
483
+ overflow: "hidden",
484
+ mb: 1
485
+ },
486
+ children: [
487
+ /* @__PURE__ */ r(
488
+ Kt,
489
+ {
490
+ expandIcon: /* @__PURE__ */ r(xr, { fontSize: "small" }),
491
+ sx: {
492
+ minHeight: 44,
493
+ "& .MuiAccordionSummary-content": { my: 1 }
494
+ },
495
+ children: /* @__PURE__ */ r(S, { variant: "body2", color: "text.primary", children: n(xt(e.id)) })
496
+ }
497
+ ),
498
+ /* @__PURE__ */ m(Ut, { sx: { pt: 0, pb: 1.25 }, children: [
499
+ e.id === "custom" && /* @__PURE__ */ m(d, { sx: { mb: 1 }, children: [
500
+ /* @__PURE__ */ r(
501
+ le,
502
+ {
503
+ size: "small",
504
+ fullWidth: !0,
505
+ label: n("text.variables.customVariableName"),
506
+ value: I,
507
+ placeholder: "e.g. order_id",
508
+ onChange: (i) => {
509
+ pe(i.target.value), !Z && i.target.value.trim() !== "" && _(!0);
510
+ },
511
+ onBlur: () => {
512
+ I.trim() !== "" && _(!0);
513
+ },
514
+ error: Z && !!q,
515
+ helperText: Z && q || " ",
516
+ sx: { mb: 1 }
517
+ }
518
+ ),
519
+ /* @__PURE__ */ r(
520
+ le,
521
+ {
522
+ size: "small",
523
+ fullWidth: !0,
524
+ label: n("text.variables.defaultValueLabel"),
525
+ value: k,
526
+ placeholder: n("text.variables.defaultPlaceholder"),
527
+ onChange: (i) => {
528
+ fe(i.target.value), !ee && i.target.value.trim() !== "" && P(!0);
529
+ },
530
+ onBlur: () => {
531
+ k.trim() !== "" && P(!0);
532
+ },
533
+ error: ee && k.trim() === "",
534
+ helperText: ee && k.trim() === "" ? n("text.variables.defaultRequired") : " "
535
+ }
536
+ ),
537
+ /* @__PURE__ */ r(
538
+ ie,
539
+ {
540
+ fullWidth: !0,
541
+ size: "small",
542
+ variant: "outlined",
543
+ startIcon: /* @__PURE__ */ r(br, { fontSize: "small" }),
544
+ onClick: pt,
545
+ sx: {
546
+ justifyContent: "center",
547
+ borderColor: "divider",
548
+ borderStyle: "dashed",
549
+ color: "text.secondary",
550
+ textTransform: "none"
551
+ },
552
+ children: n("text.variables.addCustomVariable")
553
+ }
554
+ )
555
+ ] }),
556
+ e.items.length > 0 && /* @__PURE__ */ r(d, { sx: { display: "grid", gap: 0.75 }, children: e.items.map((i) => /* @__PURE__ */ r(
557
+ ie,
558
+ {
559
+ size: "small",
560
+ variant: "outlined",
561
+ onClick: () => bt(i.name, i.kind),
562
+ sx: {
563
+ justifyContent: "flex-start",
564
+ borderColor: "divider",
565
+ color: "text.secondary",
566
+ textTransform: "none"
567
+ },
568
+ children: /* @__PURE__ */ m(d, { sx: { textAlign: "left", minWidth: 0 }, children: [
569
+ /* @__PURE__ */ r(S, { variant: "body2", color: "text.primary", children: e.id === "custom" ? i.name : n(i.labelKey) }),
570
+ /* @__PURE__ */ r(S, { variant: "caption", color: "text.secondary", sx: { fontFamily: "monospace" }, children: i.kind === "builtin" ? `{%${i.name}%}` : `{{${i.name}}}` })
571
+ ] })
572
+ },
573
+ `${e.id}:${i.name}`
574
+ )) })
575
+ ] })
576
+ ]
577
+ },
578
+ e.id
579
+ );
580
+ }) }),
581
+ /* @__PURE__ */ r(Yt, { sx: { my: 2 } }),
582
+ /* @__PURE__ */ r(S, { variant: "subtitle2", sx: { mb: 1 }, children: n("htmlEditor.variables.detected") }),
583
+ /* @__PURE__ */ r(S, { variant: "body2", color: "text.secondary", sx: { mb: 1.25 }, children: n("htmlEditor.variables.defaultHelp") }),
584
+ u.length === 0 ? /* @__PURE__ */ r(
585
+ d,
586
+ {
587
+ sx: {
588
+ border: "1px dashed",
589
+ borderColor: "divider",
590
+ borderRadius: 1,
591
+ p: 2,
592
+ color: "text.secondary",
593
+ fontSize: 14,
594
+ textAlign: "center"
595
+ },
596
+ children: n("htmlEditor.variables.empty")
597
+ }
598
+ ) : /* @__PURE__ */ r(d, { sx: { display: "grid", gap: 1.5 }, children: u.map((e) => {
599
+ const t = lt && e.type === "user" && e.default.trim() === "";
600
+ return /* @__PURE__ */ m(
601
+ d,
602
+ {
603
+ sx: {
604
+ display: "grid",
605
+ gap: 0.75,
606
+ p: 1.25,
607
+ border: "1px solid",
608
+ borderColor: t ? "error.main" : "divider",
609
+ borderRadius: 1
610
+ },
611
+ children: [
612
+ /* @__PURE__ */ r(S, { variant: "body2", sx: { fontFamily: "monospace", wordBreak: "break-all" }, children: e.variable }),
613
+ /* @__PURE__ */ r(
614
+ le,
615
+ {
616
+ size: "small",
617
+ fullWidth: !0,
618
+ disabled: e.type === "system",
619
+ value: e.default,
620
+ label: n("text.variables.defaultValueLabel"),
621
+ placeholder: e.type === "system" ? n("htmlEditor.variables.systemDefault") : n("text.variables.defaultPlaceholder"),
622
+ error: t,
623
+ helperText: t ? n("text.variables.defaultRequired") : " ",
624
+ onChange: (i) => ht(e.attribute, e.type, i.target.value)
625
+ }
626
+ )
627
+ ]
628
+ },
629
+ `${e.type}:${e.attribute}`
630
+ );
631
+ }) })
632
+ ]
633
+ }
634
+ ), ye = () => /* @__PURE__ */ m(d, { sx: { height: h, minHeight: 0, display: "flex", flexDirection: "column" }, children: [
635
+ /* @__PURE__ */ m(
636
+ jt,
637
+ {
638
+ value: he,
639
+ onChange: (e, t) => M(t),
640
+ sx: {
641
+ minHeight: 40,
642
+ borderBottom: "1px solid",
643
+ borderColor: "divider",
644
+ backgroundColor: "background.paper",
645
+ "& .MuiTab-root": {
646
+ minHeight: 40,
647
+ textTransform: "none"
648
+ }
649
+ },
650
+ children: [
651
+ /* @__PURE__ */ r(je, { value: "preview", label: n("htmlEditor.tabs.preview") }),
652
+ /* @__PURE__ */ r(je, { value: "variables", label: n("htmlEditor.tabs.variables") })
653
+ ]
654
+ }
655
+ ),
656
+ /* @__PURE__ */ r(d, { sx: { flex: 1, minHeight: 0, overflow: "hidden" }, children: he === "preview" ? vt() : Et() })
657
+ ] });
658
+ return /* @__PURE__ */ m(
659
+ d,
224
660
  {
225
661
  sx: {
226
662
  display: "flex",
@@ -229,11 +665,11 @@ function xt({
229
665
  width: "100%",
230
666
  minHeight: 0,
231
667
  minWidth: 0,
232
- ...me
668
+ ...p
233
669
  },
234
670
  children: [
235
- he && /* @__PURE__ */ s(
236
- i,
671
+ f && /* @__PURE__ */ m(
672
+ d,
237
673
  {
238
674
  sx: {
239
675
  display: "flex",
@@ -245,55 +681,55 @@ function xt({
245
681
  backgroundColor: "background.paper"
246
682
  },
247
683
  children: [
248
- /* @__PURE__ */ s(i, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
249
- /* @__PURE__ */ s(
250
- ee,
684
+ /* @__PURE__ */ m(d, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: [
685
+ /* @__PURE__ */ m(
686
+ _e,
251
687
  {
252
- value: Ee,
688
+ value: yt,
253
689
  exclusive: !0,
254
- onChange: ve,
690
+ onChange: ut,
255
691
  size: "small",
256
- "aria-label": r("htmlEditor.mode.split"),
692
+ "aria-label": n("htmlEditor.mode.split"),
257
693
  children: [
258
- /* @__PURE__ */ e(b, { title: r("htmlEditor.tooltips.splitView"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
259
- g,
694
+ /* @__PURE__ */ r(O, { title: n("htmlEditor.tooltips.splitView"), arrow: !0, slotProps: A, children: /* @__PURE__ */ r(
695
+ F,
260
696
  {
261
697
  value: "split",
262
- "aria-label": r("htmlEditor.mode.split"),
263
- children: /* @__PURE__ */ e(Ze, { fontSize: "small" })
698
+ "aria-label": n("htmlEditor.mode.split"),
699
+ children: /* @__PURE__ */ r(vr, { fontSize: "small" })
264
700
  }
265
701
  ) }),
266
- /* @__PURE__ */ e(b, { title: r("htmlEditor.tooltips.codeOnly"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
267
- g,
702
+ /* @__PURE__ */ r(O, { title: n("htmlEditor.tooltips.codeOnly"), arrow: !0, slotProps: A, children: /* @__PURE__ */ r(
703
+ F,
268
704
  {
269
705
  value: "code",
270
- "aria-label": r("htmlEditor.mode.code"),
271
- children: /* @__PURE__ */ e(Je, { fontSize: "small" })
706
+ "aria-label": n("htmlEditor.mode.code"),
707
+ children: /* @__PURE__ */ r(pr, { fontSize: "small" })
272
708
  }
273
709
  ) }),
274
- /* @__PURE__ */ e(b, { title: r("htmlEditor.tooltips.previewOnly"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
275
- g,
710
+ /* @__PURE__ */ r(O, { title: n("htmlEditor.tooltips.previewOnly"), arrow: !0, slotProps: A, children: /* @__PURE__ */ r(
711
+ F,
276
712
  {
277
713
  value: "preview",
278
- "aria-label": r("htmlEditor.mode.preview"),
279
- children: /* @__PURE__ */ e(Qe, { fontSize: "small" })
714
+ "aria-label": n("htmlEditor.mode.preview"),
715
+ children: /* @__PURE__ */ r(yr, { fontSize: "small" })
280
716
  }
281
717
  ) })
282
718
  ]
283
719
  }
284
720
  ),
285
- /* @__PURE__ */ s(Re, { size: "small", sx: { minWidth: 140 }, children: [
286
- /* @__PURE__ */ e(Ye, { id: "theme-select-label", children: r("htmlEditor.theme") }),
287
- /* @__PURE__ */ s(
288
- Ae,
721
+ /* @__PURE__ */ m(_t, { size: "small", sx: { minWidth: 140 }, children: [
722
+ /* @__PURE__ */ r(Pt, { id: "theme-select-label", children: n("htmlEditor.theme") }),
723
+ /* @__PURE__ */ m(
724
+ Wt,
289
725
  {
290
726
  labelId: "theme-select-label",
291
727
  id: "theme-select",
292
- value: k,
293
- label: r("htmlEditor.theme"),
294
- onChange: (o) => {
295
- const t = o.target.value;
296
- ge(t), console.log("theme changed to", t), lt(t);
728
+ value: ue,
729
+ label: n("htmlEditor.theme"),
730
+ onChange: (e) => {
731
+ const t = e.target.value;
732
+ it(t), console.log("theme changed to", t), Sr(t);
297
733
  },
298
734
  sx: {
299
735
  // fontSize: '0.875rem',
@@ -302,38 +738,38 @@ function xt({
302
738
  }
303
739
  },
304
740
  children: [
305
- /* @__PURE__ */ e(te, { children: r("htmlEditor.lightThemes") }),
306
- Object.entries(ot).map(([o, t]) => /* @__PURE__ */ e(oe, { value: o, children: t }, o)),
307
- /* @__PURE__ */ e(te, { children: r("htmlEditor.darkThemes") }),
308
- Object.entries(rt).map(([o, t]) => /* @__PURE__ */ e(oe, { value: o, children: t }, o))
741
+ /* @__PURE__ */ r(Pe, { children: n("htmlEditor.lightThemes") }),
742
+ Object.entries(Vr).map(([e, t]) => /* @__PURE__ */ r(We, { value: e, children: t }, e)),
743
+ /* @__PURE__ */ r(Pe, { children: n("htmlEditor.darkThemes") }),
744
+ Object.entries(Cr).map(([e, t]) => /* @__PURE__ */ r(We, { value: e, children: t }, e))
309
745
  ]
310
746
  }
311
747
  )
312
748
  ] })
313
749
  ] }),
314
- /* @__PURE__ */ e(i, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: n !== "code" && /* @__PURE__ */ s(
315
- ee,
750
+ /* @__PURE__ */ r(d, { sx: { display: "flex", alignItems: "center", gap: 1 }, children: v !== "code" && /* @__PURE__ */ m(
751
+ _e,
316
752
  {
317
- value: we,
753
+ value: gt,
318
754
  exclusive: !0,
319
- onChange: ye,
755
+ onChange: mt,
320
756
  size: "small",
321
- "aria-label": r("htmlEditor.device.desktop"),
757
+ "aria-label": n("htmlEditor.device.desktop"),
322
758
  children: [
323
- /* @__PURE__ */ e(b, { title: r("htmlEditor.tooltips.desktopView"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
324
- g,
759
+ /* @__PURE__ */ r(O, { title: n("htmlEditor.tooltips.desktopView"), arrow: !0, slotProps: A, children: /* @__PURE__ */ r(
760
+ F,
325
761
  {
326
762
  value: "desktop",
327
- "aria-label": r("htmlEditor.device.desktop"),
328
- children: /* @__PURE__ */ e(et, { fontSize: "small" })
763
+ "aria-label": n("htmlEditor.device.desktop"),
764
+ children: /* @__PURE__ */ r(Er, { fontSize: "small" })
329
765
  }
330
766
  ) }),
331
- /* @__PURE__ */ e(b, { title: r("htmlEditor.tooltips.mobileView"), arrow: !0, slotProps: f, children: /* @__PURE__ */ e(
332
- g,
767
+ /* @__PURE__ */ r(O, { title: n("htmlEditor.tooltips.mobileView"), arrow: !0, slotProps: A, children: /* @__PURE__ */ r(
768
+ F,
333
769
  {
334
770
  value: "mobile",
335
- "aria-label": r("htmlEditor.device.mobile"),
336
- children: /* @__PURE__ */ e(tt, { fontSize: "small" })
771
+ "aria-label": n("htmlEditor.device.mobile"),
772
+ children: /* @__PURE__ */ r(Tr, { fontSize: "small" })
337
773
  }
338
774
  ) })
339
775
  ]
@@ -342,8 +778,8 @@ function xt({
342
778
  ]
343
779
  }
344
780
  ),
345
- /* @__PURE__ */ s(
346
- i,
781
+ /* @__PURE__ */ m(
782
+ d,
347
783
  {
348
784
  sx: {
349
785
  flex: 1,
@@ -353,12 +789,12 @@ function xt({
353
789
  overflow: "hidden"
354
790
  },
355
791
  children: [
356
- n === "split" && /* @__PURE__ */ s(De, { children: [
357
- /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: M() }),
358
- /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: S() })
792
+ v === "split" && /* @__PURE__ */ m(wt, { children: [
793
+ /* @__PURE__ */ r(d, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: ge() }),
794
+ /* @__PURE__ */ r(d, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: ye() })
359
795
  ] }),
360
- n === "code" && /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: M() }),
361
- n === "preview" && /* @__PURE__ */ e(i, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: S() })
796
+ v === "code" && /* @__PURE__ */ r(d, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: ge() }),
797
+ v === "preview" && /* @__PURE__ */ r(d, { sx: { flex: 1, minHeight: 0, minWidth: 0, overflow: "hidden" }, children: ye() })
362
798
  ]
363
799
  }
364
800
  )
@@ -366,7 +802,9 @@ function xt({
366
802
  }
367
803
  );
368
804
  }
805
+ const Lr = St(Hr);
806
+ Lr.displayName = "HtmlEditor";
369
807
  export {
370
- xt as HtmlEditor,
371
- xt as default
808
+ Lr as HtmlEditor,
809
+ Lr as default
372
810
  };