courthive-components 1.0.0 → 1.0.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.
@@ -1,6 +1,6 @@
1
1
  import { TemporalEngine as e, drawDefinitionConstants as t, drawsGovernor as n, entryStatusConstants as r, eventConstants as i, eventGovernor as a, factoryConstants as o, fixtures as s, genderConstants as c, governors as l, matchUpFormatCode as u, matchUpStatusConstants as d, mocksEngine as f, participantConstants as p, scoreGovernor as m, temporal as h, tools as g, tournamentEngine as _ } from "tods-competition-factory";
2
2
  //#region \0rolldown/runtime.js
3
- var v = Object.create, y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, S = Object.getPrototypeOf, C = Object.prototype.hasOwnProperty, w = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), T = (e, t) => {
3
+ var v = Object.create, y = Object.defineProperty, b = Object.getOwnPropertyDescriptor, x = Object.getOwnPropertyNames, S = Object.getPrototypeOf, C = Object.prototype.hasOwnProperty, w = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), T = (e, t) => {
4
4
  let n = {};
5
5
  for (var r in e) y(n, r, {
6
6
  get: e[r],
@@ -1492,49 +1492,49 @@ function $t(e) {
1492
1492
  }
1493
1493
  var en = class {
1494
1494
  constructor(e) {
1495
- let { config: t, inputField: n } = this.datepicker = e, r = this.element = Ze(Et.replace(/%buttonClass%/g, t.buttonClass)).firstChild, [i, a, o] = r.firstChild.children, s = i.firstElementChild, [c, l, u] = i.lastElementChild.children, [d, f] = o.firstChild.children, p = {
1496
- title: s,
1497
- prevButton: c,
1498
- viewSwitch: l,
1499
- nextButton: u,
1500
- todayButton: d,
1501
- clearButton: f
1495
+ let { config: t, inputField: n } = this.datepicker = e, r = Et.replace(/%buttonClass%/g, t.buttonClass), i = this.element = Ze(r).firstChild, [a, o, s] = i.firstChild.children, c = a.firstElementChild, [l, u, d] = a.lastElementChild.children, [f, p] = s.firstChild.children, m = {
1496
+ title: c,
1497
+ prevButton: l,
1498
+ viewSwitch: u,
1499
+ nextButton: d,
1500
+ todayButton: f,
1501
+ clearButton: p
1502
1502
  };
1503
- this.main = a, this.controls = p;
1504
- let m = n ? "dropdown" : "inline";
1505
- r.classList.add(`datepicker-${m}`), Yt(this, t), this.viewDate = Xt(e), st(e, [
1503
+ this.main = o, this.controls = m;
1504
+ let h = n ? "dropdown" : "inline";
1505
+ i.classList.add(`datepicker-${h}`), Yt(this, t), this.viewDate = Xt(e), st(e, [
1506
1506
  [
1507
- r,
1507
+ i,
1508
1508
  "mousedown",
1509
1509
  Kt
1510
1510
  ],
1511
1511
  [
1512
- a,
1512
+ o,
1513
1513
  "click",
1514
1514
  Gt.bind(null, e)
1515
1515
  ],
1516
1516
  [
1517
- p.viewSwitch,
1517
+ m.viewSwitch,
1518
1518
  "click",
1519
1519
  Ht.bind(null, e)
1520
1520
  ],
1521
1521
  [
1522
- p.prevButton,
1522
+ m.prevButton,
1523
1523
  "click",
1524
1524
  Ut.bind(null, e)
1525
1525
  ],
1526
1526
  [
1527
- p.nextButton,
1527
+ m.nextButton,
1528
1528
  "click",
1529
1529
  Wt.bind(null, e)
1530
1530
  ],
1531
1531
  [
1532
- p.todayButton,
1532
+ m.todayButton,
1533
1533
  "click",
1534
1534
  zt.bind(null, e)
1535
1535
  ],
1536
1536
  [
1537
- p.clearButton,
1537
+ m.clearButton,
1538
1538
  "click",
1539
1539
  Rt.bind(null, e)
1540
1540
  ]
@@ -12708,7 +12708,7 @@ function dh(e) {
12708
12708
  //#endregion
12709
12709
  //#region src/version.ts
12710
12710
  function fh() {
12711
- return "1.0.0";
12711
+ return "1.0.2";
12712
12712
  }
12713
12713
  //#endregion
12714
12714
  //#region src/constants/matchUpFormats.ts
@@ -13474,7 +13474,8 @@ function u_(e) {
13474
13474
  }
13475
13475
  function d_(e) {
13476
13476
  return function() {
13477
- this.textContent = e.apply(this, arguments) ?? "";
13477
+ var t = e.apply(this, arguments);
13478
+ this.textContent = t ?? "";
13478
13479
  };
13479
13480
  }
13480
13481
  function f_(e) {
@@ -13492,7 +13493,8 @@ function m_(e) {
13492
13493
  }
13493
13494
  function h_(e) {
13494
13495
  return function() {
13495
- this.innerHTML = e.apply(this, arguments) ?? "";
13496
+ var t = e.apply(this, arguments);
13497
+ this.innerHTML = t ?? "";
13496
13498
  };
13497
13499
  }
13498
13500
  function g_(e) {
@@ -14675,7 +14677,8 @@ function Db(e) {
14675
14677
  }
14676
14678
  function Ob(e) {
14677
14679
  return function() {
14678
- this.textContent = e(this) ?? "";
14680
+ var t = e(this);
14681
+ this.textContent = t ?? "";
14679
14682
  };
14680
14683
  }
14681
14684
  function kb(e) {
@@ -17055,7 +17058,28 @@ function BT(e) {
17055
17058
  //#region src/components/scheduling-profile/engine/profileStore.ts
17056
17059
  var VT = class {
17057
17060
  constructor(e) {
17058
- this.listeners = /* @__PURE__ */ new Set(), this.config = e, this.state = {
17061
+ this.listeners = /* @__PURE__ */ new Set(), this.config = e;
17062
+ let t = {
17063
+ all: [],
17064
+ bySeverity: {
17065
+ ERROR: [],
17066
+ WARN: [],
17067
+ INFO: []
17068
+ },
17069
+ byDate: {},
17070
+ byVenue: {},
17071
+ byDraw: {},
17072
+ counts: {
17073
+ total: 0,
17074
+ ERROR: 0,
17075
+ WARN: 0,
17076
+ INFO: 0,
17077
+ byDate: {},
17078
+ byVenue: {},
17079
+ byDraw: {}
17080
+ }
17081
+ };
17082
+ this.state = {
17059
17083
  profileDraft: $w(e.initialProfile ?? []),
17060
17084
  venues: e.venues,
17061
17085
  roundCatalog: e.roundCatalog,
@@ -17064,26 +17088,7 @@ var VT = class {
17064
17088
  selectedDate: e.selectedDate ?? e.schedulableDates[0] ?? null,
17065
17089
  selectedLocator: null,
17066
17090
  ruleResults: [],
17067
- issueIndex: {
17068
- all: [],
17069
- bySeverity: {
17070
- ERROR: [],
17071
- WARN: [],
17072
- INFO: []
17073
- },
17074
- byDate: {},
17075
- byVenue: {},
17076
- byDraw: {},
17077
- counts: {
17078
- total: 0,
17079
- ERROR: 0,
17080
- WARN: 0,
17081
- INFO: 0,
17082
- byDate: {},
17083
- byVenue: {},
17084
- byDraw: {}
17085
- }
17086
- },
17091
+ issueIndex: t,
17087
17092
  catalogSearchQuery: "",
17088
17093
  catalogGroupBy: "event",
17089
17094
  plannedRoundBehavior: e.plannedRoundBehavior ?? "dim"
@@ -17443,25 +17448,27 @@ var eE = class {
17443
17448
  let t = prompt("Enter not-before time (HH:MM):", "10:00");
17444
17449
  t !== null && this.store.setNotBeforeTime(e, t || void 0);
17445
17450
  }
17446
- }), this.layout = Zw({
17447
- dateStrip: QT({ onDateSelected: (e) => this.store.selectDate(e) }),
17448
- issuesPanel: bT({ onFixAction: (e) => this.store.applyFixAction(e) }),
17449
- venueBoard: YT({
17450
- onDrop: (e, t) => {
17451
- this.store.dropRound(e, t);
17452
- },
17453
- onCardClick: (e) => this.store.selectCard(e),
17454
- onCardContextMenu: (e, t) => {
17455
- this.popover.show(t, e);
17456
- }
17457
- }),
17458
- roundCatalog: yT({
17459
- onSearchChange: (e) => this.store.setCatalogSearch(e),
17460
- onGroupByChange: (e) => this.store.setCatalogGroupBy(e),
17461
- onDropRemove: (e) => this.store.removeRound(e),
17462
- onNavigateToPlanned: (e) => this.store.navigateToRound(e)
17463
- }),
17464
- inspectorPanel: dT()
17451
+ });
17452
+ let t = QT({ onDateSelected: (e) => this.store.selectDate(e) }), n = bT({ onFixAction: (e) => this.store.applyFixAction(e) }), r = YT({
17453
+ onDrop: (e, t) => {
17454
+ this.store.dropRound(e, t);
17455
+ },
17456
+ onCardClick: (e) => this.store.selectCard(e),
17457
+ onCardContextMenu: (e, t) => {
17458
+ this.popover.show(t, e);
17459
+ }
17460
+ }), i = yT({
17461
+ onSearchChange: (e) => this.store.setCatalogSearch(e),
17462
+ onGroupByChange: (e) => this.store.setCatalogGroupBy(e),
17463
+ onDropRemove: (e) => this.store.removeRound(e),
17464
+ onNavigateToPlanned: (e) => this.store.navigateToRound(e)
17465
+ }), a = dT();
17466
+ this.layout = Zw({
17467
+ dateStrip: t,
17468
+ issuesPanel: n,
17469
+ venueBoard: r,
17470
+ roundCatalog: i,
17471
+ inspectorPanel: a
17465
17472
  }, {
17466
17473
  hideLeft: e.hideLeft,
17467
17474
  catalogSide: e.catalogSide
@@ -17672,7 +17679,7 @@ function fE(e) {
17672
17679
  var pE, mE, hE, gE = !1;
17673
17680
  async function _E() {
17674
17681
  if (!pE) {
17675
- let e = await import("./dist-BsKs6tET.mjs");
17682
+ let e = await import("./dist-D8bGN7nf.mjs");
17676
17683
  pE = e.TimepickerUI, mE = e.PluginRegistry, hE = (await import("./range-B1T9TbVf.mjs")).RangePlugin, !gE && mE && hE && (mE.register(hE), gE = !0);
17677
17684
  }
17678
17685
  }
@@ -18812,24 +18819,24 @@ var LE = class {
18812
18819
  rowHeight: 40,
18813
18820
  ...r
18814
18821
  };
18815
- let i = /* @__PURE__ */ new Date();
18816
- this.scale = new OE(r.start || i, r.end || new Date(i.getTime() + 720 * 60 * 1e3), e.clientWidth || 800), (r.min || r.max || r.zoomMin || r.zoomMax) && this.scale.setLimits({
18822
+ let i = /* @__PURE__ */ new Date(), a = r.start || i, o = r.end || new Date(i.getTime() + 720 * 60 * 1e3), s = e.clientWidth || 800;
18823
+ this.scale = new OE(a, o, s), (r.min || r.max || r.zoomMin || r.zoomMax) && this.scale.setLimits({
18817
18824
  min: r.min,
18818
18825
  max: r.max,
18819
18826
  zoomMin: r.zoomMin,
18820
18827
  zoomMax: r.zoomMax
18821
18828
  }), this.timeAxis = new jE(this.scale, r.timeAxis), this.layout = new LE(this.options.rowHeight), this.renderer = new RE(this.scale, this.layout), this.interaction = new UE(this.scale, this.layout, this.renderer, this.callbacks, 5, r.enablePinchZoom ?? !1), this.rootEl = document.createElement("div"), this.rootEl.className = "tg-timeline", r.height && (this.rootEl.style.height = r.height);
18822
- let a = document.createElement("div");
18823
- a.className = "tg-axis-header";
18824
- let o = document.createElement("div");
18825
- o.className = "tg-axis-spacer", a.appendChild(o), a.appendChild(this.timeAxis.getDayElement()), a.appendChild(this.timeAxis.getHourElement()), this.rootEl.appendChild(a), this.bodyEl = document.createElement("div"), this.bodyEl.className = "tg-body", this.bodyEl.appendChild(this.layout.getLabelPanel());
18826
- let s = document.createElement("div");
18827
- s.className = "tg-scroll-wrapper", s.appendChild(this.layout.getContentArea()), this.bodyEl.appendChild(s), this.rootEl.appendChild(this.bodyEl), e.appendChild(this.rootEl), s.addEventListener("scroll", () => {
18828
- this.layout.getLabelPanel().scrollTop = s.scrollTop;
18829
- }), this.interaction.setScrollContainer(s), this.interaction.setWheelTarget(this.rootEl), this.interaction.onScaleChanged = () => this.renderAll(), this.layout.setGroups(n), this.renderer.setItems(t), this.interaction.setItems(t), this.interaction.attach(), this.renderAll(), this.resizeObserver = new ResizeObserver(() => {
18830
- let t = s.clientWidth || e.clientWidth;
18829
+ let c = document.createElement("div");
18830
+ c.className = "tg-axis-header";
18831
+ let l = document.createElement("div");
18832
+ l.className = "tg-axis-spacer", c.appendChild(l), c.appendChild(this.timeAxis.getDayElement()), c.appendChild(this.timeAxis.getHourElement()), this.rootEl.appendChild(c), this.bodyEl = document.createElement("div"), this.bodyEl.className = "tg-body", this.bodyEl.appendChild(this.layout.getLabelPanel());
18833
+ let u = document.createElement("div");
18834
+ u.className = "tg-scroll-wrapper", u.appendChild(this.layout.getContentArea()), this.bodyEl.appendChild(u), this.rootEl.appendChild(this.bodyEl), e.appendChild(this.rootEl), u.addEventListener("scroll", () => {
18835
+ this.layout.getLabelPanel().scrollTop = u.scrollTop;
18836
+ }), this.interaction.setScrollContainer(u), this.interaction.setWheelTarget(this.rootEl), this.interaction.onScaleChanged = () => this.renderAll(), this.layout.setGroups(n), this.renderer.setItems(t), this.interaction.setItems(t), this.interaction.attach(), this.renderAll(), this.resizeObserver = new ResizeObserver(() => {
18837
+ let t = u.clientWidth || e.clientWidth;
18831
18838
  this.scale.setWidth(t), this.renderAll();
18832
- }), this.resizeObserver.observe(s);
18839
+ }), this.resizeObserver.observe(u);
18833
18840
  }
18834
18841
  setGroups(e) {
18835
18842
  this.layout.setGroups(e), this.renderAll();
@@ -19239,7 +19246,7 @@ function qE(e) {
19239
19246
  var JE, YE, XE, ZE = !1;
19240
19247
  async function QE() {
19241
19248
  if (!JE) {
19242
- let e = await import("./dist-BsKs6tET.mjs");
19249
+ let e = await import("./dist-D8bGN7nf.mjs");
19243
19250
  JE = e.TimepickerUI, YE = e.PluginRegistry, XE = (await import("./range-B1T9TbVf.mjs")).RangePlugin, !ZE && YE && XE && (YE.register(XE), ZE = !0);
19244
19251
  }
19245
19252
  }
@@ -20126,7 +20133,9 @@ var eO = 160, tO = 60, nO = 30, rO = class {
20126
20133
  }
20127
20134
  let a = /* @__PURE__ */ new Map(), o = new Set(e.filter((e) => e.stage === GD).map((e) => e.id)), s = [];
20128
20135
  for (let e of i) o.has(e.id) ? a.set(e.id, -1) : a.set(e.id, 0), s.push(e.id);
20129
- for (; s.length;) {
20136
+ let c = e.length * (e.length - 1) + e.length, l = 0;
20137
+ for (; s.length && l < c;) {
20138
+ l++;
20130
20139
  let e = s.shift(), t = a.get(e), n = r.get(e) || [];
20131
20140
  for (let e of n) {
20132
20141
  let n = t + 1, r = a.get(e);
@@ -20134,22 +20143,22 @@ var eO = 160, tO = 60, nO = 30, rO = class {
20134
20143
  }
20135
20144
  }
20136
20145
  for (let t of e) a.has(t.id) || a.set(t.id, 0);
20137
- let c = Math.min(...a.values());
20138
- if (c < 0) for (let [e, t] of a) a.set(e, t - c);
20139
- let l = /* @__PURE__ */ new Map();
20146
+ let u = Math.min(...a.values());
20147
+ if (u < 0) for (let [e, t] of a) a.set(e, t - u);
20148
+ let d = /* @__PURE__ */ new Map();
20140
20149
  for (let t of e) {
20141
20150
  let e = a.get(t.id);
20142
- l.has(e) || l.set(e, []), l.get(e).push(t);
20151
+ d.has(e) || d.set(e, []), d.get(e).push(t);
20143
20152
  }
20144
- let u = [...l.keys()].sort((e, t) => e - t), d = 40;
20145
- for (let e of u) {
20146
- let t = l.get(e), n = Math.max(...t.map((e) => BD(e)));
20153
+ let f = [...d.keys()].sort((e, t) => e - t), p = 40;
20154
+ for (let e of f) {
20155
+ let t = d.get(e), n = Math.max(...t.map((e) => BD(e)));
20147
20156
  t.forEach((e, t) => {
20148
20157
  e.position = {
20149
- x: d,
20158
+ x: p,
20150
20159
  y: t * (eO + nO) + 40
20151
20160
  };
20152
- }), d += n + tO;
20161
+ }), p += n + tO;
20153
20162
  }
20154
20163
  }
20155
20164
  loadState(e) {
@@ -21839,22 +21848,22 @@ var { SINGLE_ELIMINATION: kk, FEED_IN: Ak, ROUND_ROBIN: jk, LUCKY_DRAW: Mk, MAIN
21839
21848
  ], { MAIN: Yk, QUALIFYING: Xk, CONSOLATION: Zk, PLAY_OFF: Qk, SINGLE_ELIMINATION: $k, LUCKY_DRAW: eA, WINNER: tA, LOSER: nA } = t, rA = "POSITION", iA = class {
21840
21849
  constructor(e = {}) {
21841
21850
  this.config = e, this.store = new rO(e.initialState);
21842
- let t = [...Jk, ...e.templates || []], n = !!e.readOnly;
21851
+ let t = [...Jk, ...e.templates || []], n = !!e.readOnly, r = this.buildToolbarPanel(t, n), i = this.buildCanvasPanel(n), a = BO({
21852
+ onUpdateNode: n ? () => {} : (e, t) => this.store.updateNode(e, t),
21853
+ onUpdateEdge: n ? () => {} : (e, t) => this.store.updateEdge(e, t),
21854
+ onDeleteNode: n ? () => {} : (e) => this.store.removeNode(e),
21855
+ readOnly: n,
21856
+ hideDelete: e.hideDelete
21857
+ }), o = QO({
21858
+ onUpdateEdge: n ? () => {} : (e, t) => this.store.updateEdge(e, t),
21859
+ onDeleteEdge: n ? () => {} : (e) => this.store.removeEdge(e),
21860
+ readOnly: n
21861
+ });
21843
21862
  this.layout = Ok({
21844
- toolbar: this.buildToolbarPanel(t, n),
21845
- canvas: this.buildCanvasPanel(n),
21846
- nodeEditor: BO({
21847
- onUpdateNode: n ? () => {} : (e, t) => this.store.updateNode(e, t),
21848
- onUpdateEdge: n ? () => {} : (e, t) => this.store.updateEdge(e, t),
21849
- onDeleteNode: n ? () => {} : (e) => this.store.removeNode(e),
21850
- readOnly: n,
21851
- hideDelete: e.hideDelete
21852
- }),
21853
- edgeEditor: QO({
21854
- onUpdateEdge: n ? () => {} : (e, t) => this.store.updateEdge(e, t),
21855
- onDeleteEdge: n ? () => {} : (e) => this.store.removeEdge(e),
21856
- readOnly: n
21857
- })
21863
+ toolbar: r,
21864
+ canvas: i,
21865
+ nodeEditor: a,
21866
+ edgeEditor: o
21858
21867
  }), this.unsubscribe = this.store.subscribe((e) => {
21859
21868
  this.layout.update(e);
21860
21869
  }), this.layout.update(this.store.getState());
@@ -22780,24 +22789,26 @@ var Mj = class {
22780
22789
  }
22781
22790
  }, Nj = class {
22782
22791
  constructor(e) {
22783
- this.container = null, this.store = new Mj(e), this.layout = pj({
22784
- dateStrip: Aj({ onDateSelected: (e) => this.store.selectDate(e) }),
22785
- issuesPanel: kj(),
22786
- courtGridSlot: jj(e.courtGridElement, { onMatchUpDrop: (e, t) => {
22787
- this.store.handleMatchUpDrop(e, t);
22788
- } }, { gridMaxHeight: e.gridMaxHeight }),
22789
- matchUpCatalog: Ej({
22790
- onSearchChange: (e) => this.store.setCatalogSearch(e),
22791
- onGroupByChange: (e) => this.store.setCatalogGroupBy(e),
22792
- onFilterChange: (e) => this.store.setCatalogFilters(e),
22793
- onShowCompletedChange: (e) => this.store.setShowCompleted(e),
22794
- onShowScheduledChange: (e) => this.store.setShowScheduled(e),
22795
- onMatchUpSelected: (e) => this.store.selectMatchUp(e),
22796
- onDropRemove: (e) => {
22797
- this.store.handleMatchUpRemove(e);
22798
- }
22799
- }),
22800
- inspectorPanel: _j()
22792
+ this.container = null, this.store = new Mj(e);
22793
+ let t = Aj({ onDateSelected: (e) => this.store.selectDate(e) }), n = kj(), r = jj(e.courtGridElement, { onMatchUpDrop: (e, t) => {
22794
+ this.store.handleMatchUpDrop(e, t);
22795
+ } }, { gridMaxHeight: e.gridMaxHeight }), i = Ej({
22796
+ onSearchChange: (e) => this.store.setCatalogSearch(e),
22797
+ onGroupByChange: (e) => this.store.setCatalogGroupBy(e),
22798
+ onFilterChange: (e) => this.store.setCatalogFilters(e),
22799
+ onShowCompletedChange: (e) => this.store.setShowCompleted(e),
22800
+ onShowScheduledChange: (e) => this.store.setShowScheduled(e),
22801
+ onMatchUpSelected: (e) => this.store.selectMatchUp(e),
22802
+ onDropRemove: (e) => {
22803
+ this.store.handleMatchUpRemove(e);
22804
+ }
22805
+ }), a = _j();
22806
+ this.layout = pj({
22807
+ dateStrip: t,
22808
+ issuesPanel: n,
22809
+ courtGridSlot: r,
22810
+ matchUpCatalog: i,
22811
+ inspectorPanel: a
22801
22812
  }, { onToggleLeft: () => this.store.toggleLeftPanel() }, {
22802
22813
  hideLeft: e.hideLeft,
22803
22814
  catalogSide: e.catalogSide
@@ -26598,9 +26609,9 @@ function NI(e) {
26598
26609
  var PI = class {
26599
26610
  constructor(e) {
26600
26611
  this.listeners = /* @__PURE__ */ new Set(), this.config = e;
26601
- let t = new Set((e.builtinPolicies ?? []).map((e) => e.id));
26612
+ let t = new Set((e.builtinPolicies ?? []).map((e) => e.id)), n = [...e.builtinPolicies ?? [], ...(e.userPolicies ?? []).filter((e) => !t.has(e.id))];
26602
26613
  this.state = {
26603
- catalog: [...e.builtinPolicies ?? [], ...(e.userPolicies ?? []).filter((e) => !t.has(e.id))],
26614
+ catalog: n,
26604
26615
  searchQuery: "",
26605
26616
  groupBy: "type",
26606
26617
  selectedId: null,