@web-mods/articles 1.1.5 → 1.1.6

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
@@ -18,16 +18,16 @@ const Ye = /* @__PURE__ */ new Set();
18
18
  function st() {
19
19
  Ye.forEach((e) => e([...me]));
20
20
  }
21
- function _e(e, r) {
21
+ function Le(e, r) {
22
22
  const n = Math.random().toString(36).slice(2);
23
23
  me = [...me, { id: n, type: e, content: r }], st(), setTimeout(() => {
24
24
  me = me.filter((a) => a.id !== n), st();
25
25
  }, 3e3);
26
26
  }
27
27
  const ae = {
28
- success: (e) => _e("success", e),
29
- error: (e) => _e("error", e),
30
- warning: (e) => _e("warning", e)
28
+ success: (e) => Le("success", e),
29
+ error: (e) => Le("error", e),
30
+ warning: (e) => Le("warning", e)
31
31
  };
32
32
  function Jt(e) {
33
33
  return Ye.add(e), () => {
@@ -177,7 +177,7 @@ const ar = (e) => {
177
177
  size: y = 24,
178
178
  strokeWidth: f = 2,
179
179
  absoluteStrokeWidth: N = !1,
180
- color: _ = "currentColor",
180
+ color: L = "currentColor",
181
181
  className: z = ""
182
182
  } = sr() ?? {}, A = a ?? N ? Number(n ?? f) * 24 / Number(r ?? y) : n ?? f;
183
183
  return Ve(
@@ -187,14 +187,14 @@ const ar = (e) => {
187
187
  ...Te,
188
188
  width: r ?? y ?? Te.width,
189
189
  height: r ?? y ?? Te.height,
190
- stroke: e ?? _,
190
+ stroke: e ?? L,
191
191
  strokeWidth: A,
192
192
  className: Nt("lucide", z, c),
193
193
  ...!d && !ar(h) && { "aria-hidden": "true" },
194
194
  ...h
195
195
  },
196
196
  [
197
- ...g.map(([W, V]) => Ve(W, V)),
197
+ ...g.map(([G, V]) => Ve(G, V)),
198
198
  ...Array.isArray(d) ? d : [d]
199
199
  ]
200
200
  );
@@ -411,18 +411,18 @@ const Dr = [
411
411
  * This source code is licensed under the ISC license.
412
412
  * See the LICENSE file in the root directory of this source tree.
413
413
  */
414
- const Lr = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Pe = K("loader-circle", Lr);
414
+ const _r = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]], Pe = K("loader-circle", _r);
415
415
  /**
416
416
  * @license lucide-react v1.11.0 - ISC
417
417
  *
418
418
  * This source code is licensed under the ISC license.
419
419
  * See the LICENSE file in the root directory of this source tree.
420
420
  */
421
- const _r = [
421
+ const Lr = [
422
422
  ["rect", { width: "20", height: "14", x: "2", y: "3", rx: "2", key: "48i651" }],
423
423
  ["line", { x1: "8", x2: "16", y1: "21", y2: "21", key: "1svkeh" }],
424
424
  ["line", { x1: "12", x2: "12", y1: "17", y2: "21", key: "vw1qmm" }]
425
- ], Mt = K("monitor", _r);
425
+ ], Mt = K("monitor", Lr);
426
426
  /**
427
427
  * @license lucide-react v1.11.0 - ISC
428
428
  *
@@ -465,10 +465,10 @@ const Hr = [
465
465
  * This source code is licensed under the ISC license.
466
466
  * See the LICENSE file in the root directory of this source tree.
467
467
  */
468
- const Gr = [
468
+ const Wr = [
469
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" }],
470
470
  ["path", { d: "M3 3v5h5", key: "1xhq8a" }]
471
- ], Wr = K("rotate-ccw", Gr);
471
+ ], Gr = K("rotate-ccw", Wr);
472
472
  /**
473
473
  * @license lucide-react v1.11.0 - ISC
474
474
  *
@@ -534,7 +534,7 @@ function Kr() {
534
534
  (function(n, a) {
535
535
  e.exports = a();
536
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) {
537
+ var n = 1e3, a = 6e4, c = 36e5, d = "millisecond", g = "second", h = "minute", u = "hour", y = "day", f = "week", N = "month", L = "quarter", z = "year", A = "date", G = "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
538
  var l = ["th", "st", "nd", "rd"], m = k % 100;
539
539
  return "[" + k + (l[(m - 20) % 10] || l[m] || l[0]) + "]";
540
540
  } }, F = function(k, l, m) {
@@ -550,13 +550,13 @@ function Kr() {
550
550
  }, a: function(k) {
551
551
  return k < 0 ? Math.ceil(k) || 0 : Math.floor(k);
552
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$/, "");
553
+ return { M: N, y: z, w: f, d: y, D: A, h: u, m: h, s: g, ms: d, Q: L }[k] || String(k || "").toLowerCase().replace(/s$/, "");
554
554
  }, u: function(k) {
555
555
  return k === void 0;
556
556
  } }, D = "en", v = {};
557
557
  v[D] = H;
558
558
  var b = "$isDayjsObject", T = function(k) {
559
- return k instanceof L || !(!k || !k[b]);
559
+ return k instanceof _ || !(!k || !k[b]);
560
560
  }, O = function k(l, m, $) {
561
561
  var x;
562
562
  if (!l) return D;
@@ -573,12 +573,12 @@ function Kr() {
573
573
  }, p = function(k, l) {
574
574
  if (T(k)) return k.clone();
575
575
  var m = typeof l == "object" ? l : {};
576
- return m.date = k, m.args = arguments, new L(m);
576
+ return m.date = k, m.args = arguments, new _(m);
577
577
  }, C = M;
578
578
  C.l = O, C.i = T, C.w = function(k, l) {
579
579
  return p(k, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
580
580
  };
581
- var L = (function() {
581
+ var _ = (function() {
582
582
  function k(m) {
583
583
  this.$L = O(m.locale, null, !0), this.parse(m), this.$x = this.$x || m.x || {}, this[b] = !0;
584
584
  }
@@ -604,7 +604,7 @@ function Kr() {
604
604
  }, l.$utils = function() {
605
605
  return C;
606
606
  }, l.isValid = function() {
607
- return this.$d.toString() !== W;
607
+ return this.$d.toString() !== G;
608
608
  }, l.isSame = function(m, $) {
609
609
  var x = p(m);
610
610
  return this.startOf($) <= x && x <= this.endOf($);
@@ -624,7 +624,7 @@ function Kr() {
624
624
  return E ? ie : ie.endOf(y);
625
625
  }, o = function(X, ne) {
626
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" : "");
627
+ }, w = this.$W, j = this.$M, W = this.$D, J = "set" + (this.$u ? "UTC" : "");
628
628
  switch (P) {
629
629
  case z:
630
630
  return E ? i(1, 0) : i(31, 11);
@@ -632,7 +632,7 @@ function Kr() {
632
632
  return E ? i(1, j) : i(0, j + 1);
633
633
  case f:
634
634
  var B = this.$locale().weekStart || 0, re = (w < B ? w + 7 : w) - B;
635
- return i(E ? G - re : G + (6 - re), j);
635
+ return i(E ? W - re : W + (6 - re), j);
636
636
  case y:
637
637
  case A:
638
638
  return o(J + "Hours", 0);
@@ -662,8 +662,8 @@ function Kr() {
662
662
  var x, E = this;
663
663
  m = Number(m);
664
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);
665
+ var W = p(E);
666
+ return C.w(W.date(W.date() + Math.round(j * m)), E);
667
667
  };
668
668
  if (P === N) return this.set(N, this.$M + m);
669
669
  if (P === z) return this.set(z, this.$y + m);
@@ -675,8 +675,8 @@ function Kr() {
675
675
  return this.add(-1 * m, $);
676
676
  }, l.format = function(m) {
677
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) {
678
+ if (!this.isValid()) return x.invalidDate || G;
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, W = x.months, J = x.meridiem, B = function(ne, ie, se, ee) {
680
680
  return ne && (ne[ie] || ne($, E)) || se[ie].slice(0, ee);
681
681
  }, re = function(ne) {
682
682
  return C.s(i % 12 || 12, ne, "0");
@@ -696,9 +696,9 @@ function Kr() {
696
696
  case "MM":
697
697
  return C.s(w + 1, 2, "0");
698
698
  case "MMM":
699
- return B(x.monthsShort, w, G, 3);
699
+ return B(x.monthsShort, w, W, 3);
700
700
  case "MMMM":
701
- return B(G, w);
701
+ return B(W, w);
702
702
  case "D":
703
703
  return $.$D;
704
704
  case "DD":
@@ -742,18 +742,18 @@ function Kr() {
742
742
  }, l.utcOffset = function() {
743
743
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
744
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() {
745
+ var E, P = this, i = C.p($), o = p(m), w = (o.utcOffset() - this.utcOffset()) * a, j = this - o, W = function() {
746
746
  return C.m(P, o);
747
747
  };
748
748
  switch (i) {
749
749
  case z:
750
- E = G() / 12;
750
+ E = W() / 12;
751
751
  break;
752
752
  case N:
753
- E = G();
753
+ E = W();
754
754
  break;
755
- case _:
756
- E = G() / 3;
755
+ case L:
756
+ E = W() / 3;
757
757
  break;
758
758
  case f:
759
759
  E = (j - w) / 6048e5;
@@ -793,13 +793,13 @@ function Kr() {
793
793
  }, l.toString = function() {
794
794
  return this.$d.toUTCString();
795
795
  }, k;
796
- })(), q = L.prototype;
796
+ })(), q = _.prototype;
797
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
798
  q[k[1]] = function(l) {
799
799
  return this.$g(l, k[0], k[1]);
800
800
  };
801
801
  })), p.extend = function(k, l) {
802
- return k.$i || (k(l, L, p), k.$i = !0), p;
802
+ return k.$i || (k(l, _, p), k.$i = !0), p;
803
803
  }, p.locale = O, p.isDayjs = T, p.unix = function(k) {
804
804
  return p(1e3 * k);
805
805
  }, p.en = v[D], p.Ls = v, p.p = {}, p;
@@ -814,16 +814,16 @@ function Pt() {
814
814
  c.current = N, a(!1), r(!0);
815
815
  }
816
816
  }, g = async () => {
817
- var N, _;
817
+ var N, L;
818
818
  a(!0);
819
819
  try {
820
- await ((_ = (N = c.current).onOk) == null ? void 0 : _.call(N)), r(!1);
820
+ await ((L = (N = c.current).onOk) == null ? void 0 : L.call(N)), r(!1);
821
821
  } finally {
822
822
  a(!1);
823
823
  }
824
824
  }, h = () => {
825
- var N, _;
826
- (_ = (N = c.current).onCancel) == null || _.call(N), r(!1);
825
+ var N, L;
826
+ (L = (N = c.current).onCancel) == null || L.call(N), r(!1);
827
827
  }, u = c.current, y = u.okType === "danger", f = e ? vt(
828
828
  /* @__PURE__ */ s("div", { className: "fixed inset-0 z-[9998] flex items-center justify-center", children: [
829
829
  /* @__PURE__ */ t(
@@ -891,18 +891,18 @@ function Xr({ article: e, groups: r, canLoadGroups: n, onRetry: a }) {
891
891
  var g;
892
892
  const c = e.navPlacements ?? [], d = (g = e.navname) == null ? void 0 : g.trim();
893
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 ? "已开启" : "已关闭" })
894
+ /* @__PURE__ */ s("div", { className: "grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-start gap-x-2 gap-y-1 leading-5", children: [
895
+ /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "导航名称" }),
896
+ /* @__PURE__ */ t(Se, { enabled: !!e.navEnabled, children: e.navEnabled ? "已开启" : "已关闭" }),
897
+ /* @__PURE__ */ t("span", { title: d, className: "col-span-2 min-w-0 whitespace-normal text-sm font-medium text-gray-800 [overflow-wrap:anywhere]", children: d || "尚未填写" })
898
898
  ] }),
899
899
  e.navEnabled && ["header", "footer"].map((h) => {
900
900
  const u = c.find((A) => A.position === h);
901
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" ? "页眉" : "页尾";
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"), L = u.parentNavId ? f ? `${f} 分组内` : N ? "正在加载分组…" : "分组名称加载失败" : "直接显示链接", z = h === "header" ? "页眉" : "页尾";
903
903
  return /* @__PURE__ */ s("div", { className: "flex min-w-0 items-center gap-2 text-xs leading-5", children: [
904
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: _ }),
905
+ /* @__PURE__ */ t("span", { title: `${z}:${L}`, className: "truncate text-gray-600", children: L }),
906
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
907
  ] }, h);
908
908
  }),
@@ -910,7 +910,7 @@ function Xr({ article: e, groups: r, canLoadGroups: n, onRetry: a }) {
910
910
  ] });
