tods-competition-factory 1.6.20 → 1.6.22

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.
@@ -362,7 +362,7 @@ var matchUpFormatCode = {
362
362
  };
363
363
 
364
364
  function factoryVersion() {
365
- return '1.6.20';
365
+ return '1.6.22';
366
366
  }
367
367
 
368
368
  /******************************************************************************
@@ -8956,12 +8956,13 @@ function isLucky(_a) {
8956
8956
  }
8957
8957
 
8958
8958
  function isAdHoc(_a) {
8959
- var _b, _c;
8960
8959
  var drawDefinition = _a.drawDefinition, structure = _a.structure;
8961
8960
  if (!structure)
8962
8961
  return false;
8963
- var hasRoundPosition = (_b = structure === null || structure === void 0 ? void 0 : structure.matchUps) === null || _b === void 0 ? void 0 : _b.find(function (matchUp) { return matchUp === null || matchUp === void 0 ? void 0 : matchUp.roundPosition; });
8964
- var hasDrawPosition = (_c = structure === null || structure === void 0 ? void 0 : structure.matchUps) === null || _c === void 0 ? void 0 : _c.find(function (matchUp) { var _a; return (_a = matchUp === null || matchUp === void 0 ? void 0 : matchUp.drawPositions) === null || _a === void 0 ? void 0 : _a.length; });
8962
+ var matchUps = structure.matchUps ||
8963
+ (structure.roundMatchUps && Object.values(structure.roundMatchUps).flat());
8964
+ var hasRoundPosition = matchUps === null || matchUps === void 0 ? void 0 : matchUps.find(function (matchUp) { return matchUp === null || matchUp === void 0 ? void 0 : matchUp.roundPosition; });
8965
+ var hasDrawPosition = matchUps === null || matchUps === void 0 ? void 0 : matchUps.find(function (matchUp) { var _a; return (_a = matchUp === null || matchUp === void 0 ? void 0 : matchUp.drawPositions) === null || _a === void 0 ? void 0 : _a.length; });
8965
8966
  return (!(structure === null || structure === void 0 ? void 0 : structure.structures) &&
8966
8967
  !((drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.drawType) && drawDefinition.drawType !== AD_HOC) &&
8967
8968
  !hasRoundPosition &&
@@ -48284,8 +48285,8 @@ function roundRobinSwap(_a) {
48284
48285
  }
48285
48286
 
48286
48287
  function resetMatchUpLineUps$1(_a) {
48287
- var _b;
48288
- var _c = _a.inheritance, inheritance = _c === void 0 ? true : _c, tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, matchUpId = _a.matchUpId, event = _a.event;
48288
+ var _b, _c;
48289
+ var _d = _a.inheritance, inheritance = _d === void 0 ? true : _d, tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, matchUpId = _a.matchUpId, event = _a.event;
48289
48290
  if (!drawDefinition)
48290
48291
  return { error: MISSING_DRAW_DEFINITION };
48291
48292
  var matchUp = (_b = findMatchUp$1({
@@ -48294,18 +48295,20 @@ function resetMatchUpLineUps$1(_a) {
48294
48295
  })) === null || _b === void 0 ? void 0 : _b.matchUp;
48295
48296
  if (!(matchUp === null || matchUp === void 0 ? void 0 : matchUp.tieMatchUps))
48296
48297
  return { error: INVALID_MATCHUP };
48298
+ var inContextMatchUp = (_c = findMatchUp$1({
48299
+ inContext: true,
48300
+ drawDefinition: drawDefinition,
48301
+ matchUpId: matchUpId,
48302
+ event: event,
48303
+ })) === null || _c === void 0 ? void 0 : _c.matchUp;
48297
48304
  var modificationsCount = 0;
48298
- (matchUp.sides || []).forEach(function (side) {
48299
- var _a;
48305
+ ((matchUp === null || matchUp === void 0 ? void 0 : matchUp.sides) || []).forEach(function (side) {
48306
+ if (side.lineUp)
48307
+ delete side.lineUp;
48308
+ });
48309
+ ((inContextMatchUp === null || inContextMatchUp === void 0 ? void 0 : inContextMatchUp.sides) || []).forEach(function (side) {
48300
48310
  modificationsCount += 1;
48301
- delete side.lineUp;
48302
48311
  if (inheritance === false) {
48303
- // remove lineup for team participantId from drawDefinition LINE_UP extension
48304
- var inContextMatchUp = (_a = findMatchUp$1({
48305
- inContext: true,
48306
- drawDefinition: drawDefinition,
48307
- matchUpId: matchUpId,
48308
- })) === null || _a === void 0 ? void 0 : _a.matchUp;
48309
48312
  var tieFormat = inContextMatchUp === null || inContextMatchUp === void 0 ? void 0 : inContextMatchUp.tieFormat;
48310
48313
  var participantId = side.participantId;
48311
48314
  if (tieFormat && participantId) {
@@ -48319,7 +48322,7 @@ function resetMatchUpLineUps$1(_a) {
48319
48322
  }
48320
48323
  modifyMatchUpNotice({
48321
48324
  tournamentId: tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.tournamentId,
48322
- context: 'resetLineUps',
48325
+ context: 'resetMatchUpLineUps',
48323
48326
  eventId: event === null || event === void 0 ? void 0 : event.eventId,
48324
48327
  drawDefinition: drawDefinition,
48325
48328
  matchUp: matchUp,
@@ -60525,7 +60528,7 @@ function getScaledEntries(_a) {
60525
60528
  .filter(function (scaledEntry) {
60526
60529
  var scaleValue = scaledEntry.scaleValue;
60527
60530
  // if a custom sort method is not provided, filter out entries with non-float values
60528
- if (!scaleSortMethod && scaleValue && typeof scaleValue !== 'number')
60531
+ if (!scaleSortMethod && (isNaN(scaleValue) || !parseFloat(scaleValue)))
60529
60532
  return false;
60530
60533
  return scaleValue;
60531
60534
  })
@@ -64850,6 +64853,7 @@ var lastNames = [
64850
64853
  "Catton",
64851
64854
  "Calvino",
64852
64855
  "Carson",
64856
+ "Chip",
64853
64857
  "Constant",
64854
64858
  "Crane",
64855
64859
  "Crowne",