@chaibuilder/pages 0.1.0-beta.2 → 0.1.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +10 -10
- package/dist/index.d.ts +4 -3
- package/dist/index.js +1549 -1111
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +29 -3
- package/dist/server.js +276 -32
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { loadWebBlocks as
|
|
3
|
-
import { getBlocksFromHTML as
|
|
4
|
-
import { useQueryClient as
|
|
5
|
-
import { useToast as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { get as
|
|
8
|
-
var
|
|
1
|
+
import _t, { useCallback as Xe, useState as R, useEffect as me, useMemo as V, useRef as Rt } from "react";
|
|
2
|
+
import { loadWebBlocks as ma } from "@chaibuilder/sdk/web-blocks";
|
|
3
|
+
import { getBlocksFromHTML as ga, useLanguages as Ze, useTranslation as xa, ChaiBuilderEditor as pa } from "@chaibuilder/sdk";
|
|
4
|
+
import { useQueryClient as Q, useQuery as W, useMutation as re, QueryClient as va, QueryClientProvider as ba } from "@tanstack/react-query";
|
|
5
|
+
import { useToast as ie, Accordion as At, AccordionItem as ae, AccordionTrigger as ne, AccordionContent as se, Label as F, Input as M, Textarea as Re, Button as _, Popover as ya, PopoverTrigger as ja, PopoverContent as wa, Dialog as ge, DialogContent as xe, DialogHeader as pe, DialogTitle as ve, DialogDescription as be, DialogFooter as ye, Tabs as Na, TabsList as ka, TabsTrigger as wt, SheetHeader as Ca, SheetDescription as Sa, DropdownMenu as Ea, DropdownMenuTrigger as Ta, DropdownMenuContent as Pa, DropdownMenuItem as Je, Sheet as Oa, SheetContent as _a } from "@chaibuilder/sdk/ui";
|
|
6
|
+
import { StarIcon as Ra, PencilIcon as Dt, TrashIcon as Ft, Plus as Aa, GlobeIcon as Ae, File as De, MoreVertical as Da, Power as Fa, EyeIcon as La, ArrowLeftRightIcon as Ia, RocketIcon as Ua } from "lucide-react";
|
|
7
|
+
import { get as $, find as H, isEmpty as I, filter as U, includes as he, startCase as Ba, reverse as Ga, sortBy as qa, isEqual as He, map as z, startsWith as Nt, toLower as Ma, trim as $a, orderBy as Ka, first as kt, concat as Ye, uniq as Ct, isString as St } from "lodash-es";
|
|
8
|
+
var Qe = { exports: {} }, ue = {};
|
|
9
9
|
/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.production.min.js
|
|
@@ -15,21 +15,21 @@ var Le = { exports: {} }, ee = {};
|
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
17
|
*/
|
|
18
|
-
var
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
var
|
|
23
|
-
function
|
|
24
|
-
var
|
|
25
|
-
p !== void 0 && (
|
|
26
|
-
for (
|
|
27
|
-
if (
|
|
28
|
-
return { $$typeof:
|
|
18
|
+
var Et;
|
|
19
|
+
function Va() {
|
|
20
|
+
if (Et) return ue;
|
|
21
|
+
Et = 1;
|
|
22
|
+
var a = _t, s = Symbol.for("react.element"), l = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, r = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
23
|
+
function o(d, f, p) {
|
|
24
|
+
var x, b = {}, w = null, E = null;
|
|
25
|
+
p !== void 0 && (w = "" + p), f.key !== void 0 && (w = "" + f.key), f.ref !== void 0 && (E = f.ref);
|
|
26
|
+
for (x in f) n.call(f, x) && !u.hasOwnProperty(x) && (b[x] = f[x]);
|
|
27
|
+
if (d && d.defaultProps) for (x in f = d.defaultProps, f) b[x] === void 0 && (b[x] = f[x]);
|
|
28
|
+
return { $$typeof: s, type: d, key: w, ref: E, props: b, _owner: r.current };
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return ue.Fragment = l, ue.jsx = o, ue.jsxs = o, ue;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var de = {};
|
|
33
33
|
/**
|
|
34
34
|
* @license React
|
|
35
35
|
* react-jsx-runtime.development.js
|
|
@@ -39,91 +39,91 @@ var te = {};
|
|
|
39
39
|
* This source code is licensed under the MIT license found in the
|
|
40
40
|
* LICENSE file in the root directory of this source tree.
|
|
41
41
|
*/
|
|
42
|
-
var
|
|
43
|
-
function
|
|
44
|
-
return
|
|
45
|
-
var
|
|
46
|
-
function
|
|
47
|
-
if (
|
|
42
|
+
var Tt;
|
|
43
|
+
function za() {
|
|
44
|
+
return Tt || (Tt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
|
+
var a = _t, s = Symbol.for("react.element"), l = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), r = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), o = Symbol.for("react.provider"), d = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), b = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), E = Symbol.for("react.offscreen"), h = Symbol.iterator, g = "@@iterator";
|
|
46
|
+
function C(t) {
|
|
47
|
+
if (t === null || typeof t != "object")
|
|
48
48
|
return null;
|
|
49
|
-
var
|
|
50
|
-
return typeof
|
|
49
|
+
var i = h && t[h] || t[g];
|
|
50
|
+
return typeof i == "function" ? i : null;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
52
|
+
var y = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
+
function S(t) {
|
|
54
54
|
{
|
|
55
|
-
for (var
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
for (var i = arguments.length, c = new Array(i > 1 ? i - 1 : 0), m = 1; m < i; m++)
|
|
56
|
+
c[m - 1] = arguments[m];
|
|
57
|
+
Le("error", t, c);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Le(t, i, c) {
|
|
61
61
|
{
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var
|
|
65
|
-
return String(
|
|
62
|
+
var m = y.ReactDebugCurrentFrame, N = m.getStackAddendum();
|
|
63
|
+
N !== "" && (i += "%s", c = c.concat([N]));
|
|
64
|
+
var k = c.map(function(j) {
|
|
65
|
+
return String(j);
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
k.unshift("Warning: " + i), Function.prototype.apply.call(console[t], console, k);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
return !!(typeof
|
|
70
|
+
var le = !1, Ie = !1, we = !1, Ue = !1, Ne = !1, ke;
|
|
71
|
+
ke = Symbol.for("react.module.reference");
|
|
72
|
+
function Ce(t) {
|
|
73
|
+
return !!(typeof t == "string" || typeof t == "function" || t === n || t === u || Ne || t === r || t === p || t === x || Ue || t === E || le || Ie || we || typeof t == "object" && t !== null && (t.$$typeof === w || t.$$typeof === b || t.$$typeof === o || t.$$typeof === d || t.$$typeof === f || // This needs to include all possible module reference object
|
|
74
74
|
// types supported by any Flight configuration anywhere since
|
|
75
75
|
// we don't know which Flight build this will end up being used
|
|
76
76
|
// with.
|
|
77
|
-
|
|
77
|
+
t.$$typeof === ke || t.getModuleId !== void 0));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
var
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
83
|
-
var
|
|
84
|
-
return
|
|
79
|
+
function X(t, i, c) {
|
|
80
|
+
var m = t.displayName;
|
|
81
|
+
if (m)
|
|
82
|
+
return m;
|
|
83
|
+
var N = i.displayName || i.name || "";
|
|
84
|
+
return N !== "" ? c + "(" + N + ")" : c;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function Se(t) {
|
|
87
|
+
return t.displayName || "Context";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
if (
|
|
89
|
+
function B(t) {
|
|
90
|
+
if (t == null)
|
|
91
91
|
return null;
|
|
92
|
-
if (typeof
|
|
93
|
-
return
|
|
94
|
-
if (typeof
|
|
95
|
-
return
|
|
96
|
-
switch (
|
|
97
|
-
case
|
|
92
|
+
if (typeof t.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
93
|
+
return t.displayName || t.name || null;
|
|
94
|
+
if (typeof t == "string")
|
|
95
|
+
return t;
|
|
96
|
+
switch (t) {
|
|
97
|
+
case n:
|
|
98
98
|
return "Fragment";
|
|
99
|
-
case
|
|
99
|
+
case l:
|
|
100
100
|
return "Portal";
|
|
101
|
-
case
|
|
101
|
+
case u:
|
|
102
102
|
return "Profiler";
|
|
103
|
-
case
|
|
103
|
+
case r:
|
|
104
104
|
return "StrictMode";
|
|
105
105
|
case p:
|
|
106
106
|
return "Suspense";
|
|
107
|
-
case
|
|
107
|
+
case x:
|
|
108
108
|
return "SuspenseList";
|
|
109
109
|
}
|
|
110
|
-
if (typeof
|
|
111
|
-
switch (
|
|
110
|
+
if (typeof t == "object")
|
|
111
|
+
switch (t.$$typeof) {
|
|
112
|
+
case d:
|
|
113
|
+
var i = t;
|
|
114
|
+
return Se(i) + ".Consumer";
|
|
115
|
+
case o:
|
|
116
|
+
var c = t;
|
|
117
|
+
return Se(c._context) + ".Provider";
|
|
112
118
|
case f:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return ce(e, e.render, "ForwardRef");
|
|
120
|
-
case m:
|
|
121
|
-
var d = e.displayName || null;
|
|
122
|
-
return d !== null ? d : T(e.type) || "Memo";
|
|
123
|
-
case h: {
|
|
124
|
-
var y = e, j = y._payload, x = y._init;
|
|
119
|
+
return X(t, t.render, "ForwardRef");
|
|
120
|
+
case b:
|
|
121
|
+
var m = t.displayName || null;
|
|
122
|
+
return m !== null ? m : B(t.type) || "Memo";
|
|
123
|
+
case w: {
|
|
124
|
+
var N = t, k = N._payload, j = N._init;
|
|
125
125
|
try {
|
|
126
|
-
return
|
|
126
|
+
return B(j(k));
|
|
127
127
|
} catch {
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
@@ -131,307 +131,307 @@ function Da() {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
var
|
|
135
|
-
function
|
|
134
|
+
var K = Object.assign, J = 0, P, q, Z, Ee, st, rt, it;
|
|
135
|
+
function lt() {
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
function
|
|
137
|
+
lt.__reactDisabledLog = !0;
|
|
138
|
+
function qt() {
|
|
139
139
|
{
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
var
|
|
140
|
+
if (J === 0) {
|
|
141
|
+
P = console.log, q = console.info, Z = console.warn, Ee = console.error, st = console.group, rt = console.groupCollapsed, it = console.groupEnd;
|
|
142
|
+
var t = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
145
|
-
value:
|
|
145
|
+
value: lt,
|
|
146
146
|
writable: !0
|
|
147
147
|
};
|
|
148
148
|
Object.defineProperties(console, {
|
|
149
|
-
info:
|
|
150
|
-
log:
|
|
151
|
-
warn:
|
|
152
|
-
error:
|
|
153
|
-
group:
|
|
154
|
-
groupCollapsed:
|
|
155
|
-
groupEnd:
|
|
149
|
+
info: t,
|
|
150
|
+
log: t,
|
|
151
|
+
warn: t,
|
|
152
|
+
error: t,
|
|
153
|
+
group: t,
|
|
154
|
+
groupCollapsed: t,
|
|
155
|
+
groupEnd: t
|
|
156
156
|
});
|
|
157
157
|
}
|
|
158
|
-
|
|
158
|
+
J++;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Mt() {
|
|
162
162
|
{
|
|
163
|
-
if (
|
|
164
|
-
var
|
|
163
|
+
if (J--, J === 0) {
|
|
164
|
+
var t = {
|
|
165
165
|
configurable: !0,
|
|
166
166
|
enumerable: !0,
|
|
167
167
|
writable: !0
|
|
168
168
|
};
|
|
169
169
|
Object.defineProperties(console, {
|
|
170
|
-
log:
|
|
171
|
-
value:
|
|
170
|
+
log: K({}, t, {
|
|
171
|
+
value: P
|
|
172
172
|
}),
|
|
173
|
-
info:
|
|
174
|
-
value:
|
|
173
|
+
info: K({}, t, {
|
|
174
|
+
value: q
|
|
175
175
|
}),
|
|
176
|
-
warn:
|
|
177
|
-
value:
|
|
176
|
+
warn: K({}, t, {
|
|
177
|
+
value: Z
|
|
178
178
|
}),
|
|
179
|
-
error:
|
|
180
|
-
value:
|
|
179
|
+
error: K({}, t, {
|
|
180
|
+
value: Ee
|
|
181
181
|
}),
|
|
182
|
-
group:
|
|
183
|
-
value:
|
|
182
|
+
group: K({}, t, {
|
|
183
|
+
value: st
|
|
184
184
|
}),
|
|
185
|
-
groupCollapsed:
|
|
186
|
-
value:
|
|
185
|
+
groupCollapsed: K({}, t, {
|
|
186
|
+
value: rt
|
|
187
187
|
}),
|
|
188
|
-
groupEnd:
|
|
189
|
-
value:
|
|
188
|
+
groupEnd: K({}, t, {
|
|
189
|
+
value: it
|
|
190
190
|
})
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
J < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
var
|
|
197
|
-
function
|
|
196
|
+
var Be = y.ReactCurrentDispatcher, Ge;
|
|
197
|
+
function Te(t, i, c) {
|
|
198
198
|
{
|
|
199
|
-
if (
|
|
199
|
+
if (Ge === void 0)
|
|
200
200
|
try {
|
|
201
201
|
throw Error();
|
|
202
|
-
} catch (
|
|
203
|
-
var
|
|
204
|
-
|
|
202
|
+
} catch (N) {
|
|
203
|
+
var m = N.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
+
Ge = m && m[1] || "";
|
|
205
205
|
}
|
|
206
206
|
return `
|
|
207
|
-
` +
|
|
207
|
+
` + Ge + t;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
var
|
|
210
|
+
var qe = !1, Pe;
|
|
211
211
|
{
|
|
212
|
-
var
|
|
213
|
-
|
|
212
|
+
var $t = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
+
Pe = new $t();
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
if (!
|
|
215
|
+
function ot(t, i) {
|
|
216
|
+
if (!t || qe)
|
|
217
217
|
return "";
|
|
218
218
|
{
|
|
219
|
-
var
|
|
220
|
-
if (
|
|
221
|
-
return
|
|
219
|
+
var c = Pe.get(t);
|
|
220
|
+
if (c !== void 0)
|
|
221
|
+
return c;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
var
|
|
223
|
+
var m;
|
|
224
|
+
qe = !0;
|
|
225
|
+
var N = Error.prepareStackTrace;
|
|
226
226
|
Error.prepareStackTrace = void 0;
|
|
227
|
-
var
|
|
228
|
-
|
|
227
|
+
var k;
|
|
228
|
+
k = Be.current, Be.current = null, qt();
|
|
229
229
|
try {
|
|
230
|
-
if (
|
|
231
|
-
var
|
|
230
|
+
if (i) {
|
|
231
|
+
var j = function() {
|
|
232
232
|
throw Error();
|
|
233
233
|
};
|
|
234
|
-
if (Object.defineProperty(
|
|
234
|
+
if (Object.defineProperty(j.prototype, "props", {
|
|
235
235
|
set: function() {
|
|
236
236
|
throw Error();
|
|
237
237
|
}
|
|
238
238
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
239
|
try {
|
|
240
|
-
Reflect.construct(
|
|
241
|
-
} catch (
|
|
242
|
-
|
|
240
|
+
Reflect.construct(j, []);
|
|
241
|
+
} catch (L) {
|
|
242
|
+
m = L;
|
|
243
243
|
}
|
|
244
|
-
Reflect.construct(
|
|
244
|
+
Reflect.construct(t, [], j);
|
|
245
245
|
} else {
|
|
246
246
|
try {
|
|
247
|
-
|
|
248
|
-
} catch (
|
|
249
|
-
|
|
247
|
+
j.call();
|
|
248
|
+
} catch (L) {
|
|
249
|
+
m = L;
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
t.call(j.prototype);
|
|
252
252
|
}
|
|
253
253
|
} else {
|
|
254
254
|
try {
|
|
255
255
|
throw Error();
|
|
256
|
-
} catch (
|
|
257
|
-
|
|
256
|
+
} catch (L) {
|
|
257
|
+
m = L;
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
t();
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
if (
|
|
263
|
-
for (var v =
|
|
264
|
-
`),
|
|
265
|
-
`),
|
|
266
|
-
|
|
267
|
-
for (;
|
|
268
|
-
if (v[
|
|
269
|
-
if (
|
|
261
|
+
} catch (L) {
|
|
262
|
+
if (L && m && typeof L.stack == "string") {
|
|
263
|
+
for (var v = L.stack.split(`
|
|
264
|
+
`), D = m.stack.split(`
|
|
265
|
+
`), T = v.length - 1, O = D.length - 1; T >= 1 && O >= 0 && v[T] !== D[O]; )
|
|
266
|
+
O--;
|
|
267
|
+
for (; T >= 1 && O >= 0; T--, O--)
|
|
268
|
+
if (v[T] !== D[O]) {
|
|
269
|
+
if (T !== 1 || O !== 1)
|
|
270
270
|
do
|
|
271
|
-
if (
|
|
272
|
-
var
|
|
273
|
-
` + v[
|
|
274
|
-
return
|
|
271
|
+
if (T--, O--, O < 0 || v[T] !== D[O]) {
|
|
272
|
+
var G = `
|
|
273
|
+
` + v[T].replace(" at new ", " at ");
|
|
274
|
+
return t.displayName && G.includes("<anonymous>") && (G = G.replace("<anonymous>", t.displayName)), typeof t == "function" && Pe.set(t, G), G;
|
|
275
275
|
}
|
|
276
|
-
while (
|
|
276
|
+
while (T >= 1 && O >= 0);
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
qe = !1, Be.current = k, Mt(), Error.prepareStackTrace = N;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
return typeof
|
|
283
|
+
var te = t ? t.displayName || t.name : "", Y = te ? Te(te) : "";
|
|
284
|
+
return typeof t == "function" && Pe.set(t, Y), Y;
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
return
|
|
286
|
+
function Kt(t, i, c) {
|
|
287
|
+
return ot(t, !1);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
var
|
|
291
|
-
return !!(
|
|
289
|
+
function Vt(t) {
|
|
290
|
+
var i = t.prototype;
|
|
291
|
+
return !!(i && i.isReactComponent);
|
|
292
292
|
}
|
|
293
|
-
function
|
|
294
|
-
if (
|
|
293
|
+
function Oe(t, i, c) {
|
|
294
|
+
if (t == null)
|
|
295
295
|
return "";
|
|
296
|
-
if (typeof
|
|
297
|
-
return
|
|
298
|
-
if (typeof
|
|
299
|
-
return
|
|
300
|
-
switch (
|
|
296
|
+
if (typeof t == "function")
|
|
297
|
+
return ot(t, Vt(t));
|
|
298
|
+
if (typeof t == "string")
|
|
299
|
+
return Te(t);
|
|
300
|
+
switch (t) {
|
|
301
301
|
case p:
|
|
302
|
-
return
|
|
303
|
-
case
|
|
304
|
-
return
|
|
302
|
+
return Te("Suspense");
|
|
303
|
+
case x:
|
|
304
|
+
return Te("SuspenseList");
|
|
305
305
|
}
|
|
306
|
-
if (typeof
|
|
307
|
-
switch (
|
|
308
|
-
case
|
|
309
|
-
return
|
|
310
|
-
case
|
|
311
|
-
return
|
|
312
|
-
case
|
|
313
|
-
var
|
|
306
|
+
if (typeof t == "object")
|
|
307
|
+
switch (t.$$typeof) {
|
|
308
|
+
case f:
|
|
309
|
+
return Kt(t.render);
|
|
310
|
+
case b:
|
|
311
|
+
return Oe(t.type, i, c);
|
|
312
|
+
case w: {
|
|
313
|
+
var m = t, N = m._payload, k = m._init;
|
|
314
314
|
try {
|
|
315
|
-
return
|
|
315
|
+
return Oe(k(N), i, c);
|
|
316
316
|
} catch {
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
320
|
return "";
|
|
321
321
|
}
|
|
322
|
-
var
|
|
323
|
-
function
|
|
324
|
-
if (
|
|
325
|
-
var
|
|
326
|
-
|
|
322
|
+
var oe = Object.prototype.hasOwnProperty, ct = {}, ut = y.ReactDebugCurrentFrame;
|
|
323
|
+
function _e(t) {
|
|
324
|
+
if (t) {
|
|
325
|
+
var i = t._owner, c = Oe(t.type, t._source, i ? i.type : null);
|
|
326
|
+
ut.setExtraStackFrame(c);
|
|
327
327
|
} else
|
|
328
|
-
|
|
328
|
+
ut.setExtraStackFrame(null);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function zt(t, i, c, m, N) {
|
|
331
331
|
{
|
|
332
|
-
var
|
|
333
|
-
for (var
|
|
334
|
-
if (
|
|
332
|
+
var k = Function.call.bind(oe);
|
|
333
|
+
for (var j in t)
|
|
334
|
+
if (k(t, j)) {
|
|
335
335
|
var v = void 0;
|
|
336
336
|
try {
|
|
337
|
-
if (typeof
|
|
338
|
-
var
|
|
339
|
-
throw
|
|
337
|
+
if (typeof t[j] != "function") {
|
|
338
|
+
var D = Error((m || "React class") + ": " + c + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
+
throw D.name = "Invariant Violation", D;
|
|
340
340
|
}
|
|
341
|
-
v =
|
|
342
|
-
} catch (
|
|
343
|
-
v =
|
|
341
|
+
v = t[j](i, j, m, c, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
+
} catch (T) {
|
|
343
|
+
v = T;
|
|
344
344
|
}
|
|
345
|
-
v && !(v instanceof Error) && (
|
|
345
|
+
v && !(v instanceof Error) && (_e(N), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", c, j, typeof v), _e(null)), v instanceof Error && !(v.message in ct) && (ct[v.message] = !0, _e(N), S("Failed %s type: %s", c, v.message), _e(null));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
|
-
var
|
|
350
|
-
function
|
|
351
|
-
return
|
|
349
|
+
var Wt = Array.isArray;
|
|
350
|
+
function Me(t) {
|
|
351
|
+
return Wt(t);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Jt(t) {
|
|
354
354
|
{
|
|
355
|
-
var
|
|
356
|
-
return
|
|
355
|
+
var i = typeof Symbol == "function" && Symbol.toStringTag, c = i && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
356
|
+
return c;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Yt(t) {
|
|
360
360
|
try {
|
|
361
|
-
return
|
|
361
|
+
return dt(t), !1;
|
|
362
362
|
} catch {
|
|
363
363
|
return !0;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
return "" +
|
|
366
|
+
function dt(t) {
|
|
367
|
+
return "" + t;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
369
|
+
function ht(t) {
|
|
370
|
+
if (Yt(t))
|
|
371
|
+
return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Jt(t)), dt(t);
|
|
372
372
|
}
|
|
373
|
-
var
|
|
373
|
+
var ce = y.ReactCurrentOwner, Ht = {
|
|
374
374
|
key: !0,
|
|
375
375
|
ref: !0,
|
|
376
376
|
__self: !0,
|
|
377
377
|
__source: !0
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
function
|
|
381
|
-
if (
|
|
382
|
-
var
|
|
383
|
-
if (
|
|
378
|
+
}, ft, mt, $e;
|
|
379
|
+
$e = {};
|
|
380
|
+
function Qt(t) {
|
|
381
|
+
if (oe.call(t, "ref")) {
|
|
382
|
+
var i = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
383
|
+
if (i && i.isReactWarning)
|
|
384
384
|
return !1;
|
|
385
385
|
}
|
|
386
|
-
return
|
|
386
|
+
return t.ref !== void 0;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
if (
|
|
390
|
-
var
|
|
391
|
-
if (
|
|
388
|
+
function Xt(t) {
|
|
389
|
+
if (oe.call(t, "key")) {
|
|
390
|
+
var i = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
391
|
+
if (i && i.isReactWarning)
|
|
392
392
|
return !1;
|
|
393
393
|
}
|
|
394
|
-
return
|
|
394
|
+
return t.key !== void 0;
|
|
395
395
|
}
|
|
396
|
-
function
|
|
397
|
-
if (typeof
|
|
398
|
-
var
|
|
399
|
-
|
|
396
|
+
function Zt(t, i) {
|
|
397
|
+
if (typeof t.ref == "string" && ce.current && i && ce.current.stateNode !== i) {
|
|
398
|
+
var c = B(ce.current.type);
|
|
399
|
+
$e[c] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', B(ce.current.type), t.ref), $e[c] = !0);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function ea(t, i) {
|
|
403
403
|
{
|
|
404
|
-
var
|
|
405
|
-
|
|
404
|
+
var c = function() {
|
|
405
|
+
ft || (ft = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", i));
|
|
406
406
|
};
|
|
407
|
-
|
|
408
|
-
get:
|
|
407
|
+
c.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
408
|
+
get: c,
|
|
409
409
|
configurable: !0
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function ta(t, i) {
|
|
414
414
|
{
|
|
415
|
-
var
|
|
416
|
-
|
|
415
|
+
var c = function() {
|
|
416
|
+
mt || (mt = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", i));
|
|
417
417
|
};
|
|
418
|
-
|
|
419
|
-
get:
|
|
418
|
+
c.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
419
|
+
get: c,
|
|
420
420
|
configurable: !0
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
var
|
|
424
|
+
var aa = function(t, i, c, m, N, k, j) {
|
|
425
425
|
var v = {
|
|
426
426
|
// This tag allows us to uniquely identify this as a React Element
|
|
427
|
-
$$typeof:
|
|
427
|
+
$$typeof: s,
|
|
428
428
|
// Built-in properties that belong on the element
|
|
429
|
-
type:
|
|
430
|
-
key:
|
|
431
|
-
ref:
|
|
432
|
-
props:
|
|
429
|
+
type: t,
|
|
430
|
+
key: i,
|
|
431
|
+
ref: c,
|
|
432
|
+
props: j,
|
|
433
433
|
// Record the component responsible for creating this element.
|
|
434
|
-
_owner:
|
|
434
|
+
_owner: k
|
|
435
435
|
};
|
|
436
436
|
return v._store = {}, Object.defineProperty(v._store, "validated", {
|
|
437
437
|
configurable: !1,
|
|
@@ -442,336 +442,286 @@ function Da() {
|
|
|
442
442
|
configurable: !1,
|
|
443
443
|
enumerable: !1,
|
|
444
444
|
writable: !1,
|
|
445
|
-
value:
|
|
445
|
+
value: m
|
|
446
446
|
}), Object.defineProperty(v, "_source", {
|
|
447
447
|
configurable: !1,
|
|
448
448
|
enumerable: !1,
|
|
449
449
|
writable: !1,
|
|
450
|
-
value:
|
|
450
|
+
value: N
|
|
451
451
|
}), Object.freeze && (Object.freeze(v.props), Object.freeze(v)), v;
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function na(t, i, c, m, N) {
|
|
454
454
|
{
|
|
455
|
-
var
|
|
456
|
-
|
|
457
|
-
for (
|
|
458
|
-
|
|
459
|
-
if (
|
|
460
|
-
var
|
|
461
|
-
for (
|
|
462
|
-
|
|
455
|
+
var k, j = {}, v = null, D = null;
|
|
456
|
+
c !== void 0 && (ht(c), v = "" + c), Xt(i) && (ht(i.key), v = "" + i.key), Qt(i) && (D = i.ref, Zt(i, N));
|
|
457
|
+
for (k in i)
|
|
458
|
+
oe.call(i, k) && !Ht.hasOwnProperty(k) && (j[k] = i[k]);
|
|
459
|
+
if (t && t.defaultProps) {
|
|
460
|
+
var T = t.defaultProps;
|
|
461
|
+
for (k in T)
|
|
462
|
+
j[k] === void 0 && (j[k] = T[k]);
|
|
463
463
|
}
|
|
464
|
-
if (v ||
|
|
465
|
-
var
|
|
466
|
-
v &&
|
|
464
|
+
if (v || D) {
|
|
465
|
+
var O = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
466
|
+
v && ea(j, O), D && ta(j, O);
|
|
467
467
|
}
|
|
468
|
-
return
|
|
468
|
+
return aa(t, v, D, N, m, ce.current, j);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
var
|
|
472
|
-
function
|
|
473
|
-
if (
|
|
474
|
-
var
|
|
475
|
-
|
|
471
|
+
var Ke = y.ReactCurrentOwner, gt = y.ReactDebugCurrentFrame;
|
|
472
|
+
function ee(t) {
|
|
473
|
+
if (t) {
|
|
474
|
+
var i = t._owner, c = Oe(t.type, t._source, i ? i.type : null);
|
|
475
|
+
gt.setExtraStackFrame(c);
|
|
476
476
|
} else
|
|
477
|
-
|
|
477
|
+
gt.setExtraStackFrame(null);
|
|
478
478
|
}
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
function
|
|
482
|
-
return typeof
|
|
479
|
+
var Ve;
|
|
480
|
+
Ve = !1;
|
|
481
|
+
function ze(t) {
|
|
482
|
+
return typeof t == "object" && t !== null && t.$$typeof === s;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function xt() {
|
|
485
485
|
{
|
|
486
|
-
if (
|
|
487
|
-
var
|
|
488
|
-
if (
|
|
486
|
+
if (Ke.current) {
|
|
487
|
+
var t = B(Ke.current.type);
|
|
488
|
+
if (t)
|
|
489
489
|
return `
|
|
490
490
|
|
|
491
|
-
Check the render method of \`` +
|
|
491
|
+
Check the render method of \`` + t + "`.";
|
|
492
492
|
}
|
|
493
493
|
return "";
|
|
494
494
|
}
|
|
495
495
|
}
|
|
496
|
-
function
|
|
496
|
+
function sa(t) {
|
|
497
497
|
return "";
|
|
498
498
|
}
|
|
499
|
-
var
|
|
500
|
-
function
|
|
499
|
+
var pt = {};
|
|
500
|
+
function ra(t) {
|
|
501
501
|
{
|
|
502
|
-
var
|
|
503
|
-
if (!
|
|
504
|
-
var
|
|
505
|
-
|
|
502
|
+
var i = xt();
|
|
503
|
+
if (!i) {
|
|
504
|
+
var c = typeof t == "string" ? t : t.displayName || t.name;
|
|
505
|
+
c && (i = `
|
|
506
506
|
|
|
507
|
-
Check the top-level render call using <` +
|
|
507
|
+
Check the top-level render call using <` + c + ">.");
|
|
508
508
|
}
|
|
509
|
-
return
|
|
509
|
+
return i;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function vt(t, i) {
|
|
513
513
|
{
|
|
514
|
-
if (!
|
|
514
|
+
if (!t._store || t._store.validated || t.key != null)
|
|
515
515
|
return;
|
|
516
|
-
|
|
517
|
-
var
|
|
518
|
-
if (
|
|
516
|
+
t._store.validated = !0;
|
|
517
|
+
var c = ra(i);
|
|
518
|
+
if (pt[c])
|
|
519
519
|
return;
|
|
520
|
-
|
|
521
|
-
var
|
|
522
|
-
|
|
520
|
+
pt[c] = !0;
|
|
521
|
+
var m = "";
|
|
522
|
+
t && t._owner && t._owner !== Ke.current && (m = " It was passed a child from " + B(t._owner.type) + "."), ee(t), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', c, m), ee(null);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function bt(t, i) {
|
|
526
526
|
{
|
|
527
|
-
if (typeof
|
|
527
|
+
if (typeof t != "object")
|
|
528
528
|
return;
|
|
529
|
-
if (
|
|
530
|
-
for (var
|
|
531
|
-
var
|
|
532
|
-
|
|
529
|
+
if (Me(t))
|
|
530
|
+
for (var c = 0; c < t.length; c++) {
|
|
531
|
+
var m = t[c];
|
|
532
|
+
ze(m) && vt(m, i);
|
|
533
533
|
}
|
|
534
|
-
else if (
|
|
535
|
-
|
|
536
|
-
else if (
|
|
537
|
-
var
|
|
538
|
-
if (typeof
|
|
539
|
-
for (var
|
|
540
|
-
|
|
534
|
+
else if (ze(t))
|
|
535
|
+
t._store && (t._store.validated = !0);
|
|
536
|
+
else if (t) {
|
|
537
|
+
var N = C(t);
|
|
538
|
+
if (typeof N == "function" && N !== t.entries)
|
|
539
|
+
for (var k = N.call(t), j; !(j = k.next()).done; )
|
|
540
|
+
ze(j.value) && vt(j.value, i);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function ia(t) {
|
|
545
545
|
{
|
|
546
|
-
var
|
|
547
|
-
if (
|
|
546
|
+
var i = t.type;
|
|
547
|
+
if (i == null || typeof i == "string")
|
|
548
548
|
return;
|
|
549
|
-
var
|
|
550
|
-
if (typeof
|
|
551
|
-
|
|
552
|
-
else if (typeof
|
|
549
|
+
var c;
|
|
550
|
+
if (typeof i == "function")
|
|
551
|
+
c = i.propTypes;
|
|
552
|
+
else if (typeof i == "object" && (i.$$typeof === f || // Note: Memo only checks outer props here.
|
|
553
553
|
// Inner props are checked in the reconciler.
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
i.$$typeof === b))
|
|
555
|
+
c = i.propTypes;
|
|
556
556
|
else
|
|
557
557
|
return;
|
|
558
|
-
if (
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
} else if (
|
|
562
|
-
|
|
563
|
-
var
|
|
564
|
-
|
|
558
|
+
if (c) {
|
|
559
|
+
var m = B(i);
|
|
560
|
+
zt(c, t.props, "prop", m, t);
|
|
561
|
+
} else if (i.PropTypes !== void 0 && !Ve) {
|
|
562
|
+
Ve = !0;
|
|
563
|
+
var N = B(i);
|
|
564
|
+
S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown");
|
|
565
565
|
}
|
|
566
|
-
typeof
|
|
566
|
+
typeof i.getDefaultProps == "function" && !i.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function la(t) {
|
|
570
570
|
{
|
|
571
|
-
for (var
|
|
572
|
-
var
|
|
573
|
-
if (
|
|
574
|
-
|
|
571
|
+
for (var i = Object.keys(t.props), c = 0; c < i.length; c++) {
|
|
572
|
+
var m = i[c];
|
|
573
|
+
if (m !== "children" && m !== "key") {
|
|
574
|
+
ee(t), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", m), ee(null);
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
|
|
578
|
+
t.ref !== null && (ee(t), S("Invalid attribute `ref` supplied to `React.Fragment`."), ee(null));
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
581
|
+
var yt = {};
|
|
582
|
+
function jt(t, i, c, m, N, k) {
|
|
583
583
|
{
|
|
584
|
-
var
|
|
585
|
-
if (!
|
|
584
|
+
var j = Ce(t);
|
|
585
|
+
if (!j) {
|
|
586
586
|
var v = "";
|
|
587
|
-
(
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
|
|
587
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (v += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
588
|
+
var D = sa();
|
|
589
|
+
D ? v += D : v += xt();
|
|
590
|
+
var T;
|
|
591
|
+
t === null ? T = "null" : Me(t) ? T = "array" : t !== void 0 && t.$$typeof === s ? (T = "<" + (B(t.type) || "Unknown") + " />", v = " Did you accidentally export a JSX literal instead of a component?") : T = typeof t, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", T, v);
|
|
592
592
|
}
|
|
593
|
-
var
|
|
594
|
-
if (
|
|
595
|
-
return
|
|
596
|
-
if (
|
|
597
|
-
var
|
|
598
|
-
if (
|
|
599
|
-
if (
|
|
600
|
-
if (
|
|
601
|
-
for (var
|
|
602
|
-
|
|
603
|
-
Object.freeze && Object.freeze(
|
|
593
|
+
var O = na(t, i, c, N, k);
|
|
594
|
+
if (O == null)
|
|
595
|
+
return O;
|
|
596
|
+
if (j) {
|
|
597
|
+
var G = i.children;
|
|
598
|
+
if (G !== void 0)
|
|
599
|
+
if (m)
|
|
600
|
+
if (Me(G)) {
|
|
601
|
+
for (var te = 0; te < G.length; te++)
|
|
602
|
+
bt(G[te], t);
|
|
603
|
+
Object.freeze && Object.freeze(G);
|
|
604
604
|
} else
|
|
605
|
-
|
|
605
|
+
S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
606
606
|
else
|
|
607
|
-
|
|
607
|
+
bt(G, t);
|
|
608
608
|
}
|
|
609
|
-
if (
|
|
610
|
-
var
|
|
611
|
-
return
|
|
612
|
-
}),
|
|
613
|
-
if (!
|
|
614
|
-
var
|
|
615
|
-
|
|
609
|
+
if (oe.call(i, "key")) {
|
|
610
|
+
var Y = B(t), L = Object.keys(i).filter(function(fa) {
|
|
611
|
+
return fa !== "key";
|
|
612
|
+
}), We = L.length > 0 ? "{key: someKey, " + L.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
613
|
+
if (!yt[Y + We]) {
|
|
614
|
+
var ha = L.length > 0 ? "{" + L.join(": ..., ") + ": ...}" : "{}";
|
|
615
|
+
S(`A props object containing a "key" prop is being spread into JSX:
|
|
616
616
|
let props = %s;
|
|
617
617
|
<%s {...props} />
|
|
618
618
|
React keys must be passed directly to JSX without using spread:
|
|
619
619
|
let props = %s;
|
|
620
|
-
<%s key={someKey} {...props} />`,
|
|
620
|
+
<%s key={someKey} {...props} />`, We, Y, ha, Y), yt[Y + We] = !0;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
return
|
|
623
|
+
return t === n ? la(O) : ia(O), O;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return
|
|
626
|
+
function oa(t, i, c) {
|
|
627
|
+
return jt(t, i, c, !0);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
return
|
|
629
|
+
function ca(t, i, c) {
|
|
630
|
+
return jt(t, i, c, !1);
|
|
631
631
|
}
|
|
632
|
-
var
|
|
633
|
-
|
|
634
|
-
}()),
|
|
635
|
-
}
|
|
636
|
-
process.env.NODE_ENV === "production" ? Le.exports = Ra() : Le.exports = Da();
|
|
637
|
-
var t = Le.exports;
|
|
638
|
-
const Aa = (r, i) => {
|
|
639
|
-
const a = J().getQueryData(["builder_props"]);
|
|
640
|
-
return q(a, r, i);
|
|
641
|
-
}, A = () => Aa("apiUrl", "/chai/api");
|
|
642
|
-
function H() {
|
|
643
|
-
const [r, i] = I(
|
|
644
|
-
new URLSearchParams(window.location.search)
|
|
645
|
-
);
|
|
646
|
-
return Ie(() => {
|
|
647
|
-
const o = () => {
|
|
648
|
-
i(new URLSearchParams(window.location.search));
|
|
649
|
-
};
|
|
650
|
-
return window.addEventListener("popstate", o), () => {
|
|
651
|
-
window.removeEventListener("popstate", o);
|
|
652
|
-
};
|
|
653
|
-
}, []), [r, i];
|
|
632
|
+
var ua = ca, da = oa;
|
|
633
|
+
de.Fragment = n, de.jsx = ua, de.jsxs = da;
|
|
634
|
+
}()), de;
|
|
654
635
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
data: { id: i, draft: !0 }
|
|
666
|
-
})
|
|
667
|
-
})).json()).blocks ?? [],
|
|
668
|
-
enabled: !!i
|
|
636
|
+
process.env.NODE_ENV === "production" ? Qe.exports = Va() : Qe.exports = za();
|
|
637
|
+
var e = Qe.exports;
|
|
638
|
+
const Lt = (a, s) => {
|
|
639
|
+
const n = Q().getQueryData(["builder_props"]);
|
|
640
|
+
return $(n, a, s);
|
|
641
|
+
}, A = () => Lt("apiUrl", "/chai/api"), et = () => {
|
|
642
|
+
const a = Q(), { data: s } = W({
|
|
643
|
+
queryKey: ["ai-context"],
|
|
644
|
+
initialData: "",
|
|
645
|
+
queryFn: () => ""
|
|
669
646
|
});
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
const
|
|
678
|
-
_type: "@chai/ai-context",
|
|
679
|
-
_value: Ae(p) ? p : ""
|
|
680
|
-
}, m = ae(
|
|
681
|
-
a,
|
|
682
|
-
(S) => (S == null ? void 0 : S._type) !== g._type
|
|
683
|
-
);
|
|
684
|
-
return m.push(g), await fetch(r, {
|
|
685
|
-
method: "POST",
|
|
686
|
-
headers: { "Content-Type": "application/json" },
|
|
687
|
-
body: JSON.stringify({
|
|
688
|
-
action: "UPDATE_PAGE",
|
|
689
|
-
data: { id: u, blocks: m }
|
|
690
|
-
})
|
|
691
|
-
});
|
|
692
|
-
},
|
|
693
|
-
onSuccess: (u, { aiContext: p }) => {
|
|
694
|
-
i.setQueryData(["page", w], () => {
|
|
695
|
-
const g = {
|
|
696
|
-
_type: "@chai/ai-context",
|
|
697
|
-
_value: Ae(p) ? p : ""
|
|
698
|
-
}, m = ae(
|
|
699
|
-
a,
|
|
700
|
-
(h) => (h == null ? void 0 : h._type) !== g._type
|
|
701
|
-
);
|
|
702
|
-
return m.push(g), m;
|
|
703
|
-
}), o({ title: "AI context updated successfully." });
|
|
704
|
-
},
|
|
705
|
-
onError: (u) => {
|
|
706
|
-
o({
|
|
707
|
-
variant: "destructive",
|
|
708
|
-
title: "Failed to update AI context",
|
|
709
|
-
description: u.message
|
|
710
|
-
});
|
|
711
|
-
}
|
|
712
|
-
});
|
|
713
|
-
return { aiContext: c, updateAiContext: f };
|
|
714
|
-
}, Fa = () => {
|
|
715
|
-
const r = A(), { aiContext: i } = Pt();
|
|
716
|
-
return la(
|
|
717
|
-
async (o, a, s, w) => {
|
|
718
|
-
const f = await (await fetch(r, {
|
|
647
|
+
return { setAiContext: Xe((n) => {
|
|
648
|
+
a.setQueryData(["ai-context"], n);
|
|
649
|
+
}, []), aiContext: s };
|
|
650
|
+
}, Wa = () => {
|
|
651
|
+
const a = A(), { aiContext: s } = et();
|
|
652
|
+
return Xe(
|
|
653
|
+
async (l, n, r, u) => {
|
|
654
|
+
const d = await (await fetch(a, {
|
|
719
655
|
method: "POST",
|
|
720
656
|
headers: {
|
|
721
657
|
"Content-Type": "application/json"
|
|
722
658
|
},
|
|
723
659
|
body: JSON.stringify({
|
|
724
660
|
action: "ASK_AI",
|
|
725
|
-
data: { type:
|
|
661
|
+
data: { type: l, prompt: n, blocks: r, aiContext: s, lang: u }
|
|
726
662
|
})
|
|
727
663
|
})).json();
|
|
728
|
-
return console.log("data",
|
|
664
|
+
return console.log("data", d), d.error ? { error: new Error(d.error) } : d;
|
|
729
665
|
},
|
|
730
|
-
[
|
|
666
|
+
[a, s]
|
|
731
667
|
);
|
|
732
|
-
},
|
|
733
|
-
const
|
|
734
|
-
return { getUILibraryBlock: async (
|
|
735
|
-
const
|
|
736
|
-
|
|
668
|
+
}, Ja = () => {
|
|
669
|
+
const a = A(), { toast: s } = ie();
|
|
670
|
+
return { getUILibraryBlock: async (u, o) => {
|
|
671
|
+
const p = (await (await fetch(
|
|
672
|
+
u.url + (o.path ? "/blocks/" + o.path : "/" + o.uuid + ".html")
|
|
737
673
|
)).text()).replace(/---([\s\S]*?)---/g, "");
|
|
738
|
-
return
|
|
739
|
-
}, getUILibraryBlocks: async (
|
|
674
|
+
return ga(`${p}`);
|
|
675
|
+
}, getUILibraryBlocks: async (u) => {
|
|
740
676
|
try {
|
|
741
|
-
return (await (await fetch(
|
|
742
|
-
...
|
|
743
|
-
preview:
|
|
677
|
+
return (await (await fetch(u.url + "/blocks.json")).json()).map((f) => ({
|
|
678
|
+
...f,
|
|
679
|
+
preview: u.url.replace("chaiblocks", "") + f.preview
|
|
744
680
|
}));
|
|
745
|
-
} catch (
|
|
746
|
-
return console.error(
|
|
681
|
+
} catch (o) {
|
|
682
|
+
return console.error(o), [];
|
|
747
683
|
}
|
|
748
684
|
}, onSave: async ({
|
|
749
|
-
page:
|
|
750
|
-
blocks:
|
|
685
|
+
page: u,
|
|
686
|
+
blocks: o
|
|
751
687
|
}) => {
|
|
752
688
|
try {
|
|
753
|
-
return (await fetch(
|
|
689
|
+
return (await fetch(a, {
|
|
754
690
|
method: "POST",
|
|
755
691
|
headers: { "Content-Type": "application/json" },
|
|
756
692
|
body: JSON.stringify({
|
|
757
693
|
action: "UPDATE_PAGE",
|
|
758
|
-
data: { id:
|
|
694
|
+
data: { id: u, blocks: o }
|
|
759
695
|
})
|
|
760
|
-
})).ok ? (
|
|
696
|
+
})).ok ? (s({
|
|
761
697
|
title: "Success",
|
|
762
698
|
description: "Page saved successfully",
|
|
763
699
|
variant: "default"
|
|
764
700
|
}), !0) : new Error("Failed to save blocks");
|
|
765
|
-
} catch (
|
|
766
|
-
return
|
|
701
|
+
} catch (d) {
|
|
702
|
+
return d;
|
|
767
703
|
}
|
|
768
704
|
} };
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
705
|
+
};
|
|
706
|
+
function je() {
|
|
707
|
+
const [a, s] = R(
|
|
708
|
+
new URLSearchParams(window.location.search)
|
|
709
|
+
);
|
|
710
|
+
return me(() => {
|
|
711
|
+
const l = () => {
|
|
712
|
+
s(new URLSearchParams(window.location.search));
|
|
713
|
+
};
|
|
714
|
+
return window.addEventListener("popstate", l), () => {
|
|
715
|
+
window.removeEventListener("popstate", l);
|
|
716
|
+
};
|
|
717
|
+
}, []), [a, s];
|
|
718
|
+
}
|
|
719
|
+
const tt = () => {
|
|
720
|
+
const a = A();
|
|
721
|
+
return W({
|
|
772
722
|
queryKey: ["project-pages"],
|
|
773
|
-
|
|
774
|
-
queryFn: async () => await (await fetch(
|
|
723
|
+
staleTime: 1e3 * 60 * 5,
|
|
724
|
+
queryFn: async () => await (await fetch(a, {
|
|
775
725
|
method: "POST",
|
|
776
726
|
headers: {
|
|
777
727
|
"Content-Type": "application/json"
|
|
@@ -781,13 +731,13 @@ const Tt = () => {
|
|
|
781
731
|
})
|
|
782
732
|
})).json()
|
|
783
733
|
});
|
|
784
|
-
},
|
|
785
|
-
const [
|
|
786
|
-
return { data:
|
|
787
|
-
() =>
|
|
788
|
-
[
|
|
789
|
-
), isFetching:
|
|
790
|
-
},
|
|
734
|
+
}, Fe = () => {
|
|
735
|
+
const [a] = je(), s = a.get("page"), { data: l, isFetching: n } = tt();
|
|
736
|
+
return { data: V(
|
|
737
|
+
() => H(l, { id: s }) || {},
|
|
738
|
+
[l, s]
|
|
739
|
+
), isFetching: n };
|
|
740
|
+
}, Ya = () => W({
|
|
791
741
|
queryKey: ["uiLibraries"],
|
|
792
742
|
initialData: [],
|
|
793
743
|
queryFn: async () => [
|
|
@@ -802,97 +752,113 @@ const Tt = () => {
|
|
|
802
752
|
url: "https://chaibuilder.com/chaiblocks"
|
|
803
753
|
}
|
|
804
754
|
]
|
|
805
|
-
}),
|
|
806
|
-
|
|
755
|
+
}), Ha = () => {
|
|
756
|
+
const [a] = je(), s = a.get("page"), l = A(), { setAiContext: n } = et();
|
|
757
|
+
return W({
|
|
758
|
+
queryKey: ["page", s],
|
|
759
|
+
initialData: [],
|
|
760
|
+
queryFn: async () => {
|
|
761
|
+
const o = (await (await fetch(`${l}`, {
|
|
762
|
+
method: "POST",
|
|
763
|
+
headers: { "Content-Type": "application/json" },
|
|
764
|
+
body: JSON.stringify({
|
|
765
|
+
action: "GET_PAGE",
|
|
766
|
+
data: { id: s, draft: !0 }
|
|
767
|
+
})
|
|
768
|
+
})).json()).blocks ?? [], d = H(o, { _type: "@chai/ai-context" });
|
|
769
|
+
return n($(d, "_value", "") || ""), o;
|
|
770
|
+
},
|
|
771
|
+
enabled: !!s
|
|
772
|
+
});
|
|
773
|
+
}, Qa = (a) => V(() => {
|
|
774
|
+
if (!a || I(a))
|
|
807
775
|
return {
|
|
808
776
|
blocks: [],
|
|
809
777
|
theme: {}
|
|
810
778
|
};
|
|
811
|
-
const
|
|
812
|
-
|
|
813
|
-
(
|
|
779
|
+
const s = H(a, { _type: "@chai/theme" }), l = $(s, "_value", {}) || {}, n = U(
|
|
780
|
+
a,
|
|
781
|
+
(r) => !he(r == null ? void 0 : r._type, "@chai/")
|
|
814
782
|
);
|
|
815
|
-
return { theme:
|
|
816
|
-
}, [
|
|
817
|
-
const
|
|
818
|
-
return
|
|
783
|
+
return { theme: l, blocks: n };
|
|
784
|
+
}, [a]), It = () => {
|
|
785
|
+
const a = A();
|
|
786
|
+
return W({
|
|
819
787
|
queryKey: ["project-config"],
|
|
820
|
-
initialData: {
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
788
|
+
initialData: {
|
|
789
|
+
theme: {},
|
|
790
|
+
fallbackLang: "",
|
|
791
|
+
languages: []
|
|
792
|
+
},
|
|
793
|
+
queryFn: async () => {
|
|
794
|
+
try {
|
|
795
|
+
const l = await (await fetch(a, {
|
|
796
|
+
method: "POST",
|
|
797
|
+
headers: {
|
|
798
|
+
"Content-Type": "application/json"
|
|
799
|
+
},
|
|
800
|
+
body: JSON.stringify({ action: "GET_PROJECT_CONFIG" })
|
|
801
|
+
})).json();
|
|
802
|
+
if (l != null && l.error) throw "";
|
|
803
|
+
return l;
|
|
804
|
+
} catch {
|
|
805
|
+
return {
|
|
806
|
+
fallbackLang: "fr",
|
|
807
|
+
languages: ["en"],
|
|
808
|
+
theme: {}
|
|
809
|
+
};
|
|
810
|
+
}
|
|
811
|
+
}
|
|
828
812
|
});
|
|
829
|
-
},
|
|
830
|
-
const { data:
|
|
813
|
+
}, Xa = () => {
|
|
814
|
+
const { data: a } = tt(), s = A();
|
|
831
815
|
return {
|
|
832
816
|
getGlobalBlocks: async () => {
|
|
833
|
-
const
|
|
834
|
-
for (const
|
|
835
|
-
|
|
836
|
-
name:
|
|
817
|
+
const l = {};
|
|
818
|
+
for (const n of a ?? [])
|
|
819
|
+
I(n == null ? void 0 : n.slug) && (l[n.id] = {
|
|
820
|
+
name: Ba(n.name ?? n.slug),
|
|
837
821
|
description: ""
|
|
838
822
|
});
|
|
839
|
-
return
|
|
823
|
+
return l;
|
|
840
824
|
},
|
|
841
|
-
getGlobalBlockBlocks: async (
|
|
825
|
+
getGlobalBlockBlocks: async (l) => l ? (await (await fetch(`${s}`, {
|
|
842
826
|
method: "POST",
|
|
843
827
|
headers: { "Content-Type": "application/json" },
|
|
844
828
|
body: JSON.stringify({
|
|
845
829
|
action: "GET_PAGE",
|
|
846
|
-
data: { id:
|
|
830
|
+
data: { id: l, draft: !0 }
|
|
847
831
|
})
|
|
848
832
|
})).json()).blocks : []
|
|
849
833
|
};
|
|
850
|
-
},
|
|
851
|
-
const
|
|
852
|
-
return { uploadFile: async (
|
|
853
|
-
const
|
|
854
|
-
return
|
|
834
|
+
}, Za = () => {
|
|
835
|
+
const a = A();
|
|
836
|
+
return { uploadFile: async (l) => {
|
|
837
|
+
const n = new FormData();
|
|
838
|
+
return n.append("action", "UPLOAD_FILE"), n.append("file", l), (await fetch(a, {
|
|
855
839
|
method: "POST",
|
|
856
|
-
body:
|
|
840
|
+
body: n
|
|
857
841
|
})).json();
|
|
858
842
|
} };
|
|
859
|
-
},
|
|
860
|
-
const
|
|
861
|
-
return
|
|
862
|
-
|
|
863
|
-
method: "POST",
|
|
864
|
-
headers: { "Content-Type": "application/json" },
|
|
865
|
-
body: JSON.stringify({
|
|
866
|
-
action: "PUBLISH_PAGE",
|
|
867
|
-
data: { id: o }
|
|
868
|
-
})
|
|
869
|
-
})).json(),
|
|
870
|
-
onSuccess: () => {
|
|
871
|
-
i({
|
|
872
|
-
title: "Pages published",
|
|
873
|
-
description: "Your page has been published"
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
});
|
|
877
|
-
}, qe = () => {
|
|
878
|
-
const r = A(), [i] = H(), o = i.get("page");
|
|
879
|
-
return ne({
|
|
880
|
-
queryKey: ["language-pages", o],
|
|
843
|
+
}, at = () => {
|
|
844
|
+
const a = A(), [s] = je(), l = s.get("page");
|
|
845
|
+
return W({
|
|
846
|
+
queryKey: ["language-pages", l],
|
|
881
847
|
initialData: [],
|
|
882
848
|
queryFn: async () => {
|
|
883
|
-
if (!
|
|
884
|
-
const
|
|
849
|
+
if (!l) return null;
|
|
850
|
+
const r = await (await fetch(a, {
|
|
885
851
|
method: "POST",
|
|
886
852
|
headers: { "Content-Type": "application/json" },
|
|
887
853
|
body: JSON.stringify({
|
|
888
854
|
action: "GET_LANGUAGE_PAGES",
|
|
889
|
-
data: { id:
|
|
855
|
+
data: { id: l }
|
|
890
856
|
})
|
|
891
857
|
})).json();
|
|
892
|
-
return
|
|
858
|
+
return Ga(qa(r, "primaryPage"));
|
|
893
859
|
}
|
|
894
860
|
});
|
|
895
|
-
},
|
|
861
|
+
}, fe = {
|
|
896
862
|
ab: "Abkhazian",
|
|
897
863
|
aa: "Afar",
|
|
898
864
|
af: "Afrikaans",
|
|
@@ -1080,99 +1046,159 @@ const Tt = () => {
|
|
|
1080
1046
|
yo: "Yoruba",
|
|
1081
1047
|
za: "Zhuang, Chuang",
|
|
1082
1048
|
zu: "Zulu"
|
|
1083
|
-
},
|
|
1084
|
-
const
|
|
1049
|
+
}, Ut = () => {
|
|
1050
|
+
const a = A(), s = Q(), { toast: l } = ie();
|
|
1085
1051
|
return re({
|
|
1086
|
-
mutationFn: async (
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1052
|
+
mutationFn: async (n) => {
|
|
1053
|
+
var o;
|
|
1054
|
+
const u = await (await fetch(a, {
|
|
1055
|
+
method: "POST",
|
|
1056
|
+
headers: {
|
|
1057
|
+
"Content-Type": "application/json"
|
|
1058
|
+
},
|
|
1059
|
+
body: JSON.stringify({
|
|
1060
|
+
action: "CREATE_PAGE",
|
|
1061
|
+
data: n
|
|
1062
|
+
})
|
|
1063
|
+
})).json();
|
|
1064
|
+
if (u != null && u.error)
|
|
1065
|
+
throw new Error(((o = u == null ? void 0 : u.error) == null ? void 0 : o.message) || "Something went wrong.");
|
|
1066
|
+
return u;
|
|
1067
|
+
},
|
|
1068
|
+
onSuccess: (n, r) => {
|
|
1069
|
+
r && (r != null && r.primaryPage) ? s.invalidateQueries({
|
|
1070
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1071
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1072
|
+
title: `New ${r.global ? "global block" : "page"} added successfully.`
|
|
1101
1073
|
});
|
|
1102
1074
|
},
|
|
1103
|
-
onError: (
|
|
1104
|
-
|
|
1075
|
+
onError: (n, r) => {
|
|
1076
|
+
l({
|
|
1105
1077
|
variant: "destructive",
|
|
1106
|
-
title: `Failed to add new ${
|
|
1107
|
-
description:
|
|
1078
|
+
title: `Failed to add new ${r.global ? "global block" : "page"}.`,
|
|
1079
|
+
description: n.message
|
|
1108
1080
|
});
|
|
1109
1081
|
}
|
|
1110
1082
|
});
|
|
1111
|
-
},
|
|
1112
|
-
const
|
|
1083
|
+
}, nt = () => {
|
|
1084
|
+
const a = A(), s = Q(), { toast: l } = ie();
|
|
1113
1085
|
return re({
|
|
1114
|
-
mutationFn: async (
|
|
1086
|
+
mutationFn: async (n) => (await fetch(a, {
|
|
1115
1087
|
method: "POST",
|
|
1116
1088
|
headers: {
|
|
1117
1089
|
"Content-Type": "application/json"
|
|
1118
1090
|
},
|
|
1119
1091
|
body: JSON.stringify({
|
|
1120
1092
|
action: "UPDATE_PAGE",
|
|
1121
|
-
data:
|
|
1093
|
+
data: n
|
|
1122
1094
|
})
|
|
1123
1095
|
})).json(),
|
|
1124
|
-
onSuccess: (
|
|
1125
|
-
|
|
1126
|
-
queryKey: ["language-pages",
|
|
1127
|
-
}) :
|
|
1096
|
+
onSuccess: (n, r) => {
|
|
1097
|
+
r && (r != null && r.primaryPage || r != null && r.seo) ? s.invalidateQueries({
|
|
1098
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1099
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), r != null && r.seo ? l({
|
|
1128
1100
|
title: "SEO Settings updated successfully."
|
|
1129
|
-
}) :
|
|
1130
|
-
title: `${
|
|
1101
|
+
}) : l({
|
|
1102
|
+
title: `${r.global ? "Global block" : "Page"} updated successfully.`
|
|
1131
1103
|
});
|
|
1132
1104
|
},
|
|
1133
|
-
onError: (
|
|
1134
|
-
|
|
1105
|
+
onError: (n, r) => {
|
|
1106
|
+
l({
|
|
1135
1107
|
variant: "destructive",
|
|
1136
|
-
title: `Failed to update ${
|
|
1137
|
-
description:
|
|
1108
|
+
title: `Failed to update ${r.global ? "global block" : "page"}.`,
|
|
1109
|
+
description: n.message
|
|
1138
1110
|
});
|
|
1139
1111
|
}
|
|
1140
1112
|
});
|
|
1141
|
-
},
|
|
1142
|
-
const
|
|
1113
|
+
}, Bt = () => {
|
|
1114
|
+
const a = A(), s = Q(), { toast: l } = ie();
|
|
1143
1115
|
return re({
|
|
1144
|
-
mutationFn: async (
|
|
1116
|
+
mutationFn: async (n) => (await fetch(a, {
|
|
1145
1117
|
method: "POST",
|
|
1146
1118
|
headers: {
|
|
1147
1119
|
"Content-Type": "application/json"
|
|
1148
1120
|
},
|
|
1149
1121
|
body: JSON.stringify({
|
|
1150
1122
|
action: "DELETE_PAGE",
|
|
1151
|
-
data: { id:
|
|
1123
|
+
data: { id: n == null ? void 0 : n.id }
|
|
1152
1124
|
})
|
|
1153
1125
|
})).json(),
|
|
1154
|
-
onSuccess: (
|
|
1155
|
-
|
|
1156
|
-
queryKey: ["language-pages",
|
|
1157
|
-
}) :
|
|
1158
|
-
title: `${
|
|
1126
|
+
onSuccess: (n, r) => {
|
|
1127
|
+
r && (r != null && r.primaryPage) ? s.invalidateQueries({
|
|
1128
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1129
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1130
|
+
title: `${r.global ? "Global block" : "Page"} deleted successfully.`
|
|
1159
1131
|
});
|
|
1160
1132
|
},
|
|
1161
|
-
onError: (
|
|
1162
|
-
|
|
1133
|
+
onError: (n, r) => {
|
|
1134
|
+
l({
|
|
1163
1135
|
variant: "destructive",
|
|
1164
|
-
title: `Failed to delete ${
|
|
1165
|
-
description:
|
|
1136
|
+
title: `Failed to delete ${r.global ? "global block" : "page"}.`,
|
|
1137
|
+
description: n.message
|
|
1166
1138
|
});
|
|
1167
1139
|
}
|
|
1168
1140
|
});
|
|
1169
|
-
},
|
|
1170
|
-
const
|
|
1171
|
-
return
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1141
|
+
}, en = () => {
|
|
1142
|
+
const a = A(), s = Q(), { toast: l } = ie();
|
|
1143
|
+
return re({
|
|
1144
|
+
mutationFn: async (n) => {
|
|
1145
|
+
const u = await (await fetch(a, {
|
|
1146
|
+
method: "POST",
|
|
1147
|
+
headers: {
|
|
1148
|
+
"Content-Type": "application/json"
|
|
1149
|
+
},
|
|
1150
|
+
body: JSON.stringify({
|
|
1151
|
+
action: "TAKE_OFFLINE",
|
|
1152
|
+
data: { id: n == null ? void 0 : n.id }
|
|
1153
|
+
})
|
|
1154
|
+
})).json();
|
|
1155
|
+
if (u != null && u.error) throw u == null ? void 0 : u.error;
|
|
1156
|
+
return u;
|
|
1157
|
+
},
|
|
1158
|
+
onSuccess: (n, r) => {
|
|
1159
|
+
r && (r != null && r.primaryPage) ? s.invalidateQueries({
|
|
1160
|
+
queryKey: ["language-pages", r == null ? void 0 : r.primaryPage]
|
|
1161
|
+
}) : s.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1162
|
+
title: `${r.global ? "Global block" : "Page"} taken offline successfully.`
|
|
1163
|
+
});
|
|
1164
|
+
},
|
|
1165
|
+
onError: (n, r) => {
|
|
1166
|
+
l({
|
|
1167
|
+
variant: "destructive",
|
|
1168
|
+
title: `Failed to take offline ${r.global ? "global block" : "page"}.`,
|
|
1169
|
+
description: n.message
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
});
|
|
1173
|
+
}, tn = () => {
|
|
1174
|
+
const a = A(), { toast: s } = ie(), l = Q();
|
|
1175
|
+
return re({
|
|
1176
|
+
mutationFn: async ({ ids: n, theme: r }) => {
|
|
1177
|
+
const o = await (await fetch(`${a}`, {
|
|
1178
|
+
method: "POST",
|
|
1179
|
+
headers: { "Content-Type": "application/json" },
|
|
1180
|
+
body: JSON.stringify({
|
|
1181
|
+
action: "PUBLISH_CHANGES",
|
|
1182
|
+
data: { ids: n, theme: r }
|
|
1183
|
+
})
|
|
1184
|
+
})).json();
|
|
1185
|
+
if (o != null && o.error) throw o == null ? void 0 : o.error;
|
|
1186
|
+
return o;
|
|
1187
|
+
},
|
|
1188
|
+
onSuccess: () => {
|
|
1189
|
+
s({ title: "Pages published" }), l.invalidateQueries({ queryKey: ["get-page-changes"] }), l.invalidateQueries({ queryKey: ["project-pages"] });
|
|
1190
|
+
},
|
|
1191
|
+
onError: () => {
|
|
1192
|
+
s({ title: "Failed to publish pages.", variant: "destructive" });
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1195
|
+
}, an = () => {
|
|
1196
|
+
const { selectedLang: a } = Ze(), { data: s, isFetching: l } = at();
|
|
1197
|
+
return { data: V(() => H(s, { lang: a || "" }) || {}, [s, a]), isFetching: l };
|
|
1198
|
+
}, Gt = () => {
|
|
1199
|
+
const { data: a, isFetching: s } = an(), l = a == null ? void 0 : a.seo, [n, r] = R({
|
|
1200
|
+
title: "",
|
|
1201
|
+
description: "",
|
|
1176
1202
|
cononicalUrl: "",
|
|
1177
1203
|
noIndex: !1,
|
|
1178
1204
|
noFollow: "",
|
|
@@ -1182,12 +1208,12 @@ const Tt = () => {
|
|
|
1182
1208
|
searchTitle: "",
|
|
1183
1209
|
searchDescription: "",
|
|
1184
1210
|
jsonLD: "",
|
|
1185
|
-
...
|
|
1186
|
-
}),
|
|
1187
|
-
|
|
1188
|
-
!
|
|
1189
|
-
|
|
1190
|
-
|
|
1211
|
+
...l
|
|
1212
|
+
}), u = Rt({ initial: n, updated: n }), { selectedLang: o, fallbackLang: d } = Ze(), f = o.length ? o : d, { mutate: p, isPending: x } = nt(), b = x;
|
|
1213
|
+
me(() => {
|
|
1214
|
+
!s && l && r({
|
|
1215
|
+
title: "",
|
|
1216
|
+
description: "",
|
|
1191
1217
|
cononicalUrl: "",
|
|
1192
1218
|
noIndex: !1,
|
|
1193
1219
|
noFollow: "",
|
|
@@ -1197,629 +1223,759 @@ const Tt = () => {
|
|
|
1197
1223
|
searchTitle: "",
|
|
1198
1224
|
searchDescription: "",
|
|
1199
1225
|
jsonLD: "",
|
|
1200
|
-
...
|
|
1226
|
+
...l
|
|
1201
1227
|
});
|
|
1202
|
-
}, [
|
|
1203
|
-
const
|
|
1204
|
-
p({ id:
|
|
1205
|
-
},
|
|
1206
|
-
|
|
1207
|
-
...
|
|
1208
|
-
ogTitle:
|
|
1209
|
-
ogDescription:
|
|
1228
|
+
}, [s, l]);
|
|
1229
|
+
const w = async () => {
|
|
1230
|
+
p({ id: a == null ? void 0 : a.id, seo: n }), u.current.initial = n, u.current.updated = n;
|
|
1231
|
+
}, E = () => {
|
|
1232
|
+
r({
|
|
1233
|
+
...n,
|
|
1234
|
+
ogTitle: n.title,
|
|
1235
|
+
ogDescription: n.description
|
|
1210
1236
|
});
|
|
1211
|
-
},
|
|
1212
|
-
|
|
1213
|
-
...
|
|
1214
|
-
searchTitle:
|
|
1215
|
-
searchDescription:
|
|
1237
|
+
}, h = () => {
|
|
1238
|
+
r({
|
|
1239
|
+
...n,
|
|
1240
|
+
searchTitle: n.ogTitle,
|
|
1241
|
+
searchDescription: n.ogDescription
|
|
1216
1242
|
});
|
|
1217
|
-
},
|
|
1218
|
-
const
|
|
1219
|
-
...
|
|
1220
|
-
[
|
|
1243
|
+
}, g = (C) => {
|
|
1244
|
+
const y = {
|
|
1245
|
+
...n,
|
|
1246
|
+
[C.target.name]: C.target.name === "noIndex" || C.target.name === "noFollow" ? C.target.checked : C.target.value
|
|
1221
1247
|
};
|
|
1222
|
-
|
|
1248
|
+
r(y), u.current.updated = y;
|
|
1223
1249
|
};
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1250
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative pb-40", children: [
|
|
1251
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-center", children: [
|
|
1226
1252
|
"Current language:",
|
|
1227
1253
|
" ",
|
|
1228
|
-
/* @__PURE__ */
|
|
1254
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-blue-500 font-semibold", children: $(fe, f, f) }),
|
|
1255
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-[11px] text-gray-500", children: [
|
|
1256
|
+
" ",
|
|
1257
|
+
"( ",
|
|
1258
|
+
a == null ? void 0 : a.slug,
|
|
1259
|
+
" )"
|
|
1260
|
+
] })
|
|
1229
1261
|
] }),
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
|
|
1262
|
+
/* @__PURE__ */ e.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ e.jsxs(At, { type: "multiple", defaultValue: ["page"], children: [
|
|
1263
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "page", children: [
|
|
1264
|
+
/* @__PURE__ */ e.jsx(ne, { className: "text-blue-500", children: "Seo Page" }),
|
|
1265
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1266
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1267
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "title", children: "SEO Title" }),
|
|
1268
|
+
/* @__PURE__ */ e.jsx(
|
|
1269
|
+
M,
|
|
1238
1270
|
{
|
|
1239
1271
|
type: "text",
|
|
1240
|
-
id: "
|
|
1241
|
-
name: "
|
|
1242
|
-
value:
|
|
1243
|
-
onChange:
|
|
1244
|
-
disabled:
|
|
1272
|
+
id: "title",
|
|
1273
|
+
name: "title",
|
|
1274
|
+
value: n.title,
|
|
1275
|
+
onChange: g,
|
|
1276
|
+
disabled: b,
|
|
1245
1277
|
placeholder: "Enter SEO title"
|
|
1246
1278
|
}
|
|
1247
1279
|
),
|
|
1248
|
-
/* @__PURE__ */
|
|
1280
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The title should be between 10 and 60 characters." })
|
|
1249
1281
|
] }),
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
|
|
1282
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1283
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "description", children: "SEO Description" }),
|
|
1284
|
+
/* @__PURE__ */ e.jsx(
|
|
1285
|
+
Re,
|
|
1254
1286
|
{
|
|
1255
|
-
id: "
|
|
1256
|
-
name: "
|
|
1257
|
-
value:
|
|
1258
|
-
onChange:
|
|
1259
|
-
disabled:
|
|
1287
|
+
id: "description",
|
|
1288
|
+
name: "description",
|
|
1289
|
+
value: n.description,
|
|
1290
|
+
onChange: g,
|
|
1291
|
+
disabled: b,
|
|
1260
1292
|
placeholder: "Enter SEO description"
|
|
1261
1293
|
}
|
|
1262
1294
|
),
|
|
1263
|
-
/* @__PURE__ */
|
|
1295
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The description should be between 50 and 160 characters." })
|
|
1264
1296
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
|
|
1297
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1298
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "title", children: "Canonical URL" }),
|
|
1299
|
+
/* @__PURE__ */ e.jsx(
|
|
1300
|
+
M,
|
|
1269
1301
|
{
|
|
1270
1302
|
type: "text",
|
|
1271
1303
|
id: "canonicalUrl",
|
|
1272
1304
|
name: "canonicalUrl",
|
|
1273
|
-
value:
|
|
1274
|
-
onChange:
|
|
1275
|
-
disabled:
|
|
1305
|
+
value: n.canonicalUrl,
|
|
1306
|
+
onChange: g,
|
|
1307
|
+
disabled: b,
|
|
1276
1308
|
placeholder: "Enter Canonical URL"
|
|
1277
1309
|
}
|
|
1278
1310
|
)
|
|
1279
1311
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
|
|
1312
|
+
/* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
1313
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1314
|
+
/* @__PURE__ */ e.jsx(
|
|
1315
|
+
M,
|
|
1284
1316
|
{
|
|
1285
1317
|
type: "checkbox",
|
|
1286
1318
|
id: "noIndex",
|
|
1287
1319
|
name: "noIndex",
|
|
1288
|
-
checked:
|
|
1289
|
-
onChange:
|
|
1290
|
-
disabled:
|
|
1320
|
+
checked: n.noIndex,
|
|
1321
|
+
onChange: g,
|
|
1322
|
+
disabled: b,
|
|
1291
1323
|
className: "h-4 w-4"
|
|
1292
1324
|
}
|
|
1293
1325
|
),
|
|
1294
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
|
|
1295
1327
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1328
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to index this page." })
|
|
1297
1329
|
] }),
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1330
|
+
/* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
1331
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1332
|
+
/* @__PURE__ */ e.jsx(
|
|
1333
|
+
M,
|
|
1334
|
+
{
|
|
1335
|
+
type: "checkbox",
|
|
1336
|
+
id: "noFollow",
|
|
1337
|
+
name: "noFollow",
|
|
1338
|
+
checked: n.noFollow,
|
|
1339
|
+
onChange: g,
|
|
1340
|
+
disabled: b,
|
|
1341
|
+
className: "h-4 w-4"
|
|
1342
|
+
}
|
|
1343
|
+
),
|
|
1344
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Follow" })
|
|
1345
|
+
] }),
|
|
1346
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-2 text-[10px] font-light text-gray-400", children: "Check this if you don't want search engines to follow links on this page." })
|
|
1312
1347
|
] })
|
|
1313
1348
|
] }) })
|
|
1314
1349
|
] }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
|
|
1350
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "og", children: [
|
|
1351
|
+
/* @__PURE__ */ e.jsx(ne, { className: "text-blue-500", children: "OG" }),
|
|
1352
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1353
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
|
|
1354
|
+
_,
|
|
1320
1355
|
{
|
|
1321
1356
|
type: "button",
|
|
1322
1357
|
variant: "outline",
|
|
1323
1358
|
size: "sm",
|
|
1324
|
-
onClick:
|
|
1359
|
+
onClick: E,
|
|
1325
1360
|
children: "Copy from SEO Settings"
|
|
1326
1361
|
}
|
|
1327
1362
|
) }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
|
|
1363
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1364
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
|
|
1365
|
+
/* @__PURE__ */ e.jsx(
|
|
1366
|
+
M,
|
|
1332
1367
|
{
|
|
1333
1368
|
type: "text",
|
|
1334
1369
|
id: "ogTitle",
|
|
1335
1370
|
name: "ogTitle",
|
|
1336
|
-
value:
|
|
1337
|
-
onChange:
|
|
1338
|
-
disabled:
|
|
1371
|
+
value: n.ogTitle,
|
|
1372
|
+
onChange: g,
|
|
1373
|
+
disabled: b,
|
|
1339
1374
|
placeholder: "Enter OG title"
|
|
1340
1375
|
}
|
|
1341
1376
|
),
|
|
1342
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG title should be between 10 and 60 characters." })
|
|
1343
1378
|
] }),
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
|
|
1379
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
|
|
1380
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
|
|
1381
|
+
/* @__PURE__ */ e.jsx(
|
|
1382
|
+
Re,
|
|
1348
1383
|
{
|
|
1349
1384
|
id: "ogDescription",
|
|
1350
1385
|
name: "ogDescription",
|
|
1351
|
-
value:
|
|
1352
|
-
onChange:
|
|
1353
|
-
disabled:
|
|
1386
|
+
value: n.ogDescription,
|
|
1387
|
+
onChange: g,
|
|
1388
|
+
disabled: b,
|
|
1354
1389
|
placeholder: "Enter OG description"
|
|
1355
1390
|
}
|
|
1356
1391
|
),
|
|
1357
|
-
/* @__PURE__ */
|
|
1392
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The OG description should be between 50 and 160 characters." })
|
|
1358
1393
|
] }),
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
|
|
1394
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
|
|
1395
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
|
|
1396
|
+
/* @__PURE__ */ e.jsx(
|
|
1397
|
+
M,
|
|
1363
1398
|
{
|
|
1364
1399
|
type: "text",
|
|
1365
1400
|
id: "ogImage",
|
|
1366
1401
|
name: "ogImage",
|
|
1367
|
-
value:
|
|
1368
|
-
onChange:
|
|
1369
|
-
disabled:
|
|
1402
|
+
value: n.ogImage,
|
|
1403
|
+
onChange: g,
|
|
1404
|
+
disabled: b,
|
|
1370
1405
|
placeholder: "Enter OG image URL"
|
|
1371
1406
|
}
|
|
1372
1407
|
),
|
|
1373
|
-
/* @__PURE__ */
|
|
1408
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "Enter a valid URL for the OG image." })
|
|
1374
1409
|
] })
|
|
1375
1410
|
] }) })
|
|
1376
1411
|
] }),
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
|
|
1412
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "search", children: [
|
|
1413
|
+
/* @__PURE__ */ e.jsx(ne, { className: "text-blue-500", children: "Search" }),
|
|
1414
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1415
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
|
|
1416
|
+
_,
|
|
1382
1417
|
{
|
|
1383
1418
|
type: "button",
|
|
1384
1419
|
variant: "outline",
|
|
1385
1420
|
size: "sm",
|
|
1386
|
-
onClick:
|
|
1421
|
+
onClick: h,
|
|
1387
1422
|
children: "Copy from OG Settings"
|
|
1388
1423
|
}
|
|
1389
1424
|
) }),
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
|
|
1425
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1426
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
|
|
1427
|
+
/* @__PURE__ */ e.jsx(
|
|
1428
|
+
M,
|
|
1394
1429
|
{
|
|
1395
1430
|
type: "text",
|
|
1396
1431
|
id: "searchTitle",
|
|
1397
1432
|
name: "searchTitle",
|
|
1398
|
-
value:
|
|
1399
|
-
onChange:
|
|
1400
|
-
disabled:
|
|
1433
|
+
value: n.searchTitle,
|
|
1434
|
+
onChange: g,
|
|
1435
|
+
disabled: b,
|
|
1401
1436
|
placeholder: "Enter search title"
|
|
1402
1437
|
}
|
|
1403
1438
|
),
|
|
1404
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search title should be between 10 and 60 characters." })
|
|
1405
1440
|
] }),
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
|
|
1441
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1442
|
+
/* @__PURE__ */ e.jsx(F, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
|
|
1443
|
+
/* @__PURE__ */ e.jsx(
|
|
1444
|
+
Re,
|
|
1410
1445
|
{
|
|
1411
1446
|
id: "searchDescription",
|
|
1412
1447
|
name: "searchDescription",
|
|
1413
|
-
value:
|
|
1414
|
-
onChange:
|
|
1448
|
+
value: n.searchDescription,
|
|
1449
|
+
onChange: g,
|
|
1415
1450
|
placeholder: "Enter search description"
|
|
1416
1451
|
}
|
|
1417
1452
|
),
|
|
1418
|
-
/* @__PURE__ */
|
|
1453
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "The search description should be between 50 and 160 characters." })
|
|
1419
1454
|
] })
|
|
1420
1455
|
] }) })
|
|
1421
1456
|
] }),
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
|
|
1457
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "jsonLD", children: [
|
|
1458
|
+
/* @__PURE__ */ e.jsx(ne, { className: "text-blue-500", children: "JSON-LD" }),
|
|
1459
|
+
/* @__PURE__ */ e.jsx(se, { children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
1460
|
+
Re,
|
|
1426
1461
|
{
|
|
1427
1462
|
id: "jsonLD",
|
|
1428
1463
|
name: "jsonLD",
|
|
1429
1464
|
rows: 3,
|
|
1430
|
-
value:
|
|
1431
|
-
onChange:
|
|
1465
|
+
value: n.jsonLD,
|
|
1466
|
+
onChange: g,
|
|
1432
1467
|
placeholder: "Enter JSON-LD"
|
|
1433
1468
|
}
|
|
1434
1469
|
) }) }) })
|
|
1435
1470
|
] })
|
|
1436
1471
|
] }) }),
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
|
|
1472
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ e.jsx(
|
|
1473
|
+
_,
|
|
1439
1474
|
{
|
|
1440
1475
|
size: "lg",
|
|
1441
1476
|
variant: "default",
|
|
1442
|
-
onClick:
|
|
1443
|
-
disabled:
|
|
1444
|
-
children:
|
|
1477
|
+
onClick: w,
|
|
1478
|
+
disabled: He(u.current.initial, n) || b,
|
|
1479
|
+
children: x ? "Saving..." : "Save"
|
|
1445
1480
|
}
|
|
1446
1481
|
) })
|
|
1447
1482
|
] });
|
|
1448
1483
|
};
|
|
1449
|
-
|
|
1450
|
-
const
|
|
1451
|
-
langProps:
|
|
1452
|
-
onClose:
|
|
1453
|
-
|
|
1484
|
+
Gt.displayName = "SeoPanel";
|
|
1485
|
+
const nn = ({
|
|
1486
|
+
langProps: a,
|
|
1487
|
+
onClose: s,
|
|
1488
|
+
languages: l
|
|
1454
1489
|
}) => {
|
|
1455
|
-
const { data:
|
|
1456
|
-
|
|
1457
|
-
(
|
|
1458
|
-
), D = () => {
|
|
1459
|
-
r.edit ? h(
|
|
1460
|
-
{
|
|
1461
|
-
name: s,
|
|
1462
|
-
slug: u,
|
|
1463
|
-
lang: c,
|
|
1464
|
-
id: r == null ? void 0 : r.id,
|
|
1465
|
-
primaryPage: r == null ? void 0 : r.primaryPage
|
|
1466
|
-
},
|
|
1467
|
-
{ onSuccess: i }
|
|
1468
|
-
) : g(
|
|
1469
|
-
{
|
|
1470
|
-
name: s,
|
|
1471
|
-
slug: u,
|
|
1472
|
-
lang: c,
|
|
1473
|
-
primaryPage: a == null ? void 0 : a.id
|
|
1474
|
-
},
|
|
1475
|
-
{ onSuccess: i }
|
|
1476
|
-
);
|
|
1490
|
+
const { data: n } = Fe(), [r, u] = R(a.name || ""), [o, d] = R(a.edit ? a.lang : ""), [f, p] = R(a.edit ? a.slug : ""), { mutate: x, isPending: b } = Ut(), { mutate: w, isPending: E } = nt(), h = !!(a != null && a.global), g = b || E, C = () => {
|
|
1491
|
+
const y = { name: r, lang: o, primaryPage: n == null ? void 0 : n.id, slug: f };
|
|
1492
|
+
y.global = h, a.edit && (y.id = a == null ? void 0 : a.id), a.edit ? w(y, { onSuccess: s }) : x(y, { onSuccess: s });
|
|
1477
1493
|
};
|
|
1478
|
-
return /* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ e.jsx(ge, { open: !!a, onOpenChange: s, children: /* @__PURE__ */ e.jsxs(xe, { className: "sm:max-w-[425px]", children: [
|
|
1495
|
+
/* @__PURE__ */ e.jsxs(pe, { children: [
|
|
1496
|
+
/* @__PURE__ */ e.jsx(ve, { children: a.edit ? "Edit language" : "Add New language" }),
|
|
1497
|
+
/* @__PURE__ */ e.jsx(be, { children: "Enter the details for the language" })
|
|
1482
1498
|
] }),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1499
|
+
/* @__PURE__ */ e.jsxs("form", { children: [
|
|
1500
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1501
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1502
|
+
/* @__PURE__ */ e.jsx(F, { htmlFor: "lang", className: "text-right", children: "Language" }),
|
|
1503
|
+
/* @__PURE__ */ e.jsxs(
|
|
1488
1504
|
"select",
|
|
1489
1505
|
{
|
|
1490
|
-
value:
|
|
1491
|
-
disabled:
|
|
1492
|
-
onChange: (
|
|
1506
|
+
value: o,
|
|
1507
|
+
disabled: a.edit || I(l),
|
|
1508
|
+
onChange: (y) => {
|
|
1509
|
+
const S = y.target.value;
|
|
1510
|
+
d(S), !h && p(`/${S}`);
|
|
1511
|
+
},
|
|
1493
1512
|
className: "flex h-9 w-full rounded-md border border-border bg-background px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 col-span-3",
|
|
1494
1513
|
children: [
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
|
|
1514
|
+
/* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, selected: !0, children: a.edit ? $(fe, a.lang, a.lang) : I(l) ? "All available language page is created." : "Choose language" }),
|
|
1515
|
+
z(l, (y) => /* @__PURE__ */ e.jsx("option", { value: y, children: $(fe, y, y) }, y))
|
|
1497
1516
|
]
|
|
1498
1517
|
}
|
|
1499
1518
|
)
|
|
1500
1519
|
] }),
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
|
|
1520
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1521
|
+
/* @__PURE__ */ e.jsx(F, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
|
|
1522
|
+
/* @__PURE__ */ e.jsx(
|
|
1523
|
+
M,
|
|
1505
1524
|
{
|
|
1506
1525
|
id: "name",
|
|
1507
|
-
value:
|
|
1508
|
-
onChange: (
|
|
1526
|
+
value: r,
|
|
1527
|
+
onChange: (y) => u(y.target.value),
|
|
1509
1528
|
className: "col-span-3",
|
|
1510
1529
|
required: !0,
|
|
1511
1530
|
placeholder: "Enter page name"
|
|
1512
1531
|
}
|
|
1513
1532
|
)
|
|
1514
1533
|
] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
1534
|
+
!h && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1535
|
+
/* @__PURE__ */ e.jsxs(F, { htmlFor: "slug", className: "text-right", children: [
|
|
1517
1536
|
"Slug",
|
|
1518
1537
|
" ",
|
|
1519
|
-
/* @__PURE__ */
|
|
1538
|
+
/* @__PURE__ */ e.jsxs("small", { className: "font-light", children: [
|
|
1539
|
+
"(Slug should start with /",
|
|
1540
|
+
o,
|
|
1541
|
+
")"
|
|
1542
|
+
] })
|
|
1520
1543
|
] }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
|
|
1544
|
+
/* @__PURE__ */ e.jsx(
|
|
1545
|
+
M,
|
|
1523
1546
|
{
|
|
1524
1547
|
id: "slug",
|
|
1525
|
-
value:
|
|
1526
|
-
onChange: (
|
|
1548
|
+
value: f,
|
|
1549
|
+
onChange: (y) => {
|
|
1550
|
+
const S = y.target.value;
|
|
1551
|
+
Nt(S, `/${o}`) && p(Ma($a(S)));
|
|
1552
|
+
},
|
|
1527
1553
|
className: "col-span-3",
|
|
1528
1554
|
required: !0,
|
|
1529
1555
|
pattern: "^/.*",
|
|
1556
|
+
disabled: I(o),
|
|
1530
1557
|
title: "Slug must start with /",
|
|
1531
|
-
placeholder: "Enter page slug"
|
|
1558
|
+
placeholder: I(o) ? "Choose language to add slug" : "Enter page slug"
|
|
1532
1559
|
}
|
|
1533
1560
|
)
|
|
1534
1561
|
] })
|
|
1535
1562
|
] }),
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
|
|
1563
|
+
/* @__PURE__ */ e.jsx(ye, { children: /* @__PURE__ */ e.jsx(
|
|
1564
|
+
_,
|
|
1538
1565
|
{
|
|
1539
|
-
onClick:
|
|
1566
|
+
onClick: C,
|
|
1540
1567
|
type: "button",
|
|
1541
|
-
disabled:
|
|
1542
|
-
children:
|
|
1568
|
+
disabled: g || !o || !h && !Nt(f, `/${o}`),
|
|
1569
|
+
children: g ? a.edit ? "Updating..." : "Adding..." : a.edit ? "Update" : "Add new language"
|
|
1543
1570
|
}
|
|
1544
1571
|
) })
|
|
1545
1572
|
] })
|
|
1546
1573
|
] }) });
|
|
1547
|
-
},
|
|
1548
|
-
const [
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
] })
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1574
|
+
}, sn = () => {
|
|
1575
|
+
const [a, s] = R(null), { selectedLang: l, fallbackLang: n, setSelectedLang: r } = Ze(), { data: u, isFetching: o } = at(), { mutate: d, isPending: f } = Bt(), { data: p } = Fe(), { data: x } = It(), b = U(
|
|
1576
|
+
$(x, "languages") || ["en"],
|
|
1577
|
+
(w) => !H(u, { lang: w }) && w !== $(x, "fallbackLang")
|
|
1578
|
+
);
|
|
1579
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
1580
|
+
/* @__PURE__ */ e.jsx("ul", { className: "space-y-2 mt-4", children: o ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1581
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1582
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1583
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1584
|
+
] }) : z(u, (w) => {
|
|
1585
|
+
const E = w.lang, h = w.slug, g = !w.primaryPage, C = E === l;
|
|
1586
|
+
return g ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1587
|
+
/* @__PURE__ */ e.jsxs(
|
|
1588
|
+
"li",
|
|
1589
|
+
{
|
|
1590
|
+
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${C ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
1591
|
+
onClick: () => r(E),
|
|
1592
|
+
children: [
|
|
1593
|
+
/* @__PURE__ */ e.jsxs("div", { className: " flex-1 gap-x-3", children: [
|
|
1594
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-[13px]", children: $(fe, g ? n : E, E) }),
|
|
1595
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1596
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1597
|
+
"Slug:",
|
|
1598
|
+
/* @__PURE__ */ e.jsxs("b", { children: [
|
|
1599
|
+
" ",
|
|
1600
|
+
h
|
|
1601
|
+
] })
|
|
1602
|
+
] }),
|
|
1603
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1604
|
+
"Name:",
|
|
1605
|
+
/* @__PURE__ */ e.jsxs("b", { children: [
|
|
1606
|
+
" ",
|
|
1607
|
+
w.name,
|
|
1608
|
+
" "
|
|
1582
1609
|
] })
|
|
1583
|
-
] })
|
|
1584
|
-
] }),
|
|
1585
|
-
S ? /* @__PURE__ */ t.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1586
|
-
/* @__PURE__ */ t.jsx(wa, { fill: "orange", className: "w-3 h-3" }),
|
|
1587
|
-
/* @__PURE__ */ t.jsx("b", { children: " Default" })
|
|
1588
|
-
] }) : /* @__PURE__ */ t.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1589
|
-
/* @__PURE__ */ t.jsx(
|
|
1590
|
-
Et,
|
|
1591
|
-
{
|
|
1592
|
-
onClick: (E) => {
|
|
1593
|
-
E.stopPropagation(), i({ ...g, edit: !0 });
|
|
1594
|
-
},
|
|
1595
|
-
className: "w-3 h-3 hover:text-blue-500"
|
|
1596
|
-
}
|
|
1597
|
-
),
|
|
1598
|
-
/* @__PURE__ */ t.jsxs(gt, { children: [
|
|
1599
|
-
/* @__PURE__ */ t.jsx(mt, { children: /* @__PURE__ */ t.jsx(Ct, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1600
|
-
/* @__PURE__ */ t.jsx(vt, { children: /* @__PURE__ */ t.jsxs("div", { children: [
|
|
1601
|
-
/* @__PURE__ */ t.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1602
|
-
"Are you sure you want to remove",
|
|
1603
|
-
" ",
|
|
1604
|
-
/* @__PURE__ */ t.jsx("b", { children: q(ye, m, m) }),
|
|
1605
|
-
" language?"
|
|
1606
|
-
] }),
|
|
1607
|
-
/* @__PURE__ */ t.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ t.jsx(
|
|
1608
|
-
B,
|
|
1609
|
-
{
|
|
1610
|
-
size: "sm",
|
|
1611
|
-
variant: "destructive",
|
|
1612
|
-
disabled: p,
|
|
1613
|
-
onClick: () => u(g),
|
|
1614
|
-
children: p ? "Deleting..." : "Delete"
|
|
1615
|
-
}
|
|
1616
|
-
) })
|
|
1617
|
-
] }) })
|
|
1618
1610
|
] })
|
|
1619
1611
|
] })
|
|
1620
|
-
]
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1612
|
+
] }),
|
|
1613
|
+
g ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1614
|
+
/* @__PURE__ */ e.jsx(Ra, { fill: "orange", className: "w-3 h-3" }),
|
|
1615
|
+
/* @__PURE__ */ e.jsx("b", { children: " Default" })
|
|
1616
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1617
|
+
/* @__PURE__ */ e.jsx(
|
|
1618
|
+
Dt,
|
|
1619
|
+
{
|
|
1620
|
+
onClick: (y) => {
|
|
1621
|
+
y.stopPropagation(), s({ ...w, edit: !0 });
|
|
1622
|
+
},
|
|
1623
|
+
className: "w-3 h-3 hover:text-blue-500"
|
|
1624
|
+
}
|
|
1625
|
+
),
|
|
1626
|
+
/* @__PURE__ */ e.jsxs(ya, { children: [
|
|
1627
|
+
/* @__PURE__ */ e.jsx(ja, { children: /* @__PURE__ */ e.jsx(Ft, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1628
|
+
/* @__PURE__ */ e.jsx(wa, { children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1629
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1630
|
+
"Are you sure you want to remove",
|
|
1631
|
+
" ",
|
|
1632
|
+
/* @__PURE__ */ e.jsx("b", { children: $(fe, E, E) }),
|
|
1633
|
+
" language?"
|
|
1634
|
+
] }),
|
|
1635
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ e.jsx(
|
|
1636
|
+
_,
|
|
1637
|
+
{
|
|
1638
|
+
size: "sm",
|
|
1639
|
+
variant: "destructive",
|
|
1640
|
+
disabled: f,
|
|
1641
|
+
onClick: () => d(w),
|
|
1642
|
+
children: f ? "Deleting..." : "Delete"
|
|
1643
|
+
}
|
|
1644
|
+
) })
|
|
1645
|
+
] }) })
|
|
1646
|
+
] })
|
|
1647
|
+
] })
|
|
1648
|
+
]
|
|
1649
|
+
},
|
|
1650
|
+
w.id
|
|
1651
|
+
),
|
|
1652
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-1 w-full border-b" })
|
|
1653
|
+
] });
|
|
1654
|
+
}) }),
|
|
1655
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ e.jsx(
|
|
1656
|
+
_,
|
|
1630
1657
|
{
|
|
1631
1658
|
variant: "default",
|
|
1632
1659
|
size: "sm",
|
|
1633
|
-
|
|
1660
|
+
disabled: I(b),
|
|
1661
|
+
onClick: () => {
|
|
1662
|
+
s({
|
|
1663
|
+
name: p == null ? void 0 : p.name,
|
|
1664
|
+
global: p == null ? void 0 : p.global,
|
|
1665
|
+
lang: "",
|
|
1666
|
+
slug: "",
|
|
1667
|
+
edit: !1
|
|
1668
|
+
});
|
|
1669
|
+
},
|
|
1634
1670
|
children: "+ Add new language"
|
|
1635
1671
|
}
|
|
1636
1672
|
) }),
|
|
1637
|
-
|
|
1638
|
-
|
|
1673
|
+
a && /* @__PURE__ */ e.jsx(
|
|
1674
|
+
nn,
|
|
1639
1675
|
{
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
onClose: () =>
|
|
1676
|
+
languages: b,
|
|
1677
|
+
langProps: a,
|
|
1678
|
+
onClose: () => s(null)
|
|
1643
1679
|
}
|
|
1644
1680
|
)
|
|
1645
1681
|
] });
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1682
|
+
};
|
|
1683
|
+
function rn({
|
|
1684
|
+
page: a,
|
|
1685
|
+
onClose: s,
|
|
1686
|
+
onDelete: l
|
|
1687
|
+
}) {
|
|
1688
|
+
const { mutate: n, isPending: r } = Bt(), u = () => {
|
|
1689
|
+
n(a, {
|
|
1690
|
+
onSuccess: () => {
|
|
1691
|
+
l();
|
|
1692
|
+
}
|
|
1693
|
+
});
|
|
1694
|
+
};
|
|
1695
|
+
return /* @__PURE__ */ e.jsx(ge, { open: !!a, onOpenChange: s, children: /* @__PURE__ */ e.jsxs(xe, { children: [
|
|
1696
|
+
/* @__PURE__ */ e.jsxs(pe, { children: [
|
|
1697
|
+
/* @__PURE__ */ e.jsx(ve, { children: "Confirm Deletion" }),
|
|
1698
|
+
/* @__PURE__ */ e.jsxs(be, { children: [
|
|
1699
|
+
"Are you sure you want to remove ",
|
|
1700
|
+
/* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
|
|
1701
|
+
" ",
|
|
1702
|
+
a != null && a.global ? "global block?" : "page? This will also delete all associated language pages."
|
|
1703
|
+
] })
|
|
1704
|
+
] }),
|
|
1705
|
+
/* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1706
|
+
/* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: s, children: "Cancel" }),
|
|
1707
|
+
/* @__PURE__ */ e.jsx(_, { variant: "destructive", disabled: r, onClick: u, children: r ? "Deleting..." : "Delete" })
|
|
1708
|
+
] })
|
|
1709
|
+
] }) });
|
|
1710
|
+
}
|
|
1711
|
+
const ln = ({
|
|
1712
|
+
page: a,
|
|
1713
|
+
onClose: s,
|
|
1714
|
+
onUnpublish: l
|
|
1650
1715
|
}) => {
|
|
1651
|
-
const
|
|
1652
|
-
|
|
1716
|
+
const { mutate: n, isPending: r } = en(), u = async () => {
|
|
1717
|
+
n(a, {
|
|
1718
|
+
onSuccess: () => {
|
|
1719
|
+
l();
|
|
1720
|
+
}
|
|
1721
|
+
});
|
|
1722
|
+
};
|
|
1723
|
+
return /* @__PURE__ */ e.jsx(ge, { open: !!a, onOpenChange: s, children: /* @__PURE__ */ e.jsxs(xe, { children: [
|
|
1724
|
+
/* @__PURE__ */ e.jsxs(pe, { children: [
|
|
1725
|
+
/* @__PURE__ */ e.jsx(ve, { children: "Confirm action" }),
|
|
1726
|
+
/* @__PURE__ */ e.jsxs(be, { children: [
|
|
1727
|
+
"Are you sure you want to take offline",
|
|
1728
|
+
" ",
|
|
1729
|
+
/* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
|
|
1730
|
+
"?"
|
|
1731
|
+
] })
|
|
1732
|
+
] }),
|
|
1733
|
+
/* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1734
|
+
/* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: s, children: "Cancel" }),
|
|
1735
|
+
/* @__PURE__ */ e.jsx(
|
|
1736
|
+
_,
|
|
1737
|
+
{
|
|
1738
|
+
variant: "destructive",
|
|
1739
|
+
disabled: r,
|
|
1740
|
+
onClick: u,
|
|
1741
|
+
children: r ? "Updating..." : "Take offline"
|
|
1742
|
+
}
|
|
1743
|
+
)
|
|
1744
|
+
] })
|
|
1745
|
+
] }) });
|
|
1746
|
+
}, on = ({
|
|
1747
|
+
activePage: a,
|
|
1748
|
+
editPage: s,
|
|
1749
|
+
onShowUpsertPage: l
|
|
1750
|
+
}) => {
|
|
1751
|
+
const [n, r] = R("pages"), { data: u, isFetching: o } = tt(), [d, f] = R(
|
|
1752
|
+
null
|
|
1753
|
+
), [p, x] = R(null), b = (w) => Ka(
|
|
1754
|
+
U(w, (h) => n === "pages" ? h.slug : !h.slug),
|
|
1653
1755
|
"name",
|
|
1654
1756
|
"asc"
|
|
1655
|
-
).map((h) => /* @__PURE__ */
|
|
1656
|
-
|
|
1757
|
+
).map((h) => /* @__PURE__ */ e.jsxs(
|
|
1758
|
+
_,
|
|
1657
1759
|
{
|
|
1658
|
-
onClick: () =>
|
|
1659
|
-
variant: h.id ===
|
|
1760
|
+
onClick: () => s(h.id),
|
|
1761
|
+
variant: h.id === a ? "default" : "ghost",
|
|
1660
1762
|
className: "flex justify-between items-center w-full space-x-2 py-1",
|
|
1661
1763
|
children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
h.global ? /* @__PURE__ */
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
(h == null ? void 0 : h.slug) && /* @__PURE__ */
|
|
1764
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 relative", children: [
|
|
1765
|
+
h.global ? /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(De, { className: "h-4 w-4" }),
|
|
1766
|
+
/* @__PURE__ */ e.jsx("span", { children: h.name ?? h.slug }),
|
|
1767
|
+
(h == null ? void 0 : h.slug) && /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-light", children: [
|
|
1666
1768
|
"( ",
|
|
1667
1769
|
h.slug,
|
|
1668
1770
|
" )"
|
|
1669
1771
|
] })
|
|
1670
1772
|
] }),
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
|
|
1773
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-4", children: [
|
|
1774
|
+
/* @__PURE__ */ e.jsx(
|
|
1775
|
+
"div",
|
|
1674
1776
|
{
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1777
|
+
style: {
|
|
1778
|
+
width: "10px",
|
|
1779
|
+
height: "10px",
|
|
1780
|
+
backgroundColor: h != null && h.online ? "lightgreen" : "transparent"
|
|
1781
|
+
},
|
|
1782
|
+
className: "rounded-full"
|
|
1679
1783
|
}
|
|
1680
1784
|
),
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
" "
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1785
|
+
/* @__PURE__ */ e.jsxs(Ea, { children: [
|
|
1786
|
+
/* @__PURE__ */ e.jsx(Ta, { asChild: !0, onClick: (g) => g.stopPropagation(), children: /* @__PURE__ */ e.jsx(
|
|
1787
|
+
_,
|
|
1788
|
+
{
|
|
1789
|
+
variant: "ghost",
|
|
1790
|
+
size: "sm",
|
|
1791
|
+
className: `h-8 w-8 p-0 hover:bg-transparent ${h.id === a ? " hover:text-gray-200" : "bg-transparent "}`,
|
|
1792
|
+
children: /* @__PURE__ */ e.jsx(Da, { className: "h-4 w-4" })
|
|
1793
|
+
}
|
|
1794
|
+
) }),
|
|
1795
|
+
/* @__PURE__ */ e.jsxs(Pa, { align: "end", className: "text-sm", children: [
|
|
1796
|
+
/* @__PURE__ */ e.jsxs(
|
|
1797
|
+
Je,
|
|
1693
1798
|
{
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
onClick: (S) => {
|
|
1698
|
-
S.stopPropagation(), f(h);
|
|
1799
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
1800
|
+
onClick: (g) => {
|
|
1801
|
+
g.stopPropagation(), l({ ...h, global: n === "globalBlocks" });
|
|
1699
1802
|
},
|
|
1700
|
-
children:
|
|
1803
|
+
children: [
|
|
1804
|
+
/* @__PURE__ */ e.jsx(Dt, { className: "size-3" }),
|
|
1805
|
+
"Edit"
|
|
1806
|
+
]
|
|
1701
1807
|
}
|
|
1702
|
-
)
|
|
1703
|
-
|
|
1808
|
+
),
|
|
1809
|
+
/* @__PURE__ */ e.jsxs(
|
|
1810
|
+
Je,
|
|
1811
|
+
{
|
|
1812
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
1813
|
+
onClick: (g) => {
|
|
1814
|
+
g.stopPropagation(), f(h);
|
|
1815
|
+
},
|
|
1816
|
+
children: [
|
|
1817
|
+
/* @__PURE__ */ e.jsx(Ft, { className: "size-3" }),
|
|
1818
|
+
"Delete"
|
|
1819
|
+
]
|
|
1820
|
+
}
|
|
1821
|
+
),
|
|
1822
|
+
(h == null ? void 0 : h.online) && /* @__PURE__ */ e.jsxs(
|
|
1823
|
+
Je,
|
|
1824
|
+
{
|
|
1825
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
1826
|
+
onClick: (g) => {
|
|
1827
|
+
g.stopPropagation(), x(h);
|
|
1828
|
+
},
|
|
1829
|
+
children: [
|
|
1830
|
+
/* @__PURE__ */ e.jsx(Fa, { className: "size-3" }),
|
|
1831
|
+
"Take offline"
|
|
1832
|
+
]
|
|
1833
|
+
}
|
|
1834
|
+
)
|
|
1835
|
+
] })
|
|
1704
1836
|
] })
|
|
1705
1837
|
] })
|
|
1706
1838
|
]
|
|
1707
1839
|
},
|
|
1708
1840
|
h.id
|
|
1709
1841
|
));
|
|
1710
|
-
return /* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1842
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1843
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
1844
|
+
/* @__PURE__ */ e.jsxs(Na, { value: n, className: "w-full", onValueChange: r, children: [
|
|
1845
|
+
/* @__PURE__ */ e.jsxs(ka, { className: "w-full", children: [
|
|
1846
|
+
/* @__PURE__ */ e.jsx(wt, { value: "pages", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Pages" }) }),
|
|
1847
|
+
/* @__PURE__ */ e.jsx(wt, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Global Blocks" }) })
|
|
1716
1848
|
] }),
|
|
1717
|
-
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
] }) : /* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1849
|
+
o ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1850
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1851
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1852
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1853
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "py-4 space-y-3", children: [
|
|
1854
|
+
/* @__PURE__ */ e.jsx(Ca, { children: /* @__PURE__ */ e.jsxs(Sa, { className: "text-xs text-muted-foreground text-center text-light", children: [
|
|
1723
1855
|
"Manage your ",
|
|
1724
|
-
|
|
1856
|
+
n === "pages" ? "pages" : "global blocks"
|
|
1725
1857
|
] }) }),
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
|
|
1858
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ e.jsxs(
|
|
1859
|
+
_,
|
|
1728
1860
|
{
|
|
1729
1861
|
variant: "default",
|
|
1730
1862
|
size: "sm",
|
|
1731
|
-
disabled:
|
|
1732
|
-
onClick: () =>
|
|
1863
|
+
disabled: o,
|
|
1864
|
+
onClick: () => l({
|
|
1733
1865
|
slug: "",
|
|
1734
1866
|
name: "",
|
|
1735
|
-
global:
|
|
1867
|
+
global: n === "globalBlocks"
|
|
1736
1868
|
}),
|
|
1737
1869
|
className: "mb-4 w-1/2 bg-blue-500 hover:bg-blue-400",
|
|
1738
1870
|
children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
|
|
1871
|
+
/* @__PURE__ */ e.jsx(Aa, { className: "h-4 w-4 mr-2" }),
|
|
1872
|
+
o ? "Loading..." : `Add new ${n === "pages" ? "page" : "global block"}`
|
|
1741
1873
|
]
|
|
1742
1874
|
}
|
|
1743
1875
|
) }),
|
|
1744
|
-
/* @__PURE__ */
|
|
1876
|
+
/* @__PURE__ */ e.jsx("div", { className: "pt-4", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: o ? /* @__PURE__ */ e.jsx(cn, {}) : b(u) }) })
|
|
1745
1877
|
] })
|
|
1746
|
-
] })
|
|
1878
|
+
] }),
|
|
1879
|
+
/* @__PURE__ */ e.jsx(
|
|
1880
|
+
rn,
|
|
1881
|
+
{
|
|
1882
|
+
page: d,
|
|
1883
|
+
onClose: () => f(null),
|
|
1884
|
+
onDelete: () => {
|
|
1885
|
+
f(null);
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
),
|
|
1889
|
+
/* @__PURE__ */ e.jsx(
|
|
1890
|
+
ln,
|
|
1891
|
+
{
|
|
1892
|
+
page: p,
|
|
1893
|
+
onClose: () => x(null),
|
|
1894
|
+
onUnpublish: () => {
|
|
1895
|
+
x(null);
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
)
|
|
1747
1899
|
] });
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1900
|
+
};
|
|
1901
|
+
function cn() {
|
|
1902
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." });
|
|
1903
|
+
}
|
|
1904
|
+
const un = ({
|
|
1905
|
+
editPage: a,
|
|
1906
|
+
showUpsertPage: s,
|
|
1907
|
+
setShowUpsertPage: l
|
|
1752
1908
|
}) => {
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1909
|
+
const n = s.id, [r, u] = R(n && s.name || ""), [o, d] = R(n && s.slug || ""), { mutate: f, isPending: p } = Ut(), { mutate: x, isPending: b } = nt(), w = p || b, E = () => {
|
|
1910
|
+
n ? x(
|
|
1755
1911
|
{
|
|
1756
|
-
name:
|
|
1757
|
-
slug:
|
|
1758
|
-
id:
|
|
1759
|
-
global: !!
|
|
1912
|
+
name: r,
|
|
1913
|
+
slug: o,
|
|
1914
|
+
id: s.id,
|
|
1915
|
+
global: !!s.global
|
|
1760
1916
|
},
|
|
1761
1917
|
{
|
|
1762
1918
|
onSuccess: () => {
|
|
1763
|
-
|
|
1919
|
+
l(void 0);
|
|
1764
1920
|
}
|
|
1765
1921
|
}
|
|
1766
|
-
) :
|
|
1922
|
+
) : f(
|
|
1767
1923
|
{
|
|
1768
|
-
name:
|
|
1769
|
-
slug:
|
|
1770
|
-
global: !!
|
|
1924
|
+
name: r,
|
|
1925
|
+
slug: o,
|
|
1926
|
+
global: !!s.global
|
|
1771
1927
|
},
|
|
1772
1928
|
{
|
|
1773
|
-
onSuccess: (
|
|
1774
|
-
|
|
1929
|
+
onSuccess: (h) => {
|
|
1930
|
+
a(h.id);
|
|
1775
1931
|
}
|
|
1776
1932
|
}
|
|
1777
1933
|
);
|
|
1778
1934
|
};
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
|
|
1935
|
+
return /* @__PURE__ */ e.jsx(
|
|
1936
|
+
ge,
|
|
1781
1937
|
{
|
|
1782
|
-
open: !!
|
|
1783
|
-
onOpenChange: () =>
|
|
1784
|
-
children: /* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
|
|
1938
|
+
open: !!s,
|
|
1939
|
+
onOpenChange: () => l(void 0),
|
|
1940
|
+
children: /* @__PURE__ */ e.jsxs(xe, { className: "sm:max-w-[425px]", children: [
|
|
1941
|
+
/* @__PURE__ */ e.jsxs(pe, { children: [
|
|
1942
|
+
/* @__PURE__ */ e.jsxs(ve, { children: [
|
|
1943
|
+
n ? "Edit" : "Add New",
|
|
1788
1944
|
" ",
|
|
1789
|
-
|
|
1945
|
+
s.global ? "Global Block" : "Page"
|
|
1790
1946
|
] }),
|
|
1791
|
-
/* @__PURE__ */
|
|
1947
|
+
/* @__PURE__ */ e.jsxs(be, { children: [
|
|
1792
1948
|
"Enter the details for the new",
|
|
1793
1949
|
" ",
|
|
1794
|
-
|
|
1950
|
+
s.global ? "global block. Identifier should be unique." : "page. Slug must start with /"
|
|
1795
1951
|
] })
|
|
1796
1952
|
] }),
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1802
|
-
|
|
1953
|
+
/* @__PURE__ */ e.jsxs("form", { children: [
|
|
1954
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1955
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1956
|
+
/* @__PURE__ */ e.jsx(F, { htmlFor: "name", className: "text-right", children: "Name" }),
|
|
1957
|
+
/* @__PURE__ */ e.jsx(
|
|
1958
|
+
M,
|
|
1803
1959
|
{
|
|
1804
1960
|
id: "name",
|
|
1805
|
-
value:
|
|
1806
|
-
placeholder: `Enter ${
|
|
1807
|
-
onChange: (
|
|
1961
|
+
value: r,
|
|
1962
|
+
placeholder: `Enter ${s.global ? "global block" : "page"} name`,
|
|
1963
|
+
onChange: (h) => u(h.target.value),
|
|
1808
1964
|
className: "col-span-3",
|
|
1809
1965
|
required: !0
|
|
1810
1966
|
}
|
|
1811
1967
|
)
|
|
1812
1968
|
] }),
|
|
1813
|
-
!
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
|
|
1969
|
+
!s.global && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1970
|
+
/* @__PURE__ */ e.jsx(F, { htmlFor: "slug", className: "text-right", children: s.global ? "Identifier" : "Slug" }),
|
|
1971
|
+
/* @__PURE__ */ e.jsx(
|
|
1972
|
+
M,
|
|
1817
1973
|
{
|
|
1818
1974
|
id: "slug",
|
|
1819
|
-
value:
|
|
1820
|
-
onChange: (
|
|
1821
|
-
var
|
|
1822
|
-
return
|
|
1975
|
+
value: o,
|
|
1976
|
+
onChange: (h) => {
|
|
1977
|
+
var g;
|
|
1978
|
+
return d((g = h.target.value) == null ? void 0 : g.trim().toLowerCase());
|
|
1823
1979
|
},
|
|
1824
1980
|
className: "col-span-3",
|
|
1825
1981
|
required: !0,
|
|
@@ -1830,13 +1986,13 @@ const $a = ({
|
|
|
1830
1986
|
)
|
|
1831
1987
|
] })
|
|
1832
1988
|
] }),
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
|
|
1989
|
+
/* @__PURE__ */ e.jsx(ye, { children: /* @__PURE__ */ e.jsx(
|
|
1990
|
+
_,
|
|
1835
1991
|
{
|
|
1836
|
-
onClick:
|
|
1992
|
+
onClick: E,
|
|
1837
1993
|
type: "button",
|
|
1838
|
-
disabled:
|
|
1839
|
-
children:
|
|
1994
|
+
disabled: w || !r || !s.global && !o.startsWith("/") || He(s.name, r) && He(s.slug, o),
|
|
1995
|
+
children: w ? n ? "Updating..." : "Adding..." : s.global ? `${n ? "Update" : "Add"} global block` : `${n ? "Update" : "Add"} Page`
|
|
1840
1996
|
}
|
|
1841
1997
|
) })
|
|
1842
1998
|
] })
|
|
@@ -1844,37 +2000,37 @@ const $a = ({
|
|
|
1844
2000
|
}
|
|
1845
2001
|
);
|
|
1846
2002
|
};
|
|
1847
|
-
function
|
|
1848
|
-
const { activePage:
|
|
1849
|
-
window.history.pushState({}, "", `?page=${p}`),
|
|
2003
|
+
function dn(a) {
|
|
2004
|
+
const { activePage: s, canClose: l, open: n, close: r } = a, [, u] = je(), [o, d] = R(), f = (p) => {
|
|
2005
|
+
window.history.pushState({}, "", `?page=${p}`), u(new URLSearchParams({ page: p })), window.dispatchEvent(new PopStateEvent("popstate")), d(void 0), r();
|
|
1850
2006
|
};
|
|
1851
|
-
return /* @__PURE__ */
|
|
1852
|
-
|
|
2007
|
+
return /* @__PURE__ */ e.jsx(
|
|
2008
|
+
Oa,
|
|
1853
2009
|
{
|
|
1854
|
-
open:
|
|
2010
|
+
open: n,
|
|
1855
2011
|
onOpenChange: (p) => {
|
|
1856
|
-
!p &&
|
|
2012
|
+
!p && l && r();
|
|
1857
2013
|
},
|
|
1858
|
-
children: /* @__PURE__ */
|
|
1859
|
-
|
|
2014
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
2015
|
+
_a,
|
|
1860
2016
|
{
|
|
1861
2017
|
side: "left",
|
|
1862
|
-
className: `border-border w-full ${
|
|
2018
|
+
className: `border-border w-full ${l ? "" : "sheet-hide-close-btn"}`,
|
|
1863
2019
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
2020
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
2021
|
+
on,
|
|
1866
2022
|
{
|
|
1867
|
-
onShowUpsertPage: (p) =>
|
|
1868
|
-
activePage:
|
|
1869
|
-
editPage:
|
|
2023
|
+
onShowUpsertPage: (p) => d(p),
|
|
2024
|
+
activePage: s,
|
|
2025
|
+
editPage: f
|
|
1870
2026
|
}
|
|
1871
2027
|
) }),
|
|
1872
|
-
|
|
1873
|
-
|
|
2028
|
+
o && /* @__PURE__ */ e.jsx(
|
|
2029
|
+
un,
|
|
1874
2030
|
{
|
|
1875
|
-
editPage:
|
|
1876
|
-
showUpsertPage:
|
|
1877
|
-
setShowUpsertPage:
|
|
2031
|
+
editPage: f,
|
|
2032
|
+
showUpsertPage: o,
|
|
2033
|
+
setShowUpsertPage: d
|
|
1878
2034
|
}
|
|
1879
2035
|
)
|
|
1880
2036
|
]
|
|
@@ -1883,87 +2039,368 @@ function za(r) {
|
|
|
1883
2039
|
}
|
|
1884
2040
|
);
|
|
1885
2041
|
}
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
2042
|
+
const hn = () => {
|
|
2043
|
+
const { t: a } = xa(), { data: s, isFetching: l } = Fe(), n = Lt(
|
|
2044
|
+
"getPreviewUrl",
|
|
2045
|
+
async (o) => o
|
|
2046
|
+
), [r, u] = R("");
|
|
2047
|
+
return me(() => {
|
|
2048
|
+
(async () => {
|
|
2049
|
+
if (!n || !(s != null && s.slug)) {
|
|
2050
|
+
u("");
|
|
2051
|
+
return;
|
|
2052
|
+
}
|
|
2053
|
+
const o = await n((s == null ? void 0 : s.slug) || "");
|
|
2054
|
+
u(o);
|
|
2055
|
+
})();
|
|
2056
|
+
}, [n, s == null ? void 0 : s.slug]), !r || s != null && s.global || l ? null : /* @__PURE__ */ e.jsxs(_, { variant: "outline", size: "sm", className: "ml-2", children: [
|
|
2057
|
+
/* @__PURE__ */ e.jsx(La, { className: "h-4 w-4 mr-2" }),
|
|
2058
|
+
/* @__PURE__ */ e.jsx("a", { href: r, target: "_blank", children: a("Preview") })
|
|
2059
|
+
] });
|
|
2060
|
+
}, fn = () => {
|
|
2061
|
+
const a = A();
|
|
2062
|
+
return W({
|
|
2063
|
+
queryKey: ["project-collections"],
|
|
2064
|
+
initialData: [],
|
|
2065
|
+
queryFn: async () => await (await fetch(a, {
|
|
2066
|
+
method: "POST",
|
|
2067
|
+
headers: {
|
|
2068
|
+
"Content-Type": "application/json"
|
|
2069
|
+
},
|
|
2070
|
+
body: JSON.stringify({ action: "GET_COLLECTIONS" })
|
|
2071
|
+
})).json()
|
|
2072
|
+
});
|
|
2073
|
+
}, mn = () => {
|
|
2074
|
+
const a = A();
|
|
2075
|
+
return re({
|
|
2076
|
+
mutationFn: async ({ collection: s, query: l }) => {
|
|
2077
|
+
try {
|
|
2078
|
+
return await (await fetch(a, {
|
|
2079
|
+
method: "POST",
|
|
2080
|
+
headers: {
|
|
2081
|
+
"Content-Type": "application/json"
|
|
2082
|
+
},
|
|
2083
|
+
body: JSON.stringify({
|
|
2084
|
+
action: "SEARCH_PAGES",
|
|
2085
|
+
data: {
|
|
2086
|
+
collection: s,
|
|
2087
|
+
query: Array.isArray(l) && l.length > 0 ? l[0] : l
|
|
2088
|
+
}
|
|
2089
|
+
})
|
|
2090
|
+
})).json() || [];
|
|
2091
|
+
} catch {
|
|
2092
|
+
return [];
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
});
|
|
2096
|
+
}, gn = () => {
|
|
2097
|
+
const a = A();
|
|
2098
|
+
return W({
|
|
2099
|
+
queryKey: ["get-page-changes"],
|
|
2100
|
+
queryFn: async () => await (await fetch(a, {
|
|
2101
|
+
method: "POST",
|
|
2102
|
+
headers: {
|
|
2103
|
+
"Content-Type": "application/json"
|
|
2104
|
+
},
|
|
2105
|
+
body: JSON.stringify({
|
|
2106
|
+
action: "GET_CHANGES"
|
|
2107
|
+
})
|
|
2108
|
+
})).json()
|
|
2109
|
+
});
|
|
2110
|
+
}, Pt = ({
|
|
2111
|
+
pages: a,
|
|
2112
|
+
selectedPages: s,
|
|
2113
|
+
handleCheckboxChange: l,
|
|
2114
|
+
loading: n,
|
|
2115
|
+
type: r
|
|
2116
|
+
}) => {
|
|
2117
|
+
if (n)
|
|
2118
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
|
|
2119
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse mt-2" }),
|
|
2120
|
+
/* @__PURE__ */ e.jsx("div", { className: "bg-gray-200 h-6 w-full rounded animate-pulse" })
|
|
2121
|
+
] });
|
|
2122
|
+
if (I(a))
|
|
2123
|
+
return /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center text-gray-400 font-medium", children: "No changes available to publish" });
|
|
2124
|
+
const u = U(a, { online: !0 }), o = U(a, { online: !1 });
|
|
2125
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2 px-1", children: [
|
|
2126
|
+
z(u, (d, f) => /* @__PURE__ */ e.jsxs(
|
|
2127
|
+
"div",
|
|
2128
|
+
{
|
|
2129
|
+
className: `pt-2 flex justify-between ${f > 0 ? "border-t" : ""}`,
|
|
2130
|
+
children: [
|
|
2131
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-x-2", children: [
|
|
2132
|
+
/* @__PURE__ */ e.jsx(
|
|
2133
|
+
"input",
|
|
2134
|
+
{
|
|
2135
|
+
checked: he(s, d.id),
|
|
2136
|
+
onChange: () => l(d.id),
|
|
2137
|
+
type: "checkbox",
|
|
2138
|
+
className: "rounded focus:outline-none focus:ring-0 cursor-pointer"
|
|
2139
|
+
}
|
|
2140
|
+
),
|
|
2141
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-xs", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 text-gray-400", children: [
|
|
2142
|
+
d.global ? /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(De, { className: "h-4 w-4" }),
|
|
2143
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-gray-800", children: d.name }),
|
|
2144
|
+
" ",
|
|
2145
|
+
/* @__PURE__ */ e.jsx("span", { children: d.slug && !d.global && /* @__PURE__ */ e.jsx("span", { children: d.slug }) })
|
|
2146
|
+
] }) })
|
|
2147
|
+
] }),
|
|
2148
|
+
/* @__PURE__ */ e.jsx("div", { className: " text-gray-500 text-xs font-medium", children: kt(d == null ? void 0 : d.changes) })
|
|
2149
|
+
]
|
|
2150
|
+
},
|
|
2151
|
+
d.id
|
|
2152
|
+
)),
|
|
2153
|
+
!I(o) && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2154
|
+
/* @__PURE__ */ e.jsxs("div", { className: "relative py-0 -ml-2 !mt-3", children: [
|
|
2155
|
+
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 flex items-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-full border-t border-gray-200" }) }),
|
|
2156
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative flex justify-left", children: /* @__PURE__ */ e.jsxs("span", { className: "bg-white px-2 text-xs text-gray-500", children: [
|
|
2157
|
+
"Offline ",
|
|
2158
|
+
r
|
|
2159
|
+
] }) })
|
|
2160
|
+
] }),
|
|
2161
|
+
z(o, (d, f) => /* @__PURE__ */ e.jsxs(
|
|
2162
|
+
"div",
|
|
2163
|
+
{
|
|
2164
|
+
className: `pt-2 flex justify-between ${f > 0 ? "border-t" : ""}`,
|
|
2165
|
+
children: [
|
|
2166
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-x-2", children: [
|
|
2167
|
+
/* @__PURE__ */ e.jsx(
|
|
2168
|
+
"input",
|
|
2169
|
+
{
|
|
2170
|
+
checked: he(s, d.id),
|
|
2171
|
+
onChange: () => l(d.id),
|
|
2172
|
+
type: "checkbox",
|
|
2173
|
+
className: "rounded focus:outline-none focus:ring-0 cursor-pointer"
|
|
2174
|
+
}
|
|
2175
|
+
),
|
|
2176
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-xs", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 text-gray-400", children: [
|
|
2177
|
+
d.global ? /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(De, { className: "h-4 w-4" }),
|
|
2178
|
+
/* @__PURE__ */ e.jsxs("span", { className: "font-medium text-gray-800", children: [
|
|
2179
|
+
d.name,
|
|
2180
|
+
" ",
|
|
2181
|
+
d.lang && `(${d.lang})`
|
|
2182
|
+
] }),
|
|
2183
|
+
" ",
|
|
2184
|
+
/* @__PURE__ */ e.jsx("span", { children: d.slug && !d.global && /* @__PURE__ */ e.jsx("span", { children: d.slug }) })
|
|
2185
|
+
] }) })
|
|
2186
|
+
] }),
|
|
2187
|
+
/* @__PURE__ */ e.jsx("div", { className: " text-gray-500 text-xs font-medium", children: kt(d == null ? void 0 : d.changes) })
|
|
2188
|
+
]
|
|
2189
|
+
},
|
|
2190
|
+
d.id
|
|
2191
|
+
))
|
|
2192
|
+
] })
|
|
2193
|
+
] });
|
|
2194
|
+
};
|
|
2195
|
+
function xn({
|
|
2196
|
+
onClose: a = () => console.log("Cancelled")
|
|
2197
|
+
}) {
|
|
2198
|
+
const [s, l] = R([]), { data: n, isFetching: r } = gn(), u = V(
|
|
2199
|
+
() => [
|
|
2200
|
+
...U(n, { global: !1, online: !0 }),
|
|
2201
|
+
...U(n, { global: !1, online: !1 })
|
|
2202
|
+
],
|
|
2203
|
+
[n]
|
|
2204
|
+
), o = V(
|
|
2205
|
+
() => [
|
|
2206
|
+
...U(n, { global: !0, online: !0 }),
|
|
2207
|
+
...U(n, { global: !0, online: !1 })
|
|
2208
|
+
],
|
|
2209
|
+
[n]
|
|
2210
|
+
), { mutate: d, isPending: f } = tn();
|
|
2211
|
+
me(() => {
|
|
2212
|
+
l(z(U(n, { online: !0 }), "id"));
|
|
2213
|
+
}, [n]);
|
|
2214
|
+
const { isAllPagesSelected: p, isAllGlobalBlocksSelected: x } = V(() => {
|
|
2215
|
+
const h = u.length > 0 && u.every((C) => s.includes(C.id)), g = o.length > 0 && o.every((C) => s.includes(C.id));
|
|
2216
|
+
return {
|
|
2217
|
+
isAllPagesSelected: h,
|
|
2218
|
+
isAllGlobalBlocksSelected: g
|
|
2219
|
+
};
|
|
2220
|
+
}, [u, o, s]), b = (h) => {
|
|
2221
|
+
l(
|
|
2222
|
+
(g) => he(g, h) ? U(g, (C) => C !== h) : Ye(g, h)
|
|
2223
|
+
);
|
|
2224
|
+
}, w = (h) => {
|
|
2225
|
+
l(h === "globalBlocks" ? (C) => x ? U(C, (y) => !H(o, { id: y })) : Ct(Ye(C, z(o, "id"))) : (C) => p ? U(C, (y) => !H(u, { id: y })) : Ct(Ye(C, z(u, "id"))));
|
|
2226
|
+
}, E = () => {
|
|
2227
|
+
d(
|
|
2228
|
+
{ ids: s, theme: !1 },
|
|
2229
|
+
{
|
|
2230
|
+
onSuccess: () => {
|
|
2231
|
+
a();
|
|
2232
|
+
}
|
|
2233
|
+
}
|
|
2234
|
+
);
|
|
2235
|
+
};
|
|
2236
|
+
return /* @__PURE__ */ e.jsx(ge, { open: !0, onOpenChange: f ? () => {
|
|
2237
|
+
} : a, children: /* @__PURE__ */ e.jsxs(xe, { className: "sm:max-w-[525px]", children: [
|
|
2238
|
+
/* @__PURE__ */ e.jsxs(pe, { children: [
|
|
2239
|
+
/* @__PURE__ */ e.jsx(ve, { children: "Publish changes" }),
|
|
2240
|
+
/* @__PURE__ */ e.jsx(be, { className: "text-xs", children: "Select the pages you want to publish. Click publish when you're done." })
|
|
2241
|
+
] }),
|
|
2242
|
+
/* @__PURE__ */ e.jsx("div", { className: "max-h-[400px] overflow-y-auto", children: /* @__PURE__ */ e.jsxs(At, { type: "multiple", defaultValue: ["pages", "globalBlocks"], children: [
|
|
2243
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "pages", defaultChecked: !0, children: [
|
|
2244
|
+
/* @__PURE__ */ e.jsx(ne, { className: "bg-gray-100 rounded px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 pl-2 -mx-1", children: [
|
|
2245
|
+
!I(u) && /* @__PURE__ */ e.jsx(
|
|
2246
|
+
"input",
|
|
2247
|
+
{
|
|
2248
|
+
checked: p,
|
|
2249
|
+
onClick: (h) => {
|
|
2250
|
+
h.stopPropagation(), w("pages");
|
|
2251
|
+
},
|
|
2252
|
+
type: "checkbox",
|
|
2253
|
+
className: "rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"
|
|
2254
|
+
}
|
|
2255
|
+
),
|
|
2256
|
+
"Pages"
|
|
2257
|
+
] }) }),
|
|
2258
|
+
/* @__PURE__ */ e.jsx(se, { className: "px-4 pt-2", children: /* @__PURE__ */ e.jsx(
|
|
2259
|
+
Pt,
|
|
2260
|
+
{
|
|
2261
|
+
type: "Pages",
|
|
2262
|
+
loading: r,
|
|
2263
|
+
pages: u,
|
|
2264
|
+
selectedPages: s,
|
|
2265
|
+
handleCheckboxChange: b
|
|
2266
|
+
}
|
|
2267
|
+
) })
|
|
2268
|
+
] }),
|
|
2269
|
+
/* @__PURE__ */ e.jsxs(ae, { value: "globalBlocks", children: [
|
|
2270
|
+
/* @__PURE__ */ e.jsx(ne, { className: "bg-gray-100 rounded px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2 pl-2 -mx-1", children: [
|
|
2271
|
+
!I(o) && /* @__PURE__ */ e.jsx(
|
|
2272
|
+
"input",
|
|
2273
|
+
{
|
|
2274
|
+
checked: x,
|
|
2275
|
+
onClick: (h) => {
|
|
2276
|
+
h.stopPropagation(), w("globalBlocks");
|
|
2277
|
+
},
|
|
2278
|
+
type: "checkbox",
|
|
2279
|
+
className: "rounded focus:outline-none focus:ring-0 mt-1 cursor-pointer"
|
|
2280
|
+
}
|
|
2281
|
+
),
|
|
2282
|
+
"Global Block"
|
|
2283
|
+
] }) }),
|
|
2284
|
+
/* @__PURE__ */ e.jsx(se, { className: "px-4 pt-2", children: /* @__PURE__ */ e.jsx(
|
|
2285
|
+
Pt,
|
|
2286
|
+
{
|
|
2287
|
+
type: "Global Blocks",
|
|
2288
|
+
loading: r,
|
|
2289
|
+
pages: o,
|
|
2290
|
+
selectedPages: s,
|
|
2291
|
+
handleCheckboxChange: b
|
|
2292
|
+
}
|
|
2293
|
+
) })
|
|
2294
|
+
] })
|
|
2295
|
+
] }) }),
|
|
2296
|
+
/* @__PURE__ */ e.jsxs(ye, { children: [
|
|
2297
|
+
/* @__PURE__ */ e.jsx(_, { disabled: f, variant: "outline", onClick: a, children: "Cancel" }),
|
|
2298
|
+
/* @__PURE__ */ e.jsx(
|
|
2299
|
+
_,
|
|
2300
|
+
{
|
|
2301
|
+
disabled: f || r || I(n),
|
|
2302
|
+
onClick: E,
|
|
2303
|
+
children: f ? "Publishing..." : "Publish"
|
|
2304
|
+
}
|
|
2305
|
+
)
|
|
2306
|
+
] })
|
|
2307
|
+
] }) });
|
|
2308
|
+
}
|
|
2309
|
+
ma();
|
|
2310
|
+
const pn = (a) => {
|
|
2311
|
+
const s = Rt([]), [l] = je(), n = l.get("page"), { data: r, isFetching: u } = Fe(), { data: o } = Ya(), { data: d, isFetching: f } = Ha(), { blocks: p } = Qa(d), { data: x } = It(), { data: b } = at(), { data: w } = fn(), E = Wa(), { uploadFile: h } = Za(), { getUILibraryBlock: g, getUILibraryBlocks: C, onSave: y } = Ja(), { getGlobalBlocks: S, getGlobalBlockBlocks: Le } = Xa(), { aiContext: le, setAiContext: Ie } = et(), { mutateAsync: we } = mn();
|
|
2312
|
+
s.current = p;
|
|
2313
|
+
const [Ue, Ne] = R(!1), [ke, Ce] = R(!1), [X, Se] = R("SAVED");
|
|
2314
|
+
me(() => {
|
|
2315
|
+
const P = (q) => {
|
|
2316
|
+
X === "UNSAVED" && (q.preventDefault(), q.returnValue = !1);
|
|
1893
2317
|
};
|
|
1894
|
-
return
|
|
1895
|
-
window.removeEventListener("beforeunload",
|
|
2318
|
+
return X === "UNSAVED" && window.addEventListener("beforeunload", P), () => {
|
|
2319
|
+
window.removeEventListener("beforeunload", P);
|
|
1896
2320
|
};
|
|
1897
|
-
}, [
|
|
1898
|
-
const
|
|
1899
|
-
const
|
|
1900
|
-
return
|
|
1901
|
-
}, [
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
2321
|
+
}, [X]);
|
|
2322
|
+
const B = V(() => {
|
|
2323
|
+
const P = {};
|
|
2324
|
+
return x != null && x.theme && (P.brandingOptions = x.theme), P;
|
|
2325
|
+
}, [x]), K = V(() => Array.isArray(a == null ? void 0 : a.uiLibraries) ? [...o, ...a == null ? void 0 : a.uiLibraries] : o, [o, a == null ? void 0 : a.uiLibraries]), J = Xe(
|
|
2326
|
+
async (P, q) => await we({ collection: P, query: q }),
|
|
2327
|
+
[we]
|
|
2328
|
+
);
|
|
2329
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2330
|
+
/* @__PURE__ */ e.jsx(
|
|
2331
|
+
pa,
|
|
1905
2332
|
{
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
2333
|
+
loading: f,
|
|
2334
|
+
...a.fallbackLang && {
|
|
2335
|
+
fallbackLang: a.fallbackLang || "en"
|
|
2336
|
+
},
|
|
2337
|
+
...a.languages && {
|
|
2338
|
+
languages: z(b, "lang") || []
|
|
2339
|
+
},
|
|
2340
|
+
translations: a.translations || {},
|
|
2341
|
+
locale: a.locale || "en",
|
|
2342
|
+
htmlDir: a.htmlDir || "ltr",
|
|
2343
|
+
autoSaveSupport: a.autoSaveSupport || !1,
|
|
2344
|
+
autoSaveInterval: a.autoSaveInterval || 15,
|
|
1913
2345
|
uploadMediaCallback: h,
|
|
1914
|
-
onError:
|
|
1915
|
-
getGlobalBlockBlocks:
|
|
1916
|
-
getGlobalBlocks:
|
|
1917
|
-
blocks:
|
|
1918
|
-
getUILibraryBlock:
|
|
1919
|
-
getUILibraryBlocks:
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
onSave: async ({ blocks: O, themeConfiguration: T }) => {
|
|
1927
|
-
if (!o) return !0;
|
|
1928
|
-
const G = {
|
|
1929
|
-
_type: "@chai/theme",
|
|
1930
|
-
_value: T
|
|
1931
|
-
}, M = {
|
|
2346
|
+
onError: a.onError || console.error,
|
|
2347
|
+
getGlobalBlockBlocks: Le,
|
|
2348
|
+
getGlobalBlocks: S,
|
|
2349
|
+
blocks: p,
|
|
2350
|
+
getUILibraryBlock: g,
|
|
2351
|
+
getUILibraryBlocks: C,
|
|
2352
|
+
uiLibraries: K,
|
|
2353
|
+
collections: w,
|
|
2354
|
+
searchCollectionItems: J,
|
|
2355
|
+
saveAiContextCallback: async (P) => {
|
|
2356
|
+
if (!n) return !0;
|
|
2357
|
+
const q = s.current, Z = {
|
|
1932
2358
|
_type: "@chai/ai-context",
|
|
1933
|
-
_value:
|
|
1934
|
-
},
|
|
1935
|
-
return await
|
|
2359
|
+
_value: St(P) ? P : ""
|
|
2360
|
+
}, Ee = [...q, Z];
|
|
2361
|
+
return await y({ page: n, blocks: Ee }), Ie(P), !0;
|
|
2362
|
+
},
|
|
2363
|
+
onSaveStateChange: (P) => Se(P),
|
|
2364
|
+
aiContext: le,
|
|
2365
|
+
askAiCallBack: E,
|
|
2366
|
+
onSave: async ({ blocks: P }) => {
|
|
2367
|
+
if (!n) return !0;
|
|
2368
|
+
s.current = P;
|
|
2369
|
+
const q = {
|
|
2370
|
+
_type: "@chai/ai-context",
|
|
2371
|
+
_value: St(le) ? le : ""
|
|
2372
|
+
}, Z = [...P, q];
|
|
2373
|
+
return await y({ page: n, blocks: Z }), s.current = P, !0;
|
|
1936
2374
|
},
|
|
1937
2375
|
topBarComponents: {
|
|
1938
2376
|
left: [
|
|
1939
|
-
() => /* @__PURE__ */
|
|
1940
|
-
|
|
2377
|
+
() => /* @__PURE__ */ e.jsxs(
|
|
2378
|
+
_,
|
|
1941
2379
|
{
|
|
1942
2380
|
variant: "default",
|
|
1943
2381
|
className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
|
|
1944
|
-
onClick: () =>
|
|
2382
|
+
onClick: () => Ne(!0),
|
|
1945
2383
|
children: [
|
|
1946
|
-
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
2384
|
+
he(r.slug, "/") ? /* @__PURE__ */ e.jsx(De, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Ae, { className: "h-4 w-4" }),
|
|
2385
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: (r == null ? void 0 : r.name) ?? "" }),
|
|
2386
|
+
/* @__PURE__ */ e.jsx(Ia, { className: "h-4 w-4" })
|
|
1949
2387
|
]
|
|
1950
2388
|
},
|
|
1951
2389
|
"template-viewer"
|
|
1952
2390
|
)
|
|
1953
2391
|
],
|
|
1954
2392
|
right: [
|
|
1955
|
-
|
|
1956
|
-
|
|
2393
|
+
hn,
|
|
2394
|
+
() => /* @__PURE__ */ e.jsxs(
|
|
2395
|
+
_,
|
|
1957
2396
|
{
|
|
1958
|
-
disabled:
|
|
2397
|
+
disabled: X !== "SAVED",
|
|
1959
2398
|
size: "sm",
|
|
1960
2399
|
variant: "default",
|
|
1961
|
-
onClick: () =>
|
|
2400
|
+
onClick: () => Ce(!0),
|
|
1962
2401
|
children: [
|
|
1963
|
-
/* @__PURE__ */
|
|
1964
|
-
"
|
|
1965
|
-
" ",
|
|
1966
|
-
ie ? "Publishing..." : "Publish"
|
|
2402
|
+
/* @__PURE__ */ e.jsx(Ua, { className: "h-4 w-4" }),
|
|
2403
|
+
" Publish"
|
|
1967
2404
|
]
|
|
1968
2405
|
}
|
|
1969
2406
|
)
|
|
@@ -1971,11 +2408,11 @@ const Ja = (r) => {
|
|
|
1971
2408
|
},
|
|
1972
2409
|
sideBarComponents: {
|
|
1973
2410
|
top: [
|
|
1974
|
-
...
|
|
2411
|
+
...r != null && r.global ? [] : [
|
|
1975
2412
|
{
|
|
1976
2413
|
label: "SEO Setting",
|
|
1977
|
-
component:
|
|
1978
|
-
icon: /* @__PURE__ */
|
|
2414
|
+
component: Gt,
|
|
2415
|
+
icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
1979
2416
|
"svg",
|
|
1980
2417
|
{
|
|
1981
2418
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1984,25 +2421,25 @@ const Ja = (r) => {
|
|
|
1984
2421
|
width: "21",
|
|
1985
2422
|
height: "21",
|
|
1986
2423
|
children: [
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
2424
|
+
/* @__PURE__ */ e.jsx("path", { d: "M9.931 6.818c-1.238 0-2.136.925-2.136 2.2 0 1.279.898 2.207 2.136 2.207.664 0 1.257-.246 1.67-.694a.15.15 0 0 0-.009-.213l-.311-.286a.15.15 0 0 0-.213.009c-.273.297-.677.46-1.137.46-.699 0-1.233-.444-1.375-1.12h3.295a.15.15 0 0 0 .151-.151v-.211c0-1.295-.852-2.2-2.072-2.2m0 .724c.697 0 1.188.422 1.315 1.113h-2.69c.142-.673.676-1.113 1.374-1.113m4.332-.724c-1.246 0-2.15.925-2.15 2.2 0 1.279.904 2.207 2.15 2.207.596 0 1.143-.223 1.538-.628s.612-.965.612-1.579c0-1.275-.904-2.2-2.15-2.2m0 3.683c-.826 0-1.426-.624-1.426-1.483 0-.855.6-1.475 1.426-1.475s1.426.621 1.426 1.476c0 .423-.144.804-.406 1.073-.258.264-.62.41-1.019.41M6.318 8.71c-.665-.206-.902-.335-.902-.645 0-.47.564-.521.806-.521.29 0 .552.07.801.215a.15.15 0 0 0 .206-.055l.212-.366a.15.15 0 0 0-.055-.206 2.27 2.27 0 0 0-1.165-.312c-.915 0-1.53.501-1.53 1.245 0 .899.816 1.152 1.411 1.336.655.203.812.307.804.53-.016.398-.567.429-.735.429-.386 0-.722-.129-.972-.374q-.043-.042-.107-.043a.15.15 0 0 0-.106.045l-.295.302a.15.15 0 0 0 .002.213c.383.374.908.58 1.478.58.859 0 1.432-.441 1.459-1.125.031-.833-.746-1.074-1.313-1.249" }),
|
|
2425
|
+
/* @__PURE__ */ e.jsx("path", { d: "M20.396 2.049H.604A.604.604 0 0 0 0 2.653v12.7c0 .333.27.604.604.604h6.941c-.266 1.296-.881 1.966-.886 1.971a.604.604 0 0 0 .434 1.024h6.815a.604.604 0 0 0 .434-1.024c-.007-.007-.621-.675-.886-1.971h6.941c.333 0 .604-.27.604-.604V2.652a.604.604 0 0 0-.604-.604m-.604 12.701h-.985v-.17a.604.604 0 0 0-1.208 0v.17h-.63v-.17a.604.604 0 0 0-1.208 0v.17H1.207V3.256h18.585z" })
|
|
1989
2426
|
]
|
|
1990
2427
|
}
|
|
1991
2428
|
) })
|
|
1992
2429
|
}
|
|
1993
|
-
]
|
|
1994
|
-
...(
|
|
2430
|
+
],
|
|
2431
|
+
...(x == null ? void 0 : x.languages.length) > 0 ? [
|
|
1995
2432
|
{
|
|
1996
2433
|
label: "Language Pages",
|
|
1997
|
-
component:
|
|
1998
|
-
icon: /* @__PURE__ */
|
|
2434
|
+
component: sn,
|
|
2435
|
+
icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
1999
2436
|
"svg",
|
|
2000
2437
|
{
|
|
2001
2438
|
width: "21",
|
|
2002
2439
|
height: "21",
|
|
2003
2440
|
viewBox: "0 0 21 21",
|
|
2004
2441
|
fill: "currentColor",
|
|
2005
|
-
children: /* @__PURE__ */
|
|
2442
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
2006
2443
|
"g",
|
|
2007
2444
|
{
|
|
2008
2445
|
fill: "none",
|
|
@@ -2011,10 +2448,10 @@ const Ja = (r) => {
|
|
|
2011
2448
|
"stroke-linecap": "round",
|
|
2012
2449
|
"stroke-linejoin": "round",
|
|
2013
2450
|
children: [
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2451
|
+
/* @__PURE__ */ e.jsx("path", { d: "M18.5 10.5v-6a2 2 0 0 0-2-2h-6a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2" }),
|
|
2452
|
+
/* @__PURE__ */ e.jsx("path", { d: "M6.5 8.503h-2a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h.003l6-.01a2 2 0 0 0 1.997-2V14.5" }),
|
|
2453
|
+
/* @__PURE__ */ e.jsx("path", { d: "M7.5 12.503h-3M9 14l-1 1q-.5.5-2.5 1.5" }),
|
|
2454
|
+
/* @__PURE__ */ e.jsx("path", { d: "M5.5 12.503q.501 1.75 1.5 2.499c1 .749 1.5.999 2.5 1.498m4-12-3 6m3-6 3 6m-1-2h-4" })
|
|
2018
2455
|
]
|
|
2019
2456
|
}
|
|
2020
2457
|
)
|
|
@@ -2024,22 +2461,23 @@ const Ja = (r) => {
|
|
|
2024
2461
|
] : []
|
|
2025
2462
|
]
|
|
2026
2463
|
},
|
|
2027
|
-
...
|
|
2464
|
+
...B
|
|
2028
2465
|
}
|
|
2029
2466
|
),
|
|
2030
|
-
/* @__PURE__ */
|
|
2031
|
-
|
|
2467
|
+
/* @__PURE__ */ e.jsx(
|
|
2468
|
+
dn,
|
|
2032
2469
|
{
|
|
2033
|
-
activePage:
|
|
2034
|
-
canClose: !!
|
|
2035
|
-
open: !
|
|
2036
|
-
close: () =>
|
|
2470
|
+
activePage: n || "",
|
|
2471
|
+
canClose: !!n && !I(r),
|
|
2472
|
+
open: !n || !u && I(r) || Ue,
|
|
2473
|
+
close: () => Ne(!1)
|
|
2037
2474
|
}
|
|
2038
|
-
)
|
|
2475
|
+
),
|
|
2476
|
+
ke && /* @__PURE__ */ e.jsx(xn, { onClose: () => Ce(!1) })
|
|
2039
2477
|
] });
|
|
2040
|
-
},
|
|
2478
|
+
}, Ot = new va({
|
|
2041
2479
|
defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
|
|
2042
|
-
}),
|
|
2480
|
+
}), Cn = (a) => (Ot.setQueryData(["builder_props"], a), /* @__PURE__ */ e.jsx(ba, { client: Ot, children: /* @__PURE__ */ e.jsx(pn, { ...a }) }));
|
|
2043
2481
|
export {
|
|
2044
|
-
|
|
2482
|
+
Cn as default
|
|
2045
2483
|
};
|