import { S as Q, i as V, s as Z, f as y, b as G, n as C, d as b, h as x, k as g, q as S, u as J, w as K, C as M, D as I, j as h, e as s, m as A, a2 as B, c as O, Z as H, t as X, g as v, x as Y, y as $, z as tt, A as et } from "./GeneralLogout-CShGWvvZ.js";
import "../stencil/ui-skeleton-CTFP1U_H.js";
function it(a) {
  G(a, "svelte-1b8j2p", ':host{padding:0;margin:0;font-family:inherit}.PlayerAccountNotificationsContainer{padding:0 5px;display:grid;grid-gap:20px;animation-name:fadeIn;animation-iteration-count:1;animation-timing-function:ease-in;animation-duration:0.3s;container-type:inline-size;container-name:notifications-container}.PlayerAccountNotificationBox{background:var(--emw--color-pale, var(--emw--color-gray-50, #f1f1f1));display:block;padding:20px;border-radius:var(--emw--border-radius-medium, 10px);width:100%;color:var(--emw--color-black, #000);box-sizing:border-box;text-decoration:none;word-break:break-word;word-wrap:break-word;overflow-wrap:anywhere;white-space:normal}.PlayerAccountNotificationBoxHeader{display:grid;width:100%;grid-template-areas:"nav  main  aside";grid-template-rows:auto;grid-template-columns:34px calc(100% - 34px);align-items:center}.PlayerAccountNotificationBoxHeader .PlayerAccountNotificationIcon{width:24px;margin-right:10px;flex:1}.PlayerAccountNotificationBoxHeader .PlayerAccountNotificationTitle{font-size:16px;flex:2}.PlayerAccountNotificationText{margin:0;font-size:14px;font-weight:300}.PlayerAccountNotificationText a{text-decoration:none;color:var(--emw--color-white, #FFFFFF)}.PlayerAccountNotificationsMobileContainer{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-gap:20px;padding:20px}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationBoxHeader{grid-template-columns:40px calc(100% - 40px)}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationTitle{font-size:14px}.PlayerAccountNotificationsMobileContainer .PlayerAccountNotificationIcon{width:30px;margin-right:10px}.skeletonContainer{container-type:inline-size}.skeletonContainer .skeletonWrapper{animation:fadeIn ease 0.3s}@container (max-width: 768px){.skeletonContainer .skeletonWrapper{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));grid-gap:20px}.skeletonContainer .skeletonWrapper .skeletonNotification{width:100%}}@container (max-width: 425px){.skeletonContainer .skeletonWrapper{display:grid;grid-template-columns:repeat(1, minmax(0, 1fr));grid-gap:20px;padding:0px 10px}.skeletonContainer .skeletonWrapper .skeletonNotification{width:100%}}@keyframes fadeIn{0%{opacity:0.01}1%{opacity:0}50%{opacity:0}100%{opacity:1}}');
}
function W(a, t, n) {
  const e = a.slice();
  return e[24] = t[n], e;
}
function z(a, t, n) {
  const e = a.slice();
  return e[21] = t[n], e;
}
function nt(a) {
  let t, n = M(
    /*notificationsData*/
    a[1]
  ), e = [];
  for (let i = 0; i < n.length; i += 1)
    e[i] = L(W(a, n, i));
  return {
    c() {
      t = g("div");
      for (let i = 0; i < e.length; i += 1)
        e[i].c();
      s(t, "class", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (a[3] ? "PlayerAccountNotificationsMobileContainer" : "")), s(t, "part", "PlayerAccountNotificationsContainer " + /*isMobile*/
      (a[3] ? "PlayerAccountNotificationsMobileContainer" : ""));
    },
    m(i, o) {
      x(i, t, o);
      for (let l = 0; l < e.length; l += 1)
        e[l] && e[l].m(t, null);
    },
    p(i, o) {
      if (o & /*notificationsData*/
      2) {
        n = M(
          /*notificationsData*/
          i[1]
        );
        let l;
        for (l = 0; l < n.length; l += 1) {
          const r = W(i, n, l);
          e[l] ? e[l].p(r, o) : (e[l] = L(r), e[l].c(), e[l].m(t, null));
        }
        for (; l < e.length; l += 1)
          e[l].d(1);
        e.length = n.length;
      }
    },
    d(i) {
      i && b(t), I(e, i);
    }
  };
}
function ot(a) {
  let t, n, e = M({ length: 3 }), i = [];
  for (let o = 0; o < e.length; o += 1)
    i[o] = F(z(a, e, o));
  return {
    c() {
      t = g("div"), n = g("div");
      for (let o = 0; o < i.length; o += 1)
        i[o].c();
      s(n, "class", "skeletonWrapper"), s(t, "class", "skeletonContainer");
    },
    m(o, l) {
      x(o, t, l), h(t, n);
      for (let r = 0; r < i.length; r += 1)
        i[r] && i[r].m(n, null);
    },
    p(o, l) {
      if (l & /*isMobile, mediaQuery*/
      24) {
        e = M({ length: 3 });
        let r;
        for (r = 0; r < e.length; r += 1) {
          const d = z(o, e, r);
          i[r] ? i[r].p(d, l) : (i[r] = F(d), i[r].c(), i[r].m(n, null));
        }
        for (; r < i.length; r += 1)
          i[r].d(1);
        i.length = e.length;
      }
    },
    d(o) {
      o && b(t), I(i, o);
    }
  };
}
function L(a) {
  let t, n, e, i, o, l, r, d = (
    /*notification*/
    a[24].title + ""
  ), p, _, u, k = (
    /*notification*/
    a[24].description + ""
  ), P;
  return {
    c() {
      t = g("div"), n = g("div"), e = g("img"), l = A(), r = g("p"), p = X(d), _ = A(), u = g("p"), P = A(), s(e, "class", "PlayerAccountNotificationIcon"), s(e, "width", "24px"), s(e, "height", "24px"), B(e.src, i = /*notification*/
      a[24].icon) || s(e, "src", i), s(e, "alt", o = /*notification*/
      a[24].title), s(r, "class", "PlayerAccountNotificationTitle"), s(n, "class", "PlayerAccountNotificationBoxHeader"), s(u, "class", "PlayerAccountNotificationText"), s(t, "class", "PlayerAccountNotificationBox"), H(
        t,
        "background",
        /*notification*/
        a[24].backgroundColor
      );
    },
    m(m, f) {
      x(m, t, f), h(t, n), h(n, e), h(n, l), h(n, r), h(r, p), h(t, _), h(t, u), u.innerHTML = k, h(t, P);
    },
    p(m, f) {
      f & /*notificationsData*/
      2 && !B(e.src, i = /*notification*/
      m[24].icon) && s(e, "src", i), f & /*notificationsData*/
      2 && o !== (o = /*notification*/
      m[24].title) && s(e, "alt", o), f & /*notificationsData*/
      2 && d !== (d = /*notification*/
      m[24].title + "") && O(p, d), f & /*notificationsData*/
      2 && k !== (k = /*notification*/
      m[24].description + "") && (u.innerHTML = k), f & /*notificationsData*/
      2 && H(
        t,
        "background",
        /*notification*/
        m[24].backgroundColor
      );
    },
    d(m) {
      m && b(t);
    }
  };
}
function lt(a) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), v(t, "structure", "rectangle"), v(t, "width", "auto"), v(
        t,
        "height",
        /*isMobile*/
        a[3] && /*mediaQuery*/
        a[4].matches ? "250px" : "400px"
      );
    },
    m(n, e) {
      x(n, t, e);
    },
    p: C,
    d(n) {
      n && b(t);
    }
  };
}
function at(a) {
  let t;
  return {
    c() {
      t = g("ui-skeleton"), t.innerHTML = "", v(t, "structure", "rectangle"), v(t, "width", "auto"), v(t, "height", "130px");
    },
    m(n, e) {
      x(n, t, e);
    },
    p: C,
    d(n) {
      n && b(t);
    }
  };
}
function F(a) {
  let t, n;
  function e(l, r) {
    return (
      /*isMobile*/
      l[3] ? lt : at
    );
  }
  let o = e(a)(a);
  return {
    c() {
      t = g("div"), o.c(), n = A(), s(t, "class", "skeletonNotification");
    },
    m(l, r) {
      x(l, t, r), o.m(t, null), h(t, n);
    },
    p(l, r) {
      o.p(l, r);
    },
    d(l) {
      l && b(t), o.d();
    }
  };
}
function rt(a) {
  let t;
  function n(o, l) {
    var r;
    if (
      /*skeletonLoading*/
      o[2]
    )
      return ot;
    if (
      /*notificationsData*/
      (r = o[1]) != null && r.length
    )
      return nt;
  }
  let e = n(a), i = e && e(a);
  return {
    c() {
      t = g("div"), i && i.c();
    },
    m(o, l) {
      x(o, t, l), i && i.m(t, null), a[13](t);
    },
    p(o, [l]) {
      e === (e = n(o)) && i ? i.p(o, l) : (i && i.d(1), i = e && e(o), i && (i.c(), i.m(t, null)));
    },
    i: C,
    o: C,
    d(o) {
      o && b(t), i && i.d(), a[13](null);
    }
  };
}
function ct(a, t, n) {
  let { lang: e = "" } = t, { cmsendpoint: i = "" } = t, { env: o = "" } = t, { userroles: l = "" } = t, { customnotif: r = "" } = t, { clientstyling: d = "" } = t, { clientstylingurl: p = "" } = t, { mbsource: _ } = t, u, k = !0, P = window.navigator.userAgent, m = S(P) !== "PC", f = [], N = [], j = D();
  const q = window.matchMedia("(min-width: 768px)");
  function D() {
    const c = S(P);
    if (c)
      return c === "PC" ? "dk" : "mtWeb";
  }
  const R = () => {
    const c = new URL(`${i}/${e}/support-information`);
    c.searchParams.append("env", o), c.searchParams.append("userRoles", l), c.searchParams.append("device", j), fetch(c.href).then((w) => w.json()).then((w) => {
      w.length && (n(1, f = w[0].children), f == null || f.forEach((E) => {
        N.length && (E.backgroundColor = N[0], N.shift());
      }));
    }).catch((w) => {
      console.error(w);
    }).finally(() => {
      setTimeout(
        () => {
          n(2, k = !1);
        },
        1e3
      );
    });
  }, T = () => {
    r.replace(" ", ""), N = r.split(",");
  };
  J(() => () => {
  });
  function U(c) {
    K[c ? "unshift" : "push"](() => {
      u = c, n(0, u);
    });
  }
  return a.$$set = (c) => {
    "lang" in c && n(5, e = c.lang), "cmsendpoint" in c && n(6, i = c.cmsendpoint), "env" in c && n(7, o = c.env), "userroles" in c && n(8, l = c.userroles), "customnotif" in c && n(9, r = c.customnotif), "clientstyling" in c && n(10, d = c.clientstyling), "clientstylingurl" in c && n(11, p = c.clientstylingurl), "mbsource" in c && n(12, _ = c.mbsource);
  }, a.$$.update = () => {
    a.$$.dirty & /*customnotif*/
    512 && r && T(), a.$$.dirty & /*notificationsData*/
    2 && f && T(), a.$$.dirty & /*userroles, cmsendpoint, env, lang*/
    480 && l && i && o && e && R(), a.$$.dirty & /*clientstyling, customStylingContainer*/
    1025 && d && u && Y(u, d), a.$$.dirty & /*clientstylingurl, customStylingContainer*/
    2049 && p && u && $(u, p), a.$$.dirty & /*mbsource, customStylingContainer*/
    4097 && _ && u && tt(u, `${_}.Style`);
  }, [
    u,
    f,
    k,
    m,
    q,
    e,
    i,
    o,
    l,
    r,
    d,
    p,
    _,
    U
  ];
}
class st extends Q {
  constructor(t) {
    super(), V(
      this,
      t,
      ct,
      rt,
      Z,
      {
        lang: 5,
        cmsendpoint: 6,
        env: 7,
        userroles: 8,
        customnotif: 9,
        clientstyling: 10,
        clientstylingurl: 11,
        mbsource: 12
      },
      it
    );
  }
  get lang() {
    return this.$$.ctx[5];
  }
  set lang(t) {
    this.$$set({ lang: t }), y();
  }
  get cmsendpoint() {
    return this.$$.ctx[6];
  }
  set cmsendpoint(t) {
    this.$$set({ cmsendpoint: t }), y();
  }
  get env() {
    return this.$$.ctx[7];
  }
  set env(t) {
    this.$$set({ env: t }), y();
  }
  get userroles() {
    return this.$$.ctx[8];
  }
  set userroles(t) {
    this.$$set({ userroles: t }), y();
  }
  get customnotif() {
    return this.$$.ctx[9];
  }
  set customnotif(t) {
    this.$$set({ customnotif: t }), y();
  }
  get clientstyling() {
    return this.$$.ctx[10];
  }
  set clientstyling(t) {
    this.$$set({ clientstyling: t }), y();
  }
  get clientstylingurl() {
    return this.$$.ctx[11];
  }
  set clientstylingurl(t) {
    this.$$set({ clientstylingurl: t }), y();
  }
  get mbsource() {
    return this.$$.ctx[12];
  }
  set mbsource(t) {
    this.$$set({ mbsource: t }), y();
  }
}
et(st, { lang: {}, cmsendpoint: {}, env: {}, userroles: {}, customnotif: {}, clientstyling: {}, clientstylingurl: {}, mbsource: {} }, [], [], !0);
export {
  st as default
};
