1/// <reference path="./base-service.ts" /> 2var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 return new (P || (P = Promise))(function (resolve, reject) { 5 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 }); 10}; 11var __generator = (this && this.__generator) || function (thisArg, body) { 12 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 13 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 14 function verb(n) { return function (v) { return step([n, v]); }; } 15 function step(op) { 16 if (f) throw new TypeError("Generator is already executing."); 17 while (g && (g = 0, op[0] && (_ = 0)), _) try { 18 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 19 if (y = 0, t) op = [op[0] & 2, t.value]; 20 switch (op[0]) { 21 case 0: case 1: t = op; break; 22 case 4: _.label++; return { value: op[1], done: false }; 23 case 5: _.label++; y = op[1]; op = [0]; continue; 24 case 7: op = _.ops.pop(); _.trys.pop(); continue; 25 default: 26 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 27 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 28 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 29 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 30 if (t[2]) _.ops.pop(); 31 _.trys.pop(); continue; 32 } 33 op = body.call(thisArg, _); 34 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 35 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 36 } 37}; 38var PublicLeaderboardService; 39(function (PublicLeaderboardService) { 40 var LeaderboardService = /** @class */ (function () { 41 function LeaderboardService() { 42 this.api = new BaseService.ApiService(); 43 } 44 LeaderboardService.prototype.getLeaderboard = function (competitionUid, options) { 45 return __awaiter(this, void 0, void 0, function () { 46 var result, data, entries, rounds, types; 47 var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t; 48 return __generator(this, function (_u) { 49 switch (_u.label) { 50 case 0: return [4 /*yield*/, this.api.get("/api/public/leaderboard/".concat(competitionUid), options)]; 51 case 1: 52 result = _u.sent(); 53 data = result.data || {}; 54 entries = data.Entries || data.entries || []; 55 rounds = data.Rounds || data.rounds || []; 56 types = data.Types || data.types || []; 57 return [2 /*return*/, { 58 competitionName: (_b = (_a = data.CompetitionName) !== null && _a !== void 0 ? _a : data.competitionName) !== null && _b !== void 0 ? _b : "", 59 clubName: (_d = (_c = data.ClubName) !== null && _c !== void 0 ? _c : data.clubName) !== null && _d !== void 0 ? _d : "", 60 startDate: (_e = data.StartDate) !== null && _e !== void 0 ? _e : data.startDate, 61 endDate: (_f = data.EndDate) !== null && _f !== void 0 ? _f : data.endDate, 62 status: (_h = (_g = data.Status) !== null && _g !== void 0 ? _g : data.status) !== null && _h !== void 0 ? _h : "", 63 isLiveScoring: (_k = (_j = data.IsLiveScoring) !== null && _j !== void 0 ? _j : data.isLiveScoring) !== null && _k !== void 0 ? _k : false, 64 progressHeading: (_m = (_l = data.ProgressHeading) !== null && _l !== void 0 ? _l : data.progressHeading) !== null && _m !== void 0 ? _m : "To Par", 65 lastUpdatedUtc: (_p = (_o = data.LastUpdatedUtc) !== null && _o !== void 0 ? _o : data.lastUpdatedUtc) !== null && _p !== void 0 ? _p : null, 66 bannerImage: (_r = (_q = data.BannerImage) !== null && _q !== void 0 ? _q : data.bannerImage) !== null && _r !== void 0 ? _r : "", 67 pageDurationSeconds: (_t = (_s = data.PageDurationSeconds) !== null && _s !== void 0 ? _s : data.pageDurationSeconds) !== null && _t !== void 0 ? _t : null,
68 entries: entries.map(function (entry) { 69 var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2; 70 return ({ 71 pos: (_a = entry.Pos) !== null && _a !== void 0 ? _a : entry.pos, 72 posBadgeClass: (_c = (_b = entry.PosBadgeClass) !== null && _b !== void 0 ? _b : entry.posBadgeClass) !== null && _c !== void 0 ? _c : "", 73 isLeader: (_e = (_d = entry.IsLeader) !== null && _d !== void 0 ? _d : entry.isLeader) !== null && _e !== void 0 ? _e : false, 74 player: (_f = entry.Player) !== null && _f !== void 0 ? _f : entry.player, 75 division: (_h = (_g = entry.Division) !== null && _g !== void 0 ? _g : entry.division) !== null && _h !== void 0 ? _h : "", 76 rounds: ((_k = (_j = entry.Rounds) !== null && _j !== void 0 ? _j : entry.rounds) !== null && _k !== void 0 ? _k : []).map(function (round) { 77 var _a, _b, _c; 78 return ({ 79 roundNo: (_a = round.RoundNo) !== null && _a !== void 0 ? _a : round.roundNo, 80 score: (_c = (_b = round.Score) !== null && _b !== void 0 ? _b : round.score) !== null && _c !== void 0 ? _c : "", 81 }); 82 }), 83 holeScores: ((_m = (_l = entry.HoleScores) !== null && _l !== void 0 ? _l : entry.holeScores) !== null && _m !== void 0 ? _m : []).map(function (hole) { 84 var _a, _b, _c, _d, _e, _f, _g; 85 return ({ 86 holeNo: (_a = hole.HoleNo) !== null && _a !== void 0 ? _a : hole.holeNo, 87 score: (_c = (_b = hole.Score) !== null && _b !== void 0 ? _b : hole.score) !== null && _c !== void 0 ? _c : null, 88 par: (_e = (_d = hole.Par) !== null && _d !== void 0 ? _d : hole.par) !== null && _e !== void 0 ? _e : null, 89 scoreClass: (_g = (_f = hole.ScoreClass) !== null && _f !== void 0 ? _f : hole.scoreClass) !== null && _g !== void 0 ? _g : "", 90 }); 91 }), 92 thru: (_p = (_o = entry.Thru) !== null && _o !== void 0 ? _o : entry.thru) !== null && _p !== void 0 ? _p : "", 93 roundScore: (_r = (_q = entry.RoundScore) !== null && _q !== void 0 ? _q : entry.roundScore) !== null && _r !== void 0 ? _r : "-", 94 total: (_s = entry.Total) !== null && _s !== void 0 ? _s : entry.total, 95 toPar: (_t = entry.ToPar) !== null && _t !== void 0 ? _t : entry.toPar, 96 toParClass: (_v = (_u = entry.ToParClass) !== null && _u !== void 0 ? _u : entry.toParClass) !== null && _v !== void 0 ? _v : "", 97 status: (_w = entry.Status) !== null && _w !== void 0 ? _w : entry.status, 98 statusClass: (_y = (_x = entry.StatusClass) !== null && _x !== void 0 ? _x : entry.statusClass) !== null && _y !== void 0 ? _y : "", 99 isWithdrawn: (_0 = (_z = entry.IsWithdrawn) !== null && _z !== void 0 ? _z : entry.isWithdrawn) !== null && _0 !== void 0 ? _0 : false, 100 scoresHidden: (_2 = (_1 = entry.ScoresHidden) !== null && _1 !== void 0 ? _1 : entry.scoresHidden) !== null && _2 !== void 0 ? _2 : false, 101 }); 102 }), 103 rounds: rounds.map(function (round) { 104 var _a, _b, _c, _d, _e, _f, _g, _h; 105 return ({ 106 competitionRoundId: (_a = round.CompetitionRoundId) !== null && _a !== void 0 ? _a : round.competitionRoundId, 107 roundNo: (_b = round.RoundNo) !== null && _b !== void 0 ? _b : round.roundNo, 108 isPlayed: (_d = (_c = round.IsPlayed) !== null && _c !== void 0 ? _c : round.isPlayed) !== null && _d !== void 0 ? _d : false, 109 isActive: (_f = (_e = round.IsActive) !== null && _e !== void 0 ? _e : round.isActive) !== null && _f !== void 0 ? _f : false, 110 isLiveScoring: (_h = (_g = round.IsLiveScoring) !== null && _g !== void 0 ? _g : round.isLiveScoring) !== null && _h !== void 0 ? _h : false, 111 }); 112 }), 113 types: types.map(function (type) { 114 var _a, _b, _c, _d; 115 return ({ 116 competitionTypeId: (_a = type.CompetitionTypeId) !== null && _a !== void 0 ? _a : type.competitionTypeId, 117 name: (_b = type.Name) !== null && _b !== void 0 ? _b : type.n
117ame, 118 isActive: (_d = (_c = type.IsActive) !== null && _c !== void 0 ? _c : type.isActive) !== null && _d !== void 0 ? _d : false, 119 }); 120 }), 121 }]; 122 } 123 }); 124 }); 125 }; 126 return LeaderboardService; 127 }()); 128 PublicLeaderboardService.LeaderboardService = LeaderboardService; 129})(PublicLeaderboardService || (PublicLeaderboardService = {}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.