@blocklet/pages-kit-inner-components 0.6.20 → 0.6.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
1
  import { jsx as r, jsxs as w, Fragment as Q } from "react/jsx-runtime";
2
- import { ErrorOutline as Dt } from "@mui/icons-material";
3
- import { Box as h, styled as Gt, Typography as L, Container as Ht, useTheme as Yt, useMediaQuery as Vt, Card as Jt, CircularProgress as Kt, Grid as ht, CardMedia as Xt, CardContent as qt, Alert as Qt } from "@mui/material";
2
+ import { ErrorOutline as Gt } from "@mui/icons-material";
3
+ import { Box as h, styled as Dt, Typography as z, Container as Ht, useTheme as Yt, useMediaQuery as Vt, Card as Jt, CircularProgress as Kt, Grid as ht, CardMedia as Xt, CardContent as qt, Alert as Qt } from "@mui/material";
4
4
  import Zt from "lodash/isEmpty";
5
5
  import lt from "lodash/pick";
6
- import te, { createContext as $t, useMemo as S, useCallback as D, useContext as Ct, useState as Z, useEffect as G, Fragment as ee, isValidElement as St, useRef as ct } from "react";
7
- import z from "lodash/keyBy";
6
+ import te, { createContext as $t, useMemo as B, useCallback as Y, useContext as Ct, useState as Z, useEffect as V, Fragment as ee, isValidElement as St, useRef as ct } from "react";
7
+ import R from "lodash/keyBy";
8
8
  import { styled as _, useTheme as Nt } from "@arcblock/ux/lib/Theme";
9
9
  import { cx as x, css as it } from "@emotion/css";
10
- import N from "lodash/omit";
10
+ import M from "lodash/omit";
11
11
  import { Link as oe, NavLink as ne, useNavigate as re } from "react-router-dom";
12
12
  import ie from "@arcblock/ux/lib/Button";
13
13
  import at from "is-uri";
14
14
  import { Icon as Bt } from "@iconify-icon/react";
15
- import { e as A, f as B, i as dt, l as mt } from "./state-DSo43FAB.js";
15
+ import { e as j, f as P, i as dt, l as mt } from "./state-DSo43FAB.js";
16
16
  import ae from "@blocklet/pages-kit/builtin/markdown/markdown-renderer";
17
17
  import { useColorConvert as Mt } from "@blocklet/pages-kit/contexts/color";
18
18
  import { materialDark as se } from "react-syntax-highlighter/dist/esm/styles/prism";
