@blocklet/pages-kit-inner-components 0.4.68 → 0.4.70

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.
package/lib/es/setting.js CHANGED
@@ -1,145 +1,145 @@
1
- import { jsx as t, jsxs as S, Fragment as $ } from "react/jsx-runtime";
2
- import { t as ge, g as ne, i as _e, b as Je, h as de, E as gt, n as $e, j as xe } from "./_chunks/state-DqChB5ys.js";
3
- import te from "@arcblock/ux/lib/Empty";
4
- import { useLocaleContext as A } from "@arcblock/ux/lib/Locale/context";
5
- import { CodeEditor as ke } from "@blocklet/code-editor";
6
- import xt from "@mui/icons-material/AddRounded";
7
- import kt from "@mui/icons-material/ArrowDownward";
8
- import wt from "@mui/icons-material/ArrowUpward";
9
- import Pt from "@mui/icons-material/DeleteOutline";
10
- import { Typography as F, TextField as D, Stack as j, FormLabel as oe, Box as O, TableContainer as It, Paper as re, Table as Me, TableHead as He, TableRow as se, TableCell as ce, TableBody as Ye, Button as T, IconButton as we, FormControlLabel as Ge, Switch as Le, InputAdornment as ue, Dialog as Pe, DialogTitle as qe, DialogContent as Qe, DialogActions as Xe, alpha as St, Tooltip as X, buttonClasses as Ot, Autocomplete as Ze, MenuItem as he, Popper as et, Divider as Ct } from "@mui/material";
1
+ import { jsx as t, jsxs as S, Fragment as J } from "react/jsx-runtime";
2
+ import { t as ve, g as ie, i as Me, b as He, h as ae, E as yt, n as Ye, j as ge } from "./_chunks/state-DqChB5ys.js";
3
+ import ee from "@arcblock/ux/lib/Empty";
4
+ import { useLocaleContext as N } from "@arcblock/ux/lib/Locale/context";
5
+ import { CodeEditor as xe } from "@blocklet/code-editor";
6
+ import vt from "@mui/icons-material/AddRounded";
7
+ import gt from "@mui/icons-material/ArrowDownward";
8
+ import xt from "@mui/icons-material/ArrowUpward";
9
+ import kt from "@mui/icons-material/DeleteOutline";
10
+ import { Typography as $, TextField as D, Stack as j, FormLabel as ne, Box as O, TableContainer as wt, Paper as de, Table as Le, TableHead as Ge, TableRow as oe, TableCell as le, TableBody as qe, Button as A, IconButton as ke, FormControlLabel as Qe, Switch as Xe, InputAdornment as ue, Dialog as pe, DialogTitle as we, DialogContent as Pe, DialogActions as Ie, alpha as Pt, Tooltip as Z, buttonClasses as It, Autocomplete as Ze, MenuItem as me, Divider as St, Popper as Ot } from "@mui/material";
11
11
  import V from "lodash/sortBy";
12
- import { useCallback as N, useMemo as ae, forwardRef as tt, useState as Z, useEffect as M, useImperativeHandle as rt, lazy as jt, Suspense as zt, useRef as J, useId as Rt } from "react";
13
- import { useUpdate as it, useDebounce as Dt } from "react-use";
14
- import { styled as At } from "@arcblock/ux/lib/Theme";
12
+ import { useCallback as T, useMemo as se, forwardRef as et, useState as M, useEffect as H, useImperativeHandle as tt, lazy as Ct, Suspense as jt, useRef as F, useId as zt } from "react";
13
+ import { useUpdate as rt, useDebounce as Rt } from "react-use";
14
+ import { styled as Dt } from "@arcblock/ux/lib/Theme";
15
15
  import { cx as Nt } from "@emotion/css";
16
- import { useReactive as Tt, useBoolean as Vt, useUpdate as Et } from "ahooks";
17
- import Ue from "gradient-parser";
16
+ import { useReactive as At, useBoolean as Tt, useUpdate as Vt } from "ahooks";
17
+ import Ke from "gradient-parser";
18
18
  import "lodash/without";
19
- import Ut from "tinycolor2";
20
- import { red as Wt, pink as Bt, purple as Kt, indigo as Ft, blue as _t, cyan as Jt, teal as $t, green as Mt, lime as Ht, yellow as Yt, amber as Gt, orange as Lt, brown as qt, grey as Qt, blueGrey as Xt } from "@mui/material/colors";
21
- import { getImageSize as fe, getVideoSize as be, UploaderButton as Ie, UploaderProvider as Se, useUploader as Zt } from "./uploader.js";
22
- import { Icon as er } from "@iconify-icon/react";
23
- import lt from "lodash/isEmpty";
19
+ import Wt from "tinycolor2";
20
+ import { red as Et, pink as Ut, purple as Bt, indigo as Kt, blue as Ft, cyan as _t, teal as Jt, green as $t, lime as Mt, yellow as Ht, amber as Yt, orange as Lt, brown as Gt, grey as qt, blueGrey as Qt } from "@mui/material/colors";
21
+ import { getImageSize as he, getVideoSize as fe, UploaderButton as Se, UploaderProvider as Oe, useUploader as Xt } from "./uploader.js";
22
+ import { Icon as Zt } from "@iconify-icon/react";
23
+ import it from "lodash/isEmpty";
24
24
  import nt from "lodash/set";
25
- import * as ye from "yaml";
26
- import "lodash";
27
- import We from "@arcblock/ux/lib/Toast";
25
+ import * as be from "yaml";
26
+ import { cloneDeep as er } from "lodash";
27
+ import Fe from "@arcblock/ux/lib/Toast";
28
28
  import { CustomComponentRenderer as ot, transpileAndLoadScript as tr, getPropertiesFromCode as rr } from "@blocklet/pages-kit/components";
29
- import { unstable_useNumberInput as ir, ClickAwayListener as st } from "@mui/base";
30
- import { VisibilityOffRounded as lr, VisibilityRounded as nr, DeleteOutlineRounded as or, DragIndicatorRounded as sr, TranslateRounded as ct, AddRounded as at, InfoRounded as dt, StarRounded as cr, SettingsRounded as ut } from "@mui/icons-material";
31
- import { alpha as Be } from "@mui/material/styles";
32
- import { getYjsValue as H } from "@syncedstore/core";
33
- import ar from "lodash/assign";
34
- import dr from "lodash/has";
35
- import ee from "lodash/isNil";
36
- import ur from "lodash/isObject";
37
- import pr from "lodash/keyBy";
38
- import mr from "lodash/omit";
39
- import hr from "lodash/pick";
40
- import fr from "lodash/reduce";
41
- import { usePopupState as pe, bindTrigger as me, bindDialog as pt, bindPopper as mt } from "material-ui-popup-state/hooks";
42
- import { ErrorBoundary as br } from "react-error-boundary";
43
- import { useDrop as ht, useDrag as yr } from "react-dnd";
44
- function vr({
29
+ import { unstable_useNumberInput as ir, ClickAwayListener as nr } from "@mui/base";
30
+ import { VisibilityOffRounded as or, VisibilityRounded as lr, DeleteOutlineRounded as sr, DragIndicatorRounded as cr, TranslateRounded as lt, AddRounded as st, InfoRounded as ct, StarRounded as ar, SettingsRounded as at } from "@mui/icons-material";
31
+ import { alpha as _e } from "@mui/material/styles";
32
+ import { getYjsValue as Y } from "@syncedstore/core";
33
+ import dr from "lodash/assign";
34
+ import ur from "lodash/has";
35
+ import ce from "lodash/isNil";
36
+ import pr from "lodash/isObject";
37
+ import mr from "lodash/keyBy";
38
+ import hr from "lodash/omit";
39
+ import fr from "lodash/pick";
40
+ import br from "lodash/reduce";
41
+ import { usePopupState as Ce, bindTrigger as je, bindDialog as dt, bindPopper as yr } from "material-ui-popup-state/hooks";
42
+ import { ErrorBoundary as vr } from "react-error-boundary";
43
+ import { useDrop as ut, useDrag as gr } from "react-dnd";
44
+ function xr({
45
45
  onClick: e,
46
46
  disabled: r,
47
- sx: l,
47
+ sx: n,
48
48
  ...i
49
49
  }) {
50
- return /* @__PURE__ */ t(we, { size: "small", color: "warning", variant: "outlined", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(Pt, { fontSize: "small" }) });
50
+ return /* @__PURE__ */ t(ke, { size: "small", color: "warning", variant: "outlined", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(kt, { fontSize: "small" }) });
51
51
  }
52
- function gr({
52
+ function kr({
53
53
  onClick: e,
54
54
  disabled: r,
55
- sx: l,
55
+ sx: n,
56
56
  ...i
57
57
  }) {
58
- return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(wt, { fontSize: "small" }) });
58
+ return /* @__PURE__ */ t(ke, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(xt, { fontSize: "small" }) });
59
59
  }
60
- function xr({
60
+ function wr({
61
61
  onClick: e,
62
62
  disabled: r,
63
- sx: l,
63
+ sx: n,
64
64
  ...i
65
65
  }) {
66
- return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(kt, { fontSize: "small" }) });
66
+ return /* @__PURE__ */ t(ke, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(gt, { fontSize: "small" }) });
67
67
  }
