@xcpcio/core 0.83.2 → 0.84.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.
- package/dist/index.cjs +49 -0
- package/dist/index.d.cts +20 -2
- package/dist/index.d.mts +20 -2
- package/dist/index.d.ts +20 -2
- package/dist/index.mjs +46 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1158,6 +1158,47 @@ function createOrganizations(orgsJSON) {
|
|
|
1158
1158
|
return orgsJSON.map((org) => createOrganization(org));
|
|
1159
1159
|
}
|
|
1160
1160
|
|
|
1161
|
+
class SeatMapSection {
|
|
1162
|
+
title;
|
|
1163
|
+
rowLabels;
|
|
1164
|
+
grid;
|
|
1165
|
+
constructor() {
|
|
1166
|
+
this.title = new I18nText();
|
|
1167
|
+
this.rowLabels = [];
|
|
1168
|
+
this.grid = [];
|
|
1169
|
+
}
|
|
1170
|
+
}
|
|
1171
|
+
class SeatMap {
|
|
1172
|
+
sections;
|
|
1173
|
+
constructor() {
|
|
1174
|
+
this.sections = [];
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
1178
|
+
*/
|
|
1179
|
+
buildSeatToTeamMap(teams) {
|
|
1180
|
+
const map = /* @__PURE__ */ new Map();
|
|
1181
|
+
for (const team of teams) {
|
|
1182
|
+
if (team.location) {
|
|
1183
|
+
map.set(team.location, team);
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
return map;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1189
|
+
function createSeatMapSection(sectionJSON) {
|
|
1190
|
+
const s = new SeatMapSection();
|
|
1191
|
+
s.title = I18nText.fromIText(sectionJSON.title ?? "");
|
|
1192
|
+
s.rowLabels = sectionJSON.rowLabels ?? [];
|
|
1193
|
+
s.grid = sectionJSON.grid ?? [];
|
|
1194
|
+
return s;
|
|
1195
|
+
}
|
|
1196
|
+
function createSeatMap(seatMapJSON) {
|
|
1197
|
+
const sm = new SeatMap();
|
|
1198
|
+
sm.sections = (seatMapJSON.sections ?? []).map(createSeatMapSection);
|
|
1199
|
+
return sm;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1161
1202
|
class Contest {
|
|
1162
1203
|
id = "";
|
|
1163
1204
|
name;
|
|
@@ -1187,6 +1228,7 @@ class Contest {
|
|
|
1187
1228
|
socialMedia;
|
|
1188
1229
|
options;
|
|
1189
1230
|
organizations;
|
|
1231
|
+
seatMap;
|
|
1190
1232
|
constructor() {
|
|
1191
1233
|
this.name = new I18nText();
|
|
1192
1234
|
this.startTime = createDayJS();
|
|
@@ -1413,6 +1455,9 @@ function createContest(contestJSON) {
|
|
|
1413
1455
|
if (contestJSON.organizations) {
|
|
1414
1456
|
c.organizations = createOrganizations(contestJSON.organizations);
|
|
1415
1457
|
}
|
|
1458
|
+
if (contestJSON.seat_map && !("url" in contestJSON.seat_map)) {
|
|
1459
|
+
c.seatMap = createSeatMap(contestJSON.seat_map);
|
|
1460
|
+
}
|
|
1416
1461
|
return c;
|
|
1417
1462
|
}
|
|
1418
1463
|
|
|
@@ -3009,6 +3054,8 @@ exports.RatingUser = RatingUser;
|
|
|
3009
3054
|
exports.RatingUtility = RatingUtility;
|
|
3010
3055
|
exports.Resolver = Resolver;
|
|
3011
3056
|
exports.ResolverVue = ResolverVue;
|
|
3057
|
+
exports.SeatMap = SeatMap;
|
|
3058
|
+
exports.SeatMapSection = SeatMapSection;
|
|
3012
3059
|
exports.Submission = Submission;
|
|
3013
3060
|
exports.Team = Team;
|
|
3014
3061
|
exports.TeamProblemStatistics = TeamProblemStatistics;
|
|
@@ -3023,6 +3070,8 @@ exports.createPersons = createPersons;
|
|
|
3023
3070
|
exports.createProblem = createProblem;
|
|
3024
3071
|
exports.createProblems = createProblems;
|
|
3025
3072
|
exports.createProblemsByProblemIds = createProblemsByProblemIds;
|
|
3073
|
+
exports.createSeatMap = createSeatMap;
|
|
3074
|
+
exports.createSeatMapSection = createSeatMapSection;
|
|
3026
3075
|
exports.createSubmission = createSubmission;
|
|
3027
3076
|
exports.createSubmissions = createSubmissions;
|
|
3028
3077
|
exports.createTeam = createTeam;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
1
|
+
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, SeatMapSection as SeatMapSection$1, SeatMap as SeatMap$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
export { default as dayjs } from 'dayjs';
|
|
4
4
|
import * as XLSX from 'xlsx-js-style';
|
|
@@ -140,6 +140,23 @@ type Organizations = Array<Organization>;
|
|
|
140
140
|
declare function createOrganization(orgJSON: Organization$1): Organization;
|
|
141
141
|
declare function createOrganizations(orgsJSON: Organizations$1): Organizations;
|
|
142
142
|
|
|
143
|
+
declare class SeatMapSection {
|
|
144
|
+
title: I18nText;
|
|
145
|
+
rowLabels: Array<string | null>;
|
|
146
|
+
grid: Array<Array<string | null>>;
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
declare class SeatMap {
|
|
150
|
+
sections: Array<SeatMapSection>;
|
|
151
|
+
constructor();
|
|
152
|
+
/**
|
|
153
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
154
|
+
*/
|
|
155
|
+
buildSeatToTeamMap(teams: Teams): Map<string, Team>;
|
|
156
|
+
}
|
|
157
|
+
declare function createSeatMapSection(sectionJSON: SeatMapSection$1): SeatMapSection;
|
|
158
|
+
declare function createSeatMap(seatMapJSON: SeatMap$1): SeatMap;
|
|
159
|
+
|
|
143
160
|
declare class Group {
|
|
144
161
|
name: I18nText;
|
|
145
162
|
isDefault: boolean;
|
|
@@ -186,6 +203,7 @@ declare class Contest {
|
|
|
186
203
|
socialMedia?: SocialMedia;
|
|
187
204
|
options: ContestOptions;
|
|
188
205
|
organizations?: Organizations;
|
|
206
|
+
seatMap?: SeatMap;
|
|
189
207
|
constructor();
|
|
190
208
|
getStartTime(): dayjs.Dayjs;
|
|
191
209
|
getEndTime(): dayjs.Dayjs;
|
|
@@ -573,5 +591,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
573
591
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
574
592
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
575
593
|
|
|
576
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
594
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
577
595
|
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
1
|
+
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, SeatMapSection as SeatMapSection$1, SeatMap as SeatMap$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
export { default as dayjs } from 'dayjs';
|
|
4
4
|
import * as XLSX from 'xlsx-js-style';
|
|
@@ -140,6 +140,23 @@ type Organizations = Array<Organization>;
|
|
|
140
140
|
declare function createOrganization(orgJSON: Organization$1): Organization;
|
|
141
141
|
declare function createOrganizations(orgsJSON: Organizations$1): Organizations;
|
|
142
142
|
|
|
143
|
+
declare class SeatMapSection {
|
|
144
|
+
title: I18nText;
|
|
145
|
+
rowLabels: Array<string | null>;
|
|
146
|
+
grid: Array<Array<string | null>>;
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
declare class SeatMap {
|
|
150
|
+
sections: Array<SeatMapSection>;
|
|
151
|
+
constructor();
|
|
152
|
+
/**
|
|
153
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
154
|
+
*/
|
|
155
|
+
buildSeatToTeamMap(teams: Teams): Map<string, Team>;
|
|
156
|
+
}
|
|
157
|
+
declare function createSeatMapSection(sectionJSON: SeatMapSection$1): SeatMapSection;
|
|
158
|
+
declare function createSeatMap(seatMapJSON: SeatMap$1): SeatMap;
|
|
159
|
+
|
|
143
160
|
declare class Group {
|
|
144
161
|
name: I18nText;
|
|
145
162
|
isDefault: boolean;
|
|
@@ -186,6 +203,7 @@ declare class Contest {
|
|
|
186
203
|
socialMedia?: SocialMedia;
|
|
187
204
|
options: ContestOptions;
|
|
188
205
|
organizations?: Organizations;
|
|
206
|
+
seatMap?: SeatMap;
|
|
189
207
|
constructor();
|
|
190
208
|
getStartTime(): dayjs.Dayjs;
|
|
191
209
|
getEndTime(): dayjs.Dayjs;
|
|
@@ -573,5 +591,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
573
591
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
574
592
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
575
593
|
|
|
576
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
594
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
577
595
|
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
1
|
+
import { CalculationOfPenalty, TimeUnit, Image, Lang, I18NStringSet, Text, Person as Person$1, Persons as Persons$1, Team as Team$1, Teams as Teams$1, Organization as Organization$1, Organizations as Organizations$1, SeatMapSection as SeatMapSection$1, SeatMap as SeatMap$1, StatusTimeDisplay, MedalPreset, BannerMode, SocialMedia, ContestState, Contest as Contest$1, SubmissionReaction, SubmissionStatus, Submission as Submission$1, Submissions as Submissions$1, BalloonColor, Problem as Problem$1, Problems as Problems$1, ContestIndex as ContestIndex$1, IRatingHistory, IRatingUser, IRating } from '@xcpcio/types';
|
|
2
2
|
import dayjs from 'dayjs';
|
|
3
3
|
export { default as dayjs } from 'dayjs';
|
|
4
4
|
import * as XLSX from 'xlsx-js-style';
|
|
@@ -140,6 +140,23 @@ type Organizations = Array<Organization>;
|
|
|
140
140
|
declare function createOrganization(orgJSON: Organization$1): Organization;
|
|
141
141
|
declare function createOrganizations(orgsJSON: Organizations$1): Organizations;
|
|
142
142
|
|
|
143
|
+
declare class SeatMapSection {
|
|
144
|
+
title: I18nText;
|
|
145
|
+
rowLabels: Array<string | null>;
|
|
146
|
+
grid: Array<Array<string | null>>;
|
|
147
|
+
constructor();
|
|
148
|
+
}
|
|
149
|
+
declare class SeatMap {
|
|
150
|
+
sections: Array<SeatMapSection>;
|
|
151
|
+
constructor();
|
|
152
|
+
/**
|
|
153
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
154
|
+
*/
|
|
155
|
+
buildSeatToTeamMap(teams: Teams): Map<string, Team>;
|
|
156
|
+
}
|
|
157
|
+
declare function createSeatMapSection(sectionJSON: SeatMapSection$1): SeatMapSection;
|
|
158
|
+
declare function createSeatMap(seatMapJSON: SeatMap$1): SeatMap;
|
|
159
|
+
|
|
143
160
|
declare class Group {
|
|
144
161
|
name: I18nText;
|
|
145
162
|
isDefault: boolean;
|
|
@@ -186,6 +203,7 @@ declare class Contest {
|
|
|
186
203
|
socialMedia?: SocialMedia;
|
|
187
204
|
options: ContestOptions;
|
|
188
205
|
organizations?: Organizations;
|
|
206
|
+
seatMap?: SeatMap;
|
|
189
207
|
constructor();
|
|
190
208
|
getStartTime(): dayjs.Dayjs;
|
|
191
209
|
getEndTime(): dayjs.Dayjs;
|
|
@@ -573,5 +591,5 @@ declare function isRejected(status: SubmissionStatus): boolean;
|
|
|
573
591
|
declare function isPending(status: SubmissionStatus): boolean;
|
|
574
592
|
declare function isNotCalculatedPenaltyStatus(status: SubmissionStatus): boolean;
|
|
575
593
|
|
|
576
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
594
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
577
595
|
export type { Awards, Balloons, ContestIndexList, Options, Organizations, Persons, Problems, Ranks, RatingHistories, RatingUserMap, RatingUsers, SelectOptionItem, Submissions, Teams };
|
package/dist/index.mjs
CHANGED
|
@@ -1127,6 +1127,47 @@ function createOrganizations(orgsJSON) {
|
|
|
1127
1127
|
return orgsJSON.map((org) => createOrganization(org));
|
|
1128
1128
|
}
|
|
1129
1129
|
|
|
1130
|
+
class SeatMapSection {
|
|
1131
|
+
title;
|
|
1132
|
+
rowLabels;
|
|
1133
|
+
grid;
|
|
1134
|
+
constructor() {
|
|
1135
|
+
this.title = new I18nText();
|
|
1136
|
+
this.rowLabels = [];
|
|
1137
|
+
this.grid = [];
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
class SeatMap {
|
|
1141
|
+
sections;
|
|
1142
|
+
constructor() {
|
|
1143
|
+
this.sections = [];
|
|
1144
|
+
}
|
|
1145
|
+
/**
|
|
1146
|
+
* Build a map from seat IDs (from team.location) to teams
|
|
1147
|
+
*/
|
|
1148
|
+
buildSeatToTeamMap(teams) {
|
|
1149
|
+
const map = /* @__PURE__ */ new Map();
|
|
1150
|
+
for (const team of teams) {
|
|
1151
|
+
if (team.location) {
|
|
1152
|
+
map.set(team.location, team);
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
return map;
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
function createSeatMapSection(sectionJSON) {
|
|
1159
|
+
const s = new SeatMapSection();
|
|
1160
|
+
s.title = I18nText.fromIText(sectionJSON.title ?? "");
|
|
1161
|
+
s.rowLabels = sectionJSON.rowLabels ?? [];
|
|
1162
|
+
s.grid = sectionJSON.grid ?? [];
|
|
1163
|
+
return s;
|
|
1164
|
+
}
|
|
1165
|
+
function createSeatMap(seatMapJSON) {
|
|
1166
|
+
const sm = new SeatMap();
|
|
1167
|
+
sm.sections = (seatMapJSON.sections ?? []).map(createSeatMapSection);
|
|
1168
|
+
return sm;
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1130
1171
|
class Contest {
|
|
1131
1172
|
id = "";
|
|
1132
1173
|
name;
|
|
@@ -1156,6 +1197,7 @@ class Contest {
|
|
|
1156
1197
|
socialMedia;
|
|
1157
1198
|
options;
|
|
1158
1199
|
organizations;
|
|
1200
|
+
seatMap;
|
|
1159
1201
|
constructor() {
|
|
1160
1202
|
this.name = new I18nText();
|
|
1161
1203
|
this.startTime = createDayJS();
|
|
@@ -1382,6 +1424,9 @@ function createContest(contestJSON) {
|
|
|
1382
1424
|
if (contestJSON.organizations) {
|
|
1383
1425
|
c.organizations = createOrganizations(contestJSON.organizations);
|
|
1384
1426
|
}
|
|
1427
|
+
if (contestJSON.seat_map && !("url" in contestJSON.seat_map)) {
|
|
1428
|
+
c.seatMap = createSeatMap(contestJSON.seat_map);
|
|
1429
|
+
}
|
|
1385
1430
|
return c;
|
|
1386
1431
|
}
|
|
1387
1432
|
|
|
@@ -2946,4 +2991,4 @@ class ResolverVue extends Resolver {
|
|
|
2946
2991
|
}
|
|
2947
2992
|
}
|
|
2948
2993
|
|
|
2949
|
-
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
|
2994
|
+
export { Award, Balloon, BattleOfGiants, CodeforcesGymGhostDATConverter, Contest, ContestIndex, ContestIndexConfig, ContestOptions, GeneralExcelConverter, Giants, GiantsType, I18nText, ICPCStandingsCsvConverter, MedalType, Organization, Person, PlaceChartPointData, Problem, ProblemStatistics, Rank, RankOptions, RankStatistics, Rating, RatingCalculator, RatingHistory, RatingLevel, RatingLevelToString, RatingUser, RatingUtility, Resolver, ResolverVue, SeatMap, SeatMapSection, Submission, Team, TeamProblemStatistics, calcDirt, createContest, createContestIndex, createContestIndexList, createDayJS, createOrganization, createOrganizations, createPersons, createProblem, createProblems, createProblemsByProblemIds, createSeatMap, createSeatMapSection, createSubmission, createSubmissions, createTeam, createTeams, getImageSource, getTimeDiff, getTimestamp, getWhiteOrBlackColor, getWhiteOrBlackColorV1, isAccepted, isNotCalculatedPenaltyStatus, isPending, isRejected, isValidMedalType, normalizePath, stringToSubmissionStatus };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xcpcio/core",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.84.0",
|
|
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.
|
|
45
|
+
"@xcpcio/types": "0.84.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/types": "^7.28.6",
|