tods-competition-factory 1.6.10 → 1.6.11
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 +145 -136
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.mjs +5 -2
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +5 -2
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +32 -24
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +53 -50
- 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.11';
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
/******************************************************************************
|
|
@@ -7721,7 +7721,7 @@ var drawDefinitionConstants = {
|
|
|
7721
7721
|
};
|
|
7722
7722
|
|
|
7723
7723
|
function structureSort(a, b, config) {
|
|
7724
|
-
var _a, _b;
|
|
7724
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7725
7725
|
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
7726
|
var completed = config === null || config === void 0 ? void 0 : config.deprioritizeCompleted;
|
|
7727
7727
|
var aggregate = (config === null || config === void 0 ? void 0 : config.mode) === AGGREGATE_EVENT_STRUCTURES && aggregateOrder;
|
|
@@ -7744,9 +7744,9 @@ function structureSort(a, b, config) {
|
|
|
7744
7744
|
(getRoundTarget(a) || 0) - (getRoundTarget(b) || 0) ||
|
|
7745
7745
|
(!finish &&
|
|
7746
7746
|
!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)
|
|
7747
|
+
((_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) -
|
|
7748
|
+
((_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)) ||
|
|
7749
|
+
((_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
7750
|
(getMinFinishingPositionRange(a) || 0) -
|
|
7751
7751
|
(getMinFinishingPositionRange(b) || 0));
|
|
7752
7752
|
}
|
|
@@ -7940,7 +7940,7 @@ function getStageEntryTypeCount(_a) {
|
|
|
7940
7940
|
}
|
|
7941
7941
|
function getStageEntries$1(_a) {
|
|
7942
7942
|
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;
|
|
7943
|
+
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
7944
|
var entries = (_c = (_b = drawDefinition.entries) === null || _b === void 0 ? void 0 : _b.reduce(function (entries, entry) {
|
|
7945
7945
|
var _a, _b, _c;
|
|
7946
7946
|
var entryRoundTarget = (_b = (_a = findExtension$2({
|
|
@@ -7970,7 +7970,7 @@ function getStageEntries$1(_a) {
|
|
|
7970
7970
|
if (error) {
|
|
7971
7971
|
console.log('playoff entries error'); // TODO: bubble this up...
|
|
7972
7972
|
}
|
|
7973
|
-
return (playoffEntries === null || playoffEntries === void 0 ? void 0 : playoffEntries.length) ? playoffEntries : entries;
|
|
7973
|
+
return ((playoffEntries === null || playoffEntries === void 0 ? void 0 : playoffEntries.length) ? playoffEntries : entries).filter(function (entry) { return !placementGroup || entry.placementGroup === placementGroup; });
|
|
7974
7974
|
}
|
|
7975
7975
|
return entries;
|
|
7976
7976
|
}
|
|
@@ -16188,7 +16188,7 @@ var POLICY_SCHEDULING_USTA = (_a$9 = {},
|
|
|
16188
16188
|
_c),
|
|
16189
16189
|
matchUpAverageTimes: [
|
|
16190
16190
|
{
|
|
16191
|
-
matchUpFormatCodes: [
|
|
16191
|
+
matchUpFormatCodes: [FORMAT_STANDARD],
|
|
16192
16192
|
averageTimes: [
|
|
16193
16193
|
{
|
|
16194
16194
|
categoryNames: [],
|
|
@@ -16361,11 +16361,11 @@ var POLICY_SCORING_USTA = (_a$8 = {},
|
|
|
16361
16361
|
},
|
|
16362
16362
|
},
|
|
16363
16363
|
_b$2),
|
|
16364
|
-
defaultMatchUpFormat:
|
|
16364
|
+
defaultMatchUpFormat: FORMAT_STANDARD,
|
|
16365
16365
|
matchUpFormats: [
|
|
16366
16366
|
{
|
|
16367
16367
|
description: 'Best of 3 tiebreak sets',
|
|
16368
|
-
matchUpFormat:
|
|
16368
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
16369
16369
|
categoryNames: [],
|
|
16370
16370
|
categoryTypes: [],
|
|
16371
16371
|
},
|
|
@@ -16452,7 +16452,7 @@ var _a$7, _b$1;
|
|
|
16452
16452
|
*/
|
|
16453
16453
|
var POLICY_SCORING_DEFAULT = (_a$7 = {},
|
|
16454
16454
|
_a$7[POLICY_TYPE_SCORING] = {
|
|
16455
|
-
defaultMatchUpFormat:
|
|
16455
|
+
defaultMatchUpFormat: FORMAT_STANDARD,
|
|
16456
16456
|
requireAllPositionsAssigned: false,
|
|
16457
16457
|
processCodes: {
|
|
16458
16458
|
incompleteAssignmentsOnDefault: ['RANKING.IGNORE'],
|
|
@@ -41197,19 +41197,19 @@ function feedInChampionship(params) {
|
|
|
41197
41197
|
|
|
41198
41198
|
function processPlayoffGroups(_a) {
|
|
41199
41199
|
var e_1, _b;
|
|
41200
|
-
var _c, _d;
|
|
41201
|
-
var
|
|
41200
|
+
var _c, _d, _e, _f, _g, _h, _j;
|
|
41201
|
+
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
41202
|
feedPolicy = feedPolicy || (policyDefinitions === null || policyDefinitions === void 0 ? void 0 : policyDefinitions[POLICY_TYPE_FEED_IN]);
|
|
41203
41203
|
var stack = 'processPlayoffGroups';
|
|
41204
41204
|
var finishingPositionOffset = 0;
|
|
41205
41205
|
var finishingPositionTargets = [];
|
|
41206
41206
|
var structures = [];
|
|
41207
41207
|
var links = [];
|
|
41208
|
-
var
|
|
41208
|
+
var _o = getPositionRangeMap({
|
|
41209
41209
|
structureId: sourceStructureId,
|
|
41210
41210
|
drawDefinition: drawDefinition,
|
|
41211
41211
|
playoffGroups: playoffGroups,
|
|
41212
|
-
}), error =
|
|
41212
|
+
}), error = _o.error, positionRangeMap = _o.positionRangeMap;
|
|
41213
41213
|
if (error)
|
|
41214
41214
|
return decorateResult({ result: { error: error }, stack: stack });
|
|
41215
41215
|
var validFinishingPositions = !positionRangeMap ||
|
|
@@ -41232,7 +41232,7 @@ function processPlayoffGroups(_a) {
|
|
|
41232
41232
|
});
|
|
41233
41233
|
}
|
|
41234
41234
|
var _loop_1 = function (playoffGroup) {
|
|
41235
|
-
var
|
|
41235
|
+
var _p;
|
|
41236
41236
|
var finishingPositions = playoffGroup.finishingPositions;
|
|
41237
41237
|
var positionsPlayedOff = positionRangeMap &&
|
|
41238
41238
|
finishingPositions
|
|
@@ -41245,10 +41245,10 @@ function processPlayoffGroups(_a) {
|
|
|
41245
41245
|
finishingPositionOffset = Math.min.apply(Math, __spreadArray([], __read(positionsPlayedOff), false)) - 1;
|
|
41246
41246
|
}
|
|
41247
41247
|
var params = {
|
|
41248
|
+
structureId: (_c = playoffGroup.structureId) !== null && _c !== void 0 ? _c : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41248
41249
|
structureName: playoffGroup.structureName,
|
|
41249
41250
|
idPrefix: idPrefix && "".concat(idPrefix, "-po"),
|
|
41250
41251
|
appliedPolicies: policyDefinitions,
|
|
41251
|
-
structureId: uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41252
41252
|
finishingPositionOffset: finishingPositionOffset,
|
|
41253
41253
|
stage: PLAY_OFF,
|
|
41254
41254
|
stageSequence: stageSequence,
|
|
@@ -41286,9 +41286,9 @@ function processPlayoffGroups(_a) {
|
|
|
41286
41286
|
uuids: uuids,
|
|
41287
41287
|
}).matchUps;
|
|
41288
41288
|
var playoffStructure = structureTemplate({
|
|
41289
|
+
structureId: (_d = playoffGroup.structureId) !== null && _d !== void 0 ? _d : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41289
41290
|
structureName: playoffGroup.structureName,
|
|
41290
41291
|
matchUpFormat: playoffMatchUpFormat,
|
|
41291
|
-
structureId: uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41292
41292
|
stage: PLAY_OFF,
|
|
41293
41293
|
stageSequence: stageSequence,
|
|
41294
41294
|
matchUps: matchUps,
|
|
@@ -41310,6 +41310,7 @@ function processPlayoffGroups(_a) {
|
|
|
41310
41310
|
else if ([COMPASS, OLYMPIC, PLAY_OFF].includes(playoffDrawType)) {
|
|
41311
41311
|
var structureName = playoffGroup.structureName;
|
|
41312
41312
|
var params_1 = {
|
|
41313
|
+
structureId: (_e = playoffGroup.structureId) !== null && _e !== void 0 ? _e : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41313
41314
|
playoffStructureNameBase: structureName,
|
|
41314
41315
|
idPrefix: idPrefix && "".concat(idPrefix, "-po"),
|
|
41315
41316
|
addNameBaseToAttributeName: true,
|
|
@@ -41336,9 +41337,9 @@ function processPlayoffGroups(_a) {
|
|
|
41336
41337
|
var result = generatePlayoffStructures(params_1);
|
|
41337
41338
|
if (result.error)
|
|
41338
41339
|
return { value: result };
|
|
41339
|
-
if ((
|
|
41340
|
+
if ((_f = result.links) === null || _f === void 0 ? void 0 : _f.length)
|
|
41340
41341
|
links.push.apply(links, __spreadArray([], __read(result.links), false));
|
|
41341
|
-
if ((
|
|
41342
|
+
if ((_g = result.structures) === null || _g === void 0 ? void 0 : _g.length)
|
|
41342
41343
|
structures.push.apply(structures, __spreadArray([], __read(result.structures), false));
|
|
41343
41344
|
structures.sort(structureSort);
|
|
41344
41345
|
if (result.structureId) {
|
|
@@ -41366,6 +41367,7 @@ function processPlayoffGroups(_a) {
|
|
|
41366
41367
|
].includes(playoffDrawType)) {
|
|
41367
41368
|
var uuidsFMLC = [uuids === null || uuids === void 0 ? void 0 : uuids.pop(), uuids === null || uuids === void 0 ? void 0 : uuids.pop()];
|
|
41368
41369
|
var params_2 = {
|
|
41370
|
+
structureId: (_h = playoffGroup.structureId) !== null && _h !== void 0 ? _h : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41369
41371
|
structureName: playoffGroup.structureName,
|
|
41370
41372
|
idPrefix: idPrefix && "".concat(idPrefix, "-po"),
|
|
41371
41373
|
finishingPositionOffset: finishingPositionOffset,
|
|
@@ -41376,16 +41378,16 @@ function processPlayoffGroups(_a) {
|
|
|
41376
41378
|
drawSize: drawSize,
|
|
41377
41379
|
isMock: isMock,
|
|
41378
41380
|
};
|
|
41379
|
-
var additionalAttributes = (
|
|
41380
|
-
|
|
41381
|
-
|
|
41382
|
-
|
|
41383
|
-
|
|
41384
|
-
|
|
41385
|
-
|
|
41381
|
+
var additionalAttributes = (_p = {},
|
|
41382
|
+
_p[FIRST_MATCH_LOSER_CONSOLATION] = { fmlc: true, feedRounds: 1 },
|
|
41383
|
+
_p[MODIFIED_FEED_IN_CHAMPIONSHIP] = { feedRounds: 1 },
|
|
41384
|
+
_p[FEED_IN_CHAMPIONSHIP_TO_R16] = { feedsFromFinal: 3 },
|
|
41385
|
+
_p[FEED_IN_CHAMPIONSHIP_TO_QF] = { feedsFromFinal: 2 },
|
|
41386
|
+
_p[FEED_IN_CHAMPIONSHIP_TO_SF] = { feedsFromFinal: 1 },
|
|
41387
|
+
_p);
|
|
41386
41388
|
Object.assign(params_2, additionalAttributes[playoffDrawType] || {});
|
|
41387
|
-
var
|
|
41388
|
-
var
|
|
41389
|
+
var _q = feedInChampionship(params_2), champitionShipStructures = _q.structures, feedInLinks = _q.links;
|
|
41390
|
+
var _r = __read(champitionShipStructures, 1), playoffStructure = _r[0];
|
|
41389
41391
|
var playoffLink = generatePlayoffLink({
|
|
41390
41392
|
playoffStructureId: playoffStructure.structureId,
|
|
41391
41393
|
finishingPositions: finishingPositions,
|
|
@@ -41402,22 +41404,22 @@ function processPlayoffGroups(_a) {
|
|
|
41402
41404
|
finishingPositionOffset += participantsInDraw;
|
|
41403
41405
|
}
|
|
41404
41406
|
else if ([ROUND_ROBIN].includes(playoffDrawType)) {
|
|
41405
|
-
var
|
|
41407
|
+
var _s = generateRoundRobin(__assign(__assign({}, params), { structureOptions: playoffGroup.structureOptions || { groupSize: 4 } })), playoffStructures = _s.structures, playoffLinks = _s.links;
|
|
41406
41408
|
updateStructureAndLinks({ playoffStructures: playoffStructures, playoffLinks: playoffLinks });
|
|
41407
41409
|
}
|
|
41408
41410
|
else if ([FIRST_ROUND_LOSER_CONSOLATION].includes(playoffDrawType)) {
|
|
41409
|
-
var
|
|
41411
|
+
var _t = firstRoundLoserConsolation(params), playoffStructures = _t.structures, playoffLinks = _t.links;
|
|
41410
41412
|
updateStructureAndLinks({ playoffStructures: playoffStructures, playoffLinks: playoffLinks });
|
|
41411
41413
|
}
|
|
41412
41414
|
else if ([CURTIS_CONSOLATION].includes(playoffDrawType)) {
|
|
41413
|
-
var
|
|
41415
|
+
var _u = generateCurtisConsolation(params), playoffStructures = _u.structures, playoffLinks = _u.links;
|
|
41414
41416
|
updateStructureAndLinks({ playoffStructures: playoffStructures, playoffLinks: playoffLinks });
|
|
41415
41417
|
}
|
|
41416
41418
|
else if ([AD_HOC].includes(playoffDrawType)) {
|
|
41417
41419
|
var structure = structureTemplate({
|
|
41420
|
+
structureId: (_j = playoffGroup.structureId) !== null && _j !== void 0 ? _j : uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41418
41421
|
structureName: playoffGroup.structureName,
|
|
41419
41422
|
finishingPosition: WIN_RATIO$1,
|
|
41420
|
-
structureId: uuids === null || uuids === void 0 ? void 0 : uuids.pop(),
|
|
41421
41423
|
stage: PLAY_OFF,
|
|
41422
41424
|
stageSequence: stageSequence,
|
|
41423
41425
|
matchUps: [],
|
|
@@ -44133,7 +44135,7 @@ function positionSeedBlock(_a) {
|
|
|
44133
44135
|
|
|
44134
44136
|
function automatedPositioning$1(_a) {
|
|
44135
44137
|
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;
|
|
44138
|
+
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
44139
|
var positioningReport = [];
|
|
44138
44140
|
//-----------------------------------------------------------
|
|
44139
44141
|
// handle notification state for all exit conditions
|
|
@@ -44181,6 +44183,7 @@ function automatedPositioning$1(_a) {
|
|
|
44181
44183
|
stageSequence: structure.stageSequence,
|
|
44182
44184
|
provisionalPositioning: provisionalPositioning,
|
|
44183
44185
|
stage: structure.stage,
|
|
44186
|
+
placementGroup: placementGroup,
|
|
44184
44187
|
drawDefinition: drawDefinition,
|
|
44185
44188
|
entryStatuses: entryStatuses,
|
|
44186
44189
|
structureId: structureId,
|
|
@@ -44385,7 +44388,8 @@ function automatedPositioning(_a) {
|
|
|
44385
44388
|
}
|
|
44386
44389
|
function automatedPlayoffPositioning(params) {
|
|
44387
44390
|
var e_1, _a;
|
|
44388
|
-
var _b
|
|
44391
|
+
var _b;
|
|
44392
|
+
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
44393
|
if (!event)
|
|
44390
44394
|
return { error: EVENT_NOT_FOUND };
|
|
44391
44395
|
if (!drawDefinition)
|
|
@@ -44397,10 +44401,10 @@ function automatedPlayoffPositioning(params) {
|
|
|
44397
44401
|
if (!structureIsComplete && !provisionalPositioning) {
|
|
44398
44402
|
return { error: INCOMPLETE_SOURCE_STRUCTURE };
|
|
44399
44403
|
}
|
|
44400
|
-
var playoffStructures = getPlayoffStructures({
|
|
44404
|
+
var playoffStructures = (_b = getPlayoffStructures({
|
|
44401
44405
|
drawDefinition: drawDefinition,
|
|
44402
44406
|
structureId: structureId,
|
|
44403
|
-
}).playoffStructures;
|
|
44407
|
+
}).playoffStructures) === null || _b === void 0 ? void 0 : _b.sort(function (a, b) { return getMinFinishingPositionRange(a) - getMinFinishingPositionRange(b); });
|
|
44404
44408
|
var structurePositionAssignments = [];
|
|
44405
44409
|
var participants = tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.participants;
|
|
44406
44410
|
if (playoffStructures) {
|
|
@@ -44553,7 +44557,7 @@ function generateAndPopulatePlayoffStructures(params) {
|
|
|
44553
44557
|
if (availabilityResult.error) {
|
|
44554
44558
|
return decorateResult({ result: availabilityResult, stack: stack });
|
|
44555
44559
|
}
|
|
44556
|
-
var sourceStructureId = params.structureId, addNameBaseToAttributeName = params.addNameBaseToAttributeName, playoffStructureNameBase = params.playoffStructureNameBase,
|
|
44560
|
+
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
44561
|
// The goal here is to return { structures, links } and not modify existing drawDefinition
|
|
44558
44562
|
// However, a copy of the drawDefinition needs to have the structures attached in order to
|
|
44559
44563
|
// populate the newly created structures with participants which should advance into them
|
|
@@ -44669,7 +44673,7 @@ function generateAndPopulatePlayoffStructures(params) {
|
|
|
44669
44673
|
}
|
|
44670
44674
|
};
|
|
44671
44675
|
try {
|
|
44672
|
-
for (var _g = __values(sourceRounds
|
|
44676
|
+
for (var _g = __values(sourceRounds !== null && sourceRounds !== void 0 ? sourceRounds : []), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
44673
44677
|
var roundNumber = _h.value;
|
|
44674
44678
|
var state_1 = _loop_1(roundNumber);
|
|
44675
44679
|
if (typeof state_1 === "object")
|
|
@@ -58579,7 +58583,6 @@ var tieFormatConstants = {
|
|
|
58579
58583
|
};
|
|
58580
58584
|
|
|
58581
58585
|
var _a$1;
|
|
58582
|
-
var bestOf3tbSets = 'SET3-S:6/TB7';
|
|
58583
58586
|
var STANDARD = 'STANDARD';
|
|
58584
58587
|
var namedFormats = (_a$1 = {},
|
|
58585
58588
|
_a$1[STANDARD] = {
|
|
@@ -58596,9 +58599,9 @@ var namedFormats = (_a$1 = {},
|
|
|
58596
58599
|
matchUpFormat: 'SET1-S:8/TB7@7',
|
|
58597
58600
|
},
|
|
58598
58601
|
singles: {
|
|
58602
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58599
58603
|
matchUpCount: 6,
|
|
58600
58604
|
matchUpValue: 1,
|
|
58601
|
-
matchUpFormat: bestOf3tbSets,
|
|
58602
58605
|
},
|
|
58603
58606
|
tieFormatName: COLLEGE_D3,
|
|
58604
58607
|
valueGoal: 5,
|
|
@@ -58608,12 +58611,12 @@ var namedFormats = (_a$1 = {},
|
|
|
58608
58611
|
doubles: {
|
|
58609
58612
|
matchUpCount: 3,
|
|
58610
58613
|
collectionValue: 1,
|
|
58611
|
-
matchUpFormat:
|
|
58614
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58612
58615
|
},
|
|
58613
58616
|
singles: {
|
|
58614
58617
|
matchUpCount: 6,
|
|
58615
58618
|
matchUpValue: 1,
|
|
58616
|
-
matchUpFormat:
|
|
58619
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58617
58620
|
},
|
|
58618
58621
|
tieFormatName: COLLEGE_DEFAULT,
|
|
58619
58622
|
valueGoal: 4,
|
|
@@ -58628,7 +58631,7 @@ var namedFormats = (_a$1 = {},
|
|
|
58628
58631
|
singles: {
|
|
58629
58632
|
matchUpCount: 6,
|
|
58630
58633
|
matchUpValue: 1,
|
|
58631
|
-
matchUpFormat:
|
|
58634
|
+
matchUpFormat: FORMAT_STANDARD,
|
|
58632
58635
|
},
|
|
58633
58636
|
tieFormatName: COLLEGE_JUCO,
|
|
58634
58637
|
valueGoal: 5,
|
|
@@ -58668,8 +58671,8 @@ var tieFormatDefaults = function (params) {
|
|
|
58668
58671
|
valueGoal: template.valueGoal,
|
|
58669
58672
|
},
|
|
58670
58673
|
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:
|
|
58674
|
+
__assign({ collectionId: (uuids === null || uuids === void 0 ? void 0 : uuids.pop()) || UUID(), matchUpFormat: FORMAT_ATP_DOUBLES, matchUpType: TypeEnum.Doubles, collectionName: 'Doubles' }, template.doubles),
|
|
58675
|
+
__assign({ collectionId: (uuids === null || uuids === void 0 ? void 0 : uuids.pop()) || UUID(), matchUpType: TypeEnum.Singles, matchUpFormat: FORMAT_STANDARD, collectionName: 'Singles' }, template.singles),
|
|
58673
58676
|
],
|
|
58674
58677
|
};
|
|
58675
58678
|
if (template.tieFormatName)
|
|
@@ -61471,7 +61474,7 @@ function generateDrawDefinition(params) {
|
|
|
61471
61474
|
else if (!matchUpFormat) {
|
|
61472
61475
|
tieFormat = undefined;
|
|
61473
61476
|
if (!(event === null || event === void 0 ? void 0 : event.matchUpFormat)) {
|
|
61474
|
-
matchUpFormat =
|
|
61477
|
+
matchUpFormat = FORMAT_STANDARD;
|
|
61475
61478
|
}
|
|
61476
61479
|
}
|
|
61477
61480
|
var invalidDrawId = params.drawId && typeof params.drawId !== 'string';
|
|
@@ -65514,9 +65517,9 @@ var defaultStatusProfile = (_a = {},
|
|
|
65514
65517
|
function generateOutcome(params) {
|
|
65515
65518
|
var e_1, _a;
|
|
65516
65519
|
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;
|
|
65520
|
+
var _c = params.matchUpStatusProfile, matchUpStatusProfile = _c === void 0 ? defaultStatusProfile : _c, // { matchUpStatusProfile: {} } will always return only { matchUpStatus: COMPLETED }
|
|
65521
|
+
_d = params.matchUpFormat, // { matchUpStatusProfile: {} } will always return only { matchUpStatus: COMPLETED }
|
|
65522
|
+
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
65523
|
if (!isValid(matchUpFormat))
|
|
65521
65524
|
return { error: INVALID_MATCHUP_FORMAT };
|
|
65522
65525
|
if (typeof matchUpStatusProfile !== 'object')
|