mirador
Version:
An open-source, web-based 'multi-up' viewer that supports zoom-pan-rotate functionality, ability to display/compare simple images, and images with annotations.
22,217 lines • 680 kB
JavaScript
import { B as e, M as t, U as n, V as r, W as i, Z as a, _ as o, a as s, at as c, ct as l, d as u, dt as d, f, ft as p, g as m, h, i as g, l as _, lt as v, m as y, n as b, o as x, ot as S, s as C, st as w, t as T, u as E, ut as D } from "./getters-DPoFra9X.js";
import { $ as ee, A as te, Bt as ne, C as re, D as ie, Dt as ae, E as oe, Et as se, F as ce, Ft as O, G as le, I as ue, It as de, J as fe, K as pe, M as me, Mt as he, N as ge, Nt as _e, Ot as ve, P as ye, Pt as k, Q as be, R as xe, S as Se, St as Ce, T as we, Tt as Te, U as Ee, V as De, Vt as Oe, W as ke, Wt as Ae, Y as je, Z as Me, _ as Ne, _t as Pe, a as Fe, an as Ie, at as Le, b as Re, c as ze, ct as Be, d as Ve, et as He, g as Ue, gt as We, h as Ge, i as Ke, it as qe, j as Je, jt as Ye, k as Xe, l as Ze, ln as Qe, lt as $e, mt as et, n as tt, nt, o as rt, ot as it, p as at, q as ot, rt as st, s as ct, tt as lt, u as ut, w as dt, x as ft, xt as pt, y as mt, yt as ht, zt as gt } from "./canvases-xKdr7cbX.js";
import { t as A } from "./action-types-DjIbTE-A.js";
import { E as _t, S as vt, _ as yt, b as bt, c as xt, d as St, f as Ct, k as wt, l as Tt, n as Et, p as Dt, r as Ot, v as kt, w as At, x as jt, y as Mt } from "./FailedImageContext-BPhlsq3Z.js";
import { a as Nt, c as Pt, d as Ft, f as It, l as Lt, m as Rt, n as zt, t as Bt, u as Vt } from "./index.module-dbOTBfsw.js";
import { a as Ht, c as Ut, d as Wt, f as Gt, i as Kt, l as qt, n as Jt, o as Yt, r as Xt, s as Zt, t as Qt, u as $t } from "./window-QrrPJPF0.js";
import { i as en, n as tn, r as nn, t as j } from "./css-ns-CcpadD-C.js";
import { n as rn, r as an, t as on } from "./PluginHook-CDvgJE4t.js";
import { a as sn, n as cn, o as ln, r as un, t as dn } from "./CommentSharp-DboCbTHD.js";
import { t as M } from "./createSvgIcon-Cwt8YPfm.js";
import { i as fn, n as pn, o as mn, r as hn, t as gn } from "./visuallyHidden-4u-NKp9z.js";
import { t as _n } from "./react-error-boundary.esm-ByHqCaxk.js";
import * as N from "react";
import P, { Children as vn, PureComponent as yn, Suspense as bn, cloneElement as xn, createContext as Sn, createElement as Cn, createRef as wn, forwardRef as Tn, isValidElement as En, lazy as Dn, memo as On, useCallback as kn, useContext as An, useEffect as F, useId as jn, useImperativeHandle as Mn, useLayoutEffect as Nn, useMemo as Pn, useRef as I, useState as L } from "react";
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
import Fn from "@mui/material/Paper";
import { useTranslation as V } from "react-i18next";
import { alpha as In, darken as Ln, lighten as Rn, styled as H, styled as zn, useTheme as Bn, useThemeProps as Vn } from "@mui/material/styles";
import U from "@mui/material/Typography";
import { createSvgIcon as Hn } from "@mui/material/utils";
import Un from "@mui/material/Badge";
import Wn from "@mui/material/IconButton";
import Gn from "@mui/material/Tooltip";
import Kn from "@mui/material/Chip";
import qn from "@mui/material/MenuList";
import Jn from "@mui/material/MenuItem";
import Yn from "@mui/material/ListItemText";
import Xn from "@mui/material/Toolbar";
import Zn, { flushSync as Qn } from "react-dom";
import $n from "@mui/material/Accordion";
import er from "@mui/material/AccordionDetails";
import tr from "@mui/material/AccordionSummary";
import nr from "@mui/material/InputLabel";
import rr from "@mui/material/FormControl";
import ir from "@mui/material/Select";
import ar from "@mui/material/Button";
import or from "@mui/material/Link";
import sr from "@mui/material/Tabs";
import cr from "@mui/material/Tab";
import { useRtl as lr } from "@mui/system/RtlProvider";
import ur from "@mui/material/Collapse";
import { shouldForwardProp as dr } from "@mui/system/createStyled";
import fr from "@mui/material/Checkbox";
import { shouldForwardProp as pr } from "@mui/system";
import mr from "@mui/material/Skeleton";
import hr from "@mui/material/Autocomplete";
import gr from "@mui/material/CircularProgress";
import _r from "@mui/material/TextField";
import vr from "@mui/material/InputAdornment";
import yr from "@mui/material/List";
import br from "@mui/material/ListItem";
import xr from "@mui/material/ListItemButton";
import Sr from "@mui/material/Input";
import Cr from "@mui/material/Slider";
import wr from "@mui/material/ListItemIcon";
import Tr from "@mui/material/AppBar";
import Er from "@mui/material/ListSubheader";
import Dr from "@mui/material/Popover";
import Or from "@mui/material/FormControlLabel";
import kr from "@mui/material/SvgIcon";
import Ar from "@mui/material/Menu";
import jr from "@mui/material/Drawer";
import Mr from "@mui/material/Slide";
import Nr from "@mui/material/Stack";
import Pr from "@mui/material/Alert";
import { Button as Fr, Card as Ir, CardContent as Lr, Chip as Rr, Dialog as zr, DialogActions as Br, DialogContent as Vr, DialogContentText as Hr, DialogTitle as Ur, Link as Wr, ListItemIcon as Gr, ListItemText as Kr, MenuItem as qr, MenuList as Jr, TextField as Yr, Typography as Xr } from "@mui/material";
import Zr from "@mui/material/DialogContent";
import Qr from "@mui/material/DialogActions";
import $r from "@mui/material/Dialog";
import ei from "@mui/material/DialogTitle";
import ti from "@mui/material/Backdrop";
import { grey as ni } from "@mui/material/colors";
import ri from "@mui/material/Grid";
import ii from "@mui/material/ButtonBase";
import ai from "@mui/material/GlobalStyles";
import oi from "@mui/material/Fab";
import si from "@mui/material/useMediaQuery";
import ci from "@mui/material/Snackbar";
//#region node_modules/lodash/union.js
var li = /* @__PURE__ */ D(((e, t) => {
var n = Rt(), r = It(), i = Ft(), a = Vt();
t.exports = r(function(e) {
return i(n(e, 1, a, !0));
});
})), ui = /* @__PURE__ */ D(((e, t) => {
var n = Lt(), r = It(), i = Vt();
t.exports = r(function(e, t) {
return i(e) ? n(e, t) : [];
});
})), di = /* @__PURE__ */ p(li(), 1), fi = /* @__PURE__ */ p(ui(), 1), pi = Oe();
function mi(e, t) {
let n = e.getCanvasIds();
for (let e = 0; e < n.length; e += 1) if (pi.Utils.normalisedUrlsMatch(n[e], t)) return !0;
return !1;
}
function hi(e) {
return e.parentNode === void 0 ? [] : e.parentNode.parentNode === void 0 ? [e.parentNode.id] : [...hi(e.parentNode), e.parentNode.id];
}
function gi(e, t) {
return e.reduce((e, n) => {
let r = [];
r.push(...e);
let i = t.reduce((e, t) => e || mi(n.data, t), !1), a = n.nodes.length > 0 ? gi(n.nodes, t) : [];
return r.push(...a), (i || a.length > 0) && r.push({
containsVisibleCanvas: i,
descendantsContainVisibleCanvas: a.length > 0,
id: n.id,
leaf: n.nodes.length === 0,
parentIds: hi(n)
}), r;
}, []);
}
var _i = y([ce, at], (e, t) => t.length === 0 || !e ? [] : gi(e.nodes, t)), vi = y([_i], (e) => e.map((e) => e.id)), yi = y([_i], (e) => e.reduce((e, t) => t.leaf || !t.descendantsContainVisibleCanvas ? e : [...e, t.id], [])), bi = y([_i], (e) => e.reduce((e, t) => t.containsVisibleCanvas ? [...e, t] : e, []));
function xi(e, { companionWindowId: t }, n) {
let r = se(e, { companionWindowId: t });
return r.tocNodes ? Object.keys(r.tocNodes).reduce((e, t) => r.tocNodes[t].expanded === n ? [...e, t] : e, []) : [];
}
function Si(e, { companionWindowId: t, windowId: n }) {
let r = yi(e, {
companionWindowId: t,
windowId: n
}), i = xi(e, { companionWindowId: t }, !0), a = xi(e, { companionWindowId: t }, !1);
return (0, fi.default)((0, di.default)(i, r), ...a);
}
function Ci(e, { ...t }) {
let n = bi(e, { ...t }), r = xi(e, t, !1);
if (n && n.length > 0) {
for (let e = 0; e < n[0].parentIds.length; e += 1) if (r.indexOf(n[0].parentIds[e]) !== -1) return n[0].parentIds[e];
return n[0].id;
}
return null;
}
var wi = y([ce], (e) => e && e.nodes && e.nodes.length > 0 ? "tableOfContents" : "item"), Ti = y([et], ({ auth: { serviceProfiles: e = [] } = {} }) => e), Ei = (e) => f(e).accessTokens || u, Di = (e) => f(e).auth || u, Oi = y([
Ne,
mt,
Ti,
Di,
de,
(e, { iiifResources: t }) => t
], (e, t = {}, n, r, i, a) => {
let o = a;
if (!o && e && (o = e.flatMap((e) => i(e).iiifImageResources.map((e) => {
let n = ne(e), r = t[n.id];
return r && r.json ? {
...r.json,
options: {}
} : n;
}))), !o || o.length === 0) return E;
let s = o.map((e) => {
let t, i = pi.Utils.getServices(e);
for (let e of n) {
let n = i.filter((t) => e.profile === t.getProfile());
for (let e of n) if (t = e, !r[e.id] || r[e.id].isFetching || r[e.id].ok) return e;
}
return t;
});
return Object.values(s.reduce((e, t) => (t && !e[t.id] && (e[t.id] = t), e), {}));
}), ki = {
content: null,
position: null
};
function Ai(e, t, n = ki) {
let r = `cw-${h()}`;
return {
id: r,
payload: {
...n,
...t,
id: r,
windowId: e
},
type: A.ADD_COMPANION_WINDOW,
windowId: e
};
}
function ji(e, t, n = ki) {
return (r, i) => {
let a = i(), { position: o } = t, s = o === "left" && ae(a, {
position: o,
windowId: e
})[0];
r(s ? Mi(e, s, t) : Ai(e, t, n));
};
}
function Mi(e, t, n) {
return {
id: t,
payload: n,
type: A.UPDATE_COMPANION_WINDOW,
windowId: e
};
}
function Ni(e, t) {
return {
id: t,
type: A.REMOVE_COMPANION_WINDOW,
windowId: e
};
}
function Pi(e, t, n) {
return (r, i) => {
let a = i(), o = xi(a, { companionWindowId: t }, !1), s = xi(a, { companionWindowId: t }, !0), c = vi(a, {
id: t,
windowId: e
}), l = o.indexOf(n) !== -1 || s.indexOf(n) === -1 && c.indexOf(n) === -1;
return r({
id: t,
payload: { [n]: { expanded: l } },
type: A.TOGGLE_TOC_NODE,
windowId: e
});
};
}
function Fi(e, t, n) {
return (r, i) => {
let a = xi(i(), { companionWindowId: t }, !0), o = {};
return a.forEach((e) => {
o[e] = { expanded: !1 };
}), n.forEach((e) => {
o[e] = { expanded: !0 };
}), r({
id: t,
payload: o,
type: A.TOGGLE_TOC_NODE,
windowId: e
});
};
}
//#endregion
//#region src/state/actions/config.js
function Ii(e) {
return {
config: e,
type: A.IMPORT_CONFIG
};
}
function Li(e) {
return {
config: e,
type: A.SET_CONFIG
};
}
function Ri(e) {
return {
config: e,
type: A.UPDATE_CONFIG
};
}
function zi(e) {
return {
state: {
...e,
workspace: {
...e.workspace,
id: h()
}
},
type: A.IMPORT_MIRADOR_STATE
};
}
//#endregion
//#region src/state/actions/errors.js
function Bi(e) {
return {
id: `error-${h()}`,
message: e,
type: A.ADD_ERROR
};
}
function Vi(e) {
return {
id: e,
type: A.REMOVE_ERROR
};
}
//#endregion
//#region src/state/actions/manifest.js
function Hi(e, t) {
return {
manifestId: e,
properties: t,
type: A.REQUEST_MANIFEST
};
}
function Ui(e, t) {
return {
manifestId: e,
manifestJson: t,
type: A.RECEIVE_MANIFEST
};
}
function Wi(e, t) {
return {
error: t,
manifestId: e,
type: A.RECEIVE_MANIFEST_FAILURE
};
}
function Gi(e, t) {
return Hi(e, {
...t,
isFetching: !0
});
}
function Ki(e) {
return {
manifestId: e,
type: A.REMOVE_MANIFEST
};
}
//#endregion
//#region src/state/actions/workspace.js
function qi(e) {
return {
config: e,
type: A.UPDATE_WORKSPACE
};
}
function Ji(e) {
return {
showZoomControls: e,
type: A.TOGGLE_ZOOM_CONTROLS
};
}
function Yi(e) {
return {
layout: e,
type: A.UPDATE_WORKSPACE_MOSAIC_LAYOUT
};
}
function Xi(e) {
return {
isWorkspaceAddVisible: e,
type: A.SET_WORKSPACE_ADD_VISIBILITY
};
}
function Zi({ x: e, y: t }) {
return {
payload: { position: {
x: e,
y: t
} },
type: A.SET_WORKSPACE_VIEWPORT_POSITION
};
}
function Qi({ width: e, height: t }) {
return {
payload: { position: {
height: t,
width: e
} },
type: A.SET_WORKSPACE_VIEWPORT_POSITION
};
}
function $i() {
return { type: A.TOGGLE_DRAGGING };
}
//#endregion
//#region src/state/actions/auth.js
function ea(e, t, n = void 0) {
return {
id: t,
profile: n,
type: A.ADD_AUTHENTICATION_REQUEST,
windowId: e
};
}
function ta(e, t, n) {
return {
id: e,
tokenServiceId: t,
type: A.RESOLVE_AUTHENTICATION_REQUEST,
...n
};
}
function na(e, t) {
return {
authId: t,
serviceId: e,
type: A.REQUEST_ACCESS_TOKEN
};
}
function ra(e, t, n) {
return {
authId: e,
json: n,
serviceId: t,
type: A.RECEIVE_ACCESS_TOKEN
};
}
function ia(e, t, n) {
return {
authId: e,
error: n,
serviceId: t,
type: A.RECEIVE_ACCESS_TOKEN_FAILURE
};
}
function aa(e, t, n) {
return n.accessToken ? ra(e, t, n) : ia(e, t, n);
}
function oa({ authServiceId: e, tokenServiceId: t }) {
return {
id: e,
tokenServiceId: t,
type: A.RESET_AUTHENTICATION_STATE
};
}
//#endregion
//#region src/state/actions/elasticLayout.js
function sa(e, t) {
return {
payload: t,
type: A.UPDATE_ELASTIC_WINDOW_LAYOUT,
windowId: e
};
}
//#endregion
//#region src/state/actions/search.js
function ca(e, t, n, r) {
return {
companionWindowId: t,
query: r,
searchId: n,
type: A.REQUEST_SEARCH,
windowId: e
};
}
function la(e, t, n, r) {
return {
companionWindowId: t,
searchId: n,
searchJson: r,
type: A.RECEIVE_SEARCH,
windowId: e
};
}
function ua(e, t, n, r) {
return {
companionWindowId: t,
error: r,
searchId: n,
type: A.RECEIVE_SEARCH_FAILURE,
windowId: e
};
}
function da(e, t) {
return {
companionWindowId: t,
type: A.REMOVE_SEARCH,
windowId: e
};
}
function fa(e, t, n, r) {
return ca(e, t, n, r);
}
function pa(e, t, n) {
return {
annotationIds: n,
companionWindowId: t,
type: A.SET_CONTENT_SEARCH_CURRENT_ANNOTATIONS,
windowId: e
};
}
//#endregion
//#region src/state/actions/layers.js
function ma(e, t, n) {
return {
canvasId: t,
payload: n,
type: A.UPDATE_LAYERS,
windowId: e
};
}
//#endregion
//#region src/state/actions/catalog.js
function ha(e, t = void 0, n) {
return {
manifestId: e,
manifestJson: t,
payload: n,
type: A.ADD_RESOURCE
};
}
function ga(e) {
return {
manifestId: e,
type: A.REMOVE_RESOURCE
};
}
//#endregion
//#region node_modules/react-window/dist/react-window.js
var W = /* @__PURE__ */ p(c(), 1);
function _a(e) {
let t = e;
for (; t;) {
if (t.dir) return t.dir === "rtl";
t = t.parentElement;
}
return !1;
}
function va(e, t) {
let [n, r] = L(t === "rtl");
return Nn(() => {
e && (t || r(_a(e)));
}, [t, e]), n;
}
var ya = typeof window < "u" ? Nn : F;
function ba(e) {
if (e !== void 0) switch (typeof e) {
case "number": return e;
case "string":
if (e.endsWith("px")) return parseFloat(e);
break;
}
}
function xa({ box: e, defaultHeight: t, defaultWidth: n, disabled: r, element: i, mode: a, style: o }) {
let { styleHeight: s, styleWidth: c } = Pn(() => ({
styleHeight: ba(o?.height),
styleWidth: ba(o?.width)
}), [o?.height, o?.width]), [l, u] = L({
height: t,
width: n
}), d = r || a === "only-height" && s !== void 0 || a === "only-width" && c !== void 0 || s !== void 0 && c !== void 0;
return ya(() => {
if (i === null || d) return;
let t = new ResizeObserver((e) => {
for (let t of e) {
let { contentRect: e, target: n } = t;
i === n && u((t) => t.height === e.height && t.width === e.width ? t : {
height: e.height,
width: e.width
});
}
});
return t.observe(i, { box: e }), () => {
t?.unobserve(i);
};
}, [
e,
d,
i,
s,
c
]), Pn(() => ({
height: s ?? l.height,
width: c ?? l.width
}), [
l,
s,
c
]);
}
function Sa(e) {
let t = I(() => {
throw Error("Cannot call during render.");
});
return ya(() => {
t.current = e;
}, [e]), kn((e) => t.current?.(e), [t]);
}
var Ca = null;
function wa(e = !1) {
if (Ca === null || e) {
let e = document.createElement("div"), t = e.style;
t.width = "50px", t.height = "50px", t.overflow = "scroll", t.direction = "rtl";
let n = document.createElement("div"), r = n.style;
return r.width = "100px", r.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? Ca = "positive-descending" : (e.scrollLeft = 1, Ca = e.scrollLeft === 0 ? "negative" : "positive-ascending"), document.body.removeChild(e), Ca;
}
return Ca;
}
function Ta({ containerElement: e, direction: t, isRtl: n, scrollOffset: r }) {
if (t === "horizontal" && n) switch (wa()) {
case "negative": return -r;
case "positive-descending":
if (e) {
let { clientWidth: t, scrollLeft: n, scrollWidth: r } = e;
return r - t - n;
}
break;
}
return r;
}
function Ea(e, t = "Assertion error") {
if (!e) throw console.error(t), Error(t);
}
function Da(e, t) {
if (e === t) return !0;
if (!!e != !!t || (Ea(e !== void 0), Ea(t !== void 0), Object.keys(e).length !== Object.keys(t).length)) return !1;
for (let n in e) if (!Object.is(t[n], e[n])) return !1;
return !0;
}
function Oa({ cachedBounds: e, itemCount: t, itemSize: n }) {
if (t === 0) return 0;
if (typeof n == "number") return t * n;
{
let n = e.get(e.size === 0 ? 0 : e.size - 1);
return Ea(n !== void 0, "Unexpected bounds cache miss"), t * ((n.scrollOffset + n.size) / e.size);
}
}
function ka({ align: e, cachedBounds: t, index: n, itemCount: r, itemSize: i, containerScrollOffset: a, containerSize: o }) {
if (n < 0 || n >= r) throw RangeError(`Invalid index specified: ${n}`, { cause: `Index ${n} is not within the range of 0 - ${r - 1}` });
let s = Oa({
cachedBounds: t,
itemCount: r,
itemSize: i
}), c = t.get(n), l = Math.max(0, Math.min(s - o, c.scrollOffset)), u = Math.max(0, c.scrollOffset - o + c.size);
switch (e === "smart" && (e = a >= u && a <= l ? "auto" : "center"), e) {
case "start": return l;
case "end": return u;
case "center": return c.scrollOffset <= o / 2 ? 0 : c.scrollOffset + c.size / 2 >= s - o / 2 ? s - o : c.scrollOffset + c.size / 2 - o / 2;
default: return a >= u && a <= l ? a : a < u ? u : l;
}
}
function Aa({ cachedBounds: e, containerScrollOffset: t, containerSize: n, itemCount: r, overscanCount: i }) {
let a = r - 1, o = 0, s = -1, c = 0, l = -1, u = 0;
for (; u < a;) {
let n = e.get(u);
if (n.scrollOffset + n.size > t) break;
u++;
}
for (o = u, c = Math.max(0, o - i); u < a;) {
let r = e.get(u);
if (r.scrollOffset + r.size >= t + n) break;
u++;
}
return s = Math.min(a, u), l = Math.min(r - 1, s + i), o < 0 && (o = 0, s = -1, c = 0, l = -1), {
startIndexVisible: o,
stopIndexVisible: s,
startIndexOverscan: c,
stopIndexOverscan: l
};
}
function ja({ itemCount: e, itemProps: t, itemSize: n }) {
let r = /* @__PURE__ */ new Map();
return {
get(i) {
for (Ea(i < e, `Invalid index ${i}`); r.size - 1 < i;) {
let e = r.size, a;
switch (typeof n) {
case "function":
a = n(e, t);
break;
case "number": a = n;
}
if (e === 0) r.set(e, {
size: a,
scrollOffset: 0
});
else {
let t = r.get(e - 1);
Ea(t !== void 0, `Unexpected bounds cache miss for index ${i}`), r.set(e, {
scrollOffset: t.scrollOffset + t.size,
size: a
});
}
}
let a = r.get(i);
return Ea(a !== void 0, `Unexpected bounds cache miss for index ${i}`), a;
},
set(e, t) {
r.set(e, t);
},
get size() {
return r.size;
}
};
}
function Ma({ itemCount: e, itemProps: t, itemSize: n }) {
return Pn(() => ja({
itemCount: e,
itemProps: t,
itemSize: n
}), [
e,
t,
n
]);
}
function Na({ containerSize: e, itemSize: t }) {
let n;
switch (typeof t) {
case "string":
Ea(t.endsWith("%"), `Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`), Ea(e !== void 0, "Container size must be defined if a percentage item size is specified"), n = e * parseInt(t) / 100;
break;
default: n = t;
}
return n;
}
function Pa({ containerElement: e, containerStyle: t, defaultContainerSize: n = 0, direction: r, isRtl: i = !1, itemCount: a, itemProps: o, itemSize: s, onResize: c, overscanCount: l }) {
let { height: u = n, width: d = n } = xa({
defaultHeight: r === "vertical" ? n : void 0,
defaultWidth: r === "horizontal" ? n : void 0,
element: e,
mode: r === "vertical" ? "only-height" : "only-width",
style: t
}), f = I({
height: 0,
width: 0
}), p = r === "vertical" ? u : d, m = Na({
containerSize: p,
itemSize: s
});
Nn(() => {
if (typeof c == "function") {
let e = f.current;
(e.height !== u || e.width !== d) && (c({
height: u,
width: d
}, { ...e }), e.height = u, e.width = d);
}
}, [
u,
c,
d
]);
let h = Ma({
itemCount: a,
itemProps: o,
itemSize: m
}), g = kn((e) => h.get(e), [h]), [_, v] = L(() => Aa({
cachedBounds: h,
containerScrollOffset: 0,
containerSize: p,
itemCount: a,
overscanCount: l
})), { startIndexVisible: y, startIndexOverscan: b, stopIndexVisible: x, stopIndexOverscan: S } = {
startIndexVisible: Math.min(a - 1, _.startIndexVisible),
startIndexOverscan: Math.min(a - 1, _.startIndexOverscan),
stopIndexVisible: Math.min(a - 1, _.stopIndexVisible),
stopIndexOverscan: Math.min(a - 1, _.stopIndexOverscan)
}, C = kn(() => Oa({
cachedBounds: h,
itemCount: a,
itemSize: m
}), [
h,
a,
m
]), w = kn((t) => {
let n = Ta({
containerElement: e,
direction: r,
isRtl: i,
scrollOffset: t
});
return Aa({
cachedBounds: h,
containerScrollOffset: n,
containerSize: p,
itemCount: a,
overscanCount: l
});
}, [
h,
e,
p,
r,
i,
a,
l
]);
return ya(() => {
let t = (r === "vertical" ? e?.scrollTop : e?.scrollLeft) ?? 0;
v(w(t));
}, [
e,
r,
w
]), ya(() => {
if (!e) return;
let t = () => {
v((t) => {
let { scrollLeft: n, scrollTop: o } = e, s = Ta({
containerElement: e,
direction: r,
isRtl: i,
scrollOffset: r === "vertical" ? o : n
}), c = Aa({
cachedBounds: h,
containerScrollOffset: s,
containerSize: p,
itemCount: a,
overscanCount: l
});
return Da(c, t) ? t : c;
});
};
return e.addEventListener("scroll", t), () => {
e.removeEventListener("scroll", t);
};
}, [
h,
e,
p,
r,
a,
l
]), {
getCellBounds: g,
getEstimatedSize: C,
scrollToIndex: Sa(({ align: t = "auto", containerScrollOffset: n, index: o }) => {
let s = ka({
align: t,
cachedBounds: h,
containerScrollOffset: n,
containerSize: p,
index: o,
itemCount: a,
itemSize: m
});
if (e) {
if (s = Ta({
containerElement: e,
direction: r,
isRtl: i,
scrollOffset: s
}), typeof e.scrollTo != "function") {
let e = w(s);
Da(_, e) || v(e);
}
return s;
}
}),
startIndexOverscan: b,
startIndexVisible: y,
stopIndexOverscan: S,
stopIndexVisible: x
};
}
function Fa(e) {
return Pn(() => e, Object.values(e));
}
function Ia(e, t) {
let { ariaAttributes: n, style: r, ...i } = e, { ariaAttributes: a, style: o, ...s } = t;
return Da(n, a) && Da(r, o) && Da(i, s);
}
function La({ cellComponent: e, cellProps: t, children: n, className: r, columnCount: i, columnWidth: a, defaultHeight: o = 0, defaultWidth: s = 0, dir: c, gridRef: l, onCellsRendered: u, onResize: d, overscanCount: f = 3, rowCount: p, rowHeight: m, style: h, tagName: g = "div", ..._ }) {
let v = Fa(t), y = Pn(() => On(e, Ia), [e]), [b, x] = L(null), S = va(b, c), { getCellBounds: C, getEstimatedSize: w, startIndexOverscan: T, startIndexVisible: E, scrollToIndex: D, stopIndexOverscan: ee, stopIndexVisible: te } = Pa({
containerElement: b,
containerStyle: h,
defaultContainerSize: s,
direction: "horizontal",
isRtl: S,
itemCount: i,
itemProps: v,
itemSize: a,
onResize: d,
overscanCount: f
}), { getCellBounds: ne, getEstimatedSize: re, startIndexOverscan: ie, startIndexVisible: ae, scrollToIndex: oe, stopIndexOverscan: se, stopIndexVisible: ce } = Pa({
containerElement: b,
containerStyle: h,
defaultContainerSize: o,
direction: "vertical",
itemCount: p,
itemProps: v,
itemSize: m,
onResize: d,
overscanCount: f
});
Mn(l, () => ({
get element() {
return b;
},
scrollToCell({ behavior: e = "auto", columnAlign: t = "auto", columnIndex: n, rowAlign: r = "auto", rowIndex: i }) {
let a = D({
align: t,
containerScrollOffset: b?.scrollLeft ?? 0,
index: n
}), o = oe({
align: r,
containerScrollOffset: b?.scrollTop ?? 0,
index: i
});
typeof b?.scrollTo == "function" && b.scrollTo({
behavior: e,
left: a,
top: o
});
},
scrollToColumn({ align: e = "auto", behavior: t = "auto", index: n }) {
let r = D({
align: e,
containerScrollOffset: b?.scrollLeft ?? 0,
index: n
});
typeof b?.scrollTo == "function" && b.scrollTo({
behavior: t,
left: r
});
},
scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
let r = oe({
align: e,
containerScrollOffset: b?.scrollTop ?? 0,
index: n
});
typeof b?.scrollTo == "function" && b.scrollTo({
behavior: t,
top: r
});
}
}), [
b,
D,
oe
]), F(() => {
T >= 0 && ee >= 0 && ie >= 0 && se >= 0 && u && u({
columnStartIndex: E,
columnStopIndex: te,
rowStartIndex: ae,
rowStopIndex: ce
}, {
columnStartIndex: T,
columnStopIndex: ee,
rowStartIndex: ie,
rowStopIndex: se
});
}, [
u,
T,
E,
ee,
te,
ie,
ae,
se,
ce
]);
let O = Pn(() => {
let e = [];
if (i > 0 && p > 0) for (let t = ie; t <= se; t++) {
let n = ne(t), r = [];
for (let e = T; e <= ee; e++) {
let i = C(e);
r.push(/* @__PURE__ */ Cn(y, {
...v,
ariaAttributes: {
"aria-colindex": e + 1,
role: "gridcell"
},
columnIndex: e,
key: e,
rowIndex: t,
style: {
position: "absolute",
left: S ? void 0 : 0,
right: S ? 0 : void 0,
transform: `translate(${S ? -i.scrollOffset : i.scrollOffset}px, ${n.scrollOffset}px)`,
height: n.size,
width: i.size
}
}));
}
e.push(/* @__PURE__ */ z("div", {
role: "row",
"aria-rowindex": t + 1,
children: r
}, t));
}
return e;
}, [
y,
v,
i,
T,
ee,
C,
ne,
S,
p,
ie,
se
]), le = /* @__PURE__ */ z("div", {
"aria-hidden": !0,
style: {
height: re(),
width: w(),
zIndex: -1
}
});
return Cn(g, {
"aria-colcount": i,
"aria-rowcount": p,
role: "grid",
..._,
className: r,
dir: c,
ref: x,
style: {
position: "relative",
maxHeight: "100%",
maxWidth: "100%",
flexGrow: 1,
overflow: "auto",
...h
}
}, O, n, le);
}
function Ra(e) {
return typeof e == "object" && !!e && "getAverageRowHeight" in e && typeof e.getAverageRowHeight == "function";
}
var za = "data-react-window-index";
function Ba({ children: e, className: t, defaultHeight: n = 0, listRef: r, onResize: i, onRowsRendered: a, overscanCount: o = 3, rowComponent: s, rowCount: c, rowHeight: l, rowProps: u, tagName: d = "div", style: f, ...p }) {
let m = Fa(u), h = Pn(() => On(s, Ia), [s]), [g, _] = L(null), v = Ra(l), { getCellBounds: y, getEstimatedSize: b, scrollToIndex: x, startIndexOverscan: S, startIndexVisible: C, stopIndexOverscan: w, stopIndexVisible: T } = Pa({
containerElement: g,
containerStyle: f,
defaultContainerSize: n,
direction: "vertical",
itemCount: c,
itemProps: m,
itemSize: Pn(() => v ? (e) => l.getRowHeight(e) ?? l.getAverageRowHeight() : l, [v, l]),
onResize: i,
overscanCount: o
});
Mn(r, () => ({
get element() {
return g;
},
scrollToRow({ align: e = "auto", behavior: t = "auto", index: n }) {
let r = x({
align: e,
containerScrollOffset: g?.scrollTop ?? 0,
index: n
});
typeof g?.scrollTo == "function" && g.scrollTo({
behavior: t,
top: r
});
}
}), [g, x]), ya(() => {
if (!g) return;
let e = Array.from(g.children).filter((e, t) => {
if (e.hasAttribute("aria-hidden")) return !1;
let n = `${S + t}`;
return e.setAttribute(za, n), !0;
});
if (v) return l.observeRowElements(e);
}, [
g,
v,
l,
S,
w
]), F(() => {
S >= 0 && w >= 0 && a && a({
startIndex: C,
stopIndex: T
}, {
startIndex: S,
stopIndex: w
});
}, [
a,
S,
C,
w,
T
]);
let E = Pn(() => {
let e = [];
if (c > 0) for (let t = S; t <= w; t++) {
let n = y(t);
e.push(/* @__PURE__ */ Cn(h, {
...m,
ariaAttributes: {
"aria-posinset": t + 1,
"aria-setsize": c,
role: "listitem"
},
key: t,
index: t,
style: {
position: "absolute",
left: 0,
transform: `translateY(${n.scrollOffset}px)`,
height: v ? void 0 : n.size,
width: "100%"
}
}));
}
return e;
}, [
h,
y,
v,
c,
m,
S,
w
]), D = /* @__PURE__ */ z("div", {
"aria-hidden": !0,
style: {
height: b(),
width: "100%",
zIndex: -1
}
});
return Cn(d, {
role: "list",
...p,
className: t,
ref: _,
style: {
position: "relative",
maxHeight: "100%",
flexGrow: 1,
overflowY: "auto",
...f
}
}, E, e, D);
}
//#endregion
//#region src/hooks/useCanvasWorldService.js
function Va() {
let e = l(de);
return { get: (t) => t && new zt(t.map(e)) };
}
//#endregion
//#region src/components/ThumbnailCanvasGrouping.jsx
var G = /* @__PURE__ */ p(an(), 1), Ha = H("div")(({ theme: e }) => ({
boxSizing: "border-box",
color: e.palette.common.white,
cursor: "pointer",
display: "inline-block",
whiteSpace: "nowrap"
})), Ua = class extends yn {
constructor(e) {
super(e), this.setCanvas = this.setCanvas.bind(this);
}
setCanvas(e) {
let { setCanvas: t } = this.props;
t(e.currentTarget.dataset.canvasId);
}
currentCanvasClass(e) {
let { index: t } = this.props;
return e.includes(t) ? "current-canvas-grouping" : "";
}
render() {
let { index: e, columnIndex: t, style: n, canvasGroupings: r, position: i, currentCanvasId: a, showThumbnailLabels: o } = this.props, s = t === void 0 ? e : t, c = r[s], l = c.map((e) => e.id).includes(a);
return /* @__PURE__ */ z("div", {
style: {
...n,
boxSizing: "border-box",
height: Number.isInteger(n.height) ? n.height - 12 : null,
left: Number.isInteger(n.left) ? n.left + 6 : null,
padding: 6,
top: Number.isInteger(n.top) ? n.top + 6 : null,
width: Number.isInteger(n.width) ? n.width - 12 : null
},
className: j("thumbnail-nav-container"),
role: "gridcell",
"aria-selected": l,
"aria-colindex": s + 1,
children: /* @__PURE__ */ z(Ha, {
role: "button",
"data-canvas-id": c[0].id,
"data-canvas-index": c[0].index,
onClick: this.setCanvas,
tabIndex: -1,
sx: (e) => ({
"&:not(:hover)": {
outline: l ? `2px solid ${e.palette.primary.main}` : 0,
...l && { outlineOffset: "3px" }
},
"&:hover": {
outline: l ? `2px solid ${e.palette.primary.main}` : `2px solid ${e.palette.action.hover}`,
outlineOffset: l ? "3px" : "-2px"
},
height: i === "far-right" ? "auto" : `${n.height}px`,
width: i === "far-bottom" ? "auto" : `${n.width}px`
}),
className: (0, G.default)(j([
"thumbnail-nav-canvas",
`thumbnail-nav-canvas-${s}`,
this.currentCanvasClass(c.map((e) => e.index))
])),
children: c.map((e, t) => /* @__PURE__ */ z(un, {
resource: e,
labelled: o,
maxHeight: i === "far-right" ? n.height - 12 : n.height,
variant: "inside"
}, e.id))
})
});
}
};
Ua.propTypes = {
canvasGroupings: W.default.array.isRequired,
columnIndex: W.default.number,
currentCanvasId: W.default.string.isRequired,
index: W.default.number,
position: W.default.string.isRequired,
setCanvas: W.default.func.isRequired,
showThumbnailLabels: W.default.bool.isRequired,
style: W.default.object.isRequired
}, Ua.defaultProps = {
columnIndex: void 0,
index: void 0
};
var Wa = n(w((e, { windowId: t }) => ({
currentCanvasId: (ze(e, { windowId: t }) || {}).id,
showThumbnailLabels: et(e).thumbnailNavigation.showThumbnailLabels
}), (e, { windowId: t }) => ({ setCanvas: (...n) => e(tn(t, ...n)) })), m("ThumbnailCanvasGrouping"))(Ua);
//#endregion
//#region src/components/ThumbnailNavigation.jsx
function Ga({ canvasGroupings: e, canvasIndex: t, hasNextCanvas: n = !1, hasPreviousCanvas: r = !1, position: i, setNextCanvas: a = () => {}, setPreviousCanvas: o = () => {}, thumbnailNavigation: s, view: c = void 0, viewingDirection: l = "", windowId: u }) {
let { t: d } = V(), f = I(), p = I(c), m = Va();
F(() => {
p.current !== c && i !== "off" && (p.current = c);
}, [c, i]), F(() => {
let n = t;
c === "book" && (n = Math.ceil(n / 2)), f.current && n >= 0 && n < e.length && (i === "far-bottom" ? f.current.scrollToCell({
columnIndex: n,
rowIndex: 0,
columnAlign: "center",
rowAlign: "center"
}) : f.current.scrollToRow({
index: n,
align: "center"
}));
}, [
t,
c,
e.length,
i
]);
let h = I(null);
F(() => {
h.current && document.activeElement !== h.current && h.current.focus({ preventScroll: !0 });
}, [t]);
let g = (e) => {
let t = "ArrowRight", n = "ArrowLeft";
switch (i === "far-right" && (t = "ArrowDown", n = "ArrowUp"), e.key) {
case t:
b();
break;
case n: x();
}
}, _ = (t) => {
let n = e[t];
if (!n) return s.width + 12;
let r = m.get(n).worldBounds(), i = s.height - 12 - 6, a = Math.ceil(i * r[2] / r[3]);
return Number.isInteger(a) ? a + 12 : s.width + 12;
}, v = (t) => {
let n = e[t];
if (!n) return s.height + 12;
let r = m.get(n).worldBounds(), i = s.width - 12 - 6, a = Math.ceil(i * n.length * r[3] / r[2]);
return Number.isInteger(a) ? Math.max(a, Math.round(s.height / 3)) + 12 : s.height + 12;
}, y = kn(() => {
let e = c === "book" ? s.width * 2 : s.width;
switch (i) {
case "far-right": return { width: `${e}px` };
default: return { width: "100%" };
}
}, [
i,
s,
c
]), b = () => {
n && a();
}, x = () => {
r && o();
};
if (i === "off") return null;
let S = l === "right-to-left" ? "rtl" : "ltr", C = {
canvasGroupings: e,
position: i,
windowId: u
};
return /* @__PURE__ */ B(Fn, {
className: (0, G.default)(j("thumb-navigation")),
sx: {
"&:focus": {
boxShadow: 0,
outline: 0
},
scrollbarGutter: "stable"
},
"aria-label": d("thumbnailNavigation"),
square: !0,
elevation: 0,
style: y(),
tabIndex: 0,
onKeyDown: g,
ref: h,
children: [e.length > 0 && i === "far-bottom" && /* @__PURE__ */ z(La, {
columnCount: e.length,
columnWidth: _,
rowCount: 1,
rowHeight: s.height - 12 - 6,
style: {
direction: S === "rtl" ? "rtl" : "ltr",
height: s.height
},
cellProps: C,
gridRef: f,
cellComponent: Wa
}), e.length > 0 && i === "far-right" && /* @__PURE__ */ z(Ba, {
defaultHeight: 100,
rowCount: e.length,
rowHeight: v,
style: {
paddingBottom: 12,
direction: S === "rtl" ? "rtl" : "ltr"
},
rowProps: C,
listRef: f,
rowComponent: Wa
})]
});
}
Ga.propTypes = {
canvasGroupings: W.default.array.isRequired,
canvasIndex: W.default.number.isRequired,
hasNextCanvas: W.default.bool,
hasPreviousCanvas: W.default.bool,
position: W.default.string.isRequired,
setNextCanvas: W.default.func,
setPreviousCanvas: W.default.func,
thumbnailNavigation: W.default.object.isRequired,
view: W.default.string,
viewingDirection: W.default.string,
windowId: W.default.string.isRequired
};
var Ka = n(w((e, { windowId: t }) => ({
canvasGroupings: Ke(e, { windowId: t }),
canvasIndex: me(e, { windowId: t }),
hasNextCanvas: !!Ze(e, { windowId: t }),
hasPreviousCanvas: !!ut(e, { windowId: t }),
position: se(e, { companionWindowId: s(e, { windowId: t }).thumbnailNavigationId }).position,
thumbnailNavigation: et(e).thumbnailNavigation,
view: we(e, { windowId: t }),
viewingDirection: ue(e, { windowId: t })
}), (e, { windowId: t }) => ({
setNextCanvas: (...n) => e(nn(t)),
setPreviousCanvas: (...n) => e(en(t))
})), m("ThumbnailNavigation"))(Ga), qa = M(/*#__PURE__*/ z("path", { d: "M12 4C7 4 2.73 7.11 1 11.5 2.73 15.89 7 19 12 19s9.27-3.11 11-7.5C21.27 7.11 17 4 12 4m0 12.5c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3" }), "VisibilitySharp"), Ja = M(/*#__PURE__*/ z("path", { d: "M12 6.5c2.76 0 5 2.24 5 5 0 .51-.1 1-.24 1.46l3.06 3.06c1.39-1.23 2.49-2.77 3.18-4.53C21.27 7.11 17 4 12 4c-1.27 0-2.49.2-3.64.57l2.17 2.17c.47-.14.96-.24 1.47-.24M3.42 2.45 2.01 3.87l2.68 2.68C3.06 7.83 1.77 9.53 1 11.5 2.73 15.89 7 19 12 19c1.52 0 2.97-.3 4.31-.82l3.43 3.43 1.41-1.41zM12 16.5c-2.76 0-5-2.24-5-5 0-.77.18-1.5.49-2.14l1.57 1.57c-.03.18-.06.37-.06.57 0 1.66 1.34 3 3 3 .2 0 .38-.03.57-.07L14.14 16c-.65.32-1.37.5-2.14.5m2.97-5.33c-.15-1.4-1.25-2.49-2.64-2.64z" }), "VisibilityOffSharp");
//#endregion
//#region src/components/AnnotationSettings.jsx
function Ya({ displayAll: e, displayAllDisabled: t, toggleAnnotationDisplay: n }) {
let { t: r } = V();
return /* @__PURE__ */ z(fn, {
"aria-label": r(e ? "displayNoAnnotations" : "highlightAllAnnotations"),
onClick: n,
disabled: t,
size: "small",
children: z(e ? qa : Ja, {})
});
}
Ya.propTypes = {
displayAll: W.default.bool.isRequired,
displayAllDisabled: W.default.bool.isRequired,
toggleAnnotationDisplay: W.default.func.isRequired,
windowId: W.default.string.isRequired
};
var Xa = n(w((e, { windowId: t }) => ({
displayAll: s(e, { windowId: t }).highlightAllAnnotations,
displayAllDisabled: At(e, { windowId: t }).length < 1
}), (e, { windowId: t }) => ({ toggleAnnotationDisplay: () => {
e(Tt(t));
} })), m("AnnotationSettings"))(Ya);
//#endregion
//#region node_modules/dompurify/dist/purify.es.mjs
function Za(e, t) {
(t == null || t > e.length) && (t = e.length);
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
return r;
}
function Qa(e) {
if (Array.isArray(e)) return e;
}
function $a(e, t) {
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
if (n != null) {
var r, i, a, o, s = [], c = !0, l = !1;
try {
if (a = (n = n.call(e)).next, t !== 0) for (; !(c = (r = a.call(n)).done) && (s.push(r.value), s.length !== t); c = !0);
} catch (e) {
l = !0, i = e;
} finally {
try {
if (!c && n.return != null && (o = n.return(), Object(o) !== o)) return;
} finally {
if (l) throw i;
}
}
return s;
}
}
function eo() {
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function to(e, t) {
return Qa(e) || $a(e, t) || no(e, t) || eo();
}
function no(e, t) {
if (e) {
if (typeof e == "string") return Za(e, t);
var n = {}.toString.call(e).slice(8, -1);
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? Za(e, t) : void 0;
}
}
var ro = Object.entries, io = Object.setPrototypeOf, ao = Object.isFrozen, oo = Object.getPrototypeOf, so = Object.getOwnPropertyDescriptor, co = Object.freeze, lo = Object.seal, uo = Object.create, fo = typeof Reflect < "u" && Reflect, po = fo.apply, mo = fo.construct;
co ||= function(e) {
return e;
}, lo ||= function(e) {
return e;
}, po ||= function(e, t) {
var n = [...arguments].slice(2);
return e.apply(t, n);
}, mo ||= function(e) {
return new e(...[...arguments].slice(1));
};
var ho = Fo(Array.prototype.forEach), go = Fo(Array.prototype.lastIndexOf), _o = Fo(Array.prototype.pop), vo = Fo(Array.prototype.push), yo = Fo(Array.prototype.splice), bo = Array.isArray, xo = Fo(String.prototype.toLowerCase), So = Fo(String.prototype.toString), Co = Fo(String.prototype.match), wo = Fo(String.prototype.replace), To = Fo(String.prototype.indexOf), Eo = Fo(String.prototype.trim), Do = Fo(Number.prototype.toString), Oo = Fo(Boolean.prototype.toString), ko = typeof BigInt > "u" ? null : Fo(BigInt.prototype.toString), Ao = typeof Symbol > "u" ? null : Fo(Symbol.prototype.toString), jo = Fo(Object.prototype.hasOwnProperty), Mo = Fo(Object.prototype.toString), No = Fo(RegExp.prototype.test), Po = Io(TypeError);
function Fo(e) {
return function(t) {
t instanceof RegExp && (t.lastIndex = 0);
var n = [...arguments].slice(1);
return po(e, t, n);
};
}
function Io(e) {
return function() {
return mo(e, [...arguments]);
};
}
function K(e, t) {
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : xo;
if (io && io(e, null), !bo(t)) return e;
let r = t.length;
for (; r--;) {
let i = t[r];
if (typeof i == "string") {
let e = n(i);
e !== i && (ao(t) || (t[r] = e), i = e);
}
e[i] = !0;
}
return e;
}
function Lo(e) {
for (let t = 0; t < e.length; t++) jo(e, t) || (e[t] = null);
return e;
}
function Ro(e) {
let t = uo(null);
for (let r of ro(e)) {
var n = to(r, 2);
let i = n[0], a = n[1];
jo(e, i) && (t[i] = bo(a) ? Lo(a) : a && typeof a == "object" && a.constructor === Object ? Ro(a) : a);
}
return t;
}
function zo(e) {
switch (typeof e) {
case "string": return e;
case "number": return Do(e);
case "boolean": return Oo(e);
case "bigint": return ko ? ko(e) : "0";
case "symbol": return Ao ? Ao(e) : "Symbol()";
case "undefined": return Mo(e);
case "function":
case "object": {
if (e === null) return Mo(e);
let t = e, n = Bo(t, "toString");
if (typeof n == "function") {
let e = n(t);
return typeof e == "string" ? e : Mo(e);
}
return Mo(e);
}
default: return Mo(e);
}
}
function Bo(e, t) {
for (; e !== null;) {
let n = so(e, t);
if (n) {
if (n.get) return Fo(n.get);
if (typeof n.value == "function") return Fo(n.value);
}
e = oo(e);
}
function n() {
return null;
}
return n;
}
function Vo(e) {
try {
return No(e, ""), !0;
} catch {
return !1;
}
}
var Ho = co(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Uo = co(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Wo = co([
"feBlend",
"feColorMatrix",
"feComponentTransfer",
"feComposite",
"feConvolveMatrix",
"feDiffuseLighting",
"feDisplacementMap",
"feDistantLight",
"feDropShadow",
"feFlood",
"feFuncA",
"feFuncB",
"feFuncG",
"feFuncR",
"feGaussianBlur",
"feImage",
"feMerge",
"feMergeNode",
"feMorphology",
"feOffset",
"fePointLight",
"feSpecularLighting",
"feSpotLight",
"feTile",
"feTurbulence"
]), Go = co([
"animate",
"color-profile",
"cursor",
"discard",
"font-face",
"font-face-format",
"font-face-name",
"font-face-src",
"font-face-uri",
"foreignobject",
"hatch",
"hatchpath",
"mesh",
"meshgradient",
"meshpatch",
"meshrow",
"missing-glyph",
"script",
"set",
"solidcolor",
"unknown",
"use"
]), Ko = co(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), qo = co([
"maction",
"maligngroup",
"malignmark",
"mlongdiv",
"mscarries",
"mscarry",
"msgroup",
"mstack",
"msline",
"msrow",
"semantics",
"annotation",
"annotation-xml",
"mprescripts",
"none"
]), Jo = co(["#text"]), Yo = co(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), Xo = co(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), Zo = co(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), Qo = co([
"xlink:href",
"xml:id",
"xlink:title",
"xml:space",
"xmlns:xlink"
]), $o = lo(/{{[\w\W]*|^[\w\W]*}}/g), es = lo(/<%[\w\W]*|^[\w\W]*%>/g), ts = lo(/\${[\w\W]*/g), ns = lo(/^data-[\-\w.\u00B7-\uFFFF]+$/), rs = lo(/^aria-[\-\w]+$/), is = lo(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), as = lo(/^(?:\w+script|data):/i), os = lo(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), ss = lo(/^html$/i), cs = lo(/^[a-z][.\w]*(-[.\w]+)+$/i), ls = lo(/<[/\w!]/g), us = lo(/<[/\w]/g), ds = lo(/<\/no(script|embed|frames)/i), fs = lo(/\/>/i), ps = {
element: 1,
attribute: 2,
text: 3,
cdataSection: 4,
entityReference: 5,
entityNode: 6,
processingInstruction: 7,
comment: 8,
document: 9,
documentType: 10,
documentFragment: 11,
notation: 12
}, ms = function() {
return typeof window > "u" ? null : window;
}, hs = function(e, t) {
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
let n = null, r = "data-tt-policy-suffix";
t && t.hasAttribute(r) && (n = t.getAttribute(r));
let i = "dompurify" + (n ? "#" + n : "");
try {
return e.createPolicy(i, {
createHTML(e) {
return e;
},
createScriptURL(e) {
return e;
}
});
} catch {
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
}
}, gs = function() {
return {
afterSanitizeAttributes: [],
afterSanitizeElements: [],
afterSanitizeShadowDOM: [],
beforeSanitizeAttributes: [],
beforeSanitizeElements: [],
beforeSanitizeShadowDOM: [],
uponSanitizeAttribute: [],
uponSanitizeElement: [],
uponSanitizeShadowNode: []
};
}, _s = function(e, t, n, r) {
return jo(e, t) && bo(e[t]) ? K(r.base ? Ro(r.base) : {}, e[t], r.transform) : n;
};
function vs() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ms(), t = (e) => vs(e);
if (t.version = "3.4.13", t.removed = [], !e || !e.document || e.document.nodeType !== ps.document || !e.Element) return t.isSupported = !1, t;
let n = e.document, r = n, i = r.currentScript;
e.DocumentFragment;
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Bo(d, "cloneNode"), p = Bo(d, "remove"), m = Bo(d, "nextSibling"), h = Bo(d, "childNodes"), g = Bo(d, "parentNode"), _ = Bo(d, "shadowRoot"), v = Bo(d, "attributes"), y = o && o.prototype ? Bo(o.prototype, "nodeType") : null, b = o && o.prototype ? Bo(o.prototype, "nodeName") : null, x = o && o.prototype ? Bo(o.prototype, "ownerDocument") : null;
if (typeof a == "function") {
let e = n.createElement("template");
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
}
let S, C = "", w, T = !1, E = 0, D = function() {
if (E > 0) throw Po("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
}, ee = function(e) {
D(), E++;
try {
return S.createHTML(e);
} finally {
E--;
}
}, te = function(e) {
D(), E++;
try {
return S.createScriptURL(e);
} finally {
E--;
}
}, ne = function() {
return T ||= (w = hs(u, i), !0), w;
}, re = n, ie = re.implementation, ae = re.createNodeIterator, oe = re.createDocumentFragment, se = re.getElementsByTagName, ce = r.importNode, O = gs();
t.isSupported = typeof ro == "function" && typeof g == "function" && ie && ie.createHTMLDocument !== void 0;
let le = $o, ue = es, de = ts, fe = ns, pe = rs, me = as, he = os, ge = cs, _e = is, ve = null, ye = K({}, [
...Ho,
...Uo,
...Wo,
...Ko,
...Jo
]), k = null, be = K({}, [
...Yo,
...Xo,
...Zo,
...Qo
]), xe = Object.seal(uo(null, {
tagNameCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
},
attributeNameCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
},
allowCustomizedBuiltInElements: {
writable: !0,
configurable: !1,
enumerable: !0,
value: !1
}
})), Se = null, Ce = null, we = Object.seal(uo(null, {
tagCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
},
attributeCheck: {
writable: !0,
configurable: !1,
enumerable: !0,
value: null
}
})), Te = !0, Ee = !0, De = !1, Oe = !0, ke = !1, Ae = !0, je = !1, Me = !1, Ne = null, Pe = null, Fe = !1, Ie = !1, Le = !1, Re = !1, ze = !0, Be = !1, Ve = "user-content-", He = !0, Ue = !1, We = {}, Ge = null, Ke = K({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), qe = null, Je = K({}, [
"audio",
"video",
"img",
"source",
"image",
"track"
]), Ye = null, Xe = K({}, [
"alt",
"class",
"for",
"id",
"label",
"name",
"pattern",
"placeholder",
"role",
"summary",
"title",
"value",
"style",
"xmlns"
]), Ze = "http://www.w3.org/1998/Math/MathML", Qe = "http://www.w3.org/2000/svg", $e = "http://www.w3.org/1999/xhtml", et = $e, tt = !1, nt = null, rt = K({}, [
Ze,
Qe,
$e
], So), it = co([
"mi",
"mo",
"mn",
"ms",
"mtext"
]), at = K({}, it), ot = co(["annotation-xml"]), st = K({}, ot), ct = K({}, [
"title",
"style",
"font",
"a",
"script"
]), lt = null, ut = ["application/xhtml+xml", "text/html"], dt = null, ft = null, pt = n.createElement("form"), mt = function(e) {
return e instanceof RegExp || e instanceof Function;
}, ht = function() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (ft && ft === e) return;
(!e || typeof e != "object") && (e = {}), e = Ro(e), lt = ut.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, dt = lt === "application/xhtml+xml" ? So : xo, ve = _s(e, "ALLOWED_TAGS", ye, { transform: dt }), k = _s(e, "ALLOWED_ATTR", be, { transform: dt }), nt = _s(e, "ALLOWED_NAMESPACES", rt, { transform: So }), Ye = _s(e, "ADD_URI_SAFE_ATTR", Xe, {
transform: dt,
base: Xe
}), qe = _s(e, "ADD_DATA_URI_TAGS", Je, {
transform: dt,
base: Je
}), Ge = _s(e, "FORBID_CONTENTS", Ke, { transform: dt }), Se = _s(e, "FORBID_TAGS", Ro({}), { transform: dt }), Ce = _s(e, "FORBID_ATTR", Ro({}), { transform: dt }), We = jo(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Ro(e.USE_PROFILES) : e.USE_PROFILES : !1, Te = e.ALLOW_ARIA_ATTR !== !1, Ee = e.ALLOW_DATA_ATTR !== !1, De = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Oe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ke = e.SAFE_FOR_TEMPLATES || !1, Ae = e.SAFE_FOR_XML !== !1, je = e.WHOLE_DOCUMENT || !1, Ie = e.RETURN_DOM || !1, Le = e.RETURN_DOM_FRAGMENT || !1, Re = e.RETURN_TRUSTED_TYPE || !1, Fe = e.FORCE_BODY || !1, ze = e.SANITIZE_DOM !== !1, Be = e.SANITIZE_NAMED_PROPS || !1, He = e.KEEP_CONTENT !== !1, Ue = e.IN_PLACE || !1, _e = Vo(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : is, et = typeof e.NAMESPACE == "string" ? e.NAMESPACE : $e, at = jo(e, "MATHML_TEXT_INTEGRATION_POINTS") && e.MATHML_TEXT_INTEGRATION_POINTS && typeof e.MATHML_TEXT_INTEGRATION_POINTS == "object" ? Ro(e.MATHML_TEXT_INTEGRATION_POINTS) : K({}, it), st = jo(e, "HTML_INTEGRATION_POINTS") && e.HTML_INTEGRATION_POINTS && typeof e.HTML_INTEGRATION_POINTS == "object" ? Ro(e.HTML_INTEGRATION_POINTS) : K({}, ot);
let t = jo(e, "CUSTOM_ELEMENT_HANDLING") && e.CUSTOM_ELEMENT_HANDLING && typeof e.CUSTOM_ELEMENT_HANDLING == "object" ? Ro(e.CUSTOM_ELEMENT_HANDLING) : uo(null);
if (xe = uo(null), jo(t, "tagNameCheck") && mt(t.tagNameCheck) && (xe.tagNameCheck = t.tagNameCheck), jo(t, "attributeNameCheck") && mt(t.attributeNameCheck) && (xe.attributeNameCheck = t.attributeNameCheck), jo(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (xe.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), lo(xe), ke && (Ee = !1), Le && (Ie = !0), We && (ve = K({}, Jo), k = uo(null), We.html === !0 && (K(ve, Ho), K(k, Yo)), We.svg === !0 && (K(ve, Uo), K(k, Xo), K(k, Qo)), We.svgFilters === !0 && (K(ve, Wo), K(k, Xo), K(k, Qo)), We.mathMl === !0 && (K(ve, Ko), K(k, Zo), K(k, Qo))), we.tagCheck = null, we.attributeCheck = null, jo(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? we.tagCheck = e.ADD_TAGS : bo(e.ADD_TAGS) && (ve === ye && (ve = Ro(ve)), K(ve, e.ADD_TAGS, dt))), jo(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? we.attributeCheck = e.ADD_ATTR : bo(e.ADD_ATTR) && (k === be && (k = Ro(k)), K(k, e.ADD_ATTR, dt))), jo(e, "ADD_URI_SAFE_ATTR") && bo(e.ADD_URI_SAFE_ATTR) && K(Ye, e.ADD_URI_SAFE_ATTR, dt), jo(e, "FORBID_CONTENTS") && bo(e.FORBID_CONTENTS) && (Ge === Ke && (Ge = Ro(Ge)), K(Ge, e.FORBID_CONTENTS, dt)), jo(e, "ADD_FORBID_CONTENTS") && bo(e.ADD_FORBID_CONTENTS) && (Ge === Ke && (Ge = Ro(Ge)), K(Ge, e.ADD_FORBID_CONTENTS, dt)), He && (ve["#text"] = !0), je && K(ve, [
"html",
"head",
"body"
]), ve.table && (K(ve, ["tbody"]), delete Se.tbody), e.TRUSTED_TYPES_POLICY) {
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Po("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Po("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
let t = S;
S = e.TRUSTED_TYPES_POLICY;
try {
C = ee("");
} catch (e) {
throw S = t, e;
}
} else e.TRUSTED_TYPES_POLICY === null ? (S = void 0, C = "") : (S === void 0 && (S = ne()), S && typeof C == "string" && (C = ee("")));
co && co(e), ft = e;
}, gt = K({}, [
...Uo,
...Wo,
...Go
]), A = K({}, [...Ko, ...qo]), _t = function(e, t, n) {
return t.namespaceURI === $e ? e === "svg" : t.namespaceURI === Ze ? e === "svg" && (n === "annotation-xml" || at[n]) : !!gt[e];
}, vt = function(e, t, n) {
return t.namespaceURI === $e ? e === "math" : t.namespaceURI === Qe ? e === "math" && st[n] : !!A[e];
}, yt = function(e, t, n) {
return t.namespaceURI === Qe && !st[n] || t.namespaceURI === Ze && !at[n] ? !1 : !A[e] && (ct[e] || !gt[e]);
}, bt = function(e) {
let t = g(e);
(!t || !t.tagName) && (t = {
namespaceURI: et,
tagName: "template"
});
let n = xo(e.tagName), r = xo(t.tagName);
return nt[e.namespaceURI] ? e.namespaceURI === Qe ? _t(n, t, r) : e.namespaceURI === Ze ? vt(n, t, r) : e.namespaceURI === $e ? yt(n, t, r) : !!(lt === "application/xhtml+xml" && nt[e.namespaceURI]) : !1;
}, xt = function(e) {
vo(t.removed, { element: e });
try {
g(e).removeChild(e);
} catch {
if (p(e), !g(e)) throw Po("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
}
}, St = function(e) {
Tt(e);
let t = h(e);
if (t) {
let e = [];
ho(t, (t) => {
vo(e, t);
}), ho(e, (e) => {
try {
p(e);
} catch {}
});
}
let n = v(e);
if (n) for (let t = n.length - 1; t >= 0; --t) {
let r = n[t], i = r && r.name;
if (typeof i == "string") try {
e.removeAttribute(i);
} catch {}
}
}, Ct = function(e, n) {
try {
vo(t.removed, {
attribute: n.getAttributeNode(e),
from: n
});
} catch {
vo(t.removed, {
attribute: null,
from: n
});
}
if (n.removeAttribute(e), e === "is") {
if (Ie || Le) try {
xt(n);
} catch {}
else try {
n.setAttribute(e, "");
} catch {}
}
}, wt = function(e) {
let t = v(e);
if (t) for (let n = t.length - 1; n >= 0; --n) {
let r = t[n], i = r && r.name;
if (!(typeof i != "string" || k[dt(i)])) try {
e.removeAttribute(i);
} catch {}
}
}, Tt = function(e) {
let t = [e];
for (; t.length > 0;) {
let e = t.pop();
(y ? y(e) : e.nodeType) === ps.element && wt(e);
let n = h(e);
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
}
}, Et = function(e) {
if (!Ae) return;
let t = [e];
for (; t.length > 0;) {
let e = t.pop(), n = y ? y(e) : e.nodeType;
if (n === ps.processingInstruction || n === ps.comment && No(us, e.data)) {
try {
p(e);
} catch {}
continue;
}
if (n === ps.element) {
let t = e, n = dt(b ? b(e) : e.nodeName);
try {
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && n !== "label" && n !== "output" && t.removeAttribute("for");
} catch {}
}
let r = h(e);
if (r) for (let e = r.length - 1; e >= 0; --e) t.push(r[e]);
}
}, Dt = function(e) {
let t = null, r = null;
if (Fe) e = "<remove></remove>" + e;
else {
let t = Co(e, /^[\r\n\t ]+/);
r = t && t[0];
}
lt === "application/xhtml+xml" && et === $e && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
let i = S ? ee(e) : e;
if (et === $e) try {
t = new l().parseFromString(i, lt);
} catch {}
if (!t || !t.documentElement) {
t = ie.createDocument(et, "template", null);
try {
t.documentElement.innerHTML = tt ? C : i;
} catch {}
}
let a = t.body || t.documentElement;
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), et === $e ? se.call(t, je ? "html" : "body")[0] : je ? t.documentElement : a;
}, Ot = function(e) {
let t = x ? x(e) : e.ownerDocument;
return ae.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
}, kt = function(e) {
return e = wo(e, le, " "), e = wo(e, ue, " "), e = wo(e, de, " "), e;
}, At = function(e) {
e.normalize();
let t = x ? x(e) : e.ownerDocument, n = ae.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
for (; r;) r.data = kt(r.data), r = n.nextNode();
let i = e.querySelectorAll?.call(e, "template");
i && ho(i, (e) => {
Mt(e.content) && At(e.content);
});
}, jt = function(e) {
let t = b ? b(e) : null;
return typeof t != "string" || dt(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== v(e) || typeof e.removeAttribute != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== y(e) || e.childNodes !== h(e);
}, Mt = function(e) {
if (!y || typeof e != "object" || !e) return !1;
try {
return y(e) === ps.documentFragment;
} catch {
return !1;
}
}, Nt = function(e) {
if (!y || typeof e != "object" || !e) return !1;
try {
return typeof y(e) == "number";
} catch {
return !1;
}
};
function Pt(e, n, r) {
e.length !== 0 && ho(e, (e) => {
e.call(t, n, r, ft);
});
}
let Ft = function(e, t) {
return !!(Ae && e.hasChildNodes() && !Nt(e.firstElementChild) && No(ls, e.textContent) && No(ls, e.innerHTML) || Ae && e.namespaceURI === $e && t === "style" && Nt(e.firstElementChild) || e.nodeType === ps.processingInstruction || Ae && e.nodeType === ps.comment && No(us, e.data));
}, It = function(e, t, n) {
if (!Se[t] && Vt(t) && (xe.tagNameCheck instanceof RegExp && No(xe.tagNameCheck, t) || xe.tagNameCheck instanceof Function && xe.tagNameCheck(t))) return !1;
if (He && !Ge[t]) {
let t = g(e), r = h(e);
if (r && t) {
let i = r.length;
for (let a = i - 1; a >= 0; --a) {
let i = e === n ? f(r[a], !0) : r[a];
t.insertBefore(i, m(e));
}
}
}
return xt(e), !0;
}, Lt = function(e, t, n, r) {
return e.length === 0 ? t : t === n || t === r ? Ro(t) : t;
}, Rt = function(e, n) {
if (Pt(O.beforeSanitizeElements, e, null), e !== n && g(e) === null) return Ue && Tt(e), !0;
if (jt(e)) return xt(e), !0;
let r = dt(b ? b(e) : e.nodeName);
if (ve = Lt(O.uponSanitizeElement, ve, ye, Ne), Pt(O.uponSanitizeElement, e, {
tagName: r,
allowedTags: ve
}), e !== n && g(e) === null) return Ue && Tt(e), !0;
if (Ft(e, r)) return xt(e), !0;
if (Se[r] || !(we.tagCheck instanceof Function && we.tagCheck(r)) && !ve[r]) {
let t = It(e, r, n);
return t === !1 && Pt(O.afterSanitizeElements, e, null), t;
}
if ((y ? y(e) : e.nodeType) === ps.element && !bt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && No(ds, e.innerHTML)) return xt(e), !0;
if (ke && e.nodeType === ps.text) {
let n = kt(e.textContent);
e.textContent !== n && (vo(t.removed, { element: e.cloneNode() }), e.textContent = n);
}
return Pt(O.afterSanitizeElements, e, null), !1;
}, zt = function(e, t, r) {
if (Ce[t] || Ae && t === "patchsrc" || Ae && t === "for" && e !== "label" && e !== "output" || ze && (t === "id" || t === "name") && (r in n || r in pt)) return !1;
let i = k[t] || we.attributeCheck instanceof Function && we.attributeCheck(t, e);
if (!(Ee && No(fe, t)) && !(Te && No(pe, t))) {
if (!i) {
if (!(Vt(e) && (xe.tagNameCheck instanceof RegExp && No(xe.tagNameCheck, e) || xe.tagNameCheck instanceof Function && xe.tagNameCheck(e)) && (xe.attributeNameCheck instanceof RegExp && No(xe.attributeNameCheck, t) || xe.attributeNameCheck instanceof Function && xe.attributeNameCheck(t, e)) || t === "is" && xe.allowCustomizedBuiltInElements && (xe.tagNameCheck instanceof RegExp && No(xe.tagNameCheck, r) || xe.tagNameCheck instanceof Function && xe.tagNameCheck(r)))) return !1;
} else if (!Ye[t] && !No(_e, wo(r, he, "")) && !((t === "src" || t === "xlink:href" || t === "href") && e !== "script" && To(r, "data:") === 0 && qe[e]) && !(De && !No(me, wo(r, he, ""))) && r) return !1;
}
return !0;
}, Bt = K({}, [
"annotation-xml",
"color-profile",
"font-face",
"font-face-format",
"font-face-name",
"font-face-src",
"font-face-uri",
"missing-glyph"
]), Vt = function(e) {
return !Bt[xo(e)] && No(ge, e);
}, Ht = function(e, t, n, r) {
if (S && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
case "TrustedHTML": return ee(r);
case "TrustedScriptURL": return te(r);
}
return r;
}, Ut = function(e, n, r, i) {
try {
r ? e.setAttributeNS(r, n, i) : e.setAttribute(n, i), jt(e) ? xt(e) : _o(t.removed);
} catch {
Ct(n, e);
}
}, Wt = function(e) {
Pt(O.beforeSanitizeAttributes, e, null);
let t = e.attributes;
if (!t || jt(e)) return;
k = Lt(O.uponSanitizeAttribute, k, be, Pe);
let n = {
attrName: "",
attrValue: "",
keepAttr: !0,
allowedAttributes: k,
forceKeepAttr: void 0
}, r = t.length, i = dt(e.nodeName);
for (; r--;) {
let a = t[r], o = a.name, s = a.namespaceURI, c = a.value, l = dt(o), u = c, d = o === "value" ? u : Eo(u);
if (n.attrName = l, n.attrValue = d, n.keepAttr = !0, n.forceKeepAttr = void 0, Pt(O.uponSanitizeAttribute, e, n), d = n.attrValue, Be && (l === "id" || l === "name") && To(d, Ve) !== 0 && (Ct(o, e), d = Ve + d), Ae && No(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, d)) {
Ct(o, e);
continue;
}
if (l === "attributename" && Co(d, "href")) {
Ct(o, e);
continue;
}
if (!n.forceKeepAttr) {
if (!n.keepAttr) {
Ct(o, e);
continue;
}
if (!Oe && No(fs, d)) {
Ct(o, e);
continue;
}
if (ke && (d = kt(d)), !zt(i, l, d)) {
Ct(o, e);
continue;
}
d = Ht(i, l, s, d), d !== u && Ut(e, o, s, d);
}
}
Pt(O.afterSanitizeAttributes, e, null);
}, Gt = function(e) {
let t = null, n = Ot(e);
for (Pt(O.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (Pt(O.uponSanitizeShadowNode, t, null), Rt(t, e), Wt(t), Mt(t.content) && Gt(t.content), (y ? y(t) : t.nodeType) === ps.element) {
let e = _(t);
Mt(e) && (Kt(e), Gt(e));
}
Pt(O.afterSanitizeShadowDOM, e, null);
}, Kt = function(e) {
let t = [{
node: e,
shadow: null
}];
for (; t.length > 0;) {
let e = t.pop();
if (e.shadow) {
Gt(e.shadow);
continue;
}
let n = e.node, r = (y ? y(n) : n.nodeType) === ps.element, i = h(n);
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
node: i[e],
shadow: null
});
if (r) {
let e = b ? b(n) : null;
if (typeof e == "string" && dt(e) === "template") {
let e = n.content;
Mt(e) && t.push({
node: e,
shadow: null
});
}
}
if (r) {
let e = _(n);
Mt(e) && t.push({
node: null,
shadow: e
}, {
node: e,
shadow: null
});
}
}
};
return t.sanitize = function(e) {
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
if (tt = !e, tt && (e = "<!-->"), typeof e != "string" && !Nt(e) && (e = zo(e), typeof e != "string")) throw Po("dirty is not a string, aborting");
if (!t.isSupported) return e;
Me ? (ve = Ne, k = Pe) : ht(n), (O.uponSanitizeElement.length > 0 || O.uponSanitizeAttribute.length > 0) && (ve = Ro(ve)), O.uponSanitizeAttribute.length > 0 && (k = Ro(k)), t.removed = [];
let c = Ue && typeof e != "string" && Nt(e);
if (c) {
Et(e);
let t = b ? b(e) : e.nodeName;
if (typeof t == "string") {
let n = dt(t);
if (!ve[n] || Se[n]) throw St(e), Po("root node is forbidden and cannot be sanitized in-place");
}
if (jt(e)) throw St(e), Po("root node is clobbered and cannot be sanitized in-place");
try {
Kt(e);
} catch (t) {
throw St(e), t;
}
} else if (Nt(e)) i = Dt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === ps.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), Kt(a);
else {
if (!Ie && !ke && !je && e.indexOf("<") === -1) return S && Re ? ee(e) : e;
if (i = Dt(e), !i) return Ie ? null : Re ? C : "";
}
i && Fe && xt(i.firstChild);
let l = c ? e : i;
try {
let e = Ot(l);
for (; o = e.nextNode();) Rt(o, l), Wt(o), Mt(o.content) && Gt(o.content);
} catch (n) {
throw c && (St(e), ho(t.removed, (e) => {
e.element && Tt(e.element);
})), n;
}
if (c) return ho(t.removed, (e) => {
e.element && Tt(e.element);
}), ke && At(e), e;
if (Ie) {
if (ke && At(i), Le) for (s = oe.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
else s = i;
return (k.shadowroot || k.shadowrootmode) && (s = ce.call(r, s, !0)), s;
}
let u = je ? i.outerHTML : i.innerHTML;
return je && ve["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && No(ss, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), ke && (u = kt(u)), S && Re ? ee(u) : u;
}, t.setConfig = function() {
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
ht(e), Me = !0, Ne = ve, Pe = k;
}, t.clearConfig = function() {
ft = null, Me = !1, Ne = null, Pe = null, S = w, C = "";
}, t.isValidAttribute = function(e, t, n) {
ft || ht({});
let r = dt(e), i = dt(t);
return zt(r, i, n);
}, t.addHook = function(e, t) {
typeof t == "function" && jo(O, e) && vo(O[e], t);
}, t.removeHook = function(e, t) {
if (jo(O, e)) {
if (t !== void 0) {
let n = go(O[e], t);
return n === -1 ? void 0 : yo(O[e], n, 1)[0];
}
return _o(O[e]);
}
}, t.removeHooks = function(e) {
jo(O, e) && (O[e] = []);
}, t.removeAllHooks = function() {
O = gs();
}, t;
}
var ys = vs(), bs = {
iiif: {
ALLOWED_ATTR: [
"href",
"src",
"alt"
],
ALLOWED_TAGS: [
"a",
"b",
"br",
"i",
"img",
"p",
"span"
]
},
liberal: {},
mirador2: {
ALLOWED_ATTR: [
"href",
"target",
"src",
"alt",
"dir"
],
ALLOWED_TAGS: [
"a",
"b",
"br",
"i",
"img",
"p",
"span",
"strong",
"em",
"ul",
"ol",
"li"
]
},
noHtml: { ALLOWED_TAGS: [] }
}, xs = H("span", {
name: "IIIFHtmlContent",
slot: "root"
})({});
ys.addHook("afterSanitizeAttributes", (e) => {
"target" in e && (e.setAttribute("target", "_blank"), e.setAttribute("rel", "noopener noreferrer"));
});
function Ss({ classes: e = {}, htmlString: t, ruleSet: n, ...r }) {
return /* @__PURE__ */ z(xs, {
className: [j("third-party-html"), e.root].join(" "),
dangerouslySetInnerHTML: { __html: ys.sanitize(t, bs[n]) },
...r
});
}
Ss.propTypes = {
classes: W.default.objectOf(W.default.string),
htmlString: W.default.string.isRequired,
ruleSet: W.default.string.isRequired
};
//#endregion
//#region src/containers/SanitizedHtml.js
var Cs = Ss, ws = /* @__PURE__ */ p(o(), 1);
function Ts(e) {
let t = I();
return F(() => {
t.current = e;
}, [e]), t.current;
}
function Es({ children: e, containerRef: t, offsetTop: n = 0, scrollTo: r, ...i }) {
let a = I(), o = Ts(r);
return F(() => {
if (!r || r === o) return;
let e = a?.current;
if (!e) return;
let i = t?.current?.querySelector(`.${j("scrollto-scrollable")}`);
if (!i) return;
let s = t?.current?.getBoundingClientRect() || {}, c = e?.getBoundingClientRect() || {};
if (!(c.top < s.top + n || c.bottom > s.bottom)) return;
let l = e.offsetTop - s.height / 2 + n;
i.scrollTo(0, l);
}, [
t,
a,
r,
o,
n
]), !r && (0, ws.default)(i) ? e : xn(e, {
ref: a,
...i
});
}
Es.propTypes = {
children: W.default.node.isRequired,
containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]).isRequired,
offsetTop: W.default.number,
scrollTo: W.default.bool.isRequired
};
//#endregion
//#region src/components/CanvasAnnotations.jsx
function Ds({ annotations: e = [], index: t, label: n, selectedAnnotationId: r = void 0, totalSize: i, listContainerComponent: a = "li", htmlSanitizationRuleSet: o = "iiif", hoveredAnnotationIds: s = [], containerRef: c = void 0, deselectAnnotation: l, selectAnnotation: u, windowId: d, hoverAnnotation: f }) {
let { t: p } = V(), m = kn((e, t) => {
window.getSelection()?.toString() || (r === t.id ? l(d, t.id) : u(d, t.id));
}, [
d,
l,
u,
r
]), h = kn((e) => {
f(d, [e.id]);
}, [f, d]), g = kn(() => {
f(d, []);
}, [f, d]);
return e.length === 0 ? null : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
sx: {
paddingLeft: 2,
paddingRight: 1,
paddingTop: 2
},
variant: "overline",
children: p("annotationCanvasLabel", {
context: `${t + 1}/${i}`,
label: n
})
}), /* @__PURE__ */ z(qn, {
autoFocusItem: !0,
variant: "selectedMenu",
children: e.map((e) => /* @__PURE__ */ z(Es, {
containerRef: c,
offsetTop: 96,
scrollTo: r === e.id,
selected: r === e.id,
children: /* @__PURE__ */ z(Jn, {
component: a,
variant: "multiline",
divider: !0,
sx: {
"&:hover,&:focus": { backgroundColor: "action.hover" },
backgroundColor: s.includes(e.id) ? "action.hover" : "",
userSelect: "text"
},
annotationid: e.id,
onClick: (t) => m(t, e),
onFocus: () => h(e),
onBlur: g,
onMouseEnter: () => h(e),
onMouseLeave: g,
children: /* @__PURE__ */ z(Yn, {
primary: /* @__PURE__ */ z(Cs, {
ruleSet: o,
htmlString: e.content
}),
secondary: e.tags.map((e) => /* @__PURE__ */ z(Kn, {
component: "span",
size: "small",
variant: "outlined",
label: e,
id: e
}, e?.toString())),
slotProps: { primary: { variant: "body2" } }
})
}, e.id)
}, `${e.id}-scroll`))
})] });
}
Ds.propTypes = {
annotations: W.default.arrayOf(W.default.shape({
content: W.default.string.isRequired,
id: W.default.string.isRequired
})),
containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]),
deselectAnnotation: W.default.func.isRequired,
hoverAnnotation: W.default.func.isRequired,
hoveredAnnotationIds: W.default.arrayOf(W.default.string),
htmlSanitizationRuleSet: W.default.string,
index: W.default.number.isRequired,
label: W.default.string.isRequired,
listContainerComponent: W.default.elementType,
selectAnnotation: W.default.func.isRequired,
selectedAnnotationId: W.default.string,
totalSize: W.default.number.isRequired,
windowId: W.default.string.isRequired
};
var Os = n(w((e, { canvasId: t, windowId: n }) => ({
annotations: _t(e, {
canvasId: t,
windowId: n
}),
htmlSanitizationRuleSet: et(e).annotations.htmlSanitizationRuleSet,
label: Fe(e, {
canvasId: t,
windowId: n
}),
selectedAnnotationId: wt(e, { windowId: n })
}), {
deselectAnnotation: Et,
hoverAnnotation: Ot,
selectAnnotation: xt
}), m("CanvasAnnotations"))(Ds), ks = M(/*#__PURE__*/ z("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "CloseSharp"), As = M(/*#__PURE__*/ z("path", { d: "M19 19H5V5h7V3H3v18h18v-9h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z" }), "OpenInNewSharp"), js = M(/*#__PURE__*/ z("path", { d: "M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "DragIndicatorSharp");
//#endregion
//#region node_modules/clsx/dist/clsx.mjs
function Ms(e) {
var t, n, r = "";
if (typeof e == "string" || typeof e == "number") r += e;
else if (typeof e == "object") {
if (Array.isArray(e)) {
var i = e.length;
for (t = 0; t < i; t++) e[t] && (n = Ms(e[t])) && (r && (r += " "), r += n);
} else for (n in e) e[n] && (r && (r += " "), r += n);
}
return r;
}
function Ns() {
for (var e, t, n = 0, r = "", i = arguments.length; n < i; n++) (e = arguments[n]) && (t = Ms(e)) && (r && (r += " "), r += t);
return r;
}
//#endregion
//#region node_modules/react-draggable/build/cjs/chunk-RXGSR3JC.mjs
function Ps(e, t) {
for (let n = 0, r = e.length; n < r; n++) if (t.apply(t, [
e[n],
n,
e
])) return e[n];
}
function Fs(e) {
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
}
function Is(e) {
return typeof e == "number" && !isNaN(e);
}
function Ls(e) {
return parseInt(e, 10);
}
function Rs(e, t, n) {
if (e[t]) return /* @__PURE__ */ Error(`Invalid prop ${t} passed to ${n} - do not set this, set it on the child.`);
}
var zs = [
"Moz",
"Webkit",
"O",
"ms"
];
function Bs(e = "transform") {
if (typeof window > "u") return "";
let t = window.document?.documentElement?.style;
if (!t || e in t) return "";
for (let n = 0; n < zs.length; n++) if (Vs(e, zs[n]) in t) return zs[n];
return "";
}
function Vs(e, t) {
return t ? `${t}${Hs(e)}` : e;
}
function Hs(e) {
let t = "", n = !0;
for (let r = 0; r < e.length; r++) n ? (t += e[r].toUpperCase(), n = !1) : e[r] === "-" ? n = !0 : t += e[r];
return t;
}
var Us = Bs(), Ws = "";
function Gs(e, t) {
Ws ||= Ps([
"matches",
"webkitMatchesSelector",
"mozMatchesSelector",
"msMatchesSelector",
"oMatchesSelector"
], function(t) {
return Fs(e[t]);
}) ?? "";
let n = e[Ws];
return Fs(n) ? !!n.call(e, t) : !1;
}
function Ks(e, t, n) {
let r = e;
do {
if (Gs(r, t)) return !0;
if (r === n) return !1;
r = r.parentNode;
} while (r);
return !1;
}
function qs(e, t, n, r) {
if (!e) return;
let i = {
capture: !0,
...r
}, a = n;
e.addEventListener ? e.addEventListener(t, a, i) : e.attachEvent ? e.attachEvent("on" + t, a) : e["on" + t] = a;
}
function Js(e, t, n, r) {
if (!e) return;
let i = {
capture: !0,
...r
}, a = n;
e.removeEventListener ? e.removeEventListener(t, a, i) : e.detachEvent ? e.detachEvent("on" + t, a) : e["on" + t] = null;
}
function Ys(e) {
let t = e.clientHeight, n = e.ownerDocument.defaultView.getComputedStyle(e);
return t += Ls(n.borderTopWidth), t += Ls(n.borderBottomWidth), t;
}
function Xs(e) {
let t = e.clientWidth, n = e.ownerDocument.defaultView.getComputedStyle(e);
return t += Ls(n.borderLeftWidth), t += Ls(n.borderRightWidth), t;
}
function Zs(e) {
let t = e.clientHeight, n = e.ownerDocument.defaultView.getComputedStyle(e);
return t -= Ls(n.paddingTop), t -= Ls(n.paddingBottom), t;
}
function Qs(e) {
let t = e.clientWidth, n = e.ownerDocument.defaultView.getComputedStyle(e);
return t -= Ls(n.paddingLeft), t -= Ls(n.paddingRight), t;
}
function $s(e, t, n) {
let r = t === t.ownerDocument.body ? {
left: 0,
top: 0
} : t.getBoundingClientRect();
return {
x: (e.clientX + t.scrollLeft - r.left) / n,
y: (e.clientY + t.scrollTop - r.top) / n
};
}
function ec(e, t) {
let n = nc(e, t, "px");
return { [Vs("transform", Us)]: n };
}
function tc(e, t) {
return nc(e, t, "");
}
function nc({ x: e, y: t }, n, r) {
let i = `translate(${e}${r},${t}${r})`;
return n && (i = `translate(${`${typeof n.x == "string" ? n.x : n.x + r}`}, ${`${typeof n.y == "string" ? n.y : n.y + r}`})` + i), i;
}
function rc(e, t) {
return e.targetTouches && Ps(e.targetTouches, (e) => t === e.identifier) || e.changedTouches && Ps(e.changedTouches, (e) => t === e.identifier);
}
function ic(e) {
if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier;
if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier;
}
function ac() {
return typeof __webpack_nonce__ < "u" ? __webpack_nonce__ : void 0;
}
function oc(e, t) {
if (!e) return;
let n = e.getElementById("react-draggable-style-el");
if (!n) {
n = e.createElement("style"), n.type = "text/css", n.id = "react-draggable-style-el";
let r = t ?? ac();
r && n.setAttribute("nonce", r), n.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n", n.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n", e.getElementsByTagName("head")[0].appendChild(n);
}
e.body && lc(e.body, "react-draggable-transparent-selection");
}
function sc(e) {
window.requestAnimationFrame ? window.requestAnimationFrame(() => {
cc(e);
}) : cc(e);
}
function cc(e) {
if (e) try {
e.body && uc(e.body, "react-draggable-transparent-selection");
let t = e.selection;
if (t) t.empty();
else {
let t = (e.defaultView || window).getSelection();
t && t.type !== "Caret" && t.removeAllRanges();
}
} catch {}
}
function lc(e, t) {
e.classList ? e.classList.add(t) : e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`)) || (e.className += ` ${t}`);
}
function uc(e, t) {
e.classList ? e.classList.remove(t) : e.className = e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`, "g"), "");
}
function dc(e, t, n) {
if (!e.props.bounds) return [t, n];
let { bounds: r } = e.props;
r = typeof r == "string" ? r : vc(r);
let i = yc(e);
if (typeof r == "string") {
let { ownerDocument: e } = i, t = e.defaultView;
if (!t) throw Error("Cannot resolve the owner window of the draggable node.");
let n;
if (n = r === "parent" ? i.parentNode : i.getRootNode().querySelector(r), !(n instanceof t.HTMLElement)) throw Error("Bounds selector \"" + r + "\" could not find an element.");
let a = n, o = t.getComputedStyle(i), s = t.getComputedStyle(a);
r = {
left: -i.offsetLeft + Ls(s.paddingLeft) + Ls(o.marginLeft),
top: -i.offsetTop + Ls(s.paddingTop) + Ls(o.marginTop),
right: Qs(a) - Xs(i) - i.offsetLeft + Ls(s.paddingRight) - Ls(o.marginRight),
bottom: Zs(a) - Ys(i) - i.offsetTop + Ls(s.paddingBottom) - Ls(o.marginBottom)
};
}
return Is(r.right) && (t = Math.min(t, r.right)), Is(r.bottom) && (n = Math.min(n, r.bottom)), Is(r.left) && (t = Math.max(t, r.left)), Is(r.top) && (n = Math.max(n, r.top)), [t, n];
}
function fc(e, t, n) {
return [Math.round(t / e[0]) * e[0], Math.round(n / e[1]) * e[1]];
}
function pc(e) {
return e.props.axis === "both" || e.props.axis === "x";
}
function mc(e) {
return e.props.axis === "both" || e.props.axis === "y";
}
function hc(e, t, n) {
let r = typeof t == "number" ? rc(e, t) : null;
if (typeof t == "number" && !r) return null;
let i = yc(n), a = n.props.offsetParent || i.offsetParent || i.ownerDocument.body;
return $s(r || e, a, n.props.scale);
}
function gc(e, t, n) {
let r = !Is(e.lastX), i = yc(e);
return r ? {
node: i,
deltaX: 0,
deltaY: 0,
lastX: t,
lastY: n,
x: t,
y: n
} : {
node: i,
deltaX: t - e.lastX,
deltaY: n - e.lastY,
lastX: e.lastX,
lastY: e.lastY,
x: t,
y: n
};
}
function _c(e, t) {
let n = e.props.scale;
return {
node: t.node,
x: e.state.x + t.deltaX / n,
y: e.state.y + t.deltaY / n,
deltaX: t.deltaX / n,
deltaY: t.deltaY / n,
lastX: e.state.x,
lastY: e.state.y
};
}
function vc(e) {
return {
left: e.left,
top: e.top,
right: e.right,
bottom: e.bottom
};
}
function yc(e) {
let t = e.findDOMNode();
if (!t) throw Error("<DraggableCore>: Unmounted during event!");
return t;
}
function bc(...e) {
({}).DRAGGABLE_DEBUG && console.log(...e);
}
var xc = {
touch: {
start: "touchstart",
move: "touchmove",
stop: "touchend"
},
mouse: {
start: "mousedown",
move: "mousemove",
stop: "mouseup"
}
}, Sc = xc.mouse, Cc = class extends N.Component {
constructor() {
super(...arguments), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, this.touchIdentifier = null, this.mounted = !1, this.handleDragStart = (e) => {
if (this.props.onMouseDown(e), !this.props.allowAnyClick && (typeof e.button == "number" && e.button !== 0 || e.ctrlKey)) return !1;
let t = this.findDOMNode();
if (!t || !t.ownerDocument || !t.ownerDocument.body) throw Error("<DraggableCore> not mounted on DragStart!");
let { ownerDocument: n } = t;
if (this.props.disabled || !(e.target instanceof n.defaultView.Node) || this.props.handle && !Ks(e.target, this.props.handle, t) || this.props.cancel && Ks(e.target, this.props.cancel, t)) return;
e.type === "touchstart" && !this.props.allowMobileScroll && e.preventDefault();
let r = ic(e);
this.touchIdentifier = r;
let i = hc(e, r, this);
if (i == null) return;
let { x: a, y: o } = i, s = gc(this, a, o);
bc("DraggableCore: handleDragStart: %j", s), bc("calling", this.props.onStart), this.props.onStart(e, s) !== !1 && this.mounted !== !1 && (this.props.enableUserSelectHack && oc(n, this.props.nonce), this.dragging = !0, this.lastX = a, this.lastY = o, qs(n, Sc.move, this.handleDrag), qs(n, Sc.stop, this.handleDragStop));
}, this.handleDrag = (e) => {
let t = hc(e, this.touchIdentifier, this);
if (t == null) return;
let { x: n, y: r } = t;
if (Array.isArray(this.props.grid)) {
let e = n - this.lastX, t = r - this.lastY;
if ([e, t] = fc(this.props.grid, e, t), !e && !t) return;
n = this.lastX + e, r = this.lastY + t;
}
let i = gc(this, n, r);
if (bc("DraggableCore: handleDrag: %j", i), this.props.onDrag(e, i) === !1 || this.mounted === !1) {
try {
this.handleDragStop(new MouseEvent("mouseup"));
} catch {
let e = document.createEvent("MouseEvents");
e.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(e);
}
return;
}
this.lastX = n, this.lastY = r;
}, this.handleDragStop = (e) => {
if (!this.dragging) return;
let t = hc(e, this.touchIdentifier, this);
if (t == null) return;
let { x: n, y: r } = t;
if (Array.isArray(this.props.grid)) {
let e = n - this.lastX || 0, t = r - this.lastY || 0;
[e, t] = fc(this.props.grid, e, t), n = this.lastX + e, r = this.lastY + t;
}
let i = gc(this, n, r);
if (this.props.onStop(e, i) === !1 || this.mounted === !1) return !1;
let a = this.findDOMNode();
a && this.props.enableUserSelectHack && sc(a.ownerDocument), bc("DraggableCore: handleDragStop: %j", i), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, a && (bc("DraggableCore: Removing handlers"), Js(a.ownerDocument, Sc.move, this.handleDrag), Js(a.ownerDocument, Sc.stop, this.handleDragStop));
}, this.onMouseDown = (e) => (Sc = xc.mouse, this.handleDragStart(e)), this.onMouseUp = (e) => (Sc = xc.mouse, this.handleDragStop(e)), this.onTouchStart = (e) => (Sc = xc.touch, this.handleDragStart(e)), this.onTouchEnd = (e) => (Sc = xc.touch, this.handleDragStop(e));
}
componentDidMount() {
this.mounted = !0;
let e = this.findDOMNode();
e && qs(e, xc.touch.start, this.onTouchStart, { passive: !1 });
}
componentWillUnmount() {
this.mounted = !1;
let e = this.findDOMNode();
if (e) {
let { ownerDocument: t } = e;
Js(t, xc.mouse.move, this.handleDrag), Js(t, xc.touch.move, this.handleDrag), Js(t, xc.mouse.stop, this.handleDragStop), Js(t, xc.touch.stop, this.handleDragStop), Js(e, xc.touch.start, this.onTouchStart, { passive: !1 }), this.props.enableUserSelectHack && sc(t);
}
}
findDOMNode() {
if (this.props?.nodeRef) return this.props.nodeRef.current;
let e = Zn;
return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : (bc("react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef"), null);
}
render() {
return N.cloneElement(N.Children.only(this.props.children), {
onMouseDown: this.onMouseDown,
onMouseUp: this.onMouseUp,
onTouchEnd: this.onTouchEnd
});
}
};
Cc.displayName = "DraggableCore", Cc.propTypes = {
allowAnyClick: W.default.bool,
allowMobileScroll: W.default.bool,
children: W.default.node.isRequired,
disabled: W.default.bool,
enableUserSelectHack: W.default.bool,
offsetParent: function(e, t) {
if (e[t] && e[t].nodeType !== 1) throw Error("Draggable's offsetParent must be a DOM Node.");
},
grid: W.default.arrayOf(W.default.number),
handle: W.default.string,
cancel: W.default.string,
nodeRef: W.default.object,
nonce: W.default.string,
onStart: W.default.func,
onDrag: W.default.func,
onStop: W.default.func,
onMouseDown: W.default.func,
scale: W.default.number,
className: Rs,
style: Rs,
transform: Rs
}, Cc.defaultProps = {
allowAnyClick: !1,
allowMobileScroll: !1,
disabled: !1,
enableUserSelectHack: !0,
onStart: function() {},
onDrag: function() {},
onStop: function() {},
onMouseDown: function() {},
scale: 1
};
var wc = class extends N.Component {
constructor(e) {
super(e), this.onDragStart = (e, t) => {
if (bc("Draggable: onDragStart: %j", t), this.props.onStart(e, _c(this, t)) === !1) return !1;
this.setState({
dragging: !0,
dragged: !0
});
}, this.onDrag = (e, t) => {
if (!this.state.dragging) return !1;
bc("Draggable: onDrag: %j", t);
let n = _c(this, t), r = {
x: n.x,
y: n.y,
slackX: 0,
slackY: 0
};
if (this.props.bounds) {
let { x: e, y: t } = r;
r.x += this.state.slackX, r.y += this.state.slackY;
let [i, a] = dc(this, r.x, r.y);
r.x = i, r.y = a, r.slackX = this.state.slackX + (e - r.x), r.slackY = this.state.slackY + (t - r.y), n.x = r.x, n.y = r.y, n.deltaX = r.x - this.state.x, n.deltaY = r.y - this.state.y;
}
if (this.props.onDrag(e, n) === !1) return !1;
this.setState(r);
}, this.onDragStop = (e, t) => {
if (!this.state.dragging || this.props.onStop(e, _c(this, t)) === !1) return !1;
bc("Draggable: onDragStop: %j", t);
let n = {
dragging: !1,
slackX: 0,
slackY: 0
};
if (this.props.position) {
let { x: e, y: t } = this.props.position;
n.x = e, n.y = t;
}
this.setState(n);
}, this.state = {
dragging: !1,
dragged: !1,
x: e.position ? e.position.x : e.defaultPosition.x,
y: e.position ? e.position.y : e.defaultPosition.y,
prevPropsPosition: { ...e.position },
slackX: 0,
slackY: 0,
isElementSVG: !1
}, e.position && !(e.onDrag || e.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
}
static getDerivedStateFromProps({ position: e }, { prevPropsPosition: t }) {
return e && (!t || e.x !== t.x || e.y !== t.y) ? (bc("Draggable: getDerivedStateFromProps %j", {
position: e,
prevPropsPosition: t
}), {
x: e.x,
y: e.y,
prevPropsPosition: { ...e }
}) : null;
}
componentDidMount() {
window.SVGElement !== void 0 && this.findDOMNode() instanceof window.SVGElement && this.setState({ isElementSVG: !0 });
}
componentWillUnmount() {
this.state.dragging && this.setState({ dragging: !1 });
}
findDOMNode() {
if (this.props?.nodeRef) return this.props.nodeRef.current;
let e = Zn;
return typeof e.findDOMNode == "function" ? e.findDOMNode(this) : null;
}
render() {
let { axis: e, bounds: t, children: n, defaultPosition: r, defaultClassName: i, defaultClassNameDragging: a, defaultClassNameDragged: o, position: s, positionOffset: c, scale: l, ...u } = this.props, d = {}, f = null, p = !s || this.state.dragging, m = s || r, h = {
x: pc(this) && p ? this.state.x : m.x,
y: mc(this) && p ? this.state.y : m.y
};
this.state.isElementSVG ? f = tc(h, c) : d = ec(h, c);
let g = N.Children.only(n), _ = Ns(g.props.className || "", i, {
[a]: this.state.dragging,
[o]: this.state.dragged
});
return /* @__PURE__ */ N.createElement(Cc, {
...u,
onStart: this.onDragStart,
onDrag: this.onDrag,
onStop: this.onDragStop
}, N.cloneElement(g, {
className: _,
style: {
...g.props.style,
...d
},
transform: f
}));
}
};
wc.displayName = "Draggable", wc.propTypes = {
...Cc.propTypes,
axis: W.default.oneOf([
"both",
"x",
"y",
"none"
]),
bounds: W.default.oneOfType([
W.default.shape({
left: W.default.number,
right: W.default.number,
top: W.default.number,
bottom: W.default.number
}),
W.default.string,
W.default.oneOf([!1])
]),
defaultClassName: W.default.string,
defaultClassNameDragging: W.default.string,
defaultClassNameDragged: W.default.string,
defaultPosition: W.default.shape({
x: W.default.number,
y: W.default.number
}),
positionOffset: W.default.shape({
x: W.default.oneOfType([W.default.number, W.default.string]),
y: W.default.oneOfType([W.default.number, W.default.string])
}),
position: W.default.shape({
x: W.default.number,
y: W.default.number
}),
className: Rs,
style: Rs,
transform: Rs
}, wc.defaultProps = {
...Cc.defaultProps,
axis: "both",
bounds: !1,
defaultClassName: "react-draggable",
defaultClassNameDragging: "react-draggable-dragging",
defaultClassNameDragged: "react-draggable-dragged",
defaultPosition: {
x: 0,
y: 0
},
scale: 1
};
//#endregion
//#region node_modules/react-draggable/build/cjs/cjs.mjs
var Tc = wc, Ec = function() {
return Ec = Object.assign || function(e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
return e;
}, Ec.apply(this, arguments);
}, Dc = {
width: "100%",
height: "10px",
top: "0px",
left: "0px",
cursor: "row-resize"
}, Oc = {
width: "10px",
height: "100%",
top: "0px",
left: "0px",
cursor: "col-resize"
}, kc = {
width: "20px",
height: "20px",
position: "absolute",
zIndex: 1
}, Ac = {
top: Ec(Ec({}, Dc), { top: "-5px" }),
right: Ec(Ec({}, Oc), {
left: void 0,
right: "-5px"
}),
bottom: Ec(Ec({}, Dc), {
top: void 0,
bottom: "-5px"
}),
left: Ec(Ec({}, Oc), { left: "-5px" }),
topRight: Ec(Ec({}, kc), {
right: "-10px",
top: "-10px",
cursor: "ne-resize"
}),
bottomRight: Ec(Ec({}, kc), {
right: "-10px",
bottom: "-10px",
cursor: "se-resize"
}),
bottomLeft: Ec(Ec({}, kc), {
left: "-10px",
bottom: "-10px",
cursor: "sw-resize"
}),
topLeft: Ec(Ec({}, kc), {
left: "-10px",
top: "-10px",
cursor: "nw-resize"
})
}, jc = On(function(e) {
var t = e.onResizeStart, n = e.direction, r = e.children, i = e.replaceStyles, a = e.className, o = kn(function(e) {
t(e, n);
}, [t, n]), s = kn(function(e) {
t(e, n);
}, [t, n]), c = Pn(function() {
return Ec(Ec({
position: "absolute",
userSelect: "none"
}, Ac[n]), i ?? {});
}, [i, n]);
return z("div", {
className: a || void 0,
style: c,
onMouseDown: o,
onTouchStart: s,
children: r
});
}), Mc = (function() {
var e = function(t, n) {
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
e.__proto__ = t;
} || function(e, t) {
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
}, e(t, n);
};
return function(t, n) {
if (typeof n != "function" && n !== null) throw TypeError("Class extends value " + String(n) + " is not a constructor or null");
e(t, n);
function r() {
this.constructor = t;
}
t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
};
})(), Nc = function() {
return Nc = Object.assign || function(e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
return e;
}, Nc.apply(this, arguments);
}, Pc = {
width: "auto",
height: "auto"
}, Fc = function(e, t, n) {
return Math.max(Math.min(e, n), t);
}, Ic = function(e, t, n) {
var r = Math.round(e / t);
return r * t + n * (r - 1);
}, Lc = function(e, t) {
return new RegExp(e, "i").test(t);
}, Rc = function(e) {
return !!(e.touches && e.touches.length);
}, zc = function(e) {
return !!((e.clientX || e.clientX === 0) && (e.clientY || e.clientY === 0));
}, Bc = function(e, t, n) {
n === void 0 && (n = 0);
var r = t.reduce(function(n, r, i) {
return Math.abs(r - e) < Math.abs(t[n] - e) ? i : n;
}, 0), i = Math.abs(t[r] - e);
return n === 0 || i < n ? t[r] : e;
}, Vc = function(e) {
return e = e.toString(), e === "auto" || e.endsWith("px") || e.endsWith("%") || e.endsWith("vh") || e.endsWith("vw") || e.endsWith("vmax") || e.endsWith("vmin") ? e : `${e}px`;
}, Hc = function(e, t, n, r) {
if (e && typeof e == "string") {
if (e.endsWith("px")) return Number(e.replace("px", ""));
if (e.endsWith("%")) {
var i = Number(e.replace("%", "")) / 100;
return t * i;
}
if (e.endsWith("vw")) {
var i = Number(e.replace("vw", "")) / 100;
return n * i;
}
if (e.endsWith("vh")) {
var i = Number(e.replace("vh", "")) / 100;
return r * i;
}
}
return e;
}, Uc = function(e, t, n, r, i, a, o) {
return r = Hc(r, e.width, t, n), i = Hc(i, e.height, t, n), a = Hc(a, e.width, t, n), o = Hc(o, e.height, t, n), {
maxWidth: r === void 0 ? void 0 : Number(r),
maxHeight: i === void 0 ? void 0 : Number(i),
minWidth: a === void 0 ? void 0 : Number(a),
minHeight: o === void 0 ? void 0 : Number(o)
};
}, Wc = function(e) {
return Array.isArray(e) ? e : [e, e];
}, Gc = /* @__PURE__ */ "as.ref.style.className.grid.gridGap.snap.bounds.boundsByDirection.size.defaultSize.minWidth.minHeight.maxWidth.maxHeight.lockAspectRatio.lockAspectRatioExtraWidth.lockAspectRatioExtraHeight.enable.handleStyles.handleClasses.handleWrapperStyle.handleWrapperClass.children.onResizeStart.onResize.onResizeStop.handleComponent.scale.resizeRatio.snapGap".split("."), Kc = "__resizable_base__", qc = function(e) {
Mc(t, e);
function t(t) {
var n = e.call(this, t) || this;
return n.ratio = 1, n.resizable = null, n.parentLeft = 0, n.parentTop = 0, n.resizableLeft = 0, n.resizableRight = 0, n.resizableTop = 0, n.resizableBottom = 0, n.targetLeft = 0, n.targetTop = 0, n.delta = {
width: 0,
height: 0
}, n.appendBase = function() {
if (!n.resizable || !n.window) return null;
var e = n.parentNode;
if (!e) return null;
var t = n.window.document.createElement("div");
return t.style.width = "100%", t.style.height = "100%", t.style.position = "absolute", t.style.transform = "scale(0, 0)", t.style.left = "0", t.style.flex = "0 0 100%", t.classList ? t.classList.add(Kc) : t.className += Kc, e.appendChild(t), t;
}, n.removeBase = function(e) {
var t = n.parentNode;
t && t.removeChild(e);
}, n.state = {
isResizing: !1,
width: n.propsSize?.width ?? "auto",
height: n.propsSize?.height ?? "auto",
direction: "right",
original: {
x: 0,
y: 0,
width: 0,
height: 0
},
backgroundStyle: {
height: "100%",
width: "100%",
backgroundColor: "rgba(0,0,0,0)",
cursor: "auto",
opacity: 0,
position: "fixed",
zIndex: 9999,
top: "0",
left: "0",
bottom: "0",
right: "0"
},
flexBasis: void 0
}, n.onResizeStart = n.onResizeStart.bind(n), n.onMouseMove = n.onMouseMove.bind(n), n.onMouseUp = n.onMouseUp.bind(n), n;
}
return Object.defineProperty(t.prototype, "parentNode", {
get: function() {
return this.resizable ? this.resizable.parentNode : null;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(t.prototype, "window", {
get: function() {
return !this.resizable || !this.resizable.ownerDocument ? null : this.resizable.ownerDocument.defaultView;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(t.prototype, "propsSize", {
get: function() {
return this.props.size || this.props.defaultSize || Pc;
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(t.prototype, "size", {
get: function() {
var e = 0, t = 0;
if (this.resizable && this.window) {
var n = this.resizable.offsetWidth, r = this.resizable.offsetHeight, i = this.resizable.style.position;
i !== "relative" && (this.resizable.style.position = "relative"), e = this.resizable.style.width === "auto" ? n : this.resizable.offsetWidth, t = this.resizable.style.height === "auto" ? r : this.resizable.offsetHeight, this.resizable.style.position = i;
}
return {
width: e,
height: t
};
},
enumerable: !1,
configurable: !0
}), Object.defineProperty(t.prototype, "sizeStyle", {
get: function() {
var e = this, t = this.props.size, n = function(t) {
if (e.state[t] === void 0 || e.state[t] === "auto") return "auto";
if (e.propsSize && e.propsSize[t] && e.propsSize[t]?.toString().endsWith("%")) {
if (e.state[t].toString().endsWith("%")) return e.state[t].toString();
var n = e.getParentSize();
return `${Number(e.state[t].toString().replace("px", "")) / n[t] * 100}%`;
}
return Vc(e.state[t]);
};
return {
width: t && t.width !== void 0 && !this.state.isResizing ? Vc(t.width) : n("width"),
height: t && t.height !== void 0 && !this.state.isResizing ? Vc(t.height) : n("height")
};
},
enumerable: !1,
configurable: !0
}), t.prototype.getParentSize = function() {
if (!this.parentNode) return this.window ? {
width: this.window.innerWidth,
height: this.window.innerHeight
} : {
width: 0,
height: 0
};
var e = this.appendBase();
if (!e) return {
width: 0,
height: 0
};
var t = !1, n = this.parentNode.style.flexWrap;
n !== "wrap" && (t = !0, this.parentNode.style.flexWrap = "wrap"), e.style.position = "relative", e.style.minWidth = "100%", e.style.minHeight = "100%";
var r = {
width: e.offsetWidth,
height: e.offsetHeight
};
return t && (this.parentNode.style.flexWrap = n), this.removeBase(e), r;
}, t.prototype.bindEvents = function() {
this.window && (this.window.addEventListener("mouseup", this.onMouseUp), this.window.addEventListener("mousemove", this.onMouseMove), this.window.addEventListener("mouseleave", this.onMouseUp), this.window.addEventListener("touchmove", this.onMouseMove, {
capture: !0,
passive: !1
}), this.window.addEventListener("touchend", this.onMouseUp));
}, t.prototype.unbindEvents = function() {
this.window && (this.window.removeEventListener("mouseup", this.onMouseUp), this.window.removeEventListener("mousemove", this.onMouseMove), this.window.removeEventListener("mouseleave", this.onMouseUp), this.window.removeEventListener("touchmove", this.onMouseMove, !0), this.window.removeEventListener("touchend", this.onMouseUp));
}, t.prototype.componentDidMount = function() {
if (!(!this.resizable || !this.window)) {
var e = this.window.getComputedStyle(this.resizable);
this.setState({
width: this.state.width || this.size.width,
height: this.state.height || this.size.height,
flexBasis: e.flexBasis === "auto" ? void 0 : e.flexBasis
});
}
}, t.prototype.componentWillUnmount = function() {
this.window && this.unbindEvents();
}, t.prototype.createSizeForCssProperty = function(e, t) {
var n = this.propsSize && this.propsSize[t];
return this.state[t] === "auto" && this.state.original[t] === e && (n === void 0 || n === "auto") ? "auto" : e;
}, t.prototype.calculateNewMaxFromBoundary = function(e, t) {
var n = this.props.boundsByDirection, r = this.state.direction, i = n && Lc("left", r), a = n && Lc("top", r), o, s;
if (this.props.bounds === "parent") {
var c = this.parentNode;
c && (o = i ? this.resizableRight - this.parentLeft : c.offsetWidth + (this.parentLeft - this.resizableLeft), s = a ? this.resizableBottom - this.parentTop : c.offsetHeight + (this.parentTop - this.resizableTop));
} else this.props.bounds === "window" ? this.window && (o = i ? this.resizableRight : this.window.innerWidth - this.resizableLeft, s = a ? this.resizableBottom : this.window.innerHeight - this.resizableTop) : this.props.bounds && (o = i ? this.resizableRight - this.targetLeft : this.props.bounds.offsetWidth + (this.targetLeft - this.resizableLeft), s = a ? this.resizableBottom - this.targetTop : this.props.bounds.offsetHeight + (this.targetTop - this.resizableTop));
return o && Number.isFinite(o) && (e = e && e < o ? e : o), s && Number.isFinite(s) && (t = t && t < s ? t : s), {
maxWidth: e,
maxHeight: t
};
}, t.prototype.calculateNewSizeFromDirection = function(e, t) {
var n = this.props.scale || 1, r = Wc(this.props.resizeRatio || 1), i = r[0], a = r[1], o = this.state, s = o.direction, c = o.original, l = this.props, u = l.lockAspectRatio, d = l.lockAspectRatioExtraHeight, f = l.lockAspectRatioExtraWidth, p = c.width, m = c.height, h = d || 0, g = f || 0;
return Lc("right", s) && (p = c.width + (e - c.x) * i / n, u && (m = (p - g) / this.ratio + h)), Lc("left", s) && (p = c.width - (e - c.x) * i / n, u && (m = (p - g) / this.ratio + h)), Lc("bottom", s) && (m = c.height + (t - c.y) * a / n, u && (p = (m - h) * this.ratio + g)), Lc("top", s) && (m = c.height - (t - c.y) * a / n, u && (p = (m - h) * this.ratio + g)), {
newWidth: p,
newHeight: m
};
}, t.prototype.calculateNewSizeFromAspectRatio = function(e, t, n, r) {
var i = this.props, a = i.lockAspectRatio, o = i.lockAspectRatioExtraHeight, s = i.lockAspectRatioExtraWidth, c = r.width === void 0 ? 10 : r.width, l = n.width === void 0 || n.width < 0 ? e : n.width, u = r.height === void 0 ? 10 : r.height, d = n.height === void 0 || n.height < 0 ? t : n.height, f = o || 0, p = s || 0;
if (a) {
var m = (u - f) * this.ratio + p, h = (d - f) * this.ratio + p, g = (c - p) / this.ratio + f, _ = (l - p) / this.ratio + f, v = Math.max(c, m), y = Math.min(l, h), b = Math.max(u, g), x = Math.min(d, _);
e = Fc(e, v, y), t = Fc(t, b, x);
} else e = Fc(e, c, l), t = Fc(t, u, d);
return {
newWidth: e,
newHeight: t
};
}, t.prototype.setBoundingClientRect = function() {
var e = 1 / (this.props.scale || 1);
if (this.props.bounds === "parent") {
var t = this.parentNode;
if (t) {
var n = t.getBoundingClientRect();
this.parentLeft = n.left * e, this.parentTop = n.top * e;
}
}
if (this.props.bounds && typeof this.props.bounds != "string") {
var r = this.props.bounds.getBoundingClientRect();
this.targetLeft = r.left * e, this.targetTop = r.top * e;
}
if (this.resizable) {
var i = this.resizable.getBoundingClientRect(), a = i.left, o = i.top, s = i.right, c = i.bottom;
this.resizableLeft = a * e, this.resizableRight = s * e, this.resizableTop = o * e, this.resizableBottom = c * e;
}
}, t.prototype.onResizeStart = function(e, t) {
if (!(!this.resizable || !this.window)) {
var n = 0, r = 0;
if (e.nativeEvent && zc(e.nativeEvent) ? (n = e.nativeEvent.clientX, r = e.nativeEvent.clientY) : e.nativeEvent && Rc(e.nativeEvent) && (n = e.nativeEvent.touches[0].clientX, r = e.nativeEvent.touches[0].clientY), !(this.props.onResizeStart && this.resizable && this.props.onResizeStart(e, t, this.resizable) === !1)) {
this.props.size && (this.props.size.height !== void 0 && this.props.size.height !== this.state.height && this.setState({ height: this.props.size.height }), this.props.size.width !== void 0 && this.props.size.width !== this.state.width && this.setState({ width: this.props.size.width })), this.ratio = typeof this.props.lockAspectRatio == "number" ? this.props.lockAspectRatio : this.size.width / this.size.height;
var i, a = this.window.getComputedStyle(this.resizable);
if (a.flexBasis !== "auto") {
var o = this.parentNode;
if (o) {
var s = this.window.getComputedStyle(o).flexDirection;
this.flexDir = s.startsWith("row") ? "row" : "column", i = a.flexBasis;
}
}
this.setBoundingClientRect(), this.bindEvents();
var c = {
original: {
x: n,
y: r,
width: this.size.width,
height: this.size.height
},
isResizing: !0,
backgroundStyle: Nc(Nc({}, this.state.backgroundStyle), { cursor: this.window.getComputedStyle(e.target).cursor || "auto" }),
direction: t,
flexBasis: i
};
this.setState(c);
}
}
}, t.prototype.onMouseMove = function(e) {
var t = this;
if (!(!this.state.isResizing || !this.resizable || !this.window)) {
if (this.window.TouchEvent && Rc(e)) try {
e.preventDefault(), e.stopPropagation();
} catch {}
var n = this.props, r = n.maxWidth, i = n.maxHeight, a = n.minWidth, o = n.minHeight, s = Rc(e) ? e.touches[0].clientX : e.clientX, c = Rc(e) ? e.touches[0].clientY : e.clientY, l = this.state, u = l.direction, d = l.original, f = l.width, p = l.height, m = this.getParentSize(), h = Uc(m, this.window.innerWidth, this.window.innerHeight, r, i, a, o);
r = h.maxWidth, i = h.maxHeight, a = h.minWidth, o = h.minHeight;
var g = this.calculateNewSizeFromDirection(s, c), _ = g.newHeight, v = g.newWidth, y = this.calculateNewMaxFromBoundary(r, i);
this.props.snap && this.props.snap.x && (v = Bc(v, this.props.snap.x, this.props.snapGap)), this.props.snap && this.props.snap.y && (_ = Bc(_, this.props.snap.y, this.props.snapGap));
var b = this.calculateNewSizeFromAspectRatio(v, _, {
width: y.maxWidth,
height: y.maxHeight
}, {
width: a,
height: o
});
if (v = b.newWidth, _ = b.newHeight, this.props.grid) {
var x = Ic(v, this.props.grid[0], this.props.gridGap ? this.props.gridGap[0] : 0), S = Ic(_, this.props.grid[1], this.props.gridGap ? this.props.gridGap[1] : 0), C = this.props.snapGap || 0, w = C === 0 || Math.abs(x - v) <= C ? x : v, T = C === 0 || Math.abs(S - _) <= C ? S : _;
v = w, _ = T;
}
var E = {
width: v - d.width,
height: _ - d.height
};
if (this.delta = E, f && typeof f == "string") {
if (f.endsWith("%")) {
var D = v / m.width * 100;
v = `${D}%`;
} else if (f.endsWith("vw")) {
var ee = v / this.window.innerWidth * 100;
v = `${ee}vw`;
} else if (f.endsWith("vh")) {
var te = v / this.window.innerHeight * 100;
v = `${te}vh`;
}
}
if (p && typeof p == "string") {
if (p.endsWith("%")) {
var D = _ / m.height * 100;
_ = `${D}%`;
} else if (p.endsWith("vw")) {
var ee = _ / this.window.innerWidth * 100;
_ = `${ee}vw`;
} else if (p.endsWith("vh")) {
var te = _ / this.window.innerHeight * 100;
_ = `${te}vh`;
}
}
var ne = {
width: this.createSizeForCssProperty(v, "width"),
height: this.createSizeForCssProperty(_, "height")
};
this.flexDir === "row" ? ne.flexBasis = ne.width : this.flexDir === "column" && (ne.flexBasis = ne.height);
var re = this.state.width !== ne.width, ie = this.state.height !== ne.height, ae = this.state.flexBasis !== ne.flexBasis, oe = re || ie || ae;
oe && Qn(function() {
t.setState(ne);
}), this.props.onResize && oe && this.props.onResize(e, u, this.resizable, E);
}
}, t.prototype.onMouseUp = function(e) {
var t = this.state, n = t.isResizing, r = t.direction;
t.original, !(!n || !this.resizable) && (this.props.onResizeStop && this.props.onResizeStop(e, r, this.resizable, this.delta), this.props.size && this.setState({
width: this.props.size.width ?? "auto",
height: this.props.size.height ?? "auto"
}), this.unbindEvents(), this.setState({
isResizing: !1,
backgroundStyle: Nc(Nc({}, this.state.backgroundStyle), { cursor: "auto" })
}));
}, t.prototype.updateSize = function(e) {
this.setState({
width: e.width ?? "auto",
height: e.height ?? "auto"
});
}, t.prototype.renderResizer = function() {
var e = this, t = this.props, n = t.enable, r = t.handleStyles, i = t.handleClasses, a = t.handleWrapperStyle, o = t.handleWrapperClass, s = t.handleComponent;
if (!n) return null;
var c = Object.keys(n).map(function(t) {
return n[t] === !1 ? null : z(jc, {
direction: t,
onResizeStart: e.onResizeStart,
replaceStyles: r && r[t],
className: i && i[t],
children: s && s[t] ? s[t] : null
}, t);
});
return z("div", {
className: o,
style: a,
children: c
});
}, t.prototype.render = function() {
var e = this, t = Object.keys(this.props).reduce(function(t, n) {
return Gc.indexOf(n) === -1 && (t[n] = e.props[n]), t;
}, {}), n = Nc(Nc(Nc({
position: "relative",
userSelect: this.state.isResizing ? "none" : "auto"
}, this.props.style), this.sizeStyle), {
maxWidth: this.props.maxWidth,
maxHeight: this.props.maxHeight,
minWidth: this.props.minWidth,
minHeight: this.props.minHeight,
boxSizing: "border-box",
flexShrink: 0
});
this.state.flexBasis && (n.flexBasis = this.state.flexBasis);
var r = this.props.as || "div";
return B(r, Nc({
style: n,
className: this.props.className
}, t, {
ref: function(t) {
t && (e.resizable = t);
},
children: [
this.state.isResizing && z("div", { style: this.state.backgroundStyle }),
this.props.children,
this.renderResizer()
]
}));
}, t.defaultProps = {
as: "div",
onResizeStart: function() {},
onResize: function() {},
onResizeStop: function() {},
enable: {
top: !0,
right: !0,
bottom: !0,
left: !0,
topRight: !0,
bottomRight: !0,
bottomLeft: !0,
topLeft: !0
},
style: {},
grid: [1, 1],
gridGap: [0, 0],
lockAspectRatio: !1,
lockAspectRatioExtraWidth: 0,
lockAspectRatioExtraHeight: 0,
scale: 1,
resizeRatio: 1,
snapGap: 0
}, t;
}(yn), Jc = function(e, t) {
return Jc = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
e.__proto__ = t;
} || function(e, t) {
for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
}, Jc(e, t);
};
function Yc(e, t) {
Jc(e, t);
function n() {
this.constructor = e;
}
e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
}
var Xc = function() {
return Xc = Object.assign || function(e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
return e;
}, Xc.apply(this, arguments);
};
function Zc(e, t) {
var n = {};
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var i = 0, r = Object.getOwnPropertySymbols(e); i < r.length; i++) t.indexOf(r[i]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[i]) && (n[r[i]] = e[r[i]]);
return n;
}
var Qc = {
width: "auto",
height: "auto",
display: "inline-block",
position: "absolute",
top: 0,
left: 0
}, $c = function(e) {
return {
bottom: e,
bottomLeft: e,
bottomRight: e,
left: e,
right: e,
top: e,
topLeft: e,
topRight: e
};
}, el = function(e) {
Yc(t, e);
function t(t) {
var n = e.call(this, t) || this;
return n.resizingPosition = {
x: 0,
y: 0
}, n.offsetFromParent = {
left: 0,
top: 0
}, n.resizableElement = { current: null }, n.originalPosition = {
x: 0,
y: 0
}, n.state = {
resizing: !1,
bounds: {
top: 0,
right: 0,
bottom: 0,
left: 0
},
maxWidth: t.maxWidth,
maxHeight: t.maxHeight
}, n.onResizeStart = n.onResizeStart.bind(n), n.onResize = n.onResize.bind(n), n.onResizeStop = n.onResizeStop.bind(n), n.onDragStart = n.onDragStart.bind(n), n.onDrag = n.onDrag.bind(n), n.onDragStop = n.onDragStop.bind(n), n.getMaxSizesFromProps = n.getMaxSizesFromProps.bind(n), n;
}
return t.prototype.componentDidMount = function() {
this.updateOffsetFromParent();
var e = this.offsetFromParent, t = e.left, n = e.top, r = this.getDraggablePosition(), i = r.x, a = r.y;
this.draggable.setState({
x: i - t,
y: a - n
}), this.forceUpdate();
}, t.prototype.getDraggablePosition = function() {
var e = this.draggable.state;
return {
x: e.x,
y: e.y
};
}, t.prototype.getParent = function() {
return this.resizable && this.resizable.parentNode;
}, t.prototype.getParentSize = function() {
return this.resizable.getParentSize();
}, t.prototype.getMaxSizesFromProps = function() {
return {
maxWidth: this.props.maxWidth === void 0 ? 2 ** 53 - 1 : this.props.maxWidth,
maxHeight: this.props.maxHeight === void 0 ? 2 ** 53 - 1 : this.props.maxHeight
};
}, t.prototype.getSelfElement = function() {
return this.resizable && this.resizable.resizable;
}, t.prototype.getOffsetHeight = function(e) {
var t = this.props.scale;
switch (this.props.bounds) {
case "window": return window.innerHeight / t;
case "body": return document.body.offsetHeight / t;
default: return e.offsetHeight;
}
}, t.prototype.getOffsetWidth = function(e) {
var t = this.props.scale;
switch (this.props.bounds) {
case "window": return window.innerWidth / t;
case "body": return document.body.offsetWidth / t;
default: return e.offsetWidth;
}
}, t.prototype.onDragStart = function(e, t) {
if (this.props.onDragStart && this.props.onDragStart(e, t) === !1) return !1;
var n = this.getDraggablePosition();
if (this.originalPosition = n, this.props.bounds) {
var r = this.getParent(), i = this.props.scale, a;
if (this.props.bounds === "parent") a = r;
else if (this.props.bounds === "body") {
var o = r.getBoundingClientRect(), s = o.left, c = o.top, l = document.body.getBoundingClientRect(), u = -(s - r.offsetLeft * i - l.left) / i, d = -(c - r.offsetTop * i - l.top) / i, f = (document.body.offsetWidth - this.resizable.size.width * i) / i + u, p = (document.body.offsetHeight - this.resizable.size.height * i) / i + d;
return this.setState({ bounds: {
top: d,
right: f,
bottom: p,
left: u
} });
} else if (this.props.bounds === "window") {
if (!this.resizable) return;
var m = r.getBoundingClientRect(), h = m.left, g = m.top, _ = -(h - r.offsetLeft * i) / i, v = -(g - r.offsetTop * i) / i, f = (window.innerWidth - this.resizable.size.width * i) / i + _, p = (window.innerHeight - this.resizable.size.height * i) / i + v;
return this.setState({ bounds: {
top: v,
right: f,
bottom: p,
left: _
} });
} else typeof this.props.bounds == "string" ? a = document.querySelector(this.props.bounds) : this.props.bounds instanceof HTMLElement && (a = this.props.bounds);
if (!(!(a instanceof HTMLElement) || !(r instanceof HTMLElement))) {
var y = a.getBoundingClientRect(), b = y.left, x = y.top, S = r.getBoundingClientRect(), C = S.left, w = S.top, T = (b - C) / i, E = x - w;
if (this.resizable) {
this.updateOffsetFromParent();
var D = this.offsetFromParent;
this.setState({ bounds: {
top: E - D.top,
right: T + (a.offsetWidth - this.resizable.size.width) - D.left / i,
bottom: E + (a.offsetHeight - this.resizable.size.height) - D.top,
left: T - D.left / i
} });
}
}
}
}, t.prototype.onDrag = function(e, t) {
if (this.props.onDrag) {
var n = this.offsetFromParent, r = n.left, i = n.top;
if (!this.props.dragAxis || this.props.dragAxis === "both") return this.props.onDrag(e, Xc(Xc({}, t), {
x: t.x + r,
y: t.y + i
}));
if (this.props.dragAxis === "x") return this.props.onDrag(e, Xc(Xc({}, t), {
x: t.x + r,
y: this.originalPosition.y + i,
deltaY: 0
}));
if (this.props.dragAxis === "y") return this.props.onDrag(e, Xc(Xc({}, t), {
x: this.originalPosition.x + r,
y: t.y + i,
deltaX: 0
}));
}
}, t.prototype.onDragStop = function(e, t) {
if (this.props.onDragStop) {
var n = this.offsetFromParent, r = n.left, i = n.top;
if (!this.props.dragAxis || this.props.dragAxis === "both") return this.props.onDragStop(e, Xc(Xc({}, t), {
x: t.x + r,
y: t.y + i
}));
if (this.props.dragAxis === "x") return this.props.onDragStop(e, Xc(Xc({}, t), {
x: t.x + r,
y: this.originalPosition.y + i,
deltaY: 0
}));
if (this.props.dragAxis === "y") return this.props.onDragStop(e, Xc(Xc({}, t), {
x: this.originalPosition.x + r,
y: t.y + i,
deltaX: 0
}));
}
}, t.prototype.onResizeStart = function(e, t, n) {
if (this.props.onResizeStart && this.props.onResizeStart(e, t, n) === !1) return !1;
e.stopPropagation(), this.setState({ resizing: !0 });
var r = this.props.scale, i = this.offsetFromParent, a = this.getDraggablePosition();
if (this.resizingPosition = {
x: a.x + i.left,
y: a.y + i.top
}, this.originalPosition = a, this.props.bounds) {
var o = this.getParent(), s = void 0;
this.props.bounds === "parent" ? s = o : this.props.bounds === "body" ? s = document.body : this.props.bounds === "window" ? s = window : typeof this.props.bounds == "string" ? s = document.querySelector(this.props.bounds) : this.props.bounds instanceof HTMLElement && (s = this.props.bounds);
var c = this.getSelfElement();
if (c instanceof Element && (s instanceof HTMLElement || s === window) && o instanceof HTMLElement) {
var l = this.getMaxSizesFromProps(), u = l.maxWidth, d = l.maxHeight, f = this.getParentSize();
if (u && typeof u == "string") {
if (u.endsWith("%")) {
var p = Number(u.replace("%", "")) / 100;
u = f.width * p;
} else u.endsWith("px") && (u = Number(u.replace("px", "")));
}
if (d && typeof d == "string") {
if (d.endsWith("%")) {
var p = Number(d.replace("%", "")) / 100;
d = f.height * p;
} else d.endsWith("px") && (d = Number(d.replace("px", "")));
}
var m = c.getBoundingClientRect(), h = m.left, g = m.top, _ = this.props.bounds === "window" ? {
left: 0,
top: 0
} : s.getBoundingClientRect(), v = _.left, y = _.top, b = this.getOffsetWidth(s), x = this.getOffsetHeight(s), S = t.toLowerCase().endsWith("left"), C = t.toLowerCase().endsWith("right"), w = t.startsWith("top"), T = t.startsWith("bottom");
if ((S || w) && this.resizable) {
var E = (h - v) / r + this.resizable.size.width;
this.setState({ maxWidth: E > Number(u) ? u : E });
}
if (C || this.props.lockAspectRatio && !S && !w) {
var E = b + (v - h) / r;
this.setState({ maxWidth: E > Number(u) ? u : E });
}
if ((w || S) && this.resizable) {
var E = (g - y) / r + this.resizable.size.height;
this.setState({ maxHeight: E > Number(d) ? d : E });
}
if (T || this.props.lockAspectRatio && !w && !S) {
var E = x + (y - g) / r;
this.setState({ maxHeight: E > Number(d) ? d : E });
}
}
} else this.setState({
maxWidth: this.props.maxWidth,
maxHeight: this.props.maxHeight
});
}, t.prototype.onResize = function(e, t, n, r) {
var i = this, a = {
x: this.originalPosition.x,
y: this.originalPosition.y
}, o = -r.width, s = -r.height;
[
"top",
"left",
"topLeft",
"bottomLeft",
"topRight"
].includes(t) && (t === "bottomLeft" ? a.x += o : (t === "topRight" || (a.x += o), a.y += s));
var c = this.draggable.state;
(a.x !== c.x || a.y !== c.y) && Qn(function() {
i.draggable.setState(a);
}), this.updateOffsetFromParent();
var l = this.offsetFromParent, u = this.getDraggablePosition().x + l.left, d = this.getDraggablePosition().y + l.top;
this.resizingPosition = {
x: u,
y: d
}, this.props.onResize && this.props.onResize(e, t, n, r, {
x: u,
y: d
});
}, t.prototype.onResizeStop = function(e, t, n, r) {
this.setState({ resizing: !1 });
var i = this.getMaxSizesFromProps(), a = i.maxWidth, o = i.maxHeight;
this.setState({
maxWidth: a,
maxHeight: o
}), this.props.onResizeStop && this.props.onResizeStop(e, t, n, r, this.resizingPosition);
}, t.prototype.updateSize = function(e) {
this.resizable && this.resizable.updateSize({
width: e.width,
height: e.height
});
}, t.prototype.updatePosition = function(e) {
this.draggable.setState(e);
}, t.prototype.updateOffsetFromParent = function() {
var e = this.props.scale, t = this.getParent(), n = this.getSelfElement();
if (!t || n === null) return {
top: 0,
left: 0
};
var r = t.getBoundingClientRect(), i = r.left, a = r.top, o = n.getBoundingClientRect(), s = this.getDraggablePosition(), c = t.scrollLeft, l = t.scrollTop;
this.offsetFromParent = {
left: o.left - i + c - s.x * e,
top: o.top - a + l - s.y * e
};
}, t.prototype.render = function() {
var e = this, t = this.props, n = t.disableDragging, r = t.style, i = t.dragHandleClassName, a = t.position, o = t.onMouseDown, s = t.onMouseUp, c = t.dragAxis, l = t.dragGrid, u = t.bounds, d = t.enableUserSelectHack, f = t.cancel, p = t.children;
t.onResizeStart, t.onResize, t.onResizeStop, t.onDragStart, t.onDrag, t.onDragStop;
var m = t.resizeHandleStyles, h = t.resizeHandleClasses, g = t.resizeHandleComponent, _ = t.enableResizing, v = t.resizeGrid, y = t.resizeHandleWrapperClass, b = t.resizeHandleWrapperStyle, x = t.scale, S = t.allowAnyClick, C = t.dragPositionOffset, w = Zc(t, /* @__PURE__ */ "disableDragging.style.dragHandleClassName.position.onMouseDown.onMouseUp.dragAxis.dragGrid.bounds.enableUserSelectHack.cancel.children.onResizeStart.onResize.onResizeStop.onDragStart.onDrag.onDragStop.resizeHandleStyles.resizeHandleClasses.resizeHandleComponent.enableResizing.resizeGrid.resizeHandleWrapperClass.resizeHandleWrapperStyle.scale.allowAnyClick.dragPositionOffset".split(".")), T = this.props.default ? Xc({}, this.props.default) : void 0;
delete w.default;
var E = n || i ? { cursor: "auto" } : { cursor: "move" }, D = Xc(Xc(Xc({}, Qc), E), r), ee = this.offsetFromParent, te = ee.left, ne = ee.top, re;
a && (re = {
x: a.x - te,
y: a.y - ne
});
var ie = this.state.resizing ? void 0 : re, ae = this.state.resizing ? "both" : c;
return Cn(Tc, {
ref: function(t) {
t && (e.draggable = t);
},
handle: i ? `.${i}` : void 0,
defaultPosition: T,
onMouseDown: o,
onMouseUp: s,
onStart: this.onDragStart,
onDrag: this.onDrag,
onStop: this.onDragStop,
axis: ae,
disabled: n,
grid: l,
bounds: u ? this.state.bounds : void 0,
position: ie,
enableUserSelectHack: d,
cancel: f,
scale: x,
allowAnyClick: S,
nodeRef: this.resizableElement,
positionOffset: C
}, Cn(qc, Xc({}, w, {
ref: function(t) {
t && (e.resizable = t, e.resizableElement.current = t.resizable);
},
defaultSize: T,
size: this.props.size,
enable: typeof _ == "boolean" ? $c(_) : _,
onResizeStart: this.onResizeStart,
onResize: this.onResize,
onResizeStop: this.onResizeStop,
style: D,
minWidth: this.props.minWidth,
minHeight: this.props.minHeight,
maxWidth: this.state.resizing ? this.state.maxWidth : this.props.maxWidth,
maxHeight: this.state.resizing ? this.state.maxHeight : this.props.maxHeight,
grid: v,
handleWrapperClass: y,
handleWrapperStyle: b,
lockAspectRatio: this.props.lockAspectRatio,
lockAspectRatioExtraWidth: this.props.lockAspectRatioExtraWidth,
lockAspectRatioExtraHeight: this.props.lockAspectRatioExtraHeight,
handleStyles: m,
handleClasses: h,
handleComponent: g,
scale: this.props.scale
}), p));
}, t.defaultProps = {
maxWidth: 2 ** 53 - 1,
maxHeight: 2 ** 53 - 1,
scale: 1,
onResizeStart: function() {},
onResize: function() {},
onResizeStop: function() {},
onDragStart: function() {},
onDrag: function() {},
onDragStop: function() {}
}, t;
}(yn), tl = hn(), nl = H(Fn, {
name: "CompanionWindow",
slot: "root"
})({}), rl = H(Xn, {
name: "CompanionWindow",
slot: "toolbar"
})({}), il = H(U, {
name: "CompanionWindow",
slot: "title"
})({}), al = H("div", {
name: "CompanionWindow",
slot: "controls"
})({}), ol = H(Fn, {
name: "CompanionWindow",
slot: "contents"
})({}), sl = H(el, {
name: "CompanionWindow",
slot: "resize"
})({}), cl = H(fn, {
name: "CompanionWindow",
slot: "positionButton"
})({}), ll = H(fn, {
name: "CompanionWindow",
slot: "closeButton"
})({}), ul = Tn((e, t) => {
let { ariaLabel: n = void 0, classes: r = {}, direction: i, id: a, paperClassName: o = "", onCloseClick: s = () => {}, updateCompanionWindow: c = void 0, isDisplayed: u = !1, position: d = null, title: f = null, children: p = void 0, titleControls: m = null, defaultSidebarPanelWidth: h = 235, defaultSidebarPanelHeight: g = 201 } = e, [_, v] = (0, tl.useElementSize)(), { t: y } = V(), b = l((e) => ve(e, { companionWindowId: a }), [a]), x = i === "rtl" ? { transform: "scale(-1, 1)" } : {}, S = (() => {
let e = {
ltr: {
default: "left",
opposite: "right"
},
rtl: {
default: "right",
opposite: "left"
}
}, t = {
bottom: !1,
bottomLeft: !1,
bottomRight: !1,
left: !1,
right: !1,
top: !1,
topLeft: !1,
topRight: !1
};
return d === "right" || d === "far-right" ? {
...t,
[e[i].default]: !0
} : d === "left" ? {
...t,
[e[i].opposite]: !0
} : d === "bottom" || d === "far-bottom" ? {
...t,
top: !0
} : t;
})(), C = d === "bottom" || d === "far-bottom", w = vn.map(p, (e) => e ? xn(e, { parentactions: { closeCompanionWindow: s } }) : null);
return /* @__PURE__ */ z(nl, {
ownerState: e,
ref: pn(t, _),
style: {
display: u ? null : "none",
order: d === "left" ? -1 : null
},
className: [
j(`companion-window-${d}`),
o,
d === "bottom" ? r.horizontal : r.vertical
].join(" "),
square: !0,
component: "aside",
role: "region",
"aria-label": n || f,
children: /* @__PURE__ */ z(ln.Provider, {
value: b,
children: /* @__PURE__ */ B(sl, {
style: {
display: "inherit",
position: "inherit"
},
ownerState: e,
default: {
height: C ? g : "100%",
width: C ? "auto" : h
},
disableDragging: !0,
enableResizing: S,
minHeight: 50,
minWidth: d === "left" ? 235 : 100,
children: [/* @__PURE__ */ B(rl, {
variant: "dense",
className: [j("companion-window-header"), v.width < 370 ? "test" : null].join(" "),
disableGutters: !0,
children: [
/* @__PURE__ */ z(il, {
variant: "h3",
children: f
}),
d === "left" ? c && /* @__PURE__ */ z(fn, {
"aria-label": y("openInCompanionWindow"),
onClick: () => {
c({ position: "right" });
},
children: /* @__PURE__ */ z(As, { style: x })
}) : /* @__PURE__ */ B(R, { children: [c && /* @__PURE__ */ z(cl, {
"aria-label": y(d === "bottom" ? "moveCompanionWindowToRight" : "moveCompanionWindowToBottom"),
onClick: () => {
c({ position: d === "bottom" ? "right" : "bottom" });
},
children: /* @__PURE__ */ z(js, {})
}), /* @__PURE__ */ z(ll, {
sx: { ...v.width < 370 && { order: "unset" } },
"aria-label": y("closeCompanionWindow"),
onClick: s,
children: /* @__PURE__ */ z(ks, {})
})] }),
m && /* @__PURE__ */ z(al, {
ownerState: { position: d },
sx: { order: C || v.width < 370 ? "unset" : 1e3 },
className: j("companion-window-title-controls"),
children: m
})
]
}), /* @__PURE__ */ z(ol, {
className: j("scrollto-scrollable"),
elevation: 0,
children: w
})]
})
})
});
});
ul.propTypes = {
ariaLabel: W.default.string,
children: W.default.node,
classes: W.default.objectOf(W.default.string),
defaultSidebarPanelHeight: W.default.number,
defaultSidebarPanelWidth: W.default.number,
direction: W.default.string.isRequired,
id: W.default.string.isRequired,
isDisplayed: W.default.bool,
onCloseClick: W.default.func,
paperClassName: W.default.string,
position: W.default.string,
size: W.default.shape({ width: W.default.number }),
title: W.default.oneOfType([W.default.string, W.default.node]),
titleControls: W.default.node,
updateCompanionWindow: W.default.func
}, ul.displayName = "CompanionWindow";
var dl = n(w((e, { id: t, windowId: n }) => {
let r = se(e, { companionWindowId: t }), { defaultSidebarPanelHeight: i, defaultSidebarPanelWidth: a } = Se(e, { windowId: n });
return {
...r,
defaultSidebarPanelHeight: i,
defaultSidebarPanelWidth: a,
direction: pt(e),
isDisplayed: r && r.content && r.content.length > 0
};
}, (e, { windowId: t, id: n }) => ({
onCloseClick: () => e(Ni(t, n)),
updateCompanionWindow: (...r) => e(Mi(t, n, ...r))
}), null, { forwardRef: !0 }), m("CompanionWindow"))(ul), fl = H("div", {
name: "CompanionWindowSection",
slot: "root"
})(({ theme: e }) => ({
paddingBlockEnd: e.spacing(1),
paddingBlockStart: e.spacing(2),
paddingInlineEnd: e.spacing(1),
paddingInlineStart: e.spacing(2)
}));
//#endregion
//#region src/components/WindowSideBarAnnotationsPanel.jsx
function pl({ annotationCount: e, canvasIds: t = [], windowId: n, id: r }) {
let { t: i } = V(), a = wn();
return /* @__PURE__ */ B(dl, {
title: i("annotations"),
paperClassName: j("window-sidebar-annotation-panel"),
windowId: n,
id: r,
ref: a,
titleControls: /* @__PURE__ */ z(Xa, { windowId: n }),
children: [/* @__PURE__ */ z(fl, { children: /* @__PURE__ */ z(U, {
component: "p",
variant: "subtitle2",
children: i("showingNumAnnotations", {
count: e,
number: e
})
}) }), t.map((e, r) => /* @__PURE__ */ z(Os, {
canvasId: e,
containerRef: a,
index: r,
totalSize: t.length,
windowId: n
}, e))]
});
}
pl.propTypes = {
annotationCount: W.default.number.isRequired,
canvasIds: W.default.arrayOf(W.default.string),
id: W.default.string.isRequired,
windowId: W.default.string.isRequired
};
var ml = n(w((e, { windowId: t }) => ({
annotationCount: At(e, { windowId: t }).length,
canvasIds: at(e, { windowId: t })
}), null), m("WindowSideBarAnnotationsPanel"))(pl), hl = M(/*#__PURE__*/ z("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMore");
//#endregion
//#region src/components/CollapsibleSection.jsx
function gl({ children: e, id: t, label: n }) {
let { t: r } = V(), [i, a] = L(!0), o = kn((e, t) => {
a(t);
}, [a]);
return /* @__PURE__ */ B($n, {
slotProps: { heading: { component: "h4" } },
id: t,
elevation: 0,
expanded: i,
onChange: o,
disableGutters: !0,
square: !0,
variant: "compact",
children: [/* @__PURE__ */ z(tr, {
id: `${t}-header`,
"aria-controls": `${t}-content`,
"aria-label": r(i ? "collapseSection" : "expandSection", { section: n }),
expandIcon: /* @__PURE__ */ z(hl, {}),
children: /* @__PURE__ */ z(U, {
variant: "overline",
children: n
})
}), /* @__PURE__ */ z(er, { children: e })]
});
}
gl.propTypes = {
children: W.default.node.isRequired,
id: W.default.string.isRequired,
label: W.default.string.isRequired
};
//#endregion
//#region src/containers/CollapsibleSection.js
var _l = gl;
//#endregion
//#region src/components/LabelValueMetadata.jsx
function vl({ defaultLabel: e = void 0, labelValuePairs: t, labelValueJoiner: n = ", " }) {
return t.length === 0 ? null : /* @__PURE__ */ z("dl", {
className: j("label-value-metadata"),
children: t.reduce((t, r, i) => t.concat([/* @__PURE__ */ z(U, {
component: "dt",
variant: "subtitle2",
children: r.label || e
}, `label-${i}`), /* @__PURE__ */ z(U, {
style: {
marginBottom: ".5em",
marginLeft: "0px"
},
component: "dd",
variant: "body1",
children: /* @__PURE__ */ z(Cs, {
htmlString: r.values.join(n),
ruleSet: "iiif"
})
}, `value-${i}`)]), [])
});
}
vl.propTypes = {
defaultLabel: W.default.string,
labelValueJoiner: W.default.string,
labelValuePairs: W.default.arrayOf(W.default.shape({
label: W.default.string,
values: W.default.arrayOf(W.default.string)
})).isRequired
};
var yl = n(w((e) => ({ labelValueJoiner: et(e).labelValueJoiner })), m("LabelValueMetadata"))(vl);
//#endregion
//#region src/components/CanvasInfo.jsx
function bl({ canvasDescription: e = null, canvasLabel: t = null, canvasMetadata: n = [], index: r = 1, totalSize: i = 1 }) {
let { t: a } = V(), o = jn(), s = jn(), c = arguments[0];
return /* @__PURE__ */ B(_l, {
id: o,
label: a("currentItem", { context: `${r + 1}/${i}` }),
children: [
t && /* @__PURE__ */ z(U, {
"aria-labelledby": `${o} ${s}`,
id: s,
variant: "h4",
component: "h5",
children: t
}),
e && /* @__PURE__ */ z(U, {
variant: "body1",
children: /* @__PURE__ */ z(Cs, {
htmlString: e,
ruleSet: "iiif"
})
}),
n && n.length > 0 && /* @__PURE__ */ z(yl, { labelValuePairs: n }),
/* @__PURE__ */ z(on, {
targetName: "CanvasInfo",
...c
})
]
});
}
bl.propTypes = {
canvasDescription: W.default.string,
canvasLabel: W.default.string,
canvasMetadata: W.default.array,
index: W.default.number,
totalSize: W.default.number
};
var xl = n(w((e, { canvasId: t, companionWindowId: n, windowId: r }) => ({
canvasDescription: tt(e, {
canvasId: t,
companionWindowId: n,
windowId: r
}),
canvasLabel: Fe(e, {
canvasId: t,
companionWindowId: n,
windowId: r
}),
canvasMetadata: rt(e, {
canvasId: t,
companionWindowId: n,
windowId: r
})
})), m("CanvasInfo"))(bl), Sl = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
var n = Ie();
t.exports = k()(function(e, t, r) {
n(e, r, t);
});
})))(), 1);
function Cl({ availableLocales: e = [], locale: t = "", setLocale: n = void 0 }) {
let r = l((e) => Pe(e)), { t: i } = V();
if (!n || e.length < 2) return null;
let a = e.indexOf(t) >= 0 ? t : e[0], o = (0, Sl.default)(r, (e) => e.locale), s = (e) => {
try {
return new Intl.DisplayNames([a], { type: "language" }).of(e);
} catch {
return;
}
}, c = (e) => o[e]?.label || s(e) || e;
return /* @__PURE__ */ B(rr, {
variant: "standard",
children: [/* @__PURE__ */ z(nr, { children: i("language") }), /* @__PURE__ */ z(ir, {
MenuProps: { anchorOrigin: {
horizontal: "left",
vertical: "bottom"
} },
autoWidth: !0,
displayEmpty: !0,
value: a,
onChange: (e) => {
n(e.target.value);
},
name: "locale",
children: e.map((e) => /* @__PURE__ */ z(Jn, {
value: e,
children: /* @__PURE__ */ z(U, {
variant: "body2",
children: c(e)
})
}, e))
})]
});
}
Cl.propTypes = {
availableLocales: W.default.arrayOf(W.default.string),
locale: W.default.string,
setLocale: W.default.func
};
//#endregion
//#region src/containers/LocalePicker.js
var wl = Cl;
//#endregion
//#region src/components/ManifestInfo.jsx
function Tl({ manifestLabel: e = null, manifestMetadata: t = [], manifestSummary: n = null, ...r }) {
let { t: i } = V(), a = jn(), o = {
manifestLabel: e,
manifestMetadata: t,
manifestSummary: n,
...r
};
return /* @__PURE__ */ B(_l, {
id: `${a}-resource`,
label: i("resource"),
children: [
e && /* @__PURE__ */ z(U, {
"aria-labelledby": `${a}-resource ${a}-resource-heading`,
id: `${a}-resource-heading`,
variant: "h4",
component: "h5",
children: e
}),
n && /* @__PURE__ */ z(U, {
variant: "body1",
children: /* @__PURE__ */ z(Cs, {
htmlString: n,
ruleSet: "iiif"
})
}),
t.length > 0 && /* @__PURE__ */ z(yl, { labelValuePairs: t }),
/* @__PURE__ */ z(on, {
targetName: "ManifestInfo",
...o
})
]
});
}
Tl.propTypes = {
manifestLabel: W.default.string,
manifestMetadata: W.default.array,
manifestSummary: W.default.string
};
var El = n(w((e, { companionWindowId: t, manifestId: n, windowId: r }) => ({
manifestLabel: st(e, {
companionWindowId: t,
manifestId: n,
windowId: r
}),
manifestMetadata: ot(e, {
companionWindowId: t,
manifestId: n,
windowId: r
}),
manifestSummary: lt(e, {
companionWindowId: t,
manifestId: n,
windowId: r
})
})), m("ManifestInfo"))(Tl), Dl = M(/*#__PURE__*/ z("path", { d: "M3 14h4v-4H3zm0 5h4v-4H3zM3 9h4V5H3zm5 5h13v-4H8zm0 5h13v-4H8zM8 5v4h13V5z" }), "ViewListSharp");
//#endregion
//#region src/components/CollectionInfo.jsx
function Ol({ collectionLabel: e = null, collectionPath: t = [], showCollectionDialog: n, windowId: r = null }) {
let { t: i } = V(), a = jn(), o = jn();
return t.length === 0 ? null : /* @__PURE__ */ B(_l, {
id: a,
label: i("collection"),
children: [e && /* @__PURE__ */ z(U, {
"aria-labelledby": `${a} ${o}`,
id: o,
variant: "h4",
children: e
}), /* @__PURE__ */ z(ar, {
color: "primary",
onClick: () => {
let e = t[t.length - 1];
n(e, t.slice(0, -1), r);
},
startIcon: /* @__PURE__ */ z(Dl, {}),
children: i("showCollection")
})]
});
}
Ol.propTypes = {
collectionLabel: W.default.string,
collectionPath: W.default.arrayOf(W.default.string),
showCollectionDialog: W.default.func.isRequired,
windowId: W.default.string
};
var kl = n(w((e, { windowId: t }) => {
let { collectionPath: n } = s(e, { windowId: t }) || {}, r = n[n.length - 1];
return {
collectionLabel: st(e, { manifestId: r }),
collectionPath: n
};
}, { showCollectionDialog: $t }), m("CollectionInfo"))(Ol), Al = H("dl")(({ theme: e }) => ({ "& dd": {
marginBottom: ".5em",
marginLeft: "0"
} }));
function jl({ homepage: e = null, manifestUrl: t = null, related: n = null, renderings: r = null, seeAlso: i = null, ...a }) {
let { t: o } = V(), s = jn(), c = jn(), l = {
homepage: e,
manifestUrl: t,
related: n,
renderings: r,
seeAlso: i,
t: o,
...a
};
return /* @__PURE__ */ B(_l, {
"aria-labelledby": c,
id: s,
label: o("related"),
children: [
/* @__PURE__ */ z(U, {
"aria-labelledby": `${s} ${c}`,
id: c,
variant: "h4",
component: "h5",
children: o("links")
}),
/* @__PURE__ */ B(Al, {
className: (0, G.default)(j("label-value-metadata")),
children: [
e && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
variant: "subtitle2",
component: "dt",
children: o("iiif_homepage")
}), e.map((e) => /* @__PURE__ */ z(U, {
variant: "body1",
component: "dd",
children: /* @__PURE__ */ z(or, {
target: "_blank",
rel: "noopener noreferrer",
href: e.value,
children: e.label || e.value
})
}, e.value))] }),
r && r.length > 0 && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
variant: "subtitle2",
component: "dt",
children: o("iiif_renderings")
}), r.map((e) => /* @__PURE__ */ z(U, {
variant: "body1",
component: "dd",
children: /* @__PURE__ */ z(or, {
target: "_blank",
rel: "noopener noreferrer",
href: e.value,
children: e.label || e.value
})
}, e.value))] }),
n && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
variant: "subtitle2",
component: "dt",
children: o("iiif_related")
}), n.map((e) => /* @__PURE__ */ B(U, {
variant: "body1",
component: "dd",
children: [/* @__PURE__ */ z(or, {
target: "_blank",
rel: "noopener noreferrer",
href: e.value,
children: e.label || e.value
}), e.format && /* @__PURE__ */ z(U, {
component: "span",
children: ` (${e.format})`
})]
}, e.value))] }),
i && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
variant: "subtitle2",
component: "dt",
children: o("iiif_seeAlso")
}), i.map((e) => /* @__PURE__ */ B(U, {
variant: "body1",
component: "dd",
children: [/* @__PURE__ */ z(or, {
target: "_blank",
rel: "noopener noreferrer",
href: e.value,
children: e.label || e.value
}), e.format && /* @__PURE__ */ z(U, {
component: "span",
children: ` (${e.format})`
})]
}, e.value))] }),
t && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(U, {
variant: "subtitle2",
component: "dt",
children: o("iiif_manifest")
}), /* @__PURE__ */ z(U, {
variant: "body1",
component: "dd",
children: /* @__PURE__ */ z(or, {
target: "_blank",
rel: "noopener noreferrer",
href: t,
children: t
})
})] })
]
}),
/* @__PURE__ */ z(on, {
targetName: "ManifestRelatedLinks",
...l
})
]
});
}
jl.propTypes = {
homepage: W.default.arrayOf(W.default.shape({
label: W.default.string,
value: W.default.string
})),
manifestUrl: W.default.string,
related: W.default.arrayOf(W.default.shape({
format: W.default.string,
label: W.default.string,
value: W.default.string
})),
renderings: W.default.arrayOf(W.default.shape({
label: W.default.string,
value: W.default.string
})),
seeAlso: W.default.arrayOf(W.default.shape({
format: W.default.string,
label: W.default.string,
value: W.default.string
}))
};
var Ml = n(w((e, { companionWindowId: t, windowId: n }) => ({
homepage: ke(e, { windowId: n }),
manifestUrl: qe(e, { windowId: n }),
related: je(e, { windowId: n }),
renderings: Me(e, { windowId: n }),
seeAlso: ee(e, { windowId: n })
})), m("ManifestRelatedLinks"))(jl);
//#endregion
//#region src/components/WindowSideBarInfoPanel.jsx
function Nl({ windowId: e, id: t, canvasIds: n = [], collectionPath: r = [], locale: i = "", setLocale: a = void 0, availableLocales: o = [], showLocalePicker: s = !1 }) {
let { t: c } = V();
return /* @__PURE__ */ B(dl, {
title: c("aboutThisItem"),
paperClassName: j("window-sidebar-info-panel"),
windowId: e,
id: t,
titleControls: s && /* @__PURE__ */ z(wl, {
locale: i,
setLocale: a,
availableLocales: o
}),
children: [
n.map((r, i) => /* @__PURE__ */ z(fl, { children: /* @__PURE__ */ z(xl, {
canvasId: r,
companionWindowId: t,
index: i,
totalSize: n.length,
windowId: e
}) }, r)),
r.length > 0 && /* @__PURE__ */ z(fl, { children: /* @__PURE__ */ z(kl, {
companionWindowId: t,
windowId: e
}) }),
/* @__PURE__ */ z(fl, { children: /* @__PURE__ */ z(El, {
companionWindowId: t,
windowId: e
}) }),
/* @__PURE__ */ z(fl, { children: /* @__PURE__ */ z(Ml, {
companionWindowId: t,
windowId: e
}) })
]
});
}
Nl.propTypes = {
availableLocales: W.default.arrayOf(W.default.string),
canvasIds: W.default.arrayOf(W.default.string),
collectionPath: W.default.arrayOf(W.default.string),
id: W.default.string.isRequired,
locale: W.default.string,
setLocale: W.default.func,
showLocalePicker: W.default.bool,
windowId: W.default.string.isRequired
};
var Pl = n(w((e, { id: t, windowId: n }) => ({
availableLocales: it(e, {
companionWindowId: t,
windowId: n
}),
canvasIds: at(e, { windowId: n }),
collectionPath: (s(e, { windowId: n }) || {}).collectionPath,
locale: se(e, { companionWindowId: t }).locale || le(e, { windowId: n }),
showLocalePicker: Se(e, { windowId: n }).showLocalePicker
}), (e, { windowId: t, id: n }) => ({ setLocale: (r) => e(Mi(t, n, { locale: r })) })), m("WindowSideBarInfoPanel"))(Nl), Fl = M(/*#__PURE__*/ z("path", { d: "M3 15h18v-2H3zm0 4h18v-2H3zm0-8h18V9H3zm0-6v2h18V5z" }), "ReorderSharp"), Il = M(/*#__PURE__*/ z("path", { d: "M3 18h6v-2H3zM3 6v2h18V6zm0 7h12v-2H3z" }), "SortSharp"), Ll = M(/*#__PURE__*/ z("path", { d: "m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z" }), "ArrowForwardSharp");
//#endregion
//#region src/components/SidebarIndexItem.jsx
function Rl({ label: e }) {
return /* @__PURE__ */ z(U, {
variant: "body1",
children: e
});
}
Rl.propTypes = { label: W.default.string.isRequired };
var zl = n(w(null, null), m("SidebarIndexItem"))(Rl);
//#endregion
//#region src/components/SidebarIndexThumbnail.jsx
function Bl({ canvas: e, height: t = void 0, label: n, width: r = void 0 }) {
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z("div", {
style: { minWidth: 50 },
children: /* @__PURE__ */ z(un, {
label: n,
resource: e,
maxHeight: t,
maxWidth: r
})
}), /* @__PURE__ */ z(U, { children: n })] });
}
Bl.propTypes = {
canvas: W.default.object.isRequired,
height: W.default.number,
label: W.default.string.isRequired,
width: W.default.number
};
var Vl = n(w((e, { data: t }) => ({ ...et(e).canvasNavigation || {} }), null), m("SidebarIndexThumbnail"))(Bl), Hl = H(Jn, {
name: "SidebarIndexList",
slot: "item"
})(({ theme: e }) => ({
alignItems: "flex-start",
gap: e.spacing(1),
paddingLeft: e.spacing(2),
paddingRight: e.spacing(1),
position: "initial",
whiteSpace: "normal"
}));
function Ul(e) {
return e.map((e) => ({
id: e.id,
label: new gt(e).getLabel()
}));
}
function Wl({ canvases: e, containerRef: t, selectedCanvasIds: n = [], setCanvas: r, variant: i = "item", windowId: a }) {
let o = Pn(() => Ul(e), [e]), s;
switch (i) {
case "thumbnail":
s = Vl;
break;
default: s = zl;
}
return /* @__PURE__ */ z(qn, {
variant: "selectedMenu",
children: o.map((o, c) => /* @__PURE__ */ z(Es, {
containerRef: t,
offsetTop: 96,
selected: n.includes(o.id),
scrollTo: n.includes(o.id),
children: /* @__PURE__ */ z(Hl, {
divider: !0,
onClick: () => {
r(a, o.id);
},
component: "li",
children: /* @__PURE__ */ z(s, {
label: o.label,
canvas: e[c]
})
}, o.id)
}, `${o.id}-${i}`))
});
}
Wl.propTypes = {
canvases: W.default.array.isRequired,
containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]).isRequired,
selectedCanvasIds: W.default.arrayOf(W.default.string),
setCanvas: W.default.func.isRequired,
variant: W.default.oneOf(["item", "thumbnail"]),
windowId: W.default.string.isRequired
};
var Gl = n(w((e, { id: t, windowId: n }) => ({
canvases: ct(e, { windowId: n }),
selectedCanvasIds: at(e, { windowId: n }),
variant: se(e, {
companionWindowId: t,
windowId: n
}).variant
}), (e, { id: t, windowId: n }) => ({ setCanvas: (...t) => e(tn(...t)) })), m("SidebarIndexList"))(Wl);
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/extends.js
function q() {
return q = Object.assign ? Object.assign.bind() : function(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t];
for (var r in n) ({}).hasOwnProperty.call(n, r) && (e[r] = n[r]);
}
return e;
}, q.apply(null, arguments);
}
//#endregion
//#region node_modules/@mui/utils/esm/composeClasses/composeClasses.js
function Kl(e, t, n = void 0) {
let r = {};
for (let i in e) {
let a = e[i], o = "", s = !0;
for (let e = 0; e < a.length; e += 1) {
let r = a[e];
r && (o += (s === !0 ? "" : " ") + t(r), s = !1, n && n[r] && (o += " " + n[r]));
}
r[i] = o;
}
return r;
}
//#endregion
//#region node_modules/@mui/utils/esm/useForkRef/useForkRef.js
function ql(...e) {
let t = N.useRef(void 0), n = N.useCallback((t) => {
let n = e.map((e) => {
if (e == null) return null;
if (typeof e == "function") {
let n = e, r = n(t);
return typeof r == "function" ? r : () => {
n(null);
};
}
return e.current = t, () => {
e.current = null;
};
});
return () => {
n.forEach((e) => e?.());
};
}, e);
return N.useMemo(() => e.every((e) => e == null) ? null : (e) => {
t.current &&= (t.current(), void 0), e != null && (t.current = n(e));
}, e);
}
//#endregion
//#region node_modules/@mui/utils/esm/isHostComponent/isHostComponent.js
function Jl(e) {
return typeof e == "string";
}
//#endregion
//#region node_modules/@mui/utils/esm/appendOwnerState/appendOwnerState.js
function Yl(e, t, n) {
return e === void 0 || Jl(e) ? t : {
...t,
ownerState: {
...t.ownerState,
...n
}
};
}
//#endregion
//#region node_modules/@mui/utils/esm/extractEventHandlers/extractEventHandlers.js
function Xl(e, t = []) {
if (e === void 0) return {};
let n = {};
return Object.keys(e).filter((n) => n.match(/^on[A-Z]/) && typeof e[n] == "function" && !t.includes(n)).forEach((t) => {
n[t] = e[t];
}), n;
}
//#endregion
//#region node_modules/@mui/utils/esm/omitEventHandlers/omitEventHandlers.js
function Zl(e) {
if (e === void 0) return {};
let t = {};
return Object.keys(e).filter((t) => !(t.match(/^on[A-Z]/) && typeof e[t] == "function")).forEach((n) => {
t[n] = e[n];
}), t;
}
//#endregion
//#region node_modules/@mui/utils/esm/mergeSlotProps/mergeSlotProps.js
function Ql(e) {
let { getSlotProps: t, additionalProps: n, externalSlotProps: r, externalForwardedProps: i, className: a } = e;
if (!t) {
let e = Ns(n?.className, a, i?.className, r?.className), t = {
...n?.style,
...i?.style,
...r?.style
}, o = {
...n,
...i,
...r
};
return e.length > 0 && (o.className = e), Object.keys(t).length > 0 && (o.style = t), {
props: o,
internalRef: void 0
};
}
let o = Xl({
...i,
...r
}), s = Zl(r), c = Zl(i), l = t(o), u = Ns(l?.className, n?.className, a, i?.className, r?.className), d = {
...l?.style,
...n?.style,
...i?.style,
...r?.style
}, f = {
...l,
...n,
...c,
...s
};
return u.length > 0 && (f.className = u), Object.keys(d).length > 0 && (f.style = d), {
props: f,
internalRef: l.ref
};
}
//#endregion
//#region node_modules/@mui/utils/esm/resolveComponentProps/resolveComponentProps.js
function $l(e, t, n) {
return typeof e == "function" ? e(t, n) : e;
}
//#endregion
//#region node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js
function eu(e) {
let { elementType: t, externalSlotProps: n, ownerState: r, skipResolvingSlotProps: i = !1, ...a } = e, o = i ? {} : $l(n, r), { props: s, internalRef: c } = Ql({
...a,
externalSlotProps: o
}), l = ql(c, o?.ref, e.additionalProps?.ref);
return Yl(t, {
...s,
ref: l
}, r);
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/zero-styled/index.js
function tu(e) {
return Vn;
}
//#endregion
//#region node_modules/@mui/utils/esm/ClassNameGenerator/ClassNameGenerator.js
var nu = (e) => e, ru = (() => {
let e = nu;
return {
configure(t) {
e = t;
},
generate(t) {
return e(t);
},
reset() {
e = nu;
}
};
})(), iu = {
active: "active",
checked: "checked",
completed: "completed",
disabled: "disabled",
error: "error",
expanded: "expanded",
focused: "focused",
focusVisible: "focusVisible",
open: "open",
readOnly: "readOnly",
required: "required",
selected: "selected"
};
function au(e, t, n = "Mui") {
let r = iu[t];
return r ? `${n}-${r}` : `${ru.generate(e)}-${t}`;
}
//#endregion
//#region node_modules/@mui/utils/esm/generateUtilityClasses/generateUtilityClasses.js
function ou(e, t, n = "Mui") {
let r = {};
return t.forEach((t) => {
r[t] = au(e, t, n);
}), r;
}
//#endregion
//#region node_modules/@mui/x-tree-view/SimpleTreeView/simpleTreeViewClasses.js
function su(e) {
return au("MuiSimpleTreeView", e);
}
ou("MuiSimpleTreeView", ["root"]);
//#endregion
//#region node_modules/@mui/x-tree-view/internals/useTreeView/useTreeViewModels.js
var cu = (e, t) => {
let n = N.useRef({}), [r, i] = N.useState(() => {
let r = {};
return e.forEach((e) => {
e.models && Object.entries(e.models).forEach(([e, i]) => {
n.current[e] = {
isControlled: t[e] !== void 0,
getDefaultValue: i.getDefaultValue
}, r[e] = i.getDefaultValue(t);
});
}), r;
});
return Object.fromEntries(Object.entries(n.current).map(([e, n]) => [e, {
value: t[e] ?? r[e],
setControlledValue: (t) => {
n.isControlled || i((n) => q({}, n, { [e]: t }));
}
}]));
}, lu = class {
constructor() {
this.maxListeners = 20, this.warnOnce = !1, this.events = {};
}
on(e, t, n = {}) {
let r = this.events[e];
r || (r = {
highPriority: /* @__PURE__ */ new Map(),
regular: /* @__PURE__ */ new Map()
}, this.events[e] = r), n.isFirst ? r.highPriority.set(t, !0) : r.regular.set(t, !0);
}
removeListener(e, t) {
this.events[e] && (this.events[e].regular.delete(t), this.events[e].highPriority.delete(t));
}
removeAllListeners() {
this.events = {};
}
emit(e, ...t) {
let n = this.events[e];
if (!n) return;
let r = Array.from(n.highPriority.keys()), i = Array.from(n.regular.keys());
for (let e = r.length - 1; e >= 0; --e) {
let i = r[e];
n.highPriority.has(i) && i.apply(this, t);
}
for (let e = 0; e < i.length; e += 1) {
let r = i[e];
n.regular.has(r) && r.apply(this, t);
}
}
once(e, t) {
let n = this;
this.on(e, function r(...i) {
n.removeListener(e, r), t.apply(n, i);
});
}
}, uu = (e) => e.isPropagationStopped !== void 0, du = () => {
let [e] = N.useState(() => new lu());
return { instance: {
$$publishEvent: N.useCallback((...t) => {
let [n, r, i = {}] = t;
i.defaultMuiPrevented = !1, !(uu(i) && i.isPropagationStopped()) && e.emit(n, r, i);
}, [e]),
$$subscribeEvent: N.useCallback((t, n) => (e.on(t, n), () => {
e.removeListener(t, n);
}), [e])
} };
};
du.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/corePlugins/useTreeViewOptionalPlugins/useTreeViewOptionalPlugins.js
var fu = ({ plugins: e }) => {
let t = new Set(e);
return { instance: { getAvailablePlugins: () => t } };
};
fu.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/corePlugins/useTreeViewId/useTreeViewId.utils.js
var pu = 0, mu = () => (pu += 1, `mui-tree-view-${pu}`), hu = ({ id: e, treeId: t = "", itemId: n }) => e ?? `${t}-${n}`, gu = ({ params: e, state: t, setState: n }) => {
N.useEffect(() => {
n((t) => t.id.treeId === e.id && t.id.treeId !== void 0 ? t : q({}, t, { id: q({}, t.id, { treeId: e.id ?? mu() }) }));
}, [n, e.id]);
let r = e.id ?? t.id.treeId;
return {
getRootProps: () => ({ id: r }),
contextValue: { treeId: r }
};
};
gu.params = { id: !0 }, gu.getInitialState = ({ id: e }) => ({ id: { treeId: e ?? void 0 } });
//#endregion
//#region node_modules/@mui/x-tree-view/internals/corePlugins/corePlugins.js
var _u = [
du,
fu,
gu
];
//#endregion
//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
function vu(e, t) {
if (e == null) return {};
var n = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
if (t.indexOf(r) !== -1) continue;
n[r] = e[r];
}
return n;
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/useTreeView/extractPluginParamsFromProps.js
var yu = [
"slots",
"slotProps",
"apiRef",
"experimentalFeatures"
], bu = (e) => {
let { props: { slots: t, slotProps: n, apiRef: r, experimentalFeatures: i }, plugins: a } = e, o = vu(e.props, yu), s = {};
a.forEach((e) => {
Object.assign(s, e.params);
});
let c = {}, l = {};
Object.keys(o).forEach((e) => {
let t = o[e];
s[e] ? c[e] = t : l[e] = t;
});
let u = i ?? {};
return {
apiRef: r,
forwardedProps: l,
pluginParams: a.reduce((e, t) => t.getDefaultizedParams ? t.getDefaultizedParams({
params: e,
experimentalFeatures: u
}) : e, c),
slots: t ?? {},
slotProps: n ?? {},
experimentalFeatures: u
};
}, xu = ({ plugins: e, instance: t, publicAPI: n, rootRef: r }) => ({
runItemPlugins: (t) => {
let n = null, r = null, i = [], a = {};
e.forEach((e) => {
if (!e.itemPlugin) return;
let o = e.itemPlugin({
props: t,
rootRef: n,
contentRef: r
});
o?.rootRef && (n = o.rootRef), o?.contentRef && (r = o.contentRef), o?.propsEnhancers && (i.push(o.propsEnhancers), Object.keys(o.propsEnhancers).forEach((e) => {
a[e] = !0;
}));
});
let o = (e) => (t) => {
let n = {};
return i.forEach((r) => {
let i = r[e];
i != null && Object.assign(n, i(t));
}), n;
}, s = Object.fromEntries(Object.keys(a).map((e) => [e, o(e)]));
return {
contentRef: r,
rootRef: n,
propsEnhancers: s
};
},
wrapItem: ({ itemId: n, children: r }) => {
let i = r;
for (let r = e.length - 1; r >= 0; --r) {
let a = e[r];
a.wrapItem && (i = a.wrapItem({
itemId: n,
children: i,
instance: t
}));
}
return i;
},
wrapRoot: ({ children: n }) => {
let r = n;
for (let n = e.length - 1; n >= 0; --n) {
let i = e[n];
i.wrapRoot && (r = i.wrapRoot({
children: r,
instance: t
}));
}
return r;
},
instance: t,
rootRef: r,
publicAPI: n
});
//#endregion
//#region node_modules/@mui/x-tree-view/internals/useTreeView/useTreeView.js
function Su(e) {
let t = N.useRef({});
return e ? (e.current ??= {}, e.current) : t.current;
}
var Cu = ({ plugins: e, rootRef: t, props: n }) => {
let r = [..._u, ...e], { pluginParams: i, forwardedProps: a, apiRef: o, experimentalFeatures: s, slots: c, slotProps: l } = bu({
plugins: r,
props: n
}), u = cu(r, i), d = N.useRef({}).current, f = Su(o), p = N.useRef(null), m = ql(p, t), h = xu({
plugins: r,
instance: d,
publicAPI: f,
rootRef: p
}), [g, _] = N.useState(() => {
let e = {};
return r.forEach((t) => {
t.getInitialState && Object.assign(e, t.getInitialState(i));
}), e;
}), v = [];
return r.forEach((e) => {
let t = e({
instance: d,
params: i,
slots: c,
slotProps: l,
experimentalFeatures: s,
state: g,
setState: _,
rootRef: p,
models: u,
plugins: r
});
t.getRootProps && v.push(t.getRootProps), t.publicAPI && Object.assign(f, t.publicAPI), t.instance && Object.assign(d, t.instance), t.contextValue && Object.assign(h, t.contextValue);
}), {
getRootProps: (e = {}) => {
let t = q({ role: "tree" }, a, e, { ref: m });
return v.forEach((n) => {
Object.assign(t, n(e));
}), t;
},
rootRef: m,
contextValue: h,
instance: d
};
}, wu = /*#__PURE__*/ N.createContext(null);
//#endregion
//#region node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewProvider.js
function Tu(e) {
let { value: t, children: n } = e;
return /*#__PURE__*/ z(wu.Provider, {
value: t,
children: t.wrapRoot({
children: n,
instance: t.instance
})
});
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/TreeViewProvider/useTreeViewContext.js
var Eu = () => {
let e = N.useContext(wu);
if (e == null) throw Error([
"MUI X: Could not find the Tree View context.",
"It looks like you rendered your component outside of a SimpleTreeView or RichTreeView parent component.",
"This can also happen if you are bundling multiple versions of the Tree View."
].join("\n"));
return e;
}, Du = (e, t, n) => {
e.$$publishEvent(t, n);
}, Ou = "__TREE_VIEW_ROOT_PARENT_ID__", ku = (e) => {
let t = {};
return e.forEach((e, n) => {
t[e] = n;
}), t;
}, Au = /*#__PURE__*/ N.createContext(() => -1), ju = ["children"], Mu = ({ items: e, isItemDisabled: t, getItemLabel: n, getItemId: r }) => {
let i = {}, a = {}, o = { [Ou]: [] }, s = (e, c, l) => {
let u = r ? r(e) : e.id;
if (u == null) throw Error([
"MUI X: The Tree View component requires all items to have a unique `id` property.",
"Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",
"An item was provided without id in the `items` prop:",
JSON.stringify(e)
].join("\n"));
if (i[u] != null) throw Error([
"MUI X: The Tree View component requires all items to have a unique `id` property.",
"Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",
`Two items were provided with the same id in the \`items\` prop: "${u}"`
].join("\n"));
let d = n ? n(e) : e.label;
if (d == null) throw Error([
"MUI X: The Tree View component requires all items to have a `label` property.",
"Alternatively, you can use the `getItemLabel` prop to specify a custom label for each item.",
"An item was provided without label in the `items` prop:",
JSON.stringify(e)
].join("\n"));
i[u] = {
id: u,
label: d,
parentId: l,
idAttribute: void 0,
expandable: !!e.children?.length,
disabled: t ? t(e) : !1,
depth: c
}, a[u] = e;
let f = l ?? "__TREE_VIEW_ROOT_PARENT_ID__";
o[f] || (o[f] = []), o[f].push(u), e.children?.forEach((e) => s(e, c + 1, u));
};
e.forEach((e) => s(e, 0, null));
let c = {};
return Object.keys(o).forEach((e) => {
c[e] = ku(o[e]);
}), {
itemMetaMap: i,
itemMap: a,
itemOrderedChildrenIds: o,
itemChildrenIndexes: c
};
}, Nu = ({ instance: e, params: t, state: n, setState: r, experimentalFeatures: i }) => {
let a = N.useCallback((e) => n.items.itemMetaMap[e], [n.items.itemMetaMap]), o = N.useCallback((e) => n.items.itemMap[e], [n.items.itemMap]), s = N.useCallback(() => {
let e = (t) => {
let r = n.items.itemMap[t], i = vu(r, ju), a = n.items.itemOrderedChildrenIds[t];
return a && (i.children = a.map(e)), i;
};
return n.items.itemOrderedChildrenIds[Ou].map(e);
}, [n.items.itemMap, n.items.itemOrderedChildrenIds]), c = N.useCallback((t) => {
if (t == null) return !1;
let n = e.getItemMeta(t);
if (!n) return !1;
if (n.disabled) return !0;
for (; n.parentId != null;) if (n = e.getItemMeta(n.parentId), n.disabled) return !0;
return !1;
}, [e]), l = N.useCallback((t) => {
let r = e.getItemMeta(t).parentId ?? "__TREE_VIEW_ROOT_PARENT_ID__";
return n.items.itemChildrenIndexes[r][t];
}, [e, n.items.itemChildrenIndexes]), u = N.useCallback((e) => n.items.itemOrderedChildrenIds[e ?? "__TREE_VIEW_ROOT_PARENT_ID__"] ?? [], [n.items.itemOrderedChildrenIds]), d = (t) => {
let r = e.getItemMeta(t);
return r == null ? null : document.getElementById(hu({
treeId: n.id.treeId,
itemId: t,
id: r.idAttribute
}));
}, f = (n) => t.disabledItemsFocusable ? !0 : !e.isItemDisabled(n), p = N.useRef(!1), m = N.useCallback(() => {
p.current = !0;
}, []), h = N.useCallback(() => p.current, []);
return N.useEffect(() => {
e.areItemUpdatesPrevented() || r((n) => {
let r = Mu({
items: t.items,
isItemDisabled: t.isItemDisabled,
getItemId: t.getItemId,
getItemLabel: t.getItemLabel
});
return Object.values(n.items.itemMetaMap).forEach((t) => {
r.itemMetaMap[t.id] || Du(e, "removeItem", { id: t.id });
}), q({}, n, { items: r });
});
}, [
e,
r,
t.items,
t.isItemDisabled,
t.getItemId,
t.getItemLabel
]), {
getRootProps: () => ({ style: { "--TreeView-itemChildrenIndentation": typeof t.itemChildrenIndentation == "number" ? `${t.itemChildrenIndentation}px` : t.itemChildrenIndentation } }),
publicAPI: {
getItem: o,
getItemDOMElement: d,
getItemTree: s,
getItemOrderedChildrenIds: u
},
instance: {
getItemMeta: a,
getItem: o,
getItemTree: s,
getItemsToRender: () => {
let e = (t) => {
let r = n.items.itemMetaMap[t];
return {
label: r.label,
itemId: r.id,
id: r.idAttribute,
children: n.items.itemOrderedChildrenIds[t]?.map(e)
};
};
return n.items.itemOrderedChildrenIds[Ou].map(e);
},
getItemIndex: l,
getItemDOMElement: d,
getItemOrderedChildrenIds: u,
isItemDisabled: c,
isItemNavigable: f,
preventItemUpdates: m,
areItemUpdatesPrevented: h
},
contextValue: { items: {
onItemClick: t.onItemClick,
disabledItemsFocusable: t.disabledItemsFocusable,
indentationAtItemLevel: i.indentationAtItemLevel ?? !1
} }
};
};
Nu.getInitialState = (e) => ({ items: Mu({
items: e.items,
isItemDisabled: e.isItemDisabled,
getItemId: e.getItemId,
getItemLabel: e.getItemLabel
}) }), Nu.getDefaultizedParams = ({ params: e }) => q({}, e, {
disabledItemsFocusable: e.disabledItemsFocusable ?? !1,
itemChildrenIndentation: e.itemChildrenIndentation ?? "12px"
}), Nu.wrapRoot = ({ children: e, instance: t }) => /*#__PURE__*/ z(Au.Provider, {
value: (e) => t.getItemMeta(e)?.depth ?? 0,
children: e
}), Nu.params = {
disabledItemsFocusable: !0,
items: !0,
isItemDisabled: !0,
getItemLabel: !0,
getItemId: !0,
onItemClick: !0,
itemChildrenIndentation: !0
};
//#endregion
//#region node_modules/@mui/utils/esm/useEnhancedEffect/useEnhancedEffect.js
var Pu = typeof window < "u" ? N.useLayoutEffect : N.useEffect;
//#endregion
//#region node_modules/@mui/utils/esm/useEventCallback/useEventCallback.js
function Fu(e) {
let t = N.useRef(e);
return Pu(() => {
t.current = e;
}), N.useRef((...e) => (0, t.current)(...e)).current;
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewExpansion/useTreeViewExpansion.js
var Iu = ({ instance: e, params: t, models: n }) => {
let r = N.useMemo(() => {
let e = /* @__PURE__ */ new Map();
return n.expandedItems.value.forEach((t) => {
e.set(t, !0);
}), e;
}, [n.expandedItems.value]), i = (e, r) => {
t.onExpandedItemsChange?.(e, r), n.expandedItems.setControlledValue(r);
}, a = N.useCallback((e) => r.has(e), [r]), o = N.useCallback((t) => !!e.getItemMeta(t)?.expandable, [e]), s = Fu((t, n) => {
let r = e.isItemExpanded(n);
e.setItemExpansion(t, n, !r);
}), c = Fu((r, a, o) => {
if (e.isItemExpanded(a) === o) return;
let s;
s = o ? [a].concat(n.expandedItems.value) : n.expandedItems.value.filter((e) => e !== a), t.onItemExpansionToggle && t.onItemExpansionToggle(r, a, o), i(r, s);
}), l = (r, a) => {
let o = e.getItemMeta(a), s = e.getItemOrderedChildrenIds(o.parentId).filter((t) => e.isItemExpandable(t) && !e.isItemExpanded(t)), c = n.expandedItems.value.concat(s);
s.length > 0 && (t.onItemExpansionToggle && s.forEach((e) => {
t.onItemExpansionToggle(r, e, !0);
}), i(r, c));
}, u = N.useMemo(() => t.expansionTrigger ? t.expansionTrigger : e.isTreeViewEditable ? "iconContainer" : "content", [t.expansionTrigger, e.isTreeViewEditable]);
return {
publicAPI: { setItemExpansion: c },
instance: {
isItemExpanded: a,
isItemExpandable: o,
setItemExpansion: c,
toggleItemExpansion: s,
expandAllSiblings: l
},
contextValue: { expansion: { expansionTrigger: u } }
};
};
Iu.models = { expandedItems: { getDefaultValue: (e) => e.defaultExpandedItems } };
var Lu = [];
Iu.getDefaultizedParams = ({ params: e }) => q({}, e, { defaultExpandedItems: e.defaultExpandedItems ?? Lu }), Iu.params = {
expandedItems: !0,
defaultExpandedItems: !0,
onExpandedItemsChange: !0,
onItemExpansionToggle: !0,
expansionTrigger: !0
};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/utils/tree.js
var Ru = (e, t) => {
let n = t.length - 1;
for (; n >= 0 && !e.isItemNavigable(t[n]);) --n;
if (n !== -1) return t[n];
}, zu = (e, t) => {
let n = e.getItemMeta(t), r = e.getItemOrderedChildrenIds(n.parentId), i = e.getItemIndex(t);
if (i === 0) return n.parentId;
let a = i - 1;
for (; !e.isItemNavigable(r[a]) && a >= 0;) --a;
if (a === -1) return n.parentId == null ? null : zu(e, n.parentId);
let o = r[a], s = Ru(e, e.getItemOrderedChildrenIds(o));
for (; e.isItemExpanded(o) && s != null;) o = s, s = e.getItemOrderedChildrenIds(o).find(e.isItemNavigable);
return o;
}, Bu = (e, t) => {
if (e.isItemExpanded(t)) {
let n = e.getItemOrderedChildrenIds(t).find(e.isItemNavigable);
if (n != null) return n;
}
let n = e.getItemMeta(t);
for (; n != null;) {
let t = e.getItemOrderedChildrenIds(n.parentId), r = e.getItemIndex(n.id);
if (r < t.length - 1) {
let n = r + 1;
for (; !e.isItemNavigable(t[n]) && n < t.length - 1;) n += 1;
if (e.isItemNavigable(t[n])) return t[n];
}
n = e.getItemMeta(n.parentId);
}
return null;
}, Vu = (e) => {
let t = null;
for (; t == null || e.isItemExpanded(t);) {
let n = Ru(e, e.getItemOrderedChildrenIds(t));
if (n == null) return t;
t = n;
}
return t;
}, Hu = (e) => e.getItemOrderedChildrenIds(null).find(e.isItemNavigable), Uu = (e, t, n) => {
if (t === n) return [t, n];
let r = e.getItemMeta(t), i = e.getItemMeta(n);
if (r.parentId === i.id || i.parentId === r.id) return i.parentId === r.id ? [r.id, i.id] : [i.id, r.id];
let a = [r.id], o = [i.id], s = r.parentId, c = i.parentId, l = o.indexOf(s) !== -1, u = a.indexOf(c) !== -1, d = !0, f = !0;
for (; !u && !l;) d && (a.push(s), l = o.indexOf(s) !== -1, d = s !== null, !l && d && (s = e.getItemMeta(s).parentId)), f && !l && (o.push(c), u = a.indexOf(c) !== -1, f = c !== null, !u && f && (c = e.getItemMeta(c).parentId));
let p = l ? s : c, m = e.getItemOrderedChildrenIds(p), h = a[a.indexOf(p) - 1], g = o[o.indexOf(p) - 1];
return m.indexOf(h) < m.indexOf(g) ? [t, n] : [n, t];
}, Wu = (e, t, n) => {
let r = (t) => {
if (e.isItemExpandable(t) && e.isItemExpanded(t)) return e.getItemOrderedChildrenIds(t)[0];
let n = e.getItemMeta(t);
for (; n != null;) {
let t = e.getItemOrderedChildrenIds(n.parentId), r = e.getItemIndex(n.id);
if (r < t.length - 1) return t[r + 1];
n = e.getItemMeta(n.parentId);
}
throw Error("Invalid range");
}, [i, a] = Uu(e, t, n), o = [i], s = i;
for (; s !== a;) s = r(s), e.isItemDisabled(s) || o.push(s);
return o;
}, Gu = (e) => {
let t = Hu(e), n = [];
for (; t != null;) n.push(t), t = Bu(e, t);
return n;
}, Ku = (e, t) => t !== e.closest("*[role=\"treeitem\"]"), qu = (e) => Array.isArray(e) ? e : e == null ? [] : [e], Ju = (e) => {
let t = {};
return e.forEach((e) => {
t[e] = !0;
}), t;
}, Yu = ({ instance: e, params: t, models: n }) => {
let r = N.useRef(null), i = N.useRef({}), a = N.useMemo(() => {
let e = /* @__PURE__ */ new Map();
return Array.isArray(n.selectedItems.value) ? n.selectedItems.value.forEach((t) => {
e.set(t, !0);
}) : n.selectedItems.value != null && e.set(n.selectedItems.value, !0), e;
}, [n.selectedItems.value]), o = (r, i) => {
if (t.onItemSelectionToggle) {
if (t.multiSelect) {
let a = i.filter((t) => !e.isItemSelected(t)), o = n.selectedItems.value.filter((e) => !i.includes(e));
a.forEach((e) => {
t.onItemSelectionToggle(r, e, !0);
}), o.forEach((e) => {
t.onItemSelectionToggle(r, e, !1);
});
} else i !== n.selectedItems.value && (n.selectedItems.value != null && t.onItemSelectionToggle(r, n.selectedItems.value, !1), i != null && t.onItemSelectionToggle(r, i, !0));
}
t.onSelectedItemsChange && t.onSelectedItemsChange(r, i), n.selectedItems.setControlledValue(i);
}, s = (e) => a.has(e), c = ({ event: a, itemId: s, keepExistingSelection: c = !1, shouldBeSelected: l }) => {
if (t.disableSelection) return;
let u;
if (c) {
let t = qu(n.selectedItems.value), r = e.isItemSelected(s);
u = r && (l === !1 || l == null) ? t.filter((e) => e !== s) : !r && (l === !0 || l == null) ? [s].concat(t) : t;
} else u = l === !1 || l == null && e.isItemSelected(s) ? t.multiSelect ? [] : null : t.multiSelect ? [s] : s;
o(a, u), r.current = s, i.current = {};
}, l = (r, [a, s]) => {
if (t.disableSelection || !t.multiSelect) return;
let c = qu(n.selectedItems.value).slice();
Object.keys(i.current).length > 0 && (c = c.filter((e) => !i.current[e]));
let l = Ju(c), u = Wu(e, a, s), d = u.filter((e) => !l[e]);
c = c.concat(d), o(r, c), i.current = Ju(u);
};
return {
getRootProps: () => ({ "aria-multiselectable": t.multiSelect }),
publicAPI: { selectItem: c },
instance: {
isItemSelected: s,
selectItem: c,
selectAllNavigableItems: (n) => {
if (t.disableSelection || !t.multiSelect) return;
let r = Gu(e);
o(n, r), i.current = Ju(r);
},
expandSelectionRange: (t, n) => {
if (r.current != null) {
let [i, a] = Uu(e, n, r.current);
l(t, [i, a]);
}
},
selectRangeFromStartToItem: (t, n) => {
l(t, [Hu(e), n]);
},
selectRangeFromItemToEnd: (t, n) => {
l(t, [n, Vu(e)]);
},
selectItemFromArrowNavigation: (e, r, a) => {
if (t.disableSelection || !t.multiSelect) return;
let s = qu(n.selectedItems.value).slice();
Object.keys(i.current).length === 0 ? (s.push(a), i.current = {
[r]: !0,
[a]: !0
}) : (i.current[r] || (i.current = {}), i.current[a] ? (s = s.filter((e) => e !== r), delete i.current[r]) : (s.push(a), i.current[a] = !0)), o(e, s);
}
},
contextValue: { selection: {
multiSelect: t.multiSelect,
checkboxSelection: t.checkboxSelection,
disableSelection: t.disableSelection
} }
};
};
Yu.models = { selectedItems: { getDefaultValue: (e) => e.defaultSelectedItems } };
var Xu = [];
Yu.getDefaultizedParams = ({ params: e }) => q({}, e, {
disableSelection: e.disableSelection ?? !1,
multiSelect: e.multiSelect ?? !1,
checkboxSelection: e.checkboxSelection ?? !1,
defaultSelectedItems: e.defaultSelectedItems ?? (e.multiSelect ? Xu : null)
}), Yu.params = {
disableSelection: !0,
multiSelect: !0,
checkboxSelection: !0,
defaultSelectedItems: !0,
selectedItems: !0,
onSelectedItemsChange: !0,
onItemSelectionToggle: !0
};
//#endregion
//#region node_modules/@mui/utils/esm/ownerDocument/ownerDocument.js
function Zu(e) {
return e && e.ownerDocument || document;
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/utils/cleanupTracking/TimerBasedCleanupTracking.js
var Qu = 1e3, $u = class {
constructor(e = Qu) {
this.timeouts = /* @__PURE__ */ new Map(), this.cleanupTimeout = Qu, this.cleanupTimeout = e;
}
register(e, t, n) {
this.timeouts ||= /* @__PURE__ */ new Map();
let r = setTimeout(() => {
typeof t == "function" && t(), this.timeouts.delete(n.cleanupToken);
}, this.cleanupTimeout);
this.timeouts.set(n.cleanupToken, r);
}
unregister(e) {
let t = this.timeouts.get(e.cleanupToken);
t && (this.timeouts.delete(e.cleanupToken), clearTimeout(t));
}
reset() {
this.timeouts &&= (this.timeouts.forEach((e, t) => {
this.unregister({ cleanupToken: t });
}), void 0);
}
}, ed = class {
constructor() {
this.registry = new FinalizationRegistry((e) => {
typeof e == "function" && e();
});
}
register(e, t, n) {
this.registry.register(e, t, n);
}
unregister(e) {
this.registry.unregister(e);
}
reset() {}
}, td = class {};
function nd(e) {
let t = 0;
return function(n, r, i) {
e.registry === null && (e.registry = typeof FinalizationRegistry < "u" ? new ed() : new $u());
let [a] = N.useState(new td()), o = N.useRef(null), s = N.useRef(void 0);
s.current = i;
let c = N.useRef(null);
!o.current && s.current ? (o.current = n.$$subscribeEvent(r, (e, t) => {
t.defaultMuiPrevented || s.current?.(e, t);
}), t += 1, c.current = { cleanupToken: t }, e.registry.register(a, () => {
o.current?.(), o.current = null, c.current = null;
}, c.current)) : !s.current && o.current && (o.current(), o.current = null, c.current &&= (e.registry.unregister(c.current), null)), N.useEffect(() => (!o.current && s.current && (o.current = n.$$subscribeEvent(r, (e, t) => {
t.defaultMuiPrevented || s.current?.(e, t);
})), c.current && e.registry && (e.registry.unregister(c.current), c.current = null), () => {
o.current?.(), o.current = null;
}), [n, r]);
};
}
var rd = nd({ registry: null }), id = (e = document) => {
let t = e.activeElement;
return t ? t.shadowRoot ? id(t.shadowRoot) : t : null;
};
function ad(e) {
return e.replace(/["\\]/g, "\\$&");
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewFocus/useTreeViewFocus.js
var od = (e, t) => {
let n = qu(t).find((t) => {
if (!e.isItemNavigable(t)) return !1;
let n = e.getItemMeta(t);
return n && (n.parentId == null || e.isItemExpanded(n.parentId));
});
return n ??= Hu(e), n;
}, sd = ({ instance: e, params: t, state: n, setState: r, models: i, rootRef: a }) => {
let o = od(e, i.selectedItems.value), s = Fu((e) => {
let t = typeof e == "function" ? e(n.focusedItemId) : e;
n.focusedItemId !== t && r((e) => q({}, e, { focusedItemId: t }));
}), c = N.useCallback(() => !!a.current && a.current.contains(id(Zu(a.current))), [a]), l = N.useCallback((e) => n.focusedItemId === e && c(), [n.focusedItemId, c]), u = (t) => {
let n = e.getItemMeta(t);
return n && (n.parentId == null || e.isItemExpanded(n.parentId));
}, d = (n, r) => {
let i = e.getItemDOMElement(r);
i && i.focus(), s(r), t.onItemFocus && t.onItemFocus(n, r);
}, f = Fu((e, t) => {
u(t) && d(e, t);
}), p = Fu(() => {
if (n.focusedItemId != null) {
if (e.getItemMeta(n.focusedItemId)) {
let t = e.getItemDOMElement(n.focusedItemId);
t && t.blur();
}
s(null);
}
}), m = (e) => e === o;
rd(e, "removeItem", ({ id: e }) => {
n.focusedItemId === e && d(null, o);
});
let h = (e) => (t) => {
e.onFocus?.(t), !t.defaultMuiPrevented && t.target === t.currentTarget && d(t, o);
};
return {
getRootProps: (e) => ({ onFocus: h(e) }),
publicAPI: { focusItem: f },
instance: {
isItemFocused: l,
canItemBeTabbed: m,
focusItem: f,
removeFocusedItem: p
}
};
};
sd.getInitialState = () => ({ focusedItemId: null }), sd.params = { onItemFocus: !0 };
//#endregion
//#region node_modules/@mui/x-tree-view/internals/utils/plugins.js
var cd = (e, t) => e.getAvailablePlugins().has(t), ld = ({ props: e }) => {
let { instance: t } = Eu(), { label: n, itemId: r } = e, [i, a] = N.useState(n), o = t.isItemBeingEdited(r);
return N.useEffect(() => {
o || a(n);
}, [o, n]), { propsEnhancers: { labelInput: ({ externalEventHandlers: e, interactions: n }) => t.isItemEditable(r) ? {
value: i ?? "",
"data-element": "labelInput",
onChange: (t) => {
e.onChange?.(t), a(t.target.value);
},
onKeyDown: (t) => {
if (e.onKeyDown?.(t), t.defaultMuiPrevented) return;
let r = t.target;
t.key === "Enter" && r.value ? n.handleSaveItemLabel(t, r.value) : t.key === "Escape" && n.handleCancelItemLabelEditing(t);
},
onBlur: (t) => {
e.onBlur?.(t), !t.defaultMuiPrevented && t.target.value && n.handleSaveItemLabel(t, t.target.value);
},
autoFocus: !0,
type: "text"
} : {} } };
}, ud = ({ instance: e, state: t, setState: n, params: r }) => {
let i = N.useRef(t.editedItemId), a = (e) => i.current === e, o = (e) => {
n((t) => q({}, t, { editedItemId: e })), i.current = e;
}, s = (e) => e === t.editedItemId, c = !!r.isItemEditable, l = (t) => {
if (t == null || !c) return !1;
let n = e.getItem(t);
return n ? typeof r.isItemEditable == "function" ? r.isItemEditable(n) : !!r.isItemEditable : !1;
}, u = (e, t) => {
if (!t) throw Error([
"MUI X: The Tree View component requires all items to have a `label` property.",
"The label of an item cannot be empty.",
e
].join("\n"));
n((n) => {
let r = n.items.itemMetaMap[e];
return r.label === t ? n : q({}, n, { items: q({}, n.items, { itemMetaMap: q({}, n.items.itemMetaMap, { [e]: q({}, r, { label: t }) }) }) });
}), r.onItemLabelChange && r.onItemLabelChange(e, t);
};
return {
instance: {
setEditedItemId: o,
isItemBeingEdited: s,
updateItemLabel: u,
isItemEditable: l,
isTreeViewEditable: c,
isItemBeingEditedRef: a
},
publicAPI: { updateItemLabel: u }
};
};
ud.itemPlugin = ld, ud.getDefaultizedParams = ({ params: e, experimentalFeatures: t }) => {
let n = t?.labelEditing;
return q({}, e, { isItemEditable: n ? e.isItemEditable ?? !1 : !1 });
}, ud.getInitialState = () => ({ editedItemId: null }), ud.params = {
onItemLabelChange: !0,
isItemEditable: !0
};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewKeyboardNavigation/useTreeViewKeyboardNavigation.js
function dd(e) {
return !!e && e.length === 1 && !!e.match(/\S/);
}
var fd = ({ instance: e, params: t, state: n }) => {
let r = lr(), i = N.useRef({}), a = Fu((e) => {
i.current = e(i.current);
});
N.useEffect(() => {
if (e.areItemUpdatesPrevented()) return;
let t = {};
Object.values(n.items.itemMetaMap).forEach((e) => {
t[e.id] = e.label.substring(0, 1).toLowerCase();
}), i.current = t;
}, [
n.items.itemMetaMap,
t.getItemId,
e
]);
let o = (t, n) => {
let r = n.toLowerCase(), a = (t) => {
let n = Bu(e, t);
return n === null ? Hu(e) : n;
}, o = null, s = a(t), c = {};
for (; o == null && !c[s];) i.current[s] === r ? o = s : (c[s] = !0, s = a(s));
return o;
}, s = (n) => !t.disableSelection && !e.isItemDisabled(n), c = (t) => !e.isItemDisabled(t) && e.isItemExpandable(t);
return { instance: {
updateFirstCharMap: a,
handleItemKeyDown: (n, i) => {
if (n.defaultMuiPrevented || n.altKey || Ku(n.target, n.currentTarget)) return;
let a = n.ctrlKey || n.metaKey, l = n.key;
switch (!0) {
case l === " " && s(i):
n.preventDefault(), t.multiSelect && n.shiftKey ? e.expandSelectionRange(n, i) : e.selectItem({
event: n,
itemId: i,
keepExistingSelection: t.multiSelect,
shouldBeSelected: !t.multiSelect || void 0
});
break;
case l === "Enter":
cd(e, ud) && e.isItemEditable(i) && !e.isItemBeingEdited(i) ? e.setEditedItemId(i) : c(i) ? (e.toggleItemExpansion(n, i), n.preventDefault()) : s(i) && (t.multiSelect ? (n.preventDefault(), e.selectItem({
event: n,
itemId: i,
keepExistingSelection: !0
})) : e.isItemSelected(i) || (e.selectItem({
event: n,
itemId: i
}), n.preventDefault()));
break;
case l === "ArrowDown": {
let r = Bu(e, i);
r && (n.preventDefault(), e.focusItem(n, r), t.multiSelect && n.shiftKey && s(r) && e.selectItemFromArrowNavigation(n, i, r));
break;
}
case l === "ArrowUp": {
let r = zu(e, i);
r && (n.preventDefault(), e.focusItem(n, r), t.multiSelect && n.shiftKey && s(r) && e.selectItemFromArrowNavigation(n, i, r));
break;
}
case l === "ArrowRight" && !r || l === "ArrowLeft" && r:
if (a) return;
if (e.isItemExpanded(i)) {
let t = Bu(e, i);
t && (e.focusItem(n, t), n.preventDefault());
} else c(i) && (e.toggleItemExpansion(n, i), n.preventDefault());
break;
case l === "ArrowLeft" && !r || l === "ArrowRight" && r:
if (a) return;
if (c(i) && e.isItemExpanded(i)) e.toggleItemExpansion(n, i), n.preventDefault();
else {
let t = e.getItemMeta(i).parentId;
t && (e.focusItem(n, t), n.preventDefault());
}
break;
case l === "Home":
s(i) && t.multiSelect && a && n.shiftKey ? e.selectRangeFromStartToItem(n, i) : e.focusItem(n, Hu(e)), n.preventDefault();
break;
case l === "End":
s(i) && t.multiSelect && a && n.shiftKey ? e.selectRangeFromItemToEnd(n, i) : e.focusItem(n, Vu(e)), n.preventDefault();
break;
case l === "*":
e.expandAllSiblings(n, i), n.preventDefault();
break;
case String.fromCharCode(n.keyCode) === "A" && a && t.multiSelect && !t.disableSelection:
e.selectAllNavigableItems(n), n.preventDefault();
break;
case !a && !n.shiftKey && dd(l): {
let t = o(i, l);
t != null && (e.focusItem(n, t), n.preventDefault());
break;
}
}
}
} };
};
fd.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewIcons/useTreeViewIcons.js
var pd = ({ slots: e, slotProps: t }) => ({ contextValue: { icons: {
slots: {
collapseIcon: e.collapseIcon,
expandIcon: e.expandIcon,
endIcon: e.endIcon
},
slotProps: {
collapseIcon: t.collapseIcon,
expandIcon: t.expandIcon,
endIcon: t.endIcon
}
} } });
pd.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/internals/TreeViewProvider/TreeViewChildrenItemProvider.js
var md = /*#__PURE__*/ N.createContext(null);
function hd(e) {
let { children: t, itemId: n = null } = e, { instance: r, treeId: i, rootRef: a } = Eu(), o = N.useRef(/* @__PURE__ */ new Map());
N.useEffect(() => {
if (!a.current) return;
let e = null;
if (n == null) e = a.current.id;
else {
let t = r.getItemMeta(n);
t !== void 0 && (e = hu({
itemId: n,
treeId: i,
id: t.idAttribute
}));
}
if (e == null) return;
let t = r.getItemOrderedChildrenIds(n ?? null) ?? [], s = ad(e), c = a.current.querySelectorAll(`${n == null ? "" : `*[id="${s}"] `}[role="treeitem"]:not(*[id="${s}"] [role="treeitem"] [role="treeitem"])`), l = Array.from(c).map((e) => o.current.get(e.id));
(l.length !== t.length || l.some((e, n) => e !== t[n])) && r.setJSXItemsOrderedChildrenIds(n ?? null, l);
});
let s = N.useMemo(() => ({
registerChild: (e, t) => o.current.set(e, t),
unregisterChild: (e) => o.current.delete(e),
parentId: n
}), [n]);
return /*#__PURE__*/ z(md.Provider, {
value: s,
children: t
});
}
//#endregion
//#region node_modules/@mui/x-tree-view/internals/plugins/useTreeViewJSXItems/useTreeViewJSXItems.js
var gd = ({ instance: e, setState: t }) => (e.preventItemUpdates(), { instance: {
insertJSXItem: Fu((n) => (t((e) => {
if (e.items.itemMetaMap[n.id] != null) throw Error([
"MUI X: The Tree View component requires all items to have a unique `id` property.",
"Alternatively, you can use the `getItemId` prop to specify a custom id for each item.",
`Two items were provided with the same id in the \`items\` prop: "${n.id}"`
].join("\n"));
return q({}, e, { items: q({}, e.items, {
itemMetaMap: q({}, e.items.itemMetaMap, { [n.id]: n }),
itemMap: q({}, e.items.itemMap, { [n.id]: {
id: n.id,
label: n.label
} })
}) });
}), () => {
t((e) => {
let t = q({}, e.items.itemMetaMap), r = q({}, e.items.itemMap);
return delete t[n.id], delete r[n.id], q({}, e, { items: q({}, e.items, {
itemMetaMap: t,
itemMap: r
}) });
}), Du(e, "removeItem", { id: n.id });
})),
setJSXItemsOrderedChildrenIds: (e, n) => {
let r = e ?? "__TREE_VIEW_ROOT_PARENT_ID__";
t((e) => q({}, e, { items: q({}, e.items, {
itemOrderedChildrenIds: q({}, e.items.itemOrderedChildrenIds, { [r]: n }),
itemChildrenIndexes: q({}, e.items.itemChildrenIndexes, { [r]: ku(n) })
}) }));
},
mapFirstCharFromJSX: Fu((t, n) => (e.updateFirstCharMap((e) => (e[t] = n, e)), () => {
e.updateFirstCharMap((e) => {
let n = q({}, e);
return delete n[t], n;
});
}))
} }), _d = (e) => Array.isArray(e) ? e.length > 0 && e.some(_d) : !!e;
gd.itemPlugin = ({ props: e, rootRef: t, contentRef: n }) => {
let { instance: r, treeId: i } = Eu(), { children: a, disabled: o = !1, label: s, itemId: c, id: l } = e, u = N.useContext(md);
if (u == null) throw Error([
"MUI X: Could not find the Tree View Children Item context.",
"It looks like you rendered your component outside of a SimpleTreeView parent component.",
"This can also happen if you are bundling multiple versions of the Tree View."
].join("\n"));
let { registerChild: d, unregisterChild: f, parentId: p } = u, m = _d(a), h = N.useRef(null), g = ql(h, n);
return Pu(() => {
let e = hu({
itemId: c,
treeId: i,
id: l
});
return d(e, c), () => {
f(e);
};
}, [
d,
f,
c,
l,
i
]), N.useEffect(() => r.insertJSXItem({
id: c,
idAttribute: l,
parentId: p,
expandable: m,
disabled: o
}), [
r,
p,
c,
m,
o,
l
]), N.useEffect(() => {
if (s) return r.mapFirstCharFromJSX(c, (h.current?.textContent ?? "").substring(0, 1).toLowerCase());
}, [
r,
c,
s
]), {
contentRef: g,
rootRef: t
};
}, gd.wrapItem = ({ children: e, itemId: t }) => {
let n = N.useContext(Au);
return /*#__PURE__*/ z(hd, {
itemId: t,
children: /*#__PURE__*/ z(Au.Provider, {
value: n + 1,
children: e
})
});
}, gd.wrapRoot = ({ children: e }) => /*#__PURE__*/ z(hd, { children: /*#__PURE__*/ z(Au.Provider, {
value: 0,
children: e
}) }), gd.params = {};
//#endregion
//#region node_modules/@mui/x-tree-view/SimpleTreeView/SimpleTreeView.plugins.js
var vd = [
Nu,
Iu,
Yu,
sd,
fd,
pd,
gd
], yd = tu("MuiSimpleTreeView"), bd = (e) => {
let { classes: t } = e;
return Kl({ root: ["root"] }, su, t);
}, xd = zn("ul", {
name: "MuiSimpleTreeView",
slot: "Root",
overridesResolver: (e, t) => t.root
})({
padding: 0,
margin: 0,
listStyle: "none",
outline: 0,
position: "relative"
}), Sd = [], Cd = /*#__PURE__*/ N.forwardRef(function(e, t) {
let n = yd({
props: e,
name: "MuiSimpleTreeView"
}), r = n, { getRootProps: i, contextValue: a } = Cu({
plugins: vd,
rootRef: t,
props: q({}, n, { items: Sd })
}), { slots: o, slotProps: s } = n, c = bd(n), l = o?.root ?? xd, u = eu({
elementType: l,
externalSlotProps: s?.root,
className: c.root,
getSlotProps: i,
ownerState: r
});
return /*#__PURE__*/ z(Tu, {
value: a,
children: /*#__PURE__*/ z(l, q({}, u))
});
});
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem/useTreeItemState.js
function wd(e) {
let { instance: t, items: { onItemClick: n }, selection: { multiSelect: r, checkboxSelection: i, disableSelection: a }, expansion: { expansionTrigger: o } } = Eu(), s = t.isItemExpandable(e), c = t.isItemExpanded(e), l = t.isItemFocused(e), u = t.isItemSelected(e), d = t.isItemDisabled(e), f = t?.isItemBeingEdited ? t?.isItemBeingEdited(e) : !1, p = t.isItemEditable ? t.isItemEditable(e) : !1, m = (n) => {
if (!d) {
l || t.focusItem(n, e);
let i = r && (n.shiftKey || n.ctrlKey || n.metaKey);
s && !(i && t.isItemExpanded(e)) && t.toggleItemExpansion(n, e);
}
}, h = (n) => {
d || (!l && !f && t.focusItem(n, e), r && (n.shiftKey || n.ctrlKey || n.metaKey) ? n.shiftKey ? t.expandSelectionRange(n, e) : t.selectItem({
event: n,
itemId: e,
keepExistingSelection: !0
}) : t.selectItem({
event: n,
itemId: e,
shouldBeSelected: !0
}));
}, g = (n) => {
if (a || d) return;
let i = n.nativeEvent.shiftKey;
r && i ? t.expandSelectionRange(n, e) : t.selectItem({
event: n,
itemId: e,
keepExistingSelection: r,
shouldBeSelected: n.target.checked
});
}, _ = (e) => {
(e.shiftKey || e.ctrlKey || e.metaKey || d) && e.preventDefault();
}, v = () => {
cd(t, ud) && t.isItemEditable(e) && (t.isItemBeingEdited(e) ? t.setEditedItemId(null) : t.setEditedItemId(e));
};
return {
disabled: d,
expanded: c,
selected: u,
focused: l,
editable: p,
editing: f,
disableSelection: a,
checkboxSelection: i,
handleExpansion: m,
handleSelection: h,
handleCheckboxSelection: g,
handleContentClick: n,
preventSelection: _,
expansionTrigger: o,
toggleItemEditing: v,
handleSaveItemLabel: (n, r) => {
cd(t, ud) && t.isItemBeingEditedRef(e) && (t.updateItemLabel(e, r), v(), t.focusItem(n, e));
},
handleCancelItemLabelEditing: (n) => {
cd(t, ud) && t.isItemBeingEditedRef(e) && (v(), t.focusItem(n, e));
}
};
}
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem2DragAndDropOverlay/TreeItem2DragAndDropOverlay.js
var Td = zn("div", {
name: "MuiTreeItem2DragAndDropOverlay",
slot: "Root",
overridesResolver: (e, t) => t.root,
shouldForwardProp: (e) => pr(e) && e !== "action"
})(({ theme: e }) => ({
position: "absolute",
left: 0,
display: "flex",
top: 0,
bottom: 0,
right: 0,
pointerEvents: "none",
variants: [
{
props: { action: "make-child" },
style: {
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
borderRadius: e.shape.borderRadius,
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.darkChannel} / ${e.vars.palette.action.focusOpacity})` : In(e.palette.primary.dark, e.palette.action.focusOpacity)
}
},
{
props: { action: "reorder-above" },
style: {
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
borderTop: `1px solid ${(e.vars || e).palette.action.active}`
}
},
{
props: { action: "reorder-below" },
style: {
marginLeft: "calc(var(--TreeView-indentMultiplier) * var(--TreeView-itemDepth))",
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
}
},
{
props: { action: "move-to-parent" },
style: {
marginLeft: "calc(var(--TreeView-indentMultiplier) * calc(var(--TreeView-itemDepth) - 1))",
borderBottom: `1px solid ${(e.vars || e).palette.action.active}`
}
}
]
}));
function Ed(e) {
return e.action == null ? null : /*#__PURE__*/ z(Td, q({}, e));
}
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem2LabelInput/TreeItem2LabelInput.js
var Dd = zn("input", {
name: "MuiTreeItem2",
slot: "LabelInput",
overridesResolver: (e, t) => t.labelInput
})(({ theme: e }) => q({}, e.typography.body1, {
width: "100%",
backgroundColor: e.palette.background.paper,
borderRadius: e.shape.borderRadius,
border: "none",
padding: "0 2px",
boxSizing: "border-box",
"&:focus": { outline: `1px solid ${e.palette.primary.main}` }
})), Od = [
"classes",
"className",
"displayIcon",
"expansionIcon",
"icon",
"label",
"itemId",
"onClick",
"onMouseDown",
"dragAndDropOverlayProps",
"labelInputProps"
], kd = /*#__PURE__*/ N.forwardRef(function(e, t) {
let { classes: n, className: r, displayIcon: i, expansionIcon: a, icon: o, label: s, itemId: c, onClick: l, onMouseDown: u, dragAndDropOverlayProps: d, labelInputProps: f } = e, p = vu(e, Od), { disabled: m, expanded: h, selected: g, focused: _, editing: v, editable: y, disableSelection: b, checkboxSelection: x, handleExpansion: S, handleSelection: C, handleCheckboxSelection: w, handleContentClick: T, preventSelection: E, expansionTrigger: D, toggleItemEditing: ee } = wd(c), te = o || a || i, ne = N.useRef(null), re = (e) => {
E(e), u && u(e);
}, ie = (e) => {
T?.(e, c), !ne.current?.contains(e.target) && (D === "content" && S(e), x || C(e), l && l(e));
}, ae = a != null && te === a && D === "iconContainer" ? (e) => {
a != null && te === a && D === "iconContainer" && S(e);
} : void 0;
return /*#__PURE__*/ B("div", q({}, p, {
className: Ns(n.root, r, h && n.expanded, g && n.selected, _ && n.focused, m && n.disabled, v && n.editing, y && n.editable),
onClick: ie,
onMouseDown: re,
ref: t,
children: [
/*#__PURE__*/ z("div", {
className: n.iconContainer,
onClick: ae,
children: te
}),
x && /*#__PURE__*/ z(fr, {
className: n.checkbox,
checked: g,
onChange: w,
disabled: m || b,
ref: ne,
tabIndex: -1
}),
v ? /*#__PURE__*/ z(Dd, q({}, f, { className: n.labelInput })) : /*#__PURE__*/ z("div", q({ className: n.label }, y && { onDoubleClick: (e) => {
e.defaultMuiPrevented || ee();
} }, { children: s })),
d && /*#__PURE__*/ z(Ed, q({}, d))
]
}));
});
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem/treeItemClasses.js
function Ad(e) {
return au("MuiTreeItem", e);
}
var jd = ou("MuiTreeItem", [
"root",
"groupTransition",
"content",
"expanded",
"selected",
"focused",
"disabled",
"iconContainer",
"label",
"checkbox",
"labelInput",
"editable",
"editing",
"dragAndDropOverlay"
]), Md = Hn(/*#__PURE__*/ z("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "TreeViewExpandIcon"), Nd = Hn(/*#__PURE__*/ z("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "TreeViewCollapseIcon");
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem2Provider/TreeItem2Provider.js
function Pd(e) {
let { children: t, itemId: n } = e, { wrapItem: r, instance: i } = Eu();
return r({
children: t,
itemId: n,
instance: i
});
}
Pd.propTypes = {
children: W.default.node,
itemId: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/x-tree-view/TreeItem/TreeItem.js
var Fd = [
"children",
"className",
"slots",
"slotProps",
"ContentComponent",
"ContentProps",
"itemId",
"id",
"label",
"onClick",
"onMouseDown",
"onFocus",
"onBlur",
"onKeyDown"
], Id = ["ownerState"], Ld = ["ownerState"], Rd = ["ownerState"], zd = tu("MuiTreeItem"), Bd = (e) => {
let { classes: t } = e;
return Kl({
root: ["root"],
content: ["content"],
expanded: ["expanded"],
selected: ["selected"],
focused: ["focused"],
disabled: ["disabled"],
iconContainer: ["iconContainer"],
checkbox: ["checkbox"],
label: ["label"],
labelInput: ["labelInput"],
editing: ["editing"],
editable: ["editable"],
groupTransition: ["groupTransition"]
}, Ad, t);
}, Vd = zn("li", {
name: "MuiTreeItem",
slot: "Root",
overridesResolver: (e, t) => t.root
})({
listStyle: "none",
margin: 0,
padding: 0,
outline: 0
}), Hd = zn(kd, {
name: "MuiTreeItem",
slot: "Content",
overridesResolver: (e, t) => [
t.content,
t.iconContainer && { [`& .${jd.iconContainer}`]: t.iconContainer },
t.label && { [`& .${jd.label}`]: t.label }
],
shouldForwardProp: (e) => dr(e) && e !== "indentationAtItemLevel"
})(({ theme: e }) => ({
padding: e.spacing(.5, 1),
borderRadius: e.shape.borderRadius,
width: "100%",
boxSizing: "border-box",
position: "relative",
display: "flex",
alignItems: "center",
gap: e.spacing(1),
cursor: "pointer",
WebkitTapHighlightColor: "transparent",
"&:hover": {
backgroundColor: (e.vars || e).palette.action.hover,
"@media (hover: none)": { backgroundColor: "transparent" }
},
[`&.${jd.disabled}`]: {
opacity: (e.vars || e).palette.action.disabledOpacity,
backgroundColor: "transparent"
},
[`&.${jd.focused}`]: { backgroundColor: (e.vars || e).palette.action.focus },
[`&.${jd.selected}`]: {
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : In(e.palette.primary.main, e.palette.action.selectedOpacity),
"&:hover": {
backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.hoverOpacity}))` : In(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.hoverOpacity),
"@media (hover: none)": { backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / ${e.vars.palette.action.selectedOpacity})` : In(e.palette.primary.main, e.palette.action.selectedOpacity) }
},
[`&.${jd.focused}`]: { backgroundColor: e.vars ? `rgba(${e.vars.palette.primary.mainChannel} / calc(${e.vars.palette.action.selectedOpacity} + ${e.vars.palette.action.focusOpacity}))` : In(e.palette.primary.main, e.palette.action.selectedOpacity + e.palette.action.focusOpacity) }
},
[`& .${jd.iconContainer}`]: {
width: 16,
display: "flex",
flexShrink: 0,
justifyContent: "center",
"& svg": { fontSize: 18 }
},
[`& .${jd.label}`]: q({
width: "100%",
boxSizing: "border-box",
minWidth: 0,
position: "relative"
}, e.typography.body1),
[`& .${jd.checkbox}`]: { padding: 0 },
variants: [{
props: { indentationAtItemLevel: !0 },
style: { paddingLeft: `calc(${e.spacing(1)} + var(--TreeView-itemChildrenIndentation) * var(--TreeView-itemDepth))` }
}]
})), Ud = zn(ur, {
name: "MuiTreeItem",
slot: "GroupTransition",
overridesResolver: (e, t) => t.groupTransition,
shouldForwardProp: (e) => dr(e) && e !== "indentationAtItemLevel"
})({
margin: 0,
padding: 0,
paddingLeft: "var(--TreeView-itemChildrenIndentation)",
variants: [{
props: { indentationAtItemLevel: !0 },
style: { paddingLeft: 0 }
}]
}), Wd = /*#__PURE__*/ N.forwardRef(function(e, t) {
let { icons: n, runItemPlugins: r, items: { disabledItemsFocusable: i, indentationAtItemLevel: a }, selection: { disableSelection: o }, treeId: s, instance: c } = Eu(), l = N.useContext(Au), u = zd({
props: e,
name: "MuiTreeItem"
}), { children: d, className: f, slots: p, slotProps: m, ContentComponent: h = kd, ContentProps: g, itemId: _, id: v, label: y, onClick: b, onMouseDown: x, onBlur: S, onKeyDown: C } = u, w = vu(u, Fd), { expanded: T, focused: E, selected: D, disabled: ee, editing: te, handleCancelItemLabelEditing: ne, handleSaveItemLabel: re } = wd(_), { contentRef: ie, rootRef: ae, propsEnhancers: oe } = r(u), se = N.useRef(null), ce = N.useRef(null), O = ql(t, ae, se), le = ql(g?.ref, ie, ce), ue = {
expandIcon: p?.expandIcon ?? n.slots.expandIcon ?? Md,
collapseIcon: p?.collapseIcon ?? n.slots.collapseIcon ?? Nd,
endIcon: p?.endIcon ?? n.slots.endIcon,
icon: p?.icon,
groupTransition: p?.groupTransition
}, de = (e) => Array.isArray(e) ? e.length > 0 && e.some(de) : !!e, fe = de(d), pe = q({}, u, {
expanded: T,
focused: E,
selected: D,
disabled: ee,
indentationAtItemLevel: a
}), me = Bd(pe), he = ue.groupTransition ?? void 0, ge = eu({
elementType: he,
ownerState: {},
externalSlotProps: m?.groupTransition,
additionalProps: q({
unmountOnExit: !0,
in: T,
component: "ul",
role: "group"
}, a ? { indentationAtItemLevel: !0 } : {}),
className: me.groupTransition
}), _e = T ? ue.collapseIcon : ue.expandIcon, ve = vu(eu({
elementType: _e,
ownerState: {},
externalSlotProps: (e) => T ? q({}, $l(n.slotProps.collapseIcon, e), $l(m?.collapseIcon, e)) : q({}, $l(n.slotProps.expandIcon, e), $l(m?.expandIcon, e))
}), Id), ye = fe && _e ? /*#__PURE__*/ z(_e, q({}, ve)) : null, k = fe ? void 0 : ue.endIcon, be = vu(eu({
elementType: k,
ownerState: {},
externalSlotProps: (e) => fe ? {} : q({}, $l(n.slotProps.endIcon, e), $l(m?.endIcon, e))
}), Ld), xe = k ? /*#__PURE__*/ z(k, q({}, be)) : null, Se = ue.icon, Ce = vu(eu({
elementType: Se,
ownerState: {},
externalSlotProps: m?.icon
}), Rd), we = Se ? /*#__PURE__*/ z(Se, q({}, Ce)) : null, Te;
Te = D ? !0 : o || ee ? void 0 : !1;
function Ee(e) {
!E && (!ee || i) && e.currentTarget === e.target && c.focusItem(e, _);
}
function De(e) {
S?.(e), !(te || e.relatedTarget && Ku(e.relatedTarget, se.current) && (e.target && e.target?.dataset?.element === "labelInput" && Ku(e.target, se.current) || e.relatedTarget?.dataset?.element === "labelInput")) && c.removeFocusedItem();
}
let Oe = (e) => {
C?.(e), e.target?.dataset?.element !== "labelInput" && c.handleItemKeyDown(e, _);
}, ke = hu({
itemId: _,
treeId: s,
id: v
}), Ae = c.canItemBeTabbed(_) ? 0 : -1, je = {
rootRefObject: se,
contentRefObject: ce,
interactions: {
handleSaveItemLabel: re,
handleCancelItemLabelEditing: ne
}
}, Me = oe.root?.(q({}, je, { externalEventHandlers: Xl(w) })) ?? {}, Ne = oe.content?.(q({}, je, { externalEventHandlers: Xl(g) })) ?? {}, Pe = oe.dragAndDropOverlay?.(q({}, je, { externalEventHandlers: {} })) ?? {}, Fe = oe.labelInput?.(q({}, je, { externalEventHandlers: {} })) ?? {};
return /*#__PURE__*/ z(Pd, {
itemId: _,
children: /*#__PURE__*/ B(Vd, q({
className: Ns(me.root, f),
role: "treeitem",
"aria-expanded": fe ? T : void 0,
"aria-selected": Te,
"aria-disabled": ee || void 0,
id: ke,
tabIndex: Ae
}, w, {
ownerState: pe,
onFocus: Ee,
onBlur: De,
onKeyDown: Oe,
ref: O,
style: a ? q({}, w.style, { "--TreeView-itemDepth": typeof l == "function" ? l(_) : l }) : w.style
}, Me, { children: [/*#__PURE__*/ z(Hd, q({
as: h,
classes: {
root: me.content,
expanded: me.expanded,
selected: me.selected,
focused: me.focused,
disabled: me.disabled,
editable: me.editable,
editing: me.editing,
iconContainer: me.iconContainer,
label: me.label,
labelInput: me.labelInput,
checkbox: me.checkbox
},
label: y,
itemId: _,
onClick: b,
onMouseDown: x,
icon: we,
expansionIcon: ye,
displayIcon: xe,
ownerState: pe
}, g, Ne, Pe.action == null ? {} : { dragAndDropOverlayProps: Pe }, Fe.value == null ? {} : { labelInputProps: Fe }, { ref: le })), d && /*#__PURE__*/ z(Ud, q({ as: he }, ge, { children: d }))] }))
});
}), Gd = M(/*#__PURE__*/ z("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRight"), Kd = H("div")(() => ({}));
function qd(e) {
let t = e.data.__jsonld;
if (t.startCanvas && typeof t.startCanvas == "string") return t.startCanvas;
if (t.start) {
if (t.start.type === "Canvas" && typeof t.start.id == "string") return t.start.id;
if (t.start.type === "SpecificResource" && typeof t.start.source == "string") return t.start.source;
}
return e.data.getCanvasIds()[0];
}
function Jd(e, t) {
if (e.id === t) return e;
let n = null;
if (e.nodes) for (let r = 0; n == null && r < e.nodes.length; r += 1) n = Jd(e.nodes[r], t);
return n;
}
var Yd = ({ children: e, itemId: t, ...n }) => /* @__PURE__ */ z(Es, {
...n,
children: e
});
Yd.propTypes = {
children: W.default.node.isRequired,
itemId: W.default.string.isRequired
};
var Xd = (e) => /* @__PURE__ */ z(hl, {
...e,
color: "action"
}), Zd = (e) => /* @__PURE__ */ z(Gd, {
...e,
color: "action"
});
function Qd({ toggleNode: e, expandNodes: t, setCanvas: n, windowId: r, treeStructure: i, visibleNodeIds: a, expandedNodeIds: o, containerRef: s, nodeIdToScrollTo: c }) {
let l = (t, n) => {
(t.key === " " || t.key === "Spacebar") && e(n), d(n);
}, u = (e, n) => {
t(n);
}, d = (e) => {
let t = Jd(i, e);
if (!t.data.getCanvasIds() || t.data.getCanvasIds().length === 0 || t.nodes.length > 0) return;
let a = qd(t);
n(r, a.indexOf("#") === -1 ? a : a.substr(0, a.indexOf("#")));
};
if (!i) return null;
let f = (e) => /* @__PURE__ */ z(Yd, {
containerRef: s,
itemId: e.id,
offsetTop: 96,
scrollTo: c === e.id,
children: /* @__PURE__ */ z(Wd, {
itemId: e.id,
label: /* @__PURE__ */ z(Kd, {
sx: (t) => ({
backgroundColor: a.indexOf(e.id) !== -1 && In(t.palette.highlights?.primary || t.palette.action.selected, .35),
display: a.indexOf(e.id) !== -1 && "inline"
}),
children: e.label
}),
children: e.nodes && e.nodes.length > 0 ? e.nodes.map(f) : null
})
}, e.id);
return /* @__PURE__ */ z(Cd, {
sx: { flexGrow: 1 },
slots: {
collapseIcon: Xd,
endIcon: null,
expandIcon: Zd
},
onSelectedItemsChange: l,
onExpandedItemsChange: u,
expandedItems: o,
children: Array.isArray(i.nodes) && i.nodes.length > 0 ? i.nodes.map((e) => f(e)) : /* @__PURE__ */ z("p", { children: "No items found" })
});
}
Qd.propTypes = {
containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]).isRequired,
expandedNodeIds: W.default.arrayOf(W.default.string).isRequired,
expandNodes: W.default.func.isRequired,
nodeIdToScrollTo: W.default.string.isRequired,
setCanvas: W.default.func.isRequired,
toggleNode: W.default.func.isRequired,
treeStructure: W.default.shape({
id: W.default.string.isRequired,
label: W.default.string.isRequired,
nodes: W.default.arrayOf(W.default.shape({
id: W.default.string.isRequired,
label: W.default.string.isRequired,
nodes: W.default.array
}))
}).isRequired,
visibleNodeIds: W.default.arrayOf(W.default.string).isRequired,
windowId: W.default.string.isRequired
};
var $d = n(w((e, { id: t, windowId: n }) => ({
expandedNodeIds: Si(e, {
companionWindowId: t,
windowId: n
}),
nodeIdToScrollTo: Ci(e, {
companionWindowId: t,
windowId: n
}),
treeStructure: ce(e, { windowId: n }),
visibleNodeIds: vi(e, {
companionWindowId: t,
windowId: n
})
}), (e, { id: t, windowId: n }) => ({
expandNodes: (r) => e(Fi(n, t, r)),
setCanvas: (...t) => e(tn(...t)),
toggleNode: (r) => e(Pi(n, t, r))
})), m("SidebarIndexTableOfContents"))(Qd), ef = H("div")(() => ({
flexBasis: "100%",
height: 0
}));
function tf({ collection: e = null, id: t, showMultipart: n, sequenceId: r = null, sequences: i = [], variant: a, showToc: o = !1, updateSequence: s, updateVariant: c, windowId: l }) {
let { t: u } = V(), d = I(), f = jn(), p = (e) => {
s(e.target.value);
}, m = (e, t) => {
c(t);
}, h;
return h = z(a === "tableOfContents" ? $d : Gl, {
id: t,
containerRef: d,
windowId: l
}), /* @__PURE__ */ z(dl, {
title: u("canvasIndex"),
id: t,
windowId: l,
ref: d,
titleControls: /* @__PURE__ */ B(R, { children: [
i && i.length > 1 && /* @__PURE__ */ z(rr, { children: /* @__PURE__ */ z(ir, {
MenuProps: { anchorOrigin: {
horizontal: "left",
vertical: "bottom"
} },
displayEmpty: !0,
value: r,
onChange: p,
name: "sequenceId",
sx: {
"&.MuiSelect-select": { "&:focus": { backgroundColor: "background.paper" } },
backgroundColor: "background.paper"
},
"data-testid": "sequence-select",
children: i.map((e, t) => /* @__PURE__ */ z(Jn, {
value: e.id,
children: /* @__PURE__ */ z(U, {
variant: "body2",
children: /* @__PURE__ */ z(sn, { resource: e })
})
}, e.id))
}) }),
/* @__PURE__ */ z(ef, {}),
/* @__PURE__ */ B(sr, {
value: a,
onChange: m,
variant: "fullWidth",
indicatorColor: "primary",
textColor: "primary",
children: [
o && /* @__PURE__ */ z(Gn, {
title: u("tableOfContentsList"),
value: "tableOfContents",
children: /* @__PURE__ */ z(cr, {
sx: { minWidth: "auto" },
value: "tableOfContents",
"aria-label": u("tableOfContentsList"),
"aria-controls": f,
icon: /* @__PURE__ */ z(Il, { style: { transform: "scale(-1, 1)" } })
})
}),
/* @__PURE__ */ z(Gn, {
title: u("itemList"),
value: "item",
children: /* @__PURE__ */ z(cr, {
sx: { minWidth: "auto" },
value: "item",
"aria-label": u("itemList"),
"aria-controls": f,
icon: /* @__PURE__ */ z(Fl, {})
})
}),
/* @__PURE__ */ z(Gn, {
title: u("thumbnailList"),
value: "thumbnail",
children: /* @__PURE__ */ z(cr, {
sx: { minWidth: "auto" },
value: "thumbnail",
"aria-label": u("thumbnailList"),
"aria-controls": f,
icon: /* @__PURE__ */ z(Dl, {})
})
})
]
})
] }),
children: /* @__PURE__ */ B("div", {
id: f,
children: [e && /* @__PURE__ */ z(ar, {
fullWidth: !0,
onClick: n,
endIcon: /* @__PURE__ */ z(Ll, {}),
children: /* @__PURE__ */ z(U, {
sx: { textTransform: "none" },
children: /* @__PURE__ */ z(sn, { resource: e })
})
}), h]
})
});
}
tf.propTypes = {
collection: W.default.object,
id: W.default.string.isRequired,
sequenceId: W.default.string,
sequences: W.default.arrayOf(W.default.object),
showMultipart: W.default.func.isRequired,
showToc: W.default.bool,
updateSequence: W.default.func.isRequired,
updateVariant: W.default.func.isRequired,
variant: W.default.oneOf([
"item",
"thumbnail",
"tableOfContents"
]).isRequired,
windowId: W.default.string.isRequired
};
var nf = n(w((e, { id: t, windowId: n }) => {
let r = ce(e, { windowId: n }), i = s(e, { windowId: n }), { config: a } = e, o = se(e, { companionWindowId: t }), c = i.collectionPath || [], l = c && c[c.length - 1], u = ge(e, { windowId: n });
return {
collection: l && Le(e, { manifestId: l }),
config: a,
sequenceId: u && u.id,
sequences: xe(e, { windowId: n }),
showToc: r && r.nodes && r.nodes.length > 0,
variant: o.variant || wi(e, { windowId: n })
};
}, (e, { id: t, windowId: n }) => ({
showMultipart: () => e(ji(n, {
content: "collection",
position: "right"
})),
updateSequence: (t) => e(Gt(n, { sequenceId: t })),
updateVariant: (r) => e(Mi(n, t, { variant: r }))
})), m("WindowSideBarCanvasPanel"))(tf), rf = /* @__PURE__ */ D(((e, t) => {
function n(e) {
"@babel/helpers - typeof";
return t.exports = n = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, t.exports.__esModule = !0, t.exports.default = t.exports, n(e);
}
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
})), af = /* @__PURE__ */ D(((e, t) => {
var n = rf().default;
function r(e, t) {
if (n(e) != "object" || !e) return e;
var r = e[Symbol.toPrimitive];
if (r !== void 0) {
var i = r.call(e, t || "default");
if (n(i) != "object") return i;
throw TypeError("@@toPrimitive must return a primitive value.");
}
return (t === "string" ? String : Number)(e);
}
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
})), of = /* @__PURE__ */ D(((e, t) => {
var n = rf().default, r = af();
function i(e) {
var t = r(e, "string");
return n(t) == "symbol" ? t : t + "";
}
t.exports = i, t.exports.__esModule = !0, t.exports.default = t.exports;
})), sf = /* @__PURE__ */ D(((e, t) => {
var n = of();
function r(e, t, r) {
return (t = n(t)) in e ? Object.defineProperty(e, t, {
value: r,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = r, e;
}
t.exports = r, t.exports.__esModule = !0, t.exports.default = t.exports;
})), cf = /* @__PURE__ */ D(((e, t) => {
function n(e, t) {
if (e == null) return {};
var n = {};
for (var r in e) if ({}.hasOwnProperty.call(e, r)) {
if (t.indexOf(r) !== -1) continue;
n[r] = e[r];
}
return n;
}
t.exports = n, t.exports.__esModule = !0, t.exports.default = t.exports;
})), lf = (/* @__PURE__ */ D(((e, t) => {
(function(n, r) {
typeof e == "object" && t !== void 0 ? r(e, sf(), cf(), v()) : typeof define == "function" && define.amd ? define([
"exports",
"@babel/runtime/helpers/defineProperty",
"@babel/runtime/helpers/objectWithoutPropertiesLoose",
"react"
], r) : (n = typeof globalThis > "u" ? n || self : globalThis, r(n.Img = {}, n._defineProperty, n._objectWithoutPropertiesLoose, n.React));
})(e, function(e, t, n, r) {
function i(e) {
return e && typeof e == "object" && "default" in e ? e : { default: e };
}
function a(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})), n.push.apply(n, r);
}
return n;
}
function o(e) {
for (var t, n = 1; n < arguments.length; n++) t = arguments[n] == null ? {} : arguments[n], n % 2 ? a(Object(t), !0).forEach(function(n) {
u.default(e, n, t[n]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : a(Object(t)).forEach(function(n) {
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
});
return e;
}
function s(e) {
var t = e.srcList, n = e.imgPromise, i = n === void 0 ? p({ decode: !0 }) : n, a = e.useSuspense, s = a === void 0 || a, c = r.useState(!1)[1], l = m(h(t)), u = l.join("");
if (g[u] || (g[u] = {
promise: _(l, i),
cache: "pending",
error: null
}), g[u].cache === "resolved") return {
src: g[u].src,
isLoading: !1,
error: null
};
if (g[u].cache === "rejected") {
if (s) throw g[u].error;
return {
isLoading: !1,
error: g[u].error,
src: void 0
};
}
if (g[u].promise.then(function(e) {
g[u] = o(o({}, g[u]), {}, {
cache: "resolved",
src: e
}), s || c(u);
}).catch(function(e) {
g[u] = o(o({}, g[u]), {}, {
cache: "rejected",
error: e
}), s || c(u);
}), s) throw g[u].promise;
return {
isLoading: !0,
src: void 0,
error: null
};
}
function c(e, t) {
var n = Object.keys(e);
if (Object.getOwnPropertySymbols) {
var r = Object.getOwnPropertySymbols(e);
t && (r = r.filter(function(t) {
return Object.getOwnPropertyDescriptor(e, t).enumerable;
})), n.push.apply(n, r);
}
return n;
}
function l(e) {
for (var t, n = 1; n < arguments.length; n++) t = arguments[n] == null ? {} : arguments[n], n % 2 ? c(Object(t), !0).forEach(function(n) {
u.default(e, n, t[n]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : c(Object(t)).forEach(function(n) {
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(t, n));
});
return e;
}
var u = i(t), d = i(n), f = i(r), p = function(e) {
var t = e.decode, n = e.crossOrigin, r = n === void 0 ? "" : n;
return function(e) {
return new Promise(function(n, i) {
var a = new Image();
r && (a.crossOrigin = r), a.onload = function() {
(t === void 0 || t) && a.decode ? a.decode().then(n).catch(i) : n();
}, a.onerror = i, a.src = e;
});
};
}, m = function(e) {
return e.filter(function(e) {
return e;
});
}, h = function(e) {
return Array.isArray(e) ? e : [e];
}, g = {}, _ = function(e, t) {
var n = !1;
return new Promise(function(r, i) {
var a = function(e) {
return t(e).then(function() {
n = !0, r(e);
});
};
e.reduce(function(e, t) {
return e.catch(function() {
if (!n) return a(t);
});
}, a(e.shift())).catch(i);
});
}, v = [
"decode",
"src",
"loader",
"unloader",
"container",
"loaderContainer",
"unloaderContainer",
"imgPromise",
"crossorigin",
"useSuspense"
], y = function(e) {
return e;
};
e.Img = function(e) {
var t = e.decode, n = e.src, r = n === void 0 ? [] : n, i = e.loader, a = i === void 0 ? null : i, o = e.unloader, c = o === void 0 ? null : o, u = e.container, m = u === void 0 ? y : u, h = e.loaderContainer, g = h === void 0 ? y : h, _ = e.unloaderContainer, b = _ === void 0 ? y : _, x = e.imgPromise, S = e.crossorigin, C = e.useSuspense, w = C !== void 0 && C, T = d.default(e, v);
x ||= p({
decode: t === void 0 || t,
crossOrigin: S
});
var E = s({
srcList: r,
imgPromise: x,
useSuspense: w
}), D = E.src, ee = E.isLoading;
return D ? m(f.default.createElement("img", l({ src: D }, T))) : !w && ee ? g(a) : !w && c ? b(c) : null;
}, e.useImage = s, Object.defineProperty(e, "__esModule", { value: !0 });
});
})))(), uf = H(lf.Img)(() => ({ maxWidth: "100%" })), df = H(mr)(({ theme: e }) => ({ backgroundColor: e.palette.grey[300] }));
function ff({ manifestLogo: e = null, requiredStatement: t = null, rights: n = null, windowId: r, id: i }) {
let { t: a } = V(), o = arguments[0];
return /* @__PURE__ */ B(dl, {
title: a("attributionTitle"),
paperClassName: j("attribution-panel"),
windowId: r,
id: i,
children: [
/* @__PURE__ */ B(fl, { children: [t && /* @__PURE__ */ z(yl, {
labelValuePairs: t,
defaultLabel: a("attribution")
}), n && n.length > 0 && /* @__PURE__ */ B("dl", {
className: j("label-value-metadata"),
children: [/* @__PURE__ */ z(U, {
variant: "subtitle2",
component: "dt",
children: a("rights")
}), n.map((e) => /* @__PURE__ */ z(U, {
variant: "body1",
component: "dd",
children: /* @__PURE__ */ z(or, {
target: "_blank",
rel: "noopener noreferrer",
href: e,
children: e
})
}, e.toString()))]
})] }),
e && /* @__PURE__ */ z(fl, { children: /* @__PURE__ */ z(uf, {
src: [e],
alt: "",
role: "presentation",
unloader: /* @__PURE__ */ z(df, {
variant: "rectangular",
height: 60,
width: 60
})
}) }),
/* @__PURE__ */ z(on, {
targetName: "AttributionPanel",
...o
})
]
});
}
ff.propTypes = {
id: W.default.string.isRequired,
manifestLogo: W.default.string,
requiredStatement: W.default.arrayOf(W.default.shape({
label: W.default.string,
value: W.default.string
})),
rights: W.default.arrayOf(W.default.string),
windowId: W.default.string.isRequired
};
var pf = n(w((e, { id: t, windowId: n }) => ({
manifestLogo: pe(e, { windowId: n }),
requiredStatement: Be(e, { windowId: n }),
rights: $e(e, { windowId: n })
})), m("AttributionPanel"))(ff), mf = /* @__PURE__ */ D(((e, t) => {
function n(e) {
return function(t) {
return e?.[t];
};
}
t.exports = n;
})), hf = /* @__PURE__ */ D(((e, t) => {
t.exports = mf()({
À: "A",
Á: "A",
Â: "A",
Ã: "A",
Ä: "A",
Å: "A",
à: "a",
á: "a",
â: "a",
ã: "a",
ä: "a",
å: "a",
Ç: "C",
ç: "c",
Ð: "D",
ð: "d",
È: "E",
É: "E",
Ê: "E",
Ë: "E",
è: "e",
é: "e",
ê: "e",
ë: "e",
Ì: "I",
Í: "I",
Î: "I",
Ï: "I",
ì: "i",
í: "i",
î: "i",
ï: "i",
Ñ: "N",
ñ: "n",
Ò: "O",
Ó: "O",
Ô: "O",
Õ: "O",
Ö: "O",
Ø: "O",
ò: "o",
ó: "o",
ô: "o",
õ: "o",
ö: "o",
ø: "o",
Ù: "U",
Ú: "U",
Û: "U",
Ü: "U",
ù: "u",
ú: "u",
û: "u",
ü: "u",
Ý: "Y",
ý: "y",
ÿ: "y",
Æ: "Ae",
æ: "ae",
Þ: "Th",
þ: "th",
ß: "ss",
Ā: "A",
Ă: "A",
Ą: "A",
ā: "a",
ă: "a",
ą: "a",
Ć: "C",
Ĉ: "C",
Ċ: "C",
Č: "C",
ć: "c",
ĉ: "c",
ċ: "c",
č: "c",
Ď: "D",
Đ: "D",
ď: "d",
đ: "d",
Ē: "E",
Ĕ: "E",
Ė: "E",
Ę: "E",
Ě: "E",
ē: "e",
ĕ: "e",
ė: "e",
ę: "e",
ě: "e",
Ĝ: "G",
Ğ: "G",
Ġ: "G",
Ģ: "G",
ĝ: "g",
ğ: "g",
ġ: "g",
ģ: "g",
Ĥ: "H",
Ħ: "H",
ĥ: "h",
ħ: "h",
Ĩ: "I",
Ī: "I",
Ĭ: "I",
Į: "I",
İ: "I",
ĩ: "i",
ī: "i",
ĭ: "i",
į: "i",
ı: "i",
Ĵ: "J",
ĵ: "j",
Ķ: "K",
ķ: "k",
ĸ: "k",
Ĺ: "L",
Ļ: "L",
Ľ: "L",
Ŀ: "L",
Ł: "L",
ĺ: "l",
ļ: "l",
ľ: "l",
ŀ: "l",
ł: "l",
Ń: "N",
Ņ: "N",
Ň: "N",
Ŋ: "N",
ń: "n",
ņ: "n",
ň: "n",
ŋ: "n",
Ō: "O",
Ŏ: "O",
Ő: "O",
ō: "o",
ŏ: "o",
ő: "o",
Ŕ: "R",
Ŗ: "R",
Ř: "R",
ŕ: "r",
ŗ: "r",
ř: "r",
Ś: "S",
Ŝ: "S",
Ş: "S",
Š: "S",
ś: "s",
ŝ: "s",
ş: "s",
š: "s",
Ţ: "T",
Ť: "T",
Ŧ: "T",
ţ: "t",
ť: "t",
ŧ: "t",
Ũ: "U",
Ū: "U",
Ŭ: "U",
Ů: "U",
Ű: "U",
Ų: "U",
ũ: "u",
ū: "u",
ŭ: "u",
ů: "u",
ű: "u",
ų: "u",
Ŵ: "W",
ŵ: "w",
Ŷ: "Y",
ŷ: "y",
Ÿ: "Y",
Ź: "Z",
Ż: "Z",
Ž: "Z",
ź: "z",
ż: "z",
ž: "z",
IJ: "IJ",
ij: "ij",
Œ: "Oe",
œ: "oe",
ʼn: "'n",
ſ: "s"
});
})), gf = /* @__PURE__ */ D(((e, t) => {
var n = hf(), r = Qe(), i = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, a = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
function o(e) {
return e = r(e), e && e.replace(i, n).replace(a, "");
}
t.exports = o;
})), _f = /* @__PURE__ */ p(a(), 1), vf = /* @__PURE__ */ p(gf(), 1), yf = M(/*#__PURE__*/ z("path", { d: "M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z" }), "ChevronLeftSharp"), bf = M(/*#__PURE__*/ z("path", { d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }), "ChevronRightSharp");
//#endregion
//#region src/components/SearchPanelNavigation.jsx
function xf({ numTotal: e = void 0, searchHits: t = [], selectedContentSearchAnnotation: n, direction: r, selectAnnotation: i }) {
let { t: a } = V(), o = (e) => {
i(t[e + 1].annotations[0]);
}, s = (e) => {
i(t[e - 1].annotations[0]);
}, c = (e) => t.length !== 0 && e < t.length - 1, l = (e) => t.length !== 0 && e > 0, u = r === "rtl" ? { transform: "rotate(180deg)" } : {}, d = t.findIndex((e) => e.annotations.includes(n[0])), f = t.length;
return t.length < e && (f += "+"), t.length === 0 ? null : /* @__PURE__ */ B(U, {
variant: "body2",
align: "center",
children: [
/* @__PURE__ */ z(fn, {
"aria-label": a("searchPreviousResult"),
disabled: !l(d),
onClick: () => s(d),
children: /* @__PURE__ */ z(yf, { style: u })
}),
/* @__PURE__ */ z("span", {
style: { unicodeBidi: "plaintext" },
role: "status",
children: a("pagination", {
current: d + 1,
total: f
})
}),
/* @__PURE__ */ z(fn, {
"aria-label": a("searchNextResult"),
disabled: !c(d),
onClick: () => o(d),
children: /* @__PURE__ */ z(bf, { style: u })
})
]
});
}
xf.propTypes = {
direction: W.default.string.isRequired,
numTotal: W.default.number,
searchHits: W.default.arrayOf(W.default.object),
selectAnnotation: W.default.func.isRequired,
selectedContentSearchAnnotation: W.default.arrayOf(W.default.string).isRequired,
windowId: W.default.string.isRequired
};
var Sf = n(w((e, { companionWindowId: t, windowId: n }) => ({
direction: pt(e),
numTotal: kt(e, {
companionWindowId: t,
windowId: n
}),
searchHits: vt(e, {
companionWindowId: t,
windowId: n
}),
selectedContentSearchAnnotation: bt(e, {
companionWindowId: t,
windowId: n
})
}), (e, { windowId: t }) => ({ selectAnnotation: (...n) => e(xt(t, ...n)) })), m("SearchPanelNavigation"))(xf), Cf = H("form", {
name: "SearchPanelControls",
slot: "form"
})(({ theme: e }) => ({
paddingBottom: e.spacing(1),
paddingRight: e.spacing(1.5),
width: "100%"
})), wf = (e) => (0, _f.default)(e) ? e.match : e;
function Tf({ autocompleteService: e = void 0, companionWindowId: t, fetchSearch: n, query: r = "", searchIsFetching: i = !1, searchService: a, windowId: o }) {
let { t: s } = V(), [c, l] = L(r), [u, d] = L(r), [f, p] = L([]);
F(() => {
l(r), d(r), p([]);
}, [r]), F(() => {
u && u !== "" && a && n(o, t, `${a.id}?${new URLSearchParams({ q: u })}`, u);
}, [
u,
a,
t,
n,
o
]);
let m = (e, t, n) => {
n === "reset" && !t || (l(t), p([]), t && h(t));
}, h = Bt(kn(() => {
e && c && fetch(`${e.id}?${new URLSearchParams({ q: c })}`).then((e) => e.json()).then(g);
}, [e, c]), 500), g = (e) => {
p(e.terms);
}, _ = (e) => {
c && (e && e.preventDefault(), d(c));
}, v = (e, t, n) => {
t && wf(t) && d(wf(t));
}, y = `search-${t}`;
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Cf, {
"aria-label": s("searchTitle"),
onSubmit: _,
children: /* @__PURE__ */ z(hr, {
id: y,
inputValue: c,
options: f,
getOptionLabel: wf,
isOptionEqualToValue: (e, t) => (0, vf.default)(wf(e).trim()).toLowerCase() === (0, vf.default)(wf(t).trim()).toLowerCase(),
noOptionsText: "",
onChange: v,
onInputChange: m,
freeSolo: !0,
disableClearable: !0,
renderInput: (e) => /* @__PURE__ */ z(_r, {
...e,
label: s("searchInputLabel"),
variant: "standard",
slotProps: {
...e.slotProps,
input: {
...e.InputProps,
...e.slotProps?.input,
endAdornment: /* @__PURE__ */ B(vr, {
sx: { position: "relative" },
position: "end",
children: [/* @__PURE__ */ z(fn, {
"aria-label": s("searchSubmitAria"),
type: "submit",
children: /* @__PURE__ */ z(cn, {})
}), !!i && /* @__PURE__ */ z(gr, {
sx: {
left: "50%",
marginLeft: "-25px",
marginTop: "-25px",
position: "absolute",
top: "50%"
},
size: 50
})]
})
}
}
})
})
}), /* @__PURE__ */ z(Sf, {
windowId: o,
companionWindowId: t
})] });
}
Tf.propTypes = {
autocompleteService: W.default.shape({ id: W.default.string }),
companionWindowId: W.default.string.isRequired,
fetchSearch: W.default.func.isRequired,
query: W.default.string,
searchIsFetching: W.default.bool,
searchService: W.default.shape({ id: W.default.string }).isRequired,
windowId: W.default.string.isRequired
};
var Ef = n(w((e, { companionWindowId: t, windowId: n }) => ({
autocompleteService: De(e, { windowId: n }),
query: Mt(e, {
companionWindowId: t,
windowId: n
}),
searchIsFetching: yt(e, {
companionWindowId: t,
windowId: n
}),
searchService: be(e, { windowId: n })
}), { fetchSearch: fa }), m("SearchPanelControls"))(Tf), Df = M(/*#__PURE__*/ z("path", { d: "M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z" }), "ArrowBackSharp"), Of = 7e3, kf = null;
function Af(e, t = "assertive", n = Of) {
kf ? kf.announce(e, t, n) : (kf = new jf(), (typeof IS_REACT_ACT_ENVIRONMENT == "boolean" ? IS_REACT_ACT_ENVIRONMENT : typeof jest < "u") ? kf.announce(e, t, n) : setTimeout(() => {
kf?.isAttached() && kf?.announce(e, t, n);
}, 100));
}
var jf = class {
constructor() {
this.node = null, this.assertiveLog = null, this.politeLog = null, typeof document < "u" && (this.node = document.createElement("div"), this.node.dataset.liveAnnouncer = "true", Object.assign(this.node.style, {
border: 0,
clip: "rect(0 0 0 0)",
clipPath: "inset(50%)",
height: "1px",
margin: "-1px",
overflow: "hidden",
padding: 0,
position: "absolute",
width: "1px",
whiteSpace: "nowrap"
}), this.assertiveLog = this.createLog("assertive"), this.node.appendChild(this.assertiveLog), this.politeLog = this.createLog("polite"), this.node.appendChild(this.politeLog), document.body.prepend(this.node));
}
isAttached() {
return this.node?.isConnected;
}
createLog(e) {
let t = document.createElement("div");
return t.setAttribute("role", "log"), t.setAttribute("aria-live", e), t.setAttribute("aria-relevant", "additions"), t;
}
destroy() {
this.node &&= (document.body.removeChild(this.node), null);
}
announce(e, t = "assertive", n = Of) {
if (!this.node) return;
let r = document.createElement("div");
typeof e == "object" ? (r.setAttribute("role", "img"), r.setAttribute("aria-labelledby", e["aria-labelledby"])) : r.textContent = e, t === "assertive" ? this.assertiveLog?.appendChild(r) : this.politeLog?.appendChild(r), e !== "" && setTimeout(() => {
r.remove();
}, n);
}
clear(e) {
this.node && ((!e || e === "assertive") && this.assertiveLog && (this.assertiveLog.innerHTML = ""), (!e || e === "polite") && this.politeLog && (this.politeLog.innerHTML = ""));
}
}, Mf = P.createContext(!0);
function Nf() {
throw Error("A function wrapped in useEffectEvent can't be called during rendering.");
}
var Pf = "use" in P ? () => {
try {
return P.use(Mf);
} catch {
return !1;
}
} : () => !1;
function Ff(e) {
let t = P.useRef(Nf);
return P.useInsertionEffect(() => {
t.current = e;
}, [e]), (...e) => {
Pf() && Nf();
let n = t.current;
return n(...e);
};
}
//#endregion
//#region src/lib/TruncatedHit.js
var If = class {
constructor(e, t = void 0, { maxChars: n = 200, minimum: r = 20 } = {}) {
this.hit = e, this.annotation = t, this.maxChars = n || 200, this.minimum = r || 20;
}
get match() {
return this.hit.match || this.annotation && this.annotation.resource.resource.chars || "-";
}
get charsOnSide() {
let e = (this.maxChars - this.match.length) / 2, t = [(this.hit.before || "").length, (this.hit.after || "").length].filter((e) => e > 0);
return Math.max(Math.min(e, ...t), this.minimum);
}
get before() {
return this.hit.before ? this.hit.before.substring(this.hit.before.length - this.charsOnSide, this.hit.before.length) : "";
}
get after() {
return this.hit.after ? this.hit.after.substring(0, Math.min(this.hit.after.length, this.charsOnSide)) : "";
}
}, Lf = H(br, {
name: "SearchHit",
slot: "root"
})(({ ownerState: e, theme: t }) => ({
"&.Mui-focused": {
"&:hover": { ...e.windowSelected && { backgroundColor: "inherit" } },
...e.windowSelected && { backgroundColor: "inherit" }
},
paddingRight: t.spacing(1)
})), Rf = H("h4", {
name: "SearchHit",
slot: "canvasLabel"
})(({ theme: e }) => ({
display: "inline",
marginBottom: e.spacing(1.5)
})), zf = H(Kn, {
name: "SearchHit",
slot: "counter"
})(({ ownerState: e, theme: t }) => ({
backgroundColor: t.palette.hitCounter.default,
...e.windowSelected && { backgroundColor: t.palette.highlights.primary },
...e.adjacent && !e.windowSelected && { backgroundColor: t.palette.highlights.secondary },
height: 30,
marginRight: t.spacing(1),
typography: "subtitle2",
verticalAlign: "inherit"
}));
function Bf({ adjacent: e = !1, annotation: t = void 0, annotationId: n = void 0, annotationLabel: r = void 0, announcer: i = void 0, canvasLabel: a = void 0, companionWindowId: o = void 0, containerRef: s = void 0, focused: c = !1, hit: l = void 0, index: u = void 0, selectAnnotation: d = () => {}, selected: f = !1, showDetails: p = () => {}, total: m = void 0, windowId: h, windowSelected: g = !1 }) {
let { t: _ } = V();
F(() => {
f && b();
}, [f]);
let v = () => {
t && n && d(n);
}, y = Pn(() => l && new If(l, t), [l, t]), b = Ff(() => {
!i || !y || i([
_("pagination", {
current: u + 1,
total: m
}),
a,
r,
y.before,
y.match,
y.after
].join(" "), "polite");
}), x = jn();
if (c && !f) return null;
let S = c ? l : l && y, C = l && (S.before !== l.before || S.after !== l.after), w = {
adjacent: e,
focused: c,
selected: f,
windowSelected: g
}, T = /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(zf, {
component: "span",
ownerState: w,
label: u + 1
}), /* @__PURE__ */ B(Rf, {
id: x,
children: [a, r && /* @__PURE__ */ z(U, {
component: "span",
sx: {
display: "block",
marginTop: 1
},
children: r
})]
})] });
return /* @__PURE__ */ z(Es, {
containerRef: s,
offsetTop: 96,
scrollTo: g && !c,
children: /* @__PURE__ */ z(Lf, {
ownerState: w,
className: g ? "windowSelected" : "",
divider: !0,
component: f ? "li" : xr,
onClick: v,
selected: f,
children: /* @__PURE__ */ z(Yn, {
primary: T,
secondary: /* @__PURE__ */ B(R, { children: [l && /* @__PURE__ */ B(R, { children: [
/* @__PURE__ */ z(Cs, {
ruleSet: "iiif",
htmlString: S.before
}),
" ",
/* @__PURE__ */ z("strong", { children: /* @__PURE__ */ z(Cs, {
ruleSet: "iiif",
htmlString: S.match
}) }),
" ",
/* @__PURE__ */ z(Cs, {
ruleSet: "iiif",
htmlString: S.after
}),
" ",
C && !c && /* @__PURE__ */ z(ar, {
sx: {
"& span": { lineHeight: "1.5em" },
margin: 0,
padding: 0,
textTransform: "none"
},
onClick: p,
color: "secondary",
size: "small",
"aria-describedby": x,
children: _("more")
})
] }), !l && t && /* @__PURE__ */ z(Cs, {
ruleSet: "iiif",
htmlString: t.chars
})] }),
slotProps: {
primary: {
component: "div",
sx: { marginBottom: 1 },
variant: "subtitle2"
},
secondary: { variant: "body1" }
}
})
})
});
}
Bf.propTypes = {
adjacent: W.default.bool,
annotation: W.default.shape({
chars: W.default.string,
targetId: W.default.string
}),
annotationId: W.default.string,
annotationLabel: W.default.string,
announcer: W.default.func,
canvasLabel: W.default.string,
companionWindowId: W.default.string,
containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]),
focused: W.default.bool,
hit: W.default.shape({
after: W.default.string,
before: W.default.string,
match: W.default.string
}),
index: W.default.number,
selectAnnotation: W.default.func,
selected: W.default.bool,
showDetails: W.default.func,
total: W.default.number,
windowId: W.default.string.isRequired,
windowSelected: W.default.bool
};
var Vf = n(w((e, { annotationId: t, hit: n = { annotations: [] }, companionWindowId: r, windowId: i }) => {
let a = t || n.annotations[0], o = Ct(e, {
annotationUri: a,
companionWindowId: r,
windowId: i
}), s = Dt(e, {
annotationUri: a,
companionWindowId: r,
windowId: i
}), c = at(e, { windowId: i }), l = bt(e, {
companionWindowId: r,
windowId: i
}), u = wt(e, { windowId: i }), d = [t, ...n.annotations];
return {
adjacent: c.includes(o?.targetId),
annotation: o,
annotationId: a,
annotationLabel: s[0],
canvasLabel: o && Fe(e, {
canvasId: o.targetId,
windowId: i
}),
selected: l[0] && d.includes(l[0]),
windowSelected: u && d.includes(u)
};
}, (e, { windowId: t }) => ({ selectAnnotation: (...n) => e(xt(t, ...n)) })), m("SearchHit"))(Bf);
//#endregion
//#region src/components/SearchResults.jsx
function Hf({ companionWindowId: e, containerRef: t, searchAnnotations: n, searchHits: r, windowId: i, focused: a, toggleFocus: o }) {
return r.length === 0 && n.length > 0 ? n.map((r, s) => /* @__PURE__ */ z(Vf, {
announcer: Af,
annotationId: r.id,
companionWindowId: e,
containerRef: t,
focused: a,
index: s,
total: n.length,
windowId: i,
showDetails: o
}, r.id)) : r.map((n, s) => /* @__PURE__ */ z(Vf, {
announcer: Af,
containerRef: t,
companionWindowId: e,
focused: a,
hit: n,
index: s,
total: r.length,
windowId: i,
showDetails: o
}, n.annotations[0]));
}
function Uf({ companionWindowId: e, containerRef: t = void 0, isFetching: n = !1, fetchSearch: r, nextSearch: i = void 0, query: a = void 0, searchAnnotations: o = [], searchHits: s = [], searchNumTotal: c = void 0, windowId: l }) {
let { t: u } = V(), [d, f] = L(!1), p = kn(() => {
f(!d);
}, [f, d]), m = a && !n && s.length === 0 && o.length === 0;
return /* @__PURE__ */ B(R, { children: [
d && /* @__PURE__ */ z(Es, {
containerRef: t,
offsetTop: 96,
scrollTo: !0,
children: /* @__PURE__ */ B(ar, {
onClick: p,
sx: { textTransform: "none" },
size: "small",
children: [/* @__PURE__ */ z(Df, {}), u("backToResults")]
})
}),
m && /* @__PURE__ */ z(U, {
sx: {
padding: 2,
typography: "h6"
},
children: u("searchNoResults")
}),
/* @__PURE__ */ z(yr, {
disablePadding: !0,
children: /* @__PURE__ */ z(Hf, {
companionWindowId: e,
containerRef: t,
searchAnnotations: o,
searchHits: s,
windowId: l,
focused: d,
toggleFocus: p
})
}),
i && /* @__PURE__ */ B(ar, {
sx: { width: "100%" },
color: "secondary",
onClick: () => r(l, e, i, a),
children: [
u("moreResults"),
/* @__PURE__ */ z("br", {}),
`(${u("searchResultsRemaining", { numLeft: c - s.length })})`
]
})
] });
}
Uf.propTypes = {
companionWindowId: W.default.string.isRequired,
containerRef: W.default.oneOfType([W.default.func, W.default.shape({ current: W.default.instanceOf(Element) })]),
fetchSearch: W.default.func.isRequired,
isFetching: W.default.bool,
nextSearch: W.default.string,
query: W.default.string,
searchAnnotations: W.default.arrayOf(W.default.object),
searchHits: W.default.arrayOf(W.default.object),
searchNumTotal: W.default.number,
windowId: W.default.string.isRequired
};
var Wf = n(w((e, { companionWindowId: t, windowId: n }) => ({
isFetching: yt(e, {
companionWindowId: t,
windowId: n
}),
nextSearch: St(e, {
companionWindowId: t,
windowId: n
}),
query: Mt(e, {
companionWindowId: t,
windowId: n
}),
searchAnnotations: jt(e, {
companionWindowId: t,
windowId: n
}),
searchHits: vt(e, {
companionWindowId: t,
windowId: n
}),
searchNumTotal: kt(e, {
companionWindowId: t,
windowId: n
})
}), { fetchSearch: fa }), m("SearchResults"))(Uf);
//#endregion
//#region src/components/SearchPanel.jsx
function Gf({ fetchSearch: e = void 0, id: t, query: n = "", removeSearch: r, searchService: i, suggestedSearches: a = [], windowId: o }) {
let { t: s } = V(), c = I(null);
return /* @__PURE__ */ B(dl, {
ariaLabel: s("searchTitle"),
title: /* @__PURE__ */ B(R, { children: [s("searchTitle"), n && n !== "" && /* @__PURE__ */ z(Kn, {
"aria-label": s("clearSearchAria"),
role: "button",
sx: { marginLeft: 1 },
color: "secondary",
label: s("clearSearch"),
onClick: r,
onDelete: r,
size: "small",
tabIndex: 0,
variant: "outlined"
})] }),
windowId: o,
id: t,
titleControls: /* @__PURE__ */ z(Ef, {
companionWindowId: t,
windowId: o
}),
ref: c,
children: [/* @__PURE__ */ z(Wf, {
containerRef: c,
companionWindowId: t,
windowId: o
}), e && a && n === "" && a.map((t) => /* @__PURE__ */ z(U, {
component: "p",
variant: "body1",
sx: { margin: 2 },
children: /* @__PURE__ */ z(ar, {
variant: "inlineText",
color: "secondary",
onClick: () => e(`${i.id}?${new URLSearchParams({ q: t })}`, t),
children: s("suggestSearch", { query: t })
})
}, t))]
});
}
Gf.propTypes = {
fetchSearch: W.default.func,
id: W.default.string.isRequired,
query: W.default.string,
removeSearch: W.default.func.isRequired,
searchService: W.default.shape({ id: W.default.string }).isRequired,
suggestedSearches: W.default.arrayOf(W.default.string),
windowId: W.default.string.isRequired
};
var Kf = n(w((e, { id: t, windowId: n }) => ({
query: Mt(e, {
companionWindowId: t,
windowId: n
}),
searchService: be(e, { windowId: n }),
suggestedSearches: s(e, { windowId: n }).suggestedSearches
}), (e, t) => ({
fetchSearch: (n, r) => e(fa(t.windowId, t.id, n, r)),
removeSearch: () => e(da(t.windowId, t.id))
})), m("SearchPanel"))(Gf), qf = M(/*#__PURE__*/ z("path", { d: "M20 9H4v2h16zM4 15h16v-2H4z" }), "DragHandleSharp"), Jf = M(/*#__PURE__*/ z("path", { d: "M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z" }), "VerticalAlignTopSharp"), Yf = M(/*#__PURE__*/ z("path", { d: "M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z" }), "VerticalAlignBottomSharp"), Xf = M(/*#__PURE__*/ z("path", { d: "M17.66 8 12 2.35 6.34 8C4.78 9.56 4 11.64 4 13.64s.78 4.11 2.34 5.67 3.61 2.35 5.66 2.35 4.1-.79 5.66-2.35S20 15.64 20 13.64 19.22 9.56 17.66 8M6 14c.01-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 17.99 12 18 14z" }), "OpacitySharp"), Zf = "Invariant failed";
function Qf(e, t) {
if (!e) throw Error(Zf);
}
//#endregion
//#region node_modules/css-box-model/dist/css-box-model.esm.js
var $f = function(e) {
var t = e.top, n = e.right, r = e.bottom, i = e.left;
return {
top: t,
right: n,
bottom: r,
left: i,
width: n - i,
height: r - t,
x: i,
y: t,
center: {
x: (n + i) / 2,
y: (r + t) / 2
}
};
}, ep = function(e, t) {
return {
top: e.top - t.top,
left: e.left - t.left,
bottom: e.bottom + t.bottom,
right: e.right + t.right
};
}, tp = function(e, t) {
return {
top: e.top + t.top,
left: e.left + t.left,
bottom: e.bottom - t.bottom,
right: e.right - t.right
};
}, np = function(e, t) {
return {
top: e.top + t.y,
left: e.left + t.x,
bottom: e.bottom + t.y,
right: e.right + t.x
};
}, rp = {
top: 0,
right: 0,
bottom: 0,
left: 0
}, ip = function(e) {
var t = e.borderBox, n = e.margin, r = n === void 0 ? rp : n, i = e.border, a = i === void 0 ? rp : i, o = e.padding, s = o === void 0 ? rp : o, c = $f(ep(t, r)), l = $f(tp(t, a)), u = $f(tp(l, s));
return {
marginBox: c,
borderBox: $f(t),
paddingBox: l,
contentBox: u,
margin: r,
border: a,
padding: s
};
}, ap = function(e) {
var t = e.slice(0, -2);
if (e.slice(-2) !== "px") return 0;
var n = Number(t);
return isNaN(n) && Qf(!1), n;
}, op = function() {
return {
x: window.pageXOffset,
y: window.pageYOffset
};
}, sp = function(e, t) {
var n = e.borderBox, r = e.border, i = e.margin, a = e.padding;
return ip({
borderBox: np(n, t),
border: r,
margin: i,
padding: a
});
}, cp = function(e, t) {
return t === void 0 && (t = op()), sp(e, t);
}, lp = function(e, t) {
return ip({
borderBox: e,
margin: {
top: ap(t.marginTop),
right: ap(t.marginRight),
bottom: ap(t.marginBottom),
left: ap(t.marginLeft)
},
padding: {
top: ap(t.paddingTop),
right: ap(t.paddingRight),
bottom: ap(t.paddingBottom),
left: ap(t.paddingLeft)
},
border: {
top: ap(t.borderTopWidth),
right: ap(t.borderRightWidth),
bottom: ap(t.borderBottomWidth),
left: ap(t.borderLeftWidth)
}
});
}, up = function(e) {
return lp(e.getBoundingClientRect(), window.getComputedStyle(e));
}, dp = function(e) {
var t = [], n = null, r = function() {
t = [...arguments], !n && (n = requestAnimationFrame(function() {
n = null, e.apply(void 0, t);
}));
};
return r.cancel = function() {
n &&= (cancelAnimationFrame(n), null);
}, r;
};
//#endregion
//#region node_modules/@hello-pangea/dnd/dist/dnd.esm.js
function fp(e, t) {}
fp.bind(null, "warn"), fp.bind(null, "error");
function pp() {}
function mp(e, t) {
return {
...e,
...t
};
}
function hp(e, t, n) {
let r = t.map((t) => {
let r = mp(n, t.options);
return e.addEventListener(t.eventName, t.fn, r), function() {
e.removeEventListener(t.eventName, t.fn, r);
};
});
return function() {
r.forEach((e) => {
e();
});
};
}
var gp = "Invariant failed", _p = class extends Error {};
_p.prototype.toString = function() {
return this.message;
};
function J(e, t) {
throw new _p(gp);
}
var vp = class extends P.Component {
constructor(...e) {
super(...e), this.callbacks = null, this.unbind = pp, this.onWindowError = (e) => {
let t = this.getCallbacks();
t.isDragging() && t.tryAbort(), e.error instanceof _p && e.preventDefault();
}, this.getCallbacks = () => {
if (!this.callbacks) throw Error("Unable to find AppCallbacks in <ErrorBoundary/>");
return this.callbacks;
}, this.setCallbacks = (e) => {
this.callbacks = e;
};
}
componentDidMount() {
this.unbind = hp(window, [{
eventName: "error",
fn: this.onWindowError
}]);
}
componentDidCatch(e) {
if (e instanceof _p) {
this.setState({});
return;
}
throw e;
}
componentWillUnmount() {
this.unbind();
}
render() {
return this.props.children(this.setCallbacks);
}
}, yp = "\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n", bp = (e) => e + 1, xp = (e) => `
You have lifted an item in position ${bp(e.source.index)}
`, Sp = (e, t) => {
let n = e.droppableId === t.droppableId, r = bp(e.index), i = bp(t.index);
return n ? `
You have moved the item from position ${r}
to position ${i}
` : `
You have moved the item from position ${r}
in list ${e.droppableId}
to list ${t.droppableId}
in position ${i}
`;
}, Cp = (e, t, n) => t.droppableId === n.droppableId ? `
The item ${e}
has been combined with ${n.draggableId}` : `
The item ${e}
in list ${t.droppableId}
has been combined with ${n.draggableId}
in list ${n.droppableId}
`, wp = (e) => {
let t = e.destination;
if (t) return Sp(e.source, t);
let n = e.combine;
return n ? Cp(e.draggableId, e.source, n) : "You are over an area that cannot be dropped on";
}, Tp = (e) => `
The item has returned to its starting position
of ${bp(e.index)}
`, Ep = {
dragHandleUsageInstructions: yp,
onDragStart: xp,
onDragUpdate: wp,
onDragEnd: (e) => {
if (e.reason === "CANCEL") return `
Movement cancelled.
${Tp(e.source)}
`;
let t = e.destination, n = e.combine;
return t ? `
You have dropped the item.
${Sp(e.source, t)}
` : n ? `
You have dropped the item.
${Cp(e.draggableId, e.source, n)}
` : `
The item has been dropped while not over a drop area.
${Tp(e.source)}
`;
}
};
function Dp(e, t) {
return !!(e === t || Number.isNaN(e) && Number.isNaN(t));
}
function Op(e, t) {
if (e.length !== t.length) return !1;
for (let n = 0; n < e.length; n++) if (!Dp(e[n], t[n])) return !1;
return !0;
}
function Y(e, t) {
let n = L(() => ({
inputs: t,
result: e()
}))[0], r = I(!0), i = I(n), a = r.current || t && i.current.inputs && Op(t, i.current.inputs) ? i.current : {
inputs: t,
result: e()
};
return F(() => {
r.current = !1, i.current = a;
}, [a]), a.result;
}
function X(e, t) {
return Y(() => e, t);
}
var kp = {
x: 0,
y: 0
}, Ap = (e, t) => ({
x: e.x + t.x,
y: e.y + t.y
}), jp = (e, t) => ({
x: e.x - t.x,
y: e.y - t.y
}), Mp = (e, t) => e.x === t.x && e.y === t.y, Np = (e) => ({
x: e.x === 0 ? 0 : -e.x,
y: e.y === 0 ? 0 : -e.y
}), Pp = (e, t, n = 0) => e === "x" ? {
x: t,
y: n
} : {
x: n,
y: t
}, Fp = (e, t) => Math.sqrt((t.x - e.x) ** 2 + (t.y - e.y) ** 2), Ip = (e, t) => Math.min(...t.map((t) => Fp(e, t))), Lp = (e) => (t) => ({
x: e(t.x),
y: e(t.y)
}), Rp = (e, t) => {
let n = $f({
top: Math.max(t.top, e.top),
right: Math.min(t.right, e.right),
bottom: Math.min(t.bottom, e.bottom),
left: Math.max(t.left, e.left)
});
return n.width <= 0 || n.height <= 0 ? null : n;
}, zp = (e, t) => ({
top: e.top + t.y,
left: e.left + t.x,
bottom: e.bottom + t.y,
right: e.right + t.x
}), Bp = (e) => [
{
x: e.left,
y: e.top
},
{
x: e.right,
y: e.top
},
{
x: e.left,
y: e.bottom
},
{
x: e.right,
y: e.bottom
}
], Vp = {
top: 0,
right: 0,
bottom: 0,
left: 0
}, Hp = (e, t) => t ? zp(e, t.scroll.diff.displacement) : e, Up = (e, t, n) => n && n.increasedBy ? {
...e,
[t.end]: e[t.end] + n.increasedBy[t.line]
} : e, Wp = (e, t) => t && t.shouldClipSubject ? Rp(t.pageMarginBox, e) : $f(e), Gp = ({ page: e, withPlaceholder: t, axis: n, frame: r }) => ({
page: e,
withPlaceholder: t,
active: Wp(Up(Hp(e.marginBox, r), n, t), r)
}), Kp = (e, t) => {
!e.frame && J();
let n = e.frame, r = jp(t, n.scroll.initial), i = Np(r), a = {
...n,
scroll: {
initial: n.scroll.initial,
current: t,
diff: {
value: r,
displacement: i
},
max: n.scroll.max
}
}, o = Gp({
page: e.subject.page,
withPlaceholder: e.subject.withPlaceholder,
axis: e.axis,
frame: a
});
return {
...e,
frame: a,
subject: o
};
};
function qp(e, t = Op) {
let n = null;
function r(...r) {
if (n && n.lastThis === this && t(r, n.lastArgs)) return n.lastResult;
let i = e.apply(this, r);
return n = {
lastResult: i,
lastArgs: r,
lastThis: this
}, i;
}
return r.clear = function() {
n = null;
}, r;
}
var Jp = qp((e) => e.reduce((e, t) => (e[t.descriptor.id] = t, e), {})), Yp = qp((e) => e.reduce((e, t) => (e[t.descriptor.id] = t, e), {})), Xp = qp((e) => Object.values(e)), Zp = qp((e) => Object.values(e)), Qp = qp((e, t) => Zp(t).filter((t) => e === t.descriptor.droppableId).sort((e, t) => e.descriptor.index - t.descriptor.index));
function $p(e) {
return e.at && e.at.type === "REORDER" ? e.at.destination : null;
}
function em(e) {
return e.at && e.at.type === "COMBINE" ? e.at.combine : null;
}
var tm = qp((e, t) => t.filter((t) => t.descriptor.id !== e.descriptor.id)), nm = ({ isMovingForward: e, draggable: t, destination: n, insideDestination: r, previousImpact: i }) => {
if (!n.isCombineEnabled || !$p(i)) return null;
function a(e) {
let t = {
type: "COMBINE",
combine: {
draggableId: e,
droppableId: n.descriptor.id
}
};
return {
...i,
at: t
};
}
let o = i.displaced.all, s = o.length ? o[0] : null;
if (e) return s ? a(s) : null;
let c = tm(t, r);
if (!s) {
if (!c.length) return null;
let e = c[c.length - 1];
return a(e.descriptor.id);
}
let l = c.findIndex((e) => e.descriptor.id === s);
l === -1 && J();
let u = l - 1;
if (u < 0) return null;
let d = c[u];
return a(d.descriptor.id);
}, rm = (e, t) => e.descriptor.droppableId === t.descriptor.id, im = {
point: kp,
value: 0
}, am = {
invisible: {},
visible: {},
all: []
}, om = {
displaced: am,
displacedBy: im,
at: null
}, sm = (e, t) => (n) => e <= n && n <= t, cm = (e) => {
let t = sm(e.top, e.bottom), n = sm(e.left, e.right);
return (r) => {
if (t(r.top) && t(r.bottom) && n(r.left) && n(r.right)) return !0;
let i = t(r.top) || t(r.bottom), a = n(r.left) || n(r.right);
if (i && a) return !0;
let o = r.top < e.top && r.bottom > e.bottom, s = r.left < e.left && r.right > e.right;
return o && s ? !0 : o && a || s && i;
};
}, lm = (e) => {
let t = sm(e.top, e.bottom), n = sm(e.left, e.right);
return (e) => t(e.top) && t(e.bottom) && n(e.left) && n(e.right);
}, um = {
direction: "vertical",
line: "y",
crossAxisLine: "x",
start: "top",
end: "bottom",
size: "height",
crossAxisStart: "left",
crossAxisEnd: "right",
crossAxisSize: "width"
}, dm = {
direction: "horizontal",
line: "x",
crossAxisLine: "y",
start: "left",
end: "right",
size: "width",
crossAxisStart: "top",
crossAxisEnd: "bottom",
crossAxisSize: "height"
}, fm = (e) => (t) => {
let n = sm(t.top, t.bottom), r = sm(t.left, t.right);
return (t) => e === um ? n(t.top) && n(t.bottom) : r(t.left) && r(t.right);
}, pm = (e, t) => zp(e, t.frame ? t.frame.scroll.diff.displacement : kp), mm = (e, t, n) => t.subject.active ? n(t.subject.active)(e) : !1, hm = (e, t, n) => n(t)(e), gm = ({ target: e, destination: t, viewport: n, withDroppableDisplacement: r, isVisibleThroughFrameFn: i }) => {
let a = r ? pm(e, t) : e;
return mm(a, t, i) && hm(a, n, i);
}, _m = (e) => gm({
...e,
isVisibleThroughFrameFn: cm
}), vm = (e) => gm({
...e,
isVisibleThroughFrameFn: lm
}), ym = (e) => gm({
...e,
isVisibleThroughFrameFn: fm(e.destination.axis)
}), bm = (e, t, n) => {
if (typeof n == "boolean") return n;
if (!t) return !0;
let { invisible: r, visible: i } = t;
if (r[e]) return !1;
let a = i[e];
return !a || a.shouldAnimate;
};
function xm(e, t) {
let n = e.page.marginBox;
return $f(ep(n, {
top: t.point.y,
right: 0,
bottom: 0,
left: t.point.x
}));
}
function Sm({ afterDragging: e, destination: t, displacedBy: n, viewport: r, forceShouldAnimate: i, last: a }) {
return e.reduce(function(e, o) {
let s = xm(o, n), c = o.descriptor.id;
if (e.all.push(c), !_m({
target: s,
destination: t,
viewport: r,
withDroppableDisplacement: !0
})) return e.invisible[o.descriptor.id] = !0, e;
let l = {
draggableId: c,
shouldAnimate: bm(c, a, i)
};
return e.visible[c] = l, e;
}, {
all: [],
visible: {},
invisible: {}
});
}
function Cm(e, t) {
if (!e.length) return 0;
let n = e[e.length - 1].descriptor.index;
return t.inHomeList ? n : n + 1;
}
function wm({ insideDestination: e, inHomeList: t, displacedBy: n, destination: r }) {
let i = Cm(e, { inHomeList: t });
return {
displaced: am,
displacedBy: n,
at: {
type: "REORDER",
destination: {
droppableId: r.descriptor.id,
index: i
}
}
};
}
function Tm({ draggable: e, insideDestination: t, destination: n, viewport: r, displacedBy: i, last: a, index: o, forceShouldAnimate: s }) {
let c = rm(e, n);
if (o == null) return wm({
insideDestination: t,
inHomeList: c,
displacedBy: i,
destination: n
});
let l = t.find((e) => e.descriptor.index === o);
if (!l) return wm({
insideDestination: t,
inHomeList: c,
displacedBy: i,
destination: n
});
let u = tm(e, t), d = t.indexOf(l);
return {
displaced: Sm({
afterDragging: u.slice(d),
destination: n,
displacedBy: i,
last: a,
viewport: r.frame,
forceShouldAnimate: s
}),
displacedBy: i,
at: {
type: "REORDER",
destination: {
droppableId: n.descriptor.id,
index: o
}
}
};
}
function Em(e, t) {
return !!t.effected[e];
}
var Dm = ({ isMovingForward: e, destination: t, draggables: n, combine: r, afterCritical: i }) => {
if (!t.isCombineEnabled) return null;
let a = r.draggableId, o = n[a].descriptor.index;
return Em(a, i) ? e ? o : o - 1 : e ? o + 1 : o;
}, Om = ({ isMovingForward: e, isInHomeList: t, insideDestination: n, location: r }) => {
if (!n.length) return null;
let i = r.index, a = e ? i + 1 : i - 1, o = n[0].descriptor.index, s = n[n.length - 1].descriptor.index, c = t ? s : s + 1;
return a < o || a > c ? null : a;
}, km = ({ isMovingForward: e, isInHomeList: t, draggable: n, draggables: r, destination: i, insideDestination: a, previousImpact: o, viewport: s, afterCritical: c }) => {
let l = o.at;
if (!l && J(), l.type === "REORDER") {
let r = Om({
isMovingForward: e,
isInHomeList: t,
location: l.destination,
insideDestination: a
});
return r == null ? null : Tm({
draggable: n,
insideDestination: a,
destination: i,
viewport: s,
last: o.displaced,
displacedBy: o.displacedBy,
index: r
});
}
let u = Dm({
isMovingForward: e,
destination: i,
displaced: o.displaced,
draggables: r,
combine: l.combine,
afterCritical: c
});
return u == null ? null : Tm({
draggable: n,
insideDestination: a,
destination: i,
viewport: s,
last: o.displaced,
displacedBy: o.displacedBy,
index: u
});
}, Am = ({ displaced: e, afterCritical: t, combineWith: n, displacedBy: r }) => {
let i = !!(e.visible[n] || e.invisible[n]);
return Em(n, t) ? i ? kp : Np(r.point) : i ? r.point : kp;
}, jm = ({ afterCritical: e, impact: t, draggables: n }) => {
let r = em(t);
!r && J();
let i = r.draggableId, a = n[i].page.borderBox.center;
return Ap(a, Am({
displaced: t.displaced,
afterCritical: e,
combineWith: i,
displacedBy: t.displacedBy
}));
}, Mm = (e, t) => t.margin[e.start] + t.borderBox[e.size] / 2, Nm = (e, t) => t.margin[e.end] + t.borderBox[e.size] / 2, Pm = (e, t, n) => t[e.crossAxisStart] + n.margin[e.crossAxisStart] + n.borderBox[e.crossAxisSize] / 2, Fm = ({ axis: e, moveRelativeTo: t, isMoving: n }) => Pp(e.line, t.marginBox[e.end] + Mm(e, n), Pm(e, t.marginBox, n)), Im = ({ axis: e, moveRelativeTo: t, isMoving: n }) => Pp(e.line, t.marginBox[e.start] - Nm(e, n), Pm(e, t.marginBox, n)), Lm = ({ axis: e, moveInto: t, isMoving: n }) => Pp(e.line, t.contentBox[e.start] + Mm(e, n), Pm(e, t.contentBox, n)), Rm = ({ impact: e, draggable: t, draggables: n, droppable: r, afterCritical: i }) => {
let a = Qp(r.descriptor.id, n), o = t.page, s = r.axis;
if (!a.length) return Lm({
axis: s,
moveInto: r.page,
isMoving: o
});
let { displaced: c, displacedBy: l } = e, u = c.all[0];
if (u) {
let e = n[u];
return Em(u, i) ? Im({
axis: s,
moveRelativeTo: e.page,
isMoving: o
}) : Im({
axis: s,
moveRelativeTo: sp(e.page, l.point),
isMoving: o
});
}
let d = a[a.length - 1];
return d.descriptor.id === t.descriptor.id ? o.borderBox.center : Em(d.descriptor.id, i) ? Fm({
axis: s,
moveRelativeTo: sp(d.page, Np(i.displacedBy.point)),
isMoving: o
}) : Fm({
axis: s,
moveRelativeTo: d.page,
isMoving: o
});
}, zm = (e, t) => {
let n = e.frame;
return n ? Ap(t, n.scroll.diff.displacement) : t;
}, Bm = ({ impact: e, draggable: t, droppable: n, draggables: r, afterCritical: i }) => {
let a = t.page.borderBox.center, o = e.at;
return !n || !o ? a : o.type === "REORDER" ? Rm({
impact: e,
draggable: t,
draggables: r,
droppable: n,
afterCritical: i
}) : jm({
impact: e,
draggables: r,
afterCritical: i
});
}, Vm = (e) => {
let t = Bm(e), n = e.droppable;
return n ? zm(n, t) : t;
}, Hm = (e, t) => {
let n = jp(t, e.scroll.initial), r = Np(n);
return {
frame: $f({
top: t.y,
bottom: t.y + e.frame.height,
left: t.x,
right: t.x + e.frame.width
}),
scroll: {
initial: e.scroll.initial,
max: e.scroll.max,
current: t,
diff: {
value: n,
displacement: r
}
}
};
};
function Um(e, t) {
return e.map((e) => t[e]);
}
function Wm(e, t) {
for (let n = 0; n < t.length; n++) {
let r = t[n].visible[e];
if (r) return r;
}
return null;
}
var Gm = ({ impact: e, viewport: t, destination: n, draggables: r, maxScrollChange: i }) => {
let a = Hm(t, Ap(t.scroll.current, i)), o = n.frame ? Kp(n, Ap(n.frame.scroll.current, i)) : n, s = e.displaced, c = Sm({
afterDragging: Um(s.all, r),
destination: n,
displacedBy: e.displacedBy,
viewport: a.frame,
last: s,
forceShouldAnimate: !1
}), l = Sm({
afterDragging: Um(s.all, r),
destination: o,
displacedBy: e.displacedBy,
viewport: t.frame,
last: s,
forceShouldAnimate: !1
}), u = {}, d = {}, f = [
s,
c,
l
];
return s.all.forEach((e) => {
let t = Wm(e, f);
if (t) {
d[e] = t;
return;
}
u[e] = !0;
}), {
...e,
displaced: {
all: s.all,
invisible: u,
visible: d
}
};
}, Km = (e, t) => Ap(e.scroll.diff.displacement, t), qm = ({ pageBorderBoxCenter: e, draggable: t, viewport: n }) => {
let r = jp(Km(n, e), t.page.borderBox.center);
return Ap(t.client.borderBox.center, r);
}, Jm = ({ draggable: e, destination: t, newPageBorderBoxCenter: n, viewport: r, withDroppableDisplacement: i, onlyOnMainAxis: a = !1 }) => {
let o = jp(n, e.page.borderBox.center), s = {
target: zp(e.page.borderBox, o),
destination: t,
withDroppableDisplacement: i,
viewport: r
};
return a ? ym(s) : vm(s);
}, Ym = ({ isMovingForward: e, draggable: t, destination: n, draggables: r, previousImpact: i, viewport: a, previousPageBorderBoxCenter: o, previousClientSelection: s, afterCritical: c }) => {
if (!n.isEnabled) return null;
let l = Qp(n.descriptor.id, r), u = rm(t, n), d = nm({
isMovingForward: e,
draggable: t,
destination: n,
insideDestination: l,
previousImpact: i
}) || km({
isMovingForward: e,
isInHomeList: u,
draggable: t,
draggables: r,
destination: n,
insideDestination: l,
previousImpact: i,
viewport: a,
afterCritical: c
});
if (!d) return null;
let f = Vm({
impact: d,
draggable: t,
droppable: n,
draggables: r,
afterCritical: c
});
if (Jm({
draggable: t,
destination: n,
newPageBorderBoxCenter: f,
viewport: a.frame,
withDroppableDisplacement: !1,
onlyOnMainAxis: !0
})) return {
clientSelection: qm({
pageBorderBoxCenter: f,
draggable: t,
viewport: a
}),
impact: d,
scrollJumpRequest: null
};
let p = jp(f, o);
return {
clientSelection: s,
impact: Gm({
impact: d,
viewport: a,
destination: n,
draggables: r,
maxScrollChange: p
}),
scrollJumpRequest: p
};
}, Xm = (e) => {
let t = e.subject.active;
return !t && J(), t;
}, Zm = ({ isMovingForward: e, pageBorderBoxCenter: t, source: n, droppables: r, viewport: i }) => {
let a = n.subject.active;
if (!a) return null;
let o = n.axis, s = sm(a[o.start], a[o.end]), c = Xp(r).filter((e) => e !== n).filter((e) => e.isEnabled).filter((e) => !!e.subject.active).filter((e) => cm(i.frame)(Xm(e))).filter((t) => {
let n = Xm(t);
return e ? a[o.crossAxisEnd] < n[o.crossAxisEnd] : n[o.crossAxisStart] < a[o.crossAxisStart];
}).filter((e) => {
let t = Xm(e), n = sm(t[o.start], t[o.end]);
return s(t[o.start]) || s(t[o.end]) || n(a[o.start]) || n(a[o.end]);
}).sort((t, n) => {
let r = Xm(t)[o.crossAxisStart], i = Xm(n)[o.crossAxisStart];
return e ? r - i : i - r;
}).filter((e, t, n) => Xm(e)[o.crossAxisStart] === Xm(n[0])[o.crossAxisStart]);
if (!c.length) return null;
if (c.length === 1) return c[0];
let l = c.filter((e) => sm(Xm(e)[o.start], Xm(e)[o.end])(t[o.line]));
return l.length === 1 ? l[0] : l.length > 1 ? l.sort((e, t) => Xm(e)[o.start] - Xm(t)[o.start])[0] : c.sort((e, n) => {
let r = Ip(t, Bp(Xm(e))), i = Ip(t, Bp(Xm(n)));
return r === i ? Xm(e)[o.start] - Xm(n)[o.start] : r - i;
})[0];
}, Qm = (e, t) => {
let n = e.page.borderBox.center;
return Em(e.descriptor.id, t) ? jp(n, t.displacedBy.point) : n;
}, $m = (e, t) => {
let n = e.page.borderBox;
return Em(e.descriptor.id, t) ? zp(n, Np(t.displacedBy.point)) : n;
}, eh = ({ pageBorderBoxCenter: e, viewport: t, destination: n, insideDestination: r, afterCritical: i }) => r.filter((e) => vm({
target: $m(e, i),
destination: n,
viewport: t.frame,
withDroppableDisplacement: !0
})).sort((t, r) => {
let a = Fp(e, zm(n, Qm(t, i))), o = Fp(e, zm(n, Qm(r, i)));
return a < o ? -1 : o < a ? 1 : t.descriptor.index - r.descriptor.index;
})[0] || null, th = qp(function(e, t) {
let n = t[e.line];
return {
value: n,
point: Pp(e.line, n)
};
}), nh = (e, t, n) => {
let r = e.axis;
if (e.descriptor.mode === "virtual") return Pp(r.line, t[r.line]);
let i = e.subject.page.contentBox[r.size], a = Qp(e.descriptor.id, n).reduce((e, t) => e + t.client.marginBox[r.size], 0) + t[r.line] - i;
return a <= 0 ? null : Pp(r.line, a);
}, rh = (e, t) => ({
...e,
scroll: {
...e.scroll,
max: t
}
}), ih = (e, t, n) => {
let r = e.frame;
rm(t, e) && J(), e.subject.withPlaceholder && J();
let i = th(e.axis, t.displaceBy).point, a = nh(e, i, n), o = {
placeholderSize: i,
increasedBy: a,
oldFrameMaxScroll: e.frame ? e.frame.scroll.max : null
};
if (!r) {
let t = Gp({
page: e.subject.page,
withPlaceholder: o,
axis: e.axis,
frame: e.frame
});
return {
...e,
subject: t
};
}
let s = rh(r, a ? Ap(r.scroll.max, a) : r.scroll.max), c = Gp({
page: e.subject.page,
withPlaceholder: o,
axis: e.axis,
frame: s
});
return {
...e,
subject: c,
frame: s
};
}, ah = (e) => {
let t = e.subject.withPlaceholder;
!t && J();
let n = e.frame;
if (!n) {
let t = Gp({
page: e.subject.page,
axis: e.axis,
frame: null,
withPlaceholder: null
});
return {
...e,
subject: t
};
}
let r = t.oldFrameMaxScroll;
!r && J();
let i = rh(n, r), a = Gp({
page: e.subject.page,
axis: e.axis,
frame: i,
withPlaceholder: null
});
return {
...e,
subject: a,
frame: i
};
}, oh = ({ previousPageBorderBoxCenter: e, moveRelativeTo: t, insideDestination: n, draggable: r, draggables: i, destination: a, viewport: o, afterCritical: s }) => {
if (!t) {
if (n.length) return null;
let e = {
displaced: am,
displacedBy: im,
at: {
type: "REORDER",
destination: {
droppableId: a.descriptor.id,
index: 0
}
}
}, t = Vm({
impact: e,
draggable: r,
droppable: a,
draggables: i,
afterCritical: s
});
return Jm({
draggable: r,
destination: rm(r, a) ? a : ih(a, r, i),
newPageBorderBoxCenter: t,
viewport: o.frame,
withDroppableDisplacement: !1,
onlyOnMainAxis: !0
}) ? e : null;
}
let c = e[a.axis.line] <= t.page.borderBox.center[a.axis.line], l = (() => {
let e = t.descriptor.index;
return t.descriptor.id === r.descriptor.id || c ? e : e + 1;
})();
return Tm({
draggable: r,
insideDestination: n,
destination: a,
viewport: o,
displacedBy: th(a.axis, r.displaceBy),
last: am,
index: l
});
}, sh = ({ isMovingForward: e, previousPageBorderBoxCenter: t, draggable: n, isOver: r, draggables: i, droppables: a, viewport: o, afterCritical: s }) => {
let c = Zm({
isMovingForward: e,
pageBorderBoxCenter: t,
source: r,
droppables: a,
viewport: o
});
if (!c) return null;
let l = Qp(c.descriptor.id, i), u = oh({
previousPageBorderBoxCenter: t,
destination: c,
draggable: n,
draggables: i,
moveRelativeTo: eh({
pageBorderBoxCenter: t,
viewport: o,
destination: c,
insideDestination: l,
afterCritical: s
}),
insideDestination: l,
viewport: o,
afterCritical: s
});
return u ? {
clientSelection: qm({
pageBorderBoxCenter: Vm({
impact: u,
draggable: n,
droppable: c,
draggables: i,
afterCritical: s
}),
draggable: n,
viewport: o
}),
impact: u,
scrollJumpRequest: null
} : null;
}, ch = (e) => {
let t = e.at;
return t ? t.type === "REORDER" ? t.destination.droppableId : t.combine.droppableId : null;
}, lh = (e, t) => {
let n = ch(e);
return n ? t[n] : null;
}, uh = ({ state: e, type: t }) => {
let n = lh(e.impact, e.dimensions.droppables), r = !!n, i = e.dimensions.droppables[e.critical.droppable.id], a = n || i, o = a.axis.direction, s = o === "vertical" && (t === "MOVE_UP" || t === "MOVE_DOWN") || o === "horizontal" && (t === "MOVE_LEFT" || t === "MOVE_RIGHT");
if (s && !r) return null;
let c = t === "MOVE_DOWN" || t === "MOVE_RIGHT", l = e.dimensions.draggables[e.critical.draggable.id], u = e.current.page.borderBoxCenter, { draggables: d, droppables: f } = e.dimensions;
return s ? Ym({
isMovingForward: c,
previousPageBorderBoxCenter: u,
draggable: l,
destination: a,
draggables: d,
viewport: e.viewport,
previousClientSelection: e.current.client.selection,
previousImpact: e.impact,
afterCritical: e.afterCritical
}) : sh({
isMovingForward: c,
previousPageBorderBoxCenter: u,
draggable: l,
isOver: a,
draggables: d,
droppables: f,
viewport: e.viewport,
afterCritical: e.afterCritical
});
};
function dh(e) {
return e.phase === "DRAGGING" || e.phase === "COLLECTING";
}
function fh(e) {
let t = sm(e.top, e.bottom), n = sm(e.left, e.right);
return function(e) {
return t(e.y) && n(e.x);
};
}
function ph(e, t) {
return e.left < t.right && e.right > t.left && e.top < t.bottom && e.bottom > t.top;
}
function mh({ pageBorderBox: e, draggable: t, candidates: n }) {
let r = t.page.borderBox.center, i = n.map((t) => {
let n = t.axis, i = Pp(t.axis.line, e.center[n.line], t.page.borderBox.center[n.crossAxisLine]);
return {
id: t.descriptor.id,
distance: Fp(r, i)
};
}).sort((e, t) => t.distance - e.distance);
return i[0] ? i[0].id : null;
}
function hh({ pageBorderBox: e, draggable: t, droppables: n }) {
let r = Xp(n).filter((t) => {
if (!t.isEnabled) return !1;
let n = t.subject.active;
if (!n || !ph(e, n)) return !1;
if (fh(n)(e.center)) return !0;
let r = t.axis, i = n.center[r.crossAxisLine], a = e[r.crossAxisStart], o = e[r.crossAxisEnd], s = sm(n[r.crossAxisStart], n[r.crossAxisEnd]), c = s(a), l = s(o);
return !c && !l ? !0 : c ? a < i : o > i;
});
return r.length ? r.length === 1 ? r[0].descriptor.id : mh({
pageBorderBox: e,
draggable: t,
candidates: r
}) : null;
}
var gh = (e, t) => $f(zp(e, t)), _h = (e, t) => {
let n = e.frame;
return n ? gh(t, n.scroll.diff.value) : t;
};
function vh({ displaced: e, id: t }) {
return !!(e.visible[t] || e.invisible[t]);
}
function yh({ draggable: e, closest: t, inHomeList: n }) {
return t ? n && t.descriptor.index > e.descriptor.index ? t.descriptor.index - 1 : t.descriptor.index : null;
}
var bh = ({ pageBorderBoxWithDroppableScroll: e, draggable: t, destination: n, insideDestination: r, last: i, viewport: a, afterCritical: o }) => {
let s = n.axis, c = th(n.axis, t.displaceBy), l = c.value, u = e[s.start], d = e[s.end];
return Tm({
draggable: t,
insideDestination: r,
destination: n,
viewport: a,
last: i,
displacedBy: c,
index: yh({
draggable: t,
closest: tm(t, r).find((e) => {
let t = e.descriptor.id, n = e.page.borderBox.center[s.line], r = Em(t, o), a = vh({
displaced: i,
id: t
});
return r ? a ? d <= n : u < n - l : a ? d <= n + l : u < n;
}) || null,
inHomeList: rm(t, n)
})
});
}, xh = 4, Sh = ({ draggable: e, pageBorderBoxWithDroppableScroll: t, previousImpact: n, destination: r, insideDestination: i, afterCritical: a }) => {
if (!r.isCombineEnabled) return null;
let o = r.axis, s = th(r.axis, e.displaceBy), c = s.value, l = t[o.start], u = t[o.end], d = tm(e, i).find((e) => {
let t = e.descriptor.id, r = e.page.borderBox, i = r[o.size] / xh, s = Em(t, a), d = vh({
displaced: n.displaced,
id: t
});
return s ? d ? u > r[o.start] + i && u < r[o.end] - i : l > r[o.start] - c + i && l < r[o.end] - c - i : d ? u > r[o.start] + c + i && u < r[o.end] + c - i : l > r[o.start] + i && l < r[o.end] - i;
});
return d ? {
displacedBy: s,
displaced: n.displaced,
at: {
type: "COMBINE",
combine: {
draggableId: d.descriptor.id,
droppableId: r.descriptor.id
}
}
} : null;
}, Ch = ({ pageOffset: e, draggable: t, draggables: n, droppables: r, previousImpact: i, viewport: a, afterCritical: o }) => {
let s = gh(t.page.borderBox, e), c = hh({
pageBorderBox: s,
draggable: t,
droppables: r
});
if (!c) return om;
let l = r[c], u = Qp(l.descriptor.id, n), d = _h(l, s);
return Sh({
pageBorderBoxWithDroppableScroll: d,
draggable: t,
previousImpact: i,
destination: l,
insideDestination: u,
afterCritical: o
}) || bh({
pageBorderBoxWithDroppableScroll: d,
draggable: t,
destination: l,
insideDestination: u,
last: i.displaced,
viewport: a,
afterCritical: o
});
}, wh = (e, t) => ({
...e,
[t.descriptor.id]: t
}), Th = ({ previousImpact: e, impact: t, droppables: n }) => {
let r = ch(e), i = ch(t);
if (!r || r === i) return n;
let a = n[r];
return a.subject.withPlaceholder ? wh(n, ah(a)) : n;
}, Eh = ({ draggable: e, draggables: t, droppables: n, previousImpact: r, impact: i }) => {
let a = Th({
previousImpact: r,
impact: i,
droppables: n
}), o = ch(i);
if (!o) return a;
let s = n[o];
return rm(e, s) || s.subject.withPlaceholder ? a : wh(a, ih(s, e, t));
}, Dh = ({ state: e, clientSelection: t, dimensions: n, viewport: r, impact: i, scrollJumpRequest: a }) => {
let o = r || e.viewport, s = n || e.dimensions, c = t || e.current.client.selection, l = jp(c, e.initial.client.selection), u = {
offset: l,
selection: c,
borderBoxCenter: Ap(e.initial.client.borderBoxCenter, l)
}, d = {
selection: Ap(u.selection, o.scroll.current),
borderBoxCenter: Ap(u.borderBoxCenter, o.scroll.current),
offset: Ap(u.offset, o.scroll.diff.value)
}, f = {
client: u,
page: d
};
if (e.phase === "COLLECTING") return {
...e,
dimensions: s,
viewport: o,
current: f
};
let p = s.draggables[e.critical.draggable.id], m = i || Ch({
pageOffset: d.offset,
draggable: p,
draggables: s.draggables,
droppables: s.droppables,
previousImpact: e.impact,
viewport: o,
afterCritical: e.afterCritical
}), h = Eh({
draggable: p,
impact: m,
previousImpact: e.impact,
draggables: s.draggables,
droppables: s.droppables
});
return {
...e,
current: f,
dimensions: {
draggables: s.draggables,
droppables: h
},
impact: m,
viewport: o,
scrollJumpRequest: a || null,
forceShouldAnimate: !a && null
};
};
function Oh(e, t) {
return e.map((e) => t[e]);
}
var kh = ({ impact: e, viewport: t, draggables: n, destination: r, forceShouldAnimate: i }) => {
let a = e.displaced, o = Sm({
afterDragging: Oh(a.all, n),
destination: r,
displacedBy: e.displacedBy,
viewport: t.frame,
forceShouldAnimate: i,
last: a
});
return {
...e,
displaced: o
};
}, Ah = ({ impact: e, draggable: t, droppable: n, draggables: r, viewport: i, afterCritical: a }) => qm({
pageBorderBoxCenter: Vm({
impact: e,
draggable: t,
draggables: r,
droppable: n,
afterCritical: a
}),
draggable: t,
viewport: i
}), jh = ({ state: e, dimensions: t, viewport: n }) => {
e.movementMode !== "SNAP" && J();
let r = e.impact, i = n || e.viewport, a = t || e.dimensions, { draggables: o, droppables: s } = a, c = o[e.critical.draggable.id], l = ch(r);
!l && J();
let u = s[l], d = kh({
impact: r,
viewport: i,
destination: u,
draggables: o
});
return Dh({
impact: d,
clientSelection: Ah({
impact: d,
draggable: c,
droppable: u,
draggables: o,
viewport: i,
afterCritical: e.afterCritical
}),
state: e,
dimensions: a,
viewport: i
});
}, Mh = (e) => ({
index: e.index,
droppableId: e.droppableId
}), Nh = ({ draggable: e, home: t, draggables: n, viewport: r }) => {
let i = th(t.axis, e.displaceBy), a = Qp(t.descriptor.id, n), o = a.indexOf(e);
o === -1 && J();
let s = a.slice(o + 1), c = s.reduce((e, t) => (e[t.descriptor.id] = !0, e), {}), l = {
inVirtualList: t.descriptor.mode === "virtual",
displacedBy: i,
effected: c
};
return {
impact: {
displaced: Sm({
afterDragging: s,
destination: t,
displacedBy: i,
last: null,
viewport: r.frame,
forceShouldAnimate: !1
}),
displacedBy: i,
at: {
type: "REORDER",
destination: Mh(e.descriptor)
}
},
afterCritical: l
};
}, Ph = (e, t) => ({
draggables: e.draggables,
droppables: wh(e.droppables, t)
}), Fh = ({ draggable: e, offset: t, initialWindowScroll: n }) => {
let r = sp(e.client, t), i = cp(r, n);
return {
...e,
placeholder: {
...e.placeholder,
client: r
},
client: r,
page: i
};
}, Ih = (e) => {
let t = e.frame;
return !t && J(), t;
}, Lh = ({ additions: e, updatedDroppables: t, viewport: n }) => {
let r = n.scroll.diff.value;
return e.map((e) => {
let i = t[e.descriptor.droppableId], a = Ih(i).scroll.diff.value;
return Fh({
draggable: e,
offset: Ap(r, a),
initialWindowScroll: n.scroll.initial
});
});
}, Rh = ({ state: e, published: t }) => {
let n = t.modified.map((t) => {
let n = e.dimensions.droppables[t.droppableId];
return Kp(n, t.scroll);
}), r = {
...e.dimensions.droppables,
...Jp(n)
}, i = Yp(Lh({
additions: t.additions,
updatedDroppables: r,
viewport: e.viewport
})), a = {
...e.dimensions.draggables,
...i
};
t.removals.forEach((e) => {
delete a[e];
});
let o = {
droppables: r,
draggables: a
}, s = ch(e.impact), c = s ? o.droppables[s] : null, l = o.draggables[e.critical.draggable.id], u = o.droppables[e.critical.droppable.id], { impact: d, afterCritical: f } = Nh({
draggable: l,
home: u,
draggables: a,
viewport: e.viewport
}), p = c && c.isCombineEnabled ? e.impact : d, m = Ch({
pageOffset: e.current.page.offset,
draggable: o.draggables[e.critical.draggable.id],
draggables: o.draggables,
droppables: o.droppables,
previousImpact: p,
viewport: e.viewport,
afterCritical: f
}), h = {
...e,
phase: "DRAGGING",
impact: m,
onLiftImpact: d,
dimensions: o,
afterCritical: f,
forceShouldAnimate: !1
};
return e.phase === "COLLECTING" ? h : {
...h,
phase: "DROP_PENDING",
reason: e.reason,
isWaiting: !1
};
}, zh = (e) => e.movementMode === "SNAP", Bh = (e, t, n) => {
let r = Ph(e.dimensions, t);
return !zh(e) || n ? Dh({
state: e,
dimensions: r
}) : jh({
state: e,
dimensions: r
});
};
function Vh(e) {
return e.isDragging && e.movementMode === "SNAP" ? {
...e,
scrollJumpRequest: null
} : e;
}
var Hh = {
phase: "IDLE",
completed: null,
shouldFlush: !1
}, Uh = (e = Hh, t) => {
if (t.type === "FLUSH") return {
...Hh,
shouldFlush: !0
};
if (t.type === "INITIAL_PUBLISH") {
e.phase !== "IDLE" && J();
let { critical: n, clientSelection: r, viewport: i, dimensions: a, movementMode: o } = t.payload, s = a.draggables[n.draggable.id], c = a.droppables[n.droppable.id], l = {
selection: r,
borderBoxCenter: s.client.borderBox.center,
offset: kp
}, u = {
client: l,
page: {
selection: Ap(l.selection, i.scroll.initial),
borderBoxCenter: Ap(l.selection, i.scroll.initial),
offset: Ap(l.selection, i.scroll.diff.value)
}
}, d = Xp(a.droppables).every((e) => !e.isFixedOnPage), { impact: f, afterCritical: p } = Nh({
draggable: s,
home: c,
draggables: a.draggables,
viewport: i
});
return {
phase: "DRAGGING",
isDragging: !0,
critical: n,
movementMode: o,
dimensions: a,
initial: u,
current: u,
isWindowScrollAllowed: d,
impact: f,
afterCritical: p,
onLiftImpact: f,
viewport: i,
scrollJumpRequest: null,
forceShouldAnimate: null
};
}
if (t.type === "COLLECTION_STARTING") return e.phase === "COLLECTING" || e.phase === "DROP_PENDING" ? e : (e.phase !== "DRAGGING" && J(), {
...e,
phase: "COLLECTING"
});
if (t.type === "PUBLISH_WHILE_DRAGGING") return e.phase !== "COLLECTING" && e.phase !== "DROP_PENDING" && J(), Rh({
state: e,
published: t.payload
});
if (t.type === "MOVE") {
if (e.phase === "DROP_PENDING") return e;
!dh(e) && J();
let { client: n } = t.payload;
return Mp(n, e.current.client.selection) ? e : Dh({
state: e,
clientSelection: n,
impact: zh(e) ? e.impact : null
});
}
if (t.type === "UPDATE_DROPPABLE_SCROLL") {
if (e.phase === "DROP_PENDING" || e.phase === "COLLECTING") return Vh(e);
!dh(e) && J();
let { id: n, newScroll: r } = t.payload, i = e.dimensions.droppables[n];
return i ? Bh(e, Kp(i, r), !1) : e;
}
if (t.type === "UPDATE_DROPPABLE_IS_ENABLED") {
if (e.phase === "DROP_PENDING") return e;
!dh(e) && J();
let { id: n, isEnabled: r } = t.payload, i = e.dimensions.droppables[n];
return !i && J(), i.isEnabled === r && J(), Bh(e, {
...i,
isEnabled: r
}, !0);
}
if (t.type === "UPDATE_DROPPABLE_IS_COMBINE_ENABLED") {
if (e.phase === "DROP_PENDING") return e;
!dh(e) && J();
let { id: n, isCombineEnabled: r } = t.payload, i = e.dimensions.droppables[n];
return !i && J(), i.isCombineEnabled === r && J(), Bh(e, {
...i,
isCombineEnabled: r
}, !0);
}
if (t.type === "MOVE_BY_WINDOW_SCROLL") {
if (e.phase === "DROP_PENDING" || e.phase === "DROP_ANIMATING") return e;
!dh(e) && J(), !e.isWindowScrollAllowed && J();
let n = t.payload.newScroll;
if (Mp(e.viewport.scroll.current, n)) return Vh(e);
let r = Hm(e.viewport, n);
return zh(e) ? jh({
state: e,
viewport: r
}) : Dh({
state: e,
viewport: r
});
}
if (t.type === "UPDATE_VIEWPORT_MAX_SCROLL") {
if (!dh(e)) return e;
let n = t.payload.maxScroll;
if (Mp(n, e.viewport.scroll.max)) return e;
let r = {
...e.viewport,
scroll: {
...e.viewport.scroll,
max: n
}
};
return {
...e,
viewport: r
};
}
if (t.type === "MOVE_UP" || t.type === "MOVE_DOWN" || t.type === "MOVE_LEFT" || t.type === "MOVE_RIGHT") {
if (e.phase === "COLLECTING" || e.phase === "DROP_PENDING") return e;
e.phase !== "DRAGGING" && J();
let n = uh({
state: e,
type: t.type
});
return n ? Dh({
state: e,
impact: n.impact,
clientSelection: n.clientSelection,
scrollJumpRequest: n.scrollJumpRequest
}) : e;
}
if (t.type === "DROP_PENDING") {
let n = t.payload.reason;
return e.phase !== "COLLECTING" && J(), {
...e,
phase: "DROP_PENDING",
isWaiting: !0,
reason: n
};
}
if (t.type === "DROP_ANIMATE") {
let { completed: n, dropDuration: r, newHomeClientOffset: i } = t.payload;
return e.phase !== "DRAGGING" && e.phase !== "DROP_PENDING" && J(), {
phase: "DROP_ANIMATING",
completed: n,
dropDuration: r,
newHomeClientOffset: i,
dimensions: e.dimensions
};
}
if (t.type === "DROP_COMPLETE") {
let { completed: e } = t.payload;
return {
phase: "IDLE",
completed: e,
shouldFlush: !1
};
}
return e;
};
function Z(e, t) {
return e instanceof Object && "type" in e && e.type === t;
}
var Wh = (e) => ({
type: "BEFORE_INITIAL_CAPTURE",
payload: e
}), Gh = (e) => ({
type: "LIFT",
payload: e
}), Kh = (e) => ({
type: "INITIAL_PUBLISH",
payload: e
}), qh = (e) => ({
type: "PUBLISH_WHILE_DRAGGING",
payload: e
}), Jh = () => ({
type: "COLLECTION_STARTING",
payload: null
}), Yh = (e) => ({
type: "UPDATE_DROPPABLE_SCROLL",
payload: e
}), Xh = (e) => ({
type: "UPDATE_DROPPABLE_IS_ENABLED",
payload: e
}), Zh = (e) => ({
type: "UPDATE_DROPPABLE_IS_COMBINE_ENABLED",
payload: e
}), Qh = (e) => ({
type: "MOVE",
payload: e
}), $h = (e) => ({
type: "MOVE_BY_WINDOW_SCROLL",
payload: e
}), eg = (e) => ({
type: "UPDATE_VIEWPORT_MAX_SCROLL",
payload: e
}), tg = () => ({
type: "MOVE_UP",
payload: null
}), ng = () => ({
type: "MOVE_DOWN",
payload: null
}), rg = () => ({
type: "MOVE_RIGHT",
payload: null
}), ig = () => ({
type: "MOVE_LEFT",
payload: null
}), ag = () => ({
type: "FLUSH",
payload: null
}), og = (e) => ({
type: "DROP_ANIMATE",
payload: e
}), sg = (e) => ({
type: "DROP_COMPLETE",
payload: e
}), cg = (e) => ({
type: "DROP",
payload: e
}), lg = (e) => ({
type: "DROP_PENDING",
payload: e
}), ug = () => ({
type: "DROP_ANIMATION_FINISHED",
payload: null
}), dg = (e) => ({ getState: t, dispatch: n }) => (r) => (i) => {
if (!Z(i, "LIFT")) {
r(i);
return;
}
let { id: a, clientSelection: o, movementMode: s } = i.payload, c = t();
c.phase === "DROP_ANIMATING" && n(sg({ completed: c.completed })), t().phase !== "IDLE" && J(), n(ag()), n(Wh({
draggableId: a,
movementMode: s
}));
let l = {
draggableId: a,
scrollOptions: { shouldPublishImmediately: s === "SNAP" }
}, { critical: u, dimensions: d, viewport: f } = e.startPublishing(l);
n(Kh({
critical: u,
dimensions: d,
clientSelection: o,
movementMode: s,
viewport: f
}));
}, fg = (e) => () => (t) => (n) => {
Z(n, "INITIAL_PUBLISH") && e.dragging(), Z(n, "DROP_ANIMATE") && e.dropping(n.payload.completed.result.reason), (Z(n, "FLUSH") || Z(n, "DROP_COMPLETE")) && e.resting(), t(n);
}, pg = {
outOfTheWay: "cubic-bezier(0.2, 0, 0, 1)",
drop: "cubic-bezier(.2,1,.1,1)"
}, mg = {
opacity: {
drop: 0,
combining: .7
},
scale: { drop: .75 }
}, hg = {
outOfTheWay: .2,
minDropTime: .33,
maxDropTime: .55
}, gg = `${hg.outOfTheWay}s ${pg.outOfTheWay}`, _g = {
fluid: `opacity ${gg}`,
snap: `transform ${gg}, opacity ${gg}`,
drop: (e) => {
let t = `${e}s ${pg.drop}`;
return `transform ${t}, opacity ${t}`;
},
outOfTheWay: `transform ${gg}`,
placeholder: `height ${gg}, width ${gg}, margin ${gg}`
}, vg = (e) => Mp(e, kp) ? void 0 : `translate(${e.x}px, ${e.y}px)`, yg = {
moveTo: vg,
drop: (e, t) => {
let n = vg(e);
if (n) return t ? `${n} scale(${mg.scale.drop})` : n;
}
}, { minDropTime: bg, maxDropTime: xg } = hg, Sg = xg - bg, Cg = 1500, wg = .6, Tg = ({ current: e, destination: t, reason: n }) => {
let r = Fp(e, t);
if (r <= 0) return bg;
if (r >= Cg) return xg;
let i = bg + r / Cg * Sg, a = n === "CANCEL" ? i * wg : i;
return Number(a.toFixed(2));
}, Eg = ({ impact: e, draggable: t, dimensions: n, viewport: r, afterCritical: i }) => {
let { draggables: a, droppables: o } = n, s = ch(e), c = s ? o[s] : null, l = o[t.descriptor.droppableId];
return jp(Ah({
impact: e,
draggable: t,
draggables: a,
afterCritical: i,
droppable: c || l,
viewport: r
}), t.client.borderBox.center);
}, Dg = ({ draggables: e, reason: t, lastImpact: n, home: r, viewport: i, onLiftImpact: a }) => !n.at || t !== "DROP" ? {
impact: kh({
draggables: e,
impact: a,
destination: r,
viewport: i,
forceShouldAnimate: !0
}),
didDropInsideDroppable: !1
} : n.at.type === "REORDER" ? {
impact: n,
didDropInsideDroppable: !0
} : {
impact: {
...n,
displaced: am
},
didDropInsideDroppable: !0
}, Og = ({ getState: e, dispatch: t }) => (n) => (r) => {
if (!Z(r, "DROP")) {
n(r);
return;
}
let i = e(), a = r.payload.reason;
if (i.phase === "COLLECTING") {
t(lg({ reason: a }));
return;
}
if (i.phase === "IDLE") return;
i.phase === "DROP_PENDING" && i.isWaiting && J(), i.phase !== "DRAGGING" && i.phase !== "DROP_PENDING" && J();
let o = i.critical, s = i.dimensions, c = s.draggables[i.critical.draggable.id], { impact: l, didDropInsideDroppable: u } = Dg({
reason: a,
lastImpact: i.impact,
afterCritical: i.afterCritical,
onLiftImpact: i.onLiftImpact,
home: i.dimensions.droppables[i.critical.droppable.id],
viewport: i.viewport,
draggables: i.dimensions.draggables
}), d = u ? $p(l) : null, f = u ? em(l) : null, p = {
index: o.draggable.index,
droppableId: o.droppable.id
}, m = {
draggableId: c.descriptor.id,
type: c.descriptor.type,
source: p,
reason: a,
mode: i.movementMode,
destination: d,
combine: f
}, h = Eg({
impact: l,
draggable: c,
dimensions: s,
viewport: i.viewport,
afterCritical: i.afterCritical
}), g = {
critical: i.critical,
afterCritical: i.afterCritical,
result: m,
impact: l
};
if (!(!Mp(i.current.client.offset, h) || m.combine)) {
t(sg({ completed: g }));
return;
}
t(og({
newHomeClientOffset: h,
dropDuration: Tg({
current: i.current.client.offset,
destination: h,
reason: a
}),
completed: g
}));
}, kg = () => ({
x: window.pageXOffset,
y: window.pageYOffset
});
function Ag(e) {
return {
eventName: "scroll",
options: {
passive: !0,
capture: !1
},
fn: (t) => {
(t.target === window || t.target === window.document) && e();
}
};
}
function jg({ onWindowScroll: e }) {
function t() {
e(kg());
}
let n = dp(t), r = Ag(n), i = pp;
function a() {
return i !== pp;
}
function o() {
a() && J(), i = hp(window, [r]);
}
function s() {
!a() && J(), n.cancel(), i(), i = pp;
}
return {
start: o,
stop: s,
isActive: a
};
}
var Mg = (e) => Z(e, "DROP_COMPLETE") || Z(e, "DROP_ANIMATE") || Z(e, "FLUSH"), Ng = (e) => {
let t = jg({ onWindowScroll: (t) => {
e.dispatch($h({ newScroll: t }));
} });
return (e) => (n) => {
!t.isActive() && Z(n, "INITIAL_PUBLISH") && t.start(), t.isActive() && Mg(n) && t.stop(), e(n);
};
}, Pg = (e) => {
let t = !1, n = !1, r = setTimeout(() => {
n = !0;
}), i = (i) => {
t || n || (t = !0, e(i), clearTimeout(r));
};
return i.wasCalled = () => t, i;
}, Fg = () => {
let e = [], t = (t) => {
let n = e.findIndex((e) => e.timerId === t);
n === -1 && J();
let [r] = e.splice(n, 1);
r.callback();
};
return {
add: (n) => {
let r = setTimeout(() => t(r)), i = {
timerId: r,
callback: n
};
e.push(i);
},
flush: () => {
if (!e.length) return;
let t = [...e];
e.length = 0, t.forEach((e) => {
clearTimeout(e.timerId), e.callback();
});
}
};
}, Ig = (e, t) => e == null && t == null ? !0 : e == null || t == null ? !1 : e.droppableId === t.droppableId && e.index === t.index, Lg = (e, t) => e == null && t == null ? !0 : e == null || t == null ? !1 : e.draggableId === t.draggableId && e.droppableId === t.droppableId, Rg = (e, t) => {
if (e === t) return !0;
let n = e.draggable.id === t.draggable.id && e.draggable.droppableId === t.draggable.droppableId && e.draggable.type === t.draggable.type && e.draggable.index === t.draggable.index, r = e.droppable.id === t.droppable.id && e.droppable.type === t.droppable.type;
return n && r;
}, zg = (e, t) => {
t();
}, Bg = (e, t) => ({
draggableId: e.draggable.id,
type: e.droppable.type,
source: {
droppableId: e.droppable.id,
index: e.draggable.index
},
mode: t
});
function Vg(e, t, n, r) {
if (!e) {
n(r(t));
return;
}
let i = Pg(n);
e(t, { announce: i }), i.wasCalled() || n(r(t));
}
var Hg = (e, t) => {
let n = Fg(), r = null, i = (t, n) => {
r && J(), zg("onBeforeCapture", () => {
let r = e().onBeforeCapture;
r && r({
draggableId: t,
mode: n
});
});
}, a = (t, n) => {
r && J(), zg("onBeforeDragStart", () => {
let r = e().onBeforeDragStart;
r && r(Bg(t, n));
});
}, o = (i, a) => {
r && J();
let o = Bg(i, a);
r = {
mode: a,
lastCritical: i,
lastLocation: o.source,
lastCombine: null
}, n.add(() => {
zg("onDragStart", () => Vg(e().onDragStart, o, t, Ep.onDragStart));
});
}, s = (i, a) => {
let o = $p(a), s = em(a);
!r && J();
let c = !Rg(i, r.lastCritical);
c && (r.lastCritical = i);
let l = !Ig(r.lastLocation, o);
l && (r.lastLocation = o);
let u = !Lg(r.lastCombine, s);
if (u && (r.lastCombine = s), !c && !l && !u) return;
let d = {
...Bg(i, r.mode),
combine: s,
destination: o
};
n.add(() => {
zg("onDragUpdate", () => Vg(e().onDragUpdate, d, t, Ep.onDragUpdate));
});
}, c = () => {
!r && J(), n.flush();
}, l = (n) => {
!r && J(), r = null, zg("onDragEnd", () => Vg(e().onDragEnd, n, t, Ep.onDragEnd));
};
return {
beforeCapture: i,
beforeStart: a,
start: o,
update: s,
flush: c,
drop: l,
abort: () => {
if (!r) return;
let e = {
...Bg(r.lastCritical, r.mode),
combine: null,
destination: null,
reason: "CANCEL"
};
l(e);
}
};
}, Ug = (e, t) => {
let n = Hg(e, t);
return (e) => (t) => (r) => {
if (Z(r, "BEFORE_INITIAL_CAPTURE")) {
n.beforeCapture(r.payload.draggableId, r.payload.movementMode);
return;
}
if (Z(r, "INITIAL_PUBLISH")) {
let e = r.payload.critical;
n.beforeStart(e, r.payload.movementMode), t(r), n.start(e, r.payload.movementMode);
return;
}
if (Z(r, "DROP_COMPLETE")) {
let e = r.payload.completed.result;
n.flush(), t(r), n.drop(e);
return;
}
if (t(r), Z(r, "FLUSH")) {
n.abort();
return;
}
let i = e.getState();
i.phase === "DRAGGING" && n.update(i.critical, i.impact);
};
}, Wg = (e) => (t) => (n) => {
if (!Z(n, "DROP_ANIMATION_FINISHED")) {
t(n);
return;
}
let r = e.getState();
r.phase !== "DROP_ANIMATING" && J(), e.dispatch(sg({ completed: r.completed }));
}, Gg = (e) => {
let t = null, n = null;
function r() {
n &&= (cancelAnimationFrame(n), null), t &&= (t(), null);
}
return (i) => (a) => {
if ((Z(a, "FLUSH") || Z(a, "DROP_COMPLETE") || Z(a, "DROP_ANIMATION_FINISHED")) && r(), i(a), !Z(a, "DROP_ANIMATE")) return;
let o = {
eventName: "scroll",
options: {
capture: !0,
passive: !1,
once: !0
},
fn: function() {
e.getState().phase === "DROP_ANIMATING" && e.dispatch(ug());
}
};
n = requestAnimationFrame(() => {
n = null, t = hp(window, [o]);
});
};
}, Kg = (e) => () => (t) => (n) => {
(Z(n, "DROP_COMPLETE") || Z(n, "FLUSH") || Z(n, "DROP_ANIMATE")) && e.stopPublishing(), t(n);
}, qg = (e) => {
let t = !1;
return () => (n) => (r) => {
if (Z(r, "INITIAL_PUBLISH")) {
t = !0, e.tryRecordFocus(r.payload.critical.draggable.id), n(r), e.tryRestoreFocusRecorded();
return;
}
if (n(r), t) {
if (Z(r, "FLUSH")) {
t = !1, e.tryRestoreFocusRecorded();
return;
}
if (Z(r, "DROP_COMPLETE")) {
t = !1;
let n = r.payload.completed.result;
n.combine && e.tryShiftRecord(n.draggableId, n.combine.draggableId), e.tryRestoreFocusRecorded();
}
}
};
}, Jg = (e) => Z(e, "DROP_COMPLETE") || Z(e, "DROP_ANIMATE") || Z(e, "FLUSH"), Yg = (e) => (t) => (n) => (r) => {
if (Jg(r)) {
e.stop(), n(r);
return;
}
if (Z(r, "INITIAL_PUBLISH")) {
n(r);
let i = t.getState();
i.phase !== "DRAGGING" && J(), e.start(i);
return;
}
n(r), e.scroll(t.getState());
}, Xg = (e) => (t) => (n) => {
if (t(n), !Z(n, "PUBLISH_WHILE_DRAGGING")) return;
let r = e.getState();
r.phase === "DROP_PENDING" && (r.isWaiting || e.dispatch(cg({ reason: r.reason })));
}, Zg = n, Qg = ({ dimensionMarshal: t, focusMarshal: n, styleMarshal: r, getResponders: a, announce: o, autoScroller: s }) => i(Uh, Zg(e(fg(r), Kg(t), dg(t), Og, Wg, Gg, Xg, Yg(s), Ng, qg(n), Ug(a, o)))), $g = () => ({
additions: {},
removals: {},
modified: {}
});
function e_({ registry: e, callbacks: t }) {
let n = $g(), r = null, i = () => {
r ||= (t.collectionStarting(), requestAnimationFrame(() => {
r = null;
let { additions: i, removals: a, modified: o } = n, s = Object.keys(i).map((t) => e.draggable.getById(t).getDimension(kp)).sort((e, t) => e.descriptor.index - t.descriptor.index), c = Object.keys(o).map((t) => ({
droppableId: t,
scroll: e.droppable.getById(t).callbacks.getScrollWhileDragging()
})), l = {
additions: s,
removals: Object.keys(a),
modified: c
};
n = $g(), t.publish(l);
}));
};
return {
add: (e) => {
let t = e.descriptor.id;
n.additions[t] = e, n.modified[e.descriptor.droppableId] = !0, n.removals[t] && delete n.removals[t], i();
},
remove: (e) => {
let t = e.descriptor;
n.removals[t.id] = !0, n.modified[t.droppableId] = !0, n.additions[t.id] && delete n.additions[t.id], i();
},
stop: () => {
r && (cancelAnimationFrame(r), r = null, n = $g());
}
};
}
var t_ = ({ scrollHeight: e, scrollWidth: t, height: n, width: r }) => {
let i = jp({
x: t,
y: e
}, {
x: r,
y: n
});
return {
x: Math.max(0, i.x),
y: Math.max(0, i.y)
};
}, n_ = () => {
let e = document.documentElement;
return !e && J(), e;
}, r_ = () => {
let e = n_();
return t_({
scrollHeight: e.scrollHeight,
scrollWidth: e.scrollWidth,
width: e.clientWidth,
height: e.clientHeight
});
}, i_ = () => {
let e = kg(), t = r_(), n = e.y, r = e.x, i = n_(), a = i.clientWidth, o = i.clientHeight;
return {
frame: $f({
top: n,
left: r,
right: r + a,
bottom: n + o
}),
scroll: {
initial: e,
current: e,
max: t,
diff: {
value: kp,
displacement: kp
}
}
};
}, a_ = ({ critical: e, scrollOptions: t, registry: n }) => {
let r = i_(), i = r.scroll.current, a = e.droppable, o = n.droppable.getAllByType(a.type).map((e) => e.callbacks.getDimensionAndWatchScroll(i, t));
return {
dimensions: {
draggables: Yp(n.draggable.getAllByType(e.draggable.type).map((e) => e.getDimension(i))),
droppables: Jp(o)
},
critical: e,
viewport: r
};
};
function o_(e, t, n) {
return n.descriptor.id !== t.id && n.descriptor.type === t.type && e.droppable.getById(n.descriptor.droppableId).descriptor.mode === "virtual";
}
var s_ = (e, t) => {
let n = null, r = e_({
callbacks: {
publish: t.publishWhileDragging,
collectionStarting: t.collectionStarting
},
registry: e
}), i = (r, i) => {
!e.droppable.exists(r) && J(), n && t.updateDroppableIsEnabled({
id: r,
isEnabled: i
});
}, a = (r, i) => {
n && (!e.droppable.exists(r) && J(), t.updateDroppableIsCombineEnabled({
id: r,
isCombineEnabled: i
}));
}, o = (r, i) => {
n && (!e.droppable.exists(r) && J(), t.updateDroppableScroll({
id: r,
newScroll: i
}));
}, s = (t, r) => {
n && e.droppable.getById(t).callbacks.scroll(r);
}, c = () => {
if (!n) return;
r.stop();
let t = n.critical.droppable;
e.droppable.getAllByType(t.type).forEach((e) => e.callbacks.dragStopped()), n.unsubscribe(), n = null;
}, l = (t) => {
!n && J();
let i = n.critical.draggable;
t.type === "ADDITION" && o_(e, i, t.value) && r.add(t.value), t.type === "REMOVAL" && o_(e, i, t.value) && r.remove(t.value);
};
return {
updateDroppableIsEnabled: i,
updateDroppableIsCombineEnabled: a,
scrollDroppable: s,
updateDroppableScroll: o,
startPublishing: (t) => {
n && J();
let r = e.draggable.getById(t.draggableId), i = e.droppable.getById(r.descriptor.droppableId), a = {
draggable: r.descriptor,
droppable: i.descriptor
};
return n = {
critical: a,
unsubscribe: e.subscribe(l)
}, a_({
critical: a,
registry: e,
scrollOptions: t.scrollOptions
});
},
stopPublishing: c
};
}, c_ = (e, t) => e.phase === "IDLE" ? !0 : e.phase !== "DROP_ANIMATING" || e.completed.result.draggableId === t ? !1 : e.completed.result.reason === "DROP", l_ = (e) => {
window.scrollBy(e.x, e.y);
}, u_ = qp((e) => Xp(e).filter((e) => !(!e.isEnabled || !e.frame))), d_ = (e, t) => u_(t).find((t) => (!t.frame && J(), fh(t.frame.pageMarginBox)(e))) || null, f_ = ({ center: e, destination: t, droppables: n }) => {
if (t) {
let e = n[t];
return e.frame ? e : null;
}
return d_(e, n);
}, p_ = {
startFromPercentage: .25,
maxScrollAtPercentage: .05,
maxPixelScroll: 28,
ease: (e) => e ** 2,
durationDampening: {
stopDampeningAt: 1200,
accelerateAt: 360
},
disabled: !1
}, m_ = (e, t, n = () => p_) => {
let r = n();
return {
startScrollingFrom: e[t.size] * r.startFromPercentage,
maxScrollValueAt: e[t.size] * r.maxScrollAtPercentage
};
}, h_ = ({ startOfRange: e, endOfRange: t, current: n }) => {
let r = t - e;
return r === 0 ? 0 : (n - e) / r;
}, g_ = 1, __ = (e, t, n = () => p_) => {
let r = n();
if (e > t.startScrollingFrom) return 0;
if (e <= t.maxScrollValueAt) return r.maxPixelScroll;
if (e === t.startScrollingFrom) return g_;
let i = 1 - h_({
startOfRange: t.maxScrollValueAt,
endOfRange: t.startScrollingFrom,
current: e
}), a = r.maxPixelScroll * r.ease(i);
return Math.ceil(a);
}, v_ = (e, t, n) => {
let r = n(), i = r.durationDampening.accelerateAt, a = r.durationDampening.stopDampeningAt, o = t, s = a, c = Date.now() - o;
if (c >= a) return e;
if (c < i) return g_;
let l = h_({
startOfRange: i,
endOfRange: s,
current: c
}), u = e * r.ease(l);
return Math.ceil(u);
}, y_ = ({ distanceToEdge: e, thresholds: t, dragStartTime: n, shouldUseTimeDampening: r, getAutoScrollerOptions: i }) => {
let a = __(e, t, i);
return a === 0 ? 0 : r ? Math.max(v_(a, n, i), g_) : a;
}, b_ = ({ container: e, distanceToEdges: t, dragStartTime: n, axis: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
let o = m_(e, r, a);
return t[r.end] < t[r.start] ? y_({
distanceToEdge: t[r.end],
thresholds: o,
dragStartTime: n,
shouldUseTimeDampening: i,
getAutoScrollerOptions: a
}) : -1 * y_({
distanceToEdge: t[r.start],
thresholds: o,
dragStartTime: n,
shouldUseTimeDampening: i,
getAutoScrollerOptions: a
});
}, x_ = ({ container: e, subject: t, proposedScroll: n }) => {
let r = t.height > e.height, i = t.width > e.width;
return !i && !r ? n : i && r ? null : {
x: i ? 0 : n.x,
y: r ? 0 : n.y
};
}, S_ = Lp((e) => e === 0 ? 0 : e), C_ = ({ dragStartTime: e, container: t, subject: n, center: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
let o = {
top: r.y - t.top,
right: t.right - r.x,
bottom: t.bottom - r.y,
left: r.x - t.left
}, s = b_({
container: t,
distanceToEdges: o,
dragStartTime: e,
axis: um,
shouldUseTimeDampening: i,
getAutoScrollerOptions: a
}), c = S_({
x: b_({
container: t,
distanceToEdges: o,
dragStartTime: e,
axis: dm,
shouldUseTimeDampening: i,
getAutoScrollerOptions: a
}),
y: s
});
if (Mp(c, kp)) return null;
let l = x_({
container: t,
subject: n,
proposedScroll: c
});
return l ? Mp(l, kp) ? null : l : null;
}, w_ = Lp((e) => e === 0 ? 0 : e > 0 ? 1 : -1), T_ = (() => {
let e = (e, t) => e < 0 ? e : e > t ? e - t : 0;
return ({ current: t, max: n, change: r }) => {
let i = Ap(t, r), a = {
x: e(i.x, n.x),
y: e(i.y, n.y)
};
return Mp(a, kp) ? null : a;
};
})(), E_ = ({ max: e, current: t, change: n }) => {
let r = {
x: Math.max(t.x, e.x),
y: Math.max(t.y, e.y)
}, i = w_(n), a = T_({
max: r,
current: t,
change: i
});
return !a || i.x !== 0 && a.x === 0 || i.y !== 0 && a.y === 0;
}, D_ = (e, t) => E_({
current: e.scroll.current,
max: e.scroll.max,
change: t
}), O_ = (e, t) => {
if (!D_(e, t)) return null;
let n = e.scroll.max, r = e.scroll.current;
return T_({
current: r,
max: n,
change: t
});
}, k_ = (e, t) => {
let n = e.frame;
return n ? E_({
current: n.scroll.current,
max: n.scroll.max,
change: t
}) : !1;
}, A_ = (e, t) => {
let n = e.frame;
return !n || !k_(e, t) ? null : T_({
current: n.scroll.current,
max: n.scroll.max,
change: t
});
}, j_ = ({ viewport: e, subject: t, center: n, dragStartTime: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
let o = C_({
dragStartTime: r,
container: e.frame,
subject: t,
center: n,
shouldUseTimeDampening: i,
getAutoScrollerOptions: a
});
return o && D_(e, o) ? o : null;
}, M_ = ({ droppable: e, subject: t, center: n, dragStartTime: r, shouldUseTimeDampening: i, getAutoScrollerOptions: a }) => {
let o = e.frame;
if (!o) return null;
let s = C_({
dragStartTime: r,
container: o.pageMarginBox,
subject: t,
center: n,
shouldUseTimeDampening: i,
getAutoScrollerOptions: a
});
return s && k_(e, s) ? s : null;
}, N_ = ({ state: e, dragStartTime: t, shouldUseTimeDampening: n, scrollWindow: r, scrollDroppable: i, getAutoScrollerOptions: a }) => {
let o = e.current.page.borderBoxCenter, s = e.dimensions.draggables[e.critical.draggable.id].page.marginBox;
if (e.isWindowScrollAllowed) {
let i = e.viewport, c = j_({
dragStartTime: t,
viewport: i,
subject: s,
center: o,
shouldUseTimeDampening: n,
getAutoScrollerOptions: a
});
if (c) {
r(c);
return;
}
}
let c = f_({
center: o,
destination: ch(e.impact),
droppables: e.dimensions.droppables
});
if (!c) return;
let l = M_({
dragStartTime: t,
droppable: c,
subject: s,
center: o,
shouldUseTimeDampening: n,
getAutoScrollerOptions: a
});
l && i(c.descriptor.id, l);
}, P_ = ({ scrollWindow: e, scrollDroppable: t, getAutoScrollerOptions: n = () => p_ }) => {
let r = dp(e), i = dp(t), a = null, o = (e) => {
!a && J();
let { shouldUseTimeDampening: t, dragStartTime: o } = a;
N_({
state: e,
scrollWindow: r,
scrollDroppable: i,
dragStartTime: o,
shouldUseTimeDampening: t,
getAutoScrollerOptions: n
});
};
return {
start: (e) => {
a && J();
let t = Date.now(), r = !1, i = () => {
r = !0;
};
N_({
state: e,
dragStartTime: 0,
shouldUseTimeDampening: !1,
scrollWindow: i,
scrollDroppable: i,
getAutoScrollerOptions: n
}), a = {
dragStartTime: t,
shouldUseTimeDampening: r
}, r && o(e);
},
stop: () => {
a &&= (r.cancel(), i.cancel(), null);
},
scroll: o
};
}, F_ = ({ move: e, scrollDroppable: t, scrollWindow: n }) => {
let r = (t, n) => {
e({ client: Ap(t.current.client.selection, n) });
}, i = (e, n) => {
if (!k_(e, n)) return n;
let r = A_(e, n);
if (!r) return t(e.descriptor.id, n), null;
let i = jp(n, r);
return t(e.descriptor.id, i), jp(n, i);
}, a = (e, t, r) => {
if (!e || !D_(t, r)) return r;
let i = O_(t, r);
if (!i) return n(r), null;
let a = jp(r, i);
return n(a), jp(r, a);
};
return (e) => {
let t = e.scrollJumpRequest;
if (!t) return;
let n = ch(e.impact);
!n && J();
let o = i(e.dimensions.droppables[n], t);
if (!o) return;
let s = e.viewport, c = a(e.isWindowScrollAllowed, s, o);
c && r(e, c);
};
}, I_ = ({ scrollDroppable: e, scrollWindow: t, move: n, getAutoScrollerOptions: r }) => {
let i = P_({
scrollWindow: t,
scrollDroppable: e,
getAutoScrollerOptions: r
}), a = F_({
move: n,
scrollWindow: t,
scrollDroppable: e
});
return {
scroll: (e) => {
if (!(r().disabled || e.phase !== "DRAGGING")) {
if (e.movementMode === "FLUID") {
i.scroll(e);
return;
}
e.scrollJumpRequest && a(e);
}
},
start: i.start,
stop: i.stop
};
}, L_ = "data-rfd", R_ = (() => {
let e = `${L_}-drag-handle`;
return {
base: e,
draggableId: `${e}-draggable-id`,
contextId: `${e}-context-id`
};
})(), z_ = (() => {
let e = `${L_}-draggable`;
return {
base: e,
contextId: `${e}-context-id`,
id: `${e}-id`
};
})(), B_ = (() => {
let e = `${L_}-droppable`;
return {
base: e,
contextId: `${e}-context-id`,
id: `${e}-id`
};
})(), V_ = { contextId: `${L_}-scroll-container-context-id` }, H_ = (e) => (t) => `[${t}="${e}"]`, U_ = (e, t) => e.map((e) => {
let n = e.styles[t];
return n ? `${e.selector} { ${n} }` : "";
}).join(" "), W_ = "pointer-events: none;", G_ = (e) => {
let t = H_(e), n = (() => {
let e = "\n cursor: -webkit-grab;\n cursor: grab;\n ";
return {
selector: t(R_.contextId),
styles: {
always: "\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n ",
resting: e,
dragging: W_,
dropAnimating: e
}
};
})(), r = [
(() => {
let e = `
transition: ${_g.outOfTheWay};
`;
return {
selector: t(z_.contextId),
styles: {
dragging: e,
dropAnimating: e,
userCancel: e
}
};
})(),
n,
{
selector: t(B_.contextId),
styles: { always: "overflow-anchor: none;" }
},
{
selector: "body",
styles: { dragging: "\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n " }
}
];
return {
always: U_(r, "always"),
resting: U_(r, "resting"),
dragging: U_(r, "dragging"),
dropAnimating: U_(r, "dropAnimating"),
userCancel: U_(r, "userCancel")
};
}, K_ = typeof window < "u" && window.document !== void 0 && window.document.createElement !== void 0 ? Nn : F, q_ = () => {
let e = document.querySelector("head");
return !e && J(), e;
}, J_ = (e) => {
let t = document.createElement("style");
return e && t.setAttribute("nonce", e), t.type = "text/css", t;
};
function Y_(e, t) {
let n = Y(() => G_(e), [e]), r = I(null), i = I(null), a = X(qp((e) => {
let t = i.current;
!t && J(), t.textContent = e;
}), []), o = X((e) => {
let t = r.current;
!t && J(), t.textContent = e;
}, []);
K_(() => {
!(!r.current && !i.current) && J();
let s = J_(t), c = J_(t);
return r.current = s, i.current = c, s.setAttribute(`${L_}-always`, e), c.setAttribute(`${L_}-dynamic`, e), q_().appendChild(s), q_().appendChild(c), o(n.always), a(n.resting), () => {
let e = (e) => {
let t = e.current;
!t && J(), q_().removeChild(t), e.current = null;
};
e(r), e(i);
};
}, [
t,
o,
a,
n.always,
n.resting,
e
]);
let s = X(() => a(n.dragging), [a, n.dragging]), c = X((e) => {
if (e === "DROP") {
a(n.dropAnimating);
return;
}
a(n.userCancel);
}, [
a,
n.dropAnimating,
n.userCancel
]), l = X(() => {
i.current && a(n.resting);
}, [a, n.resting]);
return Y(() => ({
dragging: s,
dropping: c,
resting: l
}), [
s,
c,
l
]);
}
function X_(e, t) {
return Array.from(e.querySelectorAll(t));
}
var Z_ = (e) => e && e.ownerDocument && e.ownerDocument.defaultView ? e.ownerDocument.defaultView : window;
function Q_(e) {
return e instanceof Z_(e).HTMLElement;
}
function $_(e, t) {
let n = `[${R_.contextId}="${e}"]`, r = X_(document, n);
if (!r.length) return null;
let i = r.find((e) => e.getAttribute(R_.draggableId) === t);
return !i || !Q_(i) ? null : i;
}
function ev(e) {
let t = I({}), n = I(null), r = I(null), i = I(!1), a = X(function(e, n) {
let r = {
id: e,
focus: n
};
return t.current[e] = r, function() {
let n = t.current;
n[e] !== r && delete n[e];
};
}, []), o = X(function(t) {
let n = $_(e, t);
n && n !== document.activeElement && n.focus();
}, [e]), s = X(function(e, t) {
n.current === e && (n.current = t);
}, []), c = X(function() {
r.current || i.current && (r.current = requestAnimationFrame(() => {
r.current = null;
let e = n.current;
e && o(e);
}));
}, [o]), l = X(function(e) {
n.current = null;
let t = document.activeElement;
t && t.getAttribute(R_.draggableId) === e && (n.current = e);
}, []);
return K_(() => (i.current = !0, function() {
i.current = !1;
let e = r.current;
e && cancelAnimationFrame(e);
}), []), Y(() => ({
register: a,
tryRecordFocus: l,
tryRestoreFocusRecorded: c,
tryShiftRecord: s
}), [
a,
l,
c,
s
]);
}
function tv() {
let e = {
draggables: {},
droppables: {}
}, t = [];
function n(e) {
return t.push(e), function() {
let n = t.indexOf(e);
n !== -1 && t.splice(n, 1);
};
}
function r(e) {
t.length && t.forEach((t) => t(e));
}
function i(t) {
return e.draggables[t] || null;
}
function a(e) {
let t = i(e);
return !t && J(), t;
}
let o = {
register: (t) => {
e.draggables[t.descriptor.id] = t, r({
type: "ADDITION",
value: t
});
},
update: (t, n) => {
let r = e.draggables[n.descriptor.id];
r && r.uniqueId === t.uniqueId && (delete e.draggables[n.descriptor.id], e.draggables[t.descriptor.id] = t);
},
unregister: (t) => {
let n = t.descriptor.id, a = i(n);
a && t.uniqueId === a.uniqueId && (delete e.draggables[n], e.droppables[t.descriptor.droppableId] && r({
type: "REMOVAL",
value: t
}));
},
getById: a,
findById: i,
exists: (e) => !!i(e),
getAllByType: (t) => Object.values(e.draggables).filter((e) => e.descriptor.type === t)
};
function s(t) {
return e.droppables[t] || null;
}
function c(e) {
let t = s(e);
return !t && J(), t;
}
let l = {
register: (t) => {
e.droppables[t.descriptor.id] = t;
},
unregister: (t) => {
let n = s(t.descriptor.id);
n && t.uniqueId === n.uniqueId && delete e.droppables[t.descriptor.id];
},
getById: c,
findById: s,
exists: (e) => !!s(e),
getAllByType: (t) => Object.values(e.droppables).filter((e) => e.descriptor.type === t)
};
function u() {
e.draggables = {}, e.droppables = {}, t.length = 0;
}
return {
draggable: o,
droppable: l,
subscribe: n,
clean: u
};
}
function nv() {
let e = Y(tv, []);
return F(() => function() {
e.clean();
}, [e]), e;
}
var rv = P.createContext(null), iv = () => {
let e = document.body;
return !e && J(), e;
}, av = {
position: "absolute",
width: "1px",
height: "1px",
margin: "-1px",
border: "0",
padding: "0",
overflow: "hidden",
clip: "rect(0 0 0 0)",
"clip-path": "inset(100%)"
}, ov = (e) => `rfd-announcement-${e}`;
function sv(e) {
let t = Y(() => ov(e), [e]), n = I(null);
return F(function() {
let e = document.createElement("div");
return n.current = e, e.id = t, e.setAttribute("aria-live", "assertive"), e.setAttribute("aria-atomic", "true"), q(e.style, av), iv().appendChild(e), function() {
setTimeout(function() {
let t = iv();
t.contains(e) && t.removeChild(e), e === n.current && (n.current = null);
});
};
}, [t]), X((e) => {
let t = n.current;
if (t) {
t.textContent = e;
return;
}
}, []);
}
var cv = { separator: "::" };
function lv(e, t = cv) {
let n = P.useId();
return Y(() => `${e}${t.separator}${n}`, [
t.separator,
e,
n
]);
}
function uv({ contextId: e, uniqueId: t }) {
return `rfd-hidden-text-${e}-${t}`;
}
function dv({ contextId: e, text: t }) {
let n = lv("hidden-text", { separator: "-" }), r = Y(() => uv({
contextId: e,
uniqueId: n
}), [n, e]);
return F(function() {
let e = document.createElement("div");
return e.id = r, e.textContent = t, e.style.display = "none", iv().appendChild(e), function() {
let t = iv();
t.contains(e) && t.removeChild(e);
};
}, [r, t]), r;
}
var fv = P.createContext(null);
function pv(e) {
let t = I(e);
return F(() => {
t.current = e;
}), t;
}
function mv() {
let e = null;
function t() {
return !!e;
}
function n(t) {
return t === e;
}
function r(t) {
e && J();
let n = { abandon: t };
return e = n, n;
}
function i() {
!e && J(), e = null;
}
function a() {
e && (e.abandon(), i());
}
return {
isClaimed: t,
isActive: n,
claim: r,
release: i,
tryAbandon: a
};
}
function hv(e) {
return e.phase === "IDLE" || e.phase === "DROP_ANIMATING" ? !1 : e.isDragging;
}
var gv = 9, _v = 13, vv = 27, yv = 32, bv = 33, xv = 34, Sv = 35, Cv = 36, wv = 37, Tv = 38, Ev = 39, Dv = 40, Ov = {
[_v]: !0,
[gv]: !0
}, kv = (e) => {
Ov[e.keyCode] && e.preventDefault();
}, Av = (() => {
let e = "visibilitychange";
return typeof document > "u" ? e : [
e,
`ms${e}`,
`webkit${e}`,
`moz${e}`,
`o${e}`
].find((e) => `on${e}` in document) || e;
})(), jv = 0, Mv = 5;
function Nv(e, t) {
return Math.abs(t.x - e.x) >= Mv || Math.abs(t.y - e.y) >= Mv;
}
var Pv = { type: "IDLE" };
function Fv({ cancel: e, completed: t, getPhase: n, setPhase: r }) {
return [
{
eventName: "mousemove",
fn: (e) => {
let { button: t, clientX: i, clientY: a } = e;
if (t !== jv) return;
let o = {
x: i,
y: a
}, s = n();
if (s.type === "DRAGGING") {
e.preventDefault(), s.actions.move(o);
return;
}
s.type !== "PENDING" && J();
let c = s.point;
Nv(c, o) && (e.preventDefault(), r({
type: "DRAGGING",
actions: s.actions.fluidLift(o)
}));
}
},
{
eventName: "mouseup",
fn: (r) => {
let i = n();
if (i.type !== "DRAGGING") {
e();
return;
}
r.preventDefault(), i.actions.drop({ shouldBlockNextClick: !0 }), t();
}
},
{
eventName: "mousedown",
fn: (t) => {
n().type === "DRAGGING" && t.preventDefault(), e();
}
},
{
eventName: "keydown",
fn: (t) => {
if (n().type === "PENDING") {
e();
return;
}
if (t.keyCode === vv) {
t.preventDefault(), e();
return;
}
kv(t);
}
},
{
eventName: "resize",
fn: e
},
{
eventName: "scroll",
options: {
passive: !0,
capture: !1
},
fn: () => {
n().type === "PENDING" && e();
}
},
{
eventName: "webkitmouseforcedown",
fn: (t) => {
let r = n();
if (r.type === "IDLE" && J(), r.actions.shouldRespectForcePress()) {
e();
return;
}
t.preventDefault();
}
},
{
eventName: Av,
fn: e
}
];
}
function Iv(e) {
let t = I(Pv), n = I(pp), r = Y(() => ({
eventName: "mousedown",
fn: function(t) {
if (t.defaultPrevented || t.button !== jv || t.ctrlKey || t.metaKey || t.shiftKey || t.altKey) return;
let r = e.findClosestDraggableId(t);
if (!r) return;
let i = e.tryGetLock(r, o, { sourceEvent: t });
if (!i) return;
t.preventDefault();
let a = {
x: t.clientX,
y: t.clientY
};
n.current(), l(i, a);
}
}), [e]), i = Y(() => ({
eventName: "webkitmouseforcewillbegin",
fn: (t) => {
if (t.defaultPrevented) return;
let n = e.findClosestDraggableId(t);
if (!n) return;
let r = e.findOptionsForDraggable(n);
r && (r.shouldRespectForcePress || e.canGetLock(n) && t.preventDefault());
}
}), [e]), a = X(function() {
n.current = hp(window, [i, r], {
passive: !1,
capture: !0
});
}, [i, r]), o = X(() => {
t.current.type !== "IDLE" && (t.current = Pv, n.current(), a());
}, [a]), s = X(() => {
let e = t.current;
o(), e.type === "DRAGGING" && e.actions.cancel({ shouldBlockNextClick: !0 }), e.type === "PENDING" && e.actions.abort();
}, [o]), c = X(function() {
let e = {
capture: !0,
passive: !1
}, r = Fv({
cancel: s,
completed: o,
getPhase: () => t.current,
setPhase: (e) => {
t.current = e;
}
});
n.current = hp(window, r, e);
}, [s, o]), l = X(function(e, n) {
t.current.type !== "IDLE" && J(), t.current = {
type: "PENDING",
point: n,
actions: e
}, c();
}, [c]);
K_(function() {
return a(), function() {
n.current();
};
}, [a]);
}
function Lv() {}
var Rv = {
[xv]: !0,
[bv]: !0,
[Cv]: !0,
[Sv]: !0
};
function zv(e, t) {
function n() {
t(), e.cancel();
}
function r() {
t(), e.drop();
}
return [
{
eventName: "keydown",
fn: (t) => {
if (t.keyCode === vv) {
t.preventDefault(), n();
return;
}
if (t.keyCode === yv) {
t.preventDefault(), r();
return;
}
if (t.keyCode === Dv) {
t.preventDefault(), e.moveDown();
return;
}
if (t.keyCode === Tv) {
t.preventDefault(), e.moveUp();
return;
}
if (t.keyCode === Ev) {
t.preventDefault(), e.moveRight();
return;
}
if (t.keyCode === wv) {
t.preventDefault(), e.moveLeft();
return;
}
if (Rv[t.keyCode]) {
t.preventDefault();
return;
}
kv(t);
}
},
{
eventName: "mousedown",
fn: n
},
{
eventName: "mouseup",
fn: n
},
{
eventName: "click",
fn: n
},
{
eventName: "touchstart",
fn: n
},
{
eventName: "resize",
fn: n
},
{
eventName: "wheel",
fn: n,
options: { passive: !0 }
},
{
eventName: Av,
fn: n
}
];
}
function Bv(e) {
let t = I(Lv), n = Y(() => ({
eventName: "keydown",
fn: function(n) {
if (n.defaultPrevented || n.keyCode !== yv) return;
let i = e.findClosestDraggableId(n);
if (!i) return;
let a = e.tryGetLock(i, c, { sourceEvent: n });
if (!a) return;
n.preventDefault();
let o = !0, s = a.snapLift();
t.current();
function c() {
!o && J(), o = !1, t.current(), r();
}
t.current = hp(window, zv(s, c), {
capture: !0,
passive: !1
});
}
}), [e]), r = X(function() {
t.current = hp(window, [n], {
passive: !1,
capture: !0
});
}, [n]);
K_(function() {
return r(), function() {
t.current();
};
}, [r]);
}
var Vv = { type: "IDLE" }, Hv = 120, Uv = .15;
function Wv({ cancel: e, getPhase: t }) {
return [
{
eventName: "orientationchange",
fn: e
},
{
eventName: "resize",
fn: e
},
{
eventName: "contextmenu",
fn: (e) => {
e.preventDefault();
}
},
{
eventName: "keydown",
fn: (n) => {
if (t().type !== "DRAGGING") {
e();
return;
}
n.keyCode === vv && n.preventDefault(), e();
}
},
{
eventName: Av,
fn: e
}
];
}
function Gv({ cancel: e, completed: t, getPhase: n }) {
return [
{
eventName: "touchmove",
options: { capture: !1 },
fn: (t) => {
let r = n();
if (r.type !== "DRAGGING") {
e();
return;
}
r.hasMoved = !0;
let { clientX: i, clientY: a } = t.touches[0], o = {
x: i,
y: a
};
t.preventDefault(), r.actions.move(o);
}
},
{
eventName: "touchend",
fn: (r) => {
let i = n();
if (i.type !== "DRAGGING") {
e();
return;
}
r.preventDefault(), i.actions.drop({ shouldBlockNextClick: !0 }), t();
}
},
{
eventName: "touchcancel",
fn: (t) => {
if (n().type !== "DRAGGING") {
e();
return;
}
t.preventDefault(), e();
}
},
{
eventName: "touchforcechange",
fn: (t) => {
let r = n();
r.type === "IDLE" && J();
let i = t.touches[0];
if (!i || !(i.force >= Uv)) return;
let a = r.actions.shouldRespectForcePress();
if (r.type === "PENDING") {
a && e();
return;
}
if (a) {
if (r.hasMoved) {
t.preventDefault();
return;
}
e();
return;
}
t.preventDefault();
}
},
{
eventName: Av,
fn: e
}
];
}
function Kv(e) {
let t = I(Vv), n = I(pp), r = X(function() {
return t.current;
}, []), i = X(function(e) {
t.current = e;
}, []), a = Y(() => ({
eventName: "touchstart",
fn: function(t) {
if (t.defaultPrevented) return;
let r = e.findClosestDraggableId(t);
if (!r) return;
let i = e.tryGetLock(r, s, { sourceEvent: t });
if (!i) return;
let { clientX: a, clientY: o } = t.touches[0], c = {
x: a,
y: o
};
n.current(), d(i, c);
}
}), [e]), o = X(function() {
n.current = hp(window, [a], {
capture: !0,
passive: !1
});
}, [a]), s = X(() => {
let e = t.current;
e.type !== "IDLE" && (e.type === "PENDING" && clearTimeout(e.longPressTimerId), i(Vv), n.current(), o());
}, [o, i]), c = X(() => {
let e = t.current;
s(), e.type === "DRAGGING" && e.actions.cancel({ shouldBlockNextClick: !0 }), e.type === "PENDING" && e.actions.abort();
}, [s]), l = X(function() {
let e = {
capture: !0,
passive: !1
}, t = {
cancel: c,
completed: s,
getPhase: r
}, i = hp(window, Gv(t), e), a = hp(window, Wv(t), e);
n.current = function() {
i(), a();
};
}, [
c,
r,
s
]), u = X(function() {
let e = r();
e.type !== "PENDING" && J();
let t = e.actions.fluidLift(e.point);
i({
type: "DRAGGING",
actions: t,
hasMoved: !1
});
}, [r, i]), d = X(function(e, t) {
r().type !== "IDLE" && J();
let n = setTimeout(u, Hv);
i({
type: "PENDING",
point: t,
actions: e,
longPressTimerId: n
}), l();
}, [
l,
r,
i,
u
]);
K_(function() {
return o(), function() {
n.current();
let e = r();
e.type === "PENDING" && (clearTimeout(e.longPressTimerId), i(Vv));
};
}, [
r,
o,
i
]), K_(function() {
return hp(window, [{
eventName: "touchmove",
fn: () => {},
options: {
capture: !1,
passive: !1
}
}]);
}, []);
}
var qv = [
"input",
"button",
"textarea",
"select",
"option",
"optgroup",
"video",
"audio"
];
function Jv(e, t) {
if (t == null) return !1;
if (qv.includes(t.tagName.toLowerCase())) return !0;
let n = t.getAttribute("contenteditable");
return n === "true" || n === "" || t !== e && Jv(e, t.parentElement);
}
function Yv(e, t) {
let n = t.target;
return Q_(n) ? Jv(e, n) : !1;
}
var Xv = (e) => $f(e.getBoundingClientRect()).center;
function Zv(e) {
return e instanceof Z_(e).Element;
}
var Qv = (() => {
let e = "matches";
return typeof document > "u" ? e : [
e,
"msMatchesSelector",
"webkitMatchesSelector"
].find((e) => e in Element.prototype) || e;
})();
function $v(e, t) {
return e == null ? null : e[Qv](t) ? e : $v(e.parentElement, t);
}
function ey(e, t) {
return e.closest ? e.closest(t) : $v(e, t);
}
function ty(e) {
return `[${R_.contextId}="${e}"]`;
}
function ny(e, t) {
let n = t.target;
if (!Zv(n)) return null;
let r = ey(n, ty(e));
return !r || !Q_(r) ? null : r;
}
function ry(e, t) {
let n = ny(e, t);
return n ? n.getAttribute(R_.draggableId) : null;
}
function iy(e, t) {
let n = `[${z_.contextId}="${e}"]`, r = X_(document, n).find((e) => e.getAttribute(z_.id) === t);
return !r || !Q_(r) ? null : r;
}
function ay(e) {
e.preventDefault();
}
function oy({ expected: e, phase: t, isLockActive: n, shouldWarn: r }) {
return !(!n() || e !== t);
}
function sy({ lockAPI: e, store: t, registry: n, draggableId: r }) {
if (e.isClaimed()) return !1;
let i = n.draggable.findById(r);
return !(!i || !i.options.isEnabled || !c_(t.getState(), r));
}
function cy({ lockAPI: e, contextId: t, store: n, registry: r, draggableId: i, forceSensorStop: a, sourceEvent: o }) {
if (!sy({
lockAPI: e,
store: n,
registry: r,
draggableId: i
})) return null;
let s = r.draggable.getById(i), c = iy(t, s.descriptor.id);
if (!c || o && !s.options.canDragInteractiveElements && Yv(c, o)) return null;
let l = e.claim(a || pp), u = "PRE_DRAG";
function d() {
return s.options.shouldRespectForcePress;
}
function f() {
return e.isActive(l);
}
function p(e, t) {
oy({
expected: e,
phase: u,
isLockActive: f,
shouldWarn: !0
}) && n.dispatch(t());
}
let m = p.bind(null, "DRAGGING");
function h(t) {
function r() {
e.release(), u = "COMPLETED";
}
u !== "PRE_DRAG" && (r(), J()), n.dispatch(Gh(t.liftActionArgs)), u = "DRAGGING";
function i(e, i = { shouldBlockNextClick: !1 }) {
if (t.cleanup(), i.shouldBlockNextClick) {
let e = hp(window, [{
eventName: "click",
fn: ay,
options: {
once: !0,
passive: !1,
capture: !0
}
}]);
setTimeout(e);
}
r(), n.dispatch(cg({ reason: e }));
}
return {
isActive: () => oy({
expected: "DRAGGING",
phase: u,
isLockActive: f,
shouldWarn: !1
}),
shouldRespectForcePress: d,
drop: (e) => i("DROP", e),
cancel: (e) => i("CANCEL", e),
...t.actions
};
}
function g(e) {
let t = dp((e) => {
m(() => Qh({ client: e }));
});
return {
...h({
liftActionArgs: {
id: i,
clientSelection: e,
movementMode: "FLUID"
},
cleanup: () => t.cancel(),
actions: { move: t }
}),
move: t
};
}
function _() {
return h({
liftActionArgs: {
id: i,
clientSelection: Xv(c),
movementMode: "SNAP"
},
cleanup: pp,
actions: {
moveUp: () => m(tg),
moveRight: () => m(rg),
moveDown: () => m(ng),
moveLeft: () => m(ig)
}
});
}
function v() {
oy({
expected: "PRE_DRAG",
phase: u,
isLockActive: f,
shouldWarn: !0
}) && e.release();
}
return {
isActive: () => oy({
expected: "PRE_DRAG",
phase: u,
isLockActive: f,
shouldWarn: !1
}),
shouldRespectForcePress: d,
fluidLift: g,
snapLift: _,
abort: v
};
}
var ly = [
Iv,
Bv,
Kv
];
function uy({ contextId: e, store: t, registry: n, customSensors: r, enableDefaultSensors: i }) {
let a = [...i ? ly : [], ...r || []], o = L(() => mv())[0], s = X(function(e, t) {
hv(e) && !hv(t) && o.tryAbandon();
}, [o]);
K_(function() {
let e = t.getState();
return t.subscribe(() => {
let n = t.getState();
s(e, n), e = n;
});
}, [
o,
t,
s
]), K_(() => o.tryAbandon, [o.tryAbandon]);
let c = X((e) => sy({
lockAPI: o,
registry: n,
store: t,
draggableId: e
}), [
o,
n,
t
]), l = X((r, i, a) => cy({
lockAPI: o,
registry: n,
contextId: e,
store: t,
draggableId: r,
forceSensorStop: i || null,
sourceEvent: a && a.sourceEvent ? a.sourceEvent : null
}), [
e,
o,
n,
t
]), u = X((t) => ry(e, t), [e]), d = X((e) => {
let t = n.draggable.findById(e);
return t ? t.options : null;
}, [n.draggable]), f = X(function() {
o.isClaimed() && (o.tryAbandon(), t.getState().phase !== "IDLE" && t.dispatch(ag()));
}, [o, t]), p = X(() => o.isClaimed(), [o]), m = Y(() => ({
canGetLock: c,
tryGetLock: l,
findClosestDraggableId: u,
findOptionsForDraggable: d,
tryReleaseLock: f,
isLockClaimed: p
}), [
c,
l,
u,
d,
f,
p
]);
for (let e = 0; e < a.length; e++) a[e](m);
}
var dy = (e) => ({
onBeforeCapture: (t) => {
Qn(() => {
e.onBeforeCapture && e.onBeforeCapture(t);
});
},
onBeforeDragStart: e.onBeforeDragStart,
onDragStart: e.onDragStart,
onDragEnd: e.onDragEnd,
onDragUpdate: e.onDragUpdate
}), fy = (e) => ({
...p_,
...e.autoScrollerOptions,
durationDampening: {
...p_.durationDampening,
...e.autoScrollerOptions
}
});
function py(e) {
return !e.current && J(), e.current;
}
function my(e) {
let { contextId: t, setCallbacks: n, sensors: i, nonce: a, dragHandleUsageInstructions: o } = e, s = I(null), c = pv(e), l = X(() => dy(c.current), [c]), u = X(() => fy(c.current), [c]), d = sv(t), f = dv({
contextId: t,
text: o
}), p = Y_(t, a), m = X((e) => {
py(s).dispatch(e);
}, []), h = Y(() => r({
publishWhileDragging: qh,
updateDroppableScroll: Yh,
updateDroppableIsEnabled: Xh,
updateDroppableIsCombineEnabled: Zh,
collectionStarting: Jh
}, m), [m]), g = nv(), _ = Y(() => s_(g, h), [g, h]), v = Y(() => I_({
scrollWindow: l_,
scrollDroppable: _.scrollDroppable,
getAutoScrollerOptions: u,
...r({ move: Qh }, m)
}), [
_.scrollDroppable,
m,
u
]), y = ev(t), b = Y(() => Qg({
announce: d,
autoScroller: v,
dimensionMarshal: _,
focusMarshal: y,
getResponders: l,
styleMarshal: p
}), [
d,
v,
_,
y,
l,
p
]);
s.current = b;
let x = X(() => {
let e = py(s);
e.getState().phase !== "IDLE" && e.dispatch(ag());
}, []), C = X(() => {
let e = py(s).getState();
return e.phase === "DROP_ANIMATING" || e.phase !== "IDLE" && e.isDragging;
}, []);
n(Y(() => ({
isDragging: C,
tryAbort: x
}), [C, x]));
let w = X((e) => c_(py(s).getState(), e), []), T = X(() => dh(py(s).getState()), []), E = Y(() => ({
marshal: _,
focus: y,
contextId: t,
canLift: w,
isMovementAllowed: T,
dragHandleUsageInstructionsId: f,
registry: g
}), [
t,
_,
f,
y,
w,
T,
g
]);
return uy({
contextId: t,
store: b,
registry: g,
customSensors: i || null,
enableDefaultSensors: e.enableDefaultSensors !== !1
}), F(() => x, [x]), P.createElement(fv.Provider, { value: E }, P.createElement(S, {
context: rv,
store: b
}, e.children));
}
function hy() {
return P.useId();
}
function gy(e) {
let t = hy(), n = e.dragHandleUsageInstructions || Ep.dragHandleUsageInstructions;
return P.createElement(vp, null, (r) => P.createElement(my, {
nonce: e.nonce,
contextId: t,
setCallbacks: r,
dragHandleUsageInstructions: n,
enableDefaultSensors: e.enableDefaultSensors,
sensors: e.sensors,
onBeforeCapture: e.onBeforeCapture,
onBeforeDragStart: e.onBeforeDragStart,
onDragStart: e.onDragStart,
onDragUpdate: e.onDragUpdate,
onDragEnd: e.onDragEnd,
autoScrollerOptions: e.autoScrollerOptions
}, e.children));
}
var _y = {
dragging: 5e3,
dropAnimating: 4500
}, vy = (e, t) => t ? _g.drop(t.duration) : e ? _g.snap : _g.fluid, yy = (e, t) => {
if (e) return t ? mg.opacity.drop : mg.opacity.combining;
}, by = (e) => e.forceShouldAnimate == null ? e.mode === "SNAP" : e.forceShouldAnimate;
function xy(e) {
let t = e.dimension.client, { offset: n, combineWith: r, dropping: i } = e, a = !!r, o = by(e), s = !!i, c = s ? yg.drop(n, a) : yg.moveTo(n);
return {
position: "fixed",
top: t.marginBox.top,
left: t.marginBox.left,
boxSizing: "border-box",
width: t.borderBox.width,
height: t.borderBox.height,
transition: vy(o, i),
transform: c,
opacity: yy(a, s),
zIndex: s ? _y.dropAnimating : _y.dragging,
pointerEvents: "none"
};
}
function Sy(e) {
return {
transform: yg.moveTo(e.offset),
transition: e.shouldAnimateDisplacement ? void 0 : "none"
};
}
function Cy(e) {
return e.type === "DRAGGING" ? xy(e) : Sy(e);
}
function wy(e, t, n = kp) {
let r = window.getComputedStyle(t), i = lp(t.getBoundingClientRect(), r), a = cp(i, n);
return {
descriptor: e,
placeholder: {
client: i,
tagName: t.tagName.toLowerCase(),
display: r.display
},
displaceBy: {
x: i.marginBox.width,
y: i.marginBox.height
},
client: i,
page: a
};
}
function Ty(e) {
let t = lv("draggable"), { descriptor: n, registry: r, getDraggableRef: i, canDragInteractiveElements: a, shouldRespectForcePress: o, isEnabled: s } = e, c = Y(() => ({
canDragInteractiveElements: a,
shouldRespectForcePress: o,
isEnabled: s
}), [
a,
s,
o
]), l = X((e) => {
let t = i();
return !t && J(), wy(n, t, e);
}, [n, i]), u = Y(() => ({
uniqueId: t,
descriptor: n,
options: c,
getDimension: l
}), [
n,
l,
c,
t
]), d = I(u), f = I(!0);
K_(() => (r.draggable.register(d.current), () => r.draggable.unregister(d.current)), [r.draggable]), K_(() => {
if (f.current) {
f.current = !1;
return;
}
let e = d.current;
d.current = u, r.draggable.update(u, e);
}, [u, r.draggable]);
}
var Ey = P.createContext(null);
function Dy(e) {
let t = An(e);
return !t && J(), t;
}
function Oy(e) {
e.preventDefault();
}
var ky = (e) => {
let t = I(null), n = X((e = null) => {
t.current = e;
}, []), r = X(() => t.current, []), { contextId: i, dragHandleUsageInstructionsId: a, registry: o } = Dy(fv), { type: s, droppableId: c } = Dy(Ey), l = Y(() => ({
id: e.draggableId,
index: e.index,
type: s,
droppableId: c
}), [
e.draggableId,
e.index,
s,
c
]), { children: u, draggableId: d, isEnabled: f, shouldRespectForcePress: p, canDragInteractiveElements: m, isClone: h, mapped: g, dropAnimationFinished: _ } = e;
h || Ty(Y(() => ({
descriptor: l,
registry: o,
getDraggableRef: r,
canDragInteractiveElements: m,
shouldRespectForcePress: p,
isEnabled: f
}), [
l,
o,
r,
m,
p,
f
]));
let v = Y(() => f ? {
tabIndex: 0,
role: "button",
"aria-describedby": a,
"data-rfd-drag-handle-draggable-id": d,
"data-rfd-drag-handle-context-id": i,
draggable: !1,
onDragStart: Oy
} : null, [
i,
a,
d,
f
]), y = X((e) => {
g.type === "DRAGGING" && g.dropping && e.propertyName === "transform" && Qn(_);
}, [_, g]), b = Y(() => {
let e = Cy(g), t = g.type === "DRAGGING" && g.dropping ? y : void 0;
return {
innerRef: n,
draggableProps: {
"data-rfd-draggable-context-id": i,
"data-rfd-draggable-id": d,
style: e,
onTransitionEnd: t
},
dragHandleProps: v
};
}, [
i,
v,
d,
g,
y,
n
]), x = Y(() => ({
draggableId: l.id,
type: l.type,
source: {
index: l.index,
droppableId: l.droppableId
}
}), [
l.droppableId,
l.id,
l.index,
l.type
]);
return P.createElement(P.Fragment, null, u(b, g.snapshot, x));
}, Ay = (e, t) => e === t, jy = (e) => {
let { combine: t, destination: n } = e;
return n ? n.droppableId : t ? t.droppableId : null;
}, My = (e) => e.combine ? e.combine.draggableId : null, Ny = (e) => e.at && e.at.type === "COMBINE" ? e.at.combine.draggableId : null;
function Py() {
let e = qp((e, t) => ({
x: e,
y: t
})), t = qp((e, t, n = null, r = null, i = null) => ({
isDragging: !0,
isClone: t,
isDropAnimating: !!i,
dropAnimation: i,
mode: e,
draggingOver: n,
combineWith: r,
combineTargetFor: null
})), n = qp((e, n, r, i, a = null, o = null, s = null) => ({ mapped: {
type: "DRAGGING",
dropping: null,
draggingOver: a,
combineWith: o,
mode: n,
offset: e,
dimension: r,
forceShouldAnimate: s,
snapshot: t(n, i, a, o, null)
} }));
return (r, i) => {
if (hv(r)) {
if (r.critical.draggable.id !== i.draggableId) return null;
let t = r.current.client.offset, a = r.dimensions.draggables[i.draggableId], o = ch(r.impact), s = Ny(r.impact), c = r.forceShouldAnimate;
return n(e(t.x, t.y), r.movementMode, a, i.isClone, o, s, c);
}
if (r.phase === "DROP_ANIMATING") {
let e = r.completed;
if (e.result.draggableId !== i.draggableId) return null;
let n = i.isClone, a = r.dimensions.draggables[i.draggableId], o = e.result, s = o.mode, c = jy(o), l = My(o), u = {
duration: r.dropDuration,
curve: pg.drop,
moveTo: r.newHomeClientOffset,
opacity: l ? mg.opacity.drop : null,
scale: l ? mg.scale.drop : null
};
return { mapped: {
type: "DRAGGING",
offset: r.newHomeClientOffset,
dimension: a,
dropping: u,
draggingOver: c,
combineWith: l,
mode: s,
forceShouldAnimate: null,
snapshot: t(s, n, c, l, u)
} };
}
return null;
};
}
function Fy(e = null) {
return {
isDragging: !1,
isDropAnimating: !1,
isClone: !1,
dropAnimation: null,
mode: null,
draggingOver: null,
combineTargetFor: e,
combineWith: null
};
}
var Iy = { mapped: {
type: "SECONDARY",
offset: kp,
combineTargetFor: null,
shouldAnimateDisplacement: !0,
snapshot: Fy(null)
} };
function Ly() {
let e = qp((e, t) => ({
x: e,
y: t
})), t = qp(Fy), n = qp((e, n = null, r) => ({ mapped: {
type: "SECONDARY",
offset: e,
combineTargetFor: n,
shouldAnimateDisplacement: r,
snapshot: t(n)
} })), r = (e) => e ? n(kp, e, !0) : null, i = (t, i, a, o) => {
let s = a.displaced.visible[t], c = !!(o.inVirtualList && o.effected[t]), l = em(a), u = l && l.draggableId === t ? i : null;
if (!s) {
if (!c) return r(u);
if (a.displaced.invisible[t]) return null;
let i = Np(o.displacedBy.point), s = e(i.x, i.y);
return n(s, u, !0);
}
if (c) return r(u);
let d = a.displacedBy.point, f = e(d.x, d.y);
return n(f, u, s.shouldAnimate);
};
return (e, t) => {
if (hv(e)) return e.critical.draggable.id === t.draggableId ? null : i(t.draggableId, e.critical.draggable.id, e.impact, e.afterCritical);
if (e.phase === "DROP_ANIMATING") {
let n = e.completed;
return n.result.draggableId === t.draggableId ? null : i(t.draggableId, n.result.draggableId, n.impact, n.afterCritical);
}
return null;
};
}
var Ry = w(() => {
let e = Py(), t = Ly();
return (n, r) => e(n, r) || t(n, r) || Iy;
}, { dropAnimationFinished: ug }, null, {
context: rv,
areStatePropsEqual: Ay
})(ky);
function zy(e) {
return Dy(Ey).isUsingCloneFor === e.draggableId && !e.isClone ? null : P.createElement(Ry, e);
}
function By(e) {
let t = typeof e.isDragDisabled != "boolean" || !e.isDragDisabled, n = !!e.disableInteractiveElementBlocking, r = !!e.shouldRespectForcePress;
return P.createElement(zy, q({}, e, {
isClone: !1,
isEnabled: t,
canDragInteractiveElements: n,
shouldRespectForcePress: r
}));
}
var Vy = (e) => (t) => e === t, Hy = Vy("scroll"), Uy = Vy("auto"), Wy = (e, t) => t(e.overflowX) || t(e.overflowY), Gy = (e) => {
let t = window.getComputedStyle(e), n = {
overflowX: t.overflowX,
overflowY: t.overflowY
};
return Wy(n, Hy) || Wy(n, Uy);
}, Ky = () => !1, qy = (e) => e == null ? null : e === document.body ? Ky() ? e : null : e === document.documentElement ? null : Gy(e) ? e : qy(e.parentElement), Jy = (e) => ({
x: e.scrollLeft,
y: e.scrollTop
}), Yy = (e) => e ? window.getComputedStyle(e).position === "fixed" || Yy(e.parentElement) : !1, Xy = (e) => ({
closestScrollable: qy(e),
isFixedOnPage: Yy(e)
}), Zy = ({ descriptor: e, isEnabled: t, isCombineEnabled: n, isFixedOnPage: r, direction: i, client: a, page: o, closest: s }) => {
let c = (() => {
if (!s) return null;
let { scrollSize: e, client: t } = s, n = t_({
scrollHeight: e.scrollHeight,
scrollWidth: e.scrollWidth,
height: t.paddingBox.height,
width: t.paddingBox.width
});
return {
pageMarginBox: s.page.marginBox,
frameClient: t,
scrollSize: e,
shouldClipSubject: s.shouldClipSubject,
scroll: {
initial: s.scroll,
current: s.scroll,
max: n,
diff: {
value: kp,
displacement: kp
}
}
};
})(), l = i === "vertical" ? um : dm;
return {
descriptor: e,
isCombineEnabled: n,
isFixedOnPage: r,
axis: l,
isEnabled: t,
client: a,
page: o,
frame: c,
subject: Gp({
page: o,
withPlaceholder: null,
axis: l,
frame: c
})
};
}, Qy = (e, t) => {
let n = up(e);
if (!t || e !== t) return n;
let r = n.paddingBox.top - t.scrollTop, i = n.paddingBox.left - t.scrollLeft, a = r + t.scrollHeight;
return ip({
borderBox: ep({
top: r,
right: i + t.scrollWidth,
bottom: a,
left: i
}, n.border),
margin: n.margin,
border: n.border,
padding: n.padding
});
}, $y = ({ ref: e, descriptor: t, env: n, windowScroll: r, direction: i, isDropDisabled: a, isCombineEnabled: o, shouldClipSubject: s }) => {
let c = n.closestScrollable, l = Qy(e, c), u = cp(l, r), d = (() => {
if (!c) return null;
let e = up(c), t = {
scrollHeight: c.scrollHeight,
scrollWidth: c.scrollWidth
};
return {
client: e,
page: cp(e, r),
scroll: Jy(c),
scrollSize: t,
shouldClipSubject: s
};
})();
return Zy({
descriptor: t,
isEnabled: !a,
isCombineEnabled: o,
isFixedOnPage: n.isFixedOnPage,
direction: i,
client: l,
page: u,
closest: d
});
}, eb = { passive: !1 }, tb = { passive: !0 }, nb = (e) => e.shouldPublishImmediately ? eb : tb, rb = (e) => e && e.env.closestScrollable || null;
function ib(e) {
let t = I(null), n = Dy(fv), r = lv("droppable"), { registry: i, marshal: a } = n, o = pv(e), s = Y(() => ({
id: e.droppableId,
type: e.type,
mode: e.mode
}), [
e.droppableId,
e.mode,
e.type
]), c = I(s), l = Y(() => qp((e, n) => {
!t.current && J();
let r = {
x: e,
y: n
};
a.updateDroppableScroll(s.id, r);
}), [s.id, a]), u = X(() => {
let e = t.current;
return !e || !e.env.closestScrollable ? kp : Jy(e.env.closestScrollable);
}, []), d = X(() => {
let e = u();
l(e.x, e.y);
}, [u, l]), f = Y(() => dp(d), [d]), p = X(() => {
let e = t.current, n = rb(e);
if (!(e && n) && J(), e.scrollOptions.shouldPublishImmediately) {
d();
return;
}
f();
}, [f, d]), m = X((e, r) => {
t.current && J();
let i = o.current, a = i.getDroppableRef();
!a && J();
let c = Xy(a), l = {
ref: a,
descriptor: s,
env: c,
scrollOptions: r
};
t.current = l;
let u = $y({
ref: a,
descriptor: s,
env: c,
windowScroll: e,
direction: i.direction,
isDropDisabled: i.isDropDisabled,
isCombineEnabled: i.isCombineEnabled,
shouldClipSubject: !i.ignoreContainerClipping
}), d = c.closestScrollable;
return d && (d.setAttribute(V_.contextId, n.contextId), d.addEventListener("scroll", p, nb(l.scrollOptions))), u;
}, [
n.contextId,
s,
p,
o
]), h = X(() => {
let e = t.current, n = rb(e);
return !(e && n) && J(), Jy(n);
}, []), g = X(() => {
let e = t.current;
!e && J();
let n = rb(e);
t.current = null, n && (f.cancel(), n.removeAttribute(V_.contextId), n.removeEventListener("scroll", p, nb(e.scrollOptions)));
}, [p, f]), _ = X((e) => {
let n = t.current;
!n && J();
let r = rb(n);
!r && J(), r.scrollTop += e.y, r.scrollLeft += e.x;
}, []), v = Y(() => ({
getDimensionAndWatchScroll: m,
getScrollWhileDragging: h,
dragStopped: g,
scroll: _
}), [
g,
m,
h,
_
]), y = Y(() => ({
uniqueId: r,
descriptor: s,
callbacks: v
}), [
v,
s,
r
]);
K_(() => (c.current = y.descriptor, i.droppable.register(y), () => {
t.current && g(), i.droppable.unregister(y);
}), [
v,
s,
g,
y,
a,
i.droppable
]), K_(() => {
t.current && a.updateDroppableIsEnabled(c.current.id, !e.isDropDisabled);
}, [e.isDropDisabled, a]), K_(() => {
t.current && a.updateDroppableIsCombineEnabled(c.current.id, e.isCombineEnabled);
}, [e.isCombineEnabled, a]);
}
function ab() {}
var ob = {
width: 0,
height: 0,
margin: Vp
}, sb = ({ isAnimatingOpenOnMount: e, placeholder: t, animate: n }) => e || n === "close" ? ob : {
height: t.client.borderBox.height,
width: t.client.borderBox.width,
margin: t.client.margin
}, cb = ({ isAnimatingOpenOnMount: e, placeholder: t, animate: n }) => {
let r = sb({
isAnimatingOpenOnMount: e,
placeholder: t,
animate: n
});
return {
display: t.display,
boxSizing: "border-box",
width: r.width,
height: r.height,
marginTop: r.margin.top,
marginRight: r.margin.right,
marginBottom: r.margin.bottom,
marginLeft: r.margin.left,
flexShrink: "0",
flexGrow: "0",
pointerEvents: "none",
transition: n === "none" ? null : _g.placeholder
};
}, lb = P.memo((e) => {
let t = I(null), n = X(() => {
t.current &&= (clearTimeout(t.current), null);
}, []), { animate: r, onTransitionEnd: i, onClose: a, contextId: o } = e, [s, c] = L(e.animate === "open");
F(() => s ? r === "open" ? t.current ? ab : (t.current = setTimeout(() => {
t.current = null, c(!1);
}), n) : (n(), c(!1), ab) : ab, [
r,
s,
n
]);
let l = X((e) => {
e.propertyName === "height" && (i(), r === "close" && a());
}, [
r,
a,
i
]), u = cb({
isAnimatingOpenOnMount: s,
animate: e.animate,
placeholder: e.placeholder
});
return P.createElement(e.placeholder.tagName, {
style: u,
"data-rfd-placeholder-context-id": o,
onTransitionEnd: l,
ref: e.innerRef
});
}), ub = class extends P.PureComponent {
constructor(...e) {
super(...e), this.state = {
isVisible: !!this.props.on,
data: this.props.on,
animate: this.props.shouldAnimate && this.props.on ? "open" : "none"
}, this.onClose = () => {
this.state.animate === "close" && this.setState({ isVisible: !1 });
};
}
static getDerivedStateFromProps(e, t) {
return e.shouldAnimate ? e.on ? {
isVisible: !0,
data: e.on,
animate: "open"
} : t.isVisible ? {
isVisible: !0,
data: t.data,
animate: "close"
} : {
isVisible: !1,
animate: "close",
data: null
} : {
isVisible: !!e.on,
data: e.on,
animate: "none"
};
}
render() {
if (!this.state.isVisible) return null;
let e = {
onClose: this.onClose,
data: this.state.data,
animate: this.state.animate
};
return this.props.children(e);
}
}, db = (e) => {
let t = An(fv);
!t && J();
let { contextId: n, isMovementAllowed: r } = t, i = I(null), a = I(null), { children: o, droppableId: s, type: c, mode: l, direction: u, ignoreContainerClipping: d, isDropDisabled: f, isCombineEnabled: p, snapshot: m, useClone: h, updateViewportMaxScroll: g, getContainerForClone: _ } = e, v = X(() => i.current, []), y = X((e = null) => {
i.current = e;
}, []);
X(() => a.current, []);
let b = X((e = null) => {
a.current = e;
}, []), x = X(() => {
r() && g({ maxScroll: r_() });
}, [r, g]);
ib({
droppableId: s,
type: c,
mode: l,
direction: u,
isDropDisabled: f,
isCombineEnabled: p,
ignoreContainerClipping: d,
getDroppableRef: v
});
let S = Y(() => P.createElement(ub, {
on: e.placeholder,
shouldAnimate: e.shouldAnimatePlaceholder
}, ({ onClose: e, data: t, animate: r }) => P.createElement(lb, {
placeholder: t,
onClose: e,
innerRef: b,
animate: r,
contextId: n,
onTransitionEnd: x
})), [
n,
x,
e.placeholder,
e.shouldAnimatePlaceholder,
b
]), C = Y(() => ({
innerRef: y,
placeholder: S,
droppableProps: {
"data-rfd-droppable-id": s,
"data-rfd-droppable-context-id": n
}
}), [
n,
s,
S,
y
]), w = h ? h.dragging.draggableId : null, T = Y(() => ({
droppableId: s,
type: c,
isUsingCloneFor: w
}), [
s,
w,
c
]);
function E() {
if (!h) return null;
let { dragging: e, render: t } = h, n = P.createElement(zy, {
draggableId: e.draggableId,
index: e.source.index,
isClone: !0,
isEnabled: !0,
shouldRespectForcePress: !1,
canDragInteractiveElements: !0
}, (n, r) => t(n, r, e));
return Zn.createPortal(n, _());
}
return P.createElement(Ey.Provider, { value: T }, o(C, m), E());
};
function fb() {
return !document.body && J(), document.body;
}
var pb = {
mode: "standard",
type: "DEFAULT",
direction: "vertical",
isDropDisabled: !1,
isCombineEnabled: !1,
ignoreContainerClipping: !1,
renderClone: null,
getContainerForClone: fb
}, mb = (e) => {
let t = { ...e }, n;
for (n in pb) e[n] === void 0 && (t = {
...t,
[n]: pb[n]
});
return t;
}, hb = (e, t) => e === t.droppable.type, gb = (e, t) => t.draggables[e.draggable.id], _b = w(() => {
let e = {
placeholder: null,
shouldAnimatePlaceholder: !0,
snapshot: {
isDraggingOver: !1,
draggingOverWith: null,
draggingFromThisWith: null,
isUsingPlaceholder: !1
},
useClone: null
}, t = {
...e,
shouldAnimatePlaceholder: !1
}, n = qp((e) => ({
draggableId: e.id,
type: e.type,
source: {
index: e.index,
droppableId: e.droppableId
}
})), r = qp((r, i, a, o, s, c) => {
let l = s.descriptor.id;
if (s.descriptor.droppableId === r) {
let e = c ? {
render: c,
dragging: n(s.descriptor)
} : null, t = {
isDraggingOver: a,
draggingOverWith: a ? l : null,
draggingFromThisWith: l,
isUsingPlaceholder: !0
};
return {
placeholder: s.placeholder,
shouldAnimatePlaceholder: !1,
snapshot: t,
useClone: e
};
}
if (!i) return t;
if (!o) return e;
let u = {
isDraggingOver: a,
draggingOverWith: l,
draggingFromThisWith: null,
isUsingPlaceholder: !0
};
return {
placeholder: s.placeholder,
shouldAnimatePlaceholder: !0,
snapshot: u,
useClone: null
};
});
return (n, i) => {
let a = mb(i), o = a.droppableId, s = a.type, c = !a.isDropDisabled, l = a.renderClone;
if (hv(n)) {
let e = n.critical;
if (!hb(s, e)) return t;
let i = gb(e, n.dimensions), a = ch(n.impact) === o;
return r(o, c, a, a, i, l);
}
if (n.phase === "DROP_ANIMATING") {
let e = n.completed;
if (!hb(s, e.critical)) return t;
let i = gb(e.critical, n.dimensions);
return r(o, c, jy(e.result) === o, ch(e.impact) === o, i, l);
}
if (n.phase === "IDLE" && n.completed && !n.shouldFlush) {
let r = n.completed;
if (!hb(s, r.critical)) return t;
let i = ch(r.impact) === o, a = !!(r.impact.at && r.impact.at.type === "COMBINE"), c = r.critical.droppable.id === o;
return i ? a ? e : t : c ? e : t;
}
return t;
};
}, { updateViewportMaxScroll: eg }, (e, t, n) => ({
...mb(n),
...e,
...t
}), {
context: rv,
areStatePropsEqual: Ay
})(db), vb = H("div")(({ theme: e }) => ({
alignItems: "center",
borderRight: `0.5px solid ${e.palette.divider}`,
display: "flex",
flex: 1,
flexDirection: "row",
marginBottom: e.spacing(-2),
marginRight: e.spacing(1),
marginTop: e.spacing(-2),
maxWidth: e.spacing(3),
width: e.spacing(3)
})), yb = (e, t, n) => {
let r = Array.from(e), [i] = r.splice(t, 1);
return r.splice(n, 0, i), r;
};
function bb({ resource: e, layerMetadata: t = {}, index: n, handleOpacityChange: r, setLayerVisibility: i, moveToBackground: a, moveToFront: o }) {
let { t: s } = V(), { width: c, height: l } = {
height: void 0,
width: 40
}, u = {
opacity: 1,
visibility: !!e.preferred,
...t || {}
};
return /* @__PURE__ */ B("div", {
style: { flex: 1 },
children: [/* @__PURE__ */ B("div", {
style: {
alignItems: "flex-start",
display: "flex"
},
children: [/* @__PURE__ */ z(un, {
maxHeight: l,
maxWidth: c,
resource: e,
border: !0
}), /* @__PURE__ */ B(U, {
sx: { paddingLeft: 1 },
component: "div",
variant: "body1",
children: [/* @__PURE__ */ z(sn, {
resource: e,
fallback: n + 1
}), /* @__PURE__ */ B("div", { children: [
/* @__PURE__ */ z(fn, {
"aria-label": s(u.visibility ? "layer_hide" : "layer_show"),
edge: "start",
size: "small",
onClick: () => {
i(e.id, !u.visibility);
},
children: u.visibility ? /* @__PURE__ */ z(qa, {}) : /* @__PURE__ */ z(Ja, {})
}),
u.index !== 0 && /* @__PURE__ */ z(fn, {
"aria-label": s("layer_moveToBackground"),
size: "small",
onClick: () => {
a(e.id);
},
children: /* @__PURE__ */ z(Jf, {})
}),
u.index !== t && /* @__PURE__ */ z(fn, {
"aria-label": s("layer_moveToFront"),
size: "small",
onClick: () => {
o(e.id);
},
children: /* @__PURE__ */ z(Yf, {})
})
] })]
})]
}), /* @__PURE__ */ B("div", {
style: {
alignItems: "center",
display: "flex"
},
children: [
/* @__PURE__ */ z(Gn, {
title: s("layer_opacity"),
children: /* @__PURE__ */ z(Xf, {
sx: { marginRight: .5 },
color: u.visibility ? "inherit" : "disabled",
fontSize: "small"
})
}),
/* @__PURE__ */ z(Sr, {
sx: { "MuiInput-input": {
"&::-webkit-outer-spin-button,&::-webkit-inner-spin-button": {
margin: 0,
WebkitAppearance: "none"
},
MozAppearance: "textfield",
textAlign: "right",
typography: "caption",
width: "3ch"
} },
disabled: !u.visibility,
value: Math.round(u.opacity * 100),
type: "number",
min: 0,
max: 100,
onChange: (t) => r(e.id, t.target.value),
endAdornment: /* @__PURE__ */ z(vr, {
disableTypography: !0,
position: "end",
children: /* @__PURE__ */ z(U, {
variant: "caption",
children: "%"
})
}),
inputProps: { "aria-label": s("layer_opacity") }
}),
/* @__PURE__ */ z(Cr, {
sx: {
marginLeft: 2,
marginRight: 2,
maxWidth: 150
},
disabled: !u.visibility,
value: u.opacity * 100,
onChange: (t, n) => r(e.id, n)
})
]
})]
});
}
bb.propTypes = {
handleOpacityChange: W.default.func.isRequired,
index: W.default.number.isRequired,
layerMetadata: W.default.objectOf(W.default.shape({
opacity: W.default.number,
visibility: W.default.bool
})),
moveToBackground: W.default.func.isRequired,
moveToFront: W.default.func.isRequired,
resource: W.default.object.isRequired,
setLayerVisibility: W.default.func.isRequired
};
function xb({ children: e, resource: t, index: n }) {
let { t: r } = V();
return /* @__PURE__ */ z(By, {
draggableId: t.id,
index: n,
children: (n, i) => /* @__PURE__ */ Cn(br, {
ref: n.innerRef,
...n.draggableProps,
component: "li",
divider: !0,
sx: {
alignItems: "stretch",
cursor: "pointer",
paddingBottom: 2,
paddingRight: 2,
paddingTop: 2,
...i.isDragging && { backgroundColor: "action.hover" }
},
disableGutters: !0,
key: t.id
}, /* @__PURE__ */ z(vb, {
...n.dragHandleProps,
sx: {
"&:hover": { backgroundColor: i.isDragging ? "action.selected" : "action.hover" },
backgroundColor: i.isDragging ? "action.selected" : "shades.light"
},
children: /* @__PURE__ */ z(Gn, {
title: r("layer_move"),
children: /* @__PURE__ */ z(qf, {})
})
}), e)
});
}
xb.propTypes = {
children: W.default.node.isRequired,
index: W.default.number.isRequired,
resource: W.default.object.isRequired
};
function Sb({ canvasId: e, index: t, label: n, layers: r, layerMetadata: i = {}, totalSize: a, updateLayers: o, windowId: s }) {
let { t: c } = V(), l = jn(), u = kn((t, n) => {
o(s, e, { [t]: { opacity: n / 100 } });
}, [
e,
o,
s
]), d = kn((t) => {
if (!t.destination || t.destination.droppableId !== l || t.source.droppableId !== l) return;
let n = yb(r.map((e) => e.id), t.source.index, t.destination.index);
o(s, e, r.reduce((e, t) => (e[t.id] = { index: n.indexOf(t.id) }, e), {}));
}, [
e,
l,
r,
o,
s
]), f = kn((t, n) => {
o(s, e, { [t]: { visibility: n } });
}, [
e,
o,
s
]), p = kn((t) => {
let n = yb(r.map((e) => e.id), r.findIndex((e) => e.id === t), 0);
o(s, e, r.reduce((e, t) => (e[t.id] = { index: n.indexOf(t.id) }, e), {}));
}, [
e,
r,
o,
s
]), m = kn((t) => {
let n = yb(r.map((e) => e.id), r.findIndex((e) => e.id === t), r.length - 1);
o(s, e, r.reduce((e, t) => (e[t.id] = { index: n.indexOf(t.id) }, e), {}));
}, [
e,
r,
o,
s
]);
return /* @__PURE__ */ B(R, { children: [a > 1 && /* @__PURE__ */ z(U, {
sx: {
paddingLeft: 1,
paddingRight: 1,
paddingTop: 2
},
variant: "overline",
children: c("annotationCanvasLabel", {
context: `${t + 1}/${a}`,
label: n
})
}), /* @__PURE__ */ z(gy, {
onDragEnd: d,
children: /* @__PURE__ */ z(_b, {
droppableId: l,
children: (e, t) => /* @__PURE__ */ B(yr, {
sx: { paddingTop: 0 },
...e.droppableProps,
ref: e.innerRef,
children: [r && r.map((e, t) => /* @__PURE__ */ z(xb, {
resource: e,
index: t,
children: /* @__PURE__ */ z(bb, {
resource: e,
index: t,
layerMetadata: (i || {})[e.id] || {},
handleOpacityChange: u,
setLayerVisibility: f,
moveToBackground: p,
moveToFront: m
})
}, e.id)), e.placeholder]
})
})
})] });
}
Sb.propTypes = {
canvasId: W.default.string.isRequired,
index: W.default.number.isRequired,
label: W.default.string.isRequired,
layerMetadata: W.default.objectOf(W.default.shape({ opacity: W.default.number })),
layers: W.default.arrayOf(W.default.shape({})).isRequired,
totalSize: W.default.number.isRequired,
updateLayers: W.default.func.isRequired,
windowId: W.default.string.isRequired
};
var Cb = n(w((e, { canvasId: t, companionWindowId: n, windowId: r }) => ({
label: Fe(e, {
canvasId: t,
companionWindowId: n,
windowId: r
}),
layerMetadata: Nt(e, {
canvasId: t,
companionWindowId: n,
windowId: r
}),
layers: Pt(e, {
canvasId: t,
companionWindowId: n,
windowId: r
})
}), { updateLayers: ma }))(Sb);
//#endregion
//#region src/components/LayersPanel.jsx
function wb({ canvasIds: e = [], id: t, windowId: n }) {
let { t: r } = V();
return /* @__PURE__ */ z(dl, {
title: r("layers"),
id: t,
windowId: n,
children: e.map((t, r) => /* @__PURE__ */ z(Cb, {
canvasId: t,
index: r,
totalSize: e.length,
windowId: n
}, t))
});
}
wb.propTypes = {
canvasIds: W.default.arrayOf(W.default.string),
id: W.default.string.isRequired,
windowId: W.default.string.isRequired
};
var Tb = n(w((e, { id: t, windowId: n }) => ({ canvasIds: at(e, { windowId: n }) })), m("LayersPanel"))(wb);
//#endregion
//#region src/components/CustomPanel.jsx
function Eb({ id: e, children: t = null, title: n, windowId: r }) {
let { t: i } = V();
return /* @__PURE__ */ z(dl, {
title: i(n),
id: e,
windowId: r,
children: t
});
}
Eb.propTypes = {
children: W.default.node,
id: W.default.string.isRequired,
title: W.default.string.isRequired,
windowId: W.default.string.isRequired
};
var Db = n(w((e, { id: t, windowId: n }) => ({})), m("CustomPanel"))(Eb), Ob = M(/*#__PURE__*/ z("path", { d: "m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z" }), "ArrowUpwardSharp");
//#endregion
//#region src/components/WindowSideBarCollectionPanel.jsx
function kb({ manifest: e, canvasNavigation: t, variant: n, ...r }) {
return /* @__PURE__ */ B(Jn, {
divider: !0,
component: "li",
variant: "multiline",
sx: {
alignItems: "flex-start",
paddingRight: 1
},
...r,
children: [n === "thumbnail" && /* @__PURE__ */ z(wr, { children: /* @__PURE__ */ z(un, {
resource: e,
maxHeight: t.height,
maxWidth: t.width
}) }), /* @__PURE__ */ z(Yn, { children: /* @__PURE__ */ z(sn, { resource: e }) })]
});
}
kb.propTypes = {
canvasNavigation: W.default.shape({
height: W.default.number,
width: W.default.number
}).isRequired,
manifest: W.default.object.isRequired,
variant: W.default.string.isRequired
};
function Ab({ canvasNavigation: e, collectionPath: t = [], collection: n = null, id: r, isFetching: i = !1, manifestId: a, parentCollection: o = null, updateCompanionWindow: s, updateWindow: c, variant: l = null, windowId: u }) {
let { t: d } = V(), f = (() => {
if (!n) return !1;
let e = n.getProperty("behavior");
return e ? Array.isArray(e) ? e.includes("multi-part") : e === "multi-part" : !1;
})();
return /* @__PURE__ */ z(dl, {
title: d(f ? "multipartCollection" : "collection"),
windowId: u,
id: r,
titleControls: /* @__PURE__ */ B(R, { children: [o && /* @__PURE__ */ z(yr, { children: /* @__PURE__ */ B(xr, {
onClick: () => s({ collectionPath: t.slice(0, -1) }),
children: [/* @__PURE__ */ z(wr, { children: /* @__PURE__ */ z(Ob, {}) }), /* @__PURE__ */ z(Yn, {
slotProps: { primary: { variant: "body1" } },
children: /* @__PURE__ */ z(sn, { resource: o })
})]
}) }), /* @__PURE__ */ B(U, {
variant: "h6",
children: [n && /* @__PURE__ */ z(sn, { resource: n }), i && /* @__PURE__ */ z(mr, { variant: "text" })]
})] }),
children: /* @__PURE__ */ B(qn, { children: [
i && /* @__PURE__ */ z(Jn, { children: /* @__PURE__ */ B(Yn, { children: [
/* @__PURE__ */ z(mr, { variant: "text" }),
/* @__PURE__ */ z(mr, { variant: "text" }),
/* @__PURE__ */ z(mr, { variant: "text" })
] }) }),
n && n.getCollections().map((n) => /* @__PURE__ */ z(kb, {
onClick: () => {
s({ collectionPath: [...t, n.id] });
},
canvasNavigation: e,
manifest: n,
variant: l,
selected: a === n.id
}, n.id)),
n && n.getManifests().map((n) => /* @__PURE__ */ z(kb, {
onClick: () => {
c({
canvasId: null,
collectionPath: t,
manifestId: n.id
}), s({ multipart: !1 });
},
canvasNavigation: e,
manifest: n,
variant: l,
selected: a === n.id
}, n.id))
] })
});
}
Ab.propTypes = {
canvasNavigation: W.default.shape({
height: W.default.number,
width: W.default.number
}).isRequired,
collection: W.default.object,
collectionPath: W.default.arrayOf(W.default.string),
id: W.default.string.isRequired,
isFetching: W.default.bool,
manifestId: W.default.string.isRequired,
parentCollection: W.default.object,
updateCompanionWindow: W.default.func.isRequired,
updateWindow: W.default.func.isRequired,
variant: W.default.string,
windowId: W.default.string.isRequired
};
var jb = n(w((e, { id: t, windowId: n }) => {
let r = s(e, { windowId: n }), i = se(e, { companionWindowId: t }), { collectionPath: a } = i, o = a || r.collectionPath, c = o && o[o.length - 1], l = o && o[o.length - 2], u = c && b(e, { manifestId: c }), d = l && b(e, { manifestId: l }), f = b(e, { windowId: n });
return {
canvasNavigation: e.config.canvasNavigation,
collection: u && Le(e, { manifestId: u.id }),
collectionId: c,
collectionPath: o,
error: u && u.error,
isFetching: u && u.isFetching,
manifestId: f && f.id,
parentCollection: d && Le(e, { manifestId: d.id }),
ready: u && !!u.json,
variant: i.variant || wi(e, { windowId: n })
};
}, (e, { id: t, windowId: n }) => ({
updateCompanionWindow: (...r) => e(Mi(n, t, ...r)),
updateWindow: (...t) => e(Gt(n, ...t))
})), m("WindowSideBarCollectionPanel"))(Ab), Mb = {
annotations: ml,
attribution: pf,
canvas: nf,
collection: jb,
custom: Db,
info: Pl,
layers: Tb,
search: Kf,
thumbnailNavigation: Ka
}, Nb = Sn({ dragDropManager: void 0 });
//#endregion
//#region node_modules/dnd-core/node_modules/redux/es/redux.js
function Pb(e) {
return "Minified Redux error #" + e + "; visit https://redux.js.org/Errors?code=" + e + " for the full message or use the non-minified dev environment for full errors. ";
}
var Fb = (function() {
return typeof Symbol == "function" && Symbol.observable || "@@observable";
})(), Ib = function() {
return Math.random().toString(36).substring(7).split("").join(".");
}, Lb = {
INIT: "@@redux/INIT" + Ib(),
REPLACE: "@@redux/REPLACE" + Ib(),
PROBE_UNKNOWN_ACTION: function() {
return "@@redux/PROBE_UNKNOWN_ACTION" + Ib();
}
};
function Rb(e) {
if (typeof e != "object" || !e) return !1;
for (var t = e; Object.getPrototypeOf(t) !== null;) t = Object.getPrototypeOf(t);
return Object.getPrototypeOf(e) === t;
}
function zb(e, t, n) {
var r;
if (typeof t == "function" && typeof n == "function" || typeof n == "function" && typeof arguments[3] == "function") throw Error(Pb(0));
if (typeof t == "function" && n === void 0 && (n = t, t = void 0), n !== void 0) {
if (typeof n != "function") throw Error(Pb(1));
return n(zb)(e, t);
}
if (typeof e != "function") throw Error(Pb(2));
var i = e, a = t, o = [], s = o, c = !1;
function l() {
s === o && (s = o.slice());
}
function u() {
if (c) throw Error(Pb(3));
return a;
}
function d(e) {
if (typeof e != "function") throw Error(Pb(4));
if (c) throw Error(Pb(5));
var t = !0;
return l(), s.push(e), function() {
if (t) {
if (c) throw Error(Pb(6));
t = !1, l();
var n = s.indexOf(e);
s.splice(n, 1), o = null;
}
};
}
function f(e) {
if (!Rb(e)) throw Error(Pb(7));
if (e.type === void 0) throw Error(Pb(8));
if (c) throw Error(Pb(9));
try {
c = !0, a = i(a, e);
} finally {
c = !1;
}
for (var t = o = s, n = 0; n < t.length; n++) {
var r = t[n];
r();
}
return e;
}
function p(e) {
if (typeof e != "function") throw Error(Pb(10));
i = e, f({ type: Lb.REPLACE });
}
function m() {
var e, t = d;
return e = { subscribe: function(e) {
if (typeof e != "object" || !e) throw Error(Pb(11));
function n() {
e.next && e.next(u());
}
return n(), { unsubscribe: t(n) };
} }, e[Fb] = function() {
return this;
}, e;
}
return f({ type: Lb.INIT }), r = {
dispatch: f,
subscribe: d,
getState: u,
replaceReducer: p
}, r[Fb] = m, r;
}
//#endregion
//#region node_modules/@react-dnd/invariant/dist/index.js
function Q(e, t, ...n) {
if (Bb() && t === void 0) throw Error("invariant requires an error message argument");
if (!e) {
let e;
if (t === void 0) e = /* @__PURE__ */ Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
else {
let r = 0;
e = Error(t.replace(/%s/g, function() {
return n[r++];
})), e.name = "Invariant Violation";
}
throw e.framesToPop = 1, e;
}
}
function Bb() {
return typeof process < "u" && !0;
}
//#endregion
//#region node_modules/dnd-core/dist/utils/js_utils.js
function Vb(e, t, n) {
return t.split(".").reduce((e, t) => e && e[t] ? e[t] : n || null, e);
}
function Hb(e, t) {
return e.filter((e) => e !== t);
}
function Ub(e) {
return typeof e == "object";
}
function Wb(e, t) {
let n = /* @__PURE__ */ new Map(), r = (e) => {
n.set(e, n.has(e) ? n.get(e) + 1 : 1);
};
e.forEach(r), t.forEach(r);
let i = [];
return n.forEach((e, t) => {
e === 1 && i.push(t);
}), i;
}
function Gb(e, t) {
return e.filter((e) => t.indexOf(e) > -1);
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/types.js
var Kb = "dnd-core/INIT_COORDS", qb = "dnd-core/BEGIN_DRAG", Jb = "dnd-core/PUBLISH_DRAG_SOURCE", Yb = "dnd-core/HOVER", Xb = "dnd-core/DROP", Zb = "dnd-core/END_DRAG";
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/local/setClientOffset.js
function Qb(e, t) {
return {
type: Kb,
payload: {
sourceClientOffset: t || null,
clientOffset: e || null
}
};
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/beginDrag.js
var $b = {
type: Kb,
payload: {
clientOffset: null,
sourceClientOffset: null
}
};
function ex(e) {
return function(t = [], n = { publishSource: !0 }) {
let { publishSource: r = !0, clientOffset: i, getSourceClientOffset: a } = n, o = e.getMonitor(), s = e.getRegistry();
e.dispatch(Qb(i)), tx(t, o, s);
let c = ix(t, o);
if (c == null) {
e.dispatch($b);
return;
}
let l = null;
if (i) {
if (!a) throw Error("getSourceClientOffset must be defined");
nx(a), l = a(c);
}
e.dispatch(Qb(i, l));
let u = s.getSource(c).beginDrag(o, c);
return u == null ? void 0 : (rx(u), s.pinSource(c), {
type: qb,
payload: {
itemType: s.getSourceType(c),
item: u,
sourceId: c,
clientOffset: i || null,
sourceClientOffset: l || null,
isSourcePublic: !!r
}
});
};
}
function tx(e, t, n) {
Q(!t.isDragging(), "Cannot call beginDrag while dragging."), e.forEach(function(e) {
Q(n.getSource(e), "Expected sourceIds to be registered.");
});
}
function nx(e) {
Q(typeof e == "function", "When clientOffset is provided, getSourceClientOffset must be a function.");
}
function rx(e) {
Q(Ub(e), "Item must be an object.");
}
function ix(e, t) {
let n = null;
for (let r = e.length - 1; r >= 0; r--) if (t.canDragSource(e[r])) {
n = e[r];
break;
}
return n;
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/drop.js
function ax(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function ox(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
return Object.getOwnPropertyDescriptor(n, e).enumerable;
}))), r.forEach(function(t) {
ax(e, t, n[t]);
});
}
return e;
}
function sx(e) {
return function(t = {}) {
let n = e.getMonitor(), r = e.getRegistry();
cx(n), dx(n).forEach((i, a) => {
let o = {
type: Xb,
payload: { dropResult: ox({}, t, lx(i, a, r, n)) }
};
e.dispatch(o);
});
};
}
function cx(e) {
Q(e.isDragging(), "Cannot call drop while not dragging."), Q(!e.didDrop(), "Cannot call drop twice during one drag operation.");
}
function lx(e, t, n, r) {
let i = n.getTarget(e), a = i ? i.drop(r, e) : void 0;
return ux(a), a === void 0 && (a = t === 0 ? {} : r.getDropResult()), a;
}
function ux(e) {
Q(e === void 0 || Ub(e), "Drop result must either be an object or undefined.");
}
function dx(e) {
let t = e.getTargetIds().filter(e.canDropOnTarget, e);
return t.reverse(), t;
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/endDrag.js
function fx(e) {
return function() {
let t = e.getMonitor(), n = e.getRegistry();
px(t);
let r = t.getSourceId();
return r != null && (n.getSource(r, !0).endDrag(t, r), n.unpinSource()), { type: Zb };
};
}
function px(e) {
Q(e.isDragging(), "Cannot call endDrag while not dragging.");
}
//#endregion
//#region node_modules/dnd-core/dist/utils/matchesType.js
function mx(e, t) {
return t === null ? e === null : Array.isArray(e) ? e.some((e) => e === t) : e === t;
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/hover.js
function hx(e) {
return function(t, { clientOffset: n } = {}) {
gx(t);
let r = t.slice(0), i = e.getMonitor(), a = e.getRegistry();
return vx(r, a, i.getItemType()), _x(r, i, a), yx(r, i, a), {
type: Yb,
payload: {
targetIds: r,
clientOffset: n || null
}
};
};
}
function gx(e) {
Q(Array.isArray(e), "Expected targetIds to be an array.");
}
function _x(e, t, n) {
Q(t.isDragging(), "Cannot call hover while not dragging."), Q(!t.didDrop(), "Cannot call hover after drop.");
for (let t = 0; t < e.length; t++) {
let r = e[t];
Q(e.lastIndexOf(r) === t, "Expected targetIds to be unique in the passed array."), Q(n.getTarget(r), "Expected targetIds to be registered.");
}
}
function vx(e, t, n) {
for (let r = e.length - 1; r >= 0; r--) {
let i = e[r];
mx(t.getTargetType(i), n) || e.splice(r, 1);
}
}
function yx(e, t, n) {
e.forEach(function(e) {
n.getTarget(e).hover(t, e);
});
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/publishDragSource.js
function bx(e) {
return function() {
if (e.getMonitor().isDragging()) return { type: Jb };
};
}
//#endregion
//#region node_modules/dnd-core/dist/actions/dragDrop/index.js
function xx(e) {
return {
beginDrag: ex(e),
publishDragSource: bx(e),
hover: hx(e),
drop: sx(e),
endDrag: fx(e)
};
}
//#endregion
//#region node_modules/dnd-core/dist/classes/DragDropManagerImpl.js
var Sx = class {
receiveBackend(e) {
this.backend = e;
}
getMonitor() {
return this.monitor;
}
getBackend() {
return this.backend;
}
getRegistry() {
return this.monitor.registry;
}
getActions() {
let e = this, { dispatch: t } = this.store;
function n(n) {
return (...r) => {
let i = n.apply(e, r);
i !== void 0 && t(i);
};
}
let r = xx(this);
return Object.keys(r).reduce((e, t) => {
let i = r[t];
return e[t] = n(i), e;
}, {});
}
dispatch(e) {
this.store.dispatch(e);
}
constructor(e, t) {
this.isSetUp = !1, this.handleRefCountChange = () => {
let e = this.store.getState().refCount > 0;
this.backend && (e && !this.isSetUp ? (this.backend.setup(), this.isSetUp = !0) : !e && this.isSetUp && (this.backend.teardown(), this.isSetUp = !1));
}, this.store = e, this.monitor = t, e.subscribe(this.handleRefCountChange);
}
};
//#endregion
//#region node_modules/dnd-core/dist/utils/coords.js
function Cx(e, t) {
return {
x: e.x + t.x,
y: e.y + t.y
};
}
function wx(e, t) {
return {
x: e.x - t.x,
y: e.y - t.y
};
}
function Tx(e) {
let { clientOffset: t, initialClientOffset: n, initialSourceClientOffset: r } = e;
return !t || !n || !r ? null : wx(Cx(t, r), n);
}
function Ex(e) {
let { clientOffset: t, initialClientOffset: n } = e;
return !t || !n ? null : wx(t, n);
}
//#endregion
//#region node_modules/dnd-core/dist/utils/dirtiness.js
var Dx = [], Ox = [];
Dx.__IS_NONE__ = !0, Ox.__IS_ALL__ = !0;
function kx(e, t) {
return e === Dx ? !1 : e === Ox || t === void 0 || Gb(t, e).length > 0;
}
//#endregion
//#region node_modules/dnd-core/dist/classes/DragDropMonitorImpl.js
var Ax = class {
subscribeToStateChange(e, t = {}) {
let { handlerIds: n } = t;
Q(typeof e == "function", "listener must be a function."), Q(n === void 0 || Array.isArray(n), "handlerIds, when specified, must be an array of strings.");
let r = this.store.getState().stateId;
return this.store.subscribe(() => {
let t = this.store.getState(), i = t.stateId;
try {
i === r || i === r + 1 && !kx(t.dirtyHandlerIds, n) || e();
} finally {
r = i;
}
});
}
subscribeToOffsetChange(e) {
Q(typeof e == "function", "listener must be a function.");
let t = this.store.getState().dragOffset;
return this.store.subscribe(() => {
let n = this.store.getState().dragOffset;
n !== t && (t = n, e());
});
}
canDragSource(e) {
if (!e) return !1;
let t = this.registry.getSource(e);
return Q(t, `Expected to find a valid source. sourceId=${e}`), !this.isDragging() && t.canDrag(this, e);
}
canDropOnTarget(e) {
if (!e) return !1;
let t = this.registry.getTarget(e);
return Q(t, `Expected to find a valid target. targetId=${e}`), !this.isDragging() || this.didDrop() ? !1 : mx(this.registry.getTargetType(e), this.getItemType()) && t.canDrop(this, e);
}
isDragging() {
return !!this.getItemType();
}
isDraggingSource(e) {
if (!e) return !1;
let t = this.registry.getSource(e, !0);
return Q(t, `Expected to find a valid source. sourceId=${e}`), !this.isDragging() || !this.isSourcePublic() || this.registry.getSourceType(e) !== this.getItemType() ? !1 : t.isDragging(this, e);
}
isOverTarget(e, t = { shallow: !1 }) {
if (!e) return !1;
let { shallow: n } = t;
if (!this.isDragging()) return !1;
let r = this.registry.getTargetType(e), i = this.getItemType();
if (i && !mx(r, i)) return !1;
let a = this.getTargetIds();
if (!a.length) return !1;
let o = a.indexOf(e);
return n ? o === a.length - 1 : o > -1;
}
getItemType() {
return this.store.getState().dragOperation.itemType;
}
getItem() {
return this.store.getState().dragOperation.item;
}
getSourceId() {
return this.store.getState().dragOperation.sourceId;
}
getTargetIds() {
return this.store.getState().dragOperation.targetIds;
}
getDropResult() {
return this.store.getState().dragOperation.dropResult;
}
didDrop() {
return this.store.getState().dragOperation.didDrop;
}
isSourcePublic() {
return !!this.store.getState().dragOperation.isSourcePublic;
}
getInitialClientOffset() {
return this.store.getState().dragOffset.initialClientOffset;
}
getInitialSourceClientOffset() {
return this.store.getState().dragOffset.initialSourceClientOffset;
}
getClientOffset() {
return this.store.getState().dragOffset.clientOffset;
}
getSourceClientOffset() {
return Tx(this.store.getState().dragOffset);
}
getDifferenceFromInitialOffset() {
return Ex(this.store.getState().dragOffset);
}
constructor(e, t) {
this.store = e, this.registry = t;
}
}, jx = typeof global < "u" ? global : self, Mx = jx.MutationObserver || jx.WebKitMutationObserver;
function Nx(e) {
return function() {
let t = setTimeout(r, 0), n = setInterval(r, 50);
function r() {
clearTimeout(t), clearInterval(n), e();
}
};
}
function Px(e) {
let t = 1, n = new Mx(e), r = document.createTextNode("");
return n.observe(r, { characterData: !0 }), function() {
t = -t, r.data = t;
};
}
var Fx = typeof Mx == "function" ? Px : Nx, Ix = class {
enqueueTask(e) {
let { queue: t, requestFlush: n } = this;
t.length || (n(), this.flushing = !0), t[t.length] = e;
}
constructor() {
this.queue = [], this.pendingErrors = [], this.flushing = !1, this.index = 0, this.capacity = 1024, this.flush = () => {
let { queue: e } = this;
for (; this.index < e.length;) {
let t = this.index;
if (this.index++, e[t].call(), this.index > this.capacity) {
for (let t = 0, n = e.length - this.index; t < n; t++) e[t] = e[t + this.index];
e.length -= this.index, this.index = 0;
}
}
e.length = 0, this.index = 0, this.flushing = !1;
}, this.registerPendingError = (e) => {
this.pendingErrors.push(e), this.requestErrorThrow();
}, this.requestFlush = Fx(this.flush), this.requestErrorThrow = Nx(() => {
if (this.pendingErrors.length) throw this.pendingErrors.shift();
});
}
}, Lx = class {
call() {
try {
this.task && this.task();
} catch (e) {
this.onError(e);
} finally {
this.task = null, this.release(this);
}
}
constructor(e, t) {
this.onError = e, this.release = t, this.task = null;
}
}, Rx = class {
create(e) {
let t = this.freeTasks, n = t.length ? t.pop() : new Lx(this.onError, (e) => t[t.length] = e);
return n.task = e, n;
}
constructor(e) {
this.onError = e, this.freeTasks = [];
}
}, zx = new Ix(), Bx = new Rx(zx.registerPendingError);
function Vx(e) {
zx.enqueueTask(Bx.create(e));
}
//#endregion
//#region node_modules/dnd-core/dist/actions/registry.js
var Hx = "dnd-core/ADD_SOURCE", Ux = "dnd-core/ADD_TARGET", Wx = "dnd-core/REMOVE_SOURCE", Gx = "dnd-core/REMOVE_TARGET";
function Kx(e) {
return {
type: Hx,
payload: { sourceId: e }
};
}
function qx(e) {
return {
type: Ux,
payload: { targetId: e }
};
}
function Jx(e) {
return {
type: Wx,
payload: { sourceId: e }
};
}
function Yx(e) {
return {
type: Gx,
payload: { targetId: e }
};
}
//#endregion
//#region node_modules/dnd-core/dist/contracts.js
function Xx(e) {
Q(typeof e.canDrag == "function", "Expected canDrag to be a function."), Q(typeof e.beginDrag == "function", "Expected beginDrag to be a function."), Q(typeof e.endDrag == "function", "Expected endDrag to be a function.");
}
function Zx(e) {
Q(typeof e.canDrop == "function", "Expected canDrop to be a function."), Q(typeof e.hover == "function", "Expected hover to be a function."), Q(typeof e.drop == "function", "Expected beginDrag to be a function.");
}
function Qx(e, t) {
if (t && Array.isArray(e)) {
e.forEach((e) => Qx(e, !1));
return;
}
Q(typeof e == "string" || typeof e == "symbol", t ? "Type can only be a string, a symbol, or an array of either." : "Type can only be a string or a symbol.");
}
//#endregion
//#region node_modules/dnd-core/dist/interfaces.js
var $x;
(function(e) {
e.SOURCE = "SOURCE", e.TARGET = "TARGET";
})($x ||= {});
//#endregion
//#region node_modules/dnd-core/dist/utils/getNextUniqueId.js
var eS = 0;
function tS() {
return eS++;
}
//#endregion
//#region node_modules/dnd-core/dist/classes/HandlerRegistryImpl.js
function nS(e) {
let t = tS().toString();
switch (e) {
case $x.SOURCE: return `S${t}`;
case $x.TARGET: return `T${t}`;
default: throw Error(`Unknown Handler Role: ${e}`);
}
}
function rS(e) {
switch (e[0]) {
case "S": return $x.SOURCE;
case "T": return $x.TARGET;
default: throw Error(`Cannot parse handler ID: ${e}`);
}
}
function iS(e, t) {
let n = e.entries(), r = !1;
do {
let { done: e, value: [, i] } = n.next();
if (i === t) return !0;
r = !!e;
} while (!r);
return !1;
}
var aS = class {
addSource(e, t) {
Qx(e), Xx(t);
let n = this.addHandler($x.SOURCE, e, t);
return this.store.dispatch(Kx(n)), n;
}
addTarget(e, t) {
Qx(e, !0), Zx(t);
let n = this.addHandler($x.TARGET, e, t);
return this.store.dispatch(qx(n)), n;
}
containsHandler(e) {
return iS(this.dragSources, e) || iS(this.dropTargets, e);
}
getSource(e, t = !1) {
return Q(this.isSourceId(e), "Expected a valid source ID."), t && e === this.pinnedSourceId ? this.pinnedSource : this.dragSources.get(e);
}
getTarget(e) {
return Q(this.isTargetId(e), "Expected a valid target ID."), this.dropTargets.get(e);
}
getSourceType(e) {
return Q(this.isSourceId(e), "Expected a valid source ID."), this.types.get(e);
}
getTargetType(e) {
return Q(this.isTargetId(e), "Expected a valid target ID."), this.types.get(e);
}
isSourceId(e) {
return rS(e) === $x.SOURCE;
}
isTargetId(e) {
return rS(e) === $x.TARGET;
}
removeSource(e) {
Q(this.getSource(e), "Expected an existing source."), this.store.dispatch(Jx(e)), Vx(() => {
this.dragSources.delete(e), this.types.delete(e);
});
}
removeTarget(e) {
Q(this.getTarget(e), "Expected an existing target."), this.store.dispatch(Yx(e)), this.dropTargets.delete(e), this.types.delete(e);
}
pinSource(e) {
let t = this.getSource(e);
Q(t, "Expected an existing source."), this.pinnedSourceId = e, this.pinnedSource = t;
}
unpinSource() {
Q(this.pinnedSource, "No source is pinned at the time."), this.pinnedSourceId = null, this.pinnedSource = null;
}
addHandler(e, t, n) {
let r = nS(e);
return this.types.set(r, t), e === $x.SOURCE ? this.dragSources.set(r, n) : e === $x.TARGET && this.dropTargets.set(r, n), r;
}
constructor(e) {
this.types = /* @__PURE__ */ new Map(), this.dragSources = /* @__PURE__ */ new Map(), this.dropTargets = /* @__PURE__ */ new Map(), this.pinnedSourceId = null, this.pinnedSource = null, this.store = e;
}
}, oS = (e, t) => e === t;
function sS(e, t) {
return !e && !t ? !0 : !e || !t ? !1 : e.x === t.x && e.y === t.y;
}
function cS(e, t, n = oS) {
if (e.length !== t.length) return !1;
for (let r = 0; r < e.length; ++r) if (!n(e[r], t[r])) return !1;
return !0;
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/dirtyHandlerIds.js
function lS(e = Dx, t) {
switch (t.type) {
case Yb: break;
case Hx:
case Ux:
case Gx:
case Wx: return Dx;
case qb:
case Jb:
case Zb:
case Xb:
default: return Ox;
}
let { targetIds: n = [], prevTargetIds: r = [] } = t.payload, i = Wb(n, r);
if (!(i.length > 0 || !cS(n, r))) return Dx;
let a = r[r.length - 1], o = n[n.length - 1];
return a !== o && (a && i.push(a), o && i.push(o)), i;
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/dragOffset.js
function uS(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function dS(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
return Object.getOwnPropertyDescriptor(n, e).enumerable;
}))), r.forEach(function(t) {
uS(e, t, n[t]);
});
}
return e;
}
var fS = {
initialSourceClientOffset: null,
initialClientOffset: null,
clientOffset: null
};
function pS(e = fS, t) {
let { payload: n } = t;
switch (t.type) {
case Kb:
case qb: return {
initialSourceClientOffset: n.sourceClientOffset,
initialClientOffset: n.clientOffset,
clientOffset: n.clientOffset
};
case Yb: return sS(e.clientOffset, n.clientOffset) ? e : dS({}, e, { clientOffset: n.clientOffset });
case Zb:
case Xb: return fS;
default: return e;
}
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/dragOperation.js
function mS(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function hS(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
return Object.getOwnPropertyDescriptor(n, e).enumerable;
}))), r.forEach(function(t) {
mS(e, t, n[t]);
});
}
return e;
}
var gS = {
itemType: null,
item: null,
sourceId: null,
targetIds: [],
dropResult: null,
didDrop: !1,
isSourcePublic: null
};
function _S(e = gS, t) {
let { payload: n } = t;
switch (t.type) {
case qb: return hS({}, e, {
itemType: n.itemType,
item: n.item,
sourceId: n.sourceId,
isSourcePublic: n.isSourcePublic,
dropResult: null,
didDrop: !1
});
case Jb: return hS({}, e, { isSourcePublic: !0 });
case Yb: return hS({}, e, { targetIds: n.targetIds });
case Gx: return e.targetIds.indexOf(n.targetId) === -1 ? e : hS({}, e, { targetIds: Hb(e.targetIds, n.targetId) });
case Xb: return hS({}, e, {
dropResult: n.dropResult,
didDrop: !0,
targetIds: []
});
case Zb: return hS({}, e, {
itemType: null,
item: null,
sourceId: null,
dropResult: null,
didDrop: !1,
isSourcePublic: null,
targetIds: []
});
default: return e;
}
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/refCount.js
function vS(e = 0, t) {
switch (t.type) {
case Hx:
case Ux: return e + 1;
case Wx:
case Gx: return e - 1;
default: return e;
}
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/stateId.js
function yS(e = 0) {
return e + 1;
}
//#endregion
//#region node_modules/dnd-core/dist/reducers/index.js
function bS(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function xS(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
return Object.getOwnPropertyDescriptor(n, e).enumerable;
}))), r.forEach(function(t) {
bS(e, t, n[t]);
});
}
return e;
}
function SS(e = {}, t) {
return {
dirtyHandlerIds: lS(e.dirtyHandlerIds, {
type: t.type,
payload: xS({}, t.payload, { prevTargetIds: Vb(e, "dragOperation.targetIds", []) })
}),
dragOffset: pS(e.dragOffset, t),
refCount: vS(e.refCount, t),
dragOperation: _S(e.dragOperation, t),
stateId: yS(e.stateId)
};
}
//#endregion
//#region node_modules/dnd-core/dist/createDragDropManager.js
function CS(e, t = void 0, n = {}, r = !1) {
let i = wS(r), a = new Sx(i, new Ax(i, new aS(i))), o = e(a, t, n);
return a.receiveBackend(o), a;
}
function wS(e) {
let t = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION__;
return zb(SS, e && t && t({
name: "dnd-core",
instanceId: "dnd-core"
}));
}
//#endregion
//#region node_modules/react-dnd/dist/core/DndProvider.js
function TS(e, t) {
if (e == null) return {};
var n = ES(e, t), r, i;
if (Object.getOwnPropertySymbols) {
var a = Object.getOwnPropertySymbols(e);
for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
}
return n;
}
function ES(e, t) {
if (e == null) return {};
var n = {}, r = Object.keys(e), i, a;
for (a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
return n;
}
var DS = 0, OS = Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"), kS = /*#__PURE__*/ On(function(e) {
var { children: t } = e;
let [n, r] = AS(TS(e, ["children"]));
return F(() => {
if (r) {
let e = MS();
return ++DS, () => {
--DS === 0 && (e[OS] = null);
};
}
}, []), /*#__PURE__*/ z(Nb.Provider, {
value: n,
children: t
});
});
function AS(e) {
return "manager" in e ? [{ dragDropManager: e.manager }, !1] : [jS(e.backend, e.context, e.options, e.debugMode), !e.context];
}
function jS(e, t = MS(), n, r) {
let i = t;
return i[OS] || (i[OS] = { dragDropManager: CS(e, t, n, r) }), i[OS];
}
function MS() {
return typeof global < "u" ? global : window;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useIsomorphicLayoutEffect.js
var NS = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
t.exports = function e(t, n) {
if (t === n) return !0;
if (t && n && typeof t == "object" && typeof n == "object") {
if (t.constructor !== n.constructor) return !1;
var r, i, a;
if (Array.isArray(t)) {
if (r = t.length, r != n.length) return !1;
for (i = r; i-- !== 0;) if (!e(t[i], n[i])) return !1;
return !0;
}
if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
for (i = r; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(n, a[i])) return !1;
for (i = r; i-- !== 0;) {
var o = a[i];
if (!e(t[o], n[o])) return !1;
}
return !0;
}
return t !== t && n !== n;
};
})))(), 1), PS = typeof window < "u" ? Nn : F;
//#endregion
//#region node_modules/react-dnd/dist/hooks/useCollector.js
function FS(e, t, n) {
let [r, i] = L(() => t(e)), a = kn(() => {
let a = t(e);
(0, NS.default)(r, a) || (i(a), n && n());
}, [
r,
e,
n
]);
return PS(a), [r, a];
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useMonitorOutput.js
function IS(e, t, n) {
let [r, i] = FS(e, t, n);
return PS(function() {
let t = e.getHandlerId();
if (t != null) return e.subscribeToStateChange(i, { handlerIds: [t] });
}, [e, i]), r;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useCollectedProps.js
function LS(e, t, n) {
return IS(t, e || (() => ({})), () => n.reconnect());
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useOptionalFactory.js
function RS(e, t) {
let n = [...t || []];
return t == null && typeof e != "function" && n.push(e), Pn(() => typeof e == "function" ? e() : e, n);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/connectors.js
function zS(e) {
return Pn(() => e.hooks.dragSource(), [e]);
}
function BS(e) {
return Pn(() => e.hooks.dragPreview(), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/internals/DragSourceMonitorImpl.js
var VS = !1, HS = !1, US = class {
receiveHandlerId(e) {
this.sourceId = e;
}
getHandlerId() {
return this.sourceId;
}
canDrag() {
Q(!VS, "You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
try {
return VS = !0, this.internalMonitor.canDragSource(this.sourceId);
} finally {
VS = !1;
}
}
isDragging() {
if (!this.sourceId) return !1;
Q(!HS, "You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");
try {
return HS = !0, this.internalMonitor.isDraggingSource(this.sourceId);
} finally {
HS = !1;
}
}
subscribeToStateChange(e, t) {
return this.internalMonitor.subscribeToStateChange(e, t);
}
isDraggingSource(e) {
return this.internalMonitor.isDraggingSource(e);
}
isOverTarget(e, t) {
return this.internalMonitor.isOverTarget(e, t);
}
getTargetIds() {
return this.internalMonitor.getTargetIds();
}
isSourcePublic() {
return this.internalMonitor.isSourcePublic();
}
getSourceId() {
return this.internalMonitor.getSourceId();
}
subscribeToOffsetChange(e) {
return this.internalMonitor.subscribeToOffsetChange(e);
}
canDragSource(e) {
return this.internalMonitor.canDragSource(e);
}
canDropOnTarget(e) {
return this.internalMonitor.canDropOnTarget(e);
}
getItemType() {
return this.internalMonitor.getItemType();
}
getItem() {
return this.internalMonitor.getItem();
}
getDropResult() {
return this.internalMonitor.getDropResult();
}
didDrop() {
return this.internalMonitor.didDrop();
}
getInitialClientOffset() {
return this.internalMonitor.getInitialClientOffset();
}
getInitialSourceClientOffset() {
return this.internalMonitor.getInitialSourceClientOffset();
}
getSourceClientOffset() {
return this.internalMonitor.getSourceClientOffset();
}
getClientOffset() {
return this.internalMonitor.getClientOffset();
}
getDifferenceFromInitialOffset() {
return this.internalMonitor.getDifferenceFromInitialOffset();
}
constructor(e) {
this.sourceId = null, this.internalMonitor = e.getMonitor();
}
}, WS = !1, GS = class {
receiveHandlerId(e) {
this.targetId = e;
}
getHandlerId() {
return this.targetId;
}
subscribeToStateChange(e, t) {
return this.internalMonitor.subscribeToStateChange(e, t);
}
canDrop() {
if (!this.targetId) return !1;
Q(!WS, "You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");
try {
return WS = !0, this.internalMonitor.canDropOnTarget(this.targetId);
} finally {
WS = !1;
}
}
isOver(e) {
return this.targetId ? this.internalMonitor.isOverTarget(this.targetId, e) : !1;
}
getItemType() {
return this.internalMonitor.getItemType();
}
getItem() {
return this.internalMonitor.getItem();
}
getDropResult() {
return this.internalMonitor.getDropResult();
}
didDrop() {
return this.internalMonitor.didDrop();
}
getInitialClientOffset() {
return this.internalMonitor.getInitialClientOffset();
}
getInitialSourceClientOffset() {
return this.internalMonitor.getInitialSourceClientOffset();
}
getSourceClientOffset() {
return this.internalMonitor.getSourceClientOffset();
}
getClientOffset() {
return this.internalMonitor.getClientOffset();
}
getDifferenceFromInitialOffset() {
return this.internalMonitor.getDifferenceFromInitialOffset();
}
constructor(e) {
this.targetId = null, this.internalMonitor = e.getMonitor();
}
};
//#endregion
//#region node_modules/react-dnd/dist/internals/registration.js
function KS(e, t, n) {
let r = n.getRegistry(), i = r.addTarget(e, t);
return [i, () => r.removeTarget(i)];
}
function qS(e, t, n) {
let r = n.getRegistry(), i = r.addSource(e, t);
return [i, () => r.removeSource(i)];
}
//#endregion
//#region node_modules/@react-dnd/shallowequal/dist/index.js
function JS(e, t, n, r) {
let i = n ? n.call(r, e, t) : void 0;
if (i !== void 0) return !!i;
if (e === t) return !0;
if (typeof e != "object" || !e || typeof t != "object" || !t) return !1;
let a = Object.keys(e), o = Object.keys(t);
if (a.length !== o.length) return !1;
let s = Object.prototype.hasOwnProperty.bind(t);
for (let o = 0; o < a.length; o++) {
let c = a[o];
if (!s(c)) return !1;
let l = e[c], u = t[c];
if (i = n ? n.call(r, l, u, c) : void 0, i === !1 || i === void 0 && l !== u) return !1;
}
return !0;
}
//#endregion
//#region node_modules/react-dnd/dist/internals/isRef.js
function YS(e) {
return typeof e == "object" && !!e && Object.prototype.hasOwnProperty.call(e, "current");
}
//#endregion
//#region node_modules/react-dnd/dist/internals/wrapConnectorHooks.js
function XS(e) {
if (typeof e.type == "string") return;
let t = e.type.displayName || e.type.name || "the component";
throw Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`);
}
function ZS(e) {
return (t = null, n = null) => {
if (!En(t)) {
let r = t;
return e(r, n), r;
}
let r = t;
return XS(r), eC(r, n ? (t) => e(t, n) : e);
};
}
function QS(e) {
let t = {};
return Object.keys(e).forEach((n) => {
let r = e[n];
if (n.endsWith("Ref")) t[n] = e[n];
else {
let e = ZS(r);
t[n] = () => e;
}
}), t;
}
function $S(e, t) {
typeof e == "function" ? e(t) : e.current = t;
}
function eC(e, t) {
let n = e.ref;
return Q(typeof n != "string", "Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"), n ? xn(e, { ref: (e) => {
$S(n, e), $S(t, e);
} }) : xn(e, { ref: t });
}
//#endregion
//#region node_modules/react-dnd/dist/internals/SourceConnector.js
var tC = class {
receiveHandlerId(e) {
this.handlerId !== e && (this.handlerId = e, this.reconnect());
}
get connectTarget() {
return this.dragSource;
}
get dragSourceOptions() {
return this.dragSourceOptionsInternal;
}
set dragSourceOptions(e) {
this.dragSourceOptionsInternal = e;
}
get dragPreviewOptions() {
return this.dragPreviewOptionsInternal;
}
set dragPreviewOptions(e) {
this.dragPreviewOptionsInternal = e;
}
reconnect() {
let e = this.reconnectDragSource();
this.reconnectDragPreview(e);
}
reconnectDragSource() {
let e = this.dragSource, t = this.didHandlerIdChange() || this.didConnectedDragSourceChange() || this.didDragSourceOptionsChange();
return t && this.disconnectDragSource(), this.handlerId ? e ? (t && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragSource = e, this.lastConnectedDragSourceOptions = this.dragSourceOptions, this.dragSourceUnsubscribe = this.backend.connectDragSource(this.handlerId, e, this.dragSourceOptions)), t) : (this.lastConnectedDragSource = e, t) : t;
}
reconnectDragPreview(e = !1) {
let t = this.dragPreview, n = e || this.didHandlerIdChange() || this.didConnectedDragPreviewChange() || this.didDragPreviewOptionsChange();
if (n && this.disconnectDragPreview(), this.handlerId) {
if (!t) {
this.lastConnectedDragPreview = t;
return;
}
n && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDragPreview = t, this.lastConnectedDragPreviewOptions = this.dragPreviewOptions, this.dragPreviewUnsubscribe = this.backend.connectDragPreview(this.handlerId, t, this.dragPreviewOptions));
}
}
didHandlerIdChange() {
return this.lastConnectedHandlerId !== this.handlerId;
}
didConnectedDragSourceChange() {
return this.lastConnectedDragSource !== this.dragSource;
}
didConnectedDragPreviewChange() {
return this.lastConnectedDragPreview !== this.dragPreview;
}
didDragSourceOptionsChange() {
return !JS(this.lastConnectedDragSourceOptions, this.dragSourceOptions);
}
didDragPreviewOptionsChange() {
return !JS(this.lastConnectedDragPreviewOptions, this.dragPreviewOptions);
}
disconnectDragSource() {
this.dragSourceUnsubscribe &&= (this.dragSourceUnsubscribe(), void 0);
}
disconnectDragPreview() {
this.dragPreviewUnsubscribe && (this.dragPreviewUnsubscribe(), this.dragPreviewUnsubscribe = void 0, this.dragPreviewNode = null, this.dragPreviewRef = null);
}
get dragSource() {
return this.dragSourceNode || this.dragSourceRef && this.dragSourceRef.current;
}
get dragPreview() {
return this.dragPreviewNode || this.dragPreviewRef && this.dragPreviewRef.current;
}
clearDragSource() {
this.dragSourceNode = null, this.dragSourceRef = null;
}
clearDragPreview() {
this.dragPreviewNode = null, this.dragPreviewRef = null;
}
constructor(e) {
this.hooks = QS({
dragSource: (e, t) => {
this.clearDragSource(), this.dragSourceOptions = t || null, YS(e) ? this.dragSourceRef = e : this.dragSourceNode = e, this.reconnectDragSource();
},
dragPreview: (e, t) => {
this.clearDragPreview(), this.dragPreviewOptions = t || null, YS(e) ? this.dragPreviewRef = e : this.dragPreviewNode = e, this.reconnectDragPreview();
}
}), this.handlerId = null, this.dragSourceRef = null, this.dragSourceOptionsInternal = null, this.dragPreviewRef = null, this.dragPreviewOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDragSource = null, this.lastConnectedDragSourceOptions = null, this.lastConnectedDragPreview = null, this.lastConnectedDragPreviewOptions = null, this.backend = e;
}
}, nC = class {
get connectTarget() {
return this.dropTarget;
}
reconnect() {
let e = this.didHandlerIdChange() || this.didDropTargetChange() || this.didOptionsChange();
e && this.disconnectDropTarget();
let t = this.dropTarget;
if (this.handlerId) {
if (!t) {
this.lastConnectedDropTarget = t;
return;
}
e && (this.lastConnectedHandlerId = this.handlerId, this.lastConnectedDropTarget = t, this.lastConnectedDropTargetOptions = this.dropTargetOptions, this.unsubscribeDropTarget = this.backend.connectDropTarget(this.handlerId, t, this.dropTargetOptions));
}
}
receiveHandlerId(e) {
e !== this.handlerId && (this.handlerId = e, this.reconnect());
}
get dropTargetOptions() {
return this.dropTargetOptionsInternal;
}
set dropTargetOptions(e) {
this.dropTargetOptionsInternal = e;
}
didHandlerIdChange() {
return this.lastConnectedHandlerId !== this.handlerId;
}
didDropTargetChange() {
return this.lastConnectedDropTarget !== this.dropTarget;
}
didOptionsChange() {
return !JS(this.lastConnectedDropTargetOptions, this.dropTargetOptions);
}
disconnectDropTarget() {
this.unsubscribeDropTarget &&= (this.unsubscribeDropTarget(), void 0);
}
get dropTarget() {
return this.dropTargetNode || this.dropTargetRef && this.dropTargetRef.current;
}
clearDropTarget() {
this.dropTargetRef = null, this.dropTargetNode = null;
}
constructor(e) {
this.hooks = QS({ dropTarget: (e, t) => {
this.clearDropTarget(), this.dropTargetOptions = t, YS(e) ? this.dropTargetRef = e : this.dropTargetNode = e, this.reconnect();
} }), this.handlerId = null, this.dropTargetRef = null, this.dropTargetOptionsInternal = null, this.lastConnectedHandlerId = null, this.lastConnectedDropTarget = null, this.lastConnectedDropTargetOptions = null, this.backend = e;
}
};
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDragDropManager.js
function rC() {
let { dragDropManager: e } = An(Nb);
return Q(e != null, "Expected drag drop context"), e;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragSourceConnector.js
function iC(e, t) {
let n = rC(), r = Pn(() => new tC(n.getBackend()), [n]);
return PS(() => (r.dragSourceOptions = e || null, r.reconnect(), () => r.disconnectDragSource()), [r, e]), PS(() => (r.dragPreviewOptions = t || null, r.reconnect(), () => r.disconnectDragPreview()), [r, t]), r;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragSourceMonitor.js
function aC() {
let e = rC();
return Pn(() => new US(e), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/DragSourceImpl.js
var oC = class {
beginDrag() {
let e = this.spec, t = this.monitor, n = null;
return n = typeof e.item == "object" ? e.item : typeof e.item == "function" ? e.item(t) : {}, n ?? null;
}
canDrag() {
let e = this.spec, t = this.monitor;
return typeof e.canDrag == "boolean" ? e.canDrag : typeof e.canDrag != "function" || e.canDrag(t);
}
isDragging(e, t) {
let n = this.spec, r = this.monitor, { isDragging: i } = n;
return i ? i(r) : t === e.getSourceId();
}
endDrag() {
let e = this.spec, t = this.monitor, n = this.connector, { end: r } = e;
r && r(t.getItem(), t), n.reconnect();
}
constructor(e, t, n) {
this.spec = e, this.monitor = t, this.connector = n;
}
};
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragSource.js
function sC(e, t, n) {
let r = Pn(() => new oC(e, t, n), [t, n]);
return F(() => {
r.spec = e;
}, [e]), r;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDragType.js
function cC(e) {
return Pn(() => {
let t = e.type;
return Q(t != null, "spec.type must be defined"), t;
}, [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useRegisteredDragSource.js
function lC(e, t, n) {
let r = rC(), i = sC(e, t, n), a = cC(e);
PS(function() {
if (a != null) {
let [e, o] = qS(a, i, r);
return t.receiveHandlerId(e), n.receiveHandlerId(e), o;
}
}, [
r,
t,
n,
i,
a
]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrag/useDrag.js
function uC(e, t) {
let n = RS(e, t);
Q(!n.begin, "useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");
let r = aC(), i = iC(n.options, n.previewOptions);
return lC(n, r, i), [
LS(n.collect, r, i),
zS(i),
BS(i)
];
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/connectors.js
function dC(e) {
return Pn(() => e.hooks.dropTarget(), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDropTargetConnector.js
function fC(e) {
let t = rC(), n = Pn(() => new nC(t.getBackend()), [t]);
return PS(() => (n.dropTargetOptions = e || null, n.reconnect(), () => n.disconnectDropTarget()), [e]), n;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDropTargetMonitor.js
function pC() {
let e = rC();
return Pn(() => new GS(e), [e]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useAccept.js
function mC(e) {
let { accept: t } = e;
return Pn(() => (Q(e.accept != null, "accept must be defined"), Array.isArray(t) ? t : [t]), [t]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/DropTargetImpl.js
var hC = class {
canDrop() {
let e = this.spec, t = this.monitor;
return !e.canDrop || e.canDrop(t.getItem(), t);
}
hover() {
let e = this.spec, t = this.monitor;
e.hover && e.hover(t.getItem(), t);
}
drop() {
let e = this.spec, t = this.monitor;
if (e.drop) return e.drop(t.getItem(), t);
}
constructor(e, t) {
this.spec = e, this.monitor = t;
}
};
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDropTarget.js
function gC(e, t) {
let n = Pn(() => new hC(e, t), [t]);
return F(() => {
n.spec = e;
}, [e]), n;
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useRegisteredDropTarget.js
function _C(e, t, n) {
let r = rC(), i = gC(e, t), a = mC(e);
PS(function() {
let [e, o] = KS(a, i, r);
return t.receiveHandlerId(e), n.receiveHandlerId(e), o;
}, [
r,
t,
i,
n,
a.map((e) => e.toString()).join("|")
]);
}
//#endregion
//#region node_modules/react-dnd/dist/hooks/useDrop/useDrop.js
function vC(e, t) {
let n = RS(e, t), r = pC(), i = fC(n.options);
return _C(n, r, i), [LS(n.collect, r, i), dC(i)];
}
//#endregion
//#region node_modules/dnd-multi-backend/dist/index.js
var yC = (e) => {
throw TypeError(e);
}, bC = (e, t, n) => t.has(e) || yC("Cannot " + n), $ = (e, t, n) => (bC(e, t, "read from private field"), n ? n.call(e) : t.get(e)), xC = (e, t, n) => t.has(e) ? yC("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), SC = (e, t, n, r) => (bC(e, t, "write to private field"), r ? r.call(e, n) : t.set(e, n), n), CC, wC = class {
constructor() {
xC(this, CC), this.register = (e) => {
$(this, CC).push(e);
}, this.unregister = (e) => {
for (; $(this, CC).indexOf(e) !== -1;) $(this, CC).splice($(this, CC).indexOf(e), 1);
}, this.backendChanged = (e) => {
for (let t of $(this, CC)) t.backendChanged(e);
}, SC(this, CC, []);
}
};
CC = /* @__PURE__ */ new WeakMap();
var TC, EC, DC, OC, kC, AC, jC, MC, NC, PC, FC, IC = class e {
constructor(t, n, r) {
if (xC(this, TC), xC(this, EC), xC(this, DC), xC(this, OC), xC(this, kC), xC(this, AC, (e, t, n) => {
if (!n.backend) throw Error(`You must specify a 'backend' property in your Backend entry: ${JSON.stringify(n)}`);
let r = n.backend(e, t, n.options), i = n.id, a = !n.id && r && r.constructor;
if (a && (i = r.constructor.name), !i) throw Error(`You must specify an 'id' property in your Backend entry: ${JSON.stringify(n)}
see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-5xx`);
if (a && console.warn("Deprecation notice: You are using a pipeline which doesn't include backends' 'id'.\n This might be unsupported in the future, please specify 'id' explicitely for every backend."), $(this, DC)[i]) throw Error(`You must specify a unique 'id' property in your Backend entry:
${JSON.stringify(n)} (conflicts with: ${JSON.stringify($(this, DC)[i])})`);
return {
id: i,
instance: r,
preview: n.preview ?? !1,
transition: n.transition,
skipDispatchOnTransition: n.skipDispatchOnTransition ?? !1
};
}), this.setup = () => {
if (!(typeof window > "u")) {
if (e.isSetUp) throw Error("Cannot have two MultiBackends at the same time.");
e.isSetUp = !0, $(this, jC).call(this, window), $(this, DC)[$(this, TC)].instance.setup();
}
}, this.teardown = () => {
typeof window > "u" || (e.isSetUp = !1, $(this, MC).call(this, window), $(this, DC)[$(this, TC)].instance.teardown());
}, this.connectDragSource = (e, t, n) => $(this, FC).call(this, "connectDragSource", e, t, n), this.connectDragPreview = (e, t, n) => $(this, FC).call(this, "connectDragPreview", e, t, n), this.connectDropTarget = (e, t, n) => $(this, FC).call(this, "connectDropTarget", e, t, n), this.profile = () => $(this, DC)[$(this, TC)].instance.profile(), this.previewEnabled = () => $(this, DC)[$(this, TC)].preview, this.previewsList = () => $(this, EC), this.backendsList = () => $(this, OC), xC(this, jC, (e) => {
for (let t of $(this, OC)) t.transition && e.addEventListener(t.transition.event, $(this, NC));
}), xC(this, MC, (e) => {
for (let t of $(this, OC)) t.transition && e.removeEventListener(t.transition.event, $(this, NC));
}), xC(this, NC, (e) => {
let t = $(this, TC);
if ($(this, OC).some((t) => t.id !== $(this, TC) && t.transition && t.transition.check(e) ? (SC(this, TC, t.id), !0) : !1), $(this, TC) !== t) {
$(this, DC)[t].instance.teardown();
for (let [e, t] of Object.entries($(this, kC))) t.unsubscribe(), t.unsubscribe = $(this, PC).call(this, t.func, ...t.args);
$(this, EC).backendChanged(this);
let n = $(this, DC)[$(this, TC)];
if (n.instance.setup(), n.skipDispatchOnTransition) return;
let r = e.constructor, i = new r(e.type, e);
e.target?.dispatchEvent(i);
}
}), xC(this, PC, (e, t, n, r) => $(this, DC)[$(this, TC)].instance[e](t, n, r)), xC(this, FC, (e, t, n, r) => {
let i = `${e}_${t}`, a = $(this, PC).call(this, e, t, n, r);
return $(this, kC)[i] = {
func: e,
args: [
t,
n,
r
],
unsubscribe: a
}, () => {
$(this, kC)[i].unsubscribe(), delete $(this, kC)[i];
};
}), !r || !r.backends || r.backends.length < 1) throw Error("You must specify at least one Backend, if you are coming from 2.x.x (or don't understand this error)\n see this guide: https://github.com/louisbrunner/dnd-multi-backend/tree/master/packages/react-dnd-multi-backend#migrating-from-2xx");
SC(this, EC, new wC()), SC(this, DC, {}), SC(this, OC, []);
for (let e of r.backends) {
let r = $(this, AC).call(this, t, n, e);
$(this, DC)[r.id] = r, $(this, OC).push(r);
}
SC(this, TC, $(this, OC)[0].id), SC(this, kC, {});
}
};
TC = /* @__PURE__ */ new WeakMap(), EC = /* @__PURE__ */ new WeakMap(), DC = /* @__PURE__ */ new WeakMap(), OC = /* @__PURE__ */ new WeakMap(), kC = /* @__PURE__ */ new WeakMap(), AC = /* @__PURE__ */ new WeakMap(), jC = /* @__PURE__ */ new WeakMap(), MC = /* @__PURE__ */ new WeakMap(), NC = /* @__PURE__ */ new WeakMap(), PC = /* @__PURE__ */ new WeakMap(), FC = /* @__PURE__ */ new WeakMap(), IC.isSetUp = !1;
var LC = IC, RC = (e, t, n) => new LC(e, t, n), zC = (e, t) => ({
event: e,
check: t
}), BC = zC("touchstart", (e) => {
let t = e;
return t.touches !== null && t.touches !== void 0;
}), VC = zC("pointerdown", (e) => e.pointerType === "mouse");
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/utils/js_utils.js
function HC(e) {
let t = null;
return () => (t ??= e(), t);
}
function UC(e, t) {
return e.filter((e) => e !== t);
}
function WC(e, t) {
let n = /* @__PURE__ */ new Set(), r = (e) => n.add(e);
e.forEach(r), t.forEach(r);
let i = [];
return n.forEach((e) => i.push(e)), i;
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/EnterLeaveCounter.js
var GC = class {
enter(e) {
let t = this.entered.length, n = (t) => this.isNodeInDocument(t) && (!t.contains || t.contains(e));
return this.entered = WC(this.entered.filter(n), [e]), t === 0 && this.entered.length > 0;
}
leave(e) {
let t = this.entered.length;
return this.entered = UC(this.entered.filter(this.isNodeInDocument), e), t > 0 && this.entered.length === 0;
}
reset() {
this.entered = [];
}
constructor(e) {
this.entered = [], this.isNodeInDocument = e;
}
}, KC = class {
initializeExposedProperties() {
Object.keys(this.config.exposeProperties).forEach((e) => {
Object.defineProperty(this.item, e, {
configurable: !0,
enumerable: !0,
get() {
return console.warn(`Browser doesn't allow reading "${e}" until the drop event.`), null;
}
});
});
}
loadDataTransfer(e) {
if (e) {
let t = {};
Object.keys(this.config.exposeProperties).forEach((n) => {
let r = this.config.exposeProperties[n];
r != null && (t[n] = {
value: r(e, this.config.matchesTypes),
configurable: !0,
enumerable: !0
});
}), Object.defineProperties(this.item, t);
}
}
canDrag() {
return !0;
}
beginDrag() {
return this.item;
}
isDragging(e, t) {
return t === e.getSourceId();
}
endDrag() {}
constructor(e) {
this.config = e, this.item = {}, this.initializeExposedProperties();
}
}, qC = /* @__PURE__ */ d({
FILE: () => JC,
HTML: () => ZC,
TEXT: () => XC,
URL: () => YC
}), JC = "__NATIVE_FILE__", YC = "__NATIVE_URL__", XC = "__NATIVE_TEXT__", ZC = "__NATIVE_HTML__";
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/NativeDragSources/getDataFromDataTransfer.js
function QC(e, t, n) {
return t.reduce((t, n) => t || e.getData(n), "") ?? n;
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/NativeDragSources/nativeTypesConfig.js
var $C = {
[JC]: {
exposeProperties: {
files: (e) => Array.prototype.slice.call(e.files),
items: (e) => e.items,
dataTransfer: (e) => e
},
matchesTypes: ["Files"]
},
[ZC]: {
exposeProperties: {
html: (e, t) => QC(e, t, ""),
dataTransfer: (e) => e
},
matchesTypes: ["Html", "text/html"]
},
[YC]: {
exposeProperties: {
urls: (e, t) => QC(e, t, "").split("\n"),
dataTransfer: (e) => e
},
matchesTypes: ["Url", "text/uri-list"]
},
[XC]: {
exposeProperties: {
text: (e, t) => QC(e, t, ""),
dataTransfer: (e) => e
},
matchesTypes: ["Text", "text/plain"]
}
};
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/NativeDragSources/index.js
function ew(e, t) {
let n = $C[e];
if (!n) throw Error(`native type ${e} has no configuration`);
let r = new KC(n);
return r.loadDataTransfer(t), r;
}
function tw(e) {
if (!e) return null;
let t = Array.prototype.slice.call(e.types || []);
return Object.keys($C).filter((e) => {
let n = $C[e];
return n?.matchesTypes ? n.matchesTypes.some((e) => t.indexOf(e) > -1) : !1;
})[0] || null;
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/BrowserDetector.js
var nw = HC(() => /firefox/i.test(navigator.userAgent)), rw = HC(() => !!window.safari), iw = class {
interpolate(e) {
let { xs: t, ys: n, c1s: r, c2s: i, c3s: a } = this, o = t.length - 1;
if (e === t[o]) return n[o];
let s = 0, c = a.length - 1, l;
for (; s <= c;) {
l = Math.floor(.5 * (s + c));
let r = t[l];
if (r < e) s = l + 1;
else if (r > e) c = l - 1;
else return n[l];
}
o = Math.max(0, c);
let u = e - t[o], d = u * u;
return n[o] + r[o] * u + i[o] * d + a[o] * u * d;
}
constructor(e, t) {
let { length: n } = e, r = [];
for (let e = 0; e < n; e++) r.push(e);
r.sort((t, n) => e[t] < e[n] ? -1 : 1);
let i = [], a = [], o = [], s, c;
for (let r = 0; r < n - 1; r++) s = e[r + 1] - e[r], c = t[r + 1] - t[r], a.push(s), i.push(c), o.push(c / s);
let l = [o[0]];
for (let e = 0; e < a.length - 1; e++) {
let t = o[e], n = o[e + 1];
if (t * n <= 0) l.push(0);
else {
s = a[e];
let r = a[e + 1], i = s + r;
l.push(3 * i / ((i + r) / t + (i + s) / n));
}
}
l.push(o[o.length - 1]);
let u = [], d = [], f;
for (let e = 0; e < l.length - 1; e++) {
f = o[e];
let t = l[e], n = 1 / a[e], r = t + l[e + 1] - f - f;
u.push((f - t - r) * n), d.push(r * n * n);
}
this.xs = e, this.ys = t, this.c1s = l, this.c2s = u, this.c3s = d;
}
}, aw = 1;
function ow(e) {
let t = e.nodeType === aw ? e : e.parentElement;
if (!t) return null;
let { top: n, left: r } = t.getBoundingClientRect();
return {
x: r,
y: n
};
}
function sw(e) {
return {
x: e.clientX,
y: e.clientY
};
}
function cw(e) {
return e.nodeName === "IMG" && (nw() || !document.documentElement?.contains(e));
}
function lw(e, t, n, r) {
let i = e ? t.width : n, a = e ? t.height : r;
return rw() && e && (a /= window.devicePixelRatio, i /= window.devicePixelRatio), {
dragPreviewWidth: i,
dragPreviewHeight: a
};
}
function uw(e, t, n, r, i) {
let a = cw(t), o = ow(a ? e : t), s = {
x: n.x - o.x,
y: n.y - o.y
}, { offsetWidth: c, offsetHeight: l } = e, { anchorX: u, anchorY: d } = r, { dragPreviewWidth: f, dragPreviewHeight: p } = lw(a, t, c, l), m = () => {
let e = new iw([
0,
.5,
1
], [
s.y,
s.y / l * p,
s.y + p - l
]).interpolate(d);
return rw() && a && (e += (window.devicePixelRatio - 1) * p), e;
}, h = () => new iw([
0,
.5,
1
], [
s.x,
s.x / c * f,
s.x + f - c
]).interpolate(u), { offsetX: g, offsetY: _ } = i, v = g === 0 || g, y = _ === 0 || _;
return {
x: v ? g : h(),
y: y ? _ : m()
};
}
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/OptionsReader.js
var dw = class {
get window() {
if (this.globalContext) return this.globalContext;
if (typeof window < "u") return window;
}
get document() {
if (this.globalContext?.document) return this.globalContext.document;
if (this.window) return this.window.document;
}
get rootElement() {
return this.optionsArgs?.rootElement || this.window;
}
constructor(e, t) {
this.ownerDocument = null, this.globalContext = e, this.optionsArgs = t;
}
};
//#endregion
//#region node_modules/react-dnd-html5-backend/dist/HTML5BackendImpl.js
function fw(e, t, n) {
return t in e ? Object.defineProperty(e, t, {
value: n,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = n, e;
}
function pw(e) {
for (var t = 1; t < arguments.length; t++) {
var n = arguments[t] == null ? {} : arguments[t], r = Object.keys(n);
typeof Object.getOwnPropertySymbols == "function" && (r = r.concat(Object.getOwnPropertySymbols(n).filter(function(e) {
return Object.getOwnPropertyDescriptor(n, e).enumerable;
}))), r.forEach(function(t) {
fw(e, t, n[t]);
});
}
return e;
}
var mw = class {
profile() {
return {
sourcePreviewNodes: this.sourcePreviewNodes.size,
sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,
sourceNodeOptions: this.sourceNodeOptions.size,
sourceNodes: this.sourceNodes.size,
dragStartSourceIds: this.dragStartSourceIds?.length || 0,
dropTargetIds: this.dropTargetIds.length,
dragEnterTargetIds: this.dragEnterTargetIds.length,
dragOverTargetIds: this.dragOverTargetIds?.length || 0
};
}
get window() {
return this.options.window;
}
get document() {
return this.options.document;
}
get rootElement() {
return this.options.rootElement;
}
setup() {
let e = this.rootElement;
if (e !== void 0) {
if (e.__isReactDndBackendSetUp) throw Error("Cannot have two HTML5 backends at the same time.");
e.__isReactDndBackendSetUp = !0, this.addEventListeners(e);
}
}
teardown() {
let e = this.rootElement;
if (e !== void 0 && (e.__isReactDndBackendSetUp = !1, this.removeEventListeners(this.rootElement), this.clearCurrentDragSourceNode(), this.asyncEndDragFrameId)) {
var t;
(t = this.window) == null || t.cancelAnimationFrame(this.asyncEndDragFrameId);
}
}
connectDragPreview(e, t, n) {
return this.sourcePreviewNodeOptions.set(e, n), this.sourcePreviewNodes.set(e, t), () => {
this.sourcePreviewNodes.delete(e), this.sourcePreviewNodeOptions.delete(e);
};
}
connectDragSource(e, t, n) {
this.sourceNodes.set(e, t), this.sourceNodeOptions.set(e, n);
let r = (t) => this.handleDragStart(t, e), i = (e) => this.handleSelectStart(e);
return t.setAttribute("draggable", "true"), t.addEventListener("dragstart", r), t.addEventListener("selectstart", i), () => {
this.sourceNodes.delete(e), this.sourceNodeOptions.delete(e), t.removeEventListener("dragstart", r), t.removeEventListener("selectstart", i), t.setAttribute("draggable", "false");
};
}
connectDropTarget(e, t) {
let n = (t) => this.handleDragEnter(t, e), r = (t) => this.handleDragOver(t, e), i = (t) => this.handleDrop(t, e);
return t.addEventListener("dragenter", n), t.addEventListener("dragover", r), t.addEventListener("drop", i), () => {
t.removeEventListener("dragenter", n), t.removeEventListener("dragover", r), t.removeEventListener("drop", i);
};
}
addEventListeners(e) {
e.addEventListener && (e.addEventListener("dragstart", this.handleTopDragStart), e.addEventListener("dragstart", this.handleTopDragStartCapture, !0), e.addEventListener("dragend", this.handleTopDragEndCapture, !0), e.addEventListener("dragenter", this.handleTopDragEnter), e.addEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.addEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.addEventListener("dragover", this.handleTopDragOver), e.addEventListener("dragover", this.handleTopDragOverCapture, !0), e.addEventListener("drop", this.handleTopDrop), e.addEventListener("drop", this.handleTopDropCapture, !0));
}
removeEventListeners(e) {
e.removeEventListener && (e.removeEventListener("dragstart", this.handleTopDragStart), e.removeEventListener("dragstart", this.handleTopDragStartCapture, !0), e.removeEventListener("dragend", this.handleTopDragEndCapture, !0), e.removeEventListener("dragenter", this.handleTopDragEnter), e.removeEventListener("dragenter", this.handleTopDragEnterCapture, !0), e.removeEventListener("dragleave", this.handleTopDragLeaveCapture, !0), e.removeEventListener("dragover", this.handleTopDragOver), e.removeEventListener("dragover", this.handleTopDragOverCapture, !0), e.removeEventListener("drop", this.handleTopDrop), e.removeEventListener("drop", this.handleTopDropCapture, !0));
}
getCurrentSourceNodeOptions() {
let e = this.monitor.getSourceId(), t = this.sourceNodeOptions.get(e);
return pw({ dropEffect: this.altKeyPressed ? "copy" : "move" }, t || {});
}
getCurrentDropEffect() {
return this.isDraggingNativeItem() ? "copy" : this.getCurrentSourceNodeOptions().dropEffect;
}
getCurrentSourcePreviewNodeOptions() {
let e = this.monitor.getSourceId();
return pw({
anchorX: .5,
anchorY: .5,
captureDraggingState: !1
}, this.sourcePreviewNodeOptions.get(e) || {});
}
isDraggingNativeItem() {
let e = this.monitor.getItemType();
return Object.keys(qC).some((t) => qC[t] === e);
}
beginDragNativeItem(e, t) {
this.clearCurrentDragSourceNode(), this.currentNativeSource = ew(e, t), this.currentNativeHandle = this.registry.addSource(e, this.currentNativeSource), this.actions.beginDrag([this.currentNativeHandle]);
}
setCurrentDragSourceNode(e) {
this.clearCurrentDragSourceNode(), this.currentDragSourceNode = e, this.mouseMoveTimeoutTimer = setTimeout(() => this.rootElement?.addEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0), 1e3);
}
clearCurrentDragSourceNode() {
if (this.currentDragSourceNode) {
if (this.currentDragSourceNode = null, this.rootElement) {
var e;
(e = this.window) == null || e.clearTimeout(this.mouseMoveTimeoutTimer || void 0), this.rootElement.removeEventListener("mousemove", this.endDragIfSourceWasRemovedFromDOM, !0);
}
return this.mouseMoveTimeoutTimer = null, !0;
}
return !1;
}
handleDragStart(e, t) {
e.defaultPrevented || (this.dragStartSourceIds ||= [], this.dragStartSourceIds.unshift(t));
}
handleDragEnter(e, t) {
this.dragEnterTargetIds.unshift(t);
}
handleDragOver(e, t) {
this.dragOverTargetIds === null && (this.dragOverTargetIds = []), this.dragOverTargetIds.unshift(t);
}
handleDrop(e, t) {
this.dropTargetIds.unshift(t);
}
constructor(e, t, n) {
this.sourcePreviewNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodeOptions = /* @__PURE__ */ new Map(), this.sourceNodes = /* @__PURE__ */ new Map(), this.sourceNodeOptions = /* @__PURE__ */ new Map(), this.dragStartSourceIds = null, this.dropTargetIds = [], this.dragEnterTargetIds = [], this.currentNativeSource = null, this.currentNativeHandle = null, this.currentDragSourceNode = null, this.altKeyPressed = !1, this.mouseMoveTimeoutTimer = null, this.asyncEndDragFrameId = null, this.dragOverTargetIds = null, this.lastClientOffset = null, this.hoverRafId = null, this.getSourceClientOffset = (e) => {
let t = this.sourceNodes.get(e);
return t && ow(t) || null;
}, this.endDragNativeItem = () => {
this.isDraggingNativeItem() && (this.actions.endDrag(), this.currentNativeHandle && this.registry.removeSource(this.currentNativeHandle), this.currentNativeHandle = null, this.currentNativeSource = null);
}, this.isNodeInDocument = (e) => !!(e && this.document && this.document.body && this.document.body.contains(e)), this.endDragIfSourceWasRemovedFromDOM = () => {
let e = this.currentDragSourceNode;
e == null || this.isNodeInDocument(e) || (this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover());
}, this.scheduleHover = (e) => {
this.hoverRafId === null && typeof requestAnimationFrame < "u" && (this.hoverRafId = requestAnimationFrame(() => {
this.monitor.isDragging() && this.actions.hover(e || [], { clientOffset: this.lastClientOffset }), this.hoverRafId = null;
}));
}, this.cancelHover = () => {
this.hoverRafId !== null && typeof cancelAnimationFrame < "u" && (cancelAnimationFrame(this.hoverRafId), this.hoverRafId = null);
}, this.handleTopDragStartCapture = () => {
this.clearCurrentDragSourceNode(), this.dragStartSourceIds = [];
}, this.handleTopDragStart = (e) => {
if (e.defaultPrevented) return;
let { dragStartSourceIds: t } = this;
this.dragStartSourceIds = null;
let n = sw(e);
this.monitor.isDragging() && (this.actions.endDrag(), this.cancelHover()), this.actions.beginDrag(t || [], {
publishSource: !1,
getSourceClientOffset: this.getSourceClientOffset,
clientOffset: n
});
let { dataTransfer: r } = e, i = tw(r);
if (this.monitor.isDragging()) {
if (r && typeof r.setDragImage == "function") {
let e = this.monitor.getSourceId(), t = this.sourceNodes.get(e), i = this.sourcePreviewNodes.get(e) || t;
if (i) {
let { anchorX: e, anchorY: a, offsetX: o, offsetY: s } = this.getCurrentSourcePreviewNodeOptions(), c = uw(t, i, n, {
anchorX: e,
anchorY: a
}, {
offsetX: o,
offsetY: s
});
r.setDragImage(i, c.x, c.y);
}
}
try {
r?.setData("application/json", {});
} catch {}
this.setCurrentDragSourceNode(e.target);
let { captureDraggingState: t } = this.getCurrentSourcePreviewNodeOptions();
t ? this.actions.publishDragSource() : setTimeout(() => this.actions.publishDragSource(), 0);
} else if (i) this.beginDragNativeItem(i);
else if (r && !r.types && (e.target && !e.target.hasAttribute || !e.target.hasAttribute("draggable"))) return;
else e.preventDefault();
}, this.handleTopDragEndCapture = () => {
this.clearCurrentDragSourceNode() && this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
}, this.handleTopDragEnterCapture = (e) => {
if (this.dragEnterTargetIds = [], this.isDraggingNativeItem()) {
var t;
(t = this.currentNativeSource) == null || t.loadDataTransfer(e.dataTransfer);
}
if (!this.enterLeaveCounter.enter(e.target) || this.monitor.isDragging()) return;
let { dataTransfer: n } = e, r = tw(n);
r && this.beginDragNativeItem(r, n);
}, this.handleTopDragEnter = (e) => {
let { dragEnterTargetIds: t } = this;
this.dragEnterTargetIds = [], this.monitor.isDragging() && (this.altKeyPressed = e.altKey, t.length > 0 && this.actions.hover(t, { clientOffset: sw(e) }), t.some((e) => this.monitor.canDropOnTarget(e)) && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = this.getCurrentDropEffect())));
}, this.handleTopDragOverCapture = (e) => {
if (this.dragOverTargetIds = [], this.isDraggingNativeItem()) {
var t;
(t = this.currentNativeSource) == null || t.loadDataTransfer(e.dataTransfer);
}
}, this.handleTopDragOver = (e) => {
let { dragOverTargetIds: t } = this;
if (this.dragOverTargetIds = [], !this.monitor.isDragging()) {
e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "none");
return;
}
this.altKeyPressed = e.altKey, this.lastClientOffset = sw(e), this.scheduleHover(t), (t || []).some((e) => this.monitor.canDropOnTarget(e)) ? (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = this.getCurrentDropEffect())) : this.isDraggingNativeItem() ? e.preventDefault() : (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "none"));
}, this.handleTopDragLeaveCapture = (e) => {
this.isDraggingNativeItem() && e.preventDefault(), this.enterLeaveCounter.leave(e.target) && (this.isDraggingNativeItem() && setTimeout(() => this.endDragNativeItem(), 0), this.cancelHover());
}, this.handleTopDropCapture = (e) => {
if (this.dropTargetIds = [], this.isDraggingNativeItem()) {
var t;
e.preventDefault(), (t = this.currentNativeSource) == null || t.loadDataTransfer(e.dataTransfer);
} else tw(e.dataTransfer) && e.preventDefault();
this.enterLeaveCounter.reset();
}, this.handleTopDrop = (e) => {
let { dropTargetIds: t } = this;
this.dropTargetIds = [], this.actions.hover(t, { clientOffset: sw(e) }), this.actions.drop({ dropEffect: this.getCurrentDropEffect() }), this.isDraggingNativeItem() ? this.endDragNativeItem() : this.monitor.isDragging() && this.actions.endDrag(), this.cancelHover();
}, this.handleSelectStart = (e) => {
let t = e.target;
typeof t.dragDrop == "function" && (t.tagName === "INPUT" || t.tagName === "SELECT" || t.tagName === "TEXTAREA" || t.isContentEditable || (e.preventDefault(), t.dragDrop()));
}, this.options = new dw(t, n), this.actions = e.getActions(), this.monitor = e.getMonitor(), this.registry = e.getRegistry(), this.enterLeaveCounter = new GC(this.isNodeInDocument);
}
}, hw = function(e, t, n) {
return new mw(e, t, n);
}, gw;
(function(e) {
e.mouse = "mouse", e.touch = "touch", e.keyboard = "keyboard";
})(gw ||= {});
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/OptionsReader.js
var _w = class {
get delay() {
return this.args.delay ?? 0;
}
get scrollAngleRanges() {
return this.args.scrollAngleRanges;
}
get getDropTargetElementsAtPoint() {
return this.args.getDropTargetElementsAtPoint;
}
get ignoreContextMenu() {
return this.args.ignoreContextMenu ?? !1;
}
get enableHoverOutsideTarget() {
return this.args.enableHoverOutsideTarget ?? !1;
}
get enableKeyboardEvents() {
return this.args.enableKeyboardEvents ?? !1;
}
get enableMouseEvents() {
return this.args.enableMouseEvents ?? !1;
}
get enableTouchEvents() {
return this.args.enableTouchEvents ?? !0;
}
get touchSlop() {
return this.args.touchSlop || 0;
}
get delayTouchStart() {
return this.args?.delayTouchStart ?? this.args?.delay ?? 0;
}
get delayMouseStart() {
return this.args?.delayMouseStart ?? this.args?.delay ?? 0;
}
get window() {
if (this.context && this.context.window) return this.context.window;
if (typeof window < "u") return window;
}
get document() {
if (this.context?.document) return this.context.document;
if (this.window) return this.window.document;
}
get rootElement() {
return this.args?.rootElement || this.document;
}
constructor(e, t) {
this.args = e, this.context = t;
}
};
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/math.js
function vw(e, t, n, r) {
return Math.sqrt(Math.abs(n - e) ** 2 + Math.abs(r - t) ** 2);
}
function yw(e, t, n, r, i) {
if (!i) return !1;
let a = Math.atan2(r - t, n - e) * 180 / Math.PI + 180;
for (let e = 0; e < i.length; ++e) {
let t = i[e];
if (t && (t.start == null || a >= t.start) && (t.end == null || a <= t.end)) return !0;
}
return !1;
}
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/predicates.js
var bw = {
Left: 1,
Right: 2,
Center: 4
}, xw = {
Left: 0,
Center: 1,
Right: 2
};
function Sw(e) {
return e.button === void 0 || e.button === xw.Left;
}
function Cw(e) {
return e.buttons === void 0 || (e.buttons & bw.Left) === 0;
}
function ww(e) {
return !!e.targetTouches;
}
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/offsets.js
var Tw = 1;
function Ew(e) {
let t = e.nodeType === Tw ? e : e.parentElement;
if (!t) return;
let { top: n, left: r } = t.getBoundingClientRect();
return {
x: r,
y: n
};
}
function Dw(e, t) {
if (e.targetTouches.length === 1) return Ow(e.targetTouches[0]);
if (t && e.touches.length === 1 && e.touches[0].target === t.target) return Ow(e.touches[0]);
}
function Ow(e, t) {
return ww(e) ? Dw(e, t) : {
x: e.clientX,
y: e.clientY
};
}
//#endregion
//#region node_modules/react-dnd-touch-backend/dist/utils/supportsPassive.js
var kw = (() => {
let e = !1;
try {
addEventListener("test", () => {}, Object.defineProperty({}, "passive", { get() {
return e = !0, !0;
} }));
} catch {}
return e;
})(), Aw = {
[gw.mouse]: {
start: "mousedown",
move: "mousemove",
end: "mouseup",
contextmenu: "contextmenu"
},
[gw.touch]: {
start: "touchstart",
move: "touchmove",
end: "touchend"
},
[gw.keyboard]: { keydown: "keydown" }
}, jw = class e {
profile() {
return {
sourceNodes: this.sourceNodes.size,
sourcePreviewNodes: this.sourcePreviewNodes.size,
sourcePreviewNodeOptions: this.sourcePreviewNodeOptions.size,
targetNodes: this.targetNodes.size,
dragOverTargetIds: this.dragOverTargetIds?.length || 0
};
}
get document() {
return this.options.document;
}
setup() {
let t = this.options.rootElement;
t && (Q(!e.isSetUp, "Cannot have two Touch backends at the same time."), e.isSetUp = !0, this.addEventListener(t, "start", this.getTopMoveStartHandler()), this.addEventListener(t, "start", this.handleTopMoveStartCapture, !0), this.addEventListener(t, "move", this.handleTopMove), this.addEventListener(t, "move", this.handleTopMoveCapture, !0), this.addEventListener(t, "end", this.handleTopMoveEndCapture, !0), this.options.enableMouseEvents && !this.options.ignoreContextMenu && this.addEventListener(t, "contextmenu", this.handleTopMoveEndCapture), this.options.enableKeyboardEvents && this.addEventListener(t, "keydown", this.handleCancelOnEscape, !0));
}
teardown() {
let t = this.options.rootElement;
t && (e.isSetUp = !1, this._mouseClientOffset = {}, this.removeEventListener(t, "start", this.handleTopMoveStartCapture, !0), this.removeEventListener(t, "start", this.handleTopMoveStart), this.removeEventListener(t, "move", this.handleTopMoveCapture, !0), this.removeEventListener(t, "move", this.handleTopMove), this.removeEventListener(t, "end", this.handleTopMoveEndCapture, !0), this.options.enableMouseEvents && !this.options.ignoreContextMenu && this.removeEventListener(t, "contextmenu", this.handleTopMoveEndCapture), this.options.enableKeyboardEvents && this.removeEventListener(t, "keydown", this.handleCancelOnEscape, !0), this.uninstallSourceNodeRemovalObserver());
}
addEventListener(e, t, n, r = !1) {
let i = kw ? {
capture: r,
passive: !1
} : r;
this.listenerTypes.forEach(function(r) {
let a = Aw[r][t];
a && e.addEventListener(a, n, i);
});
}
removeEventListener(e, t, n, r = !1) {
let i = kw ? {
capture: r,
passive: !1
} : r;
this.listenerTypes.forEach(function(r) {
let a = Aw[r][t];
a && e.removeEventListener(a, n, i);
});
}
connectDragSource(e, t) {
let n = this.handleMoveStart.bind(this, e);
return this.sourceNodes.set(e, t), this.addEventListener(t, "start", n), () => {
this.sourceNodes.delete(e), this.removeEventListener(t, "start", n);
};
}
connectDragPreview(e, t, n) {
return this.sourcePreviewNodeOptions.set(e, n), this.sourcePreviewNodes.set(e, t), () => {
this.sourcePreviewNodes.delete(e), this.sourcePreviewNodeOptions.delete(e);
};
}
connectDropTarget(e, t) {
let n = this.options.rootElement;
if (!this.document || !n) return () => {};
let r = (r) => {
if (!this.document || !n || !this.monitor.isDragging()) return;
let i;
switch (r.type) {
case Aw.mouse.move:
i = {
x: r.clientX,
y: r.clientY
};
break;
case Aw.touch.move: i = {
x: r.touches[0]?.clientX || 0,
y: r.touches[0]?.clientY || 0
};
}
let a = i == null ? void 0 : this.document.elementFromPoint(i.x, i.y), o = a && t.contains(a);
if (a === t || o) return this.handleMove(r, e);
};
return this.addEventListener(this.document.body, "move", r), this.targetNodes.set(e, t), () => {
this.document && (this.targetNodes.delete(e), this.removeEventListener(this.document.body, "move", r));
};
}
getTopMoveStartHandler() {
return !this.options.delayTouchStart && !this.options.delayMouseStart ? this.handleTopMoveStart : this.handleTopMoveStartDelay;
}
installSourceNodeRemovalObserver(e) {
this.uninstallSourceNodeRemovalObserver(), this.draggedSourceNode = e, this.draggedSourceNodeRemovalObserver = new MutationObserver(() => {
e && !e.parentElement && (this.resurrectSourceNode(), this.uninstallSourceNodeRemovalObserver());
}), !(!e || !e.parentElement) && this.draggedSourceNodeRemovalObserver.observe(e.parentElement, { childList: !0 });
}
resurrectSourceNode() {
this.document && this.draggedSourceNode && (this.draggedSourceNode.style.display = "none", this.draggedSourceNode.removeAttribute("data-reactid"), this.document.body.appendChild(this.draggedSourceNode));
}
uninstallSourceNodeRemovalObserver() {
this.draggedSourceNodeRemovalObserver && this.draggedSourceNodeRemovalObserver.disconnect(), this.draggedSourceNodeRemovalObserver = void 0, this.draggedSourceNode = void 0;
}
constructor(e, t, n) {
this.getSourceClientOffset = (e) => {
let t = this.sourceNodes.get(e);
return t && Ew(t);
}, this.handleTopMoveStartCapture = (e) => {
Sw(e) && (this.moveStartSourceIds = []);
}, this.handleMoveStart = (e) => {
Array.isArray(this.moveStartSourceIds) && this.moveStartSourceIds.unshift(e);
}, this.handleTopMoveStart = (e) => {
if (!Sw(e)) return;
let t = Ow(e);
t && (ww(e) && (this.lastTargetTouchFallback = e.targetTouches[0]), this._mouseClientOffset = t), this.waitingForDelay = !1;
}, this.handleTopMoveStartDelay = (e) => {
if (!Sw(e)) return;
let t = e.type === Aw.touch.start ? this.options.delayTouchStart : this.options.delayMouseStart;
this.timeout = setTimeout(this.handleTopMoveStart.bind(this, e), t), this.waitingForDelay = !0;
}, this.handleTopMoveCapture = () => {
this.dragOverTargetIds = [];
}, this.handleMove = (e, t) => {
this.dragOverTargetIds && this.dragOverTargetIds.unshift(t);
}, this.handleTopMove = (e) => {
if (this.timeout && clearTimeout(this.timeout), !this.document || this.waitingForDelay) return;
let { moveStartSourceIds: t, dragOverTargetIds: n } = this, r = this.options.enableHoverOutsideTarget, i = Ow(e, this.lastTargetTouchFallback);
if (!i) return;
if (this._isScrolling || !this.monitor.isDragging() && yw(this._mouseClientOffset.x || 0, this._mouseClientOffset.y || 0, i.x, i.y, this.options.scrollAngleRanges)) {
this._isScrolling = !0;
return;
}
if (!this.monitor.isDragging() && this._mouseClientOffset.hasOwnProperty("x") && t && vw(this._mouseClientOffset.x || 0, this._mouseClientOffset.y || 0, i.x, i.y) > (this.options.touchSlop ? this.options.touchSlop : 0) && (this.moveStartSourceIds = void 0, this.actions.beginDrag(t, {
clientOffset: this._mouseClientOffset,
getSourceClientOffset: this.getSourceClientOffset,
publishSource: !1
})), !this.monitor.isDragging()) return;
let a = this.sourceNodes.get(this.monitor.getSourceId());
this.installSourceNodeRemovalObserver(a), this.actions.publishDragSource(), e.cancelable && e.preventDefault();
let o = (n || []).map((e) => this.targetNodes.get(e)).filter((e) => !!e), s = this.options.getDropTargetElementsAtPoint ? this.options.getDropTargetElementsAtPoint(i.x, i.y, o) : this.document.elementsFromPoint(i.x, i.y), c = [];
for (let e in s) {
if (!s.hasOwnProperty(e)) continue;
let t = s[e];
for (t != null && c.push(t); t;) t = t.parentElement, t && c.indexOf(t) === -1 && c.push(t);
}
let l = c.filter((e) => o.indexOf(e) > -1).map((e) => this._getDropTargetId(e)).filter((e) => !!e).filter((e, t, n) => n.indexOf(e) === t);
if (r) for (let e in this.targetNodes) {
let t = this.targetNodes.get(e);
if (a && t && t.contains(a) && l.indexOf(e) === -1) {
l.unshift(e);
break;
}
}
l.reverse(), this.actions.hover(l, { clientOffset: i });
}, this._getDropTargetId = (e) => {
let t = this.targetNodes.keys(), n = t.next();
for (; n.done === !1;) {
let r = n.value;
if (e === this.targetNodes.get(r)) return r;
n = t.next();
}
}, this.handleTopMoveEndCapture = (e) => {
if (this._isScrolling = !1, this.lastTargetTouchFallback = void 0, Cw(e)) {
if (!this.monitor.isDragging() || this.monitor.didDrop()) {
this.moveStartSourceIds = void 0;
return;
}
e.cancelable && e.preventDefault(), this._mouseClientOffset = {}, this.uninstallSourceNodeRemovalObserver(), this.actions.drop(), this.actions.endDrag();
}
}, this.handleCancelOnEscape = (e) => {
e.key === "Escape" && this.monitor.isDragging() && (this._mouseClientOffset = {}, this.uninstallSourceNodeRemovalObserver(), this.actions.endDrag());
}, this.options = new _w(n, t), this.actions = e.getActions(), this.monitor = e.getMonitor(), this.sourceNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodes = /* @__PURE__ */ new Map(), this.sourcePreviewNodeOptions = /* @__PURE__ */ new Map(), this.targetNodes = /* @__PURE__ */ new Map(), this.listenerTypes = [], this._mouseClientOffset = {}, this._isScrolling = !1, this.options.enableMouseEvents && this.listenerTypes.push(gw.mouse), this.options.enableTouchEvents && this.listenerTypes.push(gw.touch), this.options.enableKeyboardEvents && this.listenerTypes.push(gw.keyboard);
}
}, Mw = { backends: [{
id: "html5",
backend: hw,
transition: VC
}, {
id: "touch",
backend: function(e, t = {}, n = {}) {
return new jw(e, t, n);
},
options: { enableMouseEvents: !0 },
preview: !0,
transition: BC
}] }, Nw = Sn(), Pw = /* @__PURE__ */ D(((e, t) => {
function n(e) {
return e === void 0;
}
t.exports = n;
})), Fw = /* @__PURE__ */ D(((e, t) => {
function n(e, t, n) {
var r = -1, i = e.length;
t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
for (var a = Array(i); ++r < i;) a[r] = e[r + t];
return a;
}
t.exports = n;
})), Iw = /* @__PURE__ */ p(Pw(), 1), Lw = P[typeof document < "u" && document.createElement !== void 0 ? "useLayoutEffect" : "useEffect"], Rw = (e) => {
let t = N.useRef(e);
return N.useEffect(() => {
t.current = e;
}), t;
};
//#endregion
//#region node_modules/@react-hook/resize-observer/dist/module/index.js
function zw() {}
function Bw(e, t, n = {}) {
let r = Uw(n.polyfill), i = Rw(t);
return Lw(() => {
let t = !1, n = e && "current" in e ? e.current : e;
if (!n) return zw;
function a(e, n) {
t || i.current(e, n);
}
return r.subscribe(n, a), () => {
t = !0, r.unsubscribe(n, a);
};
}, [
e,
r,
i
]), r.observer;
}
function Vw(e) {
let t = !1, n = [], r = /* @__PURE__ */ new Map(), i = new (e || window.ResizeObserver)((e, i) => {
n = n.concat(e);
function a() {
let e = /* @__PURE__ */ new Set();
for (let t = 0; t < n.length; t++) e.has(n[t].target) || (e.add(n[t].target), r.get(n[t].target)?.forEach((e) => e(n[t], i)));
n = [], t = !1;
}
t || window.requestAnimationFrame(a), t = !0;
});
return {
observer: i,
subscribe(e, t) {
i.observe(e);
let n = r.get(e) ?? [];
n.push(t), r.set(e, n);
},
unsubscribe(e, t) {
let n = r.get(e) ?? [];
if (n.length === 1) {
i.unobserve(e), r.delete(e);
return;
}
let a = n.indexOf(t);
a !== -1 && n.splice(a, 1), r.set(e, n);
}
};
}
var Hw, Uw = (e) => Hw ||= Vw(e), Ww = typeof global == "object" && global && global.Object === Object && global, Gw = typeof self == "object" && self && self.Object === Object && self, Kw = Ww || Gw || Function("return this")(), qw = Kw.Symbol, Jw = Object.prototype, Yw = Jw.hasOwnProperty, Xw = Jw.toString, Zw = qw ? qw.toStringTag : void 0;
function Qw(e) {
var t = Yw.call(e, Zw), n = e[Zw];
try {
e[Zw] = void 0;
var r = !0;
} catch {}
var i = Xw.call(e);
return r && (t ? e[Zw] = n : delete e[Zw]), i;
}
//#endregion
//#region node_modules/lodash-es/_objectToString.js
var $w = Object.prototype.toString;
function eT(e) {
return $w.call(e);
}
//#endregion
//#region node_modules/lodash-es/_baseGetTag.js
var tT = "[object Null]", nT = "[object Undefined]", rT = qw ? qw.toStringTag : void 0;
function iT(e) {
return e == null ? e === void 0 ? nT : tT : rT && rT in Object(e) ? Qw(e) : eT(e);
}
//#endregion
//#region node_modules/lodash-es/isObjectLike.js
function aT(e) {
return typeof e == "object" && !!e;
}
//#endregion
//#region node_modules/lodash-es/isSymbol.js
var oT = "[object Symbol]";
function sT(e) {
return typeof e == "symbol" || aT(e) && iT(e) == oT;
}
//#endregion
//#region node_modules/lodash-es/_arrayMap.js
function cT(e, t) {
for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
return i;
}
//#endregion
//#region node_modules/lodash-es/isArray.js
var lT = Array.isArray, uT = 1 / 0, dT = qw ? qw.prototype : void 0, fT = dT ? dT.toString : void 0;
function pT(e) {
if (typeof e == "string") return e;
if (lT(e)) return cT(e, pT) + "";
if (sT(e)) return fT ? fT.call(e) : "";
var t = e + "";
return t == "0" && 1 / e == -uT ? "-0" : t;
}
//#endregion
//#region node_modules/lodash-es/_trimmedEndIndex.js
var mT = /\s/;
function hT(e) {
for (var t = e.length; t-- && mT.test(e.charAt(t)););
return t;
}
//#endregion
//#region node_modules/lodash-es/_baseTrim.js
var gT = /^\s+/;
function _T(e) {
return e && e.slice(0, hT(e) + 1).replace(gT, "");
}
//#endregion
//#region node_modules/lodash-es/isObject.js
function vT(e) {
var t = typeof e;
return e != null && (t == "object" || t == "function");
}
//#endregion
//#region node_modules/lodash-es/toNumber.js
var yT = NaN, bT = /^[-+]0x[0-9a-f]+$/i, xT = /^0b[01]+$/i, ST = /^0o[0-7]+$/i, CT = parseInt;
function wT(e) {
if (typeof e == "number") return e;
if (sT(e)) return yT;
if (vT(e)) {
var t = typeof e.valueOf == "function" ? e.valueOf() : e;
e = vT(t) ? t + "" : t;
}
if (typeof e != "string") return e === 0 ? e : +e;
e = _T(e);
var n = xT.test(e);
return n || ST.test(e) ? CT(e.slice(2), n ? 2 : 8) : bT.test(e) ? yT : +e;
}
//#endregion
//#region node_modules/lodash-es/toFinite.js
var TT = 1 / 0, ET = 17976931348623157e292;
function DT(e) {
return e ? (e = wT(e), e === TT || e === -TT ? (e < 0 ? -1 : 1) * ET : e === e ? e : 0) : e === 0 ? e : 0;
}
//#endregion
//#region node_modules/lodash-es/toInteger.js
function OT(e) {
var t = DT(e), n = t % 1;
return t === t ? n ? t - n : t : 0;
}
//#endregion
//#region node_modules/lodash-es/identity.js
function kT(e) {
return e;
}
//#endregion
//#region node_modules/lodash-es/isFunction.js
var AT = "[object AsyncFunction]", jT = "[object Function]", MT = "[object GeneratorFunction]", NT = "[object Proxy]";
function PT(e) {
if (!vT(e)) return !1;
var t = iT(e);
return t == jT || t == MT || t == AT || t == NT;
}
//#endregion
//#region node_modules/lodash-es/_coreJsData.js
var FT = Kw["__core-js_shared__"], IT = function() {
var e = /[^.]+$/.exec(FT && FT.keys && FT.keys.IE_PROTO || "");
return e ? "Symbol(src)_1." + e : "";
}();
function LT(e) {
return !!IT && IT in e;
}
//#endregion
//#region node_modules/lodash-es/_toSource.js
var RT = Function.prototype.toString;
function zT(e) {
if (e != null) {
try {
return RT.call(e);
} catch {}
try {
return e + "";
} catch {}
}
return "";
}
//#endregion
//#region node_modules/lodash-es/_baseIsNative.js
var BT = /[\\^$.*+?()[\]{}|]/g, VT = /^\[object .+?Constructor\]$/, HT = Function.prototype, UT = Object.prototype, WT = HT.toString, GT = UT.hasOwnProperty, KT = RegExp("^" + WT.call(GT).replace(BT, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
function qT(e) {
return !vT(e) || LT(e) ? !1 : (PT(e) ? KT : VT).test(zT(e));
}
//#endregion
//#region node_modules/lodash-es/_getValue.js
function JT(e, t) {
return e?.[t];
}
//#endregion
//#region node_modules/lodash-es/_getNative.js
function YT(e, t) {
var n = JT(e, t);
return qT(n) ? n : void 0;
}
//#endregion
//#region node_modules/lodash-es/_WeakMap.js
var XT = YT(Kw, "WeakMap"), ZT = Object.create, QT = function() {
function e() {}
return function(t) {
if (!vT(t)) return {};
if (ZT) return ZT(t);
e.prototype = t;
var n = new e();
return e.prototype = void 0, n;
};
}();
//#endregion
//#region node_modules/lodash-es/_apply.js
function $T(e, t, n) {
switch (n.length) {
case 0: return e.call(t);
case 1: return e.call(t, n[0]);
case 2: return e.call(t, n[0], n[1]);
case 3: return e.call(t, n[0], n[1], n[2]);
}
return e.apply(t, n);
}
//#endregion
//#region node_modules/lodash-es/noop.js
function eE() {}
//#endregion
//#region node_modules/lodash-es/_copyArray.js
function tE(e, t) {
var n = -1, r = e.length;
for (t ||= Array(r); ++n < r;) t[n] = e[n];
return t;
}
//#endregion
//#region node_modules/lodash-es/_shortOut.js
var nE = 800, rE = 16, iE = Date.now;
function aE(e) {
var t = 0, n = 0;
return function() {
var r = iE(), i = rE - (r - n);
if (n = r, i > 0) {
if (++t >= nE) return arguments[0];
} else t = 0;
return e.apply(void 0, arguments);
};
}
//#endregion
//#region node_modules/lodash-es/constant.js
function oE(e) {
return function() {
return e;
};
}
//#endregion
//#region node_modules/lodash-es/_defineProperty.js
var sE = function() {
try {
var e = YT(Object, "defineProperty");
return e({}, "", {}), e;
} catch {}
}(), cE = aE(sE ? function(e, t) {
return sE(e, "toString", {
configurable: !0,
enumerable: !1,
value: oE(t),
writable: !0
});
} : kT);
//#endregion
//#region node_modules/lodash-es/_arrayEach.js
function lE(e, t) {
for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1;);
return e;
}
//#endregion
//#region node_modules/lodash-es/_isIndex.js
var uE = 9007199254740991, dE = /^(?:0|[1-9]\d*)$/;
function fE(e, t) {
var n = typeof e;
return t ??= uE, !!t && (n == "number" || n != "symbol" && dE.test(e)) && e > -1 && e % 1 == 0 && e < t;
}
//#endregion
//#region node_modules/lodash-es/_baseAssignValue.js
function pE(e, t, n) {
t == "__proto__" && sE ? sE(e, t, {
configurable: !0,
enumerable: !0,
value: n,
writable: !0
}) : e[t] = n;
}
//#endregion
//#region node_modules/lodash-es/eq.js
function mE(e, t) {
return e === t || e !== e && t !== t;
}
//#endregion
//#region node_modules/lodash-es/_assignValue.js
var hE = Object.prototype.hasOwnProperty;
function gE(e, t, n) {
var r = e[t];
(!(hE.call(e, t) && mE(r, n)) || n === void 0 && !(t in e)) && pE(e, t, n);
}
//#endregion
//#region node_modules/lodash-es/_copyObject.js
function _E(e, t, n, r) {
var i = !n;
n ||= {};
for (var a = -1, o = t.length; ++a < o;) {
var s = t[a], c = r ? r(n[s], e[s], s, n, e) : void 0;
c === void 0 && (c = e[s]), i ? pE(n, s, c) : gE(n, s, c);
}
return n;
}
//#endregion
//#region node_modules/lodash-es/_overRest.js
var vE = Math.max;
function yE(e, t, n) {
return t = vE(t === void 0 ? e.length - 1 : t, 0), function() {
for (var r = arguments, i = -1, a = vE(r.length - t, 0), o = Array(a); ++i < a;) o[i] = r[t + i];
i = -1;
for (var s = Array(t + 1); ++i < t;) s[i] = r[i];
return s[t] = n(o), $T(e, this, s);
};
}
//#endregion
//#region node_modules/lodash-es/_baseRest.js
function bE(e, t) {
return cE(yE(e, t, kT), e + "");
}
//#endregion
//#region node_modules/lodash-es/isLength.js
var xE = 9007199254740991;
function SE(e) {
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= xE;
}
//#endregion
//#region node_modules/lodash-es/isArrayLike.js
function CE(e) {
return e != null && SE(e.length) && !PT(e);
}
//#endregion
//#region node_modules/lodash-es/_isPrototype.js
var wE = Object.prototype;
function TE(e) {
var t = e && e.constructor;
return e === (typeof t == "function" && t.prototype || wE);
}
//#endregion
//#region node_modules/lodash-es/_baseTimes.js
function EE(e, t) {
for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
return r;
}
//#endregion
//#region node_modules/lodash-es/_baseIsArguments.js
var DE = "[object Arguments]";
function OE(e) {
return aT(e) && iT(e) == DE;
}
//#endregion
//#region node_modules/lodash-es/isArguments.js
var kE = Object.prototype, AE = kE.hasOwnProperty, jE = kE.propertyIsEnumerable, ME = OE(function() {
return arguments;
}()) ? OE : function(e) {
return aT(e) && AE.call(e, "callee") && !jE.call(e, "callee");
};
//#endregion
//#region node_modules/lodash-es/stubFalse.js
function NE() {
return !1;
}
//#endregion
//#region node_modules/lodash-es/isBuffer.js
var PE = typeof exports == "object" && exports && !exports.nodeType && exports, FE = PE && typeof module == "object" && module && !module.nodeType && module, IE = FE && FE.exports === PE ? Kw.Buffer : void 0, LE = (IE ? IE.isBuffer : void 0) || NE, RE = "[object Arguments]", zE = "[object Array]", BE = "[object Boolean]", VE = "[object Date]", HE = "[object Error]", UE = "[object Function]", WE = "[object Map]", GE = "[object Number]", KE = "[object Object]", qE = "[object RegExp]", JE = "[object Set]", YE = "[object String]", XE = "[object WeakMap]", ZE = "[object ArrayBuffer]", QE = "[object DataView]", $E = "[object Float32Array]", eD = "[object Float64Array]", tD = "[object Int8Array]", nD = "[object Int16Array]", rD = "[object Int32Array]", iD = "[object Uint8Array]", aD = "[object Uint8ClampedArray]", oD = "[object Uint16Array]", sD = "[object Uint32Array]", cD = {};
cD[$E] = cD[eD] = cD[tD] = cD[nD] = cD[rD] = cD[iD] = cD[aD] = cD[oD] = cD[sD] = !0, cD[RE] = cD[zE] = cD[ZE] = cD[BE] = cD[QE] = cD[VE] = cD[HE] = cD[UE] = cD[WE] = cD[GE] = cD[KE] = cD[qE] = cD[JE] = cD[YE] = cD[XE] = !1;
function lD(e) {
return aT(e) && SE(e.length) && !!cD[iT(e)];
}
//#endregion
//#region node_modules/lodash-es/_baseUnary.js
function uD(e) {
return function(t) {
return e(t);
};
}
//#endregion
//#region node_modules/lodash-es/_nodeUtil.js
var dD = typeof exports == "object" && exports && !exports.nodeType && exports, fD = dD && typeof module == "object" && module && !module.nodeType && module, pD = fD && fD.exports === dD && Ww.process, mD = function() {
try {
return fD && fD.require && fD.require("util").types || pD && pD.binding && pD.binding("util");
} catch {}
}(), hD = mD && mD.isTypedArray, gD = hD ? uD(hD) : lD, _D = Object.prototype.hasOwnProperty;
function vD(e, t) {
var n = lT(e), r = !n && ME(e), i = !n && !r && LE(e), a = !n && !r && !i && gD(e), o = n || r || i || a, s = o ? EE(e.length, String) : [], c = s.length;
for (var l in e) (t || _D.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || fE(l, c))) && s.push(l);
return s;
}
//#endregion
//#region node_modules/lodash-es/_overArg.js
function yD(e, t) {
return function(n) {
return e(t(n));
};
}
//#endregion
//#region node_modules/lodash-es/_nativeKeys.js
var bD = yD(Object.keys, Object), xD = Object.prototype.hasOwnProperty;
function SD(e) {
if (!TE(e)) return bD(e);
var t = [];
for (var n in Object(e)) xD.call(e, n) && n != "constructor" && t.push(n);
return t;
}
//#endregion
//#region node_modules/lodash-es/keys.js
function CD(e) {
return CE(e) ? vD(e) : SD(e);
}
//#endregion
//#region node_modules/lodash-es/_nativeKeysIn.js
function wD(e) {
var t = [];
if (e != null) for (var n in Object(e)) t.push(n);
return t;
}
//#endregion
//#region node_modules/lodash-es/_baseKeysIn.js
var TD = Object.prototype.hasOwnProperty;
function ED(e) {
if (!vT(e)) return wD(e);
var t = TE(e), n = [];
for (var r in e) r == "constructor" && (t || !TD.call(e, r)) || n.push(r);
return n;
}
//#endregion
//#region node_modules/lodash-es/keysIn.js
function DD(e) {
return CE(e) ? vD(e, !0) : ED(e);
}
//#endregion
//#region node_modules/lodash-es/_nativeCreate.js
var OD = YT(Object, "create");
//#endregion
//#region node_modules/lodash-es/_hashClear.js
function kD() {
this.__data__ = OD ? OD(null) : {}, this.size = 0;
}
//#endregion
//#region node_modules/lodash-es/_hashDelete.js
function AD(e) {
var t = this.has(e) && delete this.__data__[e];
return this.size -= +!!t, t;
}
//#endregion
//#region node_modules/lodash-es/_hashGet.js
var jD = "__lodash_hash_undefined__", MD = Object.prototype.hasOwnProperty;
function ND(e) {
var t = this.__data__;
if (OD) {
var n = t[e];
return n === jD ? void 0 : n;
}
return MD.call(t, e) ? t[e] : void 0;
}
//#endregion
//#region node_modules/lodash-es/_hashHas.js
var PD = Object.prototype.hasOwnProperty;
function FD(e) {
var t = this.__data__;
return OD ? t[e] !== void 0 : PD.call(t, e);
}
//#endregion
//#region node_modules/lodash-es/_hashSet.js
var ID = "__lodash_hash_undefined__";
function LD(e, t) {
var n = this.__data__;
return this.size += +!this.has(e), n[e] = OD && t === void 0 ? ID : t, this;
}
//#endregion
//#region node_modules/lodash-es/_Hash.js
function RD(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1]);
}
}
RD.prototype.clear = kD, RD.prototype.delete = AD, RD.prototype.get = ND, RD.prototype.has = FD, RD.prototype.set = LD;
//#endregion
//#region node_modules/lodash-es/_listCacheClear.js
function zD() {
this.__data__ = [], this.size = 0;
}
//#endregion
//#region node_modules/lodash-es/_assocIndexOf.js
function BD(e, t) {
for (var n = e.length; n--;) if (mE(e[n][0], t)) return n;
return -1;
}
//#endregion
//#region node_modules/lodash-es/_listCacheDelete.js
var VD = Array.prototype.splice;
function HD(e) {
var t = this.__data__, n = BD(t, e);
return n < 0 ? !1 : (n == t.length - 1 ? t.pop() : VD.call(t, n, 1), --this.size, !0);
}
//#endregion
//#region node_modules/lodash-es/_listCacheGet.js
function UD(e) {
var t = this.__data__, n = BD(t, e);
return n < 0 ? void 0 : t[n][1];
}
//#endregion
//#region node_modules/lodash-es/_listCacheHas.js
function WD(e) {
return BD(this.__data__, e) > -1;
}
//#endregion
//#region node_modules/lodash-es/_listCacheSet.js
function GD(e, t) {
var n = this.__data__, r = BD(n, e);
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
}
//#endregion
//#region node_modules/lodash-es/_ListCache.js
function KD(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1]);
}
}
KD.prototype.clear = zD, KD.prototype.delete = HD, KD.prototype.get = UD, KD.prototype.has = WD, KD.prototype.set = GD;
//#endregion
//#region node_modules/lodash-es/_Map.js
var qD = YT(Kw, "Map");
//#endregion
//#region node_modules/lodash-es/_mapCacheClear.js
function JD() {
this.size = 0, this.__data__ = {
hash: new RD(),
map: new (qD || KD)(),
string: new RD()
};
}
//#endregion
//#region node_modules/lodash-es/_isKeyable.js
function YD(e) {
var t = typeof e;
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
}
//#endregion
//#region node_modules/lodash-es/_getMapData.js
function XD(e, t) {
var n = e.__data__;
return YD(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
}
//#endregion
//#region node_modules/lodash-es/_mapCacheDelete.js
function ZD(e) {
var t = XD(this, e).delete(e);
return this.size -= +!!t, t;
}
//#endregion
//#region node_modules/lodash-es/_mapCacheGet.js
function QD(e) {
return XD(this, e).get(e);
}
//#endregion
//#region node_modules/lodash-es/_mapCacheHas.js
function $D(e) {
return XD(this, e).has(e);
}
//#endregion
//#region node_modules/lodash-es/_mapCacheSet.js
function eO(e, t) {
var n = XD(this, e), r = n.size;
return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
}
//#endregion
//#region node_modules/lodash-es/_MapCache.js
function tO(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.clear(); ++t < n;) {
var r = e[t];
this.set(r[0], r[1]);
}
}
tO.prototype.clear = JD, tO.prototype.delete = ZD, tO.prototype.get = QD, tO.prototype.has = $D, tO.prototype.set = eO;
//#endregion
//#region node_modules/lodash-es/toString.js
function nO(e) {
return e == null ? "" : pT(e);
}
//#endregion
//#region node_modules/lodash-es/_arrayPush.js
function rO(e, t) {
for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
return e;
}
//#endregion
//#region node_modules/lodash-es/_isFlattenable.js
var iO = qw ? qw.isConcatSpreadable : void 0;
function aO(e) {
return lT(e) || ME(e) || !!(iO && e && e[iO]);
}
//#endregion
//#region node_modules/lodash-es/_baseFlatten.js
function oO(e, t, n, r, i) {
var a = -1, o = e.length;
for (n ||= aO, i ||= []; ++a < o;) {
var s = e[a];
t > 0 && n(s) ? t > 1 ? oO(s, t - 1, n, r, i) : rO(i, s) : r || (i[i.length] = s);
}
return i;
}
//#endregion
//#region node_modules/lodash-es/flatten.js
function sO(e) {
return e != null && e.length ? oO(e, 1) : [];
}
//#endregion
//#region node_modules/lodash-es/_getPrototype.js
var cO = yD(Object.getPrototypeOf, Object);
//#endregion
//#region node_modules/lodash-es/_baseSlice.js
function lO(e, t, n) {
var r = -1, i = e.length;
t < 0 && (t = -t > i ? 0 : i + t), n = n > i ? i : n, n < 0 && (n += i), i = t > n ? 0 : n - t >>> 0, t >>>= 0;
for (var a = Array(i); ++r < i;) a[r] = e[r + t];
return a;
}
//#endregion
//#region node_modules/lodash-es/_arrayReduce.js
function uO(e, t, n, r) {
var i = -1, a = e == null ? 0 : e.length;
for (r && a && (n = e[++i]); ++i < a;) n = t(n, e[i], i, e);
return n;
}
//#endregion
//#region node_modules/lodash-es/_basePropertyOf.js
function dO(e) {
return function(t) {
return e?.[t];
};
}
//#endregion
//#region node_modules/lodash-es/_deburrLetter.js
var fO = dO({
À: "A",
Á: "A",
Â: "A",
Ã: "A",
Ä: "A",
Å: "A",
à: "a",
á: "a",
â: "a",
ã: "a",
ä: "a",
å: "a",
Ç: "C",
ç: "c",
Ð: "D",
ð: "d",
È: "E",
É: "E",
Ê: "E",
Ë: "E",
è: "e",
é: "e",
ê: "e",
ë: "e",
Ì: "I",
Í: "I",
Î: "I",
Ï: "I",
ì: "i",
í: "i",
î: "i",
ï: "i",
Ñ: "N",
ñ: "n",
Ò: "O",
Ó: "O",
Ô: "O",
Õ: "O",
Ö: "O",
Ø: "O",
ò: "o",
ó: "o",
ô: "o",
õ: "o",
ö: "o",
ø: "o",
Ù: "U",
Ú: "U",
Û: "U",
Ü: "U",
ù: "u",
ú: "u",
û: "u",
ü: "u",
Ý: "Y",
ý: "y",
ÿ: "y",
Æ: "Ae",
æ: "ae",
Þ: "Th",
þ: "th",
ß: "ss",
Ā: "A",
Ă: "A",
Ą: "A",
ā: "a",
ă: "a",
ą: "a",
Ć: "C",
Ĉ: "C",
Ċ: "C",
Č: "C",
ć: "c",
ĉ: "c",
ċ: "c",
č: "c",
Ď: "D",
Đ: "D",
ď: "d",
đ: "d",
Ē: "E",
Ĕ: "E",
Ė: "E",
Ę: "E",
Ě: "E",
ē: "e",
ĕ: "e",
ė: "e",
ę: "e",
ě: "e",
Ĝ: "G",
Ğ: "G",
Ġ: "G",
Ģ: "G",
ĝ: "g",
ğ: "g",
ġ: "g",
ģ: "g",
Ĥ: "H",
Ħ: "H",
ĥ: "h",
ħ: "h",
Ĩ: "I",
Ī: "I",
Ĭ: "I",
Į: "I",
İ: "I",
ĩ: "i",
ī: "i",
ĭ: "i",
į: "i",
ı: "i",
Ĵ: "J",
ĵ: "j",
Ķ: "K",
ķ: "k",
ĸ: "k",
Ĺ: "L",
Ļ: "L",
Ľ: "L",
Ŀ: "L",
Ł: "L",
ĺ: "l",
ļ: "l",
ľ: "l",
ŀ: "l",
ł: "l",
Ń: "N",
Ņ: "N",
Ň: "N",
Ŋ: "N",
ń: "n",
ņ: "n",
ň: "n",
ŋ: "n",
Ō: "O",
Ŏ: "O",
Ő: "O",
ō: "o",
ŏ: "o",
ő: "o",
Ŕ: "R",
Ŗ: "R",
Ř: "R",
ŕ: "r",
ŗ: "r",
ř: "r",
Ś: "S",
Ŝ: "S",
Ş: "S",
Š: "S",
ś: "s",
ŝ: "s",
ş: "s",
š: "s",
Ţ: "T",
Ť: "T",
Ŧ: "T",
ţ: "t",
ť: "t",
ŧ: "t",
Ũ: "U",
Ū: "U",
Ŭ: "U",
Ů: "U",
Ű: "U",
Ų: "U",
ũ: "u",
ū: "u",
ŭ: "u",
ů: "u",
ű: "u",
ų: "u",
Ŵ: "W",
ŵ: "w",
Ŷ: "Y",
ŷ: "y",
Ÿ: "Y",
Ź: "Z",
Ż: "Z",
Ž: "Z",
ź: "z",
ż: "z",
ž: "z",
IJ: "IJ",
ij: "ij",
Œ: "Oe",
œ: "oe",
ʼn: "'n",
ſ: "s"
}), pO = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, mO = RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]", "g");
function hO(e) {
return e = nO(e), e && e.replace(pO, fO).replace(mO, "");
}
//#endregion
//#region node_modules/lodash-es/_asciiWords.js
var gO = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
function _O(e) {
return e.match(gO) || [];
}
//#endregion
//#region node_modules/lodash-es/_hasUnicodeWord.js
var vO = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
function yO(e) {
return vO.test(e);
}
//#endregion
//#region node_modules/lodash-es/_unicodeWords.js
var bO = "\\ud800-\\udfff", xO = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", SO = "\\u2700-\\u27bf", CO = "a-z\\xdf-\\xf6\\xf8-\\xff", wO = "\\xac\\xb1\\xd7\\xf7", TO = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", EO = "\\u2000-\\u206f", DO = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", OO = "A-Z\\xc0-\\xd6\\xd8-\\xde", kO = "\\ufe0e\\ufe0f", AO = wO + TO + EO + DO, jO = "['’]", MO = "[" + AO + "]", NO = "[" + xO + "]", PO = "\\d+", FO = "[" + SO + "]", IO = "[" + CO + "]", LO = "[^" + bO + AO + PO + SO + CO + OO + "]", RO = "(?:" + NO + "|\\ud83c[\\udffb-\\udfff])", zO = "[^" + bO + "]", BO = "(?:\\ud83c[\\udde6-\\uddff]){2}", VO = "[\\ud800-\\udbff][\\udc00-\\udfff]", HO = "[" + OO + "]", UO = "\\u200d", WO = "(?:" + IO + "|" + LO + ")", GO = "(?:" + HO + "|" + LO + ")", KO = "(?:" + jO + "(?:d|ll|m|re|s|t|ve))?", qO = "(?:" + jO + "(?:D|LL|M|RE|S|T|VE))?", JO = RO + "?", YO = "[" + kO + "]?", XO = "(?:" + UO + "(?:" + [
zO,
BO,
VO
].join("|") + ")" + YO + JO + ")*", ZO = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", QO = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", $O = YO + JO + XO, ek = "(?:" + [
FO,
BO,
VO
].join("|") + ")" + $O, tk = RegExp([
HO + "?" + IO + "+" + KO + "(?=" + [
MO,
HO,
"$"
].join("|") + ")",
GO + "+" + qO + "(?=" + [
MO,
HO + WO,
"$"
].join("|") + ")",
HO + "?" + WO + "+" + KO,
HO + "+" + qO,
QO,
ZO,
PO,
ek
].join("|"), "g");
function nk(e) {
return e.match(tk) || [];
}
//#endregion
//#region node_modules/lodash-es/words.js
function rk(e, t, n) {
return e = nO(e), t = n ? void 0 : t, t === void 0 ? yO(e) ? nk(e) : _O(e) : e.match(t) || [];
}
//#endregion
//#region node_modules/lodash-es/_createCompounder.js
var ik = RegExp("['’]", "g");
function ak(e) {
return function(t) {
return uO(rk(hO(t).replace(ik, "")), e, "");
};
}
//#endregion
//#region node_modules/lodash-es/_baseClamp.js
function ok(e, t, n) {
return e === e && (n !== void 0 && (e = e <= n ? e : n), t !== void 0 && (e = e >= t ? e : t)), e;
}
//#endregion
//#region node_modules/lodash-es/clamp.js
function sk(e, t, n) {
return n === void 0 && (n = t, t = void 0), n !== void 0 && (n = wT(n), n = n === n ? n : 0), t !== void 0 && (t = wT(t), t = t === t ? t : 0), ok(wT(e), t, n);
}
//#endregion
//#region node_modules/lodash-es/_stackClear.js
function ck() {
this.__data__ = new KD(), this.size = 0;
}
//#endregion
//#region node_modules/lodash-es/_stackDelete.js
function lk(e) {
var t = this.__data__, n = t.delete(e);
return this.size = t.size, n;
}
//#endregion
//#region node_modules/lodash-es/_stackGet.js
function uk(e) {
return this.__data__.get(e);
}
//#endregion
//#region node_modules/lodash-es/_stackHas.js
function dk(e) {
return this.__data__.has(e);
}
//#endregion
//#region node_modules/lodash-es/_stackSet.js
var fk = 200;
function pk(e, t) {
var n = this.__data__;
if (n instanceof KD) {
var r = n.__data__;
if (!qD || r.length < fk - 1) return r.push([e, t]), this.size = ++n.size, this;
n = this.__data__ = new tO(r);
}
return n.set(e, t), this.size = n.size, this;
}
//#endregion
//#region node_modules/lodash-es/_Stack.js
function mk(e) {
var t = this.__data__ = new KD(e);
this.size = t.size;
}
mk.prototype.clear = ck, mk.prototype.delete = lk, mk.prototype.get = uk, mk.prototype.has = dk, mk.prototype.set = pk;
//#endregion
//#region node_modules/lodash-es/_baseAssign.js
function hk(e, t) {
return e && _E(t, CD(t), e);
}
//#endregion
//#region node_modules/lodash-es/_baseAssignIn.js
function gk(e, t) {
return e && _E(t, DD(t), e);
}
//#endregion
//#region node_modules/lodash-es/_cloneBuffer.js
var _k = typeof exports == "object" && exports && !exports.nodeType && exports, vk = _k && typeof module == "object" && module && !module.nodeType && module, yk = vk && vk.exports === _k ? Kw.Buffer : void 0, bk = yk ? yk.allocUnsafe : void 0;
function xk(e, t) {
if (t) return e.slice();
var n = e.length, r = bk ? bk(n) : new e.constructor(n);
return e.copy(r), r;
}
//#endregion
//#region node_modules/lodash-es/_arrayFilter.js
function Sk(e, t) {
for (var n = -1, r = e == null ? 0 : e.length, i = 0, a = []; ++n < r;) {
var o = e[n];
t(o, n, e) && (a[i++] = o);
}
return a;
}
//#endregion
//#region node_modules/lodash-es/stubArray.js
function Ck() {
return [];
}
//#endregion
//#region node_modules/lodash-es/_getSymbols.js
var wk = Object.prototype.propertyIsEnumerable, Tk = Object.getOwnPropertySymbols, Ek = Tk ? function(e) {
return e == null ? [] : (e = Object(e), Sk(Tk(e), function(t) {
return wk.call(e, t);
}));
} : Ck;
//#endregion
//#region node_modules/lodash-es/_copySymbols.js
function Dk(e, t) {
return _E(e, Ek(e), t);
}
//#endregion
//#region node_modules/lodash-es/_getSymbolsIn.js
var Ok = Object.getOwnPropertySymbols ? function(e) {
for (var t = []; e;) rO(t, Ek(e)), e = cO(e);
return t;
} : Ck;
//#endregion
//#region node_modules/lodash-es/_copySymbolsIn.js
function kk(e, t) {
return _E(e, Ok(e), t);
}
//#endregion
//#region node_modules/lodash-es/_baseGetAllKeys.js
function Ak(e, t, n) {
var r = t(e);
return lT(e) ? r : rO(r, n(e));
}
//#endregion
//#region node_modules/lodash-es/_getAllKeys.js
function jk(e) {
return Ak(e, CD, Ek);
}
//#endregion
//#region node_modules/lodash-es/_getAllKeysIn.js
function Mk(e) {
return Ak(e, DD, Ok);
}
//#endregion
//#region node_modules/lodash-es/_DataView.js
var Nk = YT(Kw, "DataView"), Pk = YT(Kw, "Promise"), Fk = YT(Kw, "Set"), Ik = "[object Map]", Lk = "[object Object]", Rk = "[object Promise]", zk = "[object Set]", Bk = "[object WeakMap]", Vk = "[object DataView]", Hk = zT(Nk), Uk = zT(qD), Wk = zT(Pk), Gk = zT(Fk), Kk = zT(XT), qk = iT;
(Nk && qk(new Nk(/* @__PURE__ */ new ArrayBuffer(1))) != Vk || qD && qk(new qD()) != Ik || Pk && qk(Pk.resolve()) != Rk || Fk && qk(new Fk()) != zk || XT && qk(new XT()) != Bk) && (qk = function(e) {
var t = iT(e), n = t == Lk ? e.constructor : void 0, r = n ? zT(n) : "";
if (r) switch (r) {
case Hk: return Vk;
case Uk: return Ik;
case Wk: return Rk;
case Gk: return zk;
case Kk: return Bk;
}
return t;
});
var Jk = qk, Yk = Object.prototype.hasOwnProperty;
function Xk(e) {
var t = e.length, n = new e.constructor(t);
return t && typeof e[0] == "string" && Yk.call(e, "index") && (n.index = e.index, n.input = e.input), n;
}
//#endregion
//#region node_modules/lodash-es/_Uint8Array.js
var Zk = Kw.Uint8Array;
//#endregion
//#region node_modules/lodash-es/_cloneArrayBuffer.js
function Qk(e) {
var t = new e.constructor(e.byteLength);
return new Zk(t).set(new Zk(e)), t;
}
//#endregion
//#region node_modules/lodash-es/_cloneDataView.js
function $k(e, t) {
var n = t ? Qk(e.buffer) : e.buffer;
return new e.constructor(n, e.byteOffset, e.byteLength);
}
//#endregion
//#region node_modules/lodash-es/_cloneRegExp.js
var eA = /\w*$/;
function tA(e) {
var t = new e.constructor(e.source, eA.exec(e));
return t.lastIndex = e.lastIndex, t;
}
//#endregion
//#region node_modules/lodash-es/_cloneSymbol.js
var nA = qw ? qw.prototype : void 0, rA = nA ? nA.valueOf : void 0;
function iA(e) {
return rA ? Object(rA.call(e)) : {};
}
//#endregion
//#region node_modules/lodash-es/_cloneTypedArray.js
function aA(e, t) {
var n = t ? Qk(e.buffer) : e.buffer;
return new e.constructor(n, e.byteOffset, e.length);
}
//#endregion
//#region node_modules/lodash-es/_initCloneByTag.js
var oA = "[object Boolean]", sA = "[object Date]", cA = "[object Map]", lA = "[object Number]", uA = "[object RegExp]", dA = "[object Set]", fA = "[object String]", pA = "[object Symbol]", mA = "[object ArrayBuffer]", hA = "[object DataView]", gA = "[object Float32Array]", _A = "[object Float64Array]", vA = "[object Int8Array]", yA = "[object Int16Array]", bA = "[object Int32Array]", xA = "[object Uint8Array]", SA = "[object Uint8ClampedArray]", CA = "[object Uint16Array]", wA = "[object Uint32Array]";
function TA(e, t, n) {
var r = e.constructor;
switch (t) {
case mA: return Qk(e);
case oA:
case sA: return new r(+e);
case hA: return $k(e, n);
case gA:
case _A:
case vA:
case yA:
case bA:
case xA:
case SA:
case CA:
case wA: return aA(e, n);
case cA: return new r();
case lA:
case fA: return new r(e);
case uA: return tA(e);
case dA: return new r();
case pA: return iA(e);
}
}
//#endregion
//#region node_modules/lodash-es/_initCloneObject.js
function EA(e) {
return typeof e.constructor == "function" && !TE(e) ? QT(cO(e)) : {};
}
//#endregion
//#region node_modules/lodash-es/_baseIsMap.js
var DA = "[object Map]";
function OA(e) {
return aT(e) && Jk(e) == DA;
}
//#endregion
//#region node_modules/lodash-es/isMap.js
var kA = mD && mD.isMap, AA = kA ? uD(kA) : OA, jA = "[object Set]";
function MA(e) {
return aT(e) && Jk(e) == jA;
}
//#endregion
//#region node_modules/lodash-es/isSet.js
var NA = mD && mD.isSet, PA = NA ? uD(NA) : MA, FA = 1, IA = 2, LA = 4, RA = "[object Arguments]", zA = "[object Array]", BA = "[object Boolean]", VA = "[object Date]", HA = "[object Error]", UA = "[object Function]", WA = "[object GeneratorFunction]", GA = "[object Map]", KA = "[object Number]", qA = "[object Object]", JA = "[object RegExp]", YA = "[object Set]", XA = "[object String]", ZA = "[object Symbol]", QA = "[object WeakMap]", $A = "[object ArrayBuffer]", ej = "[object DataView]", tj = "[object Float32Array]", nj = "[object Float64Array]", rj = "[object Int8Array]", ij = "[object Int16Array]", aj = "[object Int32Array]", oj = "[object Uint8Array]", sj = "[object Uint8ClampedArray]", cj = "[object Uint16Array]", lj = "[object Uint32Array]", uj = {};
uj[RA] = uj[zA] = uj[$A] = uj[ej] = uj[BA] = uj[VA] = uj[tj] = uj[nj] = uj[rj] = uj[ij] = uj[aj] = uj[GA] = uj[KA] = uj[qA] = uj[JA] = uj[YA] = uj[XA] = uj[ZA] = uj[oj] = uj[sj] = uj[cj] = uj[lj] = !0, uj[HA] = uj[UA] = uj[QA] = !1;
function dj(e, t, n, r, i, a) {
var o, s = t & FA, c = t & IA, l = t & LA;
if (n && (o = i ? n(e, r, i, a) : n(e)), o !== void 0) return o;
if (!vT(e)) return e;
var u = lT(e);
if (u) {
if (o = Xk(e), !s) return tE(e, o);
} else {
var d = Jk(e), f = d == UA || d == WA;
if (LE(e)) return xk(e, s);
if (d == qA || d == RA || f && !i) {
if (o = c || f ? {} : EA(e), !s) return c ? kk(e, gk(o, e)) : Dk(e, hk(o, e));
} else {
if (!uj[d]) return i ? e : {};
o = TA(e, d, s);
}
}
a ||= new mk();
var p = a.get(e);
if (p) return p;
a.set(e, o), PA(e) ? e.forEach(function(r) {
o.add(dj(r, t, n, r, e, a));
}) : AA(e) && e.forEach(function(r, i) {
o.set(i, dj(r, t, n, i, e, a));
});
var m = u ? void 0 : (l ? c ? Mk : jk : c ? DD : CD)(e);
return lE(m || e, function(r, i) {
m && (i = r, r = e[i]), gE(o, i, dj(r, t, n, i, e, a));
}), o;
}
//#endregion
//#region node_modules/lodash-es/clone.js
var fj = 4;
function pj(e) {
return dj(e, fj);
}
//#endregion
//#region node_modules/lodash-es/_setCacheAdd.js
var mj = "__lodash_hash_undefined__";
function hj(e) {
return this.__data__.set(e, mj), this;
}
//#endregion
//#region node_modules/lodash-es/_setCacheHas.js
function gj(e) {
return this.__data__.has(e);
}
//#endregion
//#region node_modules/lodash-es/_SetCache.js
function _j(e) {
var t = -1, n = e == null ? 0 : e.length;
for (this.__data__ = new tO(); ++t < n;) this.add(e[t]);
}
_j.prototype.add = _j.prototype.push = hj, _j.prototype.has = gj;
//#endregion
//#region node_modules/lodash-es/_arraySome.js
function vj(e, t) {
for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
return !1;
}
//#endregion
//#region node_modules/lodash-es/_cacheHas.js
function yj(e, t) {
return e.has(t);
}
//#endregion
//#region node_modules/lodash-es/_equalArrays.js
var bj = 1, xj = 2;
function Sj(e, t, n, r, i, a) {
var o = n & bj, s = e.length, c = t.length;
if (s != c && !(o && c > s)) return !1;
var l = a.get(e), u = a.get(t);
if (l && u) return l == t && u == e;
var d = -1, f = !0, p = n & xj ? new _j() : void 0;
for (a.set(e, t), a.set(t, e); ++d < s;) {
var m = e[d], h = t[d];
if (r) var g = o ? r(h, m, d, t, e, a) : r(m, h, d, e, t, a);
if (g !== void 0) {
if (g) continue;
f = !1;
break;
}
if (p) {
if (!vj(t, function(e, t) {
if (!yj(p, t) && (m === e || i(m, e, n, r, a))) return p.push(t);
})) {
f = !1;
break;
}
} else if (!(m === h || i(m, h, n, r, a))) {
f = !1;
break;
}
}
return a.delete(e), a.delete(t), f;
}
//#endregion
//#region node_modules/lodash-es/_mapToArray.js
function Cj(e) {
var t = -1, n = Array(e.size);
return e.forEach(function(e, r) {
n[++t] = [r, e];
}), n;
}
//#endregion
//#region node_modules/lodash-es/_setToArray.js
function wj(e) {
var t = -1, n = Array(e.size);
return e.forEach(function(e) {
n[++t] = e;
}), n;
}
//#endregion
//#region node_modules/lodash-es/_equalByTag.js
var Tj = 1, Ej = 2, Dj = "[object Boolean]", Oj = "[object Date]", kj = "[object Error]", Aj = "[object Map]", jj = "[object Number]", Mj = "[object RegExp]", Nj = "[object Set]", Pj = "[object String]", Fj = "[object Symbol]", Ij = "[object ArrayBuffer]", Lj = "[object DataView]", Rj = qw ? qw.prototype : void 0, zj = Rj ? Rj.valueOf : void 0;
function Bj(e, t, n, r, i, a, o) {
switch (n) {
case Lj:
if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
e = e.buffer, t = t.buffer;
case Ij: return !(e.byteLength != t.byteLength || !a(new Zk(e), new Zk(t)));
case Dj:
case Oj:
case jj: return mE(+e, +t);
case kj: return e.name == t.name && e.message == t.message;
case Mj:
case Pj: return e == t + "";
case Aj: var s = Cj;
case Nj:
var c = r & Tj;
if (s ||= wj, e.size != t.size && !c) return !1;
var l = o.get(e);
if (l) return l == t;
r |= Ej, o.set(e, t);
var u = Sj(s(e), s(t), r, i, a, o);
return o.delete(e), u;
case Fj: if (zj) return zj.call(e) == zj.call(t);
}
return !1;
}
//#endregion
//#region node_modules/lodash-es/_equalObjects.js
var Vj = 1, Hj = Object.prototype.hasOwnProperty;
function Uj(e, t, n, r, i, a) {
var o = n & Vj, s = jk(e), c = s.length;
if (c != jk(t).length && !o) return !1;
for (var l = c; l--;) {
var u = s[l];
if (!(o ? u in t : Hj.call(t, u))) return !1;
}
var d = a.get(e), f = a.get(t);
if (d && f) return d == t && f == e;
var p = !0;
a.set(e, t), a.set(t, e);
for (var m = o; ++l < c;) {
u = s[l];
var h = e[u], g = t[u];
if (r) var _ = o ? r(g, h, u, t, e, a) : r(h, g, u, e, t, a);
if (!(_ === void 0 ? h === g || i(h, g, n, r, a) : _)) {
p = !1;
break;
}
m ||= u == "constructor";
}
if (p && !m) {
var v = e.constructor, y = t.constructor;
v != y && "constructor" in e && "constructor" in t && !(typeof v == "function" && v instanceof v && typeof y == "function" && y instanceof y) && (p = !1);
}
return a.delete(e), a.delete(t), p;
}
//#endregion
//#region node_modules/lodash-es/_baseIsEqualDeep.js
var Wj = 1, Gj = "[object Arguments]", Kj = "[object Array]", qj = "[object Object]", Jj = Object.prototype.hasOwnProperty;
function Yj(e, t, n, r, i, a) {
var o = lT(e), s = lT(t), c = o ? Kj : Jk(e), l = s ? Kj : Jk(t);
c = c == Gj ? qj : c, l = l == Gj ? qj : l;
var u = c == qj, d = l == qj, f = c == l;
if (f && LE(e)) {
if (!LE(t)) return !1;
o = !0, u = !1;
}
if (f && !u) return a ||= new mk(), o || gD(e) ? Sj(e, t, n, r, i, a) : Bj(e, t, c, n, r, i, a);
if (!(n & Wj)) {
var p = u && Jj.call(e, "__wrapped__"), m = d && Jj.call(t, "__wrapped__");
if (p || m) {
var h = p ? e.value() : e, g = m ? t.value() : t;
return a ||= new mk(), i(h, g, n, r, a);
}
}
return f ? (a ||= new mk(), Uj(e, t, n, r, i, a)) : !1;
}
//#endregion
//#region node_modules/lodash-es/_baseIsEqual.js
function Xj(e, t, n, r, i) {
return e === t ? !0 : e == null || t == null || !aT(e) && !aT(t) ? e !== e && t !== t : Yj(e, t, n, r, Xj, i);
}
//#endregion
//#region node_modules/lodash-es/now.js
var Zj = function() {
return Kw.Date.now();
}, Qj = "Expected a function", $j = Math.max, eM = Math.min;
function tM(e, t, n) {
var r, i, a, o, s, c, l = 0, u = !1, d = !1, f = !0;
if (typeof e != "function") throw TypeError(Qj);
t = wT(t) || 0, vT(n) && (u = !!n.leading, d = "maxWait" in n, a = d ? $j(wT(n.maxWait) || 0, t) : a, f = "trailing" in n ? !!n.trailing : f);
function p(t) {
var n = r, a = i;
return r = i = void 0, l = t, o = e.apply(a, n), o;
}
function m(e) {
return l = e, s = setTimeout(_, t), u ? p(e) : o;
}
function h(e) {
var n = e - c, r = e - l, i = t - n;
return d ? eM(i, a - r) : i;
}
function g(e) {
var n = e - c, r = e - l;
return c === void 0 || n >= t || n < 0 || d && r >= a;
}
function _() {
var e = Zj();
if (g(e)) return v(e);
s = setTimeout(_, h(e));
}
function v(e) {
return s = void 0, f && r ? p(e) : (r = i = void 0, o);
}
function y() {
s !== void 0 && clearTimeout(s), l = 0, r = c = i = s = void 0;
}
function b() {
return s === void 0 ? o : v(Zj());
}
function x() {
var e = Zj(), n = g(e);
if (r = arguments, i = this, c = e, n) {
if (s === void 0) return m(c);
if (d) return clearTimeout(s), s = setTimeout(_, t), p(c);
}
return s === void 0 && (s = setTimeout(_, t)), o;
}
return x.cancel = y, x.flush = b, x;
}
//#endregion
//#region node_modules/lodash-es/_baseDelay.js
var nM = "Expected a function";
function rM(e, t, n) {
if (typeof e != "function") throw TypeError(nM);
return setTimeout(function() {
e.apply(void 0, n);
}, t);
}
//#endregion
//#region node_modules/lodash-es/defer.js
var iM = bE(function(e, t) {
return rM(e, 1, t);
});
//#endregion
//#region node_modules/lodash-es/drop.js
function aM(e, t, n) {
var r = e == null ? 0 : e.length;
return r ? (t = n || t === void 0 ? 1 : OT(t), lO(e, t < 0 ? 0 : t, r)) : [];
}
//#endregion
//#region node_modules/lodash-es/dropRight.js
function oM(e, t, n) {
var r = e == null ? 0 : e.length;
return r ? (t = n || t === void 0 ? 1 : OT(t), t = r - t, lO(e, 0, t < 0 ? 0 : t)) : [];
}
//#endregion
//#region node_modules/lodash-es/_baseValues.js
function sM(e, t) {
return cT(t, function(t) {
return e[t];
});
}
//#endregion
//#region node_modules/lodash-es/values.js
function cM(e) {
return e == null ? [] : sM(e, CD(e));
}
//#endregion
//#region node_modules/lodash-es/isEqual.js
function lM(e, t) {
return Xj(e, t);
}
//#endregion
//#region node_modules/lodash-es/kebabCase.js
var uM = ak(function(e, t, n) {
return e + (n ? "-" : "") + t.toLowerCase();
});
//#endregion
//#region node_modules/lodash-es/_baseSum.js
function dM(e, t) {
for (var n, r = -1, i = e.length; ++r < i;) {
var a = t(e[r]);
a !== void 0 && (n = n === void 0 ? a : n + a);
}
return n;
}
//#endregion
//#region node_modules/lodash-es/sum.js
function fM(e) {
return e && e.length ? dM(e, kT) : 0;
}
//#endregion
//#region node_modules/lodash-es/throttle.js
var pM = "Expected a function";
function mM(e, t, n) {
var r = !0, i = !0;
if (typeof e != "function") throw TypeError(pM);
return vT(n) && (r = "leading" in n ? !!n.leading : r, i = "trailing" in n ? !!n.trailing : i), tM(e, t, {
leading: r,
maxWait: t,
trailing: i
});
}
//#endregion
//#region node_modules/react-mosaic-component/lib/contextTypes.mjs
var hM = P.createContext(void 0), gM = P.createContext(void 0);
//#endregion
//#region node_modules/react-mosaic-component/lib/util/assertNever.mjs
function _M(e) {
throw Error("Unhandled case: " + JSON.stringify(e));
}
//#endregion
//#region node_modules/react-mosaic-component/lib/util/BoundingBox.mjs
function vM() {
return {
top: 0,
right: 0,
bottom: 0,
left: 0
};
}
function yM(e, t, n) {
let r = [], i = 0;
for (let a of t) {
let t = { ...e };
switch (n) {
case "row": {
let n = 100 - e.left - e.right;
t.left = e.left + n * i / 100, t.right = e.right + n * (100 - (i + a)) / 100;
break;
}
case "column": {
let n = 100 - e.top - e.bottom;
t.top = e.top + n * i / 100, t.bottom = e.bottom + n * (100 - (i + a)) / 100;
break;
}
default: _M(n);
}
r.push(t), i += a;
}
return r;
}
function bM({ top: e, right: t, bottom: n, left: r }) {
return {
top: `${e}%`,
right: `${t}%`,
bottom: `${n}%`,
left: `${r}%`
};
}
function xM(e, t, n) {
let { top: r, right: i, bottom: a, left: o } = e;
return n === "column" ? (100 - r - a) * t / 100 + r : n === "row" ? (100 - i - o) * t / 100 + o : _M(n);
}
function SM(e, t, n) {
let { top: r, right: i, bottom: a, left: o } = e;
if (n === "column") {
let e = 100 - r - a;
return e === 0 ? 0 : (t - r) / e * 100;
}
if (n === "row") {
let e = 100 - i - o;
return e === 0 ? 0 : (t - o) / e * 100;
}
return _M(n);
}
//#endregion
//#region node_modules/react-mosaic-component/lib/Split.mjs
var CM = 1e3 / 30, wM = {
capture: !0,
passive: !1
}, TM = class extends P.PureComponent {
rootElement = P.createRef();
listenersBound = !1;
static defaultProps = {
onChange: () => void 0,
onRelease: () => void 0,
minimumPaneSizePercentage: 10
};
render() {
let { direction: e } = this.props;
return /* @__PURE__ */ P.createElement("div", {
className: (0, G.default)("mosaic-split", {
"-row": e === "row",
"-column": e === "column"
}),
ref: this.rootElement,
onMouseDown: this.onMouseDown,
style: this.computeStyle()
}, /* @__PURE__ */ P.createElement("div", { className: "mosaic-split-line" }));
}
componentDidMount() {
this.rootElement.current.addEventListener("touchstart", this.onMouseDown, wM);
}
componentWillUnmount() {
this.unbindListeners(), this.rootElement.current && this.rootElement.current.ownerDocument.removeEventListener("touchstart", this.onMouseDown, wM);
}
computeStyle() {
let { boundingBox: e, direction: t, splitPercentages: n, splitIndex: r } = this.props, i = xM(e, fM(n.slice(0, r + 1)), t), a = t === "column" ? "top" : "left";
return {
...bM(e),
[a]: `${i}%`
};
}
onMouseDown = (e) => {
!EM(e) && e.button !== 0 || (e.preventDefault(), this.bindListeners());
};
onMouseUp = (e) => {
this.unbindListeners();
let t = this.calculateNewPercentages(e);
this.props.onRelease(t);
};
onMouseMove = (e) => {
e.preventDefault(), this.throttledUpdatePercentage(e);
};
throttledUpdatePercentage = mM((e) => {
let t = this.calculateNewPercentages(e);
this.props.onChange(t);
}, CM);
calculateNewPercentages(e) {
let { minimumPaneSizePercentage: t, direction: n, boundingBox: r, splitPercentages: i, splitIndex: a } = this.props, o = this.rootElement.current.parentElement.getBoundingClientRect(), s = EM(e) ? e.changedTouches[0] : e, c;
c = n === "column" ? (s.clientY - o.top) / o.height * 100 : (s.clientX - o.left) / o.width * 100;
let l = SM(r, c, n), u = fM(i.slice(0, a)), d = i[a] + i[a + 1], f = l - u;
f = sk(f, t, d - t);
let p = d - f, m = [...i];
return m[a] = f, m[a + 1] = p, m;
}
bindListeners() {
if (!this.listenersBound) {
let e = this.rootElement.current.ownerDocument;
e.addEventListener("mousemove", this.onMouseMove, !0), e.addEventListener("touchmove", this.onMouseMove, wM), e.addEventListener("mouseup", this.onMouseUp, !0), e.addEventListener("touchend", this.onMouseUp, !0), this.listenersBound = !0;
}
}
unbindListeners() {
if (this.listenersBound && this.rootElement.current) {
let e = this.rootElement.current.ownerDocument;
e.removeEventListener("mousemove", this.onMouseMove, !0), e.removeEventListener("touchmove", this.onMouseMove, wM), e.removeEventListener("mouseup", this.onMouseUp, !0), e.removeEventListener("touchend", this.onMouseUp, !0), this.listenersBound = !1;
}
}
};
function EM(e) {
return e.changedTouches != null;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/util/mosaicUtilities.mjs
var DM = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
Object.defineProperty(e, "__esModule", { value: !0 });
function n(e) {
/* istanbul ignore next */
return typeof e == "object" && !("toString" in e) ? Object.prototype.toString.call(e).slice(8, -1) : e;
}
var r = typeof process == "object" && !0;
function i(e, t) {
if (!e) throw Error(r ? "Invariant failed" : t());
}
e.invariant = i;
var a = Object.prototype.hasOwnProperty, o = Array.prototype.splice, s = Object.prototype.toString;
function c(e) {
return s.call(e).slice(8, -1);
}
var l = Object.assign || (function(e, t) {
return u(t).forEach(function(n) {
a.call(t, n) && (e[n] = t[n]);
}), e;
}), u = typeof Object.getOwnPropertySymbols == "function" ? function(e) {
return Object.keys(e).concat(Object.getOwnPropertySymbols(e));
} : function(e) {
return Object.keys(e);
};
function d(e) {
return Array.isArray(e) ? l(e.constructor(e.length), e) : c(e) === "Map" ? new Map(e) : c(e) === "Set" ? new Set(e) : e && typeof e == "object" ? l(Object.create(Object.getPrototypeOf(e)), e) : e;
}
var f = function() {
function e() {
this.commands = l({}, p), this.update = this.update.bind(this), this.update.extend = this.extend = this.extend.bind(this), this.update.isEquals = function(e, t) {
return e === t;
}, this.update.newContext = function() {
return new e().update;
};
}
return Object.defineProperty(e.prototype, "isEquals", {
get: function() {
return this.update.isEquals;
},
set: function(e) {
this.update.isEquals = e;
},
enumerable: !0,
configurable: !0
}), e.prototype.extend = function(e, t) {
this.commands[e] = t;
}, e.prototype.update = function(e, t) {
var n = this, r = typeof t == "function" ? { $apply: t } : t;
Array.isArray(e) && Array.isArray(r) || i(!Array.isArray(r), function() {
return "update(): You provided an invalid spec to update(). The spec may not contain an array except as the value of $set, $push, $unshift, $splice or any custom command allowing an array value.";
}), i(typeof r == "object" && !!r, function() {
return "update(): You provided an invalid spec to update(). The spec and every included key path must be plain objects containing one of the " + ("following commands: " + Object.keys(n.commands).join(", ") + ".");
});
var o = e;
return u(r).forEach(function(t) {
if (a.call(n.commands, t)) {
var i = e === o;
o = n.commands[t](r[t], o, r, e), i && n.isEquals(o, e) && (o = e);
} else {
var s = c(e) === "Map" ? n.update(e.get(t), r[t]) : n.update(e[t], r[t]), l = c(o) === "Map" ? o.get(t) : o[t];
(!n.isEquals(s, l) || s === void 0 && !a.call(e, t)) && (o === e && (o = d(e)), c(o) === "Map" ? o.set(t, s) : o[t] = s);
}
}), o;
}, e;
}();
e.Context = f;
var p = {
$push: function(e, t, n) {
return h(t, n, "$push"), e.length ? t.concat(e) : t;
},
$unshift: function(e, t, n) {
return h(t, n, "$unshift"), e.length ? e.concat(t) : t;
},
$splice: function(e, t, n, r) {
return _(t, n), e.forEach(function(e) {
v(e), t === r && e.length && (t = d(r)), o.apply(t, e);
}), t;
},
$set: function(e, t, n) {
return b(n), e;
},
$toggle: function(e, t) {
g(e, "$toggle");
var n = e.length ? d(t) : t;
return e.forEach(function(e) {
n[e] = !t[e];
}), n;
},
$unset: function(e, t, n, r) {
return g(e, "$unset"), e.forEach(function(e) {
Object.hasOwnProperty.call(t, e) && (t === r && (t = d(r)), delete t[e]);
}), t;
},
$add: function(e, t, n, r) {
return S(t, "$add"), g(e, "$add"), c(t) === "Map" ? e.forEach(function(e) {
var n = e[0], i = e[1];
t === r && t.get(n) !== i && (t = d(r)), t.set(n, i);
}) : e.forEach(function(e) {
t === r && !t.has(e) && (t = d(r)), t.add(e);
}), t;
},
$remove: function(e, t, n, r) {
return S(t, "$remove"), g(e, "$remove"), e.forEach(function(e) {
t === r && t.has(e) && (t = d(r)), t.delete(e);
}), t;
},
$merge: function(e, t, n, r) {
return x(t, e), u(e).forEach(function(n) {
e[n] !== t[n] && (t === r && (t = d(r)), t[n] = e[n]);
}), t;
},
$apply: function(e, t) {
return y(e), e(t);
}
}, m = new f();
e.isEquals = m.update.isEquals, e.extend = m.extend, e.default = m.update, e.default.default = t.exports = l(e.default, e);
function h(e, t, r) {
i(Array.isArray(e), function() {
return "update(): expected target of " + n(r) + " to be an array; got " + n(e) + ".";
}), g(t[r], r);
}
function g(e, t) {
i(Array.isArray(e), function() {
return "update(): expected spec of " + n(t) + " to be an array; got " + n(e) + ". Did you forget to wrap your parameter in an array?";
});
}
function _(e, t) {
i(Array.isArray(e), function() {
return "Expected $splice target to be an array; got " + n(e);
}), v(t.$splice);
}
function v(e) {
i(Array.isArray(e), function() {
return "update(): expected spec of $splice to be an array of arrays; got " + n(e) + ". Did you forget to wrap your parameters in an array?";
});
}
function y(e) {
i(typeof e == "function", function() {
return "update(): expected spec of $apply to be a function; got " + n(e) + ".";
});
}
function b(e) {
i(Object.keys(e).length === 1, function() {
return "Cannot have more than one key in an object with $set";
});
}
function x(e, t) {
i(t && typeof t == "object", function() {
return "update(): $merge expects a spec of type 'object'; got " + n(t);
}), i(e && typeof e == "object", function() {
return "update(): $merge expects a target of type 'object'; got " + n(e);
});
}
function S(e, t) {
var r = c(e);
i(r === "Map" || r === "Set", function() {
return "update(): " + n(t) + " expects a target of type Set or Map; got " + n(r);
});
}
})))(), 1);
function OM(e, t = "row") {
if (AM(e)) {
let n = FM(t);
return {
type: "split",
direction: t,
children: e.children.map((e) => OM(e, n)),
splitPercentages: e.splitPercentages
};
}
return e;
}
var kM = /* @__PURE__ */ ((e) => (e[e.TOP_LEFT = 1] = "TOP_LEFT", e[e.TOP_RIGHT = 2] = "TOP_RIGHT", e[e.BOTTOM_LEFT = 3] = "BOTTOM_LEFT", e[e.BOTTOM_RIGHT = 4] = "BOTTOM_RIGHT", e))(kM || {});
function AM(e) {
return typeof e == "object" && !!e && "type" in e && e.type === "split";
}
function jM(e) {
return typeof e == "object" && !!e && "tabs" in e && Array.isArray(e.tabs);
}
function MM(e, t) {
return BM(e, NM(t));
}
function NM(e) {
return e.slice(0, -1);
}
function PM(e, t = "row") {
if (e.length === 0) return null;
if (e.length === 1) return e[0];
let n = pj(e), r = [];
for (; n.length > 1;) {
for (; n.length > 0;) if (n.length > 1) {
let e = n.shift(), t = n.shift();
r.push({
type: "split",
direction: "row",
children: [e, t],
splitPercentages: [50, 50]
});
} else r.unshift(n.shift());
n = r, r = [];
}
return OM(n[0], t);
}
function FM(e) {
return e === "row" ? "column" : "row";
}
function IM(e, t) {
let n = e, r = [];
for (; AM(n);) {
let e;
e = n.direction === "row" ? t === 1 || t === 3 ? 0 : n.children.length - 1 : t === 1 || t === 2 ? 0 : n.children.length - 1, r.push(e), n = n.children[e];
}
return r;
}
function LM(e) {
return e == null ? [] : AM(e) ? e.children.flatMap((e) => LM(e)) : jM(e) ? e.tabs : [e];
}
function RM(e) {
if (typeof e != "object" || !e || !("first" in e)) return e;
let t = e;
return {
type: "split",
direction: t.direction,
children: [RM(t.first), RM(t.second)],
splitPercentages: t.splitPercentage === void 0 ? void 0 : [t.splitPercentage, 100 - t.splitPercentage]
};
}
function zM(e) {
if (typeof e != "object" || !e) return e;
if (e.type === "split") {
let t = e.children.map((e) => zM(e)).filter((e) => e !== null);
if (t.length === 0) return null;
if (t.length === 1) return t[0];
let n = [], r = [], i = !0;
for (let a = 0; a < t.length; a++) {
let o = t[a];
if (AM(o) && o.direction === e.direction) {
if (n.push(...o.children), i && e.splitPercentages && o.splitPercentages) {
let t = e.splitPercentages[a], n = o.splitPercentages.map((e) => e * t / 100);
r.push(...n);
} else i = !1;
} else n.push(o), i && e.splitPercentages ? r.push(e.splitPercentages[a]) : i = !1;
}
let a, o = n.length !== t.length, s = e.children.length !== t.length;
if (i && r.length === n.length) a = r;
else if (!o && !s && e.splitPercentages) a = e.splitPercentages;
else if (s && e.splitPercentages) {
let r = [], i = 0;
for (let n = 0; n < t.length; n++) {
let a = t[n], o = e.children.findIndex((e) => zM(e) === a);
o >= 0 && e.splitPercentages[o] ? (r.push(e.splitPercentages[o]), i += e.splitPercentages[o]) : r.push(0);
}
if (i > 0) a = r.map((e) => e / i * 100);
else {
let e = 100 / n.length;
a = Array(n.length).fill(e);
}
} else {
let e = 100 / n.length;
a = Array(n.length).fill(e);
}
return {
...e,
children: n,
splitPercentages: a
};
}
if (e.type === "tabs") {
let t = e.tabs;
if (t.length === 0) return null;
if (t.length === 1) return t[0];
let n = Math.max(0, Math.min(e.activeTabIndex, t.length - 1));
return {
...e,
activeTabIndex: n
};
}
return e;
}
function BM(e, t) {
if (!e) return null;
let n = e;
for (let e of t) {
if (typeof n != "object" || !n) return null;
if ("type" in n) switch (n.type) {
case "split":
n = n.children[e] ?? null;
break;
case "tabs":
n = n.tabs[e] ?? null;
break;
default: return null;
}
else return null;
}
return n;
}
function VM(e, t) {
if (e == null) throw Error("Root is empty, cannot fetch path");
let n = BM(e, t);
if (n == null) throw Error(`Path [${t.join(", ")}] did not resolve to a node`);
return n;
}
function HM(e, t) {
if (t.length === 0 || e == null) return null;
let n = t.slice(0, -1), r = t[t.length - 1], i = typeof r == "number" ? r : Number(r);
if (!Number.isInteger(i) || i < 0) return null;
let a = BM(e, n);
return a ? AM(a) ? i >= a.children.length ? null : {
parent: a,
childIndex: i
} : jM(a) ? i >= a.tabs.length ? null : {
parent: a,
childIndex: i
} : null : null;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/types.mjs
var UM = { WINDOW: "MosaicWindow" }, WM = {
TOP: "top",
BOTTOM: "bottom",
LEFT: "left",
RIGHT: "right"
};
//#endregion
//#region node_modules/react-mosaic-component/lib/util/mosaicUpdates.mjs
function GM(e, t, n) {
return t.reduceRight((n, r, i) => {
let a = BM(e, t.slice(0, i)), o = "children";
return a && typeof a == "object" && "type" in a && a.type === "tabs" && (o = "tabs"), { [o]: { [r]: n } };
}, n);
}
function KM(e, t) {
if (t.length === 0) return e;
let n = e;
for (let { path: e, spec: r } of t) if (e.length === 0) n = (0, DM.default)(n, r);
else {
let t = GM(n, e, r);
n = (0, DM.default)(n, t);
}
return n;
}
function qM(e, t) {
if (t.length === 0) throw Error("Cannot remove root node");
let n = HM(e, t);
if (!n) throw Error("Cannot find parent for removal");
let { parent: r, childIndex: i } = n;
if (AM(r)) {
if (r.children.length === 2) {
let e = +(i === 0), n = r.children[e];
return {
path: oM(t),
spec: { $set: n }
};
}
{
let e = r.children.filter((e, t) => t !== i), n = r.splitPercentages || Array(r.children.length).fill(100 / r.children.length), a = n[i] / e.length, o = n.filter((e, t) => t !== i).map((e) => e + a);
return {
path: oM(t),
spec: {
children: { $set: e },
splitPercentages: { $set: o }
}
};
}
}
if (jM(r)) {
let e = r.tabs.filter((e, t) => t !== i);
if (e.length === 0) throw Error("Cannot remove last tab from tabs node");
let n = r.activeTabIndex;
return i === r.activeTabIndex ? n = i > 0 ? i - 1 : 0 : i < r.activeTabIndex && (n = r.activeTabIndex - 1), {
path: oM(t),
spec: {
tabs: { $set: e },
activeTabIndex: { $set: n }
}
};
}
throw Error("Invalid parent node type for removal");
}
function JM(e, t, n, r) {
if (lM(t, n)) return [];
let i = VM(e, n), a = VM(e, t);
switch (r.type) {
case "tab-container":
case "tab-reorder": {
if (!jM(i)) throw Error(`Expected tab container at destination path ${n.join(", ")}, but found: ${JSON.stringify(i)}`);
let o = [];
o.push(qM(e, t));
let s = YM(t, n), c = KM(e, o), l = BM(c, s);
if (!l || !jM(l)) {
let e = function(t, n = []) {
if (t && typeof t == "object") {
if (jM(t) && jM(i) && t.tabs && JSON.stringify(t.tabs) === JSON.stringify(i.tabs)) return {
node: t,
path: n
};
if (AM(t)) for (let r = 0; r < t.children.length; r++) {
let i = e(t.children[r], [...n, r]);
if (i) return i;
}
}
return null;
}, t = e(c);
t && (s = t.path, l = t.node);
}
if (!l || !jM(l)) throw Error(`Could not find tabs container after removal. Original path: ${n.join(", ")}, Adjusted path: ${s.join(", ")}`);
if (r.type === "tab-reorder") {
let e = [...l.tabs];
e.splice(r.insertIndex, 0, a), o.push({
path: s,
spec: {
tabs: { $set: e },
activeTabIndex: { $set: r.insertIndex }
}
});
} else o.push({
path: s,
spec: {
tabs: { $push: [a] },
activeTabIndex: { $set: l.tabs.length }
}
});
return o;
}
case "split": {
let i = [];
i.push(qM(e, t));
let o = YM(t, n), s = KM(e, i), c = BM(s, o);
if (!c) {
for (let e = o.length - 1; e >= 0; e--) {
let t = o.slice(0, e), n = BM(s, t);
if (n) {
o = t, c = n;
break;
}
}
c ||= (o = [], s);
}
if (!c) throw console.error("Could not find valid destination after removing source from:", t, "original destination was:", n), Error(`Could not find valid destination after removing source from [${t.join(", ")}]`);
let l = "column";
if ((r.position === WM.LEFT || r.position === WM.RIGHT) && (l = "row"), AM(c) && c.direction === l) {
let e = r.position === WM.LEFT || r.position === WM.TOP ? 0 : c.children.length;
i.push(QM(o, a, e));
} else {
let e, t;
r.position === WM.LEFT || r.position === WM.TOP ? (e = a, t = c) : (e = c, t = a), i.push({
path: o,
spec: { $set: {
type: "split",
direction: l,
children: [e, t],
splitPercentages: [50, 50]
} }
});
}
return i;
}
default: _M(r);
}
}
function YM(e, t) {
if (e.length === 0 || t.length === 0) return t;
if (lM(e, t)) return [];
if (!lM(e.slice(0, -1), t.slice(0, -1))) return t;
let n = e[e.length - 1], r = t[t.length - 1];
if (typeof n == "number" && typeof r == "number" && r > n) {
let e = [...t];
return e[e.length - 1] = r - 1, e;
}
return t;
}
function XM(e, t) {
if (t.length === 0) throw Error("Cannot hide root node");
let n = HM(e, t);
if (!n) throw Error("Cannot hide node: parent not found");
let { parent: r, childIndex: i } = n;
if (AM(r)) {
let e = r.splitPercentages || Array(r.children.length).fill(100 / r.children.length), n = e[i], a = e.map((e, t) => t).filter((e) => e !== i);
if (a.length === 0) throw Error("Cannot hide the only child of a split node");
let o = n / a.length, s = e.map((e, t) => t === i ? 0 : e + o);
return {
path: oM(t),
spec: { splitPercentages: { $set: s } }
};
}
if (jM(r)) {
if (r.tabs.length <= 1) throw Error("Cannot hide the only tab in a tab container");
let e = r.activeTabIndex;
return i === r.activeTabIndex && (e = i > 0 ? i - 1 : i + 1), {
path: oM(t),
spec: { activeTabIndex: { $set: e } }
};
}
throw Error("Cannot hide node: parent is not a split or tabs node");
}
function ZM(e, t) {
let n = {};
for (let r = e.length - 1; r >= 0; r--) {
let i = typeof e[r] == "number" ? e[r] : Number(e[r]);
n = {
splitPercentages: { $apply: (e) => {
if (!e) throw Error("Cannot expand: parent node has no splitPercentages defined");
let n = [...e], r = t, a = n.length - 1;
if (a === 0) return [100];
let o = (100 - r) / a;
for (let e = 0; e < n.length; e++) e === i ? n[e] = r : n[e] = o;
return n;
} },
children: { [i]: n }
};
}
return {
spec: n,
path: []
};
}
function QM(e, t, n) {
return {
path: e,
spec: {
children: { $apply: (e) => {
let r = [...e], i = n === void 0 ? r.length : n;
return r.splice(i, 0, t), r;
} },
splitPercentages: { $apply: (e) => {
let t = (e ? e.length : 0) + 1, n = 100 / t;
return Array(t).fill(n);
} }
}
};
}
//#endregion
//#region node_modules/react-mosaic-component/lib/util/OptionalBlueprint.mjs
var $M;
((e) => {
e.Icon = ({ icon: e, className: t, size: r = "standard" }) => {
let { blueprintNamespace: i } = N.useContext(hM);
return /* @__PURE__ */ N.createElement("span", { className: (0, G.default)(t, n(i, e), {
[`${i}-icon`]: r === "empty",
[`${i}-icon-${r}`]: r !== "empty"
}) });
};
function t(e, ...t) {
return t.map((t) => `${e}-${uM(t)}`).join(" ");
}
e.getClasses = t;
function n(e, t) {
return `${e}-icon-${uM(t)}`;
}
e.getIconClass = n;
})($M ||= {});
//#endregion
//#region node_modules/react-mosaic-component/lib/DraggableTab.mjs
var eN = ({ tabKey: e, tabIndex: t, tabContainerPath: n, mosaicActions: r, mosaicId: i, children: a }) => {
let o = n.concat(t), [{ isDragging: s }, c, l] = uC({
type: UM.WINDOW,
item: () => (r.hide(o, !0), {
mosaicId: i,
isTab: !0,
tabIndex: t,
tabKey: e,
tabContainerPath: n
}),
end: (i, a) => {
let s = a.getDropResult(), c = a.didDrop(), l = o, u = s?.tabReorderIndex, d = u !== void 0 && s?.path && lM(s.path, n), f = u !== void 0 && s?.path && !lM(s.path, n), p = s?.path && lM(s.path, n) && u === void 0, m = s?.path && s.path.length > l.length && lM(s.path.slice(0, l.length), l);
if (!c || !s || m) {
r.show(l, !0);
return;
}
if (d) {
let e = BM(r.getRoot(), n);
if (e && jM(e)) {
let i = [...e.tabs], a = e.activeTabIndex, [o] = i.splice(t, 1), s = t < u ? u - 1 : u;
i.splice(s, 0, o);
let c = a;
t === a ? c = s : t < a && s >= a ? c = a - 1 : t > a && s <= a && (c = a + 1), r.updateTree([{
path: n,
spec: {
tabs: { $set: i },
activeTabIndex: { $set: c }
}
}]);
} else console.warn("Could not find tabs node at path:", n);
return;
}
if (f) {
let i = r.getRoot(), a = BM(i, s.path);
if (a && jM(a)) {
let o = BM(i, n), c = [...o.tabs];
c.splice(t, 1);
let l = [{
path: n,
spec: {
tabs: { $set: c },
activeTabIndex: { $set: Math.max(0, Math.min(t, o.tabs.length - 2)) }
}
}], d = [...a.tabs];
d.splice(u, 0, e);
let f = [{
path: s.path,
spec: {
tabs: { $set: d },
activeTabIndex: { $set: u }
}
}];
r.updateTree([...l, ...f]);
} else console.warn("Could not find destination tabs node at path:", s.path);
return;
}
if (p || s.path === void 0) {
r.show(l, !0);
return;
}
let h = JM(r.getRoot(), l, s.path, s.position === void 0 ? { type: "tab-container" } : {
type: "split",
position: s.position
});
r.updateTree(h, { shouldNormalize: !0 });
},
collect: (e) => ({ isDragging: e.isDragging() })
});
return a({
isDragging: s,
connectDragSource: c,
connectDragPreview: l
});
}, tN = ({ title: e, className: t, onClick: n, text: r }) => {
let { blueprintNamespace: i } = P.useContext(hM);
return /* @__PURE__ */ P.createElement("button", {
title: e,
onClick: n,
className: (0, G.default)("mosaic-default-control", $M.getClasses(i, "BUTTON", "MINIMAL", "SMALL"), t)
}, r && /* @__PURE__ */ P.createElement("span", { className: "control-text" }, r));
}, nN = class extends P.PureComponent {
static contextType = gM;
render() {
return /* @__PURE__ */ P.createElement(hM.Consumer, null, ({ mosaicActions: e }) => /* @__PURE__ */ P.createElement(tN, {
title: "Expand",
className: (0, G.default)("expand-button", $M.getIconClass(this.context.blueprintNamespace, "MAXIMIZE")),
onClick: this.createExpand(e)
}));
}
createExpand(e) {
return () => {
e.expand(this.context.mosaicWindowActions.getPath()), this.props.onClick && this.props.onClick();
};
}
}, rN = class extends P.PureComponent {
static contextType = gM;
render() {
return /* @__PURE__ */ P.createElement(hM.Consumer, null, ({ mosaicActions: e, blueprintNamespace: t }) => /* @__PURE__ */ P.createElement(tN, {
title: "Close Window",
className: (0, G.default)("close-button", $M.getIconClass(t, "CROSS")),
onClick: this.createRemove(e)
}));
}
createRemove(e) {
return () => {
e.remove(this.context.mosaicWindowActions.getPath()), this.props.onClick && this.props.onClick();
};
}
}, iN = class extends P.PureComponent {
static contextType = gM;
render() {
return /* @__PURE__ */ P.createElement(tN, {
title: "Replace Window",
className: (0, G.default)("replace-button", $M.getIconClass(this.context.blueprintNamespace, "EXCHANGE")),
onClick: this.replace
});
}
replace = () => {
this.context.mosaicWindowActions.replaceWithNew().then(() => {
this.props.onClick && this.props.onClick();
}).catch(eE);
};
}, aN = class extends P.PureComponent {
static contextType = gM;
render() {
return /* @__PURE__ */ P.createElement(tN, {
title: "Split Window",
className: (0, G.default)("split-button", $M.getIconClass(this.context.blueprintNamespace, "SPLIT_COLUMNS")),
onClick: this.split
});
}
split = () => {
this.context.mosaicWindowActions.split().then(() => {
this.props.onClick && this.props.onClick();
}).catch(eE);
};
}, oN = class extends P.PureComponent {
static contextType = gM;
render() {
return /* @__PURE__ */ P.createElement(tN, {
title: "Add Tab",
className: (0, G.default)("add-tab-button", $M.getIconClass(this.context.blueprintNamespace, "ADD_COLUMN_RIGHT")),
onClick: this.addTab
});
}
addTab = () => {
this.context.mosaicWindowActions.addTab().then(() => {
this.props.onClick && this.props.onClick();
}).catch(eE);
};
}, sN = class extends P.PureComponent {
static contextType = hM;
render() {
return /* @__PURE__ */ P.createElement(tN, {
title: "Split Tab Group",
className: (0, G.default)("split-button", $M.getIconClass(this.context.blueprintNamespace, "SPLIT_COLUMNS")),
onClick: this.split
});
}
split = () => {
let { mosaicActions: e } = this.context, { path: t } = this.props;
if (e.createNode == null) {
console.error("Operation invalid unless `createNode` is defined on Mosaic");
return;
}
Promise.resolve(e.createNode()).then((n) => {
if (!n) return;
let r = this.getCurrentTabsNode();
if (!r) return;
let i = {
type: "split",
direction: "row",
splitPercentages: [50, 50],
children: [r, n]
};
e.replaceWith(t, i), this.props.onClick && this.props.onClick();
}).catch(eE);
};
getCurrentTabsNode = () => {
let e = this.context.mosaicActions.getRoot();
if (!e) return null;
let t = e;
for (let e of this.props.path) if (typeof t == "object" && "children" in t) t = t.children[e];
else return null;
return t;
};
}, cN = class extends P.PureComponent {
static contextType = hM;
render() {
return /* @__PURE__ */ P.createElement(tN, {
title: "Close Tab Group",
className: (0, G.default)("close-button", $M.getIconClass(this.context.blueprintNamespace, "CROSS")),
onClick: this.remove
});
}
remove = () => {
let { mosaicActions: e } = this.context, { path: t } = this.props;
e.remove(t), this.props.onClick && this.props.onClick();
};
}, lN = class extends P.PureComponent {
static contextType = hM;
render() {
return this.props.connectDragSource(/* @__PURE__ */ P.createElement("button", {
title: "Drag to move",
className: (0, G.default)("mosaic-default-control", "mosaic-tab-drag-button", $M.getClasses(this.context.blueprintNamespace, "BUTTON", "MINIMAL", "SMALL"), $M.getIconClass(this.context.blueprintNamespace, "DRAG_HANDLE_VERTICAL"))
}));
}
}, uN = ({ path: e, className: t, title: n = "Add new tab", ariaLabel: r = "Add new tab", children: i = "+" }) => {
let { mosaicActions: a } = P.useContext(hM);
return /* @__PURE__ */ P.createElement("button", {
className: (0, G.default)("mosaic-tab-add-button", t),
onClick: () => {
a.addTab(e).catch((e) => console.error(e));
},
"aria-label": r,
title: n
}, i);
}, dN = P.Children.toArray([/* @__PURE__ */ P.createElement(rN, null)]), fN = (e, t) => P.Children.toArray([
...t ? [/* @__PURE__ */ P.createElement(lN, {
connectDragSource: t,
key: "tab-drag-btn"
})] : [],
/* @__PURE__ */ P.createElement(uN, {
path: e,
key: "tab-add-btn"
}),
/* @__PURE__ */ P.createElement(sN, {
path: e,
key: "tab-split-btn"
}),
/* @__PURE__ */ P.createElement(cN, {
path: e,
key: "tab-remove-btn"
})
]), pN = P.Children.toArray([
/* @__PURE__ */ P.createElement(iN, { key: "replace-btn" }),
/* @__PURE__ */ P.createElement(aN, { key: "split-btn" }),
/* @__PURE__ */ P.createElement(oN, { key: "add-tab-btn" }),
/* @__PURE__ */ P.createElement(nN, { key: "expand-btn" }),
/* @__PURE__ */ P.createElement(rN, { key: "remove-btn" })
]), mN = P.Children.toArray([/* @__PURE__ */ P.createElement(nN, { key: "expand-btn" }), /* @__PURE__ */ P.createElement(rN, { key: "remove-btn" })]), hN = ({ tabKey: e, index: t, isActive: n, path: r, mosaicId: i, onTabClick: a, mosaicActions: o, renderTabTitle: s = ({ tabKey: e }) => `Tab ${e}`, canClose: c = () => "canClose", onTabClose: l, tabs: u }) => {
let d = (n) => {
n.stopPropagation(), l?.(e, t);
}, f = c(e, u, t, r);
return /* @__PURE__ */ P.createElement(eN, {
tabKey: e,
tabIndex: t,
tabContainerPath: r,
mosaicActions: o,
mosaicId: i
}, ({ isDragging: o, connectDragSource: c, connectDragPreview: l }) => /* @__PURE__ */ P.createElement("button", {
className: (0, G.default)("mosaic-tab-button", {
"-active": n,
"-dragging": o
}),
onClick: a,
title: `${e}`,
ref: (e) => {
c(e), l(e);
}
}, /* @__PURE__ */ P.createElement("span", { className: "mosaic-tab-button-content" }, s({
tabKey: e,
path: r,
isActive: n,
index: t,
mosaicId: i
})), f !== "noClose" && /* @__PURE__ */ P.createElement("span", {
className: (0, G.default)("mosaic-tab-close-button", {
"-can-close": f === "canClose",
"-cannot-close": f === "cannotClose",
"-active-tab": n,
"-inactive-tab": !n
}),
onClick: f === "canClose" ? d : void 0,
title: f === "canClose" ? "Close tab" : "Cannot close tab"
}, /* @__PURE__ */ P.createElement($M.Icon, {
size: "empty",
icon: "CROSS"
}))));
}, gN = ({ tabContainerPath: e, insertIndex: t }) => {
let [{ isOver: n, canDrop: r, draggedMosaicId: i }, a] = vC({
accept: UM.WINDOW,
canDrop: (t) => {
let n = t?.isTab && t?.tabContainerPath && lM(t.tabContainerPath, e), r = !t?.isTab || !lM(t.tabContainerPath, e);
return n || r;
},
drop: () => ({
path: e,
position: void 0,
tabReorderIndex: t
}),
hover: () => {},
collect: (e) => ({
isOver: e.isOver(),
canDrop: e.canDrop(),
draggedMosaicId: e.getItem()?.mosaicId
})
}), o = i != null;
return a(/* @__PURE__ */ P.createElement("div", { className: (0, G.default)("tab-drop-target", {
"tab-drop-target-hover": n,
dragging: o
}) }, n ? /* @__PURE__ */ P.createElement("div", { className: "tab-drop-placeholder" }, /* @__PURE__ */ P.createElement("div", { className: "tab-drop-arrow" }), "``") : /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("tab-drop-indicator", {
"can-drop": r,
default: !r
}) })));
}, _N = ({ node: e, path: t, renderTile: n, renderTabToolbar: r, boundingBox: i, renderTabTitle: a, renderTabButton: o, renderTabToolbarControls: s, canClose: c, showTabDragButton: l }) => {
let { mosaicActions: u, mosaicId: d } = P.useContext(hM), { tabs: f, activeTabIndex: p } = e, [, m, h] = uC({
type: UM.WINDOW,
item: () => {
let e = iM(() => u.hide(t));
return {
mosaicId: d,
hideTimer: e
};
},
end: ({ hideTimer: e }, n) => {
window.clearTimeout(e);
let r = t, i = n.getDropResult() || {}, { position: a, path: o } = i, s = o != null, c = s && lM(o, r), l = s && jM(BM(u.getRoot(), o)) && lM(r, o), d = s && o.length > r.length && lM(r, aM(o, o.length - r.length));
if (s && !c && !d && !l) {
let e = JM(u.getRoot(), r, o, i.tabReorderIndex === void 0 ? a === void 0 ? { type: "tab-container" } : {
type: "split",
position: a
} : {
type: "tab-reorder",
insertIndex: i.tabReorderIndex
});
u.updateTree(e, { shouldNormalize: !0 });
} else u.show(r, !0);
}
}), [, g] = vC({
accept: UM.WINDOW,
canDrop: () => !1,
collect: (e) => ({
isOver: e.isOver({ shallow: !0 }),
draggedMosaicId: e.getItem()?.mosaicId
})
}), [{ isOver: _, draggedMosaicId: v }, y] = vC({
accept: UM.WINDOW,
canDrop: (e, t) => t.isOver({ shallow: !0 }),
drop: () => ({
path: t,
position: void 0
}),
collect: (e) => ({
isOver: e.isOver({ shallow: !0 }),
draggedMosaicId: e.getItem()?.mosaicId
})
}), b = (e) => {
e !== p && u.updateTree([{
path: t,
spec: { activeTabIndex: { $set: e } }
}]);
}, x = (e, n) => {
(c ? c(e, f, n, t) : "noClose") === "canClose" && (f.length <= 1 || u.removeTab(t, n));
}, S = () => {
let e = t.length > 0, n = {
tabs: f,
activeTabIndex: p,
path: t,
mosaicId: d
}, r = e && (!l || l(t)), i = r && s !== void 0 ? /* @__PURE__ */ P.createElement(lN, { connectDragSource: m }) : null, h = s ? s(n) : fN(t, r ? m : void 0);
return y(/* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-tab-bar", {
"tab-bar-drop-target-hover": _ && v === d,
draggable: e
}) }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar-tabs" }, /* @__PURE__ */ P.createElement(gN, {
tabContainerPath: t,
insertIndex: 0,
mosaicActions: u,
mosaicId: d
}), f.map((e, n) => {
let r = o || hN;
return /* @__PURE__ */ P.createElement(P.Fragment, { key: e }, /* @__PURE__ */ P.createElement(r, {
tabKey: e,
index: n,
isActive: n === p,
path: t,
mosaicId: d,
onTabClick: () => b(n),
mosaicActions: u,
renderTabTitle: a,
canClose: c,
onTabClose: x,
tabs: f
}), /* @__PURE__ */ P.createElement(gN, {
tabContainerPath: t,
insertIndex: n + 1,
mosaicActions: u,
mosaicId: d
}));
})), /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar-controls" }, i, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-toolbar-controls" }, h))));
}, C = f[p], w = t.concat(p);
return /* @__PURE__ */ P.createElement("div", {
className: "mosaic-tabs-container",
style: bM(i)
}, r ? r({
tabs: f,
activeTabIndex: p,
path: t,
DraggableTab: (e) => /* @__PURE__ */ P.createElement(eN, {
key: e.tabKey,
...e,
tabContainerPath: t,
mosaicActions: u,
mosaicId: d
})
}) : S(), g(/* @__PURE__ */ P.createElement("div", { className: "mosaic-tile" }, n(C, w))), h(/* @__PURE__ */ P.createElement("div", { className: "mosaic-preview" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-tab-bar-tabs" }, f.map((e, n) => /* @__PURE__ */ P.createElement("button", {
key: e,
className: (0, G.default)("mosaic-tab-button", { "-active": n === p })
}, /* @__PURE__ */ P.createElement("span", { className: "mosaic-tab-button-content" }, a ? a({
tabKey: e,
path: t,
isActive: n === p,
index: n,
mosaicId: d
}) : `Tab ${e}`))))), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-body" }, /* @__PURE__ */ P.createElement("h4", null, "Tab Container"), /* @__PURE__ */ P.createElement($M.Icon, {
className: "default-preview-icon",
size: "large",
icon: "APPLICATION"
})))));
}, vN = class extends P.PureComponent {
static contextType = hM;
render() {
let e = RM(this.props.root);
return e === null ? null : /* @__PURE__ */ P.createElement("div", { className: "mosaic-root" }, this.renderRecursively(e, vM(), []));
}
renderRecursively(e, t, n) {
if (typeof e == "string" || typeof e == "number") return /* @__PURE__ */ P.createElement("div", {
key: e,
className: "mosaic-tile",
style: { ...bM(t) }
}, this.props.renderTile(e, n));
switch (e.type) {
case "split": {
let { children: r, direction: i } = e, a = yM(t, e.splitPercentages ?? r.map(() => 100 / r.length), i), o = sO(r.flatMap((i, o) => {
let s = n.concat(o), c = [this.renderRecursively(i, a[o], s)];
return o < r.length - 1 && c.push(this.renderSplit(e, n, o, t)), c;
})).filter(yN);
return /* @__PURE__ */ P.createElement(P.Fragment, null, o.map((e, t) => P.cloneElement(e, { key: e.key || `${n.join("-")}-${t}` })));
}
case "tabs": return /* @__PURE__ */ P.createElement(_N, {
node: e,
path: n,
renderTile: this.props.renderTile,
renderTabToolbar: this.props.renderTabToolbar,
boundingBox: t,
renderTabTitle: this.props.renderTabTitle,
renderTabButton: this.props.renderTabButton,
showTabDragButton: this.props.showTabDragButton,
renderTabToolbarControls: this.props.renderTabToolbarControls,
canClose: this.props.canClose
});
default: return console.error("Unknown mosaic node type:", e), null;
}
}
renderSplit(e, t, n, r) {
let { resize: i } = this.props;
if (i !== "DISABLED" && e.children.length > 1) {
let { direction: a } = e, o = e.splitPercentages ?? e.children.map(() => 100 / e.children.length);
return /* @__PURE__ */ P.createElement(TM, {
key: `split-${t.join("-")}-${n}`,
...i,
direction: a,
boundingBox: r,
splitIndex: n,
splitPercentages: o,
onChange: (e) => this.onResize(e, t, !0),
onRelease: (e) => this.onResize(e, t, !1)
});
}
return null;
}
onResize = (e, t, n) => {
this.context.mosaicActions.updateTree([{
path: t,
spec: { splitPercentages: { $set: e } }
}], { suppressOnRelease: n });
};
};
function yN(e) {
return e !== null;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/MosaicZeroState.mjs
var bN = class extends P.PureComponent {
static contextType = hM;
render() {
return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-zero-state", $M.getClasses(this.context.blueprintNamespace, "NON_IDEAL_STATE")) }, /* @__PURE__ */ P.createElement("div", { className: $M.getClasses(this.context.blueprintNamespace, "NON_IDEAL_STATE_VISUAL") }, /* @__PURE__ */ P.createElement($M.Icon, {
className: "default-zero-state-icon",
size: "large",
icon: "APPLICATIONS"
})), /* @__PURE__ */ P.createElement("h4", { className: $M.getClasses(this.context.blueprintNamespace, "HEADING") }, "No Windows Present"), /* @__PURE__ */ P.createElement("div", null, this.props.createNode && /* @__PURE__ */ P.createElement("button", {
className: (0, G.default)($M.getClasses(this.context.blueprintNamespace, "BUTTON"), $M.getIconClass(this.context.blueprintNamespace, "ADD")),
onClick: this.replace
}, "Add New Window")));
}
replace = () => Promise.resolve(this.props.createNode()).then((e) => this.context.mosaicActions.replaceWith([], e)).catch(eE);
}, xN = ({ path: e, position: t }) => {
let { mosaicId: n } = P.useContext(hM), [{ isOver: r, draggedMosaicId: i }, a] = vC({
accept: UM.WINDOW,
drop: () => ({
path: e,
position: t
}),
collect: (e) => ({
isOver: e.isOver(),
draggedMosaicId: e.getItem()?.mosaicId
})
});
return a(/* @__PURE__ */ P.createElement("div", { className: (0, G.default)("drop-target", t, { "drop-target-hover": r && i === n }) }));
}, SN = P.memo(() => {
let [{ isDragging: e }] = vC({
accept: UM.WINDOW,
collect: (e) => ({ isDragging: e.getItem() !== null && e.getItemType() === UM.WINDOW })
}), t = CN(e, 0);
return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("drop-target-container", { "-dragging": t }) }, cM(WM).map((e) => /* @__PURE__ */ P.createElement(xN, {
position: e,
path: [],
key: e
})));
});
SN.displayName = "RootDropTargets";
function CN(e, t) {
let n = P.useRef(e), [, r] = P.useState(0), i = (e) => {
n.current = e, r((e) => e + 1);
};
return e || (n.current = !1), P.useEffect(() => {
if (n.current === e || !e) return;
let r = window.setTimeout(() => i(!0), t);
return () => {
window.clearTimeout(r);
};
}, [e]), n.current;
}
//#endregion
//#region node_modules/react-mosaic-component/lib/Mosaic.mjs
var wN = 70;
function TN(e) {
return e.initialValue != null;
}
var EN = class extends P.PureComponent {
static defaultProps = {
onChange: () => void 0,
zeroStateView: /* @__PURE__ */ P.createElement(bN, null),
className: "mosaic-blueprint-theme",
blueprintNamespace: "bp5"
};
static getDerivedStateFromProps(e, t) {
return e.mosaicId && (t.mosaicId, e.mosaicId), TN(e) && e.initialValue !== t.lastInitialValue ? {
lastInitialValue: RM(e.initialValue),
currentNode: RM(e.initialValue)
} : null;
}
state = {
currentNode: null,
lastInitialValue: null,
mosaicId: this.props.mosaicId ?? h()
};
render() {
let { className: e } = this.props;
return /* @__PURE__ */ P.createElement(hM.Provider, { value: this.childContext }, /* @__PURE__ */ P.createElement(DN, { className: e }, this.renderTree(), /* @__PURE__ */ P.createElement(SN, null)));
}
getRoot() {
return TN(this.props) ? this.state.currentNode : RM(this.props.value);
}
updateRoot = (e, t) => {
t = {
shouldNormalize: t?.shouldNormalize ?? !1,
suppressOnRelease: t?.suppressOnRelease ?? !1,
suppressOnChange: t?.suppressOnChange ?? !1
};
let n = this.getRoot() || {}, r = t.shouldNormalize ? zM(KM(n, e)) : KM(n, e);
this.replaceRoot(r, t.suppressOnRelease, t.suppressOnChange);
};
replaceRoot = (e, t = !1, n = !1) => {
n || this.props.onChange(e), !t && this.props.onRelease && this.props.onRelease(e), TN(this.props) && this.setState({ currentNode: e });
};
actions = {
updateTree: this.updateRoot,
remove: (e) => {
e.length === 0 ? this.replaceRoot(null) : this.updateRoot([qM(this.getRoot(), e)], { shouldNormalize: !0 });
},
expand: (e, t = wN) => this.updateRoot([ZM(e, t)]),
getRoot: () => this.getRoot(),
hide: (e, t = !1) => {
this.updateRoot([XM(this.getRoot(), e)], {
suppressOnChange: t,
suppressOnRelease: !0
});
},
show: (e, t = !1) => {
let n = this.getRoot();
if (!n || e.length === 0) return;
let r = HM(n, e);
if (!r) return;
let { parent: i } = r;
if (AM(i)) {
let n = 100 / i.children.length, r = Array(i.children.length).fill(n);
this.updateRoot([{
path: e.slice(0, -1),
spec: { splitPercentages: { $set: r } }
}], {
suppressOnChange: t,
suppressOnRelease: !0
});
}
},
createNode: this.props.createNode,
addTab: (e, ...t) => {
let { createNode: n } = this.props;
return n == null ? Promise.reject(/* @__PURE__ */ Error("addTab requires `createNode` to be defined on Mosaic")) : Promise.resolve(n(...t)).then((t) => {
if (typeof t != "string" && typeof t != "number") {
console.error("createNode() for addTab must return a MosaicKey (string or number).");
return;
}
let n = this.getRoot();
if (!n) return;
let r = BM(n, e);
if (r == null) {
console.error("addTab called on an invalid path.");
return;
}
if (jM(r)) {
this.updateRoot([{
path: e,
spec: {
tabs: { $push: [t] },
activeTabIndex: { $set: r.tabs.length }
}
}], { shouldNormalize: !0 });
return;
}
if (AM(r)) {
console.error("addTab cannot target a split node; pick a leaf or a tabs node.");
return;
}
this.actions.replaceWith(e, {
type: "tabs",
tabs: [r, t],
activeTabIndex: 1
});
});
},
removeTab: (e, t) => {
let n = this.getRoot();
if (!n) return;
let r = BM(n, e);
if (!jM(r)) {
console.error("removeTab called on a path that is not a tabs node.");
return;
}
if (t < 0 || t >= r.tabs.length) {
console.error(`removeTab index ${t} is out of range.`);
return;
}
let i = r.tabs.filter((e, n) => n !== t), a = r.activeTabIndex;
t === r.activeTabIndex ? a = Math.max(0, t - 1) : t < r.activeTabIndex && (a = r.activeTabIndex - 1), this.updateRoot([{
path: e,
spec: {
tabs: { $set: i },
activeTabIndex: { $set: a }
}
}], { shouldNormalize: !0 });
},
replaceWith: (e, t) => this.updateRoot([{
path: e,
spec: { $set: t }
}])
};
childContext = {
mosaicActions: this.actions,
mosaicId: this.state.mosaicId,
blueprintNamespace: this.props.blueprintNamespace
};
renderTree() {
let e = this.getRoot();
if (this.validateTree(e), e == null) return this.props.zeroStateView;
{
let { renderTile: t, resize: n } = this.props;
return /* @__PURE__ */ P.createElement(vN, {
root: e,
renderTile: t,
renderTabToolbar: this.props.renderTabToolbar,
renderTabToolbarControls: this.props.renderTabToolbarControls,
resize: n,
renderTabTitle: this.props.renderTabTitle,
renderTabButton: this.props.renderTabButton,
canClose: this.props.canClose
});
}
}
validateTree(e) {}
};
function DN({ className: e, children: t }) {
let [{ isDragging: n }] = vC({
accept: UM.WINDOW,
collect: (e) => ({ isDragging: e.getItem() !== null && e.getItemType() === UM.WINDOW })
});
return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)(e, "mosaic mosaic-drop-target", { "-dragging": n }) }, t);
}
var ON = class extends P.PureComponent {
render() {
return /* @__PURE__ */ P.createElement(kS, {
backend: RC,
options: Mw,
context: window,
...this.props.dragAndDropManager && { manager: this.props.dragAndDropManager }
}, /* @__PURE__ */ P.createElement(EN, { ...this.props }));
}
}, kN = class extends P.PureComponent {
render() {
return /* @__PURE__ */ P.createElement("div", { className: "separator" });
}
}, AN = class extends P.Component {
static defaultProps = {
additionalControlButtonText: "More",
draggable: !0,
renderPreview: ({ title: e }) => /* @__PURE__ */ P.createElement("div", { className: "mosaic-preview" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-toolbar" }, /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-title" }, e)), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-body" }, /* @__PURE__ */ P.createElement("h4", null, e), /* @__PURE__ */ P.createElement($M.Icon, {
className: "default-preview-icon",
size: "large",
icon: "APPLICATION"
}))),
renderToolbar: null
};
static contextType = hM;
state = { additionalControlsOpen: !1 };
rootElement = wn();
render() {
let { className: e, isOver: t, renderPreview: n, additionalControls: r, connectDropTarget: i, connectDragPreview: a, draggedMosaicId: o, disableAdditionalControlsOverlay: s } = this.props, c = jM(MM(this.context.mosaicActions.getRoot(), this.props.path));
return /* @__PURE__ */ P.createElement(gM.Provider, { value: this.childContext }, /* @__PURE__ */ P.createElement("div", {
className: (0, G.default)("mosaic-window", "mosaic-drop-target", e, {
"drop-target-hover": t && o === this.context.mosaicId,
"additional-controls-open": this.state.additionalControlsOpen
}),
ref: (e) => {
this.rootElement.current = e, i(e);
}
}, this.renderToolbar(), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-body" }, this.props.children), !s && /* @__PURE__ */ P.createElement("div", {
className: "mosaic-window-body-overlay",
onClick: () => {
this.setAdditionalControlsOpen(!1);
}
}), /* @__PURE__ */ P.createElement("div", { className: "mosaic-window-additional-actions-bar" }, r), a(n(this.props)), !c && /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("drop-target-container", {}) }, cM(WM).map(this.renderDropTarget))));
}
getToolbarControls() {
let { toolbarControls: e, createNode: t, path: n } = this.props;
return e || (jM(MM(this.context.mosaicActions.getRoot(), n)) ? dN : t ? pN : mN);
}
renderToolbar() {
let { title: e, draggable: t, additionalControls: n, additionalControlButtonText: r, path: i, renderToolbar: a } = this.props, { additionalControlsOpen: o } = this.state, s = this.getToolbarControls(), c = MM(this.context.mosaicActions.getRoot(), i), l = t && i.length > 0 && !jM(c), u = l ? this.props.connectDragSource : (e) => e;
if (a) {
let e = u(a(this.props, t));
return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-window-toolbar", { draggable: l }) }, e);
}
let d = u(/* @__PURE__ */ P.createElement("div", {
title: e,
className: "mosaic-window-title"
}, e)), f = !!n;
return /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-window-toolbar", { draggable: l }) }, d, /* @__PURE__ */ P.createElement("div", { className: (0, G.default)("mosaic-window-controls", $M.getClasses("BUTTON_GROUP")) }, f && /* @__PURE__ */ P.createElement("button", {
onClick: () => this.setAdditionalControlsOpen(!o),
className: (0, G.default)($M.getClasses(this.context.blueprintNamespace, "BUTTON", "MINIMAL"), $M.getIconClass(this.context.blueprintNamespace, "MORE"), { [$M.getClasses(this.context.blueprintNamespace, "ACTIVE")]: o })
}, /* @__PURE__ */ P.createElement("span", { className: "control-text" }, r)), f && /* @__PURE__ */ P.createElement(kN, null), s));
}
renderDropTarget = (e) => {
let { path: t } = this.props;
return /* @__PURE__ */ P.createElement(xN, {
position: e,
path: t,
key: e
});
};
checkCreateNode() {
if (this.props.createNode == null) throw Error("Operation invalid unless `createNode` is defined");
}
split = (...e) => {
this.checkCreateNode();
let { path: t } = this.props, { mosaicActions: n } = this.context, r = n.getRoot();
if (jM(MM(r, t))) return Promise.resolve();
let i = this.rootElement.current && this.rootElement.current.offsetWidth > this.rootElement.current.offsetHeight ? "row" : "column", a = BM(r, t);
if (!a) throw Error("Current node could not be found.");
return Promise.resolve(n.createNode(...e)).then((e) => {
let r = {
type: "split",
direction: i,
children: [a, e],
splitPercentages: [50, 50]
};
n.replaceWith(t, r);
});
};
addTab = (...e) => {
this.checkCreateNode();
let { path: t } = this.props, { mosaicActions: n } = this.context, r = jM(MM(n.getRoot(), t)) ? t.slice(0, -1) : t;
return n.addTab(r, ...e);
};
getRoot = () => {
let { mosaicActions: e } = this.context;
return e.getRoot();
};
swap = (...e) => {
this.checkCreateNode();
let { mosaicActions: t } = this.context, { path: n, createNode: r } = this.props;
return Promise.resolve(r(...e)).then((e) => t.replaceWith(n, e));
};
setAdditionalControlsOpen = (e) => {
let t = e === "toggle" ? !this.state.additionalControlsOpen : e;
this.setState({ additionalControlsOpen: t }), this.props.onAdditionalControlsToggle?.(t);
};
getPath = () => this.props.path;
connectDragSource = (e) => {
let { connectDragSource: t } = this.props;
return t(e);
};
childContext = {
blueprintNamespace: this.context.blueprintNamespace,
mosaicWindowActions: {
split: this.split,
addTab: this.addTab,
getRoot: this.getRoot,
replaceWithNew: this.swap,
setAdditionalControlsOpen: this.setAdditionalControlsOpen,
getPath: this.getPath,
connectDragSource: this.connectDragSource
}
};
};
function jN(e) {
let { mosaicActions: t, mosaicId: n } = An(hM), [, r, i] = uC({
type: UM.WINDOW,
item: () => {
e.onDragStart && e.onDragStart();
let r = iM(() => t.hide(e.path));
return {
mosaicId: n,
hideTimer: r
};
},
end: ({ hideTimer: n }, r) => {
window.clearTimeout(n);
let i = e.path, a = r.getDropResult() || {}, { position: o, path: s } = a, c = s != null, l = c && lM(s, i), u = c && (() => {
let e = t.getRoot(), n = i.slice(0, -1), r = BM(e, n), a = BM(e, s);
return jM(r) && jM(a) && lM(n, s);
})(), d = c && s.length > i.length && lM(i, aM(s, s.length - i.length));
if (c && !l && !d && !u) {
let n = JM(t.getRoot(), i, s, a.tabReorderIndex === void 0 ? o === void 0 ? { type: "tab-container" } : {
type: "split",
position: o
} : {
type: "tab-reorder",
insertIndex: a.tabReorderIndex
});
t.updateTree(n, { shouldNormalize: !0 }), e.onDragEnd && e.onDragEnd("drop");
} else t.show(i, !0), e.onDragEnd && e.onDragEnd("reset");
}
}), [{ isOver: a, draggedMosaicId: o }, s] = vC({
accept: UM.WINDOW,
collect: (e) => ({
isOver: e.isOver(),
draggedMosaicId: e.getItem()?.mosaicId
})
});
return /* @__PURE__ */ P.createElement(AN, {
...e,
connectDragPreview: i,
connectDragSource: r,
connectDropTarget: s,
isOver: a,
draggedMosaicId: o
});
}
var MN = class extends P.PureComponent {
render() {
return /* @__PURE__ */ P.createElement(jN, { ...this.props });
}
}, NN = M(/*#__PURE__*/ z("path", { d: "M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z" }), "MenuSharp"), PN = M(/*#__PURE__*/ z("path", { d: "M21 3H3v18h18zm-2 16H5V5h14z" }), "CropDinSharp");
//#endregion
//#region src/components/icons/ThumbnailNavigationBottomIcon.jsx
function FN(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: [/* @__PURE__ */ z("path", {
d: "M3,3H21V5H3Z",
transform: "translate(0 16)"
}), /* @__PURE__ */ z("path", {
d: "M21,5H3V19H21ZM19,17H5V7H19Z",
transform: "translate(0 -2)"
})]
})
});
}
//#endregion
//#region src/components/icons/ThumbnailNavigationRightIcon.jsx
function IN(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: [
/* @__PURE__ */ z("path", {
d: "M0,0H24V24H0Z",
transform: "translate(24) rotate(90)",
fill: "none"
}),
/* @__PURE__ */ z("path", {
d: "M3,3H21V5H3Z",
transform: "translate(24) rotate(90)"
}),
/* @__PURE__ */ z("path", {
d: "M19,3H5V21H19ZM17,19H7V5H17Z",
transform: "translate(-2)"
})
]
})
});
}
//#endregion
//#region src/components/WindowThumbnailSettings.jsx
var LN = H(Jn, {
name: "WindowThumbnailSettings",
slot: "option"
})(({ selected: e, theme: t }) => ({ "& .MuiFormControlLabel-label": {
borderBottom: "2px solid transparent",
...e && { borderBottomColor: t.palette.secondary.main },
"&.Mui-selected": { backgroundColor: "transparent !important" },
"&.Mui-selected.Mui-focusVisible": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
"&:focused": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
color: e ? t.palette.secondary.main : void 0,
display: "inline-flex"
} })), RN = H(qn, {
name: "WindowViewSettings",
slot: "option"
})(() => ({ display: "inline-flex" }));
function zN({ handleClose: e = () => {}, thumbnailNavigationPosition: t, direction: n, windowId: r, setWindowThumbnailPosition: i }) {
let { t: a } = V(), o = (t) => {
i(r, t), e();
};
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Er, {
role: "presentation",
disableSticky: !0,
children: a("thumbnails")
}), /* @__PURE__ */ B(RN, {
role: "menubar",
children: [
/* @__PURE__ */ z(LN, {
"aria-checked": t === "off",
onClick: () => {
o("off");
},
role: "menuitemradio",
selected: t === "off",
children: /* @__PURE__ */ z(Or, {
control: /* @__PURE__ */ z(PN, {
color: t === "off" ? "secondary" : void 0,
fill: "currentcolor"
}),
label: a("off"),
labelPlacement: "bottom",
value: "off"
})
}, "off"),
/* @__PURE__ */ z(LN, {
"aria-checked": t === "far-bottom",
onClick: () => {
o("far-bottom");
},
role: "menuitemradio",
selected: t === "far-bottom",
children: /* @__PURE__ */ z(Or, {
control: /* @__PURE__ */ z(FN, {
color: t === "far-bottom" ? "secondary" : void 0,
fill: "currentcolor"
}),
label: a("bottom"),
labelPlacement: "bottom",
value: "far-bottom"
})
}, "far-bottom"),
/* @__PURE__ */ z(LN, {
"aria-checked": t === "far-right",
onClick: () => {
o("far-right");
},
role: "menuitemradio",
selected: t === "far-right",
children: /* @__PURE__ */ z(Or, {
control: /* @__PURE__ */ z(IN, {
color: t === "far-right" ? "secondary" : void 0,
fill: "currentcolor",
style: n === "rtl" ? { transform: "rotate(180deg)" } : {}
}),
label: a("right"),
labelPlacement: "bottom",
value: "far-right"
})
}, "far-right")
]
})] });
}
zN.propTypes = {
direction: W.default.string.isRequired,
handleClose: W.default.func,
setWindowThumbnailPosition: W.default.func.isRequired,
thumbnailNavigationPosition: W.default.string.isRequired,
windowId: W.default.string.isRequired
};
var BN = n(w((e, { windowId: t }) => ({
direction: pt(e),
thumbnailNavigationPosition: he(e, { windowId: t })
}), { setWindowThumbnailPosition: Ut }, null, { forwardRef: !0 }), m("WindowThumbnailSettings"))(zN), VN = M(/*#__PURE__*/ z("path", { d: "M21 3H3v18h18zm-2 16H5V5h14zm-5.04-6.71-2.75 3.54-1.96-2.36L6.5 17h11z" }), "CropOriginalSharp"), HN = M(/*#__PURE__*/ z("path", { d: "M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z" }), "ViewColumn");
//#endregion
//#region src/components/icons/BookViewIcon.jsx
function UN(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ z("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: /* @__PURE__ */ z("path", { d: "M1,4V21H22.853V4.1ZM3,19V6h8V19Zm18,0H13V6h8ZM14,9.5h6V11H14ZM14,12h6v1.5H14Zm0,2.5h6V16H14Z" })
})
});
}
//#endregion
//#region src/components/icons/GalleryViewIcon.jsx
function WN(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ z("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: /* @__PURE__ */ z("path", {
d: "M19.974,2H2V19.974H19.974V2ZM7.392,18.177H3.8V14.582H7.392Zm0-5.392H3.8V9.19H7.392Zm0-5.392H3.8V3.8H7.392Zm5.392,10.785H9.19V14.582h3.595Zm0-5.392H9.19V9.19h3.595Zm0-5.392H9.19V3.8h3.595Zm5.392,10.785H14.582V14.582h3.595Zm0-5.392H14.582V9.19h3.595Zm0-5.392H14.582V3.8h3.595Z",
transform: "translate(1 1)"
})
})
});
}
//#endregion
//#region src/components/WindowViewSettings.jsx
var GN = H(Jn, {
name: "WindowViewSettings",
slot: "option"
})(({ selected: e, theme: t }) => ({ "& .MuiFormControlLabel-label": {
borderBottom: "2px solid transparent",
...e && { borderBottomColor: t.palette.secondary.main },
"&.Mui-selected": { backgroundColor: "transparent !important" },
"&.Mui-selected.Mui-focusVisible": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
"&:focused": { backgroundColor: `${(t.vars || t).palette.action.focus} !important` },
color: e ? t.palette.secondary.main : void 0,
display: "inline-block"
} })), KN = H(qn, {
name: "WindowViewSettings",
slot: "option"
})(() => ({ display: "inline-flex" }));
function qN({ handleClose: e = () => {}, windowViewType: t, viewTypes: n = [], setWindowViewType: r, windowId: i }) {
let { t: a } = V(), o = (e) => {
r(i, e);
}, s = {
book: UN,
gallery: WN,
scroll: HN,
single: VN
}, c = ({ value: n, Icon: r }) => /* @__PURE__ */ z(GN, {
"aria-checked": t === n,
autoFocus: t === n,
onClick: () => {
o(n), e();
},
role: "menuitemradio",
selected: t === n,
children: /* @__PURE__ */ z(Or, {
value: n,
control: /* @__PURE__ */ z(r, {
fill: "currentcolor",
color: t === n ? "secondary" : void 0
}),
label: a(n),
labelPlacement: "bottom"
})
}, n);
return n.length === 0 ? null : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Er, {
role: "presentation",
disableSticky: !0,
children: a("view")
}), /* @__PURE__ */ z(KN, {
role: "menubar",
children: n.map((e) => c({
Icon: s[e],
value: e
}))
})] });
}
qN.propTypes = {
handleClose: W.default.func,
setWindowViewType: W.default.func.isRequired,
viewTypes: W.default.arrayOf(W.default.string),
windowId: W.default.string.isRequired,
windowViewType: W.default.string.isRequired
};
var JN = n(w((e, { windowId: t }) => ({
viewTypes: Re(e, { windowId: t }),
windowViewType: we(e, { windowId: t })
}), { setWindowViewType: qt }, null, { forwardRef: !0 }), m("WindowViewSettings"))(qN);
//#endregion
//#region src/components/WindowTopMenu.jsx
function YN({ targetName: e, ...t }) {
let { PluginComponents: n } = rn(e), { t: r } = V();
return n?.length > 0 ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Er, {
role: "presentation",
disableSticky: !0,
tabIndex: -1,
children: r("windowPluginButtons")
}), /* @__PURE__ */ z(on, {
targetName: e,
...t
})] }) : null;
}
YN.propTypes = { targetName: W.default.string.isRequired };
function XN({ handleClose: e, showThumbnailNavigationSettings: t = !0, toggleDraggingEnabled: n, windowId: r, anchorEl: i = null, open: a = !1 }) {
let o = An(mn), s = arguments[0];
return /* @__PURE__ */ B(Dr, {
container: o?.current,
anchorOrigin: {
horizontal: "right",
vertical: "bottom"
},
transformOrigin: {
horizontal: "right",
vertical: "top"
},
onClose: e,
orientation: "horizontal",
anchorEl: i,
open: a,
role: "menu",
slotProps: {
transition: {
onEntering: n,
onExit: n
},
paper: { className: j("window-top-menu") }
},
children: [
/* @__PURE__ */ z(JN, {
windowId: r,
handleClose: e
}),
t && /* @__PURE__ */ z(BN, {
windowId: r,
handleClose: e
}),
/* @__PURE__ */ z(YN, {
targetName: "WindowTopMenu",
...s
})
]
});
}
XN.propTypes = {
anchorEl: W.default.object,
handleClose: W.default.func.isRequired,
open: W.default.bool,
showThumbnailNavigationSettings: W.default.bool,
toggleDraggingEnabled: W.default.func.isRequired,
windowId: W.default.string.isRequired
};
var ZN = n(w((e) => ({ showThumbnailNavigationSettings: et(e).thumbnailNavigation.displaySettings }), (e) => ({ toggleDraggingEnabled: () => e($i()) })), m("WindowTopMenu"))(XN);
//#endregion
//#region src/components/icons/WindowOptionsIcon.jsx
function QN(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: [
/* @__PURE__ */ z("path", {
d: "M0,0H24V24H0Z",
fill: "none"
}),
/* @__PURE__ */ z("path", {
d: "M24.852,17.981,3,18V15.945l21.852-.019Z",
transform: "translate(-2 5)"
}),
/* @__PURE__ */ z("path", {
d: "M1,4V21H22.853V4.1ZM3,19V6h8V19Zm18,0H13V6h8Z",
transform: "translate(0 -2)"
})
]
})
});
}
//#endregion
//#region src/components/WindowTopMenuButton.jsx
function $N({ classes: e = {}, windowId: t }) {
let { t: n } = V(), [r, i] = L(null), [a, o] = L(!1), s = jn();
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(fn, {
"aria-expanded": !!r,
"aria-haspopup": "true",
"aria-label": n("windowMenu"),
"aria-owns": a ? s : void 0,
className: a ? e.ctrlBtnSelected : void 0,
selected: a,
onClick: (e) => {
i(e.currentTarget), o(!0);
},
children: /* @__PURE__ */ z(QN, {})
}), /* @__PURE__ */ z(ZN, {
windowId: t,
anchorEl: r,
handleClose: () => {
i(null), o(!1);
},
id: s,
open: a
})] });
}
$N.propTypes = {
classes: W.default.objectOf(W.default.string),
windowId: W.default.string.isRequired
};
var eP = n(m("WindowTopMenuButton"))($N);
//#endregion
//#region src/components/WindowTopBarPluginArea.jsx
function tP(e) {
return /* @__PURE__ */ z(on, {
targetName: "WindowTopBarPluginArea",
...e
});
}
var nP = n(w(null, null), m("WindowTopBarPluginArea"))(tP), rP = M(/*#__PURE__*/ z("path", { d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreVertSharp");
//#endregion
//#region src/components/WindowTopBarPluginMenu.jsx
function iP({ windowId: e, menuIcon: t = /* @__PURE__ */ z(rP, {}), pluginTarget: n = "WindowTopBarPluginMenu" }) {
let { t: r } = V(), i = An(mn), a = arguments[0], [o, s] = L(null), [c, l] = L(!1), u = jn(), { PluginComponents: d } = rn(n), f = (e) => {
s(e.currentTarget), l(!0);
}, p = () => {
s(null), l(!1);
};
return !d || d.length === 0 ? null : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(fn, {
"aria-expanded": !!o,
"aria-haspopup": "true",
"aria-label": r("windowPluginMenu"),
"aria-owns": c ? u : void 0,
selected: c,
onClick: f,
children: t
}), /* @__PURE__ */ z(Ar, {
id: u,
container: i?.current,
anchorEl: o,
anchorOrigin: {
horizontal: "right",
vertical: "bottom"
},
transformOrigin: {
horizontal: "right",
vertical: "top"
},
open: c,
onClose: p,
children: /* @__PURE__ */ z(on, {
targetName: n,
handleClose: p,
...a
})
})] });
}
iP.propTypes = {
anchorEl: W.default.object,
container: W.default.shape({ current: W.default.instanceOf(Element) }),
menuIcon: W.default.element,
open: W.default.bool,
pluginTarget: W.default.string,
windowId: W.default.string.isRequired
};
var aP = n(m("WindowTopBarPluginMenu"))(iP), oP = M(/*#__PURE__*/ z("path", { d: "M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8" }), "ErrorOutlineSharp"), sP = H(lP)(({ theme: e }) => ({
...e.typography.h6,
flexGrow: 1,
paddingLeft: e.spacing(.5)
})), cP = H("div")(({ theme: e }) => ({
...e.typography.h6,
flexGrow: 1,
paddingLeft: e.spacing(.5)
}));
function lP({ children: e, ...t }) {
return /* @__PURE__ */ z(U, {
variant: "h2",
noWrap: !0,
...t,
sx: [{ color: "inherit" }, ...Array.isArray(t.sx) ? t.sx : [t.sx]],
children: e
});
}
lP.propTypes = {
children: W.default.node.isRequired,
sx: W.default.oneOfType([W.default.arrayOf(W.default.object), W.default.object])
};
function uP({ error: e = null, hideWindowTitle: t = !1, isFetching: n = !1, manifestTitle: r = "" }) {
let i;
return i = n ? /* @__PURE__ */ z(sP, { children: /* @__PURE__ */ z(mr, { variant: "text" }) }) : e ? /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(oP, { color: "error" }), /* @__PURE__ */ z(sP, {
color: "textSecondary",
children: e
})] }) : t ? /* @__PURE__ */ z(cP, {}) : /* @__PURE__ */ z(sP, { children: r }), i;
}
uP.propTypes = {
error: W.default.string,
hideWindowTitle: W.default.bool,
isFetching: W.default.bool,
manifestTitle: W.default.string
};
var dP = n(w((e, { windowId: t }) => ({
error: He(e, { windowId: t }).error,
hideWindowTitle: Se(e, { windowId: t }).hideWindowTitle,
isFetching: He(e, { windowId: t }).isFetching,
manifestTitle: st(e, { windowId: t })
}), null), m("WindowTopBarTitle"))(uP), fP = M(/*#__PURE__*/ z("path", { d: "M7 14H5v5h5v-2H7zm-2-4h2V7h3V5H5zm12 7h-3v2h5v-5h-2zM14 5v2h3v3h2V5z" }), "FullscreenSharp"), pP = M(/*#__PURE__*/ z("path", { d: "M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z" }), "FullscreenExitSharp");
//#endregion
//#region src/components/FullScreenButton.jsx
function mP({ className: e = void 0 }) {
let { t } = V(), n = An(Nw), [r, i] = L(!1);
return F(() => {
let e = document.createElement("div");
i(typeof e.requestFullscreen == "function");
}, []), r ? n && n.active ? /* @__PURE__ */ z(fn, {
className: e,
"aria-label": t("exitFullScreen"),
onClick: n.exit,
children: /* @__PURE__ */ z(pP, {})
}) : n ? /* @__PURE__ */ z(fn, {
className: e,
"aria-label": t("workspaceFullScreen"),
onClick: n.enter,
children: /* @__PURE__ */ z(fP, {})
}) : null : null;
}
mP.propTypes = { className: W.default.string };
var hP = n(w((e) => ({}), {}), m("FullScreenButton"))(mP);
//#endregion
//#region src/components/icons/WindowMaxIcon.jsx
function gP(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: [/* @__PURE__ */ z("path", { d: "M7,14H5v5h5V17H7Zm7-9V7h3v3h2V5Z" }), /* @__PURE__ */ z("path", { d: "M22.517,1.524H1.736V22.37H22.517Zm-2,18.845H3.736V3.524H20.517Z" })]
})
});
}
//#endregion
//#region src/components/icons/WindowMinIcon.jsx
function _P(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: [/* @__PURE__ */ z("path", { d: "M5,16H8v3h2V14H5ZM16,8V5H14v5h5V8Z" }), /* @__PURE__ */ z("path", { d: "M22.517,1.524H1.736V22.37H22.517Zm-2,18.845H3.736V3.524H20.517Z" })]
})
});
}
//#endregion
//#region src/components/WindowTopBar.jsx
var vP = H(Tr, {
name: "WindowTopBar",
slot: "root"
})(() => ({ zIndex: 1100 })), yP = H(Xn, {
name: "WindowTopBar",
slot: "toolbar"
})(({ ownerState: e, theme: t }) => ({
backgroundColor: t.palette.shades?.main,
borderTop: "2px solid",
borderTopColor: e?.focused ? t.palette.primary.main : "transparent",
minHeight: 32,
paddingLeft: t.spacing(.5),
paddingRight: t.spacing(.5),
...e?.windowDraggable && { cursor: "move" }
}));
function bP({ removeWindow: e, windowId: t, toggleWindowSideBar: n, maximizeWindow: r = () => {}, maximized: i = !1, minimizeWindow: a = () => {}, allowClose: o = !0, allowMaximize: s = !0, focusWindow: c = () => {}, allowFullscreen: l = !1, allowTopMenuButton: u = !0, allowWindowSideBar: d = !0, sideBarOpen: f = !1, component: p = "nav" }) {
let { t: m } = V(), h = arguments[0];
return /* @__PURE__ */ z(vP, {
component: p,
"aria-label": m("windowNavigation"),
position: "relative",
color: "default",
enableColorOnDark: !0,
children: /* @__PURE__ */ B(yP, {
disableGutters: !0,
onMouseDown: c,
ownerState: h,
className: (0, G.default)(j("window-top-bar")),
variant: "dense",
children: [
d && /* @__PURE__ */ z(fn, {
"aria-expanded": f,
"aria-haspopup": !0,
"aria-label": m(f ? "hideWindowSideBar" : "showWindowSideBar"),
onClick: n,
className: j("window-menu-btn"),
children: /* @__PURE__ */ z(NN, {})
}),
/* @__PURE__ */ z(dP, { windowId: t }),
u && /* @__PURE__ */ z(eP, {
windowId: t,
className: j("window-menu-btn")
}),
/* @__PURE__ */ z(nP, { windowId: t }),
/* @__PURE__ */ z(aP, { windowId: t }),
s && /* @__PURE__ */ z(fn, {
"aria-label": m(i ? "minimizeWindow" : "maximizeWindow"),
className: (0, G.default)(j("window-maximize"), j("window-menu-btn")),
onClick: i ? a : r,
children: z(i ? _P : gP, {})
}),
l && /* @__PURE__ */ z(hP, { className: j("window-menu-btn") }),
o && /* @__PURE__ */ z(fn, {
"aria-label": m("closeWindow"),
className: (0, G.default)(j("window-close"), j("window-menu-btn")),
onClick: e,
children: /* @__PURE__ */ z(ks, {})
})
]
})
});
}
bP.propTypes = {
allowClose: W.default.bool,
allowFullscreen: W.default.bool,
allowMaximize: W.default.bool,
allowTopMenuButton: W.default.bool,
allowWindowSideBar: W.default.bool,
component: W.default.elementType,
focused: W.default.bool,
focusWindow: W.default.func,
maximized: W.default.bool,
maximizeWindow: W.default.func,
minimizeWindow: W.default.func,
sideBarOpen: W.default.bool,
removeWindow: W.default.func.isRequired,
toggleWindowSideBar: W.default.func.isRequired,
windowDraggable: W.default.bool,
windowId: W.default.string.isRequired
};
var xP = n(w((e, { windowId: t }) => {
let n = Se(e, { windowId: t });
return {
allowClose: n.allowClose,
allowFullscreen: n.allowFullscreen,
allowMaximize: n.allowMaximize,
allowTopMenuButton: n.allowTopMenuButton,
allowWindowSideBar: n.allowWindowSideBar,
focused: Je(e, { windowId: t }),
maximized: n.maximized,
sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen
};
}, (e, { windowId: t }) => ({
focusWindow: () => e(Jt(t)),
maximizeWindow: () => e(Kt(t)),
minimizeWindow: () => e(Ht(t)),
removeWindow: () => e(Yt(t)),
toggleWindowSideBar: () => e(Wt(t))
})), m("WindowTopBar"))(bP), SP = M(/*#__PURE__*/ z("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z" }), "InfoSharp"), CP = M(/*#__PURE__*/ z("path", { d: "M10.08 10.86c.05-.33.16-.62.3-.87s.34-.46.59-.62c.24-.15.54-.22.91-.23.23.01.44.05.63.13.2.09.38.21.52.36s.25.33.34.53.13.42.14.64h1.79c-.02-.47-.11-.9-.28-1.29s-.4-.73-.7-1.01-.66-.5-1.08-.66-.88-.23-1.39-.23c-.65 0-1.22.11-1.7.34s-.88.53-1.2.92-.56.84-.71 1.36S8 11.29 8 11.87v.27c0 .58.08 1.12.23 1.64s.39.97.71 1.35.72.69 1.2.91 1.05.34 1.7.34c.47 0 .91-.08 1.32-.23s.77-.36 1.08-.63.56-.58.74-.94.29-.74.3-1.15h-1.79c-.01.21-.06.4-.15.58s-.21.33-.36.46-.32.23-.52.3c-.19.07-.39.09-.6.1-.36-.01-.66-.08-.89-.23-.25-.16-.45-.37-.59-.62s-.25-.55-.3-.88-.08-.67-.08-1v-.27c0-.35.03-.68.08-1.01M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8" }), "CopyrightSharp"), wP = M(/*#__PURE__*/ z("path", { d: "m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27z" }), "LayersSharp");
//#endregion
//#region src/components/icons/CanvasIndexIcon.jsx
function TP(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ z("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "24",
height: "24",
viewBox: "0 0 24 24",
children: /* @__PURE__ */ z("path", { d: "M6.924,21H21V19H6.924ZM3,17H21V15H3Zm3.924-4H21V11H6.924Zm0-4H21V7H6.924ZM3,3V5H21V3Z" })
})
});
}
//#endregion
//#region src/components/WindowSideBarButtons.jsx
var EP = H(sr, {
name: "WindowSideBarButtons",
slot: "root"
})({
"& .MuiTabs-flexContainer": { flexDirection: "column" },
"&.MuiTabs-indicator": { display: "none" }
}), DP = H(cr, {
name: "WindowSideBarButtons",
slot: "button"
})(({ theme: e }) => ({
"&.Mui-selected": {
borderRight: "2px solid",
borderRightColor: e.palette.primary.main
},
"&.MuiTab-root": {
"&:active": { backgroundColor: e.palette.action.active },
"&:focus": {
"@media (hover: none)": { backgroundColor: "transparent" },
backgroundColor: e.palette.action.hover,
textDecoration: "none"
},
"&:hover": {
"@media (hover: none)": { backgroundColor: "transparent" },
backgroundColor: e.palette.action.hover,
textDecoration: "none"
},
borderRight: "2px solid transparent",
minWidth: "auto"
},
fill: "currentcolor"
}));
function OP({ value: e, ...t }) {
let { t: n } = V();
return /* @__PURE__ */ z(Gn, {
title: n("openCompanionWindow", { context: e }),
children: /* @__PURE__ */ z(DP, {
...t,
value: e,
"aria-label": n("openCompanionWindow", { context: e }),
disableRipple: !0
})
});
}
OP.propTypes = { value: W.default.string.isRequired };
function kP({ addCompanionWindow: e, hasAnnotations: t = !1, hasAnyAnnotations: n = !1, hasAnyLayers: r = !1, hasCurrentLayers: i = !1, hasSearchResults: a = !1, hasSearchService: o = !1, panels: s = [], sideBarPanel: c = "closed" }) {
let { t: l } = V(), { PluginComponents: u } = rn("WindowSideBarButtons");
return /* @__PURE__ */ B(EP, {
value: c !== "closed" && c,
onChange: (t, n) => {
e(n);
},
variant: "fullWidth",
indicatorColor: "primary",
textColor: "primary",
orientation: "vertical",
children: [
s.info && /* @__PURE__ */ z(OP, {
value: "info",
icon: /* @__PURE__ */ z(SP, {})
}),
s.attribution && /* @__PURE__ */ z(OP, {
value: "attribution",
icon: /* @__PURE__ */ z(CP, {})
}),
s.canvas && /* @__PURE__ */ z(OP, {
value: "canvas",
icon: /* @__PURE__ */ z(TP, {})
}),
s.annotations && (t || n) && /* @__PURE__ */ z(OP, {
value: "annotations",
icon: /* @__PURE__ */ z(Un, {
overlap: "rectangular",
color: "notification",
invisible: !t,
variant: "dot",
children: /* @__PURE__ */ z(dn, {})
})
}),
s.search && o && /* @__PURE__ */ z(OP, {
value: "search",
icon: /* @__PURE__ */ z(Un, {
overlap: "rectangular",
color: "notification",
invisible: !a,
variant: "dot",
children: /* @__PURE__ */ z(cn, {})
})
}),
s.layers && r && /* @__PURE__ */ z(OP, {
value: "layers",
icon: /* @__PURE__ */ z(Un, {
overlap: "rectangular",
color: "notification",
invisible: !i,
variant: "dot",
children: /* @__PURE__ */ z(wP, {})
})
}),
u && u.map((e) => /* @__PURE__ */ z(OP, {
value: e.value,
icon: /* @__PURE__ */ z(e, {})
}, e.value))
]
});
}
kP.propTypes = {
addCompanionWindow: W.default.func.isRequired,
hasAnnotations: W.default.bool,
hasAnyAnnotations: W.default.bool,
hasAnyLayers: W.default.bool,
hasCurrentLayers: W.default.bool,
hasSearchResults: W.default.bool,
hasSearchService: W.default.bool,
panels: W.default.objectOf(W.default.bool),
sideBarPanel: W.default.string
};
//#endregion
//#region src/containers/WindowSideBarButtons.js
var AP = (e, { windowId: t }) => ({ addCompanionWindow: (n) => e(ji(t, {
content: n,
position: "left"
})) });
function jP(e, t) {
return e && e.some((e) => t(e).imageResources.length > 1);
}
function MP(e, t) {
return e && e.some((e) => {
let n = t(e);
return n.annotationListUris.length > 0 || n.canvasAnnotationPages.length > 0;
});
}
function NP(e, { windowId: t }) {
let { suggestedSearches: n } = s(e, { windowId: t }), r = Ye(e, {
position: "left",
windowId: t
})?.[0]?.id, i = Mt(e, {
companionWindowId: r,
windowId: t
});
return !!(n || i);
}
var PP = n(w((e, { windowId: t }) => ({
hasAnnotations: At(e, { windowId: t }).length > 0,
hasAnyAnnotations: MP(ct(e, { windowId: t }), de(e)),
hasAnyLayers: jP(ct(e, { windowId: t }), de(e)),
hasCurrentLayers: jP(Ne(e, { windowId: t }), de(e)),
hasSearchResults: NP(e, { windowId: t }),
hasSearchService: be(e, { windowId: t }) !== null,
panels: Se(e, { windowId: t }).panels,
sideBarPanel: (Ye(e, {
position: "left",
windowId: t
})[0] || {}).content
}), AP), m("WindowSideBarButtons"))(kP);
//#endregion
//#region src/components/WindowSideBar.jsx
H(jr, {
name: "WindowSideBar",
slot: "root"
})(({ theme: e }) => ({
flexShrink: 0,
order: -1e3,
zIndex: e.zIndex.appBar - 1
}));
function FP({ classes: e = {}, direction: t, windowId: n, sideBarOpen: r = !1 }) {
let { t: i } = V();
return /* @__PURE__ */ z(jr, {
sx: {
flexShrink: 0,
order: -1e3,
zIndex: (e) => e.zIndex.appBar - 1
},
variant: "persistent",
className: e.drawer,
anchor: t === "rtl" ? "right" : "left",
slotProps: {
paper: {
component: "nav",
sx: {
width: r ? 48 : 0,
position: "relative"
}
},
transition: {
direction: t === "rtl" ? "left" : "right",
mountOnEnter: !0,
unmountOnExit: !0
}
},
open: r,
children: /* @__PURE__ */ z(PP, { windowId: n })
});
}
FP.propTypes = {
classes: W.default.objectOf(W.default.string),
direction: W.default.string.isRequired,
sideBarOpen: W.default.bool,
windowId: W.default.string.isRequired
};
var IP = n(w((e, { windowId: t }) => ({
direction: pt(e),
sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen,
sideBarPanel: (s(e, { windowId: t }) || {}).sideBarPanel
}), null), m("WindowSideBar"))(FP), LP = M(/*#__PURE__*/ z("path", { d: "m14 7-5 5 5 5z" }), "ArrowLeftSharp"), RP = M(/*#__PURE__*/ z("path", { d: "m10 17 5-5-5-5z" }), "ArrowRightSharp"), zP = H("pre", {
name: "ErrorContent",
slot: "stacktrace"
})({ overflowY: "scroll" }), BP = H("pre", {
name: "ErrorContent",
slot: "metadata"
})({
height: "100px",
overflowY: "scroll"
}), VP = H($n, {
name: "ErrorContent",
slot: "accordion"
})({
backgroundColor: "inherit",
color: "inherit",
margin: 0
});
function HP({ error: e, metadata: t = null, showJsError: n = !0, ...r }) {
let { t: i } = V();
if (!n) return null;
let a = {
error: e,
metadata: t,
showJsError: n,
t: i,
...r
};
return /* @__PURE__ */ B(Pr, {
elevation: 6,
variant: "filled",
severity: "error",
children: [
i("errorDialogTitle"),
n && /* @__PURE__ */ B(VP, {
elevation: 2,
square: !0,
children: [/* @__PURE__ */ z(tr, {
sx: { marginInlineStart: "-1rem" },
expandIcon: /* @__PURE__ */ z(hl, { sx: { color: "#fff" } }),
children: i("jsError", {
message: e.message,
name: e.name
})
}), /* @__PURE__ */ z(er, { children: /* @__PURE__ */ B(Nr, { children: [/* @__PURE__ */ z(zP, { children: i("jsStack", { stack: e.stack }) }), t && /* @__PURE__ */ z(BP, { children: JSON.stringify(t, null, 2) })] }) })]
}),
/* @__PURE__ */ z(on, {
targetName: "ErrorContent",
...a
})
]
});
}
HP.propTypes = {
error: W.default.object.isRequired,
metadata: W.default.object,
showJsError: W.default.bool
};
var UP = n(w((e, { companionWindowId: t, windowId: n }) => ({
metadata: {
companionWindow: t && se(e, { companionWindowId: t }),
manifest: b(e, { windowId: n }),
viewer: g(e, { windowId: n }),
window: s(e, { windowId: n })
},
showJsError: et(e).window.showJsError
})), m("ErrorContent"))(HP);
//#endregion
//#region src/components/CompanionWindowFactory.jsx
function WP({ content: e = null, id: t, windowId: n }) {
let { t: r } = V(), i = kn(({ error: e }) => /* @__PURE__ */ z(dl, {
title: r("error"),
windowId: n,
id: t,
children: /* @__PURE__ */ z(UP, {
error: e,
windowId: n,
companionWindowId: t
})
}), [
n,
r,
t
]), a = Mb[e];
return a ? /* @__PURE__ */ z(_n, {
fallbackComponent: i,
children: /* @__PURE__ */ z(a, {
id: t,
windowId: n
})
}) : null;
}
WP.propTypes = {
content: W.default.string,
id: W.default.string.isRequired,
windowId: W.default.string.isRequired
};
var GP = n(w((e, { id: t }) => ({
content: se(e, { companionWindowId: t }).content,
id: t
})), m("CompanionWindowFactory"))(WP), KP = H("div", {
name: "CompanionArea",
slot: "root"
})(({ ownerState: e, theme: t }) => ({
display: "flex",
minHeight: 0,
position: "relative",
zIndex: t.zIndex.appBar - 2,
...(e.position === "bottom" || e.position === "far-bottom") && {
flexDirection: "column",
width: "100%"
}
})), qP = H("div", {
name: "CompanionArea",
slot: "container"
})(({ ownerState: e }) => ({
display: e?.companionAreaOpen ? "flex" : "none",
...(e?.position === "bottom" || e?.position === "far-bottom") && {
flexDirection: "column",
width: "100%"
},
...e?.position === "left" && e?.companionWindowIds && e.companionWindowIds.length > 0 && { minWidth: "235px" }
})), JP = H("div", {
name: "CompanionArea",
slot: "toggle"
})(({ theme: e }) => ({
alignItems: "center",
backgroundColor: e.palette.background.paper,
border: `1px solid ${e.palette.shades?.dark}`,
...e.applyStyles("dark", { borderColor: e.palette.divider }),
borderInlineStart: 0,
borderRadius: 0,
display: "inline-flex",
height: "48px",
left: "100%",
marginTop: "1rem",
overflow: "hidden",
padding: 2,
position: "absolute",
width: "23px",
zIndex: e.zIndex.drawer
}));
function YP({ classes: e = {}, className: t = void 0, direction: n, companionWindowIds: r, companionAreaOpen: i, setCompanionAreaOpen: a = () => {}, position: o, sideBarOpen: s = !1, windowId: c }) {
let { t: l } = V(), u = o === "bottom" || o === "far-bottom" ? e.horizontal : null, d = z(n === "rtl" ? i ? RP : LP : i ? LP : RP, {}), f = (() => {
let e = n === "rtl" ? "left" : "right", t = n === "rtl" ? "right" : "left";
switch (o) {
case "right":
case "far-right": return t;
case "bottom":
case "far-bottom": return "up";
default: return e;
}
})(), p = (0, G.default)(u, j(`companion-area-${o}`), t), m = arguments[0];
return /* @__PURE__ */ B(KP, {
ownerState: m,
className: p,
children: [/* @__PURE__ */ z(Mr, {
in: i,
direction: f,
children: /* @__PURE__ */ z(qP, {
ownerState: m,
className: `${j("companion-windows")}`,
children: r.map((e) => /* @__PURE__ */ z(GP, {
id: e,
windowId: c
}, e))
})
}), a && o === "left" && s && r.length > 0 && /* @__PURE__ */ z(JP, { children: /* @__PURE__ */ z(fn, {
"aria-expanded": i,
"aria-label": l(i ? "collapseSidePanel" : "expandSidePanel"),
edge: "start",
onClick: () => {
a(c, !i);
},
TooltipProps: { placement: "right" },
children: d
}) })]
});
}
YP.propTypes = {
classes: W.default.objectOf(W.default.string),
className: W.default.string,
companionAreaOpen: W.default.bool.isRequired,
companionWindowIds: W.default.arrayOf(W.default.string).isRequired,
direction: W.default.string.isRequired,
position: W.default.string.isRequired,
setCompanionAreaOpen: W.default.func,
sideBarOpen: W.default.bool,
windowId: W.default.string.isRequired
};
var XP = n(w((e, { windowId: t, position: n }) => ({
companionAreaOpen: Te(e, {
position: n,
windowId: t
}),
companionWindowIds: ae(e, {
position: n,
windowId: t
}),
direction: pt(e),
sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen
}), { setCompanionAreaOpen: Zt }), m("CompanionArea"))(YP), ZP = (e) => {
let t;
return t = e < 1 ? 5.11916 * e ** 2 : 4.5 * Math.log(e + 1) + 2, (t / 100).toFixed(2);
}, QP = H(Zr, {
name: "ScrollIndicatedDialogContent",
slot: "root"
})(({ ownerState: e, theme: t }) => {
let n = t.palette.mode === "dark" ? { backgroundImage: `linear-gradient(${In("#fff", ZP(e?.elevation || 24))}, ${In("#fff", ZP(e?.elevation || 24))})` } : t.palette.background.paper;
return {
background: `linear-gradient(${n} 30%, rgba(255, 255, 255, 0)), linear-gradient(rgba(255, 255, 255, 0), ${n} 70%) 0 100%, radial-gradient(farthest-side at 50% 0, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)), radial-gradient(farthest-side at 50% 100%, rgba(0, 0, 0, .2), rgba(0, 0, 0, 0)) 0 100%;`,
backgroundAttachment: "local, local, scroll, scroll",
backgroundRepeat: "no-repeat",
backgroundSize: "100% 40px, 100% 40px, 100% 14px, 100% 14px",
overflowY: "auto"
};
});
function $P({ classes: e = {}, className: t = "", ...n }) {
let r = [t, e.shadowScrollDialog].join(" ");
return /* @__PURE__ */ z(QP, {
className: r,
...n
});
}
$P.propTypes = {
classes: W.default.shape({ shadowScrollDialog: W.default.string }),
className: W.default.string
};
//#endregion
//#region src/containers/ScrollIndicatedDialogContent.js
var eF = $P, tF = H(eF)(() => ({ padding: (e) => e.spacing(1) })), nF = H("div")(() => ({
"& .MuiPaper-root": { background: "transparent" },
padding: (e) => e.spacing(2)
})), rF = H("div")(() => ({
padding: (e) => e.spacing(2),
paddingTop: 0
})), iF = ({ onClose: e, container: t }) => /* @__PURE__ */ B(zr, {
variant: "contained",
onClose: e,
open: !0,
container: t,
children: [/* @__PURE__ */ z(Ur, {
id: "select-collection",
children: /* @__PURE__ */ z(mr, { variant: "text" })
}), /* @__PURE__ */ B(eF, { children: [/* @__PURE__ */ z(mr, { variant: "text" }), /* @__PURE__ */ z(mr, { variant: "text" })] })]
});
iF.propTypes = {
container: W.default.instanceOf(Element).isRequired,
onClose: W.default.func.isRequired
};
function aF({ addWindow: e, collection: t = null, dialogCollectionPath: n = [], error: r = null, hideCollectionDialog: i, isMultipart: a = !1, manifest: o, manifestId: s, ready: c = !1, setWorkspaceAddVisibility: l, showCollectionDialog: u, updateWindow: d, windowId: f = null }) {
let p = An(mn), { t: m } = V(), [h, g] = L(null), _ = () => {
i(f);
}, v = (e) => {
u(e.id, [...n, s], f);
}, y = () => {
u(n[n.length - 1], n.slice(0, -1), f);
}, b = (t) => {
f ? d(f, {
canvasId: null,
collectionPath: [...n, s],
manifestId: t.id
}) : e({
collectionPath: [...n, s],
manifestId: t.id
}), _(), l(!1);
}, x = (p?.current || document.body).querySelector(`#${f}`);
if (r || !x) return null;
if (!c) return /* @__PURE__ */ z(iF, {
container: x,
onClose: _
});
let S = o && O(o.getProperty("rights") || o.getProperty("license")), C = o && O(o.getRequiredStatement()).filter((e) => e && e.getValue()).map((e) => ({
label: null,
values: e.getValues()
})), w = o.getCollections(), T = h || (w.length > 0 ? "collections" : "manifests");
return /* @__PURE__ */ B(zr, {
variant: "contained",
onClose: _,
container: x,
open: !0,
children: [
/* @__PURE__ */ B(Ur, {
id: "select-collection",
children: [/* @__PURE__ */ z(Xr, {
component: "div",
variant: "overline",
children: m(a ? "multipartCollection" : "collection")
}), /* @__PURE__ */ z(Xr, {
component: "div",
variant: "h3",
children: /* @__PURE__ */ z(sn, { resource: o })
})]
}),
/* @__PURE__ */ B(tF, { children: [
t && /* @__PURE__ */ z(Fr, {
startIcon: /* @__PURE__ */ z(Df, {}),
onClick: () => y(),
children: /* @__PURE__ */ z(sn, { resource: t })
}),
/* @__PURE__ */ B(nF, { children: [/* @__PURE__ */ z(El, { manifestId: o.id }), /* @__PURE__ */ B(_l, {
id: "select-collection-rights",
label: m("attributionTitle"),
children: [C && /* @__PURE__ */ z(yl, {
labelValuePairs: C,
defaultLabel: m("attribution")
}), S && S.length > 0 && /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(Xr, {
variant: "subtitle2",
component: "dt",
children: m("rights")
}), S.map((e) => /* @__PURE__ */ z(Xr, {
variant: "body1",
component: "dd",
children: /* @__PURE__ */ z(Wr, {
target: "_blank",
rel: "noopener noreferrer",
href: e,
children: e
})
}, e))] })]
})] }),
/* @__PURE__ */ B(rF, { children: [o.getTotalCollections() > 0 && /* @__PURE__ */ z(Rr, {
clickable: !0,
color: T === "collections" ? "primary" : "default",
onClick: () => g("collections"),
label: m("totalCollections", { count: o.getTotalCollections() })
}), o.getTotalManifests() > 0 && /* @__PURE__ */ z(Rr, {
clickable: !0,
color: T === "manifests" ? "primary" : "default",
onClick: () => g("manifests"),
label: m("totalManifests", { count: o.getTotalManifests() })
})] }),
T === "collections" && /* @__PURE__ */ z(Jr, { children: w.map((e) => /* @__PURE__ */ z(qr, {
onClick: () => {
v(e);
},
variant: "multiline",
children: /* @__PURE__ */ z(sn, { resource: e })
}, e.id)) }),
T === "manifests" && /* @__PURE__ */ z(Jr, { children: o.getManifests().map((e) => /* @__PURE__ */ z(qr, {
onClick: () => {
b(e);
},
variant: "multiline",
children: /* @__PURE__ */ z(sn, { resource: e })
}, e.id)) })
] }),
/* @__PURE__ */ z(Br, { children: /* @__PURE__ */ z(Fr, {
onClick: _,
children: m("close")
}) })
]
});
}
aF.propTypes = {
addWindow: W.default.func.isRequired,
collection: W.default.object,
dialogCollectionPath: W.default.arrayOf(W.default.string),
error: W.default.string,
hideCollectionDialog: W.default.func.isRequired,
isMultipart: W.default.bool,
manifest: W.default.object.isRequired,
manifestId: W.default.string.isRequired,
ready: W.default.bool,
setWorkspaceAddVisibility: W.default.func.isRequired,
showCollectionDialog: W.default.func.isRequired,
updateWindow: W.default.func.isRequired,
windowId: W.default.string
};
var oF = n(w((e, { windowId: t }) => {
let { collectionManifestId: n, dialogCollectionPath: r } = s(e, { windowId: t }), i = b(e, { manifestId: n }), a = r && r[r.length - 1], o = a && b(e, { manifestId: a });
return {
collection: o && Le(e, { manifestId: o.id }),
dialogCollectionPath: r,
error: i && i.error,
isMultipart: ye(e, { manifestId: n }).includes("multi-part"),
manifest: i && Le(e, { manifestId: n }),
manifestId: n,
open: e.workspace.collectionDialogOn,
ready: i && !!i.json,
windowId: t
};
}, {
addWindow: Qt,
hideCollectionDialog: Xt,
setWorkspaceAddVisibility: Xi,
showCollectionDialog: $t,
updateWindow: Gt
}), m("CollectionDialog"))(aF), sF = Dn(() => import("./AudioViewer-bGPXOwhs.js").then((e) => e.n)), cF = Dn(() => import("./GalleryView-D4GEjZKP.js").then((e) => e.n)), lF = Dn(() => import("./SelectCollection-D9vIyalj.js").then((e) => e.n)), uF = Dn(() => import("./WindowViewer-CfkRJDLW.js").then((e) => e.n)), dF = Dn(() => import("./VideoViewer-Dg5dqTfU.js").then((e) => e.n)), fF = Dn(() => import("./TextViewer-B68ZaRP3.js").then((e) => e.n));
cF.displayName = "GalleryView", lF.displayName = "SelectCollection", uF.displayName = "WindowViewer";
var pF = H("div", {
name: "PrimaryWindow",
slot: "root"
})(() => ({
display: "flex",
flex: 1,
position: "relative"
})), mF = ({ audioResources: e = [], isCollection: t = !1, isFetching: n = !1, textResources: r = [], videoResources: i = [], view: a = void 0, windowId: o }) => t ? /* @__PURE__ */ z(lF, { windowId: o }) : n === !1 ? a === "gallery" ? /* @__PURE__ */ z(cF, { windowId: o }) : i.length > 0 ? /* @__PURE__ */ z(dF, { windowId: o }) : e.length > 0 ? /* @__PURE__ */ z(sF, { windowId: o }) : r.length > 0 ? /* @__PURE__ */ z(fF, { windowId: o }) : /* @__PURE__ */ z(uF, { windowId: o }) : null;
mF.propTypes = {
audioResources: W.default.arrayOf(W.default.object),
isCollection: W.default.bool,
isFetching: W.default.bool,
textResources: W.default.arrayOf(W.default.object),
videoResources: W.default.arrayOf(W.default.object),
view: W.default.string,
windowId: W.default.string.isRequired
};
function hF({ audioResources: e = void 0, children: t = null, className: n = void 0, isCollection: r = !1, isCollectionDialogVisible: i = !1, isFetching: a = !1, textResources: o = void 0, videoResources: s = void 0, view: c = void 0, windowId: l }) {
let u = {
audioResources: e,
isCollection: r,
isFetching: a,
textResources: o,
videoResources: s,
view: c,
windowId: l
};
return /* @__PURE__ */ B(pF, {
"data-testid": "test-window",
className: (0, G.default)(j("primary-window"), n),
children: [
/* @__PURE__ */ z(IP, { windowId: l }),
/* @__PURE__ */ z(XP, {
windowId: l,
position: "left"
}),
i && /* @__PURE__ */ z(oF, { windowId: l }),
/* @__PURE__ */ z(bn, {
fallback: /* @__PURE__ */ z("div", {}),
children: t || /* @__PURE__ */ z(mF, { ...u })
})
]
});
}
hF.propTypes = {
audioResources: W.default.arrayOf(W.default.object),
children: W.default.node,
className: W.default.string,
isCollection: W.default.bool,
isCollectionDialogVisible: W.default.bool,
isFetching: W.default.bool,
textResources: W.default.arrayOf(W.default.object),
videoResources: W.default.arrayOf(W.default.object),
view: W.default.string,
windowId: W.default.string.isRequired
};
var gF = n(w((e, { windowId: t }) => {
let n = Le(e, { windowId: t });
return {
audioResources: Ve(e, { windowId: t }) || [],
isCollection: n && n.isCollection(),
isCollectionDialogVisible: s(e, { windowId: t }).collectionDialogOn,
textResources: Ge(e, { windowId: t }) || [],
videoResources: Ue(e, { windowId: t }) || []
};
}, null), m("PrimaryWindow"))(hF), _F = H(fn)(() => ({ marginLeft: "auto" }));
function vF({ allowClose: e = !0, allowWindowSideBar: t = !0, ariaLabel: n = !0, children: r = null, label: i = "", removeWindow: a = () => {}, windowId: o }) {
let { t: s } = V();
return /* @__PURE__ */ B(Fn, {
component: "section",
elevation: 1,
id: o,
className: (0, G.default)(j("placeholder-window")),
sx: {
backgroundColor: "shades.dark",
borderRadius: 0,
display: "flex",
flexDirection: "column",
height: "100%",
minHeight: 0,
overflow: "hidden",
width: "100%"
},
"aria-label": i && n ? s("window", { label: i }) : null,
children: [/* @__PURE__ */ z(Tr, {
position: "relative",
color: "default",
enableColorOnDark: !0,
children: /* @__PURE__ */ B(Xn, {
disableGutters: !0,
className: (0, G.default)(j("window-top-bar")),
sx: {
backgroundColor: "shades.main",
borderTop: "2px solid transparent",
minHeight: 32,
paddingLeft: .5,
paddingRight: .5
},
variant: "dense",
children: [
t && /* @__PURE__ */ z(fn, {
"aria-label": s("toggleWindowSideBar"),
disabled: !0,
children: /* @__PURE__ */ z(NN, {})
}),
/* @__PURE__ */ z(U, {
variant: "h2",
noWrap: !0,
sx: {
color: "inherit",
flexGrow: 1,
paddingLeft: .5,
typography: "h6"
},
children: i
}),
e && a && /* @__PURE__ */ z(_F, {
"aria-label": s("closeWindow"),
className: (0, G.default)(j("window-close")),
onClick: a,
TooltipProps: { tabIndex: n ? 0 : -1 },
children: /* @__PURE__ */ z(ks, {})
})
]
})
}), r]
});
}
vF.propTypes = {
allowClose: W.default.bool,
allowWindowSideBar: W.default.bool,
ariaLabel: W.default.bool,
children: W.default.node,
label: W.default.string,
removeWindow: W.default.func,
windowId: W.default.string.isRequired
};
var yF = n(w((e, { windowId: t }) => ({
allowClose: Se(e, { windowId: t }).allowClose,
allowWindowSideBar: Se(e, { windowId: t }).allowWindowSideBar
}), (e, { windowId: t }) => ({ removeWindow: () => e(Yt(t)) })), m("MinimalWindow"))(vF), bF = {
"aria-hidden": !0,
frameBorder: 0,
height: 1,
name: void 0,
scrolling: void 0,
style: { visibility: "hidden" },
width: 1
};
function xF({ handleReceiveMessage: e = void 0, ...t }) {
return F(() => {
if (e) return window.addEventListener("message", e), () => window.removeEventListener("message", e, !1);
}, [e]), /* @__PURE__ */ z("iframe", {
...bF,
...t
});
}
xF.propTypes = {
"aria-hidden": W.default.bool,
frameBorder: W.default.oneOfType([W.default.string, W.default.number]),
handleReceiveMessage: W.default.func,
height: W.default.oneOfType([W.default.string, W.default.number]),
name: W.default.string,
scrolling: W.default.string,
src: W.default.string.isRequired,
style: W.default.shape({}),
width: W.default.oneOfType([W.default.string, W.default.number])
};
//#endregion
//#region src/components/AccessTokenSender.jsx
function SF({ handleAccessTokenMessage: e, url: t = void 0 }) {
let n = kn((n) => {
n.data && n.data.messageId && n.data.messageId === t && e(n.data);
}, [e, t]);
if (!t) return null;
let r = new URL(t);
return r.searchParams.append("origin", window.origin), r.searchParams.append("messageId", t), /* @__PURE__ */ z(xF, {
src: r.toString(),
title: "AccessTokenSender",
handleReceiveMessage: n
});
}
SF.propTypes = {
handleAccessTokenMessage: W.default.func.isRequired,
url: W.default.string
};
//#endregion
//#region src/components/NewBrowserWindow.jsx
function CF({ depWindow: e = void 0, features: t = void 0, name: n = void 0, onClose: r, url: i }) {
let a = I(!1);
return F(() => {
let o = (e || window).open(i, n, t), s = setInterval(() => {
!a.current && (!o || o.closed) && (a.current = !0, clearInterval(s), r(i));
}, 250);
return () => {
clearInterval(s), o.close();
};
}), null;
}
CF.propTypes = {
depWindow: W.default.object,
features: W.default.string,
name: W.default.string,
onClose: W.default.func.isRequired,
url: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/LockSharp.js
var wF = M(/*#__PURE__*/ z("path", { d: "M20 8h-3V6.21c0-2.61-1.91-4.94-4.51-5.19C9.51.74 7 3.08 7 6v2H4v14h16zm-8 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 2M9 8V6c0-1.66 1.34-3 3-3s3 1.34 3 3v2z" }), "LockSharp"), TF = H("div")(({ theme: e }) => ({
alignItems: "center",
backgroundColor: e.palette.secondary.main,
color: e.palette.secondary.contrastText,
display: "flex",
padding: e.spacing(1)
})), EF = H("span")(({ theme: e }) => ({ marginLeft: e.spacing(2.5) }));
function DF({ confirmButton: e = void 0, continueLabel: t = void 0, header: n = void 0, description: r = void 0, icon: i = void 0, label: a, ruleSet: o = "iiif", hasLogoutService: s = !0, status: c = void 0, ConfirmProps: l = {}, onConfirm: u }) {
let { t: d } = V(), f = arguments[0], [p, m] = L(!1), h = () => {
m(!1), u();
};
if (c === "ok" && !s) return null;
let g = /* @__PURE__ */ z(ar, {
onClick: h,
color: "secondary",
sx: (e) => ({
backgroundColor: e.palette.secondary.contrastText,
lineHeight: "1.5rem"
}),
...l,
children: e || d("login")
});
return !r && !n ? /* @__PURE__ */ z(Fn, {
square: !0,
elevation: 4,
color: "secondary",
children: /* @__PURE__ */ B(TF, { children: [
i || /* @__PURE__ */ z(wF, { sx: { marginInlineEnd: 5 } }),
/* @__PURE__ */ z(U, {
component: "h3",
variant: "body1",
sx: { color: "inherit" },
children: o ? /* @__PURE__ */ z(Cs, {
htmlString: a,
ruleSet: o
}) : a
}),
/* @__PURE__ */ z(on, {
targetName: "WindowAuthenticationBar",
...f
}),
g
] })
}) : /* @__PURE__ */ B(Fn, {
square: !0,
elevation: 4,
color: "secondary",
children: [/* @__PURE__ */ B(ar, {
fullWidth: !0,
onClick: () => m(!0),
component: "div",
color: "inherit",
sx: (e) => ({
"&:hover": { backgroundColor: e.palette.secondary.main },
backgroundColor: e.palette.secondary.main,
borderRadius: 0,
color: e.palette.secondary.contrastText,
justifyContent: "start",
textTransform: "none"
}),
children: [
i || /* @__PURE__ */ z(wF, { sx: { marginInlineEnd: 1.5 } }),
/* @__PURE__ */ z(U, {
component: "h3",
variant: "body1",
sx: {
color: "inherit",
paddingBlockEnd: 1,
paddingBlockStart: 1
},
children: o ? /* @__PURE__ */ z(Cs, {
htmlString: a,
ruleSet: o
}) : a
}),
/* @__PURE__ */ z(on, {
targetName: "WindowAuthenticationBar",
...f
}),
/* @__PURE__ */ z(EF, { children: !p && /* @__PURE__ */ z(U, {
variant: "button",
sx: { color: "inherit" },
children: t || d("continue")
}) })
]
}), /* @__PURE__ */ B(ur, {
sx: (e) => ({
backgroundColor: e.palette.secondary.main,
color: e.palette.secondary.contrastText,
paddingInlineEnd: e.spacing(1),
paddingInlineStart: e.spacing(1)
}),
in: p,
onClose: () => m(!1),
children: [/* @__PURE__ */ B(U, {
variant: "body1",
sx: { color: "inherit" },
children: [
o ? /* @__PURE__ */ z(Cs, {
htmlString: n,
ruleSet: o
}) : n,
n && r ? ": " : "",
o ? /* @__PURE__ */ z(Cs, {
htmlString: r,
ruleSet: o
}) : r
]
}), /* @__PURE__ */ B(Qr, { children: [/* @__PURE__ */ z(ar, {
onClick: () => m(!1),
color: "inherit",
children: d("cancel")
}), g] })]
})]
});
}
DF.propTypes = {
confirmButton: W.default.string,
ConfirmProps: W.default.object,
continueLabel: W.default.string,
description: W.default.node,
hasLogoutService: W.default.bool,
header: W.default.node,
icon: W.default.node,
label: W.default.node.isRequired,
onConfirm: W.default.func.isRequired,
ruleSet: W.default.string,
status: W.default.string
};
var OF = n(m("WindowAuthenticationBar"))(DF);
//#endregion
//#region src/components/IIIFAuthentication.jsx
function kF({ accessTokenServiceId: e = void 0, authServiceId: t = void 0, confirm: n = void 0, description: r = void 0, failureDescription: i = void 0, failureHeader: a = void 0, features: o = "centerscreen", handleAuthInteraction: s, header: c = void 0, isInteractive: l = !0, label: u = void 0, logoutConfirm: d = void 0, logoutServiceId: f = void 0, openWindow: p = window.open, resetAuthenticationState: m, resolveAccessTokenRequest: h, resolveAuthenticationRequest: g, status: _ = null, windowId: v }) {
let { t: y } = V(), b = (n) => {
h(t, e, n);
}, x = () => ({
authServiceId: t,
hasLogoutService: !!f,
status: _,
windowId: v
}), S = () => {
p(f, void 0, o), m({
authServiceId: t,
tokenServiceId: e
});
}, C = () => !l && !f ? null : /* @__PURE__ */ z(OF, {
confirmButton: d || y("logout"),
onConfirm: S,
...x()
}), w = () => /* @__PURE__ */ z(OF, {
header: a,
description: i,
confirmButton: y("retry"),
onConfirm: () => s(v, t),
...x()
}), T = () => /* @__PURE__ */ B(R, { children: [D(), /* @__PURE__ */ z(CF, {
name: "IiifLoginSender",
url: `${t}?origin=${window.origin}`,
features: o,
onClose: () => g(t, e)
})] }), E = () => /* @__PURE__ */ B(R, { children: [D(), /* @__PURE__ */ z(SF, {
handleAccessTokenMessage: b,
url: e
})] }), D = () => l ? /* @__PURE__ */ z(OF, {
header: c,
description: r,
label: u,
confirmButton: n,
onConfirm: () => s(v, t),
...x()
}) : null;
return t ? _ === null ? D() : _ === "cookie" ? T() : _ === "token" ? E() : _ === "failed" ? w() : _ === "ok" ? C() : null : null;
}
kF.propTypes = {
accessTokenServiceId: W.default.string,
authServiceId: W.default.string,
confirm: W.default.string,
description: W.default.string,
failureDescription: W.default.string,
failureHeader: W.default.string,
features: W.default.string,
handleAuthInteraction: W.default.func.isRequired,
header: W.default.string,
isInteractive: W.default.bool,
label: W.default.string,
logoutConfirm: W.default.string,
logoutServiceId: W.default.string,
openWindow: W.default.func,
resetAuthenticationState: W.default.func.isRequired,
resolveAccessTokenRequest: W.default.func.isRequired,
resolveAuthenticationRequest: W.default.func.isRequired,
status: W.default.oneOf([
"logout",
"ok",
"token",
"cookie",
"failed",
null
]),
windowId: W.default.string.isRequired
};
var AF = n(w((e, { windowId: t }) => {
let n = Oi(e, { windowId: t })[0], r = n && (pi.Utils.getService(n, "http://iiif.io/api/auth/1/token") || pi.Utils.getService(n, "http://iiif.io/api/auth/0/token")), i = n && (pi.Utils.getService(n, "http://iiif.io/api/auth/1/logout") || pi.Utils.getService(n, "http://iiif.io/api/auth/0/logout")), a = Di(e), o = n && a[n.id], s = Ei(e), c = r && s[r.id], l = null;
o ? o.isFetching ? o.windowId === t && (l = "cookie") : c && c.isFetching ? o.windowId === t && (l = "token") : o.ok ? l = "ok" : o.ok === !1 && (l = "failed") : l = null;
let u = Ti(e), d = n && n.getProfile(), f = u.some((e) => e.profile === d && !(e.external || e.kiosk));
return {
accessTokenServiceId: r && r.id,
authServiceId: n && n.id,
confirm: n && n.getConfirmLabel(),
description: n && n.getDescription(),
failureDescription: n && n.getFailureDescription(),
failureHeader: n && n.getFailureHeader(),
header: n && n.getHeader(),
isInteractive: f,
label: n && n.getLabel()[0].value,
logoutConfirm: i && i.getLabel()[0] && i.getLabel()[0].value,
logoutServiceId: i && i.id,
profile: d,
status: l
};
}, {
handleAuthInteraction: ea,
resetAuthenticationState: oa,
resolveAccessTokenRequest: aa,
resolveAuthenticationRequest: ta
}), m("IIIFAuthentication"))(kF), jF = {
display: "flex",
flex: "1",
flexDirection: "row",
minHeight: 0
}, MF = {
display: "flex",
flex: "1",
flexDirection: "column",
minHeight: 0
}, NF = H(Fn, {
name: "Window",
slot: "root"
})(({ ownerState: e, theme: t }) => ({
...MF,
backgroundColor: t.palette.shades?.dark,
borderRadius: 0,
height: "100%",
overflow: "hidden",
width: "100%",
...e?.maximized && {
left: 0,
position: "absolute",
top: 0,
zIndex: t.zIndex.modal - 1
}
})), PF = H("div", {
name: "Window",
slot: "row"
})(() => ({ ...jF })), FF = H("div", {
name: "Window",
slot: "column"
})(() => ({ ...MF })), IF = H(gF, {
name: "Window",
slot: "primary"
})(() => ({
...jF,
height: "300px",
position: "relative"
})), LF = H(XP, {
name: "Window",
slot: "bottom"
})(() => ({
...jF,
flex: "0",
flexBasis: "auto"
})), RF = H("div", {
name: "Window",
slot: "right"
})(() => ({
...jF,
flex: "0 1 auto"
})), zF = ({ children: e, ...t }) => {
let { mosaicWindowActions: n } = An(gM);
return n.connectDragSource(/* @__PURE__ */ z("nav", {
...t,
children: e
}));
};
function BF({ focusWindow: e = () => {}, label: t = null, isFetching: n = !1, sideBarOpen: r = !1, view: i = void 0, windowDraggable: a = null, windowId: o, workspaceType: s = null, manifestError: c = null }) {
let { t: l } = V(), u = arguments[0], d = kn(({ error: e }) => /* @__PURE__ */ z(yF, {
windowId: o,
children: /* @__PURE__ */ z(UP, {
error: e,
windowId: o
})
}), [o]);
return /* @__PURE__ */ z(_n, {
FallbackComponent: d,
children: /* @__PURE__ */ B(NF, {
onFocus: e,
ownerState: u,
component: "section",
elevation: 1,
id: o,
className: j("window"),
"aria-label": l("window", { label: t }),
children: [
/* @__PURE__ */ z(xP, {
component: s === "mosaic" && a ? zF : void 0,
windowId: o,
windowDraggable: a
}),
/* @__PURE__ */ z(AF, { windowId: o }),
c && /* @__PURE__ */ z(UP, {
error: { stack: c },
windowId: o
}),
/* @__PURE__ */ B(PF, { children: [/* @__PURE__ */ B(FF, { children: [/* @__PURE__ */ z(IF, {
view: i,
windowId: o,
isFetching: n,
sideBarOpen: r
}), /* @__PURE__ */ z(LF, {
windowId: o,
position: "bottom"
})] }), /* @__PURE__ */ B(RF, { children: [/* @__PURE__ */ z(XP, {
windowId: o,
position: "right"
}), /* @__PURE__ */ z(XP, {
windowId: o,
position: "far-right"
})] })] }),
/* @__PURE__ */ z(XP, {
windowId: o,
position: "far-bottom"
}),
/* @__PURE__ */ z(on, {
targetName: "Window",
...u
})
]
})
});
}
BF.propTypes = {
focusWindow: W.default.func,
isFetching: W.default.bool,
label: W.default.string,
manifestError: W.default.string,
maximized: W.default.bool,
sideBarOpen: W.default.bool,
view: W.default.string,
windowDraggable: W.default.bool,
windowId: W.default.string.isRequired,
workspaceType: W.default.string
};
var VF = n(w((e, { windowId: t }) => ({
isFetching: He(e, { windowId: t }).isFetching,
label: st(e, { windowId: t }),
manifestError: Ee(e, { windowId: t }),
maximized: (s(e, { windowId: t }) || {}).maximized,
sideBarOpen: (s(e, { windowId: t }) || {}).sideBarOpen,
thumbnailNavigationPosition: he(e, { windowId: t }),
view: we(e, { windowId: t }),
windowDraggable: re(e, { windowId: t }),
workspaceType: te(e)
}), (e, { windowId: t }) => ({ focusWindow: () => e(Jt(t)) })), m("Window"))(BF), HF = H(el, { shouldForwardProp: (e) => e !== "focused" })(({ focused: e, theme: t }) => ({ zIndex: e ? t.zIndex.modal - 1 : "auto" }));
function UF({ classes: e = {}, companionWindowDimensions: t = {
height: 0,
width: 0
}, focused: n = !1, focusWindow: r = () => {}, layout: i, workspace: a, updateElasticWindowLayout: o }) {
let s = a.width / 2, c = a.height / 2;
return /* @__PURE__ */ z(HF, {
focused: n,
className: n ? e.focused : void 0,
size: {
height: i.height + t.height,
width: i.width + t.width
},
position: {
x: i.x + s,
y: i.y + c
},
bounds: "parent",
onDragStop: (e, t) => {
o(i.windowId, {
x: t.x - s,
y: t.y - c
});
},
onDragStart: r,
onResize: (e, n, r, a, l) => {
o(i.windowId, {
height: Number.parseInt(r.style.height, 10) - t.height,
width: Number.parseInt(r.style.width, 10) - t.width,
x: l.x - s,
y: l.y - c
});
},
dragHandleClassName: j("window-top-bar"),
cancel: `.${j("window-menu-btn")}`,
children: /* @__PURE__ */ z(VF, { windowId: i.windowId })
}, `${i.windowId}-${a.id}`);
}
UF.propTypes = {
classes: W.default.objectOf(W.default.string),
companionWindowDimensions: W.default.shape({
height: W.default.number,
width: W.default.number
}),
focused: W.default.bool,
focusWindow: W.default.func,
layout: W.default.shape({
height: W.default.number,
id: W.default.string,
width: W.default.number,
windowId: W.default.string,
x: W.default.number,
y: W.default.number
}).isRequired,
updateElasticWindowLayout: W.default.func.isRequired,
workspace: W.default.object.isRequired
};
var WF = n(w((e, { windowId: t }) => ({
companionWindowDimensions: _e(e, { windowId: t }),
focused: Je(e, { windowId: t }),
layout: oe(e)[t],
workspace: _(e)
}), (e, t) => ({
focusWindow: () => e(Jt(t.windowId)),
updateElasticWindowLayout: (t, n) => {
e(sa(t, n));
}
})))(UF), GF = H("div", {
name: "WorkspaceElastic",
slot: "root"
})({
height: "100%",
overflow: "hidden",
position: "relative",
width: "100%"
}), KF = H(el)({
boxSizing: "border-box",
margin: 0,
position: "absolute",
transitionDuration: ".7s",
"&.react-draggable-dragging": { transitionDuration: "unset" }
});
function qF({ workspace: e, elasticLayout: t, setWorkspaceViewportDimensions: n, setWorkspaceViewportPosition: r }) {
let { viewportPosition: i } = e, a = e.width / 2, o = e.height / 2, s = I(null);
return Nn(() => {
s.current && n(s.current.getBoundingClientRect());
}, [s, n]), Bw(s, (e) => {
n(e.contentRect);
}), /* @__PURE__ */ z(GF, {
ref: s,
children: /* @__PURE__ */ z(KF, {
size: {
height: e.height,
width: e.width
},
position: {
x: -1 * i.x - a,
y: -1 * i.y - o
},
enableResizing: {
bottom: !1,
bottomLeft: !1,
bottomRight: !1,
left: !1,
right: !1,
top: !1,
topLeft: !1,
topRight: !1
},
onDragStop: (e, t) => {
r({
x: -1 * t.x - a,
y: -1 * t.y - o
});
},
cancel: `.${j("window")}`,
className: j("workspace"),
disableDragging: !e.draggingEnabled,
children: Object.keys(t).map((e) => /* @__PURE__ */ z(WF, { windowId: e }, e))
})
});
}
qF.propTypes = {
elasticLayout: W.default.object.isRequired,
setWorkspaceViewportDimensions: W.default.func.isRequired,
setWorkspaceViewportPosition: W.default.func.isRequired,
workspace: W.default.object.isRequired
};
//#endregion
//#region src/components/BackgroundPluginArea.jsx
var JF = ({ ...e }) => /* @__PURE__ */ z("div", {
className: j("background-plugin-area"),
style: { display: "none" },
children: /* @__PURE__ */ z(on, {
targetName: "BackgroundPluginArea",
...e
})
});
//#endregion
//#region src/components/icons/MiradorIcon.jsx
function YF(e) {
return /* @__PURE__ */ B(kr, {
viewBox: "0 0 60 55",
...e,
children: [
/* @__PURE__ */ z("rect", {
width: "18",
height: "55"
}),
/* @__PURE__ */ z("rect", {
width: "18",
height: "55",
transform: "translate(42)"
}),
/* @__PURE__ */ z("rect", {
width: "18",
height: "34",
transform: "translate(21)"
})
]
});
}
//#endregion
//#region src/components/Branding.jsx
function XF({ variant: e = "default", ...t }) {
let { t: n } = V();
return /* @__PURE__ */ B(Nr, {
sx: { alignItems: "center" },
...t,
children: [e === "wide" && /* @__PURE__ */ z("div", { children: /* @__PURE__ */ z(U, {
align: "center",
component: "p",
variant: "h3",
children: n("mirador")
}) }), /* @__PURE__ */ z(U, {
align: "center",
children: /* @__PURE__ */ z(Wn, {
component: "a",
href: "https://projectmirador.org",
target: "_blank",
rel: "noopener",
size: "large",
children: /* @__PURE__ */ z(YF, {
"aria-label": n("aboutMirador"),
titleAccess: n("aboutMirador"),
fontSize: "large"
})
})
})]
});
}
XF.propTypes = { variant: W.default.oneOf(["default", "wide"]) };
//#endregion
//#region node_modules/@mui/icons-material/esm/PaletteSharp.js
var ZF = M(/*#__PURE__*/ z("path", { d: "M12 2C6.49 2 2 6.49 2 12s4.49 10 10 10c1.38 0 2.5-1.12 2.5-2.5 0-.61-.23-1.2-.64-1.67-.08-.1-.13-.21-.13-.33 0-.28.22-.5.5-.5H16c3.31 0 6-2.69 6-6 0-4.96-4.49-9-10-9m5.5 11c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5m-3-4c-.83 0-1.5-.67-1.5-1.5S13.67 6 14.5 6s1.5.67 1.5 1.5S15.33 9 14.5 9M5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S7.33 13 6.5 13 5 12.33 5 11.5m6-4c0 .83-.67 1.5-1.5 1.5S8 8.33 8 7.5 8.67 6 9.5 6s1.5.67 1.5 1.5" }), "PaletteSharp"), QF = H(zr, {
name: "WorkspaceDialog",
slot: "root"
})(({ theme: e, variant: t }) => ({
"& .MuiDialogTitle-root": e.unstable_sx({ typography: "h2" }),
...t === "menu" && { "& .MuiDialogContent-root": { padding: 0 } }
})), $F = H(ZF, {
name: "ThemeIcon",
slot: "icon"
})(({ theme: e }) => ({ color: "#BDBDBD" }));
function eI({ container: e = null, handleClose: t, open: n = !1, selectedTheme: r, setSelectedTheme: i, themeIds: a = [] }) {
let { t: o } = V(), s = kn((e) => {
i(e), t();
}, [t, i]);
return /* @__PURE__ */ B(QF, {
container: e,
onClose: t,
open: n,
variant: "menu",
children: [/* @__PURE__ */ z(Ur, { children: o("changeTheme") }), /* @__PURE__ */ z(Vr, { children: /* @__PURE__ */ z(Jr, {
autoFocusItem: !0,
children: a.map((e) => /* @__PURE__ */ B(qr, {
className: "listitem",
onClick: () => s(e),
selected: e === r,
value: e,
children: [/* @__PURE__ */ z(Gr, { children: /* @__PURE__ */ z($F, { ownerState: { value: e } }) }), /* @__PURE__ */ z(Kr, { children: o(e) })]
}, e))
}) })]
});
}
eI.propTypes = {
container: W.default.object,
handleClose: W.default.func.isRequired,
open: W.default.bool,
selectedTheme: W.default.string.isRequired,
setSelectedTheme: W.default.func.isRequired,
themeIds: W.default.arrayOf(W.default.string)
};
//#endregion
//#region src/components/ErrorDialog.jsx
function tI({ error: e = null, removeError: t = () => {} }) {
let { t: n } = V(), r = !(0, Iw.default)(e);
return e ? /* @__PURE__ */ B($r, {
"aria-labelledby": "error-dialog-title",
id: "error-dialog",
onClose: () => t(e.id),
open: r,
children: [/* @__PURE__ */ z(ei, {
id: "error-dialog-title",
children: n("errorDialogTitle")
}), /* @__PURE__ */ B(Zr, { children: [/* @__PURE__ */ z(Hr, {
variant: "body2",
noWrap: !0,
sx: { color: "inherit" },
children: `${e.message}`
}), /* @__PURE__ */ z(Br, { children: /* @__PURE__ */ z(ar, {
onClick: () => t(e.id),
variant: "contained",
children: n("errorDialogConfirm")
}) })] })]
}) : null;
}
tI.propTypes = {
error: W.default.shape({
id: W.default.string,
message: W.default.string
}),
removeError: W.default.func
};
//#endregion
//#region node_modules/@mui/icons-material/esm/InsertDriveFileSharp.js
var nI = M(/*#__PURE__*/ z("path", { d: "M4.01 2 4 22h16V8l-6-6zM13 9V3.5L18.5 9z" }), "InsertDriveFileSharp");
//#endregion
//#region src/lib/readImageMetadata.js
function rI(e) {
return new Promise((t, n) => {
let r = new FileReader();
r.addEventListener("load", () => {
let n = new Image();
n.addEventListener("load", () => {
t({
height: n.height,
name: e.name,
type: e.type,
url: r.result,
width: n.width
});
}), n.src = r.result;
}), r.readAsDataURL(e);
});
}
//#endregion
//#region src/components/IIIFDropTarget.jsx
var iI = (e) => {
try {
return new URL(e);
} catch {
return console.warn("Invalid URL:", e), null;
}
}, aI = (e, t, n) => {
let { onDrop: r } = n;
if (e.html) {
let r = new DOMParser().parseFromString(e.html, "text/html").querySelector("a[href]");
if (r) {
let e = iI(r.href);
if (e) return aI({ urls: [e.toString()] }, t, n);
}
}
if (e.urls && e.urls.forEach((e) => {
let i = iI(e);
if (!i) return;
let a = i.searchParams.get("manifest"), o = i.searchParams.get("canvas");
a && r({
canvasId: o,
manifestId: a
}, n, t);
}), e.files) {
let i = e.files.filter((e) => e.type === "application/json").map((e) => new Promise((i, a) => {
let o = new FileReader();
o.addEventListener("load", () => {
let e = o.result, a = h();
e && r({
manifestId: a,
manifestJson: e
}, n, t), i();
}), o.readAsText(e);
})), a = e.files.filter(({ type: e }) => e.startsWith("image/")), o;
if (a.length > 0) {
let e = h(), i = a.map((e) => rI(e));
o = Promise.all(i).then((i) => {
let a = {
"@context": "http://iiif.io/api/presentation/3/context.json",
id: e,
items: i.map(({ name: t, type: n, width: r, height: i, url: a }, o) => ({
height: i,
id: `${e}/canvas/${o}`,
items: [{
id: `${e}/canvas/${o}/1`,
items: [{
body: {
format: n,
id: a,
type: "Image"
},
height: i,
id: `${e}/canvas/${o}/1/image`,
motivation: "painting",
target: `${e}/canvas/${o}/1`,
type: "Annotation",
width: r
}],
type: "AnnotationPage"
}],
label: t,
type: "Canvas",
width: r
})),
label: i[0].name,
type: "Manifest"
}, o = h();
a && r({
manifestId: o,
manifestJson: a
}, n, t);
});
}
return Promise.all([...i, o]);
}
}, oI = (e) => {
let { children: t, onDrop: n } = e, [{ canDrop: r, isOver: i }, a] = vC({
accept: [
YC,
JC,
ZC
],
collect: (e) => ({
canDrop: e.canDrop(),
isOver: e.isOver()
}),
drop(t, r) {
n && aI(t, r, e);
}
});
return /* @__PURE__ */ B("div", {
ref: a,
onDrop: (t) => {
if (!(!window.safari || !n || !t.dataTransfer) && t.dataTransfer.types.includes("Files") && t.dataTransfer.types.includes("text/uri-list")) {
let n = t.dataTransfer.getData("text/uri-list");
if (!n) return;
aI({ urls: [n] }, null, e);
}
},
style: {
height: "100%",
width: "100%"
},
children: [t, /* @__PURE__ */ z(ti, {
open: r && i,
style: { zIndex: 9999 },
children: /* @__PURE__ */ z(nI, { style: {
color: ni[400],
fontSize: 256
} })
})]
});
};
oI.propTypes = {
children: W.default.node.isRequired,
onDrop: W.default.func.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/CheckSharp.js
var sI = M(/*#__PURE__*/ z("path", { d: "M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z" }), "CheckSharp");
//#endregion
//#region src/components/LanguageSettings.jsx
function cI({ handleClick: e, languages: t }) {
return /* @__PURE__ */ z(R, { children: t.map((t) => /* @__PURE__ */ B(Jn, {
"aria-selected": t.current,
lang: t.locale,
onClick: () => {
e(t.locale);
},
children: [/* @__PURE__ */ z(wr, { children: t.current && /* @__PURE__ */ z(sI, {}) }), /* @__PURE__ */ z(Yn, {
slotProps: { primary: { variant: "body1" } },
children: t.label
})]
}, t.locale)) });
}
cI.propTypes = {
handleClick: W.default.func.isRequired,
languages: W.default.arrayOf(W.default.shape({
current: W.default.bool.isRequired,
label: W.default.string.isRequired,
locale: W.default.string.isRequired
})).isRequired
};
//#endregion
//#region src/components/ManifestForm.jsx
function lI({ addResourcesOpen: e, addResource: t, onSubmit: n = () => {}, onCancel: r = null }) {
let { t: i } = V(), [a, o] = L("");
return e ? /* @__PURE__ */ z("form", {
onSubmit: (e) => {
e.preventDefault(), t(a), n(), o("");
},
children: /* @__PURE__ */ B(ri, {
container: !0,
spacing: 2,
columns: 12,
sx: { mt: .5 },
children: [
/* @__PURE__ */ z(ri, {
size: {
sm: "grow",
xs: 12
},
children: /* @__PURE__ */ z(_r, {
autoFocus: !0,
fullWidth: !0,
value: a,
id: "manifestURL",
type: "text",
onChange: (e) => {
e.preventDefault(), o(e.target.value);
},
variant: "filled",
label: i("addManifestUrl"),
helperText: i("addManifestUrlHelp"),
slotProps: {
inputLabel: { shrink: !0 },
inputProps: { style: { typography: "body1" } }
}
})
}),
r && /* @__PURE__ */ z(ri, {
size: "auto",
children: /* @__PURE__ */ z(ar, {
onClick: () => {
r(), o("");
},
children: i("cancel")
})
}),
/* @__PURE__ */ z(ri, {
size: "auto",
children: /* @__PURE__ */ z(ar, {
id: "fetchBtn",
type: "submit",
variant: "contained",
color: "primary",
children: i("fetchManifest")
})
})
]
})
}) : null;
}
lI.propTypes = {
addResource: W.default.func.isRequired,
addResourcesOpen: W.default.bool.isRequired,
onCancel: W.default.func,
onSubmit: W.default.func
};
//#endregion
//#region src/components/ManifestListItemError.jsx
function uI({ manifestId: e, onDismissClick: t, onTryAgainClick: n }) {
let { t: r } = V();
return /* @__PURE__ */ B(ri, {
container: !0,
sx: {
alignItems: "center",
width: "100%"
},
children: [/* @__PURE__ */ B(ri, {
container: !0,
size: {
sm: 5,
xs: 12
},
sx: { alignItems: "center" },
children: [
/* @__PURE__ */ z(oP, { sx: {
color: "error.main",
height: "2rem",
marginRight: "0.5rem",
width: "2rem"
} }),
/* @__PURE__ */ z(U, { children: r("manifestError") }),
/* @__PURE__ */ z(U, {
sx: { wordBreak: "break-all" },
children: e
})
]
}), /* @__PURE__ */ B(ri, {
container: !0,
size: {
sm: 7,
xs: 12
},
children: [/* @__PURE__ */ z(ar, {
onClick: () => {
t(e);
},
children: r("dismiss")
}), /* @__PURE__ */ z(ar, {
onClick: () => {
n(e);
},
children: r("tryAgain")
})]
})]
});
}
uI.propTypes = {
manifestId: W.default.string.isRequired,
onDismissClick: W.default.func.isRequired,
onTryAgainClick: W.default.func.isRequired
};
var dI = n(w(null, {
onDismissClick: ga,
onTryAgainClick: Gi
}), m("ManifestListItemError"))(uI), fI = H(br, {
name: "ManifestListItem",
slot: "root"
})(({ ownerState: e, theme: t }) => ({
"&:hover,&:focus-within": {
backgroundColor: t.palette.action.hover,
borderLeftColor: e?.active ? t.palette.primary.main : t.palette.action.hover
},
borderLeft: "4px solid",
borderLeftColor: e?.active ? t.palette.primary.main : "transparent",
paddingLeft: t.spacing(2),
paddingRight: t.spacing(2),
[t.breakpoints.up("sm")]: {
paddingLeft: t.spacing(3),
paddingRight: t.spacing(3)
}
})), pI = H(lf.Img, {
name: "ManifestListItem",
slot: "thumbnail"
})(({ theme: e }) => ({
maxWidth: "100%",
objectFit: "contain"
})), mI = H(lf.Img, {
name: "ManifestListItem",
slot: "logo"
})(({ theme: e }) => ({
height: "2.5rem",
maxWidth: "100%",
objectFit: "contain",
paddingRight: 1
})), hI = () => /* @__PURE__ */ B(ri, {
container: !0,
className: j("manifest-list-item"),
sx: {
alignItems: "center",
display: "flex",
width: "100%"
},
children: [
/* @__PURE__ */ z(ri, {
size: {
sm: 5,
xs: 12
},
sx: {
display: "flex",
justifyContent: "flex-start",
width: "100%",
alignItems: "center"
},
children: /* @__PURE__ */ B(ri, {
container: !0,
component: "div",
sx: { width: "100%" },
children: [/* @__PURE__ */ z(ri, {
size: 3,
sx: {
alignItems: "center",
display: "flex",
justifyContent: "flex-start"
},
children: /* @__PURE__ */ z(mr, {
variant: "rectangular",
sx: { bgcolor: "grey[300]" },
height: 80,
width: 120
})
}), /* @__PURE__ */ z(ri, {
size: 9,
sx: {
alignContent: "center",
paddingLeft: 2
},
children: /* @__PURE__ */ z(mr, {
sx: { bgcolor: "grey[300]" },
variant: "text",
width: 300
})
})]
})
}),
/* @__PURE__ */ B(ri, {
size: {
sm: 4,
xs: 8
},
children: [/* @__PURE__ */ z(mr, {
sx: { bgcolor: "grey[300]" },
variant: "text",
width: 150
}), /* @__PURE__ */ z(mr, {
sx: { bgcolor: "grey[300]" },
variant: "text",
width: 70
})]
}),
/* @__PURE__ */ z(ri, {
size: {
sm: 3,
xs: 4
},
children: /* @__PURE__ */ z(mr, {
sx: { bgcolor: "grey[300]" },
variant: "rectangular",
height: 60,
width: 60
})
})
]
});
function gI({ fetchManifest: e, isFetching: t = !1, addWindow: n, handleClose: r = () => {}, active: i = !1, buttonRef: a = void 0, manifestId: o, ready: s = !1, title: c = null, thumbnail: l = null, manifestLogo: u = null, size: d = 0, provider: f = null, error: p = null, isCollection: m = !1, isMultipart: h = !1 }) {
let { t: g } = V();
F(() => {
!s && !p && !t && f !== "file" && e(o);
}, [
o,
f,
e,
s,
p,
t
]);
let _ = arguments[0];
return p ? /* @__PURE__ */ z(fI, {
ownerState: _,
divider: !0,
selected: i,
className: i ? "active" : "",
"data-manifestid": o,
children: /* @__PURE__ */ z(dI, { manifestId: o })
}) : /* @__PURE__ */ z(fI, {
ownerState: _,
divider: !0,
selected: i,
className: i ? "active" : "",
"data-manifestid": o,
"data-active": i,
sx: { width: "100%" },
children: s ? /* @__PURE__ */ B(ri, {
container: !0,
className: j("manifest-list-item"),
sx: {
alignItems: "center",
width: "100%"
},
children: [
/* @__PURE__ */ z(ri, {
size: {
sm: 5,
xs: 12
},
children: /* @__PURE__ */ z(ii, {
ref: a,
className: j("manifest-list-item-title"),
onClick: () => {
n({ manifestId: o }), r();
},
sx: {
alignItems: "center",
justifyContent: "flex-start",
width: "100%"
},
children: /* @__PURE__ */ B(ri, {
container: !0,
component: "div",
sx: { width: "100%" },
children: [/* @__PURE__ */ z(ri, {
size: 3,
sx: {
alignItems: "center",
display: "flex",
justifyContent: "flex-start"
},
children: l ? /* @__PURE__ */ z(pI, {
className: [j("manifest-list-item-thumb")],
src: [l],
alt: "",
height: "80",
unloader: /* @__PURE__ */ z(mr, {
variant: "rectangular",
animation: !1,
sx: { bgcolor: "grey[300]" },
height: 80,
width: 120
})
}) : /* @__PURE__ */ z(mr, {
sx: { bgcolor: "grey[300]" },
variant: "rectangular",
height: 80,
width: 120
})
}), /* @__PURE__ */ B(ri, {
size: 9,
sx: {
alignContent: "center",
paddingLeft: 2
},
children: [m && /* @__PURE__ */ z(U, {
component: "div",
variant: "overline",
sx: { textAlign: "left" },
children: g(h ? "multipartCollection" : "collection")
}), /* @__PURE__ */ z(U, {
component: "div",
variant: "h6",
sx: { textAlign: "left" },
children: c || o
})]
})]
})
})
}),
/* @__PURE__ */ B(ri, {
size: {
sm: 4,
xs: 8
},
children: [/* @__PURE__ */ z(U, {
className: j("manifest-list-item-provider"),
children: f
}), /* @__PURE__ */ z(U, { children: g("numItems", {
count: d,
number: d
}) })]
}),
/* @__PURE__ */ z(ri, {
size: {
sm: 3,
xs: 4
},
children: u && /* @__PURE__ */ z(mI, {
src: [u],
alt: "",
role: "presentation",
unloader: /* @__PURE__ */ z(mr, {
variant: "rectangular",
animation: !1,
sx: { bgcolor: "grey[300]" },
height: 60,
width: 60
})
})
})
]
}) : /* @__PURE__ */ z(hI, {})
});
}
gI.propTypes = {
active: W.default.bool,
addWindow: W.default.func.isRequired,
buttonRef: W.default.elementType,
error: W.default.oneOfType([
W.default.string,
W.default.bool,
W.default.oneOf([null])
]),
fetchManifest: W.default.func.isRequired,
handleClose: W.default.func,
isCollection: W.default.bool,
isFetching: W.default.bool,
isMultipart: W.default.bool,
manifestId: W.default.string.isRequired,
manifestLogo: W.default.string,
provider: W.default.string,
ready: W.default.bool,
size: W.default.number,
thumbnail: W.default.string,
title: W.default.string
};
//#endregion
//#region src/components/MosaicRenderPreview.jsx
function _I({ title: e = "", windowId: t }) {
let { t: n } = V();
return /* @__PURE__ */ z(yF, {
windowId: `${t}-preview`,
label: n("previewWindowTitle", { title: e }),
ariaLabel: !1
});
}
_I.propTypes = {
title: W.default.string,
windowId: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/ExpandLessSharp.js
var vI = M(/*#__PURE__*/ z("path", { d: "m12 8-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z" }), "ExpandLessSharp"), yI = M(/*#__PURE__*/ z("path", { d: "M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z" }), "ExpandMoreSharp");
//#endregion
//#region src/components/NestedMenu.jsx
function bI({ children: e, icon: t = null, label: n, ...r }) {
let [i, a] = L(!1), o = kn(() => {
a(!i);
}, [i, a]);
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B(Jn, {
"aria-expanded": i,
onClick: o,
divider: i,
...r,
children: [
t && /* @__PURE__ */ z(wr, { children: t }),
/* @__PURE__ */ z(Yn, {
slotProps: { primary: { variant: "body1" } },
children: n
}),
z(i ? vI : yI, {})
]
}), i && e] });
}
bI.propTypes = {
children: W.default.element.isRequired,
icon: W.default.element,
label: W.default.string.isRequired
};
//#endregion
//#region src/components/WindowList.jsx
function xI({ handleClose: e, windowIds: t, focusWindow: n, focusedWindowId: r = null, titles: i = {}, tReady: a = !1, ...o }) {
let { t: s } = V(), c = An(mn);
return /* @__PURE__ */ B(Ar, {
anchorOrigin: {
horizontal: "right",
vertical: "top"
},
transformOrigin: {
horizontal: "left",
vertical: "top"
},
id: "window-list-menu",
container: c?.current,
onClose: e,
...o,
children: [/* @__PURE__ */ z(Er, {
role: "presentation",
selected: !1,
disabled: !0,
tabIndex: "-1",
children: s("openWindows")
}), t.map((t, a) => /* @__PURE__ */ z(Jn, {
selected: t === r,
onClick: (r) => {
n(t, !0), e(r);
},
children: /* @__PURE__ */ z(Yn, {
slotProps: { primary: { variant: "body1" } },
children: i[t] || s("untitled")
})
}, t))]
});
}
xI.propTypes = {
container: W.default.shape({ current: W.default.instanceOf(Element) }),
focusedWindowId: W.default.string,
focusWindow: W.default.func.isRequired,
handleClose: W.default.func.isRequired,
titles: W.default.objectOf(W.default.string),
tReady: W.default.bool,
windowIds: W.default.arrayOf(W.default.string).isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/BookmarksSharp.js
var SI = M(/*#__PURE__*/ z("path", { d: "m19 18 2 1V1H7v2h12zM17 5H3v18l7-3 7 3z" }), "BookmarksSharp"), CI = n(w((e) => ({
focusedWindowId: ie(e),
titles: dt(e),
windowIds: x(e)
}), { focusWindow: Jt }), m("WindowList"))(xI);
//#endregion
//#region src/components/WindowListButton.jsx
function wI({ disabled: e = !1, windowCount: t }) {
let { t: n } = V(), [r, i] = L(null), a = jn(), o = () => {
i(null);
}, s = (e) => {
i(e.currentTarget);
};
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(fn, {
"aria-haspopup": "true",
"aria-label": n("listAllOpenWindows"),
"aria-owns": r ? a : null,
selected: !!r,
disabled: e,
badge: !0,
BadgeProps: {
badgeContent: t,
sx: { ".MuiBadge-badge": { paddingLeft: 1.5 } }
},
onClick: (e) => s(e),
children: /* @__PURE__ */ z(SI, {})
}), !!r && /* @__PURE__ */ z(CI, {
anchorEl: r,
id: a,
open: !!r,
handleClose: o
})] });
}
wI.propTypes = {
disabled: W.default.bool,
windowCount: W.default.number.isRequired
};
//#endregion
//#region src/containers/MosaicRenderPreview.js
var TI = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
var n = Ae();
function r(e, t) {
return n(e, t);
}
t.exports = r;
})))(), 1), EI = n(w((e, { windowId: t }) => ({ title: st(e, { windowId: t }) }), null), m("MosaicRenderPreview"))(_I), DI = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, n) => {
var r = Fw(), i = t();
function a(e, t, n) {
var a = e == null ? 0 : e.length;
return a ? (t = n || t === void 0 ? 1 : i(t), t = a - t, r(e, 0, t < 0 ? 0 : t)) : [];
}
n.exports = a;
})))(), 1), OI = class {
constructor(e) {
this.layout = e;
}
pathToCorner(e = kM.TOP_RIGHT) {
return IM(this.layout, e);
}
pathToParent(e) {
return BM(this.layout, (0, DI.default)(e));
}
nodeAtPath(e) {
return BM(this.layout, e);
}
addWindows(e) {
e.forEach((t, n) => {
let r = this.pathToCorner(), i = this.pathToParent(r), a = this.nodeAtPath(r), o = i ? FM(i.direction) : "row", s;
s = o === "row" ? [a, e[n]] : [e[n], a];
let c = {
path: r,
spec: { $set: {
type: "split",
direction: o,
children: s
} }
};
this.layout = KM(this.layout, [c]);
});
}
removeWindows(e, t) {
let n = e.map((e) => qM(this.layout, t[e]));
this.layout = KM(this.layout, n);
}
}, kI = {
".mosaic": {
height: "100%",
width: "100%"
},
".mosaic, .mosaic > *": { boxSizing: "border-box" },
".mosaic .mosaic-zero-state": {
position: "absolute",
top: 6,
right: 6,
bottom: 6,
left: 6,
width: "auto",
height: "auto",
zIndex: "1"
},
".mosaic-root": {
position: "absolute",
top: 3,
right: 3,
bottom: 3,
left: 3
},
".mosaic-split": {
position: "absolute",
zIndex: "1",
touchAction: "none"
},
".mosaic-split:hover": { background: "black" },
".mosaic-split .mosaic-split-line": { position: "absolute" },
".mosaic-split.-row": {
marginLeft: -3,
width: 6,
cursor: "ew-resize"
},
".mosaic-split.-row .mosaic-split-line": {
top: "0",
bottom: "0",
left: 3,
right: 3
},
".mosaic-split.-column": {
marginTop: -3,
height: 6,
cursor: "ns-resize"
},
".mosaic-split.-column .mosaic-split-line": {
top: 3,
bottom: 3,
left: "0",
right: "0"
},
".mosaic-tile": {
position: "absolute",
margin: 3
},
".mosaic-tile > *": {
height: "100%",
width: "100%"
},
".mosaic-drop-target": { position: "relative" },
".mosaic-drop-target.drop-target-hover .drop-target-container": { display: "block" },
".mosaic-drop-target.mosaic > .drop-target-container .drop-target.left": { right: "calc(100% - 10px )" },
".mosaic-drop-target.mosaic > .drop-target-container .drop-target.right": { left: "calc(100% - 10px )" },
".mosaic-drop-target.mosaic > .drop-target-container .drop-target.bottom": { top: "calc(100% - 10px )" },
".mosaic-drop-target.mosaic > .drop-target-container .drop-target.top": { bottom: "calc(100% - 10px )" },
".mosaic-drop-target .drop-target-container": {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
display: "none"
},
".mosaic-drop-target .drop-target-container.-dragging": { display: "block" },
".mosaic-drop-target .drop-target-container .drop-target": {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
background: "rgba(0, 0, 0, 0.2)",
border: "2px solid black",
opacity: "0",
zIndex: "5"
},
".mosaic-drop-target .drop-target-container .drop-target.left": { right: "calc(100% - 30% )" },
".mosaic-drop-target .drop-target-container .drop-target.right": { left: "calc(100% - 30% )" },
".mosaic-drop-target .drop-target-container .drop-target.bottom": { top: "calc(100% - 30% )" },
".mosaic-drop-target .drop-target-container .drop-target.top": { bottom: "calc(100% - 30% )" },
".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover": { opacity: "1" },
".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.left": { right: "calc(100% - 50% )" },
".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.right": { left: "calc(100% - 50% )" },
".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.bottom": { top: "calc(100% - 50% )" },
".mosaic-drop-target .drop-target-container .drop-target.drop-target-hover.top": { bottom: "calc(100% - 50% )" },
".mosaic-window, .mosaic-preview": {
position: "relative",
display: "flex",
fallbacks: [{ display: "-webkit-box" }],
webkitBoxOrient: "vertical",
webkitBoxDirection: "normal",
flexDirection: "column",
overflow: "hidden",
boxShadow: "0 0 1px rgba(0, 0, 0, 0.2)"
},
".mosaic-window .mosaic-window-toolbar, .mosaic-preview .mosaic-window-toolbar": {
zIndex: "4",
display: "flex",
fallbacks: [{ display: "-webkit-box" }],
webkitBoxPack: "justify",
justifyContent: "space-between",
webkitBoxAlign: "center",
alignItems: "center",
flexShrink: "0",
height: 30,
background: "white",
boxShadow: "0 1px 1px rgba(0, 0, 0, 0.2)"
},
".mosaic-window .mosaic-window-toolbar.draggable, .mosaic-preview .mosaic-window-toolbar.draggable": { cursor: "move" },
".mosaic-window .mosaic-window-title, .mosaic-preview .mosaic-window-title": {
paddingLeft: 15,
webkitBoxFlex: "1",
flex: "1",
textOverflow: "ellipsis",
whiteSpace: "nowrap",
overflow: "hidden",
minHeight: 18
},
".mosaic-window .mosaic-window-controls, .mosaic-preview .mosaic-window-controls": {
display: "flex",
fallbacks: [{ display: "-webkit-box" }],
height: "100%"
},
".mosaic-window .mosaic-window-controls .separator, .mosaic-preview .mosaic-window-controls .separator": {
height: 20,
borderLeft: "1px solid black",
margin: "5px 4px"
},
".mosaic-window .mosaic-window-body, .mosaic-preview .mosaic-window-body": {
position: "relative",
webkitBoxFlex: "1",
flex: "1",
height: "0",
background: "white",
zIndex: "1",
overflow: "hidden"
},
".mosaic-window .mosaic-window-additional-actions-bar, .mosaic-preview .mosaic-window-additional-actions-bar": {
position: "absolute",
top: 30,
right: "0",
bottom: "initial",
left: "0",
height: "0",
overflow: "hidden",
background: "white",
webkitBoxPack: "end",
justifyContent: "flex-end",
display: "flex",
fallbacks: [{ display: "-webkit-box" }],
zIndex: "3"
},
".mosaic-window .mosaic-window-additional-actions-bar .bp3-button, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button": { margin: "0" },
".mosaic-window .mosaic-window-additional-actions-bar .bp3-button:after, .mosaic-preview .mosaic-window-additional-actions-bar .bp3-button:after": { display: "none" },
".mosaic-window .mosaic-window-body-overlay, .mosaic-preview .mosaic-window-body-overlay": {
position: "absolute",
top: "0",
right: "0",
bottom: "0",
left: "0",
opacity: "0",
background: "white",
display: "none",
zIndex: "2"
},
".mosaic-window.additional-controls-open .mosaic-window-additional-actions-bar, .mosaic-preview.additional-controls-open .mosaic-window-additional-actions-bar": { height: 30 },
".mosaic-window.additional-controls-open .mosaic-window-body-overlay, .mosaic-preview.additional-controls-open .mosaic-window-body-overlay": { display: "block" },
".mosaic-window .mosaic-preview, .mosaic-preview .mosaic-preview": {
height: "100%",
width: "100%",
position: "absolute",
zIndex: "0",
border: "1px solid black",
maxHeight: 400
},
".mosaic-window .mosaic-preview .mosaic-window-body, .mosaic-preview .mosaic-preview .mosaic-window-body": {
display: "flex",
fallbacks: [{ display: "-webkit-box" }],
webkitBoxOrient: "vertical",
webkitBoxDirection: "normal",
flexDirection: "column",
webkitBoxAlign: "center",
alignItems: "center",
webkitBoxPack: "center",
justifyContent: "center"
},
".mosaic-window .mosaic-preview h4, .mosaic-preview .mosaic-preview h4": { marginBottom: 10 },
".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.close-button:before": { content: "'Close'" },
".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.split-button:before": { content: "'Split'" },
".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.replace-button:before": { content: "'Replace'" },
".mosaic:not(.mosaic-blueprint-theme) .mosaic-default-control.expand-button:before": { content: "'Expand'" }
}, AI = H(ON)({
"& .mosaic-preview": { boxShadow: "none" },
"& .mosaic-tile": { boxShadow: "0 1px 3px 0 rgba(0, 0, 0, .2), 0 1px 1px 0 rgba(0, 0, 0, .2), 0 2px 1px -1px rgba(0, 0, 0, .2)" },
"& .mosaic-window": { boxShadow: "none" },
"& .mosaic-window-toolbar": { display: "none !important" }
}), jI = ({ windowId: e }) => /* @__PURE__ */ z("div", {
className: "mosaic-preview",
"aria-hidden": !0,
children: /* @__PURE__ */ z(EI, { windowId: e })
});
jI.propTypes = { windowId: W.default.string.isRequired };
var MI = () => /* @__PURE__ */ z("div", {}), NI = (e, t, n = {}) => {
let r = LM(e), i = new OI(e), a = t.filter((e) => !r.includes(e));
a.length > 0 && i.addWindows(a);
let o = r.filter((e) => !t.includes(e));
if (o.every((e) => n[e])) i.removeWindows(o, n);
else return PM(t);
return i.layout;
};
function PI({ layout: e = void 0, updateWorkspaceMosaicLayout: t, windowIds: n = [], workspaceId: r }) {
let i = I({}), a = An(Nb), o = e && RM(e);
F(() => {
let e = LM(o);
if (!o || n.length === 0 || e.length < 2) {
t(PM(n));
return;
}
if (n.every((t) => e.includes(t)) && e.every((e) => n.includes(e))) return;
let r = NI(o, n, i.current);
(0, TI.default)(r, o) || t(r);
}, [
o,
n,
i,
t
]);
let s = [], c = (e, t) => n.includes(e) ? (i.current[e] = t, /* @__PURE__ */ z(MN, {
toolbarControls: s,
path: t,
windowId: e,
renderPreview: jI,
children: /* @__PURE__ */ z(VF, { windowId: e }, `${e}-${r}`)
})) : null, l = (e) => {
t(e);
};
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(ai, { styles: { ...kI } }), /* @__PURE__ */ z(AI, {
dragAndDropManager: a.dragDropManager,
renderTile: c,
initialValue: o || PM(n),
onChange: l,
className: (0, G.default)("mirador-mosaic"),
zeroStateView: /* @__PURE__ */ z(MI, {})
})] });
}
PI.propTypes = {
layout: W.default.oneOfType([W.default.object, W.default.string]),
updateWorkspaceMosaicLayout: W.default.func.isRequired,
windowIds: W.default.arrayOf(W.default.string),
workspaceId: W.default.string.isRequired
};
var FI = n(w((e) => ({
layout: _(e).layout,
windowIds: _(e).windowIds,
workspaceId: _(e).id
}), { updateWorkspaceMosaicLayout: Yi }), m("WorkspaceMosaic"))(PI), II = n(w((e) => ({
elasticLayout: oe(e),
workspace: _(e)
}), (e, t) => ({
setWorkspaceViewportDimensions: (t) => {
e(Qi(t));
},
setWorkspaceViewportPosition: (t) => {
e(Zi(t));
},
updateElasticWindowLayout: (t, n) => {
e(sa(t, n));
}
})), m("WorkspaceElastic"))(qF), LI = H("div", {
name: "Workspace",
slot: "root"
})(() => ({
height: "100%",
position: "relative",
width: "100%"
})), RI = () => {
let { t: e } = V();
return /* @__PURE__ */ z(LI, { children: /* @__PURE__ */ z(ri, {
container: !0,
style: {
height: "100%",
justifyContent: "center"
},
sx: { alignItems: "center" },
children: /* @__PURE__ */ z(ri, {
size: 12,
children: /* @__PURE__ */ z(U, {
variant: "h1",
component: "div",
align: "center",
children: e("welcome")
})
})
}) });
};
RI.propTypes = {};
function zI({ addWindow: e = () => {}, allowNewWindows: t = !0, maximizedWindowIds: n = [], windowIds: r = [], workspaceId: i, workspaceType: a }) {
let { t: o } = V();
return /* @__PURE__ */ z(oI, {
onDrop: ({ canvasId: n, manifestId: r, manifestJson: i }, a, o) => {
t && e({
canvasId: n,
manifest: i,
manifestId: r
});
},
children: /* @__PURE__ */ B(LI, {
ownerState: {
allowNewWindows: t,
maximizedWindowIds: n,
windowIds: r,
workspaceId: i,
workspaceType: a
},
className: (0, G.default)(j("workspace-viewport")),
children: [/* @__PURE__ */ z(U, {
style: gn,
component: "h1",
children: o("miradorViewer")
}), (() => {
if (n.length > 0 && n.length > 0) return n.map((e) => /* @__PURE__ */ z(VF, {
windowId: e,
className: (0, G.default)(j("workspace-maximized-window"))
}, `${e}-${i}`));
if (r.length === 0) return /* @__PURE__ */ z(RI, {});
switch (a) {
case "elastic": return /* @__PURE__ */ z(II, {});
case "mosaic": return /* @__PURE__ */ z(FI, {});
default: return r.map((e) => /* @__PURE__ */ z(VF, { windowId: e }, `${e}-${i}`));
}
})()]
})
});
}
zI.propTypes = {
addWindow: W.default.func,
allowNewWindows: W.default.bool,
maximizedWindowIds: W.default.arrayOf(W.default.string),
windowIds: W.default.arrayOf(W.default.string),
workspaceId: W.default.string.isRequired,
workspaceType: W.default.string.isRequired
};
//#endregion
//#region node_modules/@mui/icons-material/esm/AddSharp.js
var BI = M(/*#__PURE__*/ z("path", { d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z" }), "AddSharp"), VI = n(w(null, { addResource: ha }), m("ManifestForm"))(lI), HI = n(w((e, { manifestId: t, provider: n }) => {
let r = b(e, { manifestId: t }) || {}, i = Le(e, { manifestId: t }), a = (i || { isCollection: () => !1 }).isCollection(), o = a ? i.getTotalItems() : ct(e, { manifestId: t }).length;
return {
active: C(e).includes(t),
error: r.error || !i && !!r.json,
isCollection: a,
isFetching: r.isFetching,
isMultipart: a && ye(e, { manifestId: t }).includes("multi-part"),
manifestLogo: pe(e, { manifestId: t }),
provider: n || fe(e, { manifestId: t }),
ready: !!r.json,
size: o,
thumbnail: nt(e, { manifestId: t }),
title: st(e, { manifestId: t })
};
}, {
addWindow: Qt,
fetchManifest: Gi
}), m("ManifestListItem"))(gI), UI = H("div")(() => ({
boxSizing: "border-box",
height: "100%",
overflowX: "hidden",
overflowY: "auto"
})), WI = H(fn)(() => ({
marginLeft: -12,
marginRight: 20
}));
function GI({ addResource: e = () => {}, catalog: t = [], setWorkspaceAddVisibility: n, ...r }) {
let { t: i } = V(), [a, o] = L(!1), s = I(), [c, l] = L("100%"), u = () => {
s.current && l(s.current.offsetWidth);
}, d = ({ manifestId: t, manifestJson: n }, r, i) => {
n ? e(t, n, { provider: "file" }) : e(t), p();
}, f = () => {
o(!1), p();
}, p = () => {
s.current && s.current.scrollTo({
behavior: "smooth",
left: 0,
top: 0
});
}, m = t.map((e, t) => /* @__PURE__ */ Cn(HI, {
...t === 0 && { buttonRef: (e) => e && e.focus() },
key: e.manifestId,
manifestId: e.manifestId,
provider: e.provider,
handleClose: () => n(!1)
})), h = {
addResource: e,
catalog: t,
setWorkspaceAddVisibility: n,
t: i,
...r
};
return F(() => (window.addEventListener("resize", u), u(), () => {
window.removeEventListener("resize", u);
}), []), /* @__PURE__ */ z(oI, {
onDrop: d,
children: /* @__PURE__ */ B(UI, {
className: (0, G.default)(j("workspace-add")),
ref: s,
children: [
t.length < 1 ? /* @__PURE__ */ z(ri, {
container: !0,
style: { height: "100%" },
sx: { alignItems: "center" },
children: /* @__PURE__ */ z(ri, {
size: 12,
children: /* @__PURE__ */ z(U, {
variant: "h1",
component: "div",
align: "center",
children: i("emptyResourceList")
})
})
}) : /* @__PURE__ */ B(Fn, {
sx: { margin: 2 },
children: [
/* @__PURE__ */ z(U, {
style: gn,
component: "h1",
children: i("miradorResources")
}),
/* @__PURE__ */ z(on, {
targetName: "WorkspaceAdd",
...h
}),
/* @__PURE__ */ z(yr, {
disablePadding: !0,
children: m
})
]
}),
/* @__PURE__ */ B(oi, {
variant: "extended",
disabled: a,
sx: (e) => ({
bottom: e.spacing(2),
position: "absolute",
right: e.spacing(2)
}),
className: (0, G.default)(j("add-resource-button")),
"aria-label": i("addResource"),
color: "primary",
onClick: () => o(!0),
children: [/* @__PURE__ */ z(BI, {}), i("addResource")]
}),
/* @__PURE__ */ z(jr, {
sx: (e) => ({
".MuiDrawer-paper": {
borderTop: "0",
left: "unset",
width: c
},
...!a && { display: "none" }
}),
variant: "persistent",
anchor: "bottom",
open: a,
ModalProps: {
disablePortal: !0,
hideBackdrop: !0,
style: { position: "absolute" }
},
children: /* @__PURE__ */ B(Fn, {
sx: {
left: "0",
marginTop: 6,
paddingBottom: 2,
paddingLeft: {
sm: 3,
xs: 2
},
paddingRight: {
sm: 3,
xs: 2
},
paddingTop: 2,
right: "0"
},
children: [/* @__PURE__ */ z(Tr, {
position: "absolute",
color: "primary",
enableColorOnDark: !0,
onClick: () => o(!1),
children: /* @__PURE__ */ B(Xn, {
variant: "dense",
children: [/* @__PURE__ */ z(WI, {
"aria-label": i("closeAddResourceForm"),
color: "inherit",
children: /* @__PURE__ */ z(yI, {})
}), /* @__PURE__ */ z(U, {
variant: "h2",
noWrap: !0,
sx: {
color: "inherit",
flexGrow: 1
},
children: i("addResource")
})]
})
}), /* @__PURE__ */ z(VI, {
addResourcesOpen: a,
onSubmit: f,
onCancel: () => o(!1)
})]
})
})
]
})
});
}
GI.propTypes = {
addResource: W.default.func,
catalog: W.default.arrayOf(W.default.shape({
manifestId: W.default.string.isRequired,
provider: W.default.string
})),
setWorkspaceAddVisibility: W.default.func.isRequired
};
//#endregion
//#region src/components/WorkspaceAddButton.jsx
function KI() {
let e = Bn();
return [...e.breakpoints.keys].reverse().reduce((t, n) => {
let r = si(e.breakpoints.up(n));
return !t && r ? n : t;
}, null) || "xs";
}
var qI = H(oi, {
name: "WorkspaceAddButton",
slot: "root"
})(({ theme: e }) => ({
marginBottom: e.spacing(1),
"&:hover, &.Mui-focusVisible": { backgroundColor: (e.vars || e).palette.primary.dark },
...e.applyStyles("dark", { "&:hover, &.Mui-focusVisible": { backgroundColor: (e.vars || e).palette.primary.light } })
}));
function JI({ setWorkspaceAddVisibility: e, isWorkspaceAddVisible: t = !1, useExtendedFab: n }) {
let r = KI(), { t: i } = V();
return /* @__PURE__ */ z(Gn, {
title: i(t ? "closeAddResourceMenu" : "addResource"),
children: /* @__PURE__ */ B(qI, {
size: "medium",
color: "primary",
id: "addBtn",
focusRipple: !1,
"aria-label": t ? i("closeAddResourceMenu") : n && r !== "xs" && i("startHere") || i("addResource"),
variant: n && r !== "xs" ? "extended" : "circular",
onClick: () => {
e(!t);
},
children: [z(t ? ks : BI, {}), n && r !== "xs" && i("startHere")]
})
});
}
JI.propTypes = {
isWorkspaceAddVisible: W.default.bool,
setWorkspaceAddVisibility: W.default.func.isRequired,
useExtendedFab: W.default.bool.isRequired
};
var YI = n(w((e) => ({ error: Xe(e) }), { removeError: Vi }), m("ErrorDialog"))(tI), XI = n(w((e, { width: t }) => {
let { isWorkspaceAddVisible: n } = _(e);
return {
isWorkspaceAddVisible: n,
useExtendedFab: !n && x(e).length === 0
};
}, { setWorkspaceAddVisibility: Xi }), m("WorkspaceAddButton"))(JI), ZI = M(/*#__PURE__*/ z("path", { d: "m19.44 12.99-.01.02c.04-.33.08-.67.08-1.01s-.03-.66-.07-.99l.01.02 2.44-1.92-2.43-4.22-2.87 1.16.01.01c-.52-.4-1.09-.74-1.71-1h.01L14.44 2H9.57l-.44 3.07h.01c-.62.26-1.19.6-1.71 1l.01-.01-2.88-1.17-2.44 4.22 2.44 1.92.01-.02c-.04.33-.07.65-.07.99s.03.68.08 1.01l-.01-.02-2.1 1.65-.33.26 2.43 4.2 2.88-1.15-.02-.04c.53.41 1.1.75 1.73 1.01h-.03L9.58 22h4.85s.03-.18.06-.42l.38-2.65h-.01c.62-.26 1.2-.6 1.73-1.01l-.02.04 2.88 1.15 2.43-4.2s-.14-.12-.33-.26zM12 15.5c-1.93 0-3.5-1.57-3.5-3.5s1.57-3.5 3.5-3.5 3.5 1.57 3.5 3.5-1.57 3.5-3.5 3.5" }), "SettingsSharp"), QI = n(w((e) => ({ languages: Pe(e) }), (e, { afterSelect: t }) => ({ handleClick: (n) => {
e(Ri({ language: n })), t && t();
} })), m("LanguageSettings"))(cI);
//#endregion
//#region src/components/icons/WorkspaceTypeElasticIcon.jsx
function $I(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "120",
height: "90",
viewBox: "0 0 300 225",
children: [/* @__PURE__ */ B("defs", { children: [
/* @__PURE__ */ B("linearGradient", {
id: "linear-gradient",
x1: "0.5",
y1: "1",
x2: "0.5",
gradientUnits: "objectBoundingBox",
children: [
/* @__PURE__ */ z("stop", { offset: "0" }),
/* @__PURE__ */ z("stop", {
offset: "0.14",
stopOpacity: "0.631"
}),
/* @__PURE__ */ z("stop", {
offset: "1",
stopOpacity: "0"
})
]
}),
/* @__PURE__ */ B("linearGradient", {
id: "linear-gradient-2",
x1: "0.5",
y1: "1",
x2: "0.5",
gradientUnits: "objectBoundingBox",
children: [
/* @__PURE__ */ z("stop", {
offset: "0",
stopColor: "#fff",
stopOpacity: "0"
}),
/* @__PURE__ */ z("stop", {
offset: "0.23",
stopColor: "#fff",
stopOpacity: "0.012"
}),
/* @__PURE__ */ z("stop", {
offset: "0.36",
stopColor: "#fff",
stopOpacity: "0.039"
}),
/* @__PURE__ */ z("stop", {
offset: "0.47",
stopColor: "#fff",
stopOpacity: "0.102"
}),
/* @__PURE__ */ z("stop", {
offset: "0.57",
stopColor: "#fff",
stopOpacity: "0.18"
}),
/* @__PURE__ */ z("stop", {
offset: "0.67",
stopColor: "#fff",
stopOpacity: "0.278"
}),
/* @__PURE__ */ z("stop", {
offset: "0.75",
stopColor: "#fff",
stopOpacity: "0.412"
}),
/* @__PURE__ */ z("stop", {
offset: "0.83",
stopColor: "#fff",
stopOpacity: "0.561"
}),
/* @__PURE__ */ z("stop", {
offset: "0.91",
stopColor: "#fff",
stopOpacity: "0.741"
}),
/* @__PURE__ */ z("stop", {
offset: "0.98",
stopColor: "#fff",
stopOpacity: "0.929"
}),
/* @__PURE__ */ z("stop", {
offset: "1",
stopColor: "#fff"
})
]
}),
/* @__PURE__ */ z("clipPath", {
id: "clip-elastic_icon",
children: /* @__PURE__ */ z("rect", {
width: "300",
height: "225"
})
})
] }), /* @__PURE__ */ B("g", {
id: "elastic_icon",
"data-name": "elastic icon",
clipPath: "url(#clip-elastic_icon)",
children: [
/* @__PURE__ */ z("rect", {
width: "300",
height: "225",
fill: "#fff"
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_278",
"data-name": "Rectangle 278",
transform: "translate(232 159)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "54",
height: "54",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "53",
height: "53",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_8",
"data-name": "Rectangle 8",
transform: "translate(7 148)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "70",
height: "70",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "69",
height: "69",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_258",
"data-name": "Rectangle 258",
transform: "translate(224 6)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "70",
height: "100",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "69",
height: "99",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_259",
"data-name": "Rectangle 259",
transform: "translate(71 64)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "115",
height: "75",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "114",
height: "74",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_260",
"data-name": "Rectangle 260",
transform: "translate(99 87)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "115",
height: "75",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "114",
height: "74",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Group_689",
"data-name": "Group 689",
children: [
/* @__PURE__ */ B("g", {
id: "Group_687",
"data-name": "Group 687",
transform: "translate(0 3)",
children: [/* @__PURE__ */ z("path", {
id: "checkbox",
d: "M258.766,37.316v146.5H39.053V37.316Zm40.07-39.254h-300v225h300Z",
transform: "translate(1.164 -1.063)",
fill: "#010101",
fillRule: "evenodd",
opacity: "0.246"
}), /* @__PURE__ */ B("g", {
id: "Path_821",
"data-name": "Path 821",
transform: "translate(40 36)",
fill: "none",
children: [/* @__PURE__ */ z("path", {
d: "M0,0H220V147H0Z",
stroke: "none"
}), /* @__PURE__ */ z("path", {
d: "M 2 2 L 2 145 L 218 145 L 218 2 L 172.9869689941406 2 L 2 2 M 0 0 L 172.9869689941406 0 L 220 0 L 220 147 L 0 147 L 0 0 Z",
stroke: "none",
fill: "#01579b"
})]
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_257",
"data-name": "Rectangle 257",
transform: "translate(40 39)",
fill: "#fff",
stroke: "#01579b",
strokeWidth: "2",
children: [/* @__PURE__ */ z("rect", {
width: "20",
height: "147",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "1",
y: "1",
width: "18",
height: "145",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Group_688",
"data-name": "Group 688",
transform: "translate(-27.5 -126)",
children: [/* @__PURE__ */ z("circle", {
id: "teal_circle",
"data-name": "teal circle",
cx: "7.5",
cy: "7.5",
r: "7.5",
transform: "translate(70 171)",
fill: "#009688"
}), /* @__PURE__ */ B("g", {
id: "Group_333",
"data-name": "Group 333",
transform: "translate(70 171)",
opacity: "0.12",
children: [/* @__PURE__ */ z("path", {
id: "gradient_border_2",
"data-name": "gradient border 2",
d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
transform: "translate(-3403 -959)",
fill: "url(#linear-gradient)"
}), /* @__PURE__ */ z("path", {
id: "gradient_border_1",
"data-name": "gradient border 1",
d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
transform: "translate(-3403 -959)",
fill: "url(#linear-gradient-2)"
})]
})]
})
]
})
]
})]
})
});
}
//#endregion
//#region src/components/icons/WorkspaceTypeMosaicIcon.jsx
function eL(e) {
return /* @__PURE__ */ z(kr, {
...e,
children: /* @__PURE__ */ B("svg", {
xmlns: "http://www.w3.org/2000/svg",
width: "120",
height: "90",
viewBox: "0 0 300 225",
children: [/* @__PURE__ */ B("defs", { children: [
/* @__PURE__ */ B("linearGradient", {
id: "linear-gradient",
x1: "0.5",
y1: "1",
x2: "0.5",
gradientUnits: "objectBoundingBox",
children: [
/* @__PURE__ */ z("stop", { offset: "0" }),
/* @__PURE__ */ z("stop", {
offset: "0.14",
stopOpacity: "0.631"
}),
/* @__PURE__ */ z("stop", {
offset: "1",
stopOpacity: "0"
})
]
}),
/* @__PURE__ */ B("linearGradient", {
id: "linear-gradient-2",
x1: "0.5",
y1: "1",
x2: "0.5",
gradientUnits: "objectBoundingBox",
children: [
/* @__PURE__ */ z("stop", {
offset: "0",
stopColor: "#fff",
stopOpacity: "0"
}),
/* @__PURE__ */ z("stop", {
offset: "0.23",
stopColor: "#fff",
stopOpacity: "0.012"
}),
/* @__PURE__ */ z("stop", {
offset: "0.36",
stopColor: "#fff",
stopOpacity: "0.039"
}),
/* @__PURE__ */ z("stop", {
offset: "0.47",
stopColor: "#fff",
stopOpacity: "0.102"
}),
/* @__PURE__ */ z("stop", {
offset: "0.57",
stopColor: "#fff",
stopOpacity: "0.18"
}),
/* @__PURE__ */ z("stop", {
offset: "0.67",
stopColor: "#fff",
stopOpacity: "0.278"
}),
/* @__PURE__ */ z("stop", {
offset: "0.75",
stopColor: "#fff",
stopOpacity: "0.412"
}),
/* @__PURE__ */ z("stop", {
offset: "0.83",
stopColor: "#fff",
stopOpacity: "0.561"
}),
/* @__PURE__ */ z("stop", {
offset: "0.91",
stopColor: "#fff",
stopOpacity: "0.741"
}),
/* @__PURE__ */ z("stop", {
offset: "0.98",
stopColor: "#fff",
stopOpacity: "0.929"
}),
/* @__PURE__ */ z("stop", {
offset: "1",
stopColor: "#fff"
})
]
}),
/* @__PURE__ */ z("clipPath", {
id: "clip-mosaic_icon",
children: /* @__PURE__ */ z("rect", {
width: "300",
height: "225"
})
})
] }), /* @__PURE__ */ B("g", {
id: "mosaic_icon",
"data-name": "mosaic icon",
clipPath: "url(#clip-mosaic_icon)",
children: [
/* @__PURE__ */ z("rect", {
width: "300",
height: "225",
fill: "#fff"
}),
/* @__PURE__ */ z("path", {
id: "checkbox",
d: "M258.766,37.316v146.5H39.053V37.316Zm40.07-39.254h-300v225h300Z",
transform: "translate(1.163 1.938)",
fill: "#010101",
fillRule: "evenodd",
opacity: "0.5"
}),
/* @__PURE__ */ z("path", {
id: "checkbox-2",
"data-name": "checkbox",
d: "M258.766,37.316v146.5H39.053V37.316Zm40.07-39.254h-300v225h300Z",
transform: "translate(1.164 1.938)",
fill: "#010101",
fillRule: "evenodd",
opacity: "0.246"
}),
/* @__PURE__ */ B("g", {
id: "Path_821",
"data-name": "Path 821",
transform: "translate(40 39)",
fill: "none",
children: [/* @__PURE__ */ z("path", {
d: "M0,0H220V147H0Z",
stroke: "none"
}), /* @__PURE__ */ z("path", {
d: "M 2 2 L 2 145 L 218 145 L 218 2 L 172.9869689941406 2 L 2 2 M 0 0 L 172.9869689941406 0 L 220 0 L 220 147 L 0 147 L 0 0 Z",
stroke: "none",
fill: "#01579b"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_257",
"data-name": "Rectangle 257",
transform: "translate(40 39)",
fill: "#fff",
stroke: "#01579b",
strokeWidth: "2",
children: [/* @__PURE__ */ z("rect", {
width: "20",
height: "147",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "1",
y: "1",
width: "18",
height: "145",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Group_688",
"data-name": "Group 688",
transform: "translate(-27.5 -126)",
children: [/* @__PURE__ */ z("circle", {
id: "teal_circle",
"data-name": "teal circle",
cx: "7.5",
cy: "7.5",
r: "7.5",
transform: "translate(70 171)",
fill: "#009688"
}), /* @__PURE__ */ B("g", {
id: "Group_333",
"data-name": "Group 333",
transform: "translate(70 171)",
opacity: "0.12",
children: [/* @__PURE__ */ z("path", {
id: "gradient_border_2",
"data-name": "gradient border 2",
d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
transform: "translate(-3403 -959)",
fill: "url(#linear-gradient)"
}), /* @__PURE__ */ z("path", {
id: "gradient_border_1",
"data-name": "gradient border 1",
d: "M3408,959.089A4.911,4.911,0,1,1,3403.09,964a4.911,4.911,0,0,1,4.911-4.911m0-.089a5,5,0,1,0,5,5,5,5,0,0,0-5-5Z",
transform: "translate(-3403 -959)",
fill: "url(#linear-gradient-2)"
})]
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_270",
"data-name": "Rectangle 270",
transform: "translate(60 40.647)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "99",
height: "72",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "98",
height: "71",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_271",
"data-name": "Rectangle 271",
transform: "translate(159 40.647)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "99",
height: "72",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "98",
height: "71",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_272",
"data-name": "Rectangle 272",
transform: "translate(192 112.647)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "66",
height: "71.45",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "65",
height: "70.45",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_284",
"data-name": "Rectangle 284",
transform: "translate(60 112.647)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "66",
height: "71.45",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "65",
height: "70.45",
fill: "none"
})]
}),
/* @__PURE__ */ B("g", {
id: "Rectangle_285",
"data-name": "Rectangle 285",
transform: "translate(126 112.647)",
fill: "#88c6c3",
stroke: "#707070",
strokeWidth: "1",
opacity: "0.747",
children: [/* @__PURE__ */ z("rect", {
width: "66",
height: "71.45",
stroke: "none"
}), /* @__PURE__ */ z("rect", {
x: "0.5",
y: "0.5",
width: "65",
height: "70.45",
fill: "none"
})]
})
]
})]
})
});
}
//#endregion
//#region src/components/WorkspaceSelectionDialog.jsx
var tL = H("div")(() => ({
display: "flex",
flexDirection: "column"
}));
function nL({ container: e = null, handleClose: t, open: n = !1, children: r = null, updateWorkspace: i, workspaceType: a }) {
let { t: o } = V(), s = jn(), c = (e) => {
i({ type: e }), t();
};
return /* @__PURE__ */ B(QF, {
"aria-labelledby": s,
container: e,
onClose: t,
open: n,
children: [/* @__PURE__ */ z(ei, {
id: s,
children: o("workspaceSelectionTitle")
}), /* @__PURE__ */ B(eF, { children: [r, /* @__PURE__ */ B(Jr, {
sx: {
"&active": { outline: "none" },
"&focus": { outline: "none" },
outline: "none"
},
selected: a,
autoFocusItem: !0,
children: [/* @__PURE__ */ z(qr, {
sx: {
height: "auto",
overflow: "auto",
whiteSpace: "inherit"
},
onClick: () => c("elastic"),
selected: a === "elastic",
value: "elastic",
children: /* @__PURE__ */ B(Ir, {
sx: {
backgroundColor: "transparent",
borderRadius: "0",
boxShadow: "0 0 transparent",
display: "flex"
},
children: [/* @__PURE__ */ z($I, {
sx: {
flexShrink: 0,
height: "90px",
width: "120px"
},
viewBox: "0 0 120 90"
}), /* @__PURE__ */ z(tL, { children: /* @__PURE__ */ B(Lr, {
sx: {
"&.MuiCardContent-root": {
"&:last-child": { paddingBottom: "12px" },
paddingBottom: 0,
paddingTop: 0,
textAlign: "left"
},
flex: "1 0 auto"
},
children: [/* @__PURE__ */ z(Xr, {
sx: { paddingBottom: "6px" },
component: "p",
variant: "h3",
children: o("elastic")
}), /* @__PURE__ */ z(Xr, {
variant: "body1",
children: o("elasticDescription")
})]
}) })]
})
}), /* @__PURE__ */ z(qr, {
sx: {
height: "auto",
overflow: "auto",
whiteSpace: "inherit"
},
onClick: () => c("mosaic"),
selected: a === "mosaic",
value: "mosaic",
children: /* @__PURE__ */ B(Ir, {
sx: {
backgroundColor: "transparent",
borderRadius: "0",
boxShadow: "0 0 transparent",
display: "flex"
},
children: [/* @__PURE__ */ z(eL, {
sx: {
flexShrink: 0,
height: "90px",
width: "120px"
},
viewBox: "0 0 120 90"
}), /* @__PURE__ */ z(tL, { children: /* @__PURE__ */ B(Lr, {
sx: {
"&.MuiCardContent-root": {
"&:last-child": { paddingBottom: "12px" },
paddingBottom: 0,
paddingTop: 0,
textAlign: "left"
},
flex: "1 0 auto"
},
children: [/* @__PURE__ */ z(Xr, {
sx: { paddingBottom: "6px" },
component: "p",
variant: "h3",
children: o("mosaic")
}), /* @__PURE__ */ z(Xr, {
variant: "body1",
children: o("mosaicDescription")
})]
}) })]
})
})]
})] })]
});
}
nL.propTypes = {
children: W.default.node,
container: W.default.object,
handleClose: W.default.func.isRequired,
open: W.default.bool,
updateWorkspace: W.default.func.isRequired,
workspaceType: W.default.string.isRequired
};
var rL = n(w((e) => ({ workspaceType: te(e) }), { updateWorkspace: qi }), m("WorkspaceSelectionDialog"))(nL), iL = n(w((e) => ({
selectedTheme: et(e).selectedTheme,
themeIds: Ce(e)
}), (e, { windowId: t }) => ({ setSelectedTheme: (t) => e(Ri({ selectedTheme: t })) })), m("ChangeThemeDialog"))(eI);
//#endregion
//#region src/components/WorkspaceMenu.jsx
function aL({ handleClose: e, showThemePicker: t = !1, isWorkspaceAddVisible: n = !1, tReady: r = !1, toggleZoomControls: i = () => {}, showZoomControls: a = !1, ...o }) {
let { t: s } = V(), c = An(mn), [l, u] = L(null), d = arguments[0], f = (t, n) => {
u(t), e(n);
}, p = () => {
u(null);
}, m = (t) => {
i(!a), e(t);
};
return /* @__PURE__ */ B(R, { children: [
/* @__PURE__ */ B(Ar, {
container: c?.current,
anchorOrigin: {
horizontal: "right",
vertical: "top"
},
transformOrigin: {
horizontal: "left",
vertical: "top"
},
onClose: e,
...o,
children: [
/* @__PURE__ */ z(Jn, {
"aria-haspopup": "true",
"aria-expanded": l === "workspaceSelection",
disabled: n,
onClick: (e) => {
m(e);
},
"aria-owns": l === "toggleZoom" ? "toggle-zoom-menu" : void 0,
children: /* @__PURE__ */ z(U, {
variant: "body1",
children: s(a ? "hideZoomControls" : "showZoomControls")
})
}),
/* @__PURE__ */ z(Jn, {
"aria-haspopup": "true",
onClick: (e) => {
f("workspaceSelection", e);
},
"aria-owns": l === "workspaceSelection" ? "workspace-selection" : void 0,
children: /* @__PURE__ */ z(U, {
variant: "body1",
children: s("selectWorkspaceMenu")
})
}),
/* @__PURE__ */ z(bI, {
label: s("language"),
children: /* @__PURE__ */ z(QI, { afterSelect: e })
}),
t && /* @__PURE__ */ z(Jn, {
"aria-haspopup": "true",
onClick: (e) => {
f("changeTheme", e);
},
"aria-owns": l === "changeTheme" ? "change-theme" : void 0,
children: /* @__PURE__ */ z(U, {
variant: "body1",
children: s("changeTheme")
})
}),
/* @__PURE__ */ z(on, {
targetName: "WorkspaceMenu",
...d
})
]
}),
l === "changeTheme" && /* @__PURE__ */ z(iL, {
container: c?.current,
handleClose: p,
open: l === "changeTheme"
}),
l === "workspaceSelection" && /* @__PURE__ */ z(rL, {
open: l === "workspaceSelection",
container: c?.current,
handleClose: p
})
] });
}
aL.propTypes = {
handleClose: W.default.func.isRequired,
isWorkspaceAddVisible: W.default.bool,
showThemePicker: W.default.bool,
showZoomControls: W.default.bool,
toggleZoomControls: W.default.func,
tReady: W.default.bool
};
var oL = n(w((e) => ({
isWorkspaceAddVisible: _(e).isWorkspaceAddVisible,
showThemePicker: Ce(e).length > 0,
showZoomControls: ht(e)
}), { toggleZoomControls: Ji }), m("WorkspaceMenu"))(aL);
//#endregion
//#region src/components/WorkspaceMenuButton.jsx
function sL() {
let { t: e } = V(), [t, n] = L(null), [r, i] = L(!1), a = jn();
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(fn, {
"aria-haspopup": "true",
"aria-label": e("workspaceMenu"),
"aria-owns": r ? a : void 0,
selected: r,
id: "menuBtn",
onClick: (e) => {
n(e.currentTarget), i(!0);
},
children: /* @__PURE__ */ z(ZI, {})
}), /* @__PURE__ */ z(oL, {
anchorEl: t,
id: a,
handleClose: () => {
n(null), i(!1);
},
open: r
})] });
}
var cL = n(m("WorkspaceMenuButton"))(sL), lL = M(/*#__PURE__*/ z("path", { d: "M6 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m12 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m-6 0c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2" }), "MoreHorizSharp"), uL = M(/*#__PURE__*/ z("path", { d: "M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2M11 16l4-4-4-4v3H1v2h10z" }), "Input"), dL = M(/*#__PURE__*/ z("path", { d: "M19 12v7H5v-7H3v9h18v-9zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z" }), "SaveAltSharp"), fL = M(/*#__PURE__*/ z("path", { d: "M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z" }), "Close"), pL = /* @__PURE__ */ D(((e, t) => {
t.exports = function() {
var e = document.getSelection();
if (!e.rangeCount) return function() {};
for (var t = document.activeElement, n = [], r = 0; r < e.rangeCount; r++) n.push(e.getRangeAt(r));
switch (t.tagName.toUpperCase()) {
case "INPUT":
case "TEXTAREA":
t.blur();
break;
default: t = null;
}
return e.removeAllRanges(), function() {
e.type === "Caret" && e.removeAllRanges(), e.rangeCount || n.forEach(function(t) {
e.addRange(t);
}), t && t.focus();
};
};
})), mL = /* @__PURE__ */ p((/* @__PURE__ */ D(((e, t) => {
var n = pL(), r = {
"text/plain": "Text",
"text/html": "Url",
default: "Text"
}, i = "Copy to clipboard: #{key}, Enter";
function a(e) {
var t = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C";
return e.replace(/#{\s*key\s*}/g, t);
}
function o(e, t) {
var o, s, c, l, u, d, f = !1;
t ||= {}, o = t.debug || !1;
try {
if (c = n(), l = document.createRange(), u = document.getSelection(), d = document.createElement("span"), d.textContent = e, d.ariaHidden = "true", d.style.all = "unset", d.style.position = "fixed", d.style.top = 0, d.style.clip = "rect(0, 0, 0, 0)", d.style.whiteSpace = "pre", d.style.webkitUserSelect = "text", d.style.MozUserSelect = "text", d.style.msUserSelect = "text", d.style.userSelect = "text", d.addEventListener("copy", function(n) {
if (n.stopPropagation(), t.format) {
if (n.preventDefault(), n.clipboardData === void 0) {
o && console.warn("unable to use e.clipboardData"), o && console.warn("trying IE specific stuff"), window.clipboardData.clearData();
var i = r[t.format] || r.default;
window.clipboardData.setData(i, e);
} else n.clipboardData.clearData(), n.clipboardData.setData(t.format, e);
}
t.onCopy && (n.preventDefault(), t.onCopy(n.clipboardData));
}), document.body.appendChild(d), l.selectNodeContents(d), u.addRange(l), !document.execCommand("copy")) throw Error("copy command was unsuccessful");
f = !0;
} catch (n) {
o && console.error("unable to copy using execCommand: ", n), o && console.warn("trying IE specific stuff");
try {
window.clipboardData.setData(t.format || "text", e), t.onCopy && t.onCopy(window.clipboardData), f = !0;
} catch (n) {
o && console.error("unable to copy using clipboardData: ", n), o && console.error("falling back to prompt"), s = a("message" in t ? t.message : i), window.prompt(s, e);
}
} finally {
u && (typeof u.removeRange == "function" ? u.removeRange(l) : u.removeAllRanges()), d && document.body.removeChild(d), c();
}
return f;
}
t.exports = o;
})))(), 1);
function hL({ children: e = null, container: t = null, id: n = void 0, open: r = !1, handleClose: i, exportableState: a }) {
let { t: o } = V(), [s, c] = L(!1), l = jn(), u = Pn(() => JSON.stringify(a, null, 2), [a]), d = kn(() => {
(0, mL.default)(u), c(!0);
}, [u, c]);
return s ? /* @__PURE__ */ z(ci, {
anchorOrigin: {
horizontal: "center",
vertical: "top"
},
open: !0,
autoHideDuration: 6e3,
onClose: i,
message: o("exportCopied"),
action: /* @__PURE__ */ z(Wn, {
size: "small",
"aria-label": o("dismiss"),
color: "inherit",
onClick: i,
children: /* @__PURE__ */ z(fL, { fontSize: "small" })
})
}) : /* @__PURE__ */ B(QF, {
"aria-labelledby": l,
id: n,
container: t,
open: r,
onClose: i,
scroll: "paper",
fullWidth: !0,
maxWidth: "sm",
children: [
/* @__PURE__ */ z(ei, {
id: l,
children: o("downloadExport")
}),
/* @__PURE__ */ z(Zr, { children: /* @__PURE__ */ B($n, {
slotProps: { heading: { component: "h4" } },
elevation: 2,
children: [/* @__PURE__ */ z(tr, {
expandIcon: /* @__PURE__ */ z(hl, {}),
children: /* @__PURE__ */ z(U, { children: o("viewWorkspaceConfiguration") })
}), /* @__PURE__ */ B(er, {
sx: { overflow: "scroll" },
children: [e, /* @__PURE__ */ z("pre", { children: u })]
})]
}) }),
/* @__PURE__ */ B(Qr, { children: [/* @__PURE__ */ z(ar, {
onClick: i,
children: o("cancel")
}), /* @__PURE__ */ z(ar, {
onClick: d,
variant: "contained",
color: "primary",
children: o("copy")
})] })
]
});
}
hL.propTypes = {
children: W.default.node,
container: W.default.object,
exportableState: W.default.object.isRequired,
handleClose: W.default.func.isRequired,
id: W.default.string,
open: W.default.bool
};
var gL = n(w((e) => ({ exportableState: We(e) }), {}), m("WorkspaceExport"))(hL);
//#endregion
//#region src/components/WorkspaceImport.jsx
function _L({ addError: e, container: t = null, id: n = void 0, importConfig: r, classes: i = {}, handleClose: a, open: o = !1 }) {
let { t: s } = V(), [c, l] = L(""), u = jn();
return /* @__PURE__ */ B(QF, {
"aria-labelledby": u,
container: t,
id: n,
onClose: a,
open: o,
fullWidth: !0,
maxWidth: "sm",
children: [
/* @__PURE__ */ z(ei, {
id: u,
children: s("importWorkspace")
}),
/* @__PURE__ */ z(eF, { children: /* @__PURE__ */ z(Yr, {
className: i.textField,
id: "workspace-import-input",
multiline: !0,
onChange: (e) => {
e.preventDefault(), l(e.target.value);
},
minRows: 15,
variant: "filled",
sx: {
"& .MuiInputBase-input": { fontFamily: "monospace" },
width: "100%"
},
helperText: s("importWorkspaceHint"),
slotProps: { htmlInput: { autoFocus: "autofocus" } }
}) }),
/* @__PURE__ */ B(Br, { children: [/* @__PURE__ */ z(ar, {
onClick: a,
children: s("cancel")
}), /* @__PURE__ */ z(ar, {
color: "primary",
onClick: (t) => {
try {
r(JSON.parse(c)), a();
} catch (t) {
e(t.toString());
}
},
variant: "contained",
children: s("import")
})] })
]
});
}
_L.propTypes = {
addError: W.default.func.isRequired,
classes: W.default.objectOf(W.default.string),
container: W.default.object,
handleClose: W.default.func.isRequired,
id: W.default.string,
importConfig: W.default.func.isRequired,
open: W.default.bool
};
var vL = n(w(null, {
addError: Bi,
importConfig: zi
}), m("WorkspaceImport"))(_L);
//#endregion
//#region src/components/WorkspaceOptionsMenu.jsx
function yL({ anchorEl: e = null, handleClose: t, open: n = !1, ...r }) {
let { t: i } = V(), a = An(mn), [o, s] = L(null), c = jn(), l = jn(), u = {
anchorEl: e,
container: a,
handleClose: t,
open: n,
t: i,
...r
}, d = (e) => {
s(e), t();
}, f = () => {
s(null);
};
return /* @__PURE__ */ B(R, { children: [
/* @__PURE__ */ B(Ar, {
id: "workspace-options-menu",
container: a?.current,
anchorEl: e,
anchorOrigin: {
horizontal: "right",
vertical: "top"
},
transformOrigin: {
horizontal: "left",
vertical: "top"
},
open: n,
onClose: t,
children: [
/* @__PURE__ */ B(Jn, {
"aria-haspopup": "true",
onClick: () => {
d("exportWorkspace");
},
"aria-owns": o === "exportWorkspace" ? c : void 0,
children: [/* @__PURE__ */ z(wr, { children: /* @__PURE__ */ z(dL, {}) }), /* @__PURE__ */ z(U, {
variant: "body1",
children: i("downloadExportWorkspace")
})]
}),
/* @__PURE__ */ B(Jn, {
"aria-haspopup": "true",
onClick: () => {
d("importWorkspace");
},
"aria-owns": o === "importWorkspace" ? l : void 0,
children: [/* @__PURE__ */ z(wr, { children: /* @__PURE__ */ z(uL, {}) }), /* @__PURE__ */ z(U, {
variant: "body1",
children: i("importWorkspace")
})]
}),
/* @__PURE__ */ z(on, {
targetName: "WorkspaceOptionsMenu",
...u
})
]
}),
o === "exportWorkspace" && /* @__PURE__ */ z(gL, {
id: c,
open: o === "exportWorkspace",
container: a?.current,
handleClose: f
}),
o === "importWorkspace" && /* @__PURE__ */ z(vL, {
id: l,
open: o === "importWorkspace",
container: a?.current,
handleClose: f
})
] });
}
yL.propTypes = {
anchorEl: W.default.object,
handleClose: W.default.func.isRequired,
open: W.default.bool
};
//#endregion
//#region src/containers/WorkspaceOptionsMenu.js
var bL = yL;
//#endregion
//#region src/components/WorkspaceOptionsButton.jsx
function xL() {
let { t: e } = V(), [t, n] = L(null), [r, i] = L(!1);
return /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(fn, {
"aria-label": e("workspaceOptions"),
onClick: (e) => {
n(e.currentTarget), i(!0);
},
selected: r,
children: /* @__PURE__ */ z(lL, {})
}), /* @__PURE__ */ z(bL, {
anchorEl: t,
handleClose: () => {
n(null), i(!1);
},
open: r
})] });
}
var SL = n(m("WorkspaceOptionsButton"))(xL), CL = n(w((e) => ({
disabled: _(e).isWorkspaceAddVisible,
windowCount: x(e).length
}), null), m("WindowListButton"))(wI);
//#endregion
//#region src/components/WorkspaceControlPanelButtons.jsx
function wL({ ...e }) {
return /* @__PURE__ */ B(R, { children: [
/* @__PURE__ */ z(CL, {}),
/* @__PURE__ */ z(cL, {}),
/* @__PURE__ */ z(SL, {}),
/* @__PURE__ */ z(hP, {}),
/* @__PURE__ */ z(on, {
targetName: "WorkspaceControlPanelButtons",
...e
})
] });
}
var TL = n(m("WorkspaceControlPanelButtons"))(wL), EL = m("Branding")(XF), DL = H(Tr, {
name: "WorkspaceControlPanel",
slot: "root"
})(({ ownerState: e, theme: t }) => ({
display: "flex",
height: 64,
padding: t.spacing(1),
paddingBottom: 0,
position: "relative",
[t.breakpoints.up("sm")]: {
height: "auto",
width: e.variant === "wide" ? "auto" : 64
},
...e.variant === "wide" && { width: "auto" }
})), OL = H(Xn, {
name: "WorkspaceControlPanel",
slot: "toolbar"
})(({ theme: e }) => ({
display: "flex",
flexGrow: 1,
justifyContent: "space-between",
[e.breakpoints.up("sm")]: {
flexDirection: "column",
justifyContent: "flex-start",
minHeight: 0
}
})), kL = H("div", {
name: "WorkspaceControlPanel",
slot: "buttonArea"
})(({ theme: e }) => ({ [e.breakpoints.up("sm")]: {
display: "flex",
flexDirection: "column",
gap: e.spacing(2),
marginBottom: e.spacing(1),
marginTop: e.spacing(1)
} })), AL = H(EL, {
name: "WorkspaceControlPanel",
slot: "branding"
})(({ theme: e }) => ({
[e.breakpoints.up("xs")]: { display: "none" },
[e.breakpoints.up("sm")]: { display: "flex" }
}));
function jL({ variant: e = "default", ...t }) {
let { t: n } = V();
return /* @__PURE__ */ B(DL, {
ownerState: {
t: n,
variant: e,
...t
},
className: (0, G.default)(j("workspace-control-panel")),
color: "default",
enableColorOnDark: !0,
position: "absolute",
component: "nav",
"aria-label": n("workspaceNavigation"),
children: [/* @__PURE__ */ B(OL, {
disableGutters: !0,
children: [/* @__PURE__ */ z(XI, {}), /* @__PURE__ */ z(kL, { children: /* @__PURE__ */ z(TL, {}) })]
}), /* @__PURE__ */ z(AL, { variant: e })]
});
}
jL.propTypes = { variant: W.default.oneOf(["default", "wide"]) };
var ML = n(m("WorkspaceControlPanel"))(jL), NL = n(w((e) => ({
allowNewWindows: et(e).workspace.allowNewWindows,
maximizedWindowIds: ft(e),
windowIds: x(e),
workspaceId: _(e).id,
workspaceType: te(e)
}), { addWindow: Qt }), m("Workspace"))(zI), PL = n(w((e) => ({ catalog: T(e) }), {
addResource: ha,
setWorkspaceAddVisibility: Xi
}), m("WorkspaceAdd"))(GI), FL = m("BackgroundPluginArea")(JF), IL = H("div", {
name: "WorkspaceArea",
slot: "root"
})(({ theme: e }) => ({
background: Ln(e.palette.shades.light, .1),
...e.applyStyles("dark", { background: Rn(e.palette.shades.light, .1) }),
bottom: 0,
display: "flex",
flexDirection: "column",
left: 0,
position: "absolute",
right: 0,
top: 0,
[e.breakpoints.up("sm")]: { flexDirection: "row" }
})), LL = H("main", {
name: "WorkspaceArea",
slot: "viewer"
})(() => ({
flexGrow: 1,
position: "relative"
}));
function RL({ areaRef: e = null, controlPanelVariant: t = void 0, isWorkspaceAddVisible: n = !1, isWorkspaceControlPanelVisible: r, lang: i = void 0 }) {
let { t: a } = V(), o = arguments[0];
return /* @__PURE__ */ B(IL, {
ownerState: o,
children: [r && /* @__PURE__ */ z(ML, { variant: t }), /* @__PURE__ */ B(LL, {
className: j("viewer"),
lang: i,
"aria-label": a("workspace"),
...e ? { ref: e } : {},
children: [
z(n ? PL : NL, {}),
/* @__PURE__ */ z(YI, {}),
/* @__PURE__ */ z(FL, {})
]
})]
});
}
RL.propTypes = {
areaRef: W.default.shape({ current: W.default.instanceOf(Element) }),
controlPanelVariant: W.default.string,
isWorkspaceAddVisible: W.default.bool,
isWorkspaceControlPanelVisible: W.default.bool.isRequired,
lang: W.default.string
};
//#endregion
//#region src/containers/WorkspaceArea.js
var zL = /* @__PURE__ */ d({ default: () => BL }), BL = n(w((e) => ({
controlPanelVariant: _(e).isWorkspaceAddVisible || x(e).length > 0 ? void 0 : "wide",
isWorkspaceAddVisible: _(e).isWorkspaceAddVisible,
isWorkspaceControlPanelVisible: et(e).workspaceControlPanel.enabled,
lang: et(e).language
})), m("WorkspaceArea"))(RL);
//#endregion
export { oI as $, Ml as $n, Yi as $r, QN as $t, QI as A, Vf as An, ha as Ar, GP as At, PI as B, tf as Bn, ea as Br, bP as Bt, oL as C, xi as Ci, wb as Cn, bs as Cr, hF as Ct, nL as D, Gf as Dn, Ga as Dr, $P as Dt, rL as E, ui as Ei, Kf as En, Ka as Er, eF as Et, HI as F, Sf as Fn, ua as Fr, FP as Ft, xI as G, Gl as Gn, aa as Gr, dP as Gt, EI as H, Qd as Hn, ia as Hr, gP as Ht, VI as I, xf as In, da as Ir, PP as It, gI as J, Bl as Jn, Qi as Jr, iP as Jt, bI as K, Wl as Kn, ta as Kr, uP as Kt, zI as L, pf as Ln, ca as Lr, kP as Lt, YI as M, If as Mn, ma as Mr, UP as Mt, JI as N, Ef as Nn, fa as Nr, HP as Nt, eL as O, Wf as On, Wa as Or, XP as Ot, GI as P, Tf as Pn, la as Pr, IP as Pt, cI as Q, Nl as Qn, qi as Qr, $N as Qt, II as R, ff as Rn, pa as Rr, TP as Rt, sL as S, Si, Tb as Sn, Ss as Sr, gF as St, iL as T, vi as Ti, Sb as Tn, Ya as Tr, aF as Tt, wI as U, vu as Un, na as Ur, hP as Ut, OI as V, $d as Vn, ra as Vr, _P as Vt, CI as W, q as Wn, oa as Wr, mP as Wt, uI as X, Rl as Xn, $i as Xr, tP as Xt, dI as Y, zl as Yn, Zi as Yr, nP as Yt, lI as Z, Pl as Zn, Ji as Zr, eP as Zt, vL as _, Ei as _i, Mb as _n, ul as _r, CF as _t, PL as a, Bi as ai, UN as an, wl as ar, XF as at, hL as b, Oi as bi, Db as bn, Es as br, yF as bt, jL as c, zi as ci, IN as cn, bl as cr, qF as ct, wL as d, Ai as di, Pw as dn, _l as dr, VF as dt, Gi as ei, ZN as en, jl as er, aI as et, CL as f, ji as fi, Nw as fn, gl as fr, BF as ft, yL as g, Mi as gi, Nb as gn, dl as gr, DF as gt, bL as h, Pi as hi, kS as hn, fl as hr, OF as ht, FL as i, Hi as ii, WN as in, Tl as ir, QF as it, XI as j, Bf as jn, ga as jr, WP as jt, $I as k, Uf as kn, Ua as kr, YP as kt, EL as l, Li as li, FN as ln, yl as lr, WF as lt, xL as m, Ni as mi, RC as mn, pl as mr, kF as mt, zL as n, Wi as ni, JN as nn, Ol as nr, tI as nt, NL as o, Vi as oi, BN as on, Cl as or, YF as ot, SL as p, Fi as pi, Mw as pn, ml as pr, AF as pt, _I as q, Vl as qn, Xi as qr, aP as qt, RL as r, Ki as ri, qN as rn, El as rr, eI as rt, ML as s, Ii as si, zN as sn, xl as sr, JF as st, BL as t, Ui as ti, XN as tn, kl as tr, rI as tt, TL as u, Ri as ui, Fw as un, vl as ur, UF as ut, _L as v, Di as vi, jb as vn, Os as vr, SF as vt, aL as w, Ci as wi, Cb as wn, Xa as wr, oF as wt, cL as x, wi as xi, Eb as xn, Cs as xr, vF as xt, gL as y, Ti as yi, Ab as yn, Ds as yr, xF as yt, FI as z, nf as zn, sa as zr, xP as zt };
//# sourceMappingURL=WorkspaceArea-BmPee4p8.js.map