import { jsxs as m, jsx as l, Fragment as g } from "react/jsx-runtime";
import { aG as A, aH as w, aI as F, aJ as P, aK as M, as as G, aL as V, Z as f, z as K, aM as z, y as _, aN as k, aO as Q, aP as q, R as Z } from "./index-_1f6rhg6.js";
import { memo as D, useState as W } from "react";
function H(e, r) {
  var a = -1, s = e.length;
  for (r || (r = Array(s)); ++a < s; )
    r[a] = e[a];
  return r;
}
var Y = H, J = Math.floor, X = Math.random;
function B(e, r) {
  return e + J(X() * (r - e + 1));
}
var ee = B, re = ee;
function te(e, r) {
  var a = -1, s = e.length, i = s - 1;
  for (r = r === void 0 ? s : r; ++a < r; ) {
    var t = re(a, i), o = e[t];
    e[t] = e[a], e[a] = o;
  }
  return e.length = r, e;
}
var I = te, ae = Y, ie = I;
function se(e) {
  return ie(ae(e));
}
var oe = se;
function ne(e, r) {
  for (var a = -1, s = e == null ? 0 : e.length, i = Array(s); ++a < s; )
    i[a] = r(e[a], a, e);
  return i;
}
var le = ne, ce = le;
function de(e, r) {
  return ce(r, function(a) {
    return e[a];
  });
}
var ue = de;
function me(e, r) {
  for (var a = -1, s = Array(e); ++a < e; )
    s[a] = r(a);
  return s;
}
var pe = me, fe = A, he = w, ge = "[object Arguments]";
function be(e) {
  return he(e) && fe(e) == ge;
}
var ve = be, $ = ve, ye = w, S = Object.prototype, xe = S.hasOwnProperty, Te = S.propertyIsEnumerable, je = $(/* @__PURE__ */ function() {
  return arguments;
}()) ? $ : function(e) {
  return ye(e) && xe.call(e, "callee") && !Te.call(e, "callee");
}, ke = je, Ae = Array.isArray, U = Ae, y = { exports: {} };
function we() {
  return !1;
}
var Le = we;
y.exports;
(function(e, r) {
  var a = F, s = Le, i = r && !r.nodeType && r, t = i && !0 && e && !e.nodeType && e, o = t && t.exports === i, c = o ? a.Buffer : void 0, u = c ? c.isBuffer : void 0, d = u || s;
  e.exports = d;
})(y, y.exports);
var $e = y.exports, Ne = 9007199254740991, Ce = /^(?:0|[1-9]\d*)$/;
function _e(e, r) {
  var a = typeof e;
  return r = r ?? Ne, !!r && (a == "number" || a != "symbol" && Ce.test(e)) && e > -1 && e % 1 == 0 && e < r;
}
var Ie = _e, Se = 9007199254740991;
function Ue(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Se;
}
var O = Ue, Oe = A, Ee = O, Re = w, Fe = "[object Arguments]", Pe = "[object Array]", Me = "[object Boolean]", Ge = "[object Date]", Ve = "[object Error]", Ke = "[object Function]", ze = "[object Map]", Qe = "[object Number]", qe = "[object Object]", Ze = "[object RegExp]", De = "[object Set]", We = "[object String]", He = "[object WeakMap]", Ye = "[object ArrayBuffer]", Je = "[object DataView]", Xe = "[object Float32Array]", Be = "[object Float64Array]", er = "[object Int8Array]", rr = "[object Int16Array]", tr = "[object Int32Array]", ar = "[object Uint8Array]", ir = "[object Uint8ClampedArray]", sr = "[object Uint16Array]", or = "[object Uint32Array]", n = {};
n[Xe] = n[Be] = n[er] = n[rr] = n[tr] = n[ar] = n[ir] = n[sr] = n[or] = !0;
n[Fe] = n[Pe] = n[Ye] = n[Me] = n[Je] = n[Ge] = n[Ve] = n[Ke] = n[ze] = n[Qe] = n[qe] = n[Ze] = n[De] = n[We] = n[He] = !1;
function nr(e) {
  return Re(e) && Ee(e.length) && !!n[Oe(e)];
}
var lr = nr;
function cr(e) {
  return function(r) {
    return e(r);
  };
}
var dr = cr, x = { exports: {} };
x.exports;
(function(e, r) {
  var a = P, s = r && !r.nodeType && r, i = s && !0 && e && !e.nodeType && e, t = i && i.exports === s, o = t && a.process, c = function() {
    try {
      var u = i && i.require && i.require("util").types;
      return u || o && o.binding && o.binding("util");
    } catch {
    }
  }();
  e.exports = c;
})(x, x.exports);
var ur = x.exports, mr = lr, pr = dr, N = ur, C = N && N.isTypedArray, fr = C ? pr(C) : mr, hr = fr, gr = pe, br = ke, vr = U, yr = $e, xr = Ie, Tr = hr, jr = Object.prototype, kr = jr.hasOwnProperty;
function Ar(e, r) {
  var a = vr(e), s = !a && br(e), i = !a && !s && yr(e), t = !a && !s && !i && Tr(e), o = a || s || i || t, c = o ? gr(e.length, String) : [], u = c.length;
  for (var d in e)
    (r || kr.call(e, d)) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
    (d == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    i && (d == "offset" || d == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    t && (d == "buffer" || d == "byteLength" || d == "byteOffset") || // Skip index properties.
    xr(d, u))) && c.push(d);
  return c;
}
var wr = Ar, Lr = Object.prototype;
function $r(e) {
  var r = e && e.constructor, a = typeof r == "function" && r.prototype || Lr;
  return e === a;
}
var Nr = $r;
function Cr(e, r) {
  return function(a) {
    return e(r(a));
  };
}
var _r = Cr, Ir = _r, Sr = Ir(Object.keys, Object), Ur = Sr, Or = Nr, Er = Ur, Rr = Object.prototype, Fr = Rr.hasOwnProperty;
function Pr(e) {
  if (!Or(e))
    return Er(e);
  var r = [];
  for (var a in Object(e))
    Fr.call(e, a) && a != "constructor" && r.push(a);
  return r;
}
var Mr = Pr, Gr = A, Vr = M, Kr = "[object AsyncFunction]", zr = "[object Function]", Qr = "[object GeneratorFunction]", qr = "[object Proxy]";
function Zr(e) {
  if (!Vr(e))
    return !1;
  var r = Gr(e);
  return r == zr || r == Qr || r == Kr || r == qr;
}
var Dr = Zr, Wr = Dr, Hr = O;
function Yr(e) {
  return e != null && Hr(e.length) && !Wr(e);
}
var Jr = Yr, Xr = wr, Br = Mr, et = Jr;
function rt(e) {
  return et(e) ? Xr(e) : Br(e);
}
var tt = rt, at = ue, it = tt;
function st(e) {
  return e == null ? [] : at(e, it(e));
}
var ot = st, nt = I, lt = ot;
function ct(e) {
  return nt(lt(e));
}
var dt = ct, ut = oe, mt = dt, pt = U;
function ft(e) {
  var r = pt(e) ? ut : mt;
  return r(e);
}
var ht = ft;
const gt = /* @__PURE__ */ G(ht), b = z("", {
  // Variants won't have any style by default. Style will only be applied if the variants are combined.
  // So, style is defined in compoundVariants.
  variants: {
    variant: {
      basic: "",
      ProfileCard: "",
      SidebarCard: ""
    },
    structure: {
      image: "",
      card: "",
      title: "",
      description: ""
    }
  },
  compoundVariants: [
    // Style for Basic Variants types
    {
      variant: "basic",
      structure: "image",
      className: "w-10 h-auto"
    },
    {
      variant: "basic",
      structure: "card",
      className: "p-5"
    },
    {
      variant: "basic",
      structure: "title",
      className: "text-base mt-4"
    },
    {
      variant: "basic",
      structure: "description",
      className: "text-sm leading-[18px] text-subtle font-normal"
    },
    // Style for ProfileCard Variant Types
    {
      variant: "ProfileCard",
      structure: "image",
      className: "w-9 h-auto rounded-full mb-4s"
    },
    {
      variant: "ProfileCard",
      structure: "card",
      className: "w-80 p-4 hover:bg-subtle"
    },
    {
      variant: "ProfileCard",
      structure: "title",
      className: "text-base"
    },
    {
      variant: "ProfileCard",
      structure: "description",
      className: "text-sm leading-[18px] text-subtle font-normal"
    },
    // Style for SidebarCard Variant Types
    {
      variant: "SidebarCard",
      structure: "image",
      className: "w-9 h-auto rounded-full mb-4s"
    },
    {
      variant: "SidebarCard",
      structure: "card",
      className: "w-full p-3 border border-subtle"
    },
    {
      variant: "SidebarCard",
      structure: "title",
      className: "text-sm font-cal"
    },
    {
      variant: "SidebarCard",
      structure: "description",
      className: "text-xs text-default line-clamp-2"
    }
  ]
});
function bt({
  image: e,
  title: r,
  icon: a,
  description: s,
  variant: i,
  actionButton: t,
  containerProps: o,
  imageProps: c,
  mediaLink: u,
  thumbnailUrl: d,
  learnMore: p
}) {
  const T = p && p.href.startsWith("https") ? "a" : V;
  return /* @__PURE__ */ m(
    "div",
    {
      className: f(
        o == null ? void 0 : o.className,
        b({ variant: i, structure: "card" }),
        "bg-default border-subtle text-default flex flex-col justify-between rounded-md border"
      ),
      "data-testid": "card-container",
      ...o,
      children: [
        /* @__PURE__ */ m("div", { children: [
          a && a,
          e && /* @__PURE__ */ l(
            "img",
            {
              src: e,
              alt: c == null ? void 0 : c.alt,
              className: f(
                c == null ? void 0 : c.className,
                b({ variant: i, structure: "image" })
              ),
              ...c
            }
          ),
          /* @__PURE__ */ l(
            "h5",
            {
              title: r,
              className: f(
                b({ variant: i, structure: "title" }),
                "text-emphasis line-clamp-1 font-bold leading-5"
              ),
              children: r
            }
          ),
          s && /* @__PURE__ */ l(
            "p",
            {
              title: s.toString(),
              className: f(b({ variant: i, structure: "description" }), "pt-1"),
              children: s
            }
          )
        ] }),
        i === "SidebarCard" && /* @__PURE__ */ m(
          "a",
          {
            onClick: t == null ? void 0 : t.onClick,
            target: "_blank",
            rel: "noreferrer",
            href: u,
            "data-testid": t == null ? void 0 : t["data-testid"],
            className: "group relative my-3 flex aspect-video items-center overflow-hidden rounded",
            children: [
              /* @__PURE__ */ l("div", { className: "absolute inset-0 bg-black bg-opacity-50 transition group-hover:bg-opacity-40" }),
              /* @__PURE__ */ m(
                "svg",
                {
                  className: "text-inverted absolute left-1/2 top-1/2 h-8 w-8 -translate-x-1/2 -translate-y-1/2 transform rounded-full shadow-lg transition-all hover:-mt-px",
                  viewBox: "0 0 32 32",
                  fill: "none",
                  xmlns: "http://www.w3.org/2000/svg",
                  children: [
                    /* @__PURE__ */ l(
                      "path",
                      {
                        d: "M16 32C24.8366 32 32 24.8366 32 16C32 7.16344 24.8366 0 16 0C7.16344 0 0 7.16344 0 16C0 24.8366 7.16344 32 16 32Z",
                        fill: "white"
                      }
                    ),
                    /* @__PURE__ */ l(
                      "path",
                      {
                        d: "M12.1667 8.5L23.8334 16L12.1667 23.5V8.5Z",
                        fill: "#111827",
                        stroke: "#111827",
                        strokeWidth: "1.5",
                        strokeLinecap: "round",
                        strokeLinejoin: "round"
                      }
                    )
                  ]
                }
              ),
              /* @__PURE__ */ l("img", { alt: "play feature video", src: d })
            ]
          }
        ),
        i === "basic" && t && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
          K,
          {
            color: "secondary",
            href: t == null ? void 0 : t.href,
            className: "mt-10",
            EndIcon: "arrow-right",
            "data-testid": t["data-testid"],
            children: t == null ? void 0 : t.child
          }
        ) }),
        i === "SidebarCard" && /* @__PURE__ */ m("div", { className: "mt-2 flex items-center justify-between", children: [
          p && /* @__PURE__ */ l(
            T,
            {
              href: p.href,
              onClick: t == null ? void 0 : t.onClick,
              target: "_blank",
              rel: "noreferrer",
              className: "text-default text-xs font-medium",
              children: p.text
            }
          ),
          (t == null ? void 0 : t.child) && /* @__PURE__ */ l(
            "button",
            {
              className: "text-default hover:text-emphasis p-0 text-xs font-normal",
              color: "minimal",
              "data-testid": t == null ? void 0 : t["data-testid"],
              onClick: t == null ? void 0 : t.onClick,
              children: t == null ? void 0 : t.child
            }
          )
        ] })
      ]
    }
  );
}
const vt = [
  {
    id: 17,
    thumbnailUrl: "https://img.youtube.com/vi/fMHW6jYPIb8/0.jpg",
    mediaLink: "https://go.cal.com/embed-video",
    title: "Embed",
    description: "Embed your booking page on your website",
    href: "https://go.cal.com/embed-video"
  },
  {
    id: 16,
    thumbnailUrl: "https://img.youtube.com/vi/xopxmk2H4Ng/0.jpg",
    mediaLink: "https://go.cal.com/paid-booking",
    title: "Paid Bookings",
    description: "Charge for your time with Cal.com's paid bookings",
    href: "https://go.cal.com/paid-booking"
  },
  {
    id: 15,
    thumbnailUrl: "https://img.youtube.com/vi/ZjSD1yPgLLQ/0.jpg",
    mediaLink: "https://go.cal.com/instant-meetings-video",
    title: "Instant Meetings",
    description: "Book meetings instantly with a link",
    href: "https://go.cal.com/instant-meetings-video"
  },
  {
    id: 14,
    thumbnailUrl: "https://img.youtube.com/vi/IZ4-nUiIpvY/0.jpg",
    mediaLink: "https://go.cal.com/custom-attributes",
    title: "Custom Attributes",
    description: "Define roles and attributes for your teams",
    href: "https://go.cal.com/custom-attributes"
  },
  {
    id: 13,
    thumbnailUrl: "https://img.youtube.com/vi/TTAASLLPKk0/0.jpg",
    mediaLink: "https://go.cal.com/ooo-video",
    title: "ooo.new",
    description: "Easily go out-of-office",
    href: "https://go.cal.com/ooo-video"
  },
  {
    id: 12,
    thumbnailUrl: "https://cal.com/og-image-cal-ai.jpg",
    mediaLink: "https://go.cal.com/cal-ai",
    title: "Cal.ai",
    description: "Your personal AI scheduling assistant",
    href: "https://go.cal.com/cal-ai"
  },
  {
    id: 11,
    thumbnailUrl: "https://img.youtube.com/vi/KTg_qzA9NEc/0.jpg",
    mediaLink: "https://go.cal.com/insights",
    title: "Insights",
    description: "Get a better understanding of your business",
    href: "https://go.cal.com/insights"
  },
  {
    id: 10,
    thumbnailUrl: "https://img.youtube.com/vi/jvaBafzVUQc/0.jpg",
    mediaLink: "https://go.cal.com/video",
    title: "Cal Video",
    description: "Free video conferencing with recording",
    href: "https://go.cal.com/video"
  },
  {
    id: 9,
    thumbnailUrl: "https://img.youtube.com/vi/93iOmzHieCU/0.jpg",
    mediaLink: "https://go.cal.com/round-robin",
    title: "Round-Robin",
    description: "Create advanced group meetings with round-robin",
    href: "https://go.cal.com/round-robin"
  },
  {
    id: 8,
    thumbnailUrl: "https://img.youtube.com/vi/piKlAiibAFo/0.jpg",
    mediaLink: "https://go.cal.com/workflows",
    title: "Automate Workflows",
    description: "Make time work for you and automate tasks",
    href: "https://go.cal.com/workflows"
  },
  {
    id: 7,
    thumbnailUrl: "https://img.youtube.com/vi/UVXgo12cY4g/0.jpg",
    mediaLink: "https://go.cal.com/routing-forms",
    title: "Routing Forms",
    description: "Ask questions and route to the correct person",
    href: "https://go.cal.com/routing-forms"
  },
  {
    id: 6,
    thumbnailUrl: "https://img.youtube.com/vi/yGiZo1Ry5-8/0.jpg",
    mediaLink: "https://go.cal.com/recurring-video",
    title: "Recurring Bookings",
    description: "Learn how to create a recurring schedule",
    href: "https://go.cal.com/recurring-video"
  },
  {
    id: 5,
    thumbnailUrl: "https://img.youtube.com/vi/0v_nQtpxC_4/0.jpg",
    mediaLink: "https://go.cal.com/payments-video",
    title: "Accept Payments",
    description: "Charge for your time with Cal.com's Stripe App",
    href: "https://app.cal.com/apps/stripe"
  },
  {
    id: 4,
    thumbnailUrl: "https://img.youtube.com/vi/zGr_s-fG84k/0.jpg",
    mediaLink: "https://go.cal.com/confirmation-video",
    title: "Requires Confirmation",
    description: "Learn how to be in charge of your bookings",
    href: "https://cal.com/resources/feature/opt-in"
  },
  {
    id: 3,
    thumbnailUrl: "https://img.youtube.com/vi/-L8MCiT6uhQ/0.jpg",
    mediaLink: "https://youtu.be/-L8MCiT6uhQ?si=DRJzRNhN85hqAwBl",
    title: "Routing Forms, Workflows",
    description: "Ask screening questions of potential bookers to connect them with the right person",
    href: "https://youtu.be/-L8MCiT6uhQ?si=DRJzRNhN85hqAwBl"
  },
  {
    id: 2,
    thumbnailUrl: "https://img.youtube.com/vi/EAc46SPL6iA/0.jpg",
    mediaLink: "https://go.cal.com/teams-video",
    title: "How to set up Teams",
    description: "Learn how to use round-robin and collective events.",
    href: "https://cal.com/docs/enterprise-features/teams"
  },
  {
    id: 1,
    thumbnailUrl: "https://img.youtube.com/vi/VZ5PfQzzxBw/0.jpg",
    mediaLink: "https://youtu.be/VZ5PfQzzxBw?si=oB0LPSxG8dWIwg5a",
    title: "Dynamic booking links",
    description: "Booking link that allows people to quickly schedule meetings.",
    href: "https://youtu.be/VZ5PfQzzxBw?si=oB0LPSxG8dWIwg5a"
  }
], v = gt(vt).slice(0).reverse();
function yt() {
  const { t: e } = _(), [r, a] = W(() => {
    if (typeof window > "u")
      return v;
    try {
      const t = k.getItem("removedTipsIds");
      if (t !== null) {
        const o = t.split(",").map((u) => parseInt(u, 10));
        return v.filter((u) => o.indexOf(u.id) === -1);
      } else
        return v;
    } catch {
      return v;
    }
  }), s = (t) => {
    a((o) => {
      const c = k.getItem("removedTipsIds") || "", u = o.findIndex((d) => d.id === t);
      return u === -1 ? [...o] : (k.setItem(
        "removedTipsIds",
        `${o[u].id.toString()}${c.length > 0 ? `,${c}` : ""}`
      ), o.splice(u, 1), [...o]);
    });
  }, i = r.slice(0).reverse();
  return /* @__PURE__ */ l(
    "div",
    {
      className: "hidden pb-4 pt-8 lg:grid",
      style: {
        gridTemplateColumns: "1fr"
      },
      children: r.map((t) => /* @__PURE__ */ l(
        "div",
        {
          className: "relative",
          style: {
            gridRowStart: 1,
            gridColumnStart: 1
          },
          children: /* @__PURE__ */ l(
            "div",
            {
              className: "relative",
              style: {
                transform: `scale(${1 - i.indexOf(t) / 20})`,
                top: -i.indexOf(t) * 10,
                opacity: `${1 - i.indexOf(t) / 7}`
              },
              children: /* @__PURE__ */ l(
                bt,
                {
                  variant: "SidebarCard",
                  thumbnailUrl: t.thumbnailUrl,
                  mediaLink: t.mediaLink,
                  title: t.title,
                  description: t.description,
                  learnMore: { href: t.href, text: e("learn_more") },
                  actionButton: { onClick: () => s(t.id), child: e("dismiss") }
                }
              )
            }
          )
        },
        t.id
      ))
    }
  );
}
const kt = D(yt);
function At({
  title: e,
  description: r,
  background: a,
  features: s,
  buttons: i,
  isParentLoading: t,
  children: o,
  plan: c
}) {
  const { resolvedTheme: u } = Q(), { t: d } = _(), { isPending: p, hasTeamPlan: T } = q(), { data: j } = Z.viewer.teams.getUpgradeable.useQuery(), L = `${a}${u === "dark" ? "-dark" : ""}.jpg`, E = !1, R = !!(j != null && j[0]);
  return c === "team" && (T || R) ? /* @__PURE__ */ l(g, { children: o }) : c === "enterprise" && E ? /* @__PURE__ */ l(g, { children: o }) : p ? /* @__PURE__ */ l(g, { children: t }) : /* @__PURE__ */ m(g, { children: [
    /* @__PURE__ */ m("div", { className: "relative flex min-h-[295px] w-full items-center justify-between overflow-hidden rounded-lg pb-10", children: [
      /* @__PURE__ */ m("picture", { className: "absolute min-h-[295px] w-full rounded-lg object-cover", children: [
        /* @__PURE__ */ l("source", { srcSet: L, media: "(prefers-color-scheme: dark)" }),
        /* @__PURE__ */ l(
          "img",
          {
            className: "absolute min-h-[295px] w-full select-none rounded-lg object-cover object-left md:object-center",
            src: L,
            loading: "lazy",
            alt: e
          }
        )
      ] }),
      /* @__PURE__ */ m("div", { className: "relative my-4 px-8 sm:px-14", children: [
        /* @__PURE__ */ l("h1", { className: f("font-cal mt-4 text-3xl"), children: d(e) }),
        /* @__PURE__ */ l("p", { className: f("mb-8 mt-4 max-w-sm"), children: d(r) }),
        i
      ] })
    ] }),
    /* @__PURE__ */ l("div", { className: "mt-4 grid-cols-3 md:grid md:gap-4", children: s.map((h) => /* @__PURE__ */ m("div", { className: "bg-muted mb-4 min-h-[180px] w-full rounded-md  p-8 md:mb-0", children: [
      h.icon,
      /* @__PURE__ */ l("h2", { className: "font-cal text-emphasis mt-4 text-lg", children: h.title }),
      /* @__PURE__ */ l("p", { className: "text-default", children: h.description })
    ] }, h.title)) })
  ] });
}
export {
  kt as Tips,
  At as UpgradeTip
};
