@four-leaf-studios/rl-overlay 1.0.3 → 1.0.5

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.js CHANGED
@@ -10371,9 +10371,9 @@ var ScoreboardSeriesBoxComponent = function (_a) {
10371
10371
  var teamSeriesScore = Number(team.series_score) || 0;
10372
10372
  var pointsCount = Math.ceil(bestOf / 2);
10373
10373
  var points = Array.from({ length: pointsCount }, function (_, index) { return index; });
10374
- var isLefTeam = team.id === 0;
10375
- var modifier = isLefTeam ? "left" : "right";
10376
- var teamColor = ((_b = team.color) === null || _b === void 0 ? void 0 : _b.primary_color) || (isLefTeam ? "#0052cc" : "#ff6600");
10374
+ var isLeftTeam = team.id === "0";
10375
+ var modifier = isLeftTeam ? "left" : "right";
10376
+ var teamColor = ((_b = team.color) === null || _b === void 0 ? void 0 : _b.primary_color) || (isLeftTeam ? "#0052cc" : "#ff6600");
10377
10377
  return (React.createElement("div", { className: "series_box ".concat(modifier, "_series_box"), style: { "--team-color": teamColor } }, points.map(function (index) {
10378
10378
  var pointClass = index < teamSeriesScore
10379
10379
  ? "series_score_box_point ".concat(modifier, "_series_score_box_point")
@@ -10529,13 +10529,20 @@ var useTargetPlayer = function () {
10529
10529
  return targetPlayer;
10530
10530
  };
10531
10531
 
10532
+ // src/components/TargetPlayer.tsx
10532
10533
  var TargetPlayer = function () {
10533
- var _a;
10534
+ var _a, _b;
10534
10535
  var broadcast = useBroadcast();
10535
10536
  var targetPlayer = useTargetPlayer();
10536
- if (!targetPlayer || !broadcast)
10537
+ // Safeguard conditions
10538
+ if (!targetPlayer ||
10539
+ !broadcast ||
10540
+ !broadcast.teams ||
10541
+ !broadcast.teams[targetPlayer.team]) {
10537
10542
  return null;
10538
- var teamColor = (_a = broadcast.teams[targetPlayer.team].color) === null || _a === void 0 ? void 0 : _a.primary_color;
10543
+ }
10544
+ var teamData = broadcast.teams[targetPlayer.team];
10545
+ var teamColor = (_b = (_a = teamData === null || teamData === void 0 ? void 0 : teamData.color) === null || _a === void 0 ? void 0 : _a.primary_color) !== null && _b !== void 0 ? _b : "#ffffff";
10539
10546
  var modifier = targetPlayer.team === 0 ? "left" : "right";
10540
10547
  return (React.createElement(AnimatePresence, { mode: "wait" },
10541
10548
  React.createElement(motion.div, { key: targetPlayer.id, className: "stat_box ".concat(modifier, "_stat_box"), style: { "--team-color": teamColor }, initial: { x: modifier === "left" ? -300 : 300, opacity: 0 }, animate: { x: 0, opacity: 1 }, exit: { x: modifier === "left" ? -300 : 300, opacity: 0 }, transition: { duration: 0.8, ease: [0.77, 0, 0.175, 1] } },