import { jsxs as c, Fragment as F, jsx as t } from "react/jsx-runtime";
import { i as N, u as V, e as $, c as v, b as G, B as a, W as E, a as J } from "./PrizeCard-C2El3VOB.js";
import { s as K, h as O } from "./helpers-uh28Hksw.js";
import { R as Q } from "./NotFoundSkeleton-BJ7rW_uC.js";
import { T as k } from "./Button-DPGn5NZd.js";
import "react";
import { S as X } from "./ChanceGameEmbedVariant-ConiQ7Ej.js";
import { d as Y, a as Z, b as _ } from "./useImageVariant-f37LbO43.js";
import "react-dom";
const ee = (e) => ({
  // Main headline section with background image
  headlineSection: {
    display: "flex",
    flexDirection: "column",
    justifyContent: "space-between",
    gap: "10px",
    flex: "0.5",
    backgroundImage: `url("${e.finalImage}")`,
    backgroundSize: "cover",
    backgroundPosition: "center",
    borderTopLeftRadius: e.borderRadius.md,
    borderTopRightRadius: e.isMobile ? e.borderRadius.md : 0,
    borderBottomLeftRadius: e.isMobile ? 0 : e.borderRadius.md,
    overflow: "hidden",
    height: "auto",
    position: "relative",
    minHeight: e.isMobile ? "210px" : "430px",
    "&::before": {
      content: '""',
      position: "absolute",
      width: "100%",
      height: "100%",
      borderTopLeftRadius: "5px",
      borderTopRightRadius: "5px"
    }
  },
  // Main content area
  mainContentArea: {
    flex: "0.5",
    display: "flex",
    flexDirection: "column",
    justifyContent: "center",
    p: e.spacingScale.lg
  },
  headlineContent: {
    zIndex: 1,
    height: "100%",
    p: e.spacingScale.xl,
    gap: e.spacingScale.xl,
    display: "flex",
    flexDirection: "column",
    justifyContent: "space-between"
  },
  // Headline text
  headlineText: {
    fontWeight: 500,
    lineHeight: "166%",
    letterSpacing: "1px",
    fontSize: "0.75em",
    color: e.secondaryColor,
    opacity: "70%",
    textTransform: "uppercase",
    fontFamily: e.fontFamilySecondary,
    textAlign: e.isMobile ? "center" : "left"
  },
  // Title text
  titleText: {
    fontWeight: 700,
    lineHeight: "133%",
    fontSize: "1.5em",
    letterSpacing: "0.15px",
    color: e.contentColor,
    fontFamily: e.fontFamilyPrimary,
    textAlign: e.isMobile ? "center" : "left"
  },
  // Description text
  descriptionText: {
    fontWeight: 400,
    lineHeight: "140%",
    fontSize: "1.25em",
    letterSpacing: "0.15px",
    color: e.secondaryColor,
    opacity: "70%",
    fontFamily: e.fontFamilyPrimary,
    textAlign: e.isMobile ? "center" : "left"
  },
  ctaWrapper: {
    display: "flex",
    flexDirection: "column",
    justifyContent: "space-between",
    alignItems: "center",
    gap: e.spacingScale["2xl"]
  },
  // Content container
  contentContainer: {
    display: "flex",
    flexDirection: "column",
    gap: e.spacingScale["3xs"]
  }
}), de = ({
  entity: e,
  headline: T,
  finalImage: d,
  signInContent: p,
  brandingContent: b,
  rulesDisplay: i
}) => {
  var u;
  const s = N(), S = V(), m = $(), r = v().primary, R = v().secondary, g = G(), o = ((u = e.branding) == null ? void 0 : u.colors) || null, C = (o == null ? void 0 : o.contentColor) || S.colorSchemes.dark.textColor, I = (o == null ? void 0 : o.secondaryColor) || S.colorSchemes.dark.textColor, l = ee({
    finalImage: d,
    spacingScale: m,
    borderRadius: g,
    fontFamilyPrimary: r,
    fontFamilySecondary: R,
    secondaryColor: I,
    contentColor: C,
    opacity: "60%",
    isMobile: s
  });
  return /* @__PURE__ */ c(F, { children: [
    /* @__PURE__ */ t(a, { sx: l.headlineSection, children: /* @__PURE__ */ c(a, { sx: l.headlineContent, children: [
      /* @__PURE__ */ c(a, { sx: { display: "flex", flexDirection: "column", alignItems: s ? "center" : "flex-start", gap: m["3xs"] }, children: [
        /* @__PURE__ */ c(a, { sx: { display: "flex", alignItems: "center", gap: m["3xs"] }, children: [
          /* @__PURE__ */ t(k, { sx: l.headlineText, children: T }),
          /* @__PURE__ */ t(
            Q,
            {
              rulesDisplay: i,
              rules: e.rules || ""
            }
          )
        ] }),
        /* @__PURE__ */ c(a, { sx: l.contentContainer, children: [
          /* @__PURE__ */ t(k, { sx: l.titleText, children: e.title }),
          /* @__PURE__ */ t(k, { sx: l.descriptionText, children: K(e.description) })
        ] })
      ] }),
      s ? /* @__PURE__ */ t(F, {}) : b
    ] }) }),
    /* @__PURE__ */ t(a, { sx: l.mainContentArea, children: /* @__PURE__ */ c(a, { sx: l.ctaWrapper, children: [
      p,
      s && b
    ] }) })
  ] });
}, me = (e) => {
  var D, l, u, A, L, M, W;
  const T = V(), d = N(), p = e.defaultImagePlaceholder ? e.defaultImagePlaceholder : d ? Y : Z, b = _(
    {
      images: e.entity.images || null,
      imagePlaceholder: p
    },
    E.SPLIT
  ), i = ((D = e.entity.branding) == null ? void 0 : D.colors) || null, s = (i == null ? void 0 : i.borderColor) || null, S = (i == null ? void 0 : i.backgroundColor) || J().surfaceVariant, m = O(S), r = $(), R = G(), g = d ? ((u = (l = e.entity.branding) == null ? void 0 : l.images) == null ? void 0 : u.mobileLogo) || ((L = (A = e.entity.branding) == null ? void 0 : A.images) == null ? void 0 : L.mainLogo) || "" : ((W = (M = e.entity.branding) == null ? void 0 : M.images) == null ? void 0 : W.mainLogo) || "", o = {
    questionArea: {
      width: "100%",
      justifyContent: "center",
      display: "flex",
      flexDirection: "column"
    },
    questionAreaContent: {
      p: r.lg,
      display: "flex",
      flexDirection: "column",
      justifyContent: "center",
      gap: "16px"
    },
    leadContentContainer: {
      p: r.md,
      gap: r.md,
      display: "flex",
      flexDirection: "column",
      backdropFilter: "blur(4px)",
      bgcolor: `rgba(${m.replace(/[^\d,]/g, "")}, 0.5)`,
      borderRadius: R.sm
    }
  }, C = (P) => {
    var n, f, x, y, h;
    return /* @__PURE__ */ t(
      e.PresentedBy,
      {
        brandingLogo: g,
        textColor: P,
        label: ((n = e.entity.labels) == null ? void 0 : n.sponsor) || null,
        primaryUrl: (x = (f = e.entity.branding) == null ? void 0 : f.urls) == null ? void 0 : x.primaryUrl,
        secondaryUrl: (h = (y = e.entity.branding) == null ? void 0 : y.urls) == null ? void 0 : h.secondaryUrl,
        isCentered: !1
      }
    );
  }, I = () => {
    var f, x, y, h, j, B, w, z, H, U, q;
    const { CollectLeadWrapper: P, entity: n } = e;
    return /* @__PURE__ */ c(F, { children: [
      /* @__PURE__ */ t(a, { sx: o.questionArea, children: /* @__PURE__ */ t(a, { sx: o.questionAreaContent, children: /* @__PURE__ */ t(a, { sx: o.leadContentContainer, children: /* @__PURE__ */ t(
        P,
        {
          sdk: e.sdk,
          contentId: n.id,
          contentName: n.title,
          brandingColors: (f = n.branding) == null ? void 0 : f.colors,
          brandingUrls: (x = n.branding) == null ? void 0 : x.urls,
          campaignId: (y = e.leads) == null ? void 0 : y.campaignId,
          campaignName: (h = e.leads) == null ? void 0 : h.campaignName,
          fields: (j = e.leads) == null ? void 0 : j.fields,
          leadTitle: (B = n.labels) == null ? void 0 : B.leadTitle,
          leadDescription: (w = n.labels) == null ? void 0 : w.leadDescription,
          leadCta: (z = n.labels) == null ? void 0 : z.leadCta,
          leadSuccessTitle: (H = n.labels) == null ? void 0 : H.leadSuccessTitle,
          leadSuccessDescription: (U = n.labels) == null ? void 0 : U.leadSuccessDescription,
          syncWithProfile: (q = e.leads) == null ? void 0 : q.syncWithProfile,
          startGame: e.onLeadSubmitted,
          isAfterPosition: !0,
          isSubmittingParticipation: e.isSubmitting
        }
      ) }) }) }),
      g && d && /* @__PURE__ */ t(a, { sx: { mb: r.lg, px: r.lg }, children: C(
        (i == null ? void 0 : i.contentColor) || T.colorSchemes.dark.textColor
      ) })
    ] });
  };
  return /* @__PURE__ */ t(e.MainCard, { brandingBorderColor: s, children: /* @__PURE__ */ t(
    X,
    {
      entity: e.entity,
      headline: e.headline,
      finalImage: b,
      brandingLogo: g,
      renderPresentedBy: C,
      rulesDisplay: e.rulesDisplay,
      children: I()
    }
  ) });
};
export {
  de as S,
  me as a
};
