maze-blockly-wrapper 0.2.6 → 0.3.2

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.
Files changed (41) hide show
  1. package/dist/blockly-CB1haBOu.cjs +329 -0
  2. package/dist/blockly-CB1haBOu.cjs.map +1 -0
  3. package/dist/blockly-D9trJ_x0.js +329 -0
  4. package/dist/blockly-D9trJ_x0.js.map +1 -0
  5. package/dist/blockly_compressed-Bdba50O4.js +21043 -0
  6. package/dist/{blockly_compressed-BMyLVN-Q.js.map → blockly_compressed-Bdba50O4.js.map} +1 -1
  7. package/dist/blockly_compressed-DKwMdvF1.cjs +21042 -0
  8. package/dist/{blockly_compressed-BSXJbxOI.cjs.map → blockly_compressed-DKwMdvF1.cjs.map} +1 -1
  9. package/dist/blocks-B05dnyOn.js +1707 -0
  10. package/dist/{blocks-B72zId9w.js.map → blocks-B05dnyOn.js.map} +1 -1
  11. package/dist/blocks-BabbRNKU.cjs +1707 -0
  12. package/dist/{blocks-GkRPBplU.cjs.map → blocks-BabbRNKU.cjs.map} +1 -1
  13. package/dist/components/BlocklyDebugTest.d.ts +30 -0
  14. package/dist/components/maze/MazeGame.d.ts +1 -0
  15. package/dist/index-C2TQzLih.js +5038 -0
  16. package/dist/index-C2TQzLih.js.map +1 -0
  17. package/dist/index-CeTmKa8Y.cjs +5053 -0
  18. package/dist/index-CeTmKa8Y.cjs.map +1 -0
  19. package/dist/index.cjs.js +34 -1
  20. package/dist/index.cjs.js.map +1 -1
  21. package/dist/index.esm.js +32 -31
  22. package/dist/javascript-B767_urL.js +969 -0
  23. package/dist/{javascript-CBgY3c4m.js.map → javascript-B767_urL.js.map} +1 -1
  24. package/dist/javascript-Diow8phl.cjs +969 -0
  25. package/dist/{javascript-DCJc0bzp.cjs.map → javascript-Diow8phl.cjs.map} +1 -1
  26. package/dist/utils/blocklySetup.d.ts +4 -0
  27. package/package.json +1 -1
  28. package/dist/blockly-B8_W0qMx.js +0 -328
  29. package/dist/blockly-B8_W0qMx.js.map +0 -1
  30. package/dist/blockly-D-XLGkbZ.cjs +0 -2
  31. package/dist/blockly-D-XLGkbZ.cjs.map +0 -1
  32. package/dist/blockly_compressed-BMyLVN-Q.js +0 -15717
  33. package/dist/blockly_compressed-BSXJbxOI.cjs +0 -792
  34. package/dist/blocks-B72zId9w.js +0 -1316
  35. package/dist/blocks-GkRPBplU.cjs +0 -4
  36. package/dist/index-D10FGDwl.js +0 -3666
  37. package/dist/index-D10FGDwl.js.map +0 -1
  38. package/dist/index-I2TnBYCs.cjs +0 -74
  39. package/dist/index-I2TnBYCs.cjs.map +0 -1
  40. package/dist/javascript-CBgY3c4m.js +0 -819
  41. package/dist/javascript-DCJc0bzp.cjs +0 -219
