tods-competition-factory 0.90.2 → 0.90.6
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/tods-competition-factory.development.cjs.js +162 -92
- 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/dist/tods-competition-factory.production.esm.min.js +1 -1
- package/dist/tods-competition-factory.production.esm.min.js.map +1 -1
- package/package.json +6 -9
|
@@ -249,7 +249,7 @@ const matchUpFormatCode = {
|
|
|
249
249
|
};
|
|
250
250
|
|
|
251
251
|
function factoryVersion() {
|
|
252
|
-
return '0.90.
|
|
252
|
+
return '0.90.6';
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
const FORMAT_STANDARD = 'SET3-S:6/TB7'; // Best of 3 Tiebreak Sets to 6
|
|
@@ -7395,13 +7395,13 @@ var collectionDefinitions$d = [
|
|
|
7395
7395
|
matchUpValue: 1
|
|
7396
7396
|
}
|
|
7397
7397
|
];
|
|
7398
|
-
var tieFormatName$
|
|
7398
|
+
var tieFormatName$d = "COLLEGE_D3";
|
|
7399
7399
|
var winCriteria$d = {
|
|
7400
7400
|
valueGoal: 5
|
|
7401
7401
|
};
|
|
7402
7402
|
var COLLEGE_D3$1 = {
|
|
7403
7403
|
collectionDefinitions: collectionDefinitions$d,
|
|
7404
|
-
tieFormatName: tieFormatName$
|
|
7404
|
+
tieFormatName: tieFormatName$d,
|
|
7405
7405
|
winCriteria: winCriteria$d
|
|
7406
7406
|
};
|
|
7407
7407
|
|
|
@@ -7421,13 +7421,13 @@ var collectionDefinitions$c = [
|
|
|
7421
7421
|
matchUpValue: 1
|
|
7422
7422
|
}
|
|
7423
7423
|
];
|
|
7424
|
-
var tieFormatName$
|
|
7424
|
+
var tieFormatName$c = "COLLEGE_DEFAULT";
|
|
7425
7425
|
var winCriteria$c = {
|
|
7426
7426
|
valueGoal: 5
|
|
7427
7427
|
};
|
|
7428
7428
|
var COLLEGE_DEFAULT$1 = {
|
|
7429
7429
|
collectionDefinitions: collectionDefinitions$c,
|
|
7430
|
-
tieFormatName: tieFormatName$
|
|
7430
|
+
tieFormatName: tieFormatName$c,
|
|
7431
7431
|
winCriteria: winCriteria$c
|
|
7432
7432
|
};
|
|
7433
7433
|
|
|
@@ -7447,13 +7447,13 @@ var collectionDefinitions$b = [
|
|
|
7447
7447
|
matchUpValue: 1
|
|
7448
7448
|
}
|
|
7449
7449
|
];
|
|
7450
|
-
var tieFormatName$
|
|
7450
|
+
var tieFormatName$b = "COLLEGE_JUCO";
|
|
7451
7451
|
var winCriteria$b = {
|
|
7452
7452
|
valueGoal: 5
|
|
7453
7453
|
};
|
|
7454
7454
|
var COLLEGE_JUCO$1 = {
|
|
7455
7455
|
collectionDefinitions: collectionDefinitions$b,
|
|
7456
|
-
tieFormatName: tieFormatName$
|
|
7456
|
+
tieFormatName: tieFormatName$b,
|
|
7457
7457
|
winCriteria: winCriteria$b
|
|
7458
7458
|
};
|
|
7459
7459
|
|
|
@@ -7473,13 +7473,13 @@ var collectionDefinitions$a = [
|
|
|
7473
7473
|
matchUpValue: 1
|
|
7474
7474
|
}
|
|
7475
7475
|
];
|
|
7476
|
-
var tieFormatName$
|
|
7476
|
+
var tieFormatName$a = "DOMINANT_DUO";
|
|
7477
7477
|
var winCriteria$a = {
|
|
7478
7478
|
valueGoal: 2
|
|
7479
7479
|
};
|
|
7480
7480
|
var DOMINANT_DUO_TIE_FORMAT = {
|
|
7481
7481
|
collectionDefinitions: collectionDefinitions$a,
|
|
7482
|
-
tieFormatName: tieFormatName$
|
|
7482
|
+
tieFormatName: tieFormatName$a,
|
|
7483
7483
|
winCriteria: winCriteria$a
|
|
7484
7484
|
};
|
|
7485
7485
|
|
|
@@ -7508,19 +7508,16 @@ var collectionDefinitions$9 = [
|
|
|
7508
7508
|
matchUpValue: 1
|
|
7509
7509
|
}
|
|
7510
7510
|
];
|
|
7511
|
-
var tieFormatName$
|
|
7511
|
+
var tieFormatName$9 = "DOMINANT_DUO_MIXED";
|
|
7512
7512
|
var winCriteria$9 = {
|
|
7513
7513
|
valueGoal: 2
|
|
7514
7514
|
};
|
|
7515
7515
|
var DOMINANT_DUO_MIXED_TIE_FORMAT = {
|
|
7516
7516
|
collectionDefinitions: collectionDefinitions$9,
|
|
7517
|
-
tieFormatName: tieFormatName$
|
|
7517
|
+
tieFormatName: tieFormatName$9,
|
|
7518
7518
|
winCriteria: winCriteria$9
|
|
7519
7519
|
};
|
|
7520
7520
|
|
|
7521
|
-
var winCriteria$8 = {
|
|
7522
|
-
valueGoal: 13
|
|
7523
|
-
};
|
|
7524
7521
|
var collectionDefinitions$8 = [
|
|
7525
7522
|
{
|
|
7526
7523
|
collectionGroupNumber: 1,
|
|
@@ -7565,7 +7562,7 @@ var collectionDefinitions$8 = [
|
|
|
7565
7562
|
matchUpValue: 3
|
|
7566
7563
|
}
|
|
7567
7564
|
];
|
|
7568
|
-
var collectionGroups = [
|
|
7565
|
+
var collectionGroups$1 = [
|
|
7569
7566
|
{
|
|
7570
7567
|
groupNumber: 1,
|
|
7571
7568
|
groupName: "Day 1"
|
|
@@ -7579,10 +7576,15 @@ var collectionGroups = [
|
|
|
7579
7576
|
groupName: "Day 3"
|
|
7580
7577
|
}
|
|
7581
7578
|
];
|
|
7579
|
+
var tieFormatName$8 = "LAVER_CUP";
|
|
7580
|
+
var winCriteria$8 = {
|
|
7581
|
+
valueGoal: 13
|
|
7582
|
+
};
|
|
7582
7583
|
var LAVER_CUP_TIE_FORMAT = {
|
|
7583
|
-
winCriteria: winCriteria$8,
|
|
7584
7584
|
collectionDefinitions: collectionDefinitions$8,
|
|
7585
|
-
collectionGroups: collectionGroups
|
|
7585
|
+
collectionGroups: collectionGroups$1,
|
|
7586
|
+
tieFormatName: tieFormatName$8,
|
|
7587
|
+
winCriteria: winCriteria$8
|
|
7586
7588
|
};
|
|
7587
7589
|
|
|
7588
7590
|
var collectionDefinitions$7 = [
|
|
@@ -7840,6 +7842,25 @@ var USTA_SOUTHERN_LEVEL_5_TIE_FORMAT = {
|
|
|
7840
7842
|
|
|
7841
7843
|
var collectionDefinitions$1 = [
|
|
7842
7844
|
{
|
|
7845
|
+
collectionGroupNumber: 1,
|
|
7846
|
+
collectionName: "Boys Doubles",
|
|
7847
|
+
gender: "MALE",
|
|
7848
|
+
matchUpCount: 1,
|
|
7849
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7850
|
+
matchUpType: "DOUBLES",
|
|
7851
|
+
matchUpValue: 1
|
|
7852
|
+
},
|
|
7853
|
+
{
|
|
7854
|
+
collectionGroupNumber: 1,
|
|
7855
|
+
collectionName: "Girls Doubles",
|
|
7856
|
+
gender: "FEMALE",
|
|
7857
|
+
matchUpCount: 1,
|
|
7858
|
+
matchUpFormat: "SET1-S:8/TB7",
|
|
7859
|
+
matchUpType: "DOUBLES",
|
|
7860
|
+
matchUpValue: 1
|
|
7861
|
+
},
|
|
7862
|
+
{
|
|
7863
|
+
collectionGroupNumber: 2,
|
|
7843
7864
|
collectionName: "Boys Singles",
|
|
7844
7865
|
matchUpCount: 1,
|
|
7845
7866
|
gender: "MALE",
|
|
@@ -7848,6 +7869,7 @@ var collectionDefinitions$1 = [
|
|
|
7848
7869
|
matchUpValue: 1
|
|
7849
7870
|
},
|
|
7850
7871
|
{
|
|
7872
|
+
collectionGroupNumber: 2,
|
|
7851
7873
|
collectionName: "Girls Singles",
|
|
7852
7874
|
gender: "FEMALE",
|
|
7853
7875
|
matchUpCount: 1,
|
|
@@ -7856,27 +7878,26 @@ var collectionDefinitions$1 = [
|
|
|
7856
7878
|
matchUpValue: 1
|
|
7857
7879
|
},
|
|
7858
7880
|
{
|
|
7859
|
-
|
|
7860
|
-
|
|
7881
|
+
collectionGroupNumber: 3,
|
|
7882
|
+
collectionName: "Mixed Doubles",
|
|
7861
7883
|
matchUpCount: 1,
|
|
7862
7884
|
matchUpFormat: "SET1-S:8/TB7",
|
|
7863
7885
|
matchUpType: "DOUBLES",
|
|
7864
7886
|
matchUpValue: 1
|
|
7887
|
+
}
|
|
7888
|
+
];
|
|
7889
|
+
var collectionGroups = [
|
|
7890
|
+
{
|
|
7891
|
+
groupNumber: 1,
|
|
7892
|
+
groupName: "Doubles"
|
|
7865
7893
|
},
|
|
7866
7894
|
{
|
|
7867
|
-
|
|
7868
|
-
|
|
7869
|
-
matchUpCount: 1,
|
|
7870
|
-
matchUpFormat: "SET1-S:8/TB7",
|
|
7871
|
-
matchUpType: "DOUBLES",
|
|
7872
|
-
matchUpValue: 1
|
|
7895
|
+
groupNumber: 2,
|
|
7896
|
+
groupName: "Singles"
|
|
7873
7897
|
},
|
|
7874
7898
|
{
|
|
7875
|
-
|
|
7876
|
-
|
|
7877
|
-
matchUpFormat: "SET1-S:8/TB7",
|
|
7878
|
-
matchUpType: "DOUBLES",
|
|
7879
|
-
matchUpValue: 1
|
|
7899
|
+
groupNumber: 3,
|
|
7900
|
+
groupName: "Mixed Doubles"
|
|
7880
7901
|
}
|
|
7881
7902
|
];
|
|
7882
7903
|
var tieFormatName$1 = "USTA_WTT";
|
|
@@ -7885,6 +7906,7 @@ var winCriteria$1 = {
|
|
|
7885
7906
|
};
|
|
7886
7907
|
var USTA_WTT_TIE_FORMAT = {
|
|
7887
7908
|
collectionDefinitions: collectionDefinitions$1,
|
|
7909
|
+
collectionGroups: collectionGroups,
|
|
7888
7910
|
tieFormatName: tieFormatName$1,
|
|
7889
7911
|
winCriteria: winCriteria$1
|
|
7890
7912
|
};
|
|
@@ -13049,32 +13071,6 @@ function addMatchUpResumeTime$2({
|
|
|
13049
13071
|
}
|
|
13050
13072
|
}
|
|
13051
13073
|
|
|
13052
|
-
function annotatePerson(person) {
|
|
13053
|
-
const {
|
|
13054
|
-
nationalityCode
|
|
13055
|
-
} = person || {};
|
|
13056
|
-
|
|
13057
|
-
if (nationalityCode) {
|
|
13058
|
-
const country = countries.find(({
|
|
13059
|
-
ioc
|
|
13060
|
-
}) => ioc === nationalityCode);
|
|
13061
|
-
if (country !== null && country !== void 0 && country.iso && !person.isoNationalityCode) person.isoNationalityCode = country.iso;
|
|
13062
|
-
if (country !== null && country !== void 0 && country.label && !person.countryName) person.countryName = country.label;
|
|
13063
|
-
}
|
|
13064
|
-
}
|
|
13065
|
-
function addNationalityCodeISO({
|
|
13066
|
-
participant
|
|
13067
|
-
}) {
|
|
13068
|
-
const {
|
|
13069
|
-
person,
|
|
13070
|
-
individualParticipants
|
|
13071
|
-
} = participant;
|
|
13072
|
-
const persons = [person, individualParticipants === null || individualParticipants === void 0 ? void 0 : individualParticipants.map(({
|
|
13073
|
-
person
|
|
13074
|
-
}) => person)].flat().filter(Boolean);
|
|
13075
|
-
persons.forEach(annotatePerson);
|
|
13076
|
-
}
|
|
13077
|
-
|
|
13078
13074
|
function addParticipantGroupings({
|
|
13079
13075
|
participants = []
|
|
13080
13076
|
}) {
|
|
@@ -13133,6 +13129,32 @@ function addParticipantGroupings({
|
|
|
13133
13129
|
return participantsWithGroupings;
|
|
13134
13130
|
}
|
|
13135
13131
|
|
|
13132
|
+
function annotatePerson(person) {
|
|
13133
|
+
const {
|
|
13134
|
+
nationalityCode
|
|
13135
|
+
} = person || {};
|
|
13136
|
+
|
|
13137
|
+
if (nationalityCode) {
|
|
13138
|
+
const country = countries.find(({
|
|
13139
|
+
ioc
|
|
13140
|
+
}) => ioc === nationalityCode);
|
|
13141
|
+
if (country !== null && country !== void 0 && country.iso && !person.isoNationalityCode) person.isoNationalityCode = country.iso;
|
|
13142
|
+
if (country !== null && country !== void 0 && country.label && !person.countryName) person.countryName = country.label;
|
|
13143
|
+
}
|
|
13144
|
+
}
|
|
13145
|
+
function addNationalityCodeISO({
|
|
13146
|
+
participant
|
|
13147
|
+
}) {
|
|
13148
|
+
const {
|
|
13149
|
+
person,
|
|
13150
|
+
individualParticipants
|
|
13151
|
+
} = participant;
|
|
13152
|
+
const persons = [person, individualParticipants === null || individualParticipants === void 0 ? void 0 : individualParticipants.map(({
|
|
13153
|
+
person
|
|
13154
|
+
}) => person)].flat().filter(Boolean);
|
|
13155
|
+
persons.forEach(annotatePerson);
|
|
13156
|
+
}
|
|
13157
|
+
|
|
13136
13158
|
/*
|
|
13137
13159
|
returns the next round matchUp for winner of given matchUp
|
|
13138
13160
|
*/
|
|
@@ -13987,7 +14009,7 @@ function getDrawMatchUps({
|
|
|
13987
14009
|
context,
|
|
13988
14010
|
event
|
|
13989
14011
|
}) {
|
|
13990
|
-
var _tournamentParticipan
|
|
14012
|
+
var _tournamentParticipan;
|
|
13991
14013
|
|
|
13992
14014
|
if (!drawDefinition) return {
|
|
13993
14015
|
error: MISSING_DRAW_DEFINITION
|
|
@@ -14000,12 +14022,16 @@ function getDrawMatchUps({
|
|
|
14000
14022
|
// ...so participants must be sourced directly from tournamentRecord
|
|
14001
14023
|
// ...and groupings must be added independent of that
|
|
14002
14024
|
|
|
14003
|
-
|
|
14025
|
+
if (!((_tournamentParticipan = tournamentParticipants) !== null && _tournamentParticipan !== void 0 && _tournamentParticipan.length) && tournamentRecord) {
|
|
14026
|
+
var _tournamentParticipan2;
|
|
14004
14027
|
|
|
14005
|
-
|
|
14006
|
-
|
|
14007
|
-
|
|
14008
|
-
|
|
14028
|
+
tournamentParticipants = tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.participants;
|
|
14029
|
+
|
|
14030
|
+
if ((inContext || participantsProfile !== null && participantsProfile !== void 0 && participantsProfile.withGroupings) && (_tournamentParticipan2 = tournamentParticipants) !== null && _tournamentParticipan2 !== void 0 && _tournamentParticipan2.length) {
|
|
14031
|
+
tournamentParticipants = addParticipantGroupings({
|
|
14032
|
+
participants: tournamentParticipants
|
|
14033
|
+
});
|
|
14034
|
+
}
|
|
14009
14035
|
}
|
|
14010
14036
|
|
|
14011
14037
|
const {
|
|
@@ -14113,7 +14139,8 @@ function allTournamentMatchUps({
|
|
|
14113
14139
|
const events = (tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.events) || [];
|
|
14114
14140
|
const participants = getParticipants({
|
|
14115
14141
|
participantsProfile,
|
|
14116
|
-
tournamentRecord
|
|
14142
|
+
tournamentRecord,
|
|
14143
|
+
inContext
|
|
14117
14144
|
});
|
|
14118
14145
|
const {
|
|
14119
14146
|
appliedPolicies: tournamentAppliedPolicies
|
|
@@ -14146,6 +14173,7 @@ function allTournamentMatchUps({
|
|
|
14146
14173
|
};
|
|
14147
14174
|
}
|
|
14148
14175
|
function allDrawMatchUps$1({
|
|
14176
|
+
participants: tournamentParticipants,
|
|
14149
14177
|
scheduleVisibilityFilters,
|
|
14150
14178
|
tournamentAppliedPolicies,
|
|
14151
14179
|
participantsProfile,
|
|
@@ -14155,12 +14183,13 @@ function allDrawMatchUps$1({
|
|
|
14155
14183
|
contextFilters,
|
|
14156
14184
|
drawDefinition,
|
|
14157
14185
|
contextProfile,
|
|
14158
|
-
participants,
|
|
14159
14186
|
nextMatchUps,
|
|
14160
14187
|
inContext,
|
|
14161
14188
|
context,
|
|
14162
14189
|
event
|
|
14163
14190
|
}) {
|
|
14191
|
+
var _tournamentParticipan;
|
|
14192
|
+
|
|
14164
14193
|
const {
|
|
14165
14194
|
eventId,
|
|
14166
14195
|
eventName,
|
|
@@ -14178,10 +14207,15 @@ function allDrawMatchUps$1({
|
|
|
14178
14207
|
surfaceCategory: (event === null || event === void 0 ? void 0 : event.surfaceCategory) || (tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.surfaceCategory),
|
|
14179
14208
|
endDate: event === null || event === void 0 ? void 0 : event.endDate
|
|
14180
14209
|
};
|
|
14181
|
-
|
|
14182
|
-
|
|
14183
|
-
|
|
14184
|
-
|
|
14210
|
+
|
|
14211
|
+
if (!((_tournamentParticipan = tournamentParticipants) !== null && _tournamentParticipan !== void 0 && _tournamentParticipan.length) && tournamentRecord) {
|
|
14212
|
+
tournamentParticipants = getParticipants({
|
|
14213
|
+
inContext,
|
|
14214
|
+
tournamentRecord,
|
|
14215
|
+
participantsProfile
|
|
14216
|
+
}) || [];
|
|
14217
|
+
}
|
|
14218
|
+
|
|
14185
14219
|
return getAllDrawMatchUps({
|
|
14186
14220
|
context: additionalContext,
|
|
14187
14221
|
tournamentAppliedPolicies,
|
|
@@ -14214,6 +14248,8 @@ function allEventMatchUps({
|
|
|
14214
14248
|
context,
|
|
14215
14249
|
event
|
|
14216
14250
|
}) {
|
|
14251
|
+
var _participants;
|
|
14252
|
+
|
|
14217
14253
|
if (!event) return {
|
|
14218
14254
|
error: MISSING_EVENT
|
|
14219
14255
|
};
|
|
@@ -14239,10 +14275,15 @@ function allEventMatchUps({
|
|
|
14239
14275
|
})
|
|
14240
14276
|
};
|
|
14241
14277
|
if (endDate) additionalContext.endDate = endDate;
|
|
14242
|
-
|
|
14243
|
-
|
|
14244
|
-
|
|
14245
|
-
|
|
14278
|
+
|
|
14279
|
+
if (!((_participants = participants) !== null && _participants !== void 0 && _participants.length) && tournamentRecord) {
|
|
14280
|
+
participants = getParticipants({
|
|
14281
|
+
participantsProfile,
|
|
14282
|
+
tournamentRecord,
|
|
14283
|
+
inContext
|
|
14284
|
+
});
|
|
14285
|
+
}
|
|
14286
|
+
|
|
14246
14287
|
const drawDefinitions = event.drawDefinitions || [];
|
|
14247
14288
|
const scheduleTiming = getScheduleTiming({
|
|
14248
14289
|
tournamentRecord,
|
|
@@ -14295,7 +14336,8 @@ function tournamentMatchUps({
|
|
|
14295
14336
|
const events = tournamentRecord && tournamentRecord.events || [];
|
|
14296
14337
|
const participants = getParticipants({
|
|
14297
14338
|
participantsProfile,
|
|
14298
|
-
tournamentRecord
|
|
14339
|
+
tournamentRecord,
|
|
14340
|
+
inContext
|
|
14299
14341
|
});
|
|
14300
14342
|
const {
|
|
14301
14343
|
appliedPolicies: tournamentAppliedPolicies
|
|
@@ -14333,6 +14375,7 @@ function tournamentMatchUps({
|
|
|
14333
14375
|
return matchUpGroupings;
|
|
14334
14376
|
}
|
|
14335
14377
|
function eventMatchUps({
|
|
14378
|
+
participants: tournamentParticipants,
|
|
14336
14379
|
tournamentAppliedPolicies,
|
|
14337
14380
|
scheduleVisibilityFilters,
|
|
14338
14381
|
participantsProfile,
|
|
@@ -14342,7 +14385,6 @@ function eventMatchUps({
|
|
|
14342
14385
|
contextFilters,
|
|
14343
14386
|
contextProfile,
|
|
14344
14387
|
nextMatchUps,
|
|
14345
|
-
participants,
|
|
14346
14388
|
tournamentId,
|
|
14347
14389
|
inContext,
|
|
14348
14390
|
context,
|
|
@@ -14366,10 +14408,15 @@ function eventMatchUps({
|
|
|
14366
14408
|
surfaceCategory: event.surfaceCategory || (tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.surfaceCategory)
|
|
14367
14409
|
})
|
|
14368
14410
|
};
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14411
|
+
|
|
14412
|
+
if (!tournamentParticipants && tournamentRecord) {
|
|
14413
|
+
tournamentParticipants = getParticipants({
|
|
14414
|
+
participantsProfile,
|
|
14415
|
+
tournamentRecord,
|
|
14416
|
+
inContext
|
|
14417
|
+
});
|
|
14418
|
+
}
|
|
14419
|
+
|
|
14373
14420
|
const drawDefinitions = event.drawDefinitions || [];
|
|
14374
14421
|
const matchUpGroupings = drawDefinitions.reduce((matchUps, drawDefinition) => {
|
|
14375
14422
|
const drawMatchUps = getDrawMatchUps({
|
|
@@ -14398,6 +14445,7 @@ function eventMatchUps({
|
|
|
14398
14445
|
return matchUpGroupings;
|
|
14399
14446
|
}
|
|
14400
14447
|
function drawMatchUps$1({
|
|
14448
|
+
participants: tournamentParticipants,
|
|
14401
14449
|
tournamentAppliedPolicies,
|
|
14402
14450
|
scheduleVisibilityFilters,
|
|
14403
14451
|
participantsProfile,
|
|
@@ -14408,12 +14456,13 @@ function drawMatchUps$1({
|
|
|
14408
14456
|
contextProfile,
|
|
14409
14457
|
drawDefinition,
|
|
14410
14458
|
nextMatchUps,
|
|
14411
|
-
participants,
|
|
14412
14459
|
tournamentId,
|
|
14413
14460
|
inContext,
|
|
14414
14461
|
context,
|
|
14415
14462
|
event
|
|
14416
14463
|
}) {
|
|
14464
|
+
var _tournamentParticipan2;
|
|
14465
|
+
|
|
14417
14466
|
if (!event) return {
|
|
14418
14467
|
error: MISSING_EVENT
|
|
14419
14468
|
};
|
|
@@ -14432,10 +14481,15 @@ function drawMatchUps$1({
|
|
|
14432
14481
|
surfaceCategory: (event === null || event === void 0 ? void 0 : event.surfaceCategory) || (tournamentRecord === null || tournamentRecord === void 0 ? void 0 : tournamentRecord.surfaceCategory)
|
|
14433
14482
|
})
|
|
14434
14483
|
};
|
|
14435
|
-
|
|
14436
|
-
|
|
14437
|
-
|
|
14438
|
-
|
|
14484
|
+
|
|
14485
|
+
if (!((_tournamentParticipan2 = tournamentParticipants) !== null && _tournamentParticipan2 !== void 0 && _tournamentParticipan2.length) && tournamentRecord) {
|
|
14486
|
+
tournamentParticipants = getParticipants({
|
|
14487
|
+
participantsProfile,
|
|
14488
|
+
tournamentRecord,
|
|
14489
|
+
inContext
|
|
14490
|
+
});
|
|
14491
|
+
}
|
|
14492
|
+
|
|
14439
14493
|
return getDrawMatchUps({
|
|
14440
14494
|
context: additionalContext,
|
|
14441
14495
|
tournamentAppliedPolicies,
|
|
@@ -14455,13 +14509,24 @@ function drawMatchUps$1({
|
|
|
14455
14509
|
}
|
|
14456
14510
|
|
|
14457
14511
|
function getParticipants({
|
|
14512
|
+
inContext,
|
|
14458
14513
|
tournamentRecord,
|
|
14459
14514
|
participantsProfile
|
|
14460
14515
|
}) {
|
|
14461
|
-
|
|
14462
|
-
|
|
14516
|
+
var _participants2;
|
|
14517
|
+
|
|
14518
|
+
let participants = tournamentRecord.participants || [];
|
|
14519
|
+
if (participantsProfile !== null && participantsProfile !== void 0 && participantsProfile.withISO) participants.forEach(participant => addNationalityCodeISO({
|
|
14463
14520
|
participant
|
|
14464
14521
|
}));
|
|
14522
|
+
|
|
14523
|
+
if ((inContext || participantsProfile !== null && participantsProfile !== void 0 && participantsProfile.withGroupings) && (_participants2 = participants) !== null && _participants2 !== void 0 && _participants2.length) {
|
|
14524
|
+
participants = addParticipantGroupings({
|
|
14525
|
+
participants
|
|
14526
|
+
});
|
|
14527
|
+
}
|
|
14528
|
+
|
|
14529
|
+
return participants;
|
|
14465
14530
|
}
|
|
14466
14531
|
|
|
14467
14532
|
function publicFindMatchUp(params) {
|
|
@@ -22771,7 +22836,7 @@ function addParticipant({
|
|
|
22771
22836
|
|
|
22772
22837
|
const hasSchedule = ({
|
|
22773
22838
|
scheduleAttributes = ['scheduledDate', 'scheduledTime'],
|
|
22774
|
-
schedule
|
|
22839
|
+
schedule = {}
|
|
22775
22840
|
}) => {
|
|
22776
22841
|
const matchUpScheduleKeys = Object.keys(schedule).filter(key => scheduleAttributes.includes(key)).filter(key => schedule[key]);
|
|
22777
22842
|
return !!matchUpScheduleKeys.length;
|
|
@@ -22787,7 +22852,7 @@ function participantScheduledMatchUps({
|
|
|
22787
22852
|
if (!Array.isArray(scheduleAttributes)) return {
|
|
22788
22853
|
error: INVALID_VALUES
|
|
22789
22854
|
};
|
|
22790
|
-
const scheduledMatchUps = matchUps.filter(({
|
|
22855
|
+
const scheduledMatchUps = matchUps.filter(Boolean).filter(({
|
|
22791
22856
|
schedule
|
|
22792
22857
|
}) => hasSchedule({
|
|
22793
22858
|
schedule,
|
|
@@ -23800,7 +23865,9 @@ function annotateParticipant({
|
|
|
23800
23865
|
scheduledMinutesDifference
|
|
23801
23866
|
} = scheduleAnalysis || {};
|
|
23802
23867
|
Object.keys(scheduledMatchUps).forEach(date => {
|
|
23803
|
-
scheduledMatchUps[date].forEach((matchUp, i) => {
|
|
23868
|
+
scheduledMatchUps[date].filter(Boolean).forEach((matchUp, i) => {
|
|
23869
|
+
var _matchUp$schedule;
|
|
23870
|
+
|
|
23804
23871
|
const {
|
|
23805
23872
|
schedule: {
|
|
23806
23873
|
scheduledTime,
|
|
@@ -23823,7 +23890,7 @@ function annotateParticipant({
|
|
|
23823
23890
|
roundNumber,
|
|
23824
23891
|
roundPosition,
|
|
23825
23892
|
...matchUp.schedule,
|
|
23826
|
-
scheduledTime: extractTime(matchUp.schedule.scheduledTime)
|
|
23893
|
+
scheduledTime: extractTime((_matchUp$schedule = matchUp.schedule) === null || _matchUp$schedule === void 0 ? void 0 : _matchUp$schedule.scheduledTime)
|
|
23827
23894
|
}); // matchUps with { matchUpStatus: BYE } are ignored
|
|
23828
23895
|
|
|
23829
23896
|
if (scheduledTime && matchUpStatus !== BYE) {
|
|
@@ -23836,18 +23903,20 @@ function annotateParticipant({
|
|
|
23836
23903
|
|
|
23837
23904
|
// ignore { matchUpStatus: BYE } and matchUps which are unscheduled
|
|
23838
23905
|
if (matchUpStatus !== BYE && (_consideredMatchUp$sc = consideredMatchUp.schedule) !== null && _consideredMatchUp$sc !== void 0 && _consideredMatchUp$sc.scheduledTime) {
|
|
23906
|
+
var _consideredMatchUp$sc2, _consideredMatchUp$sc3;
|
|
23907
|
+
|
|
23839
23908
|
// if there is a matchType change (SINGLES => DOUBLES or vice versa) then there is potentially a different timeAfterRecovery
|
|
23840
23909
|
const typeChange = matchUp.matchUpType !== consideredMatchUp.matchUpType;
|
|
23841
23910
|
const notBeforeTime = typeChange ? typeChangeTimeAfterRecovery || timeAfterRecovery : timeAfterRecovery; // if two matchUps are both potentials and both part of the same draw they cannot be considered in conflict
|
|
23842
23911
|
|
|
23843
23912
|
const sameDraw = matchUp.drawId === consideredMatchUp.drawId;
|
|
23844
23913
|
const bothPotential = matchUp.potential && consideredMatchUp.potential;
|
|
23845
|
-
const nextMinutes = timeStringMinutes(consideredMatchUp.schedule.scheduledTime);
|
|
23914
|
+
const nextMinutes = timeStringMinutes((_consideredMatchUp$sc2 = consideredMatchUp.schedule) === null || _consideredMatchUp$sc2 === void 0 ? void 0 : _consideredMatchUp$sc2.scheduledTime);
|
|
23846
23915
|
const minutesDifference = nextMinutes - scheduledMinutes; // Conflicts can be determined in two ways:
|
|
23847
23916
|
// 1. scheduledMinutesDifference - the minutes difference between two scheduledTimes
|
|
23848
23917
|
// 2. A scheduledTime occurring before a prior matchUps notBeforeTime (timeAfterRecovery)
|
|
23849
23918
|
|
|
23850
|
-
const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : timeStringMinutes(notBeforeTime) > timeStringMinutes(consideredMatchUp.schedule.scheduledTime); // if there is a time overlap capture both the prior matchUpId and the conflicted matchUpId
|
|
23919
|
+
const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference) ? minutesDifference <= scheduledMinutesDifference : timeStringMinutes(notBeforeTime) > timeStringMinutes((_consideredMatchUp$sc3 = consideredMatchUp.schedule) === null || _consideredMatchUp$sc3 === void 0 ? void 0 : _consideredMatchUp$sc3.scheduledTime); // if there is a time overlap capture both the prior matchUpId and the conflicted matchUpId
|
|
23851
23920
|
|
|
23852
23921
|
if (timeOverlap && !(bothPotential && sameDraw)) {
|
|
23853
23922
|
scheduleConflicts.push({
|
|
@@ -39444,6 +39513,7 @@ function isAvailableAction({
|
|
|
39444
39513
|
function positionActions$1({
|
|
39445
39514
|
policyDefinitions: specifiedPolicyDefinitions,
|
|
39446
39515
|
tournamentParticipants = [],
|
|
39516
|
+
overrideAttachedPolicies,
|
|
39447
39517
|
tournamentRecord,
|
|
39448
39518
|
drawDefinition,
|
|
39449
39519
|
drawPosition,
|
|
@@ -39484,7 +39554,7 @@ function positionActions$1({
|
|
|
39484
39554
|
drawDefinition,
|
|
39485
39555
|
event
|
|
39486
39556
|
});
|
|
39487
|
-
const policyDefinitions = specifiedPolicyDefinitions ||
|
|
39557
|
+
const policyDefinitions = overrideAttachedPolicies ? specifiedPolicyDefinitions : attachedPolicyDefinitions ? Object.assign(attachedPolicyDefinitions, specifiedPolicyDefinitions || {}) : specifiedPolicyDefinitions;
|
|
39488
39558
|
const {
|
|
39489
39559
|
enabledStructures,
|
|
39490
39560
|
actionsDisabled
|