import * as l from "react";
import { createContextScope as b } from "../../../../../@radix-ui_react-context@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-context/dist/index.js";
import { useComposedRefs as u } from "../../../../../@radix-ui_react-compose-refs@1.1.2_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-compose-refs/dist/index.js";
import { createDialogScope as A, Root as w, Portal as M, Overlay as x, Trigger as I, WarningProvider as L, Content as $, Title as F, Description as G, Close as v } from "../../../../../@radix-ui_react-dialog@1.1.14_@types_react-dom@19.1.6_@types_react@19.1.6__@types_react_00050fb27f6e4250402df169ba62a563/node_modules/@radix-ui/react-dialog/dist/index.js";
import { composeEventHandlers as j } from "../../../../../@radix-ui_primitive@1.1.2/node_modules/@radix-ui/primitive/dist/index.js";
import { createSlottable as W } from "../../../../../@radix-ui_react-slot@1.2.3_@types_react@19.1.6_react@19.1.0/node_modules/@radix-ui/react-slot/dist/index.js";
import { jsx as i, jsxs as Y } from "react/jsx-runtime";
var f = "AlertDialog", [q, te] = b(f, [
  A
]), n = A(), D = (e) => {
  const { __scopeAlertDialog: o, ...r } = e, t = n(o);
  return /* @__PURE__ */ i(w, { ...t, ...r, modal: !0 });
};
D.displayName = f;
var B = "AlertDialogTrigger", m = l.forwardRef(
  (e, o) => {
    const { __scopeAlertDialog: r, ...t } = e, a = n(r);
    return /* @__PURE__ */ i(I, { ...a, ...t, ref: o });
  }
);
m.displayName = B;
var H = "AlertDialogPortal", y = (e) => {
  const { __scopeAlertDialog: o, ...r } = e, t = n(o);
  return /* @__PURE__ */ i(M, { ...t, ...r });
};
y.displayName = H;
var V = "AlertDialogOverlay", _ = l.forwardRef(
  (e, o) => {
    const { __scopeAlertDialog: r, ...t } = e, a = n(r);
    return /* @__PURE__ */ i(x, { ...a, ...t, ref: o });
  }
);
_.displayName = V;
var s = "AlertDialogContent", [k, z] = q(s), J = W("AlertDialogContent"), N = l.forwardRef(
  (e, o) => {
    const { __scopeAlertDialog: r, children: t, ...a } = e, g = n(r), p = l.useRef(null), O = u(o, p), d = l.useRef(null);
    return /* @__PURE__ */ i(
      L,
      {
        contentName: s,
        titleName: R,
        docsSlug: "alert-dialog",
        children: /* @__PURE__ */ i(k, { scope: r, cancelRef: d, children: /* @__PURE__ */ Y(
          $,
          {
            role: "alertdialog",
            ...g,
            ...a,
            ref: O,
            onOpenAutoFocus: j(a.onOpenAutoFocus, (c) => {
              c.preventDefault(), d.current?.focus({ preventScroll: !0 });
            }),
            onPointerDownOutside: (c) => c.preventDefault(),
            onInteractOutside: (c) => c.preventDefault(),
            children: [
              /* @__PURE__ */ i(J, { children: t }),
              /* @__PURE__ */ i(Q, { contentRef: p })
            ]
          }
        ) })
      }
    );
  }
);
N.displayName = s;
var R = "AlertDialogTitle", C = l.forwardRef(
  (e, o) => {
    const { __scopeAlertDialog: r, ...t } = e, a = n(r);
    return /* @__PURE__ */ i(F, { ...a, ...t, ref: o });
  }
);
C.displayName = R;
var h = "AlertDialogDescription", E = l.forwardRef((e, o) => {
  const { __scopeAlertDialog: r, ...t } = e, a = n(r);
  return /* @__PURE__ */ i(G, { ...a, ...t, ref: o });
});
E.displayName = h;
var K = "AlertDialogAction", S = l.forwardRef(
  (e, o) => {
    const { __scopeAlertDialog: r, ...t } = e, a = n(r);
    return /* @__PURE__ */ i(v, { ...a, ...t, ref: o });
  }
);
S.displayName = K;
var P = "AlertDialogCancel", T = l.forwardRef(
  (e, o) => {
    const { __scopeAlertDialog: r, ...t } = e, { cancelRef: a } = z(P, r), g = n(r), p = u(o, a);
    return /* @__PURE__ */ i(v, { ...g, ...t, ref: p });
  }
);
T.displayName = P;
var Q = ({ contentRef: e }) => {
  const o = `\`${s}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${s}\` by passing a \`${h}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${s}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;
  return l.useEffect(() => {
    document.getElementById(
      e.current?.getAttribute("aria-describedby")
    ) || console.warn(o);
  }, [o, e]), null;
}, ae = D, ie = m, le = y, ne = _, se = N, ce = S, pe = T, ge = C, de = E;
export {
  ce as Action,
  D as AlertDialog,
  S as AlertDialogAction,
  T as AlertDialogCancel,
  N as AlertDialogContent,
  E as AlertDialogDescription,
  _ as AlertDialogOverlay,
  y as AlertDialogPortal,
  C as AlertDialogTitle,
  m as AlertDialogTrigger,
  pe as Cancel,
  se as Content,
  de as Description,
  ne as Overlay,
  le as Portal,
  ae as Root,
  ge as Title,
  ie as Trigger,
  te as createAlertDialogScope
};
//# sourceMappingURL=index.js.map