@@ -1,3666 +0,0 @@
1
- import * as S from "react";
2
- import K, { useRef as Me, useState as qe, useCallback as q, useContext as Z, useMemo as Ne, useEffect as Pt, Component as ze } from "react";
3
- import xe from "react-dom";
4
- let U, Ve, Re = !1, de = null;
5
- function vr() {
6
- return Re ? (console.log("[Blockly Setup] Already initialized, returning resolved promise"), Promise.resolve()) : de ? (console.log("[Blockly Setup] Initialization already in progress, returning existing promise"), de) : (console.log("[Blockly Setup] Starting Blockly initialization..."), de = new Promise((t, e) => {
7
- (async () => {
8
- try {
9
- if (console.log("[Blockly Setup] Checking Blockly core availability..."), typeof U > "u") {
10
- console.log("[Blockly Setup] Blockly not loaded, attempting dynamic import...");
11
- try {
12
- const n = await import("./blockly-B8_W0qMx.js");
13
- await import("./blocks-B72zId9w.js");
14
- const o = await import("./javascript-CBgY3c4m.js");
15
- U = n, Ve = o.javascriptGenerator, console.log("[Blockly Setup] Blockly modules imported successfully");
16
- } catch (n) {
17
- console.error("[Blockly Setup] Failed to import Blockly modules:", n);
18
- const o = new Error("Blockly core is not available. Make sure Blockly is properly installed and imported in your project.");
19
- e(o);
20
- return;
21
- }
22
- }
23
- if (console.log("[Blockly Setup] Blockly core is available"), console.log("[Blockly Setup] Setting up locale..."), typeof U.setLocale == "function")
24
- try {
25
- U.setLocale("en"), console.log("[Blockly Setup] Locale set to English");
26
- } catch (n) {
27
- console.warn("[Blockly Setup] Locale setup failed, using default:", n);
28
- }
29
- if (console.log("[Blockly Setup] Initializing main workspace access..."), typeof U.getMainWorkspace == "function")
30
- try {
31
- U.getMainWorkspace(), console.log("[Blockly Setup] Main workspace access initialized");
32
- } catch (n) {
33
- console.log("[Blockly Setup] Main workspace access failed (expected if no workspace exists):", n);
34
- }
35
- if (console.log("[Blockly Setup] Initializing event system..."), typeof U.Events == "object" && U.Events.getGroup)
36
- try {
37
- U.Events.getGroup(), console.log("[Blockly Setup] Event system initialized");
38
- } catch (n) {
39
- console.log("[Blockly Setup] Event system initialization failed (may already be initialized):", n);
40
- }
41
- if (console.log("[Blockly Setup] Checking JavaScript generator..."), typeof Ve > "u") {
42
- const n = new Error("Blockly JavaScript generator is not available. Make sure blockly/javascript is imported.");
43
- console.error("[Blockly Setup] Error:", n.message), e(n);
44
- return;
45
- }
46
- console.log("[Blockly Setup] JavaScript generator is available"), Re = !0, console.log("[Blockly Setup] ✅ Blockly initialized successfully for package usage"), t();
47
- } catch (n) {
48
- console.error("[Blockly Setup] ❌ Failed to initialize Blockly:", n), de = null, e(n);
49
- }
50
- })();
51
- }), de);
52
- }
53
- function At() {
54
- return Re && typeof U < "u";
55
- }
56
- function He() {
57
- if (!At())
58
- throw new Error("Blockly is not initialized. Call initializeBlockly() first.");
59
- return U;
60
- }
61
- function Be() {
62
- if (!At())
63
- throw new Error("Blockly is not initialized. Call initializeBlockly() first.");
64
- return Ve;
65
- }
66
- function Gn() {
67
- console.log("[Blockly Setup] Resetting initialization state"), Re = !1, de = null;
68
- }
69
- function Yn(t, e) {
70
- let r;
71
- return (...n) => {
72
- clearTimeout(r), r = setTimeout(() => t(...n), e);
73
- };
74
- }
75
- function Un(t, e) {
76
- let r;
77
- return (...n) => {
78
- r || (t(...n), r = !0, setTimeout(() => r = !1, e));
79
- };
80
- }
81
- function qn(t = 8) {
82
- const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
83
- let r = "";
84
- for (let n = 0; n < t; n++)
85
- r += e.charAt(Math.floor(Math.random() * e.length));
86
- return r;
87
- }
88
- function Vn(t) {
89
- return t.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
90
- }
91
- function Hn(t, e = {}) {
92
- const r = new Date(t), n = {
93
- year: "numeric",
94
- month: "long",
95
- day: "numeric",
96
- ...e
97
- };
98
- return new Intl.DateTimeFormat("en-US", n).format(r);
99
- }
100
- function Xn(t) {
101
- const e = /* @__PURE__ */ new Date(), r = new Date(t), n = Math.floor((e.getTime() - r.getTime()) / 1e3);
102
- if (n < 60)
103
- return "just now";
104
- const o = Math.floor(n / 60);
105
- if (o < 60)
106
- return `${o} minute${o === 1 ? "" : "s"} ago`;
107
- const i = Math.floor(o / 60);
108
- if (i < 24)
109
- return `${i} hour${i === 1 ? "" : "s"} ago`;
110
- const a = Math.floor(i / 24);
111
- if (a < 7)
112
- return `${a} day${a === 1 ? "" : "s"} ago`;
113
- const l = Math.floor(a / 7);
114
- if (l < 4)
115
- return `${l} week${l === 1 ? "" : "s"} ago`;
116
- const u = Math.floor(a / 30);
117
- if (u < 12)
118
- return `${u} month${u === 1 ? "" : "s"} ago`;
119
- const f = Math.floor(a / 365);
120
- return `${f} year${f === 1 ? "" : "s"} ago`;
121
- }
122
- function gr(t) {
123
- return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
124
- }
125
- function Jn(t) {
126
- return t.toLowerCase().split(" ").map((e) => gr(e)).join(" ");
127
- }
128
- function Kn(t, e, r = "...") {
129
- return t.length <= e ? t : t.substring(0, e - r.length) + r;
130
- }
131
- function Zn(t) {
132
- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t);
133
- }
134
- function Qn(t) {
135
- try {
136
- return new URL(t), !0;
137
- } catch {
138
- return !1;
139
- }
140
- }
141
- function dt(t) {
142
- if (t === null || typeof t != "object")
143
- return t;
144
- if (t instanceof Date)
145
- return new Date(t.getTime());
146
- if (t instanceof Array)
147
- return t.map((e) => dt(e));
148
- if (typeof t == "object") {
149
- const e = {};
150
- for (const r in t)
151
- Object.prototype.hasOwnProperty.call(t, r) && (e[r] = dt(t[r]));
152
- return e;
153
- }
154
- return t;
155
- }
156
- function xr(...t) {
157
- return t.reduce((e, r) => {
158
- for (const n in r)
159
- Object.prototype.hasOwnProperty.call(r, n) && (typeof r[n] == "object" && r[n] !== null && !Array.isArray(r[n]) ? e[n] = xr(e[n] || {}, r[n]) : e[n] = r[n]);
160
- return e;
161
- }, {});
162
- }
163
- function eo(t) {
164
- const e = {};
165
- for (const r in t)
166
- Object.prototype.hasOwnProperty.call(t, r) && t[r] !== void 0 && t[r] !== null && (e[r] = t[r]);
167
- return e;
168
- }
169
- function to(t, e, r) {
170
- const n = e.split(".");
171
- let o = t;
172
- for (const i of n)
173
- if (o && typeof o == "object" && i in o)
174
- o = o[i];
175
- else
176
- return r;
177
- return o;
178
- }
179
- function ro(t, e, r) {
180
- const n = e.split("."), o = { ...t };
181
- let i = o;
182
- for (let a = 0; a < n.length - 1; a++) {
183
- const l = n[a];
184
- (!(l in i) || typeof i[l] != "object") && (i[l] = {}), i = i[l];
185
- }
186
- return i[n[n.length - 1]] = r, o;
187
- }
188
- function br(t, e) {
189
- if (t === e)
190
- return !0;
191
- if (typeof t != "object" || typeof e != "object" || t === null || e === null)
192
- return !1;
193
- const r = Object.keys(t), n = Object.keys(e);
194
- if (r.length !== n.length)
195
- return !1;
196
- for (const o of r)
197
- if (!n.includes(o) || !br(t[o], e[o]))
198
- return !1;
199
- return !0;
200
- }
201
- function Er(t) {
202
- return new Promise((e) => setTimeout(e, t));
203
- }
204
- async function no(t, e = 3, r = 1e3) {
205
- let n;
206
- for (let o = 0; o <= e; o++)
207
- try {
208
- return await t();
209
- } catch (i) {
210
- if (n = i, o === e)
211
- throw n;
212
- const a = r * Math.pow(2, o);
213
- await Er(a);
214
- }
215
- throw n;
216
- }
217
- var oo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
218
- function rt(t) {
219
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
220
- }
221
- var Ce = { exports: {} }, ve = {};
222
- /**
223
- * @license React
224
- * react-jsx-runtime.production.js
225
- *
226
- * Copyright (c) Meta Platforms, Inc. and affiliates.
227
- *
228
- * This source code is licensed under the MIT license found in the
229
- * LICENSE file in the root directory of this source tree.
230
- */
231
- var pt;
232
- function wr() {
233
- if (pt) return ve;
234
- pt = 1;
235
- var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
236
- function r(n, o, i) {
237
- var a = null;
238
- if (i !== void 0 && (a = "" + i), o.key !== void 0 && (a = "" + o.key), "key" in o) {
239
- i = {};
240
- for (var l in o)
241
- l !== "key" && (i[l] = o[l]);
242
- } else i = o;
243
- return o = i.ref, {
244
- $$typeof: t,
245
- type: n,
246
- key: a,
247
- ref: o !== void 0 ? o : null,
248
- props: i
249
- };
250
- }
251
- return ve.Fragment = e, ve.jsx = r, ve.jsxs = r, ve;
252
- }
253
- var ge = {};
254
- /**
255
- * @license React
256
- * react-jsx-runtime.development.js
257
- *
258
- * Copyright (c) Meta Platforms, Inc. and affiliates.
259
- *
260
- * This source code is licensed under the MIT license found in the
261
- * LICENSE file in the root directory of this source tree.
262
- */
263
- var mt;
264
- function Cr() {
265
- return mt || (mt = 1, process.env.NODE_ENV !== "production" && (function() {
266
- function t(s) {
267
- if (s == null) return null;
268
- if (typeof s == "function")
269
- return s.$$typeof === he ? null : s.displayName || s.name || null;
270
- if (typeof s == "string") return s;
271
- switch (s) {
272
- case g:
273
- return "Fragment";
274
- case P:
275
- return "Profiler";
276
- case b:
277
- return "StrictMode";
278
- case m:
279
- return "Suspense";
280
- case L:
281
- return "SuspenseList";
282
- case me:
283
- return "Activity";
284
- }
285
- if (typeof s == "object")
286
- switch (typeof s.tag == "number" && console.error(
287
- "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
288
- ), s.$$typeof) {
289
- case A:
290
- return "Portal";
291
- case j:
292
- return (s.displayName || "Context") + ".Provider";
293
- case F:
294
- return (s._context.displayName || "Context") + ".Consumer";
295
- case D:
296
- var d = s.render;
297
- return s = s.displayName, s || (s = d.displayName || d.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
298
- case Y:
299
- return d = s.displayName || null, d !== null ? d : t(s.type) || "Memo";
300
- case se:
301
- d = s._payload, s = s._init;
302
- try {
303
- return t(s(d));
304
- } catch {
305
- }
306
- }
307
- return null;
308
- }
309
- function e(s) {
310
- return "" + s;
311
- }
312
- function r(s) {
313
- try {
314
- e(s);
315
- var d = !1;
316
- } catch {
317
- d = !0;
318
- }
319
- if (d) {
320
- d = console;
321
- var x = d.error, E = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
322
- return x.call(
323
- d,
324
- "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
325
- E
326
- ), e(s);
327
- }
328
- }
329
- function n(s) {
330
- if (s === g) return "<>";
331
- if (typeof s == "object" && s !== null && s.$$typeof === se)
332
- return "<...>";
333
- try {
334
- var d = t(s);
335
- return d ? "<" + d + ">" : "<...>";
336
- } catch {
337
- return "<...>";
338
- }
339
- }
340
- function o() {
341
- var s = te.A;
342
- return s === null ? null : s.getOwner();
343
- }
344
- function i() {
345
- return Error("react-stack-top-frame");
346
- }
347
- function a(s) {
348
- if (le.call(s, "key")) {
349
- var d = Object.getOwnPropertyDescriptor(s, "key").get;
350
- if (d && d.isReactWarning) return !1;
351
- }
352
- return s.key !== void 0;
353
- }
354
- function l(s, d) {
355
- function x() {
356
- ce || (ce = !0, console.error(
357
- "%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://react.dev/link/special-props)",
358
- d
359
- ));
360
- }
361
- x.isReactWarning = !0, Object.defineProperty(s, "key", {
362
- get: x,
363
- configurable: !0
364
- });
365
- }
366
- function u() {
367
- var s = t(this.type);
368
- return G[s] || (G[s] = !0, console.error(
369
- "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
370
- )), s = this.props.ref, s !== void 0 ? s : null;
371
- }
372
- function f(s, d, x, E, w, T, _, O) {
373
- return x = T.ref, s = {
374
- $$typeof: R,
375
- type: s,
376
- key: d,
377
- props: T,
378
- _owner: w
379
- }, (x !== void 0 ? x : null) !== null ? Object.defineProperty(s, "ref", {
380
- enumerable: !1,
381
- get: u
382
- }) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
383
- configurable: !1,
384
- enumerable: !1,
385
- writable: !0,
386
- value: 0
387
- }), Object.defineProperty(s, "_debugInfo", {
388
- configurable: !1,
389
- enumerable: !1,
390
- writable: !0,
391
- value: null
392
- }), Object.defineProperty(s, "_debugStack", {
393
- configurable: !1,
394
- enumerable: !1,
395
- writable: !0,
396
- value: _
397
- }), Object.defineProperty(s, "_debugTask", {
398
- configurable: !1,
399
- enumerable: !1,
400
- writable: !0,
401
- value: O
402
- }), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
403
- }
404
- function p(s, d, x, E, w, T, _, O) {
405
- var C = d.children;
406
- if (C !== void 0)
407
- if (E)
408
- if (ye(C)) {
409
- for (E = 0; E < C.length; E++)
410
- h(C[E]);
411
- Object.freeze && Object.freeze(C);
412
- } else
413
- console.error(
414
- "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
415
- );
416
- else h(C);
417
- if (le.call(d, "key")) {
418
- C = t(s);
419
- var M = Object.keys(d).filter(function(W) {
420
- return W !== "key";
421
- });
422
- E = 0 < M.length ? "{key: someKey, " + M.join(": ..., ") + ": ...}" : "{key: someKey}", ue[C + E] || (M = 0 < M.length ? "{" + M.join(": ..., ") + ": ...}" : "{}", console.error(
423
- `A props object containing a "key" prop is being spread into JSX:
424
- let props = %s;
425
- <%s {...props} />
426
- React keys must be passed directly to JSX without using spread:
427
- let props = %s;
428
- <%s key={someKey} {...props} />`,
429
- E,
430
- C,
431
- M,
432
- C
433
- ), ue[C + E] = !0);
434
- }
435
- if (C = null, x !== void 0 && (r(x), C = "" + x), a(d) && (r(d.key), C = "" + d.key), "key" in d) {
436
- x = {};
437
- for (var N in d)
438
- N !== "key" && (x[N] = d[N]);
439
- } else x = d;
440
- return C && l(
441
- x,
442
- typeof s == "function" ? s.displayName || s.name || "Unknown" : s
443
- ), f(
444
- s,
445
- C,
446
- T,
447
- w,
448
- o(),
449
- x,
450
- _,
451
- O
452
- );
453
- }
454
- function h(s) {
455
- typeof s == "object" && s !== null && s.$$typeof === R && s._store && (s._store.validated = 1);
456
- }
457
- var y = K, R = Symbol.for("react.transitional.element"), A = Symbol.for("react.portal"), g = Symbol.for("react.fragment"), b = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), F = Symbol.for("react.consumer"), j = Symbol.for("react.context"), D = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), L = Symbol.for("react.suspense_list"), Y = Symbol.for("react.memo"), se = Symbol.for("react.lazy"), me = Symbol.for("react.activity"), he = Symbol.for("react.client.reference"), te = y.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, le = Object.prototype.hasOwnProperty, ye = Array.isArray, V = console.createTask ? console.createTask : function() {
458
- return null;
459
- };
460
- y = {
461
- react_stack_bottom_frame: function(s) {
462
- return s();
463
- }
464
- };
465
- var ce, G = {}, H = y.react_stack_bottom_frame.bind(
466
- y,
467
- i
468
- )(), oe = V(n(i)), ue = {};
469
- ge.Fragment = g, ge.jsx = function(s, d, x, E, w) {
470
- var T = 1e4 > te.recentlyCreatedOwnerStacks++;
471
- return p(
472
- s,
473
- d,
474
- x,
475
- !1,
476
- E,
477
- w,
478
- T ? Error("react-stack-top-frame") : H,
479
- T ? V(n(s)) : oe
480
- );
481
- }, ge.jsxs = function(s, d, x, E, w) {
482
- var T = 1e4 > te.recentlyCreatedOwnerStacks++;
483
- return p(
484
- s,
485
- d,
486
- x,
487
- !0,
488
- E,
489
- w,
490
- T ? Error("react-stack-top-frame") : H,
491
- T ? V(n(s)) : oe
492
- );
493
- };
494
- })()), ge;
495
- }
496
- var ht;
497
- function kr() {
498
- return ht || (ht = 1, process.env.NODE_ENV === "production" ? Ce.exports = wr() : Ce.exports = Cr()), Ce.exports;
499
- }
500
- var c = kr(), $e = { exports: {} };
501
- /*!
502
- Copyright (c) 2018 Jed Watson.
503
- Licensed under the MIT License (MIT), see
504
- http://jedwatson.github.io/classnames
505
- */
506
- var yt;
507
- function Sr() {
508
- return yt || (yt = 1, (function(t) {
509
- (function() {
510
- var e = {}.hasOwnProperty;
511
- function r() {
512
- for (var i = "", a = 0; a < arguments.length; a++) {
513
- var l = arguments[a];
514
- l && (i = o(i, n(l)));
515
- }
516
- return i;
517
- }
518
- function n(i) {
519
- if (typeof i == "string" || typeof i == "number")
520
- return i;
521
- if (typeof i != "object")
522
- return "";
523
- if (Array.isArray(i))
524
- return r.apply(null, i);
525
- if (i.toString !== Object.prototype.toString && !i.toString.toString().includes("[native code]"))
526
- return i.toString();
527
- var a = "";
528
- for (var l in i)
529
- e.call(i, l) && i[l] && (a = o(a, l));
530
- return a;
531
- }
532
- function o(i, a) {
533
- return a ? i ? i + " " + a : i + a : i;
534
- }
535
- t.exports ? (r.default = r, t.exports = r) : window.classNames = r;
536
- })();
537
- })($e)), $e.exports;
538
- }
539
- var Tr = Sr();
540
- const z = /* @__PURE__ */ rt(Tr);
541
- function Xe() {
542
- return Xe = Object.assign ? Object.assign.bind() : function(t) {
543
- for (var e = 1; e < arguments.length; e++) {
544
- var r = arguments[e];
545
- for (var n in r) ({}).hasOwnProperty.call(r, n) && (t[n] = r[n]);
546
- }
547
- return t;
548
- }, Xe.apply(null, arguments);
549
- }
550
- function Bt(t, e) {
551
- if (t == null) return {};
552
- var r = {};
553
- for (var n in t) if ({}.hasOwnProperty.call(t, n)) {
554
- if (e.indexOf(n) !== -1) continue;
555
- r[n] = t[n];
556
- }
557
- return r;
558
- }
559
- function vt(t) {
560
- return "default" + t.charAt(0).toUpperCase() + t.substr(1);
561
- }
562
- function Rr(t) {
563
- var e = _r(t, "string");
564
- return typeof e == "symbol" ? e : String(e);
565
- }
566
- function _r(t, e) {
567
- if (typeof t != "object" || t === null) return t;
568
- var r = t[Symbol.toPrimitive];
569
- if (r !== void 0) {
570
- var n = r.call(t, e);
571
- if (typeof n != "object") return n;
572
- throw new TypeError("@@toPrimitive must return a primitive value.");
573
- }
574
- return String(t);
575
- }
576
- function jr(t, e, r) {
577
- var n = Me(t !== void 0), o = qe(e), i = o[0], a = o[1], l = t !== void 0, u = n.current;
578
- return n.current = l, !l && u && i !== e && a(e), [l ? t : i, q(function(f) {
579
- for (var p = arguments.length, h = new Array(p > 1 ? p - 1 : 0), y = 1; y < p; y++)
580
- h[y - 1] = arguments[y];
581
- r && r.apply(void 0, [f].concat(h)), a(f);
582
- }, [r])];
583
- }
584
- function Or(t, e) {
585
- return Object.keys(e).reduce(function(r, n) {
586
- var o, i = r, a = i[vt(n)], l = i[n], u = Bt(i, [vt(n), n].map(Rr)), f = e[n], p = jr(l, a, t[f]), h = p[0], y = p[1];
587
- return Xe({}, u, (o = {}, o[n] = h, o[f] = y, o));
588
- }, t);
589
- }
590
- function Je(t, e) {
591
- return Je = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(r, n) {
592
- return r.__proto__ = n, r;
593
- }, Je(t, e);
594
- }
595
- function Mr(t, e) {
596
- t.prototype = Object.create(e.prototype), t.prototype.constructor = t, Je(t, e);
597
- }
598
- const Nr = ["xxl", "xl", "lg", "md", "sm", "xs"], zr = "xs", Pe = /* @__PURE__ */ S.createContext({
599
- prefixes: {},
600
- breakpoints: Nr,
601
- minBreakpoint: zr
602
- }), {
603
- Consumer: io,
604
- Provider: ao
605
- } = Pe;
606
- function I(t, e) {
607
- const {
608
- prefixes: r
609
- } = Z(Pe);
610
- return t || r[e] || e;
611
- }
612
- function $t() {
613
- const {
614
- breakpoints: t
615
- } = Z(Pe);
616
- return t;
617
- }
618
- function It() {
619
- const {
620
- minBreakpoint: t
621
- } = Z(Pe);
622
- return t;
623
- }
624
- function Pr(t) {
625
- return t && t.ownerDocument || document;
626
- }
627
- function Ar(t) {
628
- var e = Pr(t);
629
- return e && e.defaultView || window;
630
- }
631
- function Br(t, e) {
632
- return Ar(t).getComputedStyle(t, e);
633
- }
634
- var $r = /([A-Z])/g;
635
- function Ir(t) {
636
- return t.replace($r, "-$1").toLowerCase();
637
- }
638
- var Dr = /^ms-/;
639
- function ke(t) {
640
- return Ir(t).replace(Dr, "-ms-");
641
- }
642
- var Fr = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;
643
- function Lr(t) {
644
- return !!(t && Fr.test(t));
645
- }
646
- function Dt(t, e) {
647
- var r = "", n = "";
648
- if (typeof e == "string")
649
- return t.style.getPropertyValue(ke(e)) || Br(t).getPropertyValue(ke(e));
650
- Object.keys(e).forEach(function(o) {
651
- var i = e[o];
652
- !i && i !== 0 ? t.style.removeProperty(ke(o)) : Lr(o) ? n += o + "(" + i + ") " : r += ke(o) + ": " + i + ";";
653
- }), n && (r += "transform: " + n + ";"), t.style.cssText += ";" + r;
654
- }
655
- var Se = { exports: {} }, Te = { exports: {} }, B = {};
656
- /** @license React v16.13.1
657
- * react-is.production.min.js
658
- *
659
- * Copyright (c) Facebook, Inc. and its affiliates.
660
- *
661
- * This source code is licensed under the MIT license found in the
662
- * LICENSE file in the root directory of this source tree.
663
- */
664
- var gt;
665
- function Wr() {
666
- if (gt) return B;
667
- gt = 1;
668
- var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, n = t ? Symbol.for("react.fragment") : 60107, o = t ? Symbol.for("react.strict_mode") : 60108, i = t ? Symbol.for("react.profiler") : 60114, a = t ? Symbol.for("react.provider") : 60109, l = t ? Symbol.for("react.context") : 60110, u = t ? Symbol.for("react.async_mode") : 60111, f = t ? Symbol.for("react.concurrent_mode") : 60111, p = t ? Symbol.for("react.forward_ref") : 60112, h = t ? Symbol.for("react.suspense") : 60113, y = t ? Symbol.for("react.suspense_list") : 60120, R = t ? Symbol.for("react.memo") : 60115, A = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, b = t ? Symbol.for("react.fundamental") : 60117, P = t ? Symbol.for("react.responder") : 60118, F = t ? Symbol.for("react.scope") : 60119;
669
- function j(m) {
670
- if (typeof m == "object" && m !== null) {
671
- var L = m.$$typeof;
672
- switch (L) {
673
- case e:
674
- switch (m = m.type, m) {
675
- case u:
676
- case f:
677
- case n:
678
- case i:
679
- case o:
680
- case h:
681
- return m;
682
- default:
683
- switch (m = m && m.$$typeof, m) {
684
- case l:
685
- case p:
686
- case A:
687
- case R:
688
- case a:
689
- return m;
690
- default:
691
- return L;
692
- }
693
- }
694
- case r:
695
- return L;
696
- }
697
- }
698
- }
699
- function D(m) {
700
- return j(m) === f;
701
- }
702
- return B.AsyncMode = u, B.ConcurrentMode = f, B.ContextConsumer = l, B.ContextProvider = a, B.Element = e, B.ForwardRef = p, B.Fragment = n, B.Lazy = A, B.Memo = R, B.Portal = r, B.Profiler = i, B.StrictMode = o, B.Suspense = h, B.isAsyncMode = function(m) {
703
- return D(m) || j(m) === u;
704
- }, B.isConcurrentMode = D, B.isContextConsumer = function(m) {
705
- return j(m) === l;
706
- }, B.isContextProvider = function(m) {
707
- return j(m) === a;
708
- }, B.isElement = function(m) {
709
- return typeof m == "object" && m !== null && m.$$typeof === e;
710
- }, B.isForwardRef = function(m) {
711
- return j(m) === p;
712
- }, B.isFragment = function(m) {
713
- return j(m) === n;
714
- }, B.isLazy = function(m) {
715
- return j(m) === A;
716
- }, B.isMemo = function(m) {
717
- return j(m) === R;
718
- }, B.isPortal = function(m) {
719
- return j(m) === r;
720
- }, B.isProfiler = function(m) {
721
- return j(m) === i;
722
- }, B.isStrictMode = function(m) {
723
- return j(m) === o;
724
- }, B.isSuspense = function(m) {
725
- return j(m) === h;
726
- }, B.isValidElementType = function(m) {
727
- return typeof m == "string" || typeof m == "function" || m === n || m === f || m === i || m === o || m === h || m === y || typeof m == "object" && m !== null && (m.$$typeof === A || m.$$typeof === R || m.$$typeof === a || m.$$typeof === l || m.$$typeof === p || m.$$typeof === b || m.$$typeof === P || m.$$typeof === F || m.$$typeof === g);
728
- }, B.typeOf = j, B;
729
- }
730
- var $ = {};
731
- /** @license React v16.13.1
732
- * react-is.development.js
733
- *
734
- * Copyright (c) Facebook, Inc. and its affiliates.
735
- *
736
- * This source code is licensed under the MIT license found in the
737
- * LICENSE file in the root directory of this source tree.
738
- */
739
- var xt;
740
- function Gr() {
741
- return xt || (xt = 1, process.env.NODE_ENV !== "production" && (function() {
742
- var t = typeof Symbol == "function" && Symbol.for, e = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, n = t ? Symbol.for("react.fragment") : 60107, o = t ? Symbol.for("react.strict_mode") : 60108, i = t ? Symbol.for("react.profiler") : 60114, a = t ? Symbol.for("react.provider") : 60109, l = t ? Symbol.for("react.context") : 60110, u = t ? Symbol.for("react.async_mode") : 60111, f = t ? Symbol.for("react.concurrent_mode") : 60111, p = t ? Symbol.for("react.forward_ref") : 60112, h = t ? Symbol.for("react.suspense") : 60113, y = t ? Symbol.for("react.suspense_list") : 60120, R = t ? Symbol.for("react.memo") : 60115, A = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, b = t ? Symbol.for("react.fundamental") : 60117, P = t ? Symbol.for("react.responder") : 60118, F = t ? Symbol.for("react.scope") : 60119;
743
- function j(v) {
744
- return typeof v == "string" || typeof v == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
745
- v === n || v === f || v === i || v === o || v === h || v === y || typeof v == "object" && v !== null && (v.$$typeof === A || v.$$typeof === R || v.$$typeof === a || v.$$typeof === l || v.$$typeof === p || v.$$typeof === b || v.$$typeof === P || v.$$typeof === F || v.$$typeof === g);
746
- }
747
- function D(v) {
748
- if (typeof v == "object" && v !== null) {
749
- var X = v.$$typeof;
750
- switch (X) {
751
- case e:
752
- var we = v.type;
753
- switch (we) {
754
- case u:
755
- case f:
756
- case n:
757
- case i:
758
- case o:
759
- case h:
760
- return we;
761
- default:
762
- var ft = we && we.$$typeof;
763
- switch (ft) {
764
- case l:
765
- case p:
766
- case A:
767
- case R:
768
- case a:
769
- return ft;
770
- default:
771
- return X;
772
- }
773
- }
774
- case r:
775
- return X;
776
- }
777
- }
778
- }
779
- var m = u, L = f, Y = l, se = a, me = e, he = p, te = n, le = A, ye = R, V = r, ce = i, G = o, H = h, oe = !1;
780
- function ue(v) {
781
- return oe || (oe = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), s(v) || D(v) === u;
782
- }
783
- function s(v) {
784
- return D(v) === f;
785
- }
786
- function d(v) {
787
- return D(v) === l;
788
- }
789
- function x(v) {
790
- return D(v) === a;
791
- }
792
- function E(v) {
793
- return typeof v == "object" && v !== null && v.$$typeof === e;
794
- }
795
- function w(v) {
796
- return D(v) === p;
797
- }
798
- function T(v) {
799
- return D(v) === n;
800
- }
801
- function _(v) {
802
- return D(v) === A;
803
- }
804
- function O(v) {
805
- return D(v) === R;
806
- }
807
- function C(v) {
808
- return D(v) === r;
809
- }
810
- function M(v) {
811
- return D(v) === i;
812
- }
813
- function N(v) {
814
- return D(v) === o;
815
- }
816
- function W(v) {
817
- return D(v) === h;
818
- }
819
- $.AsyncMode = m, $.ConcurrentMode = L, $.ContextConsumer = Y, $.ContextProvider = se, $.Element = me, $.ForwardRef = he, $.Fragment = te, $.Lazy = le, $.Memo = ye, $.Portal = V, $.Profiler = ce, $.StrictMode = G, $.Suspense = H, $.isAsyncMode = ue, $.isConcurrentMode = s, $.isContextConsumer = d, $.isContextProvider = x, $.isElement = E, $.isForwardRef = w, $.isFragment = T, $.isLazy = _, $.isMemo = O, $.isPortal = C, $.isProfiler = M, $.isStrictMode = N, $.isSuspense = W, $.isValidElementType = j, $.typeOf = D;
820
- })()), $;
821
- }
822
- var bt;
823
- function Ft() {
824
- return bt || (bt = 1, process.env.NODE_ENV === "production" ? Te.exports = Wr() : Te.exports = Gr()), Te.exports;
825
- }
826
- /*
827
- object-assign
828
- (c) Sindre Sorhus
829
- @license MIT
830
- */
831
- var Ie, Et;
832
- function Yr() {
833
- if (Et) return Ie;
834
- Et = 1;
835
- var t = Object.getOwnPropertySymbols, e = Object.prototype.hasOwnProperty, r = Object.prototype.propertyIsEnumerable;
836
- function n(i) {
837
- if (i == null)
838
- throw new TypeError("Object.assign cannot be called with null or undefined");
839
- return Object(i);
840
- }
841
- function o() {
842
- try {
843
- if (!Object.assign)
844
- return !1;
845
- var i = new String("abc");
846
- if (i[5] = "de", Object.getOwnPropertyNames(i)[0] === "5")
847
- return !1;
848
- for (var a = {}, l = 0; l < 10; l++)
849
- a["_" + String.fromCharCode(l)] = l;
850
- var u = Object.getOwnPropertyNames(a).map(function(p) {
851
- return a[p];
852
- });
853
- if (u.join("") !== "0123456789")
854
- return !1;
855
- var f = {};
856
- return "abcdefghijklmnopqrst".split("").forEach(function(p) {
857
- f[p] = p;
858
- }), Object.keys(Object.assign({}, f)).join("") === "abcdefghijklmnopqrst";
859
- } catch {
860
- return !1;
861
- }
862
- }
863
- return Ie = o() ? Object.assign : function(i, a) {
864
- for (var l, u = n(i), f, p = 1; p < arguments.length; p++) {
865
- l = Object(arguments[p]);
866
- for (var h in l)
867
- e.call(l, h) && (u[h] = l[h]);
868
- if (t) {
869
- f = t(l);
870
- for (var y = 0; y < f.length; y++)
871
- r.call(l, f[y]) && (u[f[y]] = l[f[y]]);
872
- }
873
- }
874
- return u;
875
- }, Ie;
876
- }
877
- var De, wt;
878
- function nt() {
879
- if (wt) return De;
880
- wt = 1;
881
- var t = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
882
- return De = t, De;
883
- }
884
- var Fe, Ct;
885
- function Lt() {
886
- return Ct || (Ct = 1, Fe = Function.call.bind(Object.prototype.hasOwnProperty)), Fe;
887
- }
888
- var Le, kt;
889
- function Ur() {
890
- if (kt) return Le;
891
- kt = 1;
892
- var t = function() {
893
- };
894
- if (process.env.NODE_ENV !== "production") {
895
- var e = /* @__PURE__ */ nt(), r = {}, n = /* @__PURE__ */ Lt();
896
- t = function(i) {
897
- var a = "Warning: " + i;
898
- typeof console < "u" && console.error(a);
899
- try {
900
- throw new Error(a);
901
- } catch {
902
- }
903
- };
904
- }
905
- function o(i, a, l, u, f) {
906
- if (process.env.NODE_ENV !== "production") {
907
- for (var p in i)
908
- if (n(i, p)) {
909
- var h;
910
- try {
911
- if (typeof i[p] != "function") {
912
- var y = Error(
913
- (u || "React class") + ": " + l + " type `" + p + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof i[p] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."
914
- );
915
- throw y.name = "Invariant Violation", y;
916
- }
917
- h = i[p](a, p, u, l, null, e);
918
- } catch (A) {
919
- h = A;
920
- }
921
- if (h && !(h instanceof Error) && t(
922
- (u || "React class") + ": type specification of " + l + " `" + p + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof h + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."
923
- ), h instanceof Error && !(h.message in r)) {
924
- r[h.message] = !0;
925
- var R = f ? f() : "";
926
- t(
927
- "Failed " + l + " type: " + h.message + (R ?? "")
928
- );
929
- }
930
- }
931
- }
932
- }
933
- return o.resetWarningCache = function() {
934
- process.env.NODE_ENV !== "production" && (r = {});
935
- }, Le = o, Le;
936
- }
937
- var We, St;
938
- function qr() {
939
- if (St) return We;
940
- St = 1;
941
- var t = Ft(), e = Yr(), r = /* @__PURE__ */ nt(), n = /* @__PURE__ */ Lt(), o = /* @__PURE__ */ Ur(), i = function() {
942
- };
943
- process.env.NODE_ENV !== "production" && (i = function(l) {
944
- var u = "Warning: " + l;
945
- typeof console < "u" && console.error(u);
946
- try {
947
- throw new Error(u);
948
- } catch {
949
- }
950
- });
951
- function a() {
952
- return null;
953
- }
954
- return We = function(l, u) {
955
- var f = typeof Symbol == "function" && Symbol.iterator, p = "@@iterator";
956
- function h(s) {
957
- var d = s && (f && s[f] || s[p]);
958
- if (typeof d == "function")
959
- return d;
960
- }
961
- var y = "<<anonymous>>", R = {
962
- array: P("array"),
963
- bigint: P("bigint"),
964
- bool: P("boolean"),
965
- func: P("function"),
966
- number: P("number"),
967
- object: P("object"),
968
- string: P("string"),
969
- symbol: P("symbol"),
970
- any: F(),
971
- arrayOf: j,
972
- element: D(),
973
- elementType: m(),
974
- instanceOf: L,
975
- node: he(),
976
- objectOf: se,
977
- oneOf: Y,
978
- oneOfType: me,
979
- shape: le,
980
- exact: ye
981
- };
982
- function A(s, d) {
983
- return s === d ? s !== 0 || 1 / s === 1 / d : s !== s && d !== d;
984
- }
985
- function g(s, d) {
986
- this.message = s, this.data = d && typeof d == "object" ? d : {}, this.stack = "";
987
- }
988
- g.prototype = Error.prototype;
989
- function b(s) {
990
- if (process.env.NODE_ENV !== "production")
991
- var d = {}, x = 0;
992
- function E(T, _, O, C, M, N, W) {
993
- if (C = C || y, N = N || O, W !== r) {
994
- if (u) {
995
- var v = new Error(
996
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
997
- );
998
- throw v.name = "Invariant Violation", v;
999
- } else if (process.env.NODE_ENV !== "production" && typeof console < "u") {
1000
- var X = C + ":" + O;
1001
- !d[X] && // Avoid spamming the console because they are often not actionable except for lib authors
1002
- x < 3 && (i(
1003
- "You are manually calling a React.PropTypes validation function for the `" + N + "` prop on `" + C + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
1004
- ), d[X] = !0, x++);
1005
- }
1006
- }
1007
- return _[O] == null ? T ? _[O] === null ? new g("The " + M + " `" + N + "` is marked as required " + ("in `" + C + "`, but its value is `null`.")) : new g("The " + M + " `" + N + "` is marked as required in " + ("`" + C + "`, but its value is `undefined`.")) : null : s(_, O, C, M, N);
1008
- }
1009
- var w = E.bind(null, !1);
1010
- return w.isRequired = E.bind(null, !0), w;
1011
- }
1012
- function P(s) {
1013
- function d(x, E, w, T, _, O) {
1014
- var C = x[E], M = G(C);
1015
- if (M !== s) {
1016
- var N = H(C);
1017
- return new g(
1018
- "Invalid " + T + " `" + _ + "` of type " + ("`" + N + "` supplied to `" + w + "`, expected ") + ("`" + s + "`."),
1019
- { expectedType: s }
1020
- );
1021
- }
1022
- return null;
1023
- }
1024
- return b(d);
1025
- }
1026
- function F() {
1027
- return b(a);
1028
- }
1029
- function j(s) {
1030
- function d(x, E, w, T, _) {
1031
- if (typeof s != "function")
1032
- return new g("Property `" + _ + "` of component `" + w + "` has invalid PropType notation inside arrayOf.");
1033
- var O = x[E];
1034
- if (!Array.isArray(O)) {
1035
- var C = G(O);
1036
- return new g("Invalid " + T + " `" + _ + "` of type " + ("`" + C + "` supplied to `" + w + "`, expected an array."));
1037
- }
1038
- for (var M = 0; M < O.length; M++) {
1039
- var N = s(O, M, w, T, _ + "[" + M + "]", r);
1040
- if (N instanceof Error)
1041
- return N;
1042
- }
1043
- return null;
1044
- }
1045
- return b(d);
1046
- }
1047
- function D() {
1048
- function s(d, x, E, w, T) {
1049
- var _ = d[x];
1050
- if (!l(_)) {
1051
- var O = G(_);
1052
- return new g("Invalid " + w + " `" + T + "` of type " + ("`" + O + "` supplied to `" + E + "`, expected a single ReactElement."));
1053
- }
1054
- return null;
1055
- }
1056
- return b(s);
1057
- }
1058
- function m() {
1059
- function s(d, x, E, w, T) {
1060
- var _ = d[x];
1061
- if (!t.isValidElementType(_)) {
1062
- var O = G(_);
1063
- return new g("Invalid " + w + " `" + T + "` of type " + ("`" + O + "` supplied to `" + E + "`, expected a single ReactElement type."));
1064
- }
1065
- return null;
1066
- }
1067
- return b(s);
1068
- }
1069
- function L(s) {
1070
- function d(x, E, w, T, _) {
1071
- if (!(x[E] instanceof s)) {
1072
- var O = s.name || y, C = ue(x[E]);
1073
- return new g("Invalid " + T + " `" + _ + "` of type " + ("`" + C + "` supplied to `" + w + "`, expected ") + ("instance of `" + O + "`."));
1074
- }
1075
- return null;
1076
- }
1077
- return b(d);
1078
- }
1079
- function Y(s) {
1080
- if (!Array.isArray(s))
1081
- return process.env.NODE_ENV !== "production" && (arguments.length > 1 ? i(
1082
- "Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."
1083
- ) : i("Invalid argument supplied to oneOf, expected an array.")), a;
1084
- function d(x, E, w, T, _) {
1085
- for (var O = x[E], C = 0; C < s.length; C++)
1086
- if (A(O, s[C]))
1087
- return null;
1088
- var M = JSON.stringify(s, function(W, v) {
1089
- var X = H(v);
1090
- return X === "symbol" ? String(v) : v;
1091
- });
1092
- return new g("Invalid " + T + " `" + _ + "` of value `" + String(O) + "` " + ("supplied to `" + w + "`, expected one of " + M + "."));
1093
- }
1094
- return b(d);
1095
- }
1096
- function se(s) {
1097
- function d(x, E, w, T, _) {
1098
- if (typeof s != "function")
1099
- return new g("Property `" + _ + "` of component `" + w + "` has invalid PropType notation inside objectOf.");
1100
- var O = x[E], C = G(O);
1101
- if (C !== "object")
1102
- return new g("Invalid " + T + " `" + _ + "` of type " + ("`" + C + "` supplied to `" + w + "`, expected an object."));
1103
- for (var M in O)
1104
- if (n(O, M)) {
1105
- var N = s(O, M, w, T, _ + "." + M, r);
1106
- if (N instanceof Error)
1107
- return N;
1108
- }
1109
- return null;
1110
- }
1111
- return b(d);
1112
- }
1113
- function me(s) {
1114
- if (!Array.isArray(s))
1115
- return process.env.NODE_ENV !== "production" && i("Invalid argument supplied to oneOfType, expected an instance of array."), a;
1116
- for (var d = 0; d < s.length; d++) {
1117
- var x = s[d];
1118
- if (typeof x != "function")
1119
- return i(
1120
- "Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + oe(x) + " at index " + d + "."
1121
- ), a;
1122
- }
1123
- function E(w, T, _, O, C) {
1124
- for (var M = [], N = 0; N < s.length; N++) {
1125
- var W = s[N], v = W(w, T, _, O, C, r);
1126
- if (v == null)
1127
- return null;
1128
- v.data && n(v.data, "expectedType") && M.push(v.data.expectedType);
1129
- }
1130
- var X = M.length > 0 ? ", expected one of type [" + M.join(", ") + "]" : "";
1131
- return new g("Invalid " + O + " `" + C + "` supplied to " + ("`" + _ + "`" + X + "."));
1132
- }
1133
- return b(E);
1134
- }
1135
- function he() {
1136
- function s(d, x, E, w, T) {
1137
- return V(d[x]) ? null : new g("Invalid " + w + " `" + T + "` supplied to " + ("`" + E + "`, expected a ReactNode."));
1138
- }
1139
- return b(s);
1140
- }
1141
- function te(s, d, x, E, w) {
1142
- return new g(
1143
- (s || "React class") + ": " + d + " type `" + x + "." + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + w + "`."
1144
- );
1145
- }
1146
- function le(s) {
1147
- function d(x, E, w, T, _) {
1148
- var O = x[E], C = G(O);
1149
- if (C !== "object")
1150
- return new g("Invalid " + T + " `" + _ + "` of type `" + C + "` " + ("supplied to `" + w + "`, expected `object`."));
1151
- for (var M in s) {
1152
- var N = s[M];
1153
- if (typeof N != "function")
1154
- return te(w, T, _, M, H(N));
1155
- var W = N(O, M, w, T, _ + "." + M, r);
1156
- if (W)
1157
- return W;
1158
- }
1159
- return null;
1160
- }
1161
- return b(d);
1162
- }
1163
- function ye(s) {
1164
- function d(x, E, w, T, _) {
1165
- var O = x[E], C = G(O);
1166
- if (C !== "object")
1167
- return new g("Invalid " + T + " `" + _ + "` of type `" + C + "` " + ("supplied to `" + w + "`, expected `object`."));
1168
- var M = e({}, x[E], s);
1169
- for (var N in M) {
1170
- var W = s[N];
1171
- if (n(s, N) && typeof W != "function")
1172
- return te(w, T, _, N, H(W));
1173
- if (!W)
1174
- return new g(
1175
- "Invalid " + T + " `" + _ + "` key `" + N + "` supplied to `" + w + "`.\nBad object: " + JSON.stringify(x[E], null, " ") + `
1176
- Valid keys: ` + JSON.stringify(Object.keys(s), null, " ")
1177
- );
1178
- var v = W(O, N, w, T, _ + "." + N, r);
1179
- if (v)
1180
- return v;
1181
- }
1182
- return null;
1183
- }
1184
- return b(d);
1185
- }
1186
- function V(s) {
1187
- switch (typeof s) {
1188
- case "number":
1189
- case "string":
1190
- case "undefined":
1191
- return !0;
1192
- case "boolean":
1193
- return !s;
1194
- case "object":
1195
- if (Array.isArray(s))
1196
- return s.every(V);
1197
- if (s === null || l(s))
1198
- return !0;
1199
- var d = h(s);
1200
- if (d) {
1201
- var x = d.call(s), E;
1202
- if (d !== s.entries) {
1203
- for (; !(E = x.next()).done; )
1204
- if (!V(E.value))
1205
- return !1;
1206
- } else
1207
- for (; !(E = x.next()).done; ) {
1208
- var w = E.value;
1209
- if (w && !V(w[1]))
1210
- return !1;
1211
- }
1212
- } else
1213
- return !1;
1214
- return !0;
1215
- default:
1216
- return !1;
1217
- }
1218
- }
1219
- function ce(s, d) {
1220
- return s === "symbol" ? !0 : d ? d["@@toStringTag"] === "Symbol" || typeof Symbol == "function" && d instanceof Symbol : !1;
1221
- }
1222
- function G(s) {
1223
- var d = typeof s;
1224
- return Array.isArray(s) ? "array" : s instanceof RegExp ? "object" : ce(d, s) ? "symbol" : d;
1225
- }
1226
- function H(s) {
1227
- if (typeof s > "u" || s === null)
1228
- return "" + s;
1229
- var d = G(s);
1230
- if (d === "object") {
1231
- if (s instanceof Date)
1232
- return "date";
1233
- if (s instanceof RegExp)
1234
- return "regexp";
1235
- }
1236
- return d;
1237
- }
1238
- function oe(s) {
1239
- var d = H(s);
1240
- switch (d) {
1241
- case "array":
1242
- case "object":
1243
- return "an " + d;
1244
- case "boolean":
1245
- case "date":
1246
- case "regexp":
1247
- return "a " + d;
1248
- default:
1249
- return d;
1250
- }
1251
- }
1252
- function ue(s) {
1253
- return !s.constructor || !s.constructor.name ? y : s.constructor.name;
1254
- }
1255
- return R.checkPropTypes = o, R.resetWarningCache = o.resetWarningCache, R.PropTypes = R, R;
1256
- }, We;
1257
- }
1258
- var Ge, Tt;
1259
- function Vr() {
1260
- if (Tt) return Ge;
1261
- Tt = 1;
1262
- var t = /* @__PURE__ */ nt();
1263
- function e() {
1264
- }
1265
- function r() {
1266
- }
1267
- return r.resetWarningCache = e, Ge = function() {
1268
- function n(a, l, u, f, p, h) {
1269
- if (h !== t) {
1270
- var y = new Error(
1271
- "Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
1272
- );
1273
- throw y.name = "Invariant Violation", y;
1274
- }
1275
- }
1276
- n.isRequired = n;
1277
- function o() {
1278
- return n;
1279
- }
1280
- var i = {
1281
- array: n,
1282
- bigint: n,
1283
- bool: n,
1284
- func: n,
1285
- number: n,
1286
- object: n,
1287
- string: n,
1288
- symbol: n,
1289
- any: n,
1290
- arrayOf: o,
1291
- element: n,
1292
- elementType: n,
1293
- instanceOf: o,
1294
- node: n,
1295
- objectOf: o,
1296
- oneOf: o,
1297
- oneOfType: o,
1298
- shape: o,
1299
- exact: o,
1300
- checkPropTypes: r,
1301
- resetWarningCache: e
1302
- };
1303
- return i.PropTypes = i, i;
1304
- }, Ge;
1305
- }
1306
- var Rt;
1307
- function Hr() {
1308
- if (Rt) return Se.exports;
1309
- if (Rt = 1, process.env.NODE_ENV !== "production") {
1310
- var t = Ft(), e = !0;
1311
- Se.exports = /* @__PURE__ */ qr()(t.isElement, e);
1312
- } else
1313
- Se.exports = /* @__PURE__ */ Vr()();
1314
- return Se.exports;
1315
- }
1316
- var Xr = /* @__PURE__ */ Hr();
1317
- const k = /* @__PURE__ */ rt(Xr), _t = {
1318
- disabled: !1
1319
- };
1320
- var Jr = process.env.NODE_ENV !== "production" ? k.oneOfType([k.number, k.shape({
1321
- enter: k.number,
1322
- exit: k.number,
1323
- appear: k.number
1324
- }).isRequired]) : null;
1325
- process.env.NODE_ENV !== "production" && k.oneOfType([k.string, k.shape({
1326
- enter: k.string,
1327
- exit: k.string,
1328
- active: k.string
1329
- }), k.shape({
1330
- enter: k.string,
1331
- enterDone: k.string,
1332
- enterActive: k.string,
1333
- exit: k.string,
1334
- exitDone: k.string,
1335
- exitActive: k.string
1336
- })]);
1337
- const Wt = K.createContext(null);
1338
- var Kr = function(e) {
1339
- return e.scrollTop;
1340
- }, be = "unmounted", ie = "exited", re = "entering", ae = "entered", Ke = "exiting", ee = /* @__PURE__ */ (function(t) {
1341
- Mr(e, t);
1342
- function e(n, o) {
1343
- var i;
1344
- i = t.call(this, n, o) || this;
1345
- var a = o, l = a && !a.isMounting ? n.enter : n.appear, u;
1346
- return i.appearStatus = null, n.in ? l ? (u = ie, i.appearStatus = re) : u = ae : n.unmountOnExit || n.mountOnEnter ? u = be : u = ie, i.state = {
1347
- status: u
1348
- }, i.nextCallback = null, i;
1349
- }
1350
- e.getDerivedStateFromProps = function(o, i) {
1351
- var a = o.in;
1352
- return a && i.status === be ? {
1353
- status: ie
1354
- } : null;
1355
- };
1356
- var r = e.prototype;
1357
- return r.componentDidMount = function() {
1358
- this.updateStatus(!0, this.appearStatus);
1359
- }, r.componentDidUpdate = function(o) {
1360
- var i = null;
1361
- if (o !== this.props) {
1362
- var a = this.state.status;
1363
- this.props.in ? a !== re && a !== ae && (i = re) : (a === re || a === ae) && (i = Ke);
1364
- }
1365
- this.updateStatus(!1, i);
1366
- }, r.componentWillUnmount = function() {
1367
- this.cancelNextCallback();
1368
- }, r.getTimeouts = function() {
1369
- var o = this.props.timeout, i, a, l;
1370
- return i = a = l = o, o != null && typeof o != "number" && (i = o.exit, a = o.enter, l = o.appear !== void 0 ? o.appear : a), {
1371
- exit: i,
1372
- enter: a,
1373
- appear: l
1374
- };
1375
- }, r.updateStatus = function(o, i) {
1376
- if (o === void 0 && (o = !1), i !== null)
1377
- if (this.cancelNextCallback(), i === re) {
1378
- if (this.props.unmountOnExit || this.props.mountOnEnter) {
1379
- var a = this.props.nodeRef ? this.props.nodeRef.current : xe.findDOMNode(this);
1380
- a && Kr(a);
1381
- }
1382
- this.performEnter(o);
1383
- } else
1384
- this.performExit();
1385
- else this.props.unmountOnExit && this.state.status === ie && this.setState({
1386
- status: be
1387
- });
1388
- }, r.performEnter = function(o) {
1389
- var i = this, a = this.props.enter, l = this.context ? this.context.isMounting : o, u = this.props.nodeRef ? [l] : [xe.findDOMNode(this), l], f = u[0], p = u[1], h = this.getTimeouts(), y = l ? h.appear : h.enter;
1390
- if (!o && !a || _t.disabled) {
1391
- this.safeSetState({
1392
- status: ae
1393
- }, function() {
1394
- i.props.onEntered(f);
1395
- });
1396
- return;
1397
- }
1398
- this.props.onEnter(f, p), this.safeSetState({
1399
- status: re
1400
- }, function() {
1401
- i.props.onEntering(f, p), i.onTransitionEnd(y, function() {
1402
- i.safeSetState({
1403
- status: ae
1404
- }, function() {
1405
- i.props.onEntered(f, p);
1406
- });
1407
- });
1408
- });
1409
- }, r.performExit = function() {
1410
- var o = this, i = this.props.exit, a = this.getTimeouts(), l = this.props.nodeRef ? void 0 : xe.findDOMNode(this);
1411
- if (!i || _t.disabled) {
1412
- this.safeSetState({
1413
- status: ie
1414
- }, function() {
1415
- o.props.onExited(l);
1416
- });
1417
- return;
1418
- }
1419
- this.props.onExit(l), this.safeSetState({
1420
- status: Ke
1421
- }, function() {
1422
- o.props.onExiting(l), o.onTransitionEnd(a.exit, function() {
1423
- o.safeSetState({
1424
- status: ie
1425
- }, function() {
1426
- o.props.onExited(l);
1427
- });
1428
- });
1429
- });
1430
- }, r.cancelNextCallback = function() {
1431
- this.nextCallback !== null && (this.nextCallback.cancel(), this.nextCallback = null);
1432
- }, r.safeSetState = function(o, i) {
1433
- i = this.setNextCallback(i), this.setState(o, i);
1434
- }, r.setNextCallback = function(o) {
1435
- var i = this, a = !0;
1436
- return this.nextCallback = function(l) {
1437
- a && (a = !1, i.nextCallback = null, o(l));
1438
- }, this.nextCallback.cancel = function() {
1439
- a = !1;
1440
- }, this.nextCallback;
1441
- }, r.onTransitionEnd = function(o, i) {
1442
- this.setNextCallback(i);
1443
- var a = this.props.nodeRef ? this.props.nodeRef.current : xe.findDOMNode(this), l = o == null && !this.props.addEndListener;
1444
- if (!a || l) {
1445
- setTimeout(this.nextCallback, 0);
1446
- return;
1447
- }
1448
- if (this.props.addEndListener) {
1449
- var u = this.props.nodeRef ? [this.nextCallback] : [a, this.nextCallback], f = u[0], p = u[1];
1450
- this.props.addEndListener(f, p);
1451
- }
1452
- o != null && setTimeout(this.nextCallback, o);
1453
- }, r.render = function() {
1454
- var o = this.state.status;
1455
- if (o === be)
1456
- return null;
1457
- var i = this.props, a = i.children;
1458
- i.in, i.mountOnEnter, i.unmountOnExit, i.appear, i.enter, i.exit, i.timeout, i.addEndListener, i.onEnter, i.onEntering, i.onEntered, i.onExit, i.onExiting, i.onExited, i.nodeRef;
1459
- var l = Bt(i, ["children", "in", "mountOnEnter", "unmountOnExit", "appear", "enter", "exit", "timeout", "addEndListener", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "nodeRef"]);
1460
- return (
1461
- // allows for nested Transitions
1462
- /* @__PURE__ */ K.createElement(Wt.Provider, {
1463
- value: null
1464
- }, typeof a == "function" ? a(o, l) : K.cloneElement(K.Children.only(a), l))
1465
- );
1466
- }, e;
1467
- })(K.Component);
1468
- ee.contextType = Wt;
1469
- ee.propTypes = process.env.NODE_ENV !== "production" ? {
1470
- /**
1471
- * A React reference to DOM element that need to transition:
1472
- * https://stackoverflow.com/a/51127130/4671932
1473
- *
1474
- * - When `nodeRef` prop is used, `node` is not passed to callback functions
1475
- * (e.g. `onEnter`) because user already has direct access to the node.
1476
- * - When changing `key` prop of `Transition` in a `TransitionGroup` a new
1477
- * `nodeRef` need to be provided to `Transition` with changed `key` prop
1478
- * (see
1479
- * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).
1480
- */
1481
- nodeRef: k.shape({
1482
- current: typeof Element > "u" ? k.any : function(t, e, r, n, o, i) {
1483
- var a = t[e];
1484
- return k.instanceOf(a && "ownerDocument" in a ? a.ownerDocument.defaultView.Element : Element)(t, e, r, n, o, i);
1485
- }
1486
- }),
1487
- /**
1488
- * A `function` child can be used instead of a React element. This function is
1489
- * called with the current transition status (`'entering'`, `'entered'`,
1490
- * `'exiting'`, `'exited'`), which can be used to apply context
1491
- * specific props to a component.
1492
- *
1493
- * ```jsx
1494
- * <Transition in={this.state.in} timeout={150}>
1495
- * {state => (
1496
- * <MyComponent className={`fade fade-${state}`} />
1497
- * )}
1498
- * </Transition>
1499
- * ```
1500
- */
1501
- children: k.oneOfType([k.func.isRequired, k.element.isRequired]).isRequired,
1502
- /**
1503
- * Show the component; triggers the enter or exit states
1504
- */
1505
- in: k.bool,
1506
- /**
1507
- * By default the child component is mounted immediately along with
1508
- * the parent `Transition` component. If you want to "lazy mount" the component on the
1509
- * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay
1510
- * mounted, even on "exited", unless you also specify `unmountOnExit`.
1511
- */
1512
- mountOnEnter: k.bool,
1513
- /**
1514
- * By default the child component stays mounted after it reaches the `'exited'` state.
1515
- * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.
1516
- */
1517
- unmountOnExit: k.bool,
1518
- /**
1519
- * By default the child component does not perform the enter transition when
1520
- * it first mounts, regardless of the value of `in`. If you want this
1521
- * behavior, set both `appear` and `in` to `true`.
1522
- *
1523
- * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop
1524
- * > only adds an additional enter transition. However, in the
1525
- * > `<CSSTransition>` component that first enter transition does result in
1526
- * > additional `.appear-*` classes, that way you can choose to style it
1527
- * > differently.
1528
- */
1529
- appear: k.bool,
1530
- /**
1531
- * Enable or disable enter transitions.
1532
- */
1533
- enter: k.bool,
1534
- /**
1535
- * Enable or disable exit transitions.
1536
- */
1537
- exit: k.bool,
1538
- /**
1539
- * The duration of the transition, in milliseconds.
1540
- * Required unless `addEndListener` is provided.
1541
- *
1542
- * You may specify a single timeout for all transitions:
1543
- *
1544
- * ```jsx
1545
- * timeout={500}
1546
- * ```
1547
- *
1548
- * or individually:
1549
- *
1550
- * ```jsx
1551
- * timeout={{
1552
- * appear: 500,
1553
- * enter: 300,
1554
- * exit: 500,
1555
- * }}
1556
- * ```
1557
- *
1558
- * - `appear` defaults to the value of `enter`
1559
- * - `enter` defaults to `0`
1560
- * - `exit` defaults to `0`
1561
- *
1562
- * @type {number | { enter?: number, exit?: number, appear?: number }}
1563
- */
1564
- timeout: function(e) {
1565
- var r = Jr;
1566
- e.addEndListener || (r = r.isRequired);
1567
- for (var n = arguments.length, o = new Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)
1568
- o[i - 1] = arguments[i];
1569
- return r.apply(void 0, [e].concat(o));
1570
- },
1571
- /**
1572
- * Add a custom transition end trigger. Called with the transitioning
1573
- * DOM node and a `done` callback. Allows for more fine grained transition end
1574
- * logic. Timeouts are still used as a fallback if provided.
1575
- *
1576
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1577
- *
1578
- * ```jsx
1579
- * addEndListener={(node, done) => {
1580
- * // use the css transitionend event to mark the finish of a transition
1581
- * node.addEventListener('transitionend', done, false);
1582
- * }}
1583
- * ```
1584
- */
1585
- addEndListener: k.func,
1586
- /**
1587
- * Callback fired before the "entering" status is applied. An extra parameter
1588
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1589
- *
1590
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1591
- *
1592
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
1593
- */
1594
- onEnter: k.func,
1595
- /**
1596
- * Callback fired after the "entering" status is applied. An extra parameter
1597
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1598
- *
1599
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1600
- *
1601
- * @type Function(node: HtmlElement, isAppearing: bool)
1602
- */
1603
- onEntering: k.func,
1604
- /**
1605
- * Callback fired after the "entered" status is applied. An extra parameter
1606
- * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount
1607
- *
1608
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1609
- *
1610
- * @type Function(node: HtmlElement, isAppearing: bool) -> void
1611
- */
1612
- onEntered: k.func,
1613
- /**
1614
- * Callback fired before the "exiting" status is applied.
1615
- *
1616
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1617
- *
1618
- * @type Function(node: HtmlElement) -> void
1619
- */
1620
- onExit: k.func,
1621
- /**
1622
- * Callback fired after the "exiting" status is applied.
1623
- *
1624
- * **Note**: when `nodeRef` prop is passed, `node` is not passed.
1625
- *
1626
- * @type Function(node: HtmlElement) -> void
1627
- */
1628
- onExiting: k.func,
1629
- /**
1630
- * Callback fired after the "exited" status is applied.
1631
- *
1632
- * **Note**: when `nodeRef` prop is passed, `node` is not passed
1633
- *
1634
- * @type Function(node: HtmlElement) -> void
1635
- */
1636
- onExited: k.func
1637
- } : {};
1638
- function fe() {
1639
- }
1640
- ee.defaultProps = {
1641
- in: !1,
1642
- mountOnEnter: !1,
1643
- unmountOnExit: !1,
1644
- appear: !1,
1645
- enter: !0,
1646
- exit: !0,
1647
- onEnter: fe,
1648
- onEntering: fe,
1649
- onEntered: fe,
1650
- onExit: fe,
1651
- onExiting: fe,
1652
- onExited: fe
1653
- };
1654
- ee.UNMOUNTED = be;
1655
- ee.EXITED = ie;
1656
- ee.ENTERING = re;
1657
- ee.ENTERED = ae;
1658
- ee.EXITING = Ke;
1659
- function Zr() {
1660
- const t = S.version.split(".");
1661
- return {
1662
- major: +t[0],
1663
- minor: +t[1],
1664
- patch: +t[2]
1665
- };
1666
- }
1667
- function Qr(t) {
1668
- if (!t || typeof t == "function")
1669
- return null;
1670
- const {
1671
- major: e
1672
- } = Zr();
1673
- return e >= 19 ? t.props.ref : t.ref;
1674
- }
1675
- const en = !!(typeof window < "u" && window.document && window.document.createElement);
1676
- var Ze = !1, Qe = !1;
1677
- try {
1678
- var Ye = {
1679
- get passive() {
1680
- return Ze = !0;
1681
- },
1682
- get once() {
1683
- return Qe = Ze = !0;
1684
- }
1685
- };
1686
- en && (window.addEventListener("test", Ye, Ye), window.removeEventListener("test", Ye, !0));
1687
- } catch {
1688
- }
1689
- function tn(t, e, r, n) {
1690
- if (n && typeof n != "boolean" && !Qe) {
1691
- var o = n.once, i = n.capture, a = r;
1692
- !Qe && o && (a = r.__once || function l(u) {
1693
- this.removeEventListener(e, l, i), r.call(this, u);
1694
- }, r.__once = a), t.addEventListener(e, a, Ze ? n : i);
1695
- }
1696
- t.addEventListener(e, r, n);
1697
- }
1698
- function rn(t, e, r, n) {
1699
- var o = n && typeof n != "boolean" ? n.capture : n;
1700
- t.removeEventListener(e, r, o), r.__once && t.removeEventListener(e, r.__once, o);
1701
- }
1702
- function Gt(t, e, r, n) {
1703
- return tn(t, e, r, n), function() {
1704
- rn(t, e, r, n);
1705
- };
1706
- }
1707
- function nn(t, e, r, n) {
1708
- if (n === void 0 && (n = !0), t) {
1709
- var o = document.createEvent("HTMLEvents");
1710
- o.initEvent(e, r, n), t.dispatchEvent(o);
1711
- }
1712
- }
1713
- function on(t) {
1714
- var e = Dt(t, "transitionDuration") || "", r = e.indexOf("ms") === -1 ? 1e3 : 1;
1715
- return parseFloat(e) * r;
1716
- }
1717
- function an(t, e, r) {
1718
- r === void 0 && (r = 5);
1719
- var n = !1, o = setTimeout(function() {
1720
- n || nn(t, "transitionend", !0);
1721
- }, e + r), i = Gt(t, "transitionend", function() {
1722
- n = !0;
1723
- }, {
1724
- once: !0
1725
- });
1726
- return function() {
1727
- clearTimeout(o), i();
1728
- };
1729
- }
1730
- function sn(t, e, r, n) {
1731
- r == null && (r = on(t) || 0);
1732
- var o = an(t, r, n), i = Gt(t, "transitionend", e);
1733
- return function() {
1734
- o(), i();
1735
- };
1736
- }
1737
- function jt(t, e) {
1738
- const r = Dt(t, e) || "", n = r.indexOf("ms") === -1 ? 1e3 : 1;
1739
- return parseFloat(r) * n;
1740
- }
1741
- function ln(t, e) {
1742
- const r = jt(t, "transitionDuration"), n = jt(t, "transitionDelay"), o = sn(t, (i) => {
1743
- i.target === t && (o(), e(i));
1744
- }, r + n);
1745
- }
1746
- function cn(t) {
1747
- t.offsetHeight;
1748
- }
1749
- const Ot = (t) => !t || typeof t == "function" ? t : (e) => {
1750
- t.current = e;
1751
- };
1752
- function un(t, e) {
1753
- const r = Ot(t), n = Ot(e);
1754
- return (o) => {
1755
- r && r(o), n && n(o);
1756
- };
1757
- }
1758
- function fn(t, e) {
1759
- return Ne(() => un(t, e), [t, e]);
1760
- }
1761
- function dn(t) {
1762
- return t && "setState" in t ? xe.findDOMNode(t) : t ?? null;
1763
- }
1764
- const Yt = /* @__PURE__ */ K.forwardRef(({
1765
- onEnter: t,
1766
- onEntering: e,
1767
- onEntered: r,
1768
- onExit: n,
1769
- onExiting: o,
1770
- onExited: i,
1771
- addEndListener: a,
1772
- children: l,
1773
- childRef: u,
1774
- ...f
1775
- }, p) => {
1776
- const h = Me(null), y = fn(h, u), R = (L) => {
1777
- y(dn(L));
1778
- }, A = (L) => (Y) => {
1779
- L && h.current && L(h.current, Y);
1780
- }, g = q(A(t), [t]), b = q(A(e), [e]), P = q(A(r), [r]), F = q(A(n), [n]), j = q(A(o), [o]), D = q(A(i), [i]), m = q(A(a), [a]);
1781
- return /* @__PURE__ */ c.jsx(ee, {
1782
- ref: p,
1783
- ...f,
1784
- onEnter: g,
1785
- onEntered: P,
1786
- onEntering: b,
1787
- onExit: F,
1788
- onExited: D,
1789
- onExiting: j,
1790
- addEndListener: m,
1791
- nodeRef: h,
1792
- children: typeof l == "function" ? (L, Y) => (
1793
- // TODO: Types for RTG missing innerProps, so need to cast.
1794
- l(L, {
1795
- ...Y,
1796
- ref: R
1797
- })
1798
- ) : /* @__PURE__ */ K.cloneElement(l, {
1799
- ref: R
1800
- })
1801
- });
1802
- });
1803
- Yt.displayName = "TransitionWrapper";
1804
- function pn(t) {
1805
- const e = Me(t);
1806
- return Pt(() => {
1807
- e.current = t;
1808
- }, [t]), e;
1809
- }
1810
- function mn(t) {
1811
- const e = pn(t);
1812
- return q(function(...r) {
1813
- return e.current && e.current(...r);
1814
- }, [e]);
1815
- }
1816
- const ot = ((t) => (
1817
- // eslint-disable-next-line react/display-name
1818
- /* @__PURE__ */ S.forwardRef((e, r) => /* @__PURE__ */ c.jsx("div", {
1819
- ...e,
1820
- ref: r,
1821
- className: z(e.className, t)
1822
- }))
1823
- )), Ut = ot("h4");
1824
- Ut.displayName = "DivStyledAsH4";
1825
- const qt = /* @__PURE__ */ S.forwardRef(({
1826
- className: t,
1827
- bsPrefix: e,
1828
- as: r = Ut,
1829
- ...n
1830
- }, o) => (e = I(e, "alert-heading"), /* @__PURE__ */ c.jsx(r, {
1831
- ref: o,
1832
- className: z(t, e),
1833
- ...n
1834
- })));
1835
- qt.displayName = "AlertHeading";
1836
- function hn(t) {
1837
- const e = Me(t);
1838
- return Pt(() => {
1839
- e.current = t;
1840
- }, [t]), e;
1841
- }
1842
- function yn(t) {
1843
- const e = hn(t);
1844
- return q(function(...r) {
1845
- return e.current && e.current(...r);
1846
- }, [e]);
1847
- }
1848
- const vn = ["as", "disabled"];
1849
- function gn(t, e) {
1850
- if (t == null) return {};
1851
- var r = {};
1852
- for (var n in t) if ({}.hasOwnProperty.call(t, n)) {
1853
- if (e.indexOf(n) >= 0) continue;
1854
- r[n] = t[n];
1855
- }
1856
- return r;
1857
- }
1858
- function xn(t) {
1859
- return !t || t.trim() === "#";
1860
- }
1861
- function it({
1862
- tagName: t,
1863
- disabled: e,
1864
- href: r,
1865
- target: n,
1866
- rel: o,
1867
- role: i,
1868
- onClick: a,
1869
- tabIndex: l = 0,
1870
- type: u
1871
- }) {
1872
- t || (r != null || n != null || o != null ? t = "a" : t = "button");
1873
- const f = {
1874
- tagName: t
1875
- };
1876
- if (t === "button")
1877
- return [{
1878
- type: u || "button",
1879
- disabled: e
1880
- }, f];
1881
- const p = (y) => {
1882
- if ((e || t === "a" && xn(r)) && y.preventDefault(), e) {
1883
- y.stopPropagation();
1884
- return;
1885
- }
1886
- a?.(y);
1887
- }, h = (y) => {
1888
- y.key === " " && (y.preventDefault(), p(y));
1889
- };
1890
- return t === "a" && (r || (r = "#"), e && (r = void 0)), [{
1891
- role: i ?? "button",
1892
- // explicitly undefined so that it overrides the props disabled in a spread
1893
- // e.g. <Tag {...props} {...hookProps} />
1894
- disabled: void 0,
1895
- tabIndex: e ? void 0 : l,
1896
- href: r,
1897
- target: t === "a" ? n : void 0,
1898
- "aria-disabled": e || void 0,
1899
- rel: t === "a" ? o : void 0,
1900
- onClick: p,
1901
- onKeyDown: h
1902
- }, f];
1903
- }
1904
- const bn = /* @__PURE__ */ S.forwardRef((t, e) => {
1905
- let {
1906
- as: r,
1907
- disabled: n
1908
- } = t, o = gn(t, vn);
1909
- const [i, {
1910
- tagName: a
1911
- }] = it(Object.assign({
1912
- tagName: r,
1913
- disabled: n
1914
- }, o));
1915
- return /* @__PURE__ */ c.jsx(a, Object.assign({}, o, i, {
1916
- ref: e
1917
- }));
1918
- });
1919
- bn.displayName = "Button";
1920
- const En = ["onKeyDown"];
1921
- function wn(t, e) {
1922
- if (t == null) return {};
1923
- var r = {};
1924
- for (var n in t) if ({}.hasOwnProperty.call(t, n)) {
1925
- if (e.indexOf(n) >= 0) continue;
1926
- r[n] = t[n];
1927
- }
1928
- return r;
1929
- }
1930
- function Cn(t) {
1931
- return !t || t.trim() === "#";
1932
- }
1933
- const Vt = /* @__PURE__ */ S.forwardRef((t, e) => {
1934
- let {
1935
- onKeyDown: r
1936
- } = t, n = wn(t, En);
1937
- const [o] = it(Object.assign({
1938
- tagName: "a"
1939
- }, n)), i = yn((a) => {
1940
- o.onKeyDown(a), r?.(a);
1941
- });
1942
- return Cn(n.href) || n.role === "button" ? /* @__PURE__ */ c.jsx("a", Object.assign({
1943
- ref: e
1944
- }, n, o, {
1945
- onKeyDown: i
1946
- })) : /* @__PURE__ */ c.jsx("a", Object.assign({
1947
- ref: e
1948
- }, n, {
1949
- onKeyDown: r
1950
- }));
1951
- });
1952
- Vt.displayName = "Anchor";
1953
- const Ht = /* @__PURE__ */ S.forwardRef(({
1954
- className: t,
1955
- bsPrefix: e,
1956
- as: r = Vt,
1957
- ...n
1958
- }, o) => (e = I(e, "alert-link"), /* @__PURE__ */ c.jsx(r, {
1959
- ref: o,
1960
- className: z(t, e),
1961
- ...n
1962
- })));
1963
- Ht.displayName = "AlertLink";
1964
- const kn = {
1965
- [re]: "show",
1966
- [ae]: "show"
1967
- }, et = /* @__PURE__ */ S.forwardRef(({
1968
- className: t,
1969
- children: e,
1970
- transitionClasses: r = {},
1971
- onEnter: n,
1972
- ...o
1973
- }, i) => {
1974
- const a = {
1975
- in: !1,
1976
- timeout: 300,
1977
- mountOnEnter: !1,
1978
- unmountOnExit: !1,
1979
- appear: !1,
1980
- ...o
1981
- }, l = q((u, f) => {
1982
- cn(u), n?.(u, f);
1983
- }, [n]);
1984
- return /* @__PURE__ */ c.jsx(Yt, {
1985
- ref: i,
1986
- addEndListener: ln,
1987
- ...a,
1988
- onEnter: l,
1989
- childRef: Qr(e),
1990
- children: (u, f) => /* @__PURE__ */ S.cloneElement(e, {
1991
- ...f,
1992
- className: z("fade", t, e.props.className, kn[u], r[u])
1993
- })
1994
- });
1995
- });
1996
- et.displayName = "Fade";
1997
- const Sn = {
1998
- /** An accessible label indicating the relevant information about the Close Button. */
1999
- "aria-label": k.string,
2000
- /** A callback fired after the Close Button is clicked. */
2001
- onClick: k.func,
2002
- /**
2003
- * Render different color variant for the button.
2004
- *
2005
- * Omitting this will render the default dark color.
2006
- */
2007
- variant: k.oneOf(["white"])
2008
- }, at = /* @__PURE__ */ S.forwardRef(({
2009
- className: t,
2010
- variant: e,
2011
- "aria-label": r = "Close",
2012
- ...n
2013
- }, o) => /* @__PURE__ */ c.jsx("button", {
2014
- ref: o,
2015
- type: "button",
2016
- className: z("btn-close", e && `btn-close-${e}`, t),
2017
- "aria-label": r,
2018
- ...n
2019
- }));
2020
- at.displayName = "CloseButton";
2021
- at.propTypes = Sn;
2022
- const Xt = /* @__PURE__ */ S.forwardRef((t, e) => {
2023
- const {
2024
- bsPrefix: r,
2025
- show: n = !0,
2026
- closeLabel: o = "Close alert",
2027
- closeVariant: i,
2028
- className: a,
2029
- children: l,
2030
- variant: u = "primary",
2031
- onClose: f,
2032
- dismissible: p,
2033
- transition: h = et,
2034
- ...y
2035
- } = Or(t, {
2036
- show: "onClose"
2037
- }), R = I(r, "alert"), A = mn((P) => {
2038
- f && f(!1, P);
2039
- }), g = h === !0 ? et : h, b = /* @__PURE__ */ c.jsxs("div", {
2040
- role: "alert",
2041
- ...g ? void 0 : y,
2042
- ref: e,
2043
- className: z(a, R, u && `${R}-${u}`, p && `${R}-dismissible`),
2044
- children: [p && /* @__PURE__ */ c.jsx(at, {
2045
- onClick: A,
2046
- "aria-label": o,
2047
- variant: i
2048
- }), l]
2049
- });
2050
- return g ? /* @__PURE__ */ c.jsx(g, {
2051
- unmountOnExit: !0,
2052
- ...y,
2053
- ref: void 0,
2054
- in: n,
2055
- children: b
2056
- }) : n ? b : null;
2057
- });
2058
- Xt.displayName = "Alert";
2059
- const Mt = Object.assign(Xt, {
2060
- Link: Ht,
2061
- Heading: qt
2062
- }), pe = /* @__PURE__ */ S.forwardRef(({
2063
- bsPrefix: t,
2064
- bg: e = "primary",
2065
- pill: r = !1,
2066
- text: n,
2067
- className: o,
2068
- as: i = "span",
2069
- ...a
2070
- }, l) => {
2071
- const u = I(t, "badge");
2072
- return /* @__PURE__ */ c.jsx(i, {
2073
- ref: l,
2074
- ...a,
2075
- className: z(o, u, r && "rounded-pill", n && `text-${n}`, e && `bg-${e}`)
2076
- });
2077
- });
2078
- pe.displayName = "Badge";
2079
- const J = /* @__PURE__ */ S.forwardRef(({
2080
- as: t,
2081
- bsPrefix: e,
2082
- variant: r = "primary",
2083
- size: n,
2084
- active: o = !1,
2085
- disabled: i = !1,
2086
- className: a,
2087
- ...l
2088
- }, u) => {
2089
- const f = I(e, "btn"), [p, {
2090
- tagName: h
2091
- }] = it({
2092
- tagName: t,
2093
- disabled: i,
2094
- ...l
2095
- }), y = h;
2096
- return /* @__PURE__ */ c.jsx(y, {
2097
- ...p,
2098
- ...l,
2099
- ref: u,
2100
- disabled: i,
2101
- className: z(a, f, o && "active", r && `${f}-${r}`, n && `${f}-${n}`, l.href && i && "disabled")
2102
- });
2103
- });
2104
- J.displayName = "Button";
2105
- const tt = /* @__PURE__ */ S.forwardRef(({
2106
- bsPrefix: t,
2107
- size: e,
2108
- vertical: r = !1,
2109
- className: n,
2110
- role: o = "group",
2111
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2112
- as: i = "div",
2113
- ...a
2114
- }, l) => {
2115
- const u = I(t, "btn-group");
2116
- let f = u;
2117
- return r && (f = `${u}-vertical`), /* @__PURE__ */ c.jsx(i, {
2118
- ...a,
2119
- ref: l,
2120
- role: o,
2121
- className: z(n, f, e && `${u}-${e}`)
2122
- });
2123
- });
2124
- tt.displayName = "ButtonGroup";
2125
- const st = /* @__PURE__ */ S.forwardRef(({
2126
- className: t,
2127
- bsPrefix: e,
2128
- as: r = "div",
2129
- ...n
2130
- }, o) => (e = I(e, "card-body"), /* @__PURE__ */ c.jsx(r, {
2131
- ref: o,
2132
- className: z(t, e),
2133
- ...n
2134
- })));
2135
- st.displayName = "CardBody";
2136
- const Jt = /* @__PURE__ */ S.forwardRef(({
2137
- className: t,
2138
- bsPrefix: e,
2139
- as: r = "div",
2140
- ...n
2141
- }, o) => (e = I(e, "card-footer"), /* @__PURE__ */ c.jsx(r, {
2142
- ref: o,
2143
- className: z(t, e),
2144
- ...n
2145
- })));
2146
- Jt.displayName = "CardFooter";
2147
- const Kt = /* @__PURE__ */ S.createContext(null);
2148
- Kt.displayName = "CardHeaderContext";
2149
- const Zt = /* @__PURE__ */ S.forwardRef(({
2150
- bsPrefix: t,
2151
- className: e,
2152
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2153
- as: r = "div",
2154
- ...n
2155
- }, o) => {
2156
- const i = I(t, "card-header"), a = Ne(() => ({
2157
- cardHeaderBsPrefix: i
2158
- }), [i]);
2159
- return /* @__PURE__ */ c.jsx(Kt.Provider, {
2160
- value: a,
2161
- children: /* @__PURE__ */ c.jsx(r, {
2162
- ref: o,
2163
- ...n,
2164
- className: z(e, i)
2165
- })
2166
- });
2167
- });
2168
- Zt.displayName = "CardHeader";
2169
- const Qt = /* @__PURE__ */ S.forwardRef(
2170
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2171
- ({
2172
- bsPrefix: t,
2173
- className: e,
2174
- variant: r,
2175
- as: n = "img",
2176
- ...o
2177
- }, i) => {
2178
- const a = I(t, "card-img");
2179
- return /* @__PURE__ */ c.jsx(n, {
2180
- ref: i,
2181
- className: z(r ? `${a}-${r}` : a, e),
2182
- ...o
2183
- });
2184
- }
2185
- );
2186
- Qt.displayName = "CardImg";
2187
- const er = /* @__PURE__ */ S.forwardRef(({
2188
- className: t,
2189
- bsPrefix: e,
2190
- as: r = "div",
2191
- ...n
2192
- }, o) => (e = I(e, "card-img-overlay"), /* @__PURE__ */ c.jsx(r, {
2193
- ref: o,
2194
- className: z(t, e),
2195
- ...n
2196
- })));
2197
- er.displayName = "CardImgOverlay";
2198
- const tr = /* @__PURE__ */ S.forwardRef(({
2199
- className: t,
2200
- bsPrefix: e,
2201
- as: r = "a",
2202
- ...n
2203
- }, o) => (e = I(e, "card-link"), /* @__PURE__ */ c.jsx(r, {
2204
- ref: o,
2205
- className: z(t, e),
2206
- ...n
2207
- })));
2208
- tr.displayName = "CardLink";
2209
- const Tn = ot("h6"), rr = /* @__PURE__ */ S.forwardRef(({
2210
- className: t,
2211
- bsPrefix: e,
2212
- as: r = Tn,
2213
- ...n
2214
- }, o) => (e = I(e, "card-subtitle"), /* @__PURE__ */ c.jsx(r, {
2215
- ref: o,
2216
- className: z(t, e),
2217
- ...n
2218
- })));
2219
- rr.displayName = "CardSubtitle";
2220
- const nr = /* @__PURE__ */ S.forwardRef(({
2221
- className: t,
2222
- bsPrefix: e,
2223
- as: r = "p",
2224
- ...n
2225
- }, o) => (e = I(e, "card-text"), /* @__PURE__ */ c.jsx(r, {
2226
- ref: o,
2227
- className: z(t, e),
2228
- ...n
2229
- })));
2230
- nr.displayName = "CardText";
2231
- const Rn = ot("h5"), or = /* @__PURE__ */ S.forwardRef(({
2232
- className: t,
2233
- bsPrefix: e,
2234
- as: r = Rn,
2235
- ...n
2236
- }, o) => (e = I(e, "card-title"), /* @__PURE__ */ c.jsx(r, {
2237
- ref: o,
2238
- className: z(t, e),
2239
- ...n
2240
- })));
2241
- or.displayName = "CardTitle";
2242
- const ir = /* @__PURE__ */ S.forwardRef(({
2243
- bsPrefix: t,
2244
- className: e,
2245
- bg: r,
2246
- text: n,
2247
- border: o,
2248
- body: i = !1,
2249
- children: a,
2250
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2251
- as: l = "div",
2252
- ...u
2253
- }, f) => {
2254
- const p = I(t, "card");
2255
- return /* @__PURE__ */ c.jsx(l, {
2256
- ref: f,
2257
- ...u,
2258
- className: z(e, p, r && `bg-${r}`, n && `text-${n}`, o && `border-${o}`),
2259
- children: i ? /* @__PURE__ */ c.jsx(st, {
2260
- children: a
2261
- }) : a
2262
- });
2263
- });
2264
- ir.displayName = "Card";
2265
- const Ee = Object.assign(ir, {
2266
- Img: Qt,
2267
- Title: or,
2268
- Subtitle: rr,
2269
- Body: st,
2270
- Link: tr,
2271
- Text: nr,
2272
- Header: Zt,
2273
- Footer: Jt,
2274
- ImgOverlay: er
2275
- });
2276
- function _n(t, e) {
2277
- return S.Children.toArray(t).some((r) => /* @__PURE__ */ S.isValidElement(r) && r.type === e);
2278
- }
2279
- function jn({
2280
- as: t,
2281
- bsPrefix: e,
2282
- className: r,
2283
- ...n
2284
- }) {
2285
- e = I(e, "col");
2286
- const o = $t(), i = It(), a = [], l = [];
2287
- return o.forEach((u) => {
2288
- const f = n[u];
2289
- delete n[u];
2290
- let p, h, y;
2291
- typeof f == "object" && f != null ? {
2292
- span: p,
2293
- offset: h,
2294
- order: y
2295
- } = f : p = f;
2296
- const R = u !== i ? `-${u}` : "";
2297
- p && a.push(p === !0 ? `${e}${R}` : `${e}${R}-${p}`), y != null && l.push(`order${R}-${y}`), h != null && l.push(`offset${R}-${h}`);
2298
- }), [{
2299
- ...n,
2300
- className: z(r, ...a, ...l)
2301
- }, {
2302
- as: t,
2303
- bsPrefix: e,
2304
- spans: a
2305
- }];
2306
- }
2307
- const ne = /* @__PURE__ */ S.forwardRef(
2308
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2309
- (t, e) => {
2310
- const [{
2311
- className: r,
2312
- ...n
2313
- }, {
2314
- as: o = "div",
2315
- bsPrefix: i,
2316
- spans: a
2317
- }] = jn(t);
2318
- return /* @__PURE__ */ c.jsx(o, {
2319
- ...n,
2320
- ref: e,
2321
- className: z(r, !a.length && i)
2322
- });
2323
- }
2324
- );
2325
- ne.displayName = "Col";
2326
- const ar = /* @__PURE__ */ S.forwardRef(({
2327
- bsPrefix: t,
2328
- fluid: e = !1,
2329
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2330
- as: r = "div",
2331
- className: n,
2332
- ...o
2333
- }, i) => {
2334
- const a = I(t, "container"), l = typeof e == "string" ? `-${e}` : "-fluid";
2335
- return /* @__PURE__ */ c.jsx(r, {
2336
- ref: i,
2337
- ...o,
2338
- className: z(n, e ? `${a}${l}` : a)
2339
- });
2340
- });
2341
- ar.displayName = "Container";
2342
- var Ue, Nt;
2343
- function On() {
2344
- if (Nt) return Ue;
2345
- Nt = 1;
2346
- var t = process.env.NODE_ENV !== "production", e = function() {
2347
- };
2348
- if (t) {
2349
- var r = function(o, i) {
2350
- var a = arguments.length;
2351
- i = new Array(a > 1 ? a - 1 : 0);
2352
- for (var l = 1; l < a; l++)
2353
- i[l - 1] = arguments[l];
2354
- var u = 0, f = "Warning: " + o.replace(/%s/g, function() {
2355
- return i[u++];
2356
- });
2357
- typeof console < "u" && console.error(f);
2358
- try {
2359
- throw new Error(f);
2360
- } catch {
2361
- }
2362
- };
2363
- e = function(n, o, i) {
2364
- var a = arguments.length;
2365
- i = new Array(a > 2 ? a - 2 : 0);
2366
- for (var l = 2; l < a; l++)
2367
- i[l - 2] = arguments[l];
2368
- if (o === void 0)
2369
- throw new Error(
2370
- "`warning(condition, format, ...args)` requires a warning message argument"
2371
- );
2372
- n || r.apply(null, [o].concat(i));
2373
- };
2374
- }
2375
- return Ue = e, Ue;
2376
- }
2377
- var Mn = On();
2378
- const sr = /* @__PURE__ */ rt(Mn), Nn = {
2379
- /**
2380
- * Specify whether the feedback is for valid or invalid fields
2381
- *
2382
- * @type {('valid'|'invalid')}
2383
- */
2384
- type: k.string,
2385
- /** Display feedback as a tooltip. */
2386
- tooltip: k.bool,
2387
- as: k.elementType
2388
- }, Ae = /* @__PURE__ */ S.forwardRef(
2389
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2390
- ({
2391
- as: t = "div",
2392
- className: e,
2393
- type: r = "valid",
2394
- tooltip: n = !1,
2395
- ...o
2396
- }, i) => /* @__PURE__ */ c.jsx(t, {
2397
- ...o,
2398
- ref: i,
2399
- className: z(e, `${r}-${n ? "tooltip" : "feedback"}`)
2400
- })
2401
- );
2402
- Ae.displayName = "Feedback";
2403
- Ae.propTypes = Nn;
2404
- const Q = /* @__PURE__ */ S.createContext({}), lt = /* @__PURE__ */ S.forwardRef(({
2405
- id: t,
2406
- bsPrefix: e,
2407
- className: r,
2408
- type: n = "checkbox",
2409
- isValid: o = !1,
2410
- isInvalid: i = !1,
2411
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2412
- as: a = "input",
2413
- ...l
2414
- }, u) => {
2415
- const {
2416
- controlId: f
2417
- } = Z(Q);
2418
- return e = I(e, "form-check-input"), /* @__PURE__ */ c.jsx(a, {
2419
- ...l,
2420
- ref: u,
2421
- type: n,
2422
- id: t || f,
2423
- className: z(r, e, o && "is-valid", i && "is-invalid")
2424
- });
2425
- });
2426
- lt.displayName = "FormCheckInput";
2427
- const _e = /* @__PURE__ */ S.forwardRef(({
2428
- bsPrefix: t,
2429
- className: e,
2430
- htmlFor: r,
2431
- ...n
2432
- }, o) => {
2433
- const {
2434
- controlId: i
2435
- } = Z(Q);
2436
- return t = I(t, "form-check-label"), /* @__PURE__ */ c.jsx("label", {
2437
- ...n,
2438
- ref: o,
2439
- htmlFor: r || i,
2440
- className: z(e, t)
2441
- });
2442
- });
2443
- _e.displayName = "FormCheckLabel";
2444
- const lr = /* @__PURE__ */ S.forwardRef(({
2445
- id: t,
2446
- bsPrefix: e,
2447
- bsSwitchPrefix: r,
2448
- inline: n = !1,
2449
- reverse: o = !1,
2450
- disabled: i = !1,
2451
- isValid: a = !1,
2452
- isInvalid: l = !1,
2453
- feedbackTooltip: u = !1,
2454
- feedback: f,
2455
- feedbackType: p,
2456
- className: h,
2457
- style: y,
2458
- title: R = "",
2459
- type: A = "checkbox",
2460
- label: g,
2461
- children: b,
2462
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2463
- as: P = "input",
2464
- ...F
2465
- }, j) => {
2466
- e = I(e, "form-check"), r = I(r, "form-switch");
2467
- const {
2468
- controlId: D
2469
- } = Z(Q), m = Ne(() => ({
2470
- controlId: t || D
2471
- }), [D, t]), L = !b && g != null && g !== !1 || _n(b, _e), Y = /* @__PURE__ */ c.jsx(lt, {
2472
- ...F,
2473
- type: A === "switch" ? "checkbox" : A,
2474
- ref: j,
2475
- isValid: a,
2476
- isInvalid: l,
2477
- disabled: i,
2478
- as: P
2479
- });
2480
- return /* @__PURE__ */ c.jsx(Q.Provider, {
2481
- value: m,
2482
- children: /* @__PURE__ */ c.jsx("div", {
2483
- style: y,
2484
- className: z(h, L && e, n && `${e}-inline`, o && `${e}-reverse`, A === "switch" && r),
2485
- children: b || /* @__PURE__ */ c.jsxs(c.Fragment, {
2486
- children: [Y, L && /* @__PURE__ */ c.jsx(_e, {
2487
- title: R,
2488
- children: g
2489
- }), f && /* @__PURE__ */ c.jsx(Ae, {
2490
- type: p,
2491
- tooltip: u,
2492
- children: f
2493
- })]
2494
- })
2495
- })
2496
- });
2497
- });
2498
- lr.displayName = "FormCheck";
2499
- const je = Object.assign(lr, {
2500
- Input: lt,
2501
- Label: _e
2502
- }), cr = /* @__PURE__ */ S.forwardRef(({
2503
- bsPrefix: t,
2504
- type: e,
2505
- size: r,
2506
- htmlSize: n,
2507
- id: o,
2508
- className: i,
2509
- isValid: a = !1,
2510
- isInvalid: l = !1,
2511
- plaintext: u,
2512
- readOnly: f,
2513
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2514
- as: p = "input",
2515
- ...h
2516
- }, y) => {
2517
- const {
2518
- controlId: R
2519
- } = Z(Q);
2520
- return t = I(t, "form-control"), process.env.NODE_ENV !== "production" && sr(R == null || !o, "`controlId` is ignored on `<FormControl>` when `id` is specified."), /* @__PURE__ */ c.jsx(p, {
2521
- ...h,
2522
- type: e,
2523
- size: n,
2524
- ref: y,
2525
- readOnly: f,
2526
- id: o || R,
2527
- className: z(i, u ? `${t}-plaintext` : t, r && `${t}-${r}`, e === "color" && `${t}-color`, a && "is-valid", l && "is-invalid")
2528
- });
2529
- });
2530
- cr.displayName = "FormControl";
2531
- const zn = Object.assign(cr, {
2532
- Feedback: Ae
2533
- }), ur = /* @__PURE__ */ S.forwardRef(({
2534
- className: t,
2535
- bsPrefix: e,
2536
- as: r = "div",
2537
- ...n
2538
- }, o) => (e = I(e, "form-floating"), /* @__PURE__ */ c.jsx(r, {
2539
- ref: o,
2540
- className: z(t, e),
2541
- ...n
2542
- })));
2543
- ur.displayName = "FormFloating";
2544
- const ct = /* @__PURE__ */ S.forwardRef(({
2545
- controlId: t,
2546
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2547
- as: e = "div",
2548
- ...r
2549
- }, n) => {
2550
- const o = Ne(() => ({
2551
- controlId: t
2552
- }), [t]);
2553
- return /* @__PURE__ */ c.jsx(Q.Provider, {
2554
- value: o,
2555
- children: /* @__PURE__ */ c.jsx(e, {
2556
- ...r,
2557
- ref: n
2558
- })
2559
- });
2560
- });
2561
- ct.displayName = "FormGroup";
2562
- const fr = /* @__PURE__ */ S.forwardRef(({
2563
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2564
- as: t = "label",
2565
- bsPrefix: e,
2566
- column: r = !1,
2567
- visuallyHidden: n = !1,
2568
- className: o,
2569
- htmlFor: i,
2570
- ...a
2571
- }, l) => {
2572
- const {
2573
- controlId: u
2574
- } = Z(Q);
2575
- e = I(e, "form-label");
2576
- let f = "col-form-label";
2577
- typeof r == "string" && (f = `${f} ${f}-${r}`);
2578
- const p = z(o, e, n && "visually-hidden", r && f);
2579
- return process.env.NODE_ENV !== "production" && sr(u == null || !i, "`controlId` is ignored on `<FormLabel>` when `htmlFor` is specified."), i = i || u, r ? /* @__PURE__ */ c.jsx(ne, {
2580
- ref: l,
2581
- as: "label",
2582
- className: p,
2583
- htmlFor: i,
2584
- ...a
2585
- }) : /* @__PURE__ */ c.jsx(t, {
2586
- ref: l,
2587
- className: p,
2588
- htmlFor: i,
2589
- ...a
2590
- });
2591
- });
2592
- fr.displayName = "FormLabel";
2593
- const dr = /* @__PURE__ */ S.forwardRef(({
2594
- bsPrefix: t,
2595
- className: e,
2596
- id: r,
2597
- ...n
2598
- }, o) => {
2599
- const {
2600
- controlId: i
2601
- } = Z(Q);
2602
- return t = I(t, "form-range"), /* @__PURE__ */ c.jsx("input", {
2603
- ...n,
2604
- type: "range",
2605
- ref: o,
2606
- className: z(e, t),
2607
- id: r || i
2608
- });
2609
- });
2610
- dr.displayName = "FormRange";
2611
- const pr = /* @__PURE__ */ S.forwardRef(({
2612
- bsPrefix: t,
2613
- size: e,
2614
- htmlSize: r,
2615
- className: n,
2616
- isValid: o = !1,
2617
- isInvalid: i = !1,
2618
- id: a,
2619
- ...l
2620
- }, u) => {
2621
- const {
2622
- controlId: f
2623
- } = Z(Q);
2624
- return t = I(t, "form-select"), /* @__PURE__ */ c.jsx("select", {
2625
- ...l,
2626
- size: r,
2627
- ref: u,
2628
- className: z(n, t, e && `${t}-${e}`, o && "is-valid", i && "is-invalid"),
2629
- id: a || f
2630
- });
2631
- });
2632
- pr.displayName = "FormSelect";
2633
- const mr = /* @__PURE__ */ S.forwardRef(
2634
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2635
- ({
2636
- bsPrefix: t,
2637
- className: e,
2638
- as: r = "small",
2639
- muted: n,
2640
- ...o
2641
- }, i) => (t = I(t, "form-text"), /* @__PURE__ */ c.jsx(r, {
2642
- ...o,
2643
- ref: i,
2644
- className: z(e, t, n && "text-muted")
2645
- }))
2646
- );
2647
- mr.displayName = "FormText";
2648
- const hr = /* @__PURE__ */ S.forwardRef((t, e) => /* @__PURE__ */ c.jsx(je, {
2649
- ...t,
2650
- ref: e,
2651
- type: "switch"
2652
- }));
2653
- hr.displayName = "Switch";
2654
- const Pn = Object.assign(hr, {
2655
- Input: je.Input,
2656
- Label: je.Label
2657
- }), yr = /* @__PURE__ */ S.forwardRef(({
2658
- bsPrefix: t,
2659
- className: e,
2660
- children: r,
2661
- controlId: n,
2662
- label: o,
2663
- ...i
2664
- }, a) => (t = I(t, "form-floating"), /* @__PURE__ */ c.jsxs(ct, {
2665
- ref: a,
2666
- className: z(e, t),
2667
- controlId: n,
2668
- ...i,
2669
- children: [r, /* @__PURE__ */ c.jsx("label", {
2670
- htmlFor: n,
2671
- children: o
2672
- })]
2673
- })));
2674
- yr.displayName = "FloatingLabel";
2675
- const An = {
2676
- /**
2677
- * The Form `ref` will be forwarded to the underlying element,
2678
- * which means, unless it's rendered `as` a composite component,
2679
- * it will be a DOM node, when resolved.
2680
- *
2681
- * @type {ReactRef}
2682
- * @alias ref
2683
- */
2684
- _ref: k.any,
2685
- /**
2686
- * Mark a form as having been validated. Setting it to `true` will
2687
- * toggle any validation styles on the forms elements.
2688
- */
2689
- validated: k.bool,
2690
- as: k.elementType
2691
- }, ut = /* @__PURE__ */ S.forwardRef(({
2692
- className: t,
2693
- validated: e,
2694
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2695
- as: r = "form",
2696
- ...n
2697
- }, o) => /* @__PURE__ */ c.jsx(r, {
2698
- ...n,
2699
- ref: o,
2700
- className: z(t, e && "was-validated")
2701
- }));
2702
- ut.displayName = "Form";
2703
- ut.propTypes = An;
2704
- const zt = Object.assign(ut, {
2705
- Group: ct,
2706
- Control: zn,
2707
- Floating: ur,
2708
- Check: je,
2709
- Switch: Pn,
2710
- Label: fr,
2711
- Text: mr,
2712
- Range: dr,
2713
- Select: pr,
2714
- FloatingLabel: yr
2715
- }), Oe = /* @__PURE__ */ S.forwardRef(({
2716
- bsPrefix: t,
2717
- className: e,
2718
- // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
2719
- as: r = "div",
2720
- ...n
2721
- }, o) => {
2722
- const i = I(t, "row"), a = $t(), l = It(), u = `${i}-cols`, f = [];
2723
- return a.forEach((p) => {
2724
- const h = n[p];
2725
- delete n[p];
2726
- let y;
2727
- h != null && typeof h == "object" ? {
2728
- cols: y
2729
- } = h : y = h;
2730
- const R = p !== l ? `-${p}` : "";
2731
- y != null && f.push(`${u}${R}-${y}`);
2732
- }), /* @__PURE__ */ c.jsx(r, {
2733
- ref: o,
2734
- ...n,
2735
- className: z(e, i, ...f)
2736
- });
2737
- });
2738
- Oe.displayName = "Row";
2739
- class Bn extends ze {
2740
- createMazeGrid() {
2741
- const { width: e, height: r, walls: n, finishPosition: o } = this.props.config, i = [];
2742
- for (let a = 0; a < r; a++) {
2743
- i[a] = [];
2744
- for (let l = 0; l < e; l++) {
2745
- const u = n.some((p) => p.x === l && p.y === a), f = o.x === l && o.y === a;
2746
- i[a][l] = {
2747
- isWall: u,
2748
- isFinish: f,
2749
- isSpider: !1,
2750
- isPath: !u
2751
- };
2752
- }
2753
- }
2754
- return i;
2755
- }
2756
- render() {
2757
- const { config: e, cellSize: r } = this.props, { width: n, height: o } = e, i = this.createMazeGrid();
2758
- return /* @__PURE__ */ c.jsx(
2759
- "div",
2760
- {
2761
- style: {
2762
- position: "relative",
2763
- width: n * r,
2764
- height: o * r,
2765
- border: "2px solid #333",
2766
- backgroundColor: "#f0f0f0"
2767
- },
2768
- children: i.map(
2769
- (a, l) => a.map((u, f) => /* @__PURE__ */ c.jsxs(
2770
- "div",
2771
- {
2772
- style: {
2773
- position: "absolute",
2774
- left: f * r,
2775
- top: l * r,
2776
- width: r,
2777
- height: r,
2778
- backgroundColor: u.isWall ? "#333" : u.isFinish ? "#90EE90" : "#f0f0f0",
2779
- border: "1px solid #ccc",
2780
- display: "flex",
2781
- alignItems: "center",
2782
- justifyContent: "center",
2783
- fontSize: "12px",
2784
- fontWeight: "bold"
2785
- },
2786
- children: [
2787
- u.isFinish && /* @__PURE__ */ c.jsx(
2788
- "div",
2789
- {
2790
- style: {
2791
- width: "80%",
2792
- height: "80%",
2793
- backgroundColor: "#32CD32",
2794
- borderRadius: "50%",
2795
- border: "3px solid #228B22",
2796
- display: "flex",
2797
- alignItems: "center",
2798
- justifyContent: "center",
2799
- color: "white",
2800
- fontSize: "14px",
2801
- fontWeight: "bold"
2802
- },
2803
- children: "🎯"
2804
- }
2805
- ),
2806
- u.isWall && /* @__PURE__ */ c.jsx(
2807
- "div",
2808
- {
2809
- style: {
2810
- width: "100%",
2811
- height: "100%",
2812
- backgroundColor: "#333",
2813
- display: "flex",
2814
- alignItems: "center",
2815
- justifyContent: "center",
2816
- color: "white",
2817
- fontSize: "12px"
2818
- },
2819
- children: "🧱"
2820
- }
2821
- )
2822
- ]
2823
- },
2824
- `${f}-${l}`
2825
- ))
2826
- )
2827
- }
2828
- );
2829
- }
2830
- }
2831
- class $n extends ze {
2832
- render() {
2833
- const { position: e, direction: r, size: n } = this.props, o = n, a = {
2834
- north: 0,
2835
- east: 90,
2836
- south: 180,
2837
- west: 270
2838
- }[r];
2839
- return /* @__PURE__ */ c.jsx(
2840
- "div",
2841
- {
2842
- style: {
2843
- position: "absolute",
2844
- left: e.x * o + o / 2,
2845
- top: e.y * o + o / 2,
2846
- width: o * 0.8,
2847
- height: o * 0.8,
2848
- transform: `translate(-50%, -50%) rotate(${a}deg)`,
2849
- transition: "all 0.3s ease-in-out",
2850
- zIndex: 10
2851
- },
2852
- children: /* @__PURE__ */ c.jsxs(
2853
- "div",
2854
- {
2855
- style: {
2856
- width: "100%",
2857
- height: "100%",
2858
- backgroundColor: "#8B4513",
2859
- borderRadius: "50%",
2860
- border: "2px solid #654321",
2861
- position: "relative",
2862
- display: "flex",
2863
- alignItems: "center",
2864
- justifyContent: "center"
2865
- },
2866
- children: [
2867
- /* @__PURE__ */ c.jsx(
2868
- "div",
2869
- {
2870
- style: {
2871
- width: "30%",
2872
- height: "30%",
2873
- backgroundColor: "#FF0000",
2874
- borderRadius: "50%",
2875
- position: "absolute",
2876
- left: "20%",
2877
- top: "20%",
2878
- boxShadow: "0 0 5px #FF0000"
2879
- }
2880
- }
2881
- ),
2882
- /* @__PURE__ */ c.jsx(
2883
- "div",
2884
- {
2885
- style: {
2886
- width: "30%",
2887
- height: "30%",
2888
- backgroundColor: "#FF0000",
2889
- borderRadius: "50%",
2890
- position: "absolute",
2891
- right: "20%",
2892
- top: "20%",
2893
- boxShadow: "0 0 5px #FF0000"
2894
- }
2895
- }
2896
- )
2897
- ]
2898
- }
2899
- )
2900
- }
2901
- );
2902
- }
2903
- }
2904
- function In() {
2905
- const t = He();
2906
- t.Blocks.maze_move_forward = {
2907
- init() {
2908
- this.appendDummyInput().appendField("Move Forward"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setColour(92), this.setTooltip("Move the spider forward one step"), this.setHelpUrl("");
2909
- }
2910
- }, t.Blocks.maze_turn_left = {
2911
- init() {
2912
- this.appendDummyInput().appendField("🔄 Turn Left"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setColour(92), this.setTooltip("Turn the spider 90 degrees to the left"), this.setHelpUrl("");
2913
- }
2914
- }, t.Blocks.maze_turn_right = {
2915
- init() {
2916
- this.appendDummyInput().appendField("🔄 Turn Right"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setColour(92), this.setTooltip("Turn the spider 90 degrees to the right"), this.setHelpUrl("");
2917
- }
2918
- }, t.Blocks.maze_turn_around = {
2919
- init() {
2920
- this.appendDummyInput().appendField("🔄 Turn Around"), this.setPreviousStatement(!0, null), this.setNextStatement(!0, null), this.setColour(92), this.setTooltip("Turn the spider 180 degrees around"), this.setHelpUrl("");
2921
- }
2922
- };
2923
- }
2924
- class Dn extends ze {
2925
- constructor(e) {
2926
- super(e), this.state = { workspace: null, isInitialized: !1 }, this.onAnyChange = this.onAnyChange.bind(this);
2927
- }
2928
- componentDidMount() {
2929
- console.log("[MazeBlocklyContainer] Component mounted, starting initialization..."), this.initializeBlockly();
2930
- }
2931
- componentDidUpdate(e) {
2932
- e.config.toolbox !== this.props.config.toolbox && (this.disposeWorkspace(), this.initializeBlockly()), e.config.initialXml !== this.props.config.initialXml && this.workspace && this.loadXml(this.props.config.initialXml);
2933
- }
2934
- componentWillUnmount() {
2935
- this.disposeWorkspace();
2936
- }
2937
- workspace = null;
2938
- blocklyDivRef = K.createRef();
2939
- async initializeBlockly() {
2940
- if (!this.blocklyDivRef.current) {
2941
- console.error("[MazeBlocklyContainer] Blockly div ref is not available");
2942
- return;
2943
- }
2944
- try {
2945
- console.log("[MazeBlocklyContainer] Starting Blockly initialization..."), console.log("[MazeBlocklyContainer] Calling initializeBlockly()..."), await vr(), console.log("[MazeBlocklyContainer] Blockly initialization completed"), console.log("[MazeBlocklyContainer] Registering maze blocks..."), In(), console.log("[MazeBlocklyContainer] Maze blocks registered"), console.log("[MazeBlocklyContainer] Registering maze generators..."), this.registerMazeGenerators(), console.log("[MazeBlocklyContainer] Maze generators registered"), console.log("[MazeBlocklyContainer] Getting Blockly instance...");
2946
- const e = He();
2947
- console.log("[MazeBlocklyContainer] Blockly instance obtained:", !!e);
2948
- const r = this.props.config.toolbox;
2949
- console.log("[MazeBlocklyContainer] Parsing toolbox XML...");
2950
- const n = e.utils.xml.textToDom(r);
2951
- console.log("[MazeBlocklyContainer] Toolbox XML parsed successfully"), console.log("[MazeBlocklyContainer] Injecting Blockly workspace..."), this.workspace = e.inject(this.blocklyDivRef.current, {
2952
- toolbox: n,
2953
- scrollbars: !0,
2954
- trashcan: !0,
2955
- grid: { spacing: 20, length: 3, colour: "#ccc", snap: !0 },
2956
- zoom: {
2957
- controls: !0,
2958
- wheel: !0,
2959
- startScale: 1,
2960
- maxScale: 3,
2961
- minScale: 0.3,
2962
- scaleSpeed: 1.2
2963
- }
2964
- }), console.log("[MazeBlocklyContainer] Workspace injected successfully:", !!this.workspace), console.log("[MazeBlocklyContainer] Loading initial XML..."), this.loadXml(this.props.config.initialXml), console.log("[MazeBlocklyContainer] Initial XML loaded"), console.log("[MazeBlocklyContainer] Adding change listener..."), this.workspace.addChangeListener(this.onAnyChange), console.log("[MazeBlocklyContainer] Change listener added"), this.setState({ workspace: this.workspace, isInitialized: !0 }), this.props.onWorkspaceChange?.(this.workspace), console.log("[MazeBlocklyContainer] Generating initial code..."), setTimeout(() => {
2965
- this.generateCode();
2966
- }, 100), console.log("[MazeBlocklyContainer] ✅ Initialization completed successfully");
2967
- } catch (e) {
2968
- console.error("[MazeBlocklyContainer] ❌ Failed to initialize Blockly:", e), console.error("[MazeBlocklyContainer] Error details:", e);
2969
- }
2970
- }
2971
- registerMazeGenerators() {
2972
- console.log("[MazeBlocklyContainer] Starting maze generator registration...");
2973
- try {
2974
- console.log("[MazeBlocklyContainer] Getting JavaScript generator...");
2975
- const e = Be();
2976
- console.log("[MazeBlocklyContainer] JavaScript generator obtained:", !!e), console.log("[MazeBlocklyContainer] Registering generators via direct assignment..."), e.maze_move_forward = function() {
2977
- return `moveForward();
2978
- `;
2979
- }, e.maze_turn_left = function() {
2980
- return `turnLeft();
2981
- `;
2982
- }, e.maze_turn_right = function() {
2983
- return `turnRight();
2984
- `;
2985
- }, e.maze_turn_around = function() {
2986
- return `turnAround();
2987
- `;
2988
- }, console.log("[MazeBlocklyContainer] Direct assignment completed"), console.log("[MazeBlocklyContainer] Registering generators via forBlock property...");
2989
- const r = e;
2990
- r.forBlock ? (r.forBlock.maze_move_forward = function() {
2991
- return `moveForward();
2992
- `;
2993
- }, r.forBlock.maze_turn_left = function() {
2994
- return `turnLeft();
2995
- `;
2996
- }, r.forBlock.maze_turn_right = function() {
2997
- return `turnRight();
2998
- `;
2999
- }, r.forBlock.maze_turn_around = function() {
3000
- return `turnAround();
3001
- `;
3002
- }, console.log("[MazeBlocklyContainer] forBlock registration completed")) : console.log("[MazeBlocklyContainer] forBlock property not available, skipping"), console.log("[MazeBlocklyContainer] ✅ Maze generators registered successfully");
3003
- } catch (e) {
3004
- console.error("[MazeBlocklyContainer] ❌ Failed to register maze generators:", e), console.error("[MazeBlocklyContainer] Error details:", e);
3005
- }
3006
- }
3007
- disposeWorkspace() {
3008
- this.workspace && (this.workspace.dispose(), this.workspace = null, this.setState({ workspace: null, isInitialized: !1 }));
3009
- }
3010
- onAnyChange(e) {
3011
- if (!this.workspace) return;
3012
- const r = e?.type || "";
3013
- (r === "block_create" || r === "block_move" || r === "block_delete" || r === "block_change") && (this.props.onWorkspaceChange?.(this.workspace), this.generateCode());
3014
- }
3015
- generateCode() {
3016
- if (!(!this.workspace || !this.props.onCodeChange))
3017
- try {
3018
- console.log("Generating code for workspace:", this.workspace), console.log("Available blocks:", this.workspace.getAllBlocks(!1));
3019
- const r = Be().workspaceToCode(this.workspace);
3020
- console.log("Generated code:", r), this.props.onCodeChange(r);
3021
- } catch (e) {
3022
- console.error("Failed to generate code:", e), console.error("Error details:", e);
3023
- }
3024
- }
3025
- loadXml(e) {
3026
- if (!(!this.workspace || !e))
3027
- try {
3028
- const r = He(), n = r.utils.xml.textToDom(e);
3029
- r.Xml.domToWorkspace(n, this.workspace);
3030
- } catch (r) {
3031
- console.error("Failed to load XML:", r);
3032
- }
3033
- }
3034
- executeCode() {
3035
- if (!this.workspace) return [];
3036
- try {
3037
- console.log("Executing maze code..."), console.log("Workspace state:", this.workspace);
3038
- const r = Be().workspaceToCode(this.workspace);
3039
- console.log("Executing maze code:", r);
3040
- const n = this.parseMovementCode(r);
3041
- return console.log("Parsed movement commands:", n), this.props.onExecuteCode && this.props.onExecuteCode(n), n;
3042
- } catch (e) {
3043
- return console.error("Failed to execute code:", e), console.error("Error details:", e), [];
3044
- }
3045
- }
3046
- parseMovementCode(e) {
3047
- const r = [], n = e.split(`
3048
- `);
3049
- for (const o of n) {
3050
- const i = o.trim();
3051
- i.includes("moveForward()") ? r.push({ type: "move_forward", direction: "north" }) : i.includes("turnLeft()") ? r.push({ type: "turn_left", direction: "north" }) : i.includes("turnRight()") ? r.push({ type: "turn_right", direction: "north" }) : i.includes("turnAround()") && r.push({ type: "turn_around", direction: "north" });
3052
- }
3053
- return r;
3054
- }
3055
- getWorkspace() {
3056
- return this.workspace;
3057
- }
3058
- clearWorkspace() {
3059
- this.workspace?.clear();
3060
- }
3061
- render() {
3062
- const { className: e = "", style: r = {} } = this.props, { isInitialized: n } = this.state;
3063
- return /* @__PURE__ */ c.jsxs(
3064
- "div",
3065
- {
3066
- className: `maze-blockly-container ${e}`,
3067
- style: {
3068
- width: "100%",
3069
- height: "400px",
3070
- position: "relative",
3071
- ...r
3072
- },
3073
- children: [
3074
- /* @__PURE__ */ c.jsx(
3075
- "div",
3076
- {
3077
- ref: this.blocklyDivRef,
3078
- style: {
3079
- width: "100%",
3080
- height: "100%",
3081
- position: "absolute",
3082
- top: 0,
3083
- left: 0
3084
- }
3085
- }
3086
- ),
3087
- !n && /* @__PURE__ */ c.jsx(
3088
- "div",
3089
- {
3090
- style: {
3091
- position: "absolute",
3092
- top: "50%",
3093
- left: "50%",
3094
- transform: "translate(-50%, -50%)",
3095
- color: "#666",
3096
- fontSize: 16
3097
- },
3098
- children: "Loading Blockly..."
3099
- }
3100
- )
3101
- ]
3102
- }
3103
- );
3104
- }
3105
- }
3106
- const Fn = ({
3107
- config: t,
3108
- onConfigChange: e,
3109
- className: r
3110
- }) => {
3111
- const [n, o] = qe("wall"), [i, a] = qe(!1), l = (g, b) => {
3112
- const P = { ...t };
3113
- switch (n) {
3114
- case "start": {
3115
- P.spiderStart = { x: g, y: b };
3116
- break;
3117
- }
3118
- case "finish": {
3119
- P.finishPosition = { x: g, y: b };
3120
- break;
3121
- }
3122
- case "wall": {
3123
- P.walls.findIndex((j) => j.x === g && j.y === b) === -1 && P.walls.push({ x: g, y: b });
3124
- break;
3125
- }
3126
- case "empty": {
3127
- P.walls = P.walls.filter((F) => !(F.x === g && F.y === b));
3128
- break;
3129
- }
3130
- }
3131
- e(P);
3132
- }, u = (g, b) => {
3133
- i && n === "wall" && l(g, b);
3134
- }, f = (g, b) => t.walls.some((P) => P.x === g && P.y === b), p = (g, b) => t.spiderStart.x === g && t.spiderStart.y === b, h = (g, b) => t.finishPosition.x === g && t.finishPosition.y === b, y = (g, b) => p(g, b) ? "start" : h(g, b) ? "finish" : f(g, b) ? "wall" : "empty", R = () => {
3135
- const g = {
3136
- width: t.width,
3137
- height: t.height,
3138
- spiderStart: { x: 1, y: 1 },
3139
- finishPosition: { x: t.width - 2, y: t.height - 2 },
3140
- walls: []
3141
- }, b = t.width * t.height, P = Math.floor(b * 0.2);
3142
- for (let F = 0; F < P; F++) {
3143
- const j = Math.floor(Math.random() * t.width), D = Math.floor(Math.random() * t.height);
3144
- j === g.spiderStart.x && D === g.spiderStart.y || j === g.finishPosition.x && D === g.finishPosition.y || g.walls.push({ x: j, y: D });
3145
- }
3146
- e(g);
3147
- }, A = () => {
3148
- const g = {
3149
- ...t,
3150
- walls: []
3151
- };
3152
- e(g);
3153
- };
3154
- return /* @__PURE__ */ c.jsxs(Ee, { className: r, children: [
3155
- /* @__PURE__ */ c.jsx(Ee.Header, { children: /* @__PURE__ */ c.jsxs(Oe, { className: "align-items-center", children: [
3156
- /* @__PURE__ */ c.jsx(ne, { children: /* @__PURE__ */ c.jsx("h5", { className: "mb-0", children: "Maze Editor" }) }),
3157
- /* @__PURE__ */ c.jsx(ne, { xs: "auto", children: /* @__PURE__ */ c.jsxs(tt, { size: "sm", children: [
3158
- /* @__PURE__ */ c.jsx(
3159
- J,
3160
- {
3161
- variant: n === "wall" ? "primary" : "outline-primary",
3162
- onClick: () => o("wall"),
3163
- children: "Wall"
3164
- }
3165
- ),
3166
- /* @__PURE__ */ c.jsx(
3167
- J,
3168
- {
3169
- variant: n === "empty" ? "primary" : "outline-primary",
3170
- onClick: () => o("empty"),
3171
- children: "Clear"
3172
- }
3173
- ),
3174
- /* @__PURE__ */ c.jsx(
3175
- J,
3176
- {
3177
- variant: n === "start" ? "primary" : "outline-primary",
3178
- onClick: () => o("start"),
3179
- children: "Start"
3180
- }
3181
- ),
3182
- /* @__PURE__ */ c.jsx(
3183
- J,
3184
- {
3185
- variant: n === "finish" ? "primary" : "outline-primary",
3186
- onClick: () => o("finish"),
3187
- children: "Finish"
3188
- }
3189
- )
3190
- ] }) }),
3191
- /* @__PURE__ */ c.jsx(ne, { xs: "auto", children: /* @__PURE__ */ c.jsxs(tt, { size: "sm", children: [
3192
- /* @__PURE__ */ c.jsx(J, { variant: "outline-secondary", onClick: R, children: "Regenerate" }),
3193
- /* @__PURE__ */ c.jsx(J, { variant: "outline-secondary", onClick: A, children: "Clear All" })
3194
- ] }) })
3195
- ] }) }),
3196
- /* @__PURE__ */ c.jsx(Ee.Body, { children: /* @__PURE__ */ c.jsx(
3197
- "div",
3198
- {
3199
- className: "maze-grid",
3200
- style: {
3201
- display: "grid",
3202
- gridTemplateColumns: `repeat(${t.width}, 30px)`,
3203
- gap: "1px",
3204
- backgroundColor: "#ccc",
3205
- padding: "1px"
3206
- },
3207
- onMouseDown: () => a(!0),
3208
- onMouseUp: () => a(!1),
3209
- onMouseLeave: () => a(!1),
3210
- children: Array.from(
3211
- { length: t.height },
3212
- (g, b) => Array.from({ length: t.width }, (P, F) => {
3213
- const j = y(F, b);
3214
- return /* @__PURE__ */ c.jsxs(
3215
- "div",
3216
- {
3217
- className: `maze-cell ${j}`,
3218
- style: {
3219
- width: "30px",
3220
- height: "30px",
3221
- backgroundColor: j === "wall" ? "#333" : j === "start" ? "#28a745" : j === "finish" ? "#dc3545" : "#fff",
3222
- border: "1px solid #ccc",
3223
- cursor: "pointer",
3224
- display: "flex",
3225
- alignItems: "center",
3226
- justifyContent: "center",
3227
- fontSize: "12px",
3228
- color: j === "start" || j === "finish" ? "white" : "black"
3229
- },
3230
- onClick: () => l(F, b),
3231
- onMouseEnter: () => u(F, b),
3232
- title: `${j} at (${F}, ${b})`,
3233
- children: [
3234
- j === "start" && "S",
3235
- j === "finish" && "F"
3236
- ]
3237
- },
3238
- `${F}-${b}`
3239
- );
3240
- })
3241
- )
3242
- }
3243
- ) })
3244
- ] });
3245
- };
3246
- class so extends ze {
3247
- constructor(e) {
3248
- super(e), e.configuration && (this.mazeConfig = { ...e.configuration }), this.state = {
3249
- gameState: {
3250
- spiderPosition: { ...this.mazeConfig.spiderStart },
3251
- isGameWon: !1,
3252
- isGameOver: !1,
3253
- moveCount: 0,
3254
- maxMoves: e.maxMoves || 50
3255
- },
3256
- currentDirection: "east",
3257
- isExecuting: !1,
3258
- currentCommandIndex: 0,
3259
- generatedCode: "",
3260
- minSteps: 8,
3261
- isGenerating: !1
3262
- }, e.configuration || this.generateMaze();
3263
- }
3264
- componentWillUnmount() {
3265
- this.executionInterval && clearInterval(this.executionInterval);
3266
- }
3267
- // Maze configuration - will be auto-generated
3268
- mazeConfig = {
3269
- width: 10,
3270
- height: 8,
3271
- spiderStart: { x: 1, y: 1 },
3272
- finishPosition: { x: 8, y: 6 },
3273
- walls: []
3274
- };
3275
- // Blockly configuration for maze game
3276
- blocklyConfig = {
3277
- allowedTypes: /* @__PURE__ */ new Set([
3278
- "maze_move_forward",
3279
- "maze_turn_left",
3280
- "maze_turn_right",
3281
- "maze_turn_around",
3282
- "controls_repeat",
3283
- "controls_if"
3284
- ]),
3285
- limits: {
3286
- maze_move_forward: 20,
3287
- maze_turn_left: 10,
3288
- maze_turn_right: 10,
3289
- maze_turn_around: 5,
3290
- controls_repeat: 5,
3291
- controls_if: 3
3292
- },
3293
- toolbox: `
3294
- <xml xmlns="https://developers.google.com/blockly/xml" id="toolbox" style="display:none">
3295
- <category name="Movement" colour="#5CA65C">
3296
- <block type="maze_move_forward"></block>
3297
- <block type="maze_turn_left"></block>
3298
- <block type="maze_turn_right"></block>
3299
- <block type="maze_turn_around"></block>
3300
- </category>
3301
- <category name="Control" colour="#A65C81">
3302
- <block type="controls_repeat">
3303
- <field name="TIMES">3</field>
3304
- </block>
3305
- <block type="controls_if"></block>
3306
- </category>
3307
- </xml>
3308
- `,
3309
- initialXml: `
3310
- <xml xmlns="https://developers.google.com/blockly/xml">
3311
- <block type="maze_move_forward" x="20" y="20"></block>
3312
- </xml>
3313
- `
3314
- };
3315
- executionInterval = null;
3316
- blocklyRef = K.createRef();
3317
- generateMaze = () => {
3318
- this.setState({ isGenerating: !0 }), setTimeout(() => {
3319
- const e = this.createMazeWithMinSteps(this.state.minSteps);
3320
- this.mazeConfig = e, this.setState({
3321
- gameState: {
3322
- spiderPosition: { ...e.spiderStart },
3323
- isGameWon: !1,
3324
- isGameOver: !1,
3325
- moveCount: 0,
3326
- maxMoves: Math.max(50, (e.estimatedSteps || 8) + 10)
3327
- },
3328
- currentDirection: "east",
3329
- isExecuting: !1,
3330
- currentCommandIndex: 0,
3331
- isGenerating: !1
3332
- }), this.blocklyRef.current && this.blocklyRef.current.clearWorkspace();
3333
- }, 100);
3334
- };
3335
- createMazeWithMinSteps(e) {
3336
- for (let i = 0; i < 50; i++) {
3337
- const a = this.generateRandomMaze(10, 8), l = this.estimateOptimalSteps(a);
3338
- if (l >= e && this.isMazeSolvable(a))
3339
- return { ...a, estimatedSteps: l };
3340
- }
3341
- return this.generateFallbackMaze(10, 8, e);
3342
- }
3343
- generateRandomMaze(e, r) {
3344
- const n = [], o = { x: 1, y: 1 }, i = { x: e - 2, y: r - 2 }, a = Math.floor(e * r * (0.3 + Math.random() * 0.1));
3345
- for (let l = 0; l < a; l++) {
3346
- const u = Math.floor(Math.random() * e), f = Math.floor(Math.random() * r);
3347
- u === o.x && f === o.y || u === i.x && f === i.y || Math.abs(u - o.x) <= 1 && Math.abs(f - o.y) <= 1 || Math.abs(u - i.x) <= 1 && Math.abs(f - i.y) <= 1 || n.some((p) => p.x === u && p.y === f) || n.push({ x: u, y: f });
3348
- }
3349
- return { width: e, height: r, spiderStart: o, finishPosition: i, walls: n };
3350
- }
3351
- generateFallbackMaze(e, r, n) {
3352
- const o = [], i = { x: 1, y: 1 }, a = { x: e - 2, y: r - 2 }, l = [], u = { ...i };
3353
- for (; u.x < a.x || u.y < a.y; )
3354
- u.x < a.x && (u.x++, l.push({ ...u })), u.y < a.y && (u.y++, l.push({ ...u }));
3355
- for (let f = 0; f < Math.floor(n / 2); f++) {
3356
- const p = Math.floor(Math.random() * (e - 2)) + 1, h = Math.floor(Math.random() * (r - 2)) + 1;
3357
- !l.some((y) => y.x === p && y.y === h) && !o.some((y) => y.x === p && y.y === h) && o.push({ x: p, y: h });
3358
- }
3359
- return { width: e, height: r, spiderStart: i, finishPosition: a, walls: o, estimatedSteps: n };
3360
- }
3361
- estimateOptimalSteps(e) {
3362
- const r = Math.abs(e.finishPosition.x - e.spiderStart.x) + Math.abs(e.finishPosition.y - e.spiderStart.y), n = Math.min(e.walls.length * 0.5, 10);
3363
- return Math.ceil(r + n);
3364
- }
3365
- isMazeSolvable(e) {
3366
- const r = /* @__PURE__ */ new Set(), n = [e.spiderStart];
3367
- for (; n.length > 0; ) {
3368
- const o = n.shift(), i = `${o.x},${o.y}`;
3369
- if (r.has(i)) continue;
3370
- if (r.add(i), o.x === e.finishPosition.x && o.y === e.finishPosition.y)
3371
- return !0;
3372
- const a = [
3373
- { x: o.x + 1, y: o.y },
3374
- { x: o.x - 1, y: o.y },
3375
- { x: o.x, y: o.y + 1 },
3376
- { x: o.x, y: o.y - 1 }
3377
- ];
3378
- for (const l of a)
3379
- l.x >= 0 && l.x < e.width && l.y >= 0 && l.y < e.height && !e.walls.some((u) => u.x === l.x && u.y === l.y) && !r.has(`${l.x},${l.y}`) && n.push(l);
3380
- }
3381
- return !1;
3382
- }
3383
- handleCodeChange = (e) => {
3384
- this.setState({ generatedCode: e });
3385
- };
3386
- handleConfigChange = (e) => {
3387
- this.mazeConfig = e, this.setState({
3388
- gameState: {
3389
- ...this.state.gameState,
3390
- spiderPosition: { ...e.spiderStart },
3391
- isGameWon: !1,
3392
- isGameOver: !1,
3393
- moveCount: 0
3394
- }
3395
- }), this.props.onChange && this.props.onChange(e);
3396
- };
3397
- handleExecuteCode = (e) => {
3398
- e.length !== 0 && (this.setState({
3399
- isExecuting: !0,
3400
- currentCommandIndex: 0
3401
- }), this.executeCommands(e));
3402
- };
3403
- executeCommands(e) {
3404
- let r = 0;
3405
- this.executionInterval = setInterval(() => {
3406
- if (r >= e.length) {
3407
- this.stopExecution();
3408
- return;
3409
- }
3410
- const n = e[r];
3411
- this.executeCommand(n), r++, this.setState({ currentCommandIndex: r });
3412
- }, 800);
3413
- }
3414
- executeCommand(e) {
3415
- switch (e.type) {
3416
- case "move_forward":
3417
- this.moveSpiderForward();
3418
- break;
3419
- case "turn_left":
3420
- this.turnSpider("left");
3421
- break;
3422
- case "turn_right":
3423
- this.turnSpider("right");
3424
- break;
3425
- case "turn_around":
3426
- this.turnSpider("around");
3427
- break;
3428
- }
3429
- }
3430
- moveSpiderForward() {
3431
- const { gameState: e, currentDirection: r } = this.state, n = { ...e.spiderPosition };
3432
- switch (r) {
3433
- case "north":
3434
- n.y = Math.max(0, n.y - 1);
3435
- break;
3436
- case "south":
3437
- n.y = Math.min(this.mazeConfig.height - 1, n.y + 1);
3438
- break;
3439
- case "east":
3440
- n.x = Math.min(this.mazeConfig.width - 1, n.x + 1);
3441
- break;
3442
- case "west":
3443
- n.x = Math.max(0, n.x - 1);
3444
- break;
3445
- }
3446
- if (!this.isWall(n)) {
3447
- const o = {
3448
- ...e,
3449
- spiderPosition: n,
3450
- moveCount: e.moveCount + 1
3451
- };
3452
- if (this.isFinish(n) && (o.isGameWon = !0, o.isGameOver = !0), o.moveCount >= e.maxMoves && (o.isGameOver = !0), this.setState({ gameState: o }), o.isGameOver && this.props.onRunFinish) {
3453
- const i = {
3454
- steps: o.moveCount,
3455
- reachedFinish: o.isGameWon,
3456
- maxMovesExceeded: o.moveCount >= e.maxMoves,
3457
- finalPosition: n,
3458
- path: [],
3459
- // TODO: Track path during execution
3460
- executionTime: 0
3461
- // TODO: Track execution time
3462
- };
3463
- this.props.onRunFinish(i);
3464
- }
3465
- }
3466
- }
3467
- turnSpider(e) {
3468
- const n = {
3469
- north: { left: "west", right: "east", around: "south" },
3470
- south: { left: "east", right: "west", around: "north" },
3471
- east: { left: "north", right: "south", around: "west" },
3472
- west: { left: "south", right: "north", around: "east" }
3473
- }[this.state.currentDirection][e];
3474
- this.setState({ currentDirection: n });
3475
- }
3476
- isWall(e) {
3477
- return this.mazeConfig.walls.some(
3478
- (r) => r.x === e.x && r.y === e.y
3479
- );
3480
- }
3481
- isFinish(e) {
3482
- return e.x === this.mazeConfig.finishPosition.x && e.y === this.mazeConfig.finishPosition.y;
3483
- }
3484
- stopExecution() {
3485
- this.executionInterval && (clearInterval(this.executionInterval), this.executionInterval = null), this.setState({ isExecuting: !1 });
3486
- }
3487
- resetGame = () => {
3488
- this.setState({
3489
- gameState: {
3490
- spiderPosition: { ...this.mazeConfig.spiderStart },
3491
- isGameWon: !1,
3492
- isGameOver: !1,
3493
- moveCount: 0,
3494
- maxMoves: Math.max(50, (this.mazeConfig.estimatedSteps || 8) + 10)
3495
- },
3496
- currentDirection: "east",
3497
- isExecuting: !1,
3498
- currentCommandIndex: 0
3499
- }), this.blocklyRef.current && this.blocklyRef.current.clearWorkspace();
3500
- };
3501
- runCode = () => {
3502
- this.blocklyRef.current && this.blocklyRef.current.executeCode();
3503
- };
3504
- // private handleMinStepsChange = (event: React.ChangeEvent<HTMLInputElement>) => {
3505
- // const value = parseInt(event.target.value);
3506
- // if (!isNaN(value) && value >= 3 && value <= 30) {
3507
- // this.setState({ minSteps: value }, () => {
3508
- // // Regenerate maze with new minimum steps if the current maze doesn't meet the requirement
3509
- // if (this.mazeConfig.estimatedSteps && this.mazeConfig.estimatedSteps < value) {
3510
- // this.generateMaze();
3511
- // }
3512
- // });
3513
- // }
3514
- // };
3515
- handleGenerateNewMaze = () => {
3516
- this.generateMaze();
3517
- };
3518
- render() {
3519
- const { gameState: e, currentDirection: r, isExecuting: n, generatedCode: o, isGenerating: i } = this.state, a = 50;
3520
- return /* @__PURE__ */ c.jsx("div", { className: `maze-game ${this.props.className || ""}`, children: /* @__PURE__ */ c.jsx(ar, { fluid: !0, children: /* @__PURE__ */ c.jsx(Oe, { children: /* @__PURE__ */ c.jsx(ne, { children: /* @__PURE__ */ c.jsx(Ee, { children: /* @__PURE__ */ c.jsx(Ee.Body, { children: /* @__PURE__ */ c.jsxs(Oe, { children: [
3521
- /* @__PURE__ */ c.jsxs(ne, { md: 8, children: [
3522
- /* @__PURE__ */ c.jsxs("div", { className: "d-flex justify-content-between align-items-center mb-3", children: [
3523
- /* @__PURE__ */ c.jsxs("div", { children: [
3524
- /* @__PURE__ */ c.jsxs(pe, { bg: "primary", className: "me-2", children: [
3525
- "Moves: ",
3526
- e.moveCount,
3527
- "/",
3528
- e.maxMoves
3529
- ] }),
3530
- /* @__PURE__ */ c.jsx(pe, { bg: r === "north" ? "success" : "secondary", className: "me-1", children: "↑" }),
3531
- /* @__PURE__ */ c.jsx(pe, { bg: r === "east" ? "success" : "secondary", className: "me-1", children: "→" }),
3532
- /* @__PURE__ */ c.jsx(pe, { bg: r === "south" ? "success" : "secondary", className: "me-1", children: "↓" }),
3533
- /* @__PURE__ */ c.jsx(pe, { bg: r === "west" ? "success" : "secondary", className: "me-1", children: "←" })
3534
- ] }),
3535
- /* @__PURE__ */ c.jsxs("div", { children: [
3536
- /* @__PURE__ */ c.jsx(
3537
- J,
3538
- {
3539
- variant: "success",
3540
- onClick: this.runCode,
3541
- disabled: n || e.isGameOver,
3542
- className: "me-2",
3543
- children: n ? "Running..." : "▶️ Run Code"
3544
- }
3545
- ),
3546
- /* @__PURE__ */ c.jsx(
3547
- J,
3548
- {
3549
- variant: "outline-secondary",
3550
- onClick: this.resetGame,
3551
- disabled: n,
3552
- className: "me-2",
3553
- children: "🔄 Reset"
3554
- }
3555
- )
3556
- ] })
3557
- ] }),
3558
- this.props.isEditable && /* @__PURE__ */ c.jsxs("div", { className: "d-flex align-items-center mb-3 p-3 bg-light rounded", children: [
3559
- /* @__PURE__ */ c.jsxs("div", { className: "me-3", children: [
3560
- /* @__PURE__ */ c.jsx(zt.Label, { className: "mb-1 fw-bold", children: "Steps:" }),
3561
- /* @__PURE__ */ c.jsx("div", { className: "text-muted", children: this.mazeConfig.estimatedSteps || "Calculating..." })
3562
- ] }),
3563
- /* @__PURE__ */ c.jsxs("div", { className: "me-3", children: [
3564
- /* @__PURE__ */ c.jsx(zt.Label, { className: "mb-1 fw-bold", children: "Walls:" }),
3565
- /* @__PURE__ */ c.jsx("div", { className: "text-muted", children: this.mazeConfig.walls.length })
3566
- ] }),
3567
- /* @__PURE__ */ c.jsx(
3568
- J,
3569
- {
3570
- variant: "primary",
3571
- onClick: this.handleGenerateNewMaze,
3572
- disabled: n || i,
3573
- className: "ms-auto",
3574
- children: i ? "🔄 Generating..." : "🎲 Generate New Maze"
3575
- }
3576
- )
3577
- ] }),
3578
- e.isGameWon && /* @__PURE__ */ c.jsx(Mt, { variant: "success", className: "mb-3", children: "🎉 Congratulations! You've reached the finish! 🎯" }),
3579
- e.isGameOver && !e.isGameWon && /* @__PURE__ */ c.jsx(Mt, { variant: "danger", className: "mb-3", children: "❌ Game Over! You've exceeded the maximum moves." }),
3580
- this.props.isEditable && /* @__PURE__ */ c.jsx("div", { className: "mb-4", children: /* @__PURE__ */ c.jsx(
3581
- Fn,
3582
- {
3583
- config: this.mazeConfig,
3584
- onConfigChange: this.handleConfigChange
3585
- }
3586
- ) }),
3587
- /* @__PURE__ */ c.jsxs("div", { style: { position: "relative", marginBottom: "20px" }, children: [
3588
- /* @__PURE__ */ c.jsx(
3589
- Bn,
3590
- {
3591
- config: this.mazeConfig,
3592
- cellSize: a
3593
- }
3594
- ),
3595
- /* @__PURE__ */ c.jsx(
3596
- $n,
3597
- {
3598
- position: e.spiderPosition,
3599
- direction: r,
3600
- size: a
3601
- }
3602
- )
3603
- ] })
3604
- ] }),
3605
- /* @__PURE__ */ c.jsxs(ne, { md: 4, children: [
3606
- /* @__PURE__ */ c.jsx("h5", { children: "Programming Blocks" }),
3607
- /* @__PURE__ */ c.jsx(
3608
- Dn,
3609
- {
3610
- ref: this.blocklyRef,
3611
- config: this.blocklyConfig,
3612
- onCodeChange: this.handleCodeChange,
3613
- onExecuteCode: this.handleExecuteCode,
3614
- style: { height: "300px" }
3615
- }
3616
- ),
3617
- /* @__PURE__ */ c.jsxs("div", { className: "mt-3", children: [
3618
- /* @__PURE__ */ c.jsx("h6", { children: "Generated Code:" }),
3619
- /* @__PURE__ */ c.jsx(
3620
- "pre",
3621
- {
3622
- className: "bg-light p-2 rounded",
3623
- style: { fontSize: "12px", maxHeight: "150px", overflow: "auto" },
3624
- children: o || "// No code generated yet"
3625
- }
3626
- )
3627
- ] })
3628
- ] })
3629
- ] }) }) }) }) }) }) });
3630
- }
3631
- }
3632
- export {
3633
- Er as A,
3634
- no as B,
3635
- In as C,
3636
- Fn as E,
3637
- so as M,
3638
- $n as S,
3639
- At as a,
3640
- He as b,
3641
- oo as c,
3642
- Be as d,
3643
- Dn as e,
3644
- Bn as f,
3645
- rt as g,
3646
- Yn as h,
3647
- vr as i,
3648
- qn as j,
3649
- Vn as k,
3650
- Hn as l,
3651
- Xn as m,
3652
- gr as n,
3653
- Jn as o,
3654
- Kn as p,
3655
- Zn as q,
3656
- Gn as r,
3657
- Qn as s,
3658
- Un as t,
3659
- dt as u,
3660
- xr as v,
3661
- eo as w,
3662
- to as x,
3663
- ro as y,
3664
- br as z
3665
- };
3666
- //# sourceMappingURL=index-D10FGDwl.js.map