@graph-render/tournament-tree 1.0.1

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 (50) hide show
  1. package/.eslintrc.json +6 -0
  2. package/CHANGELOG.md +23 -0
  3. package/README.md +0 -0
  4. package/dist/index.js +2258 -0
  5. package/dist/src/components/BracketToolbar.d.ts +11 -0
  6. package/dist/src/components/BracketToolbar.d.ts.map +1 -0
  7. package/dist/src/components/SquashNode.d.ts +10 -0
  8. package/dist/src/components/SquashNode.d.ts.map +1 -0
  9. package/dist/src/components/TournamentBracket.d.ts +4 -0
  10. package/dist/src/components/TournamentBracket.d.ts.map +1 -0
  11. package/dist/src/constants/index.d.ts +3 -0
  12. package/dist/src/constants/index.d.ts.map +1 -0
  13. package/dist/src/constants/node.d.ts +127 -0
  14. package/dist/src/constants/node.d.ts.map +1 -0
  15. package/dist/src/constants/tournament.d.ts +4 -0
  16. package/dist/src/constants/tournament.d.ts.map +1 -0
  17. package/dist/src/contexts/BracketThemeContext.d.ts +16 -0
  18. package/dist/src/contexts/BracketThemeContext.d.ts.map +1 -0
  19. package/dist/src/index.d.ts +9 -0
  20. package/dist/src/index.d.ts.map +1 -0
  21. package/dist/src/types/index.d.ts +3 -0
  22. package/dist/src/types/index.d.ts.map +1 -0
  23. package/dist/src/types/squash.d.ts +18 -0
  24. package/dist/src/types/squash.d.ts.map +1 -0
  25. package/dist/src/types/tournament.d.ts +13 -0
  26. package/dist/src/types/tournament.d.ts.map +1 -0
  27. package/dist/src/utils/pathKeys.d.ts +8 -0
  28. package/dist/src/utils/pathKeys.d.ts.map +1 -0
  29. package/dist/src/utils/roundLabels.d.ts +16 -0
  30. package/dist/src/utils/roundLabels.d.ts.map +1 -0
  31. package/dist/tsconfig.tsbuildinfo +1 -0
  32. package/index.html +18 -0
  33. package/package.json +51 -0
  34. package/project.json +60 -0
  35. package/src/components/BracketToolbar.tsx +135 -0
  36. package/src/components/SquashNode.tsx +813 -0
  37. package/src/components/TournamentBracket.tsx +992 -0
  38. package/src/constants/index.ts +2 -0
  39. package/src/constants/node.ts +96 -0
  40. package/src/constants/tournament.ts +54 -0
  41. package/src/contexts/BracketThemeContext.tsx +35 -0
  42. package/src/index.ts +12 -0
  43. package/src/types/index.ts +2 -0
  44. package/src/types/squash.ts +21 -0
  45. package/src/types/tournament.ts +14 -0
  46. package/src/utils/pathKeys.ts +50 -0
  47. package/src/utils/roundLabels.ts +110 -0
  48. package/tsconfig.json +19 -0
  49. package/tsconfig.node.json +11 -0
  50. package/vite.config.ts +21 -0
