@xcpcio/core 0.79.0 → 0.79.2

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.cjs CHANGED
@@ -1053,6 +1053,7 @@ class BattleOfGiants {
1053
1053
  }
1054
1054
 
1055
1055
  class ContestOptions {
1056
+ enableOrganization;
1056
1057
  calculationOfPenalty;
1057
1058
  submissionTimestampUnit;
1058
1059
  submissionHasTimeField;
@@ -1066,6 +1067,7 @@ class ContestOptions {
1066
1067
  teamWebcamStreamUrlTemplate;
1067
1068
  teamScreenStreamUrlTemplate;
1068
1069
  constructor() {
1070
+ this.enableOrganization = false;
1069
1071
  this.calculationOfPenalty = "in_minutes";
1070
1072
  this.submissionTimestampUnit = "second";
1071
1073
  this.submissionHasTimeField = false;
@@ -1078,6 +1080,7 @@ class ContestOptions {
1078
1080
  function createContestOptions(contestOptionsJSON = {}) {
1079
1081
  const j = contestOptionsJSON;
1080
1082
  const o = new ContestOptions();
1083
+ o.enableOrganization = !!j.enable_organization;
1081
1084
  if (j.calculation_of_penalty) {
1082
1085
  o.calculationOfPenalty = j.calculation_of_penalty;
1083
1086
  }
@@ -1164,8 +1167,6 @@ class Contest {
1164
1167
  problems;
1165
1168
  problemsMap;
1166
1169
  statusTimeDisplay;
1167
- badge;
1168
- organization;
1169
1170
  medal;
1170
1171
  awards;
1171
1172
  group;
@@ -1327,8 +1328,6 @@ function createContest(contestJSON) {
1327
1328
  pending: Boolean(contestJSON.status_time_display.pending ?? false)
1328
1329
  };
1329
1330
  }
1330
- c.badge = contestJSON.badge;
1331
- c.organization = contestJSON.organization;
1332
1331
  c.medal = contestJSON.medal;
1333
1332
  (() => {
1334
1333
  if (contestJSON.medal === void 0 || contestJSON.medal === null) {
@@ -1680,9 +1679,9 @@ class GeneralExcelConverter {
1680
1679
  {
1681
1680
  const head = [];
1682
1681
  head.push("Rank");
1683
- if (rank.contest.organization) {
1684
- head.push(`${rank.contest.organization} Rank`);
1685
- head.push(rank.contest.organization);
1682
+ if (rank.contest.options.enableOrganization) {
1683
+ head.push("Organization Rank");
1684
+ head.push("Organization");
1686
1685
  }
1687
1686
  head.push("Team", "Solved", "Penalty", ...rank.contest.problems.map((p) => p.label), "Dirt");
1688
1687
  if (enableAwards) {
@@ -1866,6 +1865,8 @@ class RankOptions {
1866
1865
  filterOrganizationMap;
1867
1866
  filterTeams;
1868
1867
  filterTeamMap;
1868
+ filterTeamIds;
1869
+ filterTeamIdMap;
1869
1870
  enableAnimatedSubmissions;
1870
1871
  battleOfGiants;
1871
1872
  constructor() {
@@ -1878,6 +1879,8 @@ class RankOptions {
1878
1879
  this.filterOrganizationMap = /* @__PURE__ */ new Map();
1879
1880
  this.filterTeams = [];
1880
1881
  this.filterTeamMap = /* @__PURE__ */ new Map();
1882
+ this.filterTeamIds = [];
1883
+ this.filterTeamIdMap = /* @__PURE__ */ new Map();
1881
1884
  this.enableAnimatedSubmissions = false;
1882
1885
  this.battleOfGiants = new BattleOfGiants();
1883
1886
  }
@@ -1891,6 +1894,8 @@ class RankOptions {
1891
1894
  this.filterOrganizationMap = self.filterOrganizationMap;
1892
1895
  this.filterTeams = self.filterTeams;
1893
1896
  this.filterTeamMap = self.filterTeamMap;
1897
+ this.filterTeamIds = self.filterTeamIds;
1898
+ this.filterTeamIdMap = self.filterTeamIdMap;
1894
1899
  this.enableAnimatedSubmissions = self.enableAnimatedSubmissions;
1895
1900
  this.battleOfGiants = self.battleOfGiants;
1896
1901
  }
@@ -1929,6 +1934,14 @@ class RankOptions {
1929
1934
  this.filterTeams = filterTeams;
1930
1935
  this.filterTeamMap = m;
1931
1936
  }
1937
+ setFilterTeamIds(filterTeamIds) {
1938
+ const m = /* @__PURE__ */ new Map();
1939
+ filterTeamIds.forEach((item) => {
1940
+ m.set(item.value, item);
1941
+ });
1942
+ this.filterTeamIds = filterTeamIds;
1943
+ this.filterTeamIdMap = m;
1944
+ }
1932
1945
  isNeedReBuildRank(nextRankOptions) {
1933
1946
  if (this.enableFilterSubmissionsByTimestamp !== nextRankOptions.enableFilterSubmissionsByTimestamp) {
1934
1947
  return true;
@@ -2023,7 +2036,7 @@ class Rank {
2023
2036
  });
2024
2037
  }
2025
2038
  buildOrganizationsMap() {
2026
- if (!this.contest.organization) {
2039
+ if (!this.contest.options.enableOrganization) {
2027
2040
  return /* @__PURE__ */ new Map();
2028
2041
  }
2029
2042
  const res = /* @__PURE__ */ new Map();
@@ -2209,7 +2222,7 @@ class Rank {
2209
2222
  }
2210
2223
  }
2211
2224
  buildOrgRank() {
2212
- if (!this.contest.organization) {
2225
+ if (!this.contest.options.enableOrganization) {
2213
2226
  return;
2214
2227
  }
2215
2228
  let rank = 1;
package/dist/index.d.cts CHANGED
@@ -20,6 +20,7 @@ declare function isValidMedalType(medal: MedalType): boolean;
20
20
  type Awards = Map<string, Award[]>;
21
21
 
22
22
  declare class ContestOptions {
23
+ enableOrganization: boolean;
23
24
  calculationOfPenalty: CalculationOfPenalty;
24
25
  submissionTimestampUnit: TimeUnit;
25
26
  submissionHasTimeField: boolean;
@@ -171,8 +172,6 @@ declare class Contest {
171
172
  problems: Problems;
172
173
  problemsMap: Map<string, Problem>;
173
174
  statusTimeDisplay: StatusTimeDisplay;
174
- badge?: string;
175
- organization?: string;
176
175
  medal?: Record<string, Record<string, number>> | MedalPreset;
177
176
  awards?: Awards;
178
177
  group: Map<string, Group>;
@@ -372,6 +371,8 @@ declare class RankOptions {
372
371
  filterOrganizationMap: Map<string, SelectOptionItem>;
373
372
  filterTeams: Array<SelectOptionItem>;
374
373
  filterTeamMap: Map<string, SelectOptionItem>;
374
+ filterTeamIds: Array<SelectOptionItem>;
375
+ filterTeamIdMap: Map<string, SelectOptionItem>;
375
376
  enableAnimatedSubmissions: boolean;
376
377
  battleOfGiants: BattleOfGiants;
377
378
  constructor();
@@ -382,6 +383,7 @@ declare class RankOptions {
382
383
  disableFilterTeamsByGroup(): void;
383
384
  setFilterOrganizations(filterOrganizations: Array<SelectOptionItem>): void;
384
385
  setFilterTeams(filterTeams: Array<SelectOptionItem>): void;
386
+ setFilterTeamIds(filterTeamIds: Array<SelectOptionItem>): void;
385
387
  isNeedReBuildRank(nextRankOptions: RankOptions): boolean;
386
388
  }
387
389
  declare class Rank {
package/dist/index.d.mts CHANGED
@@ -20,6 +20,7 @@ declare function isValidMedalType(medal: MedalType): boolean;
20
20
  type Awards = Map<string, Award[]>;
21
21
 
22
22
  declare class ContestOptions {
23
+ enableOrganization: boolean;
23
24
  calculationOfPenalty: CalculationOfPenalty;
24
25
  submissionTimestampUnit: TimeUnit;
25
26
  submissionHasTimeField: boolean;
@@ -171,8 +172,6 @@ declare class Contest {
171
172
  problems: Problems;
172
173
  problemsMap: Map<string, Problem>;
173
174
  statusTimeDisplay: StatusTimeDisplay;
174
- badge?: string;
175
- organization?: string;
176
175
  medal?: Record<string, Record<string, number>> | MedalPreset;
177
176
  awards?: Awards;
178
177
  group: Map<string, Group>;
@@ -372,6 +371,8 @@ declare class RankOptions {
372
371
  filterOrganizationMap: Map<string, SelectOptionItem>;
373
372
  filterTeams: Array<SelectOptionItem>;
374
373
  filterTeamMap: Map<string, SelectOptionItem>;
374
+ filterTeamIds: Array<SelectOptionItem>;
375
+ filterTeamIdMap: Map<string, SelectOptionItem>;
375
376
  enableAnimatedSubmissions: boolean;
376
377
  battleOfGiants: BattleOfGiants;
377
378
  constructor();
@@ -382,6 +383,7 @@ declare class RankOptions {
382
383
  disableFilterTeamsByGroup(): void;
383
384
  setFilterOrganizations(filterOrganizations: Array<SelectOptionItem>): void;
384
385
  setFilterTeams(filterTeams: Array<SelectOptionItem>): void;
386
+ setFilterTeamIds(filterTeamIds: Array<SelectOptionItem>): void;
385
387
  isNeedReBuildRank(nextRankOptions: RankOptions): boolean;
386
388
  }
387
389
  declare class Rank {
package/dist/index.d.ts CHANGED
@@ -20,6 +20,7 @@ declare function isValidMedalType(medal: MedalType): boolean;
20
20
  type Awards = Map<string, Award[]>;
21
21
 
22
22
  declare class ContestOptions {
23
+ enableOrganization: boolean;
23
24
  calculationOfPenalty: CalculationOfPenalty;
24
25
  submissionTimestampUnit: TimeUnit;
25
26
  submissionHasTimeField: boolean;
@@ -171,8 +172,6 @@ declare class Contest {
171
172
  problems: Problems;
172
173
  problemsMap: Map<string, Problem>;
173
174
  statusTimeDisplay: StatusTimeDisplay;
174
- badge?: string;
175
- organization?: string;
176
175
  medal?: Record<string, Record<string, number>> | MedalPreset;
177
176
  awards?: Awards;
178
177
  group: Map<string, Group>;
@@ -372,6 +371,8 @@ declare class RankOptions {
372
371
  filterOrganizationMap: Map<string, SelectOptionItem>;
373
372
  filterTeams: Array<SelectOptionItem>;
374
373
  filterTeamMap: Map<string, SelectOptionItem>;
374
+ filterTeamIds: Array<SelectOptionItem>;
375
+ filterTeamIdMap: Map<string, SelectOptionItem>;
375
376
  enableAnimatedSubmissions: boolean;
376
377
  battleOfGiants: BattleOfGiants;
377
378
  constructor();
@@ -382,6 +383,7 @@ declare class RankOptions {
382
383
  disableFilterTeamsByGroup(): void;
383
384
  setFilterOrganizations(filterOrganizations: Array<SelectOptionItem>): void;
384
385
  setFilterTeams(filterTeams: Array<SelectOptionItem>): void;
386
+ setFilterTeamIds(filterTeamIds: Array<SelectOptionItem>): void;
385
387
  isNeedReBuildRank(nextRankOptions: RankOptions): boolean;
386
388
  }
387
389
  declare class Rank {
package/dist/index.mjs CHANGED
@@ -1022,6 +1022,7 @@ class BattleOfGiants {
1022
1022
  }
1023
1023
 
1024
1024
  class ContestOptions {
1025
+ enableOrganization;
1025
1026
  calculationOfPenalty;
1026
1027
  submissionTimestampUnit;
1027
1028
  submissionHasTimeField;
@@ -1035,6 +1036,7 @@ class ContestOptions {
1035
1036
  teamWebcamStreamUrlTemplate;
1036
1037
  teamScreenStreamUrlTemplate;
1037
1038
  constructor() {
1039
+ this.enableOrganization = false;
1038
1040
  this.calculationOfPenalty = "in_minutes";
1039
1041
  this.submissionTimestampUnit = "second";
1040
1042
  this.submissionHasTimeField = false;
@@ -1047,6 +1049,7 @@ class ContestOptions {
1047
1049
  function createContestOptions(contestOptionsJSON = {}) {
1048
1050
  const j = contestOptionsJSON;
1049
1051
  const o = new ContestOptions();
1052
+ o.enableOrganization = !!j.enable_organization;
1050
1053
  if (j.calculation_of_penalty) {
1051
1054
  o.calculationOfPenalty = j.calculation_of_penalty;
1052
1055
  }
@@ -1133,8 +1136,6 @@ class Contest {
1133
1136
  problems;
1134
1137
  problemsMap;
1135
1138
  statusTimeDisplay;
1136
- badge;
1137
- organization;
1138
1139
  medal;
1139
1140
  awards;
1140
1141
  group;
@@ -1296,8 +1297,6 @@ function createContest(contestJSON) {
1296
1297
  pending: Boolean(contestJSON.status_time_display.pending ?? false)
1297
1298
  };
1298
1299
  }
1299
- c.badge = contestJSON.badge;
1300
- c.organization = contestJSON.organization;
1301
1300
  c.medal = contestJSON.medal;
1302
1301
  (() => {
1303
1302
  if (contestJSON.medal === void 0 || contestJSON.medal === null) {
@@ -1649,9 +1648,9 @@ class GeneralExcelConverter {
1649
1648
  {
1650
1649
  const head = [];
1651
1650
  head.push("Rank");
1652
- if (rank.contest.organization) {
1653
- head.push(`${rank.contest.organization} Rank`);
1654
- head.push(rank.contest.organization);
1651
+ if (rank.contest.options.enableOrganization) {
1652
+ head.push("Organization Rank");
1653
+ head.push("Organization");
1655
1654
  }
1656
1655
  head.push("Team", "Solved", "Penalty", ...rank.contest.problems.map((p) => p.label), "Dirt");
1657
1656
  if (enableAwards) {
@@ -1835,6 +1834,8 @@ class RankOptions {
1835
1834
  filterOrganizationMap;
1836
1835
  filterTeams;
1837
1836
  filterTeamMap;
1837
+ filterTeamIds;
1838
+ filterTeamIdMap;
1838
1839
  enableAnimatedSubmissions;
1839
1840
  battleOfGiants;
1840
1841
  constructor() {
@@ -1847,6 +1848,8 @@ class RankOptions {
1847
1848
  this.filterOrganizationMap = /* @__PURE__ */ new Map();
1848
1849
  this.filterTeams = [];
1849
1850
  this.filterTeamMap = /* @__PURE__ */ new Map();
1851
+ this.filterTeamIds = [];
1852
+ this.filterTeamIdMap = /* @__PURE__ */ new Map();
1850
1853
  this.enableAnimatedSubmissions = false;
1851
1854
  this.battleOfGiants = new BattleOfGiants();
1852
1855
  }
@@ -1860,6 +1863,8 @@ class RankOptions {
1860
1863
  this.filterOrganizationMap = self.filterOrganizationMap;
1861
1864
  this.filterTeams = self.filterTeams;
1862
1865
  this.filterTeamMap = self.filterTeamMap;
1866
+ this.filterTeamIds = self.filterTeamIds;
1867
+ this.filterTeamIdMap = self.filterTeamIdMap;
1863
1868
  this.enableAnimatedSubmissions = self.enableAnimatedSubmissions;
1864
1869
  this.battleOfGiants = self.battleOfGiants;
1865
1870
  }
@@ -1898,6 +1903,14 @@ class RankOptions {
1898
1903
  this.filterTeams = filterTeams;
1899
1904
  this.filterTeamMap = m;
1900
1905
  }
1906
+ setFilterTeamIds(filterTeamIds) {
1907
+ const m = /* @__PURE__ */ new Map();
1908
+ filterTeamIds.forEach((item) => {
1909
+ m.set(item.value, item);
1910
+ });
1911
+ this.filterTeamIds = filterTeamIds;
1912
+ this.filterTeamIdMap = m;
1913
+ }
1901
1914
  isNeedReBuildRank(nextRankOptions) {
1902
1915
  if (this.enableFilterSubmissionsByTimestamp !== nextRankOptions.enableFilterSubmissionsByTimestamp) {
1903
1916
  return true;
@@ -1992,7 +2005,7 @@ class Rank {
1992
2005
  });
1993
2006
  }
1994
2007
  buildOrganizationsMap() {
1995
- if (!this.contest.organization) {
2008
+ if (!this.contest.options.enableOrganization) {
1996
2009
  return /* @__PURE__ */ new Map();
1997
2010
  }
1998
2011
  const res = /* @__PURE__ */ new Map();
@@ -2178,7 +2191,7 @@ class Rank {
2178
2191
  }
2179
2192
  }
2180
2193
  buildOrgRank() {
2181
- if (!this.contest.organization) {
2194
+ if (!this.contest.options.enableOrganization) {
2182
2195
  return;
2183
2196
  }
2184
2197
  let rank = 1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xcpcio/core",
3
3
  "type": "module",
4
- "version": "0.79.0",
4
+ "version": "0.79.2",
5
5
  "description": "The core library for XCPCIO",
6
6
  "author": "Dup4 <hi@dup4.com>",
7
7
  "license": "MIT",
@@ -42,7 +42,7 @@
42
42
  "papaparse": "^5.5.3",
43
43
  "string-width": "^8.1.0",
44
44
  "xlsx-js-style": "^1.2.0",
45
- "@xcpcio/types": "0.79.0"
45
+ "@xcpcio/types": "0.79.2"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@babel/types": "^7.28.6",