help-layer 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ja.md +62 -3
- package/README.md +65 -3
- package/dist/help-layer.esm.js +3 -3
- package/dist/help-layer.esm.js.map +4 -4
- package/dist/help-layer.iife.js +3 -3
- package/dist/help-layer.iife.js.map +4 -4
- package/dist/types/aria-isolation.d.ts +10 -0
- package/dist/types/floating.d.ts +9 -1
- package/dist/types/markers.d.ts +4 -1
- package/package.json +5 -4
- package/src/aria-isolation.js +67 -0
- package/src/dom-builder.js +12 -3
- package/src/floating.js +44 -1
- package/src/markers.js +14 -2
- package/src/toggle.js +19 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/index.js", "../src/dom-builder.js", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs", "../node_modules/@floating-ui/core/dist/floating-ui.core.mjs", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs", "../src/geometry.js", "../src/floating.js", "../src/blocking-layer.js", "../src/config.js", "../src/overlap.js", "../src/markers.js", "../src/safe.js", "../src/observer.js", "../src/matcher.js", "../src/popup.js", "../src/state.js", "../src/style.js", "../src/toggle.js"],
|
|
4
|
-
"sourcesContent": ["import { createToggleController } from './toggle.js';\n\n/**\n * Initialize the help mode.\n *\n * It can be toggled ON/OFF by clicking the toggle element, and also controlled programmatically\n * via the returned API. If `toggle` is omitted, there's no DOM toggle and it's programmatic-only.\n *\n * @param {object} options\n * @param {import('./config.js').HelpConfig} options.config - configuration that specifies targets by data-help-id or position.\n * Elements not in config can still be targets via the data-help-title / data-help-text inline definition (config wins)\n * @param {string|HTMLElement} [options.toggle] - toggle element that switches ON/OFF (CSS selector string or element). Optional\n * @param {() => void} [options.onEnable] - called right after the mode is turned ON\n * @param {() => void} [options.onDisable] - called right after the mode is turned OFF\n * @param {(record: import('./matcher.js').HelpRecord) => void} [options.onOpen] - called when a description popup is opened\n * @param {() => void} [options.onClose] - called when a description popup is closed\n * @param {boolean} [options.silent] - suppress the warning log for unregistered keys\n * @param {string} [options.attribute] - attribute name marking targets (default 'data-help-id')\n * @param {(record: import('./matcher.js').HelpRecord) => (Node|null|undefined)} [options.render] - render the popup body with your own DOM.\n * Return a Node to display it; if nothing is returned, fall back to safe text display (the title is always record.title).\n * \u26A0\uFE0F The return value is inserted as-is without sanitization. If it contains untrusted data, neutralize it on the caller side (XSS prevention)\n * @param {string} [options.markerLabel] - character shown on the marker (default '?')\n * @param {import('@floating-ui/dom').Placement} [options.markerPlacement] - corner to overlap the marker onto (default 'top-end')\n * @param {import('@floating-ui/dom').Placement} [options.popupPlacement] - initial popup placement (default 'bottom-start')\n * @param {string} [options.nonce] - nonce to allow the injected <style> under a strict CSP (style-src 'nonce-\u2026')\n * @returns {{\n * enable(): void,\n * disable(): void,\n * toggle(): void,\n * isActive(): boolean,\n * open(key: string): void,\n * close(): void,\n * update(config: import('./config.js').HelpConfig): void,\n * destroy(): void,\n * }} a handle to control the mode and fully clean up at the end.\n * open(key) opens the description for the given key (auto-enables when OFF). close() closes the open description.\n */\nexport function initHelpLayer(options) {\n return createToggleController(options);\n}\n", "/**\n * Factory functions that create the DOM elements for markers, popups, and the blocking layer.\n * Event wiring and positioning are not done here (that is the caller's responsibility).\n *\n * Accessibility:\n * - Markers are <button> elements so they are focusable and can be activated with Enter/Space.\n * - The popup uses role=\"dialog\" + aria-labelledby (the title element) to describe itself to assistive tech.\n */\n\nconst POPUP_TITLE_ID = 'help-layer-popup-title';\n\nexport function createBlockingLayer() {\n const layer = document.createElement('div');\n layer.className = 'help-layer-blocking-layer';\n return layer;\n}\n\n/**\n * @param {string} title description title used for the assistive-tech label\n * @param {string} [label] character shown on the marker (default '?'). Visual only; does not affect the aria-label.\n */\nexport function createMarker(title, label = '?') {\n const marker = document.createElement('button');\n marker.type = 'button';\n marker.className = 'help-layer-marker';\n marker.textContent = label;\n marker.setAttribute('aria-label', `Help: ${title}`);\n return marker;\n}\n\n/**\n * Create the single popup shared across the whole library.\n * Also returns references to titleEl/textEl (used to update the content) and the close button closeEl.\n */\nexport function createPopup() {\n const root = document.createElement('div');\n root.className = 'help-layer-popup';\n root.setAttribute('role', 'dialog');\n root.setAttribute('aria-labelledby', POPUP_TITLE_ID);\n root.tabIndex = -1;\n\n const titleEl = document.createElement('div');\n titleEl.className = 'help-layer-popup__title';\n titleEl.id = POPUP_TITLE_ID;\n\n const textEl = document.createElement('div');\n textEl.className = 'help-layer-popup__text';\n\n // Explicit close affordance. Wiring the click is popup.js's job (only element creation here).\n const closeEl = document.createElement('button');\n closeEl.type = 'button';\n closeEl.className = 'help-layer-popup__close';\n closeEl.textContent = '\u00D7';\n closeEl.setAttribute('aria-label', 'Close');\n\n root.append(titleEl, textEl, closeEl);\n\n return { root, titleEl, textEl, closeEl };\n}\n", "/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n", "import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n", "function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n", "import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n", "/**\n * Pure geometry calculations. Takes no DOM elements, only numbers already read off.\n *\n * Clamping things that overflow the viewport is handled by Floating UI's shift()\n * middleware. toDocumentPosition is used for the virtual-element math of free placement, etc.\n */\n\n/**\n * Given getBoundingClientRect() values (viewport-relative) and the scroll offset,\n * compute coordinates relative to the whole document.\n */\nexport function toDocumentPosition(rect, scroll) {\n return {\n top: rect.top + scroll.y,\n left: rect.left + scroll.x,\n };\n}\n\n/**\n * Convert a document-coordinate rect into a viewport-coordinate rect by subtracting\n * the current scroll offset. This is what the getBoundingClientRect of a Floating UI\n * virtual reference element (a free-placement marker) returns.\n * @param {{top:number,left:number,width?:number,height?:number}} docRect\n * @param {{x:number,y:number}} scroll\n */\nexport function docRectToViewportRect(docRect, scroll) {\n const width = docRect.width || 0;\n const height = docRect.height || 0;\n const left = docRect.left - scroll.x;\n const top = docRect.top - scroll.y;\n return {\n x: left,\n y: top,\n left,\n top,\n right: left + width,\n bottom: top + height,\n width,\n height,\n };\n}\n", "/**\n * A thin wrapper around Floating UI (@floating-ui/dom).\n * Use of Floating UI is confined to this one file; other modules only call the\n * purpose-specific functions (anchorMarker / anchorPopup / watchReference /\n * makeVirtualElement). That way, if Floating UI is ever swapped out, the blast\n * radius stays limited to here.\n *\n * Floating UI in a nutshell (note for readers unfamiliar with the DOM):\n * - computePosition(reference, floating, options) computes the optimal placement\n * coordinates (x,y) for \"this exact moment\" and returns them (one-shot).\n * - autoUpdate(reference, floating, update) watches scroll, resize, and element-size\n * changes (internally using ResizeObserver, etc.) and calls update on every change.\n * Calling the returned cleanup stops watching. This is what makes the element \"stick\"\n * to its target.\n */\nimport { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';\n\nimport { docRectToViewportRect } from './geometry.js';\n\n/**\n * Create a \"virtual reference element\" for free-placement items not bound to an element.\n * When getDocRect() returns document coordinates, this converts them to viewport\n * coordinates according to the current scroll. Because autoUpdate re-evaluates on every\n * scroll, the element sticks to the given coordinate while scrolling along with the page.\n * @param {() => {top:number,left:number,width?:number,height?:number}} getDocRect\n */\nexport function makeVirtualElement(getDocRect) {\n return {\n // Tell autoUpdate that this element's ancestor is body (= scroll is watched up to window).\n // Without this the virtual element isn't scroll-watched and won't follow page scroll.\n contextElement: document.body,\n getBoundingClientRect() {\n return docRectToViewportRect(getDocRect(), { x: window.scrollX, y: window.scrollY });\n },\n };\n}\n\nfunction place(el, x, y) {\n el.style.left = `${x}px`;\n el.style.top = `${y}px`;\n}\n\n/**\n * Whether the reference lives in a `position: fixed` subtree. Such a reference stays put in the\n * viewport while the page scrolls, so an absolutely-positioned floating element (which scrolls with\n * the document) would have to be re-corrected every frame and visibly jitters. For these we switch the\n * floating element to Floating UI's `fixed` strategy (and position:fixed) so both live in the same\n * viewport space and stay glued without per-frame correction.\n *\n * Virtual elements (free placements) aren't in the DOM and already track scroll via their getRect, so\n * they report false. Walks across shadow boundaries via the host so Shadow DOM targets are handled too.\n * @param {Element|object} reference\n */\nexport function isFixedReference(reference) {\n if (!(reference instanceof Element)) {\n return false;\n }\n let node = reference;\n while (node) {\n if (getComputedStyle(node).position === 'fixed') {\n return true;\n }\n const parent = node.parentElement;\n if (parent) {\n node = parent;\n } else {\n const root = node.getRootNode();\n node = root instanceof ShadowRoot ? root.host : null;\n }\n }\n return false;\n}\n\n// Half of the default marker size (22px). The amount used to overlap the marker onto the\n// target's corner with an \"inset\". (If the marker-size CSS variable is changed, the resulting\n// drift is left as existing behavior = not compensated for here.)\nconst MARKER_INSET = 11;\n\n/**\n * Derive the offset for overlapping the marker onto the target's corner from the placement.\n * mainAxis is always negative (bites inward past the target's edge). crossAxis flips sign by\n * alignment direction: `-end` (right/bottom-aligned) is negative to go inward, `-start`\n * (left/top-aligned) is positive to go inward.\n * @param {string} placement\n */\nfunction markerOffset(placement) {\n const isStart = placement.endsWith('-start');\n return { mainAxis: -MARKER_INSET, crossAxis: isStart ? MARKER_INSET : -MARKER_INSET };\n}\n\n/**\n * Overlap the marker onto a corner of the target (element or virtual element), stick it there, and keep it following.\n * @param {Element|object} reference\n * @param {HTMLElement} markerEl\n * @param {() => void} [onPlaced] called every time placement is finalized (used to trigger the overlap-avoidance pass, etc.)\n * @param {import('@floating-ui/dom').Placement} [placement] corner to overlap (top-end/top-start/bottom-end/bottom-start). Default 'top-end'\n * @returns {() => void} cleanup\n */\nexport function anchorMarker(reference, markerEl, onPlaced, placement = 'top-end') {\n // Match the floating element's strategy to the reference: a fixed reference needs a fixed marker, or\n // it jitters while scrolling (see isFixedReference). Inline !important beats the stylesheet's\n // `position: absolute !important`.\n const strategy = isFixedReference(reference) ? 'fixed' : 'absolute';\n if (strategy === 'fixed') {\n markerEl.style.setProperty('position', 'fixed', 'important');\n }\n const update = () => {\n computePosition(reference, markerEl, {\n placement,\n strategy,\n middleware: [offset(markerOffset(placement))],\n }).then(({ x, y }) => {\n place(markerEl, x, y);\n if (onPlaced) {\n onPlaced();\n }\n // Swallow silently: this runs every animation frame, so logging would flood the console, and a\n // stray rejection must not surface in the host app's unhandledrejection handler (e.g. Sentry).\n }).catch(() => {});\n };\n // animationFrame: true syncs repositioning to the rAF loop. With the default (scroll/resize\n // events only), computePosition resolves asynchronously, so left/top is written the frame after\n // the browser already painted the scroll \u2014 the marker lags a frame and visibly jitters.\n return autoUpdate(reference, markerEl, update, { animationFrame: true });\n}\n\n/**\n * Place the popup below the target, and at screen edges use flip (flip to the opposite side) /\n * shift (nudge) to avoid clipping. Only follows while visible.\n * @param {Element|object} reference\n * @param {HTMLElement} popupEl\n * @param {import('@floating-ui/dom').Placement} [placement] initial placement (Floating UI placement). Default 'bottom-start'\n * @returns {{ update: () => void, cleanup: () => void }}\n * calling update repositions immediately (used for reference-side transform moves that autoUpdate doesn't pick up, etc.).\n */\nexport function anchorPopup(reference, popupEl, placement = 'bottom-start') {\n // The reference is the clicked marker. If it's fixed (anchored to a fixed target), the popup must be\n // fixed too or it jitters on scroll. Set position every open so reopening on a normal marker restores\n // absolute. Inline !important beats the stylesheet's `position: absolute !important`.\n const strategy = isFixedReference(reference) ? 'fixed' : 'absolute';\n popupEl.style.setProperty('position', strategy, 'important');\n const update = () => {\n computePosition(reference, popupEl, {\n placement,\n strategy,\n middleware: [offset(8), flip({ padding: 8 }), shift({ padding: 8 })],\n }).then(({ x, y }) => {\n place(popupEl, x, y);\n // Same rationale as anchorMarker: swallow per-frame rejections so they don't reach the host.\n }).catch(() => {});\n };\n // animationFrame: true for the same smooth-tracking reason as anchorMarker. The reference here is\n // the marker element, which itself moves per frame, so the popup must track per frame to stay glued.\n const cleanup = autoUpdate(reference, popupEl, update, { animationFrame: true });\n return { update, cleanup };\n}\n\n/**\n * Watch a reference element's position/size changes and call onUpdate on every change.\n * (Used for non-placement purposes, e.g. keeping the blocking layer's clip-path hole following the toggle position.)\n * autoUpdate requires a floating element, so floatingEl is just passed as a dummy that\n * onUpdate doesn't actually position.\n * @param {Element} referenceEl\n * @param {HTMLElement} floatingEl\n * @param {() => void} onUpdate\n * @returns {() => void} cleanup\n */\nexport function watchReference(referenceEl, floatingEl, onUpdate) {\n return autoUpdate(referenceEl, floatingEl, onUpdate);\n}\n", "/**\n * Transparent interaction-blocking layer.\n *\n * Without touching the original app's event listeners at all, it keeps interactions from getting through. How it works:\n *\n * 1. Let the toggle show through via a clip-path \"hole\":\n * Set a clip-path polygon on the full-screen layer made of the outer rectangle + the toggle\n * rectangle (the hole). Inside the hole the layer isn't painted and hit-testing passes through,\n * so the toggle can be clicked natively without touching z-index at all. Unlike approaches that\n * shuffle z-index, this doesn't break depending on ancestor stacking contexts.\n * The hole is updated via autoUpdate to follow the toggle's scroll/resize.\n *\n * 2. Focus containment:\n * On ON, blur activeElement, and via focusin (capture) detect focus moving to anything other\n * than the library UI and pull it back to the toggle. Host listeners are not detached.\n *\n * 3. Key-input suppression:\n * Capture keydown/keyup in document's capture phase; for anything outside the library UI,\n * stopPropagation+preventDefault. Escape has dedicated handling (close popup / exit mode).\n * Inside the library UI (marker/popup/toggle), normal interactions like Tab are allowed.\n */\nimport { createBlockingLayer } from './dom-builder.js';\nimport { watchReference } from './floating.js';\n\nfunction buildClipPath(rect) {\n const x1 = rect.left;\n const y1 = rect.top;\n const x2 = rect.right;\n const y2 = rect.bottom;\n // A single stroke: outer ring (clockwise) -> bridge -> toggle rectangle (counter-clockwise).\n // Under the nonzero winding rule, making the inner ring wind opposite to the outer one punches a hole.\n return `polygon(\n 0px 0px, 100% 0px, 100% 100%, 0px 100%, 0px 0px,\n ${x1}px ${y1}px, ${x1}px ${y2}px, ${x2}px ${y2}px, ${x2}px ${y1}px, ${x1}px ${y1}px\n )`;\n}\n\nexport function activateBlockingLayer(state, {\n toggleEl,\n onBackgroundClick,\n isLibraryElement,\n onEscape,\n}) {\n const layer = createBlockingLayer();\n document.body.appendChild(layer);\n state.track(() => layer.remove());\n\n // --- 1. Keep the clip-path hole following the toggle position ---\n // If there's no toggle element (programmatic control only), keeping the whole surface blocked with no hole is correct.\n if (toggleEl) {\n const updateClip = () => {\n layer.style.clipPath = buildClipPath(toggleEl.getBoundingClientRect());\n };\n const cleanupClipWatch = watchReference(toggleEl, layer, updateClip);\n state.track(cleanupClipWatch);\n }\n\n // Clicking the background (the layer itself) closes the popup\n if (onBackgroundClick) {\n layer.addEventListener('click', onBackgroundClick);\n state.track(() => layer.removeEventListener('click', onBackgroundClick));\n }\n\n // --- 2. Focus containment ---\n // Turning ON happens via a click on the toggle, so don't blur if the active element is the toggle\n // itself (blurring would leave focus floating). For any other host element, make it let go.\n const activeEl = document.activeElement;\n if (\n activeEl instanceof HTMLElement &&\n activeEl !== document.body &&\n activeEl !== toggleEl\n ) {\n activeEl.blur();\n }\n\n const handleFocusIn = (event) => {\n if (isLibraryElement(event.target)) {\n return;\n }\n // If focus tries to move to a host element, take it back.\n // To the toggle if there is one; otherwise blur that element so it isn't handed to the host.\n event.stopPropagation();\n if (toggleEl) {\n toggleEl.focus({ preventScroll: true });\n } else if (event.target instanceof HTMLElement) {\n event.target.blur();\n }\n };\n document.addEventListener('focusin', handleFocusIn, true);\n state.track(() => document.removeEventListener('focusin', handleFocusIn, true));\n\n // --- 3. Key-input suppression + Escape ---\n // Shared logic that doesn't pass key input destined outside the library UI through to the host.\n const blockNonLibrary = (event) => {\n if (isLibraryElement(event.target)) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n };\n // keyup / keypress: don't leak to the host, Escape included (Escape's real handling is on the keydown side).\n const blockKey = (event) => {\n if (event.key === 'Escape') {\n event.stopPropagation();\n event.preventDefault();\n return;\n }\n blockNonLibrary(event);\n };\n const handleKeydown = (event) => {\n if (event.key === 'Escape') {\n event.stopPropagation();\n event.preventDefault();\n if (onEscape) {\n onEscape();\n }\n return;\n }\n blockNonLibrary(event);\n };\n document.addEventListener('keydown', handleKeydown, true);\n document.addEventListener('keyup', blockKey, true);\n document.addEventListener('keypress', blockKey, true);\n state.track(() => {\n document.removeEventListener('keydown', handleKeydown, true);\n document.removeEventListener('keyup', blockKey, true);\n document.removeEventListener('keypress', blockKey, true);\n });\n\n return layer;\n}\n", "/**\n * Validation and normalization of the helpConfig object. A pure function that does no DOM work.\n */\n\n/**\n * @typedef {object} HelpEntry\n * @property {string} title heading shown on the marker / popup (non-empty)\n * @property {string} text description body (non-empty)\n * @property {{ top: number, left: number }} [position] if given, becomes a free placement not tied to an element\n */\n\n/**\n * The helpConfig itself. For element-bound entries the key is the `data-help-id` value;\n * for free placement it is any identifier.\n * @typedef {Object<string, HelpEntry>} HelpConfig\n */\n\nexport function isPlainObject(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isValidPosition(position) {\n // Number.isFinite rejects NaN / Infinity / non-numbers, so a computed coordinate that became NaN\n // fails validation here instead of silently pinning the marker to 0,0 at render time.\n return (\n isPlainObject(position) &&\n Number.isFinite(position.top) &&\n Number.isFinite(position.left)\n );\n}\n\n/**\n * Validate the shape of helpConfig. Throws an Error on any problem (fail fast).\n */\nexport function validateConfig(config) {\n if (!isPlainObject(config)) {\n throw new Error('helpConfig must be a plain object');\n }\n\n for (const [key, entry] of Object.entries(config)) {\n if (!isPlainObject(entry)) {\n throw new Error(`helpConfig[\"${key}\"] must be an object`);\n }\n if (typeof entry.title !== 'string' || entry.title === '') {\n throw new Error(`helpConfig[\"${key}\"].title must be a non-empty string`);\n }\n if (typeof entry.text !== 'string' || entry.text === '') {\n throw new Error(`helpConfig[\"${key}\"].text must be a non-empty string`);\n }\n if (entry.position !== undefined && !isValidPosition(entry.position)) {\n throw new Error(`helpConfig[\"${key}\"].position must be { top: finite number, left: finite number }`);\n }\n }\n}\n\n/**\n * Convert a validated helpConfig into the shared array of \"help items\" the rendering\n * code works with. The target of kind:'element' is null at this point (DOM matching is\n * left to matcher.js).\n */\nexport function normalizeConfig(config) {\n return Object.entries(config).map(([key, entry]) => {\n if (isValidPosition(entry.position)) {\n return {\n key,\n title: entry.title,\n text: entry.text,\n kind: 'free',\n target: null,\n position: { top: entry.position.top, left: entry.position.left },\n };\n }\n\n return {\n key,\n title: entry.title,\n text: entry.text,\n kind: 'element',\n target: null,\n position: null,\n };\n });\n}\n", "/**\n * Overlap avoidance between markers (pure function).\n *\n * Takes an array of each marker's \"base position\" (the center coordinate Floating UI\n * decided on) and returns an array of extra offsets that push overlapping ones apart.\n * Touches no DOM.\n *\n * The algorithm is a simple iterative push-out (a lightweight force-based separation):\n * if two circles are closer than the minimum distance, push them apart in opposite\n * directions. Repeat a few times. Markers are small circles, so a circle-to-circle\n * distance test is enough.\n */\n\n/**\n * @param {Array<{x:number,y:number}>} centers base coordinate of each marker center\n * @param {object} [options]\n * @param {number} [options.minDistance] center-to-center distance closer than this counts as overlap\n * @param {number} [options.iterations] number of iterations\n * @returns {Array<{dx:number,dy:number}>} offset to add to each marker\n */\nexport function resolveOverlaps(centers, options = {}) {\n const minDistance = options.minDistance ?? 26;\n const iterations = options.iterations ?? 6;\n\n // Working positions (base + accumulated offset).\n const positions = centers.map((c) => ({ x: c.x, y: c.y }));\n\n for (let iter = 0; iter < iterations; iter++) {\n let moved = false;\n\n for (let i = 0; i < positions.length; i++) {\n for (let j = i + 1; j < positions.length; j++) {\n const a = positions[i];\n const b = positions[j];\n let dx = b.x - a.x;\n let dy = b.y - a.y;\n let dist = Math.hypot(dx, dy);\n\n if (dist >= minDistance) {\n continue;\n }\n\n // If the coordinates are exactly identical, separate in a deterministic direction (horizontal).\n if (dist === 0) {\n dx = 1;\n dy = 0;\n dist = 1;\n }\n\n const overlap = (minDistance - dist) / 2;\n const ux = dx / dist;\n const uy = dy / dist;\n\n a.x -= ux * overlap;\n a.y -= uy * overlap;\n b.x += ux * overlap;\n b.y += uy * overlap;\n moved = true;\n }\n }\n\n if (!moved) {\n break;\n }\n }\n\n return positions.map((p, i) => ({\n dx: p.x - centers[i].x,\n dy: p.y - centers[i].y,\n }));\n}\n", "/**\n * Marker manager.\n * Markers can be dynamically mounted/unmounted per help record (SPA dynamic-element support).\n * Each marker keeps following its target (an element, or the virtual element of a free placement)\n * via Floating UI's autoUpdate. On every finalized placement it triggers the overlap-avoidance pass,\n * debounced with rAF.\n *\n * Marker identifier (id):\n * - element-bound: the target element itself (distinguishes multiple elements with the same data-help-id)\n * - free placement: the config key string\n */\nimport { createMarker } from './dom-builder.js';\nimport { anchorMarker, makeVirtualElement } from './floating.js';\nimport { resolveOverlaps } from './overlap.js';\n\n// Temporary class added to the target element only while the marker is hovered/focused (matches the style.js definition).\nconst TARGET_HIGHLIGHT_CLASS = 'help-layer-target-highlight';\n\n/** @param {import('./matcher.js').HelpRecord} record */\nfunction referenceFor(record) {\n if (record.kind === 'free') {\n return makeVirtualElement(() => ({\n top: record.position.top,\n left: record.position.left,\n width: 0,\n height: 0,\n }));\n }\n return record.target;\n}\n\n/**\n * @param {object} state teardown registry\n * @param {object} options\n * @param {(record: import('./matcher.js').HelpRecord, markerEl: HTMLElement) => void} options.onMarkerClick\n * @param {() => void} [options.onOverlapResolved]\n * @param {string} [options.markerLabel] character shown on the marker (default '?')\n * @param {import('@floating-ui/dom').Placement} [options.markerPlacement] corner to overlap (default 'top-end')\n */\nexport function createMarkerManager(state, {\n onMarkerClick,\n onOverlapResolved,\n markerLabel = '?',\n markerPlacement = 'top-end',\n}) {\n /** @type {Map<Element|string, {record:import('./matcher.js').HelpRecord, el:HTMLElement, cleanup:() => void}>} */\n const markers = new Map();\n let rafId = null;\n // Don't schedule a new rAF during teardown (prevents a frame lingering after teardown).\n let tornDown = false;\n\n function runOverlapPass() {\n rafId = null;\n const entries = [...markers.values()];\n // With one marker or fewer, overlap is impossible. Skip getBoundingClientRect (forced reflow)\n // and the O(n^2) push-out math entirely (avoids a per-frame reflow while scrolling on screens\n // with few targets). However, right after dropping from 2 to 1, if the remaining one still has\n // a leftover push-out transform, clear it and let an open popup follow that move (in steady\n // state, with an empty transform, do nothing).\n if (entries.length <= 1) {\n const el = entries.length === 1 ? entries[0].el : null;\n if (el && el.style.transform) {\n el.style.transform = '';\n if (onOverlapResolved) {\n onOverlapResolved();\n }\n }\n return;\n }\n\n // Clear the accumulated transform to measure base centers, then reapply after resolving overlaps.\n entries.forEach((e) => { e.el.style.transform = ''; });\n const centers = entries.map((e) => {\n const r = e.el.getBoundingClientRect();\n return { x: r.left + r.width / 2, y: r.top + r.height / 2 };\n });\n const offsets = resolveOverlaps(centers);\n entries.forEach((e, i) => {\n const { dx, dy } = offsets[i];\n e.el.style.transform = (dx || dy) ? `translate(${dx}px, ${dy}px)` : '';\n });\n\n // Marker positions moved, so give an open popup etc. the chance to follow.\n if (onOverlapResolved) {\n onOverlapResolved();\n }\n }\n\n function scheduleOverlapPass() {\n if (rafId !== null || tornDown) {\n return;\n }\n rafId = requestAnimationFrame(runOverlapPass);\n }\n\n /** @param {import('./matcher.js').HelpRecord} record */\n function mount(record) {\n if (markers.has(record.id)) {\n return;\n }\n\n const el = createMarker(record.title, markerLabel);\n document.body.appendChild(el);\n\n const handleClick = () => onMarkerClick(record, el);\n el.addEventListener('click', handleClick);\n\n const cleanupAnchor = anchorMarker(referenceFor(record), el, scheduleOverlapPass, markerPlacement);\n\n // Target-element highlight (element-bound only; free placement has no target, so skip).\n // Show an outline on the target only while the marker is hovered/focused, to make clear \"which element this explains\".\n const target = record.kind === 'element' ? record.target : null;\n const addHighlight = () => target && target.classList.add(TARGET_HIGHLIGHT_CLASS);\n const removeHighlight = () => target && target.classList.remove(TARGET_HIGHLIGHT_CLASS);\n if (target) {\n el.addEventListener('mouseenter', addHighlight);\n el.addEventListener('mouseleave', removeHighlight);\n el.addEventListener('focus', addHighlight);\n el.addEventListener('blur', removeHighlight);\n }\n\n let done = false;\n const cleanup = () => {\n if (done) {\n return;\n }\n done = true;\n cleanupAnchor();\n el.removeEventListener('click', handleClick);\n if (target) {\n el.removeEventListener('mouseenter', addHighlight);\n el.removeEventListener('mouseleave', removeHighlight);\n el.removeEventListener('focus', addHighlight);\n el.removeEventListener('blur', removeHighlight);\n removeHighlight(); // don't leave the highlight on the target if unmounted while highlighted\n }\n el.remove();\n markers.delete(record.id);\n scheduleOverlapPass();\n };\n\n markers.set(record.id, { record, el, cleanup });\n }\n\n function unmount(id) {\n const entry = markers.get(id);\n if (entry) {\n entry.cleanup();\n }\n }\n\n function mountAll(records) {\n records.forEach(mount);\n }\n\n // Register a single teardown for the whole manager with state\n // (individual mount/unmount happen many times during a session, so they're bundled here).\n state.track(() => {\n tornDown = true;\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n rafId = null;\n }\n [...markers.values()].forEach((entry) => entry.cleanup());\n });\n\n return {\n mount,\n unmount,\n mountAll,\n has(id) {\n return markers.has(id);\n },\n // Return the first entry matching the config key (either element-bound or free placement).\n // Used by the programmatic open(key).\n findByKey(key) {\n for (const entry of markers.values()) {\n if (entry.record.key === key) {\n return entry;\n }\n }\n return null;\n },\n };\n}\n", "/**\n * Isolation for user-supplied callbacks (render / onOpen / onClose / onEnable / onDisable).\n *\n * These run inside the library's own control flow (event handlers, teardown), so a throw from a\n * caller's mistake must not derail us: it could leave a popup half-open or abort a teardown midway,\n * stranding markers, observers and injected styles. We swallow the error and log it instead, so the\n * developer still sees their bug while the library keeps its internal state consistent.\n */\n\n/**\n * Invoke a user callback, never letting it throw into library code.\n * @template T\n * @param {string} label name used in the error log (e.g. 'onClose')\n * @param {((...args: any[]) => T)|undefined|null} fn the callback, or nullish to skip\n * @param {...any} args arguments forwarded to fn\n * @returns {T|undefined} fn's return value, or undefined when absent or it threw\n */\nexport function safeInvoke(label, fn, ...args) {\n if (!fn) {\n return undefined;\n }\n try {\n return fn(...args);\n } catch (err) {\n // Always logged regardless of `silent` (that flag only gates unregistered-key warnings).\n console.error(`[help-layer] ${label} threw:`, err);\n return undefined;\n }\n}\n", "/**\n * DOM observation and Shadow DOM-piercing traversal.\n *\n * A normal querySelectorAll does not cross shadow boundaries, so queryAllDeep walks open\n * shadowRoots recursively. A closed shadowRoot is unreachable from JS, so it is unsupported\n * (a known limitation).\n *\n * For SPA support, while ON a MutationObserver watches for additions/removals of data-help-id\n * elements and mounts/unmounts markers dynamically.\n */\n\nimport { safeInvoke } from './safe.js';\n\nconst ELEMENT_NODE = 1;\n\n/**\n * Internal worker that traverses everything under root (including inside open shadowRoots) once,\n * collecting both selector-matching elements and shadowRoots at the same time. It uses a single\n * `querySelectorAll('*')` pass and does both the `matches` test and shadowRoot detection within it.\n * The goal is to cut what used to be two separate full scans (\"collect matches\" and \"find shadow\n * hosts\") down to one (lightening the hot path that reacts to host DOM changes while ON).\n * @param {ParentNode} root\n * @param {string} selector\n * @param {(el: Element) => void} [onMatch]\n * @param {(shadow: ShadowRoot) => void} [onShadowRoot]\n */\nfunction walkDeep(root, selector, onMatch, onShadowRoot) {\n if (typeof root.querySelectorAll !== 'function') {\n return;\n }\n // querySelectorAll('*') does not cross shadow boundaries, so run it flatly once per root and,\n // when a shadowRoot is found, recurse into it right there (depth-first).\n root.querySelectorAll('*').forEach((el) => {\n if (onMatch && el.matches(selector)) {\n onMatch(el);\n }\n if (el.shadowRoot) {\n if (onShadowRoot) {\n onShadowRoot(el.shadowRoot);\n }\n walkDeep(el.shadowRoot, selector, onMatch, onShadowRoot);\n }\n });\n}\n\n/**\n * Collect every element under root (including inside open shadowRoots) matching selector.\n * @param {ParentNode} root\n * @param {string} selector\n * @returns {Element[]}\n */\nexport function queryAllDeep(root, selector) {\n const results = [];\n walkDeep(root, selector, (el) => results.push(el));\n return results;\n}\n\n/**\n * Collect every open shadowRoot under root (excluding root itself).\n * @param {ParentNode} root\n * @returns {ShadowRoot[]}\n */\nexport function collectShadowRoots(root) {\n const roots = [];\n walkDeep(root, '*', null, (shadow) => roots.push(shadow));\n return roots;\n}\n\n/**\n * Traverse a node and its descendants (including shadow) once, returning both selector-matching\n * elements and the descendants' open shadowRoots together. Used in MutationObserver added-node\n * handling to fold \"collect matches\" and \"add shadow observation\" into one traversal per subtree.\n * @param {Node} node\n * @param {string} selector\n * @returns {{ matches: Element[], shadowRoots: ShadowRoot[] }}\n */\nfunction scanSubtree(node, selector) {\n /** @type {Element[]} */\n const matches = [];\n /** @type {ShadowRoot[]} */\n const shadowRoots = [];\n if (node.nodeType !== ELEMENT_NODE) {\n return { matches, shadowRoots };\n }\n // node itself is not included in querySelectorAll('*'), so test it separately (equivalent to the former matchingWithin).\n const el = /** @type {Element} */ (node);\n if (typeof el.matches === 'function' && el.matches(selector)) {\n matches.push(el);\n }\n // The added node itself may be a shadow host. walkDeep only inspects the shadowRoots of\n // descendants (querySelectorAll('*') never includes the root), so handle the node's own\n // shadowRoot here before descending into the light-DOM subtree.\n if (el.shadowRoot) {\n shadowRoots.push(el.shadowRoot);\n walkDeep(el.shadowRoot, selector, (m) => matches.push(m), (shadow) => shadowRoots.push(shadow));\n }\n walkDeep(el, selector, (m) => matches.push(m), (shadow) => shadowRoots.push(shadow));\n return { matches, shadowRoots };\n}\n\n/**\n * While ON, watch root and all shadowRoots under it, notifying on entry/exit of selector-matching elements.\n * If an added element has a new shadowRoot, that shadowRoot is also added to the observation.\n *\n * @param {object} params\n * @param {ParentNode} [params.root=document]\n * @param {string} params.selector\n * @param {(el: Element) => void} params.onAdded\n * @param {(el: Element) => void} params.onRemoved\n * @returns {{ disconnect(): void }}\n */\nexport function createMutationWatcher({ root = document, selector, onAdded, onRemoved }) {\n const observed = new Set();\n\n const handle = (records) => {\n for (const record of records) {\n // For added nodes, get both \"matching elements\" and \"shadowRoots to start observing\" in one traversal per subtree.\n record.addedNodes.forEach((node) => {\n const { matches, shadowRoots } = scanSubtree(node, selector);\n // Isolate each callback: a throw on one element must not abort the rest of the batch nor\n // kill ongoing observation (which would silently stop all later SPA tracking).\n matches.forEach((el) => safeInvoke('observer onAdded', onAdded, el));\n shadowRoots.forEach(observe);\n });\n record.removedNodes.forEach((node) => {\n scanSubtree(node, selector).matches.forEach((el) => safeInvoke('observer onRemoved', onRemoved, el));\n });\n }\n };\n\n const observer = new MutationObserver(handle);\n\n function observe(target) {\n if (observed.has(target)) {\n return;\n }\n observed.add(target);\n observer.observe(target, { childList: true, subtree: true });\n }\n\n observe(root);\n collectShadowRoots(root).forEach(observe);\n\n return {\n disconnect() {\n observer.disconnect();\n observed.clear();\n },\n };\n}\n", "/**\n * Map the help-item array returned by normalizeConfig() onto actual DOM elements or free\n * placements, producing the \"help records\" the marker manager works with. Reads the DOM only;\n * never writes.\n *\n * Behavior of this module:\n * - Searches with queryAllDeep for Shadow DOM support.\n * - Emits a marker for each of multiple elements sharing the same data-help-id (correct in practice).\n * Because of that, an element-bound record uses \"the element itself\" as its id (identity).\n * - A free-placement record uses the config key as its id.\n *\n * Resolution order for title/text:\n * - First look up config by the `data-help-id` value (config always wins).\n * - If config has no match, use the element's `data-help-title` / `data-help-text` as an inline definition.\n * This lets you adopt the library with markup alone, without a config object.\n */\nimport { queryAllDeep } from './observer.js';\n\n/**\n * One marker's worth of \"help record\". Produced by matcher; consumed by markers/popup/toggle/index \u2014 the shared contract.\n * Other modules reference it via `import('./matcher.js').HelpRecord` (the same style as config.js's HelpConfig).\n * @typedef {object} HelpRecord\n * @property {Element|string} id for element-bound, the target element itself; for free placement, the config key string\n * @property {'element'|'free'} kind\n * @property {string|null} key config key (null for an inline-definition-only element)\n * @property {string} title\n * @property {string} text\n * @property {Element} [target] the target element when kind:'element'\n * @property {{top:number,left:number}} [position] the placement coordinate when kind:'free'\n */\n\n// Attribute names used for inline definitions (fixed defaults so as not to grow the API).\nexport const TITLE_ATTR = 'data-help-title';\nexport const TEXT_ATTR = 'data-help-text';\n\n/**\n * Build the selector to scan. In addition to elements with `data-help-id` (default), also pick up\n * elements that only have an inline definition (`data-help-title`).\n * A single source of truth so collectElementRecords and the MutationObserver share the same condition.\n * @param {string} [attribute] attribute name marking targets (default 'data-help-id')\n */\nexport function targetSelector(attribute = 'data-help-id') {\n return `[${attribute}], [${TITLE_ATTR}]`;\n}\n\n/** Turn element-bound items into a key->item Map. */\nexport function elementConfigMap(items) {\n const map = new Map();\n for (const item of items) {\n if (item.kind === 'element') {\n map.set(item.key, item);\n }\n }\n return map;\n}\n\n/**\n * Turn free-placement items into records.\n * @returns {HelpRecord[]}\n */\nexport function freeRecords(items) {\n return items\n .filter((item) => item.kind === 'free')\n .map((item) => ({\n id: item.key,\n kind: 'free',\n key: item.key,\n title: item.title,\n text: item.text,\n position: item.position,\n }));\n}\n\n/**\n * Build the help record for a single element. title/text prefer config; if absent, fall back to\n * the element's data-help-title / data-help-text (inline definition). If neither source yields\n * both title and text, return null (not a target).\n * (Used by both the initial scan and SPA dynamic additions.)\n * @param {string} [attribute] attribute name marking targets (default 'data-help-id')\n * @returns {HelpRecord|null}\n */\nexport function recordForElement(el, configMap, attribute = 'data-help-id') {\n const key = el.getAttribute(attribute);\n // config wins. If there's no matching key, fall back to the inline attributes.\n const item = key != null ? configMap.get(key) : undefined;\n const title = item ? item.title : el.getAttribute(TITLE_ATTR);\n const text = item ? item.text : el.getAttribute(TEXT_ATTR);\n // If both title and text aren't present, it's not a target (treated as unregistered).\n if (!title || !text) {\n return null;\n }\n return {\n id: el,\n kind: 'element',\n key,\n title,\n text,\n target: el,\n };\n}\n\n/**\n * Scan target-attribute elements under root (including Shadow DOM) and collect element-bound records.\n * Targets not in config are warned about and ignored (non-fatal). silent:true suppresses the warning.\n * @param {object[]} items\n * @param {ParentNode} [root]\n * @param {object} [options]\n * @param {boolean} [options.silent] don't warn on unregistered keys\n * @param {string} [options.attribute] attribute name marking targets (default 'data-help-id')\n * @returns {HelpRecord[]}\n */\nexport function collectElementRecords(items, root = document, { silent = false, attribute = 'data-help-id' } = {}) {\n const configMap = elementConfigMap(items);\n const records = [];\n\n queryAllDeep(root, targetSelector(attribute)).forEach((el) => {\n const record = recordForElement(el, configMap, attribute);\n if (!record) {\n if (!silent) {\n const key = el.getAttribute(attribute);\n console.warn(\n key != null\n ? `[help-layer] element with ${attribute}=\"${key}\" has no matching helpConfig entry or inline ${TITLE_ATTR}/${TEXT_ATTR}`\n : `[help-layer] element needs both ${TITLE_ATTR} and ${TEXT_ATTR} (or a ${attribute} matching helpConfig)`,\n );\n }\n return;\n }\n records.push(record);\n });\n\n return records;\n}\n", "/**\n * The single popup shared across the whole library.\n * Placed on its target (the clicked marker) with Floating UI; at screen edges, flip/shift avoid\n * clipping. While visible it follows via autoUpdate.\n *\n * Accessibility:\n * - On open, move focus to the popup (role=dialog).\n * - On close, return focus to the trigger element (the marker).\n */\nimport { createPopup } from './dom-builder.js';\nimport { anchorPopup } from './floating.js';\nimport { safeInvoke } from './safe.js';\n\n/**\n * @param {object} state teardown registry\n * @param {object} [options]\n * @param {() => void} [options.onClose] called when the popup closes (transitions from shown to hidden)\n * @param {(record: import('./matcher.js').HelpRecord) => (Node|null|undefined)} [options.render]\n * Escape hatch to render the body area with your own DOM node. Return a Node to display it;\n * if nothing is returned, fall back to safe text rendering (textContent). The title is always record.title.\n * Note: the return value is appendChild'd as-is without sanitization, so untrusted data must be neutralized by the caller.\n * @param {import('@floating-ui/dom').Placement} [options.popupPlacement] initial placement (default 'bottom-start')\n */\nexport function createPopupController(state, { onClose, render, popupPlacement = 'bottom-start' } = {}) {\n const { root, titleEl, textEl, closeEl } = createPopup();\n // Drive the open/close state with an inline !important display so it beats both this library's own\n // stylesheet and any host rule (e.g. div { display:none !important }). Start hidden.\n root.style.setProperty('display', 'none', 'important');\n document.body.appendChild(root);\n\n // The close (\u00D7) button. root is removed on teardown, so explicitly detaching the listener isn't needed.\n closeEl.addEventListener('click', () => close());\n\n let openId = null;\n let triggerEl = null;\n let anchor = null;\n\n function stopAnchor() {\n if (anchor) {\n anchor.cleanup();\n anchor = null;\n }\n }\n\n /**\n * @param {import('./matcher.js').HelpRecord} record\n * @param {HTMLElement} referenceEl placement reference (the clicked marker element)\n */\n function open(record, referenceEl) {\n titleEl.textContent = record.title;\n // If render exists, replace the body with a custom Node; otherwise fall back to safe text rendering.\n // A throwing render yields undefined here, so we degrade to the safe textContent path below.\n const custom = safeInvoke('render', render, record);\n textEl.textContent = '';\n if (custom) {\n textEl.appendChild(custom);\n } else {\n textEl.textContent = record.text;\n }\n root.style.setProperty('display', 'block', 'important');\n openId = record.id;\n triggerEl = referenceEl;\n\n stopAnchor();\n anchor = anchorPopup(referenceEl, root, popupPlacement);\n\n // preventScroll: the popup is positioned asynchronously (computePosition().then), so at this\n // point it's still at its stale position; a default focus would scroll toward that, causing a\n // visible jump. flip/shift keep it in the viewport, so suppressing the scroll is safe.\n root.focus({ preventScroll: true });\n }\n\n // Reposition immediately, only when open.\n // (Called e.g. right after a marker shifts due to the overlap-avoidance transform.)\n function reposition() {\n if (anchor) {\n anchor.update();\n }\n }\n\n function hide() {\n // Call onClose only if it was open (catches both the close-path and teardown-path close routes at one point).\n const wasOpen = openId !== null;\n stopAnchor();\n openId = null;\n triggerEl = null;\n root.style.setProperty('display', 'none', 'important');\n if (wasOpen) {\n safeInvoke('onClose', onClose);\n }\n }\n\n /**\n * Close and return focus.\n * @param {HTMLElement} [focusTarget] explicit focus-return target.\n * If omitted, returns to the trigger element (the marker). In contexts where the trigger\n * disappears (SPA removal), pass another surviving element such as the toggle.\n */\n function close(focusTarget) {\n const returnTo = focusTarget ?? triggerEl;\n hide();\n // Return focus if the target is still in the DOM.\n if (returnTo && returnTo.isConnected && typeof returnTo.focus === 'function') {\n returnTo.focus({ preventScroll: true });\n }\n }\n\n state.track(() => {\n hide();\n root.remove();\n });\n\n return {\n root,\n isOpen(id) {\n return openId === id;\n },\n getOpenId() {\n return openId;\n },\n open,\n close,\n reposition,\n };\n}\n", "/**\n * Registry of teardown callbacks.\n * DOM, listeners, and style changes added while the mode is ON are unwound in\n * reverse order of creation (LIFO), so that dependent cleanups (e.g. detach an\n * internal listener, then remove its element) run in a natural order.\n */\nexport function createState() {\n const cleanupFns = [];\n\n return {\n track(fn) {\n cleanupFns.push(fn);\n },\n teardownAll() {\n while (cleanupFns.length > 0) {\n const cleanup = cleanupFns.pop();\n // A throwing cleanup (e.g. a user onClose run during teardown) must not abort the rest of\n // the unwind, otherwise later-registered subsystems (markers, observer, styles) would leak.\n try {\n cleanup();\n } catch (err) {\n console.error('[help-layer] teardown step threw:', err);\n }\n }\n },\n };\n}\n", "/**\n * The z-index constants help-layer uses, and the CSS it injects.\n * Things that must sit above the blocking layer use Z_TOP (markers); the popup uses Z_POPUP so it\n * always paints in front of the markers (they share a stacking context as <body> children, so a tie\n * would otherwise be decided by DOM order and a remounted marker could cover an open popup).\n * The toggle is made visible through the clip-path \"hole\", so its z-index is left untouched.\n */\nexport const Z_BLOCKING_LAYER = 2147483000;\nexport const Z_TOP = 2147483001;\nexport const Z_POPUP = 2147483002;\n\nconst STYLE_ATTR = 'data-help-layer-style';\n\n// The theme is fully exposed via CSS custom properties. Users can change the look just by\n// overriding the following variables in host-side CSS (e.g. :root or any scope):\n// --help-layer-marker-size marker diameter (default 22px)\n// --help-layer-marker-bg marker background color (default #2563eb)\n// --help-layer-marker-color marker text color (default #fff)\n// --help-layer-popup-bg popup background color (default #fff)\n// --help-layer-popup-color popup text color (default #1f2933)\n// --help-layer-popup-max-width popup max width (default 280px)\n// --help-layer-popup-max-height body max height (default 50vh, scrolls when exceeded)\n// --help-layer-accent focus ring color (default #1d4ed8)\n// --help-layer-overlay-bg blocking-layer (scrim) background (default transparent; e.g. rgba(0,0,0,0.15))\n// --help-layer-overlay-cursor cursor over the blocked area (default default; e.g. not-allowed / help)\nconst CSS = `\n.help-layer-blocking-layer {\n /* Structural properties !important so a host can't accidentally un-fix or restack the layer and\n defeat the blocking guarantee. */\n position: fixed !important;\n inset: 0 !important;\n pointer-events: auto !important;\n /* Default transparent (unchanged). Set --help-layer-overlay-bg to tint it into a scrim that signals\n \"the host app is inactive\". The clip-path hole isn't painted, so the toggle stays untinted. */\n background: var(--help-layer-overlay-bg, transparent);\n /* Cursor over the blocked area only (the toggle shows through the hole and keeps its own cursor).\n e.g. not-allowed / help makes \"this won't respond\" obvious without needing a tint. */\n cursor: var(--help-layer-overlay-cursor, default);\n z-index: ${Z_BLOCKING_LAYER} !important;\n}\n\n.help-layer-marker {\n /* reset of the button element */\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n padding: 0;\n border: none;\n /* Structural properties are !important so a host's broad rules (e.g. button { display:none }) can't\n hide or distort the marker. top/left stay non-important because place() writes them inline per\n frame; !important there would override that and pin the marker to 0,0. Theme stays var()-driven.\n Note: for targets in a position:fixed subtree, floating.js overrides this with an inline\n position:fixed !important (inline important beats this rule) so the marker doesn't jitter. */\n position: absolute !important;\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n pointer-events: auto !important;\n top: 0;\n left: 0;\n width: var(--help-layer-marker-size, 22px) !important;\n height: var(--help-layer-marker-size, 22px) !important;\n border-radius: 50%;\n background: var(--help-layer-marker-bg, #2563eb);\n color: var(--help-layer-marker-color, #fff);\n font-family: sans-serif;\n font-size: 13px;\n font-weight: bold;\n line-height: var(--help-layer-marker-size, 22px);\n text-align: center;\n cursor: pointer;\n user-select: none;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);\n z-index: ${Z_TOP} !important;\n}\n\n.help-layer-marker:focus-visible {\n outline: 3px solid var(--help-layer-accent, #1d4ed8);\n outline-offset: 2px;\n}\n\n.help-layer-popup {\n /* Structural !important guards against host resets; top/left stay inline (place()), and display is\n deliberately NOT !important here \u2014 popup.js toggles it via an inline !important declaration so the\n open/close state itself can also beat a host rule without this stylesheet fighting the toggle. */\n position: absolute !important;\n visibility: visible !important;\n opacity: 1 !important;\n pointer-events: auto !important;\n top: 0;\n left: 0;\n display: none;\n max-width: var(--help-layer-popup-max-width, 280px);\n background: var(--help-layer-popup-bg, #fff);\n color: var(--help-layer-popup-color, #1f2933);\n border-radius: 6px;\n padding: 12px 14px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);\n font-family: sans-serif;\n font-size: 13px;\n line-height: 1.5;\n z-index: ${Z_POPUP} !important;\n}\n\n.help-layer-popup:focus {\n outline: none;\n}\n\n.help-layer-popup:focus-visible {\n outline: 3px solid var(--help-layer-accent, #1d4ed8);\n outline-offset: 2px;\n}\n\n.help-layer-popup__title {\n font-weight: bold;\n margin-bottom: 4px;\n /* Reserve space so it doesn't overlap the \u00D7 button at the top-right. */\n padding-right: 16px;\n}\n\n.help-layer-popup__text {\n /* Render the body's \\n as line breaks (still textContent, so no XSS risk). */\n white-space: pre-line;\n /* Keep long text from spilling off-screen; only the body scrolls within the popup. */\n max-height: var(--help-layer-popup-max-height, 50vh);\n overflow-y: auto;\n}\n\n.help-layer-popup__close {\n /* reset of the button element */\n appearance: none;\n -webkit-appearance: none;\n /* Keep the close affordance visible/placed even under host button { ... } rules. */\n display: block !important;\n position: absolute !important;\n pointer-events: auto !important;\n top: 6px;\n right: 6px;\n width: 22px;\n height: 22px;\n padding: 0;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: inherit;\n font-size: 16px;\n line-height: 1;\n cursor: pointer;\n}\n\n.help-layer-popup__close:hover {\n background: rgba(0, 0, 0, 0.08);\n}\n\n.help-layer-popup__close:focus-visible {\n outline: 2px solid var(--help-layer-accent, #1d4ed8);\n outline-offset: 1px;\n}\n\n/*\n * Show an outline on the target element only while the marker is hovered/focused (clarifies \"which element this explains\").\n * Make only the outline !important so it can beat host-side outline resets.\n */\n.help-layer-target-highlight {\n outline: 2px solid var(--help-layer-accent, #1d4ed8) !important;\n outline-offset: 2px !important;\n}\n\n/*\n * Dark-mode defaults. If the user specifies CSS variables, those always win via var(), so here we\n * only swap the dark fallback values (the properties themselves aren't re-declared).\n */\n@media (prefers-color-scheme: dark) {\n .help-layer-popup {\n background: var(--help-layer-popup-bg, #1f2933);\n color: var(--help-layer-popup-color, #e5e7eb);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);\n }\n}\n`;\n\n/**\n * Inject a <style> tag into head and return that element.\n * @param {string} [nonce] nonce to allow this <style> under a strict CSP (style-src 'nonce-\u2026').\n * The nonce attribute is added only when provided. If omitted, nothing is added (as before).\n */\nexport function injectStyles(nonce) {\n const styleEl = document.createElement('style');\n styleEl.setAttribute(STYLE_ATTR, '');\n // Under a CSP running style-src 'nonce-\u2026', only a <style> with a matching nonce is applied.\n if (nonce) {\n styleEl.setAttribute('nonce', nonce);\n }\n styleEl.textContent = CSS;\n document.head.appendChild(styleEl);\n return styleEl;\n}\n\n/**\n * Remove the <style> tag injected by injectStyles().\n */\nexport function removeStyles(styleEl) {\n styleEl.remove();\n}\n", "/**\n * Orchestration of the help mode's ON/OFF.\n * Starts each subsystem (style injection, marker manager, popup, blocking layer, DOM observation)\n * and aggregates their teardown into the cleanup registry (state).\n */\nimport { activateBlockingLayer } from './blocking-layer.js';\nimport { isPlainObject, normalizeConfig, validateConfig } from './config.js';\nimport { createMarkerManager } from './markers.js';\nimport {\n collectElementRecords,\n elementConfigMap,\n freeRecords,\n recordForElement,\n targetSelector,\n} from './matcher.js';\nimport { createMutationWatcher } from './observer.js';\nimport { createPopupController } from './popup.js';\nimport { safeInvoke } from './safe.js';\nimport { createState } from './state.js';\nimport { injectStyles, removeStyles } from './style.js';\n\nfunction resolveToggleElement(toggle) {\n if (typeof toggle === 'string') {\n const el = document.querySelector(toggle);\n if (!el) {\n throw new Error(`help-layer: toggle element not found for selector \"${toggle}\"`);\n }\n return /** @type {HTMLElement} */ (el);\n }\n // Reject truthy garbage (a number, a plain object, ...) early; otherwise it would be accepted as a\n // toggle and only blow up cryptically later at toggleEl.addEventListener.\n if (toggle instanceof HTMLElement) {\n return toggle;\n }\n throw new Error('help-layer: toggle must be a CSS selector string or a DOM element');\n}\n\n/**\n * @param {object} options\n * @param {object} options.config helpConfig\n * @param {string|HTMLElement} [options.toggle] DOM element that switches ON/OFF (if omitted, programmatic control only)\n * @param {() => void} [options.onEnable] called right after the mode is turned ON\n * @param {() => void} [options.onDisable] called right after the mode is turned OFF\n * @param {(record: import('./matcher.js').HelpRecord) => void} [options.onOpen] called when a popup is opened\n * @param {() => void} [options.onClose] called when a popup is closed\n * @param {boolean} [options.silent] suppress the warning log for unregistered keys\n * @param {string} [options.attribute] attribute name marking targets (default 'data-help-id')\n * @param {(record: import('./matcher.js').HelpRecord) => (Node|null|undefined)} [options.render] render the popup body with your own Node\n * (the return value is inserted as-is without sanitization, so untrusted data must be neutralized by the caller)\n * @param {string} [options.markerLabel] character shown on the marker (default '?')\n * @param {import('@floating-ui/dom').Placement} [options.markerPlacement] corner to overlap the marker onto (default 'top-end')\n * @param {import('@floating-ui/dom').Placement} [options.popupPlacement] initial popup placement (default 'bottom-start')\n * @param {string} [options.nonce] nonce to allow the injected <style> under a strict CSP (style-src 'nonce-\u2026')\n */\nexport function createToggleController(options) {\n // Validate before destructuring so initHelpLayer() / initHelpLayer(null) get a clear message\n // instead of a cryptic \"Cannot destructure property 'config' of undefined\".\n if (!isPlainObject(options)) {\n throw new Error('help-layer: initHelpLayer requires an options object');\n }\n const {\n config,\n toggle,\n onEnable,\n onDisable,\n onOpen,\n onClose,\n silent = false,\n attribute = 'data-help-id',\n render,\n markerLabel = '?',\n markerPlacement = 'top-end',\n popupPlacement = 'bottom-start',\n nonce,\n } = options;\n\n let activeConfig = config;\n validateConfig(activeConfig);\n // The toggle element is optional. If omitted, it's driven solely by programmatic control like enable()/disable().\n const toggleEl = toggle != null ? resolveToggleElement(toggle) : null;\n\n let state = null;\n // References to the current subsystems that exist only while ON. Hoisted because open(key)/close() touch them too.\n let popup = null;\n let markers = null;\n\n // Only builds the side effects (onEnable/onDisable aren't called here; they fire on the enable/disable side).\n function turnOn() {\n if (state) {\n return;\n }\n state = createState();\n\n // On OFF, return focus to the toggle last (at the LIFO tail) (only when there is a toggle).\n if (toggleEl) {\n state.track(() => {\n if (toggleEl.isConnected && typeof toggleEl.focus === 'function') {\n toggleEl.focus({ preventScroll: true });\n }\n });\n }\n\n const styleEl = injectStyles(nonce);\n state.track(() => removeStyles(styleEl));\n\n const items = normalizeConfig(activeConfig);\n const configMap = elementConfigMap(items);\n\n popup = createPopupController(state, { onClose, render, popupPlacement });\n markers = createMarkerManager(state, {\n markerLabel,\n markerPlacement,\n onMarkerClick: (record, markerEl) => {\n if (popup.isOpen(record.id)) {\n popup.close();\n return;\n }\n popup.open(record, markerEl);\n safeInvoke('onOpen', onOpen, record);\n },\n // When overlap avoidance moves a marker, make the open popup follow.\n onOverlapResolved: () => popup.reposition(),\n });\n\n // Initial mount (free placements + elements currently in the DOM, including Shadow DOM)\n markers.mountAll(freeRecords(items));\n markers.mountAll(collectElementRecords(items, document, { silent, attribute }));\n\n // SPA dynamic elements: follow additions/removals while ON\n const watcher = createMutationWatcher({\n selector: targetSelector(attribute),\n onAdded: (el) => {\n const record = recordForElement(el, configMap, attribute);\n if (record && !markers.has(record.id)) {\n markers.mount(record);\n }\n },\n onRemoved: (el) => {\n // Both the target and its marker disappear, so return focus to the toggle (or the default if absent).\n if (popup.isOpen(el)) {\n popup.close(toggleEl ?? undefined);\n }\n markers.unmount(el);\n },\n });\n state.track(() => watcher.disconnect());\n\n const isLibraryElement = (target) =>\n !!target &&\n ((toggleEl ? toggleEl.contains(target) : false) ||\n popup.root.contains(target) ||\n (typeof target.closest === 'function' && !!target.closest('.help-layer-marker')));\n\n activateBlockingLayer(state, {\n toggleEl,\n onBackgroundClick: () => popup.close(),\n isLibraryElement,\n onEscape: () => {\n if (popup.getOpenId() !== null) {\n popup.close();\n } else {\n disable();\n }\n },\n });\n }\n\n function turnOff() {\n if (state) {\n state.teardownAll();\n state = null;\n popup = null;\n markers = null;\n }\n }\n\n function enable() {\n if (state) {\n return;\n }\n turnOn();\n safeInvoke('onEnable', onEnable);\n }\n\n function disable() {\n if (!state) {\n return;\n }\n turnOff();\n safeInvoke('onDisable', onDisable);\n }\n\n function toggleMode() {\n if (state) {\n disable();\n } else {\n enable();\n }\n }\n\n // Open the description for a given key programmatically. When OFF, first enable() to create the markers.\n function openByKey(key) {\n if (!state) {\n enable();\n }\n if (!markers || !popup) {\n return;\n }\n const entry = markers.findByKey(key);\n if (!entry) {\n if (!silent) {\n console.warn(`[help-layer] open(): no help marker for key \"${key}\"`);\n }\n return;\n }\n popup.open(entry.record, entry.el);\n safeInvoke('onOpen', onOpen, entry.record);\n }\n\n // Close the open description (does not turn the mode itself OFF).\n function closePopup() {\n if (popup) {\n popup.close();\n }\n }\n\n // Replace the helpConfig. If ON, rebuild silently (onEnable/onDisable are not fired).\n function update(newConfig) {\n validateConfig(newConfig);\n activeConfig = newConfig;\n if (state) {\n turnOff();\n turnOn();\n }\n }\n\n if (toggleEl) {\n toggleEl.addEventListener('click', toggleMode);\n }\n\n return {\n enable,\n disable,\n toggle: toggleMode,\n isActive() {\n return state !== null;\n },\n open: openByKey,\n close: closePopup,\n update,\n destroy() {\n disable();\n if (toggleEl) {\n toggleEl.removeEventListener('click', toggleMode);\n }\n },\n };\n}\n"],
|
|
5
|
-
"mappings": "8bAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,KCSA,IAAMC,GAAiB,yBAEhB,SAASC,IAAsB,CACpC,IAAMC,EAAQ,SAAS,cAAc,KAAK,EAC1C,OAAAA,EAAM,UA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AgDwC,CAAG,GAAG,EAErE,MACF,CACA7B,EAAM,KAAK8B,EAAM,OAAQA,EAAM,EAAE,EACjCf,EAAW,SAAU5B,EAAQ2C,EAAM,MAAM,CAC3C,CAGA,SAASC,GAAa,CAChB/B,GACFA,EAAM,MAAM,CAEhB,CAGA,SAASgC,EAAOC,EAAW,CACzBpC,GAAeoC,CAAS,EACxBrC,EAAeqC,EACXlC,IACF0B,EAAQ,EACRvB,EAAO,EAEX,CAEA,OAAIJ,GACFA,EAAS,iBAAiB,QAAS6B,CAAU,EAGxC,CACL,OAAAD,EACA,QAAAF,EACA,OAAQG,EACR,UAAW,CACT,OAAO5B,IAAU,IACnB,EACA,KAAM6B,EACN,MAAOG,EACP,OAAAC,EACA,SAAU,CACRR,EAAQ,EACJ1B,GACFA,EAAS,oBAAoB,QAAS6B,CAAU,CAEpD,CACF,CACF,ClB5NO,SAASO,GAAcC,EAAS,CACrC,OAAOC,GAAuBD,CAAO,CACvC",
|
|
6
|
-
"names": ["index_exports", "__export", "initHelpLayer", "POPUP_TITLE_ID", "createBlockingLayer", "layer", "createMarker", "title", "label", "marker", "createPopup", "root", "titleEl", "textEl", "closeEl", "min", "max", "round", "floor", "createCoords", "v", "oppositeSideMap", "clamp", "start", "value", "end", "evaluate", "param", "getSide", "placement", "getAlignment", "getOppositeAxis", "axis", "getAxisLength", "getSideAxis", "firstChar", "getAlignmentAxis", "getAlignmentSides", "rects", "rtl", "alignment", "alignmentAxis", "length", "mainAlignmentSide", "getOppositePlacement", "getExpandedPlacements", "oppositePlacement", "getOppositeAlignmentPlacement", "lrPlacement", "rlPlacement", "tbPlacement", "btPlacement", "getSideList", "side", "isStart", "getOppositeAxisPlacements", "flipAlignment", "direction", "list", "expandPaddingObject", "padding", "getPaddingObject", "rectToClientRect", "rect", "x", "y", "width", "height", "computeCoordsFromPlacement", "_ref", "placement", "rtl", "reference", "floating", "sideAxis", "getSideAxis", "alignmentAxis", "getAlignmentAxis", "alignLength", "getAxisLength", "side", "getSide", "isVertical", "commonX", "commonY", "commonAlign", "coords", "getAlignment", "detectOverflow", "state", "options", "_await$platform$isEle", "x", "y", "platform", "rects", "elements", "strategy", "boundary", "rootBoundary", "elementContext", "altBoundary", "padding", "evaluate", "paddingObject", "getPaddingObject", "element", "clippingClientRect", "rectToClientRect", "rect", "offsetParent", "offsetScale", "elementClientRect", "MAX_RESET_COUNT", "computePosition", "config", "middleware", "platformWithDetectOverflow", "statefulPlacement", "resetCount", "middlewareData", "i", "currentMiddleware", "name", "fn", "nextX", "nextY", "data", "reset", "flip", "options", "state", "_middlewareData$arrow", "_middlewareData$flip", "placement", "middlewareData", "rects", "initialPlacement", "platform", "elements", "checkMainAxis", "checkCrossAxis", "specifiedFallbackPlacements", "fallbackStrategy", "fallbackAxisSideDirection", "flipAlignment", "detectOverflowOptions", "evaluate", "side", "getSide", "initialSideAxis", "getSideAxis", "isBasePlacement", "rtl", "fallbackPlacements", "getOppositePlacement", "getExpandedPlacements", "hasFallbackAxisSideDirection", "getOppositeAxisPlacements", "placements", "overflow", "overflows", "overflowsData", "sides", "getAlignmentSides", "_middlewareData$flip2", "_overflowsData$filter", "nextIndex", "nextPlacement", "d", "resetPlacement", "a", "b", "_overflowsData$filter2", "currentSideAxis", "acc", "originSides", "convertValueToCoords", "state", "options", "placement", "platform", "elements", "rtl", "side", "getSide", "alignment", "getAlignment", "isVertical", "getSideAxis", "mainAxisMulti", "crossAxisMulti", "rawValue", "evaluate", "mainAxis", "crossAxis", "alignmentAxis", "offset", "_middlewareData$offse", "_middlewareData$arrow", "x", "y", "middlewareData", "diffCoords", "shift", "checkMainAxis", "checkCrossAxis", "limiter", "_ref", "detectOverflowOptions", "coords", "overflow", "getOppositeAxis", "mainAxisCoord", "crossAxisCoord", "minSide", "maxSide", "min", "max", "clamp", "limitedCoords", "hasWindow", "getNodeName", "node", "isNode", "getWindow", "_node$ownerDocument", "getDocumentElement", "_ref", "value", "isElement", "isHTMLElement", "isShadowRoot", "isOverflowElement", "element", "overflow", "overflowX", "overflowY", "display", "getComputedStyle", "isTableElement", "isTopLayer", "willChangeRe", "containRe", "isNotNone", "isWebKitValue", "isContainingBlock", "elementOrCss", "css", "isWebKit", "getContainingBlock", "currentNode", "getParentNode", "isLastTraversableNode", "getNodeScroll", "result", "getNearestOverflowAncestor", "parentNode", "getOverflowAncestors", "list", "traverseIframes", "_node$ownerDocument2", "scrollableAncestor", "isBody", "win", "frameElement", "getFrameElement", "getCssDimensions", "element", "css", "getComputedStyle", "width", "height", "hasOffset", "isHTMLElement", "offsetWidth", "offsetHeight", "shouldFallback", "round", "unwrapElement", "isElement", "getScale", "domElement", "createCoords", "rect", "$", "x", "y", "noOffsets", "getVisualOffsets", "win", "getWindow", "isWebKit", "shouldAddVisualOffsets", "isFixed", "floatingOffsetParent", "getBoundingClientRect", "includeScale", "isFixedStrategy", "offsetParent", "clientRect", "scale", "visualOffsets", "offsetWin", "currentWin", "currentIFrame", "getFrameElement", "iframeScale", "iframeRect", "left", "top", "rectToClientRect", "getWindowScrollBarX", "leftScroll", "getNodeScroll", "getDocumentElement", "getHTMLOffset", "documentElement", "scroll", "htmlRect", "convertOffsetParentRelativeRectToViewportRelativeRect", "_ref", "elements", "strategy", "topLayer", "isTopLayer", "offsets", "isOffsetParentAnElement", "getNodeName", "isOverflowElement", "offsetRect", "htmlOffset", "getClientRects", "getDocumentRect", "html", "body", "max", "SCROLLBAR_MAX", "getViewportRect", "visualViewport", "visualViewportBased", "windowScrollbarX", "doc", "bodyStyles", "bodyMarginInline", "clippingStableScrollbarWidth", "getInnerBoundingClientRect", "getClientRectFromClippingAncestor", "clippingAncestor", "hasFixedPositionAncestor", "stopNode", "parentNode", "getParentNode", "isLastTraversableNode", "getClippingElementAncestors", "cache", "cachedResult", "result", "getOverflowAncestors", "el", "currentContainingBlockComputedStyle", "elementIsFixed", "currentNode", "computedStyle", "currentNodeIsContaining", "isContainingBlock", "ancestor", "getClippingRect", "boundary", "rootBoundary", "clippingAncestors", "firstRect", "right", "bottom", "i", "min", "getDimensions", "getRectRelativeToOffsetParent", "setLeftRTLScrollbarOffset", "isStaticPositioned", "getTrueOffsetParent", "polyfill", "rawOffsetParent", "getOffsetParent", "svgOffsetParent", "isTableElement", "getContainingBlock", "getElementRects", "data", "getOffsetParentFn", "getDimensionsFn", "floatingDimensions", "isRTL", "platform", "rectsAreEqual", "a", "b", "observeMove", "onMove", "io", "timeoutId", "root", "cleanup", "_io", "refresh", "skip", "threshold", "elementRectForRootMargin", "insetTop", "floor", "insetRight", "insetBottom", "insetLeft", "options", "isFirstUpdate", "handleObserve", "entries", "ratio", "autoUpdate", "reference", "floating", "update", "ancestorScroll", "ancestorResize", "elementResize", "layoutShift", "animationFrame", "referenceEl", "ancestors", "cleanupIo", "reobserveFrame", "resizeObserver", "firstEntry", "_resizeObserver", "frameId", "prevRefRect", "frameLoop", "nextRefRect", "_resizeObserver2", "offset", "shift", "flip", "computePosition", "reference", "floating", "options", "cache", "mergedOptions", "platform", "platformWithCache", "docRectToViewportRect", "docRect", "scroll", "width", "height", "left", "top", "makeVirtualElement", "getDocRect", "docRectToViewportRect", "place", "el", "x", "y", "isFixedReference", "reference", "node", "parent", "root", "MARKER_INSET", "markerOffset", "placement", "isStart", "anchorMarker", "markerEl", "onPlaced", "strategy", "autoUpdate", "computePosition", "offset", "anchorPopup", "popupEl", "update", "flip", "shift", "cleanup", "watchReference", "referenceEl", "floatingEl", "onUpdate", "buildClipPath", "rect", "x1", "y1", "x2", "y2", "activateBlockingLayer", "state", "toggleEl", "onBackgroundClick", "isLibraryElement", "onEscape", "layer", "createBlockingLayer", "cleanupClipWatch", "watchReference", "activeEl", "handleFocusIn", "event", "blockNonLibrary", "blockKey", "handleKeydown", "isPlainObject", "value", "isValidPosition", "position", "validateConfig", "config", "key", "entry", "normalizeConfig", "resolveOverlaps", "centers", "options", "minDistance", "iterations", "positions", "c", "iter", "moved", "i", "j", "a", "b", "dx", "dy", "dist", "overlap", "ux", "uy", "p", "TARGET_HIGHLIGHT_CLASS", "referenceFor", "record", "makeVirtualElement", "createMarkerManager", "state", "onMarkerClick", "onOverlapResolved", "markerLabel", "markerPlacement", "markers", "rafId", "tornDown", "runOverlapPass", "entries", "el", "e", "centers", "r", "offsets", "resolveOverlaps", "i", "dx", "dy", "scheduleOverlapPass", "mount", "createMarker", "handleClick", "cleanupAnchor", "anchorMarker", "target", "addHighlight", "removeHighlight", "done", "cleanup", "unmount", "id", "entry", "mountAll", "records", "key", "safeInvoke", "label", "fn", "args", "err", "ELEMENT_NODE", "walkDeep", "root", "selector", "onMatch", "onShadowRoot", "el", "queryAllDeep", "results", "collectShadowRoots", "roots", "shadow", "scanSubtree", "node", "matches", "shadowRoots", "m", "createMutationWatcher", "onAdded", "onRemoved", "observed", "handle", "records", "record", "safeInvoke", "observe", "observer", "target", "TITLE_ATTR", "TEXT_ATTR", "targetSelector", "attribute", "elementConfigMap", "items", "map", "item", "freeRecords", "recordForElement", "el", "configMap", "key", "title", "text", "collectElementRecords", "root", "silent", "records", "queryAllDeep", "record", "createPopupController", "state", "onClose", "render", "popupPlacement", "root", "titleEl", "textEl", "closeEl", "createPopup", "close", "openId", "triggerEl", "anchor", "stopAnchor", "open", "record", "referenceEl", "custom", "safeInvoke", "anchorPopup", "reposition", "hide", "wasOpen", "focusTarget", "returnTo", "id", "createState", "cleanupFns", "fn", "cleanup", "err", "STYLE_ATTR", "CSS", "injectStyles", "nonce", "styleEl", "removeStyles", "resolveToggleElement", "toggle", "el", "createToggleController", "options", "isPlainObject", "config", "onEnable", "onDisable", "onOpen", "onClose", "silent", "attribute", "render", "markerLabel", "markerPlacement", "popupPlacement", "nonce", "activeConfig", "validateConfig", "toggleEl", "state", "popup", "markers", "turnOn", "createState", "styleEl", "injectStyles", "removeStyles", "items", "normalizeConfig", "configMap", "elementConfigMap", "createPopupController", "createMarkerManager", "record", "markerEl", "safeInvoke", "freeRecords", "collectElementRecords", "watcher", "createMutationWatcher", "targetSelector", "recordForElement", "activateBlockingLayer", "target", "disable", "turnOff", "enable", "toggleMode", "openByKey", "key", "entry", "closePopup", "update", "newConfig", "initHelpLayer", "options", "createToggleController"]
|
|
3
|
+
"sources": ["../src/index.js", "../src/aria-isolation.js", "../src/dom-builder.js", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs", "../node_modules/@floating-ui/core/dist/floating-ui.core.mjs", "../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs", "../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs", "../src/geometry.js", "../src/floating.js", "../src/blocking-layer.js", "../src/config.js", "../src/overlap.js", "../src/markers.js", "../src/safe.js", "../src/observer.js", "../src/matcher.js", "../src/popup.js", "../src/state.js", "../src/style.js", "../src/toggle.js"],
|
|
4
|
+
"sourcesContent": ["import { createToggleController } from './toggle.js';\n\n/**\n * Initialize the help mode.\n *\n * It can be toggled ON/OFF by clicking the toggle element, and also controlled programmatically\n * via the returned API. If `toggle` is omitted, there's no DOM toggle and it's programmatic-only.\n *\n * @param {object} options\n * @param {import('./config.js').HelpConfig} options.config - configuration that specifies targets by data-help-id or position.\n * Elements not in config can still be targets via the data-help-title / data-help-text inline definition (config wins)\n * @param {string|HTMLElement} [options.toggle] - toggle element that switches ON/OFF (CSS selector string or element). Optional\n * @param {() => void} [options.onEnable] - called right after the mode is turned ON\n * @param {() => void} [options.onDisable] - called right after the mode is turned OFF\n * @param {(record: import('./matcher.js').HelpRecord) => void} [options.onOpen] - called when a description popup is opened\n * @param {() => void} [options.onClose] - called when a description popup is closed\n * @param {boolean} [options.silent] - suppress the warning log for unregistered keys\n * @param {string} [options.attribute] - attribute name marking targets (default 'data-help-id')\n * @param {(record: import('./matcher.js').HelpRecord) => (Node|null|undefined)} [options.render] - render the popup body with your own DOM.\n * Return a Node to display it; if nothing is returned, fall back to safe text display (the title is always record.title).\n * \u26A0\uFE0F The return value is inserted as-is without sanitization. If it contains untrusted data, neutralize it on the caller side (XSS prevention)\n * @param {string} [options.markerLabel] - character shown on the marker (default '?')\n * @param {import('@floating-ui/dom').Placement} [options.markerPlacement] - corner to overlap the marker onto (default 'top-end')\n * @param {import('@floating-ui/dom').Placement} [options.popupPlacement] - initial popup placement (default 'bottom-start')\n * @param {string} [options.nonce] - nonce to allow the injected <style> under a strict CSP (style-src 'nonce-\u2026')\n * @returns {{\n * enable(): void,\n * disable(): void,\n * toggle(): void,\n * isActive(): boolean,\n * open(key: string): void,\n * close(): void,\n * update(config: import('./config.js').HelpConfig): void,\n * destroy(): void,\n * }} a handle to control the mode and fully clean up at the end.\n * open(key) opens the description for the given key (auto-enables when OFF). close() closes the open description.\n */\nexport function initHelpLayer(options) {\n return createToggleController(options);\n}\n", "/**\n * Semantic background blocking for assistive technology (AT).\n *\n * The clip-path layer / focus containment / key suppression block pointer, physical focus, and\n * physical keys, but a screen reader's virtual cursor (browse mode) reads and can activate background\n * content regardless of focus or hit-testing. So while ON we also remove the host from the\n * accessibility tree with `inert` (which both excludes from the a11y tree and suppresses interaction),\n * giving AT users the same \"host is inactive\" guarantee.\n *\n * Why operate at document.body's top level: `inert` is inherited and cannot be cancelled on a\n * descendant of an inert subtree. The toggle is host-owned and may be deeply nested, so\u2014exactly like\n * the clip-path \"hole\" that lets the toggle show through\u2014we inert each body child that is neither a\n * library node nor the branch containing the toggle. The toggle's own top-level branch stays\n * reachable (a bounded leak when the toggle is nested; none when it's a direct body child).\n */\n\nconst ELEMENT_NODE = 1;\n\n/**\n * @param {object} state teardown registry\n * @param {object} params\n * @param {HTMLElement|null} params.toggleEl the toggle (must stay reachable), or null for programmatic-only\n * @param {(el: Element) => boolean} params.isLibraryNode whether a body child belongs to the library UI\n */\nexport function isolateBackgroundFromAT(state, { toggleEl, isLibraryNode }) {\n /** @type {Set<Element>} */\n const isolated = new Set();\n\n /** @param {Node} node */\n function isolate(node) {\n if (node.nodeType !== ELEMENT_NODE) {\n return;\n }\n const el = /** @type {Element} */ (node);\n // Skip library UI, the toggle's branch, and anything the host already made inert (so restore\n // doesn't clobber the host's own inert state).\n if (\n isLibraryNode(el) ||\n (toggleEl && (el === toggleEl || el.contains(toggleEl))) ||\n el.hasAttribute('inert')\n ) {\n return;\n }\n el.toggleAttribute('inert', true);\n isolated.add(el);\n }\n\n for (const child of [...document.body.children]) {\n isolate(child);\n }\n\n // The host may add top-level nodes while ON (SPA route changes, portals, ...). Keep them isolated\n // too. Only direct body children matter here, so childList without subtree is enough.\n const observer = new MutationObserver((records) => {\n for (const record of records) {\n record.addedNodes.forEach(isolate);\n }\n });\n observer.observe(document.body, { childList: true });\n\n state.track(() => {\n observer.disconnect();\n // Remove inert only from the nodes we added it to (leave any host-owned inert untouched).\n isolated.forEach((el) => el.removeAttribute('inert'));\n isolated.clear();\n });\n}\n", "/**\n * Factory functions that create the DOM elements for markers, popups, and the blocking layer.\n * Event wiring and positioning are not done here (that is the caller's responsibility).\n *\n * Accessibility:\n * - Markers are <button> elements so they are focusable and can be activated with Enter/Space.\n * - The popup uses role=\"dialog\" + aria-labelledby (the title element) to describe itself to assistive tech.\n */\n\n// Each initHelpLayer instance builds its own popup; a fixed id would collide when the\n// library is initialized more than once on a page (invalid duplicate id + ambiguous\n// aria-labelledby). Hand out a unique id per popup instead.\nlet popupSeq = 0;\n\nexport function createBlockingLayer() {\n const layer = document.createElement('div');\n layer.className = 'help-layer-blocking-layer';\n return layer;\n}\n\n/**\n * @param {string} title description title used for the assistive-tech label\n * @param {string} [label] character shown on the marker (default '?'). Visual only; does not affect the aria-label.\n */\nexport function createMarker(title, label = '?') {\n const marker = document.createElement('button');\n marker.type = 'button';\n marker.className = 'help-layer-marker';\n marker.textContent = label;\n marker.setAttribute('aria-label', `Help: ${title}`);\n return marker;\n}\n\n/**\n * Create the single popup shared across the whole library.\n * Also returns references to titleEl/textEl (used to update the content) and the close button closeEl.\n */\nexport function createPopup() {\n const titleId = `help-layer-popup-title-${popupSeq++}`;\n\n const root = document.createElement('div');\n root.className = 'help-layer-popup';\n root.setAttribute('role', 'dialog');\n // aria-modal tells AT that content outside the dialog is inert while it's shown (the host is also\n // inert'd at the document level during help mode). Harmless when hidden: display:none drops the\n // popup from the a11y tree.\n root.setAttribute('aria-modal', 'true');\n root.setAttribute('aria-labelledby', titleId);\n root.tabIndex = -1;\n\n const titleEl = document.createElement('div');\n titleEl.className = 'help-layer-popup__title';\n titleEl.id = titleId;\n\n const textEl = document.createElement('div');\n textEl.className = 'help-layer-popup__text';\n\n // Explicit close affordance. Wiring the click is popup.js's job (only element creation here).\n const closeEl = document.createElement('button');\n closeEl.type = 'button';\n closeEl.className = 'help-layer-popup__close';\n closeEl.textContent = '\u00D7';\n closeEl.setAttribute('aria-label', 'Close');\n\n root.append(titleEl, textEl, closeEl);\n\n return { root, titleEl, textEl, closeEl };\n}\n", "/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n const firstChar = placement[0];\n return firstChar === 't' || firstChar === 'b' ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.includes('start') ? placement.replace('start', 'end') : placement.replace('end', 'start');\n}\nconst lrPlacement = ['left', 'right'];\nconst rlPlacement = ['right', 'left'];\nconst tbPlacement = ['top', 'bottom'];\nconst btPlacement = ['bottom', 'top'];\nfunction getSideList(side, isStart, rtl) {\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rlPlacement : lrPlacement;\n return isStart ? lrPlacement : rlPlacement;\n case 'left':\n case 'right':\n return isStart ? tbPlacement : btPlacement;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n const side = getSide(placement);\n return oppositeSideMap[side] + placement.slice(side.length);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n", "import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n// Maximum number of resets that can occur before bailing to avoid infinite reset loops.\nconst MAX_RESET_COUNT = 50;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const platformWithDetectOverflow = platform.detectOverflow ? platform : {\n ...platform,\n detectOverflow\n };\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let resetCount = 0;\n const middlewareData = {};\n for (let i = 0; i < middleware.length; i++) {\n const currentMiddleware = middleware[i];\n if (!currentMiddleware) {\n continue;\n }\n const {\n name,\n fn\n } = currentMiddleware;\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform: platformWithDetectOverflow,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData[name] = {\n ...middlewareData[name],\n ...data\n };\n if (reset && resetCount < MAX_RESET_COUNT) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;\n if (!ignoreCrossAxisOverflow ||\n // We leave the current main axis only if every placement on that axis\n // overflows the main axis.\n overflowsData.every(d => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects,\n platform\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await platform.detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\nconst originSides = /*#__PURE__*/new Set(['left', 'top']);\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = originSides.has(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n platform\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = originSides.has(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await platform.detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n", "function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== 'inline' && display !== 'contents';\n}\nfunction isTableElement(element) {\n return /^(table|td|th)$/.test(getNodeName(element));\n}\nfunction isTopLayer(element) {\n try {\n if (element.matches(':popover-open')) {\n return true;\n }\n } catch (_e) {\n // no-op\n }\n try {\n return element.matches(':modal');\n } catch (_e) {\n return false;\n }\n}\nconst willChangeRe = /transform|translate|scale|rotate|perspective|filter/;\nconst containRe = /paint|layout|strict|content/;\nconst isNotNone = value => !!value && value !== 'none';\nlet isWebKitValue;\nfunction isContainingBlock(elementOrCss) {\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || '') || containRe.test(css.contain || '');\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (isWebKitValue == null) {\n isWebKitValue = typeof CSS !== 'undefined' && CSS.supports && CSS.supports('-webkit-backdrop-filter', 'none');\n }\n return isWebKitValue;\n}\nfunction isLastTraversableNode(node) {\n return /^(html|body|#document)$/.test(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n } else {\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n }\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n", "import { rectToClientRect, arrow as arrow$1, autoPlacement as autoPlacement$1, detectOverflow as detectOverflow$1, flip as flip$1, hide as hide$1, inline as inline$1, limitShift as limitShift$1, offset as offset$1, shift as shift$1, size as size$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle as getComputedStyle$1, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle$1(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle$1(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If <html> has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll) {\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect);\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `<html>` and `<body>` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle$1(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Safety check: ensure the scrollbar space is reasonable in case this\n// calculation is affected by unusual styles.\n// Most scrollbars leave 15-18px of space.\nconst SCROLLBAR_MAX = 25;\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n const windowScrollbarX = getWindowScrollBarX(html);\n // <html> `overflow: hidden` + `scrollbar-gutter: stable` reduces the\n // visual width of the <html> but this is not considered in the size\n // of `html.clientWidth`.\n if (windowScrollbarX <= 0) {\n const doc = html.ownerDocument;\n const body = doc.body;\n const bodyStyles = getComputedStyle(body);\n const bodyMarginInline = doc.compatMode === 'CSS1Compat' ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0;\n const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline);\n if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) {\n width -= clippingStableScrollbarWidth;\n }\n } else if (windowScrollbarX <= SCROLLBAR_MAX) {\n // If the <body> scrollbar is on the left, the width needs to be extended\n // by the scrollbar amount so there isn't extra space on the right.\n width += windowScrollbarX;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle$1(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle$1(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === 'absolute' || currentContainingBlockComputedStyle.position === 'fixed') || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy);\n let top = firstRect.top;\n let right = firstRect.right;\n let bottom = firstRect.bottom;\n let left = firstRect.left;\n for (let i = 1; i < clippingAncestors.length; i++) {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy);\n top = max(rect.top, top);\n right = min(rect.right, right);\n bottom = min(rect.bottom, bottom);\n left = max(rect.left, left);\n }\n return {\n width: right - left,\n height: bottom - top,\n x: left,\n y: top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n\n // If the <body> scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n function setLeftRTLScrollbarOffset() {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n setLeftRTLScrollbarOffset();\n }\n }\n if (isFixed && !isOffsetParentAnElement && documentElement) {\n setLeftRTLScrollbarOffset();\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle$1(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the <html> element as the offsetParent if it's non-static,\n // while Chrome and Safari return the <body> element. The <body> element must\n // be used to perform the correct calculations even if the <html> element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle$1(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle <iframe>s\n root: root.ownerDocument\n });\n } catch (_e) {\n io = new IntersectionObserver(handleObserve, options);\n }\n io.observe(element);\n }\n refresh(true);\n return cleanup;\n}\n\n/**\n * Automatically updates the position of the floating element when necessary.\n * Should only be called when the floating element is mounted on the DOM or\n * visible on the screen.\n * @returns cleanup function that should be invoked when the floating element is\n * removed from the DOM or hidden from the screen.\n * @see https://floating-ui.com/docs/autoUpdate\n */\nfunction autoUpdate(reference, floating, update, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n ancestorScroll = true,\n ancestorResize = true,\n elementResize = typeof ResizeObserver === 'function',\n layoutShift = typeof IntersectionObserver === 'function',\n animationFrame = false\n } = options;\n const referenceEl = unwrapElement(reference);\n const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...(floating ? getOverflowAncestors(floating) : [])] : [];\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.addEventListener('scroll', update, {\n passive: true\n });\n ancestorResize && ancestor.addEventListener('resize', update);\n });\n const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;\n let reobserveFrame = -1;\n let resizeObserver = null;\n if (elementResize) {\n resizeObserver = new ResizeObserver(_ref => {\n let [firstEntry] = _ref;\n if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) {\n // Prevent update loops when using the `size` middleware.\n // https://github.com/floating-ui/floating-ui/issues/1740\n resizeObserver.unobserve(floating);\n cancelAnimationFrame(reobserveFrame);\n reobserveFrame = requestAnimationFrame(() => {\n var _resizeObserver;\n (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating);\n });\n }\n update();\n });\n if (referenceEl && !animationFrame) {\n resizeObserver.observe(referenceEl);\n }\n if (floating) {\n resizeObserver.observe(floating);\n }\n }\n let frameId;\n let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;\n if (animationFrame) {\n frameLoop();\n }\n function frameLoop() {\n const nextRefRect = getBoundingClientRect(reference);\n if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {\n update();\n }\n prevRefRect = nextRefRect;\n frameId = requestAnimationFrame(frameLoop);\n }\n update();\n return () => {\n var _resizeObserver2;\n ancestors.forEach(ancestor => {\n ancestorScroll && ancestor.removeEventListener('scroll', update);\n ancestorResize && ancestor.removeEventListener('resize', update);\n });\n cleanupIo == null || cleanupIo();\n (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect();\n resizeObserver = null;\n if (animationFrame) {\n cancelAnimationFrame(frameId);\n }\n };\n}\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nconst detectOverflow = detectOverflow$1;\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = offset$1;\n\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = autoPlacement$1;\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = shift$1;\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = flip$1;\n\n/**\n * Provides data that allows you to change the size of the floating element \u2014\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = size$1;\n\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = hide$1;\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = arrow$1;\n\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = inline$1;\n\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = limitShift$1;\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n */\nconst computePosition = (reference, floating, options) => {\n // This caches the expensive `getClippingElementAncestors` function so that\n // multiple lifecycle resets re-use the same result. It only lives for a\n // single call. If other functions become expensive, we can add them as well.\n const cache = new Map();\n const mergedOptions = {\n platform,\n ...options\n };\n const platformWithCache = {\n ...mergedOptions.platform,\n _c: cache\n };\n return computePosition$1(reference, floating, {\n ...mergedOptions,\n platform: platformWithCache\n });\n};\n\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, platform, shift, size };\n", "/**\n * Pure geometry calculations. Takes no DOM elements, only numbers already read off.\n *\n * Clamping things that overflow the viewport is handled by Floating UI's shift()\n * middleware. toDocumentPosition is used for the virtual-element math of free placement, etc.\n */\n\n/**\n * Given getBoundingClientRect() values (viewport-relative) and the scroll offset,\n * compute coordinates relative to the whole document.\n */\nexport function toDocumentPosition(rect, scroll) {\n return {\n top: rect.top + scroll.y,\n left: rect.left + scroll.x,\n };\n}\n\n/**\n * Convert a document-coordinate rect into a viewport-coordinate rect by subtracting\n * the current scroll offset. This is what the getBoundingClientRect of a Floating UI\n * virtual reference element (a free-placement marker) returns.\n * @param {{top:number,left:number,width?:number,height?:number}} docRect\n * @param {{x:number,y:number}} scroll\n */\nexport function docRectToViewportRect(docRect, scroll) {\n const width = docRect.width || 0;\n const height = docRect.height || 0;\n const left = docRect.left - scroll.x;\n const top = docRect.top - scroll.y;\n return {\n x: left,\n y: top,\n left,\n top,\n right: left + width,\n bottom: top + height,\n width,\n height,\n };\n}\n", "/**\n * A thin wrapper around Floating UI (@floating-ui/dom).\n * Use of Floating UI is confined to this one file; other modules only call the\n * purpose-specific functions (anchorMarker / anchorPopup / watchReference /\n * makeVirtualElement). That way, if Floating UI is ever swapped out, the blast\n * radius stays limited to here.\n *\n * Floating UI in a nutshell (note for readers unfamiliar with the DOM):\n * - computePosition(reference, floating, options) computes the optimal placement\n * coordinates (x,y) for \"this exact moment\" and returns them (one-shot).\n * - autoUpdate(reference, floating, update) watches scroll, resize, and element-size\n * changes (internally using ResizeObserver, etc.) and calls update on every change.\n * Calling the returned cleanup stops watching. This is what makes the element \"stick\"\n * to its target.\n */\nimport { autoUpdate, computePosition, flip, offset, shift } from '@floating-ui/dom';\n\nimport { docRectToViewportRect } from './geometry.js';\n\n/**\n * Create a \"virtual reference element\" for free-placement items not bound to an element.\n * When getDocRect() returns document coordinates, this converts them to viewport\n * coordinates according to the current scroll. Because autoUpdate re-evaluates on every\n * scroll, the element sticks to the given coordinate while scrolling along with the page.\n * @param {() => {top:number,left:number,width?:number,height?:number}} getDocRect\n */\nexport function makeVirtualElement(getDocRect) {\n return {\n // Tell autoUpdate that this element's ancestor is body (= scroll is watched up to window).\n // Without this the virtual element isn't scroll-watched and won't follow page scroll.\n contextElement: document.body,\n getBoundingClientRect() {\n return docRectToViewportRect(getDocRect(), { x: window.scrollX, y: window.scrollY });\n },\n };\n}\n\nfunction place(el, x, y) {\n el.style.left = `${x}px`;\n el.style.top = `${y}px`;\n}\n\n/**\n * Whether the reference lives in a `position: fixed` subtree. Such a reference stays put in the\n * viewport while the page scrolls, so an absolutely-positioned floating element (which scrolls with\n * the document) would have to be re-corrected every frame and visibly jitters. For these we switch the\n * floating element to Floating UI's `fixed` strategy (and position:fixed) so both live in the same\n * viewport space and stay glued without per-frame correction.\n *\n * Virtual elements (free placements) aren't in the DOM and already track scroll via their getRect, so\n * they report false. Walks across shadow boundaries via the host so Shadow DOM targets are handled too.\n * @param {Element|object} reference\n */\nexport function isFixedReference(reference) {\n if (!(reference instanceof Element)) {\n return false;\n }\n let node = reference;\n while (node) {\n if (getComputedStyle(node).position === 'fixed') {\n return true;\n }\n const parent = node.parentElement;\n if (parent) {\n node = parent;\n } else {\n const root = node.getRootNode();\n node = root instanceof ShadowRoot ? root.host : null;\n }\n }\n return false;\n}\n\n/**\n * Whether a reference element is currently not rendered (hidden). Free placements use a virtual\n * element with no host node, so they are never \"hidden\" (return false).\n * @param {Element|object} reference\n */\nexport function isReferenceHidden(reference) {\n if (!(reference instanceof Element)) {\n return false;\n }\n // checkVisibility() catches display:none (incl. an ancestor), content-visibility, and\u2014with the\n // option\u2014visibility:hidden, in one cheap call without any extra observers. NOTE: do NOT use\n // offsetParent here; it is null for position:fixed elements too (which this lib supports as\n // targets) and would wrongly hide their markers. Engines without checkVisibility fall back to the\n // rect: a display:none element measures 0x0 (the worst case \u2014 the marker would jump to 0,0).\n if (typeof reference.checkVisibility === 'function') {\n return !reference.checkVisibility({ visibilityProperty: true, contentVisibilityAuto: true });\n }\n const r = reference.getBoundingClientRect();\n return r.width === 0 && r.height === 0;\n}\n\n// Half of the default marker size (22px). The amount used to overlap the marker onto the\n// target's corner with an \"inset\". (If the marker-size CSS variable is changed, the resulting\n// drift is left as existing behavior = not compensated for here.)\nconst MARKER_INSET = 11;\n\n/**\n * Derive the offset for overlapping the marker onto the target's corner from the placement.\n * mainAxis is always negative (bites inward past the target's edge). crossAxis flips sign by\n * alignment direction: `-end` (right/bottom-aligned) is negative to go inward, `-start`\n * (left/top-aligned) is positive to go inward.\n * @param {string} placement\n */\nfunction markerOffset(placement) {\n const isStart = placement.endsWith('-start');\n return { mainAxis: -MARKER_INSET, crossAxis: isStart ? MARKER_INSET : -MARKER_INSET };\n}\n\n/**\n * Overlap the marker onto a corner of the target (element or virtual element), stick it there, and keep it following.\n * @param {Element|object} reference\n * @param {HTMLElement} markerEl\n * @param {() => void} [onPlaced] called every time placement is finalized (used to trigger the overlap-avoidance pass, etc.)\n * @param {import('@floating-ui/dom').Placement} [placement] corner to overlap (top-end/top-start/bottom-end/bottom-start). Default 'top-end'\n * @param {() => void} [onHidden] called once each time the target transitions from visible to hidden\n * (lets the caller close a popup that was open on this now-hidden marker)\n * @returns {() => void} cleanup\n */\nexport function anchorMarker(reference, markerEl, onPlaced, placement = 'top-end', onHidden) {\n // Match the floating element's strategy to the reference: a fixed reference needs a fixed marker, or\n // it jitters while scrolling (see isFixedReference). Inline !important beats the stylesheet's\n // `position: absolute !important`.\n const strategy = isFixedReference(reference) ? 'fixed' : 'absolute';\n if (strategy === 'fixed') {\n markerEl.style.setProperty('position', 'fixed', 'important');\n }\n // Track the visible/hidden state so onHidden fires only on the transition, not every frame.\n let hiddenNow = false;\n const update = () => {\n if (isReferenceHidden(reference)) {\n // Target went hidden (e.g. display:none) while ON. Hide the marker too instead of leaving it\n // stranded (a display:none target measures 0x0, which would otherwise fling the marker to 0,0).\n // Inline !important beats the stylesheet's `display:block !important`; skip computePosition while\n // hidden. autoUpdate({animationFrame:true}) keeps polling, so the marker is restored on reshow.\n markerEl.style.setProperty('display', 'none', 'important');\n if (!hiddenNow && onHidden) {\n onHidden(); // notify on the visible -> hidden edge (e.g. close a popup open on this marker)\n }\n hiddenNow = true;\n if (onPlaced) {\n onPlaced(); // let the overlap pass re-pack without this now-hidden marker\n }\n return;\n }\n hiddenNow = false;\n // Revert to the stylesheet's `display:block` (no-op when we never hid it).\n markerEl.style.removeProperty('display');\n computePosition(reference, markerEl, {\n placement,\n strategy,\n middleware: [offset(markerOffset(placement))],\n }).then(({ x, y }) => {\n place(markerEl, x, y);\n if (onPlaced) {\n onPlaced();\n }\n // Swallow silently: this runs every animation frame, so logging would flood the console, and a\n // stray rejection must not surface in the host app's unhandledrejection handler (e.g. Sentry).\n }).catch(() => {});\n };\n // animationFrame: true syncs repositioning to the rAF loop. With the default (scroll/resize\n // events only), computePosition resolves asynchronously, so left/top is written the frame after\n // the browser already painted the scroll \u2014 the marker lags a frame and visibly jitters.\n return autoUpdate(reference, markerEl, update, { animationFrame: true });\n}\n\n/**\n * Place the popup below the target, and at screen edges use flip (flip to the opposite side) /\n * shift (nudge) to avoid clipping. Only follows while visible.\n * @param {Element|object} reference\n * @param {HTMLElement} popupEl\n * @param {import('@floating-ui/dom').Placement} [placement] initial placement (Floating UI placement). Default 'bottom-start'\n * @returns {{ update: () => void, cleanup: () => void }}\n * calling update repositions immediately (used for reference-side transform moves that autoUpdate doesn't pick up, etc.).\n */\nexport function anchorPopup(reference, popupEl, placement = 'bottom-start') {\n // The reference is the clicked marker. If it's fixed (anchored to a fixed target), the popup must be\n // fixed too or it jitters on scroll. Set position every open so reopening on a normal marker restores\n // absolute. Inline !important beats the stylesheet's `position: absolute !important`.\n const strategy = isFixedReference(reference) ? 'fixed' : 'absolute';\n popupEl.style.setProperty('position', strategy, 'important');\n const update = () => {\n computePosition(reference, popupEl, {\n placement,\n strategy,\n middleware: [offset(8), flip({ padding: 8 }), shift({ padding: 8 })],\n }).then(({ x, y }) => {\n place(popupEl, x, y);\n // Same rationale as anchorMarker: swallow per-frame rejections so they don't reach the host.\n }).catch(() => {});\n };\n // animationFrame: true for the same smooth-tracking reason as anchorMarker. The reference here is\n // the marker element, which itself moves per frame, so the popup must track per frame to stay glued.\n const cleanup = autoUpdate(reference, popupEl, update, { animationFrame: true });\n return { update, cleanup };\n}\n\n/**\n * Watch a reference element's position/size changes and call onUpdate on every change.\n * (Used for non-placement purposes, e.g. keeping the blocking layer's clip-path hole following the toggle position.)\n * autoUpdate requires a floating element, so floatingEl is just passed as a dummy that\n * onUpdate doesn't actually position.\n * @param {Element} referenceEl\n * @param {HTMLElement} floatingEl\n * @param {() => void} onUpdate\n * @returns {() => void} cleanup\n */\nexport function watchReference(referenceEl, floatingEl, onUpdate) {\n return autoUpdate(referenceEl, floatingEl, onUpdate);\n}\n", "/**\n * Transparent interaction-blocking layer.\n *\n * Without touching the original app's event listeners at all, it keeps interactions from getting through. How it works:\n *\n * 1. Let the toggle show through via a clip-path \"hole\":\n * Set a clip-path polygon on the full-screen layer made of the outer rectangle + the toggle\n * rectangle (the hole). Inside the hole the layer isn't painted and hit-testing passes through,\n * so the toggle can be clicked natively without touching z-index at all. Unlike approaches that\n * shuffle z-index, this doesn't break depending on ancestor stacking contexts.\n * The hole is updated via autoUpdate to follow the toggle's scroll/resize.\n *\n * 2. Focus containment:\n * On ON, blur activeElement, and via focusin (capture) detect focus moving to anything other\n * than the library UI and pull it back to the toggle. Host listeners are not detached.\n *\n * 3. Key-input suppression:\n * Capture keydown/keyup in document's capture phase; for anything outside the library UI,\n * stopPropagation+preventDefault. Escape has dedicated handling (close popup / exit mode).\n * Inside the library UI (marker/popup/toggle), normal interactions like Tab are allowed.\n */\nimport { createBlockingLayer } from './dom-builder.js';\nimport { watchReference } from './floating.js';\n\nfunction buildClipPath(rect) {\n const x1 = rect.left;\n const y1 = rect.top;\n const x2 = rect.right;\n const y2 = rect.bottom;\n // A single stroke: outer ring (clockwise) -> bridge -> toggle rectangle (counter-clockwise).\n // Under the nonzero winding rule, making the inner ring wind opposite to the outer one punches a hole.\n return `polygon(\n 0px 0px, 100% 0px, 100% 100%, 0px 100%, 0px 0px,\n ${x1}px ${y1}px, ${x1}px ${y2}px, ${x2}px ${y2}px, ${x2}px ${y1}px, ${x1}px ${y1}px\n )`;\n}\n\nexport function activateBlockingLayer(state, {\n toggleEl,\n onBackgroundClick,\n isLibraryElement,\n onEscape,\n}) {\n const layer = createBlockingLayer();\n document.body.appendChild(layer);\n state.track(() => layer.remove());\n\n // --- 1. Keep the clip-path hole following the toggle position ---\n // If there's no toggle element (programmatic control only), keeping the whole surface blocked with no hole is correct.\n if (toggleEl) {\n const updateClip = () => {\n layer.style.clipPath = buildClipPath(toggleEl.getBoundingClientRect());\n };\n const cleanupClipWatch = watchReference(toggleEl, layer, updateClip);\n state.track(cleanupClipWatch);\n }\n\n // Clicking the background (the layer itself) closes the popup\n if (onBackgroundClick) {\n layer.addEventListener('click', onBackgroundClick);\n state.track(() => layer.removeEventListener('click', onBackgroundClick));\n }\n\n // --- 2. Focus containment ---\n // Turning ON happens via a click on the toggle, so don't blur if the active element is the toggle\n // itself (blurring would leave focus floating). For any other host element, make it let go.\n const activeEl = document.activeElement;\n if (\n activeEl instanceof HTMLElement &&\n activeEl !== document.body &&\n activeEl !== toggleEl\n ) {\n activeEl.blur();\n }\n\n const handleFocusIn = (event) => {\n if (isLibraryElement(event.target)) {\n return;\n }\n // If focus tries to move to a host element, take it back.\n // To the toggle if there is one; otherwise blur that element so it isn't handed to the host.\n event.stopPropagation();\n if (toggleEl) {\n toggleEl.focus({ preventScroll: true });\n } else if (event.target instanceof HTMLElement) {\n event.target.blur();\n }\n };\n document.addEventListener('focusin', handleFocusIn, true);\n state.track(() => document.removeEventListener('focusin', handleFocusIn, true));\n\n // --- 3. Key-input suppression + Escape ---\n // Shared logic that doesn't pass key input destined outside the library UI through to the host.\n const blockNonLibrary = (event) => {\n if (isLibraryElement(event.target)) {\n return;\n }\n event.stopPropagation();\n event.preventDefault();\n };\n // keyup / keypress: don't leak to the host, Escape included (Escape's real handling is on the keydown side).\n const blockKey = (event) => {\n if (event.key === 'Escape') {\n event.stopPropagation();\n event.preventDefault();\n return;\n }\n blockNonLibrary(event);\n };\n const handleKeydown = (event) => {\n if (event.key === 'Escape') {\n event.stopPropagation();\n event.preventDefault();\n if (onEscape) {\n onEscape();\n }\n return;\n }\n blockNonLibrary(event);\n };\n document.addEventListener('keydown', handleKeydown, true);\n document.addEventListener('keyup', blockKey, true);\n document.addEventListener('keypress', blockKey, true);\n state.track(() => {\n document.removeEventListener('keydown', handleKeydown, true);\n document.removeEventListener('keyup', blockKey, true);\n document.removeEventListener('keypress', blockKey, true);\n });\n\n return layer;\n}\n", "/**\n * Validation and normalization of the helpConfig object. A pure function that does no DOM work.\n */\n\n/**\n * @typedef {object} HelpEntry\n * @property {string} title heading shown on the marker / popup (non-empty)\n * @property {string} text description body (non-empty)\n * @property {{ top: number, left: number }} [position] if given, becomes a free placement not tied to an element\n */\n\n/**\n * The helpConfig itself. For element-bound entries the key is the `data-help-id` value;\n * for free placement it is any identifier.\n * @typedef {Object<string, HelpEntry>} HelpConfig\n */\n\nexport function isPlainObject(value) {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nfunction isValidPosition(position) {\n // Number.isFinite rejects NaN / Infinity / non-numbers, so a computed coordinate that became NaN\n // fails validation here instead of silently pinning the marker to 0,0 at render time.\n return (\n isPlainObject(position) &&\n Number.isFinite(position.top) &&\n Number.isFinite(position.left)\n );\n}\n\n/**\n * Validate the shape of helpConfig. Throws an Error on any problem (fail fast).\n */\nexport function validateConfig(config) {\n if (!isPlainObject(config)) {\n throw new Error('helpConfig must be a plain object');\n }\n\n for (const [key, entry] of Object.entries(config)) {\n if (!isPlainObject(entry)) {\n throw new Error(`helpConfig[\"${key}\"] must be an object`);\n }\n if (typeof entry.title !== 'string' || entry.title === '') {\n throw new Error(`helpConfig[\"${key}\"].title must be a non-empty string`);\n }\n if (typeof entry.text !== 'string' || entry.text === '') {\n throw new Error(`helpConfig[\"${key}\"].text must be a non-empty string`);\n }\n if (entry.position !== undefined && !isValidPosition(entry.position)) {\n throw new Error(`helpConfig[\"${key}\"].position must be { top: finite number, left: finite number }`);\n }\n }\n}\n\n/**\n * Convert a validated helpConfig into the shared array of \"help items\" the rendering\n * code works with. The target of kind:'element' is null at this point (DOM matching is\n * left to matcher.js).\n */\nexport function normalizeConfig(config) {\n return Object.entries(config).map(([key, entry]) => {\n if (isValidPosition(entry.position)) {\n return {\n key,\n title: entry.title,\n text: entry.text,\n kind: 'free',\n target: null,\n position: { top: entry.position.top, left: entry.position.left },\n };\n }\n\n return {\n key,\n title: entry.title,\n text: entry.text,\n kind: 'element',\n target: null,\n position: null,\n };\n });\n}\n", "/**\n * Overlap avoidance between markers (pure function).\n *\n * Takes an array of each marker's \"base position\" (the center coordinate Floating UI\n * decided on) and returns an array of extra offsets that push overlapping ones apart.\n * Touches no DOM.\n *\n * The algorithm is a simple iterative push-out (a lightweight force-based separation):\n * if two circles are closer than the minimum distance, push them apart in opposite\n * directions. Repeat a few times. Markers are small circles, so a circle-to-circle\n * distance test is enough.\n */\n\n/**\n * @param {Array<{x:number,y:number}>} centers base coordinate of each marker center\n * @param {object} [options]\n * @param {number} [options.minDistance] center-to-center distance closer than this counts as overlap\n * @param {number} [options.iterations] number of iterations\n * @returns {Array<{dx:number,dy:number}>} offset to add to each marker\n */\nexport function resolveOverlaps(centers, options = {}) {\n const minDistance = options.minDistance ?? 26;\n const iterations = options.iterations ?? 6;\n\n // Working positions (base + accumulated offset).\n const positions = centers.map((c) => ({ x: c.x, y: c.y }));\n\n for (let iter = 0; iter < iterations; iter++) {\n let moved = false;\n\n for (let i = 0; i < positions.length; i++) {\n for (let j = i + 1; j < positions.length; j++) {\n const a = positions[i];\n const b = positions[j];\n let dx = b.x - a.x;\n let dy = b.y - a.y;\n let dist = Math.hypot(dx, dy);\n\n if (dist >= minDistance) {\n continue;\n }\n\n // If the coordinates are exactly identical, separate in a deterministic direction (horizontal).\n if (dist === 0) {\n dx = 1;\n dy = 0;\n dist = 1;\n }\n\n const overlap = (minDistance - dist) / 2;\n const ux = dx / dist;\n const uy = dy / dist;\n\n a.x -= ux * overlap;\n a.y -= uy * overlap;\n b.x += ux * overlap;\n b.y += uy * overlap;\n moved = true;\n }\n }\n\n if (!moved) {\n break;\n }\n }\n\n return positions.map((p, i) => ({\n dx: p.x - centers[i].x,\n dy: p.y - centers[i].y,\n }));\n}\n", "/**\n * Marker manager.\n * Markers can be dynamically mounted/unmounted per help record (SPA dynamic-element support).\n * Each marker keeps following its target (an element, or the virtual element of a free placement)\n * via Floating UI's autoUpdate. On every finalized placement it triggers the overlap-avoidance pass,\n * debounced with rAF.\n *\n * Marker identifier (id):\n * - element-bound: the target element itself (distinguishes multiple elements with the same data-help-id)\n * - free placement: the config key string\n */\nimport { createMarker } from './dom-builder.js';\nimport { anchorMarker, makeVirtualElement } from './floating.js';\nimport { resolveOverlaps } from './overlap.js';\n\n// Temporary class added to the target element only while the marker is hovered/focused (matches the style.js definition).\nconst TARGET_HIGHLIGHT_CLASS = 'help-layer-target-highlight';\n\n/** @param {import('./matcher.js').HelpRecord} record */\nfunction referenceFor(record) {\n if (record.kind === 'free') {\n return makeVirtualElement(() => ({\n top: record.position.top,\n left: record.position.left,\n width: 0,\n height: 0,\n }));\n }\n return record.target;\n}\n\n/**\n * @param {object} state teardown registry\n * @param {object} options\n * @param {(record: import('./matcher.js').HelpRecord, markerEl: HTMLElement) => void} options.onMarkerClick\n * @param {() => void} [options.onOverlapResolved]\n * @param {(record: import('./matcher.js').HelpRecord) => void} [options.onMarkerHidden] called when a\n * marker's target transitions to hidden (e.g. display:none) \u2014 lets the caller close a popup open on it\n * @param {string} [options.markerLabel] character shown on the marker (default '?')\n * @param {import('@floating-ui/dom').Placement} [options.markerPlacement] corner to overlap (default 'top-end')\n */\nexport function createMarkerManager(state, {\n onMarkerClick,\n onOverlapResolved,\n onMarkerHidden,\n markerLabel = '?',\n markerPlacement = 'top-end',\n}) {\n /** @type {Map<Element|string, {record:import('./matcher.js').HelpRecord, el:HTMLElement, cleanup:() => void}>} */\n const markers = new Map();\n let rafId = null;\n // Don't schedule a new rAF during teardown (prevents a frame lingering after teardown).\n let tornDown = false;\n\n function runOverlapPass() {\n rafId = null;\n // Exclude hidden markers (floating.js sets inline display:none when a target goes display:none):\n // such a marker measures 0x0 at the origin, so leaving it in would make it count toward the\n // \"<=1, skip\" check and push visible markers away from (0,0).\n const entries = [...markers.values()].filter((e) => e.el.style.display !== 'none');\n // With one marker or fewer, overlap is impossible. Skip getBoundingClientRect (forced reflow)\n // and the O(n^2) push-out math entirely (avoids a per-frame reflow while scrolling on screens\n // with few targets). However, right after dropping from 2 to 1, if the remaining one still has\n // a leftover push-out transform, clear it and let an open popup follow that move (in steady\n // state, with an empty transform, do nothing).\n if (entries.length <= 1) {\n const el = entries.length === 1 ? entries[0].el : null;\n if (el && el.style.transform) {\n el.style.transform = '';\n if (onOverlapResolved) {\n onOverlapResolved();\n }\n }\n return;\n }\n\n // Clear the accumulated transform to measure base centers, then reapply after resolving overlaps.\n entries.forEach((e) => { e.el.style.transform = ''; });\n const centers = entries.map((e) => {\n const r = e.el.getBoundingClientRect();\n return { x: r.left + r.width / 2, y: r.top + r.height / 2 };\n });\n const offsets = resolveOverlaps(centers);\n entries.forEach((e, i) => {\n const { dx, dy } = offsets[i];\n e.el.style.transform = (dx || dy) ? `translate(${dx}px, ${dy}px)` : '';\n });\n\n // Marker positions moved, so give an open popup etc. the chance to follow.\n if (onOverlapResolved) {\n onOverlapResolved();\n }\n }\n\n function scheduleOverlapPass() {\n if (rafId !== null || tornDown) {\n return;\n }\n rafId = requestAnimationFrame(runOverlapPass);\n }\n\n /** @param {import('./matcher.js').HelpRecord} record */\n function mount(record) {\n if (markers.has(record.id)) {\n return;\n }\n\n const el = createMarker(record.title, markerLabel);\n document.body.appendChild(el);\n\n const handleClick = () => onMarkerClick(record, el);\n el.addEventListener('click', handleClick);\n\n const cleanupAnchor = anchorMarker(\n referenceFor(record),\n el,\n scheduleOverlapPass,\n markerPlacement,\n () => onMarkerHidden && onMarkerHidden(record),\n );\n\n // Target-element highlight (element-bound only; free placement has no target, so skip).\n // Show an outline on the target only while the marker is hovered/focused, to make clear \"which element this explains\".\n const target = record.kind === 'element' ? record.target : null;\n const addHighlight = () => target && target.classList.add(TARGET_HIGHLIGHT_CLASS);\n const removeHighlight = () => target && target.classList.remove(TARGET_HIGHLIGHT_CLASS);\n if (target) {\n el.addEventListener('mouseenter', addHighlight);\n el.addEventListener('mouseleave', removeHighlight);\n el.addEventListener('focus', addHighlight);\n el.addEventListener('blur', removeHighlight);\n }\n\n let done = false;\n const cleanup = () => {\n if (done) {\n return;\n }\n done = true;\n cleanupAnchor();\n el.removeEventListener('click', handleClick);\n if (target) {\n el.removeEventListener('mouseenter', addHighlight);\n el.removeEventListener('mouseleave', removeHighlight);\n el.removeEventListener('focus', addHighlight);\n el.removeEventListener('blur', removeHighlight);\n removeHighlight(); // don't leave the highlight on the target if unmounted while highlighted\n }\n el.remove();\n markers.delete(record.id);\n scheduleOverlapPass();\n };\n\n markers.set(record.id, { record, el, cleanup });\n }\n\n function unmount(id) {\n const entry = markers.get(id);\n if (entry) {\n entry.cleanup();\n }\n }\n\n function mountAll(records) {\n records.forEach(mount);\n }\n\n // Register a single teardown for the whole manager with state\n // (individual mount/unmount happen many times during a session, so they're bundled here).\n state.track(() => {\n tornDown = true;\n if (rafId !== null) {\n cancelAnimationFrame(rafId);\n rafId = null;\n }\n [...markers.values()].forEach((entry) => entry.cleanup());\n });\n\n return {\n mount,\n unmount,\n mountAll,\n has(id) {\n return markers.has(id);\n },\n // Return the first entry matching the config key (either element-bound or free placement).\n // Used by the programmatic open(key).\n findByKey(key) {\n for (const entry of markers.values()) {\n if (entry.record.key === key) {\n return entry;\n }\n }\n return null;\n },\n };\n}\n", "/**\n * Isolation for user-supplied callbacks (render / onOpen / onClose / onEnable / onDisable).\n *\n * These run inside the library's own control flow (event handlers, teardown), so a throw from a\n * caller's mistake must not derail us: it could leave a popup half-open or abort a teardown midway,\n * stranding markers, observers and injected styles. We swallow the error and log it instead, so the\n * developer still sees their bug while the library keeps its internal state consistent.\n */\n\n/**\n * Invoke a user callback, never letting it throw into library code.\n * @template T\n * @param {string} label name used in the error log (e.g. 'onClose')\n * @param {((...args: any[]) => T)|undefined|null} fn the callback, or nullish to skip\n * @param {...any} args arguments forwarded to fn\n * @returns {T|undefined} fn's return value, or undefined when absent or it threw\n */\nexport function safeInvoke(label, fn, ...args) {\n if (!fn) {\n return undefined;\n }\n try {\n return fn(...args);\n } catch (err) {\n // Always logged regardless of `silent` (that flag only gates unregistered-key warnings).\n console.error(`[help-layer] ${label} threw:`, err);\n return undefined;\n }\n}\n", "/**\n * DOM observation and Shadow DOM-piercing traversal.\n *\n * A normal querySelectorAll does not cross shadow boundaries, so queryAllDeep walks open\n * shadowRoots recursively. A closed shadowRoot is unreachable from JS, so it is unsupported\n * (a known limitation).\n *\n * For SPA support, while ON a MutationObserver watches for additions/removals of data-help-id\n * elements and mounts/unmounts markers dynamically.\n */\n\nimport { safeInvoke } from './safe.js';\n\nconst ELEMENT_NODE = 1;\n\n/**\n * Internal worker that traverses everything under root (including inside open shadowRoots) once,\n * collecting both selector-matching elements and shadowRoots at the same time. It uses a single\n * `querySelectorAll('*')` pass and does both the `matches` test and shadowRoot detection within it.\n * The goal is to cut what used to be two separate full scans (\"collect matches\" and \"find shadow\n * hosts\") down to one (lightening the hot path that reacts to host DOM changes while ON).\n * @param {ParentNode} root\n * @param {string} selector\n * @param {(el: Element) => void} [onMatch]\n * @param {(shadow: ShadowRoot) => void} [onShadowRoot]\n */\nfunction walkDeep(root, selector, onMatch, onShadowRoot) {\n if (typeof root.querySelectorAll !== 'function') {\n return;\n }\n // querySelectorAll('*') does not cross shadow boundaries, so run it flatly once per root and,\n // when a shadowRoot is found, recurse into it right there (depth-first).\n root.querySelectorAll('*').forEach((el) => {\n if (onMatch && el.matches(selector)) {\n onMatch(el);\n }\n if (el.shadowRoot) {\n if (onShadowRoot) {\n onShadowRoot(el.shadowRoot);\n }\n walkDeep(el.shadowRoot, selector, onMatch, onShadowRoot);\n }\n });\n}\n\n/**\n * Collect every element under root (including inside open shadowRoots) matching selector.\n * @param {ParentNode} root\n * @param {string} selector\n * @returns {Element[]}\n */\nexport function queryAllDeep(root, selector) {\n const results = [];\n walkDeep(root, selector, (el) => results.push(el));\n return results;\n}\n\n/**\n * Collect every open shadowRoot under root (excluding root itself).\n * @param {ParentNode} root\n * @returns {ShadowRoot[]}\n */\nexport function collectShadowRoots(root) {\n const roots = [];\n walkDeep(root, '*', null, (shadow) => roots.push(shadow));\n return roots;\n}\n\n/**\n * Traverse a node and its descendants (including shadow) once, returning both selector-matching\n * elements and the descendants' open shadowRoots together. Used in MutationObserver added-node\n * handling to fold \"collect matches\" and \"add shadow observation\" into one traversal per subtree.\n * @param {Node} node\n * @param {string} selector\n * @returns {{ matches: Element[], shadowRoots: ShadowRoot[] }}\n */\nfunction scanSubtree(node, selector) {\n /** @type {Element[]} */\n const matches = [];\n /** @type {ShadowRoot[]} */\n const shadowRoots = [];\n if (node.nodeType !== ELEMENT_NODE) {\n return { matches, shadowRoots };\n }\n // node itself is not included in querySelectorAll('*'), so test it separately (equivalent to the former matchingWithin).\n const el = /** @type {Element} */ (node);\n if (typeof el.matches === 'function' && el.matches(selector)) {\n matches.push(el);\n }\n // The added node itself may be a shadow host. walkDeep only inspects the shadowRoots of\n // descendants (querySelectorAll('*') never includes the root), so handle the node's own\n // shadowRoot here before descending into the light-DOM subtree.\n if (el.shadowRoot) {\n shadowRoots.push(el.shadowRoot);\n walkDeep(el.shadowRoot, selector, (m) => matches.push(m), (shadow) => shadowRoots.push(shadow));\n }\n walkDeep(el, selector, (m) => matches.push(m), (shadow) => shadowRoots.push(shadow));\n return { matches, shadowRoots };\n}\n\n/**\n * While ON, watch root and all shadowRoots under it, notifying on entry/exit of selector-matching elements.\n * If an added element has a new shadowRoot, that shadowRoot is also added to the observation.\n *\n * @param {object} params\n * @param {ParentNode} [params.root=document]\n * @param {string} params.selector\n * @param {(el: Element) => void} params.onAdded\n * @param {(el: Element) => void} params.onRemoved\n * @returns {{ disconnect(): void }}\n */\nexport function createMutationWatcher({ root = document, selector, onAdded, onRemoved }) {\n const observed = new Set();\n\n const handle = (records) => {\n for (const record of records) {\n // For added nodes, get both \"matching elements\" and \"shadowRoots to start observing\" in one traversal per subtree.\n record.addedNodes.forEach((node) => {\n const { matches, shadowRoots } = scanSubtree(node, selector);\n // Isolate each callback: a throw on one element must not abort the rest of the batch nor\n // kill ongoing observation (which would silently stop all later SPA tracking).\n matches.forEach((el) => safeInvoke('observer onAdded', onAdded, el));\n shadowRoots.forEach(observe);\n });\n record.removedNodes.forEach((node) => {\n scanSubtree(node, selector).matches.forEach((el) => safeInvoke('observer onRemoved', onRemoved, el));\n });\n }\n };\n\n const observer = new MutationObserver(handle);\n\n function observe(target) {\n if (observed.has(target)) {\n return;\n }\n observed.add(target);\n observer.observe(target, { childList: true, subtree: true });\n }\n\n observe(root);\n collectShadowRoots(root).forEach(observe);\n\n return {\n disconnect() {\n observer.disconnect();\n observed.clear();\n },\n };\n}\n", "/**\n * Map the help-item array returned by normalizeConfig() onto actual DOM elements or free\n * placements, producing the \"help records\" the marker manager works with. Reads the DOM only;\n * never writes.\n *\n * Behavior of this module:\n * - Searches with queryAllDeep for Shadow DOM support.\n * - Emits a marker for each of multiple elements sharing the same data-help-id (correct in practice).\n * Because of that, an element-bound record uses \"the element itself\" as its id (identity).\n * - A free-placement record uses the config key as its id.\n *\n * Resolution order for title/text:\n * - First look up config by the `data-help-id` value (config always wins).\n * - If config has no match, use the element's `data-help-title` / `data-help-text` as an inline definition.\n * This lets you adopt the library with markup alone, without a config object.\n */\nimport { queryAllDeep } from './observer.js';\n\n/**\n * One marker's worth of \"help record\". Produced by matcher; consumed by markers/popup/toggle/index \u2014 the shared contract.\n * Other modules reference it via `import('./matcher.js').HelpRecord` (the same style as config.js's HelpConfig).\n * @typedef {object} HelpRecord\n * @property {Element|string} id for element-bound, the target element itself; for free placement, the config key string\n * @property {'element'|'free'} kind\n * @property {string|null} key config key (null for an inline-definition-only element)\n * @property {string} title\n * @property {string} text\n * @property {Element} [target] the target element when kind:'element'\n * @property {{top:number,left:number}} [position] the placement coordinate when kind:'free'\n */\n\n// Attribute names used for inline definitions (fixed defaults so as not to grow the API).\nexport const TITLE_ATTR = 'data-help-title';\nexport const TEXT_ATTR = 'data-help-text';\n\n/**\n * Build the selector to scan. In addition to elements with `data-help-id` (default), also pick up\n * elements that only have an inline definition (`data-help-title`).\n * A single source of truth so collectElementRecords and the MutationObserver share the same condition.\n * @param {string} [attribute] attribute name marking targets (default 'data-help-id')\n */\nexport function targetSelector(attribute = 'data-help-id') {\n return `[${attribute}], [${TITLE_ATTR}]`;\n}\n\n/** Turn element-bound items into a key->item Map. */\nexport function elementConfigMap(items) {\n const map = new Map();\n for (const item of items) {\n if (item.kind === 'element') {\n map.set(item.key, item);\n }\n }\n return map;\n}\n\n/**\n * Turn free-placement items into records.\n * @returns {HelpRecord[]}\n */\nexport function freeRecords(items) {\n return items\n .filter((item) => item.kind === 'free')\n .map((item) => ({\n id: item.key,\n kind: 'free',\n key: item.key,\n title: item.title,\n text: item.text,\n position: item.position,\n }));\n}\n\n/**\n * Build the help record for a single element. title/text prefer config; if absent, fall back to\n * the element's data-help-title / data-help-text (inline definition). If neither source yields\n * both title and text, return null (not a target).\n * (Used by both the initial scan and SPA dynamic additions.)\n * @param {string} [attribute] attribute name marking targets (default 'data-help-id')\n * @returns {HelpRecord|null}\n */\nexport function recordForElement(el, configMap, attribute = 'data-help-id') {\n const key = el.getAttribute(attribute);\n // config wins. If there's no matching key, fall back to the inline attributes.\n const item = key != null ? configMap.get(key) : undefined;\n const title = item ? item.title : el.getAttribute(TITLE_ATTR);\n const text = item ? item.text : el.getAttribute(TEXT_ATTR);\n // If both title and text aren't present, it's not a target (treated as unregistered).\n if (!title || !text) {\n return null;\n }\n return {\n id: el,\n kind: 'element',\n key,\n title,\n text,\n target: el,\n };\n}\n\n/**\n * Scan target-attribute elements under root (including Shadow DOM) and collect element-bound records.\n * Targets not in config are warned about and ignored (non-fatal). silent:true suppresses the warning.\n * @param {object[]} items\n * @param {ParentNode} [root]\n * @param {object} [options]\n * @param {boolean} [options.silent] don't warn on unregistered keys\n * @param {string} [options.attribute] attribute name marking targets (default 'data-help-id')\n * @returns {HelpRecord[]}\n */\nexport function collectElementRecords(items, root = document, { silent = false, attribute = 'data-help-id' } = {}) {\n const configMap = elementConfigMap(items);\n const records = [];\n\n queryAllDeep(root, targetSelector(attribute)).forEach((el) => {\n const record = recordForElement(el, configMap, attribute);\n if (!record) {\n if (!silent) {\n const key = el.getAttribute(attribute);\n console.warn(\n key != null\n ? `[help-layer] element with ${attribute}=\"${key}\" has no matching helpConfig entry or inline ${TITLE_ATTR}/${TEXT_ATTR}`\n : `[help-layer] element needs both ${TITLE_ATTR} and ${TEXT_ATTR} (or a ${attribute} matching helpConfig)`,\n );\n }\n return;\n }\n records.push(record);\n });\n\n return records;\n}\n", "/**\n * The single popup shared across the whole library.\n * Placed on its target (the clicked marker) with Floating UI; at screen edges, flip/shift avoid\n * clipping. While visible it follows via autoUpdate.\n *\n * Accessibility:\n * - On open, move focus to the popup (role=dialog).\n * - On close, return focus to the trigger element (the marker).\n */\nimport { createPopup } from './dom-builder.js';\nimport { anchorPopup } from './floating.js';\nimport { safeInvoke } from './safe.js';\n\n/**\n * @param {object} state teardown registry\n * @param {object} [options]\n * @param {() => void} [options.onClose] called when the popup closes (transitions from shown to hidden)\n * @param {(record: import('./matcher.js').HelpRecord) => (Node|null|undefined)} [options.render]\n * Escape hatch to render the body area with your own DOM node. Return a Node to display it;\n * if nothing is returned, fall back to safe text rendering (textContent). The title is always record.title.\n * Note: the return value is appendChild'd as-is without sanitization, so untrusted data must be neutralized by the caller.\n * @param {import('@floating-ui/dom').Placement} [options.popupPlacement] initial placement (default 'bottom-start')\n */\nexport function createPopupController(state, { onClose, render, popupPlacement = 'bottom-start' } = {}) {\n const { root, titleEl, textEl, closeEl } = createPopup();\n // Drive the open/close state with an inline !important display so it beats both this library's own\n // stylesheet and any host rule (e.g. div { display:none !important }). Start hidden.\n root.style.setProperty('display', 'none', 'important');\n document.body.appendChild(root);\n\n // The close (\u00D7) button. root is removed on teardown, so explicitly detaching the listener isn't needed.\n closeEl.addEventListener('click', () => close());\n\n let openId = null;\n let triggerEl = null;\n let anchor = null;\n\n function stopAnchor() {\n if (anchor) {\n anchor.cleanup();\n anchor = null;\n }\n }\n\n /**\n * @param {import('./matcher.js').HelpRecord} record\n * @param {HTMLElement} referenceEl placement reference (the clicked marker element)\n */\n function open(record, referenceEl) {\n titleEl.textContent = record.title;\n // If render exists, replace the body with a custom Node; otherwise fall back to safe text rendering.\n // A throwing render yields undefined here, so we degrade to the safe textContent path below.\n const custom = safeInvoke('render', render, record);\n textEl.textContent = '';\n if (custom) {\n textEl.appendChild(custom);\n } else {\n textEl.textContent = record.text;\n }\n root.style.setProperty('display', 'block', 'important');\n openId = record.id;\n triggerEl = referenceEl;\n\n stopAnchor();\n anchor = anchorPopup(referenceEl, root, popupPlacement);\n\n // preventScroll: the popup is positioned asynchronously (computePosition().then), so at this\n // point it's still at its stale position; a default focus would scroll toward that, causing a\n // visible jump. flip/shift keep it in the viewport, so suppressing the scroll is safe.\n root.focus({ preventScroll: true });\n }\n\n // Reposition immediately, only when open.\n // (Called e.g. right after a marker shifts due to the overlap-avoidance transform.)\n function reposition() {\n if (anchor) {\n anchor.update();\n }\n }\n\n function hide() {\n // Call onClose only if it was open (catches both the close-path and teardown-path close routes at one point).\n const wasOpen = openId !== null;\n stopAnchor();\n openId = null;\n triggerEl = null;\n root.style.setProperty('display', 'none', 'important');\n if (wasOpen) {\n safeInvoke('onClose', onClose);\n }\n }\n\n /**\n * Close and return focus.\n * @param {HTMLElement} [focusTarget] explicit focus-return target.\n * If omitted, returns to the trigger element (the marker). In contexts where the trigger\n * disappears (SPA removal), pass another surviving element such as the toggle.\n */\n function close(focusTarget) {\n const returnTo = focusTarget ?? triggerEl;\n hide();\n // Return focus if the target is still in the DOM.\n if (returnTo && returnTo.isConnected && typeof returnTo.focus === 'function') {\n returnTo.focus({ preventScroll: true });\n }\n }\n\n state.track(() => {\n hide();\n root.remove();\n });\n\n return {\n root,\n isOpen(id) {\n return openId === id;\n },\n getOpenId() {\n return openId;\n },\n open,\n close,\n reposition,\n };\n}\n", "/**\n * Registry of teardown callbacks.\n * DOM, listeners, and style changes added while the mode is ON are unwound in\n * reverse order of creation (LIFO), so that dependent cleanups (e.g. detach an\n * internal listener, then remove its element) run in a natural order.\n */\nexport function createState() {\n const cleanupFns = [];\n\n return {\n track(fn) {\n cleanupFns.push(fn);\n },\n teardownAll() {\n while (cleanupFns.length > 0) {\n const cleanup = cleanupFns.pop();\n // A throwing cleanup (e.g. a user onClose run during teardown) must not abort the rest of\n // the unwind, otherwise later-registered subsystems (markers, observer, styles) would leak.\n try {\n cleanup();\n } catch (err) {\n console.error('[help-layer] teardown step threw:', err);\n }\n }\n },\n };\n}\n", "/**\n * The z-index constants help-layer uses, and the CSS it injects.\n * Things that must sit above the blocking layer use Z_TOP (markers); the popup uses Z_POPUP so it\n * always paints in front of the markers (they share a stacking context as <body> children, so a tie\n * would otherwise be decided by DOM order and a remounted marker could cover an open popup).\n * The toggle is made visible through the clip-path \"hole\", so its z-index is left untouched.\n */\nexport const Z_BLOCKING_LAYER = 2147483000;\nexport const Z_TOP = 2147483001;\nexport const Z_POPUP = 2147483002;\n\nconst STYLE_ATTR = 'data-help-layer-style';\n\n// The theme is fully exposed via CSS custom properties. Users can change the look just by\n// overriding the following variables in host-side CSS (e.g. :root or any scope):\n// --help-layer-marker-size marker diameter (default 22px)\n// --help-layer-marker-bg marker background color (default #2563eb)\n// --help-layer-marker-color marker text color (default #fff)\n// --help-layer-popup-bg popup background color (default #fff)\n// --help-layer-popup-color popup text color (default #1f2933)\n// --help-layer-popup-max-width popup max width (default 280px)\n// --help-layer-popup-max-height body max height (default 50vh, scrolls when exceeded)\n// --help-layer-accent focus ring color (default #1d4ed8)\n// --help-layer-overlay-bg blocking-layer (scrim) background (default transparent; e.g. rgba(0,0,0,0.15))\n// --help-layer-overlay-cursor cursor over the blocked area (default default; e.g. not-allowed / help)\nconst CSS = `\n.help-layer-blocking-layer {\n /* Structural properties !important so a host can't accidentally un-fix or restack the layer and\n defeat the blocking guarantee. */\n position: fixed !important;\n inset: 0 !important;\n pointer-events: auto !important;\n /* Default transparent (unchanged). Set --help-layer-overlay-bg to tint it into a scrim that signals\n \"the host app is inactive\". The clip-path hole isn't painted, so the toggle stays untinted. */\n background: var(--help-layer-overlay-bg, transparent);\n /* Cursor over the blocked area only (the toggle shows through the hole and keeps its own cursor).\n e.g. not-allowed / help makes \"this won't respond\" obvious without needing a tint. */\n cursor: var(--help-layer-overlay-cursor, default);\n z-index: ${Z_BLOCKING_LAYER} !important;\n}\n\n.help-layer-marker {\n /* reset of the button element */\n appearance: none;\n -webkit-appearance: none;\n margin: 0;\n padding: 0;\n border: none;\n /* Structural properties are !important so a host's broad rules (e.g. button { display:none }) can't\n hide or distort the marker. top/left stay non-important because place() writes them inline per\n frame; !important there would override that and pin the marker to 0,0. Theme stays var()-driven.\n Note: for targets in a position:fixed subtree, floating.js overrides this with an inline\n position:fixed !important (inline important beats this rule) so the marker doesn't jitter. */\n position: absolute !important;\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n pointer-events: auto !important;\n top: 0;\n left: 0;\n width: var(--help-layer-marker-size, 22px) !important;\n height: var(--help-layer-marker-size, 22px) !important;\n border-radius: 50%;\n background: var(--help-layer-marker-bg, #2563eb);\n color: var(--help-layer-marker-color, #fff);\n font-family: sans-serif;\n font-size: 13px;\n font-weight: bold;\n line-height: var(--help-layer-marker-size, 22px);\n text-align: center;\n cursor: pointer;\n user-select: none;\n box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);\n z-index: ${Z_TOP} !important;\n}\n\n.help-layer-marker:focus-visible {\n outline: 3px solid var(--help-layer-accent, #1d4ed8);\n outline-offset: 2px;\n}\n\n.help-layer-popup {\n /* Structural !important guards against host resets; top/left stay inline (place()), and display is\n deliberately NOT !important here \u2014 popup.js toggles it via an inline !important declaration so the\n open/close state itself can also beat a host rule without this stylesheet fighting the toggle. */\n position: absolute !important;\n visibility: visible !important;\n opacity: 1 !important;\n pointer-events: auto !important;\n top: 0;\n left: 0;\n display: none;\n max-width: var(--help-layer-popup-max-width, 280px);\n background: var(--help-layer-popup-bg, #fff);\n color: var(--help-layer-popup-color, #1f2933);\n border-radius: 6px;\n padding: 12px 14px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);\n font-family: sans-serif;\n font-size: 13px;\n line-height: 1.5;\n z-index: ${Z_POPUP} !important;\n}\n\n.help-layer-popup:focus {\n outline: none;\n}\n\n.help-layer-popup:focus-visible {\n outline: 3px solid var(--help-layer-accent, #1d4ed8);\n outline-offset: 2px;\n}\n\n.help-layer-popup__title {\n font-weight: bold;\n margin-bottom: 4px;\n /* Reserve space so it doesn't overlap the \u00D7 button at the top-right. */\n padding-right: 16px;\n}\n\n.help-layer-popup__text {\n /* Render the body's \\n as line breaks (still textContent, so no XSS risk). */\n white-space: pre-line;\n /* Keep long text from spilling off-screen; only the body scrolls within the popup. */\n max-height: var(--help-layer-popup-max-height, 50vh);\n overflow-y: auto;\n}\n\n.help-layer-popup__close {\n /* reset of the button element */\n appearance: none;\n -webkit-appearance: none;\n /* Keep the close affordance visible/placed even under host button { ... } rules. */\n display: block !important;\n position: absolute !important;\n pointer-events: auto !important;\n top: 6px;\n right: 6px;\n width: 22px;\n height: 22px;\n padding: 0;\n border: none;\n border-radius: 4px;\n background: transparent;\n color: inherit;\n font-size: 16px;\n line-height: 1;\n cursor: pointer;\n}\n\n.help-layer-popup__close:hover {\n background: rgba(0, 0, 0, 0.08);\n}\n\n.help-layer-popup__close:focus-visible {\n outline: 2px solid var(--help-layer-accent, #1d4ed8);\n outline-offset: 1px;\n}\n\n/*\n * Show an outline on the target element only while the marker is hovered/focused (clarifies \"which element this explains\").\n * Make only the outline !important so it can beat host-side outline resets.\n */\n.help-layer-target-highlight {\n outline: 2px solid var(--help-layer-accent, #1d4ed8) !important;\n outline-offset: 2px !important;\n}\n\n/*\n * Dark-mode defaults. If the user specifies CSS variables, those always win via var(), so here we\n * only swap the dark fallback values (the properties themselves aren't re-declared).\n */\n@media (prefers-color-scheme: dark) {\n .help-layer-popup {\n background: var(--help-layer-popup-bg, #1f2933);\n color: var(--help-layer-popup-color, #e5e7eb);\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);\n }\n}\n`;\n\n/**\n * Inject a <style> tag into head and return that element.\n * @param {string} [nonce] nonce to allow this <style> under a strict CSP (style-src 'nonce-\u2026').\n * The nonce attribute is added only when provided. If omitted, nothing is added (as before).\n */\nexport function injectStyles(nonce) {\n const styleEl = document.createElement('style');\n styleEl.setAttribute(STYLE_ATTR, '');\n // Under a CSP running style-src 'nonce-\u2026', only a <style> with a matching nonce is applied.\n if (nonce) {\n styleEl.setAttribute('nonce', nonce);\n }\n styleEl.textContent = CSS;\n document.head.appendChild(styleEl);\n return styleEl;\n}\n\n/**\n * Remove the <style> tag injected by injectStyles().\n */\nexport function removeStyles(styleEl) {\n styleEl.remove();\n}\n", "/**\n * Orchestration of the help mode's ON/OFF.\n * Starts each subsystem (style injection, marker manager, popup, blocking layer, DOM observation)\n * and aggregates their teardown into the cleanup registry (state).\n */\nimport { isolateBackgroundFromAT } from './aria-isolation.js';\nimport { activateBlockingLayer } from './blocking-layer.js';\nimport { isPlainObject, normalizeConfig, validateConfig } from './config.js';\nimport { createMarkerManager } from './markers.js';\nimport {\n collectElementRecords,\n elementConfigMap,\n freeRecords,\n recordForElement,\n targetSelector,\n} from './matcher.js';\nimport { createMutationWatcher } from './observer.js';\nimport { createPopupController } from './popup.js';\nimport { safeInvoke } from './safe.js';\nimport { createState } from './state.js';\nimport { injectStyles, removeStyles } from './style.js';\n\nfunction resolveToggleElement(toggle) {\n if (typeof toggle === 'string') {\n const el = document.querySelector(toggle);\n if (!el) {\n throw new Error(`help-layer: toggle element not found for selector \"${toggle}\"`);\n }\n return /** @type {HTMLElement} */ (el);\n }\n // Reject truthy garbage (a number, a plain object, ...) early; otherwise it would be accepted as a\n // toggle and only blow up cryptically later at toggleEl.addEventListener.\n if (toggle instanceof HTMLElement) {\n return toggle;\n }\n throw new Error('help-layer: toggle must be a CSS selector string or a DOM element');\n}\n\n/**\n * @param {object} options\n * @param {object} options.config helpConfig\n * @param {string|HTMLElement} [options.toggle] DOM element that switches ON/OFF (if omitted, programmatic control only)\n * @param {() => void} [options.onEnable] called right after the mode is turned ON\n * @param {() => void} [options.onDisable] called right after the mode is turned OFF\n * @param {(record: import('./matcher.js').HelpRecord) => void} [options.onOpen] called when a popup is opened\n * @param {() => void} [options.onClose] called when a popup is closed\n * @param {boolean} [options.silent] suppress the warning log for unregistered keys\n * @param {string} [options.attribute] attribute name marking targets (default 'data-help-id')\n * @param {(record: import('./matcher.js').HelpRecord) => (Node|null|undefined)} [options.render] render the popup body with your own Node\n * (the return value is inserted as-is without sanitization, so untrusted data must be neutralized by the caller)\n * @param {string} [options.markerLabel] character shown on the marker (default '?')\n * @param {import('@floating-ui/dom').Placement} [options.markerPlacement] corner to overlap the marker onto (default 'top-end')\n * @param {import('@floating-ui/dom').Placement} [options.popupPlacement] initial popup placement (default 'bottom-start')\n * @param {string} [options.nonce] nonce to allow the injected <style> under a strict CSP (style-src 'nonce-\u2026')\n */\nexport function createToggleController(options) {\n // Validate before destructuring so initHelpLayer() / initHelpLayer(null) get a clear message\n // instead of a cryptic \"Cannot destructure property 'config' of undefined\".\n if (!isPlainObject(options)) {\n throw new Error('help-layer: initHelpLayer requires an options object');\n }\n const {\n config,\n toggle,\n onEnable,\n onDisable,\n onOpen,\n onClose,\n silent = false,\n attribute = 'data-help-id',\n render,\n markerLabel = '?',\n markerPlacement = 'top-end',\n popupPlacement = 'bottom-start',\n nonce,\n } = options;\n\n let activeConfig = config;\n validateConfig(activeConfig);\n // The toggle element is optional. If omitted, it's driven solely by programmatic control like enable()/disable().\n const toggleEl = toggle != null ? resolveToggleElement(toggle) : null;\n\n let state = null;\n // References to the current subsystems that exist only while ON. Hoisted because open(key)/close() touch them too.\n let popup = null;\n let markers = null;\n\n // Only builds the side effects (onEnable/onDisable aren't called here; they fire on the enable/disable side).\n function turnOn() {\n if (state) {\n return;\n }\n state = createState();\n\n // On OFF, return focus to the toggle last (at the LIFO tail) (only when there is a toggle).\n if (toggleEl) {\n state.track(() => {\n if (toggleEl.isConnected && typeof toggleEl.focus === 'function') {\n toggleEl.focus({ preventScroll: true });\n }\n });\n }\n\n const styleEl = injectStyles(nonce);\n state.track(() => removeStyles(styleEl));\n\n const items = normalizeConfig(activeConfig);\n const configMap = elementConfigMap(items);\n\n popup = createPopupController(state, { onClose, render, popupPlacement });\n markers = createMarkerManager(state, {\n markerLabel,\n markerPlacement,\n onMarkerClick: (record, markerEl) => {\n if (popup.isOpen(record.id)) {\n popup.close();\n return;\n }\n popup.open(record, markerEl);\n safeInvoke('onOpen', onOpen, record);\n },\n // When overlap avoidance moves a marker, make the open popup follow.\n onOverlapResolved: () => popup.reposition(),\n // If a target is hidden (e.g. display:none) while its popup is open, close it (its marker just\n // collapsed to 0x0) \u2014 same as the SPA-removal path. Return focus to the toggle since the marker\n // is no longer focusable.\n onMarkerHidden: (record) => {\n if (popup.isOpen(record.id)) {\n popup.close(toggleEl ?? undefined);\n }\n },\n });\n\n // Initial mount (free placements + elements currently in the DOM, including Shadow DOM)\n markers.mountAll(freeRecords(items));\n markers.mountAll(collectElementRecords(items, document, { silent, attribute }));\n\n // SPA dynamic elements: follow additions/removals while ON\n const watcher = createMutationWatcher({\n selector: targetSelector(attribute),\n onAdded: (el) => {\n const record = recordForElement(el, configMap, attribute);\n if (record && !markers.has(record.id)) {\n markers.mount(record);\n }\n },\n onRemoved: (el) => {\n // Both the target and its marker disappear, so return focus to the toggle (or the default if absent).\n if (popup.isOpen(el)) {\n popup.close(toggleEl ?? undefined);\n }\n markers.unmount(el);\n },\n });\n state.track(() => watcher.disconnect());\n\n const isLibraryElement = (target) =>\n !!target &&\n ((toggleEl ? toggleEl.contains(target) : false) ||\n popup.root.contains(target) ||\n (typeof target.closest === 'function' && !!target.closest('.help-layer-marker')));\n\n const layer = activateBlockingLayer(state, {\n toggleEl,\n onBackgroundClick: () => popup.close(),\n isLibraryElement,\n onEscape: () => {\n if (popup.getOpenId() !== null) {\n popup.close();\n } else {\n disable();\n }\n },\n });\n\n // Semantic blocking for assistive tech: remove the host from the a11y tree while ON (the layer/\n // popup/markers and the toggle stay reachable). Runs last so the just-mounted library nodes are\n // present and skipped by the initial scan.\n const isLibraryNode = (el) =>\n el === layer ||\n el === popup.root ||\n (!!el.classList && el.classList.contains('help-layer-marker'));\n isolateBackgroundFromAT(state, { toggleEl, isLibraryNode });\n }\n\n function turnOff() {\n if (state) {\n state.teardownAll();\n state = null;\n popup = null;\n markers = null;\n }\n }\n\n function enable() {\n if (state) {\n return;\n }\n turnOn();\n safeInvoke('onEnable', onEnable);\n }\n\n function disable() {\n if (!state) {\n return;\n }\n turnOff();\n safeInvoke('onDisable', onDisable);\n }\n\n function toggleMode() {\n if (state) {\n disable();\n } else {\n enable();\n }\n }\n\n // Open the description for a given key programmatically. When OFF, first enable() to create the markers.\n function openByKey(key) {\n if (!state) {\n enable();\n }\n if (!markers || !popup) {\n return;\n }\n const entry = markers.findByKey(key);\n if (!entry) {\n if (!silent) {\n console.warn(`[help-layer] open(): no help marker for key \"${key}\"`);\n }\n return;\n }\n popup.open(entry.record, entry.el);\n safeInvoke('onOpen', onOpen, entry.record);\n }\n\n // Close the open description (does not turn the mode itself OFF).\n function closePopup() {\n if (popup) {\n popup.close();\n }\n }\n\n // Replace the helpConfig. If ON, rebuild silently (onEnable/onDisable are not fired).\n function update(newConfig) {\n validateConfig(newConfig);\n activeConfig = newConfig;\n if (state) {\n turnOff();\n turnOn();\n }\n }\n\n if (toggleEl) {\n toggleEl.addEventListener('click', toggleMode);\n }\n\n return {\n enable,\n disable,\n toggle: toggleMode,\n isActive() {\n return state !== null;\n },\n open: openByKey,\n close: closePopup,\n update,\n destroy() {\n disable();\n if (toggleEl) {\n toggleEl.removeEventListener('click', toggleMode);\n }\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "8bAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,mBAAAE,KCwBO,SAASC,GAAwBC,EAAO,CAAE,SAAAC,EAAU,cAAAC,CAAc,EAAG,CAE1E,IAAMC,EAAW,IAAI,IAGrB,SAASC,EAAQC,EAAM,CACrB,GAAIA,EAAK,WAAa,EACpB,OAEF,IAAMC,EAA6BD,EAIjCH,EAAcI,CAAE,GACfL,IAAaK,IAAOL,GAAYK,EAAG,SAASL,CAAQ,IACrDK,EAAG,aAAa,OAAO,IAIzBA,EAAG,gBAAgB,QAAS,EAAI,EAChCH,EAAS,IAAIG,CAAE,EACjB,CAEA,QAAWC,IAAS,CAAC,GAAG,SAAS,KAAK,QAAQ,EAC5CH,EAAQG,CAAK,EAKf,IAAMC,EAAW,IAAI,iBAAkBC,GAAY,CACjD,QAAWC,KAAUD,EACnBC,EAAO,WAAW,QAAQN,CAAO,CAErC,CAAC,EACDI,EAAS,QAAQ,SAAS,KAAM,CAAE,UAAW,EAAK,CAAC,EAEnDR,EAAM,MAAM,IAAM,CAChBQ,EAAS,WAAW,EAEpBL,EAAS,QAASG,GAAOA,EAAG,gBAAgB,OAAO,CAAC,EACpDH,EAAS,MAAM,CACjB,CAAC,CACH,CCtDA,IAAIQ,GAAW,EAER,SAASC,IAAsB,CACpC,IAAMC,EAAQ,SAAS,cAAc,KAAK,EAC1C,OAAAA,EAAM,UAAY,4BACXA,CACT,CAMO,SAASC,GAAaC,EAAOC,EAAQ,IAAK,CAC/C,IAAMC,EAAS,SAAS,cAAc,QAAQ,EAC9C,OAAAA,EAAO,KAAO,SACdA,EAAO,UAAY,oBACnBA,E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Q,EACJ3B,GACFA,EAAS,oBAAoB,QAAS+B,CAAU,CAEpD,CACF,CACF,CnB9OO,SAASO,GAAcC,EAAS,CACrC,OAAOC,GAAuBD,CAAO,CACvC",
|
|
6
|
+
"names": ["index_exports", "__export", "initHelpLayer", "isolateBackgroundFromAT", "state", "toggleEl", "isLibraryNode", "isolated", "isolate", "node", "el", "child", "observer", "records", "record", "popupSeq", "createBlockingLayer", "layer", "createMarker", "title", "label", "marker", "createPopup", "titleId", "root", "titleEl", "textEl", "closeEl", "min", "max", "round", "floor", "createCoords", "v", "oppositeSideMap", "clamp", "start", "value", "end", "evaluate", "param", "getSide", "placement", "getAlignment", "getOppositeAxis", "axis", "getAxisLength", "getSideAxis", "firstChar", "getAlignmentAxis", "getAlignmentSides", "rects", "rtl", "alignment", "alignmentAxis", "length", "mainAlignmentSide", "getOppositePlacement", "getExpandedPlacements", "oppositePlacement", "getOppositeAlignmentPlacement", "lrPlacement", "rlPlacement", "tbPlacement", "btPlacement", "getSideList", "side", "isStart", "getOppositeAxisPlacements", "flipAlignment", "direction", "list", "expandPaddingObject", "padding", "getPaddingObject", "rectToClientRect", "rect", "x", "y", "width", "height", "computeCoordsFromPlacement", "_ref", "placement", "rtl", "reference", "floating", "sideAxis", "getSideAxis", "alignmentAxis", "getAlignmentAxis", "alignLength", "getAxisLength", "side", "getSide", "isVertical", "commonX", "commonY", "commonAlign", "coords", "getAlignment", "detectOverflow", "state", "options", "_await$platform$isEle", "x", "y", "platform", "rects", "elements", "strategy", "boundary", "rootBoundary", "elementContext", "altBoundary", "padding", "evaluate", "paddingObject", "getPaddingObject", "element", "clippingClientRect", "rectToClientRect", "rect", "offsetParent", "offsetScale", "elementClientRect", "MAX_RESET_COUNT", "computePosition", "config", "middleware", "platformWithDetectOverflow", "statefulPlacement", "resetCount", "middlewareData", "i", "currentMiddleware", "name", "fn", "nextX", "nextY", "data", "reset", "flip", "options", "state", "_middlewareData$arrow", "_middlewareData$flip", "placement", "middlewareData", "rects", "initialPlacement", "platform", "elements", "checkMainAxis", "checkCrossAxis", "specifiedFallbackPlacements", "fallbackStrategy", "fallbackAxisSideDirection", "flipAlignment", "detectOverflowOptions", "evaluate", "side", "getSide", "initialSideAxis", "getSideAxis", "isBasePlacement", "rtl", "fallbackPlacements", "getOppositePlacement", "getExpandedPlacements", "hasFallbackAxisSideDirection", "getOppositeAxisPlacements", "placements", "overflow", "overflows", "overflowsData", "sides", "getAlignmentSides", "_middlewareData$flip2", "_overflowsData$filter", "nextIndex", "nextPlacement", "d", "resetPlacement", "a", "b", "_overflowsData$filter2", "currentSideAxis", "acc", "originSides", "convertValueToCoords", "state", "options", "placement", "platform", "elements", "rtl", "side", "getSide", "alignment", "getAlignment", "isVertical", "getSideAxis", "mainAxisMulti", "crossAxisMulti", "rawValue", "evaluate", "mainAxis", "crossAxis", "alignmentAxis", "offset", "_middlewareData$offse", "_middlewareData$arrow", "x", "y", "middlewareData", "diffCoords", "shift", "checkMainAxis", "checkCrossAxis", "limiter", "_ref", "detectOverflowOptions", "coords", "overflow", "getOppositeAxis", "mainAxisCoord", "crossAxisCoord", "minSide", "maxSide", "min", "max", "clamp", "limitedCoords", "hasWindow", "getNodeName", "node", "isNode", "getWindow", "_node$ownerDocument", "getDocumentElement", "_ref", "value", "isElement", "isHTMLElement", "isShadowRoot", "isOverflowElement", "element", "overflow", "overflowX", "overflowY", "display", "getComputedStyle", "isTableElement", "isTopLayer", "willChangeRe", "containRe", "isNotNone", "isWebKitValue", "isContainingBlock", "elementOrCss", "css", "isWebKit", "getContainingBlock", "currentNode", "getParentNode", "isLastTraversableNode", "getNodeScroll", "result", "getNearestOverflowAncestor", "parentNode", "getOverflowAncestors", "list", "traverseIframes", "_node$ownerDocument2", "scrollableAncestor", "isBody", "win", "frameElement", "getFrameElement", "getCssDimensions", "element", "css", "getComputedStyle", "width", "height", "hasOffset", "isHTMLElement", "offsetWidth", "offsetHeight", "shouldFallback", "round", "unwrapElement", "isElement", "getScale", "domElement", "createCoords", "rect", "$", "x", "y", "noOffsets", "getVisualOffsets", "win", "getWindow", "isWebKit", "shouldAddVisualOffsets", "isFixed", "floatingOffsetParent", "getBoundingClientRect", "includeScale", "isFixedStrategy", "offsetParent", "clientRect", "scale", "visualOffsets", "offsetWin", "currentWin", "currentIFrame", "getFrameElement", "iframeScale", "iframeRect", "left", "top", "rectToClientRect", "getWindowScrollBarX", "leftScroll", "getNodeScroll", "getDocumentElement", "getHTMLOffset", "documentElement", "scroll", "htmlRect", "convertOffsetParentRelativeRectToViewportRelativeRect", "_ref", "elements", "strategy", "topLayer", "isTopLayer", "offsets", "isOffsetParentAnElement", "getNodeName", "isOverflowElement", "offsetRect", "htmlOffset", "getClientRects", "getDocumentRect", "html", "body", "max", "SCROLLBAR_MAX", "getViewportRect", "visualViewport", "visualViewportBased", "windowScrollbarX", "doc", "bodyStyles", "bodyMarginInline", "clippingStableScrollbarWidth", "getInnerBoundingClientRect", "getClientRectFromClippingAncestor", "clippingAncestor", "hasFixedPositionAncestor", "stopNode", "parentNode", "getParentNode", "isLastTraversableNode", "getClippingElementAncestors", "cache", "cachedResult", "result", "getOverflowAncestors", "el", "currentContainingBlockComputedStyle", "elementIsFixed", "currentNode", "computedStyle", "currentNodeIsContaining", "isContainingBlock", "ancestor", "getClippingRect", "boundary", "rootBoundary", "clippingAncestors", "firstRect", "right", "bottom", "i", "min", "getDimensions", "getRectRelativeToOffsetParent", "setLeftRTLScrollbarOffset", "isStaticPositioned", "getTrueOffsetParent", "polyfill", "rawOffsetParent", "getOffsetParent", "svgOffsetParent", "isTableElement", "getContainingBlock", "getElementRects", "data", "getOffsetParentFn", "getDimensionsFn", "floatingDimensions", "isRTL", "platform", "rectsAreEqual", "a", "b", "observeMove", "onMove", "io", "timeoutId", "root", "cleanup", "_io", "refresh", "skip", "threshold", "elementRectForRootMargin", "insetTop", "floor", "insetRight", "insetBottom", "insetLeft", "options", "isFirstUpdate", "handleObserve", "entries", "ratio", "autoUpdate", "reference", "floating", "update", "ancestorScroll", "ancestorResize", "elementResize", "layoutShift", "animationFrame", "referenceEl", "ancestors", "cleanupIo", "reobserveFrame", "resizeObserver", "firstEntry", "_resizeObserver", "frameId", "prevRefRect", "frameLoop", "nextRefRect", "_resizeObserver2", "offset", "shift", "flip", "computePosition", "reference", "floating", "options", "cache", "mergedOptions", "platform", "platformWithCache", "docRectToViewportRect", "docRect", "scroll", "width", "height", "left", "top", "makeVirtualElement", "getDocRect", "docRectToViewportRect", "place", "el", "x", "y", "isFixedReference", "reference", "node", "parent", "root", "isReferenceHidden", "r", "MARKER_INSET", "markerOffset", "placement", "isStart", "anchorMarker", "markerEl", "onPlaced", "onHidden", "strategy", "hiddenNow", "autoUpdate", "computePosition", "offset", "anchorPopup", "popupEl", "update", "flip", "shift", "cleanup", "watchReference", "referenceEl", "floatingEl", "onUpdate", "buildClipPath", "rect", "x1", "y1", "x2", "y2", "activateBlockingLayer", "state", "toggleEl", "onBackgroundClick", "isLibraryElement", "onEscape", "layer", "createBlockingLayer", "cleanupClipWatch", "watchReference", "activeEl", "handleFocusIn", "event", "blockNonLibrary", "blockKey", "handleKeydown", "isPlainObject", "value", "isValidPosition", "position", "validateConfig", "config", "key", "entry", "normalizeConfig", "resolveOverlaps", "centers", "options", "minDistance", "iterations", "positions", "c", "iter", "moved", "i", "j", "a", "b", "dx", "dy", "dist", "overlap", "ux", "uy", "p", "TARGET_HIGHLIGHT_CLASS", "referenceFor", "record", "makeVirtualElement", "createMarkerManager", "state", "onMarkerClick", "onOverlapResolved", "onMarkerHidden", "markerLabel", "markerPlacement", "markers", "rafId", "tornDown", "runOverlapPass", "entries", "e", "el", "centers", "r", "offsets", "resolveOverlaps", "i", "dx", "dy", "scheduleOverlapPass", "mount", "createMarker", "handleClick", "cleanupAnchor", "anchorMarker", "target", "addHighlight", "removeHighlight", "done", "cleanup", "unmount", "id", "entry", "mountAll", "records", "key", "safeInvoke", "label", "fn", "args", "err", "ELEMENT_NODE", "walkDeep", "root", "selector", "onMatch", "onShadowRoot", "el", "queryAllDeep", "results", "collectShadowRoots", "roots", "shadow", "scanSubtree", "node", "matches", "shadowRoots", "m", "createMutationWatcher", "onAdded", "onRemoved", "observed", "handle", "records", "record", "safeInvoke", "observe", "observer", "target", "TITLE_ATTR", "TEXT_ATTR", "targetSelector", "attribute", "elementConfigMap", "items", "map", "item", "freeRecords", "recordForElement", "el", "configMap", "key", "title", "text", "collectElementRecords", "root", "silent", "records", "queryAllDeep", "record", "createPopupController", "state", "onClose", "render", "popupPlacement", "root", "titleEl", "textEl", "closeEl", "createPopup", "close", "openId", "triggerEl", "anchor", "stopAnchor", "open", "record", "referenceEl", "custom", "safeInvoke", "anchorPopup", "reposition", "hide", "wasOpen", "focusTarget", "returnTo", "id", "createState", "cleanupFns", "fn", "cleanup", "err", "STYLE_ATTR", "CSS", "injectStyles", "nonce", "styleEl", "removeStyles", "resolveToggleElement", "toggle", "el", "createToggleController", "options", "isPlainObject", "config", "onEnable", "onDisable", "onOpen", "onClose", "silent", "attribute", "render", "markerLabel", "markerPlacement", "popupPlacement", "nonce", "activeConfig", "validateConfig", "toggleEl", "state", "popup", "markers", "turnOn", "createState", "styleEl", "injectStyles", "removeStyles", "items", "normalizeConfig", "configMap", "elementConfigMap", "createPopupController", "createMarkerManager", "record", "markerEl", "safeInvoke", "freeRecords", "collectElementRecords", "watcher", "createMutationWatcher", "targetSelector", "recordForElement", "layer", "activateBlockingLayer", "target", "disable", "isolateBackgroundFromAT", "turnOff", "enable", "toggleMode", "openByKey", "key", "entry", "closePopup", "update", "newConfig", "initHelpLayer", "options", "createToggleController"]
|
|
7
7
|
}
|