@amnstak/react-image-annotate
Version:
[](https://www.npmjs.com/package/@amnstak/react-image-annotate)
1,692 lines • 100 kB
JavaScript
import { jsx as u, jsxs as le, Fragment as Yo } from "react/jsx-runtime";
import * as $ from "react";
import { createContext as Xo, useContext as Ko, memo as Go, useState as Rt, useCallback as Jo, useLayoutEffect as Qo, useEffect as co, useMemo as fo, forwardRef as Re, createElement as Pt, useRef as uo, useImperativeHandle as ho, useReducer as Zo } from "react";
import { M as er, N as tr, O as or, z as rr, m as Xe, i as Qe, Q as nr, R as ir, c as ge, p as Q, P as r, d as ye, j as gt, u as yt, S as ar, U as sr, y as mo, V as _e, l as dt, s as B, n as bt, W as Ht, t as Ze, X as pr, Y as lr, G as Ke, K as cr, f as se, h as Vt, x as fr, T as Pe, I as vo, Z as Ft, _ as dr, k as Ut, $ as ur, H as go, a0 as hr, a1 as ut, a2 as yo, F as mr, J as vr, a3 as _t, a4 as gr, a5 as yr, w as at, a6 as br, v as bo, a7 as qt, a8 as wr, L as xr, B as Or } from "./Portal-IhUi94Sd.js";
function Tr(t = {}) {
const {
themeId: e,
defaultTheme: o,
defaultClassName: n = "MuiBox-root",
generateClassName: i
} = t, s = er("div", {
shouldForwardProp: (a) => a !== "theme" && a !== "sx" && a !== "as"
})(tr);
return /* @__PURE__ */ $.forwardRef(function(p, f) {
const c = or(o), {
className: h,
component: y = "div",
...d
} = rr(p);
return /* @__PURE__ */ u(s, {
as: y,
ref: f,
className: Xe(h, i ? i(n) : n),
theme: e && c[e] || c,
...d
});
});
}
const Er = Qe("MuiBox", ["root"]), Cr = ge(), wo = Tr({
themeId: ir,
defaultTheme: Cr,
defaultClassName: Er.root,
generateClassName: nr.generate
});
Q.env.NODE_ENV !== "production" && (wo.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* @ignore
*/
children: r.node,
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: r.elementType,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object])
});
const Rr = ye(/* @__PURE__ */ u("path", {
d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"
}), "ExpandMore");
function Pr(t) {
return gt("MuiCollapse", t);
}
Qe("MuiCollapse", ["root", "horizontal", "vertical", "entered", "hidden", "wrapper", "wrapperInner"]);
const Sr = (t) => {
const {
orientation: e,
classes: o
} = t, n = {
root: ["root", `${e}`],
entered: ["entered"],
hidden: ["hidden"],
wrapper: ["wrapper", `${e}`],
wrapperInner: ["wrapperInner", `${e}`]
};
return bt(n, Pr, o);
}, $r = B("div", {
name: "MuiCollapse",
slot: "Root",
overridesResolver: (t, e) => {
const {
ownerState: o
} = t;
return [e.root, e[o.orientation], o.state === "entered" && e.entered, o.state === "exited" && !o.in && o.collapsedSize === "0px" && e.hidden];
}
})(Ze(({
theme: t
}) => ({
height: 0,
overflow: "hidden",
transition: t.transitions.create("height"),
variants: [{
props: {
orientation: "horizontal"
},
style: {
height: "auto",
width: 0,
transition: t.transitions.create("width")
}
}, {
props: {
state: "entered"
},
style: {
height: "auto",
overflow: "visible"
}
}, {
props: {
state: "entered",
orientation: "horizontal"
},
style: {
width: "auto"
}
}, {
props: ({
ownerState: e
}) => e.state === "exited" && !e.in && e.collapsedSize === "0px",
style: {
visibility: "hidden"
}
}]
}))), Ar = B("div", {
name: "MuiCollapse",
slot: "Wrapper",
overridesResolver: (t, e) => e.wrapper
})({
// Hack to get children with a negative margin to not falsify the height computation.
display: "flex",
width: "100%",
variants: [{
props: {
orientation: "horizontal"
},
style: {
width: "auto",
height: "100%"
}
}]
}), Mr = B("div", {
name: "MuiCollapse",
slot: "WrapperInner",
overridesResolver: (t, e) => e.wrapperInner
})({
width: "100%",
variants: [{
props: {
orientation: "horizontal"
},
style: {
width: "auto",
height: "100%"
}
}]
}), ht = /* @__PURE__ */ $.forwardRef(function(e, o) {
const n = yt({
props: e,
name: "MuiCollapse"
}), {
addEndListener: i,
children: s,
className: l,
collapsedSize: a = "0px",
component: p,
easing: f,
in: c,
onEnter: h,
onEntered: y,
onEntering: d,
onExit: w,
onExited: m,
onExiting: v,
orientation: x = "vertical",
style: P,
timeout: b = ar.standard,
// eslint-disable-next-line react/prop-types
TransitionComponent: g = sr,
...C
} = n, O = {
...n,
orientation: x,
collapsedSize: a
}, S = Sr(O), j = mo(), A = _e(), T = $.useRef(null), D = $.useRef(), W = typeof a == "number" ? `${a}px` : a, M = x === "horizontal", F = M ? "width" : "height", U = $.useRef(null), k = dt(o, U), N = (R) => (H) => {
if (R) {
const L = U.current;
H === void 0 ? R(L) : R(L, H);
}
}, z = () => T.current ? T.current[M ? "clientWidth" : "clientHeight"] : 0, oe = N((R, H) => {
T.current && M && (T.current.style.position = "absolute"), R.style[F] = W, h && h(R, H);
}), V = N((R, H) => {
const L = z();
T.current && M && (T.current.style.position = "");
const {
duration: G,
easing: ve
} = Ht({
style: P,
timeout: b,
easing: f
}, {
mode: "enter"
});
if (b === "auto") {
const de = j.transitions.getAutoHeightDuration(L);
R.style.transitionDuration = `${de}ms`, D.current = de;
} else
R.style.transitionDuration = typeof G == "string" ? G : `${G}ms`;
R.style[F] = `${L}px`, R.style.transitionTimingFunction = ve, d && d(R, H);
}), he = N((R, H) => {
R.style[F] = "auto", y && y(R, H);
}), re = N((R) => {
R.style[F] = `${z()}px`, w && w(R);
}), me = N(m), Y = N((R) => {
const H = z(), {
duration: L,
easing: G
} = Ht({
style: P,
timeout: b,
easing: f
}, {
mode: "exit"
});
if (b === "auto") {
const ve = j.transitions.getAutoHeightDuration(H);
R.style.transitionDuration = `${ve}ms`, D.current = ve;
} else
R.style.transitionDuration = typeof L == "string" ? L : `${L}ms`;
R.style[F] = W, R.style.transitionTimingFunction = G, v && v(R);
});
return /* @__PURE__ */ u(g, {
in: c,
onEnter: oe,
onEntered: he,
onEntering: V,
onExit: re,
onExited: me,
onExiting: Y,
addEndListener: (R) => {
b === "auto" && A.start(D.current || 0, R), i && i(U.current, R);
},
nodeRef: U,
timeout: b === "auto" ? null : b,
...C,
children: (R, {
ownerState: H,
...L
}) => /* @__PURE__ */ u($r, {
as: p,
className: Xe(S.root, l, {
entered: S.entered,
exited: !c && W === "0px" && S.hidden
}[R]),
style: {
[M ? "minWidth" : "minHeight"]: W,
...P
},
ref: k,
ownerState: {
...O,
state: R
},
...L,
children: /* @__PURE__ */ u(Ar, {
ownerState: {
...O,
state: R
},
className: S.wrapper,
ref: T,
children: /* @__PURE__ */ u(Mr, {
ownerState: {
...O,
state: R
},
className: S.wrapperInner,
children: s
})
})
})
});
});
Q.env.NODE_ENV !== "production" && (ht.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Add a custom transition end trigger. Called with the transitioning DOM
* node and a done callback. Allows for more fine grained transition end
* logic. Note: Timeouts are still used as a fallback if provided.
*/
addEndListener: r.func,
/**
* The content node to be collapsed.
*/
children: r.node,
/**
* Override or extend the styles applied to the component.
*/
classes: r.object,
/**
* @ignore
*/
className: r.string,
/**
* The width (horizontal) or height (vertical) of the container when collapsed.
* @default '0px'
*/
collapsedSize: r.oneOfType([r.number, r.string]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: pr,
/**
* The transition timing function.
* You may specify a single easing or a object containing enter and exit values.
*/
easing: r.oneOfType([r.shape({
enter: r.string,
exit: r.string
}), r.string]),
/**
* If `true`, the component will transition in.
*/
in: r.bool,
/**
* @ignore
*/
onEnter: r.func,
/**
* @ignore
*/
onEntered: r.func,
/**
* @ignore
*/
onEntering: r.func,
/**
* @ignore
*/
onExit: r.func,
/**
* @ignore
*/
onExited: r.func,
/**
* @ignore
*/
onExiting: r.func,
/**
* The transition orientation.
* @default 'vertical'
*/
orientation: r.oneOf(["horizontal", "vertical"]),
/**
* @ignore
*/
style: r.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
/**
* The duration for the transition, in milliseconds.
* You may specify a single timeout for all transitions, or individually with an object.
*
* Set to 'auto' to automatically calculate transition time based on height.
* @default duration.standard
*/
timeout: r.oneOfType([r.oneOf(["auto"]), r.number, r.shape({
appear: r.number,
enter: r.number,
exit: r.number
})])
});
ht && (ht.muiSupportAuto = !0);
function Dr(t) {
return gt("MuiTypography", t);
}
const ia = Qe("MuiTypography", ["root", "h1", "h2", "h3", "h4", "h5", "h6", "subtitle1", "subtitle2", "body1", "body2", "inherit", "button", "caption", "overline", "alignLeft", "alignRight", "alignCenter", "alignJustify", "noWrap", "gutterBottom", "paragraph"]), Nr = {
primary: !0,
secondary: !0,
error: !0,
info: !0,
success: !0,
warning: !0,
textPrimary: !0,
textSecondary: !0,
textDisabled: !0
}, jr = lr(), Br = (t) => {
const {
align: e,
gutterBottom: o,
noWrap: n,
paragraph: i,
variant: s,
classes: l
} = t, a = {
root: ["root", s, t.align !== "inherit" && `align${Ke(e)}`, o && "gutterBottom", n && "noWrap", i && "paragraph"]
};
return bt(a, Dr, l);
}, kr = B("span", {
name: "MuiTypography",
slot: "Root",
overridesResolver: (t, e) => {
const {
ownerState: o
} = t;
return [e.root, o.variant && e[o.variant], o.align !== "inherit" && e[`align${Ke(o.align)}`], o.noWrap && e.noWrap, o.gutterBottom && e.gutterBottom, o.paragraph && e.paragraph];
}
})(Ze(({
theme: t
}) => {
var e;
return {
margin: 0,
variants: [{
props: {
variant: "inherit"
},
style: {
// Some elements, like <button> on Chrome have default font that doesn't inherit, reset this.
font: "inherit",
lineHeight: "inherit",
letterSpacing: "inherit"
}
}, ...Object.entries(t.typography).filter(([o, n]) => o !== "inherit" && n && typeof n == "object").map(([o, n]) => ({
props: {
variant: o
},
style: n
})), ...Object.entries(t.palette).filter(cr()).map(([o]) => ({
props: {
color: o
},
style: {
color: (t.vars || t).palette[o].main
}
})), ...Object.entries(((e = t.palette) == null ? void 0 : e.text) || {}).filter(([, o]) => typeof o == "string").map(([o]) => ({
props: {
color: `text${Ke(o)}`
},
style: {
color: (t.vars || t).palette.text[o]
}
})), {
props: ({
ownerState: o
}) => o.align !== "inherit",
style: {
textAlign: "var(--Typography-textAlign)"
}
}, {
props: ({
ownerState: o
}) => o.noWrap,
style: {
overflow: "hidden",
textOverflow: "ellipsis",
whiteSpace: "nowrap"
}
}, {
props: ({
ownerState: o
}) => o.gutterBottom,
style: {
marginBottom: "0.35em"
}
}, {
props: ({
ownerState: o
}) => o.paragraph,
style: {
marginBottom: 16
}
}]
};
})), Yt = {
h1: "h1",
h2: "h2",
h3: "h3",
h4: "h4",
h5: "h5",
h6: "h6",
subtitle1: "h6",
subtitle2: "h6",
body1: "p",
body2: "p",
inherit: "p"
}, xo = /* @__PURE__ */ $.forwardRef(function(e, o) {
const {
color: n,
...i
} = yt({
props: e,
name: "MuiTypography"
}), s = !Nr[n], l = jr({
...i,
...s && {
color: n
}
}), {
align: a = "inherit",
className: p,
component: f,
gutterBottom: c = !1,
noWrap: h = !1,
paragraph: y = !1,
variant: d = "body1",
variantMapping: w = Yt,
...m
} = l, v = {
...l,
align: a,
color: n,
className: p,
component: f,
gutterBottom: c,
noWrap: h,
paragraph: y,
variant: d,
variantMapping: w
}, x = f || (y ? "p" : w[d] || Yt[d]) || "span", P = Br(v);
return /* @__PURE__ */ u(kr, {
as: x,
ref: o,
className: Xe(P.root, p),
...m,
ownerState: v,
style: {
...a !== "inherit" && {
"--Typography-textAlign": a
},
...m.style
}
});
});
Q.env.NODE_ENV !== "production" && (xo.propTypes = {
// ┌────────────────────────────── Warning ──────────────────────────────┐
// │ These PropTypes are generated from the TypeScript type definitions. │
// │ To update them, edit the d.ts file and run `pnpm proptypes`. │
// └─────────────────────────────────────────────────────────────────────┘
/**
* Set the text-align on the component.
* @default 'inherit'
*/
align: r.oneOf(["center", "inherit", "justify", "left", "right"]),
/**
* The content of the component.
*/
children: r.node,
/**
* Override or extend the styles applied to the component.
*/
classes: r.object,
/**
* @ignore
*/
className: r.string,
/**
* The color of the component.
* It supports both default and custom theme colors, which can be added as shown in the
* [palette customization guide](https://mui.com/material-ui/customization/palette/#custom-colors).
*/
color: r.oneOfType([r.oneOf(["primary", "secondary", "success", "error", "info", "warning", "textPrimary", "textSecondary", "textDisabled"]), r.string]),
/**
* The component used for the root node.
* Either a string to use a HTML element or a component.
*/
component: r.elementType,
/**
* If `true`, the text will have a bottom margin.
* @default false
*/
gutterBottom: r.bool,
/**
* If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.
*
* Note that text overflow can only happen with block or inline-block level elements
* (the element needs to have a width in order to overflow).
* @default false
*/
noWrap: r.bool,
/**
* If `true`, the element will be a paragraph element.
* @default false
* @deprecated Use the `component` prop instead. This prop will be removed in v7. See [Migrating from deprecated APIs](https://mui.com/material-ui/migration/migrating-from-deprecated-apis/) for more details.
*/
paragraph: r.bool,
/**
* @ignore
*/
style: r.object,
/**
* The system prop that allows defining system overrides as well as additional CSS styles.
*/
sx: r.oneOfType([r.arrayOf(r.oneOfType([r.func, r.object, r.bool])), r.func, r.object]),
/**
* Applies the theme typography styles.
* @default 'body1'
*/
variant: r.oneOfType([r.oneOf(["body1", "body2", "button", "caption", "h1", "h2", "h3", "h4", "h5", "h6", "inherit", "overline", "subtitle1", "subtitle2"]), r.string]),
/**
* The component maps the variant prop to a range of different HTML element types.
* For instance, subtitle1 to `<h6>`.
* If you wish to change that mapping, you can provide your own.
* Alternatively, you can use the `component` prop.
* @default {
* h1: 'h1',
* h2: 'h2',
* h3: 'h3',
* h4: 'h4',
* h5: 'h5',
* h6: 'h6',
* subtitle1: 'h6',
* subtitle2: 'h6',
* body1: 'p',
* body2: 'p',
* inherit: 'p',
* }
*/
variantMapping: r.object
});
const Oo = Xo({}), Lr = {}, Mt = () => Ko(Oo) || Lr, Ir = ge(), Wr = B("div")(() => ({
borderBottom: `2px solid ${se[400]}`,
"&:firstChild": { borderTop: `1px solid ${se[400]}` }
})), zr = B("div")(() => ({
display: "flex",
flexDirection: "row",
alignItems: "center",
padding: 4,
paddingLeft: 16,
paddingRight: 12,
"& .iconContainer": {
color: se[600],
display: "flex",
alignItems: "center",
justifyContent: "center",
"& .MuiSvgIcon-root": {
width: 16,
height: 16
}
}
})), Hr = B("div")(() => ({
maxHeight: 200,
overflowY: "auto",
"&.noScroll": {
overflowY: "visible",
overflow: "visible"
}
})), Vr = B(xo)(() => ({
fontSize: 11,
flexGrow: 1,
fontWeight: 800,
paddingLeft: 8,
color: se[800],
"& span": {
color: se[600],
fontSize: 11
}
})), Fr = (t) => {
try {
return JSON.parse(
window.localStorage[`__REACT_WORKSPACE_SIDEBAR_EXPANDED_${t}`]
);
} catch {
return !1;
}
}, Ur = (t, e) => {
window.localStorage[`__REACT_WORKSPACE_SIDEBAR_EXPANDED_${t}`] = JSON.stringify(e);
}, _r = ({
icon: t,
title: e,
subTitle: o,
children: n,
noScroll: i = !1,
expandedByDefault: s
}) => {
const l = /* @__PURE__ */ u(Hr, { className: Vt(i && "noScroll"), children: n }), [a, p] = Rt(
s === void 0 ? Fr(e) : s
), f = Jo(
(d) => {
p(d), Ur(e, d);
},
[p, e]
), c = fr(() => f(!a)), y = Mt()[e.toLowerCase()];
return /* @__PURE__ */ u(Pe, { theme: Ir, children: /* @__PURE__ */ le(Wr, { children: [
/* @__PURE__ */ le(zr, { children: [
/* @__PURE__ */ u("div", { className: "iconContainer", children: t || /* @__PURE__ */ u(y, {}) }),
/* @__PURE__ */ le(Vr, { children: [
e,
" ",
/* @__PURE__ */ u("span", { children: o })
] }),
/* @__PURE__ */ u(
vo,
{
onClick: c,
sx: {
padding: 0,
width: 30,
height: 30,
"& .icon": {
width: 20,
height: 20,
transition: "500ms transform",
"&.expanded": {
transform: "rotate(180deg)"
}
}
},
children: /* @__PURE__ */ u(
Rr,
{
className: Vt("icon", a && "expanded")
}
)
}
)
] }),
i ? a ? l : null : /* @__PURE__ */ u(ht, { in: a, children: /* @__PURE__ */ u(
"div",
{
className: "panel",
style: { display: "block", overflow: "hidden", height: 200 },
children: l
}
) })
] }) });
};
Go(
_r,
(t, e) => t.title === e.title && t.children === e.children
);
var qr = function() {
}, To = typeof window < "u", Yr = To ? Qo : co, Eo = {
x: 0,
y: 0,
width: 0,
height: 0,
top: 0,
left: 0,
bottom: 0,
right: 0
};
function Xr() {
var t = Rt(null), e = t[0], o = t[1], n = Rt(Eo), i = n[0], s = n[1], l = fo(function() {
return new window.ResizeObserver(function(a) {
if (a[0]) {
var p = a[0].contentRect, f = p.x, c = p.y, h = p.width, y = p.height, d = p.top, w = p.left, m = p.bottom, v = p.right;
s({ x: f, y: c, width: h, height: y, top: d, left: w, bottom: m, right: v });
}
});
}, []);
return Yr(function() {
if (e)
return l.observe(e), function() {
l.disconnect();
};
}, [e]), [o, i];
}
const Kr = To && typeof window.ResizeObserver < "u" ? Xr : function() {
return [qr, Eo];
};
var _ = "top", ee = "bottom", te = "right", q = "left", Dt = "auto", et = [_, ee, te, q], De = "start", Ge = "end", Gr = "clippingParents", Co = "viewport", Fe = "popper", Jr = "reference", Xt = /* @__PURE__ */ et.reduce(function(t, e) {
return t.concat([e + "-" + De, e + "-" + Ge]);
}, []), Ro = /* @__PURE__ */ [].concat(et, [Dt]).reduce(function(t, e) {
return t.concat([e, e + "-" + De, e + "-" + Ge]);
}, []), Qr = "beforeRead", Zr = "read", en = "afterRead", tn = "beforeMain", on = "main", rn = "afterMain", nn = "beforeWrite", an = "write", sn = "afterWrite", pn = [Qr, Zr, en, tn, on, rn, nn, an, sn];
function fe(t) {
return t ? (t.nodeName || "").toLowerCase() : null;
}
function K(t) {
if (t == null)
return window;
if (t.toString() !== "[object Window]") {
var e = t.ownerDocument;
return e && e.defaultView || window;
}
return t;
}
function Ce(t) {
var e = K(t).Element;
return t instanceof e || t instanceof Element;
}
function Z(t) {
var e = K(t).HTMLElement;
return t instanceof e || t instanceof HTMLElement;
}
function Nt(t) {
if (typeof ShadowRoot > "u")
return !1;
var e = K(t).ShadowRoot;
return t instanceof e || t instanceof ShadowRoot;
}
function ln(t) {
var e = t.state;
Object.keys(e.elements).forEach(function(o) {
var n = e.styles[o] || {}, i = e.attributes[o] || {}, s = e.elements[o];
!Z(s) || !fe(s) || (Object.assign(s.style, n), Object.keys(i).forEach(function(l) {
var a = i[l];
a === !1 ? s.removeAttribute(l) : s.setAttribute(l, a === !0 ? "" : a);
}));
});
}
function cn(t) {
var e = t.state, o = {
popper: {
position: e.options.strategy,
left: "0",
top: "0",
margin: "0"
},
arrow: {
position: "absolute"
},
reference: {}
};
return Object.assign(e.elements.popper.style, o.popper), e.styles = o, e.elements.arrow && Object.assign(e.elements.arrow.style, o.arrow), function() {
Object.keys(e.elements).forEach(function(n) {
var i = e.elements[n], s = e.attributes[n] || {}, l = Object.keys(e.styles.hasOwnProperty(n) ? e.styles[n] : o[n]), a = l.reduce(function(p, f) {
return p[f] = "", p;
}, {});
!Z(i) || !fe(i) || (Object.assign(i.style, a), Object.keys(s).forEach(function(p) {
i.removeAttribute(p);
}));
});
};
}
const fn = {
name: "applyStyles",
enabled: !0,
phase: "write",
fn: ln,
effect: cn,
requires: ["computeStyles"]
};
function ce(t) {
return t.split("-")[0];
}
var Ee = Math.max, mt = Math.min, Ne = Math.round;
function St() {
var t = navigator.userAgentData;
return t != null && t.brands && Array.isArray(t.brands) ? t.brands.map(function(e) {
return e.brand + "/" + e.version;
}).join(" ") : navigator.userAgent;
}
function Po() {
return !/^((?!chrome|android).)*safari/i.test(St());
}
function je(t, e, o) {
e === void 0 && (e = !1), o === void 0 && (o = !1);
var n = t.getBoundingClientRect(), i = 1, s = 1;
e && Z(t) && (i = t.offsetWidth > 0 && Ne(n.width) / t.offsetWidth || 1, s = t.offsetHeight > 0 && Ne(n.height) / t.offsetHeight || 1);
var l = Ce(t) ? K(t) : window, a = l.visualViewport, p = !Po() && o, f = (n.left + (p && a ? a.offsetLeft : 0)) / i, c = (n.top + (p && a ? a.offsetTop : 0)) / s, h = n.width / i, y = n.height / s;
return {
width: h,
height: y,
top: c,
right: f + h,
bottom: c + y,
left: f,
x: f,
y: c
};
}
function jt(t) {
var e = je(t), o = t.offsetWidth, n = t.offsetHeight;
return Math.abs(e.width - o) <= 1 && (o = e.width), Math.abs(e.height - n) <= 1 && (n = e.height), {
x: t.offsetLeft,
y: t.offsetTop,
width: o,
height: n
};
}
function So(t, e) {
var o = e.getRootNode && e.getRootNode();
if (t.contains(e))
return !0;
if (o && Nt(o)) {
var n = e;
do {
if (n && t.isSameNode(n))
return !0;
n = n.parentNode || n.host;
} while (n);
}
return !1;
}
function ue(t) {
return K(t).getComputedStyle(t);
}
function dn(t) {
return ["table", "td", "th"].indexOf(fe(t)) >= 0;
}
function be(t) {
return ((Ce(t) ? t.ownerDocument : (
// $FlowFixMe[prop-missing]
t.document
)) || window.document).documentElement;
}
function wt(t) {
return fe(t) === "html" ? t : (
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
// $FlowFixMe[incompatible-return]
// $FlowFixMe[prop-missing]
t.assignedSlot || // step into the shadow DOM of the parent of a slotted node
t.parentNode || // DOM Element detected
(Nt(t) ? t.host : null) || // ShadowRoot detected
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
be(t)
);
}
function Kt(t) {
return !Z(t) || // https://github.com/popperjs/popper-core/issues/837
ue(t).position === "fixed" ? null : t.offsetParent;
}
function un(t) {
var e = /firefox/i.test(St()), o = /Trident/i.test(St());
if (o && Z(t)) {
var n = ue(t);
if (n.position === "fixed")
return null;
}
var i = wt(t);
for (Nt(i) && (i = i.host); Z(i) && ["html", "body"].indexOf(fe(i)) < 0; ) {
var s = ue(i);
if (s.transform !== "none" || s.perspective !== "none" || s.contain === "paint" || ["transform", "perspective"].indexOf(s.willChange) !== -1 || e && s.willChange === "filter" || e && s.filter && s.filter !== "none")
return i;
i = i.parentNode;
}
return null;
}
function tt(t) {
for (var e = K(t), o = Kt(t); o && dn(o) && ue(o).position === "static"; )
o = Kt(o);
return o && (fe(o) === "html" || fe(o) === "body" && ue(o).position === "static") ? e : o || un(t) || e;
}
function Bt(t) {
return ["top", "bottom"].indexOf(t) >= 0 ? "x" : "y";
}
function qe(t, e, o) {
return Ee(t, mt(e, o));
}
function hn(t, e, o) {
var n = qe(t, e, o);
return n > o ? o : n;
}
function $o() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function Ao(t) {
return Object.assign({}, $o(), t);
}
function Mo(t, e) {
return e.reduce(function(o, n) {
return o[n] = t, o;
}, {});
}
var mn = function(e, o) {
return e = typeof e == "function" ? e(Object.assign({}, o.rects, {
placement: o.placement
})) : e, Ao(typeof e != "number" ? e : Mo(e, et));
};
function vn(t) {
var e, o = t.state, n = t.name, i = t.options, s = o.elements.arrow, l = o.modifiersData.popperOffsets, a = ce(o.placement), p = Bt(a), f = [q, te].indexOf(a) >= 0, c = f ? "height" : "width";
if (!(!s || !l)) {
var h = mn(i.padding, o), y = jt(s), d = p === "y" ? _ : q, w = p === "y" ? ee : te, m = o.rects.reference[c] + o.rects.reference[p] - l[p] - o.rects.popper[c], v = l[p] - o.rects.reference[p], x = tt(s), P = x ? p === "y" ? x.clientHeight || 0 : x.clientWidth || 0 : 0, b = m / 2 - v / 2, g = h[d], C = P - y[c] - h[w], O = P / 2 - y[c] / 2 + b, S = qe(g, O, C), j = p;
o.modifiersData[n] = (e = {}, e[j] = S, e.centerOffset = S - O, e);
}
}
function gn(t) {
var e = t.state, o = t.options, n = o.element, i = n === void 0 ? "[data-popper-arrow]" : n;
i != null && (typeof i == "string" && (i = e.elements.popper.querySelector(i), !i) || So(e.elements.popper, i) && (e.elements.arrow = i));
}
const yn = {
name: "arrow",
enabled: !0,
phase: "main",
fn: vn,
effect: gn,
requires: ["popperOffsets"],
requiresIfExists: ["preventOverflow"]
};
function Be(t) {
return t.split("-")[1];
}
var bn = {
top: "auto",
right: "auto",
bottom: "auto",
left: "auto"
};
function wn(t, e) {
var o = t.x, n = t.y, i = e.devicePixelRatio || 1;
return {
x: Ne(o * i) / i || 0,
y: Ne(n * i) / i || 0
};
}
function Gt(t) {
var e, o = t.popper, n = t.popperRect, i = t.placement, s = t.variation, l = t.offsets, a = t.position, p = t.gpuAcceleration, f = t.adaptive, c = t.roundOffsets, h = t.isFixed, y = l.x, d = y === void 0 ? 0 : y, w = l.y, m = w === void 0 ? 0 : w, v = typeof c == "function" ? c({
x: d,
y: m
}) : {
x: d,
y: m
};
d = v.x, m = v.y;
var x = l.hasOwnProperty("x"), P = l.hasOwnProperty("y"), b = q, g = _, C = window;
if (f) {
var O = tt(o), S = "clientHeight", j = "clientWidth";
if (O === K(o) && (O = be(o), ue(O).position !== "static" && a === "absolute" && (S = "scrollHeight", j = "scrollWidth")), O = O, i === _ || (i === q || i === te) && s === Ge) {
g = ee;
var A = h && O === C && C.visualViewport ? C.visualViewport.height : (
// $FlowFixMe[prop-missing]
O[S]
);
m -= A - n.height, m *= p ? 1 : -1;
}
if (i === q || (i === _ || i === ee) && s === Ge) {
b = te;
var T = h && O === C && C.visualViewport ? C.visualViewport.width : (
// $FlowFixMe[prop-missing]
O[j]
);
d -= T - n.width, d *= p ? 1 : -1;
}
}
var D = Object.assign({
position: a
}, f && bn), W = c === !0 ? wn({
x: d,
y: m
}, K(o)) : {
x: d,
y: m
};
if (d = W.x, m = W.y, p) {
var M;
return Object.assign({}, D, (M = {}, M[g] = P ? "0" : "", M[b] = x ? "0" : "", M.transform = (C.devicePixelRatio || 1) <= 1 ? "translate(" + d + "px, " + m + "px)" : "translate3d(" + d + "px, " + m + "px, 0)", M));
}
return Object.assign({}, D, (e = {}, e[g] = P ? m + "px" : "", e[b] = x ? d + "px" : "", e.transform = "", e));
}
function xn(t) {
var e = t.state, o = t.options, n = o.gpuAcceleration, i = n === void 0 ? !0 : n, s = o.adaptive, l = s === void 0 ? !0 : s, a = o.roundOffsets, p = a === void 0 ? !0 : a, f = {
placement: ce(e.placement),
variation: Be(e.placement),
popper: e.elements.popper,
popperRect: e.rects.popper,
gpuAcceleration: i,
isFixed: e.options.strategy === "fixed"
};
e.modifiersData.popperOffsets != null && (e.styles.popper = Object.assign({}, e.styles.popper, Gt(Object.assign({}, f, {
offsets: e.modifiersData.popperOffsets,
position: e.options.strategy,
adaptive: l,
roundOffsets: p
})))), e.modifiersData.arrow != null && (e.styles.arrow = Object.assign({}, e.styles.arrow, Gt(Object.assign({}, f, {
offsets: e.modifiersData.arrow,
position: "absolute",
adaptive: !1,
roundOffsets: p
})))), e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-placement": e.placement
});
}
const On = {
name: "computeStyles",
enabled: !0,
phase: "beforeWrite",
fn: xn,
data: {}
};
var st = {
passive: !0
};
function Tn(t) {
var e = t.state, o = t.instance, n = t.options, i = n.scroll, s = i === void 0 ? !0 : i, l = n.resize, a = l === void 0 ? !0 : l, p = K(e.elements.popper), f = [].concat(e.scrollParents.reference, e.scrollParents.popper);
return s && f.forEach(function(c) {
c.addEventListener("scroll", o.update, st);
}), a && p.addEventListener("resize", o.update, st), function() {
s && f.forEach(function(c) {
c.removeEventListener("scroll", o.update, st);
}), a && p.removeEventListener("resize", o.update, st);
};
}
const En = {
name: "eventListeners",
enabled: !0,
phase: "write",
fn: function() {
},
effect: Tn,
data: {}
};
var Cn = {
left: "right",
right: "left",
bottom: "top",
top: "bottom"
};
function ft(t) {
return t.replace(/left|right|bottom|top/g, function(e) {
return Cn[e];
});
}
var Rn = {
start: "end",
end: "start"
};
function Jt(t) {
return t.replace(/start|end/g, function(e) {
return Rn[e];
});
}
function kt(t) {
var e = K(t), o = e.pageXOffset, n = e.pageYOffset;
return {
scrollLeft: o,
scrollTop: n
};
}
function Lt(t) {
return je(be(t)).left + kt(t).scrollLeft;
}
function Pn(t, e) {
var o = K(t), n = be(t), i = o.visualViewport, s = n.clientWidth, l = n.clientHeight, a = 0, p = 0;
if (i) {
s = i.width, l = i.height;
var f = Po();
(f || !f && e === "fixed") && (a = i.offsetLeft, p = i.offsetTop);
}
return {
width: s,
height: l,
x: a + Lt(t),
y: p
};
}
function Sn(t) {
var e, o = be(t), n = kt(t), i = (e = t.ownerDocument) == null ? void 0 : e.body, s = Ee(o.scrollWidth, o.clientWidth, i ? i.scrollWidth : 0, i ? i.clientWidth : 0), l = Ee(o.scrollHeight, o.clientHeight, i ? i.scrollHeight : 0, i ? i.clientHeight : 0), a = -n.scrollLeft + Lt(t), p = -n.scrollTop;
return ue(i || o).direction === "rtl" && (a += Ee(o.clientWidth, i ? i.clientWidth : 0) - s), {
width: s,
height: l,
x: a,
y: p
};
}
function It(t) {
var e = ue(t), o = e.overflow, n = e.overflowX, i = e.overflowY;
return /auto|scroll|overlay|hidden/.test(o + i + n);
}
function Do(t) {
return ["html", "body", "#document"].indexOf(fe(t)) >= 0 ? t.ownerDocument.body : Z(t) && It(t) ? t : Do(wt(t));
}
function Ye(t, e) {
var o;
e === void 0 && (e = []);
var n = Do(t), i = n === ((o = t.ownerDocument) == null ? void 0 : o.body), s = K(n), l = i ? [s].concat(s.visualViewport || [], It(n) ? n : []) : n, a = e.concat(l);
return i ? a : (
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
a.concat(Ye(wt(l)))
);
}
function $t(t) {
return Object.assign({}, t, {
left: t.x,
top: t.y,
right: t.x + t.width,
bottom: t.y + t.height
});
}
function $n(t, e) {
var o = je(t, !1, e === "fixed");
return o.top = o.top + t.clientTop, o.left = o.left + t.clientLeft, o.bottom = o.top + t.clientHeight, o.right = o.left + t.clientWidth, o.width = t.clientWidth, o.height = t.clientHeight, o.x = o.left, o.y = o.top, o;
}
function Qt(t, e, o) {
return e === Co ? $t(Pn(t, o)) : Ce(e) ? $n(e, o) : $t(Sn(be(t)));
}
function An(t) {
var e = Ye(wt(t)), o = ["absolute", "fixed"].indexOf(ue(t).position) >= 0, n = o && Z(t) ? tt(t) : t;
return Ce(n) ? e.filter(function(i) {
return Ce(i) && So(i, n) && fe(i) !== "body";
}) : [];
}
function Mn(t, e, o, n) {
var i = e === "clippingParents" ? An(t) : [].concat(e), s = [].concat(i, [o]), l = s[0], a = s.reduce(function(p, f) {
var c = Qt(t, f, n);
return p.top = Ee(c.top, p.top), p.right = mt(c.right, p.right), p.bottom = mt(c.bottom, p.bottom), p.left = Ee(c.left, p.left), p;
}, Qt(t, l, n));
return a.width = a.right - a.left, a.height = a.bottom - a.top, a.x = a.left, a.y = a.top, a;
}
function No(t) {
var e = t.reference, o = t.element, n = t.placement, i = n ? ce(n) : null, s = n ? Be(n) : null, l = e.x + e.width / 2 - o.width / 2, a = e.y + e.height / 2 - o.height / 2, p;
switch (i) {
case _:
p = {
x: l,
y: e.y - o.height
};
break;
case ee:
p = {
x: l,
y: e.y + e.height
};
break;
case te:
p = {
x: e.x + e.width,
y: a
};
break;
case q:
p = {
x: e.x - o.width,
y: a
};
break;
default:
p = {
x: e.x,
y: e.y
};
}
var f = i ? Bt(i) : null;
if (f != null) {
var c = f === "y" ? "height" : "width";
switch (s) {
case De:
p[f] = p[f] - (e[c] / 2 - o[c] / 2);
break;
case Ge:
p[f] = p[f] + (e[c] / 2 - o[c] / 2);
break;
}
}
return p;
}
function Je(t, e) {
e === void 0 && (e = {});
var o = e, n = o.placement, i = n === void 0 ? t.placement : n, s = o.strategy, l = s === void 0 ? t.strategy : s, a = o.boundary, p = a === void 0 ? Gr : a, f = o.rootBoundary, c = f === void 0 ? Co : f, h = o.elementContext, y = h === void 0 ? Fe : h, d = o.altBoundary, w = d === void 0 ? !1 : d, m = o.padding, v = m === void 0 ? 0 : m, x = Ao(typeof v != "number" ? v : Mo(v, et)), P = y === Fe ? Jr : Fe, b = t.rects.popper, g = t.elements[w ? P : y], C = Mn(Ce(g) ? g : g.contextElement || be(t.elements.popper), p, c, l), O = je(t.elements.reference), S = No({
reference: O,
element: b,
placement: i
}), j = $t(Object.assign({}, b, S)), A = y === Fe ? j : O, T = {
top: C.top - A.top + x.top,
bottom: A.bottom - C.bottom + x.bottom,
left: C.left - A.left + x.left,
right: A.right - C.right + x.right
}, D = t.modifiersData.offset;
if (y === Fe && D) {
var W = D[i];
Object.keys(T).forEach(function(M) {
var F = [te, ee].indexOf(M) >= 0 ? 1 : -1, U = [_, ee].indexOf(M) >= 0 ? "y" : "x";
T[M] += W[U] * F;
});
}
return T;
}
function Dn(t, e) {
e === void 0 && (e = {});
var o = e, n = o.placement, i = o.boundary, s = o.rootBoundary, l = o.padding, a = o.flipVariations, p = o.allowedAutoPlacements, f = p === void 0 ? Ro : p, c = Be(n), h = c ? a ? Xt : Xt.filter(function(w) {
return Be(w) === c;
}) : et, y = h.filter(function(w) {
return f.indexOf(w) >= 0;
});
y.length === 0 && (y = h);
var d = y.reduce(function(w, m) {
return w[m] = Je(t, {
placement: m,
boundary: i,
rootBoundary: s,
padding: l
})[ce(m)], w;
}, {});
return Object.keys(d).sort(function(w, m) {
return d[w] - d[m];
});
}
function Nn(t) {
if (ce(t) === Dt)
return [];
var e = ft(t);
return [Jt(t), e, Jt(e)];
}
function jn(t) {
var e = t.state, o = t.options, n = t.name;
if (!e.modifiersData[n]._skip) {
for (var i = o.mainAxis, s = i === void 0 ? !0 : i, l = o.altAxis, a = l === void 0 ? !0 : l, p = o.fallbackPlacements, f = o.padding, c = o.boundary, h = o.rootBoundary, y = o.altBoundary, d = o.flipVariations, w = d === void 0 ? !0 : d, m = o.allowedAutoPlacements, v = e.options.placement, x = ce(v), P = x === v, b = p || (P || !w ? [ft(v)] : Nn(v)), g = [v].concat(b).reduce(function(Y, X) {
return Y.concat(ce(X) === Dt ? Dn(e, {
placement: X,
boundary: c,
rootBoundary: h,
padding: f,
flipVariations: w,
allowedAutoPlacements: m
}) : X);
}, []), C = e.rects.reference, O = e.rects.popper, S = /* @__PURE__ */ new Map(), j = !0, A = g[0], T = 0; T < g.length; T++) {
var D = g[T], W = ce(D), M = Be(D) === De, F = [_, ee].indexOf(W) >= 0, U = F ? "width" : "height", k = Je(e, {
placement: D,
boundary: c,
rootBoundary: h,
altBoundary: y,
padding: f
}), N = F ? M ? te : q : M ? ee : _;
C[U] > O[U] && (N = ft(N));
var z = ft(N), oe = [];
if (s && oe.push(k[W] <= 0), a && oe.push(k[N] <= 0, k[z] <= 0), oe.every(function(Y) {
return Y;
})) {
A = D, j = !1;
break;
}
S.set(D, oe);
}
if (j)
for (var V = w ? 3 : 1, he = function(X) {
var R = g.find(function(H) {
var L = S.get(H);
if (L)
return L.slice(0, X).every(function(G) {
return G;
});
});
if (R)
return A = R, "break";
}, re = V; re > 0; re--) {
var me = he(re);
if (me === "break") break;
}
e.placement !== A && (e.modifiersData[n]._skip = !0, e.placement = A, e.reset = !0);
}
}
const Bn = {
name: "flip",
enabled: !0,
phase: "main",
fn: jn,
requiresIfExists: ["offset"],
data: {
_skip: !1
}
};
function Zt(t, e, o) {
return o === void 0 && (o = {
x: 0,
y: 0
}), {
top: t.top - e.height - o.y,
right: t.right - e.width + o.x,
bottom: t.bottom - e.height + o.y,
left: t.left - e.width - o.x
};
}
function eo(t) {
return [_, te, ee, q].some(function(e) {
return t[e] >= 0;
});
}
function kn(t) {
var e = t.state, o = t.name, n = e.rects.reference, i = e.rects.popper, s = e.modifiersData.preventOverflow, l = Je(e, {
elementContext: "reference"
}), a = Je(e, {
altBoundary: !0
}), p = Zt(l, n), f = Zt(a, i, s), c = eo(p), h = eo(f);
e.modifiersData[o] = {
referenceClippingOffsets: p,
popperEscapeOffsets: f,
isReferenceHidden: c,
hasPopperEscaped: h
}, e.attributes.popper = Object.assign({}, e.attributes.popper, {
"data-popper-reference-hidden": c,
"data-popper-escaped": h
});
}
const Ln = {
name: "hide",
enabled: !0,
phase: "main",
requiresIfExists: ["preventOverflow"],
fn: kn
};
function In(t, e, o) {
var n = ce(t), i = [q, _].indexOf(n) >= 0 ? -1 : 1, s = typeof o == "function" ? o(Object.assign({}, e, {
placement: t
})) : o, l = s[0], a = s[1];
return l = l || 0, a = (a || 0) * i, [q, te].indexOf(n) >= 0 ? {
x: a,
y: l
} : {
x: l,
y: a
};
}
function Wn(t) {
var e = t.state, o = t.options, n = t.name, i = o.offset, s = i === void 0 ? [0, 0] : i, l = Ro.reduce(function(c, h) {
return c[h] = In(h, e.rects, s), c;
}, {}), a = l[e.placement], p = a.x, f = a.y;
e.modifiersData.popperOffsets != null && (e.modifiersData.popperOffsets.x += p, e.modifiersData.popperOffsets.y += f), e.modifiersData[n] = l;
}
const zn = {
name: "offset",
enabled: !0,
phase: "main",
requires: ["popperOffsets"],
fn: Wn
};
function Hn(t) {
var e = t.state, o = t.name;
e.modifiersData[o] = No({
reference: e.rects.reference,
element: e.rects.popper,
placement: e.placement
});
}
const Vn = {
name: "popperOffsets",
enabled: !0,
phase: "read",
fn: Hn,
data: {}
};
function Fn(t) {
return t === "x" ? "y" : "x";
}
function Un(t) {
var e = t.state, o = t.options, n = t.name, i = o.mainAxis, s = i === void 0 ? !0 : i, l = o.altAxis, a = l === void 0 ? !1 : l, p = o.boundary, f = o.rootBoundary, c = o.altBoundary, h = o.padding, y = o.tether, d = y === void 0 ? !0 : y, w = o.tetherOffset, m = w === void 0 ? 0 : w, v = Je(e, {
boundary: p,
rootBoundary: f,
padding: h,
altBoundary: c
}), x = ce(e.placement), P = Be(e.placement), b = !P, g = Bt(x), C = Fn(g), O = e.modifiersData.popperOffsets, S = e.rects.reference, j = e.rects.popper, A = typeof m == "function" ? m(Object.assign({}, e.rects, {
placement: e.placement
})) : m, T = typeof A == "number" ? {
mainAxis: A,
altAxis: A
} : Object.assign({
mainAxis: 0,
altAxis: 0
}, A), D = e.modifiersData.offset ? e.modifiersData.offset[e.placement] : null, W = {
x: 0,
y: 0
};
if (O) {
if (s) {
var M, F = g === "y" ? _ : q, U = g === "y" ? ee : te, k = g === "y" ? "height" : "width", N = O[g], z = N + v[F], oe = N - v[U], V = d ? -j[k] / 2 : 0, he = P === De ? S[k] : j[k], re = P === De ? -j[k] : -S[k], me = e.elements.arrow, Y = d && me ? jt(me) : {
width: 0,
height: 0
}, X = e.modifiersData["arrow#persistent"] ? e.modifiersData["arrow#persistent"].padding : $o(), R = X[F], H = X[U], L = qe(0, S[k], Y[k]), G = b ? S[k] / 2 - V - L - R - T.mainAxis : he - L - R - T.mainAxis, ve = b ? -S[k] / 2 + V + L + H + T.mainAxis : re + L + H + T.mainAxis, de = e.elements.arrow && tt(e.elements.arrow), ne = de ? g === "y" ? de.clientTop || 0 : de.clientLeft || 0 : 0, Se = (M = D == null ? void 0 : D[g]) != null ? M : 0, we = N + G - Se - ne, $e = N + ve - Se, ke = qe(d ? mt(z, we) : z, N, d ? Ee(oe, $e) : oe);
O[g] = ke, W[g] = ke - N;
}
if (a) {
var xe, Ae = g === "x" ? _ : q, Le = g === "x" ? ee : te, pe = O[C], Oe = C === "y" ? "height" : "width", Ie = pe + v[Ae], We = pe - v[Le], ze = [_, q].indexOf(x) !== -1, ot = (xe = D == null ? void 0 : D[C]) != null ? xe : 0, rt = ze ? Ie : pe - S[Oe] - j[Oe] - ot + T.altAxis, Me = ze ? pe + S[Oe] + j[Oe] - ot - T.altAxis : We, nt = d && ze ? hn(rt, pe, Me) : qe(d ? rt : Ie, pe, d ? Me : We);
O[C] = nt, W[C] = nt - pe;
}
e.modifiersData[n] = W;
}
}
const _n = {
name: "preventOverflow",
enabled: !0,
phase: "main",
fn: Un,
requiresIfExists: ["offset"]
};
function qn(t) {
return {
scrollLeft: t.scrollLeft,
scrollTop: t.scrollTop
};
}
function Yn(t) {
return t === K(t) || !Z(t) ? kt(t) : qn(t);
}
function Xn(t) {
var e = t.getBoundingClientRect(), o = Ne(e.width) / t.offsetWidth || 1, n = Ne(e.height) / t.offsetHeight || 1;
return o !== 1 || n !== 1;
}
function Kn(t, e, o) {
o === void 0 && (o = !1);
var n = Z(e), i = Z(e) && Xn(e), s = be(e), l = je(t, i, o), a = {
scrollLeft: 0,
scrollTop: 0
}, p = {
x: 0,
y: 0
};
return (n || !n && !o) && ((fe(e) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
It(s)) && (a = Yn(e)), Z(e) ? (p = je(e, !0), p.x += e.clientLeft, p.y += e.clientTop) : s && (p.x = Lt(s))), {
x: l.left + a.scrollLeft - p.x,
y: l.top + a.scrollTop - p.y,
width: l.width,
height: l.height
};
}
function Gn(t) {
var e = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), n = [];
t.forEach(function(s) {
e.set(s.name, s);
});
function i(s) {
o.add(s.name);
var l = [].concat(s.requires || [], s.requiresIfExists || []);
l.forEach(function(a) {
if (!o.has(a)) {
var p = e.get(a);
p && i(p);
}
}), n.push(s);
}
return t.forEach(function(s) {
o.has(s.name) || i(s);
}), n;
}
function Jn(t) {
var e = Gn(t);
return pn.reduce(function(o, n) {
return o.concat(e.filter(function(i) {
return i.phase === n;
}));
}, []);
}
function Qn(t) {
var e;
return function() {
return e || (e = new Promise(function(o) {
Promise.resolve().then(function() {
e = void 0, o(t());
});
})), e;
};
}
function Zn(t) {
var e = t.reduce(function(o, n) {
var i = o[n.name];
return o[n.name] = i ? Object.assign({}, i, n, {
options: Object.assign({}, i.options, n.options),
data: Object.assign({}, i.data, n.data)
}) : n, o;
}, {});
return Object.keys(e).map(function(o) {
return e[o];
});
}
var to = {
placement: "bottom",
modifiers: [],
strategy: "absolute"
};
function oo() {
for (var t = arguments.length, e = new Array(t), o = 0; o < t; o++)
e[o] = arguments[o];
return !e.some(function(n) {
return !(n && typeof n.getBoundingClientRect == "function");
});
}
function ei(t) {
t === void 0 && (t = {});
var e = t, o = e.defaultModifiers, n = o === void 0 ? [] : o, i = e.defaultOptions, s = i === void 0 ? to : i;
return function(a, p, f) {
f === void 0 && (f = s);
var c = {
placement: "bottom",
orderedModifiers: [],
options: Object.assign({}, to, s),
modifiersData: {},
elements: {
reference: a,
popper: p
},
attributes: {},
styles: {}
}, h = [], y = !1, d = {
state: c,
setOptions: function(x) {
var P = typeof x == "function" ? x(c.options) : x;
m(), c.options = Object.assign({}, s, c.options, P), c.scrollParents = {
reference: Ce(a) ? Ye(a) : a.contextElement ? Ye(a.contextElement) : [],
popper: Ye(p)
};
var b = Jn(Zn([].concat(n, c.options.modifiers)));
return c.orderedModifiers = b.filter(function(g) {
return g.enabled;
}), w(), d.update();
},
// Sync update – it will always be executed, even if not necessary. This
// is useful for low frequency updates where sync behavior simplifies the
// logic.
// For high frequency updates (e.g. `resize` and `scroll` events), always
// prefer the async Popper#update method
forceUpdate: function() {
if (!y) {
var x = c.elements, P = x.reference, b = x.popper;
if (oo(P, b)) {
c.rects = {
reference: Kn(P, tt(b), c.options.strategy === "fixed"),
popper: jt(b)
}, c.reset = !1, c.placement = c.options.placement, c.orderedModifiers.forEach(function(T) {
return c.modifiersData[T.name] = Object.assign({}, T.data);
});
for (var g = 0; g < c.orderedModifiers.length; g++) {
if (c.reset === !0) {
c.reset = !1, g = -1;
continue;
}
var C = c.orderedModifiers[g], O = C.fn, S = C.options, j = S === void 0 ? {} : S, A = C.name;
typeof O == "function" && (c = O({
state: c,
options: j,
name: A,
instance: d
}) || c);
}
}
}
},
// Async and optimistically optimized update – it will not be executed if
// not necessary (debounced to run at most once-per-tick)
update: Qn(function() {
return new Promise(function(v) {
d.forceUpdate(), v(c);
});
}),
destroy: function() {
m(), y = !0;
}
};
if (!oo(a, p))
return d;
d.setOptions(f).then(function(v) {
!y && f.onFirstUpdate && f.onFirstUpdate(v);
});
function w() {
c.orderedModifiers.forEach(function(v) {
var x = v.name, P = v.options, b = P === void 0 ? {} : P, g = v.effect;
if (typeof g == "function") {
var C = g({
state: c,
name: x,
instance: d,
options: b
}), O = function() {
};
h.push(C || O);
}
});
}
function m() {
h.forEach(function(v) {
return v();
}), h = [];
}
return d;
};
}
var ti = [En, Vn, On, fn, zn, Bn, _n, yn, Ln], oi = /* @__PURE__ */ ei({
defaultModifiers: ti
});
function ri(t) {
return gt("MuiPopper", t);
}
Qe("MuiPopper", ["root"]);
function ni(t, e) {
if (e === "ltr")
return t;
switch (t) {
case "bottom-end":
return "bottom-start";
case "bottom-start":
return "bottom-end";
case "top-end":
return "top-start";
case "top-start":
return "top-end";
default:
return t;
}
}
function vt(t) {
return typeof t == "function" ? t() : t;
}
function xt(t) {
return t.nodeType !== void 0;
}
functio