tods-competition-factory 2.2.25 → 2.2.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.
@@ -2818,8 +2818,9 @@ interface QualifierProgressionArgs {
2818
2818
  tournamentRecord: Tournament;
2819
2819
  targetRoundNumber?: number;
2820
2820
  event: Event$1;
2821
+ randomList?: number[];
2821
2822
  }
2822
- declare function qualifierProgression({ targetRoundNumber, tournamentRecord, drawDefinition, event, }: QualifierProgressionArgs): ResultType;
2823
+ declare function qualifierProgression({ targetRoundNumber, tournamentRecord, drawDefinition, event, randomList, }: QualifierProgressionArgs): ResultType;
2823
2824
 
2824
2825
  declare function setStructureOrder({ drawDefinition, orderMap }: {
2825
2826
  drawDefinition: any;
@@ -3264,29 +3265,6 @@ type GetParticipantIdFinishingPositionsArgs = {
3264
3265
  };
3265
3266
  declare function getParticipantIdFinishingPositions({ byeAdvancements, tournamentRecord, drawDefinition, }: GetParticipantIdFinishingPositionsArgs): any;
3266
3267
 
3267
- type GetStructureSeedAssignmentsArgs = {
3268
- provisionalPositioning?: boolean;
3269
- drawDefinition?: DrawDefinition;
3270
- returnAllProxies?: boolean;
3271
- structure?: Structure;
3272
- structureId?: string;
3273
- };
3274
- declare function getStructureSeedAssignments({ provisionalPositioning, returnAllProxies, drawDefinition, structureId, structure, }: GetStructureSeedAssignmentsArgs): {
3275
- seedAssignments?: SeedAssignment[];
3276
- stageSequence?: number;
3277
- stage?: StageTypeUnion;
3278
- seedLimit?: number;
3279
- error?: ErrorType;
3280
- };
3281
-
3282
- type GetAssignedParticipantIdsArgs = {
3283
- drawDefinition: DrawDefinition;
3284
- stages?: StageTypeUnion[];
3285
- };
3286
- declare function getAssignedParticipantIds({ drawDefinition, stages }: GetAssignedParticipantIdsArgs): ResultType & {
3287
- assignedParticipantIds?: string[];
3288
- };
3289
-
3290
3268
  type GetDrawDefinitionArgs = {
3291
3269
  tournamentRecords?: {
3292
3270
  [key: string]: Tournament;
@@ -3303,6 +3281,29 @@ declare function publicFindDrawDefinition(params: GetDrawDefinitionArgs): {
3303
3281
  error?: undefined;
3304
3282
  };
3305
3283
 
3284
+ type GetAssignedParticipantIdsArgs = {
3285
+ drawDefinition: DrawDefinition;
3286
+ stages?: StageTypeUnion[];
3287
+ };
3288
+ declare function getAssignedParticipantIds({ drawDefinition, stages }: GetAssignedParticipantIdsArgs): ResultType & {
3289
+ assignedParticipantIds?: string[];
3290
+ };
3291
+
3292
+ type GetStructureSeedAssignmentsArgs = {
3293
+ provisionalPositioning?: boolean;
3294
+ drawDefinition?: DrawDefinition;
3295
+ returnAllProxies?: boolean;
3296
+ structure?: Structure;
3297
+ structureId?: string;
3298
+ };
3299
+ declare function getStructureSeedAssignments({ provisionalPositioning, returnAllProxies, drawDefinition, structureId, structure, }: GetStructureSeedAssignmentsArgs): {
3300
+ seedAssignments?: SeedAssignment[];
3301
+ stageSequence?: number;
3302
+ stage?: StageTypeUnion;
3303
+ seedLimit?: number;
3304
+ error?: ErrorType;
3305
+ };
3306
+
3306
3307
  type PositionActionsArgs = {
3307
3308
  inContextDrawMatchUps?: HydratedMatchUp[];
3308
3309
  restrictAdHocRoundParticipants?: boolean;
@@ -3326,6 +3327,18 @@ declare function positionActions(params: PositionActionsArgs): ResultType & {
3326
3327
  validActions?: any[];
3327
3328
  };
3328
3329
 
3330
+ type getDrawTypeCoercionArgs = {
3331
+ policyDefinitions?: PolicyDefinitions;
3332
+ appliedPolicies?: PolicyDefinitions;
3333
+ drawType?: string;
3334
+ };
3335
+ declare function getDrawTypeCoercion({ policyDefinitions, appliedPolicies, drawType }: getDrawTypeCoercionArgs): any;
3336
+
3337
+ interface GetRandomQualifierListParams {
3338
+ drawDefinition: DrawDefinition;
3339
+ }
3340
+ declare const getRandomQualifierList: ({ drawDefinition }: GetRandomQualifierListParams) => any[] | ResultType;
3341
+
3329
3342
  type GetPositionsPlayedOff = {
3330
3343
  drawDefinition: DrawDefinition;
3331
3344
  matchUpsMap?: MatchUpsMap;
@@ -3356,12 +3369,19 @@ declare function getPositionsPlayedOff({ drawDefinition, structureIds, matchUpsM
3356
3369
  context?: undefined;
3357
3370
  };
3358
3371
 
3359
- type getDrawTypeCoercionArgs = {
3360
- policyDefinitions?: PolicyDefinitions;
3361
- appliedPolicies?: PolicyDefinitions;
3362
- drawType?: string;
3372
+ declare function isValidForQualifying({ structureId, drawDefinition }: {
3373
+ structureId: any;
3374
+ drawDefinition: any;
3375
+ }): {
3376
+ error: {
3377
+ message: string;
3378
+ code: string;
3379
+ };
3380
+ links?: undefined;
3381
+ } | {
3382
+ valid: boolean;
3383
+ success: boolean;
3363
3384
  };
3364
- declare function getDrawTypeCoercion({ policyDefinitions, appliedPolicies, drawType }: getDrawTypeCoercionArgs): any;
3365
3385
 
3366
3386
  type GetPositionAssignmentsArgs = {
3367
3387
  tournamentRecord: Tournament;
@@ -3383,20 +3403,6 @@ declare function getPositionAssignments({ tournamentRecord, drawDefinition, stag
3383
3403
  error: ErrorType | undefined;
3384
3404
  };
3385
3405
 
3386
- declare function isValidForQualifying({ structureId, drawDefinition }: {
3387
- structureId: any;
3388
- drawDefinition: any;
3389
- }): {
3390
- error: {
3391
- message: string;
3392
- code: string;
3393
- };
3394
- links?: undefined;
3395
- } | {
3396
- valid: boolean;
3397
- success: boolean;
3398
- };
3399
-
3400
3406
  type GetSeedingThresholdsArgs = {
3401
3407
  roundRobinGroupsCount?: number;
3402
3408
  participantsCount: number;
@@ -3651,6 +3657,7 @@ declare const query$b_getMatchUpsMap: typeof getMatchUpsMap;
3651
3657
  declare const query$b_getParticipantIdFinishingPositions: typeof getParticipantIdFinishingPositions;
3652
3658
  declare const query$b_getPositionAssignments: typeof getPositionAssignments;
3653
3659
  declare const query$b_getPositionsPlayedOff: typeof getPositionsPlayedOff;
3660
+ declare const query$b_getRandomQualifierList: typeof getRandomQualifierList;
3654
3661
  declare const query$b_getSeedingThresholds: typeof getSeedingThresholds;
3655
3662
  declare const query$b_getSeedsCount: typeof getSeedsCount;
3656
3663
  declare const query$b_getStructureSeedAssignments: typeof getStructureSeedAssignments;
@@ -3661,7 +3668,7 @@ declare const query$b_isCompletedStructure: typeof isCompletedStructure;
3661
3668
  declare const query$b_isValidForQualifying: typeof isValidForQualifying;
3662
3669
  declare const query$b_positionActions: typeof positionActions;
3663
3670
  declare namespace query$b {
3664
- export { query$b_addGoesTo as addGoesTo, query$b_allPlayoffPositionsFilled as allPlayoffPositionsFilled, query$b_checkValidEntries as checkValidEntries, publicFindDrawDefinition as findDrawDefinition, query$b_getAssignedParticipantIds as getAssignedParticipantIds, query$b_getAvailableMatchUpsCount as getAvailableMatchUpsCount, query$b_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, query$b_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, query$b_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, query$b_getDrawStructures as getDrawStructures, query$b_getDrawTypeCoercion as getDrawTypeCoercion, query$b_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, query$b_getMatchUpsMap as getMatchUpsMap, query$b_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, query$b_getPositionAssignments as getPositionAssignments, query$b_getPositionsPlayedOff as getPositionsPlayedOff, query$b_getSeedingThresholds as getSeedingThresholds, query$b_getSeedsCount as getSeedsCount, query$b_getStructureSeedAssignments as getStructureSeedAssignments, query$b_getTeamLineUp as getTeamLineUp, query$b_getValidGroupSizes as getValidGroupSizes, query$b_isAdHoc as isAdHoc, query$b_isCompletedStructure as isCompletedStructure, query$b_isValidForQualifying as isValidForQualifying, query$b_positionActions as positionActions };
3671
+ export { query$b_addGoesTo as addGoesTo, query$b_allPlayoffPositionsFilled as allPlayoffPositionsFilled, query$b_checkValidEntries as checkValidEntries, publicFindDrawDefinition as findDrawDefinition, query$b_getAssignedParticipantIds as getAssignedParticipantIds, query$b_getAvailableMatchUpsCount as getAvailableMatchUpsCount, query$b_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, query$b_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, query$b_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, query$b_getDrawStructures as getDrawStructures, query$b_getDrawTypeCoercion as getDrawTypeCoercion, query$b_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, query$b_getMatchUpsMap as getMatchUpsMap, query$b_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, query$b_getPositionAssignments as getPositionAssignments, query$b_getPositionsPlayedOff as getPositionsPlayedOff, query$b_getRandomQualifierList as getRandomQualifierList, query$b_getSeedingThresholds as getSeedingThresholds, query$b_getSeedsCount as getSeedsCount, query$b_getStructureSeedAssignments as getStructureSeedAssignments, query$b_getTeamLineUp as getTeamLineUp, query$b_getValidGroupSizes as getValidGroupSizes, query$b_isAdHoc as isAdHoc, query$b_isCompletedStructure as isCompletedStructure, query$b_isValidForQualifying as isValidForQualifying, query$b_positionActions as positionActions };
3665
3672
  }
3666
3673
 
3667
3674
  type GenerateDrawTypeAndModify = {
@@ -4000,6 +4007,7 @@ declare const index$j_getMatchUpsMap: typeof getMatchUpsMap;
4000
4007
  declare const index$j_getParticipantIdFinishingPositions: typeof getParticipantIdFinishingPositions;
4001
4008
  declare const index$j_getPositionAssignments: typeof getPositionAssignments;
4002
4009
  declare const index$j_getPositionsPlayedOff: typeof getPositionsPlayedOff;
4010
+ declare const index$j_getRandomQualifierList: typeof getRandomQualifierList;
4003
4011
  declare const index$j_getSeedingThresholds: typeof getSeedingThresholds;
4004
4012
  declare const index$j_getSeedsCount: typeof getSeedsCount;
4005
4013
  declare const index$j_getStructureSeedAssignments: typeof getStructureSeedAssignments;
@@ -4034,7 +4042,7 @@ declare const index$j_swapDrawPositionAssignments: typeof swapDrawPositionAssign
4034
4042
  declare const index$j_updateTeamLineUp: typeof updateTeamLineUp;
4035
4043
  declare const index$j_withdrawParticipantAtDrawPosition: typeof withdrawParticipantAtDrawPosition;
4036
4044
  declare namespace index$j {
4037
- export { index$j_adHocPositionSwap as adHocPositionSwap, index$j_addAdHocMatchUps as addAdHocMatchUps, index$j_addDrawDefinitionTimeItem as addDrawDefinitionTimeItem, index$j_addFinishingRounds as addFinishingRounds, index$j_addGoesTo as addGoesTo, index$j_addPlayoffStructures as addPlayoffStructures, index$j_addQualifyingStructure as addQualifyingStructure, index$j_addVoluntaryConsolationStage as addVoluntaryConsolationStage, index$j_addVoluntaryConsolationStructure as addVoluntaryConsolationStructure, index$j_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$j_alternateDrawPositionAssignment as alternateDrawPositionAssignment, index$j_assignDrawPosition as assignDrawPosition, index$j_assignDrawPositionBye as assignDrawPositionBye, index$j_attachConsolationStructures as attachConsolationStructures, index$j_attachPlayoffStructures as attachPlayoffStructures, index$j_attachQualifyingStructure as attachQualifyingStructure, index$j_attachStructures as attachStructures, index$j_autoSeeding as autoSeeding, index$j_automatedPlayoffPositioning as automatedPlayoffPositioning, index$j_automatedPositioning as automatedPositioning, index$j_checkValidEntries as checkValidEntries, index$j_deleteAdHocMatchUps as deleteAdHocMatchUps, index$j_drawMatic as drawMatic, publicFindDrawDefinition as findDrawDefinition, index$j_generateAdHocMatchUps as generateAdHocMatchUps, index$j_generateAdHocRounds as generateAdHocRounds, index$j_generateAndPopulatePlayoffStructures as generateAndPopulatePlayoffStructures, index$j_generateDrawDefinition as generateDrawDefinition, index$j_generateDrawMaticRound as generateDrawMaticRound, index$j_generateDrawStructuresAndLinks as generateDrawStructuresAndLinks, index$j_generateDrawTypeAndModifyDrawDefinition as generateDrawTypeAndModifyDrawDefinition, index$j_generateQualifyingStructure as generateQualifyingStructure, index$j_generateVoluntaryConsolation as generateVoluntaryConsolation, index$j_getAssignedParticipantIds as getAssignedParticipantIds, index$j_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$j_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$j_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$j_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$j_getDrawStructures as getDrawStructures, index$j_getDrawTypeCoercion as getDrawTypeCoercion, index$j_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$j_getMatchUpsMap as getMatchUpsMap, index$j_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$j_getPositionAssignments as getPositionAssignments, index$j_getPositionsPlayedOff as getPositionsPlayedOff, index$j_getSeedingThresholds as getSeedingThresholds, index$j_getSeedsCount as getSeedsCount, index$j_getStructureSeedAssignments as getStructureSeedAssignments, index$j_getTeamLineUp as getTeamLineUp, index$j_getValidGroupSizes as getValidGroupSizes, index$j_isAdHoc as isAdHoc, index$j_isCompletedStructure as isCompletedStructure, index$j_isValidForQualifying as isValidForQualifying, index$j_luckyLoserDrawPositionAssignment as luckyLoserDrawPositionAssignment, index$j_modifyDrawDefinition as modifyDrawDefinition, index$j_modifyDrawName as modifyDrawName, index$j_modifySeedAssignment as modifySeedAssignment, mutate$c as mutate, index$j_positionActions as positionActions, index$j_pruneDrawDefinition as pruneDrawDefinition, index$j_qualifierDrawPositionAssignment as qualifierDrawPositionAssignment, index$j_qualifierProgression as qualifierProgression, query$b as query, index$j_removeDrawPositionAssignment as removeDrawPositionAssignment, index$j_removeRoundMatchUps as removeRoundMatchUps, index$j_removeSeededParticipant as removeSeededParticipant, index$j_removeStructure as removeStructure, index$j_renameStructures as renameStructures, index$j_resetDrawDefinition as resetDrawDefinition, index$j_resetQualifyingStructure as resetQualifyingStructure, index$j_resetVoluntaryConsolationStructure as resetVoluntaryConsolationStructure, index$j_setDrawParticipantRepresentativeIds as setDrawParticipantRepresentativeIds, index$j_setPositionAssignments as setPositionAssignments, index$j_setStructureOrder as setStructureOrder, index$j_setSubOrder as setSubOrder, index$j_shiftAdHocRounds as shiftAdHocRounds, index$j_swapAdHocRounds as swapAdHocRounds, index$j_swapDrawPositionAssignments as swapDrawPositionAssignments, index$j_updateTeamLineUp as updateTeamLineUp, index$j_withdrawParticipantAtDrawPosition as withdrawParticipantAtDrawPosition };
4045
+ export { index$j_adHocPositionSwap as adHocPositionSwap, index$j_addAdHocMatchUps as addAdHocMatchUps, index$j_addDrawDefinitionTimeItem as addDrawDefinitionTimeItem, index$j_addFinishingRounds as addFinishingRounds, index$j_addGoesTo as addGoesTo, index$j_addPlayoffStructures as addPlayoffStructures, index$j_addQualifyingStructure as addQualifyingStructure, index$j_addVoluntaryConsolationStage as addVoluntaryConsolationStage, index$j_addVoluntaryConsolationStructure as addVoluntaryConsolationStructure, index$j_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$j_alternateDrawPositionAssignment as alternateDrawPositionAssignment, index$j_assignDrawPosition as assignDrawPosition, index$j_assignDrawPositionBye as assignDrawPositionBye, index$j_attachConsolationStructures as attachConsolationStructures, index$j_attachPlayoffStructures as attachPlayoffStructures, index$j_attachQualifyingStructure as attachQualifyingStructure, index$j_attachStructures as attachStructures, index$j_autoSeeding as autoSeeding, index$j_automatedPlayoffPositioning as automatedPlayoffPositioning, index$j_automatedPositioning as automatedPositioning, index$j_checkValidEntries as checkValidEntries, index$j_deleteAdHocMatchUps as deleteAdHocMatchUps, index$j_drawMatic as drawMatic, publicFindDrawDefinition as findDrawDefinition, index$j_generateAdHocMatchUps as generateAdHocMatchUps, index$j_generateAdHocRounds as generateAdHocRounds, index$j_generateAndPopulatePlayoffStructures as generateAndPopulatePlayoffStructures, index$j_generateDrawDefinition as generateDrawDefinition, index$j_generateDrawMaticRound as generateDrawMaticRound, index$j_generateDrawStructuresAndLinks as generateDrawStructuresAndLinks, index$j_generateDrawTypeAndModifyDrawDefinition as generateDrawTypeAndModifyDrawDefinition, index$j_generateQualifyingStructure as generateQualifyingStructure, index$j_generateVoluntaryConsolation as generateVoluntaryConsolation, index$j_getAssignedParticipantIds as getAssignedParticipantIds, index$j_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$j_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$j_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$j_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$j_getDrawStructures as getDrawStructures, index$j_getDrawTypeCoercion as getDrawTypeCoercion, index$j_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$j_getMatchUpsMap as getMatchUpsMap, index$j_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$j_getPositionAssignments as getPositionAssignments, index$j_getPositionsPlayedOff as getPositionsPlayedOff, index$j_getRandomQualifierList as getRandomQualifierList, index$j_getSeedingThresholds as getSeedingThresholds, index$j_getSeedsCount as getSeedsCount, index$j_getStructureSeedAssignments as getStructureSeedAssignments, index$j_getTeamLineUp as getTeamLineUp, index$j_getValidGroupSizes as getValidGroupSizes, index$j_isAdHoc as isAdHoc, index$j_isCompletedStructure as isCompletedStructure, index$j_isValidForQualifying as isValidForQualifying, index$j_luckyLoserDrawPositionAssignment as luckyLoserDrawPositionAssignment, index$j_modifyDrawDefinition as modifyDrawDefinition, index$j_modifyDrawName as modifyDrawName, index$j_modifySeedAssignment as modifySeedAssignment, mutate$c as mutate, index$j_positionActions as positionActions, index$j_pruneDrawDefinition as pruneDrawDefinition, index$j_qualifierDrawPositionAssignment as qualifierDrawPositionAssignment, index$j_qualifierProgression as qualifierProgression, query$b as query, index$j_removeDrawPositionAssignment as removeDrawPositionAssignment, index$j_removeRoundMatchUps as removeRoundMatchUps, index$j_removeSeededParticipant as removeSeededParticipant, index$j_removeStructure as removeStructure, index$j_renameStructures as renameStructures, index$j_resetDrawDefinition as resetDrawDefinition, index$j_resetQualifyingStructure as resetQualifyingStructure, index$j_resetVoluntaryConsolationStructure as resetVoluntaryConsolationStructure, index$j_setDrawParticipantRepresentativeIds as setDrawParticipantRepresentativeIds, index$j_setPositionAssignments as setPositionAssignments, index$j_setStructureOrder as setStructureOrder, index$j_setSubOrder as setSubOrder, index$j_shiftAdHocRounds as shiftAdHocRounds, index$j_swapAdHocRounds as swapAdHocRounds, index$j_swapDrawPositionAssignments as swapDrawPositionAssignments, index$j_updateTeamLineUp as updateTeamLineUp, index$j_withdrawParticipantAtDrawPosition as withdrawParticipantAtDrawPosition };
4038
4046
  }
4039
4047
 
4040
4048
  type DestroyPairEntryArgs = {
@@ -7960,6 +7968,7 @@ declare const index$9_getPositionsPlayedOff: typeof getPositionsPlayedOff;
7960
7968
  declare const index$9_getPredictiveAccuracy: typeof getPredictiveAccuracy;
7961
7969
  declare const index$9_getProfileRounds: typeof getProfileRounds;
7962
7970
  declare const index$9_getPublishState: typeof getPublishState;
7971
+ declare const index$9_getRandomQualifierList: typeof getRandomQualifierList;
7963
7972
  declare const index$9_getRoundMatchUps: typeof getRoundMatchUps;
7964
7973
  declare const index$9_getRounds: typeof getRounds;
7965
7974
  declare const index$9_getScaleValues: typeof getScaleValues;
@@ -8002,7 +8011,7 @@ declare const index$9_validMatchUps: typeof validMatchUps;
8002
8011
  declare const index$9_validateCollectionDefinition: typeof validateCollectionDefinition;
8003
8012
  declare const index$9_validateLineUp: typeof validateLineUp;
8004
8013
  declare namespace index$9 {
8005
- export { index$9_addGoesTo as addGoesTo, index$9_allCompetitionMatchUps as allCompetitionMatchUps, index$9_allDrawMatchUps as allDrawMatchUps, index$9_allEventMatchUps as allEventMatchUps, index$9_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$9_allTournamentMatchUps as allTournamentMatchUps, index$9_analyzeDraws as analyzeDraws, index$9_analyzeMatchUp as analyzeMatchUp, index$9_analyzeTournament as analyzeTournament, index$9_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, index$9_calculateWinCriteria as calculateWinCriteria, index$9_categoryCanContain as categoryCanContain, index$9_checkMatchUpIsComplete as checkMatchUpIsComplete, index$9_checkValidEntries as checkValidEntries, index$9_compareTieFormats as compareTieFormats, index$9_competitionScheduleMatchUps as competitionScheduleMatchUps, index$9_courtGridRows as courtGridRows, index$9_credits as credits, index$9_drawMatchUps as drawMatchUps, index$9_eventMatchUps as eventMatchUps, index$9_filterMatchUps as filterMatchUps, index$9_filterParticipants as filterParticipants, publicFindDrawDefinition as findDrawDefinition, index$9_findExtension as findExtension, index$9_findVenue as findVenue, index$9_getAggregateTeamResults as getAggregateTeamResults, index$9_getAllDrawMatchUps as getAllDrawMatchUps, index$9_getAllEventData as getAllEventData, index$9_getAllStructureMatchUps as getAllStructureMatchUps, index$9_getAllowedDrawTypes as getAllowedDrawTypes, index$9_getAllowedMatchUpFormats as getAllowedMatchUpFormats, index$9_getAppliedPolicies as getAppliedPolicies, index$9_getAssignedParticipantIds as getAssignedParticipantIds, index$9_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$9_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$9_getCategoryAgeDetails as getCategoryAgeDetails, index$9_getCheckedInParticipantIds as getCheckedInParticipantIds, index$9_getCompetitionDateRange as getCompetitionDateRange, index$9_getCompetitionMatchUps as getCompetitionMatchUps, index$9_getCompetitionParticipants as getCompetitionParticipants, index$9_getCompetitionPenalties as getCompetitionPenalties, index$9_getCompetitionVenues as getCompetitionVenues, index$9_getCourtInfo as getCourtInfo, index$9_getCourts as getCourts, index$9_getDrawData as getDrawData, index$9_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$9_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$9_getDrawStructures as getDrawStructures, index$9_getDrawTypeCoercion as getDrawTypeCoercion, index$9_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$9_getEntriesAndSeedsCount as getEntriesAndSeedsCount, index$9_getEvent as getEvent, index$9_getEventData as getEventData, index$9_getEventMatchUpFormatTiming as getEventMatchUpFormatTiming, index$9_getEventProperties as getEventProperties, index$9_getEventPublishStatus as getEventPublishStatus, index$9_getEventStructures as getEventStructures, index$9_getEventTimeItem as getEventTimeItem, index$9_getEvents as getEvents, index$9_getFlightProfile as getFlightProfile, index$9_getHomeParticipantId as getHomeParticipantId, index$9_getLinkedTournamentIds as getLinkedTournamentIds, index$9_getMatchUpCompetitiveProfile as getMatchUpCompetitiveProfile, index$9_getMatchUpContextIds as getMatchUpContextIds, index$9_getMatchUpDailyLimits as getMatchUpDailyLimits, index$9_getMatchUpDailyLimitsUpdate as getMatchUpDailyLimitsUpdate, index$9_getMatchUpDependencies as getMatchUpDependencies, index$9_getMatchUpFormat as getMatchUpFormat, index$9_getMatchUpFormatTiming as getMatchUpFormatTiming, index$9_getMatchUpFormatTimingUpdate as getMatchUpFormatTimingUpdate, index$9_getMatchUpScheduleDetails as getMatchUpScheduleDetails, index$9_getMatchUpType as getMatchUpType, index$9_getMatchUpsMap as getMatchUpsMap, index$9_getMatchUpsStats as getMatchUpsStats, index$9_getMatchUpsToSchedule as getMatchUpsToSchedule, index$9_getMaxEntryPosition as getMaxEntryPosition, index$9_getModifiedMatchUpFormatTiming as getModifiedMatchUpFormatTiming, index$9_getPairedParticipant as getPairedParticipant, index$9_getParticipantEventDetails as getParticipantEventDetails, index$9_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$9_getParticipantMembership as getParticipantMembership, index$9_getParticipantResults as getParticipantResults, index$9_getParticipantScaleItem as getParticipantScaleItem, index$9_getParticipantSchedules as getParticipantSchedules, index$9_getParticipantSignInStatus as getParticipantSignInStatus, index$9_getParticipantTimeItem as getParticipantTimeItem, index$9_getParticipants as getParticipants, index$9_getPersonRequests as getPersonRequests, index$9_getPolicyDefinitions as getPolicyDefinitions, index$9_getPositionAssignments as getPositionAssignments, index$9_getPositionsPlayedOff as getPositionsPlayedOff, index$9_getPredictiveAccuracy as getPredictiveAccuracy, index$9_getProfileRounds as getProfileRounds, index$9_getPublishState as getPublishState, index$9_getRoundMatchUps as getRoundMatchUps, index$9_getRounds as getRounds, index$9_getScaleValues as getScaleValues, index$9_getScaledEntries as getScaledEntries, index$9_getScheduledRoundsDetails as getScheduledRoundsDetails, index$9_getSchedulingProfile as getSchedulingProfile, index$9_getSchedulingProfileIssues as getSchedulingProfileIssues, index$9_getSeedingThresholds as getSeedingThresholds, index$9_getSeedsCount as getSeedsCount, index$9_getStructureSeedAssignments as getStructureSeedAssignments, index$9_getTeamLineUp as getTeamLineUp, index$9_getTieFormat as getTieFormat, index$9_getTimeItem as getTimeItem, index$9_getTournamentIds as getTournamentIds, index$9_getTournamentInfo as getTournamentInfo, index$9_getTournamentPenalties as getTournamentPenalties, index$9_getTournamentPersons as getTournamentPersons, index$9_getTournamentPoints as getTournamentPoints, index$9_getTournamentPublishStatus as getTournamentPublishStatus, index$9_getTournamentStructures as getTournamentStructures, index$9_getTournamentTimeItem as getTournamentTimeItem, index$9_getValidGroupSizes as getValidGroupSizes, index$9_getVenueData as getVenueData, index$9_getVenuesAndCourts as getVenuesAndCourts, index$9_isAdHoc as isAdHoc, index$9_isCompletedStructure as isCompletedStructure, index$9_isValidForQualifying as isValidForQualifying, index$9_isValidMatchUpFormat as isValidMatchUpFormat, index$9_matchUpActions as matchUpActions, index$9_participantScaleItem as participantScaleItem, index$9_participantScheduledMatchUps as participantScheduledMatchUps, index$9_positionActions as positionActions, index$9_publicFindCourt as publicFindCourt, index$9_publicFindVenue as publicFindVenue, index$9_tallyParticipantResults as tallyParticipantResults, index$9_tieFormatGenderValidityCheck as tieFormatGenderValidityCheck, index$9_tournamentMatchUps as tournamentMatchUps, index$9_validMatchUp as validMatchUp, index$9_validMatchUps as validMatchUps, index$9_validateCollectionDefinition as validateCollectionDefinition, index$9_validateLineUp as validateLineUp };
8014
+ export { index$9_addGoesTo as addGoesTo, index$9_allCompetitionMatchUps as allCompetitionMatchUps, index$9_allDrawMatchUps as allDrawMatchUps, index$9_allEventMatchUps as allEventMatchUps, index$9_allPlayoffPositionsFilled as allPlayoffPositionsFilled, index$9_allTournamentMatchUps as allTournamentMatchUps, index$9_analyzeDraws as analyzeDraws, index$9_analyzeMatchUp as analyzeMatchUp, index$9_analyzeTournament as analyzeTournament, index$9_bulkUpdatePublishedEventIds as bulkUpdatePublishedEventIds, index$9_calculateWinCriteria as calculateWinCriteria, index$9_categoryCanContain as categoryCanContain, index$9_checkMatchUpIsComplete as checkMatchUpIsComplete, index$9_checkValidEntries as checkValidEntries, index$9_compareTieFormats as compareTieFormats, index$9_competitionScheduleMatchUps as competitionScheduleMatchUps, index$9_courtGridRows as courtGridRows, index$9_credits as credits, index$9_drawMatchUps as drawMatchUps, index$9_eventMatchUps as eventMatchUps, index$9_filterMatchUps as filterMatchUps, index$9_filterParticipants as filterParticipants, publicFindDrawDefinition as findDrawDefinition, index$9_findExtension as findExtension, index$9_findVenue as findVenue, index$9_getAggregateTeamResults as getAggregateTeamResults, index$9_getAllDrawMatchUps as getAllDrawMatchUps, index$9_getAllEventData as getAllEventData, index$9_getAllStructureMatchUps as getAllStructureMatchUps, index$9_getAllowedDrawTypes as getAllowedDrawTypes, index$9_getAllowedMatchUpFormats as getAllowedMatchUpFormats, index$9_getAppliedPolicies as getAppliedPolicies, index$9_getAssignedParticipantIds as getAssignedParticipantIds, index$9_getAvailableMatchUpsCount as getAvailableMatchUpsCount, index$9_getAvailablePlayoffProfiles as getAvailablePlayoffProfiles, index$9_getCategoryAgeDetails as getCategoryAgeDetails, index$9_getCheckedInParticipantIds as getCheckedInParticipantIds, index$9_getCompetitionDateRange as getCompetitionDateRange, index$9_getCompetitionMatchUps as getCompetitionMatchUps, index$9_getCompetitionParticipants as getCompetitionParticipants, index$9_getCompetitionPenalties as getCompetitionPenalties, index$9_getCompetitionVenues as getCompetitionVenues, index$9_getCourtInfo as getCourtInfo, index$9_getCourts as getCourts, index$9_getDrawData as getDrawData, index$9_getDrawDefinitionTimeItem as getDrawDefinitionTimeItem, index$9_getDrawParticipantRepresentativeIds as getDrawParticipantRepresentativeIds, index$9_getDrawStructures as getDrawStructures, index$9_getDrawTypeCoercion as getDrawTypeCoercion, index$9_getEligibleVoluntaryConsolationParticipants as getEligibleVoluntaryConsolationParticipants, index$9_getEntriesAndSeedsCount as getEntriesAndSeedsCount, index$9_getEvent as getEvent, index$9_getEventData as getEventData, index$9_getEventMatchUpFormatTiming as getEventMatchUpFormatTiming, index$9_getEventProperties as getEventProperties, index$9_getEventPublishStatus as getEventPublishStatus, index$9_getEventStructures as getEventStructures, index$9_getEventTimeItem as getEventTimeItem, index$9_getEvents as getEvents, index$9_getFlightProfile as getFlightProfile, index$9_getHomeParticipantId as getHomeParticipantId, index$9_getLinkedTournamentIds as getLinkedTournamentIds, index$9_getMatchUpCompetitiveProfile as getMatchUpCompetitiveProfile, index$9_getMatchUpContextIds as getMatchUpContextIds, index$9_getMatchUpDailyLimits as getMatchUpDailyLimits, index$9_getMatchUpDailyLimitsUpdate as getMatchUpDailyLimitsUpdate, index$9_getMatchUpDependencies as getMatchUpDependencies, index$9_getMatchUpFormat as getMatchUpFormat, index$9_getMatchUpFormatTiming as getMatchUpFormatTiming, index$9_getMatchUpFormatTimingUpdate as getMatchUpFormatTimingUpdate, index$9_getMatchUpScheduleDetails as getMatchUpScheduleDetails, index$9_getMatchUpType as getMatchUpType, index$9_getMatchUpsMap as getMatchUpsMap, index$9_getMatchUpsStats as getMatchUpsStats, index$9_getMatchUpsToSchedule as getMatchUpsToSchedule, index$9_getMaxEntryPosition as getMaxEntryPosition, index$9_getModifiedMatchUpFormatTiming as getModifiedMatchUpFormatTiming, index$9_getPairedParticipant as getPairedParticipant, index$9_getParticipantEventDetails as getParticipantEventDetails, index$9_getParticipantIdFinishingPositions as getParticipantIdFinishingPositions, index$9_getParticipantMembership as getParticipantMembership, index$9_getParticipantResults as getParticipantResults, index$9_getParticipantScaleItem as getParticipantScaleItem, index$9_getParticipantSchedules as getParticipantSchedules, index$9_getParticipantSignInStatus as getParticipantSignInStatus, index$9_getParticipantTimeItem as getParticipantTimeItem, index$9_getParticipants as getParticipants, index$9_getPersonRequests as getPersonRequests, index$9_getPolicyDefinitions as getPolicyDefinitions, index$9_getPositionAssignments as getPositionAssignments, index$9_getPositionsPlayedOff as getPositionsPlayedOff, index$9_getPredictiveAccuracy as getPredictiveAccuracy, index$9_getProfileRounds as getProfileRounds, index$9_getPublishState as getPublishState, index$9_getRandomQualifierList as getRandomQualifierList, index$9_getRoundMatchUps as getRoundMatchUps, index$9_getRounds as getRounds, index$9_getScaleValues as getScaleValues, index$9_getScaledEntries as getScaledEntries, index$9_getScheduledRoundsDetails as getScheduledRoundsDetails, index$9_getSchedulingProfile as getSchedulingProfile, index$9_getSchedulingProfileIssues as getSchedulingProfileIssues, index$9_getSeedingThresholds as getSeedingThresholds, index$9_getSeedsCount as getSeedsCount, index$9_getStructureSeedAssignments as getStructureSeedAssignments, index$9_getTeamLineUp as getTeamLineUp, index$9_getTieFormat as getTieFormat, index$9_getTimeItem as getTimeItem, index$9_getTournamentIds as getTournamentIds, index$9_getTournamentInfo as getTournamentInfo, index$9_getTournamentPenalties as getTournamentPenalties, index$9_getTournamentPersons as getTournamentPersons, index$9_getTournamentPoints as getTournamentPoints, index$9_getTournamentPublishStatus as getTournamentPublishStatus, index$9_getTournamentStructures as getTournamentStructures, index$9_getTournamentTimeItem as getTournamentTimeItem, index$9_getValidGroupSizes as getValidGroupSizes, index$9_getVenueData as getVenueData, index$9_getVenuesAndCourts as getVenuesAndCourts, index$9_isAdHoc as isAdHoc, index$9_isCompletedStructure as isCompletedStructure, index$9_isValidForQualifying as isValidForQualifying, index$9_isValidMatchUpFormat as isValidMatchUpFormat, index$9_matchUpActions as matchUpActions, index$9_participantScaleItem as participantScaleItem, index$9_participantScheduledMatchUps as participantScheduledMatchUps, index$9_positionActions as positionActions, index$9_publicFindCourt as publicFindCourt, index$9_publicFindVenue as publicFindVenue, index$9_tallyParticipantResults as tallyParticipantResults, index$9_tieFormatGenderValidityCheck as tieFormatGenderValidityCheck, index$9_tournamentMatchUps as tournamentMatchUps, index$9_validMatchUp as validMatchUp, index$9_validMatchUps as validMatchUps, index$9_validateCollectionDefinition as validateCollectionDefinition, index$9_validateLineUp as validateLineUp };
8006
8015
  }
8007
8016
 
8008
8017
  type StatCounters = {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  function factoryVersion() {
6
- return '2.2.25';
6
+ return '2.2.26';
7
7
  }
8
8
 
9
9
  const SINGLES_MATCHUP = 'SINGLES';
@@ -113,7 +113,7 @@ function stepRound(value, step) {
113
113
  function skewedDistribution(min, max, skew, step, significantDecimals = 2) {
114
114
  const u = 1 - Math.random();
115
115
  const v = 1 - Math.random();
116
- let num = Math.sqrt(-2.0 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
116
+ let num = Math.sqrt(-2 * Math.log(u)) * Math.cos(2.0 * Math.PI * v);
117
117
  num = num / 10.0 + 0.5;
118
118
  if (num > 1 || num < 0) {
119
119
  num = skewedDistribution(min, max, skew);
@@ -1462,7 +1462,7 @@ function addNotice$1({ topic, payload, key }, isGlobalSubscription) {
1462
1462
  return { ...SUCCESS };
1463
1463
  }
1464
1464
  function getMethods$1() {
1465
- return syncGlobalState.methods ?? {};
1465
+ return syncGlobalState.methods;
1466
1466
  }
1467
1467
  function getNotices$1({ topic }) {
1468
1468
  return syncGlobalState.notices.filter((notice) => notice.topic === topic).map((notice) => notice.payload);
@@ -2908,7 +2908,7 @@ function makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtens
2908
2908
  if (getProvider().makeDeepCopy)
2909
2909
  return getProvider().makeDeepCopy(sourceObject, convertExtensions, internalUse, removeExtensions);
2910
2910
  const deepCopy = deepCopyEnabled();
2911
- const { stringify, toJSON, ignore, modulate } = deepCopy || {};
2911
+ const { stringify, toJSON, ignore, modulate } = deepCopy;
2912
2912
  if ((!deepCopy?.enabled && !internalUse) ||
2913
2913
  typeof sourceObject !== 'object' ||
2914
2914
  isFunction(sourceObject) ||
@@ -5422,7 +5422,7 @@ function structureAssignedDrawPositions({ drawDefinition, structureId, structure
5422
5422
  const assignedPositions = positionAssignments?.filter((assignment) => {
5423
5423
  return assignment.participantId ?? assignment.bye ?? assignment.qualifier;
5424
5424
  });
5425
- const allPositionsAssigned = positionAssignments && positionAssignments?.length === assignedPositions?.length;
5425
+ const allPositionsAssigned = positionAssignments?.length === assignedPositions?.length;
5426
5426
  const unassignedPositions = positionAssignments?.filter((assignment) => {
5427
5427
  return !assignment.participantId && !assignment.bye && !assignment.qualifier;
5428
5428
  });
@@ -9093,7 +9093,7 @@ function getMatchUpParticipantIds({ matchUp }) {
9093
9093
  ?.map((side) => side.participant?.individualParticipants)
9094
9094
  .filter(Boolean) ?? [];
9095
9095
  const nestedIndividualParticipantIds = nestedIndividualParticipants.map((participants) => (participants ?? []).map((participant) => participant?.participantId).filter(Boolean));
9096
- const individualParticipantIds = [...sideIndividualParticipantIds, ...nestedIndividualParticipantIds.flat()].filter(Boolean) ?? [];
9096
+ const individualParticipantIds = [...sideIndividualParticipantIds, ...nestedIndividualParticipantIds.flat()].filter(Boolean);
9097
9097
  const allRelevantParticipantIds = unique(individualParticipantIds.concat(sideParticipantIds)).filter(Boolean) ?? [];
9098
9098
  return {
9099
9099
  nestedIndividualParticipantIds,
@@ -12698,7 +12698,7 @@ function clearDrawPosition(params) {
12698
12698
  const positionAssignments = structureAssignedDrawPositions({
12699
12699
  drawDefinition,
12700
12700
  structure,
12701
- }).positionAssignments || [];
12701
+ }).positionAssignments;
12702
12702
  const existingAssignment = positionAssignments.find((assignment) => (participantId && assignment.participantId === participantId) ||
12703
12703
  (drawPosition && assignment.drawPosition === drawPosition));
12704
12704
  if (existingAssignment && participantId && !drawPosition) {
@@ -12749,7 +12749,7 @@ function drawPositionRemovals({ inContextDrawMatchUps, tournamentRecord, drawDef
12749
12749
  const positionAssignments = structureAssignedDrawPositions({
12750
12750
  drawDefinition,
12751
12751
  structure,
12752
- }).positionAssignments || [];
12752
+ }).positionAssignments;
12753
12753
  const drawPositionCleared = positionAssignments.some((assignment) => {
12754
12754
  if (assignment.drawPosition === drawPosition) {
12755
12755
  delete assignment.participantId;
@@ -19266,7 +19266,32 @@ function getSourceStructureIdsAndRelevantLinks({ targetRoundNumber, finishingPos
19266
19266
  return { sourceStructureIds, relevantLinks };
19267
19267
  }
19268
19268
 
19269
- function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDefinition, event, }) {
19269
+ const mapNumbersToIndexes = (indexArray, randNumberArray) => {
19270
+ const uniqueRandomList = [...new Set(randNumberArray.slice(0, indexArray.length))];
19271
+ const sortedRandomList = [...uniqueRandomList].sort((a, b) => a - b);
19272
+ const usedIndexes = new Set();
19273
+ const mappedNumbersToIndexes = [];
19274
+ uniqueRandomList.forEach((item) => {
19275
+ const randNumberIndex = indexArray.indexOf(item);
19276
+ if (randNumberIndex !== -1 && !usedIndexes.has(randNumberIndex)) {
19277
+ mappedNumbersToIndexes.push(randNumberIndex);
19278
+ usedIndexes.add(randNumberIndex);
19279
+ }
19280
+ else {
19281
+ const sortedIndex = sortedRandomList.indexOf(item);
19282
+ let nextAvailableIndex = indexArray.findIndex((_, i) => !usedIndexes.has(i));
19283
+ while (usedIndexes.has(nextAvailableIndex) && nextAvailableIndex === -1 && usedIndexes.size < indexArray.length) {
19284
+ nextAvailableIndex = indexArray.findIndex((_, i) => !usedIndexes.has(i) && i > nextAvailableIndex);
19285
+ }
19286
+ mappedNumbersToIndexes.push(sortedIndex);
19287
+ usedIndexes.add(sortedIndex);
19288
+ }
19289
+ });
19290
+ const remainingIndexes = indexArray.filter((_, index) => !usedIndexes.has(index));
19291
+ return [...mappedNumbersToIndexes, ...remainingIndexes];
19292
+ };
19293
+
19294
+ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDefinition, event, randomList, }) {
19270
19295
  const paramsCheck = checkRequiredParameters({ drawDefinition, event, tournamentRecord }, [
19271
19296
  { [DRAW_DEFINITION]: true, [EVENT]: true, [TOURNAMENT_RECORD]: true },
19272
19297
  ]);
@@ -19280,22 +19305,26 @@ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDef
19280
19305
  const appliedPolicies = getAppliedPolicies({ tournamentRecord, drawDefinition, structure: mainStructure, event }).appliedPolicies ?? {};
19281
19306
  const policy = appliedPolicies[POLICY_TYPE_POSITION_ACTIONS];
19282
19307
  const requireCompletedStructures = policy?.requireCompletedStructures;
19283
- const { qualifierPositions, positionAssignments } = structureAssignedDrawPositions({ structure: mainStructure });
19308
+ const { qualifierPositions, positionAssignments, } = structureAssignedDrawPositions({ structure: mainStructure });
19284
19309
  if (!qualifierPositions.length)
19285
19310
  return decorateResult({ result: { error: NO_DRAW_POSITIONS_AVAILABLE_FOR_QUALIFIERS } });
19311
+ let qualifierPositionIndexes = generateRange(0, qualifierPositions.length);
19312
+ if (randomList) {
19313
+ qualifierPositionIndexes = mapNumbersToIndexes(qualifierPositionIndexes, randomList);
19314
+ }
19286
19315
  const assignedParticipantIds = positionAssignments.map((assignment) => assignment.participantId).filter(Boolean);
19287
19316
  const { relevantLinks: eliminationSourceLinks } = getSourceStructureIdsAndRelevantLinks({
19288
19317
  structureId: mainStructure.structureId,
19289
19318
  targetRoundNumber,
19290
19319
  linkType: WINNER,
19291
19320
  drawDefinition,
19292
- }) || {};
19321
+ });
19293
19322
  const { relevantLinks: roundRobinSourceLinks } = getSourceStructureIdsAndRelevantLinks({
19294
19323
  structureId: mainStructure.structureId,
19295
19324
  targetRoundNumber,
19296
19325
  linkType: POSITION,
19297
19326
  drawDefinition,
19298
- }) || {};
19327
+ });
19299
19328
  for (const sourceLink of eliminationSourceLinks) {
19300
19329
  const structure = drawDefinition.structures?.find((structure) => structure.structureId === sourceLink.source.structureId);
19301
19330
  if (structure?.stage !== QUALIFYING)
@@ -19349,18 +19378,19 @@ function qualifierProgression({ targetRoundNumber = 1, tournamentRecord, drawDef
19349
19378
  }
19350
19379
  if (!qualifyingParticipantIds.length)
19351
19380
  return decorateResult({ result: { error: MISSING_QUALIFIED_PARTICIPANTS } });
19352
- qualifierPositions.forEach((position) => {
19353
- const randomParticipantId = randomPop(qualifyingParticipantIds);
19354
- if (randomParticipantId) {
19381
+ qualifierPositionIndexes.forEach((positionIndex, index) => {
19382
+ const participantToAssign = qualifyingParticipantIds[index];
19383
+ const drawPosition = qualifierPositions[positionIndex].drawPosition;
19384
+ if (participantToAssign) {
19355
19385
  const positionAssignmentResult = qualifierDrawPositionAssignment({
19356
- qualifyingParticipantId: randomParticipantId,
19386
+ qualifyingParticipantId: participantToAssign,
19357
19387
  structureId: mainStructure.structureId,
19358
- drawPosition: position.drawPosition,
19388
+ drawPosition,
19359
19389
  tournamentRecord,
19360
19390
  drawDefinition,
19361
19391
  });
19362
19392
  positionAssignmentResult?.success &&
19363
- assignedParticipants.push({ participantId: randomParticipantId, drawPosition: position.drawPosition });
19393
+ assignedParticipants.push({ participantId: participantToAssign, drawPosition });
19364
19394
  }
19365
19395
  });
19366
19396
  return decorateResult({
@@ -22084,7 +22114,7 @@ function calculatePercentages({ participantResults, groupingTotal, matchUpFormat
22084
22114
  const setsLost = participantResults[participantId].setsLost;
22085
22115
  const setsTotal = tallyPolicy?.groupTotalSetsPlayed || groupingTotal === 'setsPct'
22086
22116
  ? totalSets
22087
- : perPlayer * (bracketSetsToWin || 0) || setsWon + setsLost;
22117
+ : perPlayer * (bracketSetsToWin) || setsWon + setsLost;
22088
22118
  let setsPct = Math.round((setsWon / setsTotal) * precision) / precision;
22089
22119
  if (setsPct === Infinity || isNaN(setsPct))
22090
22120
  setsPct = setsTotal;
@@ -22102,7 +22132,7 @@ function calculatePercentages({ participantResults, groupingTotal, matchUpFormat
22102
22132
  matchUpsPct = matchUpsWon;
22103
22133
  const gamesWon = participantResults[participantId].gamesWon || 0;
22104
22134
  const gamesLost = participantResults[participantId].gamesLost || 0;
22105
- const minimumExpectedGames = (perPlayer || 0) * (bracketSetsToWin || 0) * (bracketGamesForSet || 0);
22135
+ const minimumExpectedGames = (perPlayer || 0) * (bracketSetsToWin) * (bracketGamesForSet || 0);
22106
22136
  const gamesTotal = tallyPolicy?.groupTotalGamesPlayed || groupingTotal === 'gamesPct'
22107
22137
  ? totalGames
22108
22138
  : Math.max(minimumExpectedGames, gamesWon + gamesLost);
@@ -23530,7 +23560,7 @@ function updateTieMatchUpScore(params) {
23530
23560
  }) ||
23531
23561
  {};
23532
23562
  const tournamentId = params.tournamentId || params.tournamentRecord?.tournamentId;
23533
- tournamentRecords && findTournamentId({ tournamentRecords, ...params });
23563
+ findTournamentId({ tournamentRecords, ...params });
23534
23564
  const tournamentRecord = tournamentId && tournamentRecords[tournamentId];
23535
23565
  if (!tournamentRecord)
23536
23566
  return { error: MISSING_TOURNAMENT_RECORD };
@@ -26499,7 +26529,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
26499
26529
  linkType: WINNER,
26500
26530
  drawDefinition,
26501
26531
  structureId,
26502
- }) || {};
26532
+ });
26503
26533
  if (eliminationSoureStructureIds?.length)
26504
26534
  sourceStructureIds.push(...eliminationSoureStructureIds);
26505
26535
  const { sourceStructureIds: roundRobinSourceStructureIds, relevantLinks: roundRobinSourceLinks } = getSourceStructureIdsAndRelevantLinks({
@@ -26507,7 +26537,7 @@ function getValidQualifiersAction({ drawPositionInitialRounds, tournamentPartici
26507
26537
  linkType: POSITION,
26508
26538
  drawDefinition,
26509
26539
  structureId,
26510
- }) || {};
26540
+ });
26511
26541
  if (roundRobinSourceStructureIds?.length)
26512
26542
  sourceStructureIds.push(...roundRobinSourceStructureIds);
26513
26543
  for (const sourceLink of eliminationSourceLinks) {
@@ -26696,7 +26726,7 @@ function positionActions(params) {
26696
26726
  linkType: POSITION,
26697
26727
  drawDefinition,
26698
26728
  structureId,
26699
- }) || {};
26729
+ });
26700
26730
  let sourceStructuresComplete;
26701
26731
  if (positionSourceStructureIds?.length) {
26702
26732
  sourceStructuresComplete = positionSourceStructureIds.every((sourceStructureId) => isCompletedStructure({ structureId: sourceStructureId, drawDefinition }));
@@ -26988,6 +27018,33 @@ function getDrawTypeCoercion({ policyDefinitions, appliedPolicies, drawType }) {
26988
27018
  true);
26989
27019
  }
26990
27020
 
27021
+ const getRandomQualifierList = ({ drawDefinition }) => {
27022
+ const paramsCheck = checkRequiredParameters({ drawDefinition }, [{ [DRAW_DEFINITION]: true }]);
27023
+ if (paramsCheck.error)
27024
+ return paramsCheck;
27025
+ const mainStructure = drawDefinition.structures?.find((structure) => structure.stage === MAIN && structure.stageSequence === 1);
27026
+ if (!mainStructure)
27027
+ return decorateResult({ result: { error: MISSING_MAIN_STRUCTURE } });
27028
+ const { qualifierPositions, } = structureAssignedDrawPositions({ structure: mainStructure });
27029
+ return generateRange(0, qualifierPositions.length).sort(() => Math.random() - 0.5);
27030
+ };
27031
+
27032
+ function isValidForQualifying({ structureId, drawDefinition }) {
27033
+ if (!drawDefinition)
27034
+ return { error: MISSING_DRAW_DEFINITION };
27035
+ if (!isString(structureId))
27036
+ return { error: INVALID_VALUES };
27037
+ const result = getStructureLinks({
27038
+ drawDefinition,
27039
+ structureId,
27040
+ });
27041
+ if (result.error)
27042
+ return result;
27043
+ const targetFeedProfiles = result.links.target.flatMap((t) => t.target.feedProfile).filter(Boolean);
27044
+ const valid = !intersection([BOTTOM_UP, TOP_DOWN, RANDOM, WATERFALL], targetFeedProfiles).length;
27045
+ return { ...SUCCESS, valid };
27046
+ }
27047
+
26991
27048
  function getPositionAssignments({ tournamentRecord, drawDefinition, stage = MAIN, structureId, structure, }) {
26992
27049
  if (!tournamentRecord)
26993
27050
  return { error: MISSING_TOURNAMENT_RECORD };
@@ -27012,22 +27069,6 @@ function getPositionAssignments({ tournamentRecord, drawDefinition, stage = MAIN
27012
27069
  };
27013
27070
  }
27014
27071
 
27015
- function isValidForQualifying({ structureId, drawDefinition }) {
27016
- if (!drawDefinition)
27017
- return { error: MISSING_DRAW_DEFINITION };
27018
- if (!isString(structureId))
27019
- return { error: INVALID_VALUES };
27020
- const result = getStructureLinks({
27021
- drawDefinition,
27022
- structureId,
27023
- });
27024
- if (result.error)
27025
- return result;
27026
- const targetFeedProfiles = result.links.target.flatMap((t) => t.target.feedProfile).filter(Boolean);
27027
- const valid = !intersection([BOTTOM_UP, TOP_DOWN, RANDOM, WATERFALL], targetFeedProfiles).length;
27028
- return { ...SUCCESS, valid };
27029
- }
27030
-
27031
27072
  function getEliminationDrawSize({ participantsCount, participantCount, }) {
27032
27073
  participantsCount = participantsCount ?? participantCount;
27033
27074
  if (!participantsCount)
@@ -27191,6 +27232,7 @@ var query$b = {
27191
27232
  getParticipantIdFinishingPositions: getParticipantIdFinishingPositions,
27192
27233
  getPositionAssignments: getPositionAssignments,
27193
27234
  getPositionsPlayedOff: getPositionsPlayedOff,
27235
+ getRandomQualifierList: getRandomQualifierList,
27194
27236
  getSeedingThresholds: getSeedingThresholds,
27195
27237
  getSeedsCount: getSeedsCount,
27196
27238
  getStructureSeedAssignments: getStructureSeedAssignments,
@@ -27214,7 +27256,7 @@ function generateQualifyingStructures({ hasExistingDrawDefinition, qualifyingPro
27214
27256
  const structureProfiles = roundTargetProfile.structureProfiles || [];
27215
27257
  roundTarget = roundTargetProfile.roundTarget || roundTarget;
27216
27258
  let stageSequence = 1, targetRoundQualifiersCount = 0, finalQualifyingRoundNumber, finalQualifyingStructureId, linkType;
27217
- for (const structureProfile of (structureProfiles || []).sort(sequenceSort)) {
27259
+ for (const structureProfile of (structureProfiles).sort(sequenceSort)) {
27218
27260
  let drawSize = coerceEven(structureProfile.drawSize || structureProfile.participantsCount);
27219
27261
  const { qualifyingRoundNumber, structureOptions, matchUpFormat, structureName, structureId, drawType } = structureProfile;
27220
27262
  const matchUpType = structureProfile.matchUpType;
@@ -33211,7 +33253,7 @@ const definitionTemplate = () => ({
33211
33253
  });
33212
33254
 
33213
33255
  function newDrawDefinition(params) {
33214
- const { drawId = UUID(), processCodes, matchUpType, drawType } = params ?? {};
33256
+ const { drawId = UUID(), processCodes, matchUpType, drawType } = params;
33215
33257
  const drawDefinition = definitionTemplate();
33216
33258
  return Object.assign(drawDefinition, {
33217
33259
  processCodes,
@@ -33994,8 +34036,7 @@ function getTournamentInfo(params) {
33994
34036
  for (const event of tournamentRecord.events ?? []) {
33995
34037
  if (!params?.usePublishState || publishedEventIds.includes(event.eventId)) {
33996
34038
  const info = extractEventInfo({ event }).eventInfo;
33997
- if (info)
33998
- eventInfo.push(info);
34039
+ eventInfo.push(info);
33999
34040
  }
34000
34041
  }
34001
34042
  tournamentInfo.timeItemValues = getTimeItemValues({ element: tournamentRecord });
@@ -38206,6 +38247,7 @@ var index$f = {
38206
38247
  getPredictiveAccuracy: getPredictiveAccuracy,
38207
38248
  getProfileRounds: getProfileRounds,
38208
38249
  getPublishState: getPublishState,
38250
+ getRandomQualifierList: getRandomQualifierList,
38209
38251
  getRoundMatchUps: getRoundMatchUps,
38210
38252
  getRounds: getRounds,
38211
38253
  getScaleValues: getScaleValues,
@@ -38545,6 +38587,7 @@ var index$e = {
38545
38587
  getParticipantIdFinishingPositions: getParticipantIdFinishingPositions,
38546
38588
  getPositionAssignments: getPositionAssignments,
38547
38589
  getPositionsPlayedOff: getPositionsPlayedOff,
38590
+ getRandomQualifierList: getRandomQualifierList,
38548
38591
  getSeedingThresholds: getSeedingThresholds,
38549
38592
  getSeedsCount: getSeedsCount,
38550
38593
  getStructureSeedAssignments: getStructureSeedAssignments,
@@ -49317,10 +49360,10 @@ function genRatings(params) {
49317
49360
  const { categoryName, ageCategoryCode, ratingType } = category;
49318
49361
  const scaleName = category.categoryName || category.ratingType || category.ageCategoryCode;
49319
49362
  if ((categoryName || ageCategoryCode) && !ratingType) {
49320
- const [start, end] = rankingRange || [];
49363
+ const [start, end] = rankingRange;
49321
49364
  singlesRankings[scaleName] = shuffleArray(generateRange(start, end)).slice(0, scaledParticipantsCount || randomInt(20, 30));
49322
49365
  if ([PAIR, TEAM].includes(participantType)) {
49323
- const [start, end] = rankingRange || [];
49366
+ const [start, end] = rankingRange;
49324
49367
  doublesRankings[scaleName] = shuffleArray(generateRange(start, end)).slice(0, scaledParticipantsCount || randomInt(20, 30));
49325
49368
  }
49326
49369
  }
@@ -53947,12 +53990,12 @@ function getStructureReports(params) {
53947
53990
  participant: individualParticipants?.[0] || winningParticipant,
53948
53991
  eventType,
53949
53992
  });
53950
- const { personId: winningPersonId, personOtherId: winningPersonOtherId, tennisId: winningPersonTennisId, confidence: confidence1, wtnRating: wtnRating1, } = winningPersonWTN || {};
53993
+ const { personId: winningPersonId, personOtherId: winningPersonOtherId, tennisId: winningPersonTennisId, confidence: confidence1, wtnRating: wtnRating1, } = winningPersonWTN;
53951
53994
  const winningPerson2WTN = getDetailsWTN({
53952
53995
  participant: individualParticipants?.[1],
53953
53996
  eventType,
53954
53997
  });
53955
- const { personId: winningPerson2Id, personOtherId: winningPerson2OtherId, tennisId: winningPerson2TennisId, confidence: confidence2, wtnRating: wtnRating2, } = winningPerson2WTN || {};
53998
+ const { personId: winningPerson2Id, personOtherId: winningPerson2OtherId, tennisId: winningPerson2TennisId, confidence: confidence2, wtnRating: wtnRating2, } = winningPerson2WTN;
53956
53999
  const { ageCategoryCode, categoryName, subType } = category ?? {};
53957
54000
  const matchUpFormat = s.matchUpFormat || drawMatchUpFormat;
53958
54001
  const matchUpsInitialFormat = matchUpFormatCounts[matchUpFormat] || 0;