3638 lines
122 KiB
JavaScript
3638 lines
122 KiB
JavaScript
import "./chunk-VAL2CHZC.js";
|
||
import {
|
||
createApp,
|
||
defineComponent,
|
||
getCurrentInstance,
|
||
h,
|
||
isReactive,
|
||
isRef,
|
||
isVNode,
|
||
nextTick,
|
||
onMounted,
|
||
onUnmounted,
|
||
reactive,
|
||
ref,
|
||
shallowRef,
|
||
unref,
|
||
watch
|
||
} from "./chunk-AAHVYXXY.js";
|
||
import "./chunk-OWZYVOTZ.js";
|
||
import "./chunk-V4OQ3NZ2.js";
|
||
|
||
// ../node_modules/.pnpm/vue-tippy@6.7.1_vue@3.5.24_typescript@5.9.3_/node_modules/vue-tippy/dist/vue-tippy.esm-browser.js
|
||
var top = "top";
|
||
var bottom = "bottom";
|
||
var right = "right";
|
||
var left = "left";
|
||
var auto = "auto";
|
||
var basePlacements = [top, bottom, right, left];
|
||
var start = "start";
|
||
var end = "end";
|
||
var clippingParents = "clippingParents";
|
||
var viewport = "viewport";
|
||
var popper = "popper";
|
||
var reference = "reference";
|
||
var variationPlacements = basePlacements.reduce(function(acc, placement) {
|
||
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
||
}, []);
|
||
var placements = [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
||
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
||
}, []);
|
||
var beforeRead = "beforeRead";
|
||
var read = "read";
|
||
var afterRead = "afterRead";
|
||
var beforeMain = "beforeMain";
|
||
var main = "main";
|
||
var afterMain = "afterMain";
|
||
var beforeWrite = "beforeWrite";
|
||
var write = "write";
|
||
var afterWrite = "afterWrite";
|
||
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
||
function getNodeName(element) {
|
||
return element ? (element.nodeName || "").toLowerCase() : null;
|
||
}
|
||
function getWindow(node) {
|
||
if (node == null) {
|
||
return window;
|
||
}
|
||
if (node.toString() !== "[object Window]") {
|
||
var ownerDocument = node.ownerDocument;
|
||
return ownerDocument ? ownerDocument.defaultView || window : window;
|
||
}
|
||
return node;
|
||
}
|
||
function isElement(node) {
|
||
var OwnElement = getWindow(node).Element;
|
||
return node instanceof OwnElement || node instanceof Element;
|
||
}
|
||
function isHTMLElement(node) {
|
||
var OwnElement = getWindow(node).HTMLElement;
|
||
return node instanceof OwnElement || node instanceof HTMLElement;
|
||
}
|
||
function isShadowRoot(node) {
|
||
if (typeof ShadowRoot === "undefined") {
|
||
return false;
|
||
}
|
||
var OwnElement = getWindow(node).ShadowRoot;
|
||
return node instanceof OwnElement || node instanceof ShadowRoot;
|
||
}
|
||
function applyStyles(_ref) {
|
||
var state = _ref.state;
|
||
Object.keys(state.elements).forEach(function(name) {
|
||
var style = state.styles[name] || {};
|
||
var attributes = state.attributes[name] || {};
|
||
var element = state.elements[name];
|
||
if (!isHTMLElement(element) || !getNodeName(element)) {
|
||
return;
|
||
}
|
||
Object.assign(element.style, style);
|
||
Object.keys(attributes).forEach(function(name2) {
|
||
var value = attributes[name2];
|
||
if (value === false) {
|
||
element.removeAttribute(name2);
|
||
} else {
|
||
element.setAttribute(name2, value === true ? "" : value);
|
||
}
|
||
});
|
||
});
|
||
}
|
||
function effect(_ref2) {
|
||
var state = _ref2.state;
|
||
var initialStyles = {
|
||
popper: {
|
||
position: state.options.strategy,
|
||
left: "0",
|
||
top: "0",
|
||
margin: "0"
|
||
},
|
||
arrow: {
|
||
position: "absolute"
|
||
},
|
||
reference: {}
|
||
};
|
||
Object.assign(state.elements.popper.style, initialStyles.popper);
|
||
state.styles = initialStyles;
|
||
if (state.elements.arrow) {
|
||
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
||
}
|
||
return function() {
|
||
Object.keys(state.elements).forEach(function(name) {
|
||
var element = state.elements[name];
|
||
var attributes = state.attributes[name] || {};
|
||
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
||
var style = styleProperties.reduce(function(style2, property) {
|
||
style2[property] = "";
|
||
return style2;
|
||
}, {});
|
||
if (!isHTMLElement(element) || !getNodeName(element)) {
|
||
return;
|
||
}
|
||
Object.assign(element.style, style);
|
||
Object.keys(attributes).forEach(function(attribute) {
|
||
element.removeAttribute(attribute);
|
||
});
|
||
});
|
||
};
|
||
}
|
||
var applyStyles$1 = {
|
||
name: "applyStyles",
|
||
enabled: true,
|
||
phase: "write",
|
||
fn: applyStyles,
|
||
effect,
|
||
requires: ["computeStyles"]
|
||
};
|
||
function getBasePlacement(placement) {
|
||
return placement.split("-")[0];
|
||
}
|
||
var max = Math.max;
|
||
var min = Math.min;
|
||
var round = Math.round;
|
||
function getBoundingClientRect(element, includeScale) {
|
||
if (includeScale === void 0) {
|
||
includeScale = false;
|
||
}
|
||
var rect = element.getBoundingClientRect();
|
||
var scaleX = 1;
|
||
var scaleY = 1;
|
||
if (isHTMLElement(element) && includeScale) {
|
||
var offsetHeight = element.offsetHeight;
|
||
var offsetWidth = element.offsetWidth;
|
||
if (offsetWidth > 0) {
|
||
scaleX = round(rect.width) / offsetWidth || 1;
|
||
}
|
||
if (offsetHeight > 0) {
|
||
scaleY = round(rect.height) / offsetHeight || 1;
|
||
}
|
||
}
|
||
return {
|
||
width: rect.width / scaleX,
|
||
height: rect.height / scaleY,
|
||
top: rect.top / scaleY,
|
||
right: rect.right / scaleX,
|
||
bottom: rect.bottom / scaleY,
|
||
left: rect.left / scaleX,
|
||
x: rect.left / scaleX,
|
||
y: rect.top / scaleY
|
||
};
|
||
}
|
||
function getLayoutRect(element) {
|
||
var clientRect = getBoundingClientRect(element);
|
||
var width = element.offsetWidth;
|
||
var height = element.offsetHeight;
|
||
if (Math.abs(clientRect.width - width) <= 1) {
|
||
width = clientRect.width;
|
||
}
|
||
if (Math.abs(clientRect.height - height) <= 1) {
|
||
height = clientRect.height;
|
||
}
|
||
return {
|
||
x: element.offsetLeft,
|
||
y: element.offsetTop,
|
||
width,
|
||
height
|
||
};
|
||
}
|
||
function contains(parent, child) {
|
||
var rootNode = child.getRootNode && child.getRootNode();
|
||
if (parent.contains(child)) {
|
||
return true;
|
||
} else if (rootNode && isShadowRoot(rootNode)) {
|
||
var next = child;
|
||
do {
|
||
if (next && parent.isSameNode(next)) {
|
||
return true;
|
||
}
|
||
next = next.parentNode || next.host;
|
||
} while (next);
|
||
}
|
||
return false;
|
||
}
|
||
function getComputedStyle(element) {
|
||
return getWindow(element).getComputedStyle(element);
|
||
}
|
||
function isTableElement(element) {
|
||
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
||
}
|
||
function getDocumentElement(element) {
|
||
return ((isElement(element) ? element.ownerDocument : (
|
||
// $FlowFixMe[prop-missing]
|
||
element.document
|
||
)) || window.document).documentElement;
|
||
}
|
||
function getParentNode(element) {
|
||
if (getNodeName(element) === "html") {
|
||
return element;
|
||
}
|
||
return (
|
||
// this is a quicker (but less type safe) way to save quite some bytes from the bundle
|
||
// $FlowFixMe[incompatible-return]
|
||
// $FlowFixMe[prop-missing]
|
||
element.assignedSlot || // step into the shadow DOM of the parent of a slotted node
|
||
element.parentNode || // DOM Element detected
|
||
(isShadowRoot(element) ? element.host : null) || // ShadowRoot detected
|
||
// $FlowFixMe[incompatible-call]: HTMLElement is a Node
|
||
getDocumentElement(element)
|
||
);
|
||
}
|
||
function getTrueOffsetParent(element) {
|
||
if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837
|
||
getComputedStyle(element).position === "fixed") {
|
||
return null;
|
||
}
|
||
return element.offsetParent;
|
||
}
|
||
function getContainingBlock(element) {
|
||
var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
|
||
var isIE = navigator.userAgent.indexOf("Trident") !== -1;
|
||
if (isIE && isHTMLElement(element)) {
|
||
var elementCss = getComputedStyle(element);
|
||
if (elementCss.position === "fixed") {
|
||
return null;
|
||
}
|
||
}
|
||
var currentNode = getParentNode(element);
|
||
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
||
var css = getComputedStyle(currentNode);
|
||
if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") {
|
||
return currentNode;
|
||
} else {
|
||
currentNode = currentNode.parentNode;
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
function getOffsetParent(element) {
|
||
var window2 = getWindow(element);
|
||
var offsetParent = getTrueOffsetParent(element);
|
||
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
||
offsetParent = getTrueOffsetParent(offsetParent);
|
||
}
|
||
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
||
return window2;
|
||
}
|
||
return offsetParent || getContainingBlock(element) || window2;
|
||
}
|
||
function getMainAxisFromPlacement(placement) {
|
||
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
||
}
|
||
function within(min$1, value, max$1) {
|
||
return max(min$1, min(value, max$1));
|
||
}
|
||
function withinMaxClamp(min2, value, max2) {
|
||
var v = within(min2, value, max2);
|
||
return v > max2 ? max2 : v;
|
||
}
|
||
function getFreshSideObject() {
|
||
return {
|
||
top: 0,
|
||
right: 0,
|
||
bottom: 0,
|
||
left: 0
|
||
};
|
||
}
|
||
function mergePaddingObject(paddingObject) {
|
||
return Object.assign({}, getFreshSideObject(), paddingObject);
|
||
}
|
||
function expandToHashMap(value, keys) {
|
||
return keys.reduce(function(hashMap, key) {
|
||
hashMap[key] = value;
|
||
return hashMap;
|
||
}, {});
|
||
}
|
||
var toPaddingObject = function toPaddingObject2(padding, state) {
|
||
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
|
||
placement: state.placement
|
||
})) : padding;
|
||
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
||
};
|
||
function arrow(_ref) {
|
||
var _state$modifiersData$;
|
||
var state = _ref.state, name = _ref.name, options = _ref.options;
|
||
var arrowElement = state.elements.arrow;
|
||
var popperOffsets2 = state.modifiersData.popperOffsets;
|
||
var basePlacement = getBasePlacement(state.placement);
|
||
var axis = getMainAxisFromPlacement(basePlacement);
|
||
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
||
var len = isVertical ? "height" : "width";
|
||
if (!arrowElement || !popperOffsets2) {
|
||
return;
|
||
}
|
||
var paddingObject = toPaddingObject(options.padding, state);
|
||
var arrowRect = getLayoutRect(arrowElement);
|
||
var minProp = axis === "y" ? top : left;
|
||
var maxProp = axis === "y" ? bottom : right;
|
||
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
||
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
||
var arrowOffsetParent = getOffsetParent(arrowElement);
|
||
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
||
var centerToReference = endDiff / 2 - startDiff / 2;
|
||
var min2 = paddingObject[minProp];
|
||
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
||
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
||
var offset2 = within(min2, center, max2);
|
||
var axisProp = axis;
|
||
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
||
}
|
||
function effect$1(_ref2) {
|
||
var state = _ref2.state, options = _ref2.options;
|
||
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
||
if (arrowElement == null) {
|
||
return;
|
||
}
|
||
if (typeof arrowElement === "string") {
|
||
arrowElement = state.elements.popper.querySelector(arrowElement);
|
||
if (!arrowElement) {
|
||
return;
|
||
}
|
||
}
|
||
if (!contains(state.elements.popper, arrowElement)) {
|
||
return;
|
||
}
|
||
state.elements.arrow = arrowElement;
|
||
}
|
||
var arrow$1 = {
|
||
name: "arrow",
|
||
enabled: true,
|
||
phase: "main",
|
||
fn: arrow,
|
||
effect: effect$1,
|
||
requires: ["popperOffsets"],
|
||
requiresIfExists: ["preventOverflow"]
|
||
};
|
||
function getVariation(placement) {
|
||
return placement.split("-")[1];
|
||
}
|
||
var unsetSides = {
|
||
top: "auto",
|
||
right: "auto",
|
||
bottom: "auto",
|
||
left: "auto"
|
||
};
|
||
function roundOffsetsByDPR(_ref) {
|
||
var x = _ref.x, y = _ref.y;
|
||
var win = window;
|
||
var dpr = win.devicePixelRatio || 1;
|
||
return {
|
||
x: round(x * dpr) / dpr || 0,
|
||
y: round(y * dpr) / dpr || 0
|
||
};
|
||
}
|
||
function mapToStyles(_ref2) {
|
||
var _Object$assign2;
|
||
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
||
var _ref3 = roundOffsets === true ? roundOffsetsByDPR(offsets) : typeof roundOffsets === "function" ? roundOffsets(offsets) : offsets, _ref3$x = _ref3.x, x = _ref3$x === void 0 ? 0 : _ref3$x, _ref3$y = _ref3.y, y = _ref3$y === void 0 ? 0 : _ref3$y;
|
||
var hasX = offsets.hasOwnProperty("x");
|
||
var hasY = offsets.hasOwnProperty("y");
|
||
var sideX = left;
|
||
var sideY = top;
|
||
var win = window;
|
||
if (adaptive) {
|
||
var offsetParent = getOffsetParent(popper2);
|
||
var heightProp = "clientHeight";
|
||
var widthProp = "clientWidth";
|
||
if (offsetParent === getWindow(popper2)) {
|
||
offsetParent = getDocumentElement(popper2);
|
||
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
||
heightProp = "scrollHeight";
|
||
widthProp = "scrollWidth";
|
||
}
|
||
}
|
||
offsetParent = offsetParent;
|
||
if (placement === top || (placement === left || placement === right) && variation === end) {
|
||
sideY = bottom;
|
||
var offsetY = isFixed && win.visualViewport ? win.visualViewport.height : (
|
||
// $FlowFixMe[prop-missing]
|
||
offsetParent[heightProp]
|
||
);
|
||
y -= offsetY - popperRect.height;
|
||
y *= gpuAcceleration ? 1 : -1;
|
||
}
|
||
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
||
sideX = right;
|
||
var offsetX = isFixed && win.visualViewport ? win.visualViewport.width : (
|
||
// $FlowFixMe[prop-missing]
|
||
offsetParent[widthProp]
|
||
);
|
||
x -= offsetX - popperRect.width;
|
||
x *= gpuAcceleration ? 1 : -1;
|
||
}
|
||
}
|
||
var commonStyles = Object.assign({
|
||
position
|
||
}, adaptive && unsetSides);
|
||
if (gpuAcceleration) {
|
||
var _Object$assign;
|
||
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
||
}
|
||
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
||
}
|
||
function computeStyles(_ref4) {
|
||
var state = _ref4.state, options = _ref4.options;
|
||
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
||
var commonStyles = {
|
||
placement: getBasePlacement(state.placement),
|
||
variation: getVariation(state.placement),
|
||
popper: state.elements.popper,
|
||
popperRect: state.rects.popper,
|
||
gpuAcceleration,
|
||
isFixed: state.options.strategy === "fixed"
|
||
};
|
||
if (state.modifiersData.popperOffsets != null) {
|
||
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
||
offsets: state.modifiersData.popperOffsets,
|
||
position: state.options.strategy,
|
||
adaptive,
|
||
roundOffsets
|
||
})));
|
||
}
|
||
if (state.modifiersData.arrow != null) {
|
||
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
||
offsets: state.modifiersData.arrow,
|
||
position: "absolute",
|
||
adaptive: false,
|
||
roundOffsets
|
||
})));
|
||
}
|
||
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
||
"data-popper-placement": state.placement
|
||
});
|
||
}
|
||
var computeStyles$1 = {
|
||
name: "computeStyles",
|
||
enabled: true,
|
||
phase: "beforeWrite",
|
||
fn: computeStyles,
|
||
data: {}
|
||
};
|
||
var passive = {
|
||
passive: true
|
||
};
|
||
function effect$2(_ref) {
|
||
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
||
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
||
var window2 = getWindow(state.elements.popper);
|
||
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
||
if (scroll) {
|
||
scrollParents.forEach(function(scrollParent) {
|
||
scrollParent.addEventListener("scroll", instance.update, passive);
|
||
});
|
||
}
|
||
if (resize) {
|
||
window2.addEventListener("resize", instance.update, passive);
|
||
}
|
||
return function() {
|
||
if (scroll) {
|
||
scrollParents.forEach(function(scrollParent) {
|
||
scrollParent.removeEventListener("scroll", instance.update, passive);
|
||
});
|
||
}
|
||
if (resize) {
|
||
window2.removeEventListener("resize", instance.update, passive);
|
||
}
|
||
};
|
||
}
|
||
var eventListeners = {
|
||
name: "eventListeners",
|
||
enabled: true,
|
||
phase: "write",
|
||
fn: function fn() {
|
||
},
|
||
effect: effect$2,
|
||
data: {}
|
||
};
|
||
var hash = {
|
||
left: "right",
|
||
right: "left",
|
||
bottom: "top",
|
||
top: "bottom"
|
||
};
|
||
function getOppositePlacement(placement) {
|
||
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
||
return hash[matched];
|
||
});
|
||
}
|
||
var hash$1 = {
|
||
start: "end",
|
||
end: "start"
|
||
};
|
||
function getOppositeVariationPlacement(placement) {
|
||
return placement.replace(/start|end/g, function(matched) {
|
||
return hash$1[matched];
|
||
});
|
||
}
|
||
function getWindowScroll(node) {
|
||
var win = getWindow(node);
|
||
var scrollLeft = win.pageXOffset;
|
||
var scrollTop = win.pageYOffset;
|
||
return {
|
||
scrollLeft,
|
||
scrollTop
|
||
};
|
||
}
|
||
function getWindowScrollBarX(element) {
|
||
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
||
}
|
||
function getViewportRect(element) {
|
||
var win = getWindow(element);
|
||
var html = getDocumentElement(element);
|
||
var visualViewport = win.visualViewport;
|
||
var width = html.clientWidth;
|
||
var height = html.clientHeight;
|
||
var x = 0;
|
||
var y = 0;
|
||
if (visualViewport) {
|
||
width = visualViewport.width;
|
||
height = visualViewport.height;
|
||
if (!/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {
|
||
x = visualViewport.offsetLeft;
|
||
y = visualViewport.offsetTop;
|
||
}
|
||
}
|
||
return {
|
||
width,
|
||
height,
|
||
x: x + getWindowScrollBarX(element),
|
||
y
|
||
};
|
||
}
|
||
function getDocumentRect(element) {
|
||
var _element$ownerDocumen;
|
||
var html = getDocumentElement(element);
|
||
var winScroll = getWindowScroll(element);
|
||
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
||
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
||
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
||
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
||
var y = -winScroll.scrollTop;
|
||
if (getComputedStyle(body || html).direction === "rtl") {
|
||
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
||
}
|
||
return {
|
||
width,
|
||
height,
|
||
x,
|
||
y
|
||
};
|
||
}
|
||
function isScrollParent(element) {
|
||
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
||
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
||
}
|
||
function getScrollParent(node) {
|
||
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
||
return node.ownerDocument.body;
|
||
}
|
||
if (isHTMLElement(node) && isScrollParent(node)) {
|
||
return node;
|
||
}
|
||
return getScrollParent(getParentNode(node));
|
||
}
|
||
function listScrollParents(element, list) {
|
||
var _element$ownerDocumen;
|
||
if (list === void 0) {
|
||
list = [];
|
||
}
|
||
var scrollParent = getScrollParent(element);
|
||
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
||
var win = getWindow(scrollParent);
|
||
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
||
var updatedList = list.concat(target);
|
||
return isBody ? updatedList : (
|
||
// $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
|
||
updatedList.concat(listScrollParents(getParentNode(target)))
|
||
);
|
||
}
|
||
function rectToClientRect(rect) {
|
||
return Object.assign({}, rect, {
|
||
left: rect.x,
|
||
top: rect.y,
|
||
right: rect.x + rect.width,
|
||
bottom: rect.y + rect.height
|
||
});
|
||
}
|
||
function getInnerBoundingClientRect(element) {
|
||
var rect = getBoundingClientRect(element);
|
||
rect.top = rect.top + element.clientTop;
|
||
rect.left = rect.left + element.clientLeft;
|
||
rect.bottom = rect.top + element.clientHeight;
|
||
rect.right = rect.left + element.clientWidth;
|
||
rect.width = element.clientWidth;
|
||
rect.height = element.clientHeight;
|
||
rect.x = rect.left;
|
||
rect.y = rect.top;
|
||
return rect;
|
||
}
|
||
function getClientRectFromMixedType(element, clippingParent) {
|
||
return clippingParent === viewport ? rectToClientRect(getViewportRect(element)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
||
}
|
||
function getClippingParents(element) {
|
||
var clippingParents2 = listScrollParents(getParentNode(element));
|
||
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
|
||
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
||
if (!isElement(clipperElement)) {
|
||
return [];
|
||
}
|
||
return clippingParents2.filter(function(clippingParent) {
|
||
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body" && (canEscapeClipping ? getComputedStyle(clippingParent).position !== "static" : true);
|
||
});
|
||
}
|
||
function getClippingRect(element, boundary, rootBoundary) {
|
||
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
||
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
||
var firstClippingParent = clippingParents2[0];
|
||
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
||
var rect = getClientRectFromMixedType(element, clippingParent);
|
||
accRect.top = max(rect.top, accRect.top);
|
||
accRect.right = min(rect.right, accRect.right);
|
||
accRect.bottom = min(rect.bottom, accRect.bottom);
|
||
accRect.left = max(rect.left, accRect.left);
|
||
return accRect;
|
||
}, getClientRectFromMixedType(element, firstClippingParent));
|
||
clippingRect.width = clippingRect.right - clippingRect.left;
|
||
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
||
clippingRect.x = clippingRect.left;
|
||
clippingRect.y = clippingRect.top;
|
||
return clippingRect;
|
||
}
|
||
function computeOffsets(_ref) {
|
||
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
||
var basePlacement = placement ? getBasePlacement(placement) : null;
|
||
var variation = placement ? getVariation(placement) : null;
|
||
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
||
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
||
var offsets;
|
||
switch (basePlacement) {
|
||
case top:
|
||
offsets = {
|
||
x: commonX,
|
||
y: reference2.y - element.height
|
||
};
|
||
break;
|
||
case bottom:
|
||
offsets = {
|
||
x: commonX,
|
||
y: reference2.y + reference2.height
|
||
};
|
||
break;
|
||
case right:
|
||
offsets = {
|
||
x: reference2.x + reference2.width,
|
||
y: commonY
|
||
};
|
||
break;
|
||
case left:
|
||
offsets = {
|
||
x: reference2.x - element.width,
|
||
y: commonY
|
||
};
|
||
break;
|
||
default:
|
||
offsets = {
|
||
x: reference2.x,
|
||
y: reference2.y
|
||
};
|
||
}
|
||
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
||
if (mainAxis != null) {
|
||
var len = mainAxis === "y" ? "height" : "width";
|
||
switch (variation) {
|
||
case start:
|
||
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
||
break;
|
||
case end:
|
||
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
||
break;
|
||
}
|
||
}
|
||
return offsets;
|
||
}
|
||
function detectOverflow(state, options) {
|
||
if (options === void 0) {
|
||
options = {};
|
||
}
|
||
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
||
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
||
var altContext = elementContext === popper ? reference : popper;
|
||
var popperRect = state.rects.popper;
|
||
var element = state.elements[altBoundary ? altContext : elementContext];
|
||
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary);
|
||
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
||
var popperOffsets2 = computeOffsets({
|
||
reference: referenceClientRect,
|
||
element: popperRect,
|
||
strategy: "absolute",
|
||
placement
|
||
});
|
||
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
||
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
||
var overflowOffsets = {
|
||
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
||
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
||
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
||
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
||
};
|
||
var offsetData = state.modifiersData.offset;
|
||
if (elementContext === popper && offsetData) {
|
||
var offset2 = offsetData[placement];
|
||
Object.keys(overflowOffsets).forEach(function(key) {
|
||
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
||
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
|
||
overflowOffsets[key] += offset2[axis] * multiply;
|
||
});
|
||
}
|
||
return overflowOffsets;
|
||
}
|
||
function computeAutoPlacement(state, options) {
|
||
if (options === void 0) {
|
||
options = {};
|
||
}
|
||
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
||
var variation = getVariation(placement);
|
||
var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
||
return getVariation(placement2) === variation;
|
||
}) : basePlacements;
|
||
var allowedPlacements = placements$1.filter(function(placement2) {
|
||
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
||
});
|
||
if (allowedPlacements.length === 0) {
|
||
allowedPlacements = placements$1;
|
||
}
|
||
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
||
acc[placement2] = detectOverflow(state, {
|
||
placement: placement2,
|
||
boundary,
|
||
rootBoundary,
|
||
padding
|
||
})[getBasePlacement(placement2)];
|
||
return acc;
|
||
}, {});
|
||
return Object.keys(overflows).sort(function(a, b) {
|
||
return overflows[a] - overflows[b];
|
||
});
|
||
}
|
||
function getExpandedFallbackPlacements(placement) {
|
||
if (getBasePlacement(placement) === auto) {
|
||
return [];
|
||
}
|
||
var oppositePlacement = getOppositePlacement(placement);
|
||
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
||
}
|
||
function flip(_ref) {
|
||
var state = _ref.state, options = _ref.options, name = _ref.name;
|
||
if (state.modifiersData[name]._skip) {
|
||
return;
|
||
}
|
||
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
||
var preferredPlacement = state.options.placement;
|
||
var basePlacement = getBasePlacement(preferredPlacement);
|
||
var isBasePlacement = basePlacement === preferredPlacement;
|
||
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
||
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
||
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
||
placement: placement2,
|
||
boundary,
|
||
rootBoundary,
|
||
padding,
|
||
flipVariations,
|
||
allowedAutoPlacements
|
||
}) : placement2);
|
||
}, []);
|
||
var referenceRect = state.rects.reference;
|
||
var popperRect = state.rects.popper;
|
||
var checksMap = /* @__PURE__ */ new Map();
|
||
var makeFallbackChecks = true;
|
||
var firstFittingPlacement = placements2[0];
|
||
for (var i = 0; i < placements2.length; i++) {
|
||
var placement = placements2[i];
|
||
var _basePlacement = getBasePlacement(placement);
|
||
var isStartVariation = getVariation(placement) === start;
|
||
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
||
var len = isVertical ? "width" : "height";
|
||
var overflow = detectOverflow(state, {
|
||
placement,
|
||
boundary,
|
||
rootBoundary,
|
||
altBoundary,
|
||
padding
|
||
});
|
||
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
||
if (referenceRect[len] > popperRect[len]) {
|
||
mainVariationSide = getOppositePlacement(mainVariationSide);
|
||
}
|
||
var altVariationSide = getOppositePlacement(mainVariationSide);
|
||
var checks = [];
|
||
if (checkMainAxis) {
|
||
checks.push(overflow[_basePlacement] <= 0);
|
||
}
|
||
if (checkAltAxis) {
|
||
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
||
}
|
||
if (checks.every(function(check) {
|
||
return check;
|
||
})) {
|
||
firstFittingPlacement = placement;
|
||
makeFallbackChecks = false;
|
||
break;
|
||
}
|
||
checksMap.set(placement, checks);
|
||
}
|
||
if (makeFallbackChecks) {
|
||
var numberOfChecks = flipVariations ? 3 : 1;
|
||
var _loop = function _loop2(_i2) {
|
||
var fittingPlacement = placements2.find(function(placement2) {
|
||
var checks2 = checksMap.get(placement2);
|
||
if (checks2) {
|
||
return checks2.slice(0, _i2).every(function(check) {
|
||
return check;
|
||
});
|
||
}
|
||
});
|
||
if (fittingPlacement) {
|
||
firstFittingPlacement = fittingPlacement;
|
||
return "break";
|
||
}
|
||
};
|
||
for (var _i = numberOfChecks; _i > 0; _i--) {
|
||
var _ret = _loop(_i);
|
||
if (_ret === "break") break;
|
||
}
|
||
}
|
||
if (state.placement !== firstFittingPlacement) {
|
||
state.modifiersData[name]._skip = true;
|
||
state.placement = firstFittingPlacement;
|
||
state.reset = true;
|
||
}
|
||
}
|
||
var flip$1 = {
|
||
name: "flip",
|
||
enabled: true,
|
||
phase: "main",
|
||
fn: flip,
|
||
requiresIfExists: ["offset"],
|
||
data: {
|
||
_skip: false
|
||
}
|
||
};
|
||
function getSideOffsets(overflow, rect, preventedOffsets) {
|
||
if (preventedOffsets === void 0) {
|
||
preventedOffsets = {
|
||
x: 0,
|
||
y: 0
|
||
};
|
||
}
|
||
return {
|
||
top: overflow.top - rect.height - preventedOffsets.y,
|
||
right: overflow.right - rect.width + preventedOffsets.x,
|
||
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
||
left: overflow.left - rect.width - preventedOffsets.x
|
||
};
|
||
}
|
||
function isAnySideFullyClipped(overflow) {
|
||
return [top, right, bottom, left].some(function(side) {
|
||
return overflow[side] >= 0;
|
||
});
|
||
}
|
||
function hide(_ref) {
|
||
var state = _ref.state, name = _ref.name;
|
||
var referenceRect = state.rects.reference;
|
||
var popperRect = state.rects.popper;
|
||
var preventedOffsets = state.modifiersData.preventOverflow;
|
||
var referenceOverflow = detectOverflow(state, {
|
||
elementContext: "reference"
|
||
});
|
||
var popperAltOverflow = detectOverflow(state, {
|
||
altBoundary: true
|
||
});
|
||
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
||
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
||
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
||
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
||
state.modifiersData[name] = {
|
||
referenceClippingOffsets,
|
||
popperEscapeOffsets,
|
||
isReferenceHidden,
|
||
hasPopperEscaped
|
||
};
|
||
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
||
"data-popper-reference-hidden": isReferenceHidden,
|
||
"data-popper-escaped": hasPopperEscaped
|
||
});
|
||
}
|
||
var hide$1 = {
|
||
name: "hide",
|
||
enabled: true,
|
||
phase: "main",
|
||
requiresIfExists: ["preventOverflow"],
|
||
fn: hide
|
||
};
|
||
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
||
var basePlacement = getBasePlacement(placement);
|
||
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
||
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
||
placement
|
||
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
||
skidding = skidding || 0;
|
||
distance = (distance || 0) * invertDistance;
|
||
return [left, right].indexOf(basePlacement) >= 0 ? {
|
||
x: distance,
|
||
y: skidding
|
||
} : {
|
||
x: skidding,
|
||
y: distance
|
||
};
|
||
}
|
||
function offset(_ref2) {
|
||
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
||
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
||
var data = placements.reduce(function(acc, placement) {
|
||
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
||
return acc;
|
||
}, {});
|
||
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
||
if (state.modifiersData.popperOffsets != null) {
|
||
state.modifiersData.popperOffsets.x += x;
|
||
state.modifiersData.popperOffsets.y += y;
|
||
}
|
||
state.modifiersData[name] = data;
|
||
}
|
||
var offset$1 = {
|
||
name: "offset",
|
||
enabled: true,
|
||
phase: "main",
|
||
requires: ["popperOffsets"],
|
||
fn: offset
|
||
};
|
||
function popperOffsets(_ref) {
|
||
var state = _ref.state, name = _ref.name;
|
||
state.modifiersData[name] = computeOffsets({
|
||
reference: state.rects.reference,
|
||
element: state.rects.popper,
|
||
strategy: "absolute",
|
||
placement: state.placement
|
||
});
|
||
}
|
||
var popperOffsets$1 = {
|
||
name: "popperOffsets",
|
||
enabled: true,
|
||
phase: "read",
|
||
fn: popperOffsets,
|
||
data: {}
|
||
};
|
||
function getAltAxis(axis) {
|
||
return axis === "x" ? "y" : "x";
|
||
}
|
||
function preventOverflow(_ref) {
|
||
var state = _ref.state, options = _ref.options, name = _ref.name;
|
||
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
||
var overflow = detectOverflow(state, {
|
||
boundary,
|
||
rootBoundary,
|
||
padding,
|
||
altBoundary
|
||
});
|
||
var basePlacement = getBasePlacement(state.placement);
|
||
var variation = getVariation(state.placement);
|
||
var isBasePlacement = !variation;
|
||
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
||
var altAxis = getAltAxis(mainAxis);
|
||
var popperOffsets2 = state.modifiersData.popperOffsets;
|
||
var referenceRect = state.rects.reference;
|
||
var popperRect = state.rects.popper;
|
||
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
||
placement: state.placement
|
||
})) : tetherOffset;
|
||
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
||
mainAxis: tetherOffsetValue,
|
||
altAxis: tetherOffsetValue
|
||
} : Object.assign({
|
||
mainAxis: 0,
|
||
altAxis: 0
|
||
}, tetherOffsetValue);
|
||
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
||
var data = {
|
||
x: 0,
|
||
y: 0
|
||
};
|
||
if (!popperOffsets2) {
|
||
return;
|
||
}
|
||
if (checkMainAxis) {
|
||
var _offsetModifierState$;
|
||
var mainSide = mainAxis === "y" ? top : left;
|
||
var altSide = mainAxis === "y" ? bottom : right;
|
||
var len = mainAxis === "y" ? "height" : "width";
|
||
var offset2 = popperOffsets2[mainAxis];
|
||
var min$1 = offset2 + overflow[mainSide];
|
||
var max$1 = offset2 - overflow[altSide];
|
||
var additive = tether ? -popperRect[len] / 2 : 0;
|
||
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
||
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
||
var arrowElement = state.elements.arrow;
|
||
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
||
width: 0,
|
||
height: 0
|
||
};
|
||
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
||
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
||
var arrowPaddingMax = arrowPaddingObject[altSide];
|
||
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
||
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
||
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
||
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
||
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
||
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
||
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
||
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
||
var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1);
|
||
popperOffsets2[mainAxis] = preventedOffset;
|
||
data[mainAxis] = preventedOffset - offset2;
|
||
}
|
||
if (checkAltAxis) {
|
||
var _offsetModifierState$2;
|
||
var _mainSide = mainAxis === "x" ? top : left;
|
||
var _altSide = mainAxis === "x" ? bottom : right;
|
||
var _offset = popperOffsets2[altAxis];
|
||
var _len = altAxis === "y" ? "height" : "width";
|
||
var _min = _offset + overflow[_mainSide];
|
||
var _max = _offset - overflow[_altSide];
|
||
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
||
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
||
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
||
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
||
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
||
popperOffsets2[altAxis] = _preventedOffset;
|
||
data[altAxis] = _preventedOffset - _offset;
|
||
}
|
||
state.modifiersData[name] = data;
|
||
}
|
||
var preventOverflow$1 = {
|
||
name: "preventOverflow",
|
||
enabled: true,
|
||
phase: "main",
|
||
fn: preventOverflow,
|
||
requiresIfExists: ["offset"]
|
||
};
|
||
function getHTMLElementScroll(element) {
|
||
return {
|
||
scrollLeft: element.scrollLeft,
|
||
scrollTop: element.scrollTop
|
||
};
|
||
}
|
||
function getNodeScroll(node) {
|
||
if (node === getWindow(node) || !isHTMLElement(node)) {
|
||
return getWindowScroll(node);
|
||
} else {
|
||
return getHTMLElementScroll(node);
|
||
}
|
||
}
|
||
function isElementScaled(element) {
|
||
var rect = element.getBoundingClientRect();
|
||
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
||
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
||
return scaleX !== 1 || scaleY !== 1;
|
||
}
|
||
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
||
if (isFixed === void 0) {
|
||
isFixed = false;
|
||
}
|
||
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
||
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
||
var documentElement = getDocumentElement(offsetParent);
|
||
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled);
|
||
var scroll = {
|
||
scrollLeft: 0,
|
||
scrollTop: 0
|
||
};
|
||
var offsets = {
|
||
x: 0,
|
||
y: 0
|
||
};
|
||
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
||
if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
|
||
isScrollParent(documentElement)) {
|
||
scroll = getNodeScroll(offsetParent);
|
||
}
|
||
if (isHTMLElement(offsetParent)) {
|
||
offsets = getBoundingClientRect(offsetParent, true);
|
||
offsets.x += offsetParent.clientLeft;
|
||
offsets.y += offsetParent.clientTop;
|
||
} else if (documentElement) {
|
||
offsets.x = getWindowScrollBarX(documentElement);
|
||
}
|
||
}
|
||
return {
|
||
x: rect.left + scroll.scrollLeft - offsets.x,
|
||
y: rect.top + scroll.scrollTop - offsets.y,
|
||
width: rect.width,
|
||
height: rect.height
|
||
};
|
||
}
|
||
function order(modifiers) {
|
||
var map = /* @__PURE__ */ new Map();
|
||
var visited = /* @__PURE__ */ new Set();
|
||
var result = [];
|
||
modifiers.forEach(function(modifier) {
|
||
map.set(modifier.name, modifier);
|
||
});
|
||
function sort(modifier) {
|
||
visited.add(modifier.name);
|
||
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
||
requires.forEach(function(dep) {
|
||
if (!visited.has(dep)) {
|
||
var depModifier = map.get(dep);
|
||
if (depModifier) {
|
||
sort(depModifier);
|
||
}
|
||
}
|
||
});
|
||
result.push(modifier);
|
||
}
|
||
modifiers.forEach(function(modifier) {
|
||
if (!visited.has(modifier.name)) {
|
||
sort(modifier);
|
||
}
|
||
});
|
||
return result;
|
||
}
|
||
function orderModifiers(modifiers) {
|
||
var orderedModifiers = order(modifiers);
|
||
return modifierPhases.reduce(function(acc, phase) {
|
||
return acc.concat(orderedModifiers.filter(function(modifier) {
|
||
return modifier.phase === phase;
|
||
}));
|
||
}, []);
|
||
}
|
||
function debounce(fn6) {
|
||
var pending;
|
||
return function() {
|
||
if (!pending) {
|
||
pending = new Promise(function(resolve) {
|
||
Promise.resolve().then(function() {
|
||
pending = void 0;
|
||
resolve(fn6());
|
||
});
|
||
});
|
||
}
|
||
return pending;
|
||
};
|
||
}
|
||
function mergeByName(modifiers) {
|
||
var merged = modifiers.reduce(function(merged2, current) {
|
||
var existing = merged2[current.name];
|
||
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
||
options: Object.assign({}, existing.options, current.options),
|
||
data: Object.assign({}, existing.data, current.data)
|
||
}) : current;
|
||
return merged2;
|
||
}, {});
|
||
return Object.keys(merged).map(function(key) {
|
||
return merged[key];
|
||
});
|
||
}
|
||
var DEFAULT_OPTIONS = {
|
||
placement: "bottom",
|
||
modifiers: [],
|
||
strategy: "absolute"
|
||
};
|
||
function areValidElements() {
|
||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
||
args[_key] = arguments[_key];
|
||
}
|
||
return !args.some(function(element) {
|
||
return !(element && typeof element.getBoundingClientRect === "function");
|
||
});
|
||
}
|
||
function popperGenerator(generatorOptions) {
|
||
if (generatorOptions === void 0) {
|
||
generatorOptions = {};
|
||
}
|
||
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
||
return function createPopper2(reference2, popper2, options) {
|
||
if (options === void 0) {
|
||
options = defaultOptions;
|
||
}
|
||
var state = {
|
||
placement: "bottom",
|
||
orderedModifiers: [],
|
||
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
||
modifiersData: {},
|
||
elements: {
|
||
reference: reference2,
|
||
popper: popper2
|
||
},
|
||
attributes: {},
|
||
styles: {}
|
||
};
|
||
var effectCleanupFns = [];
|
||
var isDestroyed = false;
|
||
var instance = {
|
||
state,
|
||
setOptions: function setOptions(setOptionsAction) {
|
||
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
||
cleanupModifierEffects();
|
||
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
||
state.scrollParents = {
|
||
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
||
popper: listScrollParents(popper2)
|
||
};
|
||
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
||
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
||
return m.enabled;
|
||
});
|
||
runModifierEffects();
|
||
return instance.update();
|
||
},
|
||
// Sync update – it will always be executed, even if not necessary. This
|
||
// is useful for low frequency updates where sync behavior simplifies the
|
||
// logic.
|
||
// For high frequency updates (e.g. `resize` and `scroll` events), always
|
||
// prefer the async Popper#update method
|
||
forceUpdate: function forceUpdate() {
|
||
if (isDestroyed) {
|
||
return;
|
||
}
|
||
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
||
if (!areValidElements(reference3, popper3)) {
|
||
return;
|
||
}
|
||
state.rects = {
|
||
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
||
popper: getLayoutRect(popper3)
|
||
};
|
||
state.reset = false;
|
||
state.placement = state.options.placement;
|
||
state.orderedModifiers.forEach(function(modifier) {
|
||
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
||
});
|
||
for (var index = 0; index < state.orderedModifiers.length; index++) {
|
||
if (state.reset === true) {
|
||
state.reset = false;
|
||
index = -1;
|
||
continue;
|
||
}
|
||
var _state$orderedModifie = state.orderedModifiers[index], fn6 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
||
if (typeof fn6 === "function") {
|
||
state = fn6({
|
||
state,
|
||
options: _options,
|
||
name,
|
||
instance
|
||
}) || state;
|
||
}
|
||
}
|
||
},
|
||
// Async and optimistically optimized update – it will not be executed if
|
||
// not necessary (debounced to run at most once-per-tick)
|
||
update: debounce(function() {
|
||
return new Promise(function(resolve) {
|
||
instance.forceUpdate();
|
||
resolve(state);
|
||
});
|
||
}),
|
||
destroy: function destroy() {
|
||
cleanupModifierEffects();
|
||
isDestroyed = true;
|
||
}
|
||
};
|
||
if (!areValidElements(reference2, popper2)) {
|
||
return instance;
|
||
}
|
||
instance.setOptions(options).then(function(state2) {
|
||
if (!isDestroyed && options.onFirstUpdate) {
|
||
options.onFirstUpdate(state2);
|
||
}
|
||
});
|
||
function runModifierEffects() {
|
||
state.orderedModifiers.forEach(function(_ref3) {
|
||
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect3 = _ref3.effect;
|
||
if (typeof effect3 === "function") {
|
||
var cleanupFn = effect3({
|
||
state,
|
||
name,
|
||
instance,
|
||
options: options2
|
||
});
|
||
var noopFn = function noopFn2() {
|
||
};
|
||
effectCleanupFns.push(cleanupFn || noopFn);
|
||
}
|
||
});
|
||
}
|
||
function cleanupModifierEffects() {
|
||
effectCleanupFns.forEach(function(fn6) {
|
||
return fn6();
|
||
});
|
||
effectCleanupFns = [];
|
||
}
|
||
return instance;
|
||
};
|
||
}
|
||
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1];
|
||
var createPopper = popperGenerator({
|
||
defaultModifiers
|
||
});
|
||
var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>';
|
||
var BOX_CLASS = "tippy-box";
|
||
var CONTENT_CLASS = "tippy-content";
|
||
var BACKDROP_CLASS = "tippy-backdrop";
|
||
var ARROW_CLASS = "tippy-arrow";
|
||
var SVG_ARROW_CLASS = "tippy-svg-arrow";
|
||
var TOUCH_OPTIONS = {
|
||
passive: true,
|
||
capture: true
|
||
};
|
||
var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() {
|
||
return document.body;
|
||
};
|
||
function getValueAtIndexOrReturn(value, index, defaultValue) {
|
||
if (Array.isArray(value)) {
|
||
var v = value[index];
|
||
return v == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v;
|
||
}
|
||
return value;
|
||
}
|
||
function isType(value, type) {
|
||
var str = {}.toString.call(value);
|
||
return str.indexOf("[object") === 0 && str.indexOf(type + "]") > -1;
|
||
}
|
||
function invokeWithArgsOrReturn(value, args) {
|
||
return typeof value === "function" ? value.apply(void 0, args) : value;
|
||
}
|
||
function debounce$1(fn6, ms) {
|
||
if (ms === 0) {
|
||
return fn6;
|
||
}
|
||
var timeout;
|
||
return function(arg) {
|
||
clearTimeout(timeout);
|
||
timeout = setTimeout(function() {
|
||
fn6(arg);
|
||
}, ms);
|
||
};
|
||
}
|
||
function removeProperties(obj, keys) {
|
||
var clone = Object.assign({}, obj);
|
||
keys.forEach(function(key) {
|
||
delete clone[key];
|
||
});
|
||
return clone;
|
||
}
|
||
function splitBySpaces(value) {
|
||
return value.split(/\s+/).filter(Boolean);
|
||
}
|
||
function normalizeToArray(value) {
|
||
return [].concat(value);
|
||
}
|
||
function pushIfUnique(arr, value) {
|
||
if (arr.indexOf(value) === -1) {
|
||
arr.push(value);
|
||
}
|
||
}
|
||
function unique(arr) {
|
||
return arr.filter(function(item, index) {
|
||
return arr.indexOf(item) === index;
|
||
});
|
||
}
|
||
function getBasePlacement$1(placement) {
|
||
return placement.split("-")[0];
|
||
}
|
||
function arrayFrom(value) {
|
||
return [].slice.call(value);
|
||
}
|
||
function removeUndefinedProps(obj) {
|
||
return Object.keys(obj).reduce(function(acc, key) {
|
||
if (obj[key] !== void 0) {
|
||
acc[key] = obj[key];
|
||
}
|
||
return acc;
|
||
}, {});
|
||
}
|
||
function div() {
|
||
return document.createElement("div");
|
||
}
|
||
function isElement$1(value) {
|
||
return ["Element", "Fragment"].some(function(type) {
|
||
return isType(value, type);
|
||
});
|
||
}
|
||
function isNodeList(value) {
|
||
return isType(value, "NodeList");
|
||
}
|
||
function isMouseEvent(value) {
|
||
return isType(value, "MouseEvent");
|
||
}
|
||
function isReferenceElement(value) {
|
||
return !!(value && value._tippy && value._tippy.reference === value);
|
||
}
|
||
function getArrayOfElements(value) {
|
||
if (isElement$1(value)) {
|
||
return [value];
|
||
}
|
||
if (isNodeList(value)) {
|
||
return arrayFrom(value);
|
||
}
|
||
if (Array.isArray(value)) {
|
||
return value;
|
||
}
|
||
return arrayFrom(document.querySelectorAll(value));
|
||
}
|
||
function setTransitionDuration(els, value) {
|
||
els.forEach(function(el) {
|
||
if (el) {
|
||
el.style.transitionDuration = value + "ms";
|
||
}
|
||
});
|
||
}
|
||
function setVisibilityState(els, state) {
|
||
els.forEach(function(el) {
|
||
if (el) {
|
||
el.setAttribute("data-state", state);
|
||
}
|
||
});
|
||
}
|
||
function getOwnerDocument(elementOrElements) {
|
||
var _element$ownerDocumen;
|
||
var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0];
|
||
return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document;
|
||
}
|
||
function isCursorOutsideInteractiveBorder(popperTreeData, event) {
|
||
var clientX = event.clientX, clientY = event.clientY;
|
||
return popperTreeData.every(function(_ref) {
|
||
var popperRect = _ref.popperRect, popperState = _ref.popperState, props2 = _ref.props;
|
||
var interactiveBorder = props2.interactiveBorder;
|
||
var basePlacement = getBasePlacement$1(popperState.placement);
|
||
var offsetData = popperState.modifiersData.offset;
|
||
if (!offsetData) {
|
||
return true;
|
||
}
|
||
var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0;
|
||
var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0;
|
||
var leftDistance = basePlacement === "right" ? offsetData.left.x : 0;
|
||
var rightDistance = basePlacement === "left" ? offsetData.right.x : 0;
|
||
var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder;
|
||
var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder;
|
||
var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder;
|
||
var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder;
|
||
return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight;
|
||
});
|
||
}
|
||
function updateTransitionEndListener(box, action, listener) {
|
||
var method = action + "EventListener";
|
||
["transitionend", "webkitTransitionEnd"].forEach(function(event) {
|
||
box[method](event, listener);
|
||
});
|
||
}
|
||
function actualContains(parent, child) {
|
||
var target = child;
|
||
while (target) {
|
||
var _target$getRootNode;
|
||
if (parent.contains(target)) {
|
||
return true;
|
||
}
|
||
target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host;
|
||
}
|
||
return false;
|
||
}
|
||
var currentInput = {
|
||
isTouch: false
|
||
};
|
||
var lastMouseMoveTime = 0;
|
||
function onDocumentTouchStart() {
|
||
if (currentInput.isTouch) {
|
||
return;
|
||
}
|
||
currentInput.isTouch = true;
|
||
if (window.performance) {
|
||
document.addEventListener("mousemove", onDocumentMouseMove);
|
||
}
|
||
}
|
||
function onDocumentMouseMove() {
|
||
var now = performance.now();
|
||
if (now - lastMouseMoveTime < 20) {
|
||
currentInput.isTouch = false;
|
||
document.removeEventListener("mousemove", onDocumentMouseMove);
|
||
}
|
||
lastMouseMoveTime = now;
|
||
}
|
||
function onWindowBlur() {
|
||
var activeElement = document.activeElement;
|
||
if (isReferenceElement(activeElement)) {
|
||
var instance = activeElement._tippy;
|
||
if (activeElement.blur && !instance.state.isVisible) {
|
||
activeElement.blur();
|
||
}
|
||
}
|
||
}
|
||
function bindGlobalEventListeners() {
|
||
document.addEventListener("touchstart", onDocumentTouchStart, TOUCH_OPTIONS);
|
||
window.addEventListener("blur", onWindowBlur);
|
||
}
|
||
var isBrowser = typeof window !== "undefined" && typeof document !== "undefined";
|
||
var isIE11 = isBrowser ? (
|
||
// @ts-ignore
|
||
!!window.msCrypto
|
||
) : false;
|
||
var pluginProps = {
|
||
animateFill: false,
|
||
followCursor: false,
|
||
inlinePositioning: false,
|
||
sticky: false
|
||
};
|
||
var renderProps = {
|
||
allowHTML: false,
|
||
animation: "fade",
|
||
arrow: true,
|
||
content: "",
|
||
inertia: false,
|
||
maxWidth: 350,
|
||
role: "tooltip",
|
||
theme: "",
|
||
zIndex: 9999
|
||
};
|
||
var defaultProps = Object.assign({
|
||
appendTo: TIPPY_DEFAULT_APPEND_TO,
|
||
aria: {
|
||
content: "auto",
|
||
expanded: "auto"
|
||
},
|
||
delay: 0,
|
||
duration: [300, 250],
|
||
getReferenceClientRect: null,
|
||
hideOnClick: true,
|
||
ignoreAttributes: false,
|
||
interactive: false,
|
||
interactiveBorder: 2,
|
||
interactiveDebounce: 0,
|
||
moveTransition: "",
|
||
offset: [0, 10],
|
||
onAfterUpdate: function onAfterUpdate() {
|
||
},
|
||
onBeforeUpdate: function onBeforeUpdate() {
|
||
},
|
||
onCreate: function onCreate() {
|
||
},
|
||
onDestroy: function onDestroy() {
|
||
},
|
||
onHidden: function onHidden() {
|
||
},
|
||
onHide: function onHide() {
|
||
},
|
||
onMount: function onMount() {
|
||
},
|
||
onShow: function onShow() {
|
||
},
|
||
onShown: function onShown() {
|
||
},
|
||
onTrigger: function onTrigger() {
|
||
},
|
||
onUntrigger: function onUntrigger() {
|
||
},
|
||
onClickOutside: function onClickOutside() {
|
||
},
|
||
placement: "top",
|
||
plugins: [],
|
||
popperOptions: {},
|
||
render: null,
|
||
showOnCreate: false,
|
||
touch: true,
|
||
trigger: "mouseenter focus",
|
||
triggerTarget: null
|
||
}, pluginProps, renderProps);
|
||
var defaultKeys = Object.keys(defaultProps);
|
||
var setDefaultProps = function setDefaultProps2(partialProps) {
|
||
var keys = Object.keys(partialProps);
|
||
keys.forEach(function(key) {
|
||
defaultProps[key] = partialProps[key];
|
||
});
|
||
};
|
||
function getExtendedPassedProps(passedProps) {
|
||
var plugins = passedProps.plugins || [];
|
||
var pluginProps2 = plugins.reduce(function(acc, plugin2) {
|
||
var name = plugin2.name, defaultValue = plugin2.defaultValue;
|
||
if (name) {
|
||
var _name;
|
||
acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
|
||
}
|
||
return acc;
|
||
}, {});
|
||
return Object.assign({}, passedProps, pluginProps2);
|
||
}
|
||
function getDataAttributeProps(reference2, plugins) {
|
||
var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, {
|
||
plugins
|
||
}))) : defaultKeys;
|
||
var props2 = propKeys.reduce(function(acc, key) {
|
||
var valueAsString = (reference2.getAttribute("data-tippy-" + key) || "").trim();
|
||
if (!valueAsString) {
|
||
return acc;
|
||
}
|
||
if (key === "content") {
|
||
acc[key] = valueAsString;
|
||
} else {
|
||
try {
|
||
acc[key] = JSON.parse(valueAsString);
|
||
} catch (e) {
|
||
acc[key] = valueAsString;
|
||
}
|
||
}
|
||
return acc;
|
||
}, {});
|
||
return props2;
|
||
}
|
||
function evaluateProps(reference2, props2) {
|
||
var out = Object.assign({}, props2, {
|
||
content: invokeWithArgsOrReturn(props2.content, [reference2])
|
||
}, props2.ignoreAttributes ? {} : getDataAttributeProps(reference2, props2.plugins));
|
||
out.aria = Object.assign({}, defaultProps.aria, out.aria);
|
||
out.aria = {
|
||
expanded: out.aria.expanded === "auto" ? props2.interactive : out.aria.expanded,
|
||
content: out.aria.content === "auto" ? props2.interactive ? null : "describedby" : out.aria.content
|
||
};
|
||
return out;
|
||
}
|
||
var innerHTML = function innerHTML2() {
|
||
return "innerHTML";
|
||
};
|
||
function dangerouslySetInnerHTML(element, html) {
|
||
element[innerHTML()] = html;
|
||
}
|
||
function createArrowElement(value) {
|
||
var arrow2 = div();
|
||
if (value === true) {
|
||
arrow2.className = ARROW_CLASS;
|
||
} else {
|
||
arrow2.className = SVG_ARROW_CLASS;
|
||
if (isElement$1(value)) {
|
||
arrow2.appendChild(value);
|
||
} else {
|
||
dangerouslySetInnerHTML(arrow2, value);
|
||
}
|
||
}
|
||
return arrow2;
|
||
}
|
||
function setContent(content, props2) {
|
||
if (isElement$1(props2.content)) {
|
||
dangerouslySetInnerHTML(content, "");
|
||
content.appendChild(props2.content);
|
||
} else if (typeof props2.content !== "function") {
|
||
if (props2.allowHTML) {
|
||
dangerouslySetInnerHTML(content, props2.content);
|
||
} else {
|
||
content.textContent = props2.content;
|
||
}
|
||
}
|
||
}
|
||
function getChildren(popper2) {
|
||
var box = popper2.firstElementChild;
|
||
var boxChildren = arrayFrom(box.children);
|
||
return {
|
||
box,
|
||
content: boxChildren.find(function(node) {
|
||
return node.classList.contains(CONTENT_CLASS);
|
||
}),
|
||
arrow: boxChildren.find(function(node) {
|
||
return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS);
|
||
}),
|
||
backdrop: boxChildren.find(function(node) {
|
||
return node.classList.contains(BACKDROP_CLASS);
|
||
})
|
||
};
|
||
}
|
||
function render(instance) {
|
||
var popper2 = div();
|
||
var box = div();
|
||
box.className = BOX_CLASS;
|
||
box.setAttribute("data-state", "hidden");
|
||
box.setAttribute("tabindex", "-1");
|
||
var content = div();
|
||
content.className = CONTENT_CLASS;
|
||
content.setAttribute("data-state", "hidden");
|
||
setContent(content, instance.props);
|
||
popper2.appendChild(box);
|
||
box.appendChild(content);
|
||
onUpdate(instance.props, instance.props);
|
||
function onUpdate(prevProps, nextProps) {
|
||
var _getChildren = getChildren(popper2), box2 = _getChildren.box, content2 = _getChildren.content, arrow2 = _getChildren.arrow;
|
||
if (nextProps.theme) {
|
||
box2.setAttribute("data-theme", nextProps.theme);
|
||
} else {
|
||
box2.removeAttribute("data-theme");
|
||
}
|
||
if (typeof nextProps.animation === "string") {
|
||
box2.setAttribute("data-animation", nextProps.animation);
|
||
} else {
|
||
box2.removeAttribute("data-animation");
|
||
}
|
||
if (nextProps.inertia) {
|
||
box2.setAttribute("data-inertia", "");
|
||
} else {
|
||
box2.removeAttribute("data-inertia");
|
||
}
|
||
box2.style.maxWidth = typeof nextProps.maxWidth === "number" ? nextProps.maxWidth + "px" : nextProps.maxWidth;
|
||
if (nextProps.role) {
|
||
box2.setAttribute("role", nextProps.role);
|
||
} else {
|
||
box2.removeAttribute("role");
|
||
}
|
||
if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) {
|
||
setContent(content2, instance.props);
|
||
}
|
||
if (nextProps.arrow) {
|
||
if (!arrow2) {
|
||
box2.appendChild(createArrowElement(nextProps.arrow));
|
||
} else if (prevProps.arrow !== nextProps.arrow) {
|
||
box2.removeChild(arrow2);
|
||
box2.appendChild(createArrowElement(nextProps.arrow));
|
||
}
|
||
} else if (arrow2) {
|
||
box2.removeChild(arrow2);
|
||
}
|
||
}
|
||
return {
|
||
popper: popper2,
|
||
onUpdate
|
||
};
|
||
}
|
||
render.$$tippy = true;
|
||
var idCounter = 1;
|
||
var mouseMoveListeners = [];
|
||
var mountedInstances = [];
|
||
function createTippy(reference2, passedProps) {
|
||
var props2 = evaluateProps(reference2, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps))));
|
||
var showTimeout;
|
||
var hideTimeout;
|
||
var scheduleHideAnimationFrame;
|
||
var isVisibleFromClick = false;
|
||
var didHideDueToDocumentMouseDown = false;
|
||
var didTouchMove = false;
|
||
var ignoreOnFirstUpdate = false;
|
||
var lastTriggerEvent;
|
||
var currentTransitionEndListener;
|
||
var onFirstUpdate;
|
||
var listeners = [];
|
||
var debouncedOnMouseMove = debounce$1(onMouseMove, props2.interactiveDebounce);
|
||
var currentTarget;
|
||
var id = idCounter++;
|
||
var popperInstance = null;
|
||
var plugins = unique(props2.plugins);
|
||
var state = {
|
||
// Is the instance currently enabled?
|
||
isEnabled: true,
|
||
// Is the tippy currently showing and not transitioning out?
|
||
isVisible: false,
|
||
// Has the instance been destroyed?
|
||
isDestroyed: false,
|
||
// Is the tippy currently mounted to the DOM?
|
||
isMounted: false,
|
||
// Has the tippy finished transitioning in?
|
||
isShown: false
|
||
};
|
||
var instance = {
|
||
// properties
|
||
id,
|
||
reference: reference2,
|
||
popper: div(),
|
||
popperInstance,
|
||
props: props2,
|
||
state,
|
||
plugins,
|
||
// methods
|
||
clearDelayTimeouts,
|
||
setProps,
|
||
setContent: setContent2,
|
||
show,
|
||
hide: hide2,
|
||
hideWithInteractivity,
|
||
enable,
|
||
disable,
|
||
unmount,
|
||
destroy
|
||
};
|
||
if (!props2.render) {
|
||
return instance;
|
||
}
|
||
var _props$render = props2.render(instance), popper2 = _props$render.popper, onUpdate = _props$render.onUpdate;
|
||
popper2.setAttribute("data-tippy-root", "");
|
||
popper2.id = "tippy-" + instance.id;
|
||
instance.popper = popper2;
|
||
reference2._tippy = instance;
|
||
popper2._tippy = instance;
|
||
var pluginsHooks = plugins.map(function(plugin2) {
|
||
return plugin2.fn(instance);
|
||
});
|
||
var hasAriaExpanded = reference2.hasAttribute("aria-expanded");
|
||
addListeners();
|
||
handleAriaExpandedAttribute();
|
||
handleStyles();
|
||
invokeHook("onCreate", [instance]);
|
||
if (props2.showOnCreate) {
|
||
scheduleShow();
|
||
}
|
||
popper2.addEventListener("mouseenter", function() {
|
||
if (instance.props.interactive && instance.state.isVisible) {
|
||
instance.clearDelayTimeouts();
|
||
}
|
||
});
|
||
popper2.addEventListener("mouseleave", function() {
|
||
if (instance.props.interactive && instance.props.trigger.indexOf("mouseenter") >= 0) {
|
||
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
||
}
|
||
});
|
||
return instance;
|
||
function getNormalizedTouchSettings() {
|
||
var touch = instance.props.touch;
|
||
return Array.isArray(touch) ? touch : [touch, 0];
|
||
}
|
||
function getIsCustomTouchBehavior() {
|
||
return getNormalizedTouchSettings()[0] === "hold";
|
||
}
|
||
function getIsDefaultRenderFn() {
|
||
var _instance$props$rende;
|
||
return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy);
|
||
}
|
||
function getCurrentTarget() {
|
||
return currentTarget || reference2;
|
||
}
|
||
function getDocument() {
|
||
var parent = getCurrentTarget().parentNode;
|
||
return parent ? getOwnerDocument(parent) : document;
|
||
}
|
||
function getDefaultTemplateChildren() {
|
||
return getChildren(popper2);
|
||
}
|
||
function getDelay(isShow) {
|
||
if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") {
|
||
return 0;
|
||
}
|
||
return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay);
|
||
}
|
||
function handleStyles(fromHide) {
|
||
if (fromHide === void 0) {
|
||
fromHide = false;
|
||
}
|
||
popper2.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none";
|
||
popper2.style.zIndex = "" + instance.props.zIndex;
|
||
}
|
||
function invokeHook(hook, args, shouldInvokePropsHook) {
|
||
if (shouldInvokePropsHook === void 0) {
|
||
shouldInvokePropsHook = true;
|
||
}
|
||
pluginsHooks.forEach(function(pluginHooks) {
|
||
if (pluginHooks[hook]) {
|
||
pluginHooks[hook].apply(pluginHooks, args);
|
||
}
|
||
});
|
||
if (shouldInvokePropsHook) {
|
||
var _instance$props;
|
||
(_instance$props = instance.props)[hook].apply(_instance$props, args);
|
||
}
|
||
}
|
||
function handleAriaContentAttribute() {
|
||
var aria = instance.props.aria;
|
||
if (!aria.content) {
|
||
return;
|
||
}
|
||
var attr = "aria-" + aria.content;
|
||
var id2 = popper2.id;
|
||
var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
|
||
nodes.forEach(function(node) {
|
||
var currentValue = node.getAttribute(attr);
|
||
if (instance.state.isVisible) {
|
||
node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2);
|
||
} else {
|
||
var nextValue = currentValue && currentValue.replace(id2, "").trim();
|
||
if (nextValue) {
|
||
node.setAttribute(attr, nextValue);
|
||
} else {
|
||
node.removeAttribute(attr);
|
||
}
|
||
}
|
||
});
|
||
}
|
||
function handleAriaExpandedAttribute() {
|
||
if (hasAriaExpanded || !instance.props.aria.expanded) {
|
||
return;
|
||
}
|
||
var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
|
||
nodes.forEach(function(node) {
|
||
if (instance.props.interactive) {
|
||
node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false");
|
||
} else {
|
||
node.removeAttribute("aria-expanded");
|
||
}
|
||
});
|
||
}
|
||
function cleanupInteractiveMouseListeners() {
|
||
getDocument().removeEventListener("mousemove", debouncedOnMouseMove);
|
||
mouseMoveListeners = mouseMoveListeners.filter(function(listener) {
|
||
return listener !== debouncedOnMouseMove;
|
||
});
|
||
}
|
||
function onDocumentPress(event) {
|
||
if (currentInput.isTouch) {
|
||
if (didTouchMove || event.type === "mousedown") {
|
||
return;
|
||
}
|
||
}
|
||
var actualTarget = event.composedPath && event.composedPath()[0] || event.target;
|
||
if (instance.props.interactive && actualContains(popper2, actualTarget)) {
|
||
return;
|
||
}
|
||
if (normalizeToArray(instance.props.triggerTarget || reference2).some(function(el) {
|
||
return actualContains(el, actualTarget);
|
||
})) {
|
||
if (currentInput.isTouch) {
|
||
return;
|
||
}
|
||
if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) {
|
||
return;
|
||
}
|
||
} else {
|
||
invokeHook("onClickOutside", [instance, event]);
|
||
}
|
||
if (instance.props.hideOnClick === true) {
|
||
instance.clearDelayTimeouts();
|
||
instance.hide();
|
||
didHideDueToDocumentMouseDown = true;
|
||
setTimeout(function() {
|
||
didHideDueToDocumentMouseDown = false;
|
||
});
|
||
if (!instance.state.isMounted) {
|
||
removeDocumentPress();
|
||
}
|
||
}
|
||
}
|
||
function onTouchMove() {
|
||
didTouchMove = true;
|
||
}
|
||
function onTouchStart() {
|
||
didTouchMove = false;
|
||
}
|
||
function addDocumentPress() {
|
||
var doc = getDocument();
|
||
doc.addEventListener("mousedown", onDocumentPress, true);
|
||
doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
|
||
doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
|
||
doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
|
||
}
|
||
function removeDocumentPress() {
|
||
var doc = getDocument();
|
||
doc.removeEventListener("mousedown", onDocumentPress, true);
|
||
doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
|
||
doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS);
|
||
doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
|
||
}
|
||
function onTransitionedOut(duration, callback) {
|
||
onTransitionEnd(duration, function() {
|
||
if (!instance.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) {
|
||
callback();
|
||
}
|
||
});
|
||
}
|
||
function onTransitionedIn(duration, callback) {
|
||
onTransitionEnd(duration, callback);
|
||
}
|
||
function onTransitionEnd(duration, callback) {
|
||
var box = getDefaultTemplateChildren().box;
|
||
function listener(event) {
|
||
if (event.target === box) {
|
||
updateTransitionEndListener(box, "remove", listener);
|
||
callback();
|
||
}
|
||
}
|
||
if (duration === 0) {
|
||
return callback();
|
||
}
|
||
updateTransitionEndListener(box, "remove", currentTransitionEndListener);
|
||
updateTransitionEndListener(box, "add", listener);
|
||
currentTransitionEndListener = listener;
|
||
}
|
||
function on(eventType, handler, options) {
|
||
if (options === void 0) {
|
||
options = false;
|
||
}
|
||
var nodes = normalizeToArray(instance.props.triggerTarget || reference2);
|
||
nodes.forEach(function(node) {
|
||
node.addEventListener(eventType, handler, options);
|
||
listeners.push({
|
||
node,
|
||
eventType,
|
||
handler,
|
||
options
|
||
});
|
||
});
|
||
}
|
||
function addListeners() {
|
||
if (getIsCustomTouchBehavior()) {
|
||
on("touchstart", onTrigger2, {
|
||
passive: true
|
||
});
|
||
on("touchend", onMouseLeave, {
|
||
passive: true
|
||
});
|
||
}
|
||
splitBySpaces(instance.props.trigger).forEach(function(eventType) {
|
||
if (eventType === "manual") {
|
||
return;
|
||
}
|
||
on(eventType, onTrigger2);
|
||
switch (eventType) {
|
||
case "mouseenter":
|
||
on("mouseleave", onMouseLeave);
|
||
break;
|
||
case "focus":
|
||
on(isIE11 ? "focusout" : "blur", onBlurOrFocusOut);
|
||
break;
|
||
case "focusin":
|
||
on("focusout", onBlurOrFocusOut);
|
||
break;
|
||
}
|
||
});
|
||
}
|
||
function removeListeners() {
|
||
listeners.forEach(function(_ref) {
|
||
var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options;
|
||
node.removeEventListener(eventType, handler, options);
|
||
});
|
||
listeners = [];
|
||
}
|
||
function onTrigger2(event) {
|
||
var _lastTriggerEvent;
|
||
var shouldScheduleClickHide = false;
|
||
if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) {
|
||
return;
|
||
}
|
||
var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus";
|
||
lastTriggerEvent = event;
|
||
currentTarget = event.currentTarget;
|
||
handleAriaExpandedAttribute();
|
||
if (!instance.state.isVisible && isMouseEvent(event)) {
|
||
mouseMoveListeners.forEach(function(listener) {
|
||
return listener(event);
|
||
});
|
||
}
|
||
if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) {
|
||
shouldScheduleClickHide = true;
|
||
} else {
|
||
scheduleShow(event);
|
||
}
|
||
if (event.type === "click") {
|
||
isVisibleFromClick = !shouldScheduleClickHide;
|
||
}
|
||
if (shouldScheduleClickHide && !wasFocused) {
|
||
scheduleHide(event);
|
||
}
|
||
}
|
||
function onMouseMove(event) {
|
||
var target = event.target;
|
||
var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target);
|
||
if (event.type === "mousemove" && isCursorOverReferenceOrPopper) {
|
||
return;
|
||
}
|
||
var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) {
|
||
var _instance$popperInsta;
|
||
var instance2 = popper3._tippy;
|
||
var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state;
|
||
if (state2) {
|
||
return {
|
||
popperRect: popper3.getBoundingClientRect(),
|
||
popperState: state2,
|
||
props: props2
|
||
};
|
||
}
|
||
return null;
|
||
}).filter(Boolean);
|
||
if (isCursorOutsideInteractiveBorder(popperTreeData, event)) {
|
||
cleanupInteractiveMouseListeners();
|
||
scheduleHide(event);
|
||
}
|
||
}
|
||
function onMouseLeave(event) {
|
||
var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick;
|
||
if (shouldBail) {
|
||
return;
|
||
}
|
||
if (instance.props.interactive) {
|
||
instance.hideWithInteractivity(event);
|
||
return;
|
||
}
|
||
scheduleHide(event);
|
||
}
|
||
function onBlurOrFocusOut(event) {
|
||
if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) {
|
||
return;
|
||
}
|
||
if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) {
|
||
return;
|
||
}
|
||
scheduleHide(event);
|
||
}
|
||
function isEventListenerStopped(event) {
|
||
return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false;
|
||
}
|
||
function createPopperInstance() {
|
||
destroyPopperInstance();
|
||
var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition;
|
||
var arrow2 = getIsDefaultRenderFn() ? getChildren(popper2).arrow : null;
|
||
var computedReference = getReferenceClientRect ? {
|
||
getBoundingClientRect: getReferenceClientRect,
|
||
contextElement: getReferenceClientRect.contextElement || getCurrentTarget()
|
||
} : reference2;
|
||
var tippyModifier = {
|
||
name: "$$tippy",
|
||
enabled: true,
|
||
phase: "beforeWrite",
|
||
requires: ["computeStyles"],
|
||
fn: function fn6(_ref2) {
|
||
var state2 = _ref2.state;
|
||
if (getIsDefaultRenderFn()) {
|
||
var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box;
|
||
["placement", "reference-hidden", "escaped"].forEach(function(attr) {
|
||
if (attr === "placement") {
|
||
box.setAttribute("data-placement", state2.placement);
|
||
} else {
|
||
if (state2.attributes.popper["data-popper-" + attr]) {
|
||
box.setAttribute("data-" + attr, "");
|
||
} else {
|
||
box.removeAttribute("data-" + attr);
|
||
}
|
||
}
|
||
});
|
||
state2.attributes.popper = {};
|
||
}
|
||
}
|
||
};
|
||
var modifiers = [{
|
||
name: "offset",
|
||
options: {
|
||
offset: offset2
|
||
}
|
||
}, {
|
||
name: "preventOverflow",
|
||
options: {
|
||
padding: {
|
||
top: 2,
|
||
bottom: 2,
|
||
left: 5,
|
||
right: 5
|
||
}
|
||
}
|
||
}, {
|
||
name: "flip",
|
||
options: {
|
||
padding: 5
|
||
}
|
||
}, {
|
||
name: "computeStyles",
|
||
options: {
|
||
adaptive: !moveTransition
|
||
}
|
||
}, tippyModifier];
|
||
if (getIsDefaultRenderFn() && arrow2) {
|
||
modifiers.push({
|
||
name: "arrow",
|
||
options: {
|
||
element: arrow2,
|
||
padding: 3
|
||
}
|
||
});
|
||
}
|
||
modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []);
|
||
instance.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, {
|
||
placement,
|
||
onFirstUpdate,
|
||
modifiers
|
||
}));
|
||
}
|
||
function destroyPopperInstance() {
|
||
if (instance.popperInstance) {
|
||
instance.popperInstance.destroy();
|
||
instance.popperInstance = null;
|
||
}
|
||
}
|
||
function mount() {
|
||
var appendTo = instance.props.appendTo;
|
||
var parentNode;
|
||
var node = getCurrentTarget();
|
||
if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") {
|
||
parentNode = node.parentNode;
|
||
} else {
|
||
parentNode = invokeWithArgsOrReturn(appendTo, [node]);
|
||
}
|
||
if (!parentNode.contains(popper2)) {
|
||
parentNode.appendChild(popper2);
|
||
}
|
||
instance.state.isMounted = true;
|
||
createPopperInstance();
|
||
}
|
||
function getNestedPopperTree() {
|
||
return arrayFrom(popper2.querySelectorAll("[data-tippy-root]"));
|
||
}
|
||
function scheduleShow(event) {
|
||
instance.clearDelayTimeouts();
|
||
if (event) {
|
||
invokeHook("onTrigger", [instance, event]);
|
||
}
|
||
addDocumentPress();
|
||
var delay = getDelay(true);
|
||
var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1];
|
||
if (currentInput.isTouch && touchValue === "hold" && touchDelay) {
|
||
delay = touchDelay;
|
||
}
|
||
if (delay) {
|
||
showTimeout = setTimeout(function() {
|
||
instance.show();
|
||
}, delay);
|
||
} else {
|
||
instance.show();
|
||
}
|
||
}
|
||
function scheduleHide(event) {
|
||
instance.clearDelayTimeouts();
|
||
invokeHook("onUntrigger", [instance, event]);
|
||
if (!instance.state.isVisible) {
|
||
removeDocumentPress();
|
||
return;
|
||
}
|
||
if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) {
|
||
return;
|
||
}
|
||
var delay = getDelay(false);
|
||
if (delay) {
|
||
hideTimeout = setTimeout(function() {
|
||
if (instance.state.isVisible) {
|
||
instance.hide();
|
||
}
|
||
}, delay);
|
||
} else {
|
||
scheduleHideAnimationFrame = requestAnimationFrame(function() {
|
||
instance.hide();
|
||
});
|
||
}
|
||
}
|
||
function enable() {
|
||
instance.state.isEnabled = true;
|
||
}
|
||
function disable() {
|
||
instance.hide();
|
||
instance.state.isEnabled = false;
|
||
}
|
||
function clearDelayTimeouts() {
|
||
clearTimeout(showTimeout);
|
||
clearTimeout(hideTimeout);
|
||
cancelAnimationFrame(scheduleHideAnimationFrame);
|
||
}
|
||
function setProps(partialProps) {
|
||
if (instance.state.isDestroyed) {
|
||
return;
|
||
}
|
||
invokeHook("onBeforeUpdate", [instance, partialProps]);
|
||
removeListeners();
|
||
var prevProps = instance.props;
|
||
var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
|
||
ignoreAttributes: true
|
||
}));
|
||
instance.props = nextProps;
|
||
addListeners();
|
||
if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
|
||
cleanupInteractiveMouseListeners();
|
||
debouncedOnMouseMove = debounce$1(onMouseMove, nextProps.interactiveDebounce);
|
||
}
|
||
if (prevProps.triggerTarget && !nextProps.triggerTarget) {
|
||
normalizeToArray(prevProps.triggerTarget).forEach(function(node) {
|
||
node.removeAttribute("aria-expanded");
|
||
});
|
||
} else if (nextProps.triggerTarget) {
|
||
reference2.removeAttribute("aria-expanded");
|
||
}
|
||
handleAriaExpandedAttribute();
|
||
handleStyles();
|
||
if (onUpdate) {
|
||
onUpdate(prevProps, nextProps);
|
||
}
|
||
if (instance.popperInstance) {
|
||
createPopperInstance();
|
||
getNestedPopperTree().forEach(function(nestedPopper) {
|
||
requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate);
|
||
});
|
||
}
|
||
invokeHook("onAfterUpdate", [instance, partialProps]);
|
||
}
|
||
function setContent2(content) {
|
||
instance.setProps({
|
||
content
|
||
});
|
||
}
|
||
function show() {
|
||
var isAlreadyVisible = instance.state.isVisible;
|
||
var isDestroyed = instance.state.isDestroyed;
|
||
var isDisabled = !instance.state.isEnabled;
|
||
var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch;
|
||
var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration);
|
||
if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) {
|
||
return;
|
||
}
|
||
if (getCurrentTarget().hasAttribute("disabled")) {
|
||
return;
|
||
}
|
||
invokeHook("onShow", [instance], false);
|
||
if (instance.props.onShow(instance) === false) {
|
||
return;
|
||
}
|
||
instance.state.isVisible = true;
|
||
if (getIsDefaultRenderFn()) {
|
||
popper2.style.visibility = "visible";
|
||
}
|
||
handleStyles();
|
||
addDocumentPress();
|
||
if (!instance.state.isMounted) {
|
||
popper2.style.transition = "none";
|
||
}
|
||
if (getIsDefaultRenderFn()) {
|
||
var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content = _getDefaultTemplateCh2.content;
|
||
setTransitionDuration([box, content], 0);
|
||
}
|
||
onFirstUpdate = function onFirstUpdate2() {
|
||
var _instance$popperInsta2;
|
||
if (!instance.state.isVisible || ignoreOnFirstUpdate) {
|
||
return;
|
||
}
|
||
ignoreOnFirstUpdate = true;
|
||
void popper2.offsetHeight;
|
||
popper2.style.transition = instance.props.moveTransition;
|
||
if (getIsDefaultRenderFn() && instance.props.animation) {
|
||
var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content;
|
||
setTransitionDuration([_box, _content], duration);
|
||
setVisibilityState([_box, _content], "visible");
|
||
}
|
||
handleAriaContentAttribute();
|
||
handleAriaExpandedAttribute();
|
||
pushIfUnique(mountedInstances, instance);
|
||
(_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate();
|
||
invokeHook("onMount", [instance]);
|
||
if (instance.props.animation && getIsDefaultRenderFn()) {
|
||
onTransitionedIn(duration, function() {
|
||
instance.state.isShown = true;
|
||
invokeHook("onShown", [instance]);
|
||
});
|
||
}
|
||
};
|
||
mount();
|
||
}
|
||
function hide2() {
|
||
var isAlreadyHidden = !instance.state.isVisible;
|
||
var isDestroyed = instance.state.isDestroyed;
|
||
var isDisabled = !instance.state.isEnabled;
|
||
var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration);
|
||
if (isAlreadyHidden || isDestroyed || isDisabled) {
|
||
return;
|
||
}
|
||
invokeHook("onHide", [instance], false);
|
||
if (instance.props.onHide(instance) === false) {
|
||
return;
|
||
}
|
||
instance.state.isVisible = false;
|
||
instance.state.isShown = false;
|
||
ignoreOnFirstUpdate = false;
|
||
isVisibleFromClick = false;
|
||
if (getIsDefaultRenderFn()) {
|
||
popper2.style.visibility = "hidden";
|
||
}
|
||
cleanupInteractiveMouseListeners();
|
||
removeDocumentPress();
|
||
handleStyles(true);
|
||
if (getIsDefaultRenderFn()) {
|
||
var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content = _getDefaultTemplateCh4.content;
|
||
if (instance.props.animation) {
|
||
setTransitionDuration([box, content], duration);
|
||
setVisibilityState([box, content], "hidden");
|
||
}
|
||
}
|
||
handleAriaContentAttribute();
|
||
handleAriaExpandedAttribute();
|
||
if (instance.props.animation) {
|
||
if (getIsDefaultRenderFn()) {
|
||
onTransitionedOut(duration, instance.unmount);
|
||
}
|
||
} else {
|
||
instance.unmount();
|
||
}
|
||
}
|
||
function hideWithInteractivity(event) {
|
||
getDocument().addEventListener("mousemove", debouncedOnMouseMove);
|
||
pushIfUnique(mouseMoveListeners, debouncedOnMouseMove);
|
||
debouncedOnMouseMove(event);
|
||
}
|
||
function unmount() {
|
||
if (instance.state.isVisible) {
|
||
instance.hide();
|
||
}
|
||
if (!instance.state.isMounted) {
|
||
return;
|
||
}
|
||
destroyPopperInstance();
|
||
getNestedPopperTree().forEach(function(nestedPopper) {
|
||
nestedPopper._tippy.unmount();
|
||
});
|
||
if (popper2.parentNode) {
|
||
popper2.parentNode.removeChild(popper2);
|
||
}
|
||
mountedInstances = mountedInstances.filter(function(i) {
|
||
return i !== instance;
|
||
});
|
||
instance.state.isMounted = false;
|
||
invokeHook("onHidden", [instance]);
|
||
}
|
||
function destroy() {
|
||
if (instance.state.isDestroyed) {
|
||
return;
|
||
}
|
||
instance.clearDelayTimeouts();
|
||
instance.unmount();
|
||
removeListeners();
|
||
delete reference2._tippy;
|
||
instance.state.isDestroyed = true;
|
||
invokeHook("onDestroy", [instance]);
|
||
}
|
||
}
|
||
function tippy(targets, optionalProps) {
|
||
if (optionalProps === void 0) {
|
||
optionalProps = {};
|
||
}
|
||
var plugins = defaultProps.plugins.concat(optionalProps.plugins || []);
|
||
bindGlobalEventListeners();
|
||
var passedProps = Object.assign({}, optionalProps, {
|
||
plugins
|
||
});
|
||
var elements = getArrayOfElements(targets);
|
||
var instances = elements.reduce(function(acc, reference2) {
|
||
var instance = reference2 && createTippy(reference2, passedProps);
|
||
if (instance) {
|
||
acc.push(instance);
|
||
}
|
||
return acc;
|
||
}, []);
|
||
return isElement$1(targets) ? instances[0] : instances;
|
||
}
|
||
tippy.defaultProps = defaultProps;
|
||
tippy.setDefaultProps = setDefaultProps;
|
||
tippy.currentInput = currentInput;
|
||
var hideAll = function hideAll2(_temp) {
|
||
var _ref = _temp === void 0 ? {} : _temp, excludedReferenceOrInstance = _ref.exclude, duration = _ref.duration;
|
||
mountedInstances.forEach(function(instance) {
|
||
var isExcluded = false;
|
||
if (excludedReferenceOrInstance) {
|
||
isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper;
|
||
}
|
||
if (!isExcluded) {
|
||
var originalDuration = instance.props.duration;
|
||
instance.setProps({
|
||
duration
|
||
});
|
||
instance.hide();
|
||
if (!instance.state.isDestroyed) {
|
||
instance.setProps({
|
||
duration: originalDuration
|
||
});
|
||
}
|
||
}
|
||
});
|
||
};
|
||
var applyStylesModifier = Object.assign({}, applyStyles$1, {
|
||
effect: function effect2(_ref) {
|
||
var state = _ref.state;
|
||
var initialStyles = {
|
||
popper: {
|
||
position: state.options.strategy,
|
||
left: "0",
|
||
top: "0",
|
||
margin: "0"
|
||
},
|
||
arrow: {
|
||
position: "absolute"
|
||
},
|
||
reference: {}
|
||
};
|
||
Object.assign(state.elements.popper.style, initialStyles.popper);
|
||
state.styles = initialStyles;
|
||
if (state.elements.arrow) {
|
||
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
||
}
|
||
}
|
||
});
|
||
var createSingleton = function createSingleton2(tippyInstances, optionalProps) {
|
||
var _optionalProps$popper;
|
||
if (optionalProps === void 0) {
|
||
optionalProps = {};
|
||
}
|
||
var individualInstances = tippyInstances;
|
||
var references = [];
|
||
var triggerTargets = [];
|
||
var currentTarget;
|
||
var overrides = optionalProps.overrides;
|
||
var interceptSetPropsCleanups = [];
|
||
var shownOnCreate = false;
|
||
function setTriggerTargets() {
|
||
triggerTargets = individualInstances.map(function(instance) {
|
||
return normalizeToArray(instance.props.triggerTarget || instance.reference);
|
||
}).reduce(function(acc, item) {
|
||
return acc.concat(item);
|
||
}, []);
|
||
}
|
||
function setReferences() {
|
||
references = individualInstances.map(function(instance) {
|
||
return instance.reference;
|
||
});
|
||
}
|
||
function enableInstances(isEnabled) {
|
||
individualInstances.forEach(function(instance) {
|
||
if (isEnabled) {
|
||
instance.enable();
|
||
} else {
|
||
instance.disable();
|
||
}
|
||
});
|
||
}
|
||
function interceptSetProps(singleton2) {
|
||
return individualInstances.map(function(instance) {
|
||
var originalSetProps2 = instance.setProps;
|
||
instance.setProps = function(props2) {
|
||
originalSetProps2(props2);
|
||
if (instance.reference === currentTarget) {
|
||
singleton2.setProps(props2);
|
||
}
|
||
};
|
||
return function() {
|
||
instance.setProps = originalSetProps2;
|
||
};
|
||
});
|
||
}
|
||
function prepareInstance(singleton2, target) {
|
||
var index = triggerTargets.indexOf(target);
|
||
if (target === currentTarget) {
|
||
return;
|
||
}
|
||
currentTarget = target;
|
||
var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) {
|
||
acc[prop] = individualInstances[index].props[prop];
|
||
return acc;
|
||
}, {});
|
||
singleton2.setProps(Object.assign({}, overrideProps, {
|
||
getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() {
|
||
var _references$index;
|
||
return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect();
|
||
}
|
||
}));
|
||
}
|
||
enableInstances(false);
|
||
setReferences();
|
||
setTriggerTargets();
|
||
var plugin2 = {
|
||
fn: function fn6() {
|
||
return {
|
||
onDestroy: function onDestroy2() {
|
||
enableInstances(true);
|
||
},
|
||
onHidden: function onHidden2() {
|
||
currentTarget = null;
|
||
},
|
||
onClickOutside: function onClickOutside2(instance) {
|
||
if (instance.props.showOnCreate && !shownOnCreate) {
|
||
shownOnCreate = true;
|
||
currentTarget = null;
|
||
}
|
||
},
|
||
onShow: function onShow2(instance) {
|
||
if (instance.props.showOnCreate && !shownOnCreate) {
|
||
shownOnCreate = true;
|
||
prepareInstance(instance, references[0]);
|
||
}
|
||
},
|
||
onTrigger: function onTrigger2(instance, event) {
|
||
prepareInstance(instance, event.currentTarget);
|
||
}
|
||
};
|
||
}
|
||
};
|
||
var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ["overrides"]), {
|
||
plugins: [plugin2].concat(optionalProps.plugins || []),
|
||
triggerTarget: triggerTargets,
|
||
popperOptions: Object.assign({}, optionalProps.popperOptions, {
|
||
modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier])
|
||
})
|
||
}));
|
||
var originalShow = singleton.show;
|
||
singleton.show = function(target) {
|
||
originalShow();
|
||
if (!currentTarget && target == null) {
|
||
return prepareInstance(singleton, references[0]);
|
||
}
|
||
if (currentTarget && target == null) {
|
||
return;
|
||
}
|
||
if (typeof target === "number") {
|
||
return references[target] && prepareInstance(singleton, references[target]);
|
||
}
|
||
if (individualInstances.indexOf(target) >= 0) {
|
||
var ref2 = target.reference;
|
||
return prepareInstance(singleton, ref2);
|
||
}
|
||
if (references.indexOf(target) >= 0) {
|
||
return prepareInstance(singleton, target);
|
||
}
|
||
};
|
||
singleton.showNext = function() {
|
||
var first = references[0];
|
||
if (!currentTarget) {
|
||
return singleton.show(0);
|
||
}
|
||
var index = references.indexOf(currentTarget);
|
||
singleton.show(references[index + 1] || first);
|
||
};
|
||
singleton.showPrevious = function() {
|
||
var last = references[references.length - 1];
|
||
if (!currentTarget) {
|
||
return singleton.show(last);
|
||
}
|
||
var index = references.indexOf(currentTarget);
|
||
var target = references[index - 1] || last;
|
||
singleton.show(target);
|
||
};
|
||
var originalSetProps = singleton.setProps;
|
||
singleton.setProps = function(props2) {
|
||
overrides = props2.overrides || overrides;
|
||
originalSetProps(props2);
|
||
};
|
||
singleton.setInstances = function(nextInstances) {
|
||
enableInstances(true);
|
||
interceptSetPropsCleanups.forEach(function(fn6) {
|
||
return fn6();
|
||
});
|
||
individualInstances = nextInstances;
|
||
enableInstances(false);
|
||
setReferences();
|
||
setTriggerTargets();
|
||
interceptSetPropsCleanups = interceptSetProps(singleton);
|
||
singleton.setProps({
|
||
triggerTarget: triggerTargets
|
||
});
|
||
};
|
||
interceptSetPropsCleanups = interceptSetProps(singleton);
|
||
return singleton;
|
||
};
|
||
var animateFill = {
|
||
name: "animateFill",
|
||
defaultValue: false,
|
||
fn: function fn2(instance) {
|
||
var _instance$props$rende;
|
||
if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) {
|
||
return {};
|
||
}
|
||
var _getChildren = getChildren(instance.popper), box = _getChildren.box, content = _getChildren.content;
|
||
var backdrop = instance.props.animateFill ? createBackdropElement() : null;
|
||
return {
|
||
onCreate: function onCreate2() {
|
||
if (backdrop) {
|
||
box.insertBefore(backdrop, box.firstElementChild);
|
||
box.setAttribute("data-animatefill", "");
|
||
box.style.overflow = "hidden";
|
||
instance.setProps({
|
||
arrow: false,
|
||
animation: "shift-away"
|
||
});
|
||
}
|
||
},
|
||
onMount: function onMount2() {
|
||
if (backdrop) {
|
||
var transitionDuration = box.style.transitionDuration;
|
||
var duration = Number(transitionDuration.replace("ms", ""));
|
||
content.style.transitionDelay = Math.round(duration / 10) + "ms";
|
||
backdrop.style.transitionDuration = transitionDuration;
|
||
setVisibilityState([backdrop], "visible");
|
||
}
|
||
},
|
||
onShow: function onShow2() {
|
||
if (backdrop) {
|
||
backdrop.style.transitionDuration = "0ms";
|
||
}
|
||
},
|
||
onHide: function onHide2() {
|
||
if (backdrop) {
|
||
setVisibilityState([backdrop], "hidden");
|
||
}
|
||
}
|
||
};
|
||
}
|
||
};
|
||
function createBackdropElement() {
|
||
var backdrop = div();
|
||
backdrop.className = BACKDROP_CLASS;
|
||
setVisibilityState([backdrop], "hidden");
|
||
return backdrop;
|
||
}
|
||
var mouseCoords = {
|
||
clientX: 0,
|
||
clientY: 0
|
||
};
|
||
var activeInstances = [];
|
||
function storeMouseCoords(_ref) {
|
||
var clientX = _ref.clientX, clientY = _ref.clientY;
|
||
mouseCoords = {
|
||
clientX,
|
||
clientY
|
||
};
|
||
}
|
||
function addMouseCoordsListener(doc) {
|
||
doc.addEventListener("mousemove", storeMouseCoords);
|
||
}
|
||
function removeMouseCoordsListener(doc) {
|
||
doc.removeEventListener("mousemove", storeMouseCoords);
|
||
}
|
||
var followCursor = {
|
||
name: "followCursor",
|
||
defaultValue: false,
|
||
fn: function fn3(instance) {
|
||
var reference2 = instance.reference;
|
||
var doc = getOwnerDocument(instance.props.triggerTarget || reference2);
|
||
var isInternalUpdate = false;
|
||
var wasFocusEvent = false;
|
||
var isUnmounted = true;
|
||
var prevProps = instance.props;
|
||
function getIsInitialBehavior() {
|
||
return instance.props.followCursor === "initial" && instance.state.isVisible;
|
||
}
|
||
function addListener() {
|
||
doc.addEventListener("mousemove", onMouseMove);
|
||
}
|
||
function removeListener() {
|
||
doc.removeEventListener("mousemove", onMouseMove);
|
||
}
|
||
function unsetGetReferenceClientRect() {
|
||
isInternalUpdate = true;
|
||
instance.setProps({
|
||
getReferenceClientRect: null
|
||
});
|
||
isInternalUpdate = false;
|
||
}
|
||
function onMouseMove(event) {
|
||
var isCursorOverReference = event.target ? reference2.contains(event.target) : true;
|
||
var followCursor2 = instance.props.followCursor;
|
||
var clientX = event.clientX, clientY = event.clientY;
|
||
var rect = reference2.getBoundingClientRect();
|
||
var relativeX = clientX - rect.left;
|
||
var relativeY = clientY - rect.top;
|
||
if (isCursorOverReference || !instance.props.interactive) {
|
||
instance.setProps({
|
||
// @ts-ignore - unneeded DOMRect properties
|
||
getReferenceClientRect: function getReferenceClientRect() {
|
||
var rect2 = reference2.getBoundingClientRect();
|
||
var x = clientX;
|
||
var y = clientY;
|
||
if (followCursor2 === "initial") {
|
||
x = rect2.left + relativeX;
|
||
y = rect2.top + relativeY;
|
||
}
|
||
var top2 = followCursor2 === "horizontal" ? rect2.top : y;
|
||
var right2 = followCursor2 === "vertical" ? rect2.right : x;
|
||
var bottom2 = followCursor2 === "horizontal" ? rect2.bottom : y;
|
||
var left2 = followCursor2 === "vertical" ? rect2.left : x;
|
||
return {
|
||
width: right2 - left2,
|
||
height: bottom2 - top2,
|
||
top: top2,
|
||
right: right2,
|
||
bottom: bottom2,
|
||
left: left2
|
||
};
|
||
}
|
||
});
|
||
}
|
||
}
|
||
function create() {
|
||
if (instance.props.followCursor) {
|
||
activeInstances.push({
|
||
instance,
|
||
doc
|
||
});
|
||
addMouseCoordsListener(doc);
|
||
}
|
||
}
|
||
function destroy() {
|
||
activeInstances = activeInstances.filter(function(data) {
|
||
return data.instance !== instance;
|
||
});
|
||
if (activeInstances.filter(function(data) {
|
||
return data.doc === doc;
|
||
}).length === 0) {
|
||
removeMouseCoordsListener(doc);
|
||
}
|
||
}
|
||
return {
|
||
onCreate: create,
|
||
onDestroy: destroy,
|
||
onBeforeUpdate: function onBeforeUpdate2() {
|
||
prevProps = instance.props;
|
||
},
|
||
onAfterUpdate: function onAfterUpdate2(_, _ref2) {
|
||
var followCursor2 = _ref2.followCursor;
|
||
if (isInternalUpdate) {
|
||
return;
|
||
}
|
||
if (followCursor2 !== void 0 && prevProps.followCursor !== followCursor2) {
|
||
destroy();
|
||
if (followCursor2) {
|
||
create();
|
||
if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) {
|
||
addListener();
|
||
}
|
||
} else {
|
||
removeListener();
|
||
unsetGetReferenceClientRect();
|
||
}
|
||
}
|
||
},
|
||
onMount: function onMount2() {
|
||
if (instance.props.followCursor && !wasFocusEvent) {
|
||
if (isUnmounted) {
|
||
onMouseMove(mouseCoords);
|
||
isUnmounted = false;
|
||
}
|
||
if (!getIsInitialBehavior()) {
|
||
addListener();
|
||
}
|
||
}
|
||
},
|
||
onTrigger: function onTrigger2(_, event) {
|
||
if (isMouseEvent(event)) {
|
||
mouseCoords = {
|
||
clientX: event.clientX,
|
||
clientY: event.clientY
|
||
};
|
||
}
|
||
wasFocusEvent = event.type === "focus";
|
||
},
|
||
onHidden: function onHidden2() {
|
||
if (instance.props.followCursor) {
|
||
unsetGetReferenceClientRect();
|
||
removeListener();
|
||
isUnmounted = true;
|
||
}
|
||
}
|
||
};
|
||
}
|
||
};
|
||
function getProps(props2, modifier) {
|
||
var _props$popperOptions;
|
||
return {
|
||
popperOptions: Object.assign({}, props2.popperOptions, {
|
||
modifiers: [].concat((((_props$popperOptions = props2.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function(_ref) {
|
||
var name = _ref.name;
|
||
return name !== modifier.name;
|
||
}), [modifier])
|
||
})
|
||
};
|
||
}
|
||
var inlinePositioning = {
|
||
name: "inlinePositioning",
|
||
defaultValue: false,
|
||
fn: function fn4(instance) {
|
||
var reference2 = instance.reference;
|
||
function isEnabled() {
|
||
return !!instance.props.inlinePositioning;
|
||
}
|
||
var placement;
|
||
var cursorRectIndex = -1;
|
||
var isInternalUpdate = false;
|
||
var triedPlacements = [];
|
||
var modifier = {
|
||
name: "tippyInlinePositioning",
|
||
enabled: true,
|
||
phase: "afterWrite",
|
||
fn: function fn6(_ref2) {
|
||
var state = _ref2.state;
|
||
if (isEnabled()) {
|
||
if (triedPlacements.indexOf(state.placement) !== -1) {
|
||
triedPlacements = [];
|
||
}
|
||
if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) {
|
||
triedPlacements.push(state.placement);
|
||
instance.setProps({
|
||
// @ts-ignore - unneeded DOMRect properties
|
||
getReferenceClientRect: function getReferenceClientRect() {
|
||
return _getReferenceClientRect(state.placement);
|
||
}
|
||
});
|
||
}
|
||
placement = state.placement;
|
||
}
|
||
}
|
||
};
|
||
function _getReferenceClientRect(placement2) {
|
||
return getInlineBoundingClientRect(getBasePlacement$1(placement2), reference2.getBoundingClientRect(), arrayFrom(reference2.getClientRects()), cursorRectIndex);
|
||
}
|
||
function setInternalProps(partialProps) {
|
||
isInternalUpdate = true;
|
||
instance.setProps(partialProps);
|
||
isInternalUpdate = false;
|
||
}
|
||
function addModifier() {
|
||
if (!isInternalUpdate) {
|
||
setInternalProps(getProps(instance.props, modifier));
|
||
}
|
||
}
|
||
return {
|
||
onCreate: addModifier,
|
||
onAfterUpdate: addModifier,
|
||
onTrigger: function onTrigger2(_, event) {
|
||
if (isMouseEvent(event)) {
|
||
var rects = arrayFrom(instance.reference.getClientRects());
|
||
var cursorRect = rects.find(function(rect) {
|
||
return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY;
|
||
});
|
||
var index = rects.indexOf(cursorRect);
|
||
cursorRectIndex = index > -1 ? index : cursorRectIndex;
|
||
}
|
||
},
|
||
onHidden: function onHidden2() {
|
||
cursorRectIndex = -1;
|
||
}
|
||
};
|
||
}
|
||
};
|
||
function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) {
|
||
if (clientRects.length < 2 || currentBasePlacement === null) {
|
||
return boundingRect;
|
||
}
|
||
if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) {
|
||
return clientRects[cursorRectIndex] || boundingRect;
|
||
}
|
||
switch (currentBasePlacement) {
|
||
case "top":
|
||
case "bottom": {
|
||
var firstRect = clientRects[0];
|
||
var lastRect = clientRects[clientRects.length - 1];
|
||
var isTop = currentBasePlacement === "top";
|
||
var top2 = firstRect.top;
|
||
var bottom2 = lastRect.bottom;
|
||
var left2 = isTop ? firstRect.left : lastRect.left;
|
||
var right2 = isTop ? firstRect.right : lastRect.right;
|
||
var width = right2 - left2;
|
||
var height = bottom2 - top2;
|
||
return {
|
||
top: top2,
|
||
bottom: bottom2,
|
||
left: left2,
|
||
right: right2,
|
||
width,
|
||
height
|
||
};
|
||
}
|
||
case "left":
|
||
case "right": {
|
||
var minLeft = Math.min.apply(Math, clientRects.map(function(rects) {
|
||
return rects.left;
|
||
}));
|
||
var maxRight = Math.max.apply(Math, clientRects.map(function(rects) {
|
||
return rects.right;
|
||
}));
|
||
var measureRects = clientRects.filter(function(rect) {
|
||
return currentBasePlacement === "left" ? rect.left === minLeft : rect.right === maxRight;
|
||
});
|
||
var _top = measureRects[0].top;
|
||
var _bottom = measureRects[measureRects.length - 1].bottom;
|
||
var _left = minLeft;
|
||
var _right = maxRight;
|
||
var _width = _right - _left;
|
||
var _height = _bottom - _top;
|
||
return {
|
||
top: _top,
|
||
bottom: _bottom,
|
||
left: _left,
|
||
right: _right,
|
||
width: _width,
|
||
height: _height
|
||
};
|
||
}
|
||
default: {
|
||
return boundingRect;
|
||
}
|
||
}
|
||
}
|
||
var sticky = {
|
||
name: "sticky",
|
||
defaultValue: false,
|
||
fn: function fn5(instance) {
|
||
var reference2 = instance.reference, popper2 = instance.popper;
|
||
function getReference() {
|
||
return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference2;
|
||
}
|
||
function shouldCheck(value) {
|
||
return instance.props.sticky === true || instance.props.sticky === value;
|
||
}
|
||
var prevRefRect = null;
|
||
var prevPopRect = null;
|
||
function updatePosition() {
|
||
var currentRefRect = shouldCheck("reference") ? getReference().getBoundingClientRect() : null;
|
||
var currentPopRect = shouldCheck("popper") ? popper2.getBoundingClientRect() : null;
|
||
if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) {
|
||
if (instance.popperInstance) {
|
||
instance.popperInstance.update();
|
||
}
|
||
}
|
||
prevRefRect = currentRefRect;
|
||
prevPopRect = currentPopRect;
|
||
if (instance.state.isMounted) {
|
||
requestAnimationFrame(updatePosition);
|
||
}
|
||
}
|
||
return {
|
||
onMount: function onMount2() {
|
||
if (instance.props.sticky) {
|
||
updatePosition();
|
||
}
|
||
}
|
||
};
|
||
}
|
||
};
|
||
function areRectsDifferent(rectA, rectB) {
|
||
if (rectA && rectB) {
|
||
return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left;
|
||
}
|
||
return true;
|
||
}
|
||
tippy.setDefaultProps({
|
||
render
|
||
});
|
||
tippy.setDefaultProps({
|
||
//@ts-ignore
|
||
onShow: (instance) => {
|
||
if (!instance.props.content)
|
||
return false;
|
||
}
|
||
});
|
||
var isComponentInstance = (value) => {
|
||
return value instanceof Object && "$" in value && "$el" in value;
|
||
};
|
||
function useTippy(el, opts = {}, settings = { mount: true, appName: "Tippy" }) {
|
||
settings = Object.assign({ mount: true, appName: "Tippy" }, settings);
|
||
const vm = getCurrentInstance();
|
||
const instance = ref();
|
||
const state = ref({
|
||
isEnabled: false,
|
||
isVisible: false,
|
||
isDestroyed: false,
|
||
isMounted: false,
|
||
isShown: false
|
||
});
|
||
const headlessApp = shallowRef();
|
||
let container = null;
|
||
const getContainer = () => {
|
||
if (container)
|
||
return container;
|
||
container = document.createDocumentFragment();
|
||
return container;
|
||
};
|
||
const getContent = (content) => {
|
||
let newContent;
|
||
let unwrappedContent = isRef(content) ? content.value : content;
|
||
if (isVNode(unwrappedContent)) {
|
||
if (!headlessApp.value) {
|
||
headlessApp.value = createApp({
|
||
name: settings.appName,
|
||
setup: () => {
|
||
return () => isRef(content) ? content.value : content;
|
||
}
|
||
});
|
||
if (vm) {
|
||
Object.assign(headlessApp.value._context, vm.appContext);
|
||
}
|
||
headlessApp.value.mount(getContainer());
|
||
}
|
||
newContent = () => getContainer();
|
||
} else if (typeof unwrappedContent === "object") {
|
||
if (!headlessApp.value) {
|
||
headlessApp.value = createApp({
|
||
name: settings.appName,
|
||
setup: () => {
|
||
return () => h(isRef(content) ? content.value : content);
|
||
}
|
||
});
|
||
if (vm) {
|
||
Object.assign(headlessApp.value._context, vm.appContext);
|
||
}
|
||
headlessApp.value.mount(getContainer());
|
||
}
|
||
newContent = () => getContainer();
|
||
} else {
|
||
newContent = unwrappedContent;
|
||
}
|
||
return newContent;
|
||
};
|
||
const getProps2 = (opts2) => {
|
||
let options = {};
|
||
if (isRef(opts2)) {
|
||
options = opts2.value || {};
|
||
} else if (isReactive(opts2)) {
|
||
options = { ...opts2 };
|
||
} else {
|
||
options = { ...opts2 };
|
||
}
|
||
if (options.content) {
|
||
options.content = getContent(options.content);
|
||
}
|
||
if (options.triggerTarget) {
|
||
options.triggerTarget = isRef(options.triggerTarget) ? options.triggerTarget.value : options.triggerTarget;
|
||
}
|
||
if (!options.plugins || !Array.isArray(options.plugins)) {
|
||
options.plugins = [];
|
||
}
|
||
options.plugins = options.plugins.filter((plugin2) => plugin2.name !== "vueTippyReactiveState");
|
||
options.plugins.push({
|
||
name: "vueTippyReactiveState",
|
||
fn: () => {
|
||
return {
|
||
onCreate() {
|
||
state.value.isEnabled = true;
|
||
},
|
||
onMount() {
|
||
state.value.isMounted = true;
|
||
},
|
||
onShow() {
|
||
state.value.isMounted = true;
|
||
state.value.isVisible = true;
|
||
},
|
||
onShown() {
|
||
state.value.isShown = true;
|
||
},
|
||
onHide() {
|
||
state.value.isMounted = false;
|
||
state.value.isVisible = false;
|
||
},
|
||
onHidden() {
|
||
state.value.isShown = false;
|
||
},
|
||
onUnmounted() {
|
||
state.value.isMounted = false;
|
||
},
|
||
onDestroy() {
|
||
state.value.isDestroyed = true;
|
||
}
|
||
};
|
||
}
|
||
});
|
||
return options;
|
||
};
|
||
const refresh = () => {
|
||
if (!instance.value)
|
||
return;
|
||
instance.value.setProps(getProps2(opts));
|
||
};
|
||
const refreshContent = () => {
|
||
if (!instance.value || !opts.content)
|
||
return;
|
||
instance.value.setContent(getContent(opts.content));
|
||
};
|
||
const setContent2 = (value) => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.setContent(getContent(value));
|
||
};
|
||
const setProps = (value) => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.setProps(getProps2(value));
|
||
};
|
||
const destroy = () => {
|
||
var _a;
|
||
if (instance.value) {
|
||
instance.value.destroy();
|
||
instance.value = void 0;
|
||
}
|
||
container = null;
|
||
(_a = headlessApp.value) === null || _a === void 0 ? void 0 : _a.unmount();
|
||
headlessApp.value = void 0;
|
||
};
|
||
const show = () => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.show();
|
||
};
|
||
const hide2 = () => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.hide();
|
||
};
|
||
const disable = () => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.disable();
|
||
state.value.isEnabled = false;
|
||
};
|
||
const enable = () => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.enable();
|
||
state.value.isEnabled = true;
|
||
};
|
||
const unmount = () => {
|
||
var _a;
|
||
(_a = instance.value) === null || _a === void 0 ? void 0 : _a.unmount();
|
||
};
|
||
const mount = () => {
|
||
if (!el)
|
||
return;
|
||
let target = isRef(el) ? el.value : el;
|
||
if (typeof target === "function")
|
||
target = target();
|
||
if (isComponentInstance(target)) {
|
||
target = target.$el;
|
||
}
|
||
if (target) {
|
||
instance.value = tippy(target, getProps2(opts));
|
||
target.$tippy = response;
|
||
}
|
||
};
|
||
const response = {
|
||
tippy: instance,
|
||
refresh,
|
||
refreshContent,
|
||
setContent: setContent2,
|
||
setProps,
|
||
destroy,
|
||
hide: hide2,
|
||
show,
|
||
disable,
|
||
enable,
|
||
unmount,
|
||
mount,
|
||
state
|
||
};
|
||
if (settings.mount) {
|
||
if (vm) {
|
||
if (vm.isMounted) {
|
||
mount();
|
||
} else {
|
||
onMounted(mount);
|
||
}
|
||
} else {
|
||
mount();
|
||
}
|
||
}
|
||
if (vm) {
|
||
onUnmounted(() => {
|
||
destroy();
|
||
});
|
||
}
|
||
if (isRef(opts) || isReactive(opts)) {
|
||
watch(opts, refresh, { immediate: false });
|
||
} else if (isRef(opts.content)) {
|
||
watch(opts.content, refreshContent, { immediate: false });
|
||
}
|
||
return response;
|
||
}
|
||
function useTippyComponent(opts = {}, children) {
|
||
const instance = ref();
|
||
return {
|
||
instance,
|
||
TippyComponent: h(TippyComponent, {
|
||
...opts,
|
||
onVnodeMounted: (vnode) => {
|
||
instance.value = vnode.component.ctx;
|
||
}
|
||
}, children)
|
||
};
|
||
}
|
||
function useSingleton(instances, optionalProps) {
|
||
const singleton = ref();
|
||
onMounted(() => {
|
||
const pendingTippyInstances = Array.isArray(instances) ? instances.map((i) => i.value) : typeof instances === "function" ? instances() : instances.value;
|
||
const tippyInstances = pendingTippyInstances.map((instance) => {
|
||
if (instance instanceof Element) {
|
||
return instance._tippy;
|
||
}
|
||
return instance;
|
||
}).filter(Boolean);
|
||
singleton.value = createSingleton(tippyInstances, optionalProps ? { allowHTML: true, ...optionalProps } : { allowHTML: true });
|
||
});
|
||
return {
|
||
singleton
|
||
};
|
||
}
|
||
function toValue(r) {
|
||
return typeof r === "function" ? r() : unref(r);
|
||
}
|
||
function unrefElement(elRef) {
|
||
var _a, _b;
|
||
const plain = toValue(elRef);
|
||
return (_b = (_a = plain) === null || _a === void 0 ? void 0 : _a.$el) !== null && _b !== void 0 ? _b : plain;
|
||
}
|
||
var TippyComponent = defineComponent({
|
||
props: {
|
||
to: {
|
||
type: [String, Function]
|
||
},
|
||
tag: {
|
||
type: [String, Object],
|
||
default: "span"
|
||
},
|
||
contentTag: {
|
||
type: [String, Object],
|
||
default: "span"
|
||
},
|
||
contentClass: {
|
||
type: String,
|
||
default: null
|
||
},
|
||
appendTo: { default: () => tippy.defaultProps["appendTo"] },
|
||
aria: { default: () => tippy.defaultProps["aria"] },
|
||
delay: { default: () => tippy.defaultProps["delay"] },
|
||
duration: { default: () => tippy.defaultProps["duration"] },
|
||
getReferenceClientRect: { default: () => tippy.defaultProps["getReferenceClientRect"] },
|
||
hideOnClick: { type: [Boolean, String], default: () => tippy.defaultProps["hideOnClick"] },
|
||
ignoreAttributes: { type: Boolean, default: () => tippy.defaultProps["ignoreAttributes"] },
|
||
interactive: { type: Boolean, default: () => tippy.defaultProps["interactive"] },
|
||
interactiveBorder: { default: () => tippy.defaultProps["interactiveBorder"] },
|
||
interactiveDebounce: { default: () => tippy.defaultProps["interactiveDebounce"] },
|
||
moveTransition: { default: () => tippy.defaultProps["moveTransition"] },
|
||
offset: { default: () => tippy.defaultProps["offset"] },
|
||
onAfterUpdate: { default: () => tippy.defaultProps["onAfterUpdate"] },
|
||
onBeforeUpdate: { default: () => tippy.defaultProps["onBeforeUpdate"] },
|
||
onCreate: { default: () => tippy.defaultProps["onCreate"] },
|
||
onDestroy: { default: () => tippy.defaultProps["onDestroy"] },
|
||
onHidden: { default: () => tippy.defaultProps["onHidden"] },
|
||
onHide: { default: () => tippy.defaultProps["onHide"] },
|
||
onMount: { default: () => tippy.defaultProps["onMount"] },
|
||
onShow: { default: () => tippy.defaultProps["onShow"] },
|
||
onShown: { default: () => tippy.defaultProps["onShown"] },
|
||
onTrigger: { default: () => tippy.defaultProps["onTrigger"] },
|
||
onUntrigger: { default: () => tippy.defaultProps["onUntrigger"] },
|
||
onClickOutside: { default: () => tippy.defaultProps["onClickOutside"] },
|
||
placement: { default: () => tippy.defaultProps["placement"] },
|
||
plugins: { default: () => tippy.defaultProps["plugins"] },
|
||
popperOptions: { default: () => tippy.defaultProps["popperOptions"] },
|
||
render: { default: () => tippy.defaultProps["render"] },
|
||
showOnCreate: { type: Boolean, default: () => tippy.defaultProps["showOnCreate"] },
|
||
touch: { type: [Boolean, String, Array], default: () => tippy.defaultProps["touch"] },
|
||
trigger: { default: () => tippy.defaultProps["trigger"] },
|
||
triggerTarget: { default: () => tippy.defaultProps["triggerTarget"] },
|
||
animateFill: { type: Boolean, default: () => tippy.defaultProps["animateFill"] },
|
||
followCursor: { type: [Boolean, String], default: () => tippy.defaultProps["followCursor"] },
|
||
inlinePositioning: { type: Boolean, default: () => tippy.defaultProps["inlinePositioning"] },
|
||
sticky: { type: [Boolean, String], default: () => tippy.defaultProps["sticky"] },
|
||
allowHTML: { type: Boolean, default: () => tippy.defaultProps["allowHTML"] },
|
||
animation: { default: () => tippy.defaultProps["animation"] },
|
||
arrow: { default: () => tippy.defaultProps["arrow"] },
|
||
content: { default: () => tippy.defaultProps["content"] },
|
||
inertia: { default: () => tippy.defaultProps["inertia"] },
|
||
maxWidth: { default: () => tippy.defaultProps["maxWidth"] },
|
||
role: { default: () => tippy.defaultProps["role"] },
|
||
theme: { default: () => tippy.defaultProps["theme"] },
|
||
zIndex: { default: () => tippy.defaultProps["zIndex"] }
|
||
},
|
||
emits: ["state"],
|
||
setup(props2, { slots, emit, expose }) {
|
||
const elem = ref();
|
||
const findParentHelper = ref();
|
||
const contentElem = ref();
|
||
const mounted = ref(false);
|
||
const getOptions = () => {
|
||
let options = { ...props2 };
|
||
for (const prop of ["to", "tag", "contentTag", "contentClass"]) {
|
||
if (options.hasOwnProperty(prop)) {
|
||
delete options[prop];
|
||
}
|
||
}
|
||
return options;
|
||
};
|
||
let target = () => unrefElement(elem);
|
||
if (props2.to) {
|
||
if (typeof Element !== "undefined" && props2.to instanceof Element) {
|
||
target = () => props2.to;
|
||
} else if (props2.to === "parent") {
|
||
target = () => {
|
||
let el = elem.value;
|
||
if (!el) {
|
||
el = elem.value = findParentHelper.value.parentElement;
|
||
}
|
||
return el;
|
||
};
|
||
} else if (typeof props2.to === "string" || props2.to instanceof String) {
|
||
target = () => document.querySelector(props2.to);
|
||
}
|
||
}
|
||
const tippy2 = useTippy(target, getOptions());
|
||
let contentSlot = slots.content;
|
||
if (!contentSlot && props2.to === "parent") {
|
||
contentSlot = slots.default;
|
||
}
|
||
onMounted(() => {
|
||
mounted.value = true;
|
||
nextTick(() => {
|
||
if (contentSlot)
|
||
tippy2.setContent(() => contentElem.value);
|
||
});
|
||
});
|
||
watch(tippy2.state, () => {
|
||
emit("state", unref(tippy2.state));
|
||
}, { immediate: true, deep: true });
|
||
watch(() => props2, () => {
|
||
tippy2.setProps(getOptions());
|
||
if (contentSlot)
|
||
tippy2.setContent(() => contentElem.value);
|
||
}, { deep: true });
|
||
let exposed = reactive({
|
||
elem,
|
||
contentElem,
|
||
mounted,
|
||
...tippy2
|
||
});
|
||
expose(exposed);
|
||
return () => {
|
||
const contentTag = typeof props2.contentTag === "string" ? props2.contentTag : props2.contentTag;
|
||
const content = contentSlot ? h(contentTag, {
|
||
ref: contentElem,
|
||
style: { display: mounted.value ? "inherit" : "none" },
|
||
class: props2.contentClass
|
||
}, contentSlot(exposed)) : null;
|
||
if (props2.to === "parent") {
|
||
const result = [];
|
||
if (!elem.value) {
|
||
const findParentHelperNode = h("span", {
|
||
ref: findParentHelper,
|
||
"data-v-tippy": "",
|
||
style: { display: "none" }
|
||
});
|
||
result.push(findParentHelperNode);
|
||
}
|
||
if (content) {
|
||
result.push(content);
|
||
}
|
||
return result;
|
||
}
|
||
const slot = slots.default ? slots.default(exposed) : [];
|
||
if (!props2.tag) {
|
||
const trigger = h(slot[0], {
|
||
ref: elem,
|
||
"data-v-tippy": ""
|
||
});
|
||
return content ? [trigger, content] : trigger;
|
||
}
|
||
const tag = typeof props2.tag === "string" ? props2.tag : props2.tag;
|
||
return h(tag, { ref: elem, "data-v-tippy": "" }, content ? [slot, content] : slot);
|
||
};
|
||
}
|
||
});
|
||
var booleanProps = [
|
||
"a11y",
|
||
"allowHTML",
|
||
"arrow",
|
||
"flip",
|
||
"flipOnUpdate",
|
||
"hideOnClick",
|
||
"ignoreAttributes",
|
||
"inertia",
|
||
"interactive",
|
||
"lazy",
|
||
"multiple",
|
||
"showOnInit",
|
||
"touch",
|
||
"touchHold"
|
||
];
|
||
var props = {};
|
||
Object.keys(tippy.defaultProps).forEach((prop) => {
|
||
if (booleanProps.includes(prop)) {
|
||
props[prop] = {
|
||
type: Boolean,
|
||
default: function() {
|
||
return tippy.defaultProps[prop];
|
||
}
|
||
};
|
||
} else {
|
||
props[prop] = {
|
||
default: function() {
|
||
return tippy.defaultProps[prop];
|
||
}
|
||
};
|
||
}
|
||
});
|
||
var TippySingleton = defineComponent({
|
||
props,
|
||
setup(props2) {
|
||
const instances = ref([]);
|
||
const { singleton } = useSingleton(instances, props2);
|
||
return { instances, singleton };
|
||
},
|
||
mounted() {
|
||
var _a;
|
||
const parent = this.$el.parentElement;
|
||
const elements = parent.querySelectorAll("[data-v-tippy]");
|
||
this.instances = Array.from(elements).map((el) => el._tippy).filter(Boolean);
|
||
(_a = this.singleton) === null || _a === void 0 ? void 0 : _a.setInstances(this.instances);
|
||
},
|
||
render() {
|
||
let slot = this.$slots.default ? this.$slots.default() : [];
|
||
return h(() => slot);
|
||
}
|
||
});
|
||
var directive = {
|
||
mounted(el, binding, vnode) {
|
||
const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
|
||
const modifiers = Object.keys(binding.modifiers || {});
|
||
const placement = modifiers.find((modifier) => modifier !== "arrow");
|
||
const withArrow = modifiers.findIndex((modifier) => modifier === "arrow") !== -1;
|
||
if (placement) {
|
||
opts.placement = opts.placement || placement;
|
||
}
|
||
if (withArrow) {
|
||
opts.arrow = opts.arrow !== void 0 ? opts.arrow : true;
|
||
}
|
||
if (vnode.props && vnode.props.onTippyShow) {
|
||
opts.onShow = function(...args) {
|
||
var _a;
|
||
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShow(...args);
|
||
};
|
||
}
|
||
if (vnode.props && vnode.props.onTippyShown) {
|
||
opts.onShown = function(...args) {
|
||
var _a;
|
||
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyShown(...args);
|
||
};
|
||
}
|
||
if (vnode.props && vnode.props.onTippyHidden) {
|
||
opts.onHidden = function(...args) {
|
||
var _a;
|
||
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHidden(...args);
|
||
};
|
||
}
|
||
if (vnode.props && vnode.props.onTippyHide) {
|
||
opts.onHide = function(...args) {
|
||
var _a;
|
||
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyHide(...args);
|
||
};
|
||
}
|
||
if (vnode.props && vnode.props.onTippyMount) {
|
||
opts.onMount = function(...args) {
|
||
var _a;
|
||
return (_a = vnode.props) === null || _a === void 0 ? void 0 : _a.onTippyMount(...args);
|
||
};
|
||
}
|
||
if (el.getAttribute("title") && !opts.content) {
|
||
opts.content = el.getAttribute("title");
|
||
el.removeAttribute("title");
|
||
}
|
||
if (el.getAttribute("content") && !opts.content) {
|
||
opts.content = el.getAttribute("content");
|
||
}
|
||
useTippy(el, opts);
|
||
},
|
||
unmounted(el) {
|
||
if (el.$tippy) {
|
||
el.$tippy.destroy();
|
||
} else if (el._tippy) {
|
||
el._tippy.destroy();
|
||
}
|
||
},
|
||
updated(el, binding) {
|
||
const opts = typeof binding.value === "string" ? { content: binding.value } : binding.value || {};
|
||
if (!opts.content) {
|
||
opts.content = null;
|
||
}
|
||
if (el.getAttribute("title") && !opts.content) {
|
||
opts.content = el.getAttribute("title");
|
||
el.removeAttribute("title");
|
||
}
|
||
if (el.getAttribute("content") && !opts.content) {
|
||
opts.content = el.getAttribute("content");
|
||
}
|
||
if (el.$tippy) {
|
||
el.$tippy.setProps(opts || {});
|
||
} else if (el._tippy) {
|
||
el._tippy.setProps(opts || {});
|
||
}
|
||
}
|
||
};
|
||
var plugin = {
|
||
install(app, options = {}) {
|
||
tippy.setDefaultProps(options.defaultProps || {});
|
||
app.directive(options.directive || "tippy", directive);
|
||
app.component(options.component || "tippy", TippyComponent);
|
||
app.component(options.componentSingleton || "tippy-singleton", TippySingleton);
|
||
}
|
||
};
|
||
var setDefaultProps$1 = tippy.setDefaultProps;
|
||
setDefaultProps$1({
|
||
ignoreAttributes: true,
|
||
plugins: [sticky, inlinePositioning, followCursor, animateFill]
|
||
});
|
||
var vue_tippy_esm_browser_default = plugin;
|
||
export {
|
||
TippyComponent as Tippy,
|
||
TippySingleton,
|
||
vue_tippy_esm_browser_default as default,
|
||
directive,
|
||
hideAll,
|
||
plugin,
|
||
ROUND_ARROW as roundArrow,
|
||
setDefaultProps$1 as setDefaultProps,
|
||
tippy,
|
||
useSingleton,
|
||
useTippy,
|
||
useTippyComponent
|
||
};
|
||
//# sourceMappingURL=vue-tippy.js.map
|