tods-competition-factory 1.6.10 → 1.6.12
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 +225 -205
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +7 -4
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +84 -70
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +119 -100
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +168 -153
- 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 +3 -3
|
@@ -362,7 +362,7 @@ var matchUpFormatCode = {
|
|
|
362
362
|
};
|
|
363
363
|
|
|
364
364
|
function factoryVersion() {
|
|
365
|
-
return '1.6.
|
|
365
|
+
return '1.6.12';
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/******************************************************************************
|
|
@@ -4078,7 +4078,7 @@ function getParticipantResults(_a) {
|
|
|
4078
4078
|
});
|
|
4079
4079
|
var winningParticipantId = winningSide && getWinningSideId(matchUp);
|
|
4080
4080
|
var losingParticipantId = winningSide && getLosingSideId(matchUp);
|
|
4081
|
-
if (!winningParticipantId
|
|
4081
|
+
if (!winningParticipantId && !losingParticipantId) {
|
|
4082
4082
|
if (completedMatchUpStatuses.includes(matchUpStatus)) {
|
|
4083
4083
|
var participantIdSide1 = getSideId(matchUp, 0);
|
|
4084
4084
|
var participantIdSide2 = getSideId(matchUp, 1);
|
|
@@ -4091,63 +4091,61 @@ function getParticipantResults(_a) {
|
|
|
4091
4091
|
participantResults[participantIdSide2].matchUpsCancelled += 1;
|
|
4092
4092
|
}
|
|
4093
4093
|
}
|
|
4094
|
-
else {
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
var
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
var
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
participantResults[tieLosingParticipantId].tieDoublesLost += 1;
|
|
4119
|
-
}
|
|
4094
|
+
else if (tieMatchUps === null || tieMatchUps === void 0 ? void 0 : tieMatchUps.length) {
|
|
4095
|
+
perPlayer = 0; // if any matchUps are matchUpType: TEAM don't calculate perPlayer
|
|
4096
|
+
var _loop_1 = function (tieMatchUp) {
|
|
4097
|
+
if (tieMatchUp.winningSide) {
|
|
4098
|
+
var tieWinningParticipantId = (_e = sides.find(function (_a) {
|
|
4099
|
+
var sideNumber = _a.sideNumber;
|
|
4100
|
+
return sideNumber === tieMatchUp.winningSide;
|
|
4101
|
+
})) === null || _e === void 0 ? void 0 : _e.participantId;
|
|
4102
|
+
var tieLosingParticipantId = (_f = sides.find(function (_a) {
|
|
4103
|
+
var sideNumber = _a.sideNumber;
|
|
4104
|
+
return sideNumber === tieMatchUp.winningSide;
|
|
4105
|
+
})) === null || _f === void 0 ? void 0 : _f.participantId;
|
|
4106
|
+
if (tieWinningParticipantId && tieLosingParticipantId) {
|
|
4107
|
+
checkInitializeParticipant(participantResults, tieWinningParticipantId);
|
|
4108
|
+
checkInitializeParticipant(participantResults, tieLosingParticipantId);
|
|
4109
|
+
participantResults[tieWinningParticipantId].tieMatchUpsWon += 1;
|
|
4110
|
+
participantResults[tieLosingParticipantId].tieMatchUpsLost += 1;
|
|
4111
|
+
if (tieMatchUp.matchUpType === SINGLES$1) {
|
|
4112
|
+
participantResults[tieWinningParticipantId].tieSinglesWon += 1;
|
|
4113
|
+
participantResults[tieLosingParticipantId].tieSinglesLost += 1;
|
|
4114
|
+
}
|
|
4115
|
+
else if (tieMatchUp.matchUpType === DOUBLES$1) {
|
|
4116
|
+
participantResults[tieWinningParticipantId].tieDoublesWon += 1;
|
|
4117
|
+
participantResults[tieLosingParticipantId].tieDoublesLost += 1;
|
|
4120
4118
|
}
|
|
4121
4119
|
}
|
|
4122
|
-
processScore({
|
|
4123
|
-
score: tieMatchUp.score,
|
|
4124
|
-
manualGamesOverride: manualGamesOverride,
|
|
4125
|
-
participantResults: participantResults,
|
|
4126
|
-
sides: sides,
|
|
4127
|
-
});
|
|
4128
|
-
};
|
|
4129
|
-
try {
|
|
4130
|
-
for (var tieMatchUps_1 = (e_2 = void 0, __values(tieMatchUps)), tieMatchUps_1_1 = tieMatchUps_1.next(); !tieMatchUps_1_1.done; tieMatchUps_1_1 = tieMatchUps_1.next()) {
|
|
4131
|
-
var tieMatchUp = tieMatchUps_1_1.value;
|
|
4132
|
-
_loop_1(tieMatchUp);
|
|
4133
|
-
}
|
|
4134
|
-
}
|
|
4135
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4136
|
-
finally {
|
|
4137
|
-
try {
|
|
4138
|
-
if (tieMatchUps_1_1 && !tieMatchUps_1_1.done && (_c = tieMatchUps_1.return)) _c.call(tieMatchUps_1);
|
|
4139
|
-
}
|
|
4140
|
-
finally { if (e_2) throw e_2.error; }
|
|
4141
4120
|
}
|
|
4142
|
-
}
|
|
4143
|
-
else {
|
|
4144
4121
|
processScore({
|
|
4122
|
+
score: tieMatchUp.score,
|
|
4145
4123
|
manualGamesOverride: manualGamesOverride,
|
|
4146
4124
|
participantResults: participantResults,
|
|
4147
|
-
score: score,
|
|
4148
4125
|
sides: sides,
|
|
4149
4126
|
});
|
|
4127
|
+
};
|
|
4128
|
+
try {
|
|
4129
|
+
for (var tieMatchUps_1 = (e_2 = void 0, __values(tieMatchUps)), tieMatchUps_1_1 = tieMatchUps_1.next(); !tieMatchUps_1_1.done; tieMatchUps_1_1 = tieMatchUps_1.next()) {
|
|
4130
|
+
var tieMatchUp = tieMatchUps_1_1.value;
|
|
4131
|
+
_loop_1(tieMatchUp);
|
|
4132
|
+
}
|
|
4150
4133
|
}
|
|
4134
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
4135
|
+
finally {
|
|
4136
|
+
try {
|
|
4137
|
+
if (tieMatchUps_1_1 && !tieMatchUps_1_1.done && (_c = tieMatchUps_1.return)) _c.call(tieMatchUps_1);
|
|
4138
|
+
}
|
|
4139
|
+
finally { if (e_2) throw e_2.error; }
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
else {
|
|
4143
|
+
processScore({
|
|
4144
|
+
manualGamesOverride: manualGamesOverride,
|
|
4145
|
+
participantResults: participantResults,
|
|
4146
|
+
score: score,
|
|
4147
|
+
sides: sides,
|
|
4148
|
+
});
|
|
4151
4149
|
}
|
|
4152
4150
|
}
|
|
4153
4151
|
else {
|
|
@@ -7721,7 +7719,7 @@ var drawDefinitionConstants = {
|
|
|
7721
7719
|
};
|
|
7722
7720
|
|
|
7723
7721
|
function structureSort(a, b, config) {
|
|
7724
|
-
var _a, _b;
|
|
7722
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7725
7723
|
var getRoundTarget = function (element) { var _a, _b; return (_b = (_a = findExtension$2({ element: element, name: ROUND_TARGET })) === null || _a === void 0 ? void 0 : _a.extension) === null || _b === void 0 ? void 0 : _b.value; };
|
|
7726
7724
|
var completed = config === null || config === void 0 ? void 0 : config.deprioritizeCompleted;
|
|
7727
7725
|
var aggregate = (config === null || config === void 0 ? void 0 : config.mode) === AGGREGATE_EVENT_STRUCTURES && aggregateOrder;
|
|
@@ -7744,9 +7742,9 @@ function structureSort(a, b, config) {
|
|
|
7744
7742
|
(getRoundTarget(a) || 0) - (getRoundTarget(b) || 0) ||
|
|
7745
7743
|
(!finish &&
|
|
7746
7744
|
!aggregate &&
|
|
7747
|
-
(((_a = b === null || b === void 0 ? void 0 : b.positionAssignments) === null || _a === void 0 ? void 0 : _a.length)
|
|
7748
|
-
(((
|
|
7749
|
-
((a === null || a === void 0 ? void 0 : a.stageSequence)
|
|
7745
|
+
((_b = (_a = b === null || b === void 0 ? void 0 : b.positionAssignments) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : Infinity) -
|
|
7746
|
+
((_d = (_c = a === null || a === void 0 ? void 0 : a.positionAssignments) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : Infinity)) ||
|
|
7747
|
+
((_e = a === null || a === void 0 ? void 0 : a.stageSequence) !== null && _e !== void 0 ? _e : 0) - ((_f = b === null || b === void 0 ? void 0 : b.stageSequence) !== null && _f !== void 0 ? _f : 0) ||
|
|
7750
7748
|
(getMinFinishingPositionRange(a) || 0) -
|
|
7751
7749
|
(getMinFinishingPositionRange(b) || 0));
|
|
7752
7750
|
}
|
|
@@ -7940,7 +7938,7 @@ function getStageEntryTypeCount(_a) {
|
|
|
7940
7938
|
}
|
|
7941
7939
|
function getStageEntries$1(_a) {
|
|
7942
7940
|
var _b, _c;
|
|
7943
|
-
var provisionalPositioning = _a.provisionalPositioning, drawDefinition = _a.drawDefinition, stageSequence = _a.stageSequence, entryStatuses = _a.entryStatuses, structureId = _a.structureId, roundTarget = _a.roundTarget, stages = _a.stages, stage = _a.stage;
|
|
7941
|
+
var provisionalPositioning = _a.provisionalPositioning, placementGroup = _a.placementGroup, drawDefinition = _a.drawDefinition, stageSequence = _a.stageSequence, entryStatuses = _a.entryStatuses, structureId = _a.structureId, roundTarget = _a.roundTarget, stages = _a.stages, stage = _a.stage;
|
|
7944
7942
|
var entries = (_c = (_b = drawDefinition.entries) === null || _b === void 0 ? void 0 : _b.reduce(function (entries, entry) {
|
|
7945
7943
|
var _a, _b, _c;
|
|
7946
7944
|
var entryRoundTarget = (_b = (_a = findExtension$2({
|
|
@@ -7970,7 +7968,7 @@ function getStageEntries$1(_a) {
|
|
|
7970
7968
|
if (error) {
|
|
7971
7969
|
console.log('playoff entries error'); // TODO: bubble this up...
|
|
7972
7970
|
}
|
|
7973
|
-
return (playoffEntries === null || playoffEntries === void 0 ? void 0 : playoffEntries.length) ? playoffEntries : entries;
|
|
7971
|
+
return ((playoffEntries === null || playoffEntries === void 0 ? void 0 : playoffEntries.length) ? playoffEntries : entries).filter(function (entry) { return !placementGroup || entry.placementGroup === placementGroup; });
|
|
7974
7972
|
}
|
|
7975
7973
|
return entries;
|
|
7976
7974
|
}
|
|
@@ -11086,9 +11084,8 @@ function modifyMatchUpScore(_a) {
|
|
|
11086
11084
|
(matchUp = findResult.matchUp, structure = findResult.structure);
|
|
11087
11085
|
}
|
|
11088
11086
|
}
|
|
11089
|
-
else {
|
|
11090
|
-
|
|
11091
|
-
console.log('!!!!!');
|
|
11087
|
+
else if (matchUp.matchUpId !== matchUpId) {
|
|
11088
|
+
console.log('!!!!!');
|
|
11092
11089
|
}
|
|
11093
11090
|
if ((matchUpStatus && [WALKOVER$2, DOUBLE_WALKOVER].includes(matchUpStatus)) ||
|
|
11094
11091
|
removeScore) {
|
|
@@ -11136,37 +11133,50 @@ function modifyMatchUpScore(_a) {
|
|
|
11136
11133
|
defaultedProcessCodes =
|
|
11137
11134
|
(_g = (_f = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies[POLICY_TYPE_SCORING]) === null || _f === void 0 ? void 0 : _f.processCodes) === null || _g === void 0 ? void 0 : _g.incompleteAssignmentsOnDefault;
|
|
11138
11135
|
}
|
|
11139
|
-
|
|
11140
|
-
|
|
11141
|
-
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11169
|
-
|
|
11136
|
+
if (!matchUp.collectionId) {
|
|
11137
|
+
var isRoundRobin = (structure === null || structure === void 0 ? void 0 : structure.structureType) === CONTAINER;
|
|
11138
|
+
var isAdHocStructure_1 = isAdHoc({ drawDefinition: drawDefinition, structure: structure });
|
|
11139
|
+
if (isLucky({ drawDefinition: drawDefinition, structure: structure }) ||
|
|
11140
|
+
isAdHocStructure_1 ||
|
|
11141
|
+
isRoundRobin) {
|
|
11142
|
+
var updateTally = function (structure) {
|
|
11143
|
+
var _a, _b, _c;
|
|
11144
|
+
// matchUpFormat set here is only used in updateAssignmentParticipantResults
|
|
11145
|
+
matchUpFormat = isDualMatchUp
|
|
11146
|
+
? 'SET1-S:T100'
|
|
11147
|
+
: (_c = (_b = (_a = matchUpFormat !== null && matchUpFormat !== void 0 ? matchUpFormat : matchUp.matchUpFormat) !== null && _a !== void 0 ? _a : structure === null || structure === void 0 ? void 0 : structure.matchUpFormat) !== null && _b !== void 0 ? _b : drawDefinition === null || drawDefinition === void 0 ? void 0 : drawDefinition.matchUpFormat) !== null && _c !== void 0 ? _c : event === null || event === void 0 ? void 0 : event.matchUpFormat;
|
|
11148
|
+
var matchUpFilters = isDualMatchUp
|
|
11149
|
+
? { matchUpTypes: [TEAM$2] }
|
|
11150
|
+
: undefined;
|
|
11151
|
+
var matchUps = getAllStructureMatchUps({
|
|
11152
|
+
afterRecoveryTimes: false,
|
|
11153
|
+
inContext: true,
|
|
11154
|
+
matchUpFilters: matchUpFilters,
|
|
11155
|
+
structure: structure,
|
|
11156
|
+
event: event,
|
|
11157
|
+
}).matchUps;
|
|
11158
|
+
if (isAdHocStructure_1) {
|
|
11159
|
+
structure.positionAssignments = unique(matchUps
|
|
11160
|
+
.flatMap(function (matchUp) { var _a; return ((_a = matchUp.sides) !== null && _a !== void 0 ? _a : []).map(function (side) { return side.participantId; }); })
|
|
11161
|
+
.filter(Boolean)).map(function (participantId) { return ({ participantId: participantId }); });
|
|
11162
|
+
}
|
|
11163
|
+
return updateAssignmentParticipantResults({
|
|
11164
|
+
positionAssignments: structure.positionAssignments,
|
|
11165
|
+
tournamentRecord: tournamentRecord,
|
|
11166
|
+
drawDefinition: drawDefinition,
|
|
11167
|
+
matchUpFormat: matchUpFormat,
|
|
11168
|
+
matchUps: matchUps,
|
|
11169
|
+
event: event,
|
|
11170
|
+
});
|
|
11171
|
+
};
|
|
11172
|
+
var itemStructure = isRoundRobin &&
|
|
11173
|
+
structure.structures.find(function (itemStructure) {
|
|
11174
|
+
return itemStructure === null || itemStructure === void 0 ? void 0 : itemStructure.matchUps.find(function (matchUp) { return matchUp.matchUpId === matchUpId; });
|
|
11175
|
+
});
|
|
11176
|
+
var result = updateTally(itemStructure || structure);
|
|
11177
|
+
if (result.error)
|
|
11178
|
+
return decorateResult({ result: result, stack: stack });
|
|
11179
|
+
}
|
|
11170
11180
|
}
|
|
11171
11181
|
if (notes) {
|
|
11172
11182
|
var result = addNotes({ element: matchUp, notes: notes });
|
|
@@ -16188,7 +16198,7 @@ var POLICY_SCHEDULING_USTA = (_a$9 = {},
|
|
|
16188
16198
|
_c),
|
|
16189
16199
|
matchUpAverageTimes: [
|
|
16190
16200
|
{
|
|
16191
|
-
matchUpFormatCodes: [
|
|
16201
|
+
matchUpFormatCodes: [FORMAT_STANDARD],
|
|
16192
16202
|
averageTimes: [
|
|
16193
16203
|
{
|
|
16194
16204
|
categoryNames: [],
|
|
@@ -16361,11 +16371,11 @@ var POLICY_SCORING_USTA = (_a$8 = {},
|
|
|
16361
16371
|
},
|
|
16362
16372
|
},
|
|
16363
16373
|
_b$2),
|
|
16364
|
-
defaultMatchUpFormat:
|
|
16374
|
+
defaultMatchUpFormat: FORMAT_STANDARD,
|
|
16365
16375
|
matchUpFormats: [
|
|
16366
16376
|
{
|
|
16367
16377
|
description: 'Best of 3 tiebreak sets',
|
|
16368
|
-
matchUpFormat:
|
|
16378
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
16369
16379
|
categoryNames: [],
|
|
16370
16380
|
categoryTypes: [],
|
|
16371
16381
|
},
|
|
@@ -16452,7 +16462,7 @@ var _a$7, _b$1;
|
|
|
16452
16462
|
*/
|
|
16453
16463
|
var POLICY_SCORING_DEFAULT = (_a$7 = {},
|
|
16454
16464
|
_a$7[POLICY_TYPE_SCORING] = {
|
|
16455
|
-
defaultMatchUpFormat:
|
|
16465
|
+
defaultMatchUpFormat: FORMAT_STANDARD,
|
|
16456
16466
|
requireAllPositionsAssigned: false,
|
|
16457
16467
|
processCodes: {
|
|
16458
16468
|
incompleteAssignmentsOnDefault: ['RANKING.IGNORE'],
|
|
@@ -25042,7 +25052,7 @@ function getSeedingThresholds(_a) {
|
|
|
25042
25052
|
}
|
|
25043
25053
|
|
|
25044
25054
|
function getValidSeedBlocks(_a) {
|
|
25045
|
-
var _b;
|
|
25055
|
+
var _b, _c;
|
|
25046
25056
|
var provisionalPositioning = _a.provisionalPositioning, appliedPolicies = _a.appliedPolicies, drawDefinition = _a.drawDefinition, allPositions = _a.allPositions, structure = _a.structure;
|
|
25047
25057
|
var validSeedBlocks = [];
|
|
25048
25058
|
if (!structure)
|
|
@@ -25059,7 +25069,7 @@ function getValidSeedBlocks(_a) {
|
|
|
25059
25069
|
}).seedAssignments;
|
|
25060
25070
|
var positionAssignments = structureAssignedDrawPositions({ structure: structure }).positionAssignments;
|
|
25061
25071
|
var positionsCount = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.length;
|
|
25062
|
-
var seedsCount = (seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.length)
|
|
25072
|
+
var seedsCount = (_b = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.length) !== null && _b !== void 0 ? _b : 0;
|
|
25063
25073
|
var allDrawPositions = [];
|
|
25064
25074
|
var roundNumbers = Object.keys(roundMatchUps)
|
|
25065
25075
|
.map(function (n) { return parseInt(n); })
|
|
@@ -25078,7 +25088,7 @@ function getValidSeedBlocks(_a) {
|
|
|
25078
25088
|
.reverse();
|
|
25079
25089
|
var firstRoundDrawPositions = uniqueDrawPositionsByRound.pop();
|
|
25080
25090
|
var firstRoundDrawPositionOffset = (firstRoundDrawPositions && Math.min.apply(Math, __spreadArray([], __read(firstRoundDrawPositions), false)) - 1) || 0;
|
|
25081
|
-
var seedingProfile = (
|
|
25091
|
+
var seedingProfile = (_c = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _c === void 0 ? void 0 : _c.seedingProfile;
|
|
25082
25092
|
var baseDrawSize = (firstRoundDrawPositions === null || firstRoundDrawPositions === void 0 ? void 0 : firstRoundDrawPositions.length) || 0;
|
|
25083
25093
|
// firstRoundDrawPositions have been popped
|
|
25084
25094
|
// seedRangeDrawPositionBlocks determines FEED_IN
|
|
@@ -25291,7 +25301,7 @@ function isValidSeedPosition(_a) {
|
|
|
25291
25301
|
return validSeedPositions.includes(drawPosition);
|
|
25292
25302
|
}
|
|
25293
25303
|
function getNextSeedBlock(params) {
|
|
25294
|
-
var _a, _b;
|
|
25304
|
+
var _a, _b, _c;
|
|
25295
25305
|
var provisionalPositioning = params.provisionalPositioning, drawDefinition = params.drawDefinition, seedBlockInfo = params.seedBlockInfo, structureId = params.structureId, randomize = params.randomize;
|
|
25296
25306
|
var structure = findStructure({ drawDefinition: drawDefinition, structureId: structureId }).structure;
|
|
25297
25307
|
var seedAssignments = getStructureSeedAssignments({
|
|
@@ -25322,7 +25332,9 @@ function getNextSeedBlock(params) {
|
|
|
25322
25332
|
var unplacedSeedIds = assignedSeedParticipantIds === null || assignedSeedParticipantIds === void 0 ? void 0 : assignedSeedParticipantIds.filter(function (participantId) { return !(assignedPositionParticipantIds === null || assignedPositionParticipantIds === void 0 ? void 0 : assignedPositionParticipantIds.includes(participantId)); });
|
|
25323
25333
|
var unplacedSeedAssignments = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.filter(function (assignment) { return unplacedSeedIds === null || unplacedSeedIds === void 0 ? void 0 : unplacedSeedIds.includes(assignment.participantId); });
|
|
25324
25334
|
var seedsWithoutDrawPositions = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.filter(function (assignment) { return !assignment.participantId; });
|
|
25325
|
-
var seedsLeftToAssign = (unplacedSeedAssignments === null || unplacedSeedAssignments === void 0 ? void 0 : unplacedSeedAssignments.length)
|
|
25335
|
+
var seedsLeftToAssign = (unplacedSeedAssignments === null || unplacedSeedAssignments === void 0 ? void 0 : unplacedSeedAssignments.length) && unplacedSeedAssignments.length > 0
|
|
25336
|
+
? unplacedSeedAssignments.length
|
|
25337
|
+
: (_b = seedsWithoutDrawPositions === null || seedsWithoutDrawPositions === void 0 ? void 0 : seedsWithoutDrawPositions.length) !== null && _b !== void 0 ? _b : 0;
|
|
25326
25338
|
var unfilled = (seedsLeftToAssign &&
|
|
25327
25339
|
(nextSeedBlock === null || nextSeedBlock === void 0 ? void 0 : nextSeedBlock.drawPositions.filter(function (drawPosition) { return !(assignedDrawPositions === null || assignedDrawPositions === void 0 ? void 0 : assignedDrawPositions.includes(drawPosition)); }))) ||
|
|
25328
25340
|
[];
|
|
@@ -25347,7 +25359,7 @@ function getNextSeedBlock(params) {
|
|
|
25347
25359
|
var unplacedSeedNumberIds = seedAssignments === null || seedAssignments === void 0 ? void 0 : seedAssignments.filter(function (assignment) {
|
|
25348
25360
|
return unplacedSeedNumbers.includes(assignment.seedNumber);
|
|
25349
25361
|
}).map(function (assignment) { return assignment.participantId; });
|
|
25350
|
-
var duplicateSeedNumbers = (
|
|
25362
|
+
var duplicateSeedNumbers = (_c = appliedPolicies === null || appliedPolicies === void 0 ? void 0 : appliedPolicies.seeding) === null || _c === void 0 ? void 0 : _c.duplicateSeedNumbers;
|
|
25351
25363
|
var allowsDuplicateSeedNumbers = duplicateSeedNumbers !== undefined ? duplicateSeedNumbers : true;
|
|
25352
25364
|
var unplacedSeedParticipantIds = allowsDuplicateSeedNumbers
|
|
25353
25365
|
? randomlySelectedUnplacedSeedValueIds
|
|
@@ -30751,8 +30763,8 @@ function getParticipantEntries(params) {
|
|
|
30751
30763
|
// id is the pair, team or individual participant currently being processed
|
|
30752
30764
|
// whereas participantId is the id of the entry into the event
|
|
30753
30765
|
var addEventEntry = function (id) {
|
|
30754
|
-
var _a;
|
|
30755
|
-
if ((_a = participantMap[id]) === null || _a === void 0 ? void 0 : _a.events[eventId])
|
|
30766
|
+
var _a, _b;
|
|
30767
|
+
if ((_b = (_a = participantMap[id]) === null || _a === void 0 ? void 0 : _a.events) === null || _b === void 0 ? void 0 : _b[eventId])
|
|
30756
30768
|
return;
|
|
30757
30769
|
var participant = participantMap[id];
|
|
30758
30770
|
processEventEntry({
|
|
@@ -30855,7 +30867,7 @@ function getParticipantEntries(params) {
|
|
|
30855
30867
|
var participantId = _a.participantId;
|
|
30856
30868
|
return assignedParticipantIds.includes(participantId);
|
|
30857
30869
|
});
|
|
30858
|
-
var publishedSeeding_1 = (_d = eventsPublishStatuses[eventId]) === null || _d === void 0 ? void 0 : _d.publishedSeeding;
|
|
30870
|
+
var publishedSeeding_1 = (_d = eventsPublishStatuses === null || eventsPublishStatuses === void 0 ? void 0 : eventsPublishStatuses[eventId]) === null || _d === void 0 ? void 0 : _d.publishedSeeding;
|
|
30859
30871
|
var seedingPublished = !usePublishState ||
|
|
30860
30872
|
((publishedSeeding_1 === null || publishedSeeding_1 === void 0 ? void 0 : publishedSeeding_1.published) &&
|
|
30861
30873
|
(((_e = publishedSeeding_1 === null || publishedSeeding_1 === void 0 ? void 0 : publishedSeeding_1.drawIds) === null || _e === void 0 ? void 0 : _e.length) === 0 ||
|
|
@@ -30872,18 +30884,18 @@ function getParticipantEntries(params) {
|
|
|
30872
30884
|
// id is the pair, team or individual participant currently being processed
|
|
30873
30885
|
// whereas participantId is the id of the entry into the draw
|
|
30874
30886
|
var addDrawEntry = function (id) {
|
|
30875
|
-
var _a, _b, _c, _d, _e;
|
|
30876
|
-
if (participantMap[id].draws[drawId])
|
|
30887
|
+
var _a, _b, _c, _d, _e, _f;
|
|
30888
|
+
if ((_a = participantMap[id].draws) === null || _a === void 0 ? void 0 : _a[drawId])
|
|
30877
30889
|
return;
|
|
30878
30890
|
var includeSeeding = withSeeding && seedingPublished;
|
|
30879
30891
|
var seedAssignments = includeSeeding ? {} : undefined;
|
|
30880
30892
|
var mainSeeding = includeSeeding
|
|
30881
|
-
? ((
|
|
30882
|
-
((
|
|
30893
|
+
? ((_b = mainSeedingMap === null || mainSeedingMap === void 0 ? void 0 : mainSeedingMap[participantId]) === null || _b === void 0 ? void 0 : _b.seedValue) ||
|
|
30894
|
+
((_c = mainSeedingMap === null || mainSeedingMap === void 0 ? void 0 : mainSeedingMap[participantId]) === null || _c === void 0 ? void 0 : _c.seedNumber)
|
|
30883
30895
|
: undefined;
|
|
30884
30896
|
var qualifyingSeeding = includeSeeding
|
|
30885
|
-
? ((
|
|
30886
|
-
((
|
|
30897
|
+
? ((_d = qualifyingSeedingMap === null || qualifyingSeedingMap === void 0 ? void 0 : qualifyingSeedingMap[participantId]) === null || _d === void 0 ? void 0 : _d.seedValue) ||
|
|
30898
|
+
((_e = qualifyingSeedingMap === null || qualifyingSeedingMap === void 0 ? void 0 : qualifyingSeedingMap[participantId]) === null || _e === void 0 ? void 0 : _e.seedNumber)
|
|
30887
30899
|
: undefined;
|
|
30888
30900
|
if (seedAssignments && mainSeeding)
|
|
30889
30901
|
seedAssignments[MAIN] = mainSeeding;
|
|
@@ -30895,7 +30907,7 @@ function getParticipantEntries(params) {
|
|
|
30895
30907
|
participantMap[id].events[eventId].seedValue =
|
|
30896
30908
|
mainSeeding || qualifyingSeeding;
|
|
30897
30909
|
}
|
|
30898
|
-
else if ((
|
|
30910
|
+
else if ((_f = participantMap[id].events[eventId]) === null || _f === void 0 ? void 0 : _f.seedValue) {
|
|
30899
30911
|
// if seeding for specific drawIds is NOT published, remove from event
|
|
30900
30912
|
participantMap[id].events[eventId].seedValue = undefined;
|
|
30901
30913
|
}
|
|
@@ -31280,9 +31292,9 @@ function getParticipants$1(params) {
|
|
|
31280
31292
|
withIOC: withIOC,
|
|
31281
31293
|
}).participantMap;
|
|
31282
31294
|
var entriesResult = getParticipantEntries({
|
|
31283
|
-
withMatchUps: withMatchUps
|
|
31284
|
-
withEvents: withEvents
|
|
31285
|
-
withDraws: withDraws
|
|
31295
|
+
withMatchUps: withMatchUps !== null && withMatchUps !== void 0 ? withMatchUps : withRankingProfile,
|
|
31296
|
+
withEvents: withEvents !== null && withEvents !== void 0 ? withEvents : withRankingProfile,
|
|
31297
|
+
withDraws: withDraws !== null && withDraws !== void 0 ? withDraws : withRankingProfile,
|
|
31286
31298
|
withPotentialMatchUps: withPotentialMatchUps,
|
|
31287
31299
|
participantFilters: participantFilters,
|
|
31288
31300
|
withRankingProfile: withRankingProfile,
|
|
@@ -31302,7 +31314,7 @@ function getParticipants$1(params) {
|
|
|
31302
31314
|
var participantIdsWithConflicts = entriesResult.participantIdsWithConflicts, eventsPublishStatuses = entriesResult.eventsPublishStatuses, derivedEventInfo = entriesResult.derivedEventInfo, derivedDrawInfo = entriesResult.derivedDrawInfo, mappedMatchUps = entriesResult.mappedMatchUps;
|
|
31303
31315
|
var matchUps = entriesResult.matchUps;
|
|
31304
31316
|
participantMap = entriesResult.participantMap;
|
|
31305
|
-
var nextMatchUps = scheduleAnalysis
|
|
31317
|
+
var nextMatchUps = scheduleAnalysis !== null && scheduleAnalysis !== void 0 ? scheduleAnalysis : withPotentialMatchUps;
|
|
31306
31318
|
var processedParticipants = Object.values(participantMap).map(function (_a) {
|
|
31307
31319
|
var potentialMatchUps = _a.potentialMatchUps, scheduleConflicts = _a.scheduleConflicts, participant = _a.participant, statistics = _a.statistics, opponents = _a.opponents, matchUps = _a.matchUps, events = _a.events, draws = _a.draws;
|
|
31308
31320
|
var participantDraws = Object.values(draws);
|
|
@@ -41197,19 +41209,19 @@ function feedInChampionship(params) {
|
|
|
41197
41209
|
|
|
41198
41210
|
function processPlayoffGroups(_a) {
|
|
41199
41211
|
var e_1, _b;
|
|
41200
|
-
var _c, _d;
|
|
41201
|
-
var
|
|
41212
|
+
var _c, _d, _e, _f, _g, _h, _j;
|
|
41213
|
+
var _k = _a.compassAttributes, compassAttributes = _k === void 0 ? COMPASS_ATTRIBUTES : _k, _l = _a.olympicAttributes, olympicAttributes = _l === void 0 ? OLYMPIC_ATTRIBUTES : _l, _m = _a.requireSequential, requireSequential = _m === void 0 ? true : _m, playoffMatchUpFormat = _a.playoffMatchUpFormat, sourceStructureId = _a.sourceStructureId, policyDefinitions = _a.policyDefinitions, stageSequence = _a.stageSequence, drawDefinition = _a.drawDefinition, playoffGroups = _a.playoffGroups, matchUpType = _a.matchUpType, feedPolicy = _a.feedPolicy, groupCount = _a.groupCount, idPrefix = _a.idPrefix, isMock = _a.isMock, uuids = _a.uuids;
|
|
41202
41214
|
feedPolicy = feedPolicy || (policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_FEED_IN]);
|
|
41203
41215
|
var stack = 'processPlayoffGroups';
|
|
41204
41216
|
var finishingPositionOffset = 0;
|
|
41205
41217
|
var finishingPositionTargets = [];
|
|
41206
41218
|
var structures = [];
|
|
41207
41219
|
var links = [];
|
|
41208
|
-
var
|
|
41220
|
+
var _o = getPositionRangeMap({
|
|
41209
41221
|
structureId: sourceStructureId,
|
|
41210
41222
|
drawDefinition: drawDefinition,
|
|
41211
41223
|
playoffGroups: playoffGroups,
|
|
41212
|
-
}), error =
|
|
41224
|
+
}), error = _o.error, positionRangeMap = _o.positionRangeMap;
|
|
41213
41225
|
if (error)
|
|
41214
41226
|
return decorateResult({ result: { error: error }, stack: stack });
|
|
41215
41227
|
var validFinishingPositions = !positionRangeMap ||
|
|
@@ -41232,7 +41244,7 @@ function processPlayoffGroups(_a) {
|
|
|
41232
41244
|
});
|
|
41233
41245
|
}
|
|
41234
41246
|
var _loop_1 = function (playoffGroup) {
|
|
41235
|
-
var
|
|
41247
|
+
var _p;
|
|
41236
41248
|
var finishingPositions = playoffGroup.finishingPositions;
|
|
41237
41249
|
var positionsPlayedOff = positionRangeMap &&
|
|
41238
41250
|
finishingPositions
|
|
@@ -41245,10 +41257,10 @@ function processPlayoffGroups(_a) {
|
|
|
41245
41257
|
finishingPositionOffset = Math.min.apply(Math, __spreadArray([], __read(positionsPlayedOff), false)) - 1;
|
|
41246
41258
|
}
|
|
41247
41259
|
var params = {
|
|
41260
|
+
structureId: (_c = playoffGroup.structureId) !== null && _c !== void 0 ? _c : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41248
41261
|
structureName: playoffGroup.structureName,
|
|
41249
41262
|
idPrefix: idPrefix && "".concat(idPrefix, "-po"),
|
|
41250
41263
|
appliedPolicies: policyDefinitions,
|
|
41251
|
-
structureId: uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41252
41264
|
finishingPositionOffset: finishingPositionOffset,
|
|
41253
41265
|
stage: PLAY_OFF,
|
|
41254
41266
|
stageSequence: stageSequence,
|
|
@@ -41286,9 +41298,9 @@ function processPlayoffGroups(_a) {
|
|
|
41286
41298
|
uuids: uuids,
|
|
41287
41299
|
}).matchUps;
|
|
41288
41300
|
var playoffStructure = structureTemplate({
|
|
41301
|
+
structureId: (_d = playoffGroup.structureId) !== null && _d !== void 0 ? _d : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41289
41302
|
structureName: playoffGroup.structureName,
|
|
41290
41303
|
matchUpFormat: playoffMatchUpFormat,
|
|
41291
|
-
structureId: uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41292
41304
|
stage: PLAY_OFF,
|
|
41293
41305
|
stageSequence: stageSequence,
|
|
41294
41306
|
matchUps: matchUps,
|
|
@@ -41310,6 +41322,7 @@ function processPlayoffGroups(_a) {
|
|
|
41310
41322
|
else if ([COMPASS, OLYMPIC, PLAY_OFF].includes(playoffDrawType)) {
|
|
41311
41323
|
var structureName = playoffGroup.structureName;
|
|
41312
41324
|
var params_1 = {
|
|
41325
|
+
structureId: (_e = playoffGroup.structureId) !== null && _e !== void 0 ? _e : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41313
41326
|
playoffStructureNameBase: structureName,
|
|
41314
41327
|
idPrefix: idPrefix && "".concat(idPrefix, "-po"),
|
|
41315
41328
|
addNameBaseToAttributeName: true,
|
|
@@ -41336,9 +41349,9 @@ function processPlayoffGroups(_a) {
|
|
|
41336
41349
|
var result = generatePlayoffStructures(params_1);
|
|
41337
41350
|
if (result.error)
|
|
41338
41351
|
return { value: result };
|
|
41339
|
-
if ((
|
|
41352
|
+
if ((_f = result.links) === null || _f === void 0 ? void 0 : _f.length)
|
|
41340
41353
|
links.push.apply(links, __spreadArray([], __read(result.links), false));
|
|
41341
|
-
if ((
|
|
41354
|
+
if ((_g = result.structures) === null || _g === void 0 ? void 0 : _g.length)
|
|
41342
41355
|
structures.push.apply(structures, __spreadArray([], __read(result.structures), false));
|
|
41343
41356
|
structures.sort(structureSort);
|
|
41344
41357
|
if (result.structureId) {
|
|
@@ -41366,6 +41379,7 @@ function processPlayoffGroups(_a) {
|
|
|
41366
41379
|
].includes(playoffDrawType)) {
|
|
41367
41380
|
var uuidsFMLC = [uuids === null || uuids === void 0 ? void 0 : uuids.pop(), uuids === null || uuids === void 0 ? void 0 : uuids.pop()];
|
|
41368
41381
|
var params_2 = {
|
|
41382
|
+
structureId: (_h = playoffGroup.structureId) !== null && _h !== void 0 ? _h : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41369
41383
|
structureName: playoffGroup.structureName,
|
|
41370
41384
|
idPrefix: idPrefix && "".concat(idPrefix, "-po"),
|
|
41371
41385
|
finishingPositionOffset: finishingPositionOffset,
|
|
@@ -41376,16 +41390,16 @@ function processPlayoffGroups(_a) {
|
|
|
41376
41390
|
drawSize: drawSize,
|
|
41377
41391
|
isMock: isMock,
|
|
41378
41392
|
};
|
|
41379
|
-
var additionalAttributes = (
|
|
41380
|
-
|
|
41381
|
-
|
|
41382
|
-
|
|
41383
|
-
|
|
41384
|
-
|
|
41385
|
-
|
|
41393
|
+
var additionalAttributes = (_p = {},
|
|
41394
|
+
_p[FIRST_MATCH_LOSER_CONSOLATION] = { fmlc: true, feedRounds: 1 },
|
|
41395
|
+
_p[MODIFIED_FEED_IN_CHAMPIONSHIP] = { feedRounds: 1 },
|
|
41396
|
+
_p[FEED_IN_CHAMPIONSHIP_TO_R16] = { feedsFromFinal: 3 },
|
|
41397
|
+
_p[FEED_IN_CHAMPIONSHIP_TO_QF] = { feedsFromFinal: 2 },
|
|
41398
|
+
_p[FEED_IN_CHAMPIONSHIP_TO_SF] = { feedsFromFinal: 1 },
|
|
41399
|
+
_p);
|
|
41386
41400
|
Object.assign(params_2, additionalAttributes[playoffDrawType] || {});
|
|
41387
|
-
var
|
|
41388
|
-
var
|
|
41401
|
+
var _q = feedInChampionship(params_2), champitionShipStructures = _q.structures, feedInLinks = _q.links;
|
|
41402
|
+
var _r = __read(champitionShipStructures, 1), playoffStructure = _r[0];
|
|
41389
41403
|
var playoffLink = generatePlayoffLink({
|
|
41390
41404
|
playoffStructureId: playoffStructure.structureId,
|
|
41391
41405
|
finishingPositions: finishingPositions,
|
|
@@ -41402,22 +41416,22 @@ function processPlayoffGroups(_a) {
|
|
|
41402
41416
|
finishingPositionOffset += participantsInDraw;
|
|
41403
41417
|
}
|
|
41404
41418
|
else if ([ROUND_ROBIN].includes(playoffDrawType)) {
|
|
41405
|
-
var
|
|
41419
|
+
var _s = generateRoundRobin(__assign(__assign({}, params), { structureOptions: playoffGroup.structureOptions || { groupSize: 4 } })), playoffStructures = _s.structures, playoffLinks = _s.links;
|
|
41406
41420
|
updateStructureAndLinks({ playoffStructures: playoffStructures, playoffLinks: playoffLinks });
|
|
41407
41421
|
}
|
|
41408
41422
|
else if ([FIRST_ROUND_LOSER_CONSOLATION].includes(playoffDrawType)) {
|
|
41409
|
-
var
|
|
41423
|
+
var _t = firstRoundLoserConsolation(params), playoffStructures = _t.structures, playoffLinks = _t.links;
|
|
41410
41424
|
updateStructureAndLinks({ playoffStructures: playoffStructures, playoffLinks: playoffLinks });
|
|
41411
41425
|
}
|
|
41412
41426
|
else if ([CURTIS_CONSOLATION].includes(playoffDrawType)) {
|
|
41413
|
-
var
|
|
41427
|
+
var _u = generateCurtisConsolation(params), playoffStructures = _u.structures, playoffLinks = _u.links;
|
|
41414
41428
|
updateStructureAndLinks({ playoffStructures: playoffStructures, playoffLinks: playoffLinks });
|
|
41415
41429
|
}
|
|
41416
41430
|
else if ([AD_HOC].includes(playoffDrawType)) {
|
|
41417
41431
|
var structure = structureTemplate({
|
|
41432
|
+
structureId: (_j = playoffGroup.structureId) !== null && _j !== void 0 ? _j : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41418
41433
|
structureName: playoffGroup.structureName,
|
|
41419
41434
|
finishingPosition: WIN_RATIO$1,
|
|
41420
|
-
structureId: uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41421
41435
|
stage: PLAY_OFF,
|
|
41422
41436
|
stageSequence: stageSequence,
|
|
41423
41437
|
matchUps: [],
|
|
@@ -44133,7 +44147,7 @@ function positionSeedBlock(_a) {
|
|
|
44133
44147
|
|
|
44134
44148
|
function automatedPositioning$1(_a) {
|
|
44135
44149
|
var _b;
|
|
44136
|
-
var _c = _a.applyPositioning, applyPositioning = _c === void 0 ? true : _c, provisionalPositioning = _a.provisionalPositioning, inContextDrawMatchUps = _a.inContextDrawMatchUps, multipleStructures = _a.multipleStructures, _d = _a.placeByes, placeByes = _d === void 0 ? true : _d, tournamentRecord = _a.tournamentRecord, appliedPolicies = _a.appliedPolicies, drawDefinition = _a.drawDefinition, seedingProfile = _a.seedingProfile, participants = _a.participants, structureId = _a.structureId, matchUpsMap = _a.matchUpsMap, seedLimit = _a.seedLimit, seedsOnly = _a.seedsOnly, drawType = _a.drawType, drawSize = _a.drawSize, event = _a.event;
|
|
44150
|
+
var _c = _a.applyPositioning, applyPositioning = _c === void 0 ? true : _c, provisionalPositioning = _a.provisionalPositioning, inContextDrawMatchUps = _a.inContextDrawMatchUps, multipleStructures = _a.multipleStructures, _d = _a.placeByes, placeByes = _d === void 0 ? true : _d, tournamentRecord = _a.tournamentRecord, appliedPolicies = _a.appliedPolicies, placementGroup = _a.placementGroup, drawDefinition = _a.drawDefinition, seedingProfile = _a.seedingProfile, participants = _a.participants, structureId = _a.structureId, matchUpsMap = _a.matchUpsMap, seedLimit = _a.seedLimit, seedsOnly = _a.seedsOnly, drawType = _a.drawType, drawSize = _a.drawSize, event = _a.event;
|
|
44137
44151
|
var positioningReport = [];
|
|
44138
44152
|
//-----------------------------------------------------------
|
|
44139
44153
|
// handle notification state for all exit conditions
|
|
@@ -44181,6 +44195,7 @@ function automatedPositioning$1(_a) {
|
|
|
44181
44195
|
stageSequence: structure.stageSequence,
|
|
44182
44196
|
provisionalPositioning: provisionalPositioning,
|
|
44183
44197
|
stage: structure.stage,
|
|
44198
|
+
placementGroup: placementGroup,
|
|
44184
44199
|
drawDefinition: drawDefinition,
|
|
44185
44200
|
entryStatuses: entryStatuses,
|
|
44186
44201
|
structureId: structureId,
|
|
@@ -44385,7 +44400,8 @@ function automatedPositioning(_a) {
|
|
|
44385
44400
|
}
|
|
44386
44401
|
function automatedPlayoffPositioning(params) {
|
|
44387
44402
|
var e_1, _a;
|
|
44388
|
-
var _b
|
|
44403
|
+
var _b;
|
|
44404
|
+
var _c = params.applyPositioning, applyPositioning = _c === void 0 ? true : _c, provisionalPositioning = params.provisionalPositioning, tournamentRecord = params.tournamentRecord, drawDefinition = params.drawDefinition, seedingProfile = params.seedingProfile, structureId = params.structureId, placeByes = params.placeByes, seedsOnly = params.seedsOnly, event = params.event;
|
|
44389
44405
|
if (!event)
|
|
44390
44406
|
return { error: EVENT_NOT_FOUND };
|
|
44391
44407
|
if (!drawDefinition)
|
|
@@ -44397,10 +44413,10 @@ function automatedPlayoffPositioning(params) {
|
|
|
44397
44413
|
if (!structureIsComplete && !provisionalPositioning) {
|
|
44398
44414
|
return { error: INCOMPLETE_SOURCE_STRUCTURE };
|
|
44399
44415
|
}
|
|
44400
|
-
var playoffStructures = getPlayoffStructures({
|
|
44416
|
+
var playoffStructures = (_b = getPlayoffStructures({
|
|
44401
44417
|
drawDefinition: drawDefinition,
|
|
44402
44418
|
structureId: structureId,
|
|
44403
|
-
}).playoffStructures;
|
|
44419
|
+
}).playoffStructures) === null || _b === void 0 ? void 0 : _b.sort(function (a, b) { return getMinFinishingPositionRange(a) - getMinFinishingPositionRange(b); });
|
|
44404
44420
|
var structurePositionAssignments = [];
|
|
44405
44421
|
var participants = tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.participants;
|
|
44406
44422
|
if (playoffStructures) {
|
|
@@ -44553,7 +44569,7 @@ function generateAndPopulatePlayoffStructures(params) {
|
|
|
44553
44569
|
if (availabilityResult.error) {
|
|
44554
44570
|
return decorateResult({ result: availabilityResult, stack: stack });
|
|
44555
44571
|
}
|
|
44556
|
-
var sourceStructureId = params.structureId, addNameBaseToAttributeName = params.addNameBaseToAttributeName, playoffStructureNameBase = params.playoffStructureNameBase,
|
|
44572
|
+
var sourceStructureId = params.structureId, addNameBaseToAttributeName = params.addNameBaseToAttributeName, playoffStructureNameBase = params.playoffStructureNameBase, playoffAttributes = params.playoffAttributes, playoffPositions = params.playoffPositions, tournamentRecord = params.tournamentRecord, exitProfileLimit = params.exitProfileLimit, roundProfiles = params.roundProfiles, roundNumbers = params.roundNumbers, idPrefix = params.idPrefix, isMock = params.isMock, event = params.event, uuids = params.uuids;
|
|
44557
44573
|
// The goal here is to return { structures, links } and not modify existing drawDefinition
|
|
44558
44574
|
// However, a copy of the drawDefinition needs to have the structures attached in order to
|
|
44559
44575
|
// populate the newly created structures with participants which should advance into them
|
|
@@ -44669,7 +44685,7 @@ function generateAndPopulatePlayoffStructures(params) {
|
|
|
44669
44685
|
}
|
|
44670
44686
|
};
|
|
44671
44687
|
try {
|
|
44672
|
-
for (var _g = __values(sourceRounds
|
|
44688
|
+
for (var _g = __values(sourceRounds !== null && sourceRounds !== void 0 ? sourceRounds : []), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
44673
44689
|
var roundNumber = _h.value;
|
|
44674
44690
|
var state_1 = _loop_1(roundNumber);
|
|
44675
44691
|
if (typeof state_1 === "object")
|
|
@@ -58579,7 +58595,6 @@ var tieFormatConstants = {
|
|
|
58579
58595
|
};
|
|
58580
58596
|
|
|
58581
58597
|
var _a$1;
|
|
58582
|
-
var bestOf3tbSets = 'SET3-S:6/TB7';
|
|
58583
58598
|
var STANDARD = 'STANDARD';
|
|
58584
58599
|
var namedFormats = (_a$1 = {},
|
|
58585
58600
|
_a$1[STANDARD] = {
|
|
@@ -58596,9 +58611,9 @@ var namedFormats = (_a$1 = {},
|
|
|
58596
58611
|
matchUpFormat: 'SET1-S:8/TB7@7',
|
|
58597
58612
|
},
|
|
58598
58613
|
singles: {
|
|
58614
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58599
58615
|
matchUpCount: 6,
|
|
58600
58616
|
matchUpValue: 1,
|
|
58601
|
-
matchUpFormat: bestOf3tbSets,
|
|
58602
58617
|
},
|
|
58603
58618
|
tieFormatName: COLLEGE_D3,
|
|
58604
58619
|
valueGoal: 5,
|
|
@@ -58608,12 +58623,12 @@ var namedFormats = (_a$1 = {},
|
|
|
58608
58623
|
doubles: {
|
|
58609
58624
|
matchUpCount: 3,
|
|
58610
58625
|
collectionValue: 1,
|
|
58611
|
-
matchUpFormat:
|
|
58626
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58612
58627
|
},
|
|
58613
58628
|
singles: {
|
|
58614
58629
|
matchUpCount: 6,
|
|
58615
58630
|
matchUpValue: 1,
|
|
58616
|
-
matchUpFormat:
|
|
58631
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58617
58632
|
},
|
|
58618
58633
|
tieFormatName: COLLEGE_DEFAULT,
|
|
58619
58634
|
valueGoal: 4,
|
|
@@ -58628,7 +58643,7 @@ var namedFormats = (_a$1 = {},
|
|
|
58628
58643
|
singles: {
|
|
58629
58644
|
matchUpCount: 6,
|
|
58630
58645
|
matchUpValue: 1,
|
|
58631
|
-
matchUpFormat:
|
|
58646
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58632
58647
|
},
|
|
58633
58648
|
tieFormatName: COLLEGE_JUCO,
|
|
58634
58649
|
valueGoal: 5,
|
|
@@ -58668,8 +58683,8 @@ var tieFormatDefaults = function (params) {
|
|
|
58668
58683
|
valueGoal: template.valueGoal,
|
|
58669
58684
|
},
|
|
58670
58685
|
collectionDefinitions: [
|
|
58671
|
-
__assign({ collectionId: (uuids === null || uuids === void 0 ? void 0 : uuids.pop()) || UUID(), matchUpFormat:
|
|
58672
|
-
__assign({ collectionId: (uuids === null || uuids === void 0 ? void 0 : uuids.pop()) || UUID(), matchUpType: TypeEnum.Singles, matchUpFormat:
|
|
58686
|
+
__assign({ collectionId: (uuids === null || uuids === void 0 ? void 0 : uuids.pop()) || UUID(), matchUpFormat: FORMAT_ATP_DOUBLES, matchUpType: TypeEnum.Doubles, collectionName: 'Doubles' }, template.doubles),
|
|
58687
|
+
__assign({ collectionId: (uuids === null || uuids === void 0 ? void 0 : uuids.pop()) || UUID(), matchUpType: TypeEnum.Singles, matchUpFormat: FORMAT_STANDARD, collectionName: 'Singles' }, template.singles),
|
|
58673
58688
|
],
|
|
58674
58689
|
};
|
|
58675
58690
|
if (template.tieFormatName)
|
|
@@ -61471,7 +61486,7 @@ function generateDrawDefinition(params) {
|
|
|
61471
61486
|
else if (!matchUpFormat) {
|
|
61472
61487
|
tieFormat = undefined;
|
|
61473
61488
|
if (!(event === null || event === void 0 ? void 0 : event.matchUpFormat)) {
|
|
61474
|
-
matchUpFormat =
|
|
61489
|
+
matchUpFormat = FORMAT_STANDARD;
|
|
61475
61490
|
}
|
|
61476
61491
|
}
|
|
61477
61492
|
var invalidDrawId = params.drawId && typeof params.drawId !== 'string';
|
|
@@ -65514,9 +65529,9 @@ var defaultStatusProfile = (_a = {},
|
|
|
65514
65529
|
function generateOutcome(params) {
|
|
65515
65530
|
var e_1, _a;
|
|
65516
65531
|
var _b = params.defaultWithScorePercent, defaultWithScorePercent = _b === void 0 ? 2 : _b, winningSide = params.winningSide;
|
|
65517
|
-
var _c = params.
|
|
65518
|
-
|
|
65519
|
-
pointsPerMinute = _e === void 0 ? 1 : _e, _f = params.sideWeight, sideWeight = _f === void 0 ? 4 : _f;
|
|
65532
|
+
var _c = params.matchUpStatusProfile, matchUpStatusProfile = _c === void 0 ? defaultStatusProfile : _c, // { matchUpStatusProfile: {} } will always return only { matchUpStatus: COMPLETED }
|
|
65533
|
+
_d = params.matchUpFormat, // { matchUpStatusProfile: {} } will always return only { matchUpStatus: COMPLETED }
|
|
65534
|
+
matchUpFormat = _d === void 0 ? FORMAT_STANDARD : _d, _e = params.pointsPerMinute, pointsPerMinute = _e === void 0 ? 1 : _e, _f = params.sideWeight, sideWeight = _f === void 0 ? 4 : _f;
|
|
65520
65535
|
if (!isValid(matchUpFormat))
|
|
65521
65536
|
return { error: INVALID_MATCHUP_FORMAT };
|
|
65522
65537
|
if (typeof matchUpStatusProfile !== 'object')
|