/******/ (function() { // webpackBootstrap /******/ "use strict"; /******/ var __webpack_modules__ = ({ /***/ "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; var _memoize = _interopRequireDefault(__webpack_require__(/*! @emotion/memoize */ "../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23 var index = (0, _memoize.default)(function (prop) { return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111 /* o */ && prop.charCodeAt(1) === 110 /* n */ && prop.charCodeAt(2) < 91; } /* Z+1 */); var _default = index; exports["default"] = _default; /***/ }), /***/ "../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js": /*!**************************************************************************!*\ !*** ../../../node_modules/@emotion/memoize/dist/memoize.browser.esm.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; function memoize(fn) { var cache = {}; return function (arg) { if (cache[arg] === undefined) cache[arg] = fn(arg); return cache[arg]; }; } var _default = memoize; exports["default"] = _default; /***/ }), /***/ "../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js ***! \****************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.computePosition = exports.autoPlacement = exports.arrow = void 0; exports.detectOverflow = detectOverflow; exports.offset = exports.limitShift = exports.inline = exports.hide = exports.flip = void 0; exports.rectToClientRect = rectToClientRect; exports.size = exports.shift = void 0; function getAlignment(placement) { return placement.split('-')[1]; } function getLengthFromAxis(axis) { return axis === 'y' ? 'height' : 'width'; } function getSide(placement) { return placement.split('-')[0]; } function getMainAxisFromPlacement(placement) { return ['top', 'bottom'].includes(getSide(placement)) ? 'x' : 'y'; } function computeCoordsFromPlacement(_ref, placement, rtl) { let { reference, floating } = _ref; const commonX = reference.x + reference.width / 2 - floating.width / 2; const commonY = reference.y + reference.height / 2 - floating.height / 2; const mainAxis = getMainAxisFromPlacement(placement); const length = getLengthFromAxis(mainAxis); const commonAlign = reference[length] / 2 - floating[length] / 2; const side = getSide(placement); const isVertical = mainAxis === 'x'; let coords; switch (side) { case 'top': coords = { x: commonX, y: reference.y - floating.height }; break; case 'bottom': coords = { x: commonX, y: reference.y + reference.height }; break; case 'right': coords = { x: reference.x + reference.width, y: commonY }; break; case 'left': coords = { x: reference.x - floating.width, y: commonY }; break; default: coords = { x: reference.x, y: reference.y }; } switch (getAlignment(placement)) { case 'start': coords[mainAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); break; case 'end': coords[mainAxis] += commonAlign * (rtl && isVertical ? -1 : 1); break; } return coords; } /** * Computes the `x` and `y` coordinates that will place the floating element * next to a reference element when it is given a certain positioning strategy. * * This export does not have any `platform` interface logic. You will need to * write one for the platform you are using Floating UI with. */ const computePosition = async (reference, floating, config) => { const { placement = 'bottom', strategy = 'absolute', middleware = [], platform } = config; const validMiddleware = middleware.filter(Boolean); const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating)); let rects = await platform.getElementRects({ reference, floating, strategy }); let { x, y } = computeCoordsFromPlacement(rects, placement, rtl); let statefulPlacement = placement; let middlewareData = {}; let resetCount = 0; for (let i = 0; i < validMiddleware.length; i++) { const { name, fn } = validMiddleware[i]; const { x: nextX, y: nextY, data, reset } = await fn({ x, y, initialPlacement: placement, placement: statefulPlacement, strategy, middlewareData, rects, platform, elements: { reference, floating } }); x = nextX != null ? nextX : x; y = nextY != null ? nextY : y; middlewareData = { ...middlewareData, [name]: { ...middlewareData[name], ...data } }; if (reset && resetCount <= 50) { resetCount++; if (typeof reset === 'object') { if (reset.placement) { statefulPlacement = reset.placement; } if (reset.rects) { rects = reset.rects === true ? await platform.getElementRects({ reference, floating, strategy }) : reset.rects; } ({ x, y } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); } i = -1; continue; } } return { x, y, placement: statefulPlacement, strategy, middlewareData }; }; exports.computePosition = computePosition; function evaluate(value, param) { return typeof value === 'function' ? value(param) : value; } function expandPaddingObject(padding) { return { top: 0, right: 0, bottom: 0, left: 0, ...padding }; } function getSideObjectFromPadding(padding) { return typeof padding !== 'number' ? expandPaddingObject(padding) : { top: padding, right: padding, bottom: padding, left: padding }; } function rectToClientRect(rect) { return { ...rect, top: rect.y, left: rect.x, right: rect.x + rect.width, bottom: rect.y + rect.height }; } /** * Resolves with an object of overflow side offsets that determine how much the * element is overflowing a given clipping boundary on each side. * - positive = overflowing the boundary by that number of pixels * - negative = how many pixels left before it will overflow * - 0 = lies flush with the boundary * @see https://floating-ui.com/docs/detectOverflow */ async function detectOverflow(state, options) { var _await$platform$isEle; if (options === void 0) { options = {}; } const { x, y, platform, rects, elements, strategy } = state; const { boundary = 'clippingAncestors', rootBoundary = 'viewport', elementContext = 'floating', altBoundary = false, padding = 0 } = evaluate(options, state); const paddingObject = getSideObjectFromPadding(padding); const altContext = elementContext === 'floating' ? 'reference' : 'floating'; const element = elements[altBoundary ? altContext : elementContext]; const clippingClientRect = rectToClientRect(await platform.getClippingRect({ 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))), boundary, rootBoundary, strategy })); const rect = elementContext === 'floating' ? { ...rects.floating, x, y } : rects.reference; const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating)); const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || { x: 1, y: 1 } : { x: 1, y: 1 }; const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({ rect, offsetParent, strategy }) : rect); return { top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x }; } const min = Math.min; const max = Math.max; function within(min$1, value, max$1) { return max(min$1, min(value, max$1)); } /** * Provides data to position an inner element of the floating element so that it * appears centered to the reference element. * @see https://floating-ui.com/docs/arrow */ const arrow = options => ({ name: 'arrow', options, async fn(state) { const { x, y, placement, rects, platform, elements } = state; // Since `element` is required, we don't Partial<> the type. const { element, padding = 0 } = evaluate(options, state) || {}; if (element == null) { return {}; } const paddingObject = getSideObjectFromPadding(padding); const coords = { x, y }; const axis = getMainAxisFromPlacement(placement); const length = getLengthFromAxis(axis); const arrowDimensions = await platform.getDimensions(element); const isYAxis = axis === 'y'; const minProp = isYAxis ? 'top' : 'left'; const maxProp = isYAxis ? 'bottom' : 'right'; const clientProp = isYAxis ? 'clientHeight' : 'clientWidth'; const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; const startDiff = coords[axis] - rects.reference[axis]; const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element)); let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0; // DOM platform can return `window` as the `offsetParent`. if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) { clientSize = elements.floating[clientProp] || rects.floating[length]; } const centerToReference = endDiff / 2 - startDiff / 2; // If the padding is large enough that it causes the arrow to no longer be // centered, modify the padding so that it is centered. const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; const minPadding = min(paddingObject[minProp], largestPossiblePadding); const maxPadding = min(paddingObject[maxProp], largestPossiblePadding); // Make sure the arrow doesn't overflow the floating element if the center // point is outside the floating element's bounds. const min$1 = minPadding; const max = clientSize - arrowDimensions[length] - maxPadding; const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; const offset = within(min$1, center, max); // If the reference is small enough that the arrow's padding causes it to // to point to nothing for an aligned placement, adjust the offset of the // floating element itself. This stops `shift()` from taking action, but can // be worked around by calling it again after the `arrow()` if desired. const shouldAddOffset = getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; const alignmentOffset = shouldAddOffset ? center < min$1 ? min$1 - center : max - center : 0; return { [axis]: coords[axis] - alignmentOffset, data: { [axis]: offset, centerOffset: center - offset } }; } }); exports.arrow = arrow; const sides = ['top', 'right', 'bottom', 'left']; const allPlacements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-start", side + "-end"), []); const oppositeSideMap = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; function getOppositePlacement(placement) { return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]); } function getAlignmentSides(placement, rects, rtl) { if (rtl === void 0) { rtl = false; } const alignment = getAlignment(placement); const mainAxis = getMainAxisFromPlacement(placement); const length = getLengthFromAxis(mainAxis); let mainAlignmentSide = mainAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top'; if (rects.reference[length] > rects.floating[length]) { mainAlignmentSide = getOppositePlacement(mainAlignmentSide); } return { main: mainAlignmentSide, cross: getOppositePlacement(mainAlignmentSide) }; } const oppositeAlignmentMap = { start: 'end', end: 'start' }; function getOppositeAlignmentPlacement(placement) { return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]); } function getPlacementList(alignment, autoAlignment, allowedPlacements) { const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement); return allowedPlacementsSortedByAlignment.filter(placement => { if (alignment) { return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false); } return true; }); } /** * Optimizes the visibility of the floating element by choosing the placement * that has the most space available automatically, without needing to specify a * preferred placement. Alternative to `flip`. * @see https://floating-ui.com/docs/autoPlacement */ const autoPlacement = function (options) { if (options === void 0) { options = {}; } return { name: 'autoPlacement', options, async fn(state) { var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE; const { rects, middlewareData, placement, platform, elements } = state; const { crossAxis = false, alignment, allowedPlacements = allPlacements, autoAlignment = true, ...detectOverflowOptions } = evaluate(options, state); const placements = alignment !== undefined || allowedPlacements === allPlacements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements; const overflow = await detectOverflow(state, detectOverflowOptions); const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0; const currentPlacement = placements[currentIndex]; if (currentPlacement == null) { return {}; } const { main, cross } = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))); // Make `computeCoords` start from the right place. if (placement !== currentPlacement) { return { reset: { placement: placements[0] } }; } const currentOverflows = [overflow[getSide(currentPlacement)], overflow[main], overflow[cross]]; const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), { placement: currentPlacement, overflows: currentOverflows }]; const nextPlacement = placements[currentIndex + 1]; // There are more placements to check. if (nextPlacement) { return { data: { index: currentIndex + 1, overflows: allOverflows }, reset: { placement: nextPlacement } }; } const placementsSortedByMostSpace = allOverflows.map(d => { const alignment = getAlignment(d.placement); return [d.placement, alignment && crossAxis ? // Check along the mainAxis and main crossAxis side. d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) : // Check only the mainAxis. d.overflows[0], d.overflows]; }).sort((a, b) => a[1] - b[1]); const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0, // Aligned placements should not check their opposite crossAxis // side. getAlignment(d[0]) ? 2 : 3).every(v => v <= 0)); const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0]; if (resetPlacement !== placement) { return { data: { index: currentIndex + 1, overflows: allOverflows }, reset: { placement: resetPlacement } }; } return {}; } }; }; exports.autoPlacement = autoPlacement; function getExpandedPlacements(placement) { const oppositePlacement = getOppositePlacement(placement); return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; } function getSideList(side, isStart, rtl) { const lr = ['left', 'right']; const rl = ['right', 'left']; const tb = ['top', 'bottom']; const bt = ['bottom', 'top']; switch (side) { case 'top': case 'bottom': if (rtl) return isStart ? rl : lr; return isStart ? lr : rl; case 'left': case 'right': return isStart ? tb : bt; default: return []; } } function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { const alignment = getAlignment(placement); let list = getSideList(getSide(placement), direction === 'start', rtl); if (alignment) { list = list.map(side => side + "-" + alignment); if (flipAlignment) { list = list.concat(list.map(getOppositeAlignmentPlacement)); } } return list; } /** * Optimizes the visibility of the floating element by flipping the `placement` * in order to keep it in view when the preferred placement(s) will overflow the * clipping boundary. Alternative to `autoPlacement`. * @see https://floating-ui.com/docs/flip */ const flip = function (options) { if (options === void 0) { options = {}; } return { name: 'flip', options, async fn(state) { var _middlewareData$flip; const { placement, middlewareData, rects, initialPlacement, platform, elements } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true, fallbackPlacements: specifiedFallbackPlacements, fallbackStrategy = 'bestFit', fallbackAxisSideDirection = 'none', flipAlignment = true, ...detectOverflowOptions } = evaluate(options, state); const side = getSide(placement); const isBasePlacement = getSide(initialPlacement) === initialPlacement; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') { fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); } const placements = [initialPlacement, ...fallbackPlacements]; const overflow = await detectOverflow(state, detectOverflowOptions); const overflows = []; let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; if (checkMainAxis) { overflows.push(overflow[side]); } if (checkCrossAxis) { const { main, cross } = getAlignmentSides(placement, rects, rtl); overflows.push(overflow[main], overflow[cross]); } overflowsData = [...overflowsData, { placement, overflows }]; // One or more sides is overflowing. if (!overflows.every(side => side <= 0)) { var _middlewareData$flip2, _overflowsData$filter; const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; const nextPlacement = placements[nextIndex]; if (nextPlacement) { // Try next placement and re-run the lifecycle. return { data: { index: nextIndex, overflows: overflowsData }, reset: { placement: nextPlacement } }; } // First, find the candidates that fit on the mainAxis side of overflow, // then find the placement that fits the best on the main crossAxis side. 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; // Otherwise fallback. if (!resetPlacement) { switch (fallbackStrategy) { case 'bestFit': { var _overflowsData$map$so; const placement = (_overflowsData$map$so = overflowsData.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$map$so[0]; if (placement) { resetPlacement = placement; } break; } case 'initialPlacement': resetPlacement = initialPlacement; break; } } if (placement !== resetPlacement) { return { reset: { placement: resetPlacement } }; } } return {}; } }; }; exports.flip = flip; function getSideOffsets(overflow, rect) { return { top: overflow.top - rect.height, right: overflow.right - rect.width, bottom: overflow.bottom - rect.height, left: overflow.left - rect.width }; } function isAnySideFullyClipped(overflow) { return sides.some(side => overflow[side] >= 0); } /** * Provides data to hide the floating element in applicable situations, such as * when it is not in the same clipping context as the reference element. * @see https://floating-ui.com/docs/hide */ const hide = function (options) { if (options === void 0) { options = {}; } return { name: 'hide', options, async fn(state) { const { rects } = state; const { strategy = 'referenceHidden', ...detectOverflowOptions } = evaluate(options, state); switch (strategy) { case 'referenceHidden': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, elementContext: 'reference' }); const offsets = getSideOffsets(overflow, rects.reference); return { data: { referenceHiddenOffsets: offsets, referenceHidden: isAnySideFullyClipped(offsets) } }; } case 'escaped': { const overflow = await detectOverflow(state, { ...detectOverflowOptions, altBoundary: true }); const offsets = getSideOffsets(overflow, rects.floating); return { data: { escapedOffsets: offsets, escaped: isAnySideFullyClipped(offsets) } }; } default: { return {}; } } } }; }; exports.hide = hide; function getBoundingRect(rects) { const minX = min(...rects.map(rect => rect.left)); const minY = min(...rects.map(rect => rect.top)); const maxX = max(...rects.map(rect => rect.right)); const maxY = max(...rects.map(rect => rect.bottom)); return { x: minX, y: minY, width: maxX - minX, height: maxY - minY }; } function getRectsByLine(rects) { const sortedRects = rects.slice().sort((a, b) => a.y - b.y); const groups = []; let prevRect = null; for (let i = 0; i < sortedRects.length; i++) { const rect = sortedRects[i]; if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) { groups.push([rect]); } else { groups[groups.length - 1].push(rect); } prevRect = rect; } return groups.map(rect => rectToClientRect(getBoundingRect(rect))); } /** * Provides improved positioning for inline reference elements that can span * over multiple lines, such as hyperlinks or range selections. * @see https://floating-ui.com/docs/inline */ const inline = function (options) { if (options === void 0) { options = {}; } return { name: 'inline', options, async fn(state) { const { placement, elements, rects, platform, strategy } = state; // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a // ClientRect's bounds, despite the event listener being triggered. A // padding of 2 seems to handle this issue. const { padding = 2, x, y } = evaluate(options, state); const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []); const clientRects = getRectsByLine(nativeClientRects); const fallback = rectToClientRect(getBoundingRect(nativeClientRects)); const paddingObject = getSideObjectFromPadding(padding); function getBoundingClientRect() { // There are two rects and they are disjoined. if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) { // Find the first rect in which the point is fully inside. 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; } // There are 2 or more connected rects. if (clientRects.length >= 2) { if (getMainAxisFromPlacement(placement) === 'x') { const firstRect = clientRects[0]; const lastRect = clientRects[clientRects.length - 1]; const isTop = getSide(placement) === 'top'; const top = firstRect.top; const bottom = lastRect.bottom; const left = isTop ? firstRect.left : lastRect.left; const right = isTop ? firstRect.right : lastRect.right; const width = right - left; const height = bottom - top; return { top, bottom, left, right, width, height, x: left, y: top }; } const isLeftSide = getSide(placement) === 'left'; const maxRight = max(...clientRects.map(rect => rect.right)); const minLeft = min(...clientRects.map(rect => rect.left)); const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight); const top = measureRects[0].top; const bottom = measureRects[measureRects.length - 1].bottom; const left = minLeft; const right = maxRight; const width = right - left; const height = bottom - top; return { top, bottom, left, right, width, height, x: left, y: top }; } return fallback; } const resetRects = await platform.getElementRects({ reference: { getBoundingClientRect }, floating: elements.floating, strategy }); 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) { return { reset: { rects: resetRects } }; } return {}; } }; }; exports.inline = inline; async function convertValueToCoords(state, options) { const { placement, platform, elements } = state; const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)); const side = getSide(placement); const alignment = getAlignment(placement); const isVertical = getMainAxisFromPlacement(placement) === 'x'; const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1; const crossAxisMulti = rtl && isVertical ? -1 : 1; const rawValue = evaluate(options, state); // eslint-disable-next-line prefer-const let { mainAxis, crossAxis, alignmentAxis } = typeof rawValue === 'number' ? { mainAxis: rawValue, crossAxis: 0, alignmentAxis: null } : { mainAxis: 0, crossAxis: 0, alignmentAxis: null, ...rawValue }; if (alignment && typeof alignmentAxis === 'number') { crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis; } return isVertical ? { x: crossAxis * crossAxisMulti, y: mainAxis * mainAxisMulti } : { x: mainAxis * mainAxisMulti, y: crossAxis * crossAxisMulti }; } /** * Modifies the placement by translating the floating element along the * specified axes. * A number (shorthand for `mainAxis` or distance), or an axes configuration * object may be passed. * @see https://floating-ui.com/docs/offset */ const offset = function (options) { if (options === void 0) { options = 0; } return { name: 'offset', options, async fn(state) { const { x, y } = state; const diffCoords = await convertValueToCoords(state, options); return { x: x + diffCoords.x, y: y + diffCoords.y, data: diffCoords }; } }; }; exports.offset = offset; function getCrossAxis(axis) { return axis === 'x' ? 'y' : 'x'; } /** * Optimizes the visibility of the floating element by shifting it in order to * keep it in view when it will overflow the clipping boundary. * @see https://floating-ui.com/docs/shift */ const shift = function (options) { if (options === void 0) { options = {}; } return { name: 'shift', options, async fn(state) { const { x, y, placement } = state; const { mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = false, limiter = { fn: _ref => { let { x, y } = _ref; return { x, y }; } }, ...detectOverflowOptions } = evaluate(options, state); const coords = { x, y }; const overflow = await detectOverflow(state, detectOverflowOptions); const mainAxis = getMainAxisFromPlacement(getSide(placement)); const crossAxis = getCrossAxis(mainAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; if (checkMainAxis) { const minSide = mainAxis === 'y' ? 'top' : 'left'; const maxSide = mainAxis === 'y' ? 'bottom' : 'right'; const min = mainAxisCoord + overflow[minSide]; const max = mainAxisCoord - overflow[maxSide]; mainAxisCoord = within(min, mainAxisCoord, max); } if (checkCrossAxis) { const minSide = crossAxis === 'y' ? 'top' : 'left'; const maxSide = crossAxis === 'y' ? 'bottom' : 'right'; const min = crossAxisCoord + overflow[minSide]; const max = crossAxisCoord - overflow[maxSide]; crossAxisCoord = within(min, crossAxisCoord, max); } const limitedCoords = limiter.fn({ ...state, [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }); return { ...limitedCoords, data: { x: limitedCoords.x - x, y: limitedCoords.y - y } }; } }; }; /** * Built-in `limiter` that will stop `shift()` at a certain point. */ exports.shift = shift; const limitShift = function (options) { if (options === void 0) { options = {}; } return { options, fn(state) { const { x, y, placement, rects, middlewareData } = state; const { offset = 0, mainAxis: checkMainAxis = true, crossAxis: checkCrossAxis = true } = evaluate(options, state); const coords = { x, y }; const mainAxis = getMainAxisFromPlacement(placement); const crossAxis = getCrossAxis(mainAxis); let mainAxisCoord = coords[mainAxis]; let crossAxisCoord = coords[crossAxis]; const rawOffset = evaluate(offset, state); const computedOffset = typeof rawOffset === 'number' ? { mainAxis: rawOffset, crossAxis: 0 } : { mainAxis: 0, crossAxis: 0, ...rawOffset }; if (checkMainAxis) { const len = mainAxis === 'y' ? 'height' : 'width'; const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; if (mainAxisCoord < limitMin) { mainAxisCoord = limitMin; } else if (mainAxisCoord > limitMax) { mainAxisCoord = limitMax; } } if (checkCrossAxis) { var _middlewareData$offse, _middlewareData$offse2; const len = mainAxis === 'y' ? 'width' : 'height'; const isOriginSide = ['top', 'left'].includes(getSide(placement)); 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); 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); if (crossAxisCoord < limitMin) { crossAxisCoord = limitMin; } else if (crossAxisCoord > limitMax) { crossAxisCoord = limitMax; } } return { [mainAxis]: mainAxisCoord, [crossAxis]: crossAxisCoord }; } }; }; /** * Provides data that allows you to change the size of the floating element — * for instance, prevent it from overflowing the clipping boundary or match the * width of the reference element. * @see https://floating-ui.com/docs/size */ exports.limitShift = limitShift; const size = function (options) { if (options === void 0) { options = {}; } return { name: 'size', options, async fn(state) { const { placement, rects, platform, elements } = state; const { apply = () => {}, ...detectOverflowOptions } = evaluate(options, state); const overflow = await detectOverflow(state, detectOverflowOptions); const side = getSide(placement); const alignment = getAlignment(placement); const axis = getMainAxisFromPlacement(placement); const isXAxis = axis === 'x'; const { width, height } = rects.floating; let heightSide; let widthSide; if (side === 'top' || side === 'bottom') { heightSide = side; widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right'; } else { widthSide = side; heightSide = alignment === 'end' ? 'top' : 'bottom'; } const overflowAvailableHeight = height - overflow[heightSide]; const overflowAvailableWidth = width - overflow[widthSide]; const noShift = !state.middlewareData.shift; let availableHeight = overflowAvailableHeight; let availableWidth = overflowAvailableWidth; if (isXAxis) { const maximumClippingWidth = width - overflow.left - overflow.right; availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth; } else { const maximumClippingHeight = height - overflow.top - overflow.bottom; availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight; } if (noShift && !alignment) { const xMin = max(overflow.left, 0); const xMax = max(overflow.right, 0); const yMin = max(overflow.top, 0); const yMax = max(overflow.bottom, 0); if (isXAxis) { availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); } else { availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); } } await apply({ ...state, availableWidth, availableHeight }); const nextDimensions = await platform.getDimensions(elements.floating); if (width !== nextDimensions.width || height !== nextDimensions.height) { return { reset: { rects: true } }; } return {}; } }; }; exports.size = size; /***/ }), /***/ "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js": /*!**************************************************************************!*\ !*** ../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "arrow", ({ enumerable: true, get: function () { return _core.arrow; } })); Object.defineProperty(exports, "autoPlacement", ({ enumerable: true, get: function () { return _core.autoPlacement; } })); exports.autoUpdate = autoUpdate; exports.computePosition = void 0; Object.defineProperty(exports, "detectOverflow", ({ enumerable: true, get: function () { return _core.detectOverflow; } })); Object.defineProperty(exports, "flip", ({ enumerable: true, get: function () { return _core.flip; } })); exports.getOverflowAncestors = getOverflowAncestors; Object.defineProperty(exports, "hide", ({ enumerable: true, get: function () { return _core.hide; } })); Object.defineProperty(exports, "inline", ({ enumerable: true, get: function () { return _core.inline; } })); Object.defineProperty(exports, "limitShift", ({ enumerable: true, get: function () { return _core.limitShift; } })); Object.defineProperty(exports, "offset", ({ enumerable: true, get: function () { return _core.offset; } })); exports.platform = void 0; Object.defineProperty(exports, "shift", ({ enumerable: true, get: function () { return _core.shift; } })); Object.defineProperty(exports, "size", ({ enumerable: true, get: function () { return _core.size; } })); var _core = __webpack_require__(/*! @floating-ui/core */ "../../../node_modules/@floating-ui/core/dist/floating-ui.core.esm.js"); function getWindow(node) { var _node$ownerDocument; return ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; } function getComputedStyle$1(element) { return getWindow(element).getComputedStyle(element); } function isNode(value) { return value instanceof getWindow(value).Node; } function getNodeName(node) { return isNode(node) ? (node.nodeName || '').toLowerCase() : ''; } function isHTMLElement(value) { return value instanceof getWindow(value).HTMLElement; } function isElement(value) { return value instanceof getWindow(value).Element; } function isShadowRoot(node) { // Browsers without `ShadowRoot` support. if (typeof ShadowRoot === 'undefined') { return false; } const OwnElement = getWindow(node).ShadowRoot; return node instanceof OwnElement || node instanceof ShadowRoot; } function isOverflowElement(element) { const { overflow, overflowX, overflowY, display } = getComputedStyle$1(element); return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display); } function isTableElement(element) { return ['table', 'td', 'th'].includes(getNodeName(element)); } function isContainingBlock(element) { const safari = isSafari(); const css = getComputedStyle$1(element); // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block return css.transform !== 'none' || css.perspective !== 'none' || !safari && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !safari && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value)); } function isSafari() { if (typeof CSS === 'undefined' || !CSS.supports) return false; return CSS.supports('-webkit-backdrop-filter', 'none'); } function isLastTraversableNode(node) { return ['html', 'body', '#document'].includes(getNodeName(node)); } const min = Math.min; const max = Math.max; const round = Math.round; function getCssDimensions(element) { const css = getComputedStyle$1(element); // In testing environments, the `width` and `height` properties are empty // strings for SVG elements, returning NaN. Fallback to `0` in this case. let width = parseFloat(css.width) || 0; let height = parseFloat(css.height) || 0; const hasOffset = isHTMLElement(element); const offsetWidth = hasOffset ? element.offsetWidth : width; const offsetHeight = hasOffset ? element.offsetHeight : height; const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; if (shouldFallback) { width = offsetWidth; height = offsetHeight; } return { width, height, fallback: shouldFallback }; } function unwrapElement(element) { return !isElement(element) ? element.contextElement : element; } const FALLBACK_SCALE = { x: 1, y: 1 }; function getScale(element) { const domElement = unwrapElement(element); if (!isHTMLElement(domElement)) { return FALLBACK_SCALE; } const rect = domElement.getBoundingClientRect(); const { width, height, fallback } = getCssDimensions(domElement); let x = (fallback ? round(rect.width) : rect.width) / width; let y = (fallback ? round(rect.height) : rect.height) / height; // 0, NaN, or Infinity should always fallback to 1. if (!x || !Number.isFinite(x)) { x = 1; } if (!y || !Number.isFinite(y)) { y = 1; } return { x, y }; } const noOffsets = { x: 0, y: 0 }; function getVisualOffsets(element, isFixed, floatingOffsetParent) { var _win$visualViewport, _win$visualViewport2; if (isFixed === void 0) { isFixed = true; } if (!isSafari()) { return noOffsets; } const win = element ? getWindow(element) : window; if (!floatingOffsetParent || isFixed && floatingOffsetParent !== win) { return noOffsets; } return { x: ((_win$visualViewport = win.visualViewport) == null ? void 0 : _win$visualViewport.offsetLeft) || 0, y: ((_win$visualViewport2 = win.visualViewport) == null ? void 0 : _win$visualViewport2.offsetTop) || 0 }; } function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { if (includeScale === void 0) { includeScale = false; } if (isFixedStrategy === void 0) { isFixedStrategy = false; } const clientRect = element.getBoundingClientRect(); const domElement = unwrapElement(element); let scale = FALLBACK_SCALE; if (includeScale) { if (offsetParent) { if (isElement(offsetParent)) { scale = getScale(offsetParent); } } else { scale = getScale(element); } } const visualOffsets = getVisualOffsets(domElement, isFixedStrategy, offsetParent); let x = (clientRect.left + visualOffsets.x) / scale.x; let y = (clientRect.top + visualOffsets.y) / scale.y; let width = clientRect.width / scale.x; let height = clientRect.height / scale.y; if (domElement) { const win = getWindow(domElement); const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; let currentIFrame = win.frameElement; while (currentIFrame && offsetParent && offsetWin !== win) { const iframeScale = getScale(currentIFrame); const iframeRect = currentIFrame.getBoundingClientRect(); const css = getComputedStyle(currentIFrame); iframeRect.x += (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; iframeRect.y += (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; x *= iframeScale.x; y *= iframeScale.y; width *= iframeScale.x; height *= iframeScale.y; x += iframeRect.x; y += iframeRect.y; currentIFrame = getWindow(currentIFrame).frameElement; } } return (0, _core.rectToClientRect)({ width, height, x, y }); } function getDocumentElement(node) { return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement; } function getNodeScroll(element) { if (isElement(element)) { return { scrollLeft: element.scrollLeft, scrollTop: element.scrollTop }; } return { scrollLeft: element.pageXOffset, scrollTop: element.pageYOffset }; } function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { let { rect, offsetParent, strategy } = _ref; const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); if (offsetParent === documentElement) { return rect; } let scroll = { scrollLeft: 0, scrollTop: 0 }; let scale = { x: 1, y: 1 }; const offsets = { x: 0, y: 0 }; if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent); scale = getScale(offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } } return { width: rect.width * scale.x, height: rect.height * scale.y, x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x, y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y }; } function getWindowScrollBarX(element) { // If has a CSS width greater than the viewport, then this will be // incorrect for RTL. return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft; } // Gets the entire size of the scrollable document area, even extending outside // of the `` and `` rect bounds if horizontally scrollable. function getDocumentRect(element) { const html = getDocumentElement(element); const scroll = getNodeScroll(element); const body = element.ownerDocument.body; const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); let x = -scroll.scrollLeft + getWindowScrollBarX(element); const y = -scroll.scrollTop; if (getComputedStyle$1(body).direction === 'rtl') { x += max(html.clientWidth, body.clientWidth) - width; } return { width, height, x, y }; } function getParentNode(node) { if (getNodeName(node) === 'html') { return node; } const result = // Step into the shadow DOM of the parent of a slotted node. node.assignedSlot || // DOM Element detected. node.parentNode || // ShadowRoot detected. isShadowRoot(node) && node.host || // Fallback. getDocumentElement(node); return isShadowRoot(result) ? result.host : result; } function getNearestOverflowAncestor(node) { const parentNode = getParentNode(node); if (isLastTraversableNode(parentNode)) { // `getParentNode` will never return a `Document` due to the fallback // check, so it's either the or element. return parentNode.ownerDocument.body; } if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { return parentNode; } return getNearestOverflowAncestor(parentNode); } function getOverflowAncestors(node, list) { var _node$ownerDocument; if (list === void 0) { list = []; } const scrollableAncestor = getNearestOverflowAncestor(node); const isBody = scrollableAncestor === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body); const win = getWindow(scrollableAncestor); if (isBody) { return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []); } return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor)); } function getViewportRect(element, strategy) { const win = getWindow(element); const html = getDocumentElement(element); const visualViewport = win.visualViewport; let width = html.clientWidth; let height = html.clientHeight; let x = 0; let y = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; const visualViewportBased = isSafari(); if (!visualViewportBased || visualViewportBased && strategy === 'fixed') { x = visualViewport.offsetLeft; y = visualViewport.offsetTop; } } return { width, height, x, y }; } // Returns the inner client rect, subtracting scrollbars if present. function getInnerBoundingClientRect(element, strategy) { const clientRect = getBoundingClientRect(element, true, strategy === 'fixed'); const top = clientRect.top + element.clientTop; const left = clientRect.left + element.clientLeft; const scale = isHTMLElement(element) ? getScale(element) : { x: 1, y: 1 }; const width = element.clientWidth * scale.x; const height = element.clientHeight * scale.y; const x = left * scale.x; const y = top * scale.y; return { width, height, x, y }; } function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { let rect; if (clippingAncestor === 'viewport') { rect = getViewportRect(element, strategy); } else if (clippingAncestor === 'document') { rect = getDocumentRect(getDocumentElement(element)); } else if (isElement(clippingAncestor)) { rect = getInnerBoundingClientRect(clippingAncestor, strategy); } else { const visualOffsets = getVisualOffsets(element); rect = { ...clippingAncestor, x: clippingAncestor.x - visualOffsets.x, y: clippingAncestor.y - visualOffsets.y }; } return (0, _core.rectToClientRect)(rect); } function hasFixedPositionAncestor(element, stopNode) { const parentNode = getParentNode(element); if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { return false; } return getComputedStyle$1(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode); } // A "clipping ancestor" is an `overflow` element with the characteristic of // clipping (or hiding) child elements. This returns all clipping ancestors // of the given element up the tree. function getClippingElementAncestors(element, cache) { const cachedResult = cache.get(element); if (cachedResult) { return cachedResult; } let result = getOverflowAncestors(element).filter(el => isElement(el) && getNodeName(el) !== 'body'); let currentContainingBlockComputedStyle = null; const elementIsFixed = getComputedStyle$1(element).position === 'fixed'; let currentNode = elementIsFixed ? getParentNode(element) : element; // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { const computedStyle = getComputedStyle$1(currentNode); const currentNodeIsContaining = isContainingBlock(currentNode); if (!currentNodeIsContaining && computedStyle.position === 'fixed') { currentContainingBlockComputedStyle = null; } const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); if (shouldDropCurrentNode) { // Drop non-containing blocks. result = result.filter(ancestor => ancestor !== currentNode); } else { // Record last containing block for next iteration. currentContainingBlockComputedStyle = computedStyle; } currentNode = getParentNode(currentNode); } cache.set(element, result); return result; } // Gets the maximum area that the element is visible in due to any number of // clipping ancestors. function getClippingRect(_ref) { let { element, boundary, rootBoundary, strategy } = _ref; const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary); const clippingAncestors = [...elementClippingAncestors, rootBoundary]; const firstClippingAncestor = clippingAncestors[0]; const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => { const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy); accRect.top = max(rect.top, accRect.top); accRect.right = min(rect.right, accRect.right); accRect.bottom = min(rect.bottom, accRect.bottom); accRect.left = max(rect.left, accRect.left); return accRect; }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy)); return { width: clippingRect.right - clippingRect.left, height: clippingRect.bottom - clippingRect.top, x: clippingRect.left, y: clippingRect.top }; } function getDimensions(element) { return getCssDimensions(element); } function getTrueOffsetParent(element, polyfill) { if (!isHTMLElement(element) || getComputedStyle$1(element).position === 'fixed') { return null; } if (polyfill) { return polyfill(element); } return element.offsetParent; } function getContainingBlock(element) { let currentNode = getParentNode(element); while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { if (isContainingBlock(currentNode)) { return currentNode; } else { currentNode = getParentNode(currentNode); } } return null; } // Gets the closest ancestor positioned element. Handles some edge cases, // such as table ancestors and cross browser bugs. function getOffsetParent(element, polyfill) { const window = getWindow(element); if (!isHTMLElement(element)) { return window; } let offsetParent = getTrueOffsetParent(element, polyfill); while (offsetParent && isTableElement(offsetParent) && getComputedStyle$1(offsetParent).position === 'static') { offsetParent = getTrueOffsetParent(offsetParent, polyfill); } if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle$1(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) { return window; } return offsetParent || getContainingBlock(element) || window; } function getRectRelativeToOffsetParent(element, offsetParent, strategy) { const isOffsetParentAnElement = isHTMLElement(offsetParent); const documentElement = getDocumentElement(offsetParent); const isFixed = strategy === 'fixed'; const rect = getBoundingClientRect(element, true, isFixed, offsetParent); let scroll = { scrollLeft: 0, scrollTop: 0 }; const offsets = { x: 0, y: 0 }; if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) { scroll = getNodeScroll(offsetParent); } if (isHTMLElement(offsetParent)) { const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); offsets.x = offsetRect.x + offsetParent.clientLeft; offsets.y = offsetRect.y + offsetParent.clientTop; } else if (documentElement) { offsets.x = getWindowScrollBarX(documentElement); } } return { x: rect.left + scroll.scrollLeft - offsets.x, y: rect.top + scroll.scrollTop - offsets.y, width: rect.width, height: rect.height }; } const platform = { getClippingRect, convertOffsetParentRelativeRectToViewportRelativeRect, isElement, getDimensions, getOffsetParent, getDocumentElement, getScale, async getElementRects(_ref) { let { reference, floating, strategy } = _ref; const getOffsetParentFn = this.getOffsetParent || getOffsetParent; const getDimensionsFn = this.getDimensions; return { reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy), floating: { x: 0, y: 0, ...(await getDimensionsFn(floating)) } }; }, getClientRects: element => Array.from(element.getClientRects()), isRTL: element => getComputedStyle$1(element).direction === 'rtl' }; /** * Automatically updates the position of the floating element when necessary. * Should only be called when the floating element is mounted on the DOM or * visible on the screen. * @returns cleanup function that should be invoked when the floating element is * removed from the DOM or hidden from the screen. * @see https://floating-ui.com/docs/autoUpdate */ exports.platform = platform; function autoUpdate(reference, floating, update, options) { if (options === void 0) { options = {}; } const { ancestorScroll = true, ancestorResize = true, elementResize = true, animationFrame = false } = options; const ancestors = ancestorScroll || ancestorResize ? [...(isElement(reference) ? getOverflowAncestors(reference) : reference.contextElement ? getOverflowAncestors(reference.contextElement) : []), ...getOverflowAncestors(floating)] : []; ancestors.forEach(ancestor => { // ignores Window, checks for [object VisualViewport] const isVisualViewport = !isElement(ancestor) && ancestor.toString().includes('V'); if (ancestorScroll && (animationFrame ? isVisualViewport : true)) { ancestor.addEventListener('scroll', update, { passive: true }); } ancestorResize && ancestor.addEventListener('resize', update); }); let observer = null; if (elementResize) { observer = new ResizeObserver(() => { update(); }); isElement(reference) && !animationFrame && observer.observe(reference); if (!isElement(reference) && reference.contextElement && !animationFrame) { observer.observe(reference.contextElement); } observer.observe(floating); } let frameId; let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; if (animationFrame) { frameLoop(); } function frameLoop() { const nextRefRect = getBoundingClientRect(reference); if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) { update(); } prevRefRect = nextRefRect; frameId = requestAnimationFrame(frameLoop); } update(); return () => { var _observer; ancestors.forEach(ancestor => { ancestorScroll && ancestor.removeEventListener('scroll', update); ancestorResize && ancestor.removeEventListener('resize', update); }); (_observer = observer) == null ? void 0 : _observer.disconnect(); observer = null; if (animationFrame) { cancelAnimationFrame(frameId); } }; } /** * Computes the `x` and `y` coordinates that will place the floating element * next to a reference element when it is given a certain CSS positioning * strategy. */ const computePosition = (reference, floating, options) => { // This caches the expensive `getClippingElementAncestors` function so that // multiple lifecycle resets re-use the same result. It only lives for a // single call. If other functions become expensive, we can add them as well. const cache = new Map(); const mergedOptions = { platform, ...options }; const platformWithCache = { ...mergedOptions.platform, _c: cache }; return (0, _core.computePosition)(reference, floating, { ...mergedOptions, platform: platformWithCache }); }; exports.computePosition = computePosition; /***/ }), /***/ "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.arrow = void 0; Object.defineProperty(exports, "autoPlacement", ({ enumerable: true, get: function () { return _dom.autoPlacement; } })); Object.defineProperty(exports, "autoUpdate", ({ enumerable: true, get: function () { return _dom.autoUpdate; } })); Object.defineProperty(exports, "computePosition", ({ enumerable: true, get: function () { return _dom.computePosition; } })); Object.defineProperty(exports, "detectOverflow", ({ enumerable: true, get: function () { return _dom.detectOverflow; } })); Object.defineProperty(exports, "flip", ({ enumerable: true, get: function () { return _dom.flip; } })); Object.defineProperty(exports, "getOverflowAncestors", ({ enumerable: true, get: function () { return _dom.getOverflowAncestors; } })); Object.defineProperty(exports, "hide", ({ enumerable: true, get: function () { return _dom.hide; } })); Object.defineProperty(exports, "inline", ({ enumerable: true, get: function () { return _dom.inline; } })); Object.defineProperty(exports, "limitShift", ({ enumerable: true, get: function () { return _dom.limitShift; } })); Object.defineProperty(exports, "offset", ({ enumerable: true, get: function () { return _dom.offset; } })); Object.defineProperty(exports, "platform", ({ enumerable: true, get: function () { return _dom.platform; } })); Object.defineProperty(exports, "shift", ({ enumerable: true, get: function () { return _dom.shift; } })); Object.defineProperty(exports, "size", ({ enumerable: true, get: function () { return _dom.size; } })); exports.useFloating = useFloating; var _dom = __webpack_require__(/*! @floating-ui/dom */ "../../../node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js"); var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /** * Provides data to position an inner element of the floating element so that it * appears centered to the reference element. * This wraps the core `arrow` middleware to allow React refs as the element. * @see https://floating-ui.com/docs/arrow */ const arrow = options => { function isRef(value) { return {}.hasOwnProperty.call(value, 'current'); } return { name: 'arrow', options, fn(state) { const { element, padding } = typeof options === 'function' ? options(state) : options; if (element && isRef(element)) { if (element.current != null) { return (0, _dom.arrow)({ element: element.current, padding }).fn(state); } return {}; } else if (element) { return (0, _dom.arrow)({ element, padding }).fn(state); } return {}; } }; }; exports.arrow = arrow; var index = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect; // Fork of `fast-deep-equal` that only does the comparisons we need and compares // functions function deepEqual(a, b) { if (a === b) { return true; } if (typeof a !== typeof b) { return false; } if (typeof a === 'function' && a.toString() === b.toString()) { return true; } let length, i, keys; if (a && b && typeof a == 'object') { if (Array.isArray(a)) { length = a.length; if (length != b.length) return false; for (i = length; i-- !== 0;) { if (!deepEqual(a[i], b[i])) { return false; } } return true; } keys = Object.keys(a); length = keys.length; if (length !== Object.keys(b).length) { return false; } for (i = length; i-- !== 0;) { if (!{}.hasOwnProperty.call(b, keys[i])) { return false; } } for (i = length; i-- !== 0;) { const key = keys[i]; if (key === '_owner' && a.$$typeof) { continue; } if (!deepEqual(a[key], b[key])) { return false; } } return true; } return a !== a && b !== b; } function getDPR(element) { if (typeof window === 'undefined') { return 1; } const win = element.ownerDocument.defaultView || window; return win.devicePixelRatio || 1; } function roundByDPR(element, value) { const dpr = getDPR(element); return Math.round(value * dpr) / dpr; } function useLatestRef(value) { const ref = React.useRef(value); index(() => { ref.current = value; }); return ref; } /** * Provides data to position a floating element. * @see https://floating-ui.com/docs/react */ function useFloating(options) { if (options === void 0) { options = {}; } const { placement = 'bottom', strategy = 'absolute', middleware = [], platform, elements: { reference: externalReference, floating: externalFloating } = {}, transform = true, whileElementsMounted, open } = options; const [data, setData] = React.useState({ x: 0, y: 0, strategy, placement, middlewareData: {}, isPositioned: false }); const [latestMiddleware, setLatestMiddleware] = React.useState(middleware); if (!deepEqual(latestMiddleware, middleware)) { setLatestMiddleware(middleware); } const [_reference, _setReference] = React.useState(null); const [_floating, _setFloating] = React.useState(null); const setReference = React.useCallback(node => { if (node != referenceRef.current) { referenceRef.current = node; _setReference(node); } }, [_setReference]); const setFloating = React.useCallback(node => { if (node !== floatingRef.current) { floatingRef.current = node; _setFloating(node); } }, [_setFloating]); const referenceEl = externalReference || _reference; const floatingEl = externalFloating || _floating; const referenceRef = React.useRef(null); const floatingRef = React.useRef(null); const dataRef = React.useRef(data); const whileElementsMountedRef = useLatestRef(whileElementsMounted); const platformRef = useLatestRef(platform); const update = React.useCallback(() => { if (!referenceRef.current || !floatingRef.current) { return; } const config = { placement, strategy, middleware: latestMiddleware }; if (platformRef.current) { config.platform = platformRef.current; } (0, _dom.computePosition)(referenceRef.current, floatingRef.current, config).then(data => { const fullData = { ...data, isPositioned: true }; if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { dataRef.current = fullData; ReactDOM.flushSync(() => { setData(fullData); }); } }); }, [latestMiddleware, placement, strategy, platformRef]); index(() => { if (open === false && dataRef.current.isPositioned) { dataRef.current.isPositioned = false; setData(data => ({ ...data, isPositioned: false })); } }, [open]); const isMountedRef = React.useRef(false); index(() => { isMountedRef.current = true; return () => { isMountedRef.current = false; }; }, []); index(() => { if (referenceEl) referenceRef.current = referenceEl; if (floatingEl) floatingRef.current = floatingEl; if (referenceEl && floatingEl) { if (whileElementsMountedRef.current) { return whileElementsMountedRef.current(referenceEl, floatingEl, update); } else { update(); } } }, [referenceEl, floatingEl, update, whileElementsMountedRef]); const refs = React.useMemo(() => ({ reference: referenceRef, floating: floatingRef, setReference, setFloating }), [setReference, setFloating]); const elements = React.useMemo(() => ({ reference: referenceEl, floating: floatingEl }), [referenceEl, floatingEl]); const floatingStyles = React.useMemo(() => { const initialStyles = { position: strategy, left: 0, top: 0 }; if (!elements.floating) { return initialStyles; } const x = roundByDPR(elements.floating, data.x); const y = roundByDPR(elements.floating, data.y); if (transform) { return { ...initialStyles, transform: "translate(" + x + "px, " + y + "px)", ...(getDPR(elements.floating) >= 1.5 && { willChange: 'transform' }) }; } return { position: strategy, left: x, top: y }; }, [strategy, transform, elements.floating, data.x, data.y]); return React.useMemo(() => ({ ...data, update, refs, elements, floatingStyles }), [data, update, refs, elements, floatingStyles]); } /***/ }), /***/ "../../../node_modules/@motionone/animation/dist/Animation.es.js": /*!***********************************************************************!*\ !*** ../../../node_modules/@motionone/animation/dist/Animation.es.js ***! \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Animation = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_modules/@motionone/animation/dist/utils/easing.es.js"); class Animation { constructor(output) { let keyframes = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 1]; let { easing, duration: initialDuration = _utils.defaults.duration, delay = _utils.defaults.delay, endDelay = _utils.defaults.endDelay, repeat = _utils.defaults.repeat, offset, direction = "normal" } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; this.startTime = null; this.rate = 1; this.t = 0; this.cancelTimestamp = null; this.easing = _utils.noopReturn; this.duration = 0; this.totalDuration = 0; this.repeat = 0; this.playState = "idle"; this.finished = new Promise((resolve, reject) => { this.resolve = resolve; this.reject = reject; }); easing = easing || _utils.defaults.easing; if ((0, _utils.isEasingGenerator)(easing)) { const custom = easing.createAnimation(keyframes); easing = custom.easing; keyframes = custom.keyframes || keyframes; initialDuration = custom.duration || initialDuration; } this.repeat = repeat; this.easing = (0, _utils.isEasingList)(easing) ? _utils.noopReturn : (0, _easingEs.getEasingFunction)(easing); this.updateDuration(initialDuration); const interpolate$1 = (0, _utils.interpolate)(keyframes, offset, (0, _utils.isEasingList)(easing) ? easing.map(_easingEs.getEasingFunction) : _utils.noopReturn); this.tick = timestamp => { var _a; // TODO: Temporary fix for OptionsResolver typing delay = delay; let t = 0; if (this.pauseTime !== undefined) { t = this.pauseTime; } else { t = (timestamp - this.startTime) * this.rate; } this.t = t; // Convert to seconds t /= 1000; // Rebase on delay t = Math.max(t - delay, 0); /** * If this animation has finished, set the current time * to the total duration. */ if (this.playState === "finished" && this.pauseTime === undefined) { t = this.totalDuration; } /** * Get the current progress (0-1) of the animation. If t is > * than duration we'll get values like 2.5 (midway through the * third iteration) */ const progress = t / this.duration; // TODO progress += iterationStart /** * Get the current iteration (0 indexed). For instance the floor of * 2.5 is 2. */ let currentIteration = Math.floor(progress); /** * Get the current progress of the iteration by taking the remainder * so 2.5 is 0.5 through iteration 2 */ let iterationProgress = progress % 1.0; if (!iterationProgress && progress >= 1) { iterationProgress = 1; } /** * If iteration progress is 1 we count that as the end * of the previous iteration. */ iterationProgress === 1 && currentIteration--; /** * Reverse progress if we're not running in "normal" direction */ const iterationIsOdd = currentIteration % 2; if (direction === "reverse" || direction === "alternate" && iterationIsOdd || direction === "alternate-reverse" && !iterationIsOdd) { iterationProgress = 1 - iterationProgress; } const p = t >= this.totalDuration ? 1 : Math.min(iterationProgress, 1); const latest = interpolate$1(this.easing(p)); output(latest); const isAnimationFinished = this.pauseTime === undefined && (this.playState === "finished" || t >= this.totalDuration + endDelay); if (isAnimationFinished) { this.playState = "finished"; (_a = this.resolve) === null || _a === void 0 ? void 0 : _a.call(this, latest); } else if (this.playState !== "idle") { this.frameRequestId = requestAnimationFrame(this.tick); } }; this.play(); } play() { const now = performance.now(); this.playState = "running"; if (this.pauseTime !== undefined) { this.startTime = now - this.pauseTime; } else if (!this.startTime) { this.startTime = now; } this.cancelTimestamp = this.startTime; this.pauseTime = undefined; this.frameRequestId = requestAnimationFrame(this.tick); } pause() { this.playState = "paused"; this.pauseTime = this.t; } finish() { this.playState = "finished"; this.tick(0); } stop() { var _a; this.playState = "idle"; if (this.frameRequestId !== undefined) { cancelAnimationFrame(this.frameRequestId); } (_a = this.reject) === null || _a === void 0 ? void 0 : _a.call(this, false); } cancel() { this.stop(); this.tick(this.cancelTimestamp); } reverse() { this.rate *= -1; } commitStyles() {} updateDuration(duration) { this.duration = duration; this.totalDuration = duration * (this.repeat + 1); } get currentTime() { return this.t; } set currentTime(t) { if (this.pauseTime !== undefined || this.rate === 0) { this.pauseTime = t; } else { this.startTime = performance.now() - t / this.rate; } } get playbackRate() { return this.rate; } set playbackRate(rate) { this.rate = rate; } } exports.Animation = Animation; /***/ }), /***/ "../../../node_modules/@motionone/animation/dist/index.es.js": /*!*******************************************************************!*\ !*** ../../../node_modules/@motionone/animation/dist/index.es.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "Animation", ({ enumerable: true, get: function () { return _AnimationEs.Animation; } })); Object.defineProperty(exports, "getEasingFunction", ({ enumerable: true, get: function () { return _easingEs.getEasingFunction; } })); var _AnimationEs = __webpack_require__(/*! ./Animation.es.js */ "../../../node_modules/@motionone/animation/dist/Animation.es.js"); var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_modules/@motionone/animation/dist/utils/easing.es.js"); /***/ }), /***/ "../../../node_modules/@motionone/animation/dist/utils/easing.es.js": /*!**************************************************************************!*\ !*** ../../../node_modules/@motionone/animation/dist/utils/easing.es.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getEasingFunction = getEasingFunction; var _easing = __webpack_require__(/*! @motionone/easing */ "../../../node_modules/@motionone/easing/dist/index.es.js"); var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); const namedEasings = { ease: (0, _easing.cubicBezier)(0.25, 0.1, 0.25, 1.0), "ease-in": (0, _easing.cubicBezier)(0.42, 0.0, 1.0, 1.0), "ease-in-out": (0, _easing.cubicBezier)(0.42, 0.0, 0.58, 1.0), "ease-out": (0, _easing.cubicBezier)(0.0, 0.0, 0.58, 1.0) }; const functionArgsRegex = /\((.*?)\)/; function getEasingFunction(definition) { // If already an easing function, return if ((0, _utils.isFunction)(definition)) return definition; // If an easing curve definition, return bezier function if ((0, _utils.isCubicBezier)(definition)) return (0, _easing.cubicBezier)(...definition); // If we have a predefined easing function, return if (namedEasings[definition]) return namedEasings[definition]; // If this is a steps function, attempt to create easing curve if (definition.startsWith("steps")) { const args = functionArgsRegex.exec(definition); if (args) { const argsArray = args[1].split(","); return (0, _easing.steps)(parseFloat(argsArray[0]), argsArray[1].trim()); } } return _utils.noopReturn; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.animateStyle = animateStyle; var _dataEs = __webpack_require__(/*! ./data.es.js */ "../../../node_modules/@motionone/dom/dist/animate/data.es.js"); var _cssVarEs = __webpack_require__(/*! ./utils/css-var.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js"); var _animation = __webpack_require__(/*! @motionone/animation */ "../../../node_modules/@motionone/animation/dist/index.es.js"); var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _transformsEs = __webpack_require__(/*! ./utils/transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); var _easingEs = __webpack_require__(/*! ./utils/easing.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js"); var _featureDetectionEs = __webpack_require__(/*! ./utils/feature-detection.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js"); var _keyframesEs = __webpack_require__(/*! ./utils/keyframes.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js"); var _styleEs = __webpack_require__(/*! ./style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/style.es.js"); var _getStyleNameEs = __webpack_require__(/*! ./utils/get-style-name.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js"); var _stopAnimationEs = __webpack_require__(/*! ./utils/stop-animation.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js"); function getDevToolsRecord() { return window.__MOTION_DEV_TOOLS_RECORD; } function animateStyle(element, key, keyframesDefinition) { let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; const record = getDevToolsRecord(); const isRecording = options.record !== false && record; let animation; let { duration = _utils.defaults.duration, delay = _utils.defaults.delay, endDelay = _utils.defaults.endDelay, repeat = _utils.defaults.repeat, easing = _utils.defaults.easing, direction, offset, allowWebkitAcceleration = false } = options; const data = (0, _dataEs.getAnimationData)(element); let canAnimateNatively = _featureDetectionEs.supports.waapi(); const valueIsTransform = (0, _transformsEs.isTransform)(key); /** * If this is an individual transform, we need to map its * key to a CSS variable and update the element's transform style */ valueIsTransform && (0, _transformsEs.addTransformToElement)(element, key); const name = (0, _getStyleNameEs.getStyleName)(key); const motionValue = (0, _dataEs.getMotionValue)(data.values, name); /** * Get definition of value, this will be used to convert numerical * keyframes into the default value type. */ const definition = _transformsEs.transformDefinitions.get(name); /** * Stop the current animation, if any. Because this will trigger * commitStyles (DOM writes) and we might later trigger DOM reads, * this is fired now and we return a factory function to create * the actual animation that can get called in batch, */ (0, _stopAnimationEs.stopAnimation)(motionValue.animation, !((0, _utils.isEasingGenerator)(easing) && motionValue.generator) && options.record !== false); /** * Batchable factory function containing all DOM reads. */ return () => { const readInitialValue = () => { var _a, _b; return (_b = (_a = _styleEs.style.get(element, name)) !== null && _a !== void 0 ? _a : definition === null || definition === void 0 ? void 0 : definition.initialValue) !== null && _b !== void 0 ? _b : 0; }; /** * Replace null values with the previous keyframe value, or read * it from the DOM if it's the first keyframe. */ let keyframes = (0, _keyframesEs.hydrateKeyframes)((0, _keyframesEs.keyframesList)(keyframesDefinition), readInitialValue); if ((0, _utils.isEasingGenerator)(easing)) { const custom = easing.createAnimation(keyframes, readInitialValue, valueIsTransform, name, motionValue); easing = custom.easing; if (custom.keyframes !== undefined) keyframes = custom.keyframes; if (custom.duration !== undefined) duration = custom.duration; } /** * If this is a CSS variable we need to register it with the browser * before it can be animated natively. We also set it with setProperty * rather than directly onto the element.style object. */ if ((0, _cssVarEs.isCssVar)(name)) { if (_featureDetectionEs.supports.cssRegisterProperty()) { (0, _cssVarEs.registerCssVariable)(name); } else { canAnimateNatively = false; } } /** * If we can animate this value with WAAPI, do so. Currently this only * feature detects CSS.registerProperty but could check WAAPI too. */ if (canAnimateNatively) { /** * Convert numbers to default value types. Currently this only supports * transforms but it could also support other value types. */ if (definition) { keyframes = keyframes.map(value => (0, _utils.isNumber)(value) ? definition.toDefaultUnit(value) : value); } /** * If this browser doesn't support partial/implicit keyframes we need to * explicitly provide one. */ if (keyframes.length === 1 && (!_featureDetectionEs.supports.partialKeyframes() || isRecording)) { keyframes.unshift(readInitialValue()); } const animationOptions = { delay: _utils.time.ms(delay), duration: _utils.time.ms(duration), endDelay: _utils.time.ms(endDelay), easing: !(0, _utils.isEasingList)(easing) ? (0, _easingEs.convertEasing)(easing) : undefined, direction, iterations: repeat + 1, fill: "both" }; animation = element.animate({ [name]: keyframes, offset, easing: (0, _utils.isEasingList)(easing) ? easing.map(_easingEs.convertEasing) : undefined }, animationOptions); /** * Polyfill finished Promise in browsers that don't support it */ if (!animation.finished) { animation.finished = new Promise((resolve, reject) => { animation.onfinish = resolve; animation.oncancel = reject; }); } const target = keyframes[keyframes.length - 1]; animation.finished.then(() => { // Apply styles to target _styleEs.style.set(element, name, target); // Ensure fill modes don't persist animation.cancel(); }).catch(_utils.noop); /** * This forces Webkit to run animations on the main thread by exploiting * this condition: * https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp?rev=281238#L1099 * * This fixes Webkit's timing bugs, like accelerated animations falling * out of sync with main thread animations and massive delays in starting * accelerated animations in WKWebView. */ if (!allowWebkitAcceleration) animation.playbackRate = 1.000001; /** * If we can't animate the value natively then we can fallback to the numbers-only * polyfill for transforms. */ } else if (valueIsTransform) { /** * If any keyframe is a string (because we measured it from the DOM), we need to convert * it into a number before passing to the Animation polyfill. */ keyframes = keyframes.map(value => typeof value === "string" ? parseFloat(value) : value); /** * If we only have a single keyframe, we need to create an initial keyframe by reading * the current value from the DOM. */ if (keyframes.length === 1) { keyframes.unshift(parseFloat(readInitialValue())); } const render = latest => { if (definition) latest = definition.toDefaultUnit(latest); _styleEs.style.set(element, name, latest); }; animation = new _animation.Animation(render, keyframes, Object.assign(Object.assign({}, options), { duration, easing })); } else { const target = keyframes[keyframes.length - 1]; _styleEs.style.set(element, name, definition && (0, _utils.isNumber)(target) ? definition.toDefaultUnit(target) : target); } if (isRecording) { record(element, key, keyframes, { duration, delay: delay, easing, repeat, offset }, "motion-one"); } motionValue.setAnimation(animation); return animation; }; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/data.es.js": /*!********************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/data.es.js ***! \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getAnimationData = getAnimationData; exports.getMotionValue = getMotionValue; var _types = __webpack_require__(/*! @motionone/types */ "../../../node_modules/@motionone/types/dist/index.es.js"); const data = new WeakMap(); function getAnimationData(element) { if (!data.has(element)) { data.set(element, { transforms: [], values: new Map() }); } return data.get(element); } function getMotionValue(motionValues, name) { if (!motionValues.has(name)) { motionValues.set(name, new _types.MotionValue()); } return motionValues.get(name); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/index.es.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/index.es.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.animate = animate; var _animateStyleEs = __webpack_require__(/*! ./animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); var _optionsEs = __webpack_require__(/*! ./utils/options.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js"); var _resolveElementsEs = __webpack_require__(/*! ../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); var _controlsEs = __webpack_require__(/*! ./utils/controls.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js"); var _staggerEs = __webpack_require__(/*! ../utils/stagger.es.js */ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js"); function animate(elements, keyframes) { let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; elements = (0, _resolveElementsEs.resolveElements)(elements); const numElements = elements.length; /** * Create and start new animations */ const animationFactories = []; for (let i = 0; i < numElements; i++) { const element = elements[i]; for (const key in keyframes) { const valueOptions = (0, _optionsEs.getOptions)(options, key); valueOptions.delay = (0, _staggerEs.resolveOption)(valueOptions.delay, i, numElements); const animation = (0, _animateStyleEs.animateStyle)(element, key, keyframes[key], valueOptions); animationFactories.push(animation); } } return (0, _controlsEs.withControls)(animationFactories, options, /** * TODO: * If easing is set to spring or glide, duration will be dynamically * generated. Ideally we would dynamically generate this from * animation.effect.getComputedTiming().duration but this isn't * supported in iOS13 or our number polyfill. Perhaps it's possible * to Proxy animations returned from animateStyle that has duration * as a getter. */ options.duration); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/style.es.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/style.es.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.style = void 0; var _cssVarEs = __webpack_require__(/*! ./utils/css-var.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js"); var _getStyleNameEs = __webpack_require__(/*! ./utils/get-style-name.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js"); var _transformsEs = __webpack_require__(/*! ./utils/transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); const style = { get: (element, name) => { name = (0, _getStyleNameEs.getStyleName)(name); let value = (0, _cssVarEs.isCssVar)(name) ? element.style.getPropertyValue(name) : getComputedStyle(element)[name]; if (!value && value !== 0) { const definition = _transformsEs.transformDefinitions.get(name); if (definition) value = definition.initialValue; } return value; }, set: (element, name, value) => { name = (0, _getStyleNameEs.getStyleName)(name); if ((0, _cssVarEs.isCssVar)(name)) { element.style.setProperty(name, value); } else { element.style[name] = value; } } }; exports.style = style; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js": /*!******************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js ***! \******************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.withControls = exports.controls = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _stopAnimationEs = __webpack_require__(/*! ./stop-animation.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js"); const createAnimation = factory => factory(); const withControls = function (animationFactory, options) { let duration = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _utils.defaults.duration; return new Proxy({ animations: animationFactory.map(createAnimation).filter(Boolean), duration, options }, controls); }; /** * TODO: * Currently this returns the first animation, ideally it would return * the first active animation. */ exports.withControls = withControls; const getActiveAnimation = state => state.animations[0]; const controls = { get: (target, key) => { const activeAnimation = getActiveAnimation(target); switch (key) { case "duration": return target.duration; case "currentTime": return _utils.time.s((activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) || 0); case "playbackRate": case "playState": return activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]; case "finished": if (!target.finished) { target.finished = Promise.all(target.animations.map(selectFinished)).catch(_utils.noop); } return target.finished; case "stop": return () => { target.animations.forEach(animation => (0, _stopAnimationEs.stopAnimation)(animation)); }; case "forEachNative": /** * This is for internal use only, fire a callback for each * underlying animation. */ return callback => { target.animations.forEach(animation => callback(animation, target)); }; default: return typeof (activeAnimation === null || activeAnimation === void 0 ? void 0 : activeAnimation[key]) === "undefined" ? undefined : () => target.animations.forEach(animation => animation[key]()); } }, set: (target, key, value) => { switch (key) { case "currentTime": value = _utils.time.ms(value); case "currentTime": case "playbackRate": for (let i = 0; i < target.animations.length; i++) { target.animations[i][key] = value; } return true; } return false; } }; exports.controls = controls; const selectFinished = animation => animation.finished; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/css-var.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isCssVar = void 0; exports.registerCssVariable = registerCssVariable; exports.registeredProperties = void 0; var _transformsEs = __webpack_require__(/*! ./transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); const isCssVar = name => name.startsWith("--"); exports.isCssVar = isCssVar; const registeredProperties = new Set(); exports.registeredProperties = registeredProperties; function registerCssVariable(name) { if (registeredProperties.has(name)) return; registeredProperties.add(name); try { const { syntax, initialValue } = _transformsEs.transformDefinitions.has(name) ? _transformsEs.transformDefinitions.get(name) : {}; CSS.registerProperty({ name, inherits: false, syntax, initialValue }); } catch (e) {} } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/easing.es.js ***! \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cubicBezierAsString = exports.convertEasing = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); const convertEasing = easing => (0, _utils.isCubicBezier)(easing) ? cubicBezierAsString(easing) : easing; exports.convertEasing = convertEasing; const cubicBezierAsString = _ref => { let [a, b, c, d] = _ref; return `cubic-bezier(${a}, ${b}, ${c}, ${d})`; }; exports.cubicBezierAsString = cubicBezierAsString; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js": /*!***************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/feature-detection.es.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.supports = void 0; const testAnimation = keyframes => document.createElement("div").animate(keyframes, { duration: 0.001 }); const featureTests = { cssRegisterProperty: () => typeof CSS !== "undefined" && Object.hasOwnProperty.call(CSS, "registerProperty"), waapi: () => Object.hasOwnProperty.call(Element.prototype, "animate"), partialKeyframes: () => { try { testAnimation({ opacity: [1] }); } catch (e) { return false; } return true; }, finished: () => Boolean(testAnimation({ opacity: [0, 1] }).finished) }; const results = {}; const supports = {}; exports.supports = supports; for (const key in featureTests) { supports[key] = () => { if (results[key] === undefined) results[key] = featureTests[key](); return results[key]; }; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js": /*!************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js ***! \************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getStyleName = getStyleName; var _transformsEs = __webpack_require__(/*! ./transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); function getStyleName(key) { if (_transformsEs.transformAlias[key]) key = _transformsEs.transformAlias[key]; return (0, _transformsEs.isTransform)(key) ? (0, _transformsEs.asTransformCssVar)(key) : key; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js": /*!*******************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js ***! \*******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hydrateKeyframes = hydrateKeyframes; exports.keyframesList = void 0; function hydrateKeyframes(keyframes, readInitialValue) { for (let i = 0; i < keyframes.length; i++) { if (keyframes[i] === null) { keyframes[i] = i ? keyframes[i - 1] : readInitialValue(); } } return keyframes; } const keyframesList = keyframes => Array.isArray(keyframes) ? keyframes : [keyframes]; exports.keyframesList = keyframesList; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOptions = void 0; const getOptions = (options, key) => /** * TODO: Make test for this * Always return a new object otherwise delay is overwritten by results of stagger * and this results in no stagger */ options[key] ? Object.assign(Object.assign({}, options), options[key]) : Object.assign({}, options); exports.getOptions = getOptions; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js": /*!************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/stop-animation.es.js ***! \************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.stopAnimation = stopAnimation; function stopAnimation(animation) { let needsCommit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; if (!animation || animation.playState === "finished") return; // Suppress error thrown by WAAPI try { if (animation.stop) { animation.stop(); } else { needsCommit && animation.commitStyles(); animation.cancel(); } } catch (e) {} } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js": /*!**********************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js ***! \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createStyles = createStyles; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _transformsEs = __webpack_require__(/*! ./transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); function createStyles(keyframes) { const initialKeyframes = {}; const transformKeys = []; for (let key in keyframes) { const value = keyframes[key]; if ((0, _transformsEs.isTransform)(key)) { if (_transformsEs.transformAlias[key]) key = _transformsEs.transformAlias[key]; transformKeys.push(key); key = (0, _transformsEs.asTransformCssVar)(key); } let initialKeyframe = Array.isArray(value) ? value[0] : value; /** * If this is a number and we have a default value type, convert the number * to this type. */ const definition = _transformsEs.transformDefinitions.get(key); if (definition) { initialKeyframe = (0, _utils.isNumber)(value) ? definition.toDefaultUnit(value) : value; } initialKeyframes[key] = initialKeyframe; } if (transformKeys.length) { initialKeyframes.transform = (0, _transformsEs.buildTransformTemplate)(transformKeys); } return initialKeyframes; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/style-string.es.js": /*!**********************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/style-string.es.js ***! \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createStyleString = createStyleString; var _styleObjectEs = __webpack_require__(/*! ./style-object.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js"); const camelLetterToPipeLetter = letter => `-${letter.toLowerCase()}`; const camelToPipeCase = str => str.replace(/[A-Z]/g, camelLetterToPipeLetter); function createStyleString() { let target = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; const styles = (0, _styleObjectEs.createStyles)(target); let style = ""; for (const key in styles) { style += key.startsWith("--") ? key : camelToPipeCase(key); style += `: ${styles[key]}; `; } return style; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js": /*!********************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js ***! \********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.transformDefinitions = exports.transformAlias = exports.isTransform = exports.compareTransformOrder = exports.buildTransformTemplate = exports.axes = exports.asTransformCssVar = exports.addTransformToElement = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _dataEs = __webpack_require__(/*! ../data.es.js */ "../../../node_modules/@motionone/dom/dist/animate/data.es.js"); /** * A list of all transformable axes. We'll use this list to generated a version * of each axes for each transform. */ const axes = ["", "X", "Y", "Z"]; /** * An ordered array of each transformable value. By default, transform values * will be sorted to this order. */ exports.axes = axes; const order = ["translate", "scale", "rotate", "skew"]; const transformAlias = { x: "translateX", y: "translateY", z: "translateZ" }; exports.transformAlias = transformAlias; const rotation = { syntax: "", initialValue: "0deg", toDefaultUnit: v => v + "deg" }; const baseTransformProperties = { translate: { syntax: "", initialValue: "0px", toDefaultUnit: v => v + "px" }, rotate: rotation, scale: { syntax: "", initialValue: 1, toDefaultUnit: _utils.noopReturn }, skew: rotation }; const transformDefinitions = new Map(); exports.transformDefinitions = transformDefinitions; const asTransformCssVar = name => `--motion-${name}`; /** * Generate a list of every possible transform key */ exports.asTransformCssVar = asTransformCssVar; const transforms = ["x", "y", "z"]; order.forEach(name => { axes.forEach(axis => { transforms.push(name + axis); transformDefinitions.set(asTransformCssVar(name + axis), baseTransformProperties[name]); }); }); /** * A function to use with Array.sort to sort transform keys by their default order. */ const compareTransformOrder = (a, b) => transforms.indexOf(a) - transforms.indexOf(b); /** * Provide a quick way to check if a string is the name of a transform */ exports.compareTransformOrder = compareTransformOrder; const transformLookup = new Set(transforms); const isTransform = name => transformLookup.has(name); exports.isTransform = isTransform; const addTransformToElement = (element, name) => { // Map x to translateX etc if (transformAlias[name]) name = transformAlias[name]; const { transforms } = (0, _dataEs.getAnimationData)(element); (0, _utils.addUniqueItem)(transforms, name); /** * TODO: An optimisation here could be to cache the transform in element data * and only update if this has changed. */ element.style.transform = buildTransformTemplate(transforms); }; exports.addTransformToElement = addTransformToElement; const buildTransformTemplate = transforms => transforms.sort(compareTransformOrder).reduce(transformListToString, "").trim(); exports.buildTransformTemplate = buildTransformTemplate; const transformListToString = (template, name) => `${template} ${name}(var(${asTransformCssVar(name)}))`; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createGeneratorEasing = createGeneratorEasing; var _generators = __webpack_require__(/*! @motionone/generators */ "../../../node_modules/@motionone/generators/dist/index.es.js"); function createGeneratorEasing(createGenerator) { const keyframesCache = new WeakMap(); return function () { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; const generatorCache = new Map(); const getGenerator = function () { let from = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; let to = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 100; let velocity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; let isScale = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; const key = `${from}-${to}-${velocity}-${isScale}`; if (!generatorCache.has(key)) { generatorCache.set(key, createGenerator(Object.assign({ from, to, velocity, restSpeed: isScale ? 0.05 : 2, restDistance: isScale ? 0.01 : 0.5 }, options))); } return generatorCache.get(key); }; const getKeyframes = generator => { if (!keyframesCache.has(generator)) { keyframesCache.set(generator, (0, _generators.pregenerateKeyframes)(generator)); } return keyframesCache.get(generator); }; return { createAnimation: (keyframes, getOrigin, canUseGenerator, name, motionValue) => { var _a, _b; let settings; const numKeyframes = keyframes.length; let shouldUseGenerator = canUseGenerator && numKeyframes <= 2 && keyframes.every(isNumberOrNull); if (shouldUseGenerator) { const target = keyframes[numKeyframes - 1]; const unresolvedOrigin = numKeyframes === 1 ? null : keyframes[0]; let velocity = 0; let origin = 0; const prevGenerator = motionValue === null || motionValue === void 0 ? void 0 : motionValue.generator; if (prevGenerator) { /** * If we have a generator for this value we can use it to resolve * the animations's current value and velocity. */ const { animation, generatorStartTime } = motionValue; const startTime = (animation === null || animation === void 0 ? void 0 : animation.startTime) || generatorStartTime || 0; const currentTime = (animation === null || animation === void 0 ? void 0 : animation.currentTime) || performance.now() - startTime; const prevGeneratorCurrent = prevGenerator(currentTime).current; origin = (_a = unresolvedOrigin) !== null && _a !== void 0 ? _a : prevGeneratorCurrent; if (numKeyframes === 1 || numKeyframes === 2 && keyframes[0] === null) { velocity = (0, _generators.calcGeneratorVelocity)(t => prevGenerator(t).current, currentTime, prevGeneratorCurrent); } } else { origin = (_b = unresolvedOrigin) !== null && _b !== void 0 ? _b : parseFloat(getOrigin()); } const generator = getGenerator(origin, target, velocity, name === null || name === void 0 ? void 0 : name.includes("scale")); const keyframesMetadata = getKeyframes(generator); settings = Object.assign(Object.assign({}, keyframesMetadata), { easing: "linear" }); // TODO Add test for this if (motionValue) { motionValue.generator = generator; motionValue.generatorStartTime = performance.now(); } } else { const keyframesMetadata = getKeyframes(getGenerator(0, 100)); settings = { easing: "ease", duration: keyframesMetadata.overshootDuration }; } return settings; } }; }; } const isNumberOrNull = value => typeof value !== "string"; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/easing/glide/index.es.js": /*!**************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/easing/glide/index.es.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.glide = void 0; var _generators = __webpack_require__(/*! @motionone/generators */ "../../../node_modules/@motionone/generators/dist/index.es.js"); var _createGeneratorEasingEs = __webpack_require__(/*! ../create-generator-easing.es.js */ "../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js"); const glide = (0, _createGeneratorEasingEs.createGeneratorEasing)(_generators.glide); exports.glide = glide; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/easing/spring/index.es.js": /*!***************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/easing/spring/index.es.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.spring = void 0; var _generators = __webpack_require__(/*! @motionone/generators */ "../../../node_modules/@motionone/generators/dist/index.es.js"); var _createGeneratorEasingEs = __webpack_require__(/*! ../create-generator-easing.es.js */ "../../../node_modules/@motionone/dom/dist/easing/create-generator-easing.es.js"); const spring = (0, _createGeneratorEasingEs.createGeneratorEasing)(_generators.spring); exports.spring = spring; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js": /*!************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js ***! \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.inView = inView; var _resolveElementsEs = __webpack_require__(/*! ../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); const thresholds = { any: 0, all: 1 }; function inView(elementOrSelector, onStart) { let { root, margin: rootMargin, amount = "any" } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; /** * If this browser doesn't support IntersectionObserver, return a dummy stop function. * Default triggering of onStart is tricky - it could be used for starting/stopping * videos, lazy loading content etc. We could provide an option to enable a fallback, or * provide a fallback callback option. */ if (typeof IntersectionObserver === "undefined") { return () => {}; } const elements = (0, _resolveElementsEs.resolveElements)(elementOrSelector); const activeIntersections = new WeakMap(); const onIntersectionChange = entries => { entries.forEach(entry => { const onEnd = activeIntersections.get(entry.target); /** * If there's no change to the intersection, we don't need to * do anything here. */ if (entry.isIntersecting === Boolean(onEnd)) return; if (entry.isIntersecting) { const newOnEnd = onStart(entry); if (typeof newOnEnd === "function") { activeIntersections.set(entry.target, newOnEnd); } else { observer.unobserve(entry.target); } } else if (onEnd) { onEnd(entry); activeIntersections.delete(entry.target); } }); }; const observer = new IntersectionObserver(onIntersectionChange, { root, rootMargin, threshold: typeof amount === "number" ? amount : thresholds[amount] }); elements.forEach(element => observer.observe(element)); return () => observer.disconnect(); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resizeElement = resizeElement; var _resolveElementsEs = __webpack_require__(/*! ../../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); const resizeHandlers = new WeakMap(); let observer; function getElementSize(target, borderBoxSize) { if (borderBoxSize) { const { inlineSize, blockSize } = borderBoxSize[0]; return { width: inlineSize, height: blockSize }; } else if (target instanceof SVGElement && "getBBox" in target) { return target.getBBox(); } else { return { width: target.offsetWidth, height: target.offsetHeight }; } } function notifyTarget(_ref) { let { target, contentRect, borderBoxSize } = _ref; var _a; (_a = resizeHandlers.get(target)) === null || _a === void 0 ? void 0 : _a.forEach(handler => { handler({ target, contentSize: contentRect, get size() { return getElementSize(target, borderBoxSize); } }); }); } function notifyAll(entries) { entries.forEach(notifyTarget); } function createResizeObserver() { if (typeof ResizeObserver === "undefined") return; observer = new ResizeObserver(notifyAll); } function resizeElement(target, handler) { if (!observer) createResizeObserver(); const elements = (0, _resolveElementsEs.resolveElements)(target); elements.forEach(element => { let elementHandlers = resizeHandlers.get(element); if (!elementHandlers) { elementHandlers = new Set(); resizeHandlers.set(element, elementHandlers); } elementHandlers.add(handler); observer === null || observer === void 0 ? void 0 : observer.observe(element); }); return () => { elements.forEach(element => { const elementHandlers = resizeHandlers.get(element); elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.delete(handler); if (!(elementHandlers === null || elementHandlers === void 0 ? void 0 : elementHandlers.size)) { observer === null || observer === void 0 ? void 0 : observer.unobserve(element); } }); }; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js": /*!*************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resizeWindow = resizeWindow; const windowCallbacks = new Set(); let windowResizeHandler; function createWindowResizeHandler() { windowResizeHandler = () => { const size = { width: window.innerWidth, height: window.innerHeight }; const info = { target: window, size, contentSize: size }; windowCallbacks.forEach(callback => callback(info)); }; window.addEventListener("resize", windowResizeHandler); } function resizeWindow(callback) { windowCallbacks.add(callback); if (!windowResizeHandler) createWindowResizeHandler(); return () => { windowCallbacks.delete(callback); if (!windowCallbacks.size && windowResizeHandler) { windowResizeHandler = undefined; } }; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resize = resize; var _handleElementEs = __webpack_require__(/*! ./handle-element.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-element.es.js"); var _handleWindowEs = __webpack_require__(/*! ./handle-window.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/handle-window.es.js"); function resize(a, b) { return typeof a === "function" ? (0, _handleWindowEs.resizeWindow)(a) : (0, _handleElementEs.resizeElement)(a, b); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/index.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/index.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.scroll = scroll; var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); var _indexEs = __webpack_require__(/*! ../resize/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js"); var _infoEs = __webpack_require__(/*! ./info.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js"); var _onScrollHandlerEs = __webpack_require__(/*! ./on-scroll-handler.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js"); const scrollListeners = new WeakMap(); const resizeListeners = new WeakMap(); const onScrollHandlers = new WeakMap(); const getEventTarget = element => element === document.documentElement ? window : element; function scroll(onScroll) { let _a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var { container = document.documentElement } = _a, options = (0, _tslib.__rest)(_a, ["container"]); let containerHandlers = onScrollHandlers.get(container); /** * Get the onScroll handlers for this container. * If one isn't found, create a new one. */ if (!containerHandlers) { containerHandlers = new Set(); onScrollHandlers.set(container, containerHandlers); } /** * Create a new onScroll handler for the provided callback. */ const info = (0, _infoEs.createScrollInfo)(); const containerHandler = (0, _onScrollHandlerEs.createOnScrollHandler)(container, onScroll, info, options); containerHandlers.add(containerHandler); /** * Check if there's a scroll event listener for this container. * If not, create one. */ if (!scrollListeners.has(container)) { const listener = () => { const time = performance.now(); for (const handler of containerHandlers) handler.measure(); for (const handler of containerHandlers) handler.update(time); for (const handler of containerHandlers) handler.notify(); }; scrollListeners.set(container, listener); const target = getEventTarget(container); window.addEventListener("resize", listener, { passive: true }); if (container !== document.documentElement) { resizeListeners.set(container, (0, _indexEs.resize)(container, listener)); } target.addEventListener("scroll", listener, { passive: true }); } const listener = scrollListeners.get(container); const onLoadProcesss = requestAnimationFrame(listener); return () => { var _a; if (typeof onScroll !== "function") onScroll.stop(); cancelAnimationFrame(onLoadProcesss); /** * Check if we even have any handlers for this container. */ const containerHandlers = onScrollHandlers.get(container); if (!containerHandlers) return; containerHandlers.delete(containerHandler); if (containerHandlers.size) return; /** * If no more handlers, remove the scroll listener too. */ const listener = scrollListeners.get(container); scrollListeners.delete(container); if (listener) { getEventTarget(container).removeEventListener("scroll", listener); (_a = resizeListeners.get(container)) === null || _a === void 0 ? void 0 : _a(); window.removeEventListener("resize", listener); } }; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js ***! \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createScrollInfo = void 0; exports.updateScrollInfo = updateScrollInfo; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); /** * A time in milliseconds, beyond which we consider the scroll velocity to be 0. */ const maxElapsed = 50; const createAxisInfo = () => ({ current: 0, offset: [], progress: 0, scrollLength: 0, targetOffset: 0, targetLength: 0, containerLength: 0, velocity: 0 }); const createScrollInfo = () => ({ time: 0, x: createAxisInfo(), y: createAxisInfo() }); exports.createScrollInfo = createScrollInfo; const keys = { x: { length: "Width", position: "Left" }, y: { length: "Height", position: "Top" } }; function updateAxisInfo(element, axisName, info, time) { const axis = info[axisName]; const { length, position } = keys[axisName]; const prev = axis.current; const prevTime = info.time; axis.current = element["scroll" + position]; axis.scrollLength = element["scroll" + length] - element["client" + length]; axis.offset.length = 0; axis.offset[0] = 0; axis.offset[1] = axis.scrollLength; axis.progress = (0, _utils.progress)(0, axis.scrollLength, axis.current); const elapsed = time - prevTime; axis.velocity = elapsed > maxElapsed ? 0 : (0, _utils.velocityPerSecond)(axis.current - prev, elapsed); } function updateScrollInfo(element, info, time) { updateAxisInfo(element, "x", info, time); updateAxisInfo(element, "y", info, time); info.time = time; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js": /*!************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js ***! \************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.namedEdges = void 0; exports.resolveEdge = resolveEdge; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); const namedEdges = { start: 0, center: 0.5, end: 1 }; exports.namedEdges = namedEdges; function resolveEdge(edge, length) { let inset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; let delta = 0; /** * If we have this edge defined as a preset, replace the definition * with the numerical value. */ if (namedEdges[edge] !== undefined) { edge = namedEdges[edge]; } /** * Handle unit values */ if ((0, _utils.isString)(edge)) { const asNumber = parseFloat(edge); if (edge.endsWith("px")) { delta = asNumber; } else if (edge.endsWith("%")) { edge = asNumber / 100; } else if (edge.endsWith("vw")) { delta = asNumber / 100 * document.documentElement.clientWidth; } else if (edge.endsWith("vh")) { delta = asNumber / 100 * document.documentElement.clientHeight; } else { edge = asNumber; } } /** * If the edge is defined as a number, handle as a progress value. */ if ((0, _utils.isNumber)(edge)) { delta = length * edge; } return inset + delta; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js": /*!*************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveOffsets = resolveOffsets; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _insetEs = __webpack_require__(/*! ./inset.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js"); var _presetsEs = __webpack_require__(/*! ./presets.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js"); var _offsetEs = __webpack_require__(/*! ./offset.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js"); const point = { x: 0, y: 0 }; function resolveOffsets(container, info, options) { let { offset: offsetDefinition = _presetsEs.ScrollOffset.All } = options; const { target = container, axis = "y" } = options; const lengthLabel = axis === "y" ? "height" : "width"; const inset = target !== container ? (0, _insetEs.calcInset)(target, container) : point; /** * Measure the target and container. If they're the same thing then we * use the container's scrollWidth/Height as the target, from there * all other calculations can remain the same. */ const targetSize = target === container ? { width: container.scrollWidth, height: container.scrollHeight } : { width: target.clientWidth, height: target.clientHeight }; const containerSize = { width: container.clientWidth, height: container.clientHeight }; /** * Reset the length of the resolved offset array rather than creating a new one. * TODO: More reusable data structures for targetSize/containerSize would also be good. */ info[axis].offset.length = 0; /** * Populate the offset array by resolving the user's offset definition into * a list of pixel scroll offets. */ let hasChanged = !info[axis].interpolate; const numOffsets = offsetDefinition.length; for (let i = 0; i < numOffsets; i++) { const offset = (0, _offsetEs.resolveOffset)(offsetDefinition[i], containerSize[lengthLabel], targetSize[lengthLabel], inset[axis]); if (!hasChanged && offset !== info[axis].interpolatorOffsets[i]) { hasChanged = true; } info[axis].offset[i] = offset; } /** * If the pixel scroll offsets have changed, create a new interpolator function * to map scroll value into a progress. */ if (hasChanged) { info[axis].interpolate = (0, _utils.interpolate)((0, _utils.defaultOffset)(numOffsets), info[axis].offset); info[axis].interpolatorOffsets = [...info[axis].offset]; } info[axis].progress = info[axis].interpolate(info[axis].current); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js": /*!*************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/inset.es.js ***! \*************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.calcInset = calcInset; function calcInset(element, container) { let inset = { x: 0, y: 0 }; let current = element; while (current && current !== container) { if (current instanceof HTMLElement) { inset.x += current.offsetLeft; inset.y += current.offsetTop; current = current.offsetParent; } else if (current instanceof SVGGraphicsElement && "getBBox" in current) { const { top, left } = current.getBBox(); inset.x += left; inset.y += top; /** * Assign the next parent element as the tag. */ while (current && current.tagName !== "svg") { current = current.parentNode; } } } return inset; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js": /*!**************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/offset.es.js ***! \**************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveOffset = resolveOffset; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _edgeEs = __webpack_require__(/*! ./edge.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/edge.es.js"); const defaultOffset = [0, 0]; function resolveOffset(offset, containerLength, targetLength, targetInset) { let offsetDefinition = Array.isArray(offset) ? offset : defaultOffset; let targetPoint = 0; let containerPoint = 0; if ((0, _utils.isNumber)(offset)) { /** * If we're provided offset: [0, 0.5, 1] then each number x should become * [x, x], so we default to the behaviour of mapping 0 => 0 of both target * and container etc. */ offsetDefinition = [offset, offset]; } else if ((0, _utils.isString)(offset)) { offset = offset.trim(); if (offset.includes(" ")) { offsetDefinition = offset.split(" "); } else { /** * If we're provided a definition like "100px" then we want to apply * that only to the top of the target point, leaving the container at 0. * Whereas a named offset like "end" should be applied to both. */ offsetDefinition = [offset, _edgeEs.namedEdges[offset] ? offset : `0`]; } } targetPoint = (0, _edgeEs.resolveEdge)(offsetDefinition[0], targetLength, targetInset); containerPoint = (0, _edgeEs.resolveEdge)(offsetDefinition[1], containerLength); return targetPoint - containerPoint; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js": /*!***************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.ScrollOffset = void 0; const ScrollOffset = { Enter: [[0, 1], [1, 1]], Exit: [[0, 0], [1, 0]], Any: [[1, 0], [0, 1]], All: [[0, 0], [1, 1]] }; exports.ScrollOffset = ScrollOffset; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js": /*!*****************************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/gestures/scroll/on-scroll-handler.es.js ***! \*****************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createOnScrollHandler = createOnScrollHandler; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _infoEs = __webpack_require__(/*! ./info.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/info.es.js"); var _indexEs = __webpack_require__(/*! ./offsets/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/index.es.js"); function measure(container) { let target = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : container; let info = arguments.length > 2 ? arguments[2] : undefined; /** * Find inset of target within scrollable container */ info.x.targetOffset = 0; info.y.targetOffset = 0; if (target !== container) { let node = target; while (node && node != container) { info.x.targetOffset += node.offsetLeft; info.y.targetOffset += node.offsetTop; node = node.offsetParent; } } info.x.targetLength = target === container ? target.scrollWidth : target.clientWidth; info.y.targetLength = target === container ? target.scrollHeight : target.clientHeight; info.x.containerLength = container.clientWidth; info.y.containerLength = container.clientHeight; } function createOnScrollHandler(element, onScroll, info) { let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; const axis = options.axis || "y"; return { measure: () => measure(element, options.target, info), update: time => { (0, _infoEs.updateScrollInfo)(element, info, time); if (options.offset || options.target) { (0, _indexEs.resolveOffsets)(element, info, options); } }, notify: typeof onScroll === "function" ? () => onScroll(info) : scrubAnimation(onScroll, info[axis]) }; } function scrubAnimation(controls, axisInfo) { controls.pause(); controls.forEachNative((animation, _ref) => { let { easing } = _ref; var _a, _b; if (animation.updateDuration) { if (!easing) animation.easing = _utils.noopReturn; animation.updateDuration(1); } else { const timingOptions = { duration: 1000 }; if (!easing) timingOptions.easing = "linear"; (_b = (_a = animation.effect) === null || _a === void 0 ? void 0 : _a.updateTiming) === null || _b === void 0 ? void 0 : _b.call(_a, timingOptions); } }); return () => { controls.currentTime = axisInfo.progress; }; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/index.es.js": /*!*************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/index.es.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "ScrollOffset", ({ enumerable: true, get: function () { return _presetsEs.ScrollOffset; } })); Object.defineProperty(exports, "animate", ({ enumerable: true, get: function () { return _indexEs.animate; } })); Object.defineProperty(exports, "animateStyle", ({ enumerable: true, get: function () { return _animateStyleEs.animateStyle; } })); Object.defineProperty(exports, "createMotionState", ({ enumerable: true, get: function () { return _indexEs7.createMotionState; } })); Object.defineProperty(exports, "createStyleString", ({ enumerable: true, get: function () { return _styleStringEs.createStyleString; } })); Object.defineProperty(exports, "createStyles", ({ enumerable: true, get: function () { return _styleObjectEs.createStyles; } })); Object.defineProperty(exports, "getAnimationData", ({ enumerable: true, get: function () { return _dataEs.getAnimationData; } })); Object.defineProperty(exports, "getStyleName", ({ enumerable: true, get: function () { return _getStyleNameEs.getStyleName; } })); Object.defineProperty(exports, "glide", ({ enumerable: true, get: function () { return _indexEs4.glide; } })); Object.defineProperty(exports, "inView", ({ enumerable: true, get: function () { return _inViewEs.inView; } })); Object.defineProperty(exports, "mountedStates", ({ enumerable: true, get: function () { return _indexEs7.mountedStates; } })); Object.defineProperty(exports, "resize", ({ enumerable: true, get: function () { return _indexEs5.resize; } })); Object.defineProperty(exports, "scroll", ({ enumerable: true, get: function () { return _indexEs6.scroll; } })); Object.defineProperty(exports, "spring", ({ enumerable: true, get: function () { return _indexEs3.spring; } })); Object.defineProperty(exports, "stagger", ({ enumerable: true, get: function () { return _staggerEs.stagger; } })); Object.defineProperty(exports, "style", ({ enumerable: true, get: function () { return _styleEs.style; } })); Object.defineProperty(exports, "timeline", ({ enumerable: true, get: function () { return _indexEs2.timeline; } })); Object.defineProperty(exports, "withControls", ({ enumerable: true, get: function () { return _controlsEs.withControls; } })); var _indexEs = __webpack_require__(/*! ./animate/index.es.js */ "../../../node_modules/@motionone/dom/dist/animate/index.es.js"); var _animateStyleEs = __webpack_require__(/*! ./animate/animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); var _indexEs2 = __webpack_require__(/*! ./timeline/index.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/index.es.js"); var _staggerEs = __webpack_require__(/*! ./utils/stagger.es.js */ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js"); var _indexEs3 = __webpack_require__(/*! ./easing/spring/index.es.js */ "../../../node_modules/@motionone/dom/dist/easing/spring/index.es.js"); var _indexEs4 = __webpack_require__(/*! ./easing/glide/index.es.js */ "../../../node_modules/@motionone/dom/dist/easing/glide/index.es.js"); var _styleEs = __webpack_require__(/*! ./animate/style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/style.es.js"); var _inViewEs = __webpack_require__(/*! ./gestures/in-view.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js"); var _indexEs5 = __webpack_require__(/*! ./gestures/resize/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/resize/index.es.js"); var _indexEs6 = __webpack_require__(/*! ./gestures/scroll/index.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/index.es.js"); var _presetsEs = __webpack_require__(/*! ./gestures/scroll/offsets/presets.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/scroll/offsets/presets.es.js"); var _controlsEs = __webpack_require__(/*! ./animate/utils/controls.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js"); var _dataEs = __webpack_require__(/*! ./animate/data.es.js */ "../../../node_modules/@motionone/dom/dist/animate/data.es.js"); var _getStyleNameEs = __webpack_require__(/*! ./animate/utils/get-style-name.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/get-style-name.es.js"); var _indexEs7 = __webpack_require__(/*! ./state/index.es.js */ "../../../node_modules/@motionone/dom/dist/state/index.es.js"); var _styleObjectEs = __webpack_require__(/*! ./animate/utils/style-object.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/style-object.es.js"); var _styleStringEs = __webpack_require__(/*! ./animate/utils/style-string.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/style-string.es.js"); /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/gestures/hover.es.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/gestures/hover.es.js ***! \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hover = void 0; var _eventsEs = __webpack_require__(/*! ../utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); const mouseEvent = (element, name, action) => event => { if (event.pointerType && event.pointerType !== "mouse") return; action(); (0, _eventsEs.dispatchPointerEvent)(element, name, event); }; const hover = { isActive: options => Boolean(options.hover), subscribe: (element, _ref) => { let { enable, disable } = _ref; const onEnter = mouseEvent(element, "hoverstart", enable); const onLeave = mouseEvent(element, "hoverend", disable); element.addEventListener("pointerenter", onEnter); element.addEventListener("pointerleave", onLeave); return () => { element.removeEventListener("pointerenter", onEnter); element.removeEventListener("pointerleave", onLeave); }; } }; exports.hover = hover; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/gestures/in-view.es.js": /*!******************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/gestures/in-view.es.js ***! \******************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.inView = void 0; var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); var _eventsEs = __webpack_require__(/*! ../utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); var _inViewEs = __webpack_require__(/*! ../../gestures/in-view.es.js */ "../../../node_modules/@motionone/dom/dist/gestures/in-view.es.js"); const inView = { isActive: options => Boolean(options.inView), subscribe: (element, _ref, _ref2) => { let { enable, disable } = _ref; let { inViewOptions = {} } = _ref2; const { once } = inViewOptions, viewOptions = (0, _tslib.__rest)(inViewOptions, ["once"]); return (0, _inViewEs.inView)(element, enterEntry => { enable(); (0, _eventsEs.dispatchViewEvent)(element, "viewenter", enterEntry); if (!once) { return leaveEntry => { disable(); (0, _eventsEs.dispatchViewEvent)(element, "viewleave", leaveEntry); }; } }, viewOptions); } }; exports.inView = inView; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/gestures/press.es.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/gestures/press.es.js ***! \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.press = void 0; var _eventsEs = __webpack_require__(/*! ../utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); const press = { isActive: options => Boolean(options.press), subscribe: (element, _ref) => { let { enable, disable } = _ref; const onPointerUp = event => { disable(); (0, _eventsEs.dispatchPointerEvent)(element, "pressend", event); window.removeEventListener("pointerup", onPointerUp); }; const onPointerDown = event => { enable(); (0, _eventsEs.dispatchPointerEvent)(element, "pressstart", event); window.addEventListener("pointerup", onPointerUp); }; element.addEventListener("pointerdown", onPointerDown); return () => { element.removeEventListener("pointerdown", onPointerDown); window.removeEventListener("pointerup", onPointerUp); }; } }; exports.press = press; /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/index.es.js": /*!*******************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/index.es.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createMotionState = createMotionState; exports.mountedStates = void 0; var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); var _heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _animateStyleEs = __webpack_require__(/*! ../animate/animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); var _styleEs = __webpack_require__(/*! ../animate/style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/style.es.js"); var _optionsEs = __webpack_require__(/*! ../animate/utils/options.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js"); var _hasChangedEs = __webpack_require__(/*! ./utils/has-changed.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/has-changed.es.js"); var _resolveVariantEs = __webpack_require__(/*! ./utils/resolve-variant.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js"); var _scheduleEs = __webpack_require__(/*! ./utils/schedule.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/schedule.es.js"); var _inViewEs = __webpack_require__(/*! ./gestures/in-view.es.js */ "../../../node_modules/@motionone/dom/dist/state/gestures/in-view.es.js"); var _hoverEs = __webpack_require__(/*! ./gestures/hover.es.js */ "../../../node_modules/@motionone/dom/dist/state/gestures/hover.es.js"); var _pressEs = __webpack_require__(/*! ./gestures/press.es.js */ "../../../node_modules/@motionone/dom/dist/state/gestures/press.es.js"); var _eventsEs = __webpack_require__(/*! ./utils/events.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js"); const gestures = { inView: _inViewEs.inView, hover: _hoverEs.hover, press: _pressEs.press }; /** * A list of state types, in priority order. If a value is defined in * a righter-most type, it will override any definition in a lefter-most. */ const stateTypes = ["initial", "animate", ...Object.keys(gestures), "exit"]; /** * A global store of all generated motion states. This can be used to lookup * a motion state for a given Element. */ const mountedStates = new WeakMap(); exports.mountedStates = mountedStates; function createMotionState() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; let parent = arguments.length > 1 ? arguments[1] : undefined; /** * The element represented by the motion state. This is an empty reference * when we create the state to support SSR and allow for later mounting * in view libraries. * * @ts-ignore */ let element; /** * Calculate a depth that we can use to order motion states by tree depth. */ let depth = parent ? parent.getDepth() + 1 : 0; /** * Track which states are currently active. */ const activeStates = { initial: true, animate: true }; /** * A map of functions that, when called, will remove event listeners for * a given gesture. */ const gestureSubscriptions = {}; /** * Initialise a context to share through motion states. This * will be populated by variant names (if any). */ const context = {}; for (const name of stateTypes) { context[name] = typeof options[name] === "string" ? options[name] : parent === null || parent === void 0 ? void 0 : parent.getContext()[name]; } /** * If initial is set to false we use the animate prop as the initial * animation state. */ const initialVariantSource = options.initial === false ? "animate" : "initial"; /** * Destructure an initial target out from the resolved initial variant. */ let _a = (0, _resolveVariantEs.resolveVariant)(options[initialVariantSource] || context[initialVariantSource], options.variants) || {}, target = (0, _tslib.__rest)(_a, ["transition"]); /** * The base target is a cached map of values that we'll use to animate * back to if a value is removed from all active state types. This * is usually the initial value as read from the DOM, for instance if * it hasn't been defined in initial. */ const baseTarget = Object.assign({}, target); /** * A generator that will be processed by the global animation scheduler. * This yeilds when it switches from reading the DOM to writing to it * to prevent layout thrashing. */ function* animateUpdates() { var _a, _b; const prevTarget = target; target = {}; const animationOptions = {}; for (const name of stateTypes) { if (!activeStates[name]) continue; const variant = (0, _resolveVariantEs.resolveVariant)(options[name]); if (!variant) continue; for (const key in variant) { if (key === "transition") continue; target[key] = variant[key]; animationOptions[key] = (0, _optionsEs.getOptions)((_b = (_a = variant.transition) !== null && _a !== void 0 ? _a : options.transition) !== null && _b !== void 0 ? _b : {}, key); } } const allTargetKeys = new Set([...Object.keys(target), ...Object.keys(prevTarget)]); const animationFactories = []; allTargetKeys.forEach(key => { var _a; if (target[key] === undefined) { target[key] = baseTarget[key]; } if ((0, _hasChangedEs.hasChanged)(prevTarget[key], target[key])) { (_a = baseTarget[key]) !== null && _a !== void 0 ? _a : baseTarget[key] = _styleEs.style.get(element, key); animationFactories.push((0, _animateStyleEs.animateStyle)(element, key, target[key], animationOptions[key])); } }); // Wait for all animation states to read from the DOM yield; const animations = animationFactories.map(factory => factory()).filter(Boolean); if (!animations.length) return; const animationTarget = target; element.dispatchEvent((0, _eventsEs.motionEvent)("motionstart", animationTarget)); Promise.all(animations.map(animation => animation.finished)).then(() => { element.dispatchEvent((0, _eventsEs.motionEvent)("motioncomplete", animationTarget)); }).catch(_utils.noop); } const setGesture = (name, isActive) => () => { activeStates[name] = isActive; (0, _scheduleEs.scheduleAnimation)(state); }; const updateGestureSubscriptions = () => { for (const name in gestures) { const isGestureActive = gestures[name].isActive(options); const remove = gestureSubscriptions[name]; if (isGestureActive && !remove) { gestureSubscriptions[name] = gestures[name].subscribe(element, { enable: setGesture(name, true), disable: setGesture(name, false) }, options); } else if (!isGestureActive && remove) { remove(); delete gestureSubscriptions[name]; } } }; const state = { update: newOptions => { if (!element) return; options = newOptions; updateGestureSubscriptions(); (0, _scheduleEs.scheduleAnimation)(state); }, setActive: (name, isActive) => { if (!element) return; activeStates[name] = isActive; (0, _scheduleEs.scheduleAnimation)(state); }, animateUpdates, getDepth: () => depth, getTarget: () => target, getOptions: () => options, getContext: () => context, mount: newElement => { (0, _heyListen.invariant)(Boolean(newElement), "Animation state must be mounted with valid Element"); element = newElement; mountedStates.set(element, state); updateGestureSubscriptions(); return () => { mountedStates.delete(element); (0, _scheduleEs.unscheduleAnimation)(state); for (const key in gestureSubscriptions) { gestureSubscriptions[key](); } }; }, isMounted: () => Boolean(element) }; return state; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/utils/events.es.js": /*!**************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/utils/events.es.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.dispatchPointerEvent = dispatchPointerEvent; exports.dispatchViewEvent = dispatchViewEvent; exports.motionEvent = void 0; const motionEvent = (name, target) => new CustomEvent(name, { detail: { target } }); exports.motionEvent = motionEvent; function dispatchPointerEvent(element, name, event) { element.dispatchEvent(new CustomEvent(name, { detail: { originalEvent: event } })); } function dispatchViewEvent(element, name, entry) { element.dispatchEvent(new CustomEvent(name, { detail: { originalEntry: entry } })); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/utils/has-changed.es.js": /*!*******************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/utils/has-changed.es.js ***! \*******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hasChanged = hasChanged; exports.shallowCompare = shallowCompare; function hasChanged(a, b) { if (typeof a !== typeof b) return true; if (Array.isArray(a) && Array.isArray(b)) return !shallowCompare(a, b); return a !== b; } function shallowCompare(next, prev) { const prevLength = prev.length; if (prevLength !== next.length) return false; for (let i = 0; i < prevLength; i++) { if (prev[i] !== next[i]) return false; } return true; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/utils/is-variant.es.js": /*!******************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/utils/is-variant.es.js ***! \******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isVariant = isVariant; function isVariant(definition) { return typeof definition === "object"; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js": /*!***********************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/utils/resolve-variant.es.js ***! \***********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveVariant = resolveVariant; var _isVariantEs = __webpack_require__(/*! ./is-variant.es.js */ "../../../node_modules/@motionone/dom/dist/state/utils/is-variant.es.js"); function resolveVariant(definition, variants) { if ((0, _isVariantEs.isVariant)(definition)) { return definition; } else if (definition && variants) { return variants[definition]; } } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/state/utils/schedule.es.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/state/utils/schedule.es.js ***! \****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.scheduleAnimation = scheduleAnimation; exports.unscheduleAnimation = unscheduleAnimation; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); let scheduled = undefined; function processScheduledAnimations() { if (!scheduled) return; const generators = scheduled.sort(compareByDepth).map(fireAnimateUpdates); generators.forEach(fireNext); generators.forEach(fireNext); scheduled = undefined; } function scheduleAnimation(state) { if (!scheduled) { scheduled = [state]; requestAnimationFrame(processScheduledAnimations); } else { (0, _utils.addUniqueItem)(scheduled, state); } } function unscheduleAnimation(state) { scheduled && (0, _utils.removeItem)(scheduled, state); } const compareByDepth = (a, b) => a.getDepth() - b.getDepth(); const fireAnimateUpdates = state => state.animateUpdates(); const fireNext = iterator => iterator.next(); /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/timeline/index.es.js": /*!**********************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/timeline/index.es.js ***! \**********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createAnimationsFromTimeline = createAnimationsFromTimeline; exports.timeline = timeline; var _tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); var _heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _staggerEs = __webpack_require__(/*! ../utils/stagger.es.js */ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js"); var _animateStyleEs = __webpack_require__(/*! ../animate/animate-style.es.js */ "../../../node_modules/@motionone/dom/dist/animate/animate-style.es.js"); var _controlsEs = __webpack_require__(/*! ../animate/utils/controls.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/controls.es.js"); var _keyframesEs = __webpack_require__(/*! ../animate/utils/keyframes.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/keyframes.es.js"); var _optionsEs = __webpack_require__(/*! ../animate/utils/options.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/options.es.js"); var _resolveElementsEs = __webpack_require__(/*! ../utils/resolve-elements.es.js */ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js"); var _transformsEs = __webpack_require__(/*! ../animate/utils/transforms.es.js */ "../../../node_modules/@motionone/dom/dist/animate/utils/transforms.es.js"); var _calcTimeEs = __webpack_require__(/*! ./utils/calc-time.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js"); var _editEs = __webpack_require__(/*! ./utils/edit.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/utils/edit.es.js"); var _sortEs = __webpack_require__(/*! ./utils/sort.es.js */ "../../../node_modules/@motionone/dom/dist/timeline/utils/sort.es.js"); function timeline(definition) { let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var _a; const animationDefinitions = createAnimationsFromTimeline(definition, options); /** * Create and start animations */ const animationFactories = animationDefinitions.map(definition => (0, _animateStyleEs.animateStyle)(...definition)).filter(Boolean); return (0, _controlsEs.withControls)(animationFactories, options, // Get the duration from the first animation definition (_a = animationDefinitions[0]) === null || _a === void 0 ? void 0 : _a[3].duration); } function createAnimationsFromTimeline(definition) { let _a = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var { defaultOptions = {} } = _a, timelineOptions = (0, _tslib.__rest)(_a, ["defaultOptions"]); const animationDefinitions = []; const elementSequences = new Map(); const elementCache = {}; const timeLabels = new Map(); let prevTime = 0; let currentTime = 0; let totalDuration = 0; /** * Build the timeline by mapping over the definition array and converting * the definitions into keyframes and offsets with absolute time values. * These will later get converted into relative offsets in a second pass. */ for (let i = 0; i < definition.length; i++) { const segment = definition[i]; /** * If this is a timeline label, mark it and skip the rest of this iteration. */ if ((0, _utils.isString)(segment)) { timeLabels.set(segment, currentTime); continue; } else if (!Array.isArray(segment)) { timeLabels.set(segment.name, (0, _calcTimeEs.calcNextTime)(currentTime, segment.at, prevTime, timeLabels)); continue; } const [elementDefinition, keyframes, options = {}] = segment; /** * If a relative or absolute time value has been specified we need to resolve * it in relation to the currentTime. */ if (options.at !== undefined) { currentTime = (0, _calcTimeEs.calcNextTime)(currentTime, options.at, prevTime, timeLabels); } /** * Keep track of the maximum duration in this definition. This will be * applied to currentTime once the definition has been parsed. */ let maxDuration = 0; /** * Find all the elements specified in the definition and parse value * keyframes from their timeline definitions. */ const elements = (0, _resolveElementsEs.resolveElements)(elementDefinition, elementCache); const numElements = elements.length; for (let elementIndex = 0; elementIndex < numElements; elementIndex++) { const element = elements[elementIndex]; const elementSequence = getElementSequence(element, elementSequences); for (const key in keyframes) { const valueSequence = getValueSequence(key, elementSequence); let valueKeyframes = (0, _keyframesEs.keyframesList)(keyframes[key]); const valueOptions = (0, _optionsEs.getOptions)(options, key); let { duration = defaultOptions.duration || _utils.defaults.duration, easing = defaultOptions.easing || _utils.defaults.easing } = valueOptions; if ((0, _utils.isEasingGenerator)(easing)) { const valueIsTransform = (0, _transformsEs.isTransform)(key); (0, _heyListen.invariant)(valueKeyframes.length === 2 || !valueIsTransform, "spring must be provided 2 keyframes within timeline"); const custom = easing.createAnimation(valueKeyframes, // TODO We currently only support explicit keyframes // so this doesn't currently read from the DOM () => "0", valueIsTransform); easing = custom.easing; if (custom.keyframes !== undefined) valueKeyframes = custom.keyframes; if (custom.duration !== undefined) duration = custom.duration; } const delay = (0, _staggerEs.resolveOption)(options.delay, elementIndex, numElements) || 0; const startTime = currentTime + delay; const targetTime = startTime + duration; /** * */ let { offset = (0, _utils.defaultOffset)(valueKeyframes.length) } = valueOptions; /** * If there's only one offset of 0, fill in a second with length 1 * * TODO: Ensure there's a test that covers this removal */ if (offset.length === 1 && offset[0] === 0) { offset[1] = 1; } /** * Fill out if offset if fewer offsets than keyframes */ const remainder = length - valueKeyframes.length; remainder > 0 && (0, _utils.fillOffset)(offset, remainder); /** * If only one value has been set, ie [1], push a null to the start of * the keyframe array. This will let us mark a keyframe at this point * that will later be hydrated with the previous value. */ valueKeyframes.length === 1 && valueKeyframes.unshift(null); /** * Add keyframes, mapping offsets to absolute time. */ (0, _editEs.addKeyframes)(valueSequence, valueKeyframes, easing, offset, startTime, targetTime); maxDuration = Math.max(delay + duration, maxDuration); totalDuration = Math.max(targetTime, totalDuration); } } prevTime = currentTime; currentTime += maxDuration; } /** * For every element and value combination create a new animation. */ elementSequences.forEach((valueSequences, element) => { for (const key in valueSequences) { const valueSequence = valueSequences[key]; /** * Arrange all the keyframes in ascending time order. */ valueSequence.sort(_sortEs.compareByTime); const keyframes = []; const valueOffset = []; const valueEasing = []; /** * For each keyframe, translate absolute times into * relative offsets based on the total duration of the timeline. */ for (let i = 0; i < valueSequence.length; i++) { const { at, value, easing } = valueSequence[i]; keyframes.push(value); valueOffset.push((0, _utils.progress)(0, totalDuration, at)); valueEasing.push(easing || _utils.defaults.easing); } /** * If the first keyframe doesn't land on offset: 0 * provide one by duplicating the initial keyframe. This ensures * it snaps to the first keyframe when the animation starts. */ if (valueOffset[0] !== 0) { valueOffset.unshift(0); keyframes.unshift(keyframes[0]); valueEasing.unshift("linear"); } /** * If the last keyframe doesn't land on offset: 1 * provide one with a null wildcard value. This will ensure it * stays static until the end of the animation. */ if (valueOffset[valueOffset.length - 1] !== 1) { valueOffset.push(1); keyframes.push(null); } animationDefinitions.push([element, key, keyframes, Object.assign(Object.assign(Object.assign({}, defaultOptions), { duration: totalDuration, easing: valueEasing, offset: valueOffset }), timelineOptions)]); } }); return animationDefinitions; } function getElementSequence(element, sequences) { !sequences.has(element) && sequences.set(element, {}); return sequences.get(element); } function getValueSequence(name, sequences) { if (!sequences[name]) sequences[name] = []; return sequences[name]; } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js": /*!********************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/timeline/utils/calc-time.es.js ***! \********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.calcNextTime = calcNextTime; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); function calcNextTime(current, next, prev, labels) { var _a; if ((0, _utils.isNumber)(next)) { return next; } else if (next.startsWith("-") || next.startsWith("+")) { return Math.max(0, current + parseFloat(next)); } else if (next === "<") { return prev; } else { return (_a = labels.get(next)) !== null && _a !== void 0 ? _a : current; } } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/timeline/utils/edit.es.js": /*!***************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/timeline/utils/edit.es.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addKeyframes = addKeyframes; exports.eraseKeyframes = eraseKeyframes; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); function eraseKeyframes(sequence, startTime, endTime) { for (let i = 0; i < sequence.length; i++) { const keyframe = sequence[i]; if (keyframe.at > startTime && keyframe.at < endTime) { (0, _utils.removeItem)(sequence, keyframe); // If we remove this item we have to push the pointer back one i--; } } } function addKeyframes(sequence, keyframes, easing, offset, startTime, endTime) { /** * Erase every existing value between currentTime and targetTime, * this will essentially splice this timeline into any currently * defined ones. */ eraseKeyframes(sequence, startTime, endTime); for (let i = 0; i < keyframes.length; i++) { sequence.push({ value: keyframes[i], at: (0, _utils.mix)(startTime, endTime, offset[i]), easing: (0, _utils.getEasingForSegment)(easing, i) }); } } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/timeline/utils/sort.es.js": /*!***************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/timeline/utils/sort.es.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.compareByTime = compareByTime; function compareByTime(a, b) { if (a.at === b.at) { return a.value === null ? 1 : -1; } else { return a.at - b.at; } } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js": /*!******************************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/utils/resolve-elements.es.js ***! \******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.resolveElements = resolveElements; function resolveElements(elements, selectorCache) { var _a; if (typeof elements === "string") { if (selectorCache) { (_a = selectorCache[elements]) !== null && _a !== void 0 ? _a : selectorCache[elements] = document.querySelectorAll(elements); elements = selectorCache[elements]; } else { elements = document.querySelectorAll(elements); } } else if (elements instanceof Element) { elements = [elements]; } /** * Return an empty array */ return Array.from(elements || []); } /***/ }), /***/ "../../../node_modules/@motionone/dom/dist/utils/stagger.es.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@motionone/dom/dist/utils/stagger.es.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getFromIndex = getFromIndex; exports.resolveOption = resolveOption; exports.stagger = stagger; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _animation = __webpack_require__(/*! @motionone/animation */ "../../../node_modules/@motionone/animation/dist/index.es.js"); function stagger() { let duration = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.1; let { start = 0, from = 0, easing } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; return (i, total) => { const fromIndex = (0, _utils.isNumber)(from) ? from : getFromIndex(from, total); const distance = Math.abs(fromIndex - i); let delay = duration * distance; if (easing) { const maxDelay = total * duration; const easingFunction = (0, _animation.getEasingFunction)(easing); delay = easingFunction(delay / maxDelay) * maxDelay; } return start + delay; }; } function getFromIndex(from, total) { if (from === "first") { return 0; } else { const lastIndex = total - 1; return from === "last" ? lastIndex : lastIndex / 2; } } function resolveOption(option, i, total) { return typeof option === "function" ? option(i, total) : option; } /***/ }), /***/ "../../../node_modules/@motionone/easing/dist/cubic-bezier.es.js": /*!***********************************************************************!*\ !*** ../../../node_modules/@motionone/easing/dist/cubic-bezier.es.js ***! \***********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.cubicBezier = cubicBezier; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); /* Bezier function generator This has been modified from Gaëtan Renaudeau's BezierEasing https://github.com/gre/bezier-easing/blob/master/src/index.js https://github.com/gre/bezier-easing/blob/master/LICENSE I've removed the newtonRaphsonIterate algo because in benchmarking it wasn't noticiably faster than binarySubdivision, indeed removing it usually improved times, depending on the curve. I also removed the lookup table, as for the added bundle size and loop we're only cutting ~4 or so subdivision iterations. I bumped the max iterations up to 12 to compensate and this still tended to be faster for no perceivable loss in accuracy. Usage const easeOut = cubicBezier(.17,.67,.83,.67); const x = easeOut(0.5); // returns 0.627... */ // Returns x(t) given t, x1, and x2, or y(t) given t, y1, and y2. const calcBezier = (t, a1, a2) => (((1.0 - 3.0 * a2 + 3.0 * a1) * t + (3.0 * a2 - 6.0 * a1)) * t + 3.0 * a1) * t; const subdivisionPrecision = 0.0000001; const subdivisionMaxIterations = 12; function binarySubdivide(x, lowerBound, upperBound, mX1, mX2) { let currentX; let currentT; let i = 0; do { currentT = lowerBound + (upperBound - lowerBound) / 2.0; currentX = calcBezier(currentT, mX1, mX2) - x; if (currentX > 0.0) { upperBound = currentT; } else { lowerBound = currentT; } } while (Math.abs(currentX) > subdivisionPrecision && ++i < subdivisionMaxIterations); return currentT; } function cubicBezier(mX1, mY1, mX2, mY2) { // If this is a linear gradient, return linear easing if (mX1 === mY1 && mX2 === mY2) return _utils.noopReturn; const getTForX = aX => binarySubdivide(aX, 0, 1, mX1, mX2); // If animation is at start/end, return t without easing return t => t === 0 || t === 1 ? t : calcBezier(getTForX(t), mY1, mY2); } /***/ }), /***/ "../../../node_modules/@motionone/easing/dist/index.es.js": /*!****************************************************************!*\ !*** ../../../node_modules/@motionone/easing/dist/index.es.js ***! \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "cubicBezier", ({ enumerable: true, get: function () { return _cubicBezierEs.cubicBezier; } })); Object.defineProperty(exports, "steps", ({ enumerable: true, get: function () { return _stepsEs.steps; } })); var _cubicBezierEs = __webpack_require__(/*! ./cubic-bezier.es.js */ "../../../node_modules/@motionone/easing/dist/cubic-bezier.es.js"); var _stepsEs = __webpack_require__(/*! ./steps.es.js */ "../../../node_modules/@motionone/easing/dist/steps.es.js"); /***/ }), /***/ "../../../node_modules/@motionone/easing/dist/steps.es.js": /*!****************************************************************!*\ !*** ../../../node_modules/@motionone/easing/dist/steps.es.js ***! \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.steps = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); const steps = function (steps) { let direction = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "end"; return progress => { progress = direction === "end" ? Math.min(progress, 0.999) : Math.max(progress, 0.001); const expanded = progress * steps; const rounded = direction === "end" ? Math.floor(expanded) : Math.ceil(expanded); return (0, _utils.clamp)(0, 1, rounded / steps); }; }; exports.steps = steps; /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/glide/index.es.js": /*!**************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/glide/index.es.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.glide = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _velocityEs = __webpack_require__(/*! ../utils/velocity.es.js */ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js"); var _indexEs = __webpack_require__(/*! ../spring/index.es.js */ "../../../node_modules/@motionone/generators/dist/spring/index.es.js"); const glide = _ref => { let { from = 0, velocity = 0.0, power = 0.8, decay = 0.325, bounceDamping, bounceStiffness, changeTarget, min, max, restDistance = 0.5, restSpeed } = _ref; decay = _utils.time.ms(decay); const state = { hasReachedTarget: false, done: false, current: from, target: from }; const isOutOfBounds = v => min !== undefined && v < min || max !== undefined && v > max; const nearestBoundary = v => { if (min === undefined) return max; if (max === undefined) return min; return Math.abs(min - v) < Math.abs(max - v) ? min : max; }; let amplitude = power * velocity; const ideal = from + amplitude; const target = changeTarget === undefined ? ideal : changeTarget(ideal); state.target = target; /** * If the target has changed we need to re-calculate the amplitude, otherwise * the animation will start from the wrong position. */ if (target !== ideal) amplitude = target - from; const calcDelta = t => -amplitude * Math.exp(-t / decay); const calcLatest = t => target + calcDelta(t); const applyFriction = t => { const delta = calcDelta(t); const latest = calcLatest(t); state.done = Math.abs(delta) <= restDistance; state.current = state.done ? target : latest; }; /** * Ideally this would resolve for t in a stateless way, we could * do that by always precalculating the animation but as we know * this will be done anyway we can assume that spring will * be discovered during that. */ let timeReachedBoundary; let spring$1; const checkCatchBoundary = t => { if (!isOutOfBounds(state.current)) return; timeReachedBoundary = t; spring$1 = (0, _indexEs.spring)({ from: state.current, to: nearestBoundary(state.current), velocity: (0, _velocityEs.calcGeneratorVelocity)(calcLatest, t, state.current), damping: bounceDamping, stiffness: bounceStiffness, restDistance, restSpeed }); }; checkCatchBoundary(0); return t => { /** * We need to resolve the friction to figure out if we need a * spring but we don't want to do this twice per frame. So here * we flag if we updated for this frame and later if we did * we can skip doing it again. */ let hasUpdatedFrame = false; if (!spring$1 && timeReachedBoundary === undefined) { hasUpdatedFrame = true; applyFriction(t); checkCatchBoundary(t); } /** * If we have a spring and the provided t is beyond the moment the friction * animation crossed the min/max boundary, use the spring. */ if (timeReachedBoundary !== undefined && t > timeReachedBoundary) { state.hasReachedTarget = true; return spring$1(t - timeReachedBoundary); } else { state.hasReachedTarget = false; !hasUpdatedFrame && applyFriction(t); return state; } }; }; exports.glide = glide; /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/index.es.js": /*!********************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/index.es.js ***! \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "calcGeneratorVelocity", ({ enumerable: true, get: function () { return _velocityEs.calcGeneratorVelocity; } })); Object.defineProperty(exports, "glide", ({ enumerable: true, get: function () { return _indexEs.glide; } })); Object.defineProperty(exports, "pregenerateKeyframes", ({ enumerable: true, get: function () { return _pregenerateKeyframesEs.pregenerateKeyframes; } })); Object.defineProperty(exports, "spring", ({ enumerable: true, get: function () { return _indexEs2.spring; } })); var _indexEs = __webpack_require__(/*! ./glide/index.es.js */ "../../../node_modules/@motionone/generators/dist/glide/index.es.js"); var _indexEs2 = __webpack_require__(/*! ./spring/index.es.js */ "../../../node_modules/@motionone/generators/dist/spring/index.es.js"); var _pregenerateKeyframesEs = __webpack_require__(/*! ./utils/pregenerate-keyframes.es.js */ "../../../node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js"); var _velocityEs = __webpack_require__(/*! ./utils/velocity.es.js */ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js"); /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/spring/defaults.es.js": /*!******************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/spring/defaults.es.js ***! \******************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaults = void 0; const defaults = { stiffness: 100.0, damping: 10.0, mass: 1.0 }; exports.defaults = defaults; /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/spring/index.es.js": /*!***************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/spring/index.es.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.spring = void 0; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); var _defaultsEs = __webpack_require__(/*! ./defaults.es.js */ "../../../node_modules/@motionone/generators/dist/spring/defaults.es.js"); var _utilsEs = __webpack_require__(/*! ./utils.es.js */ "../../../node_modules/@motionone/generators/dist/spring/utils.es.js"); var _hasReachedTargetEs = __webpack_require__(/*! ../utils/has-reached-target.es.js */ "../../../node_modules/@motionone/generators/dist/utils/has-reached-target.es.js"); var _velocityEs = __webpack_require__(/*! ../utils/velocity.es.js */ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js"); const spring = function () { let { stiffness = _defaultsEs.defaults.stiffness, damping = _defaultsEs.defaults.damping, mass = _defaultsEs.defaults.mass, from = 0, to = 1, velocity = 0.0, restSpeed = 2, restDistance = 0.5 } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; velocity = velocity ? _utils.time.s(velocity) : 0.0; const state = { done: false, hasReachedTarget: false, current: from, target: to }; const initialDelta = to - from; const undampedAngularFreq = Math.sqrt(stiffness / mass) / 1000; const dampingRatio = (0, _utilsEs.calcDampingRatio)(stiffness, damping, mass); let resolveSpring; if (dampingRatio < 1) { const angularFreq = undampedAngularFreq * Math.sqrt(1 - dampingRatio * dampingRatio); // Underdamped spring (bouncy) resolveSpring = t => to - Math.exp(-dampingRatio * undampedAngularFreq * t) * ((-velocity + dampingRatio * undampedAngularFreq * initialDelta) / angularFreq * Math.sin(angularFreq * t) + initialDelta * Math.cos(angularFreq * t)); } else { // Critically damped spring resolveSpring = t => { return to - Math.exp(-undampedAngularFreq * t) * (initialDelta + (-velocity + undampedAngularFreq * initialDelta) * t); }; } return t => { state.current = resolveSpring(t); const currentVelocity = t === 0 ? velocity : (0, _velocityEs.calcGeneratorVelocity)(resolveSpring, t, state.current); const isBelowVelocityThreshold = Math.abs(currentVelocity) <= restSpeed; const isBelowDisplacementThreshold = Math.abs(to - state.current) <= restDistance; state.done = isBelowVelocityThreshold && isBelowDisplacementThreshold; state.hasReachedTarget = (0, _hasReachedTargetEs.hasReachedTarget)(from, to, state.current); return state; }; }; exports.spring = spring; /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/spring/utils.es.js": /*!***************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/spring/utils.es.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.calcDampingRatio = void 0; var _defaultsEs = __webpack_require__(/*! ./defaults.es.js */ "../../../node_modules/@motionone/generators/dist/spring/defaults.es.js"); const calcDampingRatio = function () { let stiffness = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _defaultsEs.defaults.stiffness; let damping = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _defaultsEs.defaults.damping; let mass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _defaultsEs.defaults.mass; return damping / (2 * Math.sqrt(stiffness * mass)); }; exports.calcDampingRatio = calcDampingRatio; /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/utils/has-reached-target.es.js": /*!***************************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/utils/has-reached-target.es.js ***! \***************************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.hasReachedTarget = hasReachedTarget; function hasReachedTarget(origin, target, current) { return origin < target && current >= target || origin > target && current <= target; } /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js": /*!******************************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/utils/pregenerate-keyframes.es.js ***! \******************************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.pregenerateKeyframes = pregenerateKeyframes; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); const timeStep = 10; const maxDuration = 10000; function pregenerateKeyframes(generator) { let toUnit = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.noopReturn; let overshootDuration = undefined; let timestamp = timeStep; let state = generator(0); const keyframes = [toUnit(state.current)]; while (!state.done && timestamp < maxDuration) { state = generator(timestamp); keyframes.push(toUnit(state.done ? state.target : state.current)); if (overshootDuration === undefined && state.hasReachedTarget) { overshootDuration = timestamp; } timestamp += timeStep; } const duration = timestamp - timeStep; /** * If generating an animation that didn't actually move, * generate a second keyframe so we have an origin and target. */ if (keyframes.length === 1) keyframes.push(state.current); return { keyframes, duration: duration / 1000, overshootDuration: (overshootDuration !== null && overshootDuration !== void 0 ? overshootDuration : duration) / 1000 }; } /***/ }), /***/ "../../../node_modules/@motionone/generators/dist/utils/velocity.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/generators/dist/utils/velocity.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.calcGeneratorVelocity = calcGeneratorVelocity; var _utils = __webpack_require__(/*! @motionone/utils */ "../../../node_modules/@motionone/utils/dist/index.es.js"); const sampleT = 5; // ms function calcGeneratorVelocity(resolveValue, t, current) { const prevT = Math.max(t - sampleT, 0); return (0, _utils.velocityPerSecond)(current - resolveValue(prevT), t - prevT); } /***/ }), /***/ "../../../node_modules/@motionone/types/dist/MotionValue.es.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@motionone/types/dist/MotionValue.es.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.MotionValue = void 0; /** * The MotionValue tracks the state of a single animatable * value. Currently, updatedAt and current are unused. The * long term idea is to use this to minimise the number * of DOM reads, and to abstract the DOM interactions here. */ class MotionValue { setAnimation(animation) { this.animation = animation; animation === null || animation === void 0 ? void 0 : animation.finished.then(() => this.clearAnimation()).catch(() => {}); } clearAnimation() { this.animation = this.generator = undefined; } } exports.MotionValue = MotionValue; /***/ }), /***/ "../../../node_modules/@motionone/types/dist/index.es.js": /*!***************************************************************!*\ !*** ../../../node_modules/@motionone/types/dist/index.es.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "MotionValue", ({ enumerable: true, get: function () { return _MotionValueEs.MotionValue; } })); var _MotionValueEs = __webpack_require__(/*! ./MotionValue.es.js */ "../../../node_modules/@motionone/types/dist/MotionValue.es.js"); /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/array.es.js": /*!***************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/array.es.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.addUniqueItem = addUniqueItem; exports.removeItem = removeItem; function addUniqueItem(array, item) { array.indexOf(item) === -1 && array.push(item); } function removeItem(arr, item) { const index = arr.indexOf(item); index > -1 && arr.splice(index, 1); } /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/clamp.es.js": /*!***************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/clamp.es.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.clamp = void 0; const clamp = (min, max, v) => Math.min(Math.max(v, min), max); exports.clamp = clamp; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/defaults.es.js": /*!******************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/defaults.es.js ***! \******************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaults = void 0; const defaults = { duration: 0.3, delay: 0, endDelay: 0, repeat: 0, easing: "ease" }; exports.defaults = defaults; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/easing.es.js": /*!****************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/easing.es.js ***! \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getEasingForSegment = getEasingForSegment; var _isEasingListEs = __webpack_require__(/*! ./is-easing-list.es.js */ "../../../node_modules/@motionone/utils/dist/is-easing-list.es.js"); var _wrapEs = __webpack_require__(/*! ./wrap.es.js */ "../../../node_modules/@motionone/utils/dist/wrap.es.js"); function getEasingForSegment(easing, i) { return (0, _isEasingListEs.isEasingList)(easing) ? easing[(0, _wrapEs.wrap)(0, easing.length, i)] : easing; } /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/index.es.js": /*!***************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/index.es.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "addUniqueItem", ({ enumerable: true, get: function () { return _arrayEs.addUniqueItem; } })); Object.defineProperty(exports, "clamp", ({ enumerable: true, get: function () { return _clampEs.clamp; } })); Object.defineProperty(exports, "defaultOffset", ({ enumerable: true, get: function () { return _offsetEs.defaultOffset; } })); Object.defineProperty(exports, "defaults", ({ enumerable: true, get: function () { return _defaultsEs.defaults; } })); Object.defineProperty(exports, "fillOffset", ({ enumerable: true, get: function () { return _offsetEs.fillOffset; } })); Object.defineProperty(exports, "getEasingForSegment", ({ enumerable: true, get: function () { return _easingEs.getEasingForSegment; } })); Object.defineProperty(exports, "interpolate", ({ enumerable: true, get: function () { return _interpolateEs.interpolate; } })); Object.defineProperty(exports, "isCubicBezier", ({ enumerable: true, get: function () { return _isCubicBezierEs.isCubicBezier; } })); Object.defineProperty(exports, "isEasingGenerator", ({ enumerable: true, get: function () { return _isEasingGeneratorEs.isEasingGenerator; } })); Object.defineProperty(exports, "isEasingList", ({ enumerable: true, get: function () { return _isEasingListEs.isEasingList; } })); Object.defineProperty(exports, "isFunction", ({ enumerable: true, get: function () { return _isFunctionEs.isFunction; } })); Object.defineProperty(exports, "isNumber", ({ enumerable: true, get: function () { return _isNumberEs.isNumber; } })); Object.defineProperty(exports, "isString", ({ enumerable: true, get: function () { return _isStringEs.isString; } })); Object.defineProperty(exports, "mix", ({ enumerable: true, get: function () { return _mixEs.mix; } })); Object.defineProperty(exports, "noop", ({ enumerable: true, get: function () { return _noopEs.noop; } })); Object.defineProperty(exports, "noopReturn", ({ enumerable: true, get: function () { return _noopEs.noopReturn; } })); Object.defineProperty(exports, "progress", ({ enumerable: true, get: function () { return _progressEs.progress; } })); Object.defineProperty(exports, "removeItem", ({ enumerable: true, get: function () { return _arrayEs.removeItem; } })); Object.defineProperty(exports, "time", ({ enumerable: true, get: function () { return _timeEs.time; } })); Object.defineProperty(exports, "velocityPerSecond", ({ enumerable: true, get: function () { return _velocityEs.velocityPerSecond; } })); Object.defineProperty(exports, "wrap", ({ enumerable: true, get: function () { return _wrapEs.wrap; } })); var _arrayEs = __webpack_require__(/*! ./array.es.js */ "../../../node_modules/@motionone/utils/dist/array.es.js"); var _clampEs = __webpack_require__(/*! ./clamp.es.js */ "../../../node_modules/@motionone/utils/dist/clamp.es.js"); var _defaultsEs = __webpack_require__(/*! ./defaults.es.js */ "../../../node_modules/@motionone/utils/dist/defaults.es.js"); var _easingEs = __webpack_require__(/*! ./easing.es.js */ "../../../node_modules/@motionone/utils/dist/easing.es.js"); var _interpolateEs = __webpack_require__(/*! ./interpolate.es.js */ "../../../node_modules/@motionone/utils/dist/interpolate.es.js"); var _isCubicBezierEs = __webpack_require__(/*! ./is-cubic-bezier.es.js */ "../../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js"); var _isEasingGeneratorEs = __webpack_require__(/*! ./is-easing-generator.es.js */ "../../../node_modules/@motionone/utils/dist/is-easing-generator.es.js"); var _isEasingListEs = __webpack_require__(/*! ./is-easing-list.es.js */ "../../../node_modules/@motionone/utils/dist/is-easing-list.es.js"); var _isFunctionEs = __webpack_require__(/*! ./is-function.es.js */ "../../../node_modules/@motionone/utils/dist/is-function.es.js"); var _isNumberEs = __webpack_require__(/*! ./is-number.es.js */ "../../../node_modules/@motionone/utils/dist/is-number.es.js"); var _isStringEs = __webpack_require__(/*! ./is-string.es.js */ "../../../node_modules/@motionone/utils/dist/is-string.es.js"); var _mixEs = __webpack_require__(/*! ./mix.es.js */ "../../../node_modules/@motionone/utils/dist/mix.es.js"); var _noopEs = __webpack_require__(/*! ./noop.es.js */ "../../../node_modules/@motionone/utils/dist/noop.es.js"); var _offsetEs = __webpack_require__(/*! ./offset.es.js */ "../../../node_modules/@motionone/utils/dist/offset.es.js"); var _progressEs = __webpack_require__(/*! ./progress.es.js */ "../../../node_modules/@motionone/utils/dist/progress.es.js"); var _timeEs = __webpack_require__(/*! ./time.es.js */ "../../../node_modules/@motionone/utils/dist/time.es.js"); var _velocityEs = __webpack_require__(/*! ./velocity.es.js */ "../../../node_modules/@motionone/utils/dist/velocity.es.js"); var _wrapEs = __webpack_require__(/*! ./wrap.es.js */ "../../../node_modules/@motionone/utils/dist/wrap.es.js"); /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/interpolate.es.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/interpolate.es.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.interpolate = interpolate; var _mixEs = __webpack_require__(/*! ./mix.es.js */ "../../../node_modules/@motionone/utils/dist/mix.es.js"); var _noopEs = __webpack_require__(/*! ./noop.es.js */ "../../../node_modules/@motionone/utils/dist/noop.es.js"); var _offsetEs = __webpack_require__(/*! ./offset.es.js */ "../../../node_modules/@motionone/utils/dist/offset.es.js"); var _progressEs = __webpack_require__(/*! ./progress.es.js */ "../../../node_modules/@motionone/utils/dist/progress.es.js"); var _easingEs = __webpack_require__(/*! ./easing.es.js */ "../../../node_modules/@motionone/utils/dist/easing.es.js"); var _clampEs = __webpack_require__(/*! ./clamp.es.js */ "../../../node_modules/@motionone/utils/dist/clamp.es.js"); function interpolate(output) { let input = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _offsetEs.defaultOffset)(output.length); let easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : _noopEs.noopReturn; const length = output.length; /** * If the input length is lower than the output we * fill the input to match. This currently assumes the input * is an animation progress value so is a good candidate for * moving outside the function. */ const remainder = length - input.length; remainder > 0 && (0, _offsetEs.fillOffset)(input, remainder); return t => { let i = 0; for (; i < length - 2; i++) { if (t < input[i + 1]) break; } let progressInRange = (0, _clampEs.clamp)(0, 1, (0, _progressEs.progress)(input[i], input[i + 1], t)); const segmentEasing = (0, _easingEs.getEasingForSegment)(easing, i); progressInRange = segmentEasing(progressInRange); return (0, _mixEs.mix)(output[i], output[i + 1], progressInRange); }; } /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js": /*!*************************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/is-cubic-bezier.es.js ***! \*************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isCubicBezier = void 0; var _isNumberEs = __webpack_require__(/*! ./is-number.es.js */ "../../../node_modules/@motionone/utils/dist/is-number.es.js"); const isCubicBezier = easing => Array.isArray(easing) && (0, _isNumberEs.isNumber)(easing[0]); exports.isCubicBezier = isCubicBezier; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/is-easing-generator.es.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/is-easing-generator.es.js ***! \*****************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isEasingGenerator = void 0; const isEasingGenerator = easing => typeof easing === "object" && Boolean(easing.createAnimation); exports.isEasingGenerator = isEasingGenerator; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/is-easing-list.es.js": /*!************************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/is-easing-list.es.js ***! \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isEasingList = void 0; var _isNumberEs = __webpack_require__(/*! ./is-number.es.js */ "../../../node_modules/@motionone/utils/dist/is-number.es.js"); const isEasingList = easing => Array.isArray(easing) && !(0, _isNumberEs.isNumber)(easing[0]); exports.isEasingList = isEasingList; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/is-function.es.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/is-function.es.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isFunction = void 0; const isFunction = value => typeof value === "function"; exports.isFunction = isFunction; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/is-number.es.js": /*!*******************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/is-number.es.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isNumber = void 0; const isNumber = value => typeof value === "number"; exports.isNumber = isNumber; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/is-string.es.js": /*!*******************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/is-string.es.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isString = void 0; const isString = value => typeof value === "string"; exports.isString = isString; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/mix.es.js": /*!*************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/mix.es.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.mix = void 0; const mix = (min, max, progress) => -progress * min + progress * max + min; exports.mix = mix; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/noop.es.js": /*!**************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/noop.es.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.noopReturn = exports.noop = void 0; const noop = () => {}; exports.noop = noop; const noopReturn = v => v; exports.noopReturn = noopReturn; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/offset.es.js": /*!****************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/offset.es.js ***! \****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultOffset = defaultOffset; exports.fillOffset = fillOffset; var _mixEs = __webpack_require__(/*! ./mix.es.js */ "../../../node_modules/@motionone/utils/dist/mix.es.js"); var _progressEs = __webpack_require__(/*! ./progress.es.js */ "../../../node_modules/@motionone/utils/dist/progress.es.js"); function fillOffset(offset, remaining) { const min = offset[offset.length - 1]; for (let i = 1; i <= remaining; i++) { const offsetProgress = (0, _progressEs.progress)(0, remaining, i); offset.push((0, _mixEs.mix)(min, 1, offsetProgress)); } } function defaultOffset(length) { const offset = [0]; fillOffset(offset, length - 1); return offset; } /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/progress.es.js": /*!******************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/progress.es.js ***! \******************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.progress = void 0; const progress = (min, max, value) => max - min === 0 ? 1 : (value - min) / (max - min); exports.progress = progress; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/time.es.js": /*!**************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/time.es.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.time = void 0; const time = { ms: seconds => seconds * 1000, s: milliseconds => milliseconds / 1000 }; exports.time = time; /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/velocity.es.js": /*!******************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/velocity.es.js ***! \******************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.velocityPerSecond = velocityPerSecond; /* Convert velocity into velocity per second @param [number]: Unit per frame @param [number]: Frame duration in ms */ function velocityPerSecond(velocity, frameDuration) { return frameDuration ? velocity * (1000 / frameDuration) : 0; } /***/ }), /***/ "../../../node_modules/@motionone/utils/dist/wrap.es.js": /*!**************************************************************!*\ !*** ../../../node_modules/@motionone/utils/dist/wrap.es.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.wrap = void 0; const wrap = (min, max, v) => { const rangeSize = max - min; return ((v - min) % rangeSize + rangeSize) % rangeSize + min; }; exports.wrap = wrap; /***/ }), /***/ "../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js": /*!********************************************************************************!*\ !*** ../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js ***! \********************************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); function createDeferred() { const d = {}; d.promise = new Promise((resolve, reject) => { d.resolve = resolve; d.reject = reject; }); return d; } const SYMBOL_FINISHED = Symbol(); const SYMBOL_NEW_VALUE = Symbol(); /** * makePushPullAsyncIterableIterator * * The iterable will publish values until return or throw is called. * Afterwards it is in the completed state and cannot be used for publishing any further values. * It will handle back-pressure and keep pushed values until they are consumed by a source. */ function makePushPullAsyncIterableIterator() { let isRunning = true; const values = []; let newValueD = createDeferred(); const finishedD = createDeferred(); const asyncIterableIterator = async function* PushPullAsyncIterableIterator() { while (true) { if (values.length > 0) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion yield values.shift(); } else { const result = await Promise.race([newValueD.promise, finishedD.promise]); if (result === SYMBOL_FINISHED) { break; } if (result !== SYMBOL_NEW_VALUE) { throw result; } } } }(); function pushValue(value) { if (isRunning === false) { // TODO: Should this throw? return; } values.push(value); newValueD.resolve(SYMBOL_NEW_VALUE); newValueD = createDeferred(); } // We monkey patch the original generator for clean-up // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const originalReturn = asyncIterableIterator.return.bind(asyncIterableIterator); asyncIterableIterator.return = function () { isRunning = false; finishedD.resolve(SYMBOL_FINISHED); return originalReturn(...arguments); }; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const originalThrow = asyncIterableIterator.throw.bind(asyncIterableIterator); asyncIterableIterator.throw = err => { isRunning = false; finishedD.resolve(err); return originalThrow(err); }; return { pushValue, asyncIterableIterator }; } const makeAsyncIterableIteratorFromSink = make => { const { pushValue, asyncIterableIterator } = makePushPullAsyncIterableIterator(); const dispose = make({ next: value => { pushValue(value); }, complete: () => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion asyncIterableIterator.return(); }, error: err => { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion asyncIterableIterator.throw(err); } }); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const originalReturn = asyncIterableIterator.return; let returnValue = undefined; asyncIterableIterator.return = () => { if (returnValue === undefined) { dispose(); returnValue = originalReturn(); } return returnValue; }; return asyncIterableIterator; }; function applyAsyncIterableIteratorToSink(asyncIterableIterator, sink) { const run = async () => { try { for await (const value of asyncIterableIterator) { sink.next(value); } sink.complete(); } catch (err) { sink.error(err); } }; run(); return () => { var _a; (_a = asyncIterableIterator.return) === null || _a === void 0 ? void 0 : _a.call(asyncIterableIterator); }; } function isAsyncIterable(input) { return typeof input === "object" && input !== null && ( // The AsyncGenerator check is for Safari on iOS which currently does not have // Symbol.asyncIterator implemented // That means every custom AsyncIterable must be built using a AsyncGeneratorFunction (async function * () {}) // eslint-disable-next-line @typescript-eslint/no-explicit-any input[Symbol.toStringTag] === "AsyncGenerator" || Symbol.asyncIterator && Symbol.asyncIterator in input); } exports.applyAsyncIterableIteratorToSink = applyAsyncIterableIteratorToSink; exports.isAsyncIterable = isAsyncIterable; exports.makeAsyncIterableIteratorFromSink = makeAsyncIterableIteratorFromSink; exports.makePushPullAsyncIterableIterator = makePushPullAsyncIterableIterator; /***/ }), /***/ "../../../node_modules/@radix-ui/primitive/dist/index.js": /*!***************************************************************!*\ !*** ../../../node_modules/@radix-ui/primitive/dist/index.js ***! \***************************************************************/ /***/ (function(module) { function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "composeEventHandlers", () => $1a6a90a521dcd173$export$b9ecd428b558ff10); function $1a6a90a521dcd173$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler) { let { checkForDefaultPrevented = true } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; return function handleEvent(event) { originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event); if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event); }; } /***/ }), /***/ "../../../node_modules/@radix-ui/react-arrow/dist/index.js": /*!*****************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-arrow/dist/index.js ***! \*****************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $eQpDd$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $eQpDd$react = __webpack_require__(/*! react */ "react"); var $eQpDd$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "Arrow", () => $09f4ad68a9251bc3$export$21b07c8f274aebd5); $parcel$export(module.exports, "Root", () => $09f4ad68a9251bc3$export$be92b6f5f03c0fe9); /* ------------------------------------------------------------------------------------------------- * Arrow * -----------------------------------------------------------------------------------------------*/ const $09f4ad68a9251bc3$var$NAME = 'Arrow'; const $09f4ad68a9251bc3$export$21b07c8f274aebd5 = /*#__PURE__*/$eQpDd$react.forwardRef((props, forwardedRef) => { const { children: children, width = 10, height = 5, ...arrowProps } = props; return /*#__PURE__*/$eQpDd$react.createElement($eQpDd$radixuireactprimitive.Primitive.svg, $parcel$interopDefault($eQpDd$babelruntimehelpersextends)({}, arrowProps, { ref: forwardedRef, width: width, height: height, viewBox: "0 0 30 10", preserveAspectRatio: "none" }), props.asChild ? children : /*#__PURE__*/$eQpDd$react.createElement("polygon", { points: "0,0 30,0 15,10" })); }); /*#__PURE__*/ Object.assign($09f4ad68a9251bc3$export$21b07c8f274aebd5, { displayName: $09f4ad68a9251bc3$var$NAME }); /* -----------------------------------------------------------------------------------------------*/ const $09f4ad68a9251bc3$export$be92b6f5f03c0fe9 = $09f4ad68a9251bc3$export$21b07c8f274aebd5; /***/ }), /***/ "../../../node_modules/@radix-ui/react-collection/dist/index.js": /*!**********************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-collection/dist/index.js ***! \**********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $hnlpS$react = __webpack_require__(/*! react */ "react"); var $hnlpS$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $hnlpS$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $hnlpS$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createCollection", () => $1a96635ec239608b$export$c74125a8e3af6bb2); // We have resorted to returning slots directly rather than exposing primitives that can then // be slotted like ``. // This is because we encountered issues with generic types that cannot be statically analysed // due to creating them dynamically via createCollection. function $1a96635ec239608b$export$c74125a8e3af6bb2(name) { /* ----------------------------------------------------------------------------------------------- * CollectionProvider * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider'; const [createCollectionContext, createCollectionScope] = $hnlpS$radixuireactcontext.createContextScope(PROVIDER_NAME); const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, { collectionRef: { current: null }, itemMap: new Map() }); const CollectionProvider = props => { const { scope: scope, children: children } = props; const ref = $parcel$interopDefault($hnlpS$react).useRef(null); const itemMap = $parcel$interopDefault($hnlpS$react).useRef(new Map()).current; return /*#__PURE__*/$parcel$interopDefault($hnlpS$react).createElement(CollectionProviderImpl, { scope: scope, itemMap: itemMap, collectionRef: ref }, children); }; /*#__PURE__*/ Object.assign(CollectionProvider, { displayName: PROVIDER_NAME }); /* ----------------------------------------------------------------------------------------------- * CollectionSlot * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot'; const CollectionSlot = /*#__PURE__*/$parcel$interopDefault($hnlpS$react).forwardRef((props, forwardedRef) => { const { scope: scope, children: children } = props; const context = useCollectionContext(COLLECTION_SLOT_NAME, scope); const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.collectionRef); return /*#__PURE__*/$parcel$interopDefault($hnlpS$react).createElement($hnlpS$radixuireactslot.Slot, { ref: composedRefs }, children); }); /*#__PURE__*/ Object.assign(CollectionSlot, { displayName: COLLECTION_SLOT_NAME }); /* ----------------------------------------------------------------------------------------------- * CollectionItem * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot'; const ITEM_DATA_ATTR = 'data-radix-collection-item'; const CollectionItemSlot = /*#__PURE__*/$parcel$interopDefault($hnlpS$react).forwardRef((props, forwardedRef) => { const { scope: scope, children: children, ...itemData } = props; const ref = $parcel$interopDefault($hnlpS$react).useRef(null); const composedRefs = $hnlpS$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); const context = useCollectionContext(ITEM_SLOT_NAME, scope); $parcel$interopDefault($hnlpS$react).useEffect(() => { context.itemMap.set(ref, { ref: ref, ...itemData }); return () => void context.itemMap.delete(ref); }); return /*#__PURE__*/$parcel$interopDefault($hnlpS$react).createElement($hnlpS$radixuireactslot.Slot, { [ITEM_DATA_ATTR]: '', ref: composedRefs }, children); }); /*#__PURE__*/ Object.assign(CollectionItemSlot, { displayName: ITEM_SLOT_NAME }); /* ----------------------------------------------------------------------------------------------- * useCollection * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) { const context = useCollectionContext(name + 'CollectionConsumer', scope); const getItems = $parcel$interopDefault($hnlpS$react).useCallback(() => { const collectionNode = context.collectionRef.current; if (!collectionNode) return []; const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`)); const items = Array.from(context.itemMap.values()); const orderedItems = items.sort((a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)); return orderedItems; }, [context.collectionRef, context.itemMap]); return getItems; } return [{ Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot }, useCollection, createCollectionScope]; } /***/ }), /***/ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js": /*!************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-compose-refs/dist/index.js ***! \************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $dJwbH$react = __webpack_require__(/*! react */ "react"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "composeRefs", () => $9c2aaba23466b352$export$43e446d32b3d21af); $parcel$export(module.exports, "useComposedRefs", () => $9c2aaba23466b352$export$c7b2cbe3552a0d05); /** * Set a given ref to a given value * This utility takes care of different types of refs: callback refs and RefObject(s) */ function $9c2aaba23466b352$var$setRef(ref, value) { if (typeof ref === 'function') ref(value);else if (ref !== null && ref !== undefined) ref.current = value; } /** * A utility to compose multiple refs together * Accepts callback refs and RefObject(s) */ function $9c2aaba23466b352$export$43e446d32b3d21af() { for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { refs[_key] = arguments[_key]; } return node => refs.forEach(ref => $9c2aaba23466b352$var$setRef(ref, node)); } /** * A custom hook that composes multiple refs * Accepts callback refs and RefObject(s) */ function $9c2aaba23466b352$export$c7b2cbe3552a0d05() { for (var _len2 = arguments.length, refs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { refs[_key2] = arguments[_key2]; } // eslint-disable-next-line react-hooks/exhaustive-deps return $dJwbH$react.useCallback($9c2aaba23466b352$export$43e446d32b3d21af(...refs), refs); } /***/ }), /***/ "../../../node_modules/@radix-ui/react-context/dist/index.js": /*!*******************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-context/dist/index.js ***! \*******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $4O1Ne$react = __webpack_require__(/*! react */ "react"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "createContext", () => $dec3cc0142d4f286$export$fd42f52fd3ae1109); $parcel$export(module.exports, "createContextScope", () => $dec3cc0142d4f286$export$50c7b4e9d9f19c1); function $dec3cc0142d4f286$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { const Context = /*#__PURE__*/$4O1Ne$react.createContext(defaultContext); function Provider(props) { const { children: children, ...context } = props; // Only re-memoize when prop values change // eslint-disable-next-line react-hooks/exhaustive-deps const value = $4O1Ne$react.useMemo(() => context, Object.values(context)); return /*#__PURE__*/$4O1Ne$react.createElement(Context.Provider, { value: value }, children); } function useContext(consumerName) { const context = $4O1Ne$react.useContext(Context); if (context) return context; if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } Provider.displayName = rootComponentName + 'Provider'; return [Provider, useContext]; } /* ------------------------------------------------------------------------------------------------- * createContextScope * -----------------------------------------------------------------------------------------------*/ function $dec3cc0142d4f286$export$50c7b4e9d9f19c1(scopeName) { let createContextScopeDeps = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; let defaultContexts = []; /* ----------------------------------------------------------------------------------------------- * createContext * ---------------------------------------------------------------------------------------------*/ function $dec3cc0142d4f286$export$fd42f52fd3ae1109(rootComponentName, defaultContext) { const BaseContext = /*#__PURE__*/$4O1Ne$react.createContext(defaultContext); const index = defaultContexts.length; defaultContexts = [...defaultContexts, defaultContext]; function Provider(props) { const { scope: scope, children: children, ...context } = props; const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change // eslint-disable-next-line react-hooks/exhaustive-deps const value = $4O1Ne$react.useMemo(() => context, Object.values(context)); return /*#__PURE__*/$4O1Ne$react.createElement(Context.Provider, { value: value }, children); } function useContext(consumerName, scope) { const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; const context = $4O1Ne$react.useContext(Context); if (context) return context; if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context. throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``); } Provider.displayName = rootComponentName + 'Provider'; return [Provider, useContext]; } /* ----------------------------------------------------------------------------------------------- * createScope * ---------------------------------------------------------------------------------------------*/ const createScope = () => { const scopeContexts = defaultContexts.map(defaultContext => { return /*#__PURE__*/$4O1Ne$react.createContext(defaultContext); }); return function useScope(scope) { const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts; return $4O1Ne$react.useMemo(() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }), [scope, contexts]); }; }; createScope.scopeName = scopeName; return [$dec3cc0142d4f286$export$fd42f52fd3ae1109, $dec3cc0142d4f286$var$composeContextScopes(createScope, ...createContextScopeDeps)]; } /* ------------------------------------------------------------------------------------------------- * composeContextScopes * -----------------------------------------------------------------------------------------------*/ function $dec3cc0142d4f286$var$composeContextScopes() { for (var _len = arguments.length, scopes = new Array(_len), _key = 0; _key < _len; _key++) { scopes[_key] = arguments[_key]; } const baseScope = scopes[0]; if (scopes.length === 1) return baseScope; const createScope1 = () => { const scopeHooks = scopes.map(createScope => ({ useScope: createScope(), scopeName: createScope.scopeName })); return function useComposedScopes(overrideScopes) { const nextScopes1 = scopeHooks.reduce((nextScopes, _ref) => { let { useScope: useScope, scopeName: scopeName } = _ref; // We are calling a hook inside a callback which React warns against to avoid inconsistent // renders, however, scoping doesn't have render side effects so we ignore the rule. // eslint-disable-next-line react-hooks/rules-of-hooks const scopeProps = useScope(overrideScopes); const currentScope = scopeProps[`__scope${scopeName}`]; return { ...nextScopes, ...currentScope }; }, {}); return $4O1Ne$react.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes1 }), [nextScopes1]); }; }; createScope1.scopeName = baseScope.scopeName; return createScope1; } /***/ }), /***/ "../../../node_modules/@radix-ui/react-dialog/dist/index.js": /*!******************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-dialog/dist/index.js ***! \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $aJCrN$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $aJCrN$react = __webpack_require__(/*! react */ "react"); var $aJCrN$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); var $aJCrN$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $aJCrN$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $aJCrN$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); var $aJCrN$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); var $aJCrN$radixuireactdismissablelayer = __webpack_require__(/*! @radix-ui/react-dismissable-layer */ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js"); var $aJCrN$radixuireactfocusscope = __webpack_require__(/*! @radix-ui/react-focus-scope */ "../../../node_modules/@radix-ui/react-focus-scope/dist/index.js"); var $aJCrN$radixuireactportal = __webpack_require__(/*! @radix-ui/react-portal */ "../../../node_modules/@radix-ui/react-portal/dist/index.js"); var $aJCrN$radixuireactpresence = __webpack_require__(/*! @radix-ui/react-presence */ "../../../node_modules/@radix-ui/react-presence/dist/index.js"); var $aJCrN$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $aJCrN$radixuireactfocusguards = __webpack_require__(/*! @radix-ui/react-focus-guards */ "../../../node_modules/@radix-ui/react-focus-guards/dist/index.js"); var $aJCrN$reactremovescroll = __webpack_require__(/*! react-remove-scroll */ "../../../node_modules/react-remove-scroll/dist/es2015/index.js"); var $aJCrN$ariahidden = __webpack_require__(/*! aria-hidden */ "../../../node_modules/aria-hidden/dist/es2015/index.js"); var $aJCrN$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createDialogScope", () => $f4833395aa1bca1a$export$cc702773b8ea3e41); $parcel$export(module.exports, "Dialog", () => $f4833395aa1bca1a$export$3ddf2d174ce01153); $parcel$export(module.exports, "DialogTrigger", () => $f4833395aa1bca1a$export$2e1e1122cf0cba88); $parcel$export(module.exports, "DialogPortal", () => $f4833395aa1bca1a$export$dad7c95542bacce0); $parcel$export(module.exports, "DialogOverlay", () => $f4833395aa1bca1a$export$bd1d06c79be19e17); $parcel$export(module.exports, "DialogContent", () => $f4833395aa1bca1a$export$b6d9565de1e068cf); $parcel$export(module.exports, "DialogTitle", () => $f4833395aa1bca1a$export$16f7638e4a34b909); $parcel$export(module.exports, "DialogDescription", () => $f4833395aa1bca1a$export$94e94c2ec2c954d5); $parcel$export(module.exports, "DialogClose", () => $f4833395aa1bca1a$export$fba2fb7cd781b7ac); $parcel$export(module.exports, "Root", () => $f4833395aa1bca1a$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Trigger", () => $f4833395aa1bca1a$export$41fb9f06171c75f4); $parcel$export(module.exports, "Portal", () => $f4833395aa1bca1a$export$602eac185826482c); $parcel$export(module.exports, "Overlay", () => $f4833395aa1bca1a$export$c6fdb837b070b4ff); $parcel$export(module.exports, "Content", () => $f4833395aa1bca1a$export$7c6e2c02157bb7d2); $parcel$export(module.exports, "Title", () => $f4833395aa1bca1a$export$f99233281efd08a0); $parcel$export(module.exports, "Description", () => $f4833395aa1bca1a$export$393edc798c47379d); $parcel$export(module.exports, "Close", () => $f4833395aa1bca1a$export$f39c2d165cd861fe); $parcel$export(module.exports, "WarningProvider", () => $f4833395aa1bca1a$export$69b62a49393917d6); /* ------------------------------------------------------------------------------------------------- * Dialog * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DIALOG_NAME = 'Dialog'; const [$f4833395aa1bca1a$var$createDialogContext, $f4833395aa1bca1a$export$cc702773b8ea3e41] = $aJCrN$radixuireactcontext.createContextScope($f4833395aa1bca1a$var$DIALOG_NAME); const [$f4833395aa1bca1a$var$DialogProvider, $f4833395aa1bca1a$var$useDialogContext] = $f4833395aa1bca1a$var$createDialogContext($f4833395aa1bca1a$var$DIALOG_NAME); const $f4833395aa1bca1a$export$3ddf2d174ce01153 = props => { const { __scopeDialog: __scopeDialog, children: children, open: openProp, defaultOpen: defaultOpen, onOpenChange: onOpenChange, modal = true } = props; const triggerRef = $aJCrN$react.useRef(null); const contentRef = $aJCrN$react.useRef(null); const [open = false, setOpen] = $aJCrN$radixuireactusecontrollablestate.useControllableState({ prop: openProp, defaultProp: defaultOpen, onChange: onOpenChange }); return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogProvider, { scope: __scopeDialog, triggerRef: triggerRef, contentRef: contentRef, contentId: $aJCrN$radixuireactid.useId(), titleId: $aJCrN$radixuireactid.useId(), descriptionId: $aJCrN$radixuireactid.useId(), open: open, onOpenChange: setOpen, onOpenToggle: $aJCrN$react.useCallback(() => setOpen(prevOpen => !prevOpen), [setOpen]), modal: modal }, children); }; /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$3ddf2d174ce01153, { displayName: $f4833395aa1bca1a$var$DIALOG_NAME }); /* ------------------------------------------------------------------------------------------------- * DialogTrigger * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$TRIGGER_NAME = 'DialogTrigger'; const $f4833395aa1bca1a$export$2e1e1122cf0cba88 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const { __scopeDialog: __scopeDialog, ...triggerProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$TRIGGER_NAME, __scopeDialog); const composedTriggerRef = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.triggerRef); return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.button, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ type: "button", "aria-haspopup": "dialog", "aria-expanded": context.open, "aria-controls": context.contentId, "data-state": $f4833395aa1bca1a$var$getState(context.open) }, triggerProps, { ref: composedTriggerRef, onClick: $aJCrN$radixuiprimitive.composeEventHandlers(props.onClick, context.onOpenToggle) })); }); /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$2e1e1122cf0cba88, { displayName: $f4833395aa1bca1a$var$TRIGGER_NAME }); /* ------------------------------------------------------------------------------------------------- * DialogPortal * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$PORTAL_NAME = 'DialogPortal'; const [$f4833395aa1bca1a$var$PortalProvider, $f4833395aa1bca1a$var$usePortalContext] = $f4833395aa1bca1a$var$createDialogContext($f4833395aa1bca1a$var$PORTAL_NAME, { forceMount: undefined }); const $f4833395aa1bca1a$export$dad7c95542bacce0 = props => { const { __scopeDialog: __scopeDialog, forceMount: forceMount, children: children, container: container } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$PORTAL_NAME, __scopeDialog); return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$PortalProvider, { scope: __scopeDialog, forceMount: forceMount }, $aJCrN$react.Children.map(children, child => /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, { present: forceMount || context.open }, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactportal.Portal, { asChild: true, container: container }, child)))); }; /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$dad7c95542bacce0, { displayName: $f4833395aa1bca1a$var$PORTAL_NAME }); /* ------------------------------------------------------------------------------------------------- * DialogOverlay * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$OVERLAY_NAME = 'DialogOverlay'; const $f4833395aa1bca1a$export$bd1d06c79be19e17 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const portalContext = $f4833395aa1bca1a$var$usePortalContext($f4833395aa1bca1a$var$OVERLAY_NAME, props.__scopeDialog); const { forceMount = portalContext.forceMount, ...overlayProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$OVERLAY_NAME, props.__scopeDialog); return context.modal ? /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, { present: forceMount || context.open }, /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogOverlayImpl, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, overlayProps, { ref: forwardedRef }))) : null; }); /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$bd1d06c79be19e17, { displayName: $f4833395aa1bca1a$var$OVERLAY_NAME }); const $f4833395aa1bca1a$var$DialogOverlayImpl = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const { __scopeDialog: __scopeDialog, ...overlayProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$OVERLAY_NAME, __scopeDialog); return /*#__PURE__*/ (// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll` // ie. when `Overlay` and `Content` are siblings $aJCrN$react.createElement($aJCrN$reactremovescroll.RemoveScroll, { as: $aJCrN$radixuireactslot.Slot, allowPinchZoom: true, shards: [context.contentRef] }, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.div, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ "data-state": $f4833395aa1bca1a$var$getState(context.open) }, overlayProps, { ref: forwardedRef // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay. , style: { pointerEvents: 'auto', ...overlayProps.style } }))) ); }); /* ------------------------------------------------------------------------------------------------- * DialogContent * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$CONTENT_NAME = 'DialogContent'; const $f4833395aa1bca1a$export$b6d9565de1e068cf = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const portalContext = $f4833395aa1bca1a$var$usePortalContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); const { forceMount = portalContext.forceMount, ...contentProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactpresence.Presence, { present: forceMount || context.open }, context.modal ? /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentModal, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, contentProps, { ref: forwardedRef })) : /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentNonModal, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, contentProps, { ref: forwardedRef }))); }); /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$b6d9565de1e068cf, { displayName: $f4833395aa1bca1a$var$CONTENT_NAME }); /* -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DialogContentModal = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); const contentRef = $aJCrN$react.useRef(null); const composedRefs = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, context.contentRef, contentRef); // aria-hide everything except the content (better supported equivalent to setting aria-modal) $aJCrN$react.useEffect(() => { const content = contentRef.current; if (content) return $aJCrN$ariahidden.hideOthers(content); }, []); return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentImpl, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, props, { ref: composedRefs // we make sure focus isn't trapped once `DialogContent` has been closed , trapFocus: context.open, disableOutsidePointerEvents: true, onCloseAutoFocus: $aJCrN$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, event => { var _context$triggerRef$c; event.preventDefault(); (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus(); }), onPointerDownOutside: $aJCrN$radixuiprimitive.composeEventHandlers(props.onPointerDownOutside, event => { const originalEvent = event.detail.originalEvent; const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; const isRightClick = originalEvent.button === 2 || ctrlLeftClick; // If the event is a right-click, we shouldn't close because // it is effectively as if we right-clicked the `Overlay`. if (isRightClick) event.preventDefault(); }) // When focus is trapped, a `focusout` event may still happen. , onFocusOutside: $aJCrN$radixuiprimitive.composeEventHandlers(props.onFocusOutside, event => event.preventDefault()) })); }); /* -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DialogContentNonModal = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, props.__scopeDialog); const hasInteractedOutsideRef = $aJCrN$react.useRef(false); const hasPointerDownOutsideRef = $aJCrN$react.useRef(false); return /*#__PURE__*/$aJCrN$react.createElement($f4833395aa1bca1a$var$DialogContentImpl, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({}, props, { ref: forwardedRef, trapFocus: false, disableOutsidePointerEvents: false, onCloseAutoFocus: event => { var _props$onCloseAutoFoc; (_props$onCloseAutoFoc = props.onCloseAutoFocus) === null || _props$onCloseAutoFoc === void 0 || _props$onCloseAutoFoc.call(props, event); if (!event.defaultPrevented) { var _context$triggerRef$c2; if (!hasInteractedOutsideRef.current) (_context$triggerRef$c2 = context.triggerRef.current) === null || _context$triggerRef$c2 === void 0 || _context$triggerRef$c2.focus(); // Always prevent auto focus because we either focus manually or want user agent focus event.preventDefault(); } hasInteractedOutsideRef.current = false; hasPointerDownOutsideRef.current = false; }, onInteractOutside: event => { var _props$onInteractOuts, _context$triggerRef$c3; (_props$onInteractOuts = props.onInteractOutside) === null || _props$onInteractOuts === void 0 || _props$onInteractOuts.call(props, event); if (!event.defaultPrevented) { hasInteractedOutsideRef.current = true; if (event.detail.originalEvent.type === 'pointerdown') hasPointerDownOutsideRef.current = true; } // Prevent dismissing when clicking the trigger. // As the trigger is already setup to close, without doing so would // cause it to close and immediately open. const target = event.target; const targetIsTrigger = (_context$triggerRef$c3 = context.triggerRef.current) === null || _context$triggerRef$c3 === void 0 ? void 0 : _context$triggerRef$c3.contains(target); if (targetIsTrigger) event.preventDefault(); // On Safari if the trigger is inside a container with tabIndex={0}, when clicked // we will get the pointer down outside event on the trigger, but then a subsequent // focus outside event on the container, we ignore any focus outside event when we've // already had a pointer down outside event. if (event.detail.originalEvent.type === 'focusin' && hasPointerDownOutsideRef.current) event.preventDefault(); } })); }); /* -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DialogContentImpl = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const { __scopeDialog: __scopeDialog, trapFocus: trapFocus, onOpenAutoFocus: onOpenAutoFocus, onCloseAutoFocus: onCloseAutoFocus, ...contentProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CONTENT_NAME, __scopeDialog); const contentRef = $aJCrN$react.useRef(null); const composedRefs = $aJCrN$radixuireactcomposerefs.useComposedRefs(forwardedRef, contentRef); // Make sure the whole tree has focus guards as our `Dialog` will be // the last element in the DOM (beacuse of the `Portal`) $aJCrN$radixuireactfocusguards.useFocusGuards(); return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$react.Fragment, null, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactfocusscope.FocusScope, { asChild: true, loop: true, trapped: trapFocus, onMountAutoFocus: onOpenAutoFocus, onUnmountAutoFocus: onCloseAutoFocus }, /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactdismissablelayer.DismissableLayer, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ role: "dialog", id: context.contentId, "aria-describedby": context.descriptionId, "aria-labelledby": context.titleId, "data-state": $f4833395aa1bca1a$var$getState(context.open) }, contentProps, { ref: composedRefs, onDismiss: () => context.onOpenChange(false) }))), false); }); /* ------------------------------------------------------------------------------------------------- * DialogTitle * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$TITLE_NAME = 'DialogTitle'; const $f4833395aa1bca1a$export$16f7638e4a34b909 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const { __scopeDialog: __scopeDialog, ...titleProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$TITLE_NAME, __scopeDialog); return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.h2, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ id: context.titleId }, titleProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$16f7638e4a34b909, { displayName: $f4833395aa1bca1a$var$TITLE_NAME }); /* ------------------------------------------------------------------------------------------------- * DialogDescription * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$DESCRIPTION_NAME = 'DialogDescription'; const $f4833395aa1bca1a$export$94e94c2ec2c954d5 = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const { __scopeDialog: __scopeDialog, ...descriptionProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$DESCRIPTION_NAME, __scopeDialog); return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.p, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ id: context.descriptionId }, descriptionProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$94e94c2ec2c954d5, { displayName: $f4833395aa1bca1a$var$DESCRIPTION_NAME }); /* ------------------------------------------------------------------------------------------------- * DialogClose * -----------------------------------------------------------------------------------------------*/ const $f4833395aa1bca1a$var$CLOSE_NAME = 'DialogClose'; const $f4833395aa1bca1a$export$fba2fb7cd781b7ac = /*#__PURE__*/$aJCrN$react.forwardRef((props, forwardedRef) => { const { __scopeDialog: __scopeDialog, ...closeProps } = props; const context = $f4833395aa1bca1a$var$useDialogContext($f4833395aa1bca1a$var$CLOSE_NAME, __scopeDialog); return /*#__PURE__*/$aJCrN$react.createElement($aJCrN$radixuireactprimitive.Primitive.button, $parcel$interopDefault($aJCrN$babelruntimehelpersextends)({ type: "button" }, closeProps, { ref: forwardedRef, onClick: $aJCrN$radixuiprimitive.composeEventHandlers(props.onClick, () => context.onOpenChange(false)) })); }); /*#__PURE__*/ Object.assign($f4833395aa1bca1a$export$fba2fb7cd781b7ac, { displayName: $f4833395aa1bca1a$var$CLOSE_NAME }); /* -----------------------------------------------------------------------------------------------*/ function $f4833395aa1bca1a$var$getState(open) { return open ? 'open' : 'closed'; } const $f4833395aa1bca1a$var$TITLE_WARNING_NAME = 'DialogTitleWarning'; const [$f4833395aa1bca1a$export$69b62a49393917d6, $f4833395aa1bca1a$var$useWarningContext] = $aJCrN$radixuireactcontext.createContext($f4833395aa1bca1a$var$TITLE_WARNING_NAME, { contentName: $f4833395aa1bca1a$var$CONTENT_NAME, titleName: $f4833395aa1bca1a$var$TITLE_NAME, docsSlug: 'dialog' }); const $f4833395aa1bca1a$var$TitleWarning = _ref => { let { titleId: titleId } = _ref; const titleWarningContext = $f4833395aa1bca1a$var$useWarningContext($f4833395aa1bca1a$var$TITLE_WARNING_NAME); const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`; $aJCrN$react.useEffect(() => { if (titleId) { const hasTitle = document.getElementById(titleId); if (!hasTitle) throw new Error(MESSAGE); } }, [MESSAGE, titleId]); return null; }; const $f4833395aa1bca1a$var$DESCRIPTION_WARNING_NAME = 'DialogDescriptionWarning'; const $f4833395aa1bca1a$var$DescriptionWarning = _ref2 => { let { contentRef: contentRef, descriptionId: descriptionId } = _ref2; const descriptionWarningContext = $f4833395aa1bca1a$var$useWarningContext($f4833395aa1bca1a$var$DESCRIPTION_WARNING_NAME); const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`; $aJCrN$react.useEffect(() => { var _contentRef$current; const describedById = (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.getAttribute('aria-describedby'); // if we have an id and the user hasn't set aria-describedby={undefined} if (descriptionId && describedById) { const hasDescription = document.getElementById(descriptionId); if (!hasDescription) console.warn(MESSAGE); } }, [MESSAGE, contentRef, descriptionId]); return null; }; const $f4833395aa1bca1a$export$be92b6f5f03c0fe9 = $f4833395aa1bca1a$export$3ddf2d174ce01153; const $f4833395aa1bca1a$export$41fb9f06171c75f4 = $f4833395aa1bca1a$export$2e1e1122cf0cba88; const $f4833395aa1bca1a$export$602eac185826482c = $f4833395aa1bca1a$export$dad7c95542bacce0; const $f4833395aa1bca1a$export$c6fdb837b070b4ff = $f4833395aa1bca1a$export$bd1d06c79be19e17; const $f4833395aa1bca1a$export$7c6e2c02157bb7d2 = $f4833395aa1bca1a$export$b6d9565de1e068cf; const $f4833395aa1bca1a$export$f99233281efd08a0 = $f4833395aa1bca1a$export$16f7638e4a34b909; const $f4833395aa1bca1a$export$393edc798c47379d = $f4833395aa1bca1a$export$94e94c2ec2c954d5; const $f4833395aa1bca1a$export$f39c2d165cd861fe = $f4833395aa1bca1a$export$fba2fb7cd781b7ac; /***/ }), /***/ "../../../node_modules/@radix-ui/react-direction/dist/index.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-direction/dist/index.js ***! \*********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $9g4ps$react = __webpack_require__(/*! react */ "react"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useDirection", () => $cc45c1b701a63adc$export$b39126d51d94e6f3); $parcel$export(module.exports, "Provider", () => $cc45c1b701a63adc$export$2881499e37b75b9a); $parcel$export(module.exports, "DirectionProvider", () => $cc45c1b701a63adc$export$c760c09fdd558351); const $cc45c1b701a63adc$var$DirectionContext = /*#__PURE__*/$9g4ps$react.createContext(undefined); /* ------------------------------------------------------------------------------------------------- * Direction * -----------------------------------------------------------------------------------------------*/ const $cc45c1b701a63adc$export$c760c09fdd558351 = props => { const { dir: dir, children: children } = props; return /*#__PURE__*/$9g4ps$react.createElement($cc45c1b701a63adc$var$DirectionContext.Provider, { value: dir }, children); }; /* -----------------------------------------------------------------------------------------------*/ function $cc45c1b701a63adc$export$b39126d51d94e6f3(localDir) { const globalDir = $9g4ps$react.useContext($cc45c1b701a63adc$var$DirectionContext); return localDir || globalDir || 'ltr'; } const $cc45c1b701a63adc$export$2881499e37b75b9a = $cc45c1b701a63adc$export$c760c09fdd558351; /***/ }), /***/ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js ***! \*****************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $g2vWm$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $g2vWm$react = __webpack_require__(/*! react */ "react"); var $g2vWm$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); var $g2vWm$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $g2vWm$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $g2vWm$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); var $g2vWm$radixuireactuseescapekeydown = __webpack_require__(/*! @radix-ui/react-use-escape-keydown */ "../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "DismissableLayer", () => $d715e0554b679f1f$export$177fb62ff3ec1f22); $parcel$export(module.exports, "DismissableLayerBranch", () => $d715e0554b679f1f$export$4d5eb2109db14228); $parcel$export(module.exports, "Root", () => $d715e0554b679f1f$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Branch", () => $d715e0554b679f1f$export$aecb2ddcb55c95be); /* ------------------------------------------------------------------------------------------------- * DismissableLayer * -----------------------------------------------------------------------------------------------*/ const $d715e0554b679f1f$var$DISMISSABLE_LAYER_NAME = 'DismissableLayer'; const $d715e0554b679f1f$var$CONTEXT_UPDATE = 'dismissableLayer.update'; const $d715e0554b679f1f$var$POINTER_DOWN_OUTSIDE = 'dismissableLayer.pointerDownOutside'; const $d715e0554b679f1f$var$FOCUS_OUTSIDE = 'dismissableLayer.focusOutside'; let $d715e0554b679f1f$var$originalBodyPointerEvents; const $d715e0554b679f1f$var$DismissableLayerContext = /*#__PURE__*/$g2vWm$react.createContext({ layers: new Set(), layersWithOutsidePointerEventsDisabled: new Set(), branches: new Set() }); const $d715e0554b679f1f$export$177fb62ff3ec1f22 = /*#__PURE__*/$g2vWm$react.forwardRef((props, forwardedRef) => { var _node$ownerDocument; const { disableOutsidePointerEvents = false, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, onFocusOutside: onFocusOutside, onInteractOutside: onInteractOutside, onDismiss: onDismiss, ...layerProps } = props; const context = $g2vWm$react.useContext($d715e0554b679f1f$var$DismissableLayerContext); const [node1, setNode] = $g2vWm$react.useState(null); const ownerDocument = (_node$ownerDocument = node1 === null || node1 === void 0 ? void 0 : node1.ownerDocument) !== null && _node$ownerDocument !== void 0 ? _node$ownerDocument : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; const [, force] = $g2vWm$react.useState({}); const composedRefs = $g2vWm$radixuireactcomposerefs.useComposedRefs(forwardedRef, node => setNode(node)); const layers = Array.from(context.layers); const [highestLayerWithOutsidePointerEventsDisabled] = [...context.layersWithOutsidePointerEventsDisabled].slice(-1); // prettier-ignore const highestLayerWithOutsidePointerEventsDisabledIndex = layers.indexOf(highestLayerWithOutsidePointerEventsDisabled); // prettier-ignore const index = node1 ? layers.indexOf(node1) : -1; const isBodyPointerEventsDisabled = context.layersWithOutsidePointerEventsDisabled.size > 0; const isPointerEventsEnabled = index >= highestLayerWithOutsidePointerEventsDisabledIndex; const pointerDownOutside = $d715e0554b679f1f$var$usePointerDownOutside(event => { const target = event.target; const isPointerDownOnBranch = [...context.branches].some(branch => branch.contains(target)); if (!isPointerEventsEnabled || isPointerDownOnBranch) return; onPointerDownOutside === null || onPointerDownOutside === void 0 || onPointerDownOutside(event); onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); }, ownerDocument); const focusOutside = $d715e0554b679f1f$var$useFocusOutside(event => { const target = event.target; const isFocusInBranch = [...context.branches].some(branch => branch.contains(target)); if (isFocusInBranch) return; onFocusOutside === null || onFocusOutside === void 0 || onFocusOutside(event); onInteractOutside === null || onInteractOutside === void 0 || onInteractOutside(event); if (!event.defaultPrevented) onDismiss === null || onDismiss === void 0 || onDismiss(); }, ownerDocument); $g2vWm$radixuireactuseescapekeydown.useEscapeKeydown(event => { const isHighestLayer = index === context.layers.size - 1; if (!isHighestLayer) return; onEscapeKeyDown === null || onEscapeKeyDown === void 0 || onEscapeKeyDown(event); if (!event.defaultPrevented && onDismiss) { event.preventDefault(); onDismiss(); } }, ownerDocument); $g2vWm$react.useEffect(() => { if (!node1) return; if (disableOutsidePointerEvents) { if (context.layersWithOutsidePointerEventsDisabled.size === 0) { $d715e0554b679f1f$var$originalBodyPointerEvents = ownerDocument.body.style.pointerEvents; ownerDocument.body.style.pointerEvents = 'none'; } context.layersWithOutsidePointerEventsDisabled.add(node1); } context.layers.add(node1); $d715e0554b679f1f$var$dispatchUpdate(); return () => { if (disableOutsidePointerEvents && context.layersWithOutsidePointerEventsDisabled.size === 1) ownerDocument.body.style.pointerEvents = $d715e0554b679f1f$var$originalBodyPointerEvents; }; }, [node1, ownerDocument, disableOutsidePointerEvents, context]); /** * We purposefully prevent combining this effect with the `disableOutsidePointerEvents` effect * because a change to `disableOutsidePointerEvents` would remove this layer from the stack * and add it to the end again so the layering order wouldn't be _creation order_. * We only want them to be removed from context stacks when unmounted. */ $g2vWm$react.useEffect(() => { return () => { if (!node1) return; context.layers.delete(node1); context.layersWithOutsidePointerEventsDisabled.delete(node1); $d715e0554b679f1f$var$dispatchUpdate(); }; }, [node1, context]); $g2vWm$react.useEffect(() => { const handleUpdate = () => force({}); document.addEventListener($d715e0554b679f1f$var$CONTEXT_UPDATE, handleUpdate); return () => document.removeEventListener($d715e0554b679f1f$var$CONTEXT_UPDATE, handleUpdate); }, []); return /*#__PURE__*/$g2vWm$react.createElement($g2vWm$radixuireactprimitive.Primitive.div, $parcel$interopDefault($g2vWm$babelruntimehelpersextends)({}, layerProps, { ref: composedRefs, style: { pointerEvents: isBodyPointerEventsDisabled ? isPointerEventsEnabled ? 'auto' : 'none' : undefined, ...props.style }, onFocusCapture: $g2vWm$radixuiprimitive.composeEventHandlers(props.onFocusCapture, focusOutside.onFocusCapture), onBlurCapture: $g2vWm$radixuiprimitive.composeEventHandlers(props.onBlurCapture, focusOutside.onBlurCapture), onPointerDownCapture: $g2vWm$radixuiprimitive.composeEventHandlers(props.onPointerDownCapture, pointerDownOutside.onPointerDownCapture) })); }); /*#__PURE__*/ Object.assign($d715e0554b679f1f$export$177fb62ff3ec1f22, { displayName: $d715e0554b679f1f$var$DISMISSABLE_LAYER_NAME }); /* ------------------------------------------------------------------------------------------------- * DismissableLayerBranch * -----------------------------------------------------------------------------------------------*/ const $d715e0554b679f1f$var$BRANCH_NAME = 'DismissableLayerBranch'; const $d715e0554b679f1f$export$4d5eb2109db14228 = /*#__PURE__*/$g2vWm$react.forwardRef((props, forwardedRef) => { const context = $g2vWm$react.useContext($d715e0554b679f1f$var$DismissableLayerContext); const ref = $g2vWm$react.useRef(null); const composedRefs = $g2vWm$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); $g2vWm$react.useEffect(() => { const node = ref.current; if (node) { context.branches.add(node); return () => { context.branches.delete(node); }; } }, [context.branches]); return /*#__PURE__*/$g2vWm$react.createElement($g2vWm$radixuireactprimitive.Primitive.div, $parcel$interopDefault($g2vWm$babelruntimehelpersextends)({}, props, { ref: composedRefs })); }); /*#__PURE__*/ Object.assign($d715e0554b679f1f$export$4d5eb2109db14228, { displayName: $d715e0554b679f1f$var$BRANCH_NAME }); /* -----------------------------------------------------------------------------------------------*/ /** * Listens for `pointerdown` outside a react subtree. We use `pointerdown` rather than `pointerup` * to mimic layer dismissing behaviour present in OS. * Returns props to pass to the node we want to check for outside events. */ function $d715e0554b679f1f$var$usePointerDownOutside(onPointerDownOutside) { let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; const handlePointerDownOutside = $g2vWm$radixuireactusecallbackref.useCallbackRef(onPointerDownOutside); const isPointerInsideReactTreeRef = $g2vWm$react.useRef(false); const handleClickRef = $g2vWm$react.useRef(() => {}); $g2vWm$react.useEffect(() => { const handlePointerDown = event => { if (event.target && !isPointerInsideReactTreeRef.current) { const eventDetail = { originalEvent: event }; function handleAndDispatchPointerDownOutsideEvent() { $d715e0554b679f1f$var$handleAndDispatchCustomEvent($d715e0554b679f1f$var$POINTER_DOWN_OUTSIDE, handlePointerDownOutside, eventDetail, { discrete: true }); } /** * On touch devices, we need to wait for a click event because browsers implement * a ~350ms delay between the time the user stops touching the display and when the * browser executres events. We need to ensure we don't reactivate pointer-events within * this timeframe otherwise the browser may execute events that should have been prevented. * * Additionally, this also lets us deal automatically with cancellations when a click event * isn't raised because the page was considered scrolled/drag-scrolled, long-pressed, etc. * * This is why we also continuously remove the previous listener, because we cannot be * certain that it was raised, and therefore cleaned-up. */ if (event.pointerType === 'touch') { ownerDocument.removeEventListener('click', handleClickRef.current); handleClickRef.current = handleAndDispatchPointerDownOutsideEvent; ownerDocument.addEventListener('click', handleClickRef.current, { once: true }); } else handleAndDispatchPointerDownOutsideEvent(); } isPointerInsideReactTreeRef.current = false; }; /** * if this hook executes in a component that mounts via a `pointerdown` event, the event * would bubble up to the document and trigger a `pointerDownOutside` event. We avoid * this by delaying the event listener registration on the document. * This is not React specific, but rather how the DOM works, ie: * ``` * button.addEventListener('pointerdown', () => { * console.log('I will log'); * document.addEventListener('pointerdown', () => { * console.log('I will also log'); * }) * }); */ const timerId = window.setTimeout(() => { ownerDocument.addEventListener('pointerdown', handlePointerDown); }, 0); return () => { window.clearTimeout(timerId); ownerDocument.removeEventListener('pointerdown', handlePointerDown); ownerDocument.removeEventListener('click', handleClickRef.current); }; }, [ownerDocument, handlePointerDownOutside]); return { // ensures we check React component tree (not just DOM tree) onPointerDownCapture: () => isPointerInsideReactTreeRef.current = true }; } /** * Listens for when focus happens outside a react subtree. * Returns props to pass to the root (node) of the subtree we want to check. */ function $d715e0554b679f1f$var$useFocusOutside(onFocusOutside) { let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; const handleFocusOutside = $g2vWm$radixuireactusecallbackref.useCallbackRef(onFocusOutside); const isFocusInsideReactTreeRef = $g2vWm$react.useRef(false); $g2vWm$react.useEffect(() => { const handleFocus = event => { if (event.target && !isFocusInsideReactTreeRef.current) { const eventDetail = { originalEvent: event }; $d715e0554b679f1f$var$handleAndDispatchCustomEvent($d715e0554b679f1f$var$FOCUS_OUTSIDE, handleFocusOutside, eventDetail, { discrete: false }); } }; ownerDocument.addEventListener('focusin', handleFocus); return () => ownerDocument.removeEventListener('focusin', handleFocus); }, [ownerDocument, handleFocusOutside]); return { onFocusCapture: () => isFocusInsideReactTreeRef.current = true, onBlurCapture: () => isFocusInsideReactTreeRef.current = false }; } function $d715e0554b679f1f$var$dispatchUpdate() { const event = new CustomEvent($d715e0554b679f1f$var$CONTEXT_UPDATE); document.dispatchEvent(event); } function $d715e0554b679f1f$var$handleAndDispatchCustomEvent(name, handler, detail, _ref) { let { discrete: discrete } = _ref; const target = detail.originalEvent.target; const event = new CustomEvent(name, { bubbles: false, cancelable: true, detail: detail }); if (handler) target.addEventListener(name, handler, { once: true }); if (discrete) $g2vWm$radixuireactprimitive.dispatchDiscreteCustomEvent(target, event);else target.dispatchEvent(event); } const $d715e0554b679f1f$export$be92b6f5f03c0fe9 = $d715e0554b679f1f$export$177fb62ff3ec1f22; const $d715e0554b679f1f$export$aecb2ddcb55c95be = $d715e0554b679f1f$export$4d5eb2109db14228; /***/ }), /***/ "../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js": /*!*************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js ***! \*************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $7dQ7Q$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $7dQ7Q$react = __webpack_require__(/*! react */ "react"); var $7dQ7Q$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); var $7dQ7Q$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $7dQ7Q$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $7dQ7Q$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); var $7dQ7Q$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $7dQ7Q$radixuireactmenu = __webpack_require__(/*! @radix-ui/react-menu */ "../../../node_modules/@radix-ui/react-menu/dist/index.js"); var $7dQ7Q$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createDropdownMenuScope", () => $d1bf075a6b218014$export$c0623cd925aeb687); $parcel$export(module.exports, "DropdownMenu", () => $d1bf075a6b218014$export$e44a253a59704894); $parcel$export(module.exports, "DropdownMenuTrigger", () => $d1bf075a6b218014$export$d2469213b3befba9); $parcel$export(module.exports, "DropdownMenuPortal", () => $d1bf075a6b218014$export$cd369b4d4d54efc9); $parcel$export(module.exports, "DropdownMenuContent", () => $d1bf075a6b218014$export$6e76d93a37c01248); $parcel$export(module.exports, "DropdownMenuGroup", () => $d1bf075a6b218014$export$246bebaba3a2f70e); $parcel$export(module.exports, "DropdownMenuLabel", () => $d1bf075a6b218014$export$76e48c5b57f24495); $parcel$export(module.exports, "DropdownMenuItem", () => $d1bf075a6b218014$export$ed97964d1871885d); $parcel$export(module.exports, "DropdownMenuCheckboxItem", () => $d1bf075a6b218014$export$53a69729da201fa9); $parcel$export(module.exports, "DropdownMenuRadioGroup", () => $d1bf075a6b218014$export$3323ad73d55f587e); $parcel$export(module.exports, "DropdownMenuRadioItem", () => $d1bf075a6b218014$export$e4f69b41b1637536); $parcel$export(module.exports, "DropdownMenuItemIndicator", () => $d1bf075a6b218014$export$42355ae145153fb6); $parcel$export(module.exports, "DropdownMenuSeparator", () => $d1bf075a6b218014$export$da160178fd3bc7e9); $parcel$export(module.exports, "DropdownMenuArrow", () => $d1bf075a6b218014$export$34b8980744021ec5); $parcel$export(module.exports, "DropdownMenuSub", () => $d1bf075a6b218014$export$2f307d81a64f5442); $parcel$export(module.exports, "DropdownMenuSubTrigger", () => $d1bf075a6b218014$export$21dcb7ec56f874cf); $parcel$export(module.exports, "DropdownMenuSubContent", () => $d1bf075a6b218014$export$f34ec8bc2482cc5f); $parcel$export(module.exports, "Root", () => $d1bf075a6b218014$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Trigger", () => $d1bf075a6b218014$export$41fb9f06171c75f4); $parcel$export(module.exports, "Portal", () => $d1bf075a6b218014$export$602eac185826482c); $parcel$export(module.exports, "Content", () => $d1bf075a6b218014$export$7c6e2c02157bb7d2); $parcel$export(module.exports, "Group", () => $d1bf075a6b218014$export$eb2fcfdbd7ba97d4); $parcel$export(module.exports, "Label", () => $d1bf075a6b218014$export$b04be29aa201d4f5); $parcel$export(module.exports, "Item", () => $d1bf075a6b218014$export$6d08773d2e66f8f2); $parcel$export(module.exports, "CheckboxItem", () => $d1bf075a6b218014$export$16ce288f89fa631c); $parcel$export(module.exports, "RadioGroup", () => $d1bf075a6b218014$export$a98f0dcb43a68a25); $parcel$export(module.exports, "RadioItem", () => $d1bf075a6b218014$export$371ab307eab489c0); $parcel$export(module.exports, "ItemIndicator", () => $d1bf075a6b218014$export$c3468e2714d175fa); $parcel$export(module.exports, "Separator", () => $d1bf075a6b218014$export$1ff3c3f08ae963c0); $parcel$export(module.exports, "Arrow", () => $d1bf075a6b218014$export$21b07c8f274aebd5); $parcel$export(module.exports, "Sub", () => $d1bf075a6b218014$export$d7a01e11500dfb6f); $parcel$export(module.exports, "SubTrigger", () => $d1bf075a6b218014$export$2ea8a7a591ac5eac); $parcel$export(module.exports, "SubContent", () => $d1bf075a6b218014$export$6d4de93b380beddf); /* ------------------------------------------------------------------------------------------------- * DropdownMenu * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$DROPDOWN_MENU_NAME = 'DropdownMenu'; const [$d1bf075a6b218014$var$createDropdownMenuContext, $d1bf075a6b218014$export$c0623cd925aeb687] = $7dQ7Q$radixuireactcontext.createContextScope($d1bf075a6b218014$var$DROPDOWN_MENU_NAME, [$7dQ7Q$radixuireactmenu.createMenuScope]); const $d1bf075a6b218014$var$useMenuScope = $7dQ7Q$radixuireactmenu.createMenuScope(); const [$d1bf075a6b218014$var$DropdownMenuProvider, $d1bf075a6b218014$var$useDropdownMenuContext] = $d1bf075a6b218014$var$createDropdownMenuContext($d1bf075a6b218014$var$DROPDOWN_MENU_NAME); const $d1bf075a6b218014$export$e44a253a59704894 = props => { const { __scopeDropdownMenu: __scopeDropdownMenu, children: children, dir: dir, open: openProp, defaultOpen: defaultOpen, onOpenChange: onOpenChange, modal = true } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); const triggerRef = $7dQ7Q$react.useRef(null); const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({ prop: openProp, defaultProp: defaultOpen, onChange: onOpenChange }); return /*#__PURE__*/$7dQ7Q$react.createElement($d1bf075a6b218014$var$DropdownMenuProvider, { scope: __scopeDropdownMenu, triggerId: $7dQ7Q$radixuireactid.useId(), triggerRef: triggerRef, contentId: $7dQ7Q$radixuireactid.useId(), open: open, onOpenChange: setOpen, onOpenToggle: $7dQ7Q$react.useCallback(() => setOpen(prevOpen => !prevOpen), [setOpen]), modal: modal }, /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Root, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, { open: open, onOpenChange: setOpen, dir: dir, modal: modal }), children)); }; /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$e44a253a59704894, { displayName: $d1bf075a6b218014$var$DROPDOWN_MENU_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuTrigger * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$TRIGGER_NAME = 'DropdownMenuTrigger'; const $d1bf075a6b218014$export$d2469213b3befba9 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, disabled = false, ...triggerProps } = props; const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$TRIGGER_NAME, __scopeDropdownMenu); const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Anchor, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({ asChild: true }, menuScope), /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactprimitive.Primitive.button, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({ type: "button", id: context.triggerId, "aria-haspopup": "menu", "aria-expanded": context.open, "aria-controls": context.open ? context.contentId : undefined, "data-state": context.open ? 'open' : 'closed', "data-disabled": disabled ? '' : undefined, disabled: disabled }, triggerProps, { ref: $7dQ7Q$radixuireactcomposerefs.composeRefs(forwardedRef, context.triggerRef), onPointerDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onPointerDown, event => { // only call handler if it's the left button (mousedown gets triggered by all mouse buttons) // but not when the control key is pressed (avoiding MacOS right click) if (!disabled && event.button === 0 && event.ctrlKey === false) { context.onOpenToggle(); // prevent trigger focusing when opening // this allows the content to be given focus without competition if (!context.open) event.preventDefault(); } }), onKeyDown: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { if (disabled) return; if (['Enter', ' '].includes(event.key)) context.onOpenToggle(); if (event.key === 'ArrowDown') context.onOpenChange(true); // prevent keydown from scrolling window / first focused item to execute // that keydown (inadvertently closing the menu) if (['Enter', ' ', 'ArrowDown'].includes(event.key)) event.preventDefault(); }) }))); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$d2469213b3befba9, { displayName: $d1bf075a6b218014$var$TRIGGER_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuPortal * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$PORTAL_NAME = 'DropdownMenuPortal'; const $d1bf075a6b218014$export$cd369b4d4d54efc9 = props => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...portalProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Portal, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, portalProps)); }; /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$cd369b4d4d54efc9, { displayName: $d1bf075a6b218014$var$PORTAL_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuContent * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$CONTENT_NAME = 'DropdownMenuContent'; const $d1bf075a6b218014$export$6e76d93a37c01248 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...contentProps } = props; const context = $d1bf075a6b218014$var$useDropdownMenuContext($d1bf075a6b218014$var$CONTENT_NAME, __scopeDropdownMenu); const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); const hasInteractedOutsideRef = $7dQ7Q$react.useRef(false); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Content, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({ id: context.contentId, "aria-labelledby": context.triggerId }, menuScope, contentProps, { ref: forwardedRef, onCloseAutoFocus: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onCloseAutoFocus, event => { var _context$triggerRef$c; if (!hasInteractedOutsideRef.current) (_context$triggerRef$c = context.triggerRef.current) === null || _context$triggerRef$c === void 0 || _context$triggerRef$c.focus(); hasInteractedOutsideRef.current = false; // Always prevent auto focus because we either focus manually or want user agent focus event.preventDefault(); }), onInteractOutside: $7dQ7Q$radixuiprimitive.composeEventHandlers(props.onInteractOutside, event => { const originalEvent = event.detail.originalEvent; const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true; const isRightClick = originalEvent.button === 2 || ctrlLeftClick; if (!context.modal || isRightClick) hasInteractedOutsideRef.current = true; }), style: { ...props.style, '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)', '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)', '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)', '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)', '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)' } })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$6e76d93a37c01248, { displayName: $d1bf075a6b218014$var$CONTENT_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuGroup * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$GROUP_NAME = 'DropdownMenuGroup'; const $d1bf075a6b218014$export$246bebaba3a2f70e = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...groupProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Group, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, groupProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$246bebaba3a2f70e, { displayName: $d1bf075a6b218014$var$GROUP_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuLabel * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$LABEL_NAME = 'DropdownMenuLabel'; const $d1bf075a6b218014$export$76e48c5b57f24495 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...labelProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Label, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, labelProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$76e48c5b57f24495, { displayName: $d1bf075a6b218014$var$LABEL_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuItem * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$ITEM_NAME = 'DropdownMenuItem'; const $d1bf075a6b218014$export$ed97964d1871885d = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...itemProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Item, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, itemProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$ed97964d1871885d, { displayName: $d1bf075a6b218014$var$ITEM_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuCheckboxItem * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$CHECKBOX_ITEM_NAME = 'DropdownMenuCheckboxItem'; const $d1bf075a6b218014$export$53a69729da201fa9 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...checkboxItemProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.CheckboxItem, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, checkboxItemProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$53a69729da201fa9, { displayName: $d1bf075a6b218014$var$CHECKBOX_ITEM_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuRadioGroup * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$RADIO_GROUP_NAME = 'DropdownMenuRadioGroup'; const $d1bf075a6b218014$export$3323ad73d55f587e = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...radioGroupProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.RadioGroup, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, radioGroupProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$3323ad73d55f587e, { displayName: $d1bf075a6b218014$var$RADIO_GROUP_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuRadioItem * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$RADIO_ITEM_NAME = 'DropdownMenuRadioItem'; const $d1bf075a6b218014$export$e4f69b41b1637536 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...radioItemProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.RadioItem, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, radioItemProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$e4f69b41b1637536, { displayName: $d1bf075a6b218014$var$RADIO_ITEM_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuItemIndicator * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$INDICATOR_NAME = 'DropdownMenuItemIndicator'; const $d1bf075a6b218014$export$42355ae145153fb6 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...itemIndicatorProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.ItemIndicator, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, itemIndicatorProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$42355ae145153fb6, { displayName: $d1bf075a6b218014$var$INDICATOR_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuSeparator * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$SEPARATOR_NAME = 'DropdownMenuSeparator'; const $d1bf075a6b218014$export$da160178fd3bc7e9 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...separatorProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Separator, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, separatorProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$da160178fd3bc7e9, { displayName: $d1bf075a6b218014$var$SEPARATOR_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuArrow * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$ARROW_NAME = 'DropdownMenuArrow'; const $d1bf075a6b218014$export$34b8980744021ec5 = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...arrowProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Arrow, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, arrowProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$34b8980744021ec5, { displayName: $d1bf075a6b218014$var$ARROW_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuSub * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$export$2f307d81a64f5442 = props => { const { __scopeDropdownMenu: __scopeDropdownMenu, children: children, open: openProp, onOpenChange: onOpenChange, defaultOpen: defaultOpen } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); const [open = false, setOpen] = $7dQ7Q$radixuireactusecontrollablestate.useControllableState({ prop: openProp, defaultProp: defaultOpen, onChange: onOpenChange }); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.Sub, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, { open: open, onOpenChange: setOpen }), children); }; /* ------------------------------------------------------------------------------------------------- * DropdownMenuSubTrigger * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$SUB_TRIGGER_NAME = 'DropdownMenuSubTrigger'; const $d1bf075a6b218014$export$21dcb7ec56f874cf = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...subTriggerProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.SubTrigger, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, subTriggerProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$21dcb7ec56f874cf, { displayName: $d1bf075a6b218014$var$SUB_TRIGGER_NAME }); /* ------------------------------------------------------------------------------------------------- * DropdownMenuSubContent * -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$var$SUB_CONTENT_NAME = 'DropdownMenuSubContent'; const $d1bf075a6b218014$export$f34ec8bc2482cc5f = /*#__PURE__*/$7dQ7Q$react.forwardRef((props, forwardedRef) => { const { __scopeDropdownMenu: __scopeDropdownMenu, ...subContentProps } = props; const menuScope = $d1bf075a6b218014$var$useMenuScope(__scopeDropdownMenu); return /*#__PURE__*/$7dQ7Q$react.createElement($7dQ7Q$radixuireactmenu.SubContent, $parcel$interopDefault($7dQ7Q$babelruntimehelpersextends)({}, menuScope, subContentProps, { ref: forwardedRef, style: { ...props.style, '--radix-dropdown-menu-content-transform-origin': 'var(--radix-popper-transform-origin)', '--radix-dropdown-menu-content-available-width': 'var(--radix-popper-available-width)', '--radix-dropdown-menu-content-available-height': 'var(--radix-popper-available-height)', '--radix-dropdown-menu-trigger-width': 'var(--radix-popper-anchor-width)', '--radix-dropdown-menu-trigger-height': 'var(--radix-popper-anchor-height)' } })); }); /*#__PURE__*/ Object.assign($d1bf075a6b218014$export$f34ec8bc2482cc5f, { displayName: $d1bf075a6b218014$var$SUB_CONTENT_NAME }); /* -----------------------------------------------------------------------------------------------*/ const $d1bf075a6b218014$export$be92b6f5f03c0fe9 = $d1bf075a6b218014$export$e44a253a59704894; const $d1bf075a6b218014$export$41fb9f06171c75f4 = $d1bf075a6b218014$export$d2469213b3befba9; const $d1bf075a6b218014$export$602eac185826482c = $d1bf075a6b218014$export$cd369b4d4d54efc9; const $d1bf075a6b218014$export$7c6e2c02157bb7d2 = $d1bf075a6b218014$export$6e76d93a37c01248; const $d1bf075a6b218014$export$eb2fcfdbd7ba97d4 = $d1bf075a6b218014$export$246bebaba3a2f70e; const $d1bf075a6b218014$export$b04be29aa201d4f5 = $d1bf075a6b218014$export$76e48c5b57f24495; const $d1bf075a6b218014$export$6d08773d2e66f8f2 = $d1bf075a6b218014$export$ed97964d1871885d; const $d1bf075a6b218014$export$16ce288f89fa631c = $d1bf075a6b218014$export$53a69729da201fa9; const $d1bf075a6b218014$export$a98f0dcb43a68a25 = $d1bf075a6b218014$export$3323ad73d55f587e; const $d1bf075a6b218014$export$371ab307eab489c0 = $d1bf075a6b218014$export$e4f69b41b1637536; const $d1bf075a6b218014$export$c3468e2714d175fa = $d1bf075a6b218014$export$42355ae145153fb6; const $d1bf075a6b218014$export$1ff3c3f08ae963c0 = $d1bf075a6b218014$export$da160178fd3bc7e9; const $d1bf075a6b218014$export$21b07c8f274aebd5 = $d1bf075a6b218014$export$34b8980744021ec5; const $d1bf075a6b218014$export$d7a01e11500dfb6f = $d1bf075a6b218014$export$2f307d81a64f5442; const $d1bf075a6b218014$export$2ea8a7a591ac5eac = $d1bf075a6b218014$export$21dcb7ec56f874cf; const $d1bf075a6b218014$export$6d4de93b380beddf = $d1bf075a6b218014$export$f34ec8bc2482cc5f; /***/ }), /***/ "../../../node_modules/@radix-ui/react-focus-guards/dist/index.js": /*!************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-focus-guards/dist/index.js ***! \************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $cnctE$react = __webpack_require__(/*! react */ "react"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "FocusGuards", () => $71476a6ed7dbbaf3$export$ac5b58043b79449b); $parcel$export(module.exports, "Root", () => $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "useFocusGuards", () => $71476a6ed7dbbaf3$export$b7ece24a22aeda8c); /** Number of components which have requested interest to have focus guards */ let $71476a6ed7dbbaf3$var$count = 0; function $71476a6ed7dbbaf3$export$ac5b58043b79449b(props) { $71476a6ed7dbbaf3$export$b7ece24a22aeda8c(); return props.children; } /** * Injects a pair of focus guards at the edges of the whole DOM tree * to ensure `focusin` & `focusout` events can be caught consistently. */ function $71476a6ed7dbbaf3$export$b7ece24a22aeda8c() { $cnctE$react.useEffect(() => { var _edgeGuards$, _edgeGuards$2; const edgeGuards = document.querySelectorAll('[data-radix-focus-guard]'); document.body.insertAdjacentElement('afterbegin', (_edgeGuards$ = edgeGuards[0]) !== null && _edgeGuards$ !== void 0 ? _edgeGuards$ : $71476a6ed7dbbaf3$var$createFocusGuard()); document.body.insertAdjacentElement('beforeend', (_edgeGuards$2 = edgeGuards[1]) !== null && _edgeGuards$2 !== void 0 ? _edgeGuards$2 : $71476a6ed7dbbaf3$var$createFocusGuard()); $71476a6ed7dbbaf3$var$count++; return () => { if ($71476a6ed7dbbaf3$var$count === 1) document.querySelectorAll('[data-radix-focus-guard]').forEach(node => node.remove()); $71476a6ed7dbbaf3$var$count--; }; }, []); } function $71476a6ed7dbbaf3$var$createFocusGuard() { const element = document.createElement('span'); element.setAttribute('data-radix-focus-guard', ''); element.tabIndex = 0; element.style.cssText = 'outline: none; opacity: 0; position: fixed; pointer-events: none'; return element; } const $71476a6ed7dbbaf3$export$be92b6f5f03c0fe9 = $71476a6ed7dbbaf3$export$ac5b58043b79449b; /***/ }), /***/ "../../../node_modules/@radix-ui/react-focus-scope/dist/index.js": /*!***********************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-focus-scope/dist/index.js ***! \***********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $buum9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $buum9$react = __webpack_require__(/*! react */ "react"); var $buum9$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $buum9$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $buum9$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "FocusScope", () => $2bc01e66e04aa9ed$export$20e40289641fbbb6); $parcel$export(module.exports, "Root", () => $2bc01e66e04aa9ed$export$be92b6f5f03c0fe9); const $2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT = 'focusScope.autoFocusOnMount'; const $2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT = 'focusScope.autoFocusOnUnmount'; const $2bc01e66e04aa9ed$var$EVENT_OPTIONS = { bubbles: false, cancelable: true }; /* ------------------------------------------------------------------------------------------------- * FocusScope * -----------------------------------------------------------------------------------------------*/ const $2bc01e66e04aa9ed$var$FOCUS_SCOPE_NAME = 'FocusScope'; const $2bc01e66e04aa9ed$export$20e40289641fbbb6 = /*#__PURE__*/$buum9$react.forwardRef((props, forwardedRef) => { const { loop = false, trapped = false, onMountAutoFocus: onMountAutoFocusProp, onUnmountAutoFocus: onUnmountAutoFocusProp, ...scopeProps } = props; const [container1, setContainer] = $buum9$react.useState(null); const onMountAutoFocus = $buum9$radixuireactusecallbackref.useCallbackRef(onMountAutoFocusProp); const onUnmountAutoFocus = $buum9$radixuireactusecallbackref.useCallbackRef(onUnmountAutoFocusProp); const lastFocusedElementRef = $buum9$react.useRef(null); const composedRefs = $buum9$radixuireactcomposerefs.useComposedRefs(forwardedRef, node => setContainer(node)); const focusScope = $buum9$react.useRef({ paused: false, pause() { this.paused = true; }, resume() { this.paused = false; } }).current; // Takes care of trapping focus if focus is moved outside programmatically for example $buum9$react.useEffect(() => { if (trapped) { function handleFocusIn(event) { if (focusScope.paused || !container1) return; const target = event.target; if (container1.contains(target)) lastFocusedElementRef.current = target;else $2bc01e66e04aa9ed$var$focus(lastFocusedElementRef.current, { select: true }); } function handleFocusOut(event) { if (focusScope.paused || !container1) return; const relatedTarget = event.relatedTarget; // A `focusout` event with a `null` `relatedTarget` will happen in at least two cases: // // 1. When the user switches app/tabs/windows/the browser itself loses focus. // 2. In Google Chrome, when the focused element is removed from the DOM. // // We let the browser do its thing here because: // // 1. The browser already keeps a memory of what's focused for when the page gets refocused. // 2. In Google Chrome, if we try to focus the deleted focused element (as per below), it // throws the CPU to 100%, so we avoid doing anything for this reason here too. if (relatedTarget === null) return; // If the focus has moved to an actual legitimate element (`relatedTarget !== null`) // that is outside the container, we move focus to the last valid focused element inside. if (!container1.contains(relatedTarget)) $2bc01e66e04aa9ed$var$focus(lastFocusedElementRef.current, { select: true }); } // When the focused element gets removed from the DOM, browsers move focus // back to the document.body. In this case, we move focus to the container // to keep focus trapped correctly. function handleMutations(mutations) { const focusedElement = document.activeElement; for (const mutation of mutations) { if (mutation.removedNodes.length > 0) { if (!(container1 !== null && container1 !== void 0 && container1.contains(focusedElement))) $2bc01e66e04aa9ed$var$focus(container1); } } } document.addEventListener('focusin', handleFocusIn); document.addEventListener('focusout', handleFocusOut); const mutationObserver = new MutationObserver(handleMutations); if (container1) mutationObserver.observe(container1, { childList: true, subtree: true }); return () => { document.removeEventListener('focusin', handleFocusIn); document.removeEventListener('focusout', handleFocusOut); mutationObserver.disconnect(); }; } }, [trapped, container1, focusScope.paused]); $buum9$react.useEffect(() => { if (container1) { $2bc01e66e04aa9ed$var$focusScopesStack.add(focusScope); const previouslyFocusedElement = document.activeElement; const hasFocusedCandidate = container1.contains(previouslyFocusedElement); if (!hasFocusedCandidate) { const mountEvent = new CustomEvent($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT, $2bc01e66e04aa9ed$var$EVENT_OPTIONS); container1.addEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); container1.dispatchEvent(mountEvent); if (!mountEvent.defaultPrevented) { $2bc01e66e04aa9ed$var$focusFirst($2bc01e66e04aa9ed$var$removeLinks($2bc01e66e04aa9ed$var$getTabbableCandidates(container1)), { select: true }); if (document.activeElement === previouslyFocusedElement) $2bc01e66e04aa9ed$var$focus(container1); } } return () => { container1.removeEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_MOUNT, onMountAutoFocus); // We hit a react bug (fixed in v17) with focusing in unmount. // We need to delay the focus a little to get around it for now. // See: https://github.com/facebook/react/issues/17894 setTimeout(() => { const unmountEvent = new CustomEvent($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT, $2bc01e66e04aa9ed$var$EVENT_OPTIONS); container1.addEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); container1.dispatchEvent(unmountEvent); if (!unmountEvent.defaultPrevented) $2bc01e66e04aa9ed$var$focus(previouslyFocusedElement !== null && previouslyFocusedElement !== void 0 ? previouslyFocusedElement : document.body, { select: true }); // we need to remove the listener after we `dispatchEvent` container1.removeEventListener($2bc01e66e04aa9ed$var$AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus); $2bc01e66e04aa9ed$var$focusScopesStack.remove(focusScope); }, 0); }; } }, [container1, onMountAutoFocus, onUnmountAutoFocus, focusScope]); // Takes care of looping focus (when tabbing whilst at the edges) const handleKeyDown = $buum9$react.useCallback(event => { if (!loop && !trapped) return; if (focusScope.paused) return; const isTabKey = event.key === 'Tab' && !event.altKey && !event.ctrlKey && !event.metaKey; const focusedElement = document.activeElement; if (isTabKey && focusedElement) { const container = event.currentTarget; const [first, last] = $2bc01e66e04aa9ed$var$getTabbableEdges(container); const hasTabbableElementsInside = first && last; // we can only wrap focus if we have tabbable edges if (!hasTabbableElementsInside) { if (focusedElement === container) event.preventDefault(); } else { if (!event.shiftKey && focusedElement === last) { event.preventDefault(); if (loop) $2bc01e66e04aa9ed$var$focus(first, { select: true }); } else if (event.shiftKey && focusedElement === first) { event.preventDefault(); if (loop) $2bc01e66e04aa9ed$var$focus(last, { select: true }); } } } }, [loop, trapped, focusScope.paused]); return /*#__PURE__*/$buum9$react.createElement($buum9$radixuireactprimitive.Primitive.div, $parcel$interopDefault($buum9$babelruntimehelpersextends)({ tabIndex: -1 }, scopeProps, { ref: composedRefs, onKeyDown: handleKeyDown })); }); /*#__PURE__*/ Object.assign($2bc01e66e04aa9ed$export$20e40289641fbbb6, { displayName: $2bc01e66e04aa9ed$var$FOCUS_SCOPE_NAME }); /* ------------------------------------------------------------------------------------------------- * Utils * -----------------------------------------------------------------------------------------------*/ /** * Attempts focusing the first element in a list of candidates. * Stops when focus has actually moved. */ function $2bc01e66e04aa9ed$var$focusFirst(candidates) { let { select = false } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; const previouslyFocusedElement = document.activeElement; for (const candidate of candidates) { $2bc01e66e04aa9ed$var$focus(candidate, { select: select }); if (document.activeElement !== previouslyFocusedElement) return; } } /** * Returns the first and last tabbable elements inside a container. */ function $2bc01e66e04aa9ed$var$getTabbableEdges(container) { const candidates = $2bc01e66e04aa9ed$var$getTabbableCandidates(container); const first = $2bc01e66e04aa9ed$var$findVisible(candidates, container); const last = $2bc01e66e04aa9ed$var$findVisible(candidates.reverse(), container); return [first, last]; } /** * Returns a list of potential tabbable candidates. * * NOTE: This is only a close approximation. For example it doesn't take into account cases like when * elements are not visible. This cannot be worked out easily by just reading a property, but rather * necessitate runtime knowledge (computed styles, etc). We deal with these cases separately. * * See: https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker * Credit: https://github.com/discord/focus-layers/blob/master/src/util/wrapFocus.tsx#L1 */ function $2bc01e66e04aa9ed$var$getTabbableCandidates(container) { const nodes = []; const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, { acceptNode: node => { const isHiddenInput = node.tagName === 'INPUT' && node.type === 'hidden'; if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP; // `.tabIndex` is not the same as the `tabindex` attribute. It works on the // runtime's understanding of tabbability, so this automatically accounts // for any kind of element that could be tabbed to. return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP; } }); while (walker.nextNode()) nodes.push(walker.currentNode); // we do not take into account the order of nodes with positive `tabIndex` as it // hinders accessibility to have tab order different from visual order. return nodes; } /** * Returns the first visible element in a list. * NOTE: Only checks visibility up to the `container`. */ function $2bc01e66e04aa9ed$var$findVisible(elements, container) { for (const element of elements) { // we stop checking if it's hidden at the `container` level (excluding) if (!$2bc01e66e04aa9ed$var$isHidden(element, { upTo: container })) return element; } } function $2bc01e66e04aa9ed$var$isHidden(node, _ref) { let { upTo: upTo } = _ref; if (getComputedStyle(node).visibility === 'hidden') return true; while (node) { // we stop at `upTo` (excluding it) if (upTo !== undefined && node === upTo) return false; if (getComputedStyle(node).display === 'none') return true; node = node.parentElement; } return false; } function $2bc01e66e04aa9ed$var$isSelectableInput(element) { return element instanceof HTMLInputElement && 'select' in element; } function $2bc01e66e04aa9ed$var$focus(element) { let { select = false } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; // only focus if that element is focusable if (element && element.focus) { const previouslyFocusedElement = document.activeElement; // NOTE: we prevent scrolling on focus, to minimize jarring transitions for users element.focus({ preventScroll: true }); // only select if its not the same element, it supports selection and we need to select if (element !== previouslyFocusedElement && $2bc01e66e04aa9ed$var$isSelectableInput(element) && select) element.select(); } } /* ------------------------------------------------------------------------------------------------- * FocusScope stack * -----------------------------------------------------------------------------------------------*/ const $2bc01e66e04aa9ed$var$focusScopesStack = $2bc01e66e04aa9ed$var$createFocusScopesStack(); function $2bc01e66e04aa9ed$var$createFocusScopesStack() { /** A stack of focus scopes, with the active one at the top */let stack = []; return { add(focusScope) { // pause the currently active focus scope (at the top of the stack) const activeFocusScope = stack[0]; if (focusScope !== activeFocusScope) activeFocusScope === null || activeFocusScope === void 0 || activeFocusScope.pause(); // remove in case it already exists (because we'll re-add it at the top of the stack) stack = $2bc01e66e04aa9ed$var$arrayRemove(stack, focusScope); stack.unshift(focusScope); }, remove(focusScope) { var _stack$; stack = $2bc01e66e04aa9ed$var$arrayRemove(stack, focusScope); (_stack$ = stack[0]) === null || _stack$ === void 0 || _stack$.resume(); } }; } function $2bc01e66e04aa9ed$var$arrayRemove(array, item) { const updatedArray = [...array]; const index = updatedArray.indexOf(item); if (index !== -1) updatedArray.splice(index, 1); return updatedArray; } function $2bc01e66e04aa9ed$var$removeLinks(items) { return items.filter(item => item.tagName !== 'A'); } const $2bc01e66e04aa9ed$export$be92b6f5f03c0fe9 = $2bc01e66e04aa9ed$export$20e40289641fbbb6; /***/ }), /***/ "../../../node_modules/@radix-ui/react-id/dist/index.js": /*!**************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-id/dist/index.js ***! \**************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $47woD$react = __webpack_require__(/*! react */ "react"); var $47woD$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useId", () => $dc478e4659f630c5$export$f680877a34711e37); const $dc478e4659f630c5$var$useReactId = $47woD$react['useId'.toString()] || (() => undefined); let $dc478e4659f630c5$var$count = 0; function $dc478e4659f630c5$export$f680877a34711e37(deterministicId) { const [id, setId] = $47woD$react.useState($dc478e4659f630c5$var$useReactId()); // React versions older than 18 will have client-side ids only. $47woD$radixuireactuselayouteffect.useLayoutEffect(() => { if (!deterministicId) setId(reactId => reactId !== null && reactId !== void 0 ? reactId : String($dc478e4659f630c5$var$count++)); }, [deterministicId]); return deterministicId || (id ? `radix-${id}` : ''); } /***/ }), /***/ "../../../node_modules/@radix-ui/react-menu/dist/index.js": /*!****************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-menu/dist/index.js ***! \****************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $cnSS2$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $cnSS2$react = __webpack_require__(/*! react */ "react"); var $cnSS2$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); var $cnSS2$radixuireactcollection = __webpack_require__(/*! @radix-ui/react-collection */ "../../../node_modules/@radix-ui/react-collection/dist/index.js"); var $cnSS2$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $cnSS2$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $cnSS2$radixuireactdirection = __webpack_require__(/*! @radix-ui/react-direction */ "../../../node_modules/@radix-ui/react-direction/dist/index.js"); var $cnSS2$radixuireactdismissablelayer = __webpack_require__(/*! @radix-ui/react-dismissable-layer */ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js"); var $cnSS2$radixuireactfocusguards = __webpack_require__(/*! @radix-ui/react-focus-guards */ "../../../node_modules/@radix-ui/react-focus-guards/dist/index.js"); var $cnSS2$radixuireactfocusscope = __webpack_require__(/*! @radix-ui/react-focus-scope */ "../../../node_modules/@radix-ui/react-focus-scope/dist/index.js"); var $cnSS2$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); var $cnSS2$radixuireactpopper = __webpack_require__(/*! @radix-ui/react-popper */ "../../../node_modules/@radix-ui/react-popper/dist/index.js"); var $cnSS2$radixuireactportal = __webpack_require__(/*! @radix-ui/react-portal */ "../../../node_modules/@radix-ui/react-portal/dist/index.js"); var $cnSS2$radixuireactpresence = __webpack_require__(/*! @radix-ui/react-presence */ "../../../node_modules/@radix-ui/react-presence/dist/index.js"); var $cnSS2$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $cnSS2$radixuireactrovingfocus = __webpack_require__(/*! @radix-ui/react-roving-focus */ "../../../node_modules/@radix-ui/react-roving-focus/dist/index.js"); var $cnSS2$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); var $cnSS2$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); var $cnSS2$ariahidden = __webpack_require__(/*! aria-hidden */ "../../../node_modules/aria-hidden/dist/es2015/index.js"); var $cnSS2$reactremovescroll = __webpack_require__(/*! react-remove-scroll */ "../../../node_modules/react-remove-scroll/dist/es2015/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createMenuScope", () => $213e4d2df823067d$export$4027731b685e72eb); $parcel$export(module.exports, "Menu", () => $213e4d2df823067d$export$d9b273488cd8ce6f); $parcel$export(module.exports, "MenuAnchor", () => $213e4d2df823067d$export$9fa5ebd18bee4d43); $parcel$export(module.exports, "MenuPortal", () => $213e4d2df823067d$export$793392f970497feb); $parcel$export(module.exports, "MenuContent", () => $213e4d2df823067d$export$479f0f2f71193efe); $parcel$export(module.exports, "MenuGroup", () => $213e4d2df823067d$export$22a631d1f72787bb); $parcel$export(module.exports, "MenuLabel", () => $213e4d2df823067d$export$dd37bec0e8a99143); $parcel$export(module.exports, "MenuItem", () => $213e4d2df823067d$export$2ce376c2cc3355c8); $parcel$export(module.exports, "MenuCheckboxItem", () => $213e4d2df823067d$export$f6f243521332502d); $parcel$export(module.exports, "MenuRadioGroup", () => $213e4d2df823067d$export$ea2200c9eee416b3); $parcel$export(module.exports, "MenuRadioItem", () => $213e4d2df823067d$export$69bd225e9817f6d0); $parcel$export(module.exports, "MenuItemIndicator", () => $213e4d2df823067d$export$a2593e23056970a3); $parcel$export(module.exports, "MenuSeparator", () => $213e4d2df823067d$export$1cec7dcdd713e220); $parcel$export(module.exports, "MenuArrow", () => $213e4d2df823067d$export$bcdda4773debf5fa); $parcel$export(module.exports, "MenuSub", () => $213e4d2df823067d$export$71bdb9d1e2909932); $parcel$export(module.exports, "MenuSubTrigger", () => $213e4d2df823067d$export$5fbbb3ba7297405f); $parcel$export(module.exports, "MenuSubContent", () => $213e4d2df823067d$export$e7142ab31822bde6); $parcel$export(module.exports, "Root", () => $213e4d2df823067d$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Anchor", () => $213e4d2df823067d$export$b688253958b8dfe7); $parcel$export(module.exports, "Portal", () => $213e4d2df823067d$export$602eac185826482c); $parcel$export(module.exports, "Content", () => $213e4d2df823067d$export$7c6e2c02157bb7d2); $parcel$export(module.exports, "Group", () => $213e4d2df823067d$export$eb2fcfdbd7ba97d4); $parcel$export(module.exports, "Label", () => $213e4d2df823067d$export$b04be29aa201d4f5); $parcel$export(module.exports, "Item", () => $213e4d2df823067d$export$6d08773d2e66f8f2); $parcel$export(module.exports, "CheckboxItem", () => $213e4d2df823067d$export$16ce288f89fa631c); $parcel$export(module.exports, "RadioGroup", () => $213e4d2df823067d$export$a98f0dcb43a68a25); $parcel$export(module.exports, "RadioItem", () => $213e4d2df823067d$export$371ab307eab489c0); $parcel$export(module.exports, "ItemIndicator", () => $213e4d2df823067d$export$c3468e2714d175fa); $parcel$export(module.exports, "Separator", () => $213e4d2df823067d$export$1ff3c3f08ae963c0); $parcel$export(module.exports, "Arrow", () => $213e4d2df823067d$export$21b07c8f274aebd5); $parcel$export(module.exports, "Sub", () => $213e4d2df823067d$export$d7a01e11500dfb6f); $parcel$export(module.exports, "SubTrigger", () => $213e4d2df823067d$export$2ea8a7a591ac5eac); $parcel$export(module.exports, "SubContent", () => $213e4d2df823067d$export$6d4de93b380beddf); const $213e4d2df823067d$var$SELECTION_KEYS = ['Enter', ' ']; const $213e4d2df823067d$var$FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home']; const $213e4d2df823067d$var$LAST_KEYS = ['ArrowUp', 'PageDown', 'End']; const $213e4d2df823067d$var$FIRST_LAST_KEYS = [...$213e4d2df823067d$var$FIRST_KEYS, ...$213e4d2df823067d$var$LAST_KEYS]; const $213e4d2df823067d$var$SUB_OPEN_KEYS = { ltr: [...$213e4d2df823067d$var$SELECTION_KEYS, 'ArrowRight'], rtl: [...$213e4d2df823067d$var$SELECTION_KEYS, 'ArrowLeft'] }; const $213e4d2df823067d$var$SUB_CLOSE_KEYS = { ltr: ['ArrowLeft'], rtl: ['ArrowRight'] }; /* ------------------------------------------------------------------------------------------------- * Menu * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$MENU_NAME = 'Menu'; const [$213e4d2df823067d$var$Collection, $213e4d2df823067d$var$useCollection, $213e4d2df823067d$var$createCollectionScope] = $cnSS2$radixuireactcollection.createCollection($213e4d2df823067d$var$MENU_NAME); const [$213e4d2df823067d$var$createMenuContext, $213e4d2df823067d$export$4027731b685e72eb] = $cnSS2$radixuireactcontext.createContextScope($213e4d2df823067d$var$MENU_NAME, [$213e4d2df823067d$var$createCollectionScope, $cnSS2$radixuireactpopper.createPopperScope, $cnSS2$radixuireactrovingfocus.createRovingFocusGroupScope]); const $213e4d2df823067d$var$usePopperScope = $cnSS2$radixuireactpopper.createPopperScope(); const $213e4d2df823067d$var$useRovingFocusGroupScope = $cnSS2$radixuireactrovingfocus.createRovingFocusGroupScope(); const [$213e4d2df823067d$var$MenuProvider, $213e4d2df823067d$var$useMenuContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$MENU_NAME); const [$213e4d2df823067d$var$MenuRootProvider, $213e4d2df823067d$var$useMenuRootContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$MENU_NAME); const $213e4d2df823067d$export$d9b273488cd8ce6f = props => { const { __scopeMenu: __scopeMenu, open = false, children: children, dir: dir, onOpenChange: onOpenChange, modal = true } = props; const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); const [content, setContent] = $cnSS2$react.useState(null); const isUsingKeyboardRef = $cnSS2$react.useRef(false); const handleOpenChange = $cnSS2$radixuireactusecallbackref.useCallbackRef(onOpenChange); const direction = $cnSS2$radixuireactdirection.useDirection(dir); $cnSS2$react.useEffect(() => { // Capture phase ensures we set the boolean before any side effects execute // in response to the key or pointer event as they might depend on this value. const handleKeyDown = () => { isUsingKeyboardRef.current = true; document.addEventListener('pointerdown', handlePointer, { capture: true, once: true }); document.addEventListener('pointermove', handlePointer, { capture: true, once: true }); }; const handlePointer = () => isUsingKeyboardRef.current = false; document.addEventListener('keydown', handleKeyDown, { capture: true }); return () => { document.removeEventListener('keydown', handleKeyDown, { capture: true }); document.removeEventListener('pointerdown', handlePointer, { capture: true }); document.removeEventListener('pointermove', handlePointer, { capture: true }); }; }, []); return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Root, popperScope, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuProvider, { scope: __scopeMenu, open: open, onOpenChange: handleOpenChange, content: content, onContentChange: setContent }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuRootProvider, { scope: __scopeMenu, onClose: $cnSS2$react.useCallback(() => handleOpenChange(false), [handleOpenChange]), isUsingKeyboardRef: isUsingKeyboardRef, dir: direction, modal: modal }, children))); }; /*#__PURE__*/ Object.assign($213e4d2df823067d$export$d9b273488cd8ce6f, { displayName: $213e4d2df823067d$var$MENU_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuAnchor * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$ANCHOR_NAME = 'MenuAnchor'; const $213e4d2df823067d$export$9fa5ebd18bee4d43 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, ...anchorProps } = props; const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Anchor, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, popperScope, anchorProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$9fa5ebd18bee4d43, { displayName: $213e4d2df823067d$var$ANCHOR_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuPortal * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$PORTAL_NAME = 'MenuPortal'; const [$213e4d2df823067d$var$PortalProvider, $213e4d2df823067d$var$usePortalContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$PORTAL_NAME, { forceMount: undefined }); const $213e4d2df823067d$export$793392f970497feb = props => { const { __scopeMenu: __scopeMenu, forceMount: forceMount, children: children, container: container } = props; const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$PORTAL_NAME, __scopeMenu); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$PortalProvider, { scope: __scopeMenu, forceMount: forceMount }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { present: forceMount || context.open }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactportal.Portal, { asChild: true, container: container }, children))); }; /*#__PURE__*/ Object.assign($213e4d2df823067d$export$793392f970497feb, { displayName: $213e4d2df823067d$var$PORTAL_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuContent * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$CONTENT_NAME = 'MenuContent'; const [$213e4d2df823067d$var$MenuContentProvider, $213e4d2df823067d$var$useMenuContentContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$CONTENT_NAME); const $213e4d2df823067d$export$479f0f2f71193efe = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const portalContext = $213e4d2df823067d$var$usePortalContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); const { forceMount = portalContext.forceMount, ...contentProps } = props; const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Provider, { scope: props.__scopeMenu }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { present: forceMount || context.open }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Slot, { scope: props.__scopeMenu }, rootContext.modal ? /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuRootContentModal, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, contentProps, { ref: forwardedRef })) : /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuRootContentNonModal, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, contentProps, { ref: forwardedRef }))))); }); /* ---------------------------------------------------------------------------------------------- */ const $213e4d2df823067d$var$MenuRootContentModal = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); const ref = $cnSS2$react.useRef(null); const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent` $cnSS2$react.useEffect(() => { const content = ref.current; if (content) return $cnSS2$ariahidden.hideOthers(content); }, []); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, props, { ref: composedRefs // we make sure we're not trapping once it's been closed , trapFocus: context.open // make sure to only disable pointer events when open , disableOutsidePointerEvents: context.open, disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen. , onFocusOutside: $cnSS2$radixuiprimitive.composeEventHandlers(props.onFocusOutside, event => event.preventDefault(), { checkForDefaultPrevented: false }), onDismiss: () => context.onOpenChange(false) })); }); const $213e4d2df823067d$var$MenuRootContentNonModal = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, props, { ref: forwardedRef, trapFocus: false, disableOutsidePointerEvents: false, disableOutsideScroll: false, onDismiss: () => context.onOpenChange(false) })); }); /* ---------------------------------------------------------------------------------------------- */ const $213e4d2df823067d$var$MenuContentImpl = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, loop = false, trapFocus: trapFocus, onOpenAutoFocus: onOpenAutoFocus, onCloseAutoFocus: onCloseAutoFocus, disableOutsidePointerEvents: disableOutsidePointerEvents, onEntryFocus: onEntryFocus, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, onFocusOutside: onFocusOutside, onInteractOutside: onInteractOutside, onDismiss: onDismiss, disableOutsideScroll: disableOutsideScroll, ...contentProps } = props; const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, __scopeMenu); const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$CONTENT_NAME, __scopeMenu); const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); const rovingFocusGroupScope = $213e4d2df823067d$var$useRovingFocusGroupScope(__scopeMenu); const getItems = $213e4d2df823067d$var$useCollection(__scopeMenu); const [currentItemId, setCurrentItemId] = $cnSS2$react.useState(null); const contentRef = $cnSS2$react.useRef(null); const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, contentRef, context.onContentChange); const timerRef = $cnSS2$react.useRef(0); const searchRef = $cnSS2$react.useRef(''); const pointerGraceTimerRef = $cnSS2$react.useRef(0); const pointerGraceIntentRef = $cnSS2$react.useRef(null); const pointerDirRef = $cnSS2$react.useRef('right'); const lastPointerXRef = $cnSS2$react.useRef(0); const ScrollLockWrapper = disableOutsideScroll ? $cnSS2$reactremovescroll.RemoveScroll : $cnSS2$react.Fragment; const scrollLockWrapperProps = disableOutsideScroll ? { as: $cnSS2$radixuireactslot.Slot, allowPinchZoom: true } : undefined; const handleTypeaheadSearch = key => { var _items$find, _items$find2; const search = searchRef.current + key; const items = getItems().filter(item => !item.disabled); const currentItem = document.activeElement; const currentMatch = (_items$find = items.find(item => item.ref.current === currentItem)) === null || _items$find === void 0 ? void 0 : _items$find.textValue; const values = items.map(item => item.textValue); const nextMatch = $213e4d2df823067d$var$getNextMatch(values, search, currentMatch); const newItem = (_items$find2 = items.find(item => item.textValue === nextMatch)) === null || _items$find2 === void 0 ? void 0 : _items$find2.ref.current; // Reset `searchRef` 1 second after it was last updated (function updateSearch(value) { searchRef.current = value; window.clearTimeout(timerRef.current); if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000); })(search); if (newItem) /** * Imperative focus during keydown is risky so we prevent React's batching updates * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332 */ setTimeout(() => newItem.focus()); }; $cnSS2$react.useEffect(() => { return () => window.clearTimeout(timerRef.current); }, []); // Make sure the whole tree has focus guards as our `MenuContent` may be // the last element in the DOM (beacuse of the `Portal`) $cnSS2$radixuireactfocusguards.useFocusGuards(); const isPointerMovingToSubmenu = $cnSS2$react.useCallback(event => { var _pointerGraceIntentRe, _pointerGraceIntentRe2; const isMovingTowards = pointerDirRef.current === ((_pointerGraceIntentRe = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe === void 0 ? void 0 : _pointerGraceIntentRe.side); return isMovingTowards && $213e4d2df823067d$var$isPointerInGraceArea(event, (_pointerGraceIntentRe2 = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe2 === void 0 ? void 0 : _pointerGraceIntentRe2.area); }, []); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentProvider, { scope: __scopeMenu, searchRef: searchRef, onItemEnter: $cnSS2$react.useCallback(event => { if (isPointerMovingToSubmenu(event)) event.preventDefault(); }, [isPointerMovingToSubmenu]), onItemLeave: $cnSS2$react.useCallback(event => { var _contentRef$current; if (isPointerMovingToSubmenu(event)) return; (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus(); setCurrentItemId(null); }, [isPointerMovingToSubmenu]), onTriggerLeave: $cnSS2$react.useCallback(event => { if (isPointerMovingToSubmenu(event)) event.preventDefault(); }, [isPointerMovingToSubmenu]), pointerGraceTimerRef: pointerGraceTimerRef, onPointerGraceIntentChange: $cnSS2$react.useCallback(intent => { pointerGraceIntentRef.current = intent; }, []) }, /*#__PURE__*/$cnSS2$react.createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactfocusscope.FocusScope, { asChild: true, trapped: trapFocus, onMountAutoFocus: $cnSS2$radixuiprimitive.composeEventHandlers(onOpenAutoFocus, event => { var _contentRef$current2; // when opening, explicitly focus the content area only and leave // `onEntryFocus` in control of focusing first item event.preventDefault(); (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus(); }), onUnmountAutoFocus: onCloseAutoFocus }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactdismissablelayer.DismissableLayer, { asChild: true, disableOutsidePointerEvents: disableOutsidePointerEvents, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, onFocusOutside: onFocusOutside, onInteractOutside: onInteractOutside, onDismiss: onDismiss }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactrovingfocus.Root, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ asChild: true }, rovingFocusGroupScope, { dir: rootContext.dir, orientation: "vertical", loop: loop, currentTabStopId: currentItemId, onCurrentTabStopIdChange: setCurrentItemId, onEntryFocus: $cnSS2$radixuiprimitive.composeEventHandlers(onEntryFocus, event => { // only focus first item when using keyboard if (!rootContext.isUsingKeyboardRef.current) event.preventDefault(); }) }), /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Content, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ role: "menu", "aria-orientation": "vertical", "data-state": $213e4d2df823067d$var$getOpenState(context.open), "data-radix-menu-content": "", dir: rootContext.dir }, popperScope, contentProps, { ref: composedRefs, style: { outline: 'none', ...contentProps.style }, onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(contentProps.onKeyDown, event => { // submenu key events bubble through portals. We only care about keys in this menu. const target = event.target; const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget; const isModifierKey = event.ctrlKey || event.altKey || event.metaKey; const isCharacterKey = event.key.length === 1; if (isKeyDownInside) { // menus should not be navigated using tab key so we prevent it if (event.key === 'Tab') event.preventDefault(); if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key); } // focus first/last item based on key pressed const content = contentRef.current; if (event.target !== content) return; if (!$213e4d2df823067d$var$FIRST_LAST_KEYS.includes(event.key)) return; event.preventDefault(); const items = getItems().filter(item => !item.disabled); const candidateNodes = items.map(item => item.ref.current); if ($213e4d2df823067d$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse(); $213e4d2df823067d$var$focusFirst(candidateNodes); }), onBlur: $cnSS2$radixuiprimitive.composeEventHandlers(props.onBlur, event => { // clear search buffer when leaving the menu if (!event.currentTarget.contains(event.target)) { window.clearTimeout(timerRef.current); searchRef.current = ''; } }), onPointerMove: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerMove, $213e4d2df823067d$var$whenMouse(event => { const target = event.target; const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will // always return `0` on a pointer event. if (event.currentTarget.contains(target) && pointerXHasChanged) { const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left'; pointerDirRef.current = newDir; lastPointerXRef.current = event.clientX; } })) }))))))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$479f0f2f71193efe, { displayName: $213e4d2df823067d$var$CONTENT_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuGroup * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$GROUP_NAME = 'MenuGroup'; const $213e4d2df823067d$export$22a631d1f72787bb = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, ...groupProps } = props; return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ role: "group" }, groupProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$22a631d1f72787bb, { displayName: $213e4d2df823067d$var$GROUP_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuLabel * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$LABEL_NAME = 'MenuLabel'; const $213e4d2df823067d$export$dd37bec0e8a99143 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, ...labelProps } = props; return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, labelProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$dd37bec0e8a99143, { displayName: $213e4d2df823067d$var$LABEL_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuItem * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$ITEM_NAME = 'MenuItem'; const $213e4d2df823067d$var$ITEM_SELECT = 'menu.itemSelect'; const $213e4d2df823067d$export$2ce376c2cc3355c8 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { disabled = false, onSelect: onSelect, ...itemProps } = props; const ref = $cnSS2$react.useRef(null); const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$ITEM_NAME, props.__scopeMenu); const contentContext = $213e4d2df823067d$var$useMenuContentContext($213e4d2df823067d$var$ITEM_NAME, props.__scopeMenu); const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); const isPointerDownRef = $cnSS2$react.useRef(false); const handleSelect = () => { const menuItem = ref.current; if (!disabled && menuItem) { const itemSelectEvent = new CustomEvent($213e4d2df823067d$var$ITEM_SELECT, { bubbles: true, cancelable: true }); menuItem.addEventListener($213e4d2df823067d$var$ITEM_SELECT, event => onSelect === null || onSelect === void 0 ? void 0 : onSelect(event), { once: true }); $cnSS2$radixuireactprimitive.dispatchDiscreteCustomEvent(menuItem, itemSelectEvent); if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;else rootContext.onClose(); } }; return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuItemImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, itemProps, { ref: composedRefs, disabled: disabled, onClick: $cnSS2$radixuiprimitive.composeEventHandlers(props.onClick, handleSelect), onPointerDown: event => { var _props$onPointerDown; (_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event); isPointerDownRef.current = true; }, onPointerUp: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerUp, event => { var _event$currentTarget; // Pointer down can move to a different menu item which should activate it on pointer up. // We dispatch a click for selection to allow composition with click based triggers and to // prevent Firefox from getting stuck in text selection mode when the menu closes. if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click(); }), onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { const isTypingAhead = contentContext.searchRef.current !== ''; if (disabled || isTypingAhead && event.key === ' ') return; if ($213e4d2df823067d$var$SELECTION_KEYS.includes(event.key)) { event.currentTarget.click(); /** * We prevent default browser behaviour for selection keys as they should trigger * a selection only: * - prevents space from scrolling the page. * - if keydown causes focus to move, prevents keydown from firing on the new target. */ event.preventDefault(); } }) })); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$2ce376c2cc3355c8, { displayName: $213e4d2df823067d$var$ITEM_NAME }); /* ---------------------------------------------------------------------------------------------- */ const $213e4d2df823067d$var$MenuItemImpl = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, disabled = false, textValue: textValue, ...itemProps } = props; const contentContext = $213e4d2df823067d$var$useMenuContentContext($213e4d2df823067d$var$ITEM_NAME, __scopeMenu); const rovingFocusGroupScope = $213e4d2df823067d$var$useRovingFocusGroupScope(__scopeMenu); const ref = $cnSS2$react.useRef(null); const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); const [isFocused, setIsFocused] = $cnSS2$react.useState(false); // get the item's `.textContent` as default strategy for typeahead `textValue` const [textContent, setTextContent] = $cnSS2$react.useState(''); $cnSS2$react.useEffect(() => { const menuItem = ref.current; if (menuItem) { var _menuItem$textContent; setTextContent(((_menuItem$textContent = menuItem.textContent) !== null && _menuItem$textContent !== void 0 ? _menuItem$textContent : '').trim()); } }, [itemProps.children]); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.ItemSlot, { scope: __scopeMenu, disabled: disabled, textValue: textValue !== null && textValue !== void 0 ? textValue : textContent }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactrovingfocus.Item, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ asChild: true }, rovingFocusGroupScope, { focusable: !disabled }), /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ role: "menuitem", "data-highlighted": isFocused ? '' : undefined, "aria-disabled": disabled || undefined, "data-disabled": disabled ? '' : undefined }, itemProps, { ref: composedRefs, onPointerMove: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerMove, $213e4d2df823067d$var$whenMouse(event => { if (disabled) contentContext.onItemLeave(event);else { contentContext.onItemEnter(event); if (!event.defaultPrevented) { const item = event.currentTarget; item.focus(); } } })), onPointerLeave: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerLeave, $213e4d2df823067d$var$whenMouse(event => contentContext.onItemLeave(event))), onFocus: $cnSS2$radixuiprimitive.composeEventHandlers(props.onFocus, () => setIsFocused(true)), onBlur: $cnSS2$radixuiprimitive.composeEventHandlers(props.onBlur, () => setIsFocused(false)) })))); }); /* ------------------------------------------------------------------------------------------------- * MenuCheckboxItem * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$CHECKBOX_ITEM_NAME = 'MenuCheckboxItem'; const $213e4d2df823067d$export$f6f243521332502d = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { checked = false, onCheckedChange: onCheckedChange, ...checkboxItemProps } = props; return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$ItemIndicatorProvider, { scope: props.__scopeMenu, checked: checked }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$2ce376c2cc3355c8, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ role: "menuitemcheckbox", "aria-checked": $213e4d2df823067d$var$isIndeterminate(checked) ? 'mixed' : checked }, checkboxItemProps, { ref: forwardedRef, "data-state": $213e4d2df823067d$var$getCheckedState(checked), onSelect: $cnSS2$radixuiprimitive.composeEventHandlers(checkboxItemProps.onSelect, () => onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange($213e4d2df823067d$var$isIndeterminate(checked) ? true : !checked), { checkForDefaultPrevented: false }) }))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$f6f243521332502d, { displayName: $213e4d2df823067d$var$CHECKBOX_ITEM_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuRadioGroup * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$RADIO_GROUP_NAME = 'MenuRadioGroup'; const [$213e4d2df823067d$var$RadioGroupProvider, $213e4d2df823067d$var$useRadioGroupContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$RADIO_GROUP_NAME, { value: undefined, onValueChange: () => {} }); const $213e4d2df823067d$export$ea2200c9eee416b3 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { value: value, onValueChange: onValueChange, ...groupProps } = props; const handleValueChange = $cnSS2$radixuireactusecallbackref.useCallbackRef(onValueChange); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$RadioGroupProvider, { scope: props.__scopeMenu, value: value, onValueChange: handleValueChange }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$22a631d1f72787bb, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, groupProps, { ref: forwardedRef }))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$ea2200c9eee416b3, { displayName: $213e4d2df823067d$var$RADIO_GROUP_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuRadioItem * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$RADIO_ITEM_NAME = 'MenuRadioItem'; const $213e4d2df823067d$export$69bd225e9817f6d0 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { value: value, ...radioItemProps } = props; const context = $213e4d2df823067d$var$useRadioGroupContext($213e4d2df823067d$var$RADIO_ITEM_NAME, props.__scopeMenu); const checked = value === context.value; return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$ItemIndicatorProvider, { scope: props.__scopeMenu, checked: checked }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$2ce376c2cc3355c8, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ role: "menuitemradio", "aria-checked": checked }, radioItemProps, { ref: forwardedRef, "data-state": $213e4d2df823067d$var$getCheckedState(checked), onSelect: $cnSS2$radixuiprimitive.composeEventHandlers(radioItemProps.onSelect, () => { var _context$onValueChang; return (_context$onValueChang = context.onValueChange) === null || _context$onValueChang === void 0 ? void 0 : _context$onValueChang.call(context, value); }, { checkForDefaultPrevented: false }) }))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$69bd225e9817f6d0, { displayName: $213e4d2df823067d$var$RADIO_ITEM_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuItemIndicator * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$ITEM_INDICATOR_NAME = 'MenuItemIndicator'; const [$213e4d2df823067d$var$ItemIndicatorProvider, $213e4d2df823067d$var$useItemIndicatorContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$ITEM_INDICATOR_NAME, { checked: false }); const $213e4d2df823067d$export$a2593e23056970a3 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, forceMount: forceMount, ...itemIndicatorProps } = props; const indicatorContext = $213e4d2df823067d$var$useItemIndicatorContext($213e4d2df823067d$var$ITEM_INDICATOR_NAME, __scopeMenu); return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { present: forceMount || $213e4d2df823067d$var$isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.span, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, itemIndicatorProps, { ref: forwardedRef, "data-state": $213e4d2df823067d$var$getCheckedState(indicatorContext.checked) }))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$a2593e23056970a3, { displayName: $213e4d2df823067d$var$ITEM_INDICATOR_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuSeparator * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$SEPARATOR_NAME = 'MenuSeparator'; const $213e4d2df823067d$export$1cec7dcdd713e220 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, ...separatorProps } = props; return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactprimitive.Primitive.div, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ role: "separator", "aria-orientation": "horizontal" }, separatorProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$1cec7dcdd713e220, { displayName: $213e4d2df823067d$var$SEPARATOR_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuArrow * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$ARROW_NAME = 'MenuArrow'; const $213e4d2df823067d$export$bcdda4773debf5fa = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const { __scopeMenu: __scopeMenu, ...arrowProps } = props; const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Arrow, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({}, popperScope, arrowProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$bcdda4773debf5fa, { displayName: $213e4d2df823067d$var$ARROW_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuSub * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$SUB_NAME = 'MenuSub'; const [$213e4d2df823067d$var$MenuSubProvider, $213e4d2df823067d$var$useMenuSubContext] = $213e4d2df823067d$var$createMenuContext($213e4d2df823067d$var$SUB_NAME); const $213e4d2df823067d$export$71bdb9d1e2909932 = props => { const { __scopeMenu: __scopeMenu, children: children, open = false, onOpenChange: onOpenChange } = props; const parentMenuContext = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$SUB_NAME, __scopeMenu); const popperScope = $213e4d2df823067d$var$usePopperScope(__scopeMenu); const [trigger, setTrigger] = $cnSS2$react.useState(null); const [content, setContent] = $cnSS2$react.useState(null); const handleOpenChange = $cnSS2$radixuireactusecallbackref.useCallbackRef(onOpenChange); // Prevent the parent menu from reopening with open submenus. $cnSS2$react.useEffect(() => { if (parentMenuContext.open === false) handleOpenChange(false); return () => handleOpenChange(false); }, [parentMenuContext.open, handleOpenChange]); return /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpopper.Root, popperScope, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuProvider, { scope: __scopeMenu, open: open, onOpenChange: handleOpenChange, content: content, onContentChange: setContent }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuSubProvider, { scope: __scopeMenu, contentId: $cnSS2$radixuireactid.useId(), triggerId: $cnSS2$radixuireactid.useId(), trigger: trigger, onTriggerChange: setTrigger }, children))); }; /*#__PURE__*/ Object.assign($213e4d2df823067d$export$71bdb9d1e2909932, { displayName: $213e4d2df823067d$var$SUB_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuSubTrigger * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$SUB_TRIGGER_NAME = 'MenuSubTrigger'; const $213e4d2df823067d$export$5fbbb3ba7297405f = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); const subContext = $213e4d2df823067d$var$useMenuSubContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); const contentContext = $213e4d2df823067d$var$useMenuContentContext($213e4d2df823067d$var$SUB_TRIGGER_NAME, props.__scopeMenu); const openTimerRef = $cnSS2$react.useRef(null); const { pointerGraceTimerRef: pointerGraceTimerRef, onPointerGraceIntentChange: onPointerGraceIntentChange } = contentContext; const scope = { __scopeMenu: props.__scopeMenu }; const clearOpenTimer = $cnSS2$react.useCallback(() => { if (openTimerRef.current) window.clearTimeout(openTimerRef.current); openTimerRef.current = null; }, []); $cnSS2$react.useEffect(() => clearOpenTimer, [clearOpenTimer]); $cnSS2$react.useEffect(() => { const pointerGraceTimer = pointerGraceTimerRef.current; return () => { window.clearTimeout(pointerGraceTimer); onPointerGraceIntentChange(null); }; }, [pointerGraceTimerRef, onPointerGraceIntentChange]); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$export$9fa5ebd18bee4d43, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ asChild: true }, scope), /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuItemImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ id: subContext.triggerId, "aria-haspopup": "menu", "aria-expanded": context.open, "aria-controls": subContext.contentId, "data-state": $213e4d2df823067d$var$getOpenState(context.open) }, props, { ref: $cnSS2$radixuireactcomposerefs.composeRefs(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from , onClick: event => { var _props$onClick; (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event); if (props.disabled || event.defaultPrevented) return; /** * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons) * and we rely heavily on `onFocusOutside` for submenus to close when switching * between separate submenus. */ event.currentTarget.focus(); if (!context.open) context.onOpenChange(true); }, onPointerMove: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerMove, $213e4d2df823067d$var$whenMouse(event => { contentContext.onItemEnter(event); if (event.defaultPrevented) return; if (!props.disabled && !context.open && !openTimerRef.current) { contentContext.onPointerGraceIntentChange(null); openTimerRef.current = window.setTimeout(() => { context.onOpenChange(true); clearOpenTimer(); }, 100); } })), onPointerLeave: $cnSS2$radixuiprimitive.composeEventHandlers(props.onPointerLeave, $213e4d2df823067d$var$whenMouse(event => { var _context$content; clearOpenTimer(); const contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect(); if (contentRect) { var _context$content2; // TODO: make sure to update this when we change positioning logic const side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side; const rightSide = side === 'right'; const bleed = rightSide ? -5 : 5; const contentNearEdge = contentRect[rightSide ? 'left' : 'right']; const contentFarEdge = contentRect[rightSide ? 'right' : 'left']; contentContext.onPointerGraceIntentChange({ area: [ // consistently within polygon bounds { x: event.clientX + bleed, y: event.clientY }, { x: contentNearEdge, y: contentRect.top }, { x: contentFarEdge, y: contentRect.top }, { x: contentFarEdge, y: contentRect.bottom }, { x: contentNearEdge, y: contentRect.bottom }], side: side }); window.clearTimeout(pointerGraceTimerRef.current); pointerGraceTimerRef.current = window.setTimeout(() => contentContext.onPointerGraceIntentChange(null), 300); } else { contentContext.onTriggerLeave(event); if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened. contentContext.onPointerGraceIntentChange(null); } })), onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { const isTypingAhead = contentContext.searchRef.current !== ''; if (props.disabled || isTypingAhead && event.key === ' ') return; if ($213e4d2df823067d$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) { var _context$content3; context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction // so we ensure content is given focus again when switching to keyboard. (_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling event.preventDefault(); } }) }))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$5fbbb3ba7297405f, { displayName: $213e4d2df823067d$var$SUB_TRIGGER_NAME }); /* ------------------------------------------------------------------------------------------------- * MenuSubContent * -----------------------------------------------------------------------------------------------*/ const $213e4d2df823067d$var$SUB_CONTENT_NAME = 'MenuSubContent'; const $213e4d2df823067d$export$e7142ab31822bde6 = /*#__PURE__*/$cnSS2$react.forwardRef((props, forwardedRef) => { const portalContext = $213e4d2df823067d$var$usePortalContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); const { forceMount = portalContext.forceMount, ...subContentProps } = props; const context = $213e4d2df823067d$var$useMenuContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); const rootContext = $213e4d2df823067d$var$useMenuRootContext($213e4d2df823067d$var$CONTENT_NAME, props.__scopeMenu); const subContext = $213e4d2df823067d$var$useMenuSubContext($213e4d2df823067d$var$SUB_CONTENT_NAME, props.__scopeMenu); const ref = $cnSS2$react.useRef(null); const composedRefs = $cnSS2$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); return /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Provider, { scope: props.__scopeMenu }, /*#__PURE__*/$cnSS2$react.createElement($cnSS2$radixuireactpresence.Presence, { present: forceMount || context.open }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$Collection.Slot, { scope: props.__scopeMenu }, /*#__PURE__*/$cnSS2$react.createElement($213e4d2df823067d$var$MenuContentImpl, $parcel$interopDefault($cnSS2$babelruntimehelpersextends)({ id: subContext.contentId, "aria-labelledby": subContext.triggerId }, subContentProps, { ref: composedRefs, align: "start", side: rootContext.dir === 'rtl' ? 'left' : 'right', disableOutsidePointerEvents: false, disableOutsideScroll: false, trapFocus: false, onOpenAutoFocus: event => { var _ref$current; // when opening a submenu, focus content for keyboard users only if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus(); event.preventDefault(); } // The menu might close because of focusing another menu item in the parent menu. We , onCloseAutoFocus: event => event.preventDefault(), onFocusOutside: $cnSS2$radixuiprimitive.composeEventHandlers(props.onFocusOutside, event => { // We prevent closing when the trigger is focused to avoid triggering a re-open animation // on pointer interaction. if (event.target !== subContext.trigger) context.onOpenChange(false); }), onEscapeKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onEscapeKeyDown, event => { rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode event.preventDefault(); }), onKeyDown: $cnSS2$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { // Submenu key events bubble through portals. We only care about keys in this menu. const isKeyDownInside = event.currentTarget.contains(event.target); const isCloseKey = $213e4d2df823067d$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key); if (isKeyDownInside && isCloseKey) { var _subContext$trigger; context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus` (_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling event.preventDefault(); } }) }))))); }); /*#__PURE__*/ Object.assign($213e4d2df823067d$export$e7142ab31822bde6, { displayName: $213e4d2df823067d$var$SUB_CONTENT_NAME }); /* -----------------------------------------------------------------------------------------------*/ function $213e4d2df823067d$var$getOpenState(open) { return open ? 'open' : 'closed'; } function $213e4d2df823067d$var$isIndeterminate(checked) { return checked === 'indeterminate'; } function $213e4d2df823067d$var$getCheckedState(checked) { return $213e4d2df823067d$var$isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked'; } function $213e4d2df823067d$var$focusFirst(candidates) { const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; for (const candidate of candidates) { // if focus is already where we want to go, we don't want to keep going through the candidates if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; candidate.focus(); if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; } } /** * Wraps an array around itself at a given start index * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` */ function $213e4d2df823067d$var$wrapArray(array, startIndex) { return array.map((_, index) => array[(startIndex + index) % array.length]); } /** * This is the "meat" of the typeahead matching logic. It takes in all the values, * the search and the current match, and returns the next match (or `undefined`). * * We normalize the search because if a user has repeatedly pressed a character, * we want the exact same behavior as if we only had that one character * (ie. cycle through options starting with that character) * * We also reorder the values by wrapping the array around the current match. * This is so we always look forward from the current match, and picking the first * match will always be the correct one. * * Finally, if the normalized search is exactly one character, we exclude the * current match from the values because otherwise it would be the first to match always * and focus would never move. This is as opposed to the regular case, where we * don't want focus to move if the current match still matches. */ function $213e4d2df823067d$var$getNextMatch(values, search, currentMatch) { const isRepeated = search.length > 1 && Array.from(search).every(char => char === search[0]); const normalizedSearch = isRepeated ? search[0] : search; const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1; let wrappedValues = $213e4d2df823067d$var$wrapArray(values, Math.max(currentMatchIndex, 0)); const excludeCurrentMatch = normalizedSearch.length === 1; if (excludeCurrentMatch) wrappedValues = wrappedValues.filter(v => v !== currentMatch); const nextMatch = wrappedValues.find(value => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())); return nextMatch !== currentMatch ? nextMatch : undefined; } // Determine if a point is inside of a polygon. // Based on https://github.com/substack/point-in-polygon function $213e4d2df823067d$var$isPointInPolygon(point, polygon) { const { x: x, y: y } = point; let inside = false; for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { const xi = polygon[i].x; const yi = polygon[i].y; const xj = polygon[j].x; const yj = polygon[j].y; // prettier-ignore const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; if (intersect) inside = !inside; } return inside; } function $213e4d2df823067d$var$isPointerInGraceArea(event, area) { if (!area) return false; const cursorPos = { x: event.clientX, y: event.clientY }; return $213e4d2df823067d$var$isPointInPolygon(cursorPos, area); } function $213e4d2df823067d$var$whenMouse(handler) { return event => event.pointerType === 'mouse' ? handler(event) : undefined; } const $213e4d2df823067d$export$be92b6f5f03c0fe9 = $213e4d2df823067d$export$d9b273488cd8ce6f; const $213e4d2df823067d$export$b688253958b8dfe7 = $213e4d2df823067d$export$9fa5ebd18bee4d43; const $213e4d2df823067d$export$602eac185826482c = $213e4d2df823067d$export$793392f970497feb; const $213e4d2df823067d$export$7c6e2c02157bb7d2 = $213e4d2df823067d$export$479f0f2f71193efe; const $213e4d2df823067d$export$eb2fcfdbd7ba97d4 = $213e4d2df823067d$export$22a631d1f72787bb; const $213e4d2df823067d$export$b04be29aa201d4f5 = $213e4d2df823067d$export$dd37bec0e8a99143; const $213e4d2df823067d$export$6d08773d2e66f8f2 = $213e4d2df823067d$export$2ce376c2cc3355c8; const $213e4d2df823067d$export$16ce288f89fa631c = $213e4d2df823067d$export$f6f243521332502d; const $213e4d2df823067d$export$a98f0dcb43a68a25 = $213e4d2df823067d$export$ea2200c9eee416b3; const $213e4d2df823067d$export$371ab307eab489c0 = $213e4d2df823067d$export$69bd225e9817f6d0; const $213e4d2df823067d$export$c3468e2714d175fa = $213e4d2df823067d$export$a2593e23056970a3; const $213e4d2df823067d$export$1ff3c3f08ae963c0 = $213e4d2df823067d$export$1cec7dcdd713e220; const $213e4d2df823067d$export$21b07c8f274aebd5 = $213e4d2df823067d$export$bcdda4773debf5fa; const $213e4d2df823067d$export$d7a01e11500dfb6f = $213e4d2df823067d$export$71bdb9d1e2909932; const $213e4d2df823067d$export$2ea8a7a591ac5eac = $213e4d2df823067d$export$5fbbb3ba7297405f; const $213e4d2df823067d$export$6d4de93b380beddf = $213e4d2df823067d$export$e7142ab31822bde6; /***/ }), /***/ "../../../node_modules/@radix-ui/react-popper/dist/index.js": /*!******************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-popper/dist/index.js ***! \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $50Iv9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $50Iv9$react = __webpack_require__(/*! react */ "react"); var $50Iv9$floatinguireactdom = __webpack_require__(/*! @floating-ui/react-dom */ "../../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js"); var $50Iv9$radixuireactarrow = __webpack_require__(/*! @radix-ui/react-arrow */ "../../../node_modules/@radix-ui/react-arrow/dist/index.js"); var $50Iv9$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $50Iv9$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $50Iv9$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $50Iv9$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); var $50Iv9$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); var $50Iv9$radixuireactusesize = __webpack_require__(/*! @radix-ui/react-use-size */ "../../../node_modules/@radix-ui/react-use-size/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createPopperScope", () => $34310caa050a8d63$export$722aac194ae923); $parcel$export(module.exports, "Popper", () => $34310caa050a8d63$export$badac9ada3a0bdf9); $parcel$export(module.exports, "PopperAnchor", () => $34310caa050a8d63$export$ecd4e1ccab6ed6d); $parcel$export(module.exports, "PopperContent", () => $34310caa050a8d63$export$bc4ae5855d3c4fc); $parcel$export(module.exports, "PopperArrow", () => $34310caa050a8d63$export$79d62cd4e10a3fd0); $parcel$export(module.exports, "Root", () => $34310caa050a8d63$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Anchor", () => $34310caa050a8d63$export$b688253958b8dfe7); $parcel$export(module.exports, "Content", () => $34310caa050a8d63$export$7c6e2c02157bb7d2); $parcel$export(module.exports, "Arrow", () => $34310caa050a8d63$export$21b07c8f274aebd5); $parcel$export(module.exports, "SIDE_OPTIONS", () => $34310caa050a8d63$export$36f0086da09c4b9f); $parcel$export(module.exports, "ALIGN_OPTIONS", () => $34310caa050a8d63$export$3671ffab7b302fc9); const $34310caa050a8d63$export$36f0086da09c4b9f = ['top', 'right', 'bottom', 'left']; const $34310caa050a8d63$export$3671ffab7b302fc9 = ['start', 'center', 'end']; /* ------------------------------------------------------------------------------------------------- * Popper * -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$POPPER_NAME = 'Popper'; const [$34310caa050a8d63$var$createPopperContext, $34310caa050a8d63$export$722aac194ae923] = $50Iv9$radixuireactcontext.createContextScope($34310caa050a8d63$var$POPPER_NAME); const [$34310caa050a8d63$var$PopperProvider, $34310caa050a8d63$var$usePopperContext] = $34310caa050a8d63$var$createPopperContext($34310caa050a8d63$var$POPPER_NAME); const $34310caa050a8d63$export$badac9ada3a0bdf9 = props => { const { __scopePopper: __scopePopper, children: children } = props; const [anchor, setAnchor] = $50Iv9$react.useState(null); return /*#__PURE__*/$50Iv9$react.createElement($34310caa050a8d63$var$PopperProvider, { scope: __scopePopper, anchor: anchor, onAnchorChange: setAnchor }, children); }; /*#__PURE__*/ Object.assign($34310caa050a8d63$export$badac9ada3a0bdf9, { displayName: $34310caa050a8d63$var$POPPER_NAME }); /* ------------------------------------------------------------------------------------------------- * PopperAnchor * -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$ANCHOR_NAME = 'PopperAnchor'; const $34310caa050a8d63$export$ecd4e1ccab6ed6d = /*#__PURE__*/$50Iv9$react.forwardRef((props, forwardedRef) => { const { __scopePopper: __scopePopper, virtualRef: virtualRef, ...anchorProps } = props; const context = $34310caa050a8d63$var$usePopperContext($34310caa050a8d63$var$ANCHOR_NAME, __scopePopper); const ref = $50Iv9$react.useRef(null); const composedRefs = $50Iv9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); $50Iv9$react.useEffect(() => { // Consumer can anchor the popper to something that isn't // a DOM node e.g. pointer position, so we override the // `anchorRef` with their virtual ref in this case. context.onAnchorChange((virtualRef === null || virtualRef === void 0 ? void 0 : virtualRef.current) || ref.current); }); return virtualRef ? null : /*#__PURE__*/$50Iv9$react.createElement($50Iv9$radixuireactprimitive.Primitive.div, $parcel$interopDefault($50Iv9$babelruntimehelpersextends)({}, anchorProps, { ref: composedRefs })); }); /*#__PURE__*/ Object.assign($34310caa050a8d63$export$ecd4e1ccab6ed6d, { displayName: $34310caa050a8d63$var$ANCHOR_NAME }); /* ------------------------------------------------------------------------------------------------- * PopperContent * -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$CONTENT_NAME = 'PopperContent'; const [$34310caa050a8d63$var$PopperContentProvider, $34310caa050a8d63$var$useContentContext] = $34310caa050a8d63$var$createPopperContext($34310caa050a8d63$var$CONTENT_NAME); const $34310caa050a8d63$export$bc4ae5855d3c4fc = /*#__PURE__*/$50Iv9$react.forwardRef((props, forwardedRef) => { var _arrowSize$width, _arrowSize$height, _middlewareData$arrow, _middlewareData$arrow2, _middlewareData$arrow3, _middlewareData$trans, _middlewareData$trans2, _middlewareData$hide; const { __scopePopper: __scopePopper, side = 'bottom', sideOffset = 0, align = 'center', alignOffset = 0, arrowPadding = 0, collisionBoundary = [], collisionPadding: collisionPaddingProp = 0, sticky = 'partial', hideWhenDetached = false, avoidCollisions = true, onPlaced: onPlaced, ...contentProps } = props; const context = $34310caa050a8d63$var$usePopperContext($34310caa050a8d63$var$CONTENT_NAME, __scopePopper); const [content, setContent] = $50Iv9$react.useState(null); const composedRefs = $50Iv9$radixuireactcomposerefs.useComposedRefs(forwardedRef, node => setContent(node)); const [arrow, setArrow] = $50Iv9$react.useState(null); const arrowSize = $50Iv9$radixuireactusesize.useSize(arrow); const arrowWidth = (_arrowSize$width = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.width) !== null && _arrowSize$width !== void 0 ? _arrowSize$width : 0; const arrowHeight = (_arrowSize$height = arrowSize === null || arrowSize === void 0 ? void 0 : arrowSize.height) !== null && _arrowSize$height !== void 0 ? _arrowSize$height : 0; const desiredPlacement = side + (align !== 'center' ? '-' + align : ''); const collisionPadding = typeof collisionPaddingProp === 'number' ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp }; const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary]; const hasExplicitBoundaries = boundary.length > 0; const detectOverflowOptions = { padding: collisionPadding, boundary: boundary.filter($34310caa050a8d63$var$isNotNull), // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries altBoundary: hasExplicitBoundaries }; const { refs: refs, floatingStyles: floatingStyles, placement: placement, isPositioned: isPositioned, middlewareData: middlewareData } = $50Iv9$floatinguireactdom.useFloating({ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues strategy: 'fixed', placement: desiredPlacement, whileElementsMounted: $50Iv9$floatinguireactdom.autoUpdate, elements: { reference: context.anchor }, middleware: [$50Iv9$floatinguireactdom.offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }), avoidCollisions && $50Iv9$floatinguireactdom.shift({ mainAxis: true, crossAxis: false, limiter: sticky === 'partial' ? $50Iv9$floatinguireactdom.limitShift() : undefined, ...detectOverflowOptions }), avoidCollisions && $50Iv9$floatinguireactdom.flip({ ...detectOverflowOptions }), $50Iv9$floatinguireactdom.size({ ...detectOverflowOptions, apply: _ref => { let { elements: elements, rects: rects, availableWidth: availableWidth, availableHeight: availableHeight } = _ref; const { width: anchorWidth, height: anchorHeight } = rects.reference; const contentStyle = elements.floating.style; contentStyle.setProperty('--radix-popper-available-width', `${availableWidth}px`); contentStyle.setProperty('--radix-popper-available-height', `${availableHeight}px`); contentStyle.setProperty('--radix-popper-anchor-width', `${anchorWidth}px`); contentStyle.setProperty('--radix-popper-anchor-height', `${anchorHeight}px`); } }), arrow && $50Iv9$floatinguireactdom.arrow({ element: arrow, padding: arrowPadding }), $34310caa050a8d63$var$transformOrigin({ arrowWidth: arrowWidth, arrowHeight: arrowHeight }), hideWhenDetached && $50Iv9$floatinguireactdom.hide({ strategy: 'referenceHidden' })] }); const [placedSide, placedAlign] = $34310caa050a8d63$var$getSideAndAlignFromPlacement(placement); const handlePlaced = $50Iv9$radixuireactusecallbackref.useCallbackRef(onPlaced); $50Iv9$radixuireactuselayouteffect.useLayoutEffect(() => { if (isPositioned) handlePlaced === null || handlePlaced === void 0 || handlePlaced(); }, [isPositioned, handlePlaced]); const arrowX = (_middlewareData$arrow = middlewareData.arrow) === null || _middlewareData$arrow === void 0 ? void 0 : _middlewareData$arrow.x; const arrowY = (_middlewareData$arrow2 = middlewareData.arrow) === null || _middlewareData$arrow2 === void 0 ? void 0 : _middlewareData$arrow2.y; const cannotCenterArrow = ((_middlewareData$arrow3 = middlewareData.arrow) === null || _middlewareData$arrow3 === void 0 ? void 0 : _middlewareData$arrow3.centerOffset) !== 0; const [contentZIndex, setContentZIndex] = $50Iv9$react.useState(); $50Iv9$radixuireactuselayouteffect.useLayoutEffect(() => { if (content) setContentZIndex(window.getComputedStyle(content).zIndex); }, [content]); return /*#__PURE__*/$50Iv9$react.createElement("div", { ref: refs.setFloating, "data-radix-popper-content-wrapper": "", style: { ...floatingStyles, transform: isPositioned ? floatingStyles.transform : 'translate(0, -200%)', // keep off the page when measuring minWidth: 'max-content', zIndex: contentZIndex, ['--radix-popper-transform-origin']: [(_middlewareData$trans = middlewareData.transformOrigin) === null || _middlewareData$trans === void 0 ? void 0 : _middlewareData$trans.x, (_middlewareData$trans2 = middlewareData.transformOrigin) === null || _middlewareData$trans2 === void 0 ? void 0 : _middlewareData$trans2.y].join(' ') } // Floating UI interally calculates logical alignment based the `dir` attribute on , dir: props.dir }, /*#__PURE__*/$50Iv9$react.createElement($34310caa050a8d63$var$PopperContentProvider, { scope: __scopePopper, placedSide: placedSide, onArrowChange: setArrow, arrowX: arrowX, arrowY: arrowY, shouldHideArrow: cannotCenterArrow }, /*#__PURE__*/$50Iv9$react.createElement($50Iv9$radixuireactprimitive.Primitive.div, $parcel$interopDefault($50Iv9$babelruntimehelpersextends)({ "data-side": placedSide, "data-align": placedAlign }, contentProps, { ref: composedRefs, style: { ...contentProps.style, // if the PopperContent hasn't been placed yet (not all measurements done) // we prevent animations so that users's animation don't kick in too early referring wrong sides animation: !isPositioned ? 'none' : undefined, // hide the content if using the hide middleware and should be hidden opacity: (_middlewareData$hide = middlewareData.hide) !== null && _middlewareData$hide !== void 0 && _middlewareData$hide.referenceHidden ? 0 : undefined } })))); }); /*#__PURE__*/ Object.assign($34310caa050a8d63$export$bc4ae5855d3c4fc, { displayName: $34310caa050a8d63$var$CONTENT_NAME }); /* ------------------------------------------------------------------------------------------------- * PopperArrow * -----------------------------------------------------------------------------------------------*/ const $34310caa050a8d63$var$ARROW_NAME = 'PopperArrow'; const $34310caa050a8d63$var$OPPOSITE_SIDE = { top: 'bottom', right: 'left', bottom: 'top', left: 'right' }; const $34310caa050a8d63$export$79d62cd4e10a3fd0 = /*#__PURE__*/$50Iv9$react.forwardRef(function $34310caa050a8d63$export$79d62cd4e10a3fd0(props, forwardedRef) { const { __scopePopper: __scopePopper, ...arrowProps } = props; const contentContext = $34310caa050a8d63$var$useContentContext($34310caa050a8d63$var$ARROW_NAME, __scopePopper); const baseSide = $34310caa050a8d63$var$OPPOSITE_SIDE[contentContext.placedSide]; return /*#__PURE__*/ (// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`) // doesn't report size as we'd expect on SVG elements. // it reports their bounding box which is effectively the largest path inside the SVG. $50Iv9$react.createElement("span", { ref: contentContext.onArrowChange, style: { position: 'absolute', left: contentContext.arrowX, top: contentContext.arrowY, [baseSide]: 0, transformOrigin: { top: '', right: '0 0', bottom: 'center 0', left: '100% 0' }[contentContext.placedSide], transform: { top: 'translateY(100%)', right: 'translateY(50%) rotate(90deg) translateX(-50%)', bottom: `rotate(180deg)`, left: 'translateY(50%) rotate(-90deg) translateX(50%)' }[contentContext.placedSide], visibility: contentContext.shouldHideArrow ? 'hidden' : undefined } }, /*#__PURE__*/$50Iv9$react.createElement($50Iv9$radixuireactarrow.Root, $parcel$interopDefault($50Iv9$babelruntimehelpersextends)({}, arrowProps, { ref: forwardedRef, style: { ...arrowProps.style, // ensures the element can be measured correctly (mostly for if SVG) display: 'block' } }))) ); }); /*#__PURE__*/ Object.assign($34310caa050a8d63$export$79d62cd4e10a3fd0, { displayName: $34310caa050a8d63$var$ARROW_NAME }); /* -----------------------------------------------------------------------------------------------*/ function $34310caa050a8d63$var$isNotNull(value) { return value !== null; } const $34310caa050a8d63$var$transformOrigin = options => ({ name: 'transformOrigin', options: options, fn(data) { var _middlewareData$arrow4, _middlewareData$arrow5, _middlewareData$arrow6, _middlewareData$arrow7, _middlewareData$arrow8; const { placement: placement, rects: rects, middlewareData: middlewareData } = data; const cannotCenterArrow = ((_middlewareData$arrow4 = middlewareData.arrow) === null || _middlewareData$arrow4 === void 0 ? void 0 : _middlewareData$arrow4.centerOffset) !== 0; const isArrowHidden = cannotCenterArrow; const arrowWidth = isArrowHidden ? 0 : options.arrowWidth; const arrowHeight = isArrowHidden ? 0 : options.arrowHeight; const [placedSide, placedAlign] = $34310caa050a8d63$var$getSideAndAlignFromPlacement(placement); const noArrowAlign = { start: '0%', center: '50%', end: '100%' }[placedAlign]; const arrowXCenter = ((_middlewareData$arrow5 = (_middlewareData$arrow6 = middlewareData.arrow) === null || _middlewareData$arrow6 === void 0 ? void 0 : _middlewareData$arrow6.x) !== null && _middlewareData$arrow5 !== void 0 ? _middlewareData$arrow5 : 0) + arrowWidth / 2; const arrowYCenter = ((_middlewareData$arrow7 = (_middlewareData$arrow8 = middlewareData.arrow) === null || _middlewareData$arrow8 === void 0 ? void 0 : _middlewareData$arrow8.y) !== null && _middlewareData$arrow7 !== void 0 ? _middlewareData$arrow7 : 0) + arrowHeight / 2; let x = ''; let y = ''; if (placedSide === 'bottom') { x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; y = `${-arrowHeight}px`; } else if (placedSide === 'top') { x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`; y = `${rects.floating.height + arrowHeight}px`; } else if (placedSide === 'right') { x = `${-arrowHeight}px`; y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; } else if (placedSide === 'left') { x = `${rects.floating.width + arrowHeight}px`; y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`; } return { data: { x: x, y: y } }; } }); function $34310caa050a8d63$var$getSideAndAlignFromPlacement(placement) { const [side, align = 'center'] = placement.split('-'); return [side, align]; } const $34310caa050a8d63$export$be92b6f5f03c0fe9 = $34310caa050a8d63$export$badac9ada3a0bdf9; const $34310caa050a8d63$export$b688253958b8dfe7 = $34310caa050a8d63$export$ecd4e1ccab6ed6d; const $34310caa050a8d63$export$7c6e2c02157bb7d2 = $34310caa050a8d63$export$bc4ae5855d3c4fc; const $34310caa050a8d63$export$21b07c8f274aebd5 = $34310caa050a8d63$export$79d62cd4e10a3fd0; /***/ }), /***/ "../../../node_modules/@radix-ui/react-portal/dist/index.js": /*!******************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-portal/dist/index.js ***! \******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $amzHf$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $amzHf$react = __webpack_require__(/*! react */ "react"); var $amzHf$reactdom = __webpack_require__(/*! react-dom */ "react-dom"); var $amzHf$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "Portal", () => $913a70b877676c16$export$602eac185826482c); $parcel$export(module.exports, "Root", () => $913a70b877676c16$export$be92b6f5f03c0fe9); /* ------------------------------------------------------------------------------------------------- * Portal * -----------------------------------------------------------------------------------------------*/ const $913a70b877676c16$var$PORTAL_NAME = 'Portal'; const $913a70b877676c16$export$602eac185826482c = /*#__PURE__*/$amzHf$react.forwardRef((props, forwardedRef) => { var _globalThis$document; const { container = globalThis === null || globalThis === void 0 ? void 0 : (_globalThis$document = globalThis.document) === null || _globalThis$document === void 0 ? void 0 : _globalThis$document.body, ...portalProps } = props; return container ? /*#__PURE__*/$parcel$interopDefault($amzHf$reactdom).createPortal( /*#__PURE__*/$amzHf$react.createElement($amzHf$radixuireactprimitive.Primitive.div, $parcel$interopDefault($amzHf$babelruntimehelpersextends)({}, portalProps, { ref: forwardedRef })), container) : null; }); /*#__PURE__*/ Object.assign($913a70b877676c16$export$602eac185826482c, { displayName: $913a70b877676c16$var$PORTAL_NAME }); /* -----------------------------------------------------------------------------------------------*/ const $913a70b877676c16$export$be92b6f5f03c0fe9 = $913a70b877676c16$export$602eac185826482c; /***/ }), /***/ "../../../node_modules/@radix-ui/react-presence/dist/index.js": /*!********************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-presence/dist/index.js ***! \********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $fnLeV$react = __webpack_require__(/*! react */ "react"); var $fnLeV$reactdom = __webpack_require__(/*! react-dom */ "react-dom"); var $fnLeV$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $fnLeV$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "Presence", () => $a2fa0214bb2735a1$export$99c2b779aa4e8b8b); function $8f63844556d0d3cd$export$3e6543de14f8614f(initialState, machine) { return $fnLeV$react.useReducer((state, event) => { const nextState = machine[state][event]; return nextState !== null && nextState !== void 0 ? nextState : state; }, initialState); } const $a2fa0214bb2735a1$export$99c2b779aa4e8b8b = props => { const { present: present, children: children } = props; const presence = $a2fa0214bb2735a1$var$usePresence(present); const child = typeof children === 'function' ? children({ present: presence.isPresent }) : $fnLeV$react.Children.only(children); const ref = $fnLeV$radixuireactcomposerefs.useComposedRefs(presence.ref, child.ref); const forceMount = typeof children === 'function'; return forceMount || presence.isPresent ? /*#__PURE__*/$fnLeV$react.cloneElement(child, { ref: ref }) : null; }; $a2fa0214bb2735a1$export$99c2b779aa4e8b8b.displayName = 'Presence'; /* ------------------------------------------------------------------------------------------------- * usePresence * -----------------------------------------------------------------------------------------------*/ function $a2fa0214bb2735a1$var$usePresence(present) { const [node1, setNode] = $fnLeV$react.useState(); const stylesRef = $fnLeV$react.useRef({}); const prevPresentRef = $fnLeV$react.useRef(present); const prevAnimationNameRef = $fnLeV$react.useRef('none'); const initialState = present ? 'mounted' : 'unmounted'; const [state, send] = $8f63844556d0d3cd$export$3e6543de14f8614f(initialState, { mounted: { UNMOUNT: 'unmounted', ANIMATION_OUT: 'unmountSuspended' }, unmountSuspended: { MOUNT: 'mounted', ANIMATION_END: 'unmounted' }, unmounted: { MOUNT: 'mounted' } }); $fnLeV$react.useEffect(() => { const currentAnimationName = $a2fa0214bb2735a1$var$getAnimationName(stylesRef.current); prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none'; }, [state]); $fnLeV$radixuireactuselayouteffect.useLayoutEffect(() => { const styles = stylesRef.current; const wasPresent = prevPresentRef.current; const hasPresentChanged = wasPresent !== present; if (hasPresentChanged) { const prevAnimationName = prevAnimationNameRef.current; const currentAnimationName = $a2fa0214bb2735a1$var$getAnimationName(styles); if (present) send('MOUNT');else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run // so we unmount instantly send('UNMOUNT');else { /** * When `present` changes to `false`, we check changes to animation-name to * determine whether an animation has started. We chose this approach (reading * computed styles) because there is no `animationrun` event and `animationstart` * fires after `animation-delay` has expired which would be too late. */ const isAnimating = prevAnimationName !== currentAnimationName; if (wasPresent && isAnimating) send('ANIMATION_OUT');else send('UNMOUNT'); } prevPresentRef.current = present; } }, [present, send]); $fnLeV$radixuireactuselayouteffect.useLayoutEffect(() => { if (node1) { /** * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel` * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we * make sure we only trigger ANIMATION_END for the currently active animation. */ const handleAnimationEnd = event => { const currentAnimationName = $a2fa0214bb2735a1$var$getAnimationName(stylesRef.current); const isCurrentAnimation = currentAnimationName.includes(event.animationName); if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied // a frame after the animation ends, creating a flash of visible content. // By manually flushing we ensure they sync within a frame, removing the flash. $fnLeV$reactdom.flushSync(() => send('ANIMATION_END')); }; const handleAnimationStart = event => { if (event.target === node1) // if animation occurred, store its name as the previous animation. prevAnimationNameRef.current = $a2fa0214bb2735a1$var$getAnimationName(stylesRef.current); }; node1.addEventListener('animationstart', handleAnimationStart); node1.addEventListener('animationcancel', handleAnimationEnd); node1.addEventListener('animationend', handleAnimationEnd); return () => { node1.removeEventListener('animationstart', handleAnimationStart); node1.removeEventListener('animationcancel', handleAnimationEnd); node1.removeEventListener('animationend', handleAnimationEnd); }; } else // Transition to the unmounted state if the node is removed prematurely. // We avoid doing so during cleanup as the node may change but still exist. send('ANIMATION_END'); }, [node1, send]); return { isPresent: ['mounted', 'unmountSuspended'].includes(state), ref: $fnLeV$react.useCallback(node => { if (node) stylesRef.current = getComputedStyle(node); setNode(node); }, []) }; } /* -----------------------------------------------------------------------------------------------*/ function $a2fa0214bb2735a1$var$getAnimationName(styles) { return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none'; } /***/ }), /***/ "../../../node_modules/@radix-ui/react-primitive/dist/index.js": /*!*********************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-primitive/dist/index.js ***! \*********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $iMixA$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $iMixA$react = __webpack_require__(/*! react */ "react"); var $iMixA$reactdom = __webpack_require__(/*! react-dom */ "react-dom"); var $iMixA$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "Primitive", () => $c3def6332c2749a6$export$250ffa63cdc0d034); $parcel$export(module.exports, "Root", () => $c3def6332c2749a6$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "dispatchDiscreteCustomEvent", () => $c3def6332c2749a6$export$6d1a0317bde7de7f); const $c3def6332c2749a6$var$NODES = ['a', 'button', 'div', 'form', 'h2', 'h3', 'img', 'input', 'label', 'li', 'nav', 'ol', 'p', 'span', 'svg', 'ul']; // Temporary while we await merge of this fix: // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396 // prettier-ignore /* ------------------------------------------------------------------------------------------------- * Primitive * -----------------------------------------------------------------------------------------------*/ const $c3def6332c2749a6$export$250ffa63cdc0d034 = $c3def6332c2749a6$var$NODES.reduce((primitive, node) => { const Node = /*#__PURE__*/$iMixA$react.forwardRef((props, forwardedRef) => { const { asChild: asChild, ...primitiveProps } = props; const Comp = asChild ? $iMixA$radixuireactslot.Slot : node; $iMixA$react.useEffect(() => { window[Symbol.for('radix-ui')] = true; }, []); return /*#__PURE__*/$iMixA$react.createElement(Comp, $parcel$interopDefault($iMixA$babelruntimehelpersextends)({}, primitiveProps, { ref: forwardedRef })); }); Node.displayName = `Primitive.${node}`; return { ...primitive, [node]: Node }; }, {}); /* ------------------------------------------------------------------------------------------------- * Utils * -----------------------------------------------------------------------------------------------*/ /** * Flush custom event dispatch * https://github.com/radix-ui/primitives/pull/1378 * * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types. * * Internally, React prioritises events in the following order: * - discrete * - continuous * - default * * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350 * * `discrete` is an important distinction as updates within these events are applied immediately. * React however, is not able to infer the priority of custom event types due to how they are detected internally. * Because of this, it's possible for updates from custom events to be unexpectedly batched when * dispatched by another `discrete` event. * * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch. * This utility should be used when dispatching a custom event from within another `discrete` event, this utility * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event. * For example: * * dispatching a known click 👎 * target.dispatchEvent(new Event(‘click’)) * * dispatching a custom type within a non-discrete event 👎 * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))} * * dispatching a custom type within a `discrete` event 👍 * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))} * * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use * this utility with them. This is because it's possible for those handlers to be called implicitly during render * e.g. when focus is within a component as it is unmounted, or when managing focus on mount. */ function $c3def6332c2749a6$export$6d1a0317bde7de7f(target, event) { if (target) $iMixA$reactdom.flushSync(() => target.dispatchEvent(event)); } /* -----------------------------------------------------------------------------------------------*/ const $c3def6332c2749a6$export$be92b6f5f03c0fe9 = $c3def6332c2749a6$export$250ffa63cdc0d034; /***/ }), /***/ "../../../node_modules/@radix-ui/react-roving-focus/dist/index.js": /*!************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-roving-focus/dist/index.js ***! \************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $9QJ9Y$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $9QJ9Y$react = __webpack_require__(/*! react */ "react"); var $9QJ9Y$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); var $9QJ9Y$radixuireactcollection = __webpack_require__(/*! @radix-ui/react-collection */ "../../../node_modules/@radix-ui/react-collection/dist/index.js"); var $9QJ9Y$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $9QJ9Y$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $9QJ9Y$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); var $9QJ9Y$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $9QJ9Y$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); var $9QJ9Y$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); var $9QJ9Y$radixuireactdirection = __webpack_require__(/*! @radix-ui/react-direction */ "../../../node_modules/@radix-ui/react-direction/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createRovingFocusGroupScope", () => $0063afae63b3fa70$export$c7109489551a4f4); $parcel$export(module.exports, "RovingFocusGroup", () => $0063afae63b3fa70$export$8699f7c8af148338); $parcel$export(module.exports, "RovingFocusGroupItem", () => $0063afae63b3fa70$export$ab9df7c53fe8454); $parcel$export(module.exports, "Root", () => $0063afae63b3fa70$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Item", () => $0063afae63b3fa70$export$6d08773d2e66f8f2); const $0063afae63b3fa70$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus'; const $0063afae63b3fa70$var$EVENT_OPTIONS = { bubbles: false, cancelable: true }; /* ------------------------------------------------------------------------------------------------- * RovingFocusGroup * -----------------------------------------------------------------------------------------------*/ const $0063afae63b3fa70$var$GROUP_NAME = 'RovingFocusGroup'; const [$0063afae63b3fa70$var$Collection, $0063afae63b3fa70$var$useCollection, $0063afae63b3fa70$var$createCollectionScope] = $9QJ9Y$radixuireactcollection.createCollection($0063afae63b3fa70$var$GROUP_NAME); const [$0063afae63b3fa70$var$createRovingFocusGroupContext, $0063afae63b3fa70$export$c7109489551a4f4] = $9QJ9Y$radixuireactcontext.createContextScope($0063afae63b3fa70$var$GROUP_NAME, [$0063afae63b3fa70$var$createCollectionScope]); const [$0063afae63b3fa70$var$RovingFocusProvider, $0063afae63b3fa70$var$useRovingFocusContext] = $0063afae63b3fa70$var$createRovingFocusGroupContext($0063afae63b3fa70$var$GROUP_NAME); const $0063afae63b3fa70$export$8699f7c8af148338 = /*#__PURE__*/$9QJ9Y$react.forwardRef((props, forwardedRef) => { return /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$Collection.Provider, { scope: props.__scopeRovingFocusGroup }, /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$Collection.Slot, { scope: props.__scopeRovingFocusGroup }, /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$RovingFocusGroupImpl, $parcel$interopDefault($9QJ9Y$babelruntimehelpersextends)({}, props, { ref: forwardedRef })))); }); /*#__PURE__*/ Object.assign($0063afae63b3fa70$export$8699f7c8af148338, { displayName: $0063afae63b3fa70$var$GROUP_NAME }); /* -----------------------------------------------------------------------------------------------*/ const $0063afae63b3fa70$var$RovingFocusGroupImpl = /*#__PURE__*/$9QJ9Y$react.forwardRef((props, forwardedRef) => { const { __scopeRovingFocusGroup: __scopeRovingFocusGroup, orientation: orientation, loop = false, dir: dir, currentTabStopId: currentTabStopIdProp, defaultCurrentTabStopId: defaultCurrentTabStopId, onCurrentTabStopIdChange: onCurrentTabStopIdChange, onEntryFocus: onEntryFocus, ...groupProps } = props; const ref = $9QJ9Y$react.useRef(null); const composedRefs = $9QJ9Y$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); const direction = $9QJ9Y$radixuireactdirection.useDirection(dir); const [currentTabStopId = null, setCurrentTabStopId] = $9QJ9Y$radixuireactusecontrollablestate.useControllableState({ prop: currentTabStopIdProp, defaultProp: defaultCurrentTabStopId, onChange: onCurrentTabStopIdChange }); const [isTabbingBackOut, setIsTabbingBackOut] = $9QJ9Y$react.useState(false); const handleEntryFocus = $9QJ9Y$radixuireactusecallbackref.useCallbackRef(onEntryFocus); const getItems = $0063afae63b3fa70$var$useCollection(__scopeRovingFocusGroup); const isClickFocusRef = $9QJ9Y$react.useRef(false); const [focusableItemsCount, setFocusableItemsCount] = $9QJ9Y$react.useState(0); $9QJ9Y$react.useEffect(() => { const node = ref.current; if (node) { node.addEventListener($0063afae63b3fa70$var$ENTRY_FOCUS, handleEntryFocus); return () => node.removeEventListener($0063afae63b3fa70$var$ENTRY_FOCUS, handleEntryFocus); } }, [handleEntryFocus]); return /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$RovingFocusProvider, { scope: __scopeRovingFocusGroup, orientation: orientation, dir: direction, loop: loop, currentTabStopId: currentTabStopId, onItemFocus: $9QJ9Y$react.useCallback(tabStopId => setCurrentTabStopId(tabStopId), [setCurrentTabStopId]), onItemShiftTab: $9QJ9Y$react.useCallback(() => setIsTabbingBackOut(true), []), onFocusableItemAdd: $9QJ9Y$react.useCallback(() => setFocusableItemsCount(prevCount => prevCount + 1), []), onFocusableItemRemove: $9QJ9Y$react.useCallback(() => setFocusableItemsCount(prevCount => prevCount - 1), []) }, /*#__PURE__*/$9QJ9Y$react.createElement($9QJ9Y$radixuireactprimitive.Primitive.div, $parcel$interopDefault($9QJ9Y$babelruntimehelpersextends)({ tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0, "data-orientation": orientation }, groupProps, { ref: composedRefs, style: { outline: 'none', ...props.style }, onMouseDown: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onMouseDown, () => { isClickFocusRef.current = true; }), onFocus: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onFocus, event => { // We normally wouldn't need this check, because we already check // that the focus is on the current target and not bubbling to it. // We do this because Safari doesn't focus buttons when clicked, and // instead, the wrapper will get focused and not through a bubbling event. const isKeyboardFocus = !isClickFocusRef.current; if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) { const entryFocusEvent = new CustomEvent($0063afae63b3fa70$var$ENTRY_FOCUS, $0063afae63b3fa70$var$EVENT_OPTIONS); event.currentTarget.dispatchEvent(entryFocusEvent); if (!entryFocusEvent.defaultPrevented) { const items = getItems().filter(item => item.focusable); const activeItem = items.find(item => item.active); const currentItem = items.find(item => item.id === currentTabStopId); const candidateItems = [activeItem, currentItem, ...items].filter(Boolean); const candidateNodes = candidateItems.map(item => item.ref.current); $0063afae63b3fa70$var$focusFirst(candidateNodes); } } isClickFocusRef.current = false; }), onBlur: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false)) }))); }); /* ------------------------------------------------------------------------------------------------- * RovingFocusGroupItem * -----------------------------------------------------------------------------------------------*/ const $0063afae63b3fa70$var$ITEM_NAME = 'RovingFocusGroupItem'; const $0063afae63b3fa70$export$ab9df7c53fe8454 = /*#__PURE__*/$9QJ9Y$react.forwardRef((props, forwardedRef) => { const { __scopeRovingFocusGroup: __scopeRovingFocusGroup, focusable = true, active = false, tabStopId: tabStopId, ...itemProps } = props; const autoId = $9QJ9Y$radixuireactid.useId(); const id = tabStopId || autoId; const context = $0063afae63b3fa70$var$useRovingFocusContext($0063afae63b3fa70$var$ITEM_NAME, __scopeRovingFocusGroup); const isCurrentTabStop = context.currentTabStopId === id; const getItems = $0063afae63b3fa70$var$useCollection(__scopeRovingFocusGroup); const { onFocusableItemAdd: onFocusableItemAdd, onFocusableItemRemove: onFocusableItemRemove } = context; $9QJ9Y$react.useEffect(() => { if (focusable) { onFocusableItemAdd(); return () => onFocusableItemRemove(); } }, [focusable, onFocusableItemAdd, onFocusableItemRemove]); return /*#__PURE__*/$9QJ9Y$react.createElement($0063afae63b3fa70$var$Collection.ItemSlot, { scope: __scopeRovingFocusGroup, id: id, focusable: focusable, active: active }, /*#__PURE__*/$9QJ9Y$react.createElement($9QJ9Y$radixuireactprimitive.Primitive.span, $parcel$interopDefault($9QJ9Y$babelruntimehelpersextends)({ tabIndex: isCurrentTabStop ? 0 : -1, "data-orientation": context.orientation }, itemProps, { ref: forwardedRef, onMouseDown: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onMouseDown, event => { // We prevent focusing non-focusable items on `mousedown`. // Even though the item has tabIndex={-1}, that only means take it out of the tab order. if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also else context.onItemFocus(id); }), onFocus: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onFocus, () => context.onItemFocus(id)), onKeyDown: $9QJ9Y$radixuiprimitive.composeEventHandlers(props.onKeyDown, event => { if (event.key === 'Tab' && event.shiftKey) { context.onItemShiftTab(); return; } if (event.target !== event.currentTarget) return; const focusIntent = $0063afae63b3fa70$var$getFocusIntent(event, context.orientation, context.dir); if (focusIntent !== undefined) { event.preventDefault(); const items = getItems().filter(item => item.focusable); let candidateNodes = items.map(item => item.ref.current); if (focusIntent === 'last') candidateNodes.reverse();else if (focusIntent === 'prev' || focusIntent === 'next') { if (focusIntent === 'prev') candidateNodes.reverse(); const currentIndex = candidateNodes.indexOf(event.currentTarget); candidateNodes = context.loop ? $0063afae63b3fa70$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1); } /** * Imperative focus during keydown is risky so we prevent React's batching updates * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332 */ setTimeout(() => $0063afae63b3fa70$var$focusFirst(candidateNodes)); } }) }))); }); /*#__PURE__*/ Object.assign($0063afae63b3fa70$export$ab9df7c53fe8454, { displayName: $0063afae63b3fa70$var$ITEM_NAME }); /* -----------------------------------------------------------------------------------------------*/ // prettier-ignore const $0063afae63b3fa70$var$MAP_KEY_TO_FOCUS_INTENT = { ArrowLeft: 'prev', ArrowUp: 'prev', ArrowRight: 'next', ArrowDown: 'next', PageUp: 'first', Home: 'first', PageDown: 'last', End: 'last' }; function $0063afae63b3fa70$var$getDirectionAwareKey(key, dir) { if (dir !== 'rtl') return key; return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key; } function $0063afae63b3fa70$var$getFocusIntent(event, orientation, dir) { const key = $0063afae63b3fa70$var$getDirectionAwareKey(event.key, dir); if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined; if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined; return $0063afae63b3fa70$var$MAP_KEY_TO_FOCUS_INTENT[key]; } function $0063afae63b3fa70$var$focusFirst(candidates) { const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement; for (const candidate of candidates) { // if focus is already where we want to go, we don't want to keep going through the candidates if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return; candidate.focus(); if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return; } } /** * Wraps an array around itself at a given start index * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']` */ function $0063afae63b3fa70$var$wrapArray(array, startIndex) { return array.map((_, index) => array[(startIndex + index) % array.length]); } const $0063afae63b3fa70$export$be92b6f5f03c0fe9 = $0063afae63b3fa70$export$8699f7c8af148338; const $0063afae63b3fa70$export$6d08773d2e66f8f2 = $0063afae63b3fa70$export$ab9df7c53fe8454; /***/ }), /***/ "../../../node_modules/@radix-ui/react-slot/dist/index.js": /*!****************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-slot/dist/index.js ***! \****************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $dAvBt$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $dAvBt$react = __webpack_require__(/*! react */ "react"); var $dAvBt$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "Slot", () => $82dc8d030dec7549$export$8c6ed5c666ac1360); $parcel$export(module.exports, "Slottable", () => $82dc8d030dec7549$export$d9f1ccf0bdb05d45); $parcel$export(module.exports, "Root", () => $82dc8d030dec7549$export$be92b6f5f03c0fe9); /* ------------------------------------------------------------------------------------------------- * Slot * -----------------------------------------------------------------------------------------------*/ const $82dc8d030dec7549$export$8c6ed5c666ac1360 = /*#__PURE__*/$dAvBt$react.forwardRef((props, forwardedRef) => { const { children: children, ...slotProps } = props; const childrenArray = $dAvBt$react.Children.toArray(children); const slottable = childrenArray.find($82dc8d030dec7549$var$isSlottable); if (slottable) { // the new element to render is the one passed as a child of `Slottable` const newElement = slottable.props.children; const newChildren = childrenArray.map(child => { if (child === slottable) { // because the new element will be the one rendered, we are only interested // in grabbing its children (`newElement.props.children`) if ($dAvBt$react.Children.count(newElement) > 1) return $dAvBt$react.Children.only(null); return /*#__PURE__*/$dAvBt$react.isValidElement(newElement) ? newElement.props.children : null; } else return child; }); return /*#__PURE__*/$dAvBt$react.createElement($82dc8d030dec7549$var$SlotClone, $parcel$interopDefault($dAvBt$babelruntimehelpersextends)({}, slotProps, { ref: forwardedRef }), /*#__PURE__*/$dAvBt$react.isValidElement(newElement) ? /*#__PURE__*/$dAvBt$react.cloneElement(newElement, undefined, newChildren) : null); } return /*#__PURE__*/$dAvBt$react.createElement($82dc8d030dec7549$var$SlotClone, $parcel$interopDefault($dAvBt$babelruntimehelpersextends)({}, slotProps, { ref: forwardedRef }), children); }); $82dc8d030dec7549$export$8c6ed5c666ac1360.displayName = 'Slot'; /* ------------------------------------------------------------------------------------------------- * SlotClone * -----------------------------------------------------------------------------------------------*/ const $82dc8d030dec7549$var$SlotClone = /*#__PURE__*/$dAvBt$react.forwardRef((props, forwardedRef) => { const { children: children, ...slotProps } = props; if ( /*#__PURE__*/$dAvBt$react.isValidElement(children)) return /*#__PURE__*/$dAvBt$react.cloneElement(children, { ...$82dc8d030dec7549$var$mergeProps(slotProps, children.props), ref: forwardedRef ? $dAvBt$radixuireactcomposerefs.composeRefs(forwardedRef, children.ref) : children.ref }); return $dAvBt$react.Children.count(children) > 1 ? $dAvBt$react.Children.only(null) : null; }); $82dc8d030dec7549$var$SlotClone.displayName = 'SlotClone'; /* ------------------------------------------------------------------------------------------------- * Slottable * -----------------------------------------------------------------------------------------------*/ const $82dc8d030dec7549$export$d9f1ccf0bdb05d45 = _ref => { let { children: children } = _ref; return /*#__PURE__*/$dAvBt$react.createElement($dAvBt$react.Fragment, null, children); }; /* ---------------------------------------------------------------------------------------------- */ function $82dc8d030dec7549$var$isSlottable(child) { return /*#__PURE__*/$dAvBt$react.isValidElement(child) && child.type === $82dc8d030dec7549$export$d9f1ccf0bdb05d45; } function $82dc8d030dec7549$var$mergeProps(slotProps, childProps) { // all child props should override const overrideProps = { ...childProps }; for (const propName in childProps) { const slotPropValue = slotProps[propName]; const childPropValue = childProps[propName]; const isHandler = /^on[A-Z]/.test(propName); if (isHandler) { // if the handler exists on both, we compose them if (slotPropValue && childPropValue) overrideProps[propName] = function () { childPropValue(...arguments); slotPropValue(...arguments); };else if (slotPropValue) overrideProps[propName] = slotPropValue; } else if (propName === 'style') overrideProps[propName] = { ...slotPropValue, ...childPropValue };else if (propName === 'className') overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(' '); } return { ...slotProps, ...overrideProps }; } const $82dc8d030dec7549$export$be92b6f5f03c0fe9 = $82dc8d030dec7549$export$8c6ed5c666ac1360; /***/ }), /***/ "../../../node_modules/@radix-ui/react-tooltip/dist/index.js": /*!*******************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-tooltip/dist/index.js ***! \*******************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $iVrL9$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $iVrL9$react = __webpack_require__(/*! react */ "react"); var $iVrL9$radixuiprimitive = __webpack_require__(/*! @radix-ui/primitive */ "../../../node_modules/@radix-ui/primitive/dist/index.js"); var $iVrL9$radixuireactcomposerefs = __webpack_require__(/*! @radix-ui/react-compose-refs */ "../../../node_modules/@radix-ui/react-compose-refs/dist/index.js"); var $iVrL9$radixuireactcontext = __webpack_require__(/*! @radix-ui/react-context */ "../../../node_modules/@radix-ui/react-context/dist/index.js"); var $iVrL9$radixuireactdismissablelayer = __webpack_require__(/*! @radix-ui/react-dismissable-layer */ "../../../node_modules/@radix-ui/react-dismissable-layer/dist/index.js"); var $iVrL9$radixuireactid = __webpack_require__(/*! @radix-ui/react-id */ "../../../node_modules/@radix-ui/react-id/dist/index.js"); var $iVrL9$radixuireactpopper = __webpack_require__(/*! @radix-ui/react-popper */ "../../../node_modules/@radix-ui/react-popper/dist/index.js"); var $iVrL9$radixuireactportal = __webpack_require__(/*! @radix-ui/react-portal */ "../../../node_modules/@radix-ui/react-portal/dist/index.js"); var $iVrL9$radixuireactpresence = __webpack_require__(/*! @radix-ui/react-presence */ "../../../node_modules/@radix-ui/react-presence/dist/index.js"); var $iVrL9$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); var $iVrL9$radixuireactslot = __webpack_require__(/*! @radix-ui/react-slot */ "../../../node_modules/@radix-ui/react-slot/dist/index.js"); var $iVrL9$radixuireactusecontrollablestate = __webpack_require__(/*! @radix-ui/react-use-controllable-state */ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js"); var $iVrL9$radixuireactvisuallyhidden = __webpack_require__(/*! @radix-ui/react-visually-hidden */ "../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "createTooltipScope", () => $c34afbc43c90cc6f$export$1c540a2224f0d865); $parcel$export(module.exports, "TooltipProvider", () => $c34afbc43c90cc6f$export$f78649fb9ca566b8); $parcel$export(module.exports, "Tooltip", () => $c34afbc43c90cc6f$export$28c660c63b792dea); $parcel$export(module.exports, "TooltipTrigger", () => $c34afbc43c90cc6f$export$8c610744efcf8a1d); $parcel$export(module.exports, "TooltipPortal", () => $c34afbc43c90cc6f$export$7b36b8f925ab7497); $parcel$export(module.exports, "TooltipContent", () => $c34afbc43c90cc6f$export$e9003e2be37ec060); $parcel$export(module.exports, "TooltipArrow", () => $c34afbc43c90cc6f$export$c27ee0ad710f7559); $parcel$export(module.exports, "Provider", () => $c34afbc43c90cc6f$export$2881499e37b75b9a); $parcel$export(module.exports, "Root", () => $c34afbc43c90cc6f$export$be92b6f5f03c0fe9); $parcel$export(module.exports, "Trigger", () => $c34afbc43c90cc6f$export$41fb9f06171c75f4); $parcel$export(module.exports, "Portal", () => $c34afbc43c90cc6f$export$602eac185826482c); $parcel$export(module.exports, "Content", () => $c34afbc43c90cc6f$export$7c6e2c02157bb7d2); $parcel$export(module.exports, "Arrow", () => $c34afbc43c90cc6f$export$21b07c8f274aebd5); const [$c34afbc43c90cc6f$var$createTooltipContext, $c34afbc43c90cc6f$export$1c540a2224f0d865] = $iVrL9$radixuireactcontext.createContextScope('Tooltip', [$iVrL9$radixuireactpopper.createPopperScope]); const $c34afbc43c90cc6f$var$usePopperScope = $iVrL9$radixuireactpopper.createPopperScope(); /* ------------------------------------------------------------------------------------------------- * TooltipProvider * -----------------------------------------------------------------------------------------------*/ const $c34afbc43c90cc6f$var$PROVIDER_NAME = 'TooltipProvider'; const $c34afbc43c90cc6f$var$DEFAULT_DELAY_DURATION = 700; const $c34afbc43c90cc6f$var$TOOLTIP_OPEN = 'tooltip.open'; const [$c34afbc43c90cc6f$var$TooltipProviderContextProvider, $c34afbc43c90cc6f$var$useTooltipProviderContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$PROVIDER_NAME); const $c34afbc43c90cc6f$export$f78649fb9ca566b8 = props => { const { __scopeTooltip: __scopeTooltip, delayDuration = $c34afbc43c90cc6f$var$DEFAULT_DELAY_DURATION, skipDelayDuration = 300, disableHoverableContent = false, children: children } = props; const [isOpenDelayed, setIsOpenDelayed] = $iVrL9$react.useState(true); const isPointerInTransitRef = $iVrL9$react.useRef(false); const skipDelayTimerRef = $iVrL9$react.useRef(0); $iVrL9$react.useEffect(() => { const skipDelayTimer = skipDelayTimerRef.current; return () => window.clearTimeout(skipDelayTimer); }, []); return /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipProviderContextProvider, { scope: __scopeTooltip, isOpenDelayed: isOpenDelayed, delayDuration: delayDuration, onOpen: $iVrL9$react.useCallback(() => { window.clearTimeout(skipDelayTimerRef.current); setIsOpenDelayed(false); }, []), onClose: $iVrL9$react.useCallback(() => { window.clearTimeout(skipDelayTimerRef.current); skipDelayTimerRef.current = window.setTimeout(() => setIsOpenDelayed(true), skipDelayDuration); }, [skipDelayDuration]), isPointerInTransitRef: isPointerInTransitRef, onPointerInTransitChange: $iVrL9$react.useCallback(inTransit => { isPointerInTransitRef.current = inTransit; }, []), disableHoverableContent: disableHoverableContent }, children); }; /*#__PURE__*/ Object.assign($c34afbc43c90cc6f$export$f78649fb9ca566b8, { displayName: $c34afbc43c90cc6f$var$PROVIDER_NAME }); /* ------------------------------------------------------------------------------------------------- * Tooltip * -----------------------------------------------------------------------------------------------*/ const $c34afbc43c90cc6f$var$TOOLTIP_NAME = 'Tooltip'; const [$c34afbc43c90cc6f$var$TooltipContextProvider, $c34afbc43c90cc6f$var$useTooltipContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$TOOLTIP_NAME); const $c34afbc43c90cc6f$export$28c660c63b792dea = props => { const { __scopeTooltip: __scopeTooltip, children: children, open: openProp, defaultOpen = false, onOpenChange: onOpenChange, disableHoverableContent: disableHoverableContentProp, delayDuration: delayDurationProp } = props; const providerContext = $c34afbc43c90cc6f$var$useTooltipProviderContext($c34afbc43c90cc6f$var$TOOLTIP_NAME, props.__scopeTooltip); const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); const [trigger, setTrigger] = $iVrL9$react.useState(null); const contentId = $iVrL9$radixuireactid.useId(); const openTimerRef = $iVrL9$react.useRef(0); const disableHoverableContent = disableHoverableContentProp !== null && disableHoverableContentProp !== void 0 ? disableHoverableContentProp : providerContext.disableHoverableContent; const delayDuration = delayDurationProp !== null && delayDurationProp !== void 0 ? delayDurationProp : providerContext.delayDuration; const wasOpenDelayedRef = $iVrL9$react.useRef(false); const [open1 = false, setOpen] = $iVrL9$radixuireactusecontrollablestate.useControllableState({ prop: openProp, defaultProp: defaultOpen, onChange: open => { if (open) { providerContext.onOpen(); // as `onChange` is called within a lifecycle method we // avoid dispatching via `dispatchDiscreteCustomEvent`. document.dispatchEvent(new CustomEvent($c34afbc43c90cc6f$var$TOOLTIP_OPEN)); } else providerContext.onClose(); onOpenChange === null || onOpenChange === void 0 || onOpenChange(open); } }); const stateAttribute = $iVrL9$react.useMemo(() => { return open1 ? wasOpenDelayedRef.current ? 'delayed-open' : 'instant-open' : 'closed'; }, [open1]); const handleOpen = $iVrL9$react.useCallback(() => { window.clearTimeout(openTimerRef.current); wasOpenDelayedRef.current = false; setOpen(true); }, [setOpen]); const handleClose = $iVrL9$react.useCallback(() => { window.clearTimeout(openTimerRef.current); setOpen(false); }, [setOpen]); const handleDelayedOpen = $iVrL9$react.useCallback(() => { window.clearTimeout(openTimerRef.current); openTimerRef.current = window.setTimeout(() => { wasOpenDelayedRef.current = true; setOpen(true); }, delayDuration); }, [delayDuration, setOpen]); $iVrL9$react.useEffect(() => { return () => window.clearTimeout(openTimerRef.current); }, []); return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Root, popperScope, /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContextProvider, { scope: __scopeTooltip, contentId: contentId, open: open1, stateAttribute: stateAttribute, trigger: trigger, onTriggerChange: setTrigger, onTriggerEnter: $iVrL9$react.useCallback(() => { if (providerContext.isOpenDelayed) handleDelayedOpen();else handleOpen(); }, [providerContext.isOpenDelayed, handleDelayedOpen, handleOpen]), onTriggerLeave: $iVrL9$react.useCallback(() => { if (disableHoverableContent) handleClose();else // Clear the timer in case the pointer leaves the trigger before the tooltip is opened. window.clearTimeout(openTimerRef.current); }, [handleClose, disableHoverableContent]), onOpen: handleOpen, onClose: handleClose, disableHoverableContent: disableHoverableContent }, children)); }; /*#__PURE__*/ Object.assign($c34afbc43c90cc6f$export$28c660c63b792dea, { displayName: $c34afbc43c90cc6f$var$TOOLTIP_NAME }); /* ------------------------------------------------------------------------------------------------- * TooltipTrigger * -----------------------------------------------------------------------------------------------*/ const $c34afbc43c90cc6f$var$TRIGGER_NAME = 'TooltipTrigger'; const $c34afbc43c90cc6f$export$8c610744efcf8a1d = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { const { __scopeTooltip: __scopeTooltip, ...triggerProps } = props; const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$TRIGGER_NAME, __scopeTooltip); const providerContext = $c34afbc43c90cc6f$var$useTooltipProviderContext($c34afbc43c90cc6f$var$TRIGGER_NAME, __scopeTooltip); const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); const ref = $iVrL9$react.useRef(null); const composedRefs = $iVrL9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref, context.onTriggerChange); const isPointerDownRef = $iVrL9$react.useRef(false); const hasPointerMoveOpenedRef = $iVrL9$react.useRef(false); const handlePointerUp = $iVrL9$react.useCallback(() => isPointerDownRef.current = false, []); $iVrL9$react.useEffect(() => { return () => document.removeEventListener('pointerup', handlePointerUp); }, [handlePointerUp]); return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Anchor, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ asChild: true }, popperScope), /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactprimitive.Primitive.button, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ // We purposefully avoid adding `type=button` here because tooltip triggers are also // commonly anchors and the anchor `type` attribute signifies MIME type. "aria-describedby": context.open ? context.contentId : undefined, "data-state": context.stateAttribute }, triggerProps, { ref: composedRefs, onPointerMove: $iVrL9$radixuiprimitive.composeEventHandlers(props.onPointerMove, event => { if (event.pointerType === 'touch') return; if (!hasPointerMoveOpenedRef.current && !providerContext.isPointerInTransitRef.current) { context.onTriggerEnter(); hasPointerMoveOpenedRef.current = true; } }), onPointerLeave: $iVrL9$radixuiprimitive.composeEventHandlers(props.onPointerLeave, () => { context.onTriggerLeave(); hasPointerMoveOpenedRef.current = false; }), onPointerDown: $iVrL9$radixuiprimitive.composeEventHandlers(props.onPointerDown, () => { isPointerDownRef.current = true; document.addEventListener('pointerup', handlePointerUp, { once: true }); }), onFocus: $iVrL9$radixuiprimitive.composeEventHandlers(props.onFocus, () => { if (!isPointerDownRef.current) context.onOpen(); }), onBlur: $iVrL9$radixuiprimitive.composeEventHandlers(props.onBlur, context.onClose), onClick: $iVrL9$radixuiprimitive.composeEventHandlers(props.onClick, context.onClose) }))); }); /*#__PURE__*/ Object.assign($c34afbc43c90cc6f$export$8c610744efcf8a1d, { displayName: $c34afbc43c90cc6f$var$TRIGGER_NAME }); /* ------------------------------------------------------------------------------------------------- * TooltipPortal * -----------------------------------------------------------------------------------------------*/ const $c34afbc43c90cc6f$var$PORTAL_NAME = 'TooltipPortal'; const [$c34afbc43c90cc6f$var$PortalProvider, $c34afbc43c90cc6f$var$usePortalContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$PORTAL_NAME, { forceMount: undefined }); const $c34afbc43c90cc6f$export$7b36b8f925ab7497 = props => { const { __scopeTooltip: __scopeTooltip, forceMount: forceMount, children: children, container: container } = props; const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$PORTAL_NAME, __scopeTooltip); return /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$PortalProvider, { scope: __scopeTooltip, forceMount: forceMount }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpresence.Presence, { present: forceMount || context.open }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactportal.Portal, { asChild: true, container: container }, children))); }; /*#__PURE__*/ Object.assign($c34afbc43c90cc6f$export$7b36b8f925ab7497, { displayName: $c34afbc43c90cc6f$var$PORTAL_NAME }); /* ------------------------------------------------------------------------------------------------- * TooltipContent * -----------------------------------------------------------------------------------------------*/ const $c34afbc43c90cc6f$var$CONTENT_NAME = 'TooltipContent'; const $c34afbc43c90cc6f$export$e9003e2be37ec060 = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { const portalContext = $c34afbc43c90cc6f$var$usePortalContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); const { forceMount = portalContext.forceMount, side = 'top', ...contentProps } = props; const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpresence.Presence, { present: forceMount || context.open }, context.disableHoverableContent ? /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContentImpl, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ side: side }, contentProps, { ref: forwardedRef })) : /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContentHoverable, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ side: side }, contentProps, { ref: forwardedRef }))); }); const $c34afbc43c90cc6f$var$TooltipContentHoverable = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); const providerContext = $c34afbc43c90cc6f$var$useTooltipProviderContext($c34afbc43c90cc6f$var$CONTENT_NAME, props.__scopeTooltip); const ref = $iVrL9$react.useRef(null); const composedRefs = $iVrL9$radixuireactcomposerefs.useComposedRefs(forwardedRef, ref); const [pointerGraceArea, setPointerGraceArea] = $iVrL9$react.useState(null); const { trigger: trigger, onClose: onClose } = context; const content = ref.current; const { onPointerInTransitChange: onPointerInTransitChange } = providerContext; const handleRemoveGraceArea = $iVrL9$react.useCallback(() => { setPointerGraceArea(null); onPointerInTransitChange(false); }, [onPointerInTransitChange]); const handleCreateGraceArea = $iVrL9$react.useCallback((event, hoverTarget) => { const currentTarget = event.currentTarget; const exitPoint = { x: event.clientX, y: event.clientY }; const exitSide = $c34afbc43c90cc6f$var$getExitSideFromRect(exitPoint, currentTarget.getBoundingClientRect()); const paddedExitPoints = $c34afbc43c90cc6f$var$getPaddedExitPoints(exitPoint, exitSide); const hoverTargetPoints = $c34afbc43c90cc6f$var$getPointsFromRect(hoverTarget.getBoundingClientRect()); const graceArea = $c34afbc43c90cc6f$var$getHull([...paddedExitPoints, ...hoverTargetPoints]); setPointerGraceArea(graceArea); onPointerInTransitChange(true); }, [onPointerInTransitChange]); $iVrL9$react.useEffect(() => { return () => handleRemoveGraceArea(); }, [handleRemoveGraceArea]); $iVrL9$react.useEffect(() => { if (trigger && content) { const handleTriggerLeave = event => handleCreateGraceArea(event, content); const handleContentLeave = event => handleCreateGraceArea(event, trigger); trigger.addEventListener('pointerleave', handleTriggerLeave); content.addEventListener('pointerleave', handleContentLeave); return () => { trigger.removeEventListener('pointerleave', handleTriggerLeave); content.removeEventListener('pointerleave', handleContentLeave); }; } }, [trigger, content, handleCreateGraceArea, handleRemoveGraceArea]); $iVrL9$react.useEffect(() => { if (pointerGraceArea) { const handleTrackPointerGrace = event => { const target = event.target; const pointerPosition = { x: event.clientX, y: event.clientY }; const hasEnteredTarget = (trigger === null || trigger === void 0 ? void 0 : trigger.contains(target)) || (content === null || content === void 0 ? void 0 : content.contains(target)); const isPointerOutsideGraceArea = !$c34afbc43c90cc6f$var$isPointInPolygon(pointerPosition, pointerGraceArea); if (hasEnteredTarget) handleRemoveGraceArea();else if (isPointerOutsideGraceArea) { handleRemoveGraceArea(); onClose(); } }; document.addEventListener('pointermove', handleTrackPointerGrace); return () => document.removeEventListener('pointermove', handleTrackPointerGrace); } }, [trigger, content, pointerGraceArea, onClose, handleRemoveGraceArea]); return /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$TooltipContentImpl, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({}, props, { ref: composedRefs })); }); const [$c34afbc43c90cc6f$var$VisuallyHiddenContentContextProvider, $c34afbc43c90cc6f$var$useVisuallyHiddenContentContext] = $c34afbc43c90cc6f$var$createTooltipContext($c34afbc43c90cc6f$var$TOOLTIP_NAME, { isInside: false }); const $c34afbc43c90cc6f$var$TooltipContentImpl = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { const { __scopeTooltip: __scopeTooltip, children: children, 'aria-label': ariaLabel, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, ...contentProps } = props; const context = $c34afbc43c90cc6f$var$useTooltipContext($c34afbc43c90cc6f$var$CONTENT_NAME, __scopeTooltip); const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); const { onClose: onClose } = context; // Close this tooltip if another one opens $iVrL9$react.useEffect(() => { document.addEventListener($c34afbc43c90cc6f$var$TOOLTIP_OPEN, onClose); return () => document.removeEventListener($c34afbc43c90cc6f$var$TOOLTIP_OPEN, onClose); }, [onClose]); // Close the tooltip if the trigger is scrolled $iVrL9$react.useEffect(() => { if (context.trigger) { const handleScroll = event => { const target = event.target; if (target !== null && target !== void 0 && target.contains(context.trigger)) onClose(); }; window.addEventListener('scroll', handleScroll, { capture: true }); return () => window.removeEventListener('scroll', handleScroll, { capture: true }); } }, [context.trigger, onClose]); return /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactdismissablelayer.DismissableLayer, { asChild: true, disableOutsidePointerEvents: false, onEscapeKeyDown: onEscapeKeyDown, onPointerDownOutside: onPointerDownOutside, onFocusOutside: event => event.preventDefault(), onDismiss: onClose }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Content, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({ "data-state": context.stateAttribute }, popperScope, contentProps, { ref: forwardedRef, style: { ...contentProps.style, '--radix-tooltip-content-transform-origin': 'var(--radix-popper-transform-origin)', '--radix-tooltip-content-available-width': 'var(--radix-popper-available-width)', '--radix-tooltip-content-available-height': 'var(--radix-popper-available-height)', '--radix-tooltip-trigger-width': 'var(--radix-popper-anchor-width)', '--radix-tooltip-trigger-height': 'var(--radix-popper-anchor-height)' } }), /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactslot.Slottable, null, children), /*#__PURE__*/$iVrL9$react.createElement($c34afbc43c90cc6f$var$VisuallyHiddenContentContextProvider, { scope: __scopeTooltip, isInside: true }, /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactvisuallyhidden.Root, { id: context.contentId, role: "tooltip" }, ariaLabel || children)))); }); /*#__PURE__*/ Object.assign($c34afbc43c90cc6f$export$e9003e2be37ec060, { displayName: $c34afbc43c90cc6f$var$CONTENT_NAME }); /* ------------------------------------------------------------------------------------------------- * TooltipArrow * -----------------------------------------------------------------------------------------------*/ const $c34afbc43c90cc6f$var$ARROW_NAME = 'TooltipArrow'; const $c34afbc43c90cc6f$export$c27ee0ad710f7559 = /*#__PURE__*/$iVrL9$react.forwardRef((props, forwardedRef) => { const { __scopeTooltip: __scopeTooltip, ...arrowProps } = props; const popperScope = $c34afbc43c90cc6f$var$usePopperScope(__scopeTooltip); const visuallyHiddenContentContext = $c34afbc43c90cc6f$var$useVisuallyHiddenContentContext($c34afbc43c90cc6f$var$ARROW_NAME, __scopeTooltip); // if the arrow is inside the `VisuallyHidden`, we don't want to render it all to // prevent issues in positioning the arrow due to the duplicate return visuallyHiddenContentContext.isInside ? null : /*#__PURE__*/$iVrL9$react.createElement($iVrL9$radixuireactpopper.Arrow, $parcel$interopDefault($iVrL9$babelruntimehelpersextends)({}, popperScope, arrowProps, { ref: forwardedRef })); }); /*#__PURE__*/ Object.assign($c34afbc43c90cc6f$export$c27ee0ad710f7559, { displayName: $c34afbc43c90cc6f$var$ARROW_NAME }); /* -----------------------------------------------------------------------------------------------*/ function $c34afbc43c90cc6f$var$getExitSideFromRect(point, rect) { const top = Math.abs(rect.top - point.y); const bottom = Math.abs(rect.bottom - point.y); const right = Math.abs(rect.right - point.x); const left = Math.abs(rect.left - point.x); switch (Math.min(top, bottom, right, left)) { case left: return 'left'; case right: return 'right'; case top: return 'top'; case bottom: return 'bottom'; default: throw new Error('unreachable'); } } function $c34afbc43c90cc6f$var$getPaddedExitPoints(exitPoint, exitSide) { let padding = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 5; const paddedExitPoints = []; switch (exitSide) { case 'top': paddedExitPoints.push({ x: exitPoint.x - padding, y: exitPoint.y + padding }, { x: exitPoint.x + padding, y: exitPoint.y + padding }); break; case 'bottom': paddedExitPoints.push({ x: exitPoint.x - padding, y: exitPoint.y - padding }, { x: exitPoint.x + padding, y: exitPoint.y - padding }); break; case 'left': paddedExitPoints.push({ x: exitPoint.x + padding, y: exitPoint.y - padding }, { x: exitPoint.x + padding, y: exitPoint.y + padding }); break; case 'right': paddedExitPoints.push({ x: exitPoint.x - padding, y: exitPoint.y - padding }, { x: exitPoint.x - padding, y: exitPoint.y + padding }); break; } return paddedExitPoints; } function $c34afbc43c90cc6f$var$getPointsFromRect(rect) { const { top: top, right: right, bottom: bottom, left: left } = rect; return [{ x: left, y: top }, { x: right, y: top }, { x: right, y: bottom }, { x: left, y: bottom }]; } // Determine if a point is inside of a polygon. // Based on https://github.com/substack/point-in-polygon function $c34afbc43c90cc6f$var$isPointInPolygon(point, polygon) { const { x: x, y: y } = point; let inside = false; for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) { const xi = polygon[i].x; const yi = polygon[i].y; const xj = polygon[j].x; const yj = polygon[j].y; // prettier-ignore const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi; if (intersect) inside = !inside; } return inside; } // Returns a new array of points representing the convex hull of the given set of points. // https://www.nayuki.io/page/convex-hull-algorithm function $c34afbc43c90cc6f$var$getHull(points) { const newPoints = points.slice(); newPoints.sort((a, b) => { if (a.x < b.x) return -1;else if (a.x > b.x) return 1;else if (a.y < b.y) return -1;else if (a.y > b.y) return 1;else return 0; }); return $c34afbc43c90cc6f$var$getHullPresorted(newPoints); } // Returns the convex hull, assuming that each points[i] <= points[i + 1]. Runs in O(n) time. function $c34afbc43c90cc6f$var$getHullPresorted(points) { if (points.length <= 1) return points.slice(); const upperHull = []; for (let i = 0; i < points.length; i++) { const p = points[i]; while (upperHull.length >= 2) { const q = upperHull[upperHull.length - 1]; const r = upperHull[upperHull.length - 2]; if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) upperHull.pop();else break; } upperHull.push(p); } upperHull.pop(); const lowerHull = []; for (let i1 = points.length - 1; i1 >= 0; i1--) { const p = points[i1]; while (lowerHull.length >= 2) { const q = lowerHull[lowerHull.length - 1]; const r = lowerHull[lowerHull.length - 2]; if ((q.x - r.x) * (p.y - r.y) >= (q.y - r.y) * (p.x - r.x)) lowerHull.pop();else break; } lowerHull.push(p); } lowerHull.pop(); if (upperHull.length === 1 && lowerHull.length === 1 && upperHull[0].x === lowerHull[0].x && upperHull[0].y === lowerHull[0].y) return upperHull;else return upperHull.concat(lowerHull); } const $c34afbc43c90cc6f$export$2881499e37b75b9a = $c34afbc43c90cc6f$export$f78649fb9ca566b8; const $c34afbc43c90cc6f$export$be92b6f5f03c0fe9 = $c34afbc43c90cc6f$export$28c660c63b792dea; const $c34afbc43c90cc6f$export$41fb9f06171c75f4 = $c34afbc43c90cc6f$export$8c610744efcf8a1d; const $c34afbc43c90cc6f$export$602eac185826482c = $c34afbc43c90cc6f$export$7b36b8f925ab7497; const $c34afbc43c90cc6f$export$7c6e2c02157bb7d2 = $c34afbc43c90cc6f$export$e9003e2be37ec060; const $c34afbc43c90cc6f$export$21b07c8f274aebd5 = $c34afbc43c90cc6f$export$c27ee0ad710f7559; /***/ }), /***/ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js": /*!****************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js ***! \****************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $92muK$react = __webpack_require__(/*! react */ "react"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useCallbackRef", () => $28e03942f763e819$export$25bec8c6f54ee79a); /** * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a * prop or avoid re-executing effects when passed as a dependency */ function $28e03942f763e819$export$25bec8c6f54ee79a(callback) { const callbackRef = $92muK$react.useRef(callback); $92muK$react.useEffect(() => { callbackRef.current = callback; }); // https://github.com/facebook/react/issues/19240 return $92muK$react.useMemo(() => function () { var _callbackRef$current; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args); }, []); } /***/ }), /***/ "../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js": /*!**********************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.js ***! \**********************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $ijazI$react = __webpack_require__(/*! react */ "react"); var $ijazI$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useControllableState", () => $b84d42d44371bff7$export$6f32135080cb4c3); function $b84d42d44371bff7$export$6f32135080cb4c3(_ref) { let { prop: prop, defaultProp: defaultProp, onChange = () => {} } = _ref; const [uncontrolledProp, setUncontrolledProp] = $b84d42d44371bff7$var$useUncontrolledState({ defaultProp: defaultProp, onChange: onChange }); const isControlled = prop !== undefined; const value1 = isControlled ? prop : uncontrolledProp; const handleChange = $ijazI$radixuireactusecallbackref.useCallbackRef(onChange); const setValue = $ijazI$react.useCallback(nextValue => { if (isControlled) { const setter = nextValue; const value = typeof nextValue === 'function' ? setter(prop) : nextValue; if (value !== prop) handleChange(value); } else setUncontrolledProp(nextValue); }, [isControlled, prop, setUncontrolledProp, handleChange]); return [value1, setValue]; } function $b84d42d44371bff7$var$useUncontrolledState(_ref2) { let { defaultProp: defaultProp, onChange: onChange } = _ref2; const uncontrolledState = $ijazI$react.useState(defaultProp); const [value] = uncontrolledState; const prevValueRef = $ijazI$react.useRef(value); const handleChange = $ijazI$radixuireactusecallbackref.useCallbackRef(onChange); $ijazI$react.useEffect(() => { if (prevValueRef.current !== value) { handleChange(value); prevValueRef.current = value; } }, [value, prevValueRef, handleChange]); return uncontrolledState; } /***/ }), /***/ "../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.js": /*!******************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-use-escape-keydown/dist/index.js ***! \******************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $b0gz3$react = __webpack_require__(/*! react */ "react"); var $b0gz3$radixuireactusecallbackref = __webpack_require__(/*! @radix-ui/react-use-callback-ref */ "../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useEscapeKeydown", () => $24c84e9f83c4454f$export$3a72a57244d6e765); /** * Listens for when the escape key is down */ function $24c84e9f83c4454f$export$3a72a57244d6e765(onEscapeKeyDownProp) { let ownerDocument = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : globalThis === null || globalThis === void 0 ? void 0 : globalThis.document; const onEscapeKeyDown = $b0gz3$radixuireactusecallbackref.useCallbackRef(onEscapeKeyDownProp); $b0gz3$react.useEffect(() => { const handleKeyDown = event => { if (event.key === 'Escape') onEscapeKeyDown(event); }; ownerDocument.addEventListener('keydown', handleKeyDown); return () => ownerDocument.removeEventListener('keydown', handleKeyDown); }, [onEscapeKeyDown, ownerDocument]); } /***/ }), /***/ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js": /*!*****************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js ***! \*****************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $caHyQ$react = __webpack_require__(/*! react */ "react"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useLayoutEffect", () => $ca21affb0542a8a4$export$e5c5a5f917a5871c); /** * On the server, React emits a warning when calling `useLayoutEffect`. * This is because neither `useLayoutEffect` nor `useEffect` run on the server. * We use this safe version which suppresses the warning by replacing it with a noop on the server. * * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect */ const $ca21affb0542a8a4$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $caHyQ$react.useLayoutEffect : () => {}; /***/ }), /***/ "../../../node_modules/@radix-ui/react-use-size/dist/index.js": /*!********************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-use-size/dist/index.js ***! \********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $ksDzM$react = __webpack_require__(/*! react */ "react"); var $ksDzM$radixuireactuselayouteffect = __webpack_require__(/*! @radix-ui/react-use-layout-effect */ "../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } $parcel$export(module.exports, "useSize", () => $d2c1d285af17635b$export$1ab7ae714698c4b8); function $d2c1d285af17635b$export$1ab7ae714698c4b8(element) { const [size, setSize] = $ksDzM$react.useState(undefined); $ksDzM$radixuireactuselayouteffect.useLayoutEffect(() => { if (element) { // provide size as early as possible setSize({ width: element.offsetWidth, height: element.offsetHeight }); const resizeObserver = new ResizeObserver(entries => { if (!Array.isArray(entries)) return; // Since we only observe the one element, we don't need to loop over the // array if (!entries.length) return; const entry = entries[0]; let width; let height; if ('borderBoxSize' in entry) { const borderSizeEntry = entry['borderBoxSize']; // iron out differences between browsers const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry; width = borderSize['inlineSize']; height = borderSize['blockSize']; } else { // for browsers that don't support `borderBoxSize` // we calculate it ourselves to get the correct border box. width = element.offsetWidth; height = element.offsetHeight; } setSize({ width: width, height: height }); }); resizeObserver.observe(element, { box: 'border-box' }); return () => resizeObserver.unobserve(element); } else // We only want to reset to `undefined` when the element becomes `null`, // not if it changes to another element. setSize(undefined); }, [element]); return size; } /***/ }), /***/ "../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js": /*!***************************************************************************!*\ !*** ../../../node_modules/@radix-ui/react-visually-hidden/dist/index.js ***! \***************************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var $awrN2$babelruntimehelpersextends = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../../../node_modules/@babel/runtime/helpers/extends.js"); var $awrN2$react = __webpack_require__(/*! react */ "react"); var $awrN2$radixuireactprimitive = __webpack_require__(/*! @radix-ui/react-primitive */ "../../../node_modules/@radix-ui/react-primitive/dist/index.js"); function $parcel$export(e, n, v, s) { Object.defineProperty(e, n, { get: v, set: s, enumerable: true, configurable: true }); } function $parcel$interopDefault(a) { return a && a.__esModule ? a.default : a; } $parcel$export(module.exports, "VisuallyHidden", () => $685371e9c20848e2$export$439d29a4e110a164); $parcel$export(module.exports, "Root", () => $685371e9c20848e2$export$be92b6f5f03c0fe9); /* ------------------------------------------------------------------------------------------------- * VisuallyHidden * -----------------------------------------------------------------------------------------------*/ const $685371e9c20848e2$var$NAME = 'VisuallyHidden'; const $685371e9c20848e2$export$439d29a4e110a164 = /*#__PURE__*/$awrN2$react.forwardRef((props, forwardedRef) => { return /*#__PURE__*/$awrN2$react.createElement($awrN2$radixuireactprimitive.Primitive.span, $parcel$interopDefault($awrN2$babelruntimehelpersextends)({}, props, { ref: forwardedRef, style: { // See: https://github.com/twbs/bootstrap/blob/master/scss/mixins/_screen-reader.scss position: 'absolute', border: 0, width: 1, height: 1, padding: 0, margin: -1, overflow: 'hidden', clip: 'rect(0, 0, 0, 0)', whiteSpace: 'nowrap', wordWrap: 'normal', ...props.style } })); }); /*#__PURE__*/ Object.assign($685371e9c20848e2$export$439d29a4e110a164, { displayName: $685371e9c20848e2$var$NAME }); /* -----------------------------------------------------------------------------------------------*/ const $685371e9c20848e2$export$be92b6f5f03c0fe9 = $685371e9c20848e2$export$439d29a4e110a164; /***/ }), /***/ "../../../node_modules/aria-hidden/dist/es2015/index.js": /*!**************************************************************!*\ !*** ../../../node_modules/aria-hidden/dist/es2015/index.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.suppressOthers = exports.supportsInert = exports.inertOthers = exports.hideOthers = void 0; var getDefaultParent = function (originalTarget) { if (typeof document === 'undefined') { return null; } var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget; return sampleTarget.ownerDocument.body; }; var counterMap = new WeakMap(); var uncontrolledNodes = new WeakMap(); var markerMap = {}; var lockCount = 0; var unwrapHost = function (node) { return node && (node.host || unwrapHost(node.parentNode)); }; var correctTargets = function (parent, targets) { return targets.map(function (target) { if (parent.contains(target)) { return target; } var correctedTarget = unwrapHost(target); if (correctedTarget && parent.contains(correctedTarget)) { return correctedTarget; } console.error('aria-hidden', target, 'in not contained inside', parent, '. Doing nothing'); return null; }).filter(function (x) { return Boolean(x); }); }; /** * Marks everything except given node(or nodes) as aria-hidden * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @param {String} [controlAttribute] - html Attribute to control * @return {Undo} undo command */ var applyAttributeToOthers = function (originalTarget, parentNode, markerName, controlAttribute) { var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]); if (!markerMap[markerName]) { markerMap[markerName] = new WeakMap(); } var markerCounter = markerMap[markerName]; var hiddenNodes = []; var elementsToKeep = new Set(); var elementsToStop = new Set(targets); var keep = function (el) { if (!el || elementsToKeep.has(el)) { return; } elementsToKeep.add(el); keep(el.parentNode); }; targets.forEach(keep); var deep = function (parent) { if (!parent || elementsToStop.has(parent)) { return; } Array.prototype.forEach.call(parent.children, function (node) { if (elementsToKeep.has(node)) { deep(node); } else { var attr = node.getAttribute(controlAttribute); var alreadyHidden = attr !== null && attr !== 'false'; var counterValue = (counterMap.get(node) || 0) + 1; var markerValue = (markerCounter.get(node) || 0) + 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); hiddenNodes.push(node); if (counterValue === 1 && alreadyHidden) { uncontrolledNodes.set(node, true); } if (markerValue === 1) { node.setAttribute(markerName, 'true'); } if (!alreadyHidden) { node.setAttribute(controlAttribute, 'true'); } } }); }; deep(parentNode); elementsToKeep.clear(); lockCount++; return function () { hiddenNodes.forEach(function (node) { var counterValue = counterMap.get(node) - 1; var markerValue = markerCounter.get(node) - 1; counterMap.set(node, counterValue); markerCounter.set(node, markerValue); if (!counterValue) { if (!uncontrolledNodes.has(node)) { node.removeAttribute(controlAttribute); } uncontrolledNodes.delete(node); } if (!markerValue) { node.removeAttribute(markerName); } }); lockCount--; if (!lockCount) { // clear counterMap = new WeakMap(); counterMap = new WeakMap(); uncontrolledNodes = new WeakMap(); markerMap = {}; } }; }; /** * Marks everything except given node(or nodes) as aria-hidden * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @return {Undo} undo command */ var hideOthers = function (originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = 'data-aria-hidden'; } var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]); var activeParentNode = parentNode || getDefaultParent(originalTarget); if (!activeParentNode) { return function () { return null; }; } // we should not hide ariaLive elements - https://github.com/theKashey/aria-hidden/issues/10 targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll('[aria-live]'))); return applyAttributeToOthers(targets, activeParentNode, markerName, 'aria-hidden'); }; /** * Marks everything except given node(or nodes) as inert * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @return {Undo} undo command */ exports.hideOthers = hideOthers; var inertOthers = function (originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = 'data-inert-ed'; } var activeParentNode = parentNode || getDefaultParent(originalTarget); if (!activeParentNode) { return function () { return null; }; } return applyAttributeToOthers(originalTarget, activeParentNode, markerName, 'inert'); }; /** * @returns if current browser supports inert */ exports.inertOthers = inertOthers; var supportsInert = function () { return typeof HTMLElement !== 'undefined' && HTMLElement.prototype.hasOwnProperty('inert'); }; /** * Automatic function to "suppress" DOM elements - _hide_ or _inert_ in the best possible way * @param {Element | Element[]} originalTarget - elements to keep on the page * @param [parentNode] - top element, defaults to document.body * @param {String} [markerName] - a special attribute to mark every node * @return {Undo} undo command */ exports.supportsInert = supportsInert; var suppressOthers = function (originalTarget, parentNode, markerName) { if (markerName === void 0) { markerName = 'data-suppressed'; } return (supportsInert() ? inertOthers : hideOthers)(originalTarget, parentNode, markerName); }; exports.suppressOthers = suppressOthers; /***/ }), /***/ "../../../node_modules/clsx/dist/clsx.m.js": /*!*************************************************!*\ !*** ../../../node_modules/clsx/dist/clsx.m.js ***! \*************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.clsx = clsx; exports["default"] = void 0; function r(e) { var t, f, n = ""; if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);else for (t in e) e[t] && (n && (n += " "), n += t); return n; } function clsx() { for (var e, t, f = 0, n = ""; f < arguments.length;) (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t); return n; } var _default = clsx; exports["default"] = _default; /***/ }), /***/ "../../../node_modules/copy-to-clipboard/index.js": /*!********************************************************!*\ !*** ../../../node_modules/copy-to-clipboard/index.js ***! \********************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var deselectCurrent = __webpack_require__(/*! toggle-selection */ "../../../node_modules/toggle-selection/index.js"); var clipboardToIE11Formatting = { "text/plain": "Text", "text/html": "Url", "default": "Text" }; var defaultMessage = "Copy to clipboard: #{key}, Enter"; function format(message) { var copyKey = (/mac os x/i.test(navigator.userAgent) ? "⌘" : "Ctrl") + "+C"; return message.replace(/#{\s*key\s*}/g, copyKey); } function copy(text, options) { var debug, message, reselectPrevious, range, selection, mark, success = false; if (!options) { options = {}; } debug = options.debug || false; try { reselectPrevious = deselectCurrent(); range = document.createRange(); selection = document.getSelection(); mark = document.createElement("span"); mark.textContent = text; // avoid screen readers from reading out loud the text mark.ariaHidden = "true"; // reset user styles for span element mark.style.all = "unset"; // prevents scrolling to the end of the page mark.style.position = "fixed"; mark.style.top = 0; mark.style.clip = "rect(0, 0, 0, 0)"; // used to preserve spaces and line breaks mark.style.whiteSpace = "pre"; // do not inherit user-select (it may be `none`) mark.style.webkitUserSelect = "text"; mark.style.MozUserSelect = "text"; mark.style.msUserSelect = "text"; mark.style.userSelect = "text"; mark.addEventListener("copy", function (e) { e.stopPropagation(); if (options.format) { e.preventDefault(); if (typeof e.clipboardData === "undefined") { // IE 11 debug && console.warn("unable to use e.clipboardData"); debug && console.warn("trying IE specific stuff"); window.clipboardData.clearData(); var format = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"]; window.clipboardData.setData(format, text); } else { // all other browsers e.clipboardData.clearData(); e.clipboardData.setData(options.format, text); } } if (options.onCopy) { e.preventDefault(); options.onCopy(e.clipboardData); } }); document.body.appendChild(mark); range.selectNodeContents(mark); selection.addRange(range); var successful = document.execCommand("copy"); if (!successful) { throw new Error("copy command was unsuccessful"); } success = true; } catch (err) { debug && console.error("unable to copy using execCommand: ", err); debug && console.warn("trying IE specific stuff"); try { window.clipboardData.setData(options.format || "text", text); options.onCopy && options.onCopy(window.clipboardData); success = true; } catch (err) { debug && console.error("unable to copy using clipboardData: ", err); debug && console.error("falling back to prompt"); message = format("message" in options ? options.message : defaultMessage); window.prompt(message, text); } } finally { if (selection) { if (typeof selection.removeRange == "function") { selection.removeRange(range); } else { selection.removeAllRanges(); } } if (mark) { document.body.removeChild(mark); } reselectPrevious(); } return success; } module.exports = copy; /***/ }), /***/ "../../../node_modules/detect-node-es/esm/browser.js": /*!***********************************************************!*\ !*** ../../../node_modules/detect-node-es/esm/browser.js ***! \***********************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isNode = void 0; const isNode = false; exports.isNode = isNode; /***/ }), /***/ "../../../node_modules/entities/lib/decode.js": /*!****************************************************!*\ !*** ../../../node_modules/entities/lib/decode.js ***! \****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var __createBinding = void 0 && (void 0).__createBinding || (Object.create ? function (o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function () { return m[k]; } }; } Object.defineProperty(o, k2, desc); } : function (o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; }); var __setModuleDefault = void 0 && (void 0).__setModuleDefault || (Object.create ? function (o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); } : function (o, v) { o["default"] = v; }); var __importStar = void 0 && (void 0).__importStar || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decodeXML = exports.decodeHTMLStrict = exports.decodeHTMLAttribute = exports.decodeHTML = exports.determineBranch = exports.EntityDecoder = exports.DecodingMode = exports.BinTrieFlags = exports.fromCodePoint = exports.replaceCodePoint = exports.decodeCodePoint = exports.xmlDecodeTree = exports.htmlDecodeTree = void 0; var decode_data_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-html.js */ "../../../node_modules/entities/lib/generated/decode-data-html.js")); exports.htmlDecodeTree = decode_data_html_js_1.default; var decode_data_xml_js_1 = __importDefault(__webpack_require__(/*! ./generated/decode-data-xml.js */ "../../../node_modules/entities/lib/generated/decode-data-xml.js")); exports.xmlDecodeTree = decode_data_xml_js_1.default; var decode_codepoint_js_1 = __importStar(__webpack_require__(/*! ./decode_codepoint.js */ "../../../node_modules/entities/lib/decode_codepoint.js")); exports.decodeCodePoint = decode_codepoint_js_1.default; var decode_codepoint_js_2 = __webpack_require__(/*! ./decode_codepoint.js */ "../../../node_modules/entities/lib/decode_codepoint.js"); Object.defineProperty(exports, "replaceCodePoint", ({ enumerable: true, get: function () { return decode_codepoint_js_2.replaceCodePoint; } })); Object.defineProperty(exports, "fromCodePoint", ({ enumerable: true, get: function () { return decode_codepoint_js_2.fromCodePoint; } })); var CharCodes; (function (CharCodes) { CharCodes[CharCodes["NUM"] = 35] = "NUM"; CharCodes[CharCodes["SEMI"] = 59] = "SEMI"; CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS"; CharCodes[CharCodes["ZERO"] = 48] = "ZERO"; CharCodes[CharCodes["NINE"] = 57] = "NINE"; CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A"; CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F"; CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X"; CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z"; CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A"; CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F"; CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z"; })(CharCodes || (CharCodes = {})); /** Bit that needs to be set to convert an upper case ASCII character to lower case */ var TO_LOWER_BIT = 32; var BinTrieFlags; (function (BinTrieFlags) { BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH"; BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 16256] = "BRANCH_LENGTH"; BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE"; })(BinTrieFlags = exports.BinTrieFlags || (exports.BinTrieFlags = {})); function isNumber(code) { return code >= CharCodes.ZERO && code <= CharCodes.NINE; } function isHexadecimalCharacter(code) { return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F; } function isAsciiAlphaNumeric(code) { return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code); } /** * Checks if the given character is a valid end character for an entity in an attribute. * * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error. * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state */ function isEntityInAttributeInvalidEnd(code) { return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code); } var EntityDecoderState; (function (EntityDecoderState) { EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart"; EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart"; EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal"; EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex"; EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity"; })(EntityDecoderState || (EntityDecoderState = {})); var DecodingMode; (function (DecodingMode) { /** Entities in text nodes that can end with any character. */ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy"; /** Only allow entities terminated with a semicolon. */ DecodingMode[DecodingMode["Strict"] = 1] = "Strict"; /** Entities in attributes have limitations on ending characters. */ DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute"; })(DecodingMode = exports.DecodingMode || (exports.DecodingMode = {})); /** * Token decoder with support of writing partial entities. */ var EntityDecoder = /** @class */function () { function EntityDecoder( /** The tree used to decode entities. */ decodeTree, /** * The function that is called when a codepoint is decoded. * * For multi-byte named entities, this will be called multiple times, * with the second codepoint, and the same `consumed` value. * * @param codepoint The decoded codepoint. * @param consumed The number of bytes consumed by the decoder. */ emitCodePoint, /** An object that is used to produce errors. */ errors) { this.decodeTree = decodeTree; this.emitCodePoint = emitCodePoint; this.errors = errors; /** The current state of the decoder. */ this.state = EntityDecoderState.EntityStart; /** Characters that were consumed while parsing an entity. */ this.consumed = 1; /** * The result of the entity. * * Either the result index of a numeric entity, or the codepoint of a * numeric entity. */ this.result = 0; /** The current index in the decode tree. */ this.treeIndex = 0; /** The number of characters that were consumed in excess. */ this.excess = 1; /** The mode in which the decoder is operating. */ this.decodeMode = DecodingMode.Strict; } /** Resets the instance to make it reusable. */ EntityDecoder.prototype.startEntity = function (decodeMode) { this.decodeMode = decodeMode; this.state = EntityDecoderState.EntityStart; this.result = 0; this.treeIndex = 0; this.excess = 1; this.consumed = 1; }; /** * Write an entity to the decoder. This can be called multiple times with partial entities. * If the entity is incomplete, the decoder will return -1. * * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the * entity is incomplete, and resume when the next string is written. * * @param string The string containing the entity (or a continuation of the entity). * @param offset The offset at which the entity begins. Should be 0 if this is not the first call. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.write = function (str, offset) { switch (this.state) { case EntityDecoderState.EntityStart: { if (str.charCodeAt(offset) === CharCodes.NUM) { this.state = EntityDecoderState.NumericStart; this.consumed += 1; return this.stateNumericStart(str, offset + 1); } this.state = EntityDecoderState.NamedEntity; return this.stateNamedEntity(str, offset); } case EntityDecoderState.NumericStart: { return this.stateNumericStart(str, offset); } case EntityDecoderState.NumericDecimal: { return this.stateNumericDecimal(str, offset); } case EntityDecoderState.NumericHex: { return this.stateNumericHex(str, offset); } case EntityDecoderState.NamedEntity: { return this.stateNamedEntity(str, offset); } } }; /** * Switches between the numeric decimal and hexadecimal states. * * Equivalent to the `Numeric character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNumericStart = function (str, offset) { if (offset >= str.length) { return -1; } if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) { this.state = EntityDecoderState.NumericHex; this.consumed += 1; return this.stateNumericHex(str, offset + 1); } this.state = EntityDecoderState.NumericDecimal; return this.stateNumericDecimal(str, offset); }; EntityDecoder.prototype.addToNumericResult = function (str, start, end, base) { if (start !== end) { var digitCount = end - start; this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base); this.consumed += digitCount; } }; /** * Parses a hexadecimal numeric entity. * * Equivalent to the `Hexademical character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNumericHex = function (str, offset) { var startIdx = offset; while (offset < str.length) { var char = str.charCodeAt(offset); if (isNumber(char) || isHexadecimalCharacter(char)) { offset += 1; } else { this.addToNumericResult(str, startIdx, offset, 16); return this.emitNumericEntity(char, 3); } } this.addToNumericResult(str, startIdx, offset, 16); return -1; }; /** * Parses a decimal numeric entity. * * Equivalent to the `Decimal character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNumericDecimal = function (str, offset) { var startIdx = offset; while (offset < str.length) { var char = str.charCodeAt(offset); if (isNumber(char)) { offset += 1; } else { this.addToNumericResult(str, startIdx, offset, 10); return this.emitNumericEntity(char, 2); } } this.addToNumericResult(str, startIdx, offset, 10); return -1; }; /** * Validate and emit a numeric entity. * * Implements the logic from the `Hexademical character reference start * state` and `Numeric character reference end state` in the HTML spec. * * @param lastCp The last code point of the entity. Used to see if the * entity was terminated with a semicolon. * @param expectedLength The minimum number of characters that should be * consumed. Used to validate that at least one digit * was consumed. * @returns The number of characters that were consumed. */ EntityDecoder.prototype.emitNumericEntity = function (lastCp, expectedLength) { var _a; // Ensure we consumed at least one digit. if (this.consumed <= expectedLength) { (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); return 0; } // Figure out if this is a legit end of the entity if (lastCp === CharCodes.SEMI) { this.consumed += 1; } else if (this.decodeMode === DecodingMode.Strict) { return 0; } this.emitCodePoint((0, decode_codepoint_js_1.replaceCodePoint)(this.result), this.consumed); if (this.errors) { if (lastCp !== CharCodes.SEMI) { this.errors.missingSemicolonAfterCharacterReference(); } this.errors.validateNumericCharacterReference(this.result); } return this.consumed; }; /** * Parses a named entity. * * Equivalent to the `Named character reference state` in the HTML spec. * * @param str The string containing the entity (or a continuation of the entity). * @param offset The current offset. * @returns The number of characters that were consumed, or -1 if the entity is incomplete. */ EntityDecoder.prototype.stateNamedEntity = function (str, offset) { var decodeTree = this.decodeTree; var current = decodeTree[this.treeIndex]; // The mask is the number of bytes of the value, including the current byte. var valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; for (; offset < str.length; offset++, this.excess++) { var char = str.charCodeAt(offset); this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char); if (this.treeIndex < 0) { return this.result === 0 || // If we are parsing an attribute this.decodeMode === DecodingMode.Attribute && ( // We shouldn't have consumed any characters after the entity, valueLength === 0 || // And there should be no invalid characters. isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity(); } current = decodeTree[this.treeIndex]; valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14; // If the branch is a value, store it and continue if (valueLength !== 0) { // If the entity is terminated by a semicolon, we are done. if (char === CharCodes.SEMI) { return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess); } // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it. if (this.decodeMode !== DecodingMode.Strict) { this.result = this.treeIndex; this.consumed += this.excess; this.excess = 0; } } } return -1; }; /** * Emit a named entity that was not terminated with a semicolon. * * @returns The number of characters consumed. */ EntityDecoder.prototype.emitNotTerminatedNamedEntity = function () { var _a; var _b = this, result = _b.result, decodeTree = _b.decodeTree; var valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14; this.emitNamedEntityData(result, valueLength, this.consumed); (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference(); return this.consumed; }; /** * Emit a named entity. * * @param result The index of the entity in the decode tree. * @param valueLength The number of bytes in the entity. * @param consumed The number of characters consumed. * * @returns The number of characters consumed. */ EntityDecoder.prototype.emitNamedEntityData = function (result, valueLength, consumed) { var decodeTree = this.decodeTree; this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed); if (valueLength === 3) { // For multi-byte values, we need to emit the second byte. this.emitCodePoint(decodeTree[result + 2], consumed); } return consumed; }; /** * Signal to the parser that the end of the input was reached. * * Remaining data will be emitted and relevant errors will be produced. * * @returns The number of characters consumed. */ EntityDecoder.prototype.end = function () { var _a; switch (this.state) { case EntityDecoderState.NamedEntity: { // Emit a named entity if we have one. return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0; } // Otherwise, emit a numeric entity if we have one. case EntityDecoderState.NumericDecimal: { return this.emitNumericEntity(0, 2); } case EntityDecoderState.NumericHex: { return this.emitNumericEntity(0, 3); } case EntityDecoderState.NumericStart: { (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed); return 0; } case EntityDecoderState.EntityStart: { // Return 0 if we have no entity. return 0; } } }; return EntityDecoder; }(); exports.EntityDecoder = EntityDecoder; /** * Creates a function that decodes entities in a string. * * @param decodeTree The decode tree. * @returns A function that decodes entities in a string. */ function getDecoder(decodeTree) { var ret = ""; var decoder = new EntityDecoder(decodeTree, function (str) { return ret += (0, decode_codepoint_js_1.fromCodePoint)(str); }); return function decodeWithTrie(str, decodeMode) { var lastIndex = 0; var offset = 0; while ((offset = str.indexOf("&", offset)) >= 0) { ret += str.slice(lastIndex, offset); decoder.startEntity(decodeMode); var len = decoder.write(str, // Skip the "&" offset + 1); if (len < 0) { lastIndex = offset + decoder.end(); break; } lastIndex = offset + len; // If `len` is 0, skip the current `&` and continue. offset = len === 0 ? lastIndex + 1 : lastIndex; } var result = ret + str.slice(lastIndex); // Make sure we don't keep a reference to the final string. ret = ""; return result; }; } /** * Determines the branch of the current node that is taken given the current * character. This function is used to traverse the trie. * * @param decodeTree The trie. * @param current The current node. * @param nodeIdx The index right after the current node and its value. * @param char The current character. * @returns The index of the next node, or -1 if no branch is taken. */ function determineBranch(decodeTree, current, nodeIdx, char) { var branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7; var jumpOffset = current & BinTrieFlags.JUMP_TABLE; // Case 1: Single branch encoded in jump offset if (branchCount === 0) { return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1; } // Case 2: Multiple branches encoded in jump table if (jumpOffset) { var value = char - jumpOffset; return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1; } // Case 3: Multiple branches encoded in dictionary // Binary search for the character. var lo = nodeIdx; var hi = lo + branchCount - 1; while (lo <= hi) { var mid = lo + hi >>> 1; var midVal = decodeTree[mid]; if (midVal < char) { lo = mid + 1; } else if (midVal > char) { hi = mid - 1; } else { return decodeTree[mid + branchCount]; } } return -1; } exports.determineBranch = determineBranch; var htmlDecoder = getDecoder(decode_data_html_js_1.default); var xmlDecoder = getDecoder(decode_data_xml_js_1.default); /** * Decodes an HTML string. * * @param str The string to decode. * @param mode The decoding mode. * @returns The decoded string. */ function decodeHTML(str, mode) { if (mode === void 0) { mode = DecodingMode.Legacy; } return htmlDecoder(str, mode); } exports.decodeHTML = decodeHTML; /** * Decodes an HTML string in an attribute. * * @param str The string to decode. * @returns The decoded string. */ function decodeHTMLAttribute(str) { return htmlDecoder(str, DecodingMode.Attribute); } exports.decodeHTMLAttribute = decodeHTMLAttribute; /** * Decodes an HTML string, requiring all entities to be terminated by a semicolon. * * @param str The string to decode. * @returns The decoded string. */ function decodeHTMLStrict(str) { return htmlDecoder(str, DecodingMode.Strict); } exports.decodeHTMLStrict = decodeHTMLStrict; /** * Decodes an XML string, requiring all entities to be terminated by a semicolon. * * @param str The string to decode. * @returns The decoded string. */ function decodeXML(str) { return xmlDecoder(str, DecodingMode.Strict); } exports.decodeXML = decodeXML; /***/ }), /***/ "../../../node_modules/entities/lib/decode_codepoint.js": /*!**************************************************************!*\ !*** ../../../node_modules/entities/lib/decode_codepoint.js ***! \**************************************************************/ /***/ (function(__unused_webpack_module, exports) { // Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134 var _a; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.replaceCodePoint = exports.fromCodePoint = void 0; var decodeMap = new Map([[0, 65533], // C1 Unicode control character reference replacements [128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]); /** * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point. */ exports.fromCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function (codePoint) { var output = ""; if (codePoint > 0xffff) { codePoint -= 0x10000; output += String.fromCharCode(codePoint >>> 10 & 0x3ff | 0xd800); codePoint = 0xdc00 | codePoint & 0x3ff; } output += String.fromCharCode(codePoint); return output; }; /** * Replace the given code point with a replacement character if it is a * surrogate or is outside the valid range. Otherwise return the code * point unchanged. */ function replaceCodePoint(codePoint) { var _a; if (codePoint >= 0xd800 && codePoint <= 0xdfff || codePoint > 0x10ffff) { return 0xfffd; } return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint; } exports.replaceCodePoint = replaceCodePoint; /** * Replace the code point if relevant, then convert it to a string. * * @deprecated Use `fromCodePoint(replaceCodePoint(codePoint))` instead. * @param codePoint The code point to decode. * @returns The decoded code point. */ function decodeCodePoint(codePoint) { return (0, exports.fromCodePoint)(replaceCodePoint(codePoint)); } exports["default"] = decodeCodePoint; /***/ }), /***/ "../../../node_modules/entities/lib/encode.js": /*!****************************************************!*\ !*** ../../../node_modules/entities/lib/encode.js ***! \****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var __importDefault = void 0 && (void 0).__importDefault || function (mod) { return mod && mod.__esModule ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", ({ value: true })); exports.encodeNonAsciiHTML = exports.encodeHTML = void 0; var encode_html_js_1 = __importDefault(__webpack_require__(/*! ./generated/encode-html.js */ "../../../node_modules/entities/lib/generated/encode-html.js")); var escape_js_1 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); var htmlReplacer = /[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g; /** * Encodes all characters in the input using HTML entities. This includes * characters that are valid ASCII characters in HTML documents, such as `#`. * * To get a more compact output, consider using the `encodeNonAsciiHTML` * function, which will only encode characters that are not valid in HTML * documents, as well as non-ASCII characters. * * If a character has no equivalent entity, a numeric hexadecimal reference * (eg. `ü`) will be used. */ function encodeHTML(data) { return encodeHTMLTrieRe(htmlReplacer, data); } exports.encodeHTML = encodeHTML; /** * Encodes all non-ASCII characters, as well as characters not valid in HTML * documents using HTML entities. This function will not encode characters that * are valid in HTML documents, such as `#`. * * If a character has no equivalent entity, a numeric hexadecimal reference * (eg. `ü`) will be used. */ function encodeNonAsciiHTML(data) { return encodeHTMLTrieRe(escape_js_1.xmlReplacer, data); } exports.encodeNonAsciiHTML = encodeNonAsciiHTML; function encodeHTMLTrieRe(regExp, str) { var ret = ""; var lastIdx = 0; var match; while ((match = regExp.exec(str)) !== null) { var i = match.index; ret += str.substring(lastIdx, i); var char = str.charCodeAt(i); var next = encode_html_js_1.default.get(char); if (typeof next === "object") { // We are in a branch. Try to match the next char. if (i + 1 < str.length) { var nextChar = str.charCodeAt(i + 1); var value = typeof next.n === "number" ? next.n === nextChar ? next.o : undefined : next.n.get(nextChar); if (value !== undefined) { ret += value; lastIdx = regExp.lastIndex += 1; continue; } } next = next.v; } // We might have a tree node without a value; skip and use a numeric entity. if (next !== undefined) { ret += next; lastIdx = i + 1; } else { var cp = (0, escape_js_1.getCodePoint)(str, i); ret += "&#x".concat(cp.toString(16), ";"); // Increase by 1 if we have a surrogate pair lastIdx = regExp.lastIndex += Number(cp !== char); } } return ret + str.substr(lastIdx); } /***/ }), /***/ "../../../node_modules/entities/lib/escape.js": /*!****************************************************!*\ !*** ../../../node_modules/entities/lib/escape.js ***! \****************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.getCodePoint = exports.xmlReplacer = void 0; exports.xmlReplacer = /["&'<>$\x80-\uFFFF]/g; var xmlCodeMap = new Map([[34, """], [38, "&"], [39, "'"], [60, "<"], [62, ">"]]); // For compatibility with node < 4, we wrap `codePointAt` exports.getCodePoint = // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition String.prototype.codePointAt != null ? function (str, index) { return str.codePointAt(index); } : // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae function (c, index) { return (c.charCodeAt(index) & 0xfc00) === 0xd800 ? (c.charCodeAt(index) - 0xd800) * 0x400 + c.charCodeAt(index + 1) - 0xdc00 + 0x10000 : c.charCodeAt(index); }; /** * Encodes all non-ASCII characters, as well as characters not valid in XML * documents using XML entities. * * If a character has no equivalent entity, a * numeric hexadecimal reference (eg. `ü`) will be used. */ function encodeXML(str) { var ret = ""; var lastIdx = 0; var match; while ((match = exports.xmlReplacer.exec(str)) !== null) { var i = match.index; var char = str.charCodeAt(i); var next = xmlCodeMap.get(char); if (next !== undefined) { ret += str.substring(lastIdx, i) + next; lastIdx = i + 1; } else { ret += "".concat(str.substring(lastIdx, i), "&#x").concat((0, exports.getCodePoint)(str, i).toString(16), ";"); // Increase by 1 if we have a surrogate pair lastIdx = exports.xmlReplacer.lastIndex += Number((char & 0xfc00) === 0xd800); } } return ret + str.substr(lastIdx); } exports.encodeXML = encodeXML; /** * Encodes all non-ASCII characters, as well as characters not valid in XML * documents using numeric hexadecimal reference (eg. `ü`). * * Have a look at `escapeUTF8` if you want a more concise output at the expense * of reduced transportability. * * @param data String to escape. */ exports.escape = encodeXML; /** * Creates a function that escapes all characters matched by the given regular * expression using the given map of characters to escape to their entities. * * @param regex Regular expression to match characters to escape. * @param map Map of characters to escape to their entities. * * @returns Function that escapes all characters matched by the given regular * expression using the given map of characters to escape to their entities. */ function getEscaper(regex, map) { return function escape(data) { var match; var lastIdx = 0; var result = ""; while (match = regex.exec(data)) { if (lastIdx !== match.index) { result += data.substring(lastIdx, match.index); } // We know that this character will be in the map. result += map.get(match[0].charCodeAt(0)); // Every match will be of length 1 lastIdx = match.index + 1; } return result + data.substring(lastIdx); }; } /** * Encodes all characters not valid in XML documents using XML entities. * * Note that the output will be character-set dependent. * * @param data String to escape. */ exports.escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap); /** * Encodes all characters that have to be escaped in HTML attributes, * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. * * @param data String to escape. */ exports.escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([[34, """], [38, "&"], [160, " "]])); /** * Encodes all characters that have to be escaped in HTML text, * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. * * @param data String to escape. */ exports.escapeText = getEscaper(/[&<>\u00A0]/g, new Map([[38, "&"], [60, "<"], [62, ">"], [160, " "]])); /***/ }), /***/ "../../../node_modules/entities/lib/generated/decode-data-html.js": /*!************************************************************************!*\ !*** ../../../node_modules/entities/lib/generated/decode-data-html.js ***! \************************************************************************/ /***/ (function(__unused_webpack_module, exports) { // Generated using scripts/write-decode-map.ts Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = new Uint16Array( // prettier-ignore "\u1d41<\xd5\u0131\u028a\u049d\u057b\u05d0\u0675\u06de\u07a2\u07d6\u080f\u0a4a\u0a91\u0da1\u0e6d\u0f09\u0f26\u10ca\u1228\u12e1\u1415\u149d\u14c3\u14df\u1525\0\0\0\0\0\0\u156b\u16cd\u198d\u1c12\u1ddd\u1f7e\u2060\u21b0\u228d\u23c0\u23fb\u2442\u2824\u2912\u2d08\u2e48\u2fce\u3016\u32ba\u3639\u37ac\u38fe\u3a28\u3a71\u3ae0\u3b2e\u0800EMabcfglmnoprstu\\bfms\x7f\x84\x8b\x90\x95\x98\xa6\xb3\xb9\xc8\xcflig\u803b\xc6\u40c6P\u803b&\u4026cute\u803b\xc1\u40c1reve;\u4102\u0100iyx}rc\u803b\xc2\u40c2;\u4410r;\uc000\ud835\udd04rave\u803b\xc0\u40c0pha;\u4391acr;\u4100d;\u6a53\u0100gp\x9d\xa1on;\u4104f;\uc000\ud835\udd38plyFunction;\u6061ing\u803b\xc5\u40c5\u0100cs\xbe\xc3r;\uc000\ud835\udc9cign;\u6254ilde\u803b\xc3\u40c3ml\u803b\xc4\u40c4\u0400aceforsu\xe5\xfb\xfe\u0117\u011c\u0122\u0127\u012a\u0100cr\xea\xf2kslash;\u6216\u0176\xf6\xf8;\u6ae7ed;\u6306y;\u4411\u0180crt\u0105\u010b\u0114ause;\u6235noullis;\u612ca;\u4392r;\uc000\ud835\udd05pf;\uc000\ud835\udd39eve;\u42d8c\xf2\u0113mpeq;\u624e\u0700HOacdefhilorsu\u014d\u0151\u0156\u0180\u019e\u01a2\u01b5\u01b7\u01ba\u01dc\u0215\u0273\u0278\u027ecy;\u4427PY\u803b\xa9\u40a9\u0180cpy\u015d\u0162\u017aute;\u4106\u0100;i\u0167\u0168\u62d2talDifferentialD;\u6145leys;\u612d\u0200aeio\u0189\u018e\u0194\u0198ron;\u410cdil\u803b\xc7\u40c7rc;\u4108nint;\u6230ot;\u410a\u0100dn\u01a7\u01adilla;\u40b8terDot;\u40b7\xf2\u017fi;\u43a7rcle\u0200DMPT\u01c7\u01cb\u01d1\u01d6ot;\u6299inus;\u6296lus;\u6295imes;\u6297o\u0100cs\u01e2\u01f8kwiseContourIntegral;\u6232eCurly\u0100DQ\u0203\u020foubleQuote;\u601duote;\u6019\u0200lnpu\u021e\u0228\u0247\u0255on\u0100;e\u0225\u0226\u6237;\u6a74\u0180git\u022f\u0236\u023aruent;\u6261nt;\u622fourIntegral;\u622e\u0100fr\u024c\u024e;\u6102oduct;\u6210nterClockwiseContourIntegral;\u6233oss;\u6a2fcr;\uc000\ud835\udc9ep\u0100;C\u0284\u0285\u62d3ap;\u624d\u0580DJSZacefios\u02a0\u02ac\u02b0\u02b4\u02b8\u02cb\u02d7\u02e1\u02e6\u0333\u048d\u0100;o\u0179\u02a5trahd;\u6911cy;\u4402cy;\u4405cy;\u440f\u0180grs\u02bf\u02c4\u02c7ger;\u6021r;\u61a1hv;\u6ae4\u0100ay\u02d0\u02d5ron;\u410e;\u4414l\u0100;t\u02dd\u02de\u6207a;\u4394r;\uc000\ud835\udd07\u0100af\u02eb\u0327\u0100cm\u02f0\u0322ritical\u0200ADGT\u0300\u0306\u0316\u031ccute;\u40b4o\u0174\u030b\u030d;\u42d9bleAcute;\u42ddrave;\u4060ilde;\u42dcond;\u62c4ferentialD;\u6146\u0470\u033d\0\0\0\u0342\u0354\0\u0405f;\uc000\ud835\udd3b\u0180;DE\u0348\u0349\u034d\u40a8ot;\u60dcqual;\u6250ble\u0300CDLRUV\u0363\u0372\u0382\u03cf\u03e2\u03f8ontourIntegra\xec\u0239o\u0274\u0379\0\0\u037b\xbb\u0349nArrow;\u61d3\u0100eo\u0387\u03a4ft\u0180ART\u0390\u0396\u03a1rrow;\u61d0ightArrow;\u61d4e\xe5\u02cang\u0100LR\u03ab\u03c4eft\u0100AR\u03b3\u03b9rrow;\u67f8ightArrow;\u67faightArrow;\u67f9ight\u0100AT\u03d8\u03derrow;\u61d2ee;\u62a8p\u0241\u03e9\0\0\u03efrrow;\u61d1ownArrow;\u61d5erticalBar;\u6225n\u0300ABLRTa\u0412\u042a\u0430\u045e\u047f\u037crrow\u0180;BU\u041d\u041e\u0422\u6193ar;\u6913pArrow;\u61f5reve;\u4311eft\u02d2\u043a\0\u0446\0\u0450ightVector;\u6950eeVector;\u695eector\u0100;B\u0459\u045a\u61bdar;\u6956ight\u01d4\u0467\0\u0471eeVector;\u695fector\u0100;B\u047a\u047b\u61c1ar;\u6957ee\u0100;A\u0486\u0487\u62a4rrow;\u61a7\u0100ct\u0492\u0497r;\uc000\ud835\udc9frok;\u4110\u0800NTacdfglmopqstux\u04bd\u04c0\u04c4\u04cb\u04de\u04e2\u04e7\u04ee\u04f5\u0521\u052f\u0536\u0552\u055d\u0560\u0565G;\u414aH\u803b\xd0\u40d0cute\u803b\xc9\u40c9\u0180aiy\u04d2\u04d7\u04dcron;\u411arc\u803b\xca\u40ca;\u442dot;\u4116r;\uc000\ud835\udd08rave\u803b\xc8\u40c8ement;\u6208\u0100ap\u04fa\u04fecr;\u4112ty\u0253\u0506\0\0\u0512mallSquare;\u65fberySmallSquare;\u65ab\u0100gp\u0526\u052aon;\u4118f;\uc000\ud835\udd3csilon;\u4395u\u0100ai\u053c\u0549l\u0100;T\u0542\u0543\u6a75ilde;\u6242librium;\u61cc\u0100ci\u0557\u055ar;\u6130m;\u6a73a;\u4397ml\u803b\xcb\u40cb\u0100ip\u056a\u056fsts;\u6203onentialE;\u6147\u0280cfios\u0585\u0588\u058d\u05b2\u05ccy;\u4424r;\uc000\ud835\udd09lled\u0253\u0597\0\0\u05a3mallSquare;\u65fcerySmallSquare;\u65aa\u0370\u05ba\0\u05bf\0\0\u05c4f;\uc000\ud835\udd3dAll;\u6200riertrf;\u6131c\xf2\u05cb\u0600JTabcdfgorst\u05e8\u05ec\u05ef\u05fa\u0600\u0612\u0616\u061b\u061d\u0623\u066c\u0672cy;\u4403\u803b>\u403emma\u0100;d\u05f7\u05f8\u4393;\u43dcreve;\u411e\u0180eiy\u0607\u060c\u0610dil;\u4122rc;\u411c;\u4413ot;\u4120r;\uc000\ud835\udd0a;\u62d9pf;\uc000\ud835\udd3eeater\u0300EFGLST\u0635\u0644\u064e\u0656\u065b\u0666qual\u0100;L\u063e\u063f\u6265ess;\u62dbullEqual;\u6267reater;\u6aa2ess;\u6277lantEqual;\u6a7eilde;\u6273cr;\uc000\ud835\udca2;\u626b\u0400Aacfiosu\u0685\u068b\u0696\u069b\u069e\u06aa\u06be\u06caRDcy;\u442a\u0100ct\u0690\u0694ek;\u42c7;\u405eirc;\u4124r;\u610clbertSpace;\u610b\u01f0\u06af\0\u06b2f;\u610dizontalLine;\u6500\u0100ct\u06c3\u06c5\xf2\u06a9rok;\u4126mp\u0144\u06d0\u06d8ownHum\xf0\u012fqual;\u624f\u0700EJOacdfgmnostu\u06fa\u06fe\u0703\u0707\u070e\u071a\u071e\u0721\u0728\u0744\u0778\u078b\u078f\u0795cy;\u4415lig;\u4132cy;\u4401cute\u803b\xcd\u40cd\u0100iy\u0713\u0718rc\u803b\xce\u40ce;\u4418ot;\u4130r;\u6111rave\u803b\xcc\u40cc\u0180;ap\u0720\u072f\u073f\u0100cg\u0734\u0737r;\u412ainaryI;\u6148lie\xf3\u03dd\u01f4\u0749\0\u0762\u0100;e\u074d\u074e\u622c\u0100gr\u0753\u0758ral;\u622bsection;\u62c2isible\u0100CT\u076c\u0772omma;\u6063imes;\u6062\u0180gpt\u077f\u0783\u0788on;\u412ef;\uc000\ud835\udd40a;\u4399cr;\u6110ilde;\u4128\u01eb\u079a\0\u079ecy;\u4406l\u803b\xcf\u40cf\u0280cfosu\u07ac\u07b7\u07bc\u07c2\u07d0\u0100iy\u07b1\u07b5rc;\u4134;\u4419r;\uc000\ud835\udd0dpf;\uc000\ud835\udd41\u01e3\u07c7\0\u07ccr;\uc000\ud835\udca5rcy;\u4408kcy;\u4404\u0380HJacfos\u07e4\u07e8\u07ec\u07f1\u07fd\u0802\u0808cy;\u4425cy;\u440cppa;\u439a\u0100ey\u07f6\u07fbdil;\u4136;\u441ar;\uc000\ud835\udd0epf;\uc000\ud835\udd42cr;\uc000\ud835\udca6\u0580JTaceflmost\u0825\u0829\u082c\u0850\u0863\u09b3\u09b8\u09c7\u09cd\u0a37\u0a47cy;\u4409\u803b<\u403c\u0280cmnpr\u0837\u083c\u0841\u0844\u084dute;\u4139bda;\u439bg;\u67ealacetrf;\u6112r;\u619e\u0180aey\u0857\u085c\u0861ron;\u413ddil;\u413b;\u441b\u0100fs\u0868\u0970t\u0500ACDFRTUVar\u087e\u08a9\u08b1\u08e0\u08e6\u08fc\u092f\u095b\u0390\u096a\u0100nr\u0883\u088fgleBracket;\u67e8row\u0180;BR\u0899\u089a\u089e\u6190ar;\u61e4ightArrow;\u61c6eiling;\u6308o\u01f5\u08b7\0\u08c3bleBracket;\u67e6n\u01d4\u08c8\0\u08d2eeVector;\u6961ector\u0100;B\u08db\u08dc\u61c3ar;\u6959loor;\u630aight\u0100AV\u08ef\u08f5rrow;\u6194ector;\u694e\u0100er\u0901\u0917e\u0180;AV\u0909\u090a\u0910\u62a3rrow;\u61a4ector;\u695aiangle\u0180;BE\u0924\u0925\u0929\u62b2ar;\u69cfqual;\u62b4p\u0180DTV\u0937\u0942\u094cownVector;\u6951eeVector;\u6960ector\u0100;B\u0956\u0957\u61bfar;\u6958ector\u0100;B\u0965\u0966\u61bcar;\u6952ight\xe1\u039cs\u0300EFGLST\u097e\u098b\u0995\u099d\u09a2\u09adqualGreater;\u62daullEqual;\u6266reater;\u6276ess;\u6aa1lantEqual;\u6a7dilde;\u6272r;\uc000\ud835\udd0f\u0100;e\u09bd\u09be\u62d8ftarrow;\u61daidot;\u413f\u0180npw\u09d4\u0a16\u0a1bg\u0200LRlr\u09de\u09f7\u0a02\u0a10eft\u0100AR\u09e6\u09ecrrow;\u67f5ightArrow;\u67f7ightArrow;\u67f6eft\u0100ar\u03b3\u0a0aight\xe1\u03bfight\xe1\u03caf;\uc000\ud835\udd43er\u0100LR\u0a22\u0a2ceftArrow;\u6199ightArrow;\u6198\u0180cht\u0a3e\u0a40\u0a42\xf2\u084c;\u61b0rok;\u4141;\u626a\u0400acefiosu\u0a5a\u0a5d\u0a60\u0a77\u0a7c\u0a85\u0a8b\u0a8ep;\u6905y;\u441c\u0100dl\u0a65\u0a6fiumSpace;\u605flintrf;\u6133r;\uc000\ud835\udd10nusPlus;\u6213pf;\uc000\ud835\udd44c\xf2\u0a76;\u439c\u0480Jacefostu\u0aa3\u0aa7\u0aad\u0ac0\u0b14\u0b19\u0d91\u0d97\u0d9ecy;\u440acute;\u4143\u0180aey\u0ab4\u0ab9\u0aberon;\u4147dil;\u4145;\u441d\u0180gsw\u0ac7\u0af0\u0b0eative\u0180MTV\u0ad3\u0adf\u0ae8ediumSpace;\u600bhi\u0100cn\u0ae6\u0ad8\xeb\u0ad9eryThi\xee\u0ad9ted\u0100GL\u0af8\u0b06reaterGreate\xf2\u0673essLes\xf3\u0a48Line;\u400ar;\uc000\ud835\udd11\u0200Bnpt\u0b22\u0b28\u0b37\u0b3areak;\u6060BreakingSpace;\u40a0f;\u6115\u0680;CDEGHLNPRSTV\u0b55\u0b56\u0b6a\u0b7c\u0ba1\u0beb\u0c04\u0c5e\u0c84\u0ca6\u0cd8\u0d61\u0d85\u6aec\u0100ou\u0b5b\u0b64ngruent;\u6262pCap;\u626doubleVerticalBar;\u6226\u0180lqx\u0b83\u0b8a\u0b9bement;\u6209ual\u0100;T\u0b92\u0b93\u6260ilde;\uc000\u2242\u0338ists;\u6204reater\u0380;EFGLST\u0bb6\u0bb7\u0bbd\u0bc9\u0bd3\u0bd8\u0be5\u626fqual;\u6271ullEqual;\uc000\u2267\u0338reater;\uc000\u226b\u0338ess;\u6279lantEqual;\uc000\u2a7e\u0338ilde;\u6275ump\u0144\u0bf2\u0bfdownHump;\uc000\u224e\u0338qual;\uc000\u224f\u0338e\u0100fs\u0c0a\u0c27tTriangle\u0180;BE\u0c1a\u0c1b\u0c21\u62eaar;\uc000\u29cf\u0338qual;\u62ecs\u0300;EGLST\u0c35\u0c36\u0c3c\u0c44\u0c4b\u0c58\u626equal;\u6270reater;\u6278ess;\uc000\u226a\u0338lantEqual;\uc000\u2a7d\u0338ilde;\u6274ested\u0100GL\u0c68\u0c79reaterGreater;\uc000\u2aa2\u0338essLess;\uc000\u2aa1\u0338recedes\u0180;ES\u0c92\u0c93\u0c9b\u6280qual;\uc000\u2aaf\u0338lantEqual;\u62e0\u0100ei\u0cab\u0cb9verseElement;\u620cghtTriangle\u0180;BE\u0ccb\u0ccc\u0cd2\u62ebar;\uc000\u29d0\u0338qual;\u62ed\u0100qu\u0cdd\u0d0cuareSu\u0100bp\u0ce8\u0cf9set\u0100;E\u0cf0\u0cf3\uc000\u228f\u0338qual;\u62e2erset\u0100;E\u0d03\u0d06\uc000\u2290\u0338qual;\u62e3\u0180bcp\u0d13\u0d24\u0d4eset\u0100;E\u0d1b\u0d1e\uc000\u2282\u20d2qual;\u6288ceeds\u0200;EST\u0d32\u0d33\u0d3b\u0d46\u6281qual;\uc000\u2ab0\u0338lantEqual;\u62e1ilde;\uc000\u227f\u0338erset\u0100;E\u0d58\u0d5b\uc000\u2283\u20d2qual;\u6289ilde\u0200;EFT\u0d6e\u0d6f\u0d75\u0d7f\u6241qual;\u6244ullEqual;\u6247ilde;\u6249erticalBar;\u6224cr;\uc000\ud835\udca9ilde\u803b\xd1\u40d1;\u439d\u0700Eacdfgmoprstuv\u0dbd\u0dc2\u0dc9\u0dd5\u0ddb\u0de0\u0de7\u0dfc\u0e02\u0e20\u0e22\u0e32\u0e3f\u0e44lig;\u4152cute\u803b\xd3\u40d3\u0100iy\u0dce\u0dd3rc\u803b\xd4\u40d4;\u441eblac;\u4150r;\uc000\ud835\udd12rave\u803b\xd2\u40d2\u0180aei\u0dee\u0df2\u0df6cr;\u414cga;\u43a9cron;\u439fpf;\uc000\ud835\udd46enCurly\u0100DQ\u0e0e\u0e1aoubleQuote;\u601cuote;\u6018;\u6a54\u0100cl\u0e27\u0e2cr;\uc000\ud835\udcaaash\u803b\xd8\u40d8i\u016c\u0e37\u0e3cde\u803b\xd5\u40d5es;\u6a37ml\u803b\xd6\u40d6er\u0100BP\u0e4b\u0e60\u0100ar\u0e50\u0e53r;\u603eac\u0100ek\u0e5a\u0e5c;\u63deet;\u63b4arenthesis;\u63dc\u0480acfhilors\u0e7f\u0e87\u0e8a\u0e8f\u0e92\u0e94\u0e9d\u0eb0\u0efcrtialD;\u6202y;\u441fr;\uc000\ud835\udd13i;\u43a6;\u43a0usMinus;\u40b1\u0100ip\u0ea2\u0eadncareplan\xe5\u069df;\u6119\u0200;eio\u0eb9\u0eba\u0ee0\u0ee4\u6abbcedes\u0200;EST\u0ec8\u0ec9\u0ecf\u0eda\u627aqual;\u6aaflantEqual;\u627cilde;\u627eme;\u6033\u0100dp\u0ee9\u0eeeuct;\u620fortion\u0100;a\u0225\u0ef9l;\u621d\u0100ci\u0f01\u0f06r;\uc000\ud835\udcab;\u43a8\u0200Ufos\u0f11\u0f16\u0f1b\u0f1fOT\u803b\"\u4022r;\uc000\ud835\udd14pf;\u611acr;\uc000\ud835\udcac\u0600BEacefhiorsu\u0f3e\u0f43\u0f47\u0f60\u0f73\u0fa7\u0faa\u0fad\u1096\u10a9\u10b4\u10bearr;\u6910G\u803b\xae\u40ae\u0180cnr\u0f4e\u0f53\u0f56ute;\u4154g;\u67ebr\u0100;t\u0f5c\u0f5d\u61a0l;\u6916\u0180aey\u0f67\u0f6c\u0f71ron;\u4158dil;\u4156;\u4420\u0100;v\u0f78\u0f79\u611cerse\u0100EU\u0f82\u0f99\u0100lq\u0f87\u0f8eement;\u620builibrium;\u61cbpEquilibrium;\u696fr\xbb\u0f79o;\u43a1ght\u0400ACDFTUVa\u0fc1\u0feb\u0ff3\u1022\u1028\u105b\u1087\u03d8\u0100nr\u0fc6\u0fd2gleBracket;\u67e9row\u0180;BL\u0fdc\u0fdd\u0fe1\u6192ar;\u61e5eftArrow;\u61c4eiling;\u6309o\u01f5\u0ff9\0\u1005bleBracket;\u67e7n\u01d4\u100a\0\u1014eeVector;\u695dector\u0100;B\u101d\u101e\u61c2ar;\u6955loor;\u630b\u0100er\u102d\u1043e\u0180;AV\u1035\u1036\u103c\u62a2rrow;\u61a6ector;\u695biangle\u0180;BE\u1050\u1051\u1055\u62b3ar;\u69d0qual;\u62b5p\u0180DTV\u1063\u106e\u1078ownVector;\u694feeVector;\u695cector\u0100;B\u1082\u1083\u61bear;\u6954ector\u0100;B\u1091\u1092\u61c0ar;\u6953\u0100pu\u109b\u109ef;\u611dndImplies;\u6970ightarrow;\u61db\u0100ch\u10b9\u10bcr;\u611b;\u61b1leDelayed;\u69f4\u0680HOacfhimoqstu\u10e4\u10f1\u10f7\u10fd\u1119\u111e\u1151\u1156\u1161\u1167\u11b5\u11bb\u11bf\u0100Cc\u10e9\u10eeHcy;\u4429y;\u4428FTcy;\u442ccute;\u415a\u0280;aeiy\u1108\u1109\u110e\u1113\u1117\u6abcron;\u4160dil;\u415erc;\u415c;\u4421r;\uc000\ud835\udd16ort\u0200DLRU\u112a\u1134\u113e\u1149ownArrow\xbb\u041eeftArrow\xbb\u089aightArrow\xbb\u0fddpArrow;\u6191gma;\u43a3allCircle;\u6218pf;\uc000\ud835\udd4a\u0272\u116d\0\0\u1170t;\u621aare\u0200;ISU\u117b\u117c\u1189\u11af\u65a1ntersection;\u6293u\u0100bp\u118f\u119eset\u0100;E\u1197\u1198\u628fqual;\u6291erset\u0100;E\u11a8\u11a9\u6290qual;\u6292nion;\u6294cr;\uc000\ud835\udcaear;\u62c6\u0200bcmp\u11c8\u11db\u1209\u120b\u0100;s\u11cd\u11ce\u62d0et\u0100;E\u11cd\u11d5qual;\u6286\u0100ch\u11e0\u1205eeds\u0200;EST\u11ed\u11ee\u11f4\u11ff\u627bqual;\u6ab0lantEqual;\u627dilde;\u627fTh\xe1\u0f8c;\u6211\u0180;es\u1212\u1213\u1223\u62d1rset\u0100;E\u121c\u121d\u6283qual;\u6287et\xbb\u1213\u0580HRSacfhiors\u123e\u1244\u1249\u1255\u125e\u1271\u1276\u129f\u12c2\u12c8\u12d1ORN\u803b\xde\u40deADE;\u6122\u0100Hc\u124e\u1252cy;\u440by;\u4426\u0100bu\u125a\u125c;\u4009;\u43a4\u0180aey\u1265\u126a\u126fron;\u4164dil;\u4162;\u4422r;\uc000\ud835\udd17\u0100ei\u127b\u1289\u01f2\u1280\0\u1287efore;\u6234a;\u4398\u0100cn\u128e\u1298kSpace;\uc000\u205f\u200aSpace;\u6009lde\u0200;EFT\u12ab\u12ac\u12b2\u12bc\u623cqual;\u6243ullEqual;\u6245ilde;\u6248pf;\uc000\ud835\udd4bipleDot;\u60db\u0100ct\u12d6\u12dbr;\uc000\ud835\udcafrok;\u4166\u0ae1\u12f7\u130e\u131a\u1326\0\u132c\u1331\0\0\0\0\0\u1338\u133d\u1377\u1385\0\u13ff\u1404\u140a\u1410\u0100cr\u12fb\u1301ute\u803b\xda\u40dar\u0100;o\u1307\u1308\u619fcir;\u6949r\u01e3\u1313\0\u1316y;\u440eve;\u416c\u0100iy\u131e\u1323rc\u803b\xdb\u40db;\u4423blac;\u4170r;\uc000\ud835\udd18rave\u803b\xd9\u40d9acr;\u416a\u0100di\u1341\u1369er\u0100BP\u1348\u135d\u0100ar\u134d\u1350r;\u405fac\u0100ek\u1357\u1359;\u63dfet;\u63b5arenthesis;\u63ddon\u0100;P\u1370\u1371\u62c3lus;\u628e\u0100gp\u137b\u137fon;\u4172f;\uc000\ud835\udd4c\u0400ADETadps\u1395\u13ae\u13b8\u13c4\u03e8\u13d2\u13d7\u13f3rrow\u0180;BD\u1150\u13a0\u13a4ar;\u6912ownArrow;\u61c5ownArrow;\u6195quilibrium;\u696eee\u0100;A\u13cb\u13cc\u62a5rrow;\u61a5own\xe1\u03f3er\u0100LR\u13de\u13e8eftArrow;\u6196ightArrow;\u6197i\u0100;l\u13f9\u13fa\u43d2on;\u43a5ing;\u416ecr;\uc000\ud835\udcb0ilde;\u4168ml\u803b\xdc\u40dc\u0480Dbcdefosv\u1427\u142c\u1430\u1433\u143e\u1485\u148a\u1490\u1496ash;\u62abar;\u6aeby;\u4412ash\u0100;l\u143b\u143c\u62a9;\u6ae6\u0100er\u1443\u1445;\u62c1\u0180bty\u144c\u1450\u147aar;\u6016\u0100;i\u144f\u1455cal\u0200BLST\u1461\u1465\u146a\u1474ar;\u6223ine;\u407ceparator;\u6758ilde;\u6240ThinSpace;\u600ar;\uc000\ud835\udd19pf;\uc000\ud835\udd4dcr;\uc000\ud835\udcb1dash;\u62aa\u0280cefos\u14a7\u14ac\u14b1\u14b6\u14bcirc;\u4174dge;\u62c0r;\uc000\ud835\udd1apf;\uc000\ud835\udd4ecr;\uc000\ud835\udcb2\u0200fios\u14cb\u14d0\u14d2\u14d8r;\uc000\ud835\udd1b;\u439epf;\uc000\ud835\udd4fcr;\uc000\ud835\udcb3\u0480AIUacfosu\u14f1\u14f5\u14f9\u14fd\u1504\u150f\u1514\u151a\u1520cy;\u442fcy;\u4407cy;\u442ecute\u803b\xdd\u40dd\u0100iy\u1509\u150drc;\u4176;\u442br;\uc000\ud835\udd1cpf;\uc000\ud835\udd50cr;\uc000\ud835\udcb4ml;\u4178\u0400Hacdefos\u1535\u1539\u153f\u154b\u154f\u155d\u1560\u1564cy;\u4416cute;\u4179\u0100ay\u1544\u1549ron;\u417d;\u4417ot;\u417b\u01f2\u1554\0\u155boWidt\xe8\u0ad9a;\u4396r;\u6128pf;\u6124cr;\uc000\ud835\udcb5\u0be1\u1583\u158a\u1590\0\u15b0\u15b6\u15bf\0\0\0\0\u15c6\u15db\u15eb\u165f\u166d\0\u1695\u169b\u16b2\u16b9\0\u16becute\u803b\xe1\u40e1reve;\u4103\u0300;Ediuy\u159c\u159d\u15a1\u15a3\u15a8\u15ad\u623e;\uc000\u223e\u0333;\u623frc\u803b\xe2\u40e2te\u80bb\xb4\u0306;\u4430lig\u803b\xe6\u40e6\u0100;r\xb2\u15ba;\uc000\ud835\udd1erave\u803b\xe0\u40e0\u0100ep\u15ca\u15d6\u0100fp\u15cf\u15d4sym;\u6135\xe8\u15d3ha;\u43b1\u0100ap\u15dfc\u0100cl\u15e4\u15e7r;\u4101g;\u6a3f\u0264\u15f0\0\0\u160a\u0280;adsv\u15fa\u15fb\u15ff\u1601\u1607\u6227nd;\u6a55;\u6a5clope;\u6a58;\u6a5a\u0380;elmrsz\u1618\u1619\u161b\u161e\u163f\u164f\u1659\u6220;\u69a4e\xbb\u1619sd\u0100;a\u1625\u1626\u6221\u0461\u1630\u1632\u1634\u1636\u1638\u163a\u163c\u163e;\u69a8;\u69a9;\u69aa;\u69ab;\u69ac;\u69ad;\u69ae;\u69aft\u0100;v\u1645\u1646\u621fb\u0100;d\u164c\u164d\u62be;\u699d\u0100pt\u1654\u1657h;\u6222\xbb\xb9arr;\u637c\u0100gp\u1663\u1667on;\u4105f;\uc000\ud835\udd52\u0380;Eaeiop\u12c1\u167b\u167d\u1682\u1684\u1687\u168a;\u6a70cir;\u6a6f;\u624ad;\u624bs;\u4027rox\u0100;e\u12c1\u1692\xf1\u1683ing\u803b\xe5\u40e5\u0180cty\u16a1\u16a6\u16a8r;\uc000\ud835\udcb6;\u402amp\u0100;e\u12c1\u16af\xf1\u0288ilde\u803b\xe3\u40e3ml\u803b\xe4\u40e4\u0100ci\u16c2\u16c8onin\xf4\u0272nt;\u6a11\u0800Nabcdefiklnoprsu\u16ed\u16f1\u1730\u173c\u1743\u1748\u1778\u177d\u17e0\u17e6\u1839\u1850\u170d\u193d\u1948\u1970ot;\u6aed\u0100cr\u16f6\u171ek\u0200ceps\u1700\u1705\u170d\u1713ong;\u624cpsilon;\u43f6rime;\u6035im\u0100;e\u171a\u171b\u623dq;\u62cd\u0176\u1722\u1726ee;\u62bded\u0100;g\u172c\u172d\u6305e\xbb\u172drk\u0100;t\u135c\u1737brk;\u63b6\u0100oy\u1701\u1741;\u4431quo;\u601e\u0280cmprt\u1753\u175b\u1761\u1764\u1768aus\u0100;e\u010a\u0109ptyv;\u69b0s\xe9\u170cno\xf5\u0113\u0180ahw\u176f\u1771\u1773;\u43b2;\u6136een;\u626cr;\uc000\ud835\udd1fg\u0380costuvw\u178d\u179d\u17b3\u17c1\u17d5\u17db\u17de\u0180aiu\u1794\u1796\u179a\xf0\u0760rc;\u65efp\xbb\u1371\u0180dpt\u17a4\u17a8\u17adot;\u6a00lus;\u6a01imes;\u6a02\u0271\u17b9\0\0\u17becup;\u6a06ar;\u6605riangle\u0100du\u17cd\u17d2own;\u65bdp;\u65b3plus;\u6a04e\xe5\u1444\xe5\u14adarow;\u690d\u0180ako\u17ed\u1826\u1835\u0100cn\u17f2\u1823k\u0180lst\u17fa\u05ab\u1802ozenge;\u69ebriangle\u0200;dlr\u1812\u1813\u1818\u181d\u65b4own;\u65beeft;\u65c2ight;\u65b8k;\u6423\u01b1\u182b\0\u1833\u01b2\u182f\0\u1831;\u6592;\u65914;\u6593ck;\u6588\u0100eo\u183e\u184d\u0100;q\u1843\u1846\uc000=\u20e5uiv;\uc000\u2261\u20e5t;\u6310\u0200ptwx\u1859\u185e\u1867\u186cf;\uc000\ud835\udd53\u0100;t\u13cb\u1863om\xbb\u13cctie;\u62c8\u0600DHUVbdhmptuv\u1885\u1896\u18aa\u18bb\u18d7\u18db\u18ec\u18ff\u1905\u190a\u1910\u1921\u0200LRlr\u188e\u1890\u1892\u1894;\u6557;\u6554;\u6556;\u6553\u0280;DUdu\u18a1\u18a2\u18a4\u18a6\u18a8\u6550;\u6566;\u6569;\u6564;\u6567\u0200LRlr\u18b3\u18b5\u18b7\u18b9;\u655d;\u655a;\u655c;\u6559\u0380;HLRhlr\u18ca\u18cb\u18cd\u18cf\u18d1\u18d3\u18d5\u6551;\u656c;\u6563;\u6560;\u656b;\u6562;\u655fox;\u69c9\u0200LRlr\u18e4\u18e6\u18e8\u18ea;\u6555;\u6552;\u6510;\u650c\u0280;DUdu\u06bd\u18f7\u18f9\u18fb\u18fd;\u6565;\u6568;\u652c;\u6534inus;\u629flus;\u629eimes;\u62a0\u0200LRlr\u1919\u191b\u191d\u191f;\u655b;\u6558;\u6518;\u6514\u0380;HLRhlr\u1930\u1931\u1933\u1935\u1937\u1939\u193b\u6502;\u656a;\u6561;\u655e;\u653c;\u6524;\u651c\u0100ev\u0123\u1942bar\u803b\xa6\u40a6\u0200ceio\u1951\u1956\u195a\u1960r;\uc000\ud835\udcb7mi;\u604fm\u0100;e\u171a\u171cl\u0180;bh\u1968\u1969\u196b\u405c;\u69c5sub;\u67c8\u016c\u1974\u197el\u0100;e\u1979\u197a\u6022t\xbb\u197ap\u0180;Ee\u012f\u1985\u1987;\u6aae\u0100;q\u06dc\u06db\u0ce1\u19a7\0\u19e8\u1a11\u1a15\u1a32\0\u1a37\u1a50\0\0\u1ab4\0\0\u1ac1\0\0\u1b21\u1b2e\u1b4d\u1b52\0\u1bfd\0\u1c0c\u0180cpr\u19ad\u19b2\u19ddute;\u4107\u0300;abcds\u19bf\u19c0\u19c4\u19ca\u19d5\u19d9\u6229nd;\u6a44rcup;\u6a49\u0100au\u19cf\u19d2p;\u6a4bp;\u6a47ot;\u6a40;\uc000\u2229\ufe00\u0100eo\u19e2\u19e5t;\u6041\xee\u0693\u0200aeiu\u19f0\u19fb\u1a01\u1a05\u01f0\u19f5\0\u19f8s;\u6a4don;\u410ddil\u803b\xe7\u40e7rc;\u4109ps\u0100;s\u1a0c\u1a0d\u6a4cm;\u6a50ot;\u410b\u0180dmn\u1a1b\u1a20\u1a26il\u80bb\xb8\u01adptyv;\u69b2t\u8100\xa2;e\u1a2d\u1a2e\u40a2r\xe4\u01b2r;\uc000\ud835\udd20\u0180cei\u1a3d\u1a40\u1a4dy;\u4447ck\u0100;m\u1a47\u1a48\u6713ark\xbb\u1a48;\u43c7r\u0380;Ecefms\u1a5f\u1a60\u1a62\u1a6b\u1aa4\u1aaa\u1aae\u65cb;\u69c3\u0180;el\u1a69\u1a6a\u1a6d\u42c6q;\u6257e\u0261\u1a74\0\0\u1a88rrow\u0100lr\u1a7c\u1a81eft;\u61baight;\u61bb\u0280RSacd\u1a92\u1a94\u1a96\u1a9a\u1a9f\xbb\u0f47;\u64c8st;\u629birc;\u629aash;\u629dnint;\u6a10id;\u6aefcir;\u69c2ubs\u0100;u\u1abb\u1abc\u6663it\xbb\u1abc\u02ec\u1ac7\u1ad4\u1afa\0\u1b0aon\u0100;e\u1acd\u1ace\u403a\u0100;q\xc7\xc6\u026d\u1ad9\0\0\u1ae2a\u0100;t\u1ade\u1adf\u402c;\u4040\u0180;fl\u1ae8\u1ae9\u1aeb\u6201\xee\u1160e\u0100mx\u1af1\u1af6ent\xbb\u1ae9e\xf3\u024d\u01e7\u1afe\0\u1b07\u0100;d\u12bb\u1b02ot;\u6a6dn\xf4\u0246\u0180fry\u1b10\u1b14\u1b17;\uc000\ud835\udd54o\xe4\u0254\u8100\xa9;s\u0155\u1b1dr;\u6117\u0100ao\u1b25\u1b29rr;\u61b5ss;\u6717\u0100cu\u1b32\u1b37r;\uc000\ud835\udcb8\u0100bp\u1b3c\u1b44\u0100;e\u1b41\u1b42\u6acf;\u6ad1\u0100;e\u1b49\u1b4a\u6ad0;\u6ad2dot;\u62ef\u0380delprvw\u1b60\u1b6c\u1b77\u1b82\u1bac\u1bd4\u1bf9arr\u0100lr\u1b68\u1b6a;\u6938;\u6935\u0270\u1b72\0\0\u1b75r;\u62dec;\u62dfarr\u0100;p\u1b7f\u1b80\u61b6;\u693d\u0300;bcdos\u1b8f\u1b90\u1b96\u1ba1\u1ba5\u1ba8\u622arcap;\u6a48\u0100au\u1b9b\u1b9ep;\u6a46p;\u6a4aot;\u628dr;\u6a45;\uc000\u222a\ufe00\u0200alrv\u1bb5\u1bbf\u1bde\u1be3rr\u0100;m\u1bbc\u1bbd\u61b7;\u693cy\u0180evw\u1bc7\u1bd4\u1bd8q\u0270\u1bce\0\0\u1bd2re\xe3\u1b73u\xe3\u1b75ee;\u62ceedge;\u62cfen\u803b\xa4\u40a4earrow\u0100lr\u1bee\u1bf3eft\xbb\u1b80ight\xbb\u1bbde\xe4\u1bdd\u0100ci\u1c01\u1c07onin\xf4\u01f7nt;\u6231lcty;\u632d\u0980AHabcdefhijlorstuwz\u1c38\u1c3b\u1c3f\u1c5d\u1c69\u1c75\u1c8a\u1c9e\u1cac\u1cb7\u1cfb\u1cff\u1d0d\u1d7b\u1d91\u1dab\u1dbb\u1dc6\u1dcdr\xf2\u0381ar;\u6965\u0200glrs\u1c48\u1c4d\u1c52\u1c54ger;\u6020eth;\u6138\xf2\u1133h\u0100;v\u1c5a\u1c5b\u6010\xbb\u090a\u016b\u1c61\u1c67arow;\u690fa\xe3\u0315\u0100ay\u1c6e\u1c73ron;\u410f;\u4434\u0180;ao\u0332\u1c7c\u1c84\u0100gr\u02bf\u1c81r;\u61catseq;\u6a77\u0180glm\u1c91\u1c94\u1c98\u803b\xb0\u40b0ta;\u43b4ptyv;\u69b1\u0100ir\u1ca3\u1ca8sht;\u697f;\uc000\ud835\udd21ar\u0100lr\u1cb3\u1cb5\xbb\u08dc\xbb\u101e\u0280aegsv\u1cc2\u0378\u1cd6\u1cdc\u1ce0m\u0180;os\u0326\u1cca\u1cd4nd\u0100;s\u0326\u1cd1uit;\u6666amma;\u43ddin;\u62f2\u0180;io\u1ce7\u1ce8\u1cf8\u40f7de\u8100\xf7;o\u1ce7\u1cf0ntimes;\u62c7n\xf8\u1cf7cy;\u4452c\u026f\u1d06\0\0\u1d0arn;\u631eop;\u630d\u0280lptuw\u1d18\u1d1d\u1d22\u1d49\u1d55lar;\u4024f;\uc000\ud835\udd55\u0280;emps\u030b\u1d2d\u1d37\u1d3d\u1d42q\u0100;d\u0352\u1d33ot;\u6251inus;\u6238lus;\u6214quare;\u62a1blebarwedg\xe5\xfan\u0180adh\u112e\u1d5d\u1d67ownarrow\xf3\u1c83arpoon\u0100lr\u1d72\u1d76ef\xf4\u1cb4igh\xf4\u1cb6\u0162\u1d7f\u1d85karo\xf7\u0f42\u026f\u1d8a\0\0\u1d8ern;\u631fop;\u630c\u0180cot\u1d98\u1da3\u1da6\u0100ry\u1d9d\u1da1;\uc000\ud835\udcb9;\u4455l;\u69f6rok;\u4111\u0100dr\u1db0\u1db4ot;\u62f1i\u0100;f\u1dba\u1816\u65bf\u0100ah\u1dc0\u1dc3r\xf2\u0429a\xf2\u0fa6angle;\u69a6\u0100ci\u1dd2\u1dd5y;\u445fgrarr;\u67ff\u0900Dacdefglmnopqrstux\u1e01\u1e09\u1e19\u1e38\u0578\u1e3c\u1e49\u1e61\u1e7e\u1ea5\u1eaf\u1ebd\u1ee1\u1f2a\u1f37\u1f44\u1f4e\u1f5a\u0100Do\u1e06\u1d34o\xf4\u1c89\u0100cs\u1e0e\u1e14ute\u803b\xe9\u40e9ter;\u6a6e\u0200aioy\u1e22\u1e27\u1e31\u1e36ron;\u411br\u0100;c\u1e2d\u1e2e\u6256\u803b\xea\u40ealon;\u6255;\u444dot;\u4117\u0100Dr\u1e41\u1e45ot;\u6252;\uc000\ud835\udd22\u0180;rs\u1e50\u1e51\u1e57\u6a9aave\u803b\xe8\u40e8\u0100;d\u1e5c\u1e5d\u6a96ot;\u6a98\u0200;ils\u1e6a\u1e6b\u1e72\u1e74\u6a99nters;\u63e7;\u6113\u0100;d\u1e79\u1e7a\u6a95ot;\u6a97\u0180aps\u1e85\u1e89\u1e97cr;\u4113ty\u0180;sv\u1e92\u1e93\u1e95\u6205et\xbb\u1e93p\u01001;\u1e9d\u1ea4\u0133\u1ea1\u1ea3;\u6004;\u6005\u6003\u0100gs\u1eaa\u1eac;\u414bp;\u6002\u0100gp\u1eb4\u1eb8on;\u4119f;\uc000\ud835\udd56\u0180als\u1ec4\u1ece\u1ed2r\u0100;s\u1eca\u1ecb\u62d5l;\u69e3us;\u6a71i\u0180;lv\u1eda\u1edb\u1edf\u43b5on\xbb\u1edb;\u43f5\u0200csuv\u1eea\u1ef3\u1f0b\u1f23\u0100io\u1eef\u1e31rc\xbb\u1e2e\u0269\u1ef9\0\0\u1efb\xed\u0548ant\u0100gl\u1f02\u1f06tr\xbb\u1e5dess\xbb\u1e7a\u0180aei\u1f12\u1f16\u1f1als;\u403dst;\u625fv\u0100;D\u0235\u1f20D;\u6a78parsl;\u69e5\u0100Da\u1f2f\u1f33ot;\u6253rr;\u6971\u0180cdi\u1f3e\u1f41\u1ef8r;\u612fo\xf4\u0352\u0100ah\u1f49\u1f4b;\u43b7\u803b\xf0\u40f0\u0100mr\u1f53\u1f57l\u803b\xeb\u40ebo;\u60ac\u0180cip\u1f61\u1f64\u1f67l;\u4021s\xf4\u056e\u0100eo\u1f6c\u1f74ctatio\xee\u0559nential\xe5\u0579\u09e1\u1f92\0\u1f9e\0\u1fa1\u1fa7\0\0\u1fc6\u1fcc\0\u1fd3\0\u1fe6\u1fea\u2000\0\u2008\u205allingdotse\xf1\u1e44y;\u4444male;\u6640\u0180ilr\u1fad\u1fb3\u1fc1lig;\u8000\ufb03\u0269\u1fb9\0\0\u1fbdg;\u8000\ufb00ig;\u8000\ufb04;\uc000\ud835\udd23lig;\u8000\ufb01lig;\uc000fj\u0180alt\u1fd9\u1fdc\u1fe1t;\u666dig;\u8000\ufb02ns;\u65b1of;\u4192\u01f0\u1fee\0\u1ff3f;\uc000\ud835\udd57\u0100ak\u05bf\u1ff7\u0100;v\u1ffc\u1ffd\u62d4;\u6ad9artint;\u6a0d\u0100ao\u200c\u2055\u0100cs\u2011\u2052\u03b1\u201a\u2030\u2038\u2045\u2048\0\u2050\u03b2\u2022\u2025\u2027\u202a\u202c\0\u202e\u803b\xbd\u40bd;\u6153\u803b\xbc\u40bc;\u6155;\u6159;\u615b\u01b3\u2034\0\u2036;\u6154;\u6156\u02b4\u203e\u2041\0\0\u2043\u803b\xbe\u40be;\u6157;\u615c5;\u6158\u01b6\u204c\0\u204e;\u615a;\u615d8;\u615el;\u6044wn;\u6322cr;\uc000\ud835\udcbb\u0880Eabcdefgijlnorstv\u2082\u2089\u209f\u20a5\u20b0\u20b4\u20f0\u20f5\u20fa\u20ff\u2103\u2112\u2138\u0317\u213e\u2152\u219e\u0100;l\u064d\u2087;\u6a8c\u0180cmp\u2090\u2095\u209dute;\u41f5ma\u0100;d\u209c\u1cda\u43b3;\u6a86reve;\u411f\u0100iy\u20aa\u20aerc;\u411d;\u4433ot;\u4121\u0200;lqs\u063e\u0642\u20bd\u20c9\u0180;qs\u063e\u064c\u20c4lan\xf4\u0665\u0200;cdl\u0665\u20d2\u20d5\u20e5c;\u6aa9ot\u0100;o\u20dc\u20dd\u6a80\u0100;l\u20e2\u20e3\u6a82;\u6a84\u0100;e\u20ea\u20ed\uc000\u22db\ufe00s;\u6a94r;\uc000\ud835\udd24\u0100;g\u0673\u061bmel;\u6137cy;\u4453\u0200;Eaj\u065a\u210c\u210e\u2110;\u6a92;\u6aa5;\u6aa4\u0200Eaes\u211b\u211d\u2129\u2134;\u6269p\u0100;p\u2123\u2124\u6a8arox\xbb\u2124\u0100;q\u212e\u212f\u6a88\u0100;q\u212e\u211bim;\u62e7pf;\uc000\ud835\udd58\u0100ci\u2143\u2146r;\u610am\u0180;el\u066b\u214e\u2150;\u6a8e;\u6a90\u8300>;cdlqr\u05ee\u2160\u216a\u216e\u2173\u2179\u0100ci\u2165\u2167;\u6aa7r;\u6a7aot;\u62d7Par;\u6995uest;\u6a7c\u0280adels\u2184\u216a\u2190\u0656\u219b\u01f0\u2189\0\u218epro\xf8\u209er;\u6978q\u0100lq\u063f\u2196les\xf3\u2088i\xed\u066b\u0100en\u21a3\u21adrtneqq;\uc000\u2269\ufe00\xc5\u21aa\u0500Aabcefkosy\u21c4\u21c7\u21f1\u21f5\u21fa\u2218\u221d\u222f\u2268\u227dr\xf2\u03a0\u0200ilmr\u21d0\u21d4\u21d7\u21dbrs\xf0\u1484f\xbb\u2024il\xf4\u06a9\u0100dr\u21e0\u21e4cy;\u444a\u0180;cw\u08f4\u21eb\u21efir;\u6948;\u61adar;\u610firc;\u4125\u0180alr\u2201\u220e\u2213rts\u0100;u\u2209\u220a\u6665it\xbb\u220alip;\u6026con;\u62b9r;\uc000\ud835\udd25s\u0100ew\u2223\u2229arow;\u6925arow;\u6926\u0280amopr\u223a\u223e\u2243\u225e\u2263rr;\u61fftht;\u623bk\u0100lr\u2249\u2253eftarrow;\u61a9ightarrow;\u61aaf;\uc000\ud835\udd59bar;\u6015\u0180clt\u226f\u2274\u2278r;\uc000\ud835\udcbdas\xe8\u21f4rok;\u4127\u0100bp\u2282\u2287ull;\u6043hen\xbb\u1c5b\u0ae1\u22a3\0\u22aa\0\u22b8\u22c5\u22ce\0\u22d5\u22f3\0\0\u22f8\u2322\u2367\u2362\u237f\0\u2386\u23aa\u23b4cute\u803b\xed\u40ed\u0180;iy\u0771\u22b0\u22b5rc\u803b\xee\u40ee;\u4438\u0100cx\u22bc\u22bfy;\u4435cl\u803b\xa1\u40a1\u0100fr\u039f\u22c9;\uc000\ud835\udd26rave\u803b\xec\u40ec\u0200;ino\u073e\u22dd\u22e9\u22ee\u0100in\u22e2\u22e6nt;\u6a0ct;\u622dfin;\u69dcta;\u6129lig;\u4133\u0180aop\u22fe\u231a\u231d\u0180cgt\u2305\u2308\u2317r;\u412b\u0180elp\u071f\u230f\u2313in\xe5\u078ear\xf4\u0720h;\u4131f;\u62b7ed;\u41b5\u0280;cfot\u04f4\u232c\u2331\u233d\u2341are;\u6105in\u0100;t\u2338\u2339\u621eie;\u69dddo\xf4\u2319\u0280;celp\u0757\u234c\u2350\u235b\u2361al;\u62ba\u0100gr\u2355\u2359er\xf3\u1563\xe3\u234darhk;\u6a17rod;\u6a3c\u0200cgpt\u236f\u2372\u2376\u237by;\u4451on;\u412ff;\uc000\ud835\udd5aa;\u43b9uest\u803b\xbf\u40bf\u0100ci\u238a\u238fr;\uc000\ud835\udcben\u0280;Edsv\u04f4\u239b\u239d\u23a1\u04f3;\u62f9ot;\u62f5\u0100;v\u23a6\u23a7\u62f4;\u62f3\u0100;i\u0777\u23aelde;\u4129\u01eb\u23b8\0\u23bccy;\u4456l\u803b\xef\u40ef\u0300cfmosu\u23cc\u23d7\u23dc\u23e1\u23e7\u23f5\u0100iy\u23d1\u23d5rc;\u4135;\u4439r;\uc000\ud835\udd27ath;\u4237pf;\uc000\ud835\udd5b\u01e3\u23ec\0\u23f1r;\uc000\ud835\udcbfrcy;\u4458kcy;\u4454\u0400acfghjos\u240b\u2416\u2422\u2427\u242d\u2431\u2435\u243bppa\u0100;v\u2413\u2414\u43ba;\u43f0\u0100ey\u241b\u2420dil;\u4137;\u443ar;\uc000\ud835\udd28reen;\u4138cy;\u4445cy;\u445cpf;\uc000\ud835\udd5ccr;\uc000\ud835\udcc0\u0b80ABEHabcdefghjlmnoprstuv\u2470\u2481\u2486\u248d\u2491\u250e\u253d\u255a\u2580\u264e\u265e\u2665\u2679\u267d\u269a\u26b2\u26d8\u275d\u2768\u278b\u27c0\u2801\u2812\u0180art\u2477\u247a\u247cr\xf2\u09c6\xf2\u0395ail;\u691barr;\u690e\u0100;g\u0994\u248b;\u6a8bar;\u6962\u0963\u24a5\0\u24aa\0\u24b1\0\0\0\0\0\u24b5\u24ba\0\u24c6\u24c8\u24cd\0\u24f9ute;\u413amptyv;\u69b4ra\xee\u084cbda;\u43bbg\u0180;dl\u088e\u24c1\u24c3;\u6991\xe5\u088e;\u6a85uo\u803b\xab\u40abr\u0400;bfhlpst\u0899\u24de\u24e6\u24e9\u24eb\u24ee\u24f1\u24f5\u0100;f\u089d\u24e3s;\u691fs;\u691d\xeb\u2252p;\u61abl;\u6939im;\u6973l;\u61a2\u0180;ae\u24ff\u2500\u2504\u6aabil;\u6919\u0100;s\u2509\u250a\u6aad;\uc000\u2aad\ufe00\u0180abr\u2515\u2519\u251drr;\u690crk;\u6772\u0100ak\u2522\u252cc\u0100ek\u2528\u252a;\u407b;\u405b\u0100es\u2531\u2533;\u698bl\u0100du\u2539\u253b;\u698f;\u698d\u0200aeuy\u2546\u254b\u2556\u2558ron;\u413e\u0100di\u2550\u2554il;\u413c\xec\u08b0\xe2\u2529;\u443b\u0200cqrs\u2563\u2566\u256d\u257da;\u6936uo\u0100;r\u0e19\u1746\u0100du\u2572\u2577har;\u6967shar;\u694bh;\u61b2\u0280;fgqs\u258b\u258c\u0989\u25f3\u25ff\u6264t\u0280ahlrt\u2598\u25a4\u25b7\u25c2\u25e8rrow\u0100;t\u0899\u25a1a\xe9\u24f6arpoon\u0100du\u25af\u25b4own\xbb\u045ap\xbb\u0966eftarrows;\u61c7ight\u0180ahs\u25cd\u25d6\u25derrow\u0100;s\u08f4\u08a7arpoon\xf3\u0f98quigarro\xf7\u21f0hreetimes;\u62cb\u0180;qs\u258b\u0993\u25falan\xf4\u09ac\u0280;cdgs\u09ac\u260a\u260d\u261d\u2628c;\u6aa8ot\u0100;o\u2614\u2615\u6a7f\u0100;r\u261a\u261b\u6a81;\u6a83\u0100;e\u2622\u2625\uc000\u22da\ufe00s;\u6a93\u0280adegs\u2633\u2639\u263d\u2649\u264bppro\xf8\u24c6ot;\u62d6q\u0100gq\u2643\u2645\xf4\u0989gt\xf2\u248c\xf4\u099bi\xed\u09b2\u0180ilr\u2655\u08e1\u265asht;\u697c;\uc000\ud835\udd29\u0100;E\u099c\u2663;\u6a91\u0161\u2669\u2676r\u0100du\u25b2\u266e\u0100;l\u0965\u2673;\u696alk;\u6584cy;\u4459\u0280;acht\u0a48\u2688\u268b\u2691\u2696r\xf2\u25c1orne\xf2\u1d08ard;\u696bri;\u65fa\u0100io\u269f\u26a4dot;\u4140ust\u0100;a\u26ac\u26ad\u63b0che\xbb\u26ad\u0200Eaes\u26bb\u26bd\u26c9\u26d4;\u6268p\u0100;p\u26c3\u26c4\u6a89rox\xbb\u26c4\u0100;q\u26ce\u26cf\u6a87\u0100;q\u26ce\u26bbim;\u62e6\u0400abnoptwz\u26e9\u26f4\u26f7\u271a\u272f\u2741\u2747\u2750\u0100nr\u26ee\u26f1g;\u67ecr;\u61fdr\xeb\u08c1g\u0180lmr\u26ff\u270d\u2714eft\u0100ar\u09e6\u2707ight\xe1\u09f2apsto;\u67fcight\xe1\u09fdparrow\u0100lr\u2725\u2729ef\xf4\u24edight;\u61ac\u0180afl\u2736\u2739\u273dr;\u6985;\uc000\ud835\udd5dus;\u6a2dimes;\u6a34\u0161\u274b\u274fst;\u6217\xe1\u134e\u0180;ef\u2757\u2758\u1800\u65cange\xbb\u2758ar\u0100;l\u2764\u2765\u4028t;\u6993\u0280achmt\u2773\u2776\u277c\u2785\u2787r\xf2\u08a8orne\xf2\u1d8car\u0100;d\u0f98\u2783;\u696d;\u600eri;\u62bf\u0300achiqt\u2798\u279d\u0a40\u27a2\u27ae\u27bbquo;\u6039r;\uc000\ud835\udcc1m\u0180;eg\u09b2\u27aa\u27ac;\u6a8d;\u6a8f\u0100bu\u252a\u27b3o\u0100;r\u0e1f\u27b9;\u601arok;\u4142\u8400<;cdhilqr\u082b\u27d2\u2639\u27dc\u27e0\u27e5\u27ea\u27f0\u0100ci\u27d7\u27d9;\u6aa6r;\u6a79re\xe5\u25f2mes;\u62c9arr;\u6976uest;\u6a7b\u0100Pi\u27f5\u27f9ar;\u6996\u0180;ef\u2800\u092d\u181b\u65c3r\u0100du\u2807\u280dshar;\u694ahar;\u6966\u0100en\u2817\u2821rtneqq;\uc000\u2268\ufe00\xc5\u281e\u0700Dacdefhilnopsu\u2840\u2845\u2882\u288e\u2893\u28a0\u28a5\u28a8\u28da\u28e2\u28e4\u0a83\u28f3\u2902Dot;\u623a\u0200clpr\u284e\u2852\u2863\u287dr\u803b\xaf\u40af\u0100et\u2857\u2859;\u6642\u0100;e\u285e\u285f\u6720se\xbb\u285f\u0100;s\u103b\u2868to\u0200;dlu\u103b\u2873\u2877\u287bow\xee\u048cef\xf4\u090f\xf0\u13d1ker;\u65ae\u0100oy\u2887\u288cmma;\u6a29;\u443cash;\u6014asuredangle\xbb\u1626r;\uc000\ud835\udd2ao;\u6127\u0180cdn\u28af\u28b4\u28c9ro\u803b\xb5\u40b5\u0200;acd\u1464\u28bd\u28c0\u28c4s\xf4\u16a7ir;\u6af0ot\u80bb\xb7\u01b5us\u0180;bd\u28d2\u1903\u28d3\u6212\u0100;u\u1d3c\u28d8;\u6a2a\u0163\u28de\u28e1p;\u6adb\xf2\u2212\xf0\u0a81\u0100dp\u28e9\u28eeels;\u62a7f;\uc000\ud835\udd5e\u0100ct\u28f8\u28fdr;\uc000\ud835\udcc2pos\xbb\u159d\u0180;lm\u2909\u290a\u290d\u43bctimap;\u62b8\u0c00GLRVabcdefghijlmoprstuvw\u2942\u2953\u297e\u2989\u2998\u29da\u29e9\u2a15\u2a1a\u2a58\u2a5d\u2a83\u2a95\u2aa4\u2aa8\u2b04\u2b07\u2b44\u2b7f\u2bae\u2c34\u2c67\u2c7c\u2ce9\u0100gt\u2947\u294b;\uc000\u22d9\u0338\u0100;v\u2950\u0bcf\uc000\u226b\u20d2\u0180elt\u295a\u2972\u2976ft\u0100ar\u2961\u2967rrow;\u61cdightarrow;\u61ce;\uc000\u22d8\u0338\u0100;v\u297b\u0c47\uc000\u226a\u20d2ightarrow;\u61cf\u0100Dd\u298e\u2993ash;\u62afash;\u62ae\u0280bcnpt\u29a3\u29a7\u29ac\u29b1\u29ccla\xbb\u02deute;\u4144g;\uc000\u2220\u20d2\u0280;Eiop\u0d84\u29bc\u29c0\u29c5\u29c8;\uc000\u2a70\u0338d;\uc000\u224b\u0338s;\u4149ro\xf8\u0d84ur\u0100;a\u29d3\u29d4\u666el\u0100;s\u29d3\u0b38\u01f3\u29df\0\u29e3p\u80bb\xa0\u0b37mp\u0100;e\u0bf9\u0c00\u0280aeouy\u29f4\u29fe\u2a03\u2a10\u2a13\u01f0\u29f9\0\u29fb;\u6a43on;\u4148dil;\u4146ng\u0100;d\u0d7e\u2a0aot;\uc000\u2a6d\u0338p;\u6a42;\u443dash;\u6013\u0380;Aadqsx\u0b92\u2a29\u2a2d\u2a3b\u2a41\u2a45\u2a50rr;\u61d7r\u0100hr\u2a33\u2a36k;\u6924\u0100;o\u13f2\u13f0ot;\uc000\u2250\u0338ui\xf6\u0b63\u0100ei\u2a4a\u2a4ear;\u6928\xed\u0b98ist\u0100;s\u0ba0\u0b9fr;\uc000\ud835\udd2b\u0200Eest\u0bc5\u2a66\u2a79\u2a7c\u0180;qs\u0bbc\u2a6d\u0be1\u0180;qs\u0bbc\u0bc5\u2a74lan\xf4\u0be2i\xed\u0bea\u0100;r\u0bb6\u2a81\xbb\u0bb7\u0180Aap\u2a8a\u2a8d\u2a91r\xf2\u2971rr;\u61aear;\u6af2\u0180;sv\u0f8d\u2a9c\u0f8c\u0100;d\u2aa1\u2aa2\u62fc;\u62facy;\u445a\u0380AEadest\u2ab7\u2aba\u2abe\u2ac2\u2ac5\u2af6\u2af9r\xf2\u2966;\uc000\u2266\u0338rr;\u619ar;\u6025\u0200;fqs\u0c3b\u2ace\u2ae3\u2aeft\u0100ar\u2ad4\u2ad9rro\xf7\u2ac1ightarro\xf7\u2a90\u0180;qs\u0c3b\u2aba\u2aealan\xf4\u0c55\u0100;s\u0c55\u2af4\xbb\u0c36i\xed\u0c5d\u0100;r\u0c35\u2afei\u0100;e\u0c1a\u0c25i\xe4\u0d90\u0100pt\u2b0c\u2b11f;\uc000\ud835\udd5f\u8180\xac;in\u2b19\u2b1a\u2b36\u40acn\u0200;Edv\u0b89\u2b24\u2b28\u2b2e;\uc000\u22f9\u0338ot;\uc000\u22f5\u0338\u01e1\u0b89\u2b33\u2b35;\u62f7;\u62f6i\u0100;v\u0cb8\u2b3c\u01e1\u0cb8\u2b41\u2b43;\u62fe;\u62fd\u0180aor\u2b4b\u2b63\u2b69r\u0200;ast\u0b7b\u2b55\u2b5a\u2b5flle\xec\u0b7bl;\uc000\u2afd\u20e5;\uc000\u2202\u0338lint;\u6a14\u0180;ce\u0c92\u2b70\u2b73u\xe5\u0ca5\u0100;c\u0c98\u2b78\u0100;e\u0c92\u2b7d\xf1\u0c98\u0200Aait\u2b88\u2b8b\u2b9d\u2ba7r\xf2\u2988rr\u0180;cw\u2b94\u2b95\u2b99\u619b;\uc000\u2933\u0338;\uc000\u219d\u0338ghtarrow\xbb\u2b95ri\u0100;e\u0ccb\u0cd6\u0380chimpqu\u2bbd\u2bcd\u2bd9\u2b04\u0b78\u2be4\u2bef\u0200;cer\u0d32\u2bc6\u0d37\u2bc9u\xe5\u0d45;\uc000\ud835\udcc3ort\u026d\u2b05\0\0\u2bd6ar\xe1\u2b56m\u0100;e\u0d6e\u2bdf\u0100;q\u0d74\u0d73su\u0100bp\u2beb\u2bed\xe5\u0cf8\xe5\u0d0b\u0180bcp\u2bf6\u2c11\u2c19\u0200;Ees\u2bff\u2c00\u0d22\u2c04\u6284;\uc000\u2ac5\u0338et\u0100;e\u0d1b\u2c0bq\u0100;q\u0d23\u2c00c\u0100;e\u0d32\u2c17\xf1\u0d38\u0200;Ees\u2c22\u2c23\u0d5f\u2c27\u6285;\uc000\u2ac6\u0338et\u0100;e\u0d58\u2c2eq\u0100;q\u0d60\u2c23\u0200gilr\u2c3d\u2c3f\u2c45\u2c47\xec\u0bd7lde\u803b\xf1\u40f1\xe7\u0c43iangle\u0100lr\u2c52\u2c5ceft\u0100;e\u0c1a\u2c5a\xf1\u0c26ight\u0100;e\u0ccb\u2c65\xf1\u0cd7\u0100;m\u2c6c\u2c6d\u43bd\u0180;es\u2c74\u2c75\u2c79\u4023ro;\u6116p;\u6007\u0480DHadgilrs\u2c8f\u2c94\u2c99\u2c9e\u2ca3\u2cb0\u2cb6\u2cd3\u2ce3ash;\u62adarr;\u6904p;\uc000\u224d\u20d2ash;\u62ac\u0100et\u2ca8\u2cac;\uc000\u2265\u20d2;\uc000>\u20d2nfin;\u69de\u0180Aet\u2cbd\u2cc1\u2cc5rr;\u6902;\uc000\u2264\u20d2\u0100;r\u2cca\u2ccd\uc000<\u20d2ie;\uc000\u22b4\u20d2\u0100At\u2cd8\u2cdcrr;\u6903rie;\uc000\u22b5\u20d2im;\uc000\u223c\u20d2\u0180Aan\u2cf0\u2cf4\u2d02rr;\u61d6r\u0100hr\u2cfa\u2cfdk;\u6923\u0100;o\u13e7\u13e5ear;\u6927\u1253\u1a95\0\0\0\0\0\0\0\0\0\0\0\0\0\u2d2d\0\u2d38\u2d48\u2d60\u2d65\u2d72\u2d84\u1b07\0\0\u2d8d\u2dab\0\u2dc8\u2dce\0\u2ddc\u2e19\u2e2b\u2e3e\u2e43\u0100cs\u2d31\u1a97ute\u803b\xf3\u40f3\u0100iy\u2d3c\u2d45r\u0100;c\u1a9e\u2d42\u803b\xf4\u40f4;\u443e\u0280abios\u1aa0\u2d52\u2d57\u01c8\u2d5alac;\u4151v;\u6a38old;\u69bclig;\u4153\u0100cr\u2d69\u2d6dir;\u69bf;\uc000\ud835\udd2c\u036f\u2d79\0\0\u2d7c\0\u2d82n;\u42dbave\u803b\xf2\u40f2;\u69c1\u0100bm\u2d88\u0df4ar;\u69b5\u0200acit\u2d95\u2d98\u2da5\u2da8r\xf2\u1a80\u0100ir\u2d9d\u2da0r;\u69beoss;\u69bbn\xe5\u0e52;\u69c0\u0180aei\u2db1\u2db5\u2db9cr;\u414dga;\u43c9\u0180cdn\u2dc0\u2dc5\u01cdron;\u43bf;\u69b6pf;\uc000\ud835\udd60\u0180ael\u2dd4\u2dd7\u01d2r;\u69b7rp;\u69b9\u0380;adiosv\u2dea\u2deb\u2dee\u2e08\u2e0d\u2e10\u2e16\u6228r\xf2\u1a86\u0200;efm\u2df7\u2df8\u2e02\u2e05\u6a5dr\u0100;o\u2dfe\u2dff\u6134f\xbb\u2dff\u803b\xaa\u40aa\u803b\xba\u40bagof;\u62b6r;\u6a56lope;\u6a57;\u6a5b\u0180clo\u2e1f\u2e21\u2e27\xf2\u2e01ash\u803b\xf8\u40f8l;\u6298i\u016c\u2e2f\u2e34de\u803b\xf5\u40f5es\u0100;a\u01db\u2e3as;\u6a36ml\u803b\xf6\u40f6bar;\u633d\u0ae1\u2e5e\0\u2e7d\0\u2e80\u2e9d\0\u2ea2\u2eb9\0\0\u2ecb\u0e9c\0\u2f13\0\0\u2f2b\u2fbc\0\u2fc8r\u0200;ast\u0403\u2e67\u2e72\u0e85\u8100\xb6;l\u2e6d\u2e6e\u40b6le\xec\u0403\u0269\u2e78\0\0\u2e7bm;\u6af3;\u6afdy;\u443fr\u0280cimpt\u2e8b\u2e8f\u2e93\u1865\u2e97nt;\u4025od;\u402eil;\u6030enk;\u6031r;\uc000\ud835\udd2d\u0180imo\u2ea8\u2eb0\u2eb4\u0100;v\u2ead\u2eae\u43c6;\u43d5ma\xf4\u0a76ne;\u660e\u0180;tv\u2ebf\u2ec0\u2ec8\u43c0chfork\xbb\u1ffd;\u43d6\u0100au\u2ecf\u2edfn\u0100ck\u2ed5\u2eddk\u0100;h\u21f4\u2edb;\u610e\xf6\u21f4s\u0480;abcdemst\u2ef3\u2ef4\u1908\u2ef9\u2efd\u2f04\u2f06\u2f0a\u2f0e\u402bcir;\u6a23ir;\u6a22\u0100ou\u1d40\u2f02;\u6a25;\u6a72n\u80bb\xb1\u0e9dim;\u6a26wo;\u6a27\u0180ipu\u2f19\u2f20\u2f25ntint;\u6a15f;\uc000\ud835\udd61nd\u803b\xa3\u40a3\u0500;Eaceinosu\u0ec8\u2f3f\u2f41\u2f44\u2f47\u2f81\u2f89\u2f92\u2f7e\u2fb6;\u6ab3p;\u6ab7u\xe5\u0ed9\u0100;c\u0ece\u2f4c\u0300;acens\u0ec8\u2f59\u2f5f\u2f66\u2f68\u2f7eppro\xf8\u2f43urlye\xf1\u0ed9\xf1\u0ece\u0180aes\u2f6f\u2f76\u2f7approx;\u6ab9qq;\u6ab5im;\u62e8i\xed\u0edfme\u0100;s\u2f88\u0eae\u6032\u0180Eas\u2f78\u2f90\u2f7a\xf0\u2f75\u0180dfp\u0eec\u2f99\u2faf\u0180als\u2fa0\u2fa5\u2faalar;\u632eine;\u6312urf;\u6313\u0100;t\u0efb\u2fb4\xef\u0efbrel;\u62b0\u0100ci\u2fc0\u2fc5r;\uc000\ud835\udcc5;\u43c8ncsp;\u6008\u0300fiopsu\u2fda\u22e2\u2fdf\u2fe5\u2feb\u2ff1r;\uc000\ud835\udd2epf;\uc000\ud835\udd62rime;\u6057cr;\uc000\ud835\udcc6\u0180aeo\u2ff8\u3009\u3013t\u0100ei\u2ffe\u3005rnion\xf3\u06b0nt;\u6a16st\u0100;e\u3010\u3011\u403f\xf1\u1f19\xf4\u0f14\u0a80ABHabcdefhilmnoprstux\u3040\u3051\u3055\u3059\u30e0\u310e\u312b\u3147\u3162\u3172\u318e\u3206\u3215\u3224\u3229\u3258\u326e\u3272\u3290\u32b0\u32b7\u0180art\u3047\u304a\u304cr\xf2\u10b3\xf2\u03ddail;\u691car\xf2\u1c65ar;\u6964\u0380cdenqrt\u3068\u3075\u3078\u307f\u308f\u3094\u30cc\u0100eu\u306d\u3071;\uc000\u223d\u0331te;\u4155i\xe3\u116emptyv;\u69b3g\u0200;del\u0fd1\u3089\u308b\u308d;\u6992;\u69a5\xe5\u0fd1uo\u803b\xbb\u40bbr\u0580;abcfhlpstw\u0fdc\u30ac\u30af\u30b7\u30b9\u30bc\u30be\u30c0\u30c3\u30c7\u30cap;\u6975\u0100;f\u0fe0\u30b4s;\u6920;\u6933s;\u691e\xeb\u225d\xf0\u272el;\u6945im;\u6974l;\u61a3;\u619d\u0100ai\u30d1\u30d5il;\u691ao\u0100;n\u30db\u30dc\u6236al\xf3\u0f1e\u0180abr\u30e7\u30ea\u30eer\xf2\u17e5rk;\u6773\u0100ak\u30f3\u30fdc\u0100ek\u30f9\u30fb;\u407d;\u405d\u0100es\u3102\u3104;\u698cl\u0100du\u310a\u310c;\u698e;\u6990\u0200aeuy\u3117\u311c\u3127\u3129ron;\u4159\u0100di\u3121\u3125il;\u4157\xec\u0ff2\xe2\u30fa;\u4440\u0200clqs\u3134\u3137\u313d\u3144a;\u6937dhar;\u6969uo\u0100;r\u020e\u020dh;\u61b3\u0180acg\u314e\u315f\u0f44l\u0200;ips\u0f78\u3158\u315b\u109cn\xe5\u10bbar\xf4\u0fa9t;\u65ad\u0180ilr\u3169\u1023\u316esht;\u697d;\uc000\ud835\udd2f\u0100ao\u3177\u3186r\u0100du\u317d\u317f\xbb\u047b\u0100;l\u1091\u3184;\u696c\u0100;v\u318b\u318c\u43c1;\u43f1\u0180gns\u3195\u31f9\u31fcht\u0300ahlrst\u31a4\u31b0\u31c2\u31d8\u31e4\u31eerrow\u0100;t\u0fdc\u31ada\xe9\u30c8arpoon\u0100du\u31bb\u31bfow\xee\u317ep\xbb\u1092eft\u0100ah\u31ca\u31d0rrow\xf3\u0feaarpoon\xf3\u0551ightarrows;\u61c9quigarro\xf7\u30cbhreetimes;\u62ccg;\u42daingdotse\xf1\u1f32\u0180ahm\u320d\u3210\u3213r\xf2\u0feaa\xf2\u0551;\u600foust\u0100;a\u321e\u321f\u63b1che\xbb\u321fmid;\u6aee\u0200abpt\u3232\u323d\u3240\u3252\u0100nr\u3237\u323ag;\u67edr;\u61fer\xeb\u1003\u0180afl\u3247\u324a\u324er;\u6986;\uc000\ud835\udd63us;\u6a2eimes;\u6a35\u0100ap\u325d\u3267r\u0100;g\u3263\u3264\u4029t;\u6994olint;\u6a12ar\xf2\u31e3\u0200achq\u327b\u3280\u10bc\u3285quo;\u603ar;\uc000\ud835\udcc7\u0100bu\u30fb\u328ao\u0100;r\u0214\u0213\u0180hir\u3297\u329b\u32a0re\xe5\u31f8mes;\u62cai\u0200;efl\u32aa\u1059\u1821\u32ab\u65b9tri;\u69celuhar;\u6968;\u611e\u0d61\u32d5\u32db\u32df\u332c\u3338\u3371\0\u337a\u33a4\0\0\u33ec\u33f0\0\u3428\u3448\u345a\u34ad\u34b1\u34ca\u34f1\0\u3616\0\0\u3633cute;\u415bqu\xef\u27ba\u0500;Eaceinpsy\u11ed\u32f3\u32f5\u32ff\u3302\u330b\u330f\u331f\u3326\u3329;\u6ab4\u01f0\u32fa\0\u32fc;\u6ab8on;\u4161u\xe5\u11fe\u0100;d\u11f3\u3307il;\u415frc;\u415d\u0180Eas\u3316\u3318\u331b;\u6ab6p;\u6abaim;\u62e9olint;\u6a13i\xed\u1204;\u4441ot\u0180;be\u3334\u1d47\u3335\u62c5;\u6a66\u0380Aacmstx\u3346\u334a\u3357\u335b\u335e\u3363\u336drr;\u61d8r\u0100hr\u3350\u3352\xeb\u2228\u0100;o\u0a36\u0a34t\u803b\xa7\u40a7i;\u403bwar;\u6929m\u0100in\u3369\xf0nu\xf3\xf1t;\u6736r\u0100;o\u3376\u2055\uc000\ud835\udd30\u0200acoy\u3382\u3386\u3391\u33a0rp;\u666f\u0100hy\u338b\u338fcy;\u4449;\u4448rt\u026d\u3399\0\0\u339ci\xe4\u1464ara\xec\u2e6f\u803b\xad\u40ad\u0100gm\u33a8\u33b4ma\u0180;fv\u33b1\u33b2\u33b2\u43c3;\u43c2\u0400;deglnpr\u12ab\u33c5\u33c9\u33ce\u33d6\u33de\u33e1\u33e6ot;\u6a6a\u0100;q\u12b1\u12b0\u0100;E\u33d3\u33d4\u6a9e;\u6aa0\u0100;E\u33db\u33dc\u6a9d;\u6a9fe;\u6246lus;\u6a24arr;\u6972ar\xf2\u113d\u0200aeit\u33f8\u3408\u340f\u3417\u0100ls\u33fd\u3404lsetm\xe9\u336ahp;\u6a33parsl;\u69e4\u0100dl\u1463\u3414e;\u6323\u0100;e\u341c\u341d\u6aaa\u0100;s\u3422\u3423\u6aac;\uc000\u2aac\ufe00\u0180flp\u342e\u3433\u3442tcy;\u444c\u0100;b\u3438\u3439\u402f\u0100;a\u343e\u343f\u69c4r;\u633ff;\uc000\ud835\udd64a\u0100dr\u344d\u0402es\u0100;u\u3454\u3455\u6660it\xbb\u3455\u0180csu\u3460\u3479\u349f\u0100au\u3465\u346fp\u0100;s\u1188\u346b;\uc000\u2293\ufe00p\u0100;s\u11b4\u3475;\uc000\u2294\ufe00u\u0100bp\u347f\u348f\u0180;es\u1197\u119c\u3486et\u0100;e\u1197\u348d\xf1\u119d\u0180;es\u11a8\u11ad\u3496et\u0100;e\u11a8\u349d\xf1\u11ae\u0180;af\u117b\u34a6\u05b0r\u0165\u34ab\u05b1\xbb\u117car\xf2\u1148\u0200cemt\u34b9\u34be\u34c2\u34c5r;\uc000\ud835\udcc8tm\xee\xf1i\xec\u3415ar\xe6\u11be\u0100ar\u34ce\u34d5r\u0100;f\u34d4\u17bf\u6606\u0100an\u34da\u34edight\u0100ep\u34e3\u34eapsilo\xee\u1ee0h\xe9\u2eafs\xbb\u2852\u0280bcmnp\u34fb\u355e\u1209\u358b\u358e\u0480;Edemnprs\u350e\u350f\u3511\u3515\u351e\u3523\u352c\u3531\u3536\u6282;\u6ac5ot;\u6abd\u0100;d\u11da\u351aot;\u6ac3ult;\u6ac1\u0100Ee\u3528\u352a;\u6acb;\u628alus;\u6abfarr;\u6979\u0180eiu\u353d\u3552\u3555t\u0180;en\u350e\u3545\u354bq\u0100;q\u11da\u350feq\u0100;q\u352b\u3528m;\u6ac7\u0100bp\u355a\u355c;\u6ad5;\u6ad3c\u0300;acens\u11ed\u356c\u3572\u3579\u357b\u3326ppro\xf8\u32faurlye\xf1\u11fe\xf1\u11f3\u0180aes\u3582\u3588\u331bppro\xf8\u331aq\xf1\u3317g;\u666a\u0680123;Edehlmnps\u35a9\u35ac\u35af\u121c\u35b2\u35b4\u35c0\u35c9\u35d5\u35da\u35df\u35e8\u35ed\u803b\xb9\u40b9\u803b\xb2\u40b2\u803b\xb3\u40b3;\u6ac6\u0100os\u35b9\u35bct;\u6abeub;\u6ad8\u0100;d\u1222\u35c5ot;\u6ac4s\u0100ou\u35cf\u35d2l;\u67c9b;\u6ad7arr;\u697bult;\u6ac2\u0100Ee\u35e4\u35e6;\u6acc;\u628blus;\u6ac0\u0180eiu\u35f4\u3609\u360ct\u0180;en\u121c\u35fc\u3602q\u0100;q\u1222\u35b2eq\u0100;q\u35e7\u35e4m;\u6ac8\u0100bp\u3611\u3613;\u6ad4;\u6ad6\u0180Aan\u361c\u3620\u362drr;\u61d9r\u0100hr\u3626\u3628\xeb\u222e\u0100;o\u0a2b\u0a29war;\u692alig\u803b\xdf\u40df\u0be1\u3651\u365d\u3660\u12ce\u3673\u3679\0\u367e\u36c2\0\0\0\0\0\u36db\u3703\0\u3709\u376c\0\0\0\u3787\u0272\u3656\0\0\u365bget;\u6316;\u43c4r\xeb\u0e5f\u0180aey\u3666\u366b\u3670ron;\u4165dil;\u4163;\u4442lrec;\u6315r;\uc000\ud835\udd31\u0200eiko\u3686\u369d\u36b5\u36bc\u01f2\u368b\0\u3691e\u01004f\u1284\u1281a\u0180;sv\u3698\u3699\u369b\u43b8ym;\u43d1\u0100cn\u36a2\u36b2k\u0100as\u36a8\u36aeppro\xf8\u12c1im\xbb\u12acs\xf0\u129e\u0100as\u36ba\u36ae\xf0\u12c1rn\u803b\xfe\u40fe\u01ec\u031f\u36c6\u22e7es\u8180\xd7;bd\u36cf\u36d0\u36d8\u40d7\u0100;a\u190f\u36d5r;\u6a31;\u6a30\u0180eps\u36e1\u36e3\u3700\xe1\u2a4d\u0200;bcf\u0486\u36ec\u36f0\u36f4ot;\u6336ir;\u6af1\u0100;o\u36f9\u36fc\uc000\ud835\udd65rk;\u6ada\xe1\u3362rime;\u6034\u0180aip\u370f\u3712\u3764d\xe5\u1248\u0380adempst\u3721\u374d\u3740\u3751\u3757\u375c\u375fngle\u0280;dlqr\u3730\u3731\u3736\u3740\u3742\u65b5own\xbb\u1dbbeft\u0100;e\u2800\u373e\xf1\u092e;\u625cight\u0100;e\u32aa\u374b\xf1\u105aot;\u65ecinus;\u6a3alus;\u6a39b;\u69cdime;\u6a3bezium;\u63e2\u0180cht\u3772\u377d\u3781\u0100ry\u3777\u377b;\uc000\ud835\udcc9;\u4446cy;\u445brok;\u4167\u0100io\u378b\u378ex\xf4\u1777head\u0100lr\u3797\u37a0eftarro\xf7\u084fightarrow\xbb\u0f5d\u0900AHabcdfghlmoprstuw\u37d0\u37d3\u37d7\u37e4\u37f0\u37fc\u380e\u381c\u3823\u3834\u3851\u385d\u386b\u38a9\u38cc\u38d2\u38ea\u38f6r\xf2\u03edar;\u6963\u0100cr\u37dc\u37e2ute\u803b\xfa\u40fa\xf2\u1150r\u01e3\u37ea\0\u37edy;\u445eve;\u416d\u0100iy\u37f5\u37farc\u803b\xfb\u40fb;\u4443\u0180abh\u3803\u3806\u380br\xf2\u13adlac;\u4171a\xf2\u13c3\u0100ir\u3813\u3818sht;\u697e;\uc000\ud835\udd32rave\u803b\xf9\u40f9\u0161\u3827\u3831r\u0100lr\u382c\u382e\xbb\u0957\xbb\u1083lk;\u6580\u0100ct\u3839\u384d\u026f\u383f\0\0\u384arn\u0100;e\u3845\u3846\u631cr\xbb\u3846op;\u630fri;\u65f8\u0100al\u3856\u385acr;\u416b\u80bb\xa8\u0349\u0100gp\u3862\u3866on;\u4173f;\uc000\ud835\udd66\u0300adhlsu\u114b\u3878\u387d\u1372\u3891\u38a0own\xe1\u13b3arpoon\u0100lr\u3888\u388cef\xf4\u382digh\xf4\u382fi\u0180;hl\u3899\u389a\u389c\u43c5\xbb\u13faon\xbb\u389aparrows;\u61c8\u0180cit\u38b0\u38c4\u38c8\u026f\u38b6\0\0\u38c1rn\u0100;e\u38bc\u38bd\u631dr\xbb\u38bdop;\u630eng;\u416fri;\u65f9cr;\uc000\ud835\udcca\u0180dir\u38d9\u38dd\u38e2ot;\u62f0lde;\u4169i\u0100;f\u3730\u38e8\xbb\u1813\u0100am\u38ef\u38f2r\xf2\u38a8l\u803b\xfc\u40fcangle;\u69a7\u0780ABDacdeflnoprsz\u391c\u391f\u3929\u392d\u39b5\u39b8\u39bd\u39df\u39e4\u39e8\u39f3\u39f9\u39fd\u3a01\u3a20r\xf2\u03f7ar\u0100;v\u3926\u3927\u6ae8;\u6ae9as\xe8\u03e1\u0100nr\u3932\u3937grt;\u699c\u0380eknprst\u34e3\u3946\u394b\u3952\u395d\u3964\u3996app\xe1\u2415othin\xe7\u1e96\u0180hir\u34eb\u2ec8\u3959op\xf4\u2fb5\u0100;h\u13b7\u3962\xef\u318d\u0100iu\u3969\u396dgm\xe1\u33b3\u0100bp\u3972\u3984setneq\u0100;q\u397d\u3980\uc000\u228a\ufe00;\uc000\u2acb\ufe00setneq\u0100;q\u398f\u3992\uc000\u228b\ufe00;\uc000\u2acc\ufe00\u0100hr\u399b\u399fet\xe1\u369ciangle\u0100lr\u39aa\u39afeft\xbb\u0925ight\xbb\u1051y;\u4432ash\xbb\u1036\u0180elr\u39c4\u39d2\u39d7\u0180;be\u2dea\u39cb\u39cfar;\u62bbq;\u625alip;\u62ee\u0100bt\u39dc\u1468a\xf2\u1469r;\uc000\ud835\udd33tr\xe9\u39aesu\u0100bp\u39ef\u39f1\xbb\u0d1c\xbb\u0d59pf;\uc000\ud835\udd67ro\xf0\u0efbtr\xe9\u39b4\u0100cu\u3a06\u3a0br;\uc000\ud835\udccb\u0100bp\u3a10\u3a18n\u0100Ee\u3980\u3a16\xbb\u397en\u0100Ee\u3992\u3a1e\xbb\u3990igzag;\u699a\u0380cefoprs\u3a36\u3a3b\u3a56\u3a5b\u3a54\u3a61\u3a6airc;\u4175\u0100di\u3a40\u3a51\u0100bg\u3a45\u3a49ar;\u6a5fe\u0100;q\u15fa\u3a4f;\u6259erp;\u6118r;\uc000\ud835\udd34pf;\uc000\ud835\udd68\u0100;e\u1479\u3a66at\xe8\u1479cr;\uc000\ud835\udccc\u0ae3\u178e\u3a87\0\u3a8b\0\u3a90\u3a9b\0\0\u3a9d\u3aa8\u3aab\u3aaf\0\0\u3ac3\u3ace\0\u3ad8\u17dc\u17dftr\xe9\u17d1r;\uc000\ud835\udd35\u0100Aa\u3a94\u3a97r\xf2\u03c3r\xf2\u09f6;\u43be\u0100Aa\u3aa1\u3aa4r\xf2\u03b8r\xf2\u09eba\xf0\u2713is;\u62fb\u0180dpt\u17a4\u3ab5\u3abe\u0100fl\u3aba\u17a9;\uc000\ud835\udd69im\xe5\u17b2\u0100Aa\u3ac7\u3acar\xf2\u03cer\xf2\u0a01\u0100cq\u3ad2\u17b8r;\uc000\ud835\udccd\u0100pt\u17d6\u3adcr\xe9\u17d4\u0400acefiosu\u3af0\u3afd\u3b08\u3b0c\u3b11\u3b15\u3b1b\u3b21c\u0100uy\u3af6\u3afbte\u803b\xfd\u40fd;\u444f\u0100iy\u3b02\u3b06rc;\u4177;\u444bn\u803b\xa5\u40a5r;\uc000\ud835\udd36cy;\u4457pf;\uc000\ud835\udd6acr;\uc000\ud835\udcce\u0100cm\u3b26\u3b29y;\u444el\u803b\xff\u40ff\u0500acdefhiosw\u3b42\u3b48\u3b54\u3b58\u3b64\u3b69\u3b6d\u3b74\u3b7a\u3b80cute;\u417a\u0100ay\u3b4d\u3b52ron;\u417e;\u4437ot;\u417c\u0100et\u3b5d\u3b61tr\xe6\u155fa;\u43b6r;\uc000\ud835\udd37cy;\u4436grarr;\u61ddpf;\uc000\ud835\udd6bcr;\uc000\ud835\udccf\u0100jn\u3b85\u3b87;\u600dj;\u600c".split("").map(function (c) { return c.charCodeAt(0); })); /***/ }), /***/ "../../../node_modules/entities/lib/generated/decode-data-xml.js": /*!***********************************************************************!*\ !*** ../../../node_modules/entities/lib/generated/decode-data-xml.js ***! \***********************************************************************/ /***/ (function(__unused_webpack_module, exports) { // Generated using scripts/write-decode-map.ts Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = new Uint16Array( // prettier-ignore "\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022".split("").map(function (c) { return c.charCodeAt(0); })); /***/ }), /***/ "../../../node_modules/entities/lib/generated/encode-html.js": /*!*******************************************************************!*\ !*** ../../../node_modules/entities/lib/generated/encode-html.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports) { // Generated using scripts/write-encode-map.ts Object.defineProperty(exports, "__esModule", ({ value: true })); function restoreDiff(arr) { for (var i = 1; i < arr.length; i++) { arr[i][0] += arr[i - 1][0] + 1; } return arr; } // prettier-ignore exports["default"] = new Map( /* #__PURE__ */restoreDiff([[9, " "], [0, " "], [22, "!"], [0, """], [0, "#"], [0, "$"], [0, "%"], [0, "&"], [0, "'"], [0, "("], [0, ")"], [0, "*"], [0, "+"], [0, ","], [1, "."], [0, "/"], [10, ":"], [0, ";"], [0, { v: "<", n: 8402, o: "<⃒" }], [0, { v: "=", n: 8421, o: "=⃥" }], [0, { v: ">", n: 8402, o: ">⃒" }], [0, "?"], [0, "@"], [26, "["], [0, "\"], [0, "]"], [0, "^"], [0, "_"], [0, "`"], [5, { n: 106, o: "fj" }], [20, "{"], [0, "|"], [0, "}"], [34, " "], [0, "¡"], [0, "¢"], [0, "£"], [0, "¤"], [0, "¥"], [0, "¦"], [0, "§"], [0, "¨"], [0, "©"], [0, "ª"], [0, "«"], [0, "¬"], [0, "­"], [0, "®"], [0, "¯"], [0, "°"], [0, "±"], [0, "²"], [0, "³"], [0, "´"], [0, "µ"], [0, "¶"], [0, "·"], [0, "¸"], [0, "¹"], [0, "º"], [0, "»"], [0, "¼"], [0, "½"], [0, "¾"], [0, "¿"], [0, "À"], [0, "Á"], [0, "Â"], [0, "Ã"], [0, "Ä"], [0, "Å"], [0, "Æ"], [0, "Ç"], [0, "È"], [0, "É"], [0, "Ê"], [0, "Ë"], [0, "Ì"], [0, "Í"], [0, "Î"], [0, "Ï"], [0, "Ð"], [0, "Ñ"], [0, "Ò"], [0, "Ó"], [0, "Ô"], [0, "Õ"], [0, "Ö"], [0, "×"], [0, "Ø"], [0, "Ù"], [0, "Ú"], [0, "Û"], [0, "Ü"], [0, "Ý"], [0, "Þ"], [0, "ß"], [0, "à"], [0, "á"], [0, "â"], [0, "ã"], [0, "ä"], [0, "å"], [0, "æ"], [0, "ç"], [0, "è"], [0, "é"], [0, "ê"], [0, "ë"], [0, "ì"], [0, "í"], [0, "î"], [0, "ï"], [0, "ð"], [0, "ñ"], [0, "ò"], [0, "ó"], [0, "ô"], [0, "õ"], [0, "ö"], [0, "÷"], [0, "ø"], [0, "ù"], [0, "ú"], [0, "û"], [0, "ü"], [0, "ý"], [0, "þ"], [0, "ÿ"], [0, "Ā"], [0, "ā"], [0, "Ă"], [0, "ă"], [0, "Ą"], [0, "ą"], [0, "Ć"], [0, "ć"], [0, "Ĉ"], [0, "ĉ"], [0, "Ċ"], [0, "ċ"], [0, "Č"], [0, "č"], [0, "Ď"], [0, "ď"], [0, "Đ"], [0, "đ"], [0, "Ē"], [0, "ē"], [2, "Ė"], [0, "ė"], [0, "Ę"], [0, "ę"], [0, "Ě"], [0, "ě"], [0, "Ĝ"], [0, "ĝ"], [0, "Ğ"], [0, "ğ"], [0, "Ġ"], [0, "ġ"], [0, "Ģ"], [1, "Ĥ"], [0, "ĥ"], [0, "Ħ"], [0, "ħ"], [0, "Ĩ"], [0, "ĩ"], [0, "Ī"], [0, "ī"], [2, "Į"], [0, "į"], [0, "İ"], [0, "ı"], [0, "IJ"], [0, "ij"], [0, "Ĵ"], [0, "ĵ"], [0, "Ķ"], [0, "ķ"], [0, "ĸ"], [0, "Ĺ"], [0, "ĺ"], [0, "Ļ"], [0, "ļ"], [0, "Ľ"], [0, "ľ"], [0, "Ŀ"], [0, "ŀ"], [0, "Ł"], [0, "ł"], [0, "Ń"], [0, "ń"], [0, "Ņ"], [0, "ņ"], [0, "Ň"], [0, "ň"], [0, "ʼn"], [0, "Ŋ"], [0, "ŋ"], [0, "Ō"], [0, "ō"], [2, "Ő"], [0, "ő"], [0, "Œ"], [0, "œ"], [0, "Ŕ"], [0, "ŕ"], [0, "Ŗ"], [0, "ŗ"], [0, "Ř"], [0, "ř"], [0, "Ś"], [0, "ś"], [0, "Ŝ"], [0, "ŝ"], [0, "Ş"], [0, "ş"], [0, "Š"], [0, "š"], [0, "Ţ"], [0, "ţ"], [0, "Ť"], [0, "ť"], [0, "Ŧ"], [0, "ŧ"], [0, "Ũ"], [0, "ũ"], [0, "Ū"], [0, "ū"], [0, "Ŭ"], [0, "ŭ"], [0, "Ů"], [0, "ů"], [0, "Ű"], [0, "ű"], [0, "Ų"], [0, "ų"], [0, "Ŵ"], [0, "ŵ"], [0, "Ŷ"], [0, "ŷ"], [0, "Ÿ"], [0, "Ź"], [0, "ź"], [0, "Ż"], [0, "ż"], [0, "Ž"], [0, "ž"], [19, "ƒ"], [34, "Ƶ"], [63, "ǵ"], [65, "ȷ"], [142, "ˆ"], [0, "ˇ"], [16, "˘"], [0, "˙"], [0, "˚"], [0, "˛"], [0, "˜"], [0, "˝"], [51, "̑"], [127, "Α"], [0, "Β"], [0, "Γ"], [0, "Δ"], [0, "Ε"], [0, "Ζ"], [0, "Η"], [0, "Θ"], [0, "Ι"], [0, "Κ"], [0, "Λ"], [0, "Μ"], [0, "Ν"], [0, "Ξ"], [0, "Ο"], [0, "Π"], [0, "Ρ"], [1, "Σ"], [0, "Τ"], [0, "Υ"], [0, "Φ"], [0, "Χ"], [0, "Ψ"], [0, "Ω"], [7, "α"], [0, "β"], [0, "γ"], [0, "δ"], [0, "ε"], [0, "ζ"], [0, "η"], [0, "θ"], [0, "ι"], [0, "κ"], [0, "λ"], [0, "μ"], [0, "ν"], [0, "ξ"], [0, "ο"], [0, "π"], [0, "ρ"], [0, "ς"], [0, "σ"], [0, "τ"], [0, "υ"], [0, "φ"], [0, "χ"], [0, "ψ"], [0, "ω"], [7, "ϑ"], [0, "ϒ"], [2, "ϕ"], [0, "ϖ"], [5, "Ϝ"], [0, "ϝ"], [18, "ϰ"], [0, "ϱ"], [3, "ϵ"], [0, "϶"], [10, "Ё"], [0, "Ђ"], [0, "Ѓ"], [0, "Є"], [0, "Ѕ"], [0, "І"], [0, "Ї"], [0, "Ј"], [0, "Љ"], [0, "Њ"], [0, "Ћ"], [0, "Ќ"], [1, "Ў"], [0, "Џ"], [0, "А"], [0, "Б"], [0, "В"], [0, "Г"], [0, "Д"], [0, "Е"], [0, "Ж"], [0, "З"], [0, "И"], [0, "Й"], [0, "К"], [0, "Л"], [0, "М"], [0, "Н"], [0, "О"], [0, "П"], [0, "Р"], [0, "С"], [0, "Т"], [0, "У"], [0, "Ф"], [0, "Х"], [0, "Ц"], [0, "Ч"], [0, "Ш"], [0, "Щ"], [0, "Ъ"], [0, "Ы"], [0, "Ь"], [0, "Э"], [0, "Ю"], [0, "Я"], [0, "а"], [0, "б"], [0, "в"], [0, "г"], [0, "д"], [0, "е"], [0, "ж"], [0, "з"], [0, "и"], [0, "й"], [0, "к"], [0, "л"], [0, "м"], [0, "н"], [0, "о"], [0, "п"], [0, "р"], [0, "с"], [0, "т"], [0, "у"], [0, "ф"], [0, "х"], [0, "ц"], [0, "ч"], [0, "ш"], [0, "щ"], [0, "ъ"], [0, "ы"], [0, "ь"], [0, "э"], [0, "ю"], [0, "я"], [1, "ё"], [0, "ђ"], [0, "ѓ"], [0, "є"], [0, "ѕ"], [0, "і"], [0, "ї"], [0, "ј"], [0, "љ"], [0, "њ"], [0, "ћ"], [0, "ќ"], [1, "ў"], [0, "џ"], [7074, " "], [0, " "], [0, " "], [0, " "], [1, " "], [0, " "], [0, " "], [0, " "], [0, "​"], [0, "‌"], [0, "‍"], [0, "‎"], [0, "‏"], [0, "‐"], [2, "–"], [0, "—"], [0, "―"], [0, "‖"], [1, "‘"], [0, "’"], [0, "‚"], [1, "“"], [0, "”"], [0, "„"], [1, "†"], [0, "‡"], [0, "•"], [2, "‥"], [0, "…"], [9, "‰"], [0, "‱"], [0, "′"], [0, "″"], [0, "‴"], [0, "‵"], [3, "‹"], [0, "›"], [3, "‾"], [2, "⁁"], [1, "⁃"], [0, "⁄"], [10, "⁏"], [7, "⁗"], [7, { v: " ", n: 8202, o: "  " }], [0, "⁠"], [0, "⁡"], [0, "⁢"], [0, "⁣"], [72, "€"], [46, "⃛"], [0, "⃜"], [37, "ℂ"], [2, "℅"], [4, "ℊ"], [0, "ℋ"], [0, "ℌ"], [0, "ℍ"], [0, "ℎ"], [0, "ℏ"], [0, "ℐ"], [0, "ℑ"], [0, "ℒ"], [0, "ℓ"], [1, "ℕ"], [0, "№"], [0, "℗"], [0, "℘"], [0, "ℙ"], [0, "ℚ"], [0, "ℛ"], [0, "ℜ"], [0, "ℝ"], [0, "℞"], [3, "™"], [1, "ℤ"], [2, "℧"], [0, "ℨ"], [0, "℩"], [2, "ℬ"], [0, "ℭ"], [1, "ℯ"], [0, "ℰ"], [0, "ℱ"], [1, "ℳ"], [0, "ℴ"], [0, "ℵ"], [0, "ℶ"], [0, "ℷ"], [0, "ℸ"], [12, "ⅅ"], [0, "ⅆ"], [0, "ⅇ"], [0, "ⅈ"], [10, "⅓"], [0, "⅔"], [0, "⅕"], [0, "⅖"], [0, "⅗"], [0, "⅘"], [0, "⅙"], [0, "⅚"], [0, "⅛"], [0, "⅜"], [0, "⅝"], [0, "⅞"], [49, "←"], [0, "↑"], [0, "→"], [0, "↓"], [0, "↔"], [0, "↕"], [0, "↖"], [0, "↗"], [0, "↘"], [0, "↙"], [0, "↚"], [0, "↛"], [1, { v: "↝", n: 824, o: "↝̸" }], [0, "↞"], [0, "↟"], [0, "↠"], [0, "↡"], [0, "↢"], [0, "↣"], [0, "↤"], [0, "↥"], [0, "↦"], [0, "↧"], [1, "↩"], [0, "↪"], [0, "↫"], [0, "↬"], [0, "↭"], [0, "↮"], [1, "↰"], [0, "↱"], [0, "↲"], [0, "↳"], [1, "↵"], [0, "↶"], [0, "↷"], [2, "↺"], [0, "↻"], [0, "↼"], [0, "↽"], [0, "↾"], [0, "↿"], [0, "⇀"], [0, "⇁"], [0, "⇂"], [0, "⇃"], [0, "⇄"], [0, "⇅"], [0, "⇆"], [0, "⇇"], [0, "⇈"], [0, "⇉"], [0, "⇊"], [0, "⇋"], [0, "⇌"], [0, "⇍"], [0, "⇎"], [0, "⇏"], [0, "⇐"], [0, "⇑"], [0, "⇒"], [0, "⇓"], [0, "⇔"], [0, "⇕"], [0, "⇖"], [0, "⇗"], [0, "⇘"], [0, "⇙"], [0, "⇚"], [0, "⇛"], [1, "⇝"], [6, "⇤"], [0, "⇥"], [15, "⇵"], [7, "⇽"], [0, "⇾"], [0, "⇿"], [0, "∀"], [0, "∁"], [0, { v: "∂", n: 824, o: "∂̸" }], [0, "∃"], [0, "∄"], [0, "∅"], [1, "∇"], [0, "∈"], [0, "∉"], [1, "∋"], [0, "∌"], [2, "∏"], [0, "∐"], [0, "∑"], [0, "−"], [0, "∓"], [0, "∔"], [1, "∖"], [0, "∗"], [0, "∘"], [1, "√"], [2, "∝"], [0, "∞"], [0, "∟"], [0, { v: "∠", n: 8402, o: "∠⃒" }], [0, "∡"], [0, "∢"], [0, "∣"], [0, "∤"], [0, "∥"], [0, "∦"], [0, "∧"], [0, "∨"], [0, { v: "∩", n: 65024, o: "∩︀" }], [0, { v: "∪", n: 65024, o: "∪︀" }], [0, "∫"], [0, "∬"], [0, "∭"], [0, "∮"], [0, "∯"], [0, "∰"], [0, "∱"], [0, "∲"], [0, "∳"], [0, "∴"], [0, "∵"], [0, "∶"], [0, "∷"], [0, "∸"], [1, "∺"], [0, "∻"], [0, { v: "∼", n: 8402, o: "∼⃒" }], [0, { v: "∽", n: 817, o: "∽̱" }], [0, { v: "∾", n: 819, o: "∾̳" }], [0, "∿"], [0, "≀"], [0, "≁"], [0, { v: "≂", n: 824, o: "≂̸" }], [0, "≃"], [0, "≄"], [0, "≅"], [0, "≆"], [0, "≇"], [0, "≈"], [0, "≉"], [0, "≊"], [0, { v: "≋", n: 824, o: "≋̸" }], [0, "≌"], [0, { v: "≍", n: 8402, o: "≍⃒" }], [0, { v: "≎", n: 824, o: "≎̸" }], [0, { v: "≏", n: 824, o: "≏̸" }], [0, { v: "≐", n: 824, o: "≐̸" }], [0, "≑"], [0, "≒"], [0, "≓"], [0, "≔"], [0, "≕"], [0, "≖"], [0, "≗"], [1, "≙"], [0, "≚"], [1, "≜"], [2, "≟"], [0, "≠"], [0, { v: "≡", n: 8421, o: "≡⃥" }], [0, "≢"], [1, { v: "≤", n: 8402, o: "≤⃒" }], [0, { v: "≥", n: 8402, o: "≥⃒" }], [0, { v: "≦", n: 824, o: "≦̸" }], [0, { v: "≧", n: 824, o: "≧̸" }], [0, { v: "≨", n: 65024, o: "≨︀" }], [0, { v: "≩", n: 65024, o: "≩︀" }], [0, { v: "≪", n: new Map( /* #__PURE__ */restoreDiff([[824, "≪̸"], [7577, "≪⃒"]])) }], [0, { v: "≫", n: new Map( /* #__PURE__ */restoreDiff([[824, "≫̸"], [7577, "≫⃒"]])) }], [0, "≬"], [0, "≭"], [0, "≮"], [0, "≯"], [0, "≰"], [0, "≱"], [0, "≲"], [0, "≳"], [0, "≴"], [0, "≵"], [0, "≶"], [0, "≷"], [0, "≸"], [0, "≹"], [0, "≺"], [0, "≻"], [0, "≼"], [0, "≽"], [0, "≾"], [0, { v: "≿", n: 824, o: "≿̸" }], [0, "⊀"], [0, "⊁"], [0, { v: "⊂", n: 8402, o: "⊂⃒" }], [0, { v: "⊃", n: 8402, o: "⊃⃒" }], [0, "⊄"], [0, "⊅"], [0, "⊆"], [0, "⊇"], [0, "⊈"], [0, "⊉"], [0, { v: "⊊", n: 65024, o: "⊊︀" }], [0, { v: "⊋", n: 65024, o: "⊋︀" }], [1, "⊍"], [0, "⊎"], [0, { v: "⊏", n: 824, o: "⊏̸" }], [0, { v: "⊐", n: 824, o: "⊐̸" }], [0, "⊑"], [0, "⊒"], [0, { v: "⊓", n: 65024, o: "⊓︀" }], [0, { v: "⊔", n: 65024, o: "⊔︀" }], [0, "⊕"], [0, "⊖"], [0, "⊗"], [0, "⊘"], [0, "⊙"], [0, "⊚"], [0, "⊛"], [1, "⊝"], [0, "⊞"], [0, "⊟"], [0, "⊠"], [0, "⊡"], [0, "⊢"], [0, "⊣"], [0, "⊤"], [0, "⊥"], [1, "⊧"], [0, "⊨"], [0, "⊩"], [0, "⊪"], [0, "⊫"], [0, "⊬"], [0, "⊭"], [0, "⊮"], [0, "⊯"], [0, "⊰"], [1, "⊲"], [0, "⊳"], [0, { v: "⊴", n: 8402, o: "⊴⃒" }], [0, { v: "⊵", n: 8402, o: "⊵⃒" }], [0, "⊶"], [0, "⊷"], [0, "⊸"], [0, "⊹"], [0, "⊺"], [0, "⊻"], [1, "⊽"], [0, "⊾"], [0, "⊿"], [0, "⋀"], [0, "⋁"], [0, "⋂"], [0, "⋃"], [0, "⋄"], [0, "⋅"], [0, "⋆"], [0, "⋇"], [0, "⋈"], [0, "⋉"], [0, "⋊"], [0, "⋋"], [0, "⋌"], [0, "⋍"], [0, "⋎"], [0, "⋏"], [0, "⋐"], [0, "⋑"], [0, "⋒"], [0, "⋓"], [0, "⋔"], [0, "⋕"], [0, "⋖"], [0, "⋗"], [0, { v: "⋘", n: 824, o: "⋘̸" }], [0, { v: "⋙", n: 824, o: "⋙̸" }], [0, { v: "⋚", n: 65024, o: "⋚︀" }], [0, { v: "⋛", n: 65024, o: "⋛︀" }], [2, "⋞"], [0, "⋟"], [0, "⋠"], [0, "⋡"], [0, "⋢"], [0, "⋣"], [2, "⋦"], [0, "⋧"], [0, "⋨"], [0, "⋩"], [0, "⋪"], [0, "⋫"], [0, "⋬"], [0, "⋭"], [0, "⋮"], [0, "⋯"], [0, "⋰"], [0, "⋱"], [0, "⋲"], [0, "⋳"], [0, "⋴"], [0, { v: "⋵", n: 824, o: "⋵̸" }], [0, "⋶"], [0, "⋷"], [1, { v: "⋹", n: 824, o: "⋹̸" }], [0, "⋺"], [0, "⋻"], [0, "⋼"], [0, "⋽"], [0, "⋾"], [6, "⌅"], [0, "⌆"], [1, "⌈"], [0, "⌉"], [0, "⌊"], [0, "⌋"], [0, "⌌"], [0, "⌍"], [0, "⌎"], [0, "⌏"], [0, "⌐"], [1, "⌒"], [0, "⌓"], [1, "⌕"], [0, "⌖"], [5, "⌜"], [0, "⌝"], [0, "⌞"], [0, "⌟"], [2, "⌢"], [0, "⌣"], [9, "⌭"], [0, "⌮"], [7, "⌶"], [6, "⌽"], [1, "⌿"], [60, "⍼"], [51, "⎰"], [0, "⎱"], [2, "⎴"], [0, "⎵"], [0, "⎶"], [37, "⏜"], [0, "⏝"], [0, "⏞"], [0, "⏟"], [2, "⏢"], [4, "⏧"], [59, "␣"], [164, "Ⓢ"], [55, "─"], [1, "│"], [9, "┌"], [3, "┐"], [3, "└"], [3, "┘"], [3, "├"], [7, "┤"], [7, "┬"], [7, "┴"], [7, "┼"], [19, "═"], [0, "║"], [0, "╒"], [0, "╓"], [0, "╔"], [0, "╕"], [0, "╖"], [0, "╗"], [0, "╘"], [0, "╙"], [0, "╚"], [0, "╛"], [0, "╜"], [0, "╝"], [0, "╞"], [0, "╟"], [0, "╠"], [0, "╡"], [0, "╢"], [0, "╣"], [0, "╤"], [0, "╥"], [0, "╦"], [0, "╧"], [0, "╨"], [0, "╩"], [0, "╪"], [0, "╫"], [0, "╬"], [19, "▀"], [3, "▄"], [3, "█"], [8, "░"], [0, "▒"], [0, "▓"], [13, "□"], [8, "▪"], [0, "▫"], [1, "▭"], [0, "▮"], [2, "▱"], [1, "△"], [0, "▴"], [0, "▵"], [2, "▸"], [0, "▹"], [3, "▽"], [0, "▾"], [0, "▿"], [2, "◂"], [0, "◃"], [6, "◊"], [0, "○"], [32, "◬"], [2, "◯"], [8, "◸"], [0, "◹"], [0, "◺"], [0, "◻"], [0, "◼"], [8, "★"], [0, "☆"], [7, "☎"], [49, "♀"], [1, "♂"], [29, "♠"], [2, "♣"], [1, "♥"], [0, "♦"], [3, "♪"], [2, "♭"], [0, "♮"], [0, "♯"], [163, "✓"], [3, "✗"], [8, "✠"], [21, "✶"], [33, "❘"], [25, "❲"], [0, "❳"], [84, "⟈"], [0, "⟉"], [28, "⟦"], [0, "⟧"], [0, "⟨"], [0, "⟩"], [0, "⟪"], [0, "⟫"], [0, "⟬"], [0, "⟭"], [7, "⟵"], [0, "⟶"], [0, "⟷"], [0, "⟸"], [0, "⟹"], [0, "⟺"], [1, "⟼"], [2, "⟿"], [258, "⤂"], [0, "⤃"], [0, "⤄"], [0, "⤅"], [6, "⤌"], [0, "⤍"], [0, "⤎"], [0, "⤏"], [0, "⤐"], [0, "⤑"], [0, "⤒"], [0, "⤓"], [2, "⤖"], [2, "⤙"], [0, "⤚"], [0, "⤛"], [0, "⤜"], [0, "⤝"], [0, "⤞"], [0, "⤟"], [0, "⤠"], [2, "⤣"], [0, "⤤"], [0, "⤥"], [0, "⤦"], [0, "⤧"], [0, "⤨"], [0, "⤩"], [0, "⤪"], [8, { v: "⤳", n: 824, o: "⤳̸" }], [1, "⤵"], [0, "⤶"], [0, "⤷"], [0, "⤸"], [0, "⤹"], [2, "⤼"], [0, "⤽"], [7, "⥅"], [2, "⥈"], [0, "⥉"], [0, "⥊"], [0, "⥋"], [2, "⥎"], [0, "⥏"], [0, "⥐"], [0, "⥑"], [0, "⥒"], [0, "⥓"], [0, "⥔"], [0, "⥕"], [0, "⥖"], [0, "⥗"], [0, "⥘"], [0, "⥙"], [0, "⥚"], [0, "⥛"], [0, "⥜"], [0, "⥝"], [0, "⥞"], [0, "⥟"], [0, "⥠"], [0, "⥡"], [0, "⥢"], [0, "⥣"], [0, "⥤"], [0, "⥥"], [0, "⥦"], [0, "⥧"], [0, "⥨"], [0, "⥩"], [0, "⥪"], [0, "⥫"], [0, "⥬"], [0, "⥭"], [0, "⥮"], [0, "⥯"], [0, "⥰"], [0, "⥱"], [0, "⥲"], [0, "⥳"], [0, "⥴"], [0, "⥵"], [0, "⥶"], [1, "⥸"], [0, "⥹"], [1, "⥻"], [0, "⥼"], [0, "⥽"], [0, "⥾"], [0, "⥿"], [5, "⦅"], [0, "⦆"], [4, "⦋"], [0, "⦌"], [0, "⦍"], [0, "⦎"], [0, "⦏"], [0, "⦐"], [0, "⦑"], [0, "⦒"], [0, "⦓"], [0, "⦔"], [0, "⦕"], [0, "⦖"], [3, "⦚"], [1, "⦜"], [0, "⦝"], [6, "⦤"], [0, "⦥"], [0, "⦦"], [0, "⦧"], [0, "⦨"], [0, "⦩"], [0, "⦪"], [0, "⦫"], [0, "⦬"], [0, "⦭"], [0, "⦮"], [0, "⦯"], [0, "⦰"], [0, "⦱"], [0, "⦲"], [0, "⦳"], [0, "⦴"], [0, "⦵"], [0, "⦶"], [0, "⦷"], [1, "⦹"], [1, "⦻"], [0, "⦼"], [1, "⦾"], [0, "⦿"], [0, "⧀"], [0, "⧁"], [0, "⧂"], [0, "⧃"], [0, "⧄"], [0, "⧅"], [3, "⧉"], [3, "⧍"], [0, "⧎"], [0, { v: "⧏", n: 824, o: "⧏̸" }], [0, { v: "⧐", n: 824, o: "⧐̸" }], [11, "⧜"], [0, "⧝"], [0, "⧞"], [4, "⧣"], [0, "⧤"], [0, "⧥"], [5, "⧫"], [8, "⧴"], [1, "⧶"], [9, "⨀"], [0, "⨁"], [0, "⨂"], [1, "⨄"], [1, "⨆"], [5, "⨌"], [0, "⨍"], [2, "⨐"], [0, "⨑"], [0, "⨒"], [0, "⨓"], [0, "⨔"], [0, "⨕"], [0, "⨖"], [0, "⨗"], [10, "⨢"], [0, "⨣"], [0, "⨤"], [0, "⨥"], [0, "⨦"], [0, "⨧"], [1, "⨩"], [0, "⨪"], [2, "⨭"], [0, "⨮"], [0, "⨯"], [0, "⨰"], [0, "⨱"], [1, "⨳"], [0, "⨴"], [0, "⨵"], [0, "⨶"], [0, "⨷"], [0, "⨸"], [0, "⨹"], [0, "⨺"], [0, "⨻"], [0, "⨼"], [2, "⨿"], [0, "⩀"], [1, "⩂"], [0, "⩃"], [0, "⩄"], [0, "⩅"], [0, "⩆"], [0, "⩇"], [0, "⩈"], [0, "⩉"], [0, "⩊"], [0, "⩋"], [0, "⩌"], [0, "⩍"], [2, "⩐"], [2, "⩓"], [0, "⩔"], [0, "⩕"], [0, "⩖"], [0, "⩗"], [0, "⩘"], [1, "⩚"], [0, "⩛"], [0, "⩜"], [0, "⩝"], [1, "⩟"], [6, "⩦"], [3, "⩪"], [2, { v: "⩭", n: 824, o: "⩭̸" }], [0, "⩮"], [0, "⩯"], [0, { v: "⩰", n: 824, o: "⩰̸" }], [0, "⩱"], [0, "⩲"], [0, "⩳"], [0, "⩴"], [0, "⩵"], [1, "⩷"], [0, "⩸"], [0, "⩹"], [0, "⩺"], [0, "⩻"], [0, "⩼"], [0, { v: "⩽", n: 824, o: "⩽̸" }], [0, { v: "⩾", n: 824, o: "⩾̸" }], [0, "⩿"], [0, "⪀"], [0, "⪁"], [0, "⪂"], [0, "⪃"], [0, "⪄"], [0, "⪅"], [0, "⪆"], [0, "⪇"], [0, "⪈"], [0, "⪉"], [0, "⪊"], [0, "⪋"], [0, "⪌"], [0, "⪍"], [0, "⪎"], [0, "⪏"], [0, "⪐"], [0, "⪑"], [0, "⪒"], [0, "⪓"], [0, "⪔"], [0, "⪕"], [0, "⪖"], [0, "⪗"], [0, "⪘"], [0, "⪙"], [0, "⪚"], [2, "⪝"], [0, "⪞"], [0, "⪟"], [0, "⪠"], [0, { v: "⪡", n: 824, o: "⪡̸" }], [0, { v: "⪢", n: 824, o: "⪢̸" }], [1, "⪤"], [0, "⪥"], [0, "⪦"], [0, "⪧"], [0, "⪨"], [0, "⪩"], [0, "⪪"], [0, "⪫"], [0, { v: "⪬", n: 65024, o: "⪬︀" }], [0, { v: "⪭", n: 65024, o: "⪭︀" }], [0, "⪮"], [0, { v: "⪯", n: 824, o: "⪯̸" }], [0, { v: "⪰", n: 824, o: "⪰̸" }], [2, "⪳"], [0, "⪴"], [0, "⪵"], [0, "⪶"], [0, "⪷"], [0, "⪸"], [0, "⪹"], [0, "⪺"], [0, "⪻"], [0, "⪼"], [0, "⪽"], [0, "⪾"], [0, "⪿"], [0, "⫀"], [0, "⫁"], [0, "⫂"], [0, "⫃"], [0, "⫄"], [0, { v: "⫅", n: 824, o: "⫅̸" }], [0, { v: "⫆", n: 824, o: "⫆̸" }], [0, "⫇"], [0, "⫈"], [2, { v: "⫋", n: 65024, o: "⫋︀" }], [0, { v: "⫌", n: 65024, o: "⫌︀" }], [2, "⫏"], [0, "⫐"], [0, "⫑"], [0, "⫒"], [0, "⫓"], [0, "⫔"], [0, "⫕"], [0, "⫖"], [0, "⫗"], [0, "⫘"], [0, "⫙"], [0, "⫚"], [0, "⫛"], [8, "⫤"], [1, "⫦"], [0, "⫧"], [0, "⫨"], [0, "⫩"], [1, "⫫"], [0, "⫬"], [0, "⫭"], [0, "⫮"], [0, "⫯"], [0, "⫰"], [0, "⫱"], [0, "⫲"], [0, "⫳"], [9, { v: "⫽", n: 8421, o: "⫽⃥" }], [44343, { n: new Map( /* #__PURE__ */restoreDiff([[56476, "𝒜"], [1, "𝒞"], [0, "𝒟"], [2, "𝒢"], [2, "𝒥"], [0, "𝒦"], [2, "𝒩"], [0, "𝒪"], [0, "𝒫"], [0, "𝒬"], [1, "𝒮"], [0, "𝒯"], [0, "𝒰"], [0, "𝒱"], [0, "𝒲"], [0, "𝒳"], [0, "𝒴"], [0, "𝒵"], [0, "𝒶"], [0, "𝒷"], [0, "𝒸"], [0, "𝒹"], [1, "𝒻"], [1, "𝒽"], [0, "𝒾"], [0, "𝒿"], [0, "𝓀"], [0, "𝓁"], [0, "𝓂"], [0, "𝓃"], [1, "𝓅"], [0, "𝓆"], [0, "𝓇"], [0, "𝓈"], [0, "𝓉"], [0, "𝓊"], [0, "𝓋"], [0, "𝓌"], [0, "𝓍"], [0, "𝓎"], [0, "𝓏"], [52, "𝔄"], [0, "𝔅"], [1, "𝔇"], [0, "𝔈"], [0, "𝔉"], [0, "𝔊"], [2, "𝔍"], [0, "𝔎"], [0, "𝔏"], [0, "𝔐"], [0, "𝔑"], [0, "𝔒"], [0, "𝔓"], [0, "𝔔"], [1, "𝔖"], [0, "𝔗"], [0, "𝔘"], [0, "𝔙"], [0, "𝔚"], [0, "𝔛"], [0, "𝔜"], [1, "𝔞"], [0, "𝔟"], [0, "𝔠"], [0, "𝔡"], [0, "𝔢"], [0, "𝔣"], [0, "𝔤"], [0, "𝔥"], [0, "𝔦"], [0, "𝔧"], [0, "𝔨"], [0, "𝔩"], [0, "𝔪"], [0, "𝔫"], [0, "𝔬"], [0, "𝔭"], [0, "𝔮"], [0, "𝔯"], [0, "𝔰"], [0, "𝔱"], [0, "𝔲"], [0, "𝔳"], [0, "𝔴"], [0, "𝔵"], [0, "𝔶"], [0, "𝔷"], [0, "𝔸"], [0, "𝔹"], [1, "𝔻"], [0, "𝔼"], [0, "𝔽"], [0, "𝔾"], [1, "𝕀"], [0, "𝕁"], [0, "𝕂"], [0, "𝕃"], [0, "𝕄"], [1, "𝕆"], [3, "𝕊"], [0, "𝕋"], [0, "𝕌"], [0, "𝕍"], [0, "𝕎"], [0, "𝕏"], [0, "𝕐"], [1, "𝕒"], [0, "𝕓"], [0, "𝕔"], [0, "𝕕"], [0, "𝕖"], [0, "𝕗"], [0, "𝕘"], [0, "𝕙"], [0, "𝕚"], [0, "𝕛"], [0, "𝕜"], [0, "𝕝"], [0, "𝕞"], [0, "𝕟"], [0, "𝕠"], [0, "𝕡"], [0, "𝕢"], [0, "𝕣"], [0, "𝕤"], [0, "𝕥"], [0, "𝕦"], [0, "𝕧"], [0, "𝕨"], [0, "𝕩"], [0, "𝕪"], [0, "𝕫"]])) }], [8906, "ff"], [0, "fi"], [0, "fl"], [0, "ffi"], [0, "ffl"]])); /***/ }), /***/ "../../../node_modules/entities/lib/index.js": /*!***************************************************!*\ !*** ../../../node_modules/entities/lib/index.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.decodeXMLStrict = exports.decodeHTML5Strict = exports.decodeHTML4Strict = exports.decodeHTML5 = exports.decodeHTML4 = exports.decodeHTMLAttribute = exports.decodeHTMLStrict = exports.decodeHTML = exports.decodeXML = exports.DecodingMode = exports.EntityDecoder = exports.encodeHTML5 = exports.encodeHTML4 = exports.encodeNonAsciiHTML = exports.encodeHTML = exports.escapeText = exports.escapeAttribute = exports.escapeUTF8 = exports.escape = exports.encodeXML = exports.encode = exports.decodeStrict = exports.decode = exports.EncodingMode = exports.EntityLevel = void 0; var decode_js_1 = __webpack_require__(/*! ./decode.js */ "../../../node_modules/entities/lib/decode.js"); var encode_js_1 = __webpack_require__(/*! ./encode.js */ "../../../node_modules/entities/lib/encode.js"); var escape_js_1 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); /** The level of entities to support. */ var EntityLevel; (function (EntityLevel) { /** Support only XML entities. */ EntityLevel[EntityLevel["XML"] = 0] = "XML"; /** Support HTML entities, which are a superset of XML entities. */ EntityLevel[EntityLevel["HTML"] = 1] = "HTML"; })(EntityLevel = exports.EntityLevel || (exports.EntityLevel = {})); var EncodingMode; (function (EncodingMode) { /** * The output is UTF-8 encoded. Only characters that need escaping within * XML will be escaped. */ EncodingMode[EncodingMode["UTF8"] = 0] = "UTF8"; /** * The output consists only of ASCII characters. Characters that need * escaping within HTML, and characters that aren't ASCII characters will * be escaped. */ EncodingMode[EncodingMode["ASCII"] = 1] = "ASCII"; /** * Encode all characters that have an equivalent entity, as well as all * characters that are not ASCII characters. */ EncodingMode[EncodingMode["Extensive"] = 2] = "Extensive"; /** * Encode all characters that have to be escaped in HTML attributes, * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. */ EncodingMode[EncodingMode["Attribute"] = 3] = "Attribute"; /** * Encode all characters that have to be escaped in HTML text, * following {@link https://html.spec.whatwg.org/multipage/parsing.html#escapingString}. */ EncodingMode[EncodingMode["Text"] = 4] = "Text"; })(EncodingMode = exports.EncodingMode || (exports.EncodingMode = {})); /** * Decodes a string with entities. * * @param data String to decode. * @param options Decoding options. */ function decode(data, options) { if (options === void 0) { options = EntityLevel.XML; } var level = typeof options === "number" ? options : options.level; if (level === EntityLevel.HTML) { var mode = typeof options === "object" ? options.mode : undefined; return (0, decode_js_1.decodeHTML)(data, mode); } return (0, decode_js_1.decodeXML)(data); } exports.decode = decode; /** * Decodes a string with entities. Does not allow missing trailing semicolons for entities. * * @param data String to decode. * @param options Decoding options. * @deprecated Use `decode` with the `mode` set to `Strict`. */ function decodeStrict(data, options) { var _a; if (options === void 0) { options = EntityLevel.XML; } var opts = typeof options === "number" ? { level: options } : options; (_a = opts.mode) !== null && _a !== void 0 ? _a : opts.mode = decode_js_1.DecodingMode.Strict; return decode(data, opts); } exports.decodeStrict = decodeStrict; /** * Encodes a string with entities. * * @param data String to encode. * @param options Encoding options. */ function encode(data, options) { if (options === void 0) { options = EntityLevel.XML; } var opts = typeof options === "number" ? { level: options } : options; // Mode `UTF8` just escapes XML entities if (opts.mode === EncodingMode.UTF8) return (0, escape_js_1.escapeUTF8)(data); if (opts.mode === EncodingMode.Attribute) return (0, escape_js_1.escapeAttribute)(data); if (opts.mode === EncodingMode.Text) return (0, escape_js_1.escapeText)(data); if (opts.level === EntityLevel.HTML) { if (opts.mode === EncodingMode.ASCII) { return (0, encode_js_1.encodeNonAsciiHTML)(data); } return (0, encode_js_1.encodeHTML)(data); } // ASCII and Extensive are equivalent return (0, escape_js_1.encodeXML)(data); } exports.encode = encode; var escape_js_2 = __webpack_require__(/*! ./escape.js */ "../../../node_modules/entities/lib/escape.js"); Object.defineProperty(exports, "encodeXML", ({ enumerable: true, get: function () { return escape_js_2.encodeXML; } })); Object.defineProperty(exports, "escape", ({ enumerable: true, get: function () { return escape_js_2.escape; } })); Object.defineProperty(exports, "escapeUTF8", ({ enumerable: true, get: function () { return escape_js_2.escapeUTF8; } })); Object.defineProperty(exports, "escapeAttribute", ({ enumerable: true, get: function () { return escape_js_2.escapeAttribute; } })); Object.defineProperty(exports, "escapeText", ({ enumerable: true, get: function () { return escape_js_2.escapeText; } })); var encode_js_2 = __webpack_require__(/*! ./encode.js */ "../../../node_modules/entities/lib/encode.js"); Object.defineProperty(exports, "encodeHTML", ({ enumerable: true, get: function () { return encode_js_2.encodeHTML; } })); Object.defineProperty(exports, "encodeNonAsciiHTML", ({ enumerable: true, get: function () { return encode_js_2.encodeNonAsciiHTML; } })); // Legacy aliases (deprecated) Object.defineProperty(exports, "encodeHTML4", ({ enumerable: true, get: function () { return encode_js_2.encodeHTML; } })); Object.defineProperty(exports, "encodeHTML5", ({ enumerable: true, get: function () { return encode_js_2.encodeHTML; } })); var decode_js_2 = __webpack_require__(/*! ./decode.js */ "../../../node_modules/entities/lib/decode.js"); Object.defineProperty(exports, "EntityDecoder", ({ enumerable: true, get: function () { return decode_js_2.EntityDecoder; } })); Object.defineProperty(exports, "DecodingMode", ({ enumerable: true, get: function () { return decode_js_2.DecodingMode; } })); Object.defineProperty(exports, "decodeXML", ({ enumerable: true, get: function () { return decode_js_2.decodeXML; } })); Object.defineProperty(exports, "decodeHTML", ({ enumerable: true, get: function () { return decode_js_2.decodeHTML; } })); Object.defineProperty(exports, "decodeHTMLStrict", ({ enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } })); Object.defineProperty(exports, "decodeHTMLAttribute", ({ enumerable: true, get: function () { return decode_js_2.decodeHTMLAttribute; } })); // Legacy aliases (deprecated) Object.defineProperty(exports, "decodeHTML4", ({ enumerable: true, get: function () { return decode_js_2.decodeHTML; } })); Object.defineProperty(exports, "decodeHTML5", ({ enumerable: true, get: function () { return decode_js_2.decodeHTML; } })); Object.defineProperty(exports, "decodeHTML4Strict", ({ enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } })); Object.defineProperty(exports, "decodeHTML5Strict", ({ enumerable: true, get: function () { return decode_js_2.decodeHTMLStrict; } })); Object.defineProperty(exports, "decodeXMLStrict", ({ enumerable: true, get: function () { return decode_js_2.decodeXML; } })); /***/ }), /***/ "../../../node_modules/framer-motion/dist/cjs/index.js": /*!*************************************************************!*\ !*** ../../../node_modules/framer-motion/dist/cjs/index.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var tslib = __webpack_require__(/*! tslib */ "../../../node_modules/tslib/tslib.es6.js"); var React = __webpack_require__(/*! react */ "react"); var heyListen = __webpack_require__(/*! hey-listen */ "../../../node_modules/hey-listen/dist/hey-listen.es.js"); var styleValueTypes = __webpack_require__(/*! style-value-types */ "../../../node_modules/style-value-types/dist/valueTypes.cjs.js"); var popmotion = __webpack_require__(/*! popmotion */ "../../../node_modules/popmotion/dist/popmotion.cjs.js"); var sync = __webpack_require__(/*! framesync */ "../../../node_modules/framesync/dist/framesync.cjs.js"); var dom = __webpack_require__(/*! @motionone/dom */ "../../../node_modules/@motionone/dom/dist/index.es.js"); function _interopDefaultLegacy(e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } function _interopNamespace(e) { if (e && e.__esModule) return e; var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n["default"] = e; return Object.freeze(n); } var React__namespace = /*#__PURE__*/_interopNamespace(React); var React__default = /*#__PURE__*/_interopDefaultLegacy(React); var sync__default = /*#__PURE__*/_interopDefaultLegacy(sync); /** * Browser-safe usage of process */ var defaultEnvironment = "production"; var env = typeof process === "undefined" || process.env === undefined ? defaultEnvironment : "development" || 0; var createDefinition = function (propNames) { return { isEnabled: function (props) { return propNames.some(function (name) { return !!props[name]; }); } }; }; var featureDefinitions = { measureLayout: createDefinition(["layout", "layoutId", "drag"]), animation: createDefinition(["animate", "exit", "variants", "whileHover", "whileTap", "whileFocus", "whileDrag", "whileInView"]), exit: createDefinition(["exit"]), drag: createDefinition(["drag", "dragControls"]), focus: createDefinition(["whileFocus"]), hover: createDefinition(["whileHover", "onHoverStart", "onHoverEnd"]), tap: createDefinition(["whileTap", "onTap", "onTapStart", "onTapCancel"]), pan: createDefinition(["onPan", "onPanStart", "onPanSessionStart", "onPanEnd"]), inView: createDefinition(["whileInView", "onViewportEnter", "onViewportLeave"]) }; function loadFeatures(features) { for (var key in features) { if (features[key] === null) continue; if (key === "projectionNodeConstructor") { featureDefinitions.projectionNodeConstructor = features[key]; } else { featureDefinitions[key].Component = features[key]; } } } var LazyContext = React.createContext({ strict: false }); var featureNames = Object.keys(featureDefinitions); var numFeatures = featureNames.length; /** * Load features via renderless components based on the provided MotionProps. */ function useFeatures(props, visualElement, preloadedFeatures) { var features = []; var lazyContext = React.useContext(LazyContext); if (!visualElement) return null; /** * If we're in development mode, check to make sure we're not rendering a motion component * as a child of LazyMotion, as this will break the file-size benefits of using it. */ if (env !== "production" && preloadedFeatures && lazyContext.strict) { heyListen.invariant(false, "You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead."); } for (var i = 0; i < numFeatures; i++) { var name_1 = featureNames[i]; var _a = featureDefinitions[name_1], isEnabled = _a.isEnabled, Component = _a.Component; /** * It might be possible in the future to use this moment to * dynamically request functionality. In initial tests this * was producing a lot of duplication amongst bundles. */ if (isEnabled(props) && Component) { features.push(React__namespace.createElement(Component, tslib.__assign({ key: name_1 }, props, { visualElement: visualElement }))); } } return features; } /** * @public */ var MotionConfigContext = React.createContext({ transformPagePoint: function (p) { return p; }, isStatic: false, reducedMotion: "never" }); var MotionContext = React.createContext({}); function useVisualElementContext() { return React.useContext(MotionContext).visualElement; } /** * @public */ var PresenceContext = React.createContext(null); var isBrowser = typeof document !== "undefined"; var useIsomorphicLayoutEffect = isBrowser ? React.useLayoutEffect : React.useEffect; // Does this device prefer reduced motion? Returns `null` server-side. var prefersReducedMotion = { current: null }; var hasDetected = false; function initPrefersReducedMotion() { hasDetected = true; if (!isBrowser) return; if (window.matchMedia) { var motionMediaQuery_1 = window.matchMedia("(prefers-reduced-motion)"); var setReducedMotionPreferences = function () { return prefersReducedMotion.current = motionMediaQuery_1.matches; }; motionMediaQuery_1.addListener(setReducedMotionPreferences); setReducedMotionPreferences(); } else { prefersReducedMotion.current = false; } } /** * A hook that returns `true` if we should be using reduced motion based on the current device's Reduced Motion setting. * * This can be used to implement changes to your UI based on Reduced Motion. For instance, replacing motion-sickness inducing * `x`/`y` animations with `opacity`, disabling the autoplay of background videos, or turning off parallax motion. * * It will actively respond to changes and re-render your components with the latest setting. * * ```jsx * export function Sidebar({ isOpen }) { * const shouldReduceMotion = useReducedMotion() * const closedX = shouldReduceMotion ? 0 : "-100%" * * return ( * * ) * } * ``` * * @return boolean * * @public */ function useReducedMotion() { /** * Lazy initialisation of prefersReducedMotion */ !hasDetected && initPrefersReducedMotion(); var _a = tslib.__read(React.useState(prefersReducedMotion.current), 1), shouldReduceMotion = _a[0]; /** * TODO See if people miss automatically updating shouldReduceMotion setting */ return shouldReduceMotion; } function useReducedMotionConfig() { var reducedMotionPreference = useReducedMotion(); var reducedMotion = React.useContext(MotionConfigContext).reducedMotion; if (reducedMotion === "never") { return false; } else if (reducedMotion === "always") { return true; } else { return reducedMotionPreference; } } function useVisualElement(Component, visualState, props, createVisualElement) { var lazyContext = React.useContext(LazyContext); var parent = useVisualElementContext(); var presenceContext = React.useContext(PresenceContext); var shouldReduceMotion = useReducedMotionConfig(); var visualElementRef = React.useRef(undefined); /** * If we haven't preloaded a renderer, check to see if we have one lazy-loaded */ if (!createVisualElement) createVisualElement = lazyContext.renderer; if (!visualElementRef.current && createVisualElement) { visualElementRef.current = createVisualElement(Component, { visualState: visualState, parent: parent, props: props, presenceId: presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.id, blockInitialAnimation: (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false, shouldReduceMotion: shouldReduceMotion }); } var visualElement = visualElementRef.current; useIsomorphicLayoutEffect(function () { visualElement === null || visualElement === void 0 ? void 0 : visualElement.syncRender(); }); React.useEffect(function () { var _a; (_a = visualElement === null || visualElement === void 0 ? void 0 : visualElement.animationState) === null || _a === void 0 ? void 0 : _a.animateChanges(); }); useIsomorphicLayoutEffect(function () { return function () { return visualElement === null || visualElement === void 0 ? void 0 : visualElement.notifyUnmount(); }; }, []); return visualElement; } function isRefObject(ref) { return typeof ref === "object" && Object.prototype.hasOwnProperty.call(ref, "current"); } /** * Creates a ref function that, when called, hydrates the provided * external ref and VisualElement. */ function useMotionRef(visualState, visualElement, externalRef) { return React.useCallback(function (instance) { var _a; instance && ((_a = visualState.mount) === null || _a === void 0 ? void 0 : _a.call(visualState, instance)); if (visualElement) { instance ? visualElement.mount(instance) : visualElement.unmount(); } if (externalRef) { if (typeof externalRef === "function") { externalRef(instance); } else if (isRefObject(externalRef)) { externalRef.current = instance; } } }, /** * Only pass a new ref callback to React if we've received a visual element * factory. Otherwise we'll be mounting/remounting every time externalRef * or other dependencies change. */ [visualElement]); } /** * Decides if the supplied variable is an array of variant labels */ function isVariantLabels(v) { return Array.isArray(v); } /** * Decides if the supplied variable is variant label */ function isVariantLabel(v) { return typeof v === "string" || isVariantLabels(v); } /** * Creates an object containing the latest state of every MotionValue on a VisualElement */ function getCurrent(visualElement) { var current = {}; visualElement.forEachValue(function (value, key) { return current[key] = value.get(); }); return current; } /** * Creates an object containing the latest velocity of every MotionValue on a VisualElement */ function getVelocity$1(visualElement) { var velocity = {}; visualElement.forEachValue(function (value, key) { return velocity[key] = value.getVelocity(); }); return velocity; } function resolveVariantFromProps(props, definition, custom, currentValues, currentVelocity) { var _a; if (currentValues === void 0) { currentValues = {}; } if (currentVelocity === void 0) { currentVelocity = {}; } /** * If the variant definition is a function, resolve. */ if (typeof definition === "function") { definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); } /** * If the variant definition is a variant label, or * the function returned a variant label, resolve. */ if (typeof definition === "string") { definition = (_a = props.variants) === null || _a === void 0 ? void 0 : _a[definition]; } /** * At this point we've resolved both functions and variant labels, * but the resolved variant label might itself have been a function. * If so, resolve. This can only have returned a valid target object. */ if (typeof definition === "function") { definition = definition(custom !== null && custom !== void 0 ? custom : props.custom, currentValues, currentVelocity); } return definition; } function resolveVariant(visualElement, definition, custom) { var props = visualElement.getProps(); return resolveVariantFromProps(props, definition, custom !== null && custom !== void 0 ? custom : props.custom, getCurrent(visualElement), getVelocity$1(visualElement)); } function checkIfControllingVariants(props) { var _a; return typeof ((_a = props.animate) === null || _a === void 0 ? void 0 : _a.start) === "function" || isVariantLabel(props.initial) || isVariantLabel(props.animate) || isVariantLabel(props.whileHover) || isVariantLabel(props.whileDrag) || isVariantLabel(props.whileTap) || isVariantLabel(props.whileFocus) || isVariantLabel(props.exit); } function checkIfVariantNode(props) { return Boolean(checkIfControllingVariants(props) || props.variants); } function getCurrentTreeVariants(props, context) { if (checkIfControllingVariants(props)) { var initial = props.initial, animate = props.animate; return { initial: initial === false || isVariantLabel(initial) ? initial : undefined, animate: isVariantLabel(animate) ? animate : undefined }; } return props.inherit !== false ? context : {}; } function useCreateMotionContext(props) { var _a = getCurrentTreeVariants(props, React.useContext(MotionContext)), initial = _a.initial, animate = _a.animate; return React.useMemo(function () { return { initial: initial, animate: animate }; }, [variantLabelsAsDependency(initial), variantLabelsAsDependency(animate)]); } function variantLabelsAsDependency(prop) { return Array.isArray(prop) ? prop.join(" ") : prop; } /** * Creates a constant value over the lifecycle of a component. * * Even if `useMemo` is provided an empty array as its final argument, it doesn't offer * a guarantee that it won't re-run for performance reasons later on. By using `useConstant` * you can ensure that initialisers don't execute twice or more. */ function useConstant(init) { var ref = React.useRef(null); if (ref.current === null) { ref.current = init(); } return ref.current; } /** * This should only ever be modified on the client otherwise it'll * persist through server requests. If we need instanced states we * could lazy-init via root. */ var globalProjectionState = { /** * Global flag as to whether the tree has animated since the last time * we resized the window */ hasAnimatedSinceResize: true, /** * We set this to true once, on the first update. Any nodes added to the tree beyond that * update will be given a `data-projection-id` attribute. */ hasEverUpdated: false }; var id$1 = 1; function useProjectionId() { return useConstant(function () { if (globalProjectionState.hasEverUpdated) { return id$1++; } }); } var LayoutGroupContext = React.createContext({}); /** * Internal, exported only for usage in Framer */ var SwitchLayoutGroupContext = React.createContext({}); function useProjection(projectionId, _a, visualElement, ProjectionNodeConstructor) { var _b; var layoutId = _a.layoutId, layout = _a.layout, drag = _a.drag, dragConstraints = _a.dragConstraints, layoutScroll = _a.layoutScroll; var initialPromotionConfig = React.useContext(SwitchLayoutGroupContext); if (!ProjectionNodeConstructor || !visualElement || (visualElement === null || visualElement === void 0 ? void 0 : visualElement.projection)) { return; } visualElement.projection = new ProjectionNodeConstructor(projectionId, visualElement.getLatestValues(), (_b = visualElement.parent) === null || _b === void 0 ? void 0 : _b.projection); visualElement.projection.setOptions({ layoutId: layoutId, layout: layout, alwaysMeasureLayout: Boolean(drag) || dragConstraints && isRefObject(dragConstraints), visualElement: visualElement, scheduleRender: function () { return visualElement.scheduleRender(); }, /** * TODO: Update options in an effect. This could be tricky as it'll be too late * to update by the time layout animations run. * We also need to fix this safeToRemove by linking it up to the one returned by usePresence, * ensuring it gets called if there's no potential layout animations. * */ animationType: typeof layout === "string" ? layout : "both", initialPromotionConfig: initialPromotionConfig, layoutScroll: layoutScroll }); } var VisualElementHandler = /** @class */function (_super) { tslib.__extends(VisualElementHandler, _super); function VisualElementHandler() { return _super !== null && _super.apply(this, arguments) || this; } /** * Update visual element props as soon as we know this update is going to be commited. */ VisualElementHandler.prototype.getSnapshotBeforeUpdate = function () { this.updateProps(); return null; }; VisualElementHandler.prototype.componentDidUpdate = function () {}; VisualElementHandler.prototype.updateProps = function () { var _a = this.props, visualElement = _a.visualElement, props = _a.props; if (visualElement) visualElement.setProps(props); }; VisualElementHandler.prototype.render = function () { return this.props.children; }; return VisualElementHandler; }(React__default["default"].Component); /** * Create a `motion` component. * * This function accepts a Component argument, which can be either a string (ie "div" * for `motion.div`), or an actual React component. * * Alongside this is a config option which provides a way of rendering the provided * component "offline", or outside the React render cycle. */ function createMotionComponent(_a) { var preloadedFeatures = _a.preloadedFeatures, createVisualElement = _a.createVisualElement, projectionNodeConstructor = _a.projectionNodeConstructor, useRender = _a.useRender, useVisualState = _a.useVisualState, Component = _a.Component; preloadedFeatures && loadFeatures(preloadedFeatures); function MotionComponent(props, externalRef) { var layoutId = useLayoutId(props); props = tslib.__assign(tslib.__assign({}, props), { layoutId: layoutId }); /** * If we're rendering in a static environment, we only visually update the component * as a result of a React-rerender rather than interactions or animations. This * means we don't need to load additional memory structures like VisualElement, * or any gesture/animation features. */ var config = React.useContext(MotionConfigContext); var features = null; var context = useCreateMotionContext(props); /** * Create a unique projection ID for this component. If a new component is added * during a layout animation we'll use this to query the DOM and hydrate its ref early, allowing * us to measure it as soon as any layout effect flushes pending layout animations. * * Performance note: It'd be better not to have to search the DOM for these elements. * For newly-entering components it could be enough to only correct treeScale, in which * case we could mount in a scale-correction mode. This wouldn't be enough for * shared element transitions however. Perhaps for those we could revert to a root node * that gets forceRendered and layout animations are triggered on its layout effect. */ var projectionId = config.isStatic ? undefined : useProjectionId(); /** * */ var visualState = useVisualState(props, config.isStatic); if (!config.isStatic && isBrowser) { /** * Create a VisualElement for this component. A VisualElement provides a common * interface to renderer-specific APIs (ie DOM/Three.js etc) as well as * providing a way of rendering to these APIs outside of the React render loop * for more performant animations and interactions */ context.visualElement = useVisualElement(Component, visualState, tslib.__assign(tslib.__assign({}, config), props), createVisualElement); useProjection(projectionId, props, context.visualElement, projectionNodeConstructor || featureDefinitions.projectionNodeConstructor); /** * Load Motion gesture and animation features. These are rendered as renderless * components so each feature can optionally make use of React lifecycle methods. */ features = useFeatures(props, context.visualElement, preloadedFeatures); } /** * The mount order and hierarchy is specific to ensure our element ref * is hydrated by the time features fire their effects. */ return React__namespace.createElement(VisualElementHandler, { visualElement: context.visualElement, props: tslib.__assign(tslib.__assign({}, config), props) }, features, React__namespace.createElement(MotionContext.Provider, { value: context }, useRender(Component, props, projectionId, useMotionRef(visualState, context.visualElement, externalRef), visualState, config.isStatic, context.visualElement))); } return React.forwardRef(MotionComponent); } function useLayoutId(_a) { var _b; var layoutId = _a.layoutId; var layoutGroupId = (_b = React.useContext(LayoutGroupContext)) === null || _b === void 0 ? void 0 : _b.id; return layoutGroupId && layoutId !== undefined ? layoutGroupId + "-" + layoutId : layoutId; } /** * Convert any React component into a `motion` component. The provided component * **must** use `React.forwardRef` to the underlying DOM component you want to animate. * * ```jsx * const Component = React.forwardRef((props, ref) => { * return
* }) * * const MotionComponent = motion(Component) * ``` * * @public */ function createMotionProxy(createConfig) { function custom(Component, customMotionComponentConfig) { if (customMotionComponentConfig === void 0) { customMotionComponentConfig = {}; } return createMotionComponent(createConfig(Component, customMotionComponentConfig)); } if (typeof Proxy === "undefined") { return custom; } /** * A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc. * Rather than generating them anew every render. */ var componentCache = new Map(); return new Proxy(custom, { /** * Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc. * The prop name is passed through as `key` and we can use that to generate a `motion` * DOM component with that name. */ get: function (_target, key) { /** * If this element doesn't exist in the component cache, create it and cache. */ if (!componentCache.has(key)) { componentCache.set(key, custom(key)); } return componentCache.get(key); } }); } /** * We keep these listed seperately as we use the lowercase tag names as part * of the runtime bundle to detect SVG components */ var lowercaseSVGElements = ["animate", "circle", "defs", "desc", "ellipse", "g", "image", "line", "filter", "marker", "mask", "metadata", "path", "pattern", "polygon", "polyline", "rect", "stop", "svg", "switch", "symbol", "text", "tspan", "use", "view"]; function isSVGComponent(Component) { if ( /** * If it's not a string, it's a custom React component. Currently we only support * HTML custom React components. */ typeof Component !== "string" || /** * If it contains a dash, the element is a custom HTML webcomponent. */ Component.includes("-")) { return false; } else if ( /** * If it's in our list of lowercase SVG tags, it's an SVG component */ lowercaseSVGElements.indexOf(Component) > -1 || /** * If it contains a capital letter, it's an SVG component */ /[A-Z]/.test(Component)) { return true; } return false; } var scaleCorrectors = {}; function addScaleCorrector(correctors) { Object.assign(scaleCorrectors, correctors); } /** * A list of all transformable axes. We'll use this list to generated a version * of each axes for each transform. */ var transformAxes = ["", "X", "Y", "Z"]; /** * An ordered array of each transformable value. By default, transform values * will be sorted to this order. */ var order = ["translate", "scale", "rotate", "skew"]; /** * Generate a list of every possible transform key. */ var transformProps = ["transformPerspective", "x", "y", "z"]; order.forEach(function (operationKey) { return transformAxes.forEach(function (axesKey) { return transformProps.push(operationKey + axesKey); }); }); /** * A function to use with Array.sort to sort transform keys by their default order. */ function sortTransformProps(a, b) { return transformProps.indexOf(a) - transformProps.indexOf(b); } /** * A quick lookup for transform props. */ var transformPropSet = new Set(transformProps); function isTransformProp(key) { return transformPropSet.has(key); } /** * A quick lookup for transform origin props */ var transformOriginProps = new Set(["originX", "originY", "originZ"]); function isTransformOriginProp(key) { return transformOriginProps.has(key); } function isForcedMotionValue(key, _a) { var layout = _a.layout, layoutId = _a.layoutId; return isTransformProp(key) || isTransformOriginProp(key) || (layout || layoutId !== undefined) && (!!scaleCorrectors[key] || key === "opacity"); } var isMotionValue = function (value) { return Boolean(value !== null && typeof value === "object" && value.getVelocity); }; var translateAlias = { x: "translateX", y: "translateY", z: "translateZ", transformPerspective: "perspective" }; /** * Build a CSS transform style from individual x/y/scale etc properties. * * This outputs with a default order of transforms/scales/rotations, this can be customised by * providing a transformTemplate function. */ function buildTransform(_a, _b, transformIsDefault, transformTemplate) { var transform = _a.transform, transformKeys = _a.transformKeys; var _c = _b.enableHardwareAcceleration, enableHardwareAcceleration = _c === void 0 ? true : _c, _d = _b.allowTransformNone, allowTransformNone = _d === void 0 ? true : _d; // The transform string we're going to build into. var transformString = ""; // Transform keys into their default order - this will determine the output order. transformKeys.sort(sortTransformProps); // Track whether the defined transform has a defined z so we don't add a // second to enable hardware acceleration var transformHasZ = false; // Loop over each transform and build them into transformString var numTransformKeys = transformKeys.length; for (var i = 0; i < numTransformKeys; i++) { var key = transformKeys[i]; transformString += "".concat(translateAlias[key] || key, "(").concat(transform[key], ") "); if (key === "z") transformHasZ = true; } if (!transformHasZ && enableHardwareAcceleration) { transformString += "translateZ(0)"; } else { transformString = transformString.trim(); } // If we have a custom `transform` template, pass our transform values and // generated transformString to that before returning if (transformTemplate) { transformString = transformTemplate(transform, transformIsDefault ? "" : transformString); } else if (allowTransformNone && transformIsDefault) { transformString = "none"; } return transformString; } /** * Build a transformOrigin style. Uses the same defaults as the browser for * undefined origins. */ function buildTransformOrigin(_a) { var _b = _a.originX, originX = _b === void 0 ? "50%" : _b, _c = _a.originY, originY = _c === void 0 ? "50%" : _c, _d = _a.originZ, originZ = _d === void 0 ? 0 : _d; return "".concat(originX, " ").concat(originY, " ").concat(originZ); } /** * Returns true if the provided key is a CSS variable */ function isCSSVariable$1(key) { return key.startsWith("--"); } /** * Provided a value and a ValueType, returns the value as that value type. */ var getValueAsType = function (value, type) { return type && typeof value === "number" ? type.transform(value) : value; }; var int = tslib.__assign(tslib.__assign({}, styleValueTypes.number), { transform: Math.round }); var numberValueTypes = { // Border props borderWidth: styleValueTypes.px, borderTopWidth: styleValueTypes.px, borderRightWidth: styleValueTypes.px, borderBottomWidth: styleValueTypes.px, borderLeftWidth: styleValueTypes.px, borderRadius: styleValueTypes.px, radius: styleValueTypes.px, borderTopLeftRadius: styleValueTypes.px, borderTopRightRadius: styleValueTypes.px, borderBottomRightRadius: styleValueTypes.px, borderBottomLeftRadius: styleValueTypes.px, // Positioning props width: styleValueTypes.px, maxWidth: styleValueTypes.px, height: styleValueTypes.px, maxHeight: styleValueTypes.px, size: styleValueTypes.px, top: styleValueTypes.px, right: styleValueTypes.px, bottom: styleValueTypes.px, left: styleValueTypes.px, // Spacing props padding: styleValueTypes.px, paddingTop: styleValueTypes.px, paddingRight: styleValueTypes.px, paddingBottom: styleValueTypes.px, paddingLeft: styleValueTypes.px, margin: styleValueTypes.px, marginTop: styleValueTypes.px, marginRight: styleValueTypes.px, marginBottom: styleValueTypes.px, marginLeft: styleValueTypes.px, // Transform props rotate: styleValueTypes.degrees, rotateX: styleValueTypes.degrees, rotateY: styleValueTypes.degrees, rotateZ: styleValueTypes.degrees, scale: styleValueTypes.scale, scaleX: styleValueTypes.scale, scaleY: styleValueTypes.scale, scaleZ: styleValueTypes.scale, skew: styleValueTypes.degrees, skewX: styleValueTypes.degrees, skewY: styleValueTypes.degrees, distance: styleValueTypes.px, translateX: styleValueTypes.px, translateY: styleValueTypes.px, translateZ: styleValueTypes.px, x: styleValueTypes.px, y: styleValueTypes.px, z: styleValueTypes.px, perspective: styleValueTypes.px, transformPerspective: styleValueTypes.px, opacity: styleValueTypes.alpha, originX: styleValueTypes.progressPercentage, originY: styleValueTypes.progressPercentage, originZ: styleValueTypes.px, // Misc zIndex: int, // SVG fillOpacity: styleValueTypes.alpha, strokeOpacity: styleValueTypes.alpha, numOctaves: int }; function buildHTMLStyles(state, latestValues, options, transformTemplate) { var _a; var style = state.style, vars = state.vars, transform = state.transform, transformKeys = state.transformKeys, transformOrigin = state.transformOrigin; // Empty the transformKeys array. As we're throwing out refs to its items // this might not be as cheap as suspected. Maybe using the array as a buffer // with a manual incrementation would be better. transformKeys.length = 0; // Track whether we encounter any transform or transformOrigin values. var hasTransform = false; var hasTransformOrigin = false; // Does the calculated transform essentially equal "none"? var transformIsNone = true; /** * Loop over all our latest animated values and decide whether to handle them * as a style or CSS variable. * * Transforms and transform origins are kept seperately for further processing. */ for (var key in latestValues) { var value = latestValues[key]; /** * If this is a CSS variable we don't do any further processing. */ if (isCSSVariable$1(key)) { vars[key] = value; continue; } // Convert the value to its default value type, ie 0 -> "0px" var valueType = numberValueTypes[key]; var valueAsType = getValueAsType(value, valueType); if (isTransformProp(key)) { // If this is a transform, flag to enable further transform processing hasTransform = true; transform[key] = valueAsType; transformKeys.push(key); // If we already know we have a non-default transform, early return if (!transformIsNone) continue; // Otherwise check to see if this is a default transform if (value !== ((_a = valueType.default) !== null && _a !== void 0 ? _a : 0)) transformIsNone = false; } else if (isTransformOriginProp(key)) { transformOrigin[key] = valueAsType; // If this is a transform origin, flag and enable further transform-origin processing hasTransformOrigin = true; } else { style[key] = valueAsType; } } if (hasTransform) { style.transform = buildTransform(state, options, transformIsNone, transformTemplate); } else if (transformTemplate) { style.transform = transformTemplate({}, ""); } else if (!latestValues.transform && style.transform) { style.transform = "none"; } if (hasTransformOrigin) { style.transformOrigin = buildTransformOrigin(transformOrigin); } } var createHtmlRenderState = function () { return { style: {}, transform: {}, transformKeys: [], transformOrigin: {}, vars: {} }; }; function copyRawValuesOnly(target, source, props) { for (var key in source) { if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) { target[key] = source[key]; } } } function useInitialMotionValues(_a, visualState, isStatic) { var transformTemplate = _a.transformTemplate; return React.useMemo(function () { var state = createHtmlRenderState(); buildHTMLStyles(state, visualState, { enableHardwareAcceleration: !isStatic }, transformTemplate); var vars = state.vars, style = state.style; return tslib.__assign(tslib.__assign({}, vars), style); }, [visualState]); } function useStyle(props, visualState, isStatic) { var styleProp = props.style || {}; var style = {}; /** * Copy non-Motion Values straight into style */ copyRawValuesOnly(style, styleProp, props); Object.assign(style, useInitialMotionValues(props, visualState, isStatic)); if (props.transformValues) { style = props.transformValues(style); } return style; } function useHTMLProps(props, visualState, isStatic) { // The `any` isn't ideal but it is the type of createElement props argument var htmlProps = {}; var style = useStyle(props, visualState, isStatic); if (Boolean(props.drag) && props.dragListener !== false) { // Disable the ghost element when a user drags htmlProps.draggable = false; // Disable text selection style.userSelect = style.WebkitUserSelect = style.WebkitTouchCallout = "none"; // Disable scrolling on the draggable direction style.touchAction = props.drag === true ? "none" : "pan-".concat(props.drag === "x" ? "y" : "x"); } htmlProps.style = style; return htmlProps; } /** * A list of all valid MotionProps. * * @privateRemarks * This doesn't throw if a `MotionProp` name is missing - it should. */ var validMotionProps = new Set(["initial", "animate", "exit", "style", "variants", "transition", "transformTemplate", "transformValues", "custom", "inherit", "layout", "layoutId", "layoutDependency", "onLayoutAnimationStart", "onLayoutAnimationComplete", "onLayoutMeasure", "onBeforeLayoutMeasure", "onAnimationStart", "onAnimationComplete", "onUpdate", "onDragStart", "onDrag", "onDragEnd", "onMeasureDragConstraints", "onDirectionLock", "onDragTransitionEnd", "drag", "dragControls", "dragListener", "dragConstraints", "dragDirectionLock", "dragSnapToOrigin", "_dragX", "_dragY", "dragElastic", "dragMomentum", "dragPropagation", "dragTransition", "whileDrag", "onPan", "onPanStart", "onPanEnd", "onPanSessionStart", "onTap", "onTapStart", "onTapCancel", "onHoverStart", "onHoverEnd", "whileFocus", "whileTap", "whileHover", "whileInView", "onViewportEnter", "onViewportLeave", "viewport", "layoutScroll"]); /** * Check whether a prop name is a valid `MotionProp` key. * * @param key - Name of the property to check * @returns `true` is key is a valid `MotionProp`. * * @public */ function isValidMotionProp(key) { return validMotionProps.has(key); } var shouldForward = function (key) { return !isValidMotionProp(key); }; function loadExternalIsValidProp(isValidProp) { if (!isValidProp) return; // Explicitly filter our events shouldForward = function (key) { return key.startsWith("on") ? !isValidMotionProp(key) : isValidProp(key); }; } /** * Emotion and Styled Components both allow users to pass through arbitrary props to their components * to dynamically generate CSS. They both use the `@emotion/is-prop-valid` package to determine which * of these should be passed to the underlying DOM node. * * However, when styling a Motion component `styled(motion.div)`, both packages pass through *all* props * as it's seen as an arbitrary component rather than a DOM node. Motion only allows arbitrary props * passed through the `custom` prop so it doesn't *need* the payload or computational overhead of * `@emotion/is-prop-valid`, however to fix this problem we need to use it. * * By making it an optionalDependency we can offer this functionality only in the situations where it's * actually required. */ try { /** * We attempt to import this package but require won't be defined in esm environments, in that case * isPropValid will have to be provided via `MotionContext`. In a 6.0.0 this should probably be removed * in favour of explicit injection. */ loadExternalIsValidProp((__webpack_require__(/*! @emotion/is-prop-valid */ "../../../node_modules/@emotion/is-prop-valid/dist/is-prop-valid.browser.esm.js")["default"])); } catch (_a) { // We don't need to actually do anything here - the fallback is the existing `isPropValid`. } function filterProps(props, isDom, forwardMotionProps) { var filteredProps = {}; for (var key in props) { if (shouldForward(key) || forwardMotionProps === true && isValidMotionProp(key) || !isDom && !isValidMotionProp(key) || // If trying to use native HTML drag events, forward drag listeners props["draggable"] && key.startsWith("onDrag")) { filteredProps[key] = props[key]; } } return filteredProps; } function calcOrigin$1(origin, offset, size) { return typeof origin === "string" ? origin : styleValueTypes.px.transform(offset + size * origin); } /** * The SVG transform origin defaults are different to CSS and is less intuitive, * so we use the measured dimensions of the SVG to reconcile these. */ function calcSVGTransformOrigin(dimensions, originX, originY) { var pxOriginX = calcOrigin$1(originX, dimensions.x, dimensions.width); var pxOriginY = calcOrigin$1(originY, dimensions.y, dimensions.height); return "".concat(pxOriginX, " ").concat(pxOriginY); } var dashKeys = { offset: "stroke-dashoffset", array: "stroke-dasharray" }; var camelKeys = { offset: "strokeDashoffset", array: "strokeDasharray" }; /** * Build SVG path properties. Uses the path's measured length to convert * our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset * and stroke-dasharray attributes. * * This function is mutative to reduce per-frame GC. */ function buildSVGPath(attrs, length, spacing, offset, useDashCase) { if (spacing === void 0) { spacing = 1; } if (offset === void 0) { offset = 0; } if (useDashCase === void 0) { useDashCase = true; } // Normalise path length by setting SVG attribute pathLength to 1 attrs.pathLength = 1; // We use dash case when setting attributes directly to the DOM node and camel case // when defining props on a React component. var keys = useDashCase ? dashKeys : camelKeys; // Build the dash offset attrs[keys.offset] = styleValueTypes.px.transform(-offset); // Build the dash array var pathLength = styleValueTypes.px.transform(length); var pathSpacing = styleValueTypes.px.transform(spacing); attrs[keys.array] = "".concat(pathLength, " ").concat(pathSpacing); } /** * Build SVG visual attrbutes, like cx and style.transform */ function buildSVGAttrs(state, _a, options, transformTemplate) { var attrX = _a.attrX, attrY = _a.attrY, originX = _a.originX, originY = _a.originY, pathLength = _a.pathLength, _b = _a.pathSpacing, pathSpacing = _b === void 0 ? 1 : _b, _c = _a.pathOffset, pathOffset = _c === void 0 ? 0 : _c, // This is object creation, which we try to avoid per-frame. latest = tslib.__rest(_a, ["attrX", "attrY", "originX", "originY", "pathLength", "pathSpacing", "pathOffset"]); buildHTMLStyles(state, latest, options, transformTemplate); state.attrs = state.style; state.style = {}; var attrs = state.attrs, style = state.style, dimensions = state.dimensions; /** * However, we apply transforms as CSS transforms. So if we detect a transform we take it from attrs * and copy it into style. */ if (attrs.transform) { if (dimensions) style.transform = attrs.transform; delete attrs.transform; } // Parse transformOrigin if (dimensions && (originX !== undefined || originY !== undefined || style.transform)) { style.transformOrigin = calcSVGTransformOrigin(dimensions, originX !== undefined ? originX : 0.5, originY !== undefined ? originY : 0.5); } // Treat x/y not as shortcuts but as actual attributes if (attrX !== undefined) attrs.x = attrX; if (attrY !== undefined) attrs.y = attrY; // Build SVG path if one has been defined if (pathLength !== undefined) { buildSVGPath(attrs, pathLength, pathSpacing, pathOffset, false); } } var createSvgRenderState = function () { return tslib.__assign(tslib.__assign({}, createHtmlRenderState()), { attrs: {} }); }; function useSVGProps(props, visualState) { var visualProps = React.useMemo(function () { var state = createSvgRenderState(); buildSVGAttrs(state, visualState, { enableHardwareAcceleration: false }, props.transformTemplate); return tslib.__assign(tslib.__assign({}, state.attrs), { style: tslib.__assign({}, state.style) }); }, [visualState]); if (props.style) { var rawStyles = {}; copyRawValuesOnly(rawStyles, props.style, props); visualProps.style = tslib.__assign(tslib.__assign({}, rawStyles), visualProps.style); } return visualProps; } function createUseRender(forwardMotionProps) { if (forwardMotionProps === void 0) { forwardMotionProps = false; } var useRender = function (Component, props, projectionId, ref, _a, isStatic) { var latestValues = _a.latestValues; var useVisualProps = isSVGComponent(Component) ? useSVGProps : useHTMLProps; var visualProps = useVisualProps(props, latestValues, isStatic); var filteredProps = filterProps(props, typeof Component === "string", forwardMotionProps); var elementProps = tslib.__assign(tslib.__assign(tslib.__assign({}, filteredProps), visualProps), { ref: ref }); if (projectionId) { elementProps["data-projection-id"] = projectionId; } return React.createElement(Component, elementProps); }; return useRender; } var CAMEL_CASE_PATTERN = /([a-z])([A-Z])/g; var REPLACE_TEMPLATE = "$1-$2"; /** * Convert camelCase to dash-case properties. */ var camelToDash = function (str) { return str.replace(CAMEL_CASE_PATTERN, REPLACE_TEMPLATE).toLowerCase(); }; function renderHTML(element, _a, styleProp, projection) { var style = _a.style, vars = _a.vars; Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp)); // Loop over any CSS variables and assign those. for (var key in vars) { element.style.setProperty(key, vars[key]); } } /** * A set of attribute names that are always read/written as camel case. */ var camelCaseAttributes = new Set(["baseFrequency", "diffuseConstant", "kernelMatrix", "kernelUnitLength", "keySplines", "keyTimes", "limitingConeAngle", "markerHeight", "markerWidth", "numOctaves", "targetX", "targetY", "surfaceScale", "specularConstant", "specularExponent", "stdDeviation", "tableValues", "viewBox", "gradientTransform", "pathLength"]); function renderSVG(element, renderState, _styleProp, projection) { renderHTML(element, renderState, undefined, projection); for (var key in renderState.attrs) { element.setAttribute(!camelCaseAttributes.has(key) ? camelToDash(key) : key, renderState.attrs[key]); } } function scrapeMotionValuesFromProps$1(props) { var style = props.style; var newValues = {}; for (var key in style) { if (isMotionValue(style[key]) || isForcedMotionValue(key, props)) { newValues[key] = style[key]; } } return newValues; } function scrapeMotionValuesFromProps(props) { var newValues = scrapeMotionValuesFromProps$1(props); for (var key in props) { if (isMotionValue(props[key])) { var targetKey = key === "x" || key === "y" ? "attr" + key.toUpperCase() : key; newValues[targetKey] = props[key]; } } return newValues; } function isAnimationControls(v) { return typeof v === "object" && typeof v.start === "function"; } var isKeyframesTarget = function (v) { return Array.isArray(v); }; var isCustomValue = function (v) { return Boolean(v && typeof v === "object" && v.mix && v.toValue); }; var resolveFinalValueInKeyframes = function (v) { // TODO maybe throw if v.length - 1 is placeholder token? return isKeyframesTarget(v) ? v[v.length - 1] || 0 : v; }; /** * If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself * * TODO: Remove and move to library */ function resolveMotionValue(value) { var unwrappedValue = isMotionValue(value) ? value.get() : value; return isCustomValue(unwrappedValue) ? unwrappedValue.toValue() : unwrappedValue; } function makeState(_a, props, context, presenceContext) { var scrapeMotionValuesFromProps = _a.scrapeMotionValuesFromProps, createRenderState = _a.createRenderState, onMount = _a.onMount; var state = { latestValues: makeLatestValues(props, context, presenceContext, scrapeMotionValuesFromProps), renderState: createRenderState() }; if (onMount) { state.mount = function (instance) { return onMount(props, instance, state); }; } return state; } var makeUseVisualState = function (config) { return function (props, isStatic) { var context = React.useContext(MotionContext); var presenceContext = React.useContext(PresenceContext); return isStatic ? makeState(config, props, context, presenceContext) : useConstant(function () { return makeState(config, props, context, presenceContext); }); }; }; function makeLatestValues(props, context, presenceContext, scrapeMotionValues) { var values = {}; var blockInitialAnimation = (presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.initial) === false; var motionValues = scrapeMotionValues(props); for (var key in motionValues) { values[key] = resolveMotionValue(motionValues[key]); } var initial = props.initial, animate = props.animate; var isControllingVariants = checkIfControllingVariants(props); var isVariantNode = checkIfVariantNode(props); if (context && isVariantNode && !isControllingVariants && props.inherit !== false) { initial !== null && initial !== void 0 ? initial : initial = context.initial; animate !== null && animate !== void 0 ? animate : animate = context.animate; } var initialAnimationIsBlocked = blockInitialAnimation || initial === false; var variantToSet = initialAnimationIsBlocked ? animate : initial; if (variantToSet && typeof variantToSet !== "boolean" && !isAnimationControls(variantToSet)) { var list = Array.isArray(variantToSet) ? variantToSet : [variantToSet]; list.forEach(function (definition) { var resolved = resolveVariantFromProps(props, definition); if (!resolved) return; var transitionEnd = resolved.transitionEnd; resolved.transition; var target = tslib.__rest(resolved, ["transitionEnd", "transition"]); for (var key in target) { var valueTarget = target[key]; if (Array.isArray(valueTarget)) { /** * Take final keyframe if the initial animation is blocked because * we want to initialise at the end of that blocked animation. */ var index = initialAnimationIsBlocked ? valueTarget.length - 1 : 0; valueTarget = valueTarget[index]; } if (valueTarget !== null) { values[key] = valueTarget; } } for (var key in transitionEnd) values[key] = transitionEnd[key]; }); } return values; } var svgMotionConfig = { useVisualState: makeUseVisualState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps, createRenderState: createSvgRenderState, onMount: function (props, instance, _a) { var renderState = _a.renderState, latestValues = _a.latestValues; try { renderState.dimensions = typeof instance.getBBox === "function" ? instance.getBBox() : instance.getBoundingClientRect(); } catch (e) { // Most likely trying to measure an unrendered element under Firefox renderState.dimensions = { x: 0, y: 0, width: 0, height: 0 }; } buildSVGAttrs(renderState, latestValues, { enableHardwareAcceleration: false }, props.transformTemplate); renderSVG(instance, renderState); } }) }; var htmlMotionConfig = { useVisualState: makeUseVisualState({ scrapeMotionValuesFromProps: scrapeMotionValuesFromProps$1, createRenderState: createHtmlRenderState }) }; function createDomMotionConfig(Component, _a, preloadedFeatures, createVisualElement, projectionNodeConstructor) { var _b = _a.forwardMotionProps, forwardMotionProps = _b === void 0 ? false : _b; var baseConfig = isSVGComponent(Component) ? svgMotionConfig : htmlMotionConfig; return tslib.__assign(tslib.__assign({}, baseConfig), { preloadedFeatures: preloadedFeatures, useRender: createUseRender(forwardMotionProps), createVisualElement: createVisualElement, projectionNodeConstructor: projectionNodeConstructor, Component: Component }); } exports.AnimationType = void 0; (function (AnimationType) { AnimationType["Animate"] = "animate"; AnimationType["Hover"] = "whileHover"; AnimationType["Tap"] = "whileTap"; AnimationType["Drag"] = "whileDrag"; AnimationType["Focus"] = "whileFocus"; AnimationType["InView"] = "whileInView"; AnimationType["Exit"] = "exit"; })(exports.AnimationType || (exports.AnimationType = {})); function addDomEvent(target, eventName, handler, options) { if (options === void 0) { options = { passive: true }; } target.addEventListener(eventName, handler, options); return function () { return target.removeEventListener(eventName, handler); }; } /** * Attaches an event listener directly to the provided DOM element. * * Bypassing React's event system can be desirable, for instance when attaching non-passive * event handlers. * * ```jsx * const ref = useRef(null) * * useDomEvent(ref, 'wheel', onWheel, { passive: false }) * * return
* ``` * * @param ref - React.RefObject that's been provided to the element you want to bind the listener to. * @param eventName - Name of the event you want listen for. * @param handler - Function to fire when receiving the event. * @param options - Options to pass to `Event.addEventListener`. * * @public */ function useDomEvent(ref, eventName, handler, options) { React.useEffect(function () { var element = ref.current; if (handler && element) { return addDomEvent(element, eventName, handler, options); } }, [ref, eventName, handler, options]); } /** * * @param props * @param ref * @internal */ function useFocusGesture(_a) { var whileFocus = _a.whileFocus, visualElement = _a.visualElement; var onFocus = function () { var _a; (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Focus, true); }; var onBlur = function () { var _a; (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Focus, false); }; useDomEvent(visualElement, "focus", whileFocus ? onFocus : undefined); useDomEvent(visualElement, "blur", whileFocus ? onBlur : undefined); } function isMouseEvent(event) { // PointerEvent inherits from MouseEvent so we can't use a straight instanceof check. if (typeof PointerEvent !== "undefined" && event instanceof PointerEvent) { return !!(event.pointerType === "mouse"); } return event instanceof MouseEvent; } function isTouchEvent(event) { var hasTouches = !!event.touches; return hasTouches; } /** * Filters out events not attached to the primary pointer (currently left mouse button) * @param eventHandler */ function filterPrimaryPointer(eventHandler) { return function (event) { var isMouseEvent = event instanceof MouseEvent; var isPrimaryPointer = !isMouseEvent || isMouseEvent && event.button === 0; if (isPrimaryPointer) { eventHandler(event); } }; } var defaultPagePoint = { pageX: 0, pageY: 0 }; function pointFromTouch(e, pointType) { if (pointType === void 0) { pointType = "page"; } var primaryTouch = e.touches[0] || e.changedTouches[0]; var point = primaryTouch || defaultPagePoint; return { x: point[pointType + "X"], y: point[pointType + "Y"] }; } function pointFromMouse(point, pointType) { if (pointType === void 0) { pointType = "page"; } return { x: point[pointType + "X"], y: point[pointType + "Y"] }; } function extractEventInfo(event, pointType) { if (pointType === void 0) { pointType = "page"; } return { point: isTouchEvent(event) ? pointFromTouch(event, pointType) : pointFromMouse(event, pointType) }; } var wrapHandler = function (handler, shouldFilterPrimaryPointer) { if (shouldFilterPrimaryPointer === void 0) { shouldFilterPrimaryPointer = false; } var listener = function (event) { return handler(event, extractEventInfo(event)); }; return shouldFilterPrimaryPointer ? filterPrimaryPointer(listener) : listener; }; // We check for event support via functions in case they've been mocked by a testing suite. var supportsPointerEvents = function () { return isBrowser && window.onpointerdown === null; }; var supportsTouchEvents = function () { return isBrowser && window.ontouchstart === null; }; var supportsMouseEvents = function () { return isBrowser && window.onmousedown === null; }; var mouseEventNames = { pointerdown: "mousedown", pointermove: "mousemove", pointerup: "mouseup", pointercancel: "mousecancel", pointerover: "mouseover", pointerout: "mouseout", pointerenter: "mouseenter", pointerleave: "mouseleave" }; var touchEventNames = { pointerdown: "touchstart", pointermove: "touchmove", pointerup: "touchend", pointercancel: "touchcancel" }; function getPointerEventName(name) { if (supportsPointerEvents()) { return name; } else if (supportsTouchEvents()) { return touchEventNames[name]; } else if (supportsMouseEvents()) { return mouseEventNames[name]; } return name; } function addPointerEvent(target, eventName, handler, options) { return addDomEvent(target, getPointerEventName(eventName), wrapHandler(handler, eventName === "pointerdown"), options); } function usePointerEvent(ref, eventName, handler, options) { return useDomEvent(ref, getPointerEventName(eventName), handler && wrapHandler(handler, eventName === "pointerdown"), options); } function createLock(name) { var lock = null; return function () { var openLock = function () { lock = null; }; if (lock === null) { lock = name; return openLock; } return false; }; } var globalHorizontalLock = createLock("dragHorizontal"); var globalVerticalLock = createLock("dragVertical"); function getGlobalLock(drag) { var lock = false; if (drag === "y") { lock = globalVerticalLock(); } else if (drag === "x") { lock = globalHorizontalLock(); } else { var openHorizontal_1 = globalHorizontalLock(); var openVertical_1 = globalVerticalLock(); if (openHorizontal_1 && openVertical_1) { lock = function () { openHorizontal_1(); openVertical_1(); }; } else { // Release the locks because we don't use them if (openHorizontal_1) openHorizontal_1(); if (openVertical_1) openVertical_1(); } } return lock; } function isDragActive() { // Check the gesture lock - if we get it, it means no drag gesture is active // and we can safely fire the tap gesture. var openGestureLock = getGlobalLock(true); if (!openGestureLock) return true; openGestureLock(); return false; } function createHoverEvent(visualElement, isActive, callback) { return function (event, info) { var _a; if (!isMouseEvent(event) || isDragActive()) return; /** * Ensure we trigger animations before firing event callback */ (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Hover, isActive); callback === null || callback === void 0 ? void 0 : callback(event, info); }; } function useHoverGesture(_a) { var onHoverStart = _a.onHoverStart, onHoverEnd = _a.onHoverEnd, whileHover = _a.whileHover, visualElement = _a.visualElement; usePointerEvent(visualElement, "pointerenter", onHoverStart || whileHover ? createHoverEvent(visualElement, true, onHoverStart) : undefined, { passive: !onHoverStart }); usePointerEvent(visualElement, "pointerleave", onHoverEnd || whileHover ? createHoverEvent(visualElement, false, onHoverEnd) : undefined, { passive: !onHoverEnd }); } /** * Recursively traverse up the tree to check whether the provided child node * is the parent or a descendant of it. * * @param parent - Element to find * @param child - Element to test against parent */ var isNodeOrChild = function (parent, child) { if (!child) { return false; } else if (parent === child) { return true; } else { return isNodeOrChild(parent, child.parentElement); } }; function useUnmountEffect(callback) { return React.useEffect(function () { return function () { return callback(); }; }, []); } /** * @param handlers - * @internal */ function useTapGesture(_a) { var onTap = _a.onTap, onTapStart = _a.onTapStart, onTapCancel = _a.onTapCancel, whileTap = _a.whileTap, visualElement = _a.visualElement; var hasPressListeners = onTap || onTapStart || onTapCancel || whileTap; var isPressing = React.useRef(false); var cancelPointerEndListeners = React.useRef(null); /** * Only set listener to passive if there are no external listeners. */ var eventOptions = { passive: !(onTapStart || onTap || onTapCancel || onPointerDown) }; function removePointerEndListener() { var _a; (_a = cancelPointerEndListeners.current) === null || _a === void 0 ? void 0 : _a.call(cancelPointerEndListeners); cancelPointerEndListeners.current = null; } function checkPointerEnd() { var _a; removePointerEndListener(); isPressing.current = false; (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, false); return !isDragActive(); } function onPointerUp(event, info) { if (!checkPointerEnd()) return; /** * We only count this as a tap gesture if the event.target is the same * as, or a child of, this component's element */ !isNodeOrChild(visualElement.getInstance(), event.target) ? onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info) : onTap === null || onTap === void 0 ? void 0 : onTap(event, info); } function onPointerCancel(event, info) { if (!checkPointerEnd()) return; onTapCancel === null || onTapCancel === void 0 ? void 0 : onTapCancel(event, info); } function onPointerDown(event, info) { var _a; removePointerEndListener(); if (isPressing.current) return; isPressing.current = true; cancelPointerEndListeners.current = popmotion.pipe(addPointerEvent(window, "pointerup", onPointerUp, eventOptions), addPointerEvent(window, "pointercancel", onPointerCancel, eventOptions)); /** * Ensure we trigger animations before firing event callback */ (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Tap, true); onTapStart === null || onTapStart === void 0 ? void 0 : onTapStart(event, info); } usePointerEvent(visualElement, "pointerdown", hasPressListeners ? onPointerDown : undefined, eventOptions); useUnmountEffect(removePointerEndListener); } var warned = new Set(); function warnOnce(condition, message, element) { if (condition || warned.has(message)) return; console.warn(message); if (element) console.warn(element); warned.add(message); } /** * Map an IntersectionHandler callback to an element. We only ever make one handler for one * element, so even though these handlers might all be triggered by different * observers, we can keep them in the same map. */ var observerCallbacks = new WeakMap(); /** * Multiple observers can be created for multiple element/document roots. Each with * different settings. So here we store dictionaries of observers to each root, * using serialised settings (threshold/margin) as lookup keys. */ var observers = new WeakMap(); var fireObserverCallback = function (entry) { var _a; (_a = observerCallbacks.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry); }; var fireAllObserverCallbacks = function (entries) { entries.forEach(fireObserverCallback); }; function initIntersectionObserver(_a) { var root = _a.root, options = tslib.__rest(_a, ["root"]); var lookupRoot = root || document; /** * If we don't have an observer lookup map for this root, create one. */ if (!observers.has(lookupRoot)) { observers.set(lookupRoot, {}); } var rootObservers = observers.get(lookupRoot); var key = JSON.stringify(options); /** * If we don't have an observer for this combination of root and settings, * create one. */ if (!rootObservers[key]) { rootObservers[key] = new IntersectionObserver(fireAllObserverCallbacks, tslib.__assign({ root: root }, options)); } return rootObservers[key]; } function observeIntersection(element, options, callback) { var rootInteresectionObserver = initIntersectionObserver(options); observerCallbacks.set(element, callback); rootInteresectionObserver.observe(element); return function () { observerCallbacks.delete(element); rootInteresectionObserver.unobserve(element); }; } function useViewport(_a) { var visualElement = _a.visualElement, whileInView = _a.whileInView, onViewportEnter = _a.onViewportEnter, onViewportLeave = _a.onViewportLeave, _b = _a.viewport, viewport = _b === void 0 ? {} : _b; var state = React.useRef({ hasEnteredView: false, isInView: false }); var shouldObserve = Boolean(whileInView || onViewportEnter || onViewportLeave); if (viewport.once && state.current.hasEnteredView) shouldObserve = false; var useObserver = typeof IntersectionObserver === "undefined" ? useMissingIntersectionObserver : useIntersectionObserver; useObserver(shouldObserve, state.current, visualElement, viewport); } var thresholdNames = { some: 0, all: 1 }; function useIntersectionObserver(shouldObserve, state, visualElement, _a) { var root = _a.root, rootMargin = _a.margin, _b = _a.amount, amount = _b === void 0 ? "some" : _b, once = _a.once; React.useEffect(function () { if (!shouldObserve) return; var options = { root: root === null || root === void 0 ? void 0 : root.current, rootMargin: rootMargin, threshold: typeof amount === "number" ? amount : thresholdNames[amount] }; var intersectionCallback = function (entry) { var _a; var isIntersecting = entry.isIntersecting; /** * If there's been no change in the viewport state, early return. */ if (state.isInView === isIntersecting) return; state.isInView = isIntersecting; /** * Handle hasEnteredView. If this is only meant to run once, and * element isn't visible, early return. Otherwise set hasEnteredView to true. */ if (once && !isIntersecting && state.hasEnteredView) { return; } else if (isIntersecting) { state.hasEnteredView = true; } (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.InView, isIntersecting); /** * Use the latest committed props rather than the ones in scope * when this observer is created */ var props = visualElement.getProps(); var callback = isIntersecting ? props.onViewportEnter : props.onViewportLeave; callback === null || callback === void 0 ? void 0 : callback(entry); }; return observeIntersection(visualElement.getInstance(), options, intersectionCallback); }, [shouldObserve, root, rootMargin, amount]); } /** * If IntersectionObserver is missing, we activate inView and fire onViewportEnter * on mount. This way, the page will be in the state the author expects users * to see it in for everyone. */ function useMissingIntersectionObserver(shouldObserve, state, visualElement, _a) { var _b = _a.fallback, fallback = _b === void 0 ? true : _b; React.useEffect(function () { if (!shouldObserve || !fallback) return; if (env !== "production") { warnOnce(false, "IntersectionObserver not available on this device. whileInView animations will trigger on mount."); } /** * Fire this in an rAF because, at this point, the animation state * won't have flushed for the first time and there's certain logic in * there that behaves differently on the initial animation. * * This hook should be quite rarely called so setting this in an rAF * is preferred to changing the behaviour of the animation state. */ requestAnimationFrame(function () { var _a; state.hasEnteredView = true; var onViewportEnter = visualElement.getProps().onViewportEnter; onViewportEnter === null || onViewportEnter === void 0 ? void 0 : onViewportEnter(null); (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.InView, true); }); }, [shouldObserve]); } var makeRenderlessComponent = function (hook) { return function (props) { hook(props); return null; }; }; var gestureAnimations = { inView: makeRenderlessComponent(useViewport), tap: makeRenderlessComponent(useTapGesture), focus: makeRenderlessComponent(useFocusGesture), hover: makeRenderlessComponent(useHoverGesture) }; var counter = 0; var incrementId = function () { return counter++; }; var useId = function () { return useConstant(incrementId); }; /** * Ideally we'd use the following code to support React 18 optionally. * But this fairly fails in Webpack (otherwise treeshaking wouldn't work at all). * Need to come up with a different way of figuring this out. */ // export const useId = (React as any).useId // ? (React as any).useId // : () => useConstant(incrementId) /** * When a component is the child of `AnimatePresence`, it can use `usePresence` * to access information about whether it's still present in the React tree. * * ```jsx * import { usePresence } from "framer-motion" * * export const Component = () => { * const [isPresent, safeToRemove] = usePresence() * * useEffect(() => { * !isPresent && setTimeout(safeToRemove, 1000) * }, [isPresent]) * * return
* } * ``` * * If `isPresent` is `false`, it means that a component has been removed the tree, but * `AnimatePresence` won't really remove it until `safeToRemove` has been called. * * @public */ function usePresence() { var context = React.useContext(PresenceContext); if (context === null) return [true, null]; var isPresent = context.isPresent, onExitComplete = context.onExitComplete, register = context.register; // It's safe to call the following hooks conditionally (after an early return) because the context will always // either be null or non-null for the lifespan of the component. // Replace with useId when released in React var id = useId(); React.useEffect(function () { return register(id); }, []); var safeToRemove = function () { return onExitComplete === null || onExitComplete === void 0 ? void 0 : onExitComplete(id); }; return !isPresent && onExitComplete ? [false, safeToRemove] : [true]; } /** * Similar to `usePresence`, except `useIsPresent` simply returns whether or not the component is present. * There is no `safeToRemove` function. * * ```jsx * import { useIsPresent } from "framer-motion" * * export const Component = () => { * const isPresent = useIsPresent() * * useEffect(() => { * !isPresent && console.log("I've been removed!") * }, [isPresent]) * * return
* } * ``` * * @public */ function useIsPresent() { return isPresent(React.useContext(PresenceContext)); } function isPresent(context) { return context === null ? true : context.isPresent; } function shallowCompare(next, prev) { if (!Array.isArray(prev)) return false; var prevLength = prev.length; if (prevLength !== next.length) return false; for (var i = 0; i < prevLength; i++) { if (prev[i] !== next[i]) return false; } return true; } /** * Converts seconds to milliseconds * * @param seconds - Time in seconds. * @return milliseconds - Converted time in milliseconds. */ var secondsToMilliseconds = function (seconds) { return seconds * 1000; }; var easingLookup = { linear: popmotion.linear, easeIn: popmotion.easeIn, easeInOut: popmotion.easeInOut, easeOut: popmotion.easeOut, circIn: popmotion.circIn, circInOut: popmotion.circInOut, circOut: popmotion.circOut, backIn: popmotion.backIn, backInOut: popmotion.backInOut, backOut: popmotion.backOut, anticipate: popmotion.anticipate, bounceIn: popmotion.bounceIn, bounceInOut: popmotion.bounceInOut, bounceOut: popmotion.bounceOut }; var easingDefinitionToFunction = function (definition) { if (Array.isArray(definition)) { // If cubic bezier definition, create bezier curve heyListen.invariant(definition.length === 4, "Cubic bezier arrays must contain four numerical values."); var _a = tslib.__read(definition, 4), x1 = _a[0], y1 = _a[1], x2 = _a[2], y2 = _a[3]; return popmotion.cubicBezier(x1, y1, x2, y2); } else if (typeof definition === "string") { // Else lookup from table heyListen.invariant(easingLookup[definition] !== undefined, "Invalid easing type '".concat(definition, "'")); return easingLookup[definition]; } return definition; }; var isEasingArray = function (ease) { return Array.isArray(ease) && typeof ease[0] !== "number"; }; /** * Check if a value is animatable. Examples: * * ✅: 100, "100px", "#fff" * ❌: "block", "url(2.jpg)" * @param value * * @internal */ var isAnimatable = function (key, value) { // If the list of keys tat might be non-animatable grows, replace with Set if (key === "zIndex") return false; // If it's a number or a keyframes array, we can animate it. We might at some point // need to do a deep isAnimatable check of keyframes, or let Popmotion handle this, // but for now lets leave it like this for performance reasons if (typeof value === "number" || Array.isArray(value)) return true; if (typeof value === "string" && // It's animatable if we have a string styleValueTypes.complex.test(value) && // And it contains numbers and/or colors !value.startsWith("url(") // Unless it starts with "url(" ) { return true; } return false; }; var underDampedSpring = function () { return { type: "spring", stiffness: 500, damping: 25, restSpeed: 10 }; }; var criticallyDampedSpring = function (to) { return { type: "spring", stiffness: 550, damping: to === 0 ? 2 * Math.sqrt(550) : 30, restSpeed: 10 }; }; var linearTween = function () { return { type: "keyframes", ease: "linear", duration: 0.3 }; }; var keyframes = function (values) { return { type: "keyframes", duration: 0.8, values: values }; }; var defaultTransitions = { x: underDampedSpring, y: underDampedSpring, z: underDampedSpring, rotate: underDampedSpring, rotateX: underDampedSpring, rotateY: underDampedSpring, rotateZ: underDampedSpring, scaleX: criticallyDampedSpring, scaleY: criticallyDampedSpring, scale: criticallyDampedSpring, opacity: linearTween, backgroundColor: linearTween, color: linearTween, default: criticallyDampedSpring }; var getDefaultTransition = function (valueKey, to) { var transitionFactory; if (isKeyframesTarget(to)) { transitionFactory = keyframes; } else { transitionFactory = defaultTransitions[valueKey] || defaultTransitions.default; } return tslib.__assign({ to: to }, transitionFactory(to)); }; /** * A map of default value types for common values */ var defaultValueTypes = tslib.__assign(tslib.__assign({}, numberValueTypes), { // Color props color: styleValueTypes.color, backgroundColor: styleValueTypes.color, outlineColor: styleValueTypes.color, fill: styleValueTypes.color, stroke: styleValueTypes.color, // Border props borderColor: styleValueTypes.color, borderTopColor: styleValueTypes.color, borderRightColor: styleValueTypes.color, borderBottomColor: styleValueTypes.color, borderLeftColor: styleValueTypes.color, filter: styleValueTypes.filter, WebkitFilter: styleValueTypes.filter }); /** * Gets the default ValueType for the provided value key */ var getDefaultValueType = function (key) { return defaultValueTypes[key]; }; function getAnimatableNone(key, value) { var _a; var defaultValueType = getDefaultValueType(key); if (defaultValueType !== styleValueTypes.filter) defaultValueType = styleValueTypes.complex; // If value is not recognised as animatable, ie "none", create an animatable version origin based on the target return (_a = defaultValueType.getAnimatableNone) === null || _a === void 0 ? void 0 : _a.call(defaultValueType, value); } var instantAnimationState = { current: false }; /** * Decide whether a transition is defined on a given Transition. * This filters out orchestration options and returns true * if any options are left. */ function isTransitionDefined(_a) { _a.when; _a.delay; _a.delayChildren; _a.staggerChildren; _a.staggerDirection; _a.repeat; _a.repeatType; _a.repeatDelay; _a.from; var transition = tslib.__rest(_a, ["when", "delay", "delayChildren", "staggerChildren", "staggerDirection", "repeat", "repeatType", "repeatDelay", "from"]); return !!Object.keys(transition).length; } var legacyRepeatWarning = false; /** * Convert Framer Motion's Transition type into Popmotion-compatible options. */ function convertTransitionToAnimationOptions(_a) { var ease = _a.ease, times = _a.times, yoyo = _a.yoyo, flip = _a.flip, loop = _a.loop, transition = tslib.__rest(_a, ["ease", "times", "yoyo", "flip", "loop"]); var options = tslib.__assign({}, transition); if (times) options["offset"] = times; /** * Convert any existing durations from seconds to milliseconds */ if (transition.duration) options["duration"] = secondsToMilliseconds(transition.duration); if (transition.repeatDelay) options.repeatDelay = secondsToMilliseconds(transition.repeatDelay); /** * Map easing names to Popmotion's easing functions */ if (ease) { options["ease"] = isEasingArray(ease) ? ease.map(easingDefinitionToFunction) : easingDefinitionToFunction(ease); } /** * Support legacy transition API */ if (transition.type === "tween") options.type = "keyframes"; /** * TODO: These options are officially removed from the API. */ if (yoyo || loop || flip) { heyListen.warning(!legacyRepeatWarning, "yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."); legacyRepeatWarning = true; if (yoyo) { options.repeatType = "reverse"; } else if (loop) { options.repeatType = "loop"; } else if (flip) { options.repeatType = "mirror"; } options.repeat = loop || yoyo || flip || transition.repeat; } /** * TODO: Popmotion 9 has the ability to automatically detect whether to use * a keyframes or spring animation, but does so by detecting velocity and other spring options. * It'd be good to introduce a similar thing here. */ if (transition.type !== "spring") options.type = "keyframes"; return options; } /** * Get the delay for a value by checking Transition with decreasing specificity. */ function getDelayFromTransition(transition, key) { var _a, _b; var valueTransition = getValueTransition(transition, key) || {}; return (_b = (_a = valueTransition.delay) !== null && _a !== void 0 ? _a : transition.delay) !== null && _b !== void 0 ? _b : 0; } function hydrateKeyframes(options) { if (Array.isArray(options.to) && options.to[0] === null) { options.to = tslib.__spreadArray([], tslib.__read(options.to), false); options.to[0] = options.from; } return options; } function getPopmotionAnimationOptions(transition, options, key) { var _a; if (Array.isArray(options.to)) { (_a = transition.duration) !== null && _a !== void 0 ? _a : transition.duration = 0.8; } hydrateKeyframes(options); /** * Get a default transition if none is determined to be defined. */ if (!isTransitionDefined(transition)) { transition = tslib.__assign(tslib.__assign({}, transition), getDefaultTransition(key, options.to)); } return tslib.__assign(tslib.__assign({}, options), convertTransitionToAnimationOptions(transition)); } /** * */ function getAnimation(key, value, target, transition, onComplete) { var _a; var valueTransition = getValueTransition(transition, key); var origin = (_a = valueTransition.from) !== null && _a !== void 0 ? _a : value.get(); var isTargetAnimatable = isAnimatable(key, target); if (origin === "none" && isTargetAnimatable && typeof target === "string") { /** * If we're trying to animate from "none", try and get an animatable version * of the target. This could be improved to work both ways. */ origin = getAnimatableNone(key, target); } else if (isZero(origin) && typeof target === "string") { origin = getZeroUnit(target); } else if (!Array.isArray(target) && isZero(target) && typeof origin === "string") { target = getZeroUnit(origin); } var isOriginAnimatable = isAnimatable(key, origin); heyListen.warning(isOriginAnimatable === isTargetAnimatable, "You are trying to animate ".concat(key, " from \"").concat(origin, "\" to \"").concat(target, "\". ").concat(origin, " is not an animatable value - to enable this animation set ").concat(origin, " to a value animatable to ").concat(target, " via the `style` property.")); function start() { var options = { from: origin, to: target, velocity: value.getVelocity(), onComplete: onComplete, onUpdate: function (v) { return value.set(v); } }; return valueTransition.type === "inertia" || valueTransition.type === "decay" ? popmotion.inertia(tslib.__assign(tslib.__assign({}, options), valueTransition)) : popmotion.animate(tslib.__assign(tslib.__assign({}, getPopmotionAnimationOptions(valueTransition, options, key)), { onUpdate: function (v) { var _a; options.onUpdate(v); (_a = valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, v); }, onComplete: function () { var _a; options.onComplete(); (_a = valueTransition.onComplete) === null || _a === void 0 ? void 0 : _a.call(valueTransition); } })); } function set() { var _a, _b; var finalTarget = resolveFinalValueInKeyframes(target); value.set(finalTarget); onComplete(); (_a = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onUpdate) === null || _a === void 0 ? void 0 : _a.call(valueTransition, finalTarget); (_b = valueTransition === null || valueTransition === void 0 ? void 0 : valueTransition.onComplete) === null || _b === void 0 ? void 0 : _b.call(valueTransition); return { stop: function () {} }; } return !isOriginAnimatable || !isTargetAnimatable || valueTransition.type === false ? set : start; } function isZero(value) { return value === 0 || typeof value === "string" && parseFloat(value) === 0 && value.indexOf(" ") === -1; } function getZeroUnit(potentialUnitType) { return typeof potentialUnitType === "number" ? 0 : getAnimatableNone("", potentialUnitType); } function getValueTransition(transition, key) { return transition[key] || transition["default"] || transition; } /** * Start animation on a MotionValue. This function is an interface between * Framer Motion and Popmotion */ function startAnimation(key, value, target, transition) { if (transition === void 0) { transition = {}; } if (instantAnimationState.current) { transition = { type: false }; } return value.start(function (onComplete) { var delayTimer; var controls; var animation = getAnimation(key, value, target, transition, onComplete); var delay = getDelayFromTransition(transition, key); var start = function () { return controls = animation(); }; if (delay) { delayTimer = window.setTimeout(start, secondsToMilliseconds(delay)); } else { start(); } return function () { clearTimeout(delayTimer); controls === null || controls === void 0 ? void 0 : controls.stop(); }; }); } /** * Check if value is a numerical string, ie a string that is purely a number eg "100" or "-100.1" */ var isNumericalString = function (v) { return /^\-?\d*\.?\d+$/.test(v); }; /** * Check if the value is a zero value string like "0px" or "0%" */ var isZeroValueString = function (v) { return /^0[^.\s]+$/.test(v); }; function addUniqueItem(arr, item) { arr.indexOf(item) === -1 && arr.push(item); } function removeItem(arr, item) { var index = arr.indexOf(item); index > -1 && arr.splice(index, 1); } // Adapted from array-move function moveItem(_a, fromIndex, toIndex) { var _b = tslib.__read(_a), arr = _b.slice(0); var startIndex = fromIndex < 0 ? arr.length + fromIndex : fromIndex; if (startIndex >= 0 && startIndex < arr.length) { var endIndex = toIndex < 0 ? arr.length + toIndex : toIndex; var _c = tslib.__read(arr.splice(fromIndex, 1), 1), item = _c[0]; arr.splice(endIndex, 0, item); } return arr; } var SubscriptionManager = /** @class */function () { function SubscriptionManager() { this.subscriptions = []; } SubscriptionManager.prototype.add = function (handler) { var _this = this; addUniqueItem(this.subscriptions, handler); return function () { return removeItem(_this.subscriptions, handler); }; }; SubscriptionManager.prototype.notify = function (a, b, c) { var numSubscriptions = this.subscriptions.length; if (!numSubscriptions) return; if (numSubscriptions === 1) { /** * If there's only a single handler we can just call it without invoking a loop. */ this.subscriptions[0](a, b, c); } else { for (var i = 0; i < numSubscriptions; i++) { /** * Check whether the handler exists before firing as it's possible * the subscriptions were modified during this loop running. */ var handler = this.subscriptions[i]; handler && handler(a, b, c); } } }; SubscriptionManager.prototype.getSize = function () { return this.subscriptions.length; }; SubscriptionManager.prototype.clear = function () { this.subscriptions.length = 0; }; return SubscriptionManager; }(); var isFloat = function (value) { return !isNaN(parseFloat(value)); }; /** * `MotionValue` is used to track the state and velocity of motion values. * * @public */ var MotionValue = /** @class */function () { /** * @param init - The initiating value * @param config - Optional configuration options * * - `transformer`: A function to transform incoming values with. * * @internal */ function MotionValue(init) { var _this = this; /** * This will be replaced by the build step with the latest version number. * When MotionValues are provided to motion components, warn if versions are mixed. */ this.version = "6.5.1"; /** * Duration, in milliseconds, since last updating frame. * * @internal */ this.timeDelta = 0; /** * Timestamp of the last time this `MotionValue` was updated. * * @internal */ this.lastUpdated = 0; /** * Functions to notify when the `MotionValue` updates. * * @internal */ this.updateSubscribers = new SubscriptionManager(); /** * Functions to notify when the velocity updates. * * @internal */ this.velocityUpdateSubscribers = new SubscriptionManager(); /** * Functions to notify when the `MotionValue` updates and `render` is set to `true`. * * @internal */ this.renderSubscribers = new SubscriptionManager(); /** * Tracks whether this value can output a velocity. Currently this is only true * if the value is numerical, but we might be able to widen the scope here and support * other value types. * * @internal */ this.canTrackVelocity = false; this.updateAndNotify = function (v, render) { if (render === void 0) { render = true; } _this.prev = _this.current; _this.current = v; // Update timestamp var _a = sync.getFrameData(), delta = _a.delta, timestamp = _a.timestamp; if (_this.lastUpdated !== timestamp) { _this.timeDelta = delta; _this.lastUpdated = timestamp; sync__default["default"].postRender(_this.scheduleVelocityCheck); } // Update update subscribers if (_this.prev !== _this.current) { _this.updateSubscribers.notify(_this.current); } // Update velocity subscribers if (_this.velocityUpdateSubscribers.getSize()) { _this.velocityUpdateSubscribers.notify(_this.getVelocity()); } // Update render subscribers if (render) { _this.renderSubscribers.notify(_this.current); } }; /** * Schedule a velocity check for the next frame. * * This is an instanced and bound function to prevent generating a new * function once per frame. * * @internal */ this.scheduleVelocityCheck = function () { return sync__default["default"].postRender(_this.velocityCheck); }; /** * Updates `prev` with `current` if the value hasn't been updated this frame. * This ensures velocity calculations return `0`. * * This is an instanced and bound function to prevent generating a new * function once per frame. * * @internal */ this.velocityCheck = function (_a) { var timestamp = _a.timestamp; if (timestamp !== _this.lastUpdated) { _this.prev = _this.current; _this.velocityUpdateSubscribers.notify(_this.getVelocity()); } }; this.hasAnimated = false; this.prev = this.current = init; this.canTrackVelocity = isFloat(this.current); } /** * Adds a function that will be notified when the `MotionValue` is updated. * * It returns a function that, when called, will cancel the subscription. * * When calling `onChange` inside a React component, it should be wrapped with the * `useEffect` hook. As it returns an unsubscribe function, this should be returned * from the `useEffect` function to ensure you don't add duplicate subscribers.. * * ```jsx * export const MyComponent = () => { * const x = useMotionValue(0) * const y = useMotionValue(0) * const opacity = useMotionValue(1) * * useEffect(() => { * function updateOpacity() { * const maxXY = Math.max(x.get(), y.get()) * const newOpacity = transform(maxXY, [0, 100], [1, 0]) * opacity.set(newOpacity) * } * * const unsubscribeX = x.onChange(updateOpacity) * const unsubscribeY = y.onChange(updateOpacity) * * return () => { * unsubscribeX() * unsubscribeY() * } * }, []) * * return * } * ``` * * @privateRemarks * * We could look into a `useOnChange` hook if the above lifecycle management proves confusing. * * ```jsx * useOnChange(x, () => {}) * ``` * * @param subscriber - A function that receives the latest value. * @returns A function that, when called, will cancel this subscription. * * @public */ MotionValue.prototype.onChange = function (subscription) { return this.updateSubscribers.add(subscription); }; MotionValue.prototype.clearListeners = function () { this.updateSubscribers.clear(); }; /** * Adds a function that will be notified when the `MotionValue` requests a render. * * @param subscriber - A function that's provided the latest value. * @returns A function that, when called, will cancel this subscription. * * @internal */ MotionValue.prototype.onRenderRequest = function (subscription) { // Render immediately subscription(this.get()); return this.renderSubscribers.add(subscription); }; /** * Attaches a passive effect to the `MotionValue`. * * @internal */ MotionValue.prototype.attach = function (passiveEffect) { this.passiveEffect = passiveEffect; }; /** * Sets the state of the `MotionValue`. * * @remarks * * ```jsx * const x = useMotionValue(0) * x.set(10) * ``` * * @param latest - Latest value to set. * @param render - Whether to notify render subscribers. Defaults to `true` * * @public */ MotionValue.prototype.set = function (v, render) { if (render === void 0) { render = true; } if (!render || !this.passiveEffect) { this.updateAndNotify(v, render); } else { this.passiveEffect(v, this.updateAndNotify); } }; /** * Returns the latest state of `MotionValue` * * @returns - The latest state of `MotionValue` * * @public */ MotionValue.prototype.get = function () { return this.current; }; /** * @public */ MotionValue.prototype.getPrevious = function () { return this.prev; }; /** * Returns the latest velocity of `MotionValue` * * @returns - The latest velocity of `MotionValue`. Returns `0` if the state is non-numerical. * * @public */ MotionValue.prototype.getVelocity = function () { // This could be isFloat(this.prev) && isFloat(this.current), but that would be wasteful return this.canTrackVelocity ? // These casts could be avoided if parseFloat would be typed better popmotion.velocityPerSecond(parseFloat(this.current) - parseFloat(this.prev), this.timeDelta) : 0; }; /** * Registers a new animation to control this `MotionValue`. Only one * animation can drive a `MotionValue` at one time. * * ```jsx * value.start() * ``` * * @param animation - A function that starts the provided animation * * @internal */ MotionValue.prototype.start = function (animation) { var _this = this; this.stop(); return new Promise(function (resolve) { _this.hasAnimated = true; _this.stopAnimation = animation(resolve); }).then(function () { return _this.clearAnimation(); }); }; /** * Stop the currently active animation. * * @public */ MotionValue.prototype.stop = function () { if (this.stopAnimation) this.stopAnimation(); this.clearAnimation(); }; /** * Returns `true` if this value is currently animating. * * @public */ MotionValue.prototype.isAnimating = function () { return !!this.stopAnimation; }; MotionValue.prototype.clearAnimation = function () { this.stopAnimation = null; }; /** * Destroy and clean up subscribers to this `MotionValue`. * * The `MotionValue` hooks like `useMotionValue` and `useTransform` automatically * handle the lifecycle of the returned `MotionValue`, so this method is only necessary if you've manually * created a `MotionValue` via the `motionValue` function. * * @public */ MotionValue.prototype.destroy = function () { this.updateSubscribers.clear(); this.renderSubscribers.clear(); this.stop(); }; return MotionValue; }(); function motionValue(init) { return new MotionValue(init); } /** * Tests a provided value against a ValueType */ var testValueType = function (v) { return function (type) { return type.test(v); }; }; /** * ValueType for "auto" */ var auto = { test: function (v) { return v === "auto"; }, parse: function (v) { return v; } }; /** * A list of value types commonly used for dimensions */ var dimensionValueTypes = [styleValueTypes.number, styleValueTypes.px, styleValueTypes.percent, styleValueTypes.degrees, styleValueTypes.vw, styleValueTypes.vh, auto]; /** * Tests a dimensional value against the list of dimension ValueTypes */ var findDimensionValueType = function (v) { return dimensionValueTypes.find(testValueType(v)); }; /** * A list of all ValueTypes */ var valueTypes = tslib.__spreadArray(tslib.__spreadArray([], tslib.__read(dimensionValueTypes), false), [styleValueTypes.color, styleValueTypes.complex], false); /** * Tests a value against the list of ValueTypes */ var findValueType = function (v) { return valueTypes.find(testValueType(v)); }; /** * Set VisualElement's MotionValue, creating a new MotionValue for it if * it doesn't exist. */ function setMotionValue(visualElement, key, value) { if (visualElement.hasValue(key)) { visualElement.getValue(key).set(value); } else { visualElement.addValue(key, motionValue(value)); } } function setTarget(visualElement, definition) { var resolved = resolveVariant(visualElement, definition); var _a = resolved ? visualElement.makeTargetAnimatable(resolved, false) : {}, _b = _a.transitionEnd, transitionEnd = _b === void 0 ? {} : _b; _a.transition; var target = tslib.__rest(_a, ["transitionEnd", "transition"]); target = tslib.__assign(tslib.__assign({}, target), transitionEnd); for (var key in target) { var value = resolveFinalValueInKeyframes(target[key]); setMotionValue(visualElement, key, value); } } function setVariants(visualElement, variantLabels) { var reversedLabels = tslib.__spreadArray([], tslib.__read(variantLabels), false).reverse(); reversedLabels.forEach(function (key) { var _a; var variant = visualElement.getVariant(key); variant && setTarget(visualElement, variant); (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { setVariants(child, variantLabels); }); }); } function setValues(visualElement, definition) { if (Array.isArray(definition)) { return setVariants(visualElement, definition); } else if (typeof definition === "string") { return setVariants(visualElement, [definition]); } else { setTarget(visualElement, definition); } } function checkTargetForNewValues(visualElement, target, origin) { var _a, _b, _c; var _d; var newValueKeys = Object.keys(target).filter(function (key) { return !visualElement.hasValue(key); }); var numNewValues = newValueKeys.length; if (!numNewValues) return; for (var i = 0; i < numNewValues; i++) { var key = newValueKeys[i]; var targetValue = target[key]; var value = null; /** * If the target is a series of keyframes, we can use the first value * in the array. If this first value is null, we'll still need to read from the DOM. */ if (Array.isArray(targetValue)) { value = targetValue[0]; } /** * If the target isn't keyframes, or the first keyframe was null, we need to * first check if an origin value was explicitly defined in the transition as "from", * if not read the value from the DOM. As an absolute fallback, take the defined target value. */ if (value === null) { value = (_b = (_a = origin[key]) !== null && _a !== void 0 ? _a : visualElement.readValue(key)) !== null && _b !== void 0 ? _b : target[key]; } /** * If value is still undefined or null, ignore it. Preferably this would throw, * but this was causing issues in Framer. */ if (value === undefined || value === null) continue; if (typeof value === "string" && (isNumericalString(value) || isZeroValueString(value))) { // If this is a number read as a string, ie "0" or "200", convert it to a number value = parseFloat(value); } else if (!findValueType(value) && styleValueTypes.complex.test(targetValue)) { value = getAnimatableNone(key, targetValue); } visualElement.addValue(key, motionValue(value)); (_c = (_d = origin)[key]) !== null && _c !== void 0 ? _c : _d[key] = value; visualElement.setBaseTarget(key, value); } } function getOriginFromTransition(key, transition) { if (!transition) return; var valueTransition = transition[key] || transition["default"] || transition; return valueTransition.from; } function getOrigin(target, transition, visualElement) { var _a, _b; var origin = {}; for (var key in target) { origin[key] = (_a = getOriginFromTransition(key, transition)) !== null && _a !== void 0 ? _a : (_b = visualElement.getValue(key)) === null || _b === void 0 ? void 0 : _b.get(); } return origin; } function animateVisualElement(visualElement, definition, options) { if (options === void 0) { options = {}; } visualElement.notifyAnimationStart(definition); var animation; if (Array.isArray(definition)) { var animations = definition.map(function (variant) { return animateVariant(visualElement, variant, options); }); animation = Promise.all(animations); } else if (typeof definition === "string") { animation = animateVariant(visualElement, definition, options); } else { var resolvedDefinition = typeof definition === "function" ? resolveVariant(visualElement, definition, options.custom) : definition; animation = animateTarget(visualElement, resolvedDefinition, options); } return animation.then(function () { return visualElement.notifyAnimationComplete(definition); }); } function animateVariant(visualElement, variant, options) { var _a; if (options === void 0) { options = {}; } var resolved = resolveVariant(visualElement, variant, options.custom); var _b = (resolved || {}).transition, transition = _b === void 0 ? visualElement.getDefaultTransition() || {} : _b; if (options.transitionOverride) { transition = options.transitionOverride; } /** * If we have a variant, create a callback that runs it as an animation. * Otherwise, we resolve a Promise immediately for a composable no-op. */ var getAnimation = resolved ? function () { return animateTarget(visualElement, resolved, options); } : function () { return Promise.resolve(); }; /** * If we have children, create a callback that runs all their animations. * Otherwise, we resolve a Promise immediately for a composable no-op. */ var getChildAnimations = ((_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.size) ? function (forwardDelay) { if (forwardDelay === void 0) { forwardDelay = 0; } var _a = transition.delayChildren, delayChildren = _a === void 0 ? 0 : _a, staggerChildren = transition.staggerChildren, staggerDirection = transition.staggerDirection; return animateChildren(visualElement, variant, delayChildren + forwardDelay, staggerChildren, staggerDirection, options); } : function () { return Promise.resolve(); }; /** * If the transition explicitly defines a "when" option, we need to resolve either * this animation or all children animations before playing the other. */ var when = transition.when; if (when) { var _c = tslib.__read(when === "beforeChildren" ? [getAnimation, getChildAnimations] : [getChildAnimations, getAnimation], 2), first = _c[0], last = _c[1]; return first().then(last); } else { return Promise.all([getAnimation(), getChildAnimations(options.delay)]); } } /** * @internal */ function animateTarget(visualElement, definition, _a) { var _b; var _c = _a === void 0 ? {} : _a, _d = _c.delay, delay = _d === void 0 ? 0 : _d, transitionOverride = _c.transitionOverride, type = _c.type; var _e = visualElement.makeTargetAnimatable(definition), _f = _e.transition, transition = _f === void 0 ? visualElement.getDefaultTransition() : _f, transitionEnd = _e.transitionEnd, target = tslib.__rest(_e, ["transition", "transitionEnd"]); if (transitionOverride) transition = transitionOverride; var animations = []; var animationTypeState = type && ((_b = visualElement.animationState) === null || _b === void 0 ? void 0 : _b.getState()[type]); for (var key in target) { var value = visualElement.getValue(key); var valueTarget = target[key]; if (!value || valueTarget === undefined || animationTypeState && shouldBlockAnimation(animationTypeState, key)) { continue; } var valueTransition = tslib.__assign({ delay: delay }, transition); /** * Make animation instant if this is a transform prop and we should reduce motion. */ if (visualElement.shouldReduceMotion && isTransformProp(key)) { valueTransition = tslib.__assign(tslib.__assign({}, valueTransition), { type: false, delay: 0 }); } var animation = startAnimation(key, value, valueTarget, valueTransition); animations.push(animation); } return Promise.all(animations).then(function () { transitionEnd && setTarget(visualElement, transitionEnd); }); } function animateChildren(visualElement, variant, delayChildren, staggerChildren, staggerDirection, options) { if (delayChildren === void 0) { delayChildren = 0; } if (staggerChildren === void 0) { staggerChildren = 0; } if (staggerDirection === void 0) { staggerDirection = 1; } var animations = []; var maxStaggerDuration = (visualElement.variantChildren.size - 1) * staggerChildren; var generateStaggerDuration = staggerDirection === 1 ? function (i) { if (i === void 0) { i = 0; } return i * staggerChildren; } : function (i) { if (i === void 0) { i = 0; } return maxStaggerDuration - i * staggerChildren; }; Array.from(visualElement.variantChildren).sort(sortByTreeOrder).forEach(function (child, i) { animations.push(animateVariant(child, variant, tslib.__assign(tslib.__assign({}, options), { delay: delayChildren + generateStaggerDuration(i) })).then(function () { return child.notifyAnimationComplete(variant); })); }); return Promise.all(animations); } function stopAnimation(visualElement) { visualElement.forEachValue(function (value) { return value.stop(); }); } function sortByTreeOrder(a, b) { return a.sortNodePosition(b); } /** * Decide whether we should block this animation. Previously, we achieved this * just by checking whether the key was listed in protectedKeys, but this * posed problems if an animation was triggered by afterChildren and protectedKeys * had been set to true in the meantime. */ function shouldBlockAnimation(_a, key) { var protectedKeys = _a.protectedKeys, needsAnimating = _a.needsAnimating; var shouldBlock = protectedKeys.hasOwnProperty(key) && needsAnimating[key] !== true; needsAnimating[key] = false; return shouldBlock; } var variantPriorityOrder = [exports.AnimationType.Animate, exports.AnimationType.InView, exports.AnimationType.Focus, exports.AnimationType.Hover, exports.AnimationType.Tap, exports.AnimationType.Drag, exports.AnimationType.Exit]; var reversePriorityOrder = tslib.__spreadArray([], tslib.__read(variantPriorityOrder), false).reverse(); var numAnimationTypes = variantPriorityOrder.length; function animateList(visualElement) { return function (animations) { return Promise.all(animations.map(function (_a) { var animation = _a.animation, options = _a.options; return animateVisualElement(visualElement, animation, options); })); }; } function createAnimationState(visualElement) { var animate = animateList(visualElement); var state = createState(); var allAnimatedKeys = {}; var isInitialRender = true; /** * This function will be used to reduce the animation definitions for * each active animation type into an object of resolved values for it. */ var buildResolvedTypeValues = function (acc, definition) { var resolved = resolveVariant(visualElement, definition); if (resolved) { resolved.transition; var transitionEnd = resolved.transitionEnd, target = tslib.__rest(resolved, ["transition", "transitionEnd"]); acc = tslib.__assign(tslib.__assign(tslib.__assign({}, acc), target), transitionEnd); } return acc; }; function isAnimated(key) { return allAnimatedKeys[key] !== undefined; } /** * This just allows us to inject mocked animation functions * @internal */ function setAnimateFunction(makeAnimator) { animate = makeAnimator(visualElement); } /** * When we receive new props, we need to: * 1. Create a list of protected keys for each type. This is a directory of * value keys that are currently being "handled" by types of a higher priority * so that whenever an animation is played of a given type, these values are * protected from being animated. * 2. Determine if an animation type needs animating. * 3. Determine if any values have been removed from a type and figure out * what to animate those to. */ function animateChanges(options, changedActiveType) { var _a; var props = visualElement.getProps(); var context = visualElement.getVariantContext(true) || {}; /** * A list of animations that we'll build into as we iterate through the animation * types. This will get executed at the end of the function. */ var animations = []; /** * Keep track of which values have been removed. Then, as we hit lower priority * animation types, we can check if they contain removed values and animate to that. */ var removedKeys = new Set(); /** * A dictionary of all encountered keys. This is an object to let us build into and * copy it without iteration. Each time we hit an animation type we set its protected * keys - the keys its not allowed to animate - to the latest version of this object. */ var encounteredKeys = {}; /** * If a variant has been removed at a given index, and this component is controlling * variant animations, we want to ensure lower-priority variants are forced to animate. */ var removedVariantIndex = Infinity; var _loop_1 = function (i) { var type = reversePriorityOrder[i]; var typeState = state[type]; var prop = (_a = props[type]) !== null && _a !== void 0 ? _a : context[type]; var propIsVariant = isVariantLabel(prop); /** * If this type has *just* changed isActive status, set activeDelta * to that status. Otherwise set to null. */ var activeDelta = type === changedActiveType ? typeState.isActive : null; if (activeDelta === false) removedVariantIndex = i; /** * If this prop is an inherited variant, rather than been set directly on the * component itself, we want to make sure we allow the parent to trigger animations. * * TODO: Can probably change this to a !isControllingVariants check */ var isInherited = prop === context[type] && prop !== props[type] && propIsVariant; /** * */ if (isInherited && isInitialRender && visualElement.manuallyAnimateOnMount) { isInherited = false; } /** * Set all encountered keys so far as the protected keys for this type. This will * be any key that has been animated or otherwise handled by active, higher-priortiy types. */ typeState.protectedKeys = tslib.__assign({}, encounteredKeys); // Check if we can skip analysing this prop early if ( // If it isn't active and hasn't *just* been set as inactive !typeState.isActive && activeDelta === null || // If we didn't and don't have any defined prop for this animation type !prop && !typeState.prevProp || // Or if the prop doesn't define an animation isAnimationControls(prop) || typeof prop === "boolean") { return "continue"; } /** * As we go look through the values defined on this type, if we detect * a changed value or a value that was removed in a higher priority, we set * this to true and add this prop to the animation list. */ var variantDidChange = checkVariantsDidChange(typeState.prevProp, prop); var shouldAnimateType = variantDidChange || // If we're making this variant active, we want to always make it active type === changedActiveType && typeState.isActive && !isInherited && propIsVariant || // If we removed a higher-priority variant (i is in reverse order) i > removedVariantIndex && propIsVariant; /** * As animations can be set as variant lists, variants or target objects, we * coerce everything to an array if it isn't one already */ var definitionList = Array.isArray(prop) ? prop : [prop]; /** * Build an object of all the resolved values. We'll use this in the subsequent * animateChanges calls to determine whether a value has changed. */ var resolvedValues = definitionList.reduce(buildResolvedTypeValues, {}); if (activeDelta === false) resolvedValues = {}; /** * Now we need to loop through all the keys in the prev prop and this prop, * and decide: * 1. If the value has changed, and needs animating * 2. If it has been removed, and needs adding to the removedKeys set * 3. If it has been removed in a higher priority type and needs animating * 4. If it hasn't been removed in a higher priority but hasn't changed, and * needs adding to the type's protectedKeys list. */ var _b = typeState.prevResolvedValues, prevResolvedValues = _b === void 0 ? {} : _b; var allKeys = tslib.__assign(tslib.__assign({}, prevResolvedValues), resolvedValues); var markToAnimate = function (key) { shouldAnimateType = true; removedKeys.delete(key); typeState.needsAnimating[key] = true; }; for (var key in allKeys) { var next = resolvedValues[key]; var prev = prevResolvedValues[key]; // If we've already handled this we can just skip ahead if (encounteredKeys.hasOwnProperty(key)) continue; /** * If the value has changed, we probably want to animate it. */ if (next !== prev) { /** * If both values are keyframes, we need to shallow compare them to * detect whether any value has changed. If it has, we animate it. */ if (isKeyframesTarget(next) && isKeyframesTarget(prev)) { if (!shallowCompare(next, prev) || variantDidChange) { markToAnimate(key); } else { /** * If it hasn't changed, we want to ensure it doesn't animate by * adding it to the list of protected keys. */ typeState.protectedKeys[key] = true; } } else if (next !== undefined) { // If next is defined and doesn't equal prev, it needs animating markToAnimate(key); } else { // If it's undefined, it's been removed. removedKeys.add(key); } } else if (next !== undefined && removedKeys.has(key)) { /** * If next hasn't changed and it isn't undefined, we want to check if it's * been removed by a higher priority */ markToAnimate(key); } else { /** * If it hasn't changed, we add it to the list of protected values * to ensure it doesn't get animated. */ typeState.protectedKeys[key] = true; } } /** * Update the typeState so next time animateChanges is called we can compare the * latest prop and resolvedValues to these. */ typeState.prevProp = prop; typeState.prevResolvedValues = resolvedValues; /** * */ if (typeState.isActive) { encounteredKeys = tslib.__assign(tslib.__assign({}, encounteredKeys), resolvedValues); } if (isInitialRender && visualElement.blockInitialAnimation) { shouldAnimateType = false; } /** * If this is an inherited prop we want to hard-block animations * TODO: Test as this should probably still handle animations triggered * by removed values? */ if (shouldAnimateType && !isInherited) { animations.push.apply(animations, tslib.__spreadArray([], tslib.__read(definitionList.map(function (animation) { return { animation: animation, options: tslib.__assign({ type: type }, options) }; })), false)); } }; /** * Iterate through all animation types in reverse priority order. For each, we want to * detect which values it's handling and whether or not they've changed (and therefore * need to be animated). If any values have been removed, we want to detect those in * lower priority props and flag for animation. */ for (var i = 0; i < numAnimationTypes; i++) { _loop_1(i); } allAnimatedKeys = tslib.__assign({}, encounteredKeys); /** * If there are some removed value that haven't been dealt with, * we need to create a new animation that falls back either to the value * defined in the style prop, or the last read value. */ if (removedKeys.size) { var fallbackAnimation_1 = {}; removedKeys.forEach(function (key) { var fallbackTarget = visualElement.getBaseTarget(key); if (fallbackTarget !== undefined) { fallbackAnimation_1[key] = fallbackTarget; } }); animations.push({ animation: fallbackAnimation_1 }); } var shouldAnimate = Boolean(animations.length); if (isInitialRender && props.initial === false && !visualElement.manuallyAnimateOnMount) { shouldAnimate = false; } isInitialRender = false; return shouldAnimate ? animate(animations) : Promise.resolve(); } /** * Change whether a certain animation type is active. */ function setActive(type, isActive, options) { var _a; // If the active state hasn't changed, we can safely do nothing here if (state[type].isActive === isActive) return Promise.resolve(); // Propagate active change to children (_a = visualElement.variantChildren) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { var _a; return (_a = child.animationState) === null || _a === void 0 ? void 0 : _a.setActive(type, isActive); }); state[type].isActive = isActive; var animations = animateChanges(options, type); for (var key in state) { state[key].protectedKeys = {}; } return animations; } return { isAnimated: isAnimated, animateChanges: animateChanges, setActive: setActive, setAnimateFunction: setAnimateFunction, getState: function () { return state; } }; } function checkVariantsDidChange(prev, next) { if (typeof next === "string") { return next !== prev; } else if (isVariantLabels(next)) { return !shallowCompare(next, prev); } return false; } function createTypeState(isActive) { if (isActive === void 0) { isActive = false; } return { isActive: isActive, protectedKeys: {}, needsAnimating: {}, prevResolvedValues: {} }; } function createState() { var _a; return _a = {}, _a[exports.AnimationType.Animate] = createTypeState(true), _a[exports.AnimationType.InView] = createTypeState(), _a[exports.AnimationType.Hover] = createTypeState(), _a[exports.AnimationType.Tap] = createTypeState(), _a[exports.AnimationType.Drag] = createTypeState(), _a[exports.AnimationType.Focus] = createTypeState(), _a[exports.AnimationType.Exit] = createTypeState(), _a; } var animations = { animation: makeRenderlessComponent(function (_a) { var visualElement = _a.visualElement, animate = _a.animate; /** * We dynamically generate the AnimationState manager as it contains a reference * to the underlying animation library. We only want to load that if we load this, * so people can optionally code split it out using the `m` component. */ visualElement.animationState || (visualElement.animationState = createAnimationState(visualElement)); /** * Subscribe any provided AnimationControls to the component's VisualElement */ if (isAnimationControls(animate)) { React.useEffect(function () { return animate.subscribe(visualElement); }, [animate]); } }), exit: makeRenderlessComponent(function (props) { var custom = props.custom, visualElement = props.visualElement; var _a = tslib.__read(usePresence(), 2), isPresent = _a[0], safeToRemove = _a[1]; var presenceContext = React.useContext(PresenceContext); React.useEffect(function () { var _a, _b; visualElement.isPresent = isPresent; var animation = (_a = visualElement.animationState) === null || _a === void 0 ? void 0 : _a.setActive(exports.AnimationType.Exit, !isPresent, { custom: (_b = presenceContext === null || presenceContext === void 0 ? void 0 : presenceContext.custom) !== null && _b !== void 0 ? _b : custom }); !isPresent && (animation === null || animation === void 0 ? void 0 : animation.then(safeToRemove)); }, [isPresent]); }) }; /** * @internal */ var PanSession = /** @class */function () { function PanSession(event, handlers, _a) { var _this = this; var _b = _a === void 0 ? {} : _a, transformPagePoint = _b.transformPagePoint; /** * @internal */ this.startEvent = null; /** * @internal */ this.lastMoveEvent = null; /** * @internal */ this.lastMoveEventInfo = null; /** * @internal */ this.handlers = {}; this.updatePoint = function () { if (!(_this.lastMoveEvent && _this.lastMoveEventInfo)) return; var info = getPanInfo(_this.lastMoveEventInfo, _this.history); var isPanStarted = _this.startEvent !== null; // Only start panning if the offset is larger than 3 pixels. If we make it // any larger than this we'll want to reset the pointer history // on the first update to avoid visual snapping to the cursoe. var isDistancePastThreshold = popmotion.distance(info.offset, { x: 0, y: 0 }) >= 3; if (!isPanStarted && !isDistancePastThreshold) return; var point = info.point; var timestamp = sync.getFrameData().timestamp; _this.history.push(tslib.__assign(tslib.__assign({}, point), { timestamp: timestamp })); var _a = _this.handlers, onStart = _a.onStart, onMove = _a.onMove; if (!isPanStarted) { onStart && onStart(_this.lastMoveEvent, info); _this.startEvent = _this.lastMoveEvent; } onMove && onMove(_this.lastMoveEvent, info); }; this.handlePointerMove = function (event, info) { _this.lastMoveEvent = event; _this.lastMoveEventInfo = transformPoint(info, _this.transformPagePoint); // Because Safari doesn't trigger mouseup events when it's above a ` ' + e.phrase("(Use line:column or scroll% syntax)") + ""; } c(i, "getJumpDialog"); function a(e, r) { var n = Number(r); return /^[-+]/.test(r) ? e.getCursor().line + n : n - 1; } c(a, "interpretLine"), o.commands.jumpToLine = function (e) { var r = e.getCursor(); s(e, i(e), e.phrase("Jump to line:"), r.line + 1 + ":" + r.ch, function (n) { if (n) { var t; if (t = /^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(n)) e.setCursor(a(e, t[1]), Number(t[2]));else if (t = /^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(n)) { var l = Math.round(e.lineCount() * Number(t[1]) / 100); /^[-+]/.test(t[1]) && (l = r.line + l + 1), e.setCursor(l - 1, r.ch); } else (t = /^\s*\:?\s*([\+\-]?\d+)\s*/.exec(n)) && e.setCursor(a(e, t[1]), r.ch); } }); }, o.keyMap.default["Alt-G"] = "jumpToLine"; }); })(); var d = b.exports; const j = f.getDefaultExportFromCjs(d), y = h({ __proto__: null, default: j }, [d]); exports.jumpToLine = y; /***/ }), /***/ "../../graphiql-react/dist/jump.cjs.js": /*!*********************************************!*\ !*** ../../graphiql-react/dist/jump.cjs.js ***! \*********************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var c = Object.defineProperty; var s = (e, r) => c(e, "name", { value: r, configurable: !0 }); const u = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), d = __webpack_require__(/*! ./SchemaReference.cjs.js */ "../../graphiql-react/dist/SchemaReference.cjs.js"); __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); __webpack_require__(/*! ./forEachState.cjs.js */ "../../graphiql-react/dist/forEachState.cjs.js"); u.CodeMirror.defineOption("jump", !1, (e, r, n) => { if (n && n !== u.CodeMirror.Init) { const t = e.state.jump.onMouseOver; u.CodeMirror.off(e.getWrapperElement(), "mouseover", t); const i = e.state.jump.onMouseOut; u.CodeMirror.off(e.getWrapperElement(), "mouseout", i), u.CodeMirror.off(document, "keydown", e.state.jump.onKeyDown), delete e.state.jump; } if (r) { const t = e.state.jump = { options: r, onMouseOver: M.bind(null, e), onMouseOut: m.bind(null, e), onKeyDown: g.bind(null, e) }; u.CodeMirror.on(e.getWrapperElement(), "mouseover", t.onMouseOver), u.CodeMirror.on(e.getWrapperElement(), "mouseout", t.onMouseOut), u.CodeMirror.on(document, "keydown", t.onKeyDown); } }); function M(e, r) { const n = r.target || r.srcElement; if (!(n instanceof HTMLElement) || (n == null ? void 0 : n.nodeName) !== "SPAN") return; const t = n.getBoundingClientRect(), i = { left: (t.left + t.right) / 2, top: (t.top + t.bottom) / 2 }; e.state.jump.cursor = i, e.state.jump.isHoldingModifier && l(e); } s(M, "onMouseOver"); function m(e) { if (!e.state.jump.isHoldingModifier && e.state.jump.cursor) { e.state.jump.cursor = null; return; } e.state.jump.isHoldingModifier && e.state.jump.marker && p(e); } s(m, "onMouseOut"); function g(e, r) { if (e.state.jump.isHoldingModifier || !k(r.key)) return; e.state.jump.isHoldingModifier = !0, e.state.jump.cursor && l(e); const n = s(o => { o.code === r.code && (e.state.jump.isHoldingModifier = !1, e.state.jump.marker && p(e), u.CodeMirror.off(document, "keyup", n), u.CodeMirror.off(document, "click", t), e.off("mousedown", i)); }, "onKeyUp"), t = s(o => { const { destination: a, options: f } = e.state.jump; a && f.onClick(a, o); }, "onClick"), i = s((o, a) => { e.state.jump.destination && (a.codemirrorIgnore = !0); }, "onMouseDown"); u.CodeMirror.on(document, "keyup", n), u.CodeMirror.on(document, "click", t), e.on("mousedown", i); } s(g, "onKeyDown"); const j = typeof navigator < "u" && navigator && navigator.appVersion.includes("Mac"); function k(e) { return e === (j ? "Meta" : "Control"); } s(k, "isJumpModifier"); function l(e) { if (e.state.jump.marker) return; const { cursor: r, options: n } = e.state.jump, t = e.coordsChar(r), i = e.getTokenAt(t, !0), o = n.getDestination || e.getHelper(t, "jump"); if (o) { const a = o(i, n, e); if (a) { const f = e.markText({ line: t.line, ch: i.start }, { line: t.line, ch: i.end }, { className: "CodeMirror-jump-token" }); e.state.jump.marker = f, e.state.jump.destination = a; } } } s(l, "enableJumpMode"); function p(e) { const { marker: r } = e.state.jump; e.state.jump.marker = null, e.state.jump.destination = null, r.clear(); } s(p, "disableJumpMode"); u.CodeMirror.registerHelper("jump", "graphql", (e, r) => { if (!r.schema || !r.onClick || !e.state) return; const { state: n } = e, { kind: t, step: i } = n, o = d.getTypeInfo(r.schema, n); if (t === "Field" && i === 0 && o.fieldDef || t === "AliasedField" && i === 2 && o.fieldDef) return d.getFieldReference(o); if (t === "Directive" && i === 1 && o.directiveDef) return d.getDirectiveReference(o); if (t === "Argument" && i === 0 && o.argDef) return d.getArgumentReference(o); if (t === "EnumValue" && o.enumValue) return d.getEnumValueReference(o); if (t === "NamedType" && o.type) return d.getTypeReference(o); }); /***/ }), /***/ "../../graphiql-react/dist/lint.cjs.js": /*!*********************************************!*\ !*** ../../graphiql-react/dist/lint.cjs.js ***! \*********************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var W = Object.defineProperty; var s = (h, v) => W(h, "name", { value: v, configurable: !0 }); const x = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); function q(h, v) { for (var l = 0; l < v.length; l++) { const u = v[l]; if (typeof u != "string" && !Array.isArray(u)) { for (const g in u) if (g !== "default" && !(g in h)) { const c = Object.getOwnPropertyDescriptor(u, g); c && Object.defineProperty(h, g, c.get ? c : { enumerable: !0, get: () => u[g] }); } } } return Object.freeze(Object.defineProperty(h, Symbol.toStringTag, { value: "Module" })); } s(q, "_mergeNamespaces"); var B = { exports: {} }; (function (h, v) { (function (l) { l(x.requireCodemirror()); })(function (l) { var u = "CodeMirror-lint-markers", g = "CodeMirror-lint-line-"; function c(t, e, r) { var n = document.createElement("div"); n.className = "CodeMirror-lint-tooltip cm-s-" + t.options.theme, n.appendChild(r.cloneNode(!0)), t.state.lint.options.selfContain ? t.getWrapperElement().appendChild(n) : document.body.appendChild(n); function i(o) { if (!n.parentNode) return l.off(document, "mousemove", i); n.style.top = Math.max(0, o.clientY - n.offsetHeight - 5) + "px", n.style.left = o.clientX + 5 + "px"; } return s(i, "position"), l.on(document, "mousemove", i), i(e), n.style.opacity != null && (n.style.opacity = 1), n; } s(c, "showTooltip"); function L(t) { t.parentNode && t.parentNode.removeChild(t); } s(L, "rm"); function A(t) { t.parentNode && (t.style.opacity == null && L(t), t.style.opacity = 0, setTimeout(function () { L(t); }, 600)); } s(A, "hideTooltip"); function M(t, e, r, n) { var i = c(t, e, r); function o() { l.off(n, "mouseout", o), i && (A(i), i = null); } s(o, "hide"); var a = setInterval(function () { if (i) for (var f = n;; f = f.parentNode) { if (f && f.nodeType == 11 && (f = f.host), f == document.body) return; if (!f) { o(); break; } } if (!i) return clearInterval(a); }, 400); l.on(n, "mouseout", o); } s(M, "showTooltipFor"); function F(t, e, r) { this.marked = [], e instanceof Function && (e = { getAnnotations: e }), (!e || e === !0) && (e = {}), this.options = {}, this.linterOptions = e.options || {}; for (var n in C) this.options[n] = C[n]; for (var n in e) C.hasOwnProperty(n) ? e[n] != null && (this.options[n] = e[n]) : e.options || (this.linterOptions[n] = e[n]); this.timeout = null, this.hasGutter = r, this.onMouseOver = function (i) { U(t, i); }, this.waitingFor = 0; } s(F, "LintState"); var C = { highlightLines: !1, tooltips: !0, delay: 500, lintOnChange: !0, getAnnotations: null, async: !1, selfContain: null, formatAnnotation: null, onUpdateLinting: null }; function E(t) { var e = t.state.lint; e.hasGutter && t.clearGutter(u), e.options.highlightLines && G(t); for (var r = 0; r < e.marked.length; ++r) e.marked[r].clear(); e.marked.length = 0; } s(E, "clearMarks"); function G(t) { t.eachLine(function (e) { var r = e.wrapClass && /\bCodeMirror-lint-line-\w+\b/.exec(e.wrapClass); r && t.removeLineClass(e, "wrap", r[0]); }); } s(G, "clearErrorLines"); function I(t, e, r, n, i) { var o = document.createElement("div"), a = o; return o.className = "CodeMirror-lint-marker CodeMirror-lint-marker-" + r, n && (a = o.appendChild(document.createElement("div")), a.className = "CodeMirror-lint-marker CodeMirror-lint-marker-multiple"), i != !1 && l.on(a, "mouseover", function (f) { M(t, f, e, a); }), o; } s(I, "makeMarker"); function D(t, e) { return t == "error" ? t : e; } s(D, "getMaxSeverity"); function j(t) { for (var e = [], r = 0; r < t.length; ++r) { var n = t[r], i = n.from.line; (e[i] || (e[i] = [])).push(n); } return e; } s(j, "groupByLine"); function N(t) { var e = t.severity; e || (e = "error"); var r = document.createElement("div"); return r.className = "CodeMirror-lint-message CodeMirror-lint-message-" + e, typeof t.messageHTML < "u" ? r.innerHTML = t.messageHTML : r.appendChild(document.createTextNode(t.message)), r; } s(N, "annotationTooltip"); function H(t, e) { var r = t.state.lint, n = ++r.waitingFor; function i() { n = -1, t.off("change", i); } s(i, "abort"), t.on("change", i), e(t.getValue(), function (o, a) { t.off("change", i), r.waitingFor == n && (a && o instanceof l && (o = a), t.operation(function () { O(t, o); })); }, r.linterOptions, t); } s(H, "lintAsync"); function k(t) { var e = t.state.lint; if (e) { var r = e.options, n = r.getAnnotations || t.getHelper(l.Pos(0, 0), "lint"); if (n) if (r.async || n.async) H(t, n);else { var i = n(t.getValue(), e.linterOptions, t); if (!i) return; i.then ? i.then(function (o) { t.operation(function () { O(t, o); }); }) : t.operation(function () { O(t, i); }); } } } s(k, "startLinting"); function O(t, e) { var r = t.state.lint; if (r) { var n = r.options; E(t); for (var i = j(e), o = 0; o < i.length; ++o) { var a = i[o]; if (a) { var f = []; a = a.filter(function (w) { return f.indexOf(w.message) > -1 ? !1 : f.push(w.message); }); for (var p = null, m = r.hasGutter && document.createDocumentFragment(), T = 0; T < a.length; ++T) { var d = a[T], y = d.severity; y || (y = "error"), p = D(p, y), n.formatAnnotation && (d = n.formatAnnotation(d)), r.hasGutter && m.appendChild(N(d)), d.to && r.marked.push(t.markText(d.from, d.to, { className: "CodeMirror-lint-mark CodeMirror-lint-mark-" + y, __annotation: d })); } r.hasGutter && t.setGutterMarker(o, u, I(t, m, p, i[o].length > 1, n.tooltips)), n.highlightLines && t.addLineClass(o, "wrap", g + p); } } n.onUpdateLinting && n.onUpdateLinting(e, i, t); } } s(O, "updateLinting"); function b(t) { var e = t.state.lint; e && (clearTimeout(e.timeout), e.timeout = setTimeout(function () { k(t); }, e.options.delay)); } s(b, "onChange"); function P(t, e, r) { for (var n = r.target || r.srcElement, i = document.createDocumentFragment(), o = 0; o < e.length; o++) { var a = e[o]; i.appendChild(N(a)); } M(t, r, i, n); } s(P, "popupTooltips"); function U(t, e) { var r = e.target || e.srcElement; if (/\bCodeMirror-lint-mark-/.test(r.className)) { for (var n = r.getBoundingClientRect(), i = (n.left + n.right) / 2, o = (n.top + n.bottom) / 2, a = t.findMarksAt(t.coordsChar({ left: i, top: o }, "client")), f = [], p = 0; p < a.length; ++p) { var m = a[p].__annotation; m && f.push(m); } f.length && P(t, f, e); } } s(U, "onMouseOver"), l.defineOption("lint", !1, function (t, e, r) { if (r && r != l.Init && (E(t), t.state.lint.options.lintOnChange !== !1 && t.off("change", b), l.off(t.getWrapperElement(), "mouseover", t.state.lint.onMouseOver), clearTimeout(t.state.lint.timeout), delete t.state.lint), e) { for (var n = t.getOption("gutters"), i = !1, o = 0; o < n.length; ++o) n[o] == u && (i = !0); var a = t.state.lint = new F(t, e, i); a.options.lintOnChange && t.on("change", b), a.options.tooltips != !1 && a.options.tooltips != "gutter" && l.on(t.getWrapperElement(), "mouseover", a.onMouseOver), k(t); } }), l.defineExtension("performLint", function () { k(this); }); }); })(); var _ = B.exports; const R = x.getDefaultExportFromCjs(_), V = q({ __proto__: null, default: R }, [_]); exports.lint = V; /***/ }), /***/ "../../graphiql-react/dist/lint.cjs2.js": /*!**********************************************!*\ !*** ../../graphiql-react/dist/lint.cjs2.js ***! \**********************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const t = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), c = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"); __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); const a = ["error", "warning", "information", "hint"], g = { "GraphQL: Validation": "validation", "GraphQL: Deprecation": "deprecation", "GraphQL: Syntax": "syntax" }; t.CodeMirror.registerHelper("lint", "graphql", (n, s) => { const { schema: r, validationRules: i, externalFragments: o } = s; return c.getDiagnostics(n, r, i, void 0, o).map(e => ({ message: e.message, severity: e.severity ? a[e.severity - 1] : a[0], type: e.source ? g[e.source] : void 0, from: t.CodeMirror.Pos(e.range.start.line, e.range.start.character), to: t.CodeMirror.Pos(e.range.end.line, e.range.end.character) })); }); /***/ }), /***/ "../../graphiql-react/dist/lint.cjs3.js": /*!**********************************************!*\ !*** ../../graphiql-react/dist/lint.cjs3.js ***! \**********************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var V = Object.defineProperty; var t = (e, n) => V(e, "name", { value: n, configurable: !0 }); const I = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), b = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); function C(e) { d = e, E = e.length, s = u = N = -1, o(), y(); const n = q(); return p("EOF"), n; } t(C, "jsonParse"); let d, E, s, u, N, r, l; function q() { const e = s, n = []; if (p("{"), !x("}")) { do n.push(M()); while (x(",")); p("}"); } return { kind: "Object", start: e, end: N, members: n }; } t(q, "parseObj"); function M() { const e = s, n = l === "String" ? G() : null; p("String"), p(":"); const i = B(); return { kind: "Member", start: e, end: N, key: n, value: i }; } t(M, "parseMember"); function v() { const e = s, n = []; if (p("["), !x("]")) { do n.push(B()); while (x(",")); p("]"); } return { kind: "Array", start: e, end: N, values: n }; } t(v, "parseArr"); function B() { switch (l) { case "[": return v(); case "{": return q(); case "String": case "Number": case "Boolean": case "Null": const e = G(); return y(), e; } p("Value"); } t(B, "parseVal"); function G() { return { kind: l, start: s, end: u, value: JSON.parse(d.slice(s, u)) }; } t(G, "curToken"); function p(e) { if (l === e) { y(); return; } let n; if (l === "EOF") n = "[end of file]";else if (u - s > 1) n = "`" + d.slice(s, u) + "`";else { const i = d.slice(s).match(/^.+?\b/); n = "`" + (i ? i[0] : d[s]) + "`"; } throw k(`Expected ${e} but found ${n}.`); } t(p, "expect"); class j extends Error { constructor(n, i) { super(n), this.position = i; } } t(j, "JSONSyntaxError"); function k(e) { return new j(e, { start: s, end: u }); } t(k, "syntaxError"); function x(e) { if (l === e) return y(), !0; } t(x, "skip"); function o() { return u < E && (u++, r = u === E ? 0 : d.charCodeAt(u)), r; } t(o, "ch"); function y() { for (N = u; r === 9 || r === 10 || r === 13 || r === 32;) o(); if (r === 0) { l = "EOF"; return; } switch (s = u, r) { case 34: return l = "String", D(); case 45: case 48: case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: return l = "Number", H(); case 102: if (d.slice(s, s + 5) !== "false") break; u += 4, o(), l = "Boolean"; return; case 110: if (d.slice(s, s + 4) !== "null") break; u += 3, o(), l = "Null"; return; case 116: if (d.slice(s, s + 4) !== "true") break; u += 3, o(), l = "Boolean"; return; } l = d[s], o(); } t(y, "lex"); function D() { for (o(); r !== 34 && r > 31;) if (r === 92) switch (r = o(), r) { case 34: case 47: case 92: case 98: case 102: case 110: case 114: case 116: o(); break; case 117: o(), w(), w(), w(), w(); break; default: throw k("Bad character escape sequence."); } else { if (u === E) throw k("Unterminated string."); o(); } if (r === 34) { o(); return; } throw k("Unterminated string."); } t(D, "readString"); function w() { if (r >= 48 && r <= 57 || r >= 65 && r <= 70 || r >= 97 && r <= 102) return o(); throw k("Expected hexadecimal digit."); } t(w, "readHex"); function H() { r === 45 && o(), r === 48 ? o() : $(), r === 46 && (o(), $()), (r === 69 || r === 101) && (r = o(), (r === 43 || r === 45) && o(), $()); } t(H, "readNumber"); function $() { if (r < 48 || r > 57) throw k("Expected decimal digit."); do o(); while (r >= 48 && r <= 57); } t($, "readDigits"); I.CodeMirror.registerHelper("lint", "graphql-variables", (e, n, i) => { if (!e) return []; let f; try { f = C(e); } catch (c) { if (c instanceof j) return [F(i, c.position, c.message)]; throw c; } const { variableToType: a } = n; return a ? U(i, a, f) : []; }); function U(e, n, i) { var f; const a = []; for (const c of i.members) if (c) { const h = (f = c.key) === null || f === void 0 ? void 0 : f.value, m = n[h]; if (m) for (const [O, Q] of g(m, c.value)) a.push(F(e, O, Q));else a.push(F(e, c.key, `Variable "$${h}" does not appear in any GraphQL query.`)); } return a; } t(U, "validateVariables"); function g(e, n) { if (!e || !n) return []; if (e instanceof b.GraphQLNonNull) return n.kind === "Null" ? [[n, `Type "${e}" is non-nullable and cannot be null.`]] : g(e.ofType, n); if (n.kind === "Null") return []; if (e instanceof b.GraphQLList) { const i = e.ofType; if (n.kind === "Array") { const f = n.values || []; return L(f, a => g(i, a)); } return g(i, n); } if (e instanceof b.GraphQLInputObjectType) { if (n.kind !== "Object") return [[n, `Type "${e}" must be an Object.`]]; const i = Object.create(null), f = L(n.members, a => { var c; const h = (c = a == null ? void 0 : a.key) === null || c === void 0 ? void 0 : c.value; i[h] = !0; const m = e.getFields()[h]; if (!m) return [[a.key, `Type "${e}" does not have a field "${h}".`]]; const O = m ? m.type : void 0; return g(O, a.value); }); for (const a of Object.keys(e.getFields())) { const c = e.getFields()[a]; !i[a] && c.type instanceof b.GraphQLNonNull && !c.defaultValue && f.push([n, `Object of type "${e}" is missing required field "${a}".`]); } return f; } return e.name === "Boolean" && n.kind !== "Boolean" || e.name === "String" && n.kind !== "String" || e.name === "ID" && n.kind !== "Number" && n.kind !== "String" || e.name === "Float" && n.kind !== "Number" || e.name === "Int" && (n.kind !== "Number" || (n.value | 0) !== n.value) ? [[n, `Expected value of type "${e}".`]] : (e instanceof b.GraphQLEnumType || e instanceof b.GraphQLScalarType) && (n.kind !== "String" && n.kind !== "Number" && n.kind !== "Boolean" && n.kind !== "Null" || _(e.parseValue(n.value))) ? [[n, `Expected value of type "${e}".`]] : []; } t(g, "validateValue"); function F(e, n, i) { return { message: i, severity: "error", type: "validation", from: e.posFromIndex(n.start), to: e.posFromIndex(n.end) }; } t(F, "lintError"); function _(e) { return e == null || e !== e; } t(_, "isNullish"); function L(e, n) { return Array.prototype.concat.apply([], e.map(n)); } t(L, "mapCat"); /***/ }), /***/ "../../graphiql-react/dist/matchbrackets.cjs.js": /*!******************************************************!*\ !*** ../../graphiql-react/dist/matchbrackets.cjs.js ***! \******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var i = Object.defineProperty; var s = (e, c) => i(e, "name", { value: c, configurable: !0 }); const u = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), f = __webpack_require__(/*! ./matchbrackets.cjs2.js */ "../../graphiql-react/dist/matchbrackets.cjs2.js"); function b(e, c) { for (var o = 0; o < c.length; o++) { const t = c[o]; if (typeof t != "string" && !Array.isArray(t)) { for (const r in t) if (r !== "default" && !(r in e)) { const a = Object.getOwnPropertyDescriptor(t, r); a && Object.defineProperty(e, r, a.get ? a : { enumerable: !0, get: () => t[r] }); } } } return Object.freeze(Object.defineProperty(e, Symbol.toStringTag, { value: "Module" })); } s(b, "_mergeNamespaces"); var n = f.requireMatchbrackets(); const l = u.getDefaultExportFromCjs(n), m = b({ __proto__: null, default: l }, [n]); exports.matchbrackets = m; /***/ }), /***/ "../../graphiql-react/dist/matchbrackets.cjs2.js": /*!*******************************************************!*\ !*** ../../graphiql-react/dist/matchbrackets.cjs2.js ***! \*******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var R = Object.defineProperty; var f = (L, y) => R(L, "name", { value: y, configurable: !0 }); const F = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); var T = { exports: {} }, E; function I() { return E || (E = 1, function (L, y) { (function (o) { o(F.requireCodemirror()); })(function (o) { var S = /MSIE \d/.test(navigator.userAgent) && (document.documentMode == null || document.documentMode < 8), g = o.Pos, B = { "(": ")>", ")": "(<", "[": "]>", "]": "[<", "{": "}>", "}": "{<", "<": ">>", ">": "<<" }; function A(t) { return t && t.bracketRegex || /[(){}[\]]/; } f(A, "bracketRegex"); function b(t, r, e) { var s = t.getLineHandle(r.line), n = r.ch - 1, h = e && e.afterCursor; h == null && (h = /(^| )cm-fat-cursor($| )/.test(t.getWrapperElement().className)); var l = A(e), u = !h && n >= 0 && l.test(s.text.charAt(n)) && B[s.text.charAt(n)] || l.test(s.text.charAt(n + 1)) && B[s.text.charAt(++n)]; if (!u) return null; var a = u.charAt(1) == ">" ? 1 : -1; if (e && e.strict && a > 0 != (n == r.ch)) return null; var k = t.getTokenTypeAt(g(r.line, n + 1)), i = H(t, g(r.line, n + (a > 0 ? 1 : 0)), a, k, e); return i == null ? null : { from: g(r.line, n), to: i && i.pos, match: i && i.ch == u.charAt(0), forward: a > 0 }; } f(b, "findMatchingBracket"); function H(t, r, e, s, n) { for (var h = n && n.maxScanLineLength || 1e4, l = n && n.maxScanLines || 1e3, u = [], a = A(n), k = e > 0 ? Math.min(r.line + l, t.lastLine() + 1) : Math.max(t.firstLine() - 1, r.line - l), i = r.line; i != k; i += e) { var c = t.getLine(i); if (c) { var v = e > 0 ? 0 : c.length - 1, q = e > 0 ? c.length : -1; if (!(c.length > h)) for (i == r.line && (v = r.ch - (e < 0 ? 1 : 0)); v != q; v += e) { var d = c.charAt(v); if (a.test(d) && (s === void 0 || (t.getTokenTypeAt(g(i, v + 1)) || "") == (s || ""))) { var m = B[d]; if (m && m.charAt(1) == ">" == e > 0) u.push(d);else if (u.length) u.pop();else return { pos: g(i, v), ch: d }; } } } } return i - e == (e > 0 ? t.lastLine() : t.firstLine()) ? !1 : null; } f(H, "scanForBracket"); function M(t, r, e) { for (var s = t.state.matchBrackets.maxHighlightLineLength || 1e3, n = e && e.highlightNonMatching, h = [], l = t.listSelections(), u = 0; u < l.length; u++) { var a = l[u].empty() && b(t, l[u].head, e); if (a && (a.match || n !== !1) && t.getLine(a.from.line).length <= s) { var k = a.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket"; h.push(t.markText(a.from, g(a.from.line, a.from.ch + 1), { className: k })), a.to && t.getLine(a.to.line).length <= s && h.push(t.markText(a.to, g(a.to.line, a.to.ch + 1), { className: k })); } } if (h.length) { S && t.state.focused && t.focus(); var i = f(function () { t.operation(function () { for (var c = 0; c < h.length; c++) h[c].clear(); }); }, "clear"); if (r) setTimeout(i, 800);else return i; } } f(M, "matchBrackets"); function x(t) { t.operation(function () { t.state.matchBrackets.currentlyHighlighted && (t.state.matchBrackets.currentlyHighlighted(), t.state.matchBrackets.currentlyHighlighted = null), t.state.matchBrackets.currentlyHighlighted = M(t, !1, t.state.matchBrackets); }); } f(x, "doMatchBrackets"); function p(t) { t.state.matchBrackets && t.state.matchBrackets.currentlyHighlighted && (t.state.matchBrackets.currentlyHighlighted(), t.state.matchBrackets.currentlyHighlighted = null); } f(p, "clearHighlighted"), o.defineOption("matchBrackets", !1, function (t, r, e) { e && e != o.Init && (t.off("cursorActivity", x), t.off("focus", x), t.off("blur", p), p(t)), r && (t.state.matchBrackets = typeof r == "object" ? r : {}, t.on("cursorActivity", x), t.on("focus", x), t.on("blur", p)); }), o.defineExtension("matchBrackets", function () { M(this, !0); }), o.defineExtension("findMatchingBracket", function (t, r, e) { return (e || typeof r == "boolean") && (e ? (e.strict = r, r = e) : r = r ? { strict: !0 } : null), b(this, t, r); }), o.defineExtension("scanForBracket", function (t, r, e, s) { return H(this, t, r, e, s); }); }); }()), T.exports; } f(I, "requireMatchbrackets"); exports.requireMatchbrackets = I; /***/ }), /***/ "../../graphiql-react/dist/mode-indent.cjs.js": /*!****************************************************!*\ !*** ../../graphiql-react/dist/mode-indent.cjs.js ***! \****************************************************/ /***/ (function(__unused_webpack_module, exports) { var o = Object.defineProperty; var v = (n, t) => o(n, "name", { value: t, configurable: !0 }); function s(n, t) { var e, i; const { levels: l, indentLevel: d } = n; return ((!l || l.length === 0 ? d : l.at(-1) - (!((e = this.electricInput) === null || e === void 0) && e.test(t) ? 1 : 0)) || 0) * (((i = this.config) === null || i === void 0 ? void 0 : i.indentUnit) || 0); } v(s, "indent"); exports.indent = s; /***/ }), /***/ "../../graphiql-react/dist/mode.cjs.js": /*!*********************************************!*\ !*** ../../graphiql-react/dist/mode.cjs.js ***! \*********************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var n = Object.defineProperty; var s = (e, r) => n(e, "name", { value: r, configurable: !0 }); const o = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), t = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"), i = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); const l = s(e => { const r = t.onlineParser({ eatWhitespace: a => a.eatWhile(t.isIgnored), lexRules: t.LexRules, parseRules: t.ParseRules, editorConfig: { tabSize: e.tabSize } }); return { config: e, startState: r.startState, token: r.token, indent: i.indent, electricInput: /^\s*[})\]]/, fold: "brace", lineComment: "#", closeBrackets: { pairs: '()[]{}""', explode: "()[]{}" } }; }, "graphqlModeFactory"); o.CodeMirror.defineMode("graphql", l); /***/ }), /***/ "../../graphiql-react/dist/mode.cjs2.js": /*!**********************************************!*\ !*** ../../graphiql-react/dist/mode.cjs2.js ***! \**********************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { var n = Object.defineProperty; var u = (t, r) => n(t, "name", { value: r, configurable: !0 }); const i = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), e = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"), s = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); i.CodeMirror.defineMode("graphql-variables", t => { const r = e.onlineParser({ eatWhitespace: a => a.eatSpace(), lexRules: c, parseRules: o, editorConfig: { tabSize: t.tabSize } }); return { config: t, startState: r.startState, token: r.token, indent: s.indent, electricInput: /^\s*[}\]]/, fold: "brace", closeBrackets: { pairs: '[]{}""', explode: "[]{}" } }; }); const c = { Punctuation: /^\[|]|\{|\}|:|,/, Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, Keyword: /^true|false|null/ }, o = { Document: [e.p("{"), e.list("Variable", e.opt(e.p(","))), e.p("}")], Variable: [l("variable"), e.p(":"), "Value"], Value(t) { switch (t.kind) { case "Number": return "NumberValue"; case "String": return "StringValue"; case "Punctuation": switch (t.value) { case "[": return "ListValue"; case "{": return "ObjectValue"; } return null; case "Keyword": switch (t.value) { case "true": case "false": return "BooleanValue"; case "null": return "NullValue"; } return null; } }, NumberValue: [e.t("Number", "number")], StringValue: [e.t("String", "string")], BooleanValue: [e.t("Keyword", "builtin")], NullValue: [e.t("Keyword", "keyword")], ListValue: [e.p("["), e.list("Value", e.opt(e.p(","))), e.p("]")], ObjectValue: [e.p("{"), e.list("ObjectField", e.opt(e.p(","))), e.p("}")], ObjectField: [l("attribute"), e.p(":"), "Value"] }; function l(t) { return { style: t, match: r => r.kind === "String", update(r, a) { r.name = a.value.slice(1, -1); } }; } u(l, "namedKey"); /***/ }), /***/ "../../graphiql-react/dist/mode.cjs3.js": /*!**********************************************!*\ !*** ../../graphiql-react/dist/mode.cjs3.js ***! \**********************************************/ /***/ (function(__unused_webpack_module, __unused_webpack_exports, __webpack_require__) { const a = __webpack_require__(/*! ./codemirror.cjs.js */ "../../graphiql-react/dist/codemirror.cjs.js"), e = __webpack_require__(/*! graphql-language-service */ "../../graphql-language-service/esm/index.js"), l = __webpack_require__(/*! ./mode-indent.cjs.js */ "../../graphiql-react/dist/mode-indent.cjs.js"); __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); a.CodeMirror.defineMode("graphql-results", r => { const t = e.onlineParser({ eatWhitespace: u => u.eatSpace(), lexRules: n, parseRules: s, editorConfig: { tabSize: r.tabSize } }); return { config: r, startState: t.startState, token: t.token, indent: l.indent, electricInput: /^\s*[}\]]/, fold: "brace", closeBrackets: { pairs: '[]{}""', explode: "[]{}" } }; }); const n = { Punctuation: /^\[|]|\{|\}|:|,/, Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, String: /^"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?/, Keyword: /^true|false|null/ }, s = { Document: [e.p("{"), e.list("Entry", e.p(",")), e.p("}")], Entry: [e.t("String", "def"), e.p(":"), "Value"], Value(r) { switch (r.kind) { case "Number": return "NumberValue"; case "String": return "StringValue"; case "Punctuation": switch (r.value) { case "[": return "ListValue"; case "{": return "ObjectValue"; } return null; case "Keyword": switch (r.value) { case "true": case "false": return "BooleanValue"; case "null": return "NullValue"; } return null; } }, NumberValue: [e.t("Number", "number")], StringValue: [e.t("String", "string")], BooleanValue: [e.t("Keyword", "builtin")], NullValue: [e.t("Keyword", "keyword")], ListValue: [e.p("["), e.list("Value", e.p(",")), e.p("]")], ObjectValue: [e.p("{"), e.list("ObjectField", e.p(",")), e.p("}")], ObjectField: [e.t("String", "property"), e.p(":"), "Value"] }; /***/ }), /***/ "../../graphiql-react/dist/search.cjs.js": /*!***********************************************!*\ !*** ../../graphiql-react/dist/search.cjs.js ***! \***********************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var K = Object.defineProperty; var a = (S, O) => K(S, "name", { value: O, configurable: !0 }); const Q = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), L = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"), z = __webpack_require__(/*! ./dialog.cjs.js */ "../../graphiql-react/dist/dialog.cjs.js"); function U(S, O) { for (var i = 0; i < O.length; i++) { const y = O[i]; if (typeof y != "string" && !Array.isArray(y)) { for (const v in y) if (v !== "default" && !(v in S)) { const h = Object.getOwnPropertyDescriptor(y, v); h && Object.defineProperty(S, v, h.get ? h : { enumerable: !0, get: () => y[v] }); } } } return Object.freeze(Object.defineProperty(S, Symbol.toStringTag, { value: "Module" })); } a(U, "_mergeNamespaces"); var B = { exports: {} }; (function (S, O) { (function (i) { i(Q.requireCodemirror(), L.requireSearchcursor(), z.dialogExports); })(function (i) { i.defineOption("search", { bottom: !1 }); function y(e, n) { return typeof e == "string" ? e = new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"), n ? "gi" : "g") : e.global || (e = new RegExp(e.source, e.ignoreCase ? "gi" : "g")), { token: function (t) { e.lastIndex = t.pos; var o = e.exec(t.string); if (o && o.index == t.pos) return t.pos += o[0].length || 1, "searching"; o ? t.pos = o.index : t.skipToEnd(); } }; } a(y, "searchOverlay"); function v() { this.posFrom = this.posTo = this.lastQuery = this.query = null, this.overlay = null; } a(v, "SearchState"); function h(e) { return e.state.search || (e.state.search = new v()); } a(h, "getSearchState"); function m(e) { return typeof e == "string" && e == e.toLowerCase(); } a(m, "queryCaseInsensitive"); function N(e, n, t) { return e.getSearchCursor(n, t, { caseFold: m(n), multiline: !0 }); } a(N, "getSearchCursor"); function j(e, n, t, o, r) { e.openDialog(n, o, { value: t, selectValueOnOpen: !0, closeOnEnter: !1, onClose: function () { w(e); }, onKeyDown: r, bottom: e.options.search.bottom }); } a(j, "persistentDialog"); function D(e, n, t, o, r) { e.openDialog ? e.openDialog(n, r, { value: o, selectValueOnOpen: !0, bottom: e.options.search.bottom }) : r(prompt(t, o)); } a(D, "dialog"); function k(e, n, t, o) { e.openConfirm ? e.openConfirm(n, o) : confirm(t) && o[0](); } a(k, "confirmDialog"); function C(e) { return e.replace(/\\([nrt\\])/g, function (n, t) { return t == "n" ? ` ` : t == "r" ? "\r" : t == "t" ? " " : t == "\\" ? "\\" : n; }); } a(C, "parseString"); function T(e) { var n = e.match(/^\/(.*)\/([a-z]*)$/); if (n) try { e = new RegExp(n[1], n[2].indexOf("i") == -1 ? "" : "i"); } catch {} else e = C(e); return (typeof e == "string" ? e == "" : e.test("")) && (e = /x^/), e; } a(T, "parseQuery"); function P(e, n, t) { n.queryText = t, n.query = T(t), e.removeOverlay(n.overlay, m(n.query)), n.overlay = y(n.query, m(n.query)), e.addOverlay(n.overlay), e.showMatchesOnScrollbar && (n.annotate && (n.annotate.clear(), n.annotate = null), n.annotate = e.showMatchesOnScrollbar(n.query, m(n.query))); } a(P, "startSearch"); function b(e, n, t, o) { var r = h(e); if (r.query) return R(e, n); var s = e.getSelection() || r.lastQuery; if (s instanceof RegExp && s.source == "x^" && (s = null), t && e.openDialog) { var c = null, u = a(function (f, x) { i.e_stop(x), f && (f != r.queryText && (P(e, r, f), r.posFrom = r.posTo = e.getCursor()), c && (c.style.opacity = 1), R(e, x.shiftKey, function (d, g) { var p; g.line < 3 && document.querySelector && (p = e.display.wrapper.querySelector(".CodeMirror-dialog")) && p.getBoundingClientRect().bottom - 4 > e.cursorCoords(g, "window").top && ((c = p).style.opacity = .4); })); }, "searchNext"); j(e, E(e), s, u, function (f, x) { var d = i.keyName(f), g = e.getOption("extraKeys"), p = g && g[d] || i.keyMap[e.getOption("keyMap")][d]; p == "findNext" || p == "findPrev" || p == "findPersistentNext" || p == "findPersistentPrev" ? (i.e_stop(f), P(e, h(e), x), e.execCommand(p)) : (p == "find" || p == "findPersistent") && (i.e_stop(f), u(x, f)); }), o && s && (P(e, r, s), R(e, n)); } else D(e, E(e), "Search for:", s, function (f) { f && !r.query && e.operation(function () { P(e, r, f), r.posFrom = r.posTo = e.getCursor(), R(e, n); }); }); } a(b, "doSearch"); function R(e, n, t) { e.operation(function () { var o = h(e), r = N(e, o.query, n ? o.posFrom : o.posTo); !r.find(n) && (r = N(e, o.query, n ? i.Pos(e.lastLine()) : i.Pos(e.firstLine(), 0)), !r.find(n)) || (e.setSelection(r.from(), r.to()), e.scrollIntoView({ from: r.from(), to: r.to() }, 20), o.posFrom = r.from(), o.posTo = r.to(), t && t(r.from(), r.to())); }); } a(R, "findNext"); function w(e) { e.operation(function () { var n = h(e); n.lastQuery = n.query, n.query && (n.query = n.queryText = null, e.removeOverlay(n.overlay), n.annotate && (n.annotate.clear(), n.annotate = null)); }); } a(w, "clearSearch"); function l(e, n) { var t = e ? document.createElement(e) : document.createDocumentFragment(); for (var o in n) t[o] = n[o]; for (var r = 2; r < arguments.length; r++) { var s = arguments[r]; t.appendChild(typeof s == "string" ? document.createTextNode(s) : s); } return t; } a(l, "el"); function E(e) { return l("", null, l("span", { className: "CodeMirror-search-label" }, e.phrase("Search:")), " ", l("input", { type: "text", style: "width: 10em", className: "CodeMirror-search-field" }), " ", l("span", { style: "color: #888", className: "CodeMirror-search-hint" }, e.phrase("(Use /re/ syntax for regexp search)"))); } a(E, "getQueryDialog"); function A(e) { return l("", null, " ", l("input", { type: "text", style: "width: 10em", className: "CodeMirror-search-field" }), " ", l("span", { style: "color: #888", className: "CodeMirror-search-hint" }, e.phrase("(Use /re/ syntax for regexp search)"))); } a(A, "getReplaceQueryDialog"); function I(e) { return l("", null, l("span", { className: "CodeMirror-search-label" }, e.phrase("With:")), " ", l("input", { type: "text", style: "width: 10em", className: "CodeMirror-search-field" })); } a(I, "getReplacementQueryDialog"); function V(e) { return l("", null, l("span", { className: "CodeMirror-search-label" }, e.phrase("Replace?")), " ", l("button", {}, e.phrase("Yes")), " ", l("button", {}, e.phrase("No")), " ", l("button", {}, e.phrase("All")), " ", l("button", {}, e.phrase("Stop"))); } a(V, "getDoReplaceConfirm"); function _(e, n, t) { e.operation(function () { for (var o = N(e, n); o.findNext();) if (typeof n != "string") { var r = e.getRange(o.from(), o.to()).match(n); o.replace(t.replace(/\$(\d)/g, function (s, c) { return r[c]; })); } else o.replace(t); }); } a(_, "replaceAll"); function F(e, n) { if (!e.getOption("readOnly")) { var t = e.getSelection() || h(e).lastQuery, o = n ? e.phrase("Replace all:") : e.phrase("Replace:"), r = l("", null, l("span", { className: "CodeMirror-search-label" }, o), A(e)); D(e, r, o, t, function (s) { s && (s = T(s), D(e, I(e), e.phrase("Replace with:"), "", function (c) { if (c = C(c), n) _(e, s, c);else { w(e); var u = N(e, s, e.getCursor("from")), f = a(function () { var d = u.from(), g; !(g = u.findNext()) && (u = N(e, s), !(g = u.findNext()) || d && u.from().line == d.line && u.from().ch == d.ch) || (e.setSelection(u.from(), u.to()), e.scrollIntoView({ from: u.from(), to: u.to() }), k(e, V(e), e.phrase("Replace?"), [function () { x(g); }, f, function () { _(e, s, c); }])); }, "advance"), x = a(function (d) { u.replace(typeof s == "string" ? c : c.replace(/\$(\d)/g, function (g, p) { return d[p]; })), f(); }, "doReplace"); f(); } })); }); } } a(F, "replace"), i.commands.find = function (e) { w(e), b(e); }, i.commands.findPersistent = function (e) { w(e), b(e, !1, !0); }, i.commands.findPersistentNext = function (e) { b(e, !1, !0, !0); }, i.commands.findPersistentPrev = function (e) { b(e, !0, !0, !0); }, i.commands.findNext = b, i.commands.findPrev = function (e) { b(e, !0); }, i.commands.clearSearch = w, i.commands.replace = F, i.commands.replaceAll = function (e) { F(e, !0); }; }); })(); var $ = B.exports; const W = Q.getDefaultExportFromCjs($), Y = U({ __proto__: null, default: W }, [$]); exports.search = Y; /***/ }), /***/ "../../graphiql-react/dist/searchcursor.cjs.js": /*!*****************************************************!*\ !*** ../../graphiql-react/dist/searchcursor.cjs.js ***! \*****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var n = Object.defineProperty; var u = (r, o) => n(r, "name", { value: o, configurable: !0 }); const i = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), f = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"); function l(r, o) { for (var c = 0; c < o.length; c++) { const e = o[c]; if (typeof e != "string" && !Array.isArray(e)) { for (const t in e) if (t !== "default" && !(t in r)) { const s = Object.getOwnPropertyDescriptor(e, t); s && Object.defineProperty(r, t, s.get ? s : { enumerable: !0, get: () => e[t] }); } } } return Object.freeze(Object.defineProperty(r, Symbol.toStringTag, { value: "Module" })); } u(l, "_mergeNamespaces"); var a = f.requireSearchcursor(); const g = i.getDefaultExportFromCjs(a), p = l({ __proto__: null, default: g }, [a]); exports.searchcursor = p; /***/ }), /***/ "../../graphiql-react/dist/searchcursor.cjs2.js": /*!******************************************************!*\ !*** ../../graphiql-react/dist/searchcursor.cjs2.js ***! \******************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var W = Object.defineProperty; var o = (d, E) => W(d, "name", { value: E, configurable: !0 }); const G = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); var N = { exports: {} }, b; function H() { return b || (b = 1, function (d, E) { (function (m) { m(G.requireCodemirror()); })(function (m) { var a = m.Pos; function B(e) { var t = e.flags; return t !== null && t !== void 0 ? t : (e.ignoreCase ? "i" : "") + (e.global ? "g" : "") + (e.multiline ? "m" : ""); } o(B, "regexpFlags"); function F(e, t) { for (var n = B(e), r = n, l = 0; l < t.length; l++) r.indexOf(t.charAt(l)) == -1 && (r += t.charAt(l)); return n == r ? e : new RegExp(e.source, r); } o(F, "ensureFlags"); function R(e) { return /\\s|\\n|\n|\\W|\\D|\[\^/.test(e.source); } o(R, "maybeMultiline"); function I(e, t, n) { t = F(t, "g"); for (var r = n.line, l = n.ch, i = e.lastLine(); r <= i; r++, l = 0) { t.lastIndex = l; var h = e.getLine(r), f = t.exec(h); if (f) return { from: a(r, f.index), to: a(r, f.index + f[0].length), match: f }; } } o(I, "searchRegexpForward"); function j(e, t, n) { if (!R(t)) return I(e, t, n); t = F(t, "gm"); for (var r, l = 1, i = n.line, h = e.lastLine(); i <= h;) { for (var f = 0; f < l && !(i > h); f++) { var p = e.getLine(i++); r = r == null ? p : r + ` ` + p; } l = l * 2, t.lastIndex = n.ch; var u = t.exec(r); if (u) { var s = r.slice(0, u.index).split(` `), c = u[0].split(` `), g = n.line + s.length - 1, v = s[s.length - 1].length; return { from: a(g, v), to: a(g + c.length - 1, c.length == 1 ? v + c[0].length : c[c.length - 1].length), match: u }; } } } o(j, "searchRegexpForwardMultiline"); function z(e, t, n) { for (var r, l = 0; l <= e.length;) { t.lastIndex = l; var i = t.exec(e); if (!i) break; var h = i.index + i[0].length; if (h > e.length - n) break; (!r || h > r.index + r[0].length) && (r = i), l = i.index + 1; } return r; } o(z, "lastMatchIn"); function D(e, t, n) { t = F(t, "g"); for (var r = n.line, l = n.ch, i = e.firstLine(); r >= i; r--, l = -1) { var h = e.getLine(r), f = z(h, t, l < 0 ? 0 : h.length - l); if (f) return { from: a(r, f.index), to: a(r, f.index + f[0].length), match: f }; } } o(D, "searchRegexpBackward"); function A(e, t, n) { if (!R(t)) return D(e, t, n); t = F(t, "gm"); for (var r, l = 1, i = e.getLine(n.line).length - n.ch, h = n.line, f = e.firstLine(); h >= f;) { for (var p = 0; p < l && h >= f; p++) { var u = e.getLine(h--); r = r == null ? u : u + ` ` + r; } l *= 2; var s = z(r, t, i); if (s) { var c = r.slice(0, s.index).split(` `), g = s[0].split(` `), v = h + c.length, x = c[c.length - 1].length; return { from: a(v, x), to: a(v + g.length - 1, g.length == 1 ? x + g[0].length : g[g.length - 1].length), match: s }; } } } o(A, "searchRegexpBackwardMultiline"); var P, k; String.prototype.normalize ? (P = o(function (e) { return e.normalize("NFD").toLowerCase(); }, "doFold"), k = o(function (e) { return e.normalize("NFD"); }, "noFold")) : (P = o(function (e) { return e.toLowerCase(); }, "doFold"), k = o(function (e) { return e; }, "noFold")); function L(e, t, n, r) { if (e.length == t.length) return n; for (var l = 0, i = n + Math.max(0, e.length - t.length);;) { if (l == i) return l; var h = l + i >> 1, f = r(e.slice(0, h)).length; if (f == n) return h; f > n ? i = h : l = h + 1; } } o(L, "adjustPos"); function y(e, t, n, r) { if (!t.length) return null; var l = r ? P : k, i = l(t).split(/\r|\n\r?/); t: for (var h = n.line, f = n.ch, p = e.lastLine() + 1 - i.length; h <= p; h++, f = 0) { var u = e.getLine(h).slice(f), s = l(u); if (i.length == 1) { var c = s.indexOf(i[0]); if (c == -1) continue t; var n = L(u, s, c, l) + f; return { from: a(h, L(u, s, c, l) + f), to: a(h, L(u, s, c + i[0].length, l) + f) }; } else { var g = s.length - i[0].length; if (s.slice(g) != i[0]) continue t; for (var v = 1; v < i.length - 1; v++) if (l(e.getLine(h + v)) != i[v]) continue t; var x = e.getLine(h + i.length - 1), O = l(x), S = i[i.length - 1]; if (O.slice(0, S.length) != S) continue t; return { from: a(h, L(u, s, g, l) + f), to: a(h + i.length - 1, L(x, O, S.length, l)) }; } } } o(y, "searchStringForward"); function C(e, t, n, r) { if (!t.length) return null; var l = r ? P : k, i = l(t).split(/\r|\n\r?/); t: for (var h = n.line, f = n.ch, p = e.firstLine() - 1 + i.length; h >= p; h--, f = -1) { var u = e.getLine(h); f > -1 && (u = u.slice(0, f)); var s = l(u); if (i.length == 1) { var c = s.lastIndexOf(i[0]); if (c == -1) continue t; return { from: a(h, L(u, s, c, l)), to: a(h, L(u, s, c + i[0].length, l)) }; } else { var g = i[i.length - 1]; if (s.slice(0, g.length) != g) continue t; for (var v = 1, n = h - i.length + 1; v < i.length - 1; v++) if (l(e.getLine(n + v)) != i[v]) continue t; var x = e.getLine(h + 1 - i.length), O = l(x); if (O.slice(O.length - i[0].length) != i[0]) continue t; return { from: a(h + 1 - i.length, L(x, O, x.length - i[0].length, l)), to: a(h, L(u, s, g.length, l)) }; } } } o(C, "searchStringBackward"); function w(e, t, n, r) { this.atOccurrence = !1, this.afterEmptyMatch = !1, this.doc = e, n = n ? e.clipPos(n) : a(0, 0), this.pos = { from: n, to: n }; var l; typeof r == "object" ? l = r.caseFold : (l = r, r = null), typeof t == "string" ? (l == null && (l = !1), this.matches = function (i, h) { return (i ? C : y)(e, t, h, l); }) : (t = F(t, "gm"), !r || r.multiline !== !1 ? this.matches = function (i, h) { return (i ? A : j)(e, t, h); } : this.matches = function (i, h) { return (i ? D : I)(e, t, h); }); } o(w, "SearchCursor"), w.prototype = { findNext: function () { return this.find(!1); }, findPrevious: function () { return this.find(!0); }, find: function (e) { var t = this.doc.clipPos(e ? this.pos.from : this.pos.to); if (this.afterEmptyMatch && this.atOccurrence && (t = a(t.line, t.ch), e ? (t.ch--, t.ch < 0 && (t.line--, t.ch = (this.doc.getLine(t.line) || "").length)) : (t.ch++, t.ch > (this.doc.getLine(t.line) || "").length && (t.ch = 0, t.line++)), m.cmpPos(t, this.doc.clipPos(t)) != 0)) return this.atOccurrence = !1; var n = this.matches(e, t); if (this.afterEmptyMatch = n && m.cmpPos(n.from, n.to) == 0, n) return this.pos = n, this.atOccurrence = !0, this.pos.match || !0; var r = a(e ? this.doc.firstLine() : this.doc.lastLine() + 1, 0); return this.pos = { from: r, to: r }, this.atOccurrence = !1; }, from: function () { if (this.atOccurrence) return this.pos.from; }, to: function () { if (this.atOccurrence) return this.pos.to; }, replace: function (e, t) { if (this.atOccurrence) { var n = m.splitLines(e); this.doc.replaceRange(n, this.pos.from, this.pos.to, t), this.pos.to = a(this.pos.from.line + n.length - 1, n[n.length - 1].length + (n.length == 1 ? this.pos.from.ch : 0)); } } }, m.defineExtension("getSearchCursor", function (e, t, n) { return new w(this.doc, e, t, n); }), m.defineDocExtension("getSearchCursor", function (e, t, n) { return new w(this, e, t, n); }), m.defineExtension("selectMatches", function (e, t) { for (var n = [], r = this.getSearchCursor(e, this.getCursor("from"), t); r.findNext() && !(m.cmpPos(r.to(), this.getCursor("to")) > 0);) n.push({ anchor: r.from(), head: r.to() }); n.length && this.setSelections(n, 0); }); }); }()), N.exports; } o(H, "requireSearchcursor"); exports.requireSearchcursor = H; /***/ }), /***/ "../../graphiql-react/dist/show-hint.cjs.js": /*!**************************************************!*\ !*** ../../graphiql-react/dist/show-hint.cjs.js ***! \**************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var ct = Object.defineProperty; var p = (H, A) => ct(H, "name", { value: A, configurable: !0 }); const G = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"); function lt(H, A) { for (var r = 0; r < A.length; r++) { const w = A[r]; if (typeof w != "string" && !Array.isArray(w)) { for (const v in w) if (v !== "default" && !(v in H)) { const b = Object.getOwnPropertyDescriptor(w, v); b && Object.defineProperty(H, v, b.get ? b : { enumerable: !0, get: () => w[v] }); } } } return Object.freeze(Object.defineProperty(H, Symbol.toStringTag, { value: "Module" })); } p(lt, "_mergeNamespaces"); var ht = { exports: {} }; (function (H, A) { (function (r) { r(G.requireCodemirror()); })(function (r) { var w = "CodeMirror-hint", v = "CodeMirror-hint-active"; r.showHint = function (t, e, i) { if (!e) return t.showHint(i); i && i.async && (e.async = !0); var n = { hint: e }; if (i) for (var s in i) n[s] = i[s]; return t.showHint(n); }, r.defineExtension("showHint", function (t) { t = tt(this, this.getCursor("start"), t); var e = this.listSelections(); if (!(e.length > 1)) { if (this.somethingSelected()) { if (!t.hint.supportsSelection) return; for (var i = 0; i < e.length; i++) if (e[i].head.line != e[i].anchor.line) return; } this.state.completionActive && this.state.completionActive.close(); var n = this.state.completionActive = new b(this, t); n.options.hint && (r.signal(this, "startCompletion", this), n.update(!0)); } }), r.defineExtension("closeHint", function () { this.state.completionActive && this.state.completionActive.close(); }); function b(t, e) { if (this.cm = t, this.options = e, this.widget = null, this.debounce = 0, this.tick = 0, this.startPos = this.cm.getCursor("start"), this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length, this.options.updateOnCursorActivity) { var i = this; t.on("cursorActivity", this.activityFunc = function () { i.cursorActivity(); }); } } p(b, "Completion"); var Q = window.requestAnimationFrame || function (t) { return setTimeout(t, 1e3 / 60); }, Z = window.cancelAnimationFrame || clearTimeout; b.prototype = { close: function () { this.active() && (this.cm.state.completionActive = null, this.tick = null, this.options.updateOnCursorActivity && this.cm.off("cursorActivity", this.activityFunc), this.widget && this.data && r.signal(this.data, "close"), this.widget && this.widget.close(), r.signal(this.cm, "endCompletion", this.cm)); }, active: function () { return this.cm.state.completionActive == this; }, pick: function (t, e) { var i = t.list[e], n = this; this.cm.operation(function () { i.hint ? i.hint(n.cm, t, i) : n.cm.replaceRange(_(i), i.from || t.from, i.to || t.to, "complete"), r.signal(t, "pick", i), n.cm.scrollIntoView(); }), this.options.closeOnPick && this.close(); }, cursorActivity: function () { this.debounce && (Z(this.debounce), this.debounce = 0); var t = this.startPos; this.data && (t = this.data.from); var e = this.cm.getCursor(), i = this.cm.getLine(e.line); if (e.line != this.startPos.line || i.length - e.ch != this.startLen - this.startPos.ch || e.ch < t.ch || this.cm.somethingSelected() || !e.ch || this.options.closeCharacters.test(i.charAt(e.ch - 1))) this.close();else { var n = this; this.debounce = Q(function () { n.update(); }), this.widget && this.widget.disable(); } }, update: function (t) { if (this.tick != null) { var e = this, i = ++this.tick; U(this.options.hint, this.cm, this.options, function (n) { e.tick == i && e.finishUpdate(n, t); }); } }, finishUpdate: function (t, e) { this.data && r.signal(this.data, "update"); var i = this.widget && this.widget.picked || e && this.options.completeSingle; this.widget && this.widget.close(), this.data = t, t && t.list.length && (i && t.list.length == 1 ? this.pick(t, 0) : (this.widget = new K(this, t), r.signal(t, "shown"))); } }; function tt(t, e, i) { var n = t.options.hintOptions, s = {}; for (var c in D) s[c] = D[c]; if (n) for (var c in n) n[c] !== void 0 && (s[c] = n[c]); if (i) for (var c in i) i[c] !== void 0 && (s[c] = i[c]); return s.hint.resolve && (s.hint = s.hint.resolve(t, e)), s; } p(tt, "parseOptions"); function _(t) { return typeof t == "string" ? t : t.text; } p(_, "getText"); function et(t, e) { var i = { Up: function () { e.moveFocus(-1); }, Down: function () { e.moveFocus(1); }, PageUp: function () { e.moveFocus(-e.menuSize() + 1, !0); }, PageDown: function () { e.moveFocus(e.menuSize() - 1, !0); }, Home: function () { e.setFocus(0); }, End: function () { e.setFocus(e.length - 1); }, Enter: e.pick, Tab: e.pick, Esc: e.close }, n = /Mac/.test(navigator.platform); n && (i["Ctrl-P"] = function () { e.moveFocus(-1); }, i["Ctrl-N"] = function () { e.moveFocus(1); }); var s = t.options.customKeys, c = s ? {} : i; function o(u, l) { var a; typeof l != "string" ? a = p(function (S) { return l(S, e); }, "bound") : i.hasOwnProperty(l) ? a = i[l] : a = l, c[u] = a; } if (p(o, "addBinding"), s) for (var f in s) s.hasOwnProperty(f) && o(f, s[f]); var h = t.options.extraKeys; if (h) for (var f in h) h.hasOwnProperty(f) && o(f, h[f]); return c; } p(et, "buildKeyMap"); function B(t, e) { for (; e && e != t;) { if (e.nodeName.toUpperCase() === "LI" && e.parentNode == t) return e; e = e.parentNode; } } p(B, "getHintElement"); function K(t, e) { this.id = "cm-complete-" + Math.floor(Math.random(1e6)), this.completion = t, this.data = e, this.picked = !1; var i = this, n = t.cm, s = n.getInputField().ownerDocument, c = s.defaultView || s.parentWindow, o = this.hints = s.createElement("ul"); o.setAttribute("role", "listbox"), o.setAttribute("aria-expanded", "true"), o.id = this.id; var f = t.cm.options.theme; o.className = "CodeMirror-hints " + f, this.selectedHint = e.selectedHint || 0; for (var h = e.list, u = 0; u < h.length; ++u) { var l = o.appendChild(s.createElement("li")), a = h[u], S = w + (u != this.selectedHint ? "" : " " + v); a.className != null && (S = a.className + " " + S), l.className = S, u == this.selectedHint && l.setAttribute("aria-selected", "true"), l.id = this.id + "-" + u, l.setAttribute("role", "option"), a.render ? a.render(l, e, a) : l.appendChild(s.createTextNode(a.displayText || _(a))), l.hintId = u; } var T = t.options.container || s.body, y = n.cursorCoords(t.options.alignWithWord ? e.from : null), k = y.left, O = y.bottom, j = !0, F = 0, E = 0; if (T !== s.body) { var st = ["absolute", "relative", "fixed"].indexOf(c.getComputedStyle(T).position) !== -1, W = st ? T : T.offsetParent, M = W.getBoundingClientRect(), q = s.body.getBoundingClientRect(); F = M.left - q.left - W.scrollLeft, E = M.top - q.top - W.scrollTop; } o.style.left = k - F + "px", o.style.top = O - E + "px"; var N = c.innerWidth || Math.max(s.body.offsetWidth, s.documentElement.offsetWidth), L = c.innerHeight || Math.max(s.body.offsetHeight, s.documentElement.offsetHeight); T.appendChild(o), n.getInputField().setAttribute("aria-autocomplete", "list"), n.getInputField().setAttribute("aria-owns", this.id), n.getInputField().setAttribute("aria-activedescendant", this.id + "-" + this.selectedHint); var m = t.options.moveOnOverlap ? o.getBoundingClientRect() : new DOMRect(), z = t.options.paddingForScrollbar ? o.scrollHeight > o.clientHeight + 1 : !1, x; setTimeout(function () { x = n.getScrollInfo(); }); var ot = m.bottom - L; if (ot > 0) { var P = m.bottom - m.top, rt = y.top - (y.bottom - m.top); if (rt - P > 0) o.style.top = (O = y.top - P - E) + "px", j = !1;else if (P > L) { o.style.height = L - 5 + "px", o.style.top = (O = y.bottom - m.top - E) + "px"; var V = n.getCursor(); e.from.ch != V.ch && (y = n.cursorCoords(V), o.style.left = (k = y.left - F) + "px", m = o.getBoundingClientRect()); } } var C = m.right - N; if (z && (C += n.display.nativeBarWidth), C > 0 && (m.right - m.left > N && (o.style.width = N - 5 + "px", C -= m.right - m.left - N), o.style.left = (k = y.left - C - F) + "px"), z) for (var I = o.firstChild; I; I = I.nextSibling) I.style.paddingRight = n.display.nativeBarWidth + "px"; if (n.addKeyMap(this.keyMap = et(t, { moveFocus: function (d, g) { i.changeActive(i.selectedHint + d, g); }, setFocus: function (d) { i.changeActive(d); }, menuSize: function () { return i.screenAmount(); }, length: h.length, close: function () { t.close(); }, pick: function () { i.pick(); }, data: e })), t.options.closeOnUnfocus) { var Y; n.on("blur", this.onBlur = function () { Y = setTimeout(function () { t.close(); }, 100); }), n.on("focus", this.onFocus = function () { clearTimeout(Y); }); } n.on("scroll", this.onScroll = function () { var d = n.getScrollInfo(), g = n.getWrapperElement().getBoundingClientRect(); x || (x = n.getScrollInfo()); var X = O + x.top - d.top, R = X - (c.pageYOffset || (s.documentElement || s.body).scrollTop); if (j || (R += o.offsetHeight), R <= g.top || R >= g.bottom) return t.close(); o.style.top = X + "px", o.style.left = k + x.left - d.left + "px"; }), r.on(o, "dblclick", function (d) { var g = B(o, d.target || d.srcElement); g && g.hintId != null && (i.changeActive(g.hintId), i.pick()); }), r.on(o, "click", function (d) { var g = B(o, d.target || d.srcElement); g && g.hintId != null && (i.changeActive(g.hintId), t.options.completeOnSingleClick && i.pick()); }), r.on(o, "mousedown", function () { setTimeout(function () { n.focus(); }, 20); }); var $ = this.getSelectedHintRange(); return ($.from !== 0 || $.to !== 0) && this.scrollToActive(), r.signal(e, "select", h[this.selectedHint], o.childNodes[this.selectedHint]), !0; } p(K, "Widget"), K.prototype = { close: function () { if (this.completion.widget == this) { this.completion.widget = null, this.hints.parentNode && this.hints.parentNode.removeChild(this.hints), this.completion.cm.removeKeyMap(this.keyMap); var t = this.completion.cm.getInputField(); t.removeAttribute("aria-activedescendant"), t.removeAttribute("aria-owns"); var e = this.completion.cm; this.completion.options.closeOnUnfocus && (e.off("blur", this.onBlur), e.off("focus", this.onFocus)), e.off("scroll", this.onScroll); } }, disable: function () { this.completion.cm.removeKeyMap(this.keyMap); var t = this; this.keyMap = { Enter: function () { t.picked = !0; } }, this.completion.cm.addKeyMap(this.keyMap); }, pick: function () { this.completion.pick(this.data, this.selectedHint); }, changeActive: function (t, e) { if (t >= this.data.list.length ? t = e ? this.data.list.length - 1 : 0 : t < 0 && (t = e ? 0 : this.data.list.length - 1), this.selectedHint != t) { var i = this.hints.childNodes[this.selectedHint]; i && (i.className = i.className.replace(" " + v, ""), i.removeAttribute("aria-selected")), i = this.hints.childNodes[this.selectedHint = t], i.className += " " + v, i.setAttribute("aria-selected", "true"), this.completion.cm.getInputField().setAttribute("aria-activedescendant", i.id), this.scrollToActive(), r.signal(this.data, "select", this.data.list[this.selectedHint], i); } }, scrollToActive: function () { var t = this.getSelectedHintRange(), e = this.hints.childNodes[t.from], i = this.hints.childNodes[t.to], n = this.hints.firstChild; e.offsetTop < this.hints.scrollTop ? this.hints.scrollTop = e.offsetTop - n.offsetTop : i.offsetTop + i.offsetHeight > this.hints.scrollTop + this.hints.clientHeight && (this.hints.scrollTop = i.offsetTop + i.offsetHeight - this.hints.clientHeight + n.offsetTop); }, screenAmount: function () { return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; }, getSelectedHintRange: function () { var t = this.completion.options.scrollMargin || 0; return { from: Math.max(0, this.selectedHint - t), to: Math.min(this.data.list.length - 1, this.selectedHint + t) }; } }; function it(t, e) { if (!t.somethingSelected()) return e; for (var i = [], n = 0; n < e.length; n++) e[n].supportsSelection && i.push(e[n]); return i; } p(it, "applicableHelpers"); function U(t, e, i, n) { if (t.async) t(e, n, i);else { var s = t(e, i); s && s.then ? s.then(n) : n(s); } } p(U, "fetchHints"); function nt(t, e) { var i = t.getHelpers(e, "hint"), n; if (i.length) { var s = p(function (c, o, f) { var h = it(c, i); function u(l) { if (l == h.length) return o(null); U(h[l], c, f, function (a) { a && a.list.length > 0 ? o(a) : u(l + 1); }); } p(u, "run"), u(0); }, "resolved"); return s.async = !0, s.supportsSelection = !0, s; } else return (n = t.getHelper(t.getCursor(), "hintWords")) ? function (c) { return r.hint.fromList(c, { words: n }); } : r.hint.anyword ? function (c, o) { return r.hint.anyword(c, o); } : function () {}; } p(nt, "resolveAutoHints"), r.registerHelper("hint", "auto", { resolve: nt }), r.registerHelper("hint", "fromList", function (t, e) { var i = t.getCursor(), n = t.getTokenAt(i), s, c = r.Pos(i.line, n.start), o = i; n.start < i.ch && /\w/.test(n.string.charAt(i.ch - n.start - 1)) ? s = n.string.substr(0, i.ch - n.start) : (s = "", c = i); for (var f = [], h = 0; h < e.words.length; h++) { var u = e.words[h]; u.slice(0, s.length) == s && f.push(u); } if (f.length) return { list: f, from: c, to: o }; }), r.commands.autocomplete = r.showHint; var D = { hint: r.hint.auto, completeSingle: !0, alignWithWord: !0, closeCharacters: /[\s()\[\]{};:>,]/, closeOnPick: !0, closeOnUnfocus: !0, updateOnCursorActivity: !0, completeOnSingleClick: !0, container: null, customKeys: null, extraKeys: null, paddingForScrollbar: !0, moveOnOverlap: !0 }; r.defineOption("hintOptions", null); }); })(); var J = ht.exports; const at = G.getDefaultExportFromCjs(J), ft = lt({ __proto__: null, default: at }, [J]); exports.showHint = ft; /***/ }), /***/ "../../graphiql-react/dist/sublime.cjs.js": /*!************************************************!*\ !*** ../../graphiql-react/dist/sublime.cjs.js ***! \************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { var _ = Object.defineProperty; var v = (m, B) => _(m, "name", { value: B, configurable: !0 }); const E = __webpack_require__(/*! ./codemirror.cjs2.js */ "../../graphiql-react/dist/codemirror.cjs2.js"), Y = __webpack_require__(/*! ./searchcursor.cjs2.js */ "../../graphiql-react/dist/searchcursor.cjs2.js"), z = __webpack_require__(/*! ./matchbrackets.cjs2.js */ "../../graphiql-react/dist/matchbrackets.cjs2.js"); function J(m, B) { for (var h = 0; h < B.length; h++) { const a = B[h]; if (typeof a != "string" && !Array.isArray(a)) { for (const f in a) if (f !== "default" && !(f in m)) { const A = Object.getOwnPropertyDescriptor(a, f); A && Object.defineProperty(m, f, A.get ? A : { enumerable: !0, get: () => a[f] }); } } } return Object.freeze(Object.defineProperty(m, Symbol.toStringTag, { value: "Module" })); } v(J, "_mergeNamespaces"); var G = { exports: {} }; (function (m, B) { (function (h) { h(E.requireCodemirror(), Y.requireSearchcursor(), z.requireMatchbrackets()); })(function (h) { var a = h.commands, f = h.Pos; function A(e, t, n) { if (n < 0 && t.ch == 0) return e.clipPos(f(t.line - 1)); var r = e.getLine(t.line); if (n > 0 && t.ch >= r.length) return e.clipPos(f(t.line + 1, 0)); for (var l = "start", i, o = t.ch, s = o, u = n < 0 ? 0 : r.length, d = 0; s != u; s += n, d++) { var p = r.charAt(n < 0 ? s - 1 : s), c = p != "_" && h.isWordChar(p) ? "w" : "o"; if (c == "w" && p.toUpperCase() == p && (c = "W"), l == "start") c != "o" ? (l = "in", i = c) : o = s + n;else if (l == "in" && i != c) { if (i == "w" && c == "W" && n < 0 && s--, i == "W" && c == "w" && n > 0) if (s == o + 1) { i = "w"; continue; } else s--; break; } } return f(t.line, s); } v(A, "findPosSubword"); function T(e, t) { e.extendSelectionsBy(function (n) { return e.display.shift || e.doc.extend || n.empty() ? A(e.doc, n.head, t) : t < 0 ? n.from() : n.to(); }); } v(T, "moveSubword"), a.goSubwordLeft = function (e) { T(e, -1); }, a.goSubwordRight = function (e) { T(e, 1); }, a.scrollLineUp = function (e) { var t = e.getScrollInfo(); if (!e.somethingSelected()) { var n = e.lineAtHeight(t.top + t.clientHeight, "local"); e.getCursor().line >= n && e.execCommand("goLineUp"); } e.scrollTo(null, t.top - e.defaultTextHeight()); }, a.scrollLineDown = function (e) { var t = e.getScrollInfo(); if (!e.somethingSelected()) { var n = e.lineAtHeight(t.top, "local") + 1; e.getCursor().line <= n && e.execCommand("goLineDown"); } e.scrollTo(null, t.top + e.defaultTextHeight()); }, a.splitSelectionByLine = function (e) { for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) for (var l = t[r].from(), i = t[r].to(), o = l.line; o <= i.line; ++o) i.line > l.line && o == i.line && i.ch == 0 || n.push({ anchor: o == l.line ? l : f(o, 0), head: o == i.line ? i : f(o) }); e.setSelections(n, 0); }, a.singleSelectionTop = function (e) { var t = e.listSelections()[0]; e.setSelection(t.anchor, t.head, { scroll: !1 }); }, a.selectLine = function (e) { for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) { var l = t[r]; n.push({ anchor: f(l.from().line, 0), head: f(l.to().line + 1, 0) }); } e.setSelections(n); }; function x(e, t) { if (e.isReadOnly()) return h.Pass; e.operation(function () { for (var n = e.listSelections().length, r = [], l = -1, i = 0; i < n; i++) { var o = e.listSelections()[i].head; if (!(o.line <= l)) { var s = f(o.line + (t ? 0 : 1), 0); e.replaceRange(` `, s, null, "+insertLine"), e.indentLine(s.line, null, !0), r.push({ head: s, anchor: s }), l = o.line + 1; } } e.setSelections(r); }), e.execCommand("indentAuto"); } v(x, "insertLine"), a.insertLineAfter = function (e) { return x(e, !1); }, a.insertLineBefore = function (e) { return x(e, !0); }; function K(e, t) { for (var n = t.ch, r = n, l = e.getLine(t.line); n && h.isWordChar(l.charAt(n - 1));) --n; for (; r < l.length && h.isWordChar(l.charAt(r));) ++r; return { from: f(t.line, n), to: f(t.line, r), word: l.slice(n, r) }; } v(K, "wordAt"), a.selectNextOccurrence = function (e) { var t = e.getCursor("from"), n = e.getCursor("to"), r = e.state.sublimeFindFullWord == e.doc.sel; if (h.cmpPos(t, n) == 0) { var l = K(e, t); if (!l.word) return; e.setSelection(l.from, l.to), r = !0; } else { var i = e.getRange(t, n), o = r ? new RegExp("\\b" + i + "\\b") : i, s = e.getSearchCursor(o, n), u = s.findNext(); if (u || (s = e.getSearchCursor(o, f(e.firstLine(), 0)), u = s.findNext()), !u || H(e.listSelections(), s.from(), s.to())) return; e.addSelection(s.from(), s.to()); } r && (e.state.sublimeFindFullWord = e.doc.sel); }, a.skipAndSelectNextOccurrence = function (e) { var t = e.getCursor("anchor"), n = e.getCursor("head"); a.selectNextOccurrence(e), h.cmpPos(t, n) != 0 && e.doc.setSelections(e.doc.listSelections().filter(function (r) { return r.anchor != t || r.head != n; })); }; function y(e, t) { for (var n = e.listSelections(), r = [], l = 0; l < n.length; l++) { var i = n[l], o = e.findPosV(i.anchor, t, "line", i.anchor.goalColumn), s = e.findPosV(i.head, t, "line", i.head.goalColumn); o.goalColumn = i.anchor.goalColumn != null ? i.anchor.goalColumn : e.cursorCoords(i.anchor, "div").left, s.goalColumn = i.head.goalColumn != null ? i.head.goalColumn : e.cursorCoords(i.head, "div").left; var u = { anchor: o, head: s }; r.push(i), r.push(u); } e.setSelections(r); } v(y, "addCursorToSelection"), a.addCursorToPrevLine = function (e) { y(e, -1); }, a.addCursorToNextLine = function (e) { y(e, 1); }; function H(e, t, n) { for (var r = 0; r < e.length; r++) if (h.cmpPos(e[r].from(), t) == 0 && h.cmpPos(e[r].to(), n) == 0) return !0; return !1; } v(H, "isSelectedRange"); var P = "(){}[]"; function U(e) { for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) { var l = t[r], i = l.head, o = e.scanForBracket(i, -1); if (!o) return !1; for (;;) { var s = e.scanForBracket(i, 1); if (!s) return !1; if (s.ch == P.charAt(P.indexOf(o.ch) + 1)) { var u = f(o.pos.line, o.pos.ch + 1); if (h.cmpPos(u, l.from()) == 0 && h.cmpPos(s.pos, l.to()) == 0) { if (o = e.scanForBracket(o.pos, -1), !o) return !1; } else { n.push({ anchor: u, head: s.pos }); break; } } i = f(s.pos.line, s.pos.ch + 1); } } return e.setSelections(n), !0; } v(U, "selectBetweenBrackets"), a.selectScope = function (e) { U(e) || e.execCommand("selectAll"); }, a.selectBetweenBrackets = function (e) { if (!U(e)) return h.Pass; }; function I(e) { return e ? /\bpunctuation\b/.test(e) ? e : void 0 : null; } v(I, "puncType"), a.goToBracket = function (e) { e.extendSelectionsBy(function (t) { var n = e.scanForBracket(t.head, 1, I(e.getTokenTypeAt(t.head))); if (n && h.cmpPos(n.pos, t.head) != 0) return n.pos; var r = e.scanForBracket(t.head, -1, I(e.getTokenTypeAt(f(t.head.line, t.head.ch + 1)))); return r && f(r.pos.line, r.pos.ch + 1) || t.head; }); }, a.swapLineUp = function (e) { if (e.isReadOnly()) return h.Pass; for (var t = e.listSelections(), n = [], r = e.firstLine() - 1, l = [], i = 0; i < t.length; i++) { var o = t[i], s = o.from().line - 1, u = o.to().line; l.push({ anchor: f(o.anchor.line - 1, o.anchor.ch), head: f(o.head.line - 1, o.head.ch) }), o.to().ch == 0 && !o.empty() && --u, s > r ? n.push(s, u) : n.length && (n[n.length - 1] = u), r = u; } e.operation(function () { for (var d = 0; d < n.length; d += 2) { var p = n[d], c = n[d + 1], b = e.getLine(p); e.replaceRange("", f(p, 0), f(p + 1, 0), "+swapLine"), c > e.lastLine() ? e.replaceRange(` ` + b, f(e.lastLine()), null, "+swapLine") : e.replaceRange(b + ` `, f(c, 0), null, "+swapLine"); } e.setSelections(l), e.scrollIntoView(); }); }, a.swapLineDown = function (e) { if (e.isReadOnly()) return h.Pass; for (var t = e.listSelections(), n = [], r = e.lastLine() + 1, l = t.length - 1; l >= 0; l--) { var i = t[l], o = i.to().line + 1, s = i.from().line; i.to().ch == 0 && !i.empty() && o--, o < r ? n.push(o, s) : n.length && (n[n.length - 1] = s), r = s; } e.operation(function () { for (var u = n.length - 2; u >= 0; u -= 2) { var d = n[u], p = n[u + 1], c = e.getLine(d); d == e.lastLine() ? e.replaceRange("", f(d - 1), f(d), "+swapLine") : e.replaceRange("", f(d, 0), f(d + 1, 0), "+swapLine"), e.replaceRange(c + ` `, f(p, 0), null, "+swapLine"); } e.scrollIntoView(); }); }, a.toggleCommentIndented = function (e) { e.toggleComment({ indent: !0 }); }, a.joinLines = function (e) { for (var t = e.listSelections(), n = [], r = 0; r < t.length; r++) { for (var l = t[r], i = l.from(), o = i.line, s = l.to().line; r < t.length - 1 && t[r + 1].from().line == s;) s = t[++r].to().line; n.push({ start: o, end: s, anchor: !l.empty() && i }); } e.operation(function () { for (var u = 0, d = [], p = 0; p < n.length; p++) { for (var c = n[p], b = c.anchor && f(c.anchor.line - u, c.anchor.ch), w, g = c.start; g <= c.end; g++) { var S = g - u; g == c.end && (w = f(S, e.getLine(S).length + 1)), S < e.lastLine() && (e.replaceRange(" ", f(S), f(S + 1, /^\s*/.exec(e.getLine(S + 1))[0].length)), ++u); } d.push({ anchor: b || w, head: w }); } e.setSelections(d, 0); }); }, a.duplicateLine = function (e) { e.operation(function () { for (var t = e.listSelections().length, n = 0; n < t; n++) { var r = e.listSelections()[n]; r.empty() ? e.replaceRange(e.getLine(r.head.line) + ` `, f(r.head.line, 0)) : e.replaceRange(e.getRange(r.from(), r.to()), r.from()); } e.scrollIntoView(); }); }; function R(e, t, n) { if (e.isReadOnly()) return h.Pass; for (var r = e.listSelections(), l = [], i, o = 0; o < r.length; o++) { var s = r[o]; if (!s.empty()) { for (var u = s.from().line, d = s.to().line; o < r.length - 1 && r[o + 1].from().line == d;) d = r[++o].to().line; r[o].to().ch || d--, l.push(u, d); } } l.length ? i = !0 : l.push(e.firstLine(), e.lastLine()), e.operation(function () { for (var p = [], c = 0; c < l.length; c += 2) { var b = l[c], w = l[c + 1], g = f(b, 0), S = f(w), F = e.getRange(g, S, !1); t ? F.sort(function (k, L) { return k < L ? -n : k == L ? 0 : n; }) : F.sort(function (k, L) { var W = k.toUpperCase(), M = L.toUpperCase(); return W != M && (k = W, L = M), k < L ? -n : k == L ? 0 : n; }), e.replaceRange(F, g, S), i && p.push({ anchor: g, head: f(w + 1, 0) }); } i && e.setSelections(p, 0); }); } v(R, "sortLines"), a.sortLines = function (e) { R(e, !0, 1); }, a.reverseSortLines = function (e) { R(e, !0, -1); }, a.sortLinesInsensitive = function (e) { R(e, !1, 1); }, a.reverseSortLinesInsensitive = function (e) { R(e, !1, -1); }, a.nextBookmark = function (e) { var t = e.state.sublimeBookmarks; if (t) for (; t.length;) { var n = t.shift(), r = n.find(); if (r) return t.push(n), e.setSelection(r.from, r.to); } }, a.prevBookmark = function (e) { var t = e.state.sublimeBookmarks; if (t) for (; t.length;) { t.unshift(t.pop()); var n = t[t.length - 1].find(); if (!n) t.pop();else return e.setSelection(n.from, n.to); } }, a.toggleBookmark = function (e) { for (var t = e.listSelections(), n = e.state.sublimeBookmarks || (e.state.sublimeBookmarks = []), r = 0; r < t.length; r++) { for (var l = t[r].from(), i = t[r].to(), o = t[r].empty() ? e.findMarksAt(l) : e.findMarks(l, i), s = 0; s < o.length; s++) if (o[s].sublimeBookmark) { o[s].clear(); for (var u = 0; u < n.length; u++) n[u] == o[s] && n.splice(u--, 1); break; } s == o.length && n.push(e.markText(l, i, { sublimeBookmark: !0, clearWhenEmpty: !1 })); } }, a.clearBookmarks = function (e) { var t = e.state.sublimeBookmarks; if (t) for (var n = 0; n < t.length; n++) t[n].clear(); t.length = 0; }, a.selectBookmarks = function (e) { var t = e.state.sublimeBookmarks, n = []; if (t) for (var r = 0; r < t.length; r++) { var l = t[r].find(); l ? n.push({ anchor: l.from, head: l.to }) : t.splice(r--, 0); } n.length && e.setSelections(n, 0); }; function D(e, t) { e.operation(function () { for (var n = e.listSelections(), r = [], l = [], i = 0; i < n.length; i++) { var o = n[i]; o.empty() ? (r.push(i), l.push("")) : l.push(t(e.getRange(o.from(), o.to()))); } e.replaceSelections(l, "around", "case"); for (var i = r.length - 1, s; i >= 0; i--) { var o = n[r[i]]; if (!(s && h.cmpPos(o.head, s) > 0)) { var u = K(e, o.head); s = u.from, e.replaceRange(t(u.word), u.from, u.to); } } }); } v(D, "modifyWordOrSelection"), a.smartBackspace = function (e) { if (e.somethingSelected()) return h.Pass; e.operation(function () { for (var t = e.listSelections(), n = e.getOption("indentUnit"), r = t.length - 1; r >= 0; r--) { var l = t[r].head, i = e.getRange({ line: l.line, ch: 0 }, l), o = h.countColumn(i, null, e.getOption("tabSize")), s = e.findPosH(l, -1, "char", !1); if (i && !/\S/.test(i) && o % n == 0) { var u = new f(l.line, h.findColumn(i, o - n, n)); u.ch != l.ch && (s = u); } e.replaceRange("", s, l, "+delete"); } }); }, a.delLineRight = function (e) { e.operation(function () { for (var t = e.listSelections(), n = t.length - 1; n >= 0; n--) e.replaceRange("", t[n].anchor, f(t[n].to().line), "+delete"); e.scrollIntoView(); }); }, a.upcaseAtCursor = function (e) { D(e, function (t) { return t.toUpperCase(); }); }, a.downcaseAtCursor = function (e) { D(e, function (t) { return t.toLowerCase(); }); }, a.setSublimeMark = function (e) { e.state.sublimeMark && e.state.sublimeMark.clear(), e.state.sublimeMark = e.setBookmark(e.getCursor()); }, a.selectToSublimeMark = function (e) { var t = e.state.sublimeMark && e.state.sublimeMark.find(); t && e.setSelection(e.getCursor(), t); }, a.deleteToSublimeMark = function (e) { var t = e.state.sublimeMark && e.state.sublimeMark.find(); if (t) { var n = e.getCursor(), r = t; if (h.cmpPos(n, r) > 0) { var l = r; r = n, n = l; } e.state.sublimeKilled = e.getRange(n, r), e.replaceRange("", n, r); } }, a.swapWithSublimeMark = function (e) { var t = e.state.sublimeMark && e.state.sublimeMark.find(); t && (e.state.sublimeMark.clear(), e.state.sublimeMark = e.setBookmark(e.getCursor()), e.setCursor(t)); }, a.sublimeYank = function (e) { e.state.sublimeKilled != null && e.replaceSelection(e.state.sublimeKilled, null, "paste"); }, a.showInCenter = function (e) { var t = e.cursorCoords(null, "local"); e.scrollTo(null, (t.top + t.bottom) / 2 - e.getScrollInfo().clientHeight / 2); }; function N(e) { var t = e.getCursor("from"), n = e.getCursor("to"); if (h.cmpPos(t, n) == 0) { var r = K(e, t); if (!r.word) return; t = r.from, n = r.to; } return { from: t, to: n, query: e.getRange(t, n), word: r }; } v(N, "getTarget"); function O(e, t) { var n = N(e); if (n) { var r = n.query, l = e.getSearchCursor(r, t ? n.to : n.from); (t ? l.findNext() : l.findPrevious()) ? e.setSelection(l.from(), l.to()) : (l = e.getSearchCursor(r, t ? f(e.firstLine(), 0) : e.clipPos(f(e.lastLine()))), (t ? l.findNext() : l.findPrevious()) ? e.setSelection(l.from(), l.to()) : n.word && e.setSelection(n.from, n.to)); } } v(O, "findAndGoTo"), a.findUnder = function (e) { O(e, !0); }, a.findUnderPrevious = function (e) { O(e, !1); }, a.findAllUnder = function (e) { var t = N(e); if (t) { for (var n = e.getSearchCursor(t.query), r = [], l = -1; n.findNext();) r.push({ anchor: n.from(), head: n.to() }), n.from().line <= t.from.line && n.from().ch <= t.from.ch && l++; e.setSelections(r, l); } }; var C = h.keyMap; C.macSublime = { "Cmd-Left": "goLineStartSmart", "Shift-Tab": "indentLess", "Shift-Ctrl-K": "deleteLine", "Alt-Q": "wrapLines", "Ctrl-Left": "goSubwordLeft", "Ctrl-Right": "goSubwordRight", "Ctrl-Alt-Up": "scrollLineUp", "Ctrl-Alt-Down": "scrollLineDown", "Cmd-L": "selectLine", "Shift-Cmd-L": "splitSelectionByLine", Esc: "singleSelectionTop", "Cmd-Enter": "insertLineAfter", "Shift-Cmd-Enter": "insertLineBefore", "Cmd-D": "selectNextOccurrence", "Shift-Cmd-Space": "selectScope", "Shift-Cmd-M": "selectBetweenBrackets", "Cmd-M": "goToBracket", "Cmd-Ctrl-Up": "swapLineUp", "Cmd-Ctrl-Down": "swapLineDown", "Cmd-/": "toggleCommentIndented", "Cmd-J": "joinLines", "Shift-Cmd-D": "duplicateLine", F5: "sortLines", "Shift-F5": "reverseSortLines", "Cmd-F5": "sortLinesInsensitive", "Shift-Cmd-F5": "reverseSortLinesInsensitive", F2: "nextBookmark", "Shift-F2": "prevBookmark", "Cmd-F2": "toggleBookmark", "Shift-Cmd-F2": "clearBookmarks", "Alt-F2": "selectBookmarks", Backspace: "smartBackspace", "Cmd-K Cmd-D": "skipAndSelectNextOccurrence", "Cmd-K Cmd-K": "delLineRight", "Cmd-K Cmd-U": "upcaseAtCursor", "Cmd-K Cmd-L": "downcaseAtCursor", "Cmd-K Cmd-Space": "setSublimeMark", "Cmd-K Cmd-A": "selectToSublimeMark", "Cmd-K Cmd-W": "deleteToSublimeMark", "Cmd-K Cmd-X": "swapWithSublimeMark", "Cmd-K Cmd-Y": "sublimeYank", "Cmd-K Cmd-C": "showInCenter", "Cmd-K Cmd-G": "clearBookmarks", "Cmd-K Cmd-Backspace": "delLineLeft", "Cmd-K Cmd-1": "foldAll", "Cmd-K Cmd-0": "unfoldAll", "Cmd-K Cmd-J": "unfoldAll", "Ctrl-Shift-Up": "addCursorToPrevLine", "Ctrl-Shift-Down": "addCursorToNextLine", "Cmd-F3": "findUnder", "Shift-Cmd-F3": "findUnderPrevious", "Alt-F3": "findAllUnder", "Shift-Cmd-[": "fold", "Shift-Cmd-]": "unfold", "Cmd-I": "findIncremental", "Shift-Cmd-I": "findIncrementalReverse", "Cmd-H": "replace", F3: "findNext", "Shift-F3": "findPrev", fallthrough: "macDefault" }, h.normalizeKeyMap(C.macSublime), C.pcSublime = { "Shift-Tab": "indentLess", "Shift-Ctrl-K": "deleteLine", "Alt-Q": "wrapLines", "Ctrl-T": "transposeChars", "Alt-Left": "goSubwordLeft", "Alt-Right": "goSubwordRight", "Ctrl-Up": "scrollLineUp", "Ctrl-Down": "scrollLineDown", "Ctrl-L": "selectLine", "Shift-Ctrl-L": "splitSelectionByLine", Esc: "singleSelectionTop", "Ctrl-Enter": "insertLineAfter", "Shift-Ctrl-Enter": "insertLineBefore", "Ctrl-D": "selectNextOccurrence", "Shift-Ctrl-Space": "selectScope", "Shift-Ctrl-M": "selectBetweenBrackets", "Ctrl-M": "goToBracket", "Shift-Ctrl-Up": "swapLineUp", "Shift-Ctrl-Down": "swapLineDown", "Ctrl-/": "toggleCommentIndented", "Ctrl-J": "joinLines", "Shift-Ctrl-D": "duplicateLine", F9: "sortLines", "Shift-F9": "reverseSortLines", "Ctrl-F9": "sortLinesInsensitive", "Shift-Ctrl-F9": "reverseSortLinesInsensitive", F2: "nextBookmark", "Shift-F2": "prevBookmark", "Ctrl-F2": "toggleBookmark", "Shift-Ctrl-F2": "clearBookmarks", "Alt-F2": "selectBookmarks", Backspace: "smartBackspace", "Ctrl-K Ctrl-D": "skipAndSelectNextOccurrence", "Ctrl-K Ctrl-K": "delLineRight", "Ctrl-K Ctrl-U": "upcaseAtCursor", "Ctrl-K Ctrl-L": "downcaseAtCursor", "Ctrl-K Ctrl-Space": "setSublimeMark", "Ctrl-K Ctrl-A": "selectToSublimeMark", "Ctrl-K Ctrl-W": "deleteToSublimeMark", "Ctrl-K Ctrl-X": "swapWithSublimeMark", "Ctrl-K Ctrl-Y": "sublimeYank", "Ctrl-K Ctrl-C": "showInCenter", "Ctrl-K Ctrl-G": "clearBookmarks", "Ctrl-K Ctrl-Backspace": "delLineLeft", "Ctrl-K Ctrl-1": "foldAll", "Ctrl-K Ctrl-0": "unfoldAll", "Ctrl-K Ctrl-J": "unfoldAll", "Ctrl-Alt-Up": "addCursorToPrevLine", "Ctrl-Alt-Down": "addCursorToNextLine", "Ctrl-F3": "findUnder", "Shift-Ctrl-F3": "findUnderPrevious", "Alt-F3": "findAllUnder", "Shift-Ctrl-[": "fold", "Shift-Ctrl-]": "unfold", "Ctrl-I": "findIncremental", "Shift-Ctrl-I": "findIncrementalReverse", "Ctrl-H": "replace", F3: "findNext", "Shift-F3": "findPrev", fallthrough: "pcDefault" }, h.normalizeKeyMap(C.pcSublime); var V = C.default == C.macDefault; C.sublime = V ? C.macSublime : C.pcSublime; }); })(); var q = G.exports; const Q = E.getDefaultExportFromCjs(q), X = J({ __proto__: null, default: Q }, [q]); exports.sublime = X; /***/ }), /***/ "../../graphiql-toolkit/esm/async-helpers/index.js": /*!*********************************************************!*\ !*** ../../graphiql-toolkit/esm/async-helpers/index.js ***! \*********************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fetcherReturnToPromise = fetcherReturnToPromise; exports.isAsyncIterable = isAsyncIterable; exports.isObservable = isObservable; exports.isPromise = isPromise; var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; function isPromise(value) { return typeof value === 'object' && value !== null && typeof value.then === 'function'; } function observableToPromise(observable) { return new Promise((resolve, reject) => { const subscription = observable.subscribe({ next(v) { resolve(v); subscription.unsubscribe(); }, error: reject, complete() { reject(new Error('no value resolved')); } }); }); } function isObservable(value) { return typeof value === 'object' && value !== null && 'subscribe' in value && typeof value.subscribe === 'function'; } function isAsyncIterable(input) { return typeof input === 'object' && input !== null && (input[Symbol.toStringTag] === 'AsyncGenerator' || Symbol.asyncIterator in input); } function asyncIterableToPromise(input) { var _a; return __awaiter(this, void 0, void 0, function* () { const iteratorReturn = (_a = ('return' in input ? input : input[Symbol.asyncIterator]()).return) === null || _a === void 0 ? void 0 : _a.bind(input); const iteratorNext = ('next' in input ? input : input[Symbol.asyncIterator]()).next.bind(input); const result = yield iteratorNext(); void (iteratorReturn === null || iteratorReturn === void 0 ? void 0 : iteratorReturn()); return result.value; }); } function fetcherReturnToPromise(fetcherResult) { return __awaiter(this, void 0, void 0, function* () { const result = yield fetcherResult; if (isAsyncIterable(result)) { return asyncIterableToPromise(result); } if (isObservable(result)) { return observableToPromise(result); } return result; }); } /***/ }), /***/ "../../graphiql-toolkit/esm/create-fetcher/createFetcher.js": /*!******************************************************************!*\ !*** ../../graphiql-toolkit/esm/create-fetcher/createFetcher.js ***! \******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createGraphiQLFetcher = createGraphiQLFetcher; var _lib = __webpack_require__(/*! ./lib */ "../../graphiql-toolkit/esm/create-fetcher/lib.js"); function createGraphiQLFetcher(options) { let httpFetch; if (typeof window !== 'undefined' && window.fetch) { httpFetch = window.fetch; } if ((options === null || options === void 0 ? void 0 : options.enableIncrementalDelivery) === null || options.enableIncrementalDelivery !== false) { options.enableIncrementalDelivery = true; } if (options.fetch) { httpFetch = options.fetch; } if (!httpFetch) { throw new Error('No valid fetcher implementation available'); } const simpleFetcher = (0, _lib.createSimpleFetcher)(options, httpFetch); const httpFetcher = options.enableIncrementalDelivery ? (0, _lib.createMultipartFetcher)(options, httpFetch) : simpleFetcher; return (graphQLParams, fetcherOpts) => { if (graphQLParams.operationName === 'IntrospectionQuery') { return (options.schemaFetcher || simpleFetcher)(graphQLParams, fetcherOpts); } const isSubscription = (fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.documentAST) ? (0, _lib.isSubscriptionWithName)(fetcherOpts.documentAST, graphQLParams.operationName || undefined) : false; if (isSubscription) { const wsFetcher = (0, _lib.getWsFetcher)(options, fetcherOpts); if (!wsFetcher) { throw new Error(`Your GraphiQL createFetcher is not properly configured for websocket subscriptions yet. ${options.subscriptionUrl ? `Provided URL ${options.subscriptionUrl} failed` : 'Please provide subscriptionUrl, wsClient or legacyClient option first.'}`); } return wsFetcher(graphQLParams); } return httpFetcher(graphQLParams, fetcherOpts); }; } /***/ }), /***/ "../../graphiql-toolkit/esm/create-fetcher/index.js": /*!**********************************************************!*\ !*** ../../graphiql-toolkit/esm/create-fetcher/index.js ***! \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var _exportNames = { createGraphiQLFetcher: true }; Object.defineProperty(exports, "createGraphiQLFetcher", ({ enumerable: true, get: function () { return _createFetcher.createGraphiQLFetcher; } })); var _types = __webpack_require__(/*! ./types */ "../../graphiql-toolkit/esm/create-fetcher/types.js"); Object.keys(_types).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _types[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _types[key]; } }); }); var _createFetcher = __webpack_require__(/*! ./createFetcher */ "../../graphiql-toolkit/esm/create-fetcher/createFetcher.js"); /***/ }), /***/ "../../graphiql-toolkit/esm/create-fetcher/lib.js": /*!********************************************************!*\ !*** ../../graphiql-toolkit/esm/create-fetcher/lib.js ***! \********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isSubscriptionWithName = exports.getWsFetcher = exports.createWebsocketsFetcherFromUrl = exports.createWebsocketsFetcherFromClient = exports.createSimpleFetcher = exports.createMultipartFetcher = exports.createLegacyWebsocketsFetcher = void 0; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _meros = __webpack_require__(/*! meros */ "../../../node_modules/meros/browser/index.mjs"); var _pushPullAsyncIterableIterator = __webpack_require__(/*! @n1ru4l/push-pull-async-iterable-iterator */ "../../../node_modules/@n1ru4l/push-pull-async-iterable-iterator/index.js"); var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __await = void 0 && (void 0).__await || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }; var __asyncValues = void 0 && (void 0).__asyncValues || function (o) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var m = o[Symbol.asyncIterator], i; return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); } }; var __asyncGenerator = void 0 && (void 0).__asyncGenerator || function (thisArg, _arguments, generator) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var g = generator.apply(thisArg, _arguments || []), i, q = []; return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } function fulfill(value) { resume("next", value); } function reject(value) { resume("throw", value); } function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } }; const errorHasCode = err => { return typeof err === 'object' && err !== null && 'code' in err; }; const isSubscriptionWithName = (document, name) => { let isSubscription = false; (0, _graphql.visit)(document, { OperationDefinition(node) { var _a; if (name === ((_a = node.name) === null || _a === void 0 ? void 0 : _a.value) && node.operation === 'subscription') { isSubscription = true; } } }); return isSubscription; }; exports.isSubscriptionWithName = isSubscriptionWithName; const createSimpleFetcher = (options, httpFetch) => (graphQLParams, fetcherOpts) => __awaiter(void 0, void 0, void 0, function* () { const data = yield httpFetch(options.url, { method: 'POST', body: JSON.stringify(graphQLParams), headers: Object.assign(Object.assign({ 'content-type': 'application/json' }, options.headers), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers) }); return data.json(); }); exports.createSimpleFetcher = createSimpleFetcher; const createWebsocketsFetcherFromUrl = (url, connectionParams) => { let wsClient; try { const { createClient } = __webpack_require__(/*! graphql-ws */ "../../../node_modules/graphql-ws/lib/index.js"); wsClient = createClient({ url, connectionParams }); return createWebsocketsFetcherFromClient(wsClient); } catch (err) { if (errorHasCode(err) && err.code === 'MODULE_NOT_FOUND') { throw new Error("You need to install the 'graphql-ws' package to use websockets when passing a 'subscriptionUrl'"); } console.error(`Error creating websocket client for ${url}`, err); } }; exports.createWebsocketsFetcherFromUrl = createWebsocketsFetcherFromUrl; const createWebsocketsFetcherFromClient = wsClient => graphQLParams => (0, _pushPullAsyncIterableIterator.makeAsyncIterableIteratorFromSink)(sink => wsClient.subscribe(graphQLParams, Object.assign(Object.assign({}, sink), { error(err) { if (err instanceof CloseEvent) { sink.error(new Error(`Socket closed with event ${err.code} ${err.reason || ''}`.trim())); } else { sink.error(err); } } }))); exports.createWebsocketsFetcherFromClient = createWebsocketsFetcherFromClient; const createLegacyWebsocketsFetcher = legacyWsClient => graphQLParams => { const observable = legacyWsClient.request(graphQLParams); return (0, _pushPullAsyncIterableIterator.makeAsyncIterableIteratorFromSink)(sink => observable.subscribe(sink).unsubscribe); }; exports.createLegacyWebsocketsFetcher = createLegacyWebsocketsFetcher; const createMultipartFetcher = (options, httpFetch) => function (graphQLParams, fetcherOpts) { return __asyncGenerator(this, arguments, function* () { var e_1, _a; const response = yield __await(httpFetch(options.url, { method: 'POST', body: JSON.stringify(graphQLParams), headers: Object.assign(Object.assign({ 'content-type': 'application/json', accept: 'application/json, multipart/mixed' }, options.headers), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers) }).then(r => (0, _meros.meros)(r, { multiple: true }))); if (!(0, _pushPullAsyncIterableIterator.isAsyncIterable)(response)) { return yield __await(yield yield __await(response.json())); } try { for (var response_1 = __asyncValues(response), response_1_1; response_1_1 = yield __await(response_1.next()), !response_1_1.done;) { const chunk = response_1_1.value; if (chunk.some(part => !part.json)) { const message = chunk.map(part => `Headers::\n${part.headers}\n\nBody::\n${part.body}`); throw new Error(`Expected multipart chunks to be of json type. got:\n${message}`); } yield yield __await(chunk.map(part => part.body)); } } catch (e_1_1) { e_1 = { error: e_1_1 }; } finally { try { if (response_1_1 && !response_1_1.done && (_a = response_1.return)) yield __await(_a.call(response_1)); } finally { if (e_1) throw e_1.error; } } }); }; exports.createMultipartFetcher = createMultipartFetcher; const getWsFetcher = (options, fetcherOpts) => { if (options.wsClient) { return createWebsocketsFetcherFromClient(options.wsClient); } if (options.subscriptionUrl) { return createWebsocketsFetcherFromUrl(options.subscriptionUrl, Object.assign(Object.assign({}, options.wsConnectionParams), fetcherOpts === null || fetcherOpts === void 0 ? void 0 : fetcherOpts.headers)); } const legacyWebsocketsClient = options.legacyClient || options.legacyWsClient; if (legacyWebsocketsClient) { return createLegacyWebsocketsFetcher(legacyWebsocketsClient); } }; exports.getWsFetcher = getWsFetcher; /***/ }), /***/ "../../graphiql-toolkit/esm/create-fetcher/types.js": /*!**********************************************************!*\ !*** ../../graphiql-toolkit/esm/create-fetcher/types.js ***! \**********************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); /***/ }), /***/ "../../graphiql-toolkit/esm/format/index.js": /*!**************************************************!*\ !*** ../../graphiql-toolkit/esm/format/index.js ***! \**************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.formatError = formatError; exports.formatResult = formatResult; function stringify(obj) { return JSON.stringify(obj, null, 2); } function formatSingleError(error) { return Object.assign(Object.assign({}, error), { message: error.message, stack: error.stack }); } function handleSingleError(error) { if (error instanceof Error) { return formatSingleError(error); } return error; } function formatError(error) { if (Array.isArray(error)) { return stringify({ errors: error.map(e => handleSingleError(e)) }); } return stringify({ errors: [handleSingleError(error)] }); } function formatResult(result) { return stringify(result); } /***/ }), /***/ "../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js": /*!*******************************************************************!*\ !*** ../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js ***! \*******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.fillLeafs = fillLeafs; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); function fillLeafs(schema, docString, getDefaultFieldNames) { const insertions = []; if (!schema || !docString) { return { insertions, result: docString }; } let ast; try { ast = (0, _graphql.parse)(docString); } catch (_a) { return { insertions, result: docString }; } const fieldNameFn = getDefaultFieldNames || defaultGetDefaultFieldNames; const typeInfo = new _graphql.TypeInfo(schema); (0, _graphql.visit)(ast, { leave(node) { typeInfo.leave(node); }, enter(node) { typeInfo.enter(node); if (node.kind === 'Field' && !node.selectionSet) { const fieldType = typeInfo.getType(); const selectionSet = buildSelectionSet(isFieldType(fieldType), fieldNameFn); if (selectionSet && node.loc) { const indent = getIndentation(docString, node.loc.start); insertions.push({ index: node.loc.end, string: ' ' + (0, _graphql.print)(selectionSet).replaceAll('\n', '\n' + indent) }); } } } }); return { insertions, result: withInsertions(docString, insertions) }; } function defaultGetDefaultFieldNames(type) { if (!('getFields' in type)) { return []; } const fields = type.getFields(); if (fields.id) { return ['id']; } if (fields.edges) { return ['edges']; } if (fields.node) { return ['node']; } const leafFieldNames = []; for (const fieldName of Object.keys(fields)) { if ((0, _graphql.isLeafType)(fields[fieldName].type)) { leafFieldNames.push(fieldName); } } return leafFieldNames; } function buildSelectionSet(type, getDefaultFieldNames) { const namedType = (0, _graphql.getNamedType)(type); if (!type || (0, _graphql.isLeafType)(type)) { return; } const fieldNames = getDefaultFieldNames(namedType); if (!Array.isArray(fieldNames) || fieldNames.length === 0 || !('getFields' in namedType)) { return; } return { kind: _graphql.Kind.SELECTION_SET, selections: fieldNames.map(fieldName => { const fieldDef = namedType.getFields()[fieldName]; const fieldType = fieldDef ? fieldDef.type : null; return { kind: _graphql.Kind.FIELD, name: { kind: _graphql.Kind.NAME, value: fieldName }, selectionSet: buildSelectionSet(fieldType, getDefaultFieldNames) }; }) }; } function withInsertions(initial, insertions) { if (insertions.length === 0) { return initial; } let edited = ''; let prevIndex = 0; for (const { index, string } of insertions) { edited += initial.slice(prevIndex, index) + string; prevIndex = index; } edited += initial.slice(prevIndex); return edited; } function getIndentation(str, index) { let indentStart = index; let indentEnd = index; while (indentStart) { const c = str.charCodeAt(indentStart - 1); if (c === 10 || c === 13 || c === 0x2028 || c === 0x2029) { break; } indentStart--; if (c !== 9 && c !== 11 && c !== 12 && c !== 32 && c !== 160) { indentEnd = indentStart; } } return str.slice(indentStart, indentEnd); } function isFieldType(fieldType) { if (fieldType) { return fieldType; } } /***/ }), /***/ "../../graphiql-toolkit/esm/graphql-helpers/index.js": /*!***********************************************************!*\ !*** ../../graphiql-toolkit/esm/graphql-helpers/index.js ***! \***********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var _autoComplete = __webpack_require__(/*! ./auto-complete */ "../../graphiql-toolkit/esm/graphql-helpers/auto-complete.js"); Object.keys(_autoComplete).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _autoComplete[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _autoComplete[key]; } }); }); var _mergeAst = __webpack_require__(/*! ./merge-ast */ "../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js"); Object.keys(_mergeAst).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _mergeAst[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _mergeAst[key]; } }); }); var _operationName = __webpack_require__(/*! ./operation-name */ "../../graphiql-toolkit/esm/graphql-helpers/operation-name.js"); Object.keys(_operationName).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _operationName[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _operationName[key]; } }); }); /***/ }), /***/ "../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js": /*!***************************************************************!*\ !*** ../../graphiql-toolkit/esm/graphql-helpers/merge-ast.js ***! \***************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.mergeAst = mergeAst; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); function uniqueBy(array, iteratee) { var _a; const FilteredMap = new Map(); const result = []; for (const item of array) { if (item.kind === 'Field') { const uniqueValue = iteratee(item); const existing = FilteredMap.get(uniqueValue); if ((_a = item.directives) === null || _a === void 0 ? void 0 : _a.length) { const itemClone = Object.assign({}, item); result.push(itemClone); } else if ((existing === null || existing === void 0 ? void 0 : existing.selectionSet) && item.selectionSet) { existing.selectionSet.selections = [...existing.selectionSet.selections, ...item.selectionSet.selections]; } else if (!existing) { const itemClone = Object.assign({}, item); FilteredMap.set(uniqueValue, itemClone); result.push(itemClone); } } else { result.push(item); } } return result; } function inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType) { var _a; const selectionSetTypeName = selectionSetType ? (0, _graphql.getNamedType)(selectionSetType).name : null; const outputSelections = []; const seenSpreads = []; for (let selection of selections) { if (selection.kind === 'FragmentSpread') { const fragmentName = selection.name.value; if (!selection.directives || selection.directives.length === 0) { if (seenSpreads.includes(fragmentName)) { continue; } else { seenSpreads.push(fragmentName); } } const fragmentDefinition = fragmentDefinitions[selection.name.value]; if (fragmentDefinition) { const { typeCondition, directives, selectionSet } = fragmentDefinition; selection = { kind: _graphql.Kind.INLINE_FRAGMENT, typeCondition, directives, selectionSet }; } } if (selection.kind === _graphql.Kind.INLINE_FRAGMENT && (!selection.directives || ((_a = selection.directives) === null || _a === void 0 ? void 0 : _a.length) === 0)) { const fragmentTypeName = selection.typeCondition ? selection.typeCondition.name.value : null; if (!fragmentTypeName || fragmentTypeName === selectionSetTypeName) { outputSelections.push(...inlineRelevantFragmentSpreads(fragmentDefinitions, selection.selectionSet.selections, selectionSetType)); continue; } } outputSelections.push(selection); } return outputSelections; } function mergeAst(documentAST, schema) { const typeInfo = schema ? new _graphql.TypeInfo(schema) : null; const fragmentDefinitions = Object.create(null); for (const definition of documentAST.definitions) { if (definition.kind === _graphql.Kind.FRAGMENT_DEFINITION) { fragmentDefinitions[definition.name.value] = definition; } } const flattenVisitors = { SelectionSet(node) { const selectionSetType = typeInfo ? typeInfo.getParentType() : null; let { selections } = node; selections = inlineRelevantFragmentSpreads(fragmentDefinitions, selections, selectionSetType); return Object.assign(Object.assign({}, node), { selections }); }, FragmentDefinition() { return null; } }; const flattenedAST = (0, _graphql.visit)(documentAST, typeInfo ? (0, _graphql.visitWithTypeInfo)(typeInfo, flattenVisitors) : flattenVisitors); const deduplicateVisitors = { SelectionSet(node) { let { selections } = node; selections = uniqueBy(selections, selection => selection.alias ? selection.alias.value : selection.name.value); return Object.assign(Object.assign({}, node), { selections }); }, FragmentDefinition() { return null; } }; return (0, _graphql.visit)(flattenedAST, deduplicateVisitors); } /***/ }), /***/ "../../graphiql-toolkit/esm/graphql-helpers/operation-name.js": /*!********************************************************************!*\ !*** ../../graphiql-toolkit/esm/graphql-helpers/operation-name.js ***! \********************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getSelectedOperationName = getSelectedOperationName; function getSelectedOperationName(prevOperations, prevSelectedOperationName, operations) { if (!operations || operations.length < 1) { return; } const names = operations.map(op => { var _a; return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; }); if (prevSelectedOperationName && names.includes(prevSelectedOperationName)) { return prevSelectedOperationName; } if (prevSelectedOperationName && prevOperations) { const prevNames = prevOperations.map(op => { var _a; return (_a = op.name) === null || _a === void 0 ? void 0 : _a.value; }); const prevIndex = prevNames.indexOf(prevSelectedOperationName); if (prevIndex !== -1 && prevIndex < names.length) { return names[prevIndex]; } } return names[0]; } /***/ }), /***/ "../../graphiql-toolkit/esm/index.js": /*!*******************************************!*\ !*** ../../graphiql-toolkit/esm/index.js ***! \*******************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var _asyncHelpers = __webpack_require__(/*! ./async-helpers */ "../../graphiql-toolkit/esm/async-helpers/index.js"); Object.keys(_asyncHelpers).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _asyncHelpers[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _asyncHelpers[key]; } }); }); var _createFetcher = __webpack_require__(/*! ./create-fetcher */ "../../graphiql-toolkit/esm/create-fetcher/index.js"); Object.keys(_createFetcher).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _createFetcher[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _createFetcher[key]; } }); }); var _format = __webpack_require__(/*! ./format */ "../../graphiql-toolkit/esm/format/index.js"); Object.keys(_format).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _format[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _format[key]; } }); }); var _graphqlHelpers = __webpack_require__(/*! ./graphql-helpers */ "../../graphiql-toolkit/esm/graphql-helpers/index.js"); Object.keys(_graphqlHelpers).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _graphqlHelpers[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _graphqlHelpers[key]; } }); }); var _storage = __webpack_require__(/*! ./storage */ "../../graphiql-toolkit/esm/storage/index.js"); Object.keys(_storage).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _storage[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _storage[key]; } }); }); /***/ }), /***/ "../../graphiql-toolkit/esm/storage/base.js": /*!**************************************************!*\ !*** ../../graphiql-toolkit/esm/storage/base.js ***! \**************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.StorageAPI = void 0; function isQuotaError(storage, e) { return e instanceof DOMException && (e.code === 22 || e.code === 1014 || e.name === 'QuotaExceededError' || e.name === 'NS_ERROR_DOM_QUOTA_REACHED') && storage.length !== 0; } class StorageAPI { constructor(storage) { if (storage) { this.storage = storage; } else if (storage === null) { this.storage = null; } else if (typeof window === 'undefined') { this.storage = null; } else { this.storage = { getItem: window.localStorage.getItem.bind(window.localStorage), setItem: window.localStorage.setItem.bind(window.localStorage), removeItem: window.localStorage.removeItem.bind(window.localStorage), get length() { let keys = 0; for (const key in window.localStorage) { if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { keys += 1; } } return keys; }, clear() { for (const key in window.localStorage) { if (key.indexOf(`${STORAGE_NAMESPACE}:`) === 0) { window.localStorage.removeItem(key); } } } }; } } get(name) { if (!this.storage) { return null; } const key = `${STORAGE_NAMESPACE}:${name}`; const value = this.storage.getItem(key); if (value === 'null' || value === 'undefined') { this.storage.removeItem(key); return null; } return value || null; } set(name, value) { let quotaError = false; let error = null; if (this.storage) { const key = `${STORAGE_NAMESPACE}:${name}`; if (value) { try { this.storage.setItem(key, value); } catch (e) { error = e instanceof Error ? e : new Error(`${e}`); quotaError = isQuotaError(this.storage, e); } } else { this.storage.removeItem(key); } } return { isQuotaError: quotaError, error }; } clear() { if (this.storage) { this.storage.clear(); } } } exports.StorageAPI = StorageAPI; const STORAGE_NAMESPACE = 'graphiql'; /***/ }), /***/ "../../graphiql-toolkit/esm/storage/custom.js": /*!****************************************************!*\ !*** ../../graphiql-toolkit/esm/storage/custom.js ***! \****************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.createLocalStorage = createLocalStorage; function createLocalStorage(_ref) { let { namespace } = _ref; const storageKeyPrefix = `${namespace}:`; const getStorageKey = key => `${storageKeyPrefix}${key}`; const storage = { setItem: (key, value) => localStorage.setItem(getStorageKey(key), value), getItem: key => localStorage.getItem(getStorageKey(key)), removeItem: key => localStorage.removeItem(getStorageKey(key)), get length() { let keys = 0; for (const key in window.localStorage) { if (key.indexOf(storageKeyPrefix) === 0) { keys += 1; } } return keys; }, clear() { for (const key in window.localStorage) { if (key.indexOf(storageKeyPrefix) === 0) { window.localStorage.removeItem(key); } } } }; return storage; } /***/ }), /***/ "../../graphiql-toolkit/esm/storage/history.js": /*!*****************************************************!*\ !*** ../../graphiql-toolkit/esm/storage/history.js ***! \*****************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.HistoryStore = void 0; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _query = __webpack_require__(/*! ./query */ "../../graphiql-toolkit/esm/storage/query.js"); const MAX_QUERY_SIZE = 100000; class HistoryStore { constructor(storage, maxHistoryLength) { var _this = this; this.storage = storage; this.maxHistoryLength = maxHistoryLength; this.updateHistory = _ref => { let { query, variables, headers, operationName } = _ref; if (!this.shouldSaveQuery(query, variables, headers, this.history.fetchRecent())) { return; } this.history.push({ query, variables, headers, operationName }); const historyQueries = this.history.items; const favoriteQueries = this.favorite.items; this.queries = historyQueries.concat(favoriteQueries); }; this.deleteHistory = function (_ref2) { let { query, variables, headers, operationName, favorite } = _ref2; let clearFavorites = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; function deleteFromStore(store) { const found = store.items.find(x => x.query === query && x.variables === variables && x.headers === headers && x.operationName === operationName); if (found) { store.delete(found); } } if (favorite || clearFavorites) { deleteFromStore(_this.favorite); } if (!favorite || clearFavorites) { deleteFromStore(_this.history); } _this.queries = [..._this.history.items, ..._this.favorite.items]; }; this.history = new _query.QueryStore('queries', this.storage, this.maxHistoryLength); this.favorite = new _query.QueryStore('favorites', this.storage, null); this.queries = [...this.history.fetchAll(), ...this.favorite.fetchAll()]; } shouldSaveQuery(query, variables, headers, lastQuerySaved) { if (!query) { return false; } try { (0, _graphql.parse)(query); } catch (_a) { return false; } if (query.length > MAX_QUERY_SIZE) { return false; } if (!lastQuerySaved) { return true; } if (JSON.stringify(query) === JSON.stringify(lastQuerySaved.query)) { if (JSON.stringify(variables) === JSON.stringify(lastQuerySaved.variables)) { if (JSON.stringify(headers) === JSON.stringify(lastQuerySaved.headers)) { return false; } if (headers && !lastQuerySaved.headers) { return false; } } if (variables && !lastQuerySaved.variables) { return false; } } return true; } toggleFavorite(_ref3) { let { query, variables, headers, operationName, label, favorite } = _ref3; const item = { query, variables, headers, operationName, label }; if (favorite) { item.favorite = false; this.favorite.delete(item); this.history.push(item); } else { item.favorite = true; this.favorite.push(item); this.history.delete(item); } this.queries = [...this.history.items, ...this.favorite.items]; } editLabel(_ref4, index) { let { query, variables, headers, operationName, label, favorite } = _ref4; const item = { query, variables, headers, operationName, label }; if (favorite) { this.favorite.edit(Object.assign(Object.assign({}, item), { favorite }), index); } else { this.history.edit(item, index); } this.queries = [...this.history.items, ...this.favorite.items]; } } exports.HistoryStore = HistoryStore; /***/ }), /***/ "../../graphiql-toolkit/esm/storage/index.js": /*!***************************************************!*\ !*** ../../graphiql-toolkit/esm/storage/index.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var _base = __webpack_require__(/*! ./base */ "../../graphiql-toolkit/esm/storage/base.js"); Object.keys(_base).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _base[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _base[key]; } }); }); var _history = __webpack_require__(/*! ./history */ "../../graphiql-toolkit/esm/storage/history.js"); Object.keys(_history).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _history[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _history[key]; } }); }); var _query = __webpack_require__(/*! ./query */ "../../graphiql-toolkit/esm/storage/query.js"); Object.keys(_query).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _query[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _query[key]; } }); }); var _custom = __webpack_require__(/*! ./custom */ "../../graphiql-toolkit/esm/storage/custom.js"); Object.keys(_custom).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (key in exports && exports[key] === _custom[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _custom[key]; } }); }); /***/ }), /***/ "../../graphiql-toolkit/esm/storage/query.js": /*!***************************************************!*\ !*** ../../graphiql-toolkit/esm/storage/query.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.QueryStore = void 0; class QueryStore { constructor(key, storage) { let maxSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; this.key = key; this.storage = storage; this.maxSize = maxSize; this.items = this.fetchAll(); } get length() { return this.items.length; } contains(item) { return this.items.some(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); } edit(item, index) { if (typeof index === 'number' && this.items[index]) { const found = this.items[index]; if (found.query === item.query && found.variables === item.variables && found.headers === item.headers && found.operationName === item.operationName) { this.items.splice(index, 1, item); this.save(); return; } } const itemIndex = this.items.findIndex(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); if (itemIndex !== -1) { this.items.splice(itemIndex, 1, item); this.save(); } } delete(item) { const itemIndex = this.items.findIndex(x => x.query === item.query && x.variables === item.variables && x.headers === item.headers && x.operationName === item.operationName); if (itemIndex !== -1) { this.items.splice(itemIndex, 1); this.save(); } } fetchRecent() { return this.items.at(-1); } fetchAll() { const raw = this.storage.get(this.key); if (raw) { return JSON.parse(raw)[this.key]; } return []; } push(item) { const items = [...this.items, item]; if (this.maxSize && items.length > this.maxSize) { items.shift(); } for (let attempts = 0; attempts < 5; attempts++) { const response = this.storage.set(this.key, JSON.stringify({ [this.key]: items })); if (!(response === null || response === void 0 ? void 0 : response.error)) { this.items = items; } else if (response.isQuotaError && this.maxSize) { items.shift(); } else { return; } } } save() { this.storage.set(this.key, JSON.stringify({ [this.key]: this.items })); } } exports.QueryStore = QueryStore; /***/ }), /***/ "../node_modules/linkify-it/build/index.cjs.js": /*!*****************************************************!*\ !*** ../node_modules/linkify-it/build/index.cjs.js ***! \*****************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var uc_micro = __webpack_require__(/*! uc.micro */ "../node_modules/uc.micro/build/index.cjs.js"); function reFactory(opts) { const re = {}; opts = opts || {}; re.src_Any = uc_micro.Any.source; re.src_Cc = uc_micro.Cc.source; re.src_Z = uc_micro.Z.source; re.src_P = uc_micro.P.source; // \p{\Z\P\Cc\CF} (white spaces + control + format + punctuation) re.src_ZPCc = [re.src_Z, re.src_P, re.src_Cc].join('|'); // \p{\Z\Cc} (white spaces + control) re.src_ZCc = [re.src_Z, re.src_Cc].join('|'); // Experimental. List of chars, completely prohibited in links // because can separate it from other part of text const text_separators = '[><\uff5c]'; // All possible word characters (everything without punctuation, spaces & controls) // Defined via punctuation & spaces to save space // Should be something like \p{\L\N\S\M} (\w but without `_`) re.src_pseudo_letter = '(?:(?!' + text_separators + '|' + re.src_ZPCc + ')' + re.src_Any + ')'; // The same as abothe but without [0-9] // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')'; re.src_ip4 = '(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; // Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch. re.src_auth = '(?:(?:(?!' + re.src_ZCc + '|[@/\\[\\]()]).)+@)?'; re.src_port = '(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?'; re.src_host_terminator = '(?=$|' + text_separators + '|' + re.src_ZPCc + ')' + '(?!' + (opts['---'] ? '-(?!--)|' : '-|') + '_|:\\d|\\.-|\\.(?!$|' + re.src_ZPCc + '))'; re.src_path = '(?:' + '[/?#]' + '(?:' + '(?!' + re.src_ZCc + '|' + text_separators + '|[()[\\]{}.,"\'?!\\-;]).|' + '\\[(?:(?!' + re.src_ZCc + '|\\]).)*\\]|' + '\\((?:(?!' + re.src_ZCc + '|[)]).)*\\)|' + '\\{(?:(?!' + re.src_ZCc + '|[}]).)*\\}|' + '\\"(?:(?!' + re.src_ZCc + '|["]).)+\\"|' + "\\'(?:(?!" + re.src_ZCc + "|[']).)+\\'|" + // allow `I'm_king` if no pair found "\\'(?=" + re.src_pseudo_letter + '|[-])|' + // google has many dots in "google search" links (#66, #81). // github has ... in commit range links, // Restrict to // - english // - percent-encoded // - parts of file path // - params separator // until more examples found. '\\.{2,}[a-zA-Z0-9%/&]|' + '\\.(?!' + re.src_ZCc + '|[.]|$)|' + (opts['---'] ? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate : '\\-+|') + // allow `,,,` in paths ',(?!' + re.src_ZCc + '|$)|' + // allow `;` if not followed by space-like char ';(?!' + re.src_ZCc + '|$)|' + // allow `!!!` in paths, but not at the end '\\!+(?!' + re.src_ZCc + '|[!]|$)|' + '\\?(?!' + re.src_ZCc + '|[?]|$)' + ')+' + '|\\/' + ')?'; // Allow anything in markdown spec, forbid quote (") at the first position // because emails enclosed in quotes are far more common re.src_email_name = '[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*'; re.src_xn = 'xn--[a-z0-9\\-]{1,59}'; // More to read about domain names // http://serverfault.com/questions/638260/ re.src_domain_root = // Allow letters & digits (http://test1) '(?:' + re.src_xn + '|' + re.src_pseudo_letter + '{1,63}' + ')'; re.src_domain = '(?:' + re.src_xn + '|' + '(?:' + re.src_pseudo_letter + ')' + '|' + '(?:' + re.src_pseudo_letter + '(?:-|' + re.src_pseudo_letter + '){0,61}' + re.src_pseudo_letter + ')' + ')'; re.src_host = '(?:' + // Don't need IP check, because digits are already allowed in normal domain names // src_ip4 + // '|' + '(?:(?:(?:' + re.src_domain + ')\\.)*' + re.src_domain /* _root */ + ')' + ')'; re.tpl_host_fuzzy = '(?:' + re.src_ip4 + '|' + '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))' + ')'; re.tpl_host_no_ip_fuzzy = '(?:(?:(?:' + re.src_domain + ')\\.)+(?:%TLDS%))'; re.src_host_strict = re.src_host + re.src_host_terminator; re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator; re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator; re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator; re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator; // // Main rules // // Rude test fuzzy links by host, for quick deny re.tpl_host_fuzzy_test = 'localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:' + re.src_ZPCc + '|>|$))'; re.tpl_email_fuzzy = '(^|' + text_separators + '|"|\\(|' + re.src_ZCc + ')' + '(' + re.src_email_name + '@' + re.tpl_host_fuzzy_strict + ')'; re.tpl_link_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation. // but can start with > (markdown blockquote) '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_fuzzy_strict + re.src_path + ')'; re.tpl_link_no_ip_fuzzy = // Fuzzy link can't be prepended with .:/\- and non punctuation. // but can start with > (markdown blockquote) '(^|(?![.:/\\-_@])(?:[$+<=>^`|\uff5c]|' + re.src_ZPCc + '))' + '((?![$+<=>^`|\uff5c])' + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + ')'; return re; } // // Helpers // // Merge objects // function assign(obj /* from1, from2, from3, ... */) { const sources = Array.prototype.slice.call(arguments, 1); sources.forEach(function (source) { if (!source) { return; } Object.keys(source).forEach(function (key) { obj[key] = source[key]; }); }); return obj; } function _class(obj) { return Object.prototype.toString.call(obj); } function isString(obj) { return _class(obj) === '[object String]'; } function isObject(obj) { return _class(obj) === '[object Object]'; } function isRegExp(obj) { return _class(obj) === '[object RegExp]'; } function isFunction(obj) { return _class(obj) === '[object Function]'; } function escapeRE(str) { return str.replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&'); } // const defaultOptions = { fuzzyLink: true, fuzzyEmail: true, fuzzyIP: false }; function isOptionsObj(obj) { return Object.keys(obj || {}).reduce(function (acc, k) { /* eslint-disable-next-line no-prototype-builtins */ return acc || defaultOptions.hasOwnProperty(k); }, false); } const defaultSchemas = { 'http:': { validate: function (text, pos, self) { const tail = text.slice(pos); if (!self.re.http) { // compile lazily, because "host"-containing variables can change on tlds update. self.re.http = new RegExp('^\\/\\/' + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, 'i'); } if (self.re.http.test(tail)) { return tail.match(self.re.http)[0].length; } return 0; } }, 'https:': 'http:', 'ftp:': 'http:', '//': { validate: function (text, pos, self) { const tail = text.slice(pos); if (!self.re.no_http) { // compile lazily, because "host"-containing variables can change on tlds update. self.re.no_http = new RegExp('^' + self.re.src_auth + // Don't allow single-level domains, because of false positives like '//test' // with code comments '(?:localhost|(?:(?:' + self.re.src_domain + ')\\.)+' + self.re.src_domain_root + ')' + self.re.src_port + self.re.src_host_terminator + self.re.src_path, 'i'); } if (self.re.no_http.test(tail)) { // should not be `://` & `///`, that protects from errors in protocol name if (pos >= 3 && text[pos - 3] === ':') { return 0; } if (pos >= 3 && text[pos - 3] === '/') { return 0; } return tail.match(self.re.no_http)[0].length; } return 0; } }, 'mailto:': { validate: function (text, pos, self) { const tail = text.slice(pos); if (!self.re.mailto) { self.re.mailto = new RegExp('^' + self.re.src_email_name + '@' + self.re.src_host_strict, 'i'); } if (self.re.mailto.test(tail)) { return tail.match(self.re.mailto)[0].length; } return 0; } } }; // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js) /* eslint-disable-next-line max-len */ const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'; // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead const tlds_default = 'biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф'.split('|'); function resetScanCache(self) { self.__index__ = -1; self.__text_cache__ = ''; } function createValidator(re) { return function (text, pos) { const tail = text.slice(pos); if (re.test(tail)) { return tail.match(re)[0].length; } return 0; }; } function createNormalizer() { return function (match, self) { self.normalize(match); }; } // Schemas compiler. Build regexps. // function compile(self) { // Load & clone RE patterns. const re = self.re = reFactory(self.__opts__); // Define dynamic patterns const tlds = self.__tlds__.slice(); self.onCompile(); if (!self.__tlds_replaced__) { tlds.push(tlds_2ch_src_re); } tlds.push(re.src_xn); re.src_tlds = tlds.join('|'); function untpl(tpl) { return tpl.replace('%TLDS%', re.src_tlds); } re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), 'i'); re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), 'i'); re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), 'i'); re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), 'i'); // // Compile each schema // const aliases = []; self.__compiled__ = {}; // Reset compiled data function schemaError(name, val) { throw new Error('(LinkifyIt) Invalid schema "' + name + '": ' + val); } Object.keys(self.__schemas__).forEach(function (name) { const val = self.__schemas__[name]; // skip disabled methods if (val === null) { return; } const compiled = { validate: null, link: null }; self.__compiled__[name] = compiled; if (isObject(val)) { if (isRegExp(val.validate)) { compiled.validate = createValidator(val.validate); } else if (isFunction(val.validate)) { compiled.validate = val.validate; } else { schemaError(name, val); } if (isFunction(val.normalize)) { compiled.normalize = val.normalize; } else if (!val.normalize) { compiled.normalize = createNormalizer(); } else { schemaError(name, val); } return; } if (isString(val)) { aliases.push(name); return; } schemaError(name, val); }); // // Compile postponed aliases // aliases.forEach(function (alias) { if (!self.__compiled__[self.__schemas__[alias]]) { // Silently fail on missed schemas to avoid errons on disable. // schemaError(alias, self.__schemas__[alias]); return; } self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate; self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize; }); // // Fake record for guessed links // self.__compiled__[''] = { validate: null, normalize: createNormalizer() }; // // Build schema condition // const slist = Object.keys(self.__compiled__).filter(function (name) { // Filter disabled & fake schemas return name.length > 0 && self.__compiled__[name]; }).map(escapeRE).join('|'); // (?!_) cause 1.5x slowdown self.re.schema_test = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'i'); self.re.schema_search = RegExp('(^|(?!_)(?:[><\uff5c]|' + re.src_ZPCc + '))(' + slist + ')', 'ig'); self.re.schema_at_start = RegExp('^' + self.re.schema_search.source, 'i'); self.re.pretest = RegExp('(' + self.re.schema_test.source + ')|(' + self.re.host_fuzzy_test.source + ')|@', 'i'); // // Cleanup // resetScanCache(self); } /** * class Match * * Match result. Single element of array, returned by [[LinkifyIt#match]] **/ function Match(self, shift) { const start = self.__index__; const end = self.__last_index__; const text = self.__text_cache__.slice(start, end); /** * Match#schema -> String * * Prefix (protocol) for matched string. **/ this.schema = self.__schema__.toLowerCase(); /** * Match#index -> Number * * First position of matched string. **/ this.index = start + shift; /** * Match#lastIndex -> Number * * Next position after matched string. **/ this.lastIndex = end + shift; /** * Match#raw -> String * * Matched string. **/ this.raw = text; /** * Match#text -> String * * Notmalized text of matched string. **/ this.text = text; /** * Match#url -> String * * Normalized url of matched string. **/ this.url = text; } function createMatch(self, shift) { const match = new Match(self, shift); self.__compiled__[match.schema].normalize(match, self); return match; } /** * class LinkifyIt **/ /** * new LinkifyIt(schemas, options) * - schemas (Object): Optional. Additional schemas to validate (prefix/validator) * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } * * Creates new linkifier instance with optional additional schemas. * Can be called without `new` keyword for convenience. * * By default understands: * * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links * - "fuzzy" links and emails (example.com, foo@bar.com). * * `schemas` is an object, where each key/value describes protocol/rule: * * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:` * for example). `linkify-it` makes shure that prefix is not preceeded with * alphanumeric char and symbols. Only whitespaces and punctuation allowed. * - __value__ - rule to check tail after link prefix * - _String_ - just alias to existing rule * - _Object_ * - _validate_ - validator function (should return matched length on success), * or `RegExp`. * - _normalize_ - optional function to normalize text & url of matched result * (for example, for @twitter mentions). * * `options`: * * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`. * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts * like version numbers. Default `false`. * - __fuzzyEmail__ - recognize emails without `mailto:` prefix. * **/ function LinkifyIt(schemas, options) { if (!(this instanceof LinkifyIt)) { return new LinkifyIt(schemas, options); } if (!options) { if (isOptionsObj(schemas)) { options = schemas; schemas = {}; } } this.__opts__ = assign({}, defaultOptions, options); // Cache last tested result. Used to skip repeating steps on next `match` call. this.__index__ = -1; this.__last_index__ = -1; // Next scan position this.__schema__ = ''; this.__text_cache__ = ''; this.__schemas__ = assign({}, defaultSchemas, schemas); this.__compiled__ = {}; this.__tlds__ = tlds_default; this.__tlds_replaced__ = false; this.re = {}; compile(this); } /** chainable * LinkifyIt#add(schema, definition) * - schema (String): rule name (fixed pattern prefix) * - definition (String|RegExp|Object): schema definition * * Add new rule definition. See constructor description for details. **/ LinkifyIt.prototype.add = function add(schema, definition) { this.__schemas__[schema] = definition; compile(this); return this; }; /** chainable * LinkifyIt#set(options) * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false } * * Set recognition options for links without schema. **/ LinkifyIt.prototype.set = function set(options) { this.__opts__ = assign(this.__opts__, options); return this; }; /** * LinkifyIt#test(text) -> Boolean * * Searches linkifiable pattern and returns `true` on success or `false` on fail. **/ LinkifyIt.prototype.test = function test(text) { // Reset scan cache this.__text_cache__ = text; this.__index__ = -1; if (!text.length) { return false; } let m, ml, me, len, shift, next, re, tld_pos, at_pos; // try to scan for link with schema - that's the most simple rule if (this.re.schema_test.test(text)) { re = this.re.schema_search; re.lastIndex = 0; while ((m = re.exec(text)) !== null) { len = this.testSchemaAt(text, m[2], re.lastIndex); if (len) { this.__schema__ = m[2]; this.__index__ = m.index + m[1].length; this.__last_index__ = m.index + m[0].length + len; break; } } } if (this.__opts__.fuzzyLink && this.__compiled__['http:']) { // guess schemaless links tld_pos = text.search(this.re.host_fuzzy_test); if (tld_pos >= 0) { // if tld is located after found link - no need to check fuzzy pattern if (this.__index__ < 0 || tld_pos < this.__index__) { if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) { shift = ml.index + ml[1].length; if (this.__index__ < 0 || shift < this.__index__) { this.__schema__ = ''; this.__index__ = shift; this.__last_index__ = ml.index + ml[0].length; } } } } } if (this.__opts__.fuzzyEmail && this.__compiled__['mailto:']) { // guess schemaless emails at_pos = text.indexOf('@'); if (at_pos >= 0) { // We can't skip this check, because this cases are possible: // 192.168.1.1@gmail.com, my.in@example.com if ((me = text.match(this.re.email_fuzzy)) !== null) { shift = me.index + me[1].length; next = me.index + me[0].length; if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) { this.__schema__ = 'mailto:'; this.__index__ = shift; this.__last_index__ = next; } } } } return this.__index__ >= 0; }; /** * LinkifyIt#pretest(text) -> Boolean * * Very quick check, that can give false positives. Returns true if link MAY BE * can exists. Can be used for speed optimization, when you need to check that * link NOT exists. **/ LinkifyIt.prototype.pretest = function pretest(text) { return this.re.pretest.test(text); }; /** * LinkifyIt#testSchemaAt(text, name, position) -> Number * - text (String): text to scan * - name (String): rule (schema) name * - position (Number): text offset to check from * * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly * at given position. Returns length of found pattern (0 on fail). **/ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) { // If not supported schema check requested - terminate if (!this.__compiled__[schema.toLowerCase()]) { return 0; } return this.__compiled__[schema.toLowerCase()].validate(text, pos, this); }; /** * LinkifyIt#match(text) -> Array|null * * Returns array of found link descriptions or `null` on fail. We strongly * recommend to use [[LinkifyIt#test]] first, for best speed. * * ##### Result match description * * - __schema__ - link schema, can be empty for fuzzy links, or `//` for * protocol-neutral links. * - __index__ - offset of matched text * - __lastIndex__ - index of next char after mathch end * - __raw__ - matched text * - __text__ - normalized text * - __url__ - link, generated from matched text **/ LinkifyIt.prototype.match = function match(text) { const result = []; let shift = 0; // Try to take previous element from cache, if .test() called before if (this.__index__ >= 0 && this.__text_cache__ === text) { result.push(createMatch(this, shift)); shift = this.__last_index__; } // Cut head if cache was used let tail = shift ? text.slice(shift) : text; // Scan string until end reached while (this.test(tail)) { result.push(createMatch(this, shift)); tail = tail.slice(this.__last_index__); shift += this.__last_index__; } if (result.length) { return result; } return null; }; /** * LinkifyIt#matchAtStart(text) -> Match|null * * Returns fully-formed (not fuzzy) link if it starts at the beginning * of the string, and null otherwise. **/ LinkifyIt.prototype.matchAtStart = function matchAtStart(text) { // Reset scan cache this.__text_cache__ = text; this.__index__ = -1; if (!text.length) return null; const m = this.re.schema_at_start.exec(text); if (!m) return null; const len = this.testSchemaAt(text, m[2], m[0].length); if (!len) return null; this.__schema__ = m[2]; this.__index__ = m.index + m[1].length; this.__last_index__ = m.index + m[0].length + len; return createMatch(this, 0); }; /** chainable * LinkifyIt#tlds(list [, keepOld]) -> this * - list (Array): list of tlds * - keepOld (Boolean): merge with current list if `true` (`false` by default) * * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix) * to avoid false positives. By default this algorythm used: * * - hostname with any 2-letter root zones are ok. * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф * are ok. * - encoded (`xn--...`) root zones are ok. * * If list is replaced, then exact match for 2-chars root zones will be checked. **/ LinkifyIt.prototype.tlds = function tlds(list, keepOld) { list = Array.isArray(list) ? list : [list]; if (!keepOld) { this.__tlds__ = list.slice(); this.__tlds_replaced__ = true; compile(this); return this; } this.__tlds__ = this.__tlds__.concat(list).sort().filter(function (el, idx, arr) { return el !== arr[idx - 1]; }).reverse(); compile(this); return this; }; /** * LinkifyIt#normalize(match) * * Default normalizer (if schema does not define it's own). **/ LinkifyIt.prototype.normalize = function normalize(match) { // Do minimal possible changes by default. Need to collect feedback prior // to move forward https://github.com/markdown-it/linkify-it/issues/1 if (!match.schema) { match.url = 'http://' + match.url; } if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) { match.url = 'mailto:' + match.url; } }; /** * LinkifyIt#onCompile() * * Override to modify basic RegExp-s. **/ LinkifyIt.prototype.onCompile = function onCompile() {}; module.exports = LinkifyIt; /***/ }), /***/ "../node_modules/markdown-it/dist/index.cjs.js": /*!*****************************************************!*\ !*** ../node_modules/markdown-it/dist/index.cjs.js ***! \*****************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var mdurl = __webpack_require__(/*! mdurl */ "../node_modules/mdurl/build/index.cjs.js"); var ucmicro = __webpack_require__(/*! uc.micro */ "../node_modules/uc.micro/build/index.cjs.js"); var entities = __webpack_require__(/*! entities */ "../../../node_modules/entities/lib/index.js"); var LinkifyIt = __webpack_require__(/*! linkify-it */ "../node_modules/linkify-it/build/index.cjs.js"); var punycode = __webpack_require__(/*! punycode.js */ "../../../node_modules/punycode.js/punycode.es6.js"); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } var mdurl__namespace = /*#__PURE__*/_interopNamespaceDefault(mdurl); var ucmicro__namespace = /*#__PURE__*/_interopNamespaceDefault(ucmicro); // Utilities // function _class(obj) { return Object.prototype.toString.call(obj); } function isString(obj) { return _class(obj) === '[object String]'; } const _hasOwnProperty = Object.prototype.hasOwnProperty; function has(object, key) { return _hasOwnProperty.call(object, key); } // Merge objects // function assign(obj /* from1, from2, from3, ... */) { const sources = Array.prototype.slice.call(arguments, 1); sources.forEach(function (source) { if (!source) { return; } if (typeof source !== 'object') { throw new TypeError(source + 'must be object'); } Object.keys(source).forEach(function (key) { obj[key] = source[key]; }); }); return obj; } // Remove element from array and put another array at those position. // Useful for some operations with tokens function arrayReplaceAt(src, pos, newElements) { return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)); } function isValidEntityCode(c) { /* eslint no-bitwise:0 */ // broken sequence if (c >= 0xD800 && c <= 0xDFFF) { return false; } // never used if (c >= 0xFDD0 && c <= 0xFDEF) { return false; } if ((c & 0xFFFF) === 0xFFFF || (c & 0xFFFF) === 0xFFFE) { return false; } // control codes if (c >= 0x00 && c <= 0x08) { return false; } if (c === 0x0B) { return false; } if (c >= 0x0E && c <= 0x1F) { return false; } if (c >= 0x7F && c <= 0x9F) { return false; } // out of range if (c > 0x10FFFF) { return false; } return true; } function fromCodePoint(c) { /* eslint no-bitwise:0 */ if (c > 0xffff) { c -= 0x10000; const surrogate1 = 0xd800 + (c >> 10); const surrogate2 = 0xdc00 + (c & 0x3ff); return String.fromCharCode(surrogate1, surrogate2); } return String.fromCharCode(c); } const UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g; const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi; const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + '|' + ENTITY_RE.source, 'gi'); const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i; function replaceEntityPattern(match, name) { if (name.charCodeAt(0) === 0x23 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) { const code = name[1].toLowerCase() === 'x' ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10); if (isValidEntityCode(code)) { return fromCodePoint(code); } return match; } const decoded = entities.decodeHTML(match); if (decoded !== match) { return decoded; } return match; } /* function replaceEntities(str) { if (str.indexOf('&') < 0) { return str; } return str.replace(ENTITY_RE, replaceEntityPattern); } */ function unescapeMd(str) { if (str.indexOf('\\') < 0) { return str; } return str.replace(UNESCAPE_MD_RE, '$1'); } function unescapeAll(str) { if (str.indexOf('\\') < 0 && str.indexOf('&') < 0) { return str; } return str.replace(UNESCAPE_ALL_RE, function (match, escaped, entity) { if (escaped) { return escaped; } return replaceEntityPattern(match, entity); }); } const HTML_ESCAPE_TEST_RE = /[&<>"]/; const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g; const HTML_REPLACEMENTS = { '&': '&', '<': '<', '>': '>', '"': '"' }; function replaceUnsafeChar(ch) { return HTML_REPLACEMENTS[ch]; } function escapeHtml(str) { if (HTML_ESCAPE_TEST_RE.test(str)) { return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar); } return str; } const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g; function escapeRE(str) { return str.replace(REGEXP_ESCAPE_RE, '\\$&'); } function isSpace(code) { switch (code) { case 0x09: case 0x20: return true; } return false; } // Zs (unicode class) || [\t\f\v\r\n] function isWhiteSpace(code) { if (code >= 0x2000 && code <= 0x200A) { return true; } switch (code) { case 0x09: // \t case 0x0A: // \n case 0x0B: // \v case 0x0C: // \f case 0x0D: // \r case 0x20: case 0xA0: case 0x1680: case 0x202F: case 0x205F: case 0x3000: return true; } return false; } /* eslint-disable max-len */ // Currently without astral characters support. function isPunctChar(ch) { return ucmicro__namespace.P.test(ch) || ucmicro__namespace.S.test(ch); } // Markdown ASCII punctuation characters. // // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ // http://spec.commonmark.org/0.15/#ascii-punctuation-character // // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range. // function isMdAsciiPunct(ch) { switch (ch) { case 0x21 /* ! */: case 0x22 /* " */: case 0x23 /* # */: case 0x24 /* $ */: case 0x25 /* % */: case 0x26 /* & */: case 0x27 /* ' */: case 0x28 /* ( */: case 0x29 /* ) */: case 0x2A /* * */: case 0x2B /* + */: case 0x2C /* , */: case 0x2D /* - */: case 0x2E /* . */: case 0x2F /* / */: case 0x3A /* : */: case 0x3B /* ; */: case 0x3C /* < */: case 0x3D /* = */: case 0x3E /* > */: case 0x3F /* ? */: case 0x40 /* @ */: case 0x5B /* [ */: case 0x5C /* \ */: case 0x5D /* ] */: case 0x5E /* ^ */: case 0x5F /* _ */: case 0x60 /* ` */: case 0x7B /* { */: case 0x7C /* | */: case 0x7D /* } */: case 0x7E /* ~ */: return true; default: return false; } } // Hepler to unify [reference labels]. // function normalizeReference(str) { // Trim and collapse whitespace // str = str.trim().replace(/\s+/g, ' '); // In node v10 'ẞ'.toLowerCase() === 'Ṿ', which is presumed to be a bug // fixed in v12 (couldn't find any details). // // So treat this one as a special case // (remove this when node v10 is no longer supported). // if ('ẞ'.toLowerCase() === 'Ṿ') { str = str.replace(/ẞ/g, 'ß'); } // .toLowerCase().toUpperCase() should get rid of all differences // between letter variants. // // Simple .toLowerCase() doesn't normalize 125 code points correctly, // and .toUpperCase doesn't normalize 6 of them (list of exceptions: // İ, ϴ, ẞ, Ω, K, Å - those are already uppercased, but have differently // uppercased versions). // // Here's an example showing how it happens. Lets take greek letter omega: // uppercase U+0398 (Θ), U+03f4 (ϴ) and lowercase U+03b8 (θ), U+03d1 (ϑ) // // Unicode entries: // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8; // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398 // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398 // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8; // // Case-insensitive comparison should treat all of them as equivalent. // // But .toLowerCase() doesn't change ϑ (it's already lowercase), // and .toUpperCase() doesn't change ϴ (already uppercase). // // Applying first lower then upper case normalizes any character: // '\u0398\u03f4\u03b8\u03d1'.toLowerCase().toUpperCase() === '\u0398\u0398\u0398\u0398' // // Note: this is equivalent to unicode case folding; unicode normalization // is a different step that is not required here. // // Final result should be uppercased, because it's later stored in an object // (this avoid a conflict with Object.prototype members, // most notably, `__proto__`) // return str.toLowerCase().toUpperCase(); } // Re-export libraries commonly used in both markdown-it and its plugins, // so plugins won't have to depend on them explicitly, which reduces their // bundled size (e.g. a browser build). // const lib = { mdurl: mdurl__namespace, ucmicro: ucmicro__namespace }; var utils = /*#__PURE__*/Object.freeze({ __proto__: null, arrayReplaceAt: arrayReplaceAt, assign: assign, escapeHtml: escapeHtml, escapeRE: escapeRE, fromCodePoint: fromCodePoint, has: has, isMdAsciiPunct: isMdAsciiPunct, isPunctChar: isPunctChar, isSpace: isSpace, isString: isString, isValidEntityCode: isValidEntityCode, isWhiteSpace: isWhiteSpace, lib: lib, normalizeReference: normalizeReference, unescapeAll: unescapeAll, unescapeMd: unescapeMd }); // Parse link label // // this function assumes that first character ("[") already matches; // returns the end of the label // function parseLinkLabel(state, start, disableNested) { let level, found, marker, prevPos; const max = state.posMax; const oldPos = state.pos; state.pos = start + 1; level = 1; while (state.pos < max) { marker = state.src.charCodeAt(state.pos); if (marker === 0x5D /* ] */) { level--; if (level === 0) { found = true; break; } } prevPos = state.pos; state.md.inline.skipToken(state); if (marker === 0x5B /* [ */) { if (prevPos === state.pos - 1) { // increase level if we find text `[`, which is not a part of any token level++; } else if (disableNested) { state.pos = oldPos; return -1; } } } let labelEnd = -1; if (found) { labelEnd = state.pos; } // restore old state state.pos = oldPos; return labelEnd; } // Parse link destination // function parseLinkDestination(str, start, max) { let code; let pos = start; const result = { ok: false, pos: 0, str: '' }; if (str.charCodeAt(pos) === 0x3C /* < */) { pos++; while (pos < max) { code = str.charCodeAt(pos); if (code === 0x0A /* \n */) { return result; } if (code === 0x3C /* < */) { return result; } if (code === 0x3E /* > */) { result.pos = pos + 1; result.str = unescapeAll(str.slice(start + 1, pos)); result.ok = true; return result; } if (code === 0x5C /* \ */ && pos + 1 < max) { pos += 2; continue; } pos++; } // no closing '>' return result; } // this should be ... } else { ... branch let level = 0; while (pos < max) { code = str.charCodeAt(pos); if (code === 0x20) { break; } // ascii control characters if (code < 0x20 || code === 0x7F) { break; } if (code === 0x5C /* \ */ && pos + 1 < max) { if (str.charCodeAt(pos + 1) === 0x20) { break; } pos += 2; continue; } if (code === 0x28 /* ( */) { level++; if (level > 32) { return result; } } if (code === 0x29 /* ) */) { if (level === 0) { break; } level--; } pos++; } if (start === pos) { return result; } if (level !== 0) { return result; } result.str = unescapeAll(str.slice(start, pos)); result.pos = pos; result.ok = true; return result; } // Parse link title // // Parse link title within `str` in [start, max] range, // or continue previous parsing if `prev_state` is defined (equal to result of last execution). // function parseLinkTitle(str, start, max, prev_state) { let code; let pos = start; const state = { // if `true`, this is a valid link title ok: false, // if `true`, this link can be continued on the next line can_continue: false, // if `ok`, it's the position of the first character after the closing marker pos: 0, // if `ok`, it's the unescaped title str: '', // expected closing marker character code marker: 0 }; if (prev_state) { // this is a continuation of a previous parseLinkTitle call on the next line, // used in reference links only state.str = prev_state.str; state.marker = prev_state.marker; } else { if (pos >= max) { return state; } let marker = str.charCodeAt(pos); if (marker !== 0x22 /* " */ && marker !== 0x27 /* ' */ && marker !== 0x28 /* ( */) { return state; } start++; pos++; // if opening marker is "(", switch it to closing marker ")" if (marker === 0x28) { marker = 0x29; } state.marker = marker; } while (pos < max) { code = str.charCodeAt(pos); if (code === state.marker) { state.pos = pos + 1; state.str += unescapeAll(str.slice(start, pos)); state.ok = true; return state; } else if (code === 0x28 /* ( */ && state.marker === 0x29 /* ) */) { return state; } else if (code === 0x5C /* \ */ && pos + 1 < max) { pos++; } pos++; } // no closing marker found, but this link title may continue on the next line (for references) state.can_continue = true; state.str += unescapeAll(str.slice(start, pos)); return state; } // Just a shortcut for bulk export var helpers = /*#__PURE__*/Object.freeze({ __proto__: null, parseLinkDestination: parseLinkDestination, parseLinkLabel: parseLinkLabel, parseLinkTitle: parseLinkTitle }); /** * class Renderer * * Generates HTML from parsed token stream. Each instance has independent * copy of rules. Those can be rewritten with ease. Also, you can add new * rules if you create plugin and adds new token types. **/ const default_rules = {}; default_rules.code_inline = function (tokens, idx, options, env, slf) { const token = tokens[idx]; return '' + escapeHtml(token.content) + ''; }; default_rules.code_block = function (tokens, idx, options, env, slf) { const token = tokens[idx]; return '' + escapeHtml(tokens[idx].content) + '\n'; }; default_rules.fence = function (tokens, idx, options, env, slf) { const token = tokens[idx]; const info = token.info ? unescapeAll(token.info).trim() : ''; let langName = ''; let langAttrs = ''; if (info) { const arr = info.split(/(\s+)/g); langName = arr[0]; langAttrs = arr.slice(2).join(''); } let highlighted; if (options.highlight) { highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content); } else { highlighted = escapeHtml(token.content); } if (highlighted.indexOf('${highlighted}\n`; } return `
${highlighted}
\n`; }; default_rules.image = function (tokens, idx, options, env, slf) { const token = tokens[idx]; // "alt" attr MUST be set, even if empty. Because it's mandatory and // should be placed on proper position for tests. // // Replace content with actual value token.attrs[token.attrIndex('alt')][1] = slf.renderInlineAsText(token.children, options, env); return slf.renderToken(tokens, idx, options); }; default_rules.hardbreak = function (tokens, idx, options /*, env */) { return options.xhtmlOut ? '
\n' : '
\n'; }; default_rules.softbreak = function (tokens, idx, options /*, env */) { return options.breaks ? options.xhtmlOut ? '
\n' : '
\n' : '\n'; }; default_rules.text = function (tokens, idx /*, options, env */) { return escapeHtml(tokens[idx].content); }; default_rules.html_block = function (tokens, idx /*, options, env */) { return tokens[idx].content; }; default_rules.html_inline = function (tokens, idx /*, options, env */) { return tokens[idx].content; }; /** * new Renderer() * * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults. **/ function Renderer() { /** * Renderer#rules -> Object * * Contains render rules for tokens. Can be updated and extended. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * md.renderer.rules.strong_open = function () { return ''; }; * md.renderer.rules.strong_close = function () { return ''; }; * * var result = md.renderInline(...); * ``` * * Each rule is called as independent static function with fixed signature: * * ```javascript * function my_token_render(tokens, idx, options, env, renderer) { * // ... * return renderedHTML; * } * ``` * * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs) * for more details and examples. **/ this.rules = assign({}, default_rules); } /** * Renderer.renderAttrs(token) -> String * * Render token attributes to string. **/ Renderer.prototype.renderAttrs = function renderAttrs(token) { let i, l, result; if (!token.attrs) { return ''; } result = ''; for (i = 0, l = token.attrs.length; i < l; i++) { result += ' ' + escapeHtml(token.attrs[i][0]) + '="' + escapeHtml(token.attrs[i][1]) + '"'; } return result; }; /** * Renderer.renderToken(tokens, idx, options) -> String * - tokens (Array): list of tokens * - idx (Numbed): token index to render * - options (Object): params of parser instance * * Default token renderer. Can be overriden by custom function * in [[Renderer#rules]]. **/ Renderer.prototype.renderToken = function renderToken(tokens, idx, options) { const token = tokens[idx]; let result = ''; // Tight list paragraphs if (token.hidden) { return ''; } // Insert a newline between hidden paragraph and subsequent opening // block-level tag. // // For example, here we should insert a newline before blockquote: // - a // > // if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) { result += '\n'; } // Add token name, e.g. ``. // needLf = false; } } } } result += needLf ? '>\n' : '>'; return result; }; /** * Renderer.renderInline(tokens, options, env) -> String * - tokens (Array): list on block tokens to render * - options (Object): params of parser instance * - env (Object): additional data from parsed input (references, for example) * * The same as [[Renderer.render]], but for single token of `inline` type. **/ Renderer.prototype.renderInline = function (tokens, options, env) { let result = ''; const rules = this.rules; for (let i = 0, len = tokens.length; i < len; i++) { const type = tokens[i].type; if (typeof rules[type] !== 'undefined') { result += rules[type](tokens, i, options, env, this); } else { result += this.renderToken(tokens, i, options); } } return result; }; /** internal * Renderer.renderInlineAsText(tokens, options, env) -> String * - tokens (Array): list on block tokens to render * - options (Object): params of parser instance * - env (Object): additional data from parsed input (references, for example) * * Special kludge for image `alt` attributes to conform CommonMark spec. * Don't try to use it! Spec requires to show `alt` content with stripped markup, * instead of simple escaping. **/ Renderer.prototype.renderInlineAsText = function (tokens, options, env) { let result = ''; for (let i = 0, len = tokens.length; i < len; i++) { switch (tokens[i].type) { case 'text': result += tokens[i].content; break; case 'image': result += this.renderInlineAsText(tokens[i].children, options, env); break; case 'html_inline': case 'html_block': result += tokens[i].content; break; case 'softbreak': case 'hardbreak': result += '\n'; break; // all other tokens are skipped } } return result; }; /** * Renderer.render(tokens, options, env) -> String * - tokens (Array): list on block tokens to render * - options (Object): params of parser instance * - env (Object): additional data from parsed input (references, for example) * * Takes token stream and generates HTML. Probably, you will never need to call * this method directly. **/ Renderer.prototype.render = function (tokens, options, env) { let result = ''; const rules = this.rules; for (let i = 0, len = tokens.length; i < len; i++) { const type = tokens[i].type; if (type === 'inline') { result += this.renderInline(tokens[i].children, options, env); } else if (typeof rules[type] !== 'undefined') { result += rules[type](tokens, i, options, env, this); } else { result += this.renderToken(tokens, i, options, env); } } return result; }; /** * class Ruler * * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and * [[MarkdownIt#inline]] to manage sequences of functions (rules): * * - keep rules in defined order * - assign the name to each rule * - enable/disable rules * - add/replace rules * - allow assign rules to additional named chains (in the same) * - cacheing lists of active rules * * You will not need use this class directly until write plugins. For simple * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and * [[MarkdownIt.use]]. **/ /** * new Ruler() **/ function Ruler() { // List of added rules. Each element is: // // { // name: XXX, // enabled: Boolean, // fn: Function(), // alt: [ name2, name3 ] // } // this.__rules__ = []; // Cached rule chains. // // First level - chain name, '' for default. // Second level - diginal anchor for fast filtering by charcodes. // this.__cache__ = null; } // Helper methods, should not be used directly // Find rule index by name // Ruler.prototype.__find__ = function (name) { for (let i = 0; i < this.__rules__.length; i++) { if (this.__rules__[i].name === name) { return i; } } return -1; }; // Build rules lookup cache // Ruler.prototype.__compile__ = function () { const self = this; const chains = ['']; // collect unique names self.__rules__.forEach(function (rule) { if (!rule.enabled) { return; } rule.alt.forEach(function (altName) { if (chains.indexOf(altName) < 0) { chains.push(altName); } }); }); self.__cache__ = {}; chains.forEach(function (chain) { self.__cache__[chain] = []; self.__rules__.forEach(function (rule) { if (!rule.enabled) { return; } if (chain && rule.alt.indexOf(chain) < 0) { return; } self.__cache__[chain].push(rule.fn); }); }); }; /** * Ruler.at(name, fn [, options]) * - name (String): rule name to replace. * - fn (Function): new rule function. * - options (Object): new rule options (not mandatory). * * Replace rule by name with new function & options. Throws error if name not * found. * * ##### Options: * * - __alt__ - array with names of "alternate" chains. * * ##### Example * * Replace existing typographer replacement rule with new one: * * ```javascript * var md = require('markdown-it')(); * * md.core.ruler.at('replacements', function replace(state) { * //... * }); * ``` **/ Ruler.prototype.at = function (name, fn, options) { const index = this.__find__(name); const opt = options || {}; if (index === -1) { throw new Error('Parser rule not found: ' + name); } this.__rules__[index].fn = fn; this.__rules__[index].alt = opt.alt || []; this.__cache__ = null; }; /** * Ruler.before(beforeName, ruleName, fn [, options]) * - beforeName (String): new rule will be added before this one. * - ruleName (String): name of added rule. * - fn (Function): rule function. * - options (Object): rule options (not mandatory). * * Add new rule to chain before one with given name. See also * [[Ruler.after]], [[Ruler.push]]. * * ##### Options: * * - __alt__ - array with names of "alternate" chains. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * md.block.ruler.before('paragraph', 'my_rule', function replace(state) { * //... * }); * ``` **/ Ruler.prototype.before = function (beforeName, ruleName, fn, options) { const index = this.__find__(beforeName); const opt = options || {}; if (index === -1) { throw new Error('Parser rule not found: ' + beforeName); } this.__rules__.splice(index, 0, { name: ruleName, enabled: true, fn, alt: opt.alt || [] }); this.__cache__ = null; }; /** * Ruler.after(afterName, ruleName, fn [, options]) * - afterName (String): new rule will be added after this one. * - ruleName (String): name of added rule. * - fn (Function): rule function. * - options (Object): rule options (not mandatory). * * Add new rule to chain after one with given name. See also * [[Ruler.before]], [[Ruler.push]]. * * ##### Options: * * - __alt__ - array with names of "alternate" chains. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * md.inline.ruler.after('text', 'my_rule', function replace(state) { * //... * }); * ``` **/ Ruler.prototype.after = function (afterName, ruleName, fn, options) { const index = this.__find__(afterName); const opt = options || {}; if (index === -1) { throw new Error('Parser rule not found: ' + afterName); } this.__rules__.splice(index + 1, 0, { name: ruleName, enabled: true, fn, alt: opt.alt || [] }); this.__cache__ = null; }; /** * Ruler.push(ruleName, fn [, options]) * - ruleName (String): name of added rule. * - fn (Function): rule function. * - options (Object): rule options (not mandatory). * * Push new rule to the end of chain. See also * [[Ruler.before]], [[Ruler.after]]. * * ##### Options: * * - __alt__ - array with names of "alternate" chains. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * md.core.ruler.push('my_rule', function replace(state) { * //... * }); * ``` **/ Ruler.prototype.push = function (ruleName, fn, options) { const opt = options || {}; this.__rules__.push({ name: ruleName, enabled: true, fn, alt: opt.alt || [] }); this.__cache__ = null; }; /** * Ruler.enable(list [, ignoreInvalid]) -> Array * - list (String|Array): list of rule names to enable. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. * * Enable rules with given names. If any rule name not found - throw Error. * Errors can be disabled by second param. * * Returns list of found rule names (if no exception happened). * * See also [[Ruler.disable]], [[Ruler.enableOnly]]. **/ Ruler.prototype.enable = function (list, ignoreInvalid) { if (!Array.isArray(list)) { list = [list]; } const result = []; // Search by name and enable list.forEach(function (name) { const idx = this.__find__(name); if (idx < 0) { if (ignoreInvalid) { return; } throw new Error('Rules manager: invalid rule name ' + name); } this.__rules__[idx].enabled = true; result.push(name); }, this); this.__cache__ = null; return result; }; /** * Ruler.enableOnly(list [, ignoreInvalid]) * - list (String|Array): list of rule names to enable (whitelist). * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. * * Enable rules with given names, and disable everything else. If any rule name * not found - throw Error. Errors can be disabled by second param. * * See also [[Ruler.disable]], [[Ruler.enable]]. **/ Ruler.prototype.enableOnly = function (list, ignoreInvalid) { if (!Array.isArray(list)) { list = [list]; } this.__rules__.forEach(function (rule) { rule.enabled = false; }); this.enable(list, ignoreInvalid); }; /** * Ruler.disable(list [, ignoreInvalid]) -> Array * - list (String|Array): list of rule names to disable. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. * * Disable rules with given names. If any rule name not found - throw Error. * Errors can be disabled by second param. * * Returns list of found rule names (if no exception happened). * * See also [[Ruler.enable]], [[Ruler.enableOnly]]. **/ Ruler.prototype.disable = function (list, ignoreInvalid) { if (!Array.isArray(list)) { list = [list]; } const result = []; // Search by name and disable list.forEach(function (name) { const idx = this.__find__(name); if (idx < 0) { if (ignoreInvalid) { return; } throw new Error('Rules manager: invalid rule name ' + name); } this.__rules__[idx].enabled = false; result.push(name); }, this); this.__cache__ = null; return result; }; /** * Ruler.getRules(chainName) -> Array * * Return array of active functions (rules) for given chain name. It analyzes * rules configuration, compiles caches if not exists and returns result. * * Default chain name is `''` (empty string). It can't be skipped. That's * done intentionally, to keep signature monomorphic for high speed. **/ Ruler.prototype.getRules = function (chainName) { if (this.__cache__ === null) { this.__compile__(); } // Chain can be empty, if rules disabled. But we still have to return Array. return this.__cache__[chainName] || []; }; // Token class /** * class Token **/ /** * new Token(type, tag, nesting) * * Create new token and fill passed properties. **/ function Token(type, tag, nesting) { /** * Token#type -> String * * Type of the token (string, e.g. "paragraph_open") **/ this.type = type; /** * Token#tag -> String * * html tag name, e.g. "p" **/ this.tag = tag; /** * Token#attrs -> Array * * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]` **/ this.attrs = null; /** * Token#map -> Array * * Source map info. Format: `[ line_begin, line_end ]` **/ this.map = null; /** * Token#nesting -> Number * * Level change (number in {-1, 0, 1} set), where: * * - `1` means the tag is opening * - `0` means the tag is self-closing * - `-1` means the tag is closing **/ this.nesting = nesting; /** * Token#level -> Number * * nesting level, the same as `state.level` **/ this.level = 0; /** * Token#children -> Array * * An array of child nodes (inline and img tokens) **/ this.children = null; /** * Token#content -> String * * In a case of self-closing tag (code, html, fence, etc.), * it has contents of this tag. **/ this.content = ''; /** * Token#markup -> String * * '*' or '_' for emphasis, fence string for fence, etc. **/ this.markup = ''; /** * Token#info -> String * * Additional information: * * - Info string for "fence" tokens * - The value "auto" for autolink "link_open" and "link_close" tokens * - The string value of the item marker for ordered-list "list_item_open" tokens **/ this.info = ''; /** * Token#meta -> Object * * A place for plugins to store an arbitrary data **/ this.meta = null; /** * Token#block -> Boolean * * True for block-level tokens, false for inline tokens. * Used in renderer to calculate line breaks **/ this.block = false; /** * Token#hidden -> Boolean * * If it's true, ignore this element when rendering. Used for tight lists * to hide paragraphs. **/ this.hidden = false; } /** * Token.attrIndex(name) -> Number * * Search attribute index by name. **/ Token.prototype.attrIndex = function attrIndex(name) { if (!this.attrs) { return -1; } const attrs = this.attrs; for (let i = 0, len = attrs.length; i < len; i++) { if (attrs[i][0] === name) { return i; } } return -1; }; /** * Token.attrPush(attrData) * * Add `[ name, value ]` attribute to list. Init attrs if necessary **/ Token.prototype.attrPush = function attrPush(attrData) { if (this.attrs) { this.attrs.push(attrData); } else { this.attrs = [attrData]; } }; /** * Token.attrSet(name, value) * * Set `name` attribute to `value`. Override old value if exists. **/ Token.prototype.attrSet = function attrSet(name, value) { const idx = this.attrIndex(name); const attrData = [name, value]; if (idx < 0) { this.attrPush(attrData); } else { this.attrs[idx] = attrData; } }; /** * Token.attrGet(name) * * Get the value of attribute `name`, or null if it does not exist. **/ Token.prototype.attrGet = function attrGet(name) { const idx = this.attrIndex(name); let value = null; if (idx >= 0) { value = this.attrs[idx][1]; } return value; }; /** * Token.attrJoin(name, value) * * Join value to existing attribute via space. Or create new attribute if not * exists. Useful to operate with token classes. **/ Token.prototype.attrJoin = function attrJoin(name, value) { const idx = this.attrIndex(name); if (idx < 0) { this.attrPush([name, value]); } else { this.attrs[idx][1] = this.attrs[idx][1] + ' ' + value; } }; // Core state object // function StateCore(src, md, env) { this.src = src; this.env = env; this.tokens = []; this.inlineMode = false; this.md = md; // link to parser instance } // re-export Token class to use in core rules StateCore.prototype.Token = Token; // Normalize input string // https://spec.commonmark.org/0.29/#line-ending const NEWLINES_RE = /\r\n?|\n/g; const NULL_RE = /\0/g; function normalize(state) { let str; // Normalize newlines str = state.src.replace(NEWLINES_RE, '\n'); // Replace NULL characters str = str.replace(NULL_RE, '\uFFFD'); state.src = str; } function block(state) { let token; if (state.inlineMode) { token = new state.Token('inline', '', 0); token.content = state.src; token.map = [0, 1]; token.children = []; state.tokens.push(token); } else { state.md.block.parse(state.src, state.md, state.env, state.tokens); } } function inline(state) { const tokens = state.tokens; // Parse inlines for (let i = 0, l = tokens.length; i < l; i++) { const tok = tokens[i]; if (tok.type === 'inline') { state.md.inline.parse(tok.content, state.md, state.env, tok.children); } } } // Replace link-like texts with link nodes. // // Currently restricted by `md.validateLink()` to http/https/ftp // function isLinkOpen$1(str) { return /^\s]/i.test(str); } function isLinkClose$1(str) { return /^<\/a\s*>/i.test(str); } function linkify$1(state) { const blockTokens = state.tokens; if (!state.md.options.linkify) { return; } for (let j = 0, l = blockTokens.length; j < l; j++) { if (blockTokens[j].type !== 'inline' || !state.md.linkify.pretest(blockTokens[j].content)) { continue; } let tokens = blockTokens[j].children; let htmlLinkLevel = 0; // We scan from the end, to keep position when new tags added. // Use reversed logic in links start/end match for (let i = tokens.length - 1; i >= 0; i--) { const currentToken = tokens[i]; // Skip content of markdown links if (currentToken.type === 'link_close') { i--; while (tokens[i].level !== currentToken.level && tokens[i].type !== 'link_open') { i--; } continue; } // Skip content of html tag links if (currentToken.type === 'html_inline') { if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) { htmlLinkLevel--; } if (isLinkClose$1(currentToken.content)) { htmlLinkLevel++; } } if (htmlLinkLevel > 0) { continue; } if (currentToken.type === 'text' && state.md.linkify.test(currentToken.content)) { const text = currentToken.content; let links = state.md.linkify.match(text); // Now split string to nodes const nodes = []; let level = currentToken.level; let lastPos = 0; // forbid escape sequence at the start of the string, // this avoids http\://example.com/ from being linkified as // http://example.com/ if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === 'text_special') { links = links.slice(1); } for (let ln = 0; ln < links.length; ln++) { const url = links[ln].url; const fullUrl = state.md.normalizeLink(url); if (!state.md.validateLink(fullUrl)) { continue; } let urlText = links[ln].text; // Linkifier might send raw hostnames like "example.com", where url // starts with domain name. So we prepend http:// in those cases, // and remove it afterwards. // if (!links[ln].schema) { urlText = state.md.normalizeLinkText('http://' + urlText).replace(/^http:\/\//, ''); } else if (links[ln].schema === 'mailto:' && !/^mailto:/i.test(urlText)) { urlText = state.md.normalizeLinkText('mailto:' + urlText).replace(/^mailto:/, ''); } else { urlText = state.md.normalizeLinkText(urlText); } const pos = links[ln].index; if (pos > lastPos) { const token = new state.Token('text', '', 0); token.content = text.slice(lastPos, pos); token.level = level; nodes.push(token); } const token_o = new state.Token('link_open', 'a', 1); token_o.attrs = [['href', fullUrl]]; token_o.level = level++; token_o.markup = 'linkify'; token_o.info = 'auto'; nodes.push(token_o); const token_t = new state.Token('text', '', 0); token_t.content = urlText; token_t.level = level; nodes.push(token_t); const token_c = new state.Token('link_close', 'a', -1); token_c.level = --level; token_c.markup = 'linkify'; token_c.info = 'auto'; nodes.push(token_c); lastPos = links[ln].lastIndex; } if (lastPos < text.length) { const token = new state.Token('text', '', 0); token.content = text.slice(lastPos); token.level = level; nodes.push(token); } // replace current node blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes); } } } } // Simple typographic replacements // // (c) (C) → © // (tm) (TM) → ™ // (r) (R) → ® // +- → ± // ... → … (also ?.... → ?.., !.... → !..) // ???????? → ???, !!!!! → !!!, `,,` → `,` // -- → –, --- → — // // TODO: // - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾ // - multiplications 2 x 4 -> 2 × 4 const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/; // Workaround for phantomjs - need regex without /g flag, // or root check will fail every second time const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i; const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig; const SCOPED_ABBR = { c: '©', r: '®', tm: '™' }; function replaceFn(match, name) { return SCOPED_ABBR[name.toLowerCase()]; } function replace_scoped(inlineTokens) { let inside_autolink = 0; for (let i = inlineTokens.length - 1; i >= 0; i--) { const token = inlineTokens[i]; if (token.type === 'text' && !inside_autolink) { token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn); } if (token.type === 'link_open' && token.info === 'auto') { inside_autolink--; } if (token.type === 'link_close' && token.info === 'auto') { inside_autolink++; } } } function replace_rare(inlineTokens) { let inside_autolink = 0; for (let i = inlineTokens.length - 1; i >= 0; i--) { const token = inlineTokens[i]; if (token.type === 'text' && !inside_autolink) { if (RARE_RE.test(token.content)) { token.content = token.content.replace(/\+-/g, '±') // .., ..., ....... -> … // but ?..... & !..... -> ?.. & !.. .replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..').replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',') // em-dash .replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014') // en-dash .replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013').replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013'); } } if (token.type === 'link_open' && token.info === 'auto') { inside_autolink--; } if (token.type === 'link_close' && token.info === 'auto') { inside_autolink++; } } } function replace(state) { let blkIdx; if (!state.md.options.typographer) { return; } for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { if (state.tokens[blkIdx].type !== 'inline') { continue; } if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) { replace_scoped(state.tokens[blkIdx].children); } if (RARE_RE.test(state.tokens[blkIdx].content)) { replace_rare(state.tokens[blkIdx].children); } } } // Convert straight quotation marks to typographic ones // const QUOTE_TEST_RE = /['"]/; const QUOTE_RE = /['"]/g; const APOSTROPHE = '\u2019'; /* ’ */ function replaceAt(str, index, ch) { return str.slice(0, index) + ch + str.slice(index + 1); } function process_inlines(tokens, state) { let j; const stack = []; for (let i = 0; i < tokens.length; i++) { const token = tokens[i]; const thisLevel = tokens[i].level; for (j = stack.length - 1; j >= 0; j--) { if (stack[j].level <= thisLevel) { break; } } stack.length = j + 1; if (token.type !== 'text') { continue; } let text = token.content; let pos = 0; let max = text.length; /* eslint no-labels:0,block-scoped-var:0 */ OUTER: while (pos < max) { QUOTE_RE.lastIndex = pos; const t = QUOTE_RE.exec(text); if (!t) { break; } let canOpen = true; let canClose = true; pos = t.index + 1; const isSingle = t[0] === "'"; // Find previous character, // default to space if it's the beginning of the line // let lastChar = 0x20; if (t.index - 1 >= 0) { lastChar = text.charCodeAt(t.index - 1); } else { for (j = i - 1; j >= 0; j--) { if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // lastChar defaults to 0x20 if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1); break; } } // Find next character, // default to space if it's the end of the line // let nextChar = 0x20; if (pos < max) { nextChar = text.charCodeAt(pos); } else { for (j = i + 1; j < tokens.length; j++) { if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break; // nextChar defaults to 0x20 if (!tokens[j].content) continue; // should skip all tokens except 'text', 'html_inline' or 'code_inline' nextChar = tokens[j].content.charCodeAt(0); break; } } const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); const isLastWhiteSpace = isWhiteSpace(lastChar); const isNextWhiteSpace = isWhiteSpace(nextChar); if (isNextWhiteSpace) { canOpen = false; } else if (isNextPunctChar) { if (!(isLastWhiteSpace || isLastPunctChar)) { canOpen = false; } } if (isLastWhiteSpace) { canClose = false; } else if (isLastPunctChar) { if (!(isNextWhiteSpace || isNextPunctChar)) { canClose = false; } } if (nextChar === 0x22 /* " */ && t[0] === '"') { if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) { // special case: 1"" - count first quote as an inch canClose = canOpen = false; } } if (canOpen && canClose) { // Replace quotes in the middle of punctuation sequence, but not // in the middle of the words, i.e.: // // 1. foo " bar " baz - not replaced // 2. foo-"-bar-"-baz - replaced // 3. foo"bar"baz - not replaced // canOpen = isLastPunctChar; canClose = isNextPunctChar; } if (!canOpen && !canClose) { // middle of word if (isSingle) { token.content = replaceAt(token.content, t.index, APOSTROPHE); } continue; } if (canClose) { // this could be a closing quote, rewind the stack to get a match for (j = stack.length - 1; j >= 0; j--) { let item = stack[j]; if (stack[j].level < thisLevel) { break; } if (item.single === isSingle && stack[j].level === thisLevel) { item = stack[j]; let openQuote; let closeQuote; if (isSingle) { openQuote = state.md.options.quotes[2]; closeQuote = state.md.options.quotes[3]; } else { openQuote = state.md.options.quotes[0]; closeQuote = state.md.options.quotes[1]; } // replace token.content *before* tokens[item.token].content, // because, if they are pointing at the same token, replaceAt // could mess up indices when quote length != 1 token.content = replaceAt(token.content, t.index, closeQuote); tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote); pos += closeQuote.length - 1; if (item.token === i) { pos += openQuote.length - 1; } text = token.content; max = text.length; stack.length = j; continue OUTER; } } } if (canOpen) { stack.push({ token: i, pos: t.index, single: isSingle, level: thisLevel }); } else if (canClose && isSingle) { token.content = replaceAt(token.content, t.index, APOSTROPHE); } } } } function smartquotes(state) { /* eslint max-depth:0 */ if (!state.md.options.typographer) { return; } for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) { if (state.tokens[blkIdx].type !== 'inline' || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) { continue; } process_inlines(state.tokens[blkIdx].children, state); } } // Join raw text tokens with the rest of the text // // This is set as a separate rule to provide an opportunity for plugins // to run text replacements after text join, but before escape join. // // For example, `\:)` shouldn't be replaced with an emoji. // function text_join(state) { let curr, last; const blockTokens = state.tokens; const l = blockTokens.length; for (let j = 0; j < l; j++) { if (blockTokens[j].type !== 'inline') continue; const tokens = blockTokens[j].children; const max = tokens.length; for (curr = 0; curr < max; curr++) { if (tokens[curr].type === 'text_special') { tokens[curr].type = 'text'; } } for (curr = last = 0; curr < max; curr++) { if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { // collapse two adjacent text nodes tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; } else { if (curr !== last) { tokens[last] = tokens[curr]; } last++; } } if (curr !== last) { tokens.length = last; } } } /** internal * class Core * * Top-level rules executor. Glues block/inline parsers and does intermediate * transformations. **/ const _rules$2 = [['normalize', normalize], ['block', block], ['inline', inline], ['linkify', linkify$1], ['replacements', replace], ['smartquotes', smartquotes], // `text_join` finds `text_special` tokens (for escape sequences) // and joins them with the rest of the text ['text_join', text_join]]; /** * new Core() **/ function Core() { /** * Core#ruler -> Ruler * * [[Ruler]] instance. Keep configuration of core rules. **/ this.ruler = new Ruler(); for (let i = 0; i < _rules$2.length; i++) { this.ruler.push(_rules$2[i][0], _rules$2[i][1]); } } /** * Core.process(state) * * Executes core chain rules. **/ Core.prototype.process = function (state) { const rules = this.ruler.getRules(''); for (let i = 0, l = rules.length; i < l; i++) { rules[i](state); } }; Core.prototype.State = StateCore; // Parser state class function StateBlock(src, md, env, tokens) { this.src = src; // link to parser instance this.md = md; this.env = env; // // Internal state vartiables // this.tokens = tokens; this.bMarks = []; // line begin offsets for fast jumps this.eMarks = []; // line end offsets for fast jumps this.tShift = []; // offsets of the first non-space characters (tabs not expanded) this.sCount = []; // indents for each line (tabs expanded) // An amount of virtual spaces (tabs expanded) between beginning // of each line (bMarks) and real beginning of that line. // // It exists only as a hack because blockquotes override bMarks // losing information in the process. // // It's used only when expanding tabs, you can think about it as // an initial tab length, e.g. bsCount=21 applied to string `\t123` // means first tab should be expanded to 4-21%4 === 3 spaces. // this.bsCount = []; // block parser variables // required block content indent (for example, if we are // inside a list, it would be positioned after list marker) this.blkIndent = 0; this.line = 0; // line index in src this.lineMax = 0; // lines count this.tight = false; // loose/tight mode for lists this.ddIndent = -1; // indent of the current dd block (-1 if there isn't any) this.listIndent = -1; // indent of the current list block (-1 if there isn't any) // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference' // used in lists to determine if they interrupt a paragraph this.parentType = 'root'; this.level = 0; // Create caches // Generate markers. const s = this.src; for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) { const ch = s.charCodeAt(pos); if (!indent_found) { if (isSpace(ch)) { indent++; if (ch === 0x09) { offset += 4 - offset % 4; } else { offset++; } continue; } else { indent_found = true; } } if (ch === 0x0A || pos === len - 1) { if (ch !== 0x0A) { pos++; } this.bMarks.push(start); this.eMarks.push(pos); this.tShift.push(indent); this.sCount.push(offset); this.bsCount.push(0); indent_found = false; indent = 0; offset = 0; start = pos + 1; } } // Push fake entry to simplify cache bounds checks this.bMarks.push(s.length); this.eMarks.push(s.length); this.tShift.push(0); this.sCount.push(0); this.bsCount.push(0); this.lineMax = this.bMarks.length - 1; // don't count last fake line } // Push new token to "stream". // StateBlock.prototype.push = function (type, tag, nesting) { const token = new Token(type, tag, nesting); token.block = true; if (nesting < 0) this.level--; // closing tag token.level = this.level; if (nesting > 0) this.level++; // opening tag this.tokens.push(token); return token; }; StateBlock.prototype.isEmpty = function isEmpty(line) { return this.bMarks[line] + this.tShift[line] >= this.eMarks[line]; }; StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) { for (let max = this.lineMax; from < max; from++) { if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) { break; } } return from; }; // Skip spaces from given position. StateBlock.prototype.skipSpaces = function skipSpaces(pos) { for (let max = this.src.length; pos < max; pos++) { const ch = this.src.charCodeAt(pos); if (!isSpace(ch)) { break; } } return pos; }; // Skip spaces from given position in reverse. StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) { if (pos <= min) { return pos; } while (pos > min) { if (!isSpace(this.src.charCodeAt(--pos))) { return pos + 1; } } return pos; }; // Skip char codes from given position StateBlock.prototype.skipChars = function skipChars(pos, code) { for (let max = this.src.length; pos < max; pos++) { if (this.src.charCodeAt(pos) !== code) { break; } } return pos; }; // Skip char codes reverse from given position - 1 StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) { if (pos <= min) { return pos; } while (pos > min) { if (code !== this.src.charCodeAt(--pos)) { return pos + 1; } } return pos; }; // cut lines range from source. StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) { if (begin >= end) { return ''; } const queue = new Array(end - begin); for (let i = 0, line = begin; line < end; line++, i++) { let lineIndent = 0; const lineStart = this.bMarks[line]; let first = lineStart; let last; if (line + 1 < end || keepLastLF) { // No need for bounds check because we have fake entry on tail. last = this.eMarks[line] + 1; } else { last = this.eMarks[line]; } while (first < last && lineIndent < indent) { const ch = this.src.charCodeAt(first); if (isSpace(ch)) { if (ch === 0x09) { lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4; } else { lineIndent++; } } else if (first - lineStart < this.tShift[line]) { // patched tShift masked characters to look like spaces (blockquotes, list markers) lineIndent++; } else { break; } first++; } if (lineIndent > indent) { // partially expanding tabs in code blocks, e.g '\t\tfoobar' // with indent=2 becomes ' \tfoobar' queue[i] = new Array(lineIndent - indent + 1).join(' ') + this.src.slice(first, last); } else { queue[i] = this.src.slice(first, last); } } return queue.join(''); }; // re-export Token class to use in block rules StateBlock.prototype.Token = Token; // GFM table, https://github.github.com/gfm/#tables-extension- // Limit the amount of empty autocompleted cells in a table, // see https://github.com/markdown-it/markdown-it/issues/1000, // // Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k. // We set it to 65k, which can expand user input by a factor of x370 // (256x256 square is 1.8kB expanded into 650kB). const MAX_AUTOCOMPLETED_CELLS = 0x10000; function getLine(state, line) { const pos = state.bMarks[line] + state.tShift[line]; const max = state.eMarks[line]; return state.src.slice(pos, max); } function escapedSplit(str) { const result = []; const max = str.length; let pos = 0; let ch = str.charCodeAt(pos); let isEscaped = false; let lastPos = 0; let current = ''; while (pos < max) { if (ch === 0x7c /* | */) { if (!isEscaped) { // pipe separating cells, '|' result.push(current + str.substring(lastPos, pos)); current = ''; lastPos = pos + 1; } else { // escaped pipe, '\|' current += str.substring(lastPos, pos - 1); lastPos = pos; } } isEscaped = ch === 0x5c /* \ */; pos++; ch = str.charCodeAt(pos); } result.push(current + str.substring(lastPos)); return result; } function table(state, startLine, endLine, silent) { // should have at least two lines if (startLine + 2 > endLine) { return false; } let nextLine = startLine + 1; if (state.sCount[nextLine] < state.blkIndent) { return false; } // if it's indented more than 3 spaces, it should be a code block if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; } // first character of the second line should be '|', '-', ':', // and no other characters are allowed but spaces; // basically, this is the equivalent of /^[-:|][-:|\s]*$/ regexp let pos = state.bMarks[nextLine] + state.tShift[nextLine]; if (pos >= state.eMarks[nextLine]) { return false; } const firstCh = state.src.charCodeAt(pos++); if (firstCh !== 0x7C /* | */ && firstCh !== 0x2D /* - */ && firstCh !== 0x3A /* : */) { return false; } if (pos >= state.eMarks[nextLine]) { return false; } const secondCh = state.src.charCodeAt(pos++); if (secondCh !== 0x7C /* | */ && secondCh !== 0x2D /* - */ && secondCh !== 0x3A /* : */ && !isSpace(secondCh)) { return false; } // if first character is '-', then second character must not be a space // (due to parsing ambiguity with list) if (firstCh === 0x2D /* - */ && isSpace(secondCh)) { return false; } while (pos < state.eMarks[nextLine]) { const ch = state.src.charCodeAt(pos); if (ch !== 0x7C /* | */ && ch !== 0x2D /* - */ && ch !== 0x3A /* : */ && !isSpace(ch)) { return false; } pos++; } let lineText = getLine(state, startLine + 1); let columns = lineText.split('|'); const aligns = []; for (let i = 0; i < columns.length; i++) { const t = columns[i].trim(); if (!t) { // allow empty columns before and after table, but not in between columns; // e.g. allow ` |---| `, disallow ` ---||--- ` if (i === 0 || i === columns.length - 1) { continue; } else { return false; } } if (!/^:?-+:?$/.test(t)) { return false; } if (t.charCodeAt(t.length - 1) === 0x3A /* : */) { aligns.push(t.charCodeAt(0) === 0x3A /* : */ ? 'center' : 'right'); } else if (t.charCodeAt(0) === 0x3A /* : */) { aligns.push('left'); } else { aligns.push(''); } } lineText = getLine(state, startLine).trim(); if (lineText.indexOf('|') === -1) { return false; } if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } columns = escapedSplit(lineText); if (columns.length && columns[0] === '') columns.shift(); if (columns.length && columns[columns.length - 1] === '') columns.pop(); // header row will define an amount of columns in the entire table, // and align row should be exactly the same (the rest of the rows can differ) const columnCount = columns.length; if (columnCount === 0 || columnCount !== aligns.length) { return false; } if (silent) { return true; } const oldParentType = state.parentType; state.parentType = 'table'; // use 'blockquote' lists for termination because it's // the most similar to tables const terminatorRules = state.md.block.ruler.getRules('blockquote'); const token_to = state.push('table_open', 'table', 1); const tableLines = [startLine, 0]; token_to.map = tableLines; const token_tho = state.push('thead_open', 'thead', 1); token_tho.map = [startLine, startLine + 1]; const token_htro = state.push('tr_open', 'tr', 1); token_htro.map = [startLine, startLine + 1]; for (let i = 0; i < columns.length; i++) { const token_ho = state.push('th_open', 'th', 1); if (aligns[i]) { token_ho.attrs = [['style', 'text-align:' + aligns[i]]]; } const token_il = state.push('inline', '', 0); token_il.content = columns[i].trim(); token_il.children = []; state.push('th_close', 'th', -1); } state.push('tr_close', 'tr', -1); state.push('thead_close', 'thead', -1); let tbodyLines; let autocompletedCells = 0; for (nextLine = startLine + 2; nextLine < endLine; nextLine++) { if (state.sCount[nextLine] < state.blkIndent) { break; } let terminate = false; for (let i = 0, l = terminatorRules.length; i < l; i++) { if (terminatorRules[i](state, nextLine, endLine, true)) { terminate = true; break; } } if (terminate) { break; } lineText = getLine(state, nextLine).trim(); if (!lineText) { break; } if (state.sCount[nextLine] - state.blkIndent >= 4) { break; } columns = escapedSplit(lineText); if (columns.length && columns[0] === '') columns.shift(); if (columns.length && columns[columns.length - 1] === '') columns.pop(); // note: autocomplete count can be negative if user specifies more columns than header, // but that does not affect intended use (which is limiting expansion) autocompletedCells += columnCount - columns.length; if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) { break; } if (nextLine === startLine + 2) { const token_tbo = state.push('tbody_open', 'tbody', 1); token_tbo.map = tbodyLines = [startLine + 2, 0]; } const token_tro = state.push('tr_open', 'tr', 1); token_tro.map = [nextLine, nextLine + 1]; for (let i = 0; i < columnCount; i++) { const token_tdo = state.push('td_open', 'td', 1); if (aligns[i]) { token_tdo.attrs = [['style', 'text-align:' + aligns[i]]]; } const token_il = state.push('inline', '', 0); token_il.content = columns[i] ? columns[i].trim() : ''; token_il.children = []; state.push('td_close', 'td', -1); } state.push('tr_close', 'tr', -1); } if (tbodyLines) { state.push('tbody_close', 'tbody', -1); tbodyLines[1] = nextLine; } state.push('table_close', 'table', -1); tableLines[1] = nextLine; state.parentType = oldParentType; state.line = nextLine; return true; } // Code block (4 spaces padded) function code(state, startLine, endLine /*, silent */) { if (state.sCount[startLine] - state.blkIndent < 4) { return false; } let nextLine = startLine + 1; let last = nextLine; while (nextLine < endLine) { if (state.isEmpty(nextLine)) { nextLine++; continue; } if (state.sCount[nextLine] - state.blkIndent >= 4) { nextLine++; last = nextLine; continue; } break; } state.line = last; const token = state.push('code_block', 'code', 0); token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + '\n'; token.map = [startLine, state.line]; return true; } // fences (``` lang, ~~~ lang) function fence(state, startLine, endLine, silent) { let pos = state.bMarks[startLine] + state.tShift[startLine]; let max = state.eMarks[startLine]; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } if (pos + 3 > max) { return false; } const marker = state.src.charCodeAt(pos); if (marker !== 0x7E /* ~ */ && marker !== 0x60 /* ` */) { return false; } // scan marker length let mem = pos; pos = state.skipChars(pos, marker); let len = pos - mem; if (len < 3) { return false; } const markup = state.src.slice(mem, pos); const params = state.src.slice(pos, max); if (marker === 0x60 /* ` */) { if (params.indexOf(String.fromCharCode(marker)) >= 0) { return false; } } // Since start is found, we can report success here in validation mode if (silent) { return true; } // search end of block let nextLine = startLine; let haveEndMarker = false; for (;;) { nextLine++; if (nextLine >= endLine) { // unclosed block should be autoclosed by end of document. // also block seems to be autoclosed by end of parent break; } pos = mem = state.bMarks[nextLine] + state.tShift[nextLine]; max = state.eMarks[nextLine]; if (pos < max && state.sCount[nextLine] < state.blkIndent) { // non-empty line with negative indent should stop the list: // - ``` // test break; } if (state.src.charCodeAt(pos) !== marker) { continue; } if (state.sCount[nextLine] - state.blkIndent >= 4) { // closing fence should be indented less than 4 spaces continue; } pos = state.skipChars(pos, marker); // closing code fence must be at least as long as the opening one if (pos - mem < len) { continue; } // make sure tail has spaces only pos = state.skipSpaces(pos); if (pos < max) { continue; } haveEndMarker = true; // found! break; } // If a fence has heading spaces, they should be removed from its inner block len = state.sCount[startLine]; state.line = nextLine + (haveEndMarker ? 1 : 0); const token = state.push('fence', 'code', 0); token.info = params; token.content = state.getLines(startLine + 1, nextLine, len, true); token.markup = markup; token.map = [startLine, state.line]; return true; } // Block quotes function blockquote(state, startLine, endLine, silent) { let pos = state.bMarks[startLine] + state.tShift[startLine]; let max = state.eMarks[startLine]; const oldLineMax = state.lineMax; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } // check the block quote marker if (state.src.charCodeAt(pos) !== 0x3E /* > */) { return false; } // we know that it's going to be a valid blockquote, // so no point trying to find the end of it in silent mode if (silent) { return true; } const oldBMarks = []; const oldBSCount = []; const oldSCount = []; const oldTShift = []; const terminatorRules = state.md.block.ruler.getRules('blockquote'); const oldParentType = state.parentType; state.parentType = 'blockquote'; let lastLineEmpty = false; let nextLine; // Search the end of the block // // Block ends with either: // 1. an empty line outside: // ``` // > test // // ``` // 2. an empty line inside: // ``` // > // test // ``` // 3. another tag: // ``` // > test // - - - // ``` for (nextLine = startLine; nextLine < endLine; nextLine++) { // check if it's outdented, i.e. it's inside list item and indented // less than said list item: // // ``` // 1. anything // > current blockquote // 2. checking this line // ``` const isOutdented = state.sCount[nextLine] < state.blkIndent; pos = state.bMarks[nextLine] + state.tShift[nextLine]; max = state.eMarks[nextLine]; if (pos >= max) { // Case 1: line is not inside the blockquote, and this line is empty. break; } if (state.src.charCodeAt(pos++) === 0x3E /* > */ && !isOutdented) { // This line is inside the blockquote. // set offset past spaces and ">" let initial = state.sCount[nextLine] + 1; let spaceAfterMarker; let adjustTab; // skip one optional space after '>' if (state.src.charCodeAt(pos) === 0x20 /* space */) { // ' > test ' // ^ -- position start of line here: pos++; initial++; adjustTab = false; spaceAfterMarker = true; } else if (state.src.charCodeAt(pos) === 0x09 /* tab */) { spaceAfterMarker = true; if ((state.bsCount[nextLine] + initial) % 4 === 3) { // ' >\t test ' // ^ -- position start of line here (tab has width===1) pos++; initial++; adjustTab = false; } else { // ' >\t test ' // ^ -- position start of line here + shift bsCount slightly // to make extra space appear adjustTab = true; } } else { spaceAfterMarker = false; } let offset = initial; oldBMarks.push(state.bMarks[nextLine]); state.bMarks[nextLine] = pos; while (pos < max) { const ch = state.src.charCodeAt(pos); if (isSpace(ch)) { if (ch === 0x09) { offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4; } else { offset++; } } else { break; } pos++; } lastLineEmpty = pos >= max; oldBSCount.push(state.bsCount[nextLine]); state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0); oldSCount.push(state.sCount[nextLine]); state.sCount[nextLine] = offset - initial; oldTShift.push(state.tShift[nextLine]); state.tShift[nextLine] = pos - state.bMarks[nextLine]; continue; } // Case 2: line is not inside the blockquote, and the last line was empty. if (lastLineEmpty) { break; } // Case 3: another tag found. let terminate = false; for (let i = 0, l = terminatorRules.length; i < l; i++) { if (terminatorRules[i](state, nextLine, endLine, true)) { terminate = true; break; } } if (terminate) { // Quirk to enforce "hard termination mode" for paragraphs; // normally if you call `tokenize(state, startLine, nextLine)`, // paragraphs will look below nextLine for paragraph continuation, // but if blockquote is terminated by another tag, they shouldn't state.lineMax = nextLine; if (state.blkIndent !== 0) { // state.blkIndent was non-zero, we now set it to zero, // so we need to re-calculate all offsets to appear as // if indent wasn't changed oldBMarks.push(state.bMarks[nextLine]); oldBSCount.push(state.bsCount[nextLine]); oldTShift.push(state.tShift[nextLine]); oldSCount.push(state.sCount[nextLine]); state.sCount[nextLine] -= state.blkIndent; } break; } oldBMarks.push(state.bMarks[nextLine]); oldBSCount.push(state.bsCount[nextLine]); oldTShift.push(state.tShift[nextLine]); oldSCount.push(state.sCount[nextLine]); // A negative indentation means that this is a paragraph continuation // state.sCount[nextLine] = -1; } const oldIndent = state.blkIndent; state.blkIndent = 0; const token_o = state.push('blockquote_open', 'blockquote', 1); token_o.markup = '>'; const lines = [startLine, 0]; token_o.map = lines; state.md.block.tokenize(state, startLine, nextLine); const token_c = state.push('blockquote_close', 'blockquote', -1); token_c.markup = '>'; state.lineMax = oldLineMax; state.parentType = oldParentType; lines[1] = state.line; // Restore original tShift; this might not be necessary since the parser // has already been here, but just to make sure we can do that. for (let i = 0; i < oldTShift.length; i++) { state.bMarks[i + startLine] = oldBMarks[i]; state.tShift[i + startLine] = oldTShift[i]; state.sCount[i + startLine] = oldSCount[i]; state.bsCount[i + startLine] = oldBSCount[i]; } state.blkIndent = oldIndent; return true; } // Horizontal rule function hr(state, startLine, endLine, silent) { const max = state.eMarks[startLine]; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } let pos = state.bMarks[startLine] + state.tShift[startLine]; const marker = state.src.charCodeAt(pos++); // Check hr marker if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x5F /* _ */) { return false; } // markers can be mixed with spaces, but there should be at least 3 of them let cnt = 1; while (pos < max) { const ch = state.src.charCodeAt(pos++); if (ch !== marker && !isSpace(ch)) { return false; } if (ch === marker) { cnt++; } } if (cnt < 3) { return false; } if (silent) { return true; } state.line = startLine + 1; const token = state.push('hr', 'hr', 0); token.map = [startLine, state.line]; token.markup = Array(cnt + 1).join(String.fromCharCode(marker)); return true; } // Lists // Search `[-+*][\n ]`, returns next pos after marker on success // or -1 on fail. function skipBulletListMarker(state, startLine) { const max = state.eMarks[startLine]; let pos = state.bMarks[startLine] + state.tShift[startLine]; const marker = state.src.charCodeAt(pos++); // Check bullet if (marker !== 0x2A /* * */ && marker !== 0x2D /* - */ && marker !== 0x2B /* + */) { return -1; } if (pos < max) { const ch = state.src.charCodeAt(pos); if (!isSpace(ch)) { // " -test " - is not a list item return -1; } } return pos; } // Search `\d+[.)][\n ]`, returns next pos after marker on success // or -1 on fail. function skipOrderedListMarker(state, startLine) { const start = state.bMarks[startLine] + state.tShift[startLine]; const max = state.eMarks[startLine]; let pos = start; // List marker should have at least 2 chars (digit + dot) if (pos + 1 >= max) { return -1; } let ch = state.src.charCodeAt(pos++); if (ch < 0x30 /* 0 */ || ch > 0x39 /* 9 */) { return -1; } for (;;) { // EOL -> fail if (pos >= max) { return -1; } ch = state.src.charCodeAt(pos++); if (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) { // List marker should have no more than 9 digits // (prevents integer overflow in browsers) if (pos - start >= 10) { return -1; } continue; } // found valid marker if (ch === 0x29 /* ) */ || ch === 0x2e /* . */) { break; } return -1; } if (pos < max) { ch = state.src.charCodeAt(pos); if (!isSpace(ch)) { // " 1.test " - is not a list item return -1; } } return pos; } function markTightParagraphs(state, idx) { const level = state.level + 2; for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) { if (state.tokens[i].level === level && state.tokens[i].type === 'paragraph_open') { state.tokens[i + 2].hidden = true; state.tokens[i].hidden = true; i += 2; } } } function list(state, startLine, endLine, silent) { let max, pos, start, token; let nextLine = startLine; let tight = true; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[nextLine] - state.blkIndent >= 4) { return false; } // Special case: // - item 1 // - item 2 // - item 3 // - item 4 // - this one is a paragraph continuation if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) { return false; } let isTerminatingParagraph = false; // limit conditions when list can interrupt // a paragraph (validation mode only) if (silent && state.parentType === 'paragraph') { // Next list item should still terminate previous list item; // // This code can fail if plugins use blkIndent as well as lists, // but I hope the spec gets fixed long before that happens. // if (state.sCount[nextLine] >= state.blkIndent) { isTerminatingParagraph = true; } } // Detect list type and position after marker let isOrdered; let markerValue; let posAfterMarker; if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) { isOrdered = true; start = state.bMarks[nextLine] + state.tShift[nextLine]; markerValue = Number(state.src.slice(start, posAfterMarker - 1)); // If we're starting a new ordered list right after // a paragraph, it should start with 1. if (isTerminatingParagraph && markerValue !== 1) return false; } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) { isOrdered = false; } else { return false; } // If we're starting a new unordered list right after // a paragraph, first line should not be empty. if (isTerminatingParagraph) { if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false; } // For validation mode we can terminate immediately if (silent) { return true; } // We should terminate list on style change. Remember first one to compare. const markerCharCode = state.src.charCodeAt(posAfterMarker - 1); // Start list const listTokIdx = state.tokens.length; if (isOrdered) { token = state.push('ordered_list_open', 'ol', 1); if (markerValue !== 1) { token.attrs = [['start', markerValue]]; } } else { token = state.push('bullet_list_open', 'ul', 1); } const listLines = [nextLine, 0]; token.map = listLines; token.markup = String.fromCharCode(markerCharCode); // // Iterate list items // let prevEmptyEnd = false; const terminatorRules = state.md.block.ruler.getRules('list'); const oldParentType = state.parentType; state.parentType = 'list'; while (nextLine < endLine) { pos = posAfterMarker; max = state.eMarks[nextLine]; const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]); let offset = initial; while (pos < max) { const ch = state.src.charCodeAt(pos); if (ch === 0x09) { offset += 4 - (offset + state.bsCount[nextLine]) % 4; } else if (ch === 0x20) { offset++; } else { break; } pos++; } const contentStart = pos; let indentAfterMarker; if (contentStart >= max) { // trimming space in "- \n 3" case, indent is 1 here indentAfterMarker = 1; } else { indentAfterMarker = offset - initial; } // If we have more than 4 spaces, the indent is 1 // (the rest is just indented code block) if (indentAfterMarker > 4) { indentAfterMarker = 1; } // " - test" // ^^^^^ - calculating total length of this thing const indent = initial + indentAfterMarker; // Run subparser & write tokens token = state.push('list_item_open', 'li', 1); token.markup = String.fromCharCode(markerCharCode); const itemLines = [nextLine, 0]; token.map = itemLines; if (isOrdered) { token.info = state.src.slice(start, posAfterMarker - 1); } // change current state, then restore it after parser subcall const oldTight = state.tight; const oldTShift = state.tShift[nextLine]; const oldSCount = state.sCount[nextLine]; // - example list // ^ listIndent position will be here // ^ blkIndent position will be here // const oldListIndent = state.listIndent; state.listIndent = state.blkIndent; state.blkIndent = indent; state.tight = true; state.tShift[nextLine] = contentStart - state.bMarks[nextLine]; state.sCount[nextLine] = offset; if (contentStart >= max && state.isEmpty(nextLine + 1)) { // workaround for this case // (list item is empty, list terminates before "foo"): // ~~~~~~~~ // - // // foo // ~~~~~~~~ state.line = Math.min(state.line + 2, endLine); } else { state.md.block.tokenize(state, nextLine, endLine, true); } // If any of list item is tight, mark list as tight if (!state.tight || prevEmptyEnd) { tight = false; } // Item become loose if finish with empty line, // but we should filter last element, because it means list finish prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1); state.blkIndent = state.listIndent; state.listIndent = oldListIndent; state.tShift[nextLine] = oldTShift; state.sCount[nextLine] = oldSCount; state.tight = oldTight; token = state.push('list_item_close', 'li', -1); token.markup = String.fromCharCode(markerCharCode); nextLine = state.line; itemLines[1] = nextLine; if (nextLine >= endLine) { break; } // // Try to check if list is terminated or continued. // if (state.sCount[nextLine] < state.blkIndent) { break; } // if it's indented more than 3 spaces, it should be a code block if (state.sCount[nextLine] - state.blkIndent >= 4) { break; } // fail if terminating block found let terminate = false; for (let i = 0, l = terminatorRules.length; i < l; i++) { if (terminatorRules[i](state, nextLine, endLine, true)) { terminate = true; break; } } if (terminate) { break; } // fail if list has another type if (isOrdered) { posAfterMarker = skipOrderedListMarker(state, nextLine); if (posAfterMarker < 0) { break; } start = state.bMarks[nextLine] + state.tShift[nextLine]; } else { posAfterMarker = skipBulletListMarker(state, nextLine); if (posAfterMarker < 0) { break; } } if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) { break; } } // Finalize list if (isOrdered) { token = state.push('ordered_list_close', 'ol', -1); } else { token = state.push('bullet_list_close', 'ul', -1); } token.markup = String.fromCharCode(markerCharCode); listLines[1] = nextLine; state.line = nextLine; state.parentType = oldParentType; // mark paragraphs tight if needed if (tight) { markTightParagraphs(state, listTokIdx); } return true; } function reference(state, startLine, _endLine, silent) { let pos = state.bMarks[startLine] + state.tShift[startLine]; let max = state.eMarks[startLine]; let nextLine = startLine + 1; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } if (state.src.charCodeAt(pos) !== 0x5B /* [ */) { return false; } function getNextLine(nextLine) { const endLine = state.lineMax; if (nextLine >= endLine || state.isEmpty(nextLine)) { // empty line or end of input return null; } let isContinuation = false; // this would be a code block normally, but after paragraph // it's considered a lazy continuation regardless of what's there if (state.sCount[nextLine] - state.blkIndent > 3) { isContinuation = true; } // quirk for blockquotes, this line should already be checked by that rule if (state.sCount[nextLine] < 0) { isContinuation = true; } if (!isContinuation) { const terminatorRules = state.md.block.ruler.getRules('reference'); const oldParentType = state.parentType; state.parentType = 'reference'; // Some tags can terminate paragraph without empty line. let terminate = false; for (let i = 0, l = terminatorRules.length; i < l; i++) { if (terminatorRules[i](state, nextLine, endLine, true)) { terminate = true; break; } } state.parentType = oldParentType; if (terminate) { // terminated by another block return null; } } const pos = state.bMarks[nextLine] + state.tShift[nextLine]; const max = state.eMarks[nextLine]; // max + 1 explicitly includes the newline return state.src.slice(pos, max + 1); } let str = state.src.slice(pos, max + 1); max = str.length; let labelEnd = -1; for (pos = 1; pos < max; pos++) { const ch = str.charCodeAt(pos); if (ch === 0x5B /* [ */) { return false; } else if (ch === 0x5D /* ] */) { labelEnd = pos; break; } else if (ch === 0x0A /* \n */) { const lineContent = getNextLine(nextLine); if (lineContent !== null) { str += lineContent; max = str.length; nextLine++; } } else if (ch === 0x5C /* \ */) { pos++; if (pos < max && str.charCodeAt(pos) === 0x0A) { const lineContent = getNextLine(nextLine); if (lineContent !== null) { str += lineContent; max = str.length; nextLine++; } } } } if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 0x3A /* : */) { return false; } // [label]: destination 'title' // ^^^ skip optional whitespace here for (pos = labelEnd + 2; pos < max; pos++) { const ch = str.charCodeAt(pos); if (ch === 0x0A) { const lineContent = getNextLine(nextLine); if (lineContent !== null) { str += lineContent; max = str.length; nextLine++; } } else if (isSpace(ch)) ;else { break; } } // [label]: destination 'title' // ^^^^^^^^^^^ parse this const destRes = state.md.helpers.parseLinkDestination(str, pos, max); if (!destRes.ok) { return false; } const href = state.md.normalizeLink(destRes.str); if (!state.md.validateLink(href)) { return false; } pos = destRes.pos; // save cursor state, we could require to rollback later const destEndPos = pos; const destEndLineNo = nextLine; // [label]: destination 'title' // ^^^ skipping those spaces const start = pos; for (; pos < max; pos++) { const ch = str.charCodeAt(pos); if (ch === 0x0A) { const lineContent = getNextLine(nextLine); if (lineContent !== null) { str += lineContent; max = str.length; nextLine++; } } else if (isSpace(ch)) ;else { break; } } // [label]: destination 'title' // ^^^^^^^ parse this let titleRes = state.md.helpers.parseLinkTitle(str, pos, max); while (titleRes.can_continue) { const lineContent = getNextLine(nextLine); if (lineContent === null) break; str += lineContent; pos = max; max = str.length; nextLine++; titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes); } let title; if (pos < max && start !== pos && titleRes.ok) { title = titleRes.str; pos = titleRes.pos; } else { title = ''; pos = destEndPos; nextLine = destEndLineNo; } // skip trailing spaces until the rest of the line while (pos < max) { const ch = str.charCodeAt(pos); if (!isSpace(ch)) { break; } pos++; } if (pos < max && str.charCodeAt(pos) !== 0x0A) { if (title) { // garbage at the end of the line after title, // but it could still be a valid reference if we roll back title = ''; pos = destEndPos; nextLine = destEndLineNo; while (pos < max) { const ch = str.charCodeAt(pos); if (!isSpace(ch)) { break; } pos++; } } } if (pos < max && str.charCodeAt(pos) !== 0x0A) { // garbage at the end of the line return false; } const label = normalizeReference(str.slice(1, labelEnd)); if (!label) { // CommonMark 0.20 disallows empty labels return false; } // Reference can not terminate anything. This check is for safety only. /* istanbul ignore if */ if (silent) { return true; } if (typeof state.env.references === 'undefined') { state.env.references = {}; } if (typeof state.env.references[label] === 'undefined') { state.env.references[label] = { title, href }; } state.line = nextLine; return true; } // List of valid html blocks names, according to commonmark spec // https://spec.commonmark.org/0.30/#html-blocks var block_names = ['address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center', 'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav', 'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'search', 'section', 'summary', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul']; // Regexps to match html elements const attr_name = '[a-zA-Z_:][a-zA-Z0-9:._-]*'; const unquoted = '[^"\'=<>`\\x00-\\x20]+'; const single_quoted = "'[^']*'"; const double_quoted = '"[^"]*"'; const attr_value = '(?:' + unquoted + '|' + single_quoted + '|' + double_quoted + ')'; const attribute = '(?:\\s+' + attr_name + '(?:\\s*=\\s*' + attr_value + ')?)'; const open_tag = '<[A-Za-z][A-Za-z0-9\\-]*' + attribute + '*\\s*\\/?>'; const close_tag = '<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>'; const comment = ''; const processing = '<[?][\\s\\S]*?[?]>'; const declaration = ']*>'; const cdata = ''; const HTML_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + '|' + comment + '|' + processing + '|' + declaration + '|' + cdata + ')'); const HTML_OPEN_CLOSE_TAG_RE = new RegExp('^(?:' + open_tag + '|' + close_tag + ')'); // HTML block // An array of opening and corresponding closing sequences for html tags, // last argument defines whether it can terminate a paragraph or not // const HTML_SEQUENCES = [[/^<(script|pre|style|textarea)(?=(\s|>|$))/i, /<\/(script|pre|style|textarea)>/i, true], [/^/, true], [/^<\?/, /\?>/, true], [/^/, true], [/^/, true], [new RegExp('^|$))', 'i'), /^$/, true], [new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + '\\s*$'), /^$/, false]]; function html_block(state, startLine, endLine, silent) { let pos = state.bMarks[startLine] + state.tShift[startLine]; let max = state.eMarks[startLine]; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } if (!state.md.options.html) { return false; } if (state.src.charCodeAt(pos) !== 0x3C /* < */) { return false; } let lineText = state.src.slice(pos, max); let i = 0; for (; i < HTML_SEQUENCES.length; i++) { if (HTML_SEQUENCES[i][0].test(lineText)) { break; } } if (i === HTML_SEQUENCES.length) { return false; } if (silent) { // true if this sequence can be a terminator, false otherwise return HTML_SEQUENCES[i][2]; } let nextLine = startLine + 1; // If we are here - we detected HTML block. // Let's roll down till block end. if (!HTML_SEQUENCES[i][1].test(lineText)) { for (; nextLine < endLine; nextLine++) { if (state.sCount[nextLine] < state.blkIndent) { break; } pos = state.bMarks[nextLine] + state.tShift[nextLine]; max = state.eMarks[nextLine]; lineText = state.src.slice(pos, max); if (HTML_SEQUENCES[i][1].test(lineText)) { if (lineText.length !== 0) { nextLine++; } break; } } } state.line = nextLine; const token = state.push('html_block', '', 0); token.map = [startLine, nextLine]; token.content = state.getLines(startLine, nextLine, state.blkIndent, true); return true; } // heading (#, ##, ...) function heading(state, startLine, endLine, silent) { let pos = state.bMarks[startLine] + state.tShift[startLine]; let max = state.eMarks[startLine]; // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } let ch = state.src.charCodeAt(pos); if (ch !== 0x23 /* # */ || pos >= max) { return false; } // count heading level let level = 1; ch = state.src.charCodeAt(++pos); while (ch === 0x23 /* # */ && pos < max && level <= 6) { level++; ch = state.src.charCodeAt(++pos); } if (level > 6 || pos < max && !isSpace(ch)) { return false; } if (silent) { return true; } // Let's cut tails like ' ### ' from the end of string max = state.skipSpacesBack(max, pos); const tmp = state.skipCharsBack(max, 0x23, pos); // # if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) { max = tmp; } state.line = startLine + 1; const token_o = state.push('heading_open', 'h' + String(level), 1); token_o.markup = '########'.slice(0, level); token_o.map = [startLine, state.line]; const token_i = state.push('inline', '', 0); token_i.content = state.src.slice(pos, max).trim(); token_i.map = [startLine, state.line]; token_i.children = []; const token_c = state.push('heading_close', 'h' + String(level), -1); token_c.markup = '########'.slice(0, level); return true; } // lheading (---, ===) function lheading(state, startLine, endLine /*, silent */) { const terminatorRules = state.md.block.ruler.getRules('paragraph'); // if it's indented more than 3 spaces, it should be a code block if (state.sCount[startLine] - state.blkIndent >= 4) { return false; } const oldParentType = state.parentType; state.parentType = 'paragraph'; // use paragraph to match terminatorRules // jump line-by-line until empty one or EOF let level = 0; let marker; let nextLine = startLine + 1; for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { // this would be a code block normally, but after paragraph // it's considered a lazy continuation regardless of what's there if (state.sCount[nextLine] - state.blkIndent > 3) { continue; } // // Check for underline in setext header // if (state.sCount[nextLine] >= state.blkIndent) { let pos = state.bMarks[nextLine] + state.tShift[nextLine]; const max = state.eMarks[nextLine]; if (pos < max) { marker = state.src.charCodeAt(pos); if (marker === 0x2D /* - */ || marker === 0x3D /* = */) { pos = state.skipChars(pos, marker); pos = state.skipSpaces(pos); if (pos >= max) { level = marker === 0x3D /* = */ ? 1 : 2; break; } } } } // quirk for blockquotes, this line should already be checked by that rule if (state.sCount[nextLine] < 0) { continue; } // Some tags can terminate paragraph without empty line. let terminate = false; for (let i = 0, l = terminatorRules.length; i < l; i++) { if (terminatorRules[i](state, nextLine, endLine, true)) { terminate = true; break; } } if (terminate) { break; } } if (!level) { // Didn't find valid underline return false; } const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); state.line = nextLine + 1; const token_o = state.push('heading_open', 'h' + String(level), 1); token_o.markup = String.fromCharCode(marker); token_o.map = [startLine, state.line]; const token_i = state.push('inline', '', 0); token_i.content = content; token_i.map = [startLine, state.line - 1]; token_i.children = []; const token_c = state.push('heading_close', 'h' + String(level), -1); token_c.markup = String.fromCharCode(marker); state.parentType = oldParentType; return true; } // Paragraph function paragraph(state, startLine, endLine) { const terminatorRules = state.md.block.ruler.getRules('paragraph'); const oldParentType = state.parentType; let nextLine = startLine + 1; state.parentType = 'paragraph'; // jump line-by-line until empty one or EOF for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) { // this would be a code block normally, but after paragraph // it's considered a lazy continuation regardless of what's there if (state.sCount[nextLine] - state.blkIndent > 3) { continue; } // quirk for blockquotes, this line should already be checked by that rule if (state.sCount[nextLine] < 0) { continue; } // Some tags can terminate paragraph without empty line. let terminate = false; for (let i = 0, l = terminatorRules.length; i < l; i++) { if (terminatorRules[i](state, nextLine, endLine, true)) { terminate = true; break; } } if (terminate) { break; } } const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim(); state.line = nextLine; const token_o = state.push('paragraph_open', 'p', 1); token_o.map = [startLine, state.line]; const token_i = state.push('inline', '', 0); token_i.content = content; token_i.map = [startLine, state.line]; token_i.children = []; state.push('paragraph_close', 'p', -1); state.parentType = oldParentType; return true; } /** internal * class ParserBlock * * Block-level tokenizer. **/ const _rules$1 = [ // First 2 params - rule name & source. Secondary array - list of rules, // which can be terminated by this one. ['table', table, ['paragraph', 'reference']], ['code', code], ['fence', fence, ['paragraph', 'reference', 'blockquote', 'list']], ['blockquote', blockquote, ['paragraph', 'reference', 'blockquote', 'list']], ['hr', hr, ['paragraph', 'reference', 'blockquote', 'list']], ['list', list, ['paragraph', 'reference', 'blockquote']], ['reference', reference], ['html_block', html_block, ['paragraph', 'reference', 'blockquote']], ['heading', heading, ['paragraph', 'reference', 'blockquote']], ['lheading', lheading], ['paragraph', paragraph]]; /** * new ParserBlock() **/ function ParserBlock() { /** * ParserBlock#ruler -> Ruler * * [[Ruler]] instance. Keep configuration of block rules. **/ this.ruler = new Ruler(); for (let i = 0; i < _rules$1.length; i++) { this.ruler.push(_rules$1[i][0], _rules$1[i][1], { alt: (_rules$1[i][2] || []).slice() }); } } // Generate tokens for input range // ParserBlock.prototype.tokenize = function (state, startLine, endLine) { const rules = this.ruler.getRules(''); const len = rules.length; const maxNesting = state.md.options.maxNesting; let line = startLine; let hasEmptyLines = false; while (line < endLine) { state.line = line = state.skipEmptyLines(line); if (line >= endLine) { break; } // Termination condition for nested calls. // Nested calls currently used for blockquotes & lists if (state.sCount[line] < state.blkIndent) { break; } // If nesting level exceeded - skip tail to the end. That's not ordinary // situation and we should not care about content. if (state.level >= maxNesting) { state.line = endLine; break; } // Try all possible rules. // On success, rule should: // // - update `state.line` // - update `state.tokens` // - return true const prevLine = state.line; let ok = false; for (let i = 0; i < len; i++) { ok = rules[i](state, line, endLine, false); if (ok) { if (prevLine >= state.line) { throw new Error("block rule didn't increment state.line"); } break; } } // this can only happen if user disables paragraph rule if (!ok) throw new Error('none of the block rules matched'); // set state.tight if we had an empty line before current tag // i.e. latest empty line should not count state.tight = !hasEmptyLines; // paragraph might "eat" one newline after it in nested lists if (state.isEmpty(state.line - 1)) { hasEmptyLines = true; } line = state.line; if (line < endLine && state.isEmpty(line)) { hasEmptyLines = true; line++; state.line = line; } } }; /** * ParserBlock.parse(str, md, env, outTokens) * * Process input string and push block tokens into `outTokens` **/ ParserBlock.prototype.parse = function (src, md, env, outTokens) { if (!src) { return; } const state = new this.State(src, md, env, outTokens); this.tokenize(state, state.line, state.lineMax); }; ParserBlock.prototype.State = StateBlock; // Inline parser state function StateInline(src, md, env, outTokens) { this.src = src; this.env = env; this.md = md; this.tokens = outTokens; this.tokens_meta = Array(outTokens.length); this.pos = 0; this.posMax = this.src.length; this.level = 0; this.pending = ''; this.pendingLevel = 0; // Stores { start: end } pairs. Useful for backtrack // optimization of pairs parse (emphasis, strikes). this.cache = {}; // List of emphasis-like delimiters for current tag this.delimiters = []; // Stack of delimiter lists for upper level tags this._prev_delimiters = []; // backtick length => last seen position this.backticks = {}; this.backticksScanned = false; // Counter used to disable inline linkify-it execution // inside and markdown links this.linkLevel = 0; } // Flush pending text // StateInline.prototype.pushPending = function () { const token = new Token('text', '', 0); token.content = this.pending; token.level = this.pendingLevel; this.tokens.push(token); this.pending = ''; return token; }; // Push new token to "stream". // If pending text exists - flush it as text token // StateInline.prototype.push = function (type, tag, nesting) { if (this.pending) { this.pushPending(); } const token = new Token(type, tag, nesting); let token_meta = null; if (nesting < 0) { // closing tag this.level--; this.delimiters = this._prev_delimiters.pop(); } token.level = this.level; if (nesting > 0) { // opening tag this.level++; this._prev_delimiters.push(this.delimiters); this.delimiters = []; token_meta = { delimiters: this.delimiters }; } this.pendingLevel = this.level; this.tokens.push(token); this.tokens_meta.push(token_meta); return token; }; // Scan a sequence of emphasis-like markers, and determine whether // it can start an emphasis sequence or end an emphasis sequence. // // - start - position to scan from (it should point at a valid marker); // - canSplitWord - determine if these markers can be found inside a word // StateInline.prototype.scanDelims = function (start, canSplitWord) { const max = this.posMax; const marker = this.src.charCodeAt(start); // treat beginning of the line as a whitespace const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 0x20; let pos = start; while (pos < max && this.src.charCodeAt(pos) === marker) { pos++; } const count = pos - start; // treat end of the line as a whitespace const nextChar = pos < max ? this.src.charCodeAt(pos) : 0x20; const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar)); const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar)); const isLastWhiteSpace = isWhiteSpace(lastChar); const isNextWhiteSpace = isWhiteSpace(nextChar); const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar); const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar); const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar); const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar); return { can_open, can_close, length: count }; }; // re-export Token class to use in block rules StateInline.prototype.Token = Token; // Skip text characters for text token, place those to pending buffer // and increment current pos // Rule to skip pure text // '{}$%@~+=:' reserved for extentions // !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \, ], ^, _, `, {, |, }, or ~ // !!!! Don't confuse with "Markdown ASCII Punctuation" chars // http://spec.commonmark.org/0.15/#ascii-punctuation-character function isTerminatorChar(ch) { switch (ch) { case 0x0A /* \n */: case 0x21 /* ! */: case 0x23 /* # */: case 0x24 /* $ */: case 0x25 /* % */: case 0x26 /* & */: case 0x2A /* * */: case 0x2B /* + */: case 0x2D /* - */: case 0x3A /* : */: case 0x3C /* < */: case 0x3D /* = */: case 0x3E /* > */: case 0x40 /* @ */: case 0x5B /* [ */: case 0x5C /* \ */: case 0x5D /* ] */: case 0x5E /* ^ */: case 0x5F /* _ */: case 0x60 /* ` */: case 0x7B /* { */: case 0x7D /* } */: case 0x7E /* ~ */: return true; default: return false; } } function text(state, silent) { let pos = state.pos; while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) { pos++; } if (pos === state.pos) { return false; } if (!silent) { state.pending += state.src.slice(state.pos, pos); } state.pos = pos; return true; } // Alternative implementation, for memory. // // It costs 10% of performance, but allows extend terminators list, if place it // to `ParserInline` property. Probably, will switch to it sometime, such // flexibility required. /* var TERMINATOR_RE = /[\n!#$%&*+\-:<=>@[\\\]^_`{}~]/; module.exports = function text(state, silent) { var pos = state.pos, idx = state.src.slice(pos).search(TERMINATOR_RE); // first char is terminator -> empty text if (idx === 0) { return false; } // no terminator -> text till end of string if (idx < 0) { if (!silent) { state.pending += state.src.slice(pos); } state.pos = state.src.length; return true; } if (!silent) { state.pending += state.src.slice(pos, pos + idx); } state.pos += idx; return true; }; */ // Process links like https://example.org/ // RFC3986: scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." ) const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i; function linkify(state, silent) { if (!state.md.options.linkify) return false; if (state.linkLevel > 0) return false; const pos = state.pos; const max = state.posMax; if (pos + 3 > max) return false; if (state.src.charCodeAt(pos) !== 0x3A /* : */) return false; if (state.src.charCodeAt(pos + 1) !== 0x2F /* / */) return false; if (state.src.charCodeAt(pos + 2) !== 0x2F /* / */) return false; const match = state.pending.match(SCHEME_RE); if (!match) return false; const proto = match[1]; const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length)); if (!link) return false; let url = link.url; // invalid link, but still detected by linkify somehow; // need to check to prevent infinite loop below if (url.length <= proto.length) return false; // disallow '*' at the end of the link (conflicts with emphasis) url = url.replace(/\*+$/, ''); const fullUrl = state.md.normalizeLink(url); if (!state.md.validateLink(fullUrl)) return false; if (!silent) { state.pending = state.pending.slice(0, -proto.length); const token_o = state.push('link_open', 'a', 1); token_o.attrs = [['href', fullUrl]]; token_o.markup = 'linkify'; token_o.info = 'auto'; const token_t = state.push('text', '', 0); token_t.content = state.md.normalizeLinkText(url); const token_c = state.push('link_close', 'a', -1); token_c.markup = 'linkify'; token_c.info = 'auto'; } state.pos += url.length - proto.length; return true; } // Proceess '\n' function newline(state, silent) { let pos = state.pos; if (state.src.charCodeAt(pos) !== 0x0A /* \n */) { return false; } const pmax = state.pending.length - 1; const max = state.posMax; // ' \n' -> hardbreak // Lookup in pending chars is bad practice! Don't copy to other rules! // Pending string is stored in concat mode, indexed lookups will cause // convertion to flat mode. if (!silent) { if (pmax >= 0 && state.pending.charCodeAt(pmax) === 0x20) { if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 0x20) { // Find whitespaces tail of pending chars. let ws = pmax - 1; while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 0x20) ws--; state.pending = state.pending.slice(0, ws); state.push('hardbreak', 'br', 0); } else { state.pending = state.pending.slice(0, -1); state.push('softbreak', 'br', 0); } } else { state.push('softbreak', 'br', 0); } } pos++; // skip heading spaces for next line while (pos < max && isSpace(state.src.charCodeAt(pos))) { pos++; } state.pos = pos; return true; } // Process escaped chars and hardbreaks const ESCAPED = []; for (let i = 0; i < 256; i++) { ESCAPED.push(0); } '\\!"#$%&\'()*+,./:;<=>?@[]^_`{|}~-'.split('').forEach(function (ch) { ESCAPED[ch.charCodeAt(0)] = 1; }); function escape(state, silent) { let pos = state.pos; const max = state.posMax; if (state.src.charCodeAt(pos) !== 0x5C /* \ */) return false; pos++; // '\' at the end of the inline block if (pos >= max) return false; let ch1 = state.src.charCodeAt(pos); if (ch1 === 0x0A) { if (!silent) { state.push('hardbreak', 'br', 0); } pos++; // skip leading whitespaces from next line while (pos < max) { ch1 = state.src.charCodeAt(pos); if (!isSpace(ch1)) break; pos++; } state.pos = pos; return true; } let escapedStr = state.src[pos]; if (ch1 >= 0xD800 && ch1 <= 0xDBFF && pos + 1 < max) { const ch2 = state.src.charCodeAt(pos + 1); if (ch2 >= 0xDC00 && ch2 <= 0xDFFF) { escapedStr += state.src[pos + 1]; pos++; } } const origStr = '\\' + escapedStr; if (!silent) { const token = state.push('text_special', '', 0); if (ch1 < 256 && ESCAPED[ch1] !== 0) { token.content = escapedStr; } else { token.content = origStr; } token.markup = origStr; token.info = 'escape'; } state.pos = pos + 1; return true; } // Parse backticks function backtick(state, silent) { let pos = state.pos; const ch = state.src.charCodeAt(pos); if (ch !== 0x60 /* ` */) { return false; } const start = pos; pos++; const max = state.posMax; // scan marker length while (pos < max && state.src.charCodeAt(pos) === 0x60 /* ` */) { pos++; } const marker = state.src.slice(start, pos); const openerLength = marker.length; if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) { if (!silent) state.pending += marker; state.pos += openerLength; return true; } let matchEnd = pos; let matchStart; // Nothing found in the cache, scan until the end of the line (or until marker is found) while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) { matchEnd = matchStart + 1; // scan marker length while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60 /* ` */) { matchEnd++; } const closerLength = matchEnd - matchStart; if (closerLength === openerLength) { // Found matching closer length. if (!silent) { const token = state.push('code_inline', 'code', 0); token.markup = marker; token.content = state.src.slice(pos, matchStart).replace(/\n/g, ' ').replace(/^ (.+) $/, '$1'); } state.pos = matchEnd; return true; } // Some different length found, put it in cache as upper limit of where closer can be found state.backticks[closerLength] = matchStart; } // Scanned through the end, didn't find anything state.backticksScanned = true; if (!silent) state.pending += marker; state.pos += openerLength; return true; } // ~~strike through~~ // // Insert each marker as a separate text token, and add it to delimiter list // function strikethrough_tokenize(state, silent) { const start = state.pos; const marker = state.src.charCodeAt(start); if (silent) { return false; } if (marker !== 0x7E /* ~ */) { return false; } const scanned = state.scanDelims(state.pos, true); let len = scanned.length; const ch = String.fromCharCode(marker); if (len < 2) { return false; } let token; if (len % 2) { token = state.push('text', '', 0); token.content = ch; len--; } for (let i = 0; i < len; i += 2) { token = state.push('text', '', 0); token.content = ch + ch; state.delimiters.push({ marker, length: 0, // disable "rule of 3" length checks meant for emphasis token: state.tokens.length - 1, end: -1, open: scanned.can_open, close: scanned.can_close }); } state.pos += scanned.length; return true; } function postProcess$1(state, delimiters) { let token; const loneMarkers = []; const max = delimiters.length; for (let i = 0; i < max; i++) { const startDelim = delimiters[i]; if (startDelim.marker !== 0x7E /* ~ */) { continue; } if (startDelim.end === -1) { continue; } const endDelim = delimiters[startDelim.end]; token = state.tokens[startDelim.token]; token.type = 's_open'; token.tag = 's'; token.nesting = 1; token.markup = '~~'; token.content = ''; token = state.tokens[endDelim.token]; token.type = 's_close'; token.tag = 's'; token.nesting = -1; token.markup = '~~'; token.content = ''; if (state.tokens[endDelim.token - 1].type === 'text' && state.tokens[endDelim.token - 1].content === '~') { loneMarkers.push(endDelim.token - 1); } } // If a marker sequence has an odd number of characters, it's splitted // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the // start of the sequence. // // So, we have to move all those markers after subsequent s_close tags. // while (loneMarkers.length) { const i = loneMarkers.pop(); let j = i + 1; while (j < state.tokens.length && state.tokens[j].type === 's_close') { j++; } j--; if (i !== j) { token = state.tokens[j]; state.tokens[j] = state.tokens[i]; state.tokens[i] = token; } } } // Walk through delimiter list and replace text tokens with tags // function strikethrough_postProcess(state) { const tokens_meta = state.tokens_meta; const max = state.tokens_meta.length; postProcess$1(state, state.delimiters); for (let curr = 0; curr < max; curr++) { if (tokens_meta[curr] && tokens_meta[curr].delimiters) { postProcess$1(state, tokens_meta[curr].delimiters); } } } var r_strikethrough = { tokenize: strikethrough_tokenize, postProcess: strikethrough_postProcess }; // Process *this* and _that_ // // Insert each marker as a separate text token, and add it to delimiter list // function emphasis_tokenize(state, silent) { const start = state.pos; const marker = state.src.charCodeAt(start); if (silent) { return false; } if (marker !== 0x5F /* _ */ && marker !== 0x2A /* * */) { return false; } const scanned = state.scanDelims(state.pos, marker === 0x2A); for (let i = 0; i < scanned.length; i++) { const token = state.push('text', '', 0); token.content = String.fromCharCode(marker); state.delimiters.push({ // Char code of the starting marker (number). // marker, // Total length of these series of delimiters. // length: scanned.length, // A position of the token this delimiter corresponds to. // token: state.tokens.length - 1, // If this delimiter is matched as a valid opener, `end` will be // equal to its position, otherwise it's `-1`. // end: -1, // Boolean flags that determine if this delimiter could open or close // an emphasis. // open: scanned.can_open, close: scanned.can_close }); } state.pos += scanned.length; return true; } function postProcess(state, delimiters) { const max = delimiters.length; for (let i = max - 1; i >= 0; i--) { const startDelim = delimiters[i]; if (startDelim.marker !== 0x5F /* _ */ && startDelim.marker !== 0x2A /* * */) { continue; } // Process only opening markers if (startDelim.end === -1) { continue; } const endDelim = delimiters[startDelim.end]; // If the previous delimiter has the same marker and is adjacent to this one, // merge those into one strong delimiter. // // `whatever` -> `whatever` // const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && // check that first two markers match and adjacent delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && // check that last two markers are adjacent (we can safely assume they match) delimiters[startDelim.end + 1].token === endDelim.token + 1; const ch = String.fromCharCode(startDelim.marker); const token_o = state.tokens[startDelim.token]; token_o.type = isStrong ? 'strong_open' : 'em_open'; token_o.tag = isStrong ? 'strong' : 'em'; token_o.nesting = 1; token_o.markup = isStrong ? ch + ch : ch; token_o.content = ''; const token_c = state.tokens[endDelim.token]; token_c.type = isStrong ? 'strong_close' : 'em_close'; token_c.tag = isStrong ? 'strong' : 'em'; token_c.nesting = -1; token_c.markup = isStrong ? ch + ch : ch; token_c.content = ''; if (isStrong) { state.tokens[delimiters[i - 1].token].content = ''; state.tokens[delimiters[startDelim.end + 1].token].content = ''; i--; } } } // Walk through delimiter list and replace text tokens with tags // function emphasis_post_process(state) { const tokens_meta = state.tokens_meta; const max = state.tokens_meta.length; postProcess(state, state.delimiters); for (let curr = 0; curr < max; curr++) { if (tokens_meta[curr] && tokens_meta[curr].delimiters) { postProcess(state, tokens_meta[curr].delimiters); } } } var r_emphasis = { tokenize: emphasis_tokenize, postProcess: emphasis_post_process }; // Process [link]( "stuff") function link(state, silent) { let code, label, res, ref; let href = ''; let title = ''; let start = state.pos; let parseReference = true; if (state.src.charCodeAt(state.pos) !== 0x5B /* [ */) { return false; } const oldPos = state.pos; const max = state.posMax; const labelStart = state.pos + 1; const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true); // parser failed to find ']', so it's not a valid link if (labelEnd < 0) { return false; } let pos = labelEnd + 1; if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { // // Inline link // // might have found a valid shortcut link, disable reference parsing parseReference = false; // [link]( "title" ) // ^^ skipping these spaces pos++; for (; pos < max; pos++) { code = state.src.charCodeAt(pos); if (!isSpace(code) && code !== 0x0A) { break; } } if (pos >= max) { return false; } // [link]( "title" ) // ^^^^^^ parsing link destination start = pos; res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); if (res.ok) { href = state.md.normalizeLink(res.str); if (state.md.validateLink(href)) { pos = res.pos; } else { href = ''; } // [link]( "title" ) // ^^ skipping these spaces start = pos; for (; pos < max; pos++) { code = state.src.charCodeAt(pos); if (!isSpace(code) && code !== 0x0A) { break; } } // [link]( "title" ) // ^^^^^^^ parsing link title res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); if (pos < max && start !== pos && res.ok) { title = res.str; pos = res.pos; // [link]( "title" ) // ^^ skipping these spaces for (; pos < max; pos++) { code = state.src.charCodeAt(pos); if (!isSpace(code) && code !== 0x0A) { break; } } } } if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { // parsing a valid shortcut link failed, fallback to reference parseReference = true; } pos++; } if (parseReference) { // // Link reference // if (typeof state.env.references === 'undefined') { return false; } if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { start = pos + 1; pos = state.md.helpers.parseLinkLabel(state, pos); if (pos >= 0) { label = state.src.slice(start, pos++); } else { pos = labelEnd + 1; } } else { pos = labelEnd + 1; } // covers label === '' and label === undefined // (collapsed reference link and shortcut reference link respectively) if (!label) { label = state.src.slice(labelStart, labelEnd); } ref = state.env.references[normalizeReference(label)]; if (!ref) { state.pos = oldPos; return false; } href = ref.href; title = ref.title; } // // We found the end of the link, and know for a fact it's a valid link; // so all that's left to do is to call tokenizer. // if (!silent) { state.pos = labelStart; state.posMax = labelEnd; const token_o = state.push('link_open', 'a', 1); const attrs = [['href', href]]; token_o.attrs = attrs; if (title) { attrs.push(['title', title]); } state.linkLevel++; state.md.inline.tokenize(state); state.linkLevel--; state.push('link_close', 'a', -1); } state.pos = pos; state.posMax = max; return true; } // Process ![image]( "title") function image(state, silent) { let code, content, label, pos, ref, res, title, start; let href = ''; const oldPos = state.pos; const max = state.posMax; if (state.src.charCodeAt(state.pos) !== 0x21 /* ! */) { return false; } if (state.src.charCodeAt(state.pos + 1) !== 0x5B /* [ */) { return false; } const labelStart = state.pos + 2; const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false); // parser failed to find ']', so it's not a valid link if (labelEnd < 0) { return false; } pos = labelEnd + 1; if (pos < max && state.src.charCodeAt(pos) === 0x28 /* ( */) { // // Inline link // // [link]( "title" ) // ^^ skipping these spaces pos++; for (; pos < max; pos++) { code = state.src.charCodeAt(pos); if (!isSpace(code) && code !== 0x0A) { break; } } if (pos >= max) { return false; } // [link]( "title" ) // ^^^^^^ parsing link destination start = pos; res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax); if (res.ok) { href = state.md.normalizeLink(res.str); if (state.md.validateLink(href)) { pos = res.pos; } else { href = ''; } } // [link]( "title" ) // ^^ skipping these spaces start = pos; for (; pos < max; pos++) { code = state.src.charCodeAt(pos); if (!isSpace(code) && code !== 0x0A) { break; } } // [link]( "title" ) // ^^^^^^^ parsing link title res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax); if (pos < max && start !== pos && res.ok) { title = res.str; pos = res.pos; // [link]( "title" ) // ^^ skipping these spaces for (; pos < max; pos++) { code = state.src.charCodeAt(pos); if (!isSpace(code) && code !== 0x0A) { break; } } } else { title = ''; } if (pos >= max || state.src.charCodeAt(pos) !== 0x29 /* ) */) { state.pos = oldPos; return false; } pos++; } else { // // Link reference // if (typeof state.env.references === 'undefined') { return false; } if (pos < max && state.src.charCodeAt(pos) === 0x5B /* [ */) { start = pos + 1; pos = state.md.helpers.parseLinkLabel(state, pos); if (pos >= 0) { label = state.src.slice(start, pos++); } else { pos = labelEnd + 1; } } else { pos = labelEnd + 1; } // covers label === '' and label === undefined // (collapsed reference link and shortcut reference link respectively) if (!label) { label = state.src.slice(labelStart, labelEnd); } ref = state.env.references[normalizeReference(label)]; if (!ref) { state.pos = oldPos; return false; } href = ref.href; title = ref.title; } // // We found the end of the link, and know for a fact it's a valid link; // so all that's left to do is to call tokenizer. // if (!silent) { content = state.src.slice(labelStart, labelEnd); const tokens = []; state.md.inline.parse(content, state.md, state.env, tokens); const token = state.push('image', 'img', 0); const attrs = [['src', href], ['alt', '']]; token.attrs = attrs; token.children = tokens; token.content = content; if (title) { attrs.push(['title', title]); } } state.pos = pos; state.posMax = max; return true; } // Process autolinks '' /* eslint max-len:0 */ const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/; /* eslint-disable-next-line no-control-regex */ const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/; function autolink(state, silent) { let pos = state.pos; if (state.src.charCodeAt(pos) !== 0x3C /* < */) { return false; } const start = state.pos; const max = state.posMax; for (;;) { if (++pos >= max) return false; const ch = state.src.charCodeAt(pos); if (ch === 0x3C /* < */) return false; if (ch === 0x3E /* > */) break; } const url = state.src.slice(start + 1, pos); if (AUTOLINK_RE.test(url)) { const fullUrl = state.md.normalizeLink(url); if (!state.md.validateLink(fullUrl)) { return false; } if (!silent) { const token_o = state.push('link_open', 'a', 1); token_o.attrs = [['href', fullUrl]]; token_o.markup = 'autolink'; token_o.info = 'auto'; const token_t = state.push('text', '', 0); token_t.content = state.md.normalizeLinkText(url); const token_c = state.push('link_close', 'a', -1); token_c.markup = 'autolink'; token_c.info = 'auto'; } state.pos += url.length + 2; return true; } if (EMAIL_RE.test(url)) { const fullUrl = state.md.normalizeLink('mailto:' + url); if (!state.md.validateLink(fullUrl)) { return false; } if (!silent) { const token_o = state.push('link_open', 'a', 1); token_o.attrs = [['href', fullUrl]]; token_o.markup = 'autolink'; token_o.info = 'auto'; const token_t = state.push('text', '', 0); token_t.content = state.md.normalizeLinkText(url); const token_c = state.push('link_close', 'a', -1); token_c.markup = 'autolink'; token_c.info = 'auto'; } state.pos += url.length + 2; return true; } return false; } // Process html tags function isLinkOpen(str) { return /^\s]/i.test(str); } function isLinkClose(str) { return /^<\/a\s*>/i.test(str); } function isLetter(ch) { /* eslint no-bitwise:0 */ const lc = ch | 0x20; // to lower case return lc >= 0x61 /* a */ && lc <= 0x7a /* z */; } function html_inline(state, silent) { if (!state.md.options.html) { return false; } // Check start const max = state.posMax; const pos = state.pos; if (state.src.charCodeAt(pos) !== 0x3C /* < */ || pos + 2 >= max) { return false; } // Quick fail on second char const ch = state.src.charCodeAt(pos + 1); if (ch !== 0x21 /* ! */ && ch !== 0x3F /* ? */ && ch !== 0x2F /* / */ && !isLetter(ch)) { return false; } const match = state.src.slice(pos).match(HTML_TAG_RE); if (!match) { return false; } if (!silent) { const token = state.push('html_inline', '', 0); token.content = match[0]; if (isLinkOpen(token.content)) state.linkLevel++; if (isLinkClose(token.content)) state.linkLevel--; } state.pos += match[0].length; return true; } // Process html entity - {, ¯, ", ... const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i; const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i; function entity(state, silent) { const pos = state.pos; const max = state.posMax; if (state.src.charCodeAt(pos) !== 0x26 /* & */) return false; if (pos + 1 >= max) return false; const ch = state.src.charCodeAt(pos + 1); if (ch === 0x23 /* # */) { const match = state.src.slice(pos).match(DIGITAL_RE); if (match) { if (!silent) { const code = match[1][0].toLowerCase() === 'x' ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10); const token = state.push('text_special', '', 0); token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(0xFFFD); token.markup = match[0]; token.info = 'entity'; } state.pos += match[0].length; return true; } } else { const match = state.src.slice(pos).match(NAMED_RE); if (match) { const decoded = entities.decodeHTML(match[0]); if (decoded !== match[0]) { if (!silent) { const token = state.push('text_special', '', 0); token.content = decoded; token.markup = match[0]; token.info = 'entity'; } state.pos += match[0].length; return true; } } } return false; } // For each opening emphasis-like marker find a matching closing one // function processDelimiters(delimiters) { const openersBottom = {}; const max = delimiters.length; if (!max) return; // headerIdx is the first delimiter of the current (where closer is) delimiter run let headerIdx = 0; let lastTokenIdx = -2; // needs any value lower than -1 const jumps = []; for (let closerIdx = 0; closerIdx < max; closerIdx++) { const closer = delimiters[closerIdx]; jumps.push(0); // markers belong to same delimiter run if: // - they have adjacent tokens // - AND markers are the same // if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) { headerIdx = closerIdx; } lastTokenIdx = closer.token; // Length is only used for emphasis-specific "rule of 3", // if it's not defined (in strikethrough or 3rd party plugins), // we can default it to 0 to disable those checks. // closer.length = closer.length || 0; if (!closer.close) continue; // Previously calculated lower bounds (previous fails) // for each marker, each delimiter length modulo 3, // and for whether this closer can be an opener; // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460 /* eslint-disable-next-line no-prototype-builtins */ if (!openersBottom.hasOwnProperty(closer.marker)) { openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]; } const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3]; let openerIdx = headerIdx - jumps[headerIdx] - 1; let newMinOpenerIdx = openerIdx; for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) { const opener = delimiters[openerIdx]; if (opener.marker !== closer.marker) continue; if (opener.open && opener.end < 0) { let isOddMatch = false; // from spec: // // If one of the delimiters can both open and close emphasis, then the // sum of the lengths of the delimiter runs containing the opening and // closing delimiters must not be a multiple of 3 unless both lengths // are multiples of 3. // if (opener.close || closer.open) { if ((opener.length + closer.length) % 3 === 0) { if (opener.length % 3 !== 0 || closer.length % 3 !== 0) { isOddMatch = true; } } } if (!isOddMatch) { // If previous delimiter cannot be an opener, we can safely skip // the entire sequence in future checks. This is required to make // sure algorithm has linear complexity (see *_*_*_*_*_... case). // const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0; jumps[closerIdx] = closerIdx - openerIdx + lastJump; jumps[openerIdx] = lastJump; closer.open = false; opener.end = closerIdx; opener.close = false; newMinOpenerIdx = -1; // treat next token as start of run, // it optimizes skips in **<...>**a**<...>** pathological case lastTokenIdx = -2; break; } } } if (newMinOpenerIdx !== -1) { // If match for this delimiter run failed, we want to set lower bound for // future lookups. This is required to make sure algorithm has linear // complexity. // // See details here: // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442 // openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx; } } } function link_pairs(state) { const tokens_meta = state.tokens_meta; const max = state.tokens_meta.length; processDelimiters(state.delimiters); for (let curr = 0; curr < max; curr++) { if (tokens_meta[curr] && tokens_meta[curr].delimiters) { processDelimiters(tokens_meta[curr].delimiters); } } } // Clean up tokens after emphasis and strikethrough postprocessing: // merge adjacent text nodes into one and re-calculate all token levels // // This is necessary because initially emphasis delimiter markers (*, _, ~) // are treated as their own separate text tokens. Then emphasis rule either // leaves them as text (needed to merge with adjacent text) or turns them // into opening/closing tags (which messes up levels inside). // function fragments_join(state) { let curr, last; let level = 0; const tokens = state.tokens; const max = state.tokens.length; for (curr = last = 0; curr < max; curr++) { // re-calculate levels after emphasis/strikethrough turns some text nodes // into opening/closing tags if (tokens[curr].nesting < 0) level--; // closing tag tokens[curr].level = level; if (tokens[curr].nesting > 0) level++; // opening tag if (tokens[curr].type === 'text' && curr + 1 < max && tokens[curr + 1].type === 'text') { // collapse two adjacent text nodes tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content; } else { if (curr !== last) { tokens[last] = tokens[curr]; } last++; } } if (curr !== last) { tokens.length = last; } } /** internal * class ParserInline * * Tokenizes paragraph content. **/ // Parser rules const _rules = [['text', text], ['linkify', linkify], ['newline', newline], ['escape', escape], ['backticks', backtick], ['strikethrough', r_strikethrough.tokenize], ['emphasis', r_emphasis.tokenize], ['link', link], ['image', image], ['autolink', autolink], ['html_inline', html_inline], ['entity', entity]]; // `rule2` ruleset was created specifically for emphasis/strikethrough // post-processing and may be changed in the future. // // Don't use this for anything except pairs (plugins working with `balance_pairs`). // const _rules2 = [['balance_pairs', link_pairs], ['strikethrough', r_strikethrough.postProcess], ['emphasis', r_emphasis.postProcess], // rules for pairs separate '**' into its own text tokens, which may be left unused, // rule below merges unused segments back with the rest of the text ['fragments_join', fragments_join]]; /** * new ParserInline() **/ function ParserInline() { /** * ParserInline#ruler -> Ruler * * [[Ruler]] instance. Keep configuration of inline rules. **/ this.ruler = new Ruler(); for (let i = 0; i < _rules.length; i++) { this.ruler.push(_rules[i][0], _rules[i][1]); } /** * ParserInline#ruler2 -> Ruler * * [[Ruler]] instance. Second ruler used for post-processing * (e.g. in emphasis-like rules). **/ this.ruler2 = new Ruler(); for (let i = 0; i < _rules2.length; i++) { this.ruler2.push(_rules2[i][0], _rules2[i][1]); } } // Skip single token by running all rules in validation mode; // returns `true` if any rule reported success // ParserInline.prototype.skipToken = function (state) { const pos = state.pos; const rules = this.ruler.getRules(''); const len = rules.length; const maxNesting = state.md.options.maxNesting; const cache = state.cache; if (typeof cache[pos] !== 'undefined') { state.pos = cache[pos]; return; } let ok = false; if (state.level < maxNesting) { for (let i = 0; i < len; i++) { // Increment state.level and decrement it later to limit recursion. // It's harmless to do here, because no tokens are created. But ideally, // we'd need a separate private state variable for this purpose. // state.level++; ok = rules[i](state, true); state.level--; if (ok) { if (pos >= state.pos) { throw new Error("inline rule didn't increment state.pos"); } break; } } } else { // Too much nesting, just skip until the end of the paragraph. // // NOTE: this will cause links to behave incorrectly in the following case, // when an amount of `[` is exactly equal to `maxNesting + 1`: // // [[[[[[[[[[[[[[[[[[[[[foo]() // // TODO: remove this workaround when CM standard will allow nested links // (we can replace it by preventing links from being parsed in // validation mode) // state.pos = state.posMax; } if (!ok) { state.pos++; } cache[pos] = state.pos; }; // Generate tokens for input range // ParserInline.prototype.tokenize = function (state) { const rules = this.ruler.getRules(''); const len = rules.length; const end = state.posMax; const maxNesting = state.md.options.maxNesting; while (state.pos < end) { // Try all possible rules. // On success, rule should: // // - update `state.pos` // - update `state.tokens` // - return true const prevPos = state.pos; let ok = false; if (state.level < maxNesting) { for (let i = 0; i < len; i++) { ok = rules[i](state, false); if (ok) { if (prevPos >= state.pos) { throw new Error("inline rule didn't increment state.pos"); } break; } } } if (ok) { if (state.pos >= end) { break; } continue; } state.pending += state.src[state.pos++]; } if (state.pending) { state.pushPending(); } }; /** * ParserInline.parse(str, md, env, outTokens) * * Process input string and push inline tokens into `outTokens` **/ ParserInline.prototype.parse = function (str, md, env, outTokens) { const state = new this.State(str, md, env, outTokens); this.tokenize(state); const rules = this.ruler2.getRules(''); const len = rules.length; for (let i = 0; i < len; i++) { rules[i](state); } }; ParserInline.prototype.State = StateInline; // markdown-it default options var cfg_default = { options: { // Enable HTML tags in source html: false, // Use '/' to close single tags (
) xhtmlOut: false, // Convert '\n' in paragraphs into
breaks: false, // CSS language prefix for fenced blocks langPrefix: 'language-', // autoconvert URL-like texts to links linkify: false, // Enable some language-neutral replacements + quotes beautification typographer: false, // Double + single quotes replacement pairs, when typographer enabled, // and smartquotes on. Could be either a String or an Array. // // For example, you can use '«»„“' for Russian, '„“‚‘' for German, // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */ // Highlighter function. Should return escaped HTML, // or '' if the source string is not changed and should be escaped externaly. // If result starts with ) xhtmlOut: false, // Convert '\n' in paragraphs into
breaks: false, // CSS language prefix for fenced blocks langPrefix: 'language-', // autoconvert URL-like texts to links linkify: false, // Enable some language-neutral replacements + quotes beautification typographer: false, // Double + single quotes replacement pairs, when typographer enabled, // and smartquotes on. Could be either a String or an Array. // // For example, you can use '«»„“' for Russian, '„“‚‘' for German, // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */ // Highlighter function. Should return escaped HTML, // or '' if the source string is not changed and should be escaped externaly. // If result starts with ) xhtmlOut: true, // Convert '\n' in paragraphs into
breaks: false, // CSS language prefix for fenced blocks langPrefix: 'language-', // autoconvert URL-like texts to links linkify: false, // Enable some language-neutral replacements + quotes beautification typographer: false, // Double + single quotes replacement pairs, when typographer enabled, // and smartquotes on. Could be either a String or an Array. // // For example, you can use '«»„“' for Russian, '„“‚‘' for German, // and ['«\xA0', '\xA0»', '‹\xA0', '\xA0›'] for French (including nbsp). quotes: '\u201c\u201d\u2018\u2019', /* “”‘’ */ // Highlighter function. Should return escaped HTML, // or '' if the source string is not changed and should be escaped externaly. // If result starts with = 0) { try { parsed.hostname = punycode.toASCII(parsed.hostname); } catch (er) {/**/} } } return mdurl__namespace.encode(mdurl__namespace.format(parsed)); } function normalizeLinkText(url) { const parsed = mdurl__namespace.parse(url, true); if (parsed.hostname) { // Encode hostnames in urls like: // `http://host/`, `https://host/`, `mailto:user@host`, `//host/` // // We don't encode unknown schemas, because it's likely that we encode // something we shouldn't (e.g. `skype:name` treated as `skype:host`) // if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) { try { parsed.hostname = punycode.toUnicode(parsed.hostname); } catch (er) {/**/} } } // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720 return mdurl__namespace.decode(mdurl__namespace.format(parsed), mdurl__namespace.decode.defaultChars + '%'); } /** * class MarkdownIt * * Main parser/renderer class. * * ##### Usage * * ```javascript * // node.js, "classic" way: * var MarkdownIt = require('markdown-it'), * md = new MarkdownIt(); * var result = md.render('# markdown-it rulezz!'); * * // node.js, the same, but with sugar: * var md = require('markdown-it')(); * var result = md.render('# markdown-it rulezz!'); * * // browser without AMD, added to "window" on script load * // Note, there are no dash. * var md = window.markdownit(); * var result = md.render('# markdown-it rulezz!'); * ``` * * Single line rendering, without paragraph wrap: * * ```javascript * var md = require('markdown-it')(); * var result = md.renderInline('__markdown-it__ rulezz!'); * ``` **/ /** * new MarkdownIt([presetName, options]) * - presetName (String): optional, `commonmark` / `zero` * - options (Object) * * Creates parser instanse with given config. Can be called without `new`. * * ##### presetName * * MarkdownIt provides named presets as a convenience to quickly * enable/disable active syntax rules and options for common use cases. * * - ["commonmark"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) - * configures parser to strict [CommonMark](http://commonmark.org/) mode. * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) - * similar to GFM, used when no preset name given. Enables all available rules, * but still without html, typographer & autolinker. * - ["zero"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) - * all rules disabled. Useful to quickly setup your config via `.enable()`. * For example, when you need only `bold` and `italic` markup and nothing else. * * ##### options: * * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful! * That's not safe! You may need external sanitizer to protect output from XSS. * It's better to extend features via plugins, instead of enabling HTML. * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags * (`
`). This is needed only for full CommonMark compatibility. In real * world you will need HTML output. * - __breaks__ - `false`. Set `true` to convert `\n` in paragraphs into `
`. * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks. * Can be useful for external highlighters. * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links. * - __typographer__ - `false`. Set `true` to enable [some language-neutral * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) + * quotes beautification (smartquotes). * - __quotes__ - `“”‘’`, String or Array. Double + single quotes replacement * pairs, when typographer enabled and smartquotes on. For example, you can * use `'«»„“'` for Russian, `'„“‚‘'` for German, and * `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp). * - __highlight__ - `null`. Highlighter function for fenced code blocks. * Highlighter `function (str, lang)` should return escaped HTML. It can also * return empty string if the source was not changed and should be escaped * externaly. If result starts with ` or ``): * * ```javascript * var hljs = require('highlight.js') // https://highlightjs.org/ * * // Actual default values * var md = require('markdown-it')({ * highlight: function (str, lang) { * if (lang && hljs.getLanguage(lang)) { * try { * return '
' +
 *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +
 *                '
'; * } catch (__) {} * } * * return '
' + md.utils.escapeHtml(str) + '
'; * } * }); * ``` * **/ function MarkdownIt(presetName, options) { if (!(this instanceof MarkdownIt)) { return new MarkdownIt(presetName, options); } if (!options) { if (!isString(presetName)) { options = presetName || {}; presetName = 'default'; } } /** * MarkdownIt#inline -> ParserInline * * Instance of [[ParserInline]]. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.inline = new ParserInline(); /** * MarkdownIt#block -> ParserBlock * * Instance of [[ParserBlock]]. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.block = new ParserBlock(); /** * MarkdownIt#core -> Core * * Instance of [[Core]] chain executor. You may need it to add new rules when * writing plugins. For simple rules control use [[MarkdownIt.disable]] and * [[MarkdownIt.enable]]. **/ this.core = new Core(); /** * MarkdownIt#renderer -> Renderer * * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering * rules for new token types, generated by plugins. * * ##### Example * * ```javascript * var md = require('markdown-it')(); * * function myToken(tokens, idx, options, env, self) { * //... * return result; * }; * * md.renderer.rules['my_token'] = myToken * ``` * * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs). **/ this.renderer = new Renderer(); /** * MarkdownIt#linkify -> LinkifyIt * * [linkify-it](https://github.com/markdown-it/linkify-it) instance. * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs) * rule. **/ this.linkify = new LinkifyIt(); /** * MarkdownIt#validateLink(url) -> Boolean * * Link validation function. CommonMark allows too much in links. By default * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas * except some embedded image types. * * You can change this behaviour: * * ```javascript * var md = require('markdown-it')(); * // enable everything * md.validateLink = function () { return true; } * ``` **/ this.validateLink = validateLink; /** * MarkdownIt#normalizeLink(url) -> String * * Function used to encode link url to a machine-readable format, * which includes url-encoding, punycode, etc. **/ this.normalizeLink = normalizeLink; /** * MarkdownIt#normalizeLinkText(url) -> String * * Function used to decode link url to a human-readable format` **/ this.normalizeLinkText = normalizeLinkText; // Expose utils & helpers for easy acces from plugins /** * MarkdownIt#utils -> utils * * Assorted utility functions, useful to write plugins. See details * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs). **/ this.utils = utils; /** * MarkdownIt#helpers -> helpers * * Link components parser functions, useful to write plugins. See details * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers). **/ this.helpers = assign({}, helpers); this.options = {}; this.configure(presetName); if (options) { this.set(options); } } /** chainable * MarkdownIt.set(options) * * Set parser options (in the same format as in constructor). Probably, you * will never need it, but you can change options after constructor call. * * ##### Example * * ```javascript * var md = require('markdown-it')() * .set({ html: true, breaks: true }) * .set({ typographer, true }); * ``` * * __Note:__ To achieve the best possible performance, don't modify a * `markdown-it` instance options on the fly. If you need multiple configurations * it's best to create multiple instances and initialize each with separate * config. **/ MarkdownIt.prototype.set = function (options) { assign(this.options, options); return this; }; /** chainable, internal * MarkdownIt.configure(presets) * * Batch load of all options and compenent settings. This is internal method, * and you probably will not need it. But if you will - see available presets * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets) * * We strongly recommend to use presets instead of direct config loads. That * will give better compatibility with next versions. **/ MarkdownIt.prototype.configure = function (presets) { const self = this; if (isString(presets)) { const presetName = presets; presets = config[presetName]; if (!presets) { throw new Error('Wrong `markdown-it` preset "' + presetName + '", check name'); } } if (!presets) { throw new Error('Wrong `markdown-it` preset, can\'t be empty'); } if (presets.options) { self.set(presets.options); } if (presets.components) { Object.keys(presets.components).forEach(function (name) { if (presets.components[name].rules) { self[name].ruler.enableOnly(presets.components[name].rules); } if (presets.components[name].rules2) { self[name].ruler2.enableOnly(presets.components[name].rules2); } }); } return this; }; /** chainable * MarkdownIt.enable(list, ignoreInvalid) * - list (String|Array): rule name or list of rule names to enable * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. * * Enable list or rules. It will automatically find appropriate components, * containing rules with given names. If rule not found, and `ignoreInvalid` * not set - throws exception. * * ##### Example * * ```javascript * var md = require('markdown-it')() * .enable(['sub', 'sup']) * .disable('smartquotes'); * ``` **/ MarkdownIt.prototype.enable = function (list, ignoreInvalid) { let result = []; if (!Array.isArray(list)) { list = [list]; } ['core', 'block', 'inline'].forEach(function (chain) { result = result.concat(this[chain].ruler.enable(list, true)); }, this); result = result.concat(this.inline.ruler2.enable(list, true)); const missed = list.filter(function (name) { return result.indexOf(name) < 0; }); if (missed.length && !ignoreInvalid) { throw new Error('MarkdownIt. Failed to enable unknown rule(s): ' + missed); } return this; }; /** chainable * MarkdownIt.disable(list, ignoreInvalid) * - list (String|Array): rule name or list of rule names to disable. * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found. * * The same as [[MarkdownIt.enable]], but turn specified rules off. **/ MarkdownIt.prototype.disable = function (list, ignoreInvalid) { let result = []; if (!Array.isArray(list)) { list = [list]; } ['core', 'block', 'inline'].forEach(function (chain) { result = result.concat(this[chain].ruler.disable(list, true)); }, this); result = result.concat(this.inline.ruler2.disable(list, true)); const missed = list.filter(function (name) { return result.indexOf(name) < 0; }); if (missed.length && !ignoreInvalid) { throw new Error('MarkdownIt. Failed to disable unknown rule(s): ' + missed); } return this; }; /** chainable * MarkdownIt.use(plugin, params) * * Load specified plugin with given params into current parser instance. * It's just a sugar to call `plugin(md, params)` with curring. * * ##### Example * * ```javascript * var iterator = require('markdown-it-for-inline'); * var md = require('markdown-it')() * .use(iterator, 'foo_replace', 'text', function (tokens, idx) { * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar'); * }); * ``` **/ MarkdownIt.prototype.use = function (plugin /*, params, ... */) { const args = [this].concat(Array.prototype.slice.call(arguments, 1)); plugin.apply(plugin, args); return this; }; /** internal * MarkdownIt.parse(src, env) -> Array * - src (String): source string * - env (Object): environment sandbox * * Parse input string and return list of block tokens (special token type * "inline" will contain list of inline tokens). You should not call this * method directly, until you write custom renderer (for example, to produce * AST). * * `env` is used to pass data between "distributed" rules and return additional * metadata like reference info, needed for the renderer. It also can be used to * inject data in specific cases. Usually, you will be ok to pass `{}`, * and then pass updated object to renderer. **/ MarkdownIt.prototype.parse = function (src, env) { if (typeof src !== 'string') { throw new Error('Input data should be a String'); } const state = new this.core.State(src, this, env); this.core.process(state); return state.tokens; }; /** * MarkdownIt.render(src [, env]) -> String * - src (String): source string * - env (Object): environment sandbox * * Render markdown string into html. It does all magic for you :). * * `env` can be used to inject additional metadata (`{}` by default). * But you will not need it with high probability. See also comment * in [[MarkdownIt.parse]]. **/ MarkdownIt.prototype.render = function (src, env) { env = env || {}; return this.renderer.render(this.parse(src, env), this.options, env); }; /** internal * MarkdownIt.parseInline(src, env) -> Array * - src (String): source string * - env (Object): environment sandbox * * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the * block tokens list with the single `inline` element, containing parsed inline * tokens in `children` property. Also updates `env` object. **/ MarkdownIt.prototype.parseInline = function (src, env) { const state = new this.core.State(src, this, env); state.inlineMode = true; this.core.process(state); return state.tokens; }; /** * MarkdownIt.renderInline(src [, env]) -> String * - src (String): source string * - env (Object): environment sandbox * * Similar to [[MarkdownIt.render]] but for single paragraph content. Result * will NOT be wrapped into `

` tags. **/ MarkdownIt.prototype.renderInline = function (src, env) { env = env || {}; return this.renderer.render(this.parseInline(src, env), this.options, env); }; module.exports = MarkdownIt; /***/ }), /***/ "../node_modules/mdurl/build/index.cjs.js": /*!************************************************!*\ !*** ../node_modules/mdurl/build/index.cjs.js ***! \************************************************/ /***/ (function(__unused_webpack_module, exports) { /* eslint-disable no-bitwise */ const decodeCache = {}; function getDecodeCache(exclude) { let cache = decodeCache[exclude]; if (cache) { return cache; } cache = decodeCache[exclude] = []; for (let i = 0; i < 128; i++) { const ch = String.fromCharCode(i); cache.push(ch); } for (let i = 0; i < exclude.length; i++) { const ch = exclude.charCodeAt(i); cache[ch] = '%' + ('0' + ch.toString(16).toUpperCase()).slice(-2); } return cache; } // Decode percent-encoded string. // function decode(string, exclude) { if (typeof exclude !== 'string') { exclude = decode.defaultChars; } const cache = getDecodeCache(exclude); return string.replace(/(%[a-f0-9]{2})+/gi, function (seq) { let result = ''; for (let i = 0, l = seq.length; i < l; i += 3) { const b1 = parseInt(seq.slice(i + 1, i + 3), 16); if (b1 < 0x80) { result += cache[b1]; continue; } if ((b1 & 0xE0) === 0xC0 && i + 3 < l) { // 110xxxxx 10xxxxxx const b2 = parseInt(seq.slice(i + 4, i + 6), 16); if ((b2 & 0xC0) === 0x80) { const chr = b1 << 6 & 0x7C0 | b2 & 0x3F; if (chr < 0x80) { result += '\ufffd\ufffd'; } else { result += String.fromCharCode(chr); } i += 3; continue; } } if ((b1 & 0xF0) === 0xE0 && i + 6 < l) { // 1110xxxx 10xxxxxx 10xxxxxx const b2 = parseInt(seq.slice(i + 4, i + 6), 16); const b3 = parseInt(seq.slice(i + 7, i + 9), 16); if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80) { const chr = b1 << 12 & 0xF000 | b2 << 6 & 0xFC0 | b3 & 0x3F; if (chr < 0x800 || chr >= 0xD800 && chr <= 0xDFFF) { result += '\ufffd\ufffd\ufffd'; } else { result += String.fromCharCode(chr); } i += 6; continue; } } if ((b1 & 0xF8) === 0xF0 && i + 9 < l) { // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx const b2 = parseInt(seq.slice(i + 4, i + 6), 16); const b3 = parseInt(seq.slice(i + 7, i + 9), 16); const b4 = parseInt(seq.slice(i + 10, i + 12), 16); if ((b2 & 0xC0) === 0x80 && (b3 & 0xC0) === 0x80 && (b4 & 0xC0) === 0x80) { let chr = b1 << 18 & 0x1C0000 | b2 << 12 & 0x3F000 | b3 << 6 & 0xFC0 | b4 & 0x3F; if (chr < 0x10000 || chr > 0x10FFFF) { result += '\ufffd\ufffd\ufffd\ufffd'; } else { chr -= 0x10000; result += String.fromCharCode(0xD800 + (chr >> 10), 0xDC00 + (chr & 0x3FF)); } i += 9; continue; } } result += '\ufffd'; } return result; }); } decode.defaultChars = ';/?:@&=+$,#'; decode.componentChars = ''; const encodeCache = {}; // Create a lookup array where anything but characters in `chars` string // and alphanumeric chars is percent-encoded. // function getEncodeCache(exclude) { let cache = encodeCache[exclude]; if (cache) { return cache; } cache = encodeCache[exclude] = []; for (let i = 0; i < 128; i++) { const ch = String.fromCharCode(i); if (/^[0-9a-z]$/i.test(ch)) { // always allow unencoded alphanumeric characters cache.push(ch); } else { cache.push('%' + ('0' + i.toString(16).toUpperCase()).slice(-2)); } } for (let i = 0; i < exclude.length; i++) { cache[exclude.charCodeAt(i)] = exclude[i]; } return cache; } // Encode unsafe characters with percent-encoding, skipping already // encoded sequences. // // - string - string to encode // - exclude - list of characters to ignore (in addition to a-zA-Z0-9) // - keepEscaped - don't encode '%' in a correct escape sequence (default: true) // function encode(string, exclude, keepEscaped) { if (typeof exclude !== 'string') { // encode(string, keepEscaped) keepEscaped = exclude; exclude = encode.defaultChars; } if (typeof keepEscaped === 'undefined') { keepEscaped = true; } const cache = getEncodeCache(exclude); let result = ''; for (let i = 0, l = string.length; i < l; i++) { const code = string.charCodeAt(i); if (keepEscaped && code === 0x25 /* % */ && i + 2 < l) { if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) { result += string.slice(i, i + 3); i += 2; continue; } } if (code < 128) { result += cache[code]; continue; } if (code >= 0xD800 && code <= 0xDFFF) { if (code >= 0xD800 && code <= 0xDBFF && i + 1 < l) { const nextCode = string.charCodeAt(i + 1); if (nextCode >= 0xDC00 && nextCode <= 0xDFFF) { result += encodeURIComponent(string[i] + string[i + 1]); i++; continue; } } result += '%EF%BF%BD'; continue; } result += encodeURIComponent(string[i]); } return result; } encode.defaultChars = ";/?:@&=+$,-_.!~*'()#"; encode.componentChars = "-_.!~*'()"; function format(url) { let result = ''; result += url.protocol || ''; result += url.slashes ? '//' : ''; result += url.auth ? url.auth + '@' : ''; if (url.hostname && url.hostname.indexOf(':') !== -1) { // ipv6 address result += '[' + url.hostname + ']'; } else { result += url.hostname || ''; } result += url.port ? ':' + url.port : ''; result += url.pathname || ''; result += url.search || ''; result += url.hash || ''; return result; } // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to permit // persons to whom the Software is furnished to do so, subject to the // following conditions: // // The above copyright notice and this permission notice shall be included // in all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. // // Changes from joyent/node: // // 1. No leading slash in paths, // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/` // // 2. Backslashes are not replaced with slashes, // so `http:\\example.org\` is treated like a relative path // // 3. Trailing colon is treated like a part of the path, // i.e. in `http://example.org:foo` pathname is `:foo` // // 4. Nothing is URL-encoded in the resulting object, // (in joyent/node some chars in auth and paths are encoded) // // 5. `url.parse()` does not have `parseQueryString` argument // // 6. Removed extraneous result properties: `host`, `path`, `query`, etc., // which can be constructed using other parts of the url. // function Url() { this.protocol = null; this.slashes = null; this.auth = null; this.port = null; this.hostname = null; this.hash = null; this.search = null; this.pathname = null; } // Reference: RFC 3986, RFC 1808, RFC 2396 // define these here so at least they only have to be // compiled once on the first module load. const protocolPattern = /^([a-z0-9.+-]+:)/i; const portPattern = /:[0-9]*$/; // Special case for a simple path URL /* eslint-disable-next-line no-useless-escape */ const simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/; // RFC 2396: characters reserved for delimiting URLs. // We actually just auto-escape these. const delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t']; // RFC 2396: characters not allowed for various reasons. const unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims); // Allowed by RFCs, but cause of XSS attacks. Always escape these. const autoEscape = ['\''].concat(unwise); // Characters that are never ever allowed in a hostname. // Note that any invalid chars are also handled, but these // are the ones that are *expected* to be seen, so we fast-path // them. const nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape); const hostEndingChars = ['/', '?', '#']; const hostnameMaxLen = 255; const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/; const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/; // protocols that can allow "unsafe" and "unwise" chars. // protocols that never have a hostname. const hostlessProtocol = { javascript: true, 'javascript:': true }; // protocols that always contain a // bit. const slashedProtocol = { http: true, https: true, ftp: true, gopher: true, file: true, 'http:': true, 'https:': true, 'ftp:': true, 'gopher:': true, 'file:': true }; function urlParse(url, slashesDenoteHost) { if (url && url instanceof Url) return url; const u = new Url(); u.parse(url, slashesDenoteHost); return u; } Url.prototype.parse = function (url, slashesDenoteHost) { let lowerProto, hec, slashes; let rest = url; // trim before proceeding. // This is to support parse stuff like " http://foo.com \n" rest = rest.trim(); if (!slashesDenoteHost && url.split('#').length === 1) { // Try fast path regexp const simplePath = simplePathPattern.exec(rest); if (simplePath) { this.pathname = simplePath[1]; if (simplePath[2]) { this.search = simplePath[2]; } return this; } } let proto = protocolPattern.exec(rest); if (proto) { proto = proto[0]; lowerProto = proto.toLowerCase(); this.protocol = proto; rest = rest.substr(proto.length); } // figure out if it's got a host // user@server is *always* interpreted as a hostname, and url // resolution will treat //foo/bar as host=foo,path=bar because that's // how the browser resolves relative URLs. /* eslint-disable-next-line no-useless-escape */ if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { slashes = rest.substr(0, 2) === '//'; if (slashes && !(proto && hostlessProtocol[proto])) { rest = rest.substr(2); this.slashes = true; } } if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) { // there's a hostname. // the first instance of /, ?, ;, or # ends the host. // // If there is an @ in the hostname, then non-host chars *are* allowed // to the left of the last @ sign, unless some host-ending character // comes *before* the @-sign. // URLs are obnoxious. // // ex: // http://a@b@c/ => user:a@b host:c // http://a@b?@c => user:a host:c path:/?@c // v0.12 TODO(isaacs): This is not quite how Chrome does things. // Review our test case against browsers more comprehensively. // find the first instance of any hostEndingChars let hostEnd = -1; for (let i = 0; i < hostEndingChars.length; i++) { hec = rest.indexOf(hostEndingChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; } } // at this point, either we have an explicit point where the // auth portion cannot go past, or the last @ char is the decider. let auth, atSign; if (hostEnd === -1) { // atSign can be anywhere. atSign = rest.lastIndexOf('@'); } else { // atSign must be in auth portion. // http://a@b/c@d => host:b auth:a path:/c@d atSign = rest.lastIndexOf('@', hostEnd); } // Now we have a portion which is definitely the auth. // Pull that off. if (atSign !== -1) { auth = rest.slice(0, atSign); rest = rest.slice(atSign + 1); this.auth = auth; } // the host is the remaining to the left of the first non-host char hostEnd = -1; for (let i = 0; i < nonHostChars.length; i++) { hec = rest.indexOf(nonHostChars[i]); if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; } } // if we still have not hit it, then the entire thing is a host. if (hostEnd === -1) { hostEnd = rest.length; } if (rest[hostEnd - 1] === ':') { hostEnd--; } const host = rest.slice(0, hostEnd); rest = rest.slice(hostEnd); // pull out port. this.parseHost(host); // we've indicated that there is a hostname, // so even if it's empty, it has to be present. this.hostname = this.hostname || ''; // if hostname begins with [ and ends with ] // assume that it's an IPv6 address. const ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']'; // validate a little. if (!ipv6Hostname) { const hostparts = this.hostname.split(/\./); for (let i = 0, l = hostparts.length; i < l; i++) { const part = hostparts[i]; if (!part) { continue; } if (!part.match(hostnamePartPattern)) { let newpart = ''; for (let j = 0, k = part.length; j < k; j++) { if (part.charCodeAt(j) > 127) { // we replace non-ASCII char with a temporary placeholder // we need this to make sure size of hostname is not // broken by replacing non-ASCII by nothing newpart += 'x'; } else { newpart += part[j]; } } // we test again with ASCII char only if (!newpart.match(hostnamePartPattern)) { const validParts = hostparts.slice(0, i); const notHost = hostparts.slice(i + 1); const bit = part.match(hostnamePartStart); if (bit) { validParts.push(bit[1]); notHost.unshift(bit[2]); } if (notHost.length) { rest = notHost.join('.') + rest; } this.hostname = validParts.join('.'); break; } } } } if (this.hostname.length > hostnameMaxLen) { this.hostname = ''; } // strip [ and ] from the hostname // the host field still retains them, though if (ipv6Hostname) { this.hostname = this.hostname.substr(1, this.hostname.length - 2); } } // chop off from the tail first. const hash = rest.indexOf('#'); if (hash !== -1) { // got a fragment string. this.hash = rest.substr(hash); rest = rest.slice(0, hash); } const qm = rest.indexOf('?'); if (qm !== -1) { this.search = rest.substr(qm); rest = rest.slice(0, qm); } if (rest) { this.pathname = rest; } if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) { this.pathname = ''; } return this; }; Url.prototype.parseHost = function (host) { let port = portPattern.exec(host); if (port) { port = port[0]; if (port !== ':') { this.port = port.substr(1); } host = host.substr(0, host.length - port.length); } if (host) { this.hostname = host; } }; exports.decode = decode; exports.encode = encode; exports.format = format; exports.parse = urlParse; /***/ }), /***/ "../node_modules/uc.micro/build/index.cjs.js": /*!***************************************************!*\ !*** ../node_modules/uc.micro/build/index.cjs.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports) { var regex$5 = /[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/; var regex$4 = /[\0-\x1F\x7F-\x9F]/; var regex$3 = /[\xAD\u0600-\u0605\u061C\u06DD\u070F\u0890\u0891\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD80D[\uDC30-\uDC3F]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/; var regex$2 = /[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061D-\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C77\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1B7D\u1B7E\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4F\u2E52-\u2E5D\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDEAD\uDF55-\uDF59\uDF86-\uDF89]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5A\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDEB9\uDF3C-\uDF3E]|\uD806[\uDC3B\uDD44-\uDD46\uDDE2\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2\uDF00-\uDF09]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8\uDF43-\uDF4F\uDFFF]|\uD809[\uDC70-\uDC74]|\uD80B[\uDFF1\uDFF2]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A\uDFE2]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/; var regex$1 = /[\$\+<->\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u0888\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20C0\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFF\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u31EF\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC2\uFD40-\uFD4F\uFDCF\uFDFC-\uFDFF\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD833[\uDF50-\uDFC3]|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDEA\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEDC-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF76\uDF7B-\uDFD9\uDFE0-\uDFEB\uDFF0]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDE53\uDE60-\uDE6D\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC5\uDECE-\uDEDB\uDEE0-\uDEE8\uDEF0-\uDEF8\uDF00-\uDF92\uDF94-\uDFCA]/; var regex = /[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/; exports.Any = regex$5; exports.Cc = regex$4; exports.Cf = regex$3; exports.P = regex$2; exports.S = regex$1; exports.Z = regex; /***/ }), /***/ "./components/GraphiQL.tsx": /*!*********************************!*\ !*** ./components/GraphiQL.tsx ***! \*********************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.GraphiQL = GraphiQL; exports.GraphiQLInterface = GraphiQLInterface; var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); var _react2 = __webpack_require__(/*! @graphiql/react */ "../../graphiql-react/dist/index.js"); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } /** * Copyright (c) 2020 GraphQL Contributors. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ const majorVersion = parseInt(_react.default.version.slice(0, 2), 10); if (majorVersion < 16) { throw new Error(['GraphiQL 0.18.0 and after is not compatible with React 15 or below.', 'If you are using a CDN source (jsdelivr, unpkg, etc), follow this example:', 'https://github.com/graphql/graphiql/blob/master/examples/graphiql-cdn/index.html#L49'].join('\n')); } /** * API docs for this live here: * * https://graphiql-test.netlify.app/typedoc/modules/graphiql.html#graphiqlprops */ /** * The top-level React component for GraphiQL, intended to encompass the entire * browser viewport. * * @see https://github.com/graphql/graphiql#usage */ function GraphiQL(_ref) { var _props$disableTabs; let { dangerouslyAssumeSchemaIsValid, defaultQuery, defaultTabs, externalFragments, fetcher, getDefaultFieldNames, headers, inputValueDeprecation, introspectionQueryName, maxHistoryLength, onEditOperationName, onSchemaChange, onTabChange, onTogglePluginVisibility, operationName, plugins, query, response, schema, schemaDescription, shouldPersistHeaders, storage, validationRules, variables, visiblePlugin, defaultHeaders, ...props } = _ref; // Ensure props are correct if (typeof fetcher !== 'function') { throw new TypeError('The `GraphiQL` component requires a `fetcher` function to be passed as prop.'); } return /*#__PURE__*/_react.default.createElement(_react2.GraphiQLProvider, { getDefaultFieldNames: getDefaultFieldNames, dangerouslyAssumeSchemaIsValid: dangerouslyAssumeSchemaIsValid, defaultQuery: defaultQuery, defaultHeaders: defaultHeaders, defaultTabs: defaultTabs, externalFragments: externalFragments, fetcher: fetcher, headers: headers, inputValueDeprecation: inputValueDeprecation, introspectionQueryName: introspectionQueryName, maxHistoryLength: maxHistoryLength, onEditOperationName: onEditOperationName, onSchemaChange: onSchemaChange, onTabChange: onTabChange, onTogglePluginVisibility: onTogglePluginVisibility, plugins: plugins, visiblePlugin: visiblePlugin, operationName: operationName, query: query, response: response, schema: schema, schemaDescription: schemaDescription, shouldPersistHeaders: shouldPersistHeaders, storage: storage, validationRules: validationRules, variables: variables }, /*#__PURE__*/_react.default.createElement(GraphiQLInterface, _extends({ showPersistHeadersSettings: shouldPersistHeaders !== false, disableTabs: (_props$disableTabs = props.disableTabs) !== null && _props$disableTabs !== void 0 ? _props$disableTabs : false }, props))); } // Export main windows/panes to be used separately if desired. GraphiQL.Logo = GraphiQLLogo; GraphiQL.Toolbar = GraphiQLToolbar; GraphiQL.Footer = GraphiQLFooter; function GraphiQLInterface(props) { var _props$isHeadersEdito, _pluginContext$visibl, _props$toolbar, _props$toolbar2; const isHeadersEditorEnabled = (_props$isHeadersEdito = props.isHeadersEditorEnabled) !== null && _props$isHeadersEdito !== void 0 ? _props$isHeadersEdito : true; const editorContext = (0, _react2.useEditorContext)({ nonNull: true }); const executionContext = (0, _react2.useExecutionContext)({ nonNull: true }); const schemaContext = (0, _react2.useSchemaContext)({ nonNull: true }); const storageContext = (0, _react2.useStorageContext)(); const pluginContext = (0, _react2.usePluginContext)(); const copy = (0, _react2.useCopyQuery)({ onCopyQuery: props.onCopyQuery }); const merge = (0, _react2.useMergeQuery)(); const prettify = (0, _react2.usePrettifyEditors)(); const { theme, setTheme } = (0, _react2.useTheme)(); const PluginContent = pluginContext === null || pluginContext === void 0 ? void 0 : (_pluginContext$visibl = pluginContext.visiblePlugin) === null || _pluginContext$visibl === void 0 ? void 0 : _pluginContext$visibl.content; const pluginResize = (0, _react2.useDragResize)({ defaultSizeRelation: 1 / 3, direction: 'horizontal', initiallyHidden: pluginContext !== null && pluginContext !== void 0 && pluginContext.visiblePlugin ? undefined : 'first', onHiddenElementChange(resizableElement) { if (resizableElement === 'first') { pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.setVisiblePlugin(null); } }, sizeThresholdSecond: 200, storageKey: 'docExplorerFlex' }); const editorResize = (0, _react2.useDragResize)({ direction: 'horizontal', storageKey: 'editorFlex' }); const editorToolsResize = (0, _react2.useDragResize)({ defaultSizeRelation: 3, direction: 'vertical', initiallyHidden: (() => { if (props.defaultEditorToolsVisibility === 'variables' || props.defaultEditorToolsVisibility === 'headers') { return; } if (typeof props.defaultEditorToolsVisibility === 'boolean') { return props.defaultEditorToolsVisibility ? undefined : 'second'; } return editorContext.initialVariables || editorContext.initialHeaders ? undefined : 'second'; })(), sizeThresholdSecond: 60, storageKey: 'secondaryEditorFlex' }); const [activeSecondaryEditor, setActiveSecondaryEditor] = (0, _react.useState)(() => { if (props.defaultEditorToolsVisibility === 'variables' || props.defaultEditorToolsVisibility === 'headers') { return props.defaultEditorToolsVisibility; } return !editorContext.initialVariables && editorContext.initialHeaders && isHeadersEditorEnabled ? 'headers' : 'variables'; }); const [showDialog, setShowDialog] = (0, _react.useState)(null); const [clearStorageStatus, setClearStorageStatus] = (0, _react.useState)(null); const children = _react.default.Children.toArray(props.children); const logo = children.find(child => isChildComponentType(child, GraphiQL.Logo)) || /*#__PURE__*/_react.default.createElement(GraphiQL.Logo, null); const toolbar = children.find(child => isChildComponentType(child, GraphiQL.Toolbar)) || /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { onClick: prettify, label: "Prettify query (Shift-Ctrl-P)" }, /*#__PURE__*/_react.default.createElement(_react2.PrettifyIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" })), /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { onClick: merge, label: "Merge fragments into query (Shift-Ctrl-M)" }, /*#__PURE__*/_react.default.createElement(_react2.MergeIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" })), /*#__PURE__*/_react.default.createElement(_react2.ToolbarButton, { onClick: copy, label: "Copy query (Shift-Ctrl-C)" }, /*#__PURE__*/_react.default.createElement(_react2.CopyIcon, { className: "graphiql-toolbar-icon", "aria-hidden": "true" })), ((_props$toolbar = props.toolbar) === null || _props$toolbar === void 0 ? void 0 : _props$toolbar.additionalContent) && props.toolbar.additionalContent, ((_props$toolbar2 = props.toolbar) === null || _props$toolbar2 === void 0 ? void 0 : _props$toolbar2.additionalComponent) && /*#__PURE__*/_react.default.createElement(props.toolbar.additionalComponent, null)); const footer = children.find(child => isChildComponentType(child, GraphiQL.Footer)); const onClickReference = (0, _react.useCallback)(() => { if (pluginResize.hiddenElement === 'first') { pluginResize.setHiddenElement(null); } }, [pluginResize]); const handleClearData = (0, _react.useCallback)(() => { try { storageContext === null || storageContext === void 0 ? void 0 : storageContext.clear(); setClearStorageStatus('success'); } catch { setClearStorageStatus('error'); } }, [storageContext]); const handlePersistHeaders = (0, _react.useCallback)(event => { editorContext.setShouldPersistHeaders(event.currentTarget.dataset.value === 'true'); }, [editorContext]); const handleChangeTheme = (0, _react.useCallback)(event => { const selectedTheme = event.currentTarget.dataset.theme; setTheme(selectedTheme || null); }, [setTheme]); const handleAddTab = editorContext.addTab; const handleRefetchSchema = schemaContext.introspect; const handleReorder = editorContext.moveTab; const handleShowDialog = (0, _react.useCallback)(event => { setShowDialog(event.currentTarget.dataset.value); }, []); const handlePluginClick = (0, _react.useCallback)(e => { const context = pluginContext; const pluginIndex = Number(e.currentTarget.dataset.index); const plugin = context.plugins.find((_, index) => pluginIndex === index); const isVisible = plugin === context.visiblePlugin; if (isVisible) { context.setVisiblePlugin(null); pluginResize.setHiddenElement('first'); } else { context.setVisiblePlugin(plugin); pluginResize.setHiddenElement(null); } }, [pluginContext, pluginResize]); const handleToolsTabClick = (0, _react.useCallback)(event => { if (editorToolsResize.hiddenElement === 'second') { editorToolsResize.setHiddenElement(null); } setActiveSecondaryEditor(event.currentTarget.dataset.name); }, [editorToolsResize]); const toggleEditorTools = (0, _react.useCallback)(() => { editorToolsResize.setHiddenElement(editorToolsResize.hiddenElement === 'second' ? null : 'second'); }, [editorToolsResize]); const handleOpenShortKeysDialog = (0, _react.useCallback)(isOpen => { if (!isOpen) { setShowDialog(null); } }, []); const handleOpenSettingsDialog = (0, _react.useCallback)(isOpen => { if (!isOpen) { setShowDialog(null); setClearStorageStatus(null); } }, []); const addTab = /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { label: "Add tab" }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", className: "graphiql-tab-add", onClick: handleAddTab, "aria-label": "Add tab" }, /*#__PURE__*/_react.default.createElement(_react2.PlusIcon, { "aria-hidden": "true" }))); return /*#__PURE__*/_react.default.createElement(_react2.Tooltip.Provider, null, /*#__PURE__*/_react.default.createElement("div", { "data-testid": "graphiql-container", className: "graphiql-container" }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-sidebar" }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-sidebar-section" }, pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.plugins.map((plugin, index) => { const isVisible = plugin === pluginContext.visiblePlugin; const label = `${isVisible ? 'Hide' : 'Show'} ${plugin.title}`; const Icon = plugin.icon; return /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { key: plugin.title, label: label }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", className: isVisible ? 'active' : '', onClick: handlePluginClick, "data-index": index, "aria-label": label }, /*#__PURE__*/_react.default.createElement(Icon, { "aria-hidden": "true" }))); })), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-sidebar-section" }, /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { label: "Re-fetch GraphQL schema" }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", disabled: schemaContext.isFetching, onClick: handleRefetchSchema, "aria-label": "Re-fetch GraphQL schema" }, /*#__PURE__*/_react.default.createElement(_react2.ReloadIcon, { className: schemaContext.isFetching ? 'graphiql-spin' : '', "aria-hidden": "true" }))), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { label: "Open short keys dialog" }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", "data-value": "short-keys", onClick: handleShowDialog, "aria-label": "Open short keys dialog" }, /*#__PURE__*/_react.default.createElement(_react2.KeyboardShortcutIcon, { "aria-hidden": "true" }))), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { label: "Open settings dialog" }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", "data-value": "settings", onClick: handleShowDialog, "aria-label": "Open settings dialog" }, /*#__PURE__*/_react.default.createElement(_react2.SettingsIcon, { "aria-hidden": "true" }))))), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-main" }, /*#__PURE__*/_react.default.createElement("div", { ref: pluginResize.firstRef, style: { // Make sure the container shrinks when containing long // non-breaking texts minWidth: '200px' } }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-plugin" }, PluginContent ? /*#__PURE__*/_react.default.createElement(PluginContent, null) : null)), (pluginContext === null || pluginContext === void 0 ? void 0 : pluginContext.visiblePlugin) && /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-horizontal-drag-bar", ref: pluginResize.dragBarRef }), /*#__PURE__*/_react.default.createElement("div", { ref: pluginResize.secondRef, className: "graphiql-sessions" }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-session-header" }, props.disableTabs ? null : /*#__PURE__*/_react.default.createElement(_react2.Tabs, { values: editorContext.tabs, onReorder: handleReorder, "aria-label": "Select active operation" }, editorContext.tabs.length > 1 && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, editorContext.tabs.map((tab, index) => /*#__PURE__*/_react.default.createElement(_react2.Tab, { key: tab.id, value: tab, isActive: index === editorContext.activeTabIndex }, /*#__PURE__*/_react.default.createElement(_react2.Tab.Button, { "aria-controls": "graphiql-session", id: `graphiql-session-tab-${index}`, onClick: () => { executionContext.stop(); editorContext.changeTab(index); } }, tab.title), /*#__PURE__*/_react.default.createElement(_react2.Tab.Close, { onClick: () => { if (editorContext.activeTabIndex === index) { executionContext.stop(); } editorContext.closeTab(index); } }))), addTab)), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-session-header-right" }, editorContext.tabs.length === 1 && addTab, logo)), /*#__PURE__*/_react.default.createElement("div", { role: "tabpanel", id: "graphiql-session", className: "graphiql-session", "aria-labelledby": `graphiql-session-tab-${editorContext.activeTabIndex}` }, /*#__PURE__*/_react.default.createElement("div", { ref: editorResize.firstRef }, /*#__PURE__*/_react.default.createElement("div", { className: `graphiql-editors${editorContext.tabs.length === 1 ? ' full-height' : ''}` }, /*#__PURE__*/_react.default.createElement("div", { ref: editorToolsResize.firstRef }, /*#__PURE__*/_react.default.createElement("section", { className: "graphiql-query-editor", "aria-label": "Query Editor" }, /*#__PURE__*/_react.default.createElement(_react2.QueryEditor, { editorTheme: props.editorTheme, keyMap: props.keyMap, onClickReference: onClickReference, onCopyQuery: props.onCopyQuery, onEdit: props.onEditQuery, readOnly: props.readOnly }), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-toolbar", role: "toolbar", "aria-label": "Editor Commands" }, /*#__PURE__*/_react.default.createElement(_react2.ExecuteButton, null), toolbar))), /*#__PURE__*/_react.default.createElement("div", { ref: editorToolsResize.dragBarRef }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-editor-tools" }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", className: activeSecondaryEditor === 'variables' && editorToolsResize.hiddenElement !== 'second' ? 'active' : '', onClick: handleToolsTabClick, "data-name": "variables" }, "Variables"), isHeadersEditorEnabled && /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", className: activeSecondaryEditor === 'headers' && editorToolsResize.hiddenElement !== 'second' ? 'active' : '', onClick: handleToolsTabClick, "data-name": "headers" }, "Headers"), /*#__PURE__*/_react.default.createElement(_react2.Tooltip, { label: editorToolsResize.hiddenElement === 'second' ? 'Show editor tools' : 'Hide editor tools' }, /*#__PURE__*/_react.default.createElement(_react2.UnStyledButton, { type: "button", onClick: toggleEditorTools, "aria-label": editorToolsResize.hiddenElement === 'second' ? 'Show editor tools' : 'Hide editor tools', className: "graphiql-toggle-editor-tools" }, editorToolsResize.hiddenElement === 'second' ? /*#__PURE__*/_react.default.createElement(_react2.ChevronUpIcon, { className: "graphiql-chevron-icon", "aria-hidden": "true" }) : /*#__PURE__*/_react.default.createElement(_react2.ChevronDownIcon, { className: "graphiql-chevron-icon", "aria-hidden": "true" }))))), /*#__PURE__*/_react.default.createElement("div", { ref: editorToolsResize.secondRef }, /*#__PURE__*/_react.default.createElement("section", { className: "graphiql-editor-tool", "aria-label": activeSecondaryEditor === 'variables' ? 'Variables' : 'Headers' }, /*#__PURE__*/_react.default.createElement(_react2.VariableEditor, { editorTheme: props.editorTheme, isHidden: activeSecondaryEditor !== 'variables', keyMap: props.keyMap, onEdit: props.onEditVariables, onClickReference: onClickReference, readOnly: props.readOnly }), isHeadersEditorEnabled && /*#__PURE__*/_react.default.createElement(_react2.HeaderEditor, { editorTheme: props.editorTheme, isHidden: activeSecondaryEditor !== 'headers', keyMap: props.keyMap, onEdit: props.onEditHeaders, readOnly: props.readOnly }))))), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-horizontal-drag-bar", ref: editorResize.dragBarRef }), /*#__PURE__*/_react.default.createElement("div", { ref: editorResize.secondRef }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-response" }, executionContext.isFetching ? /*#__PURE__*/_react.default.createElement(_react2.Spinner, null) : null, /*#__PURE__*/_react.default.createElement(_react2.ResponseEditor, { editorTheme: props.editorTheme, responseTooltip: props.responseTooltip, keyMap: props.keyMap }), footer))))), /*#__PURE__*/_react.default.createElement(_react2.Dialog, { open: showDialog === 'short-keys', onOpenChange: handleOpenShortKeysDialog }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-header" }, /*#__PURE__*/_react.default.createElement(_react2.Dialog.Title, { className: "graphiql-dialog-title" }, "Short Keys"), /*#__PURE__*/_react.default.createElement(_react2.Dialog.Close, null)), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section" }, /*#__PURE__*/_react.default.createElement(ShortKeys, { keyMap: props.keyMap || 'sublime' }))), /*#__PURE__*/_react.default.createElement(_react2.Dialog, { open: showDialog === 'settings', onOpenChange: handleOpenSettingsDialog }, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-header" }, /*#__PURE__*/_react.default.createElement(_react2.Dialog.Title, { className: "graphiql-dialog-title" }, "Settings"), /*#__PURE__*/_react.default.createElement(_react2.Dialog.Close, null)), props.showPersistHeadersSettings ? /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section" }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section-title" }, "Persist headers"), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section-caption" }, "Save headers upon reloading.", ' ', /*#__PURE__*/_react.default.createElement("span", { className: "graphiql-warning-text" }, "Only enable if you trust this device."))), /*#__PURE__*/_react.default.createElement(_react2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_react2.Button, { type: "button", id: "enable-persist-headers", className: editorContext.shouldPersistHeaders ? 'active' : '', "data-value": "true", onClick: handlePersistHeaders }, "On"), /*#__PURE__*/_react.default.createElement(_react2.Button, { type: "button", id: "disable-persist-headers", className: editorContext.shouldPersistHeaders ? '' : 'active', onClick: handlePersistHeaders }, "Off"))) : null, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section" }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section-title" }, "Theme"), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section-caption" }, "Adjust how the interface looks like.")), /*#__PURE__*/_react.default.createElement(_react2.ButtonGroup, null, /*#__PURE__*/_react.default.createElement(_react2.Button, { type: "button", className: theme === null ? 'active' : '', onClick: handleChangeTheme }, "System"), /*#__PURE__*/_react.default.createElement(_react2.Button, { type: "button", className: theme === 'light' ? 'active' : '', "data-theme": "light", onClick: handleChangeTheme }, "Light"), /*#__PURE__*/_react.default.createElement(_react2.Button, { type: "button", className: theme === 'dark' ? 'active' : '', "data-theme": "dark", onClick: handleChangeTheme }, "Dark"))), storageContext ? /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section" }, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section-title" }, "Clear storage"), /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-dialog-section-caption" }, "Remove all locally stored data and start fresh.")), /*#__PURE__*/_react.default.createElement(_react2.Button, { type: "button", state: clearStorageStatus || undefined, disabled: clearStorageStatus === 'success', onClick: handleClearData }, { success: 'Cleared data', error: 'Failed' }[clearStorageStatus] || 'Clear data')) : null))); } const modifier = typeof window !== 'undefined' && window.navigator.platform.toLowerCase().indexOf('mac') === 0 ? 'Cmd' : 'Ctrl'; const SHORT_KEYS = Object.entries({ 'Search in editor': [modifier, 'F'], 'Search in documentation': [modifier, 'K'], 'Execute query': [modifier, 'Enter'], 'Prettify editors': ['Ctrl', 'Shift', 'P'], 'Merge fragments definitions into operation definition': ['Ctrl', 'Shift', 'M'], 'Copy query': ['Ctrl', 'Shift', 'C'], 'Re-fetch schema using introspection': ['Ctrl', 'Shift', 'R'] }); function ShortKeys(_ref2) { let { keyMap } = _ref2; return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("table", { className: "graphiql-table" }, /*#__PURE__*/_react.default.createElement("thead", null, /*#__PURE__*/_react.default.createElement("tr", null, /*#__PURE__*/_react.default.createElement("th", null, "Short Key"), /*#__PURE__*/_react.default.createElement("th", null, "Function"))), /*#__PURE__*/_react.default.createElement("tbody", null, SHORT_KEYS.map(_ref3 => { let [title, keys] = _ref3; return /*#__PURE__*/_react.default.createElement("tr", { key: title }, /*#__PURE__*/_react.default.createElement("td", null, keys.map((key, index, array) => /*#__PURE__*/_react.default.createElement(_react.Fragment, { key: key }, /*#__PURE__*/_react.default.createElement("code", { className: "graphiql-key" }, key), index !== array.length - 1 && ' + '))), /*#__PURE__*/_react.default.createElement("td", null, title)); }))), /*#__PURE__*/_react.default.createElement("p", null, "The editors use", ' ', /*#__PURE__*/_react.default.createElement("a", { href: "https://codemirror.net/5/doc/manual.html#keymaps", target: "_blank", rel: "noopener noreferrer" }, "CodeMirror Key Maps"), ' ', "that add more short keys. This instance of Graph", /*#__PURE__*/_react.default.createElement("em", null, "i"), "QL uses", ' ', /*#__PURE__*/_react.default.createElement("code", null, keyMap), ".")); } // Configure the UI by providing this Component as a child of GraphiQL. function GraphiQLLogo(props) { return /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-logo" }, props.children || /*#__PURE__*/_react.default.createElement("a", { className: "graphiql-logo-link", href: "https://github.com/graphql/graphiql", target: "_blank", rel: "noreferrer" }, "Graph", /*#__PURE__*/_react.default.createElement("em", null, "i"), "QL")); } GraphiQLLogo.displayName = 'GraphiQLLogo'; // Configure the UI by providing this Component as a child of GraphiQL. function GraphiQLToolbar(props) { // eslint-disable-next-line react/jsx-no-useless-fragment return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, props.children); } GraphiQLToolbar.displayName = 'GraphiQLToolbar'; // Configure the UI by providing this Component as a child of GraphiQL. function GraphiQLFooter(props) { return /*#__PURE__*/_react.default.createElement("div", { className: "graphiql-footer" }, props.children); } GraphiQLFooter.displayName = 'GraphiQLFooter'; // Determines if the React child is of the same type of the provided React component function isChildComponentType(child, component) { var _child$type; if (child !== null && child !== void 0 && (_child$type = child.type) !== null && _child$type !== void 0 && _child$type.displayName && child.type.displayName === component.displayName) { return true; } return child.type === component; } /***/ }), /***/ "../../graphql-language-service/esm/index.js": /*!***************************************************!*\ !*** ../../graphql-language-service/esm/index.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "CharacterStream", ({ enumerable: true, get: function () { return _parser.CharacterStream; } })); Object.defineProperty(exports, "CompletionItemKind", ({ enumerable: true, get: function () { return _types.CompletionItemKind; } })); Object.defineProperty(exports, "DIAGNOSTIC_SEVERITY", ({ enumerable: true, get: function () { return _interface.DIAGNOSTIC_SEVERITY; } })); Object.defineProperty(exports, "FileChangeTypeKind", ({ enumerable: true, get: function () { return _types.FileChangeTypeKind; } })); Object.defineProperty(exports, "LexRules", ({ enumerable: true, get: function () { return _parser.LexRules; } })); Object.defineProperty(exports, "ParseRules", ({ enumerable: true, get: function () { return _parser.ParseRules; } })); Object.defineProperty(exports, "Position", ({ enumerable: true, get: function () { return _utils.Position; } })); Object.defineProperty(exports, "Range", ({ enumerable: true, get: function () { return _utils.Range; } })); Object.defineProperty(exports, "RuleKinds", ({ enumerable: true, get: function () { return _parser.RuleKinds; } })); Object.defineProperty(exports, "SEVERITY", ({ enumerable: true, get: function () { return _interface.SEVERITY; } })); Object.defineProperty(exports, "SuggestionCommand", ({ enumerable: true, get: function () { return _interface.SuggestionCommand; } })); Object.defineProperty(exports, "canUseDirective", ({ enumerable: true, get: function () { return _interface.canUseDirective; } })); Object.defineProperty(exports, "collectVariables", ({ enumerable: true, get: function () { return _utils.collectVariables; } })); Object.defineProperty(exports, "getASTNodeAtPosition", ({ enumerable: true, get: function () { return _utils.getASTNodeAtPosition; } })); Object.defineProperty(exports, "getAutocompleteSuggestions", ({ enumerable: true, get: function () { return _interface.getAutocompleteSuggestions; } })); Object.defineProperty(exports, "getDefinitionQueryResultForDefinitionNode", ({ enumerable: true, get: function () { return _interface.getDefinitionQueryResultForDefinitionNode; } })); Object.defineProperty(exports, "getDefinitionQueryResultForField", ({ enumerable: true, get: function () { return _interface.getDefinitionQueryResultForField; } })); Object.defineProperty(exports, "getDefinitionQueryResultForFragmentSpread", ({ enumerable: true, get: function () { return _interface.getDefinitionQueryResultForFragmentSpread; } })); Object.defineProperty(exports, "getDefinitionQueryResultForNamedType", ({ enumerable: true, get: function () { return _interface.getDefinitionQueryResultForNamedType; } })); Object.defineProperty(exports, "getDefinitionState", ({ enumerable: true, get: function () { return _interface.getDefinitionState; } })); Object.defineProperty(exports, "getDiagnostics", ({ enumerable: true, get: function () { return _interface.getDiagnostics; } })); Object.defineProperty(exports, "getFieldDef", ({ enumerable: true, get: function () { return _interface.getFieldDef; } })); Object.defineProperty(exports, "getFragmentDefinitions", ({ enumerable: true, get: function () { return _interface.getFragmentDefinitions; } })); Object.defineProperty(exports, "getFragmentDependencies", ({ enumerable: true, get: function () { return _utils.getFragmentDependencies; } })); Object.defineProperty(exports, "getFragmentDependenciesForAST", ({ enumerable: true, get: function () { return _utils.getFragmentDependenciesForAST; } })); Object.defineProperty(exports, "getHoverInformation", ({ enumerable: true, get: function () { return _interface.getHoverInformation; } })); Object.defineProperty(exports, "getOperationASTFacts", ({ enumerable: true, get: function () { return _utils.getOperationASTFacts; } })); Object.defineProperty(exports, "getOperationFacts", ({ enumerable: true, get: function () { return _utils.getOperationFacts; } })); Object.defineProperty(exports, "getOutline", ({ enumerable: true, get: function () { return _interface.getOutline; } })); Object.defineProperty(exports, "getQueryFacts", ({ enumerable: true, get: function () { return _utils.getQueryFacts; } })); Object.defineProperty(exports, "getRange", ({ enumerable: true, get: function () { return _interface.getRange; } })); Object.defineProperty(exports, "getTokenAtPosition", ({ enumerable: true, get: function () { return _interface.getTokenAtPosition; } })); Object.defineProperty(exports, "getTypeInfo", ({ enumerable: true, get: function () { return _interface.getTypeInfo; } })); Object.defineProperty(exports, "getVariableCompletions", ({ enumerable: true, get: function () { return _interface.getVariableCompletions; } })); Object.defineProperty(exports, "getVariablesJSONSchema", ({ enumerable: true, get: function () { return _utils.getVariablesJSONSchema; } })); Object.defineProperty(exports, "isIgnored", ({ enumerable: true, get: function () { return _parser.isIgnored; } })); Object.defineProperty(exports, "list", ({ enumerable: true, get: function () { return _parser.list; } })); Object.defineProperty(exports, "offsetToPosition", ({ enumerable: true, get: function () { return _utils.offsetToPosition; } })); Object.defineProperty(exports, "onlineParser", ({ enumerable: true, get: function () { return _parser.onlineParser; } })); Object.defineProperty(exports, "opt", ({ enumerable: true, get: function () { return _parser.opt; } })); Object.defineProperty(exports, "p", ({ enumerable: true, get: function () { return _parser.p; } })); Object.defineProperty(exports, "pointToOffset", ({ enumerable: true, get: function () { return _utils.pointToOffset; } })); Object.defineProperty(exports, "t", ({ enumerable: true, get: function () { return _parser.t; } })); Object.defineProperty(exports, "validateQuery", ({ enumerable: true, get: function () { return _interface.validateQuery; } })); Object.defineProperty(exports, "validateWithCustomRules", ({ enumerable: true, get: function () { return _utils.validateWithCustomRules; } })); var _interface = __webpack_require__(/*! ./interface */ "../../graphql-language-service/esm/interface/index.js"); var _parser = __webpack_require__(/*! ./parser */ "../../graphql-language-service/esm/parser/index.js"); var _types = __webpack_require__(/*! ./types */ "../../graphql-language-service/esm/types.js"); var _utils = __webpack_require__(/*! ./utils */ "../../graphql-language-service/esm/utils/index.js"); /***/ }), /***/ "../../graphql-language-service/esm/interface/autocompleteUtils.js": /*!*************************************************************************!*\ !*** ../../graphql-language-service/esm/interface/autocompleteUtils.js ***! \*************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.forEachState = forEachState; exports.getDefinitionState = getDefinitionState; exports.getFieldDef = getFieldDef; exports.hintList = hintList; exports.objectValues = objectValues; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); function getDefinitionState(tokenState) { let definitionState; forEachState(tokenState, state => { switch (state.kind) { case 'Query': case 'ShortQuery': case 'Mutation': case 'Subscription': case 'FragmentDefinition': definitionState = state; break; } }); return definitionState; } function getFieldDef(schema, type, fieldName) { if (fieldName === _graphql.SchemaMetaFieldDef.name && schema.getQueryType() === type) { return _graphql.SchemaMetaFieldDef; } if (fieldName === _graphql.TypeMetaFieldDef.name && schema.getQueryType() === type) { return _graphql.TypeMetaFieldDef; } if (fieldName === _graphql.TypeNameMetaFieldDef.name && (0, _graphql.isCompositeType)(type)) { return _graphql.TypeNameMetaFieldDef; } if ('getFields' in type) { return type.getFields()[fieldName]; } return null; } function forEachState(stack, fn) { const reverseStateStack = []; let state = stack; while (state === null || state === void 0 ? void 0 : state.kind) { reverseStateStack.push(state); state = state.prevState; } for (let i = reverseStateStack.length - 1; i >= 0; i--) { fn(reverseStateStack[i]); } } function objectValues(object) { const keys = Object.keys(object); const len = keys.length; const values = new Array(len); for (let i = 0; i < len; ++i) { values[i] = object[keys[i]]; } return values; } function hintList(token, list) { return filterAndSortList(list, normalizeText(token.string)); } function filterAndSortList(list, text) { if (!text) { return filterNonEmpty(list, entry => !entry.isDeprecated); } const byProximity = list.map(entry => ({ proximity: getProximity(normalizeText(entry.label), text), entry })); return filterNonEmpty(filterNonEmpty(byProximity, pair => pair.proximity <= 2), pair => !pair.entry.isDeprecated).sort((a, b) => (a.entry.isDeprecated ? 1 : 0) - (b.entry.isDeprecated ? 1 : 0) || a.proximity - b.proximity || a.entry.label.length - b.entry.label.length).map(pair => pair.entry); } function filterNonEmpty(array, predicate) { const filtered = array.filter(predicate); return filtered.length === 0 ? array : filtered; } function normalizeText(text) { return text.toLowerCase().replaceAll(/\W/g, ''); } function getProximity(suggestion, text) { let proximity = lexicalDistance(text, suggestion); if (suggestion.length > text.length) { proximity -= suggestion.length - text.length - 1; proximity += suggestion.indexOf(text) === 0 ? 0 : 0.5; } return proximity; } function lexicalDistance(a, b) { let i; let j; const d = []; const aLength = a.length; const bLength = b.length; for (i = 0; i <= aLength; i++) { d[i] = [i]; } for (j = 1; j <= bLength; j++) { d[0][j] = j; } for (i = 1; i <= aLength; i++) { for (j = 1; j <= bLength; j++) { const cost = a[i - 1] === b[j - 1] ? 0 : 1; d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost); if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) { d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + cost); } } } return d[aLength][bLength]; } /***/ }), /***/ "../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js": /*!**********************************************************************************!*\ !*** ../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js ***! \**********************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SuggestionCommand = exports.GraphQLDocumentMode = void 0; exports.canUseDirective = canUseDirective; exports.getAutocompleteSuggestions = getAutocompleteSuggestions; exports.getFragmentDefinitions = getFragmentDefinitions; exports.getTokenAtPosition = getTokenAtPosition; exports.getTypeInfo = getTypeInfo; exports.getVariableCompletions = getVariableCompletions; exports.runOnlineParser = runOnlineParser; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _types = __webpack_require__(/*! ../types */ "../../graphql-language-service/esm/types.js"); var _parser = __webpack_require__(/*! ../parser */ "../../graphql-language-service/esm/parser/index.js"); var _autocompleteUtils = __webpack_require__(/*! ./autocompleteUtils */ "../../graphql-language-service/esm/interface/autocompleteUtils.js"); const SuggestionCommand = { command: 'editor.action.triggerSuggest', title: 'Suggestions' }; exports.SuggestionCommand = SuggestionCommand; const collectFragmentDefs = op => { const externalFragments = []; if (op) { try { (0, _graphql.visit)((0, _graphql.parse)(op), { FragmentDefinition(def) { externalFragments.push(def); } }); } catch (_a) { return []; } } return externalFragments; }; const typeSystemKinds = [_graphql.Kind.SCHEMA_DEFINITION, _graphql.Kind.OPERATION_TYPE_DEFINITION, _graphql.Kind.SCALAR_TYPE_DEFINITION, _graphql.Kind.OBJECT_TYPE_DEFINITION, _graphql.Kind.INTERFACE_TYPE_DEFINITION, _graphql.Kind.UNION_TYPE_DEFINITION, _graphql.Kind.ENUM_TYPE_DEFINITION, _graphql.Kind.INPUT_OBJECT_TYPE_DEFINITION, _graphql.Kind.DIRECTIVE_DEFINITION, _graphql.Kind.SCHEMA_EXTENSION, _graphql.Kind.SCALAR_TYPE_EXTENSION, _graphql.Kind.OBJECT_TYPE_EXTENSION, _graphql.Kind.INTERFACE_TYPE_EXTENSION, _graphql.Kind.UNION_TYPE_EXTENSION, _graphql.Kind.ENUM_TYPE_EXTENSION, _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION]; const hasTypeSystemDefinitions = sdl => { let hasTypeSystemDef = false; if (sdl) { try { (0, _graphql.visit)((0, _graphql.parse)(sdl), { enter(node) { if (node.kind === 'Document') { return; } if (typeSystemKinds.includes(node.kind)) { hasTypeSystemDef = true; return _graphql.BREAK; } return false; } }); } catch (_a) { return hasTypeSystemDef; } } return hasTypeSystemDef; }; function getAutocompleteSuggestions(schema, queryText, cursor, contextToken, fragmentDefs, options) { var _a; const opts = Object.assign(Object.assign({}, options), { schema }); const token = contextToken || getTokenAtPosition(queryText, cursor, 1); const state = token.state.kind === 'Invalid' ? token.state.prevState : token.state; const mode = (options === null || options === void 0 ? void 0 : options.mode) || getDocumentMode(queryText, options === null || options === void 0 ? void 0 : options.uri); if (!state) { return []; } const { kind, step, prevState } = state; const typeInfo = getTypeInfo(schema, token.state); if (kind === _parser.RuleKinds.DOCUMENT) { if (mode === GraphQLDocumentMode.TYPE_SYSTEM) { return getSuggestionsForTypeSystemDefinitions(token); } return getSuggestionsForExecutableDefinitions(token); } if (kind === _parser.RuleKinds.EXTEND_DEF) { return getSuggestionsForExtensionDefinitions(token); } if (((_a = prevState === null || prevState === void 0 ? void 0 : prevState.prevState) === null || _a === void 0 ? void 0 : _a.kind) === _parser.RuleKinds.EXTENSION_DEFINITION && state.name) { return (0, _autocompleteUtils.hintList)(token, []); } if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.SCALAR_TYPE_EXTENSION) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isScalarType).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.OBJECT_TYPE_EXTENSION) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isObjectType)(type) && !type.name.startsWith('__')).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.INTERFACE_TYPE_EXTENSION) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isInterfaceType).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.UNION_TYPE_EXTENSION) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isUnionType).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.ENUM_TYPE_EXTENSION) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isEnumType)(type) && !type.name.startsWith('__')).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if ((prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(_graphql.isInputObjectType).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if (kind === _parser.RuleKinds.IMPLEMENTS || kind === _parser.RuleKinds.NAMED_TYPE && (prevState === null || prevState === void 0 ? void 0 : prevState.kind) === _parser.RuleKinds.IMPLEMENTS) { return getSuggestionsForImplements(token, state, schema, queryText, typeInfo); } if (kind === _parser.RuleKinds.SELECTION_SET || kind === _parser.RuleKinds.FIELD || kind === _parser.RuleKinds.ALIASED_FIELD) { return getSuggestionsForFieldNames(token, typeInfo, opts); } if (kind === _parser.RuleKinds.ARGUMENTS || kind === _parser.RuleKinds.ARGUMENT && step === 0) { const { argDefs } = typeInfo; if (argDefs) { return (0, _autocompleteUtils.hintList)(token, argDefs.map(argDef => { var _a; return { label: argDef.name, insertText: argDef.name + ': ', command: SuggestionCommand, detail: String(argDef.type), documentation: (_a = argDef.description) !== null && _a !== void 0 ? _a : undefined, kind: _types.CompletionItemKind.Variable, type: argDef.type }; })); } } if ((kind === _parser.RuleKinds.OBJECT_VALUE || kind === _parser.RuleKinds.OBJECT_FIELD && step === 0) && typeInfo.objectFieldDefs) { const objectFields = (0, _autocompleteUtils.objectValues)(typeInfo.objectFieldDefs); const completionKind = kind === _parser.RuleKinds.OBJECT_VALUE ? _types.CompletionItemKind.Value : _types.CompletionItemKind.Field; return (0, _autocompleteUtils.hintList)(token, objectFields.map(field => { var _a; return { label: field.name, detail: String(field.type), documentation: (_a = field.description) !== null && _a !== void 0 ? _a : undefined, kind: completionKind, type: field.type }; })); } if (kind === _parser.RuleKinds.ENUM_VALUE || kind === _parser.RuleKinds.LIST_VALUE && step === 1 || kind === _parser.RuleKinds.OBJECT_FIELD && step === 2 || kind === _parser.RuleKinds.ARGUMENT && step === 2) { return getSuggestionsForInputValues(token, typeInfo, queryText, schema); } if (kind === _parser.RuleKinds.VARIABLE && step === 1) { const namedInputType = (0, _graphql.getNamedType)(typeInfo.inputType); const variableDefinitions = getVariableCompletions(queryText, schema, token); return (0, _autocompleteUtils.hintList)(token, variableDefinitions.filter(v => v.detail === (namedInputType === null || namedInputType === void 0 ? void 0 : namedInputType.name))); } if (kind === _parser.RuleKinds.TYPE_CONDITION && step === 1 || kind === _parser.RuleKinds.NAMED_TYPE && prevState != null && prevState.kind === _parser.RuleKinds.TYPE_CONDITION) { return getSuggestionsForFragmentTypeConditions(token, typeInfo, schema, kind); } if (kind === _parser.RuleKinds.FRAGMENT_SPREAD && step === 1) { return getSuggestionsForFragmentSpread(token, typeInfo, schema, queryText, Array.isArray(fragmentDefs) ? fragmentDefs : collectFragmentDefs(fragmentDefs)); } const unwrappedState = unwrapType(state); if (mode === GraphQLDocumentMode.TYPE_SYSTEM && !unwrappedState.needsAdvance && kind === _parser.RuleKinds.NAMED_TYPE || kind === _parser.RuleKinds.LIST_TYPE) { if (unwrappedState.kind === _parser.RuleKinds.FIELD_DEF) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isOutputType)(type) && !type.name.startsWith('__')).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } if (unwrappedState.kind === _parser.RuleKinds.INPUT_VALUE_DEF) { return (0, _autocompleteUtils.hintList)(token, Object.values(schema.getTypeMap()).filter(type => (0, _graphql.isInputType)(type) && !type.name.startsWith('__')).map(type => ({ label: type.name, kind: _types.CompletionItemKind.Function }))); } } if (kind === _parser.RuleKinds.VARIABLE_DEFINITION && step === 2 || kind === _parser.RuleKinds.LIST_TYPE && step === 1 || kind === _parser.RuleKinds.NAMED_TYPE && prevState && (prevState.kind === _parser.RuleKinds.VARIABLE_DEFINITION || prevState.kind === _parser.RuleKinds.LIST_TYPE || prevState.kind === _parser.RuleKinds.NON_NULL_TYPE)) { return getSuggestionsForVariableDefinition(token, schema, kind); } if (kind === _parser.RuleKinds.DIRECTIVE) { return getSuggestionsForDirective(token, state, schema, kind); } return []; } const insertSuffix = ' {\n $1\n}'; const getInsertText = field => { const { type } = field; if ((0, _graphql.isCompositeType)(type)) { return insertSuffix; } if ((0, _graphql.isListType)(type) && (0, _graphql.isCompositeType)(type.ofType)) { return insertSuffix; } if ((0, _graphql.isNonNullType)(type)) { if ((0, _graphql.isCompositeType)(type.ofType)) { return insertSuffix; } if ((0, _graphql.isListType)(type.ofType) && (0, _graphql.isCompositeType)(type.ofType.ofType)) { return insertSuffix; } } return null; }; function getSuggestionsForTypeSystemDefinitions(token) { return (0, _autocompleteUtils.hintList)(token, [{ label: 'extend', kind: _types.CompletionItemKind.Function }, { label: 'type', kind: _types.CompletionItemKind.Function }, { label: 'interface', kind: _types.CompletionItemKind.Function }, { label: 'union', kind: _types.CompletionItemKind.Function }, { label: 'input', kind: _types.CompletionItemKind.Function }, { label: 'scalar', kind: _types.CompletionItemKind.Function }, { label: 'schema', kind: _types.CompletionItemKind.Function }]); } function getSuggestionsForExecutableDefinitions(token) { return (0, _autocompleteUtils.hintList)(token, [{ label: 'query', kind: _types.CompletionItemKind.Function }, { label: 'mutation', kind: _types.CompletionItemKind.Function }, { label: 'subscription', kind: _types.CompletionItemKind.Function }, { label: 'fragment', kind: _types.CompletionItemKind.Function }, { label: '{', kind: _types.CompletionItemKind.Constructor }]); } function getSuggestionsForExtensionDefinitions(token) { return (0, _autocompleteUtils.hintList)(token, [{ label: 'type', kind: _types.CompletionItemKind.Function }, { label: 'interface', kind: _types.CompletionItemKind.Function }, { label: 'union', kind: _types.CompletionItemKind.Function }, { label: 'input', kind: _types.CompletionItemKind.Function }, { label: 'scalar', kind: _types.CompletionItemKind.Function }, { label: 'schema', kind: _types.CompletionItemKind.Function }]); } function getSuggestionsForFieldNames(token, typeInfo, options) { var _a; if (typeInfo.parentType) { const { parentType } = typeInfo; let fields = []; if ('getFields' in parentType) { fields = (0, _autocompleteUtils.objectValues)(parentType.getFields()); } if ((0, _graphql.isCompositeType)(parentType)) { fields.push(_graphql.TypeNameMetaFieldDef); } if (parentType === ((_a = options === null || options === void 0 ? void 0 : options.schema) === null || _a === void 0 ? void 0 : _a.getQueryType())) { fields.push(_graphql.SchemaMetaFieldDef, _graphql.TypeMetaFieldDef); } return (0, _autocompleteUtils.hintList)(token, fields.map((field, index) => { var _a; const suggestion = { sortText: String(index) + field.name, label: field.name, detail: String(field.type), documentation: (_a = field.description) !== null && _a !== void 0 ? _a : undefined, deprecated: Boolean(field.deprecationReason), isDeprecated: Boolean(field.deprecationReason), deprecationReason: field.deprecationReason, kind: _types.CompletionItemKind.Field, type: field.type }; if (options === null || options === void 0 ? void 0 : options.fillLeafsOnComplete) { const insertText = getInsertText(field); if (insertText) { suggestion.insertText = field.name + insertText; suggestion.insertTextFormat = _types.InsertTextFormat.Snippet; suggestion.command = SuggestionCommand; } } return suggestion; })); } return []; } function getSuggestionsForInputValues(token, typeInfo, queryText, schema) { const namedInputType = (0, _graphql.getNamedType)(typeInfo.inputType); const queryVariables = getVariableCompletions(queryText, schema, token).filter(v => v.detail === namedInputType.name); if (namedInputType instanceof _graphql.GraphQLEnumType) { const values = namedInputType.getValues(); return (0, _autocompleteUtils.hintList)(token, values.map(value => { var _a; return { label: value.name, detail: String(namedInputType), documentation: (_a = value.description) !== null && _a !== void 0 ? _a : undefined, deprecated: Boolean(value.deprecationReason), isDeprecated: Boolean(value.deprecationReason), deprecationReason: value.deprecationReason, kind: _types.CompletionItemKind.EnumMember, type: namedInputType }; }).concat(queryVariables)); } if (namedInputType === _graphql.GraphQLBoolean) { return (0, _autocompleteUtils.hintList)(token, queryVariables.concat([{ label: 'true', detail: String(_graphql.GraphQLBoolean), documentation: 'Not false.', kind: _types.CompletionItemKind.Variable, type: _graphql.GraphQLBoolean }, { label: 'false', detail: String(_graphql.GraphQLBoolean), documentation: 'Not true.', kind: _types.CompletionItemKind.Variable, type: _graphql.GraphQLBoolean }])); } return queryVariables; } function getSuggestionsForImplements(token, tokenState, schema, documentText, typeInfo) { if (tokenState.needsSeparator) { return []; } const typeMap = schema.getTypeMap(); const schemaInterfaces = (0, _autocompleteUtils.objectValues)(typeMap).filter(_graphql.isInterfaceType); const schemaInterfaceNames = schemaInterfaces.map(_ref => { let { name } = _ref; return name; }); const inlineInterfaces = new Set(); runOnlineParser(documentText, (_, state) => { var _a, _b, _c, _d, _e; if (state.name) { if (state.kind === _parser.RuleKinds.INTERFACE_DEF && !schemaInterfaceNames.includes(state.name)) { inlineInterfaces.add(state.name); } if (state.kind === _parser.RuleKinds.NAMED_TYPE && ((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.kind) === _parser.RuleKinds.IMPLEMENTS) { if (typeInfo.interfaceDef) { const existingType = (_b = typeInfo.interfaceDef) === null || _b === void 0 ? void 0 : _b.getInterfaces().find(_ref2 => { let { name } = _ref2; return name === state.name; }); if (existingType) { return; } const type = schema.getType(state.name); const interfaceConfig = (_c = typeInfo.interfaceDef) === null || _c === void 0 ? void 0 : _c.toConfig(); typeInfo.interfaceDef = new _graphql.GraphQLInterfaceType(Object.assign(Object.assign({}, interfaceConfig), { interfaces: [...interfaceConfig.interfaces, type || new _graphql.GraphQLInterfaceType({ name: state.name, fields: {} })] })); } else if (typeInfo.objectTypeDef) { const existingType = (_d = typeInfo.objectTypeDef) === null || _d === void 0 ? void 0 : _d.getInterfaces().find(_ref3 => { let { name } = _ref3; return name === state.name; }); if (existingType) { return; } const type = schema.getType(state.name); const objectTypeConfig = (_e = typeInfo.objectTypeDef) === null || _e === void 0 ? void 0 : _e.toConfig(); typeInfo.objectTypeDef = new _graphql.GraphQLObjectType(Object.assign(Object.assign({}, objectTypeConfig), { interfaces: [...objectTypeConfig.interfaces, type || new _graphql.GraphQLInterfaceType({ name: state.name, fields: {} })] })); } } } }); const currentTypeToExtend = typeInfo.interfaceDef || typeInfo.objectTypeDef; const siblingInterfaces = (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.getInterfaces()) || []; const siblingInterfaceNames = siblingInterfaces.map(_ref4 => { let { name } = _ref4; return name; }); const possibleInterfaces = schemaInterfaces.concat([...inlineInterfaces].map(name => ({ name }))).filter(_ref5 => { let { name } = _ref5; return name !== (currentTypeToExtend === null || currentTypeToExtend === void 0 ? void 0 : currentTypeToExtend.name) && !siblingInterfaceNames.includes(name); }); return (0, _autocompleteUtils.hintList)(token, possibleInterfaces.map(type => { const result = { label: type.name, kind: _types.CompletionItemKind.Interface, type }; if (type === null || type === void 0 ? void 0 : type.description) { result.documentation = type.description; } return result; })); } function getSuggestionsForFragmentTypeConditions(token, typeInfo, schema, _kind) { let possibleTypes; if (typeInfo.parentType) { if ((0, _graphql.isAbstractType)(typeInfo.parentType)) { const abstractType = (0, _graphql.assertAbstractType)(typeInfo.parentType); const possibleObjTypes = schema.getPossibleTypes(abstractType); const possibleIfaceMap = Object.create(null); for (const type of possibleObjTypes) { for (const iface of type.getInterfaces()) { possibleIfaceMap[iface.name] = iface; } } possibleTypes = possibleObjTypes.concat((0, _autocompleteUtils.objectValues)(possibleIfaceMap)); } else { possibleTypes = [typeInfo.parentType]; } } else { const typeMap = schema.getTypeMap(); possibleTypes = (0, _autocompleteUtils.objectValues)(typeMap).filter(type => (0, _graphql.isCompositeType)(type) && !type.name.startsWith('__')); } return (0, _autocompleteUtils.hintList)(token, possibleTypes.map(type => { const namedType = (0, _graphql.getNamedType)(type); return { label: String(type), documentation: (namedType === null || namedType === void 0 ? void 0 : namedType.description) || '', kind: _types.CompletionItemKind.Field }; })); } function getSuggestionsForFragmentSpread(token, typeInfo, schema, queryText, fragmentDefs) { if (!queryText) { return []; } const typeMap = schema.getTypeMap(); const defState = (0, _autocompleteUtils.getDefinitionState)(token.state); const fragments = getFragmentDefinitions(queryText); if (fragmentDefs && fragmentDefs.length > 0) { fragments.push(...fragmentDefs); } const relevantFrags = fragments.filter(frag => typeMap[frag.typeCondition.name.value] && !(defState && defState.kind === _parser.RuleKinds.FRAGMENT_DEFINITION && defState.name === frag.name.value) && (0, _graphql.isCompositeType)(typeInfo.parentType) && (0, _graphql.isCompositeType)(typeMap[frag.typeCondition.name.value]) && (0, _graphql.doTypesOverlap)(schema, typeInfo.parentType, typeMap[frag.typeCondition.name.value])); return (0, _autocompleteUtils.hintList)(token, relevantFrags.map(frag => ({ label: frag.name.value, detail: String(typeMap[frag.typeCondition.name.value]), documentation: `fragment ${frag.name.value} on ${frag.typeCondition.name.value}`, kind: _types.CompletionItemKind.Field, type: typeMap[frag.typeCondition.name.value] }))); } const getParentDefinition = (state, kind) => { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; if (((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.kind) === kind) { return state.prevState; } if (((_c = (_b = state.prevState) === null || _b === void 0 ? void 0 : _b.prevState) === null || _c === void 0 ? void 0 : _c.kind) === kind) { return state.prevState.prevState; } if (((_f = (_e = (_d = state.prevState) === null || _d === void 0 ? void 0 : _d.prevState) === null || _e === void 0 ? void 0 : _e.prevState) === null || _f === void 0 ? void 0 : _f.kind) === kind) { return state.prevState.prevState.prevState; } if (((_k = (_j = (_h = (_g = state.prevState) === null || _g === void 0 ? void 0 : _g.prevState) === null || _h === void 0 ? void 0 : _h.prevState) === null || _j === void 0 ? void 0 : _j.prevState) === null || _k === void 0 ? void 0 : _k.kind) === kind) { return state.prevState.prevState.prevState.prevState; } }; function getVariableCompletions(queryText, schema, token) { let variableName = null; let variableType; const definitions = Object.create({}); runOnlineParser(queryText, (_, state) => { if ((state === null || state === void 0 ? void 0 : state.kind) === _parser.RuleKinds.VARIABLE && state.name) { variableName = state.name; } if ((state === null || state === void 0 ? void 0 : state.kind) === _parser.RuleKinds.NAMED_TYPE && variableName) { const parentDefinition = getParentDefinition(state, _parser.RuleKinds.TYPE); if (parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type) { variableType = schema.getType(parentDefinition === null || parentDefinition === void 0 ? void 0 : parentDefinition.type); } } if (variableName && variableType && !definitions[variableName]) { definitions[variableName] = { detail: variableType.toString(), insertText: token.string === '$' ? variableName : '$' + variableName, label: variableName, type: variableType, kind: _types.CompletionItemKind.Variable }; variableName = null; variableType = null; } }); return (0, _autocompleteUtils.objectValues)(definitions); } function getFragmentDefinitions(queryText) { const fragmentDefs = []; runOnlineParser(queryText, (_, state) => { if (state.kind === _parser.RuleKinds.FRAGMENT_DEFINITION && state.name && state.type) { fragmentDefs.push({ kind: _parser.RuleKinds.FRAGMENT_DEFINITION, name: { kind: _graphql.Kind.NAME, value: state.name }, selectionSet: { kind: _parser.RuleKinds.SELECTION_SET, selections: [] }, typeCondition: { kind: _parser.RuleKinds.NAMED_TYPE, name: { kind: _graphql.Kind.NAME, value: state.type } } }); } }); return fragmentDefs; } function getSuggestionsForVariableDefinition(token, schema, _kind) { const inputTypeMap = schema.getTypeMap(); const inputTypes = (0, _autocompleteUtils.objectValues)(inputTypeMap).filter(_graphql.isInputType); return (0, _autocompleteUtils.hintList)(token, inputTypes.map(type => ({ label: type.name, documentation: type.description, kind: _types.CompletionItemKind.Variable }))); } function getSuggestionsForDirective(token, state, schema, _kind) { var _a; if ((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.kind) { const directives = schema.getDirectives().filter(directive => canUseDirective(state.prevState, directive)); return (0, _autocompleteUtils.hintList)(token, directives.map(directive => ({ label: directive.name, documentation: directive.description || '', kind: _types.CompletionItemKind.Function }))); } return []; } function getTokenAtPosition(queryText, cursor) { let offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; let styleAtCursor = null; let stateAtCursor = null; let stringAtCursor = null; const token = runOnlineParser(queryText, (stream, state, style, index) => { if (index !== cursor.line || stream.getCurrentPosition() + offset < cursor.character + 1) { return; } styleAtCursor = style; stateAtCursor = Object.assign({}, state); stringAtCursor = stream.current(); return 'BREAK'; }); return { start: token.start, end: token.end, string: stringAtCursor || token.string, state: stateAtCursor || token.state, style: styleAtCursor || token.style }; } function runOnlineParser(queryText, callback) { const lines = queryText.split('\n'); const parser = (0, _parser.onlineParser)(); let state = parser.startState(); let style = ''; let stream = new _parser.CharacterStream(''); for (let i = 0; i < lines.length; i++) { stream = new _parser.CharacterStream(lines[i]); while (!stream.eol()) { style = parser.token(stream, state); const code = callback(stream, state, style, i); if (code === 'BREAK') { break; } } callback(stream, state, style, i); if (!state.kind) { state = parser.startState(); } } return { start: stream.getStartOfToken(), end: stream.getCurrentPosition(), string: stream.current(), state, style }; } function canUseDirective(state, directive) { if (!(state === null || state === void 0 ? void 0 : state.kind)) { return false; } const { kind, prevState } = state; const { locations } = directive; switch (kind) { case _parser.RuleKinds.QUERY: return locations.includes(_graphql.DirectiveLocation.QUERY); case _parser.RuleKinds.MUTATION: return locations.includes(_graphql.DirectiveLocation.MUTATION); case _parser.RuleKinds.SUBSCRIPTION: return locations.includes(_graphql.DirectiveLocation.SUBSCRIPTION); case _parser.RuleKinds.FIELD: case _parser.RuleKinds.ALIASED_FIELD: return locations.includes(_graphql.DirectiveLocation.FIELD); case _parser.RuleKinds.FRAGMENT_DEFINITION: return locations.includes(_graphql.DirectiveLocation.FRAGMENT_DEFINITION); case _parser.RuleKinds.FRAGMENT_SPREAD: return locations.includes(_graphql.DirectiveLocation.FRAGMENT_SPREAD); case _parser.RuleKinds.INLINE_FRAGMENT: return locations.includes(_graphql.DirectiveLocation.INLINE_FRAGMENT); case _parser.RuleKinds.SCHEMA_DEF: return locations.includes(_graphql.DirectiveLocation.SCHEMA); case _parser.RuleKinds.SCALAR_DEF: return locations.includes(_graphql.DirectiveLocation.SCALAR); case _parser.RuleKinds.OBJECT_TYPE_DEF: return locations.includes(_graphql.DirectiveLocation.OBJECT); case _parser.RuleKinds.FIELD_DEF: return locations.includes(_graphql.DirectiveLocation.FIELD_DEFINITION); case _parser.RuleKinds.INTERFACE_DEF: return locations.includes(_graphql.DirectiveLocation.INTERFACE); case _parser.RuleKinds.UNION_DEF: return locations.includes(_graphql.DirectiveLocation.UNION); case _parser.RuleKinds.ENUM_DEF: return locations.includes(_graphql.DirectiveLocation.ENUM); case _parser.RuleKinds.ENUM_VALUE: return locations.includes(_graphql.DirectiveLocation.ENUM_VALUE); case _parser.RuleKinds.INPUT_DEF: return locations.includes(_graphql.DirectiveLocation.INPUT_OBJECT); case _parser.RuleKinds.INPUT_VALUE_DEF: const prevStateKind = prevState === null || prevState === void 0 ? void 0 : prevState.kind; switch (prevStateKind) { case _parser.RuleKinds.ARGUMENTS_DEF: return locations.includes(_graphql.DirectiveLocation.ARGUMENT_DEFINITION); case _parser.RuleKinds.INPUT_DEF: return locations.includes(_graphql.DirectiveLocation.INPUT_FIELD_DEFINITION); } } return false; } function getTypeInfo(schema, tokenState) { let argDef; let argDefs; let directiveDef; let enumValue; let fieldDef; let inputType; let objectTypeDef; let objectFieldDefs; let parentType; let type; let interfaceDef; (0, _autocompleteUtils.forEachState)(tokenState, state => { var _a; switch (state.kind) { case _parser.RuleKinds.QUERY: case 'ShortQuery': type = schema.getQueryType(); break; case _parser.RuleKinds.MUTATION: type = schema.getMutationType(); break; case _parser.RuleKinds.SUBSCRIPTION: type = schema.getSubscriptionType(); break; case _parser.RuleKinds.INLINE_FRAGMENT: case _parser.RuleKinds.FRAGMENT_DEFINITION: if (state.type) { type = schema.getType(state.type); } break; case _parser.RuleKinds.FIELD: case _parser.RuleKinds.ALIASED_FIELD: { if (!type || !state.name) { fieldDef = null; } else { fieldDef = parentType ? (0, _autocompleteUtils.getFieldDef)(schema, parentType, state.name) : null; type = fieldDef ? fieldDef.type : null; } break; } case _parser.RuleKinds.SELECTION_SET: parentType = (0, _graphql.getNamedType)(type); break; case _parser.RuleKinds.DIRECTIVE: directiveDef = state.name ? schema.getDirective(state.name) : null; break; case _parser.RuleKinds.INTERFACE_DEF: if (state.name) { objectTypeDef = null; interfaceDef = new _graphql.GraphQLInterfaceType({ name: state.name, interfaces: [], fields: {} }); } break; case _parser.RuleKinds.OBJECT_TYPE_DEF: if (state.name) { interfaceDef = null; objectTypeDef = new _graphql.GraphQLObjectType({ name: state.name, interfaces: [], fields: {} }); } break; case _parser.RuleKinds.ARGUMENTS: { if (state.prevState) { switch (state.prevState.kind) { case _parser.RuleKinds.FIELD: argDefs = fieldDef && fieldDef.args; break; case _parser.RuleKinds.DIRECTIVE: argDefs = directiveDef && directiveDef.args; break; case _parser.RuleKinds.ALIASED_FIELD: { const name = (_a = state.prevState) === null || _a === void 0 ? void 0 : _a.name; if (!name) { argDefs = null; break; } const field = parentType ? (0, _autocompleteUtils.getFieldDef)(schema, parentType, name) : null; if (!field) { argDefs = null; break; } argDefs = field.args; break; } default: argDefs = null; break; } } else { argDefs = null; } break; } case _parser.RuleKinds.ARGUMENT: if (argDefs) { for (let i = 0; i < argDefs.length; i++) { if (argDefs[i].name === state.name) { argDef = argDefs[i]; break; } } } inputType = argDef === null || argDef === void 0 ? void 0 : argDef.type; break; case _parser.RuleKinds.ENUM_VALUE: const enumType = (0, _graphql.getNamedType)(inputType); enumValue = enumType instanceof _graphql.GraphQLEnumType ? enumType.getValues().find(val => val.value === state.name) : null; break; case _parser.RuleKinds.LIST_VALUE: const nullableType = (0, _graphql.getNullableType)(inputType); inputType = nullableType instanceof _graphql.GraphQLList ? nullableType.ofType : null; break; case _parser.RuleKinds.OBJECT_VALUE: const objectType = (0, _graphql.getNamedType)(inputType); objectFieldDefs = objectType instanceof _graphql.GraphQLInputObjectType ? objectType.getFields() : null; break; case _parser.RuleKinds.OBJECT_FIELD: const objectField = state.name && objectFieldDefs ? objectFieldDefs[state.name] : null; inputType = objectField === null || objectField === void 0 ? void 0 : objectField.type; break; case _parser.RuleKinds.NAMED_TYPE: if (state.name) { type = schema.getType(state.name); } break; } }); return { argDef, argDefs, directiveDef, enumValue, fieldDef, inputType, objectFieldDefs, parentType, type, interfaceDef, objectTypeDef }; } var GraphQLDocumentMode; exports.GraphQLDocumentMode = GraphQLDocumentMode; (function (GraphQLDocumentMode) { GraphQLDocumentMode["TYPE_SYSTEM"] = "TYPE_SYSTEM"; GraphQLDocumentMode["EXECUTABLE"] = "EXECUTABLE"; })(GraphQLDocumentMode || (exports.GraphQLDocumentMode = GraphQLDocumentMode = {})); function getDocumentMode(documentText, uri) { if (uri === null || uri === void 0 ? void 0 : uri.endsWith('.graphqls')) { return GraphQLDocumentMode.TYPE_SYSTEM; } return hasTypeSystemDefinitions(documentText) ? GraphQLDocumentMode.TYPE_SYSTEM : GraphQLDocumentMode.EXECUTABLE; } function unwrapType(state) { if (state.prevState && state.kind && [_parser.RuleKinds.NAMED_TYPE, _parser.RuleKinds.LIST_TYPE, _parser.RuleKinds.TYPE, _parser.RuleKinds.NON_NULL_TYPE].includes(state.kind)) { return unwrapType(state.prevState); } return state; } /***/ }), /***/ "../../graphql-language-service/esm/interface/getDefinition.js": /*!*********************************************************************!*\ !*** ../../graphql-language-service/esm/interface/getDefinition.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.LANGUAGE = void 0; exports.getDefinitionQueryResultForDefinitionNode = getDefinitionQueryResultForDefinitionNode; exports.getDefinitionQueryResultForField = getDefinitionQueryResultForField; exports.getDefinitionQueryResultForFragmentSpread = getDefinitionQueryResultForFragmentSpread; exports.getDefinitionQueryResultForNamedType = getDefinitionQueryResultForNamedType; var _utils = __webpack_require__(/*! ../utils */ "../../graphql-language-service/esm/utils/index.js"); var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; const LANGUAGE = 'GraphQL'; exports.LANGUAGE = LANGUAGE; function assert(value, message) { if (!value) { throw new Error(message); } } function getRange(text, node) { const location = node.loc; assert(location, 'Expected ASTNode to have a location.'); return (0, _utils.locToRange)(text, location); } function getPosition(text, node) { const location = node.loc; assert(location, 'Expected ASTNode to have a location.'); return (0, _utils.offsetToPosition)(text, location.start); } function getDefinitionQueryResultForNamedType(text, node, dependencies) { return __awaiter(this, void 0, void 0, function* () { const name = node.name.value; const defNodes = dependencies.filter(_ref => { let { definition } = _ref; return definition.name && definition.name.value === name; }); if (defNodes.length === 0) { throw new Error(`Definition not found for GraphQL type ${name}`); } const definitions = defNodes.map(_ref2 => { let { filePath, content, definition } = _ref2; return getDefinitionForNodeDefinition(filePath || '', content, definition); }); return { definitions, queryRange: definitions.map(_ => getRange(text, node)) }; }); } function getDefinitionQueryResultForField(fieldName, typeName, dependencies) { var _a; return __awaiter(this, void 0, void 0, function* () { const defNodes = dependencies.filter(_ref3 => { let { definition } = _ref3; return definition.name && definition.name.value === typeName; }); if (defNodes.length === 0) { throw new Error(`Definition not found for GraphQL type ${typeName}`); } const definitions = []; for (const { filePath, content, definition } of defNodes) { const fieldDefinition = (_a = definition.fields) === null || _a === void 0 ? void 0 : _a.find(item => item.name.value === fieldName); if (fieldDefinition == null) { continue; } definitions.push(getDefinitionForFieldDefinition(filePath || '', content, fieldDefinition)); } return { definitions, queryRange: [] }; }); } function getDefinitionQueryResultForFragmentSpread(text, fragment, dependencies) { return __awaiter(this, void 0, void 0, function* () { const name = fragment.name.value; const defNodes = dependencies.filter(_ref4 => { let { definition } = _ref4; return definition.name.value === name; }); if (defNodes.length === 0) { throw new Error(`Definition not found for GraphQL fragment ${name}`); } const definitions = defNodes.map(_ref5 => { let { filePath, content, definition } = _ref5; return getDefinitionForFragmentDefinition(filePath || '', content, definition); }); return { definitions, queryRange: definitions.map(_ => getRange(text, fragment)) }; }); } function getDefinitionQueryResultForDefinitionNode(path, text, definition) { return { definitions: [getDefinitionForFragmentDefinition(path, text, definition)], queryRange: definition.name ? [getRange(text, definition.name)] : [] }; } function getDefinitionForFragmentDefinition(path, text, definition) { const { name } = definition; if (!name) { throw new Error('Expected ASTNode to have a Name.'); } return { path, position: getPosition(text, definition), range: getRange(text, definition), name: name.value || '', language: LANGUAGE, projectRoot: path }; } function getDefinitionForNodeDefinition(path, text, definition) { const { name } = definition; assert(name, 'Expected ASTNode to have a Name.'); return { path, position: getPosition(text, definition), range: getRange(text, definition), name: name.value || '', language: LANGUAGE, projectRoot: path }; } function getDefinitionForFieldDefinition(path, text, definition) { const { name } = definition; assert(name, 'Expected ASTNode to have a Name.'); return { path, position: getPosition(text, definition), range: getRange(text, definition), name: name.value || '', language: LANGUAGE, projectRoot: path }; } /***/ }), /***/ "../../graphql-language-service/esm/interface/getDiagnostics.js": /*!**********************************************************************!*\ !*** ../../graphql-language-service/esm/interface/getDiagnostics.js ***! \**********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.SEVERITY = exports.DIAGNOSTIC_SEVERITY = void 0; exports.getDiagnostics = getDiagnostics; exports.getRange = getRange; exports.validateQuery = validateQuery; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _parser = __webpack_require__(/*! ../parser */ "../../graphql-language-service/esm/parser/index.js"); var _utils = __webpack_require__(/*! ../utils */ "../../graphql-language-service/esm/utils/index.js"); const SEVERITY = { Error: 'Error', Warning: 'Warning', Information: 'Information', Hint: 'Hint' }; exports.SEVERITY = SEVERITY; const DIAGNOSTIC_SEVERITY = { [SEVERITY.Error]: 1, [SEVERITY.Warning]: 2, [SEVERITY.Information]: 3, [SEVERITY.Hint]: 4 }; exports.DIAGNOSTIC_SEVERITY = DIAGNOSTIC_SEVERITY; const invariant = (condition, message) => { if (!condition) { throw new Error(message); } }; function getDiagnostics(query) { let schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; let customRules = arguments.length > 2 ? arguments[2] : undefined; let isRelayCompatMode = arguments.length > 3 ? arguments[3] : undefined; let externalFragments = arguments.length > 4 ? arguments[4] : undefined; var _a, _b; let ast = null; let fragments = ''; if (externalFragments) { fragments = typeof externalFragments === 'string' ? externalFragments : externalFragments.reduce((acc, node) => acc + (0, _graphql.print)(node) + '\n\n', ''); } const enhancedQuery = fragments ? `${query}\n\n${fragments}` : query; try { ast = (0, _graphql.parse)(enhancedQuery); } catch (error) { if (error instanceof _graphql.GraphQLError) { const range = getRange((_b = (_a = error.locations) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : { line: 0, column: 0 }, enhancedQuery); return [{ severity: DIAGNOSTIC_SEVERITY.Error, message: error.message, source: 'GraphQL: Syntax', range }]; } throw error; } return validateQuery(ast, schema, customRules, isRelayCompatMode); } function validateQuery(ast) { let schema = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; let customRules = arguments.length > 2 ? arguments[2] : undefined; let isRelayCompatMode = arguments.length > 3 ? arguments[3] : undefined; if (!schema) { return []; } const validationErrorAnnotations = (0, _utils.validateWithCustomRules)(schema, ast, customRules, isRelayCompatMode).flatMap(error => annotations(error, DIAGNOSTIC_SEVERITY.Error, 'Validation')); const deprecationWarningAnnotations = (0, _graphql.validate)(schema, ast, [_graphql.NoDeprecatedCustomRule]).flatMap(error => annotations(error, DIAGNOSTIC_SEVERITY.Warning, 'Deprecation')); return validationErrorAnnotations.concat(deprecationWarningAnnotations); } function annotations(error, severity, type) { if (!error.nodes) { return []; } const highlightedNodes = []; for (const [i, node] of error.nodes.entries()) { const highlightNode = node.kind !== 'Variable' && 'name' in node && node.name !== undefined ? node.name : 'variable' in node && node.variable !== undefined ? node.variable : node; if (highlightNode) { invariant(error.locations, 'GraphQL validation error requires locations.'); const loc = error.locations[i]; const highlightLoc = getLocation(highlightNode); const end = loc.column + (highlightLoc.end - highlightLoc.start); highlightedNodes.push({ source: `GraphQL: ${type}`, message: error.message, severity, range: new _utils.Range(new _utils.Position(loc.line - 1, loc.column - 1), new _utils.Position(loc.line - 1, end)) }); } } return highlightedNodes; } function getRange(location, queryText) { const parser = (0, _parser.onlineParser)(); const state = parser.startState(); const lines = queryText.split('\n'); invariant(lines.length >= location.line, 'Query text must have more lines than where the error happened'); let stream = null; for (let i = 0; i < location.line; i++) { stream = new _parser.CharacterStream(lines[i]); while (!stream.eol()) { const style = parser.token(stream, state); if (style === 'invalidchar') { break; } } } invariant(stream, 'Expected Parser stream to be available.'); const line = location.line - 1; const start = stream.getStartOfToken(); const end = stream.getCurrentPosition(); return new _utils.Range(new _utils.Position(line, start), new _utils.Position(line, end)); } function getLocation(node) { const typeCastedNode = node; const location = typeCastedNode.loc; invariant(location, 'Expected ASTNode to have a location.'); return location; } /***/ }), /***/ "../../graphql-language-service/esm/interface/getHoverInformation.js": /*!***************************************************************************!*\ !*** ../../graphql-language-service/esm/interface/getHoverInformation.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getHoverInformation = getHoverInformation; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _getAutocompleteSuggestions = __webpack_require__(/*! ./getAutocompleteSuggestions */ "../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js"); function getHoverInformation(schema, queryText, cursor, contextToken, config) { const token = contextToken || (0, _getAutocompleteSuggestions.getTokenAtPosition)(queryText, cursor); if (!schema || !token || !token.state) { return ''; } const { kind, step } = token.state; const typeInfo = (0, _getAutocompleteSuggestions.getTypeInfo)(schema, token.state); const options = Object.assign(Object.assign({}, config), { schema }); if (kind === 'Field' && step === 0 && typeInfo.fieldDef || kind === 'AliasedField' && step === 2 && typeInfo.fieldDef) { const into = []; renderMdCodeStart(into, options); renderField(into, typeInfo, options); renderMdCodeEnd(into, options); renderDescription(into, options, typeInfo.fieldDef); return into.join('').trim(); } if (kind === 'Directive' && step === 1 && typeInfo.directiveDef) { const into = []; renderMdCodeStart(into, options); renderDirective(into, typeInfo, options); renderMdCodeEnd(into, options); renderDescription(into, options, typeInfo.directiveDef); return into.join('').trim(); } if (kind === 'Argument' && step === 0 && typeInfo.argDef) { const into = []; renderMdCodeStart(into, options); renderArg(into, typeInfo, options); renderMdCodeEnd(into, options); renderDescription(into, options, typeInfo.argDef); return into.join('').trim(); } if (kind === 'EnumValue' && typeInfo.enumValue && 'description' in typeInfo.enumValue) { const into = []; renderMdCodeStart(into, options); renderEnumValue(into, typeInfo, options); renderMdCodeEnd(into, options); renderDescription(into, options, typeInfo.enumValue); return into.join('').trim(); } if (kind === 'NamedType' && typeInfo.type && 'description' in typeInfo.type) { const into = []; renderMdCodeStart(into, options); renderType(into, typeInfo, options, typeInfo.type); renderMdCodeEnd(into, options); renderDescription(into, options, typeInfo.type); return into.join('').trim(); } return ''; } function renderMdCodeStart(into, options) { if (options.useMarkdown) { text(into, '```graphql\n'); } } function renderMdCodeEnd(into, options) { if (options.useMarkdown) { text(into, '\n```'); } } function renderField(into, typeInfo, options) { renderQualifiedField(into, typeInfo, options); renderTypeAnnotation(into, typeInfo, options, typeInfo.type); } function renderQualifiedField(into, typeInfo, options) { if (!typeInfo.fieldDef) { return; } const fieldName = typeInfo.fieldDef.name; if (fieldName.slice(0, 2) !== '__') { renderType(into, typeInfo, options, typeInfo.parentType); text(into, '.'); } text(into, fieldName); } function renderDirective(into, typeInfo, _options) { if (!typeInfo.directiveDef) { return; } const name = '@' + typeInfo.directiveDef.name; text(into, name); } function renderArg(into, typeInfo, options) { if (typeInfo.directiveDef) { renderDirective(into, typeInfo, options); } else if (typeInfo.fieldDef) { renderQualifiedField(into, typeInfo, options); } if (!typeInfo.argDef) { return; } const { name } = typeInfo.argDef; text(into, '('); text(into, name); renderTypeAnnotation(into, typeInfo, options, typeInfo.inputType); text(into, ')'); } function renderTypeAnnotation(into, typeInfo, options, t) { text(into, ': '); renderType(into, typeInfo, options, t); } function renderEnumValue(into, typeInfo, options) { if (!typeInfo.enumValue) { return; } const { name } = typeInfo.enumValue; renderType(into, typeInfo, options, typeInfo.inputType); text(into, '.'); text(into, name); } function renderType(into, typeInfo, options, t) { if (!t) { return; } if (t instanceof _graphql.GraphQLNonNull) { renderType(into, typeInfo, options, t.ofType); text(into, '!'); } else if (t instanceof _graphql.GraphQLList) { text(into, '['); renderType(into, typeInfo, options, t.ofType); text(into, ']'); } else { text(into, t.name); } } function renderDescription(into, options, def) { if (!def) { return; } const description = typeof def.description === 'string' ? def.description : null; if (description) { text(into, '\n\n'); text(into, description); } renderDeprecation(into, options, def); } function renderDeprecation(into, _options, def) { if (!def) { return; } const reason = def.deprecationReason || null; if (!reason) { return; } text(into, '\n\n'); text(into, 'Deprecated: '); text(into, reason); } function text(into, content) { into.push(content); } /***/ }), /***/ "../../graphql-language-service/esm/interface/getOutline.js": /*!******************************************************************!*\ !*** ../../graphql-language-service/esm/interface/getOutline.js ***! \******************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getOutline = getOutline; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _utils = __webpack_require__(/*! ../utils */ "../../graphql-language-service/esm/utils/index.js"); const { INLINE_FRAGMENT } = _graphql.Kind; const OUTLINEABLE_KINDS = { Field: true, OperationDefinition: true, Document: true, SelectionSet: true, Name: true, FragmentDefinition: true, FragmentSpread: true, InlineFragment: true, ObjectTypeDefinition: true, InputObjectTypeDefinition: true, InterfaceTypeDefinition: true, EnumTypeDefinition: true, EnumValueDefinition: true, InputValueDefinition: true, FieldDefinition: true }; function getOutline(documentText) { let ast; try { ast = (0, _graphql.parse)(documentText); } catch (_a) { return null; } const visitorFns = outlineTreeConverter(documentText); const outlineTrees = (0, _graphql.visit)(ast, { leave(node) { if (visitorFns !== undefined && node.kind in visitorFns) { return visitorFns[node.kind](node); } return null; } }); return { outlineTrees }; } function outlineTreeConverter(docText) { const meta = node => { return { representativeName: node.name, startPosition: (0, _utils.offsetToPosition)(docText, node.loc.start), endPosition: (0, _utils.offsetToPosition)(docText, node.loc.end), kind: node.kind, children: node.selectionSet || node.fields || node.values || node.arguments || [] }; }; return { Field(node) { const tokenizedText = node.alias ? [buildToken('plain', node.alias), buildToken('plain', ': ')] : []; tokenizedText.push(buildToken('plain', node.name)); return Object.assign({ tokenizedText }, meta(node)); }, OperationDefinition: node => Object.assign({ tokenizedText: [buildToken('keyword', node.operation), buildToken('whitespace', ' '), buildToken('class-name', node.name)] }, meta(node)), Document: node => node.definitions, SelectionSet: node => concatMap(node.selections, child => { return child.kind === INLINE_FRAGMENT ? child.selectionSet : child; }), Name: node => node.value, FragmentDefinition: node => Object.assign({ tokenizedText: [buildToken('keyword', 'fragment'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] }, meta(node)), InterfaceTypeDefinition: node => Object.assign({ tokenizedText: [buildToken('keyword', 'interface'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] }, meta(node)), EnumTypeDefinition: node => Object.assign({ tokenizedText: [buildToken('keyword', 'enum'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] }, meta(node)), EnumValueDefinition: node => Object.assign({ tokenizedText: [buildToken('plain', node.name)] }, meta(node)), ObjectTypeDefinition: node => Object.assign({ tokenizedText: [buildToken('keyword', 'type'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] }, meta(node)), InputObjectTypeDefinition: node => Object.assign({ tokenizedText: [buildToken('keyword', 'input'), buildToken('whitespace', ' '), buildToken('class-name', node.name)] }, meta(node)), FragmentSpread: node => Object.assign({ tokenizedText: [buildToken('plain', '...'), buildToken('class-name', node.name)] }, meta(node)), InputValueDefinition(node) { return Object.assign({ tokenizedText: [buildToken('plain', node.name)] }, meta(node)); }, FieldDefinition(node) { return Object.assign({ tokenizedText: [buildToken('plain', node.name)] }, meta(node)); }, InlineFragment: node => node.selectionSet }; } function buildToken(kind, value) { return { kind, value }; } function concatMap(arr, fn) { const res = []; for (let i = 0; i < arr.length; i++) { const x = fn(arr[i], i); if (Array.isArray(x)) { res.push(...x); } else { res.push(x); } } return res; } /***/ }), /***/ "../../graphql-language-service/esm/interface/index.js": /*!*************************************************************!*\ !*** ../../graphql-language-service/esm/interface/index.js ***! \*************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var _exportNames = { getOutline: true, getHoverInformation: true }; Object.defineProperty(exports, "getHoverInformation", ({ enumerable: true, get: function () { return _getHoverInformation.getHoverInformation; } })); Object.defineProperty(exports, "getOutline", ({ enumerable: true, get: function () { return _getOutline.getOutline; } })); var _autocompleteUtils = __webpack_require__(/*! ./autocompleteUtils */ "../../graphql-language-service/esm/interface/autocompleteUtils.js"); Object.keys(_autocompleteUtils).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _autocompleteUtils[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _autocompleteUtils[key]; } }); }); var _getAutocompleteSuggestions = __webpack_require__(/*! ./getAutocompleteSuggestions */ "../../graphql-language-service/esm/interface/getAutocompleteSuggestions.js"); Object.keys(_getAutocompleteSuggestions).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _getAutocompleteSuggestions[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _getAutocompleteSuggestions[key]; } }); }); var _getDefinition = __webpack_require__(/*! ./getDefinition */ "../../graphql-language-service/esm/interface/getDefinition.js"); Object.keys(_getDefinition).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _getDefinition[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _getDefinition[key]; } }); }); var _getDiagnostics = __webpack_require__(/*! ./getDiagnostics */ "../../graphql-language-service/esm/interface/getDiagnostics.js"); Object.keys(_getDiagnostics).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _getDiagnostics[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _getDiagnostics[key]; } }); }); var _getOutline = __webpack_require__(/*! ./getOutline */ "../../graphql-language-service/esm/interface/getOutline.js"); var _getHoverInformation = __webpack_require__(/*! ./getHoverInformation */ "../../graphql-language-service/esm/interface/getHoverInformation.js"); /***/ }), /***/ "../../graphql-language-service/esm/parser/CharacterStream.js": /*!********************************************************************!*\ !*** ../../graphql-language-service/esm/parser/CharacterStream.js ***! \********************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = void 0; class CharacterStream { constructor(sourceText) { var _this = this; this._start = 0; this._pos = 0; this.getStartOfToken = () => this._start; this.getCurrentPosition = () => this._pos; this.eol = () => this._sourceText.length === this._pos; this.sol = () => this._pos === 0; this.peek = () => { return this._sourceText.charAt(this._pos) || null; }; this.next = () => { const char = this._sourceText.charAt(this._pos); this._pos++; return char; }; this.eat = pattern => { const isMatched = this._testNextCharacter(pattern); if (isMatched) { this._start = this._pos; this._pos++; return this._sourceText.charAt(this._pos - 1); } return undefined; }; this.eatWhile = match => { let isMatched = this._testNextCharacter(match); let didEat = false; if (isMatched) { didEat = isMatched; this._start = this._pos; } while (isMatched) { this._pos++; isMatched = this._testNextCharacter(match); didEat = true; } return didEat; }; this.eatSpace = () => this.eatWhile(/[\s\u00a0]/); this.skipToEnd = () => { this._pos = this._sourceText.length; }; this.skipTo = position => { this._pos = position; }; this.match = function (pattern) { let consume = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; let caseFold = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; let token = null; let match = null; if (typeof pattern === 'string') { const regex = new RegExp(pattern, caseFold ? 'i' : 'g'); match = regex.test(_this._sourceText.slice(_this._pos, _this._pos + pattern.length)); token = pattern; } else if (pattern instanceof RegExp) { match = _this._sourceText.slice(_this._pos).match(pattern); token = match === null || match === void 0 ? void 0 : match[0]; } if (match != null && (typeof pattern === 'string' || match instanceof Array && _this._sourceText.startsWith(match[0], _this._pos))) { if (consume) { _this._start = _this._pos; if (token && token.length) { _this._pos += token.length; } } return match; } return false; }; this.backUp = num => { this._pos -= num; }; this.column = () => this._pos; this.indentation = () => { const match = this._sourceText.match(/\s*/); let indent = 0; if (match && match.length !== 0) { const whiteSpaces = match[0]; let pos = 0; while (whiteSpaces.length > pos) { if (whiteSpaces.charCodeAt(pos) === 9) { indent += 2; } else { indent++; } pos++; } } return indent; }; this.current = () => this._sourceText.slice(this._start, this._pos); this._sourceText = sourceText; } _testNextCharacter(pattern) { const character = this._sourceText.charAt(this._pos); let isMatched = false; if (typeof pattern === 'string') { isMatched = character === pattern; } else { isMatched = pattern instanceof RegExp ? pattern.test(character) : pattern(character); } return isMatched; } } exports["default"] = CharacterStream; /***/ }), /***/ "../../graphql-language-service/esm/parser/RuleHelpers.js": /*!****************************************************************!*\ !*** ../../graphql-language-service/esm/parser/RuleHelpers.js ***! \****************************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.butNot = butNot; exports.list = list; exports.opt = opt; exports.p = p; exports.t = t; function opt(ofRule) { return { ofRule }; } function list(ofRule, separator) { return { ofRule, isList: true, separator }; } function butNot(rule, exclusions) { const ruleMatch = rule.match; rule.match = token => { let check = false; if (ruleMatch) { check = ruleMatch(token); } return check && exclusions.every(exclusion => exclusion.match && !exclusion.match(token)); }; return rule; } function t(kind, style) { return { style, match: token => token.kind === kind }; } function p(value, style) { return { style: style || 'punctuation', match: token => token.kind === 'Punctuation' && token.value === value }; } /***/ }), /***/ "../../graphql-language-service/esm/parser/Rules.js": /*!**********************************************************!*\ !*** ../../graphql-language-service/esm/parser/Rules.js ***! \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.isIgnored = exports.ParseRules = exports.LexRules = void 0; var _RuleHelpers = __webpack_require__(/*! ./RuleHelpers */ "../../graphql-language-service/esm/parser/RuleHelpers.js"); var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); const isIgnored = ch => ch === ' ' || ch === '\t' || ch === ',' || ch === '\n' || ch === '\r' || ch === '\uFEFF' || ch === '\u00A0'; exports.isIgnored = isIgnored; const LexRules = { Name: /^[_A-Za-z][_0-9A-Za-z]*/, Punctuation: /^(?:!|\$|\(|\)|\.\.\.|:|=|&|@|\[|]|\{|\||\})/, Number: /^-?(?:0|(?:[1-9][0-9]*))(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?/, String: /^(?:"""(?:\\"""|[^"]|"[^"]|""[^"])*(?:""")?|"(?:[^"\\]|\\(?:"|\/|\\|b|f|n|r|t|u[0-9a-fA-F]{4}))*"?)/, Comment: /^#.*/ }; exports.LexRules = LexRules; const ParseRules = { Document: [(0, _RuleHelpers.list)('Definition')], Definition(token) { switch (token.value) { case '{': return 'ShortQuery'; case 'query': return 'Query'; case 'mutation': return 'Mutation'; case 'subscription': return 'Subscription'; case 'fragment': return _graphql.Kind.FRAGMENT_DEFINITION; case 'schema': return 'SchemaDef'; case 'scalar': return 'ScalarDef'; case 'type': return 'ObjectTypeDef'; case 'interface': return 'InterfaceDef'; case 'union': return 'UnionDef'; case 'enum': return 'EnumDef'; case 'input': return 'InputDef'; case 'extend': return 'ExtendDef'; case 'directive': return 'DirectiveDef'; } }, ShortQuery: ['SelectionSet'], Query: [word('query'), (0, _RuleHelpers.opt)(name('def')), (0, _RuleHelpers.opt)('VariableDefinitions'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], Mutation: [word('mutation'), (0, _RuleHelpers.opt)(name('def')), (0, _RuleHelpers.opt)('VariableDefinitions'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], Subscription: [word('subscription'), (0, _RuleHelpers.opt)(name('def')), (0, _RuleHelpers.opt)('VariableDefinitions'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], VariableDefinitions: [(0, _RuleHelpers.p)('('), (0, _RuleHelpers.list)('VariableDefinition'), (0, _RuleHelpers.p)(')')], VariableDefinition: ['Variable', (0, _RuleHelpers.p)(':'), 'Type', (0, _RuleHelpers.opt)('DefaultValue')], Variable: [(0, _RuleHelpers.p)('$', 'variable'), name('variable')], DefaultValue: [(0, _RuleHelpers.p)('='), 'Value'], SelectionSet: [(0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('Selection'), (0, _RuleHelpers.p)('}')], Selection(token, stream) { return token.value === '...' ? stream.match(/[\s\u00a0,]*(on\b|@|{)/, false) ? 'InlineFragment' : 'FragmentSpread' : stream.match(/[\s\u00a0,]*:/, false) ? 'AliasedField' : 'Field'; }, AliasedField: [name('property'), (0, _RuleHelpers.p)(':'), name('qualifier'), (0, _RuleHelpers.opt)('Arguments'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.opt)('SelectionSet')], Field: [name('property'), (0, _RuleHelpers.opt)('Arguments'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.opt)('SelectionSet')], Arguments: [(0, _RuleHelpers.p)('('), (0, _RuleHelpers.list)('Argument'), (0, _RuleHelpers.p)(')')], Argument: [name('attribute'), (0, _RuleHelpers.p)(':'), 'Value'], FragmentSpread: [(0, _RuleHelpers.p)('...'), name('def'), (0, _RuleHelpers.list)('Directive')], InlineFragment: [(0, _RuleHelpers.p)('...'), (0, _RuleHelpers.opt)('TypeCondition'), (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], FragmentDefinition: [word('fragment'), (0, _RuleHelpers.opt)((0, _RuleHelpers.butNot)(name('def'), [word('on')])), 'TypeCondition', (0, _RuleHelpers.list)('Directive'), 'SelectionSet'], TypeCondition: [word('on'), 'NamedType'], Value(token) { switch (token.kind) { case 'Number': return 'NumberValue'; case 'String': return 'StringValue'; case 'Punctuation': switch (token.value) { case '[': return 'ListValue'; case '{': return 'ObjectValue'; case '$': return 'Variable'; case '&': return 'NamedType'; } return null; case 'Name': switch (token.value) { case 'true': case 'false': return 'BooleanValue'; } if (token.value === 'null') { return 'NullValue'; } return 'EnumValue'; } }, NumberValue: [(0, _RuleHelpers.t)('Number', 'number')], StringValue: [{ style: 'string', match: token => token.kind === 'String', update(state, token) { if (token.value.startsWith('"""')) { state.inBlockstring = !token.value.slice(3).endsWith('"""'); } } }], BooleanValue: [(0, _RuleHelpers.t)('Name', 'builtin')], NullValue: [(0, _RuleHelpers.t)('Name', 'keyword')], EnumValue: [name('string-2')], ListValue: [(0, _RuleHelpers.p)('['), (0, _RuleHelpers.list)('Value'), (0, _RuleHelpers.p)(']')], ObjectValue: [(0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('ObjectField'), (0, _RuleHelpers.p)('}')], ObjectField: [name('attribute'), (0, _RuleHelpers.p)(':'), 'Value'], Type(token) { return token.value === '[' ? 'ListType' : 'NonNullType'; }, ListType: [(0, _RuleHelpers.p)('['), 'Type', (0, _RuleHelpers.p)(']'), (0, _RuleHelpers.opt)((0, _RuleHelpers.p)('!'))], NonNullType: ['NamedType', (0, _RuleHelpers.opt)((0, _RuleHelpers.p)('!'))], NamedType: [type('atom')], Directive: [(0, _RuleHelpers.p)('@', 'meta'), name('meta'), (0, _RuleHelpers.opt)('Arguments')], DirectiveDef: [word('directive'), (0, _RuleHelpers.p)('@', 'meta'), name('meta'), (0, _RuleHelpers.opt)('ArgumentsDef'), word('on'), (0, _RuleHelpers.list)('DirectiveLocation', (0, _RuleHelpers.p)('|'))], InterfaceDef: [word('interface'), name('atom'), (0, _RuleHelpers.opt)('Implements'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('FieldDef'), (0, _RuleHelpers.p)('}')], Implements: [word('implements'), (0, _RuleHelpers.list)('NamedType', (0, _RuleHelpers.p)('&'))], DirectiveLocation: [name('string-2')], SchemaDef: [word('schema'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('OperationTypeDef'), (0, _RuleHelpers.p)('}')], OperationTypeDef: [name('keyword'), (0, _RuleHelpers.p)(':'), name('atom')], ScalarDef: [word('scalar'), name('atom'), (0, _RuleHelpers.list)('Directive')], ObjectTypeDef: [word('type'), name('atom'), (0, _RuleHelpers.opt)('Implements'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('FieldDef'), (0, _RuleHelpers.p)('}')], FieldDef: [name('property'), (0, _RuleHelpers.opt)('ArgumentsDef'), (0, _RuleHelpers.p)(':'), 'Type', (0, _RuleHelpers.list)('Directive')], ArgumentsDef: [(0, _RuleHelpers.p)('('), (0, _RuleHelpers.list)('InputValueDef'), (0, _RuleHelpers.p)(')')], InputValueDef: [name('attribute'), (0, _RuleHelpers.p)(':'), 'Type', (0, _RuleHelpers.opt)('DefaultValue'), (0, _RuleHelpers.list)('Directive')], UnionDef: [word('union'), name('atom'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('='), (0, _RuleHelpers.list)('UnionMember', (0, _RuleHelpers.p)('|'))], UnionMember: ['NamedType'], EnumDef: [word('enum'), name('atom'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('EnumValueDef'), (0, _RuleHelpers.p)('}')], EnumValueDef: [name('string-2'), (0, _RuleHelpers.list)('Directive')], InputDef: [word('input'), name('atom'), (0, _RuleHelpers.list)('Directive'), (0, _RuleHelpers.p)('{'), (0, _RuleHelpers.list)('InputValueDef'), (0, _RuleHelpers.p)('}')], ExtendDef: [word('extend'), 'ExtensionDefinition'], ExtensionDefinition(token) { switch (token.value) { case 'schema': return _graphql.Kind.SCHEMA_EXTENSION; case 'scalar': return _graphql.Kind.SCALAR_TYPE_EXTENSION; case 'type': return _graphql.Kind.OBJECT_TYPE_EXTENSION; case 'interface': return _graphql.Kind.INTERFACE_TYPE_EXTENSION; case 'union': return _graphql.Kind.UNION_TYPE_EXTENSION; case 'enum': return _graphql.Kind.ENUM_TYPE_EXTENSION; case 'input': return _graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION; } }, [_graphql.Kind.SCHEMA_EXTENSION]: ['SchemaDef'], [_graphql.Kind.SCALAR_TYPE_EXTENSION]: ['ScalarDef'], [_graphql.Kind.OBJECT_TYPE_EXTENSION]: ['ObjectTypeDef'], [_graphql.Kind.INTERFACE_TYPE_EXTENSION]: ['InterfaceDef'], [_graphql.Kind.UNION_TYPE_EXTENSION]: ['UnionDef'], [_graphql.Kind.ENUM_TYPE_EXTENSION]: ['EnumDef'], [_graphql.Kind.INPUT_OBJECT_TYPE_EXTENSION]: ['InputDef'] }; exports.ParseRules = ParseRules; function word(value) { return { style: 'keyword', match: token => token.kind === 'Name' && token.value === value }; } function name(style) { return { style, match: token => token.kind === 'Name', update(state, token) { state.name = token.value; } }; } function type(style) { return { style, match: token => token.kind === 'Name', update(state, token) { var _a; if ((_a = state.prevState) === null || _a === void 0 ? void 0 : _a.prevState) { state.name = token.value; state.prevState.prevState.type = token.value; } } }; } /***/ }), /***/ "../../graphql-language-service/esm/parser/index.js": /*!**********************************************************!*\ !*** ../../graphql-language-service/esm/parser/index.js ***! \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); var _exportNames = { CharacterStream: true, LexRules: true, ParseRules: true, isIgnored: true, butNot: true, list: true, opt: true, p: true, t: true, onlineParser: true }; Object.defineProperty(exports, "CharacterStream", ({ enumerable: true, get: function () { return _CharacterStream.default; } })); Object.defineProperty(exports, "LexRules", ({ enumerable: true, get: function () { return _Rules.LexRules; } })); Object.defineProperty(exports, "ParseRules", ({ enumerable: true, get: function () { return _Rules.ParseRules; } })); Object.defineProperty(exports, "butNot", ({ enumerable: true, get: function () { return _RuleHelpers.butNot; } })); Object.defineProperty(exports, "isIgnored", ({ enumerable: true, get: function () { return _Rules.isIgnored; } })); Object.defineProperty(exports, "list", ({ enumerable: true, get: function () { return _RuleHelpers.list; } })); Object.defineProperty(exports, "onlineParser", ({ enumerable: true, get: function () { return _onlineParser.default; } })); Object.defineProperty(exports, "opt", ({ enumerable: true, get: function () { return _RuleHelpers.opt; } })); Object.defineProperty(exports, "p", ({ enumerable: true, get: function () { return _RuleHelpers.p; } })); Object.defineProperty(exports, "t", ({ enumerable: true, get: function () { return _RuleHelpers.t; } })); var _CharacterStream = _interopRequireDefault(__webpack_require__(/*! ./CharacterStream */ "../../graphql-language-service/esm/parser/CharacterStream.js")); var _Rules = __webpack_require__(/*! ./Rules */ "../../graphql-language-service/esm/parser/Rules.js"); var _RuleHelpers = __webpack_require__(/*! ./RuleHelpers */ "../../graphql-language-service/esm/parser/RuleHelpers.js"); var _onlineParser = _interopRequireDefault(__webpack_require__(/*! ./onlineParser */ "../../graphql-language-service/esm/parser/onlineParser.js")); var _types = __webpack_require__(/*! ./types */ "../../graphql-language-service/esm/parser/types.js"); Object.keys(_types).forEach(function (key) { if (key === "default" || key === "__esModule") return; if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return; if (key in exports && exports[key] === _types[key]) return; Object.defineProperty(exports, key, { enumerable: true, get: function () { return _types[key]; } }); }); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), /***/ "../../graphql-language-service/esm/parser/onlineParser.js": /*!*****************************************************************!*\ !*** ../../graphql-language-service/esm/parser/onlineParser.js ***! \*****************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = onlineParser; var _Rules = __webpack_require__(/*! ./Rules */ "../../graphql-language-service/esm/parser/Rules.js"); var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); function onlineParser() { let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : { eatWhitespace: stream => stream.eatWhile(_Rules.isIgnored), lexRules: _Rules.LexRules, parseRules: _Rules.ParseRules, editorConfig: {} }; return { startState() { const initialState = { level: 0, step: 0, name: null, kind: null, type: null, rule: null, needsSeparator: false, prevState: null }; pushRule(options.parseRules, initialState, _graphql.Kind.DOCUMENT); return initialState; }, token(stream, state) { return getToken(stream, state, options); } }; } function getToken(stream, state, options) { var _a; if (state.inBlockstring) { if (stream.match(/.*"""/)) { state.inBlockstring = false; return 'string'; } stream.skipToEnd(); return 'string'; } const { lexRules, parseRules, eatWhitespace, editorConfig } = options; if (state.rule && state.rule.length === 0) { popRule(state); } else if (state.needsAdvance) { state.needsAdvance = false; advanceRule(state, true); } if (stream.sol()) { const tabSize = (editorConfig === null || editorConfig === void 0 ? void 0 : editorConfig.tabSize) || 2; state.indentLevel = Math.floor(stream.indentation() / tabSize); } if (eatWhitespace(stream)) { return 'ws'; } const token = lex(lexRules, stream); if (!token) { const matchedSomething = stream.match(/\S+/); if (!matchedSomething) { stream.match(/\s/); } pushRule(SpecialParseRules, state, 'Invalid'); return 'invalidchar'; } if (token.kind === 'Comment') { pushRule(SpecialParseRules, state, 'Comment'); return 'comment'; } const backupState = assign({}, state); if (token.kind === 'Punctuation') { if (/^[{([]/.test(token.value)) { if (state.indentLevel !== undefined) { state.levels = (state.levels || []).concat(state.indentLevel + 1); } } else if (/^[})\]]/.test(token.value)) { const levels = state.levels = (state.levels || []).slice(0, -1); if (state.indentLevel && levels.length > 0 && levels.at(-1) < state.indentLevel) { state.indentLevel = levels.at(-1); } } } while (state.rule) { let expected = typeof state.rule === 'function' ? state.step === 0 ? state.rule(token, stream) : null : state.rule[state.step]; if (state.needsSeparator) { expected = expected === null || expected === void 0 ? void 0 : expected.separator; } if (expected) { if (expected.ofRule) { expected = expected.ofRule; } if (typeof expected === 'string') { pushRule(parseRules, state, expected); continue; } if ((_a = expected.match) === null || _a === void 0 ? void 0 : _a.call(expected, token)) { if (expected.update) { expected.update(state, token); } if (token.kind === 'Punctuation') { advanceRule(state, true); } else { state.needsAdvance = true; } return expected.style; } } unsuccessful(state); } assign(state, backupState); pushRule(SpecialParseRules, state, 'Invalid'); return 'invalidchar'; } function assign(to, from) { const keys = Object.keys(from); for (let i = 0; i < keys.length; i++) { to[keys[i]] = from[keys[i]]; } return to; } const SpecialParseRules = { Invalid: [], Comment: [] }; function pushRule(rules, state, ruleKind) { if (!rules[ruleKind]) { throw new TypeError('Unknown rule: ' + ruleKind); } state.prevState = Object.assign({}, state); state.kind = ruleKind; state.name = null; state.type = null; state.rule = rules[ruleKind]; state.step = 0; state.needsSeparator = false; } function popRule(state) { if (!state.prevState) { return; } state.kind = state.prevState.kind; state.name = state.prevState.name; state.type = state.prevState.type; state.rule = state.prevState.rule; state.step = state.prevState.step; state.needsSeparator = state.prevState.needsSeparator; state.prevState = state.prevState.prevState; } function advanceRule(state, successful) { var _a; if (isList(state) && state.rule) { const step = state.rule[state.step]; if (step.separator) { const { separator } = step; state.needsSeparator = !state.needsSeparator; if (!state.needsSeparator && separator.ofRule) { return; } } if (successful) { return; } } state.needsSeparator = false; state.step++; while (state.rule && !(Array.isArray(state.rule) && state.step < state.rule.length)) { popRule(state); if (state.rule) { if (isList(state)) { if ((_a = state.rule) === null || _a === void 0 ? void 0 : _a[state.step].separator) { state.needsSeparator = !state.needsSeparator; } } else { state.needsSeparator = false; state.step++; } } } } function isList(state) { const step = Array.isArray(state.rule) && typeof state.rule[state.step] !== 'string' && state.rule[state.step]; return step && step.isList; } function unsuccessful(state) { while (state.rule && !(Array.isArray(state.rule) && state.rule[state.step].ofRule)) { popRule(state); } if (state.rule) { advanceRule(state, false); } } function lex(lexRules, stream) { const kinds = Object.keys(lexRules); for (let i = 0; i < kinds.length; i++) { const match = stream.match(lexRules[kinds[i]]); if (match && match instanceof Array) { return { kind: kinds[i], value: match[0] }; } } } /***/ }), /***/ "../../graphql-language-service/esm/parser/types.js": /*!**********************************************************!*\ !*** ../../graphql-language-service/esm/parser/types.js ***! \**********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.RuleKinds = exports.AdditionalRuleKinds = void 0; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); const AdditionalRuleKinds = { ALIASED_FIELD: 'AliasedField', ARGUMENTS: 'Arguments', SHORT_QUERY: 'ShortQuery', QUERY: 'Query', MUTATION: 'Mutation', SUBSCRIPTION: 'Subscription', TYPE_CONDITION: 'TypeCondition', INVALID: 'Invalid', COMMENT: 'Comment', SCHEMA_DEF: 'SchemaDef', SCALAR_DEF: 'ScalarDef', OBJECT_TYPE_DEF: 'ObjectTypeDef', OBJECT_VALUE: 'ObjectValue', LIST_VALUE: 'ListValue', INTERFACE_DEF: 'InterfaceDef', UNION_DEF: 'UnionDef', ENUM_DEF: 'EnumDef', ENUM_VALUE: 'EnumValue', FIELD_DEF: 'FieldDef', INPUT_DEF: 'InputDef', INPUT_VALUE_DEF: 'InputValueDef', ARGUMENTS_DEF: 'ArgumentsDef', EXTEND_DEF: 'ExtendDef', EXTENSION_DEFINITION: 'ExtensionDefinition', DIRECTIVE_DEF: 'DirectiveDef', IMPLEMENTS: 'Implements', VARIABLE_DEFINITIONS: 'VariableDefinitions', TYPE: 'Type' }; exports.AdditionalRuleKinds = AdditionalRuleKinds; const RuleKinds = Object.assign(Object.assign({}, _graphql.Kind), AdditionalRuleKinds); exports.RuleKinds = RuleKinds; /***/ }), /***/ "../../graphql-language-service/esm/types.js": /*!***************************************************!*\ !*** ../../graphql-language-service/esm/types.js ***! \***************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.FileChangeTypeKind = exports.CompletionItemKind = void 0; Object.defineProperty(exports, "InsertTextFormat", ({ enumerable: true, get: function () { return _vscodeLanguageserverTypes.InsertTextFormat; } })); var _vscodeLanguageserverTypes = __webpack_require__(/*! vscode-languageserver-types */ "../../../node_modules/vscode-languageserver-types/lib/esm/main.js"); const FileChangeTypeKind = { Created: 1, Changed: 2, Deleted: 3 }; exports.FileChangeTypeKind = FileChangeTypeKind; var CompletionItemKind; exports.CompletionItemKind = CompletionItemKind; (function (CompletionItemKind) { CompletionItemKind.Text = 1; CompletionItemKind.Method = 2; CompletionItemKind.Function = 3; CompletionItemKind.Constructor = 4; CompletionItemKind.Field = 5; CompletionItemKind.Variable = 6; CompletionItemKind.Class = 7; CompletionItemKind.Interface = 8; CompletionItemKind.Module = 9; CompletionItemKind.Property = 10; CompletionItemKind.Unit = 11; CompletionItemKind.Value = 12; CompletionItemKind.Enum = 13; CompletionItemKind.Keyword = 14; CompletionItemKind.Snippet = 15; CompletionItemKind.Color = 16; CompletionItemKind.File = 17; CompletionItemKind.Reference = 18; CompletionItemKind.Folder = 19; CompletionItemKind.EnumMember = 20; CompletionItemKind.Constant = 21; CompletionItemKind.Struct = 22; CompletionItemKind.Event = 23; CompletionItemKind.Operator = 24; CompletionItemKind.TypeParameter = 25; })(CompletionItemKind || (exports.CompletionItemKind = CompletionItemKind = {})); /***/ }), /***/ "../../graphql-language-service/esm/utils/Range.js": /*!*********************************************************!*\ !*** ../../graphql-language-service/esm/utils/Range.js ***! \*********************************************************/ /***/ (function(__unused_webpack_module, exports) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.Range = exports.Position = void 0; exports.locToRange = locToRange; exports.offsetToPosition = offsetToPosition; class Range { constructor(start, end) { this.containsPosition = position => { if (this.start.line === position.line) { return this.start.character <= position.character; } if (this.end.line === position.line) { return this.end.character >= position.character; } return this.start.line <= position.line && this.end.line >= position.line; }; this.start = start; this.end = end; } setStart(line, character) { this.start = new Position(line, character); } setEnd(line, character) { this.end = new Position(line, character); } } exports.Range = Range; class Position { constructor(line, character) { this.lessThanOrEqualTo = position => this.line < position.line || this.line === position.line && this.character <= position.character; this.line = line; this.character = character; } setLine(line) { this.line = line; } setCharacter(character) { this.character = character; } } exports.Position = Position; function offsetToPosition(text, loc) { const EOL = '\n'; const buf = text.slice(0, loc); const lines = buf.split(EOL).length - 1; const lastLineIndex = buf.lastIndexOf(EOL); return new Position(lines, loc - lastLineIndex - 1); } function locToRange(text, loc) { const start = offsetToPosition(text, loc.start); const end = offsetToPosition(text, loc.end); return new Range(start, end); } /***/ }), /***/ "../../graphql-language-service/esm/utils/collectVariables.js": /*!********************************************************************!*\ !*** ../../graphql-language-service/esm/utils/collectVariables.js ***! \********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.collectVariables = collectVariables; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); function collectVariables(schema, documentAST) { const variableToType = Object.create(null); for (const definition of documentAST.definitions) { if (definition.kind === 'OperationDefinition') { const { variableDefinitions } = definition; if (variableDefinitions) { for (const { variable, type } of variableDefinitions) { const inputType = (0, _graphql.typeFromAST)(schema, type); if (inputType) { variableToType[variable.name.value] = inputType; } else if (type.kind === _graphql.Kind.NAMED_TYPE && type.name.value === 'Float') { variableToType[variable.name.value] = _graphql.GraphQLFloat; } } } } } return variableToType; } /***/ }), /***/ "../../graphql-language-service/esm/utils/fragmentDependencies.js": /*!************************************************************************!*\ !*** ../../graphql-language-service/esm/utils/fragmentDependencies.js ***! \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getFragmentDependenciesForAST = exports.getFragmentDependencies = void 0; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _nullthrows = _interopRequireDefault(__webpack_require__(/*! nullthrows */ "../../../node_modules/nullthrows/nullthrows.js")); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const getFragmentDependencies = (operationString, fragmentDefinitions) => { if (!fragmentDefinitions) { return []; } let parsedOperation; try { parsedOperation = (0, _graphql.parse)(operationString); } catch (_a) { return []; } return getFragmentDependenciesForAST(parsedOperation, fragmentDefinitions); }; exports.getFragmentDependencies = getFragmentDependencies; const getFragmentDependenciesForAST = (parsedOperation, fragmentDefinitions) => { if (!fragmentDefinitions) { return []; } const existingFrags = new Map(); const referencedFragNames = new Set(); (0, _graphql.visit)(parsedOperation, { FragmentDefinition(node) { existingFrags.set(node.name.value, true); }, FragmentSpread(node) { if (!referencedFragNames.has(node.name.value)) { referencedFragNames.add(node.name.value); } } }); const asts = new Set(); for (const name of referencedFragNames) { if (!existingFrags.has(name) && fragmentDefinitions.has(name)) { asts.add((0, _nullthrows.default)(fragmentDefinitions.get(name))); } } const referencedFragments = []; for (const ast of asts) { (0, _graphql.visit)(ast, { FragmentSpread(node) { if (!referencedFragNames.has(node.name.value) && fragmentDefinitions.get(node.name.value)) { asts.add((0, _nullthrows.default)(fragmentDefinitions.get(node.name.value))); referencedFragNames.add(node.name.value); } } }); if (!existingFrags.has(ast.name.value)) { referencedFragments.push(ast); } } return referencedFragments; }; exports.getFragmentDependenciesForAST = getFragmentDependenciesForAST; /***/ }), /***/ "../../graphql-language-service/esm/utils/getASTNodeAtPosition.js": /*!************************************************************************!*\ !*** ../../graphql-language-service/esm/utils/getASTNodeAtPosition.js ***! \************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.getASTNodeAtPosition = getASTNodeAtPosition; exports.pointToOffset = pointToOffset; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); function getASTNodeAtPosition(query, ast, point) { const offset = pointToOffset(query, point); let nodeContainingPosition; (0, _graphql.visit)(ast, { enter(node) { if (node.kind !== 'Name' && node.loc && node.loc.start <= offset && offset <= node.loc.end) { nodeContainingPosition = node; } else { return false; } }, leave(node) { if (node.loc && node.loc.start <= offset && offset <= node.loc.end) { return false; } } }); return nodeContainingPosition; } function pointToOffset(text, point) { const linesUntilPosition = text.split('\n').slice(0, point.line); return point.character + linesUntilPosition.map(line => line.length + 1).reduce((a, b) => a + b, 0); } /***/ }), /***/ "../../graphql-language-service/esm/utils/getOperationFacts.js": /*!*********************************************************************!*\ !*** ../../graphql-language-service/esm/utils/getOperationFacts.js ***! \*********************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports["default"] = getOperationFacts; exports.getOperationASTFacts = getOperationASTFacts; exports.getQueryFacts = void 0; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); var _collectVariables = __webpack_require__(/*! ./collectVariables */ "../../graphql-language-service/esm/utils/collectVariables.js"); function getOperationASTFacts(documentAST, schema) { const variableToType = schema ? (0, _collectVariables.collectVariables)(schema, documentAST) : undefined; const operations = []; (0, _graphql.visit)(documentAST, { OperationDefinition(node) { operations.push(node); } }); return { variableToType, operations }; } function getOperationFacts(schema, documentString) { if (!documentString) { return; } try { const documentAST = (0, _graphql.parse)(documentString); return Object.assign(Object.assign({}, getOperationASTFacts(documentAST, schema)), { documentAST }); } catch (_a) { return; } } const getQueryFacts = getOperationFacts; exports.getQueryFacts = getQueryFacts; /***/ }), /***/ "../../graphql-language-service/esm/utils/getVariablesJSONSchema.js": /*!**************************************************************************!*\ !*** ../../graphql-language-service/esm/utils/getVariablesJSONSchema.js ***! \**************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.defaultJSONSchemaOptions = void 0; exports.getVariablesJSONSchema = getVariablesJSONSchema; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); const defaultJSONSchemaOptions = { useMarkdownDescription: false }; exports.defaultJSONSchemaOptions = defaultJSONSchemaOptions; function text(into, newText) { into.push(newText); } function renderType(into, t) { if ((0, _graphql.isNonNullType)(t)) { renderType(into, t.ofType); text(into, '!'); } else if ((0, _graphql.isListType)(t)) { text(into, '['); renderType(into, t.ofType); text(into, ']'); } else { text(into, t.name); } } function renderDefinitionDescription(t, useMarkdown, description) { const into = []; const type = 'type' in t ? t.type : t; if ('type' in t && t.description) { text(into, t.description); text(into, '\n\n'); } text(into, renderTypeToString(type, useMarkdown)); if (description) { text(into, '\n'); text(into, description); } else if (!(0, _graphql.isScalarType)(type) && 'description' in type && type.description) { text(into, '\n'); text(into, type.description); } else if ('ofType' in type && !(0, _graphql.isScalarType)(type.ofType) && 'description' in type.ofType && type.ofType.description) { text(into, '\n'); text(into, type.ofType.description); } return into.join(''); } function renderTypeToString(t, useMarkdown) { const into = []; if (useMarkdown) { text(into, '```graphql\n'); } renderType(into, t); if (useMarkdown) { text(into, '\n```'); } return into.join(''); } const defaultScalarTypesMap = { Int: { type: 'integer' }, String: { type: 'string' }, Float: { type: 'number' }, ID: { type: 'string' }, Boolean: { type: 'boolean' }, DateTime: { type: 'string' } }; class Marker { constructor() { this.set = new Set(); } mark(name) { if (this.set.has(name)) { return false; } this.set.add(name); return true; } } function getJSONSchemaFromGraphQLType(fieldOrType, options) { var _a, _b; let definition = Object.create(null); const definitions = Object.create(null); const isField = ('type' in fieldOrType); const type = isField ? fieldOrType.type : fieldOrType; const baseType = (0, _graphql.isNonNullType)(type) ? type.ofType : type; const required = (0, _graphql.isNonNullType)(type); if ((0, _graphql.isScalarType)(baseType)) { if ((_a = options === null || options === void 0 ? void 0 : options.scalarSchemas) === null || _a === void 0 ? void 0 : _a[baseType.name]) { definition = JSON.parse(JSON.stringify(options.scalarSchemas[baseType.name])); } else { definition.type = ['string', 'number', 'boolean', 'integer']; } if (!required) { if (Array.isArray(definition.type)) { definition.type.push('null'); } else if (definition.type) { definition.type = [definition.type, 'null']; } else if (definition.enum) { definition.enum.push(null); } else if (definition.oneOf) { definition.oneOf.push({ type: 'null' }); } else { definition = { oneOf: [definition, { type: 'null' }] }; } } } else if ((0, _graphql.isEnumType)(baseType)) { definition.enum = baseType.getValues().map(val => val.name); if (!required) { definition.enum.push(null); } } else if ((0, _graphql.isListType)(baseType)) { if (required) { definition.type = 'array'; } else { definition.type = ['array', 'null']; } const { definition: def, definitions: defs } = getJSONSchemaFromGraphQLType(baseType.ofType, options); definition.items = def; if (defs) { for (const defName of Object.keys(defs)) { definitions[defName] = defs[defName]; } } } else if ((0, _graphql.isInputObjectType)(baseType)) { if (required) { definition.$ref = `#/definitions/${baseType.name}`; } else { definition.oneOf = [{ $ref: `#/definitions/${baseType.name}` }, { type: 'null' }]; } if ((_b = options === null || options === void 0 ? void 0 : options.definitionMarker) === null || _b === void 0 ? void 0 : _b.mark(baseType.name)) { const fields = baseType.getFields(); const fieldDef = { type: 'object', properties: {}, required: [] }; fieldDef.description = renderDefinitionDescription(baseType); if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) { fieldDef.markdownDescription = renderDefinitionDescription(baseType, true); } for (const fieldName of Object.keys(fields)) { const field = fields[fieldName]; const { required: fieldRequired, definition: fieldDefinition, definitions: typeDefinitions } = getJSONSchemaFromGraphQLType(field, options); fieldDef.properties[fieldName] = fieldDefinition; if (fieldRequired) { fieldDef.required.push(fieldName); } if (typeDefinitions) { for (const [defName, value] of Object.entries(typeDefinitions)) { definitions[defName] = value; } } } definitions[baseType.name] = fieldDef; } } if ('defaultValue' in fieldOrType && fieldOrType.defaultValue !== undefined) { definition.default = fieldOrType.defaultValue; } const { description } = definition; definition.description = renderDefinitionDescription(fieldOrType, false, description); if (options === null || options === void 0 ? void 0 : options.useMarkdownDescription) { definition.markdownDescription = renderDefinitionDescription(fieldOrType, true, description); } return { required, definition, definitions }; } function getVariablesJSONSchema(variableToType, options) { var _a; const jsonSchema = { $schema: 'http://json-schema.org/draft-04/schema', type: 'object', properties: {}, required: [] }; const runtimeOptions = Object.assign(Object.assign({}, options), { definitionMarker: new Marker(), scalarSchemas: Object.assign(Object.assign({}, defaultScalarTypesMap), options === null || options === void 0 ? void 0 : options.scalarSchemas) }); if (variableToType) { for (const [variableName, type] of Object.entries(variableToType)) { const { definition, required, definitions } = getJSONSchemaFromGraphQLType(type, runtimeOptions); jsonSchema.properties[variableName] = definition; if (required) { (_a = jsonSchema.required) === null || _a === void 0 ? void 0 : _a.push(variableName); } if (definitions) { jsonSchema.definitions = Object.assign(Object.assign({}, jsonSchema === null || jsonSchema === void 0 ? void 0 : jsonSchema.definitions), definitions); } } } return jsonSchema; } /***/ }), /***/ "../../graphql-language-service/esm/utils/index.js": /*!*********************************************************!*\ !*** ../../graphql-language-service/esm/utils/index.js ***! \*********************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); Object.defineProperty(exports, "Position", ({ enumerable: true, get: function () { return _Range.Position; } })); Object.defineProperty(exports, "Range", ({ enumerable: true, get: function () { return _Range.Range; } })); Object.defineProperty(exports, "collectVariables", ({ enumerable: true, get: function () { return _collectVariables.collectVariables; } })); Object.defineProperty(exports, "getASTNodeAtPosition", ({ enumerable: true, get: function () { return _getASTNodeAtPosition.getASTNodeAtPosition; } })); Object.defineProperty(exports, "getFragmentDependencies", ({ enumerable: true, get: function () { return _fragmentDependencies.getFragmentDependencies; } })); Object.defineProperty(exports, "getFragmentDependenciesForAST", ({ enumerable: true, get: function () { return _fragmentDependencies.getFragmentDependenciesForAST; } })); Object.defineProperty(exports, "getOperationASTFacts", ({ enumerable: true, get: function () { return _getOperationFacts.getOperationASTFacts; } })); Object.defineProperty(exports, "getOperationFacts", ({ enumerable: true, get: function () { return _getOperationFacts.default; } })); Object.defineProperty(exports, "getQueryFacts", ({ enumerable: true, get: function () { return _getOperationFacts.getQueryFacts; } })); Object.defineProperty(exports, "getVariablesJSONSchema", ({ enumerable: true, get: function () { return _getVariablesJSONSchema.getVariablesJSONSchema; } })); Object.defineProperty(exports, "locToRange", ({ enumerable: true, get: function () { return _Range.locToRange; } })); Object.defineProperty(exports, "offsetToPosition", ({ enumerable: true, get: function () { return _Range.offsetToPosition; } })); Object.defineProperty(exports, "pointToOffset", ({ enumerable: true, get: function () { return _getASTNodeAtPosition.pointToOffset; } })); Object.defineProperty(exports, "validateWithCustomRules", ({ enumerable: true, get: function () { return _validateWithCustomRules.validateWithCustomRules; } })); var _fragmentDependencies = __webpack_require__(/*! ./fragmentDependencies */ "../../graphql-language-service/esm/utils/fragmentDependencies.js"); var _getVariablesJSONSchema = __webpack_require__(/*! ./getVariablesJSONSchema */ "../../graphql-language-service/esm/utils/getVariablesJSONSchema.js"); var _getASTNodeAtPosition = __webpack_require__(/*! ./getASTNodeAtPosition */ "../../graphql-language-service/esm/utils/getASTNodeAtPosition.js"); var _Range = __webpack_require__(/*! ./Range */ "../../graphql-language-service/esm/utils/Range.js"); var _validateWithCustomRules = __webpack_require__(/*! ./validateWithCustomRules */ "../../graphql-language-service/esm/utils/validateWithCustomRules.js"); var _collectVariables = __webpack_require__(/*! ./collectVariables */ "../../graphql-language-service/esm/utils/collectVariables.js"); var _getOperationFacts = _interopRequireWildcard(__webpack_require__(/*! ./getOperationFacts */ "../../graphql-language-service/esm/utils/getOperationFacts.js")); function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } /***/ }), /***/ "../../graphql-language-service/esm/utils/validateWithCustomRules.js": /*!***************************************************************************!*\ !*** ../../graphql-language-service/esm/utils/validateWithCustomRules.js ***! \***************************************************************************/ /***/ (function(__unused_webpack_module, exports, __webpack_require__) { Object.defineProperty(exports, "__esModule", ({ value: true })); exports.validateWithCustomRules = validateWithCustomRules; var _graphql = __webpack_require__(/*! graphql */ "../../../node_modules/graphql/index.mjs"); const specifiedSDLRules = [_graphql.LoneSchemaDefinitionRule, _graphql.UniqueOperationTypesRule, _graphql.UniqueTypeNamesRule, _graphql.UniqueEnumValueNamesRule, _graphql.UniqueFieldDefinitionNamesRule, _graphql.UniqueDirectiveNamesRule, _graphql.KnownTypeNamesRule, _graphql.KnownDirectivesRule, _graphql.UniqueDirectivesPerLocationRule, _graphql.PossibleTypeExtensionsRule, _graphql.UniqueArgumentNamesRule, _graphql.UniqueInputFieldNamesRule]; function validateWithCustomRules(schema, ast, customRules, isRelayCompatMode, isSchemaDocument) { const rules = _graphql.specifiedRules.filter(rule => { if (rule === _graphql.NoUnusedFragmentsRule || rule === _graphql.ExecutableDefinitionsRule) { return false; } if (isRelayCompatMode && rule === _graphql.KnownFragmentNamesRule) { return false; } return true; }); if (customRules) { Array.prototype.push.apply(rules, customRules); } if (isSchemaDocument) { Array.prototype.push.apply(rules, specifiedSDLRules); } const errors = (0, _graphql.validate)(schema, ast, rules); return errors.filter(error => { if (error.message.includes('Unknown directive') && error.nodes) { const node = error.nodes[0]; if (node && node.kind === _graphql.Kind.DIRECTIVE) { const name = node.name.value; if (name === 'arguments' || name === 'argumentDefinitions') { return false; } } } return true; }); } /***/ }), /***/ "./style.css": /*!*******************!*\ !*** ./style.css ***! \*******************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ }), /***/ "../../graphiql-react/dist/style.css": /*!*******************************************!*\ !*** ../../graphiql-react/dist/style.css ***! \*******************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ }), /***/ "../../graphiql-react/font/fira-code.css": /*!***********************************************!*\ !*** ../../graphiql-react/font/fira-code.css ***! \***********************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ }), /***/ "../../graphiql-react/font/roboto.css": /*!********************************************!*\ !*** ../../graphiql-react/font/roboto.css ***! \********************************************/ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { __webpack_require__.r(__webpack_exports__); // extracted by mini-css-extract-plugin /***/ }), /***/ "react": /*!************************!*\ !*** external "React" ***! \************************/ /***/ (function(module) { module.exports = window["React"]; /***/ }), /***/ "react-dom": /*!***************************!*\ !*** external "ReactDOM" ***! \***************************/ /***/ (function(module) { module.exports = window["ReactDOM"]; /***/ }), /***/ "../../../node_modules/@headlessui/react/dist/headlessui.dev.cjs": /*!***********************************************************************!*\ !*** ../../../node_modules/@headlessui/react/dist/headlessui.dev.cjs ***! \***********************************************************************/ /***/ (function(module, __unused_webpack_exports, __webpack_require__) { var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; // src/index.ts var src_exports = {}; __export(src_exports, { Combobox: () => Combobox, Dialog: () => Dialog, Disclosure: () => Disclosure, FocusTrap: () => FocusTrap, Listbox: () => Listbox, Menu: () => Menu, Popover: () => Popover, Portal: () => Portal, RadioGroup: () => RadioGroup, Switch: () => Switch, Tab: () => Tab, Transition: () => Transition }); module.exports = __toCommonJS(src_exports); // src/components/combobox/combobox.tsx var import_react19 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/hooks/use-computed.ts var import_react3 = __webpack_require__(/*! react */ "react"); // src/hooks/use-iso-morphic-effect.ts var import_react = __webpack_require__(/*! react */ "react"); // src/utils/env.ts var Env = class { constructor() { __publicField(this, "current", this.detect()); __publicField(this, "handoffState", "pending"); __publicField(this, "currentId", 0); } set(env2) { if (this.current === env2) return; this.handoffState = "pending"; this.currentId = 0; this.current = env2; } reset() { this.set(this.detect()); } nextId() { return ++this.currentId; } get isServer() { return this.current === "server"; } get isClient() { return this.current === "client"; } detect() { if (typeof window === "undefined" || typeof document === "undefined") { return "server"; } return "client"; } handoff() { if (this.handoffState === "pending") { this.handoffState = "complete"; } } get isHandoffComplete() { return this.handoffState === "complete"; } }; var env = new Env(); // src/hooks/use-iso-morphic-effect.ts var useIsoMorphicEffect = (effect, deps) => { if (env.isServer) { (0, import_react.useEffect)(effect, deps); } else { (0, import_react.useLayoutEffect)(effect, deps); } }; // src/hooks/use-latest-value.ts var import_react2 = __webpack_require__(/*! react */ "react"); function useLatestValue(value) { let cache = (0, import_react2.useRef)(value); useIsoMorphicEffect(() => { cache.current = value; }, [value]); return cache; } // src/hooks/use-computed.ts function useComputed(cb, dependencies) { let [value, setValue] = (0, import_react3.useState)(cb); let cbRef = useLatestValue(cb); useIsoMorphicEffect(() => setValue(cbRef.current), [cbRef, setValue, ...dependencies]); return value; } // src/hooks/use-disposables.ts var import_react4 = __webpack_require__(/*! react */ "react"); // src/utils/micro-task.ts function microTask(cb) { if (typeof queueMicrotask === "function") { queueMicrotask(cb); } else { Promise.resolve().then(cb).catch( (e) => setTimeout(() => { throw e; }) ); } } // src/utils/disposables.ts function disposables() { let _disposables = []; let api = { addEventListener(element, name, listener, options) { element.addEventListener(name, listener, options); return api.add(() => element.removeEventListener(name, listener, options)); }, requestAnimationFrame(...args) { let raf = requestAnimationFrame(...args); return api.add(() => cancelAnimationFrame(raf)); }, nextFrame(...args) { return api.requestAnimationFrame(() => { return api.requestAnimationFrame(...args); }); }, setTimeout(...args) { let timer = setTimeout(...args); return api.add(() => clearTimeout(timer)); }, microTask(...args) { let task = { current: true }; microTask(() => { if (task.current) { args[0](); } }); return api.add(() => { task.current = false; }); }, style(node, property, value) { let previous = node.style.getPropertyValue(property); Object.assign(node.style, { [property]: value }); return this.add(() => { Object.assign(node.style, { [property]: previous }); }); }, group(cb) { let d = disposables(); cb(d); return this.add(() => d.dispose()); }, add(cb) { _disposables.push(cb); return () => { let idx = _disposables.indexOf(cb); if (idx >= 0) { for (let dispose of _disposables.splice(idx, 1)) { dispose(); } } }; }, dispose() { for (let dispose of _disposables.splice(0)) { dispose(); } } }; return api; } // src/hooks/use-disposables.ts function useDisposables() { let [d] = (0, import_react4.useState)(disposables); (0, import_react4.useEffect)(() => () => d.dispose(), [d]); return d; } // src/hooks/use-event.ts var import_react5 = __toESM(__webpack_require__(/*! react */ "react"), 1); var useEvent = ( // TODO: Add React.useEvent ?? once the useEvent hook is available function useEvent2(cb) { let cache = useLatestValue(cb); return import_react5.default.useCallback((...args) => cache.current(...args), [cache]); } ); // src/hooks/use-id.ts var import_react7 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/hooks/use-server-handoff-complete.ts var import_react6 = __webpack_require__(/*! react */ "react"); function useServerHandoffComplete() { let [complete, setComplete] = (0, import_react6.useState)(env.isHandoffComplete); if (complete && env.isHandoffComplete === false) { setComplete(false); } (0, import_react6.useEffect)(() => { if (complete === true) return; setComplete(true); }, [complete]); (0, import_react6.useEffect)(() => env.handoff(), []); return complete; } // src/hooks/use-id.ts var _a; var useId = ( // Prefer React's `useId` if it's available. // @ts-expect-error - `useId` doesn't exist in React < 18. (_a = import_react7.default.useId) != null ? _a : function useId2() { let ready = useServerHandoffComplete(); let [id, setId] = import_react7.default.useState(ready ? () => env.nextId() : null); useIsoMorphicEffect(() => { if (id === null) setId(env.nextId()); }, [id]); return id != null ? "" + id : void 0; } ); // src/hooks/use-outside-click.ts var import_react10 = __webpack_require__(/*! react */ "react"); // src/utils/match.ts function match(value, lookup, ...args) { if (value in lookup) { let returnValue = lookup[value]; return typeof returnValue === "function" ? returnValue(...args) : returnValue; } let error = new Error( `Tried to handle "${value}" but there is no handler defined. Only defined handlers are: ${Object.keys( lookup ).map((key) => `"${key}"`).join(", ")}.` ); if (Error.captureStackTrace) Error.captureStackTrace(error, match); throw error; } // src/utils/owner.ts function getOwnerDocument(element) { if (env.isServer) return null; if (element instanceof Node) return element.ownerDocument; if (element == null ? void 0 : element.hasOwnProperty("current")) { if (element.current instanceof Node) return element.current.ownerDocument; } return document; } // src/utils/focus-management.ts var focusableSelector = [ "[contentEditable=true]", "[tabindex]", "a[href]", "area[href]", "button:not([disabled])", "iframe", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])" ].map( false ? ( // TODO: Remove this once JSDOM fixes the issue where an element that is // "hidden" can be the document.activeElement, because this is not possible // in real browsers. 0 ) : (selector) => `${selector}:not([tabindex='-1'])` ).join(","); function getFocusableElements(container = document.body) { if (container == null) return []; return Array.from(container.querySelectorAll(focusableSelector)).sort( // We want to move `tabIndex={0}` to the end of the list, this is what the browser does as well. (a, z) => Math.sign((a.tabIndex || Number.MAX_SAFE_INTEGER) - (z.tabIndex || Number.MAX_SAFE_INTEGER)) ); } function isFocusableElement(element, mode = 0 /* Strict */) { var _a3; if (element === ((_a3 = getOwnerDocument(element)) == null ? void 0 : _a3.body)) return false; return match(mode, { [0 /* Strict */]() { return element.matches(focusableSelector); }, [1 /* Loose */]() { let next = element; while (next !== null) { if (next.matches(focusableSelector)) return true; next = next.parentElement; } return false; } }); } function restoreFocusIfNecessary(element) { let ownerDocument = getOwnerDocument(element); disposables().nextFrame(() => { if (ownerDocument && !isFocusableElement(ownerDocument.activeElement, 0 /* Strict */)) { focusElement(element); } }); } if (typeof window !== "undefined" && typeof document !== "undefined") { document.addEventListener( "keydown", (event) => { if (event.metaKey || event.altKey || event.ctrlKey) { return; } document.documentElement.dataset.headlessuiFocusVisible = ""; }, true ); document.addEventListener( "click", (event) => { if (event.detail === 1 /* Mouse */) { delete document.documentElement.dataset.headlessuiFocusVisible; } else if (event.detail === 0 /* Keyboard */) { document.documentElement.dataset.headlessuiFocusVisible = ""; } }, true ); } function focusElement(element) { element == null ? void 0 : element.focus({ preventScroll: true }); } var selectableSelector = ["textarea", "input"].join(","); function isSelectableElement(element) { var _a3, _b; return (_b = (_a3 = element == null ? void 0 : element.matches) == null ? void 0 : _a3.call(element, selectableSelector)) != null ? _b : false; } function sortByDomNode(nodes, resolveKey = (i) => i) { return nodes.slice().sort((aItem, zItem) => { let a = resolveKey(aItem); let z = resolveKey(zItem); if (a === null || z === null) return 0; let position = a.compareDocumentPosition(z); if (position & Node.DOCUMENT_POSITION_FOLLOWING) return -1; if (position & Node.DOCUMENT_POSITION_PRECEDING) return 1; return 0; }); } function focusFrom(current, focus) { return focusIn(getFocusableElements(), focus, { relativeTo: current }); } function focusIn(container, focus, { sorted = true, relativeTo = null, skipElements = [] } = {}) { let ownerDocument = Array.isArray(container) ? container.length > 0 ? container[0].ownerDocument : document : container.ownerDocument; let elements = Array.isArray(container) ? sorted ? sortByDomNode(container) : container : getFocusableElements(container); if (skipElements.length > 0 && elements.length > 1) { elements = elements.filter((x) => !skipElements.includes(x)); } relativeTo = relativeTo != null ? relativeTo : ownerDocument.activeElement; let direction = (() => { if (focus & (1 /* First */ | 4 /* Next */)) return 1 /* Next */; if (focus & (2 /* Previous */ | 8 /* Last */)) return -1 /* Previous */; throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"); })(); let startIndex = (() => { if (focus & 1 /* First */) return 0; if (focus & 2 /* Previous */) return Math.max(0, elements.indexOf(relativeTo)) - 1; if (focus & 4 /* Next */) return Math.max(0, elements.indexOf(relativeTo)) + 1; if (focus & 8 /* Last */) return elements.length - 1; throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last"); })(); let focusOptions = focus & 32 /* NoScroll */ ? { preventScroll: true } : {}; let offset = 0; let total = elements.length; let next = void 0; do { if (offset >= total || offset + total <= 0) return 0 /* Error */; let nextIdx = startIndex + offset; if (focus & 16 /* WrapAround */) { nextIdx = (nextIdx + total) % total; } else { if (nextIdx < 0) return 3 /* Underflow */; if (nextIdx >= total) return 1 /* Overflow */; } next = elements[nextIdx]; next == null ? void 0 : next.focus(focusOptions); offset += direction; } while (next !== ownerDocument.activeElement); if (focus & (4 /* Next */ | 2 /* Previous */) && isSelectableElement(next)) { next.select(); } return 2 /* Success */; } // src/hooks/use-document-event.ts var import_react8 = __webpack_require__(/*! react */ "react"); function useDocumentEvent(type, listener, options) { let listenerRef = useLatestValue(listener); (0, import_react8.useEffect)(() => { function handler(event) { listenerRef.current(event); } document.addEventListener(type, handler, options); return () => document.removeEventListener(type, handler, options); }, [type, options]); } // src/hooks/use-window-event.ts var import_react9 = __webpack_require__(/*! react */ "react"); function useWindowEvent(type, listener, options) { let listenerRef = useLatestValue(listener); (0, import_react9.useEffect)(() => { function handler(event) { listenerRef.current(event); } window.addEventListener(type, handler, options); return () => window.removeEventListener(type, handler, options); }, [type, options]); } // src/hooks/use-outside-click.ts function useOutsideClick(containers, cb, enabled = true) { let enabledRef = (0, import_react10.useRef)(false); (0, import_react10.useEffect)( false ? 0 : () => { requestAnimationFrame(() => { enabledRef.current = enabled; }); }, [enabled] ); function handleOutsideClick(event, resolveTarget) { if (!enabledRef.current) return; if (event.defaultPrevented) return; let target = resolveTarget(event); if (target === null) { return; } if (!target.getRootNode().contains(target)) return; let _containers = function resolve(containers2) { if (typeof containers2 === "function") { return resolve(containers2()); } if (Array.isArray(containers2)) { return containers2; } if (containers2 instanceof Set) { return containers2; } return [containers2]; }(containers); for (let container of _containers) { if (container === null) continue; let domNode = container instanceof HTMLElement ? container : container.current; if (domNode == null ? void 0 : domNode.contains(target)) { return; } if (event.composed && event.composedPath().includes(domNode)) { return; } } if ( // This check alllows us to know whether or not we clicked on a "focusable" element like a // button or an input. This is a backwards compatibility check so that you can open a

and click on another which should close Menu A and open Menu B. We might // revisit that so that you will require 2 clicks instead. !isFocusableElement(target, 1 /* Loose */) && // This could be improved, but the `Combobox.Button` adds tabIndex={-1} to make it // unfocusable via the keyboard so that tabbing to the next item from the input doesn't // first go to the button. target.tabIndex !== -1 ) { event.preventDefault(); } return cb(event, target); } let initialClickTarget = (0, import_react10.useRef)(null); useDocumentEvent( "mousedown", (event) => { var _a3, _b; if (enabledRef.current) { initialClickTarget.current = ((_b = (_a3 = event.composedPath) == null ? void 0 : _a3.call(event)) == null ? void 0 : _b[0]) || event.target; } }, true ); useDocumentEvent( "click", (event) => { if (!initialClickTarget.current) { return; } handleOutsideClick(event, () => { return initialClickTarget.current; }); initialClickTarget.current = null; }, // We will use the `capture` phase so that layers in between with `event.stopPropagation()` // don't "cancel" this outside click check. E.g.: A `Menu` inside a `DialogPanel` if the `Menu` // is open, and you click outside of it in the `DialogPanel` the `Menu` should close. However, // the `DialogPanel` has a `onClick(e) { e.stopPropagation() }` which would cancel this. true ); useWindowEvent( "blur", (event) => handleOutsideClick( event, () => window.document.activeElement instanceof HTMLIFrameElement ? window.document.activeElement : null ), true ); } // src/hooks/use-resolve-button-type.ts var import_react11 = __webpack_require__(/*! react */ "react"); function resolveType(props) { var _a3; if (props.type) return props.type; let tag = (_a3 = props.as) != null ? _a3 : "button"; if (typeof tag === "string" && tag.toLowerCase() === "button") return "button"; return void 0; } function useResolveButtonType(props, ref) { let [type, setType] = (0, import_react11.useState)(() => resolveType(props)); useIsoMorphicEffect(() => { setType(resolveType(props)); }, [props.type, props.as]); useIsoMorphicEffect(() => { if (type) return; if (!ref.current) return; if (ref.current instanceof HTMLButtonElement && !ref.current.hasAttribute("type")) { setType("button"); } }, [type, ref]); return type; } // src/hooks/use-sync-refs.ts var import_react12 = __webpack_require__(/*! react */ "react"); var Optional = Symbol(); function optionalRef(cb, isOptional = true) { return Object.assign(cb, { [Optional]: isOptional }); } function useSyncRefs(...refs) { let cache = (0, import_react12.useRef)(refs); (0, import_react12.useEffect)(() => { cache.current = refs; }, [refs]); let syncRefs = useEvent((value) => { for (let ref of cache.current) { if (ref == null) continue; if (typeof ref === "function") ref(value); else ref.current = value; } }); return refs.every( (ref) => ref == null || // @ts-expect-error (ref == null ? void 0 : ref[Optional]) ) ? void 0 : syncRefs; } // src/hooks/use-tree-walker.ts var import_react13 = __webpack_require__(/*! react */ "react"); function useTreeWalker({ container, accept, walk, enabled = true }) { let acceptRef = (0, import_react13.useRef)(accept); let walkRef = (0, import_react13.useRef)(walk); (0, import_react13.useEffect)(() => { acceptRef.current = accept; walkRef.current = walk; }, [accept, walk]); useIsoMorphicEffect(() => { if (!container) return; if (!enabled) return; let ownerDocument = getOwnerDocument(container); if (!ownerDocument) return; let accept2 = acceptRef.current; let walk2 = walkRef.current; let acceptNode = Object.assign((node) => accept2(node), { acceptNode: accept2 }); let walker = ownerDocument.createTreeWalker( container, NodeFilter.SHOW_ELEMENT, acceptNode, // @ts-expect-error This `false` is a simple small fix for older browsers false ); while (walker.nextNode()) walk2(walker.currentNode); }, [container, enabled, acceptRef, walkRef]); } // src/utils/calculate-active-index.ts function assertNever(x) { throw new Error("Unexpected object: " + x); } function calculateActiveIndex(action, resolvers) { let items = resolvers.resolveItems(); if (items.length <= 0) return null; let currentActiveIndex = resolvers.resolveActiveIndex(); let activeIndex = currentActiveIndex != null ? currentActiveIndex : -1; let nextActiveIndex = (() => { switch (action.focus) { case 0 /* First */: return items.findIndex((item) => !resolvers.resolveDisabled(item)); case 1 /* Previous */: { let idx = items.slice().reverse().findIndex((item, idx2, all) => { if (activeIndex !== -1 && all.length - idx2 - 1 >= activeIndex) return false; return !resolvers.resolveDisabled(item); }); if (idx === -1) return idx; return items.length - 1 - idx; } case 2 /* Next */: return items.findIndex((item, idx) => { if (idx <= activeIndex) return false; return !resolvers.resolveDisabled(item); }); case 3 /* Last */: { let idx = items.slice().reverse().findIndex((item) => !resolvers.resolveDisabled(item)); if (idx === -1) return idx; return items.length - 1 - idx; } case 4 /* Specific */: return items.findIndex((item) => resolvers.resolveId(item) === action.id); case 5 /* Nothing */: return null; default: assertNever(action); } })(); return nextActiveIndex === -1 ? currentActiveIndex : nextActiveIndex; } // src/utils/render.ts var import_react14 = __webpack_require__(/*! react */ "react"); // src/utils/class-names.ts function classNames(...classes) { return classes.filter(Boolean).join(" "); } // src/utils/render.ts function render({ ourProps, theirProps, slot, defaultTag, features, visible = true, name }) { let props = mergeProps(theirProps, ourProps); if (visible) return _render(props, slot, defaultTag, name); let featureFlags = features != null ? features : 0 /* None */; if (featureFlags & 2 /* Static */) { let { static: isStatic = false, ...rest } = props; if (isStatic) return _render(rest, slot, defaultTag, name); } if (featureFlags & 1 /* RenderStrategy */) { let { unmount = true, ...rest } = props; let strategy = unmount ? 0 /* Unmount */ : 1 /* Hidden */; return match(strategy, { [0 /* Unmount */]() { return null; }, [1 /* Hidden */]() { return _render( { ...rest, ...{ hidden: true, style: { display: "none" } } }, slot, defaultTag, name ); } }); } return _render(props, slot, defaultTag, name); } function _render(props, slot = {}, tag, name) { let { as: Component = tag, children, refName = "ref", ...rest } = omit(props, ["unmount", "static"]); let refRelatedProps = props.ref !== void 0 ? { [refName]: props.ref } : {}; let resolvedChildren = typeof children === "function" ? children(slot) : children; if ("className" in rest && rest.className && typeof rest.className === "function") { rest.className = rest.className(slot); } let dataAttributes = {}; if (slot) { let exposeState = false; let states = []; for (let [k, v] of Object.entries(slot)) { if (typeof v === "boolean") { exposeState = true; } if (v === true) { states.push(k); } } if (exposeState) dataAttributes[`data-headlessui-state`] = states.join(" "); } if (Component === import_react14.Fragment) { if (Object.keys(compact(rest)).length > 0) { if (!(0, import_react14.isValidElement)(resolvedChildren) || Array.isArray(resolvedChildren) && resolvedChildren.length > 1) { throw new Error( [ 'Passing props on "Fragment"!', "", `The current component <${name} /> is rendering a "Fragment".`, `However we need to passthrough the following props:`, Object.keys(rest).map((line) => ` - ${line}`).join("\n"), "", "You can apply a few solutions:", [ 'Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".', "Render a single element as the child so that we can forward the props onto that element." ].map((line) => ` - ${line}`).join("\n") ].join("\n") ); } let childProps = resolvedChildren.props; let newClassName = typeof (childProps == null ? void 0 : childProps.className) === "function" ? (...args) => classNames(childProps == null ? void 0 : childProps.className(...args), rest.className) : classNames(childProps == null ? void 0 : childProps.className, rest.className); let classNameProps = newClassName ? { className: newClassName } : {}; return (0, import_react14.cloneElement)( resolvedChildren, Object.assign( {}, // Filter out undefined values so that they don't override the existing values mergeProps(resolvedChildren.props, compact(omit(rest, ["ref"]))), dataAttributes, refRelatedProps, mergeRefs(resolvedChildren.ref, refRelatedProps.ref), classNameProps ) ); } } return (0, import_react14.createElement)( Component, Object.assign( {}, omit(rest, ["ref"]), Component !== import_react14.Fragment && refRelatedProps, Component !== import_react14.Fragment && dataAttributes ), resolvedChildren ); } function mergeRefs(...refs) { return { ref: refs.every((ref) => ref == null) ? void 0 : (value) => { for (let ref of refs) { if (ref == null) continue; if (typeof ref === "function") ref(value); else ref.current = value; } } }; } function mergeProps(...listOfProps) { var _a3; if (listOfProps.length === 0) return {}; if (listOfProps.length === 1) return listOfProps[0]; let target = {}; let eventHandlers = {}; for (let props of listOfProps) { for (let prop in props) { if (prop.startsWith("on") && typeof props[prop] === "function") { (_a3 = eventHandlers[prop]) != null ? _a3 : eventHandlers[prop] = []; eventHandlers[prop].push(props[prop]); } else { target[prop] = props[prop]; } } } if (target.disabled || target["aria-disabled"]) { return Object.assign( target, // Set all event listeners that we collected to `undefined`. This is // important because of the `cloneElement` from above, which merges the // existing and new props, they don't just override therefore we have to // explicitly nullify them. Object.fromEntries(Object.keys(eventHandlers).map((eventName) => [eventName, void 0])) ); } for (let eventName in eventHandlers) { Object.assign(target, { [eventName](event, ...args) { let handlers = eventHandlers[eventName]; for (let handler of handlers) { if ((event instanceof Event || (event == null ? void 0 : event.nativeEvent) instanceof Event) && event.defaultPrevented) { return; } handler(event, ...args); } } }); } return target; } function forwardRefWithAs(component) { var _a3; return Object.assign((0, import_react14.forwardRef)(component), { displayName: (_a3 = component.displayName) != null ? _a3 : component.name }); } function compact(object) { let clone = Object.assign({}, object); for (let key in clone) { if (clone[key] === void 0) delete clone[key]; } return clone; } function omit(object, keysToOmit = []) { let clone = Object.assign({}, object); for (let key of keysToOmit) { if (key in clone) delete clone[key]; } return clone; } // src/utils/bugs.ts function isDisabledReactIssue7711(element) { let parent = element.parentElement; let legend = null; while (parent && !(parent instanceof HTMLFieldSetElement)) { if (parent instanceof HTMLLegendElement) legend = parent; parent = parent.parentElement; } let isParentDisabled = (parent == null ? void 0 : parent.getAttribute("disabled")) === ""; if (isParentDisabled && isFirstLegend(legend)) return false; return isParentDisabled; } function isFirstLegend(element) { if (!element) return false; let previous = element.previousElementSibling; while (previous !== null) { if (previous instanceof HTMLLegendElement) return false; previous = previous.previousElementSibling; } return true; } // src/utils/form.ts function objectToFormEntries(source = {}, parentKey = null, entries = []) { for (let [key, value] of Object.entries(source)) { append(entries, composeKey(parentKey, key), value); } return entries; } function composeKey(parent, key) { return parent ? parent + "[" + key + "]" : key; } function append(entries, key, value) { if (Array.isArray(value)) { for (let [subkey, subvalue] of value.entries()) { append(entries, composeKey(key, subkey.toString()), subvalue); } } else if (value instanceof Date) { entries.push([key, value.toISOString()]); } else if (typeof value === "boolean") { entries.push([key, value ? "1" : "0"]); } else if (typeof value === "string") { entries.push([key, value]); } else if (typeof value === "number") { entries.push([key, `${value}`]); } else if (value === null || value === void 0) { entries.push([key, ""]); } else { objectToFormEntries(value, key, entries); } } function attemptSubmit(element) { var _a3; let form = (_a3 = element == null ? void 0 : element.form) != null ? _a3 : element.closest("form"); if (!form) return; for (let element2 of form.elements) { if (element2.tagName === "INPUT" && element2.type === "submit" || element2.tagName === "BUTTON" && element2.type === "submit" || element2.nodeName === "INPUT" && element2.type === "image") { element2.click(); return; } } } // src/internal/hidden.tsx var DEFAULT_VISUALLY_HIDDEN_TAG = "div"; function VisuallyHidden(props, ref) { let { features = 1 /* None */, ...theirProps } = props; let ourProps = { ref, "aria-hidden": (features & 2 /* Focusable */) === 2 /* Focusable */ ? true : void 0, style: { position: "fixed", top: 1, left: 1, width: 1, height: 0, padding: 0, margin: -1, overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0", ...(features & 4 /* Hidden */) === 4 /* Hidden */ && !((features & 2 /* Focusable */) === 2 /* Focusable */) && { display: "none" } } }; return render({ ourProps, theirProps, slot: {}, defaultTag: DEFAULT_VISUALLY_HIDDEN_TAG, name: "Hidden" }); } var Hidden = forwardRefWithAs(VisuallyHidden); // src/internal/open-closed.tsx var import_react15 = __toESM(__webpack_require__(/*! react */ "react"), 1); var Context = (0, import_react15.createContext)(null); Context.displayName = "OpenClosedContext"; function useOpenClosed() { return (0, import_react15.useContext)(Context); } function OpenClosedProvider({ value, children }) { return /* @__PURE__ */ import_react15.default.createElement(Context.Provider, { value }, children); } // src/hooks/use-controllable.ts var import_react16 = __webpack_require__(/*! react */ "react"); function useControllable(controlledValue, onChange, defaultValue) { let [internalValue, setInternalValue] = (0, import_react16.useState)(defaultValue); let isControlled = controlledValue !== void 0; let wasControlled = (0, import_react16.useRef)(isControlled); let didWarnOnUncontrolledToControlled = (0, import_react16.useRef)(false); let didWarnOnControlledToUncontrolled = (0, import_react16.useRef)(false); if (isControlled && !wasControlled.current && !didWarnOnUncontrolledToControlled.current) { didWarnOnUncontrolledToControlled.current = true; wasControlled.current = isControlled; console.error( "A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen." ); } else if (!isControlled && wasControlled.current && !didWarnOnControlledToUncontrolled.current) { didWarnOnControlledToUncontrolled.current = true; wasControlled.current = isControlled; console.error( "A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen." ); } return [ isControlled ? controlledValue : internalValue, useEvent((value) => { if (isControlled) { return onChange == null ? void 0 : onChange(value); } else { setInternalValue(value); return onChange == null ? void 0 : onChange(value); } }) ]; } // src/hooks/use-watch.ts var import_react17 = __webpack_require__(/*! react */ "react"); function useWatch(cb, dependencies) { let track = (0, import_react17.useRef)([]); let action = useEvent(cb); (0, import_react17.useEffect)(() => { let oldValues = [...track.current]; for (let [idx, value] of dependencies.entries()) { if (track.current[idx] !== value) { let returnValue = action(dependencies, oldValues); track.current = dependencies; return returnValue; } } }, [action, ...dependencies]); } // src/hooks/use-tracked-pointer.ts var import_react18 = __webpack_require__(/*! react */ "react"); function eventToPosition(evt) { return [evt.screenX, evt.screenY]; } function useTrackedPointer() { let lastPos = (0, import_react18.useRef)([-1, -1]); return { wasMoved(evt) { if (false) {} let newPos = eventToPosition(evt); if (lastPos.current[0] === newPos[0] && lastPos.current[1] === newPos[1]) { return false; } lastPos.current = newPos; return true; }, update(evt) { lastPos.current = eventToPosition(evt); } }; } // src/utils/platform.ts function isIOS() { return ( // Check if it is an iPhone /iPhone/gi.test(window.navigator.platform) || // Check if it is an iPad. iPad reports itself as "MacIntel", but we can check if it is a touch // screen. Let's hope that Apple doesn't release a touch screen Mac (or maybe this would then // work as expected 🤔). /Mac/gi.test(window.navigator.platform) && window.navigator.maxTouchPoints > 0 ); } function isAndroid() { return /Android/gi.test(window.navigator.userAgent); } function isMobile() { return isIOS() || isAndroid(); } // src/components/combobox/combobox.tsx function adjustOrderedState(state, adjustment = (i) => i) { let currentActiveOption = state.activeOptionIndex !== null ? state.options[state.activeOptionIndex] : null; let sortedOptions = sortByDomNode( adjustment(state.options.slice()), (option) => option.dataRef.current.domRef.current ); let adjustedActiveOptionIndex = currentActiveOption ? sortedOptions.indexOf(currentActiveOption) : null; if (adjustedActiveOptionIndex === -1) { adjustedActiveOptionIndex = null; } return { options: sortedOptions, activeOptionIndex: adjustedActiveOptionIndex }; } var reducers = { [1 /* CloseCombobox */](state) { var _a3; if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.disabled) return state; if (state.comboboxState === 1 /* Closed */) return state; return { ...state, activeOptionIndex: null, comboboxState: 1 /* Closed */ }; }, [0 /* OpenCombobox */](state) { var _a3; if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.disabled) return state; if (state.comboboxState === 0 /* Open */) return state; let activeOptionIndex = state.activeOptionIndex; if (state.dataRef.current) { let { isSelected } = state.dataRef.current; let optionIdx = state.options.findIndex((option) => isSelected(option.dataRef.current.value)); if (optionIdx !== -1) { activeOptionIndex = optionIdx; } } return { ...state, comboboxState: 0 /* Open */, activeOptionIndex }; }, [2 /* GoToOption */](state, action) { var _a3, _b, _c, _d; if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.disabled) return state; if (((_b = state.dataRef.current) == null ? void 0 : _b.optionsRef.current) && !((_c = state.dataRef.current) == null ? void 0 : _c.optionsPropsRef.current.static) && state.comboboxState === 1 /* Closed */) { return state; } let adjustedState = adjustOrderedState(state); if (adjustedState.activeOptionIndex === null) { let localActiveOptionIndex = adjustedState.options.findIndex( (option) => !option.dataRef.current.disabled ); if (localActiveOptionIndex !== -1) { adjustedState.activeOptionIndex = localActiveOptionIndex; } } let activeOptionIndex = calculateActiveIndex(action, { resolveItems: () => adjustedState.options, resolveActiveIndex: () => adjustedState.activeOptionIndex, resolveId: (item) => item.id, resolveDisabled: (item) => item.dataRef.current.disabled }); return { ...state, ...adjustedState, activeOptionIndex, activationTrigger: (_d = action.trigger) != null ? _d : 1 /* Other */ }; }, [3 /* RegisterOption */]: (state, action) => { var _a3, _b; let option = { id: action.id, dataRef: action.dataRef }; let adjustedState = adjustOrderedState(state, (options) => [...options, option]); if (state.activeOptionIndex === null) { if ((_a3 = state.dataRef.current) == null ? void 0 : _a3.isSelected(action.dataRef.current.value)) { adjustedState.activeOptionIndex = adjustedState.options.indexOf(option); } } let nextState = { ...state, ...adjustedState, activationTrigger: 1 /* Other */ }; if (((_b = state.dataRef.current) == null ? void 0 : _b.__demoMode) && state.dataRef.current.value === void 0) { nextState.activeOptionIndex = 0; } return nextState; }, [4 /* UnregisterOption */]: (state, action) => { let adjustedState = adjustOrderedState(state, (options) => { let idx = options.findIndex((a) => a.id === action.id); if (idx !== -1) options.splice(idx, 1); return options; }); return { ...state, ...adjustedState, activationTrigger: 1 /* Other */ }; }, [5 /* RegisterLabel */]: (state, action) => { return { ...state, labelId: action.id }; } }; var ComboboxActionsContext = (0, import_react19.createContext)(null); ComboboxActionsContext.displayName = "ComboboxActionsContext"; function useActions(component) { let context = (0, import_react19.useContext)(ComboboxActionsContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useActions); throw err; } return context; } var ComboboxDataContext = (0, import_react19.createContext)(null); ComboboxDataContext.displayName = "ComboboxDataContext"; function useData(component) { let context = (0, import_react19.useContext)(ComboboxDataContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useData); throw err; } return context; } function stateReducer(state, action) { return match(action.type, reducers, state, action); } var DEFAULT_COMBOBOX_TAG = import_react19.Fragment; function ComboboxFn(props, ref) { let { value: controlledValue, defaultValue, onChange: controlledOnChange, form: formName, name, by = (a, z) => a === z, disabled = false, __demoMode = false, nullable = false, multiple = false, ...theirProps } = props; let [value = multiple ? [] : void 0, theirOnChange] = useControllable( controlledValue, controlledOnChange, defaultValue ); let [state, dispatch] = (0, import_react19.useReducer)(stateReducer, { dataRef: (0, import_react19.createRef)(), comboboxState: __demoMode ? 0 /* Open */ : 1 /* Closed */, options: [], activeOptionIndex: null, activationTrigger: 1 /* Other */, labelId: null }); let defaultToFirstOption = (0, import_react19.useRef)(false); let optionsPropsRef = (0, import_react19.useRef)({ static: false, hold: false }); let labelRef = (0, import_react19.useRef)(null); let inputRef = (0, import_react19.useRef)(null); let buttonRef = (0, import_react19.useRef)(null); let optionsRef = (0, import_react19.useRef)(null); let compare = useEvent( // @ts-expect-error Eventually we'll want to tackle this, but for now this will do. typeof by === "string" ? (a, z) => { let property = by; return (a == null ? void 0 : a[property]) === (z == null ? void 0 : z[property]); } : by ); let isSelected = (0, import_react19.useCallback)( (compareValue) => match(data.mode, { [1 /* Multi */]: () => value.some((option) => compare(option, compareValue)), [0 /* Single */]: () => compare(value, compareValue) }), [value] ); let data = (0, import_react19.useMemo)( () => ({ ...state, optionsPropsRef, labelRef, inputRef, buttonRef, optionsRef, value, defaultValue, disabled, mode: multiple ? 1 /* Multi */ : 0 /* Single */, get activeOptionIndex() { if (defaultToFirstOption.current && state.activeOptionIndex === null && state.options.length > 0) { let localActiveOptionIndex = state.options.findIndex( (option) => !option.dataRef.current.disabled ); if (localActiveOptionIndex !== -1) { return localActiveOptionIndex; } } return state.activeOptionIndex; }, compare, isSelected, nullable, __demoMode }), [value, defaultValue, disabled, multiple, nullable, __demoMode, state] ); let lastActiveOption = (0, import_react19.useRef)( data.activeOptionIndex !== null ? data.options[data.activeOptionIndex] : null ); (0, import_react19.useEffect)(() => { let currentActiveOption = data.activeOptionIndex !== null ? data.options[data.activeOptionIndex] : null; if (lastActiveOption.current !== currentActiveOption) { lastActiveOption.current = currentActiveOption; } }); useIsoMorphicEffect(() => { state.dataRef.current = data; }, [data]); useOutsideClick( [data.buttonRef, data.inputRef, data.optionsRef], () => actions.closeCombobox(), data.comboboxState === 0 /* Open */ ); let slot = (0, import_react19.useMemo)( () => ({ open: data.comboboxState === 0 /* Open */, disabled, activeIndex: data.activeOptionIndex, activeOption: data.activeOptionIndex === null ? null : data.options[data.activeOptionIndex].dataRef.current.value, value }), [data, disabled, value] ); let selectOption = useEvent((id) => { let option = data.options.find((item) => item.id === id); if (!option) return; onChange(option.dataRef.current.value); }); let selectActiveOption = useEvent(() => { if (data.activeOptionIndex !== null) { let { dataRef, id } = data.options[data.activeOptionIndex]; onChange(dataRef.current.value); actions.goToOption(4 /* Specific */, id); } }); let openCombobox = useEvent(() => { dispatch({ type: 0 /* OpenCombobox */ }); defaultToFirstOption.current = true; }); let closeCombobox = useEvent(() => { dispatch({ type: 1 /* CloseCombobox */ }); defaultToFirstOption.current = false; }); let goToOption = useEvent((focus, id, trigger) => { defaultToFirstOption.current = false; if (focus === 4 /* Specific */) { return dispatch({ type: 2 /* GoToOption */, focus: 4 /* Specific */, id, trigger }); } return dispatch({ type: 2 /* GoToOption */, focus, trigger }); }); let registerOption = useEvent((id, dataRef) => { dispatch({ type: 3 /* RegisterOption */, id, dataRef }); return () => { var _a3; if (((_a3 = lastActiveOption.current) == null ? void 0 : _a3.id) === id) { defaultToFirstOption.current = true; } dispatch({ type: 4 /* UnregisterOption */, id }); }; }); let registerLabel = useEvent((id) => { dispatch({ type: 5 /* RegisterLabel */, id }); return () => dispatch({ type: 5 /* RegisterLabel */, id: null }); }); let onChange = useEvent((value2) => { return match(data.mode, { [0 /* Single */]() { return theirOnChange == null ? void 0 : theirOnChange(value2); }, [1 /* Multi */]() { let copy = data.value.slice(); let idx = copy.findIndex((item) => compare(item, value2)); if (idx === -1) { copy.push(value2); } else { copy.splice(idx, 1); } return theirOnChange == null ? void 0 : theirOnChange(copy); } }); }); let actions = (0, import_react19.useMemo)( () => ({ onChange, registerOption, registerLabel, goToOption, closeCombobox, openCombobox, selectActiveOption, selectOption }), [] ); let ourProps = ref === null ? {} : { ref }; let form = (0, import_react19.useRef)(null); let d = useDisposables(); (0, import_react19.useEffect)(() => { if (!form.current) return; if (defaultValue === void 0) return; d.addEventListener(form.current, "reset", () => { onChange(defaultValue); }); }, [ form, onChange /* Explicitly ignoring `defaultValue` */ ]); return /* @__PURE__ */ import_react19.default.createElement(ComboboxActionsContext.Provider, { value: actions }, /* @__PURE__ */ import_react19.default.createElement(ComboboxDataContext.Provider, { value: data }, /* @__PURE__ */ import_react19.default.createElement( OpenClosedProvider, { value: match(data.comboboxState, { [0 /* Open */]: 1 /* Open */, [1 /* Closed */]: 2 /* Closed */ }) }, name != null && value != null && objectToFormEntries({ [name]: value }).map(([name2, value2], idx) => /* @__PURE__ */ import_react19.default.createElement( Hidden, { features: 4 /* Hidden */, ref: idx === 0 ? (element) => { var _a3; form.current = (_a3 = element == null ? void 0 : element.closest("form")) != null ? _a3 : null; } : void 0, ...compact({ key: name2, as: "input", type: "hidden", hidden: true, readOnly: true, form: formName, name: name2, value: value2 }) } )), render({ ourProps, theirProps, slot, defaultTag: DEFAULT_COMBOBOX_TAG, name: "Combobox" }) ))); } var DEFAULT_INPUT_TAG = "input"; function InputFn(props, ref) { var _a3, _b, _c, _d; let internalId = useId(); let { id = `headlessui-combobox-input-${internalId}`, onChange, displayValue, // @ts-ignore: We know this MAY NOT exist for a given tag but we only care when it _does_ exist. type = "text", ...theirProps } = props; let data = useData("Combobox.Input"); let actions = useActions("Combobox.Input"); let inputRef = useSyncRefs(data.inputRef, ref); let isTyping = (0, import_react19.useRef)(false); let d = useDisposables(); let currentDisplayValue = function() { var _a4; if (typeof displayValue === "function" && data.value !== void 0) { return (_a4 = displayValue(data.value)) != null ? _a4 : ""; } else if (typeof data.value === "string") { return data.value; } else { return ""; } }(); useWatch( ([currentDisplayValue2, state], [oldCurrentDisplayValue, oldState]) => { if (isTyping.current) return; if (!data.inputRef.current) return; if (oldState === 0 /* Open */ && state === 1 /* Closed */) { data.inputRef.current.value = currentDisplayValue2; } else if (currentDisplayValue2 !== oldCurrentDisplayValue) { data.inputRef.current.value = currentDisplayValue2; } }, [currentDisplayValue, data.comboboxState] ); useWatch( ([newState], [oldState]) => { if (newState === 0 /* Open */ && oldState === 1 /* Closed */) { let input = data.inputRef.current; if (!input) return; let currentValue = input.value; let { selectionStart, selectionEnd, selectionDirection } = input; input.value = ""; input.value = currentValue; if (selectionDirection !== null) { input.setSelectionRange(selectionStart, selectionEnd, selectionDirection); } else { input.setSelectionRange(selectionStart, selectionEnd); } } }, [data.comboboxState] ); let isComposing = (0, import_react19.useRef)(false); let composedChangeEvent = (0, import_react19.useRef)(null); let handleCompositionStart = useEvent(() => { isComposing.current = true; }); let handleCompositionEnd = useEvent(() => { d.nextFrame(() => { isComposing.current = false; if (composedChangeEvent.current) { actions.openCombobox(); onChange == null ? void 0 : onChange(composedChangeEvent.current); composedChangeEvent.current = null; } }); }); let handleKeyDown = useEvent((event) => { isTyping.current = true; switch (event.key) { case "Backspace" /* Backspace */: case "Delete" /* Delete */: if (data.mode !== 0 /* Single */) return; if (!data.nullable) return; let input = event.currentTarget; d.requestAnimationFrame(() => { if (input.value === "") { actions.onChange(null); if (data.optionsRef.current) { data.optionsRef.current.scrollTop = 0; } actions.goToOption(5 /* Nothing */); } }); break; case "Enter" /* Enter */: isTyping.current = false; if (data.comboboxState !== 0 /* Open */) return; if (isComposing.current) return; event.preventDefault(); event.stopPropagation(); if (data.activeOptionIndex === null) { actions.closeCombobox(); return; } actions.selectActiveOption(); if (data.mode === 0 /* Single */) { actions.closeCombobox(); } break; case "ArrowDown" /* ArrowDown */: isTyping.current = false; event.preventDefault(); event.stopPropagation(); return match(data.comboboxState, { [0 /* Open */]: () => { actions.goToOption(2 /* Next */); }, [1 /* Closed */]: () => { actions.openCombobox(); } }); case "ArrowUp" /* ArrowUp */: isTyping.current = false; event.preventDefault(); event.stopPropagation(); return match(data.comboboxState, { [0 /* Open */]: () => { actions.goToOption(1 /* Previous */); }, [1 /* Closed */]: () => { actions.openCombobox(); d.nextFrame(() => { if (!data.value) { actions.goToOption(3 /* Last */); } }); } }); case "Home" /* Home */: if (event.shiftKey) { break; } isTyping.current = false; event.preventDefault(); event.stopPropagation(); return actions.goToOption(0 /* First */); case "PageUp" /* PageUp */: isTyping.current = false; event.preventDefault(); event.stopPropagation(); return actions.goToOption(0 /* First */); case "End" /* End */: if (event.shiftKey) { break; } isTyping.current = false; event.preventDefault(); event.stopPropagation(); return actions.goToOption(3 /* Last */); case "PageDown" /* PageDown */: isTyping.current = false; event.preventDefault(); event.stopPropagation(); return actions.goToOption(3 /* Last */); case "Escape" /* Escape */: isTyping.current = false; if (data.comboboxState !== 0 /* Open */) return; event.preventDefault(); if (data.optionsRef.current && !data.optionsPropsRef.current.static) { event.stopPropagation(); } return actions.closeCombobox(); case "Tab" /* Tab */: isTyping.current = false; if (data.comboboxState !== 0 /* Open */) return; if (data.mode === 0 /* Single */) actions.selectActiveOption(); actions.closeCombobox(); break; } }); let handleChange = useEvent((event) => { if (isComposing.current) { composedChangeEvent.current = event; return; } actions.openCombobox(); onChange == null ? void 0 : onChange(event); }); let handleBlur = useEvent(() => { isTyping.current = false; }); let labelledby = useComputed(() => { if (!data.labelId) return void 0; return [data.labelId].join(" "); }, [data.labelId]); let slot = (0, import_react19.useMemo)( () => ({ open: data.comboboxState === 0 /* Open */, disabled: data.disabled }), [data] ); let ourProps = { ref: inputRef, id, role: "combobox", type, "aria-controls": (_a3 = data.optionsRef.current) == null ? void 0 : _a3.id, "aria-expanded": data.disabled ? void 0 : data.comboboxState === 0 /* Open */, "aria-activedescendant": data.activeOptionIndex === null ? void 0 : (_b = data.options[data.activeOptionIndex]) == null ? void 0 : _b.id, "aria-labelledby": labelledby, "aria-autocomplete": "list", defaultValue: (_d = (_c = props.defaultValue) != null ? _c : data.defaultValue !== void 0 ? displayValue == null ? void 0 : displayValue(data.defaultValue) : null) != null ? _d : data.defaultValue, disabled: data.disabled, onCompositionStart: handleCompositionStart, onCompositionEnd: handleCompositionEnd, onKeyDown: handleKeyDown, onChange: handleChange, onBlur: handleBlur }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_INPUT_TAG, name: "Combobox.Input" }); } var DEFAULT_BUTTON_TAG = "button"; function ButtonFn(props, ref) { var _a3; let data = useData("Combobox.Button"); let actions = useActions("Combobox.Button"); let buttonRef = useSyncRefs(data.buttonRef, ref); let internalId = useId(); let { id = `headlessui-combobox-button-${internalId}`, ...theirProps } = props; let d = useDisposables(); let handleKeyDown = useEvent((event) => { switch (event.key) { case "ArrowDown" /* ArrowDown */: event.preventDefault(); event.stopPropagation(); if (data.comboboxState === 1 /* Closed */) { actions.openCombobox(); } return d.nextFrame(() => { var _a4; return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); case "ArrowUp" /* ArrowUp */: event.preventDefault(); event.stopPropagation(); if (data.comboboxState === 1 /* Closed */) { actions.openCombobox(); d.nextFrame(() => { if (!data.value) { actions.goToOption(3 /* Last */); } }); } return d.nextFrame(() => { var _a4; return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); case "Escape" /* Escape */: if (data.comboboxState !== 0 /* Open */) return; event.preventDefault(); if (data.optionsRef.current && !data.optionsPropsRef.current.static) { event.stopPropagation(); } actions.closeCombobox(); return d.nextFrame(() => { var _a4; return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); default: return; } }); let handleClick = useEvent((event) => { if (isDisabledReactIssue7711(event.currentTarget)) return event.preventDefault(); if (data.comboboxState === 0 /* Open */) { actions.closeCombobox(); } else { event.preventDefault(); actions.openCombobox(); } d.nextFrame(() => { var _a4; return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); }); let labelledby = useComputed(() => { if (!data.labelId) return void 0; return [data.labelId, id].join(" "); }, [data.labelId, id]); let slot = (0, import_react19.useMemo)( () => ({ open: data.comboboxState === 0 /* Open */, disabled: data.disabled, value: data.value }), [data] ); let ourProps = { ref: buttonRef, id, type: useResolveButtonType(props, data.buttonRef), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (_a3 = data.optionsRef.current) == null ? void 0 : _a3.id, "aria-expanded": data.disabled ? void 0 : data.comboboxState === 0 /* Open */, "aria-labelledby": labelledby, disabled: data.disabled, onClick: handleClick, onKeyDown: handleKeyDown }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_BUTTON_TAG, name: "Combobox.Button" }); } var DEFAULT_LABEL_TAG = "label"; function LabelFn(props, ref) { let internalId = useId(); let { id = `headlessui-combobox-label-${internalId}`, ...theirProps } = props; let data = useData("Combobox.Label"); let actions = useActions("Combobox.Label"); let labelRef = useSyncRefs(data.labelRef, ref); useIsoMorphicEffect(() => actions.registerLabel(id), [id]); let handleClick = useEvent(() => { var _a3; return (_a3 = data.inputRef.current) == null ? void 0 : _a3.focus({ preventScroll: true }); }); let slot = (0, import_react19.useMemo)( () => ({ open: data.comboboxState === 0 /* Open */, disabled: data.disabled }), [data] ); let ourProps = { ref: labelRef, id, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_LABEL_TAG, name: "Combobox.Label" }); } var DEFAULT_OPTIONS_TAG = "ul"; var OptionsRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; function OptionsFn(props, ref) { let internalId = useId(); let { id = `headlessui-combobox-options-${internalId}`, hold = false, ...theirProps } = props; let data = useData("Combobox.Options"); let optionsRef = useSyncRefs(data.optionsRef, ref); let usesOpenClosedState = useOpenClosed(); let visible = (() => { if (usesOpenClosedState !== null) { return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } return data.comboboxState === 0 /* Open */; })(); useIsoMorphicEffect(() => { var _a3; data.optionsPropsRef.current.static = (_a3 = props.static) != null ? _a3 : false; }, [data.optionsPropsRef, props.static]); useIsoMorphicEffect(() => { data.optionsPropsRef.current.hold = hold; }, [data.optionsPropsRef, hold]); useTreeWalker({ container: data.optionsRef.current, enabled: data.comboboxState === 0 /* Open */, accept(node) { if (node.getAttribute("role") === "option") return NodeFilter.FILTER_REJECT; if (node.hasAttribute("role")) return NodeFilter.FILTER_SKIP; return NodeFilter.FILTER_ACCEPT; }, walk(node) { node.setAttribute("role", "none"); } }); let labelledby = useComputed( () => { var _a3, _b; return (_b = data.labelId) != null ? _b : (_a3 = data.buttonRef.current) == null ? void 0 : _a3.id; }, [data.labelId, data.buttonRef.current] ); let slot = (0, import_react19.useMemo)( () => ({ open: data.comboboxState === 0 /* Open */ }), [data] ); let ourProps = { "aria-labelledby": labelledby, role: "listbox", "aria-multiselectable": data.mode === 1 /* Multi */ ? true : void 0, id, ref: optionsRef }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_OPTIONS_TAG, features: OptionsRenderFeatures, visible, name: "Combobox.Options" }); } var DEFAULT_OPTION_TAG = "li"; function OptionFn(props, ref) { var _a3, _b; let internalId = useId(); let { id = `headlessui-combobox-option-${internalId}`, disabled = false, value, ...theirProps } = props; let data = useData("Combobox.Option"); let actions = useActions("Combobox.Option"); let active = data.activeOptionIndex !== null ? data.options[data.activeOptionIndex].id === id : false; let selected = data.isSelected(value); let internalOptionRef = (0, import_react19.useRef)(null); let bag = useLatestValue({ disabled, value, domRef: internalOptionRef, textValue: (_b = (_a3 = internalOptionRef.current) == null ? void 0 : _a3.textContent) == null ? void 0 : _b.toLowerCase() }); let optionRef = useSyncRefs(ref, internalOptionRef); let select = useEvent(() => actions.selectOption(id)); useIsoMorphicEffect(() => actions.registerOption(id, bag), [bag, id]); let enableScrollIntoView = (0, import_react19.useRef)(data.__demoMode ? false : true); useIsoMorphicEffect(() => { if (!data.__demoMode) return; let d = disposables(); d.requestAnimationFrame(() => { enableScrollIntoView.current = true; }); return d.dispose; }, []); useIsoMorphicEffect(() => { if (data.comboboxState !== 0 /* Open */) return; if (!active) return; if (!enableScrollIntoView.current) return; if (data.activationTrigger === 0 /* Pointer */) return; let d = disposables(); d.requestAnimationFrame(() => { var _a4, _b2; (_b2 = (_a4 = internalOptionRef.current) == null ? void 0 : _a4.scrollIntoView) == null ? void 0 : _b2.call(_a4, { block: "nearest" }); }); return d.dispose; }, [ internalOptionRef, active, data.comboboxState, data.activationTrigger, /* We also want to trigger this when the position of the active item changes so that we can re-trigger the scrollIntoView */ data.activeOptionIndex ]); let handleClick = useEvent((event) => { if (disabled) return event.preventDefault(); select(); if (data.mode === 0 /* Single */) { actions.closeCombobox(); } if (!isMobile()) { requestAnimationFrame(() => { var _a4; return (_a4 = data.inputRef.current) == null ? void 0 : _a4.focus(); }); } }); let handleFocus = useEvent(() => { if (disabled) return actions.goToOption(5 /* Nothing */); actions.goToOption(4 /* Specific */, id); }); let pointer = useTrackedPointer(); let handleEnter = useEvent((evt) => pointer.update(evt)); let handleMove = useEvent((evt) => { if (!pointer.wasMoved(evt)) return; if (disabled) return; if (active) return; actions.goToOption(4 /* Specific */, id, 0 /* Pointer */); }); let handleLeave = useEvent((evt) => { if (!pointer.wasMoved(evt)) return; if (disabled) return; if (!active) return; if (data.optionsPropsRef.current.hold) return; actions.goToOption(5 /* Nothing */); }); let slot = (0, import_react19.useMemo)( () => ({ active, selected, disabled }), [active, selected, disabled] ); let ourProps = { id, ref: optionRef, role: "option", tabIndex: disabled === true ? void 0 : -1, "aria-disabled": disabled === true ? true : void 0, // According to the WAI-ARIA best practices, we should use aria-checked for // multi-select,but Voice-Over disagrees. So we use aria-checked instead for // both single and multi-select. "aria-selected": selected, disabled: void 0, // Never forward the `disabled` prop onClick: handleClick, onFocus: handleFocus, onPointerEnter: handleEnter, onMouseEnter: handleEnter, onPointerMove: handleMove, onMouseMove: handleMove, onPointerLeave: handleLeave, onMouseLeave: handleLeave }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_OPTION_TAG, name: "Combobox.Option" }); } var ComboboxRoot = forwardRefWithAs(ComboboxFn); var Button = forwardRefWithAs(ButtonFn); var Input = forwardRefWithAs(InputFn); var Label = forwardRefWithAs(LabelFn); var Options = forwardRefWithAs(OptionsFn); var Option = forwardRefWithAs(OptionFn); var Combobox = Object.assign(ComboboxRoot, { Input, Button, Label, Options, Option }); // src/components/dialog/dialog.tsx var import_react31 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/components/focus-trap/focus-trap.tsx var import_react25 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/hooks/use-tab-direction.ts var import_react20 = __webpack_require__(/*! react */ "react"); function useTabDirection() { let direction = (0, import_react20.useRef)(0 /* Forwards */); useWindowEvent( "keydown", (event) => { if (event.key === "Tab") { direction.current = event.shiftKey ? 1 /* Backwards */ : 0 /* Forwards */; } }, true ); return direction; } // src/hooks/use-is-mounted.ts var import_react21 = __webpack_require__(/*! react */ "react"); function useIsMounted() { let mounted = (0, import_react21.useRef)(false); useIsoMorphicEffect(() => { mounted.current = true; return () => { mounted.current = false; }; }, []); return mounted; } // src/hooks/use-owner.ts var import_react22 = __webpack_require__(/*! react */ "react"); function useOwnerDocument(...args) { return (0, import_react22.useMemo)(() => getOwnerDocument(...args), [...args]); } // src/hooks/use-event-listener.ts var import_react23 = __webpack_require__(/*! react */ "react"); function useEventListener(element, type, listener, options) { let listenerRef = useLatestValue(listener); (0, import_react23.useEffect)(() => { element = element != null ? element : window; function handler(event) { listenerRef.current(event); } element.addEventListener(type, handler, options); return () => element.removeEventListener(type, handler, options); }, [element, type, options]); } // src/utils/document-ready.ts function onDocumentReady(cb) { function check() { if (document.readyState === "loading") return; cb(); document.removeEventListener("DOMContentLoaded", check); } if (typeof window !== "undefined" && typeof document !== "undefined") { document.addEventListener("DOMContentLoaded", check); check(); } } // src/hooks/use-on-unmount.ts var import_react24 = __webpack_require__(/*! react */ "react"); function useOnUnmount(cb) { let stableCb = useEvent(cb); let trulyUnmounted = (0, import_react24.useRef)(false); (0, import_react24.useEffect)(() => { trulyUnmounted.current = false; return () => { trulyUnmounted.current = true; microTask(() => { if (!trulyUnmounted.current) return; stableCb(); }); }; }, [stableCb]); } // src/components/focus-trap/focus-trap.tsx function resolveContainers(containers) { if (!containers) return /* @__PURE__ */ new Set(); if (typeof containers === "function") return new Set(containers()); let all = /* @__PURE__ */ new Set(); for (let container of containers.current) { if (container.current instanceof HTMLElement) { all.add(container.current); } } return all; } var DEFAULT_FOCUS_TRAP_TAG = "div"; var Features3 = /* @__PURE__ */ ((Features4) => { Features4[Features4["None"] = 1] = "None"; Features4[Features4["InitialFocus"] = 2] = "InitialFocus"; Features4[Features4["TabLock"] = 4] = "TabLock"; Features4[Features4["FocusLock"] = 8] = "FocusLock"; Features4[Features4["RestoreFocus"] = 16] = "RestoreFocus"; Features4[Features4["All"] = 30] = "All"; return Features4; })(Features3 || {}); function FocusTrapFn(props, ref) { let container = (0, import_react25.useRef)(null); let focusTrapRef = useSyncRefs(container, ref); let { initialFocus, containers, features = 30 /* All */, ...theirProps } = props; if (!useServerHandoffComplete()) { features = 1 /* None */; } let ownerDocument = useOwnerDocument(container); useRestoreFocus({ ownerDocument }, Boolean(features & 16 /* RestoreFocus */)); let previousActiveElement = useInitialFocus( { ownerDocument, container, initialFocus }, Boolean(features & 2 /* InitialFocus */) ); useFocusLock( { ownerDocument, container, containers, previousActiveElement }, Boolean(features & 8 /* FocusLock */) ); let direction = useTabDirection(); let handleFocus = useEvent((e) => { let el = container.current; if (!el) return; let wrapper = false ? 0 : (cb) => cb(); wrapper(() => { match(direction.current, { [0 /* Forwards */]: () => { focusIn(el, 1 /* First */, { skipElements: [e.relatedTarget] }); }, [1 /* Backwards */]: () => { focusIn(el, 8 /* Last */, { skipElements: [e.relatedTarget] }); } }); }); }); let d = useDisposables(); let recentlyUsedTabKey = (0, import_react25.useRef)(false); let ourProps = { ref: focusTrapRef, onKeyDown(e) { if (e.key == "Tab") { recentlyUsedTabKey.current = true; d.requestAnimationFrame(() => { recentlyUsedTabKey.current = false; }); } }, onBlur(e) { let allContainers = resolveContainers(containers); if (container.current instanceof HTMLElement) allContainers.add(container.current); let relatedTarget = e.relatedTarget; if (!(relatedTarget instanceof HTMLElement)) return; if (relatedTarget.dataset.headlessuiFocusGuard === "true") { return; } if (!contains(allContainers, relatedTarget)) { if (recentlyUsedTabKey.current) { focusIn( container.current, match(direction.current, { [0 /* Forwards */]: () => 4 /* Next */, [1 /* Backwards */]: () => 2 /* Previous */ }) | 16 /* WrapAround */, { relativeTo: e.target } ); } else if (e.target instanceof HTMLElement) { focusElement(e.target); } } } }; return /* @__PURE__ */ import_react25.default.createElement(import_react25.default.Fragment, null, Boolean(features & 4 /* TabLock */) && /* @__PURE__ */ import_react25.default.createElement( Hidden, { as: "button", type: "button", "data-headlessui-focus-guard": true, onFocus: handleFocus, features: 2 /* Focusable */ } ), render({ ourProps, theirProps, defaultTag: DEFAULT_FOCUS_TRAP_TAG, name: "FocusTrap" }), Boolean(features & 4 /* TabLock */) && /* @__PURE__ */ import_react25.default.createElement( Hidden, { as: "button", type: "button", "data-headlessui-focus-guard": true, onFocus: handleFocus, features: 2 /* Focusable */ } )); } var FocusTrapRoot = forwardRefWithAs(FocusTrapFn); var FocusTrap = Object.assign(FocusTrapRoot, { features: Features3 }); var history = []; onDocumentReady(() => { function handle(e) { if (!(e.target instanceof HTMLElement)) return; if (e.target === document.body) return; if (history[0] === e.target) return; history.unshift(e.target); history = history.filter((x) => x != null && x.isConnected); history.splice(10); } window.addEventListener("click", handle, { capture: true }); window.addEventListener("mousedown", handle, { capture: true }); window.addEventListener("focus", handle, { capture: true }); document.body.addEventListener("click", handle, { capture: true }); document.body.addEventListener("mousedown", handle, { capture: true }); document.body.addEventListener("focus", handle, { capture: true }); }); function useRestoreElement(enabled = true) { let localHistory = (0, import_react25.useRef)(history.slice()); useWatch( ([newEnabled], [oldEnabled]) => { if (oldEnabled === true && newEnabled === false) { microTask(() => { localHistory.current.splice(0); }); } if (oldEnabled === false && newEnabled === true) { localHistory.current = history.slice(); } }, [enabled, history, localHistory] ); return useEvent(() => { var _a3; return (_a3 = localHistory.current.find((x) => x != null && x.isConnected)) != null ? _a3 : null; }); } function useRestoreFocus({ ownerDocument }, enabled) { let getRestoreElement = useRestoreElement(enabled); useWatch(() => { if (enabled) return; if ((ownerDocument == null ? void 0 : ownerDocument.activeElement) === (ownerDocument == null ? void 0 : ownerDocument.body)) { focusElement(getRestoreElement()); } }, [enabled]); useOnUnmount(() => { if (!enabled) return; focusElement(getRestoreElement()); }); } function useInitialFocus({ ownerDocument, container, initialFocus }, enabled) { let previousActiveElement = (0, import_react25.useRef)(null); let mounted = useIsMounted(); useWatch(() => { if (!enabled) return; let containerElement = container.current; if (!containerElement) return; microTask(() => { if (!mounted.current) { return; } let activeElement = ownerDocument == null ? void 0 : ownerDocument.activeElement; if (initialFocus == null ? void 0 : initialFocus.current) { if ((initialFocus == null ? void 0 : initialFocus.current) === activeElement) { previousActiveElement.current = activeElement; return; } } else if (containerElement.contains(activeElement)) { previousActiveElement.current = activeElement; return; } if (initialFocus == null ? void 0 : initialFocus.current) { focusElement(initialFocus.current); } else { if (focusIn(containerElement, 1 /* First */) === 0 /* Error */) { console.warn("There are no focusable elements inside the "); } } previousActiveElement.current = ownerDocument == null ? void 0 : ownerDocument.activeElement; }); }, [enabled]); return previousActiveElement; } function useFocusLock({ ownerDocument, container, containers, previousActiveElement }, enabled) { let mounted = useIsMounted(); useEventListener( ownerDocument == null ? void 0 : ownerDocument.defaultView, "focus", (event) => { if (!enabled) return; if (!mounted.current) return; let allContainers = resolveContainers(containers); if (container.current instanceof HTMLElement) allContainers.add(container.current); let previous = previousActiveElement.current; if (!previous) return; let toElement = event.target; if (toElement && toElement instanceof HTMLElement) { if (!contains(allContainers, toElement)) { event.preventDefault(); event.stopPropagation(); focusElement(previous); } else { previousActiveElement.current = toElement; focusElement(toElement); } } else { focusElement(previousActiveElement.current); } }, true ); } function contains(containers, element) { for (let container of containers) { if (container.contains(element)) return true; } return false; } // src/components/portal/portal.tsx var import_react27 = __toESM(__webpack_require__(/*! react */ "react"), 1); var import_react_dom = __webpack_require__(/*! react-dom */ "react-dom"); // src/internal/portal-force-root.tsx var import_react26 = __toESM(__webpack_require__(/*! react */ "react"), 1); var ForcePortalRootContext = (0, import_react26.createContext)(false); function usePortalRoot() { return (0, import_react26.useContext)(ForcePortalRootContext); } function ForcePortalRoot(props) { return /* @__PURE__ */ import_react26.default.createElement(ForcePortalRootContext.Provider, { value: props.force }, props.children); } // src/components/portal/portal.tsx function usePortalTarget(ref) { let forceInRoot = usePortalRoot(); let groupTarget = (0, import_react27.useContext)(PortalGroupContext); let ownerDocument = useOwnerDocument(ref); let [target, setTarget] = (0, import_react27.useState)(() => { if (!forceInRoot && groupTarget !== null) return null; if (env.isServer) return null; let existingRoot = ownerDocument == null ? void 0 : ownerDocument.getElementById("headlessui-portal-root"); if (existingRoot) return existingRoot; if (ownerDocument === null) return null; let root = ownerDocument.createElement("div"); root.setAttribute("id", "headlessui-portal-root"); return ownerDocument.body.appendChild(root); }); (0, import_react27.useEffect)(() => { if (target === null) return; if (!(ownerDocument == null ? void 0 : ownerDocument.body.contains(target))) { ownerDocument == null ? void 0 : ownerDocument.body.appendChild(target); } }, [target, ownerDocument]); (0, import_react27.useEffect)(() => { if (forceInRoot) return; if (groupTarget === null) return; setTarget(groupTarget.current); }, [groupTarget, setTarget, forceInRoot]); return target; } var DEFAULT_PORTAL_TAG = import_react27.Fragment; function PortalFn(props, ref) { let theirProps = props; let internalPortalRootRef = (0, import_react27.useRef)(null); let portalRef = useSyncRefs( optionalRef((ref2) => { internalPortalRootRef.current = ref2; }), ref ); let ownerDocument = useOwnerDocument(internalPortalRootRef); let target = usePortalTarget(internalPortalRootRef); let [element] = (0, import_react27.useState)( () => { var _a3; return env.isServer ? null : (_a3 = ownerDocument == null ? void 0 : ownerDocument.createElement("div")) != null ? _a3 : null; } ); let parent = (0, import_react27.useContext)(PortalParentContext); let ready = useServerHandoffComplete(); useIsoMorphicEffect(() => { if (!target || !element) return; if (!target.contains(element)) { element.setAttribute("data-headlessui-portal", ""); target.appendChild(element); } }, [target, element]); useIsoMorphicEffect(() => { if (!element) return; if (!parent) return; return parent.register(element); }, [parent, element]); useOnUnmount(() => { var _a3; if (!target || !element) return; if (element instanceof Node && target.contains(element)) { target.removeChild(element); } if (target.childNodes.length <= 0) { (_a3 = target.parentElement) == null ? void 0 : _a3.removeChild(target); } }); if (!ready) return null; let ourProps = { ref: portalRef }; return !target || !element ? null : (0, import_react_dom.createPortal)( render({ ourProps, theirProps, defaultTag: DEFAULT_PORTAL_TAG, name: "Portal" }), element ); } var DEFAULT_GROUP_TAG = import_react27.Fragment; var PortalGroupContext = (0, import_react27.createContext)(null); function GroupFn(props, ref) { let { target, ...theirProps } = props; let groupRef = useSyncRefs(ref); let ourProps = { ref: groupRef }; return /* @__PURE__ */ import_react27.default.createElement(PortalGroupContext.Provider, { value: target }, render({ ourProps, theirProps, defaultTag: DEFAULT_GROUP_TAG, name: "Popover.Group" })); } var PortalParentContext = (0, import_react27.createContext)(null); function useNestedPortals() { let parent = (0, import_react27.useContext)(PortalParentContext); let portals = (0, import_react27.useRef)([]); let register = useEvent((portal) => { portals.current.push(portal); if (parent) parent.register(portal); return () => unregister(portal); }); let unregister = useEvent((portal) => { let idx = portals.current.indexOf(portal); if (idx !== -1) portals.current.splice(idx, 1); if (parent) parent.unregister(portal); }); let api = (0, import_react27.useMemo)( () => ({ register, unregister, portals }), [register, unregister, portals] ); return [ portals, (0, import_react27.useMemo)(() => { return function PortalWrapper({ children }) { return /* @__PURE__ */ import_react27.default.createElement(PortalParentContext.Provider, { value: api }, children); }; }, [api]) ]; } var PortalRoot = forwardRefWithAs(PortalFn); var Group = forwardRefWithAs(GroupFn); var Portal = Object.assign(PortalRoot, { Group }); // src/components/description/description.tsx var import_react28 = __toESM(__webpack_require__(/*! react */ "react"), 1); var DescriptionContext = (0, import_react28.createContext)(null); function useDescriptionContext() { let context = (0, import_react28.useContext)(DescriptionContext); if (context === null) { let err = new Error( "You used a component, but it is not inside a relevant parent." ); if (Error.captureStackTrace) Error.captureStackTrace(err, useDescriptionContext); throw err; } return context; } function useDescriptions() { let [descriptionIds, setDescriptionIds] = (0, import_react28.useState)([]); return [ // The actual id's as string or undefined descriptionIds.length > 0 ? descriptionIds.join(" ") : void 0, // The provider component (0, import_react28.useMemo)(() => { return function DescriptionProvider(props) { let register = useEvent((value) => { setDescriptionIds((existing) => [...existing, value]); return () => setDescriptionIds((existing) => { let clone = existing.slice(); let idx = clone.indexOf(value); if (idx !== -1) clone.splice(idx, 1); return clone; }); }); let contextBag = (0, import_react28.useMemo)( () => ({ register, slot: props.slot, name: props.name, props: props.props }), [register, props.slot, props.name, props.props] ); return /* @__PURE__ */ import_react28.default.createElement(DescriptionContext.Provider, { value: contextBag }, props.children); }; }, [setDescriptionIds]) ]; } var DEFAULT_DESCRIPTION_TAG = "p"; function DescriptionFn(props, ref) { let internalId = useId(); let { id = `headlessui-description-${internalId}`, ...theirProps } = props; let context = useDescriptionContext(); let descriptionRef = useSyncRefs(ref); useIsoMorphicEffect(() => context.register(id), [id, context.register]); let ourProps = { ref: descriptionRef, ...context.props, id }; return render({ ourProps, theirProps, slot: context.slot || {}, defaultTag: DEFAULT_DESCRIPTION_TAG, name: context.name || "Description" }); } var DescriptionRoot = forwardRefWithAs(DescriptionFn); var Description = Object.assign(DescriptionRoot, { // }); // src/internal/stack-context.tsx var import_react29 = __toESM(__webpack_require__(/*! react */ "react"), 1); var StackContext = (0, import_react29.createContext)(() => { }); StackContext.displayName = "StackContext"; function useStackContext() { return (0, import_react29.useContext)(StackContext); } function StackProvider({ children, onUpdate, type, element, enabled }) { let parentUpdate = useStackContext(); let notify = useEvent((...args) => { onUpdate == null ? void 0 : onUpdate(...args); parentUpdate(...args); }); useIsoMorphicEffect(() => { let shouldNotify = enabled === void 0 || enabled === true; shouldNotify && notify(0 /* Add */, type, element); return () => { shouldNotify && notify(1 /* Remove */, type, element); }; }, [notify, type, element, enabled]); return /* @__PURE__ */ import_react29.default.createElement(StackContext.Provider, { value: notify }, children); } // src/use-sync-external-store-shim/index.ts var React11 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/use-sync-external-store-shim/useSyncExternalStoreShimClient.ts var React10 = __toESM(__webpack_require__(/*! react */ "react"), 1); function isPolyfill(x, y) { return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y; } var is = typeof Object.is === "function" ? Object.is : isPolyfill; var { useState: useState8, useEffect: useEffect14, useLayoutEffect: useLayoutEffect2, useDebugValue } = React10; var didWarnOld18Alpha = false; var didWarnUncachedGetSnapshot = false; function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) { if (true) { if (!didWarnOld18Alpha) { if ("startTransition" in React10) { didWarnOld18Alpha = true; console.error( "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." ); } } } const value = getSnapshot(); if (true) { if (!didWarnUncachedGetSnapshot) { const cachedValue = getSnapshot(); if (!is(value, cachedValue)) { console.error("The result of getSnapshot should be cached to avoid an infinite loop"); didWarnUncachedGetSnapshot = true; } } } const [{ inst }, forceUpdate] = useState8({ inst: { value, getSnapshot } }); useLayoutEffect2(() => { inst.value = value; inst.getSnapshot = getSnapshot; if (checkIfSnapshotChanged(inst)) { forceUpdate({ inst }); } }, [subscribe, value, getSnapshot]); useEffect14(() => { if (checkIfSnapshotChanged(inst)) { forceUpdate({ inst }); } const handleStoreChange = () => { if (checkIfSnapshotChanged(inst)) { forceUpdate({ inst }); } }; return subscribe(handleStoreChange); }, [subscribe]); useDebugValue(value); return value; } function checkIfSnapshotChanged(inst) { const latestGetSnapshot = inst.getSnapshot; const prevValue = inst.value; try { const nextValue = latestGetSnapshot(); return !is(prevValue, nextValue); } catch (error) { return true; } } // src/use-sync-external-store-shim/useSyncExternalStoreShimServer.ts function useSyncExternalStore2(subscribe, getSnapshot, getServerSnapshot) { return getSnapshot(); } // src/use-sync-external-store-shim/index.ts var canUseDOM = !!(typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.document.createElement !== "undefined"); var isServerEnvironment = !canUseDOM; var shim = isServerEnvironment ? useSyncExternalStore2 : useSyncExternalStore; var useSyncExternalStore3 = "useSyncExternalStore" in React11 ? ((r) => r.useSyncExternalStore)(React11) : shim; // src/hooks/use-store.ts function useStore(store) { return useSyncExternalStore3(store.subscribe, store.getSnapshot, store.getSnapshot); } // src/utils/store.ts function createStore(initial, actions) { let state = initial(); let listeners = /* @__PURE__ */ new Set(); return { getSnapshot() { return state; }, subscribe(onChange) { listeners.add(onChange); return () => listeners.delete(onChange); }, dispatch(key, ...args) { let newState = actions[key].call(state, ...args); if (newState) { state = newState; listeners.forEach((listener) => listener()); } } }; } // src/hooks/document-overflow/adjust-scrollbar-padding.ts function adjustScrollbarPadding() { let scrollbarWidthBefore; return { before({ doc }) { var _a3; let documentElement = doc.documentElement; let ownerWindow = (_a3 = doc.defaultView) != null ? _a3 : window; scrollbarWidthBefore = ownerWindow.innerWidth - documentElement.clientWidth; }, after({ doc, d }) { let documentElement = doc.documentElement; let scrollbarWidthAfter = documentElement.clientWidth - documentElement.offsetWidth; let scrollbarWidth = scrollbarWidthBefore - scrollbarWidthAfter; d.style(documentElement, "paddingRight", `${scrollbarWidth}px`); } }; } // src/hooks/document-overflow/handle-ios-locking.ts function handleIOSLocking() { if (!isIOS()) { return {}; } let scrollPosition; return { before() { scrollPosition = window.pageYOffset; }, after({ doc, d, meta }) { function inAllowedContainer(el) { return meta.containers.flatMap((resolve) => resolve()).some((container) => container.contains(el)); } d.style(doc.body, "marginTop", `-${scrollPosition}px`); window.scrollTo(0, 0); let scrollToElement = null; d.addEventListener( doc, "click", (e) => { if (!(e.target instanceof HTMLElement)) { return; } try { let anchor = e.target.closest("a"); if (!anchor) return; let { hash } = new URL(anchor.href); let el = doc.querySelector(hash); if (el && !inAllowedContainer(el)) { scrollToElement = el; } } catch (err) { } }, true ); d.addEventListener( doc, "touchmove", (e) => { if (e.target instanceof HTMLElement && !inAllowedContainer(e.target)) { e.preventDefault(); } }, { passive: false } ); d.add(() => { window.scrollTo(0, window.pageYOffset + scrollPosition); if (scrollToElement && scrollToElement.isConnected) { scrollToElement.scrollIntoView({ block: "nearest" }); scrollToElement = null; } }); } }; } // src/hooks/document-overflow/prevent-scroll.ts function preventScroll() { return { before({ doc, d }) { d.style(doc.documentElement, "overflow", "hidden"); } }; } // src/hooks/document-overflow/overflow-store.ts function buildMeta(fns) { let tmp = {}; for (let fn of fns) { Object.assign(tmp, fn(tmp)); } return tmp; } var overflows = createStore(() => /* @__PURE__ */ new Map(), { PUSH(doc, meta) { var _a3; let entry = (_a3 = this.get(doc)) != null ? _a3 : { doc, count: 0, d: disposables(), meta: /* @__PURE__ */ new Set() }; entry.count++; entry.meta.add(meta); this.set(doc, entry); return this; }, POP(doc, meta) { let entry = this.get(doc); if (entry) { entry.count--; entry.meta.delete(meta); } return this; }, SCROLL_PREVENT({ doc, d, meta }) { let ctx = { doc, d, meta: buildMeta(meta) }; let steps = [ handleIOSLocking(), adjustScrollbarPadding(), preventScroll() ]; steps.forEach(({ before }) => before == null ? void 0 : before(ctx)); steps.forEach(({ after }) => after == null ? void 0 : after(ctx)); }, SCROLL_ALLOW({ d }) { d.dispose(); }, TEARDOWN({ doc }) { this.delete(doc); } }); overflows.subscribe(() => { let docs = overflows.getSnapshot(); let styles = /* @__PURE__ */ new Map(); for (let [doc] of docs) { styles.set(doc, doc.documentElement.style.overflow); } for (let entry of docs.values()) { let isHidden = styles.get(entry.doc) === "hidden"; let isLocked = entry.count !== 0; let willChange = isLocked && !isHidden || !isLocked && isHidden; if (willChange) { overflows.dispatch(entry.count > 0 ? "SCROLL_PREVENT" : "SCROLL_ALLOW", entry); } if (entry.count === 0) { overflows.dispatch("TEARDOWN", entry); } } }); // src/hooks/document-overflow/use-document-overflow.ts function useDocumentOverflowLockedEffect(doc, shouldBeLocked, meta) { let store = useStore(overflows); let entry = doc ? store.get(doc) : void 0; let locked = entry ? entry.count > 0 : false; useIsoMorphicEffect(() => { if (!doc || !shouldBeLocked) { return; } overflows.dispatch("PUSH", doc, meta); return () => overflows.dispatch("POP", doc, meta); }, [shouldBeLocked, doc]); return locked; } // src/hooks/use-inert.tsx var originals = /* @__PURE__ */ new Map(); var counts = /* @__PURE__ */ new Map(); function useInert(node, enabled = true) { useIsoMorphicEffect(() => { var _a3; if (!enabled) return; let element = typeof node === "function" ? node() : node.current; if (!element) return; function cleanup() { var _a4; if (!element) return; let count2 = (_a4 = counts.get(element)) != null ? _a4 : 1; if (count2 === 1) counts.delete(element); else counts.set(element, count2 - 1); if (count2 !== 1) return; let original = originals.get(element); if (!original) return; if (original["aria-hidden"] === null) element.removeAttribute("aria-hidden"); else element.setAttribute("aria-hidden", original["aria-hidden"]); element.inert = original.inert; originals.delete(element); } let count = (_a3 = counts.get(element)) != null ? _a3 : 0; counts.set(element, count + 1); if (count !== 0) return cleanup; originals.set(element, { "aria-hidden": element.getAttribute("aria-hidden"), inert: element.inert }); element.setAttribute("aria-hidden", "true"); element.inert = true; return cleanup; }, [node, enabled]); } // src/hooks/use-root-containers.tsx var import_react30 = __toESM(__webpack_require__(/*! react */ "react"), 1); function useRootContainers({ defaultContainers = [], portals } = {}) { let mainTreeNodeRef = (0, import_react30.useRef)(null); let ownerDocument = useOwnerDocument(mainTreeNodeRef); let resolveContainers2 = useEvent(() => { var _a3; let containers = []; for (let container of defaultContainers) { if (container === null) continue; if (container instanceof HTMLElement) { containers.push(container); } else if ("current" in container && container.current instanceof HTMLElement) { containers.push(container.current); } } if (portals == null ? void 0 : portals.current) { for (let portal of portals.current) { containers.push(portal); } } for (let container of (_a3 = ownerDocument == null ? void 0 : ownerDocument.querySelectorAll("html > *, body > *")) != null ? _a3 : []) { if (container === document.body) continue; if (container === document.head) continue; if (!(container instanceof HTMLElement)) continue; if (container.id === "headlessui-portal-root") continue; if (container.contains(mainTreeNodeRef.current)) continue; if (containers.some((defaultContainer) => container.contains(defaultContainer))) continue; containers.push(container); } return containers; }); return { resolveContainers: resolveContainers2, contains: useEvent( (element) => resolveContainers2().some((container) => container.contains(element)) ), mainTreeNodeRef, MainTreeNode: (0, import_react30.useMemo)(() => { return function MainTreeNode() { return /* @__PURE__ */ import_react30.default.createElement(Hidden, { features: 4 /* Hidden */, ref: mainTreeNodeRef }); }; }, [mainTreeNodeRef]) }; } // src/components/dialog/dialog.tsx var reducers2 = { [0 /* SetTitleId */](state, action) { if (state.titleId === action.id) return state; return { ...state, titleId: action.id }; } }; var DialogContext = (0, import_react31.createContext)(null); DialogContext.displayName = "DialogContext"; function useDialogContext(component) { let context = (0, import_react31.useContext)(DialogContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useDialogContext); throw err; } return context; } function useScrollLock(ownerDocument, enabled, resolveAllowedContainers = () => [document.body]) { useDocumentOverflowLockedEffect(ownerDocument, enabled, (meta) => { var _a3; return { containers: [...(_a3 = meta.containers) != null ? _a3 : [], resolveAllowedContainers] }; }); } function stateReducer2(state, action) { return match(action.type, reducers2, state, action); } var DEFAULT_DIALOG_TAG = "div"; var DialogRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; function DialogFn(props, ref) { var _a3; let internalId = useId(); let { id = `headlessui-dialog-${internalId}`, open, onClose, initialFocus, __demoMode = false, ...theirProps } = props; let [nestedDialogCount, setNestedDialogCount] = (0, import_react31.useState)(0); let usesOpenClosedState = useOpenClosed(); if (open === void 0 && usesOpenClosedState !== null) { open = (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } let internalDialogRef = (0, import_react31.useRef)(null); let dialogRef = useSyncRefs(internalDialogRef, ref); let ownerDocument = useOwnerDocument(internalDialogRef); let hasOpen = props.hasOwnProperty("open") || usesOpenClosedState !== null; let hasOnClose = props.hasOwnProperty("onClose"); if (!hasOpen && !hasOnClose) { throw new Error( `You have to provide an \`open\` and an \`onClose\` prop to the \`Dialog\` component.` ); } if (!hasOpen) { throw new Error( `You provided an \`onClose\` prop to the \`Dialog\`, but forgot an \`open\` prop.` ); } if (!hasOnClose) { throw new Error( `You provided an \`open\` prop to the \`Dialog\`, but forgot an \`onClose\` prop.` ); } if (typeof open !== "boolean") { throw new Error( `You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${open}` ); } if (typeof onClose !== "function") { throw new Error( `You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${onClose}` ); } let dialogState = open ? 0 /* Open */ : 1 /* Closed */; let [state, dispatch] = (0, import_react31.useReducer)(stateReducer2, { titleId: null, descriptionId: null, panelRef: (0, import_react31.createRef)() }); let close = useEvent(() => onClose(false)); let setTitleId = useEvent((id2) => dispatch({ type: 0 /* SetTitleId */, id: id2 })); let ready = useServerHandoffComplete(); let enabled = ready ? __demoMode ? false : dialogState === 0 /* Open */ : false; let hasNestedDialogs = nestedDialogCount > 1; let hasParentDialog = (0, import_react31.useContext)(DialogContext) !== null; let [portals, PortalWrapper] = useNestedPortals(); let { resolveContainers: resolveRootContainers, mainTreeNodeRef, MainTreeNode } = useRootContainers({ portals, defaultContainers: [(_a3 = state.panelRef.current) != null ? _a3 : internalDialogRef.current] }); let position = !hasNestedDialogs ? "leaf" : "parent"; let isClosing = usesOpenClosedState !== null ? (usesOpenClosedState & 4 /* Closing */) === 4 /* Closing */ : false; let inertOthersEnabled = (() => { if (hasParentDialog) return false; if (isClosing) return false; return enabled; })(); let resolveRootOfMainTreeNode = (0, import_react31.useCallback)(() => { var _a4, _b; return (_b = Array.from((_a4 = ownerDocument == null ? void 0 : ownerDocument.querySelectorAll("body > *")) != null ? _a4 : []).find((root) => { if (root.id === "headlessui-portal-root") return false; return root.contains(mainTreeNodeRef.current) && root instanceof HTMLElement; })) != null ? _b : null; }, [mainTreeNodeRef]); useInert(resolveRootOfMainTreeNode, inertOthersEnabled); let inertParentDialogs = (() => { if (hasNestedDialogs) return true; return enabled; })(); let resolveRootOfParentDialog = (0, import_react31.useCallback)(() => { var _a4, _b; return (_b = Array.from((_a4 = ownerDocument == null ? void 0 : ownerDocument.querySelectorAll("[data-headlessui-portal]")) != null ? _a4 : []).find( (root) => root.contains(mainTreeNodeRef.current) && root instanceof HTMLElement )) != null ? _b : null; }, [mainTreeNodeRef]); useInert(resolveRootOfParentDialog, inertParentDialogs); let outsideClickEnabled = (() => { if (!enabled) return false; if (hasNestedDialogs) return false; return true; })(); useOutsideClick(resolveRootContainers, close, outsideClickEnabled); let escapeToCloseEnabled = (() => { if (hasNestedDialogs) return false; if (dialogState !== 0 /* Open */) return false; return true; })(); useEventListener(ownerDocument == null ? void 0 : ownerDocument.defaultView, "keydown", (event) => { if (!escapeToCloseEnabled) return; if (event.defaultPrevented) return; if (event.key !== "Escape" /* Escape */) return; event.preventDefault(); event.stopPropagation(); close(); }); let scrollLockEnabled = (() => { if (isClosing) return false; if (dialogState !== 0 /* Open */) return false; if (hasParentDialog) return false; return true; })(); useScrollLock(ownerDocument, scrollLockEnabled, resolveRootContainers); (0, import_react31.useEffect)(() => { if (dialogState !== 0 /* Open */) return; if (!internalDialogRef.current) return; let observer = new ResizeObserver((entries) => { for (let entry of entries) { let rect = entry.target.getBoundingClientRect(); if (rect.x === 0 && rect.y === 0 && rect.width === 0 && rect.height === 0) { close(); } } }); observer.observe(internalDialogRef.current); return () => observer.disconnect(); }, [dialogState, internalDialogRef, close]); let [describedby, DescriptionProvider] = useDescriptions(); let contextBag = (0, import_react31.useMemo)( () => [{ dialogState, close, setTitleId }, state], [dialogState, state, close, setTitleId] ); let slot = (0, import_react31.useMemo)( () => ({ open: dialogState === 0 /* Open */ }), [dialogState] ); let ourProps = { ref: dialogRef, id, role: "dialog", "aria-modal": dialogState === 0 /* Open */ ? true : void 0, "aria-labelledby": state.titleId, "aria-describedby": describedby }; return /* @__PURE__ */ import_react31.default.createElement( StackProvider, { type: "Dialog", enabled: dialogState === 0 /* Open */, element: internalDialogRef, onUpdate: useEvent((message, type) => { if (type !== "Dialog") return; match(message, { [0 /* Add */]: () => setNestedDialogCount((count) => count + 1), [1 /* Remove */]: () => setNestedDialogCount((count) => count - 1) }); }) }, /* @__PURE__ */ import_react31.default.createElement(ForcePortalRoot, { force: true }, /* @__PURE__ */ import_react31.default.createElement(Portal, null, /* @__PURE__ */ import_react31.default.createElement(DialogContext.Provider, { value: contextBag }, /* @__PURE__ */ import_react31.default.createElement(Portal.Group, { target: internalDialogRef }, /* @__PURE__ */ import_react31.default.createElement(ForcePortalRoot, { force: false }, /* @__PURE__ */ import_react31.default.createElement(DescriptionProvider, { slot, name: "Dialog.Description" }, /* @__PURE__ */ import_react31.default.createElement( FocusTrap, { initialFocus, containers: resolveRootContainers, features: enabled ? match(position, { parent: FocusTrap.features.RestoreFocus, leaf: FocusTrap.features.All & ~FocusTrap.features.FocusLock }) : FocusTrap.features.None }, /* @__PURE__ */ import_react31.default.createElement(PortalWrapper, null, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_DIALOG_TAG, features: DialogRenderFeatures, visible: dialogState === 0 /* Open */, name: "Dialog" })) ))))))), /* @__PURE__ */ import_react31.default.createElement(MainTreeNode, null) ); } var DEFAULT_OVERLAY_TAG = "div"; function OverlayFn(props, ref) { let internalId = useId(); let { id = `headlessui-dialog-overlay-${internalId}`, ...theirProps } = props; let [{ dialogState, close }] = useDialogContext("Dialog.Overlay"); let overlayRef = useSyncRefs(ref); let handleClick = useEvent((event) => { if (event.target !== event.currentTarget) return; if (isDisabledReactIssue7711(event.currentTarget)) return event.preventDefault(); event.preventDefault(); event.stopPropagation(); close(); }); let slot = (0, import_react31.useMemo)( () => ({ open: dialogState === 0 /* Open */ }), [dialogState] ); let ourProps = { ref: overlayRef, id, "aria-hidden": true, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_OVERLAY_TAG, name: "Dialog.Overlay" }); } var DEFAULT_BACKDROP_TAG = "div"; function BackdropFn(props, ref) { let internalId = useId(); let { id = `headlessui-dialog-backdrop-${internalId}`, ...theirProps } = props; let [{ dialogState }, state] = useDialogContext("Dialog.Backdrop"); let backdropRef = useSyncRefs(ref); (0, import_react31.useEffect)(() => { if (state.panelRef.current === null) { throw new Error( `A component is being used, but a component is missing.` ); } }, [state.panelRef]); let slot = (0, import_react31.useMemo)( () => ({ open: dialogState === 0 /* Open */ }), [dialogState] ); let ourProps = { ref: backdropRef, id, "aria-hidden": true }; return /* @__PURE__ */ import_react31.default.createElement(ForcePortalRoot, { force: true }, /* @__PURE__ */ import_react31.default.createElement(Portal, null, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_BACKDROP_TAG, name: "Dialog.Backdrop" }))); } var DEFAULT_PANEL_TAG = "div"; function PanelFn(props, ref) { let internalId = useId(); let { id = `headlessui-dialog-panel-${internalId}`, ...theirProps } = props; let [{ dialogState }, state] = useDialogContext("Dialog.Panel"); let panelRef = useSyncRefs(ref, state.panelRef); let slot = (0, import_react31.useMemo)( () => ({ open: dialogState === 0 /* Open */ }), [dialogState] ); let handleClick = useEvent((event) => { event.stopPropagation(); }); let ourProps = { ref: panelRef, id, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_PANEL_TAG, name: "Dialog.Panel" }); } var DEFAULT_TITLE_TAG = "h2"; function TitleFn(props, ref) { let internalId = useId(); let { id = `headlessui-dialog-title-${internalId}`, ...theirProps } = props; let [{ dialogState, setTitleId }] = useDialogContext("Dialog.Title"); let titleRef = useSyncRefs(ref); (0, import_react31.useEffect)(() => { setTitleId(id); return () => setTitleId(null); }, [id, setTitleId]); let slot = (0, import_react31.useMemo)( () => ({ open: dialogState === 0 /* Open */ }), [dialogState] ); let ourProps = { ref: titleRef, id }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_TITLE_TAG, name: "Dialog.Title" }); } var DialogRoot = forwardRefWithAs(DialogFn); var Backdrop = forwardRefWithAs(BackdropFn); var Panel = forwardRefWithAs(PanelFn); var Overlay = forwardRefWithAs(OverlayFn); var Title = forwardRefWithAs(TitleFn); var Dialog = Object.assign(DialogRoot, { Backdrop, Panel, Overlay, Title, Description }); // src/components/disclosure/disclosure.tsx var import_react33 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/utils/start-transition.ts var import_react32 = __toESM(__webpack_require__(/*! react */ "react"), 1); var _a2; var startTransition = ( // Prefer React's `startTransition` if it's available. // @ts-expect-error - `startTransition` doesn't exist in React < 18. (_a2 = import_react32.default.startTransition) != null ? _a2 : function startTransition2(cb) { cb(); } ); // src/components/disclosure/disclosure.tsx var reducers3 = { [0 /* ToggleDisclosure */]: (state) => ({ ...state, disclosureState: match(state.disclosureState, { [0 /* Open */]: 1 /* Closed */, [1 /* Closed */]: 0 /* Open */ }) }), [1 /* CloseDisclosure */]: (state) => { if (state.disclosureState === 1 /* Closed */) return state; return { ...state, disclosureState: 1 /* Closed */ }; }, [4 /* LinkPanel */](state) { if (state.linkedPanel === true) return state; return { ...state, linkedPanel: true }; }, [5 /* UnlinkPanel */](state) { if (state.linkedPanel === false) return state; return { ...state, linkedPanel: false }; }, [2 /* SetButtonId */](state, action) { if (state.buttonId === action.buttonId) return state; return { ...state, buttonId: action.buttonId }; }, [3 /* SetPanelId */](state, action) { if (state.panelId === action.panelId) return state; return { ...state, panelId: action.panelId }; } }; var DisclosureContext = (0, import_react33.createContext)(null); DisclosureContext.displayName = "DisclosureContext"; function useDisclosureContext(component) { let context = (0, import_react33.useContext)(DisclosureContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useDisclosureContext); throw err; } return context; } var DisclosureAPIContext = (0, import_react33.createContext)(null); DisclosureAPIContext.displayName = "DisclosureAPIContext"; function useDisclosureAPIContext(component) { let context = (0, import_react33.useContext)(DisclosureAPIContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useDisclosureAPIContext); throw err; } return context; } var DisclosurePanelContext = (0, import_react33.createContext)(null); DisclosurePanelContext.displayName = "DisclosurePanelContext"; function useDisclosurePanelContext() { return (0, import_react33.useContext)(DisclosurePanelContext); } function stateReducer3(state, action) { return match(action.type, reducers3, state, action); } var DEFAULT_DISCLOSURE_TAG = import_react33.Fragment; function DisclosureFn(props, ref) { let { defaultOpen = false, ...theirProps } = props; let internalDisclosureRef = (0, import_react33.useRef)(null); let disclosureRef = useSyncRefs( ref, optionalRef( (ref2) => { internalDisclosureRef.current = ref2; }, props.as === void 0 || // @ts-expect-error The `as` prop _can_ be a Fragment props.as === import_react33.Fragment ) ); let panelRef = (0, import_react33.useRef)(null); let buttonRef = (0, import_react33.useRef)(null); let reducerBag = (0, import_react33.useReducer)(stateReducer3, { disclosureState: defaultOpen ? 0 /* Open */ : 1 /* Closed */, linkedPanel: false, buttonRef, panelRef, buttonId: null, panelId: null }); let [{ disclosureState, buttonId }, dispatch] = reducerBag; let close = useEvent((focusableElement) => { dispatch({ type: 1 /* CloseDisclosure */ }); let ownerDocument = getOwnerDocument(internalDisclosureRef); if (!ownerDocument) return; if (!buttonId) return; let restoreElement = (() => { if (!focusableElement) return ownerDocument.getElementById(buttonId); if (focusableElement instanceof HTMLElement) return focusableElement; if (focusableElement.current instanceof HTMLElement) return focusableElement.current; return ownerDocument.getElementById(buttonId); })(); restoreElement == null ? void 0 : restoreElement.focus(); }); let api = (0, import_react33.useMemo)(() => ({ close }), [close]); let slot = (0, import_react33.useMemo)( () => ({ open: disclosureState === 0 /* Open */, close }), [disclosureState, close] ); let ourProps = { ref: disclosureRef }; return /* @__PURE__ */ import_react33.default.createElement(DisclosureContext.Provider, { value: reducerBag }, /* @__PURE__ */ import_react33.default.createElement(DisclosureAPIContext.Provider, { value: api }, /* @__PURE__ */ import_react33.default.createElement( OpenClosedProvider, { value: match(disclosureState, { [0 /* Open */]: 1 /* Open */, [1 /* Closed */]: 2 /* Closed */ }) }, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_DISCLOSURE_TAG, name: "Disclosure" }) ))); } var DEFAULT_BUTTON_TAG2 = "button"; function ButtonFn2(props, ref) { let internalId = useId(); let { id = `headlessui-disclosure-button-${internalId}`, ...theirProps } = props; let [state, dispatch] = useDisclosureContext("Disclosure.Button"); let panelContext = useDisclosurePanelContext(); let isWithinPanel = panelContext === null ? false : panelContext === state.panelId; let internalButtonRef = (0, import_react33.useRef)(null); let buttonRef = useSyncRefs(internalButtonRef, ref, !isWithinPanel ? state.buttonRef : null); (0, import_react33.useEffect)(() => { if (isWithinPanel) return; dispatch({ type: 2 /* SetButtonId */, buttonId: id }); return () => { dispatch({ type: 2 /* SetButtonId */, buttonId: null }); }; }, [id, dispatch, isWithinPanel]); let handleKeyDown = useEvent((event) => { var _a3; if (isWithinPanel) { if (state.disclosureState === 1 /* Closed */) return; switch (event.key) { case " " /* Space */: case "Enter" /* Enter */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 0 /* ToggleDisclosure */ }); (_a3 = state.buttonRef.current) == null ? void 0 : _a3.focus(); break; } } else { switch (event.key) { case " " /* Space */: case "Enter" /* Enter */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 0 /* ToggleDisclosure */ }); break; } } }); let handleKeyUp = useEvent((event) => { switch (event.key) { case " " /* Space */: event.preventDefault(); break; } }); let handleClick = useEvent((event) => { var _a3; if (isDisabledReactIssue7711(event.currentTarget)) return; if (props.disabled) return; if (isWithinPanel) { dispatch({ type: 0 /* ToggleDisclosure */ }); (_a3 = state.buttonRef.current) == null ? void 0 : _a3.focus(); } else { dispatch({ type: 0 /* ToggleDisclosure */ }); } }); let slot = (0, import_react33.useMemo)( () => ({ open: state.disclosureState === 0 /* Open */ }), [state] ); let type = useResolveButtonType(props, internalButtonRef); let ourProps = isWithinPanel ? { ref: buttonRef, type, onKeyDown: handleKeyDown, onClick: handleClick } : { ref: buttonRef, id, type, "aria-expanded": props.disabled ? void 0 : state.disclosureState === 0 /* Open */, "aria-controls": state.linkedPanel ? state.panelId : void 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_BUTTON_TAG2, name: "Disclosure.Button" }); } var DEFAULT_PANEL_TAG2 = "div"; var PanelRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; function PanelFn2(props, ref) { let internalId = useId(); let { id = `headlessui-disclosure-panel-${internalId}`, ...theirProps } = props; let [state, dispatch] = useDisclosureContext("Disclosure.Panel"); let { close } = useDisclosureAPIContext("Disclosure.Panel"); let panelRef = useSyncRefs(ref, state.panelRef, (el) => { startTransition(() => dispatch({ type: el ? 4 /* LinkPanel */ : 5 /* UnlinkPanel */ })); }); (0, import_react33.useEffect)(() => { dispatch({ type: 3 /* SetPanelId */, panelId: id }); return () => { dispatch({ type: 3 /* SetPanelId */, panelId: null }); }; }, [id, dispatch]); let usesOpenClosedState = useOpenClosed(); let visible = (() => { if (usesOpenClosedState !== null) { return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } return state.disclosureState === 0 /* Open */; })(); let slot = (0, import_react33.useMemo)( () => ({ open: state.disclosureState === 0 /* Open */, close }), [state, close] ); let ourProps = { ref: panelRef, id }; return /* @__PURE__ */ import_react33.default.createElement(DisclosurePanelContext.Provider, { value: state.panelId }, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_PANEL_TAG2, features: PanelRenderFeatures, visible, name: "Disclosure.Panel" })); } var DisclosureRoot = forwardRefWithAs(DisclosureFn); var Button2 = forwardRefWithAs(ButtonFn2); var Panel2 = forwardRefWithAs(PanelFn2); var Disclosure = Object.assign(DisclosureRoot, { Button: Button2, Panel: Panel2 }); // src/components/listbox/listbox.tsx var import_react35 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/hooks/use-text-value.ts var import_react34 = __webpack_require__(/*! react */ "react"); // src/utils/get-text-value.ts var emojiRegex = /([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g; function getTextContents(element) { var _a3, _b; let currentInnerText = (_a3 = element.innerText) != null ? _a3 : ""; let copy = element.cloneNode(true); if (!(copy instanceof HTMLElement)) { return currentInnerText; } let dropped = false; for (let child of copy.querySelectorAll('[hidden],[aria-hidden],[role="img"]')) { child.remove(); dropped = true; } let value = dropped ? (_b = copy.innerText) != null ? _b : "" : currentInnerText; if (emojiRegex.test(value)) { value = value.replace(emojiRegex, ""); } return value; } function getTextValue(element) { let label = element.getAttribute("aria-label"); if (typeof label === "string") return label.trim(); let labelledby = element.getAttribute("aria-labelledby"); if (labelledby) { let labels = labelledby.split(" ").map((labelledby2) => { let labelEl = document.getElementById(labelledby2); if (labelEl) { let label2 = labelEl.getAttribute("aria-label"); if (typeof label2 === "string") return label2.trim(); return getTextContents(labelEl).trim(); } return null; }).filter(Boolean); if (labels.length > 0) return labels.join(", "); } return getTextContents(element).trim(); } // src/hooks/use-text-value.ts function useTextValue(element) { let cacheKey = (0, import_react34.useRef)(""); let cacheValue = (0, import_react34.useRef)(""); return useEvent(() => { let el = element.current; if (!el) return ""; let currentKey = el.innerText; if (cacheKey.current === currentKey) { return cacheValue.current; } let value = getTextValue(el).trim().toLowerCase(); cacheKey.current = currentKey; cacheValue.current = value; return value; }); } // src/components/listbox/listbox.tsx function adjustOrderedState2(state, adjustment = (i) => i) { let currentActiveOption = state.activeOptionIndex !== null ? state.options[state.activeOptionIndex] : null; let sortedOptions = sortByDomNode( adjustment(state.options.slice()), (option) => option.dataRef.current.domRef.current ); let adjustedActiveOptionIndex = currentActiveOption ? sortedOptions.indexOf(currentActiveOption) : null; if (adjustedActiveOptionIndex === -1) { adjustedActiveOptionIndex = null; } return { options: sortedOptions, activeOptionIndex: adjustedActiveOptionIndex }; } var reducers4 = { [1 /* CloseListbox */](state) { if (state.dataRef.current.disabled) return state; if (state.listboxState === 1 /* Closed */) return state; return { ...state, activeOptionIndex: null, listboxState: 1 /* Closed */ }; }, [0 /* OpenListbox */](state) { if (state.dataRef.current.disabled) return state; if (state.listboxState === 0 /* Open */) return state; let activeOptionIndex = state.activeOptionIndex; let { isSelected } = state.dataRef.current; let optionIdx = state.options.findIndex((option) => isSelected(option.dataRef.current.value)); if (optionIdx !== -1) { activeOptionIndex = optionIdx; } return { ...state, listboxState: 0 /* Open */, activeOptionIndex }; }, [2 /* GoToOption */](state, action) { var _a3; if (state.dataRef.current.disabled) return state; if (state.listboxState === 1 /* Closed */) return state; let adjustedState = adjustOrderedState2(state); let activeOptionIndex = calculateActiveIndex(action, { resolveItems: () => adjustedState.options, resolveActiveIndex: () => adjustedState.activeOptionIndex, resolveId: (option) => option.id, resolveDisabled: (option) => option.dataRef.current.disabled }); return { ...state, ...adjustedState, searchQuery: "", activeOptionIndex, activationTrigger: (_a3 = action.trigger) != null ? _a3 : 1 /* Other */ }; }, [3 /* Search */]: (state, action) => { if (state.dataRef.current.disabled) return state; if (state.listboxState === 1 /* Closed */) return state; let wasAlreadySearching = state.searchQuery !== ""; let offset = wasAlreadySearching ? 0 : 1; let searchQuery = state.searchQuery + action.value.toLowerCase(); let reOrderedOptions = state.activeOptionIndex !== null ? state.options.slice(state.activeOptionIndex + offset).concat(state.options.slice(0, state.activeOptionIndex + offset)) : state.options; let matchingOption = reOrderedOptions.find( (option) => { var _a3; return !option.dataRef.current.disabled && ((_a3 = option.dataRef.current.textValue) == null ? void 0 : _a3.startsWith(searchQuery)); } ); let matchIdx = matchingOption ? state.options.indexOf(matchingOption) : -1; if (matchIdx === -1 || matchIdx === state.activeOptionIndex) return { ...state, searchQuery }; return { ...state, searchQuery, activeOptionIndex: matchIdx, activationTrigger: 1 /* Other */ }; }, [4 /* ClearSearch */](state) { if (state.dataRef.current.disabled) return state; if (state.listboxState === 1 /* Closed */) return state; if (state.searchQuery === "") return state; return { ...state, searchQuery: "" }; }, [5 /* RegisterOption */]: (state, action) => { let option = { id: action.id, dataRef: action.dataRef }; let adjustedState = adjustOrderedState2(state, (options) => [...options, option]); if (state.activeOptionIndex === null) { if (state.dataRef.current.isSelected(action.dataRef.current.value)) { adjustedState.activeOptionIndex = adjustedState.options.indexOf(option); } } return { ...state, ...adjustedState }; }, [6 /* UnregisterOption */]: (state, action) => { let adjustedState = adjustOrderedState2(state, (options) => { let idx = options.findIndex((a) => a.id === action.id); if (idx !== -1) options.splice(idx, 1); return options; }); return { ...state, ...adjustedState, activationTrigger: 1 /* Other */ }; }, [7 /* RegisterLabel */]: (state, action) => { return { ...state, labelId: action.id }; } }; var ListboxActionsContext = (0, import_react35.createContext)(null); ListboxActionsContext.displayName = "ListboxActionsContext"; function useActions2(component) { let context = (0, import_react35.useContext)(ListboxActionsContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useActions2); throw err; } return context; } var ListboxDataContext = (0, import_react35.createContext)(null); ListboxDataContext.displayName = "ListboxDataContext"; function useData2(component) { let context = (0, import_react35.useContext)(ListboxDataContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useData2); throw err; } return context; } function stateReducer4(state, action) { return match(action.type, reducers4, state, action); } var DEFAULT_LISTBOX_TAG = import_react35.Fragment; function ListboxFn(props, ref) { let { value: controlledValue, defaultValue, form: formName, name, onChange: controlledOnChange, by = (a, z) => a === z, disabled = false, horizontal = false, multiple = false, ...theirProps } = props; const orientation = horizontal ? "horizontal" : "vertical"; let listboxRef = useSyncRefs(ref); let [value = multiple ? [] : void 0, theirOnChange] = useControllable( controlledValue, controlledOnChange, defaultValue ); let [state, dispatch] = (0, import_react35.useReducer)(stateReducer4, { dataRef: (0, import_react35.createRef)(), listboxState: 1 /* Closed */, options: [], searchQuery: "", labelId: null, activeOptionIndex: null, activationTrigger: 1 /* Other */ }); let optionsPropsRef = (0, import_react35.useRef)({ static: false, hold: false }); let labelRef = (0, import_react35.useRef)(null); let buttonRef = (0, import_react35.useRef)(null); let optionsRef = (0, import_react35.useRef)(null); let compare = useEvent( typeof by === "string" ? (a, z) => { let property = by; return (a == null ? void 0 : a[property]) === (z == null ? void 0 : z[property]); } : by ); let isSelected = (0, import_react35.useCallback)( (compareValue) => match(data.mode, { [1 /* Multi */]: () => value.some((option) => compare(option, compareValue)), [0 /* Single */]: () => compare(value, compareValue) }), [value] ); let data = (0, import_react35.useMemo)( () => ({ ...state, value, disabled, mode: multiple ? 1 /* Multi */ : 0 /* Single */, orientation, compare, isSelected, optionsPropsRef, labelRef, buttonRef, optionsRef }), [value, disabled, multiple, state] ); useIsoMorphicEffect(() => { state.dataRef.current = data; }, [data]); useOutsideClick( [data.buttonRef, data.optionsRef], (event, target) => { var _a3; dispatch({ type: 1 /* CloseListbox */ }); if (!isFocusableElement(target, 1 /* Loose */)) { event.preventDefault(); (_a3 = data.buttonRef.current) == null ? void 0 : _a3.focus(); } }, data.listboxState === 0 /* Open */ ); let slot = (0, import_react35.useMemo)( () => ({ open: data.listboxState === 0 /* Open */, disabled, value }), [data, disabled, value] ); let selectOption = useEvent((id) => { let option = data.options.find((item) => item.id === id); if (!option) return; onChange(option.dataRef.current.value); }); let selectActiveOption = useEvent(() => { if (data.activeOptionIndex !== null) { let { dataRef, id } = data.options[data.activeOptionIndex]; onChange(dataRef.current.value); dispatch({ type: 2 /* GoToOption */, focus: 4 /* Specific */, id }); } }); let openListbox = useEvent(() => dispatch({ type: 0 /* OpenListbox */ })); let closeListbox = useEvent(() => dispatch({ type: 1 /* CloseListbox */ })); let goToOption = useEvent((focus, id, trigger) => { if (focus === 4 /* Specific */) { return dispatch({ type: 2 /* GoToOption */, focus: 4 /* Specific */, id, trigger }); } return dispatch({ type: 2 /* GoToOption */, focus, trigger }); }); let registerOption = useEvent((id, dataRef) => { dispatch({ type: 5 /* RegisterOption */, id, dataRef }); return () => dispatch({ type: 6 /* UnregisterOption */, id }); }); let registerLabel = useEvent((id) => { dispatch({ type: 7 /* RegisterLabel */, id }); return () => dispatch({ type: 7 /* RegisterLabel */, id: null }); }); let onChange = useEvent((value2) => { return match(data.mode, { [0 /* Single */]() { return theirOnChange == null ? void 0 : theirOnChange(value2); }, [1 /* Multi */]() { let copy = data.value.slice(); let idx = copy.findIndex((item) => compare(item, value2)); if (idx === -1) { copy.push(value2); } else { copy.splice(idx, 1); } return theirOnChange == null ? void 0 : theirOnChange(copy); } }); }); let search = useEvent((value2) => dispatch({ type: 3 /* Search */, value: value2 })); let clearSearch = useEvent(() => dispatch({ type: 4 /* ClearSearch */ })); let actions = (0, import_react35.useMemo)( () => ({ onChange, registerOption, registerLabel, goToOption, closeListbox, openListbox, selectActiveOption, selectOption, search, clearSearch }), [] ); let ourProps = { ref: listboxRef }; let form = (0, import_react35.useRef)(null); let d = useDisposables(); (0, import_react35.useEffect)(() => { if (!form.current) return; if (defaultValue === void 0) return; d.addEventListener(form.current, "reset", () => { onChange(defaultValue); }); }, [ form, onChange /* Explicitly ignoring `defaultValue` */ ]); return /* @__PURE__ */ import_react35.default.createElement(ListboxActionsContext.Provider, { value: actions }, /* @__PURE__ */ import_react35.default.createElement(ListboxDataContext.Provider, { value: data }, /* @__PURE__ */ import_react35.default.createElement( OpenClosedProvider, { value: match(data.listboxState, { [0 /* Open */]: 1 /* Open */, [1 /* Closed */]: 2 /* Closed */ }) }, name != null && value != null && objectToFormEntries({ [name]: value }).map(([name2, value2], idx) => /* @__PURE__ */ import_react35.default.createElement( Hidden, { features: 4 /* Hidden */, ref: idx === 0 ? (element) => { var _a3; form.current = (_a3 = element == null ? void 0 : element.closest("form")) != null ? _a3 : null; } : void 0, ...compact({ key: name2, as: "input", type: "hidden", hidden: true, readOnly: true, form: formName, name: name2, value: value2 }) } )), render({ ourProps, theirProps, slot, defaultTag: DEFAULT_LISTBOX_TAG, name: "Listbox" }) ))); } var DEFAULT_BUTTON_TAG3 = "button"; function ButtonFn3(props, ref) { var _a3; let internalId = useId(); let { id = `headlessui-listbox-button-${internalId}`, ...theirProps } = props; let data = useData2("Listbox.Button"); let actions = useActions2("Listbox.Button"); let buttonRef = useSyncRefs(data.buttonRef, ref); let d = useDisposables(); let handleKeyDown = useEvent((event) => { switch (event.key) { case " " /* Space */: case "Enter" /* Enter */: case "ArrowDown" /* ArrowDown */: event.preventDefault(); actions.openListbox(); d.nextFrame(() => { if (!data.value) actions.goToOption(0 /* First */); }); break; case "ArrowUp" /* ArrowUp */: event.preventDefault(); actions.openListbox(); d.nextFrame(() => { if (!data.value) actions.goToOption(3 /* Last */); }); break; } }); let handleKeyUp = useEvent((event) => { switch (event.key) { case " " /* Space */: event.preventDefault(); break; } }); let handleClick = useEvent((event) => { if (isDisabledReactIssue7711(event.currentTarget)) return event.preventDefault(); if (data.listboxState === 0 /* Open */) { actions.closeListbox(); d.nextFrame(() => { var _a4; return (_a4 = data.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); } else { event.preventDefault(); actions.openListbox(); } }); let labelledby = useComputed(() => { if (!data.labelId) return void 0; return [data.labelId, id].join(" "); }, [data.labelId, id]); let slot = (0, import_react35.useMemo)( () => ({ open: data.listboxState === 0 /* Open */, disabled: data.disabled, value: data.value }), [data] ); let ourProps = { ref: buttonRef, id, type: useResolveButtonType(props, data.buttonRef), "aria-haspopup": "listbox", "aria-controls": (_a3 = data.optionsRef.current) == null ? void 0 : _a3.id, "aria-expanded": data.disabled ? void 0 : data.listboxState === 0 /* Open */, "aria-labelledby": labelledby, disabled: data.disabled, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_BUTTON_TAG3, name: "Listbox.Button" }); } var DEFAULT_LABEL_TAG2 = "label"; function LabelFn2(props, ref) { let internalId = useId(); let { id = `headlessui-listbox-label-${internalId}`, ...theirProps } = props; let data = useData2("Listbox.Label"); let actions = useActions2("Listbox.Label"); let labelRef = useSyncRefs(data.labelRef, ref); useIsoMorphicEffect(() => actions.registerLabel(id), [id]); let handleClick = useEvent(() => { var _a3; return (_a3 = data.buttonRef.current) == null ? void 0 : _a3.focus({ preventScroll: true }); }); let slot = (0, import_react35.useMemo)( () => ({ open: data.listboxState === 0 /* Open */, disabled: data.disabled }), [data] ); let ourProps = { ref: labelRef, id, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_LABEL_TAG2, name: "Listbox.Label" }); } var DEFAULT_OPTIONS_TAG2 = "ul"; var OptionsRenderFeatures2 = 1 /* RenderStrategy */ | 2 /* Static */; function OptionsFn2(props, ref) { var _a3; let internalId = useId(); let { id = `headlessui-listbox-options-${internalId}`, ...theirProps } = props; let data = useData2("Listbox.Options"); let actions = useActions2("Listbox.Options"); let optionsRef = useSyncRefs(data.optionsRef, ref); let d = useDisposables(); let searchDisposables = useDisposables(); let usesOpenClosedState = useOpenClosed(); let visible = (() => { if (usesOpenClosedState !== null) { return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } return data.listboxState === 0 /* Open */; })(); (0, import_react35.useEffect)(() => { var _a4; let container = data.optionsRef.current; if (!container) return; if (data.listboxState !== 0 /* Open */) return; if (container === ((_a4 = getOwnerDocument(container)) == null ? void 0 : _a4.activeElement)) return; container.focus({ preventScroll: true }); }, [data.listboxState, data.optionsRef]); let handleKeyDown = useEvent((event) => { searchDisposables.dispose(); switch (event.key) { case " " /* Space */: if (data.searchQuery !== "") { event.preventDefault(); event.stopPropagation(); return actions.search(event.key); } case "Enter" /* Enter */: event.preventDefault(); event.stopPropagation(); if (data.activeOptionIndex !== null) { let { dataRef } = data.options[data.activeOptionIndex]; actions.onChange(dataRef.current.value); } if (data.mode === 0 /* Single */) { actions.closeListbox(); disposables().nextFrame(() => { var _a4; return (_a4 = data.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); } break; case match(data.orientation, { vertical: "ArrowDown" /* ArrowDown */, horizontal: "ArrowRight" /* ArrowRight */ }): event.preventDefault(); event.stopPropagation(); return actions.goToOption(2 /* Next */); case match(data.orientation, { vertical: "ArrowUp" /* ArrowUp */, horizontal: "ArrowLeft" /* ArrowLeft */ }): event.preventDefault(); event.stopPropagation(); return actions.goToOption(1 /* Previous */); case "Home" /* Home */: case "PageUp" /* PageUp */: event.preventDefault(); event.stopPropagation(); return actions.goToOption(0 /* First */); case "End" /* End */: case "PageDown" /* PageDown */: event.preventDefault(); event.stopPropagation(); return actions.goToOption(3 /* Last */); case "Escape" /* Escape */: event.preventDefault(); event.stopPropagation(); actions.closeListbox(); return d.nextFrame(() => { var _a4; return (_a4 = data.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); case "Tab" /* Tab */: event.preventDefault(); event.stopPropagation(); break; default: if (event.key.length === 1) { actions.search(event.key); searchDisposables.setTimeout(() => actions.clearSearch(), 350); } break; } }); let labelledby = useComputed( () => { var _a4, _b, _c; return (_c = (_a4 = data.labelRef.current) == null ? void 0 : _a4.id) != null ? _c : (_b = data.buttonRef.current) == null ? void 0 : _b.id; }, [data.labelRef.current, data.buttonRef.current] ); let slot = (0, import_react35.useMemo)( () => ({ open: data.listboxState === 0 /* Open */ }), [data] ); let ourProps = { "aria-activedescendant": data.activeOptionIndex === null ? void 0 : (_a3 = data.options[data.activeOptionIndex]) == null ? void 0 : _a3.id, "aria-multiselectable": data.mode === 1 /* Multi */ ? true : void 0, "aria-labelledby": labelledby, "aria-orientation": data.orientation, id, onKeyDown: handleKeyDown, role: "listbox", tabIndex: 0, ref: optionsRef }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_OPTIONS_TAG2, features: OptionsRenderFeatures2, visible, name: "Listbox.Options" }); } var DEFAULT_OPTION_TAG2 = "li"; function OptionFn2(props, ref) { let internalId = useId(); let { id = `headlessui-listbox-option-${internalId}`, disabled = false, value, ...theirProps } = props; let data = useData2("Listbox.Option"); let actions = useActions2("Listbox.Option"); let active = data.activeOptionIndex !== null ? data.options[data.activeOptionIndex].id === id : false; let selected = data.isSelected(value); let internalOptionRef = (0, import_react35.useRef)(null); let getTextValue2 = useTextValue(internalOptionRef); let bag = useLatestValue({ disabled, value, domRef: internalOptionRef, get textValue() { return getTextValue2(); } }); let optionRef = useSyncRefs(ref, internalOptionRef); useIsoMorphicEffect(() => { if (data.listboxState !== 0 /* Open */) return; if (!active) return; if (data.activationTrigger === 0 /* Pointer */) return; let d = disposables(); d.requestAnimationFrame(() => { var _a3, _b; (_b = (_a3 = internalOptionRef.current) == null ? void 0 : _a3.scrollIntoView) == null ? void 0 : _b.call(_a3, { block: "nearest" }); }); return d.dispose; }, [ internalOptionRef, active, data.listboxState, data.activationTrigger, /* We also want to trigger this when the position of the active item changes so that we can re-trigger the scrollIntoView */ data.activeOptionIndex ]); useIsoMorphicEffect(() => actions.registerOption(id, bag), [bag, id]); let handleClick = useEvent((event) => { if (disabled) return event.preventDefault(); actions.onChange(value); if (data.mode === 0 /* Single */) { actions.closeListbox(); disposables().nextFrame(() => { var _a3; return (_a3 = data.buttonRef.current) == null ? void 0 : _a3.focus({ preventScroll: true }); }); } }); let handleFocus = useEvent(() => { if (disabled) return actions.goToOption(5 /* Nothing */); actions.goToOption(4 /* Specific */, id); }); let pointer = useTrackedPointer(); let handleEnter = useEvent((evt) => pointer.update(evt)); let handleMove = useEvent((evt) => { if (!pointer.wasMoved(evt)) return; if (disabled) return; if (active) return; actions.goToOption(4 /* Specific */, id, 0 /* Pointer */); }); let handleLeave = useEvent((evt) => { if (!pointer.wasMoved(evt)) return; if (disabled) return; if (!active) return; actions.goToOption(5 /* Nothing */); }); let slot = (0, import_react35.useMemo)( () => ({ active, selected, disabled }), [active, selected, disabled] ); let ourProps = { id, ref: optionRef, role: "option", tabIndex: disabled === true ? void 0 : -1, "aria-disabled": disabled === true ? true : void 0, // According to the WAI-ARIA best practices, we should use aria-checked for // multi-select,but Voice-Over disagrees. So we use aria-checked instead for // both single and multi-select. "aria-selected": selected, disabled: void 0, // Never forward the `disabled` prop onClick: handleClick, onFocus: handleFocus, onPointerEnter: handleEnter, onMouseEnter: handleEnter, onPointerMove: handleMove, onMouseMove: handleMove, onPointerLeave: handleLeave, onMouseLeave: handleLeave }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_OPTION_TAG2, name: "Listbox.Option" }); } var ListboxRoot = forwardRefWithAs(ListboxFn); var Button3 = forwardRefWithAs(ButtonFn3); var Label2 = forwardRefWithAs(LabelFn2); var Options2 = forwardRefWithAs(OptionsFn2); var Option2 = forwardRefWithAs(OptionFn2); var Listbox = Object.assign(ListboxRoot, { Button: Button3, Label: Label2, Options: Options2, Option: Option2 }); // src/components/menu/menu.tsx var import_react36 = __toESM(__webpack_require__(/*! react */ "react"), 1); function adjustOrderedState3(state, adjustment = (i) => i) { let currentActiveItem = state.activeItemIndex !== null ? state.items[state.activeItemIndex] : null; let sortedItems = sortByDomNode( adjustment(state.items.slice()), (item) => item.dataRef.current.domRef.current ); let adjustedActiveItemIndex = currentActiveItem ? sortedItems.indexOf(currentActiveItem) : null; if (adjustedActiveItemIndex === -1) { adjustedActiveItemIndex = null; } return { items: sortedItems, activeItemIndex: adjustedActiveItemIndex }; } var reducers5 = { [1 /* CloseMenu */](state) { if (state.menuState === 1 /* Closed */) return state; return { ...state, activeItemIndex: null, menuState: 1 /* Closed */ }; }, [0 /* OpenMenu */](state) { if (state.menuState === 0 /* Open */) return state; return { ...state, /* We can turn off demo mode once we re-open the `Menu` */ __demoMode: false, menuState: 0 /* Open */ }; }, [2 /* GoToItem */]: (state, action) => { var _a3; let adjustedState = adjustOrderedState3(state); let activeItemIndex = calculateActiveIndex(action, { resolveItems: () => adjustedState.items, resolveActiveIndex: () => adjustedState.activeItemIndex, resolveId: (item) => item.id, resolveDisabled: (item) => item.dataRef.current.disabled }); return { ...state, ...adjustedState, searchQuery: "", activeItemIndex, activationTrigger: (_a3 = action.trigger) != null ? _a3 : 1 /* Other */ }; }, [3 /* Search */]: (state, action) => { let wasAlreadySearching = state.searchQuery !== ""; let offset = wasAlreadySearching ? 0 : 1; let searchQuery = state.searchQuery + action.value.toLowerCase(); let reOrderedItems = state.activeItemIndex !== null ? state.items.slice(state.activeItemIndex + offset).concat(state.items.slice(0, state.activeItemIndex + offset)) : state.items; let matchingItem = reOrderedItems.find( (item) => { var _a3; return ((_a3 = item.dataRef.current.textValue) == null ? void 0 : _a3.startsWith(searchQuery)) && !item.dataRef.current.disabled; } ); let matchIdx = matchingItem ? state.items.indexOf(matchingItem) : -1; if (matchIdx === -1 || matchIdx === state.activeItemIndex) return { ...state, searchQuery }; return { ...state, searchQuery, activeItemIndex: matchIdx, activationTrigger: 1 /* Other */ }; }, [4 /* ClearSearch */](state) { if (state.searchQuery === "") return state; return { ...state, searchQuery: "", searchActiveItemIndex: null }; }, [5 /* RegisterItem */]: (state, action) => { let adjustedState = adjustOrderedState3(state, (items) => [ ...items, { id: action.id, dataRef: action.dataRef } ]); return { ...state, ...adjustedState }; }, [6 /* UnregisterItem */]: (state, action) => { let adjustedState = adjustOrderedState3(state, (items) => { let idx = items.findIndex((a) => a.id === action.id); if (idx !== -1) items.splice(idx, 1); return items; }); return { ...state, ...adjustedState, activationTrigger: 1 /* Other */ }; } }; var MenuContext = (0, import_react36.createContext)(null); MenuContext.displayName = "MenuContext"; function useMenuContext(component) { let context = (0, import_react36.useContext)(MenuContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, useMenuContext); throw err; } return context; } function stateReducer5(state, action) { return match(action.type, reducers5, state, action); } var DEFAULT_MENU_TAG = import_react36.Fragment; function MenuFn(props, ref) { let { __demoMode = false, ...theirProps } = props; let reducerBag = (0, import_react36.useReducer)(stateReducer5, { __demoMode, menuState: __demoMode ? 0 /* Open */ : 1 /* Closed */, buttonRef: (0, import_react36.createRef)(), itemsRef: (0, import_react36.createRef)(), items: [], searchQuery: "", activeItemIndex: null, activationTrigger: 1 /* Other */ }); let [{ menuState, itemsRef, buttonRef }, dispatch] = reducerBag; let menuRef = useSyncRefs(ref); useOutsideClick( [buttonRef, itemsRef], (event, target) => { var _a3; dispatch({ type: 1 /* CloseMenu */ }); if (!isFocusableElement(target, 1 /* Loose */)) { event.preventDefault(); (_a3 = buttonRef.current) == null ? void 0 : _a3.focus(); } }, menuState === 0 /* Open */ ); let close = useEvent(() => { dispatch({ type: 1 /* CloseMenu */ }); }); let slot = (0, import_react36.useMemo)( () => ({ open: menuState === 0 /* Open */, close }), [menuState, close] ); let ourProps = { ref: menuRef }; return /* @__PURE__ */ import_react36.default.createElement(MenuContext.Provider, { value: reducerBag }, /* @__PURE__ */ import_react36.default.createElement( OpenClosedProvider, { value: match(menuState, { [0 /* Open */]: 1 /* Open */, [1 /* Closed */]: 2 /* Closed */ }) }, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_MENU_TAG, name: "Menu" }) )); } var DEFAULT_BUTTON_TAG4 = "button"; function ButtonFn4(props, ref) { var _a3; let internalId = useId(); let { id = `headlessui-menu-button-${internalId}`, ...theirProps } = props; let [state, dispatch] = useMenuContext("Menu.Button"); let buttonRef = useSyncRefs(state.buttonRef, ref); let d = useDisposables(); let handleKeyDown = useEvent((event) => { switch (event.key) { case " " /* Space */: case "Enter" /* Enter */: case "ArrowDown" /* ArrowDown */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 0 /* OpenMenu */ }); d.nextFrame(() => dispatch({ type: 2 /* GoToItem */, focus: 0 /* First */ })); break; case "ArrowUp" /* ArrowUp */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 0 /* OpenMenu */ }); d.nextFrame(() => dispatch({ type: 2 /* GoToItem */, focus: 3 /* Last */ })); break; } }); let handleKeyUp = useEvent((event) => { switch (event.key) { case " " /* Space */: event.preventDefault(); break; } }); let handleClick = useEvent((event) => { if (isDisabledReactIssue7711(event.currentTarget)) return event.preventDefault(); if (props.disabled) return; if (state.menuState === 0 /* Open */) { dispatch({ type: 1 /* CloseMenu */ }); d.nextFrame(() => { var _a4; return (_a4 = state.buttonRef.current) == null ? void 0 : _a4.focus({ preventScroll: true }); }); } else { event.preventDefault(); dispatch({ type: 0 /* OpenMenu */ }); } }); let slot = (0, import_react36.useMemo)( () => ({ open: state.menuState === 0 /* Open */ }), [state] ); let ourProps = { ref: buttonRef, id, type: useResolveButtonType(props, state.buttonRef), "aria-haspopup": "menu", "aria-controls": (_a3 = state.itemsRef.current) == null ? void 0 : _a3.id, "aria-expanded": props.disabled ? void 0 : state.menuState === 0 /* Open */, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_BUTTON_TAG4, name: "Menu.Button" }); } var DEFAULT_ITEMS_TAG = "div"; var ItemsRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; function ItemsFn(props, ref) { var _a3, _b; let internalId = useId(); let { id = `headlessui-menu-items-${internalId}`, ...theirProps } = props; let [state, dispatch] = useMenuContext("Menu.Items"); let itemsRef = useSyncRefs(state.itemsRef, ref); let ownerDocument = useOwnerDocument(state.itemsRef); let searchDisposables = useDisposables(); let usesOpenClosedState = useOpenClosed(); let visible = (() => { if (usesOpenClosedState !== null) { return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } return state.menuState === 0 /* Open */; })(); (0, import_react36.useEffect)(() => { let container = state.itemsRef.current; if (!container) return; if (state.menuState !== 0 /* Open */) return; if (container === (ownerDocument == null ? void 0 : ownerDocument.activeElement)) return; container.focus({ preventScroll: true }); }, [state.menuState, state.itemsRef, ownerDocument]); useTreeWalker({ container: state.itemsRef.current, enabled: state.menuState === 0 /* Open */, accept(node) { if (node.getAttribute("role") === "menuitem") return NodeFilter.FILTER_REJECT; if (node.hasAttribute("role")) return NodeFilter.FILTER_SKIP; return NodeFilter.FILTER_ACCEPT; }, walk(node) { node.setAttribute("role", "none"); } }); let handleKeyDown = useEvent((event) => { var _a4, _b2; searchDisposables.dispose(); switch (event.key) { case " " /* Space */: if (state.searchQuery !== "") { event.preventDefault(); event.stopPropagation(); return dispatch({ type: 3 /* Search */, value: event.key }); } case "Enter" /* Enter */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 1 /* CloseMenu */ }); if (state.activeItemIndex !== null) { let { dataRef } = state.items[state.activeItemIndex]; (_b2 = (_a4 = dataRef.current) == null ? void 0 : _a4.domRef.current) == null ? void 0 : _b2.click(); } restoreFocusIfNecessary(state.buttonRef.current); break; case "ArrowDown" /* ArrowDown */: event.preventDefault(); event.stopPropagation(); return dispatch({ type: 2 /* GoToItem */, focus: 2 /* Next */ }); case "ArrowUp" /* ArrowUp */: event.preventDefault(); event.stopPropagation(); return dispatch({ type: 2 /* GoToItem */, focus: 1 /* Previous */ }); case "Home" /* Home */: case "PageUp" /* PageUp */: event.preventDefault(); event.stopPropagation(); return dispatch({ type: 2 /* GoToItem */, focus: 0 /* First */ }); case "End" /* End */: case "PageDown" /* PageDown */: event.preventDefault(); event.stopPropagation(); return dispatch({ type: 2 /* GoToItem */, focus: 3 /* Last */ }); case "Escape" /* Escape */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 1 /* CloseMenu */ }); disposables().nextFrame(() => { var _a5; return (_a5 = state.buttonRef.current) == null ? void 0 : _a5.focus({ preventScroll: true }); }); break; case "Tab" /* Tab */: event.preventDefault(); event.stopPropagation(); dispatch({ type: 1 /* CloseMenu */ }); disposables().nextFrame(() => { focusFrom( state.buttonRef.current, event.shiftKey ? 2 /* Previous */ : 4 /* Next */ ); }); break; default: if (event.key.length === 1) { dispatch({ type: 3 /* Search */, value: event.key }); searchDisposables.setTimeout(() => dispatch({ type: 4 /* ClearSearch */ }), 350); } break; } }); let handleKeyUp = useEvent((event) => { switch (event.key) { case " " /* Space */: event.preventDefault(); break; } }); let slot = (0, import_react36.useMemo)( () => ({ open: state.menuState === 0 /* Open */ }), [state] ); let ourProps = { "aria-activedescendant": state.activeItemIndex === null ? void 0 : (_a3 = state.items[state.activeItemIndex]) == null ? void 0 : _a3.id, "aria-labelledby": (_b = state.buttonRef.current) == null ? void 0 : _b.id, id, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, role: "menu", tabIndex: 0, ref: itemsRef }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_ITEMS_TAG, features: ItemsRenderFeatures, visible, name: "Menu.Items" }); } var DEFAULT_ITEM_TAG = import_react36.Fragment; function ItemFn(props, ref) { let internalId = useId(); let { id = `headlessui-menu-item-${internalId}`, disabled = false, ...theirProps } = props; let [state, dispatch] = useMenuContext("Menu.Item"); let active = state.activeItemIndex !== null ? state.items[state.activeItemIndex].id === id : false; let internalItemRef = (0, import_react36.useRef)(null); let itemRef = useSyncRefs(ref, internalItemRef); useIsoMorphicEffect(() => { if (state.__demoMode) return; if (state.menuState !== 0 /* Open */) return; if (!active) return; if (state.activationTrigger === 0 /* Pointer */) return; let d = disposables(); d.requestAnimationFrame(() => { var _a3, _b; (_b = (_a3 = internalItemRef.current) == null ? void 0 : _a3.scrollIntoView) == null ? void 0 : _b.call(_a3, { block: "nearest" }); }); return d.dispose; }, [ state.__demoMode, internalItemRef, active, state.menuState, state.activationTrigger, /* We also want to trigger this when the position of the active item changes so that we can re-trigger the scrollIntoView */ state.activeItemIndex ]); let getTextValue2 = useTextValue(internalItemRef); let bag = (0, import_react36.useRef)({ disabled, domRef: internalItemRef, get textValue() { return getTextValue2(); } }); useIsoMorphicEffect(() => { bag.current.disabled = disabled; }, [bag, disabled]); useIsoMorphicEffect(() => { dispatch({ type: 5 /* RegisterItem */, id, dataRef: bag }); return () => dispatch({ type: 6 /* UnregisterItem */, id }); }, [bag, id]); let close = useEvent(() => { dispatch({ type: 1 /* CloseMenu */ }); }); let handleClick = useEvent((event) => { if (disabled) return event.preventDefault(); dispatch({ type: 1 /* CloseMenu */ }); restoreFocusIfNecessary(state.buttonRef.current); }); let handleFocus = useEvent(() => { if (disabled) return dispatch({ type: 2 /* GoToItem */, focus: 5 /* Nothing */ }); dispatch({ type: 2 /* GoToItem */, focus: 4 /* Specific */, id }); }); let pointer = useTrackedPointer(); let handleEnter = useEvent((evt) => pointer.update(evt)); let handleMove = useEvent((evt) => { if (!pointer.wasMoved(evt)) return; if (disabled) return; if (active) return; dispatch({ type: 2 /* GoToItem */, focus: 4 /* Specific */, id, trigger: 0 /* Pointer */ }); }); let handleLeave = useEvent((evt) => { if (!pointer.wasMoved(evt)) return; if (disabled) return; if (!active) return; dispatch({ type: 2 /* GoToItem */, focus: 5 /* Nothing */ }); }); let slot = (0, import_react36.useMemo)( () => ({ active, disabled, close }), [active, disabled, close] ); let ourProps = { id, ref: itemRef, role: "menuitem", tabIndex: disabled === true ? void 0 : -1, "aria-disabled": disabled === true ? true : void 0, disabled: void 0, // Never forward the `disabled` prop onClick: handleClick, onFocus: handleFocus, onPointerEnter: handleEnter, onMouseEnter: handleEnter, onPointerMove: handleMove, onMouseMove: handleMove, onPointerLeave: handleLeave, onMouseLeave: handleLeave }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_ITEM_TAG, name: "Menu.Item" }); } var MenuRoot = forwardRefWithAs(MenuFn); var Button4 = forwardRefWithAs(ButtonFn4); var Items = forwardRefWithAs(ItemsFn); var Item = forwardRefWithAs(ItemFn); var Menu = Object.assign(MenuRoot, { Button: Button4, Items, Item }); // src/components/popover/popover.tsx var import_react37 = __toESM(__webpack_require__(/*! react */ "react"), 1); var reducers6 = { [0 /* TogglePopover */]: (state) => { let nextState = { ...state, popoverState: match(state.popoverState, { [0 /* Open */]: 1 /* Closed */, [1 /* Closed */]: 0 /* Open */ }) }; if (nextState.popoverState === 0 /* Open */) { nextState.__demoMode = false; } return nextState; }, [1 /* ClosePopover */](state) { if (state.popoverState === 1 /* Closed */) return state; return { ...state, popoverState: 1 /* Closed */ }; }, [2 /* SetButton */](state, action) { if (state.button === action.button) return state; return { ...state, button: action.button }; }, [3 /* SetButtonId */](state, action) { if (state.buttonId === action.buttonId) return state; return { ...state, buttonId: action.buttonId }; }, [4 /* SetPanel */](state, action) { if (state.panel === action.panel) return state; return { ...state, panel: action.panel }; }, [5 /* SetPanelId */](state, action) { if (state.panelId === action.panelId) return state; return { ...state, panelId: action.panelId }; } }; var PopoverContext = (0, import_react37.createContext)(null); PopoverContext.displayName = "PopoverContext"; function usePopoverContext(component) { let context = (0, import_react37.useContext)(PopoverContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, usePopoverContext); throw err; } return context; } var PopoverAPIContext = (0, import_react37.createContext)(null); PopoverAPIContext.displayName = "PopoverAPIContext"; function usePopoverAPIContext(component) { let context = (0, import_react37.useContext)(PopoverAPIContext); if (context === null) { let err = new Error(`<${component} /> is missing a parent component.`); if (Error.captureStackTrace) Error.captureStackTrace(err, usePopoverAPIContext); throw err; } return context; } var PopoverGroupContext = (0, import_react37.createContext)(null); PopoverGroupContext.displayName = "PopoverGroupContext"; function usePopoverGroupContext() { return (0, import_react37.useContext)(PopoverGroupContext); } var PopoverPanelContext = (0, import_react37.createContext)(null); PopoverPanelContext.displayName = "PopoverPanelContext"; function usePopoverPanelContext() { return (0, import_react37.useContext)(PopoverPanelContext); } function stateReducer6(state, action) { return match(action.type, reducers6, state, action); } var DEFAULT_POPOVER_TAG = "div"; function PopoverFn(props, ref) { var _a3; let { __demoMode = false, ...theirProps } = props; let internalPopoverRef = (0, import_react37.useRef)(null); let popoverRef = useSyncRefs( ref, optionalRef((ref2) => { internalPopoverRef.current = ref2; }) ); let buttons = (0, import_react37.useRef)([]); let reducerBag = (0, import_react37.useReducer)(stateReducer6, { __demoMode, popoverState: __demoMode ? 0 /* Open */ : 1 /* Closed */, buttons, button: null, buttonId: null, panel: null, panelId: null, beforePanelSentinel: (0, import_react37.createRef)(), afterPanelSentinel: (0, import_react37.createRef)() }); let [ { popoverState, button, buttonId, panel, panelId, beforePanelSentinel, afterPanelSentinel }, dispatch ] = reducerBag; let ownerDocument = useOwnerDocument((_a3 = internalPopoverRef.current) != null ? _a3 : button); let isPortalled = (0, import_react37.useMemo)(() => { if (!button) return false; if (!panel) return false; for (let root2 of document.querySelectorAll("body > *")) { if (Number(root2 == null ? void 0 : root2.contains(button)) ^ Number(root2 == null ? void 0 : root2.contains(panel))) { return true; } } let elements = getFocusableElements(); let buttonIdx = elements.indexOf(button); let beforeIdx = (buttonIdx + elements.length - 1) % elements.length; let afterIdx = (buttonIdx + 1) % elements.length; let beforeElement = elements[beforeIdx]; let afterElement = elements[afterIdx]; if (!panel.contains(beforeElement) && !panel.contains(afterElement)) { return true; } return false; }, [button, panel]); let buttonIdRef = useLatestValue(buttonId); let panelIdRef = useLatestValue(panelId); let registerBag = (0, import_react37.useMemo)( () => ({ buttonId: buttonIdRef, panelId: panelIdRef, close: () => dispatch({ type: 1 /* ClosePopover */ }) }), [buttonIdRef, panelIdRef, dispatch] ); let groupContext = usePopoverGroupContext(); let registerPopover = groupContext == null ? void 0 : groupContext.registerPopover; let isFocusWithinPopoverGroup = useEvent(() => { var _a4; return (_a4 = groupContext == null ? void 0 : groupContext.isFocusWithinPopoverGroup()) != null ? _a4 : (ownerDocument == null ? void 0 : ownerDocument.activeElement) && ((button == null ? void 0 : button.contains(ownerDocument.activeElement)) || (panel == null ? void 0 : panel.contains(ownerDocument.activeElement))); }); (0, import_react37.useEffect)(() => registerPopover == null ? void 0 : registerPopover(registerBag), [registerPopover, registerBag]); let [portals, PortalWrapper] = useNestedPortals(); let root = useRootContainers({ portals, defaultContainers: [button, panel] }); useEventListener( ownerDocument == null ? void 0 : ownerDocument.defaultView, "focus", (event) => { var _a4, _b, _c, _d; if (event.target === window) return; if (!(event.target instanceof HTMLElement)) return; if (popoverState !== 0 /* Open */) return; if (isFocusWithinPopoverGroup()) return; if (!button) return; if (!panel) return; if (root.contains(event.target)) return; if ((_b = (_a4 = beforePanelSentinel.current) == null ? void 0 : _a4.contains) == null ? void 0 : _b.call(_a4, event.target)) return; if ((_d = (_c = afterPanelSentinel.current) == null ? void 0 : _c.contains) == null ? void 0 : _d.call(_c, event.target)) return; dispatch({ type: 1 /* ClosePopover */ }); }, true ); useOutsideClick( root.resolveContainers, (event, target) => { dispatch({ type: 1 /* ClosePopover */ }); if (!isFocusableElement(target, 1 /* Loose */)) { event.preventDefault(); button == null ? void 0 : button.focus(); } }, popoverState === 0 /* Open */ ); let close = useEvent( (focusableElement) => { dispatch({ type: 1 /* ClosePopover */ }); let restoreElement = (() => { if (!focusableElement) return button; if (focusableElement instanceof HTMLElement) return focusableElement; if ("current" in focusableElement && focusableElement.current instanceof HTMLElement) return focusableElement.current; return button; })(); restoreElement == null ? void 0 : restoreElement.focus(); } ); let api = (0, import_react37.useMemo)( () => ({ close, isPortalled }), [close, isPortalled] ); let slot = (0, import_react37.useMemo)( () => ({ open: popoverState === 0 /* Open */, close }), [popoverState, close] ); let ourProps = { ref: popoverRef }; return /* @__PURE__ */ import_react37.default.createElement(PopoverPanelContext.Provider, { value: null }, /* @__PURE__ */ import_react37.default.createElement(PopoverContext.Provider, { value: reducerBag }, /* @__PURE__ */ import_react37.default.createElement(PopoverAPIContext.Provider, { value: api }, /* @__PURE__ */ import_react37.default.createElement( OpenClosedProvider, { value: match(popoverState, { [0 /* Open */]: 1 /* Open */, [1 /* Closed */]: 2 /* Closed */ }) }, /* @__PURE__ */ import_react37.default.createElement(PortalWrapper, null, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_POPOVER_TAG, name: "Popover" }), /* @__PURE__ */ import_react37.default.createElement(root.MainTreeNode, null)) )))); } var DEFAULT_BUTTON_TAG5 = "button"; function ButtonFn5(props, ref) { let internalId = useId(); let { id = `headlessui-popover-button-${internalId}`, ...theirProps } = props; let [state, dispatch] = usePopoverContext("Popover.Button"); let { isPortalled } = usePopoverAPIContext("Popover.Button"); let internalButtonRef = (0, import_react37.useRef)(null); let sentinelId = `headlessui-focus-sentinel-${useId()}`; let groupContext = usePopoverGroupContext(); let closeOthers = groupContext == null ? void 0 : groupContext.closeOthers; let panelContext = usePopoverPanelContext(); let isWithinPanel = panelContext !== null; (0, import_react37.useEffect)(() => { if (isWithinPanel) return; dispatch({ type: 3 /* SetButtonId */, buttonId: id }); return () => { dispatch({ type: 3 /* SetButtonId */, buttonId: null }); }; }, [isWithinPanel, id, dispatch]); let [uniqueIdentifier] = (0, import_react37.useState)(() => Symbol()); let buttonRef = useSyncRefs( internalButtonRef, ref, isWithinPanel ? null : (button) => { if (button) { state.buttons.current.push(uniqueIdentifier); } else { let idx = state.buttons.current.indexOf(uniqueIdentifier); if (idx !== -1) state.buttons.current.splice(idx, 1); } if (state.buttons.current.length > 1) { console.warn( "You are already using a but only 1 is supported." ); } button && dispatch({ type: 2 /* SetButton */, button }); } ); let withinPanelButtonRef = useSyncRefs(internalButtonRef, ref); let ownerDocument = useOwnerDocument(internalButtonRef); let handleKeyDown = useEvent((event) => { var _a3, _b, _c; if (isWithinPanel) { if (state.popoverState === 1 /* Closed */) return; switch (event.key) { case " " /* Space */: case "Enter" /* Enter */: event.preventDefault(); (_b = (_a3 = event.target).click) == null ? void 0 : _b.call(_a3); dispatch({ type: 1 /* ClosePopover */ }); (_c = state.button) == null ? void 0 : _c.focus(); break; } } else { switch (event.key) { case " " /* Space */: case "Enter" /* Enter */: event.preventDefault(); event.stopPropagation(); if (state.popoverState === 1 /* Closed */) closeOthers == null ? void 0 : closeOthers(state.buttonId); dispatch({ type: 0 /* TogglePopover */ }); break; case "Escape" /* Escape */: if (state.popoverState !== 0 /* Open */) return closeOthers == null ? void 0 : closeOthers(state.buttonId); if (!internalButtonRef.current) return; if ((ownerDocument == null ? void 0 : ownerDocument.activeElement) && !internalButtonRef.current.contains(ownerDocument.activeElement)) { return; } event.preventDefault(); event.stopPropagation(); dispatch({ type: 1 /* ClosePopover */ }); break; } } }); let handleKeyUp = useEvent((event) => { if (isWithinPanel) return; if (event.key === " " /* Space */) { event.preventDefault(); } }); let handleClick = useEvent((event) => { var _a3, _b; if (isDisabledReactIssue7711(event.currentTarget)) return; if (props.disabled) return; if (isWithinPanel) { dispatch({ type: 1 /* ClosePopover */ }); (_a3 = state.button) == null ? void 0 : _a3.focus(); } else { event.preventDefault(); event.stopPropagation(); if (state.popoverState === 1 /* Closed */) closeOthers == null ? void 0 : closeOthers(state.buttonId); dispatch({ type: 0 /* TogglePopover */ }); (_b = state.button) == null ? void 0 : _b.focus(); } }); let handleMouseDown = useEvent((event) => { event.preventDefault(); event.stopPropagation(); }); let visible = state.popoverState === 0 /* Open */; let slot = (0, import_react37.useMemo)(() => ({ open: visible }), [visible]); let type = useResolveButtonType(props, internalButtonRef); let ourProps = isWithinPanel ? { ref: withinPanelButtonRef, type, onKeyDown: handleKeyDown, onClick: handleClick } : { ref: buttonRef, id: state.buttonId, type, "aria-expanded": props.disabled ? void 0 : state.popoverState === 0 /* Open */, "aria-controls": state.panel ? state.panelId : void 0, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp, onClick: handleClick, onMouseDown: handleMouseDown }; let direction = useTabDirection(); let handleFocus = useEvent(() => { let el = state.panel; if (!el) return; function run() { let result = match(direction.current, { [0 /* Forwards */]: () => focusIn(el, 1 /* First */), [1 /* Backwards */]: () => focusIn(el, 8 /* Last */) }); if (result === 0 /* Error */) { focusIn( getFocusableElements().filter((el2) => el2.dataset.headlessuiFocusGuard !== "true"), match(direction.current, { [0 /* Forwards */]: 4 /* Next */, [1 /* Backwards */]: 2 /* Previous */ }), { relativeTo: state.button } ); } } if (false) {} else { run(); } }); return /* @__PURE__ */ import_react37.default.createElement(import_react37.default.Fragment, null, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_BUTTON_TAG5, name: "Popover.Button" }), visible && !isWithinPanel && isPortalled && /* @__PURE__ */ import_react37.default.createElement( Hidden, { id: sentinelId, features: 2 /* Focusable */, "data-headlessui-focus-guard": true, as: "button", type: "button", onFocus: handleFocus } )); } var DEFAULT_OVERLAY_TAG2 = "div"; var OverlayRenderFeatures = 1 /* RenderStrategy */ | 2 /* Static */; function OverlayFn2(props, ref) { let internalId = useId(); let { id = `headlessui-popover-overlay-${internalId}`, ...theirProps } = props; let [{ popoverState }, dispatch] = usePopoverContext("Popover.Overlay"); let overlayRef = useSyncRefs(ref); let usesOpenClosedState = useOpenClosed(); let visible = (() => { if (usesOpenClosedState !== null) { return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } return popoverState === 0 /* Open */; })(); let handleClick = useEvent((event) => { if (isDisabledReactIssue7711(event.currentTarget)) return event.preventDefault(); dispatch({ type: 1 /* ClosePopover */ }); }); let slot = (0, import_react37.useMemo)( () => ({ open: popoverState === 0 /* Open */ }), [popoverState] ); let ourProps = { ref: overlayRef, id, "aria-hidden": true, onClick: handleClick }; return render({ ourProps, theirProps, slot, defaultTag: DEFAULT_OVERLAY_TAG2, features: OverlayRenderFeatures, visible, name: "Popover.Overlay" }); } var DEFAULT_PANEL_TAG3 = "div"; var PanelRenderFeatures2 = 1 /* RenderStrategy */ | 2 /* Static */; function PanelFn3(props, ref) { let internalId = useId(); let { id = `headlessui-popover-panel-${internalId}`, focus = false, ...theirProps } = props; let [state, dispatch] = usePopoverContext("Popover.Panel"); let { close, isPortalled } = usePopoverAPIContext("Popover.Panel"); let beforePanelSentinelId = `headlessui-focus-sentinel-before-${useId()}`; let afterPanelSentinelId = `headlessui-focus-sentinel-after-${useId()}`; let internalPanelRef = (0, import_react37.useRef)(null); let panelRef = useSyncRefs(internalPanelRef, ref, (panel) => { dispatch({ type: 4 /* SetPanel */, panel }); }); let ownerDocument = useOwnerDocument(internalPanelRef); useIsoMorphicEffect(() => { dispatch({ type: 5 /* SetPanelId */, panelId: id }); return () => { dispatch({ type: 5 /* SetPanelId */, panelId: null }); }; }, [id, dispatch]); let usesOpenClosedState = useOpenClosed(); let visible = (() => { if (usesOpenClosedState !== null) { return (usesOpenClosedState & 1 /* Open */) === 1 /* Open */; } return state.popoverState === 0 /* Open */; })(); let handleKeyDown = useEvent((event) => { var _a3; switch (event.key) { case "Escape" /* Escape */: if (state.popoverState !== 0 /* Open */) return; if (!internalPanelRef.current) return; if ((ownerDocument == null ? void 0 : ownerDocument.activeElement) && !internalPanelRef.current.contains(ownerDocument.activeElement)) { return; } event.preventDefault(); event.stopPropagation(); dispatch({ type: 1 /* ClosePopover */ }); (_a3 = state.button) == null ? void 0 : _a3.focus(); break; } }); (0, import_react37.useEffect)(() => { var _a3; if (props.static) return; if (state.popoverState === 1 /* Closed */ && ((_a3 = props.unmount) != null ? _a3 : true)) { dispatch({ type: 4 /* SetPanel */, panel: null }); } }, [state.popoverState, props.unmount, props.static, dispatch]); (0, import_react37.useEffect)(() => { if (state.__demoMode) return; if (!focus) return; if (state.popoverState !== 0 /* Open */) return; if (!internalPanelRef.current) return; let activeElement = ownerDocument == null ? void 0 : ownerDocument.activeElement; if (internalPanelRef.current.contains(activeElement)) return; focusIn(internalPanelRef.current, 1 /* First */); }, [state.__demoMode, focus, internalPanelRef, state.popoverState]); let slot = (0, import_react37.useMemo)( () => ({ open: state.popoverState === 0 /* Open */, close }), [state, close] ); let ourProps = { ref: panelRef, id, onKeyDown: handleKeyDown, onBlur: focus && state.popoverState === 0 /* Open */ ? (event) => { var _a3, _b, _c, _d, _e; let el = event.relatedTarget; if (!el) return; if (!internalPanelRef.current) return; if ((_a3 = internalPanelRef.current) == null ? void 0 : _a3.contains(el)) return; dispatch({ type: 1 /* ClosePopover */ }); if (((_c = (_b = state.beforePanelSentinel.current) == null ? void 0 : _b.contains) == null ? void 0 : _c.call(_b, el)) || ((_e = (_d = state.afterPanelSentinel.current) == null ? void 0 : _d.contains) == null ? void 0 : _e.call(_d, el))) { el.focus({ preventScroll: true }); } } : void 0, tabIndex: -1 }; let direction = useTabDirection(); let handleBeforeFocus = useEvent(() => { let el = internalPanelRef.current; if (!el) return; function run() { match(direction.current, { [0 /* Forwards */]: () => { var _a3; let result = focusIn(el, 1 /* First */); if (result === 0 /* Error */) { (_a3 = state.afterPanelSentinel.current) == null ? void 0 : _a3.focus(); } }, [1 /* Backwards */]: () => { var _a3; (_a3 = state.button) == null ? void 0 : _a3.focus({ preventScroll: true }); } }); } if (false) {} else { run(); } }); let handleAfterFocus = useEvent(() => { let el = internalPanelRef.current; if (!el) return; function run() { match(direction.current, { [0 /* Forwards */]: () => { var _a3; if (!state.button) return; let elements = getFocusableElements(); let idx = elements.indexOf(state.button); let before = elements.slice(0, idx + 1); let after = elements.slice(idx + 1); let combined = [...after, ...before]; for (let element of combined.slice()) { if (element.dataset.headlessuiFocusGuard === "true" || ((_a3 = state.panel) == null ? void 0 : _a3.contains(element))) { let idx2 = combined.indexOf(element); if (idx2 !== -1) combined.splice(idx2, 1); } } focusIn(combined, 1 /* First */, { sorted: false }); }, [1 /* Backwards */]: () => { var _a3; let result = focusIn(el, 2 /* Previous */); if (result === 0 /* Error */) { (_a3 = state.button) == null ? void 0 : _a3.focus(); } } }); } if (false) {} else { run(); } }); return /* @__PURE__ */ import_react37.default.createElement(PopoverPanelContext.Provider, { value: id }, visible && isPortalled && /* @__PURE__ */ import_react37.default.createElement( Hidden, { id: beforePanelSentinelId, ref: state.beforePanelSentinel, features: 2 /* Focusable */, "data-headlessui-focus-guard": true, as: "button", type: "button", onFocus: handleBeforeFocus } ), render({ ourProps, theirProps, slot, defaultTag: DEFAULT_PANEL_TAG3, features: PanelRenderFeatures2, visible, name: "Popover.Panel" }), visible && isPortalled && /* @__PURE__ */ import_react37.default.createElement( Hidden, { id: afterPanelSentinelId, ref: state.afterPanelSentinel, features: 2 /* Focusable */, "data-headlessui-focus-guard": true, as: "button", type: "button", onFocus: handleAfterFocus } )); } var DEFAULT_GROUP_TAG2 = "div"; function GroupFn2(props, ref) { let internalGroupRef = (0, import_react37.useRef)(null); let groupRef = useSyncRefs(internalGroupRef, ref); let [popovers, setPopovers] = (0, import_react37.useState)([]); let unregisterPopover = useEvent((registerbag) => { setPopovers((existing) => { let idx = existing.indexOf(registerbag); if (idx !== -1) { let clone = existing.slice(); clone.splice(idx, 1); return clone; } return existing; }); }); let registerPopover = useEvent((registerbag) => { setPopovers((existing) => [...existing, registerbag]); return () => unregisterPopover(registerbag); }); let isFocusWithinPopoverGroup = useEvent(() => { var _a3; let ownerDocument = getOwnerDocument(internalGroupRef); if (!ownerDocument) return false; let element = ownerDocument.activeElement; if ((_a3 = internalGroupRef.current) == null ? void 0 : _a3.contains(element)) return true; return popovers.some((bag) => { var _a4, _b; return ((_a4 = ownerDocument.getElementById(bag.buttonId.current)) == null ? void 0 : _a4.contains(element)) || ((_b = ownerDocument.getElementById(bag.panelId.current)) == null ? void 0 : _b.contains(element)); }); }); let closeOthers = useEvent((buttonId) => { for (let popover of popovers) { if (popover.buttonId.current !== buttonId) popover.close(); } }); let contextBag = (0, import_react37.useMemo)( () => ({ registerPopover, unregisterPopover, isFocusWithinPopoverGroup, closeOthers }), [registerPopover, unregisterPopover, isFocusWithinPopoverGroup, closeOthers] ); let slot = (0, import_react37.useMemo)(() => ({}), []); let theirProps = props; let ourProps = { ref: groupRef }; return /* @__PURE__ */ import_react37.default.createElement(PopoverGroupContext.Provider, { value: contextBag }, render({ ourProps, theirProps, slot, defaultTag: DEFAULT_GROUP_TAG2, name: "Popover.Group" })); } var PopoverRoot = forwardRefWithAs(PopoverFn); var Button5 = forwardRefWithAs(ButtonFn5); var Overlay2 = forwardRefWithAs(OverlayFn2); var Panel3 = forwardRefWithAs(PanelFn3); var Group2 = forwardRefWithAs(GroupFn2); var Popover = Object.assign(PopoverRoot, { Button: Button5, Overlay: Overlay2, Panel: Panel3, Group: Group2 }); // src/components/radio-group/radio-group.tsx var import_react40 = __toESM(__webpack_require__(/*! react */ "react"), 1); // src/hooks/use-flags.ts var import_react38 = __webpack_require__(/*! react */ "react"); function useFlags(initialFlags = 0) { let [flags, setFlags] = (0, import_react38.useState)(initialFlags); let mounted = useIsMounted(); let addFlag = (0, import_react38.useCallback)( (flag) => { if (!mounted.current) return; setFlags((flags2) => flags2 | flag); }, [flags, mounted] ); let hasFlag = (0, import_react38.useCallback)((flag) => Boolean(flags & flag), [flags]); let removeFlag = (0, import_react38.useCallback)( (flag) => { if (!mounted.current) return; setFlags((flags2) => flags2 & ~flag); }, [setFlags, mounted] ); let toggleFlag = (0, import_react38.useCallback)( (flag) => { if (!mounted.current) return; setFlags((flags2) => flags2 ^ flag); }, [setFlags] ); return { flags, addFlag, hasFlag, removeFlag, toggleFlag }; } // src/components/label/label.tsx var import_react39 = __toESM(__webpack_require__(/*! react */ "react"), 1); var LabelContext = (0, import_react39.createContext)( null ); function useLabelContext() { let context = (0, import_react39.useContext)(LabelContext); if (context === null) { let err = new Error("You used a