tods-competition-factory 1.6.19 → 1.6.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/forge/generate.mjs +161 -87
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +1 -1
- package/dist/forge/query.mjs +33 -36
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +132 -40
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +149 -126
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +149 -132
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -362,7 +362,7 @@ var matchUpFormatCode = {
|
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
function factoryVersion() {
|
|
365
|
-
return '1.6.
|
|
365
|
+
return '1.6.21';
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/******************************************************************************
|
|
@@ -7455,14 +7455,14 @@ function getRoundMatchUps$1(_a) {
|
|
|
7455
7455
|
roundIndex += 1;
|
|
7456
7456
|
}
|
|
7457
7457
|
});
|
|
7458
|
-
var
|
|
7458
|
+
var roundsNotPowerOf2 = !!Object.values(roundProfile).find(function (_a) {
|
|
7459
7459
|
var matchUpsCount = _a.matchUpsCount;
|
|
7460
7460
|
return !isPowerOf2(matchUpsCount);
|
|
7461
7461
|
});
|
|
7462
7462
|
var hasNoRoundPositions = matchUps.some(function (matchUp) { return !matchUp.roundPosition; });
|
|
7463
7463
|
return {
|
|
7464
|
-
isNotEliminationStructure: isNotEliminationStructure,
|
|
7465
7464
|
hasNoRoundPositions: hasNoRoundPositions,
|
|
7465
|
+
roundsNotPowerOf2: roundsNotPowerOf2,
|
|
7466
7466
|
maxMatchUpsCount: maxMatchUpsCount,
|
|
7467
7467
|
roundMatchUps: roundMatchUps,
|
|
7468
7468
|
roundNumbers: roundNumbers,
|
|
@@ -8934,42 +8934,39 @@ function filterMatchUps(params) {
|
|
|
8934
8934
|
}
|
|
8935
8935
|
|
|
8936
8936
|
function isLucky(_a) {
|
|
8937
|
-
var _b;
|
|
8938
|
-
var
|
|
8939
|
-
var isNotEliminationStructure = _a.isNotEliminationStructure, drawDefinition = _a.drawDefinition, roundMatchUps = _a.roundMatchUps, structure = _a.structure;
|
|
8937
|
+
var _b, _c;
|
|
8938
|
+
var roundsNotPowerOf2 = _a.roundsNotPowerOf2, drawDefinition = _a.drawDefinition, structure = _a.structure, matchUps = _a.matchUps;
|
|
8940
8939
|
if (!structure)
|
|
8941
8940
|
return false;
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8952
|
-
|
|
8953
|
-
|
|
8954
|
-
}));
|
|
8955
|
-
return (isNotEliminationStructure &&
|
|
8941
|
+
matchUps = (_b = matchUps !== null && matchUps !== void 0 ? matchUps : structure.matchUps) !== null && _b !== void 0 ? _b : [];
|
|
8942
|
+
roundsNotPowerOf2 =
|
|
8943
|
+
roundsNotPowerOf2 !== null && roundsNotPowerOf2 !== void 0 ? roundsNotPowerOf2 : getRoundMatchUps$1({ matchUps: matchUps }).roundsNotPowerOf2;
|
|
8944
|
+
var hasDrawPositions = !!((_c = structure.positionAssignments) === null || _c === void 0 ? void 0 : _c.find(function (_a) {
|
|
8945
|
+
var drawPosition = _a.drawPosition;
|
|
8946
|
+
return drawPosition;
|
|
8947
|
+
})) ||
|
|
8948
|
+
!!(matchUps === null || matchUps === void 0 ? void 0 : matchUps.find(function (_a) {
|
|
8949
|
+
var drawPositions = _a.drawPositions;
|
|
8950
|
+
return drawPositions === null || drawPositions === void 0 ? void 0 : drawPositions.length;
|
|
8951
|
+
}));
|
|
8952
|
+
return ((!(drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.drawType) || drawDefinition.drawType !== LUCKY_DRAW) &&
|
|
8956
8953
|
!(structure === null || structure === void 0 ? void 0 : structure.structures) &&
|
|
8957
|
-
|
|
8958
|
-
|
|
8959
|
-
!((drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.drawType) && drawDefinition.drawType !== LUCKY_DRAW));
|
|
8954
|
+
roundsNotPowerOf2 &&
|
|
8955
|
+
hasDrawPositions);
|
|
8960
8956
|
}
|
|
8961
8957
|
|
|
8962
8958
|
function isAdHoc(_a) {
|
|
8963
|
-
var _b;
|
|
8964
8959
|
var drawDefinition = _a.drawDefinition, structure = _a.structure;
|
|
8965
8960
|
if (!structure)
|
|
8966
8961
|
return false;
|
|
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; });
|
|
8967
8966
|
return (!(structure === null || structure === void 0 ? void 0 : structure.structures) &&
|
|
8968
8967
|
!((drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.drawType) && drawDefinition.drawType !== AD_HOC) &&
|
|
8969
|
-
!
|
|
8970
|
-
|
|
8971
|
-
return !!roundPosition;
|
|
8972
|
-
})));
|
|
8968
|
+
!hasRoundPosition &&
|
|
8969
|
+
!hasDrawPosition);
|
|
8973
8970
|
}
|
|
8974
8971
|
|
|
8975
8972
|
var _a$h, _b$4;
|
|
@@ -9002,14 +8999,10 @@ var POLICY_ROUND_NAMING_DEFAULT = (_a$h = {},
|
|
|
9002
8999
|
|
|
9003
9000
|
function getRoundContextProfile(_a) {
|
|
9004
9001
|
var roundNamingPolicy = _a.roundNamingPolicy, structure = _a.structure, matchUps = _a.matchUps;
|
|
9005
|
-
var _b = getRoundMatchUps$1({ matchUps: matchUps }),
|
|
9002
|
+
var _b = getRoundMatchUps$1({ matchUps: matchUps }), roundProfile = _b.roundProfile, roundMatchUps = _b.roundMatchUps;
|
|
9006
9003
|
var structureAbbreviation = structure.structureAbbreviation, stage = structure.stage;
|
|
9007
9004
|
var isAdHocStructure = isAdHoc({ structure: structure });
|
|
9008
|
-
var isLuckyStructure = isLucky({
|
|
9009
|
-
isNotEliminationStructure: isNotEliminationStructure,
|
|
9010
|
-
roundMatchUps: roundMatchUps,
|
|
9011
|
-
structure: structure,
|
|
9012
|
-
});
|
|
9005
|
+
var isLuckyStructure = isLucky({ structure: structure });
|
|
9013
9006
|
var isRoundRobin = structure.structures;
|
|
9014
9007
|
var roundNamingProfile = {};
|
|
9015
9008
|
var defaultRoundNamingPolicy = POLICY_ROUND_NAMING_DEFAULT[POLICY_TYPE_ROUND_NAMING];
|
|
@@ -25060,11 +25053,11 @@ function getValidSeedBlocks(_a) {
|
|
|
25060
25053
|
var validSeedBlocks = [];
|
|
25061
25054
|
if (!structure)
|
|
25062
25055
|
return { error: MISSING_STRUCTURE };
|
|
25063
|
-
var
|
|
25056
|
+
var _d = getAllStructureMatchUps({
|
|
25064
25057
|
matchUpFilters: { roundNumbers: [1] },
|
|
25065
25058
|
provisionalPositioning: provisionalPositioning,
|
|
25066
25059
|
structure: structure,
|
|
25067
|
-
}).roundMatchUps;
|
|
25060
|
+
}), matchUps = _d.matchUps, roundMatchUps = _d.roundMatchUps;
|
|
25068
25061
|
var seedAssignments = getStructureSeedAssignments({
|
|
25069
25062
|
provisionalPositioning: provisionalPositioning,
|
|
25070
25063
|
drawDefinition: drawDefinition,
|
|
@@ -25099,14 +25092,16 @@ function getValidSeedBlocks(_a) {
|
|
|
25099
25092
|
var stage = structure.stage, structureType = structure.structureType, roundLimit = structure.roundLimit;
|
|
25100
25093
|
var isContainer = structureType === CONTAINER;
|
|
25101
25094
|
var isFeedIn = !isContainer && (uniqueDrawPositionsByRound === null || uniqueDrawPositionsByRound === void 0 ? void 0 : uniqueDrawPositionsByRound.length);
|
|
25102
|
-
// if there are first round draw positions it is not AdHoc
|
|
25103
|
-
// if the baseDrawSize is not a power of 2 then it isLucky
|
|
25104
|
-
var isLucky = (firstRoundDrawPositions === null || firstRoundDrawPositions === void 0 ? void 0 : firstRoundDrawPositions.length) && !isPowerOf2(baseDrawSize);
|
|
25105
25095
|
var qualifyingBlocks = !isContainer && stage === QUALIFYING && roundLimit;
|
|
25106
25096
|
var fedSeedBlockPositions = seedRangeDrawPositionBlocks.flat(Infinity);
|
|
25107
25097
|
var fedSeedNumberOffset = isFeedIn ? fedSeedBlockPositions === null || fedSeedBlockPositions === void 0 ? void 0 : fedSeedBlockPositions.length : 0;
|
|
25108
25098
|
var countLimit = allPositions ? positionsCount : seedsCount;
|
|
25109
|
-
var
|
|
25099
|
+
var isLuckyStructure = isLucky({
|
|
25100
|
+
drawDefinition: drawDefinition,
|
|
25101
|
+
structure: structure,
|
|
25102
|
+
matchUps: matchUps,
|
|
25103
|
+
});
|
|
25104
|
+
var firstRoundSeedsCount = isLuckyStructure
|
|
25110
25105
|
? 0
|
|
25111
25106
|
: (!isFeedIn && countLimit) ||
|
|
25112
25107
|
(countLimit &&
|
|
@@ -25153,17 +25148,14 @@ function getValidSeedBlocks(_a) {
|
|
|
25153
25148
|
return { seedNumbers: block, drawPositions: block };
|
|
25154
25149
|
});
|
|
25155
25150
|
}
|
|
25156
|
-
else if (
|
|
25157
|
-
// if there are first round draw positions it is not AdHoc
|
|
25158
|
-
// if the baseDrawSize is not a power of 2 then it isLucky
|
|
25159
|
-
// firstRoundSeedsCount = 0;
|
|
25151
|
+
else if (isLuckyStructure) {
|
|
25160
25152
|
var blocks = chunkArray(firstRoundDrawPositions, 2).map(function (block, i) { return ({
|
|
25161
25153
|
drawPositions: [block[0]],
|
|
25162
25154
|
seedNumbers: [i + 1],
|
|
25163
25155
|
}); });
|
|
25164
25156
|
blocks.forEach(function (block) { return validSeedBlocks.push(block); });
|
|
25165
25157
|
}
|
|
25166
|
-
if (!isContainer && !
|
|
25158
|
+
if (!isContainer && !isLuckyStructure && !qualifyingBlocks) {
|
|
25167
25159
|
var blocks = constructPower2Blocks({
|
|
25168
25160
|
drawPositionOffset: firstRoundDrawPositionOffset,
|
|
25169
25161
|
seedNumberOffset: fedSeedNumberOffset,
|
|
@@ -25177,7 +25169,7 @@ function getValidSeedBlocks(_a) {
|
|
|
25177
25169
|
var validSeedPositions = seedDrawPositions.reduce(function (result, drawPosition) {
|
|
25178
25170
|
return (firstRoundDrawPositions === null || firstRoundDrawPositions === void 0 ? void 0 : firstRoundDrawPositions.includes(drawPosition)) && result;
|
|
25179
25171
|
}, true);
|
|
25180
|
-
if (!
|
|
25172
|
+
if (!isLuckyStructure && !isFeedIn && !isContainer && !validSeedPositions) {
|
|
25181
25173
|
return {
|
|
25182
25174
|
error: INVALID_SEED_POSITION,
|
|
25183
25175
|
validSeedBlocks: [],
|
|
@@ -25186,10 +25178,10 @@ function getValidSeedBlocks(_a) {
|
|
|
25186
25178
|
};
|
|
25187
25179
|
}
|
|
25188
25180
|
return {
|
|
25181
|
+
isLuckyStructure: isLuckyStructure,
|
|
25189
25182
|
validSeedBlocks: validSeedBlocks,
|
|
25190
25183
|
isContainer: isContainer,
|
|
25191
25184
|
isFeedIn: isFeedIn,
|
|
25192
|
-
isLucky: isLucky,
|
|
25193
25185
|
};
|
|
25194
25186
|
}
|
|
25195
25187
|
function getContainerBlocks(_a) {
|
|
@@ -25511,6 +25503,72 @@ function getTargetMatchUps(_a) {
|
|
|
25511
25503
|
return { drawPositions: drawPositions, matchUps: matchUps, targetMatchUps: targetMatchUps };
|
|
25512
25504
|
}
|
|
25513
25505
|
|
|
25506
|
+
function validateLineUp(_a) {
|
|
25507
|
+
var lineUp = _a.lineUp; _a.tieFormat;
|
|
25508
|
+
var errors = [];
|
|
25509
|
+
if (!Array.isArray(lineUp)) {
|
|
25510
|
+
errors.push(mustBeAnArray('lineUp'));
|
|
25511
|
+
return { valid: false, errors: errors, error: INVALID_VALUES };
|
|
25512
|
+
}
|
|
25513
|
+
var validItems = lineUp.every(function (item) {
|
|
25514
|
+
if (typeof item !== 'object') {
|
|
25515
|
+
errors.push("lineUp entries must be objects");
|
|
25516
|
+
return false;
|
|
25517
|
+
}
|
|
25518
|
+
var participantId = item.participantId, collectionAssignments = item.collectionAssignments;
|
|
25519
|
+
if (!participantId) {
|
|
25520
|
+
errors.push('Missing participantId');
|
|
25521
|
+
return false;
|
|
25522
|
+
}
|
|
25523
|
+
if (typeof participantId !== 'string') {
|
|
25524
|
+
errors.push('participantIds must be strings');
|
|
25525
|
+
return false;
|
|
25526
|
+
}
|
|
25527
|
+
if (!Array.isArray(collectionAssignments)) {
|
|
25528
|
+
errors.push(mustBeAnArray('collectionAssignments'));
|
|
25529
|
+
return false;
|
|
25530
|
+
}
|
|
25531
|
+
return collectionAssignments.every(function (collectionAssignment) {
|
|
25532
|
+
if (typeof collectionAssignment !== 'object') {
|
|
25533
|
+
errors.push('collectionAssignments must be objects');
|
|
25534
|
+
return false;
|
|
25535
|
+
}
|
|
25536
|
+
var collectionPosition = collectionAssignment.collectionPosition;
|
|
25537
|
+
if (typeof collectionPosition !== 'number') {
|
|
25538
|
+
errors.push('collectionPosition must be a number');
|
|
25539
|
+
return false;
|
|
25540
|
+
}
|
|
25541
|
+
return true;
|
|
25542
|
+
});
|
|
25543
|
+
});
|
|
25544
|
+
var noDuplicates = unique(lineUp.map(getParticipantId)).length === lineUp.length;
|
|
25545
|
+
if (!noDuplicates)
|
|
25546
|
+
errors.push('Duplicated participantId(s)');
|
|
25547
|
+
var valid = validItems && noDuplicates;
|
|
25548
|
+
return { valid: valid, errors: errors, error: errors.length ? INVALID_VALUES : undefined };
|
|
25549
|
+
}
|
|
25550
|
+
|
|
25551
|
+
function updateTeamLineUp(_a) {
|
|
25552
|
+
var drawDefinition = _a.drawDefinition, participantId = _a.participantId, tieFormat = _a.tieFormat, lineUp = _a.lineUp;
|
|
25553
|
+
if (typeof drawDefinition !== 'object')
|
|
25554
|
+
return { error: MISSING_DRAW_DEFINITION };
|
|
25555
|
+
if (typeof participantId !== 'string')
|
|
25556
|
+
return { error: MISSING_PARTICIPANT_ID };
|
|
25557
|
+
var validation = validateLineUp({ lineUp: lineUp, tieFormat: tieFormat });
|
|
25558
|
+
if (!validation.valid)
|
|
25559
|
+
return validation;
|
|
25560
|
+
var existingExtension = findExtension({
|
|
25561
|
+
element: drawDefinition,
|
|
25562
|
+
name: LINEUPS,
|
|
25563
|
+
}).extension;
|
|
25564
|
+
var value = (existingExtension === null || existingExtension === void 0 ? void 0 : existingExtension.value) || {};
|
|
25565
|
+
value[participantId] = removeLineUpSubstitutions({ lineUp: lineUp });
|
|
25566
|
+
var extension = { name: LINEUPS, value: value };
|
|
25567
|
+
addExtension$1({ element: drawDefinition, extension: extension });
|
|
25568
|
+
addDrawNotice({ drawDefinition: drawDefinition });
|
|
25569
|
+
return __assign({}, SUCCESS);
|
|
25570
|
+
}
|
|
25571
|
+
|
|
25514
25572
|
function resetLineUps(_a) {
|
|
25515
25573
|
var e_1, _b;
|
|
25516
25574
|
var inContextDrawMatchUps = _a.inContextDrawMatchUps, _c = _a.inheritance, inheritance = _c === void 0 ? true : _c, tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, matchUpsMap = _a.matchUpsMap, assignments = _a.assignments, structure = _a.structure, event = _a.event;
|
|
@@ -25533,11 +25591,19 @@ function resetLineUps(_a) {
|
|
|
25533
25591
|
return matchUpId === inContextMatchUp.matchUpId;
|
|
25534
25592
|
});
|
|
25535
25593
|
if ((_a = matchUp === null || matchUp === void 0 ? void 0 : matchUp.sides) === null || _a === void 0 ? void 0 : _a[sideIndex]) {
|
|
25536
|
-
|
|
25537
|
-
|
|
25538
|
-
|
|
25539
|
-
|
|
25540
|
-
|
|
25594
|
+
delete matchUp.sides[sideIndex].lineUp;
|
|
25595
|
+
if (inheritance === false) {
|
|
25596
|
+
// remove lineup for team participantId from drawDefinition LINE_UP extension
|
|
25597
|
+
var tieFormat = inContextMatchUp.tieFormat;
|
|
25598
|
+
var participantId = side.participantId;
|
|
25599
|
+
if (tieFormat && participantId) {
|
|
25600
|
+
updateTeamLineUp({
|
|
25601
|
+
drawDefinition: drawDefinition,
|
|
25602
|
+
participantId: participantId,
|
|
25603
|
+
lineUp: [],
|
|
25604
|
+
tieFormat: tieFormat,
|
|
25605
|
+
});
|
|
25606
|
+
}
|
|
25541
25607
|
}
|
|
25542
25608
|
modifyMatchUpNotice({
|
|
25543
25609
|
tournamentId: tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.tournamentId,
|
|
@@ -43547,7 +43613,7 @@ function getSeedOrderByePositions(_a) {
|
|
|
43547
43613
|
structure: structure,
|
|
43548
43614
|
});
|
|
43549
43615
|
}
|
|
43550
|
-
var isFeedIn = seedBlockInfo.isFeedIn,
|
|
43616
|
+
var isFeedIn = seedBlockInfo.isFeedIn, isLuckyStructure = seedBlockInfo.isLuckyStructure, isContainer = seedBlockInfo.isContainer;
|
|
43551
43617
|
var validSeedBlocks = seedBlockInfo.validSeedBlocks;
|
|
43552
43618
|
if ((_b = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _b === void 0 ? void 0 : _b.containerByesIgnoreSeeding)
|
|
43553
43619
|
validSeedBlocks = [];
|
|
@@ -43593,10 +43659,10 @@ function getSeedOrderByePositions(_a) {
|
|
|
43593
43659
|
return {
|
|
43594
43660
|
strictSeedOrderByePositions: strictSeedOrderByePositions,
|
|
43595
43661
|
blockSeedOrderByePositions: blockSeedOrderByePositions,
|
|
43662
|
+
isLuckyStructure: isLuckyStructure,
|
|
43596
43663
|
positionedSeeds: positionedSeeds,
|
|
43597
43664
|
isContainer: isContainer,
|
|
43598
43665
|
isFeedIn: isFeedIn,
|
|
43599
|
-
isLucky: isLucky,
|
|
43600
43666
|
};
|
|
43601
43667
|
}
|
|
43602
43668
|
function getOrderedByePositions(_a) {
|
|
@@ -43627,7 +43693,7 @@ function getOrderedByePositions(_a) {
|
|
|
43627
43693
|
|
|
43628
43694
|
function getUnseededByePositions(_a) {
|
|
43629
43695
|
var _b, _c;
|
|
43630
|
-
var provisionalPositioning = _a.provisionalPositioning, seedOrderByePositions = _a.seedOrderByePositions
|
|
43696
|
+
var provisionalPositioning = _a.provisionalPositioning, seedOrderByePositions = _a.seedOrderByePositions; _a.isLuckyStructure; var appliedPolicies = _a.appliedPolicies, drawDefinition = _a.drawDefinition, seedLimit = _a.seedLimit, structure = _a.structure, isFeedIn = _a.isFeedIn;
|
|
43631
43697
|
var seedingProfile = (_b = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _b === void 0 ? void 0 : _b.seedingProfile;
|
|
43632
43698
|
var isQualifying = structure.stage === QUALIFYING;
|
|
43633
43699
|
var positionAssignments = structureAssignedDrawPositions({ structure: structure }).positionAssignments;
|
|
@@ -43861,7 +43927,7 @@ function positionByes(_a) {
|
|
|
43861
43927
|
seedBlockInfo: seedBlockInfo,
|
|
43862
43928
|
byesToPlace: byesToPlace,
|
|
43863
43929
|
structure: structure,
|
|
43864
|
-
}), strictSeedOrderByePositions = _f.strictSeedOrderByePositions, blockSeedOrderByePositions = _f.blockSeedOrderByePositions,
|
|
43930
|
+
}), strictSeedOrderByePositions = _f.strictSeedOrderByePositions, blockSeedOrderByePositions = _f.blockSeedOrderByePositions, isLuckyStructure = _f.isLuckyStructure, isFeedIn = _f.isFeedIn;
|
|
43865
43931
|
var ignoreSeededByes = (structure === null || structure === void 0 ? void 0 : structure.structureType) &&
|
|
43866
43932
|
[CONTAINER, ITEM].includes(structure.structureType) &&
|
|
43867
43933
|
((_d = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _d === void 0 ? void 0 : _d.containerByesIgnoreSeeding);
|
|
@@ -43871,12 +43937,12 @@ function positionByes(_a) {
|
|
|
43871
43937
|
var unseededByePositions = getUnseededByePositions({
|
|
43872
43938
|
provisionalPositioning: provisionalPositioning,
|
|
43873
43939
|
seedOrderByePositions: seedOrderByePositions,
|
|
43940
|
+
isLuckyStructure: isLuckyStructure,
|
|
43874
43941
|
appliedPolicies: appliedPolicies,
|
|
43875
43942
|
drawDefinition: drawDefinition,
|
|
43876
43943
|
seedLimit: seedLimit,
|
|
43877
43944
|
structure: structure,
|
|
43878
43945
|
isFeedIn: isFeedIn,
|
|
43879
|
-
isLucky: isLucky,
|
|
43880
43946
|
}).unseededByePositions;
|
|
43881
43947
|
var isOdd = function (x) { return x % 2; };
|
|
43882
43948
|
// method determines whether candidate c is paired to elements in an array
|
|
@@ -48219,8 +48285,8 @@ function roundRobinSwap(_a) {
|
|
|
48219
48285
|
}
|
|
48220
48286
|
|
|
48221
48287
|
function resetMatchUpLineUps$1(_a) {
|
|
48222
|
-
var _b;
|
|
48223
|
-
var
|
|
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;
|
|
48224
48290
|
if (!drawDefinition)
|
|
48225
48291
|
return { error: MISSING_DRAW_DEFINITION };
|
|
48226
48292
|
var matchUp = (_b = findMatchUp$1({
|
|
@@ -48229,18 +48295,34 @@ function resetMatchUpLineUps$1(_a) {
|
|
|
48229
48295
|
})) === null || _b === void 0 ? void 0 : _b.matchUp;
|
|
48230
48296
|
if (!(matchUp === null || matchUp === void 0 ? void 0 : matchUp.tieMatchUps))
|
|
48231
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;
|
|
48232
48304
|
var modificationsCount = 0;
|
|
48233
|
-
(matchUp.sides || []).forEach(function (side) {
|
|
48234
|
-
|
|
48235
|
-
if (inheritance) {
|
|
48305
|
+
((matchUp === null || matchUp === void 0 ? void 0 : matchUp.sides) || []).forEach(function (side) {
|
|
48306
|
+
if (side.lineUp)
|
|
48236
48307
|
delete side.lineUp;
|
|
48237
|
-
|
|
48238
|
-
|
|
48239
|
-
|
|
48308
|
+
});
|
|
48309
|
+
((inContextMatchUp === null || inContextMatchUp === void 0 ? void 0 : inContextMatchUp.sides) || []).forEach(function (side) {
|
|
48310
|
+
modificationsCount += 1;
|
|
48311
|
+
if (inheritance === false) {
|
|
48312
|
+
var tieFormat = inContextMatchUp === null || inContextMatchUp === void 0 ? void 0 : inContextMatchUp.tieFormat;
|
|
48313
|
+
var participantId = side.participantId;
|
|
48314
|
+
if (tieFormat && participantId) {
|
|
48315
|
+
updateTeamLineUp({
|
|
48316
|
+
drawDefinition: drawDefinition,
|
|
48317
|
+
participantId: participantId,
|
|
48318
|
+
lineUp: [],
|
|
48319
|
+
tieFormat: tieFormat,
|
|
48320
|
+
});
|
|
48321
|
+
}
|
|
48240
48322
|
}
|
|
48241
48323
|
modifyMatchUpNotice({
|
|
48242
48324
|
tournamentId: tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.tournamentId,
|
|
48243
|
-
context: '
|
|
48325
|
+
context: 'resetMatchUpLineUps',
|
|
48244
48326
|
eventId: event === null || event === void 0 ? void 0 : event.eventId,
|
|
48245
48327
|
drawDefinition: drawDefinition,
|
|
48246
48328
|
matchUp: matchUp,
|
|
@@ -55750,72 +55832,6 @@ function removeCollectionAssignments(_a) {
|
|
|
55750
55832
|
return { modifiedLineUp: modifiedLineUp, assignmentsRemoved: assignmentsRemoved, previousParticipantIds: previousParticipantIds };
|
|
55751
55833
|
}
|
|
55752
55834
|
|
|
55753
|
-
function validateLineUp(_a) {
|
|
55754
|
-
var lineUp = _a.lineUp; _a.tieFormat;
|
|
55755
|
-
var errors = [];
|
|
55756
|
-
if (!Array.isArray(lineUp)) {
|
|
55757
|
-
errors.push(mustBeAnArray('lineUp'));
|
|
55758
|
-
return { valid: false, errors: errors, error: INVALID_VALUES };
|
|
55759
|
-
}
|
|
55760
|
-
var validItems = lineUp.every(function (item) {
|
|
55761
|
-
if (typeof item !== 'object') {
|
|
55762
|
-
errors.push("lineUp entries must be objects");
|
|
55763
|
-
return false;
|
|
55764
|
-
}
|
|
55765
|
-
var participantId = item.participantId, collectionAssignments = item.collectionAssignments;
|
|
55766
|
-
if (!participantId) {
|
|
55767
|
-
errors.push('Missing participantId');
|
|
55768
|
-
return false;
|
|
55769
|
-
}
|
|
55770
|
-
if (typeof participantId !== 'string') {
|
|
55771
|
-
errors.push('participantIds must be strings');
|
|
55772
|
-
return false;
|
|
55773
|
-
}
|
|
55774
|
-
if (!Array.isArray(collectionAssignments)) {
|
|
55775
|
-
errors.push(mustBeAnArray('collectionAssignments'));
|
|
55776
|
-
return false;
|
|
55777
|
-
}
|
|
55778
|
-
return collectionAssignments.every(function (collectionAssignment) {
|
|
55779
|
-
if (typeof collectionAssignment !== 'object') {
|
|
55780
|
-
errors.push('collectionAssignments must be objects');
|
|
55781
|
-
return false;
|
|
55782
|
-
}
|
|
55783
|
-
var collectionPosition = collectionAssignment.collectionPosition;
|
|
55784
|
-
if (typeof collectionPosition !== 'number') {
|
|
55785
|
-
errors.push('collectionPosition must be a number');
|
|
55786
|
-
return false;
|
|
55787
|
-
}
|
|
55788
|
-
return true;
|
|
55789
|
-
});
|
|
55790
|
-
});
|
|
55791
|
-
var noDuplicates = unique(lineUp.map(getParticipantId)).length === lineUp.length;
|
|
55792
|
-
if (!noDuplicates)
|
|
55793
|
-
errors.push('Duplicated participantId(s)');
|
|
55794
|
-
var valid = validItems && noDuplicates;
|
|
55795
|
-
return { valid: valid, errors: errors, error: errors.length ? INVALID_VALUES : undefined };
|
|
55796
|
-
}
|
|
55797
|
-
|
|
55798
|
-
function updateTeamLineUp(_a) {
|
|
55799
|
-
var drawDefinition = _a.drawDefinition, participantId = _a.participantId, tieFormat = _a.tieFormat, lineUp = _a.lineUp;
|
|
55800
|
-
if (typeof drawDefinition !== 'object')
|
|
55801
|
-
return { error: MISSING_DRAW_DEFINITION };
|
|
55802
|
-
if (typeof participantId !== 'string')
|
|
55803
|
-
return { error: MISSING_PARTICIPANT_ID };
|
|
55804
|
-
var validation = validateLineUp({ lineUp: lineUp, tieFormat: tieFormat });
|
|
55805
|
-
if (!validation.valid)
|
|
55806
|
-
return validation;
|
|
55807
|
-
var existingExtension = findExtension({
|
|
55808
|
-
element: drawDefinition,
|
|
55809
|
-
name: LINEUPS,
|
|
55810
|
-
}).extension;
|
|
55811
|
-
var value = (existingExtension === null || existingExtension === void 0 ? void 0 : existingExtension.value) || {};
|
|
55812
|
-
value[participantId] = removeLineUpSubstitutions({ lineUp: lineUp });
|
|
55813
|
-
var extension = { name: LINEUPS, value: value };
|
|
55814
|
-
addExtension$1({ element: drawDefinition, extension: extension });
|
|
55815
|
-
addDrawNotice({ drawDefinition: drawDefinition });
|
|
55816
|
-
return __assign({}, SUCCESS);
|
|
55817
|
-
}
|
|
55818
|
-
|
|
55819
55835
|
// for a given tieMatchUpId (SINGLES or DOUBLES) return:
|
|
55820
55836
|
// the tieMatchUp, the dualMatchUp within which it occurs, an inContext copy of the dualMatchUp
|
|
55821
55837
|
// the tieFormat, collectionId and collectionPosition & etc.
|
|
@@ -64837,6 +64853,7 @@ var lastNames = [
|
|
|
64837
64853
|
"Catton",
|
|
64838
64854
|
"Calvino",
|
|
64839
64855
|
"Carson",
|
|
64856
|
+
"Chip",
|
|
64840
64857
|
"Constant",
|
|
64841
64858
|
"Crane",
|
|
64842
64859
|
"Crowne",
|