tods-competition-factory 1.8.35 → 1.8.37
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 +22 -17
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +3 -1
- package/dist/forge/query.mjs +17 -12
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +8 -5
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/index.mjs +28 -19
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +39 -22
- 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 +4 -4
|
@@ -2929,7 +2929,7 @@ var matchUpFormatCode = {
|
|
|
2929
2929
|
};
|
|
2930
2930
|
|
|
2931
2931
|
function factoryVersion() {
|
|
2932
|
-
return '1.8.
|
|
2932
|
+
return '1.8.37';
|
|
2933
2933
|
}
|
|
2934
2934
|
|
|
2935
2935
|
function getObjectTieFormat(obj) {
|
|
@@ -17454,7 +17454,7 @@ function addNationalityCode(_a) {
|
|
|
17454
17454
|
function addIndividualParticipants(_a) {
|
|
17455
17455
|
var e_1, _b, e_2, _c;
|
|
17456
17456
|
var _d;
|
|
17457
|
-
var participantMap = _a.participantMap;
|
|
17457
|
+
var participantMap = _a.participantMap, template = _a.template;
|
|
17458
17458
|
var participantObjects = Object.values(participantMap);
|
|
17459
17459
|
try {
|
|
17460
17460
|
for (var participantObjects_1 = __values(participantObjects), participantObjects_1_1 = participantObjects_1.next(); !participantObjects_1_1.done; participantObjects_1_1 = participantObjects_1.next()) {
|
|
@@ -17465,7 +17465,8 @@ function addIndividualParticipants(_a) {
|
|
|
17465
17465
|
try {
|
|
17466
17466
|
for (var _e = (e_2 = void 0, __values(participant.individualParticipantIds)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
17467
17467
|
var participantId = _f.value;
|
|
17468
|
-
|
|
17468
|
+
var source = participantMap[participantId].participant;
|
|
17469
|
+
participant.individualParticipants.push(template ? attributeFilter({ template: template, source: source }) : source);
|
|
17469
17470
|
}
|
|
17470
17471
|
}
|
|
17471
17472
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -17652,8 +17653,12 @@ function getParticipantMap(_a) {
|
|
|
17652
17653
|
}
|
|
17653
17654
|
finally { if (e_2) throw e_2.error; }
|
|
17654
17655
|
}
|
|
17655
|
-
if (withIndividualParticipants)
|
|
17656
|
-
|
|
17656
|
+
if (withIndividualParticipants) {
|
|
17657
|
+
var template = isObject(withIndividualParticipants)
|
|
17658
|
+
? withIndividualParticipants
|
|
17659
|
+
: undefined;
|
|
17660
|
+
addIndividualParticipants({ participantMap: participantMap, template: template });
|
|
17661
|
+
}
|
|
17657
17662
|
return { participantMap: participantMap };
|
|
17658
17663
|
}
|
|
17659
17664
|
function signedIn(participant) {
|
|
@@ -17719,7 +17724,7 @@ function initializeParticipantId(_a) {
|
|
|
17719
17724
|
participantMap[participantId] = {
|
|
17720
17725
|
structureParticipation: {},
|
|
17721
17726
|
potentialMatchUps: {},
|
|
17722
|
-
scheduleConflicts:
|
|
17727
|
+
scheduleConflicts: {},
|
|
17723
17728
|
scheduleItems: [],
|
|
17724
17729
|
participant: {
|
|
17725
17730
|
groupParticipantIds: [],
|
|
@@ -29707,14 +29712,10 @@ function getParticipantEntries(params) {
|
|
|
29707
29712
|
var getRelevantParticipantIds = function (participantId) {
|
|
29708
29713
|
var _a, _b;
|
|
29709
29714
|
var relevantParticipantIds = [participantId];
|
|
29710
|
-
relevantParticipantIds.push(participantId);
|
|
29711
29715
|
(_b = (_a = participantMap[participantId]) === null || _a === void 0 ? void 0 : _a.participant.individualParticipantIds) === null || _b === void 0 ? void 0 : _b.forEach(function (individualParticiapntId) {
|
|
29712
29716
|
return relevantParticipantIds.push(individualParticiapntId);
|
|
29713
29717
|
});
|
|
29714
|
-
return relevantParticipantIds.some(function (
|
|
29715
|
-
return !(targetParticipantIds === null || targetParticipantIds === void 0 ? void 0 : targetParticipantIds.length) ||
|
|
29716
|
-
targetParticipantIds.includes(obj.relevantParticipantId);
|
|
29717
|
-
})
|
|
29718
|
+
return relevantParticipantIds.some(function (id) { return !(targetParticipantIds === null || targetParticipantIds === void 0 ? void 0 : targetParticipantIds.length) || targetParticipantIds.includes(id); })
|
|
29718
29719
|
? relevantParticipantIds
|
|
29719
29720
|
: [];
|
|
29720
29721
|
};
|
|
@@ -30280,10 +30281,13 @@ function getParticipantEntries(params) {
|
|
|
30280
30281
|
timeStringMinutes(notBeforeTime);
|
|
30281
30282
|
// if there is a time overlap capture both the prior matchUpId and the conflicted matchUpId
|
|
30282
30283
|
if (timeOverlap && !(bothPotential && sameDraw) && itemIsPrior) {
|
|
30283
|
-
|
|
30284
|
+
var key = [scheduleItem.matchUpId, consideredItem.matchUpId]
|
|
30285
|
+
.sort()
|
|
30286
|
+
.join('|');
|
|
30287
|
+
participantAggregator.scheduleConflicts[key] = {
|
|
30284
30288
|
priorScheduledMatchUpId: scheduleItem.matchUpId,
|
|
30285
30289
|
matchUpIdWithConflict: consideredItem.matchUpId,
|
|
30286
|
-
}
|
|
30290
|
+
};
|
|
30287
30291
|
}
|
|
30288
30292
|
}
|
|
30289
30293
|
}
|
|
@@ -30304,7 +30308,7 @@ function getParticipantEntries(params) {
|
|
|
30304
30308
|
finally { if (e_9) throw e_9.error; }
|
|
30305
30309
|
}
|
|
30306
30310
|
var pid = participantAggregator.participant.participantId;
|
|
30307
|
-
if (participantAggregator.scheduleConflicts.length) {
|
|
30311
|
+
if (Object.keys(participantAggregator.scheduleConflicts).length) {
|
|
30308
30312
|
participantIdsWithConflicts.push(pid);
|
|
30309
30313
|
}
|
|
30310
30314
|
participantMap[pid].scheduleConflicts =
|
|
@@ -30559,7 +30563,9 @@ function getParticipants$1(params) {
|
|
|
30559
30563
|
draw.opponents = participantOpponents.filter(function (opponent) { return opponent.drawId === draw.drawId; });
|
|
30560
30564
|
});
|
|
30561
30565
|
}
|
|
30562
|
-
return definedAttributes(__assign(__assign({}, participant), { scheduleConflicts: scheduleAnalysis
|
|
30566
|
+
return definedAttributes(__assign(__assign({}, participant), { scheduleConflicts: scheduleAnalysis
|
|
30567
|
+
? Object.values(scheduleConflicts)
|
|
30568
|
+
: undefined, draws: withDraws || withRankingProfile ? participantDraws : undefined, events: withEvents || withRankingProfile ? Object.values(events) : undefined, matchUps: withMatchUps || withRankingProfile
|
|
30563
30569
|
? Object.values(matchUps)
|
|
30564
30570
|
: undefined, opponents: withOpponents ? participantOpponents : undefined, potentialMatchUps: nextMatchUps
|
|
30565
30571
|
? Object.values(potentialMatchUps)
|
|
@@ -30589,6 +30595,9 @@ function getParticipants$1(params) {
|
|
|
30589
30595
|
tournamentRecord: tournamentRecord,
|
|
30590
30596
|
});
|
|
30591
30597
|
if (withIndividualParticipants) {
|
|
30598
|
+
var template_1 = isObject(withIndividualParticipants)
|
|
30599
|
+
? withIndividualParticipants
|
|
30600
|
+
: undefined;
|
|
30592
30601
|
try {
|
|
30593
30602
|
for (var filteredParticipants_1 = __values(filteredParticipants), filteredParticipants_1_1 = filteredParticipants_1.next(); !filteredParticipants_1_1.done; filteredParticipants_1_1 = filteredParticipants_1.next()) {
|
|
30594
30603
|
var participant = filteredParticipants_1_1.value;
|
|
@@ -30597,7 +30606,8 @@ function getParticipants$1(params) {
|
|
|
30597
30606
|
var individualParticipantId = _j.value;
|
|
30598
30607
|
if (!participant.individualParticipants)
|
|
30599
30608
|
participant.individualParticipants = [];
|
|
30600
|
-
|
|
30609
|
+
var source = ppMap.get(individualParticipantId);
|
|
30610
|
+
participant.individualParticipants.push(template_1 ? attributeFilter({ template: template_1, source: source }) : source);
|
|
30601
30611
|
}
|
|
30602
30612
|
}
|
|
30603
30613
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
@@ -45226,6 +45236,7 @@ function generatePositioningCandidate(params) {
|
|
|
45226
45236
|
};
|
|
45227
45237
|
}
|
|
45228
45238
|
function swapAssignedPositions(_a) {
|
|
45239
|
+
var _b;
|
|
45229
45240
|
var candidatePositionAssignments = _a.candidatePositionAssignments, swapOptions = _a.swapOptions;
|
|
45230
45241
|
var swapOption = randomPop(swapOptions);
|
|
45231
45242
|
if (!swapOption)
|
|
@@ -45233,11 +45244,11 @@ function swapAssignedPositions(_a) {
|
|
|
45233
45244
|
var firstPosition = swapOption.drawPosition;
|
|
45234
45245
|
var secondPosition = randomPop(swapOption.possibleDrawPositions);
|
|
45235
45246
|
var firstAssignment = candidatePositionAssignments.find(function (assignment) { return assignment.drawPosition === firstPosition; });
|
|
45236
|
-
var secondAssignment = candidatePositionAssignments.find(function (assignment) { return assignment.drawPosition === secondPosition; });
|
|
45247
|
+
var secondAssignment = (_b = candidatePositionAssignments.find(function (assignment) { return assignment.drawPosition === secondPosition; })) !== null && _b !== void 0 ? _b : {};
|
|
45237
45248
|
var updatedFirstAssignmentAttributes = {
|
|
45238
|
-
participantId: secondAssignment.participantId,
|
|
45239
|
-
qualifier: secondAssignment.qualifier,
|
|
45240
|
-
bye: secondAssignment.bye,
|
|
45249
|
+
participantId: secondAssignment === null || secondAssignment === void 0 ? void 0 : secondAssignment.participantId,
|
|
45250
|
+
qualifier: secondAssignment === null || secondAssignment === void 0 ? void 0 : secondAssignment.qualifier,
|
|
45251
|
+
bye: secondAssignment === null || secondAssignment === void 0 ? void 0 : secondAssignment.bye,
|
|
45241
45252
|
};
|
|
45242
45253
|
var updatedSecondAssignmentAttributes = {
|
|
45243
45254
|
participantId: firstAssignment.participantId,
|
|
@@ -45383,7 +45394,7 @@ function randomUnseededSeparation(_a) {
|
|
|
45383
45394
|
if (result.error)
|
|
45384
45395
|
return decorateResult({ result: result, stack: stack });
|
|
45385
45396
|
}
|
|
45386
|
-
else {
|
|
45397
|
+
else if (assignment.participantId) {
|
|
45387
45398
|
var result = assignDrawPosition$1(__assign({ automaticPlacement: true, inContextDrawMatchUps: inContextDrawMatchUps, tournamentRecord: tournamentRecord, drawDefinition: drawDefinition, seedBlockInfo: seedBlockInfo, structureId: structureId, matchUpsMap: matchUpsMap, event: event }, assignment));
|
|
45388
45399
|
if (result.error) {
|
|
45389
45400
|
return decorateResult({ result: result, stack: stack, context: { assignment: assignment } });
|
|
@@ -48135,7 +48146,9 @@ function removeStructure(_a) {
|
|
|
48135
48146
|
return link.source.structureId !== idBeingRemoved &&
|
|
48136
48147
|
link.target.structureId !== idBeingRemoved;
|
|
48137
48148
|
})) || [];
|
|
48138
|
-
if (!isMainStageSequence1 ||
|
|
48149
|
+
if (!isMainStageSequence1 ||
|
|
48150
|
+
(isMainStageSequence1 && qualifyingStructureIds.length) ||
|
|
48151
|
+
idBeingRemoved !== structureId) {
|
|
48139
48152
|
drawDefinition.structures = ((_c = drawDefinition.structures) !== null && _c !== void 0 ? _c : []).filter(function (structure) {
|
|
48140
48153
|
if (idBeingRemoved && idBeingRemoved === structure.structureId)
|
|
48141
48154
|
removedStructureIds.push(idBeingRemoved);
|
|
@@ -67807,6 +67820,7 @@ var lastNames = [
|
|
|
67807
67820
|
"Ampleforth",
|
|
67808
67821
|
"Atreides",
|
|
67809
67822
|
"Austen",
|
|
67823
|
+
"Bach",
|
|
67810
67824
|
"Banks",
|
|
67811
67825
|
"Barrington",
|
|
67812
67826
|
"Batty",
|
|
@@ -67837,6 +67851,7 @@ var lastNames = [
|
|
|
67837
67851
|
"Eisenstein",
|
|
67838
67852
|
"Eldritch",
|
|
67839
67853
|
"Elliot",
|
|
67854
|
+
"Escher",
|
|
67840
67855
|
"Eyre",
|
|
67841
67856
|
"Faulkner",
|
|
67842
67857
|
"Fukuoka",
|
|
@@ -68006,6 +68021,7 @@ var firstMale = [
|
|
|
68006
68021
|
"James",
|
|
68007
68022
|
"Jared",
|
|
68008
68023
|
"Joe",
|
|
68024
|
+
"Johann",
|
|
68009
68025
|
"Julian",
|
|
68010
68026
|
"John Michael",
|
|
68011
68027
|
"Jonathan",
|
|
@@ -68016,6 +68032,7 @@ var firstMale = [
|
|
|
68016
68032
|
"Malachi",
|
|
68017
68033
|
"Mark",
|
|
68018
68034
|
"Masanobu",
|
|
68035
|
+
"Maurits",
|
|
68019
68036
|
"Michael",
|
|
68020
68037
|
"Mustapha",
|
|
68021
68038
|
"Neil",
|