tods-competition-factory 1.8.24 → 1.8.26
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.d.ts +6 -1
- package/dist/forge/generate.mjs +153 -130
- package/dist/forge/generate.mjs.map +1 -1
- package/dist/forge/query.d.ts +1 -1
- package/dist/forge/query.mjs +32 -6
- package/dist/forge/query.mjs.map +1 -1
- package/dist/forge/transform.mjs +85 -66
- package/dist/forge/transform.mjs.map +1 -1
- package/dist/forge/utilities.mjs +5 -2
- package/dist/forge/utilities.mjs.map +1 -1
- package/dist/index.mjs +222 -156
- package/dist/index.mjs.map +1 -1
- package/dist/tods-competition-factory.development.cjs.js +244 -193
- 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 +6 -6
|
@@ -1293,6 +1293,10 @@ var SCHEDULED_MATCHUPS = {
|
|
|
1293
1293
|
message: 'Scheduled matchUps',
|
|
1294
1294
|
code: 'ERR_SCHEDULED_MATCHUPS',
|
|
1295
1295
|
};
|
|
1296
|
+
var SCORES_PRESENT = {
|
|
1297
|
+
message: 'Scores present',
|
|
1298
|
+
code: 'ERR_SCORES_PRESENT',
|
|
1299
|
+
};
|
|
1296
1300
|
var errorConditionConstants = {
|
|
1297
1301
|
ANACHRONISM: ANACHRONISM,
|
|
1298
1302
|
CANNOT_CHANGE_WINNING_SIDE: CANNOT_CHANGE_WINNING_SIDE,
|
|
@@ -1455,6 +1459,7 @@ var errorConditionConstants = {
|
|
|
1455
1459
|
POLICY_NOT_FOUND: POLICY_NOT_FOUND,
|
|
1456
1460
|
SCHEDULE_NOT_CLEARED: SCHEDULE_NOT_CLEARED,
|
|
1457
1461
|
SCHEDULED_MATCHUPS: SCHEDULED_MATCHUPS,
|
|
1462
|
+
SCORES_PRESENT: SCORES_PRESENT,
|
|
1458
1463
|
SEEDSCOUNT_GREATER_THAN_DRAW_SIZE: SEEDSCOUNT_GREATER_THAN_DRAW_SIZE,
|
|
1459
1464
|
STAGE_SEQUENCE_LIMIT: STAGE_SEQUENCE_LIMIT,
|
|
1460
1465
|
STRUCTURE_NOT_FOUND: STRUCTURE_NOT_FOUND,
|
|
@@ -1571,17 +1576,20 @@ function cycleMutationStatus$1() {
|
|
|
1571
1576
|
}
|
|
1572
1577
|
function addNotice$1(_a) {
|
|
1573
1578
|
var topic = _a.topic, payload = _a.payload, key = _a.key;
|
|
1574
|
-
syncGlobalState.modified = true;
|
|
1575
1579
|
if (typeof topic !== 'string' || typeof payload !== 'object') {
|
|
1576
1580
|
return;
|
|
1577
1581
|
}
|
|
1582
|
+
if (!syncGlobalState.disableNotifications)
|
|
1583
|
+
syncGlobalState.modified = true;
|
|
1578
1584
|
if (syncGlobalState.disableNotifications ||
|
|
1579
|
-
!syncGlobalState.subscriptions[topic])
|
|
1585
|
+
!syncGlobalState.subscriptions[topic]) {
|
|
1580
1586
|
return;
|
|
1587
|
+
}
|
|
1581
1588
|
if (key) {
|
|
1582
1589
|
syncGlobalState.notices = syncGlobalState.notices.filter(function (notice) { return !(notice.topic === topic && notice.key === key); });
|
|
1583
1590
|
}
|
|
1584
1591
|
syncGlobalState.notices.push({ topic: topic, payload: payload, key: key });
|
|
1592
|
+
return __assign({}, SUCCESS);
|
|
1585
1593
|
}
|
|
1586
1594
|
function getNotices$1(_a) {
|
|
1587
1595
|
var topic = _a.topic;
|
|
@@ -2905,7 +2913,7 @@ var matchUpFormatCode = {
|
|
|
2905
2913
|
};
|
|
2906
2914
|
|
|
2907
2915
|
function factoryVersion() {
|
|
2908
|
-
return '1.8.
|
|
2916
|
+
return '1.8.26';
|
|
2909
2917
|
}
|
|
2910
2918
|
|
|
2911
2919
|
function getObjectTieFormat(obj) {
|
|
@@ -7763,41 +7771,6 @@ function getMatchUpType(params) {
|
|
|
7763
7771
|
return { matchUpType: matchUpType };
|
|
7764
7772
|
}
|
|
7765
7773
|
|
|
7766
|
-
function modifyEntryProfile(_a) {
|
|
7767
|
-
var drawDefinition = _a.drawDefinition, attributes = _a.attributes;
|
|
7768
|
-
var extension = findDrawDefinitionExtension({
|
|
7769
|
-
name: ENTRY_PROFILE,
|
|
7770
|
-
drawDefinition: drawDefinition,
|
|
7771
|
-
}).extension;
|
|
7772
|
-
var entryProfile = (extension === null || extension === void 0 ? void 0 : extension.value) || {};
|
|
7773
|
-
attributes.forEach(function (attribute) {
|
|
7774
|
-
Object.keys(attribute).forEach(function (key) {
|
|
7775
|
-
if (!entryProfile[key]) {
|
|
7776
|
-
entryProfile[key] = attribute[key];
|
|
7777
|
-
}
|
|
7778
|
-
else {
|
|
7779
|
-
Object.assign(entryProfile[key], attribute[key]);
|
|
7780
|
-
}
|
|
7781
|
-
});
|
|
7782
|
-
});
|
|
7783
|
-
extension = {
|
|
7784
|
-
name: ENTRY_PROFILE,
|
|
7785
|
-
value: entryProfile,
|
|
7786
|
-
};
|
|
7787
|
-
addDrawDefinitionExtension({ drawDefinition: drawDefinition, extension: extension });
|
|
7788
|
-
return { entryProfile: entryProfile };
|
|
7789
|
-
}
|
|
7790
|
-
|
|
7791
|
-
function getEntryProfile(_a) {
|
|
7792
|
-
var drawDefinition = _a.drawDefinition;
|
|
7793
|
-
var extension = findDrawDefinitionExtension({
|
|
7794
|
-
name: ENTRY_PROFILE,
|
|
7795
|
-
drawDefinition: drawDefinition,
|
|
7796
|
-
}).extension;
|
|
7797
|
-
var entryProfile = (extension === null || extension === void 0 ? void 0 : extension.value) || {};
|
|
7798
|
-
return { entryProfile: entryProfile };
|
|
7799
|
-
}
|
|
7800
|
-
|
|
7801
7774
|
var _a$i, _b$5, _c$1;
|
|
7802
7775
|
// stage types
|
|
7803
7776
|
var MAIN = 'MAIN';
|
|
@@ -7856,6 +7829,7 @@ var FIRST_MATCHUP = 'FIRST_MATCHUP'; // condition for valididty of link
|
|
|
7856
7829
|
// draw types
|
|
7857
7830
|
// PLAY_OFF is also a stage type
|
|
7858
7831
|
var AD_HOC = 'AD_HOC';
|
|
7832
|
+
var FLEX_ROUNDS = 'AD_HOC';
|
|
7859
7833
|
var FEED_IN$1 = 'FEED_IN';
|
|
7860
7834
|
var COMPASS = 'COMPASS';
|
|
7861
7835
|
var OLYMPIC = 'OLYMPIC';
|
|
@@ -7949,6 +7923,7 @@ var drawDefinitionConstants = {
|
|
|
7949
7923
|
LOSER: LOSER,
|
|
7950
7924
|
AD_HOC: AD_HOC,
|
|
7951
7925
|
FEED_IN: FEED_IN$1,
|
|
7926
|
+
FLEX_ROUNDS: FLEX_ROUNDS,
|
|
7952
7927
|
COMPASS: COMPASS,
|
|
7953
7928
|
PLAY_OFF: PLAY_OFF,
|
|
7954
7929
|
OLYMPIC: OLYMPIC,
|
|
@@ -8087,6 +8062,119 @@ function getDrawStructures(_a) {
|
|
|
8087
8062
|
}
|
|
8088
8063
|
}
|
|
8089
8064
|
|
|
8065
|
+
function getAllPositionedParticipantIds(_a) {
|
|
8066
|
+
var drawDefinition = _a.drawDefinition;
|
|
8067
|
+
if (!drawDefinition)
|
|
8068
|
+
return { error: MISSING_DRAW_DEFINITION };
|
|
8069
|
+
var stagePositionedParticipantIds = {};
|
|
8070
|
+
var allPositionedParticipantIds = (drawDefinition.structures || [])
|
|
8071
|
+
.map(function (structure) {
|
|
8072
|
+
var _a;
|
|
8073
|
+
var _b;
|
|
8074
|
+
var stage = structure.stage;
|
|
8075
|
+
if (!stagePositionedParticipantIds[stage])
|
|
8076
|
+
stagePositionedParticipantIds[stage] = [];
|
|
8077
|
+
var positionAssignments = getPositionAssignments$1({ structure: structure }).positionAssignments;
|
|
8078
|
+
var particiapntIds = (_b = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.map(extractAttributes('participantId')).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
|
8079
|
+
(_a = stagePositionedParticipantIds[stage]).push.apply(_a, __spreadArray([], __read(particiapntIds), false));
|
|
8080
|
+
return particiapntIds;
|
|
8081
|
+
})
|
|
8082
|
+
.flat();
|
|
8083
|
+
return { allPositionedParticipantIds: allPositionedParticipantIds, stagePositionedParticipantIds: stagePositionedParticipantIds };
|
|
8084
|
+
}
|
|
8085
|
+
function getPositionAssignments$1(_a) {
|
|
8086
|
+
var _b;
|
|
8087
|
+
var drawDefinition = _a.drawDefinition, structureId = _a.structureId, structure = _a.structure;
|
|
8088
|
+
var error, positionAssignments = [];
|
|
8089
|
+
if (!structure) {
|
|
8090
|
+
if (!drawDefinition) {
|
|
8091
|
+
return { positionAssignments: positionAssignments, error: MISSING_DRAW_DEFINITION };
|
|
8092
|
+
}
|
|
8093
|
+
(_b = findStructure({ drawDefinition: drawDefinition, structureId: structureId }), structure = _b.structure, error = _b.error);
|
|
8094
|
+
if (error)
|
|
8095
|
+
return { positionAssignments: positionAssignments, error: error };
|
|
8096
|
+
}
|
|
8097
|
+
if (structure.structures) {
|
|
8098
|
+
positionAssignments = [].concat.apply([], __spreadArray([], __read(structure.structures.map(function (structure) {
|
|
8099
|
+
return getPositionAssignments$1({ structure: structure }).positionAssignments;
|
|
8100
|
+
})), false));
|
|
8101
|
+
}
|
|
8102
|
+
else if (structure.positionAssignments) {
|
|
8103
|
+
positionAssignments = structure.positionAssignments;
|
|
8104
|
+
}
|
|
8105
|
+
else {
|
|
8106
|
+
error = MISSING_POSITION_ASSIGNMENTS;
|
|
8107
|
+
}
|
|
8108
|
+
return { positionAssignments: positionAssignments, error: error };
|
|
8109
|
+
}
|
|
8110
|
+
function structureAssignedDrawPositions(_a) {
|
|
8111
|
+
var _b;
|
|
8112
|
+
var drawDefinition = _a.drawDefinition, structureId = _a.structureId, structure = _a.structure;
|
|
8113
|
+
var positionAssignments = ((_b = getPositionAssignments$1({
|
|
8114
|
+
drawDefinition: drawDefinition,
|
|
8115
|
+
structureId: structureId,
|
|
8116
|
+
structure: structure,
|
|
8117
|
+
})) === null || _b === void 0 ? void 0 : _b.positionAssignments) || [];
|
|
8118
|
+
var assignedPositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8119
|
+
var _a, _b;
|
|
8120
|
+
return (_b = (_a = assignment.participantId) !== null && _a !== void 0 ? _a : assignment.bye) !== null && _b !== void 0 ? _b : assignment.qualifier;
|
|
8121
|
+
});
|
|
8122
|
+
var allPositionsAssigned = positionAssignments &&
|
|
8123
|
+
(positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.length) === (assignedPositions === null || assignedPositions === void 0 ? void 0 : assignedPositions.length);
|
|
8124
|
+
var unassignedPositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8125
|
+
return (!assignment.participantId && !assignment.bye && !assignment.qualifier);
|
|
8126
|
+
});
|
|
8127
|
+
var byePositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8128
|
+
return !assignment.participantId && assignment.bye;
|
|
8129
|
+
});
|
|
8130
|
+
var qualifierPositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8131
|
+
return !assignment.participantId && assignment.qualifier;
|
|
8132
|
+
});
|
|
8133
|
+
return {
|
|
8134
|
+
allPositionsAssigned: allPositionsAssigned,
|
|
8135
|
+
positionAssignments: positionAssignments,
|
|
8136
|
+
unassignedPositions: unassignedPositions,
|
|
8137
|
+
assignedPositions: assignedPositions,
|
|
8138
|
+
qualifierPositions: qualifierPositions,
|
|
8139
|
+
byePositions: byePositions,
|
|
8140
|
+
};
|
|
8141
|
+
}
|
|
8142
|
+
|
|
8143
|
+
function modifyEntryProfile(_a) {
|
|
8144
|
+
var drawDefinition = _a.drawDefinition, attributes = _a.attributes;
|
|
8145
|
+
var extension = findDrawDefinitionExtension({
|
|
8146
|
+
name: ENTRY_PROFILE,
|
|
8147
|
+
drawDefinition: drawDefinition,
|
|
8148
|
+
}).extension;
|
|
8149
|
+
var entryProfile = (extension === null || extension === void 0 ? void 0 : extension.value) || {};
|
|
8150
|
+
attributes.forEach(function (attribute) {
|
|
8151
|
+
Object.keys(attribute).forEach(function (key) {
|
|
8152
|
+
if (!entryProfile[key]) {
|
|
8153
|
+
entryProfile[key] = attribute[key];
|
|
8154
|
+
}
|
|
8155
|
+
else {
|
|
8156
|
+
Object.assign(entryProfile[key], attribute[key]);
|
|
8157
|
+
}
|
|
8158
|
+
});
|
|
8159
|
+
});
|
|
8160
|
+
extension = {
|
|
8161
|
+
name: ENTRY_PROFILE,
|
|
8162
|
+
value: entryProfile,
|
|
8163
|
+
};
|
|
8164
|
+
addDrawDefinitionExtension({ drawDefinition: drawDefinition, extension: extension });
|
|
8165
|
+
return { entryProfile: entryProfile };
|
|
8166
|
+
}
|
|
8167
|
+
|
|
8168
|
+
function getEntryProfile(_a) {
|
|
8169
|
+
var drawDefinition = _a.drawDefinition;
|
|
8170
|
+
var extension = findDrawDefinitionExtension({
|
|
8171
|
+
name: ENTRY_PROFILE,
|
|
8172
|
+
drawDefinition: drawDefinition,
|
|
8173
|
+
}).extension;
|
|
8174
|
+
var entryProfile = (extension === null || extension === void 0 ? void 0 : extension.value) || {};
|
|
8175
|
+
return { entryProfile: entryProfile };
|
|
8176
|
+
}
|
|
8177
|
+
|
|
8090
8178
|
var ALTERNATE = exports.EntryStatusEnum.Alternate;
|
|
8091
8179
|
var CONFIRMED = exports.EntryStatusEnum.Confirmed;
|
|
8092
8180
|
var DIRECT_ACCEPTANCE = exports.EntryStatusEnum.DirectAcceptance;
|
|
@@ -8343,11 +8431,14 @@ function getStageWildcardEntriesCount(_a) {
|
|
|
8343
8431
|
function getStructureSeedAssignments(_a) {
|
|
8344
8432
|
var _b;
|
|
8345
8433
|
var _c;
|
|
8346
|
-
var provisionalPositioning = _a.provisionalPositioning, drawDefinition = _a.drawDefinition, structureId = _a.structureId, structure = _a.structure;
|
|
8434
|
+
var provisionalPositioning = _a.provisionalPositioning, returnAllProxies = _a.returnAllProxies, drawDefinition = _a.drawDefinition, structureId = _a.structureId, structure = _a.structure;
|
|
8347
8435
|
var error, seedAssignments = [];
|
|
8348
8436
|
if (!structure) {
|
|
8349
8437
|
(_b = findStructure({ drawDefinition: drawDefinition, structureId: structureId }), structure = _b.structure, error = _b.error);
|
|
8350
8438
|
}
|
|
8439
|
+
var positionAssignments = getPositionAssignments$1({
|
|
8440
|
+
structure: structure,
|
|
8441
|
+
}).positionAssignments;
|
|
8351
8442
|
if (error || !structure)
|
|
8352
8443
|
return { seedAssignments: [], error: STRUCTURE_NOT_FOUND };
|
|
8353
8444
|
if (!structureId)
|
|
@@ -8363,7 +8454,7 @@ function getStructureSeedAssignments(_a) {
|
|
|
8363
8454
|
structureId: structureId,
|
|
8364
8455
|
stage: stage,
|
|
8365
8456
|
});
|
|
8366
|
-
var
|
|
8457
|
+
var proxiedEntries = entries
|
|
8367
8458
|
? entries
|
|
8368
8459
|
.filter(function (entry) { return entry.placementGroup === 1; })
|
|
8369
8460
|
.sort(function (a, b) {
|
|
@@ -8378,11 +8469,12 @@ function getStructureSeedAssignments(_a) {
|
|
|
8378
8469
|
return {
|
|
8379
8470
|
participantId: entry.participantId,
|
|
8380
8471
|
seedValue: seedNumber,
|
|
8472
|
+
seedProxy: true,
|
|
8381
8473
|
seedNumber: seedNumber,
|
|
8382
|
-
seedProxy: true, // flag so that proxy seeding information doesn't get used externally
|
|
8383
8474
|
};
|
|
8384
8475
|
})
|
|
8385
8476
|
: [];
|
|
8477
|
+
var seedProxies = proxiedEntries === null || proxiedEntries === void 0 ? void 0 : proxiedEntries.slice(0, returnAllProxies ? proxiedEntries.length : positionAssignments.length / 2);
|
|
8386
8478
|
if (seedProxies.length) {
|
|
8387
8479
|
// seedProxies are only found in PLAY_OFF when ROUND_ROBIN is MAIN stage
|
|
8388
8480
|
seedAssignments = seedProxies;
|
|
@@ -8394,7 +8486,13 @@ function getStructureSeedAssignments(_a) {
|
|
|
8394
8486
|
error = MISSING_SEED_ASSIGNMENTS;
|
|
8395
8487
|
}
|
|
8396
8488
|
var seedLimit = structure.seedLimit || ((_c = structure === null || structure === void 0 ? void 0 : structure.positionAssignments) === null || _c === void 0 ? void 0 : _c.length);
|
|
8397
|
-
return {
|
|
8489
|
+
return {
|
|
8490
|
+
seedAssignments: seedAssignments,
|
|
8491
|
+
stageSequence: stageSequence,
|
|
8492
|
+
seedLimit: seedLimit,
|
|
8493
|
+
stage: stage,
|
|
8494
|
+
error: error,
|
|
8495
|
+
};
|
|
8398
8496
|
}
|
|
8399
8497
|
|
|
8400
8498
|
function getExitProfiles(_a) {
|
|
@@ -8718,84 +8816,6 @@ function getSourceDrawPositionRanges(_a) {
|
|
|
8718
8816
|
* }
|
|
8719
8817
|
*/
|
|
8720
8818
|
|
|
8721
|
-
function getAllPositionedParticipantIds(_a) {
|
|
8722
|
-
var drawDefinition = _a.drawDefinition;
|
|
8723
|
-
if (!drawDefinition)
|
|
8724
|
-
return { error: MISSING_DRAW_DEFINITION };
|
|
8725
|
-
var stagePositionedParticipantIds = {};
|
|
8726
|
-
var allPositionedParticipantIds = (drawDefinition.structures || [])
|
|
8727
|
-
.map(function (structure) {
|
|
8728
|
-
var _a;
|
|
8729
|
-
var _b;
|
|
8730
|
-
var stage = structure.stage;
|
|
8731
|
-
if (!stagePositionedParticipantIds[stage])
|
|
8732
|
-
stagePositionedParticipantIds[stage] = [];
|
|
8733
|
-
var positionAssignments = getPositionAssignments$1({ structure: structure }).positionAssignments;
|
|
8734
|
-
var particiapntIds = (_b = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.map(extractAttributes('participantId')).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
|
8735
|
-
(_a = stagePositionedParticipantIds[stage]).push.apply(_a, __spreadArray([], __read(particiapntIds), false));
|
|
8736
|
-
return particiapntIds;
|
|
8737
|
-
})
|
|
8738
|
-
.flat();
|
|
8739
|
-
return { allPositionedParticipantIds: allPositionedParticipantIds, stagePositionedParticipantIds: stagePositionedParticipantIds };
|
|
8740
|
-
}
|
|
8741
|
-
function getPositionAssignments$1(_a) {
|
|
8742
|
-
var _b;
|
|
8743
|
-
var drawDefinition = _a.drawDefinition, structureId = _a.structureId, structure = _a.structure;
|
|
8744
|
-
var error, positionAssignments = [];
|
|
8745
|
-
if (!structure) {
|
|
8746
|
-
if (!drawDefinition) {
|
|
8747
|
-
return { positionAssignments: positionAssignments, error: MISSING_DRAW_DEFINITION };
|
|
8748
|
-
}
|
|
8749
|
-
(_b = findStructure({ drawDefinition: drawDefinition, structureId: structureId }), structure = _b.structure, error = _b.error);
|
|
8750
|
-
if (error)
|
|
8751
|
-
return { positionAssignments: positionAssignments, error: error };
|
|
8752
|
-
}
|
|
8753
|
-
if (structure.structures) {
|
|
8754
|
-
positionAssignments = [].concat.apply([], __spreadArray([], __read(structure.structures.map(function (structure) {
|
|
8755
|
-
return getPositionAssignments$1({ structure: structure }).positionAssignments;
|
|
8756
|
-
})), false));
|
|
8757
|
-
}
|
|
8758
|
-
else if (structure.positionAssignments) {
|
|
8759
|
-
positionAssignments = structure.positionAssignments;
|
|
8760
|
-
}
|
|
8761
|
-
else {
|
|
8762
|
-
error = MISSING_POSITION_ASSIGNMENTS;
|
|
8763
|
-
}
|
|
8764
|
-
return { positionAssignments: positionAssignments, error: error };
|
|
8765
|
-
}
|
|
8766
|
-
function structureAssignedDrawPositions(_a) {
|
|
8767
|
-
var _b;
|
|
8768
|
-
var drawDefinition = _a.drawDefinition, structureId = _a.structureId, structure = _a.structure;
|
|
8769
|
-
var positionAssignments = ((_b = getPositionAssignments$1({
|
|
8770
|
-
drawDefinition: drawDefinition,
|
|
8771
|
-
structureId: structureId,
|
|
8772
|
-
structure: structure,
|
|
8773
|
-
})) === null || _b === void 0 ? void 0 : _b.positionAssignments) || [];
|
|
8774
|
-
var assignedPositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8775
|
-
var _a, _b;
|
|
8776
|
-
return (_b = (_a = assignment.participantId) !== null && _a !== void 0 ? _a : assignment.bye) !== null && _b !== void 0 ? _b : assignment.qualifier;
|
|
8777
|
-
});
|
|
8778
|
-
var allPositionsAssigned = positionAssignments &&
|
|
8779
|
-
(positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.length) === (assignedPositions === null || assignedPositions === void 0 ? void 0 : assignedPositions.length);
|
|
8780
|
-
var unassignedPositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8781
|
-
return (!assignment.participantId && !assignment.bye && !assignment.qualifier);
|
|
8782
|
-
});
|
|
8783
|
-
var byePositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8784
|
-
return !assignment.participantId && assignment.bye;
|
|
8785
|
-
});
|
|
8786
|
-
var qualifierPositions = positionAssignments === null || positionAssignments === void 0 ? void 0 : positionAssignments.filter(function (assignment) {
|
|
8787
|
-
return !assignment.participantId && assignment.qualifier;
|
|
8788
|
-
});
|
|
8789
|
-
return {
|
|
8790
|
-
allPositionsAssigned: allPositionsAssigned,
|
|
8791
|
-
positionAssignments: positionAssignments,
|
|
8792
|
-
unassignedPositions: unassignedPositions,
|
|
8793
|
-
assignedPositions: assignedPositions,
|
|
8794
|
-
qualifierPositions: qualifierPositions,
|
|
8795
|
-
byePositions: byePositions,
|
|
8796
|
-
};
|
|
8797
|
-
}
|
|
8798
|
-
|
|
8799
8819
|
function getOrderedDrawPositions(_a) {
|
|
8800
8820
|
var _b;
|
|
8801
8821
|
var drawPositions = _a.drawPositions, roundProfile = _a.roundProfile, roundNumber = _a.roundNumber;
|
|
@@ -25827,7 +25847,7 @@ function getSeedingThresholds(_a) {
|
|
|
25827
25847
|
|
|
25828
25848
|
function getValidSeedBlocks(_a) {
|
|
25829
25849
|
var _b, _c;
|
|
25830
|
-
var provisionalPositioning = _a.provisionalPositioning, appliedPolicies = _a.appliedPolicies, drawDefinition = _a.drawDefinition, allPositions = _a.allPositions, structure = _a.structure;
|
|
25850
|
+
var provisionalPositioning = _a.provisionalPositioning, returnAllProxies = _a.returnAllProxies, appliedPolicies = _a.appliedPolicies, drawDefinition = _a.drawDefinition, allPositions = _a.allPositions, structure = _a.structure;
|
|
25831
25851
|
var validSeedBlocks = [];
|
|
25832
25852
|
if (!structure)
|
|
25833
25853
|
return { error: MISSING_STRUCTURE };
|
|
@@ -25838,6 +25858,7 @@ function getValidSeedBlocks(_a) {
|
|
|
25838
25858
|
}), matchUps = _d.matchUps, roundMatchUps = _d.roundMatchUps;
|
|
25839
25859
|
var seedAssignments = getStructureSeedAssignments({
|
|
25840
25860
|
provisionalPositioning: provisionalPositioning,
|
|
25861
|
+
returnAllProxies: returnAllProxies,
|
|
25841
25862
|
drawDefinition: drawDefinition,
|
|
25842
25863
|
structure: structure,
|
|
25843
25864
|
}).seedAssignments;
|
|
@@ -26078,6 +26099,7 @@ function getNextSeedBlock(params) {
|
|
|
26078
26099
|
var provisionalPositioning = params.provisionalPositioning, drawDefinition = params.drawDefinition, seedBlockInfo = params.seedBlockInfo, structureId = params.structureId, randomize = params.randomize;
|
|
26079
26100
|
var structure = findStructure({ drawDefinition: drawDefinition, structureId: structureId }).structure;
|
|
26080
26101
|
var seedAssignments = getStructureSeedAssignments({
|
|
26102
|
+
returnAllProxies: params.returnAllProxies,
|
|
26081
26103
|
provisionalPositioning: provisionalPositioning,
|
|
26082
26104
|
drawDefinition: drawDefinition,
|
|
26083
26105
|
structure: structure,
|
|
@@ -26089,6 +26111,7 @@ function getNextSeedBlock(params) {
|
|
|
26089
26111
|
var validSeedBlocks = (seedBlockInfo === null || seedBlockInfo === void 0 ? void 0 : seedBlockInfo.validSeedBlocks) ||
|
|
26090
26112
|
(structure &&
|
|
26091
26113
|
((_a = getValidSeedBlocks({
|
|
26114
|
+
returnAllProxies: params.returnAllProxies,
|
|
26092
26115
|
provisionalPositioning: provisionalPositioning,
|
|
26093
26116
|
appliedPolicies: appliedPolicies,
|
|
26094
26117
|
drawDefinition: drawDefinition,
|
|
@@ -44888,22 +44911,6 @@ function getSwapOptions(_a) {
|
|
|
44888
44911
|
.flat(1);
|
|
44889
44912
|
}
|
|
44890
44913
|
|
|
44891
|
-
/**
|
|
44892
|
-
*
|
|
44893
|
-
* NOTE: some of these parameters are passed directly through to other functions via ...params
|
|
44894
|
-
*
|
|
44895
|
-
* @param {object[]} initialPositionAssignments - positionAssignments before any new participants placed
|
|
44896
|
-
* @param {object[]} participantsWithGroupings - participants with added team/group/pair participantIds arrays
|
|
44897
|
-
* @param {string[]} unseededParticipantIds - ids of participants who are unseeded
|
|
44898
|
-
* @param {object[]} drawPositionChunks - drawPositions grouped by round starting with the final round
|
|
44899
|
-
* @param {object[]} drawPositionGroups - drawPositions paird with their initial round opponent drawPosition
|
|
44900
|
-
* @param {object[]} policyAttributes - { key: '' } objects defining accessors for participant values to be compared
|
|
44901
|
-
* @param {object} drawDefinition - drawDefinition object
|
|
44902
|
-
* @param {boolean} pairedPriority - flag whether to prioritize positions which already have one opponent placed
|
|
44903
|
-
* @param {string} structureId - id of the structure in which participants are to be placed
|
|
44904
|
-
* @param {object[]} allGroups - map of values and participantIds which have those values
|
|
44905
|
-
*
|
|
44906
|
-
*/
|
|
44907
44914
|
function generatePositioningCandidate(params) {
|
|
44908
44915
|
var initialPositionAssignments = params.initialPositionAssignments, participantsWithGroupings = params.participantsWithGroupings, opponentsToPlaceCount = params.opponentsToPlaceCount, unseededByePositions = params.unseededByePositions, drawPositionGroups = params.drawPositionGroups, policyAttributes = params.policyAttributes, idCollections = params.idCollections, allGroups = params.allGroups;
|
|
44909
44916
|
var errors = [];
|
|
@@ -45017,7 +45024,8 @@ function swapAssignedPositions(_a) {
|
|
|
45017
45024
|
function randomUnseededSeparation(_a) {
|
|
45018
45025
|
var e_1, _b;
|
|
45019
45026
|
var _c, _d;
|
|
45020
|
-
var provisionalPositioning = _a.provisionalPositioning, unseededParticipantIds = _a.unseededParticipantIds, inContextDrawMatchUps = _a.inContextDrawMatchUps, unseededByePositions = _a.unseededByePositions, tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, seedBlockInfo = _a.seedBlockInfo, participants = _a.participants, matchUpsMap = _a.matchUpsMap, structureId = _a.structureId, avoidance = _a.avoidance, drawSize = _a.drawSize,
|
|
45027
|
+
var provisionalPositioning = _a.provisionalPositioning, unseededParticipantIds = _a.unseededParticipantIds, inContextDrawMatchUps = _a.inContextDrawMatchUps, unseededByePositions = _a.unseededByePositions, tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, seedBlockInfo = _a.seedBlockInfo, participants = _a.participants, matchUpsMap = _a.matchUpsMap, structureId = _a.structureId, avoidance = _a.avoidance, drawSize = _a.drawSize,
|
|
45028
|
+
// entries, // entries for the specific stage of drawDefinition
|
|
45021
45029
|
event = _a.event;
|
|
45022
45030
|
if (!avoidance) {
|
|
45023
45031
|
return { error: MISSING_AVOIDANCE_POLICY };
|
|
@@ -45056,16 +45064,17 @@ function randomUnseededSeparation(_a) {
|
|
|
45056
45064
|
var _f = isRoundRobin
|
|
45057
45065
|
? roundRobinParticipantGroups(params)
|
|
45058
45066
|
: eliminationParticipantGroups(params), drawPositionGroups = _f.drawPositionGroups, drawPositionChunks = _f.drawPositionChunks;
|
|
45059
|
-
var idCollections = {
|
|
45060
|
-
|
|
45061
|
-
|
|
45062
|
-
|
|
45063
|
-
|
|
45064
|
-
|
|
45065
|
-
|
|
45066
|
-
|
|
45067
|
-
|
|
45068
|
-
|
|
45067
|
+
var idCollections = {
|
|
45068
|
+
groupParticipants: participants
|
|
45069
|
+
.filter(function (participant) { return participant.participantType === GROUP; })
|
|
45070
|
+
.map(function (participant) { return participant.participantId; }),
|
|
45071
|
+
teamParticipants: participants
|
|
45072
|
+
.filter(function (participant) { return participant.participantType === TEAM; })
|
|
45073
|
+
.map(function (participant) { return participant.participantId; }),
|
|
45074
|
+
pairParticipants: participants
|
|
45075
|
+
.filter(function (participant) { return participant.participantType === PAIR; })
|
|
45076
|
+
.map(function (participant) { return participant.participantId; }),
|
|
45077
|
+
};
|
|
45069
45078
|
var allGroups = getAttributeGroupings({
|
|
45070
45079
|
targetParticipantIds: unseededParticipantIds,
|
|
45071
45080
|
policyAttributes: policyAttributes,
|
|
@@ -45122,7 +45131,7 @@ function randomUnseededSeparation(_a) {
|
|
|
45122
45131
|
idCollections: idCollections,
|
|
45123
45132
|
allGroups: allGroups,
|
|
45124
45133
|
drawSize: drawSize,
|
|
45125
|
-
|
|
45134
|
+
// entries,
|
|
45126
45135
|
});
|
|
45127
45136
|
});
|
|
45128
45137
|
var candidates = noPairPriorityCandidates
|
|
@@ -45511,11 +45520,11 @@ function getSeedOrderByePositions(_a) {
|
|
|
45511
45520
|
var strictSeedOrderByePositions = getOrderedByePositions({
|
|
45512
45521
|
orderedSeedDrawPositions: orderedSortedFirstRoundSeededDrawPositions,
|
|
45513
45522
|
relevantMatchUps: relevantMatchUps,
|
|
45514
|
-
}).slice(0,
|
|
45523
|
+
}).slice(0, byesToPlace);
|
|
45515
45524
|
var blockSeedOrderByePositions = getOrderedByePositions({
|
|
45516
45525
|
orderedSeedDrawPositions: blockSortedRandomDrawPositions,
|
|
45517
45526
|
relevantMatchUps: relevantMatchUps,
|
|
45518
|
-
}).slice(0,
|
|
45527
|
+
}).slice(0, byesToPlace);
|
|
45519
45528
|
return {
|
|
45520
45529
|
strictSeedOrderByePositions: strictSeedOrderByePositions,
|
|
45521
45530
|
blockSeedOrderByePositions: blockSeedOrderByePositions,
|
|
@@ -46242,7 +46251,6 @@ function automatedPositioning$1(_a) {
|
|
|
46242
46251
|
})
|
|
46243
46252
|
: undefined;
|
|
46244
46253
|
if (result_3 === null || result_3 === void 0 ? void 0 : result_3.error) {
|
|
46245
|
-
console.log('positionByes', { result: result_3 });
|
|
46246
46254
|
return handleErrorCondition(result_3);
|
|
46247
46255
|
}
|
|
46248
46256
|
unseededByePositions = result_3 === null || result_3 === void 0 ? void 0 : result_3.unseededByePositions;
|
|
@@ -46352,6 +46360,7 @@ function automatedPlayoffPositioning(params) {
|
|
|
46352
46360
|
}).playoffStructures) === null || _b === void 0 ? void 0 : _b.sort(function (a, b) { return getMinFinishingPositionRange(a) - getMinFinishingPositionRange(b); });
|
|
46353
46361
|
var structurePositionAssignments = [];
|
|
46354
46362
|
var participants = tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.participants;
|
|
46363
|
+
var positioningReports = [];
|
|
46355
46364
|
if (playoffStructures) {
|
|
46356
46365
|
try {
|
|
46357
46366
|
for (var playoffStructures_1 = __values(playoffStructures), playoffStructures_1_1 = playoffStructures_1.next(); !playoffStructures_1_1.done; playoffStructures_1_1 = playoffStructures_1.next()) {
|
|
@@ -46375,6 +46384,8 @@ function automatedPlayoffPositioning(params) {
|
|
|
46375
46384
|
structureId: playoffStructureId,
|
|
46376
46385
|
});
|
|
46377
46386
|
}
|
|
46387
|
+
if (result.positioningReport)
|
|
46388
|
+
positioningReports.push(result.positioningReport);
|
|
46378
46389
|
}
|
|
46379
46390
|
}
|
|
46380
46391
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -46385,7 +46396,7 @@ function automatedPlayoffPositioning(params) {
|
|
|
46385
46396
|
finally { if (e_1) throw e_1.error; }
|
|
46386
46397
|
}
|
|
46387
46398
|
}
|
|
46388
|
-
return __assign(__assign({}, SUCCESS), { structurePositionAssignments: structurePositionAssignments });
|
|
46399
|
+
return __assign(__assign({}, SUCCESS), { structurePositionAssignments: structurePositionAssignments, positioningReports: positioningReports });
|
|
46389
46400
|
}
|
|
46390
46401
|
|
|
46391
46402
|
function generateAndPopulateRRplayoffStructures(params) {
|
|
@@ -47103,18 +47114,37 @@ function getStructureGroups(_a) {
|
|
|
47103
47114
|
function generateQualifyingStructure$1(params) {
|
|
47104
47115
|
var _a;
|
|
47105
47116
|
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
47106
|
-
if (!params.drawDefinition)
|
|
47107
|
-
return { error: MISSING_DRAW_DEFINITION };
|
|
47108
47117
|
var stack = 'generateQualifyingStructure';
|
|
47118
|
+
if (!params.drawDefinition)
|
|
47119
|
+
return decorateResult({
|
|
47120
|
+
result: { error: MISSING_DRAW_DEFINITION },
|
|
47121
|
+
stack: stack,
|
|
47122
|
+
});
|
|
47123
|
+
if ((params.drawSize && !isConvertableInteger(params.drawSize)) ||
|
|
47124
|
+
(params.participantsCount &&
|
|
47125
|
+
!isConvertableInteger(params.participantsCount)) ||
|
|
47126
|
+
(params.qualifyingPositions &&
|
|
47127
|
+
!isConvertableInteger(params.qualifyingPositions))) {
|
|
47128
|
+
return decorateResult({ result: { error: INVALID_VALUES }, stack: stack });
|
|
47129
|
+
}
|
|
47109
47130
|
var drawSize = (_b = params.drawSize) !== null && _b !== void 0 ? _b : coerceEven(params.participantsCount);
|
|
47110
47131
|
var qualifyingRoundNumber = params.qualifyingRoundNumber, qualifyingPositions = params.qualifyingPositions, targetStructureId = params.targetStructureId, structureOptions = params.structureOptions, appliedPolicies = params.appliedPolicies, drawDefinition = params.drawDefinition, matchUpFormat = params.matchUpFormat, structureName = params.structureName, structureId = params.structureId, roundTarget = params.roundTarget, drawType = params.drawType, idPrefix = params.idPrefix, isMock = params.isMock, uuids = params.uuids;
|
|
47132
|
+
if (!params.drawSize)
|
|
47133
|
+
return decorateResult({
|
|
47134
|
+
result: { error: MISSING_DRAW_SIZE },
|
|
47135
|
+
context: { drawSize: drawSize },
|
|
47136
|
+
stack: stack,
|
|
47137
|
+
});
|
|
47138
|
+
if (qualifyingPositions && qualifyingPositions >= params.drawSize)
|
|
47139
|
+
return decorateResult({
|
|
47140
|
+
result: { error: INVALID_VALUES },
|
|
47141
|
+
context: { drawSize: drawSize, qualifyingPositions: qualifyingPositions },
|
|
47142
|
+
stack: stack,
|
|
47143
|
+
});
|
|
47111
47144
|
var roundLimit, roundsCount, structure, matchUps;
|
|
47112
47145
|
var qualifiersCount = 0;
|
|
47113
47146
|
var finishingPositions;
|
|
47114
47147
|
var stageSequence = 1;
|
|
47115
|
-
if (!isConvertableInteger(drawSize)) {
|
|
47116
|
-
return decorateResult({ result: { error: MISSING_DRAW_SIZE }, stack: stack });
|
|
47117
|
-
}
|
|
47118
47148
|
var structureProfiles = getStructureGroups({ drawDefinition: drawDefinition }).structureProfiles;
|
|
47119
47149
|
var structureProfile = structureProfiles[targetStructureId];
|
|
47120
47150
|
if (!structureProfile) {
|
|
@@ -47197,9 +47227,34 @@ function generateQualifyingStructure$1(params) {
|
|
|
47197
47227
|
return __assign(__assign({ qualifyingDrawPositionsCount: drawSize, qualifiersCount: qualifiersCount }, SUCCESS), { structure: structure, link: link });
|
|
47198
47228
|
}
|
|
47199
47229
|
|
|
47200
|
-
function
|
|
47230
|
+
function resequenceStructures(_a) {
|
|
47201
47231
|
var e_1, _b;
|
|
47202
|
-
var
|
|
47232
|
+
var drawDefinition = _a.drawDefinition;
|
|
47233
|
+
var _c = getStructureGroups({
|
|
47234
|
+
drawDefinition: drawDefinition,
|
|
47235
|
+
}), maxQualifyingDepth = _c.maxQualifyingDepth, structureProfiles = _c.structureProfiles;
|
|
47236
|
+
try {
|
|
47237
|
+
for (var _d = __values(drawDefinition.structures), _e = _d.next(); !_e.done; _e = _d.next()) {
|
|
47238
|
+
var structure = _e.value;
|
|
47239
|
+
var profile = structureProfiles[structure.structureId];
|
|
47240
|
+
if (profile.distanceFromMain) {
|
|
47241
|
+
structure.stageSequence =
|
|
47242
|
+
maxQualifyingDepth + 1 - profile.distanceFromMain;
|
|
47243
|
+
}
|
|
47244
|
+
}
|
|
47245
|
+
}
|
|
47246
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
47247
|
+
finally {
|
|
47248
|
+
try {
|
|
47249
|
+
if (_e && !_e.done && (_b = _d.return)) _b.call(_d);
|
|
47250
|
+
}
|
|
47251
|
+
finally { if (e_1) throw e_1.error; }
|
|
47252
|
+
}
|
|
47253
|
+
return __assign({}, SUCCESS);
|
|
47254
|
+
}
|
|
47255
|
+
|
|
47256
|
+
function attachQualifyingStructure$1(_a) {
|
|
47257
|
+
var _b;
|
|
47203
47258
|
var drawDefinition = _a.drawDefinition, tournamentId = _a.tournamentId, structure = _a.structure, eventId = _a.eventId, link = _a.link;
|
|
47204
47259
|
if (!drawDefinition)
|
|
47205
47260
|
return { error: MISSING_DRAW_DEFINITION };
|
|
@@ -47224,27 +47279,8 @@ function attachQualifyingStructure$1(_a) {
|
|
|
47224
47279
|
drawDefinition.links = [];
|
|
47225
47280
|
drawDefinition.structures.push(structure);
|
|
47226
47281
|
drawDefinition.links.push(link);
|
|
47227
|
-
|
|
47228
|
-
|
|
47229
|
-
}), maxQualifyingDepth = _d.maxQualifyingDepth, structureProfiles = _d.structureProfiles;
|
|
47230
|
-
try {
|
|
47231
|
-
for (var _e = __values(drawDefinition.structures), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
47232
|
-
var structure_1 = _f.value;
|
|
47233
|
-
var profile = structureProfiles[structure_1.structureId];
|
|
47234
|
-
if (profile.distanceFromMain) {
|
|
47235
|
-
structure_1.stageSequence =
|
|
47236
|
-
maxQualifyingDepth + 1 - profile.distanceFromMain;
|
|
47237
|
-
}
|
|
47238
|
-
}
|
|
47239
|
-
}
|
|
47240
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
47241
|
-
finally {
|
|
47242
|
-
try {
|
|
47243
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
47244
|
-
}
|
|
47245
|
-
finally { if (e_1) throw e_1.error; }
|
|
47246
|
-
}
|
|
47247
|
-
var matchUps = ((_c = getAllStructureMatchUps({ structure: structure })) === null || _c === void 0 ? void 0 : _c.matchUps) || [];
|
|
47282
|
+
resequenceStructures({ drawDefinition: drawDefinition });
|
|
47283
|
+
var matchUps = ((_b = getAllStructureMatchUps({ structure: structure })) === null || _b === void 0 ? void 0 : _b.matchUps) || [];
|
|
47248
47284
|
addMatchUpsNotice({
|
|
47249
47285
|
drawDefinition: drawDefinition,
|
|
47250
47286
|
tournamentId: tournamentId,
|
|
@@ -47791,7 +47827,7 @@ function renameStructures$1(_a) {
|
|
|
47791
47827
|
|
|
47792
47828
|
function removeStructure(_a) {
|
|
47793
47829
|
var _b, _c, _d;
|
|
47794
|
-
var tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, structureId = _a.structureId, event = _a.event;
|
|
47830
|
+
var tournamentRecord = _a.tournamentRecord, drawDefinition = _a.drawDefinition, structureId = _a.structureId, event = _a.event, force = _a.force;
|
|
47795
47831
|
if (typeof structureId !== 'string')
|
|
47796
47832
|
return { error: INVALID_VALUES };
|
|
47797
47833
|
if (!drawDefinition)
|
|
@@ -47800,11 +47836,22 @@ function removeStructure(_a) {
|
|
|
47800
47836
|
return { error: MISSING_STRUCTURE_ID };
|
|
47801
47837
|
var structures = drawDefinition.structures || [];
|
|
47802
47838
|
var removedStructureIds = [];
|
|
47839
|
+
var structure = structures.find(function (structure) { return structure.structureId === structureId; });
|
|
47840
|
+
if (!structure)
|
|
47841
|
+
return { error: STRUCTURE_NOT_FOUND };
|
|
47842
|
+
// TODO: if structure being rmoved is qualifying structure, ensure no source structures have scored matchUps
|
|
47843
|
+
var structureMatchUps = getAllStructureMatchUps({ structure: structure }).matchUps;
|
|
47844
|
+
var scoresPresent = structureMatchUps.some(function (_a) {
|
|
47845
|
+
var score = _a.score;
|
|
47846
|
+
return scoreHasValue({ score: score });
|
|
47847
|
+
});
|
|
47848
|
+
if (scoresPresent && !force)
|
|
47849
|
+
return { error: SCORES_PRESENT };
|
|
47803
47850
|
var mainStageSequence1 = structures.find(function (_a) {
|
|
47804
47851
|
var stage = _a.stage, stageSequence = _a.stageSequence;
|
|
47805
47852
|
return stage === MAIN && stageSequence === 1;
|
|
47806
47853
|
});
|
|
47807
|
-
var isMainStageSequence1 = structureId === mainStageSequence1.structureId;
|
|
47854
|
+
var isMainStageSequence1 = structureId === (mainStageSequence1 === null || mainStageSequence1 === void 0 ? void 0 : mainStageSequence1.structureId);
|
|
47808
47855
|
var qualifyingStructureIds = structures
|
|
47809
47856
|
.filter(function (_a) {
|
|
47810
47857
|
var stage = _a.stage;
|
|
@@ -47818,20 +47865,20 @@ function removeStructure(_a) {
|
|
|
47818
47865
|
var removedMatchUpIds = [];
|
|
47819
47866
|
var idsToRemove = [structureId];
|
|
47820
47867
|
var getTargetedStructureIds = function (structureId) {
|
|
47821
|
-
var _a;
|
|
47822
|
-
return (_a = drawDefinition.links) === null || _a === void 0 ? void 0 : _a.map(function (link) {
|
|
47868
|
+
var _a, _b;
|
|
47869
|
+
return (_b = (_a = drawDefinition.links) === null || _a === void 0 ? void 0 : _a.map(function (link) {
|
|
47823
47870
|
return link.source.structureId === structureId &&
|
|
47824
|
-
link.target.structureId !== mainStageSequence1.structureId &&
|
|
47871
|
+
link.target.structureId !== (mainStageSequence1 === null || mainStageSequence1 === void 0 ? void 0 : mainStageSequence1.structureId) &&
|
|
47825
47872
|
link.target.structureId;
|
|
47826
|
-
}).filter(Boolean);
|
|
47873
|
+
}).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
|
47827
47874
|
};
|
|
47828
47875
|
var getQualifyingSourceStructureIds = function (structureId) {
|
|
47829
|
-
var _a;
|
|
47830
|
-
return (_a = drawDefinition.links) === null || _a === void 0 ? void 0 : _a.map(function (link) {
|
|
47876
|
+
var _a, _b;
|
|
47877
|
+
return (_b = (_a = drawDefinition.links) === null || _a === void 0 ? void 0 : _a.map(function (link) {
|
|
47831
47878
|
return qualifyingStructureIds.includes(link.source.structureId) &&
|
|
47832
47879
|
link.target.structureId === structureId &&
|
|
47833
47880
|
link.source.structureId;
|
|
47834
|
-
}).filter(Boolean);
|
|
47881
|
+
}).filter(Boolean)) !== null && _b !== void 0 ? _b : [];
|
|
47835
47882
|
};
|
|
47836
47883
|
var isQualifyingStructure = qualifyingStructureIds.includes(structureId);
|
|
47837
47884
|
var relatedStructureIdsMap = new Map();
|
|
@@ -47842,11 +47889,11 @@ function removeStructure(_a) {
|
|
|
47842
47889
|
});
|
|
47843
47890
|
var _loop_1 = function () {
|
|
47844
47891
|
var idBeingRemoved = idsToRemove.pop();
|
|
47845
|
-
var
|
|
47892
|
+
var structure_1 = findStructure({
|
|
47846
47893
|
structureId: idBeingRemoved,
|
|
47847
47894
|
drawDefinition: drawDefinition,
|
|
47848
47895
|
}).structure;
|
|
47849
|
-
var matchUps_1 = getAllStructureMatchUps({ structure:
|
|
47896
|
+
var matchUps_1 = getAllStructureMatchUps({ structure: structure_1 }).matchUps;
|
|
47850
47897
|
var matchUpIds = getMatchUpIds(matchUps_1);
|
|
47851
47898
|
removedMatchUpIds.push.apply(removedMatchUpIds, __spreadArray([], __read(matchUpIds), false));
|
|
47852
47899
|
drawDefinition.links =
|
|
@@ -47866,7 +47913,7 @@ function removeStructure(_a) {
|
|
|
47866
47913
|
// targetedStructureIdsMap[idBeingRemoved].filter(
|
|
47867
47914
|
(_d = relatedStructureIdsMap.get(idBeingRemoved)) === null || _d === void 0 ? void 0 : _d.filter(function (id) {
|
|
47868
47915
|
// IMPORTANT: only delete MAIN stageSequence: 1 if specified to protect against DOUBLE_ELIMINATION scenario
|
|
47869
|
-
return id !== mainStageSequence1.structureId ||
|
|
47916
|
+
return id !== (mainStageSequence1 === null || mainStageSequence1 === void 0 ? void 0 : mainStageSequence1.structureId) ||
|
|
47870
47917
|
structureId === mainStageSequence1.structureId;
|
|
47871
47918
|
}));
|
|
47872
47919
|
if (targetedStructureIds === null || targetedStructureIds === void 0 ? void 0 : targetedStructureIds.length)
|
|
@@ -47896,6 +47943,7 @@ function removeStructure(_a) {
|
|
|
47896
47943
|
mainStageSequence1.extensions = [];
|
|
47897
47944
|
}
|
|
47898
47945
|
}
|
|
47946
|
+
isQualifyingStructure && resequenceStructures({ drawDefinition: drawDefinition });
|
|
47899
47947
|
deleteMatchUpsNotice({
|
|
47900
47948
|
tournamentId: tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.tournamentId,
|
|
47901
47949
|
matchUpIds: removedMatchUpIds,
|
|
@@ -51942,6 +51990,7 @@ function getValidAssignmentActions(_a) {
|
|
|
51942
51990
|
if (!ignoreSeedPositions) {
|
|
51943
51991
|
var result = getNextSeedBlock({
|
|
51944
51992
|
provisionalPositioning: provisionalPositioning,
|
|
51993
|
+
returnAllProxies: true,
|
|
51945
51994
|
randomize: true,
|
|
51946
51995
|
drawDefinition: drawDefinition,
|
|
51947
51996
|
structureId: structureId,
|
|
@@ -52518,6 +52567,7 @@ function positionActions$1(params) {
|
|
|
52518
52567
|
isValidSeedPosition({ drawDefinition: drawDefinition, structureId: structureId, drawPosition: drawPosition }) &&
|
|
52519
52568
|
validToAssignSeed) {
|
|
52520
52569
|
var seedAssignments = getStructureSeedAssignments({
|
|
52570
|
+
returnAllProxies: true,
|
|
52521
52571
|
drawDefinition: drawDefinition,
|
|
52522
52572
|
structure: structure,
|
|
52523
52573
|
}).seedAssignments;
|
|
@@ -52546,6 +52596,7 @@ function positionActions$1(params) {
|
|
|
52546
52596
|
isValidSeedPosition({ drawDefinition: drawDefinition, structureId: structureId, drawPosition: drawPosition }) &&
|
|
52547
52597
|
validToAssignSeed) {
|
|
52548
52598
|
var seedAssignments = getStructureSeedAssignments({
|
|
52599
|
+
returnAllProxies: true,
|
|
52549
52600
|
drawDefinition: drawDefinition,
|
|
52550
52601
|
structure: structure,
|
|
52551
52602
|
}).seedAssignments;
|