@chaibuilder/pages 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{B4MFY5CR-DLEJ7tHg.cjs → B4MFY5CR-EcyUHg1m.cjs} +1 -1
- package/dist/{B4MFY5CR-BMe3QoY3.js → B4MFY5CR-MVAv6DcU.js} +1 -1
- package/dist/{HO4MOOFI-DU71XYcI.cjs → HO4MOOFI-BDxIKIu9.cjs} +1 -1
- package/dist/{HO4MOOFI-D3G0RxXP.js → HO4MOOFI-DI8jMuEu.js} +2 -2
- package/dist/{HUY7CZI3-Df1y7-A2.js → HUY7CZI3-AC1qETNb.js} +2 -2
- package/dist/{HUY7CZI3-CYXHYFaO.cjs → HUY7CZI3-Y4pkyP5k.cjs} +1 -1
- package/dist/{index-D8rBoyOf.cjs → index-DYH2MB44.cjs} +2 -2
- package/dist/{index-DNzFepUU.js → index-w504XseG.js} +226 -224
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +1 -1
- package/package.json +3 -3
|
@@ -2,7 +2,7 @@ var vs = (e) => {
|
|
|
2
2
|
throw TypeError(e);
|
|
3
3
|
};
|
|
4
4
|
var Es = (e, t, n) => t.has(e) || vs("Cannot " + n);
|
|
5
|
-
var
|
|
5
|
+
var U = (e, t, n) => (Es(e, t, "read from private field"), n ? n.call(e) : t.get(e)), se = (e, t, n) => t.has(e) ? vs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), J = (e, t, n, s) => (Es(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
|
|
6
6
|
import { jsx as r, jsxs as u, Fragment as Se } from "react/jsx-runtime";
|
|
7
7
|
import { getBlocksFromHTML as va, useLanguages as ct, PERMISSIONS as Ea, useUpdateBlocksPropsRealtime as Bs, usePartailBlocksStore as ba, usePermissions as en, useLibraryBlocks as Sa, useTheme as wa, mergeClasses as Na, useSavePage as Ms, useRightPanel as Aa, useBlocksStore as xa, useTranslation as Ta, useSidebarActivePanel as Ca, registerChaiSidebarPanel as bs, registerChaiTopBar as Pa, registerChaiSaveToLibrary as _a, registerChaiMediaManager as Ia, ChaiBuilderEditor as ka } from "@chaibuilder/sdk";
|
|
8
8
|
import { loadWebBlocks as La } from "@chaibuilder/sdk/web-blocks";
|
|
@@ -92,18 +92,18 @@ function el(e, t, n) {
|
|
|
92
92
|
let s, a, i;
|
|
93
93
|
arguments.length === 1 ? (s = !0, a = e, i = {}) : (s = e, a = t, i = {});
|
|
94
94
|
let l = null, o = Rn, c = null, h = !1, g = "initialValue" in i, d = typeof s == "function" && De(s);
|
|
95
|
-
const S = /* @__PURE__ */ new Set(), [y, p] = (i.storage || ye)(i.initialValue), [w, v] = ye(void 0), [
|
|
95
|
+
const S = /* @__PURE__ */ new Set(), [y, p] = (i.storage || ye)(i.initialValue), [w, v] = ye(void 0), [x, O] = ye(void 0, {
|
|
96
96
|
equals: !1
|
|
97
97
|
}), [E, b] = ye(g ? "ready" : "unresolved");
|
|
98
98
|
R.context && (c = R.getNextContextId(), i.ssrLoadFrom === "initial" ? o = i.initialValue : R.load && R.has(c) && (o = R.load(c)));
|
|
99
|
-
function
|
|
99
|
+
function T(k, q, A, M) {
|
|
100
100
|
return l === k && (l = null, M !== void 0 && (g = !0), (k === o || q === o) && i.onHydrated && queueMicrotask(
|
|
101
101
|
() => i.onHydrated(M, {
|
|
102
102
|
value: q
|
|
103
103
|
})
|
|
104
|
-
), o = Rn,
|
|
104
|
+
), o = Rn, G(q, A)), q;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function G(k, q) {
|
|
107
107
|
We(() => {
|
|
108
108
|
q === void 0 && p(() => k), b(q !== void 0 ? "errored" : g ? "ready" : "unresolved"), v(q);
|
|
109
109
|
for (const A of S.keys())
|
|
@@ -123,7 +123,7 @@ function el(e, t, n) {
|
|
|
123
123
|
h = !1;
|
|
124
124
|
const q = d ? d() : s;
|
|
125
125
|
if (q == null || q === !1) {
|
|
126
|
-
|
|
126
|
+
T(l, xe(y));
|
|
127
127
|
return;
|
|
128
128
|
}
|
|
129
129
|
const A = o !== Rn ? o : xe(
|
|
@@ -132,12 +132,12 @@ function el(e, t, n) {
|
|
|
132
132
|
refetching: k
|
|
133
133
|
})
|
|
134
134
|
);
|
|
135
|
-
return Ji(A) ? (l = A, "value" in A ? (A.status === "success" ?
|
|
135
|
+
return Ji(A) ? (l = A, "value" in A ? (A.status === "success" ? T(l, A.value, void 0, q) : T(l, void 0, qn(A.value), q), A) : (h = !0, queueMicrotask(() => h = !1), We(() => {
|
|
136
136
|
b(g ? "refreshing" : "pending"), O();
|
|
137
137
|
}, !1), A.then(
|
|
138
|
-
(M) =>
|
|
139
|
-
(M) =>
|
|
140
|
-
))) : (
|
|
138
|
+
(M) => T(A, M, void 0, q),
|
|
139
|
+
(M) => T(A, void 0, qn(M), q)
|
|
140
|
+
))) : (T(l, A, void 0, q), A);
|
|
141
141
|
}
|
|
142
142
|
return Object.defineProperties(Z, {
|
|
143
143
|
state: {
|
|
@@ -460,24 +460,24 @@ function ul(e, t, n = {}) {
|
|
|
460
460
|
return Bt(() => Cn(i)), () => {
|
|
461
461
|
let c = e() || [], h = c.length, g, d;
|
|
462
462
|
return c[yr], xe(() => {
|
|
463
|
-
let y, p, w, v,
|
|
463
|
+
let y, p, w, v, x, O, E, b, T;
|
|
464
464
|
if (h === 0)
|
|
465
|
-
l !== 0 && (Cn(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Kn], a[0] = it((
|
|
465
|
+
l !== 0 && (Cn(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Kn], a[0] = it((G) => (i[0] = G, n.fallback())), l = 1);
|
|
466
466
|
else if (l === 0) {
|
|
467
467
|
for (a = new Array(h), d = 0; d < h; d++)
|
|
468
468
|
s[d] = c[d], a[d] = it(S);
|
|
469
469
|
l = h;
|
|
470
470
|
} else {
|
|
471
|
-
for (w = new Array(h), v = new Array(h), o && (
|
|
471
|
+
for (w = new Array(h), v = new Array(h), o && (x = new Array(h)), O = 0, E = Math.min(l, h); O < E && s[O] === c[O]; O++)
|
|
472
472
|
;
|
|
473
473
|
for (E = l - 1, b = h - 1; E >= O && b >= O && s[E] === c[b]; E--, b--)
|
|
474
|
-
w[b] = a[E], v[b] = i[E], o && (
|
|
474
|
+
w[b] = a[E], v[b] = i[E], o && (x[b] = o[E]);
|
|
475
475
|
for (y = /* @__PURE__ */ new Map(), p = new Array(b + 1), d = b; d >= O; d--)
|
|
476
|
-
|
|
476
|
+
T = c[d], g = y.get(T), p[d] = g === void 0 ? -1 : g, y.set(T, d);
|
|
477
477
|
for (g = O; g <= E; g++)
|
|
478
|
-
|
|
478
|
+
T = s[g], d = y.get(T), d !== void 0 && d !== -1 ? (w[d] = a[g], v[d] = i[g], o && (x[d] = o[g]), d = p[d], y.set(T, d)) : i[g]();
|
|
479
479
|
for (d = O; d < h; d++)
|
|
480
|
-
d in w ? (a[d] = w[d], i[d] = v[d], o && (o[d] =
|
|
480
|
+
d in w ? (a[d] = w[d], i[d] = v[d], o && (o[d] = x[d], o[d](d))) : a[d] = it(S);
|
|
481
481
|
a = a.slice(0, l = h), s = c.slice(0);
|
|
482
482
|
}
|
|
483
483
|
return a;
|
|
@@ -1753,8 +1753,8 @@ var jr = (e, t, n, s, a = [], i = [], l = /* @__PURE__ */ new Map()) => {
|
|
|
1753
1753
|
if (p === "__proto__" || p === "constructor" || p === "prototype")
|
|
1754
1754
|
throw new Error(`Detected property ${p}. This is a prototype pollution risk, please remove it from your object.`);
|
|
1755
1755
|
const w = jr(y, t, n, s, [...a, p], [...i, e], l);
|
|
1756
|
-
g[p] = w.transformedValue, nt(w.annotations) ? d[p] = w.annotations : qt(w.annotations) && _t(w.annotations, (v,
|
|
1757
|
-
d[Rr(p) + "." +
|
|
1756
|
+
g[p] = w.transformedValue, nt(w.annotations) ? d[p] = w.annotations : qt(w.annotations) && _t(w.annotations, (v, x) => {
|
|
1757
|
+
d[Rr(p) + "." + x] = v;
|
|
1758
1758
|
});
|
|
1759
1759
|
});
|
|
1760
1760
|
const S = Wn(d) ? {
|
|
@@ -1997,38 +1997,38 @@ var Bu = (e, t = !1) => {
|
|
|
1997
1997
|
J(this, mt, ye(t)), J(this, jt, n), J(this, $t, s), J(this, Vt, a), J(this, zt, h), J(this, ft, g), J(this, gt, ye(i)), J(this, pt, ye(l)), J(this, yt, ye(o)), J(this, vt, ye(c));
|
|
1998
1998
|
}
|
|
1999
1999
|
setButtonPosition(e) {
|
|
2000
|
-
|
|
2000
|
+
U(this, gt)[1](e);
|
|
2001
2001
|
}
|
|
2002
2002
|
setPosition(e) {
|
|
2003
|
-
|
|
2003
|
+
U(this, pt)[1](e);
|
|
2004
2004
|
}
|
|
2005
2005
|
setInitialIsOpen(e) {
|
|
2006
|
-
|
|
2006
|
+
U(this, yt)[1](e);
|
|
2007
2007
|
}
|
|
2008
2008
|
setErrorTypes(e) {
|
|
2009
|
-
|
|
2009
|
+
U(this, vt)[1](e);
|
|
2010
2010
|
}
|
|
2011
2011
|
setClient(e) {
|
|
2012
|
-
|
|
2012
|
+
U(this, mt)[1](e);
|
|
2013
2013
|
}
|
|
2014
2014
|
mount(e) {
|
|
2015
|
-
if (
|
|
2015
|
+
if (U(this, rt))
|
|
2016
2016
|
throw new Error("Devtools is already mounted");
|
|
2017
2017
|
const t = Ir(() => {
|
|
2018
|
-
const n = this, [s] =
|
|
2018
|
+
const n = this, [s] = U(this, gt), [a] = U(this, pt), [i] = U(this, yt), [l] = U(this, vt), [o] = U(this, mt);
|
|
2019
2019
|
let c;
|
|
2020
|
-
return
|
|
2020
|
+
return U(this, Et) ? c = U(this, Et) : (c = Pr(() => import("./HO4MOOFI-DI8jMuEu.js")), J(this, Et, c)), Yr(U(this, zt), U(this, ft)), Tr(c, Cr({
|
|
2021
2021
|
get queryFlavor() {
|
|
2022
|
-
return
|
|
2022
|
+
return U(n, jt);
|
|
2023
2023
|
},
|
|
2024
2024
|
get version() {
|
|
2025
|
-
return
|
|
2025
|
+
return U(n, $t);
|
|
2026
2026
|
},
|
|
2027
2027
|
get onlineManager() {
|
|
2028
|
-
return
|
|
2028
|
+
return U(n, Vt);
|
|
2029
2029
|
},
|
|
2030
2030
|
get shadowDOMTarget() {
|
|
2031
|
-
return
|
|
2031
|
+
return U(n, ft);
|
|
2032
2032
|
}
|
|
2033
2033
|
}, {
|
|
2034
2034
|
get client() {
|
|
@@ -2052,9 +2052,9 @@ var Bu = (e, t = !1) => {
|
|
|
2052
2052
|
}
|
|
2053
2053
|
unmount() {
|
|
2054
2054
|
var e;
|
|
2055
|
-
if (!
|
|
2055
|
+
if (!U(this, rt))
|
|
2056
2056
|
throw new Error("Devtools is not mounted");
|
|
2057
|
-
(e =
|
|
2057
|
+
(e = U(this, Wt)) == null || e.call(this), J(this, rt, !1);
|
|
2058
2058
|
}
|
|
2059
2059
|
}, mt = new WeakMap(), Vt = new WeakMap(), jt = new WeakMap(), $t = new WeakMap(), rt = new WeakMap(), zt = new WeakMap(), ft = new WeakMap(), gt = new WeakMap(), pt = new WeakMap(), yt = new WeakMap(), vt = new WeakMap(), Et = new WeakMap(), Wt = new WeakMap(), Rs), bt, Yt, Qt, Xt, at, Zt, St, wt, Nt, At, xt, Tt, Ct, Jt, Os, bo = (Os = class {
|
|
2060
2060
|
constructor(e) {
|
|
@@ -2088,41 +2088,41 @@ var Bu = (e, t = !1) => {
|
|
|
2088
2088
|
J(this, bt, ye(t)), J(this, Qt, n), J(this, Xt, s), J(this, Yt, a), J(this, Zt, h), J(this, St, g), J(this, wt, ye(i)), J(this, Nt, ye(l)), J(this, At, ye(o)), J(this, xt, ye(c)), J(this, Tt, ye(d));
|
|
2089
2089
|
}
|
|
2090
2090
|
setButtonPosition(e) {
|
|
2091
|
-
|
|
2091
|
+
U(this, wt)[1](e);
|
|
2092
2092
|
}
|
|
2093
2093
|
setPosition(e) {
|
|
2094
|
-
|
|
2094
|
+
U(this, Nt)[1](e);
|
|
2095
2095
|
}
|
|
2096
2096
|
setInitialIsOpen(e) {
|
|
2097
|
-
|
|
2097
|
+
U(this, At)[1](e);
|
|
2098
2098
|
}
|
|
2099
2099
|
setErrorTypes(e) {
|
|
2100
|
-
|
|
2100
|
+
U(this, xt)[1](e);
|
|
2101
2101
|
}
|
|
2102
2102
|
setClient(e) {
|
|
2103
|
-
|
|
2103
|
+
U(this, bt)[1](e);
|
|
2104
2104
|
}
|
|
2105
2105
|
setOnClose(e) {
|
|
2106
|
-
|
|
2106
|
+
U(this, Tt)[1](() => e);
|
|
2107
2107
|
}
|
|
2108
2108
|
mount(e) {
|
|
2109
|
-
if (
|
|
2109
|
+
if (U(this, at))
|
|
2110
2110
|
throw new Error("Devtools is already mounted");
|
|
2111
2111
|
const t = Ir(() => {
|
|
2112
|
-
const n = this, [s] =
|
|
2112
|
+
const n = this, [s] = U(this, wt), [a] = U(this, Nt), [i] = U(this, At), [l] = U(this, xt), [o] = U(this, bt), [c] = U(this, Tt);
|
|
2113
2113
|
let h;
|
|
2114
|
-
return
|
|
2114
|
+
return U(this, Ct) ? h = U(this, Ct) : (h = Pr(() => import("./HUY7CZI3-AC1qETNb.js")), J(this, Ct, h)), Yr(U(this, Zt), U(this, St)), Tr(h, Cr({
|
|
2115
2115
|
get queryFlavor() {
|
|
2116
|
-
return
|
|
2116
|
+
return U(n, Qt);
|
|
2117
2117
|
},
|
|
2118
2118
|
get version() {
|
|
2119
|
-
return
|
|
2119
|
+
return U(n, Xt);
|
|
2120
2120
|
},
|
|
2121
2121
|
get onlineManager() {
|
|
2122
|
-
return
|
|
2122
|
+
return U(n, Yt);
|
|
2123
2123
|
},
|
|
2124
2124
|
get shadowDOMTarget() {
|
|
2125
|
-
return
|
|
2125
|
+
return U(n, St);
|
|
2126
2126
|
}
|
|
2127
2127
|
}, {
|
|
2128
2128
|
get client() {
|
|
@@ -2149,9 +2149,9 @@ var Bu = (e, t = !1) => {
|
|
|
2149
2149
|
}
|
|
2150
2150
|
unmount() {
|
|
2151
2151
|
var e;
|
|
2152
|
-
if (!
|
|
2152
|
+
if (!U(this, at))
|
|
2153
2153
|
throw new Error("Devtools is not mounted");
|
|
2154
|
-
(e =
|
|
2154
|
+
(e = U(this, Jt)) == null || e.call(this), J(this, at, !1);
|
|
2155
2155
|
}
|
|
2156
2156
|
}, bt = new WeakMap(), Yt = new WeakMap(), Qt = new WeakMap(), Xt = new WeakMap(), at = new WeakMap(), Zt = new WeakMap(), St = new WeakMap(), wt = new WeakMap(), Nt = new WeakMap(), At = new WeakMap(), xt = new WeakMap(), Tt = new WeakMap(), Ct = new WeakMap(), Jt = new WeakMap(), Os);
|
|
2157
2157
|
function So(e) {
|
|
@@ -3393,14 +3393,14 @@ const Mo = () => {
|
|
|
3393
3393
|
(N) => N._type === "PartialBlock" || N._type === "GlobalBlock"
|
|
3394
3394
|
), [t]), h = Q(() => {
|
|
3395
3395
|
let N = [];
|
|
3396
|
-
for (const
|
|
3397
|
-
if (
|
|
3398
|
-
const
|
|
3399
|
-
qa(
|
|
3396
|
+
for (const C of t)
|
|
3397
|
+
if (C._type === "PartialBlock" || C._type === "GlobalBlock") {
|
|
3398
|
+
const D = a(C.partialBlockId);
|
|
3399
|
+
qa(D, "0._parent", C._parent), N = [...N, ...D];
|
|
3400
3400
|
} else
|
|
3401
|
-
N.push(
|
|
3402
|
-
return N
|
|
3403
|
-
}, [t, a]), [g, d] = I(""), [S, y] = I(""), [p, w] = I(""), [v,
|
|
3401
|
+
N.push(C);
|
|
3402
|
+
return N;
|
|
3403
|
+
}, [t, a]), [g, d] = I(""), [S, y] = I(""), [p, w] = I(""), [v, x] = I(""), [O, E] = I({}), [b, T] = I(!1), [G, Z] = I(o), [ie, k] = I(!1), { hasPermission: q } = en(), A = q(ue.DELETE_LIBRARY_BLOCK), M = Bs(), ne = () => {
|
|
3404
3404
|
M([s], { _libBlockId: void 0 }), j.success("Block delinked from library"), n();
|
|
3405
3405
|
}, {
|
|
3406
3406
|
data: he,
|
|
@@ -3410,10 +3410,10 @@ const Mo = () => {
|
|
|
3410
3410
|
be(() => {
|
|
3411
3411
|
de && o && (k(!0), Z(!1));
|
|
3412
3412
|
}, [de, o]), be(() => {
|
|
3413
|
-
he && !W && (d(he.name || ""), y(he.group || ""), w(he.description || ""),
|
|
3413
|
+
he && !W && (d(he.name || ""), y(he.group || ""), w(he.description || ""), x(he.preview || ""), Z(!1));
|
|
3414
3414
|
}, [he, W]), be(() => {
|
|
3415
|
-
const N = g.trim().length >= 2,
|
|
3416
|
-
|
|
3415
|
+
const N = g.trim().length >= 2, C = S.trim() !== "";
|
|
3416
|
+
T(N && C && !c);
|
|
3417
3417
|
}, [g, S, c]);
|
|
3418
3418
|
const F = () => {
|
|
3419
3419
|
const N = {};
|
|
@@ -3423,10 +3423,12 @@ const Mo = () => {
|
|
|
3423
3423
|
o || M([s], { _libBlockId: N.id }), j.success(`Block ${o ? "updated" : "saved"} successfully`), ve(N.library), n();
|
|
3424
3424
|
}
|
|
3425
3425
|
), f = async (N) => {
|
|
3426
|
-
N.preventDefault(), F()
|
|
3426
|
+
if (N.preventDefault(), !F()) return;
|
|
3427
|
+
const C = h.map((D) => (tn(D, "_libBlockId") && delete D._libBlockId, D));
|
|
3428
|
+
Qe.mutate({
|
|
3427
3429
|
name: g.trim(),
|
|
3428
3430
|
group: S,
|
|
3429
|
-
blocks:
|
|
3431
|
+
blocks: C,
|
|
3430
3432
|
description: p.trim(),
|
|
3431
3433
|
// Only include previewImage if it exists and is a base64 image
|
|
3432
3434
|
...v && v.startsWith("data:") ? { previewImage: v } : {},
|
|
@@ -3434,7 +3436,7 @@ const Mo = () => {
|
|
|
3434
3436
|
...o ? { id: l } : {}
|
|
3435
3437
|
});
|
|
3436
3438
|
}, m = Qe.isPending;
|
|
3437
|
-
return
|
|
3439
|
+
return G || W ? /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-8", children: /* @__PURE__ */ r("div", { className: "h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent" }) }) : ie ? /* @__PURE__ */ u("div", { className: "p-6 space-y-4", children: [
|
|
3438
3440
|
/* @__PURE__ */ r("div", { className: "text-destructive font-medium", children: "Block Not Found" }),
|
|
3439
3441
|
/* @__PURE__ */ r("p", { className: "text-sm text-muted-foreground", children: "This block could not be found on the server. It may have been deleted." }),
|
|
3440
3442
|
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-4", children: [
|
|
@@ -3498,7 +3500,7 @@ const Mo = () => {
|
|
|
3498
3500
|
] }),
|
|
3499
3501
|
/* @__PURE__ */ u("div", { className: "space-y-2", children: [
|
|
3500
3502
|
/* @__PURE__ */ r(te, { htmlFor: "previewImage", children: "Preview Image (optional)" }),
|
|
3501
|
-
/* @__PURE__ */ r(Yo, { value: v, onChange:
|
|
3503
|
+
/* @__PURE__ */ r(Yo, { value: v, onChange: x }),
|
|
3502
3504
|
/* @__PURE__ */ r("p", { className: "text-xs text-muted-foreground", children: "max 1mb" })
|
|
3503
3505
|
] }),
|
|
3504
3506
|
/* @__PURE__ */ u("div", { className: "flex justify-end gap-2 pt-2", children: [
|
|
@@ -3783,22 +3785,22 @@ var hs = {};
|
|
|
3783
3785
|
return N;
|
|
3784
3786
|
if (m.has(N))
|
|
3785
3787
|
return m.get(N);
|
|
3786
|
-
var
|
|
3787
|
-
return
|
|
3788
|
+
var C = new OffscreenCanvas(N.width, N.height), D = C.getContext("2d");
|
|
3789
|
+
return D.drawImage(N, 0, 0), m.set(N, C), C;
|
|
3788
3790
|
},
|
|
3789
3791
|
clear: function() {
|
|
3790
3792
|
m.clear();
|
|
3791
3793
|
}
|
|
3792
3794
|
};
|
|
3793
3795
|
}(o, /* @__PURE__ */ new Map()), d = function() {
|
|
3794
|
-
var f = Math.floor(16.666666666666668), m, N,
|
|
3796
|
+
var f = Math.floor(16.666666666666668), m, N, C = {}, D = 0;
|
|
3795
3797
|
return typeof requestAnimationFrame == "function" && typeof cancelAnimationFrame == "function" ? (m = function(H) {
|
|
3796
3798
|
var K = Math.random();
|
|
3797
|
-
return
|
|
3798
|
-
|
|
3799
|
+
return C[K] = requestAnimationFrame(function L(V) {
|
|
3800
|
+
D === V || D + f - 1 < V ? (D = V, delete C[K], H()) : C[K] = requestAnimationFrame(L);
|
|
3799
3801
|
}), K;
|
|
3800
3802
|
}, N = function(H) {
|
|
3801
|
-
|
|
3803
|
+
C[H] && cancelAnimationFrame(C[H]);
|
|
3802
3804
|
}) : (m = function(H) {
|
|
3803
3805
|
return setTimeout(H, f);
|
|
3804
3806
|
}, N = function(H) {
|
|
@@ -3806,25 +3808,25 @@ var hs = {};
|
|
|
3806
3808
|
}), { frame: m, cancel: N };
|
|
3807
3809
|
}(), S = /* @__PURE__ */ function() {
|
|
3808
3810
|
var f, m, N = {};
|
|
3809
|
-
function
|
|
3811
|
+
function C(D) {
|
|
3810
3812
|
function H(K, L) {
|
|
3811
|
-
|
|
3813
|
+
D.postMessage({ options: K || {}, callback: L });
|
|
3812
3814
|
}
|
|
3813
|
-
|
|
3815
|
+
D.init = function(L) {
|
|
3814
3816
|
var V = L.transferControlToOffscreen();
|
|
3815
|
-
|
|
3816
|
-
},
|
|
3817
|
+
D.postMessage({ canvas: V }, [V]);
|
|
3818
|
+
}, D.fire = function(L, V, le) {
|
|
3817
3819
|
if (m)
|
|
3818
3820
|
return H(L, null), m;
|
|
3819
3821
|
var ge = Math.random().toString(36).slice(2);
|
|
3820
3822
|
return m = h(function(oe) {
|
|
3821
3823
|
function pe(Ne) {
|
|
3822
|
-
Ne.data.callback === ge && (delete N[ge],
|
|
3824
|
+
Ne.data.callback === ge && (delete N[ge], D.removeEventListener("message", pe), m = null, g.clear(), le(), oe());
|
|
3823
3825
|
}
|
|
3824
|
-
|
|
3826
|
+
D.addEventListener("message", pe), H(L, ge), N[ge] = pe.bind(null, { data: { callback: ge } });
|
|
3825
3827
|
}), m;
|
|
3826
|
-
},
|
|
3827
|
-
|
|
3828
|
+
}, D.reset = function() {
|
|
3829
|
+
D.postMessage({ reset: !0 });
|
|
3828
3830
|
for (var L in N)
|
|
3829
3831
|
N[L](), delete N[L];
|
|
3830
3832
|
};
|
|
@@ -3833,7 +3835,7 @@ var hs = {};
|
|
|
3833
3835
|
if (f)
|
|
3834
3836
|
return f;
|
|
3835
3837
|
if (!s && i) {
|
|
3836
|
-
var
|
|
3838
|
+
var D = [
|
|
3837
3839
|
"var CONFETTI, SIZE = {}, module = {};",
|
|
3838
3840
|
"(" + e.toString() + ")(this, module, true, SIZE);",
|
|
3839
3841
|
"onmessage = function(msg) {",
|
|
@@ -3857,11 +3859,11 @@ var hs = {};
|
|
|
3857
3859
|
].join(`
|
|
3858
3860
|
`);
|
|
3859
3861
|
try {
|
|
3860
|
-
f = new Worker(URL.createObjectURL(new Blob([
|
|
3862
|
+
f = new Worker(URL.createObjectURL(new Blob([D])));
|
|
3861
3863
|
} catch (H) {
|
|
3862
3864
|
return typeof console !== void 0 && typeof console.warn == "function" && console.warn("🎊 Could not load worker", H), null;
|
|
3863
3865
|
}
|
|
3864
|
-
|
|
3866
|
+
C(f);
|
|
3865
3867
|
}
|
|
3866
3868
|
return f;
|
|
3867
3869
|
};
|
|
@@ -3903,7 +3905,7 @@ var hs = {};
|
|
|
3903
3905
|
N
|
|
3904
3906
|
);
|
|
3905
3907
|
}
|
|
3906
|
-
function
|
|
3908
|
+
function x(f) {
|
|
3907
3909
|
return f < 0 ? 0 : Math.floor(f);
|
|
3908
3910
|
}
|
|
3909
3911
|
function O(f, m) {
|
|
@@ -3913,9 +3915,9 @@ var hs = {};
|
|
|
3913
3915
|
return parseInt(f, 16);
|
|
3914
3916
|
}
|
|
3915
3917
|
function b(f) {
|
|
3916
|
-
return f.map(
|
|
3918
|
+
return f.map(T);
|
|
3917
3919
|
}
|
|
3918
|
-
function
|
|
3920
|
+
function T(f) {
|
|
3919
3921
|
var m = String(f).replace(/[^0-9a-f]/gi, "");
|
|
3920
3922
|
return m.length < 6 && (m = m[0] + m[0] + m[1] + m[1] + m[2] + m[2]), {
|
|
3921
3923
|
r: E(m.substring(0, 2)),
|
|
@@ -3923,7 +3925,7 @@ var hs = {};
|
|
|
3923
3925
|
b: E(m.substring(4, 6))
|
|
3924
3926
|
};
|
|
3925
3927
|
}
|
|
3926
|
-
function
|
|
3928
|
+
function G(f) {
|
|
3927
3929
|
var m = v(f, "origin", Object);
|
|
3928
3930
|
return m.x = v(m, "x", Number), m.y = v(m, "y", Number), m;
|
|
3929
3931
|
}
|
|
@@ -3938,8 +3940,8 @@ var hs = {};
|
|
|
3938
3940
|
var m = document.createElement("canvas");
|
|
3939
3941
|
return m.style.position = "fixed", m.style.top = "0px", m.style.left = "0px", m.style.pointerEvents = "none", m.style.zIndex = f, m;
|
|
3940
3942
|
}
|
|
3941
|
-
function q(f, m, N,
|
|
3942
|
-
f.save(), f.translate(m, N), f.rotate(H), f.scale(
|
|
3943
|
+
function q(f, m, N, C, D, H, K, L, V) {
|
|
3944
|
+
f.save(), f.translate(m, N), f.rotate(H), f.scale(C, D), f.arc(0, 0, 1, K, L, V), f.restore();
|
|
3943
3945
|
}
|
|
3944
3946
|
function A(f) {
|
|
3945
3947
|
var m = f.angle * (Math.PI / 180), N = f.spread * (Math.PI / 180);
|
|
@@ -3970,19 +3972,19 @@ var hs = {};
|
|
|
3970
3972
|
}
|
|
3971
3973
|
function M(f, m) {
|
|
3972
3974
|
m.x += Math.cos(m.angle2D) * m.velocity + m.drift, m.y += Math.sin(m.angle2D) * m.velocity + m.gravity, m.velocity *= m.decay, m.flat ? (m.wobble = 0, m.wobbleX = m.x + 10 * m.scalar, m.wobbleY = m.y + 10 * m.scalar, m.tiltSin = 0, m.tiltCos = 0, m.random = 1) : (m.wobble += m.wobbleSpeed, m.wobbleX = m.x + 10 * m.scalar * Math.cos(m.wobble), m.wobbleY = m.y + 10 * m.scalar * Math.sin(m.wobble), m.tiltAngle += 0.1, m.tiltSin = Math.sin(m.tiltAngle), m.tiltCos = Math.cos(m.tiltAngle), m.random = Math.random() + 2);
|
|
3973
|
-
var N = m.tick++ / m.totalTicks,
|
|
3975
|
+
var N = m.tick++ / m.totalTicks, C = m.x + m.random * m.tiltCos, D = m.y + m.random * m.tiltSin, H = m.wobbleX + m.random * m.tiltCos, K = m.wobbleY + m.random * m.tiltSin;
|
|
3974
3976
|
if (f.fillStyle = "rgba(" + m.color.r + ", " + m.color.g + ", " + m.color.b + ", " + (1 - N) + ")", f.beginPath(), l && m.shape.type === "path" && typeof m.shape.path == "string" && Array.isArray(m.shape.matrix))
|
|
3975
3977
|
f.fill(F(
|
|
3976
3978
|
m.shape.path,
|
|
3977
3979
|
m.shape.matrix,
|
|
3978
3980
|
m.x,
|
|
3979
3981
|
m.y,
|
|
3980
|
-
Math.abs(H -
|
|
3981
|
-
Math.abs(K -
|
|
3982
|
+
Math.abs(H - C) * 0.1,
|
|
3983
|
+
Math.abs(K - D) * 0.1,
|
|
3982
3984
|
Math.PI / 10 * m.wobble
|
|
3983
3985
|
));
|
|
3984
3986
|
else if (m.shape.type === "bitmap") {
|
|
3985
|
-
var L = Math.PI / 10 * m.wobble, V = Math.abs(H -
|
|
3987
|
+
var L = Math.PI / 10 * m.wobble, V = Math.abs(H - C) * 0.1, le = Math.abs(K - D) * 0.1, ge = m.shape.bitmap.width * m.scalar, oe = m.shape.bitmap.height * m.scalar, pe = new DOMMatrix([
|
|
3986
3988
|
Math.cos(L) * V,
|
|
3987
3989
|
Math.sin(L) * V,
|
|
3988
3990
|
-Math.sin(L) * le,
|
|
@@ -3999,21 +4001,21 @@ var hs = {};
|
|
|
3999
4001
|
oe
|
|
4000
4002
|
), f.globalAlpha = 1;
|
|
4001
4003
|
} else if (m.shape === "circle")
|
|
4002
|
-
f.ellipse ? f.ellipse(m.x, m.y, Math.abs(H -
|
|
4004
|
+
f.ellipse ? f.ellipse(m.x, m.y, Math.abs(H - C) * m.ovalScalar, Math.abs(K - D) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI) : q(f, m.x, m.y, Math.abs(H - C) * m.ovalScalar, Math.abs(K - D) * m.ovalScalar, Math.PI / 10 * m.wobble, 0, 2 * Math.PI);
|
|
4003
4005
|
else if (m.shape === "star")
|
|
4004
4006
|
for (var Y = Math.PI / 2 * 3, ke = 4 * m.scalar, Oe = 8 * m.scalar, Be = m.x, Xe = m.y, st = 5, $e = Math.PI / st; st--; )
|
|
4005
4007
|
Be = m.x + Math.cos(Y) * Oe, Xe = m.y + Math.sin(Y) * Oe, f.lineTo(Be, Xe), Y += $e, Be = m.x + Math.cos(Y) * ke, Xe = m.y + Math.sin(Y) * ke, f.lineTo(Be, Xe), Y += $e;
|
|
4006
4008
|
else
|
|
4007
|
-
f.moveTo(Math.floor(m.x), Math.floor(m.y)), f.lineTo(Math.floor(m.wobbleX), Math.floor(
|
|
4009
|
+
f.moveTo(Math.floor(m.x), Math.floor(m.y)), f.lineTo(Math.floor(m.wobbleX), Math.floor(D)), f.lineTo(Math.floor(H), Math.floor(K)), f.lineTo(Math.floor(C), Math.floor(m.wobbleY));
|
|
4008
4010
|
return f.closePath(), f.fill(), m.tick < m.totalTicks;
|
|
4009
4011
|
}
|
|
4010
|
-
function ne(f, m, N,
|
|
4012
|
+
function ne(f, m, N, C, D) {
|
|
4011
4013
|
var H = m.slice(), K = f.getContext("2d"), L, V, le = h(function(ge) {
|
|
4012
4014
|
function oe() {
|
|
4013
|
-
L = V = null, K.clearRect(0, 0,
|
|
4015
|
+
L = V = null, K.clearRect(0, 0, C.width, C.height), g.clear(), D(), ge();
|
|
4014
4016
|
}
|
|
4015
4017
|
function pe() {
|
|
4016
|
-
s && !(
|
|
4018
|
+
s && !(C.width === a.width && C.height === a.height) && (C.width = f.width = a.width, C.height = f.height = a.height), !C.width && !C.height && (N(f), C.width = f.width, C.height = f.height), K.clearRect(0, 0, C.width, C.height), H = H.filter(function(Ne) {
|
|
4017
4019
|
return M(K, Ne);
|
|
4018
4020
|
}), H.length ? L = d.frame(pe) : oe();
|
|
4019
4021
|
}
|
|
@@ -4031,9 +4033,9 @@ var hs = {};
|
|
|
4031
4033
|
};
|
|
4032
4034
|
}
|
|
4033
4035
|
function he(f, m) {
|
|
4034
|
-
var N = !f,
|
|
4036
|
+
var N = !f, C = !!v(m || {}, "resize"), D = !1, H = v(m, "disableForReducedMotion", Boolean), K = i && !!v(m || {}, "useWorker"), L = K ? S() : null, V = N ? Z : ie, le = f && L ? !!f.__confetti_initialized : !1, ge = typeof matchMedia == "function" && matchMedia("(prefers-reduced-motion)").matches, oe;
|
|
4035
4037
|
function pe(Y, ke, Oe) {
|
|
4036
|
-
for (var Be = v(Y, "particleCount",
|
|
4038
|
+
for (var Be = v(Y, "particleCount", x), Xe = v(Y, "angle", Number), st = v(Y, "spread", Number), $e = v(Y, "startVelocity", Number), ua = v(Y, "decay", Number), da = v(Y, "gravity", Number), ha = v(Y, "drift", Number), fs = v(Y, "colors", b), ma = v(Y, "ticks", Number), gs = v(Y, "shapes"), fa = v(Y, "scalar"), ga = !!v(Y, "flat"), ps = G(Y), ys = Be, Gn = [], pa = f.width * ps.x, ya = f.height * ps.y; ys--; )
|
|
4037
4039
|
Gn.push(
|
|
4038
4040
|
A({
|
|
4039
4041
|
x: pa,
|
|
@@ -4059,7 +4061,7 @@ var hs = {};
|
|
|
4059
4061
|
return h(function($e) {
|
|
4060
4062
|
$e();
|
|
4061
4063
|
});
|
|
4062
|
-
N && oe ? f = oe.canvas : N && !f && (f = k(Oe), document.body.appendChild(f)),
|
|
4064
|
+
N && oe ? f = oe.canvas : N && !f && (f = k(Oe), document.body.appendChild(f)), C && !le && V(f);
|
|
4063
4065
|
var Be = {
|
|
4064
4066
|
width: f.width,
|
|
4065
4067
|
height: f.height
|
|
@@ -4084,9 +4086,9 @@ var hs = {};
|
|
|
4084
4086
|
Be.width = Be.height = null;
|
|
4085
4087
|
}
|
|
4086
4088
|
function st() {
|
|
4087
|
-
oe = null,
|
|
4089
|
+
oe = null, C && (D = !1, t.removeEventListener("resize", Xe)), N && f && (document.body.contains(f) && document.body.removeChild(f), f = null, le = !1);
|
|
4088
4090
|
}
|
|
4089
|
-
return
|
|
4091
|
+
return C && !D && (D = !0, t.addEventListener("resize", Xe, !1)), L ? L.fire(Y, Be, st) : pe(Y, Be, st);
|
|
4090
4092
|
}
|
|
4091
4093
|
return Ne.reset = function() {
|
|
4092
4094
|
L && L.reset(), oe && oe.reset();
|
|
@@ -4096,17 +4098,17 @@ var hs = {};
|
|
|
4096
4098
|
function de() {
|
|
4097
4099
|
return W || (W = he(null, { useWorker: !0, resize: !0 })), W;
|
|
4098
4100
|
}
|
|
4099
|
-
function F(f, m, N,
|
|
4101
|
+
function F(f, m, N, C, D, H, K) {
|
|
4100
4102
|
var L = new Path2D(f), V = new Path2D();
|
|
4101
4103
|
V.addPath(L, new DOMMatrix(m));
|
|
4102
4104
|
var le = new Path2D();
|
|
4103
4105
|
return le.addPath(V, new DOMMatrix([
|
|
4104
|
-
Math.cos(K) *
|
|
4105
|
-
Math.sin(K) *
|
|
4106
|
+
Math.cos(K) * D,
|
|
4107
|
+
Math.sin(K) * D,
|
|
4106
4108
|
-Math.sin(K) * H,
|
|
4107
4109
|
Math.cos(K) * H,
|
|
4108
4110
|
N,
|
|
4109
|
-
|
|
4111
|
+
C
|
|
4110
4112
|
])), le;
|
|
4111
4113
|
}
|
|
4112
4114
|
function ve(f) {
|
|
@@ -4114,11 +4116,11 @@ var hs = {};
|
|
|
4114
4116
|
throw new Error("path confetti are not supported in this browser");
|
|
4115
4117
|
var m, N;
|
|
4116
4118
|
typeof f == "string" ? m = f : (m = f.path, N = f.matrix);
|
|
4117
|
-
var
|
|
4119
|
+
var C = new Path2D(m), D = document.createElement("canvas"), H = D.getContext("2d");
|
|
4118
4120
|
if (!N) {
|
|
4119
4121
|
for (var K = 1e3, L = K, V = K, le = 0, ge = 0, oe, pe, Ne = 0; Ne < K; Ne += 2)
|
|
4120
4122
|
for (var Y = 0; Y < K; Y += 2)
|
|
4121
|
-
H.isPointInPath(
|
|
4123
|
+
H.isPointInPath(C, Ne, Y, "nonzero") && (L = Math.min(L, Ne), V = Math.min(V, Y), le = Math.max(le, Ne), ge = Math.max(ge, Y));
|
|
4122
4124
|
oe = le - L, pe = ge - V;
|
|
4123
4125
|
var ke = 10, Oe = Math.min(ke / oe, ke / pe);
|
|
4124
4126
|
N = [
|
|
@@ -4137,12 +4139,12 @@ var hs = {};
|
|
|
4137
4139
|
};
|
|
4138
4140
|
}
|
|
4139
4141
|
function Qe(f) {
|
|
4140
|
-
var m, N = 1,
|
|
4141
|
-
typeof f == "string" ? m = f : (m = f.text, N = "scalar" in f ? f.scalar : N,
|
|
4142
|
-
var H = 10 * N, K = "" + H + "px " +
|
|
4142
|
+
var m, N = 1, C = "#000000", D = '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';
|
|
4143
|
+
typeof f == "string" ? m = f : (m = f.text, N = "scalar" in f ? f.scalar : N, D = "fontFamily" in f ? f.fontFamily : D, C = "color" in f ? f.color : C);
|
|
4144
|
+
var H = 10 * N, K = "" + H + "px " + D, L = new OffscreenCanvas(H, H), V = L.getContext("2d");
|
|
4143
4145
|
V.font = K;
|
|
4144
4146
|
var le = V.measureText(m), ge = Math.ceil(le.actualBoundingBoxRight + le.actualBoundingBoxLeft), oe = Math.ceil(le.actualBoundingBoxAscent + le.actualBoundingBoxDescent), pe = 2, Ne = le.actualBoundingBoxLeft + pe, Y = le.actualBoundingBoxAscent + pe;
|
|
4145
|
-
ge += pe + pe, oe += pe + pe, L = new OffscreenCanvas(ge, oe), V = L.getContext("2d"), V.font = K, V.fillStyle =
|
|
4147
|
+
ge += pe + pe, oe += pe + pe, L = new OffscreenCanvas(ge, oe), V = L.getContext("2d"), V.font = K, V.fillStyle = C, V.fillText(m, Ne, Y);
|
|
4146
4148
|
var ke = 1 / N;
|
|
4147
4149
|
return {
|
|
4148
4150
|
type: "bitmap",
|
|
@@ -4383,7 +4385,7 @@ const Re = ({
|
|
|
4383
4385
|
(E) => E.key === e.pageType
|
|
4384
4386
|
),
|
|
4385
4387
|
[a, e.pageType]
|
|
4386
|
-
), v = !(w != null && w.hasSlug),
|
|
4388
|
+
), v = !(w != null && w.hasSlug), x = S || p, O = (E) => {
|
|
4387
4389
|
E.preventDefault();
|
|
4388
4390
|
const b = {
|
|
4389
4391
|
name: i,
|
|
@@ -4463,8 +4465,8 @@ const Re = ({
|
|
|
4463
4465
|
_,
|
|
4464
4466
|
{
|
|
4465
4467
|
type: "submit",
|
|
4466
|
-
disabled:
|
|
4467
|
-
children:
|
|
4468
|
+
disabled: x || !i || !o || !v && !Gt(h, `/${o}`),
|
|
4469
|
+
children: x ? e.edit ? B.UPDATING : B.ADDING : e.edit ? B.UPDATE : B.ADD_NEW_LANGUAGE
|
|
4468
4470
|
}
|
|
4469
4471
|
) })
|
|
4470
4472
|
] })
|
|
@@ -4480,13 +4482,13 @@ const Re = ({
|
|
|
4480
4482
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
4481
4483
|
/* @__PURE__ */ r("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
4482
4484
|
] }) : Me(i, (v) => {
|
|
4483
|
-
const
|
|
4485
|
+
const x = v.lang, O = v.slug, E = !v.primaryPage;
|
|
4484
4486
|
return /* @__PURE__ */ u(Se, { children: [
|
|
4485
4487
|
/* @__PURE__ */ u(
|
|
4486
4488
|
"li",
|
|
4487
4489
|
{
|
|
4488
|
-
className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${
|
|
4489
|
-
onClick: () => a(
|
|
4490
|
+
className: `text-slate-500 w-full p-2 rounded cursor-pointer flex items-center justify-between ${x === n ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
4491
|
+
onClick: () => a(x),
|
|
4490
4492
|
children: [
|
|
4491
4493
|
/* @__PURE__ */ u("div", { className: " flex-1 gap-x-3", children: [
|
|
4492
4494
|
/* @__PURE__ */ u(
|
|
@@ -4500,7 +4502,7 @@ const Re = ({
|
|
|
4500
4502
|
className: `w-2.5 h-2.5 rounded-full ${v.online ? "bg-green-300" : "bg-gray-300"}`
|
|
4501
4503
|
}
|
|
4502
4504
|
),
|
|
4503
|
-
ee(Fe, E ? s :
|
|
4505
|
+
ee(Fe, E ? s : x, x)
|
|
4504
4506
|
]
|
|
4505
4507
|
}
|
|
4506
4508
|
),
|
|
@@ -4535,7 +4537,7 @@ const Re = ({
|
|
|
4535
4537
|
rn,
|
|
4536
4538
|
{
|
|
4537
4539
|
asChild: !0,
|
|
4538
|
-
onClick: (
|
|
4540
|
+
onClick: (T) => T.stopPropagation(),
|
|
4539
4541
|
children: /* @__PURE__ */ r(
|
|
4540
4542
|
_,
|
|
4541
4543
|
{
|
|
@@ -4561,8 +4563,8 @@ const Re = ({
|
|
|
4561
4563
|
Le,
|
|
4562
4564
|
{
|
|
4563
4565
|
className: "flex items-center gap-2 cursor-pointer",
|
|
4564
|
-
onClick: (
|
|
4565
|
-
|
|
4566
|
+
onClick: (T) => {
|
|
4567
|
+
T.stopPropagation(), t({ ...v, edit: !0 });
|
|
4566
4568
|
},
|
|
4567
4569
|
children: [
|
|
4568
4570
|
/* @__PURE__ */ r(Xa, { className: "size-3" }),
|
|
@@ -4580,8 +4582,8 @@ const Re = ({
|
|
|
4580
4582
|
Le,
|
|
4581
4583
|
{
|
|
4582
4584
|
className: "flex items-center gap-2 cursor-pointer",
|
|
4583
|
-
onClick: (
|
|
4584
|
-
|
|
4585
|
+
onClick: (T) => {
|
|
4586
|
+
T.stopPropagation(), d(v);
|
|
4585
4587
|
},
|
|
4586
4588
|
children: [
|
|
4587
4589
|
/* @__PURE__ */ r(Xs, { className: "size-3" }),
|
|
@@ -4599,8 +4601,8 @@ const Re = ({
|
|
|
4599
4601
|
Le,
|
|
4600
4602
|
{
|
|
4601
4603
|
className: "flex items-center gap-2 cursor-pointer",
|
|
4602
|
-
onClick: (
|
|
4603
|
-
|
|
4604
|
+
onClick: (T) => {
|
|
4605
|
+
T.stopPropagation(), h(v);
|
|
4604
4606
|
},
|
|
4605
4607
|
children: [
|
|
4606
4608
|
/* @__PURE__ */ r(Za, { className: "size-3" }),
|
|
@@ -4801,28 +4803,28 @@ function fc({
|
|
|
4801
4803
|
)
|
|
4802
4804
|
), [w, v] = I(
|
|
4803
4805
|
(e == null ? void 0 : e.parent) ?? ""
|
|
4804
|
-
), [
|
|
4806
|
+
), [x, O] = I((e == null ? void 0 : e.name) ?? ""), [E, b] = I(
|
|
4805
4807
|
((e == null ? void 0 : e.slug) ?? "").split("/").pop() || ""
|
|
4806
|
-
), [
|
|
4808
|
+
), [T, G] = I(
|
|
4807
4809
|
(e == null ? void 0 : e.dynamic) ?? !1
|
|
4808
4810
|
), [Z, ie] = I(""), { data: k, isLoading: q } = dc(d), A = l || c, M = t.find(
|
|
4809
4811
|
(f) => f.key === d
|
|
4810
4812
|
), ne = (f) => {
|
|
4811
|
-
S(f), v(""), b(""),
|
|
4813
|
+
S(f), v(""), b(""), G(!1), ie(""), p(
|
|
4812
4814
|
t.find(
|
|
4813
4815
|
(m) => m.key === f
|
|
4814
4816
|
)
|
|
4815
4817
|
);
|
|
4816
4818
|
}, he = (f) => {
|
|
4817
|
-
|
|
4819
|
+
G(f), f && b("");
|
|
4818
4820
|
}, W = (f) => {
|
|
4819
4821
|
if (v(f), f && f !== "none") {
|
|
4820
4822
|
const m = a == null ? void 0 : a.find(
|
|
4821
|
-
(
|
|
4823
|
+
(C) => C.id === f
|
|
4822
4824
|
), N = (m == null ? void 0 : m.slug) || "";
|
|
4823
4825
|
if (E.startsWith(N)) {
|
|
4824
|
-
const
|
|
4825
|
-
b(
|
|
4826
|
+
const C = E.slice(N.length).replace(/^\/+/, "");
|
|
4827
|
+
b(C);
|
|
4826
4828
|
} else
|
|
4827
4829
|
b(E.replace(/^\/+/, ""));
|
|
4828
4830
|
} else
|
|
@@ -4830,28 +4832,28 @@ function fc({
|
|
|
4830
4832
|
}, de = (f) => {
|
|
4831
4833
|
ie(f);
|
|
4832
4834
|
}, F = (f) => {
|
|
4833
|
-
if (f.preventDefault(), E.length > 0 && !
|
|
4835
|
+
if (f.preventDefault(), E.length > 0 && !T && !E.match(/^[a-zA-Z0-9-_]+$/)) {
|
|
4834
4836
|
g("Slug can only contain letters, numbers, and hyphens");
|
|
4835
4837
|
return;
|
|
4836
4838
|
}
|
|
4837
|
-
if (
|
|
4839
|
+
if (T && E !== "") {
|
|
4838
4840
|
g("Slug must be empty when using dynamic slug");
|
|
4839
4841
|
return;
|
|
4840
4842
|
}
|
|
4841
|
-
if (!
|
|
4843
|
+
if (!x.trim()) {
|
|
4842
4844
|
j.error("Name is required");
|
|
4843
4845
|
return;
|
|
4844
4846
|
}
|
|
4845
4847
|
if (!(y != null && y.hasSlug)) {
|
|
4846
4848
|
const m = {
|
|
4847
4849
|
pageType: y == null ? void 0 : y.key,
|
|
4848
|
-
name:
|
|
4850
|
+
name: x,
|
|
4849
4851
|
slug: "",
|
|
4850
4852
|
hasSlug: !1
|
|
4851
4853
|
};
|
|
4852
4854
|
if (s) {
|
|
4853
4855
|
o(
|
|
4854
|
-
{ id: e == null ? void 0 : e.id, name:
|
|
4856
|
+
{ id: e == null ? void 0 : e.id, name: x },
|
|
4855
4857
|
{
|
|
4856
4858
|
onSuccess: () => {
|
|
4857
4859
|
j.success((y == null ? void 0 : y.name) + " updated successfully"), n();
|
|
@@ -4868,24 +4870,24 @@ function fc({
|
|
|
4868
4870
|
return;
|
|
4869
4871
|
}
|
|
4870
4872
|
if (w && w !== "none") {
|
|
4871
|
-
if (!E.trim() && !
|
|
4873
|
+
if (!E.trim() && !T) {
|
|
4872
4874
|
j.error("Child page slug is required");
|
|
4873
4875
|
return;
|
|
4874
4876
|
}
|
|
4875
4877
|
const m = a == null ? void 0 : a.find(
|
|
4876
4878
|
(L) => L.id === w
|
|
4877
|
-
), N = (m == null ? void 0 : m.slug) || "",
|
|
4878
|
-
if (Object.keys(Fe).some((L) =>
|
|
4879
|
+
), N = (m == null ? void 0 : m.slug) || "", C = N === "/" ? `/${E}` : `${N}/${E}`;
|
|
4880
|
+
if (Object.keys(Fe).some((L) => C === `/${L}` || (C == null ? void 0 : C.startsWith(`/${L}/`)))) {
|
|
4879
4881
|
j.error("Slugs cannot start with a language code for primary page");
|
|
4880
4882
|
return;
|
|
4881
4883
|
}
|
|
4882
4884
|
const K = {
|
|
4883
4885
|
pageType: d,
|
|
4884
|
-
name:
|
|
4885
|
-
slug:
|
|
4886
|
+
name: x,
|
|
4887
|
+
slug: C.replace(/\/$/, ""),
|
|
4886
4888
|
// remove trailing slashes
|
|
4887
4889
|
parent: w,
|
|
4888
|
-
dynamic:
|
|
4890
|
+
dynamic: T,
|
|
4889
4891
|
hasSlug: !0,
|
|
4890
4892
|
templateId: Z || void 0
|
|
4891
4893
|
};
|
|
@@ -4908,7 +4910,7 @@ function fc({
|
|
|
4908
4910
|
} else {
|
|
4909
4911
|
const m = {
|
|
4910
4912
|
pageType: d,
|
|
4911
|
-
name:
|
|
4913
|
+
name: x,
|
|
4912
4914
|
slug: E === "" ? "/" : `/${E.replace(/\/$/, "")}`,
|
|
4913
4915
|
template: Z || void 0
|
|
4914
4916
|
};
|
|
@@ -4974,7 +4976,7 @@ function fc({
|
|
|
4974
4976
|
Ee,
|
|
4975
4977
|
{
|
|
4976
4978
|
id: "name",
|
|
4977
|
-
value:
|
|
4979
|
+
value: x,
|
|
4978
4980
|
onChange: (f) => O(f.target.value),
|
|
4979
4981
|
required: !0,
|
|
4980
4982
|
"aria-required": "true"
|
|
@@ -4988,19 +4990,19 @@ function fc({
|
|
|
4988
4990
|
{
|
|
4989
4991
|
type: "checkbox",
|
|
4990
4992
|
id: "useDynamicSlug",
|
|
4991
|
-
checked:
|
|
4993
|
+
checked: T,
|
|
4992
4994
|
onChange: (f) => he(f.target.checked),
|
|
4993
4995
|
className: "rounded border-gray-300"
|
|
4994
4996
|
}
|
|
4995
4997
|
),
|
|
4996
4998
|
/* @__PURE__ */ r(te, { htmlFor: "useDynamicSlug", className: "text-sm", children: "Use Dynamic Slug" })
|
|
4997
4999
|
] }),
|
|
4998
|
-
|
|
5000
|
+
T && /* @__PURE__ */ u("div", { className: "text-sm text-gray-500", children: [
|
|
4999
5001
|
"Pages will use pattern: ",
|
|
5000
5002
|
M == null ? void 0 : M.dynamicSlug
|
|
5001
5003
|
] })
|
|
5002
5004
|
] }),
|
|
5003
|
-
(!(M != null && M.dynamicSegments) || !
|
|
5005
|
+
(!(M != null && M.dynamicSegments) || !T) && /* @__PURE__ */ u("div", { className: "space-y-0.5", children: [
|
|
5004
5006
|
/* @__PURE__ */ u(te, { htmlFor: "slug", className: "text-sm", children: [
|
|
5005
5007
|
"Slug",
|
|
5006
5008
|
w && w !== "none" && /* @__PURE__ */ u("span", { className: "ml-2 text-sm text-gray-500", children: [
|
|
@@ -5051,7 +5053,7 @@ function fc({
|
|
|
5051
5053
|
Ee,
|
|
5052
5054
|
{
|
|
5053
5055
|
id: "name",
|
|
5054
|
-
value:
|
|
5056
|
+
value: x,
|
|
5055
5057
|
onChange: (f) => O(f.target.value),
|
|
5056
5058
|
required: !0,
|
|
5057
5059
|
"aria-required": "true"
|
|
@@ -5093,8 +5095,8 @@ const gc = ({
|
|
|
5093
5095
|
(E) => E.key === e.pageType
|
|
5094
5096
|
), p = (y == null ? void 0 : y.name) || Pt(e.pageType), w = _e(
|
|
5095
5097
|
(E) => {
|
|
5096
|
-
var
|
|
5097
|
-
const b = (
|
|
5098
|
+
var T;
|
|
5099
|
+
const b = (T = E.target.files) == null ? void 0 : T[0];
|
|
5098
5100
|
if (b) {
|
|
5099
5101
|
if (b.size > pc) {
|
|
5100
5102
|
j.error("File too large", {
|
|
@@ -5104,13 +5106,13 @@ const gc = ({
|
|
|
5104
5106
|
}
|
|
5105
5107
|
try {
|
|
5106
5108
|
h(!0);
|
|
5107
|
-
const
|
|
5108
|
-
|
|
5109
|
-
o(
|
|
5110
|
-
},
|
|
5111
|
-
} catch (
|
|
5112
|
-
console.error("Error reading file:",
|
|
5113
|
-
description:
|
|
5109
|
+
const G = new FileReader();
|
|
5110
|
+
G.onloadend = () => {
|
|
5111
|
+
o(G.result), h(!1);
|
|
5112
|
+
}, G.readAsDataURL(b);
|
|
5113
|
+
} catch (G) {
|
|
5114
|
+
console.error("Error reading file:", G), h(!1), j.error("Failed to process image", {
|
|
5115
|
+
description: G instanceof Error ? G.message : "Unknown error"
|
|
5114
5116
|
});
|
|
5115
5117
|
}
|
|
5116
5118
|
}
|
|
@@ -5118,7 +5120,7 @@ const gc = ({
|
|
|
5118
5120
|
[]
|
|
5119
5121
|
), v = () => {
|
|
5120
5122
|
o(""), g.current && (g.current.value = "");
|
|
5121
|
-
},
|
|
5123
|
+
}, x = () => {
|
|
5122
5124
|
var E;
|
|
5123
5125
|
(E = g.current) == null || E.click();
|
|
5124
5126
|
}, O = () => {
|
|
@@ -5195,7 +5197,7 @@ const gc = ({
|
|
|
5195
5197
|
{
|
|
5196
5198
|
type: "button",
|
|
5197
5199
|
variant: "outline",
|
|
5198
|
-
onClick:
|
|
5200
|
+
onClick: x,
|
|
5199
5201
|
disabled: c,
|
|
5200
5202
|
className: "w-full",
|
|
5201
5203
|
children: c ? /* @__PURE__ */ u("span", { className: "flex items-center gap-2", children: [
|
|
@@ -5431,20 +5433,20 @@ const gc = ({
|
|
|
5431
5433
|
}
|
|
5432
5434
|
);
|
|
5433
5435
|
}, Ec = ({ close: e }) => {
|
|
5434
|
-
const [, t] = I([]), [n, s] = I(""), [a, i] = I(null), [l, o] = I(null), [c, h] = I(null), [g, d] = I(null), [S, y] = I(null), { data: p, isFetching: w } = Dn(), [v,
|
|
5436
|
+
const [, t] = I([]), [n, s] = I(""), [a, i] = I(null), [l, o] = I(null), [c, h] = I(null), [g, d] = I(null), [S, y] = I(null), { data: p, isFetching: w } = Dn(), [v, x] = I(""), { hasPermission: O } = en(), [E, b] = Ge(), T = E.get("page"), { data: G } = Ie(), Z = _e(
|
|
5435
5437
|
(A) => {
|
|
5436
5438
|
var M;
|
|
5437
|
-
return (M = fe(
|
|
5439
|
+
return (M = fe(G, { key: A })) == null ? void 0 : M.hasSlug;
|
|
5438
5440
|
},
|
|
5439
|
-
[
|
|
5441
|
+
[G]
|
|
5440
5442
|
);
|
|
5441
5443
|
be(() => {
|
|
5442
5444
|
if (!me(v)) return;
|
|
5443
5445
|
const A = sessionStorage.getItem("pageTypeFilter") || "all";
|
|
5444
|
-
!me(
|
|
5445
|
-
}, [
|
|
5446
|
+
!me(G) && A && (fe(G, { key: A }) ? x(A) : x("all"));
|
|
5447
|
+
}, [G, v]);
|
|
5446
5448
|
const ie = (A) => {
|
|
5447
|
-
|
|
5449
|
+
x(A), sessionStorage.setItem("pageTypeFilter", A);
|
|
5448
5450
|
}, k = _e(
|
|
5449
5451
|
(A) => {
|
|
5450
5452
|
const ne = new URLSearchParams(window.location.search).get("lang"), he = new URLSearchParams({ page: A });
|
|
@@ -5453,11 +5455,11 @@ const gc = ({
|
|
|
5453
5455
|
[b, e]
|
|
5454
5456
|
);
|
|
5455
5457
|
be(() => {
|
|
5456
|
-
if (
|
|
5457
|
-
const A = fe(p, { id:
|
|
5458
|
+
if (T && !w) {
|
|
5459
|
+
const A = fe(p, { id: T });
|
|
5458
5460
|
A && (A != null && A.pageType) ? t((M) => [...M, A == null ? void 0 : A.pageType]) : (window.history.replaceState(null, "", "/"), b(new URLSearchParams({})), window.dispatchEvent(new PopStateEvent("popstate")));
|
|
5459
5461
|
}
|
|
5460
|
-
}, [p,
|
|
5462
|
+
}, [p, T, w, b]);
|
|
5461
5463
|
const q = Q(() => {
|
|
5462
5464
|
const A = Ae(p, (F) => me(n) ? !0 : Ot(kt(F == null ? void 0 : F.name), kt(n)) || Ot(kt(F == null ? void 0 : F.slug), kt(n)));
|
|
5463
5465
|
if (v !== "all")
|
|
@@ -5513,7 +5515,7 @@ const gc = ({
|
|
|
5513
5515
|
}
|
|
5514
5516
|
),
|
|
5515
5517
|
/* @__PURE__ */ r(Ri, { align: "end", children: Me(
|
|
5516
|
-
js([{ key: "all", name: "All" }],
|
|
5518
|
+
js([{ key: "all", name: "All" }], G),
|
|
5517
5519
|
(A) => /* @__PURE__ */ r(Oi, { value: ee(A, "key"), children: ee(A, "name") })
|
|
5518
5520
|
) })
|
|
5519
5521
|
] })
|
|
@@ -5537,7 +5539,7 @@ const gc = ({
|
|
|
5537
5539
|
setAddEditPage: h,
|
|
5538
5540
|
setMarkAsTemplate: d,
|
|
5539
5541
|
setUnmarkAsTemplate: y,
|
|
5540
|
-
active:
|
|
5542
|
+
active: T === A.id,
|
|
5541
5543
|
page: A
|
|
5542
5544
|
},
|
|
5543
5545
|
A.id
|
|
@@ -5551,12 +5553,12 @@ const gc = ({
|
|
|
5551
5553
|
setAddEditPage: h,
|
|
5552
5554
|
setMarkAsTemplate: d,
|
|
5553
5555
|
setUnmarkAsTemplate: y,
|
|
5554
|
-
active:
|
|
5556
|
+
active: T === A.id,
|
|
5555
5557
|
page: A
|
|
5556
5558
|
}
|
|
5557
5559
|
),
|
|
5558
5560
|
/* @__PURE__ */ r("div", { className: "pt-2 pl-6 bg-white", children: Me(ee(A, "children", []), (M) => {
|
|
5559
|
-
const ne =
|
|
5561
|
+
const ne = T === ee(M, "id");
|
|
5560
5562
|
return /* @__PURE__ */ r(
|
|
5561
5563
|
Fn,
|
|
5562
5564
|
{
|
|
@@ -5699,8 +5701,8 @@ const gc = ({
|
|
|
5699
5701
|
s(p);
|
|
5700
5702
|
const w = new URLSearchParams(window.location.search);
|
|
5701
5703
|
p === e ? w.delete("lang") : w.set("lang", p);
|
|
5702
|
-
const v = w.toString(),
|
|
5703
|
-
window.history.pushState({}, "",
|
|
5704
|
+
const v = w.toString(), x = `${window.location.pathname}${v ? `?${v}` : ""}`;
|
|
5705
|
+
window.history.pushState({}, "", x), i(w), window.dispatchEvent(new PopStateEvent("popstate"));
|
|
5704
5706
|
};
|
|
5705
5707
|
return me(t) || d ? null : /* @__PURE__ */ u(Se, { children: [
|
|
5706
5708
|
/* @__PURE__ */ u(sn, { children: [
|
|
@@ -5857,20 +5859,20 @@ function Pc() {
|
|
|
5857
5859
|
isFetching: g,
|
|
5858
5860
|
error: d,
|
|
5859
5861
|
refetch: S
|
|
5860
|
-
} = Ac(c == null ? void 0 : c.id), { mutate: y, isPending: p } = xc(), { mutate: w, isPending: v } = Tc(),
|
|
5862
|
+
} = Ac(c == null ? void 0 : c.id), { mutate: y, isPending: p } = xc(), { mutate: w, isPending: v } = Tc(), x = we(), O = (G) => {
|
|
5861
5863
|
n && w(
|
|
5862
|
-
{ revisionId: n.uid, discardCurrent:
|
|
5864
|
+
{ revisionId: n.uid, discardCurrent: G },
|
|
5863
5865
|
{
|
|
5864
5866
|
onSuccess: () => {
|
|
5865
|
-
i(!1), s(null),
|
|
5867
|
+
i(!1), s(null), x.invalidateQueries({ queryKey: [P.GET_PAGE] });
|
|
5866
5868
|
}
|
|
5867
5869
|
}
|
|
5868
5870
|
);
|
|
5869
|
-
}, E = (
|
|
5870
|
-
s(
|
|
5871
|
-
}, b = (
|
|
5872
|
-
s(
|
|
5873
|
-
},
|
|
5871
|
+
}, E = (G) => {
|
|
5872
|
+
s(G), i(!0);
|
|
5873
|
+
}, b = (G) => {
|
|
5874
|
+
s(G), o(!0);
|
|
5875
|
+
}, T = () => {
|
|
5874
5876
|
n && y(n.uid, {
|
|
5875
5877
|
onSuccess: () => {
|
|
5876
5878
|
o(!1), s(null);
|
|
@@ -5906,15 +5908,15 @@ function Pc() {
|
|
|
5906
5908
|
] }),
|
|
5907
5909
|
/* @__PURE__ */ r(Fi, { className: "h-[calc(100vh-6rem)] pr-2", children: g ? /* @__PURE__ */ r(_c, {}) : d ? /* @__PURE__ */ r("div", { className: "p-4 text-center text-sm text-muted-foreground", children: "Failed to load revisions. Please try again." }) : /* @__PURE__ */ u("div", { className: "mt-2 space-y-2", children: [
|
|
5908
5910
|
/* @__PURE__ */ r(Cc, {}),
|
|
5909
|
-
h == null ? void 0 : h.map((
|
|
5911
|
+
h == null ? void 0 : h.map((G) => /* @__PURE__ */ r(
|
|
5910
5912
|
Ic,
|
|
5911
5913
|
{
|
|
5912
|
-
revision:
|
|
5913
|
-
isLatest:
|
|
5914
|
-
onRestore: () => E(
|
|
5915
|
-
onDelete: () => b(
|
|
5914
|
+
revision: G,
|
|
5915
|
+
isLatest: G.uid === "current",
|
|
5916
|
+
onRestore: () => E(G),
|
|
5917
|
+
onDelete: () => b(G)
|
|
5916
5918
|
},
|
|
5917
|
-
|
|
5919
|
+
G.uid
|
|
5918
5920
|
))
|
|
5919
5921
|
] }) })
|
|
5920
5922
|
] })
|
|
@@ -5937,7 +5939,7 @@ function Pc() {
|
|
|
5937
5939
|
open: l,
|
|
5938
5940
|
onOpenChange: o,
|
|
5939
5941
|
revision: n,
|
|
5940
|
-
onDelete:
|
|
5942
|
+
onDelete: T,
|
|
5941
5943
|
isDeleting: p
|
|
5942
5944
|
}
|
|
5943
5945
|
)
|
|
@@ -6180,8 +6182,8 @@ function Rc({
|
|
|
6180
6182
|
}) {
|
|
6181
6183
|
const [n, s] = I([]), { data: a, isFetching: i } = Gc(), { data: l } = Ie(), o = _e(
|
|
6182
6184
|
(b) => {
|
|
6183
|
-
var
|
|
6184
|
-
return (
|
|
6185
|
+
var T;
|
|
6186
|
+
return (T = fe(l, { key: b })) == null ? void 0 : T.hasSlug;
|
|
6185
6187
|
},
|
|
6186
6188
|
[l]
|
|
6187
6189
|
), c = Q(
|
|
@@ -6205,11 +6207,11 @@ function Rc({
|
|
|
6205
6207
|
}, [a, d]);
|
|
6206
6208
|
const p = n.length === (a == null ? void 0 : a.length), w = (b) => {
|
|
6207
6209
|
s(
|
|
6208
|
-
(
|
|
6210
|
+
(T) => Ot(T, b) ? Ae(T, (G) => G !== b) : js(T, b)
|
|
6209
6211
|
);
|
|
6210
6212
|
}, v = () => {
|
|
6211
6213
|
s(p ? [] : Me(a, "id"));
|
|
6212
|
-
},
|
|
6214
|
+
}, x = () => {
|
|
6213
6215
|
S(
|
|
6214
6216
|
{ ids: ja(n) },
|
|
6215
6217
|
{
|
|
@@ -6220,19 +6222,19 @@ function Rc({
|
|
|
6220
6222
|
);
|
|
6221
6223
|
}, O = (b) => {
|
|
6222
6224
|
if (b === "theme") return "Theme";
|
|
6223
|
-
const
|
|
6224
|
-
return
|
|
6225
|
+
const T = fe(l, { key: b });
|
|
6226
|
+
return T ? T == null ? void 0 : T.name : b;
|
|
6225
6227
|
}, E = Q(() => {
|
|
6226
6228
|
const b = [
|
|
6227
6229
|
{ label: "Updated", top: "pt-2" },
|
|
6228
6230
|
...dn(Ae(h, { online: !0 }), "pageType"),
|
|
6229
6231
|
...dn(Ae(g, { online: !0 }), "pageType")
|
|
6230
|
-
].filter((Z) => Z.pageType !== "theme"),
|
|
6232
|
+
].filter((Z) => Z.pageType !== "theme"), T = [
|
|
6231
6233
|
{ label: "Offline", top: "pt-6" },
|
|
6232
6234
|
...dn(Ae(h, { online: !1 }), "pageType"),
|
|
6233
6235
|
...dn(Ae(g, { online: !1 }), "pageType")
|
|
6234
|
-
],
|
|
6235
|
-
return [...b, ...
|
|
6236
|
+
], G = d ? [{ label: "Theme", top: "pt-6" }, d] : [];
|
|
6237
|
+
return [...b, ...G, ...T];
|
|
6236
6238
|
}, [h, g, d]);
|
|
6237
6239
|
return /* @__PURE__ */ r(He, { open: e, onOpenChange: y ? () => {
|
|
6238
6240
|
} : t, children: /* @__PURE__ */ u(Ke, { className: "max-w-4xl max-h-[80%] flex flex-col", children: [
|
|
@@ -6299,8 +6301,8 @@ function Rc({
|
|
|
6299
6301
|
"input",
|
|
6300
6302
|
{
|
|
6301
6303
|
checked: Ot(n, b == null ? void 0 : b.id),
|
|
6302
|
-
onClick: (
|
|
6303
|
-
|
|
6304
|
+
onClick: (T) => {
|
|
6305
|
+
T.stopPropagation(), w(b == null ? void 0 : b.id);
|
|
6304
6306
|
},
|
|
6305
6307
|
type: "checkbox",
|
|
6306
6308
|
className: "rounded cursor-pointer focus:outline-none focus:ring-0"
|
|
@@ -6345,7 +6347,7 @@ function Rc({
|
|
|
6345
6347
|
_,
|
|
6346
6348
|
{
|
|
6347
6349
|
disabled: y || i || me(a),
|
|
6348
|
-
onClick:
|
|
6350
|
+
onClick: x,
|
|
6349
6351
|
children: y ? "Publishing..." : "Publish"
|
|
6350
6352
|
}
|
|
6351
6353
|
)
|
|
@@ -6497,7 +6499,7 @@ const Mc = () => {
|
|
|
6497
6499
|
size: "sm",
|
|
6498
6500
|
onClick: async () => {
|
|
6499
6501
|
var w, v;
|
|
6500
|
-
const p = ((v = (w = h == null ? void 0 : h.filter((
|
|
6502
|
+
const p = ((v = (w = h == null ? void 0 : h.filter((x) => (x == null ? void 0 : x._type) === "GlobalBlock")) == null ? void 0 : w.map((x) => x == null ? void 0 : x.globalBlock)) == null ? void 0 : v.filter((x) => typeof x == "string")) || [];
|
|
6501
6503
|
o(
|
|
6502
6504
|
{ ids: [l == null ? void 0 : l.id, ...p] },
|
|
6503
6505
|
{ onSuccess: () => Pn("TOP_RIGHT") }
|
|
@@ -6794,7 +6796,7 @@ const Xc = (e, t) => {
|
|
|
6794
6796
|
searchDescription: "",
|
|
6795
6797
|
jsonLD: "",
|
|
6796
6798
|
...h
|
|
6797
|
-
}), y = ot({ initial: d, updated: d }), p = t.length ? t : n, { mutate: w, isPending: v } = us(),
|
|
6799
|
+
}), y = ot({ initial: d, updated: d }), p = t.length ? t : n, { mutate: w, isPending: v } = us(), x = v, { hasPermission: O } = en(), E = O(ue.EDIT_SEO);
|
|
6798
6800
|
be(() => {
|
|
6799
6801
|
!c && h && S({
|
|
6800
6802
|
title: "",
|
|
@@ -6820,13 +6822,13 @@ const Xc = (e, t) => {
|
|
|
6820
6822
|
}
|
|
6821
6823
|
}
|
|
6822
6824
|
);
|
|
6823
|
-
},
|
|
6825
|
+
}, T = () => {
|
|
6824
6826
|
S({
|
|
6825
6827
|
...d,
|
|
6826
6828
|
ogTitle: d.title,
|
|
6827
6829
|
ogDescription: d.description
|
|
6828
6830
|
});
|
|
6829
|
-
},
|
|
6831
|
+
}, G = () => {
|
|
6830
6832
|
S({
|
|
6831
6833
|
...d,
|
|
6832
6834
|
searchTitle: d.ogTitle,
|
|
@@ -6912,7 +6914,7 @@ const Xc = (e, t) => {
|
|
|
6912
6914
|
name: "title",
|
|
6913
6915
|
value: d.title,
|
|
6914
6916
|
onChange: ie,
|
|
6915
|
-
disabled:
|
|
6917
|
+
disabled: x || !E,
|
|
6916
6918
|
placeholder: e("Enter SEO title"),
|
|
6917
6919
|
readOnly: !E
|
|
6918
6920
|
}
|
|
@@ -6937,7 +6939,7 @@ const Xc = (e, t) => {
|
|
|
6937
6939
|
rows: 5,
|
|
6938
6940
|
value: d.description,
|
|
6939
6941
|
onChange: ie,
|
|
6940
|
-
disabled:
|
|
6942
|
+
disabled: x || !E,
|
|
6941
6943
|
placeholder: e("Enter SEO description"),
|
|
6942
6944
|
readOnly: !E
|
|
6943
6945
|
}
|
|
@@ -6963,7 +6965,7 @@ const Xc = (e, t) => {
|
|
|
6963
6965
|
name: "canonicalUrl",
|
|
6964
6966
|
value: d.canonicalUrl,
|
|
6965
6967
|
onChange: ie,
|
|
6966
|
-
disabled:
|
|
6968
|
+
disabled: x || !E,
|
|
6967
6969
|
placeholder: e("Enter Canonical URL"),
|
|
6968
6970
|
readOnly: !E
|
|
6969
6971
|
}
|
|
@@ -6979,7 +6981,7 @@ const Xc = (e, t) => {
|
|
|
6979
6981
|
name: "noIndex",
|
|
6980
6982
|
checked: d.noIndex,
|
|
6981
6983
|
onChange: ie,
|
|
6982
|
-
disabled:
|
|
6984
|
+
disabled: x || !E,
|
|
6983
6985
|
className: "w-4 h-4"
|
|
6984
6986
|
}
|
|
6985
6987
|
),
|
|
@@ -6999,7 +7001,7 @@ const Xc = (e, t) => {
|
|
|
6999
7001
|
name: "noFollow",
|
|
7000
7002
|
checked: d.noFollow,
|
|
7001
7003
|
onChange: ie,
|
|
7002
|
-
disabled:
|
|
7004
|
+
disabled: x || !E,
|
|
7003
7005
|
className: "w-4 h-4"
|
|
7004
7006
|
}
|
|
7005
7007
|
),
|
|
@@ -7020,7 +7022,7 @@ const Xc = (e, t) => {
|
|
|
7020
7022
|
type: "button",
|
|
7021
7023
|
variant: "outline",
|
|
7022
7024
|
size: "sm",
|
|
7023
|
-
onClick:
|
|
7025
|
+
onClick: T,
|
|
7024
7026
|
disabled: !E,
|
|
7025
7027
|
children: e("Copy from SEO Settings")
|
|
7026
7028
|
}
|
|
@@ -7045,7 +7047,7 @@ const Xc = (e, t) => {
|
|
|
7045
7047
|
name: "ogTitle",
|
|
7046
7048
|
value: d.ogTitle,
|
|
7047
7049
|
onChange: ie,
|
|
7048
|
-
disabled:
|
|
7050
|
+
disabled: x || !E,
|
|
7049
7051
|
placeholder: e("Enter OG title"),
|
|
7050
7052
|
readOnly: !E
|
|
7051
7053
|
}
|
|
@@ -7071,7 +7073,7 @@ const Xc = (e, t) => {
|
|
|
7071
7073
|
rows: 5,
|
|
7072
7074
|
value: d.ogDescription,
|
|
7073
7075
|
onChange: ie,
|
|
7074
|
-
disabled:
|
|
7076
|
+
disabled: x || !E,
|
|
7075
7077
|
placeholder: e("Enter OG description"),
|
|
7076
7078
|
readOnly: !E
|
|
7077
7079
|
}
|
|
@@ -7097,7 +7099,7 @@ const Xc = (e, t) => {
|
|
|
7097
7099
|
name: "ogImage",
|
|
7098
7100
|
value: d.ogImage,
|
|
7099
7101
|
onChange: ie,
|
|
7100
|
-
disabled:
|
|
7102
|
+
disabled: x || !E,
|
|
7101
7103
|
placeholder: e("Enter OG image URL"),
|
|
7102
7104
|
readOnly: !E
|
|
7103
7105
|
}
|
|
@@ -7114,7 +7116,7 @@ const Xc = (e, t) => {
|
|
|
7114
7116
|
type: "button",
|
|
7115
7117
|
variant: "outline",
|
|
7116
7118
|
size: "sm",
|
|
7117
|
-
onClick:
|
|
7119
|
+
onClick: G,
|
|
7118
7120
|
disabled: !E,
|
|
7119
7121
|
children: e("Copy from OG Settings")
|
|
7120
7122
|
}
|
|
@@ -7139,7 +7141,7 @@ const Xc = (e, t) => {
|
|
|
7139
7141
|
name: "searchTitle",
|
|
7140
7142
|
value: d.searchTitle,
|
|
7141
7143
|
onChange: ie,
|
|
7142
|
-
disabled:
|
|
7144
|
+
disabled: x || !E,
|
|
7143
7145
|
placeholder: e("Enter search title"),
|
|
7144
7146
|
readOnly: !E
|
|
7145
7147
|
}
|
|
@@ -7166,7 +7168,7 @@ const Xc = (e, t) => {
|
|
|
7166
7168
|
value: d.searchDescription,
|
|
7167
7169
|
onChange: ie,
|
|
7168
7170
|
placeholder: e("Enter search description"),
|
|
7169
|
-
disabled:
|
|
7171
|
+
disabled: x || !E,
|
|
7170
7172
|
readOnly: !E
|
|
7171
7173
|
}
|
|
7172
7174
|
)
|
|
@@ -7196,7 +7198,7 @@ const Xc = (e, t) => {
|
|
|
7196
7198
|
value: d.jsonLD,
|
|
7197
7199
|
onChange: ie,
|
|
7198
7200
|
placeholder: e("Enter JSON-LD"),
|
|
7199
|
-
disabled:
|
|
7201
|
+
disabled: x || !E,
|
|
7200
7202
|
readOnly: !E
|
|
7201
7203
|
}
|
|
7202
7204
|
)
|
|
@@ -7210,7 +7212,7 @@ const Xc = (e, t) => {
|
|
|
7210
7212
|
size: "lg",
|
|
7211
7213
|
variant: "default",
|
|
7212
7214
|
onClick: b,
|
|
7213
|
-
disabled: Zn(y.current.initial, d) ||
|
|
7215
|
+
disabled: Zn(y.current.initial, d) || x || !E,
|
|
7214
7216
|
children: e(v ? "Saving..." : "Save")
|
|
7215
7217
|
}
|
|
7216
7218
|
) })
|
|
@@ -7266,7 +7268,7 @@ const tu = (e) => {
|
|
|
7266
7268
|
role: "",
|
|
7267
7269
|
permissions: null
|
|
7268
7270
|
}
|
|
7269
|
-
} = zc(), { data: o } = Go(), { data: c, isFetching: h } = ea(), { blocks: g } = Io(c), { data: d } = cn(), { data: S } = Ie(), { mutateAsync: y } = Zr(), p = Co(), { getUILibraryBlock: w, getUILibraryBlocks: v, onSave:
|
|
7271
|
+
} = zc(), { data: o } = Go(), { data: c, isFetching: h } = ea(), { blocks: g } = Io(c), { data: d } = cn(), { data: S } = Ie(), { mutateAsync: y } = Zr(), p = Co(), { getUILibraryBlock: w, getUILibraryBlocks: v, onSave: x } = Uo(), { getPartialBlocks: O, getPartialBlockBlocks: E } = Ro(), { aiContext: b, setAiContext: T } = os(), { mutateAsync: G } = Do(), [Z, ie] = I(!1), k = Q(
|
|
7270
7272
|
() => (d == null ? void 0 : d.fallbackLang) || "en",
|
|
7271
7273
|
[d]
|
|
7272
7274
|
), { data: q } = ta({
|
|
@@ -7283,8 +7285,8 @@ const tu = (e) => {
|
|
|
7283
7285
|
const W = {};
|
|
7284
7286
|
return l && (W.permissions = ee(l, "permissions", null), W.role = ee(l, "role", "user")), W;
|
|
7285
7287
|
}, [l]), M = Q(() => o, [o]), ne = _e(
|
|
7286
|
-
async (W, de) => await
|
|
7287
|
-
[
|
|
7288
|
+
async (W, de) => await G({ pageType: W, query: de }),
|
|
7289
|
+
[G]
|
|
7288
7290
|
), he = Q(
|
|
7289
7291
|
() => ee(d, "theme", {}) || {},
|
|
7290
7292
|
[d]
|
|
@@ -7322,7 +7324,7 @@ const tu = (e) => {
|
|
|
7322
7324
|
_type: "@chai/ai-context",
|
|
7323
7325
|
_value: Ss(W) ? W : ""
|
|
7324
7326
|
}, ve = [...de, F];
|
|
7325
|
-
return await
|
|
7327
|
+
return await x({ page: s, blocks: ve }), T(W), !0;
|
|
7326
7328
|
},
|
|
7327
7329
|
aiContext: b,
|
|
7328
7330
|
askAiCallBack: p,
|
|
@@ -7333,7 +7335,7 @@ const tu = (e) => {
|
|
|
7333
7335
|
_type: "@chai/ai-context",
|
|
7334
7336
|
_value: Ss(b) ? b : ""
|
|
7335
7337
|
}, ve = [...W, F];
|
|
7336
|
-
return await
|
|
7338
|
+
return await x({ page: s, blocks: ve }), t.current = ve, Zn(de, he) || await y({ settings: { theme: de } }), !0;
|
|
7337
7339
|
},
|
|
7338
7340
|
themePanelComponent: ic,
|
|
7339
7341
|
...A
|