import { toColorValue as u } from "../../../../@twind_core@1.1.3_typescript@5.8.3/node_modules/@twind/core/core.js";
function T({ className: e = "prose", defaultColor: p = "gray", extend: h = {}, colors: i = {} } = {}) {
  return i = {
    body: "700",
    headings: "900",
    lead: "600",
    links: "900",
    bold: "900",
    counters: "500",
    bullets: "300",
    hr: "200",
    quotes: "900",
    "quote-borders": "200",
    captions: "500",
    code: "900",
    "pre-code": "200",
    "pre-bg": "800",
    "th-borders": "300",
    "td-borders": "200",
    ...i,
    // invert colors (dark mode)
    dark: i.dark === null ? null : {
      body: "300",
      headings: "#fff",
      lead: "400",
      links: "#fff",
      bold: "#fff",
      counters: "400",
      bullets: "600",
      hr: "700",
      quotes: "100",
      "quote-borders": "700",
      captions: "400",
      code: "#fff",
      "pre-code": "300",
      "pre-bg": "rgb(0 0 0 / 50%)",
      "th-borders": "600",
      "td-borders": "700",
      ...i.dark
    }
  }, {
    // for element modifiers: prose-img:rounded-xl, prose-headings
    // & :is()
    // & :is(:where(code):not(:where([class~="not-prose"] *)))
    variants: [
      [
        "headings",
        "h1,h2,h3,h4,h5,h6,th"
      ],
      [
        "h1"
      ],
      [
        "h2"
      ],
      [
        "h3"
      ],
      [
        "h4"
      ],
      [
        "h5"
      ],
      [
        "h6"
      ],
      [
        "p"
      ],
      [
        "a"
      ],
      [
        "blockquote"
      ],
      [
        "figure"
      ],
      [
        "figcaption"
      ],
      [
        "strong"
      ],
      [
        "em"
      ],
      [
        "code"
      ],
      [
        "pre"
      ],
      [
        "ol"
      ],
      [
        "ul"
      ],
      [
        "li"
      ],
      [
        "table"
      ],
      [
        "thead"
      ],
      [
        "tr"
      ],
      [
        "th"
      ],
      [
        "td"
      ],
      [
        "img"
      ],
      [
        "video"
      ],
      [
        "hr"
      ],
      [
        "lead",
        ".lead"
      ]
    ].map(([r, o = r]) => [
      `${e}-${r}`,
      (n, l) => v(e, o[0] == "." ? "." + l.e(l.h(o.slice(1))) : o, l, (g) => `& :is(${g.trim()})`)
    ]),
    rules: [
      // marker classes lead and not-prose
      [
        `(lead|not-${e})`,
        ({ 1: r }, { h: o }) => [
          {
            c: o(r)
          }
        ]
      ],
      [
        `${e}-invert`,
        {
          "@layer base": {
            "--tw-prose-body": "var(--tw-prose-invert-body)",
            "--tw-prose-headings": "var(--tw-prose-invert-headings)",
            "--tw-prose-lead": "var(--tw-prose-invert-lead)",
            "--tw-prose-links": "var(--tw-prose-invert-links)",
            "--tw-prose-bold": "var(--tw-prose-invert-bold)",
            "--tw-prose-counters": "var(--tw-prose-invert-counters)",
            "--tw-prose-bullets": "var(--tw-prose-invert-bullets)",
            "--tw-prose-hr": "var(--tw-prose-invert-hr)",
            "--tw-prose-quotes": "var(--tw-prose-invert-quotes)",
            "--tw-prose-quote-borders": "var(--tw-prose-invert-quote-borders)",
            "--tw-prose-captions": "var(--tw-prose-invert-captions)",
            "--tw-prose-code": "var(--tw-prose-invert-code)",
            "--tw-prose-pre-code": "var(--tw-prose-invert-pre-code)",
            "--tw-prose-pre-bg": "var(--tw-prose-invert-pre-bg)",
            "--tw-prose-th-borders": "var(--tw-prose-invert-th-borders)",
            "--tw-prose-td-borders": "var(--tw-prose-invert-td-borders)"
          }
        }
      ],
      // for type scale: prose-xl
      [
        e + "-",
        ({ $$: r }, o) => {
          let n = w(o.theme("fontSize", r));
          return n && {
            "@layer components": n
          };
        }
      ],
      // for colors: prose-sky
      [
        e + "-",
        ({ $$: r }, o) => s(r, o)
      ],
      // prose
      [
        e,
        (r, o) => ({
          // layer defaults
          ...s(p, o),
          "@layer base": [
            b(e, o, {
              a: {
                color: "var(--tw-prose-links)",
                textDecorationLine: "underline",
                fontWeight: "500"
              },
              strong: {
                color: "var(--tw-prose-bold)",
                fontWeight: "600"
              },
              "a strong,blockquote strong,thead th strong": {
                color: "inherit"
              },
              ul: {
                listStyleType: "disc"
              },
              ol: {
                listStyleType: "decimal"
              },
              'ol[type="A"]': {
                listStyleType: "upper-alpha"
              },
              'ol[type="a"]': {
                listStyleType: "lower-alpha"
              },
              'ol[type="A" s]': {
                listStyleType: "upper-alpha"
              },
              'ol[type="a" s]': {
                listStyleType: "lower-alpha"
              },
              'ol[type="I"]': {
                listStyleType: "upper-roman"
              },
              'ol[type="i"]': {
                listStyleType: "lower-roman"
              },
              'ol[type="I" s]': {
                listStyleType: "upper-roman"
              },
              'ol[type="i" s]': {
                listStyleType: "lower-roman"
              },
              'ol[type="1"]': {
                listStyleType: "decimal"
              },
              "ol,ul": {
                marginTop: t(20, 16),
                marginBottom: t(20, 16),
                paddingLeft: t(26, 16)
              },
              li: {
                marginTop: t(8, 16),
                marginBottom: t(8, 16)
              },
              "ol>li,ul>li": {
                paddingLeft: t(6, 16)
              },
              ">ul>li p": {
                marginTop: t(12, 16),
                marginBottom: t(12, 16)
              },
              ">ul>li>*:first-child,>ol>li>*:last-child": {
                marginTop: t(20, 16)
              },
              ">ul>li>*:last-child,>ol>li>*:last-child": {
                marginBottom: t(20, 16)
              },
              "ol>li::marker": {
                fontWeight: "400",
                color: "var(--tw-prose-counters)"
              },
              "ul>li::marker": {
                color: "var(--tw-prose-bullets)"
              },
              "ul ul,ul ol,ol ul,ol ol": {
                marginTop: t(12, 16),
                marginBottom: t(12, 16)
              },
              hr: {
                borderColor: "var(--tw-prose-hr)",
                borderTopWidth: "1",
                marginTop: t(48, 16),
                marginBottom: t(48, 16)
              },
              blockquote: {
                marginTop: t(32, 20),
                marginBottom: t(32, 20),
                paddingLeft: t(20, 20),
                fontWeight: "500",
                fontStyle: "italic",
                color: "var(--tw-prose-quotes)",
                borderLeftWidth: "0.25rem",
                borderLeftColor: "var(--tw-prose-quote-borders)",
                quotes: '"\\201C""\\201D""\\2018""\\2019"'
              },
              "blockquote p:first-of-type::before": {
                content: "open-quote"
              },
              "blockquote p:last-of-type::after": {
                content: "close-quote"
              },
              p: {
                marginTop: t(20, 16),
                marginBottom: t(20, 16)
              },
              h1: {
                color: "var(--tw-prose-headings)",
                fontWeight: "800",
                fontSize: t(36, 16),
                marginTop: "0",
                marginBottom: t(32, 36),
                lineHeight: 1.15
              },
              "h1 strong": {
                fontWeight: "900",
                color: "inherit"
              },
              h2: {
                color: "var(--tw-prose-headings)",
                fontWeight: "700",
                fontSize: t(24, 16),
                marginTop: t(48, 24),
                marginBottom: t(24, 24),
                lineHeight: "1.35"
              },
              "h2 strong": {
                fontWeight: "800",
                color: "inherit"
              },
              h3: {
                color: "var(--tw-prose-headings)",
                fontWeight: "600",
                fontSize: t(20, 16),
                marginTop: t(32, 20),
                marginBottom: t(12, 20),
                lineHeight: "1.6"
              },
              "h3 strong": {
                fontWeight: "700",
                color: "inherit"
              },
              h4: {
                color: "var(--tw-prose-headings)",
                fontWeight: "600",
                marginTop: t(24, 16),
                marginBottom: t(8, 16),
                lineHeight: "1.5"
              },
              "h4 strong": {
                fontWeight: "700",
                color: "inherit"
              },
              "hr+*,h2+*,h3+*,h4+*": {
                marginTop: "0"
              },
              "img,video,figure": {
                marginTop: t(32, 16),
                marginBottom: t(32, 16)
              },
              "figure>*": {
                marginTop: "0",
                marginBottom: "0"
              },
              figcaption: {
                color: "var(--tw-prose-captions)",
                fontSize: t(14, 16),
                lineHeight: "1.4",
                marginTop: t(12, 14)
              },
              code: {
                color: "var(--tw-prose-code)",
                fontWeight: "600",
                fontSize: t(14, 16)
              },
              "code::before,code::after": {
                content: '"`"'
              },
              "h2 code": {
                fontSize: t(21, 24)
              },
              "h3 code": {
                fontSize: t(18, 20)
              },
              "a code,h1 code,h2 code,h3 code,h4 code,blockquote code,thead th code": {
                color: "inherit"
              },
              pre: {
                color: "var(--tw-prose-pre-code)",
                backgroundColor: "var(--tw-prose-pre-bg)",
                overflowX: "auto",
                fontWeight: "400",
                fontSize: t(14, 16),
                lineHeight: "1.7",
                marginTop: t(24, 14),
                marginBottom: t(24, 14),
                borderRadius: "0.375rem",
                paddingTop: t(12, 14),
                paddingRight: t(16, 14),
                paddingBottom: t(12, 14),
                paddingLeft: t(16, 14)
              },
              "pre code": {
                backgroundColor: "transparent",
                borderWidth: "0",
                borderRadius: "0",
                padding: "0",
                fontWeight: "inherit",
                color: "inherit",
                fontSize: "inherit",
                fontFamily: "inherit",
                lineHeight: "inherit"
              },
              "pre code::before": {
                content: "none"
              },
              "pre code::after": {
                content: "none"
              },
              table: {
                width: "100%",
                tableLayout: "auto",
                textAlign: "left",
                marginTop: t(32, 16),
                marginBottom: t(32, 16),
                fontSize: t(14, 16),
                lineHeight: "1.7"
              },
              thead: {
                borderBottomWidth: "1px",
                borderBottomColor: "var(--tw-prose-th-borders)"
              },
              "thead th": {
                color: "var(--tw-prose-headings)",
                fontWeight: "600",
                verticalAlign: "bottom",
                paddingRight: t(8, 14),
                paddingBottom: t(8, 14),
                paddingLeft: t(8, 14)
              },
              "thead th:first-child": {
                paddingLeft: "0"
              },
              "thead th:last-child": {
                paddingRight: "0"
              },
              "tbody tr": {
                borderBottomWidth: "1px",
                borderBottomColor: "var(--tw-prose-td-borders)"
              },
              "tbody tr:last-child": {
                borderBottomWidth: "0"
              },
              "tbody td,tfoot td": {
                verticalAlign: "baseline",
                paddingTop: t(8, 14),
                paddingRight: t(8, 14),
                paddingBottom: t(8, 14),
                paddingLeft: t(8, 14)
              },
              "tbody td:first-child,tfoot td:first-child": {
                paddingLeft: "0"
              },
              "tbody td:last-child,tfoot td:last-child": {
                paddingRight: "0"
              },
              [`.${o.e(o.h("lead"))}`]: {
                color: "var(--tw-prose-lead)",
                fontSize: t(20, 16),
                lineHeight: "1.6",
                marginTop: t(24, 20),
                marginBottom: t(24, 20)
              },
              ">:first-child": {
                marginTop: "0"
              },
              ">:last-child": {
                marginBottom: "0"
              }
            }),
            b(e, o, h)
          ],
          "@layer components": {
            ...w(o.theme("fontSize", "base")),
            color: "var(--tw-prose-body)",
            maxWidth: "theme(max-w.prose, 65ch)"
          }
        })
      ]
    ]
  };
  function s(r, o) {
    let n = {}, l = {}, g = (d, a, f) => {
      let c = o.theme(`colors.${r}.${a}`, a);
      f["--tw-prose-" + d] = u(c);
      let m = f != l && o.d("colors", `${r}-${a}`, c);
      m && (l["--tw-prose-" + d] = u(m));
    };
    for (let d in i) {
      let a = i[d];
      d != "dark" && a && g(d, a, n);
    }
    for (let d in i.dark || {}) {
      let a = i.dark[d];
      a && (i.dark ? (
        // explicit dark colors - need to use `dark:prose-invert`
        g("invert-" + d, a, n)
      ) : (
        // auto dark colors
        g(d, a, l)
      ));
    }
    return Object.keys(n).length ? {
      "@layer defaults": {
        "&": n,
        [o.v("dark")]: l
      }
    } : void 0;
  }
}
function b(e, p, h) {
  let i = {};
  for (let s in h) i[v(e, s, p, (r) => `.${p.e(p.h(e))}${r}`)] = h[s];
  return i;
}
function v(e, p, { e: h, h: i }, s) {
  return p.replace(
    // 1. if there no pseudo use whole selector
    // 2. if there are pseudo replace prefix
    /^[^>:]+$|(>)?((?:[^:,]+(?::[\w-]+)?)|:[\w-]+)(::[\w-]+)?/g,
    (r, o = " ", n = r, l = "") => s(`${o}:where(${n}):not(:where(.${h(i("not-" + e))} *))${l}`)
  );
}
function w(e) {
  return e ? typeof e == "string" ? {
    fontSize: e
  } : {
    fontSize: e[0],
    ...typeof e[1] == "string" ? {
      lineHeight: e[1]
    } : e[1]
  } : void 0;
}
function t(e, p) {
  return `${(e / p).toFixed(3).replace(/^0|\.?0+$/g, "")}em`;
}
export {
  T as default
};
//# sourceMappingURL=preset-typography.js.map
