Files
personal_development/ServerManagerWebApp/frontend/node_modules/.vite/deps/chunk-CL6G3ICF.js
T
2026-01-09 19:24:41 +00:00

1422 lines
41 KiB
JavaScript

import {
makeLazyProps,
useLazy
} from "./chunk-YGX2Z63P.js";
import {
makeDelayProps,
makeFocusTrapProps,
useDelay,
useFocusTrap,
useScopeId
} from "./chunk-BVUPSGRF.js";
import {
MaybeTransition,
makeTransitionProps
} from "./chunk-CAGZXMOS.js";
import {
useDisplay
} from "./chunk-N4LJHDYD.js";
import {
useBackButton,
useRouter
} from "./chunk-573D4TYC.js";
import {
useBackgroundColor
} from "./chunk-BHV5Z34M.js";
import {
makeDimensionProps,
useDimension
} from "./chunk-6EZKHCRW.js";
import {
useRtl
} from "./chunk-ENTLCOCZ.js";
import {
useProxiedModel,
useToggleScope
} from "./chunk-KA77II4V.js";
import {
makeThemeProps,
provideTheme
} from "./chunk-3DSR7NCB.js";
import {
Box,
CircularBuffer,
IN_BROWSER,
animate,
attachedRoot,
bindProps,
clamp,
consoleError,
convertToUnit,
deepEqual,
destructComputed,
flipAlign,
flipCorner,
flipSide,
genericComponent,
getAxis,
getCurrentInstance,
getElementBox,
getOverflow,
getScrollParent,
getScrollParents,
getTargetBox,
hasScrollbar,
isFixedPosition,
makeComponentProps,
matchesSelector,
nullifyTransforms,
omit,
parseAnchor,
propsFactory,
standardEasing,
templateRef,
unbindProps,
useRender
} from "./chunk-LZ5T2ERG.js";
import {
Fragment,
Teleport,
Transition,
computed,
createBaseVNode,
createVNode,
effectScope,
inject,
mergeProps,
nextTick,
onBeforeUnmount,
onMounted,
onScopeDispose,
provide,
reactive,
readonly,
ref,
shallowRef,
toRaw,
toRef,
toValue,
vShow,
warn,
watch,
watchEffect,
withDirectives
} from "./chunk-2MKFL3BX.js";
// node_modules/vuetify/lib/components/VOverlay/VOverlay.js
import "/home/david/gitea_repo/personal_development/ServerManagerWebApp/frontend/node_modules/vuetify/lib/components/VOverlay/VOverlay.css";
// node_modules/vuetify/lib/components/VOverlay/util/point.js
function elementToViewport(point, offset) {
return {
x: point.x + offset.x,
y: point.y + offset.y
};
}
function getOffset(a, b) {
return {
x: a.x - b.x,
y: a.y - b.y
};
}
function anchorToPoint(anchor, box) {
if (anchor.side === "top" || anchor.side === "bottom") {
const {
side,
align
} = anchor;
const x = align === "left" ? 0 : align === "center" ? box.width / 2 : align === "right" ? box.width : align;
const y = side === "top" ? 0 : side === "bottom" ? box.height : side;
return elementToViewport({
x,
y
}, box);
} else if (anchor.side === "left" || anchor.side === "right") {
const {
side,
align
} = anchor;
const x = side === "left" ? 0 : side === "right" ? box.width : side;
const y = align === "top" ? 0 : align === "center" ? box.height / 2 : align === "bottom" ? box.height : align;
return elementToViewport({
x,
y
}, box);
}
return elementToViewport({
x: box.width / 2,
y: box.height / 2
}, box);
}
// node_modules/vuetify/lib/components/VOverlay/locationStrategies.js
var locationStrategies = {
static: staticLocationStrategy,
// specific viewport position, usually centered
connected: connectedLocationStrategy
// connected to a certain element
};
var makeLocationStrategyProps = propsFactory({
locationStrategy: {
type: [String, Function],
default: "static",
validator: (val) => typeof val === "function" || val in locationStrategies
},
location: {
type: String,
default: "bottom"
},
origin: {
type: String,
default: "auto"
},
offset: [Number, String, Array],
stickToTarget: Boolean,
viewportMargin: {
type: [Number, String],
default: 12
}
}, "VOverlay-location-strategies");
function useLocationStrategies(props, data) {
const contentStyles = ref({});
const updateLocation = ref();
if (IN_BROWSER) {
useToggleScope(() => !!(data.isActive.value && props.locationStrategy), (reset) => {
watch(() => props.locationStrategy, reset);
onScopeDispose(() => {
window.removeEventListener("resize", onResize);
visualViewport?.removeEventListener("resize", onVisualResize);
visualViewport?.removeEventListener("scroll", onVisualScroll);
updateLocation.value = void 0;
});
window.addEventListener("resize", onResize, {
passive: true
});
visualViewport?.addEventListener("resize", onVisualResize, {
passive: true
});
visualViewport?.addEventListener("scroll", onVisualScroll, {
passive: true
});
if (typeof props.locationStrategy === "function") {
updateLocation.value = props.locationStrategy(data, props, contentStyles)?.updateLocation;
} else {
updateLocation.value = locationStrategies[props.locationStrategy](data, props, contentStyles)?.updateLocation;
}
});
}
function onResize(e) {
updateLocation.value?.(e);
}
function onVisualResize(e) {
updateLocation.value?.(e);
}
function onVisualScroll(e) {
updateLocation.value?.(e);
}
return {
contentStyles,
updateLocation
};
}
function staticLocationStrategy() {
}
function getIntrinsicSize(el, isRtl) {
const contentBox = nullifyTransforms(el);
if (isRtl) {
contentBox.x += parseFloat(el.style.right || 0);
} else {
contentBox.x -= parseFloat(el.style.left || 0);
}
contentBox.y -= parseFloat(el.style.top || 0);
return contentBox;
}
function connectedLocationStrategy(data, props, contentStyles) {
const activatorFixed = Array.isArray(data.target.value) || isFixedPosition(data.target.value);
if (activatorFixed) {
Object.assign(contentStyles.value, {
position: "fixed",
top: 0,
[data.isRtl.value ? "right" : "left"]: 0
});
}
const {
preferredAnchor,
preferredOrigin
} = destructComputed(() => {
const parsedAnchor = parseAnchor(props.location, data.isRtl.value);
const parsedOrigin = props.origin === "overlap" ? parsedAnchor : props.origin === "auto" ? flipSide(parsedAnchor) : parseAnchor(props.origin, data.isRtl.value);
if (parsedAnchor.side === parsedOrigin.side && parsedAnchor.align === flipAlign(parsedOrigin).align) {
return {
preferredAnchor: flipCorner(parsedAnchor),
preferredOrigin: flipCorner(parsedOrigin)
};
} else {
return {
preferredAnchor: parsedAnchor,
preferredOrigin: parsedOrigin
};
}
});
const [minWidth, minHeight, maxWidth, maxHeight] = ["minWidth", "minHeight", "maxWidth", "maxHeight"].map((key) => {
return computed(() => {
const val = parseFloat(props[key]);
return isNaN(val) ? Infinity : val;
});
});
const offset = computed(() => {
if (Array.isArray(props.offset)) {
return props.offset;
}
if (typeof props.offset === "string") {
const offset2 = props.offset.split(" ").map(parseFloat);
if (offset2.length < 2) offset2.push(0);
return offset2;
}
return typeof props.offset === "number" ? [props.offset, 0] : [0, 0];
});
let observe = false;
let lastFrame = -1;
const flipped = new CircularBuffer(4);
const observer = new ResizeObserver(() => {
if (!observe) return;
requestAnimationFrame((newTime) => {
if (newTime !== lastFrame) flipped.clear();
requestAnimationFrame((newNewTime) => {
lastFrame = newNewTime;
});
});
if (flipped.isFull) {
const values = flipped.values();
if (deepEqual(values.at(-1), values.at(-3)) && !deepEqual(values.at(-1), values.at(-2))) {
return;
}
}
const result = updateLocation();
if (result) flipped.push(result.flipped);
});
let targetBox = new Box({
x: 0,
y: 0,
width: 0,
height: 0
});
watch(data.target, (newTarget, oldTarget) => {
if (oldTarget && !Array.isArray(oldTarget)) observer.unobserve(oldTarget);
if (!Array.isArray(newTarget)) {
if (newTarget) observer.observe(newTarget);
} else if (!deepEqual(newTarget, oldTarget)) {
updateLocation();
}
}, {
immediate: true
});
watch(data.contentEl, (newContentEl, oldContentEl) => {
if (oldContentEl) observer.unobserve(oldContentEl);
if (newContentEl) observer.observe(newContentEl);
}, {
immediate: true
});
onScopeDispose(() => {
observer.disconnect();
});
function updateLocation() {
observe = false;
requestAnimationFrame(() => observe = true);
if (!data.target.value || !data.contentEl.value) return;
if (Array.isArray(data.target.value) || data.target.value.offsetParent || data.target.value.getClientRects().length) {
targetBox = getTargetBox(data.target.value);
}
const contentBox = getIntrinsicSize(data.contentEl.value, data.isRtl.value);
const scrollParents = getScrollParents(data.contentEl.value);
const viewportMargin = Number(props.viewportMargin);
if (!scrollParents.length) {
scrollParents.push(document.documentElement);
if (!(data.contentEl.value.style.top && data.contentEl.value.style.left)) {
contentBox.x -= parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-x") || 0);
contentBox.y -= parseFloat(document.documentElement.style.getPropertyValue("--v-body-scroll-y") || 0);
}
}
const viewport = scrollParents.reduce((box, el) => {
const scrollBox = getElementBox(el);
if (box) {
return new Box({
x: Math.max(box.left, scrollBox.left),
y: Math.max(box.top, scrollBox.top),
width: Math.min(box.right, scrollBox.right) - Math.max(box.left, scrollBox.left),
height: Math.min(box.bottom, scrollBox.bottom) - Math.max(box.top, scrollBox.top)
});
}
return scrollBox;
}, void 0);
if (props.stickToTarget) {
viewport.x += Math.min(viewportMargin, targetBox.x);
viewport.y += Math.min(viewportMargin, targetBox.y);
viewport.width = Math.max(viewport.width - viewportMargin * 2, targetBox.x + targetBox.width - viewportMargin);
viewport.height = Math.max(viewport.height - viewportMargin * 2, targetBox.y + targetBox.height - viewportMargin);
} else {
viewport.x += viewportMargin;
viewport.y += viewportMargin;
viewport.width -= viewportMargin * 2;
viewport.height -= viewportMargin * 2;
}
let placement = {
anchor: preferredAnchor.value,
origin: preferredOrigin.value
};
function checkOverflow(_placement) {
const box = new Box(contentBox);
const targetPoint = anchorToPoint(_placement.anchor, targetBox);
const contentPoint = anchorToPoint(_placement.origin, box);
let {
x: x2,
y: y2
} = getOffset(targetPoint, contentPoint);
switch (_placement.anchor.side) {
case "top":
y2 -= offset.value[0];
break;
case "bottom":
y2 += offset.value[0];
break;
case "left":
x2 -= offset.value[0];
break;
case "right":
x2 += offset.value[0];
break;
}
switch (_placement.anchor.align) {
case "top":
y2 -= offset.value[1];
break;
case "bottom":
y2 += offset.value[1];
break;
case "left":
x2 -= offset.value[1];
break;
case "right":
x2 += offset.value[1];
break;
}
box.x += x2;
box.y += y2;
box.width = Math.min(box.width, maxWidth.value);
box.height = Math.min(box.height, maxHeight.value);
const overflows = getOverflow(box, viewport);
return {
overflows,
x: x2,
y: y2
};
}
let x = 0;
let y = 0;
const available = {
x: 0,
y: 0
};
const flipped2 = {
x: false,
y: false
};
let resets = -1;
while (true) {
if (resets++ > 10) {
consoleError("Infinite loop detected in connectedLocationStrategy");
break;
}
const {
x: _x,
y: _y,
overflows
} = checkOverflow(placement);
x += _x;
y += _y;
contentBox.x += _x;
contentBox.y += _y;
{
const axis2 = getAxis(placement.anchor);
const hasOverflowX = overflows.x.before || overflows.x.after;
const hasOverflowY = overflows.y.before || overflows.y.after;
let reset = false;
["x", "y"].forEach((key) => {
if (key === "x" && hasOverflowX && !flipped2.x || key === "y" && hasOverflowY && !flipped2.y) {
const newPlacement = {
anchor: {
...placement.anchor
},
origin: {
...placement.origin
}
};
const flip = key === "x" ? axis2 === "y" ? flipAlign : flipSide : axis2 === "y" ? flipSide : flipAlign;
newPlacement.anchor = flip(newPlacement.anchor);
newPlacement.origin = flip(newPlacement.origin);
const {
overflows: newOverflows
} = checkOverflow(newPlacement);
if (newOverflows[key].before <= overflows[key].before && newOverflows[key].after <= overflows[key].after || newOverflows[key].before + newOverflows[key].after < (overflows[key].before + overflows[key].after) / 2) {
placement = newPlacement;
reset = flipped2[key] = true;
}
}
});
if (reset) continue;
}
if (overflows.x.before) {
x += overflows.x.before;
contentBox.x += overflows.x.before;
}
if (overflows.x.after) {
x -= overflows.x.after;
contentBox.x -= overflows.x.after;
}
if (overflows.y.before) {
y += overflows.y.before;
contentBox.y += overflows.y.before;
}
if (overflows.y.after) {
y -= overflows.y.after;
contentBox.y -= overflows.y.after;
}
{
const overflows2 = getOverflow(contentBox, viewport);
available.x = viewport.width - overflows2.x.before - overflows2.x.after;
available.y = viewport.height - overflows2.y.before - overflows2.y.after;
x += overflows2.x.before;
contentBox.x += overflows2.x.before;
y += overflows2.y.before;
contentBox.y += overflows2.y.before;
}
break;
}
const axis = getAxis(placement.anchor);
Object.assign(contentStyles.value, {
"--v-overlay-anchor-origin": `${placement.anchor.side} ${placement.anchor.align}`,
transformOrigin: `${placement.origin.side} ${placement.origin.align}`,
// transform: `translate(${pixelRound(x)}px, ${pixelRound(y)}px)`,
top: convertToUnit(pixelRound(y)),
left: data.isRtl.value ? void 0 : convertToUnit(pixelRound(x)),
right: data.isRtl.value ? convertToUnit(pixelRound(-x)) : void 0,
minWidth: convertToUnit(axis === "y" ? Math.min(minWidth.value, targetBox.width) : minWidth.value),
maxWidth: convertToUnit(pixelCeil(clamp(available.x, minWidth.value === Infinity ? 0 : minWidth.value, maxWidth.value))),
maxHeight: convertToUnit(pixelCeil(clamp(available.y, minHeight.value === Infinity ? 0 : minHeight.value, maxHeight.value)))
});
return {
available,
contentBox,
flipped: flipped2
};
}
watch(() => [preferredAnchor.value, preferredOrigin.value, props.offset, props.minWidth, props.minHeight, props.maxWidth, props.maxHeight], () => updateLocation());
nextTick(() => {
const result = updateLocation();
if (!result) return;
const {
available,
contentBox
} = result;
if (contentBox.height > available.y) {
requestAnimationFrame(() => {
updateLocation();
requestAnimationFrame(() => {
updateLocation();
});
});
}
});
return {
updateLocation
};
}
function pixelRound(val) {
return Math.round(val * devicePixelRatio) / devicePixelRatio;
}
function pixelCeil(val) {
return Math.ceil(val * devicePixelRatio) / devicePixelRatio;
}
// node_modules/vuetify/lib/components/VOverlay/requestNewFrame.js
var clean = true;
var frames = [];
function requestNewFrame(cb) {
if (!clean || frames.length) {
frames.push(cb);
run();
} else {
clean = false;
cb();
run();
}
}
var raf = -1;
function run() {
cancelAnimationFrame(raf);
raf = requestAnimationFrame(() => {
const frame = frames.shift();
if (frame) frame();
if (frames.length) run();
else clean = true;
});
}
// node_modules/vuetify/lib/components/VOverlay/scrollStrategies.js
var scrollStrategies = {
none: null,
close: closeScrollStrategy,
block: blockScrollStrategy,
reposition: repositionScrollStrategy
};
var makeScrollStrategyProps = propsFactory({
scrollStrategy: {
type: [String, Function],
default: "block",
validator: (val) => typeof val === "function" || val in scrollStrategies
}
}, "VOverlay-scroll-strategies");
function useScrollStrategies(props, data) {
if (!IN_BROWSER) return;
let scope;
watchEffect(async () => {
scope?.stop();
if (!(data.isActive.value && props.scrollStrategy)) return;
scope = effectScope();
await new Promise((resolve) => setTimeout(resolve));
scope.active && scope.run(() => {
if (typeof props.scrollStrategy === "function") {
props.scrollStrategy(data, props, scope);
} else {
scrollStrategies[props.scrollStrategy]?.(data, props, scope);
}
});
});
onScopeDispose(() => {
scope?.stop();
});
}
function closeScrollStrategy(data) {
function onScroll(e) {
data.isActive.value = false;
}
bindScroll(getTargetEl(data.target.value, data.contentEl.value), onScroll);
}
function blockScrollStrategy(data, props) {
const offsetParent = data.root.value?.offsetParent;
const target = getTargetEl(data.target.value, data.contentEl.value);
const scrollElements = [.../* @__PURE__ */ new Set([...getScrollParents(target, props.contained ? offsetParent : void 0), ...getScrollParents(data.contentEl.value, props.contained ? offsetParent : void 0)])].filter((el) => !el.classList.contains("v-overlay-scroll-blocked"));
const scrollbarWidth = window.innerWidth - document.documentElement.offsetWidth;
const scrollableParent = ((el) => hasScrollbar(el) && el)(offsetParent || document.documentElement);
if (scrollableParent) {
data.root.value.classList.add("v-overlay--scroll-blocked");
}
scrollElements.forEach((el, i) => {
el.style.setProperty("--v-body-scroll-x", convertToUnit(-el.scrollLeft));
el.style.setProperty("--v-body-scroll-y", convertToUnit(-el.scrollTop));
if (el !== document.documentElement) {
el.style.setProperty("--v-scrollbar-offset", convertToUnit(scrollbarWidth));
}
el.classList.add("v-overlay-scroll-blocked");
});
onScopeDispose(() => {
scrollElements.forEach((el, i) => {
const x = parseFloat(el.style.getPropertyValue("--v-body-scroll-x"));
const y = parseFloat(el.style.getPropertyValue("--v-body-scroll-y"));
const scrollBehavior = el.style.scrollBehavior;
el.style.scrollBehavior = "auto";
el.style.removeProperty("--v-body-scroll-x");
el.style.removeProperty("--v-body-scroll-y");
el.style.removeProperty("--v-scrollbar-offset");
el.classList.remove("v-overlay-scroll-blocked");
el.scrollLeft = -x;
el.scrollTop = -y;
el.style.scrollBehavior = scrollBehavior;
});
if (scrollableParent) {
data.root.value.classList.remove("v-overlay--scroll-blocked");
}
});
}
function repositionScrollStrategy(data, props, scope) {
let slow = false;
let raf2 = -1;
let ric = -1;
function update(e) {
requestNewFrame(() => {
const start = performance.now();
data.updateLocation.value?.(e);
const time = performance.now() - start;
slow = time / (1e3 / 60) > 2;
});
}
ric = (typeof requestIdleCallback === "undefined" ? (cb) => cb() : requestIdleCallback)(() => {
scope.run(() => {
bindScroll(getTargetEl(data.target.value, data.contentEl.value), (e) => {
if (slow) {
cancelAnimationFrame(raf2);
raf2 = requestAnimationFrame(() => {
raf2 = requestAnimationFrame(() => {
update(e);
});
});
} else {
update(e);
}
});
});
});
onScopeDispose(() => {
typeof cancelIdleCallback !== "undefined" && cancelIdleCallback(ric);
cancelAnimationFrame(raf2);
});
}
function getTargetEl(target, contentEl) {
return Array.isArray(target) ? document.elementsFromPoint(...target).find((el) => !contentEl?.contains(el)) : target ?? contentEl;
}
function bindScroll(el, onScroll) {
const scrollElements = [document, ...getScrollParents(el)];
scrollElements.forEach((el2) => {
el2.addEventListener("scroll", onScroll, {
passive: true
});
});
onScopeDispose(() => {
scrollElements.forEach((el2) => {
el2.removeEventListener("scroll", onScroll);
});
});
}
// node_modules/vuetify/lib/components/VMenu/shared.js
var VMenuSymbol = /* @__PURE__ */ Symbol.for("vuetify:v-menu");
// node_modules/vuetify/lib/components/VOverlay/useActivator.js
var makeActivatorProps = propsFactory({
target: [String, Object],
activator: [String, Object],
activatorProps: {
type: Object,
default: () => ({})
},
openOnClick: {
type: Boolean,
default: void 0
},
openOnHover: Boolean,
openOnFocus: {
type: Boolean,
default: void 0
},
closeOnContentClick: Boolean,
...makeDelayProps()
}, "VOverlay-activator");
function useActivator(props, _ref) {
let {
isActive,
isTop,
contentEl
} = _ref;
const vm = getCurrentInstance("useActivator");
const activatorEl = ref();
let isHovered = false;
let isFocused = false;
let firstEnter = true;
const openOnFocus = computed(() => props.openOnFocus || props.openOnFocus == null && props.openOnHover);
const openOnClick = computed(() => props.openOnClick || props.openOnClick == null && !props.openOnHover && !openOnFocus.value);
const {
runOpenDelay,
runCloseDelay
} = useDelay(props, (value) => {
if (value === (props.openOnHover && isHovered || openOnFocus.value && isFocused) && !(props.openOnHover && isActive.value && !isTop.value)) {
if (isActive.value !== value) {
firstEnter = true;
}
isActive.value = value;
}
});
const cursorTarget = ref();
const availableEvents = {
onClick: (e) => {
e.stopPropagation();
activatorEl.value = e.currentTarget || e.target;
if (!isActive.value) {
cursorTarget.value = [e.clientX, e.clientY];
}
isActive.value = !isActive.value;
},
onMouseenter: (e) => {
isHovered = true;
activatorEl.value = e.currentTarget || e.target;
runOpenDelay();
},
onMouseleave: (e) => {
isHovered = false;
runCloseDelay();
},
onFocus: (e) => {
if (matchesSelector(e.target, ":focus-visible") === false) return;
isFocused = true;
e.stopPropagation();
activatorEl.value = e.currentTarget || e.target;
runOpenDelay();
},
onBlur: (e) => {
isFocused = false;
e.stopPropagation();
runCloseDelay({
minDelay: 1
});
}
};
const activatorEvents = computed(() => {
const events = {};
if (openOnClick.value) {
events.onClick = availableEvents.onClick;
}
if (props.openOnHover) {
events.onMouseenter = availableEvents.onMouseenter;
events.onMouseleave = availableEvents.onMouseleave;
}
if (openOnFocus.value) {
events.onFocus = availableEvents.onFocus;
events.onBlur = availableEvents.onBlur;
}
return events;
});
const contentEvents = computed(() => {
const events = {};
if (props.openOnHover) {
events.onMouseenter = () => {
isHovered = true;
runOpenDelay();
};
events.onMouseleave = () => {
isHovered = false;
runCloseDelay();
};
}
if (openOnFocus.value) {
events.onFocusin = (e) => {
if (!e.target.matches(":focus-visible")) return;
isFocused = true;
runOpenDelay();
};
events.onFocusout = () => {
isFocused = false;
runCloseDelay({
minDelay: 1
});
};
}
if (props.closeOnContentClick) {
const menu = inject(VMenuSymbol, null);
events.onClick = () => {
isActive.value = false;
menu?.closeParents();
};
}
return events;
});
const scrimEvents = computed(() => {
const events = {};
if (props.openOnHover) {
events.onMouseenter = () => {
if (firstEnter) {
isHovered = true;
firstEnter = false;
runOpenDelay();
}
};
events.onMouseleave = () => {
isHovered = false;
runCloseDelay();
};
}
return events;
});
watch(isTop, (val) => {
if (val && (props.openOnHover && !isHovered && (!openOnFocus.value || !isFocused) || openOnFocus.value && !isFocused && (!props.openOnHover || !isHovered)) && !contentEl.value?.contains(document.activeElement)) {
isActive.value = false;
}
});
watch(isActive, (val) => {
if (!val) {
setTimeout(() => {
cursorTarget.value = void 0;
});
}
}, {
flush: "post"
});
const activatorRef = templateRef();
watchEffect(() => {
if (!activatorRef.value) return;
nextTick(() => {
activatorEl.value = activatorRef.el;
});
});
const targetRef = templateRef();
const target = computed(() => {
if (props.target === "cursor" && cursorTarget.value) return cursorTarget.value;
if (targetRef.value) return targetRef.el;
return getTarget(props.target, vm) || activatorEl.value;
});
const targetEl = computed(() => {
return Array.isArray(target.value) ? void 0 : target.value;
});
let scope;
watch(() => !!props.activator, (val) => {
if (val && IN_BROWSER) {
scope = effectScope();
scope.run(() => {
_useActivator(props, vm, {
activatorEl,
activatorEvents
});
});
} else if (scope) {
scope.stop();
}
}, {
flush: "post",
immediate: true
});
onScopeDispose(() => {
scope?.stop();
});
return {
activatorEl,
activatorRef,
target,
targetEl,
targetRef,
activatorEvents,
contentEvents,
scrimEvents
};
}
function _useActivator(props, vm, _ref2) {
let {
activatorEl,
activatorEvents
} = _ref2;
watch(() => props.activator, (val, oldVal) => {
if (oldVal && val !== oldVal) {
const activator = getActivator(oldVal);
activator && unbindActivatorProps(activator);
}
if (val) {
nextTick(() => bindActivatorProps());
}
}, {
immediate: true
});
watch(() => props.activatorProps, () => {
bindActivatorProps();
});
onScopeDispose(() => {
unbindActivatorProps();
});
function bindActivatorProps() {
let el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getActivator();
let _props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : props.activatorProps;
if (!el) return;
bindProps(el, mergeProps(activatorEvents.value, _props));
}
function unbindActivatorProps() {
let el = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getActivator();
let _props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : props.activatorProps;
if (!el) return;
unbindProps(el, mergeProps(activatorEvents.value, _props));
}
function getActivator() {
let selector = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : props.activator;
const activator = getTarget(selector, vm);
activatorEl.value = activator?.nodeType === Node.ELEMENT_NODE ? activator : void 0;
return activatorEl.value;
}
}
function getTarget(selector, vm) {
if (!selector) return;
let target;
if (selector === "parent") {
let el = vm?.proxy?.$el?.parentNode;
while (el?.hasAttribute("data-no-activator")) {
el = el.parentNode;
}
target = el;
} else if (typeof selector === "string") {
target = document.querySelector(selector);
} else if ("$el" in selector) {
target = selector.$el;
} else {
target = selector;
}
return target;
}
// node_modules/vuetify/lib/composables/hydration.js
function useHydration() {
if (!IN_BROWSER) return shallowRef(false);
const {
ssr
} = useDisplay();
if (ssr) {
const isMounted = shallowRef(false);
onMounted(() => {
isMounted.value = true;
});
return isMounted;
} else {
return shallowRef(true);
}
}
// node_modules/vuetify/lib/composables/stack.js
var StackSymbol = /* @__PURE__ */ Symbol.for("vuetify:stack");
var globalStack = reactive([]);
function useStack(isActive, zIndex, disableGlobalStack) {
const vm = getCurrentInstance("useStack");
const createStackEntry = !disableGlobalStack;
const parent = inject(StackSymbol, void 0);
const stack = reactive({
activeChildren: /* @__PURE__ */ new Set()
});
provide(StackSymbol, stack);
const _zIndex = shallowRef(Number(toValue(zIndex)));
useToggleScope(isActive, () => {
const lastZIndex = globalStack.at(-1)?.[1];
_zIndex.value = lastZIndex ? lastZIndex + 10 : Number(toValue(zIndex));
if (createStackEntry) {
globalStack.push([vm.uid, _zIndex.value]);
}
parent?.activeChildren.add(vm.uid);
onScopeDispose(() => {
if (createStackEntry) {
const idx = toRaw(globalStack).findIndex((v) => v[0] === vm.uid);
globalStack.splice(idx, 1);
}
parent?.activeChildren.delete(vm.uid);
});
});
const globalTop = shallowRef(true);
if (createStackEntry) {
watchEffect(() => {
const _isTop = globalStack.at(-1)?.[0] === vm.uid;
setTimeout(() => globalTop.value = _isTop);
});
}
const localTop = toRef(() => !stack.activeChildren.size);
return {
globalTop: readonly(globalTop),
localTop,
stackStyles: toRef(() => ({
zIndex: _zIndex.value
}))
};
}
// node_modules/vuetify/lib/composables/teleport.js
function useTeleport(target) {
const teleportTarget = computed(() => {
const _target = target();
if (_target === true || !IN_BROWSER) return void 0;
const targetElement = _target === false ? document.body : typeof _target === "string" ? document.querySelector(_target) : _target;
if (targetElement == null) {
warn(`Unable to locate target ${_target}`);
return void 0;
}
let container = [...targetElement.children].find((el) => el.matches(".v-overlay-container"));
if (!container) {
container = document.createElement("div");
container.className = "v-overlay-container";
targetElement.appendChild(container);
}
return container;
});
return {
teleportTarget
};
}
// node_modules/vuetify/lib/directives/click-outside/index.js
function defaultConditional() {
return true;
}
function checkEvent(e, el, binding) {
if (!e || checkIsActive(e, binding) === false) return false;
const root = attachedRoot(el);
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot && root.host === e.target) return false;
const elements = (typeof binding.value === "object" && binding.value.include || (() => []))();
elements.push(el);
return !elements.some((el2) => el2?.contains(e.target));
}
function checkIsActive(e, binding) {
const isActive = typeof binding.value === "object" && binding.value.closeConditional || defaultConditional;
return isActive(e);
}
function directive(e, el, binding) {
const handler = typeof binding.value === "function" ? binding.value : binding.value.handler;
e.shadowTarget = e.target;
el._clickOutside.lastMousedownWasOutside && checkEvent(e, el, binding) && setTimeout(() => {
checkIsActive(e, binding) && handler && handler(e);
}, 0);
}
function handleShadow(el, callback) {
const root = attachedRoot(el);
callback(document);
if (typeof ShadowRoot !== "undefined" && root instanceof ShadowRoot) {
callback(root);
}
}
var ClickOutside = {
// [data-app] may not be found
// if using bind, inserted makes
// sure that the root element is
// available, iOS does not support
// clicks on body
mounted(el, binding) {
const onClick = (e) => directive(e, el, binding);
const onMousedown = (e) => {
el._clickOutside.lastMousedownWasOutside = checkEvent(e, el, binding);
};
handleShadow(el, (app) => {
app.addEventListener("click", onClick, true);
app.addEventListener("mousedown", onMousedown, true);
});
if (!el._clickOutside) {
el._clickOutside = {
lastMousedownWasOutside: false
};
}
el._clickOutside[binding.instance.$.uid] = {
onClick,
onMousedown
};
},
beforeUnmount(el, binding) {
if (!el._clickOutside) return;
handleShadow(el, (app) => {
if (!app || !el._clickOutside?.[binding.instance.$.uid]) return;
const {
onClick,
onMousedown
} = el._clickOutside[binding.instance.$.uid];
app.removeEventListener("click", onClick, true);
app.removeEventListener("mousedown", onMousedown, true);
});
delete el._clickOutside[binding.instance.$.uid];
}
};
var click_outside_default = ClickOutside;
// node_modules/vuetify/lib/components/VOverlay/VOverlay.js
function Scrim(props) {
const {
modelValue,
color,
...rest
} = props;
return createVNode(Transition, {
"name": "fade-transition",
"appear": true
}, {
default: () => [props.modelValue && createBaseVNode("div", mergeProps({
"class": ["v-overlay__scrim", props.color.backgroundColorClasses.value],
"style": props.color.backgroundColorStyles.value
}, rest), null)]
});
}
var makeVOverlayProps = propsFactory({
absolute: Boolean,
attach: [Boolean, String, Object],
closeOnBack: {
type: Boolean,
default: true
},
contained: Boolean,
contentClass: null,
contentProps: null,
disabled: Boolean,
opacity: [Number, String],
noClickAnimation: Boolean,
modelValue: Boolean,
persistent: Boolean,
scrim: {
type: [Boolean, String],
default: true
},
zIndex: {
type: [Number, String],
default: 2e3
},
...makeActivatorProps(),
...makeComponentProps(),
...makeDimensionProps(),
...makeLazyProps(),
...makeLocationStrategyProps(),
...makeScrollStrategyProps(),
...makeFocusTrapProps(),
...makeThemeProps(),
...makeTransitionProps()
}, "VOverlay");
var VOverlay = genericComponent()({
name: "VOverlay",
directives: {
vClickOutside: click_outside_default
},
inheritAttrs: false,
props: {
_disableGlobalStack: Boolean,
...omit(makeVOverlayProps(), ["disableInitialFocus"])
},
emits: {
"click:outside": (e) => true,
"update:modelValue": (value) => true,
keydown: (e) => true,
afterEnter: () => true,
afterLeave: () => true
},
setup(props, _ref) {
let {
slots,
attrs,
emit
} = _ref;
const vm = getCurrentInstance("VOverlay");
const root = ref();
const scrimEl = ref();
const contentEl = ref();
const model = useProxiedModel(props, "modelValue");
const isActive = computed({
get: () => model.value,
set: (v) => {
if (!(v && props.disabled)) model.value = v;
}
});
const {
themeClasses
} = provideTheme(props);
const {
rtlClasses,
isRtl
} = useRtl();
const {
hasContent,
onAfterLeave: _onAfterLeave
} = useLazy(props, isActive);
const scrimColor = useBackgroundColor(() => {
return typeof props.scrim === "string" ? props.scrim : null;
});
const {
globalTop,
localTop,
stackStyles
} = useStack(isActive, () => props.zIndex, props._disableGlobalStack);
const {
activatorEl,
activatorRef,
target,
targetEl,
targetRef,
activatorEvents,
contentEvents,
scrimEvents
} = useActivator(props, {
isActive,
isTop: localTop,
contentEl
});
const {
teleportTarget
} = useTeleport(() => {
const target2 = props.attach || props.contained;
if (target2) return target2;
const rootNode = activatorEl?.value?.getRootNode() || vm.proxy?.$el?.getRootNode();
if (rootNode instanceof ShadowRoot) return rootNode;
return false;
});
const {
dimensionStyles
} = useDimension(props);
const isMounted = useHydration();
const {
scopeId
} = useScopeId();
watch(() => props.disabled, (v) => {
if (v) isActive.value = false;
});
const {
contentStyles,
updateLocation
} = useLocationStrategies(props, {
isRtl,
contentEl,
target,
isActive
});
useScrollStrategies(props, {
root,
contentEl,
targetEl,
target,
isActive,
updateLocation
});
function onClickOutside(e) {
emit("click:outside", e);
if (!props.persistent) isActive.value = false;
else animateClick();
}
function closeConditional(e) {
return isActive.value && localTop.value && // If using scrim, only close if clicking on it rather than anything opened on top
(!props.scrim || e.target === scrimEl.value || e instanceof MouseEvent && e.shadowTarget === scrimEl.value);
}
useFocusTrap(props, {
isActive,
localTop,
contentEl,
activatorEl
});
IN_BROWSER && watch(isActive, (val) => {
if (val) {
window.addEventListener("keydown", onKeydown);
} else {
window.removeEventListener("keydown", onKeydown);
}
}, {
immediate: true
});
onBeforeUnmount(() => {
if (!IN_BROWSER) return;
window.removeEventListener("keydown", onKeydown);
});
function onKeydown(e) {
if (e.key === "Escape" && globalTop.value) {
if (!contentEl.value?.contains(document.activeElement)) {
emit("keydown", e);
}
if (!props.persistent) {
isActive.value = false;
if (contentEl.value?.contains(document.activeElement)) {
activatorEl.value?.focus();
}
} else animateClick();
}
}
function onKeydownSelf(e) {
if (e.key === "Escape" && !globalTop.value) return;
emit("keydown", e);
}
const router = useRouter();
useToggleScope(() => props.closeOnBack, () => {
useBackButton(router, (next) => {
if (globalTop.value && isActive.value) {
next(false);
if (!props.persistent) isActive.value = false;
else animateClick();
} else {
next();
}
});
});
const top = ref();
watch(() => isActive.value && (props.absolute || props.contained) && teleportTarget.value == null, (val) => {
if (val) {
const scrollParent = getScrollParent(root.value);
if (scrollParent && scrollParent !== document.scrollingElement) {
top.value = scrollParent.scrollTop;
}
}
});
function animateClick() {
if (props.noClickAnimation) return;
contentEl.value && animate(contentEl.value, [{
transformOrigin: "center"
}, {
transform: "scale(1.03)"
}, {
transformOrigin: "center"
}], {
duration: 150,
easing: standardEasing
});
}
function onAfterEnter() {
emit("afterEnter");
}
function onAfterLeave() {
_onAfterLeave();
emit("afterLeave");
}
useRender(() => createBaseVNode(Fragment, null, [slots.activator?.({
isActive: isActive.value,
targetRef,
props: mergeProps({
ref: activatorRef
}, activatorEvents.value, props.activatorProps)
}), isMounted.value && hasContent.value && createVNode(Teleport, {
"disabled": !teleportTarget.value,
"to": teleportTarget.value
}, {
default: () => [createBaseVNode("div", mergeProps({
"class": ["v-overlay", {
"v-overlay--absolute": props.absolute || props.contained,
"v-overlay--active": isActive.value,
"v-overlay--contained": props.contained
}, themeClasses.value, rtlClasses.value, props.class],
"style": [stackStyles.value, {
"--v-overlay-opacity": props.opacity,
top: convertToUnit(top.value)
}, props.style],
"ref": root,
"onKeydown": onKeydownSelf
}, scopeId, attrs), [createVNode(Scrim, mergeProps({
"color": scrimColor,
"modelValue": isActive.value && !!props.scrim,
"ref": scrimEl
}, scrimEvents.value), null), createVNode(MaybeTransition, {
"appear": true,
"persisted": true,
"transition": props.transition,
"target": target.value,
"onAfterEnter": onAfterEnter,
"onAfterLeave": onAfterLeave
}, {
default: () => [withDirectives(createBaseVNode("div", mergeProps({
"ref": contentEl,
"class": ["v-overlay__content", props.contentClass],
"style": [dimensionStyles.value, contentStyles.value]
}, contentEvents.value, props.contentProps), [slots.default?.({
isActive
})]), [[vShow, isActive.value], [click_outside_default, {
handler: onClickOutside,
closeConditional,
include: () => [activatorEl.value]
}]])]
})])]
})]));
return {
activatorEl,
scrimEl,
target,
animateClick,
contentEl,
rootEl: root,
globalTop,
localTop,
updateLocation
};
}
});
export {
VMenuSymbol,
useHydration,
ClickOutside,
makeVOverlayProps,
VOverlay
};
//# sourceMappingURL=chunk-CL6G3ICF.js.map