@chaibuilder/pages 0.1.0-beta.1 → 0.1.0-beta.11
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 +3 -3
- package/dist/index.js +1198 -1056
- package/dist/server.cjs +1 -1
- package/dist/server.d.ts +4 -1
- package/dist/server.js +71 -27
- 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 J, useQuery as
|
|
5
|
-
import { useToast as
|
|
6
|
-
import { StarIcon as
|
|
7
|
-
import { get as
|
|
8
|
-
var
|
|
1
|
+
import wt, { useCallback as Ct, useState as A, useEffect as qe, useMemo as ne, useRef as St } from "react";
|
|
2
|
+
import { loadWebBlocks as ca } from "@chaibuilder/sdk/web-blocks";
|
|
3
|
+
import { getBlocksFromHTML as ua, useLanguages as $e, ChaiBuilderEditor as da } from "@chaibuilder/sdk";
|
|
4
|
+
import { useQueryClient as J, useQuery as Y, useMutation as re, QueryClient as ha, QueryClientProvider as fa } from "@tanstack/react-query";
|
|
5
|
+
import { useToast as H, Accordion as ma, AccordionItem as ge, AccordionTrigger as pe, AccordionContent as xe, Label as R, Input as G, Textarea as ve, Button as _, Popover as ga, PopoverTrigger as pa, PopoverContent as xa, Dialog as be, DialogContent as ye, DialogHeader as je, DialogTitle as we, DialogDescription as Ce, DialogFooter as Se, Tabs as va, TabsList as ba, TabsTrigger as pt, SheetHeader as ya, SheetDescription as ja, DropdownMenu as wa, DropdownMenuTrigger as Ca, DropdownMenuContent as Sa, DropdownMenuItem as Be, Sheet as ka, SheetContent as Ea } from "@chaibuilder/sdk/ui";
|
|
6
|
+
import { StarIcon as Na, PencilIcon as kt, TrashIcon as Et, Plus as Ta, GlobeIcon as Nt, File as Tt, MoreVertical as Pa, Power as _a, ArrowLeftRightIcon as Oa, RocketIcon as Ra } from "lucide-react";
|
|
7
|
+
import { get as M, find as ie, isEmpty as q, filter as Ke, includes as Pt, startCase as Da, reverse as Aa, sortBy as Fa, isEqual as Ge, map as We, startsWith as xt, toLower as La, trim as Ia, orderBy as Ua, isString as vt } from "lodash-es";
|
|
8
|
+
var Me = { exports: {} }, te = {};
|
|
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 c(
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
for (
|
|
27
|
-
if (
|
|
28
|
-
return { $$typeof: i, type:
|
|
18
|
+
var bt;
|
|
19
|
+
function Ba() {
|
|
20
|
+
if (bt) return te;
|
|
21
|
+
bt = 1;
|
|
22
|
+
var a = wt, i = Symbol.for("react.element"), l = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, s = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, d = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
23
|
+
function c(p, h, b) {
|
|
24
|
+
var w, f = {}, C = null, T = null;
|
|
25
|
+
b !== void 0 && (C = "" + b), h.key !== void 0 && (C = "" + h.key), h.ref !== void 0 && (T = h.ref);
|
|
26
|
+
for (w in h) n.call(h, w) && !d.hasOwnProperty(w) && (f[w] = h[w]);
|
|
27
|
+
if (p && p.defaultProps) for (w in h = p.defaultProps, h) f[w] === void 0 && (f[w] = h[w]);
|
|
28
|
+
return { $$typeof: i, type: p, key: C, ref: T, props: f, _owner: s.current };
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return te.Fragment = l, te.jsx = c, te.jsxs = c, te;
|
|
31
31
|
}
|
|
32
|
-
var
|
|
32
|
+
var ae = {};
|
|
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 F(
|
|
47
|
-
if (
|
|
42
|
+
var yt;
|
|
43
|
+
function Ga() {
|
|
44
|
+
return yt || (yt = 1, process.env.NODE_ENV !== "production" && function() {
|
|
45
|
+
var a = wt, i = Symbol.for("react.element"), l = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), s = Symbol.for("react.strict_mode"), d = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), p = Symbol.for("react.context"), h = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), w = Symbol.for("react.suspense_list"), f = Symbol.for("react.memo"), C = Symbol.for("react.lazy"), T = Symbol.for("react.offscreen"), m = Symbol.iterator, v = "@@iterator";
|
|
46
|
+
function F(t) {
|
|
47
|
+
if (t === null || typeof t != "object")
|
|
48
48
|
return null;
|
|
49
|
-
var
|
|
50
|
-
return typeof
|
|
49
|
+
var r = m && t[m] || t[v];
|
|
50
|
+
return typeof r == "function" ? r : null;
|
|
51
51
|
}
|
|
52
|
-
var
|
|
53
|
-
function
|
|
52
|
+
var y = a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
53
|
+
function k(t) {
|
|
54
54
|
{
|
|
55
|
-
for (var
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
for (var r = arguments.length, o = new Array(r > 1 ? r - 1 : 0), u = 1; u < r; u++)
|
|
56
|
+
o[u - 1] = arguments[u];
|
|
57
|
+
ke("error", t, o);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function ke(t, r, o) {
|
|
61
61
|
{
|
|
62
|
-
var
|
|
63
|
-
|
|
64
|
-
var
|
|
62
|
+
var u = y.ReactDebugCurrentFrame, j = u.getStackAddendum();
|
|
63
|
+
j !== "" && (r += "%s", o = o.concat([j]));
|
|
64
|
+
var S = o.map(function(x) {
|
|
65
65
|
return String(x);
|
|
66
66
|
});
|
|
67
|
-
|
|
67
|
+
S.unshift("Warning: " + r), Function.prototype.apply.call(console[t], console, S);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
var
|
|
71
|
-
|
|
72
|
-
function
|
|
73
|
-
return !!(typeof
|
|
70
|
+
var Ee = !1, oe = !1, Q = !1, Ne = !1, Te = !1, X;
|
|
71
|
+
X = Symbol.for("react.module.reference");
|
|
72
|
+
function K(t) {
|
|
73
|
+
return !!(typeof t == "string" || typeof t == "function" || t === n || t === d || Te || t === s || t === b || t === w || Ne || t === T || Ee || oe || Q || typeof t == "object" && t !== null && (t.$$typeof === C || t.$$typeof === f || t.$$typeof === c || t.$$typeof === p || t.$$typeof === h || // 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 === X || t.getModuleId !== void 0));
|
|
78
78
|
}
|
|
79
|
-
function
|
|
80
|
-
var
|
|
81
|
-
if (
|
|
82
|
-
return
|
|
83
|
-
var
|
|
84
|
-
return
|
|
79
|
+
function Pe(t, r, o) {
|
|
80
|
+
var u = t.displayName;
|
|
81
|
+
if (u)
|
|
82
|
+
return u;
|
|
83
|
+
var j = r.displayName || r.name || "";
|
|
84
|
+
return j !== "" ? o + "(" + j + ")" : o;
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function ce(t) {
|
|
87
|
+
return t.displayName || "Context";
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
if (
|
|
89
|
+
function I(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" && k("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 d:
|
|
102
102
|
return "Profiler";
|
|
103
103
|
case s:
|
|
104
104
|
return "StrictMode";
|
|
105
|
-
case
|
|
105
|
+
case b:
|
|
106
106
|
return "Suspense";
|
|
107
|
-
case
|
|
107
|
+
case w:
|
|
108
108
|
return "SuspenseList";
|
|
109
109
|
}
|
|
110
|
-
if (typeof
|
|
111
|
-
switch (
|
|
112
|
-
case
|
|
113
|
-
var
|
|
114
|
-
return
|
|
110
|
+
if (typeof t == "object")
|
|
111
|
+
switch (t.$$typeof) {
|
|
112
|
+
case p:
|
|
113
|
+
var r = t;
|
|
114
|
+
return ce(r) + ".Consumer";
|
|
115
115
|
case c:
|
|
116
|
-
var
|
|
117
|
-
return
|
|
118
|
-
case
|
|
119
|
-
return
|
|
120
|
-
case
|
|
121
|
-
var
|
|
122
|
-
return
|
|
123
|
-
case
|
|
124
|
-
var
|
|
116
|
+
var o = t;
|
|
117
|
+
return ce(o._context) + ".Provider";
|
|
118
|
+
case h:
|
|
119
|
+
return Pe(t, t.render, "ForwardRef");
|
|
120
|
+
case f:
|
|
121
|
+
var u = t.displayName || null;
|
|
122
|
+
return u !== null ? u : I(t.type) || "Memo";
|
|
123
|
+
case C: {
|
|
124
|
+
var j = t, S = j._payload, x = j._init;
|
|
125
125
|
try {
|
|
126
|
-
return
|
|
126
|
+
return I(x(S));
|
|
127
127
|
} catch {
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
@@ -131,103 +131,103 @@ function Da() {
|
|
|
131
131
|
}
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
|
-
var
|
|
135
|
-
function
|
|
134
|
+
var E = Object.assign, U = 0, W, ue, He, Qe, Xe, Ze, et;
|
|
135
|
+
function tt() {
|
|
136
136
|
}
|
|
137
|
-
|
|
138
|
-
function
|
|
137
|
+
tt.__reactDisabledLog = !0;
|
|
138
|
+
function Lt() {
|
|
139
139
|
{
|
|
140
|
-
if (
|
|
141
|
-
|
|
142
|
-
var
|
|
140
|
+
if (U === 0) {
|
|
141
|
+
W = console.log, ue = console.info, He = console.warn, Qe = console.error, Xe = console.group, Ze = console.groupCollapsed, et = console.groupEnd;
|
|
142
|
+
var t = {
|
|
143
143
|
configurable: !0,
|
|
144
144
|
enumerable: !0,
|
|
145
|
-
value:
|
|
145
|
+
value: tt,
|
|
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
|
+
U++;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function It() {
|
|
162
162
|
{
|
|
163
|
-
if (
|
|
164
|
-
var
|
|
163
|
+
if (U--, U === 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: E({}, t, {
|
|
171
|
+
value: W
|
|
172
172
|
}),
|
|
173
|
-
info:
|
|
174
|
-
value:
|
|
173
|
+
info: E({}, t, {
|
|
174
|
+
value: ue
|
|
175
175
|
}),
|
|
176
|
-
warn:
|
|
177
|
-
value:
|
|
176
|
+
warn: E({}, t, {
|
|
177
|
+
value: He
|
|
178
178
|
}),
|
|
179
|
-
error:
|
|
180
|
-
value:
|
|
179
|
+
error: E({}, t, {
|
|
180
|
+
value: Qe
|
|
181
181
|
}),
|
|
182
|
-
group:
|
|
183
|
-
value:
|
|
182
|
+
group: E({}, t, {
|
|
183
|
+
value: Xe
|
|
184
184
|
}),
|
|
185
|
-
groupCollapsed:
|
|
186
|
-
value:
|
|
185
|
+
groupCollapsed: E({}, t, {
|
|
186
|
+
value: Ze
|
|
187
187
|
}),
|
|
188
|
-
groupEnd:
|
|
189
|
-
value:
|
|
188
|
+
groupEnd: E({}, t, {
|
|
189
|
+
value: et
|
|
190
190
|
})
|
|
191
191
|
});
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
U < 0 && k("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
var
|
|
197
|
-
function de(
|
|
196
|
+
var _e = y.ReactCurrentDispatcher, Oe;
|
|
197
|
+
function de(t, r, o) {
|
|
198
198
|
{
|
|
199
|
-
if (
|
|
199
|
+
if (Oe === void 0)
|
|
200
200
|
try {
|
|
201
201
|
throw Error();
|
|
202
|
-
} catch (
|
|
203
|
-
var
|
|
204
|
-
|
|
202
|
+
} catch (j) {
|
|
203
|
+
var u = j.stack.trim().match(/\n( *(at )?)/);
|
|
204
|
+
Oe = u && u[1] || "";
|
|
205
205
|
}
|
|
206
206
|
return `
|
|
207
|
-
` +
|
|
207
|
+
` + Oe + t;
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
var
|
|
210
|
+
var Re = !1, he;
|
|
211
211
|
{
|
|
212
|
-
var
|
|
213
|
-
he = new
|
|
212
|
+
var Ut = typeof WeakMap == "function" ? WeakMap : Map;
|
|
213
|
+
he = new Ut();
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
if (!
|
|
215
|
+
function at(t, r) {
|
|
216
|
+
if (!t || Re)
|
|
217
217
|
return "";
|
|
218
218
|
{
|
|
219
|
-
var
|
|
220
|
-
if (
|
|
221
|
-
return
|
|
219
|
+
var o = he.get(t);
|
|
220
|
+
if (o !== void 0)
|
|
221
|
+
return o;
|
|
222
222
|
}
|
|
223
|
-
var
|
|
224
|
-
|
|
225
|
-
var
|
|
223
|
+
var u;
|
|
224
|
+
Re = !0;
|
|
225
|
+
var j = Error.prepareStackTrace;
|
|
226
226
|
Error.prepareStackTrace = void 0;
|
|
227
|
-
var
|
|
228
|
-
|
|
227
|
+
var S;
|
|
228
|
+
S = _e.current, _e.current = null, Lt();
|
|
229
229
|
try {
|
|
230
|
-
if (
|
|
230
|
+
if (r) {
|
|
231
231
|
var x = function() {
|
|
232
232
|
throw Error();
|
|
233
233
|
};
|
|
@@ -238,540 +238,490 @@ function Da() {
|
|
|
238
238
|
}), typeof Reflect == "object" && Reflect.construct) {
|
|
239
239
|
try {
|
|
240
240
|
Reflect.construct(x, []);
|
|
241
|
-
} catch (
|
|
242
|
-
|
|
241
|
+
} catch (D) {
|
|
242
|
+
u = D;
|
|
243
243
|
}
|
|
244
|
-
Reflect.construct(
|
|
244
|
+
Reflect.construct(t, [], x);
|
|
245
245
|
} else {
|
|
246
246
|
try {
|
|
247
247
|
x.call();
|
|
248
|
-
} catch (
|
|
249
|
-
|
|
248
|
+
} catch (D) {
|
|
249
|
+
u = D;
|
|
250
250
|
}
|
|
251
|
-
|
|
251
|
+
t.call(x.prototype);
|
|
252
252
|
}
|
|
253
253
|
} else {
|
|
254
254
|
try {
|
|
255
255
|
throw Error();
|
|
256
|
-
} catch (
|
|
257
|
-
|
|
256
|
+
} catch (D) {
|
|
257
|
+
u = D;
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
t();
|
|
260
260
|
}
|
|
261
|
-
} catch (
|
|
262
|
-
if (
|
|
263
|
-
for (var
|
|
264
|
-
`),
|
|
265
|
-
`),
|
|
266
|
-
|
|
267
|
-
for (;
|
|
268
|
-
if (
|
|
269
|
-
if (
|
|
261
|
+
} catch (D) {
|
|
262
|
+
if (D && u && typeof D.stack == "string") {
|
|
263
|
+
for (var g = D.stack.split(`
|
|
264
|
+
`), O = u.stack.split(`
|
|
265
|
+
`), N = g.length - 1, P = O.length - 1; N >= 1 && P >= 0 && g[N] !== O[P]; )
|
|
266
|
+
P--;
|
|
267
|
+
for (; N >= 1 && P >= 0; N--, P--)
|
|
268
|
+
if (g[N] !== O[P]) {
|
|
269
|
+
if (N !== 1 || P !== 1)
|
|
270
270
|
do
|
|
271
|
-
if (
|
|
272
|
-
var
|
|
273
|
-
` +
|
|
274
|
-
return
|
|
271
|
+
if (N--, P--, P < 0 || g[N] !== O[P]) {
|
|
272
|
+
var B = `
|
|
273
|
+
` + g[N].replace(" at new ", " at ");
|
|
274
|
+
return t.displayName && B.includes("<anonymous>") && (B = B.replace("<anonymous>", t.displayName)), typeof t == "function" && he.set(t, B), B;
|
|
275
275
|
}
|
|
276
|
-
while (
|
|
276
|
+
while (N >= 1 && P >= 0);
|
|
277
277
|
break;
|
|
278
278
|
}
|
|
279
279
|
}
|
|
280
280
|
} finally {
|
|
281
|
-
|
|
281
|
+
Re = !1, _e.current = S, It(), Error.prepareStackTrace = j;
|
|
282
282
|
}
|
|
283
|
-
var
|
|
284
|
-
return typeof
|
|
283
|
+
var z = t ? t.displayName || t.name : "", $ = z ? de(z) : "";
|
|
284
|
+
return typeof t == "function" && he.set(t, $), $;
|
|
285
285
|
}
|
|
286
|
-
function Bt(
|
|
287
|
-
return
|
|
286
|
+
function Bt(t, r, o) {
|
|
287
|
+
return at(t, !1);
|
|
288
288
|
}
|
|
289
|
-
function
|
|
290
|
-
var
|
|
291
|
-
return !!(
|
|
289
|
+
function Gt(t) {
|
|
290
|
+
var r = t.prototype;
|
|
291
|
+
return !!(r && r.isReactComponent);
|
|
292
292
|
}
|
|
293
|
-
function fe(
|
|
294
|
-
if (
|
|
293
|
+
function fe(t, r, o) {
|
|
294
|
+
if (t == null)
|
|
295
295
|
return "";
|
|
296
|
-
if (typeof
|
|
297
|
-
return
|
|
298
|
-
if (typeof
|
|
299
|
-
return de(
|
|
300
|
-
switch (
|
|
301
|
-
case
|
|
296
|
+
if (typeof t == "function")
|
|
297
|
+
return at(t, Gt(t));
|
|
298
|
+
if (typeof t == "string")
|
|
299
|
+
return de(t);
|
|
300
|
+
switch (t) {
|
|
301
|
+
case b:
|
|
302
302
|
return de("Suspense");
|
|
303
|
-
case
|
|
303
|
+
case w:
|
|
304
304
|
return de("SuspenseList");
|
|
305
305
|
}
|
|
306
|
-
if (typeof
|
|
307
|
-
switch (
|
|
308
|
-
case
|
|
309
|
-
return Bt(
|
|
310
|
-
case
|
|
311
|
-
return fe(
|
|
312
|
-
case
|
|
313
|
-
var
|
|
306
|
+
if (typeof t == "object")
|
|
307
|
+
switch (t.$$typeof) {
|
|
308
|
+
case h:
|
|
309
|
+
return Bt(t.render);
|
|
310
|
+
case f:
|
|
311
|
+
return fe(t.type, r, o);
|
|
312
|
+
case C: {
|
|
313
|
+
var u = t, j = u._payload, S = u._init;
|
|
314
314
|
try {
|
|
315
|
-
return fe(j
|
|
315
|
+
return fe(S(j), r, o);
|
|
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 Z = Object.prototype.hasOwnProperty, nt = {}, st = y.ReactDebugCurrentFrame;
|
|
323
|
+
function me(t) {
|
|
324
|
+
if (t) {
|
|
325
|
+
var r = t._owner, o = fe(t.type, t._source, r ? r.type : null);
|
|
326
|
+
st.setExtraStackFrame(o);
|
|
327
327
|
} else
|
|
328
|
-
|
|
328
|
+
st.setExtraStackFrame(null);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
330
|
+
function Mt(t, r, o, u, j) {
|
|
331
331
|
{
|
|
332
|
-
var
|
|
333
|
-
for (var x in
|
|
334
|
-
if (
|
|
335
|
-
var
|
|
332
|
+
var S = Function.call.bind(Z);
|
|
333
|
+
for (var x in t)
|
|
334
|
+
if (S(t, x)) {
|
|
335
|
+
var g = void 0;
|
|
336
336
|
try {
|
|
337
|
-
if (typeof
|
|
338
|
-
var
|
|
339
|
-
throw
|
|
337
|
+
if (typeof t[x] != "function") {
|
|
338
|
+
var O = Error((u || "React class") + ": " + o + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
339
|
+
throw O.name = "Invariant Violation", O;
|
|
340
340
|
}
|
|
341
|
-
|
|
342
|
-
} catch (
|
|
343
|
-
|
|
341
|
+
g = t[x](r, x, u, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
342
|
+
} catch (N) {
|
|
343
|
+
g = N;
|
|
344
344
|
}
|
|
345
|
-
|
|
345
|
+
g && !(g instanceof Error) && (me(j), k("%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).", u || "React class", o, x, typeof g), me(null)), g instanceof Error && !(g.message in nt) && (nt[g.message] = !0, me(j), k("Failed %s type: %s", o, g.message), me(null));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
var qt = Array.isArray;
|
|
350
|
-
function
|
|
351
|
-
return qt(
|
|
350
|
+
function De(t) {
|
|
351
|
+
return qt(t);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function $t(t) {
|
|
354
354
|
{
|
|
355
|
-
var
|
|
356
|
-
return
|
|
355
|
+
var r = typeof Symbol == "function" && Symbol.toStringTag, o = r && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
356
|
+
return o;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function Kt(t) {
|
|
360
360
|
try {
|
|
361
|
-
return
|
|
361
|
+
return rt(t), !1;
|
|
362
362
|
} catch {
|
|
363
363
|
return !0;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
return "" +
|
|
366
|
+
function rt(t) {
|
|
367
|
+
return "" + t;
|
|
368
368
|
}
|
|
369
|
-
function
|
|
370
|
-
if (
|
|
371
|
-
return
|
|
369
|
+
function it(t) {
|
|
370
|
+
if (Kt(t))
|
|
371
|
+
return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", $t(t)), rt(t);
|
|
372
372
|
}
|
|
373
|
-
var
|
|
373
|
+
var ee = y.ReactCurrentOwner, Wt = {
|
|
374
374
|
key: !0,
|
|
375
375
|
ref: !0,
|
|
376
376
|
__self: !0,
|
|
377
377
|
__source: !0
|
|
378
|
-
},
|
|
379
|
-
|
|
380
|
-
function Vt(
|
|
381
|
-
if (
|
|
382
|
-
var
|
|
383
|
-
if (
|
|
378
|
+
}, lt, ot, Ae;
|
|
379
|
+
Ae = {};
|
|
380
|
+
function Vt(t) {
|
|
381
|
+
if (Z.call(t, "ref")) {
|
|
382
|
+
var r = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
383
|
+
if (r && r.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 zt(t) {
|
|
389
|
+
if (Z.call(t, "key")) {
|
|
390
|
+
var r = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
391
|
+
if (r && r.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 Jt(t, r) {
|
|
397
|
+
if (typeof t.ref == "string" && ee.current && r && ee.current.stateNode !== r) {
|
|
398
|
+
var o = I(ee.current.type);
|
|
399
|
+
Ae[o] || (k('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', I(ee.current.type), t.ref), Ae[o] = !0);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
|
-
function
|
|
402
|
+
function Yt(t, r) {
|
|
403
403
|
{
|
|
404
|
-
var
|
|
405
|
-
|
|
404
|
+
var o = function() {
|
|
405
|
+
lt || (lt = !0, k("%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)", r));
|
|
406
406
|
};
|
|
407
|
-
|
|
408
|
-
get:
|
|
407
|
+
o.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
408
|
+
get: o,
|
|
409
409
|
configurable: !0
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function Ht(t, r) {
|
|
414
414
|
{
|
|
415
|
-
var
|
|
416
|
-
|
|
415
|
+
var o = function() {
|
|
416
|
+
ot || (ot = !0, k("%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)", r));
|
|
417
417
|
};
|
|
418
|
-
|
|
419
|
-
get:
|
|
418
|
+
o.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
419
|
+
get: o,
|
|
420
420
|
configurable: !0
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
}
|
|
424
|
-
var
|
|
425
|
-
var
|
|
424
|
+
var Qt = function(t, r, o, u, j, S, x) {
|
|
425
|
+
var g = {
|
|
426
426
|
// This tag allows us to uniquely identify this as a React Element
|
|
427
427
|
$$typeof: i,
|
|
428
428
|
// Built-in properties that belong on the element
|
|
429
|
-
type:
|
|
430
|
-
key:
|
|
431
|
-
ref:
|
|
429
|
+
type: t,
|
|
430
|
+
key: r,
|
|
431
|
+
ref: o,
|
|
432
432
|
props: x,
|
|
433
433
|
// Record the component responsible for creating this element.
|
|
434
|
-
_owner:
|
|
434
|
+
_owner: S
|
|
435
435
|
};
|
|
436
|
-
return
|
|
436
|
+
return g._store = {}, Object.defineProperty(g._store, "validated", {
|
|
437
437
|
configurable: !1,
|
|
438
438
|
enumerable: !1,
|
|
439
439
|
writable: !0,
|
|
440
440
|
value: !1
|
|
441
|
-
}), Object.defineProperty(
|
|
441
|
+
}), Object.defineProperty(g, "_self", {
|
|
442
442
|
configurable: !1,
|
|
443
443
|
enumerable: !1,
|
|
444
444
|
writable: !1,
|
|
445
|
-
value:
|
|
446
|
-
}), Object.defineProperty(
|
|
445
|
+
value: u
|
|
446
|
+
}), Object.defineProperty(g, "_source", {
|
|
447
447
|
configurable: !1,
|
|
448
448
|
enumerable: !1,
|
|
449
449
|
writable: !1,
|
|
450
|
-
value:
|
|
451
|
-
}), Object.freeze && (Object.freeze(
|
|
450
|
+
value: j
|
|
451
|
+
}), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
|
|
452
452
|
};
|
|
453
|
-
function
|
|
453
|
+
function Xt(t, r, o, u, j) {
|
|
454
454
|
{
|
|
455
|
-
var
|
|
456
|
-
|
|
457
|
-
for (
|
|
458
|
-
|
|
459
|
-
if (
|
|
460
|
-
var
|
|
461
|
-
for (
|
|
462
|
-
x[
|
|
455
|
+
var S, x = {}, g = null, O = null;
|
|
456
|
+
o !== void 0 && (it(o), g = "" + o), zt(r) && (it(r.key), g = "" + r.key), Vt(r) && (O = r.ref, Jt(r, j));
|
|
457
|
+
for (S in r)
|
|
458
|
+
Z.call(r, S) && !Wt.hasOwnProperty(S) && (x[S] = r[S]);
|
|
459
|
+
if (t && t.defaultProps) {
|
|
460
|
+
var N = t.defaultProps;
|
|
461
|
+
for (S in N)
|
|
462
|
+
x[S] === void 0 && (x[S] = N[S]);
|
|
463
463
|
}
|
|
464
|
-
if (
|
|
465
|
-
var
|
|
466
|
-
|
|
464
|
+
if (g || O) {
|
|
465
|
+
var P = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
466
|
+
g && Yt(x, P), O && Ht(x, P);
|
|
467
467
|
}
|
|
468
|
-
return
|
|
468
|
+
return Qt(t, g, O, j, u, ee.current, x);
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
var
|
|
472
|
-
function V(
|
|
473
|
-
if (
|
|
474
|
-
var
|
|
475
|
-
|
|
471
|
+
var Fe = y.ReactCurrentOwner, ct = y.ReactDebugCurrentFrame;
|
|
472
|
+
function V(t) {
|
|
473
|
+
if (t) {
|
|
474
|
+
var r = t._owner, o = fe(t.type, t._source, r ? r.type : null);
|
|
475
|
+
ct.setExtraStackFrame(o);
|
|
476
476
|
} else
|
|
477
|
-
|
|
477
|
+
ct.setExtraStackFrame(null);
|
|
478
478
|
}
|
|
479
|
-
var
|
|
480
|
-
|
|
481
|
-
function
|
|
482
|
-
return typeof
|
|
479
|
+
var Le;
|
|
480
|
+
Le = !1;
|
|
481
|
+
function Ie(t) {
|
|
482
|
+
return typeof t == "object" && t !== null && t.$$typeof === i;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function ut() {
|
|
485
485
|
{
|
|
486
|
-
if (
|
|
487
|
-
var
|
|
488
|
-
if (
|
|
486
|
+
if (Fe.current) {
|
|
487
|
+
var t = I(Fe.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 Zt(t) {
|
|
497
497
|
return "";
|
|
498
498
|
}
|
|
499
|
-
var
|
|
500
|
-
function
|
|
499
|
+
var dt = {};
|
|
500
|
+
function ea(t) {
|
|
501
501
|
{
|
|
502
|
-
var
|
|
503
|
-
if (!
|
|
504
|
-
var
|
|
505
|
-
|
|
502
|
+
var r = ut();
|
|
503
|
+
if (!r) {
|
|
504
|
+
var o = typeof t == "string" ? t : t.displayName || t.name;
|
|
505
|
+
o && (r = `
|
|
506
506
|
|
|
507
|
-
Check the top-level render call using <` +
|
|
507
|
+
Check the top-level render call using <` + o + ">.");
|
|
508
508
|
}
|
|
509
|
-
return
|
|
509
|
+
return r;
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
function
|
|
512
|
+
function ht(t, r) {
|
|
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 o = ea(r);
|
|
518
|
+
if (dt[o])
|
|
519
519
|
return;
|
|
520
|
-
|
|
521
|
-
var
|
|
522
|
-
|
|
520
|
+
dt[o] = !0;
|
|
521
|
+
var u = "";
|
|
522
|
+
t && t._owner && t._owner !== Fe.current && (u = " It was passed a child from " + I(t._owner.type) + "."), V(t), k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, u), V(null);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function ft(t, r) {
|
|
526
526
|
{
|
|
527
|
-
if (typeof
|
|
527
|
+
if (typeof t != "object")
|
|
528
528
|
return;
|
|
529
|
-
if (
|
|
530
|
-
for (var
|
|
531
|
-
var
|
|
532
|
-
|
|
529
|
+
if (De(t))
|
|
530
|
+
for (var o = 0; o < t.length; o++) {
|
|
531
|
+
var u = t[o];
|
|
532
|
+
Ie(u) && ht(u, r);
|
|
533
533
|
}
|
|
534
|
-
else if (
|
|
535
|
-
|
|
536
|
-
else if (
|
|
537
|
-
var
|
|
538
|
-
if (typeof
|
|
539
|
-
for (var
|
|
540
|
-
|
|
534
|
+
else if (Ie(t))
|
|
535
|
+
t._store && (t._store.validated = !0);
|
|
536
|
+
else if (t) {
|
|
537
|
+
var j = F(t);
|
|
538
|
+
if (typeof j == "function" && j !== t.entries)
|
|
539
|
+
for (var S = j.call(t), x; !(x = S.next()).done; )
|
|
540
|
+
Ie(x.value) && ht(x.value, r);
|
|
541
541
|
}
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
|
-
function
|
|
544
|
+
function ta(t) {
|
|
545
545
|
{
|
|
546
|
-
var
|
|
547
|
-
if (
|
|
546
|
+
var r = t.type;
|
|
547
|
+
if (r == null || typeof r == "string")
|
|
548
548
|
return;
|
|
549
|
-
var
|
|
550
|
-
if (typeof
|
|
551
|
-
|
|
552
|
-
else if (typeof
|
|
549
|
+
var o;
|
|
550
|
+
if (typeof r == "function")
|
|
551
|
+
o = r.propTypes;
|
|
552
|
+
else if (typeof r == "object" && (r.$$typeof === h || // Note: Memo only checks outer props here.
|
|
553
553
|
// Inner props are checked in the reconciler.
|
|
554
|
-
|
|
555
|
-
|
|
554
|
+
r.$$typeof === f))
|
|
555
|
+
o = r.propTypes;
|
|
556
556
|
else
|
|
557
557
|
return;
|
|
558
|
-
if (
|
|
559
|
-
var
|
|
560
|
-
|
|
561
|
-
} else if (
|
|
562
|
-
|
|
563
|
-
var
|
|
564
|
-
|
|
558
|
+
if (o) {
|
|
559
|
+
var u = I(r);
|
|
560
|
+
Mt(o, t.props, "prop", u, t);
|
|
561
|
+
} else if (r.PropTypes !== void 0 && !Le) {
|
|
562
|
+
Le = !0;
|
|
563
|
+
var j = I(r);
|
|
564
|
+
k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
565
565
|
}
|
|
566
|
-
typeof
|
|
566
|
+
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function aa(t) {
|
|
570
570
|
{
|
|
571
|
-
for (var
|
|
572
|
-
var
|
|
573
|
-
if (
|
|
574
|
-
V(
|
|
571
|
+
for (var r = Object.keys(t.props), o = 0; o < r.length; o++) {
|
|
572
|
+
var u = r[o];
|
|
573
|
+
if (u !== "children" && u !== "key") {
|
|
574
|
+
V(t), k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", u), V(null);
|
|
575
575
|
break;
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
|
-
|
|
578
|
+
t.ref !== null && (V(t), k("Invalid attribute `ref` supplied to `React.Fragment`."), V(null));
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
function
|
|
581
|
+
var mt = {};
|
|
582
|
+
function gt(t, r, o, u, j, S) {
|
|
583
583
|
{
|
|
584
|
-
var x =
|
|
584
|
+
var x = K(t);
|
|
585
585
|
if (!x) {
|
|
586
|
-
var
|
|
587
|
-
(
|
|
588
|
-
var
|
|
589
|
-
|
|
590
|
-
var
|
|
591
|
-
|
|
586
|
+
var g = "";
|
|
587
|
+
(t === void 0 || typeof t == "object" && t !== null && Object.keys(t).length === 0) && (g += " 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 O = Zt();
|
|
589
|
+
O ? g += O : g += ut();
|
|
590
|
+
var N;
|
|
591
|
+
t === null ? N = "null" : De(t) ? N = "array" : t !== void 0 && t.$$typeof === i ? (N = "<" + (I(t.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : N = typeof t, k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", N, g);
|
|
592
592
|
}
|
|
593
|
-
var
|
|
594
|
-
if (
|
|
595
|
-
return
|
|
593
|
+
var P = Xt(t, r, o, j, S);
|
|
594
|
+
if (P == null)
|
|
595
|
+
return P;
|
|
596
596
|
if (x) {
|
|
597
|
-
var
|
|
598
|
-
if (
|
|
599
|
-
if (
|
|
600
|
-
if (
|
|
601
|
-
for (var
|
|
602
|
-
|
|
603
|
-
Object.freeze && Object.freeze(
|
|
597
|
+
var B = r.children;
|
|
598
|
+
if (B !== void 0)
|
|
599
|
+
if (u)
|
|
600
|
+
if (De(B)) {
|
|
601
|
+
for (var z = 0; z < B.length; z++)
|
|
602
|
+
ft(B[z], t);
|
|
603
|
+
Object.freeze && Object.freeze(B);
|
|
604
604
|
} else
|
|
605
|
-
|
|
605
|
+
k("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
|
+
ft(B, t);
|
|
608
608
|
}
|
|
609
|
-
if (
|
|
610
|
-
var $ =
|
|
609
|
+
if (Z.call(r, "key")) {
|
|
610
|
+
var $ = I(t), D = Object.keys(r).filter(function(oa) {
|
|
611
611
|
return oa !== "key";
|
|
612
|
-
}),
|
|
613
|
-
if (!
|
|
614
|
-
var
|
|
615
|
-
|
|
612
|
+
}), Ue = D.length > 0 ? "{key: someKey, " + D.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
613
|
+
if (!mt[$ + Ue]) {
|
|
614
|
+
var la = D.length > 0 ? "{" + D.join(": ..., ") + ": ...}" : "{}";
|
|
615
|
+
k(`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} />`, Ue, $, la, $), mt[$ + Ue] = !0;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
|
-
return
|
|
623
|
+
return t === n ? aa(P) : ta(P), P;
|
|
624
624
|
}
|
|
625
625
|
}
|
|
626
|
-
function
|
|
627
|
-
return
|
|
626
|
+
function na(t, r, o) {
|
|
627
|
+
return gt(t, r, o, !0);
|
|
628
628
|
}
|
|
629
|
-
function
|
|
630
|
-
return
|
|
629
|
+
function sa(t, r, o) {
|
|
630
|
+
return gt(t, r, o, !1);
|
|
631
631
|
}
|
|
632
|
-
var ra =
|
|
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 ra = sa, ia = na;
|
|
633
|
+
ae.Fragment = n, ae.jsx = ra, ae.jsxs = ia;
|
|
634
|
+
}()), ae;
|
|
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" ? Me.exports = Ba() : Me.exports = Ga();
|
|
637
|
+
var e = Me.exports;
|
|
638
|
+
const Ma = (a, i) => {
|
|
639
|
+
const n = J().getQueryData(["builder_props"]);
|
|
640
|
+
return M(n, a, i);
|
|
641
|
+
}, L = () => Ma("apiUrl", "/chai"), Ve = () => {
|
|
642
|
+
const a = J(), { data: i } = Y({
|
|
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: Ct((n) => {
|
|
648
|
+
a.setQueryData(["ai-context"], n);
|
|
649
|
+
}, []), aiContext: i };
|
|
650
|
+
}, qa = () => {
|
|
651
|
+
const a = L(), { aiContext: i } = Ve();
|
|
652
|
+
return Ct(
|
|
653
|
+
async (l, n, s, d) => {
|
|
654
|
+
const p = 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: s, aiContext: i, lang: d }
|
|
726
662
|
})
|
|
727
663
|
})).json();
|
|
728
|
-
return console.log("data",
|
|
664
|
+
return console.log("data", p), p.error ? { error: new Error(p.error) } : p;
|
|
729
665
|
},
|
|
730
|
-
[
|
|
666
|
+
[a, i]
|
|
731
667
|
);
|
|
732
|
-
},
|
|
733
|
-
const
|
|
734
|
-
return { getUILibraryBlock: async (
|
|
735
|
-
const
|
|
736
|
-
|
|
668
|
+
}, $a = () => {
|
|
669
|
+
const a = L(), { toast: i } = H();
|
|
670
|
+
return { getUILibraryBlock: async (d, c) => {
|
|
671
|
+
const b = (await (await fetch(
|
|
672
|
+
d.url + (c.path ? "/blocks/" + c.path : "/" + c.uuid + ".html")
|
|
737
673
|
)).text()).replace(/---([\s\S]*?)---/g, "");
|
|
738
|
-
return
|
|
739
|
-
}, getUILibraryBlocks: async (
|
|
674
|
+
return ua(`${b}`);
|
|
675
|
+
}, getUILibraryBlocks: async (d) => {
|
|
740
676
|
try {
|
|
741
|
-
return (await (await fetch(
|
|
742
|
-
...
|
|
743
|
-
preview:
|
|
677
|
+
return (await (await fetch(d.url + "/blocks.json")).json()).map((h) => ({
|
|
678
|
+
...h,
|
|
679
|
+
preview: d.url.replace("chaiblocks", "") + h.preview
|
|
744
680
|
}));
|
|
745
|
-
} catch (
|
|
746
|
-
return console.error(
|
|
681
|
+
} catch (c) {
|
|
682
|
+
return console.error(c), [];
|
|
747
683
|
}
|
|
748
684
|
}, onSave: async ({
|
|
749
|
-
page:
|
|
750
|
-
blocks:
|
|
685
|
+
page: d,
|
|
686
|
+
blocks: c
|
|
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: d, blocks: c }
|
|
759
695
|
})
|
|
760
|
-
})).ok ? (
|
|
696
|
+
})).ok ? (i({
|
|
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 (p) {
|
|
702
|
+
return p;
|
|
767
703
|
}
|
|
768
704
|
} };
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
705
|
+
};
|
|
706
|
+
function le() {
|
|
707
|
+
const [a, i] = A(
|
|
708
|
+
new URLSearchParams(window.location.search)
|
|
709
|
+
);
|
|
710
|
+
return qe(() => {
|
|
711
|
+
const l = () => {
|
|
712
|
+
i(new URLSearchParams(window.location.search));
|
|
713
|
+
};
|
|
714
|
+
return window.addEventListener("popstate", l), () => {
|
|
715
|
+
window.removeEventListener("popstate", l);
|
|
716
|
+
};
|
|
717
|
+
}, []), [a, i];
|
|
718
|
+
}
|
|
719
|
+
const ze = () => {
|
|
720
|
+
const a = L();
|
|
721
|
+
return Y({
|
|
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"
|
|
@@ -782,12 +732,12 @@ const Tt = () => {
|
|
|
782
732
|
})).json()
|
|
783
733
|
});
|
|
784
734
|
}, _t = () => {
|
|
785
|
-
const [
|
|
786
|
-
return { data:
|
|
787
|
-
() =>
|
|
788
|
-
[
|
|
789
|
-
), isFetching:
|
|
790
|
-
},
|
|
735
|
+
const [a] = le(), i = a.get("page"), { data: l, isFetching: n } = ze();
|
|
736
|
+
return { data: ne(
|
|
737
|
+
() => ie(l, { id: i }) || {},
|
|
738
|
+
[l, i]
|
|
739
|
+
), isFetching: n };
|
|
740
|
+
}, Ka = () => Y({
|
|
791
741
|
queryKey: ["uiLibraries"],
|
|
792
742
|
initialData: [],
|
|
793
743
|
queryFn: async () => [
|
|
@@ -802,69 +752,103 @@ const Tt = () => {
|
|
|
802
752
|
url: "https://chaibuilder.com/chaiblocks"
|
|
803
753
|
}
|
|
804
754
|
]
|
|
805
|
-
}),
|
|
806
|
-
|
|
755
|
+
}), Wa = () => {
|
|
756
|
+
const [a] = le(), i = a.get("page"), l = L(), { setAiContext: n } = Ve();
|
|
757
|
+
return Y({
|
|
758
|
+
queryKey: ["page", i],
|
|
759
|
+
initialData: [],
|
|
760
|
+
queryFn: async () => {
|
|
761
|
+
const c = (await (await fetch(`${l}`, {
|
|
762
|
+
method: "POST",
|
|
763
|
+
headers: { "Content-Type": "application/json" },
|
|
764
|
+
body: JSON.stringify({
|
|
765
|
+
action: "GET_PAGE",
|
|
766
|
+
data: { id: i, draft: !0 }
|
|
767
|
+
})
|
|
768
|
+
})).json()).blocks ?? [], p = ie(c, { _type: "@chai/ai-context" });
|
|
769
|
+
return n(M(p, "_value", "") || ""), c;
|
|
770
|
+
},
|
|
771
|
+
enabled: !!i
|
|
772
|
+
});
|
|
773
|
+
}, Va = (a) => ne(() => {
|
|
774
|
+
if (!a || q(a))
|
|
807
775
|
return {
|
|
808
776
|
blocks: [],
|
|
809
777
|
theme: {}
|
|
810
778
|
};
|
|
811
|
-
const i =
|
|
812
|
-
|
|
813
|
-
(s) => !
|
|
779
|
+
const i = ie(a, { _type: "@chai/theme" }), l = M(i, "_value", {}) || {}, n = Ke(
|
|
780
|
+
a,
|
|
781
|
+
(s) => !Pt(s == null ? void 0 : s._type, "@chai/")
|
|
814
782
|
);
|
|
815
|
-
return { theme:
|
|
816
|
-
}, [
|
|
817
|
-
const
|
|
818
|
-
return
|
|
783
|
+
return { theme: l, blocks: n };
|
|
784
|
+
}, [a]), Ot = () => {
|
|
785
|
+
const a = L();
|
|
786
|
+
return Y({
|
|
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
|
+
}, za = () => {
|
|
814
|
+
const { data: a } = ze(), i = L();
|
|
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
|
+
q(n == null ? void 0 : n.slug) && (l[n.id] = {
|
|
820
|
+
name: Da(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(`${i}`, {
|
|
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
|
+
}, Ja = () => {
|
|
835
|
+
const a = L();
|
|
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
|
|
843
|
+
}, Ya = () => {
|
|
844
|
+
const a = L(), { toast: i } = H();
|
|
861
845
|
return re({
|
|
862
|
-
mutationFn: async (
|
|
846
|
+
mutationFn: async (l) => (await fetch(`${a}`, {
|
|
863
847
|
method: "POST",
|
|
864
848
|
headers: { "Content-Type": "application/json" },
|
|
865
849
|
body: JSON.stringify({
|
|
866
850
|
action: "PUBLISH_PAGE",
|
|
867
|
-
data: { id:
|
|
851
|
+
data: { id: l }
|
|
868
852
|
})
|
|
869
853
|
})).json(),
|
|
870
854
|
onSuccess: () => {
|
|
@@ -874,25 +858,25 @@ const Tt = () => {
|
|
|
874
858
|
});
|
|
875
859
|
}
|
|
876
860
|
});
|
|
877
|
-
},
|
|
878
|
-
const
|
|
879
|
-
return
|
|
880
|
-
queryKey: ["language-pages",
|
|
861
|
+
}, Je = () => {
|
|
862
|
+
const a = L(), [i] = le(), l = i.get("page");
|
|
863
|
+
return Y({
|
|
864
|
+
queryKey: ["language-pages", l],
|
|
881
865
|
initialData: [],
|
|
882
866
|
queryFn: async () => {
|
|
883
|
-
if (!
|
|
884
|
-
const s = await (await fetch(
|
|
867
|
+
if (!l) return null;
|
|
868
|
+
const s = await (await fetch(a, {
|
|
885
869
|
method: "POST",
|
|
886
870
|
headers: { "Content-Type": "application/json" },
|
|
887
871
|
body: JSON.stringify({
|
|
888
872
|
action: "GET_LANGUAGE_PAGES",
|
|
889
|
-
data: { id:
|
|
873
|
+
data: { id: l }
|
|
890
874
|
})
|
|
891
875
|
})).json();
|
|
892
|
-
return
|
|
876
|
+
return Aa(Fa(s, "primaryPage"));
|
|
893
877
|
}
|
|
894
878
|
});
|
|
895
|
-
},
|
|
879
|
+
}, se = {
|
|
896
880
|
ab: "Abkhazian",
|
|
897
881
|
aa: "Afar",
|
|
898
882
|
af: "Afrikaans",
|
|
@@ -1081,98 +1065,132 @@ const Tt = () => {
|
|
|
1081
1065
|
za: "Zhuang, Chuang",
|
|
1082
1066
|
zu: "Zulu"
|
|
1083
1067
|
}, Rt = () => {
|
|
1084
|
-
const
|
|
1068
|
+
const a = L(), i = J(), { toast: l } = H();
|
|
1085
1069
|
return re({
|
|
1086
|
-
mutationFn: async (
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1070
|
+
mutationFn: async (n) => {
|
|
1071
|
+
var c;
|
|
1072
|
+
const d = await (await fetch(a, {
|
|
1073
|
+
method: "POST",
|
|
1074
|
+
headers: {
|
|
1075
|
+
"Content-Type": "application/json"
|
|
1076
|
+
},
|
|
1077
|
+
body: JSON.stringify({
|
|
1078
|
+
action: "CREATE_PAGE",
|
|
1079
|
+
data: n
|
|
1080
|
+
})
|
|
1081
|
+
})).json();
|
|
1082
|
+
if (d != null && d.error)
|
|
1083
|
+
throw new Error(((c = d == null ? void 0 : d.error) == null ? void 0 : c.message) || "Something went wrong.");
|
|
1084
|
+
return d;
|
|
1085
|
+
},
|
|
1086
|
+
onSuccess: (n, s) => {
|
|
1097
1087
|
s && (s != null && s.primaryPage) ? i.invalidateQueries({
|
|
1098
1088
|
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1099
|
-
}) : i.invalidateQueries({ queryKey: ["project-pages"] }),
|
|
1089
|
+
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1100
1090
|
title: `New ${s.global ? "global block" : "page"} added successfully.`
|
|
1101
1091
|
});
|
|
1102
1092
|
},
|
|
1103
|
-
onError: (
|
|
1104
|
-
|
|
1093
|
+
onError: (n, s) => {
|
|
1094
|
+
l({
|
|
1105
1095
|
variant: "destructive",
|
|
1106
1096
|
title: `Failed to add new ${s.global ? "global block" : "page"}.`,
|
|
1107
|
-
description:
|
|
1097
|
+
description: n.message
|
|
1108
1098
|
});
|
|
1109
1099
|
}
|
|
1110
1100
|
});
|
|
1111
|
-
},
|
|
1112
|
-
const
|
|
1101
|
+
}, Ye = () => {
|
|
1102
|
+
const a = L(), i = J(), { toast: l } = H();
|
|
1113
1103
|
return re({
|
|
1114
|
-
mutationFn: async (
|
|
1104
|
+
mutationFn: async (n) => (await fetch(a, {
|
|
1115
1105
|
method: "POST",
|
|
1116
1106
|
headers: {
|
|
1117
1107
|
"Content-Type": "application/json"
|
|
1118
1108
|
},
|
|
1119
1109
|
body: JSON.stringify({
|
|
1120
1110
|
action: "UPDATE_PAGE",
|
|
1121
|
-
data:
|
|
1111
|
+
data: n
|
|
1122
1112
|
})
|
|
1123
1113
|
})).json(),
|
|
1124
|
-
onSuccess: (
|
|
1114
|
+
onSuccess: (n, s) => {
|
|
1125
1115
|
s && (s != null && s.primaryPage || s != null && s.seo) ? i.invalidateQueries({
|
|
1126
1116
|
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1127
|
-
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), s != null && s.seo ?
|
|
1117
|
+
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), s != null && s.seo ? l({
|
|
1128
1118
|
title: "SEO Settings updated successfully."
|
|
1129
|
-
}) :
|
|
1119
|
+
}) : l({
|
|
1130
1120
|
title: `${s.global ? "Global block" : "Page"} updated successfully.`
|
|
1131
1121
|
});
|
|
1132
1122
|
},
|
|
1133
|
-
onError: (
|
|
1134
|
-
|
|
1123
|
+
onError: (n, s) => {
|
|
1124
|
+
l({
|
|
1135
1125
|
variant: "destructive",
|
|
1136
1126
|
title: `Failed to update ${s.global ? "global block" : "page"}.`,
|
|
1137
|
-
description:
|
|
1127
|
+
description: n.message
|
|
1138
1128
|
});
|
|
1139
1129
|
}
|
|
1140
1130
|
});
|
|
1141
1131
|
}, Dt = () => {
|
|
1142
|
-
const
|
|
1132
|
+
const a = L(), i = J(), { toast: l } = H();
|
|
1143
1133
|
return re({
|
|
1144
|
-
mutationFn: async (
|
|
1134
|
+
mutationFn: async (n) => (await fetch(a, {
|
|
1145
1135
|
method: "POST",
|
|
1146
1136
|
headers: {
|
|
1147
1137
|
"Content-Type": "application/json"
|
|
1148
1138
|
},
|
|
1149
1139
|
body: JSON.stringify({
|
|
1150
1140
|
action: "DELETE_PAGE",
|
|
1151
|
-
data: { id:
|
|
1141
|
+
data: { id: n == null ? void 0 : n.id }
|
|
1152
1142
|
})
|
|
1153
1143
|
})).json(),
|
|
1154
|
-
onSuccess: (
|
|
1144
|
+
onSuccess: (n, s) => {
|
|
1155
1145
|
s && (s != null && s.primaryPage) ? i.invalidateQueries({
|
|
1156
1146
|
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1157
|
-
}) : i.invalidateQueries({ queryKey: ["project-pages"] }),
|
|
1147
|
+
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1158
1148
|
title: `${s.global ? "Global block" : "Page"} deleted successfully.`
|
|
1159
1149
|
});
|
|
1160
1150
|
},
|
|
1161
|
-
onError: (
|
|
1162
|
-
|
|
1151
|
+
onError: (n, s) => {
|
|
1152
|
+
l({
|
|
1163
1153
|
variant: "destructive",
|
|
1164
1154
|
title: `Failed to delete ${s.global ? "global block" : "page"}.`,
|
|
1165
|
-
description:
|
|
1155
|
+
description: n.message
|
|
1156
|
+
});
|
|
1157
|
+
}
|
|
1158
|
+
});
|
|
1159
|
+
}, Ha = () => {
|
|
1160
|
+
const a = L(), i = J(), { toast: l } = H();
|
|
1161
|
+
return re({
|
|
1162
|
+
mutationFn: async (n) => (await fetch(a, {
|
|
1163
|
+
method: "POST",
|
|
1164
|
+
headers: {
|
|
1165
|
+
"Content-Type": "application/json"
|
|
1166
|
+
},
|
|
1167
|
+
body: JSON.stringify({
|
|
1168
|
+
action: "UNPUBLISH_PAGE",
|
|
1169
|
+
data: { id: n == null ? void 0 : n.id }
|
|
1170
|
+
})
|
|
1171
|
+
})).json(),
|
|
1172
|
+
onSuccess: (n, s) => {
|
|
1173
|
+
s && (s != null && s.primaryPage) ? i.invalidateQueries({
|
|
1174
|
+
queryKey: ["language-pages", s == null ? void 0 : s.primaryPage]
|
|
1175
|
+
}) : i.invalidateQueries({ queryKey: ["project-pages"] }), l({
|
|
1176
|
+
title: `${s.global ? "Global block" : "Page"} unpublished successfully.`
|
|
1177
|
+
});
|
|
1178
|
+
},
|
|
1179
|
+
onError: (n, s) => {
|
|
1180
|
+
l({
|
|
1181
|
+
variant: "destructive",
|
|
1182
|
+
title: `Failed to unpublish ${s.global ? "global block" : "page"}.`,
|
|
1183
|
+
description: n.message
|
|
1166
1184
|
});
|
|
1167
1185
|
}
|
|
1168
1186
|
});
|
|
1169
|
-
}, Ma = () => {
|
|
1170
|
-
const { selectedLang: r } = Be(), { data: i, isFetching: o } = qe();
|
|
1171
|
-
return { data: je(() => se(i, { lang: r || "" }) || {}, [i, r]), isFetching: o };
|
|
1172
1187
|
}, At = () => {
|
|
1173
|
-
const {
|
|
1174
|
-
|
|
1175
|
-
|
|
1188
|
+
const { selectedLang: a } = $e(), { data: i, isFetching: l } = Je();
|
|
1189
|
+
return { data: ne(() => ie(i, { lang: a || "" }) || {}, [i, a]), isFetching: l };
|
|
1190
|
+
}, Ft = () => {
|
|
1191
|
+
const { data: a, isFetching: i } = At(), l = a == null ? void 0 : a.seo, [n, s] = A({
|
|
1192
|
+
title: "",
|
|
1193
|
+
description: "",
|
|
1176
1194
|
cononicalUrl: "",
|
|
1177
1195
|
noIndex: !1,
|
|
1178
1196
|
noFollow: "",
|
|
@@ -1182,12 +1200,12 @@ const Tt = () => {
|
|
|
1182
1200
|
searchTitle: "",
|
|
1183
1201
|
searchDescription: "",
|
|
1184
1202
|
jsonLD: "",
|
|
1185
|
-
...
|
|
1186
|
-
}),
|
|
1187
|
-
|
|
1188
|
-
!i &&
|
|
1189
|
-
|
|
1190
|
-
|
|
1203
|
+
...l
|
|
1204
|
+
}), d = St({ initial: n, updated: n }), { selectedLang: c, fallbackLang: p } = $e(), h = c.length ? c : p, { mutate: b, isPending: w } = Ye(), f = w;
|
|
1205
|
+
qe(() => {
|
|
1206
|
+
!i && l && s({
|
|
1207
|
+
title: "",
|
|
1208
|
+
description: "",
|
|
1191
1209
|
cononicalUrl: "",
|
|
1192
1210
|
noIndex: !1,
|
|
1193
1211
|
noFollow: "",
|
|
@@ -1197,561 +1215,674 @@ const Tt = () => {
|
|
|
1197
1215
|
searchTitle: "",
|
|
1198
1216
|
searchDescription: "",
|
|
1199
1217
|
jsonLD: "",
|
|
1200
|
-
...
|
|
1218
|
+
...l
|
|
1201
1219
|
});
|
|
1202
|
-
}, [i,
|
|
1203
|
-
const
|
|
1204
|
-
|
|
1205
|
-
},
|
|
1220
|
+
}, [i, l]);
|
|
1221
|
+
const C = async () => {
|
|
1222
|
+
b({ id: a == null ? void 0 : a.id, seo: n }), d.current.initial = n, d.current.updated = n;
|
|
1223
|
+
}, T = () => {
|
|
1206
1224
|
s({
|
|
1207
|
-
...
|
|
1208
|
-
ogTitle:
|
|
1209
|
-
ogDescription:
|
|
1225
|
+
...n,
|
|
1226
|
+
ogTitle: n.title,
|
|
1227
|
+
ogDescription: n.description
|
|
1210
1228
|
});
|
|
1211
|
-
},
|
|
1229
|
+
}, m = () => {
|
|
1212
1230
|
s({
|
|
1213
|
-
...
|
|
1214
|
-
searchTitle:
|
|
1215
|
-
searchDescription:
|
|
1231
|
+
...n,
|
|
1232
|
+
searchTitle: n.ogTitle,
|
|
1233
|
+
searchDescription: n.ogDescription
|
|
1216
1234
|
});
|
|
1217
|
-
},
|
|
1218
|
-
const
|
|
1219
|
-
...
|
|
1220
|
-
[F.target.name]: F.target.name === "noIndex" ? F.target.checked : F.target.value
|
|
1235
|
+
}, v = (F) => {
|
|
1236
|
+
const y = {
|
|
1237
|
+
...n,
|
|
1238
|
+
[F.target.name]: F.target.name === "noIndex" || F.target.name === "noFollow" ? F.target.checked : F.target.value
|
|
1221
1239
|
};
|
|
1222
|
-
s(
|
|
1240
|
+
s(y), d.current.updated = y;
|
|
1223
1241
|
};
|
|
1224
|
-
return /* @__PURE__ */
|
|
1225
|
-
/* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "relative pb-40", children: [
|
|
1243
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-xs bg-gray-100 p-2 rounded-md text-center", children: [
|
|
1226
1244
|
"Current language:",
|
|
1227
1245
|
" ",
|
|
1228
|
-
/* @__PURE__ */
|
|
1246
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-blue-500 font-semibold", children: M(se, h, h) }),
|
|
1247
|
+
/* @__PURE__ */ e.jsxs("span", { className: "text-[11px] text-gray-500", children: [
|
|
1248
|
+
" ",
|
|
1249
|
+
"( ",
|
|
1250
|
+
a == null ? void 0 : a.slug,
|
|
1251
|
+
" )"
|
|
1252
|
+
] })
|
|
1229
1253
|
] }),
|
|
1230
|
-
/* @__PURE__ */
|
|
1231
|
-
/* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
|
|
1254
|
+
/* @__PURE__ */ e.jsx("form", { className: "space-y-8", children: /* @__PURE__ */ e.jsxs(ma, { type: "multiple", defaultValue: ["page"], children: [
|
|
1255
|
+
/* @__PURE__ */ e.jsxs(ge, { value: "page", children: [
|
|
1256
|
+
/* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "Seo Page" }),
|
|
1257
|
+
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1258
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1259
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "title", children: "SEO Title" }),
|
|
1260
|
+
/* @__PURE__ */ e.jsx(
|
|
1261
|
+
G,
|
|
1238
1262
|
{
|
|
1239
1263
|
type: "text",
|
|
1240
|
-
id: "
|
|
1241
|
-
name: "
|
|
1242
|
-
value:
|
|
1243
|
-
onChange:
|
|
1244
|
-
disabled:
|
|
1264
|
+
id: "title",
|
|
1265
|
+
name: "title",
|
|
1266
|
+
value: n.title,
|
|
1267
|
+
onChange: v,
|
|
1268
|
+
disabled: f,
|
|
1245
1269
|
placeholder: "Enter SEO title"
|
|
1246
1270
|
}
|
|
1247
1271
|
),
|
|
1248
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__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
1273
|
] }),
|
|
1250
|
-
/* @__PURE__ */
|
|
1251
|
-
/* @__PURE__ */
|
|
1252
|
-
/* @__PURE__ */
|
|
1253
|
-
|
|
1274
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1275
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "description", children: "SEO Description" }),
|
|
1276
|
+
/* @__PURE__ */ e.jsx(
|
|
1277
|
+
ve,
|
|
1254
1278
|
{
|
|
1255
|
-
id: "
|
|
1256
|
-
name: "
|
|
1257
|
-
value:
|
|
1258
|
-
onChange:
|
|
1259
|
-
disabled:
|
|
1279
|
+
id: "description",
|
|
1280
|
+
name: "description",
|
|
1281
|
+
value: n.description,
|
|
1282
|
+
onChange: v,
|
|
1283
|
+
disabled: f,
|
|
1260
1284
|
placeholder: "Enter SEO description"
|
|
1261
1285
|
}
|
|
1262
1286
|
),
|
|
1263
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__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
1288
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
/* @__PURE__ */
|
|
1268
|
-
|
|
1289
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1290
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "title", children: "Canonical URL" }),
|
|
1291
|
+
/* @__PURE__ */ e.jsx(
|
|
1292
|
+
G,
|
|
1269
1293
|
{
|
|
1270
1294
|
type: "text",
|
|
1271
1295
|
id: "canonicalUrl",
|
|
1272
1296
|
name: "canonicalUrl",
|
|
1273
|
-
value:
|
|
1274
|
-
onChange:
|
|
1275
|
-
disabled:
|
|
1297
|
+
value: n.canonicalUrl,
|
|
1298
|
+
onChange: v,
|
|
1299
|
+
disabled: f,
|
|
1276
1300
|
placeholder: "Enter Canonical URL"
|
|
1277
1301
|
}
|
|
1278
1302
|
)
|
|
1279
1303
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1282
|
-
/* @__PURE__ */
|
|
1283
|
-
|
|
1304
|
+
/* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
1305
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1306
|
+
/* @__PURE__ */ e.jsx(
|
|
1307
|
+
G,
|
|
1284
1308
|
{
|
|
1285
1309
|
type: "checkbox",
|
|
1286
1310
|
id: "noIndex",
|
|
1287
1311
|
name: "noIndex",
|
|
1288
|
-
checked:
|
|
1289
|
-
onChange:
|
|
1290
|
-
disabled:
|
|
1312
|
+
checked: n.noIndex,
|
|
1313
|
+
onChange: v,
|
|
1314
|
+
disabled: f,
|
|
1291
1315
|
className: "h-4 w-4"
|
|
1292
1316
|
}
|
|
1293
1317
|
),
|
|
1294
|
-
/* @__PURE__ */
|
|
1318
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Index" })
|
|
1295
1319
|
] }),
|
|
1296
|
-
/* @__PURE__ */
|
|
1320
|
+
/* @__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
1321
|
] }),
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
/* @__PURE__ */
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1322
|
+
/* @__PURE__ */ e.jsxs("div", { className: "", children: [
|
|
1323
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
|
|
1324
|
+
/* @__PURE__ */ e.jsx(
|
|
1325
|
+
G,
|
|
1326
|
+
{
|
|
1327
|
+
type: "checkbox",
|
|
1328
|
+
id: "noFollow",
|
|
1329
|
+
name: "noFollow",
|
|
1330
|
+
checked: n.noFollow,
|
|
1331
|
+
onChange: v,
|
|
1332
|
+
disabled: f,
|
|
1333
|
+
className: "h-4 w-4"
|
|
1334
|
+
}
|
|
1335
|
+
),
|
|
1336
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "noIndex", children: "No Follow" })
|
|
1337
|
+
] }),
|
|
1338
|
+
/* @__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
1339
|
] })
|
|
1313
1340
|
] }) })
|
|
1314
1341
|
] }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
|
|
1342
|
+
/* @__PURE__ */ e.jsxs(ge, { value: "og", children: [
|
|
1343
|
+
/* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "OG" }),
|
|
1344
|
+
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1345
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
|
|
1346
|
+
_,
|
|
1320
1347
|
{
|
|
1321
1348
|
type: "button",
|
|
1322
1349
|
variant: "outline",
|
|
1323
1350
|
size: "sm",
|
|
1324
|
-
onClick:
|
|
1351
|
+
onClick: T,
|
|
1325
1352
|
children: "Copy from SEO Settings"
|
|
1326
1353
|
}
|
|
1327
1354
|
) }),
|
|
1328
|
-
/* @__PURE__ */
|
|
1329
|
-
/* @__PURE__ */
|
|
1330
|
-
/* @__PURE__ */
|
|
1331
|
-
|
|
1355
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1356
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "ogTitle", children: "OG Title" }),
|
|
1357
|
+
/* @__PURE__ */ e.jsx(
|
|
1358
|
+
G,
|
|
1332
1359
|
{
|
|
1333
1360
|
type: "text",
|
|
1334
1361
|
id: "ogTitle",
|
|
1335
1362
|
name: "ogTitle",
|
|
1336
|
-
value:
|
|
1337
|
-
onChange:
|
|
1338
|
-
disabled:
|
|
1363
|
+
value: n.ogTitle,
|
|
1364
|
+
onChange: v,
|
|
1365
|
+
disabled: f,
|
|
1339
1366
|
placeholder: "Enter OG title"
|
|
1340
1367
|
}
|
|
1341
1368
|
),
|
|
1342
|
-
/* @__PURE__ */
|
|
1369
|
+
/* @__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
1370
|
] }),
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
/* @__PURE__ */
|
|
1346
|
-
/* @__PURE__ */
|
|
1347
|
-
|
|
1371
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
|
|
1372
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "ogDescription", children: "OG Description" }),
|
|
1373
|
+
/* @__PURE__ */ e.jsx(
|
|
1374
|
+
ve,
|
|
1348
1375
|
{
|
|
1349
1376
|
id: "ogDescription",
|
|
1350
1377
|
name: "ogDescription",
|
|
1351
|
-
value:
|
|
1352
|
-
onChange:
|
|
1353
|
-
disabled:
|
|
1378
|
+
value: n.ogDescription,
|
|
1379
|
+
onChange: v,
|
|
1380
|
+
disabled: f,
|
|
1354
1381
|
placeholder: "Enter OG description"
|
|
1355
1382
|
}
|
|
1356
1383
|
),
|
|
1357
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__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
1385
|
] }),
|
|
1359
|
-
/* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1362
|
-
|
|
1386
|
+
/* @__PURE__ */ e.jsxs("div", { className: "mt-4", children: [
|
|
1387
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "ogImage", children: "OG Image URL" }),
|
|
1388
|
+
/* @__PURE__ */ e.jsx(
|
|
1389
|
+
G,
|
|
1363
1390
|
{
|
|
1364
1391
|
type: "text",
|
|
1365
1392
|
id: "ogImage",
|
|
1366
1393
|
name: "ogImage",
|
|
1367
|
-
value:
|
|
1368
|
-
onChange:
|
|
1369
|
-
disabled:
|
|
1394
|
+
value: n.ogImage,
|
|
1395
|
+
onChange: v,
|
|
1396
|
+
disabled: f,
|
|
1370
1397
|
placeholder: "Enter OG image URL"
|
|
1371
1398
|
}
|
|
1372
1399
|
),
|
|
1373
|
-
/* @__PURE__ */
|
|
1400
|
+
/* @__PURE__ */ e.jsx("p", { className: "mt-1 text-[10px] font-light text-gray-400", children: "Enter a valid URL for the OG image." })
|
|
1374
1401
|
] })
|
|
1375
1402
|
] }) })
|
|
1376
1403
|
] }),
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
|
|
1404
|
+
/* @__PURE__ */ e.jsxs(ge, { value: "search", children: [
|
|
1405
|
+
/* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "Search" }),
|
|
1406
|
+
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
|
|
1407
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ e.jsx(
|
|
1408
|
+
_,
|
|
1382
1409
|
{
|
|
1383
1410
|
type: "button",
|
|
1384
1411
|
variant: "outline",
|
|
1385
1412
|
size: "sm",
|
|
1386
|
-
onClick:
|
|
1413
|
+
onClick: m,
|
|
1387
1414
|
children: "Copy from OG Settings"
|
|
1388
1415
|
}
|
|
1389
1416
|
) }),
|
|
1390
|
-
/* @__PURE__ */
|
|
1391
|
-
/* @__PURE__ */
|
|
1392
|
-
/* @__PURE__ */
|
|
1393
|
-
|
|
1417
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1418
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "searchTitle", children: "Search Title" }),
|
|
1419
|
+
/* @__PURE__ */ e.jsx(
|
|
1420
|
+
G,
|
|
1394
1421
|
{
|
|
1395
1422
|
type: "text",
|
|
1396
1423
|
id: "searchTitle",
|
|
1397
1424
|
name: "searchTitle",
|
|
1398
|
-
value:
|
|
1399
|
-
onChange:
|
|
1400
|
-
disabled:
|
|
1425
|
+
value: n.searchTitle,
|
|
1426
|
+
onChange: v,
|
|
1427
|
+
disabled: f,
|
|
1401
1428
|
placeholder: "Enter search title"
|
|
1402
1429
|
}
|
|
1403
1430
|
),
|
|
1404
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__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
1432
|
] }),
|
|
1406
|
-
/* @__PURE__ */
|
|
1407
|
-
/* @__PURE__ */
|
|
1408
|
-
/* @__PURE__ */
|
|
1409
|
-
|
|
1433
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1434
|
+
/* @__PURE__ */ e.jsx(R, { className: "text-xs pb-1", htmlFor: "searchDescription", children: "Search Description" }),
|
|
1435
|
+
/* @__PURE__ */ e.jsx(
|
|
1436
|
+
ve,
|
|
1410
1437
|
{
|
|
1411
1438
|
id: "searchDescription",
|
|
1412
1439
|
name: "searchDescription",
|
|
1413
|
-
value:
|
|
1414
|
-
onChange:
|
|
1440
|
+
value: n.searchDescription,
|
|
1441
|
+
onChange: v,
|
|
1415
1442
|
placeholder: "Enter search description"
|
|
1416
1443
|
}
|
|
1417
1444
|
),
|
|
1418
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__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
1446
|
] })
|
|
1420
1447
|
] }) })
|
|
1421
1448
|
] }),
|
|
1422
|
-
/* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */
|
|
1425
|
-
|
|
1449
|
+
/* @__PURE__ */ e.jsxs(ge, { value: "jsonLD", children: [
|
|
1450
|
+
/* @__PURE__ */ e.jsx(pe, { className: "text-blue-500", children: "JSON-LD" }),
|
|
1451
|
+
/* @__PURE__ */ e.jsx(xe, { children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4", children: /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
1452
|
+
ve,
|
|
1426
1453
|
{
|
|
1427
1454
|
id: "jsonLD",
|
|
1428
1455
|
name: "jsonLD",
|
|
1429
1456
|
rows: 3,
|
|
1430
|
-
value:
|
|
1431
|
-
onChange:
|
|
1457
|
+
value: n.jsonLD,
|
|
1458
|
+
onChange: v,
|
|
1432
1459
|
placeholder: "Enter JSON-LD"
|
|
1433
1460
|
}
|
|
1434
1461
|
) }) }) })
|
|
1435
1462
|
] })
|
|
1436
1463
|
] }) }),
|
|
1437
|
-
/* @__PURE__ */
|
|
1438
|
-
|
|
1464
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full flex items-center justify-end mt-4", children: /* @__PURE__ */ e.jsx(
|
|
1465
|
+
_,
|
|
1439
1466
|
{
|
|
1440
1467
|
size: "lg",
|
|
1441
1468
|
variant: "default",
|
|
1442
|
-
onClick:
|
|
1443
|
-
disabled:
|
|
1444
|
-
children:
|
|
1469
|
+
onClick: C,
|
|
1470
|
+
disabled: Ge(d.current.initial, n) || f,
|
|
1471
|
+
children: w ? "Saving..." : "Save"
|
|
1445
1472
|
}
|
|
1446
1473
|
) })
|
|
1447
1474
|
] });
|
|
1448
1475
|
};
|
|
1449
|
-
|
|
1450
|
-
const
|
|
1451
|
-
langProps:
|
|
1476
|
+
Ft.displayName = "SeoPanel";
|
|
1477
|
+
const Qa = ({
|
|
1478
|
+
langProps: a,
|
|
1452
1479
|
onClose: i,
|
|
1453
|
-
|
|
1480
|
+
languages: l
|
|
1454
1481
|
}) => {
|
|
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
|
-
);
|
|
1482
|
+
const { data: n } = _t(), [s, d] = A(a.name || ""), [c, p] = A(a.edit ? a.lang : ""), [h, b] = A(a.edit ? a.slug : ""), { mutate: w, isPending: f } = Rt(), { mutate: C, isPending: T } = Ye(), m = !!(n != null && n.global), v = f || T, F = () => {
|
|
1483
|
+
const y = { name: s, lang: c, primaryPage: n == null ? void 0 : n.id, slug: h };
|
|
1484
|
+
m || (y.global = !0), a.edit && (y.id = a == null ? void 0 : a.id), a.edit ? C(y, { onSuccess: i }) : w(y, { onSuccess: i });
|
|
1477
1485
|
};
|
|
1478
|
-
return /* @__PURE__ */
|
|
1479
|
-
/* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */
|
|
1481
|
-
/* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ e.jsx(be, { open: !!a, onOpenChange: i, children: /* @__PURE__ */ e.jsxs(ye, { className: "sm:max-w-[425px]", children: [
|
|
1487
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
1488
|
+
/* @__PURE__ */ e.jsx(we, { children: a.edit ? "Edit language" : "Add New language" }),
|
|
1489
|
+
/* @__PURE__ */ e.jsx(Ce, { children: "Enter the details for the language" })
|
|
1482
1490
|
] }),
|
|
1483
|
-
/* @__PURE__ */
|
|
1484
|
-
/* @__PURE__ */
|
|
1485
|
-
/* @__PURE__ */
|
|
1486
|
-
/* @__PURE__ */
|
|
1487
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ e.jsxs("form", { children: [
|
|
1492
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1493
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1494
|
+
/* @__PURE__ */ e.jsx(R, { htmlFor: "lang", className: "text-right", children: "Language" }),
|
|
1495
|
+
/* @__PURE__ */ e.jsxs(
|
|
1488
1496
|
"select",
|
|
1489
1497
|
{
|
|
1490
1498
|
value: c,
|
|
1491
|
-
disabled:
|
|
1492
|
-
onChange: (
|
|
1499
|
+
disabled: a.edit || q(l),
|
|
1500
|
+
onChange: (y) => {
|
|
1501
|
+
const k = y.target.value;
|
|
1502
|
+
p(k), !m && b(`/${k}`);
|
|
1503
|
+
},
|
|
1493
1504
|
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
1505
|
children: [
|
|
1495
|
-
/* @__PURE__ */
|
|
1496
|
-
|
|
1506
|
+
/* @__PURE__ */ e.jsx("option", { value: "", disabled: !0, selected: !0, children: a.edit ? M(se, a.lang, a.lang) : q(l) ? "All available language page is created." : "Choose language" }),
|
|
1507
|
+
We(l, (y) => /* @__PURE__ */ e.jsx("option", { value: y, children: M(se, y, y) }, y))
|
|
1497
1508
|
]
|
|
1498
1509
|
}
|
|
1499
1510
|
)
|
|
1500
1511
|
] }),
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */
|
|
1504
|
-
|
|
1512
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1513
|
+
/* @__PURE__ */ e.jsx(R, { htmlFor: "slug", className: "text-right", children: "Page Name" }),
|
|
1514
|
+
/* @__PURE__ */ e.jsx(
|
|
1515
|
+
G,
|
|
1505
1516
|
{
|
|
1506
1517
|
id: "name",
|
|
1507
1518
|
value: s,
|
|
1508
|
-
onChange: (
|
|
1519
|
+
onChange: (y) => d(y.target.value),
|
|
1509
1520
|
className: "col-span-3",
|
|
1510
1521
|
required: !0,
|
|
1511
1522
|
placeholder: "Enter page name"
|
|
1512
1523
|
}
|
|
1513
1524
|
)
|
|
1514
1525
|
] }),
|
|
1515
|
-
/* @__PURE__ */
|
|
1516
|
-
/* @__PURE__ */
|
|
1526
|
+
!m && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1527
|
+
/* @__PURE__ */ e.jsxs(R, { htmlFor: "slug", className: "text-right", children: [
|
|
1517
1528
|
"Slug",
|
|
1518
1529
|
" ",
|
|
1519
|
-
/* @__PURE__ */
|
|
1530
|
+
/* @__PURE__ */ e.jsxs("small", { className: "font-light", children: [
|
|
1531
|
+
"(Slug should start with /",
|
|
1532
|
+
c,
|
|
1533
|
+
")"
|
|
1534
|
+
] })
|
|
1520
1535
|
] }),
|
|
1521
|
-
/* @__PURE__ */
|
|
1522
|
-
|
|
1536
|
+
/* @__PURE__ */ e.jsx(
|
|
1537
|
+
G,
|
|
1523
1538
|
{
|
|
1524
1539
|
id: "slug",
|
|
1525
|
-
value:
|
|
1526
|
-
onChange: (
|
|
1540
|
+
value: h,
|
|
1541
|
+
onChange: (y) => {
|
|
1542
|
+
const k = y.target.value;
|
|
1543
|
+
xt(k, `/${c}`) && b(La(Ia(k)));
|
|
1544
|
+
},
|
|
1527
1545
|
className: "col-span-3",
|
|
1528
1546
|
required: !0,
|
|
1529
1547
|
pattern: "^/.*",
|
|
1548
|
+
disabled: q(c),
|
|
1530
1549
|
title: "Slug must start with /",
|
|
1531
|
-
placeholder: "Enter page slug"
|
|
1550
|
+
placeholder: q(c) ? "Choose language to add slug" : "Enter page slug"
|
|
1532
1551
|
}
|
|
1533
1552
|
)
|
|
1534
1553
|
] })
|
|
1535
1554
|
] }),
|
|
1536
|
-
/* @__PURE__ */
|
|
1537
|
-
|
|
1555
|
+
/* @__PURE__ */ e.jsx(Se, { children: /* @__PURE__ */ e.jsx(
|
|
1556
|
+
_,
|
|
1538
1557
|
{
|
|
1539
|
-
onClick:
|
|
1558
|
+
onClick: F,
|
|
1540
1559
|
type: "button",
|
|
1541
|
-
disabled:
|
|
1542
|
-
children:
|
|
1560
|
+
disabled: v || !c || !m && !xt(h, `/${c}`),
|
|
1561
|
+
children: v ? a.edit ? "Updating..." : "Adding..." : a.edit ? "Update" : "Add new language"
|
|
1543
1562
|
}
|
|
1544
1563
|
) })
|
|
1545
1564
|
] })
|
|
1546
1565
|
] }) });
|
|
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
|
-
|
|
1566
|
+
}, Xa = () => {
|
|
1567
|
+
const [a, i] = A(null), { selectedLang: l, fallbackLang: n, setSelectedLang: s } = $e(), { data: d, isFetching: c } = Je(), { mutate: p, isPending: h } = Dt(), { data: b } = At(), { data: w } = Ot(), f = Ke(
|
|
1568
|
+
M(w, "languages") || ["en"],
|
|
1569
|
+
(C) => !ie(d, { lang: C }) && C !== M(w, "fallbackLang")
|
|
1570
|
+
);
|
|
1571
|
+
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 pt-2", children: [
|
|
1572
|
+
/* @__PURE__ */ e.jsx("ul", { className: "space-y-2 mt-4", children: c ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1573
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1574
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1575
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1576
|
+
] }) : We(d, (C) => {
|
|
1577
|
+
const T = C.lang, m = C.slug, v = !C.primaryPage, F = T === l;
|
|
1578
|
+
return v ? null : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1579
|
+
/* @__PURE__ */ e.jsxs(
|
|
1580
|
+
"li",
|
|
1581
|
+
{
|
|
1582
|
+
className: `w-full p-2 rounded cursor-pointer flex items-center justify-between ${F ? "bg-gray-200" : "hover:bg-gray-100"}`,
|
|
1583
|
+
onClick: () => s(T),
|
|
1584
|
+
children: [
|
|
1585
|
+
/* @__PURE__ */ e.jsxs("div", { className: " flex-1 gap-x-3", children: [
|
|
1586
|
+
/* @__PURE__ */ e.jsx("div", { className: "text-[13px]", children: M(se, v ? n : T, T) }),
|
|
1587
|
+
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1588
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1589
|
+
"Slug:",
|
|
1590
|
+
/* @__PURE__ */ e.jsxs("b", { children: [
|
|
1591
|
+
" ",
|
|
1592
|
+
m
|
|
1593
|
+
] })
|
|
1594
|
+
] }),
|
|
1595
|
+
/* @__PURE__ */ e.jsxs("div", { className: "text-[11px] text-gray-500", children: [
|
|
1596
|
+
"Name:",
|
|
1597
|
+
/* @__PURE__ */ e.jsxs("b", { children: [
|
|
1598
|
+
" ",
|
|
1599
|
+
C.name,
|
|
1600
|
+
" "
|
|
1582
1601
|
] })
|
|
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
1602
|
] })
|
|
1619
1603
|
] })
|
|
1620
|
-
]
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1604
|
+
] }),
|
|
1605
|
+
v ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center text-[11px] text-orange-500 gap-x-1", children: [
|
|
1606
|
+
/* @__PURE__ */ e.jsx(Na, { fill: "orange", className: "w-3 h-3" }),
|
|
1607
|
+
/* @__PURE__ */ e.jsx("b", { children: " Default" })
|
|
1608
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-3", children: [
|
|
1609
|
+
/* @__PURE__ */ e.jsx(
|
|
1610
|
+
kt,
|
|
1611
|
+
{
|
|
1612
|
+
onClick: (y) => {
|
|
1613
|
+
y.stopPropagation(), i({ ...C, edit: !0 });
|
|
1614
|
+
},
|
|
1615
|
+
className: "w-3 h-3 hover:text-blue-500"
|
|
1616
|
+
}
|
|
1617
|
+
),
|
|
1618
|
+
/* @__PURE__ */ e.jsxs(ga, { children: [
|
|
1619
|
+
/* @__PURE__ */ e.jsx(pa, { children: /* @__PURE__ */ e.jsx(Et, { className: "w-3 h-3 hover:text-red-500" }) }),
|
|
1620
|
+
/* @__PURE__ */ e.jsx(xa, { children: /* @__PURE__ */ e.jsxs("div", { children: [
|
|
1621
|
+
/* @__PURE__ */ e.jsxs("p", { className: "pb-2 text-sm", children: [
|
|
1622
|
+
"Are you sure you want to remove",
|
|
1623
|
+
" ",
|
|
1624
|
+
/* @__PURE__ */ e.jsx("b", { children: M(se, T, T) }),
|
|
1625
|
+
" language?"
|
|
1626
|
+
] }),
|
|
1627
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-end w-full", children: /* @__PURE__ */ e.jsx(
|
|
1628
|
+
_,
|
|
1629
|
+
{
|
|
1630
|
+
size: "sm",
|
|
1631
|
+
variant: "destructive",
|
|
1632
|
+
disabled: h,
|
|
1633
|
+
onClick: () => p(C),
|
|
1634
|
+
children: h ? "Deleting..." : "Delete"
|
|
1635
|
+
}
|
|
1636
|
+
) })
|
|
1637
|
+
] }) })
|
|
1638
|
+
] })
|
|
1639
|
+
] })
|
|
1640
|
+
]
|
|
1641
|
+
},
|
|
1642
|
+
C.id
|
|
1643
|
+
),
|
|
1644
|
+
/* @__PURE__ */ e.jsx("div", { className: "h-1 w-full border-b" })
|
|
1645
|
+
] });
|
|
1646
|
+
}) }),
|
|
1647
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex justify-center w-full", children: /* @__PURE__ */ e.jsx(
|
|
1648
|
+
_,
|
|
1630
1649
|
{
|
|
1631
1650
|
variant: "default",
|
|
1632
1651
|
size: "sm",
|
|
1633
|
-
|
|
1652
|
+
disabled: q(f),
|
|
1653
|
+
onClick: () => i({
|
|
1654
|
+
name: b == null ? void 0 : b.name,
|
|
1655
|
+
lang: "",
|
|
1656
|
+
slug: "",
|
|
1657
|
+
edit: !1
|
|
1658
|
+
}),
|
|
1634
1659
|
children: "+ Add new language"
|
|
1635
1660
|
}
|
|
1636
1661
|
) }),
|
|
1637
|
-
|
|
1638
|
-
|
|
1662
|
+
a && /* @__PURE__ */ e.jsx(
|
|
1663
|
+
Qa,
|
|
1639
1664
|
{
|
|
1640
|
-
|
|
1641
|
-
|
|
1665
|
+
languages: f,
|
|
1666
|
+
langProps: a,
|
|
1642
1667
|
onClose: () => i(null)
|
|
1643
1668
|
}
|
|
1644
1669
|
)
|
|
1645
1670
|
] });
|
|
1646
|
-
}
|
|
1647
|
-
|
|
1671
|
+
};
|
|
1672
|
+
function Za({
|
|
1673
|
+
page: a,
|
|
1674
|
+
onClose: i,
|
|
1675
|
+
onDelete: l
|
|
1676
|
+
}) {
|
|
1677
|
+
const { mutate: n, isPending: s } = Dt(), d = () => {
|
|
1678
|
+
n(a, {
|
|
1679
|
+
onSuccess: () => {
|
|
1680
|
+
l();
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
};
|
|
1684
|
+
return /* @__PURE__ */ e.jsx(be, { open: !!a, onOpenChange: i, children: /* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1685
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
1686
|
+
/* @__PURE__ */ e.jsx(we, { children: "Confirm Deletion" }),
|
|
1687
|
+
/* @__PURE__ */ e.jsxs(Ce, { children: [
|
|
1688
|
+
"Are you sure you want to remove ",
|
|
1689
|
+
/* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
|
|
1690
|
+
" ",
|
|
1691
|
+
a != null && a.global ? "global block?" : "page? This will also delete all associated language pages."
|
|
1692
|
+
] })
|
|
1693
|
+
] }),
|
|
1694
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
1695
|
+
/* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: i, children: "Cancel" }),
|
|
1696
|
+
/* @__PURE__ */ e.jsx(_, { variant: "destructive", disabled: s, onClick: d, children: s ? "Deleting..." : "Delete" })
|
|
1697
|
+
] })
|
|
1698
|
+
] }) });
|
|
1699
|
+
}
|
|
1700
|
+
const en = ({
|
|
1701
|
+
page: a,
|
|
1702
|
+
onClose: i,
|
|
1703
|
+
onUnpublish: l
|
|
1704
|
+
}) => {
|
|
1705
|
+
const { mutate: n, isPending: s } = Ha(), d = async () => {
|
|
1706
|
+
n(a, {
|
|
1707
|
+
onSuccess: () => {
|
|
1708
|
+
l();
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
};
|
|
1712
|
+
return /* @__PURE__ */ e.jsx(be, { open: !!a, onOpenChange: i, children: /* @__PURE__ */ e.jsxs(ye, { children: [
|
|
1713
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
1714
|
+
/* @__PURE__ */ e.jsx(we, { children: "Confirm Unpublish" }),
|
|
1715
|
+
/* @__PURE__ */ e.jsxs(Ce, { children: [
|
|
1716
|
+
"Are you sure you want to unpublish ",
|
|
1717
|
+
/* @__PURE__ */ e.jsx("b", { children: (a == null ? void 0 : a.name) ?? (a == null ? void 0 : a.slug) }),
|
|
1718
|
+
"?"
|
|
1719
|
+
] })
|
|
1720
|
+
] }),
|
|
1721
|
+
/* @__PURE__ */ e.jsxs(Se, { children: [
|
|
1722
|
+
/* @__PURE__ */ e.jsx(_, { variant: "outline", onClick: i, children: "Cancel" }),
|
|
1723
|
+
/* @__PURE__ */ e.jsx(
|
|
1724
|
+
_,
|
|
1725
|
+
{
|
|
1726
|
+
variant: "destructive",
|
|
1727
|
+
disabled: s,
|
|
1728
|
+
onClick: d,
|
|
1729
|
+
children: s ? "Unpublishing..." : "Unpublish"
|
|
1730
|
+
}
|
|
1731
|
+
)
|
|
1732
|
+
] })
|
|
1733
|
+
] }) });
|
|
1734
|
+
}, tn = ({
|
|
1735
|
+
activePage: a,
|
|
1648
1736
|
editPage: i,
|
|
1649
|
-
onShowUpsertPage:
|
|
1737
|
+
onShowUpsertPage: l
|
|
1650
1738
|
}) => {
|
|
1651
|
-
const [
|
|
1652
|
-
|
|
1739
|
+
const [n, s] = A("pages"), { data: d, isFetching: c } = ze(), [p, h] = A(
|
|
1740
|
+
null
|
|
1741
|
+
), [b, w] = A(null), f = (C) => Ua(
|
|
1742
|
+
Ke(C, (m) => n === "pages" ? m.slug : !m.slug),
|
|
1653
1743
|
"name",
|
|
1654
1744
|
"asc"
|
|
1655
|
-
).map((
|
|
1656
|
-
|
|
1745
|
+
).map((m) => /* @__PURE__ */ e.jsxs(
|
|
1746
|
+
_,
|
|
1657
1747
|
{
|
|
1658
|
-
onClick: () => i(
|
|
1659
|
-
variant:
|
|
1748
|
+
onClick: () => i(m.id),
|
|
1749
|
+
variant: m.id === a ? "default" : "ghost",
|
|
1660
1750
|
className: "flex justify-between items-center w-full space-x-2 py-1",
|
|
1661
1751
|
children: [
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
|
|
1664
|
-
/* @__PURE__ */
|
|
1665
|
-
(
|
|
1752
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1753
|
+
m.global ? /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Tt, { className: "h-4 w-4" }),
|
|
1754
|
+
/* @__PURE__ */ e.jsx("span", { children: m.name ?? m.slug }),
|
|
1755
|
+
(m == null ? void 0 : m.slug) && /* @__PURE__ */ e.jsxs("span", { className: "text-xs font-light", children: [
|
|
1666
1756
|
"( ",
|
|
1667
|
-
|
|
1757
|
+
m.slug,
|
|
1668
1758
|
" )"
|
|
1669
1759
|
] })
|
|
1670
1760
|
] }),
|
|
1671
|
-
/* @__PURE__ */
|
|
1672
|
-
/* @__PURE__ */
|
|
1673
|
-
|
|
1761
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ e.jsxs(wa, { children: [
|
|
1762
|
+
/* @__PURE__ */ e.jsx(Ca, { asChild: !0, onClick: (v) => v.stopPropagation(), children: /* @__PURE__ */ e.jsx(
|
|
1763
|
+
_,
|
|
1674
1764
|
{
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
}
|
|
1765
|
+
variant: "ghost",
|
|
1766
|
+
size: "sm",
|
|
1767
|
+
className: `h-8 w-8 p-0 hover:bg-transparent ${m.id === a ? " hover:text-gray-200" : "bg-transparent "}`,
|
|
1768
|
+
children: /* @__PURE__ */ e.jsx(Pa, { className: "h-4 w-4" })
|
|
1679
1769
|
}
|
|
1680
|
-
),
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
/* @__PURE__ */
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
"
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1770
|
+
) }),
|
|
1771
|
+
/* @__PURE__ */ e.jsxs(Sa, { align: "end", className: "text-sm font-medium", children: [
|
|
1772
|
+
/* @__PURE__ */ e.jsxs(
|
|
1773
|
+
Be,
|
|
1774
|
+
{
|
|
1775
|
+
className: "flex items-center gap-2",
|
|
1776
|
+
onClick: (v) => {
|
|
1777
|
+
v.stopPropagation(), l({ ...m, global: n === "globalBlocks" });
|
|
1778
|
+
},
|
|
1779
|
+
children: [
|
|
1780
|
+
/* @__PURE__ */ e.jsx(kt, { className: "size-3", strokeWidth: 3 }),
|
|
1781
|
+
"Edit"
|
|
1782
|
+
]
|
|
1783
|
+
}
|
|
1784
|
+
),
|
|
1785
|
+
/* @__PURE__ */ e.jsxs(
|
|
1786
|
+
Be,
|
|
1787
|
+
{
|
|
1788
|
+
className: "flex items-center gap-2",
|
|
1789
|
+
onClick: (v) => {
|
|
1790
|
+
v.stopPropagation(), h(m);
|
|
1791
|
+
},
|
|
1792
|
+
children: [
|
|
1793
|
+
/* @__PURE__ */ e.jsx(Et, { className: "size-3", strokeWidth: 3 }),
|
|
1794
|
+
"Delete"
|
|
1795
|
+
]
|
|
1796
|
+
}
|
|
1797
|
+
),
|
|
1798
|
+
/* @__PURE__ */ e.jsxs(
|
|
1799
|
+
Be,
|
|
1800
|
+
{
|
|
1801
|
+
className: "flex items-center gap-2",
|
|
1802
|
+
onClick: (v) => {
|
|
1803
|
+
v.stopPropagation(), w(m);
|
|
1804
|
+
},
|
|
1805
|
+
children: [
|
|
1806
|
+
/* @__PURE__ */ e.jsx(_a, { className: "size-3", strokeWidth: 3 }),
|
|
1807
|
+
"Unpublish"
|
|
1808
|
+
]
|
|
1809
|
+
}
|
|
1810
|
+
)
|
|
1704
1811
|
] })
|
|
1705
|
-
] })
|
|
1812
|
+
] }) })
|
|
1706
1813
|
]
|
|
1707
1814
|
},
|
|
1708
|
-
|
|
1815
|
+
m.id
|
|
1709
1816
|
));
|
|
1710
|
-
return /* @__PURE__ */
|
|
1711
|
-
/* @__PURE__ */
|
|
1712
|
-
/* @__PURE__ */
|
|
1713
|
-
/* @__PURE__ */
|
|
1714
|
-
/* @__PURE__ */
|
|
1715
|
-
/* @__PURE__ */
|
|
1817
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1818
|
+
/* @__PURE__ */ e.jsx("br", {}),
|
|
1819
|
+
/* @__PURE__ */ e.jsxs(va, { value: n, className: "w-full", onValueChange: s, children: [
|
|
1820
|
+
/* @__PURE__ */ e.jsxs(ba, { className: "w-full", children: [
|
|
1821
|
+
/* @__PURE__ */ e.jsx(pt, { value: "pages", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Pages" }) }),
|
|
1822
|
+
/* @__PURE__ */ e.jsx(pt, { value: "globalBlocks", className: "w-full", children: /* @__PURE__ */ e.jsx("div", { className: "px-4", children: "Global Blocks" }) })
|
|
1716
1823
|
] }),
|
|
1717
|
-
c ? /* @__PURE__ */
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
1720
|
-
/* @__PURE__ */
|
|
1721
|
-
] }) : /* @__PURE__ */
|
|
1722
|
-
/* @__PURE__ */
|
|
1824
|
+
c ? /* @__PURE__ */ e.jsxs("div", { className: "w-full space-y-3 py-4", children: [
|
|
1825
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1826
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" }),
|
|
1827
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full h-8 rounded bg-gray-300 animate-pulse" })
|
|
1828
|
+
] }) : /* @__PURE__ */ e.jsxs("div", { className: "py-4 space-y-3", children: [
|
|
1829
|
+
/* @__PURE__ */ e.jsx(ya, { children: /* @__PURE__ */ e.jsxs(ja, { className: "text-xs text-muted-foreground text-center text-light", children: [
|
|
1723
1830
|
"Manage your ",
|
|
1724
|
-
|
|
1831
|
+
n === "pages" ? "pages" : "global blocks"
|
|
1725
1832
|
] }) }),
|
|
1726
|
-
/* @__PURE__ */
|
|
1727
|
-
|
|
1833
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-full flex justify-center", children: /* @__PURE__ */ e.jsxs(
|
|
1834
|
+
_,
|
|
1728
1835
|
{
|
|
1729
1836
|
variant: "default",
|
|
1730
1837
|
size: "sm",
|
|
1731
1838
|
disabled: c,
|
|
1732
|
-
onClick: () =>
|
|
1839
|
+
onClick: () => l({
|
|
1733
1840
|
slug: "",
|
|
1734
1841
|
name: "",
|
|
1735
|
-
global:
|
|
1842
|
+
global: n === "globalBlocks"
|
|
1736
1843
|
}),
|
|
1737
1844
|
className: "mb-4 w-1/2 bg-blue-500 hover:bg-blue-400",
|
|
1738
1845
|
children: [
|
|
1739
|
-
/* @__PURE__ */
|
|
1740
|
-
c ? "Loading..." : `Add new
|
|
1846
|
+
/* @__PURE__ */ e.jsx(Ta, { className: "h-4 w-4 mr-2" }),
|
|
1847
|
+
c ? "Loading..." : `Add new ${n === "pages" ? "page" : "global block"}`
|
|
1741
1848
|
]
|
|
1742
1849
|
}
|
|
1743
1850
|
) }),
|
|
1744
|
-
/* @__PURE__ */
|
|
1851
|
+
/* @__PURE__ */ e.jsx("div", { className: "pt-4", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-2", children: c ? /* @__PURE__ */ e.jsx(an, {}) : f(d) }) })
|
|
1745
1852
|
] })
|
|
1746
|
-
] })
|
|
1853
|
+
] }),
|
|
1854
|
+
/* @__PURE__ */ e.jsx(
|
|
1855
|
+
Za,
|
|
1856
|
+
{
|
|
1857
|
+
page: p,
|
|
1858
|
+
onClose: () => h(null),
|
|
1859
|
+
onDelete: () => {
|
|
1860
|
+
h(null);
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
),
|
|
1864
|
+
/* @__PURE__ */ e.jsx(
|
|
1865
|
+
en,
|
|
1866
|
+
{
|
|
1867
|
+
page: b,
|
|
1868
|
+
onClose: () => w(null),
|
|
1869
|
+
onUnpublish: () => {
|
|
1870
|
+
w(null);
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
)
|
|
1747
1874
|
] });
|
|
1748
|
-
}
|
|
1749
|
-
|
|
1875
|
+
};
|
|
1876
|
+
function an() {
|
|
1877
|
+
return /* @__PURE__ */ e.jsx("div", { className: "h-32 w-full flex justify-center items-center text-sm animate-pulse", children: "Loading..." });
|
|
1878
|
+
}
|
|
1879
|
+
const nn = ({
|
|
1880
|
+
editPage: a,
|
|
1750
1881
|
showUpsertPage: i,
|
|
1751
|
-
setShowUpsertPage:
|
|
1882
|
+
setShowUpsertPage: l
|
|
1752
1883
|
}) => {
|
|
1753
|
-
const
|
|
1754
|
-
|
|
1884
|
+
const n = i.id, [s, d] = A(n && i.name || ""), [c, p] = A(n && i.slug || ""), { mutate: h, isPending: b } = Rt(), { mutate: w, isPending: f } = Ye(), C = b || f, T = () => {
|
|
1885
|
+
n ? w(
|
|
1755
1886
|
{
|
|
1756
1887
|
name: s,
|
|
1757
1888
|
slug: c,
|
|
@@ -1760,66 +1891,66 @@ const $a = ({
|
|
|
1760
1891
|
},
|
|
1761
1892
|
{
|
|
1762
1893
|
onSuccess: () => {
|
|
1763
|
-
|
|
1894
|
+
l(void 0);
|
|
1764
1895
|
}
|
|
1765
1896
|
}
|
|
1766
|
-
) :
|
|
1897
|
+
) : h(
|
|
1767
1898
|
{
|
|
1768
1899
|
name: s,
|
|
1769
1900
|
slug: c,
|
|
1770
1901
|
global: !!i.global
|
|
1771
1902
|
},
|
|
1772
1903
|
{
|
|
1773
|
-
onSuccess: (
|
|
1774
|
-
|
|
1904
|
+
onSuccess: (m) => {
|
|
1905
|
+
a(m.id);
|
|
1775
1906
|
}
|
|
1776
1907
|
}
|
|
1777
1908
|
);
|
|
1778
1909
|
};
|
|
1779
|
-
return /* @__PURE__ */
|
|
1780
|
-
|
|
1910
|
+
return /* @__PURE__ */ e.jsx(
|
|
1911
|
+
be,
|
|
1781
1912
|
{
|
|
1782
1913
|
open: !!i,
|
|
1783
|
-
onOpenChange: () =>
|
|
1784
|
-
children: /* @__PURE__ */
|
|
1785
|
-
/* @__PURE__ */
|
|
1786
|
-
/* @__PURE__ */
|
|
1787
|
-
|
|
1914
|
+
onOpenChange: () => l(void 0),
|
|
1915
|
+
children: /* @__PURE__ */ e.jsxs(ye, { className: "sm:max-w-[425px]", children: [
|
|
1916
|
+
/* @__PURE__ */ e.jsxs(je, { children: [
|
|
1917
|
+
/* @__PURE__ */ e.jsxs(we, { children: [
|
|
1918
|
+
n ? "Edit" : "Add New",
|
|
1788
1919
|
" ",
|
|
1789
1920
|
i.global ? "Global Block" : "Page"
|
|
1790
1921
|
] }),
|
|
1791
|
-
/* @__PURE__ */
|
|
1922
|
+
/* @__PURE__ */ e.jsxs(Ce, { children: [
|
|
1792
1923
|
"Enter the details for the new",
|
|
1793
1924
|
" ",
|
|
1794
1925
|
i.global ? "global block. Identifier should be unique." : "page. Slug must start with /"
|
|
1795
1926
|
] })
|
|
1796
1927
|
] }),
|
|
1797
|
-
/* @__PURE__ */
|
|
1798
|
-
/* @__PURE__ */
|
|
1799
|
-
/* @__PURE__ */
|
|
1800
|
-
/* @__PURE__ */
|
|
1801
|
-
/* @__PURE__ */
|
|
1802
|
-
|
|
1928
|
+
/* @__PURE__ */ e.jsxs("form", { children: [
|
|
1929
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid gap-4 py-4", children: [
|
|
1930
|
+
/* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1931
|
+
/* @__PURE__ */ e.jsx(R, { htmlFor: "name", className: "text-right", children: "Name" }),
|
|
1932
|
+
/* @__PURE__ */ e.jsx(
|
|
1933
|
+
G,
|
|
1803
1934
|
{
|
|
1804
1935
|
id: "name",
|
|
1805
1936
|
value: s,
|
|
1806
1937
|
placeholder: `Enter ${i.global ? "global block" : "page"} name`,
|
|
1807
|
-
onChange: (
|
|
1938
|
+
onChange: (m) => d(m.target.value),
|
|
1808
1939
|
className: "col-span-3",
|
|
1809
1940
|
required: !0
|
|
1810
1941
|
}
|
|
1811
1942
|
)
|
|
1812
1943
|
] }),
|
|
1813
|
-
!i.global && /* @__PURE__ */
|
|
1814
|
-
/* @__PURE__ */
|
|
1815
|
-
/* @__PURE__ */
|
|
1816
|
-
|
|
1944
|
+
!i.global && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1", children: [
|
|
1945
|
+
/* @__PURE__ */ e.jsx(R, { htmlFor: "slug", className: "text-right", children: i.global ? "Identifier" : "Slug" }),
|
|
1946
|
+
/* @__PURE__ */ e.jsx(
|
|
1947
|
+
G,
|
|
1817
1948
|
{
|
|
1818
1949
|
id: "slug",
|
|
1819
1950
|
value: c,
|
|
1820
|
-
onChange: (
|
|
1821
|
-
var
|
|
1822
|
-
return
|
|
1951
|
+
onChange: (m) => {
|
|
1952
|
+
var v;
|
|
1953
|
+
return p((v = m.target.value) == null ? void 0 : v.trim().toLowerCase());
|
|
1823
1954
|
},
|
|
1824
1955
|
className: "col-span-3",
|
|
1825
1956
|
required: !0,
|
|
@@ -1830,13 +1961,13 @@ const $a = ({
|
|
|
1830
1961
|
)
|
|
1831
1962
|
] })
|
|
1832
1963
|
] }),
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
|
|
1964
|
+
/* @__PURE__ */ e.jsx(Se, { children: /* @__PURE__ */ e.jsx(
|
|
1965
|
+
_,
|
|
1835
1966
|
{
|
|
1836
|
-
onClick:
|
|
1967
|
+
onClick: T,
|
|
1837
1968
|
type: "button",
|
|
1838
|
-
disabled:
|
|
1839
|
-
children:
|
|
1969
|
+
disabled: C || !s || !i.global && !c.startsWith("/") || Ge(i.name, s) && Ge(i.slug, c),
|
|
1970
|
+
children: C ? n ? "Updating..." : "Adding..." : i.global ? `${n ? "Update" : "Add"} global block` : `${n ? "Update" : "Add"} Page`
|
|
1840
1971
|
}
|
|
1841
1972
|
) })
|
|
1842
1973
|
] })
|
|
@@ -1844,37 +1975,37 @@ const $a = ({
|
|
|
1844
1975
|
}
|
|
1845
1976
|
);
|
|
1846
1977
|
};
|
|
1847
|
-
function
|
|
1848
|
-
const { activePage: i, canClose:
|
|
1849
|
-
window.history.pushState({}, "", `?page=${
|
|
1978
|
+
function sn(a) {
|
|
1979
|
+
const { activePage: i, canClose: l, open: n, close: s } = a, [, d] = le(), [c, p] = A(), h = (b) => {
|
|
1980
|
+
window.history.pushState({}, "", `?page=${b}`), d(new URLSearchParams({ page: b })), window.dispatchEvent(new PopStateEvent("popstate")), p(void 0), s();
|
|
1850
1981
|
};
|
|
1851
|
-
return /* @__PURE__ */
|
|
1852
|
-
|
|
1982
|
+
return /* @__PURE__ */ e.jsx(
|
|
1983
|
+
ka,
|
|
1853
1984
|
{
|
|
1854
|
-
open:
|
|
1855
|
-
onOpenChange: (
|
|
1856
|
-
!
|
|
1985
|
+
open: n,
|
|
1986
|
+
onOpenChange: (b) => {
|
|
1987
|
+
!b && l && s();
|
|
1857
1988
|
},
|
|
1858
|
-
children: /* @__PURE__ */
|
|
1859
|
-
|
|
1989
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
1990
|
+
Ea,
|
|
1860
1991
|
{
|
|
1861
1992
|
side: "left",
|
|
1862
|
-
className: `border-border w-full ${
|
|
1993
|
+
className: `border-border w-full ${l ? "" : "sheet-hide-close-btn"}`,
|
|
1863
1994
|
children: [
|
|
1864
|
-
/* @__PURE__ */
|
|
1865
|
-
|
|
1995
|
+
/* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
|
|
1996
|
+
tn,
|
|
1866
1997
|
{
|
|
1867
|
-
onShowUpsertPage: (
|
|
1998
|
+
onShowUpsertPage: (b) => p(b),
|
|
1868
1999
|
activePage: i,
|
|
1869
|
-
editPage:
|
|
2000
|
+
editPage: h
|
|
1870
2001
|
}
|
|
1871
2002
|
) }),
|
|
1872
|
-
c && /* @__PURE__ */
|
|
1873
|
-
|
|
2003
|
+
c && /* @__PURE__ */ e.jsx(
|
|
2004
|
+
nn,
|
|
1874
2005
|
{
|
|
1875
|
-
editPage:
|
|
2006
|
+
editPage: h,
|
|
1876
2007
|
showUpsertPage: c,
|
|
1877
|
-
setShowUpsertPage:
|
|
2008
|
+
setShowUpsertPage: p
|
|
1878
2009
|
}
|
|
1879
2010
|
)
|
|
1880
2011
|
]
|
|
@@ -1883,87 +2014,98 @@ function za(r) {
|
|
|
1883
2014
|
}
|
|
1884
2015
|
);
|
|
1885
2016
|
}
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
2017
|
+
ca();
|
|
2018
|
+
const rn = (a) => {
|
|
2019
|
+
const i = St([]), [l] = le(), n = l.get("page"), { data: s, isFetching: d } = _t(), { data: c } = Ka(), { data: p, isFetching: h } = Wa(), { blocks: b, theme: w } = Va(p), { data: f } = Ot(), { data: C } = Je(), T = qa(), { uploadFile: m } = Ja(), { getUILibraryBlock: v, getUILibraryBlocks: F, onSave: y } = $a(), { getGlobalBlocks: k, getGlobalBlockBlocks: ke } = za(), { mutate: Ee, isPending: oe } = Ya(), { aiContext: Q, setAiContext: Ne } = Ve();
|
|
2020
|
+
i.current = b;
|
|
2021
|
+
const [Te, X] = A(!1), [K, Pe] = A("SAVED");
|
|
2022
|
+
qe(() => {
|
|
2023
|
+
const E = (U) => {
|
|
2024
|
+
K === "UNSAVED" && (U.preventDefault(), U.returnValue = !1);
|
|
1893
2025
|
};
|
|
1894
|
-
return K === "UNSAVED" && window.addEventListener("beforeunload",
|
|
1895
|
-
window.removeEventListener("beforeunload",
|
|
2026
|
+
return K === "UNSAVED" && window.addEventListener("beforeunload", E), () => {
|
|
2027
|
+
window.removeEventListener("beforeunload", E);
|
|
1896
2028
|
};
|
|
1897
2029
|
}, [K]);
|
|
1898
|
-
const
|
|
1899
|
-
const
|
|
1900
|
-
return
|
|
1901
|
-
}, [
|
|
1902
|
-
return /* @__PURE__ */
|
|
1903
|
-
/* @__PURE__ */
|
|
1904
|
-
|
|
2030
|
+
const ce = ne(() => {
|
|
2031
|
+
const E = {};
|
|
2032
|
+
return f != null && f.theme && (E.brandingOptions = f.theme), E;
|
|
2033
|
+
}, [f]), I = ne(() => Array.isArray(a == null ? void 0 : a.uiLibraries) ? [...c, ...a == null ? void 0 : a.uiLibraries] : c, [c, a == null ? void 0 : a.uiLibraries]);
|
|
2034
|
+
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2035
|
+
/* @__PURE__ */ e.jsx(
|
|
2036
|
+
da,
|
|
1905
2037
|
{
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
2038
|
+
loading: h,
|
|
2039
|
+
...a.fallbackLang && {
|
|
2040
|
+
fallbackLang: a.fallbackLang || "en"
|
|
2041
|
+
},
|
|
2042
|
+
...a.languages && {
|
|
2043
|
+
languages: We(C, "lang") || []
|
|
2044
|
+
},
|
|
2045
|
+
translations: a.translations || {},
|
|
2046
|
+
locale: a.locale || "en",
|
|
2047
|
+
htmlDir: a.htmlDir || "ltr",
|
|
2048
|
+
autoSaveSupport: a.autoSaveSupport || !1,
|
|
2049
|
+
autoSaveInterval: a.autoSaveInterval || 15,
|
|
2050
|
+
uploadMediaCallback: m,
|
|
2051
|
+
onError: a.onError || console.error,
|
|
2052
|
+
getGlobalBlockBlocks: ke,
|
|
2053
|
+
getGlobalBlocks: k,
|
|
2054
|
+
blocks: b,
|
|
2055
|
+
getUILibraryBlock: v,
|
|
2056
|
+
getUILibraryBlocks: F,
|
|
2057
|
+
brandingOptions: w,
|
|
2058
|
+
uiLibraries: I,
|
|
2059
|
+
saveAiContextCallback: async (E) => {
|
|
2060
|
+
if (!n) return !0;
|
|
2061
|
+
const U = i.current, W = {
|
|
2062
|
+
_type: "@chai/ai-context",
|
|
2063
|
+
_value: vt(E) ? E : ""
|
|
2064
|
+
}, ue = [...U, W];
|
|
2065
|
+
return await y({ page: n, blocks: ue }), Ne(E), !0;
|
|
2066
|
+
},
|
|
2067
|
+
onSaveStateChange: (E) => Pe(E),
|
|
1924
2068
|
aiContext: Q,
|
|
1925
|
-
askAiCallBack:
|
|
1926
|
-
onSave: async ({ blocks:
|
|
1927
|
-
if (!
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
_value: T
|
|
1931
|
-
}, M = {
|
|
2069
|
+
askAiCallBack: T,
|
|
2070
|
+
onSave: async ({ blocks: E }) => {
|
|
2071
|
+
if (!n) return !0;
|
|
2072
|
+
i.current = E;
|
|
2073
|
+
const U = {
|
|
1932
2074
|
_type: "@chai/ai-context",
|
|
1933
|
-
_value:
|
|
1934
|
-
},
|
|
1935
|
-
return await
|
|
2075
|
+
_value: vt(Q) ? Q : ""
|
|
2076
|
+
}, W = [...E, U];
|
|
2077
|
+
return await y({ page: n, blocks: W }), i.current = E, !0;
|
|
1936
2078
|
},
|
|
1937
2079
|
topBarComponents: {
|
|
1938
2080
|
left: [
|
|
1939
|
-
() => /* @__PURE__ */
|
|
1940
|
-
|
|
2081
|
+
() => /* @__PURE__ */ e.jsxs(
|
|
2082
|
+
_,
|
|
1941
2083
|
{
|
|
1942
2084
|
variant: "default",
|
|
1943
2085
|
className: "flex justify-start max-w-[250px] items-center w-full space-x-2 py-1",
|
|
1944
|
-
onClick: () =>
|
|
2086
|
+
onClick: () => X(!0),
|
|
1945
2087
|
children: [
|
|
1946
|
-
|
|
1947
|
-
/* @__PURE__ */
|
|
1948
|
-
/* @__PURE__ */
|
|
2088
|
+
Pt(s.slug, "/") ? /* @__PURE__ */ e.jsx(Tt, { className: "h-4 w-4" }) : /* @__PURE__ */ e.jsx(Nt, { className: "h-4 w-4" }),
|
|
2089
|
+
/* @__PURE__ */ e.jsx("span", { className: "truncate", children: (s == null ? void 0 : s.name) ?? "" }),
|
|
2090
|
+
/* @__PURE__ */ e.jsx(Oa, { className: "h-4 w-4" })
|
|
1949
2091
|
]
|
|
1950
2092
|
},
|
|
1951
2093
|
"template-viewer"
|
|
1952
2094
|
)
|
|
1953
2095
|
],
|
|
1954
2096
|
right: [
|
|
1955
|
-
() => /* @__PURE__ */
|
|
1956
|
-
|
|
2097
|
+
() => /* @__PURE__ */ e.jsxs(
|
|
2098
|
+
_,
|
|
1957
2099
|
{
|
|
1958
|
-
disabled:
|
|
2100
|
+
disabled: oe || K !== "SAVED",
|
|
1959
2101
|
size: "sm",
|
|
1960
2102
|
variant: "default",
|
|
1961
|
-
onClick: () =>
|
|
2103
|
+
onClick: () => Ee(n),
|
|
1962
2104
|
children: [
|
|
1963
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ e.jsx(Ra, { className: "h-4 w-4" }),
|
|
1964
2106
|
" ",
|
|
1965
2107
|
" ",
|
|
1966
|
-
|
|
2108
|
+
oe ? "Publishing..." : "Publish"
|
|
1967
2109
|
]
|
|
1968
2110
|
}
|
|
1969
2111
|
)
|
|
@@ -1971,11 +2113,11 @@ const Ja = (r) => {
|
|
|
1971
2113
|
},
|
|
1972
2114
|
sideBarComponents: {
|
|
1973
2115
|
top: [
|
|
1974
|
-
...
|
|
2116
|
+
...s != null && s.global ? [] : [
|
|
1975
2117
|
{
|
|
1976
2118
|
label: "SEO Setting",
|
|
1977
|
-
component:
|
|
1978
|
-
icon: /* @__PURE__ */
|
|
2119
|
+
component: Ft,
|
|
2120
|
+
icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs(
|
|
1979
2121
|
"svg",
|
|
1980
2122
|
{
|
|
1981
2123
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1984,25 +2126,25 @@ const Ja = (r) => {
|
|
|
1984
2126
|
width: "21",
|
|
1985
2127
|
height: "21",
|
|
1986
2128
|
children: [
|
|
1987
|
-
/* @__PURE__ */
|
|
1988
|
-
/* @__PURE__ */
|
|
2129
|
+
/* @__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" }),
|
|
2130
|
+
/* @__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
2131
|
]
|
|
1990
2132
|
}
|
|
1991
2133
|
) })
|
|
1992
2134
|
}
|
|
1993
|
-
]
|
|
1994
|
-
...(
|
|
2135
|
+
],
|
|
2136
|
+
...(f == null ? void 0 : f.languages.length) > 0 ? [
|
|
1995
2137
|
{
|
|
1996
2138
|
label: "Language Pages",
|
|
1997
|
-
component:
|
|
1998
|
-
icon: /* @__PURE__ */
|
|
2139
|
+
component: Xa,
|
|
2140
|
+
icon: /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsx(
|
|
1999
2141
|
"svg",
|
|
2000
2142
|
{
|
|
2001
2143
|
width: "21",
|
|
2002
2144
|
height: "21",
|
|
2003
2145
|
viewBox: "0 0 21 21",
|
|
2004
2146
|
fill: "currentColor",
|
|
2005
|
-
children: /* @__PURE__ */
|
|
2147
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
2006
2148
|
"g",
|
|
2007
2149
|
{
|
|
2008
2150
|
fill: "none",
|
|
@@ -2011,10 +2153,10 @@ const Ja = (r) => {
|
|
|
2011
2153
|
"stroke-linecap": "round",
|
|
2012
2154
|
"stroke-linejoin": "round",
|
|
2013
2155
|
children: [
|
|
2014
|
-
/* @__PURE__ */
|
|
2015
|
-
/* @__PURE__ */
|
|
2016
|
-
/* @__PURE__ */
|
|
2017
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__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" }),
|
|
2157
|
+
/* @__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" }),
|
|
2158
|
+
/* @__PURE__ */ e.jsx("path", { d: "M7.5 12.503h-3M9 14l-1 1q-.5.5-2.5 1.5" }),
|
|
2159
|
+
/* @__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
2160
|
]
|
|
2019
2161
|
}
|
|
2020
2162
|
)
|
|
@@ -2024,22 +2166,22 @@ const Ja = (r) => {
|
|
|
2024
2166
|
] : []
|
|
2025
2167
|
]
|
|
2026
2168
|
},
|
|
2027
|
-
...
|
|
2169
|
+
...ce
|
|
2028
2170
|
}
|
|
2029
2171
|
),
|
|
2030
|
-
/* @__PURE__ */
|
|
2031
|
-
|
|
2172
|
+
/* @__PURE__ */ e.jsx(
|
|
2173
|
+
sn,
|
|
2032
2174
|
{
|
|
2033
|
-
activePage:
|
|
2034
|
-
canClose: !!
|
|
2035
|
-
open: !
|
|
2036
|
-
close: () =>
|
|
2175
|
+
activePage: n || "",
|
|
2176
|
+
canClose: !!n && !q(s),
|
|
2177
|
+
open: !n || !d && q(s) || Te,
|
|
2178
|
+
close: () => X(!1)
|
|
2037
2179
|
}
|
|
2038
2180
|
)
|
|
2039
2181
|
] });
|
|
2040
|
-
},
|
|
2182
|
+
}, jt = new ha({
|
|
2041
2183
|
defaultOptions: { queries: { refetchOnWindowFocus: !1 } }
|
|
2042
|
-
}),
|
|
2184
|
+
}), mn = (a) => (jt.setQueryData(["builder_props"], a), /* @__PURE__ */ e.jsx(fa, { client: jt, children: /* @__PURE__ */ e.jsx(rn, { ...a }) }));
|
|
2043
2185
|
export {
|
|
2044
|
-
|
|
2186
|
+
mn as default
|
|
2045
2187
|
};
|