tods-competition-factory 0.320.0 → 0.321.0

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.
@@ -11324,7 +11324,7 @@ function getValidSeedBlocks({
11324
11324
  isLucky
11325
11325
  };
11326
11326
  }
11327
- function getContainerBlocks({ seedingProfile, structure, seedBlocks }) {
11327
+ function getContainerBlocks({ seedingProfile, structure }) {
11328
11328
  var _a;
11329
11329
  const containedStructures = structure.structures || [];
11330
11330
  const roundRobinGroupsCount = containedStructures.length;
@@ -11332,12 +11332,6 @@ function getContainerBlocks({ seedingProfile, structure, seedBlocks }) {
11332
11332
  structure
11333
11333
  })) == null ? void 0 : _a.positionAssignments;
11334
11334
  const positioning = getSeedPattern(seedingProfile);
11335
- if (!seedBlocks) {
11336
- seedBlocks = getSeedBlocks({
11337
- participantsCount: positionAssignments == null ? void 0 : positionAssignments.length,
11338
- roundRobinGroupsCount
11339
- }).seedBlocks;
11340
- }
11341
11335
  const { seedGroups } = getSeedGroups({
11342
11336
  drawSize: positionAssignments.length,
11343
11337
  roundRobinGroupsCount
@@ -16386,6 +16380,7 @@ function positionByes({
16386
16380
  seedsOnly,
16387
16381
  event
16388
16382
  }) {
16383
+ var _a;
16389
16384
  if (!structure)
16390
16385
  ({ structure } = findStructure({ drawDefinition, structureId }));
16391
16386
  if (!structureId)
@@ -16411,8 +16406,10 @@ function positionByes({
16411
16406
  seedBlckInfo,
16412
16407
  structure
16413
16408
  });
16409
+ const ignoreSeededByes = (_a = appliedPolicies == null ? void 0 : appliedPolicies.seeding) == null ? void 0 : _a.containerByesIgnoreSeeding;
16414
16410
  const seedOrderByePositions = blockOrdered ? blockSeedOrderByePositions : strictSeedOrderByePositions;
16415
16411
  const { unseededByePositions } = getUnseededByePositions({
16412
+ ignoreSeededByes,
16416
16413
  appliedPolicies,
16417
16414
  drawDefinition,
16418
16415
  seedBlckInfo,
@@ -16420,10 +16417,15 @@ function positionByes({
16420
16417
  isFeedIn,
16421
16418
  isLucky
16422
16419
  });
16423
- const byePositions = [].concat(
16420
+ let byePositions = [].concat(
16424
16421
  ...seedOrderByePositions,
16425
16422
  ...seedsOnly ? [] : unseededByePositions
16426
16423
  );
16424
+ if (ignoreSeededByes) {
16425
+ byePositions = shuffleArray(byePositions);
16426
+ if (getDevContext({ ignoreSeededByes }))
16427
+ console.log({ byePositions });
16428
+ }
16427
16429
  const byeDrawPositions = byePositions.slice(0, byesToPlace);
16428
16430
  for (const drawPosition of byeDrawPositions) {
16429
16431
  const result = assignDrawPositionBye({
@@ -18960,28 +18962,18 @@ function addDrawDefinition({
18960
18962
  const incomingMatchUps = (_j = allDrawMatchUps({
18961
18963
  drawDefinition
18962
18964
  })) == null ? void 0 : _j.matchUps;
18963
- const incomingMatchUpIds = incomingMatchUps == null ? void 0 : incomingMatchUps.map(getMatchUpId);
18964
- const deletedMatchUpIds = existingMatchUpIds.filter(
18965
- (matchUpId) => !incomingMatchUpIds.includes(matchUpId)
18966
- );
18967
- const addedMatchUpIds = incomingMatchUpIds.filter(
18968
- (matchUpId) => !existingMatchUpIds.includes(matchUpId)
18969
- );
18970
18965
  if (!suppressNotifications) {
18971
- if (deletedMatchUpIds == null ? void 0 : deletedMatchUpIds.length) {
18966
+ if (existingMatchUpIds == null ? void 0 : existingMatchUpIds.length) {
18972
18967
  deleteMatchUpsNotice({
18973
- matchUpIds: deletedMatchUpIds,
18974
- action: "modifyDrawDefiniton",
18968
+ matchUpIds: existingMatchUpIds,
18969
+ action: "modifyDrawDefinition",
18975
18970
  tournamentId,
18976
18971
  eventId
18977
18972
  });
18978
18973
  }
18979
- if (addedMatchUpIds == null ? void 0 : addedMatchUpIds.length) {
18980
- const addedMatchUps = incomingMatchUps.filter(
18981
- ({ matchUpId }) => addedMatchUpIds.includes(matchUpId)
18982
- );
18974
+ if (incomingMatchUps == null ? void 0 : incomingMatchUps.length) {
18983
18975
  addMatchUpsNotice({
18984
- matchUps: addedMatchUps,
18976
+ matchUps: incomingMatchUps,
18985
18977
  tournamentId,
18986
18978
  eventId
18987
18979
  });