@qwanyx/stack 0.1.0
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/README.md +228 -0
- package/dist/index.cjs.js +34 -0
- package/dist/index.esm.js +1599 -0
- package/package.json +41 -0
|
@@ -0,0 +1,1599 @@
|
|
|
1
|
+
var br = Object.defineProperty;
|
|
2
|
+
var wr = (u, r, n) => r in u ? br(u, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : u[r] = n;
|
|
3
|
+
var ge = (u, r, n) => wr(u, typeof r != "symbol" ? r + "" : r, n);
|
|
4
|
+
import qe, { useState as L, useCallback as X, useEffect as oe, useMemo as _r, useRef as Be } from "react";
|
|
5
|
+
class Or {
|
|
6
|
+
constructor(r) {
|
|
7
|
+
ge(this, "config");
|
|
8
|
+
if (!r.system_id)
|
|
9
|
+
throw new Error("GraphClient: system_id is REQUIRED. No system_id → No start.");
|
|
10
|
+
this.config = r;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Call the Graph coprocessor
|
|
14
|
+
*/
|
|
15
|
+
async callGraph(r, n = {}) {
|
|
16
|
+
const a = {
|
|
17
|
+
coprocessor: "graph",
|
|
18
|
+
method: r,
|
|
19
|
+
system_id: this.config.system_id,
|
|
20
|
+
params: n
|
|
21
|
+
};
|
|
22
|
+
try {
|
|
23
|
+
const i = await fetch(`${this.config.baseUrl}/spu/invoke`, {
|
|
24
|
+
method: "POST",
|
|
25
|
+
headers: {
|
|
26
|
+
"Content-Type": "application/json",
|
|
27
|
+
Authorization: `Bearer ${this.getToken()}`
|
|
28
|
+
},
|
|
29
|
+
body: JSON.stringify(a)
|
|
30
|
+
});
|
|
31
|
+
if (!i.ok) {
|
|
32
|
+
const c = await i.text();
|
|
33
|
+
throw new Error(`API error (${i.status}): ${c}`);
|
|
34
|
+
}
|
|
35
|
+
const l = await i.json();
|
|
36
|
+
if (!l.success && l.error)
|
|
37
|
+
throw new Error(l.error);
|
|
38
|
+
return l;
|
|
39
|
+
} catch (i) {
|
|
40
|
+
throw console.error("Graph API call failed:", i), i;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get auth token from localStorage (browser) or return empty string
|
|
45
|
+
*/
|
|
46
|
+
getToken() {
|
|
47
|
+
return typeof window < "u" && window.localStorage && localStorage.getItem("qwanyx_token") || "";
|
|
48
|
+
}
|
|
49
|
+
// ===== NODE OPERATIONS =====
|
|
50
|
+
/**
|
|
51
|
+
* Get children nodes
|
|
52
|
+
*/
|
|
53
|
+
async getChildren(r) {
|
|
54
|
+
return (await this.callGraph("get_children", {
|
|
55
|
+
parent_id: r
|
|
56
|
+
})).result || [];
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Get a specific node by ID
|
|
60
|
+
*/
|
|
61
|
+
async getNode(r) {
|
|
62
|
+
return (await this.callGraph("get_node", {
|
|
63
|
+
node_id: r
|
|
64
|
+
})).result || null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Add a new node
|
|
68
|
+
*/
|
|
69
|
+
async addNode(r) {
|
|
70
|
+
const n = {
|
|
71
|
+
...r,
|
|
72
|
+
created: r.created || (/* @__PURE__ */ new Date()).toISOString(),
|
|
73
|
+
modified: (/* @__PURE__ */ new Date()).toISOString()
|
|
74
|
+
}, a = await this.callGraph("add_node", n);
|
|
75
|
+
if (!a.result)
|
|
76
|
+
throw new Error("Failed to add node");
|
|
77
|
+
return a.result;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Update an existing node
|
|
81
|
+
*/
|
|
82
|
+
async updateNode(r, n) {
|
|
83
|
+
const a = {
|
|
84
|
+
node_id: r,
|
|
85
|
+
updates: {
|
|
86
|
+
...n,
|
|
87
|
+
modified: (/* @__PURE__ */ new Date()).toISOString()
|
|
88
|
+
}
|
|
89
|
+
}, i = await this.callGraph("update_node", a);
|
|
90
|
+
if (!i.result)
|
|
91
|
+
throw new Error("Failed to update node");
|
|
92
|
+
return i.result;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Delete a node
|
|
96
|
+
*/
|
|
97
|
+
async deleteNode(r, n = !1) {
|
|
98
|
+
return (await this.callGraph("delete_node", {
|
|
99
|
+
node_id: r,
|
|
100
|
+
cascade: n
|
|
101
|
+
})).success === !0;
|
|
102
|
+
}
|
|
103
|
+
// ===== EDGE OPERATIONS =====
|
|
104
|
+
/**
|
|
105
|
+
* Get children with edges (supports different display modes)
|
|
106
|
+
*/
|
|
107
|
+
async getChildrenWithEdges(r, n = "children", a, i) {
|
|
108
|
+
return (await this.callGraph("get_children_with_edges", {
|
|
109
|
+
node_id: r,
|
|
110
|
+
display_mode: n,
|
|
111
|
+
edge_type: a,
|
|
112
|
+
node_type: i
|
|
113
|
+
})).result || [];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Add an edge between two nodes
|
|
117
|
+
*/
|
|
118
|
+
async addEdge(r, n, a = "link", i) {
|
|
119
|
+
return await this.callGraph("add_edge", {
|
|
120
|
+
source_id: r,
|
|
121
|
+
target_id: n,
|
|
122
|
+
edge_type: a,
|
|
123
|
+
data: i
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Delete an edge
|
|
128
|
+
*/
|
|
129
|
+
async deleteEdge(r, n, a) {
|
|
130
|
+
return await this.callGraph("delete_edge", {
|
|
131
|
+
source_id: r,
|
|
132
|
+
target_id: n,
|
|
133
|
+
edge_type: a
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get edges from a source node
|
|
138
|
+
*/
|
|
139
|
+
async getEdges(r, n) {
|
|
140
|
+
return (await this.callGraph("get_edges", {
|
|
141
|
+
source_id: r,
|
|
142
|
+
edge_type: n
|
|
143
|
+
})).result || [];
|
|
144
|
+
}
|
|
145
|
+
// ===== HIERARCHY OPERATIONS =====
|
|
146
|
+
/**
|
|
147
|
+
* Get ancestors of a node (path from root to node)
|
|
148
|
+
*/
|
|
149
|
+
async getAncestors(r) {
|
|
150
|
+
return (await this.callGraph("get_ancestors", {
|
|
151
|
+
node_id: r
|
|
152
|
+
})).ancestors || [];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Get tree structure starting from a root
|
|
156
|
+
*/
|
|
157
|
+
async getTree(r, n = 10) {
|
|
158
|
+
return (await this.callGraph("get_tree", {
|
|
159
|
+
root_id: r,
|
|
160
|
+
max_depth: n
|
|
161
|
+
})).tree || [];
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Move a node to a new parent
|
|
165
|
+
*/
|
|
166
|
+
async moveNode(r, n) {
|
|
167
|
+
const a = await this.callGraph("move", {
|
|
168
|
+
node_id: r,
|
|
169
|
+
new_parent_id: n
|
|
170
|
+
});
|
|
171
|
+
if (!a.node)
|
|
172
|
+
throw new Error("Failed to move node");
|
|
173
|
+
return a.node;
|
|
174
|
+
}
|
|
175
|
+
// ===== SEARCH =====
|
|
176
|
+
/**
|
|
177
|
+
* Search nodes by query
|
|
178
|
+
*/
|
|
179
|
+
async searchNodes(r, n) {
|
|
180
|
+
return (await this.callGraph("search", {
|
|
181
|
+
query: r,
|
|
182
|
+
type: n
|
|
183
|
+
})).nodes || [];
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
const ve = "qwanyx_auth_token", ye = "qwanyx_refresh_token";
|
|
187
|
+
class Er {
|
|
188
|
+
/**
|
|
189
|
+
* Store authentication token
|
|
190
|
+
*/
|
|
191
|
+
static setToken(r) {
|
|
192
|
+
typeof window < "u" && localStorage.setItem(ve, r);
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get authentication token
|
|
196
|
+
*/
|
|
197
|
+
static getToken() {
|
|
198
|
+
return typeof window < "u" ? localStorage.getItem(ve) : null;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Remove authentication token
|
|
202
|
+
*/
|
|
203
|
+
static clearToken() {
|
|
204
|
+
typeof window < "u" && (localStorage.removeItem(ve), localStorage.removeItem(ye));
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* Store refresh token
|
|
208
|
+
*/
|
|
209
|
+
static setRefreshToken(r) {
|
|
210
|
+
typeof window < "u" && localStorage.setItem(ye, r);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Get refresh token
|
|
214
|
+
*/
|
|
215
|
+
static getRefreshToken() {
|
|
216
|
+
return typeof window < "u" ? localStorage.getItem(ye) : null;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Check if user is authenticated
|
|
220
|
+
*/
|
|
221
|
+
static isAuthenticated() {
|
|
222
|
+
return !!this.getToken();
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Get authorization header
|
|
226
|
+
*/
|
|
227
|
+
static getAuthHeader() {
|
|
228
|
+
const r = this.getToken();
|
|
229
|
+
return r ? { Authorization: `Bearer ${r}` } : {};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
class jr {
|
|
233
|
+
constructor(r) {
|
|
234
|
+
ge(this, "config");
|
|
235
|
+
this.config = {
|
|
236
|
+
timeout: 3e4,
|
|
237
|
+
headers: {
|
|
238
|
+
"Content-Type": "application/json"
|
|
239
|
+
},
|
|
240
|
+
...r
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Build query string from params
|
|
245
|
+
*/
|
|
246
|
+
buildQueryString(r) {
|
|
247
|
+
if (!r || Object.keys(r).length === 0)
|
|
248
|
+
return "";
|
|
249
|
+
const n = new URLSearchParams();
|
|
250
|
+
Object.entries(r).forEach(([i, l]) => {
|
|
251
|
+
l != null && n.append(i, String(l));
|
|
252
|
+
});
|
|
253
|
+
const a = n.toString();
|
|
254
|
+
return a ? `?${a}` : "";
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Make HTTP request
|
|
258
|
+
*/
|
|
259
|
+
async request(r, n = {}) {
|
|
260
|
+
const {
|
|
261
|
+
method: a = "GET",
|
|
262
|
+
headers: i = {},
|
|
263
|
+
body: l,
|
|
264
|
+
params: c
|
|
265
|
+
} = n, p = `${this.config.baseUrl}/${r}${this.buildQueryString(c)}`, d = {
|
|
266
|
+
...this.config.headers,
|
|
267
|
+
...Er.getAuthHeader(),
|
|
268
|
+
...i
|
|
269
|
+
}, _ = {
|
|
270
|
+
method: a,
|
|
271
|
+
headers: d
|
|
272
|
+
};
|
|
273
|
+
l && a !== "GET" && (_.body = JSON.stringify(l));
|
|
274
|
+
try {
|
|
275
|
+
const v = new AbortController(), C = setTimeout(() => v.abort(), this.config.timeout), E = await fetch(p, {
|
|
276
|
+
..._,
|
|
277
|
+
signal: v.signal
|
|
278
|
+
});
|
|
279
|
+
if (clearTimeout(C), !E.ok) {
|
|
280
|
+
const N = await E.json().catch(() => ({
|
|
281
|
+
message: E.statusText
|
|
282
|
+
}));
|
|
283
|
+
throw new Error(N.message || `HTTP ${E.status}`);
|
|
284
|
+
}
|
|
285
|
+
return await E.json();
|
|
286
|
+
} catch (v) {
|
|
287
|
+
throw v instanceof Error ? v : new Error("An unexpected error occurred");
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* GET request
|
|
292
|
+
*/
|
|
293
|
+
async get(r, n) {
|
|
294
|
+
return this.request(r, { method: "GET", params: n });
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* POST request
|
|
298
|
+
*/
|
|
299
|
+
async post(r, n, a) {
|
|
300
|
+
return this.request(r, { method: "POST", body: n, params: a });
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* PUT request
|
|
304
|
+
*/
|
|
305
|
+
async put(r, n, a) {
|
|
306
|
+
return this.request(r, { method: "PUT", body: n, params: a });
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* PATCH request
|
|
310
|
+
*/
|
|
311
|
+
async patch(r, n, a) {
|
|
312
|
+
return this.request(r, { method: "PATCH", body: n, params: a });
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* DELETE request
|
|
316
|
+
*/
|
|
317
|
+
async delete(r, n) {
|
|
318
|
+
return this.request(r, { method: "DELETE", params: n });
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Update base URL
|
|
322
|
+
*/
|
|
323
|
+
setBaseUrl(r) {
|
|
324
|
+
this.config.baseUrl = r;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Get current base URL
|
|
328
|
+
*/
|
|
329
|
+
getBaseUrl() {
|
|
330
|
+
return this.config.baseUrl;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
let se = null;
|
|
334
|
+
function Pr(u) {
|
|
335
|
+
return se = new jr(u), se;
|
|
336
|
+
}
|
|
337
|
+
function Ve() {
|
|
338
|
+
if (!se)
|
|
339
|
+
throw new Error("API client not initialized. Call initializeApiClient() first.");
|
|
340
|
+
return se;
|
|
341
|
+
}
|
|
342
|
+
function Rr(u, r, n = {}) {
|
|
343
|
+
const {
|
|
344
|
+
enabled: a = !0,
|
|
345
|
+
refetchOnMount: i = !0,
|
|
346
|
+
onSuccess: l,
|
|
347
|
+
onError: c
|
|
348
|
+
} = n, [p, d] = L(null), [_, v] = L(a), [C, E] = L(null), N = X(async () => {
|
|
349
|
+
if (a) {
|
|
350
|
+
v(!0), E(null);
|
|
351
|
+
try {
|
|
352
|
+
const j = await Ve().get(u, r);
|
|
353
|
+
d(j), l == null || l(j);
|
|
354
|
+
} catch (T) {
|
|
355
|
+
const j = T instanceof Error ? T : new Error("Unknown error");
|
|
356
|
+
E(j), c == null || c(j);
|
|
357
|
+
} finally {
|
|
358
|
+
v(!1);
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
}, [u, JSON.stringify(r), a, l, c]);
|
|
362
|
+
return oe(() => {
|
|
363
|
+
i && N();
|
|
364
|
+
}, [N, i]), {
|
|
365
|
+
data: p,
|
|
366
|
+
loading: _,
|
|
367
|
+
error: C,
|
|
368
|
+
refetch: N
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
function Ar(u, r = "POST", n = {}) {
|
|
372
|
+
const { onSuccess: a, onError: i } = n, [l, c] = L(null), [p, d] = L(!1), [_, v] = L(null), C = X(
|
|
373
|
+
async (N) => {
|
|
374
|
+
d(!0), v(null);
|
|
375
|
+
try {
|
|
376
|
+
const T = Ve();
|
|
377
|
+
let j;
|
|
378
|
+
switch (r) {
|
|
379
|
+
case "POST":
|
|
380
|
+
j = await T.post(u, N);
|
|
381
|
+
break;
|
|
382
|
+
case "PUT":
|
|
383
|
+
j = await T.put(u, N);
|
|
384
|
+
break;
|
|
385
|
+
case "PATCH":
|
|
386
|
+
j = await T.patch(u, N);
|
|
387
|
+
break;
|
|
388
|
+
case "DELETE":
|
|
389
|
+
j = await T.delete(u);
|
|
390
|
+
break;
|
|
391
|
+
default:
|
|
392
|
+
throw new Error(`Unsupported method: ${r}`);
|
|
393
|
+
}
|
|
394
|
+
return c(j), a == null || a(j, N), j;
|
|
395
|
+
} catch (T) {
|
|
396
|
+
const j = T instanceof Error ? T : new Error("Unknown error");
|
|
397
|
+
return v(j), i == null || i(j, N), null;
|
|
398
|
+
} finally {
|
|
399
|
+
d(!1);
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
[u, r, a, i]
|
|
403
|
+
), E = X(() => {
|
|
404
|
+
c(null), v(null), d(!1);
|
|
405
|
+
}, []);
|
|
406
|
+
return {
|
|
407
|
+
data: l,
|
|
408
|
+
loading: p,
|
|
409
|
+
error: _,
|
|
410
|
+
mutate: C,
|
|
411
|
+
reset: E
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
var me = { exports: {} }, Z = {};
|
|
415
|
+
/**
|
|
416
|
+
* @license React
|
|
417
|
+
* react-jsx-runtime.production.min.js
|
|
418
|
+
*
|
|
419
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
420
|
+
*
|
|
421
|
+
* This source code is licensed under the MIT license found in the
|
|
422
|
+
* LICENSE file in the root directory of this source tree.
|
|
423
|
+
*/
|
|
424
|
+
var Ge;
|
|
425
|
+
function Sr() {
|
|
426
|
+
if (Ge) return Z;
|
|
427
|
+
Ge = 1;
|
|
428
|
+
var u = qe, r = Symbol.for("react.element"), n = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, i = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
429
|
+
function c(p, d, _) {
|
|
430
|
+
var v, C = {}, E = null, N = null;
|
|
431
|
+
_ !== void 0 && (E = "" + _), d.key !== void 0 && (E = "" + d.key), d.ref !== void 0 && (N = d.ref);
|
|
432
|
+
for (v in d) a.call(d, v) && !l.hasOwnProperty(v) && (C[v] = d[v]);
|
|
433
|
+
if (p && p.defaultProps) for (v in d = p.defaultProps, d) C[v] === void 0 && (C[v] = d[v]);
|
|
434
|
+
return { $$typeof: r, type: p, key: E, ref: N, props: C, _owner: i.current };
|
|
435
|
+
}
|
|
436
|
+
return Z.Fragment = n, Z.jsx = c, Z.jsxs = c, Z;
|
|
437
|
+
}
|
|
438
|
+
var ee = {};
|
|
439
|
+
/**
|
|
440
|
+
* @license React
|
|
441
|
+
* react-jsx-runtime.development.js
|
|
442
|
+
*
|
|
443
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
444
|
+
*
|
|
445
|
+
* This source code is licensed under the MIT license found in the
|
|
446
|
+
* LICENSE file in the root directory of this source tree.
|
|
447
|
+
*/
|
|
448
|
+
var Ye;
|
|
449
|
+
function Tr() {
|
|
450
|
+
return Ye || (Ye = 1, process.env.NODE_ENV !== "production" && function() {
|
|
451
|
+
var u = qe, r = Symbol.for("react.element"), n = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), l = Symbol.for("react.profiler"), c = Symbol.for("react.provider"), p = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), _ = Symbol.for("react.suspense"), v = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), N = Symbol.for("react.offscreen"), T = Symbol.iterator, j = "@@iterator";
|
|
452
|
+
function Y(e) {
|
|
453
|
+
if (e === null || typeof e != "object")
|
|
454
|
+
return null;
|
|
455
|
+
var t = T && e[T] || e[j];
|
|
456
|
+
return typeof t == "function" ? t : null;
|
|
457
|
+
}
|
|
458
|
+
var $ = u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
459
|
+
function P(e) {
|
|
460
|
+
{
|
|
461
|
+
for (var t = arguments.length, o = new Array(t > 1 ? t - 1 : 0), f = 1; f < t; f++)
|
|
462
|
+
o[f - 1] = arguments[f];
|
|
463
|
+
B("error", e, o);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function B(e, t, o) {
|
|
467
|
+
{
|
|
468
|
+
var f = $.ReactDebugCurrentFrame, w = f.getStackAddendum();
|
|
469
|
+
w !== "" && (t += "%s", o = o.concat([w]));
|
|
470
|
+
var S = o.map(function(x) {
|
|
471
|
+
return String(x);
|
|
472
|
+
});
|
|
473
|
+
S.unshift("Warning: " + t), Function.prototype.apply.call(console[e], console, S);
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
var q = !1, V = !1, h = !1, R = !1, D = !1, y;
|
|
477
|
+
y = Symbol.for("react.module.reference");
|
|
478
|
+
function k(e) {
|
|
479
|
+
return !!(typeof e == "string" || typeof e == "function" || e === a || e === l || D || e === i || e === _ || e === v || R || e === N || q || V || h || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === C || e.$$typeof === c || e.$$typeof === p || e.$$typeof === d || // This needs to include all possible module reference object
|
|
480
|
+
// types supported by any Flight configuration anywhere since
|
|
481
|
+
// we don't know which Flight build this will end up being used
|
|
482
|
+
// with.
|
|
483
|
+
e.$$typeof === y || e.getModuleId !== void 0));
|
|
484
|
+
}
|
|
485
|
+
function b(e, t, o) {
|
|
486
|
+
var f = e.displayName;
|
|
487
|
+
if (f)
|
|
488
|
+
return f;
|
|
489
|
+
var w = t.displayName || t.name || "";
|
|
490
|
+
return w !== "" ? o + "(" + w + ")" : o;
|
|
491
|
+
}
|
|
492
|
+
function z(e) {
|
|
493
|
+
return e.displayName || "Context";
|
|
494
|
+
}
|
|
495
|
+
function M(e) {
|
|
496
|
+
if (e == null)
|
|
497
|
+
return null;
|
|
498
|
+
if (typeof e.tag == "number" && P("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
499
|
+
return e.displayName || e.name || null;
|
|
500
|
+
if (typeof e == "string")
|
|
501
|
+
return e;
|
|
502
|
+
switch (e) {
|
|
503
|
+
case a:
|
|
504
|
+
return "Fragment";
|
|
505
|
+
case n:
|
|
506
|
+
return "Portal";
|
|
507
|
+
case l:
|
|
508
|
+
return "Profiler";
|
|
509
|
+
case i:
|
|
510
|
+
return "StrictMode";
|
|
511
|
+
case _:
|
|
512
|
+
return "Suspense";
|
|
513
|
+
case v:
|
|
514
|
+
return "SuspenseList";
|
|
515
|
+
}
|
|
516
|
+
if (typeof e == "object")
|
|
517
|
+
switch (e.$$typeof) {
|
|
518
|
+
case p:
|
|
519
|
+
var t = e;
|
|
520
|
+
return z(t) + ".Consumer";
|
|
521
|
+
case c:
|
|
522
|
+
var o = e;
|
|
523
|
+
return z(o._context) + ".Provider";
|
|
524
|
+
case d:
|
|
525
|
+
return b(e, e.render, "ForwardRef");
|
|
526
|
+
case C:
|
|
527
|
+
var f = e.displayName || null;
|
|
528
|
+
return f !== null ? f : M(e.type) || "Memo";
|
|
529
|
+
case E: {
|
|
530
|
+
var w = e, S = w._payload, x = w._init;
|
|
531
|
+
try {
|
|
532
|
+
return M(x(S));
|
|
533
|
+
} catch {
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return null;
|
|
539
|
+
}
|
|
540
|
+
var m = Object.assign, U = 0, G, be, we, _e, Ee, je, Re;
|
|
541
|
+
function Se() {
|
|
542
|
+
}
|
|
543
|
+
Se.__reactDisabledLog = !0;
|
|
544
|
+
function ze() {
|
|
545
|
+
{
|
|
546
|
+
if (U === 0) {
|
|
547
|
+
G = console.log, be = console.info, we = console.warn, _e = console.error, Ee = console.group, je = console.groupCollapsed, Re = console.groupEnd;
|
|
548
|
+
var e = {
|
|
549
|
+
configurable: !0,
|
|
550
|
+
enumerable: !0,
|
|
551
|
+
value: Se,
|
|
552
|
+
writable: !0
|
|
553
|
+
};
|
|
554
|
+
Object.defineProperties(console, {
|
|
555
|
+
info: e,
|
|
556
|
+
log: e,
|
|
557
|
+
warn: e,
|
|
558
|
+
error: e,
|
|
559
|
+
group: e,
|
|
560
|
+
groupCollapsed: e,
|
|
561
|
+
groupEnd: e
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
U++;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
567
|
+
function Je() {
|
|
568
|
+
{
|
|
569
|
+
if (U--, U === 0) {
|
|
570
|
+
var e = {
|
|
571
|
+
configurable: !0,
|
|
572
|
+
enumerable: !0,
|
|
573
|
+
writable: !0
|
|
574
|
+
};
|
|
575
|
+
Object.defineProperties(console, {
|
|
576
|
+
log: m({}, e, {
|
|
577
|
+
value: G
|
|
578
|
+
}),
|
|
579
|
+
info: m({}, e, {
|
|
580
|
+
value: be
|
|
581
|
+
}),
|
|
582
|
+
warn: m({}, e, {
|
|
583
|
+
value: we
|
|
584
|
+
}),
|
|
585
|
+
error: m({}, e, {
|
|
586
|
+
value: _e
|
|
587
|
+
}),
|
|
588
|
+
group: m({}, e, {
|
|
589
|
+
value: Ee
|
|
590
|
+
}),
|
|
591
|
+
groupCollapsed: m({}, e, {
|
|
592
|
+
value: je
|
|
593
|
+
}),
|
|
594
|
+
groupEnd: m({}, e, {
|
|
595
|
+
value: Re
|
|
596
|
+
})
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
U < 0 && P("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
var ie = $.ReactCurrentDispatcher, le;
|
|
603
|
+
function re(e, t, o) {
|
|
604
|
+
{
|
|
605
|
+
if (le === void 0)
|
|
606
|
+
try {
|
|
607
|
+
throw Error();
|
|
608
|
+
} catch (w) {
|
|
609
|
+
var f = w.stack.trim().match(/\n( *(at )?)/);
|
|
610
|
+
le = f && f[1] || "";
|
|
611
|
+
}
|
|
612
|
+
return `
|
|
613
|
+
` + le + e;
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
var ce = !1, te;
|
|
617
|
+
{
|
|
618
|
+
var Ke = typeof WeakMap == "function" ? WeakMap : Map;
|
|
619
|
+
te = new Ke();
|
|
620
|
+
}
|
|
621
|
+
function Te(e, t) {
|
|
622
|
+
if (!e || ce)
|
|
623
|
+
return "";
|
|
624
|
+
{
|
|
625
|
+
var o = te.get(e);
|
|
626
|
+
if (o !== void 0)
|
|
627
|
+
return o;
|
|
628
|
+
}
|
|
629
|
+
var f;
|
|
630
|
+
ce = !0;
|
|
631
|
+
var w = Error.prepareStackTrace;
|
|
632
|
+
Error.prepareStackTrace = void 0;
|
|
633
|
+
var S;
|
|
634
|
+
S = ie.current, ie.current = null, ze();
|
|
635
|
+
try {
|
|
636
|
+
if (t) {
|
|
637
|
+
var x = function() {
|
|
638
|
+
throw Error();
|
|
639
|
+
};
|
|
640
|
+
if (Object.defineProperty(x.prototype, "props", {
|
|
641
|
+
set: function() {
|
|
642
|
+
throw Error();
|
|
643
|
+
}
|
|
644
|
+
}), typeof Reflect == "object" && Reflect.construct) {
|
|
645
|
+
try {
|
|
646
|
+
Reflect.construct(x, []);
|
|
647
|
+
} catch (I) {
|
|
648
|
+
f = I;
|
|
649
|
+
}
|
|
650
|
+
Reflect.construct(e, [], x);
|
|
651
|
+
} else {
|
|
652
|
+
try {
|
|
653
|
+
x.call();
|
|
654
|
+
} catch (I) {
|
|
655
|
+
f = I;
|
|
656
|
+
}
|
|
657
|
+
e.call(x.prototype);
|
|
658
|
+
}
|
|
659
|
+
} else {
|
|
660
|
+
try {
|
|
661
|
+
throw Error();
|
|
662
|
+
} catch (I) {
|
|
663
|
+
f = I;
|
|
664
|
+
}
|
|
665
|
+
e();
|
|
666
|
+
}
|
|
667
|
+
} catch (I) {
|
|
668
|
+
if (I && f && typeof I.stack == "string") {
|
|
669
|
+
for (var g = I.stack.split(`
|
|
670
|
+
`), F = f.stack.split(`
|
|
671
|
+
`), O = g.length - 1, A = F.length - 1; O >= 1 && A >= 0 && g[O] !== F[A]; )
|
|
672
|
+
A--;
|
|
673
|
+
for (; O >= 1 && A >= 0; O--, A--)
|
|
674
|
+
if (g[O] !== F[A]) {
|
|
675
|
+
if (O !== 1 || A !== 1)
|
|
676
|
+
do
|
|
677
|
+
if (O--, A--, A < 0 || g[O] !== F[A]) {
|
|
678
|
+
var W = `
|
|
679
|
+
` + g[O].replace(" at new ", " at ");
|
|
680
|
+
return e.displayName && W.includes("<anonymous>") && (W = W.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, W), W;
|
|
681
|
+
}
|
|
682
|
+
while (O >= 1 && A >= 0);
|
|
683
|
+
break;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
} finally {
|
|
687
|
+
ce = !1, ie.current = S, Je(), Error.prepareStackTrace = w;
|
|
688
|
+
}
|
|
689
|
+
var H = e ? e.displayName || e.name : "", J = H ? re(H) : "";
|
|
690
|
+
return typeof e == "function" && te.set(e, J), J;
|
|
691
|
+
}
|
|
692
|
+
function He(e, t, o) {
|
|
693
|
+
return Te(e, !1);
|
|
694
|
+
}
|
|
695
|
+
function Xe(e) {
|
|
696
|
+
var t = e.prototype;
|
|
697
|
+
return !!(t && t.isReactComponent);
|
|
698
|
+
}
|
|
699
|
+
function ne(e, t, o) {
|
|
700
|
+
if (e == null)
|
|
701
|
+
return "";
|
|
702
|
+
if (typeof e == "function")
|
|
703
|
+
return Te(e, Xe(e));
|
|
704
|
+
if (typeof e == "string")
|
|
705
|
+
return re(e);
|
|
706
|
+
switch (e) {
|
|
707
|
+
case _:
|
|
708
|
+
return re("Suspense");
|
|
709
|
+
case v:
|
|
710
|
+
return re("SuspenseList");
|
|
711
|
+
}
|
|
712
|
+
if (typeof e == "object")
|
|
713
|
+
switch (e.$$typeof) {
|
|
714
|
+
case d:
|
|
715
|
+
return He(e.render);
|
|
716
|
+
case C:
|
|
717
|
+
return ne(e.type, t, o);
|
|
718
|
+
case E: {
|
|
719
|
+
var f = e, w = f._payload, S = f._init;
|
|
720
|
+
try {
|
|
721
|
+
return ne(S(w), t, o);
|
|
722
|
+
} catch {
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
return "";
|
|
727
|
+
}
|
|
728
|
+
var Q = Object.prototype.hasOwnProperty, ke = {}, Ce = $.ReactDebugCurrentFrame;
|
|
729
|
+
function ae(e) {
|
|
730
|
+
if (e) {
|
|
731
|
+
var t = e._owner, o = ne(e.type, e._source, t ? t.type : null);
|
|
732
|
+
Ce.setExtraStackFrame(o);
|
|
733
|
+
} else
|
|
734
|
+
Ce.setExtraStackFrame(null);
|
|
735
|
+
}
|
|
736
|
+
function Qe(e, t, o, f, w) {
|
|
737
|
+
{
|
|
738
|
+
var S = Function.call.bind(Q);
|
|
739
|
+
for (var x in e)
|
|
740
|
+
if (S(e, x)) {
|
|
741
|
+
var g = void 0;
|
|
742
|
+
try {
|
|
743
|
+
if (typeof e[x] != "function") {
|
|
744
|
+
var F = Error((f || "React class") + ": " + o + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
745
|
+
throw F.name = "Invariant Violation", F;
|
|
746
|
+
}
|
|
747
|
+
g = e[x](t, x, f, o, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
748
|
+
} catch (O) {
|
|
749
|
+
g = O;
|
|
750
|
+
}
|
|
751
|
+
g && !(g instanceof Error) && (ae(w), P("%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).", f || "React class", o, x, typeof g), ae(null)), g instanceof Error && !(g.message in ke) && (ke[g.message] = !0, ae(w), P("Failed %s type: %s", o, g.message), ae(null));
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
var Ze = Array.isArray;
|
|
756
|
+
function ue(e) {
|
|
757
|
+
return Ze(e);
|
|
758
|
+
}
|
|
759
|
+
function er(e) {
|
|
760
|
+
{
|
|
761
|
+
var t = typeof Symbol == "function" && Symbol.toStringTag, o = t && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
762
|
+
return o;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
function rr(e) {
|
|
766
|
+
try {
|
|
767
|
+
return Ne(e), !1;
|
|
768
|
+
} catch {
|
|
769
|
+
return !0;
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
function Ne(e) {
|
|
773
|
+
return "" + e;
|
|
774
|
+
}
|
|
775
|
+
function Oe(e) {
|
|
776
|
+
if (rr(e))
|
|
777
|
+
return P("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", er(e)), Ne(e);
|
|
778
|
+
}
|
|
779
|
+
var Pe = $.ReactCurrentOwner, tr = {
|
|
780
|
+
key: !0,
|
|
781
|
+
ref: !0,
|
|
782
|
+
__self: !0,
|
|
783
|
+
__source: !0
|
|
784
|
+
}, Ae, De;
|
|
785
|
+
function nr(e) {
|
|
786
|
+
if (Q.call(e, "ref")) {
|
|
787
|
+
var t = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
788
|
+
if (t && t.isReactWarning)
|
|
789
|
+
return !1;
|
|
790
|
+
}
|
|
791
|
+
return e.ref !== void 0;
|
|
792
|
+
}
|
|
793
|
+
function ar(e) {
|
|
794
|
+
if (Q.call(e, "key")) {
|
|
795
|
+
var t = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
796
|
+
if (t && t.isReactWarning)
|
|
797
|
+
return !1;
|
|
798
|
+
}
|
|
799
|
+
return e.key !== void 0;
|
|
800
|
+
}
|
|
801
|
+
function or(e, t) {
|
|
802
|
+
typeof e.ref == "string" && Pe.current;
|
|
803
|
+
}
|
|
804
|
+
function sr(e, t) {
|
|
805
|
+
{
|
|
806
|
+
var o = function() {
|
|
807
|
+
Ae || (Ae = !0, P("%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)", t));
|
|
808
|
+
};
|
|
809
|
+
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
810
|
+
get: o,
|
|
811
|
+
configurable: !0
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
function ir(e, t) {
|
|
816
|
+
{
|
|
817
|
+
var o = function() {
|
|
818
|
+
De || (De = !0, P("%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)", t));
|
|
819
|
+
};
|
|
820
|
+
o.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
821
|
+
get: o,
|
|
822
|
+
configurable: !0
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
var lr = function(e, t, o, f, w, S, x) {
|
|
827
|
+
var g = {
|
|
828
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
829
|
+
$$typeof: r,
|
|
830
|
+
// Built-in properties that belong on the element
|
|
831
|
+
type: e,
|
|
832
|
+
key: t,
|
|
833
|
+
ref: o,
|
|
834
|
+
props: x,
|
|
835
|
+
// Record the component responsible for creating this element.
|
|
836
|
+
_owner: S
|
|
837
|
+
};
|
|
838
|
+
return g._store = {}, Object.defineProperty(g._store, "validated", {
|
|
839
|
+
configurable: !1,
|
|
840
|
+
enumerable: !1,
|
|
841
|
+
writable: !0,
|
|
842
|
+
value: !1
|
|
843
|
+
}), Object.defineProperty(g, "_self", {
|
|
844
|
+
configurable: !1,
|
|
845
|
+
enumerable: !1,
|
|
846
|
+
writable: !1,
|
|
847
|
+
value: f
|
|
848
|
+
}), Object.defineProperty(g, "_source", {
|
|
849
|
+
configurable: !1,
|
|
850
|
+
enumerable: !1,
|
|
851
|
+
writable: !1,
|
|
852
|
+
value: w
|
|
853
|
+
}), Object.freeze && (Object.freeze(g.props), Object.freeze(g)), g;
|
|
854
|
+
};
|
|
855
|
+
function cr(e, t, o, f, w) {
|
|
856
|
+
{
|
|
857
|
+
var S, x = {}, g = null, F = null;
|
|
858
|
+
o !== void 0 && (Oe(o), g = "" + o), ar(t) && (Oe(t.key), g = "" + t.key), nr(t) && (F = t.ref, or(t, w));
|
|
859
|
+
for (S in t)
|
|
860
|
+
Q.call(t, S) && !tr.hasOwnProperty(S) && (x[S] = t[S]);
|
|
861
|
+
if (e && e.defaultProps) {
|
|
862
|
+
var O = e.defaultProps;
|
|
863
|
+
for (S in O)
|
|
864
|
+
x[S] === void 0 && (x[S] = O[S]);
|
|
865
|
+
}
|
|
866
|
+
if (g || F) {
|
|
867
|
+
var A = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
868
|
+
g && sr(x, A), F && ir(x, A);
|
|
869
|
+
}
|
|
870
|
+
return lr(e, g, F, w, f, Pe.current, x);
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
var de = $.ReactCurrentOwner, $e = $.ReactDebugCurrentFrame;
|
|
874
|
+
function K(e) {
|
|
875
|
+
if (e) {
|
|
876
|
+
var t = e._owner, o = ne(e.type, e._source, t ? t.type : null);
|
|
877
|
+
$e.setExtraStackFrame(o);
|
|
878
|
+
} else
|
|
879
|
+
$e.setExtraStackFrame(null);
|
|
880
|
+
}
|
|
881
|
+
var fe;
|
|
882
|
+
fe = !1;
|
|
883
|
+
function he(e) {
|
|
884
|
+
return typeof e == "object" && e !== null && e.$$typeof === r;
|
|
885
|
+
}
|
|
886
|
+
function Fe() {
|
|
887
|
+
{
|
|
888
|
+
if (de.current) {
|
|
889
|
+
var e = M(de.current.type);
|
|
890
|
+
if (e)
|
|
891
|
+
return `
|
|
892
|
+
|
|
893
|
+
Check the render method of \`` + e + "`.";
|
|
894
|
+
}
|
|
895
|
+
return "";
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
function ur(e) {
|
|
899
|
+
return "";
|
|
900
|
+
}
|
|
901
|
+
var Me = {};
|
|
902
|
+
function dr(e) {
|
|
903
|
+
{
|
|
904
|
+
var t = Fe();
|
|
905
|
+
if (!t) {
|
|
906
|
+
var o = typeof e == "string" ? e : e.displayName || e.name;
|
|
907
|
+
o && (t = `
|
|
908
|
+
|
|
909
|
+
Check the top-level render call using <` + o + ">.");
|
|
910
|
+
}
|
|
911
|
+
return t;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
function Ue(e, t) {
|
|
915
|
+
{
|
|
916
|
+
if (!e._store || e._store.validated || e.key != null)
|
|
917
|
+
return;
|
|
918
|
+
e._store.validated = !0;
|
|
919
|
+
var o = dr(t);
|
|
920
|
+
if (Me[o])
|
|
921
|
+
return;
|
|
922
|
+
Me[o] = !0;
|
|
923
|
+
var f = "";
|
|
924
|
+
e && e._owner && e._owner !== de.current && (f = " It was passed a child from " + M(e._owner.type) + "."), K(e), P('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', o, f), K(null);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
function Ie(e, t) {
|
|
928
|
+
{
|
|
929
|
+
if (typeof e != "object")
|
|
930
|
+
return;
|
|
931
|
+
if (ue(e))
|
|
932
|
+
for (var o = 0; o < e.length; o++) {
|
|
933
|
+
var f = e[o];
|
|
934
|
+
he(f) && Ue(f, t);
|
|
935
|
+
}
|
|
936
|
+
else if (he(e))
|
|
937
|
+
e._store && (e._store.validated = !0);
|
|
938
|
+
else if (e) {
|
|
939
|
+
var w = Y(e);
|
|
940
|
+
if (typeof w == "function" && w !== e.entries)
|
|
941
|
+
for (var S = w.call(e), x; !(x = S.next()).done; )
|
|
942
|
+
he(x.value) && Ue(x.value, t);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
function fr(e) {
|
|
947
|
+
{
|
|
948
|
+
var t = e.type;
|
|
949
|
+
if (t == null || typeof t == "string")
|
|
950
|
+
return;
|
|
951
|
+
var o;
|
|
952
|
+
if (typeof t == "function")
|
|
953
|
+
o = t.propTypes;
|
|
954
|
+
else if (typeof t == "object" && (t.$$typeof === d || // Note: Memo only checks outer props here.
|
|
955
|
+
// Inner props are checked in the reconciler.
|
|
956
|
+
t.$$typeof === C))
|
|
957
|
+
o = t.propTypes;
|
|
958
|
+
else
|
|
959
|
+
return;
|
|
960
|
+
if (o) {
|
|
961
|
+
var f = M(t);
|
|
962
|
+
Qe(o, e.props, "prop", f, e);
|
|
963
|
+
} else if (t.PropTypes !== void 0 && !fe) {
|
|
964
|
+
fe = !0;
|
|
965
|
+
var w = M(t);
|
|
966
|
+
P("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", w || "Unknown");
|
|
967
|
+
}
|
|
968
|
+
typeof t.getDefaultProps == "function" && !t.getDefaultProps.isReactClassApproved && P("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
969
|
+
}
|
|
970
|
+
}
|
|
971
|
+
function hr(e) {
|
|
972
|
+
{
|
|
973
|
+
for (var t = Object.keys(e.props), o = 0; o < t.length; o++) {
|
|
974
|
+
var f = t[o];
|
|
975
|
+
if (f !== "children" && f !== "key") {
|
|
976
|
+
K(e), P("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", f), K(null);
|
|
977
|
+
break;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
e.ref !== null && (K(e), P("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
var Le = {};
|
|
984
|
+
function We(e, t, o, f, w, S) {
|
|
985
|
+
{
|
|
986
|
+
var x = k(e);
|
|
987
|
+
if (!x) {
|
|
988
|
+
var g = "";
|
|
989
|
+
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).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.");
|
|
990
|
+
var F = ur();
|
|
991
|
+
F ? g += F : g += Fe();
|
|
992
|
+
var O;
|
|
993
|
+
e === null ? O = "null" : ue(e) ? O = "array" : e !== void 0 && e.$$typeof === r ? (O = "<" + (M(e.type) || "Unknown") + " />", g = " Did you accidentally export a JSX literal instead of a component?") : O = typeof e, P("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", O, g);
|
|
994
|
+
}
|
|
995
|
+
var A = cr(e, t, o, w, S);
|
|
996
|
+
if (A == null)
|
|
997
|
+
return A;
|
|
998
|
+
if (x) {
|
|
999
|
+
var W = t.children;
|
|
1000
|
+
if (W !== void 0)
|
|
1001
|
+
if (f)
|
|
1002
|
+
if (ue(W)) {
|
|
1003
|
+
for (var H = 0; H < W.length; H++)
|
|
1004
|
+
Ie(W[H], e);
|
|
1005
|
+
Object.freeze && Object.freeze(W);
|
|
1006
|
+
} else
|
|
1007
|
+
P("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
1008
|
+
else
|
|
1009
|
+
Ie(W, e);
|
|
1010
|
+
}
|
|
1011
|
+
if (Q.call(t, "key")) {
|
|
1012
|
+
var J = M(e), I = Object.keys(t).filter(function(mr) {
|
|
1013
|
+
return mr !== "key";
|
|
1014
|
+
}), pe = I.length > 0 ? "{key: someKey, " + I.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
1015
|
+
if (!Le[J + pe]) {
|
|
1016
|
+
var xr = I.length > 0 ? "{" + I.join(": ..., ") + ": ...}" : "{}";
|
|
1017
|
+
P(`A props object containing a "key" prop is being spread into JSX:
|
|
1018
|
+
let props = %s;
|
|
1019
|
+
<%s {...props} />
|
|
1020
|
+
React keys must be passed directly to JSX without using spread:
|
|
1021
|
+
let props = %s;
|
|
1022
|
+
<%s key={someKey} {...props} />`, pe, J, xr, J), Le[J + pe] = !0;
|
|
1023
|
+
}
|
|
1024
|
+
}
|
|
1025
|
+
return e === a ? hr(A) : fr(A), A;
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
function pr(e, t, o) {
|
|
1029
|
+
return We(e, t, o, !0);
|
|
1030
|
+
}
|
|
1031
|
+
function gr(e, t, o) {
|
|
1032
|
+
return We(e, t, o, !1);
|
|
1033
|
+
}
|
|
1034
|
+
var vr = gr, yr = pr;
|
|
1035
|
+
ee.Fragment = a, ee.jsx = vr, ee.jsxs = yr;
|
|
1036
|
+
}()), ee;
|
|
1037
|
+
}
|
|
1038
|
+
process.env.NODE_ENV === "production" ? me.exports = Sr() : me.exports = Tr();
|
|
1039
|
+
var s = me.exports;
|
|
1040
|
+
class xe {
|
|
1041
|
+
/**
|
|
1042
|
+
* Filter array by predicate function
|
|
1043
|
+
*/
|
|
1044
|
+
static filter(r, n) {
|
|
1045
|
+
return r.filter(n);
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* Filter by field value
|
|
1049
|
+
*/
|
|
1050
|
+
static filterBy(r, n, a) {
|
|
1051
|
+
return r.filter((i) => i[n] === a);
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Filter by multiple fields
|
|
1055
|
+
*/
|
|
1056
|
+
static filterByFields(r, n) {
|
|
1057
|
+
return r.filter((a) => Object.entries(n).every(([i, l]) => a[i] === l));
|
|
1058
|
+
}
|
|
1059
|
+
/**
|
|
1060
|
+
* Sort array by field
|
|
1061
|
+
*/
|
|
1062
|
+
static sort(r, n, a = "asc") {
|
|
1063
|
+
return [...r].sort((i, l) => {
|
|
1064
|
+
const c = i[n], p = l[n];
|
|
1065
|
+
if (c === p) return 0;
|
|
1066
|
+
let d = 0;
|
|
1067
|
+
return c > p && (d = 1), c < p && (d = -1), a === "asc" ? d : -d;
|
|
1068
|
+
});
|
|
1069
|
+
}
|
|
1070
|
+
/**
|
|
1071
|
+
* Search items by query string in specified fields
|
|
1072
|
+
*/
|
|
1073
|
+
static search(r, n, a) {
|
|
1074
|
+
if (!n.trim()) return r;
|
|
1075
|
+
const i = n.toLowerCase();
|
|
1076
|
+
return r.filter((l) => a.some((c) => {
|
|
1077
|
+
const p = l[c];
|
|
1078
|
+
return p == null ? !1 : String(p).toLowerCase().includes(i);
|
|
1079
|
+
}));
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Paginate array
|
|
1083
|
+
*/
|
|
1084
|
+
static paginate(r, n, a) {
|
|
1085
|
+
const i = (n - 1) * a, l = i + a;
|
|
1086
|
+
return {
|
|
1087
|
+
data: r.slice(i, l),
|
|
1088
|
+
total: r.length,
|
|
1089
|
+
page: n,
|
|
1090
|
+
totalPages: Math.ceil(r.length / a)
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
/**
|
|
1094
|
+
* Group items by field value
|
|
1095
|
+
*/
|
|
1096
|
+
static groupBy(r, n) {
|
|
1097
|
+
return r.reduce((a, i) => {
|
|
1098
|
+
const l = String(i[n]);
|
|
1099
|
+
return a[l] || (a[l] = []), a[l].push(i), a;
|
|
1100
|
+
}, {});
|
|
1101
|
+
}
|
|
1102
|
+
/**
|
|
1103
|
+
* Get unique values for a field
|
|
1104
|
+
*/
|
|
1105
|
+
static unique(r, n) {
|
|
1106
|
+
const a = r.map((i) => i[n]);
|
|
1107
|
+
return [...new Set(a)];
|
|
1108
|
+
}
|
|
1109
|
+
/**
|
|
1110
|
+
* Count items by field value
|
|
1111
|
+
*/
|
|
1112
|
+
static countBy(r, n) {
|
|
1113
|
+
return r.reduce((a, i) => {
|
|
1114
|
+
const l = String(i[n]);
|
|
1115
|
+
return a[l] = (a[l] || 0) + 1, a;
|
|
1116
|
+
}, {});
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* Apply multiple operations in sequence
|
|
1120
|
+
*/
|
|
1121
|
+
static pipe(r, n) {
|
|
1122
|
+
return n.reduce((a, i) => i(a), r);
|
|
1123
|
+
}
|
|
1124
|
+
}
|
|
1125
|
+
function Dr({
|
|
1126
|
+
endpoint: u,
|
|
1127
|
+
params: r,
|
|
1128
|
+
layout: n = "list",
|
|
1129
|
+
title: a,
|
|
1130
|
+
emptyMessage: i = "No items found",
|
|
1131
|
+
renderItem: l,
|
|
1132
|
+
keyExtractor: c = (j, Y) => j.id || j._id || String(Y),
|
|
1133
|
+
searchable: p = !1,
|
|
1134
|
+
searchFields: d = [],
|
|
1135
|
+
searchPlaceholder: _ = "Search...",
|
|
1136
|
+
filters: v = [],
|
|
1137
|
+
pageSize: C = 20,
|
|
1138
|
+
onItemClick: E,
|
|
1139
|
+
onRefresh: N,
|
|
1140
|
+
theme: T = {}
|
|
1141
|
+
}) {
|
|
1142
|
+
const { data: j, loading: Y, error: $, refetch: P } = Rr(u, r), [B, q] = L(""), [V, h] = L({}), [R, D] = L(1), y = _r(() => {
|
|
1143
|
+
if (!j) return { data: [], total: 0, totalPages: 0 };
|
|
1144
|
+
let m = j;
|
|
1145
|
+
return p && B && d.length > 0 && (m = xe.search(m, B, d)), Object.keys(V).length > 0 && (m = xe.filterByFields(m, V)), xe.paginate(m, R, C);
|
|
1146
|
+
}, [j, B, V, R, C, p, d]);
|
|
1147
|
+
oe(() => {
|
|
1148
|
+
D(1);
|
|
1149
|
+
}, [B, V]);
|
|
1150
|
+
const k = () => {
|
|
1151
|
+
q(""), h({}), D(1), P(), N == null || N();
|
|
1152
|
+
}, b = {
|
|
1153
|
+
background: T.background || "#ffffff",
|
|
1154
|
+
cardBackground: T.cardBackground || "#f9fafb",
|
|
1155
|
+
text: T.text || "#111827",
|
|
1156
|
+
textSecondary: T.textSecondary || "#6b7280",
|
|
1157
|
+
border: T.border || "#e5e7eb",
|
|
1158
|
+
primary: T.primary || "#3b82f6"
|
|
1159
|
+
}, M = l || ((m) => /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1160
|
+
padding: "16px",
|
|
1161
|
+
cursor: E ? "pointer" : "default"
|
|
1162
|
+
}, children: [
|
|
1163
|
+
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px", fontWeight: 500, color: b.text }, children: m.title || m.name || m.label || "Untitled" }),
|
|
1164
|
+
m.description && /* @__PURE__ */ s.jsx("div", { style: { fontSize: "13px", color: b.textSecondary, marginTop: "4px" }, children: m.description })
|
|
1165
|
+
] }));
|
|
1166
|
+
return Y && !j ? /* @__PURE__ */ s.jsx("div", { style: {
|
|
1167
|
+
display: "flex",
|
|
1168
|
+
alignItems: "center",
|
|
1169
|
+
justifyContent: "center",
|
|
1170
|
+
padding: "48px",
|
|
1171
|
+
color: b.textSecondary
|
|
1172
|
+
}, children: "Loading..." }) : $ ? /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1173
|
+
padding: "24px",
|
|
1174
|
+
textAlign: "center",
|
|
1175
|
+
color: "#ef4444"
|
|
1176
|
+
}, children: [
|
|
1177
|
+
/* @__PURE__ */ s.jsx("div", { style: { fontWeight: 500, marginBottom: "8px" }, children: "Error" }),
|
|
1178
|
+
/* @__PURE__ */ s.jsx("div", { style: { fontSize: "14px" }, children: $.message }),
|
|
1179
|
+
/* @__PURE__ */ s.jsx(
|
|
1180
|
+
"button",
|
|
1181
|
+
{
|
|
1182
|
+
onClick: k,
|
|
1183
|
+
style: {
|
|
1184
|
+
marginTop: "16px",
|
|
1185
|
+
padding: "8px 16px",
|
|
1186
|
+
background: b.primary,
|
|
1187
|
+
color: "white",
|
|
1188
|
+
border: "none",
|
|
1189
|
+
borderRadius: "6px",
|
|
1190
|
+
cursor: "pointer"
|
|
1191
|
+
},
|
|
1192
|
+
children: "Retry"
|
|
1193
|
+
}
|
|
1194
|
+
)
|
|
1195
|
+
] }) : /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1196
|
+
background: b.background,
|
|
1197
|
+
borderRadius: "12px",
|
|
1198
|
+
overflow: "hidden"
|
|
1199
|
+
}, children: [
|
|
1200
|
+
(a || p || v.length > 0) && /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1201
|
+
padding: "16px",
|
|
1202
|
+
borderBottom: `1px solid ${b.border}`
|
|
1203
|
+
}, children: [
|
|
1204
|
+
/* @__PURE__ */ s.jsxs("div", { style: {
|
|
1205
|
+
display: "flex",
|
|
1206
|
+
alignItems: "center",
|
|
1207
|
+
justifyContent: "space-between",
|
|
1208
|
+
marginBottom: p || v.length > 0 ? "12px" : "0"
|
|
1209
|
+
}, children: [
|
|
1210
|
+
a && /* @__PURE__ */ s.jsx("h2", { style: {
|
|
1211
|
+
margin: 0,
|
|
1212
|
+
fontSize: "18px",
|
|
1213
|
+
fontWeight: 600,
|
|
1214
|
+
color: b.text
|
|
1215
|
+
}, children: a }),
|
|
1216
|
+
/* @__PURE__ */ s.jsx(
|
|
1217
|
+
"button",
|
|
1218
|
+
{
|
|
1219
|
+
onClick: k,
|
|
1220
|
+
style: {
|
|
1221
|
+
padding: "6px 12px",
|
|
1222
|
+
background: "transparent",
|
|
1223
|
+
border: `1px solid ${b.border}`,
|
|
1224
|
+
borderRadius: "6px",
|
|
1225
|
+
color: b.textSecondary,
|
|
1226
|
+
cursor: "pointer",
|
|
1227
|
+
fontSize: "13px"
|
|
1228
|
+
},
|
|
1229
|
+
children: "Refresh"
|
|
1230
|
+
}
|
|
1231
|
+
)
|
|
1232
|
+
] }),
|
|
1233
|
+
p && /* @__PURE__ */ s.jsx(
|
|
1234
|
+
"input",
|
|
1235
|
+
{
|
|
1236
|
+
type: "text",
|
|
1237
|
+
placeholder: _,
|
|
1238
|
+
value: B,
|
|
1239
|
+
onChange: (m) => q(m.target.value),
|
|
1240
|
+
style: {
|
|
1241
|
+
width: "100%",
|
|
1242
|
+
padding: "8px 12px",
|
|
1243
|
+
border: `1px solid ${b.border}`,
|
|
1244
|
+
borderRadius: "8px",
|
|
1245
|
+
fontSize: "14px",
|
|
1246
|
+
outline: "none"
|
|
1247
|
+
}
|
|
1248
|
+
}
|
|
1249
|
+
)
|
|
1250
|
+
] }),
|
|
1251
|
+
/* @__PURE__ */ s.jsx("div", { style: {
|
|
1252
|
+
display: n === "grid" ? "grid" : "flex",
|
|
1253
|
+
flexDirection: n === "list" ? "column" : void 0,
|
|
1254
|
+
gridTemplateColumns: n === "grid" ? "repeat(auto-fill, minmax(250px, 1fr))" : void 0,
|
|
1255
|
+
gap: n === "list" ? "0" : "16px",
|
|
1256
|
+
padding: n === "list" ? "0" : "16px"
|
|
1257
|
+
}, children: y.data.length === 0 ? /* @__PURE__ */ s.jsx("div", { style: {
|
|
1258
|
+
padding: "48px",
|
|
1259
|
+
textAlign: "center",
|
|
1260
|
+
color: b.textSecondary
|
|
1261
|
+
}, children: i }) : y.data.map((m, U) => /* @__PURE__ */ s.jsx(
|
|
1262
|
+
"div",
|
|
1263
|
+
{
|
|
1264
|
+
onClick: () => E == null ? void 0 : E(m),
|
|
1265
|
+
style: {
|
|
1266
|
+
background: b.cardBackground,
|
|
1267
|
+
borderRadius: n === "list" ? "0" : "8px",
|
|
1268
|
+
borderBottom: n === "list" ? `1px solid ${b.border}` : "none",
|
|
1269
|
+
transition: "all 0.15s ease"
|
|
1270
|
+
},
|
|
1271
|
+
onMouseEnter: (G) => {
|
|
1272
|
+
E && (G.currentTarget.style.background = b.border);
|
|
1273
|
+
},
|
|
1274
|
+
onMouseLeave: (G) => {
|
|
1275
|
+
G.currentTarget.style.background = b.cardBackground;
|
|
1276
|
+
},
|
|
1277
|
+
children: M(m, U)
|
|
1278
|
+
},
|
|
1279
|
+
c(m, U)
|
|
1280
|
+
)) }),
|
|
1281
|
+
y.totalPages > 1 && /* @__PURE__ */ s.jsxs("div", { style: {
|
|
1282
|
+
padding: "16px",
|
|
1283
|
+
borderTop: `1px solid ${b.border}`,
|
|
1284
|
+
display: "flex",
|
|
1285
|
+
alignItems: "center",
|
|
1286
|
+
justifyContent: "space-between"
|
|
1287
|
+
}, children: [
|
|
1288
|
+
/* @__PURE__ */ s.jsxs("div", { style: { fontSize: "13px", color: b.textSecondary }, children: [
|
|
1289
|
+
"Page ",
|
|
1290
|
+
R,
|
|
1291
|
+
" of ",
|
|
1292
|
+
y.totalPages
|
|
1293
|
+
] }),
|
|
1294
|
+
/* @__PURE__ */ s.jsxs("div", { style: { display: "flex", gap: "8px" }, children: [
|
|
1295
|
+
/* @__PURE__ */ s.jsx(
|
|
1296
|
+
"button",
|
|
1297
|
+
{
|
|
1298
|
+
onClick: () => D((m) => Math.max(1, m - 1)),
|
|
1299
|
+
disabled: R === 1,
|
|
1300
|
+
style: {
|
|
1301
|
+
padding: "6px 12px",
|
|
1302
|
+
border: `1px solid ${b.border}`,
|
|
1303
|
+
borderRadius: "6px",
|
|
1304
|
+
background: "white",
|
|
1305
|
+
cursor: R === 1 ? "not-allowed" : "pointer",
|
|
1306
|
+
opacity: R === 1 ? 0.5 : 1
|
|
1307
|
+
},
|
|
1308
|
+
children: "Previous"
|
|
1309
|
+
}
|
|
1310
|
+
),
|
|
1311
|
+
/* @__PURE__ */ s.jsx(
|
|
1312
|
+
"button",
|
|
1313
|
+
{
|
|
1314
|
+
onClick: () => D((m) => Math.min(y.totalPages, m + 1)),
|
|
1315
|
+
disabled: R === y.totalPages,
|
|
1316
|
+
style: {
|
|
1317
|
+
padding: "6px 12px",
|
|
1318
|
+
border: `1px solid ${b.border}`,
|
|
1319
|
+
borderRadius: "6px",
|
|
1320
|
+
background: "white",
|
|
1321
|
+
cursor: R === y.totalPages ? "not-allowed" : "pointer",
|
|
1322
|
+
opacity: R === y.totalPages ? 0.5 : 1
|
|
1323
|
+
},
|
|
1324
|
+
children: "Next"
|
|
1325
|
+
}
|
|
1326
|
+
)
|
|
1327
|
+
] })
|
|
1328
|
+
] })
|
|
1329
|
+
] });
|
|
1330
|
+
}
|
|
1331
|
+
function $r({
|
|
1332
|
+
item: u,
|
|
1333
|
+
onClick: r,
|
|
1334
|
+
title: n = (c) => c.title || c.name || c.label || "Untitled",
|
|
1335
|
+
subtitle: a = (c) => c.description || c.subtitle || "",
|
|
1336
|
+
image: i = (c) => c.image || c.thumbnail || c.photo,
|
|
1337
|
+
badge: l = (c) => c.badge || c.tag || c.type
|
|
1338
|
+
}) {
|
|
1339
|
+
const c = n(u), p = a(u), d = i(u), _ = l(u);
|
|
1340
|
+
return /* @__PURE__ */ s.jsxs(
|
|
1341
|
+
"div",
|
|
1342
|
+
{
|
|
1343
|
+
onClick: r,
|
|
1344
|
+
className: `
|
|
1345
|
+
flex items-center gap-4 p-4 border-b border-gray-200
|
|
1346
|
+
hover:bg-gray-50 transition-colors
|
|
1347
|
+
${r ? "cursor-pointer" : ""}
|
|
1348
|
+
`,
|
|
1349
|
+
children: [
|
|
1350
|
+
d && /* @__PURE__ */ s.jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ s.jsx(
|
|
1351
|
+
"img",
|
|
1352
|
+
{
|
|
1353
|
+
src: d,
|
|
1354
|
+
alt: c,
|
|
1355
|
+
className: "w-16 h-16 object-cover rounded-lg"
|
|
1356
|
+
}
|
|
1357
|
+
) }),
|
|
1358
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1359
|
+
/* @__PURE__ */ s.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1360
|
+
/* @__PURE__ */ s.jsx("h3", { className: "font-medium text-gray-900 truncate", children: c }),
|
|
1361
|
+
_ && /* @__PURE__ */ s.jsx("span", { className: "px-2 py-0.5 text-xs font-medium bg-blue-100 text-blue-800 rounded-full", children: _ })
|
|
1362
|
+
] }),
|
|
1363
|
+
p && /* @__PURE__ */ s.jsx("p", { className: "text-sm text-gray-600 truncate mt-0.5", children: p })
|
|
1364
|
+
] }),
|
|
1365
|
+
r && /* @__PURE__ */ s.jsx("div", { className: "flex-shrink-0 text-gray-400", children: /* @__PURE__ */ s.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ s.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" }) }) })
|
|
1366
|
+
]
|
|
1367
|
+
}
|
|
1368
|
+
);
|
|
1369
|
+
}
|
|
1370
|
+
function Fr({
|
|
1371
|
+
item: u,
|
|
1372
|
+
onClose: r,
|
|
1373
|
+
title: n = (l) => l.title || l.name || l.label || "Detail",
|
|
1374
|
+
image: a = (l) => l.image || l.thumbnail || l.photo,
|
|
1375
|
+
fields: i = []
|
|
1376
|
+
}) {
|
|
1377
|
+
if (!u) return null;
|
|
1378
|
+
const l = n(u), c = a(u);
|
|
1379
|
+
return /* @__PURE__ */ s.jsx("div", { className: "fixed inset-0 bg-black/50 z-50 flex items-center justify-center p-4", children: /* @__PURE__ */ s.jsxs("div", { className: "bg-white rounded-xl max-w-2xl w-full max-h-[90vh] overflow-y-auto shadow-2xl", children: [
|
|
1380
|
+
/* @__PURE__ */ s.jsxs("div", { className: "sticky top-0 bg-white border-b border-gray-200 px-6 py-4 flex items-center justify-between", children: [
|
|
1381
|
+
/* @__PURE__ */ s.jsx("h2", { className: "text-xl font-semibold text-gray-900", children: l }),
|
|
1382
|
+
r && /* @__PURE__ */ s.jsx(
|
|
1383
|
+
"button",
|
|
1384
|
+
{
|
|
1385
|
+
onClick: r,
|
|
1386
|
+
className: "p-2 hover:bg-gray-100 rounded-lg transition-colors",
|
|
1387
|
+
children: /* @__PURE__ */ s.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ s.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1388
|
+
}
|
|
1389
|
+
)
|
|
1390
|
+
] }),
|
|
1391
|
+
/* @__PURE__ */ s.jsxs("div", { className: "p-6", children: [
|
|
1392
|
+
c && /* @__PURE__ */ s.jsx("div", { className: "mb-6", children: /* @__PURE__ */ s.jsx(
|
|
1393
|
+
"img",
|
|
1394
|
+
{
|
|
1395
|
+
src: c,
|
|
1396
|
+
alt: l,
|
|
1397
|
+
className: "w-full h-64 object-cover rounded-lg"
|
|
1398
|
+
}
|
|
1399
|
+
) }),
|
|
1400
|
+
i.length > 0 && /* @__PURE__ */ s.jsx("div", { className: "space-y-4", children: i.map((p, d) => {
|
|
1401
|
+
const _ = p.value(u);
|
|
1402
|
+
return _ == null || _ === "" ? null : /* @__PURE__ */ s.jsxs("div", { children: [
|
|
1403
|
+
/* @__PURE__ */ s.jsx("div", { className: "text-sm font-medium text-gray-500 mb-1", children: p.label }),
|
|
1404
|
+
/* @__PURE__ */ s.jsx("div", { className: "text-base text-gray-900", children: typeof _ == "object" ? JSON.stringify(_, null, 2) : String(_) })
|
|
1405
|
+
] }, d);
|
|
1406
|
+
}) }),
|
|
1407
|
+
i.length === 0 && /* @__PURE__ */ s.jsx("pre", { className: "bg-gray-50 p-4 rounded-lg text-sm overflow-x-auto", children: JSON.stringify(u, null, 2) })
|
|
1408
|
+
] }),
|
|
1409
|
+
r && /* @__PURE__ */ s.jsx("div", { className: "sticky bottom-0 bg-gray-50 border-t border-gray-200 px-6 py-4", children: /* @__PURE__ */ s.jsx(
|
|
1410
|
+
"button",
|
|
1411
|
+
{
|
|
1412
|
+
onClick: r,
|
|
1413
|
+
className: "w-full px-4 py-2 bg-gray-900 text-white rounded-lg hover:bg-gray-800 transition-colors font-medium",
|
|
1414
|
+
children: "Close"
|
|
1415
|
+
}
|
|
1416
|
+
) })
|
|
1417
|
+
] }) });
|
|
1418
|
+
}
|
|
1419
|
+
const kr = {
|
|
1420
|
+
small: "w-32 h-32",
|
|
1421
|
+
medium: "w-48 h-48",
|
|
1422
|
+
large: "w-64 h-64"
|
|
1423
|
+
};
|
|
1424
|
+
function Mr({
|
|
1425
|
+
nodes: u,
|
|
1426
|
+
cardCount: r = 2,
|
|
1427
|
+
minInterval: n = 1e3,
|
|
1428
|
+
maxInterval: a = 3e3,
|
|
1429
|
+
onCardClick: i,
|
|
1430
|
+
cardSize: l = "medium",
|
|
1431
|
+
className: c = ""
|
|
1432
|
+
}) {
|
|
1433
|
+
const p = Math.min(Math.max(r, 1), 5), [d, _] = L([]), [v, C] = L([]), [E, N] = L(Array(p).fill(!1)), [T, j] = L(Array(p).fill(!1)), Y = Be([]), $ = X((h) => {
|
|
1434
|
+
const R = u.filter((y) => !h.includes(y._id));
|
|
1435
|
+
if (R.length === 0) return null;
|
|
1436
|
+
const D = Math.floor(Math.random() * R.length);
|
|
1437
|
+
return R[D];
|
|
1438
|
+
}, [u]), P = X(() => Math.random() * (a - n) + n, [n, a]);
|
|
1439
|
+
oe(() => {
|
|
1440
|
+
if (u.length === 0) {
|
|
1441
|
+
_([]), C([]);
|
|
1442
|
+
return;
|
|
1443
|
+
}
|
|
1444
|
+
const h = [], R = [], D = [];
|
|
1445
|
+
for (let y = 0; y < p && y < u.length; y++) {
|
|
1446
|
+
const k = $(D);
|
|
1447
|
+
k && (h.push(k), D.push(k._id));
|
|
1448
|
+
}
|
|
1449
|
+
for (let y = 0; y < h.length; y++) {
|
|
1450
|
+
const k = [
|
|
1451
|
+
h[y]._id,
|
|
1452
|
+
...h.filter((z, M) => M !== y).map((z) => z._id)
|
|
1453
|
+
], b = $(k);
|
|
1454
|
+
b ? R.push(b) : R.push(h[y]);
|
|
1455
|
+
}
|
|
1456
|
+
_(h), C(R);
|
|
1457
|
+
}, [u, p, $]);
|
|
1458
|
+
const B = X((h) => {
|
|
1459
|
+
const R = P(), D = setTimeout(() => {
|
|
1460
|
+
N((y) => {
|
|
1461
|
+
const k = [...y];
|
|
1462
|
+
return k[h] = !k[h], k;
|
|
1463
|
+
}), setTimeout(() => {
|
|
1464
|
+
j((y) => {
|
|
1465
|
+
const k = [...y];
|
|
1466
|
+
return k[h] = !k[h], k;
|
|
1467
|
+
}), setTimeout(() => {
|
|
1468
|
+
const y = !T[h];
|
|
1469
|
+
y && _((k) => {
|
|
1470
|
+
const b = [...k];
|
|
1471
|
+
return b[h] = v[h], b;
|
|
1472
|
+
}), C((k) => {
|
|
1473
|
+
const b = [...k], M = [
|
|
1474
|
+
(y ? v[h] : d[h])._id,
|
|
1475
|
+
...d.filter((U, G) => G !== h).map((U) => U._id),
|
|
1476
|
+
...k.filter((U, G) => G !== h).map((U) => U._id)
|
|
1477
|
+
], m = $(M);
|
|
1478
|
+
return m && (b[h] = m), b;
|
|
1479
|
+
}), setTimeout(() => {
|
|
1480
|
+
B(h);
|
|
1481
|
+
}, 150);
|
|
1482
|
+
}, 200);
|
|
1483
|
+
}, 150);
|
|
1484
|
+
}, R);
|
|
1485
|
+
Y.current[h] = D;
|
|
1486
|
+
}, [P, $, d, v, T]), q = Be(!1);
|
|
1487
|
+
oe(() => {
|
|
1488
|
+
if (!(d.length === 0 || u.length <= 1) && !q.current) {
|
|
1489
|
+
q.current = !0;
|
|
1490
|
+
for (let h = 0; h < d.length; h++)
|
|
1491
|
+
B(h);
|
|
1492
|
+
return () => {
|
|
1493
|
+
Y.current.forEach((h) => clearTimeout(h)), Y.current = [], q.current = !1;
|
|
1494
|
+
};
|
|
1495
|
+
}
|
|
1496
|
+
}, [d.length, u.length]);
|
|
1497
|
+
const V = (h) => {
|
|
1498
|
+
i && i(h);
|
|
1499
|
+
};
|
|
1500
|
+
return u.length === 0 ? /* @__PURE__ */ s.jsx("div", { className: `flex items-center justify-center p-8 ${c}`, children: /* @__PURE__ */ s.jsx("p", { className: "text-gray-500", children: "No nodes available" }) }) : d.length === 0 ? /* @__PURE__ */ s.jsx("div", { className: `flex items-center justify-center p-8 ${c}`, children: /* @__PURE__ */ s.jsx("p", { className: "text-gray-500", children: "Loading..." }) }) : /* @__PURE__ */ s.jsx("div", { className: `flex gap-4 justify-center items-center flex-wrap ${c}`, children: d.map((h, R) => {
|
|
1501
|
+
const D = v[R], y = T[R];
|
|
1502
|
+
return /* @__PURE__ */ s.jsx(
|
|
1503
|
+
"div",
|
|
1504
|
+
{
|
|
1505
|
+
className: `relative ${kr[l]}`,
|
|
1506
|
+
style: { perspective: "1000px" },
|
|
1507
|
+
onClick: () => V(y ? D : h),
|
|
1508
|
+
children: /* @__PURE__ */ s.jsxs(
|
|
1509
|
+
"div",
|
|
1510
|
+
{
|
|
1511
|
+
className: "w-full h-full rounded-lg shadow-lg overflow-hidden cursor-pointer hover:shadow-xl",
|
|
1512
|
+
style: {
|
|
1513
|
+
transform: `rotateY(${E[R] ? 180 : 0}deg)`,
|
|
1514
|
+
transition: "transform 0.5s",
|
|
1515
|
+
transformStyle: "preserve-3d"
|
|
1516
|
+
},
|
|
1517
|
+
children: [
|
|
1518
|
+
/* @__PURE__ */ s.jsx(
|
|
1519
|
+
"div",
|
|
1520
|
+
{
|
|
1521
|
+
className: "absolute inset-0 transition-opacity duration-200",
|
|
1522
|
+
style: {
|
|
1523
|
+
opacity: y ? 0 : 1
|
|
1524
|
+
},
|
|
1525
|
+
children: /* @__PURE__ */ s.jsxs(
|
|
1526
|
+
"div",
|
|
1527
|
+
{
|
|
1528
|
+
style: {
|
|
1529
|
+
transform: E[R] ? "scaleX(-1)" : "scaleX(1)",
|
|
1530
|
+
width: "100%",
|
|
1531
|
+
height: "100%"
|
|
1532
|
+
},
|
|
1533
|
+
children: [
|
|
1534
|
+
/* @__PURE__ */ s.jsx(
|
|
1535
|
+
"img",
|
|
1536
|
+
{
|
|
1537
|
+
src: h.data.image,
|
|
1538
|
+
alt: h.title,
|
|
1539
|
+
className: "w-full h-full object-cover"
|
|
1540
|
+
}
|
|
1541
|
+
),
|
|
1542
|
+
/* @__PURE__ */ s.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ s.jsx("p", { className: "text-white text-sm font-medium truncate", children: h.title }) })
|
|
1543
|
+
]
|
|
1544
|
+
}
|
|
1545
|
+
)
|
|
1546
|
+
}
|
|
1547
|
+
),
|
|
1548
|
+
D && /* @__PURE__ */ s.jsx(
|
|
1549
|
+
"div",
|
|
1550
|
+
{
|
|
1551
|
+
className: "absolute inset-0 transition-opacity duration-200",
|
|
1552
|
+
style: {
|
|
1553
|
+
opacity: y ? 1 : 0
|
|
1554
|
+
},
|
|
1555
|
+
children: /* @__PURE__ */ s.jsxs(
|
|
1556
|
+
"div",
|
|
1557
|
+
{
|
|
1558
|
+
style: {
|
|
1559
|
+
transform: E[R] ? "scaleX(-1)" : "scaleX(1)",
|
|
1560
|
+
width: "100%",
|
|
1561
|
+
height: "100%"
|
|
1562
|
+
},
|
|
1563
|
+
children: [
|
|
1564
|
+
/* @__PURE__ */ s.jsx(
|
|
1565
|
+
"img",
|
|
1566
|
+
{
|
|
1567
|
+
src: D.data.image,
|
|
1568
|
+
alt: D.title,
|
|
1569
|
+
className: "w-full h-full object-cover"
|
|
1570
|
+
}
|
|
1571
|
+
),
|
|
1572
|
+
/* @__PURE__ */ s.jsx("div", { className: "absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/70 to-transparent p-2", children: /* @__PURE__ */ s.jsx("p", { className: "text-white text-sm font-medium truncate", children: D.title }) })
|
|
1573
|
+
]
|
|
1574
|
+
}
|
|
1575
|
+
)
|
|
1576
|
+
}
|
|
1577
|
+
)
|
|
1578
|
+
]
|
|
1579
|
+
}
|
|
1580
|
+
)
|
|
1581
|
+
},
|
|
1582
|
+
`slot-${R}`
|
|
1583
|
+
);
|
|
1584
|
+
}) });
|
|
1585
|
+
}
|
|
1586
|
+
export {
|
|
1587
|
+
Mr as AnimatedCardFlip,
|
|
1588
|
+
jr as ApiClient,
|
|
1589
|
+
Er as AuthManager,
|
|
1590
|
+
$r as Card,
|
|
1591
|
+
xe as DataOperations,
|
|
1592
|
+
Fr as Detail,
|
|
1593
|
+
Or as GraphClient,
|
|
1594
|
+
Dr as Stack,
|
|
1595
|
+
Ve as getApiClient,
|
|
1596
|
+
Pr as initializeApiClient,
|
|
1597
|
+
Ar as useMutation,
|
|
1598
|
+
Rr as useQuery
|
|
1599
|
+
};
|