tods-competition-factory 2.0.53 → 2.0.55
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/index.mjs +5 -5
- package/dist/tods-competition-factory.d.ts +13 -4
- package/dist/tods-competition-factory.development.cjs.js +144 -89
- 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 +15 -15
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function factoryVersion() {
|
|
6
|
-
return '2.0.
|
|
6
|
+
return '2.0.55';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
function isFunction(obj) {
|
|
@@ -2098,7 +2098,7 @@ function getIsoDateString(schedule) {
|
|
|
2098
2098
|
scheduledDate = extractDate(schedule.scheduledTime);
|
|
2099
2099
|
if (!scheduledDate)
|
|
2100
2100
|
return;
|
|
2101
|
-
const extractedTime = extractTime(schedule.scheduledTime);
|
|
2101
|
+
const extractedTime = extractTime$1(schedule.scheduledTime);
|
|
2102
2102
|
let isoDateString = extractDate(scheduledDate);
|
|
2103
2103
|
if (isoDateString && extractedTime)
|
|
2104
2104
|
isoDateString += `T${extractedTime}`;
|
|
@@ -2224,8 +2224,8 @@ function isTimeString(timeString) {
|
|
|
2224
2224
|
const invalid = parts.length < 2 || !isNumeric || parseInt(parts[0]) > 23 || parseInt(parts[1]) > 60;
|
|
2225
2225
|
return !invalid;
|
|
2226
2226
|
}
|
|
2227
|
-
function timeStringMinutes(timeString) {
|
|
2228
|
-
const validTimeString = extractTime(timeString);
|
|
2227
|
+
function timeStringMinutes$1(timeString) {
|
|
2228
|
+
const validTimeString = extractTime$1(timeString);
|
|
2229
2229
|
if (!validTimeString)
|
|
2230
2230
|
return 0;
|
|
2231
2231
|
const [hours, minutes] = validTimeString.split(':').map((value) => parseInt(value));
|
|
@@ -2241,7 +2241,7 @@ function dayMinutesToTimeString(totalMinutes) {
|
|
|
2241
2241
|
function tidyTime(timeString) {
|
|
2242
2242
|
return isTimeString(timeString) ? timeString.split(':').slice(0, 2).map(zeroPad).join(':') : undefined;
|
|
2243
2243
|
}
|
|
2244
|
-
function extractTime(dateString) {
|
|
2244
|
+
function extractTime$1(dateString) {
|
|
2245
2245
|
return isISODateString(dateString) && dateString.indexOf('T') > 0
|
|
2246
2246
|
? tidyTime(dateString.split('T').reverse()[0])
|
|
2247
2247
|
: tidyTime(dateString);
|
|
@@ -2302,7 +2302,7 @@ function regularTime(value) {
|
|
|
2302
2302
|
}
|
|
2303
2303
|
function convertTime(value, time24, keepDate) {
|
|
2304
2304
|
const hasDate = extractDate(value);
|
|
2305
|
-
const timeString = extractTime(value);
|
|
2305
|
+
const timeString = extractTime$1(value);
|
|
2306
2306
|
const timeValue = hasDate ? timeString : value;
|
|
2307
2307
|
return !value
|
|
2308
2308
|
? undefined
|
|
@@ -2354,11 +2354,11 @@ function minutesDifference(date1, date2, absolute = true) {
|
|
|
2354
2354
|
return absolute ? Math.abs(Math.round(diff)) : Math.round(diff);
|
|
2355
2355
|
}
|
|
2356
2356
|
function addMinutesToTimeString(timeString, minutes) {
|
|
2357
|
-
const validTimeString = extractTime(timeString);
|
|
2357
|
+
const validTimeString = extractTime$1(timeString);
|
|
2358
2358
|
if (!validTimeString)
|
|
2359
2359
|
return '00:00';
|
|
2360
2360
|
const minutesToAdd = isNaN(minutes) ? 0 : minutes;
|
|
2361
|
-
return extractTime(addMinutes(timeToDate(validTimeString), minutesToAdd).toISOString());
|
|
2361
|
+
return extractTime$1(addMinutes(timeToDate(validTimeString), minutesToAdd).toISOString());
|
|
2362
2362
|
}
|
|
2363
2363
|
function addMinutes(startDate, minutes) {
|
|
2364
2364
|
const date = new Date(startDate);
|
|
@@ -2381,7 +2381,7 @@ const dateTime = {
|
|
|
2381
2381
|
getUTCdateString,
|
|
2382
2382
|
DateHHMM,
|
|
2383
2383
|
extractDate,
|
|
2384
|
-
extractTime,
|
|
2384
|
+
extractTime: extractTime$1,
|
|
2385
2385
|
formatDate,
|
|
2386
2386
|
getDateByWeek,
|
|
2387
2387
|
isISODateString,
|
|
@@ -2390,7 +2390,7 @@ const dateTime = {
|
|
|
2390
2390
|
offsetDate,
|
|
2391
2391
|
offsetTime,
|
|
2392
2392
|
sameDay,
|
|
2393
|
-
timeStringMinutes,
|
|
2393
|
+
timeStringMinutes: timeStringMinutes$1,
|
|
2394
2394
|
timeToDate,
|
|
2395
2395
|
timeUTC,
|
|
2396
2396
|
validTimeValue,
|
|
@@ -7268,12 +7268,12 @@ function getMatchUpScheduleDetails(params) {
|
|
|
7268
7268
|
}));
|
|
7269
7269
|
if (averageMinutes || recoveryMinutes) {
|
|
7270
7270
|
timeAfterRecovery = endTime
|
|
7271
|
-
? addMinutesToTimeString(extractTime(endTime), recoveryMinutes)
|
|
7271
|
+
? addMinutesToTimeString(extractTime$1(endTime), recoveryMinutes)
|
|
7272
7272
|
: addMinutesToTimeString(scheduledTime, averageMinutes + recoveryMinutes);
|
|
7273
7273
|
}
|
|
7274
7274
|
if (typeChangeRecoveryMinutes) {
|
|
7275
7275
|
typeChangeTimeAfterRecovery = endTime
|
|
7276
|
-
? addMinutesToTimeString(extractTime(endTime), typeChangeRecoveryMinutes)
|
|
7276
|
+
? addMinutesToTimeString(extractTime$1(endTime), typeChangeRecoveryMinutes)
|
|
7277
7277
|
: addMinutesToTimeString(scheduledTime, averageMinutes + typeChangeRecoveryMinutes);
|
|
7278
7278
|
}
|
|
7279
7279
|
}
|
|
@@ -9458,14 +9458,14 @@ function addUpcomingMatchUps({ drawDefinition, inContextDrawMatchUps }) {
|
|
|
9458
9458
|
const timeAfterRecovery = inContextMatchUp.schedule?.timeAfterRecovery;
|
|
9459
9459
|
if (timeAfterRecovery) {
|
|
9460
9460
|
if (winnerTo?.schedule?.scheduledTime) {
|
|
9461
|
-
const scheduleConflict = timeStringMinutes(winnerTo.schedule.scheduledTime) < timeStringMinutes(timeAfterRecovery);
|
|
9461
|
+
const scheduleConflict = timeStringMinutes$1(winnerTo.schedule.scheduledTime) < timeStringMinutes$1(timeAfterRecovery);
|
|
9462
9462
|
if (scheduleConflict) {
|
|
9463
9463
|
scheduleConflictMatchUpIds[winnerTo.matchUpId] = inContextMatchUp.matchUpId;
|
|
9464
9464
|
winnerTo.schedule.scheduleConflict = inContextMatchUp.matchUpId;
|
|
9465
9465
|
}
|
|
9466
9466
|
}
|
|
9467
9467
|
if (loserTo?.schedule?.scheduledTime) {
|
|
9468
|
-
const scheduleConflict = timeStringMinutes(loserTo.schedule.scheduledTime) < timeStringMinutes(timeAfterRecovery);
|
|
9468
|
+
const scheduleConflict = timeStringMinutes$1(loserTo.schedule.scheduledTime) < timeStringMinutes$1(timeAfterRecovery);
|
|
9469
9469
|
if (scheduleConflict) {
|
|
9470
9470
|
scheduleConflictMatchUpIds[loserTo.matchUpId] = inContextMatchUp.matchUpId;
|
|
9471
9471
|
loserTo.schedule.scheduleConflict = inContextMatchUp.matchUpId;
|
|
@@ -11517,7 +11517,7 @@ function addScheduleItem(params) {
|
|
|
11517
11517
|
participantMap[participantId].scheduleItems.push({
|
|
11518
11518
|
...schedule,
|
|
11519
11519
|
scheduledDate: extractDate(schedule?.scheduledDate),
|
|
11520
|
-
scheduledTime: extractTime(schedule?.scheduledTime),
|
|
11520
|
+
scheduledTime: extractTime$1(schedule?.scheduledTime),
|
|
11521
11521
|
checkScoreHasValue: checkScoreHasValue({ score }),
|
|
11522
11522
|
matchUpStatus,
|
|
11523
11523
|
roundPosition,
|
|
@@ -12314,7 +12314,7 @@ function getParticipantEntries(params) {
|
|
|
12314
12314
|
for (const scheduleItem of scheduleItems) {
|
|
12315
12315
|
const { typeChangeTimeAfterRecovery, timeAfterRecovery, scheduledDate, scheduledTime } = scheduleItem;
|
|
12316
12316
|
const scheduleItemsToConsider = dateItems[scheduledDate];
|
|
12317
|
-
const scheduledMinutes = timeStringMinutes(scheduledTime);
|
|
12317
|
+
const scheduledMinutes = timeStringMinutes$1(scheduledTime);
|
|
12318
12318
|
for (const consideredItem of scheduleItemsToConsider) {
|
|
12319
12319
|
const ignoreItem = consideredItem.matchUpId === scheduleItem.matchUpId ||
|
|
12320
12320
|
([WALKOVER$2, DEFAULTED].includes(consideredItem.matchUpStatus) && !consideredItem.checkScoreHasValue);
|
|
@@ -12324,12 +12324,12 @@ function getParticipantEntries(params) {
|
|
|
12324
12324
|
const notBeforeTime = typeChange ? typeChangeTimeAfterRecovery || timeAfterRecovery : timeAfterRecovery;
|
|
12325
12325
|
const sameDraw = scheduleItem.drawId === consideredItem.drawId;
|
|
12326
12326
|
const bothPotential = potentialMatchUps[scheduleItem.matchUpId] && potentialMatchUps[consideredItem.matchUpId];
|
|
12327
|
-
const consideredMinutes = timeStringMinutes(consideredItem.scheduledTime);
|
|
12327
|
+
const consideredMinutes = timeStringMinutes$1(consideredItem.scheduledTime);
|
|
12328
12328
|
const minutesDifference = Math.abs(consideredMinutes - scheduledMinutes);
|
|
12329
12329
|
const itemIsPrior = consideredMinutes >= scheduledMinutes;
|
|
12330
12330
|
const timeOverlap = scheduledMinutesDifference && !isNaN(scheduledMinutesDifference)
|
|
12331
12331
|
? minutesDifference <= scheduledMinutesDifference
|
|
12332
|
-
: itemIsPrior && timeStringMinutes(consideredItem.scheduledTime) < timeStringMinutes(notBeforeTime);
|
|
12332
|
+
: itemIsPrior && timeStringMinutes$1(consideredItem.scheduledTime) < timeStringMinutes$1(notBeforeTime);
|
|
12333
12333
|
if (timeOverlap && !(bothPotential && sameDraw) && itemIsPrior) {
|
|
12334
12334
|
const key = [scheduleItem.matchUpId, consideredItem.matchUpId].sort(stringSort).join('|');
|
|
12335
12335
|
participantAggregator.scheduleConflicts[key] = {
|
|
@@ -13200,9 +13200,10 @@ function addEventEntries(params) {
|
|
|
13200
13200
|
entries: event.entries || [],
|
|
13201
13201
|
});
|
|
13202
13202
|
}
|
|
13203
|
-
const addedEntriesCount = addedParticipantIdEntries.length
|
|
13203
|
+
const addedEntriesCount = addedParticipantIdEntries.length;
|
|
13204
|
+
const removedEntriesCount = removedEntries.length;
|
|
13204
13205
|
return decorateResult({
|
|
13205
|
-
result: { ...SUCCESS, addedEntriesCount },
|
|
13206
|
+
result: { ...SUCCESS, addedEntriesCount, removedEntriesCount },
|
|
13206
13207
|
stack,
|
|
13207
13208
|
info,
|
|
13208
13209
|
});
|
|
@@ -19852,8 +19853,8 @@ function calculatePressureRatings({ participantResults, sides, score }) {
|
|
|
19852
19853
|
const { convertedRating: side1ConvertedRating } = getConvertedRating({ ratings: side1ratings, targetRatingType });
|
|
19853
19854
|
const { convertedRating: side2ConvertedRating } = getConvertedRating({ ratings: side2ratings, targetRatingType });
|
|
19854
19855
|
const { side1pressure, side2pressure } = getSideValues$1({ side1ConvertedRating, side2ConvertedRating, score });
|
|
19855
|
-
participantResults[side1?.participantId].pressureScores.push(side1pressure);
|
|
19856
|
-
participantResults[side2?.participantId].pressureScores.push(side2pressure);
|
|
19856
|
+
side1pressure && participantResults[side1?.participantId].pressureScores.push(side1pressure);
|
|
19857
|
+
side2pressure && participantResults[side2?.participantId].pressureScores.push(side2pressure);
|
|
19857
19858
|
const highRange = Math.max(...ratingsParameters[ELO].range);
|
|
19858
19859
|
const side1Variation = fixedDecimals((side2ConvertedRating - side1ConvertedRating) / highRange);
|
|
19859
19860
|
const side2Variation = fixedDecimals((side1ConvertedRating - side2ConvertedRating) / highRange);
|
|
@@ -19873,11 +19874,11 @@ function getSideValues$1({ side1ConvertedRating, side2ConvertedRating, score })
|
|
|
19873
19874
|
const gamesWonSide1 = score?.sets?.reduce((total, set) => total + (set?.side1Score ?? 0), 0);
|
|
19874
19875
|
const gamesWonSide2 = score?.sets?.reduce((total, set) => total + (set.side2Score ?? 0), 0);
|
|
19875
19876
|
const lowSide = side1ConvertedRating > side2ConvertedRating ? 2 : 1;
|
|
19876
|
-
const side1value = gamesWonSide1 * (lowRating + (lowSide === 1 ? lowSideBump : 0));
|
|
19877
|
-
const side2value = gamesWonSide2 * (lowRating + (lowSide === 2 ? lowSideBump : 0));
|
|
19877
|
+
const side1value = (gamesWonSide1 || 0) * (lowRating + (lowSide === 1 ? lowSideBump : 0));
|
|
19878
|
+
const side2value = (gamesWonSide2 || 0) * (lowRating + (lowSide === 2 ? lowSideBump : 0));
|
|
19878
19879
|
const combinedValues = side1value + side2value;
|
|
19879
|
-
const side1pressure = fixedDecimals(side1value / combinedValues);
|
|
19880
|
-
const side2pressure = fixedDecimals(side2value / combinedValues);
|
|
19880
|
+
const side1pressure = combinedValues ? fixedDecimals(side1value / combinedValues) : 0;
|
|
19881
|
+
const side2pressure = combinedValues ? fixedDecimals(side2value / combinedValues) : 0;
|
|
19881
19882
|
return { side1pressure, side2pressure };
|
|
19882
19883
|
}
|
|
19883
19884
|
|
|
@@ -20738,6 +20739,8 @@ function tallyParticipantResults({ policyDefinitions, generateReport, pressureRa
|
|
|
20738
20739
|
tallyPolicy,
|
|
20739
20740
|
subOrderMap,
|
|
20740
20741
|
});
|
|
20742
|
+
if (pressureRating)
|
|
20743
|
+
addPressureOrder({ participantResults });
|
|
20741
20744
|
if (bracketComplete && groupOrder) {
|
|
20742
20745
|
report = groupOrderReport;
|
|
20743
20746
|
order = groupOrder;
|
|
@@ -20795,6 +20798,22 @@ function tallyParticipantResults({ policyDefinitions, generateReport, pressureRa
|
|
|
20795
20798
|
}
|
|
20796
20799
|
return result;
|
|
20797
20800
|
}
|
|
20801
|
+
function addPressureOrder({ participantResults }) {
|
|
20802
|
+
const sum = (values) => values.reduce((total, value) => total + parseFloat(value), 0);
|
|
20803
|
+
const avg = (values) => parseFloat((sum(values) / values.length).toFixed(2));
|
|
20804
|
+
const pressureOrder = Object.keys(participantResults)
|
|
20805
|
+
.map((participantId) => {
|
|
20806
|
+
const participantResult = participantResults[participantId];
|
|
20807
|
+
const { pressureScores } = participantResult;
|
|
20808
|
+
const averagePressure = pressureScores?.length ? avg(pressureScores) : 0;
|
|
20809
|
+
return { participantId, averagePressure };
|
|
20810
|
+
})
|
|
20811
|
+
.sort((a, b) => (b.averagePressure || 0) - (a.averagePressure || 0))
|
|
20812
|
+
.map((results, i) => ({ ...results, order: i + 1 }));
|
|
20813
|
+
for (const item of pressureOrder) {
|
|
20814
|
+
participantResults[item.participantId].pressureOrder = item.order;
|
|
20815
|
+
}
|
|
20816
|
+
}
|
|
20798
20817
|
|
|
20799
20818
|
function createSubOrderMap({ positionAssignments }) {
|
|
20800
20819
|
const subOrderArray = (positionAssignments || [])
|
|
@@ -34164,6 +34183,13 @@ function getDrawIsPublished({ publishStatus, drawId }) {
|
|
|
34164
34183
|
return true;
|
|
34165
34184
|
}
|
|
34166
34185
|
|
|
34186
|
+
const PUBLIC_DISPLAY = 'PUBLIC';
|
|
34187
|
+
const ADMIN_DISPLAY = 'ADMIN';
|
|
34188
|
+
const displayConstants = {
|
|
34189
|
+
PUBLIC_DISPLAY,
|
|
34190
|
+
ADMIN_DISPLAY,
|
|
34191
|
+
};
|
|
34192
|
+
|
|
34167
34193
|
function getDrawData(params) {
|
|
34168
34194
|
const { tournamentParticipants = [], includePositionAssignments, policyDefinitions, tournamentRecord, inContext = true, usePublishState, status = PUBLIC, pressureRating, refreshResults, drawDefinition, noDeepCopy, sortConfig, context, event, } = params;
|
|
34169
34195
|
if (!drawDefinition)
|
|
@@ -34271,7 +34297,8 @@ function getDrawData(params) {
|
|
|
34271
34297
|
stage,
|
|
34272
34298
|
}))(structure)
|
|
34273
34299
|
: {};
|
|
34274
|
-
|
|
34300
|
+
const displaySettings = findExtension({ element: structure, name: DISPLAY }).extension?.value;
|
|
34301
|
+
structureInfo.display = displaySettings?.[PUBLIC_DISPLAY] ?? displaySettings;
|
|
34275
34302
|
structureInfo.sourceStructureIds = sourceStructureIds[structureId];
|
|
34276
34303
|
structureInfo.hasDrawFeedProfile = hasDrawFeedProfile[structureId];
|
|
34277
34304
|
structureInfo.positionAssignments = positionAssignments;
|
|
@@ -35543,7 +35570,7 @@ function participantScheduledMatchUps({ scheduleAttributes = ['scheduledDate', '
|
|
|
35543
35570
|
.reduce((dateMatchUps, matchUp) => {
|
|
35544
35571
|
const { schedule } = matchUp;
|
|
35545
35572
|
const date = extractDate(schedule?.scheduledDate);
|
|
35546
|
-
const time = extractTime(schedule?.scheduledTime);
|
|
35573
|
+
const time = extractTime$1(schedule?.scheduledTime);
|
|
35547
35574
|
if (date && time) {
|
|
35548
35575
|
if (dateMatchUps[date]) {
|
|
35549
35576
|
dateMatchUps[date].push(matchUp);
|
|
@@ -35556,7 +35583,7 @@ function participantScheduledMatchUps({ scheduleAttributes = ['scheduledDate', '
|
|
|
35556
35583
|
}, {});
|
|
35557
35584
|
const dates = Object.keys(scheduledMatchUps);
|
|
35558
35585
|
dates.forEach((date) => {
|
|
35559
|
-
scheduledMatchUps[date].sort((a, b) => timeSort(extractTime(a.schedule?.scheduledTime), extractTime(b.schedule?.scheduledTime)));
|
|
35586
|
+
scheduledMatchUps[date].sort((a, b) => timeSort(extractTime$1(a.schedule?.scheduledTime), extractTime$1(b.schedule?.scheduledTime)));
|
|
35560
35587
|
});
|
|
35561
35588
|
return { ...SUCCESS, scheduledMatchUps };
|
|
35562
35589
|
}
|
|
@@ -35612,7 +35639,7 @@ function scheduledSortedMatchUps({ schedulingProfile, matchUps = [] }) {
|
|
|
35612
35639
|
const timeGroups = { noScheduledTime: [] };
|
|
35613
35640
|
for (const matchUp of dateGroup) {
|
|
35614
35641
|
const schedule = matchUp.schedule || {};
|
|
35615
|
-
const scheduledTime = (schedule.scheduledTime && extractTime(schedule.scheduledTime)) || 'noScheduledTime';
|
|
35642
|
+
const scheduledTime = (schedule.scheduledTime && extractTime$1(schedule.scheduledTime)) || 'noScheduledTime';
|
|
35616
35643
|
if (!timeGroups[scheduledTime])
|
|
35617
35644
|
timeGroups[scheduledTime] = [];
|
|
35618
35645
|
timeGroups[scheduledTime].push(matchUp);
|
|
@@ -37965,11 +37992,11 @@ function addParticipants({ allowDuplicateParticipantIdPairs, returnParticipants,
|
|
|
37965
37992
|
}
|
|
37966
37993
|
}
|
|
37967
37994
|
|
|
37968
|
-
function addEventEntryPairs(
|
|
37969
|
-
|
|
37970
|
-
|
|
37971
|
-
|
|
37972
|
-
|
|
37995
|
+
function addEventEntryPairs(params) {
|
|
37996
|
+
const paramsCheck = checkRequiredParameters(params, [{ [TOURNAMENT_RECORD]: true, [EVENT]: true }]);
|
|
37997
|
+
if (paramsCheck.error)
|
|
37998
|
+
return paramsCheck;
|
|
37999
|
+
const { allowDuplicateParticipantIdPairs, entryStatus = ALTERNATE, participantIdPairs = [], entryStage = MAIN, tournamentRecord, drawDefinition, event, uuids, } = params;
|
|
37973
38000
|
if (event.eventType !== DOUBLES)
|
|
37974
38001
|
return { error: INVALID_EVENT_TYPE };
|
|
37975
38002
|
const existingParticipantIdPairs = [];
|
|
@@ -37986,10 +38013,10 @@ function addEventEntryPairs({ allowDuplicateParticipantIdPairs, entryStage = MAI
|
|
|
37986
38013
|
const invalidParticipantIdPairs = participantIdPairs.filter((pair) => {
|
|
37987
38014
|
if (pair.length !== 2)
|
|
37988
38015
|
return true;
|
|
37989
|
-
if (!genderMap.has(pair[0]) || !genderMap.has(pair[1]))
|
|
37990
|
-
return true;
|
|
37991
38016
|
if (!event.gender || event.gender === ANY)
|
|
37992
38017
|
return false;
|
|
38018
|
+
if (!genderMap.has(pair[0]) || !genderMap.has(pair[1]))
|
|
38019
|
+
return true;
|
|
37993
38020
|
const participantGenders = pair.map((id) => genderMap.get(id));
|
|
37994
38021
|
let invalidParticiapntGenders = (event.gender === MALE && (participantGenders[0] !== MALE || participantGenders[1] !== MALE)) ||
|
|
37995
38022
|
(event.gender === FEMALE && (participantGenders[0] !== FEMALE || participantGenders[1] !== FEMALE));
|
|
@@ -40010,7 +40037,7 @@ function generateTimeSlots(params) {
|
|
|
40010
40037
|
.sort((a, b) => tidyTime(a.startTime).localeCompare(tidyTime(b.startTime)))
|
|
40011
40038
|
.forEach((booking) => {
|
|
40012
40039
|
const timeSlot = {
|
|
40013
|
-
startTime: extractTime(startTime.toISOString()),
|
|
40040
|
+
startTime: extractTime$1(startTime.toISOString()),
|
|
40014
40041
|
endTime: booking.startTime,
|
|
40015
40042
|
};
|
|
40016
40043
|
if (timeToDate(booking.startTime) > startTime) {
|
|
@@ -40021,7 +40048,7 @@ function generateTimeSlots(params) {
|
|
|
40021
40048
|
}
|
|
40022
40049
|
});
|
|
40023
40050
|
const timeSlot = {
|
|
40024
|
-
startTime: extractTime(startTime.toISOString()),
|
|
40051
|
+
startTime: extractTime$1(startTime.toISOString()),
|
|
40025
40052
|
endTime: courtDate.endTime,
|
|
40026
40053
|
};
|
|
40027
40054
|
if (timeToDate(courtDate.endTime) > startTime) {
|
|
@@ -40139,7 +40166,7 @@ function generateVirtualCourts(params) {
|
|
|
40139
40166
|
},
|
|
40140
40167
|
};
|
|
40141
40168
|
});
|
|
40142
|
-
unassignedBookings.sort((a, b) => timeStringMinutes(a.startTime) - timeStringMinutes(b.startTime));
|
|
40169
|
+
unassignedBookings.sort((a, b) => timeStringMinutes$1(a.startTime) - timeStringMinutes$1(b.startTime));
|
|
40143
40170
|
const getCourtTimeSlots = () => inProcessCourts
|
|
40144
40171
|
.map((court) => {
|
|
40145
40172
|
const courtDate = court.dateAvailability;
|
|
@@ -40154,15 +40181,15 @@ function generateVirtualCourts(params) {
|
|
|
40154
40181
|
const assignedBookings = [];
|
|
40155
40182
|
for (const unassignedBooking of unassignedBookings) {
|
|
40156
40183
|
const { startTime, endTime, averageMinutes, recoveryMinutes, matchUpId } = unassignedBooking;
|
|
40157
|
-
const startMinutes = timeStringMinutes(startTime);
|
|
40158
|
-
const endMinutes = timeStringMinutes(endTime);
|
|
40184
|
+
const startMinutes = timeStringMinutes$1(startTime);
|
|
40185
|
+
const endMinutes = timeStringMinutes$1(endTime);
|
|
40159
40186
|
const courtTimeSlots = getCourtTimeSlots();
|
|
40160
40187
|
const bestCourt = courtTimeSlots.reduce((best, { courtId, courtName, timeSlots }) => {
|
|
40161
40188
|
let startDifference;
|
|
40162
40189
|
const timeSlot = timeSlots.find(({ startTime, endTime }) => {
|
|
40163
|
-
startDifference = timeStringMinutes(startTime) - startMinutes;
|
|
40164
|
-
const startFits = startMinutes >= timeStringMinutes(startTime);
|
|
40165
|
-
const endFits = endMinutes <= timeStringMinutes(endTime);
|
|
40190
|
+
startDifference = timeStringMinutes$1(startTime) - startMinutes;
|
|
40191
|
+
const startFits = startMinutes >= timeStringMinutes$1(startTime);
|
|
40192
|
+
const endFits = endMinutes <= timeStringMinutes$1(endTime);
|
|
40166
40193
|
return (endFits &&
|
|
40167
40194
|
best.startDifference !== 0 &&
|
|
40168
40195
|
(((startDifference === 0 || startDifference + periodLength >= 0) &&
|
|
@@ -40217,8 +40244,8 @@ function getDateTimeBoundary({ scheduleDate, startTime, endTime, courts }) {
|
|
|
40217
40244
|
const comparisonTime = accessor && (dateAvailability?.[accessor] || court[accessor]);
|
|
40218
40245
|
return comparisonTime &&
|
|
40219
40246
|
(!boundaryTime ||
|
|
40220
|
-
(startTime && timeStringMinutes(comparisonTime) < timeStringMinutes(boundaryTime)) ||
|
|
40221
|
-
(endTime && timeStringMinutes(comparisonTime) > timeStringMinutes(boundaryTime)))
|
|
40247
|
+
(startTime && timeStringMinutes$1(comparisonTime) < timeStringMinutes$1(boundaryTime)) ||
|
|
40248
|
+
(endTime && timeStringMinutes$1(comparisonTime) > timeStringMinutes$1(boundaryTime)))
|
|
40222
40249
|
? comparisonTime
|
|
40223
40250
|
: boundaryTime;
|
|
40224
40251
|
}, undefined);
|
|
@@ -40246,7 +40273,7 @@ function getFirstTimeSlotStartTime({ averageMinutes, startTime, endTime, courts,
|
|
|
40246
40273
|
const timeSlotMinutes = minutesDifference(timeSlotStartTime, timeSlotEndTime);
|
|
40247
40274
|
const available = timeSlotMinutes >= averageMinutes;
|
|
40248
40275
|
if (available) {
|
|
40249
|
-
const timeString = extractTime(timeSlotStartTime.toISOString());
|
|
40276
|
+
const timeString = extractTime$1(timeSlotStartTime.toISOString());
|
|
40250
40277
|
if (!firstTimeSlotStartTime || timeString < firstTimeSlotStartTime) {
|
|
40251
40278
|
firstTimeSlotStartTime = timeString;
|
|
40252
40279
|
}
|
|
@@ -40266,8 +40293,8 @@ function getScheduleTimes(params) {
|
|
|
40266
40293
|
const { calculateStartTimeFromCourts = true, remainingScheduleTimes, averageMatchUpMinutes, clearScheduleDates, courtsCount, bookings, } = params;
|
|
40267
40294
|
periodLength = periodLength || calculatePeriodLength({ averageMatchUpMinutes });
|
|
40268
40295
|
date = extractDate(date);
|
|
40269
|
-
startTime = extractTime(startTime);
|
|
40270
|
-
endTime = extractTime(endTime);
|
|
40296
|
+
startTime = extractTime$1(startTime);
|
|
40297
|
+
endTime = extractTime$1(endTime);
|
|
40271
40298
|
let previousCalculation = 0;
|
|
40272
40299
|
let previousAvailableCourts = 0;
|
|
40273
40300
|
let cumulativeMatches = 0;
|
|
@@ -40294,8 +40321,8 @@ function getScheduleTimes(params) {
|
|
|
40294
40321
|
if (calculateStartTimeFromCourts && firstTimeSlotStartTime) {
|
|
40295
40322
|
startTime = firstTimeSlotStartTime ? firstTimeSlotStartTime : startTime;
|
|
40296
40323
|
}
|
|
40297
|
-
const dayStartMinutes = timeStringMinutes(startTime);
|
|
40298
|
-
const dayEndMinutes = timeStringMinutes(endTime);
|
|
40324
|
+
const dayStartMinutes = timeStringMinutes$1(startTime);
|
|
40325
|
+
const dayEndMinutes = timeStringMinutes$1(endTime);
|
|
40299
40326
|
const dayMinutes = dayEndMinutes - dayStartMinutes;
|
|
40300
40327
|
const periodCount = Math.floor(dayMinutes / periodLength);
|
|
40301
40328
|
const periods = generateRange(0, periodCount + 1);
|
|
@@ -43126,7 +43153,7 @@ function assignMatchUpCourt({ removePriorValues, tournamentRecords, tournamentRe
|
|
|
43126
43153
|
}
|
|
43127
43154
|
|
|
43128
43155
|
function timeDate(value, scheduledDate) {
|
|
43129
|
-
const time = validTimeString.test(value) ? value : extractTime(value);
|
|
43156
|
+
const time = validTimeString.test(value) ? value : extractTime$1(value);
|
|
43130
43157
|
const date = extractDate(value) || extractDate(scheduledDate) || formatDate(new Date());
|
|
43131
43158
|
return new Date(`${date}T${time}`).getTime();
|
|
43132
43159
|
}
|
|
@@ -45136,13 +45163,13 @@ function addParticipantPotentialRecovery({ individualParticipantProfiles, recove
|
|
|
45136
45163
|
}
|
|
45137
45164
|
|
|
45138
45165
|
function updateTimeAfterRecovery({ matchUpPotentialParticipantIds, individualParticipantProfiles, typeChangeRecoveryMinutes, averageMatchUpMinutes = 0, matchUpNotBeforeTimes, matchUpDependencies, recoveryMinutes = 0, scheduleTime, matchUp, }) {
|
|
45139
|
-
const endTime = extractTime(matchUp?.schedule?.endTime);
|
|
45166
|
+
const endTime = extractTime$1(matchUp?.schedule?.endTime);
|
|
45140
45167
|
const timeAfterRecovery = endTime
|
|
45141
45168
|
? addMinutesToTimeString(endTime, ensureInt(recoveryMinutes))
|
|
45142
45169
|
: addMinutesToTimeString(scheduleTime, ensureInt(averageMatchUpMinutes) + ensureInt(recoveryMinutes));
|
|
45143
45170
|
const typeChangeTimeAfterRecovery = typeChangeRecoveryMinutes &&
|
|
45144
45171
|
(endTime
|
|
45145
|
-
? addMinutesToTimeString(extractTime(endTime), typeChangeRecoveryMinutes)
|
|
45172
|
+
? addMinutesToTimeString(extractTime$1(endTime), typeChangeRecoveryMinutes)
|
|
45146
45173
|
: addMinutesToTimeString(scheduleTime, ensureInt(averageMatchUpMinutes) + ensureInt(typeChangeRecoveryMinutes)));
|
|
45147
45174
|
const participantIdDependencies = matchUpDependencies?.[matchUp.matchUpId]?.participantIds || [];
|
|
45148
45175
|
const potentialIndividualParticipantIds = ((matchUp.roundPosition && matchUpPotentialParticipantIds[matchUp.matchUpId]) ||
|
|
@@ -45197,12 +45224,12 @@ function checkDependendantTiming({ matchUpScheduleTimes, matchUpDependencies, sc
|
|
|
45197
45224
|
};
|
|
45198
45225
|
if (candidateScheduleTime && !dependent.matchUpId)
|
|
45199
45226
|
return candidateDependent;
|
|
45200
|
-
return timeStringMinutes(candidateScheduleTime) < timeStringMinutes(dependent.scheduleTime)
|
|
45227
|
+
return timeStringMinutes$1(candidateScheduleTime) < timeStringMinutes$1(dependent.scheduleTime)
|
|
45201
45228
|
? candidateDependent
|
|
45202
45229
|
: dependent;
|
|
45203
45230
|
}, {});
|
|
45204
45231
|
if (earliestDependent.scheduleTime &&
|
|
45205
|
-
timeStringMinutes(dependentNotBeforeTime) > timeStringMinutes(earliestDependent.scheduleTime)) {
|
|
45232
|
+
timeStringMinutes$1(dependentNotBeforeTime) > timeStringMinutes$1(earliestDependent.scheduleTime)) {
|
|
45206
45233
|
scheduledDependent = earliestDependent;
|
|
45207
45234
|
}
|
|
45208
45235
|
}
|
|
@@ -45238,8 +45265,8 @@ function checkRequestConflicts({ averageMatchUpMinutes = 90, requestConflicts =
|
|
|
45238
45265
|
.filter((request) => request.requestType === DO_NOT_SCHEDULE && sameDay(scheduleDate, request.date));
|
|
45239
45266
|
const conflicts = [];
|
|
45240
45267
|
const matchUpId = matchUp?.matchUpId;
|
|
45241
|
-
const scheduleStart = timeToDate(extractTime(scheduleTime), extractDate(scheduleDate));
|
|
45242
|
-
const averageEnd = extractTime(addMinutes(scheduleStart, averageMatchUpMinutes).toISOString());
|
|
45268
|
+
const scheduleStart = timeToDate(extractTime$1(scheduleTime), extractDate(scheduleDate));
|
|
45269
|
+
const averageEnd = extractTime$1(addMinutes(scheduleStart, averageMatchUpMinutes).toISOString());
|
|
45243
45270
|
for (const request of relevantPersonRequests) {
|
|
45244
45271
|
const { requestId, startTime, endTime } = request;
|
|
45245
45272
|
const conflict = (scheduleTime > startTime && scheduleTime < endTime) || (averageEnd > startTime && averageEnd < endTime);
|
|
@@ -45432,7 +45459,7 @@ function generateBookings({ defaultRecoveryMinutes = 0, averageMatchUpMinutes =
|
|
|
45432
45459
|
eventType,
|
|
45433
45460
|
});
|
|
45434
45461
|
const { courtId, venueId } = schedule;
|
|
45435
|
-
const startTime = extractTime(schedule.scheduledTime);
|
|
45462
|
+
const startTime = extractTime$1(schedule.scheduledTime);
|
|
45436
45463
|
const endTime = addMinutesToTimeString(startTime, averageMinutes);
|
|
45437
45464
|
return {
|
|
45438
45465
|
recoveryMinutes,
|
|
@@ -45627,10 +45654,10 @@ function getVenueSchedulingDetails({ matchUpPotentialParticipantIds, individualP
|
|
|
45627
45654
|
}
|
|
45628
45655
|
|
|
45629
45656
|
function analyzeScheduleOverlap(a, b) {
|
|
45630
|
-
const startA = timeStringMinutes(a.scheduleTime);
|
|
45631
|
-
const endA = timeStringMinutes(a.timeAfterRecovery);
|
|
45632
|
-
const startB = timeStringMinutes(b.scheduleTime);
|
|
45633
|
-
const endB = timeStringMinutes(b.timeAfterRecovery);
|
|
45657
|
+
const startA = timeStringMinutes$1(a.scheduleTime);
|
|
45658
|
+
const endA = timeStringMinutes$1(a.timeAfterRecovery);
|
|
45659
|
+
const startB = timeStringMinutes$1(b.scheduleTime);
|
|
45660
|
+
const endB = timeStringMinutes$1(b.timeAfterRecovery);
|
|
45634
45661
|
const startOrEndEquivalence = startA === startB || endA === endB;
|
|
45635
45662
|
const startAisContained = startA > startB && startA < endB;
|
|
45636
45663
|
const startBisContained = startB > startA && startB < endA;
|
|
@@ -45658,7 +45685,7 @@ function checkRecoveryTime({ individualParticipantProfiles, matchUpNotBeforeTime
|
|
|
45658
45685
|
const profile = individualParticipantProfiles[participantId];
|
|
45659
45686
|
if (!profile.timeAfterRecovery)
|
|
45660
45687
|
return true;
|
|
45661
|
-
const endTime = extractTime(matchUp?.schedule?.endTime);
|
|
45688
|
+
const endTime = extractTime$1(matchUp?.schedule?.endTime);
|
|
45662
45689
|
const timeAfterRecovery = endTime
|
|
45663
45690
|
? addMinutesToTimeString(endTime, ensureInt(recoveryMinutes))
|
|
45664
45691
|
: addMinutesToTimeString(scheduleTime, ensureInt(averageMatchUpMinutes) + ensureInt(recoveryMinutes));
|
|
@@ -46091,7 +46118,7 @@ function jinnScheduler({ schedulingProfileModifications, checkPotentialRequestCo
|
|
|
46091
46118
|
}
|
|
46092
46119
|
});
|
|
46093
46120
|
noTimeMatchUpIds[scheduleDate] = venueScheduledRoundDetails[venueId].matchUpsToSchedule.map(getMatchUpId);
|
|
46094
|
-
scheduleTimesRemaining[scheduleDate][venueId] = venueScheduledRoundDetails[venueId].scheduleTimes.sort((a, b) => timeStringMinutes(a.scheduleTime) - timeStringMinutes(b.scheduleTime));
|
|
46121
|
+
scheduleTimesRemaining[scheduleDate][venueId] = venueScheduledRoundDetails[venueId].scheduleTimes.sort((a, b) => timeStringMinutes$1(a.scheduleTime) - timeStringMinutes$1(b.scheduleTime));
|
|
46095
46122
|
}
|
|
46096
46123
|
if (!dryRun && allDateScheduledByeMatchUpDetails?.length) {
|
|
46097
46124
|
bulkScheduleMatchUps({
|
|
@@ -46181,7 +46208,7 @@ function getEarliestCourtTime({ averageMinutes, startTime, endTime, court, date
|
|
|
46181
46208
|
const timeSlotMinutes = minutesDifference(consideredStartTime, timeSlotEndTime);
|
|
46182
46209
|
const available = timeSlotMinutes >= averageMinutes;
|
|
46183
46210
|
if (available) {
|
|
46184
|
-
const timeString = extractTime(consideredStartTime.toISOString());
|
|
46211
|
+
const timeString = extractTime$1(consideredStartTime.toISOString());
|
|
46185
46212
|
if (!first || timeString < first)
|
|
46186
46213
|
first = timeString;
|
|
46187
46214
|
}
|
|
@@ -46334,7 +46361,7 @@ function v2Scheduler({ schedulingProfileModifications, checkPotentialRequestConf
|
|
|
46334
46361
|
court,
|
|
46335
46362
|
});
|
|
46336
46363
|
if (courtTime.scheduleTime &&
|
|
46337
|
-
timeStringMinutes(scheduleTime) >= timeStringMinutes(courtTime.scheduleTime)) {
|
|
46364
|
+
timeStringMinutes$1(scheduleTime) >= timeStringMinutes$1(courtTime.scheduleTime)) {
|
|
46338
46365
|
return courtTime;
|
|
46339
46366
|
}
|
|
46340
46367
|
const { scheduledDependent } = checkDependendantTiming({
|
|
@@ -46389,7 +46416,7 @@ function v2Scheduler({ schedulingProfileModifications, checkPotentialRequestConf
|
|
|
46389
46416
|
matchUp,
|
|
46390
46417
|
});
|
|
46391
46418
|
if (!courtTime.scheduleTime ||
|
|
46392
|
-
timeStringMinutes(scheduleTime) < timeStringMinutes(courtTime.scheduleTime)) {
|
|
46419
|
+
timeStringMinutes$1(scheduleTime) < timeStringMinutes$1(courtTime.scheduleTime)) {
|
|
46393
46420
|
courtTime.averageMatchUpMinutes = averageMatchUpMinutes;
|
|
46394
46421
|
courtTime.recoveryMinutes = recoveryMinutes;
|
|
46395
46422
|
courtTime.scheduleTime = scheduleTime;
|
|
@@ -49586,11 +49613,11 @@ function addCourt({ tournamentRecord, disableNotice, venueId, courtId, court })
|
|
|
49586
49613
|
const dateAvailability = (court?.dateAvailability || []).map((availabilty) => ({
|
|
49587
49614
|
...availabilty,
|
|
49588
49615
|
date: extractDate(availabilty.date),
|
|
49589
|
-
startTime: extractTime(availabilty.startTime),
|
|
49590
|
-
endTime: extractTime(availabilty.endTime),
|
|
49616
|
+
startTime: extractTime$1(availabilty.startTime),
|
|
49617
|
+
endTime: extractTime$1(availabilty.endTime),
|
|
49591
49618
|
bookings: availabilty.bookings?.map(({ startTime, endTime, bookingType }) => ({
|
|
49592
|
-
startTime: extractTime(startTime),
|
|
49593
|
-
endTime: extractTime(endTime),
|
|
49619
|
+
startTime: extractTime$1(startTime),
|
|
49620
|
+
endTime: extractTime$1(endTime),
|
|
49594
49621
|
bookingType,
|
|
49595
49622
|
})),
|
|
49596
49623
|
}));
|
|
@@ -50526,8 +50553,8 @@ function mergePersonRequests({ personRequests, personId, requests }) {
|
|
|
50526
50553
|
let { date, startTime, endTime } = request;
|
|
50527
50554
|
if (request.requestType === DO_NOT_SCHEDULE) {
|
|
50528
50555
|
date = extractDate(date);
|
|
50529
|
-
startTime = extractTime(startTime);
|
|
50530
|
-
endTime = extractTime(endTime);
|
|
50556
|
+
startTime = extractTime$1(startTime);
|
|
50557
|
+
endTime = extractTime$1(endTime);
|
|
50531
50558
|
if (date && startTime && endTime) {
|
|
50532
50559
|
return { date, startTime, endTime, requestType: request.requestType };
|
|
50533
50560
|
}
|
|
@@ -52510,7 +52537,7 @@ function getVenueReport(dates, venue, matchUps) {
|
|
|
52510
52537
|
const timeSlots = courtDate && generateTimeSlots({ courtDate }).timeSlots;
|
|
52511
52538
|
const courtAvailableMinutes = timeSlots?.reduce((minutes, timeSlot) => {
|
|
52512
52539
|
const { startTime, endTime } = timeSlot;
|
|
52513
|
-
const timeSlotMinutes = timeStringMinutes(endTime) - timeStringMinutes(startTime);
|
|
52540
|
+
const timeSlotMinutes = timeStringMinutes$1(endTime) - timeStringMinutes$1(startTime);
|
|
52514
52541
|
return minutes + timeSlotMinutes;
|
|
52515
52542
|
}, 0);
|
|
52516
52543
|
if (courtAvailableMinutes)
|
|
@@ -52519,9 +52546,9 @@ function getVenueReport(dates, venue, matchUps) {
|
|
|
52519
52546
|
}
|
|
52520
52547
|
const venueMatchUps = matchUps.filter(({ schedule }) => schedule.venueId === venueId && sameDay(date, schedule.scheduledDate));
|
|
52521
52548
|
venueMatchUps.forEach(({ schedule }) => {
|
|
52522
|
-
const startTime = extractTime(schedule.scheduledTime);
|
|
52549
|
+
const startTime = extractTime$1(schedule.scheduledTime);
|
|
52523
52550
|
const endTime = addMinutesToTimeString(startTime, schedule.averageMinutes);
|
|
52524
|
-
const matchUpScheduledMinutes = timeStringMinutes(endTime) - timeStringMinutes(startTime);
|
|
52551
|
+
const matchUpScheduledMinutes = timeStringMinutes$1(endTime) - timeStringMinutes$1(startTime);
|
|
52525
52552
|
scheduledMinutes += matchUpScheduledMinutes;
|
|
52526
52553
|
});
|
|
52527
52554
|
const percentUtilization = availableMinutes ? ((scheduledMinutes / availableMinutes) * 100).toFixed(2) : '100';
|
|
@@ -52568,7 +52595,7 @@ function calculateScheduleTimes({ calculateStartTimeFromCourts = true, defaultRe
|
|
|
52568
52595
|
const dateAvailability = court.dateAvailability?.find((availability) => !availability.date || sameDay(scheduleDate, availability.date));
|
|
52569
52596
|
const comparisonStartTime = dateAvailability?.startTime ?? court.startTime;
|
|
52570
52597
|
return comparisonStartTime &&
|
|
52571
|
-
(!minStartTime || timeStringMinutes(comparisonStartTime) < timeStringMinutes(minStartTime))
|
|
52598
|
+
(!minStartTime || timeStringMinutes$1(comparisonStartTime) < timeStringMinutes$1(minStartTime))
|
|
52572
52599
|
? comparisonStartTime
|
|
52573
52600
|
: minStartTime;
|
|
52574
52601
|
}, undefined);
|
|
@@ -52577,7 +52604,7 @@ function calculateScheduleTimes({ calculateStartTimeFromCourts = true, defaultRe
|
|
|
52577
52604
|
endTime = courts?.reduce((maxEndTime, court) => {
|
|
52578
52605
|
const dateAvailability = court.dateAvailability?.find((availability) => !availability.date || sameDay(scheduleDate, availability.date));
|
|
52579
52606
|
const comparisonEndTime = dateAvailability?.endTime ?? court.endTime;
|
|
52580
|
-
return comparisonEndTime && (!maxEndTime || timeStringMinutes(comparisonEndTime) > timeStringMinutes(maxEndTime))
|
|
52607
|
+
return comparisonEndTime && (!maxEndTime || timeStringMinutes$1(comparisonEndTime) > timeStringMinutes$1(maxEndTime))
|
|
52581
52608
|
? comparisonEndTime
|
|
52582
52609
|
: maxEndTime;
|
|
52583
52610
|
}, undefined);
|
|
@@ -52622,7 +52649,7 @@ function calculateScheduleTimes({ calculateStartTimeFromCourts = true, defaultRe
|
|
|
52622
52649
|
timingDetails,
|
|
52623
52650
|
});
|
|
52624
52651
|
const { courtId, venueId } = schedule;
|
|
52625
|
-
const startTime = extractTime(schedule.scheduledTime);
|
|
52652
|
+
const startTime = extractTime$1(schedule.scheduledTime);
|
|
52626
52653
|
const endTime = addMinutesToTimeString(startTime, averageMinutes);
|
|
52627
52654
|
return {
|
|
52628
52655
|
recoveryMinutes,
|
|
@@ -52910,8 +52937,8 @@ function scheduleMatchUps(params) {
|
|
|
52910
52937
|
const { venueId, scheduleTimes, dateScheduledMatchUpIds } = calculateScheduleTimes({
|
|
52911
52938
|
tournamentRecords,
|
|
52912
52939
|
remainingScheduleTimes,
|
|
52913
|
-
startTime: extractTime(startTime),
|
|
52914
|
-
endTime: extractTime(endTime),
|
|
52940
|
+
startTime: extractTime$1(startTime),
|
|
52941
|
+
endTime: extractTime$1(endTime),
|
|
52915
52942
|
scheduleDate: extractDate(scheduleDate),
|
|
52916
52943
|
averageMatchUpMinutes,
|
|
52917
52944
|
clearScheduleDates,
|
|
@@ -53429,7 +53456,7 @@ function bulkReschedule({ tournamentRecord, scheduleChange, matchUpIds, dryRun }
|
|
|
53429
53456
|
}
|
|
53430
53457
|
if (minutesChange && scheduledTime) {
|
|
53431
53458
|
const scheduledTimeDate = extractDate(scheduledTime);
|
|
53432
|
-
const currentDayMinutes = timeStringMinutes(extractTime(scheduledTime));
|
|
53459
|
+
const currentDayMinutes = timeStringMinutes$1(extractTime$1(scheduledTime));
|
|
53433
53460
|
const newTime = currentDayMinutes + minutesChange;
|
|
53434
53461
|
doNotReschedule = newTime < 0 || newTime > dayTotalMinutes;
|
|
53435
53462
|
if (!doNotReschedule) {
|
|
@@ -55629,11 +55656,11 @@ function updateCourtAvailability({ tournamentRecord }) {
|
|
|
55629
55656
|
}
|
|
55630
55657
|
for (const court of courts) {
|
|
55631
55658
|
const { startTime, endTime } = (court.dateAvailability ?? []).reduce((extents, availability) => {
|
|
55632
|
-
const startMinutes = timeStringMinutes(extents.startTime);
|
|
55633
|
-
const endMinutes = timeStringMinutes(extents.endTime);
|
|
55634
|
-
if (availability.startTime && timeStringMinutes(availability.startTime) < startMinutes)
|
|
55659
|
+
const startMinutes = timeStringMinutes$1(extents.startTime);
|
|
55660
|
+
const endMinutes = timeStringMinutes$1(extents.endTime);
|
|
55661
|
+
if (availability.startTime && timeStringMinutes$1(availability.startTime) < startMinutes)
|
|
55635
55662
|
extents.startTime = availability.startTime;
|
|
55636
|
-
if (availability.endTime && timeStringMinutes(availability.endTime) > endMinutes)
|
|
55663
|
+
if (availability.endTime && timeStringMinutes$1(availability.endTime) > endMinutes)
|
|
55637
55664
|
extents.endTime = availability.endTime;
|
|
55638
55665
|
return extents;
|
|
55639
55666
|
}, { startTime: '08:00', endTime: '18:00' });
|
|
@@ -56575,7 +56602,7 @@ function visualizeScheduledMatchUps({ scheduledMatchUps, showGlobalLog }) {
|
|
|
56575
56602
|
},
|
|
56576
56603
|
}, true);
|
|
56577
56604
|
roundMatchUps[roundNumber].forEach(({ matchUpId, schedule }) => {
|
|
56578
|
-
const scheduledTime = extractTime(schedule.scheduledTime);
|
|
56605
|
+
const scheduledTime = extractTime$1(schedule.scheduledTime);
|
|
56579
56606
|
pushGlobalLog({
|
|
56580
56607
|
matchUpId,
|
|
56581
56608
|
time: scheduledTime,
|
|
@@ -56595,6 +56622,31 @@ function visualizeScheduledMatchUps({ scheduledMatchUps, showGlobalLog }) {
|
|
|
56595
56622
|
printGlobalLog();
|
|
56596
56623
|
}
|
|
56597
56624
|
|
|
56625
|
+
const { extractTime, timeStringMinutes } = dateTime;
|
|
56626
|
+
function matchUpScheduleSort(a, b) {
|
|
56627
|
+
const scheduleA = a.schedule ?? {};
|
|
56628
|
+
const scheduleB = b.schedule ?? {};
|
|
56629
|
+
if (scheduleA.scheduledDate && !scheduleB.scheduledDate)
|
|
56630
|
+
return 1;
|
|
56631
|
+
if (scheduleB.scheduledDate && !scheduleA.scheduledDate)
|
|
56632
|
+
return -1;
|
|
56633
|
+
if (scheduleA.scheduledDate && scheduleB.scheduledDate) {
|
|
56634
|
+
if (scheduleA.scheduledDate === scheduleB.scheduledDate) {
|
|
56635
|
+
if (scheduleA.scheduledTime && !scheduleB.scheduledTime)
|
|
56636
|
+
return 1;
|
|
56637
|
+
if (scheduleB.scheduledTime && !scheduleA.scheduledTime)
|
|
56638
|
+
return -1;
|
|
56639
|
+
if (scheduleA.scheduledTime && scheduleB.scheduledTime) {
|
|
56640
|
+
const timeA = timeStringMinutes(extractTime(scheduleA.scheduledTime));
|
|
56641
|
+
const timeB = timeStringMinutes(extractTime(scheduleB.scheduledTime));
|
|
56642
|
+
return timeA - timeB;
|
|
56643
|
+
}
|
|
56644
|
+
}
|
|
56645
|
+
return new Date(scheduleA.scheduledDate).getTime() - new Date(scheduleB.scheduledDate).getTime();
|
|
56646
|
+
}
|
|
56647
|
+
return 0;
|
|
56648
|
+
}
|
|
56649
|
+
|
|
56598
56650
|
function dehydrateMatchUps({ tournamentRecord }) {
|
|
56599
56651
|
if (!tournamentRecord)
|
|
56600
56652
|
return { error: MISSING_TOURNAMENT_RECORD };
|
|
@@ -56815,6 +56867,7 @@ var index$1 = {
|
|
|
56815
56867
|
isOdd: isOdd,
|
|
56816
56868
|
isPowerOf2: isPowerOf2,
|
|
56817
56869
|
makeDeepCopy: makeDeepCopy,
|
|
56870
|
+
matchUpScheduleSort: matchUpScheduleSort,
|
|
56818
56871
|
matchUpSort: matchUpSort,
|
|
56819
56872
|
nearestPowerOf2: nearestPowerOf2,
|
|
56820
56873
|
nextPowerOf2: nextPowerOf2,
|
|
@@ -58435,6 +58488,7 @@ var index = {
|
|
|
58435
58488
|
auditConstants: auditConstants,
|
|
58436
58489
|
completedMatchUpStatuses: completedMatchUpStatuses,
|
|
58437
58490
|
directingMatchUpStatuses: directingMatchUpStatuses,
|
|
58491
|
+
displayConstants: displayConstants,
|
|
58438
58492
|
drawDefinitionConstants: drawDefinitionConstants,
|
|
58439
58493
|
entryStatusConstants: entryStatusConstants,
|
|
58440
58494
|
errorConditionConstants: errorConditionConstants,
|
|
@@ -58480,6 +58534,7 @@ exports.competitionEngine = competitionEngine;
|
|
|
58480
58534
|
exports.competitionGovernor = index$h;
|
|
58481
58535
|
exports.completedMatchUpStatuses = completedMatchUpStatuses;
|
|
58482
58536
|
exports.directingMatchUpStatuses = directingMatchUpStatuses;
|
|
58537
|
+
exports.displayConstants = displayConstants;
|
|
58483
58538
|
exports.drawDefinitionConstants = drawDefinitionConstants;
|
|
58484
58539
|
exports.drawsGovernor = index$e;
|
|
58485
58540
|
exports.entriesGovernor = index$d;
|