@@ -140,7 +140,8 @@ const Wt = "{{CUSTOM_VALUE}}", _e = [
140
140
  {
141
141
  title: "None",
142
142
  value: "none",
143
- sx: { gap: 0 }
143
+ sx: { gap: 0 },
144
+ containerSx: { gap: 0 }
144
145
  },
145
146
  {
146
147
  title: "Small",
@@ -150,12 +151,12 @@ const Wt = "{{CUSTOM_VALUE}}", _e = [
150
151
  {
151
152
  title: "Normal",
152
153
  value: "normal",
153
- sx: { gap: { xs: 2, md: 4, lg: 4, xl: 6 } }
154
+ sx: { gap: { xs: 2, md: 3.5, lg: 3.5, xl: 5 } }
154
155
  },
155
156
  {
156
157
  title: "Large",
157
158
  value: "large",
158
- sx: { gap: { xs: 3, md: 5, lg: 5, xl: 7 } }
159
+ sx: { gap: { xs: 3, md: 5, lg: 5, xl: 6.5 } }
159
160
  }
160
161
  ], Be = [
161
162
  {
@@ -209,17 +210,17 @@ const Wt = "{{CUSTOM_VALUE}}", _e = [
209
210
  value: "space-evenly",
210
211
  sx: { alignContent: "space-evenly" }
211
212
  }
212
- ], Pe = z(_e, "value"), Ie = z($e, "value"), We = z(Ce, "value"), Le = z(Se, "value"), Ae = z(Ne, "value"), ze = z(Be, "value"), Re = z(Me, "value"), je = /* @__PURE__ */ new Map([
213
+ ], Pe = R(_e, "value"), Ie = R($e, "value"), We = R(Ce, "value"), Le = R(Se, "value"), Ae = R(Ne, "value"), ze = R(Be, "value"), je = R(Me, "value"), Re = /* @__PURE__ */ new Map([
213
214
  ["baseSectionPaddingY", Pe],
214
215
  ["maxWidth", Le],
215
216
  ["paddingY", Ie],
216
217
  ["paddingX", We],
217
218
  ["layoutBlockGap", Ae],
218
219
  ["layoutBlockPadding", ze],
219
- ["layoutBlockAlignContent", Re]
220
+ ["layoutBlockAlignContent", je]
220
221
  ]);
221
- function U(t) {
222
- const { type: e, value: o, format: n = "sx", defaultValue: i = null } = t, a = je.get(e);
222
+ function D(t) {
223
+ const { type: e, value: o, format: n = "sx", defaultValue: i = null } = t, a = Re.get(e);
223
224
  if (!a || typeof o != "string" || !o)
224
225
  return i;
225
226
  const c = o.startsWith("custom:"), s = c ? "custom" : o;
@@ -250,18 +251,18 @@ function In({
250
251
  defaultLocale: o = "en",
251
252
  currentLocale: n
252
253
  }) {
253
- const i = S(() => t ? JSON.parse(JSON.stringify(t)) : null, [JSON.stringify(t)]), a = D(() => {
254
+ const i = B(() => t ? JSON.parse(JSON.stringify(t)) : null, [JSON.stringify(t)]), a = Y(() => {
254
255
  if (!i) return {};
255
256
  const l = n || o;
256
257
  return i.locales?.[l] ?? {};
257
- }, [i, o, n]), c = D(
258
+ }, [i, o, n]), c = Y(
258
259
  (l = "sx") => {
259
260
  const d = a();
260
261
  return !d || !d.style ? {} : Object.entries(d.style || {}).reduce((m, [g, u]) => {
261
262
  if (!u) return m;
262
263
  const b = `${g}Custom`;
263
264
  d.style[b];
264
- const f = U({
265
+ const f = D({
265
266
  type: g,
266
267
  value: u,
267
268
  format: l
@@ -270,7 +271,7 @@ function In({
270
271
  }, {});
271
272
  },
272
273
  [a]
273
- ), s = S(
274
+ ), s = B(
274
275
  () => ({
275
276
  page: i,
276
277
  getPageMeta: a,
@@ -299,17 +300,17 @@ function Ue({ icon: t, ...e }) {
299
300
  return /* @__PURE__ */ r(Bt, { icon: t, ...e, ref: null });
300
301
  }
301
302
  function Fe({ icon: t, className: e = "", size: o = "1rem", ...n }) {
302
- return /* @__PURE__ */ r(De, { component: Ue, className: x("css-icon", e), size: o, ...n, icon: t });
303
+ return /* @__PURE__ */ r(Ge, { component: Ue, className: x("css-icon", e), size: o, ...n, icon: t });
303
304
  }
304
- const De = _(h)`
305
+ const Ge = _(h)`
305
306
  &.css-icon {
306
307
  display: inline-block;
307
308
  width: ${({ size: t }) => t};
308
309
  height: ${({ size: t }) => t};
309
310
  }
310
311
  `;
311
- function Ge({ icon: t, className: e = "", size: o = "1rem", imageMeta: n, ...i }) {
312
- const a = A(B(t), 540), [c, s] = Z(!1), l = Nt();
312
+ function De({ icon: t, className: e = "", size: o = "1rem", imageMeta: n, ...i }) {
313
+ const a = j(P(t), 540), [c, s] = Z(!1), l = Nt();
313
314
  return c ? /* @__PURE__ */ r(Fe, { icon: "i-mdi:image", color: l.palette.grey[500], size: o, className: e, ...i }) : /* @__PURE__ */ r(He, { className: x("image-icon", e), size: o, ...i, children: /* @__PURE__ */ r(
314
315
  "img",
315
316
  {
@@ -335,26 +336,26 @@ const He = _(h)`
335
336
  `, pt = (t) => typeof t == "string" && /^[\w-_]+:[\w-_]+$/.test(t);
336
337
  function st({ icon: t, size: e = "1rem", imageMeta: o, ...n }) {
337
338
  const i = window.isNaN(e) ? e : `${e}px`;
338
- return pt(t) ? /* @__PURE__ */ r(Bt, { icon: t }) : /* @__PURE__ */ r(Ye, { component: Ge, imageMeta: o, className: "base-icon", icon: t, size: i, ...n });
339
+ return pt(t) ? /* @__PURE__ */ r(Bt, { icon: t }) : /* @__PURE__ */ r(Ye, { component: De, imageMeta: o, className: "base-icon", icon: t, size: i, ...n });
339
340
  }
340
341
  const Ye = _(h)`
341
342
  flex-shrink: 0;
342
343
  `;
343
- function F({ text: t, children: e, icon: o = "", endIcon: n, color: i = "primary", link: a = "", href: c = "", ...s }) {
344
+ function H({ text: t, children: e, icon: o = "", endIcon: n, color: i = "primary", link: a = "", href: c = "", ...s }) {
344
345
  const l = o ? /* @__PURE__ */ r(st, { icon: o }) : null, d = n ? /* @__PURE__ */ r(st, { icon: n }) : null, p = a || c, m = { ...s };
345
346
  return p && (m.href = p, at(p) && (m.target = m.target || "_blank")), /* @__PURE__ */ r(ie, { startIcon: l, endIcon: d, color: i, ...m, children: t || e });
346
347
  }
347
- function Rt({ editing: t, text: e, ...o }) {
348
+ function jt({ editing: t, text: e, ...o }) {
348
349
  const { pages: n = [] } = zt(), i = n.find((a) => a.id === (o.link || o.linkId));
349
350
  if (t)
350
- return /* @__PURE__ */ r(F, { ...N(o, ["link", "linkId"]), children: e });
351
+ return /* @__PURE__ */ r(H, { ...M(o, ["link", "linkId"]), children: e });
351
352
  if (i) {
352
353
  const a = i.path || "/";
353
- return /* @__PURE__ */ r(oe, { to: a, children: /* @__PURE__ */ r(F, { ...N(o, ["link", "linkId"]), children: e }) });
354
+ return /* @__PURE__ */ r(oe, { to: a, children: /* @__PURE__ */ r(H, { ...M(o, ["link", "linkId"]), children: e }) });
354
355
  }
355
- return /* @__PURE__ */ r(F, { ...N(o, "linkId"), children: e });
356
+ return /* @__PURE__ */ r(H, { ...M(o, "linkId"), children: e });
356
357
  }
357
- function j({ actions: t, center: e, className: o, align: n }) {
358
+ function T({ actions: t, center: e, className: o, align: n }) {
358
359
  return t && t?.length ? /* @__PURE__ */ r(
359
360
  h,
360
361
  {
@@ -371,7 +372,7 @@ function j({ actions: t, center: e, className: o, align: n }) {
371
372
  }
372
373
  ) : null;
373
374
  }
374
- const Ve = "section", Je = Gt(h)`
375
+ const Ve = "section", Je = Dt(h)`
375
376
  overflow: hidden;
376
377
 
377
378
  .section__title {
@@ -454,20 +455,20 @@ function et({
454
455
  }) {
455
456
  const y = Mt();
456
457
  if (!t && !e && !n && !p && !d && !c && !s && !g) return null;
457
- const k = Math.max(Math.min(5, l + 1), 1), $ = {
458
+ const v = Math.max(Math.min(5, l + 1), 1), $ = {
458
459
  1: "xl:!text-3xl lg:!text-2xl md:!text-xl",
459
460
  2: "xl:!text-2xl lg:!text-xl md:!text-lg",
460
461
  3: "xl:!text-2xl lg:!text-xl md:!text-lg",
461
462
  4: "xl:!text-xl lg:!text-lg md:!text-md",
462
463
  5: "xl:!text-lg md:!text-md sm:!text-sm",
463
464
  6: "!text-sm"
464
- }, P = l === 0 ? "big" : `h${k}`, C = l === 0;
465
+ }, W = l === 0 ? "big" : `h${v}`, S = l === 0;
465
466
  return /* @__PURE__ */ w(Je, { className: x("base-info", "lg:text-left", m && "!text-center", i), ...f, children: [
466
467
  c && /* @__PURE__ */ r("div", { children: c }),
467
468
  (d || p) && /* @__PURE__ */ r("div", { className: x("section__tag", a?.tag || a?.badge), children: d || p }),
468
469
  g && /* @__PURE__ */ r("img", { className: "w-[120px] m-auto mb-8", src: g, alt: "info", loading: "lazy" }),
469
470
  t && /* @__PURE__ */ r(
470
- L,
471
+ z,
471
472
  {
472
473
  sx: {
473
474
  whiteSpace: "pre-wrap",
@@ -480,10 +481,10 @@ function et({
480
481
  "dark:text-gray-50",
481
482
  a.title,
482
483
  "page-kit-section__title",
483
- C ? "" : "section__title_non_big"
484
+ S ? "" : "section__title_non_big"
484
485
  ),
485
486
  component: `h${Math.max(l, 1)}`,
486
- variant: P,
487
+ variant: W,
487
488
  children: t
488
489
  }
489
490
  ),
@@ -497,14 +498,14 @@ function et({
497
498
  "section__description",
498
499
  "text-gray-800",
499
500
  "dark:text-gray-100",
500
- $[k],
501
+ $[v],
501
502
  a.description,
502
503
  "page-kit-section__description"
503
504
  ),
504
505
  children: /* @__PURE__ */ r(ae, { codeOptions: { showActionButton: !1, theme: se }, children: e })
505
506
  }
506
507
  ) : /* @__PURE__ */ r(
507
- L,
508
+ z,
508
509
  {
509
510
  sx: {
510
511
  whiteSpace: "pre-wrap",
@@ -514,7 +515,7 @@ function et({
514
515
  "section__description",
515
516
  "text-gray-800",
516
517
  "dark:text-gray-100",
517
- $[k],
518
+ $[v],
518
519
  a.description,
519
520
  "page-kit-section__description"
520
521
  ),
@@ -524,7 +525,7 @@ function et({
524
525
  children: e
525
526
  }
526
527
  )),
527
- /* @__PURE__ */ r(j, { actions: n, center: m, className: "mt-8" }),
528
+ /* @__PURE__ */ r(T, { actions: n, center: m, className: "mt-8" }),
528
529
  s && /* @__PURE__ */ r("div", { children: s })
529
530
  ] });
530
531
  }
@@ -552,7 +553,7 @@ function Xe(t = "") {
552
553
  const e = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, o = /^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;
553
554
  return e.test(t) || o.test(t);
554
555
  }
555
- function O(t) {
556
+ function G(t) {
556
557
  return t?.endsWith(".mp4") || t?.endsWith(".m4v") || t?.endsWith(".webm");
557
558
  }
558
559
  function qe(t) {
@@ -560,11 +561,11 @@ function qe(t) {
560
561
  }
561
562
  function Qe(t) {
562
563
  let e = {};
563
- return typeof t == "string" ? de(t) ? e.image = t : (e.image = B(t), me(t) && (e.color = t, e.image = "")) : e = t, e;
564
+ return typeof t == "string" ? de(t) ? e.image = t : (e.image = P(t), me(t) && (e.color = t, e.image = "")) : e = t, e;
564
565
  }
565
566
  function Ze() {
566
567
  const [t, e] = Z(Date.now());
567
- return G(() => {
568
+ return V(() => {
568
569
  const o = () => {
569
570
  e(Date.now());
570
571
  };
@@ -578,7 +579,7 @@ function xt(t, e, o, n, i) {
578
579
  const { color: c = "", image: s } = Qe(e);
579
580
  if (s && Xe(s)) {
580
581
  delete o.backgroundColor;
581
- const l = !(t.mobile.apple.device || Ke()) && O(s), d = O(s) && n ? A(B(n), 1200, "quality") : "";
582
+ const l = !(t.mobile.apple.device || Ke()) && G(s), d = G(s) && n ? j(P(n), 1200, "quality") : "";
582
583
  l ? a = /* @__PURE__ */ r(
583
584
  h,
584
585
  {
@@ -590,7 +591,7 @@ function xt(t, e, o, n, i) {
590
591
  controls: !1,
591
592
  playsInline: !0,
592
593
  poster: d,
593
- src: O(s) ? s : A(s, 1200, "quality"),
594
+ src: G(s) ? s : j(s, 1200, "quality"),
594
595
  sx: {
595
596
  width: "100%",
596
597
  position: "absolute",
@@ -606,7 +607,7 @@ function xt(t, e, o, n, i) {
606
607
  ) : a = /* @__PURE__ */ r(
607
608
  Pt,
608
609
  {
609
- src: O(s) && n ? d : s,
610
+ src: G(s) && n ? d : s,
610
611
  sizesAttr: {
611
612
  sm: 600,
612
613
  md: 900,
@@ -660,14 +661,14 @@ function nt({
660
661
  }) {
661
662
  const d = { ...n }, p = It((u) => u.breakpoints.down("md"));
662
663
  t && (d.color = ft.common.white, d.backgroundColor = `${ft.grey[900]} !important`), i.show && (d.display = "flex");
663
- const m = S(() => !Number(l.boxMaxWidth) || p ? {
664
+ const m = B(() => !Number(l.boxMaxWidth) || p ? {
664
665
  width: "100%"
665
666
  } : s === "wall" && l.boxMaxWidth ? {
666
667
  maxWidth: `${l.boxMaxWidth}px !important`,
667
668
  width: "100%"
668
669
  } : {
669
670
  width: "100%"
670
- }, [l.boxMaxWidth, p, s]), g = U({
671
+ }, [l.boxMaxWidth, p, s]), g = D({
671
672
  type: "baseSectionPaddingY",
672
673
  value: a || "normal",
673
674
  // section default is normal
@@ -681,7 +682,7 @@ function nt({
681
682
  className: x("base-section", "px-2 md:px-5 lg:px-5 xl:px-10", o, {
682
683
  dark: t
683
684
  }),
684
- ...N(
685
+ ...M(
685
686
  l,
686
687
  "hoverStyle",
687
688
  "boxMaxWidth",
@@ -692,11 +693,11 @@ function nt({
692
693
  "titleAppearance",
693
694
  "descriptionAppearance"
694
695
  ),
695
- children: /* @__PURE__ */ r(to, { autoWidth: l?.autoWidth, className: x("section-content h-full"), sx: m, children: i.show ? /* @__PURE__ */ r(jt, { ...c, boxed: i, children: e }) : e })
696
+ children: /* @__PURE__ */ r(to, { autoWidth: l?.autoWidth, className: x("section-content h-full"), sx: m, children: i.show ? /* @__PURE__ */ r(Rt, { ...c, boxed: i, children: e }) : e })
696
697
  }
697
698
  );
698
699
  }
699
- function jt({
700
+ function Rt({
700
701
  background: t = "",
701
702
  backgroundVideoPoster: e,
702
703
  children: o,
@@ -737,7 +738,7 @@ function jt({
737
738
  }
738
739
  );
739
740
  }
740
- const eo = _(jt)`
741
+ const eo = _(Rt)`
741
742
  &:nth-of-type(even) {
742
743
  background: #f8f8f8;
743
744
  }
@@ -761,7 +762,7 @@ function Et(t) {
761
762
  }
762
763
  return Array.isArray(t);
763
764
  }
764
- const I = "&>*";
765
+ const A = "&>*";
765
766
  function Tt({ children: t, col: e, gap: o, className: n, align: i, sx: a, type: c, ...s } = {
766
767
  children: null,
767
768
  className: "",
@@ -792,28 +793,28 @@ function Tt({ children: t, col: e, gap: o, className: n, align: i, sx: a, type:
792
793
  Et(t) || (u = 0);
793
794
  const f = (e - 1) * u / e;
794
795
  let y = { ...a, gap: `${u}rem` };
795
- const k = { [I]: { width: "100%" } }, $ = {}, P = {}, C = {};
796
- switch (k.gap = "1rem", $.gap = `${u / 2}rem`, e) {
796
+ const v = { [A]: { width: "100%" } }, $ = {}, W = {}, S = {};
797
+ switch (v.gap = "1rem", $.gap = `${u / 2}rem`, e) {
797
798
  case 3:
798
799
  case 4:
799
- $[I] = {
800
+ $[A] = {
800
801
  width: `calc(50% - ${u / 2}rem)`
801
802
  };
802
803
  break;
803
804
  case 5:
804
805
  case 6:
805
- k[I] = {
806
+ v[A] = {
806
807
  width: `calc(50% - ${u / 2 / 2}rem)`
807
- }, $[I] = {
808
+ }, $[A] = {
808
809
  width: `calc(50% - ${u / 2 / 2}rem)`
809
- }, P[I] = {
810
+ }, W[A] = {
810
811
  width: `calc(33.33% - ${u * 2 / 3}rem)`
811
812
  };
812
813
  break;
813
814
  }
814
- return y[I] = { width: `calc(${d}% - ${f}rem)` }, y[`@media (max-width: ${l.breakpoints.values.xl}px)`] = C, y[`@media (max-width: ${l.breakpoints.values.lg}px)`] = P, y[`@media (max-width: ${l.breakpoints.values.md}px)`] = $, y[`@media (max-width: ${l.breakpoints.values.sm}px)`] = k, c === "wall" && (y = { ...a, gap: `${u}rem` }, y[I] = { width: `calc(${d}% - ${f}rem)` }, k[I] = { width: `calc(45% - ${u / 2 / 2}rem)` }, y[`@media (max-width: ${l.breakpoints.values.sm}px)`] = k), /* @__PURE__ */ r(h, { className: x("flex flex-wrap flex-row h-full", m, n), sx: y, ...s, children: t });
815
+ return y[A] = { width: `calc(${d}% - ${f}rem)` }, y[`@media (max-width: ${l.breakpoints.values.xl}px)`] = S, y[`@media (max-width: ${l.breakpoints.values.lg}px)`] = W, y[`@media (max-width: ${l.breakpoints.values.md}px)`] = $, y[`@media (max-width: ${l.breakpoints.values.sm}px)`] = v, c === "wall" && (y = { ...a, gap: `${u}rem` }, y[A] = { width: `calc(${d}% - ${f}rem)` }, v[A] = { width: `calc(45% - ${u / 2 / 2}rem)` }, y[`@media (max-width: ${l.breakpoints.values.sm}px)`] = v), /* @__PURE__ */ r(h, { className: x("flex flex-wrap flex-row h-full", m, n), sx: y, ...s, children: t });
815
816
  }
816
- function E({ type: t = "", icon: e = "", size: o = "3rem", className: n = "", ...i }) {
817
+ function O({ type: t = "", icon: e = "", size: o = "3rem", className: n = "", ...i }) {
817
818
  return /* @__PURE__ */ r(
818
819
  st,
819
820
  {
@@ -855,14 +856,14 @@ function oo({
855
856
  a === "auto" && (g = "_blank"), u = t;
856
857
  else {
857
858
  pe(u) && (u = X(window.location.pathname, u));
858
- const f = ue(`${window.location.origin}${u}`), y = d.some((k) => k.pathname === f.pathname);
859
+ const f = ue(`${window.location.origin}${u}`), y = d.some((v) => v.pathname === f.pathname);
859
860
  if (s || y)
860
861
  return /* @__PURE__ */ r(
861
862
  ne,
862
863
  {
863
864
  end: !0,
864
865
  to: rt(u),
865
- className: ({ isActive: k }) => x(n, k ? i : ""),
866
+ className: ({ isActive: v }) => x(n, v ? i : ""),
866
867
  ...l,
867
868
  children: o
868
869
  }
@@ -878,12 +879,12 @@ function oo({
878
879
  ...l,
879
880
  children: [
880
881
  o,
881
- b && /* @__PURE__ */ r(E, { icon: "i-mdi:arrow-top-right", size: "0.9em", className: "smart-link__mark", style: { marginLeft: 5 } })
882
+ b && /* @__PURE__ */ r(O, { icon: "i-mdi:arrow-top-right", size: "0.9em", className: "smart-link__mark", style: { marginLeft: 5 } })
882
883
  ]
883
884
  }
884
885
  );
885
886
  }
886
- function H({
887
+ function J({
887
888
  prepend: t,
888
889
  append: e,
889
890
  children: o,
@@ -908,7 +909,7 @@ function H({
908
909
  borderColor: m.palette.divider
909
910
  },
910
911
  ...s,
911
- ...N(c, ["listType", "dark", "iconColor", "link", "hoverStyle", "imageSize"]),
912
+ ...M(c, ["listType", "dark", "iconColor", "link", "hoverStyle", "imageSize"]),
912
913
  children: [
913
914
  t,
914
915
  !p && /* @__PURE__ */ r("div", { className: "card__body", children: o }),
@@ -933,7 +934,7 @@ const no = _(h)`
933
934
  padding: 15px 15px;
934
935
  }
935
936
  `;
936
- function Y({
937
+ function K({
937
938
  align: t = "left",
938
939
  title: e,
939
940
  titleProps: o = {},
@@ -942,7 +943,7 @@ function Y({
942
943
  }) {
943
944
  return /* @__PURE__ */ w(Q, { children: [
944
945
  e && /* @__PURE__ */ r(
945
- L,
946
+ z,
946
947
  {
947
948
  className: x("card__title text-gray-800", "dark:text-gray-50"),
948
949
  component: "h5",
@@ -954,7 +955,7 @@ function Y({
954
955
  }
955
956
  ),
956
957
  n && /* @__PURE__ */ r(
957
- L,
958
+ z,
958
959
  {
959
960
  className: x("card__description", "text-gray-500", "dark:text-gray-400"),
960
961
  component: "div",
@@ -980,7 +981,7 @@ function ro({
980
981
  align: d,
981
982
  ...p
982
983
  }) {
983
- const m = pt(t), g = A(B(t), 540);
984
+ const m = pt(t), g = j(P(t), 540);
984
985
  return /* @__PURE__ */ w(
985
986
  io,
986
987
  {
@@ -999,7 +1000,7 @@ function ro({
999
1000
  alignItems: "center",
1000
1001
  justifyContent: "center"
1001
1002
  },
1002
- children: /* @__PURE__ */ r(E, { icon: t, color: "primary.main" })
1003
+ children: /* @__PURE__ */ r(O, { icon: t, color: "primary.main" })
1003
1004
  }
1004
1005
  ) : g && /* @__PURE__ */ r(
1005
1006
  "img",
@@ -1016,7 +1017,7 @@ function ro({
1016
1017
  ) }),
1017
1018
  children: [
1018
1019
  e || o ? /* @__PURE__ */ r(
1019
- Y,
1020
+ K,
1020
1021
  {
1021
1022
  align: d,
1022
1023
  title: e,
@@ -1025,12 +1026,12 @@ function ro({
1025
1026
  descriptionProps: s
1026
1027
  }
1027
1028
  ) : null,
1028
- l?.length ? /* @__PURE__ */ r(j, { align: d, actions: l, className: "mt-4" }) : null
1029
+ l?.length ? /* @__PURE__ */ r(T, { align: d, actions: l, className: "mt-4" }) : null
1029
1030
  ]
1030
1031
  }
1031
1032
  );
1032
1033
  }
1033
- const io = _(H)`
1034
+ const io = _(J)`
1034
1035
  ${(t) => t.hoverStyle === "none" ? "" : t.link ? `transition: box-shadow ease .3s;
1035
1036
  &:hover {
1036
1037
  box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
@@ -1078,7 +1079,7 @@ function yt({
1078
1079
  }) {
1079
1080
  return /* @__PURE__ */ w(ao, { className: x("card", `list-type-${c}`, s), align: a, ...l, children: [
1080
1081
  e && /* @__PURE__ */ r(
1081
- E,
1082
+ O,
1082
1083
  {
1083
1084
  icon: e,
1084
1085
  color: "primary.main",
@@ -1086,11 +1087,11 @@ function yt({
1086
1087
  imageMeta: o
1087
1088
  }
1088
1089
  ),
1089
- t || n ? /* @__PURE__ */ r(Y, { align: a, title: t, description: n }) : null,
1090
- i?.length ? /* @__PURE__ */ r(j, { align: a, actions: i, className: "mt-4" }) : null
1090
+ t || n ? /* @__PURE__ */ r(K, { align: a, title: t, description: n }) : null,
1091
+ i?.length ? /* @__PURE__ */ r(T, { align: a, actions: i, className: "mt-4" }) : null
1091
1092
  ] });
1092
1093
  }
1093
- const ao = _(H)`
1094
+ const ao = _(J)`
1094
1095
  padding: 5vw 4vw;
1095
1096
  box-sizing: border-box;
1096
1097
  /* min-height: 320px; */
@@ -1164,7 +1165,7 @@ function so({
1164
1165
  align: d,
1165
1166
  ...p
1166
1167
  }) {
1167
- const m = pt(t), g = A(B(t), 540);
1168
+ const m = pt(t), g = j(P(t), 540);
1168
1169
  return /* @__PURE__ */ w(
1169
1170
  lo,
1170
1171
  {
@@ -1183,7 +1184,7 @@ function so({
1183
1184
  alignItems: "center",
1184
1185
  justifyContent: "center"
1185
1186
  },
1186
- children: /* @__PURE__ */ r(E, { icon: t, color: "primary.main" })
1187
+ children: /* @__PURE__ */ r(O, { icon: t, color: "primary.main" })
1187
1188
  }
1188
1189
  ) : g && /* @__PURE__ */ r(
1189
1190
  h,
@@ -1206,7 +1207,7 @@ function so({
1206
1207
  ) }),
1207
1208
  children: [
1208
1209
  e || o ? /* @__PURE__ */ r(
1209
- Y,
1210
+ K,
1210
1211
  {
1211
1212
  align: d,
1212
1213
  title: e,
@@ -1215,12 +1216,12 @@ function so({
1215
1216
  descriptionProps: s
1216
1217
  }
1217
1218
  ) : null,
1218
- l?.length ? /* @__PURE__ */ r(j, { align: d, actions: l, className: "mt-4" }) : null
1219
+ l?.length ? /* @__PURE__ */ r(T, { align: d, actions: l, className: "mt-4" }) : null
1219
1220
  ]
1220
1221
  }
1221
1222
  );
1222
1223
  }
1223
- const lo = _(H)`
1224
+ const lo = _(J)`
1224
1225
  ${(t) => t.hoverStyle === "none" ? "" : t.link ? `transition: box-shadow ease .3s;
1225
1226
  &:hover {
1226
1227
  box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
@@ -1257,14 +1258,14 @@ function co({
1257
1258
  ...l
1258
1259
  }) {
1259
1260
  return /* @__PURE__ */ r(mo, { className: x("card", s), ...l, children: /* @__PURE__ */ w(h, { className: "flex items-center", children: [
1260
- e && /* @__PURE__ */ r(E, { icon: e, color: "primary.main", size: n, imageMeta: o }),
1261
+ e && /* @__PURE__ */ r(O, { icon: e, color: "primary.main", size: n, imageMeta: o }),
1261
1262
  /* @__PURE__ */ w(h, { className: "flex-1 ml-4", children: [
1262
- /* @__PURE__ */ r(Y, { align: c, title: t, description: i }),
1263
- /* @__PURE__ */ r(j, { align: c, actions: a, className: "mt-4" })
1263
+ /* @__PURE__ */ r(K, { align: c, title: t, description: i }),
1264
+ /* @__PURE__ */ r(T, { align: c, actions: a, className: "mt-4" })
1264
1265
  ] })
1265
1266
  ] }) });
1266
1267
  }
1267
- const mo = _(H)`
1268
+ const mo = _(J)`
1268
1269
  padding: 5vw 4vw;
1269
1270
  text-align: left;
1270
1271
  box-sizing: border-box;
@@ -1336,9 +1337,9 @@ function po({
1336
1337
  ...d
1337
1338
  }) {
1338
1339
  return /* @__PURE__ */ w(uo, { className: x("card-simple", c, `hover-style__${l}`), align: s, ...d, children: [
1339
- i && /* @__PURE__ */ r(E, { icon: i, color: "primary.main", imageMeta: a }),
1340
+ i && /* @__PURE__ */ r(O, { icon: i, color: "primary.main", imageMeta: a }),
1340
1341
  t || o ? /* @__PURE__ */ r(
1341
- Y,
1342
+ K,
1342
1343
  {
1343
1344
  align: s,
1344
1345
  title: t,
@@ -1349,7 +1350,7 @@ function po({
1349
1350
  ) : null
1350
1351
  ] });
1351
1352
  }
1352
- const uo = _(H)`
1353
+ const uo = _(J)`
1353
1354
  .card__title {
1354
1355
  color: ${({ theme: t }) => t.palette.text.primary};
1355
1356
  a {
@@ -1454,7 +1455,7 @@ function go({ type: t = "default", ...e }) {
1454
1455
  default: yt,
1455
1456
  wall: so
1456
1457
  }[t] || yt;
1457
- return /* @__PURE__ */ r(n, { ...t === "news" ? e : N(e, "iconSize") });
1458
+ return /* @__PURE__ */ r(n, { ...t === "news" ? e : M(e, "iconSize") });
1458
1459
  }
1459
1460
  function ho({
1460
1461
  list: t = [],
@@ -1514,8 +1515,8 @@ const fo = [
1514
1515
  "type",
1515
1516
  "textAlign"
1516
1517
  ];
1517
- function M(t, e) {
1518
- const o = lt(t, e), n = N(t, e);
1518
+ function I(t, e) {
1519
+ const o = lt(t, e), n = M(t, e);
1519
1520
  return [o, n];
1520
1521
  }
1521
1522
  const xo = _(nt)`
@@ -1535,7 +1536,7 @@ const xo = _(nt)`
1535
1536
  }
1536
1537
  `;
1537
1538
  function bo({ className: t, ...e }) {
1538
- const [o, n] = M(e, ot), [i, a] = M(n, fo);
1539
+ const [o, n] = I(e, ot), [i, a] = I(n, fo);
1539
1540
  return /* @__PURE__ */ w(xo, { className: x("section--card-list", t), type: e.type, ...a, children: [
1540
1541
  Object.keys(o).length > 0 && /* @__PURE__ */ r(et, { center: !0, ...o, className: "mb-[2.5vw]" }),
1541
1542
  /* @__PURE__ */ r(ho, { ...i, dark: !!e.dark })
@@ -1558,12 +1559,12 @@ const yo = _(bo)`
1558
1559
  }
1559
1560
  `;
1560
1561
  function wo({ section: t, ...e }) {
1561
- const [{ editing: o }, n] = M(e, tt), i = S(() => ({
1562
- ...N(n, ["listBorder", "list", "iconSize", "imageSize"]),
1562
+ const [{ editing: o }, n] = I(e, tt), i = B(() => ({
1563
+ ...M(n, ["listBorder", "list", "iconSize", "imageSize"]),
1563
1564
  list: n.list?.map((a) => ({
1564
- ...N(a, "icon", "iconColor"),
1565
+ ...M(a, "icon", "iconColor"),
1565
1566
  image: ["news", "simple", "default"].includes(n.type) && a.icon ? a.icon : a.image,
1566
- actions: a.actions?.map?.((c) => /* @__PURE__ */ r(Rt, { ...c, editing: o }, c.id)),
1567
+ actions: a.actions?.map?.((c) => /* @__PURE__ */ r(jt, { ...c, editing: o }, c.id)),
1567
1568
  border: n.listBorder,
1568
1569
  iconSize: n.iconSize,
1569
1570
  imageSize: n.imageSize,
@@ -1598,7 +1599,7 @@ function vo({
1598
1599
  py: 2
1599
1600
  },
1600
1601
  children: /* @__PURE__ */ r(
1601
- L,
1602
+ z,
1602
1603
  {
1603
1604
  variant: "caption",
1604
1605
  sx: {
@@ -1632,7 +1633,7 @@ function ko({
1632
1633
  );
1633
1634
  }
1634
1635
  function _o({ dataId: t, src: e, actions: o, center: n, onLoad: i, ...a }) {
1635
- const [c, s] = M(a, ot);
1636
+ const [c, s] = I(a, ot);
1636
1637
  return /* @__PURE__ */ w(nt, { ...s, children: [
1637
1638
  Object.keys(c).length > 0 && /* @__PURE__ */ r(et, { center: n, ...c }),
1638
1639
  /* @__PURE__ */ r(
@@ -1644,7 +1645,7 @@ function _o({ dataId: t, src: e, actions: o, center: n, onLoad: i, ...a }) {
1644
1645
  height: a.iframeHeight ? `${a.iframeHeight}px` : "100%"
1645
1646
  }
1646
1647
  ),
1647
- /* @__PURE__ */ r(j, { actions: o, center: n })
1648
+ /* @__PURE__ */ r(T, { actions: o, center: n })
1648
1649
  ] });
1649
1650
  }
1650
1651
  const An = {
@@ -1659,10 +1660,10 @@ const An = {
1659
1660
  id: ""
1660
1661
  };
1661
1662
  function $o({ section: t, id: e, src: o, ...n }) {
1662
- const i = `${e}-${n.locale}`, [{ editing: a }, c] = M(n, tt), s = ct({}), l = JSON.parse(JSON.stringify(c)), { message: d } = ge(i, "server"), p = he(JSON.parse(JSON.stringify(c.config) || "{}"));
1663
- return G(() => {
1663
+ const i = `${e}-${n.locale}`, [{ editing: a }, c] = I(n, tt), s = ct({}), l = JSON.parse(JSON.stringify(c)), { message: d } = ge(i, "server"), p = he(JSON.parse(JSON.stringify(c.config) || "{}"));
1664
+ return V(() => {
1664
1665
  d && d.onInit(() => p.current);
1665
- }, [d]), G(() => {
1666
+ }, [d]), V(() => {
1666
1667
  const m = JSON.parse(JSON.stringify(c.config) || "{}");
1667
1668
  fe(s.current, m) || (s.current = m, d?.send("config-set", m));
1668
1669
  }, [d, c.config]), o ? /* @__PURE__ */ r(_o, { ...l, dataId: i, src: o, style: a ? { pointerEvents: "none" } : {} }) : /* @__PURE__ */ r(Co, { children: 'Please set the "src" attribute for this block' });
@@ -1702,38 +1703,47 @@ const Co = _("div")`
1702
1703
  maxY: l
1703
1704
  };
1704
1705
  }, Io = (t) => Object.values(t).reduce((e, o) => Math.max(e, o.y || 0), 0) || 0, Wo = (t) => {
1705
- const { dev: e, id: o, section: n, onBlockRender: i } = t, a = e?.mode, c = Vt((v) => v.breakpoints.down("sm")), { t: s } = be(), { sections: l, sectionIds: d, config: p } = n, { columns: m = Mo, gridSettings: g, gap: u, padding: b, background: f, alignContent: y } = p || {}, k = S(() => U({
1706
- type: "layoutBlockGap",
1707
- value: u ?? So,
1708
- format: "sx"
1709
- }), [u]), $ = S(() => U({
1706
+ const { dev: e, id: o, section: n, onBlockRender: i } = t, a = e?.mode, c = Vt((k) => k.breakpoints.down("sm")), { t: s } = be(), { sections: l, sectionIds: d, config: p } = n, { columns: m = Mo, gridSettings: g, gap: u, padding: b, background: f, alignContent: y } = p || {}, v = B(() => {
1707
+ const C = D({
1708
+ type: "layoutBlockGap",
1709
+ value: u ?? So,
1710
+ format: "sx"
1711
+ }), E = {
1712
+ ...C,
1713
+ gap: Object.keys(C.gap).reduce((N, L) => (N[L] = -C.gap[L], N), {})
1714
+ };
1715
+ return {
1716
+ item: C,
1717
+ container: E
1718
+ };
1719
+ }, [u]), $ = B(() => D({
1710
1720
  type: "layoutBlockPadding",
1711
1721
  value: b ?? No,
1712
1722
  format: "sx"
1713
- }), [b]), P = S(() => U({
1723
+ }), [b]), W = B(() => D({
1714
1724
  type: "layoutBlockAlignContent",
1715
1725
  // 使用类型断言避免类型错误
1716
1726
  value: y ?? vt,
1717
1727
  format: "sx"
1718
- }), [y]), C = D(
1719
- (v, R = !1, V = 0) => {
1720
- if (!i || !v || !v.component || v.visibility === "hidden")
1728
+ }), [y]), S = Y(
1729
+ (k, C = !1, E = 0) => {
1730
+ if (!i || !k || !k.component || k.visibility === "hidden")
1721
1731
  return null;
1722
- const W = Po({
1732
+ const N = Po({
1723
1733
  gridSettings: g,
1724
- section: v,
1725
- index: V,
1734
+ section: k,
1735
+ index: E,
1726
1736
  columns: m,
1727
1737
  simulateMode: c ? "mobile" : "desktop",
1728
- isBackground: R
1729
- }), J = W?.x ?? 0, K = W?.y ?? 0, T = W?.w ?? m, Ot = W?.h ?? 1, Ut = W?.maxY ?? 0, Ft = !!n?.config?.backgroundSectionId;
1738
+ isBackground: C
1739
+ }), L = N?.x ?? 0, U = N?.y ?? 0, F = N?.w ?? m, Ot = N?.h ?? 1, Ut = N?.maxY ?? 0, Ft = !!n?.config?.backgroundSectionId;
1730
1740
  return /* @__PURE__ */ r(
1731
1741
  h,
1732
1742
  {
1733
- className: R ? "layout-block-background" : "layout-block-section",
1743
+ className: C ? "layout-block-background" : "layout-block-section",
1734
1744
  sx: {
1735
1745
  // 背景元素和普通元素都使用 grid 布局
1736
- ...R ? {
1746
+ ...C ? {
1737
1747
  // 背景元素覆盖整个网格区域
1738
1748
  gridColumn: "1 / -1",
1739
1749
  gridRow: `1 / ${Ut + 1}`,
@@ -1747,9 +1757,9 @@ const Co = _("div")`
1747
1757
  } : {
1748
1758
  position: "relative",
1749
1759
  // 使用 grid 定位普通元素
1750
- gridColumn: `${J + 1} / span ${T}`,
1760
+ gridColumn: `${L + 1} / span ${F}`,
1751
1761
  // hasBackground 的话,不再 + 1,因为 background 会占用第一行
1752
- gridRow: `${K + (Ft ? 0 : 1)} / span ${Ot}`,
1762
+ gridRow: `${U + (Ft ? 0 : 1)} / span ${Ot}`,
1753
1763
  zIndex: 1,
1754
1764
  // Ensure content is above background
1755
1765
  minWidth: 0,
@@ -1758,6 +1768,10 @@ const Co = _("div")`
1758
1768
  // 防止内容撑开网格项
1759
1769
  overflow: "hidden",
1760
1770
  // 防止子内容溢出网格项
1771
+ // 只给非第一行添加上边距
1772
+ ...U > 0 ? { mt: v?.item?.gap } : {},
1773
+ // 只给非第一列添加左边距
1774
+ ...L > 0 ? { ml: v?.item?.gap } : {},
1761
1775
  "& > .BlockBase-root": {
1762
1776
  height: "100%",
1763
1777
  width: "100%",
@@ -1766,30 +1780,30 @@ const Co = _("div")`
1766
1780
  }
1767
1781
  },
1768
1782
  children: i({
1769
- id: v.id,
1770
- type: v.component,
1783
+ id: k.id,
1784
+ type: k.component,
1771
1785
  config: {},
1772
1786
  section: {
1773
- ...v
1787
+ ...k
1774
1788
  },
1775
1789
  mode: a
1776
1790
  })
1777
1791
  },
1778
- v.id
1792
+ k.id
1779
1793
  );
1780
1794
  },
1781
- [o, a, i, g, m, c]
1782
- ), { backgroundElements: ut, contentElements: gt } = S(() => {
1795
+ [o, a, i, g, m, c, v]
1796
+ ), { backgroundElements: ut, contentElements: gt } = B(() => {
1783
1797
  if (!d || !d.length || !l || !Object.keys(l).length)
1784
1798
  return { backgroundElements: [], contentElements: [] };
1785
- const v = [], R = [];
1786
- return d?.forEach((V, W) => {
1787
- const J = l[V];
1788
- if (!J) return;
1789
- const K = n?.config?.backgroundSectionId === V, T = C(J, K, W);
1790
- T && (K ? v.push(T) : R.push(T));
1791
- }), { backgroundElements: v, contentElements: R };
1792
- }, [C, l, d]);
1799
+ const k = [], C = [];
1800
+ return d?.forEach((E, N) => {
1801
+ const L = l[E];
1802
+ if (!L) return;
1803
+ const U = n?.config?.backgroundSectionId === E, F = S(L, U, N);
1804
+ F && (U ? k.push(F) : C.push(F));
1805
+ }), { backgroundElements: k, contentElements: C };
1806
+ }, [S, l, d]);
1793
1807
  return a === "draft" && !ut?.length && !gt?.length ? /* @__PURE__ */ w(
1794
1808
  h,
1795
1809
  {
@@ -1801,7 +1815,7 @@ const Co = _("div")`
1801
1815
  alignItems: "center",
1802
1816
  justifyContent: "center",
1803
1817
  gap: 2,
1804
- border: (v) => `2px dashed ${v.palette.divider}`,
1818
+ border: (k) => `2px dashed ${k.palette.divider}`,
1805
1819
  borderRadius: 2,
1806
1820
  padding: 4,
1807
1821
  color: "text.secondary",
@@ -1851,13 +1865,13 @@ const Co = _("div")`
1851
1865
  bottom: 0,
1852
1866
  pointerEvents: "none",
1853
1867
  opacity: 0.1,
1854
- background: (v) => `
1868
+ background: (k) => `
1855
1869
  repeating-linear-gradient(
1856
1870
  90deg,
1857
1871
  transparent,
1858
1872
  transparent calc(100% / ${m} - 1px),
1859
- ${v.palette.grey[400]} calc(100% / ${m} - 1px),
1860
- ${v.palette.grey[400]} calc(100% / ${m})
1873
+ ${k.palette.grey[400]} calc(100% / ${m} - 1px),
1874
+ ${k.palette.grey[400]} calc(100% / ${m})
1861
1875
  )
1862
1876
  `
1863
1877
  }
@@ -1880,9 +1894,8 @@ const Co = _("div")`
1880
1894
  boxSizing: "border-box",
1881
1895
  overflow: "hidden",
1882
1896
  // Prevent content overflow
1883
- ...k,
1884
1897
  ...$,
1885
- alignContent: P?.alignContent ?? vt
1898
+ alignContent: W?.alignContent ?? vt
1886
1899
  },
1887
1900
  children: [
1888
1901
  ut,
@@ -1900,7 +1913,7 @@ function Ao({
1900
1913
  fullSizeImage: a,
1901
1914
  ...c
1902
1915
  }) {
1903
- const [s, l] = M(c, ot), d = Object.keys(s).length > 0 && Object.values(lt(s, Lo)).filter(Boolean).length > 0 && /* @__PURE__ */ r(et, { ...s }), p = St(t) ? t : /* @__PURE__ */ r(h, { component: "img", src: t, alt: "", className: "block" }), m = ["phone", "macbook"].includes(e), g = t && /* @__PURE__ */ r(
1916
+ const [s, l] = I(c, ot), d = Object.keys(s).length > 0 && Object.values(lt(s, Lo)).filter(Boolean).length > 0 && /* @__PURE__ */ r(et, { ...s }), p = St(t) ? t : /* @__PURE__ */ r(h, { component: "img", src: t, alt: "", className: "block" }), m = ["phone", "macbook"].includes(e), g = t && /* @__PURE__ */ r(
1904
1917
  h,
1905
1918
  {
1906
1919
  className: x(
@@ -1978,7 +1991,7 @@ const zo = [
1978
1991
  /\/v\/([^#&?]{11})/
1979
1992
  // /v/<id>
1980
1993
  ];
1981
- function Ro(t) {
1994
+ function jo(t) {
1982
1995
  if (/youtu\.?be/.test(t))
1983
1996
  for (const e of zo) {
1984
1997
  const o = e.exec(t)?.[1];
@@ -1986,13 +1999,13 @@ function Ro(t) {
1986
1999
  return o;
1987
2000
  }
1988
2001
  }
1989
- function jo(t) {
1990
- const e = Ro(t);
2002
+ function Ro(t) {
2003
+ const e = jo(t);
1991
2004
  if (e)
1992
2005
  return `https://youtube.com/embed/${e}`;
1993
2006
  }
1994
2007
  function Eo({ src: t }) {
1995
- return G(() => {
2008
+ return V(() => {
1996
2009
  import("@lottiefiles/lottie-player");
1997
2010
  }, []), /* @__PURE__ */ r("lottie-player", { autoplay: !0, loop: !0, mode: "normal", src: t });
1998
2011
  }
@@ -2011,11 +2024,11 @@ function To(t) {
2011
2024
  function Oo({ url: t }) {
2012
2025
  const e = ct(null), o = 495, [n, i] = Z(
2013
2026
  e.current ? e.current.offsetWidth * 0.5625 : o
2014
- ), a = D(() => {
2027
+ ), a = Y(() => {
2015
2028
  const c = window.innerWidth > 990 ? 1 : window.innerWidth > 522 ? 1.2 : window.innerWidth > 400 ? 1.45 : 1.85, s = e.current ? e.current.offsetWidth * 0.5625 : o;
2016
2029
  return i(Math.floor(s * c));
2017
2030
  }, []);
2018
- return G(() => {
2031
+ return V(() => {
2019
2032
  window.addEventListener("resize", a);
2020
2033
  const c = window.innerWidth > 990 ? 1 : window.innerWidth > 522 ? 1.2 : window.innerWidth > 400 ? 1.45 : 1.85, s = e.current ? e.current.offsetWidth * 0.5625 : o;
2021
2034
  return i(Math.floor(s * c)), function() {
@@ -2065,11 +2078,11 @@ function Fo({
2065
2078
  section: s,
2066
2079
  ...l
2067
2080
  }) {
2068
- const [{ editing: d }, p] = M({ ...l, boxed: e ? void 0 : o }, tt);
2069
- let m = Do(p.image, n, e, i, a, c);
2081
+ const [{ editing: d }, p] = I({ ...l, boxed: e ? void 0 : o }, tt);
2082
+ let m = Go(p.image, n, e, i, a, c);
2070
2083
  t || (m = null);
2071
2084
  let g = null;
2072
- return p.actions && (g = p.actions?.map?.((u, b) => /* @__PURE__ */ r(Rt, { ...u, editing: d }, b))), /* @__PURE__ */ r(
2085
+ return p.actions && (g = p.actions?.map?.((u, b) => /* @__PURE__ */ r(jt, { ...u, editing: d }, b))), /* @__PURE__ */ r(
2073
2086
  Uo,
2074
2087
  {
2075
2088
  ...p,
@@ -2080,17 +2093,17 @@ function Fo({
2080
2093
  }
2081
2094
  );
2082
2095
  }
2083
- function Do(t, e, o, n, i, a) {
2096
+ function Go(t, e, o, n, i, a) {
2084
2097
  if (t) {
2085
2098
  if (t.endsWith(".json"))
2086
2099
  return /* @__PURE__ */ r(Eo, { src: t });
2087
2100
  if (t.indexOf("twitter.com") !== -1)
2088
2101
  return /* @__PURE__ */ r(To, { sourceType: "url", url: t });
2089
- const c = jo(t);
2102
+ const c = Ro(t);
2090
2103
  if (c)
2091
2104
  return /* @__PURE__ */ r(Oo, { url: c });
2092
2105
  const { naturalWidth: s, naturalHeight: l, filename: d } = n || {};
2093
- if (O(t))
2106
+ if (G(t))
2094
2107
  return /* @__PURE__ */ r(
2095
2108
  "video",
2096
2109
  {
@@ -2106,8 +2119,8 @@ function Do(t, e, o, n, i, a) {
2106
2119
  width: "100%",
2107
2120
  height: "100%"
2108
2121
  },
2109
- poster: A(B(e), o ? 1200 : 540, i),
2110
- children: /* @__PURE__ */ r("source", { src: B(t), type: qe(t) })
2122
+ poster: j(P(e), o ? 1200 : 540, i),
2123
+ children: /* @__PURE__ */ r("source", { src: P(t), type: qe(t) })
2111
2124
  },
2112
2125
  t
2113
2126
  );
@@ -2115,7 +2128,7 @@ function Do(t, e, o, n, i, a) {
2115
2128
  return /* @__PURE__ */ r(
2116
2129
  Pt,
2117
2130
  {
2118
- src: B(t),
2131
+ src: P(t),
2119
2132
  sizesAttr: {
2120
2133
  sm: 600 * p,
2121
2134
  md: 450 * p,
@@ -2135,15 +2148,15 @@ function Do(t, e, o, n, i, a) {
2135
2148
  }
2136
2149
  return null;
2137
2150
  }
2138
- const Rn = ["production", "draft"];
2139
- function jn({ mode: t, version: e } = {}) {
2151
+ const jn = ["production", "draft"];
2152
+ function Rn({ mode: t, version: e } = {}) {
2140
2153
  const o = e && typeof e == "number" ? { mode: t, version: e } : { mode: t };
2141
2154
  return dt.get(`/api/${mt()}/pages`, { params: o }).then((n) => n.data);
2142
2155
  }
2143
2156
  function En({ mode: t, routes: e }) {
2144
2157
  return dt.post(`/api/${mt()}/pages/publish`, { mode: t, routes: e }).then((o) => o.data);
2145
2158
  }
2146
- function Go({
2159
+ function Do({
2147
2160
  locale: t,
2148
2161
  sort: e,
2149
2162
  page: o,
@@ -2157,14 +2170,14 @@ const Tn = {
2157
2170
  sort: "-updatedAt"
2158
2171
  }, kt = 20;
2159
2172
  function Ho({ style: t, sort: e, section: o, ...n }) {
2160
- const [{ editing: i, locale: a }, c] = M(n, tt), [s, l] = M(c, ot), [d, p] = Z(), m = ct(!1), g = ve(), u = re(), b = D(async () => {
2173
+ const [{ editing: i, locale: a }, c] = I(n, tt), [s, l] = I(c, ot), [d, p] = Z(), m = ct(!1), g = ve(), u = re(), b = Y(async () => {
2161
2174
  if (!m.current) {
2162
2175
  m.current = !0, g();
2163
2176
  try {
2164
- const f = d ? Math.floor(d.list.length / kt) + 1 : 1, { list: y, total: k } = await Go({ locale: a, sort: e, page: f, limit: kt });
2177
+ const f = d ? Math.floor(d.list.length / kt) + 1 : 1, { list: y, total: v } = await Do({ locale: a, sort: e, page: f, limit: kt });
2165
2178
  p(($) => ({
2166
2179
  list: ($?.list ?? []).concat(y),
2167
- total: k
2180
+ total: v
2168
2181
  }));
2169
2182
  } finally {
2170
2183
  m.current = !1, g();
@@ -2204,13 +2217,13 @@ function Ho({ style: t, sort: e, section: o, ...n }) {
2204
2217
  {
2205
2218
  component: "img",
2206
2219
  alt: "",
2207
- image: A(B(f.image), 540),
2220
+ image: j(P(f.image), 540),
2208
2221
  loading: "lazy"
2209
2222
  }
2210
2223
  ),
2211
2224
  /* @__PURE__ */ w(qt, { children: [
2212
- /* @__PURE__ */ r(L, { variant: "h6", component: "div", className: _t, children: f.title || f.id }),
2213
- /* @__PURE__ */ r(L, { variant: "body2", className: _t, children: f.description })
2225
+ /* @__PURE__ */ r(z, { variant: "h6", component: "div", className: _t, children: f.title || f.id }),
2226
+ /* @__PURE__ */ r(z, { variant: "body2", className: _t, children: f.description })
2214
2227
  ] })
2215
2228
  ]
2216
2229
  }
@@ -2227,7 +2240,7 @@ function Ho({ style: t, sort: e, section: o, ...n }) {
2227
2240
  textAlign: "center",
2228
2241
  mt: 2
2229
2242
  },
2230
- children: d.total > d.list.length ? /* @__PURE__ */ r(F, { variant: "outlined", color: "secondary", onClick: b, loading: m.current, children: "More" }) : /* @__PURE__ */ r(F, { variant: "outlined", color: "secondary", disabled: !0, children: "No More" })
2243
+ children: d.total > d.list.length ? /* @__PURE__ */ r(H, { variant: "outlined", color: "secondary", onClick: b, loading: m.current, children: "More" }) : /* @__PURE__ */ r(H, { variant: "outlined", color: "secondary", disabled: !0, children: "No More" })
2231
2244
  }
2232
2245
  )
2233
2246
  ] }) : /* @__PURE__ */ r(
@@ -2286,25 +2299,25 @@ function Jo({
2286
2299
  page: c,
2287
2300
  ...s
2288
2301
  }) {
2289
- const l = Vo[e], { getPageMetaStyle: d } = Ee(), p = S(() => {
2302
+ const l = Vo[e], { getPageMetaStyle: d } = Ee(), p = B(() => {
2290
2303
  const { height: u, ...b } = n;
2291
2304
  return e === "layout-block" && (b.onBlockRender = (f) => {
2292
2305
  const y = {
2293
2306
  ...n?.dev,
2294
2307
  ...f?.config?.dev
2295
- }, { defaultLocale: k } = y, $ = {
2308
+ }, { defaultLocale: v } = y, $ = {
2296
2309
  ...lt(n, ["locale", "editing"]),
2297
2310
  ...f?.config,
2298
2311
  dev: y
2299
- }, { locale: P } = $;
2300
- let C = c?.dataSource?.[f?.id]?.[P];
2301
- return Zt(C) && (C = c?.dataSource?.[f?.id]?.[k ?? "en"]), /* @__PURE__ */ r(
2312
+ }, { locale: W } = $;
2313
+ let S = c?.dataSource?.[f?.id]?.[W];
2314
+ return Zt(S) && (S = c?.dataSource?.[f?.id]?.[v ?? "en"]), /* @__PURE__ */ r(
2302
2315
  Jo,
2303
2316
  {
2304
2317
  ...f,
2305
2318
  config: {
2306
2319
  ...f?.section?.properties,
2307
- ...C,
2320
+ ...S,
2308
2321
  ...$
2309
2322
  },
2310
2323
  page: c,
@@ -2312,7 +2325,7 @@ function Jo({
2312
2325
  }
2313
2326
  );
2314
2327
  }), b;
2315
- }, [n, e]), m = S(() => {
2328
+ }, [n, e]), m = B(() => {
2316
2329
  const u = {};
2317
2330
  return e !== "custom-component" && (u.height = n.height), u.sx = a ? void 0 : d("sx"), u.id = `BlockBase-${t}`, u;
2318
2331
  }, [n.height, a, e, d]), g = l && /* @__PURE__ */ r(l, { mode: o, ...p, id: t, section: i });
@@ -2325,7 +2338,7 @@ function Ko({ type: t }) {
2325
2338
  sx: {
2326
2339
  p: 2
2327
2340
  },
2328
- children: /* @__PURE__ */ w(Qt, { icon: /* @__PURE__ */ r(Dt, {}), color: "error", children: [
2341
+ children: /* @__PURE__ */ w(Qt, { icon: /* @__PURE__ */ r(Gt, {}), color: "error", children: [
2329
2342
  "Unsupported Block `",
2330
2343
  t,
2331
2344
  "`"
@@ -2337,10 +2350,10 @@ export {
2337
2350
  Jo as B,
2338
2351
  An as I,
2339
2352
  Wn as P,
2340
- Rn as S,
2353
+ jn as S,
2341
2354
  Tn as T,
2342
2355
  In as a,
2343
2356
  zn as b,
2344
- jn as g,
2357
+ Rn as g,
2345
2358
  En as p
2346
2359
  };