import { $, a as xe, b as Te, S as ke, i as Ce, f as L, s as Oe, c as Me, d as De, n as A, e as O, g as Pe, h as Se, j as Le, k as M, l as b, m as _, o as w, t as he, p as We, q as Ue, r as Ee, u as Ye, v as I, w as X, x as He, y as V, z as J, A as U, B as ee, C as j, D as Ne, E as Ie, F as Fe, G as qe } from "./PrizeEngineSuite-3vlUEft1.js";
import "../stencil/ui-skeleton-W50o8tfg.js";
const te = {
  en: {
    History: "History",
    NoHistories: "No histories"
  }
};
function ze({ withLocale: a, translations: e }) {
  $.subscribe((t) => {
    t == null && (xe.set(e), $.set(a));
  });
}
function me(a, e) {
  Te(a, e);
}
function Re(a) {
  $.set(a);
}
const je = () => {
  ze({ withLocale: "en", translations: {} }), Object.keys(te).forEach((a) => {
    me(a, te[a]);
  });
};
function G(a) {
  "@babel/helpers - typeof";
  return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
    return typeof e;
  } : function(e) {
    return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
  }, G(a);
}
function Y(a) {
  if (a === null || a === !0 || a === !1)
    return NaN;
  var e = Number(a);
  return isNaN(e) ? e : e < 0 ? Math.ceil(e) : Math.floor(e);
}
function k(a, e) {
  if (e.length < a)
    throw new TypeError(a + " argument" + (a > 1 ? "s" : "") + " required, but only " + e.length + " present");
}
function D(a) {
  k(1, arguments);
  var e = Object.prototype.toString.call(a);
  return a instanceof Date || G(a) === "object" && e === "[object Date]" ? new Date(a.getTime()) : typeof a == "number" || e === "[object Number]" ? new Date(a) : ((typeof a == "string" || e === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
}
function Ge(a, e) {
  k(2, arguments);
  var t = D(a).getTime(), r = Y(e);
  return new Date(t + r);
}
var Be = {};
function K() {
  return Be;
}
function Qe(a) {
  var e = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds()));
  return e.setUTCFullYear(a.getFullYear()), a.getTime() - e.getTime();
}
function Ae(a) {
  return k(1, arguments), a instanceof Date || G(a) === "object" && Object.prototype.toString.call(a) === "[object Date]";
}
function Xe(a) {
  if (k(1, arguments), !Ae(a) && typeof a != "number")
    return !1;
  var e = D(a);
  return !isNaN(Number(e));
}
function Ve(a, e) {
  k(2, arguments);
  var t = Y(e);
  return Ge(a, -t);
}
var Je = 864e5;
function Ke(a) {
  k(1, arguments);
  var e = D(a), t = e.getTime();
  e.setUTCMonth(0, 1), e.setUTCHours(0, 0, 0, 0);
  var r = e.getTime(), n = t - r;
  return Math.floor(n / Je) + 1;
}
function B(a) {
  k(1, arguments);
  var e = 1, t = D(a), r = t.getUTCDay(), n = (r < e ? 7 : 0) + r - e;
  return t.setUTCDate(t.getUTCDate() - n), t.setUTCHours(0, 0, 0, 0), t;
}
function ve(a) {
  k(1, arguments);
  var e = D(a), t = e.getUTCFullYear(), r = /* @__PURE__ */ new Date(0);
  r.setUTCFullYear(t + 1, 0, 4), r.setUTCHours(0, 0, 0, 0);
  var n = B(r), i = /* @__PURE__ */ new Date(0);
  i.setUTCFullYear(t, 0, 4), i.setUTCHours(0, 0, 0, 0);
  var o = B(i);
  return e.getTime() >= n.getTime() ? t + 1 : e.getTime() >= o.getTime() ? t : t - 1;
}
function Ze(a) {
  k(1, arguments);
  var e = ve(a), t = /* @__PURE__ */ new Date(0);
  t.setUTCFullYear(e, 0, 4), t.setUTCHours(0, 0, 0, 0);
  var r = B(t);
  return r;
}
var $e = 6048e5;
function et(a) {
  k(1, arguments);
  var e = D(a), t = B(e).getTime() - Ze(e).getTime();
  return Math.round(t / $e) + 1;
}
function Q(a, e) {
  var t, r, n, i, o, s, c, d;
  k(1, arguments);
  var h = K(), u = Y((t = (r = (n = (i = e?.weekStartsOn) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.weekStartsOn) !== null && n !== void 0 ? n : h.weekStartsOn) !== null && r !== void 0 ? r : (c = h.locale) === null || c === void 0 || (d = c.options) === null || d === void 0 ? void 0 : d.weekStartsOn) !== null && t !== void 0 ? t : 0);
  if (!(u >= 0 && u <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  var m = D(a), l = m.getUTCDay(), g = (l < u ? 7 : 0) + l - u;
  return m.setUTCDate(m.getUTCDate() - g), m.setUTCHours(0, 0, 0, 0), m;
}
function ge(a, e) {
  var t, r, n, i, o, s, c, d;
  k(1, arguments);
  var h = D(a), u = h.getUTCFullYear(), m = K(), l = Y((t = (r = (n = (i = e?.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && n !== void 0 ? n : m.firstWeekContainsDate) !== null && r !== void 0 ? r : (c = m.locale) === null || c === void 0 || (d = c.options) === null || d === void 0 ? void 0 : d.firstWeekContainsDate) !== null && t !== void 0 ? t : 1);
  if (!(l >= 1 && l <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var g = /* @__PURE__ */ new Date(0);
  g.setUTCFullYear(u + 1, 0, l), g.setUTCHours(0, 0, 0, 0);
  var T = Q(g, e), x = /* @__PURE__ */ new Date(0);
  x.setUTCFullYear(u, 0, l), x.setUTCHours(0, 0, 0, 0);
  var y = Q(x, e);
  return h.getTime() >= T.getTime() ? u + 1 : h.getTime() >= y.getTime() ? u : u - 1;
}
function tt(a, e) {
  var t, r, n, i, o, s, c, d;
  k(1, arguments);
  var h = K(), u = Y((t = (r = (n = (i = e?.firstWeekContainsDate) !== null && i !== void 0 ? i : e == null || (o = e.locale) === null || o === void 0 || (s = o.options) === null || s === void 0 ? void 0 : s.firstWeekContainsDate) !== null && n !== void 0 ? n : h.firstWeekContainsDate) !== null && r !== void 0 ? r : (c = h.locale) === null || c === void 0 || (d = c.options) === null || d === void 0 ? void 0 : d.firstWeekContainsDate) !== null && t !== void 0 ? t : 1), m = ge(a, e), l = /* @__PURE__ */ new Date(0);
  l.setUTCFullYear(m, 0, u), l.setUTCHours(0, 0, 0, 0);
  var g = Q(l, e);
  return g;
}
var rt = 6048e5;
function at(a, e) {
  k(1, arguments);
  var t = D(a), r = Q(t, e).getTime() - tt(t, e).getTime();
  return Math.round(r / rt) + 1;
}
function v(a, e) {
  for (var t = a < 0 ? "-" : "", r = Math.abs(a).toString(); r.length < e; )
    r = "0" + r;
  return t + r;
}
var W = {
  // Year
  y: function(e, t) {
    var r = e.getUTCFullYear(), n = r > 0 ? r : 1 - r;
    return v(t === "yy" ? n % 100 : n, t.length);
  },
  // Month
  M: function(e, t) {
    var r = e.getUTCMonth();
    return t === "M" ? String(r + 1) : v(r + 1, 2);
  },
  // Day of the month
  d: function(e, t) {
    return v(e.getUTCDate(), t.length);
  },
  // AM or PM
  a: function(e, t) {
    var r = e.getUTCHours() / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return r.toUpperCase();
      case "aaa":
        return r;
      case "aaaaa":
        return r[0];
      case "aaaa":
      default:
        return r === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h: function(e, t) {
    return v(e.getUTCHours() % 12 || 12, t.length);
  },
  // Hour [0-23]
  H: function(e, t) {
    return v(e.getUTCHours(), t.length);
  },
  // Minute
  m: function(e, t) {
    return v(e.getUTCMinutes(), t.length);
  },
  // Second
  s: function(e, t) {
    return v(e.getUTCSeconds(), t.length);
  },
  // Fraction of second
  S: function(e, t) {
    var r = t.length, n = e.getUTCMilliseconds(), i = Math.floor(n * Math.pow(10, r - 3));
    return v(i, t.length);
  }
}, N = {
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
}, nt = {
  // Era
  G: function(e, t, r) {
    var n = e.getUTCFullYear() > 0 ? 1 : 0;
    switch (t) {
      case "G":
      case "GG":
      case "GGG":
        return r.era(n, {
          width: "abbreviated"
        });
      case "GGGGG":
        return r.era(n, {
          width: "narrow"
        });
      case "GGGG":
      default:
        return r.era(n, {
          width: "wide"
        });
    }
  },
  // Year
  y: function(e, t, r) {
    if (t === "yo") {
      var n = e.getUTCFullYear(), i = n > 0 ? n : 1 - n;
      return r.ordinalNumber(i, {
        unit: "year"
      });
    }
    return W.y(e, t);
  },
  // Local week-numbering year
  Y: function(e, t, r, n) {
    var i = ge(e, n), o = i > 0 ? i : 1 - i;
    if (t === "YY") {
      var s = o % 100;
      return v(s, 2);
    }
    return t === "Yo" ? r.ordinalNumber(o, {
      unit: "year"
    }) : v(o, t.length);
  },
  // ISO week-numbering year
  R: function(e, t) {
    var r = ve(e);
    return v(r, t.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(e, t) {
    var r = e.getUTCFullYear();
    return v(r, t.length);
  },
  // Quarter
  Q: function(e, t, r) {
    var n = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "Q":
        return String(n);
      case "QQ":
        return v(n, 2);
      case "Qo":
        return r.ordinalNumber(n, {
          unit: "quarter"
        });
      case "QQQ":
        return r.quarter(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "QQQQQ":
        return r.quarter(n, {
          width: "narrow",
          context: "formatting"
        });
      case "QQQQ":
      default:
        return r.quarter(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(e, t, r) {
    var n = Math.ceil((e.getUTCMonth() + 1) / 3);
    switch (t) {
      case "q":
        return String(n);
      case "qq":
        return v(n, 2);
      case "qo":
        return r.ordinalNumber(n, {
          unit: "quarter"
        });
      case "qqq":
        return r.quarter(n, {
          width: "abbreviated",
          context: "standalone"
        });
      case "qqqqq":
        return r.quarter(n, {
          width: "narrow",
          context: "standalone"
        });
      case "qqqq":
      default:
        return r.quarter(n, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(e, t, r) {
    var n = e.getUTCMonth();
    switch (t) {
      case "M":
      case "MM":
        return W.M(e, t);
      case "Mo":
        return r.ordinalNumber(n + 1, {
          unit: "month"
        });
      case "MMM":
        return r.month(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "MMMMM":
        return r.month(n, {
          width: "narrow",
          context: "formatting"
        });
      case "MMMM":
      default:
        return r.month(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone month
  L: function(e, t, r) {
    var n = e.getUTCMonth();
    switch (t) {
      case "L":
        return String(n + 1);
      case "LL":
        return v(n + 1, 2);
      case "Lo":
        return r.ordinalNumber(n + 1, {
          unit: "month"
        });
      case "LLL":
        return r.month(n, {
          width: "abbreviated",
          context: "standalone"
        });
      case "LLLLL":
        return r.month(n, {
          width: "narrow",
          context: "standalone"
        });
      case "LLLL":
      default:
        return r.month(n, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Local week of year
  w: function(e, t, r, n) {
    var i = at(e, n);
    return t === "wo" ? r.ordinalNumber(i, {
      unit: "week"
    }) : v(i, t.length);
  },
  // ISO week of year
  I: function(e, t, r) {
    var n = et(e);
    return t === "Io" ? r.ordinalNumber(n, {
      unit: "week"
    }) : v(n, t.length);
  },
  // Day of the month
  d: function(e, t, r) {
    return t === "do" ? r.ordinalNumber(e.getUTCDate(), {
      unit: "date"
    }) : W.d(e, t);
  },
  // Day of year
  D: function(e, t, r) {
    var n = Ke(e);
    return t === "Do" ? r.ordinalNumber(n, {
      unit: "dayOfYear"
    }) : v(n, t.length);
  },
  // Day of week
  E: function(e, t, r) {
    var n = e.getUTCDay();
    switch (t) {
      case "E":
      case "EE":
      case "EEE":
        return r.day(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "EEEEE":
        return r.day(n, {
          width: "narrow",
          context: "formatting"
        });
      case "EEEEEE":
        return r.day(n, {
          width: "short",
          context: "formatting"
        });
      case "EEEE":
      default:
        return r.day(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(e, t, r, n) {
    var i = e.getUTCDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "e":
        return String(o);
      case "ee":
        return v(o, 2);
      case "eo":
        return r.ordinalNumber(o, {
          unit: "day"
        });
      case "eee":
        return r.day(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "eeeee":
        return r.day(i, {
          width: "narrow",
          context: "formatting"
        });
      case "eeeeee":
        return r.day(i, {
          width: "short",
          context: "formatting"
        });
      case "eeee":
      default:
        return r.day(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(e, t, r, n) {
    var i = e.getUTCDay(), o = (i - n.weekStartsOn + 8) % 7 || 7;
    switch (t) {
      case "c":
        return String(o);
      case "cc":
        return v(o, t.length);
      case "co":
        return r.ordinalNumber(o, {
          unit: "day"
        });
      case "ccc":
        return r.day(i, {
          width: "abbreviated",
          context: "standalone"
        });
      case "ccccc":
        return r.day(i, {
          width: "narrow",
          context: "standalone"
        });
      case "cccccc":
        return r.day(i, {
          width: "short",
          context: "standalone"
        });
      case "cccc":
      default:
        return r.day(i, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(e, t, r) {
    var n = e.getUTCDay(), i = n === 0 ? 7 : n;
    switch (t) {
      case "i":
        return String(i);
      case "ii":
        return v(i, t.length);
      case "io":
        return r.ordinalNumber(i, {
          unit: "day"
        });
      case "iii":
        return r.day(n, {
          width: "abbreviated",
          context: "formatting"
        });
      case "iiiii":
        return r.day(n, {
          width: "narrow",
          context: "formatting"
        });
      case "iiiiii":
        return r.day(n, {
          width: "short",
          context: "formatting"
        });
      case "iiii":
      default:
        return r.day(n, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(e, t, r) {
    var n = e.getUTCHours(), i = n / 12 >= 1 ? "pm" : "am";
    switch (t) {
      case "a":
      case "aa":
        return r.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return r.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return r.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return r.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(e, t, r) {
    var n = e.getUTCHours(), i;
    switch (n === 12 ? i = N.noon : n === 0 ? i = N.midnight : i = n / 12 >= 1 ? "pm" : "am", t) {
      case "b":
      case "bb":
        return r.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return r.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return r.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return r.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(e, t, r) {
    var n = e.getUTCHours(), i;
    switch (n >= 17 ? i = N.evening : n >= 12 ? i = N.afternoon : n >= 4 ? i = N.morning : i = N.night, t) {
      case "B":
      case "BB":
      case "BBB":
        return r.dayPeriod(i, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return r.dayPeriod(i, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return r.dayPeriod(i, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(e, t, r) {
    if (t === "ho") {
      var n = e.getUTCHours() % 12;
      return n === 0 && (n = 12), r.ordinalNumber(n, {
        unit: "hour"
      });
    }
    return W.h(e, t);
  },
  // Hour [0-23]
  H: function(e, t, r) {
    return t === "Ho" ? r.ordinalNumber(e.getUTCHours(), {
      unit: "hour"
    }) : W.H(e, t);
  },
  // Hour [0-11]
  K: function(e, t, r) {
    var n = e.getUTCHours() % 12;
    return t === "Ko" ? r.ordinalNumber(n, {
      unit: "hour"
    }) : v(n, t.length);
  },
  // Hour [1-24]
  k: function(e, t, r) {
    var n = e.getUTCHours();
    return n === 0 && (n = 24), t === "ko" ? r.ordinalNumber(n, {
      unit: "hour"
    }) : v(n, t.length);
  },
  // Minute
  m: function(e, t, r) {
    return t === "mo" ? r.ordinalNumber(e.getUTCMinutes(), {
      unit: "minute"
    }) : W.m(e, t);
  },
  // Second
  s: function(e, t, r) {
    return t === "so" ? r.ordinalNumber(e.getUTCSeconds(), {
      unit: "second"
    }) : W.s(e, t);
  },
  // Fraction of second
  S: function(e, t) {
    return W.S(e, t);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(e, t, r, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    if (o === 0)
      return "Z";
    switch (t) {
      case "X":
        return ae(o);
      case "XXXX":
      case "XX":
        return E(o);
      case "XXXXX":
      case "XXX":
      default:
        return E(o, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(e, t, r, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "x":
        return ae(o);
      case "xxxx":
      case "xx":
        return E(o);
      case "xxxxx":
      case "xxx":
      default:
        return E(o, ":");
    }
  },
  // Timezone (GMT)
  O: function(e, t, r, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + re(o, ":");
      case "OOOO":
      default:
        return "GMT" + E(o, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(e, t, r, n) {
    var i = n._originalDate || e, o = i.getTimezoneOffset();
    switch (t) {
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + re(o, ":");
      case "zzzz":
      default:
        return "GMT" + E(o, ":");
    }
  },
  // Seconds timestamp
  t: function(e, t, r, n) {
    var i = n._originalDate || e, o = Math.floor(i.getTime() / 1e3);
    return v(o, t.length);
  },
  // Milliseconds timestamp
  T: function(e, t, r, n) {
    var i = n._originalDate || e, o = i.getTime();
    return v(o, t.length);
  }
};
function re(a, e) {
  var t = a > 0 ? "-" : "+", r = Math.abs(a), n = Math.floor(r / 60), i = r % 60;
  if (i === 0)
    return t + String(n);
  var o = e;
  return t + String(n) + o + v(i, 2);
}
function ae(a, e) {
  if (a % 60 === 0) {
    var t = a > 0 ? "-" : "+";
    return t + v(Math.abs(a) / 60, 2);
  }
  return E(a, e);
}
function E(a, e) {
  var t = e || "", r = a > 0 ? "-" : "+", n = Math.abs(a), i = v(Math.floor(n / 60), 2), o = v(n % 60, 2);
  return r + i + t + o;
}
var ne = function(e, t) {
  switch (e) {
    case "P":
      return t.date({
        width: "short"
      });
    case "PP":
      return t.date({
        width: "medium"
      });
    case "PPP":
      return t.date({
        width: "long"
      });
    case "PPPP":
    default:
      return t.date({
        width: "full"
      });
  }
}, ye = function(e, t) {
  switch (e) {
    case "p":
      return t.time({
        width: "short"
      });
    case "pp":
      return t.time({
        width: "medium"
      });
    case "ppp":
      return t.time({
        width: "long"
      });
    case "pppp":
    default:
      return t.time({
        width: "full"
      });
  }
}, it = function(e, t) {
  var r = e.match(/(P+)(p+)?/) || [], n = r[1], i = r[2];
  if (!i)
    return ne(e, t);
  var o;
  switch (n) {
    case "P":
      o = t.dateTime({
        width: "short"
      });
      break;
    case "PP":
      o = t.dateTime({
        width: "medium"
      });
      break;
    case "PPP":
      o = t.dateTime({
        width: "long"
      });
      break;
    case "PPPP":
    default:
      o = t.dateTime({
        width: "full"
      });
      break;
  }
  return o.replace("{{date}}", ne(n, t)).replace("{{time}}", ye(i, t));
}, ot = {
  p: ye,
  P: it
}, st = ["D", "DD"], lt = ["YY", "YYYY"];
function ut(a) {
  return st.indexOf(a) !== -1;
}
function ct(a) {
  return lt.indexOf(a) !== -1;
}
function ie(a, e, t) {
  if (a === "YYYY")
    throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (a === "YY")
    throw new RangeError("Use `yy` instead of `YY` (in `".concat(e, "`) for formatting years to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (a === "D")
    throw new RangeError("Use `d` instead of `D` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
  if (a === "DD")
    throw new RangeError("Use `dd` instead of `DD` (in `".concat(e, "`) for formatting days of the month to the input `").concat(t, "`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));
}
var dt = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
}, ft = function(e, t, r) {
  var n, i = dt[e];
  return typeof i == "string" ? n = i : t === 1 ? n = i.one : n = i.other.replace("{{count}}", t.toString()), r != null && r.addSuffix ? r.comparison && r.comparison > 0 ? "in " + n : n + " ago" : n;
};
function Z(a) {
  return function() {
    var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = e.width ? String(e.width) : a.defaultWidth, r = a.formats[t] || a.formats[a.defaultWidth];
    return r;
  };
}
var ht = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
}, mt = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
}, vt = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
}, gt = {
  date: Z({
    formats: ht,
    defaultWidth: "full"
  }),
  time: Z({
    formats: mt,
    defaultWidth: "full"
  }),
  dateTime: Z({
    formats: vt,
    defaultWidth: "full"
  })
}, yt = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
}, wt = function(e, t, r, n) {
  return yt[e];
};
function F(a) {
  return function(e, t) {
    var r = t != null && t.context ? String(t.context) : "standalone", n;
    if (r === "formatting" && a.formattingValues) {
      var i = a.defaultFormattingWidth || a.defaultWidth, o = t != null && t.width ? String(t.width) : i;
      n = a.formattingValues[o] || a.formattingValues[i];
    } else {
      var s = a.defaultWidth, c = t != null && t.width ? String(t.width) : a.defaultWidth;
      n = a.values[c] || a.values[s];
    }
    var d = a.argumentCallback ? a.argumentCallback(e) : e;
    return n[d];
  };
}
var bt = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
}, pt = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
}, _t = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
  wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}, xt = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
}, Tt = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
}, kt = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
}, Ct = function(e, t) {
  var r = Number(e), n = r % 100;
  if (n > 20 || n < 10)
    switch (n % 10) {
      case 1:
        return r + "st";
      case 2:
        return r + "nd";
      case 3:
        return r + "rd";
    }
  return r + "th";
}, Ot = {
  ordinalNumber: Ct,
  era: F({
    values: bt,
    defaultWidth: "wide"
  }),
  quarter: F({
    values: pt,
    defaultWidth: "wide",
    argumentCallback: function(e) {
      return e - 1;
    }
  }),
  month: F({
    values: _t,
    defaultWidth: "wide"
  }),
  day: F({
    values: xt,
    defaultWidth: "wide"
  }),
  dayPeriod: F({
    values: Tt,
    defaultWidth: "wide",
    formattingValues: kt,
    defaultFormattingWidth: "wide"
  })
};
function q(a) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = t.width, n = r && a.matchPatterns[r] || a.matchPatterns[a.defaultMatchWidth], i = e.match(n);
    if (!i)
      return null;
    var o = i[0], s = r && a.parsePatterns[r] || a.parsePatterns[a.defaultParseWidth], c = Array.isArray(s) ? Dt(s, function(u) {
      return u.test(o);
    }) : Mt(s, function(u) {
      return u.test(o);
    }), d;
    d = a.valueCallback ? a.valueCallback(c) : c, d = t.valueCallback ? t.valueCallback(d) : d;
    var h = e.slice(o.length);
    return {
      value: d,
      rest: h
    };
  };
}
function Mt(a, e) {
  for (var t in a)
    if (a.hasOwnProperty(t) && e(a[t]))
      return t;
}
function Dt(a, e) {
  for (var t = 0; t < a.length; t++)
    if (e(a[t]))
      return t;
}
function Pt(a) {
  return function(e) {
    var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, r = e.match(a.matchPattern);
    if (!r)
      return null;
    var n = r[0], i = e.match(a.parsePattern);
    if (!i)
      return null;
    var o = a.valueCallback ? a.valueCallback(i[0]) : i[0];
    o = t.valueCallback ? t.valueCallback(o) : o;
    var s = e.slice(n.length);
    return {
      value: o,
      rest: s
    };
  };
}
var St = /^(\d+)(th|st|nd|rd)?/i, Lt = /\d+/i, Wt = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
}, Ut = {
  any: [/^b/i, /^(a|c)/i]
}, Et = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
}, Yt = {
  any: [/1/i, /2/i, /3/i, /4/i]
}, Ht = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
}, Nt = {
  narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
  any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
}, It = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
}, Ft = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
}, qt = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
}, zt = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
}, Rt = {
  ordinalNumber: Pt({
    matchPattern: St,
    parsePattern: Lt,
    valueCallback: function(e) {
      return parseInt(e, 10);
    }
  }),
  era: q({
    matchPatterns: Wt,
    defaultMatchWidth: "wide",
    parsePatterns: Ut,
    defaultParseWidth: "any"
  }),
  quarter: q({
    matchPatterns: Et,
    defaultMatchWidth: "wide",
    parsePatterns: Yt,
    defaultParseWidth: "any",
    valueCallback: function(e) {
      return e + 1;
    }
  }),
  month: q({
    matchPatterns: Ht,
    defaultMatchWidth: "wide",
    parsePatterns: Nt,
    defaultParseWidth: "any"
  }),
  day: q({
    matchPatterns: It,
    defaultMatchWidth: "wide",
    parsePatterns: Ft,
    defaultParseWidth: "any"
  }),
  dayPeriod: q({
    matchPatterns: qt,
    defaultMatchWidth: "any",
    parsePatterns: zt,
    defaultParseWidth: "any"
  })
}, jt = {
  code: "en-US",
  formatDistance: ft,
  formatLong: gt,
  formatRelative: wt,
  localize: Ot,
  match: Rt,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
}, Gt = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g, Bt = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g, Qt = /^'([^]*?)'?$/, At = /''/g, Xt = /[a-zA-Z]/;
function Vt(a, e, t) {
  var r, n, i, o, s, c, d, h, u, m, l, g, T, x;
  k(2, arguments);
  var y = String(e), p = K(), f = (r = (n = void 0) !== null && n !== void 0 ? n : p.locale) !== null && r !== void 0 ? r : jt, P = Y((i = (o = (s = (c = void 0) !== null && c !== void 0 ? c : void 0) !== null && s !== void 0 ? s : p.firstWeekContainsDate) !== null && o !== void 0 ? o : (d = p.locale) === null || d === void 0 || (h = d.options) === null || h === void 0 ? void 0 : h.firstWeekContainsDate) !== null && i !== void 0 ? i : 1);
  if (!(P >= 1 && P <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var H = Y((u = (m = (l = (g = void 0) !== null && g !== void 0 ? g : void 0) !== null && l !== void 0 ? l : p.weekStartsOn) !== null && m !== void 0 ? m : (T = p.locale) === null || T === void 0 || (x = T.options) === null || x === void 0 ? void 0 : x.weekStartsOn) !== null && u !== void 0 ? u : 0);
  if (!(H >= 0 && H <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  if (!f.localize)
    throw new RangeError("locale must contain localize property");
  if (!f.formatLong)
    throw new RangeError("locale must contain formatLong property");
  var z = D(a);
  if (!Xe(z))
    throw new RangeError("Invalid time value");
  var we = Qe(z), be = Ve(z, we), pe = {
    firstWeekContainsDate: P,
    weekStartsOn: H,
    locale: f,
    _originalDate: z
  }, _e = y.match(Bt).map(function(C) {
    var S = C[0];
    if (S === "p" || S === "P") {
      var R = ot[S];
      return R(C, f.formatLong);
    }
    return C;
  }).join("").match(Gt).map(function(C) {
    if (C === "''")
      return "'";
    var S = C[0];
    if (S === "'")
      return Jt(C);
    var R = nt[S];
    if (R)
      return ct(C) && ie(C, e, String(a)), ut(C) && ie(C, e, String(a)), R(be, C, f.localize, pe);
    if (S.match(Xt))
      throw new RangeError("Format string contains an unescaped latin alphabet character `" + S + "`");
    return C;
  }).join("");
  return _e;
}
function Jt(a) {
  var e = a.match(Qt);
  return e ? e[1].replace(At, "'") : a;
}
const oe = async (a, e, t, r = {}) => {
  const n = new URL(a + "/v1" + e);
  r.params && Object.keys(r.params).forEach((c) => n.searchParams.append(c, r.params[c]));
  const i = {
    method: r.method || "GET",
    headers: {
      "Content-Type": "application/json",
      Accept: "text/plain",
      ...t ? { "x-SessionId": t } : {},
      ...r.headers
    },
    body: r.body
  }, s = await (await fetch(n.toString(), i)).text();
  return JSON.parse(s);
}, Kt = {
  fetchLotteries: async (a, e, t) => await oe(a, "/wof/lotteries", e, {
    params: t?.length ? { filter: t.map((r) => `Types[]=${r}`).join(",") } : { filter: "Types[]=wheelOfFortune" }
  }),
  fetchFullHistory: async (a, e, t, r) => {
    const n = (l) => {
      const g = new URL(a + "/v1" + l);
      return r?.length && r.forEach((T) => g.searchParams.append("filter", `Types[]=${T}`)), g.toString();
    }, i = async (l) => (await fetch(n(l), {
      headers: {
        "Content-Type": "application/json",
        Accept: "text/plain",
        ...e ? { "x-SessionId": e } : {}
      }
    })).json(), [o, s] = await Promise.all([
      i("/wof/lotteryHistory"),
      i("/wof/lotteries")
    ]), c = s?.items || [], d = o?.items || [], h = new Set(c.map((l) => l.program.id)), u = d.map((l) => l.programID).filter((l) => h.has(l));
    return u.length === 0 ? [] : (await Promise.all(
      u.map(async (l) => {
        const g = await oe(a, `/wof/outcome/${l}`, e), T = c.find((y) => y.program.id === l);
        if (!g?.items?.length)
          return null;
        const x = g.items.map((y) => {
          const p = y.draw.result.wheelOfFortunePartitionIndex, f = T?.program?.wheelOfFortune?.partitions[p];
          return {
            prizeName: f?.name?.[t] || f?.name?.["*"],
            prizeImage: f?.prizeImage?.[t] || f?.prizeImage?.["*"] || f?.image1?.[t] || f?.image1?.["*"],
            state: y.draw.state === "fulfilled",
            date: Vt(new Date(y.draw.time), "LLL d, yyyy HH:mm:ss")
          };
        });
        return {
          id: l,
          name: T?.program?.name[t] || T?.program?.name["*"] || "Unknown Game",
          outcomes: x
        };
      })
    )).filter((l) => l !== null);
  }
}, se = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.1724%204.72381C15.4708%205.02223%2015.4708%205.50607%2015.1724%205.80449L7.70071%2013.2762C7.40229%2013.5746%206.91846%2013.5746%206.62004%2013.2762L3.22381%209.87996C2.9254%209.58154%202.9254%209.09771%203.22381%208.79929C3.52223%208.50087%204.00607%208.50087%204.30449%208.79929L7.16038%2011.6552L14.0917%204.72381C14.3902%204.4254%2014.874%204.4254%2015.1724%204.72381Z'%20fill='%2358DB4A'/%3e%3c/svg%3e", le = "data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M3.96967%203.96967C4.26256%203.67678%204.73744%203.67678%205.03033%203.96967L9%207.93934L12.9697%203.96967C13.2626%203.67678%2013.7374%203.67678%2014.0303%203.96967C14.3232%204.26256%2014.3232%204.73744%2014.0303%205.03033L10.0607%209L14.0303%2012.9697C14.3232%2013.2626%2014.3232%2013.7374%2014.0303%2014.0303C13.7374%2014.3232%2013.2626%2014.3232%2012.9697%2014.0303L9%2010.0607L5.03033%2014.0303C4.73744%2014.3232%204.26256%2014.3232%203.96967%2014.0303C3.67678%2013.7374%203.67678%2013.2626%203.96967%2012.9697L7.93934%209L3.96967%205.03033C3.67678%204.73744%203.67678%204.26256%203.96967%203.96967Z'%20fill='%23FF9B59'/%3e%3c/svg%3e";
function Zt(a) {
  De(a, "svelte-1r6yeh4", ':host{display:block;height:100%;flex-grow:1}.PrizeHistoryContent.svelte-1r6yeh4.svelte-1r6yeh4{width:100%;height:100%;display:flex;flex-direction:column;font-family:var(--emw--font-family-primary, "Ubuntu", sans-serif);margin:30px auto}.OutcomesList.svelte-1r6yeh4.svelte-1r6yeh4,.HistoryList.svelte-1r6yeh4.svelte-1r6yeh4{overflow-y:auto}.OutcomesList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar,.HistoryList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar{width:4px}.OutcomesList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar-track,.HistoryList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar-track{background:transparent}.OutcomesList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar-thumb,.HistoryList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar-thumb{background:var(--emw--color-gray-105, #1b2e31);border-radius:2px}.OutcomesList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar-thumb:hover,.HistoryList.svelte-1r6yeh4.svelte-1r6yeh4::-webkit-scrollbar-thumb:hover{background:var(--emw--color-gray-290, #284044)}.HistoryList.svelte-1r6yeh4.svelte-1r6yeh4{flex-grow:1;display:flex;flex-direction:column;gap:24px;padding-right:10px;padding-bottom:50px}.HistoryItem.svelte-1r6yeh4.svelte-1r6yeh4{margin-bottom:40px;flex-shrink:0}.GroupName.svelte-1r6yeh4.svelte-1r6yeh4{color:var(--emw--color-white, #ffffff);font-size:var(--emw--font-size-medium, 16px);font-weight:700;line-height:18px;margin-bottom:16px}.OutcomesList.svelte-1r6yeh4.svelte-1r6yeh4{max-height:215px;display:flex;flex-direction:column}.OutcomeItem.svelte-1r6yeh4.svelte-1r6yeh4{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--emw--color-gray-transparency-20, rgba(114, 151, 135, 0.2));color:var(--emw--color-primary-variant, #a9ccbe);min-height:40px}.OutcomeItem.svelte-1r6yeh4 .OutcomeLeft.svelte-1r6yeh4{display:flex;align-items:center;gap:16px}.OutcomeItem.svelte-1r6yeh4 .PrizeInfo.svelte-1r6yeh4{display:flex;align-items:center;gap:8px}.OutcomeItem.svelte-1r6yeh4 .PrizeInfo .PrizeImg.svelte-1r6yeh4{height:20px}.OutcomeItem.svelte-1r6yeh4 .PrizeInfo .StatusIcon.svelte-1r6yeh4{height:16px}.OutcomeItem.svelte-1r6yeh4 .Date.svelte-1r6yeh4{font-size:var(--emw--font-size-small, 14px)}.HistoryLoader.svelte-1r6yeh4.svelte-1r6yeh4{display:flex;flex-direction:column;gap:16px;margin-bottom:32px}.HistoryLoader.svelte-1r6yeh4 .Skeleton{border-radius:var(--emw--border-radius-small, 12px);--emw-skeleton-primary-color:var(--emw--color-primary, #d9d9d9);--emw-skeleton-secondary-color:var(--emw--color-secondary, #999999);--emw-skeleton-text-width:255px}.HistoryLoader.svelte-1r6yeh4 .GroupLoader.svelte-1r6yeh4{display:flex;flex-direction:column;gap:16px;margin-bottom:32px}.HistoryLoader.svelte-1r6yeh4 .LoaderBody.svelte-1r6yeh4{display:flex;justify-content:space-between}.HistoryLoader.svelte-1r6yeh4 .LoaderLeft.svelte-1r6yeh4{display:flex}.HistoryLoader.svelte-1r6yeh4 .Dot.svelte-1r6yeh4 .Skeleton{border-radius:50%;margin-right:10px}.HistoryLoader.svelte-1r6yeh4 .Text.svelte-1r6yeh4 .Skeleton{margin-right:20px}.HistoryLoader.Mobile.svelte-1r6yeh4 .Skeleton{--emw-skeleton-text-width:235px}.EmptyState.svelte-1r6yeh4.svelte-1r6yeh4{display:flex;justify-content:center;align-items:center;height:200px;color:var(--emw--color-secondary-variant, #a9ccbe)}.Mobile.svelte-1r6yeh4 .GroupName.svelte-1r6yeh4{font-size:var(--emw--font-size-small, 14px)}.Mobile.svelte-1r6yeh4 .OutcomeItem.svelte-1r6yeh4{font-size:var(--emw--font-size-x-small, 12px);padding:0}.Mobile.svelte-1r6yeh4 .OutcomeItem .Date.svelte-1r6yeh4{font-size:11px}');
}
function ue(a, e, t) {
  const r = a.slice();
  return r[21] = e[t], r;
}
function ce(a, e, t) {
  const r = a.slice();
  return r[24] = e[t], r[26] = t, r;
}
function $t(a, e, t) {
  const r = a.slice();
  return r[16] = e[t], r;
}
function er(a, e, t) {
  const r = a.slice();
  return r[16] = e[t], r;
}
function tr(a) {
  let e, t, r = (
    /*$_*/
    a[3]("NoHistories") + ""
  ), n;
  return {
    c() {
      e = _("div"), t = _("p"), n = J(r), w(e, "class", "EmptyState svelte-1r6yeh4");
    },
    m(i, o) {
      M(i, e, o), b(e, t), b(t, n);
    },
    p(i, o) {
      o & /*$_*/
      8 && r !== (r = /*$_*/
      i[3]("NoHistories") + "") && V(n, r);
    },
    d(i) {
      i && O(e);
    }
  };
}
function rr(a) {
  let e, t = I(
    /*historyData*/
    a[2]
  ), r = [];
  for (let n = 0; n < t.length; n += 1)
    r[n] = fe(ue(a, t, n));
  return {
    c() {
      for (let n = 0; n < r.length; n += 1)
        r[n].c();
      e = He();
    },
    m(n, i) {
      for (let o = 0; o < r.length; o += 1)
        r[o] && r[o].m(n, i);
      M(n, e, i);
    },
    p(n, i) {
      if (i & /*historyData*/
      4) {
        t = I(
          /*historyData*/
          n[2]
        );
        let o;
        for (o = 0; o < t.length; o += 1) {
          const s = ue(n, t, o);
          r[o] ? r[o].p(s, i) : (r[o] = fe(s), r[o].c(), r[o].m(e.parentNode, e));
        }
        for (; o < r.length; o += 1)
          r[o].d(1);
        r.length = t.length;
      }
    },
    d(n) {
      n && O(e), X(r, n);
    }
  };
}
function ar(a) {
  let e, t = I([1, 2, 3]), r = [];
  for (let n = 0; n < 3; n += 1)
    r[n] = sr($t(a, t, n));
  return {
    c() {
      e = _("div");
      for (let n = 0; n < 3; n += 1)
        r[n].c();
      w(e, "class", "HistoryLoader svelte-1r6yeh4"), he(
        e,
        "Mobile",
        /*mobileView*/
        a[4]
      );
    },
    m(n, i) {
      M(n, e, i);
      for (let o = 0; o < 3; o += 1)
        r[o] && r[o].m(e, null);
    },
    p: A,
    d(n) {
      n && O(e), X(r, n);
    }
  };
}
function nr(a) {
  let e, t;
  return {
    c() {
      e = _("img"), j(e.src, t = /*outcome*/
      a[24].prizeImage) || w(e, "src", t), w(e, "alt", "prize"), w(e, "class", "PrizeImg svelte-1r6yeh4");
    },
    m(r, n) {
      M(r, e, n);
    },
    p(r, n) {
      n & /*historyData*/
      4 && !j(e.src, t = /*outcome*/
      r[24].prizeImage) && w(e, "src", t);
    },
    d(r) {
      r && O(e);
    }
  };
}
function ir(a) {
  let e, t = (
    /*outcome*/
    a[24].prizeName + ""
  ), r;
  return {
    c() {
      e = _("span"), r = J(t);
    },
    m(n, i) {
      M(n, e, i), b(e, r);
    },
    p(n, i) {
      i & /*historyData*/
      4 && t !== (t = /*outcome*/
      n[24].prizeName + "") && V(r, t);
    },
    d(n) {
      n && O(e);
    }
  };
}
function de(a) {
  let e, t, r, n, i, o, s, c, d, h, u, m = (
    /*outcome*/
    a[24].date + ""
  ), l, g;
  function T(p, f) {
    if (
      /*outcome*/
      p[24].prizeName
    )
      return ir;
    if (
      /*outcome*/
      p[24].prizeImage
    )
      return nr;
  }
  let x = T(a), y = x && x(a);
  return {
    c() {
      e = _("div"), t = _("div"), r = _("span"), r.textContent = `${/*index*/
      a[26] + 1}`, n = U(), i = _("div"), y && y.c(), o = U(), s = _("img"), d = U(), h = _("div"), u = _("span"), l = J(m), g = U(), w(r, "class", "Index"), j(s.src, c = /*outcome*/
      a[24].state ? se : le) || w(s, "src", c), w(s, "alt", "status"), w(s, "class", "StatusIcon svelte-1r6yeh4"), w(i, "class", "PrizeInfo svelte-1r6yeh4"), w(t, "class", "OutcomeLeft svelte-1r6yeh4"), w(u, "class", "Date svelte-1r6yeh4"), w(h, "class", "OutcomeRight"), w(e, "class", "OutcomeItem svelte-1r6yeh4");
    },
    m(p, f) {
      M(p, e, f), b(e, t), b(t, r), b(t, n), b(t, i), y && y.m(i, null), b(i, o), b(i, s), b(e, d), b(e, h), b(h, u), b(u, l), b(e, g);
    },
    p(p, f) {
      x === (x = T(p)) && y ? y.p(p, f) : (y && y.d(1), y = x && x(p), y && (y.c(), y.m(i, o))), f & /*historyData*/
      4 && !j(s.src, c = /*outcome*/
      p[24].state ? se : le) && w(s, "src", c), f & /*historyData*/
      4 && m !== (m = /*outcome*/
      p[24].date + "") && V(l, m);
    },
    d(p) {
      p && O(e), y && y.d();
    }
  };
}
function fe(a) {
  let e, t, r = (
    /*group*/
    a[21].name + ""
  ), n, i, o, s, c, d = I(
    /*group*/
    a[21].outcomes
  ), h = [];
  for (let u = 0; u < d.length; u += 1)
    h[u] = de(ce(a, d, u));
  return {
    c() {
      e = _("div"), t = _("div"), n = J(r), i = U(), o = _("div");
      for (let u = 0; u < h.length; u += 1)
        h[u].c();
      c = U(), w(t, "class", "GroupName svelte-1r6yeh4"), w(o, "class", "OutcomesList svelte-1r6yeh4"), w(o, "style", s = /*group*/
      a[21].outcomes.length <= 5 ? "overflow: hidden;" : ""), w(e, "class", "HistoryItem svelte-1r6yeh4");
    },
    m(u, m) {
      M(u, e, m), b(e, t), b(t, n), b(e, i), b(e, o);
      for (let l = 0; l < h.length; l += 1)
        h[l] && h[l].m(o, null);
      b(e, c);
    },
    p(u, m) {
      if (m & /*historyData*/
      4 && r !== (r = /*group*/
      u[21].name + "") && V(n, r), m & /*historyData*/
      4) {
        d = I(
          /*group*/
          u[21].outcomes
        );
        let l;
        for (l = 0; l < d.length; l += 1) {
          const g = ce(u, d, l);
          h[l] ? h[l].p(g, m) : (h[l] = de(g), h[l].c(), h[l].m(o, null));
        }
        for (; l < h.length; l += 1)
          h[l].d(1);
        h.length = d.length;
      }
      m & /*historyData*/
      4 && s !== (s = /*group*/
      u[21].outcomes.length <= 5 ? "overflow: hidden;" : "") && w(o, "style", s);
    },
    d(u) {
      u && O(e), X(h, u);
    }
  };
}
function or(a) {
  let e;
  return {
    c() {
      e = _("div"), e.innerHTML = '<div class="LoaderLeft svelte-1r6yeh4"><ui-skeleton class="Dot svelte-1r6yeh4" structure="rectangle" width="16px" height="16px"></ui-skeleton> <ui-skeleton class="Text svelte-1r6yeh4" structure="text" height="16px"></ui-skeleton></div> <ui-skeleton class="Text svelte-1r6yeh4" structure="text" width="50px" height="16px"></ui-skeleton>', w(e, "class", "LoaderBody svelte-1r6yeh4");
    },
    m(t, r) {
      M(t, e, r);
    },
    p: A,
    d(t) {
      t && O(e);
    }
  };
}
function sr(a) {
  let e, t, r, n, i = I([1, 2, 3]), o = [];
  for (let s = 0; s < 3; s += 1)
    o[s] = or(er(a, i, s));
  return {
    c() {
      e = _("div"), t = _("ui-skeleton"), r = U();
      for (let s = 0; s < 3; s += 1)
        o[s].c();
      n = U(), ee(t, "structure", "text"), ee(t, "height", "16px"), w(e, "class", "GroupLoader svelte-1r6yeh4");
    },
    m(s, c) {
      M(s, e, c), b(e, t), b(e, r);
      for (let d = 0; d < 3; d += 1)
        o[d] && o[d].m(e, null);
      b(e, n);
    },
    p: A,
    d(s) {
      s && O(e), X(o, s);
    }
  };
}
function lr(a) {
  let e, t, r;
  function n(s, c) {
    return (
      /*loading*/
      s[1] ? ar : (
        /*historyData*/
        s[2].length > 0 ? rr : tr
      )
    );
  }
  let i = n(a), o = i(a);
  return {
    c() {
      e = _("div"), t = _("div"), o.c(), w(t, "class", "HistoryList svelte-1r6yeh4"), w(e, "class", "PrizeHistoryContent svelte-1r6yeh4"), he(
        e,
        "Mobile",
        /*mobileView*/
        a[4]
      );
    },
    m(s, c) {
      M(s, e, c), b(e, t), o.m(t, null), a[13](e);
    },
    p(s, [c]) {
      i === (i = n(s)) && o ? o.p(s, c) : (o.d(1), o = i(s), o && (o.c(), o.m(t, null)));
    },
    i(s) {
      s && (r || Pe(() => {
        r = Se(e, Le, { duration: 300 }), r.start();
      }));
    },
    o: A,
    d(s) {
      s && O(e), o.d(), a[13](null);
    }
  };
}
let ur = null;
function cr(a, e, t) {
  let r;
  We(a, Ne, (f) => t(3, r = f));
  let { endpoint: n = "" } = e, { session: i = "" } = e, { lang: o = "en" } = e, { clientstyling: s = "" } = e, { clientstylingurl: c = "" } = e, { translationurl: d = "" } = e, { mbsource: h = "" } = e, { type: u = "wheelOfFortune" } = e, m;
  const l = Ue(window.navigator.userAgent);
  let g = !0, T = [];
  je();
  const x = () => {
    fetch(d).then((P) => P.json()).then((P) => {
      Object.keys(P).forEach((H) => {
        me(H, P[H]);
      });
    });
  }, y = async () => {
    if (!(!n || !i)) {
      t(1, g = !0);
      try {
        t(2, T = await Kt.fetchFullHistory(n, i, o, [u]));
      } catch (f) {
        console.error("[PrizeEngineHistory] Fetch failed", f);
      } finally {
        t(1, g = !1);
      }
    }
  };
  Ee(() => () => {
  });
  function p(f) {
    Ye[f ? "unshift" : "push"](() => {
      m = f, t(0, m);
    });
  }
  return a.$$set = (f) => {
    "endpoint" in f && t(5, n = f.endpoint), "session" in f && t(6, i = f.session), "lang" in f && t(7, o = f.lang), "clientstyling" in f && t(8, s = f.clientstyling), "clientstylingurl" in f && t(9, c = f.clientstylingurl), "translationurl" in f && t(10, d = f.translationurl), "mbsource" in f && t(11, h = f.mbsource), "type" in f && t(12, u = f.type);
  }, a.$$.update = () => {
    a.$$.dirty & /*lang*/
    128 && o && Re(o), a.$$.dirty & /*translationurl*/
    1024 && d && x(), a.$$.dirty & /*endpoint, session, type*/
    4192 && n && i && u && y(), a.$$.dirty & /*clientstyling, rootContainer*/
    257 && s && m && Ie(m, s), a.$$.dirty & /*clientstylingurl, rootContainer*/
    513 && c && m && Fe(m, c), a.$$.dirty & /*mbsource, rootContainer*/
    2049 && h && m && qe(m, `${h}.Style`, ur);
  }, [
    m,
    g,
    T,
    r,
    l,
    n,
    i,
    o,
    s,
    c,
    d,
    h,
    u,
    p
  ];
}
class dr extends ke {
  constructor(e) {
    super(), Ce(
      this,
      e,
      cr,
      lr,
      Oe,
      {
        endpoint: 5,
        session: 6,
        lang: 7,
        clientstyling: 8,
        clientstylingurl: 9,
        translationurl: 10,
        mbsource: 11,
        type: 12
      },
      Zt
    );
  }
  get endpoint() {
    return this.$$.ctx[5];
  }
  set endpoint(e) {
    this.$$set({ endpoint: e }), L();
  }
  get session() {
    return this.$$.ctx[6];
  }
  set session(e) {
    this.$$set({ session: e }), L();
  }
  get lang() {
    return this.$$.ctx[7];
  }
  set lang(e) {
    this.$$set({ lang: e }), L();
  }
  get clientstyling() {
    return this.$$.ctx[8];
  }
  set clientstyling(e) {
    this.$$set({ clientstyling: e }), L();
  }
  get clientstylingurl() {
    return this.$$.ctx[9];
  }
  set clientstylingurl(e) {
    this.$$set({ clientstylingurl: e }), L();
  }
  get translationurl() {
    return this.$$.ctx[10];
  }
  set translationurl(e) {
    this.$$set({ translationurl: e }), L();
  }
  get mbsource() {
    return this.$$.ctx[11];
  }
  set mbsource(e) {
    this.$$set({ mbsource: e }), L();
  }
  get type() {
    return this.$$.ctx[12];
  }
  set type(e) {
    this.$$set({ type: e }), L();
  }
}
customElements.define("prize-engine-history", Me(dr, { endpoint: {}, session: {}, lang: {}, clientstyling: {}, clientstylingurl: {}, translationurl: {}, mbsource: {}, type: {} }, [], [], !0));
export {
  dr as default
};