911
911
  }
912
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({
913
+ const { navigate: e } = Xe(), { basePath: r, service: n } = Ee(), [a, c] = Pt(), [d, g] = S(""), [h, u] = S(""), [y, f] = S(!1), [N, L] = S([]), [z, A] = S({}), [G, V] = S(0), [R, H] = S({
914
914
  current: 1,
915
915
  size: 15,
916
916
  total: 0
@@ -929,10 +929,10 @@ const $a = () => {
929
929
  try {
930
930
  const C = { page: b, size: T };
931
931
  O && (C.pathname = O);
932
- const L = F(p);
933
- L && (C.host = L);
932
+ const _ = F(p);
933
+ _ && (C.host = _);
934
934
  const q = await n.getList(C);
935
- _(q.items), H((k) => ({
935
+ L(q.items), H((k) => ({
936
936
  ...k,
937
937
  current: b,
938
938
  size: T,
@@ -963,7 +963,7 @@ const $a = () => {
963
963
  try {
964
964
  const C = await n.getNavigationGroups(p);
965
965
  if (!b) return;
966
- A((L) => ({ ...L, [O]: { status: "loaded", names: Object.fromEntries(C.map((q) => [q.id, q.name])) } }));
966
+ A((_) => ({ ..._, [O]: { status: "loaded", names: Object.fromEntries(C.map((q) => [q.id, q.name])) } }));
967
967
  } catch {
968
968
  if (!b) return;
969
969
  A((C) => ({ ...C, [O]: { status: "error", names: {} } }));
@@ -972,7 +972,7 @@ const $a = () => {
972
972
  return () => {
973
973
  b = !1;
974
974
  };
975
- }, [N, n, W]);
975
+ }, [N, n, G]);
976
976
  const D = (b) => {
977
977
  a.confirm({
978
978
  title: "删除文章",
@@ -1041,7 +1041,7 @@ const $a = () => {
1041
1041
  g(""), u(""), M(1, R.size, "", "");
1042
1042
  },
1043
1043
  children: [
1044
- /* @__PURE__ */ t(Wr, { className: "w-3.5 h-3.5" }),
1044
+ /* @__PURE__ */ t(Gr, { className: "w-3.5 h-3.5" }),
1045
1045
  "重置"
1046
1046
  ]
1047
1047
  }
@@ -1054,14 +1054,14 @@ const $a = () => {
1054
1054
  ]
1055
1055
  }
1056
1056
  ),
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: [
1057
+ /* @__PURE__ */ t("div", { className: "relative overflow-x-auto", role: "region", "aria-label": "文章列表", tabIndex: 0, children: /* @__PURE__ */ s("table", { className: "w-full min-w-[1440px] table-fixed text-left text-sm", children: [
1058
1058
  /* @__PURE__ */ s("colgroup", { children: [
1059
- /* @__PURE__ */ t("col", { style: { width: "8%" } }),
1060
- /* @__PURE__ */ t("col", { style: { width: "16%" } }),
1059
+ /* @__PURE__ */ t("col", { style: { width: "18%" } }),
1061
1060
  /* @__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%" } })
1061
+ /* @__PURE__ */ t("col", { style: { width: "19%" } }),
1062
+ /* @__PURE__ */ t("col", { style: { width: "15%" } }),
1063
+ /* @__PURE__ */ t("col", { style: { width: "11%" } }),
1064
+ /* @__PURE__ */ t("col", { style: { width: "13%" } })
1065
1065
  ] }),
1066
1066
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ s("tr", { className: "border-b border-gray-100", children: [
1067
1067
  /* @__PURE__ */ t("th", { scope: "col", className: "px-3 py-2.5 text-xs font-medium tracking-wide text-gray-400", children: "访问路径" }),
@@ -1078,7 +1078,7 @@ const $a = () => {
1078
1078
  const T = `/${b.pathname.replace(/^\/+/, "")}`, O = b.host ? `${b.host.replace(/\/+$/, "")}${T}` : void 0;
1079
1079
  return /* @__PURE__ */ s("tr", { className: "group border-b border-gray-50 transition-colors hover:bg-gray-50/60", children: [
1080
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: [
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: "aisee-articles-address-link inline-flex max-w-full items-center gap-1 text-xs transition-all", children: [
1082
1082
  /* @__PURE__ */ t("span", { className: "truncate", children: O.replace(/^https?:\/\//, "") }),
1083
1083
  /* @__PURE__ */ t(kr, { size: 12, className: "shrink-0", "aria-hidden": "true" })
1084
1084
  ] }) : /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "未填写" }) }),
@@ -1141,7 +1141,7 @@ const $a = () => {
1141
1141
  ] });
1142
1142
  };
1143
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);
1144
+ const h = we(), [u, y] = S(() => [...e]), [f, N] = S(!1), [L, z] = S(""), [A, G] = 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
1145
  te(() => {
1146
1146
  p.current = !0;
1147
1147
  const i = T.current;
@@ -1149,7 +1149,7 @@ function It({ items: e, label: r, description: n, presentation: a = "inline", sa
1149
1149
  p.current = !1, O.current && clearTimeout(O.current), i.forEach((o) => o.cancel());
1150
1150
  };
1151
1151
  }, []);
1152
- const L = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, q = () => {
1152
+ const _ = () => window.matchMedia("(prefers-reduced-motion: reduce)").matches, q = () => {
1153
1153
  var i;
1154
1154
  return Array.from(((i = D.current) == null ? void 0 : i.querySelectorAll("[data-order-id]")) ?? []);
1155
1155
  }, k = () => {
@@ -1159,11 +1159,11 @@ function It({ items: e, label: r, description: n, presentation: a = "inline", sa
1159
1159
  const i = b.current;
1160
1160
  b.current = null;
1161
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 }) => {
1162
+ if (T.current.forEach((j) => j.cancel()), T.current.clear(), !i || _()) return;
1163
+ o.map((j) => ({ row: j, delta: (i.get(j.dataset.orderId) ?? j.getBoundingClientRect().top) - j.getBoundingClientRect().top })).forEach(({ row: j, delta: W }) => {
1164
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)` },
1165
+ j.dataset.orderId === ((J = v.current) == null ? void 0 : J.id) || Math.abs(W) < 1 || T.current.set(j, j.animate([
1166
+ { transform: `translateY(${W}px)` },
1167
1167
  { transform: "translateY(0)" }
1168
1168
  ], { duration: 210, easing: "cubic-bezier(0.22, 1, 0.36, 1)" }));
1169
1169
  });
@@ -1175,24 +1175,24 @@ function It({ items: e, label: r, description: n, presentation: a = "inline", sa
1175
1175
  const w = i + o;
1176
1176
  if (C.current || v.current || w < 0 || w >= u.length) return;
1177
1177
  const j = [...u];
1178
- [j[i], j[w]] = [j[w], j[i]], k(), y(j), z(""), W(`${u[i].name}已移至第 ${w + 1} 位`);
1178
+ [j[i], j[w]] = [j[w], j[i]], k(), y(j), z(""), G(`${u[i].name}已移至第 ${w + 1} 位`);
1179
1179
  }, $ = (i, o) => {
1180
1180
  var J;
1181
1181
  if (C.current || v.current || !i.isPrimary || i.button !== 0) return;
1182
1182
  const w = i.currentTarget.closest("[data-order-id]");
1183
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 取消。`);
1184
+ const j = w.getBoundingClientRect(), W = 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 - W.top }), R(o.id), z(""), G(`已拿起${o.name},上下拖动调整顺序,按 Escape 取消。`);
1186
1186
  }, x = (i) => {
1187
1187
  const o = v.current;
1188
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);
1189
+ const w = i.clientY, j = D.current.getBoundingClientRect(), W = 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 = W + 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
1190
  if (X && ie >= 0 && se >= 0 && ie !== se && (ie < se ? re >= X.offsetTop + X.offsetHeight / 2 : re <= X.offsetTop + X.offsetHeight / 2)) {
1191
1191
  k();
1192
1192
  const ee = [...u], [Ie] = ee.splice(ie, 1);
1193
1193
  ee.splice(se, 0, Ie), y(ee);
1194
1194
  }
1195
- M.current && (M.current.style.transform = `translate3d(${J}px, ${G}px, 0)`);
1195
+ M.current && (M.current.style.transform = `translate3d(${J}px, ${W}px, 0)`);
1196
1196
  }, E = (i = !1) => {
1197
1197
  var J, B;
1198
1198
  const o = v.current;
@@ -1202,17 +1202,17 @@ function It({ items: e, label: r, description: n, presentation: a = "inline", sa
1202
1202
  v.current = null, O.current = null, R(null), F(null);
1203
1203
  };
1204
1204
  if (i) {
1205
- k(), y(o.original), W("已取消本次拖动。"), w();
1205
+ k(), y(o.original), G("已取消本次拖动。"), w();
1206
1206
  return;
1207
1207
  }
1208
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()) {
1209
+ G(`${((B = u[j]) == null ? void 0 : B.name) ?? r}已移至第 ${j + 1} 位。`);
1210
+ const W = q().find((re) => re.dataset.orderId === o.id);
1211
+ if (!M.current || !W || _()) {
1212
1212
  w();
1213
1213
  return;
1214
1214
  }
1215
- M.current.dataset.dropping = "true", M.current.style.transform = `translate3d(0, ${G.offsetTop}px, 0)`, O.current = setTimeout(w, 190);
1215
+ M.current.dataset.dropping = "true", M.current.style.transform = `translate3d(0, ${W.offsetTop}px, 0)`, O.current = setTimeout(w, 190);
1216
1216
  }, P = async () => {
1217
1217
  if (!(!l || C.current || v.current)) {
1218
1218
  C.current = !0, N(!0), z("");
@@ -1286,7 +1286,7 @@ function It({ items: e, label: r, description: n, presentation: a = "inline", sa
1286
1286
  }
1287
1287
  ),
1288
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: _ }),
1289
+ L && /* @__PURE__ */ t("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: L }),
1290
1290
  /* @__PURE__ */ s("div", { className: "mt-3 flex flex-wrap justify-end gap-2", children: [
1291
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
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: [
@@ -1310,7 +1310,7 @@ function Qr({ host: e, position: r, groups: n, reorder: a, onSaved: c, onCancel:
1310
1310
  }
1311
1311
  );
1312
1312
  }
1313
- function Lt({ id: e, open: r, busy: n, label: a, onDismiss: c, children: d }) {
1313
+ function _t({ id: e, open: r, busy: n, label: a, onDismiss: c, children: d }) {
1314
1314
  const g = Y(null);
1315
1315
  return te(() => {
1316
1316
  var h, u, y;
@@ -1324,7 +1324,7 @@ const en = [
1324
1324
  { position: "footer", label: "页尾", icon: zr, parentEnabled: !0 }
1325
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
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);
1327
+ const h = we(), [u, y] = S([]), [f, N] = S(!1), [L, z] = S(""), [A, G] = S(!1), [V, R] = S(""), [H, F] = S(""), [M, D] = S(!1), [v, b] = S(!1), [T, O] = S(!1), [p, C] = S(!1), _ = Y(0), q = Y(0), k = Y(g);
1328
1328
  k.current = g;
1329
1329
  const l = c.getNavigationGroups, m = c.createNavigationGroup, $ = c.reorderNavigationGroups, x = Me(async () => {
1330
1330
  if (!e || !l) return;
@@ -1339,8 +1339,8 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1339
1339
  o === q.current && N(!1);
1340
1340
  }
1341
1341
  }, [e, r, l]);
1342
- te(() => (L.current++, x(), () => {
1343
- L.current++, q.current++;
1342
+ te(() => (_.current++, x(), () => {
1343
+ _.current++, q.current++;
1344
1344
  }), [x]);
1345
1345
  const E = async () => {
1346
1346
  if (M || !m || !a) return;
@@ -1349,37 +1349,37 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1349
1349
  F("请输入父导航名称");
1350
1350
  return;
1351
1351
  }
1352
- const w = u.find((G) => G.name === o);
1352
+ const w = u.find((W) => W.name === o);
1353
1353
  if (w) {
1354
- k.current(w.id), W(!1);
1354
+ k.current(w.id), G(!1);
1355
1355
  return;
1356
1356
  }
1357
- const j = L.current;
1357
+ const j = _.current;
1358
1358
  D(!0), F("");
1359
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) {
1360
+ const W = await m({ host: e, position: r, name: o });
1361
+ if (j !== _.current) return;
1362
+ y((J) => [...J.filter((B) => B.id !== W.id), W]), k.current(W.id), G(!1), R(""), x();
1363
+ } catch (W) {
1364
+ if (j !== _.current) return;
1365
+ if ((W == null ? void 0 : W.status) === 409) {
1366
1366
  const J = await x();
1367
- if (j !== L.current) return;
1367
+ if (j !== _.current) return;
1368
1368
  const B = J == null ? void 0 : J.find((re) => re.name === o);
1369
1369
  if (B) {
1370
- k.current(B.id), W(!1), R("");
1370
+ k.current(B.id), G(!1), R("");
1371
1371
  return;
1372
1372
  }
1373
1373
  }
1374
- F(G instanceof Error ? G.message : "新增父导航失败");
1374
+ F(W instanceof Error ? W.message : "新增父导航失败");
1375
1375
  } finally {
1376
- j === L.current && D(!1);
1376
+ j === _.current && D(!1);
1377
1377
  }
1378
1378
  }, P = !!d && !u.some((o) => o.id === d), i = async () => {
1379
- const o = L.current;
1379
+ const o = _.current;
1380
1380
  O(!1);
1381
1381
  const w = await x();
1382
- w && o === L.current && w.length > 1 && b(!0);
1382
+ w && o === _.current && w.length > 1 && b(!0);
1383
1383
  };
1384
1384
  return /* @__PURE__ */ s("div", { children: [
1385
1385
  /* @__PURE__ */ s("div", { className: "mb-1.5 flex flex-wrap items-center justify-between gap-2", children: [
@@ -1388,12 +1388,12 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1388
1388
  /* @__PURE__ */ t("span", { className: "font-normal text-gray-400", children: "(可选)" })
1389
1389
  ] }),
1390
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: [
1391
+ a && $ && e && /* @__PURE__ */ s("button", { type: "button", disabled: f || M || A || v || !!L || 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
1392
  /* @__PURE__ */ t($t, { size: 12, "aria-hidden": "true" }),
1393
1393
  "调整顺序"
1394
1394
  ] }),
1395
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);
1396
+ G(!0), R(""), F(""), O(!1);
1397
1397
  }, className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1398
1398
  /* @__PURE__ */ t(et, { size: 13, "aria-hidden": "true" }),
1399
1399
  "新增父导航"
@@ -1422,13 +1422,13 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1422
1422
  ),
1423
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
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
- _,
1425
+ L && /* @__PURE__ */ s("p", { role: "alert", className: "mt-2 text-xs text-red-500", children: [
1426
+ L,
1427
1427
  /* @__PURE__ */ t("button", { type: "button", onClick: () => void x(), className: "ml-2 cursor-pointer text-blue-500", children: "重试" })
1428
1428
  ] }),
1429
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("");
1430
+ /* @__PURE__ */ t(_t, { id: `${h}-dialog`, open: v || A, busy: M || p, label: v ? "父导航顺序" : A ? `新增${n}父导航` : void 0, onDismiss: () => {
1431
+ G(!1), b(!1), F("");
1432
1432
  }, children: v && $ ? /* @__PURE__ */ t(
1433
1433
  Qr,
1434
1434
  {
@@ -1436,12 +1436,12 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1436
1436
  position: r,
1437
1437
  groups: u,
1438
1438
  reorder: async (o) => {
1439
- const w = L.current;
1439
+ const w = _.current;
1440
1440
  C(!0);
1441
1441
  try {
1442
1442
  return await $(o);
1443
1443
  } finally {
1444
- w === L.current && C(!1);
1444
+ w === _.current && C(!1);
1445
1445
  }
1446
1446
  },
1447
1447
  onSaved: (o) => {
@@ -1485,7 +1485,7 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1485
1485
  M ? /* @__PURE__ */ t(Pe, { size: 12, className: "animate-spin" }) : /* @__PURE__ */ t(Ct, { size: 12, "aria-hidden": "true" }),
1486
1486
  M ? "添加中…" : "添加并选中"
1487
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: [
1488
+ /* @__PURE__ */ s("button", { type: "button", disabled: M, onClick: () => G(!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
1489
  /* @__PURE__ */ t(Et, { size: 12, "aria-hidden": "true" }),
1490
1490
  "取消"
1491
1491
  ] })
@@ -1494,9 +1494,9 @@ function tn({ host: e, position: r, label: n, parentEnabled: a, service: c, pare
1494
1494
  ] });
1495
1495
  }
1496
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, _) => {
1497
+ const c = we(), d = e.trim().replace(/\/+$/, ""), [g, h] = S(!1), u = !!r.getNavigationGroups, y = (N) => a({ ...n, ...N }), f = (N, L) => {
1498
1498
  y({
1499
- navPlacements: _ ? [...n.navPlacements, { position: N, parentNavId: null }] : n.navPlacements.filter((z) => z.position !== N)
1499
+ navPlacements: L ? [...n.navPlacements, { position: N, parentNavId: null }] : n.navPlacements.filter((z) => z.position !== N)
1500
1500
  });
1501
1501
  };
1502
1502
  return /* @__PURE__ */ s("section", { "aria-label": "导航设置", className: "mt-5 border-t border-gray-100 pt-5", children: [
@@ -1553,24 +1553,24 @@ function rn({ host: e, service: r, value: n, onChange: a }) {
1553
1553
  "展示位置 ",
1554
1554
  /* @__PURE__ */ t("span", { className: "text-red-500", children: "*" })
1555
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: [
1556
+ /* @__PURE__ */ t("div", { className: "grid grid-cols-1 gap-3 sm:grid-cols-2", children: en.map(({ position: N, label: L, icon: z, parentEnabled: A }) => {
1557
+ const G = n.navPlacements.find((V) => V.position === N);
1558
+ return /* @__PURE__ */ s("div", { role: "group", "aria-label": `${L}导航设置`, className: `min-w-0 self-start rounded-lg border p-3 transition-colors ${G ? "border-blue-200 bg-blue-50/30" : "border-gray-200 bg-white"}`, children: [
1559
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" }),
1560
+ /* @__PURE__ */ t("input", { type: "checkbox", checked: !!G, onChange: (V) => f(N, V.target.checked), className: "h-4 w-4 shrink-0 accent-blue-500" }),
1561
1561
  /* @__PURE__ */ t(z, { size: 15, className: "shrink-0 text-gray-400", "aria-hidden": "true" }),
1562
- /* @__PURE__ */ t("span", { className: "font-medium", children: _ })
1562
+ /* @__PURE__ */ t("span", { className: "font-medium", children: L })
1563
1563
  ] }),
1564
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(
1565
+ G && /* @__PURE__ */ t("div", { className: "mt-3 border-t border-gray-200/70 pt-3", children: /* @__PURE__ */ t(
1566
1566
  tn,
1567
1567
  {
1568
1568
  host: d,
1569
1569
  position: N,
1570
- label: _,
1570
+ label: L,
1571
1571
  parentEnabled: A,
1572
1572
  service: r,
1573
- parentNavId: W.parentNavId,
1573
+ parentNavId: G.parentNavId,
1574
1574
  onSelect: (V) => y({ navPlacements: n.navPlacements.map((R) => R.position === N ? { ...R, parentNavId: V } : R) })
1575
1575
  },
1576
1576
  `${d}:${N}`
@@ -1585,22 +1585,22 @@ function rn({ host: e, service: r, value: n, onChange: a }) {
1585
1585
  }
1586
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
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;
1588
+ const h = we(), [u, y] = S(null), [f, N] = S(""), [L, z] = S(!1), [A, G] = 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), _ = Y(!1), q = Y(!1);
1589
+ te(() => (_.current = !0, () => {
1590
+ _.current = !1;
1591
1591
  }), []);
1592
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
1593
  $.current = e;
1594
1594
  const x = (i) => a({ ...e, ...i }), E = async () => {
1595
1595
  if (!(C.current || !g || n || u || H)) {
1596
- C.current = !0, D(!0), b(""), W("");
1596
+ C.current = !0, D(!0), b(""), G("");
1597
1597
  try {
1598
1598
  const i = d ? await d() : r;
1599
- L.current && F(i);
1599
+ _.current && F(i);
1600
1600
  } catch (i) {
1601
- L.current && b(i instanceof Error ? i.message : "分类加载失败,请重试");
1601
+ _.current && b(i instanceof Error ? i.message : "分类加载失败,请重试");
1602
1602
  } finally {
1603
- C.current = !1, L.current && D(!1);
1603
+ C.current = !1, _.current && D(!1);
1604
1604
  }
1605
1605
  }
1606
1606
  }, P = async () => {
@@ -1617,12 +1617,12 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1617
1617
  q.current = !0, R(!0), N("");
1618
1618
  try {
1619
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);
1620
+ if (!_.current) return;
1621
+ a({ ...$.current, categoryId: o.id }), G(u.id ? "分类已更新" : "分类已新增并选中"), y(null);
1622
1622
  } catch (o) {
1623
- L.current && N(o instanceof Error ? o.message : "分类保存失败,请重试");
1623
+ _.current && N(o instanceof Error ? o.message : "分类保存失败,请重试");
1624
1624
  } finally {
1625
- q.current = !1, L.current && R(!1);
1625
+ q.current = !1, _.current && R(!1);
1626
1626
  }
1627
1627
  };
1628
1628
  return /* @__PURE__ */ s("section", { "aria-labelledby": `${h}-heading`, className: "mt-5 border-t border-gray-100 pt-5", children: [
@@ -1637,8 +1637,8 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1637
1637
  ] }),
1638
1638
  /* @__PURE__ */ t("span", { className: "text-xs text-gray-400", children: "用于文章卡片" })
1639
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() ? "请输入文章展示标题" : "可使用比导航名称更完整的标题。" })
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": L && !e.title.trim(), "aria-describedby": `${h}-title-hint`, className: fe }),
1641
+ /* @__PURE__ */ t("p", { id: `${h}-title-hint`, className: `mt-1.5 text-xs ${L && !e.title.trim() ? "text-red-500" : "text-gray-400"}`, role: L && !e.title.trim() ? "alert" : void 0, children: L && !e.title.trim() ? "请输入文章展示标题" : "可使用比导航名称更完整的标题。" })
1642
1642
  ] }),
1643
1643
  /* @__PURE__ */ s("div", { children: [
1644
1644
  /* @__PURE__ */ s("div", { className: "mb-1.5 flex flex-wrap items-center justify-between gap-2", children: [
@@ -1652,7 +1652,7 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1652
1652
  "调整顺序"
1653
1653
  ] }),
1654
1654
  c && /* @__PURE__ */ s("button", { type: "button", disabled: n || p || M, "aria-haspopup": "dialog", onClick: () => {
1655
- y({ id: null, name: "", description: "" }), N(""), W(""), b("");
1655
+ y({ id: null, name: "", description: "" }), N(""), G(""), b("");
1656
1656
  }, className: "flex cursor-pointer items-center gap-1 text-xs text-blue-500 enabled:hover:text-blue-600 disabled:opacity-40", children: [
1657
1657
  /* @__PURE__ */ t(et, { size: 13, "aria-hidden": "true" }),
1658
1658
  "新增分类"
@@ -1660,7 +1660,7 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1660
1660
  ] })
1661
1661
  ] }),
1662
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("");
1663
+ x({ categoryId: i.target.value || null, category: void 0 }), G("");
1664
1664
  }, className: `${fe} disabled:bg-gray-50 disabled:text-gray-400`, children: [
1665
1665
  /* @__PURE__ */ t("option", { value: "", children: "不设置分类" }),
1666
1666
  l && /* @__PURE__ */ s("option", { value: "__unresolved-category__", disabled: !0, children: [
@@ -1696,7 +1696,7 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1696
1696
  /* @__PURE__ */ s("div", { className: "flex items-center justify-between gap-3", children: [
1697
1697
  /* @__PURE__ */ t("span", { className: "text-xs font-medium text-gray-500", children: "分类描述" }),
1698
1698
  k && c && /* @__PURE__ */ s("button", { type: "button", disabled: n || M, "aria-haspopup": "dialog", onClick: () => {
1699
- y({ ...k }), N(""), W(""), b("");
1699
+ y({ ...k }), N(""), G(""), b("");
1700
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
1701
  /* @__PURE__ */ t(St, { size: 12, "aria-hidden": "true" }),
1702
1702
  "编辑分类"
@@ -1705,7 +1705,7 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1705
1705
  /* @__PURE__ */ t("p", { className: "mt-2 break-words text-xs leading-5 text-gray-500", children: m || "未填写分类描述" })
1706
1706
  ] })
1707
1707
  ] }),
1708
- /* @__PURE__ */ t(Lt, { id: `${h}-dialog`, open: p, busy: V || T, label: H ? "分类顺序" : u ? u.id ? "编辑分类" : "新增分类" : void 0, onDismiss: () => {
1708
+ /* @__PURE__ */ t(_t, { id: `${h}-dialog`, open: p, busy: V || T, label: H ? "分类顺序" : u ? u.id ? "编辑分类" : "新增分类" : void 0, onDismiss: () => {
1709
1709
  y(null), F(null), N("");
1710
1710
  }, children: H && g ? /* @__PURE__ */ t(
1711
1711
  It,
@@ -1719,11 +1719,11 @@ function nn({ value: e, categories: r, categoriesDisabled: n = !1, onChange: a,
1719
1719
  try {
1720
1720
  return await g(i);
1721
1721
  } finally {
1722
- L.current && O(!1);
1722
+ _.current && O(!1);
1723
1723
  }
1724
1724
  },
1725
1725
  onSaved: () => {
1726
- F(null), W("分类顺序已保存");
1726
+ F(null), G("分类顺序已保存");
1727
1727
  },
1728
1728
  onCancel: () => F(null)
1729
1729
  }
@@ -2076,7 +2076,7 @@ var Dn = {
2076
2076
  vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"
2077
2077
  }
2078
2078
  };
2079
- function Ln(e) {
2079
+ function _n(e) {
2080
2080
  return function r() {
2081
2081
  for (var n = this, a = arguments.length, c = new Array(a), d = 0; d < a; d++)
2082
2082
  c[d] = arguments[d];
@@ -2087,23 +2087,23 @@ function Ln(e) {
2087
2087
  };
2088
2088
  };
2089
2089
  }
2090
- function _n(e) {
2090
+ function Ln(e) {
2091
2091
  return {}.toString.call(e).includes("Object");
2092
2092
  }
2093
2093
  function Tn(e) {
2094
- return e || xt("configIsRequired"), _n(e) || xt("configType"), e.urls ? (zn(), {
2094
+ return e || xt("configIsRequired"), Ln(e) || xt("configType"), e.urls ? (zn(), {
2095
2095
  paths: {
2096
2096
  vs: e.urls.monacoBase
2097
2097
  }
2098
2098
  }) : e;
2099
2099
  }
2100
2100
  function zn() {
2101
- console.warn(_t.deprecation);
2101
+ console.warn(Lt.deprecation);
2102
2102
  }
2103
2103
  function An(e, r) {
2104
2104
  throw new Error(e[r] || e.default);
2105
2105
  }
2106
- var _t = {
2106
+ var Lt = {
2107
2107
  configIsRequired: "the configuration object is required",
2108
2108
  configType: "the configuration object should be an object",
2109
2109
  default: "an unknown error accured in `@monaco-editor/loader` package",
@@ -2117,9 +2117,9 @@ var _t = {
2117
2117
 
2118
2118
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
2119
2119
  `
2120
- }, xt = Ln(An)(_t), Hn = {
2120
+ }, xt = _n(An)(Lt), Hn = {
2121
2121
  config: Tn
2122
- }, Gn = function() {
2122
+ }, Wn = function() {
2123
2123
  for (var r = arguments.length, n = new Array(r), a = 0; a < r; a++)
2124
2124
  n[a] = arguments[a];
2125
2125
  return function(c) {
@@ -2133,14 +2133,14 @@ function Tt(e, r) {
2133
2133
  r[n] instanceof Object && e[n] && Object.assign(r[n], Tt(e[n], r[n]));
2134
2134
  }), gt(gt({}, e), r);
2135
2135
  }
2136
- var Wn = {
2136
+ var Gn = {
2137
2137
  type: "cancelation",
2138
2138
  msg: "operation is manually canceled"
2139
2139
  };
2140
2140
  function Ae(e) {
2141
2141
  var r = !1, n = new Promise(function(a, c) {
2142
2142
  e.then(function(d) {
2143
- return r ? c(Wn) : a(d);
2143
+ return r ? c(Gn) : a(d);
2144
2144
  }), e.catch(c);
2145
2145
  });
2146
2146
  return n.cancel = function() {
@@ -2179,7 +2179,7 @@ function qn() {
2179
2179
  return e.resolve(e.monaco), Ae(He);
2180
2180
  if (window.monaco && window.monaco.editor)
2181
2181
  return At(window.monaco), e.resolve(window.monaco), Ae(He);
2182
- Gn(Bn, Un)(Kn);
2182
+ Wn(Bn, Un)(Kn);
2183
2183
  }
2184
2184
  return Ae(He);
2185
2185
  }
@@ -2238,19 +2238,19 @@ var He = new Promise(function(e, r) {
2238
2238
  config: Yn,
2239
2239
  init: qn,
2240
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;
2241
+ }, Jn = { wrapper: { display: "flex", position: "relative", textAlign: "initial" }, fullWidth: { width: "100%" }, hide: { display: "none" } }, We = Jn, Xn = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, Qn = Xn;
2242
2242
  function ea({ children: e }) {
2243
2243
  return ge.createElement("div", { style: Qn.container }, e);
2244
2244
  }
2245
2245
  var ta = ea, ra = ta;
2246
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 }));
2247
+ return ge.createElement("section", { style: { ...We.wrapper, width: e, height: r }, ...g }, !n && ge.createElement(ra, null, a), ge.createElement("div", { ref: c, style: { ...We.fullWidth, ...!n && We.hide }, className: d }));
2248
2248
  }
2249
- var aa = na, Gt = Ze(aa);
2249
+ var aa = na, Wt = Ze(aa);
2250
2250
  function ia(e) {
2251
2251
  te(e, []);
2252
2252
  }
2253
- var Wt = ia;
2253
+ var Gt = ia;
2254
2254
  function sa(e, r, n = !0) {
2255
2255
  let a = Y(!0);
2256
2256
  te(a.current || !n ? () => {
@@ -2272,9 +2272,9 @@ function ca(e, r, n, a) {
2272
2272
  function Rt(e, r) {
2273
2273
  return e.Uri.parse(r);
2274
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 }) {
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: L = "100%", width: z = "100%", className: A, wrapperProps: G = {}, beforeMount: V = ye, onMount: R = ye }) {
2276
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(() => {
2277
+ Gt(() => {
2278
2278
  let l = Ht.init();
2279
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
2280
  }), oe(() => {
@@ -2303,7 +2303,7 @@ function la({ original: e, modified: r, language: n, originalLanguage: a, modifi
2303
2303
  var l;
2304
2304
  (l = v.current) == null || l.updateOptions(N);
2305
2305
  }, [N], H);
2306
- let L = Me(() => {
2306
+ let _ = Me(() => {
2307
2307
  var $;
2308
2308
  if (!b.current) return;
2309
2309
  p.current(b.current);
@@ -2311,8 +2311,8 @@ function la({ original: e, modified: r, language: n, originalLanguage: a, modifi
2311
2311
  ($ = v.current) == null || $.setModel({ original: l, modified: m });
2312
2312
  }, [n, r, c, e, a, d, g]), q = Me(() => {
2313
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]);
2314
+ !C.current && T.current && (v.current = b.current.editor.createDiffEditor(T.current, { automaticLayout: !0, ...N }), _(), (l = b.current) == null || l.editor.setTheme(y), F(!0), C.current = !0);
2315
+ }, [N, y, _]);
2316
2316
  te(() => {
2317
2317
  H && O.current(v.current, b.current);
2318
2318
  }, [H]), te(() => {
@@ -2323,7 +2323,7 @@ function la({ original: e, modified: r, language: n, originalLanguage: a, modifi
2323
2323
  let l = (m = v.current) == null ? void 0 : m.getModel();
2324
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
2325
  }
2326
- return ge.createElement(Gt, { width: z, height: _, isEditorReady: H, loading: f, _ref: T, className: A, wrapperProps: W });
2326
+ return ge.createElement(Wt, { width: z, height: L, isEditorReady: H, loading: f, _ref: T, className: A, wrapperProps: G });
2327
2327
  }
2328
2328
  var da = la;
2329
2329
  Ze(da);
@@ -2334,15 +2334,15 @@ function ua(e) {
2334
2334
  }, [e]), r.current;
2335
2335
  }
2336
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(() => {
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: L = !1, width: z = "100%", height: A = "100%", className: G, 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), _ = Y(H), q = Y(R), k = Y(), l = Y(a), m = ma(d), $ = Y(!1), x = Y(!1);
2339
+ Gt(() => {
2340
2340
  let i = Ht.init();
2341
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
2342
  }), oe(() => {
2343
- var o, w, j, G;
2343
+ var o, w, j, W;
2344
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))));
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 && ((W = p.current) == null || W.restoreViewState($e.get(d))));
2346
2346
  }, [d], D), oe(() => {
2347
2347
  var i;
2348
2348
  (i = p.current) == null || i.updateOptions(y);
@@ -2368,7 +2368,7 @@ function ha({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: a, lan
2368
2368
  }
2369
2369
  }, [e, r, n, a, c, d, y, f, N, g, h]);
2370
2370
  te(() => {
2371
- D && L.current(p.current, O.current);
2371
+ D && _.current(p.current, O.current);
2372
2372
  }, [D]), te(() => {
2373
2373
  !b && !D && E();
2374
2374
  }, [b, D, E]), l.current = a, te(() => {
@@ -2381,9 +2381,9 @@ function ha({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: a, lan
2381
2381
  let i = O.current.editor.onDidChangeMarkers((o) => {
2382
2382
  var j;
2383
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);
2384
+ if (w && o.find((W) => W.path === w.path)) {
2385
+ let W = O.current.editor.getModelMarkers({ resource: w });
2386
+ M == null || M(W);
2387
2387
  }
2388
2388
  });
2389
2389
  return () => {
@@ -2395,22 +2395,22 @@ function ha({ defaultValue: e, defaultLanguage: r, defaultPath: n, value: a, lan
2395
2395
  }, [D, M]);
2396
2396
  function P() {
2397
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();
2398
+ (i = k.current) == null || i.dispose(), L ? N && $e.set(d, p.current.saveViewState()) : (o = p.current.getModel()) == null || o.dispose(), p.current.dispose();
2399
2399
  }
2400
- return ge.createElement(Gt, { width: z, height: A, isEditorReady: D, loading: u, _ref: C, className: W, wrapperProps: V });
2400
+ return ge.createElement(Wt, { width: z, height: A, isEditorReady: D, loading: u, _ref: C, className: G, wrapperProps: V });
2401
2401
  }
2402
2402
  var ga = ha, pa = Ze(ga), fa = pa;
2403
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);
2404
+ const [d, g] = S(!1), [h, u] = S(null), y = Y(null), f = Y(null), N = Y(void 0), L = Y(!1), z = Y(null), A = we(), G = () => {
2405
+ clearTimeout(N.current), L.current = !1, z.current = null, g(!1), u(null);
2406
2406
  }, V = () => {
2407
2407
  clearTimeout(N.current), g(!0);
2408
2408
  }, R = () => {
2409
- clearTimeout(N.current), !_.current && (N.current = setTimeout(() => {
2410
- _.current || W();
2409
+ clearTimeout(N.current), !L.current && (N.current = setTimeout(() => {
2410
+ L.current || G();
2411
2411
  }, 150));
2412
2412
  }, H = () => {
2413
- c === "card" && (_.current = !0, V());
2413
+ c === "card" && (L.current = !0, V());
2414
2414
  }, F = (M) => {
2415
2415
  var D, v;
2416
2416
  return M instanceof Node && (((D = y.current) == null ? void 0 : D.contains(M)) || ((v = f.current) == null ? void 0 : v.contains(M)));
@@ -2418,9 +2418,9 @@ function Oe({ title: e, children: r, placement: n = "top", align: a = "center",
2418
2418
  return te(() => () => clearTimeout(N.current), []), te(() => {
2419
2419
  if (!d) return;
2420
2420
  const M = (v) => {
2421
- F(v.target) || W();
2421
+ F(v.target) || G();
2422
2422
  }, D = (v) => {
2423
- v.key === "Escape" && W();
2423
+ v.key === "Escape" && G();
2424
2424
  };
2425
2425
  return document.addEventListener("pointerdown", M), document.addEventListener("keydown", D), () => {
2426
2426
  document.removeEventListener("pointerdown", M), document.removeEventListener("keydown", D);
@@ -2430,13 +2430,13 @@ function Oe({ title: e, children: r, placement: n = "top", align: a = "center",
2430
2430
  const M = () => {
2431
2431
  const v = y.current, b = f.current;
2432
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;
2433
+ const T = 12, O = 6, p = v.getBoundingClientRect(), C = Math.max(0, p.top - T - O), _ = Math.max(0, window.innerHeight - p.bottom - T - O), q = c === "card" ? 420 : 320;
2434
2434
  if (!z.current) {
2435
- const $ = c === "card" ? q : Math.min(q, b.getBoundingClientRect().height), x = n === "top" ? C >= $ || C >= L : !(L >= $ || L >= C);
2435
+ const $ = c === "card" ? q : Math.min(q, b.getBoundingClientRect().height), x = n === "top" ? C >= $ || C >= _ : !(_ >= $ || _ >= C);
2436
2436
  z.current = x ? "top" : "bottom";
2437
2437
  }
2438
2438
  const k = z.current === "top";
2439
- b.style.maxHeight = `${Math.min(q, k ? C : L)}px`;
2439
+ b.style.maxHeight = `${Math.min(q, k ? C : _)}px`;
2440
2440
  const { width: l, height: m } = b.getBoundingClientRect();
2441
2441
  u({
2442
2442
  left: Math.max(T, Math.min(
@@ -2461,11 +2461,11 @@ function Oe({ title: e, children: r, placement: n = "top", align: a = "center",
2461
2461
  onMouseLeave: R,
2462
2462
  onPointerDown: H,
2463
2463
  onClick: () => {
2464
- c === "default" && W();
2464
+ c === "default" && G();
2465
2465
  },
2466
2466
  onFocus: V,
2467
2467
  onBlur: (M) => {
2468
- F(M.relatedTarget) || (M.relatedTarget ? W() : R());
2468
+ F(M.relatedTarget) || (M.relatedTarget ? G() : R());
2469
2469
  },
2470
2470
  children: [
2471
2471
  r,
@@ -2500,12 +2500,12 @@ function Oe({ title: e, children: r, placement: n = "top", align: a = "center",
2500
2500
  }
2501
2501
  ) : /* @__PURE__ */ t(be, { children: r });
2502
2502
  }
2503
- const We = [
2503
+ const Ge = [
2504
2504
  { key: "desktop", icon: /* @__PURE__ */ t(Mt, { size: 13 }), label: "桌面", width: null },
2505
2505
  { key: "tablet", icon: /* @__PURE__ */ t(Ot, { size: 13 }), label: "平板", width: 768 },
2506
2506
  { key: "mobile", icon: /* @__PURE__ */ t(jt, { size: 13 }), label: "手机", width: 390 }
2507
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);
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(), [L, z] = S(!1), [A, G] = 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 }), [_, q] = S([]), [k, l] = S(!1), [m, $] = S(""), [x, E] = S(0), P = an(p), i = M.trim().replace(/\/+$/, ""), o = Y(i);
2509
2509
  o.current = i;
2510
2510
  const w = g.getGuidesCategories;
2511
2511
  te(() => {
@@ -2520,17 +2520,17 @@ const We = [
2520
2520
  I = !1;
2521
2521
  };
2522
2522
  }, [i, w, x]);
2523
- const [j, G] = S({
2523
+ const [j, W] = S({
2524
2524
  navEnabled: !1,
2525
2525
  navname: "",
2526
2526
  navPlacements: []
2527
2527
  }), J = (I) => {
2528
- G({
2528
+ W({
2529
2529
  navEnabled: I.navEnabled ?? !1,
2530
2530
  navname: I.navname ?? "",
2531
2531
  navPlacements: I.navPlacements ?? []
2532
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) => {
2533
+ }, [B, re] = S(""), [X, ne] = S("code"), [ie, se] = S(!1), [ee, Ie] = S("desktop"), [tt, rt] = S(!1), [ue, _e] = S(null), nt = (I, Z) => {
2534
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
2535
  return pe ? I.includes("</head>") ? I.replace("</head>", `${pe}
2536
2536
  </head>`) : pe + I : I;
@@ -2539,10 +2539,10 @@ const We = [
2539
2539
  ae.warning("请先输入 HTML 代码");
2540
2540
  return;
2541
2541
  }
2542
- rt(!0), Le(null);
2542
+ rt(!0), _e(null);
2543
2543
  try {
2544
2544
  const I = await ut(B);
2545
- Le(I), I.networkError ? ae.warning("W3C 校验服务不可用") : I.isValid && ae.success("HTML 校验通过");
2545
+ _e(I), I.networkError ? ae.warning("W3C 校验服务不可用") : I.isValid && ae.success("HTML 校验通过");
2546
2546
  } finally {
2547
2547
  rt(!1);
2548
2548
  }
@@ -2551,7 +2551,7 @@ const We = [
2551
2551
  if (!y) return;
2552
2552
  let I = !0;
2553
2553
  const Z = (U) => {
2554
- W(U), F(U.pathname || ""), D(U.host || ""), re(U.content || ""), J(U);
2554
+ G(U), F(U.pathname || ""), D(U.host || ""), re(U.content || ""), J(U);
2555
2555
  };
2556
2556
  if ((r == null ? void 0 : r.id) === c) {
2557
2557
  Z(r), R(!1);
@@ -2569,7 +2569,7 @@ const We = [
2569
2569
  }, [c, r, g.getById]);
2570
2570
  const at = () => n(d), Yt = V || !H.trim(), qt = B.split(`
2571
2571
  `).length, Bt = async () => {
2572
- if (_ || V) return;
2572
+ if (L || V) return;
2573
2573
  if (!H.trim()) {
2574
2574
  O("请输入访问路径");
2575
2575
  return;
@@ -2602,7 +2602,7 @@ const We = [
2602
2602
  ae.error("配置 Guides 展示时,请填写文章标题");
2603
2603
  return;
2604
2604
  }
2605
- if (p.categoryId === void 0 && !!p.category && !P.categoryId || P.categoryId && (k || m || !L.some((ce) => ce.id === P.categoryId))) {
2605
+ if (p.categoryId === void 0 && !!p.category && !P.categoryId || P.categoryId && (k || m || !_.some((ce) => ce.id === P.categoryId))) {
2606
2606
  ae.error("请先成功加载并选择有效的 Guides 分类");
2607
2607
  return;
2608
2608
  }
@@ -2679,10 +2679,9 @@ const We = [
2679
2679
  /* @__PURE__ */ s(
2680
2680
  "div",
2681
2681
  {
2682
- className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
2683
- style: { height: "calc(100vh - 90px)" },
2682
+ className: "w-full min-w-0 bg-white rounded-2xl shadow-sm border border-gray-100 overflow-clip flex flex-col",
2684
2683
  children: [
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: [
2684
+ /* @__PURE__ */ s("div", { className: "sticky top-0 z-10 shrink-0 flex items-center justify-between px-6 py-4 border-b border-gray-100 bg-gray-50", children: [
2686
2685
  /* @__PURE__ */ s("div", { className: "flex items-center gap-3", children: [
2687
2686
  /* @__PURE__ */ t(
2688
2687
  "button",
@@ -2713,15 +2712,15 @@ const We = [
2713
2712
  /* @__PURE__ */ t(
2714
2713
  "button",
2715
2714
  {
2716
- disabled: Yt || _,
2715
+ disabled: Yt || L,
2717
2716
  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",
2718
2717
  onClick: Bt,
2719
- children: V ? "加载中…" : _ ? "保存中…" : "保存"
2718
+ children: V ? "加载中…" : L ? "保存中…" : "保存"
2720
2719
  }
2721
2720
  )
2722
2721
  ] })
2723
2722
  ] }),
2724
- /* @__PURE__ */ s("div", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto", children: [
2723
+ /* @__PURE__ */ s("div", { className: "flex min-w-0 flex-col", children: [
2725
2724
  /* @__PURE__ */ s("div", { className: "shrink-0 px-6 pt-5 pb-4 border-b border-gray-100", children: [
2726
2725
  /* @__PURE__ */ s("div", { className: "flex flex-col gap-4 sm:flex-row", children: [
2727
2726
  /* @__PURE__ */ s("div", { className: "flex-1", children: [
@@ -2768,7 +2767,7 @@ const We = [
2768
2767
  "aria-invalid": !!v,
2769
2768
  onChange: (I) => {
2770
2769
  const Z = I.target.value;
2771
- Z.trim().replace(/\/+$/, "") !== M.trim().replace(/\/+$/, "") && (C((U) => ({ ...U, categoryId: null })), G((U) => ({
2770
+ Z.trim().replace(/\/+$/, "") !== M.trim().replace(/\/+$/, "") && (C((U) => ({ ...U, categoryId: null })), W((U) => ({
2772
2771
  ...U,
2773
2772
  navPlacements: U.navPlacements.map((Q) => ({ ...Q, parentNavId: null }))
2774
2773
  }))), D(Z), b("");
@@ -2783,7 +2782,7 @@ const We = [
2783
2782
  nn,
2784
2783
  {
2785
2784
  value: { ...P, ...p.categoryId === void 0 && !P.categoryId ? { category: p.category } : {} },
2786
- categories: L,
2785
+ categories: _,
2787
2786
  categoriesDisabled: !i || k || !!m,
2788
2787
  onChange: C,
2789
2788
  onLoadCategories: async () => {
@@ -2813,7 +2812,7 @@ const We = [
2813
2812
  host: M,
2814
2813
  service: g,
2815
2814
  value: j,
2816
- onChange: G
2815
+ onChange: W
2817
2816
  }
2818
2817
  )
2819
2818
  ] }),
@@ -2843,7 +2842,7 @@ const We = [
2843
2842
  }
2844
2843
  )
2845
2844
  ] }) }),
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(
2845
+ 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: Ge.map((I) => /* @__PURE__ */ t(Oe, { title: I.label, children: /* @__PURE__ */ t(
2847
2846
  "button",
2848
2847
  {
2849
2848
  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"}`,
@@ -2889,7 +2888,7 @@ const We = [
2889
2888
  )
2890
2889
  ] })
2891
2890
  ] }) }),
2892
- /* @__PURE__ */ s("div", { className: "relative min-h-[320px] flex-1 shrink-0", children: [
2891
+ /* @__PURE__ */ s("div", { className: "relative h-[calc(100dvh-180px)] min-h-[320px] shrink-0", children: [
2893
2892
  /* @__PURE__ */ t(
2894
2893
  "div",
2895
2894
  {
@@ -2906,7 +2905,7 @@ const We = [
2906
2905
  theme: "vs-dark",
2907
2906
  value: B,
2908
2907
  onChange: (I) => {
2909
- re(I ?? ""), ie && se(!1), ue && Le(null);
2908
+ re(I ?? ""), ie && se(!1), ue && _e(null);
2910
2909
  },
2911
2910
  options: {
2912
2911
  fontSize: 13,
@@ -2919,6 +2918,7 @@ const We = [
2919
2918
  lineNumbers: "on",
2920
2919
  renderWhitespace: "none",
2921
2920
  smoothScrolling: !0,
2921
+ scrollbar: { alwaysConsumeMouseWheel: !1 },
2922
2922
  cursorBlinking: "smooth",
2923
2923
  padding: { top: 12, bottom: 12 }
2924
2924
  }
@@ -2931,14 +2931,14 @@ const We = [
2931
2931
  {
2932
2932
  srcDoc: nt(
2933
2933
  B,
2934
- We.find(
2934
+ Ge.find(
2935
2935
  (I) => I.key === ee
2936
2936
  ).width
2937
2937
  ),
2938
2938
  sandbox: "allow-same-origin allow-scripts",
2939
2939
  title: "HTML 预览",
2940
2940
  style: {
2941
- width: `${We.find(
2941
+ width: `${Ge.find(
2942
2942
  (I) => I.key === ee
2943
2943
  ).width}px`,
2944
2944
  height: "100%",
@@ -2986,7 +2986,7 @@ const We = [
2986
2986
  }) => {
2987
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
2988
  r ?? (c == null ? void 0 : c.record) ?? null
2989
- ), [_, z] = S(!1), [A, W] = S("preview"), [V, R] = S("desktop");
2989
+ ), [L, z] = S(!1), [A, G] = S("preview"), [V, R] = S("desktop");
2990
2990
  te(() => {
2991
2991
  !f && d && (z(!0), h.getById(d).then(N).catch((v) => {
2992
2992
  ae.error(v.message || "获取数据失败"), n(g);
@@ -2995,11 +2995,11 @@ const We = [
2995
2995
  const H = () => n(g), F = () => n(`${g}/${d}/edit`, { state: { record: f } }), M = () => {
2996
2996
  f != null && f.content && (navigator.clipboard.writeText(f.content), ae.success("已复制到剪贴板"));
2997
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;
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>' : "", _ = T + O + p + C;
2999
+ return _ ? v.includes("</head>") ? v.replace("</head>", `${_}
3000
+ </head>`) : _ + v : v;
3001
3001
  };
3002
- return _ ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
3002
+ return L ? /* @__PURE__ */ t("div", { className: "flex items-center justify-center h-64 text-gray-400 text-sm", children: "加载中…" }) : /* @__PURE__ */ s(
3003
3003
  "div",
3004
3004
  {
3005
3005
  className: "w-full bg-white rounded-2xl shadow-sm border border-gray-100 overflow-hidden flex flex-col",
@@ -3047,7 +3047,7 @@ const We = [
3047
3047
  "button",
3048
3048
  {
3049
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),
3050
+ onClick: () => G(v),
3051
3051
  children: v === "preview" ? /* @__PURE__ */ s(be, { children: [
3052
3052
  /* @__PURE__ */ t(qe, { size: 11 }),
3053
3053
  " 预览"