package/dist/index.js ADDED
@@ -0,0 +1,2258 @@
1
+ var Xt = Object.defineProperty;
2
+ var Yt = (t, r, o) => r in t ? Xt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
3
+ var ut = (t, r, o) => Yt(t, typeof r != "symbol" ? r + "" : r, o);
4
+ import re, { useState as pe, useEffect as Ie, useRef as Ge, useMemo as ge, useCallback as ne } from "react";
5
+ import { EdgeType as qt, LayoutDirection as Kt, LayoutType as Jt } from "@graph-render/types";
6
+ import Zt, { flushSync as Qt } from "react-dom";
7
+ import { Graph as dt, groupPositionedNodesByColumn as er } from "@graph-render/react";
8
+ var qe = { exports: {} }, Ce = {};
9
+ /**
10
+ * @license React
11
+ * react-jsx-runtime.production.min.js
12
+ *
13
+ * Copyright (c) Facebook, Inc. and its affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */
18
+ var ft;
19
+ function tr() {
20
+ if (ft) return Ce;
21
+ ft = 1;
22
+ var t = re, r = Symbol.for("react.element"), o = Symbol.for("react.fragment"), a = Object.prototype.hasOwnProperty, c = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, u = { key: !0, ref: !0, __self: !0, __source: !0 };
23
+ function d(f, g, I) {
24
+ var m, l = {}, E = null, q = null;
25
+ I !== void 0 && (E = "" + I), g.key !== void 0 && (E = "" + g.key), g.ref !== void 0 && (q = g.ref);
26
+ for (m in g) a.call(g, m) && !u.hasOwnProperty(m) && (l[m] = g[m]);
27
+ if (f && f.defaultProps) for (m in g = f.defaultProps, g) l[m] === void 0 && (l[m] = g[m]);
28
+ return { $$typeof: r, type: f, key: E, ref: q, props: l, _owner: c.current };
29
+ }
30
+ return Ce.Fragment = o, Ce.jsx = d, Ce.jsxs = d, Ce;
31
+ }
32
+ var je = {};
33
+ /**
34
+ * @license React
35
+ * react-jsx-runtime.development.js
36
+ *
37
+ * Copyright (c) Facebook, Inc. and its affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */
42
+ var ht;
43
+ function rr() {
44
+ return ht || (ht = 1, process.env.NODE_ENV !== "production" && function() {
45
+ var t = re, r = Symbol.for("react.element"), o = Symbol.for("react.portal"), a = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), u = Symbol.for("react.profiler"), d = Symbol.for("react.provider"), f = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), I = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), l = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), q = Symbol.for("react.offscreen"), W = Symbol.iterator, K = "@@iterator";
46
+ function J(e) {
47
+ if (e === null || typeof e != "object")
48
+ return null;
49
+ var i = W && e[W] || e[K];
50
+ return typeof i == "function" ? i : null;
51
+ }
52
+ var N = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
53
+ function S(e) {
54
+ {
55
+ for (var i = arguments.length, s = new Array(i > 1 ? i - 1 : 0), p = 1; p < i; p++)
56
+ s[p - 1] = arguments[p];
57
+ M("error", e, s);
58
+ }
59
+ }
60
+ function M(e, i, s) {
61
+ {
62
+ var p = N.ReactDebugCurrentFrame, T = p.getStackAddendum();
63
+ T !== "" && (i += "%s", s = s.concat([T]));
64
+ var w = s.map(function(v) {
65
+ return String(v);
66
+ });
67
+ w.unshift("Warning: " + i), Function.prototype.apply.call(console[e], console, w);
68
+ }
69
+ }
70
+ var _ = !1, A = !1, H = !1, Y = !1, Z = !1, V;
71
+ V = Symbol.for("react.module.reference");
72
+ function L(e) {
73
+ return !!(typeof e == "string" || typeof e == "function" || e === a || e === u || Z || e === c || e === I || e === m || Y || e === q || _ || A || H || typeof e == "object" && e !== null && (e.$$typeof === E || e.$$typeof === l || e.$$typeof === d || e.$$typeof === f || e.$$typeof === g || // This needs to include all possible module reference object
74
+ // types supported by any Flight configuration anywhere since
75
+ // we don't know which Flight build this will end up being used
76
+ // with.
77
+ e.$$typeof === V || e.getModuleId !== void 0));
78
+ }
79
+ function U(e, i, s) {
80
+ var p = e.displayName;
81
+ if (p)
82
+ return p;
83
+ var T = i.displayName || i.name || "";
84
+ return T !== "" ? s + "(" + T + ")" : s;
85
+ }
86
+ function te(e) {
87
+ return e.displayName || "Context";
88
+ }
89
+ function C(e) {
90
+ if (e == null)
91
+ return null;
92
+ if (typeof e.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
93
+ return e.displayName || e.name || null;
94
+ if (typeof e == "string")
95
+ return e;
96
+ switch (e) {
97
+ case a:
98
+ return "Fragment";
99
+ case o:
100
+ return "Portal";
101
+ case u:
102
+ return "Profiler";
103
+ case c:
104
+ return "StrictMode";
105
+ case I:
106
+ return "Suspense";
107
+ case m:
108
+ return "SuspenseList";
109
+ }
110
+ if (typeof e == "object")
111
+ switch (e.$$typeof) {
112
+ case f:
113
+ var i = e;
114
+ return te(i) + ".Consumer";
115
+ case d:
116
+ var s = e;
117
+ return te(s._context) + ".Provider";
118
+ case g:
119
+ return U(e, e.render, "ForwardRef");
120
+ case l:
121
+ var p = e.displayName || null;
122
+ return p !== null ? p : C(e.type) || "Memo";
123
+ case E: {
124
+ var T = e, w = T._payload, v = T._init;
125
+ try {
126
+ return C(v(w));
127
+ } catch {
128
+ return null;
129
+ }
130
+ }
131
+ }
132
+ return null;
133
+ }
134
+ var y = Object.assign, k = 0, D, F, ie, z, ce, ue, se;
135
+ function de() {
136
+ }
137
+ de.__reactDisabledLog = !0;
138
+ function ae() {
139
+ {
140
+ if (k === 0) {
141
+ D = console.log, F = console.info, ie = console.warn, z = console.error, ce = console.group, ue = console.groupCollapsed, se = console.groupEnd;
142
+ var e = {
143
+ configurable: !0,
144
+ enumerable: !0,
145
+ value: de,
146
+ writable: !0
147
+ };
148
+ Object.defineProperties(console, {
149
+ info: e,
150
+ log: e,
151
+ warn: e,
152
+ error: e,
153
+ group: e,
154
+ groupCollapsed: e,
155
+ groupEnd: e
156
+ });
157
+ }
158
+ k++;
159
+ }
160
+ }
161
+ function h() {
162
+ {
163
+ if (k--, k === 0) {
164
+ var e = {
165
+ configurable: !0,
166
+ enumerable: !0,
167
+ writable: !0
168
+ };
169
+ Object.defineProperties(console, {
170
+ log: y({}, e, {
171
+ value: D
172
+ }),
173
+ info: y({}, e, {
174
+ value: F
175
+ }),
176
+ warn: y({}, e, {
177
+ value: ie
178
+ }),
179
+ error: y({}, e, {
180
+ value: z
181
+ }),
182
+ group: y({}, e, {
183
+ value: ce
184
+ }),
185
+ groupCollapsed: y({}, e, {
186
+ value: ue
187
+ }),
188
+ groupEnd: y({}, e, {
189
+ value: se
190
+ })
191
+ });
192
+ }
193
+ k < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
194
+ }
195
+ }
196
+ var b = N.ReactCurrentDispatcher, R;
197
+ function O(e, i, s) {
198
+ {
199
+ if (R === void 0)
200
+ try {
201
+ throw Error();
202
+ } catch (T) {
203
+ var p = T.stack.trim().match(/\n( *(at )?)/);
204
+ R = p && p[1] || "";
205
+ }
206
+ return `
207
+ ` + R + e;
208
+ }
209
+ }
210
+ var P = !1, j;
211
+ {
212
+ var Ae = typeof WeakMap == "function" ? WeakMap : Map;
213
+ j = new Ae();
214
+ }
215
+ function me(e, i) {
216
+ if (!e || P)
217
+ return "";
218
+ {
219
+ var s = j.get(e);
220
+ if (s !== void 0)
221
+ return s;
222
+ }
223
+ var p;
224
+ P = !0;
225
+ var T = Error.prepareStackTrace;
226
+ Error.prepareStackTrace = void 0;
227
+ var w;
228
+ w = b.current, b.current = null, ae();
229
+ try {
230
+ if (i) {
231
+ var v = function() {
232
+ throw Error();
233
+ };
234
+ if (Object.defineProperty(v.prototype, "props", {
235
+ set: function() {
236
+ throw Error();
237
+ }
238
+ }), typeof Reflect == "object" && Reflect.construct) {
239
+ try {
240
+ Reflect.construct(v, []);
241
+ } catch (X) {
242
+ p = X;
243
+ }
244
+ Reflect.construct(e, [], v);
245
+ } else {
246
+ try {
247
+ v.call();
248
+ } catch (X) {
249
+ p = X;
250
+ }
251
+ e.call(v.prototype);
252
+ }
253
+ } else {
254
+ try {
255
+ throw Error();
256
+ } catch (X) {
257
+ p = X;
258
+ }
259
+ e();
260
+ }
261
+ } catch (X) {
262
+ if (X && p && typeof X.stack == "string") {
263
+ for (var x = X.stack.split(`
264
+ `), $ = p.stack.split(`
265
+ `), B = x.length - 1, G = $.length - 1; B >= 1 && G >= 0 && x[B] !== $[G]; )
266
+ G--;
267
+ for (; B >= 1 && G >= 0; B--, G--)
268
+ if (x[B] !== $[G]) {
269
+ if (B !== 1 || G !== 1)
270
+ do
271
+ if (B--, G--, G < 0 || x[B] !== $[G]) {
272
+ var ee = `
273
+ ` + x[B].replace(" at new ", " at ");
274
+ return e.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", e.displayName)), typeof e == "function" && j.set(e, ee), ee;
275
+ }
276
+ while (B >= 1 && G >= 0);
277
+ break;
278
+ }
279
+ }
280
+ } finally {
281
+ P = !1, b.current = w, h(), Error.prepareStackTrace = T;
282
+ }
283
+ var ve = e ? e.displayName || e.name : "", he = ve ? O(ve) : "";
284
+ return typeof e == "function" && j.set(e, he), he;
285
+ }
286
+ function fe(e, i, s) {
287
+ return me(e, !1);
288
+ }
289
+ function ye(e) {
290
+ var i = e.prototype;
291
+ return !!(i && i.isReactComponent);
292
+ }
293
+ function Q(e, i, s) {
294
+ if (e == null)
295
+ return "";
296
+ if (typeof e == "function")
297
+ return me(e, ye(e));
298
+ if (typeof e == "string")
299
+ return O(e);
300
+ switch (e) {
301
+ case I:
302
+ return O("Suspense");
303
+ case m:
304
+ return O("SuspenseList");
305
+ }
306
+ if (typeof e == "object")
307
+ switch (e.$$typeof) {
308
+ case g:
309
+ return fe(e.render);
310
+ case l:
311
+ return Q(e.type, i, s);
312
+ case E: {
313
+ var p = e, T = p._payload, w = p._init;
314
+ try {
315
+ return Q(w(T), i, s);
316
+ } catch {
317
+ }
318
+ }
319
+ }
320
+ return "";
321
+ }
322
+ var be = Object.prototype.hasOwnProperty, Be = {}, Ne = N.ReactDebugCurrentFrame;
323
+ function xe(e) {
324
+ if (e) {
325
+ var i = e._owner, s = Q(e.type, e._source, i ? i.type : null);
326
+ Ne.setExtraStackFrame(s);
327
+ } else
328
+ Ne.setExtraStackFrame(null);
329
+ }
330
+ function Te(e, i, s, p, T) {
331
+ {
332
+ var w = Function.call.bind(be);
333
+ for (var v in e)
334
+ if (w(e, v)) {
335
+ var x = void 0;
336
+ try {
337
+ if (typeof e[v] != "function") {
338
+ var $ = Error((p || "React class") + ": " + s + " type `" + v + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[v] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
339
+ throw $.name = "Invariant Violation", $;
340
+ }
341
+ x = e[v](i, v, p, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
342
+ } catch (B) {
343
+ x = B;
344
+ }
345
+ x && !(x instanceof Error) && (xe(T), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", p || "React class", s, v, typeof x), xe(null)), x instanceof Error && !(x.message in Be) && (Be[x.message] = !0, xe(T), S("Failed %s type: %s", s, x.message), xe(null));
346
+ }
347
+ }
348
+ }
349
+ var Le = Array.isArray;
350
+ function Se(e) {
351
+ return Le(e);
352
+ }
353
+ function Oe(e) {
354
+ {
355
+ var i = typeof Symbol == "function" && Symbol.toStringTag, s = i && e[Symbol.toStringTag] || e.constructor.name || "Object";
356
+ return s;
357
+ }
358
+ }
359
+ function De(e) {
360
+ try {
361
+ return we(e), !1;
362
+ } catch {
363
+ return !0;
364
+ }
365
+ }
366
+ function we(e) {
367
+ return "" + e;
368
+ }
369
+ function Qe(e) {
370
+ if (De(e))
371
+ return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Oe(e)), we(e);
372
+ }
373
+ var et = N.ReactCurrentOwner, jt = {
374
+ key: !0,
375
+ ref: !0,
376
+ __self: !0,
377
+ __source: !0
378
+ }, tt, rt;
379
+ function It(e) {
380
+ if (be.call(e, "ref")) {
381
+ var i = Object.getOwnPropertyDescriptor(e, "ref").get;
382
+ if (i && i.isReactWarning)
383
+ return !1;
384
+ }
385
+ return e.ref !== void 0;
386
+ }
387
+ function kt(e) {
388
+ if (be.call(e, "key")) {
389
+ var i = Object.getOwnPropertyDescriptor(e, "key").get;
390
+ if (i && i.isReactWarning)
391
+ return !1;
392
+ }
393
+ return e.key !== void 0;
394
+ }
395
+ function At(e, i) {
396
+ typeof e.ref == "string" && et.current;
397
+ }
398
+ function Bt(e, i) {
399
+ {
400
+ var s = function() {
401
+ tt || (tt = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", i));
402
+ };
403
+ s.isReactWarning = !0, Object.defineProperty(e, "key", {
404
+ get: s,
405
+ configurable: !0
406
+ });
407
+ }
408
+ }
409
+ function Nt(e, i) {
410
+ {
411
+ var s = function() {
412
+ rt || (rt = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", i));
413
+ };
414
+ s.isReactWarning = !0, Object.defineProperty(e, "ref", {
415
+ get: s,
416
+ configurable: !0
417
+ });
418
+ }
419
+ }
420
+ var Dt = function(e, i, s, p, T, w, v) {
421
+ var x = {
422
+ // This tag allows us to uniquely identify this as a React Element
423
+ $$typeof: r,
424
+ // Built-in properties that belong on the element
425
+ type: e,
426
+ key: i,
427
+ ref: s,
428
+ props: v,
429
+ // Record the component responsible for creating this element.
430
+ _owner: w
431
+ };
432
+ return x._store = {}, Object.defineProperty(x._store, "validated", {
433
+ configurable: !1,
434
+ enumerable: !1,
435
+ writable: !0,
436
+ value: !1
437
+ }), Object.defineProperty(x, "_self", {
438
+ configurable: !1,
439
+ enumerable: !1,
440
+ writable: !1,
441
+ value: p
442
+ }), Object.defineProperty(x, "_source", {
443
+ configurable: !1,
444
+ enumerable: !1,
445
+ writable: !1,
446
+ value: T
447
+ }), Object.freeze && (Object.freeze(x.props), Object.freeze(x)), x;
448
+ };
449
+ function Gt(e, i, s, p, T) {
450
+ {
451
+ var w, v = {}, x = null, $ = null;
452
+ s !== void 0 && (Qe(s), x = "" + s), kt(i) && (Qe(i.key), x = "" + i.key), It(i) && ($ = i.ref, At(i, T));
453
+ for (w in i)
454
+ be.call(i, w) && !jt.hasOwnProperty(w) && (v[w] = i[w]);
455
+ if (e && e.defaultProps) {
456
+ var B = e.defaultProps;
457
+ for (w in B)
458
+ v[w] === void 0 && (v[w] = B[w]);
459
+ }
460
+ if (x || $) {
461
+ var G = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
462
+ x && Bt(v, G), $ && Nt(v, G);
463
+ }
464
+ return Dt(e, x, $, T, p, et.current, v);
465
+ }
466
+ }
467
+ var $e = N.ReactCurrentOwner, nt = N.ReactDebugCurrentFrame;
468
+ function Ee(e) {
469
+ if (e) {
470
+ var i = e._owner, s = Q(e.type, e._source, i ? i.type : null);
471
+ nt.setExtraStackFrame(s);
472
+ } else
473
+ nt.setExtraStackFrame(null);
474
+ }
475
+ var Me;
476
+ Me = !1;
477
+ function He(e) {
478
+ return typeof e == "object" && e !== null && e.$$typeof === r;
479
+ }
480
+ function ot() {
481
+ {
482
+ if ($e.current) {
483
+ var e = C($e.current.type);
484
+ if (e)
485
+ return `
486
+
487
+ Check the render method of \`` + e + "`.";
488
+ }
489
+ return "";
490
+ }
491
+ }
492
+ function Wt(e) {
493
+ return "";
494
+ }
495
+ var it = {};
496
+ function Ft(e) {
497
+ {
498
+ var i = ot();
499
+ if (!i) {
500
+ var s = typeof e == "string" ? e : e.displayName || e.name;
501
+ s && (i = `
502
+
503
+ Check the top-level render call using <` + s + ">.");
504
+ }
505
+ return i;
506
+ }
507
+ }
508
+ function st(e, i) {
509
+ {
510
+ if (!e._store || e._store.validated || e.key != null)
511
+ return;
512
+ e._store.validated = !0;
513
+ var s = Ft(i);
514
+ if (it[s])
515
+ return;
516
+ it[s] = !0;
517
+ var p = "";
518
+ e && e._owner && e._owner !== $e.current && (p = " It was passed a child from " + C(e._owner.type) + "."), Ee(e), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, p), Ee(null);
519
+ }
520
+ }
521
+ function at(e, i) {
522
+ {
523
+ if (typeof e != "object")
524
+ return;
525
+ if (Se(e))
526
+ for (var s = 0; s < e.length; s++) {
527
+ var p = e[s];
528
+ He(p) && st(p, i);
529
+ }
530
+ else if (He(e))
531
+ e._store && (e._store.validated = !0);
532
+ else if (e) {
533
+ var T = J(e);
534
+ if (typeof T == "function" && T !== e.entries)
535
+ for (var w = T.call(e), v; !(v = w.next()).done; )
536
+ He(v.value) && st(v.value, i);
537
+ }
538
+ }
539
+ }
540
+ function Pt(e) {
541
+ {
542
+ var i = e.type;
543
+ if (i == null || typeof i == "string")
544
+ return;
545
+ var s;
546
+ if (typeof i == "function")
547
+ s = i.propTypes;
548
+ else if (typeof i == "object" && (i.$$typeof === g || // Note: Memo only checks outer props here.
549
+ // Inner props are checked in the reconciler.
550
+ i.$$typeof === l))
551
+ s = i.propTypes;
552
+ else
553
+ return;
554
+ if (s) {
555
+ var p = C(i);
556
+ Te(s, e.props, "prop", p, e);
557
+ } else if (i.PropTypes !== void 0 && !Me) {
558
+ Me = !0;
559
+ var T = C(i);
560
+ S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
561
+ }
562
+ typeof i.getDefaultProps == "function" && !i.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
563
+ }
564
+ }
565
+ function Lt(e) {
566
+ {
567
+ for (var i = Object.keys(e.props), s = 0; s < i.length; s++) {
568
+ var p = i[s];
569
+ if (p !== "children" && p !== "key") {
570
+ Ee(e), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", p), Ee(null);
571
+ break;
572
+ }
573
+ }
574
+ e.ref !== null && (Ee(e), S("Invalid attribute `ref` supplied to `React.Fragment`."), Ee(null));
575
+ }
576
+ }
577
+ var lt = {};
578
+ function ct(e, i, s, p, T, w) {
579
+ {
580
+ var v = L(e);
581
+ if (!v) {
582
+ var x = "";
583
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (x += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
584
+ var $ = Wt();
585
+ $ ? x += $ : x += ot();
586
+ var B;
587
+ e === null ? B = "null" : Se(e) ? B = "array" : e !== void 0 && e.$$typeof === r ? (B = "<" + (C(e.type) || "Unknown") + " />", x = " Did you accidentally export a JSX literal instead of a component?") : B = typeof e, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", B, x);
588
+ }
589
+ var G = Gt(e, i, s, T, w);
590
+ if (G == null)
591
+ return G;
592
+ if (v) {
593
+ var ee = i.children;
594
+ if (ee !== void 0)
595
+ if (p)
596
+ if (Se(ee)) {
597
+ for (var ve = 0; ve < ee.length; ve++)
598
+ at(ee[ve], e);
599
+ Object.freeze && Object.freeze(ee);
600
+ } else
601
+ S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
602
+ else
603
+ at(ee, e);
604
+ }
605
+ if (be.call(i, "key")) {
606
+ var he = C(e), X = Object.keys(i).filter(function(zt) {
607
+ return zt !== "key";
608
+ }), Ve = X.length > 0 ? "{key: someKey, " + X.join(": ..., ") + ": ...}" : "{key: someKey}";
609
+ if (!lt[he + Ve]) {
610
+ var Ut = X.length > 0 ? "{" + X.join(": ..., ") + ": ...}" : "{}";
611
+ S(`A props object containing a "key" prop is being spread into JSX:
612
+ let props = %s;
613
+ <%s {...props} />
614
+ React keys must be passed directly to JSX without using spread:
615
+ let props = %s;
616
+ <%s key={someKey} {...props} />`, Ve, he, Ut, he), lt[he + Ve] = !0;
617
+ }
618
+ }
619
+ return e === a ? Lt(G) : Pt(G), G;
620
+ }
621
+ }
622
+ function $t(e, i, s) {
623
+ return ct(e, i, s, !0);
624
+ }
625
+ function Mt(e, i, s) {
626
+ return ct(e, i, s, !1);
627
+ }
628
+ var Ht = Mt, Vt = $t;
629
+ je.Fragment = a, je.jsx = Ht, je.jsxs = Vt;
630
+ }()), je;
631
+ }
632
+ process.env.NODE_ENV === "production" ? qe.exports = tr() : qe.exports = rr();
633
+ var n = qe.exports;
634
+ const oe = {
635
+ WIDTH: 280,
636
+ HEIGHT: 112
637
+ }, Rt = {
638
+ BASE_BG: "#ffffff",
639
+ SURFACE_BG: "#f7f6f3",
640
+ HEADER_BG: "#ffffff",
641
+ HEADER_TITLE: "#2d2d2d",
642
+ HEADER_MUTED: "#6b6b6b",
643
+ HEADER_BORDER: "#ece9e2",
644
+ ICON_BG: "#7c9070",
645
+ ICON_FG: "#ffffff",
646
+ BADGE_BG: "#f1eee8",
647
+ BADGE_DOT: "#7c9070",
648
+ BADGE_TEXT: "#6b6b6b",
649
+ HOVER_BG: "#faf8f2",
650
+ CREST_BG: "#c9b8a8",
651
+ CREST_TEXT: "#5d4d3f",
652
+ WINNER_CREST_BG: "#7c9070",
653
+ WINNER_CREST_TEXT: "#ffffff",
654
+ ROW_BG: "#ffffff",
655
+ ROW_BG_WINNER: "#ffffff",
656
+ ROW_HOVER_BG: "#f7f3ec",
657
+ FOREGROUND: "#2d2d2d",
658
+ MUTED_TEXT: "#8e8e93",
659
+ DARK_TEXT: "#2d2d2d",
660
+ BORDER: "#f0efec",
661
+ DARK_BORDER: "#e5e4e1",
662
+ CARD_BORDER: "#d9d6cf",
663
+ WINNER_ACCENT: "#2d2d2d",
664
+ WINNING_SCORE: "#2d2d2d",
665
+ LIVE_WINNING_SCORE: "#2d2d2d",
666
+ LIVE_INDICATOR: "#d97706",
667
+ UPCOMING_TEXT: "#b0aba3",
668
+ EDGE_COLOR: "#d9d6cf",
669
+ LABEL_TEXT: "#8e8e93",
670
+ TOOLBAR_BG: "#f7f3ec",
671
+ TOOLBAR_BORDER: "#e4ded2",
672
+ TOOLBAR_ICON: "#4b5563",
673
+ TOOLBAR_ICON_ACTIVE: "#2d2d2d",
674
+ SHADOW: "0 20px 48px rgba(45, 45, 45, 0.08)",
675
+ CARD_SHADOW: "0 10px 24px rgba(45, 45, 45, 0.06)"
676
+ }, nr = {
677
+ BASE_BG: "#1f242b",
678
+ SURFACE_BG: "#191e24",
679
+ HEADER_BG: "#232931",
680
+ HEADER_TITLE: "#f7f5ef",
681
+ HEADER_MUTED: "#c4beb1",
682
+ HEADER_BORDER: "#313844",
683
+ ICON_BG: "#7c9070",
684
+ ICON_FG: "#ffffff",
685
+ BADGE_BG: "#232b33",
686
+ BADGE_DOT: "#9ab08d",
687
+ BADGE_TEXT: "#d8d2c7",
688
+ HOVER_BG: "#242b33",
689
+ CREST_BG: "#53473e",
690
+ CREST_TEXT: "#efe7db",
691
+ WINNER_CREST_BG: "#8da180",
692
+ WINNER_CREST_TEXT: "#09120a",
693
+ ROW_BG: "#232931",
694
+ ROW_BG_WINNER: "#232931",
695
+ ROW_HOVER_BG: "#2a313a",
696
+ FOREGROUND: "#f7f5ef",
697
+ MUTED_TEXT: "#a7aaaf",
698
+ DARK_TEXT: "#f7f5ef",
699
+ BORDER: "#313844",
700
+ DARK_BORDER: "#47515f",
701
+ CARD_BORDER: "#5d6470",
702
+ WINNER_ACCENT: "#f7f5ef",
703
+ WINNING_SCORE: "#f7f5ef",
704
+ LIVE_WINNING_SCORE: "#f7f5ef",
705
+ LIVE_INDICATOR: "#f59e0b",
706
+ UPCOMING_TEXT: "#70757d",
707
+ EDGE_COLOR: "#5d6470",
708
+ LABEL_TEXT: "#a7aaaf",
709
+ TOOLBAR_BG: "#232b33",
710
+ TOOLBAR_BORDER: "#38424d",
711
+ TOOLBAR_ICON: "#d7d1c6",
712
+ TOOLBAR_ICON_ACTIVE: "#ffffff",
713
+ SHADOW: "0 22px 54px rgba(0, 0, 0, 0.28)",
714
+ CARD_SHADOW: "0 12px 32px rgba(0, 0, 0, 0.24)"
715
+ }, Ke = [
716
+ { name: "TBD", seed: 0 },
717
+ { name: "TBD", seed: 0 }
718
+ ], _t = {
719
+ layout: Jt.Tree,
720
+ layoutDirection: Kt.LTR,
721
+ width: 1600,
722
+ height: 1200,
723
+ padding: 40,
724
+ defaultEdgeType: qt.Undirected,
725
+ routingStyle: "orthogonal",
726
+ curveEdges: !1,
727
+ curveStrength: 0,
728
+ forceRightToLeft: !0,
729
+ hoverHighlight: !1,
730
+ hoverEdgeColor: "#7c9070",
731
+ hoverNodeInColor: "#7c9070",
732
+ hoverNodeOutColor: "#7c9070",
733
+ hoverNodeBothColor: "#7c9070",
734
+ theme: {
735
+ background: "#f7f6f3",
736
+ edgeColor: "#d9d6cf",
737
+ edgeWidth: 2,
738
+ nodeGap: 72,
739
+ fontFamily: '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif'
740
+ },
741
+ fixedNodeSize: {
742
+ width: oe.WIDTH,
743
+ height: oe.HEIGHT
744
+ },
745
+ labelOffset: 46,
746
+ labelPillBackground: "transparent",
747
+ labelPillBorderColor: "transparent",
748
+ labelPillTextColor: "#444b55"
749
+ }, or = {
750
+ ..._t,
751
+ hoverEdgeColor: "#9ab08d",
752
+ hoverNodeInColor: "#9ab08d",
753
+ hoverNodeOutColor: "#9ab08d",
754
+ hoverNodeBothColor: "#9ab08d",
755
+ labelPillBackground: "transparent",
756
+ labelPillBorderColor: "transparent",
757
+ labelPillTextColor: "#d8d2c7",
758
+ theme: {
759
+ background: "#191e24",
760
+ edgeColor: "#5d6470",
761
+ edgeWidth: 2,
762
+ nodeGap: 72,
763
+ fontFamily: '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif'
764
+ }
765
+ }, Tt = re.createContext({
766
+ mode: "light",
767
+ colors: Rt
768
+ }), St = () => re.useContext(Tt), pt = ({ mode: t, children: r }) => {
769
+ const o = re.useMemo(
770
+ () => ({
771
+ mode: t,
772
+ colors: t === "dark" ? nr : Rt
773
+ }),
774
+ [t]
775
+ );
776
+ return /* @__PURE__ */ n.jsx(Tt.Provider, { value: o, children: r });
777
+ }, Ot = (t) => t === "svg" || t === "export" || t === "server", gt = '"Space Mono", "SFMono-Regular", ui-monospace, monospace', le = '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif', Re = 16, Fe = 5, Ue = 10, mt = 2, ke = (t, r) => t.length <= r ? t : `${t.slice(0, Math.max(0, r - 1))}…`, ir = (t) => t === "completed" || t === "live" || t === "upcoming", ze = (t) => t.trim().toLowerCase(), yt = (t, r) => {
778
+ var a;
779
+ if (!t || typeof t != "object")
780
+ throw new TypeError(`Invalid squash match payload: ${r} must be an object.`);
781
+ const o = t;
782
+ if (typeof o.name != "string" || !o.name.trim())
783
+ throw new TypeError(`Invalid squash match payload: ${r}.name must be a non-empty string.`);
784
+ if (o.seed != null && (typeof o.seed != "number" || !Number.isFinite(o.seed)))
785
+ throw new TypeError(`Invalid squash match payload: ${r}.seed must be a finite number.`);
786
+ if (o.country != null && (typeof o.country != "string" || !o.country.trim()))
787
+ throw new TypeError(
788
+ `Invalid squash match payload: ${r}.country must be a non-empty string when provided.`
789
+ );
790
+ return {
791
+ name: o.name.trim(),
792
+ seed: o.seed,
793
+ country: (a = o.country) == null ? void 0 : a.trim()
794
+ };
795
+ }, sr = (t) => {
796
+ if (t == null)
797
+ return [Ke[0], Ke[1]];
798
+ if (!Array.isArray(t) || t.length !== 2)
799
+ throw new TypeError("Invalid squash match payload: players must contain exactly two entries.");
800
+ return [yt(t[0], "players[0]"), yt(t[1], "players[1]")];
801
+ }, Pe = (t, r) => {
802
+ if (typeof t != "number" || !Number.isFinite(t) || t < 0)
803
+ throw new TypeError(`Invalid squash match payload: ${r} must be a non-negative number.`);
804
+ return t;
805
+ }, ar = (t) => {
806
+ if (t == null)
807
+ return [];
808
+ if (!Array.isArray(t))
809
+ throw new TypeError("Invalid squash match payload: sets must be an array of score pairs.");
810
+ return t.map((r, o) => {
811
+ if (!Array.isArray(r) || r.length !== 2)
812
+ throw new TypeError(
813
+ `Invalid squash match payload: sets[${o}] must contain exactly two scores.`
814
+ );
815
+ return [
816
+ Pe(r[0], `sets[${o}][0]`),
817
+ Pe(r[1], `sets[${o}][1]`)
818
+ ];
819
+ });
820
+ }, lr = (t) => {
821
+ if (t == null)
822
+ return [];
823
+ if (!Array.isArray(t))
824
+ throw new TypeError(
825
+ "Invalid squash match payload: tiebreaks must be an array of score pairs or null entries."
826
+ );
827
+ return t.map((r, o) => {
828
+ if (r == null)
829
+ return null;
830
+ if (!Array.isArray(r) || r.length !== 2)
831
+ throw new TypeError(
832
+ `Invalid squash match payload: tiebreaks[${o}] must contain exactly two scores or be null.`
833
+ );
834
+ return [
835
+ Pe(r[0], `tiebreaks[${o}][0]`),
836
+ Pe(r[1], `tiebreaks[${o}][1]`)
837
+ ];
838
+ });
839
+ }, cr = (t) => {
840
+ if (t != null && typeof t != "object")
841
+ throw new TypeError("Invalid squash match payload: node meta must be an object when provided.");
842
+ const r = t;
843
+ if ((r == null ? void 0 : r.status) != null && !ir(r.status))
844
+ throw new TypeError(
845
+ "Invalid squash match payload: status must be one of completed, live, or upcoming."
846
+ );
847
+ const o = ar(r == null ? void 0 : r.sets);
848
+ return {
849
+ stage: typeof (r == null ? void 0 : r.stage) == "string" && r.stage.trim() ? r.stage.trim() : "Stage",
850
+ players: sr(r == null ? void 0 : r.players),
851
+ sets: o,
852
+ tiebreaks: lr(r == null ? void 0 : r.tiebreaks),
853
+ status: (r == null ? void 0 : r.status) ?? "completed",
854
+ currentSet: (r == null ? void 0 : r.currentSet) == null ? 0 : typeof r.currentSet == "number" && Number.isFinite(r.currentSet) ? Math.max(0, Math.min(Math.floor(r.currentSet), Math.max(o.length - 1, 0))) : (() => {
855
+ throw new TypeError(
856
+ "Invalid squash match payload: currentSet must be a finite number when provided."
857
+ );
858
+ })()
859
+ };
860
+ };
861
+ function ur() {
862
+ if (typeof document > "u" || document.querySelector("style[data-squash-node-animations]"))
863
+ return;
864
+ const t = document.createElement("style");
865
+ t.setAttribute("data-squash-node-animations", "true"), t.textContent = `
866
+ @keyframes pulse {
867
+ 0%, 100% {
868
+ opacity: 1;
869
+ }
870
+ 50% {
871
+ opacity: 0.5;
872
+ }
873
+ }
874
+ `, document.head.appendChild(t);
875
+ }
876
+ const bt = (t) => t.name.split(/\s+/).filter(Boolean).slice(0, 2).map((o) => {
877
+ var a;
878
+ return ((a = o[0]) == null ? void 0 : a.toUpperCase()) ?? "";
879
+ }).join("") || "–", dr = (t, r, o) => t.map((a, c) => {
880
+ const u = a[o];
881
+ if (!Number.isFinite(u))
882
+ return "—";
883
+ const d = r[c], f = d == null ? void 0 : d[o];
884
+ return typeof f == "number" && Number.isFinite(f) && f > 0 ? `${u}(${f})` : String(u);
885
+ }), xt = (t, r, o) => {
886
+ const a = dr(t, r, o);
887
+ return a.length ? a : ["—"];
888
+ }, Xe = (t) => t <= 0 ? Re : t * Re + Math.max(0, t - 1) * Fe, fr = (t, r) => r !== "completed" || t.p1 === t.p2 ? null : t.p1 > t.p2 ? 0 : 1;
889
+ class hr extends re.Component {
890
+ constructor() {
891
+ super(...arguments);
892
+ ut(this, "state", { error: null });
893
+ }
894
+ static getDerivedStateFromError(o) {
895
+ return { error: o };
896
+ }
897
+ componentDidCatch(o) {
898
+ var a, c;
899
+ (c = (a = this.props).onRenderError) == null || c.call(a, this.props.nodeId, o);
900
+ }
901
+ componentDidUpdate(o) {
902
+ this.state.error && (o.nodeId !== this.props.nodeId || o.children !== this.props.children) && this.setState({ error: null });
903
+ }
904
+ render() {
905
+ return this.state.error ? pr(
906
+ this.props.width,
907
+ this.props.height,
908
+ this.props.renderMode,
909
+ this.props.nodeId
910
+ ) : this.props.children;
911
+ }
912
+ }
913
+ const pr = (t, r, o, a) => Ot(o) ? /* @__PURE__ */ n.jsxs("g", { children: [
914
+ /* @__PURE__ */ n.jsx("rect", { width: t, height: r, rx: 16, ry: 16, fill: "#fff7ed", stroke: "#f97316", strokeWidth: 2 }),
915
+ /* @__PURE__ */ n.jsx("text", { x: 16, y: 34, fontSize: 13, fontWeight: 700, fill: "#9a3412", fontFamily: le, children: "Invalid match data" }),
916
+ /* @__PURE__ */ n.jsx("text", { x: 16, y: 56, fontSize: 11, fill: "#c2410c", fontFamily: le, children: ke(a, 28) })
917
+ ] }) : /* @__PURE__ */ n.jsx("foreignObject", { width: t, height: r, requiredExtensions: "http://www.w3.org/1999/xhtml", children: /* @__PURE__ */ n.jsxs(
918
+ "div",
919
+ {
920
+ style: {
921
+ boxSizing: "border-box",
922
+ width: "100%",
923
+ height: "100%",
924
+ borderRadius: 16,
925
+ border: "2px solid #f97316",
926
+ background: "#fff7ed",
927
+ color: "#9a3412",
928
+ padding: "16px 14px",
929
+ display: "flex",
930
+ flexDirection: "column",
931
+ justifyContent: "center",
932
+ fontFamily: le
933
+ },
934
+ children: [
935
+ /* @__PURE__ */ n.jsx("div", { style: { fontSize: 13, fontWeight: 700 }, children: "Invalid match data" }),
936
+ /* @__PURE__ */ n.jsx("div", { style: { marginTop: 6, fontSize: 11, color: "#c2410c" }, children: ke(a, 28) })
937
+ ]
938
+ }
939
+ ) }), gr = re.memo(function({
940
+ node: r,
941
+ isHovered: o,
942
+ activePathKey: a,
943
+ activePathNodeIds: c,
944
+ onPathHover: u,
945
+ onPathLeave: d,
946
+ renderMode: f = "export",
947
+ onRenderError: g
948
+ }) {
949
+ var U, te;
950
+ const [I, m] = pe(null);
951
+ Ie(() => {
952
+ f === "html" && ur();
953
+ }, [f]);
954
+ const { colors: l } = St(), E = cr(r.meta), [q, W] = E.players ?? Ke, K = E.sets ?? [], J = E.tiebreaks ?? [], N = E.status ?? "completed", S = E.currentSet ?? 0, M = ((U = r.size) == null ? void 0 : U.width) ?? oe.WIDTH, _ = ((te = r.size) == null ? void 0 : te.height) ?? oe.HEIGHT, A = q.name === "TBD" || W.name === "TBD", H = a ? ze(a) : null, Y = (c == null ? void 0 : c.has(r.id)) ?? !1, Z = K.reduce(
955
+ (C, [y, k], D) => (N === "live" && D === S || (y > k ? C.p1 += 1 : k > y && (C.p2 += 1)), C),
956
+ { p1: 0, p2: 0 }
957
+ ), V = fr(Z, N), L = `${mt}px solid ${l.CARD_BORDER}`;
958
+ if (Ot(f)) {
959
+ const y = _ / 2, k = y, D = 28, F = Xe(Math.max(K.length, 1)), ie = 22, z = M - 14 - ie - 10, ce = z - 6, ue = M - 14 - ie / 2, se = 14 + D + 10, de = Math.max(56, z - se - F - 10), ae = Math.max(10, Math.floor(de / 7)), h = `ds-${r.id.replace(/[^a-z0-9]/gi, "")}`;
960
+ return /* @__PURE__ */ n.jsxs("g", { children: [
961
+ /* @__PURE__ */ n.jsx("defs", { children: /* @__PURE__ */ n.jsx("clipPath", { id: h, children: /* @__PURE__ */ n.jsx("rect", { width: M, height: _, rx: 16, ry: 16 }) }) }),
962
+ /* @__PURE__ */ n.jsx(
963
+ "rect",
964
+ {
965
+ width: M,
966
+ height: _,
967
+ rx: 16,
968
+ ry: 16,
969
+ fill: o ? l.HOVER_BG : l.BASE_BG,
970
+ stroke: l.CARD_BORDER,
971
+ strokeWidth: mt
972
+ }
973
+ ),
974
+ N === "live" && /* @__PURE__ */ n.jsx("g", { transform: `translate(${M - 18}, 14)`, children: /* @__PURE__ */ n.jsx("circle", { r: 4, fill: l.LIVE_INDICATOR }) }),
975
+ /* @__PURE__ */ n.jsxs("g", { clipPath: `url(#${h})`, children: [
976
+ [q, W].map((b, R) => {
977
+ const O = R * y, P = xt(K, J, R), j = Xe(P.length), Ae = ce - j, me = R === 0 ? Z.p1 : Z.p2, fe = V === R, ye = N === "upcoming" ? 0.6 : 1, Q = Y && H !== null && ze(b.name) === H, Be = I === R || Q ? l.ROW_HOVER_BG : l.ROW_BG, Ne = fe ? l.WINNER_CREST_BG : l.CREST_BG, xe = fe ? l.WINNER_CREST_TEXT : l.CREST_TEXT, Te = fe ? l.FOREGROUND : l.MUTED_TEXT, Le = bt(b);
978
+ return /* @__PURE__ */ n.jsxs(
979
+ "g",
980
+ {
981
+ transform: `translate(0, ${O})`,
982
+ opacity: ye,
983
+ onMouseEnter: () => {
984
+ m(R), A || u == null || u(R, { pathKey: b.name });
985
+ },
986
+ onMouseLeave: () => {
987
+ m(null), A || d == null || d();
988
+ },
989
+ children: [
990
+ /* @__PURE__ */ n.jsx("rect", { x: 0, width: M, height: y, fill: Be }),
991
+ /* @__PURE__ */ n.jsx(
992
+ "rect",
993
+ {
994
+ x: 14,
995
+ y: (y - D) / 2,
996
+ width: D,
997
+ height: D,
998
+ rx: 7,
999
+ ry: 7,
1000
+ fill: Ne
1001
+ }
1002
+ ),
1003
+ /* @__PURE__ */ n.jsx(
1004
+ "text",
1005
+ {
1006
+ x: 14 + D / 2,
1007
+ y: y / 2 + 4,
1008
+ textAnchor: "middle",
1009
+ fontSize: 12,
1010
+ fontWeight: 700,
1011
+ fill: xe,
1012
+ fontFamily: le,
1013
+ children: Le
1014
+ }
1015
+ ),
1016
+ /* @__PURE__ */ n.jsx(
1017
+ "text",
1018
+ {
1019
+ x: se,
1020
+ y: y / 2 + 4,
1021
+ fontSize: 13,
1022
+ fontWeight: fe ? 600 : 500,
1023
+ fill: Te,
1024
+ fontFamily: le,
1025
+ children: ke(b.name, ae)
1026
+ }
1027
+ ),
1028
+ /* @__PURE__ */ n.jsx(
1029
+ "line",
1030
+ {
1031
+ x1: z,
1032
+ y1: y / 2 - 9,
1033
+ x2: z,
1034
+ y2: y / 2 + 9,
1035
+ stroke: l.DARK_BORDER,
1036
+ strokeWidth: 1
1037
+ }
1038
+ ),
1039
+ P.map((Se, Oe) => {
1040
+ const De = Ae + Re / 2 + Oe * (Re + Fe), we = De + Re / 2 + Fe / 2;
1041
+ return /* @__PURE__ */ n.jsxs("g", { children: [
1042
+ /* @__PURE__ */ n.jsx(
1043
+ "text",
1044
+ {
1045
+ x: De,
1046
+ y: y / 2 + 1,
1047
+ textAnchor: "middle",
1048
+ dominantBaseline: "middle",
1049
+ fontSize: 10.5,
1050
+ fontWeight: 400,
1051
+ fill: Te,
1052
+ fontFamily: gt,
1053
+ children: ke(Se, 4)
1054
+ }
1055
+ ),
1056
+ Oe < P.length - 1 ? /* @__PURE__ */ n.jsx(
1057
+ "line",
1058
+ {
1059
+ x1: we,
1060
+ y1: y / 2 - Ue / 2,
1061
+ x2: we,
1062
+ y2: y / 2 + Ue / 2,
1063
+ stroke: l.BORDER,
1064
+ strokeWidth: 1
1065
+ }
1066
+ ) : null
1067
+ ] }, `${r.id}-svg-score-${R}-${Oe}`);
1068
+ }),
1069
+ /* @__PURE__ */ n.jsx(
1070
+ "text",
1071
+ {
1072
+ x: ue,
1073
+ y: y / 2 + 1,
1074
+ textAnchor: "middle",
1075
+ dominantBaseline: "middle",
1076
+ fontSize: 18,
1077
+ fontWeight: 700,
1078
+ fill: Te,
1079
+ fontFamily: le,
1080
+ children: me
1081
+ }
1082
+ )
1083
+ ]
1084
+ },
1085
+ `${r.id}-svg-p-${R}`
1086
+ );
1087
+ }),
1088
+ /* @__PURE__ */ n.jsx(
1089
+ "line",
1090
+ {
1091
+ x1: 0,
1092
+ y1: k,
1093
+ x2: M,
1094
+ y2: k,
1095
+ stroke: l.BORDER,
1096
+ strokeWidth: 1
1097
+ }
1098
+ )
1099
+ ] })
1100
+ ] });
1101
+ }
1102
+ return /* @__PURE__ */ n.jsx(
1103
+ "foreignObject",
1104
+ {
1105
+ width: M,
1106
+ height: _,
1107
+ requiredExtensions: "http://www.w3.org/1999/xhtml",
1108
+ children: /* @__PURE__ */ n.jsxs(
1109
+ "div",
1110
+ {
1111
+ style: {
1112
+ boxSizing: "border-box",
1113
+ width: "100%",
1114
+ height: "100%",
1115
+ borderRadius: 16,
1116
+ background: o ? l.HOVER_BG : l.BASE_BG,
1117
+ border: L,
1118
+ color: l.FOREGROUND,
1119
+ display: "flex",
1120
+ flexDirection: "column",
1121
+ transition: "background-color 120ms ease, box-shadow 120ms ease",
1122
+ transform: "none",
1123
+ overflow: "hidden",
1124
+ position: "relative"
1125
+ },
1126
+ children: [
1127
+ N === "live" && /* @__PURE__ */ n.jsx(
1128
+ "div",
1129
+ {
1130
+ style: {
1131
+ position: "absolute",
1132
+ top: 10,
1133
+ right: 12,
1134
+ display: "flex",
1135
+ alignItems: "center",
1136
+ gap: 4,
1137
+ fontSize: 10,
1138
+ fontWeight: 700,
1139
+ color: l.LIVE_INDICATOR,
1140
+ textTransform: "uppercase"
1141
+ },
1142
+ children: /* @__PURE__ */ n.jsx(
1143
+ "span",
1144
+ {
1145
+ style: {
1146
+ width: 10,
1147
+ height: 10,
1148
+ borderRadius: "50%",
1149
+ background: l.LIVE_INDICATOR,
1150
+ animation: "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"
1151
+ }
1152
+ }
1153
+ )
1154
+ }
1155
+ ),
1156
+ /* @__PURE__ */ n.jsx(
1157
+ "div",
1158
+ {
1159
+ style: {
1160
+ display: "grid",
1161
+ gridTemplateRows: "repeat(2, 1fr)"
1162
+ },
1163
+ children: [q, W].map((C, y) => {
1164
+ const k = bt(C), D = xt(K, J, y), F = Xe(Math.max(K.length, 1)), ie = y === 0 ? Z.p1 : Z.p2, z = V === y, ce = N === "upcoming" ? 0.6 : 1, ue = Y && H !== null && ze(C.name) === H, de = I === y || ue ? l.ROW_HOVER_BG : l.ROW_BG, ae = z ? l.FOREGROUND : l.MUTED_TEXT, h = z ? l.WINNER_CREST_BG : l.CREST_BG, b = z ? l.WINNER_CREST_TEXT : l.CREST_TEXT;
1165
+ return /* @__PURE__ */ n.jsxs(
1166
+ "div",
1167
+ {
1168
+ style: {
1169
+ display: "grid",
1170
+ gridTemplateColumns: `28px minmax(0, 1fr) ${F}px 24px`,
1171
+ alignItems: "center",
1172
+ gap: 8,
1173
+ padding: "14px 12px",
1174
+ minHeight: _ / 2,
1175
+ background: de,
1176
+ opacity: ce,
1177
+ transition: "background-color 140ms ease",
1178
+ borderTop: y === 1 ? `1px solid ${l.BORDER}` : "none",
1179
+ boxSizing: "border-box"
1180
+ },
1181
+ onMouseEnter: () => {
1182
+ m(y), A || u == null || u(y, { pathKey: C.name });
1183
+ },
1184
+ onMouseLeave: () => {
1185
+ m(null), A || d == null || d();
1186
+ },
1187
+ children: [
1188
+ /* @__PURE__ */ n.jsx(
1189
+ "div",
1190
+ {
1191
+ style: {
1192
+ width: 28,
1193
+ height: 28,
1194
+ borderRadius: 7,
1195
+ background: h,
1196
+ display: "grid",
1197
+ placeItems: "center",
1198
+ fontWeight: 700,
1199
+ color: b,
1200
+ fontSize: 12,
1201
+ flexShrink: 0,
1202
+ fontFamily: le
1203
+ },
1204
+ "aria-label": `crest-${C.name}`,
1205
+ children: k
1206
+ }
1207
+ ),
1208
+ /* @__PURE__ */ n.jsx(
1209
+ "div",
1210
+ {
1211
+ style: {
1212
+ display: "flex",
1213
+ flexDirection: "column",
1214
+ minWidth: 0
1215
+ },
1216
+ children: /* @__PURE__ */ n.jsx(
1217
+ "span",
1218
+ {
1219
+ style: {
1220
+ fontSize: 13,
1221
+ fontWeight: z ? 600 : 500,
1222
+ color: ae,
1223
+ overflow: "hidden",
1224
+ textOverflow: "ellipsis",
1225
+ whiteSpace: "nowrap",
1226
+ fontFamily: le
1227
+ },
1228
+ children: C.name
1229
+ }
1230
+ )
1231
+ }
1232
+ ),
1233
+ /* @__PURE__ */ n.jsx(
1234
+ "span",
1235
+ {
1236
+ style: {
1237
+ display: "flex",
1238
+ alignItems: "center",
1239
+ justifyContent: "flex-end",
1240
+ minWidth: 0,
1241
+ width: "100%",
1242
+ gap: Fe
1243
+ },
1244
+ children: D.map((R, O) => /* @__PURE__ */ n.jsxs(re.Fragment, { children: [
1245
+ /* @__PURE__ */ n.jsx(
1246
+ "span",
1247
+ {
1248
+ style: {
1249
+ width: Re,
1250
+ fontSize: 10.5,
1251
+ color: ae,
1252
+ fontFamily: gt,
1253
+ textAlign: "center",
1254
+ whiteSpace: "nowrap",
1255
+ flexShrink: 0
1256
+ },
1257
+ children: ke(R, 4)
1258
+ }
1259
+ ),
1260
+ O < D.length - 1 ? /* @__PURE__ */ n.jsx(
1261
+ "span",
1262
+ {
1263
+ style: {
1264
+ width: 1,
1265
+ height: Ue,
1266
+ background: l.BORDER,
1267
+ flexShrink: 0
1268
+ }
1269
+ }
1270
+ ) : null
1271
+ ] }, `${r.id}-html-score-${y}-${O}`))
1272
+ }
1273
+ ),
1274
+ /* @__PURE__ */ n.jsx(
1275
+ "span",
1276
+ {
1277
+ style: {
1278
+ display: "flex",
1279
+ alignItems: "center",
1280
+ justifyContent: "center",
1281
+ minHeight: 20,
1282
+ borderLeft: `1px solid ${l.DARK_BORDER}`,
1283
+ fontSize: 18,
1284
+ fontWeight: 700,
1285
+ color: ae,
1286
+ fontFamily: le,
1287
+ paddingLeft: 8
1288
+ },
1289
+ children: ie
1290
+ }
1291
+ )
1292
+ ]
1293
+ },
1294
+ `${r.id}-p-${y}`
1295
+ );
1296
+ })
1297
+ }
1298
+ )
1299
+ ]
1300
+ }
1301
+ )
1302
+ }
1303
+ );
1304
+ }), Je = re.memo(function({
1305
+ node: r,
1306
+ renderMode: o = "export",
1307
+ onRenderError: a,
1308
+ ...c
1309
+ }) {
1310
+ var f, g;
1311
+ const u = ((f = r.size) == null ? void 0 : f.width) ?? oe.WIDTH, d = ((g = r.size) == null ? void 0 : g.height) ?? oe.HEIGHT;
1312
+ return /* @__PURE__ */ n.jsx(
1313
+ hr,
1314
+ {
1315
+ nodeId: r.id,
1316
+ renderMode: o,
1317
+ width: u,
1318
+ height: d,
1319
+ onRenderError: a,
1320
+ children: /* @__PURE__ */ n.jsx(gr, { ...c, node: r, renderMode: o })
1321
+ }
1322
+ );
1323
+ });
1324
+ Je.displayName = "SquashNode";
1325
+ var Ze, We = Zt;
1326
+ if (process.env.NODE_ENV === "production")
1327
+ Ze = We.createRoot, We.hydrateRoot;
1328
+ else {
1329
+ var Et = We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
1330
+ Ze = function(t, r) {
1331
+ Et.usingClientEntryPoint = !0;
1332
+ try {
1333
+ return We.createRoot(t, r);
1334
+ } finally {
1335
+ Et.usingClientEntryPoint = !1;
1336
+ }
1337
+ };
1338
+ }
1339
+ const _e = 16, mr = () => /* @__PURE__ */ n.jsxs("svg", { width: _e, height: _e, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1340
+ /* @__PURE__ */ n.jsx("path", { d: "M12 4v9", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }),
1341
+ /* @__PURE__ */ n.jsx(
1342
+ "path",
1343
+ {
1344
+ d: "m8.5 10.5 3.5 3.5 3.5-3.5",
1345
+ stroke: "currentColor",
1346
+ strokeWidth: "2",
1347
+ strokeLinecap: "round",
1348
+ strokeLinejoin: "round"
1349
+ }
1350
+ ),
1351
+ /* @__PURE__ */ n.jsx("path", { d: "M5 19h14", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
1352
+ ] }), yr = ({ isDarkMode: t }) => /* @__PURE__ */ n.jsx("svg", { width: _e, height: _e, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: t ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1353
+ /* @__PURE__ */ n.jsx("circle", { cx: "12", cy: "12", r: "4.5", stroke: "currentColor", strokeWidth: "2" }),
1354
+ /* @__PURE__ */ n.jsx(
1355
+ "path",
1356
+ {
1357
+ d: "M12 2.5v2.25M12 19.25v2.25M4.75 12H2.5M21.5 12h-2.25M5.78 5.78 4.2 4.2M19.8 19.8l-1.58-1.58M18.22 5.78 19.8 4.2M4.2 19.8l1.58-1.58",
1358
+ stroke: "currentColor",
1359
+ strokeWidth: "1.7",
1360
+ strokeLinecap: "round"
1361
+ }
1362
+ )
1363
+ ] }) : /* @__PURE__ */ n.jsx(
1364
+ "path",
1365
+ {
1366
+ d: "M20 14.7A8.5 8.5 0 0 1 9.3 4a8.5 8.5 0 1 0 10.7 10.7Z",
1367
+ stroke: "currentColor",
1368
+ strokeWidth: "2",
1369
+ strokeLinejoin: "round"
1370
+ }
1371
+ ) }), br = ({ isActive: t }) => /* @__PURE__ */ n.jsxs("svg", { width: _e, height: _e, viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1372
+ /* @__PURE__ */ n.jsx(
1373
+ "rect",
1374
+ {
1375
+ x: "3.5",
1376
+ y: "5",
1377
+ width: "17",
1378
+ height: "14",
1379
+ rx: "3",
1380
+ stroke: "currentColor",
1381
+ strokeWidth: "1.8",
1382
+ opacity: t ? 1 : 0.9
1383
+ }
1384
+ ),
1385
+ /* @__PURE__ */ n.jsx("path", { d: "M8.5 5v14M15.5 5v14", stroke: "currentColor", strokeWidth: "1.4", opacity: 0.7 }),
1386
+ /* @__PURE__ */ n.jsx("circle", { cx: "12", cy: "12", r: "2.2", fill: "currentColor" })
1387
+ ] }), wt = re.memo(function({
1388
+ isDarkMode: r,
1389
+ isNavigationMode: o,
1390
+ onToggleDarkMode: a,
1391
+ onToggleNavigationMode: c,
1392
+ onExportSVG: u
1393
+ }) {
1394
+ const d = {
1395
+ display: "flex",
1396
+ alignItems: "center",
1397
+ justifyContent: "center",
1398
+ width: 32,
1399
+ height: 32,
1400
+ borderRadius: 10,
1401
+ border: `1px solid ${r ? "#38424d" : "#e4ded2"}`,
1402
+ background: r ? "#232b33" : "#f7f3ec",
1403
+ color: r ? "#f7f5ef" : "#4b5563",
1404
+ cursor: "pointer",
1405
+ boxShadow: "none",
1406
+ transition: "background-color 120ms ease, color 120ms ease, transform 120ms ease"
1407
+ };
1408
+ return /* @__PURE__ */ n.jsxs(
1409
+ "div",
1410
+ {
1411
+ style: {
1412
+ display: "flex",
1413
+ gap: 8,
1414
+ alignItems: "center"
1415
+ },
1416
+ children: [
1417
+ /* @__PURE__ */ n.jsx("button", { type: "button", onClick: u, style: d, title: "Export as SVG", children: /* @__PURE__ */ n.jsx(mr, {}) }),
1418
+ /* @__PURE__ */ n.jsx(
1419
+ "button",
1420
+ {
1421
+ type: "button",
1422
+ onClick: c,
1423
+ style: {
1424
+ ...d,
1425
+ background: o ? r ? "#33403d" : "#e7ede3" : d.background,
1426
+ borderColor: o ? r ? "#6d8470" : "#b8c7ae" : d.border,
1427
+ color: o ? r ? "#f5f8f2" : "#516347" : d.color
1428
+ },
1429
+ title: o ? "Exit Navigation Mode" : "Enter Navigation Mode",
1430
+ children: /* @__PURE__ */ n.jsx(br, { isActive: o })
1431
+ }
1432
+ ),
1433
+ /* @__PURE__ */ n.jsx(
1434
+ "button",
1435
+ {
1436
+ type: "button",
1437
+ onClick: a,
1438
+ style: d,
1439
+ title: r ? "Switch to Light Mode" : "Switch to Dark Mode",
1440
+ children: /* @__PURE__ */ n.jsx(yr, { isDarkMode: r })
1441
+ }
1442
+ )
1443
+ ]
1444
+ }
1445
+ );
1446
+ });
1447
+ wt.displayName = "BracketToolbar";
1448
+ function xr(t) {
1449
+ var a;
1450
+ if (!t.nodes)
1451
+ return t;
1452
+ let r = !1;
1453
+ const o = {};
1454
+ for (const [c, u] of Object.entries(t.nodes)) {
1455
+ const d = (a = u.meta) == null ? void 0 : a.players;
1456
+ if (!Array.isArray(d) || d.length === 0) {
1457
+ o[c] = u;
1458
+ continue;
1459
+ }
1460
+ const f = d.map((g) => g && typeof g == "object" && typeof g.name == "string" ? g.name.trim() : "").filter(Boolean);
1461
+ if (f.length === 0) {
1462
+ o[c] = u;
1463
+ continue;
1464
+ }
1465
+ r = !0, o[c] = {
1466
+ ...u,
1467
+ meta: { ...u.meta, pathKeys: f }
1468
+ };
1469
+ }
1470
+ return r ? { ...t, nodes: o } : t;
1471
+ }
1472
+ function Er(t) {
1473
+ const r = /* @__PURE__ */ new Map();
1474
+ return Object.entries(t.adj).forEach(([o, a]) => {
1475
+ r.set(o, Object.keys(a)), Object.keys(a).forEach((c) => {
1476
+ r.has(c) || r.set(c, []);
1477
+ });
1478
+ }), Object.keys(t.nodes ?? {}).forEach((o) => {
1479
+ r.has(o) || r.set(o, []);
1480
+ }), r;
1481
+ }
1482
+ function vr(t) {
1483
+ const r = Er(t);
1484
+ if (!r.size)
1485
+ return 0;
1486
+ const o = new Map(Array.from(r.keys(), (f) => [f, 0]));
1487
+ r.forEach((f) => {
1488
+ f.forEach((g) => {
1489
+ o.set(g, (o.get(g) ?? 0) + 1);
1490
+ });
1491
+ });
1492
+ const a = Array.from(o.entries()).filter(([, f]) => f === 0).map(([f]) => f);
1493
+ if (!a.length)
1494
+ return 0;
1495
+ const c = [...a], u = new Map(a.map((f) => [f, 0]));
1496
+ for (let f = 0; f < c.length; f += 1) {
1497
+ const g = c[f], I = u.get(g) ?? 0;
1498
+ (r.get(g) ?? []).forEach((m) => {
1499
+ const l = I + 1, E = u.get(m);
1500
+ (E == null || l > E) && u.set(m, l), o.set(m, (o.get(m) ?? 0) - 1), (o.get(m) ?? 0) === 0 && c.push(m);
1501
+ });
1502
+ }
1503
+ const d = Math.max(...u.values());
1504
+ return Number.isFinite(d) ? d + 1 : 0;
1505
+ }
1506
+ function Ct(t) {
1507
+ return !Number.isFinite(t) || t <= 0 ? [] : Array.from({ length: t }, (r, o) => {
1508
+ const a = t - o;
1509
+ return a === 1 ? "FINAL" : a === 2 ? "SEMIFINALS" : a === 3 ? "QUARTERFINALS" : `ROUND OF ${2 ** (a - 1)}`;
1510
+ });
1511
+ }
1512
+ function Vr(t) {
1513
+ if (!Number.isFinite(t) || t <= 0) return [];
1514
+ const r = Math.max(1, Math.ceil(Math.log2(t + 1)));
1515
+ return Ct(r);
1516
+ }
1517
+ function Rr(t) {
1518
+ return Ct(vr(t));
1519
+ }
1520
+ const vt = 20, _r = 52, Ye = 44, Tr = 420, Sr = 250, Or = 0.45, wr = 2.1, Cr = ({ color: t }) => /* @__PURE__ */ n.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n.jsx(
1521
+ "path",
1522
+ {
1523
+ d: "m14.5 5-7 7 7 7",
1524
+ stroke: t,
1525
+ strokeWidth: "2.1",
1526
+ strokeLinecap: "round",
1527
+ strokeLinejoin: "round"
1528
+ }
1529
+ ) }), jr = ({ color: t }) => /* @__PURE__ */ n.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n.jsx(
1530
+ "path",
1531
+ {
1532
+ d: "m9.5 5 7 7-7 7",
1533
+ stroke: t,
1534
+ strokeWidth: "2.1",
1535
+ strokeLinecap: "round",
1536
+ strokeLinejoin: "round"
1537
+ }
1538
+ ) }), Ir = ({ color: t }) => /* @__PURE__ */ n.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n.jsx(
1539
+ "path",
1540
+ {
1541
+ d: "m5 14.5 7-7 7 7",
1542
+ stroke: t,
1543
+ strokeWidth: "2.1",
1544
+ strokeLinecap: "round",
1545
+ strokeLinejoin: "round"
1546
+ }
1547
+ ) }), kr = ({ color: t }) => /* @__PURE__ */ n.jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ n.jsx(
1548
+ "path",
1549
+ {
1550
+ d: "m5 9.5 7 7 7-7",
1551
+ stroke: t,
1552
+ strokeWidth: "2.1",
1553
+ strokeLinecap: "round",
1554
+ strokeLinejoin: "round"
1555
+ }
1556
+ ) }), Ar = ({ color: t }) => /* @__PURE__ */ n.jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1557
+ /* @__PURE__ */ n.jsx("rect", { x: "3.5", y: "5", width: "17", height: "14", rx: "3", stroke: t, strokeWidth: "1.8" }),
1558
+ /* @__PURE__ */ n.jsx("path", { d: "M8.5 5v14M15.5 5v14", stroke: t, strokeWidth: "1.4", opacity: "0.72" }),
1559
+ /* @__PURE__ */ n.jsx("circle", { cx: "12", cy: "12", r: "2.2", fill: t })
1560
+ ] });
1561
+ function Br(t, r, o) {
1562
+ return er(t).map((a, c) => {
1563
+ const u = a.nodes, d = Math.min(...u.map((l) => l.position.x)), f = Math.min(...u.map((l) => l.position.y)), g = Math.max(
1564
+ ...u.map((l) => {
1565
+ var E;
1566
+ return l.position.x + (((E = l.size) == null ? void 0 : E.width) ?? oe.WIDTH);
1567
+ })
1568
+ ), I = Math.max(
1569
+ ...u.map((l) => {
1570
+ var E;
1571
+ return l.position.y + (((E = l.size) == null ? void 0 : E.height) ?? oe.HEIGHT);
1572
+ })
1573
+ ), m = {
1574
+ minX: d,
1575
+ minY: f - o - vt + 6,
1576
+ maxX: g,
1577
+ maxY: I,
1578
+ width: g - d,
1579
+ height: I - (f - o - vt + 6)
1580
+ };
1581
+ return {
1582
+ index: c,
1583
+ label: r[c] ?? `STAGE ${c + 1}`,
1584
+ bounds: m,
1585
+ nodeIds: u.map((l) => l.id)
1586
+ };
1587
+ });
1588
+ }
1589
+ function Nr(t, r, o, a = "top") {
1590
+ const c = Math.max(
1591
+ t.width + _r * 2,
1592
+ Tr
1593
+ ), u = Math.max(
1594
+ t.height + Ye * 2,
1595
+ Sr
1596
+ ), d = Math.min(
1597
+ wr,
1598
+ Math.max(Or, Math.min(r / c, o / u))
1599
+ ), f = o / d, g = t.minY - Ye, I = t.maxY + Ye - f, m = I > g + 1, l = t.minY + t.height / 2 - f / 2, E = m ? a === "bottom" ? I : g : l;
1600
+ return {
1601
+ canPageVertically: m,
1602
+ viewport: {
1603
+ zoom: d,
1604
+ x: (r - t.width * d) / 2 - t.minX * d,
1605
+ y: -E * d
1606
+ }
1607
+ };
1608
+ }
1609
+ function Dr({ context: t, labels: r, labelOffset: o, onStagesChange: a }) {
1610
+ const c = ge(
1611
+ () => Br(t.nodes, r, o),
1612
+ [t.nodes, o, r]
1613
+ );
1614
+ return Ie(() => {
1615
+ a(c);
1616
+ }, [a, c]), null;
1617
+ }
1618
+ const Gr = () => /* @__PURE__ */ n.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: [
1619
+ /* @__PURE__ */ n.jsx("path", { d: "M8 3h8v3a4 4 0 0 1-8 0V3Z", fill: "currentColor" }),
1620
+ /* @__PURE__ */ n.jsx(
1621
+ "path",
1622
+ {
1623
+ d: "M6 5H4a2 2 0 0 0 2 2M18 5h2a2 2 0 0 1-2 2",
1624
+ stroke: "currentColor",
1625
+ strokeWidth: "1.8",
1626
+ strokeLinecap: "round",
1627
+ strokeLinejoin: "round"
1628
+ }
1629
+ ),
1630
+ /* @__PURE__ */ n.jsx(
1631
+ "path",
1632
+ {
1633
+ d: "M12 10v4M9 21h6M10 18h4",
1634
+ stroke: "currentColor",
1635
+ strokeWidth: "1.8",
1636
+ strokeLinecap: "round"
1637
+ }
1638
+ )
1639
+ ] });
1640
+ function Wr({
1641
+ children: t,
1642
+ title: r,
1643
+ badgeText: o,
1644
+ stageLabels: a,
1645
+ isDarkMode: c,
1646
+ isNavigationMode: u,
1647
+ stageViews: d,
1648
+ activeStageIndex: f,
1649
+ verticalStagePosition: g,
1650
+ canPagePlayersVertically: I,
1651
+ contentViewportRef: m,
1652
+ showToolbar: l,
1653
+ onToggleNavigationMode: E,
1654
+ onSelectStage: q,
1655
+ onPreviousStage: W,
1656
+ onNextStage: K,
1657
+ onPagePlayersUp: J,
1658
+ onPagePlayersDown: N,
1659
+ onToggleDarkMode: S,
1660
+ onExportSVG: M
1661
+ }) {
1662
+ const { colors: _ } = St(), A = c ? "#f7f5ef" : "#3f4a38", H = c ? "rgba(35, 43, 51, 0.92)" : "rgba(255, 255, 255, 0.92)", Y = c ? "#46505c" : "#ddd7cb", Z = c ? "rgba(35, 43, 51, 0.94)" : "rgba(255, 255, 255, 0.94)", V = c ? "#38424d" : "#e5dfd4", L = u ? c ? "#f4f8f1" : "#516347" : c ? "#d8d2c7" : "#59606c", U = f > 0, te = f < d.length - 1, C = I && g === "bottom", y = I && g === "top";
1663
+ return /* @__PURE__ */ n.jsxs(
1664
+ "div",
1665
+ {
1666
+ style: {
1667
+ width: "100%",
1668
+ maxWidth: 1180,
1669
+ background: _.SURFACE_BG,
1670
+ borderRadius: 24,
1671
+ boxShadow: _.SHADOW,
1672
+ overflow: "hidden"
1673
+ },
1674
+ children: [
1675
+ /* @__PURE__ */ n.jsxs(
1676
+ "div",
1677
+ {
1678
+ style: {
1679
+ display: "flex",
1680
+ alignItems: "center",
1681
+ gap: 14,
1682
+ minHeight: 72,
1683
+ padding: "0 32px",
1684
+ background: _.HEADER_BG,
1685
+ borderBottom: `1px solid ${_.HEADER_BORDER}`
1686
+ },
1687
+ children: [
1688
+ /* @__PURE__ */ n.jsx(
1689
+ "div",
1690
+ {
1691
+ style: {
1692
+ width: 30,
1693
+ height: 30,
1694
+ borderRadius: 8,
1695
+ display: "grid",
1696
+ placeItems: "center",
1697
+ background: _.ICON_BG,
1698
+ color: _.ICON_FG,
1699
+ flexShrink: 0
1700
+ },
1701
+ children: /* @__PURE__ */ n.jsx(Gr, {})
1702
+ }
1703
+ ),
1704
+ /* @__PURE__ */ n.jsx(
1705
+ "div",
1706
+ {
1707
+ style: {
1708
+ fontFamily: '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif',
1709
+ fontSize: 18,
1710
+ fontWeight: 600,
1711
+ color: _.HEADER_TITLE
1712
+ },
1713
+ children: r
1714
+ }
1715
+ ),
1716
+ /* @__PURE__ */ n.jsx("div", { style: { flex: 1 } }),
1717
+ /* @__PURE__ */ n.jsxs(
1718
+ "div",
1719
+ {
1720
+ style: {
1721
+ display: "flex",
1722
+ alignItems: "center",
1723
+ gap: 6,
1724
+ minHeight: 28,
1725
+ padding: "0 14px",
1726
+ borderRadius: 999,
1727
+ background: _.BADGE_BG,
1728
+ color: _.BADGE_TEXT,
1729
+ fontFamily: '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif',
1730
+ fontSize: 11,
1731
+ fontWeight: 600,
1732
+ letterSpacing: "0.02em",
1733
+ whiteSpace: "nowrap"
1734
+ },
1735
+ children: [
1736
+ /* @__PURE__ */ n.jsx(
1737
+ "span",
1738
+ {
1739
+ style: {
1740
+ width: 6,
1741
+ height: 6,
1742
+ borderRadius: "50%",
1743
+ background: _.BADGE_DOT,
1744
+ flexShrink: 0
1745
+ }
1746
+ }
1747
+ ),
1748
+ o
1749
+ ]
1750
+ }
1751
+ ),
1752
+ l ? /* @__PURE__ */ n.jsx(
1753
+ wt,
1754
+ {
1755
+ isDarkMode: c,
1756
+ isNavigationMode: u,
1757
+ onToggleNavigationMode: E,
1758
+ onToggleDarkMode: S,
1759
+ onExportSVG: M
1760
+ }
1761
+ ) : null
1762
+ ]
1763
+ }
1764
+ ),
1765
+ a.length ? /* @__PURE__ */ n.jsx(
1766
+ "div",
1767
+ {
1768
+ style: {
1769
+ padding: "14px 32px 12px",
1770
+ background: c ? "#20262d" : "#fbfaf7",
1771
+ borderBottom: `1px solid ${_.HEADER_BORDER}`
1772
+ },
1773
+ children: /* @__PURE__ */ n.jsx(
1774
+ "div",
1775
+ {
1776
+ style: {
1777
+ display: "grid",
1778
+ gridTemplateColumns: `repeat(${a.length}, minmax(0, 1fr))`,
1779
+ gap: 24,
1780
+ alignItems: "center"
1781
+ },
1782
+ children: a.map((k, D) => {
1783
+ const F = u && D === f;
1784
+ return /* @__PURE__ */ n.jsxs(
1785
+ "div",
1786
+ {
1787
+ style: {
1788
+ display: "grid",
1789
+ justifyItems: "center",
1790
+ gap: 8,
1791
+ minWidth: 0,
1792
+ padding: "6px 10px",
1793
+ borderRadius: 14,
1794
+ background: F && c ? "rgba(216, 210, 199, 0.08)" : F ? "rgba(124, 144, 112, 0.08)" : "transparent"
1795
+ },
1796
+ children: [
1797
+ /* @__PURE__ */ n.jsx(
1798
+ "div",
1799
+ {
1800
+ style: {
1801
+ width: 40,
1802
+ height: 1,
1803
+ background: F ? c ? "rgba(247, 245, 239, 0.62)" : "rgba(68, 75, 85, 0.34)" : c ? "rgba(216, 210, 199, 0.24)" : "rgba(68, 75, 85, 0.16)"
1804
+ }
1805
+ }
1806
+ ),
1807
+ /* @__PURE__ */ n.jsx(
1808
+ "div",
1809
+ {
1810
+ style: {
1811
+ fontFamily: '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif',
1812
+ fontSize: 12,
1813
+ fontWeight: 800,
1814
+ letterSpacing: "0.08em",
1815
+ textTransform: "uppercase",
1816
+ color: F ? c ? "#f7f5ef" : "#2f3741" : c ? "#d8d2c7" : "#444b55",
1817
+ textAlign: "center",
1818
+ whiteSpace: "nowrap"
1819
+ },
1820
+ children: k
1821
+ }
1822
+ )
1823
+ ]
1824
+ },
1825
+ k
1826
+ );
1827
+ })
1828
+ }
1829
+ )
1830
+ }
1831
+ ) : null,
1832
+ /* @__PURE__ */ n.jsxs(
1833
+ "div",
1834
+ {
1835
+ ref: m,
1836
+ style: {
1837
+ position: "relative",
1838
+ padding: "12px 24px 24px",
1839
+ overflowX: u ? "hidden" : "auto",
1840
+ overflowY: "hidden",
1841
+ background: c ? "radial-gradient(circle at top left, rgba(154, 176, 141, 0.08), transparent 28%), #191e24" : "radial-gradient(circle at top left, rgba(124, 144, 112, 0.08), transparent 28%), #f7f6f3"
1842
+ },
1843
+ children: [
1844
+ t,
1845
+ l ? /* @__PURE__ */ n.jsx(
1846
+ "div",
1847
+ {
1848
+ style: {
1849
+ position: "absolute",
1850
+ right: 18,
1851
+ top: 18,
1852
+ display: "flex",
1853
+ flexDirection: "column",
1854
+ gap: 8,
1855
+ padding: 8,
1856
+ borderRadius: 22,
1857
+ border: `1px solid ${V}`,
1858
+ background: Z,
1859
+ boxShadow: c ? "0 18px 40px rgba(0, 0, 0, 0.28)" : "0 18px 40px rgba(45, 45, 45, 0.12)"
1860
+ },
1861
+ children: /* @__PURE__ */ n.jsx(
1862
+ "button",
1863
+ {
1864
+ type: "button",
1865
+ onClick: E,
1866
+ "aria-pressed": u,
1867
+ title: u ? "Exit Navigation Mode" : "Enter Navigation Mode",
1868
+ style: {
1869
+ width: 48,
1870
+ height: 48,
1871
+ borderRadius: 16,
1872
+ border: `1px solid ${u ? _.ICON_BG : V}`,
1873
+ background: u ? _.ICON_BG : "transparent",
1874
+ color: u ? _.ICON_FG : L,
1875
+ display: "grid",
1876
+ placeItems: "center",
1877
+ cursor: "pointer"
1878
+ },
1879
+ children: /* @__PURE__ */ n.jsx(
1880
+ Ar,
1881
+ {
1882
+ color: u ? _.ICON_FG : L
1883
+ }
1884
+ )
1885
+ }
1886
+ )
1887
+ }
1888
+ ) : null,
1889
+ u && d.length > 1 ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
1890
+ /* @__PURE__ */ n.jsx(
1891
+ "button",
1892
+ {
1893
+ type: "button",
1894
+ onClick: W,
1895
+ disabled: !U,
1896
+ "aria-label": "Go to previous stage",
1897
+ style: {
1898
+ position: "absolute",
1899
+ left: 14,
1900
+ top: "50%",
1901
+ transform: "translateY(-50%)",
1902
+ width: 42,
1903
+ height: 42,
1904
+ borderRadius: 999,
1905
+ border: `1px solid ${Y}`,
1906
+ background: H,
1907
+ color: A,
1908
+ display: "grid",
1909
+ placeItems: "center",
1910
+ boxShadow: c ? "0 12px 30px rgba(0, 0, 0, 0.22)" : "0 12px 30px rgba(45, 45, 45, 0.12)",
1911
+ opacity: U ? 1 : 0.45,
1912
+ cursor: U ? "pointer" : "default"
1913
+ },
1914
+ children: /* @__PURE__ */ n.jsx(Cr, { color: A })
1915
+ }
1916
+ ),
1917
+ /* @__PURE__ */ n.jsx(
1918
+ "button",
1919
+ {
1920
+ type: "button",
1921
+ onClick: K,
1922
+ disabled: !te,
1923
+ "aria-label": "Go to next stage",
1924
+ style: {
1925
+ position: "absolute",
1926
+ right: 14,
1927
+ top: "50%",
1928
+ transform: "translateY(-50%)",
1929
+ width: 42,
1930
+ height: 42,
1931
+ borderRadius: 999,
1932
+ border: `1px solid ${Y}`,
1933
+ background: H,
1934
+ color: A,
1935
+ display: "grid",
1936
+ placeItems: "center",
1937
+ boxShadow: c ? "0 12px 30px rgba(0, 0, 0, 0.22)" : "0 12px 30px rgba(45, 45, 45, 0.12)",
1938
+ opacity: te ? 1 : 0.45,
1939
+ cursor: te ? "pointer" : "default"
1940
+ },
1941
+ children: /* @__PURE__ */ n.jsx(jr, { color: A })
1942
+ }
1943
+ ),
1944
+ I ? /* @__PURE__ */ n.jsxs(
1945
+ "div",
1946
+ {
1947
+ style: {
1948
+ position: "absolute",
1949
+ right: 18,
1950
+ bottom: 86,
1951
+ display: "flex",
1952
+ flexDirection: "column",
1953
+ gap: 8
1954
+ },
1955
+ children: [
1956
+ /* @__PURE__ */ n.jsx(
1957
+ "button",
1958
+ {
1959
+ type: "button",
1960
+ onClick: J,
1961
+ disabled: !C,
1962
+ "aria-label": "Show upper players",
1963
+ style: {
1964
+ width: 42,
1965
+ height: 42,
1966
+ borderRadius: 999,
1967
+ border: `1px solid ${Y}`,
1968
+ background: H,
1969
+ color: A,
1970
+ display: "grid",
1971
+ placeItems: "center",
1972
+ boxShadow: c ? "0 12px 30px rgba(0, 0, 0, 0.22)" : "0 12px 30px rgba(45, 45, 45, 0.12)",
1973
+ opacity: C ? 1 : 0.45,
1974
+ cursor: C ? "pointer" : "default"
1975
+ },
1976
+ children: /* @__PURE__ */ n.jsx(Ir, { color: A })
1977
+ }
1978
+ ),
1979
+ /* @__PURE__ */ n.jsx(
1980
+ "button",
1981
+ {
1982
+ type: "button",
1983
+ onClick: N,
1984
+ disabled: !y,
1985
+ "aria-label": "Show lower players",
1986
+ style: {
1987
+ width: 42,
1988
+ height: 42,
1989
+ borderRadius: 999,
1990
+ border: `1px solid ${Y}`,
1991
+ background: H,
1992
+ color: A,
1993
+ display: "grid",
1994
+ placeItems: "center",
1995
+ boxShadow: c ? "0 12px 30px rgba(0, 0, 0, 0.22)" : "0 12px 30px rgba(45, 45, 45, 0.12)",
1996
+ opacity: y ? 1 : 0.45,
1997
+ cursor: y ? "pointer" : "default"
1998
+ },
1999
+ children: /* @__PURE__ */ n.jsx(kr, { color: A })
2000
+ }
2001
+ )
2002
+ ]
2003
+ }
2004
+ ) : null,
2005
+ /* @__PURE__ */ n.jsx(
2006
+ "div",
2007
+ {
2008
+ style: {
2009
+ position: "absolute",
2010
+ left: "50%",
2011
+ bottom: 14,
2012
+ transform: "translateX(-50%)",
2013
+ display: "flex",
2014
+ gap: 8,
2015
+ alignItems: "center",
2016
+ maxWidth: "calc(100% - 120px)",
2017
+ padding: "8px 10px",
2018
+ borderRadius: 999,
2019
+ border: `1px solid ${Y}`,
2020
+ background: H,
2021
+ boxShadow: c ? "0 18px 38px rgba(0, 0, 0, 0.24)" : "0 18px 38px rgba(45, 45, 45, 0.12)",
2022
+ overflowX: "auto"
2023
+ },
2024
+ children: d.map((k, D) => {
2025
+ const F = D === f;
2026
+ return /* @__PURE__ */ n.jsx(
2027
+ "button",
2028
+ {
2029
+ type: "button",
2030
+ onClick: () => q(D),
2031
+ style: {
2032
+ padding: "8px 14px",
2033
+ borderRadius: 999,
2034
+ border: `1px solid ${F ? _.ICON_BG : Y}`,
2035
+ background: F ? _.ICON_BG : "transparent",
2036
+ color: F ? _.ICON_FG : _.BADGE_TEXT,
2037
+ fontFamily: '"Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif',
2038
+ fontSize: 11,
2039
+ fontWeight: 700,
2040
+ letterSpacing: "0.04em",
2041
+ whiteSpace: "nowrap",
2042
+ cursor: "pointer"
2043
+ },
2044
+ children: k.label
2045
+ },
2046
+ k.label
2047
+ );
2048
+ })
2049
+ }
2050
+ )
2051
+ ] }) : null
2052
+ ]
2053
+ }
2054
+ )
2055
+ ]
2056
+ }
2057
+ );
2058
+ }
2059
+ const Fr = re.memo(function({
2060
+ graph: r,
2061
+ config: o,
2062
+ vertexComponent: a,
2063
+ nodeRenderMode: c = "export",
2064
+ title: u = "Tournament Bracket",
2065
+ badgeText: d,
2066
+ showToolbar: f = !0,
2067
+ onInvalidNode: g
2068
+ }) {
2069
+ const I = Ge(null), m = Ge(null), l = Ge(null), [E, q] = pe(!1), [W, K] = pe(!1), [J, N] = pe(0), [S, M] = pe([]), [_, A] = pe("top"), [H, Y] = pe(!1), Z = Ge(null), V = ge(
2070
+ () => (o == null ? void 0 : o.labels) ?? Rr(r),
2071
+ [o == null ? void 0 : o.labels, r]
2072
+ ), L = ge(() => {
2073
+ const { theme: h, ...b } = o ?? {}, R = E ? or : _t, O = R.theme ?? {};
2074
+ return {
2075
+ ...R,
2076
+ ...b,
2077
+ labels: void 0,
2078
+ autoLabels: !1,
2079
+ theme: { ...O, ...h ?? {} }
2080
+ };
2081
+ }, [o, V, E]), U = ge(() => {
2082
+ const h = xr(r);
2083
+ if (a)
2084
+ return h;
2085
+ const b = Object.entries(h.nodes ?? {}).reduce((R, [O, P]) => {
2086
+ const j = P.size;
2087
+ return R[O] = {
2088
+ ...P,
2089
+ size: {
2090
+ width: Math.max((j == null ? void 0 : j.width) ?? 0, oe.WIDTH),
2091
+ height: Math.max((j == null ? void 0 : j.height) ?? 0, oe.HEIGHT)
2092
+ }
2093
+ }, R;
2094
+ }, {});
2095
+ return {
2096
+ ...h,
2097
+ nodes: b
2098
+ };
2099
+ }, [r, a]), te = ge(() => {
2100
+ if (d)
2101
+ return d;
2102
+ const h = Object.keys(U.nodes ?? {}).length, b = V.at(-1) ?? "FINAL";
2103
+ return h > 0 ? `${b} · ${h} MATCHES` : b;
2104
+ }, [d, U.nodes, V]), C = ne(() => {
2105
+ q((h) => !h);
2106
+ }, []), y = ne((h) => {
2107
+ M((b) => b.length === h.length && b.every((O, P) => {
2108
+ const j = h[P];
2109
+ return O.label === j.label && O.bounds.minX === j.bounds.minX && O.bounds.minY === j.bounds.minY && O.bounds.maxX === j.bounds.maxX && O.bounds.maxY === j.bounds.maxY;
2110
+ }) ? b : h);
2111
+ }, []), k = ne(
2112
+ (h) => {
2113
+ const b = S[h], R = l.current;
2114
+ if (!b || !R || !m.current)
2115
+ return;
2116
+ const O = R.clientWidth || L.width || 1600, P = R.clientHeight || L.height || 1200, j = Nr(
2117
+ b.bounds,
2118
+ O,
2119
+ P,
2120
+ _
2121
+ );
2122
+ Y(j.canPageVertically), m.current.setViewport(j.viewport);
2123
+ },
2124
+ [L.height, L.width, S, _]
2125
+ ), D = ne(() => {
2126
+ var h, b, R;
2127
+ if (W) {
2128
+ const O = Z.current;
2129
+ O ? (h = m.current) == null || h.setViewport(O) : (b = m.current) == null || b.fitView(), K(!1);
2130
+ return;
2131
+ }
2132
+ Z.current = ((R = m.current) == null ? void 0 : R.getViewport()) ?? null, A("top"), K(!0);
2133
+ }, [W]), F = ne((h) => {
2134
+ A("top"), N(h);
2135
+ }, []), ie = ne(() => {
2136
+ A("top"), N((h) => Math.max(0, h - 1));
2137
+ }, []), z = ne(() => {
2138
+ A("top"), N((h) => Math.min(S.length - 1, h + 1));
2139
+ }, [S.length]), ce = ne(() => {
2140
+ A("top");
2141
+ }, []), ue = ne(() => {
2142
+ A("bottom");
2143
+ }, []);
2144
+ Ie(() => {
2145
+ N((h) => Math.min(h, Math.max(S.length - 1, 0)));
2146
+ }, [S.length]), Ie(() => {
2147
+ !W || !S.length || k(J);
2148
+ }, [J, k, W, S.length]), Ie(() => {
2149
+ if (!W)
2150
+ return;
2151
+ const h = () => k(J);
2152
+ return window.addEventListener("resize", h), () => window.removeEventListener("resize", h);
2153
+ }, [J, k, W]);
2154
+ const se = ge(
2155
+ () => a ?? ((h) => /* @__PURE__ */ n.jsx(Je, { ...h, renderMode: "export", onRenderError: g })),
2156
+ [g, a]
2157
+ ), de = ne(() => {
2158
+ const h = (O) => {
2159
+ const P = O == null ? void 0 : O.querySelector("svg");
2160
+ if (!P)
2161
+ return;
2162
+ const j = P.cloneNode(!0);
2163
+ j.setAttribute("xmlns", "http://www.w3.org/2000/svg"), j.setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink");
2164
+ const me = new XMLSerializer().serializeToString(j), fe = new Blob([me], { type: "image/svg+xml;charset=utf-8" }), ye = URL.createObjectURL(fe), Q = document.createElement("a");
2165
+ Q.href = ye, Q.download = `tournament-bracket-${Date.now()}.svg`, document.body.appendChild(Q), Q.click(), document.body.removeChild(Q), URL.revokeObjectURL(ye);
2166
+ };
2167
+ if (c !== "html" || a) {
2168
+ h(I.current);
2169
+ return;
2170
+ }
2171
+ const b = document.createElement("div");
2172
+ b.style.position = "absolute", b.style.width = "0", b.style.height = "0", b.style.overflow = "hidden", b.style.opacity = "0", b.style.pointerEvents = "none", document.body.appendChild(b);
2173
+ const R = Ze(b);
2174
+ try {
2175
+ Qt(() => {
2176
+ R.render(
2177
+ /* @__PURE__ */ n.jsx(pt, { mode: E ? "dark" : "light", children: /* @__PURE__ */ n.jsx(
2178
+ dt,
2179
+ {
2180
+ graph: U,
2181
+ vertexComponent: se,
2182
+ config: L
2183
+ }
2184
+ ) })
2185
+ );
2186
+ }), h(b);
2187
+ } finally {
2188
+ R.unmount(), document.body.removeChild(b);
2189
+ }
2190
+ }, [
2191
+ U,
2192
+ se,
2193
+ E,
2194
+ L,
2195
+ c,
2196
+ a
2197
+ ]), ae = ge(
2198
+ () => a ?? ((h) => /* @__PURE__ */ n.jsx(Je, { ...h, renderMode: c, onRenderError: g })),
2199
+ [c, g, a]
2200
+ );
2201
+ return /* @__PURE__ */ n.jsx(pt, { mode: E ? "dark" : "light", children: /* @__PURE__ */ n.jsx(
2202
+ Wr,
2203
+ {
2204
+ title: u,
2205
+ badgeText: te,
2206
+ stageLabels: V,
2207
+ isDarkMode: E,
2208
+ isNavigationMode: W,
2209
+ stageViews: S,
2210
+ activeStageIndex: J,
2211
+ verticalStagePosition: _,
2212
+ canPagePlayersVertically: H,
2213
+ contentViewportRef: l,
2214
+ showToolbar: f,
2215
+ onToggleNavigationMode: D,
2216
+ onSelectStage: F,
2217
+ onPreviousStage: ie,
2218
+ onNextStage: z,
2219
+ onPagePlayersUp: ce,
2220
+ onPagePlayersDown: ue,
2221
+ onToggleDarkMode: C,
2222
+ onExportSVG: de,
2223
+ children: /* @__PURE__ */ n.jsx("div", { ref: I, style: { minWidth: "fit-content" }, children: /* @__PURE__ */ n.jsx(
2224
+ dt,
2225
+ {
2226
+ ref: m,
2227
+ graph: U,
2228
+ vertexComponent: ae,
2229
+ config: L,
2230
+ panEnabled: !W,
2231
+ zoomEnabled: !W,
2232
+ pinchZoomEnabled: !W,
2233
+ renderOverlay: (h) => /* @__PURE__ */ n.jsx(
2234
+ Dr,
2235
+ {
2236
+ context: h,
2237
+ labels: V,
2238
+ labelOffset: L.labelOffset ?? 46,
2239
+ onStagesChange: y
2240
+ }
2241
+ )
2242
+ }
2243
+ ) })
2244
+ }
2245
+ ) });
2246
+ });
2247
+ Fr.displayName = "TournamentBracket";
2248
+ export {
2249
+ pt as BracketThemeProvider,
2250
+ wt as BracketToolbar,
2251
+ Je as SquashNode,
2252
+ Fr as TournamentBracket,
2253
+ xr as injectTournamentPathKeys,
2254
+ Rr as roundLabelsForGraph,
2255
+ Vr as roundLabelsForMatchCount,
2256
+ Ct as roundLabelsForRoundCount,
2257
+ St as useBracketTheme
2258
+ };