@web-mods/articles 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,109 +1,109 @@
1
- import { jsx as a, jsxs as l, Fragment as pe } from "react/jsx-runtime";
2
- import ie, { createContext as Le, useContext as _e, useState as A, useEffect as K, forwardRef as Je, createElement as Se, useRef as Y, memo as Te, useCallback as je } from "react";
3
- import { defaultArticleService as ht } from "./server.js";
4
- import { createArticleService as Cn, renderArticleByPathname as Sn } from "./server.js";
5
- import { useNavigate as ft, useParams as mt, useLocation as pt } from "react-router";
6
- import { createPortal as gt } from "react-dom";
7
- const Ae = Le({
1
+ import { jsx as t, jsxs as s, Fragment as be } from "react/jsx-runtime";
2
+ import ge, { createContext as Ue, useContext as Ke, useState as S, useEffect as te, forwardRef as yt, createElement as Ve, useRef as Y, useId as we, useLayoutEffect as bt, useCallback as Me, memo as Ze } from "react";
3
+ import { defaultArticleService as Ft } from "./server.js";
4
+ import { ArticleServiceError as Oa, createArticleService as Ea, renderArticleByPathname as Pa } from "./server.js";
5
+ import { useNavigate as Ut, useParams as Kt, useLocation as Zt, useMatch as it } from "react-router";
6
+ import { createPortal as vt } from "react-dom";
7
+ const Je = Ue({
8
8
  navigate: () => {
9
9
  },
10
10
  params: {},
11
11
  locationState: null
12
12
  });
13
- function Ee() {
14
- return _e(Ae);
15
- }
16
- let ne = [];
17
- const Oe = /* @__PURE__ */ new Set();
18
- function He() {
19
- Oe.forEach((e) => e([...ne]));
20
- }
21
- function xe(e, t) {
22
- const r = Math.random().toString(36).slice(2);
23
- ne = [...ne, { id: r, type: e, content: t }], He(), setTimeout(() => {
24
- ne = ne.filter((n) => n.id !== r), He();
13
+ function Xe() {
14
+ return Ke(Je);
15
+ }
16
+ let me = [];
17
+ const Ye = /* @__PURE__ */ new Set();
18
+ function st() {
19
+ Ye.forEach((e) => e([...me]));
20
+ }
21
+ function _e(e, r) {
22
+ const n = Math.random().toString(36).slice(2);
23
+ me = [...me, { id: n, type: e, content: r }], st(), setTimeout(() => {
24
+ me = me.filter((a) => a.id !== n), st();
25
25
  }, 3e3);
26
26
  }
27
- const Z = {
28
- success: (e) => xe("success", e),
29
- error: (e) => xe("error", e),
30
- warning: (e) => xe("warning", e)
27
+ const ae = {
28
+ success: (e) => _e("success", e),
29
+ error: (e) => _e("error", e),
30
+ warning: (e) => _e("warning", e)
31
31
  };
32
- function yt(e) {
33
- return Oe.add(e), () => {
34
- Oe.delete(e);
32
+ function Jt(e) {
33
+ return Ye.add(e), () => {
34
+ Ye.delete(e);
35
35
  };
36
36
  }
37
- function bt() {
38
- return ne;
37
+ function Xt() {
38
+ return me;
39
39
  }
40
- const xt = {
40
+ const Qt = {
41
41
  success: "bg-emerald-500",
42
42
  error: "bg-red-500",
43
43
  warning: "bg-amber-500"
44
- }, vt = {
44
+ }, er = {
45
45
  success: "✓",
46
46
  error: "✕",
47
47
  warning: "⚠"
48
48
  };
49
- function wt() {
50
- const [e, t] = A(bt());
51
- return K(() => yt(t), []), e.length === 0 ? null : /* @__PURE__ */ a("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((r) => /* @__PURE__ */ l(
49
+ function tr() {
50
+ const [e, r] = S(Xt());
51
+ return te(() => Jt(r), []), e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "fixed top-4 right-4 z-[9999] flex flex-col gap-2 pointer-events-none", children: e.map((n) => /* @__PURE__ */ s(
52
52
  "div",
53
53
  {
54
- className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${xt[r.type]}`,
54
+ className: `flex items-center gap-2 px-4 py-2.5 rounded-lg shadow-lg text-sm text-white font-medium pointer-events-auto ${Qt[n.type]}`,
55
55
  children: [
56
- /* @__PURE__ */ a("span", { className: "shrink-0 font-bold", children: vt[r.type] }),
57
- r.content
56
+ /* @__PURE__ */ t("span", { className: "shrink-0 font-bold", children: er[n.type] }),
57
+ n.content
58
58
  ]
59
59
  },
60
- r.id
60
+ n.id
61
61
  )) });
62
62
  }
63
- const Ke = Le(null);
64
- function xn({
63
+ const wt = Ue(null);
64
+ function Na({
65
65
  children: e,
66
- basePath: t,
67
- service: r = ht,
68
- previewBaseUrl: n,
69
- previewTailwind: s,
70
- navigate: u
66
+ basePath: r,
67
+ service: n = Ft,
68
+ previewBaseUrl: a,
69
+ previewTailwind: c,
70
+ navigate: d
71
71
  }) {
72
- const y = /* @__PURE__ */ l(
73
- Ke.Provider,
72
+ const g = /* @__PURE__ */ s(
73
+ wt.Provider,
74
74
  {
75
- value: { basePath: t, service: r, previewBaseUrl: n, previewTailwind: s },
75
+ value: { basePath: r, service: n, previewBaseUrl: a, previewTailwind: c },
76
76
  children: [
77
77
  e,
78
- /* @__PURE__ */ a(wt, {})
78
+ /* @__PURE__ */ t(tr, {})
79
79
  ]
80
80
  }
81
81
  );
82
- return u ? /* @__PURE__ */ a(
83
- Ae.Provider,
82
+ return d ? /* @__PURE__ */ t(
83
+ Je.Provider,
84
84
  {
85
- value: { navigate: u, params: {}, locationState: null },
86
- children: y
85
+ value: { navigate: d, params: {}, locationState: null },
86
+ children: g
87
87
  }
88
- ) : y;
88
+ ) : g;
89
89
  }
90
- function ze() {
91
- const e = _e(Ke);
90
+ function Ee() {
91
+ const e = Ke(wt);
92
92
  if (!e)
93
93
  throw new Error(
94
94
  "useArticlesConfig must be used within ArticlesProvider"
95
95
  );
96
96
  return e;
97
97
  }
98
- function vn({ children: e }) {
99
- const t = ft(), r = mt(), n = pt();
100
- return /* @__PURE__ */ a(
101
- Ae.Provider,
98
+ function ka({ children: e }) {
99
+ const r = Ut(), n = Kt(), a = Zt(), { basePath: c } = Ee(), d = c.replace(/\/+$/, ""), g = it(`${d}/:id/edit`), h = it(`${d}/:id/detail`), u = g ?? h;
100
+ return /* @__PURE__ */ t(
101
+ Je.Provider,
102
102
  {
103
103
  value: {
104
- navigate: (s, u) => t(s, u),
105
- params: r,
106
- locationState: n.state
104
+ navigate: (y, f) => r(y, f),
105
+ params: { ...n, ...u == null ? void 0 : u.params },
106
+ locationState: a.state
107
107
  },
108
108
  children: e
109
109
  }
@@ -115,23 +115,23 @@ function vn({ children: e }) {
115
115
  * This source code is licensed under the ISC license.
116
116
  * See the LICENSE file in the root directory of this source tree.
117
117
  */
118
- const Ge = (...e) => e.filter((t, r, n) => !!t && t.trim() !== "" && n.indexOf(t) === r).join(" ").trim();
118
+ const Nt = (...e) => e.filter((r, n, a) => !!r && r.trim() !== "" && a.indexOf(r) === n).join(" ").trim();
119
119
  /**
120
120
  * @license lucide-react v1.11.0 - ISC
121
121
  *
122
122
  * This source code is licensed under the ISC license.
123
123
  * See the LICENSE file in the root directory of this source tree.
124
124
  */
125
- const Nt = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
125
+ const rr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
126
126
  /**
127
127
  * @license lucide-react v1.11.0 - ISC
128
128
  *
129
129
  * This source code is licensed under the ISC license.
130
130
  * See the LICENSE file in the root directory of this source tree.
131
131
  */
132
- const kt = (e) => e.replace(
132
+ const nr = (e) => e.replace(
133
133
  /^([A-Z])|[\s-_]+(\w)/g,
134
- (t, r, n) => n ? n.toUpperCase() : r.toLowerCase()
134
+ (r, n, a) => a ? a.toUpperCase() : n.toLowerCase()
135
135
  );
136
136
  /**
137
137
  * @license lucide-react v1.11.0 - ISC
@@ -139,9 +139,9 @@ const kt = (e) => e.replace(
139
139
  * This source code is licensed under the ISC license.
140
140
  * See the LICENSE file in the root directory of this source tree.
141
141
  */
142
- const Ie = (e) => {
143
- const t = kt(e);
144
- return t.charAt(0).toUpperCase() + t.slice(1);
142
+ const ot = (e) => {
143
+ const r = nr(e);
144
+ return r.charAt(0).toUpperCase() + r.slice(1);
145
145
  };
146
146
  /**
147
147
  * @license lucide-react v1.11.0 - ISC
@@ -149,7 +149,7 @@ const Ie = (e) => {
149
149
  * This source code is licensed under the ISC license.
150
150
  * See the LICENSE file in the root directory of this source tree.
151
151
  */
152
- var ve = {
152
+ var Te = {
153
153
  xmlns: "http://www.w3.org/2000/svg",
154
154
  width: 24,
155
155
  height: 24,
@@ -166,36 +166,36 @@ var ve = {
166
166
  * This source code is licensed under the ISC license.
167
167
  * See the LICENSE file in the root directory of this source tree.
168
168
  */
169
- const $t = (e) => {
170
- for (const t in e)
171
- if (t.startsWith("aria-") || t === "role" || t === "title")
169
+ const ar = (e) => {
170
+ for (const r in e)
171
+ if (r.startsWith("aria-") || r === "role" || r === "title")
172
172
  return !0;
173
173
  return !1;
174
- }, Mt = Le({}), Ct = () => _e(Mt), St = Je(
175
- ({ color: e, size: t, strokeWidth: r, absoluteStrokeWidth: n, className: s = "", children: u, iconNode: y, ...$ }, M) => {
174
+ }, ir = Ue({}), sr = () => Ke(ir), or = yt(
175
+ ({ color: e, size: r, strokeWidth: n, absoluteStrokeWidth: a, className: c = "", children: d, iconNode: g, ...h }, u) => {
176
176
  const {
177
- size: j = 24,
178
- strokeWidth: m = 2,
179
- absoluteStrokeWidth: S = !1,
180
- color: W = "currentColor",
181
- className: P = ""
182
- } = Ct() ?? {}, E = n ?? S ? Number(r ?? m) * 24 / Number(t ?? j) : r ?? m;
183
- return Se(
177
+ size: y = 24,
178
+ strokeWidth: f = 2,
179
+ absoluteStrokeWidth: N = !1,
180
+ color: _ = "currentColor",
181
+ className: z = ""
182
+ } = sr() ?? {}, A = a ?? N ? Number(n ?? f) * 24 / Number(r ?? y) : n ?? f;
183
+ return Ve(
184
184
  "svg",
185
185
  {
186
- ref: M,
187
- ...ve,
188
- width: t ?? j ?? ve.width,
189
- height: t ?? j ?? ve.height,
190
- stroke: e ?? W,
191
- strokeWidth: E,
192
- className: Ge("lucide", P, s),
193
- ...!u && !$t($) && { "aria-hidden": "true" },
194
- ...$
186
+ ref: u,
187
+ ...Te,
188
+ width: r ?? y ?? Te.width,
189
+ height: r ?? y ?? Te.height,
190
+ stroke: e ?? _,
191
+ strokeWidth: A,
192
+ className: Nt("lucide", z, c),
193
+ ...!d && !ar(h) && { "aria-hidden": "true" },
194
+ ...h
195
195
  },
196
196
  [
197
- ...y.map(([I, H]) => Se(I, H)),
198
- ...Array.isArray(u) ? u : [u]
197
+ ...g.map(([W, V]) => Ve(W, V)),
198
+ ...Array.isArray(d) ? d : [d]
199
199
  ]
200
200
  );
201
201
  }
@@ -206,20 +206,20 @@ const $t = (e) => {
206
206
  * This source code is licensed under the ISC license.
207
207
  * See the LICENSE file in the root directory of this source tree.
208
208
  */
209
- const U = (e, t) => {
210
- const r = Je(
211
- ({ className: n, ...s }, u) => Se(St, {
212
- ref: u,
213
- iconNode: t,
214
- className: Ge(
215
- `lucide-${Nt(Ie(e))}`,
209
+ const K = (e, r) => {
210
+ const n = yt(
211
+ ({ className: a, ...c }, d) => Ve(or, {
212
+ ref: d,
213
+ iconNode: r,
214
+ className: Nt(
215
+ `lucide-${rr(ot(e))}`,
216
216
  `lucide-${e}`,
217
- n
217
+ a
218
218
  ),
219
- ...s
219
+ ...c
220
220
  })
221
221
  );
222
- return r.displayName = Ie(e), r;
222
+ return n.displayName = ot(e), n;
223
223
  };
224
224
  /**
225
225
  * @license lucide-react v1.11.0 - ISC
@@ -227,48 +227,105 @@ const U = (e, t) => {
227
227
  * This source code is licensed under the ISC license.
228
228
  * See the LICENSE file in the root directory of this source tree.
229
229
  */
230
- const jt = [
230
+ const cr = [
231
+ ["path", { d: "M12 5v14", key: "s699le" }],
232
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
233
+ ], lr = K("arrow-down", cr);
234
+ /**
235
+ * @license lucide-react v1.11.0 - ISC
236
+ *
237
+ * This source code is licensed under the ISC license.
238
+ * See the LICENSE file in the root directory of this source tree.
239
+ */
240
+ const dr = [
231
241
  ["path", { d: "m12 19-7-7 7-7", key: "1l729n" }],
232
242
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
233
- ], Qe = U("arrow-left", jt);
243
+ ], kt = K("arrow-left", dr);
234
244
  /**
235
245
  * @license lucide-react v1.11.0 - ISC
236
246
  *
237
247
  * This source code is licensed under the ISC license.
238
248
  * See the LICENSE file in the root directory of this source tree.
239
249
  */
240
- const Ot = [
250
+ const ur = [
251
+ ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
252
+ ["path", { d: "M17 20V4", key: "1ejh1v" }],
253
+ ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
254
+ ["path", { d: "M7 4v16", key: "1glfcx" }]
255
+ ], $t = K("arrow-up-down", ur);
256
+ /**
257
+ * @license lucide-react v1.11.0 - ISC
258
+ *
259
+ * This source code is licensed under the ISC license.
260
+ * See the LICENSE file in the root directory of this source tree.
261
+ */
262
+ const mr = [
263
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
264
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
265
+ ], hr = K("arrow-up", mr);
266
+ /**
267
+ * @license lucide-react v1.11.0 - ISC
268
+ *
269
+ * This source code is licensed under the ISC license.
270
+ * See the LICENSE file in the root directory of this source tree.
271
+ */
272
+ const gr = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]], Ct = K("check", gr);
273
+ /**
274
+ * @license lucide-react v1.11.0 - ISC
275
+ *
276
+ * This source code is licensed under the ISC license.
277
+ * See the LICENSE file in the root directory of this source tree.
278
+ */
279
+ const pr = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]], fr = K("chevron-down", pr);
280
+ /**
281
+ * @license lucide-react v1.11.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */
286
+ const xr = [
287
+ ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
288
+ ["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
289
+ ["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
290
+ ], yr = K("circle-alert", xr);
291
+ /**
292
+ * @license lucide-react v1.11.0 - ISC
293
+ *
294
+ * This source code is licensed under the ISC license.
295
+ * See the LICENSE file in the root directory of this source tree.
296
+ */
297
+ const br = [
241
298
  ["path", { d: "m16 18 6-6-6-6", key: "eg8j8" }],
242
299
  ["path", { d: "m8 6-6 6 6 6", key: "ppft3o" }]
243
- ], Xe = U("code", Ot);
300
+ ], Qe = K("code", br);
244
301
  /**
245
302
  * @license lucide-react v1.11.0 - ISC
246
303
  *
247
304
  * This source code is licensed under the ISC license.
248
305
  * See the LICENSE file in the root directory of this source tree.
249
306
  */
250
- const Pt = [
307
+ const vr = [
251
308
  ["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
252
309
  ["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
253
- ], Dt = U("copy", Pt);
310
+ ], wr = K("copy", vr);
254
311
  /**
255
312
  * @license lucide-react v1.11.0 - ISC
256
313
  *
257
314
  * This source code is licensed under the ISC license.
258
315
  * See the LICENSE file in the root directory of this source tree.
259
316
  */
260
- const Lt = [
317
+ const Nr = [
261
318
  ["path", { d: "M15 3h6v6", key: "1q9fwt" }],
262
319
  ["path", { d: "M10 14 21 3", key: "gplh6r" }],
263
320
  ["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
264
- ], _t = U("external-link", Lt);
321
+ ], kr = K("external-link", Nr);
265
322
  /**
266
323
  * @license lucide-react v1.11.0 - ISC
267
324
  *
268
325
  * This source code is licensed under the ISC license.
269
326
  * See the LICENSE file in the root directory of this source tree.
270
327
  */
271
- const Tt = [
328
+ const $r = [
272
329
  [
273
330
  "path",
274
331
  {
@@ -277,14 +334,14 @@ const Tt = [
277
334
  }
278
335
  ],
279
336
  ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
280
- ], Pe = U("eye", Tt);
337
+ ], qe = K("eye", $r);
281
338
  /**
282
339
  * @license lucide-react v1.11.0 - ISC
283
340
  *
284
341
  * This source code is licensed under the ISC license.
285
342
  * See the LICENSE file in the root directory of this source tree.
286
343
  */
287
- const At = [
344
+ const Cr = [
288
345
  [
289
346
  "path",
290
347
  {
@@ -296,14 +353,28 @@ const At = [
296
353
  ["path", { d: "M10 9H8", key: "b1mrlr" }],
297
354
  ["path", { d: "M16 13H8", key: "t4e002" }],
298
355
  ["path", { d: "M16 17H8", key: "z1uh3a" }]
299
- ], Et = U("file-text", At);
356
+ ], Mr = K("file-text", Cr);
357
+ /**
358
+ * @license lucide-react v1.11.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */
363
+ const Sr = [
364
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
365
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
366
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
367
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
368
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
369
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
370
+ ], ct = K("grip-vertical", Sr);
300
371
  /**
301
372
  * @license lucide-react v1.11.0 - ISC
302
373
  *
303
374
  * This source code is licensed under the ISC license.
304
375
  * See the LICENSE file in the root directory of this source tree.
305
376
  */
306
- const zt = [
377
+ const jr = [
307
378
  ["polyline", { points: "22 12 16 12 14 15 10 15 8 12 2 12", key: "o97t9d" }],
308
379
  [
309
380
  "path",
@@ -312,42 +383,63 @@ const zt = [
312
383
  key: "oot6mr"
313
384
  }
314
385
  ]
315
- ], Ht = U("inbox", zt);
386
+ ], Or = K("inbox", jr);
387
+ /**
388
+ * @license lucide-react v1.11.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */
393
+ const Er = [
394
+ ["rect", { width: "18", height: "7", x: "3", y: "3", rx: "1", key: "f1a2em" }],
395
+ ["rect", { width: "7", height: "7", x: "3", y: "14", rx: "1", key: "1bb6yr" }],
396
+ ["rect", { width: "7", height: "7", x: "14", y: "14", rx: "1", key: "nxv5o0" }]
397
+ ], Pr = K("layout-panel-top", Er);
316
398
  /**
317
399
  * @license lucide-react v1.11.0 - ISC
318
400
  *
319
401
  * This source code is licensed under the ISC license.
320
402
  * See the LICENSE file in the root directory of this source tree.
321
403
  */
322
- const It = [
404
+ const Dr = [
323
405
  ["path", { d: "M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71", key: "1cjeqo" }],
324
406
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
325
- ], Wt = U("link", It);
407
+ ], Ir = K("link", Dr);
326
408
  /**
327
409
  * @license lucide-react v1.11.0 - ISC
328
410
  *
329
411
  * This source code is licensed under the ISC license.
330
412
  * See the LICENSE file in the root directory of this source tree.
331
413
  */
332
- const Rt = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Vt = U("loader-circle", Rt);
414
+ const Lr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Pe = K("loader-circle", Lr);
333
415
  /**
334
416
  * @license lucide-react v1.11.0 - ISC
335
417
  *
336
418
  * This source code is licensed under the ISC license.
337
419
  * See the LICENSE file in the root directory of this source tree.
338
420
  */
339
- const Yt = [
421
+ const _r = [
340
422
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
341
423
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
342
424
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
343
- ], et = U("monitor", Yt);
425
+ ], Mt = K("monitor", _r);
426
+ /**
427
+ * @license lucide-react v1.11.0 - ISC
428
+ *
429
+ * This source code is licensed under the ISC license.
430
+ * See the LICENSE file in the root directory of this source tree.
431
+ */
432
+ const Tr = [
433
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
434
+ ["path", { d: "M3 15h18", key: "5xshup" }]
435
+ ], zr = K("panel-bottom", Tr);
344
436
  /**
345
437
  * @license lucide-react v1.11.0 - ISC
346
438
  *
347
439
  * This source code is licensed under the ISC license.
348
440
  * See the LICENSE file in the root directory of this source tree.
349
441
  */
350
- const Ut = [
442
+ const Ar = [
351
443
  [
352
444
  "path",
353
445
  {
@@ -356,44 +448,44 @@ const Ut = [
356
448
  }
357
449
  ],
358
450
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
359
- ], qt = U("pencil", Ut);
451
+ ], St = K("pencil", Ar);
360
452
  /**
361
453
  * @license lucide-react v1.11.0 - ISC
362
454
  *
363
455
  * This source code is licensed under the ISC license.
364
456
  * See the LICENSE file in the root directory of this source tree.
365
457
  */
366
- const Bt = [
458
+ const Hr = [
367
459
  ["path", { d: "M5 12h14", key: "1ays0h" }],
368
460
  ["path", { d: "M12 5v14", key: "s699le" }]
369
- ], Ft = U("plus", Bt);
461
+ ], et = K("plus", Hr);
370
462
  /**
371
463
  * @license lucide-react v1.11.0 - ISC
372
464
  *
373
465
  * This source code is licensed under the ISC license.
374
466
  * See the LICENSE file in the root directory of this source tree.
375
467
  */
376
- const Zt = [
468
+ const Gr = [
377
469
  ["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
378
470
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
379
- ], Jt = U("rotate-ccw", Zt);
471
+ ], Wr = K("rotate-ccw", Gr);
380
472
  /**
381
473
  * @license lucide-react v1.11.0 - ISC
382
474
  *
383
475
  * This source code is licensed under the ISC license.
384
476
  * See the LICENSE file in the root directory of this source tree.
385
477
  */
386
- const Kt = [
478
+ const Rr = [
387
479
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
388
480
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
389
- ], we = U("search", Kt);
481
+ ], ze = K("search", Rr);
390
482
  /**
391
483
  * @license lucide-react v1.11.0 - ISC
392
484
  *
393
485
  * This source code is licensed under the ISC license.
394
486
  * See the LICENSE file in the root directory of this source tree.
395
487
  */
396
- const Gt = [
488
+ const Vr = [
397
489
  [
398
490
  "path",
399
491
  {
@@ -402,354 +494,364 @@ const Gt = [
402
494
  }
403
495
  ],
404
496
  ["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
405
- ], We = U("shield-check", Gt);
497
+ ], lt = K("shield-check", Vr);
406
498
  /**
407
499
  * @license lucide-react v1.11.0 - ISC
408
500
  *
409
501
  * This source code is licensed under the ISC license.
410
502
  * See the LICENSE file in the root directory of this source tree.
411
503
  */
412
- const Qt = [
504
+ const Yr = [
413
505
  ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2", key: "1yt0o3" }],
414
506
  ["path", { d: "M12 18h.01", key: "mhygvu" }]
415
- ], tt = U("smartphone", Qt);
507
+ ], jt = K("smartphone", Yr);
416
508
  /**
417
509
  * @license lucide-react v1.11.0 - ISC
418
510
  *
419
511
  * This source code is licensed under the ISC license.
420
512
  * See the LICENSE file in the root directory of this source tree.
421
513
  */
422
- const Xt = [
514
+ const qr = [
423
515
  ["rect", { width: "16", height: "20", x: "4", y: "2", rx: "2", ry: "2", key: "76otgf" }],
424
516
  ["line", { x1: "12", x2: "12.01", y1: "18", y2: "18", key: "1dp563" }]
425
- ], rt = U("tablet", Xt);
426
- function er(e) {
517
+ ], Ot = K("tablet", qr);
518
+ /**
519
+ * @license lucide-react v1.11.0 - ISC
520
+ *
521
+ * This source code is licensed under the ISC license.
522
+ * See the LICENSE file in the root directory of this source tree.
523
+ */
524
+ const Br = [
525
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
526
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
527
+ ], Et = K("x", Br);
528
+ function Fr(e) {
427
529
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
428
530
  }
429
- var me = { exports: {} }, tr = me.exports, Re;
430
- function rr() {
431
- return Re || (Re = 1, (function(e, t) {
432
- (function(r, n) {
433
- e.exports = n();
434
- })(tr, (function() {
435
- var r = 1e3, n = 6e4, s = 36e5, u = "millisecond", y = "second", $ = "minute", M = "hour", j = "day", m = "week", S = "month", W = "quarter", P = "year", E = "date", I = "Invalid Date", H = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, B = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, z = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(x) {
436
- var i = ["th", "st", "nd", "rd"], o = x % 100;
437
- return "[" + x + (i[(o - 20) % 10] || i[o] || i[0]) + "]";
438
- } }, p = function(x, i, o) {
439
- var d = String(x);
440
- return !d || d.length >= i ? x : "" + Array(i + 1 - d.length).join(o) + x;
441
- }, T = { s: p, z: function(x) {
442
- var i = -x.utcOffset(), o = Math.abs(i), d = Math.floor(o / 60), c = o % 60;
443
- return (i <= 0 ? "+" : "-") + p(d, 2, "0") + ":" + p(c, 2, "0");
444
- }, m: function x(i, o) {
445
- if (i.date() < o.date()) return -x(o, i);
446
- var d = 12 * (o.year() - i.year()) + (o.month() - i.month()), c = i.clone().add(d, S), v = o - c < 0, k = i.clone().add(d + (v ? -1 : 1), S);
447
- return +(-(d + (o - c) / (v ? c - k : k - c)) || 0);
448
- }, a: function(x) {
449
- return x < 0 ? Math.ceil(x) || 0 : Math.floor(x);
450
- }, p: function(x) {
451
- return { M: S, y: P, w: m, d: j, D: E, h: M, m: $, s: y, ms: u, Q: W }[x] || String(x || "").toLowerCase().replace(/s$/, "");
452
- }, u: function(x) {
453
- return x === void 0;
454
- } }, O = "en", b = {};
455
- b[O] = z;
456
- var w = "$isDayjsObject", R = function(x) {
457
- return x instanceof q || !(!x || !x[w]);
458
- }, L = function x(i, o, d) {
459
- var c;
460
- if (!i) return O;
461
- if (typeof i == "string") {
462
- var v = i.toLowerCase();
463
- b[v] && (c = v), o && (b[v] = o, c = v);
464
- var k = i.split("-");
465
- if (!c && k.length > 1) return x(k[0]);
531
+ var Ce = { exports: {} }, Ur = Ce.exports, dt;
532
+ function Kr() {
533
+ return dt || (dt = 1, (function(e, r) {
534
+ (function(n, a) {
535
+ e.exports = a();
536
+ })(Ur, (function() {
537
+ var n = 1e3, a = 6e4, c = 36e5, d = "millisecond", g = "second", h = "minute", u = "hour", y = "day", f = "week", N = "month", _ = "quarter", z = "year", A = "date", W = "Invalid Date", V = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, R = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, H = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(k) {
538
+ var l = ["th", "st", "nd", "rd"], m = k % 100;
539
+ return "[" + k + (l[(m - 20) % 10] || l[m] || l[0]) + "]";
540
+ } }, F = function(k, l, m) {
541
+ var $ = String(k);
542
+ return !$ || $.length >= l ? k : "" + Array(l + 1 - $.length).join(m) + k;
543
+ }, M = { s: F, z: function(k) {
544
+ var l = -k.utcOffset(), m = Math.abs(l), $ = Math.floor(m / 60), x = m % 60;
545
+ return (l <= 0 ? "+" : "-") + F($, 2, "0") + ":" + F(x, 2, "0");
546
+ }, m: function k(l, m) {
547
+ if (l.date() < m.date()) return -k(m, l);
548
+ var $ = 12 * (m.year() - l.year()) + (m.month() - l.month()), x = l.clone().add($, N), E = m - x < 0, P = l.clone().add($ + (E ? -1 : 1), N);
549
+ return +(-($ + (m - x) / (E ? x - P : P - x)) || 0);
550
+ }, a: function(k) {
551
+ return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
552
+ }, p: function(k) {
553
+ return { M: N, y: z, w: f, d: y, D: A, h: u, m: h, s: g, ms: d, Q: _ }[k] || String(k || "").toLowerCase().replace(/s$/, "");
554
+ }, u: function(k) {
555
+ return k === void 0;
556
+ } }, D = "en", v = {};
557
+ v[D] = H;
558
+ var b = "$isDayjsObject", T = function(k) {
559
+ return k instanceof L || !(!k || !k[b]);
560
+ }, O = function k(l, m, $) {
561
+ var x;
562
+ if (!l) return D;
563
+ if (typeof l == "string") {
564
+ var E = l.toLowerCase();
565
+ v[E] && (x = E), m && (v[E] = m, x = E);
566
+ var P = l.split("-");
567
+ if (!x && P.length > 1) return k(P[0]);
466
568
  } else {
467
- var f = i.name;
468
- b[f] = i, c = f;
569
+ var i = l.name;
570
+ v[i] = l, x = i;
469
571
  }
470
- return !d && c && (O = c), c || !d && O;
471
- }, g = function(x, i) {
472
- if (R(x)) return x.clone();
473
- var o = typeof i == "object" ? i : {};
474
- return o.date = x, o.args = arguments, new q(o);
475
- }, C = T;
476
- C.l = L, C.i = R, C.w = function(x, i) {
477
- return g(x, { locale: i.$L, utc: i.$u, x: i.$x, $offset: i.$offset });
572
+ return !$ && x && (D = x), x || !$ && D;
573
+ }, p = function(k, l) {
574
+ if (T(k)) return k.clone();
575
+ var m = typeof l == "object" ? l : {};
576
+ return m.date = k, m.args = arguments, new L(m);
577
+ }, C = M;
578
+ C.l = O, C.i = T, C.w = function(k, l) {
579
+ return p(k, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
478
580
  };
479
- var q = (function() {
480
- function x(o) {
481
- this.$L = L(o.locale, null, !0), this.parse(o), this.$x = this.$x || o.x || {}, this[w] = !0;
581
+ var L = (function() {
582
+ function k(m) {
583
+ this.$L = O(m.locale, null, !0), this.parse(m), this.$x = this.$x || m.x || {}, this[b] = !0;
482
584
  }
483
- var i = x.prototype;
484
- return i.parse = function(o) {
485
- this.$d = (function(d) {
486
- var c = d.date, v = d.utc;
487
- if (c === null) return /* @__PURE__ */ new Date(NaN);
488
- if (C.u(c)) return /* @__PURE__ */ new Date();
489
- if (c instanceof Date) return new Date(c);
490
- if (typeof c == "string" && !/Z$/i.test(c)) {
491
- var k = c.match(H);
492
- if (k) {
493
- var f = k[2] - 1 || 0, N = (k[7] || "0").substring(0, 3);
494
- return v ? new Date(Date.UTC(k[1], f, k[3] || 1, k[4] || 0, k[5] || 0, k[6] || 0, N)) : new Date(k[1], f, k[3] || 1, k[4] || 0, k[5] || 0, k[6] || 0, N);
585
+ var l = k.prototype;
586
+ return l.parse = function(m) {
587
+ this.$d = (function($) {
588
+ var x = $.date, E = $.utc;
589
+ if (x === null) return /* @__PURE__ */ new Date(NaN);
590
+ if (C.u(x)) return /* @__PURE__ */ new Date();
591
+ if (x instanceof Date) return new Date(x);
592
+ if (typeof x == "string" && !/Z$/i.test(x)) {
593
+ var P = x.match(V);
594
+ if (P) {
595
+ var i = P[2] - 1 || 0, o = (P[7] || "0").substring(0, 3);
596
+ return E ? new Date(Date.UTC(P[1], i, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, o)) : new Date(P[1], i, P[3] || 1, P[4] || 0, P[5] || 0, P[6] || 0, o);
495
597
  }
496
598
  }
497
- return new Date(c);
498
- })(o), this.init();
499
- }, i.init = function() {
500
- var o = this.$d;
501
- this.$y = o.getFullYear(), this.$M = o.getMonth(), this.$D = o.getDate(), this.$W = o.getDay(), this.$H = o.getHours(), this.$m = o.getMinutes(), this.$s = o.getSeconds(), this.$ms = o.getMilliseconds();
502
- }, i.$utils = function() {
599
+ return new Date(x);
600
+ })(m), this.init();
601
+ }, l.init = function() {
602
+ var m = this.$d;
603
+ this.$y = m.getFullYear(), this.$M = m.getMonth(), this.$D = m.getDate(), this.$W = m.getDay(), this.$H = m.getHours(), this.$m = m.getMinutes(), this.$s = m.getSeconds(), this.$ms = m.getMilliseconds();
604
+ }, l.$utils = function() {
503
605
  return C;
504
- }, i.isValid = function() {
505
- return this.$d.toString() !== I;
506
- }, i.isSame = function(o, d) {
507
- var c = g(o);
508
- return this.startOf(d) <= c && c <= this.endOf(d);
509
- }, i.isAfter = function(o, d) {
510
- return g(o) < this.startOf(d);
511
- }, i.isBefore = function(o, d) {
512
- return this.endOf(d) < g(o);
513
- }, i.$g = function(o, d, c) {
514
- return C.u(o) ? this[d] : this.set(c, o);
515
- }, i.unix = function() {
606
+ }, l.isValid = function() {
607
+ return this.$d.toString() !== W;
608
+ }, l.isSame = function(m, $) {
609
+ var x = p(m);
610
+ return this.startOf($) <= x && x <= this.endOf($);
611
+ }, l.isAfter = function(m, $) {
612
+ return p(m) < this.startOf($);
613
+ }, l.isBefore = function(m, $) {
614
+ return this.endOf($) < p(m);
615
+ }, l.$g = function(m, $, x) {
616
+ return C.u(m) ? this[$] : this.set(x, m);
617
+ }, l.unix = function() {
516
618
  return Math.floor(this.valueOf() / 1e3);
517
- }, i.valueOf = function() {
619
+ }, l.valueOf = function() {
518
620
  return this.$d.getTime();
519
- }, i.startOf = function(o, d) {
520
- var c = this, v = !!C.u(d) || d, k = C.p(o), f = function(ee, V) {
521
- var te = C.w(c.$u ? Date.UTC(c.$y, V, ee) : new Date(c.$y, V, ee), c);
522
- return v ? te : te.endOf(j);
523
- }, N = function(ee, V) {
524
- return C.w(c.toDate()[ee].apply(c.toDate("s"), (v ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(V)), c);
525
- }, D = this.$W, h = this.$M, _ = this.$D, Q = "set" + (this.$u ? "UTC" : "");
526
- switch (k) {
527
- case P:
528
- return v ? f(1, 0) : f(31, 11);
529
- case S:
530
- return v ? f(1, h) : f(0, h + 1);
531
- case m:
532
- var F = this.$locale().weekStart || 0, X = (D < F ? D + 7 : D) - F;
533
- return f(v ? _ - X : _ + (6 - X), h);
534
- case j:
535
- case E:
536
- return N(Q + "Hours", 0);
537
- case M:
538
- return N(Q + "Minutes", 1);
539
- case $:
540
- return N(Q + "Seconds", 2);
621
+ }, l.startOf = function(m, $) {
622
+ var x = this, E = !!C.u($) || $, P = C.p(m), i = function(X, ne) {
623
+ var ie = C.w(x.$u ? Date.UTC(x.$y, ne, X) : new Date(x.$y, ne, X), x);
624
+ return E ? ie : ie.endOf(y);
625
+ }, o = function(X, ne) {
626
+ return C.w(x.toDate()[X].apply(x.toDate("s"), (E ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ne)), x);
627
+ }, w = this.$W, j = this.$M, G = this.$D, J = "set" + (this.$u ? "UTC" : "");
628
+ switch (P) {
629
+ case z:
630
+ return E ? i(1, 0) : i(31, 11);
631
+ case N:
632
+ return E ? i(1, j) : i(0, j + 1);
633
+ case f:
634
+ var B = this.$locale().weekStart || 0, re = (w < B ? w + 7 : w) - B;
635
+ return i(E ? G - re : G + (6 - re), j);
541
636
  case y:
542
- return N(Q + "Milliseconds", 3);
637
+ case A:
638
+ return o(J + "Hours", 0);
639
+ case u:
640
+ return o(J + "Minutes", 1);
641
+ case h:
642
+ return o(J + "Seconds", 2);
643
+ case g:
644
+ return o(J + "Milliseconds", 3);
543
645
  default:
544
646
  return this.clone();
545
647
  }
546
- }, i.endOf = function(o) {
547
- return this.startOf(o, !1);
548
- }, i.$set = function(o, d) {
549
- var c, v = C.p(o), k = "set" + (this.$u ? "UTC" : ""), f = (c = {}, c[j] = k + "Date", c[E] = k + "Date", c[S] = k + "Month", c[P] = k + "FullYear", c[M] = k + "Hours", c[$] = k + "Minutes", c[y] = k + "Seconds", c[u] = k + "Milliseconds", c)[v], N = v === j ? this.$D + (d - this.$W) : d;
550
- if (v === S || v === P) {
551
- var D = this.clone().set(E, 1);
552
- D.$d[f](N), D.init(), this.$d = D.set(E, Math.min(this.$D, D.daysInMonth())).$d;
553
- } else f && this.$d[f](N);
648
+ }, l.endOf = function(m) {
649
+ return this.startOf(m, !1);
650
+ }, l.$set = function(m, $) {
651
+ var x, E = C.p(m), P = "set" + (this.$u ? "UTC" : ""), i = (x = {}, x[y] = P + "Date", x[A] = P + "Date", x[N] = P + "Month", x[z] = P + "FullYear", x[u] = P + "Hours", x[h] = P + "Minutes", x[g] = P + "Seconds", x[d] = P + "Milliseconds", x)[E], o = E === y ? this.$D + ($ - this.$W) : $;
652
+ if (E === N || E === z) {
653
+ var w = this.clone().set(A, 1);
654
+ w.$d[i](o), w.init(), this.$d = w.set(A, Math.min(this.$D, w.daysInMonth())).$d;
655
+ } else i && this.$d[i](o);
554
656
  return this.init(), this;
555
- }, i.set = function(o, d) {
556
- return this.clone().$set(o, d);
557
- }, i.get = function(o) {
558
- return this[C.p(o)]();
559
- }, i.add = function(o, d) {
560
- var c, v = this;
561
- o = Number(o);
562
- var k = C.p(d), f = function(h) {
563
- var _ = g(v);
564
- return C.w(_.date(_.date() + Math.round(h * o)), v);
657
+ }, l.set = function(m, $) {
658
+ return this.clone().$set(m, $);
659
+ }, l.get = function(m) {
660
+ return this[C.p(m)]();
661
+ }, l.add = function(m, $) {
662
+ var x, E = this;
663
+ m = Number(m);
664
+ var P = C.p($), i = function(j) {
665
+ var G = p(E);
666
+ return C.w(G.date(G.date() + Math.round(j * m)), E);
565
667
  };
566
- if (k === S) return this.set(S, this.$M + o);
567
- if (k === P) return this.set(P, this.$y + o);
568
- if (k === j) return f(1);
569
- if (k === m) return f(7);
570
- var N = (c = {}, c[$] = n, c[M] = s, c[y] = r, c)[k] || 1, D = this.$d.getTime() + o * N;
571
- return C.w(D, this);
572
- }, i.subtract = function(o, d) {
573
- return this.add(-1 * o, d);
574
- }, i.format = function(o) {
575
- var d = this, c = this.$locale();
576
- if (!this.isValid()) return c.invalidDate || I;
577
- var v = o || "YYYY-MM-DDTHH:mm:ssZ", k = C.z(this), f = this.$H, N = this.$m, D = this.$M, h = c.weekdays, _ = c.months, Q = c.meridiem, F = function(V, te, oe, de) {
578
- return V && (V[te] || V(d, v)) || oe[te].slice(0, de);
579
- }, X = function(V) {
580
- return C.s(f % 12 || 12, V, "0");
581
- }, ee = Q || function(V, te, oe) {
582
- var de = V < 12 ? "AM" : "PM";
583
- return oe ? de.toLowerCase() : de;
668
+ if (P === N) return this.set(N, this.$M + m);
669
+ if (P === z) return this.set(z, this.$y + m);
670
+ if (P === y) return i(1);
671
+ if (P === f) return i(7);
672
+ var o = (x = {}, x[h] = a, x[u] = c, x[g] = n, x)[P] || 1, w = this.$d.getTime() + m * o;
673
+ return C.w(w, this);
674
+ }, l.subtract = function(m, $) {
675
+ return this.add(-1 * m, $);
676
+ }, l.format = function(m) {
677
+ var $ = this, x = this.$locale();
678
+ if (!this.isValid()) return x.invalidDate || W;
679
+ var E = m || "YYYY-MM-DDTHH:mm:ssZ", P = C.z(this), i = this.$H, o = this.$m, w = this.$M, j = x.weekdays, G = x.months, J = x.meridiem, B = function(ne, ie, se, ee) {
680
+ return ne && (ne[ie] || ne($, E)) || se[ie].slice(0, ee);
681
+ }, re = function(ne) {
682
+ return C.s(i % 12 || 12, ne, "0");
683
+ }, X = J || function(ne, ie, se) {
684
+ var ee = ne < 12 ? "AM" : "PM";
685
+ return se ? ee.toLowerCase() : ee;
584
686
  };
585
- return v.replace(B, (function(V, te) {
586
- return te || (function(oe) {
587
- switch (oe) {
687
+ return E.replace(R, (function(ne, ie) {
688
+ return ie || (function(se) {
689
+ switch (se) {
588
690
  case "YY":
589
- return String(d.$y).slice(-2);
691
+ return String($.$y).slice(-2);
590
692
  case "YYYY":
591
- return C.s(d.$y, 4, "0");
693
+ return C.s($.$y, 4, "0");
592
694
  case "M":
593
- return D + 1;
695
+ return w + 1;
594
696
  case "MM":
595
- return C.s(D + 1, 2, "0");
697
+ return C.s(w + 1, 2, "0");
596
698
  case "MMM":
597
- return F(c.monthsShort, D, _, 3);
699
+ return B(x.monthsShort, w, G, 3);
598
700
  case "MMMM":
599
- return F(_, D);
701
+ return B(G, w);
600
702
  case "D":
601
- return d.$D;
703
+ return $.$D;
602
704
  case "DD":
603
- return C.s(d.$D, 2, "0");
705
+ return C.s($.$D, 2, "0");
604
706
  case "d":
605
- return String(d.$W);
707
+ return String($.$W);
606
708
  case "dd":
607
- return F(c.weekdaysMin, d.$W, h, 2);
709
+ return B(x.weekdaysMin, $.$W, j, 2);
608
710
  case "ddd":
609
- return F(c.weekdaysShort, d.$W, h, 3);
711
+ return B(x.weekdaysShort, $.$W, j, 3);
610
712
  case "dddd":
611
- return h[d.$W];
713
+ return j[$.$W];
612
714
  case "H":
613
- return String(f);
715
+ return String(i);
614
716
  case "HH":
615
- return C.s(f, 2, "0");
717
+ return C.s(i, 2, "0");
616
718
  case "h":
617
- return X(1);
719
+ return re(1);
618
720
  case "hh":
619
- return X(2);
721
+ return re(2);
620
722
  case "a":
621
- return ee(f, N, !0);
723
+ return X(i, o, !0);
622
724
  case "A":
623
- return ee(f, N, !1);
725
+ return X(i, o, !1);
624
726
  case "m":
625
- return String(N);
727
+ return String(o);
626
728
  case "mm":
627
- return C.s(N, 2, "0");
729
+ return C.s(o, 2, "0");
628
730
  case "s":
629
- return String(d.$s);
731
+ return String($.$s);
630
732
  case "ss":
631
- return C.s(d.$s, 2, "0");
733
+ return C.s($.$s, 2, "0");
632
734
  case "SSS":
633
- return C.s(d.$ms, 3, "0");
735
+ return C.s($.$ms, 3, "0");
634
736
  case "Z":
635
- return k;
737
+ return P;
636
738
  }
637
739
  return null;
638
- })(V) || k.replace(":", "");
740
+ })(ne) || P.replace(":", "");
639
741
  }));
640
- }, i.utcOffset = function() {
742
+ }, l.utcOffset = function() {
641
743
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
642
- }, i.diff = function(o, d, c) {
643
- var v, k = this, f = C.p(d), N = g(o), D = (N.utcOffset() - this.utcOffset()) * n, h = this - N, _ = function() {
644
- return C.m(k, N);
744
+ }, l.diff = function(m, $, x) {
745
+ var E, P = this, i = C.p($), o = p(m), w = (o.utcOffset() - this.utcOffset()) * a, j = this - o, G = function() {
746
+ return C.m(P, o);
645
747
  };
646
- switch (f) {
647
- case P:
648
- v = _() / 12;
748
+ switch (i) {
749
+ case z:
750
+ E = G() / 12;
649
751
  break;
650
- case S:
651
- v = _();
752
+ case N:
753
+ E = G();
652
754
  break;
653
- case W:
654
- v = _() / 3;
755
+ case _:
756
+ E = G() / 3;
655
757
  break;
656
- case m:
657
- v = (h - D) / 6048e5;
758
+ case f:
759
+ E = (j - w) / 6048e5;
658
760
  break;
659
- case j:
660
- v = (h - D) / 864e5;
761
+ case y:
762
+ E = (j - w) / 864e5;
661
763
  break;
662
- case M:
663
- v = h / s;
764
+ case u:
765
+ E = j / c;
664
766
  break;
665
- case $:
666
- v = h / n;
767
+ case h:
768
+ E = j / a;
667
769
  break;
668
- case y:
669
- v = h / r;
770
+ case g:
771
+ E = j / n;
670
772
  break;
671
773
  default:
672
- v = h;
774
+ E = j;
673
775
  }
674
- return c ? v : C.a(v);
675
- }, i.daysInMonth = function() {
676
- return this.endOf(S).$D;
677
- }, i.$locale = function() {
678
- return b[this.$L];
679
- }, i.locale = function(o, d) {
680
- if (!o) return this.$L;
681
- var c = this.clone(), v = L(o, d, !0);
682
- return v && (c.$L = v), c;
683
- }, i.clone = function() {
776
+ return x ? E : C.a(E);
777
+ }, l.daysInMonth = function() {
778
+ return this.endOf(N).$D;
779
+ }, l.$locale = function() {
780
+ return v[this.$L];
781
+ }, l.locale = function(m, $) {
782
+ if (!m) return this.$L;
783
+ var x = this.clone(), E = O(m, $, !0);
784
+ return E && (x.$L = E), x;
785
+ }, l.clone = function() {
684
786
  return C.w(this.$d, this);
685
- }, i.toDate = function() {
787
+ }, l.toDate = function() {
686
788
  return new Date(this.valueOf());
687
- }, i.toJSON = function() {
789
+ }, l.toJSON = function() {
688
790
  return this.isValid() ? this.toISOString() : null;
689
- }, i.toISOString = function() {
791
+ }, l.toISOString = function() {
690
792
  return this.$d.toISOString();
691
- }, i.toString = function() {
793
+ }, l.toString = function() {
692
794
  return this.$d.toUTCString();
693
- }, x;
694
- })(), G = q.prototype;
695
- return g.prototype = G, [["$ms", u], ["$s", y], ["$m", $], ["$H", M], ["$W", j], ["$M", S], ["$y", P], ["$D", E]].forEach((function(x) {
696
- G[x[1]] = function(i) {
697
- return this.$g(i, x[0], x[1]);
795
+ }, k;
796
+ })(), q = L.prototype;
797
+ return p.prototype = q, [["$ms", d], ["$s", g], ["$m", h], ["$H", u], ["$W", y], ["$M", N], ["$y", z], ["$D", A]].forEach((function(k) {
798
+ q[k[1]] = function(l) {
799
+ return this.$g(l, k[0], k[1]);
698
800
  };
699
- })), g.extend = function(x, i) {
700
- return x.$i || (x(i, q, g), x.$i = !0), g;
701
- }, g.locale = L, g.isDayjs = R, g.unix = function(x) {
702
- return g(1e3 * x);
703
- }, g.en = b[O], g.Ls = b, g.p = {}, g;
801
+ })), p.extend = function(k, l) {
802
+ return k.$i || (k(l, L, p), k.$i = !0), p;
803
+ }, p.locale = O, p.isDayjs = T, p.unix = function(k) {
804
+ return p(1e3 * k);
805
+ }, p.en = v[D], p.Ls = v, p.p = {}, p;
704
806
  }));
705
- })(me)), me.exports;
706
- }
707
- var nr = rr();
708
- const De = /* @__PURE__ */ er(nr);
709
- function nt() {
710
- const [e, t] = A(!1), [r, n] = A(!1), s = Y({ title: "" }), u = {
711
- confirm: (S) => {
712
- s.current = S, n(!1), t(!0);
807
+ })(Ce)), Ce.exports;
808
+ }
809
+ var Zr = Kr();
810
+ const Be = /* @__PURE__ */ Fr(Zr);
811
+ function Pt() {
812
+ const [e, r] = S(!1), [n, a] = S(!1), c = Y({ title: "" }), d = {
813
+ confirm: (N) => {
814
+ c.current = N, a(!1), r(!0);
713
815
  }
714
- }, y = async () => {
715
- var S, W;
716
- n(!0);
816
+ }, g = async () => {
817
+ var N, _;
818
+ a(!0);
717
819
  try {
718
- await ((W = (S = s.current).onOk) == null ? void 0 : W.call(S)), t(!1);
820
+ await ((_ = (N = c.current).onOk) == null ? void 0 : _.call(N)), r(!1);
719
821
  } finally {
720
- n(!1);
822
+ a(!1);
721
823
  }
722
- }, $ = () => {
723
- var S, W;
724
- (W = (S = s.current).onCancel) == null || W.call(S), t(!1);
725
- }, M = s.current, j = M.okType === "danger", m = e ? gt(
726
- /* @__PURE__ */ l("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
727
- /* @__PURE__ */ a(
824
+ }, h = () => {
825
+ var N, _;
826
+ (_ = (N = c.current).onCancel) == null || _.call(N), r(!1);
827
+ }, u = c.current, y = u.okType === "danger", f = e ? vt(
828
+ /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
829
+ /* @__PURE__ */ t(
728
830
  "div",
729
831
  {
730
832
  className: "absolute inset-0 bg-black/40",
731
- onClick: $
833
+ onClick: h
732
834
  }
733
835
  ),
734
- /* @__PURE__ */ l("div", { className: "relative bg-white rounded-2xl shadow-xl w-full max-w-md mx-4 p-6", children: [
735
- /* @__PURE__ */ a("div", { className: "text-base font-semibold text-gray-800 mb-2", children: M.title }),
736
- M.content && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600 mt-3", children: M.content }),
737
- /* @__PURE__ */ l("div", { className: "flex justify-end gap-2 mt-5", children: [
738
- /* @__PURE__ */ a(
836
+ /* @__PURE__ */ s("div", { className: "relative bg-white rounded-2xl shadow-xl w-full max-w-md mx-4 p-6", children: [
837
+ /* @__PURE__ */ t("div", { className: "text-base font-semibold text-gray-800 mb-2", children: u.title }),
838
+ u.content && /* @__PURE__ */ t("div", { className: "text-sm text-gray-600 mt-3", children: u.content }),
839
+ /* @__PURE__ */ s("div", { className: "flex justify-end gap-2 mt-5", children: [
840
+ /* @__PURE__ */ t(
739
841
  "button",
740
842
  {
741
843
  className: "px-4 py-1.5 rounded-lg border border-gray-200 text-sm text-gray-600 hover:bg-gray-50 transition-colors cursor-pointer",
742
- onClick: $,
743
- children: M.cancelText ?? "取消"
844
+ onClick: h,
845
+ children: u.cancelText ?? "取消"
744
846
  }
745
847
  ),
746
- /* @__PURE__ */ a(
848
+ /* @__PURE__ */ t(
747
849
  "button",
748
850
  {
749
- disabled: r,
750
- className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${j ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
751
- onClick: y,
752
- children: r ? "处理中…" : M.okText ?? "确定"
851
+ disabled: n,
852
+ className: `px-4 py-1.5 rounded-lg text-white text-sm font-medium transition-colors disabled:opacity-50 cursor-pointer ${y ? "bg-red-500 hover:bg-red-600" : "bg-blue-500 hover:bg-blue-600"}`,
853
+ onClick: g,
854
+ children: n ? "处理中…" : u.okText ?? "确定"
753
855
  }
754
856
  )
755
857
  ] })
@@ -757,15 +859,63 @@ function nt() {
757
859
  ] }),
758
860
  document.body
759
861
  ) : null;
760
- return [u, m];
862
+ return [d, f];
863
+ }
864
+ const Dt = (e, r) => JSON.stringify([e.trim().replace(/\/+$/, ""), r]);
865
+ function Se({ enabled: e, children: r }) {
866
+ return /* @__PURE__ */ s("span", { className: `inline-flex shrink-0 items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] font-medium leading-4 ${e ? "bg-emerald-50 text-emerald-700" : "bg-gray-100 text-gray-500"}`, children: [
867
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: `h-1 w-1 shrink-0 rounded-full ${e ? "bg-emerald-500" : "bg-gray-400"}` }),
868
+ r
869
+ ] });
761
870
  }
762
- const wn = () => {
763
- const { navigate: e } = Ee(), { basePath: t, service: r } = ze(), [n, s] = nt(), [u, y] = A(""), [$, M] = A(""), [j, m] = A(!1), [S, W] = A([]), [P, E] = A({
871
+ function Jr({ article: e }) {
872
+ var g, h;
873
+ const r = e.guidesDisplay, n = r == null ? void 0 : r.title.trim(), a = r == null ? void 0 : r.description.trim(), c = (g = r == null ? void 0 : r.category) == null ? void 0 : g.name.trim(), d = !!(r != null && r.categoryId || (h = r == null ? void 0 : r.category) != null && h.id || c);
874
+ return r ? /* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
875
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 leading-5", children: [
876
+ /* @__PURE__ */ t("span", { className: "w-6 shrink-0 text-xs text-gray-400", children: "标题" }),
877
+ /* @__PURE__ */ t("p", { title: n, className: "min-w-0 truncate text-sm font-medium text-gray-800", children: n || "未设置展示标题" }),
878
+ /* @__PURE__ */ t(Se, { enabled: !0, children: "已配置" })
879
+ ] }),
880
+ a && /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
881
+ /* @__PURE__ */ t("span", { className: "w-6 shrink-0 text-gray-400", children: "简介" }),
882
+ /* @__PURE__ */ t("p", { title: a, className: "truncate text-gray-500", children: a })
883
+ ] }),
884
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
885
+ /* @__PURE__ */ t("span", { className: "w-6 shrink-0 text-gray-400", children: "分类" }),
886
+ /* @__PURE__ */ t("p", { className: `truncate ${c ? "text-gray-600" : "text-gray-400"}`, title: c, children: c || (d ? "分类名称暂不可用" : "未分类") })
887
+ ] })
888
+ ] }) : /* @__PURE__ */ t(Se, { enabled: !1, children: "未配置" });
889
+ }
890
+ function Xr({ article: e, groups: r, canLoadGroups: n, onRetry: a }) {
891
+ var g;
892
+ const c = e.navPlacements ?? [], d = (g = e.navname) == null ? void 0 : g.trim();
893
+ return !e.navEnabled && !d && !c.length ? /* @__PURE__ */ t(Se, { enabled: !1, children: "未设置" }) : /* @__PURE__ */ s("div", { className: "min-w-0 space-y-1", children: [
894
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 leading-5", children: [
895
+ /* @__PURE__ */ t("span", { className: "w-12 shrink-0 text-xs text-gray-400", children: "导航名称" }),
896
+ /* @__PURE__ */ t("span", { title: d, className: "min-w-0 truncate text-sm font-medium text-gray-800", children: d || "尚未填写" }),
897
+ /* @__PURE__ */ t(Se, { enabled: !!e.navEnabled, children: e.navEnabled ? "已开启" : "已关闭" })
898
+ ] }),
899
+ e.navEnabled && ["header", "footer"].map((h) => {
900
+ const u = c.find((A) => A.position === h);
901
+ if (!u) return null;
902
+ const y = r[Dt(e.host ?? "", h)], f = u.parentNavId ? y == null ? void 0 : y.names[u.parentNavId] : void 0, N = n && e.host && (!y || y.status === "loading"), _ = u.parentNavId ? f ? `${f} 分组内` : N ? "正在加载分组…" : "分组名称加载失败" : "直接显示链接", z = h === "header" ? "页眉" : "页尾";
903
+ return /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
904
+ /* @__PURE__ */ t("span", { className: "w-12 shrink-0 text-gray-400", children: z }),
905
+ /* @__PURE__ */ t("span", { title: `${z}:${_}`, className: "truncate text-gray-600", children: _ }),
906
+ u.parentNavId && (y == null ? void 0 : y.status) === "error" && /* @__PURE__ */ t("button", { type: "button", onClick: a, className: "shrink-0 cursor-pointer text-blue-600 hover:underline", children: "重试" })
907
+ ] }, h);
908
+ }),
909
+ e.navEnabled && !c.length && /* @__PURE__ */ t("p", { className: "text-xs leading-5 text-amber-700", children: "未设置展示位置" })
910
+ ] });
911
+ }
912
+ const $a = () => {
913
+ const { navigate: e } = Xe(), { basePath: r, service: n } = Ee(), [a, c] = Pt(), [d, g] = S(""), [h, u] = S(""), [y, f] = S(!1), [N, _] = S([]), [z, A] = S({}), [W, V] = S(0), [R, H] = S({
764
914
  current: 1,
765
915
  size: 15,
766
916
  total: 0
767
- }), I = (p) => {
768
- const T = p.trim();
917
+ }), F = (b) => {
918
+ const T = b.trim();
769
919
  if (!T) return "";
770
920
  try {
771
921
  return new URL(
@@ -774,464 +924,1107 @@ const wn = () => {
774
924
  } catch {
775
925
  return T;
776
926
  }
777
- }, H = async (p = P.current, T = P.size, O = u, b = $) => {
778
- m(!0);
927
+ }, M = async (b = R.current, T = R.size, O = d, p = h) => {
928
+ f(!0);
779
929
  try {
780
- const w = { page: p, size: T };
781
- O && (w.pathname = O);
782
- const R = I(b);
783
- R && (w.host = R);
784
- const L = await r.getList(w);
785
- W(L.items), E((g) => ({
786
- ...g,
787
- current: p,
930
+ const C = { page: b, size: T };
931
+ O && (C.pathname = O);
932
+ const L = F(p);
933
+ L && (C.host = L);
934
+ const q = await n.getList(C);
935
+ _(q.items), H((k) => ({
936
+ ...k,
937
+ current: b,
788
938
  size: T,
789
- total: L.total ?? g.total
939
+ total: q.total ?? k.total
790
940
  }));
791
- } catch (w) {
792
- Z.error(w.message || "获取数据失败");
941
+ } catch (C) {
942
+ ae.error(C.message || "获取文章失败");
793
943
  } finally {
794
- m(!1);
944
+ f(!1);
795
945
  }
796
946
  };
797
- K(() => {
798
- H(1);
799
- }, []);
800
- const B = (p) => {
801
- n.confirm({
802
- title: "确认删除",
803
- content: `确认删除 /${p.pathname}?`,
947
+ te(() => {
948
+ M(1);
949
+ }, []), te(() => {
950
+ if (!n.getNavigationGroups) return;
951
+ let b = !0;
952
+ const T = /* @__PURE__ */ new Map();
953
+ for (const O of N)
954
+ if (O.host)
955
+ for (const p of O.navPlacements ?? []) {
956
+ if (!p.parentNavId) continue;
957
+ const C = O.host.trim().replace(/\/+$/, "");
958
+ T.set(Dt(C, p.position), { host: C, position: p.position });
959
+ }
960
+ A(Object.fromEntries([...T.keys()].map((O) => [O, { status: "loading", names: {} }])));
961
+ for (const [O, p] of T)
962
+ (async () => {
963
+ try {
964
+ const C = await n.getNavigationGroups(p);
965
+ if (!b) return;
966
+ A((L) => ({ ...L, [O]: { status: "loaded", names: Object.fromEntries(C.map((q) => [q.id, q.name])) } }));
967
+ } catch {
968
+ if (!b) return;
969
+ A((C) => ({ ...C, [O]: { status: "error", names: {} } }));
970
+ }
971
+ })();
972
+ return () => {
973
+ b = !1;
974
+ };
975
+ }, [N, n, W]);
976
+ const D = (b) => {
977
+ a.confirm({
978
+ title: "删除文章",
979
+ content: `确认删除 /${b.pathname}?`,
804
980
  okText: "删除",
805
981
  okType: "danger",
806
982
  cancelText: "取消",
807
983
  onOk: async () => {
808
- await r.delete(p.id), Z.success("删除成功"), H(1);
984
+ await n.delete(b.id), ae.success("删除成功"), M(1);
809
985
  }
810
986
  });
811
- }, z = Math.ceil(P.total / P.size) || 1;
812
- return /* @__PURE__ */ l("div", { className: "bg-white rounded-xl shadow-sm border border-gray-100 p-5", children: [
813
- s,
814
- /* @__PURE__ */ l(
987
+ }, v = Math.ceil(R.total / R.size) || 1;
988
+ return /* @__PURE__ */ s("div", { className: "min-w-0 bg-white rounded-xl shadow-sm border border-gray-100 p-5", children: [
989
+ c,
990
+ /* @__PURE__ */ s(
815
991
  "form",
816
992
  {
817
- className: "flex items-center gap-2 mb-5",
818
- onSubmit: (p) => {
819
- p.preventDefault(), H(1);
993
+ className: "flex flex-wrap items-center gap-2 mb-5",
994
+ onSubmit: (b) => {
995
+ b.preventDefault(), M(1);
820
996
  },
821
997
  children: [
822
- /* @__PURE__ */ l("div", { className: "relative w-52", children: [
823
- /* @__PURE__ */ a(we, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
824
- /* @__PURE__ */ a(
998
+ /* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
999
+ /* @__PURE__ */ t(ze, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
1000
+ /* @__PURE__ */ t(
825
1001
  "input",
826
1002
  {
827
1003
  className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
828
- placeholder: "搜索 Pathname",
829
- value: u,
830
- onChange: (p) => y(p.target.value)
1004
+ "aria-label": "搜索访问路径",
1005
+ placeholder: "搜索访问路径",
1006
+ value: d,
1007
+ onChange: (b) => g(b.target.value)
831
1008
  }
832
1009
  )
833
1010
  ] }),
834
- /* @__PURE__ */ l("div", { className: "relative w-52", children: [
835
- /* @__PURE__ */ a(we, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
836
- /* @__PURE__ */ a(
1011
+ /* @__PURE__ */ s("div", { className: "relative w-full sm:w-52", children: [
1012
+ /* @__PURE__ */ t(ze, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400" }),
1013
+ /* @__PURE__ */ t(
837
1014
  "input",
838
1015
  {
839
1016
  className: "w-full pl-9 pr-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
840
- placeholder: "搜索 Website URL",
841
- value: $,
842
- onChange: (p) => M(p.target.value)
1017
+ "aria-label": "搜索网站地址",
1018
+ placeholder: "搜索网站地址",
1019
+ value: h,
1020
+ onChange: (b) => u(b.target.value)
843
1021
  }
844
1022
  )
845
1023
  ] }),
846
- /* @__PURE__ */ l(
1024
+ /* @__PURE__ */ s(
847
1025
  "button",
848
1026
  {
849
1027
  type: "submit",
850
1028
  className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
851
1029
  children: [
852
- /* @__PURE__ */ a(we, { className: "w-3.5 h-3.5" }),
1030
+ /* @__PURE__ */ t(ze, { className: "w-3.5 h-3.5" }),
853
1031
  "搜索"
854
1032
  ]
855
1033
  }
856
1034
  ),
857
- /* @__PURE__ */ l(
1035
+ /* @__PURE__ */ s(
858
1036
  "button",
859
1037
  {
860
1038
  type: "button",
861
1039
  className: "flex items-center gap-1.5 px-3 py-1.5 border border-gray-200 hover:bg-gray-50 text-gray-600 text-sm rounded-lg transition cursor-pointer",
862
1040
  onClick: () => {
863
- y(""), M(""), H(1, P.size, "", "");
1041
+ g(""), u(""), M(1, R.size, "", "");
864
1042
  },
865
1043
  children: [
866
- /* @__PURE__ */ a(Jt, { className: "w-3.5 h-3.5" }),
1044
+ /* @__PURE__ */ t(Wr, { className: "w-3.5 h-3.5" }),
867
1045
  "重置"
868
1046
  ]
869
1047
  }
870
1048
  ),
871
- /* @__PURE__ */ a("div", { className: "flex-1" }),
872
- /* @__PURE__ */ l(
873
- "button",
874
- {
875
- type: "button",
876
- className: "flex items-center gap-1.5 px-3 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition cursor-pointer",
877
- onClick: () => e(`${t}/create`),
878
- children: [
879
- /* @__PURE__ */ a(Ft, { className: "w-3.5 h-3.5" }),
880
- "新增"
881
- ]
882
- }
883
- )
1049
+ /* @__PURE__ */ t("div", { className: "flex-1" }),
1050
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => e(`${r}/create`), className: "flex cursor-pointer items-center gap-1.5 rounded-lg bg-blue-500 px-3 py-1.5 text-sm text-white transition hover:bg-blue-600", children: [
1051
+ /* @__PURE__ */ t(et, { size: 14, "aria-hidden": "true" }),
1052
+ "新增文章"
1053
+ ] })
884
1054
  ]
885
1055
  }
886
1056
  ),
887
- /* @__PURE__ */ a("div", { className: "relative", children: /* @__PURE__ */ l("table", { className: "w-full text-sm", children: [
888
- /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ l("tr", { className: "border-b border-gray-100", children: [
889
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-44", children: "Pathname" }),
890
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-44", children: "Website URL" }),
891
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide", children: "HTML 摘要" }),
892
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-44", children: "创建时间" }),
893
- /* @__PURE__ */ a("th", { className: "text-left py-2.5 px-3 font-medium text-gray-400 text-xs uppercase tracking-wide w-56", children: "操作" })
1057
+ /* @__PURE__ */ t("div", { className: "relative overflow-x-auto", role: "region", "aria-label": "文章列表", tabIndex: 0, children: /* @__PURE__ */ s("table", { className: "w-full min-w-[1120px] table-fixed text-left text-sm", children: [
1058
+ /* @__PURE__ */ s("colgroup", { children: [
1059
+ /* @__PURE__ */ t("col", { style: { width: "8%" } }),
1060
+ /* @__PURE__ */ t("col", { style: { width: "16%" } }),
1061
+ /* @__PURE__ */ t("col", { style: { width: "24%" } }),
1062
+ /* @__PURE__ */ t("col", { style: { width: "23%" } }),
1063
+ /* @__PURE__ */ t("col", { style: { width: "13%" } }),
1064
+ /* @__PURE__ */ t("col", { style: { width: "16%" } })
1065
+ ] }),
1066
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ s("tr", { className: "border-b border-gray-100", children: [
1067
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "访问路径" }),
1068
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "访问地址" }),
1069
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "Guides 配置" }),
1070
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "网站导航" }),
1071
+ /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "创建时间" }),
1072
+ /* @__PURE__ */ t("th", { scope: "col", className: "sticky right-0 z-10 bg-white px-3 py-2.5 text-right text-xs font-medium tracking-wide text-gray-400", children: "操作" })
894
1073
  ] }) }),
895
- /* @__PURE__ */ a("tbody", { children: j ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: 5, className: "py-16 text-center", children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
896
- /* @__PURE__ */ a(Vt, { className: "w-6 h-6 text-blue-400 animate-spin" }),
897
- /* @__PURE__ */ a("span", { className: "text-sm", children: "加载中…" })
898
- ] }) }) }) : S.length === 0 ? /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: 5, className: "py-16 text-center", children: /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2 text-gray-300", children: [
899
- /* @__PURE__ */ a(Ht, { className: "w-10 h-10" }),
900
- /* @__PURE__ */ a("span", { className: "text-sm", children: "暂无数据" })
901
- ] }) }) }) : S.map((p) => {
902
- const T = (p.content || "").replace(/<[^>]+>/g, " ").replace(/\s+/g, " ").trim().slice(0, 80);
903
- return /* @__PURE__ */ l(
904
- "tr",
905
- {
906
- className: "border-b border-gray-50 hover:bg-gray-50/60 transition-colors",
907
- children: [
908
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: /* @__PURE__ */ l("span", { className: "font-mono text-xs text-gray-700", children: [
909
- "/",
910
- p.pathname
911
- ] }) }),
912
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: p.host ? /* @__PURE__ */ l(
913
- "a",
914
- {
915
- href: p.host,
916
- target: "_blank",
917
- rel: "noopener noreferrer",
918
- className: "inline-flex items-center gap-1 max-w-[160px] text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800 transition-colors",
919
- title: p.host,
920
- children: [
921
- /* @__PURE__ */ a("span", { className: "truncate", children: p.host.replace(/^https?:\/\//, "") }),
922
- /* @__PURE__ */ a(_t, { className: "w-3 h-3 shrink-0" })
923
- ]
924
- }
925
- ) : /* @__PURE__ */ a("span", { className: "text-xs text-gray-300", children: "—" }) }),
926
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: T ? /* @__PURE__ */ a(
927
- "span",
928
- {
929
- className: "text-sm text-gray-500 truncate block max-w-sm",
930
- title: T,
931
- children: T
932
- }
933
- ) : /* @__PURE__ */ a("span", { className: "text-xs text-gray-300", children: "暂无内容" }) }),
934
- /* @__PURE__ */ a("td", { className: "py-3 px-3 text-xs text-gray-400", children: p.createdAt ? De(p.createdAt).format(
935
- "YYYY/MM/DD HH:mm"
936
- ) : "—" }),
937
- /* @__PURE__ */ a("td", { className: "py-3 px-3", children: /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
938
- p.host && /* @__PURE__ */ a(
939
- "button",
940
- {
941
- className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
942
- onClick: () => window.open(
943
- `${p.host.replace(/\/$/, "")}/${p.pathname}`,
944
- "_blank"
945
- ),
946
- children: "跳转"
947
- }
948
- ),
949
- /* @__PURE__ */ a(
950
- "button",
951
- {
952
- className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 text-gray-600 transition cursor-pointer",
953
- onClick: () => e(
954
- `${t}/${p.id}/detail`,
955
- { state: { record: p } }
956
- ),
957
- children: "详情"
958
- }
959
- ),
960
- /* @__PURE__ */ a(
961
- "button",
962
- {
963
- className: "px-2.5 py-1 text-xs bg-blue-500 hover:bg-blue-600 text-white rounded-md transition cursor-pointer",
964
- onClick: () => e(
965
- `${t}/${p.id}/edit`,
966
- { state: { record: p } }
967
- ),
968
- children: "编辑"
969
- }
970
- ),
971
- /* @__PURE__ */ a(
972
- "button",
973
- {
974
- className: "px-2.5 py-1 text-xs bg-red-500 hover:bg-red-600 text-white rounded-md transition cursor-pointer",
975
- onClick: () => B(p),
976
- children: "删除"
977
- }
978
- )
979
- ] }) })
980
- ]
981
- },
982
- p.id
983
- );
1074
+ /* @__PURE__ */ t("tbody", { children: y || N.length === 0 ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: 6, className: "py-16 text-center", children: /* @__PURE__ */ s("div", { className: "flex flex-col items-center gap-2 text-gray-400", children: [
1075
+ y ? /* @__PURE__ */ t(Pe, { className: "h-6 w-6 animate-spin text-blue-400" }) : /* @__PURE__ */ t(Or, { className: "h-10 w-10 text-gray-300" }),
1076
+ /* @__PURE__ */ t("span", { className: "text-sm", children: y ? "正在加载文章…" : "暂无文章" })
1077
+ ] }) }) }) : N.map((b) => {
1078
+ const T = `/${b.pathname.replace(/^\/+/, "")}`, O = b.host ? `${b.host.replace(/\/+$/, "")}${T}` : void 0;
1079
+ return /* @__PURE__ */ s("tr", { className: "group border-b border-gray-50 transition-colors hover:bg-gray-50/60", children: [
1080
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: /* @__PURE__ */ t("button", { type: "button", onClick: () => e(`${r}/${b.id}/detail`, { state: { record: b } }), title: T, className: "block max-w-full cursor-pointer truncate text-left font-mono text-xs text-gray-700 hover:text-blue-600 focus-visible:outline-2 focus-visible:outline-blue-500", children: T }) }),
1081
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: O ? /* @__PURE__ */ s("a", { href: O, target: "_blank", rel: "noopener noreferrer", title: O, className: "inline-flex max-w-full items-center gap-1 text-xs text-blue-600 underline underline-offset-2 hover:text-blue-800", children: [
1082
+ /* @__PURE__ */ t("span", { className: "truncate", children: O.replace(/^https?:\/\//, "") }),
1083
+ /* @__PURE__ */ t(kr, { size: 12, className: "shrink-0", "aria-hidden": "true" })
1084
+ ] }) : /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "未填写" }) }),
1085
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: /* @__PURE__ */ t(Jr, { article: b }) }),
1086
+ /* @__PURE__ */ t("td", { className: "px-3 py-3 align-middle", children: /* @__PURE__ */ t(Xr, { article: b, groups: z, canLoadGroups: !!n.getNavigationGroups, onRetry: () => V((p) => p + 1) }) }),
1087
+ /* @__PURE__ */ t("td", { className: "whitespace-nowrap px-3 py-3 align-middle text-xs text-gray-400", children: b.createdAt ? Be(b.createdAt).format("YYYY/MM/DD HH:mm") : "—" }),
1088
+ /* @__PURE__ */ t("td", { className: "sticky right-0 z-10 bg-white px-3 py-3 text-right align-middle transition-colors group-hover:bg-gray-50", children: /* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-1", children: [
1089
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => e(`${r}/${b.id}/detail`, { state: { record: b } }), className: "cursor-pointer whitespace-nowrap rounded-md border border-gray-200 px-2.5 py-1 text-xs text-gray-600 transition hover:bg-gray-50", children: "详情" }),
1090
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => e(`${r}/${b.id}/edit`), className: "cursor-pointer whitespace-nowrap rounded-md bg-blue-500 px-2.5 py-1 text-xs text-white transition hover:bg-blue-600", children: "编辑" }),
1091
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => D(b), className: "cursor-pointer whitespace-nowrap rounded-md bg-red-500 px-2.5 py-1 text-xs text-white transition hover:bg-red-600", children: "删除" })
1092
+ ] }) })
1093
+ ] }, b.id);
984
1094
  }) })
985
1095
  ] }) }),
986
- P.total > 0 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between pt-4 mt-2 border-t border-gray-100", children: [
987
- /* @__PURE__ */ l("span", { className: "text-xs text-gray-400", children: [
1096
+ R.total > 0 && /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3 pt-4 mt-2 border-t border-gray-100", children: [
1097
+ /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
988
1098
  "共 ",
989
- P.total,
990
- " 条"
1099
+ R.total,
1100
+ " 篇文章"
991
1101
  ] }),
992
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
993
- /* @__PURE__ */ a(
1102
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-1", children: [
1103
+ /* @__PURE__ */ t(
994
1104
  "button",
995
1105
  {
996
1106
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
997
- disabled: P.current <= 1,
998
- onClick: () => H(P.current - 1),
1107
+ disabled: R.current <= 1,
1108
+ onClick: () => M(R.current - 1),
999
1109
  children: "上一页"
1000
1110
  }
1001
1111
  ),
1002
- /* @__PURE__ */ l("span", { className: "px-3 py-1 text-xs text-gray-500", children: [
1003
- P.current,
1112
+ /* @__PURE__ */ s("span", { className: "px-3 py-1 text-xs text-gray-500", children: [
1113
+ R.current,
1004
1114
  " / ",
1005
- z
1115
+ v
1006
1116
  ] }),
1007
- /* @__PURE__ */ a(
1117
+ /* @__PURE__ */ t(
1008
1118
  "button",
1009
1119
  {
1010
1120
  className: "px-2.5 py-1 text-xs border border-gray-200 rounded-md hover:bg-gray-50 disabled:opacity-40 disabled:cursor-not-allowed text-gray-600 transition cursor-pointer",
1011
- disabled: P.current >= z,
1012
- onClick: () => H(P.current + 1),
1121
+ disabled: R.current >= v,
1122
+ onClick: () => M(R.current + 1),
1013
1123
  children: "下一页"
1014
1124
  }
1015
1125
  ),
1016
- /* @__PURE__ */ a(
1126
+ /* @__PURE__ */ t(
1017
1127
  "select",
1018
1128
  {
1129
+ "aria-label": "每页条数",
1019
1130
  className: "ml-2 text-xs border border-gray-200 rounded-md px-1.5 py-1 text-gray-600 focus:outline-none focus:ring-1 focus:ring-blue-400 cursor-pointer",
1020
- value: P.size,
1021
- onChange: (p) => H(1, Number(p.target.value)),
1022
- children: [10, 15, 20, 50].map((p) => /* @__PURE__ */ l("option", { value: p, children: [
1023
- p,
1131
+ value: R.size,
1132
+ onChange: (b) => M(1, Number(b.target.value)),
1133
+ children: [10, 15, 20, 50].map((b) => /* @__PURE__ */ s("option", { value: b, children: [
1134
+ b,
1024
1135
  " 条/页"
1025
- ] }, p))
1136
+ ] }, b))
1026
1137
  }
1027
1138
  )
1028
1139
  ] })
1029
1140
  ] })
1030
1141
  ] });
1031
1142
  };
1032
- async function Ve(e) {
1033
- const t = new AbortController(), r = setTimeout(() => t.abort(), 1e4);
1143
+ function It({ items: e, label: r, description: n, presentation: a = "inline", saveOrder: c, onSaved: d, onCancel: g }) {
1144
+ const h = we(), [u, y] = S(() => [...e]), [f, N] = S(!1), [_, z] = S(""), [A, W] = S(""), [V, R] = S(null), [H, F] = S(null), M = Y(null), D = Y(null), v = Y(null), b = Y(null), T = Y(/* @__PURE__ */ new Map()), O = Y(null), p = Y(!1), C = Y(!1);
1145
+ te(() => {
1146
+ p.current = !0;
1147
+ const i = T.current;
1148
+ return () => {
1149
+ p.current = !1, O.current && clearTimeout(O.current), i.forEach((o) => o.cancel());
1150
+ };
1151
+ }, []);
1152
+ const L = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, q = () => {
1153
+ var i;
1154
+ return Array.from(((i = D.current) == null ? void 0 : i.querySelectorAll("[data-order-id]")) ?? []);
1155
+ }, k = () => {
1156
+ b.current = new Map(q().map((i) => [i.dataset.orderId, i.getBoundingClientRect().top]));
1157
+ };
1158
+ bt(() => {
1159
+ const i = b.current;
1160
+ b.current = null;
1161
+ const o = q();
1162
+ if (T.current.forEach((j) => j.cancel()), T.current.clear(), !i || L()) return;
1163
+ o.map((j) => ({ row: j, delta: (i.get(j.dataset.orderId) ?? j.getBoundingClientRect().top) - j.getBoundingClientRect().top })).forEach(({ row: j, delta: G }) => {
1164
+ var J;
1165
+ j.dataset.orderId === ((J = v.current) == null ? void 0 : J.id) || Math.abs(G) < 1 || T.current.set(j, j.animate([
1166
+ { transform: `translateY(${G}px)` },
1167
+ { transform: "translateY(0)" }
1168
+ ], { duration: 210, easing: "cubic-bezier(0.22, 1, 0.36, 1)" }));
1169
+ });
1170
+ }, [u]);
1171
+ const l = u.some((i, o) => {
1172
+ var w;
1173
+ return i.id !== ((w = e[o]) == null ? void 0 : w.id);
1174
+ }), m = (i, o) => {
1175
+ const w = i + o;
1176
+ if (C.current || v.current || w < 0 || w >= u.length) return;
1177
+ const j = [...u];
1178
+ [j[i], j[w]] = [j[w], j[i]], k(), y(j), z(""), W(`${u[i].name}已移至第 ${w + 1} 位`);
1179
+ }, $ = (i, o) => {
1180
+ var J;
1181
+ if (C.current || v.current || !i.isPrimary || i.button !== 0) return;
1182
+ const w = i.currentTarget.closest("[data-order-id]");
1183
+ if (!w || !D.current) return;
1184
+ const j = w.getBoundingClientRect(), G = D.current.getBoundingClientRect();
1185
+ (J = D.current) == null || J.setPointerCapture(i.pointerId), v.current = { id: o.id, pointerId: i.pointerId, original: [...u], startX: i.clientX, offsetY: i.clientY - j.top, height: j.height, phase: "dragging" }, F({ item: o, index: u.findIndex((B) => B.id === o.id), height: j.height, top: j.top - G.top }), R(o.id), z(""), W(`已拿起${o.name},上下拖动调整顺序,按 Escape 取消。`);
1186
+ }, x = (i) => {
1187
+ const o = v.current;
1188
+ if (!o || o.phase !== "dragging" || o.pointerId !== i.pointerId || !D.current) return;
1189
+ const w = i.clientY, j = D.current.getBoundingClientRect(), G = Math.max(0, Math.min(j.height - o.height, w - j.top - o.offsetY)), J = Math.max(-16, Math.min(16, i.clientX - o.startX)), B = q(), re = G + o.height / 2, X = B.find((ee) => re >= ee.offsetTop && re <= ee.offsetTop + ee.offsetHeight), ne = X == null ? void 0 : X.dataset.orderId, ie = u.findIndex((ee) => ee.id === o.id), se = u.findIndex((ee) => ee.id === ne);
1190
+ if (X && ie >= 0 && se >= 0 && ie !== se && (ie < se ? re >= X.offsetTop + X.offsetHeight / 2 : re <= X.offsetTop + X.offsetHeight / 2)) {
1191
+ k();
1192
+ const ee = [...u], [Ie] = ee.splice(ie, 1);
1193
+ ee.splice(se, 0, Ie), y(ee);
1194
+ }
1195
+ M.current && (M.current.style.transform = `translate3d(${J}px, ${G}px, 0)`);
1196
+ }, E = (i = !1) => {
1197
+ var J, B;
1198
+ const o = v.current;
1199
+ if (!o || o.phase === "dropping") return;
1200
+ o.phase = "dropping", (J = D.current) != null && J.hasPointerCapture(o.pointerId) && D.current.releasePointerCapture(o.pointerId);
1201
+ const w = () => {
1202
+ v.current = null, O.current = null, R(null), F(null);
1203
+ };
1204
+ if (i) {
1205
+ k(), y(o.original), W("已取消本次拖动。"), w();
1206
+ return;
1207
+ }
1208
+ const j = u.findIndex((re) => re.id === o.id);
1209
+ W(`${((B = u[j]) == null ? void 0 : B.name) ?? r}已移至第 ${j + 1} 位。`);
1210
+ const G = q().find((re) => re.dataset.orderId === o.id);
1211
+ if (!M.current || !G || L()) {
1212
+ w();
1213
+ return;
1214
+ }
1215
+ M.current.dataset.dropping = "true", M.current.style.transform = `translate3d(0, ${G.offsetTop}px, 0)`, O.current = setTimeout(w, 190);
1216
+ }, P = async () => {
1217
+ if (!(!l || C.current || v.current)) {
1218
+ C.current = !0, N(!0), z("");
1219
+ try {
1220
+ const i = await c(u.map((o) => o.id));
1221
+ p.current && d(i);
1222
+ } catch (i) {
1223
+ if (p.current) {
1224
+ const o = i == null ? void 0 : i.status;
1225
+ z(o === 404 || o === 405 || o === 501 ? `当前服务暂不支持保存${r}顺序,请联系管理员开通。` : o === 409 ? `${r}已发生变化,请取消后重新打开排序。` : i instanceof Error ? i.message : "顺序保存失败,请重试");
1226
+ }
1227
+ } finally {
1228
+ C.current = !1, p.current && N(!1);
1229
+ }
1230
+ }
1231
+ };
1232
+ return /* @__PURE__ */ s("section", { "aria-labelledby": `${h}-title`, "aria-busy": f, className: a === "dialog" ? "p-6" : "mt-3 rounded-lg border border-gray-200 bg-white p-3", children: [
1233
+ /* @__PURE__ */ s("h3", { id: `${h}-title`, className: "text-sm font-medium text-gray-700", children: [
1234
+ r,
1235
+ "顺序"
1236
+ ] }),
1237
+ /* @__PURE__ */ t("p", { className: "mt-1 text-xs leading-5 text-gray-500", children: n }),
1238
+ /* @__PURE__ */ t("p", { id: `${h}-drag-hint`, className: "mt-1 text-xs text-gray-400", children: "拖动左侧手柄或点击上下箭头调整,完成后保存顺序。" }),
1239
+ /* @__PURE__ */ s(
1240
+ "ol",
1241
+ {
1242
+ ref: D,
1243
+ "aria-label": `${r}展示顺序`,
1244
+ className: `aisee-order-list relative mt-3 space-y-2 ${V ? "aisee-order-list--dragging select-none" : ""}`,
1245
+ onPointerMove: x,
1246
+ onPointerUp: (i) => {
1247
+ var o;
1248
+ ((o = v.current) == null ? void 0 : o.pointerId) === i.pointerId && E();
1249
+ },
1250
+ onPointerCancel: () => E(!0),
1251
+ onLostPointerCapture: () => E(!0),
1252
+ children: [
1253
+ u.map((i, o) => /* @__PURE__ */ s("li", { "data-order-id": i.id, className: `aisee-order-row relative flex min-w-0 items-center gap-2 rounded-lg border px-2.5 py-2 ${V === i.id ? "aisee-order-row--placeholder" : "border-gray-100 bg-white"}`, children: [
1254
+ /* @__PURE__ */ t(
1255
+ "button",
1256
+ {
1257
+ type: "button",
1258
+ "aria-label": `拖动 ${i.name}`,
1259
+ "aria-describedby": `${h}-drag-hint`,
1260
+ disabled: f,
1261
+ onPointerDown: (w) => $(w, i),
1262
+ onKeyDown: (w) => {
1263
+ w.key === "Escape" && v.current && (w.preventDefault(), w.stopPropagation(), E(!0)), (w.key === "ArrowUp" || w.key === "ArrowDown") && (w.preventDefault(), m(o, w.key === "ArrowUp" ? -1 : 1));
1264
+ },
1265
+ className: `flex h-8 w-8 shrink-0 touch-none select-none items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 focus-visible:outline-2 focus-visible:outline-blue-500 disabled:cursor-not-allowed disabled:opacity-30 ${V === i.id ? "cursor-grabbing" : "cursor-grab"}`,
1266
+ children: /* @__PURE__ */ t(ct, { size: 16, "aria-hidden": "true" })
1267
+ }
1268
+ ),
1269
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "w-5 shrink-0 text-xs text-gray-400", children: o + 1 }),
1270
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 break-words text-sm text-gray-700", children: i.name }),
1271
+ /* @__PURE__ */ t("button", { type: "button", "aria-label": `上移 ${i.name}`, disabled: f || o === 0, onClick: () => m(o, -1), className: "flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-gray-200 text-gray-500 enabled:hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-30", children: /* @__PURE__ */ t(hr, { size: 14, "aria-hidden": "true" }) }),
1272
+ /* @__PURE__ */ t("button", { type: "button", "aria-label": `下移 ${i.name}`, disabled: f || o === u.length - 1, onClick: () => m(o, 1), className: "flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-md border border-gray-200 text-gray-500 enabled:hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-30", children: /* @__PURE__ */ t(lr, { size: 14, "aria-hidden": "true" }) }),
1273
+ V === i.id && /* @__PURE__ */ s("span", { "aria-hidden": "true", className: "aisee-order-placeholder-label", children: [
1274
+ "放到这里 · 第 ",
1275
+ o + 1,
1276
+ " 位"
1277
+ ] })
1278
+ ] }, i.id)),
1279
+ H && /* @__PURE__ */ t("li", { ref: M, "aria-hidden": "true", className: "aisee-order-floating", style: { height: H.height, transform: `translate3d(0, ${H.top}px, 0)` }, children: /* @__PURE__ */ s("div", { className: "aisee-order-floating-card", children: [
1280
+ /* @__PURE__ */ t(ct, { size: 16, className: "shrink-0 text-blue-500" }),
1281
+ /* @__PURE__ */ t("span", { className: "w-5 shrink-0 text-xs text-blue-400", children: H.index + 1 }),
1282
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 break-words text-sm font-medium text-gray-800", children: H.item.name }),
1283
+ /* @__PURE__ */ t("span", { className: "shrink-0 rounded-md bg-blue-100 px-2 py-1 text-xs font-medium text-blue-600", children: "拖动中" })
1284
+ ] }) })
1285
+ ]
1286
+ }
1287
+ ),
1288
+ /* @__PURE__ */ t("span", { role: "status", className: "sr-only", children: A }),
1289
+ _ && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: _ }),
1290
+ /* @__PURE__ */ s("div", { className: "mt-3 flex flex-wrap justify-end gap-2", children: [
1291
+ /* @__PURE__ */ t("button", { type: "button", disabled: f, onClick: g, className: "cursor-pointer rounded-lg border border-gray-200 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-50 disabled:opacity-50", children: "取消" }),
1292
+ /* @__PURE__ */ s("button", { type: "button", disabled: f || !l, onClick: () => void P(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-3 py-1.5 text-xs text-white hover:bg-blue-600 disabled:cursor-not-allowed disabled:opacity-50", children: [
1293
+ f && /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin", "aria-hidden": "true" }),
1294
+ f ? "保存中…" : "保存顺序"
1295
+ ] })
1296
+ ] })
1297
+ ] });
1298
+ }
1299
+ function Qr({ host: e, position: r, groups: n, reorder: a, onSaved: c, onCancel: d }) {
1300
+ return /* @__PURE__ */ t(
1301
+ It,
1302
+ {
1303
+ items: n,
1304
+ label: "父导航",
1305
+ description: "前台按此顺序从左到右展示。保存后对该网站的所有文章生效。",
1306
+ presentation: "dialog",
1307
+ saveOrder: (g) => a({ host: e, position: r, groupIds: g }),
1308
+ onSaved: c,
1309
+ onCancel: d
1310
+ }
1311
+ );
1312
+ }
1313
+ function Lt({ id: e, open: r, busy: n, label: a, onDismiss: c, children: d }) {
1314
+ const g = Y(null);
1315
+ return te(() => {
1316
+ var h, u, y;
1317
+ r && !((h = g.current) != null && h.open) && ((u = g.current) == null || u.showModal()), !r && ((y = g.current) != null && y.open) && g.current.close();
1318
+ }, [r]), /* @__PURE__ */ t("dialog", { ref: g, id: e, "aria-label": a, onCancel: (h) => {
1319
+ h.preventDefault(), n || c();
1320
+ }, className: "m-auto max-h-[85vh] w-[calc(100%_-_2rem)] max-w-xl overflow-y-auto rounded-2xl border border-gray-200 bg-white p-0 text-gray-700 shadow-xl backdrop:bg-black/30", children: d });
1321
+ }
1322
+ const en = [
1323
+ { position: "header", label: "页眉", icon: Pr, parentEnabled: !1 },
1324
+ { position: "footer", label: "页尾", icon: zr, parentEnabled: !0 }
1325
+ ], Fe = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
1326
+ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, parentNavId: d, onSelect: g }) {
1327
+ const h = we(), [u, y] = S([]), [f, N] = S(!1), [_, z] = S(""), [A, W] = S(!1), [V, R] = S(""), [H, F] = S(""), [M, D] = S(!1), [v, b] = S(!1), [T, O] = S(!1), [p, C] = S(!1), L = Y(0), q = Y(0), k = Y(g);
1328
+ k.current = g;
1329
+ const l = c.getNavigationGroups, m = c.createNavigationGroup, $ = c.reorderNavigationGroups, x = Me(async () => {
1330
+ if (!e || !l) return;
1331
+ const o = ++q.current;
1332
+ N(!0), z("");
1333
+ try {
1334
+ const w = await l({ host: e, position: r });
1335
+ return o !== q.current ? void 0 : (y(w), w);
1336
+ } catch (w) {
1337
+ o === q.current && z(w instanceof Error ? w.message : "父导航加载失败");
1338
+ } finally {
1339
+ o === q.current && N(!1);
1340
+ }
1341
+ }, [e, r, l]);
1342
+ te(() => (L.current++, x(), () => {
1343
+ L.current++, q.current++;
1344
+ }), [x]);
1345
+ const E = async () => {
1346
+ if (M || !m || !a) return;
1347
+ const o = V.trim();
1348
+ if (!o) {
1349
+ F("请输入父导航名称");
1350
+ return;
1351
+ }
1352
+ const w = u.find((G) => G.name === o);
1353
+ if (w) {
1354
+ k.current(w.id), W(!1);
1355
+ return;
1356
+ }
1357
+ const j = L.current;
1358
+ D(!0), F("");
1359
+ try {
1360
+ const G = await m({ host: e, position: r, name: o });
1361
+ if (j !== L.current) return;
1362
+ y((J) => [...J.filter((B) => B.id !== G.id), G]), k.current(G.id), W(!1), R(""), x();
1363
+ } catch (G) {
1364
+ if (j !== L.current) return;
1365
+ if ((G == null ? void 0 : G.status) === 409) {
1366
+ const J = await x();
1367
+ if (j !== L.current) return;
1368
+ const B = J == null ? void 0 : J.find((re) => re.name === o);
1369
+ if (B) {
1370
+ k.current(B.id), W(!1), R("");
1371
+ return;
1372
+ }
1373
+ }
1374
+ F(G instanceof Error ? G.message : "新增父导航失败");
1375
+ } finally {
1376
+ j === L.current && D(!1);
1377
+ }
1378
+ }, P = !!d && !u.some((o) => o.id === d), i = async () => {
1379
+ const o = L.current;
1380
+ O(!1);
1381
+ const w = await x();
1382
+ w && o === L.current && w.length > 1 && b(!0);
1383
+ };
1384
+ return /* @__PURE__ */ s("div", { children: [
1385
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex flex-wrap items-center justify-between gap-2", children: [
1386
+ /* @__PURE__ */ s("label", { htmlFor: h, className: "block text-sm font-medium text-gray-700", children: [
1387
+ "所属父导航 ",
1388
+ /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1389
+ ] }),
1390
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3", children: [
1391
+ a && $ && e && /* @__PURE__ */ s("button", { type: "button", disabled: f || M || A || v || !!_ || u.length < 2, "aria-haspopup": "dialog", "aria-expanded": v, "aria-controls": `${h}-dialog`, onClick: () => void i(), className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:cursor-not-allowed disabled:opacity-40", children: [
1392
+ /* @__PURE__ */ t($t, { size: 12, "aria-hidden": "true" }),
1393
+ "调整顺序"
1394
+ ] }),
1395
+ a && m && e && /* @__PURE__ */ s("button", { type: "button", disabled: f || M || A || v, "aria-label": `新增${n}父导航`, "aria-haspopup": "dialog", onClick: () => {
1396
+ W(!0), R(""), F(""), O(!1);
1397
+ }, className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1398
+ /* @__PURE__ */ t(et, { size: 13, "aria-hidden": "true" }),
1399
+ "新增父导航"
1400
+ ] })
1401
+ ] })
1402
+ ] }),
1403
+ /* @__PURE__ */ s(
1404
+ "select",
1405
+ {
1406
+ id: h,
1407
+ "aria-label": `${n}父导航`,
1408
+ disabled: !a || !e || f || M || A || v,
1409
+ value: d ?? "",
1410
+ onChange: (o) => g(o.target.value || null),
1411
+ className: `${Fe} disabled:cursor-not-allowed disabled:bg-gray-50 disabled:text-gray-400`,
1412
+ children: [
1413
+ /* @__PURE__ */ t("option", { value: "", children: a ? "不选分组(直接显示在页尾)" : "暂不支持设置" }),
1414
+ u.map((o) => /* @__PURE__ */ t("option", { value: o.id, children: o.name }, o.id)),
1415
+ P && /* @__PURE__ */ s("option", { value: d, children: [
1416
+ "已选父导航(",
1417
+ d,
1418
+ ")"
1419
+ ] })
1420
+ ]
1421
+ }
1422
+ ),
1423
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-400", children: a ? e ? d ? u.some((o) => o.id === d) ? `文章链接会显示在「${u.find((o) => o.id === d).name}」分组下。` : "文章链接会显示在所选分组下。" : "不选父导航时,链接直接显示在网站底部。" : "请先填写网站地址" : d ? "已保存的页眉父导航暂不可修改。" : "页眉目前只能直接显示文章链接。" }),
1424
+ f && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载父导航中…" }),
1425
+ _ && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
1426
+ _,
1427
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => void x(), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
1428
+ ] }),
1429
+ T && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-green-600", children: "父导航顺序已保存" }),
1430
+ /* @__PURE__ */ t(Lt, { id: `${h}-dialog`, open: v || A, busy: M || p, label: v ? "父导航顺序" : A ? `新增${n}父导航` : void 0, onDismiss: () => {
1431
+ W(!1), b(!1), F("");
1432
+ }, children: v && $ ? /* @__PURE__ */ t(
1433
+ Qr,
1434
+ {
1435
+ host: e,
1436
+ position: r,
1437
+ groups: u,
1438
+ reorder: async (o) => {
1439
+ const w = L.current;
1440
+ C(!0);
1441
+ try {
1442
+ return await $(o);
1443
+ } finally {
1444
+ w === L.current && C(!1);
1445
+ }
1446
+ },
1447
+ onSaved: (o) => {
1448
+ y(o), b(!1), O(!0);
1449
+ },
1450
+ onCancel: () => b(!1)
1451
+ }
1452
+ ) : A ? /* @__PURE__ */ s("div", { className: "p-6", children: [
1453
+ /* @__PURE__ */ s("h3", { className: "text-sm font-medium text-gray-700", children: [
1454
+ "新增",
1455
+ n,
1456
+ "父导航"
1457
+ ] }),
1458
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-new`, className: "mb-1.5 mt-3 block text-xs text-gray-600", children: [
1459
+ "父导航名称 ",
1460
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1461
+ ] }),
1462
+ /* @__PURE__ */ t(
1463
+ "input",
1464
+ {
1465
+ id: `${h}-new`,
1466
+ autoFocus: !0,
1467
+ maxLength: 100,
1468
+ value: V,
1469
+ disabled: M,
1470
+ placeholder: "输入父导航名称",
1471
+ "aria-invalid": !!H,
1472
+ "aria-describedby": H ? `${h}-error` : void 0,
1473
+ onChange: (o) => {
1474
+ R(o.target.value), F("");
1475
+ },
1476
+ onKeyDown: (o) => {
1477
+ o.key === "Enter" && !o.nativeEvent.isComposing && (o.preventDefault(), E());
1478
+ },
1479
+ className: Fe
1480
+ }
1481
+ ),
1482
+ H && /* @__PURE__ */ t("p", { id: `${h}-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: H }),
1483
+ /* @__PURE__ */ s("div", { className: "mt-2 flex flex-wrap gap-2", children: [
1484
+ /* @__PURE__ */ s("button", { type: "button", disabled: M, onClick: () => void E(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-2.5 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
1485
+ M ? /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ t(Ct, { size: 12, "aria-hidden": "true" }),
1486
+ M ? "添加中…" : "添加并选中"
1487
+ ] }),
1488
+ /* @__PURE__ */ s("button", { type: "button", disabled: M, onClick: () => W(!1), className: "flex cursor-pointer items-center gap-1 rounded-lg px-2.5 py-1.5 text-xs text-gray-500 hover:bg-gray-100 disabled:opacity-50", children: [
1489
+ /* @__PURE__ */ t(Et, { size: 12, "aria-hidden": "true" }),
1490
+ "取消"
1491
+ ] })
1492
+ ] })
1493
+ ] }) : null })
1494
+ ] });
1495
+ }
1496
+ function rn({ host: e, service: r, value: n, onChange: a }) {
1497
+ const c = we(), d = e.trim().replace(/\/+$/, ""), [g, h] = S(!1), u = !!r.getNavigationGroups, y = (N) => a({ ...n, ...N }), f = (N, _) => {
1498
+ y({
1499
+ navPlacements: _ ? [...n.navPlacements, { position: N, parentNavId: null }] : n.navPlacements.filter((z) => z.position !== N)
1500
+ });
1501
+ };
1502
+ return /* @__PURE__ */ s("section", { "aria-label": "导航设置", className: "mt-5 border-t border-gray-100 pt-5", children: [
1503
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-3", children: [
1504
+ /* @__PURE__ */ t("h2", { className: "text-sm font-semibold text-gray-800", children: "导航设置" }),
1505
+ /* @__PURE__ */ s("label", { htmlFor: `${c}-enabled`, className: "flex cursor-pointer items-center gap-2 text-sm text-gray-600", children: [
1506
+ /* @__PURE__ */ t("span", { children: "启用导航" }),
1507
+ /* @__PURE__ */ s("span", { className: "relative inline-flex h-5 w-9 shrink-0 items-center", children: [
1508
+ /* @__PURE__ */ t(
1509
+ "input",
1510
+ {
1511
+ id: `${c}-enabled`,
1512
+ type: "checkbox",
1513
+ role: "switch",
1514
+ checked: n.navEnabled,
1515
+ disabled: !u,
1516
+ "aria-controls": `${c}-fields`,
1517
+ onChange: (N) => y({ navEnabled: N.target.checked }),
1518
+ className: "peer absolute inset-0 z-10 m-0 h-full w-full cursor-pointer opacity-0 disabled:cursor-not-allowed"
1519
+ }
1520
+ ),
1521
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "absolute inset-0 rounded-full bg-gray-200 transition peer-checked:bg-blue-500 peer-disabled:opacity-50 peer-focus-visible:outline-2 peer-focus-visible:outline-offset-2 peer-focus-visible:outline-blue-500" }),
1522
+ /* @__PURE__ */ t("span", { "aria-hidden": "true", className: "pointer-events-none relative ml-0.5 h-4 w-4 rounded-full bg-white shadow-sm transition-transform peer-checked:translate-x-4" })
1523
+ ] })
1524
+ ] })
1525
+ ] }),
1526
+ u && n.navEnabled && /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs leading-5 text-gray-500", children: "在网站顶部或底部显示这篇文章的链接。" }),
1527
+ u ? n.navEnabled ? /* @__PURE__ */ s("div", { id: `${c}-fields`, className: "mt-4 space-y-4 rounded-xl border border-gray-200 bg-gray-50/40 p-4", children: [
1528
+ /* @__PURE__ */ s("div", { className: "max-w-3xl", children: [
1529
+ /* @__PURE__ */ s("label", { htmlFor: `${c}-name`, className: "mb-1.5 block text-sm font-medium text-gray-700", children: [
1530
+ "导航名称 ",
1531
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1532
+ ] }),
1533
+ /* @__PURE__ */ t(
1534
+ "input",
1535
+ {
1536
+ id: `${c}-name`,
1537
+ value: n.navname,
1538
+ maxLength: 100,
1539
+ placeholder: "输入导航名称",
1540
+ required: !0,
1541
+ "aria-invalid": g && !n.navname.trim(),
1542
+ "aria-describedby": g && !n.navname.trim() ? `${c}-name-error` : void 0,
1543
+ onChange: (N) => y({ navname: N.target.value }),
1544
+ onBlur: () => h(!0),
1545
+ className: Fe
1546
+ }
1547
+ ),
1548
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-400", children: "前台显示的链接名称,例如「关于我们」。" }),
1549
+ g && !n.navname.trim() && /* @__PURE__ */ t("p", { id: `${c}-name-error`, role: "alert", className: "mt-1.5 text-xs text-red-500", children: "开启导航后,请填写导航名称" })
1550
+ ] }),
1551
+ /* @__PURE__ */ s("fieldset", { "aria-describedby": `${c}-placements-hint`, className: "min-w-0", children: [
1552
+ /* @__PURE__ */ s("legend", { className: "mb-1.5 text-sm font-medium text-gray-700", children: [
1553
+ "展示位置 ",
1554
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1555
+ ] }),
1556
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: en.map(({ position: N, label: _, icon: z, parentEnabled: A }) => {
1557
+ const W = n.navPlacements.find((V) => V.position === N);
1558
+ return /* @__PURE__ */ s("div", { role: "group", "aria-label": `${_}导航设置`, className: `min-w-0 self-start rounded-lg border p-3 transition-colors ${W ? "border-blue-200 bg-blue-50/30" : "border-gray-200 bg-white"}`, children: [
1559
+ /* @__PURE__ */ s("label", { className: "flex cursor-pointer items-center gap-2.5 text-sm text-gray-700", children: [
1560
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!W, onChange: (V) => f(N, V.target.checked), className: "h-4 w-4 shrink-0 accent-blue-500" }),
1561
+ /* @__PURE__ */ t(z, { size: 15, className: "shrink-0 text-gray-400", "aria-hidden": "true" }),
1562
+ /* @__PURE__ */ t("span", { className: "font-medium", children: _ })
1563
+ ] }),
1564
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-500", children: N === "header" ? "文章链接显示在网站顶部。" : "文章链接显示在网站底部。" }),
1565
+ W && /* @__PURE__ */ t("div", { className: "mt-3 border-t border-gray-200/70 pt-3", children: /* @__PURE__ */ t(
1566
+ tn,
1567
+ {
1568
+ host: d,
1569
+ position: N,
1570
+ label: _,
1571
+ parentEnabled: A,
1572
+ service: r,
1573
+ parentNavId: W.parentNavId,
1574
+ onSelect: (V) => y({ navPlacements: n.navPlacements.map((R) => R.position === N ? { ...R, parentNavId: V } : R) })
1575
+ },
1576
+ `${d}:${N}`
1577
+ ) })
1578
+ ] }, N);
1579
+ }) }),
1580
+ /* @__PURE__ */ t("p", { id: `${c}-placements-hint`, className: "mt-1.5 text-xs text-gray-400", children: "可以同时勾选页眉和页尾。" }),
1581
+ n.navPlacements.length === 0 && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: "请至少选择一个展示位置" })
1582
+ ] })
1583
+ ] }) : /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-500", children: "开启后可将文章加入页眉、页尾或同时加入两处。" }) : /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs text-gray-500", children: "当前服务尚未接入导航配置" })
1584
+ ] });
1585
+ }
1586
+ const fe = "w-full min-w-0 rounded-lg border border-gray-200 bg-white px-3 py-2 text-sm text-gray-700 outline-none transition focus:border-blue-400 focus:ring-2 focus:ring-blue-500/20";
1587
+ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a, onSaveCategory: c, onLoadCategories: d, onReorderCategories: g }) {
1588
+ const h = we(), [u, y] = S(null), [f, N] = S(""), [_, z] = S(!1), [A, W] = S(""), [V, R] = S(!1), [H, F] = S(null), [M, D] = S(!1), [v, b] = S(""), [T, O] = S(!1), p = !!u || !!H, C = Y(!1), L = Y(!1), q = Y(!1);
1589
+ te(() => (L.current = !0, () => {
1590
+ L.current = !1;
1591
+ }), []);
1592
+ const k = r.find((i) => i.id === e.categoryId), l = e.categoryId ? void 0 : e.category, m = (k == null ? void 0 : k.description) ?? (l == null ? void 0 : l.description), $ = Y(e);
1593
+ $.current = e;
1594
+ const x = (i) => a({ ...e, ...i }), E = async () => {
1595
+ if (!(C.current || !g || n || u || H)) {
1596
+ C.current = !0, D(!0), b(""), W("");
1597
+ try {
1598
+ const i = d ? await d() : r;
1599
+ L.current && F(i);
1600
+ } catch (i) {
1601
+ L.current && b(i instanceof Error ? i.message : "分类加载失败,请重试");
1602
+ } finally {
1603
+ C.current = !1, L.current && D(!1);
1604
+ }
1605
+ }
1606
+ }, P = async () => {
1607
+ if (!u || !c || q.current) return;
1608
+ const i = u.name.trim();
1609
+ if (!i) {
1610
+ N("请输入分类名称");
1611
+ return;
1612
+ }
1613
+ if (r.some((o) => o.id !== u.id && o.name === i)) {
1614
+ N("该分类名称已存在,请选择已有分类或使用其他名称");
1615
+ return;
1616
+ }
1617
+ q.current = !0, R(!0), N("");
1618
+ try {
1619
+ const o = await c({ ...u.id ? { id: u.id } : {}, name: i, description: u.description.trim() });
1620
+ if (!L.current) return;
1621
+ a({ ...$.current, categoryId: o.id }), W(u.id ? "分类已更新" : "分类已新增并选中"), y(null);
1622
+ } catch (o) {
1623
+ L.current && N(o instanceof Error ? o.message : "分类保存失败,请重试");
1624
+ } finally {
1625
+ q.current = !1, L.current && R(!1);
1626
+ }
1627
+ };
1628
+ return /* @__PURE__ */ s("section", { "aria-labelledby": `${h}-heading`, className: "mt-5 border-t border-gray-100 pt-5", children: [
1629
+ /* @__PURE__ */ t("h2", { id: `${h}-heading`, className: "text-sm font-semibold text-gray-800", children: "Guides 展示设置" }),
1630
+ /* @__PURE__ */ t("p", { className: "mt-1.5 text-xs leading-5 text-gray-500", children: "用于 Guides 页面的文章展示,分类可选。" }),
1631
+ /* @__PURE__ */ s("div", { className: "mt-4 grid grid-cols-1 gap-x-6 gap-y-4 rounded-xl border border-gray-200 bg-gray-50/40 p-4 lg:grid-cols-3", children: [
1632
+ /* @__PURE__ */ s("div", { className: "lg:col-span-2", children: [
1633
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
1634
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-title`, className: "text-sm font-medium text-gray-700", children: [
1635
+ "文章标题 ",
1636
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1637
+ ] }),
1638
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "用于文章卡片" })
1639
+ ] }),
1640
+ /* @__PURE__ */ t("input", { id: `${h}-title`, value: e.title, maxLength: 200, required: !0, placeholder: "例如 White-Hat GEO: Ethical Optimization for AI Search", onChange: (i) => x({ title: i.target.value }), onBlur: () => z(!0), "aria-invalid": _ && !e.title.trim(), "aria-describedby": `${h}-title-hint`, className: fe }),
1641
+ /* @__PURE__ */ t("p", { id: `${h}-title-hint`, className: `mt-1.5 text-xs ${_ && !e.title.trim() ? "text-red-500" : "text-gray-400"}`, role: _ && !e.title.trim() ? "alert" : void 0, children: _ && !e.title.trim() ? "请输入文章展示标题" : "可使用比导航名称更完整的标题。" })
1642
+ ] }),
1643
+ /* @__PURE__ */ s("div", { children: [
1644
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex flex-wrap items-center justify-between gap-2", children: [
1645
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-category`, className: "text-sm font-medium text-gray-700", children: [
1646
+ "所属分类 ",
1647
+ /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1648
+ ] }),
1649
+ /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center gap-3", children: [
1650
+ g && /* @__PURE__ */ s("button", { type: "button", disabled: n || p || M || r.length < 2, "aria-haspopup": "dialog", "aria-expanded": !!H, "aria-controls": `${h}-dialog`, onClick: () => void E(), className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1651
+ /* @__PURE__ */ t($t, { size: 12, "aria-hidden": "true" }),
1652
+ "调整顺序"
1653
+ ] }),
1654
+ c && /* @__PURE__ */ s("button", { type: "button", disabled: n || p || M, "aria-haspopup": "dialog", onClick: () => {
1655
+ y({ id: null, name: "", description: "" }), N(""), W(""), b("");
1656
+ }, className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1657
+ /* @__PURE__ */ t(et, { size: 13, "aria-hidden": "true" }),
1658
+ "新增分类"
1659
+ ] })
1660
+ ] })
1661
+ ] }),
1662
+ /* @__PURE__ */ s("select", { id: `${h}-category`, value: l ? "__unresolved-category__" : e.categoryId ?? "", disabled: n || p || M, onChange: (i) => {
1663
+ x({ categoryId: i.target.value || null, category: void 0 }), W("");
1664
+ }, className: `${fe} disabled:bg-gray-50 disabled:text-gray-400`, children: [
1665
+ /* @__PURE__ */ t("option", { value: "", children: "不设置分类" }),
1666
+ l && /* @__PURE__ */ s("option", { value: "__unresolved-category__", disabled: !0, children: [
1667
+ l.name,
1668
+ "(请重新选择)"
1669
+ ] }),
1670
+ r.map((i) => /* @__PURE__ */ t("option", { value: i.id, children: i.name }, i.id)),
1671
+ e.categoryId && !k && /* @__PURE__ */ s("option", { value: e.categoryId, children: [
1672
+ "已选分类(",
1673
+ e.categoryId,
1674
+ ")"
1675
+ ] })
1676
+ ] }),
1677
+ /* @__PURE__ */ t("p", { className: `mt-1.5 text-xs ${l ? "text-amber-700" : "text-gray-400"}`, children: l ? "无法确认已保存的分类,请重新选择后保存。" : "可留空,不影响文章保存。" }),
1678
+ M && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载分类顺序中…" }),
1679
+ v && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: v }),
1680
+ A && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-green-600", children: A })
1681
+ ] }),
1682
+ /* @__PURE__ */ s("div", { className: k || l ? "lg:col-span-2" : "lg:col-span-3", children: [
1683
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
1684
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-description`, className: "text-sm font-medium text-gray-700", children: [
1685
+ "文章简介 ",
1686
+ /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1687
+ ] }),
1688
+ /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
1689
+ e.description.length,
1690
+ "/500"
1691
+ ] })
1692
+ ] }),
1693
+ /* @__PURE__ */ t("textarea", { id: `${h}-description`, rows: 2, maxLength: 500, value: e.description, placeholder: "简要介绍文章内容,展示在卡片标题下方", onChange: (i) => x({ description: i.target.value }), className: `${fe} resize-y leading-6` })
1694
+ ] }),
1695
+ (k || l) && /* @__PURE__ */ s("div", { className: "rounded-lg border border-gray-200 bg-white p-3", children: [
1696
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3", children: [
1697
+ /* @__PURE__ */ t("span", { className: "text-xs font-medium text-gray-500", children: "分类描述" }),
1698
+ k && c && /* @__PURE__ */ s("button", { type: "button", disabled: n || M, "aria-haspopup": "dialog", onClick: () => {
1699
+ y({ ...k }), N(""), W(""), b("");
1700
+ }, className: "flex shrink-0 cursor-pointer items-center gap-1 text-xs text-blue-500 hover:text-blue-600 disabled:opacity-40", children: [
1701
+ /* @__PURE__ */ t(St, { size: 12, "aria-hidden": "true" }),
1702
+ "编辑分类"
1703
+ ] })
1704
+ ] }),
1705
+ /* @__PURE__ */ t("p", { className: "mt-2 break-words text-xs leading-5 text-gray-500", children: m || "未填写分类描述" })
1706
+ ] })
1707
+ ] }),
1708
+ /* @__PURE__ */ t(Lt, { id: `${h}-dialog`, open: p, busy: V || T, label: H ? "分类顺序" : u ? u.id ? "编辑分类" : "新增分类" : void 0, onDismiss: () => {
1709
+ y(null), F(null), N("");
1710
+ }, children: H && g ? /* @__PURE__ */ t(
1711
+ It,
1712
+ {
1713
+ items: H,
1714
+ label: "分类",
1715
+ description: "Guides 页面按此顺序从上到下展示分类。保存后对该网站的所有文章生效,不改变文章所属分类。",
1716
+ presentation: "dialog",
1717
+ saveOrder: async (i) => {
1718
+ O(!0);
1719
+ try {
1720
+ return await g(i);
1721
+ } finally {
1722
+ L.current && O(!1);
1723
+ }
1724
+ },
1725
+ onSaved: () => {
1726
+ F(null), W("分类顺序已保存");
1727
+ },
1728
+ onCancel: () => F(null)
1729
+ }
1730
+ ) : u ? /* @__PURE__ */ s("fieldset", { disabled: V, className: "p-6", children: [
1731
+ /* @__PURE__ */ t("h3", { className: "text-sm font-medium text-gray-700", children: u.id ? "编辑分类" : "新增分类" }),
1732
+ /* @__PURE__ */ s("div", { className: "mt-3", children: [
1733
+ /* @__PURE__ */ s("label", { htmlFor: `${h}-category-name`, className: "mb-1.5 block text-xs text-gray-600", children: [
1734
+ "分类名称 ",
1735
+ /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1736
+ ] }),
1737
+ /* @__PURE__ */ t("input", { id: `${h}-category-name`, autoFocus: !0, maxLength: 100, value: u.name, "aria-invalid": !!f, "aria-describedby": f ? `${h}-category-error` : void 0, placeholder: "例如 Start with the foundations", onChange: (i) => {
1738
+ y({ ...u, name: i.target.value }), N("");
1739
+ }, className: fe })
1740
+ ] }),
1741
+ /* @__PURE__ */ s("div", { className: "mt-3", children: [
1742
+ /* @__PURE__ */ t("label", { htmlFor: `${h}-category-description`, className: "mb-1.5 block text-xs text-gray-600", children: "分类描述" }),
1743
+ /* @__PURE__ */ t("textarea", { id: `${h}-category-description`, rows: 3, maxLength: 500, value: u.description, placeholder: "介绍这个分类包含的内容,展示在分类名称下方", onChange: (i) => y({ ...u, description: i.target.value }), className: `${fe} resize-y leading-6` })
1744
+ ] }),
1745
+ u.id && /* @__PURE__ */ t("p", { className: "mt-2 text-xs leading-5 text-amber-700", children: "分类由多篇文章共用,修改名称和描述会同步影响该分类下的所有文章。" }),
1746
+ f && /* @__PURE__ */ t("p", { id: `${h}-category-error`, role: "alert", className: "mt-2 text-xs text-red-500", children: f }),
1747
+ /* @__PURE__ */ s("div", { className: "mt-3 flex flex-wrap gap-2", children: [
1748
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => void P(), className: "flex cursor-pointer items-center gap-1 rounded-lg bg-blue-500 px-3 py-1.5 text-xs text-white hover:bg-blue-600 disabled:opacity-50", children: [
1749
+ V ? /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin", "aria-hidden": "true" }) : /* @__PURE__ */ t(Ct, { size: 12, "aria-hidden": "true" }),
1750
+ V ? "保存中…" : u.id ? "保存分类" : "新增并选中"
1751
+ ] }),
1752
+ /* @__PURE__ */ s("button", { type: "button", onClick: () => {
1753
+ y(null), N("");
1754
+ }, className: "flex cursor-pointer items-center gap-1 rounded-lg px-3 py-1.5 text-xs text-gray-500 hover:bg-gray-100", children: [
1755
+ /* @__PURE__ */ t(Et, { size: 12, "aria-hidden": "true" }),
1756
+ "取消"
1757
+ ] })
1758
+ ] })
1759
+ ] }) : null })
1760
+ ] });
1761
+ }
1762
+ function an(e) {
1763
+ var n;
1764
+ const r = e.categoryId !== void 0 ? e.categoryId : ((n = e.category) == null ? void 0 : n.id) ?? null;
1765
+ return { title: e.title, description: e.description, categoryId: r };
1766
+ }
1767
+ function sn(e) {
1768
+ return e.split(/(“[^”]+”|"[^"]+")/g).map(
1769
+ (r, n) => /^(“.*”|".*")$/.test(r) ? /* @__PURE__ */ t("code", { className: "rounded bg-gray-100 px-1 py-0.5 font-mono text-[11px] text-gray-800", children: r.slice(1, -1) }, n) : r
1770
+ );
1771
+ }
1772
+ function on({ errors: e, source: r }) {
1773
+ const [n, a] = S(null), c = r.split(`
1774
+ `);
1775
+ return /* @__PURE__ */ s("div", { children: [
1776
+ /* @__PURE__ */ s("div", { className: "sticky top-0 z-10 flex items-center gap-3 border-b border-gray-100 bg-white px-4 py-3.5", children: [
1777
+ /* @__PURE__ */ t("span", { className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-red-50 text-red-500", children: /* @__PURE__ */ t(yr, { size: 18, strokeWidth: 1.75 }) }),
1778
+ /* @__PURE__ */ s("div", { className: "min-w-0 flex-1", children: [
1779
+ /* @__PURE__ */ t("div", { className: "text-sm font-semibold text-gray-900", children: "HTML 校验" }),
1780
+ /* @__PURE__ */ t("div", { className: "mt-0.5 text-xs text-gray-500", children: "点击问题查看详情" })
1781
+ ] }),
1782
+ /* @__PURE__ */ s("span", { className: "shrink-0 rounded-full bg-red-50 px-2.5 py-1 text-xs font-medium text-red-600", children: [
1783
+ e.length,
1784
+ " 个问题"
1785
+ ] })
1786
+ ] }),
1787
+ /* @__PURE__ */ t("ol", { className: "m-0 list-none divide-y divide-gray-100 p-0", children: e.map((d, g) => {
1788
+ var y, f;
1789
+ const h = (d.lastLine ? (y = c[d.lastLine - 1]) == null ? void 0 : y.trim() : "") || ((f = d.extract) == null ? void 0 : f.trim()), u = n === g;
1790
+ return /* @__PURE__ */ s("li", { children: [
1791
+ /* @__PURE__ */ s(
1792
+ "button",
1793
+ {
1794
+ type: "button",
1795
+ "aria-expanded": u,
1796
+ onClick: () => a(u ? null : g),
1797
+ className: `flex w-full cursor-pointer items-center gap-2.5 px-4 py-3 text-left transition-colors hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-blue-400 ${u ? "bg-gray-50" : ""}`,
1798
+ children: [
1799
+ /* @__PURE__ */ t("span", { className: "h-1.5 w-1.5 shrink-0 rounded-full bg-red-400" }),
1800
+ /* @__PURE__ */ t("span", { className: "w-16 shrink-0 font-mono text-[11px] text-gray-500", children: d.lastLine != null ? `第 ${d.lastLine} 行` : `问题 ${g + 1}` }),
1801
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-xs leading-5 text-gray-700", children: d.message.replace(/[“”"]/g, "") }),
1802
+ /* @__PURE__ */ t(fr, { size: 14, className: `shrink-0 text-gray-400 transition-transform ${u ? "rotate-180" : ""}` })
1803
+ ]
1804
+ }
1805
+ ),
1806
+ u && /* @__PURE__ */ s("div", { className: "border-t border-gray-100 px-4 pb-4 pt-3", children: [
1807
+ d.lastColumn != null && /* @__PURE__ */ s("div", { className: "mb-2 font-mono text-[11px] text-gray-400", children: [
1808
+ "第 ",
1809
+ d.lastColumn,
1810
+ " 列"
1811
+ ] }),
1812
+ /* @__PURE__ */ t("p", { className: "m-0 text-[13px] leading-6 text-gray-600", children: sn(d.message) }),
1813
+ h && /* @__PURE__ */ s("div", { className: "mt-3 overflow-hidden rounded-lg border border-gray-100 bg-gray-50", children: [
1814
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-1.5 border-b border-gray-100 px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider text-gray-400", children: [
1815
+ /* @__PURE__ */ t(Qe, { size: 11 }),
1816
+ " 源代码"
1817
+ ] }),
1818
+ /* @__PURE__ */ t("pre", { className: "m-0 whitespace-pre-wrap break-words px-3 py-2.5 font-mono text-[11px] leading-5 text-gray-600", children: h })
1819
+ ] })
1820
+ ] })
1821
+ ] }, g);
1822
+ }) })
1823
+ ] });
1824
+ }
1825
+ async function ut(e) {
1826
+ const r = new AbortController(), n = setTimeout(() => r.abort(), 1e4);
1034
1827
  try {
1035
- const n = await fetch("https://validator.w3.org/nu/?out=json", {
1828
+ const a = await fetch("https://validator.w3.org/nu/?out=json", {
1036
1829
  method: "POST",
1037
1830
  headers: {
1038
1831
  "Content-Type": "text/html; charset=utf-8",
1039
1832
  "User-Agent": "AiSee-Manage/1.0"
1040
1833
  },
1041
1834
  body: e,
1042
- signal: t.signal
1835
+ signal: r.signal
1043
1836
  });
1044
- if (!n.ok) throw new Error(`W3C validator responded with ${n.status}`);
1045
- const y = ((await n.json()).messages || []).filter(($) => $.type === "error");
1046
- return { isValid: y.length === 0, errors: y };
1047
- } catch (n) {
1048
- return console.error("W3C 校验请求失败:", n), { isValid: !0, errors: [], networkError: !0 };
1837
+ if (!a.ok) throw new Error(`W3C validator responded with ${a.status}`);
1838
+ const g = ((await a.json()).messages || []).filter((h) => h.type === "error");
1839
+ return { isValid: g.length === 0, errors: g };
1840
+ } catch (a) {
1841
+ return console.error("W3C 校验请求失败:", a), { isValid: !0, errors: [], networkError: !0 };
1049
1842
  } finally {
1050
- clearTimeout(r);
1843
+ clearTimeout(n);
1051
1844
  }
1052
1845
  }
1053
- function Ye(e, t) {
1054
- (t == null || t > e.length) && (t = e.length);
1055
- for (var r = 0, n = Array(t); r < t; r++) n[r] = e[r];
1056
- return n;
1846
+ function mt(e, r) {
1847
+ (r == null || r > e.length) && (r = e.length);
1848
+ for (var n = 0, a = Array(r); n < r; n++) a[n] = e[n];
1849
+ return a;
1057
1850
  }
1058
- function ar(e) {
1851
+ function cn(e) {
1059
1852
  if (Array.isArray(e)) return e;
1060
1853
  }
1061
- function ir(e, t, r) {
1062
- return (t = hr(t)) in e ? Object.defineProperty(e, t, {
1063
- value: r,
1854
+ function ln(e, r, n) {
1855
+ return (r = fn(r)) in e ? Object.defineProperty(e, r, {
1856
+ value: n,
1064
1857
  enumerable: !0,
1065
1858
  configurable: !0,
1066
1859
  writable: !0
1067
- }) : e[t] = r, e;
1860
+ }) : e[r] = n, e;
1068
1861
  }
1069
- function or(e, t) {
1070
- var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1071
- if (r != null) {
1072
- var n, s, u, y, $ = [], M = !0, j = !1;
1862
+ function dn(e, r) {
1863
+ var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
1864
+ if (n != null) {
1865
+ var a, c, d, g, h = [], u = !0, y = !1;
1073
1866
  try {
1074
- if (u = (r = r.call(e)).next, t !== 0) for (; !(M = (n = u.call(r)).done) && ($.push(n.value), $.length !== t); M = !0) ;
1075
- } catch (m) {
1076
- j = !0, s = m;
1867
+ if (d = (n = n.call(e)).next, r !== 0) for (; !(u = (a = d.call(n)).done) && (h.push(a.value), h.length !== r); u = !0) ;
1868
+ } catch (f) {
1869
+ y = !0, c = f;
1077
1870
  } finally {
1078
1871
  try {
1079
- if (!M && r.return != null && (y = r.return(), Object(y) !== y)) return;
1872
+ if (!u && n.return != null && (g = n.return(), Object(g) !== g)) return;
1080
1873
  } finally {
1081
- if (j) throw s;
1874
+ if (y) throw c;
1082
1875
  }
1083
1876
  }
1084
- return $;
1877
+ return h;
1085
1878
  }
1086
1879
  }
1087
- function sr() {
1880
+ function un() {
1088
1881
  throw new TypeError(`Invalid attempt to destructure non-iterable instance.
1089
1882
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1090
1883
  }
1091
- function Ue(e, t) {
1092
- var r = Object.keys(e);
1884
+ function ht(e, r) {
1885
+ var n = Object.keys(e);
1093
1886
  if (Object.getOwnPropertySymbols) {
1094
- var n = Object.getOwnPropertySymbols(e);
1095
- t && (n = n.filter(function(s) {
1096
- return Object.getOwnPropertyDescriptor(e, s).enumerable;
1097
- })), r.push.apply(r, n);
1887
+ var a = Object.getOwnPropertySymbols(e);
1888
+ r && (a = a.filter(function(c) {
1889
+ return Object.getOwnPropertyDescriptor(e, c).enumerable;
1890
+ })), n.push.apply(n, a);
1098
1891
  }
1099
- return r;
1100
- }
1101
- function qe(e) {
1102
- for (var t = 1; t < arguments.length; t++) {
1103
- var r = arguments[t] != null ? arguments[t] : {};
1104
- t % 2 ? Ue(Object(r), !0).forEach(function(n) {
1105
- ir(e, n, r[n]);
1106
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Ue(Object(r)).forEach(function(n) {
1107
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1892
+ return n;
1893
+ }
1894
+ function gt(e) {
1895
+ for (var r = 1; r < arguments.length; r++) {
1896
+ var n = arguments[r] != null ? arguments[r] : {};
1897
+ r % 2 ? ht(Object(n), !0).forEach(function(a) {
1898
+ ln(e, a, n[a]);
1899
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : ht(Object(n)).forEach(function(a) {
1900
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
1108
1901
  });
1109
1902
  }
1110
1903
  return e;
1111
1904
  }
1112
- function cr(e, t) {
1905
+ function mn(e, r) {
1113
1906
  if (e == null) return {};
1114
- var r, n, s = lr(e, t);
1907
+ var n, a, c = hn(e, r);
1115
1908
  if (Object.getOwnPropertySymbols) {
1116
- var u = Object.getOwnPropertySymbols(e);
1117
- for (n = 0; n < u.length; n++) r = u[n], t.indexOf(r) === -1 && {}.propertyIsEnumerable.call(e, r) && (s[r] = e[r]);
1909
+ var d = Object.getOwnPropertySymbols(e);
1910
+ for (a = 0; a < d.length; a++) n = d[a], r.indexOf(n) === -1 && {}.propertyIsEnumerable.call(e, n) && (c[n] = e[n]);
1118
1911
  }
1119
- return s;
1912
+ return c;
1120
1913
  }
1121
- function lr(e, t) {
1914
+ function hn(e, r) {
1122
1915
  if (e == null) return {};
1123
- var r = {};
1124
- for (var n in e) if ({}.hasOwnProperty.call(e, n)) {
1125
- if (t.indexOf(n) !== -1) continue;
1126
- r[n] = e[n];
1916
+ var n = {};
1917
+ for (var a in e) if ({}.hasOwnProperty.call(e, a)) {
1918
+ if (r.indexOf(a) !== -1) continue;
1919
+ n[a] = e[a];
1127
1920
  }
1128
- return r;
1921
+ return n;
1129
1922
  }
1130
- function ur(e, t) {
1131
- return ar(e) || or(e, t) || fr(e, t) || sr();
1923
+ function gn(e, r) {
1924
+ return cn(e) || dn(e, r) || xn(e, r) || un();
1132
1925
  }
1133
- function dr(e, t) {
1926
+ function pn(e, r) {
1134
1927
  if (typeof e != "object" || !e) return e;
1135
- var r = e[Symbol.toPrimitive];
1136
- if (r !== void 0) {
1137
- var n = r.call(e, t);
1138
- if (typeof n != "object") return n;
1928
+ var n = e[Symbol.toPrimitive];
1929
+ if (n !== void 0) {
1930
+ var a = n.call(e, r);
1931
+ if (typeof a != "object") return a;
1139
1932
  throw new TypeError("@@toPrimitive must return a primitive value.");
1140
1933
  }
1141
- return (t === "string" ? String : Number)(e);
1934
+ return (r === "string" ? String : Number)(e);
1142
1935
  }
1143
- function hr(e) {
1144
- var t = dr(e, "string");
1145
- return typeof t == "symbol" ? t : t + "";
1936
+ function fn(e) {
1937
+ var r = pn(e, "string");
1938
+ return typeof r == "symbol" ? r : r + "";
1146
1939
  }
1147
- function fr(e, t) {
1940
+ function xn(e, r) {
1148
1941
  if (e) {
1149
- if (typeof e == "string") return Ye(e, t);
1150
- var r = {}.toString.call(e).slice(8, -1);
1151
- return r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set" ? Array.from(e) : r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r) ? Ye(e, t) : void 0;
1942
+ if (typeof e == "string") return mt(e, r);
1943
+ var n = {}.toString.call(e).slice(8, -1);
1944
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? mt(e, r) : void 0;
1152
1945
  }
1153
1946
  }
1154
- function mr(e, t, r) {
1155
- return t in e ? Object.defineProperty(e, t, {
1156
- value: r,
1947
+ function yn(e, r, n) {
1948
+ return r in e ? Object.defineProperty(e, r, {
1949
+ value: n,
1157
1950
  enumerable: !0,
1158
1951
  configurable: !0,
1159
1952
  writable: !0
1160
- }) : e[t] = r, e;
1953
+ }) : e[r] = n, e;
1161
1954
  }
1162
- function Be(e, t) {
1163
- var r = Object.keys(e);
1955
+ function pt(e, r) {
1956
+ var n = Object.keys(e);
1164
1957
  if (Object.getOwnPropertySymbols) {
1165
- var n = Object.getOwnPropertySymbols(e);
1166
- t && (n = n.filter(function(s) {
1167
- return Object.getOwnPropertyDescriptor(e, s).enumerable;
1168
- })), r.push.apply(r, n);
1958
+ var a = Object.getOwnPropertySymbols(e);
1959
+ r && (a = a.filter(function(c) {
1960
+ return Object.getOwnPropertyDescriptor(e, c).enumerable;
1961
+ })), n.push.apply(n, a);
1169
1962
  }
1170
- return r;
1171
- }
1172
- function Fe(e) {
1173
- for (var t = 1; t < arguments.length; t++) {
1174
- var r = arguments[t] != null ? arguments[t] : {};
1175
- t % 2 ? Be(Object(r), !0).forEach(function(n) {
1176
- mr(e, n, r[n]);
1177
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Be(Object(r)).forEach(function(n) {
1178
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
1963
+ return n;
1964
+ }
1965
+ function ft(e) {
1966
+ for (var r = 1; r < arguments.length; r++) {
1967
+ var n = arguments[r] != null ? arguments[r] : {};
1968
+ r % 2 ? pt(Object(n), !0).forEach(function(a) {
1969
+ yn(e, a, n[a]);
1970
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : pt(Object(n)).forEach(function(a) {
1971
+ Object.defineProperty(e, a, Object.getOwnPropertyDescriptor(n, a));
1179
1972
  });
1180
1973
  }
1181
1974
  return e;
1182
1975
  }
1183
- function pr() {
1184
- for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++)
1185
- t[r] = arguments[r];
1186
- return function(n) {
1187
- return t.reduceRight(function(s, u) {
1188
- return u(s);
1189
- }, n);
1976
+ function bn() {
1977
+ for (var e = arguments.length, r = new Array(e), n = 0; n < e; n++)
1978
+ r[n] = arguments[n];
1979
+ return function(a) {
1980
+ return r.reduceRight(function(c, d) {
1981
+ return d(c);
1982
+ }, a);
1190
1983
  };
1191
1984
  }
1192
- function se(e) {
1193
- return function t() {
1194
- for (var r = this, n = arguments.length, s = new Array(n), u = 0; u < n; u++)
1195
- s[u] = arguments[u];
1196
- return s.length >= e.length ? e.apply(this, s) : function() {
1197
- for (var y = arguments.length, $ = new Array(y), M = 0; M < y; M++)
1198
- $[M] = arguments[M];
1199
- return t.apply(r, [].concat(s, $));
1985
+ function xe(e) {
1986
+ return function r() {
1987
+ for (var n = this, a = arguments.length, c = new Array(a), d = 0; d < a; d++)
1988
+ c[d] = arguments[d];
1989
+ return c.length >= e.length ? e.apply(this, c) : function() {
1990
+ for (var g = arguments.length, h = new Array(g), u = 0; u < g; u++)
1991
+ h[u] = arguments[u];
1992
+ return r.apply(n, [].concat(c, h));
1200
1993
  };
1201
1994
  };
1202
1995
  }
1203
- function ge(e) {
1996
+ function je(e) {
1204
1997
  return {}.toString.call(e).includes("Object");
1205
1998
  }
1206
- function gr(e) {
1999
+ function vn(e) {
1207
2000
  return !Object.keys(e).length;
1208
2001
  }
1209
- function le(e) {
2002
+ function ve(e) {
1210
2003
  return typeof e == "function";
1211
2004
  }
1212
- function yr(e, t) {
1213
- return Object.prototype.hasOwnProperty.call(e, t);
2005
+ function wn(e, r) {
2006
+ return Object.prototype.hasOwnProperty.call(e, r);
1214
2007
  }
1215
- function br(e, t) {
1216
- return ge(t) || re("changeType"), Object.keys(t).some(function(r) {
1217
- return !yr(e, r);
1218
- }) && re("changeField"), t;
2008
+ function Nn(e, r) {
2009
+ return je(r) || le("changeType"), Object.keys(r).some(function(n) {
2010
+ return !wn(e, n);
2011
+ }) && le("changeField"), r;
1219
2012
  }
1220
- function xr(e) {
1221
- le(e) || re("selectorType");
2013
+ function kn(e) {
2014
+ ve(e) || le("selectorType");
1222
2015
  }
1223
- function vr(e) {
1224
- le(e) || ge(e) || re("handlerType"), ge(e) && Object.values(e).some(function(t) {
1225
- return !le(t);
1226
- }) && re("handlersType");
2016
+ function $n(e) {
2017
+ ve(e) || je(e) || le("handlerType"), je(e) && Object.values(e).some(function(r) {
2018
+ return !ve(r);
2019
+ }) && le("handlersType");
1227
2020
  }
1228
- function wr(e) {
1229
- e || re("initialIsRequired"), ge(e) || re("initialType"), gr(e) && re("initialContent");
2021
+ function Cn(e) {
2022
+ e || le("initialIsRequired"), je(e) || le("initialType"), vn(e) && le("initialContent");
1230
2023
  }
1231
- function Nr(e, t) {
1232
- throw new Error(e[t] || e.default);
2024
+ function Mn(e, r) {
2025
+ throw new Error(e[r] || e.default);
1233
2026
  }
1234
- var kr = {
2027
+ var Sn = {
1235
2028
  initialIsRequired: "initial state is required",
1236
2029
  initialType: "initial state should be an object",
1237
2030
  initialContent: "initial state shouldn't be an empty object",
@@ -1241,76 +2034,76 @@ var kr = {
1241
2034
  changeType: "provided value of changes should be an object",
1242
2035
  changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state',
1243
2036
  default: "an unknown error accured in `state-local` package"
1244
- }, re = se(Nr)(kr), he = {
1245
- changes: br,
1246
- selector: xr,
1247
- handler: vr,
1248
- initial: wr
2037
+ }, le = xe(Mn)(Sn), ke = {
2038
+ changes: Nn,
2039
+ selector: kn,
2040
+ handler: $n,
2041
+ initial: Cn
1249
2042
  };
1250
- function $r(e) {
1251
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1252
- he.initial(e), he.handler(t);
1253
- var r = {
2043
+ function jn(e) {
2044
+ var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2045
+ ke.initial(e), ke.handler(r);
2046
+ var n = {
1254
2047
  current: e
1255
- }, n = se(Sr)(r, t), s = se(Cr)(r), u = se(he.changes)(e), y = se(Mr)(r);
1256
- function $() {
1257
- var j = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(m) {
1258
- return m;
2048
+ }, a = xe(Pn)(n, r), c = xe(En)(n), d = xe(ke.changes)(e), g = xe(On)(n);
2049
+ function h() {
2050
+ var y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(f) {
2051
+ return f;
1259
2052
  };
1260
- return he.selector(j), j(r.current);
2053
+ return ke.selector(y), y(n.current);
1261
2054
  }
1262
- function M(j) {
1263
- pr(n, s, u, y)(j);
2055
+ function u(y) {
2056
+ bn(a, c, d, g)(y);
1264
2057
  }
1265
- return [$, M];
2058
+ return [h, u];
1266
2059
  }
1267
- function Mr(e, t) {
1268
- return le(t) ? t(e.current) : t;
2060
+ function On(e, r) {
2061
+ return ve(r) ? r(e.current) : r;
1269
2062
  }
1270
- function Cr(e, t) {
1271
- return e.current = Fe(Fe({}, e.current), t), t;
2063
+ function En(e, r) {
2064
+ return e.current = ft(ft({}, e.current), r), r;
1272
2065
  }
1273
- function Sr(e, t, r) {
1274
- return le(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
1275
- var s;
1276
- return (s = t[n]) === null || s === void 0 ? void 0 : s.call(t, e.current[n]);
1277
- }), r;
2066
+ function Pn(e, r, n) {
2067
+ return ve(r) ? r(e.current) : Object.keys(n).forEach(function(a) {
2068
+ var c;
2069
+ return (c = r[a]) === null || c === void 0 ? void 0 : c.call(r, e.current[a]);
2070
+ }), n;
1278
2071
  }
1279
- var jr = {
1280
- create: $r
1281
- }, Or = {
2072
+ var Dn = {
2073
+ create: jn
2074
+ }, In = {
1282
2075
  paths: {
1283
2076
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
1284
2077
  }
1285
2078
  };
1286
- function Pr(e) {
1287
- return function t() {
1288
- for (var r = this, n = arguments.length, s = new Array(n), u = 0; u < n; u++)
1289
- s[u] = arguments[u];
1290
- return s.length >= e.length ? e.apply(this, s) : function() {
1291
- for (var y = arguments.length, $ = new Array(y), M = 0; M < y; M++)
1292
- $[M] = arguments[M];
1293
- return t.apply(r, [].concat(s, $));
2079
+ function Ln(e) {
2080
+ return function r() {
2081
+ for (var n = this, a = arguments.length, c = new Array(a), d = 0; d < a; d++)
2082
+ c[d] = arguments[d];
2083
+ return c.length >= e.length ? e.apply(this, c) : function() {
2084
+ for (var g = arguments.length, h = new Array(g), u = 0; u < g; u++)
2085
+ h[u] = arguments[u];
2086
+ return r.apply(n, [].concat(c, h));
1294
2087
  };
1295
2088
  };
1296
2089
  }
1297
- function Dr(e) {
2090
+ function _n(e) {
1298
2091
  return {}.toString.call(e).includes("Object");
1299
2092
  }
1300
- function Lr(e) {
1301
- return e || Ze("configIsRequired"), Dr(e) || Ze("configType"), e.urls ? (_r(), {
2093
+ function Tn(e) {
2094
+ return e || xt("configIsRequired"), _n(e) || xt("configType"), e.urls ? (zn(), {
1302
2095
  paths: {
1303
2096
  vs: e.urls.monacoBase
1304
2097
  }
1305
2098
  }) : e;
1306
2099
  }
1307
- function _r() {
1308
- console.warn(at.deprecation);
2100
+ function zn() {
2101
+ console.warn(_t.deprecation);
1309
2102
  }
1310
- function Tr(e, t) {
1311
- throw new Error(e[t] || e.default);
2103
+ function An(e, r) {
2104
+ throw new Error(e[r] || e.default);
1312
2105
  }
1313
- var at = {
2106
+ var _t = {
1314
2107
  configIsRequired: "the configuration object is required",
1315
2108
  configType: "the configuration object should be an object",
1316
2109
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -1324,781 +2117,977 @@ var at = {
1324
2117
 
1325
2118
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
1326
2119
  `
1327
- }, Ze = Pr(Tr)(at), Ar = {
1328
- config: Lr
1329
- }, Er = function() {
1330
- for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
1331
- r[n] = arguments[n];
1332
- return function(s) {
1333
- return r.reduceRight(function(u, y) {
1334
- return y(u);
1335
- }, s);
2120
+ }, xt = Ln(An)(_t), Hn = {
2121
+ config: Tn
2122
+ }, Gn = function() {
2123
+ for (var r = arguments.length, n = new Array(r), a = 0; a < r; a++)
2124
+ n[a] = arguments[a];
2125
+ return function(c) {
2126
+ return n.reduceRight(function(d, g) {
2127
+ return g(d);
2128
+ }, c);
1336
2129
  };
1337
2130
  };
1338
- function it(e, t) {
1339
- return Object.keys(t).forEach(function(r) {
1340
- t[r] instanceof Object && e[r] && Object.assign(t[r], it(e[r], t[r]));
1341
- }), qe(qe({}, e), t);
2131
+ function Tt(e, r) {
2132
+ return Object.keys(r).forEach(function(n) {
2133
+ r[n] instanceof Object && e[n] && Object.assign(r[n], Tt(e[n], r[n]));
2134
+ }), gt(gt({}, e), r);
1342
2135
  }
1343
- var zr = {
2136
+ var Wn = {
1344
2137
  type: "cancelation",
1345
2138
  msg: "operation is manually canceled"
1346
2139
  };
1347
- function Ne(e) {
1348
- var t = !1, r = new Promise(function(n, s) {
1349
- e.then(function(u) {
1350
- return t ? s(zr) : n(u);
1351
- }), e.catch(s);
2140
+ function Ae(e) {
2141
+ var r = !1, n = new Promise(function(a, c) {
2142
+ e.then(function(d) {
2143
+ return r ? c(Wn) : a(d);
2144
+ }), e.catch(c);
1352
2145
  });
1353
- return r.cancel = function() {
1354
- return t = !0;
1355
- }, r;
2146
+ return n.cancel = function() {
2147
+ return r = !0;
2148
+ }, n;
1356
2149
  }
1357
- var Hr = ["monaco"], Ir = jr.create({
1358
- config: Or,
2150
+ var Rn = ["monaco"], Vn = Dn.create({
2151
+ config: In,
1359
2152
  isInitialized: !1,
1360
2153
  resolve: null,
1361
2154
  reject: null,
1362
2155
  monaco: null
1363
- }), ot = ur(Ir, 2), ue = ot[0], be = ot[1];
1364
- function Wr(e) {
1365
- var t = Ar.config(e), r = t.monaco, n = cr(t, Hr);
1366
- be(function(s) {
2156
+ }), zt = gn(Vn, 2), Ne = zt[0], De = zt[1];
2157
+ function Yn(e) {
2158
+ var r = Hn.config(e), n = r.monaco, a = mn(r, Rn);
2159
+ De(function(c) {
1367
2160
  return {
1368
- config: it(s.config, n),
1369
- monaco: r
2161
+ config: Tt(c.config, a),
2162
+ monaco: n
1370
2163
  };
1371
2164
  });
1372
2165
  }
1373
- function Rr() {
1374
- var e = ue(function(t) {
1375
- var r = t.monaco, n = t.isInitialized, s = t.resolve;
2166
+ function qn() {
2167
+ var e = Ne(function(r) {
2168
+ var n = r.monaco, a = r.isInitialized, c = r.resolve;
1376
2169
  return {
1377
- monaco: r,
1378
- isInitialized: n,
1379
- resolve: s
2170
+ monaco: n,
2171
+ isInitialized: a,
2172
+ resolve: c
1380
2173
  };
1381
2174
  });
1382
2175
  if (!e.isInitialized) {
1383
- if (be({
2176
+ if (De({
1384
2177
  isInitialized: !0
1385
2178
  }), e.monaco)
1386
- return e.resolve(e.monaco), Ne(ke);
2179
+ return e.resolve(e.monaco), Ae(He);
1387
2180
  if (window.monaco && window.monaco.editor)
1388
- return st(window.monaco), e.resolve(window.monaco), Ne(ke);
1389
- Er(Vr, Ur)(qr);
2181
+ return At(window.monaco), e.resolve(window.monaco), Ae(He);
2182
+ Gn(Bn, Un)(Kn);
1390
2183
  }
1391
- return Ne(ke);
2184
+ return Ae(He);
1392
2185
  }
1393
- function Vr(e) {
2186
+ function Bn(e) {
1394
2187
  return document.body.appendChild(e);
1395
2188
  }
1396
- function Yr(e) {
1397
- var t = document.createElement("script");
1398
- return e && (t.src = e), t;
2189
+ function Fn(e) {
2190
+ var r = document.createElement("script");
2191
+ return e && (r.src = e), r;
1399
2192
  }
1400
- function Ur(e) {
1401
- var t = ue(function(n) {
1402
- var s = n.config, u = n.reject;
2193
+ function Un(e) {
2194
+ var r = Ne(function(a) {
2195
+ var c = a.config, d = a.reject;
1403
2196
  return {
1404
- config: s,
1405
- reject: u
2197
+ config: c,
2198
+ reject: d
1406
2199
  };
1407
- }), r = Yr("".concat(t.config.paths.vs, "/loader.js"));
1408
- return r.onload = function() {
2200
+ }), n = Fn("".concat(r.config.paths.vs, "/loader.js"));
2201
+ return n.onload = function() {
1409
2202
  return e();
1410
- }, r.onerror = t.reject, r;
2203
+ }, n.onerror = r.reject, n;
1411
2204
  }
1412
- function qr() {
1413
- var e = ue(function(r) {
1414
- var n = r.config, s = r.resolve, u = r.reject;
2205
+ function Kn() {
2206
+ var e = Ne(function(n) {
2207
+ var a = n.config, c = n.resolve, d = n.reject;
1415
2208
  return {
1416
- config: n,
1417
- resolve: s,
1418
- reject: u
2209
+ config: a,
2210
+ resolve: c,
2211
+ reject: d
1419
2212
  };
1420
- }), t = window.require;
1421
- t.config(e.config), t(["vs/editor/editor.main"], function(r) {
1422
- var n = r.m || r;
1423
- st(n), e.resolve(n);
1424
- }, function(r) {
1425
- e.reject(r);
2213
+ }), r = window.require;
2214
+ r.config(e.config), r(["vs/editor/editor.main"], function(n) {
2215
+ var a = n.m || n;
2216
+ At(a), e.resolve(a);
2217
+ }, function(n) {
2218
+ e.reject(n);
1426
2219
  });
1427
2220
  }
1428
- function st(e) {
1429
- ue().monaco || be({
2221
+ function At(e) {
2222
+ Ne().monaco || De({
1430
2223
  monaco: e
1431
2224
  });
1432
2225
  }
1433
- function Br() {
1434
- return ue(function(e) {
1435
- var t = e.monaco;
1436
- return t;
2226
+ function Zn() {
2227
+ return Ne(function(e) {
2228
+ var r = e.monaco;
2229
+ return r;
1437
2230
  });
1438
2231
  }
1439
- var ke = new Promise(function(e, t) {
1440
- return be({
2232
+ var He = new Promise(function(e, r) {
2233
+ return De({
1441
2234
  resolve: e,
1442
- reject: t
2235
+ reject: r
1443
2236
  });
1444
- }), ct = {
1445
- config: Wr,
1446
- init: Rr,
1447
- __getMonacoInstance: Br
1448
- }, Fr = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, $e = Fr, Zr = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Jr = Zr;
1449
- function Kr({ children: e }) {
1450
- return ie.createElement("div", { style: Jr.container }, e);
1451
- }
1452
- var Gr = Kr, Qr = Gr;
1453
- function Xr({ width: e, height: t, isEditorReady: r, loading: n, _ref: s, className: u, wrapperProps: y }) {
1454
- return ie.createElement("section", { style: { ...$e.wrapper, width: e, height: t }, ...y }, !r && ie.createElement(Qr, null, n), ie.createElement("div", { ref: s, style: { ...$e.fullWidth, ...!r && $e.hide }, className: u }));
1455
- }
1456
- var en = Xr, lt = Te(en);
1457
- function tn(e) {
1458
- K(e, []);
1459
- }
1460
- var ut = tn;
1461
- function rn(e, t, r = !0) {
1462
- let n = Y(!0);
1463
- K(n.current || !r ? () => {
1464
- n.current = !1;
1465
- } : e, t);
1466
- }
1467
- var J = rn;
1468
- function ce() {
1469
- }
1470
- function ae(e, t, r, n) {
1471
- return nn(e, n) || an(e, t, r, n);
1472
- }
1473
- function nn(e, t) {
1474
- return e.editor.getModel(dt(e, t));
1475
- }
1476
- function an(e, t, r, n) {
1477
- return e.editor.createModel(t, r, n ? dt(e, n) : void 0);
1478
- }
1479
- function dt(e, t) {
1480
- return e.Uri.parse(t);
1481
- }
1482
- function on({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: s, originalModelPath: u, modifiedModelPath: y, keepCurrentOriginalModel: $ = !1, keepCurrentModifiedModel: M = !1, theme: j = "light", loading: m = "Loading...", options: S = {}, height: W = "100%", width: P = "100%", className: E, wrapperProps: I = {}, beforeMount: H = ce, onMount: B = ce }) {
1483
- let [z, p] = A(!1), [T, O] = A(!0), b = Y(null), w = Y(null), R = Y(null), L = Y(B), g = Y(H), C = Y(!1);
1484
- ut(() => {
1485
- let i = ct.init();
1486
- return i.then((o) => (w.current = o) && O(!1)).catch((o) => (o == null ? void 0 : o.type) !== "cancelation" && console.error("Monaco initialization: error:", o)), () => b.current ? x() : i.cancel();
1487
- }), J(() => {
1488
- if (b.current && w.current) {
1489
- let i = b.current.getOriginalEditor(), o = ae(w.current, e || "", n || r || "text", u || "");
1490
- o !== i.getModel() && i.setModel(o);
2237
+ }), Ht = {
2238
+ config: Yn,
2239
+ init: qn,
2240
+ __getMonacoInstance: Zn
2241
+ }, Jn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, Ge = Jn, Xn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Qn = Xn;
2242
+ function ea({ children: e }) {
2243
+ return ge.createElement("div", { style: Qn.container }, e);
2244
+ }
2245
+ var ta = ea, ra = ta;
2246
+ function na({ width: e, height: r, isEditorReady: n, loading: a, _ref: c, className: d, wrapperProps: g }) {
2247
+ return ge.createElement("section", { style: { ...Ge.wrapper, width: e, height: r }, ...g }, !n && ge.createElement(ra, null, a), ge.createElement("div", { ref: c, style: { ...Ge.fullWidth, ...!n && Ge.hide }, className: d }));
2248
+ }
2249
+ var aa = na, Gt = Ze(aa);
2250
+ function ia(e) {
2251
+ te(e, []);
2252
+ }
2253
+ var Wt = ia;
2254
+ function sa(e, r, n = !0) {
2255
+ let a = Y(!0);
2256
+ te(a.current || !n ? () => {
2257
+ a.current = !1;
2258
+ } : e, r);
2259
+ }
2260
+ var oe = sa;
2261
+ function ye() {
2262
+ }
2263
+ function he(e, r, n, a) {
2264
+ return oa(e, a) || ca(e, r, n, a);
2265
+ }
2266
+ function oa(e, r) {
2267
+ return e.editor.getModel(Rt(e, r));
2268
+ }
2269
+ function ca(e, r, n, a) {
2270
+ return e.editor.createModel(r, n, a ? Rt(e, a) : void 0);
2271
+ }
2272
+ function Rt(e, r) {
2273
+ return e.Uri.parse(r);
2274
+ }
2275
+ function la({ original: e, modified: r, language: n, originalLanguage: a, modifiedLanguage: c, originalModelPath: d, modifiedModelPath: g, keepCurrentOriginalModel: h = !1, keepCurrentModifiedModel: u = !1, theme: y = "light", loading: f = "Loading...", options: N = {}, height: _ = "100%", width: z = "100%", className: A, wrapperProps: W = {}, beforeMount: V = ye, onMount: R = ye }) {
2276
+ let [H, F] = S(!1), [M, D] = S(!0), v = Y(null), b = Y(null), T = Y(null), O = Y(R), p = Y(V), C = Y(!1);
2277
+ Wt(() => {
2278
+ let l = Ht.init();
2279
+ return l.then((m) => (b.current = m) && D(!1)).catch((m) => (m == null ? void 0 : m.type) !== "cancelation" && console.error("Monaco initialization: error:", m)), () => v.current ? k() : l.cancel();
2280
+ }), oe(() => {
2281
+ if (v.current && b.current) {
2282
+ let l = v.current.getOriginalEditor(), m = he(b.current, e || "", a || n || "text", d || "");
2283
+ m !== l.getModel() && l.setModel(m);
1491
2284
  }
1492
- }, [u], z), J(() => {
1493
- if (b.current && w.current) {
1494
- let i = b.current.getModifiedEditor(), o = ae(w.current, t || "", s || r || "text", y || "");
1495
- o !== i.getModel() && i.setModel(o);
2285
+ }, [d], H), oe(() => {
2286
+ if (v.current && b.current) {
2287
+ let l = v.current.getModifiedEditor(), m = he(b.current, r || "", c || n || "text", g || "");
2288
+ m !== l.getModel() && l.setModel(m);
1496
2289
  }
1497
- }, [y], z), J(() => {
1498
- let i = b.current.getModifiedEditor();
1499
- i.getOption(w.current.editor.EditorOption.readOnly) ? i.setValue(t || "") : t !== i.getValue() && (i.executeEdits("", [{ range: i.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), i.pushUndoStop());
1500
- }, [t], z), J(() => {
1501
- var i, o;
1502
- (o = (i = b.current) == null ? void 0 : i.getModel()) == null || o.original.setValue(e || "");
1503
- }, [e], z), J(() => {
1504
- let { original: i, modified: o } = b.current.getModel();
1505
- w.current.editor.setModelLanguage(i, n || r || "text"), w.current.editor.setModelLanguage(o, s || r || "text");
1506
- }, [r, n, s], z), J(() => {
2290
+ }, [g], H), oe(() => {
2291
+ let l = v.current.getModifiedEditor();
2292
+ l.getOption(b.current.editor.EditorOption.readOnly) ? l.setValue(r || "") : r !== l.getValue() && (l.executeEdits("", [{ range: l.getModel().getFullModelRange(), text: r || "", forceMoveMarkers: !0 }]), l.pushUndoStop());
2293
+ }, [r], H), oe(() => {
2294
+ var l, m;
2295
+ (m = (l = v.current) == null ? void 0 : l.getModel()) == null || m.original.setValue(e || "");
2296
+ }, [e], H), oe(() => {
2297
+ let { original: l, modified: m } = v.current.getModel();
2298
+ b.current.editor.setModelLanguage(l, a || n || "text"), b.current.editor.setModelLanguage(m, c || n || "text");
2299
+ }, [n, a, c], H), oe(() => {
2300
+ var l;
2301
+ (l = b.current) == null || l.editor.setTheme(y);
2302
+ }, [y], H), oe(() => {
2303
+ var l;
2304
+ (l = v.current) == null || l.updateOptions(N);
2305
+ }, [N], H);
2306
+ let L = Me(() => {
2307
+ var $;
2308
+ if (!b.current) return;
2309
+ p.current(b.current);
2310
+ let l = he(b.current, e || "", a || n || "text", d || ""), m = he(b.current, r || "", c || n || "text", g || "");
2311
+ ($ = v.current) == null || $.setModel({ original: l, modified: m });
2312
+ }, [n, r, c, e, a, d, g]), q = Me(() => {
2313
+ var l;
2314
+ !C.current && T.current && (v.current = b.current.editor.createDiffEditor(T.current, { automaticLayout: !0, ...N }), L(), (l = b.current) == null || l.editor.setTheme(y), F(!0), C.current = !0);
2315
+ }, [N, y, L]);
2316
+ te(() => {
2317
+ H && O.current(v.current, b.current);
2318
+ }, [H]), te(() => {
2319
+ !M && !H && q();
2320
+ }, [M, H, q]);
2321
+ function k() {
2322
+ var m, $, x, E;
2323
+ let l = (m = v.current) == null ? void 0 : m.getModel();
2324
+ h || (($ = l == null ? void 0 : l.original) == null || $.dispose()), u || ((x = l == null ? void 0 : l.modified) == null || x.dispose()), (E = v.current) == null || E.dispose();
2325
+ }
2326
+ return ge.createElement(Gt, { width: z, height: _, isEditorReady: H, loading: f, _ref: T, className: A, wrapperProps: W });
2327
+ }
2328
+ var da = la;
2329
+ Ze(da);
2330
+ function ua(e) {
2331
+ let r = Y();
2332
+ return te(() => {
2333
+ r.current = e;
2334
+ }, [e]), r.current;
2335
+ }
2336
+ var ma = ua, $e = /* @__PURE__ */ new Map();
2337
+ function ha({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: a, language: c, path: d, theme: g = "light", line: h, loading: u = "Loading...", options: y = {}, overrideServices: f = {}, saveViewState: N = !0, keepCurrentModel: _ = !1, width: z = "100%", height: A = "100%", className: W, wrapperProps: V = {}, beforeMount: R = ye, onMount: H = ye, onChange: F, onValidate: M = ye }) {
2338
+ let [D, v] = S(!1), [b, T] = S(!0), O = Y(null), p = Y(null), C = Y(null), L = Y(H), q = Y(R), k = Y(), l = Y(a), m = ma(d), $ = Y(!1), x = Y(!1);
2339
+ Wt(() => {
2340
+ let i = Ht.init();
2341
+ return i.then((o) => (O.current = o) && T(!1)).catch((o) => (o == null ? void 0 : o.type) !== "cancelation" && console.error("Monaco initialization: error:", o)), () => p.current ? P() : i.cancel();
2342
+ }), oe(() => {
2343
+ var o, w, j, G;
2344
+ let i = he(O.current, e || a || "", r || c || "", d || n || "");
2345
+ i !== ((o = p.current) == null ? void 0 : o.getModel()) && (N && $e.set(m, (w = p.current) == null ? void 0 : w.saveViewState()), (j = p.current) == null || j.setModel(i), N && ((G = p.current) == null || G.restoreViewState($e.get(d))));
2346
+ }, [d], D), oe(() => {
1507
2347
  var i;
1508
- (i = w.current) == null || i.editor.setTheme(j);
1509
- }, [j], z), J(() => {
2348
+ (i = p.current) == null || i.updateOptions(y);
2349
+ }, [y], D), oe(() => {
2350
+ !p.current || a === void 0 || (p.current.getOption(O.current.editor.EditorOption.readOnly) ? p.current.setValue(a) : a !== p.current.getValue() && (x.current = !0, p.current.executeEdits("", [{ range: p.current.getModel().getFullModelRange(), text: a, forceMoveMarkers: !0 }]), p.current.pushUndoStop(), x.current = !1));
2351
+ }, [a], D), oe(() => {
2352
+ var o, w;
2353
+ let i = (o = p.current) == null ? void 0 : o.getModel();
2354
+ i && c && ((w = O.current) == null || w.editor.setModelLanguage(i, c));
2355
+ }, [c], D), oe(() => {
1510
2356
  var i;
1511
- (i = b.current) == null || i.updateOptions(S);
1512
- }, [S], z);
1513
- let q = je(() => {
1514
- var d;
1515
- if (!w.current) return;
1516
- g.current(w.current);
1517
- let i = ae(w.current, e || "", n || r || "text", u || ""), o = ae(w.current, t || "", s || r || "text", y || "");
1518
- (d = b.current) == null || d.setModel({ original: i, modified: o });
1519
- }, [r, t, s, e, n, u, y]), G = je(() => {
2357
+ h !== void 0 && ((i = p.current) == null || i.revealLine(h));
2358
+ }, [h], D), oe(() => {
1520
2359
  var i;
1521
- !C.current && R.current && (b.current = w.current.editor.createDiffEditor(R.current, { automaticLayout: !0, ...S }), q(), (i = w.current) == null || i.editor.setTheme(j), p(!0), C.current = !0);
1522
- }, [S, j, q]);
1523
- K(() => {
1524
- z && L.current(b.current, w.current);
1525
- }, [z]), K(() => {
1526
- !T && !z && G();
1527
- }, [T, z, G]);
1528
- function x() {
1529
- var o, d, c, v;
1530
- let i = (o = b.current) == null ? void 0 : o.getModel();
1531
- $ || ((d = i == null ? void 0 : i.original) == null || d.dispose()), M || ((c = i == null ? void 0 : i.modified) == null || c.dispose()), (v = b.current) == null || v.dispose();
1532
- }
1533
- return ie.createElement(lt, { width: P, height: W, isEditorReady: z, loading: m, _ref: R, className: E, wrapperProps: I });
1534
- }
1535
- var sn = on;
1536
- Te(sn);
1537
- function cn(e) {
1538
- let t = Y();
1539
- return K(() => {
1540
- t.current = e;
1541
- }, [e]), t.current;
1542
- }
1543
- var ln = cn, fe = /* @__PURE__ */ new Map();
1544
- function un({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: s, path: u, theme: y = "light", line: $, loading: M = "Loading...", options: j = {}, overrideServices: m = {}, saveViewState: S = !0, keepCurrentModel: W = !1, width: P = "100%", height: E = "100%", className: I, wrapperProps: H = {}, beforeMount: B = ce, onMount: z = ce, onChange: p, onValidate: T = ce }) {
1545
- let [O, b] = A(!1), [w, R] = A(!0), L = Y(null), g = Y(null), C = Y(null), q = Y(z), G = Y(B), x = Y(), i = Y(n), o = ln(u), d = Y(!1), c = Y(!1);
1546
- ut(() => {
1547
- let f = ct.init();
1548
- return f.then((N) => (L.current = N) && R(!1)).catch((N) => (N == null ? void 0 : N.type) !== "cancelation" && console.error("Monaco initialization: error:", N)), () => g.current ? k() : f.cancel();
1549
- }), J(() => {
1550
- var N, D, h, _;
1551
- let f = ae(L.current, e || n || "", t || s || "", u || r || "");
1552
- f !== ((N = g.current) == null ? void 0 : N.getModel()) && (S && fe.set(o, (D = g.current) == null ? void 0 : D.saveViewState()), (h = g.current) == null || h.setModel(f), S && ((_ = g.current) == null || _.restoreViewState(fe.get(u))));
1553
- }, [u], O), J(() => {
1554
- var f;
1555
- (f = g.current) == null || f.updateOptions(j);
1556
- }, [j], O), J(() => {
1557
- !g.current || n === void 0 || (g.current.getOption(L.current.editor.EditorOption.readOnly) ? g.current.setValue(n) : n !== g.current.getValue() && (c.current = !0, g.current.executeEdits("", [{ range: g.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), g.current.pushUndoStop(), c.current = !1));
1558
- }, [n], O), J(() => {
1559
- var N, D;
1560
- let f = (N = g.current) == null ? void 0 : N.getModel();
1561
- f && s && ((D = L.current) == null || D.editor.setModelLanguage(f, s));
1562
- }, [s], O), J(() => {
1563
- var f;
1564
- $ !== void 0 && ((f = g.current) == null || f.revealLine($));
1565
- }, [$], O), J(() => {
1566
- var f;
1567
- (f = L.current) == null || f.editor.setTheme(y);
1568
- }, [y], O);
1569
- let v = je(() => {
1570
- var f;
1571
- if (!(!C.current || !L.current) && !d.current) {
1572
- G.current(L.current);
1573
- let N = u || r, D = ae(L.current, n || e || "", t || s || "", N || "");
1574
- g.current = (f = L.current) == null ? void 0 : f.editor.create(C.current, { model: D, automaticLayout: !0, ...j }, m), S && g.current.restoreViewState(fe.get(N)), L.current.editor.setTheme(y), $ !== void 0 && g.current.revealLine($), b(!0), d.current = !0;
2360
+ (i = O.current) == null || i.editor.setTheme(g);
2361
+ }, [g], D);
2362
+ let E = Me(() => {
2363
+ var i;
2364
+ if (!(!C.current || !O.current) && !$.current) {
2365
+ q.current(O.current);
2366
+ let o = d || n, w = he(O.current, a || e || "", r || c || "", o || "");
2367
+ p.current = (i = O.current) == null ? void 0 : i.editor.create(C.current, { model: w, automaticLayout: !0, ...y }, f), N && p.current.restoreViewState($e.get(o)), O.current.editor.setTheme(g), h !== void 0 && p.current.revealLine(h), v(!0), $.current = !0;
1575
2368
  }
1576
- }, [e, t, r, n, s, u, j, m, S, y, $]);
1577
- K(() => {
1578
- O && q.current(g.current, L.current);
1579
- }, [O]), K(() => {
1580
- !w && !O && v();
1581
- }, [w, O, v]), i.current = n, K(() => {
1582
- var f, N;
1583
- O && p && ((f = x.current) == null || f.dispose(), x.current = (N = g.current) == null ? void 0 : N.onDidChangeModelContent((D) => {
1584
- c.current || p(g.current.getValue(), D);
2369
+ }, [e, r, n, a, c, d, y, f, N, g, h]);
2370
+ te(() => {
2371
+ D && L.current(p.current, O.current);
2372
+ }, [D]), te(() => {
2373
+ !b && !D && E();
2374
+ }, [b, D, E]), l.current = a, te(() => {
2375
+ var i, o;
2376
+ D && F && ((i = k.current) == null || i.dispose(), k.current = (o = p.current) == null ? void 0 : o.onDidChangeModelContent((w) => {
2377
+ x.current || F(p.current.getValue(), w);
1585
2378
  }));
1586
- }, [O, p]), K(() => {
1587
- if (O) {
1588
- let f = L.current.editor.onDidChangeMarkers((N) => {
1589
- var h;
1590
- let D = (h = g.current.getModel()) == null ? void 0 : h.uri;
1591
- if (D && N.find((_) => _.path === D.path)) {
1592
- let _ = L.current.editor.getModelMarkers({ resource: D });
1593
- T == null || T(_);
2379
+ }, [D, F]), te(() => {
2380
+ if (D) {
2381
+ let i = O.current.editor.onDidChangeMarkers((o) => {
2382
+ var j;
2383
+ let w = (j = p.current.getModel()) == null ? void 0 : j.uri;
2384
+ if (w && o.find((G) => G.path === w.path)) {
2385
+ let G = O.current.editor.getModelMarkers({ resource: w });
2386
+ M == null || M(G);
1594
2387
  }
1595
2388
  });
1596
2389
  return () => {
1597
- f == null || f.dispose();
2390
+ i == null || i.dispose();
1598
2391
  };
1599
2392
  }
1600
2393
  return () => {
1601
2394
  };
1602
- }, [O, T]);
1603
- function k() {
1604
- var f, N;
1605
- (f = x.current) == null || f.dispose(), W ? S && fe.set(u, g.current.saveViewState()) : (N = g.current.getModel()) == null || N.dispose(), g.current.dispose();
2395
+ }, [D, M]);
2396
+ function P() {
2397
+ var i, o;
2398
+ (i = k.current) == null || i.dispose(), _ ? N && $e.set(d, p.current.saveViewState()) : (o = p.current.getModel()) == null || o.dispose(), p.current.dispose();
1606
2399
  }
1607
- return ie.createElement(lt, { width: P, height: E, isEditorReady: O, loading: M, _ref: C, className: I, wrapperProps: H });
1608
- }
1609
- var dn = un, hn = Te(dn), fn = hn;
1610
- function ye({ title: e, children: t, placement: r = "top" }) {
1611
- const [n, s] = A(!1);
1612
- return e ? /* @__PURE__ */ l(
2400
+ return ge.createElement(Gt, { width: z, height: A, isEditorReady: D, loading: u, _ref: C, className: W, wrapperProps: V });
2401
+ }
2402
+ var ga = ha, pa = Ze(ga), fa = pa;
2403
+ function Oe({ title: e, children: r, placement: n = "top", align: a = "center", variant: c = "default" }) {
2404
+ const [d, g] = S(!1), [h, u] = S(null), y = Y(null), f = Y(null), N = Y(void 0), _ = Y(!1), z = Y(null), A = we(), W = () => {
2405
+ clearTimeout(N.current), _.current = !1, z.current = null, g(!1), u(null);
2406
+ }, V = () => {
2407
+ clearTimeout(N.current), g(!0);
2408
+ }, R = () => {
2409
+ clearTimeout(N.current), !_.current && (N.current = setTimeout(() => {
2410
+ _.current || W();
2411
+ }, 150));
2412
+ }, H = () => {
2413
+ c === "card" && (_.current = !0, V());
2414
+ }, F = (M) => {
2415
+ var D, v;
2416
+ return M instanceof Node && (((D = y.current) == null ? void 0 : D.contains(M)) || ((v = f.current) == null ? void 0 : v.contains(M)));
2417
+ };
2418
+ return te(() => () => clearTimeout(N.current), []), te(() => {
2419
+ if (!d) return;
2420
+ const M = (v) => {
2421
+ F(v.target) || W();
2422
+ }, D = (v) => {
2423
+ v.key === "Escape" && W();
2424
+ };
2425
+ return document.addEventListener("pointerdown", M), document.addEventListener("keydown", D), () => {
2426
+ document.removeEventListener("pointerdown", M), document.removeEventListener("keydown", D);
2427
+ };
2428
+ }, [d]), bt(() => {
2429
+ if (!d || !e) return;
2430
+ const M = () => {
2431
+ const v = y.current, b = f.current;
2432
+ if (!v || !b) return;
2433
+ const T = 12, O = 6, p = v.getBoundingClientRect(), C = Math.max(0, p.top - T - O), L = Math.max(0, window.innerHeight - p.bottom - T - O), q = c === "card" ? 420 : 320;
2434
+ if (!z.current) {
2435
+ const $ = c === "card" ? q : Math.min(q, b.getBoundingClientRect().height), x = n === "top" ? C >= $ || C >= L : !(L >= $ || L >= C);
2436
+ z.current = x ? "top" : "bottom";
2437
+ }
2438
+ const k = z.current === "top";
2439
+ b.style.maxHeight = `${Math.min(q, k ? C : L)}px`;
2440
+ const { width: l, height: m } = b.getBoundingClientRect();
2441
+ u({
2442
+ left: Math.max(T, Math.min(
2443
+ a === "end" ? p.right - l : p.left + (p.width - l) / 2,
2444
+ window.innerWidth - l - T
2445
+ )),
2446
+ top: k ? p.top - m - O : p.bottom + O
2447
+ });
2448
+ };
2449
+ M();
2450
+ const D = new ResizeObserver(M);
2451
+ return f.current && D.observe(f.current), window.addEventListener("resize", M), window.addEventListener("scroll", M, !0), () => {
2452
+ D.disconnect(), window.removeEventListener("resize", M), window.removeEventListener("scroll", M, !0);
2453
+ };
2454
+ }, [d, e, n, a, c]), e ? /* @__PURE__ */ s(
1613
2455
  "div",
1614
2456
  {
1615
- className: "relative inline-flex",
1616
- onMouseEnter: () => s(!0),
1617
- onMouseLeave: () => s(!1),
2457
+ ref: y,
2458
+ className: "inline-flex",
2459
+ "aria-describedby": d && c === "default" ? A : void 0,
2460
+ onMouseEnter: V,
2461
+ onMouseLeave: R,
2462
+ onPointerDown: H,
2463
+ onClick: () => {
2464
+ c === "default" && W();
2465
+ },
2466
+ onFocus: V,
2467
+ onBlur: (M) => {
2468
+ F(M.relatedTarget) || (M.relatedTarget ? W() : R());
2469
+ },
1618
2470
  children: [
1619
- t,
1620
- n && /* @__PURE__ */ a(
1621
- "div",
1622
- {
1623
- className: `absolute left-1/2 -translate-x-1/2 z-50 px-2 py-1 bg-gray-800/90 text-white text-xs rounded-md whitespace-nowrap pointer-events-none ${r === "top" ? "bottom-full mb-1.5" : "top-full mt-1.5"}`,
1624
- children: e
1625
- }
2471
+ r,
2472
+ d && vt(
2473
+ /* @__PURE__ */ t(
2474
+ "div",
2475
+ {
2476
+ ref: f,
2477
+ id: A,
2478
+ role: c === "card" ? "dialog" : "tooltip",
2479
+ "aria-label": c === "card" ? "校验问题" : void 0,
2480
+ className: `aisee-articles-tooltip aisee-articles-tooltip--${c}`,
2481
+ style: {
2482
+ width: c === "card" ? 480 : "max-content",
2483
+ maxWidth: "min(480px, calc(100vw - 24px))",
2484
+ overflowWrap: "anywhere",
2485
+ scrollbarWidth: "thin",
2486
+ left: (h == null ? void 0 : h.left) ?? 0,
2487
+ top: (h == null ? void 0 : h.top) ?? 0,
2488
+ visibility: h ? "visible" : "hidden"
2489
+ },
2490
+ onMouseEnter: V,
2491
+ onMouseLeave: R,
2492
+ onPointerDown: H,
2493
+ onFocus: V,
2494
+ children: e
2495
+ }
2496
+ ),
2497
+ document.body
1626
2498
  )
1627
2499
  ]
1628
2500
  }
1629
- ) : /* @__PURE__ */ a(pe, { children: t });
1630
- }
1631
- const Me = [
1632
- { key: "desktop", icon: /* @__PURE__ */ a(et, { size: 13 }), label: "Desktop", width: null },
1633
- { key: "tablet", icon: /* @__PURE__ */ a(rt, { size: 13 }), label: "Tablet", width: 768 },
1634
- { key: "mobile", icon: /* @__PURE__ */ a(tt, { size: 13 }), label: "Mobile", width: 390 }
1635
- ], Nn = ({ id: e, record: t }) => {
1636
- const { navigate: r, params: n, locationState: s } = Ee(), u = e ?? n.id, { basePath: y, service: $, previewBaseUrl: M, previewTailwind: j } = ze(), m = !!u, [S, W] = nt(), [P, E] = A(!1), [I, H] = A(t ?? (s == null ? void 0 : s.record) ?? null), [B, z] = A(""), [p, T] = A(m ? "" : "https://aisee.live"), [O, b] = A(""), [w, R] = A(""), [L, g] = A("code"), [C, q] = A(!1), [G, x] = A("desktop"), [i, o] = A(!1), [d, c] = A(null), v = (h, _) => {
1637
- const Q = M ? `<base href="${M}">` : "", F = _ ? `<meta name="viewport" content="width=${_}, initial-scale=1">` : "", X = _ ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", ee = j && !h.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", V = Q + F + X + ee;
1638
- return V ? h.includes("</head>") ? h.replace("</head>", `${V}
1639
- </head>`) : V + h : h;
1640
- }, k = async () => {
1641
- if (!w.trim()) {
1642
- Z.warning("请先输入 HTML 代码");
2501
+ ) : /* @__PURE__ */ t(be, { children: r });
2502
+ }
2503
+ const We = [
2504
+ { key: "desktop", icon: /* @__PURE__ */ t(Mt, { size: 13 }), label: "桌面", width: null },
2505
+ { key: "tablet", icon: /* @__PURE__ */ t(Ot, { size: 13 }), label: "平板", width: 768 },
2506
+ { key: "mobile", icon: /* @__PURE__ */ t(jt, { size: 13 }), label: "手机", width: 390 }
2507
+ ], Ca = ({ id: e, record: r }) => {
2508
+ const { navigate: n, params: a } = Xe(), c = e ?? a.id, { basePath: d, service: g, previewBaseUrl: h, previewTailwind: u } = Ee(), y = !!c, [f, N] = Pt(), [_, z] = S(!1), [A, W] = S(r ?? null), [V, R] = S(y && !r), [H, F] = S(""), [M, D] = S(y ? "" : "https://aisee.live"), [v, b] = S(""), [T, O] = S(""), [p, C] = S({ title: "", description: "", categoryId: null }), [L, q] = S([]), [k, l] = S(!1), [m, $] = S(""), [x, E] = S(0), P = an(p), i = M.trim().replace(/\/+$/, ""), o = Y(i);
2509
+ o.current = i;
2510
+ const w = g.getGuidesCategories;
2511
+ te(() => {
2512
+ let I = !0;
2513
+ return q([]), $(""), l(!!i && !!w), i && w && w({ host: i }).then((Z) => {
2514
+ I && q(Z);
2515
+ }).catch((Z) => {
2516
+ I && $(Z instanceof Error ? Z.message : "分类加载失败");
2517
+ }).finally(() => {
2518
+ I && l(!1);
2519
+ }), () => {
2520
+ I = !1;
2521
+ };
2522
+ }, [i, w, x]);
2523
+ const [j, G] = S({
2524
+ navEnabled: !1,
2525
+ navname: "",
2526
+ navPlacements: []
2527
+ }), J = (I) => {
2528
+ G({
2529
+ navEnabled: I.navEnabled ?? !1,
2530
+ navname: I.navname ?? "",
2531
+ navPlacements: I.navPlacements ?? []
2532
+ }), C(I.guidesDisplay ?? { title: "", description: "", categoryId: null });
2533
+ }, [B, re] = S(""), [X, ne] = S("code"), [ie, se] = S(!1), [ee, Ie] = S("desktop"), [tt, rt] = S(!1), [ue, Le] = S(null), nt = (I, Z) => {
2534
+ const U = h ? `<base href="${h}">` : "", Q = Z ? `<meta name="viewport" content="width=${Z}, initial-scale=1">` : "", ce = Z ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", de = u && !I.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", pe = U + Q + ce + de;
2535
+ return pe ? I.includes("</head>") ? I.replace("</head>", `${pe}
2536
+ </head>`) : pe + I : I;
2537
+ }, Vt = async () => {
2538
+ if (!B.trim()) {
2539
+ ae.warning("请先输入 HTML 代码");
1643
2540
  return;
1644
2541
  }
1645
- o(!0), c(null);
2542
+ rt(!0), Le(null);
1646
2543
  try {
1647
- const h = await Ve(w);
1648
- c(h), h.networkError ? Z.warning("W3C 校验服务不可用") : h.isValid && Z.success("W3C 校验通过");
2544
+ const I = await ut(B);
2545
+ Le(I), I.networkError ? ae.warning("W3C 校验服务不可用") : I.isValid && ae.success("HTML 校验通过");
1649
2546
  } finally {
1650
- o(!1);
2547
+ rt(!1);
1651
2548
  }
1652
2549
  };
1653
- K(() => {
1654
- m && (I ? (z(I.pathname || ""), T(I.host || ""), R(I.content || "")) : $.getById(u).then((h) => {
1655
- H(h), z(h.pathname || ""), T(h.host || ""), R(h.content || "");
1656
- }).catch((h) => {
1657
- Z.error(h.message || "获取数据失败"), r(y);
1658
- }));
1659
- }, [u]);
1660
- const f = () => r(y), N = !B.trim(), D = async () => {
2550
+ te(() => {
2551
+ if (!y) return;
2552
+ let I = !0;
2553
+ const Z = (U) => {
2554
+ W(U), F(U.pathname || ""), D(U.host || ""), re(U.content || ""), J(U);
2555
+ };
2556
+ if ((r == null ? void 0 : r.id) === c) {
2557
+ Z(r), R(!1);
2558
+ return;
2559
+ }
2560
+ return R(!0), g.getById(c).then((U) => {
2561
+ I && Z(U);
2562
+ }).catch((U) => {
2563
+ I && (ae.error(U instanceof Error ? U.message : "获取文章失败"), n(d));
2564
+ }).finally(() => {
2565
+ I && R(!1);
2566
+ }), () => {
2567
+ I = !1;
2568
+ };
2569
+ }, [c, r, g.getById]);
2570
+ const at = () => n(d), Yt = V || !H.trim(), qt = B.split(`
2571
+ `).length, Bt = async () => {
2572
+ if (_ || V) return;
2573
+ if (!H.trim()) {
2574
+ O("请输入访问路径");
2575
+ return;
2576
+ }
1661
2577
  if (!B.trim()) {
1662
- b("请输入 pathname");
2578
+ se(!0), ae.error("请先输入 HTML 代码");
1663
2579
  return;
1664
2580
  }
1665
- if (!w.trim()) {
1666
- q(!0), Z.error("请输入 HTML 代码");
2581
+ const I = M.trim().replace(/\/+$/, "");
2582
+ try {
2583
+ const Q = new URL(I);
2584
+ if (!["http:", "https:"].includes(Q.protocol) || Q.pathname !== "/" || Q.search || Q.hash || Q.username || Q.password) throw new Error();
2585
+ } catch {
2586
+ b("请输入有效的网站地址,需以 http:// 或 https:// 开头,且不能包含路径、账号、查询参数或锚点");
1667
2587
  return;
1668
2588
  }
1669
- E(!0);
1670
- const h = await Ve(w);
1671
- if (E(!1), h.networkError)
1672
- Z.warning("W3C 校验服务不可用,已跳过校验");
1673
- else if (!h.isValid && !await new Promise((Q) => {
1674
- S.confirm({
1675
- title: "W3C 校验发现问题",
1676
- content: /* @__PURE__ */ l("div", { className: "mt-1", children: [
1677
- /* @__PURE__ */ a("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
1678
- /* @__PURE__ */ l("ul", { className: "space-y-1", children: [
1679
- h.errors.slice(0, 5).map((F, X) => /* @__PURE__ */ l(
2589
+ if (g.getNavigationGroups && j.navEnabled) {
2590
+ if (!j.navname.trim()) {
2591
+ ae.error("开启导航后,请填写导航名称");
2592
+ return;
2593
+ }
2594
+ if (!j.navPlacements.length) {
2595
+ ae.error("请至少选择一个展示位置");
2596
+ return;
2597
+ }
2598
+ }
2599
+ const Z = !!(p.title.trim() || p.description.trim() || P.categoryId || p.categoryId === void 0 && p.category);
2600
+ if (w && Z) {
2601
+ if (!p.title.trim()) {
2602
+ ae.error("配置 Guides 展示时,请填写文章标题");
2603
+ return;
2604
+ }
2605
+ if (p.categoryId === void 0 && !!p.category && !P.categoryId || P.categoryId && (k || m || !L.some((ce) => ce.id === P.categoryId))) {
2606
+ ae.error("请先成功加载并选择有效的 Guides 分类");
2607
+ return;
2608
+ }
2609
+ }
2610
+ z(!0);
2611
+ const U = await ut(B);
2612
+ if (z(!1), U.networkError)
2613
+ ae.warning("W3C 校验服务不可用,已跳过校验");
2614
+ else if (!U.isValid && !await new Promise((ce) => {
2615
+ f.confirm({
2616
+ title: "HTML 校验发现问题",
2617
+ content: /* @__PURE__ */ s("div", { className: "mt-1", children: [
2618
+ /* @__PURE__ */ t("p", { className: "text-gray-600 mb-2", children: "检测到以下 W3C 标准问题,仍要保存吗?" }),
2619
+ /* @__PURE__ */ s("ul", { className: "space-y-1", children: [
2620
+ U.errors.slice(0, 5).map((de, pe) => /* @__PURE__ */ s(
1680
2621
  "li",
1681
2622
  {
1682
2623
  className: "flex items-start gap-1.5 text-red-500 text-sm",
1683
2624
  children: [
1684
- /* @__PURE__ */ a("span", { className: "shrink-0", children: "✕" }),
1685
- /* @__PURE__ */ l("span", { children: [
1686
- F.lastLine ? `第 ${F.lastLine} 行:` : "",
1687
- F.message
2625
+ /* @__PURE__ */ t("span", { className: "shrink-0", children: "✕" }),
2626
+ /* @__PURE__ */ s("span", { children: [
2627
+ de.lastLine ? `第 ${de.lastLine} 行:` : "",
2628
+ de.message
1688
2629
  ] })
1689
2630
  ]
1690
2631
  },
1691
- X
2632
+ pe
1692
2633
  )),
1693
- h.errors.length > 5 && /* @__PURE__ */ l("li", { className: "text-gray-400 text-xs mt-1", children: [
1694
- "还有 ",
1695
- h.errors.length - 5,
1696
- " 个问题…"
2634
+ U.errors.length > 5 && /* @__PURE__ */ s("li", { className: "text-gray-400 text-xs mt-1", children: [
2635
+ "另有 ",
2636
+ U.errors.length - 5,
2637
+ " 个问题"
1697
2638
  ] })
1698
2639
  ] })
1699
2640
  ] }),
1700
2641
  okText: "仍然保存",
1701
2642
  cancelText: "返回修改",
1702
- onOk: () => Q(!0),
1703
- onCancel: () => Q(!1)
2643
+ onOk: () => ce(!0),
2644
+ onCancel: () => ce(!1)
1704
2645
  });
1705
2646
  }))
1706
2647
  return;
1707
- E(!0);
2648
+ z(!0);
1708
2649
  try {
1709
- const _ = {
1710
- pathname: B.trim(),
1711
- content: w,
1712
- host: (p == null ? void 0 : p.trim()) || void 0
2650
+ const Q = {
2651
+ pathname: H.trim(),
2652
+ content: B,
2653
+ host: I,
2654
+ ...w ? {
2655
+ guidesDisplay: Z ? {
2656
+ title: p.title.trim(),
2657
+ description: p.description.trim(),
2658
+ categoryId: P.categoryId
2659
+ } : null
2660
+ } : {},
2661
+ ...g.getNavigationGroups ? {
2662
+ navEnabled: j.navEnabled,
2663
+ navname: j.navname.trim() || null,
2664
+ navPlacements: j.navPlacements.map(({ position: ce, parentNavId: de }) => ({
2665
+ position: ce,
2666
+ parentNavId: de || null
2667
+ }))
2668
+ } : {}
1713
2669
  };
1714
- m && I ? (await $.update(I.id, _), Z.success("编辑成功")) : (await $.create(_), Z.success("添加成功")), r(y);
1715
- } catch (_) {
1716
- Z.error(_.message || "保存失败");
2670
+ y && A ? (await g.update(A.id, Q), ae.success("编辑成功")) : (await g.create(Q), ae.success("新增成功")), n(d);
2671
+ } catch (Q) {
2672
+ ae.error(Q.message || "保存失败");
1717
2673
  } finally {
1718
- E(!1);
2674
+ z(!1);
1719
2675
  }
1720
2676
  };
1721
- return /* @__PURE__ */ l(pe, { children: [
1722
- W,
1723
- /* @__PURE__ */ l(
2677
+ return /* @__PURE__ */ s(be, { children: [
2678
+ N,
2679
+ /* @__PURE__ */ s(
1724
2680
  "div",
1725
2681
  {
1726
2682
  className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
1727
2683
  style: { height: "calc(100vh - 90px)" },
1728
2684
  children: [
1729
- /* @__PURE__ */ l("div", { className: "shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/60", children: [
1730
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3", children: [
1731
- /* @__PURE__ */ a(
2685
+ /* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50/60", children: [
2686
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
2687
+ /* @__PURE__ */ t(
1732
2688
  "button",
1733
2689
  {
2690
+ "aria-label": "返回文章列表",
1734
2691
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-200 transition -ml-1 cursor-pointer",
1735
- onClick: f,
1736
- children: /* @__PURE__ */ a(Qe, { size: 15 })
2692
+ onClick: at,
2693
+ children: /* @__PURE__ */ t(kt, { size: 15 })
1737
2694
  }
1738
2695
  ),
1739
- /* @__PURE__ */ l("div", { children: [
1740
- /* @__PURE__ */ a("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: m ? "编辑 Article" : "新增 Article" }),
1741
- m && I && /* @__PURE__ */ l("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
2696
+ /* @__PURE__ */ s("div", { children: [
2697
+ /* @__PURE__ */ t("div", { className: "text-base font-semibold text-gray-800 leading-tight", children: y ? "编辑文章" : "新增文章" }),
2698
+ y && A && /* @__PURE__ */ s("div", { className: "text-xs text-gray-400 mt-0.5 font-mono", children: [
1742
2699
  "/",
1743
- I.pathname
2700
+ A.pathname
1744
2701
  ] })
1745
2702
  ] })
1746
2703
  ] }),
1747
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
1748
- /* @__PURE__ */ a(
2704
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
2705
+ /* @__PURE__ */ t(
1749
2706
  "button",
1750
2707
  {
1751
2708
  className: "px-4 py-1.5 border border-gray-200 rounded-lg text-sm text-gray-600 hover:bg-gray-50 transition cursor-pointer",
1752
- onClick: f,
2709
+ onClick: at,
1753
2710
  children: "取消"
1754
2711
  }
1755
2712
  ),
1756
- /* @__PURE__ */ a(
2713
+ /* @__PURE__ */ t(
1757
2714
  "button",
1758
2715
  {
1759
- disabled: N || P,
2716
+ disabled: Yt || _,
1760
2717
  className: "px-4 py-1.5 bg-blue-500 hover:bg-blue-600 text-white text-sm rounded-lg transition disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",
1761
- onClick: D,
1762
- children: P ? "保存中…" : "保存"
2718
+ onClick: Bt,
2719
+ children: V ? "加载中…" : _ ? "保存中…" : "保存"
1763
2720
  }
1764
2721
  )
1765
2722
  ] })
1766
2723
  ] }),
1767
- /* @__PURE__ */ a("div", { className: "shrink-0 px-6 pt-5 pb-4 border-b border-gray-100", children: /* @__PURE__ */ l("div", { className: "flex gap-4", children: [
1768
- /* @__PURE__ */ l("div", { className: "flex-1", children: [
1769
- /* @__PURE__ */ l("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
1770
- "Pathname",
1771
- /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台网站路径" })
1772
- ] }),
1773
- /* @__PURE__ */ l(
1774
- "div",
1775
- {
1776
- className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${O ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
1777
- children: [
1778
- /* @__PURE__ */ a("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
1779
- /* @__PURE__ */ a(
1780
- "input",
1781
- {
1782
- className: "flex-1 pr-3 py-1.5 text-sm bg-transparent focus:outline-none",
1783
- placeholder: "例如 about-us",
1784
- value: B,
1785
- onChange: (h) => {
1786
- z(h.target.value), O && b("");
1787
- }
2724
+ /* @__PURE__ */ s("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: [
2725
+ /* @__PURE__ */ s("div", { className: "shrink-0 px-6 pt-5 pb-4 border-b border-gray-100", children: [
2726
+ /* @__PURE__ */ s("div", { className: "flex flex-col gap-4 sm:flex-row", children: [
2727
+ /* @__PURE__ */ s("div", { className: "flex-1", children: [
2728
+ /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
2729
+ "访问路径",
2730
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "前台页面路径" })
2731
+ ] }),
2732
+ /* @__PURE__ */ s(
2733
+ "div",
2734
+ {
2735
+ className: `flex items-center border rounded-lg transition focus-within:ring-2 focus-within:ring-blue-500/30 focus-within:border-blue-400 ${T ? "border-red-400 ring-2 ring-red-500/20" : "border-gray-200"}`,
2736
+ children: [
2737
+ /* @__PURE__ */ t("span", { className: "pl-3 text-gray-400 select-none text-sm shrink-0", children: "/" }),
2738
+ /* @__PURE__ */ t(
2739
+ "input",
2740
+ {
2741
+ className: "flex-1 pr-3 py-1.5 text-sm bg-transparent focus:outline-none",
2742
+ placeholder: "例如 about-us",
2743
+ value: H,
2744
+ onChange: (I) => {
2745
+ F(I.target.value), T && O("");
2746
+ }
2747
+ }
2748
+ )
2749
+ ]
2750
+ }
2751
+ ),
2752
+ /* @__PURE__ */ t("p", { className: "text-xs text-gray-500 mt-1.5", children: "建议使用小写字母,不能包含空格,例如 about-us。" }),
2753
+ T && /* @__PURE__ */ t("p", { className: "text-red-500 text-xs mt-1", children: T })
2754
+ ] }),
2755
+ /* @__PURE__ */ s("div", { className: "flex-1", children: [
2756
+ /* @__PURE__ */ s("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
2757
+ "网站地址",
2758
+ /* @__PURE__ */ t("span", { className: "text-red-500 ml-1", children: "*" }),
2759
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "网站基础地址" })
2760
+ ] }),
2761
+ /* @__PURE__ */ t(
2762
+ "input",
2763
+ {
2764
+ className: "w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
2765
+ placeholder: "例如 https://aisee.live",
2766
+ value: M,
2767
+ "aria-label": "网站地址",
2768
+ "aria-invalid": !!v,
2769
+ onChange: (I) => {
2770
+ const Z = I.target.value;
2771
+ Z.trim().replace(/\/+$/, "") !== M.trim().replace(/\/+$/, "") && (C((U) => ({ ...U, categoryId: null })), G((U) => ({
2772
+ ...U,
2773
+ navPlacements: U.navPlacements.map((Q) => ({ ...Q, parentNavId: null }))
2774
+ }))), D(Z), b("");
1788
2775
  }
1789
- )
1790
- ]
1791
- }
1792
- ),
1793
- /* @__PURE__ */ a("p", { className: "text-xs text-gray-500 mt-1.5", children: "建议使用小写字母,不能包含空格,例如 about-us。" }),
1794
- O && /* @__PURE__ */ a("p", { className: "text-red-500 text-xs mt-1", children: O })
1795
- ] }),
1796
- /* @__PURE__ */ l("div", { className: "flex-1", children: [
1797
- /* @__PURE__ */ l("label", { className: "block text-sm font-medium text-gray-700 mb-1.5", children: [
1798
- "Website URL",
1799
- /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 font-normal ml-1.5", children: "可跳转的网站地址" })
2776
+ }
2777
+ ),
2778
+ v && /* @__PURE__ */ t("p", { role: "alert", className: "mt-1 text-xs text-red-500", children: v })
2779
+ ] })
2780
+ ] }),
2781
+ w && /* @__PURE__ */ s(be, { children: [
2782
+ /* @__PURE__ */ t(
2783
+ nn,
2784
+ {
2785
+ value: { ...P, ...p.categoryId === void 0 && !P.categoryId ? { category: p.category } : {} },
2786
+ categories: L,
2787
+ categoriesDisabled: !i || k || !!m,
2788
+ onChange: C,
2789
+ onLoadCategories: async () => {
2790
+ const I = await w({ host: i });
2791
+ return o.current === i && q(I), I;
2792
+ },
2793
+ onReorderCategories: g.reorderGuidesCategories ? async (I) => {
2794
+ const Z = await g.reorderGuidesCategories({ host: i, categoryIds: I });
2795
+ return o.current === i && q(Z), Z;
2796
+ } : void 0,
2797
+ onSaveCategory: g.saveGuidesCategory ? async (I) => {
2798
+ const Z = await g.saveGuidesCategory({ ...I, host: i });
2799
+ return o.current === i && q((U) => U.some((Q) => Q.id === Z.id) ? U.map((Q) => Q.id === Z.id ? Z : Q) : [...U, Z]), Z;
2800
+ } : void 0
2801
+ },
2802
+ i
2803
+ ),
2804
+ k && /* @__PURE__ */ t("p", { role: "status", className: "mt-2 text-xs text-gray-500", children: "加载 Guides 分类中…" }),
2805
+ m && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
2806
+ m,
2807
+ /* @__PURE__ */ t("button", { type: "button", onClick: () => E((I) => I + 1), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
2808
+ ] })
1800
2809
  ] }),
1801
- /* @__PURE__ */ a(
1802
- "input",
2810
+ /* @__PURE__ */ t(
2811
+ rn,
1803
2812
  {
1804
- className: "w-full px-3 py-1.5 text-sm border border-gray-200 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500/30 focus:border-blue-400 transition",
1805
- placeholder: "例如 https://aisee.live",
1806
- value: p,
1807
- onChange: (h) => T(h.target.value)
2813
+ host: M,
2814
+ service: g,
2815
+ value: j,
2816
+ onChange: G
1808
2817
  }
1809
2818
  )
1810
- ] })
1811
- ] }) }),
1812
- /* @__PURE__ */ a("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-6 py-2", children: [
1813
- /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ l("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
1814
- /* @__PURE__ */ l(
1815
- "button",
1816
- {
1817
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${L === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
1818
- onClick: () => g("code"),
1819
- children: [
1820
- /* @__PURE__ */ a(Xe, { size: 11 }),
1821
- " Code"
1822
- ]
1823
- }
1824
- ),
1825
- /* @__PURE__ */ l(
2819
+ ] }),
2820
+ /* @__PURE__ */ t("div", { className: "shrink-0 border-b border-gray-100 bg-gray-50/40", children: /* @__PURE__ */ s("div", { className: "flex flex-wrap items-center justify-between gap-2 px-6 py-2", children: [
2821
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ s("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: [
2822
+ /* @__PURE__ */ s(
2823
+ "button",
2824
+ {
2825
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${X === "code" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2826
+ onClick: () => ne("code"),
2827
+ children: [
2828
+ /* @__PURE__ */ t(Qe, { size: 11 }),
2829
+ " 代码"
2830
+ ]
2831
+ }
2832
+ ),
2833
+ /* @__PURE__ */ s(
2834
+ "button",
2835
+ {
2836
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${X === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : B ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
2837
+ onClick: () => ne("preview"),
2838
+ disabled: !B,
2839
+ children: [
2840
+ /* @__PURE__ */ t(qe, { size: 11 }),
2841
+ " 预览"
2842
+ ]
2843
+ }
2844
+ )
2845
+ ] }) }),
2846
+ X === "preview" && B && /* @__PURE__ */ t("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: We.map((I) => /* @__PURE__ */ t(Oe, { title: I.label, children: /* @__PURE__ */ t(
1826
2847
  "button",
1827
2848
  {
1828
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none ${L === "preview" ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50 cursor-pointer" : w ? "text-gray-400 hover:text-gray-600 hover:bg-white/50 cursor-pointer" : "text-gray-300 cursor-not-allowed"}`,
1829
- onClick: () => g("preview"),
1830
- disabled: !w,
1831
- children: [
1832
- /* @__PURE__ */ a(Pe, { size: 11 }),
1833
- " 预览"
1834
- ]
2849
+ className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${ee === I.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2850
+ onClick: () => Ie(I.key),
2851
+ children: I.icon
1835
2852
  }
1836
- )
1837
- ] }) }),
1838
- L === "preview" && w && /* @__PURE__ */ a("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Me.map((h) => /* @__PURE__ */ a(ye, { title: h.label, children: /* @__PURE__ */ a(
1839
- "button",
1840
- {
1841
- className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${G === h.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
1842
- onClick: () => x(h.key),
1843
- children: h.icon
1844
- }
1845
- ) }, h.key)) }),
1846
- L === "code" && /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
1847
- w && /* @__PURE__ */ l("span", { className: "text-xs text-gray-400", children: [
1848
- w.split(`
1849
- `).length,
1850
- " 行 ·",
1851
- " ",
1852
- w.length,
1853
- " 字符"
1854
- ] }),
1855
- d && !d.networkError && (d.isValid ? /* @__PURE__ */ l("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
1856
- /* @__PURE__ */ a(We, { size: 11 }),
1857
- " 校验通过"
1858
- ] }) : /* @__PURE__ */ a(
1859
- ye,
1860
- {
1861
- title: /* @__PURE__ */ l("ul", { className: "m-0 pl-0 list-none space-y-1 max-w-xs", children: [
1862
- d.errors.slice(0, 5).map(
1863
- (h, _) => /* @__PURE__ */ l(
1864
- "li",
1865
- {
1866
- className: "text-xs",
1867
- children: [
1868
- h.lastLine ? `第 ${h.lastLine} 行:` : "",
1869
- h.message
1870
- ]
1871
- },
1872
- _
1873
- )
1874
- ),
1875
- d.errors.length > 5 && /* @__PURE__ */ l("li", { className: "text-gray-400 text-xs", children: [
1876
- "还有",
1877
- " ",
1878
- d.errors.length - 5,
2853
+ ) }, I.key)) }),
2854
+ X === "code" && /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-wrap items-center gap-2", children: [
2855
+ B && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400", children: [
2856
+ qt,
2857
+ " 行 · ",
2858
+ B.length,
2859
+ " 字符"
2860
+ ] }),
2861
+ ue && !ue.networkError && (ue.isValid ? /* @__PURE__ */ s("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-green-50 border border-green-200 text-green-600 text-xs", children: [
2862
+ /* @__PURE__ */ t(lt, { size: 11 }),
2863
+ " 校验通过"
2864
+ ] }) : /* @__PURE__ */ t(
2865
+ Oe,
2866
+ {
2867
+ variant: "card",
2868
+ align: "end",
2869
+ title: /* @__PURE__ */ t(on, { errors: ue.errors, source: B }),
2870
+ children: /* @__PURE__ */ s("span", { tabIndex: 0, className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 border border-red-200 text-red-500 text-xs cursor-default", children: [
2871
+ "✕",
1879
2872
  " ",
1880
- "个问题…"
2873
+ ue.errors.length,
2874
+ " 个问题"
1881
2875
  ] })
1882
- ] }),
1883
- children: /* @__PURE__ */ l("span", { className: "flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-50 border border-red-200 text-red-500 text-xs cursor-default", children: [
1884
- "✕",
1885
- " ",
1886
- d.errors.length,
1887
- " ",
1888
- "个问题"
1889
- ] })
1890
- }
1891
- )),
1892
- /* @__PURE__ */ l(
1893
- "button",
2876
+ }
2877
+ )),
2878
+ /* @__PURE__ */ s(
2879
+ "button",
2880
+ {
2881
+ disabled: !B || tt,
2882
+ className: "flex items-center gap-1.5 px-2.5 py-1 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
2883
+ onClick: Vt,
2884
+ children: [
2885
+ /* @__PURE__ */ t(lt, { size: 12 }),
2886
+ tt ? "校验中…" : "W3C 校验"
2887
+ ]
2888
+ }
2889
+ )
2890
+ ] })
2891
+ ] }) }),
2892
+ /* @__PURE__ */ s("div", { className: "relative min-h-[320px] flex-1 shrink-0", children: [
2893
+ /* @__PURE__ */ t(
2894
+ "div",
1894
2895
  {
1895
- disabled: !w || i,
1896
- className: "flex items-center gap-1.5 px-2.5 py-1 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition disabled:opacity-40 disabled:cursor-not-allowed cursor-pointer",
1897
- onClick: k,
1898
- children: [
1899
- /* @__PURE__ */ a(We, { size: 12 }),
1900
- i ? "校验中…" : "W3C 校验"
1901
- ]
2896
+ className: "absolute inset-0",
2897
+ style: {
2898
+ display: X === "code" ? "block" : "none",
2899
+ outline: ie ? "2px solid #ff4d4f" : "none"
2900
+ },
2901
+ children: /* @__PURE__ */ t(
2902
+ fa,
2903
+ {
2904
+ height: "100%",
2905
+ language: "html",
2906
+ theme: "vs-dark",
2907
+ value: B,
2908
+ onChange: (I) => {
2909
+ re(I ?? ""), ie && se(!1), ue && Le(null);
2910
+ },
2911
+ options: {
2912
+ fontSize: 13,
2913
+ minimap: { enabled: !1 },
2914
+ wordWrap: "on",
2915
+ scrollBeyondLastLine: !1,
2916
+ automaticLayout: !0,
2917
+ tabSize: 2,
2918
+ formatOnPaste: !0,
2919
+ lineNumbers: "on",
2920
+ renderWhitespace: "none",
2921
+ smoothScrolling: !0,
2922
+ cursorBlinking: "smooth",
2923
+ padding: { top: 12, bottom: 12 }
2924
+ }
2925
+ }
2926
+ )
1902
2927
  }
1903
- )
1904
- ] })
1905
- ] }) }),
1906
- /* @__PURE__ */ l("div", { className: "flex-1 min-h-0 relative", children: [
1907
- /* @__PURE__ */ a(
1908
- "div",
1909
- {
1910
- className: "absolute inset-0",
1911
- style: {
1912
- display: L === "code" ? "block" : "none",
1913
- outline: C ? "2px solid #ff4d4f" : "none"
1914
- },
1915
- children: /* @__PURE__ */ a(
1916
- fn,
1917
- {
2928
+ ),
2929
+ X === "preview" && (B ? /* @__PURE__ */ t("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: ee !== "desktop" ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ t(
2930
+ "iframe",
2931
+ {
2932
+ srcDoc: nt(
2933
+ B,
2934
+ We.find(
2935
+ (I) => I.key === ee
2936
+ ).width
2937
+ ),
2938
+ sandbox: "allow-same-origin allow-scripts",
2939
+ title: "HTML 预览",
2940
+ style: {
2941
+ width: `${We.find(
2942
+ (I) => I.key === ee
2943
+ ).width}px`,
1918
2944
  height: "100%",
1919
- language: "html",
1920
- theme: "vs-dark",
1921
- value: w,
1922
- onChange: (h) => {
1923
- R(h ?? ""), C && q(!1), d && c(null);
1924
- },
1925
- options: {
1926
- fontSize: 13,
1927
- minimap: { enabled: !1 },
1928
- wordWrap: "on",
1929
- scrollBeyondLastLine: !1,
1930
- automaticLayout: !0,
1931
- tabSize: 2,
1932
- formatOnPaste: !0,
1933
- lineNumbers: "on",
1934
- renderWhitespace: "none",
1935
- smoothScrolling: !0,
1936
- cursorBlinking: "smooth",
1937
- padding: { top: 12, bottom: 12 }
1938
- }
2945
+ minHeight: 0,
2946
+ border: "1px solid #e5e7eb",
2947
+ borderRadius: 10,
2948
+ background: "#fff",
2949
+ boxShadow: "0 4px 24px 0 rgba(0,0,0,0.10)",
2950
+ flexShrink: 0
1939
2951
  }
1940
- )
1941
- }
1942
- ),
1943
- L === "preview" && (w ? /* @__PURE__ */ a("div", { className: "absolute inset-0 overflow-auto bg-gray-100/60 flex justify-center", children: G !== "desktop" ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ a(
1944
- "iframe",
1945
- {
1946
- srcDoc: v(
1947
- w,
1948
- Me.find(
1949
- (h) => h.key === G
1950
- ).width
1951
- ),
1952
- sandbox: "allow-same-origin allow-scripts",
1953
- title: "HTML 预览",
1954
- style: {
1955
- width: `${Me.find(
1956
- (h) => h.key === G
1957
- ).width}px`,
1958
- height: "100%",
1959
- minHeight: 0,
1960
- border: "1px solid #e5e7eb",
1961
- borderRadius: 10,
1962
- background: "#fff",
1963
- boxShadow: "0 4px 24px 0 rgba(0,0,0,0.10)",
1964
- flexShrink: 0
1965
2952
  }
1966
- }
1967
- ) }) : /* @__PURE__ */ a(
1968
- "iframe",
1969
- {
1970
- srcDoc: v(
1971
- w
1972
- ),
1973
- sandbox: "allow-same-origin allow-scripts",
1974
- title: "HTML 预览",
1975
- style: {
1976
- width: "100%",
1977
- height: "100%",
1978
- border: "none",
1979
- background: "#fff",
1980
- display: "block"
2953
+ ) }) : /* @__PURE__ */ t(
2954
+ "iframe",
2955
+ {
2956
+ srcDoc: nt(
2957
+ B
2958
+ ),
2959
+ sandbox: "allow-same-origin allow-scripts",
2960
+ title: "HTML 预览",
2961
+ style: {
2962
+ width: "100%",
2963
+ height: "100%",
2964
+ border: "none",
2965
+ background: "#fff",
2966
+ display: "block"
2967
+ }
1981
2968
  }
1982
- }
1983
- ) }) : /* @__PURE__ */ l("div", { className: "flex flex-col items-center justify-center h-full text-gray-300 gap-3 select-none", children: [
1984
- /* @__PURE__ */ a(Pe, { size: 36 }),
1985
- /* @__PURE__ */ a("span", { className: "text-sm", children: "请先输入 HTML 代码" })
1986
- ] }))
2969
+ ) }) : /* @__PURE__ */ s("div", { className: "flex flex-col items-center justify-center h-full text-gray-300 gap-3 select-none", children: [
2970
+ /* @__PURE__ */ t(qe, { size: 36 }),
2971
+ /* @__PURE__ */ t("span", { className: "text-sm", children: "请先输入 HTML 代码以预览" })
2972
+ ] }))
2973
+ ] })
1987
2974
  ] })
1988
2975
  ]
1989
2976
  }
1990
2977
  )
1991
2978
  ] });
1992
- }, Ce = [
1993
- { key: "desktop", icon: /* @__PURE__ */ a(et, { size: 13 }), label: "Desktop", width: null },
1994
- { key: "tablet", icon: /* @__PURE__ */ a(rt, { size: 13 }), label: "Tablet", width: 768 },
1995
- { key: "mobile", icon: /* @__PURE__ */ a(tt, { size: 13 }), label: "Mobile", width: 390 }
1996
- ], kn = ({
2979
+ }, Re = [
2980
+ { key: "desktop", icon: /* @__PURE__ */ t(Mt, { size: 13 }), label: "Desktop", width: null },
2981
+ { key: "tablet", icon: /* @__PURE__ */ t(Ot, { size: 13 }), label: "Tablet", width: 768 },
2982
+ { key: "mobile", icon: /* @__PURE__ */ t(jt, { size: 13 }), label: "Mobile", width: 390 }
2983
+ ], Ma = ({
1997
2984
  id: e,
1998
- record: t
2985
+ record: r
1999
2986
  }) => {
2000
- const { navigate: r, params: n, locationState: s } = Ee(), u = e ?? n.id, { basePath: y, service: $, previewBaseUrl: M, previewTailwind: j } = ze(), [m, S] = A(
2001
- t ?? (s == null ? void 0 : s.record) ?? null
2002
- ), [W, P] = A(!1), [E, I] = A("preview"), [H, B] = A("desktop");
2003
- K(() => {
2004
- !m && u && (P(!0), $.getById(u).then(S).catch((b) => {
2005
- Z.error(b.message || "获取数据失败"), r(y);
2006
- }).finally(() => P(!1)));
2007
- }, [u]);
2008
- const z = () => r(y), p = () => r(`${y}/${u}/edit`, { state: { record: m } }), T = () => {
2009
- m != null && m.content && (navigator.clipboard.writeText(m.content), Z.success("已复制到剪贴板"));
2010
- }, O = (b, w) => {
2011
- const R = M ? `<base href="${M}">` : "", L = w ? `<meta name="viewport" content="width=${w}, initial-scale=1">` : "", g = w ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", C = j && !b.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", q = R + L + g + C;
2012
- return q ? b.includes("</head>") ? b.replace("</head>", `${q}
2013
- </head>`) : q + b : b;
2987
+ const { navigate: n, params: a, locationState: c } = Xe(), d = e ?? a.id, { basePath: g, service: h, previewBaseUrl: u, previewTailwind: y } = Ee(), [f, N] = S(
2988
+ r ?? (c == null ? void 0 : c.record) ?? null
2989
+ ), [_, z] = S(!1), [A, W] = S("preview"), [V, R] = S("desktop");
2990
+ te(() => {
2991
+ !f && d && (z(!0), h.getById(d).then(N).catch((v) => {
2992
+ ae.error(v.message || "获取数据失败"), n(g);
2993
+ }).finally(() => z(!1)));
2994
+ }, [d]);
2995
+ const H = () => n(g), F = () => n(`${g}/${d}/edit`, { state: { record: f } }), M = () => {
2996
+ f != null && f.content && (navigator.clipboard.writeText(f.content), ae.success("已复制到剪贴板"));
2997
+ }, D = (v, b) => {
2998
+ const T = u ? `<base href="${u}">` : "", O = b ? `<meta name="viewport" content="width=${b}, initial-scale=1">` : "", p = b ? "<style>*,*::before,*::after{box-sizing:border-box}img,video,svg,canvas,audio{max-width:100%;height:auto}pre{white-space:pre-wrap;word-break:break-word;overflow-x:auto}table{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}</style>" : "", C = y && !v.includes("cdn.tailwindcss.com") ? '<script src="https://cdn.tailwindcss.com"><\/script>' : "", L = T + O + p + C;
2999
+ return L ? v.includes("</head>") ? v.replace("</head>", `${L}
3000
+ </head>`) : L + v : v;
2014
3001
  };
2015
- return W ? /* @__PURE__ */ a("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ l(
3002
+ return _ ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
2016
3003
  "div",
2017
3004
  {
2018
3005
  className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
2019
3006
  style: { height: "calc(100vh - 90px)" },
2020
3007
  children: [
2021
- /* @__PURE__ */ l("div", { className: "flex items-center justify-between px-5 py-3.5 border-b border-gray-100 bg-white shrink-0", children: [
2022
- /* @__PURE__ */ l("div", { className: "flex items-center gap-3 min-w-0", children: [
2023
- /* @__PURE__ */ a(
3008
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-between px-5 py-3.5 border-b border-gray-100 bg-white shrink-0", children: [
3009
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-3 min-w-0", children: [
3010
+ /* @__PURE__ */ t(
2024
3011
  "button",
2025
3012
  {
2026
3013
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100 transition -ml-1 shrink-0 cursor-pointer",
2027
- onClick: z,
2028
- children: /* @__PURE__ */ a(Qe, { size: 15 })
3014
+ onClick: H,
3015
+ children: /* @__PURE__ */ t(kt, { size: 15 })
2029
3016
  }
2030
3017
  ),
2031
- /* @__PURE__ */ a(
3018
+ /* @__PURE__ */ t(
2032
3019
  "div",
2033
3020
  {
2034
3021
  className: "flex items-center justify-center w-8 h-8 rounded-lg shrink-0",
2035
3022
  style: {
2036
3023
  background: "linear-gradient(135deg, #60a5fa, #818cf8)"
2037
3024
  },
2038
- children: /* @__PURE__ */ a(Et, { size: 13, className: "text-white" })
3025
+ children: /* @__PURE__ */ t(Mr, { size: 13, className: "text-white" })
2039
3026
  }
2040
3027
  ),
2041
- /* @__PURE__ */ l("div", { className: "min-w-0", children: [
2042
- /* @__PURE__ */ a("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
2043
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
2044
- /* @__PURE__ */ a(Wt, { size: 9 }),
3028
+ /* @__PURE__ */ s("div", { className: "min-w-0", children: [
3029
+ /* @__PURE__ */ t("div", { className: "font-semibold text-gray-800 text-sm leading-tight", children: "Article 详情" }),
3030
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1 mt-0.5", children: /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1 px-1.5 py-0 rounded bg-blue-50 border border-blue-100 text-blue-600 font-mono text-xs leading-5 truncate max-w-[300px]", children: [
3031
+ /* @__PURE__ */ t(Ir, { size: 9 }),
2045
3032
  "/",
2046
- m == null ? void 0 : m.pathname
3033
+ f == null ? void 0 : f.pathname
2047
3034
  ] }) })
2048
3035
  ] })
2049
3036
  ] }),
2050
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2 shrink-0", children: [
2051
- E === "preview" && /* @__PURE__ */ a("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Ce.map((b) => /* @__PURE__ */ a(ye, { title: b.label, children: /* @__PURE__ */ a(
3037
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2 shrink-0", children: [
3038
+ A === "preview" && /* @__PURE__ */ t("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: Re.map((v) => /* @__PURE__ */ t(Oe, { title: v.label, children: /* @__PURE__ */ t(
2052
3039
  "button",
2053
3040
  {
2054
- className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${H === b.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2055
- onClick: () => B(b.key),
2056
- children: b.icon
3041
+ className: `flex items-center justify-center w-7 h-6 rounded-md text-xs transition-all duration-150 select-none cursor-pointer ${V === v.key ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
3042
+ onClick: () => R(v.key),
3043
+ children: v.icon
2057
3044
  }
2058
- ) }, b.key)) }),
2059
- /* @__PURE__ */ a("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((b) => /* @__PURE__ */ a(
3045
+ ) }, v.key)) }),
3046
+ /* @__PURE__ */ t("div", { className: "flex items-center bg-gray-100/80 rounded-lg p-0.5 gap-0.5 border border-gray-200/60", children: ["preview", "code"].map((v) => /* @__PURE__ */ t(
2060
3047
  "button",
2061
3048
  {
2062
- className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${E === b ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
2063
- onClick: () => I(b),
2064
- children: b === "preview" ? /* @__PURE__ */ l(pe, { children: [
2065
- /* @__PURE__ */ a(Pe, { size: 11 }),
3049
+ className: `flex items-center gap-1.5 px-3 py-1 rounded-md text-xs font-medium transition-all duration-150 select-none cursor-pointer ${A === v ? "bg-white text-gray-800 shadow-sm ring-1 ring-gray-200/50" : "text-gray-400 hover:text-gray-600 hover:bg-white/50"}`,
3050
+ onClick: () => W(v),
3051
+ children: v === "preview" ? /* @__PURE__ */ s(be, { children: [
3052
+ /* @__PURE__ */ t(qe, { size: 11 }),
2066
3053
  " 预览"
2067
- ] }) : /* @__PURE__ */ l(pe, { children: [
2068
- /* @__PURE__ */ a(Xe, { size: 11 }),
3054
+ ] }) : /* @__PURE__ */ s(be, { children: [
3055
+ /* @__PURE__ */ t(Qe, { size: 11 }),
2069
3056
  " Code"
2070
3057
  ] })
2071
3058
  },
2072
- b
3059
+ v
2073
3060
  )) }),
2074
- E === "code" && /* @__PURE__ */ a(ye, { title: "复制代码", children: /* @__PURE__ */ a(
3061
+ A === "code" && /* @__PURE__ */ t(Oe, { title: "复制代码", children: /* @__PURE__ */ t(
2075
3062
  "button",
2076
3063
  {
3064
+ type: "button",
3065
+ "aria-label": "复制代码",
2077
3066
  className: "flex items-center justify-center w-7 h-7 rounded-lg text-gray-400 hover:text-blue-500 hover:bg-blue-50 transition cursor-pointer",
2078
- onClick: T,
2079
- children: /* @__PURE__ */ a(Dt, { size: 14 })
3067
+ onClick: M,
3068
+ children: /* @__PURE__ */ t(wr, { size: 14 })
2080
3069
  }
2081
3070
  ) })
2082
3071
  ] })
2083
3072
  ] }),
2084
- /* @__PURE__ */ a(
3073
+ /* @__PURE__ */ t(
2085
3074
  "div",
2086
3075
  {
2087
- className: `flex-1 min-h-0 ${E === "preview" ? "bg-gray-100/70" : ""}`,
2088
- children: E === "preview" ? /* @__PURE__ */ a("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: H !== "desktop" ? /* @__PURE__ */ a("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ a(
3076
+ className: `flex-1 min-h-0 ${A === "preview" ? "bg-gray-100/70" : ""}`,
3077
+ children: A === "preview" ? /* @__PURE__ */ t("div", { className: "w-full h-full flex justify-center overflow-auto py-0", children: V !== "desktop" ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center py-6 h-full", children: /* @__PURE__ */ t(
2089
3078
  "iframe",
2090
3079
  {
2091
- srcDoc: O(
2092
- (m == null ? void 0 : m.content) || "",
2093
- Ce.find(
2094
- (b) => b.key === H
3080
+ srcDoc: D(
3081
+ (f == null ? void 0 : f.content) || "",
3082
+ Re.find(
3083
+ (v) => v.key === V
2095
3084
  ).width
2096
3085
  ),
2097
3086
  sandbox: "allow-same-origin allow-scripts",
2098
3087
  title: "HTML 预览",
2099
3088
  style: {
2100
- width: `${Ce.find(
2101
- (b) => b.key === H
3089
+ width: `${Re.find(
3090
+ (v) => v.key === V
2102
3091
  ).width}px`,
2103
3092
  height: "100%",
2104
3093
  minHeight: 0,
@@ -2109,11 +3098,11 @@ const Me = [
2109
3098
  flexShrink: 0
2110
3099
  }
2111
3100
  }
2112
- ) }) : /* @__PURE__ */ a(
3101
+ ) }) : /* @__PURE__ */ t(
2113
3102
  "iframe",
2114
3103
  {
2115
- srcDoc: O(
2116
- (m == null ? void 0 : m.content) || ""
3104
+ srcDoc: D(
3105
+ (f == null ? void 0 : f.content) || ""
2117
3106
  ),
2118
3107
  sandbox: "allow-same-origin allow-scripts",
2119
3108
  title: "HTML 预览",
@@ -2125,13 +3114,13 @@ const Me = [
2125
3114
  display: "block"
2126
3115
  }
2127
3116
  }
2128
- ) }) : /* @__PURE__ */ l(
3117
+ ) }) : /* @__PURE__ */ s(
2129
3118
  "div",
2130
3119
  {
2131
3120
  className: "h-full flex flex-col",
2132
3121
  style: { background: "#1e1e2e" },
2133
3122
  children: [
2134
- /* @__PURE__ */ l(
3123
+ /* @__PURE__ */ s(
2135
3124
  "div",
2136
3125
  {
2137
3126
  className: "shrink-0 flex items-center justify-between px-4 py-2 border-b",
@@ -2140,13 +3129,13 @@ const Me = [
2140
3129
  background: "#252536"
2141
3130
  },
2142
3131
  children: [
2143
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
2144
- /* @__PURE__ */ l("div", { className: "flex gap-1.5", children: [
2145
- /* @__PURE__ */ a("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
2146
- /* @__PURE__ */ a("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
2147
- /* @__PURE__ */ a("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
3132
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
3133
+ /* @__PURE__ */ s("div", { className: "flex gap-1.5", children: [
3134
+ /* @__PURE__ */ t("span", { className: "w-3 h-3 rounded-full bg-red-400/80 inline-block" }),
3135
+ /* @__PURE__ */ t("span", { className: "w-3 h-3 rounded-full bg-yellow-400/80 inline-block" }),
3136
+ /* @__PURE__ */ t("span", { className: "w-3 h-3 rounded-full bg-green-400/80 inline-block" })
2148
3137
  ] }),
2149
- /* @__PURE__ */ a(
3138
+ /* @__PURE__ */ t(
2150
3139
  "span",
2151
3140
  {
2152
3141
  className: "text-xs font-mono ml-2",
@@ -2155,24 +3144,24 @@ const Me = [
2155
3144
  }
2156
3145
  )
2157
3146
  ] }),
2158
- /* @__PURE__ */ a(
3147
+ /* @__PURE__ */ t(
2159
3148
  "span",
2160
3149
  {
2161
3150
  className: "text-xs font-mono",
2162
3151
  style: { color: "#6c7086" },
2163
- children: m != null && m.content ? `${m.content.split(`
2164
- `).length} 行 · ${m.content.length} 字符` : "空"
3152
+ children: f != null && f.content ? `${f.content.split(`
3153
+ `).length} 行 · ${f.content.length} 字符` : "空"
2165
3154
  }
2166
3155
  )
2167
3156
  ]
2168
3157
  }
2169
3158
  ),
2170
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ a(
3159
+ /* @__PURE__ */ t("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ t(
2171
3160
  "pre",
2172
3161
  {
2173
3162
  className: "m-0 p-5 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",
2174
3163
  style: { color: "#cdd6f4" },
2175
- children: (m == null ? void 0 : m.content) || /* @__PURE__ */ a("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
3164
+ children: (f == null ? void 0 : f.content) || /* @__PURE__ */ t("span", { style: { color: "#585b70" }, children: "// 暂无内容" })
2176
3165
  }
2177
3166
  ) })
2178
3167
  ]
@@ -2180,26 +3169,26 @@ const Me = [
2180
3169
  )
2181
3170
  }
2182
3171
  ),
2183
- /* @__PURE__ */ l("div", { className: "shrink-0 flex items-center justify-between px-5 py-2.5 border-t border-gray-100 bg-gray-50/60", children: [
2184
- /* @__PURE__ */ l("div", { className: "flex items-center gap-4 text-xs text-gray-400", children: [
2185
- (m == null ? void 0 : m.createdAt) && /* @__PURE__ */ l("span", { children: [
3172
+ /* @__PURE__ */ s("div", { className: "shrink-0 flex items-center justify-between px-5 py-2.5 border-t border-gray-100 bg-gray-50/60", children: [
3173
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-4 text-xs text-gray-400", children: [
3174
+ (f == null ? void 0 : f.createdAt) && /* @__PURE__ */ s("span", { children: [
2186
3175
  "创建于",
2187
3176
  " ",
2188
- De(m.createdAt).format("YYYY/MM/DD HH:mm")
3177
+ Be(f.createdAt).format("YYYY/MM/DD HH:mm")
2189
3178
  ] }),
2190
- (m == null ? void 0 : m.updatedAt) && /* @__PURE__ */ l("span", { children: [
3179
+ (f == null ? void 0 : f.updatedAt) && /* @__PURE__ */ s("span", { children: [
2191
3180
  "更新于",
2192
3181
  " ",
2193
- De(m.updatedAt).format("YYYY/MM/DD HH:mm")
3182
+ Be(f.updatedAt).format("YYYY/MM/DD HH:mm")
2194
3183
  ] })
2195
3184
  ] }),
2196
- /* @__PURE__ */ l(
3185
+ /* @__PURE__ */ s(
2197
3186
  "button",
2198
3187
  {
2199
3188
  className: "flex items-center gap-1.5 px-3 py-1.5 text-xs border border-gray-200 rounded-lg hover:bg-gray-50 text-gray-600 transition cursor-pointer",
2200
- onClick: p,
3189
+ onClick: F,
2201
3190
  children: [
2202
- /* @__PURE__ */ a(qt, { size: 12 }),
3191
+ /* @__PURE__ */ t(St, { size: 12 }),
2203
3192
  "编辑"
2204
3193
  ]
2205
3194
  }
@@ -2210,12 +3199,13 @@ const Me = [
2210
3199
  );
2211
3200
  };
2212
3201
  export {
2213
- kn as ArticleDetail,
2214
- Nn as ArticleEdit,
2215
- wn as ArticleList,
2216
- xn as ArticlesProvider,
2217
- vn as ReactRouterAdapter,
2218
- Cn as createArticleService,
2219
- ht as defaultArticleService,
2220
- Sn as renderArticleByPathname
3202
+ Ma as ArticleDetail,
3203
+ Ca as ArticleEdit,
3204
+ $a as ArticleList,
3205
+ Oa as ArticleServiceError,
3206
+ Na as ArticlesProvider,
3207
+ ka as ReactRouterAdapter,
3208
+ Ea as createArticleService,
3209
+ Ft as defaultArticleService,
3210
+ Pa as renderArticleByPathname
2221
3211
  };