@blocklet/pages-kit-inner-components 0.4.99 → 0.4.101

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.
@@ -0,0 +1,2086 @@
1
+ import { jsx as o, jsxs as w, Fragment as J } from "react/jsx-runtime";
2
+ import "@mui/icons-material";
3
+ import { Box as x, Tooltip as Ot, styled as xt, Stack as bt, Typography as P, Container as Ft, useTheme as At, createTheme as Ht, ThemeProvider as Dt, Card as Vt, CircularProgress as Ut, Grid as st, CardMedia as Mt, CardContent as Jt } from "@mui/material";
4
+ import yt, { createContext as wt, useMemo as R, useCallback as E, useContext as vt, forwardRef as Yt, useState as j, useRef as Y, Fragment as Gt, isValidElement as kt, useEffect as O } from "react";
5
+ import tt from "lodash/keyBy";
6
+ import { a as z, b as S, E as Xt, f as et, k as ot } from "./state-DsXKwImw.js";
7
+ import { AIForm as lt, AIFormResult as ct } from "@blocklet/ai-runtime/components";
8
+ import { deepmerge as Kt } from "@mui/utils";
9
+ import nt from "lodash/pick";
10
+ import { ErrorBoundary as qt } from "react-error-boundary";
11
+ import { useColorConvert as _t } from "@blocklet/pages-kit/contexts/color";
12
+ import { cx as b, css as X } from "@emotion/css";
13
+ import { Icon as K } from "@iconify/react";
14
+ import Qt from "react-markdown";
15
+ import Zt from "remark-gfm";
16
+ import { LoadingButton as te } from "@mui/lab";
17
+ import { useTheme as $t, styled as _ } from "@arcblock/ux/lib/Theme";
18
+ import ee from "@arcblock/react-hooks/lib/useBrowser";
19
+ import dt from "@arcblock/ux/lib/Colors";
20
+ import { ResponsiveImage as Nt, CustomComponentRenderer as oe } from "@blocklet/pages-kit/components";
21
+ import { isGradient as ne, isColorString as re } from "@blocklet/pages-kit/utils/style";
22
+ import St from "@mui/material/useMediaQuery";
23
+ import C from "lodash/omit";
24
+ import { Icon as Ct } from "@iconify-icon/react";
25
+ import ie from "@arcblock/ux/lib/Screenshot";
26
+ import { Link as ae, NavLink as se, useNavigate as le } from "react-router-dom";
27
+ import ce from "@arcblock/ux/lib/Button";
28
+ import q from "is-uri";
29
+ import { join as M } from "pathe";
30
+ import { withoutTrailingSlash as G, isRelative as de, parseURL as me } from "ufo";
31
+ import { useMessage as pe } from "@blocklet/embed/message";
32
+ import { useLatest as ue } from "ahooks";
33
+ import he from "lodash/isEqual";
34
+ import { EmbedIframe as fe } from "@blocklet/embed/react";
35
+ import { TwitterTimelineEmbed as ge } from "react-twitter-embed";
36
+ import { useUpdate as xe, useMount as be } from "react-use";
37
+ const ye = [
38
+ {
39
+ title: "None",
40
+ value: "none",
41
+ sx: { py: 0 }
42
+ },
43
+ {
44
+ title: "Small",
45
+ value: "small",
46
+ sx: { py: { xs: 2.5, md: 4, lg: 4, xl: 6 } }
47
+ },
48
+ {
49
+ title: "Normal",
50
+ value: "normal",
51
+ sx: { py: { xs: 5, md: 7.5, lg: 10, xl: 12.5 } }
52
+ },
53
+ {
54
+ title: "Large",
55
+ value: "large",
56
+ sx: { py: { xs: 7.5, md: 10, lg: 12.5, xl: 15 } }
57
+ }
58
+ ], we = [
59
+ {
60
+ title: "None",
61
+ value: "none",
62
+ sx: { px: 0 }
63
+ },
64
+ {
65
+ title: "Small",
66
+ value: "small",
67
+ sx: { px: { xs: 2.5, md: 4, lg: 4, xl: 6 } }
68
+ },
69
+ {
70
+ title: "Normal",
71
+ value: "normal",
72
+ sx: { px: { xs: 5, md: 7.5, lg: 10, xl: 12.5 } }
73
+ },
74
+ {
75
+ title: "Large",
76
+ value: "large",
77
+ sx: { px: { xs: 7.5, md: 10, lg: 12.5, xl: 15 } }
78
+ }
79
+ ], ve = [
80
+ {
81
+ title: "Full Width",
82
+ value: "full",
83
+ sx: { maxWidth: "100%" }
84
+ },
85
+ {
86
+ title: "Small",
87
+ value: "sm",
88
+ sx: {
89
+ maxWidth: (t) => t.breakpoints.values.sm,
90
+ width: "100%",
91
+ mx: "auto"
92
+ }
93
+ },
94
+ {
95
+ title: "Normal",
96
+ value: "md",
97
+ sx: { maxWidth: (t) => t.breakpoints.values.md, width: "100%", mx: "auto" }
98
+ },
99
+ {
100
+ title: "Large",
101
+ value: "lg",
102
+ sx: { maxWidth: (t) => t.breakpoints.values.lg, width: "100%", mx: "auto" }
103
+ },
104
+ {
105
+ title: "Extra Large",
106
+ value: "xl",
107
+ sx: { maxWidth: (t) => t.breakpoints.values.xl, width: "100%", mx: "auto" }
108
+ }
109
+ ], ke = tt(ye, "value"), _e = tt(we, "value"), $e = tt(ve, "value"), Ne = /* @__PURE__ */ new Map([
110
+ ["paddingY", ke],
111
+ ["paddingX", _e],
112
+ ["maxWidth", $e]
113
+ ]);
114
+ function Pt(t) {
115
+ var c;
116
+ const { type: e, value: r, format: i = "sx", defaultValue: n = null } = t, a = Ne.get(e);
117
+ return a && a != null && a[r] && (c = a == null ? void 0 : a[r]) != null && c[i] ? a[r][i] : n;
118
+ }
119
+ const Bt = wt({
120
+ page: null,
121
+ getPageMeta: () => ({}),
122
+ getPageMetaStyle: () => ({})
123
+ });
124
+ function Se() {
125
+ return vt(Bt);
126
+ }
127
+ function gn({
128
+ page: t,
129
+ children: e,
130
+ defaultLocale: r = "en",
131
+ currentLocale: i
132
+ }) {
133
+ const n = R(() => t ? JSON.parse(JSON.stringify(t)) : null, [JSON.stringify(t)]), a = E(() => {
134
+ var d;
135
+ if (!n) return {};
136
+ const l = i || r;
137
+ return ((d = n.locales) == null ? void 0 : d[l]) ?? {};
138
+ }, [n, r, i]), c = E(
139
+ (l = "sx") => {
140
+ const d = a();
141
+ return !d || !d.style ? {} : Object.entries(d.style || {}).reduce((p, [h, u]) => {
142
+ if (!u) return p;
143
+ const f = Pt({
144
+ type: h,
145
+ value: u,
146
+ format: l
147
+ });
148
+ return f ? { ...p, ...f } : p;
149
+ }, {});
150
+ },
151
+ [a]
152
+ ), s = R(
153
+ () => ({
154
+ page: n,
155
+ getPageMeta: a,
156
+ getPageMetaStyle: c
157
+ }),
158
+ [n, a, c]
159
+ );
160
+ return /* @__PURE__ */ o(Bt.Provider, { value: s, children: e });
161
+ }
162
+ const Ce = Yt(({ onClick: t, ...e }, r) => {
163
+ const [i, n] = j(!1), a = E(
164
+ async (c) => {
165
+ try {
166
+ n(!0), await (t == null ? void 0 : t(c));
167
+ } finally {
168
+ n(!1);
169
+ }
170
+ },
171
+ [t]
172
+ );
173
+ return /* @__PURE__ */ o(te, { ref: r, ...e, loading: e.loading || i, onClick: a });
174
+ });
175
+ function Pe({
176
+ tip: t,
177
+ tipSucceed: e,
178
+ title: r,
179
+ titleSucceed: i,
180
+ icon: n,
181
+ iconSucceed: a,
182
+ autoReset: c,
183
+ placement: s = "top",
184
+ ...l
185
+ }) {
186
+ const [d, m] = j(!1), [p, h] = j(), u = Y(), f = () => {
187
+ h(void 0), c && (u.current = window.setTimeout(() => {
188
+ m(!1);
189
+ }, 3e3));
190
+ }, y = () => {
191
+ clearTimeout(u.current);
192
+ }, g = d ? a : n, v = p ? /* @__PURE__ */ o(x, { color: "error", children: p.message }) : d && e || t;
193
+ return /* @__PURE__ */ o(Ot, { title: v, disableInteractive: !0, placement: s, onClose: f, onOpen: y, children: /* @__PURE__ */ o("span", { children: /* @__PURE__ */ o(
194
+ Ce,
195
+ {
196
+ startIcon: g && (typeof g == "string" ? /* @__PURE__ */ o(K, { icon: g }) : g),
197
+ loadingPosition: g ? "start" : void 0,
198
+ ...l,
199
+ onClick: async (N) => {
200
+ if (l.onClick)
201
+ try {
202
+ await l.onClick(N), m(!0);
203
+ } catch (B) {
204
+ h(B);
205
+ }
206
+ },
207
+ children: d ? i : r
208
+ }
209
+ ) }) });
210
+ }
211
+ const Be = yt.lazy(() => import("react-syntax-highlighter").then((t) => ({ default: t.Prism }))), Ie = xt((t) => /* @__PURE__ */ o(
212
+ Qt,
213
+ {
214
+ ...t,
215
+ remarkPlugins: [Zt],
216
+ components: {
217
+ pre: We,
218
+ code: ({ node: e, inline: r, className: i, children: n, ...a }) => {
219
+ if (!n) return null;
220
+ const c = /language-(\w+)/.exec(i || "");
221
+ return r ? /* @__PURE__ */ o(x, { component: "code", className: i, ...a, children: n }) : /* @__PURE__ */ o(x, { component: Be, language: c == null ? void 0 : c[1], ...a, sx: { borderRadius: 1 }, children: String(n).replace(/\n$/, "") });
222
+ },
223
+ table: ({ className: e, children: r }) => /* @__PURE__ */ o(x, { sx: { overflow: "auto", my: 1 }, children: /* @__PURE__ */ o("table", { className: e, children: r }) })
224
+ }
225
+ }
226
+ ))`
227
+ width: 100%;
228
+ overflow: hidden;
229
+ word-break: break-word;
230
+
231
+ > * {
232
+ &:first-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */ {
233
+ margin-top: 0;
234
+ }
235
+ &:last-child /* emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason */ {
236
+ margin-bottom: 0;
237
+ }
238
+ }
239
+
240
+ pre {
241
+ overflow: auto;
242
+ }
243
+
244
+ li {
245
+ margin: 0;
246
+ padding: 0;
247
+ }
248
+
249
+ li p {
250
+ display: inline-block;
251
+ vertical-align: top;
252
+ margin: 0;
253
+ padding: 0;
254
+ }
255
+
256
+ table {
257
+ border-collapse: collapse;
258
+ white-space: nowrap;
259
+
260
+ th,
261
+ td {
262
+ border: 1px solid grey;
263
+ padding: 4px 8px;
264
+ }
265
+ }
266
+
267
+ a {
268
+ color: ${({ theme: t }) => t.palette.primary.main};
269
+
270
+ :hover {
271
+ text-decoration: underline;
272
+ }
273
+ }
274
+
275
+ &.writing > *:last-child {
276
+ &:after {
277
+ content: '';
278
+ display: inline-block;
279
+ vertical-align: middle;
280
+ height: 1.2em;
281
+ margin-top: -0.2em;
282
+ margin-left: 0.1em;
283
+ border-right: 0.2em solid orange;
284
+ border-radius: 10px;
285
+ animation: blink-caret 0.75s step-end infinite;
286
+
287
+ @keyframes blink-caret {
288
+ from,
289
+ to {
290
+ border-color: transparent;
291
+ }
292
+ 50% {
293
+ border-color: ${({ theme: t }) => t.palette.secondary.main};
294
+ }
295
+ }
296
+ }
297
+ }
298
+ `;
299
+ function We({ children: t }) {
300
+ const e = t == null ? void 0 : t.props;
301
+ if (!(e != null && e.children)) return null;
302
+ const r = /language-(\w+)/.exec(e.className || ""), i = r == null ? void 0 : r[1];
303
+ return /* @__PURE__ */ w(
304
+ x,
305
+ {
306
+ component: "div",
307
+ sx: {
308
+ fontSize: 14,
309
+ borderRadius: 1,
310
+ bgcolor: "rgb(245, 242, 240)",
311
+ "> pre": { mt: "0 !important" }
312
+ },
313
+ children: [
314
+ /* @__PURE__ */ w(bt, { direction: "row", alignItems: "center", p: 0.5, pl: 1.5, borderBottom: 1, borderColor: "grey.200", children: [
315
+ /* @__PURE__ */ o(x, { children: i }),
316
+ /* @__PURE__ */ o(x, { flex: 1 }),
317
+ /* @__PURE__ */ o(
318
+ Pe,
319
+ {
320
+ autoReset: !0,
321
+ title: /* @__PURE__ */ o(K, { icon: "tabler:copy" }),
322
+ titleSucceed: /* @__PURE__ */ o(K, { icon: "tabler:copy-check" }),
323
+ sx: { minWidth: 32, minHeight: 32, p: 0, fontSize: 18 },
324
+ onClick: () => {
325
+ window.navigator.clipboard.writeText(e.children);
326
+ }
327
+ }
328
+ )
329
+ ] }),
330
+ t
331
+ ]
332
+ }
333
+ );
334
+ }
335
+ function T({ actions: t, center: e, className: r, align: i }) {
336
+ return t && (t != null && t.length) ? /* @__PURE__ */ o(
337
+ x,
338
+ {
339
+ className: b(
340
+ "flex gap-4 flex-wrap",
341
+ "lg:flex-row lg:gap-8",
342
+ (e || i === "center") && "justify-center",
343
+ !e && i === "right" && "justify-end",
344
+ !e && i === "left" && "justify-start",
345
+ r
346
+ ),
347
+ sx: { alignItems: "center" },
348
+ children: t
349
+ }
350
+ ) : null;
351
+ }
352
+ const Re = "section", je = xt(x)`
353
+ overflow: hidden;
354
+
355
+ .section__title {
356
+ margin-top: 0;
357
+ font-weight: 700;
358
+ }
359
+ .section__title_non_big {
360
+ font-size: 32px;
361
+ @media (max-width: 600px) {
362
+ font-size: 24px;
363
+ }
364
+ }
365
+ &.base-info .section__tag {
366
+ margin-top: 0;
367
+ margin-bottom: 2vw;
368
+ background-color: ${({ theme: t }) => t.palette.primary.main};
369
+ white-space: nowrap;
370
+ max-width: 100%;
371
+ display: inline-block;
372
+ padding: 0 10px;
373
+ justify-content: flex-start;
374
+ overflow: hidden;
375
+ text-overflow: ellipsis;
376
+ font-size: 12px;
377
+ color: #fff;
378
+ border-radius: 4px;
379
+ line-height: 20px;
380
+ }
381
+ .section__title {
382
+ a {
383
+ color: ${({ theme: t }) => t.palette.primary.main};
384
+ }
385
+ p {
386
+ margin-top: 0;
387
+ margin-bottom: 0;
388
+ }
389
+ }
390
+ .section__description {
391
+ margin-bottom: 4vw;
392
+ margin-top: 0;
393
+ a {
394
+ color: ${({ theme: t }) => t.palette.primary.main};
395
+ }
396
+ p {
397
+ margin-top: 0;
398
+ margin-bottom: 0.5rem;
399
+ }
400
+ }
401
+ @media (min-width: ${({ theme: t }) => t.breakpoints.values[Re]}px) {
402
+ .section__tag {
403
+ margin-bottom: 32px;
404
+ }
405
+ .section__title {
406
+ margin-bottom: 32px;
407
+ }
408
+ .section__description {
409
+ margin-bottom: 40px;
410
+ }
411
+ }
412
+ `;
413
+ function F({
414
+ title: t,
415
+ description: e,
416
+ descriptionMarkdown: r,
417
+ actions: i,
418
+ className: n = "",
419
+ classes: a = {},
420
+ prepend: c,
421
+ append: s,
422
+ level: l = 2,
423
+ tag: d,
424
+ badge: m,
425
+ center: p,
426
+ logo: h,
427
+ titleAppearance: u,
428
+ descriptionAppearance: f,
429
+ ...y
430
+ }) {
431
+ const g = _t();
432
+ if (!t && !e && !i && !m && !d && !c && !s && !h) return null;
433
+ const v = Math.max(Math.min(5, l + 1), 1), k = {
434
+ 1: "xl:!text-3xl lg:!text-2xl md:!text-xl",
435
+ 2: "xl:!text-2xl lg:!text-xl md:!text-lg",
436
+ 3: "xl:!text-2xl lg:!text-xl md:!text-lg",
437
+ 4: "xl:!text-xl lg:!text-lg md:!text-md",
438
+ 5: "xl:!text-lg md:!text-md sm:!text-sm",
439
+ 6: "!text-sm"
440
+ }, N = l === 0 ? "big" : `h${v}`, B = l === 0;
441
+ return /* @__PURE__ */ w(je, { className: b("base-info", "lg:text-left", p && "!text-center", n), ...y, children: [
442
+ c && /* @__PURE__ */ o("div", { children: c }),
443
+ (d || m) && /* @__PURE__ */ o("div", { className: b("section__tag", (a == null ? void 0 : a.tag) || (a == null ? void 0 : a.badge)), children: d || m }),
444
+ h && /* @__PURE__ */ o("img", { className: "w-[120px] m-auto mb-8", src: h, alt: "info", loading: "lazy" }),
445
+ t && /* @__PURE__ */ o(
446
+ P,
447
+ {
448
+ sx: {
449
+ whiteSpace: "pre-wrap",
450
+ mb: e ? "2vw" : 0,
451
+ ...(u == null ? void 0 : u.color) && { color: `${g(u.color)} !important` }
452
+ },
453
+ className: b(
454
+ "section__title",
455
+ "text-gray-800",
456
+ "dark:text-gray-50",
457
+ a.title,
458
+ "page-kit-section__title",
459
+ B ? "" : "section__title_non_big"
460
+ ),
461
+ component: `h${Math.max(l, 1)}`,
462
+ variant: N,
463
+ children: t
464
+ }
465
+ ),
466
+ e && (r ? /* @__PURE__ */ o(
467
+ x,
468
+ {
469
+ sx: {
470
+ ...(f == null ? void 0 : f.color) && { color: `${g(f.color)} !important` }
471
+ },
472
+ component: Ie,
473
+ className: b(
474
+ "section__description",
475
+ "text-gray-800",
476
+ "dark:text-gray-100",
477
+ k[v],
478
+ a.description,
479
+ "page-kit-section__description"
480
+ ),
481
+ children: e
482
+ }
483
+ ) : /* @__PURE__ */ o(
484
+ P,
485
+ {
486
+ sx: {
487
+ whiteSpace: "pre-wrap",
488
+ ...(f == null ? void 0 : f.color) && { color: `${g(f.color)} !important` }
489
+ },
490
+ className: b(
491
+ "section__description",
492
+ "text-gray-800",
493
+ "dark:text-gray-100",
494
+ k[v],
495
+ a.description,
496
+ "page-kit-section__description"
497
+ ),
498
+ component: "div",
499
+ variant: "body1",
500
+ gutterBottom: !0,
501
+ children: e
502
+ }
503
+ )),
504
+ /* @__PURE__ */ o(T, { actions: i, center: p, className: "mt-8" }),
505
+ s && /* @__PURE__ */ o("div", { children: s })
506
+ ] });
507
+ }
508
+ const A = [
509
+ "actions",
510
+ "append",
511
+ "badge",
512
+ "tag",
513
+ "center",
514
+ "description",
515
+ "descriptionMarkdown",
516
+ "level",
517
+ "logo",
518
+ "prepend",
519
+ "title",
520
+ "titleAppearance",
521
+ "descriptionAppearance"
522
+ ];
523
+ function It(t) {
524
+ if (t.type === Gt) {
525
+ const r = (t.props.children || []).filter((i) => kt(i));
526
+ return r.length === 1 ? It(r[0]) : r.length > 1;
527
+ }
528
+ return Array.isArray(t);
529
+ }
530
+ const I = "&>*";
531
+ function rt({ children: t, col: e, gap: r, className: i, align: n, sx: a, type: c, ...s } = {
532
+ children: null,
533
+ className: "",
534
+ col: 3,
535
+ gap: void 0,
536
+ sx: {},
537
+ align: "center",
538
+ type: "default"
539
+ }) {
540
+ const l = $t(), d = Number(Math.floor(100 / e * 100) / 100), m = {
541
+ center: "justify-center items-center",
542
+ left: "justify-start items-center",
543
+ right: "justify-end items-center",
544
+ top: "justify-center items-start",
545
+ bottom: "justify-center items-end",
546
+ "top-left": "justify-start items-start",
547
+ "top-right": "justify-end items-start",
548
+ "bottom-left": "justify-start items-end",
549
+ "bottom-right": "justify-end items-end"
550
+ }, p = m[n] || m.center;
551
+ let u = r ?? ({
552
+ 2: 6,
553
+ 3: 4,
554
+ 4: 4,
555
+ 5: 3,
556
+ 6: 3
557
+ }[e] || 0);
558
+ It(t) || (u = 0);
559
+ const y = (e - 1) * u / e;
560
+ let g = { ...a, gap: `${u}rem` };
561
+ const v = { [I]: { width: "100%" } }, k = {}, N = {}, B = {};
562
+ switch (v.gap = "1rem", k.gap = `${u / 2}rem`, e) {
563
+ case 3:
564
+ case 4:
565
+ k[I] = {
566
+ width: `calc(50% - ${u / 2}rem)`
567
+ };
568
+ break;
569
+ case 5:
570
+ case 6:
571
+ v[I] = {
572
+ width: `calc(50% - ${u / 2 / 2}rem)`
573
+ }, k[I] = {
574
+ width: `calc(50% - ${u / 2 / 2}rem)`
575
+ }, N[I] = {
576
+ width: `calc(33.33% - ${u * 2 / 3}rem)`
577
+ };
578
+ break;
579
+ }
580
+ return g[I] = { width: `calc(${d}% - ${y}rem)` }, g[`@media (max-width: ${l.breakpoints.values.xl}px)`] = B, g[`@media (max-width: ${l.breakpoints.values.lg}px)`] = N, g[`@media (max-width: ${l.breakpoints.values.md}px)`] = k, g[`@media (max-width: ${l.breakpoints.values.sm}px)`] = v, c === "wall" && (g = { ...a, gap: `${u}rem` }, g[I] = { width: `calc(${d}% - ${y}rem)` }, v[I] = { width: `calc(45% - ${u / 2 / 2}rem)` }, g[`@media (max-width: ${l.breakpoints.values.sm}px)`] = v), /* @__PURE__ */ o(x, { className: b("flex flex-wrap flex-row h-full", p, i), sx: g, ...s, children: t });
581
+ }
582
+ function ze() {
583
+ const t = navigator.userAgent.toLowerCase();
584
+ return t.includes("safari") && !t.includes("chrome");
585
+ }
586
+ function Te(t = "") {
587
+ if (t.startsWith("data:image/svg+xml,")) return !0;
588
+ const e = /^(((ht|f)tps?):\/\/)?([^!@#$%^&*?.\s-]([^!@#$%^&*?.\s]{0,63}[^!@#$%^&*?.\s])?\.)+[a-z]{2,6}\/?/, r = /^(\/|\.\/|\.\.\/)(?:[^/]+\/)*[^/]+$/;
589
+ return e.test(t) || r.test(t);
590
+ }
591
+ function Q(t) {
592
+ return (t == null ? void 0 : t.endsWith(".mp4")) || (t == null ? void 0 : t.endsWith(".m4v")) || (t == null ? void 0 : t.endsWith(".webm"));
593
+ }
594
+ function Le(t) {
595
+ return t != null && t.endsWith(".mp4") || t != null && t.endsWith(".m4v") ? "video/mp4" : t != null && t.endsWith(".webm") ? "video/webm" : void 0;
596
+ }
597
+ function Ee(t) {
598
+ let e = {};
599
+ return typeof t == "string" ? ne(t) ? e.image = t : (e.image = S(t), re(t) && (e.color = t, e.image = "")) : e = t, e;
600
+ }
601
+ function Oe() {
602
+ const [t, e] = j(Date.now());
603
+ return O(() => {
604
+ const r = () => {
605
+ e(Date.now());
606
+ };
607
+ return document.addEventListener("visibilitychange", r), () => {
608
+ document.removeEventListener("visibilitychange", r);
609
+ };
610
+ }, []), t;
611
+ }
612
+ function mt(t, e, r, i, n) {
613
+ let a = null;
614
+ const { color: c = "", image: s } = Ee(e);
615
+ return s && Te(s) ? (delete r.backgroundColor, !(t.mobile.apple.device || ze()) && Q(s) ? a = /* @__PURE__ */ o(
616
+ x,
617
+ {
618
+ component: "video",
619
+ className: "section-bg",
620
+ width: "100%",
621
+ autoPlay: !0,
622
+ loop: !0,
623
+ muted: !0,
624
+ controls: !1,
625
+ playsInline: !0,
626
+ poster: z(S(i), 1200, "quality"),
627
+ src: Q(s) ? s : z(s, 1200, "quality"),
628
+ sx: {
629
+ position: "absolute",
630
+ zIndex: -9999,
631
+ right: 0,
632
+ left: 0,
633
+ top: 0,
634
+ width: "100%",
635
+ height: "100%",
636
+ objectFit: "cover"
637
+ }
638
+ },
639
+ s
640
+ ) : a = /* @__PURE__ */ o(
641
+ Nt,
642
+ {
643
+ src: s,
644
+ sizesAttr: {
645
+ sm: 600,
646
+ md: 900,
647
+ lg: 1200
648
+ },
649
+ className: "section-bg",
650
+ alt: "",
651
+ width: "100%",
652
+ loading: "lazy",
653
+ sx: {
654
+ position: "absolute",
655
+ zIndex: -9999,
656
+ right: 0,
657
+ left: 0,
658
+ top: 0,
659
+ width: "100%",
660
+ height: "100%",
661
+ objectFit: "cover"
662
+ }
663
+ },
664
+ n || s
665
+ )) : s ? r.backgroundImage = `${s} !important` : c && (r.backgroundColor = `${c} !important`), a;
666
+ }
667
+ function Fe({ autoWidth: t, children: e, ...r }) {
668
+ return t ? /* @__PURE__ */ o(x, { display: "flex", ...r, children: e }) : /* @__PURE__ */ o(Ft, { ...r, children: e });
669
+ }
670
+ function H({
671
+ dark: t = !1,
672
+ children: e,
673
+ className: r,
674
+ sx: i = {},
675
+ boxed: n = { show: !1 },
676
+ padding: a = "normal",
677
+ boxProps: c,
678
+ type: s,
679
+ ...l
680
+ }) {
681
+ const d = { ...i }, m = St((u) => u.breakpoints.down("md"));
682
+ t && (d.color = dt.common.white, d.backgroundColor = `${dt.grey[900]} !important`), n.show && (d.display = "flex");
683
+ const p = R(() => !Number(l.boxMaxWidth) || m ? {
684
+ width: "100%"
685
+ } : s === "wall" && l.boxMaxWidth ? {
686
+ maxWidth: `${l.boxMaxWidth}px !important`,
687
+ width: "100%"
688
+ } : {
689
+ width: "100%"
690
+ }, [l.boxMaxWidth, m, s]), h = Pt({
691
+ type: "paddingY",
692
+ value: a || "normal",
693
+ // section default is normal
694
+ defaultValue: ""
695
+ });
696
+ return /* @__PURE__ */ o(
697
+ Ae,
698
+ {
699
+ component: "section",
700
+ styles: { ...d, ...h },
701
+ className: b("base-section", "px-2 md:px-5 lg:px-5 xl:px-10", r, {
702
+ dark: t
703
+ }),
704
+ ...C(
705
+ l,
706
+ "hoverStyle",
707
+ "boxMaxWidth",
708
+ "embedUrl",
709
+ "autoWidth",
710
+ "paddingXY",
711
+ "iframeHeight",
712
+ "titleAppearance",
713
+ "descriptionAppearance"
714
+ ),
715
+ children: /* @__PURE__ */ o(Fe, { autoWidth: l == null ? void 0 : l.autoWidth, className: b("section-content h-full"), sx: p, children: n.show ? /* @__PURE__ */ o(Wt, { ...c, boxed: n, children: e }) : e })
716
+ }
717
+ );
718
+ }
719
+ function Wt({
720
+ background: t = "",
721
+ backgroundVideoPoster: e,
722
+ children: r,
723
+ sx: i = {},
724
+ boxed: n = { show: !1 },
725
+ className: a = "",
726
+ styles: c = {},
727
+ ...s
728
+ }) {
729
+ const l = { ...c, ...i }, d = _t();
730
+ let m = null;
731
+ const p = St((f) => f.breakpoints.up("sm")), h = ee(), u = Oe();
732
+ return t && (m = mt(
733
+ h,
734
+ typeof t == "string" ? d(t) : t,
735
+ l,
736
+ e,
737
+ u
738
+ )), n.show && (l.borderRadius = "10px", l.padding === void 0 && (l.padding = p ? "50px" : "20px"), n != null && n.border && (l.border = "1px solid #c0c0c0"), n != null && n.background && (m = mt(
739
+ h,
740
+ typeof (n == null ? void 0 : n.background) == "string" ? d(n == null ? void 0 : n.background) : n == null ? void 0 : n.background,
741
+ l,
742
+ n == null ? void 0 : n.backgroundVideoPoster,
743
+ u
744
+ ))), /* @__PURE__ */ w(
745
+ x,
746
+ {
747
+ ...s,
748
+ sx: {
749
+ ...l,
750
+ ...m ? { position: "relative", overflow: "hidden", zIndex: 0 } : {}
751
+ },
752
+ className: b(a, (n == null ? void 0 : n.boxShadow) && "shadow-xl"),
753
+ children: [
754
+ m,
755
+ r
756
+ ]
757
+ }
758
+ );
759
+ }
760
+ const Ae = _(Wt)`
761
+ &:nth-of-type(even) {
762
+ background: #f8f8f8;
763
+ }
764
+
765
+ @media (max-width: 600px) {
766
+ .section__title {
767
+ font-size: 24px;
768
+ }
769
+
770
+ .base-info {
771
+ > *:last-child {
772
+ margin-bottom: 0;
773
+ }
774
+ }
775
+ }
776
+ `;
777
+ function Rt({ icon: t, ...e }) {
778
+ return /* @__PURE__ */ o(Ct, { icon: t, ...e, ref: null });
779
+ }
780
+ function $(t, e) {
781
+ const r = nt(t, e), i = C(t, e);
782
+ return [r, i];
783
+ }
784
+ const jt = ["title", "description", "actions", "badge", "tag", "prepend", "append", "logo"];
785
+ function He({
786
+ image: t,
787
+ imageBorder: e,
788
+ imageShadow: r,
789
+ className: i,
790
+ reverse: n = !1,
791
+ fullSizeImage: a,
792
+ ...c
793
+ }) {
794
+ const [s, l] = $(c, A), d = Object.keys(s).length > 0 && Object.values(nt(s, jt)).filter(Boolean).length > 0 && /* @__PURE__ */ o(F, { ...s }), m = kt(t) ? t : /* @__PURE__ */ o(x, { component: "img", src: t, alt: "", className: "block" }), p = ["phone", "macbook"].includes(e), h = t && /* @__PURE__ */ o(
795
+ x,
796
+ {
797
+ className: b(
798
+ "section__image",
799
+ "m-auto, leading-[1] text-center",
800
+ r && "shadow-xl",
801
+ s != null && s.center ? "flex justify-center items-center" : ""
802
+ ),
803
+ sx: {
804
+ border: e === !0 ? "1px solid #c0c0c0" : void 0,
805
+ borderRadius: 2,
806
+ overflow: "hidden",
807
+ // FIXME: Screenshot 组件无法设置最外层 div 的样式,只能通过父元素设置
808
+ "> div": p ? { width: "100%", video: { borderRadius: "0 !important" } } : void 0
809
+ },
810
+ children: p ? (
811
+ // @ts-ignore
812
+ /* @__PURE__ */ o(ie, { type: e, sx: { width: "100%" }, children: m })
813
+ ) : m
814
+ }
815
+ );
816
+ return /* @__PURE__ */ o(
817
+ H,
818
+ {
819
+ className: b(
820
+ "section--block",
821
+ i,
822
+ a && !n && X`
823
+ .section-bg {
824
+ height: 80%;
825
+ }
826
+ `
827
+ ),
828
+ ...l,
829
+ boxProps: a ? { sx: { padding: 0, overflow: "hidden" } } : void 0,
830
+ children: /* @__PURE__ */ o(
831
+ rt,
832
+ {
833
+ col: t ? 2 : 1,
834
+ className: a ? X`
835
+ display: flex;
836
+ flex-direction: column;
837
+
838
+ > .base-info,
839
+ > .section__image {
840
+ width: 100%;
841
+
842
+ > img,
843
+ > video {
844
+ width: 100%;
845
+ }
846
+ }
847
+ ` : void 0,
848
+ children: n ? /* @__PURE__ */ w(J, { children: [
849
+ h,
850
+ d
851
+ ] }) : /* @__PURE__ */ w(J, { children: [
852
+ d,
853
+ h
854
+ ] })
855
+ }
856
+ )
857
+ }
858
+ );
859
+ }
860
+ const D = ["editing", "height", "locale", "dev", "sx"];
861
+ function De(t) {
862
+ const { className: e, ...r } = t;
863
+ return /* @__PURE__ */ o(Ve, { ...r, className: b("BlockBase-root", e) });
864
+ }
865
+ const Ve = _(x)`
866
+ position: relative;
867
+ `;
868
+ function Ue({
869
+ widget: t,
870
+ reverse: e,
871
+ projectId: r,
872
+ assistantId: i,
873
+ working: n,
874
+ submitTitle: a,
875
+ submitIcon: c,
876
+ submitColor: s,
877
+ placeholder: l,
878
+ loadingIndicator: d,
879
+ section: m,
880
+ ...p
881
+ }) {
882
+ const [{ editing: h }, u] = $(p, D), [f, y] = $(u, A), g = r && i ? { projectId: r, gitRef: "main", assistantId: i, working: !0 } : void 0, v = {
883
+ children: a,
884
+ endIcon: c ? /* @__PURE__ */ o(Rt, { icon: c }) : void 0,
885
+ sx: {
886
+ background: s || void 0,
887
+ ":hover": {
888
+ background: s || void 0,
889
+ opacity: 0.8
890
+ }
891
+ }
892
+ }, k = [], N = l && /* @__PURE__ */ o(P, { variant: "caption", color: "text.disabled", children: l }), B = d && /* @__PURE__ */ o(P, { variant: "caption", color: "text.disabled", children: d });
893
+ Object.keys(f).length > 0 && Object.values(nt(f, jt)).filter(Boolean).length > 0 && k.push(/* @__PURE__ */ o(F, { ...f }, "base-info")), g && (t === "form" ? k.push(/* @__PURE__ */ o(lt, { identifier: g, SubmitProps: v }, "form")) : t === "result" ? k.push(
894
+ /* @__PURE__ */ o(
895
+ ct,
896
+ {
897
+ identifier: g,
898
+ placeholder: N,
899
+ loadingIndicator: B
900
+ },
901
+ "result"
902
+ )
903
+ ) : k.push(
904
+ /* @__PURE__ */ w(bt, { width: "100%", gap: 2, direction: "row", children: [
905
+ /* @__PURE__ */ o(lt, { identifier: g, BoxProps: { flex: 1 }, SubmitProps: v }),
906
+ /* @__PURE__ */ o(
907
+ ct,
908
+ {
909
+ identifier: g,
910
+ BoxProps: { flex: 1 },
911
+ placeholder: N,
912
+ loadingIndicator: B
913
+ }
914
+ )
915
+ ] }, "form-result")
916
+ )), e && k.reverse();
917
+ const at = At(), Et = R(
918
+ () => Ht(Kt(at, { palette: { primary: s ? { main: s } : void 0 } })),
919
+ [s, at]
920
+ );
921
+ return /* @__PURE__ */ o(qt, { fallbackRender: Xt, children: /* @__PURE__ */ o(Dt, { theme: Et, children: /* @__PURE__ */ o(H, { ...y, sx: h ? { pointerEvents: "none" } : {}, children: /* @__PURE__ */ o(rt, { col: k.length, children: k }) }) }) });
922
+ }
923
+ const zt = wt({
924
+ pages: [],
925
+ project: void 0
926
+ }), { Provider: xn, Consumer: bn } = zt;
927
+ function Tt() {
928
+ return vt(zt);
929
+ }
930
+ function Me({ icon: t, className: e = "", size: r = "1rem", ...i }) {
931
+ return /* @__PURE__ */ o(Je, { component: Rt, className: b("css-icon", e), size: r, ...i, icon: t });
932
+ }
933
+ const Je = _(x)`
934
+ &.css-icon {
935
+ display: inline-block;
936
+ width: ${({ size: t }) => t};
937
+ height: ${({ size: t }) => t};
938
+ }
939
+ `;
940
+ function Ye({ icon: t, className: e = "", size: r = "1rem", imageMeta: i, ...n }) {
941
+ const a = z(S(t), 540), [c, s] = j(!1), l = $t();
942
+ return c ? /* @__PURE__ */ o(Me, { icon: "i-mdi:image", color: l.palette.grey[500], size: r, className: e, ...n }) : /* @__PURE__ */ o(Ge, { className: b("image-icon", e), size: r, ...n, children: /* @__PURE__ */ o(
943
+ "img",
944
+ {
945
+ className: "image-icon__image",
946
+ src: a,
947
+ onError: () => s(!0),
948
+ width: i == null ? void 0 : i.naturalWidth,
949
+ height: i == null ? void 0 : i.naturalHeight,
950
+ alt: (i == null ? void 0 : i.filename) || "card-icon",
951
+ loading: "lazy"
952
+ }
953
+ ) });
954
+ }
955
+ const Ge = _(x)`
956
+ display: inline-block;
957
+ width: ${({ size: t }) => t};
958
+ height: ${({ size: t }) => t};
959
+ .image-icon__image {
960
+ object-fit: contain;
961
+ height: 100%;
962
+ width: 100%;
963
+ }
964
+ `, it = (t) => typeof t == "string" && /^[\w-_]+:[\w-_]+$/.test(t);
965
+ function Z({ icon: t, size: e = "1rem", imageMeta: r, ...i }) {
966
+ const n = window.isNaN(e) ? e : `${e}px`;
967
+ return it(t) ? /* @__PURE__ */ o(Ct, { icon: t }) : /* @__PURE__ */ o(Xe, { component: Ye, imageMeta: r, className: "base-icon", icon: t, size: n, ...i });
968
+ }
969
+ const Xe = _(x)`
970
+ flex-shrink: 0;
971
+ `;
972
+ function L({ text: t, children: e, icon: r = "", endIcon: i, color: n = "primary", link: a = "", href: c = "", ...s }) {
973
+ const l = r ? /* @__PURE__ */ o(Z, { icon: r }) : null, d = i ? /* @__PURE__ */ o(Z, { icon: i }) : null, m = a || c, p = { ...s };
974
+ return m && (p.href = m, q(m) && (p.target = p.target || "_blank")), /* @__PURE__ */ o(ce, { startIcon: l, endIcon: d, color: n, ...p, children: t || e });
975
+ }
976
+ function Lt({ editing: t, text: e, ...r }) {
977
+ const { pages: i = [] } = Tt(), n = i.find((a) => a.id === (r.link || r.linkId));
978
+ if (t)
979
+ return /* @__PURE__ */ o(L, { ...C(r, ["link", "linkId"]), children: e });
980
+ if (n) {
981
+ const a = n.path || "/";
982
+ return /* @__PURE__ */ o(ae, { to: a, children: /* @__PURE__ */ o(L, { ...C(r, ["link", "linkId"]), children: e }) });
983
+ }
984
+ return /* @__PURE__ */ o(L, { ...C(r, "linkId"), children: e });
985
+ }
986
+ function W({ type: t = "", icon: e = "", size: r = "3rem", className: i = "", ...n }) {
987
+ return /* @__PURE__ */ o(Z, { icon: e || t, size: r, className: b("content-icon", i), ...n });
988
+ }
989
+ W.propTypes = {};
990
+ W.defaultProps = {
991
+ type: "",
992
+ icon: "",
993
+ size: "3rem",
994
+ color: "inherit",
995
+ className: ""
996
+ };
997
+ function Ke({
998
+ to: t,
999
+ base: e,
1000
+ children: r,
1001
+ className: i,
1002
+ activeClassName: n = "active",
1003
+ target: a = "auto",
1004
+ autoExternalMark: c = !1,
1005
+ useRouterLink: s,
1006
+ ...l
1007
+ }) {
1008
+ const { pages: d = [], locale: m = "" } = {}, p = e ? M("/", e) : e || "";
1009
+ let h = a === "auto" ? "_self" : a, u = M(p, t);
1010
+ const f = c ? q(u) : !1;
1011
+ if (e)
1012
+ return u = M(p, m, t), /* @__PURE__ */ o(
1013
+ "a",
1014
+ {
1015
+ className: `no-underline ${i}`,
1016
+ href: G(u),
1017
+ rel: "noreferrer noopener",
1018
+ target: h,
1019
+ ...l,
1020
+ children: r
1021
+ }
1022
+ );
1023
+ if (q(t))
1024
+ a === "auto" && (h = "_blank"), u = t;
1025
+ else {
1026
+ de(u) && (u = M(window.location.pathname, u));
1027
+ const y = me(`${window.location.origin}${u}`), g = d.some((v) => v.pathname === y.pathname);
1028
+ if (s || g)
1029
+ return /* @__PURE__ */ o(
1030
+ se,
1031
+ {
1032
+ end: !0,
1033
+ to: G(u),
1034
+ className: ({ isActive: v }) => b(i, v ? n : ""),
1035
+ ...l,
1036
+ children: r
1037
+ }
1038
+ );
1039
+ }
1040
+ return /* @__PURE__ */ w(
1041
+ "a",
1042
+ {
1043
+ className: `no-underline ${i}`,
1044
+ href: G(u),
1045
+ rel: "noreferrer noopener",
1046
+ target: h,
1047
+ ...l,
1048
+ children: [
1049
+ r,
1050
+ f && /* @__PURE__ */ o(W, { icon: "i-mdi:arrow-top-right", size: "0.9em", className: "smart-link__mark", style: { marginLeft: 5 } })
1051
+ ]
1052
+ }
1053
+ );
1054
+ }
1055
+ function V({
1056
+ prepend: t,
1057
+ append: e,
1058
+ children: r,
1059
+ className: i = "",
1060
+ dark: n = !1,
1061
+ border: a = !0,
1062
+ ...c
1063
+ }) {
1064
+ let s = {};
1065
+ const { pages: l = [] } = Tt(), d = l.find((h) => h.id === c.link), m = !r || yt.Children.toArray(r).every((h) => h === null);
1066
+ return c.link && (s = {
1067
+ component: Ke,
1068
+ to: (d == null ? void 0 : d.path) || c.link,
1069
+ useRouterLink: !0
1070
+ }), /* @__PURE__ */ w(
1071
+ qe,
1072
+ {
1073
+ className: b(
1074
+ "base-card card",
1075
+ { "border-gray-200": a },
1076
+ { "dark:border-gray-500": n && a },
1077
+ { dark: n, "border-transparent": !a },
1078
+ i
1079
+ ),
1080
+ ...s,
1081
+ ...C(c, ["listType", "dark", "iconColor", "link", "hoverStyle", "imageSize"]),
1082
+ children: [
1083
+ t,
1084
+ !m && /* @__PURE__ */ o("div", { className: "card__body", children: r }),
1085
+ e
1086
+ ]
1087
+ }
1088
+ );
1089
+ }
1090
+ const qe = _(x)`
1091
+ &.base-card {
1092
+ text-align: left;
1093
+ border-width: 1px;
1094
+ border-style: solid;
1095
+ border-radius: 12px;
1096
+ overflow: hidden;
1097
+ &,
1098
+ &:hover {
1099
+ text-decoration: none;
1100
+ }
1101
+ }
1102
+ .card__body {
1103
+ padding: 15px 15px;
1104
+ }
1105
+ `;
1106
+ function U({
1107
+ align: t = "left",
1108
+ title: e,
1109
+ titleProps: r = {},
1110
+ description: i,
1111
+ descriptionProps: n = {}
1112
+ }) {
1113
+ return /* @__PURE__ */ w(J, { children: [
1114
+ e && /* @__PURE__ */ o(
1115
+ P,
1116
+ {
1117
+ className: b("card__title text-gray-800", "dark:text-gray-50"),
1118
+ component: "h5",
1119
+ variant: "h5",
1120
+ gutterBottom: !0,
1121
+ align: t,
1122
+ ...r,
1123
+ children: e
1124
+ }
1125
+ ),
1126
+ i && /* @__PURE__ */ o(
1127
+ P,
1128
+ {
1129
+ className: b("card__description", "text-gray-500", "dark:text-gray-400"),
1130
+ component: "div",
1131
+ variant: "body1",
1132
+ gutterBottom: !0,
1133
+ align: t,
1134
+ ...n,
1135
+ children: i
1136
+ }
1137
+ )
1138
+ ] });
1139
+ }
1140
+ function Qe({
1141
+ image: t,
1142
+ title: e,
1143
+ description: r,
1144
+ imageProps: i = {},
1145
+ imageMeta: n,
1146
+ imageSize: a,
1147
+ titleProps: c = {},
1148
+ descriptionProps: s = {},
1149
+ actions: l,
1150
+ align: d,
1151
+ ...m
1152
+ }) {
1153
+ const p = it(t), h = z(S(t), 540);
1154
+ return /* @__PURE__ */ w(
1155
+ Ze,
1156
+ {
1157
+ className: "card-article",
1158
+ ...m,
1159
+ prepend: /* @__PURE__ */ o("div", { className: "card__image__wrap", children: p && t ? /* @__PURE__ */ o(
1160
+ x,
1161
+ {
1162
+ sx: {
1163
+ position: "absolute",
1164
+ left: 0,
1165
+ top: 0,
1166
+ right: 0,
1167
+ bottom: 0,
1168
+ display: "flex",
1169
+ alignItems: "center",
1170
+ justifyContent: "center"
1171
+ },
1172
+ children: /* @__PURE__ */ o(W, { icon: t, color: "primary.main" })
1173
+ }
1174
+ ) : h && /* @__PURE__ */ o(
1175
+ "img",
1176
+ {
1177
+ className: "card__image",
1178
+ src: h,
1179
+ ...i,
1180
+ alt: i.alt || (n == null ? void 0 : n.filename) || "card-image",
1181
+ width: n == null ? void 0 : n.naturalWidth,
1182
+ height: n == null ? void 0 : n.naturalHeight,
1183
+ style: { width: "100%", height: "100%", objectFit: a || "cover", objectPosition: "center" },
1184
+ loading: "lazy"
1185
+ }
1186
+ ) }),
1187
+ children: [
1188
+ e || r ? /* @__PURE__ */ o(
1189
+ U,
1190
+ {
1191
+ align: d,
1192
+ title: e,
1193
+ titleProps: c,
1194
+ description: r,
1195
+ descriptionProps: s
1196
+ }
1197
+ ) : null,
1198
+ l != null && l.length ? /* @__PURE__ */ o(T, { align: d, actions: l, className: "mt-4" }) : null
1199
+ ]
1200
+ }
1201
+ );
1202
+ }
1203
+ const Ze = _(V)`
1204
+ ${(t) => t.hoverStyle === "none" ? "" : t.link ? `transition: box-shadow ease .3s;
1205
+ &:hover {
1206
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
1207
+ }` : ""}
1208
+
1209
+ .card__image__wrap {
1210
+ padding-top: 61.8%;
1211
+ width: 100%;
1212
+ position: relative;
1213
+ }
1214
+ .card__image {
1215
+ position: absolute;
1216
+ top: 0;
1217
+ left: 0;
1218
+ bottom: 0;
1219
+ right: 0;
1220
+ width: 100%;
1221
+ height: 100%;
1222
+ object-position: top center;
1223
+ }
1224
+ `, pt = "section";
1225
+ function ut({
1226
+ title: t,
1227
+ image: e,
1228
+ imageMeta: r,
1229
+ description: i,
1230
+ actions: n,
1231
+ align: a,
1232
+ listType: c = "",
1233
+ className: s = "",
1234
+ ...l
1235
+ }) {
1236
+ return /* @__PURE__ */ w(to, { className: b("card", `list-type-${c}`, s), align: a, ...l, children: [
1237
+ e && /* @__PURE__ */ o(
1238
+ W,
1239
+ {
1240
+ icon: e,
1241
+ color: "primary.main",
1242
+ size: c === "icon-title" ? "1.2rem" : "3rem",
1243
+ imageMeta: r
1244
+ }
1245
+ ),
1246
+ t || i ? /* @__PURE__ */ o(U, { align: a, title: t, description: i }) : null,
1247
+ n != null && n.length ? /* @__PURE__ */ o(T, { align: a, actions: n, className: "mt-4" }) : null
1248
+ ] });
1249
+ }
1250
+ const to = _(V)`
1251
+ padding: 5vw 4vw;
1252
+ box-sizing: border-box;
1253
+ /* min-height: 320px; */
1254
+ color: inherit !important;
1255
+ border-radius: 0.5rem;
1256
+ /* ${({ dark: t, theme: e }) => `background-color:${t ? e.palette.grey[900] : e.palette.common.white};`} */
1257
+ @media (max-width: ${({ theme: t }) => t.breakpoints.values[pt]}px) {
1258
+ padding: 1.5rem 2rem;
1259
+ }
1260
+ @media (max-width: ${({ theme: t }) => t.breakpoints.values.sm}px) {
1261
+ height: auto;
1262
+ min-height: unset;
1263
+ }
1264
+
1265
+ ${(t) => t.hoverStyle === "none" ? "" : t.link ? `transition: box-shadow ease .3s;
1266
+ &:hover {
1267
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
1268
+ }` : ""}
1269
+
1270
+ .card__title {
1271
+ font-weight: 700;
1272
+ margin-top: 24px;
1273
+ margin-bottom: 12px;
1274
+ a {
1275
+ color: ${({ theme: t }) => t.palette.primary.main};
1276
+ }
1277
+ }
1278
+ .card__description {
1279
+ a {
1280
+ color: ${({ theme: t }) => t.palette.primary.main};
1281
+ }
1282
+ }
1283
+ .card__body {
1284
+ padding: 0;
1285
+ ${({ align: t }) => `text-align:${t || "left"};`}
1286
+ }
1287
+
1288
+ &.list-type-icon-title {
1289
+ padding: 1.2rem;
1290
+ .title-line {
1291
+ display: flex;
1292
+ }
1293
+ .card__title {
1294
+ margin: 0;
1295
+ font-size: 1em;
1296
+ }
1297
+ .css-icon {
1298
+ margin-right: 0.5rem;
1299
+ }
1300
+ }
1301
+
1302
+ @media (min-width: ${({ theme: t }) => t.breakpoints.values[pt]}px) {
1303
+ padding: 2rem 2rem;
1304
+ text-align: left;
1305
+ box-sizing: border-box;
1306
+ }
1307
+ `;
1308
+ function eo({
1309
+ image: t,
1310
+ title: e,
1311
+ description: r,
1312
+ imageProps: i = {},
1313
+ imageMeta: n,
1314
+ imageSize: a,
1315
+ titleProps: c = {},
1316
+ descriptionProps: s = {},
1317
+ actions: l,
1318
+ align: d,
1319
+ ...m
1320
+ }) {
1321
+ const p = it(t), h = z(S(t), 540);
1322
+ return /* @__PURE__ */ w(
1323
+ oo,
1324
+ {
1325
+ className: "card-article",
1326
+ ...m,
1327
+ prepend: /* @__PURE__ */ o("div", { className: "card__image__wrap", children: p && t ? /* @__PURE__ */ o(
1328
+ x,
1329
+ {
1330
+ sx: {
1331
+ position: "absolute",
1332
+ left: 0,
1333
+ top: 0,
1334
+ right: 0,
1335
+ bottom: 0,
1336
+ display: "flex",
1337
+ alignItems: "center",
1338
+ justifyContent: "center"
1339
+ },
1340
+ children: /* @__PURE__ */ o(W, { icon: t, color: "primary.main" })
1341
+ }
1342
+ ) : h && /* @__PURE__ */ o(
1343
+ x,
1344
+ {
1345
+ component: "img",
1346
+ className: "card__image",
1347
+ src: h,
1348
+ ...i,
1349
+ alt: i.alt || (n == null ? void 0 : n.filename) || "card-image",
1350
+ width: n == null ? void 0 : n.naturalWidth,
1351
+ height: n == null ? void 0 : n.naturalHeight,
1352
+ style: { width: "100%", height: "100%", objectFit: a || "contain", objectPosition: "center" },
1353
+ loading: "lazy"
1354
+ }
1355
+ ) }),
1356
+ children: [
1357
+ e || r ? /* @__PURE__ */ o(
1358
+ U,
1359
+ {
1360
+ align: d,
1361
+ title: e,
1362
+ titleProps: c,
1363
+ description: r,
1364
+ descriptionProps: s
1365
+ }
1366
+ ) : null,
1367
+ l != null && l.length ? /* @__PURE__ */ o(T, { align: d, actions: l, className: "mt-4" }) : null
1368
+ ]
1369
+ }
1370
+ );
1371
+ }
1372
+ const oo = _(V)`
1373
+ ${(t) => t.hoverStyle === "none" ? "" : t.link ? `transition: box-shadow ease .3s;
1374
+ &:hover {
1375
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
1376
+ }` : ""}
1377
+
1378
+ border-radius: 0 !important;
1379
+
1380
+ .card__body {
1381
+ ${({ align: t }) => `text-align:${t || "left"};`}
1382
+ }
1383
+
1384
+ .card__image__wrap {
1385
+ width: 100%;
1386
+ height: 100%;
1387
+ position: relative;
1388
+ display: flex;
1389
+ justify-content: center;
1390
+ align-items: center;
1391
+ }
1392
+
1393
+ .card__image {
1394
+ max-height: 60px;
1395
+ }
1396
+ `, ht = "section";
1397
+ function no({
1398
+ title: t,
1399
+ image: e,
1400
+ imageMeta: r,
1401
+ iconSize: i = 100,
1402
+ description: n,
1403
+ actions: a,
1404
+ align: c,
1405
+ className: s = "",
1406
+ ...l
1407
+ }) {
1408
+ return /* @__PURE__ */ o(ro, { className: b("card", s), ...l, children: /* @__PURE__ */ w(x, { className: "flex items-center", children: [
1409
+ e && /* @__PURE__ */ o(W, { icon: e, color: "primary.main", size: i, imageMeta: r }),
1410
+ /* @__PURE__ */ w(x, { className: "flex-1 ml-4", children: [
1411
+ /* @__PURE__ */ o(U, { align: c, title: t, description: n }),
1412
+ /* @__PURE__ */ o(T, { align: c, actions: a, className: "mt-4" })
1413
+ ] })
1414
+ ] }) });
1415
+ }
1416
+ const ro = _(V)`
1417
+ padding: 5vw 4vw;
1418
+ text-align: left;
1419
+ box-sizing: border-box;
1420
+ /* min-height: 320px; */
1421
+ color: inherit !important;
1422
+ border-radius: 0.5rem;
1423
+ /* ${({ dark: t, theme: e }) => `background-color:${t ? e.palette.grey[900] : e.palette.common.white};`} */
1424
+ @media (max-width: ${({ theme: t }) => t.breakpoints.values[ht]}px) {
1425
+ padding: 1.5rem 2rem;
1426
+ }
1427
+ @media (max-width: ${({ theme: t }) => t.breakpoints.values.sm}px) {
1428
+ height: auto;
1429
+ min-height: unset;
1430
+ }
1431
+
1432
+ ${(t) => t.hoverStyle === "none" ? "" : t.link ? `transition: box-shadow ease .3s;
1433
+ &:hover {
1434
+ box-shadow: 0 0 10px rgba(95, 142, 244, 0.42);
1435
+ }` : ""}
1436
+
1437
+ .card__title {
1438
+ font-weight: 700;
1439
+ margin-bottom: 12px;
1440
+ a {
1441
+ color: ${({ theme: t }) => t.palette.primary.main};
1442
+ }
1443
+ }
1444
+ .card__description {
1445
+ a {
1446
+ color: ${({ theme: t }) => t.palette.primary.main};
1447
+ }
1448
+ }
1449
+ .card__body {
1450
+ padding: 0;
1451
+ }
1452
+
1453
+ &.list-type-icon-title {
1454
+ padding: 1.2rem;
1455
+ .title-line {
1456
+ display: flex;
1457
+ }
1458
+ .card__title {
1459
+ margin: 0;
1460
+ font-size: 1em;
1461
+ }
1462
+ .css-icon {
1463
+ margin-right: 0.5rem;
1464
+ }
1465
+ }
1466
+
1467
+ @media (min-width: ${({ theme: t }) => t.breakpoints.values[ht]}px) {
1468
+ padding: 2rem 2rem;
1469
+ text-align: left;
1470
+ box-sizing: border-box;
1471
+ }
1472
+ `;
1473
+ function io({
1474
+ title: t,
1475
+ titleProps: e = {},
1476
+ description: r,
1477
+ descriptionProps: i = {},
1478
+ image: n,
1479
+ imageMeta: a,
1480
+ className: c = "",
1481
+ align: s,
1482
+ hoverStyle: l,
1483
+ ...d
1484
+ }) {
1485
+ return /* @__PURE__ */ w(ao, { className: b("card-simple", c, `hover-style__${l}`), align: s, ...d, children: [
1486
+ n && /* @__PURE__ */ o(W, { icon: n, color: "primary.main", imageMeta: a }),
1487
+ t || r ? /* @__PURE__ */ o(
1488
+ U,
1489
+ {
1490
+ align: s,
1491
+ title: t,
1492
+ titleProps: e,
1493
+ description: r,
1494
+ descriptionProps: i
1495
+ }
1496
+ ) : null
1497
+ ] });
1498
+ }
1499
+ const ao = _(V)`
1500
+ ${({ dark: t, theme: e }) => `background-color:${t ? e.palette.grey[900] : e.palette.common.white};`}
1501
+
1502
+ &.hover-style__default {
1503
+ &.card-simple {
1504
+ &:hover {
1505
+ border-top-right-radius: 36px;
1506
+ }
1507
+ }
1508
+ .card__body {
1509
+ &:hover {
1510
+ &::before {
1511
+ width: 42px;
1512
+ height: 42px;
1513
+ transform: translate(50%, -50%) rotate(45deg);
1514
+ }
1515
+ &::after {
1516
+ transform: none;
1517
+ }
1518
+ }
1519
+ }
1520
+ }
1521
+
1522
+ &.card-simple {
1523
+ border-radius: 8px;
1524
+ border-top-right-radius: 26px;
1525
+
1526
+ .card__body {
1527
+ ${({ align: t }) => `text-align:${t || "left"};`}
1528
+ }
1529
+
1530
+ ${(t) => t.link ? `
1531
+ cursor: pointer;
1532
+ ` : ""}
1533
+ /* cursor: pointer; */
1534
+ /* &:hover {
1535
+ border-top-right-radius: 36px;
1536
+ } */
1537
+ transition: all 180ms ease 0s;
1538
+ overflow: visible;
1539
+ .card__title {
1540
+ margin: 12px 0;
1541
+ }
1542
+ .card__body {
1543
+ position: relative;
1544
+ padding: 20px 16px 18px;
1545
+ overflow: hidden;
1546
+ transition: all 180ms ease 0s;
1547
+ /* &:hover {
1548
+ &::before {
1549
+ width: 42px;
1550
+ height: 42px;
1551
+ transform: translate(50%, -50%) rotate(45deg);
1552
+ }
1553
+ &::after {
1554
+ transform: none;
1555
+ }
1556
+ } */
1557
+ &::before,
1558
+ &::after {
1559
+ content: ${({ border: t }) => t ? '""' : ""};
1560
+ transition: inherit;
1561
+ position: absolute;
1562
+ top: 0px;
1563
+ right: 0px;
1564
+ }
1565
+ &::before {
1566
+ z-index: 3;
1567
+ background: #fff;
1568
+ width: 30px;
1569
+ height: 30px;
1570
+ transform: translate(50%, -50%) rotate(45deg);
1571
+ box-shadow: 0 1px 0 0 #e9eaec;
1572
+ }
1573
+ &::after {
1574
+ z-index: 2;
1575
+ width: 28px;
1576
+ height: 28px;
1577
+ border-bottom-left-radius: 6px;
1578
+ background: #fcfcfd;
1579
+ box-shadow: -1px 1px 0 0 #e9eaec;
1580
+ transform: translate(8px, -8px);
1581
+ }
1582
+ }
1583
+ }
1584
+ `;
1585
+ function so({ type: t = "default", ...e }) {
1586
+ const i = {
1587
+ article: Qe,
1588
+ simple: io,
1589
+ news: no,
1590
+ default: ut,
1591
+ wall: eo
1592
+ }[t] || ut;
1593
+ return /* @__PURE__ */ o(i, { ...t === "news" ? e : C(e, "iconSize") });
1594
+ }
1595
+ function lo({
1596
+ list: t = [],
1597
+ align: e = "top",
1598
+ cards: r,
1599
+ listBorder: i = !0,
1600
+ listType: n = "",
1601
+ col: a = 3,
1602
+ gap: c,
1603
+ iconColor: s,
1604
+ className: l = "",
1605
+ type: d = "default",
1606
+ dark: m = !1,
1607
+ textAlign: p = "left",
1608
+ hoverStyle: h,
1609
+ ...u
1610
+ }) {
1611
+ return /* @__PURE__ */ o(
1612
+ rt,
1613
+ {
1614
+ type: d,
1615
+ className: b("card-list py-1", l, "items-stretch"),
1616
+ col: a,
1617
+ gap: c,
1618
+ align: e,
1619
+ ...u,
1620
+ children: r || t.map((f) => /* @__PURE__ */ o(
1621
+ so,
1622
+ {
1623
+ borderColor: i,
1624
+ iconColor: s,
1625
+ type: d,
1626
+ listType: n,
1627
+ dark: m,
1628
+ ...f,
1629
+ align: p,
1630
+ sx: {
1631
+ bgcolor: d === "wall" ? void 0 : m ? "grey.900" : "common.white"
1632
+ },
1633
+ style: c === 0 && t.length > 1 ? {
1634
+ borderRadius: 0,
1635
+ marginRight: "-1px",
1636
+ marginBottom: "-1px"
1637
+ } : {}
1638
+ },
1639
+ f.id
1640
+ ))
1641
+ }
1642
+ );
1643
+ }
1644
+ const co = [
1645
+ "align",
1646
+ "cards",
1647
+ "list",
1648
+ "listBorder",
1649
+ "listType",
1650
+ "col",
1651
+ "gap",
1652
+ "iconColor",
1653
+ "type",
1654
+ "textAlign"
1655
+ ], mo = _(H)`
1656
+ a .card {
1657
+ color: #404040;
1658
+ cursor: pointer;
1659
+ }
1660
+ a:not(.MuiButton-root) {
1661
+ color: ${({ theme: t }) => t.palette.primary.main};
1662
+ &:hover,
1663
+ &:active {
1664
+ color: ${({ theme: t }) => t.palette.primary.main};
1665
+ }
1666
+ }
1667
+ a:hover .card {
1668
+ color: #404040;
1669
+ }
1670
+ `;
1671
+ function po({ className: t, ...e }) {
1672
+ const [r, i] = $(e, A), [n, a] = $(i, co);
1673
+ return /* @__PURE__ */ w(mo, { className: b("section--card-list", t), type: e.type, ...a, children: [
1674
+ Object.keys(r).length > 0 && /* @__PURE__ */ o(F, { center: !0, ...r, className: "mb-[2.5vw]" }),
1675
+ /* @__PURE__ */ o(lo, { ...n, dark: !!e.dark })
1676
+ ] });
1677
+ }
1678
+ const uo = _(po)`
1679
+ .card__description {
1680
+ white-space: pre-wrap;
1681
+ }
1682
+ .section__description {
1683
+ }
1684
+ .card {
1685
+ /* background: inherit !important; */
1686
+ }
1687
+ &.dark .card-simple .card__body::before {
1688
+ background: #212121 !important;
1689
+ }
1690
+ .card-simple .card__body::after {
1691
+ background: inherit !important;
1692
+ }
1693
+ `;
1694
+ function ho({ section: t, ...e }) {
1695
+ const [{ editing: r }, i] = $(e, D), n = R(() => {
1696
+ var a;
1697
+ return {
1698
+ ...C(i, ["listBorder", "list", "iconSize", "imageSize"]),
1699
+ list: (a = i.list) == null ? void 0 : a.map((c) => {
1700
+ var s, l;
1701
+ return {
1702
+ ...C(c, "icon", "iconColor"),
1703
+ image: ["news", "simple", "default"].includes(i.type) && c.icon ? c.icon : c.image,
1704
+ actions: (l = (s = c.actions) == null ? void 0 : s.map) == null ? void 0 : l.call(s, (d) => /* @__PURE__ */ o(Lt, { ...d, editing: r }, d.id)),
1705
+ border: i.listBorder,
1706
+ iconSize: i.iconSize,
1707
+ imageSize: i.imageSize,
1708
+ hoverStyle: i.hoverStyle
1709
+ };
1710
+ })
1711
+ };
1712
+ }, [i]);
1713
+ return /* @__PURE__ */ o(uo, { style: r ? { pointerEvents: "none" } : {}, ...n });
1714
+ }
1715
+ function fo({
1716
+ properties: t,
1717
+ section: e,
1718
+ locale: r,
1719
+ dev: i
1720
+ }) {
1721
+ var n;
1722
+ return (n = e == null ? void 0 : e.config) != null && n.componentId ? /* @__PURE__ */ o(
1723
+ oe,
1724
+ {
1725
+ instanceId: e.id,
1726
+ componentId: e.config.componentId,
1727
+ blockletId: e.config.blockletId,
1728
+ blockletTitle: e.config.blockletTitle,
1729
+ componentName: e.config.componentName,
1730
+ locale: r,
1731
+ properties: t,
1732
+ dev: i
1733
+ }
1734
+ ) : /* @__PURE__ */ o(x, { textAlign: "center", py: 2, children: /* @__PURE__ */ o(P, { variant: "caption", color: "text.secondary", children: "Please select component to render" }) });
1735
+ }
1736
+ function go({
1737
+ src: t,
1738
+ dataId: e,
1739
+ isEdit: r = !1,
1740
+ height: i = "100%",
1741
+ onLoad: n = () => {
1742
+ }
1743
+ }) {
1744
+ return /* @__PURE__ */ o(
1745
+ fe,
1746
+ {
1747
+ isEdit: r,
1748
+ embedId: e,
1749
+ src: t,
1750
+ height: i,
1751
+ onLoad: () => {
1752
+ n();
1753
+ }
1754
+ }
1755
+ );
1756
+ }
1757
+ function xo({ dataId: t, src: e, actions: r, center: i, onLoad: n, ...a }) {
1758
+ const [c, s] = $(a, A);
1759
+ return /* @__PURE__ */ w(H, { ...s, children: [
1760
+ Object.keys(c).length > 0 && /* @__PURE__ */ o(F, { center: i, ...c }),
1761
+ /* @__PURE__ */ o(
1762
+ go,
1763
+ {
1764
+ dataId: t,
1765
+ src: e,
1766
+ onLoad: n,
1767
+ height: a.iframeHeight ? `${a.iframeHeight}px` : "100%"
1768
+ }
1769
+ ),
1770
+ /* @__PURE__ */ o(T, { actions: r, center: i })
1771
+ ] });
1772
+ }
1773
+ const yn = {
1774
+ src: "",
1775
+ embedUrl: "",
1776
+ title: "",
1777
+ description: "",
1778
+ dark: !1,
1779
+ background: "",
1780
+ center: !0,
1781
+ config: {},
1782
+ id: ""
1783
+ };
1784
+ function bo({ section: t, id: e, src: r, ...i }) {
1785
+ const n = `${e}-${i.locale}`, [{ editing: a }, c] = $(i, D), s = Y({}), l = JSON.parse(JSON.stringify(c)), { message: d } = pe(n, "server"), m = ue(JSON.parse(JSON.stringify(c.config) || "{}"));
1786
+ return O(() => {
1787
+ d && d.onInit(() => m.current);
1788
+ }, [d]), O(() => {
1789
+ const p = JSON.parse(JSON.stringify(c.config) || "{}");
1790
+ he(s.current, p) || (s.current = p, d == null || d.send("config-set", p));
1791
+ }, [d, c.config]), r ? /* @__PURE__ */ o(xo, { ...l, dataId: n, src: r, style: a ? { pointerEvents: "none" } : {} }) : /* @__PURE__ */ o(yo, { children: 'Please set the "src" attribute for this block' });
1792
+ }
1793
+ const yo = _("div")`
1794
+ user-select: none;
1795
+ color: #999;
1796
+ padding: 8px;
1797
+ height: 200px;
1798
+ `, wo = [
1799
+ /youtu\.be\/([^#&?]{11})/,
1800
+ // youtu.be/<id>
1801
+ /\?v=([^#&?]{11})/,
1802
+ // ?v=<id>
1803
+ /&v=([^#&?]{11})/,
1804
+ // &v=<id>
1805
+ /embed\/([^#&?]{11})/,
1806
+ // embed/<id>
1807
+ /\/v\/([^#&?]{11})/
1808
+ // /v/<id>
1809
+ ];
1810
+ function vo(t) {
1811
+ var e;
1812
+ if (/youtu\.?be/.test(t))
1813
+ for (const r of wo) {
1814
+ const i = (e = r.exec(t)) == null ? void 0 : e[1];
1815
+ if (i)
1816
+ return i;
1817
+ }
1818
+ }
1819
+ function ko(t) {
1820
+ const e = vo(t);
1821
+ if (e)
1822
+ return `https://youtube.com/embed/${e}`;
1823
+ }
1824
+ function _o({ src: t }) {
1825
+ return O(() => {
1826
+ import("@lottiefiles/lottie-player");
1827
+ }, []), /* @__PURE__ */ o("lottie-player", { autoplay: !0, loop: !0, mode: "normal", src: t });
1828
+ }
1829
+ function $o(t) {
1830
+ return /* @__PURE__ */ o(x, { maxHeight: 400, overflow: "hidden auto", children: /* @__PURE__ */ o(ge, { ...t }) });
1831
+ }
1832
+ function No({ url: t }) {
1833
+ const e = Y(null), r = 495, [i, n] = j(
1834
+ e.current ? e.current.offsetWidth * 0.5625 : r
1835
+ ), a = E(() => {
1836
+ 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 : r;
1837
+ return n(Math.floor(s * c));
1838
+ }, []);
1839
+ return O(() => {
1840
+ window.addEventListener("resize", a);
1841
+ 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 : r;
1842
+ return n(Math.floor(s * c)), function() {
1843
+ window.removeEventListener("resize", a);
1844
+ };
1845
+ }, [i, a]), /* @__PURE__ */ o(
1846
+ x,
1847
+ {
1848
+ component: "iframe",
1849
+ ref: e,
1850
+ title: "youtube",
1851
+ width: "100%",
1852
+ height: `${i}px`,
1853
+ src: t,
1854
+ frameBorder: "0",
1855
+ allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",
1856
+ allowFullScreen: !0,
1857
+ sx: { display: "block" }
1858
+ }
1859
+ );
1860
+ }
1861
+ const wn = {
1862
+ image: "https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png",
1863
+ badge: "Develop · Deploy · Run",
1864
+ title: "The Future is Here: Blockchain and Decentralized Application Development",
1865
+ description: "ArcBlock, your exclusive new decentralized development platform, makes developing decentralized applications, blockchain, and distributed ledger technology straightforward.",
1866
+ reverse: !1,
1867
+ dark: !1,
1868
+ background: "",
1869
+ actions: void 0,
1870
+ hasImage: !0,
1871
+ center: !1
1872
+ }, So = _(He)`
1873
+ .section__description {
1874
+ }
1875
+ `;
1876
+ function Co({
1877
+ hasImage: t,
1878
+ fullSizeImage: e,
1879
+ boxed: r,
1880
+ videoPoster: i,
1881
+ imageMeta: n,
1882
+ imageOptimization: a,
1883
+ imageSize: c,
1884
+ section: s,
1885
+ ...l
1886
+ }) {
1887
+ var u, f;
1888
+ const [{ editing: d }, m] = $({ ...l, boxed: e ? void 0 : r }, D);
1889
+ let p = Po(m.image, i, e, n, a, c);
1890
+ t || (p = null);
1891
+ let h = null;
1892
+ return m.actions && (h = (f = (u = m.actions) == null ? void 0 : u.map) == null ? void 0 : f.call(u, (y, g) => /* @__PURE__ */ o(Lt, { ...y, editing: d }, g))), /* @__PURE__ */ o(
1893
+ So,
1894
+ {
1895
+ ...m,
1896
+ style: d ? { pointerEvents: "none" } : {},
1897
+ image: p,
1898
+ fullSizeImage: t && e,
1899
+ actions: h
1900
+ }
1901
+ );
1902
+ }
1903
+ function Po(t, e, r, i, n, a) {
1904
+ if (t) {
1905
+ if (t.endsWith(".json"))
1906
+ return /* @__PURE__ */ o(_o, { src: t });
1907
+ if (t.indexOf("twitter.com") !== -1)
1908
+ return /* @__PURE__ */ o($o, { sourceType: "url", url: t });
1909
+ const c = ko(t);
1910
+ if (c)
1911
+ return /* @__PURE__ */ o(No, { url: c });
1912
+ const { naturalWidth: s, naturalHeight: l, filename: d } = i || {};
1913
+ if (Q(t))
1914
+ return /* @__PURE__ */ o(
1915
+ "video",
1916
+ {
1917
+ width: s && `${s}px`,
1918
+ height: l && `${l}px`,
1919
+ controls: !0,
1920
+ autoPlay: !0,
1921
+ muted: !0,
1922
+ style: {
1923
+ display: "block",
1924
+ objectFit: a || "contain",
1925
+ borderRadius: "8px",
1926
+ width: "100%",
1927
+ height: "100%"
1928
+ },
1929
+ poster: z(S(e), r ? 1200 : 540, n),
1930
+ children: /* @__PURE__ */ o("source", { src: S(t), type: Le(t) })
1931
+ },
1932
+ t
1933
+ );
1934
+ const m = n === "quality" ? 1 : 0.6;
1935
+ return /* @__PURE__ */ o(
1936
+ Nt,
1937
+ {
1938
+ src: S(t),
1939
+ sizesAttr: {
1940
+ sm: 600 * m,
1941
+ md: 450 * m,
1942
+ lg: 540 * m,
1943
+ ...r && {
1944
+ md: 900 * m,
1945
+ lg: 1200 * m
1946
+ }
1947
+ },
1948
+ width: s && `${s}px`,
1949
+ height: l && `${l}px`,
1950
+ alt: d ?? t,
1951
+ style: { objectFit: a || "contain", display: "block", width: "100%", height: "100%" },
1952
+ loading: "lazy"
1953
+ }
1954
+ );
1955
+ }
1956
+ return null;
1957
+ }
1958
+ const vn = ["production", "draft"];
1959
+ function kn({ mode: t, version: e } = {}) {
1960
+ const r = e && typeof e == "number" ? { mode: t, version: e } : { mode: t };
1961
+ return et.get(`/api/${ot()}/pages`, { params: r }).then((i) => i.data);
1962
+ }
1963
+ function _n({ mode: t, pages: e }) {
1964
+ return et.post(`/api/${ot()}/pages/publish`, { mode: t, pages: e }).then((r) => r.data);
1965
+ }
1966
+ function Bo({
1967
+ locale: t,
1968
+ sort: e,
1969
+ page: r,
1970
+ limit: i,
1971
+ mode: n
1972
+ } = {}) {
1973
+ return et.get(`/api/${ot()}/pages/toc`, { params: { locale: t, sort: e, page: r, limit: i, mode: n } }).then((a) => a.data);
1974
+ }
1975
+ const $n = {
1976
+ style: "list",
1977
+ sort: "-updatedAt"
1978
+ }, ft = 20;
1979
+ function Io({ style: t, sort: e, section: r, ...i }) {
1980
+ const [{ editing: n, locale: a }, c] = $(i, D), [s, l] = $(c, A), [d, m] = j(), p = Y(!1), h = xe(), u = le(), f = E(async () => {
1981
+ if (!p.current) {
1982
+ p.current = !0, h();
1983
+ try {
1984
+ const y = d ? Math.floor(d.list.length / ft) + 1 : 1, { list: g, total: v } = await Bo({ locale: a, sort: e, page: y, limit: ft });
1985
+ m((k) => ({
1986
+ list: ((k == null ? void 0 : k.list) ?? []).concat(g),
1987
+ total: v
1988
+ }));
1989
+ } finally {
1990
+ p.current = !1, h();
1991
+ }
1992
+ }
1993
+ }, [d, a, e, h]);
1994
+ return be(() => {
1995
+ f();
1996
+ }), /* @__PURE__ */ w(H, { ...l, sx: n ? { pointerEvents: "none" } : {}, children: [
1997
+ Object.keys(s).length > 0 && /* @__PURE__ */ o(F, { ...s }),
1998
+ d ? /* @__PURE__ */ w(J, { children: [
1999
+ /* @__PURE__ */ o(st, { container: !0, spacing: 2, justifyContent: "center", children: d == null ? void 0 : d.list.map((y) => /* @__PURE__ */ o(st, { item: !0, xs: 12, sm: t === "card" ? 6 : 12, md: t === "card" ? 3 : 12, children: /* @__PURE__ */ w(
2000
+ Wo,
2001
+ {
2002
+ elevation: 0,
2003
+ className: b(t === "card" && "style-card"),
2004
+ onClick: n ? void 0 : () => u(y.slug),
2005
+ children: [
2006
+ !!y.image && /* @__PURE__ */ o(
2007
+ Mt,
2008
+ {
2009
+ component: "img",
2010
+ alt: "",
2011
+ image: z(S(y.image), 540),
2012
+ loading: "lazy"
2013
+ }
2014
+ ),
2015
+ /* @__PURE__ */ w(Jt, { children: [
2016
+ /* @__PURE__ */ o(P, { variant: "h6", component: "div", className: gt, children: y.title || y.id }),
2017
+ /* @__PURE__ */ o(P, { variant: "body2", className: gt, children: y.description })
2018
+ ] })
2019
+ ]
2020
+ }
2021
+ ) }, y.id)) }),
2022
+ /* @__PURE__ */ o(x, { textAlign: "center", mt: 2, children: d.total > d.list.length ? /* @__PURE__ */ o(L, { variant: "outlined", color: "secondary", onClick: f, loading: p.current, children: "More" }) : /* @__PURE__ */ o(L, { variant: "outlined", color: "secondary", disabled: !0, children: "No More" }) })
2023
+ ] }) : /* @__PURE__ */ o(x, { p: 2, textAlign: "center", children: /* @__PURE__ */ o(Ut, { size: 24 }) })
2024
+ ] });
2025
+ }
2026
+ const gt = X`
2027
+ display: -webkit-box;
2028
+ -webkit-box-orient: vertical;
2029
+ -webkit-line-clamp: 2;
2030
+ overflow: hidden;
2031
+ text-overflow: ellipsis;
2032
+ `, Wo = _(Vt)`
2033
+ border: 1px solid #e0e0e0;
2034
+ background-color: transparent;
2035
+ cursor: pointer;
2036
+ display: flex;
2037
+ color: inherit;
2038
+
2039
+ > .MuiCardMedia-root {
2040
+ width: 30vw;
2041
+ max-height: 50vw;
2042
+ }
2043
+
2044
+ &.style-card {
2045
+ display: block;
2046
+
2047
+ > .MuiCardMedia-root {
2048
+ width: 100%;
2049
+ max-height: 50vw;
2050
+ }
2051
+ }
2052
+ `, Ro = {
2053
+ iframe: bo,
2054
+ section: Co,
2055
+ "section-card-list": ho,
2056
+ toc: Io,
2057
+ "ai-runtime": Ue,
2058
+ "custom-component": fo
2059
+ };
2060
+ function Nn({ id: t, type: e, mode: r, config: i, section: n, ...a }) {
2061
+ const c = Ro[e], { getPageMetaStyle: s } = Se(), l = R(() => {
2062
+ const { height: p, ...h } = i;
2063
+ return h;
2064
+ }, [i]), d = R(() => {
2065
+ const p = {};
2066
+ return e !== "custom-component" && (p.height = i.height), p.sx = s("sx"), p;
2067
+ }, [i.height, e, s]), m = c && /* @__PURE__ */ o(c, { mode: r, ...l, id: t, section: n });
2068
+ return /* @__PURE__ */ o(De, { ...a, ...d, children: m });
2069
+ }
2070
+ function Sn(t) {
2071
+ return t != null;
2072
+ }
2073
+ export {
2074
+ Lt as A,
2075
+ Nn as B,
2076
+ Rt as I,
2077
+ xn as P,
2078
+ vn as S,
2079
+ $n as T,
2080
+ gn as a,
2081
+ yn as b,
2082
+ wn as c,
2083
+ kn as g,
2084
+ Sn as n,
2085
+ _n as p
2086
+ };