import { bu as w, bv as L, bw as T, br as U, bx as S, aX as b, by as p, aW as t, bz as A, bA as C, b3 as N, b7 as f } from "./index-6jcTChn4.js";
import { memo as R, useState as I } from "react";
import { C as $ } from "./Card-R2SNAAqU.js";
var P = Math.floor, _ = Math.random;
function B(e, o) {
  return e + P(_() * (o - e + 1));
}
var M = B, z = M;
function F(e, o) {
  var r = -1, l = e.length, n = l - 1;
  for (o = o === void 0 ? l : o; ++r < o; ) {
    var i = z(r, n), s = e[i];
    e[i] = e[r], e[r] = s;
  }
  return e.length = o, e;
}
var v = F, Q = w, q = v;
function V(e) {
  return q(Q(e));
}
var E = V, G = L();
function D(e, o) {
  return G(o, function(r) {
    return e[r];
  });
}
var O = D, W = O, Z = T();
function H(e) {
  return e == null ? [] : W(e, Z(e));
}
var K = H, Y = v, J = K;
function X(e) {
  return Y(J(e));
}
var ee = X, te = E, ie = ee, oe = S;
function se(e) {
  var o = oe(e) ? te : ie;
  return o(e);
}
var re = se;
const ae = /* @__PURE__ */ U(re), ne = [
  {
    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"
  }
], u = ae(ne).slice(0).reverse();
function le() {
  const { t: e } = b(), [o, r] = I(() => {
    if (typeof window > "u")
      return u;
    try {
      const i = p.getItem("removedTipsIds");
      if (i !== null) {
        const s = i.split(",").map((a) => parseInt(a, 10));
        return u.filter((a) => s.indexOf(a.id) === -1);
      } else
        return u;
    } catch {
      return u;
    }
  }), l = (i) => {
    r((s) => {
      const c = p.getItem("removedTipsIds") || "", a = s.findIndex((m) => m.id === i);
      return p.setItem(
        "removedTipsIds",
        `${s[a].id.toString()}${c.length > 0 ? `,${c.split(",")}` : ""}`
      ), s.splice(a, 1), [...s];
    });
  }, n = o.slice(0).reverse();
  return /* @__PURE__ */ t.jsx(
    "div",
    {
      className: "hidden pb-4 pt-8 lg:grid",
      style: {
        gridTemplateColumns: "1fr"
      },
      children: o.map((i) => /* @__PURE__ */ t.jsx(
        "div",
        {
          className: "relative",
          style: {
            gridRowStart: 1,
            gridColumnStart: 1
          },
          children: /* @__PURE__ */ t.jsx(
            "div",
            {
              className: "relative",
              style: {
                transform: `scale(${1 - n.indexOf(i) / 20})`,
                top: -n.indexOf(i) * 10,
                opacity: `${1 - n.indexOf(i) / 7}`
              },
              children: /* @__PURE__ */ t.jsx(
                $,
                {
                  variant: "SidebarCard",
                  thumbnailUrl: i.thumbnailUrl,
                  mediaLink: i.mediaLink,
                  title: i.title,
                  description: i.description,
                  learnMore: { href: i.href, text: e("learn_more") },
                  actionButton: { onClick: () => l(i.id), child: e("dismiss") }
                }
              )
            }
          )
        },
        i.id
      ))
    }
  );
}
const ue = R(le);
function he({
  title: e,
  description: o,
  background: r,
  features: l,
  buttons: n,
  isParentLoading: i,
  children: s,
  plan: c
}) {
  const { resolvedTheme: a } = A(), { t: m } = b(), { isPending: y, hasTeamPlan: x } = C(), { data: h } = N.viewer.teams.getUpgradeable.useQuery(), g = `${r}${a === "dark" ? "-dark" : ""}.jpg`, k = !1, j = !!(h != null && h[0]);
  return c === "team" && (x || j) ? /* @__PURE__ */ t.jsx(t.Fragment, { children: s }) : c === "enterprise" && k ? /* @__PURE__ */ t.jsx(t.Fragment, { children: s }) : y ? /* @__PURE__ */ t.jsx(t.Fragment, { children: i }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
    /* @__PURE__ */ t.jsxs("div", { className: "relative flex min-h-[295px] w-full items-center justify-between overflow-hidden rounded-lg pb-10", children: [
      /* @__PURE__ */ t.jsxs("picture", { className: "absolute min-h-[295px] w-full rounded-lg object-cover", children: [
        /* @__PURE__ */ t.jsx("source", { srcSet: g, media: "(prefers-color-scheme: dark)" }),
        /* @__PURE__ */ t.jsx(
          "img",
          {
            className: "absolute min-h-[295px] w-full select-none rounded-lg object-cover object-left md:object-center",
            src: g,
            loading: "lazy",
            alt: e
          }
        )
      ] }),
      /* @__PURE__ */ t.jsxs("div", { className: "relative my-4 px-8 sm:px-14", children: [
        /* @__PURE__ */ t.jsx("h1", { className: f("font-cal mt-4 text-3xl"), children: m(e) }),
        /* @__PURE__ */ t.jsx("p", { className: f("mb-8 mt-4 max-w-sm"), children: m(o) }),
        n
      ] })
    ] }),
    /* @__PURE__ */ t.jsx("div", { className: "mt-4 grid-cols-3 md:grid md:gap-4", children: l.map((d) => /* @__PURE__ */ t.jsxs("div", { className: "bg-muted mb-4 min-h-[180px] w-full rounded-md  p-8 md:mb-0", children: [
      d.icon,
      /* @__PURE__ */ t.jsx("h2", { className: "font-cal text-emphasis mt-4 text-lg", children: d.title }),
      /* @__PURE__ */ t.jsx("p", { className: "text-default", children: d.description })
    ] }, d.title)) })
  ] });
}
export {
  ue as Tips,
  he as UpgradeTip
};