68
- function kr({
68
+ function Pr({
69
69
  label: e,
70
70
  value: r,
71
- onChange: l,
71
+ onChange: n,
72
72
  disabled: i = !1,
73
- itemLabel: u = "",
73
+ itemLabel: d = "",
74
74
  emptyHeight: m = 40,
75
- property: a,
75
+ property: c,
76
76
  renderItem: p,
77
77
  ...k
78
78
  }) {
79
- const { t: h, locale: x } = A(), b = it(), n = N(
80
- (y) => {
81
- l(ge(y, a.type));
79
+ const { t: y, locale: g } = N(), h = rt(), o = T(
80
+ (v) => {
81
+ n(ve(v, c.type));
82
82
  },
83
- [l, a.type]
84
- ), o = ae(() => Array.isArray(r) ? r : [], [r]), s = N(() => {
85
- const y = [...o, ""];
86
- n(y), b();
87
- }, [o, n, b]), d = N(() => {
88
- if (!a || !a.subProperties)
89
- return s();
90
- const y = {};
91
- V(Object.values(a.subProperties), "index").forEach(({ data: R }) => {
92
- var U, W;
83
+ [n, c.type]
84
+ ), s = se(() => Array.isArray(r) ? r : [], [r]), l = T(() => {
85
+ const v = [...s, ""];
86
+ o(v), h();
87
+ }, [s, o, h]), u = T(() => {
88
+ if (!c || !c.subProperties)
89
+ return l();
90
+ const v = {};
91
+ V(Object.values(c.subProperties), "index").forEach(({ data: R }) => {
92
+ var E, U;
93
93
  if (!R.key) return;
94
- const E = ((W = (U = R.locales) == null ? void 0 : U[x]) == null ? void 0 : W.defaultValue) ?? "";
95
- y[R.key] = E;
94
+ const W = ((U = (E = R.locales) == null ? void 0 : E[g]) == null ? void 0 : U.defaultValue) ?? "";
95
+ v[R.key] = W;
96
96
  });
97
- const z = [...o, y];
98
- n(z), b();
99
- }, [o, n, b, a, x, s]), f = N(
100
- (y) => {
97
+ const z = [...s, v];
98
+ o(z), h();
99
+ }, [s, o, h, c, g, l]), f = T(
100
+ (v) => {
101
101
  try {
102
- const I = JSON.parse(y);
103
- Array.isArray(I) ? n(I) : console.error("JSON解析结果不是数组");
102
+ const I = JSON.parse(v);
103
+ Array.isArray(I) ? o(I) : console.error("JSON解析结果不是数组");
104
104
  } catch (I) {
105
105
  console.error("JSON解析错误:", I);
106
106
  }
107
107
  },
108
- [n]
109
- ), w = N(
110
- (y) => {
111
- const I = o.filter((z, R) => R !== y);
112
- n(I), b();
108
+ [o]
109
+ ), w = T(
110
+ (v) => {
111
+ const I = s.filter((z, R) => R !== v);
112
+ o(I), h();
113
113
  },
114
- [o, n, b]
115
- ), c = N(
116
- (y) => {
117
- if (y <= 0) return;
118
- const I = [...o], z = I[y];
119
- I[y] = I[y - 1], I[y - 1] = z, n(I), b();
114
+ [s, o, h]
115
+ ), a = T(
116
+ (v) => {
117
+ if (v <= 0) return;
118
+ const I = [...s], z = I[v];
119
+ I[v] = I[v - 1], I[v - 1] = z, o(I), h();
120
120
  },
121
- [o, n, b]
122
- ), v = N(
123
- (y) => {
124
- if (y >= o.length - 1) return;
125
- const I = [...o], z = I[y];
126
- I[y] = I[y + 1], I[y + 1] = z, n(I), b();
121
+ [s, o, h]
122
+ ), x = T(
123
+ (v) => {
124
+ if (v >= s.length - 1) return;
125
+ const I = [...s], z = I[v];
126
+ I[v] = I[v + 1], I[v + 1] = z, o(I), h();
127
127
  },
128
- [o, n, b]
129
- ), g = N(
130
- (y, I) => {
131
- const z = [...o];
132
- z[y] = I, n(z);
128
+ [s, o, h]
129
+ ), b = T(
130
+ (v, I) => {
131
+ const z = [...s];
132
+ z[v] = I, o(z);
133
133
  },
134
- [o, n]
135
- ), P = a && a.subProperties && Object.keys(a.subProperties).length > 0, C = ae(() => [
134
+ [s, o]
135
+ ), P = c && c.subProperties && Object.keys(c.subProperties).length > 0, C = se(() => [
136
136
  {
137
137
  field: "index",
138
138
  headerName: "#",
139
139
  width: 40,
140
140
  align: "center",
141
- renderCell: ({ index: y }) => /* @__PURE__ */ t(
142
- F,
141
+ renderCell: ({ index: v }) => /* @__PURE__ */ t(
142
+ $,
143
143
  {
144
144
  variant: "body1",
145
145
  sx: {
@@ -152,27 +152,27 @@ function kr({
152
152
  justifyContent: "center",
153
153
  color: "text.secondary"
154
154
  },
155
- children: y + 1
155
+ children: v + 1
156
156
  }
157
157
  )
158
158
  },
159
159
  {
160
160
  field: "content",
161
161
  headerName: "",
162
- renderCell: ({ row: y, index: I }) => p && P ? p({
163
- item: y,
162
+ renderCell: ({ row: v, index: I }) => p && P ? p({
163
+ item: v,
164
164
  index: I,
165
- property: a,
166
- onChange: (z) => g(I, z)
165
+ property: c,
166
+ onChange: (z) => b(I, z)
167
167
  }) : /* @__PURE__ */ t(
168
168
  D,
169
169
  {
170
170
  fullWidth: !0,
171
171
  size: "small",
172
172
  disabled: i,
173
- value: y,
174
- placeholder: u || `${h("item")} ${I + 1}`,
175
- onChange: (z) => g(I, z.target.value),
173
+ value: v,
174
+ placeholder: d || `${y("item")} ${I + 1}`,
175
+ onChange: (z) => b(I, z.target.value),
176
176
  ...k
177
177
  }
178
178
  )
@@ -183,36 +183,36 @@ function kr({
183
183
  width: 30,
184
184
  // 增加宽度以容纳更多按钮
185
185
  align: "center",
186
- renderCell: ({ index: y }) => /* @__PURE__ */ S(j, { direction: "column", spacing: 0.25, children: [
187
- /* @__PURE__ */ t(gr, { disabled: i || y === 0, onClick: () => c(y) }),
186
+ renderCell: ({ index: v }) => /* @__PURE__ */ S(j, { direction: "column", spacing: 0.25, children: [
187
+ /* @__PURE__ */ t(kr, { disabled: i || v === 0, onClick: () => a(v) }),
188
188
  /* @__PURE__ */ t(
189
- xr,
189
+ wr,
190
190
  {
191
- disabled: i || y === o.length - 1,
192
- onClick: () => v(y)
191
+ disabled: i || v === s.length - 1,
192
+ onClick: () => x(v)
193
193
  }
194
194
  ),
195
- /* @__PURE__ */ t(vr, { disabled: i, onClick: () => w(y) })
195
+ /* @__PURE__ */ t(xr, { disabled: i, onClick: () => w(v) })
196
196
  ] })
197
197
  }
198
198
  ], [
199
199
  p,
200
200
  P,
201
- a,
202
- g,
203
- u,
204
- h,
201
+ c,
202
+ b,
203
+ d,
204
+ y,
205
205
  i,
206
206
  k,
207
207
  w,
208
- c,
209
- v,
210
- o.length
208
+ a,
209
+ x,
210
+ s.length
211
211
  ]);
212
212
  return P ? /* @__PURE__ */ S(j, { width: "100%", gap: 1, children: [
213
- e && /* @__PURE__ */ t(oe, { children: e }),
214
- o.length > 0 ? /* @__PURE__ */ t(It, { component: re, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ S(
215
- Me,
213
+ e && /* @__PURE__ */ t(ne, { children: e }),
214
+ s.length > 0 ? /* @__PURE__ */ t(wt, { component: de, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ S(
215
+ Le,
216
216
  {
217
217
  size: "small",
218
218
  sx: {
@@ -229,18 +229,18 @@ function kr({
229
229
  borderCollapse: "collapse"
230
230
  },
231
231
  children: [
232
- /* @__PURE__ */ t(He, { sx: { display: "none" }, children: /* @__PURE__ */ t(se, { children: C.map((y) => /* @__PURE__ */ t(
233
- ce,
232
+ /* @__PURE__ */ t(Ge, { sx: { display: "none" }, children: /* @__PURE__ */ t(oe, { children: C.map((v) => /* @__PURE__ */ t(
233
+ le,
234
234
  {
235
- width: y.width,
236
- align: y.align || "left",
235
+ width: v.width,
236
+ align: v.align || "left",
237
237
  sx: { fontWeight: "bold" },
238
- children: y.renderHeader ? y.renderHeader() : y.headerName
238
+ children: v.renderHeader ? v.renderHeader() : v.headerName
239
239
  },
240
- y.field
240
+ v.field
241
241
  )) }) }),
242
- /* @__PURE__ */ t(Ye, { children: o.map((y, I, z) => /* @__PURE__ */ t(
243
- se,
242
+ /* @__PURE__ */ t(qe, { children: s.map((v, I, z) => /* @__PURE__ */ t(
243
+ oe,
244
244
  {
245
245
  sx: {
246
246
  borderBottom: I < z.length - 1 ? "1px solid" : "none",
@@ -250,7 +250,7 @@ function kr({
250
250
  }
251
251
  },
252
252
  children: C.map((R) => /* @__PURE__ */ t(
253
- ce,
253
+ le,
254
254
  {
255
255
  width: R.width,
256
256
  align: R.align || "left",
@@ -258,9 +258,9 @@ function kr({
258
258
  borderBottom: "none"
259
259
  },
260
260
  children: R.renderCell({
261
- row: y,
261
+ row: v,
262
262
  index: I,
263
- onChange: (E) => g(I, E)
263
+ onChange: (W) => b(I, W)
264
264
  })
265
265
  },
266
266
  `${I}-${R.field}`
@@ -270,79 +270,79 @@ function kr({
270
270
  )) })
271
271
  ]
272
272
  }
273
- ) }) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: m }, children: h("maker.properties.arrayEmpty") }),
273
+ ) }) : /* @__PURE__ */ t(ee, { style: { fontSize: 12, height: m }, children: y("maker.properties.arrayEmpty") }),
274
274
  /* @__PURE__ */ t(
275
- T,
275
+ A,
276
276
  {
277
277
  fullWidth: !0,
278
278
  size: "small",
279
279
  variant: "outlined",
280
280
  disabled: i,
281
- startIcon: /* @__PURE__ */ t(xt, {}),
282
- onClick: d,
283
- children: h("maker.properties.addArrayItem")
281
+ startIcon: /* @__PURE__ */ t(vt, {}),
282
+ onClick: u,
283
+ children: y("maker.properties.addArrayItem")
284
284
  }
285
285
  )
286
286
  ] }) : /* @__PURE__ */ S(j, { width: "100%", gap: 1, children: [
287
- e && /* @__PURE__ */ t(oe, { children: e }),
287
+ e && /* @__PURE__ */ t(ne, { children: e }),
288
288
  /* @__PURE__ */ t(O, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ t(
289
- ke,
289
+ xe,
290
290
  {
291
- keyId: a.id,
292
- locale: x,
291
+ keyId: c.id,
292
+ locale: g,
293
293
  language: "json",
294
- value: JSON.stringify(o, null, 2),
295
- onChange: (y) => f(y || "")
294
+ value: JSON.stringify(s, null, 2),
295
+ onChange: (v) => f(v || "")
296
296
  },
297
- a.id
297
+ c.id
298
298
  ) })
299
299
  ] });
300
300
  }
301
- Wt[300], Bt[300], Kt[300], // deepPurple['300'],
302
- Ft[300], _t[300], // lightBlue['300'],
303
- Jt[300], $t[300], Mt[300], // lightGreen['300'],
304
- Ht[300], Yt[300], Gt[300], Lt[300], // deepOrange['300'],
305
- qt[300], Qt[300], Xt[300];
306
- const wr = tt(function({ showMarkdown: r, markdown: l, onMarkdownChange: i, showUploader: u, value: m, meta: a, onChange: p, ...k }, h) {
307
- const [x, b] = Z("");
308
- M(() => {
309
- b(m || "");
310
- }, [m, b]);
311
- const n = async () => {
312
- if (x !== m) {
313
- const s = ne(x);
314
- if (!s) {
315
- p(x, void 0);
301
+ Et[300], Ut[300], Bt[300], // deepPurple['300'],
302
+ Kt[300], Ft[300], // lightBlue['300'],
303
+ _t[300], Jt[300], $t[300], // lightGreen['300'],
304
+ Mt[300], Ht[300], Yt[300], Lt[300], // deepOrange['300'],
305
+ Gt[300], qt[300], Qt[300];
306
+ const Ir = et(function({ showMarkdown: r, markdown: n, onMarkdownChange: i, showUploader: d, value: m, meta: c, onChange: p, ...k }, y) {
307
+ const [g, h] = M("");
308
+ H(() => {
309
+ h(m || "");
310
+ }, [m, h]);
311
+ const o = async () => {
312
+ if (g !== m) {
313
+ const l = ie(g);
314
+ if (!l) {
315
+ p(g, void 0);
316
316
  return;
317
317
  }
318
- const d = await fe(s).catch(() => be(s)).catch(() => {
318
+ const u = await he(l).catch(() => fe(l)).catch(() => {
319
319
  });
320
- p(x, { ...d, filename: x });
320
+ p(g, { ...u, filename: g });
321
321
  }
322
322
  };
323
- Dt(
323
+ Rt(
324
324
  () => {
325
- x !== m && p(x);
325
+ g !== m && p(g);
326
326
  },
327
327
  300,
328
- [x]
329
- ), rt(h, () => ({
330
- submit: n
328
+ [g]
329
+ ), tt(y, () => ({
330
+ submit: o
331
331
  }));
332
- const o = {};
333
- return u && (o.InputProps = {
332
+ const s = {};
333
+ return d && (s.InputProps = {
334
334
  sx: { pr: 0 },
335
335
  endAdornment: /* @__PURE__ */ t(ue, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ t(
336
- Ie,
336
+ Se,
337
337
  {
338
- onChange: async ({ response: s }) => {
339
- var c;
340
- const d = (c = s == null ? void 0 : s.data) == null ? void 0 : c.filename, f = ne(d) || "";
338
+ onChange: async ({ response: l }) => {
339
+ var a;
340
+ const u = (a = l == null ? void 0 : l.data) == null ? void 0 : a.filename, f = ie(u) || "";
341
341
  let w = {};
342
- f && (w = await fe(f).catch(() => be(f)).catch(() => {
343
- })), p(d, {
342
+ f && (w = await he(f).catch(() => fe(f)).catch(() => {
343
+ })), p(u, {
344
344
  ...w,
345
- filename: d
345
+ filename: u
346
346
  });
347
347
  }
348
348
  }
@@ -355,60 +355,60 @@ const wr = tt(function({ showMarkdown: r, markdown: l, onMarkdownChange: i, show
355
355
  ...k,
356
356
  label: /* @__PURE__ */ S(j, { direction: "row", spacing: 1, alignItems: "center", children: [
357
357
  k.label,
358
- r && /* @__PURE__ */ S($, { children: [
358
+ r && /* @__PURE__ */ S(J, { children: [
359
359
  " (",
360
360
  /* @__PURE__ */ t(
361
- Ge,
361
+ Qe,
362
362
  {
363
- checked: l,
364
- label: /* @__PURE__ */ t(O, { component: er, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
363
+ checked: n,
364
+ label: /* @__PURE__ */ t(O, { component: Zt, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
365
365
  labelPlacement: "start",
366
- control: /* @__PURE__ */ t(Le, { size: "small" }),
366
+ control: /* @__PURE__ */ t(Xe, { size: "small" }),
367
367
  sx: { ml: 0.25, pr: 1 },
368
- onChange: (s, d) => i == null ? void 0 : i(d)
368
+ onChange: (l, u) => i == null ? void 0 : i(u)
369
369
  }
370
370
  ),
371
371
  ")"
372
372
  ] })
373
373
  ] }),
374
374
  InputLabelProps: { shrink: !0, ...k.InputLabelProps },
375
- value: x,
376
- onChange: (s) => b(s.target.value),
377
- ...o,
378
- onKeyDown: (s) => {
379
- s.keyCode !== 229 && s.key === "Enter" && n();
375
+ value: g,
376
+ onChange: (l) => h(l.target.value),
377
+ ...s,
378
+ onKeyDown: (l) => {
379
+ l.keyCode !== 229 && l.key === "Enter" && o();
380
380
  }
381
381
  }
382
382
  );
383
- }), Pr = jt(() => import("react-best-gradient-color-picker"));
384
- function Ir(e) {
383
+ }), Sr = Ct(() => import("react-best-gradient-color-picker"));
384
+ function Or(e) {
385
385
  try {
386
- const l = Ue.parse(e).map((u) => {
387
- const m = u.colorStops.map((a) => {
388
- if (a.type !== "rgba") {
389
- const p = Ut(a.value).toRgb();
386
+ const n = Ke.parse(e).map((d) => {
387
+ const m = d.colorStops.map((c) => {
388
+ if (c.type !== "rgba") {
389
+ const p = Wt(c.value).toRgb();
390
390
  return {
391
- ...a,
391
+ ...c,
392
392
  value: [p.r, p.g, p.b, p.a],
393
393
  type: "rgba"
394
394
  };
395
395
  }
396
- return a;
396
+ return c;
397
397
  });
398
398
  return {
399
- ...u,
399
+ ...d,
400
400
  colorStops: m
401
401
  };
402
402
  });
403
- return Ue.stringify(l);
403
+ return Ke.stringify(n);
404
404
  } catch {
405
- return Je(e) ? e : "";
405
+ return He(e) ? e : "";
406
406
  }
407
407
  }
408
- function Sr({ color: e, sx: r = {}, ...l }) {
409
- Je(e);
408
+ function Cr({ color: e, sx: r = {}, ...n }) {
409
+ He(e);
410
410
  const i = {};
411
- return _e(e) ? i.backgroundImage = e : i.backgroundColor = e, /* @__PURE__ */ t(
411
+ return Me(e) ? i.backgroundImage = e : i.backgroundColor = e, /* @__PURE__ */ t(
412
412
  O,
413
413
  {
414
414
  sx: {
@@ -424,39 +424,39 @@ function Sr({ color: e, sx: r = {}, ...l }) {
424
424
  },
425
425
  ...i
426
426
  },
427
- ...l
427
+ ...n
428
428
  }
429
429
  );
430
430
  }
431
- const Or = tt(function({ onSave: r }, l) {
432
- const i = Tt({
431
+ const jr = et(function({ onSave: r }, n) {
432
+ const i = At({
433
433
  value: ""
434
- }), { t: u } = A(), m = {};
435
- i.value ? _e(i.value) ? m.backgroundImage = i.value : m.backgroundColor = i.value : m.border = "1px solid #ccc";
436
- const [a, { setFalse: p, setTrue: k }] = Vt(!1), h = N(() => {
434
+ }), { t: d } = N(), m = {};
435
+ i.value ? Me(i.value) ? m.backgroundImage = i.value : m.backgroundColor = i.value : m.border = "1px solid #ccc";
436
+ const [c, { setFalse: p, setTrue: k }] = Tt(!1), y = T(() => {
437
437
  p();
438
- }, [p]), x = () => {
439
- r({ value: i.value }, h);
438
+ }, [p]), g = () => {
439
+ r({ value: i.value }, y);
440
440
  };
441
- return rt(l, () => ({
442
- open({ value: b } = { value: "" }) {
443
- i.value = b, k();
441
+ return tt(n, () => ({
442
+ open({ value: h } = { value: "" }) {
443
+ i.value = h, k();
444
444
  },
445
445
  close() {
446
- h();
446
+ y();
447
447
  }
448
- })), /* @__PURE__ */ S(Pe, { open: a, onClose: h, hideBackdrop: !0, children: [
449
- /* @__PURE__ */ t(qe, { children: u("maker.configBackground") }),
450
- /* @__PURE__ */ t(Qe, { sx: { width: 600 }, children: /* @__PURE__ */ S(O, { width: "100%", display: "flex", children: [
451
- /* @__PURE__ */ t(O, { flex: 1, mr: 1, sx: m, children: !i.value && /* @__PURE__ */ t(te, { children: u("error.notConfig") }) }),
452
- /* @__PURE__ */ t(zt, { children: /* @__PURE__ */ t(
453
- Pr,
448
+ })), /* @__PURE__ */ S(pe, { open: c, onClose: y, hideBackdrop: !0, children: [
449
+ /* @__PURE__ */ t(we, { children: d("maker.configBackground") }),
450
+ /* @__PURE__ */ t(Pe, { sx: { width: 600 }, children: /* @__PURE__ */ S(O, { width: "100%", display: "flex", children: [
451
+ /* @__PURE__ */ t(O, { flex: 1, mr: 1, sx: m, children: !i.value && /* @__PURE__ */ t(ee, { children: d("error.notConfig") }) }),
452
+ /* @__PURE__ */ t(jt, { children: /* @__PURE__ */ t(
453
+ Sr,
454
454
  {
455
455
  width: 200,
456
456
  height: 200,
457
- value: Ir(i.value),
458
- onChange: (b) => {
459
- i.value = b;
457
+ value: Or(i.value),
458
+ onChange: (h) => {
459
+ i.value = h;
460
460
  },
461
461
  hidePresets: !0,
462
462
  hideAdvancedSliders: !0,
@@ -465,13 +465,13 @@ const Or = tt(function({ onSave: r }, l) {
465
465
  }
466
466
  ) })
467
467
  ] }) }),
468
- /* @__PURE__ */ S(Xe, { children: [
469
- /* @__PURE__ */ t(T, { variant: "outlined", size: "small", onClick: h, children: u("common.cancel") }),
470
- /* @__PURE__ */ t(T, { variant: "contained", size: "small", onClick: x, children: u("maker.save") })
468
+ /* @__PURE__ */ S(Ie, { children: [
469
+ /* @__PURE__ */ t(A, { variant: "outlined", size: "small", onClick: y, children: d("common.cancel") }),
470
+ /* @__PURE__ */ t(A, { variant: "contained", size: "small", onClick: g, children: d("maker.save") })
471
471
  ] })
472
472
  ] });
473
473
  });
474
- At(O)`
474
+ Dt(O)`
475
475
  .color-item {
476
476
  position: relative;
477
477
  }
@@ -492,28 +492,28 @@ At(O)`
492
492
  right: 0;
493
493
  }
494
494
  `;
495
- function Cr({
495
+ function zr({
496
496
  value: e,
497
497
  onChange: r,
498
- ...l
498
+ ...n
499
499
  }) {
500
- const i = J(null);
501
- return /* @__PURE__ */ S($, { children: [
500
+ const i = F(null);
501
+ return /* @__PURE__ */ S(J, { children: [
502
502
  /* @__PURE__ */ t(
503
- wr,
503
+ Ir,
504
504
  {
505
- ...l,
505
+ ...n,
506
506
  value: e,
507
507
  onChange: r,
508
508
  InputProps: {
509
509
  endAdornment: /* @__PURE__ */ t(ue, { position: "end", children: /* @__PURE__ */ t(
510
- Sr,
510
+ Cr,
511
511
  {
512
512
  color: e ?? "",
513
513
  style: { width: "1.5rem", height: "1.5rem", padding: 0 },
514
514
  onClick: () => {
515
- var u;
516
- (u = i.current) == null || u.open({ value: e ?? "" });
515
+ var d;
516
+ (d = i.current) == null || d.open({ value: e ?? "" });
517
517
  }
518
518
  }
519
519
  ) })
@@ -521,58 +521,58 @@ function Cr({
521
521
  }
522
522
  ),
523
523
  /* @__PURE__ */ t(
524
- Or,
524
+ jr,
525
525
  {
526
526
  ref: i,
527
- onSave: ({ value: u }, m) => {
528
- r(u), m();
527
+ onSave: ({ value: d }, m) => {
528
+ r(d), m();
529
529
  }
530
530
  }
531
531
  )
532
532
  ] });
533
533
  }
534
- function jr({
534
+ function Rr({
535
535
  label: e,
536
536
  value: r,
537
- onChange: l,
537
+ onChange: n,
538
538
  property: i,
539
- component: u,
539
+ component: d,
540
540
  defaultLocale: m,
541
- allComponents: a,
541
+ allComponents: c,
542
542
  PropertyValueField: p,
543
543
  onUpload: k
544
544
  }) {
545
- const { locale: h } = A(), x = J(null);
546
- if (!lt(i.subProperties)) {
547
- const n = V(Object.values(i.subProperties || {}), "index").filter(
548
- (o) => o.data.visible !== !1 && o.data.key
545
+ const { locale: y } = N(), g = F(null);
546
+ if (!it(i.subProperties)) {
547
+ const o = V(Object.values(i.subProperties || {}), "index").filter(
548
+ (s) => s.data.visible !== !1 && s.data.key
549
549
  );
550
550
  return /* @__PURE__ */ S(j, { width: "100%", children: [
551
- /* @__PURE__ */ t(oe, { sx: { px: 0.25, py: 0.5 }, children: e }),
552
- /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(O, { sx: { position: "relative" }, children: n.map((o, s) => {
553
- const { data: d } = o, f = d.key ?? d.id, w = s === n.length - 1;
554
- let c = null;
551
+ /* @__PURE__ */ t(ne, { sx: { px: 0.25, py: 0.5 }, children: e }),
552
+ /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(O, { sx: { position: "relative" }, children: o.map((s, l) => {
553
+ const { data: u } = s, f = u.key ?? u.id, w = l === o.length - 1;
554
+ let a = null;
555
555
  try {
556
- r && typeof r == "object" ? c = r[f] : typeof r == "string" && (c = (i.type === "yaml" ? ye.parse(r || "") : JSON.parse(r || "{}"))[f]);
556
+ r && typeof r == "object" ? a = r[f] : typeof r == "string" && (a = (i.type === "yaml" ? be.parse(r || "") : JSON.parse(r || "{}"))[f]);
557
557
  } catch {
558
558
  }
559
- c == null && (d.locales && h && d.locales[h] ? c = d.locales[h].defaultValue : d.locales && m && d.locales[m] && (c = d.locales[m].defaultValue));
560
- const v = (P) => {
559
+ a == null && (u.locales && y && u.locales[y] ? a = u.locales[y].defaultValue : u.locales && m && u.locales[m] && (a = u.locales[m].defaultValue));
560
+ const x = (P) => {
561
561
  try {
562
562
  let C = {};
563
563
  if (typeof r == "string")
564
564
  try {
565
- C = i.type === "yaml" ? ye.parse(r || "") : JSON.parse(r || "{}");
565
+ C = i.type === "yaml" ? be.parse(r || "") : JSON.parse(r || "{}");
566
566
  } catch {
567
567
  }
568
568
  else typeof r == "object" && r !== null && (C = { ...r });
569
569
  nt(C, f, P);
570
- const y = ge(C, i.type);
571
- l == null || l(y);
570
+ const v = ve(C, i.type);
571
+ n == null || n(v);
572
572
  } catch (C) {
573
573
  console.error("Error updating property:", C);
574
574
  }
575
- }, g = 8;
575
+ }, b = 8;
576
576
  return /* @__PURE__ */ S(
577
577
  O,
578
578
  {
@@ -597,7 +597,7 @@ function jr({
597
597
  {
598
598
  sx: {
599
599
  position: "absolute",
600
- left: g,
600
+ left: b,
601
601
  top: 0,
602
602
  height: 16,
603
603
  // 连接到字段中点的高度
@@ -612,7 +612,7 @@ function jr({
612
612
  {
613
613
  sx: {
614
614
  position: "absolute",
615
- left: g,
615
+ left: b,
616
616
  top: 16,
617
617
  // 连接到字段中点
618
618
  width: 12,
@@ -627,7 +627,7 @@ function jr({
627
627
  {
628
628
  sx: {
629
629
  position: "absolute",
630
- left: g,
630
+ left: b,
631
631
  top: 16,
632
632
  // 从当前项中点
633
633
  bottom: -8,
@@ -644,19 +644,19 @@ function jr({
644
644
  /* @__PURE__ */ t(O, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ t(
645
645
  p,
646
646
  {
647
- component: u,
648
- property: d,
649
- value: c,
650
- onChange: v,
647
+ component: d,
648
+ property: u,
649
+ value: a,
650
+ onChange: x,
651
651
  size: "small",
652
652
  fullWidth: !0,
653
653
  defaultLocale: m,
654
- allComponents: a
654
+ allComponents: c
655
655
  }
656
656
  ) })
657
657
  ]
658
658
  },
659
- d.id
659
+ u.id
660
660
  );
661
661
  }) }) })
662
662
  ] });
@@ -675,7 +675,7 @@ function jr({
675
675
  },
676
676
  children: [
677
677
  /* @__PURE__ */ t(
678
- oe,
678
+ ne,
679
679
  {
680
680
  sx: {
681
681
  position: "absolute",
@@ -687,17 +687,17 @@ function jr({
687
687
  }
688
688
  ),
689
689
  /* @__PURE__ */ t(
690
- ke,
690
+ xe,
691
691
  {
692
692
  keyId: i.id,
693
- locale: h,
693
+ locale: y,
694
694
  language: i.type === "yaml" ? "yaml" : "json",
695
695
  value: typeof r == "string" ? r : "",
696
- onChange: (n) => {
697
- l == null || l(n);
696
+ onChange: (o) => {
697
+ n == null || n(o);
698
698
  },
699
- onUpload: (n) => {
700
- x.current = n, k && k(n);
699
+ onUpload: (o) => {
700
+ g.current = o, k && k(o);
701
701
  }
702
702
  },
703
703
  i.id
@@ -726,115 +726,115 @@ function jr({
726
726
  }
727
727
  ) });
728
728
  }
729
- const Ke = ["string", "multiline", "json", "yaml", "component", "custom", "url"];
730
- function ft({
729
+ const Je = ["string", "multiline", "json", "yaml", "component", "custom", "url"];
730
+ function pt({
731
731
  disabled: e,
732
732
  list: r,
733
- renderItem: l,
733
+ renderItem: n,
734
734
  ...i
735
735
  }) {
736
- const u = J(null), m = Rt(), a = Et(), p = V(Object.entries(r), (o) => o[1].index).map((o) => o[0]), k = J(p), h = N(
737
- (o) => {
738
- k.current = o, a();
736
+ const d = F(null), m = zt(), c = Vt(), p = V(Object.entries(r), (s) => s[1].index).map((s) => s[0]), k = F(p), y = T(
737
+ (s) => {
738
+ k.current = s, c();
739
739
  },
740
- [a]
741
- ), x = N(
742
- ({ index: o }, { index: s }) => {
743
- const d = [...k.current];
744
- d.splice(s, 0, ...d.splice(o, 1)), h(d);
740
+ [c]
741
+ ), g = T(
742
+ ({ index: s }, { index: l }) => {
743
+ const u = [...k.current];
744
+ u.splice(l, 0, ...u.splice(s, 1)), y(u);
745
745
  },
746
- [h]
746
+ [y]
747
747
  );
748
- M(() => {
749
- h(p);
748
+ H(() => {
749
+ y(p);
750
750
  }, [p.join("-")]);
751
- const [{ isOver: b }, n] = ht({
751
+ const [{ isOver: h }, o] = ut({
752
752
  accept: m,
753
- collect: (o) => ({
754
- isOver: o.isOver()
753
+ collect: (s) => ({
754
+ isOver: s.isOver()
755
755
  }),
756
756
  canDrop: () => !e,
757
757
  drop: () => {
758
- var d;
759
- const o = () => {
758
+ var u;
759
+ const s = () => {
760
760
  k.current.forEach((f, w) => {
761
- const c = r[f];
762
- c && (c.index = w);
761
+ const a = r[f];
762
+ a && (a.index = w);
763
763
  });
764
- }, s = (d = H(r)) == null ? void 0 : d.doc;
765
- s ? s.transact(() => {
766
- o();
767
- }) : o();
764
+ }, l = (u = Y(r)) == null ? void 0 : u.doc;
765
+ l ? l.transact(() => {
766
+ s();
767
+ }) : s();
768
768
  }
769
769
  });
770
- return M(() => {
771
- b || h(p);
772
- }, [b]), n(u), /* @__PURE__ */ t(O, { ...i, ref: u, className: Nt(b && "isDragging"), children: k.current.map((o, s) => /* @__PURE__ */ t(
773
- zr,
770
+ return H(() => {
771
+ h || y(p);
772
+ }, [h]), o(d), /* @__PURE__ */ t(O, { ...i, ref: d, className: Nt(h && "isDragging"), children: k.current.map((s, l) => /* @__PURE__ */ t(
773
+ Dr,
774
774
  {
775
775
  type: m,
776
776
  disabled: e,
777
- id: o,
778
- index: s,
779
- itemIndex: (d) => k.current.indexOf(d),
780
- move: x,
781
- children: (d) => {
782
- const f = r[o];
783
- return f ? l(f.data, s, d) : null;
777
+ id: s,
778
+ index: l,
779
+ itemIndex: (u) => k.current.indexOf(u),
780
+ move: g,
781
+ children: (u) => {
782
+ const f = r[s];
783
+ return f ? n(f.data, l, u) : null;
784
784
  }
785
785
  },
786
- o
786
+ s
787
787
  )) });
788
788
  }
789
- function zr({
789
+ function Dr({
790
790
  disabled: e,
791
791
  id: r,
792
- index: l,
792
+ index: n,
793
793
  type: i,
794
- children: u,
794
+ children: d,
795
795
  itemIndex: m,
796
- move: a
796
+ move: c
797
797
  }) {
798
- const p = J(), [{ isDragging: k }, h, x] = yr({
798
+ const p = F(), [{ isDragging: k }, y, g] = gr({
799
799
  type: i,
800
800
  item: () => ({ id: r }),
801
801
  canDrag: () => !e,
802
- collect: (n) => ({ isDragging: n.isDragging() })
803
- }), [, b] = ht({
802
+ collect: (o) => ({ isDragging: o.isDragging() })
803
+ }), [, h] = ut({
804
804
  accept: i,
805
805
  canDrop: () => !e,
806
- hover(n, o) {
807
- var g;
806
+ hover(o, s) {
807
+ var b;
808
808
  if (!p.current)
809
809
  return;
810
- const s = m(n.id), d = l;
811
- if (s === d)
810
+ const l = m(o.id), u = n;
811
+ if (l === u)
812
812
  return;
813
- const f = (g = p.current) == null ? void 0 : g.getBoundingClientRect(), w = (f.bottom - f.top) / 2, v = o.getClientOffset().y - f.top;
814
- s < d && v < w || s > d && v > w || a({ id: n.id, index: s }, { id: r, index: l });
813
+ const f = (b = p.current) == null ? void 0 : b.getBoundingClientRect(), w = (f.bottom - f.top) / 2, x = s.getClientOffset().y - f.top;
814
+ l < u && x < w || l > u && x > w || c({ id: o.id, index: l }, { id: r, index: n });
815
815
  }
816
816
  });
817
- return typeof u == "function" ? u({
817
+ return typeof d == "function" ? d({
818
818
  isDragging: k,
819
- drag: h,
820
- drop: (n) => (p.current = n, b(n)),
821
- preview: x
822
- }) : (h(b(x(p))), /* @__PURE__ */ t(O, { ref: p, children: u }));
819
+ drag: y,
820
+ drop: (o) => (p.current = o, h(o)),
821
+ preview: g
822
+ }) : (y(h(g(p))), /* @__PURE__ */ t(O, { ref: p, children: d }));
823
823
  }
824
- function Rr({
824
+ function Nr({
825
825
  drop: e,
826
826
  preview: r,
827
- drag: l,
827
+ drag: n,
828
828
  disabled: i,
829
- isDragging: u,
829
+ isDragging: d,
830
830
  children: m,
831
- onDelete: a,
831
+ onDelete: c,
832
832
  onVisibilityChange: p,
833
833
  visible: k = !0,
834
- actions: h,
835
- alwaysShowActions: x = !1
834
+ actions: y,
835
+ alwaysShowActions: g = !1
836
836
  }) {
837
- const { t: b } = A();
837
+ const { t: h } = N();
838
838
  return /* @__PURE__ */ t(
839
839
  O,
840
840
  {
@@ -851,7 +851,7 @@ function Rr({
851
851
  sx: {
852
852
  flex: 1,
853
853
  borderRadius: 0.5,
854
- bgcolor: u ? "action.hover" : "background.paper",
854
+ bgcolor: d ? "action.hover" : "background.paper",
855
855
  opacity: 0.9999
856
856
  // NOTE: make preview effective
857
857
  },
@@ -861,9 +861,9 @@ function Rr({
861
861
  !i && /* @__PURE__ */ t(
862
862
  O,
863
863
  {
864
- className: x ? "" : "hover-visible",
864
+ className: g ? "" : "hover-visible",
865
865
  sx: {
866
- maxWidth: x ? "100%" : 0,
866
+ maxWidth: g ? "100%" : 0,
867
867
  overflow: "hidden",
868
868
  position: "absolute",
869
869
  right: 2,
@@ -875,10 +875,10 @@ function Rr({
875
875
  {
876
876
  direction: "row",
877
877
  sx: {
878
- bgcolor: (n) => St(n.palette.grey[200], 0.9),
878
+ bgcolor: (o) => Pt(o.palette.grey[200], 0.9),
879
879
  borderRadius: 1,
880
880
  p: 0.5,
881
- [`.${Ot.root}`]: {
881
+ [`.${It.root}`]: {
882
882
  minWidth: 24,
883
883
  width: 24,
884
884
  height: 24,
@@ -886,10 +886,10 @@ function Rr({
886
886
  }
887
887
  },
888
888
  children: [
889
- h,
890
- p && /* @__PURE__ */ t(X, { title: b(k ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: () => p(!k), children: k ? /* @__PURE__ */ t(lr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(nr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
891
- a && /* @__PURE__ */ t(X, { title: b("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: a, children: /* @__PURE__ */ t(or, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
892
- /* @__PURE__ */ t(X, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { ref: l, children: /* @__PURE__ */ t(sr, { sx: { color: "grey.500" } }) }) })
889
+ y,
890
+ p && /* @__PURE__ */ t(Z, { title: h(k ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(A, { onClick: () => p(!k), children: k ? /* @__PURE__ */ t(or, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(lr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
891
+ c && /* @__PURE__ */ t(Z, { title: h("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(A, { onClick: c, children: /* @__PURE__ */ t(sr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
892
+ /* @__PURE__ */ t(Z, { title: h("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(A, { ref: n, children: /* @__PURE__ */ t(cr, { sx: { color: "grey.500" } }) }) })
893
893
  ]
894
894
  }
895
895
  )
@@ -899,12 +899,12 @@ function Rr({
899
899
  }
900
900
  );
901
901
  }
902
- function Dr({
902
+ function Ar({
903
903
  label: e,
904
904
  value: r,
905
- onChange: l
905
+ onChange: n
906
906
  }) {
907
- const [i, u] = Z(!1);
907
+ const [i, d] = M(!1);
908
908
  return /* @__PURE__ */ S(j, { gap: 1, children: [
909
909
  /* @__PURE__ */ t(
910
910
  D,
@@ -912,15 +912,15 @@ function Dr({
912
912
  label: e,
913
913
  size: "small",
914
914
  value: r,
915
- onChange: (m) => l == null ? void 0 : l(m.target.value),
915
+ onChange: (m) => n == null ? void 0 : n(m.target.value),
916
916
  InputProps: {
917
917
  endAdornment: /* @__PURE__ */ t(
918
- Ie,
918
+ Se,
919
919
  {
920
920
  onChange: ({ response: m }) => {
921
921
  var p;
922
- const a = (p = m == null ? void 0 : m.data) == null ? void 0 : p.filename;
923
- a && (l == null || l(a));
922
+ const c = (p = m == null ? void 0 : m.data) == null ? void 0 : p.filename;
923
+ c && (n == null || n(c));
924
924
  }
925
925
  }
926
926
  )
@@ -932,28 +932,28 @@ function Dr({
932
932
  {
933
933
  component: "img",
934
934
  sx: { objectFit: "contain", borderRadius: 1, cursor: "pointer" },
935
- src: ne(r),
935
+ src: ie(r),
936
936
  alt: e,
937
937
  maxWidth: 100,
938
938
  maxHeight: 100,
939
939
  width: "100%",
940
- onClick: () => u(!0)
940
+ onClick: () => d(!0)
941
941
  }
942
942
  ),
943
- /* @__PURE__ */ t(Pe, { open: i, onClose: () => u(!1), children: /* @__PURE__ */ t(O, { component: "img", sx: { objectFit: "contain" }, src: ne(r), alt: e }) })
943
+ /* @__PURE__ */ t(pe, { open: i, onClose: () => d(!1), children: /* @__PURE__ */ t(O, { component: "img", sx: { objectFit: "contain" }, src: ie(r), alt: e }) })
944
944
  ] });
945
945
  }
946
- function ve(e, r = "") {
947
- return fr(
946
+ function ye(e, r = "") {
947
+ return br(
948
948
  e,
949
- (l, i, u) => {
950
- const m = r ? `${r}.${u}` : u;
951
- return ur(i) ? ar(l, ve(i, m)) : l[m] = i, l;
949
+ (n, i, d) => {
950
+ const m = r ? `${r}.${d}` : d;
951
+ return pr(i) ? dr(n, ye(i, m)) : n[m] = i, n;
952
952
  },
953
953
  {}
954
954
  );
955
955
  }
956
- const Ar = [
956
+ const Tr = [
957
957
  { value: "string", label: "Text" },
958
958
  { value: "multiline", label: "Text (Multiline)" },
959
959
  { value: "number", label: "Number" },
@@ -967,46 +967,46 @@ const Ar = [
967
967
  { value: "component", label: "Component" },
968
968
  { value: "custom", label: "Custom (Render by a Component)" }
969
969
  ];
970
- function le(e, r, l) {
971
- return !e || !l ? !1 : Object.values(e).some(({ data: i }) => i.id !== r && i.key === l);
970
+ function re(e, r, n) {
971
+ return !e || !n ? !1 : Object.values(e).some(({ data: i }) => i.id !== r && i.key === n);
972
972
  }
973
- function bt(e, r) {
974
- var l;
975
- return !e || !r ? !1 : ((l = e[r]) == null ? void 0 : l.data.visible) ?? !0;
973
+ function mt(e, r) {
974
+ var n;
975
+ return !e || !r ? !1 : ((n = e[r]) == null ? void 0 : n.data.visible) ?? !0;
976
976
  }
977
- function Ti({ componentId: e }) {
977
+ function Vi({ componentId: e }) {
978
978
  const {
979
979
  state: { components: r }
980
- } = de(), l = r[e], i = l == null ? void 0 : l.data;
981
- return i ? /* @__PURE__ */ t(j, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(O, { p: 2, children: /* @__PURE__ */ t(br, { FallbackComponent: gt, resetKeys: [e], children: /* @__PURE__ */ t(Nr, { value: i }) }) }) }) : null;
980
+ } = ae(), n = r[e], i = n == null ? void 0 : n.data;
981
+ return i ? /* @__PURE__ */ t(j, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(O, { p: 2, children: /* @__PURE__ */ t(vr, { FallbackComponent: yt, resetKeys: [e], children: /* @__PURE__ */ t(Vr, { value: i }) }) }) }) : null;
982
982
  }
983
- function Nr({ value: e }) {
984
- var k, h, x;
985
- const { t: r } = A(), {
986
- localState: { currentLocale: l, componentDebugProps: i },
983
+ function Vr({ value: e }) {
984
+ var k, y, g;
985
+ const { t: r } = N(), {
986
+ localState: { currentLocale: n, componentDebugProps: i },
987
987
  state: {
988
- config: { defaultLocale: u }
988
+ config: { defaultLocale: d }
989
989
  },
990
990
  localActions: { setComponentDebugProps: m }
991
- } = de(), a = H(e).doc, p = xe();
991
+ } = ae(), c = Y(e).doc, p = ge();
992
992
  return /* @__PURE__ */ t(j, { height: "100%", children: /* @__PURE__ */ S(j, { gap: 2, children: [
993
- /* @__PURE__ */ t(Tr, { config: e }),
993
+ /* @__PURE__ */ t(Wr, { config: e }),
994
994
  /* @__PURE__ */ t(
995
- Er,
995
+ Ur,
996
996
  {
997
997
  config: e,
998
- currentLocale: l,
999
- defaultLocale: u,
998
+ currentLocale: n,
999
+ defaultLocale: d,
1000
1000
  allComponents: p,
1001
- onUpdateConfig: (b) => {
1002
- a.transact(() => {
1003
- b(e);
1001
+ onUpdateConfig: (h) => {
1002
+ c.transact(() => {
1003
+ h(e);
1004
1004
  });
1005
1005
  }
1006
1006
  }
1007
1007
  ),
1008
1008
  /* @__PURE__ */ S(j, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1009
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: r("renderer") }),
1009
+ /* @__PURE__ */ t($, { variant: "subtitle1", children: r("renderer") }),
1010
1010
  /* @__PURE__ */ S(
1011
1011
  D,
1012
1012
  {
@@ -1015,30 +1015,30 @@ function Nr({ value: e }) {
1015
1015
  select: !0,
1016
1016
  SelectProps: { autoWidth: !0 },
1017
1017
  value: ((k = e.renderer) == null ? void 0 : k.type) || "react-component",
1018
- onChange: (b) => {
1019
- a.transact(() => {
1020
- const n = b.target.value;
1021
- e.renderer ?? (e.renderer = { type: n }), e.renderer.type = n;
1018
+ onChange: (h) => {
1019
+ c.transact(() => {
1020
+ const o = h.target.value;
1021
+ e.renderer ?? (e.renderer = { type: o }), e.renderer.type = o;
1022
1022
  });
1023
1023
  },
1024
1024
  children: [
1025
- /* @__PURE__ */ t(he, { value: "react-component", children: "React Component" }),
1026
- /* @__PURE__ */ t(he, { value: "component", children: "Custom Component" })
1025
+ /* @__PURE__ */ t(me, { value: "react-component", children: "React Component" }),
1026
+ /* @__PURE__ */ t(me, { value: "component", children: "Custom Component" })
1027
1027
  ]
1028
1028
  }
1029
1029
  )
1030
1030
  ] }),
1031
- ((h = e.renderer) == null ? void 0 : h.type) === "component" ? /* @__PURE__ */ t($r, { value: e }) : ((x = e.renderer) == null ? void 0 : x.type) === "react-component" ? /* @__PURE__ */ t(Jr, { value: e }) : null,
1031
+ ((y = e.renderer) == null ? void 0 : y.type) === "component" ? /* @__PURE__ */ t(Hr, { value: e }) : ((g = e.renderer) == null ? void 0 : g.type) === "react-component" ? /* @__PURE__ */ t(Mr, { value: e }) : null,
1032
1032
  /* @__PURE__ */ t(
1033
- Mr,
1033
+ bt,
1034
1034
  {
1035
1035
  config: e,
1036
- currentLocale: l,
1037
- defaultLocale: u,
1036
+ currentLocale: n,
1037
+ defaultLocale: d,
1038
1038
  allComponents: p,
1039
- onChange: ({ key: b, value: n }) => {
1039
+ onChange: ({ key: h, value: o }) => {
1040
1040
  m({
1041
- [b]: n.value
1041
+ [h]: o.value
1042
1042
  });
1043
1043
  },
1044
1044
  props: {
@@ -1048,17 +1048,17 @@ function Nr({ value: e }) {
1048
1048
  )
1049
1049
  ] }) });
1050
1050
  }
1051
- function Tr({ config: e }) {
1052
- const { t: r } = A();
1053
- return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1054
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: r("basicInfo") }),
1051
+ function Wr({ config: e }) {
1052
+ const { t: r } = N();
1053
+ return /* @__PURE__ */ t(Oe, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1054
+ /* @__PURE__ */ t($, { variant: "subtitle1", children: r("basicInfo") }),
1055
1055
  /* @__PURE__ */ t(
1056
1056
  D,
1057
1057
  {
1058
1058
  label: r("name"),
1059
1059
  size: "small",
1060
1060
  value: e.name || "",
1061
- onChange: (l) => e.name = l.target.value
1061
+ onChange: (n) => e.name = n.target.value
1062
1062
  }
1063
1063
  ),
1064
1064
  /* @__PURE__ */ t(
@@ -1071,7 +1071,7 @@ function Tr({ config: e }) {
1071
1071
  maxRows: 10,
1072
1072
  inputProps: { maxLength: 200 },
1073
1073
  value: e.description || "",
1074
- onChange: (l) => e.description = l.target.value
1074
+ onChange: (n) => e.description = n.target.value
1075
1075
  }
1076
1076
  ),
1077
1077
  /* @__PURE__ */ t(
@@ -1082,34 +1082,34 @@ function Tr({ config: e }) {
1082
1082
  multiple: !0,
1083
1083
  freeSolo: !0,
1084
1084
  value: e.tags ?? [],
1085
- onChange: (l, i) => e.tags = i,
1086
- renderInput: (l) => /* @__PURE__ */ t(D, { label: r("tags"), ...l })
1085
+ onChange: (n, i) => e.tags = i,
1086
+ renderInput: (n) => /* @__PURE__ */ t(D, { label: r("tags"), ...n })
1087
1087
  }
1088
1088
  ),
1089
1089
  /* @__PURE__ */ t(
1090
- Dr,
1090
+ Ar,
1091
1091
  {
1092
1092
  label: r("previewImage"),
1093
1093
  value: e.previewImage || "",
1094
- onChange: (l) => e.previewImage = l
1094
+ onChange: (n) => e.previewImage = n
1095
1095
  }
1096
1096
  )
1097
1097
  ] }) });
1098
1098
  }
1099
- function yt({
1099
+ function ht({
1100
1100
  data: e,
1101
1101
  params: r,
1102
- visible: l,
1102
+ visible: n,
1103
1103
  config: i,
1104
- currentLocale: u,
1104
+ currentLocale: d,
1105
1105
  defaultLocale: m,
1106
- allComponents: a,
1106
+ allComponents: c,
1107
1107
  onUpdateConfig: p
1108
1108
  }) {
1109
- var x, b, n, o, s, d;
1110
- const { t: k } = A(), h = ae(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? Br : K, [e.type]);
1109
+ var g, h, o, s, l, u;
1110
+ const { t: k } = N(), y = se(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? Fr : _, [e.type]);
1111
1111
  return /* @__PURE__ */ t(
1112
- Rr,
1112
+ Nr,
1113
1113
  {
1114
1114
  preview: r.preview,
1115
1115
  drop: r.drop,
@@ -1118,18 +1118,18 @@ function yt({
1118
1118
  onDelete: () => {
1119
1119
  p((f) => {
1120
1120
  if (f.properties) {
1121
- const c = Object.entries(f.properties).sort(([, g], [, P]) => g.index - P.index);
1122
- delete f.properties[e.id], c.filter(([g]) => g !== e.id).forEach(([, g], P) => {
1123
- g.index = P;
1121
+ const a = Object.entries(f.properties).sort(([, b], [, P]) => b.index - P.index);
1122
+ delete f.properties[e.id], a.filter(([b]) => b !== e.id).forEach(([, b], P) => {
1123
+ b.index = P;
1124
1124
  });
1125
1125
  }
1126
1126
  });
1127
1127
  },
1128
- visible: l,
1128
+ visible: n,
1129
1129
  onVisibilityChange: (f) => {
1130
1130
  p((w) => {
1131
- const c = w.properties[e.id].data;
1132
- c.visible = f;
1131
+ const a = w.properties[e.id].data;
1132
+ a.visible = f;
1133
1133
  });
1134
1134
  },
1135
1135
  alwaysShowActions: !0,
@@ -1144,24 +1144,24 @@ function yt({
1144
1144
  width: "calc(100% - 80px - 8px)",
1145
1145
  flex: 1,
1146
1146
  "& .MuiOutlinedInput-root": {
1147
- borderColor: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
1147
+ borderColor: e.key ? re(i.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
1148
1148
  },
1149
1149
  "& .MuiFormLabel-root": {
1150
- color: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
1150
+ color: e.key ? re(i.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
1151
1151
  },
1152
1152
  "& .MuiFormLabel-root.Mui-focused": {
1153
- color: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
1153
+ color: e.key ? re(i.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
1154
1154
  }
1155
1155
  },
1156
1156
  value: e.key || "",
1157
1157
  onChange: (f) => {
1158
1158
  p((w) => {
1159
- const c = w.properties[e.id].data;
1160
- c.key = f.target.value.trim();
1159
+ const a = w.properties[e.id].data;
1160
+ a.key = f.target.value.trim();
1161
1161
  });
1162
1162
  },
1163
1163
  InputProps: {
1164
- endAdornment: !e.key || e.key && le(i.properties, e.id, e.key) ? /* @__PURE__ */ t(
1164
+ endAdornment: !e.key || e.key && re(i.properties, e.id, e.key) ? /* @__PURE__ */ t(
1165
1165
  ue,
1166
1166
  {
1167
1167
  position: "end",
@@ -1169,8 +1169,8 @@ function yt({
1169
1169
  width: 16,
1170
1170
  ml: 0
1171
1171
  },
1172
- children: /* @__PURE__ */ t(X, { title: e.key ? k("duplicateKey") : k("requiredKey"), children: /* @__PURE__ */ t(
1173
- dt,
1172
+ children: /* @__PURE__ */ t(Z, { title: e.key ? k("duplicateKey") : k("requiredKey"), children: /* @__PURE__ */ t(
1173
+ ct,
1174
1174
  {
1175
1175
  sx: {
1176
1176
  color: e.key ? "warning.main" : "error.main",
@@ -1190,12 +1190,12 @@ function yt({
1190
1190
  label: k("label"),
1191
1191
  size: "small",
1192
1192
  sx: { flex: 1 },
1193
- value: (((b = (x = e.locales) == null ? void 0 : x[u]) == null ? void 0 : b.name) ?? ((o = (n = e.locales) == null ? void 0 : n[m]) == null ? void 0 : o.name)) || "",
1193
+ value: (((h = (g = e.locales) == null ? void 0 : g[d]) == null ? void 0 : h.name) ?? ((s = (o = e.locales) == null ? void 0 : o[m]) == null ? void 0 : s.name)) || "",
1194
1194
  onChange: (f) => {
1195
1195
  p((w) => {
1196
- var v;
1197
- const c = w.properties[e.id].data;
1198
- c.locales ?? (c.locales = {}), (v = c.locales)[u] ?? (v[u] = {}), c.locales[u].name = f.target.value;
1196
+ var x;
1197
+ const a = w.properties[e.id].data;
1198
+ a.locales ?? (a.locales = {}), (x = a.locales)[d] ?? (x[d] = {}), a.locales[d].name = f.target.value;
1199
1199
  });
1200
1200
  }
1201
1201
  }
@@ -1210,237 +1210,224 @@ function yt({
1210
1210
  value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
1211
1211
  onChange: (f) => {
1212
1212
  p((w) => {
1213
- const c = w.properties[e.id].data;
1214
- if (c.locales)
1215
- for (const g of Object.keys(c.locales))
1216
- c.locales[g].defaultValue = void 0;
1217
- const v = f.target.value;
1218
- v === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = v);
1213
+ const a = w.properties[e.id].data;
1214
+ if (a.locales)
1215
+ for (const b of Object.keys(a.locales))
1216
+ a.locales[b].defaultValue = void 0;
1217
+ const x = f.target.value;
1218
+ x === "multiline" ? (a.type = "string", a.multiline = !0) : (typeof a.multiline < "u" && delete a.multiline, a.type = x);
1219
1219
  });
1220
1220
  },
1221
- children: Ar.map((f) => /* @__PURE__ */ t(he, { value: f.value, children: f.label }, f.value))
1221
+ children: Tr.map((f) => /* @__PURE__ */ t(me, { value: f.value, children: f.label }, f.value))
1222
1222
  }
1223
1223
  )
1224
1224
  ] }),
1225
1225
  /* @__PURE__ */ S(j, { direction: "row", gap: 1, children: [
1226
1226
  /* @__PURE__ */ t(
1227
- h,
1227
+ y,
1228
1228
  {
1229
- allComponents: a,
1229
+ allComponents: c,
1230
1230
  defaultLocale: m,
1231
1231
  component: i,
1232
1232
  property: e,
1233
1233
  label: k("defaultValue"),
1234
1234
  size: "small",
1235
1235
  fullWidth: !0,
1236
- value: (d = (s = e.locales) == null ? void 0 : s[u]) == null ? void 0 : d.defaultValue,
1236
+ value: (u = (l = e.locales) == null ? void 0 : l[d]) == null ? void 0 : u.defaultValue,
1237
1237
  onChange: (f, w) => {
1238
- p((c) => {
1239
- var g;
1240
- const v = c.properties[e.id].data;
1238
+ p((a) => {
1239
+ var b;
1240
+ const x = a.properties[e.id].data;
1241
1241
  if (w != null && w.forceUpdateProperty) {
1242
- const P = ve(v), C = ve(f);
1243
- Object.keys(C).forEach((y) => {
1244
- P[y] || nt(v, y, C[y]);
1242
+ const P = ye(x), C = ye(f);
1243
+ Object.keys(C).forEach((v) => {
1244
+ P[v] || nt(x, v, C[v]);
1245
1245
  });
1246
1246
  } else
1247
- v.locales ?? (v.locales = {}), (g = v.locales)[u] ?? (g[u] = {}), v.locales[u].defaultValue = f;
1247
+ x.locales ?? (x.locales = {}), (b = x.locales)[d] ?? (b[d] = {}), x.locales[d].defaultValue = f;
1248
1248
  });
1249
1249
  }
1250
1250
  }
1251
1251
  ),
1252
- e.type === "custom" ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(Ur, { property: e, allComponents: a }) }) : null
1252
+ e.type === "custom" ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(Br, { property: e, allComponents: c }) }) : null
1253
1253
  ] })
1254
1254
  ] })
1255
1255
  }
1256
1256
  );
1257
1257
  }
1258
- function Vr(e, r) {
1259
- const [l, i] = Z(0);
1260
- return M(() => {
1258
+ function Er(e, r) {
1259
+ const [n, i] = M(0);
1260
+ return H(() => {
1261
1261
  const m = setTimeout(() => {
1262
1262
  if (e.current) {
1263
- let a = e.current.parentElement, p = 0;
1264
- for (; a; )
1265
- a.classList.contains("property-container") && p++, a = a.parentElement;
1263
+ let c = e.current.parentElement, p = 0;
1264
+ for (; c; )
1265
+ c.classList.contains("property-container") && p++, c = c.parentElement;
1266
1266
  i(p);
1267
1267
  }
1268
1268
  }, 100);
1269
1269
  return () => clearTimeout(m);
1270
- }, [e, r]), l;
1270
+ }, [e, r]), n;
1271
1271
  }
1272
- function Er({
1272
+ function Ur({
1273
1273
  config: e,
1274
1274
  currentLocale: r,
1275
- defaultLocale: l,
1275
+ defaultLocale: n,
1276
1276
  allComponents: i,
1277
- onUpdateConfig: u,
1277
+ onUpdateConfig: d,
1278
1278
  useI18nEditor: m = !0
1279
1279
  }) {
1280
- const { t: a } = A(), p = pe({ variant: "dialog" }), k = e.properties && V(Object.values(e.properties), "index");
1281
- return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1280
+ const { t: c } = N(), p = Ce({ variant: "dialog" }), k = e.properties && V(Object.values(e.properties), "index");
1281
+ return /* @__PURE__ */ t(Oe, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1282
1282
  /* @__PURE__ */ S(j, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
1283
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: a("properties") }),
1283
+ /* @__PURE__ */ t($, { variant: "subtitle1", children: c("properties") }),
1284
1284
  /* @__PURE__ */ t(O, { flex: 1 }),
1285
- m && /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(p), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
1285
+ m && /* @__PURE__ */ t(A, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...je(p), children: /* @__PURE__ */ t(lt, { fontSize: "small" }) })
1286
1286
  ] }),
1287
1287
  e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ t(
1288
- ft,
1288
+ pt,
1289
1289
  {
1290
1290
  component: j,
1291
1291
  gap: 2,
1292
1292
  list: e.properties,
1293
- renderItem: (h, x, b) => {
1294
- const n = bt(e.properties, h.id);
1293
+ renderItem: (y, g, h) => {
1294
+ const o = mt(e.properties, y.id);
1295
1295
  return /* @__PURE__ */ t(
1296
- re,
1296
+ de,
1297
1297
  {
1298
1298
  elevation: 0,
1299
1299
  className: "property-container",
1300
1300
  sx: {
1301
1301
  p: 1.25,
1302
1302
  borderRadius: 1,
1303
- border: n ? "1px solid" : "1px dashed",
1303
+ border: o ? "1px solid" : "1px dashed",
1304
1304
  borderColor: "divider"
1305
1305
  },
1306
1306
  children: /* @__PURE__ */ t(j, { gap: 2, children: /* @__PURE__ */ t(
1307
- yt,
1307
+ ht,
1308
1308
  {
1309
- data: h,
1310
- params: b,
1311
- visible: n,
1309
+ data: y,
1310
+ params: h,
1311
+ visible: o,
1312
1312
  config: e,
1313
1313
  currentLocale: r,
1314
- defaultLocale: l,
1314
+ defaultLocale: n,
1315
1315
  allComponents: i,
1316
- onUpdateConfig: u
1316
+ onUpdateConfig: d
1317
1317
  }
1318
1318
  ) })
1319
1319
  },
1320
- h.id
1320
+ y.id
1321
1321
  );
1322
1322
  }
1323
1323
  }
1324
- ) : /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: a("maker.properties.noProperties") }),
1324
+ ) : /* @__PURE__ */ t(ee, { style: { fontSize: 12 }, children: c("maker.properties.noProperties") }),
1325
1325
  /* @__PURE__ */ t(
1326
- T,
1326
+ A,
1327
1327
  {
1328
1328
  fullWidth: !0,
1329
1329
  variant: "outlined",
1330
1330
  className: "ignore-style-override",
1331
1331
  onClick: () => {
1332
- u((h) => {
1333
- var b;
1334
- const x = $e();
1335
- h.properties ?? (h.properties = {}), (b = h.properties)[x] ?? (b[x] = { index: (k == null ? void 0 : k.length) || 0, data: { id: x } });
1332
+ d((y) => {
1333
+ var h;
1334
+ const g = Ye();
1335
+ y.properties ?? (y.properties = {}), (h = y.properties)[g] ?? (h[g] = { index: (k == null ? void 0 : k.length) || 0, data: { id: g } });
1336
1336
  });
1337
1337
  },
1338
- startIcon: /* @__PURE__ */ t(at, {}),
1339
- children: a("addObject", { object: a("property") })
1338
+ startIcon: /* @__PURE__ */ t(st, {}),
1339
+ children: c("addObject", { object: c("property") })
1340
1340
  }
1341
1341
  ),
1342
- m && /* @__PURE__ */ t(vt, { ...pt(p), component: e })
1342
+ m && /* @__PURE__ */ t(ft, { ...dt(p), component: e })
1343
1343
  ] }) });
1344
1344
  }
1345
- function Ur({
1345
+ function Br({
1346
1346
  property: e,
1347
1347
  allComponents: r
1348
1348
  }) {
1349
- const l = pe({ variant: "popper" });
1350
- return /* @__PURE__ */ S($, { children: [
1351
- /* @__PURE__ */ t(T, { sx: { minWidth: 0 }, ...me(l), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
1352
- /* @__PURE__ */ t(et, { ...mt(l), children: /* @__PURE__ */ t(st, { onClickAway: l.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(O, { width: 500, p: 2, children: /* @__PURE__ */ t(
1353
- Oe,
1349
+ const n = Ce({ variant: "popper" });
1350
+ return /* @__PURE__ */ S(J, { children: [
1351
+ /* @__PURE__ */ t(A, { sx: { minWidth: 0 }, ...je(n), children: /* @__PURE__ */ t(at, { fontSize: "small" }) }),
1352
+ /* @__PURE__ */ t(Ot, { ...yr(n), children: /* @__PURE__ */ t(nr, { onClickAway: n.close, children: /* @__PURE__ */ t(de, { children: /* @__PURE__ */ t(O, { width: 500, p: 2, children: /* @__PURE__ */ t(
1353
+ ze,
1354
1354
  {
1355
1355
  value: e.componentId,
1356
- onChange: (i, u) => e.componentId = u,
1356
+ onChange: (i, d) => e.componentId = d,
1357
1357
  allComponents: r
1358
1358
  }
1359
1359
  ) }) }) }) })
1360
1360
  ] });
1361
1361
  }
1362
- function Wr({
1362
+ function Kr({
1363
1363
  value: e,
1364
1364
  valueImmutable: r,
1365
- onChange: l,
1365
+ onChange: n,
1366
1366
  defaultLocale: i,
1367
- allComponents: u
1367
+ allComponents: d
1368
1368
  }) {
1369
- var k;
1370
- const m = pe({ variant: "popper" }), { locale: a } = A(), p = typeof (e == null ? void 0 : e.componentId) == "string" ? (k = u[e.componentId]) == null ? void 0 : k.data : void 0;
1371
- return p ? /* @__PURE__ */ S($, { children: [
1372
- /* @__PURE__ */ t(T, { sx: { minWidth: 0 }, disabled: !p, ...me(m), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
1373
- /* @__PURE__ */ t(
1374
- et,
1375
- {
1376
- ...mt(m),
1377
- sx: {
1378
- zIndex: 1e3
1379
- },
1380
- children: /* @__PURE__ */ t(st, { onClickAway: m.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ S(O, { width: 500, p: 2, children: [
1381
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: "Parameters" }),
1382
- /* @__PURE__ */ t(j, { gap: 1, children: (p == null ? void 0 : p.properties) && V(Object.values(p.properties), "index").map(({ data: h }) => {
1383
- var x, b, n, o, s, d, f, w;
1384
- return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1385
- K,
1386
- {
1387
- allComponents: u,
1388
- defaultLocale: i,
1389
- size: "small",
1390
- fullWidth: !0,
1391
- component: p,
1392
- property: h,
1393
- valueImmutable: ee((b = (x = e.properties) == null ? void 0 : x[h.id]) == null ? void 0 : b.value),
1394
- value: ((o = (n = e.properties) == null ? void 0 : n[h.id]) == null ? void 0 : o.value) ?? ((d = (s = h.locales) == null ? void 0 : s[a]) == null ? void 0 : d.defaultValue) ?? ((w = (f = h.locales) == null ? void 0 : f[i]) == null ? void 0 : w.defaultValue),
1395
- onChange: (c) => {
1396
- if (r) {
1397
- const v = JSON.parse(JSON.stringify(e));
1398
- l == null || l({ ...v, properties: { ...v.properties, [h.id]: { value: c } } });
1399
- } else
1400
- H(p).doc.transact(() => {
1401
- e.properties ?? (e.properties = {}), e.properties[h.id] = { value: c };
1402
- });
1403
- }
1404
- }
1405
- ) }, h.id);
1406
- }) })
1407
- ] }) }) })
1408
- }
1409
- )
1369
+ var g;
1370
+ const [m, c] = M(!1), { t: p, locale: k } = N(), y = typeof (e == null ? void 0 : e.componentId) == "string" ? (g = d[e.componentId]) == null ? void 0 : g.data : void 0;
1371
+ return y ? /* @__PURE__ */ S(J, { children: [
1372
+ /* @__PURE__ */ t(A, { sx: { minWidth: 0 }, disabled: !y, onClick: () => c(!0), children: /* @__PURE__ */ t(at, { fontSize: "small" }) }),
1373
+ /* @__PURE__ */ S(pe, { open: m, onClose: () => c(!1), maxWidth: "md", fullWidth: !0, children: [
1374
+ /* @__PURE__ */ t(we, { children: p("maker.properties.parameters") }),
1375
+ /* @__PURE__ */ t(Pe, { children: /* @__PURE__ */ t(O, { width: "100%", p: 2, children: /* @__PURE__ */ t(
1376
+ bt,
1377
+ {
1378
+ config: y,
1379
+ currentLocale: k,
1380
+ defaultLocale: i,
1381
+ allComponents: d,
1382
+ propertiesValue: e == null ? void 0 : e.properties,
1383
+ onChange: ({ id: h, value: o }) => {
1384
+ const s = er(o.value);
1385
+ if (r) {
1386
+ const l = JSON.parse(JSON.stringify(e));
1387
+ n == null || n({ ...l, properties: { ...l.properties, [h]: { value: s } } });
1388
+ } else
1389
+ Y(y).doc.transact(() => {
1390
+ e.properties ?? (e.properties = {}), e.properties[h] = { value: s };
1391
+ });
1392
+ }
1393
+ }
1394
+ ) }) }),
1395
+ /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(A, { onClick: () => c(!1), children: p("close") }) })
1396
+ ] })
1410
1397
  ] }) : null;
1411
1398
  }
1412
- function vt({
1399
+ function ft({
1413
1400
  type: e = "properties",
1414
1401
  component: r,
1415
- ...l
1402
+ ...n
1416
1403
  }) {
1417
- var b, n, o;
1418
- const { t: i } = A(), {
1404
+ var h, o, s;
1405
+ const { t: i } = N(), {
1419
1406
  state: {
1420
- components: u,
1407
+ components: d,
1421
1408
  supportedLocales: m,
1422
- config: { defaultLocale: a }
1409
+ config: { defaultLocale: c }
1423
1410
  }
1424
- } = de(), p = xe(), k = H(r).doc, h = e === "properties" ? r.properties : e === "parameters" && ((b = r.renderer) == null ? void 0 : b.type) === "component" ? (n = u[r.renderer.componentId]) == null ? void 0 : n.data.properties : void 0, x = ((o = r.renderer) == null ? void 0 : o.type) === "component" ? r : void 0;
1425
- return /* @__PURE__ */ S(Pe, { ...l, fullWidth: !0, maxWidth: "lg", children: [
1426
- /* @__PURE__ */ t(qe, { children: i("i18nEditorTitle") }),
1427
- /* @__PURE__ */ t(Qe, { children: h && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ S(Me, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1428
- /* @__PURE__ */ t(He, { children: /* @__PURE__ */ t(se, { children: m.map(({ locale: s, name: d }) => /* @__PURE__ */ S(ce, { children: [
1429
- d,
1430
- a === s && /* @__PURE__ */ t(cr, { sx: { fontSize: 12, color: "text.secondary" } })
1431
- ] }, s)) }) }),
1432
- /* @__PURE__ */ t(Ye, { children: V(Object.values(h), "index").map(({ data: s }) => /* @__PURE__ */ t(se, { children: m.map(({ locale: d }) => {
1433
- var f, w, c, v, g, P, C, y, I, z, R, E, U, W, ie, Y, G, L, q, Q, Ce, je, ze, Re, De, Ae;
1434
- return /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(j, { gap: 1, children: e === "properties" ? /* @__PURE__ */ S($, { children: [
1411
+ } = ae(), p = ge(), k = Y(r).doc, y = e === "properties" ? r.properties : e === "parameters" && ((h = r.renderer) == null ? void 0 : h.type) === "component" ? (o = d[r.renderer.componentId]) == null ? void 0 : o.data.properties : void 0, g = ((s = r.renderer) == null ? void 0 : s.type) === "component" ? r : void 0;
1412
+ return /* @__PURE__ */ S(pe, { ...n, fullWidth: !0, maxWidth: "lg", children: [
1413
+ /* @__PURE__ */ t(we, { children: i("i18nEditorTitle") }),
1414
+ /* @__PURE__ */ t(Pe, { children: y && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ S(Le, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1415
+ /* @__PURE__ */ t(Ge, { children: /* @__PURE__ */ t(oe, { children: m.map(({ locale: l, name: u }) => /* @__PURE__ */ S(le, { children: [
1416
+ u,
1417
+ c === l && /* @__PURE__ */ t(ar, { sx: { fontSize: 12, color: "text.secondary" } })
1418
+ ] }, l)) }) }),
1419
+ /* @__PURE__ */ t(qe, { children: V(Object.values(y), "index").map(({ data: l }) => /* @__PURE__ */ t(oe, { children: m.map(({ locale: u }) => {
1420
+ var f, w, a, x, b, P, C, v, I, z, R, W, E, U, te, L, G, q, Q, X, Re, De, Ne, Ae, Te, Ve;
1421
+ return /* @__PURE__ */ t(le, { children: /* @__PURE__ */ t(j, { gap: 1, children: e === "properties" ? /* @__PURE__ */ S(J, { children: [
1435
1422
  /* @__PURE__ */ t(
1436
1423
  D,
1437
1424
  {
1438
1425
  size: "small",
1439
1426
  label: "Key",
1440
- value: s.key || "",
1441
- onChange: (_) => {
1427
+ value: l.key || "",
1428
+ onChange: (K) => {
1442
1429
  k.transact(() => {
1443
- s.key = _.target.value.trim();
1430
+ l.key = K.target.value.trim();
1444
1431
  });
1445
1432
  }
1446
1433
  }
@@ -1450,185 +1437,185 @@ function vt({
1450
1437
  {
1451
1438
  size: "small",
1452
1439
  label: i("label"),
1453
- value: (((w = (f = s.locales) == null ? void 0 : f[d]) == null ? void 0 : w.name) ?? ((v = (c = s.locales) == null ? void 0 : c[a]) == null ? void 0 : v.name)) || "",
1454
- onChange: (_) => {
1440
+ value: (((w = (f = l.locales) == null ? void 0 : f[u]) == null ? void 0 : w.name) ?? ((x = (a = l.locales) == null ? void 0 : a[c]) == null ? void 0 : x.name)) || "",
1441
+ onChange: (K) => {
1455
1442
  k.transact(() => {
1456
1443
  var B;
1457
- s.locales ?? (s.locales = {}), (B = s.locales)[d] ?? (B[d] = {}), s.locales[d].name = _.target.value;
1444
+ l.locales ?? (l.locales = {}), (B = l.locales)[u] ?? (B[u] = {}), l.locales[u].name = K.target.value;
1458
1445
  });
1459
1446
  }
1460
1447
  }
1461
1448
  ),
1462
1449
  /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1463
- K,
1450
+ _,
1464
1451
  {
1465
1452
  allComponents: p,
1466
- defaultLocale: a,
1453
+ defaultLocale: c,
1467
1454
  component: r,
1468
- property: s,
1455
+ property: l,
1469
1456
  size: "small",
1470
1457
  fullWidth: !0,
1471
1458
  label: "Default Value",
1472
- valueImmutable: ee((P = (g = s.locales) == null ? void 0 : g[d]) == null ? void 0 : P.defaultValue),
1473
- value: ((y = (C = s.locales) == null ? void 0 : C[d]) == null ? void 0 : y.defaultValue) ?? ((z = (I = s.locales) == null ? void 0 : I[a]) == null ? void 0 : z.defaultValue),
1474
- onChange: (_) => {
1459
+ valueImmutable: ce((P = (b = l.locales) == null ? void 0 : b[u]) == null ? void 0 : P.defaultValue),
1460
+ value: ((v = (C = l.locales) == null ? void 0 : C[u]) == null ? void 0 : v.defaultValue) ?? ((z = (I = l.locales) == null ? void 0 : I[c]) == null ? void 0 : z.defaultValue),
1461
+ onChange: (K) => {
1475
1462
  k.transact(() => {
1476
1463
  var B;
1477
- s.locales ?? (s.locales = {}), (B = s.locales)[d] ?? (B[d] = {}), s.locales[d].defaultValue = _;
1464
+ l.locales ?? (l.locales = {}), (B = l.locales)[u] ?? (B[u] = {}), l.locales[u].defaultValue = K;
1478
1465
  });
1479
1466
  }
1480
1467
  }
1481
1468
  ) })
1482
- ] }) : e === "parameters" && x ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1483
- K,
1469
+ ] }) : e === "parameters" && g ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1470
+ _,
1484
1471
  {
1485
1472
  allComponents: p,
1486
- defaultLocale: a,
1473
+ defaultLocale: c,
1487
1474
  component: r,
1488
- property: s,
1475
+ property: l,
1489
1476
  size: "small",
1490
1477
  fullWidth: !0,
1491
- valueImmutable: ee(
1492
- (W = (U = (E = (R = x.renderer.properties) == null ? void 0 : R[s.id]) == null ? void 0 : E.locales) == null ? void 0 : U[d]) == null ? void 0 : W.value
1478
+ valueImmutable: ce(
1479
+ (U = (E = (W = (R = g.renderer.properties) == null ? void 0 : R[l.id]) == null ? void 0 : W.locales) == null ? void 0 : E[u]) == null ? void 0 : U.value
1493
1480
  ),
1494
- value: ((L = (G = (Y = (ie = x.renderer.properties) == null ? void 0 : ie[s.id]) == null ? void 0 : Y.locales) == null ? void 0 : G[d]) == null ? void 0 : L.value) ?? ((je = (Ce = (Q = (q = x.renderer.properties) == null ? void 0 : q[s.id]) == null ? void 0 : Q.locales) == null ? void 0 : Ce[a]) == null ? void 0 : je.value) ?? ((Re = (ze = s.locales) == null ? void 0 : ze[d]) == null ? void 0 : Re.defaultValue) ?? ((Ae = (De = s.locales) == null ? void 0 : De[a]) == null ? void 0 : Ae.defaultValue),
1495
- onChange: (_) => {
1481
+ value: ((q = (G = (L = (te = g.renderer.properties) == null ? void 0 : te[l.id]) == null ? void 0 : L.locales) == null ? void 0 : G[u]) == null ? void 0 : q.value) ?? ((De = (Re = (X = (Q = g.renderer.properties) == null ? void 0 : Q[l.id]) == null ? void 0 : X.locales) == null ? void 0 : Re[c]) == null ? void 0 : De.value) ?? ((Ae = (Ne = l.locales) == null ? void 0 : Ne[u]) == null ? void 0 : Ae.defaultValue) ?? ((Ve = (Te = l.locales) == null ? void 0 : Te[c]) == null ? void 0 : Ve.defaultValue),
1482
+ onChange: (K) => {
1496
1483
  k.transact(() => {
1497
- var B, Ne, Te, Ve, Ee;
1498
- (B = x.renderer).properties ?? (B.properties = {}), (Ne = x.renderer.properties)[Te = s.id] ?? (Ne[Te] = {}), (Ve = x.renderer.properties[s.id]).locales ?? (Ve.locales = {}), (Ee = x.renderer.properties[s.id].locales)[d] ?? (Ee[d] = {}), x.renderer.properties[s.id].locales[d].value = _;
1484
+ var B, We, Ee, Ue, Be;
1485
+ (B = g.renderer).properties ?? (B.properties = {}), (We = g.renderer.properties)[Ee = l.id] ?? (We[Ee] = {}), (Ue = g.renderer.properties[l.id]).locales ?? (Ue.locales = {}), (Be = g.renderer.properties[l.id].locales)[u] ?? (Be[u] = {}), g.renderer.properties[l.id].locales[u].value = K;
1499
1486
  });
1500
1487
  }
1501
1488
  }
1502
- ) }) : null }, s.id) }, d);
1503
- }) }, s.id)) })
1489
+ ) }) : null }, l.id) }, u);
1490
+ }) }, l.id)) })
1504
1491
  ] }) }) }),
1505
- /* @__PURE__ */ t(Xe, { children: /* @__PURE__ */ t(T, { onClick: (s) => {
1506
- var d;
1507
- return (d = l.onClose) == null ? void 0 : d.call(l, s, "escapeKeyDown");
1492
+ /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ t(A, { onClick: (l) => {
1493
+ var u;
1494
+ return (u = n.onClose) == null ? void 0 : u.call(n, l, "escapeKeyDown");
1508
1495
  }, children: i("close") }) })
1509
1496
  ] });
1510
1497
  }
1511
- const Fe = (e, r) => (l) => {
1498
+ const $e = (e, r) => (n) => {
1512
1499
  const i = [
1513
- l.palette.info.main,
1514
- l.palette.primary.main,
1515
- l.palette.secondary.main,
1516
- l.palette.success.main,
1517
- l.palette.warning.main
1518
- ], u = Math.min(i.length - 1, e), m = i[u], a = Be(m, 0.5), p = Be(m, 1);
1500
+ n.palette.info.main,
1501
+ n.palette.primary.main,
1502
+ n.palette.secondary.main,
1503
+ n.palette.success.main,
1504
+ n.palette.warning.main
1505
+ ], d = Math.min(i.length - 1, e), m = i[d], c = _e(m, 0.5), p = _e(m, 1);
1519
1506
  return {
1520
1507
  // 保留原有的边框样式
1521
- borderColor: `${a} !important`,
1508
+ borderColor: `${c} !important`,
1522
1509
  borderLeft: "3px solid !important",
1523
1510
  // 稍粗的左侧边框
1524
- borderLeftColor: a,
1511
+ borderLeftColor: c,
1525
1512
  // 使用透明度适应深色/浅色模式
1526
1513
  color: p,
1527
1514
  ...r
1528
1515
  };
1529
1516
  };
1530
- function Br({
1517
+ function Fr({
1531
1518
  property: e,
1532
1519
  onChange: r,
1533
- defaultLocale: l,
1520
+ defaultLocale: n,
1534
1521
  allComponents: i
1535
1522
  }) {
1536
- const { t: u, locale: m } = A(), a = J(null), p = Vr(a, e), k = N(() => {
1523
+ const { t: d, locale: m } = N(), c = F(null), p = Er(c, e), k = T(() => {
1537
1524
  if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
1538
1525
  try {
1539
- const h = {};
1526
+ const y = {};
1540
1527
  V(Object.values(e.subProperties), "index").filter(
1541
- (n) => n.data.visible !== !1 && n.data.key
1542
- ).forEach(({ data: n }) => {
1543
- var s, d, f, w;
1544
- if (!n.key) return;
1545
- let o = ((d = (s = n.locales) == null ? void 0 : s[m]) == null ? void 0 : d.defaultValue) ?? ((w = (f = n.locales) == null ? void 0 : f[l]) == null ? void 0 : w.defaultValue);
1546
- if (n.type === "number")
1547
- o = Number(o);
1548
- else if (n.type === "boolean")
1549
- o = o === !0 || o === "true";
1550
- else if ((n.type === "json" || n.type === "yaml") && typeof o == "string")
1528
+ (o) => o.data.visible !== !1 && o.data.key
1529
+ ).forEach(({ data: o }) => {
1530
+ var l, u, f, w;
1531
+ if (!o.key) return;
1532
+ let s = ((u = (l = o.locales) == null ? void 0 : l[m]) == null ? void 0 : u.defaultValue) ?? ((w = (f = o.locales) == null ? void 0 : f[n]) == null ? void 0 : w.defaultValue);
1533
+ if (o.type === "number")
1534
+ s = Number(s);
1535
+ else if (o.type === "boolean")
1536
+ s = s === !0 || s === "true";
1537
+ else if ((o.type === "json" || o.type === "yaml") && typeof s == "string")
1551
1538
  try {
1552
- n.type === "json" ? o = JSON.parse(o) : o = ye.parse(o);
1553
- } catch (c) {
1554
- console.error("Error parsing nested value", o, c), o = {};
1539
+ o.type === "json" ? s = JSON.parse(s) : s = be.parse(s);
1540
+ } catch (a) {
1541
+ console.error("Error parsing nested value", s, a), s = {};
1555
1542
  }
1556
- h[n.key] = o;
1543
+ y[o.key] = s;
1557
1544
  });
1558
- const b = ge(h, e.type);
1559
- r == null || r(b);
1560
- } catch (h) {
1561
- console.error("Error converting structure to text:", h);
1545
+ const h = ve(y, e.type);
1546
+ r == null || r(h);
1547
+ } catch (y) {
1548
+ console.error("Error converting structure to text:", y);
1562
1549
  }
1563
- }, [e, m, l, r]);
1564
- return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: a, children: [
1565
- /* @__PURE__ */ t(Ct, { sx: { mt: -1 }, children: /* @__PURE__ */ t(F, { variant: "caption", color: "text.secondary", children: u("maker.properties.subProperties") }) }),
1550
+ }, [e, m, n, r]);
1551
+ return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: c, children: [
1552
+ /* @__PURE__ */ t(St, { sx: { mt: -1 }, children: /* @__PURE__ */ t($, { variant: "caption", color: "text.secondary", children: d("maker.properties.subProperties") }) }),
1566
1553
  e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ t(
1567
- ft,
1554
+ pt,
1568
1555
  {
1569
1556
  component: j,
1570
1557
  gap: 2,
1571
1558
  list: e.subProperties,
1572
- renderItem: (h, x, b) => {
1573
- const n = h.visible !== !1;
1559
+ renderItem: (y, g, h) => {
1560
+ const o = y.visible !== !1;
1574
1561
  return /* @__PURE__ */ t(
1575
- re,
1562
+ de,
1576
1563
  {
1577
1564
  elevation: 0,
1578
1565
  className: "property-container",
1579
1566
  sx: {
1580
1567
  p: 1.25,
1581
1568
  borderRadius: 1,
1582
- border: n ? "1px solid" : "1px dashed",
1583
- "&": Fe(p)
1569
+ border: o ? "1px solid" : "1px dashed",
1570
+ "&": $e(p)
1584
1571
  },
1585
1572
  children: /* @__PURE__ */ t(j, { gap: 2, children: /* @__PURE__ */ t(
1586
- yt,
1573
+ ht,
1587
1574
  {
1588
- data: h,
1589
- params: b,
1590
- visible: n,
1575
+ data: y,
1576
+ params: h,
1577
+ visible: o,
1591
1578
  config: {
1592
1579
  properties: e.subProperties
1593
1580
  },
1594
1581
  currentLocale: m,
1595
- defaultLocale: l,
1582
+ defaultLocale: n,
1596
1583
  allComponents: i,
1597
- onUpdateConfig: (o) => {
1584
+ onUpdateConfig: (s) => {
1598
1585
  try {
1599
- const s = { properties: e.subProperties || {} };
1600
- o(s);
1601
- const d = {
1586
+ const l = { properties: e.subProperties || {} };
1587
+ s(l);
1588
+ const u = {
1602
1589
  ...e,
1603
- subProperties: s.properties
1590
+ subProperties: l.properties
1604
1591
  };
1605
- r == null || r(d, { forceUpdateProperty: !0 }), k();
1606
- } catch (s) {
1607
- console.error("Error updating property:", s);
1592
+ r == null || r(u, { forceUpdateProperty: !0 }), k();
1593
+ } catch (l) {
1594
+ console.error("Error updating property:", l);
1608
1595
  }
1609
1596
  }
1610
1597
  }
1611
1598
  ) })
1612
1599
  },
1613
- h.id
1600
+ y.id
1614
1601
  );
1615
1602
  }
1616
1603
  }
1617
- ) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: 100 }, children: u("maker.properties.noSubProperties") }),
1604
+ ) : /* @__PURE__ */ t(ee, { style: { fontSize: 12, height: 100 }, children: d("maker.properties.noSubProperties") }),
1618
1605
  /* @__PURE__ */ t(
1619
- T,
1606
+ A,
1620
1607
  {
1621
1608
  fullWidth: !0,
1622
1609
  variant: "outlined",
1623
1610
  className: "ignore-style-override",
1624
1611
  size: "small",
1625
- startIcon: /* @__PURE__ */ t(at, {}),
1612
+ startIcon: /* @__PURE__ */ t(st, {}),
1626
1613
  onClick: () => {
1627
1614
  try {
1628
- const h = e.subProperties || {}, x = $e(), n = {
1629
- index: Object.values(h).length,
1615
+ const y = e.subProperties || {}, g = Ye(), o = {
1616
+ index: Object.values(y).length,
1630
1617
  data: {
1631
- id: x,
1618
+ id: g,
1632
1619
  key: "",
1633
1620
  type: "string",
1634
1621
  visible: !0,
@@ -1641,57 +1628,57 @@ function Br({
1641
1628
  // 为嵌套属性预初始化
1642
1629
  subProperties: {}
1643
1630
  }
1644
- }, o = {
1631
+ }, s = {
1645
1632
  ...e,
1646
1633
  subProperties: {
1647
- ...h,
1648
- [x]: n
1634
+ ...y,
1635
+ [g]: o
1649
1636
  }
1650
1637
  };
1651
- r == null || r(o, { forceUpdateProperty: !0 }), k();
1652
- } catch (h) {
1653
- console.error("Error adding property:", h);
1638
+ r == null || r(s, { forceUpdateProperty: !0 }), k();
1639
+ } catch (y) {
1640
+ console.error("Error adding property:", y);
1654
1641
  }
1655
1642
  },
1656
1643
  sx: {
1657
- "&": Fe(p, {
1644
+ "&": $e(p, {
1658
1645
  // borderLeft: undefined,
1659
1646
  })
1660
1647
  },
1661
- children: u("maker.properties.addSubProperty")
1648
+ children: d("maker.properties.addSubProperty")
1662
1649
  }
1663
1650
  )
1664
1651
  ] });
1665
1652
  }
1666
- function K({
1653
+ function _({
1667
1654
  component: e,
1668
1655
  property: r,
1669
- value: l,
1656
+ value: n,
1670
1657
  onChange: i,
1671
- valueImmutable: u,
1658
+ valueImmutable: d,
1672
1659
  defaultLocale: m,
1673
- allComponents: a,
1660
+ allComponents: c,
1674
1661
  ...p
1675
1662
  }) {
1676
- var o, s, d, f, w;
1677
- const { locale: k } = A(), h = Zt(), x = J(null), b = () => {
1678
- var v;
1679
- const c = (v = h == null ? void 0 : h.current) == null ? void 0 : v.getUploader();
1680
- c == null || c.open(), x.current && c.onceUploadSuccess(({ response: g }) => {
1681
- var C, y;
1682
- let P = ((C = g == null ? void 0 : g.data) == null ? void 0 : C.filename) || "";
1683
- P && (P = `mediakit://${P}`, l && !l.includes("mediakit://") && (P += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (y = x.current) == null || y.call(x, P);
1663
+ var s, l, u, f, w;
1664
+ const { locale: k } = N(), y = Xt(), g = F(null), h = () => {
1665
+ var x;
1666
+ const a = (x = y == null ? void 0 : y.current) == null ? void 0 : x.getUploader();
1667
+ a == null || a.open(), g.current && a.onceUploadSuccess(({ response: b }) => {
1668
+ var C, v;
1669
+ let P = ((C = b == null ? void 0 : b.data) == null ? void 0 : C.filename) || "";
1670
+ P && (P = `mediakit://${P}`, n && !n.includes("mediakit://") && (P += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (v = g.current) == null || v.call(g, P);
1684
1671
  });
1685
- }, n = p.label || ((s = (o = r.locales) == null ? void 0 : o[k]) == null ? void 0 : s.name) || ((f = (d = r.locales) == null ? void 0 : d[m]) == null ? void 0 : f.name) || r.key || r.id;
1672
+ }, o = p.label || ((l = (s = r.locales) == null ? void 0 : s[k]) == null ? void 0 : l.name) || ((f = (u = r.locales) == null ? void 0 : u[m]) == null ? void 0 : f.name) || r.key || r.id;
1686
1673
  if (r.type === "number")
1687
1674
  return /* @__PURE__ */ t(
1688
- Kr,
1675
+ _r,
1689
1676
  {
1690
1677
  ...p,
1691
- label: n,
1678
+ label: o,
1692
1679
  NumberProps: {
1693
- value: ["number", "string"].includes(typeof l) ? l : null,
1694
- onChange: (c, v) => i == null ? void 0 : i(v)
1680
+ value: ["number", "string"].includes(typeof n) ? n : null,
1681
+ onChange: (a, x) => i == null ? void 0 : i(x)
1695
1682
  }
1696
1683
  }
1697
1684
  );
@@ -1700,17 +1687,17 @@ function K({
1700
1687
  D,
1701
1688
  {
1702
1689
  ...p,
1703
- label: n,
1690
+ label: o,
1704
1691
  type: "text",
1705
- value: l ?? "",
1706
- onChange: (c) => {
1707
- const v = c.target.value;
1708
- if (v === "" || v === "-") {
1709
- i == null || i(v);
1692
+ value: n ?? "",
1693
+ onChange: (a) => {
1694
+ const x = a.target.value;
1695
+ if (x === "" || x === "-") {
1696
+ i == null || i(x);
1710
1697
  return;
1711
1698
  }
1712
- if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(v)) {
1713
- let P = v;
1699
+ if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(x)) {
1700
+ let P = x;
1714
1701
  /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(P) && (P = Number(P)), i == null || i(P);
1715
1702
  }
1716
1703
  }
@@ -1718,160 +1705,160 @@ function K({
1718
1705
  );
1719
1706
  if (r.type === "boolean")
1720
1707
  return /* @__PURE__ */ t(
1721
- Ge,
1708
+ Qe,
1722
1709
  {
1723
- label: n,
1710
+ label: o,
1724
1711
  labelPlacement: "start",
1725
- control: /* @__PURE__ */ t(Le, { checked: l === !0, onChange: (c, v) => i == null ? void 0 : i(v) })
1712
+ control: /* @__PURE__ */ t(Xe, { checked: n === !0, onChange: (a, x) => i == null ? void 0 : i(x) })
1726
1713
  }
1727
1714
  );
1728
1715
  if (r.type === "color")
1729
1716
  return /* @__PURE__ */ t(
1730
- Cr,
1717
+ zr,
1731
1718
  {
1732
- label: n,
1733
- value: l,
1734
- onChange: (c) => {
1735
- i == null || i(c);
1719
+ label: o,
1720
+ value: n,
1721
+ onChange: (a) => {
1722
+ i == null || i(a);
1736
1723
  }
1737
1724
  }
1738
1725
  );
1739
1726
  if (r.type === "json" || r.type === "yaml")
1740
1727
  return /* @__PURE__ */ t(
1741
- jr,
1728
+ Rr,
1742
1729
  {
1743
- label: n,
1744
- value: l,
1745
- onChange: (c) => {
1746
- i == null || i(c);
1730
+ label: o,
1731
+ value: n,
1732
+ onChange: (a) => {
1733
+ i == null || i(a);
1747
1734
  },
1748
1735
  property: r,
1749
1736
  component: e,
1750
1737
  defaultLocale: m,
1751
- allComponents: a,
1752
- PropertyValueField: K,
1753
- onUpload: (c) => {
1754
- x.current = c, b();
1738
+ allComponents: c,
1739
+ PropertyValueField: _,
1740
+ onUpload: (a) => {
1741
+ g.current = a, h();
1755
1742
  }
1756
1743
  }
1757
1744
  );
1758
1745
  if (r.type === "custom") {
1759
- const c = (w = a[r.componentId]) == null ? void 0 : w.data;
1760
- return c ? /* @__PURE__ */ t(O, { width: "100%", children: /* @__PURE__ */ t(
1746
+ const a = (w = c[r.componentId]) == null ? void 0 : w.data;
1747
+ return a ? /* @__PURE__ */ t(O, { width: "100%", children: /* @__PURE__ */ t(
1761
1748
  ot,
1762
1749
  {
1763
- componentId: c.id,
1764
- props: { label: n, value: l, onChange: i },
1750
+ componentId: a.id,
1751
+ props: { label: o, value: n, onChange: i },
1765
1752
  locale: k,
1766
1753
  dev: {
1767
1754
  mode: "draft",
1768
- components: a,
1755
+ components: c,
1769
1756
  defaultLocale: m
1770
1757
  }
1771
1758
  }
1772
- ) }) : /* @__PURE__ */ t(D, { ...p, label: n, disabled: !0, placeholder: "Click right button select a component" });
1759
+ ) }) : /* @__PURE__ */ t(D, { ...p, label: o, disabled: !0, placeholder: "Click right button select a component" });
1773
1760
  }
1774
1761
  if (r.type === "component")
1775
1762
  return /* @__PURE__ */ S(j, { width: "100%", direction: "row", gap: 1, children: [
1776
1763
  /* @__PURE__ */ t(O, { flex: 1, children: /* @__PURE__ */ t(
1777
- Oe,
1764
+ ze,
1778
1765
  {
1779
- allComponents: a,
1780
- label: n,
1781
- value: l == null ? void 0 : l.componentId,
1782
- onChange: (c, v) => {
1783
- u || !l ? i == null || i({ ...l && JSON.parse(JSON.stringify(l)), componentId: v }) : typeof l == "object" && (l.componentId = v);
1766
+ allComponents: c,
1767
+ label: o,
1768
+ value: n == null ? void 0 : n.componentId,
1769
+ onChange: (a, x) => {
1770
+ d || !n ? i == null || i({ ...n && JSON.parse(JSON.stringify(n)), componentId: x }) : typeof n == "object" && (n.componentId = x);
1784
1771
  }
1785
1772
  }
1786
1773
  ) }),
1787
1774
  /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1788
- Wr,
1775
+ Kr,
1789
1776
  {
1790
- value: l,
1791
- valueImmutable: u,
1777
+ value: n,
1778
+ valueImmutable: d,
1792
1779
  onChange: i,
1793
1780
  defaultLocale: m,
1794
- allComponents: a
1781
+ allComponents: c
1795
1782
  }
1796
1783
  ) })
1797
1784
  ] });
1798
1785
  if (!r.type || ["string", "url"].includes(r.type)) {
1799
- const c = r.type === "string" ? r.multiline : void 0, v = r.type === "url" ? l == null ? void 0 : l.url : l;
1786
+ const a = r.type === "string" ? r.multiline : void 0, x = r.type === "url" ? n == null ? void 0 : n.url : n;
1800
1787
  return /* @__PURE__ */ t(
1801
1788
  D,
1802
1789
  {
1803
1790
  ...p,
1804
- label: n,
1805
- value: typeof v == "string" ? v : "",
1806
- multiline: c,
1807
- minRows: c ? 2 : void 0,
1808
- maxRows: c ? 10 : void 0,
1809
- onChange: (g) => i == null ? void 0 : i(
1810
- r.type === "url" ? { ...l, url: g.target.value, mediaKitUrl: g.target.value } : g.target.value
1791
+ label: o,
1792
+ value: typeof x == "string" ? x : "",
1793
+ multiline: a,
1794
+ minRows: a ? 2 : void 0,
1795
+ maxRows: a ? 10 : void 0,
1796
+ onChange: (b) => i == null ? void 0 : i(
1797
+ r.type === "url" ? { ...n, url: b.target.value, mediaKitUrl: b.target.value } : b.target.value
1811
1798
  ),
1812
1799
  InputProps: r.type === "url" ? {
1813
1800
  sx: { pr: 0 },
1814
1801
  endAdornment: /* @__PURE__ */ S(ue, { position: "end", children: [
1815
1802
  /* @__PURE__ */ t(
1816
- Ie,
1803
+ Se,
1817
1804
  {
1818
- onChange: async ({ response: g }) => {
1805
+ onChange: async ({ response: b }) => {
1819
1806
  var I, z, R;
1820
- const P = ((I = g == null ? void 0 : g.data) == null ? void 0 : I.url) || ((z = g == null ? void 0 : g.data) == null ? void 0 : z.fileUrl);
1807
+ const P = ((I = b == null ? void 0 : b.data) == null ? void 0 : I.url) || ((z = b == null ? void 0 : b.data) == null ? void 0 : z.fileUrl);
1821
1808
  let C;
1822
- P && (C = await fe(P).catch(() => be(P)).catch(() => {
1809
+ P && (C = await he(P).catch(() => fe(P)).catch(() => {
1823
1810
  }));
1824
- let y = ((R = g == null ? void 0 : g.data) == null ? void 0 : R.filename) || "";
1825
- y && (y = `mediakit://${y}`), i == null || i({
1811
+ let v = ((R = b == null ? void 0 : b.data) == null ? void 0 : R.filename) || "";
1812
+ v && (v = `mediakit://${v}`), i == null || i({
1826
1813
  url: P,
1827
- mediaKitUrl: y,
1814
+ mediaKitUrl: v,
1828
1815
  width: C == null ? void 0 : C.naturalWidth,
1829
1816
  height: C == null ? void 0 : C.naturalHeight
1830
1817
  });
1831
1818
  }
1832
1819
  }
1833
1820
  ),
1834
- /* @__PURE__ */ t(X, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ t(dt, { sx: { cursor: "default" }, fontSize: "small" }) })
1821
+ /* @__PURE__ */ t(Z, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ t(ct, { sx: { cursor: "default" }, fontSize: "small" }) })
1835
1822
  ] })
1836
1823
  } : void 0
1837
1824
  }
1838
1825
  );
1839
1826
  }
1840
1827
  return r.type === "array" ? /* @__PURE__ */ t(
1841
- kr,
1828
+ Pr,
1842
1829
  {
1843
- label: n,
1844
- value: Array.isArray(l) ? l : [],
1845
- onChange: (c) => i == null ? void 0 : i(c),
1830
+ label: o,
1831
+ value: Array.isArray(n) ? n : [],
1832
+ onChange: (a) => i == null ? void 0 : i(a),
1846
1833
  property: r,
1847
- renderItem: ({ item: c, index: v, onChange: g }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((P) => P.data.visible !== !1).map(({ data: P }) => P.key ? /* @__PURE__ */ t(
1848
- K,
1834
+ renderItem: ({ item: a, index: x, onChange: b }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((P) => P.data.visible !== !1).map(({ data: P }) => P.key ? /* @__PURE__ */ t(
1835
+ _,
1849
1836
  {
1850
1837
  component: e,
1851
1838
  property: P,
1852
- value: c[P.key],
1839
+ value: a[P.key],
1853
1840
  onChange: (C) => {
1854
- const y = { ...c, [P.key]: C };
1855
- g(y);
1841
+ const v = { ...a, [P.key]: C };
1842
+ b(v);
1856
1843
  },
1857
1844
  size: "small",
1858
1845
  fullWidth: !0,
1859
1846
  defaultLocale: m,
1860
- allComponents: a
1847
+ allComponents: c
1861
1848
  },
1862
1849
  P.id
1863
- ) : null) }, v) : /* @__PURE__ */ t(D, { size: p.size, fullWidth: !0, value: c, onChange: (P) => g(P.target.value) })
1850
+ ) : null) }, x) : /* @__PURE__ */ t(D, { size: p.size, fullWidth: !0, value: a, onChange: (P) => b(P.target.value) })
1864
1851
  }
1865
1852
  ) : (console.error("Unsupported property type", r.type), null);
1866
1853
  }
1867
- function Kr({
1854
+ function _r({
1868
1855
  NumberProps: e,
1869
1856
  ...r
1870
1857
  }) {
1871
- const { getInputProps: l } = ir(e), i = l();
1858
+ const { getInputProps: n } = ir(e), i = n();
1872
1859
  return /* @__PURE__ */ t(D, { ...r, inputProps: i });
1873
1860
  }
1874
- const Fr = `import React from '@blocklet/pages-kit/builtin/react'
1861
+ const Jr = `import React from '@blocklet/pages-kit/builtin/react'
1875
1862
  import { Box } from '@blocklet/pages-kit/builtin/mui/material'
1876
1863
 
1877
1864
  export default function () {
@@ -1880,182 +1867,183 @@ export default function () {
1880
1867
  Hello World
1881
1868
  </Box>
1882
1869
  )
1883
- }`, _r = `console.log('hello')
1870
+ }`, $r = `console.log('hello')
1884
1871
  `;
1885
- function Jr({
1872
+ function Mr({
1886
1873
  value: e
1887
1874
  }) {
1888
- const { locale: r } = A(), l = it(), i = H(e).doc;
1889
- return M(() => {
1890
- var u;
1891
- (u = e.renderer) != null && u.script || (i.transact(() => {
1892
- e.renderer.script = e.renderer.type === "react-component" ? Fr : _r;
1893
- }), l());
1875
+ const { locale: r } = N(), n = rt(), i = Y(e).doc;
1876
+ return H(() => {
1877
+ var d;
1878
+ (d = e.renderer) != null && d.script || (i.transact(() => {
1879
+ e.renderer.script = e.renderer.type === "react-component" ? Jr : $r;
1880
+ }), n());
1894
1881
  }, [e]), /* @__PURE__ */ t(O, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ t(
1895
- ke,
1882
+ xe,
1896
1883
  {
1897
1884
  keyId: e.id,
1898
1885
  locale: r,
1899
1886
  language: "typescript",
1900
1887
  value: e.renderer.script || "",
1901
- onChange: (u) => e.renderer.script = u,
1888
+ onChange: (d) => e.renderer.script = d,
1902
1889
  typeScriptNoValidation: !1
1903
1890
  },
1904
1891
  e.id
1905
1892
  ) });
1906
1893
  }
1907
- function $r({ value: e }) {
1908
- var x, b, n;
1909
- const { t: r } = A(), l = H(e).doc, {
1894
+ function Hr({ value: e }) {
1895
+ var g, h, o;
1896
+ const { t: r } = N(), n = Y(e).doc, {
1910
1897
  state: {
1911
1898
  components: i,
1912
- config: { defaultLocale: u },
1899
+ config: { defaultLocale: d },
1913
1900
  resources: m
1914
1901
  },
1915
- localState: { currentLocale: a }
1916
- } = de(), p = xe(), k = ((x = i[e.renderer.componentId]) == null ? void 0 : x.data) ?? ((n = (b = m.components) == null ? void 0 : b[e.renderer.componentId]) == null ? void 0 : n.component), h = pe({ variant: "dialog" });
1902
+ localState: { currentLocale: c }
1903
+ } = ae(), p = ge(), k = ((g = i[e.renderer.componentId]) == null ? void 0 : g.data) ?? ((o = (h = m.components) == null ? void 0 : h[e.renderer.componentId]) == null ? void 0 : o.component), y = Ce({ variant: "dialog" });
1917
1904
  return /* @__PURE__ */ S(j, { gap: 1, children: [
1918
1905
  /* @__PURE__ */ t(
1919
- Oe,
1906
+ ze,
1920
1907
  {
1921
1908
  allComponents: p,
1922
1909
  excludes: [e.id],
1923
1910
  value: e.renderer.componentId,
1924
- onChange: (o, s) => e.renderer.componentId = s
1911
+ onChange: (s, l) => e.renderer.componentId = l
1925
1912
  }
1926
1913
  ),
1927
- k && /* @__PURE__ */ S($, { children: [
1914
+ k && /* @__PURE__ */ S(J, { children: [
1928
1915
  /* @__PURE__ */ S(j, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1929
- /* @__PURE__ */ t(F, { variant: "subtitle2", children: r("parameters") }),
1930
- /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(h), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
1916
+ /* @__PURE__ */ t($, { variant: "subtitle2", children: r("parameters") }),
1917
+ /* @__PURE__ */ t(A, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...je(y), children: /* @__PURE__ */ t(lt, { fontSize: "small" }) })
1931
1918
  ] }),
1932
- k.properties && V(Object.values(k.properties), "index").map(({ data: o }) => {
1933
- var s, d, f, w, c, v, g, P, C, y, I, z, R, E, U, W;
1919
+ k.properties && V(Object.values(k.properties), "index").map(({ data: s }) => {
1920
+ var l, u, f, w, a, x, b, P, C, v, I, z, R, W, E, U;
1934
1921
  return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1935
- K,
1922
+ _,
1936
1923
  {
1937
1924
  allComponents: p,
1938
- defaultLocale: u,
1925
+ defaultLocale: d,
1939
1926
  component: k,
1940
- property: o,
1927
+ property: s,
1941
1928
  fullWidth: !0,
1942
1929
  size: "small",
1943
- valueImmutable: ee((w = (f = (d = (s = e.renderer.properties) == null ? void 0 : s[o.id]) == null ? void 0 : d.locales) == null ? void 0 : f[a]) == null ? void 0 : w.value),
1944
- value: ((P = (g = (v = (c = e.renderer.properties) == null ? void 0 : c[o.id]) == null ? void 0 : v.locales) == null ? void 0 : g[a]) == null ? void 0 : P.value) ?? ((z = (I = (y = (C = e.renderer.properties) == null ? void 0 : C[o.id]) == null ? void 0 : y.locales) == null ? void 0 : I[u]) == null ? void 0 : z.value) ?? ((E = (R = o.locales) == null ? void 0 : R[a]) == null ? void 0 : E.defaultValue) ?? ((W = (U = o.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
1945
- onChange: (ie) => {
1946
- l.transact(() => {
1947
- var Y, G, L, q, Q;
1948
- (Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[L = o.id] ?? (G[L] = {}), (q = e.renderer.properties[o.id]).locales ?? (q.locales = {}), (Q = e.renderer.properties[o.id].locales)[a] ?? (Q[a] = {}), e.renderer.properties[o.id].locales[a].value = ie;
1930
+ valueImmutable: ce((w = (f = (u = (l = e.renderer.properties) == null ? void 0 : l[s.id]) == null ? void 0 : u.locales) == null ? void 0 : f[c]) == null ? void 0 : w.value),
1931
+ value: ((P = (b = (x = (a = e.renderer.properties) == null ? void 0 : a[s.id]) == null ? void 0 : x.locales) == null ? void 0 : b[c]) == null ? void 0 : P.value) ?? ((z = (I = (v = (C = e.renderer.properties) == null ? void 0 : C[s.id]) == null ? void 0 : v.locales) == null ? void 0 : I[d]) == null ? void 0 : z.value) ?? ((W = (R = s.locales) == null ? void 0 : R[c]) == null ? void 0 : W.defaultValue) ?? ((U = (E = s.locales) == null ? void 0 : E[d]) == null ? void 0 : U.defaultValue),
1932
+ onChange: (te) => {
1933
+ n.transact(() => {
1934
+ var L, G, q, Q, X;
1935
+ (L = e.renderer).properties ?? (L.properties = {}), (G = e.renderer.properties)[q = s.id] ?? (G[q] = {}), (Q = e.renderer.properties[s.id]).locales ?? (Q.locales = {}), (X = e.renderer.properties[s.id].locales)[c] ?? (X[c] = {}), e.renderer.properties[s.id].locales[c].value = te;
1949
1936
  });
1950
1937
  }
1951
1938
  }
1952
- ) }, o.id);
1939
+ ) }, s.id);
1953
1940
  }),
1954
- /* @__PURE__ */ t(vt, { ...pt(h), component: e, type: "parameters" })
1941
+ /* @__PURE__ */ t(ft, { ...dt(y), component: e, type: "parameters" })
1955
1942
  ] })
1956
1943
  ] });
1957
1944
  }
1958
- function Oe({
1945
+ function ze({
1959
1946
  label: e,
1960
1947
  options: r,
1961
- excludes: l,
1948
+ excludes: n,
1962
1949
  value: i,
1963
- onChange: u,
1950
+ onChange: d,
1964
1951
  allComponents: m,
1965
- ...a
1952
+ ...c
1966
1953
  }) {
1967
- var x;
1968
- const { t: p } = A(), k = r ?? V(Object.values(mr(m, ...l ?? [])), "index").map((b) => b.data), h = (typeof i == "string" ? (x = m[i]) == null ? void 0 : x.data : void 0) ?? null;
1954
+ var g;
1955
+ const { t: p } = N(), k = r ?? V(Object.values(hr(m, ...n ?? [])), "index").map((h) => h.data), y = (typeof i == "string" ? (g = m[i]) == null ? void 0 : g.data : void 0) ?? null;
1969
1956
  return /* @__PURE__ */ t(
1970
1957
  Ze,
1971
1958
  {
1972
- ...a,
1959
+ ...c,
1973
1960
  size: "small",
1974
1961
  options: k,
1975
1962
  autoHighlight: !0,
1976
- isOptionEqualToValue: (b, n) => b.id === n.id,
1977
- getOptionKey: (b) => b.id,
1978
- getOptionLabel: (b) => b.name || b.id,
1979
- renderInput: (b) => /* @__PURE__ */ t(D, { label: e || p("component"), ...b }),
1980
- value: h,
1981
- onChange: (b, n) => {
1982
- var s, d, f, w, c, v;
1983
- let o = {};
1984
- n && (o = {
1985
- blockletId: (s = m[n == null ? void 0 : n.id]) == null ? void 0 : s.blockletId,
1986
- blockletTitle: (d = m[n == null ? void 0 : n.id]) == null ? void 0 : d.blockletTitle,
1987
- componentName: ((w = (f = m[n == null ? void 0 : n.id]) == null ? void 0 : f.data) == null ? void 0 : w.name) || ((v = (c = m[n == null ? void 0 : n.id]) == null ? void 0 : c.data) == null ? void 0 : v.id)
1988
- }), u == null || u(b, n == null ? void 0 : n.id, o);
1963
+ isOptionEqualToValue: (h, o) => h.id === o.id,
1964
+ getOptionKey: (h) => h.id,
1965
+ getOptionLabel: (h) => h.name || h.id,
1966
+ renderInput: (h) => /* @__PURE__ */ t(D, { label: e || p("component"), ...h }),
1967
+ value: y,
1968
+ onChange: (h, o) => {
1969
+ var l, u, f, w, a, x;
1970
+ let s = {};
1971
+ o && (s = {
1972
+ blockletId: (l = m[o == null ? void 0 : o.id]) == null ? void 0 : l.blockletId,
1973
+ blockletTitle: (u = m[o == null ? void 0 : o.id]) == null ? void 0 : u.blockletTitle,
1974
+ componentName: ((w = (f = m[o == null ? void 0 : o.id]) == null ? void 0 : f.data) == null ? void 0 : w.name) || ((x = (a = m[o == null ? void 0 : o.id]) == null ? void 0 : a.data) == null ? void 0 : x.id)
1975
+ }), d == null || d(h, o == null ? void 0 : o.id, s);
1989
1976
  }
1990
1977
  }
1991
1978
  );
1992
1979
  }
1993
- function Mr({
1980
+ function bt({
1994
1981
  config: e,
1995
1982
  allComponents: r,
1996
- defaultLocale: l,
1983
+ defaultLocale: n,
1997
1984
  propertiesValue: i,
1998
- currentLocale: u,
1985
+ currentLocale: d,
1999
1986
  onChange: m,
2000
- props: a
1987
+ props: c
2001
1988
  }) {
2002
- const { t: p } = A(), [k, h] = Z(e == null ? void 0 : e.properties), [x, b] = Z(null);
2003
- M(() => {
1989
+ const { t: p } = N(), [k, y] = M(e == null ? void 0 : e.properties), [g, h] = M(null);
1990
+ H(() => {
2004
1991
  (() => {
2005
- var w, c;
2006
- ((w = e == null ? void 0 : e.renderer) == null ? void 0 : w.type) === "react-component" && lt(e == null ? void 0 : e.properties) ? tr((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((v) => {
2007
- const g = rr(v);
2008
- h(g);
2009
- }) : h(e == null ? void 0 : e.properties);
1992
+ var w, a;
1993
+ ((w = e == null ? void 0 : e.renderer) == null ? void 0 : w.type) === "react-component" && it(e == null ? void 0 : e.properties) ? tr((a = e == null ? void 0 : e.renderer) == null ? void 0 : a.script).then((x) => {
1994
+ const b = rr(x);
1995
+ y(b);
1996
+ }) : y(e == null ? void 0 : e.properties);
2010
1997
  })();
2011
1998
  }, [JSON.stringify(e)]);
2012
- const n = N(() => !e || !k ? {} : Object.values(k).reduce(
1999
+ const o = T(() => !e || !k ? {} : Object.values(k).reduce(
2013
2000
  (f, { data: w }) => {
2014
- var v, g, P, C, y;
2015
- const c = w.key || w.id;
2001
+ var x, b, P, C, v;
2002
+ const a = w.key || w.id;
2016
2003
  return f[w.id] = {
2017
- key: c,
2018
- value: (a == null ? void 0 : a[c]) ?? ((v = i == null ? void 0 : i[w.id]) == null ? void 0 : v.value) ?? ((P = (g = w.locales) == null ? void 0 : g[u]) == null ? void 0 : P.defaultValue) ?? ((y = (C = w.locales) == null ? void 0 : C[l]) == null ? void 0 : y.defaultValue),
2004
+ key: a,
2005
+ value: (c == null ? void 0 : c[a]) ?? ((x = i == null ? void 0 : i[w.id]) == null ? void 0 : x.value) ?? ((P = (b = w.locales) == null ? void 0 : b[d]) == null ? void 0 : P.defaultValue) ?? ((v = (C = w.locales) == null ? void 0 : C[n]) == null ? void 0 : v.defaultValue),
2019
2006
  id: w.id,
2020
2007
  type: w.type
2021
2008
  }, f;
2022
2009
  },
2023
2010
  {}
2024
- ), [JSON.stringify(k), e, i, u, l]), o = ae(() => {
2011
+ ), [JSON.stringify(k), e, i, d, n]), s = se(() => {
2025
2012
  if (!k)
2026
2013
  return {
2027
2014
  canUseProperties: [],
2028
2015
  visibleProperties: [],
2029
2016
  canUsePropertiesKeys: []
2030
2017
  };
2031
- const f = V(Object.values(k), "index"), w = f.filter(({ data: g }) => g.key && bt(k, g.id)), c = f.filter(({ data: g }) => g.key), v = c.map(({ data: g }) => g.key);
2018
+ const f = V(Object.values(k), "index"), w = f.filter(({ data: b }) => b.key && mt(k, b.id)), a = f.filter(({ data: b }) => b.key && b.type !== "component"), x = a.map(({ data: b }) => b.key);
2032
2019
  return {
2033
- canUseProperties: c,
2020
+ canUseProperties: a,
2034
2021
  visibleProperties: w,
2035
- canUsePropertiesKeys: v
2022
+ canUsePropertiesKeys: x
2036
2023
  };
2037
- }, [JSON.stringify(k)]), s = n(), d = pr(s, "key");
2038
- return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
2039
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: p("maker.properties.parameters") }),
2040
- !e || o.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: p("maker.properties.noParameters") }) : /* @__PURE__ */ S($, { children: [
2041
- /* @__PURE__ */ t(j, { gap: 2, children: o.visibleProperties.map(({ data: f }) => {
2042
- var w, c;
2024
+ }, [JSON.stringify(k)]), l = o(), u = mr(l, "key");
2025
+ return /* @__PURE__ */ t(Oe, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
2026
+ /* @__PURE__ */ t($, { variant: "subtitle1", children: p("maker.properties.parameters") }),
2027
+ !e || s.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(ee, { style: { fontSize: 12 }, children: p("maker.properties.noParameters") }) : /* @__PURE__ */ S(J, { children: [
2028
+ /* @__PURE__ */ t(j, { gap: 2, children: s.visibleProperties.map(({ data: f }) => {
2029
+ var w, a;
2043
2030
  return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
2044
- K,
2031
+ _,
2045
2032
  {
2046
2033
  allComponents: r,
2047
- defaultLocale: l,
2034
+ defaultLocale: n,
2048
2035
  size: "small",
2049
2036
  fullWidth: !0,
2050
2037
  component: e,
2051
2038
  property: f,
2052
- valueImmutable: ee((w = i == null ? void 0 : i[f.id]) == null ? void 0 : w.value),
2053
- value: (a == null ? void 0 : a[f.key || f.id]) ?? ((c = s[f.id]) == null ? void 0 : c.value),
2054
- onChange: (v) => {
2039
+ valueImmutable: ce((w = i == null ? void 0 : i[f.id]) == null ? void 0 : w.value),
2040
+ value: (c == null ? void 0 : c[f.key || f.id]) ?? ((a = l[f.id]) == null ? void 0 : a.value),
2041
+ onChange: (x) => {
2055
2042
  m({
2056
2043
  path: ["properties", f.id],
2057
- value: { value: v },
2058
- shouldSync: !(!f.type || Ke.includes(f.type)),
2044
+ id: f.id,
2045
+ value: { value: x },
2046
+ shouldSync: !(!f.type || Je.includes(f.type)),
2059
2047
  excludeKeys: [],
2060
2048
  key: f.key || f.id
2061
2049
  });
@@ -2068,39 +2056,43 @@ function Mr({
2068
2056
  {
2069
2057
  componentId: (e == null ? void 0 : e.id) || "",
2070
2058
  renderType: "setting",
2071
- locale: u,
2072
- properties: s,
2073
- dev: { mode: "draft", components: r, defaultLocale: l },
2059
+ locale: d,
2060
+ properties: l,
2061
+ dev: { mode: "draft", components: r, defaultLocale: n },
2074
2062
  props: {
2075
- ...hr(a ?? {}, o.canUsePropertiesKeys),
2063
+ ...fr(c ?? {}, s.canUsePropertiesKeys),
2076
2064
  onChange: (f) => {
2077
- const { canUsePropertiesKeys: w } = o;
2078
- Object.keys(f).filter((v) => {
2079
- var g;
2080
- return f[v] !== ((g = d == null ? void 0 : d[v]) == null ? void 0 : g.value);
2081
- }).filter((v) => !(v === "locale" && !dr(d[v], "locale"))).reduce((v, g) => v.then(() => {
2082
- const P = d[g], C = w.includes(g);
2065
+ const { canUsePropertiesKeys: w } = s;
2066
+ Object.keys(f).filter((x) => {
2067
+ var b;
2068
+ return f[x] !== ((b = u == null ? void 0 : u[x]) == null ? void 0 : b.value);
2069
+ }).filter((x) => {
2070
+ var b;
2071
+ return !(x === "locale" && !ur(u[x], "locale") || ((b = u[x]) == null ? void 0 : b.type) === "component");
2072
+ }).reduce((x, b) => x.then(() => {
2073
+ const P = u[b], C = w.includes(b);
2083
2074
  if (P != null && P.id && C)
2084
2075
  return m({
2085
2076
  path: ["properties", P.id],
2086
- value: { value: f[g] },
2087
- shouldSync: !(!P.type || Ke.includes(P.type)),
2077
+ id: P.id,
2078
+ value: { value: f[b] },
2079
+ shouldSync: !(!P.type || Je.includes(P.type)),
2088
2080
  excludeKeys: [],
2089
2081
  key: P.key || P.id
2090
2082
  }), Promise.resolve();
2091
- const y = `propertyNotFound${g}`;
2092
- if (x === y)
2083
+ const v = `propertyNotFound${b}`;
2084
+ if (g === v)
2093
2085
  return Promise.resolve();
2094
- We.close(x);
2095
- const I = We.warning(
2086
+ Fe.close(g);
2087
+ const I = Fe.warning(
2096
2088
  p("maker.properties.propertyNotFound", {
2097
- key: g
2089
+ key: b
2098
2090
  }),
2099
2091
  {
2100
- key: y
2092
+ key: v
2101
2093
  }
2102
2094
  );
2103
- return b(I), Promise.resolve();
2095
+ return h(I), Promise.resolve();
2104
2096
  }), Promise.resolve());
2105
2097
  }
2106
2098
  }
@@ -2110,12 +2102,12 @@ function Mr({
2110
2102
  ] }) });
2111
2103
  }
2112
2104
  export {
2113
- Tr as BasicInfo,
2114
- Oe as CustomComponentAutocomplete,
2115
- Ti as CustomComponentSettings,
2116
- Fr as DefaultReactComponentScriptTemplate,
2117
- _r as DefaultWebComponentScriptTemplate,
2118
- Mr as ParametersConfig,
2119
- Er as PropertiesConfig,
2120
- K as PropertyValueField
2105
+ Wr as BasicInfo,
2106
+ ze as CustomComponentAutocomplete,
2107
+ Vi as CustomComponentSettings,
2108
+ Jr as DefaultReactComponentScriptTemplate,
2109
+ $r as DefaultWebComponentScriptTemplate,
2110
+ bt as ParametersConfig,
2111
+ Ur as PropertiesConfig,
2112
+ _ as PropertyValueField
2121
2113
  };