"use strict";
// The require scope
var __webpack_require__ = {};
/************************************************************************/ // webpack/runtime/define_property_getters
(()=>{
    __webpack_require__.d = function(exports1, definition) {
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
// webpack/runtime/has_own_property
(()=>{
    __webpack_require__.o = function(obj, prop) {
        return Object.prototype.hasOwnProperty.call(obj, prop);
    };
})();
// webpack/runtime/make_namespace_object
(()=>{
    // define __esModule on exports
    __webpack_require__.r = function(exports1) {
        if ('undefined' != typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
/************************************************************************/ var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXPORTS
__webpack_require__.d(__webpack_exports__, {
    ChakraTooltip: ()=>/* binding */ ChakraTooltip
});
const popper_namespaceObject = require("@chakra-ui/popper");
const portal_namespaceObject = require("@chakra-ui/portal");
const system_namespaceObject = require("@chakra-ui/system");
const object_utils_namespaceObject = require("@chakra-ui/object-utils");
const external_framer_motion_namespaceObject = require("framer-motion");
const external_react_namespaceObject = require("react");
/**
 * @see https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/tooltip/src/tooltip.transition.tsx
 * @description This was ported from Chakra UI because the tooltip arrow couldn't get modified otherwise.
 */ const scale = {
    exit: {
        scale: 0.85,
        opacity: 0,
        transition: {
            opacity: {
                duration: 0.15,
                easings: 'easeInOut'
            },
            scale: {
                duration: 0.2,
                easings: 'easeInOut'
            }
        }
    },
    enter: {
        scale: 1,
        opacity: 1,
        transition: {
            opacity: {
                easings: 'easeOut',
                duration: 0.2
            },
            scale: {
                duration: 0.2,
                ease: [
                    0.175,
                    0.885,
                    0.4,
                    1.1
                ]
            }
        }
    }
};
const react_namespaceObject = require("@chakra-ui/react");
/**
 * @see https://github.com/chakra-ui/chakra-ui/blob/main/packages/components/tooltip/src/tooltip.tsx
 * @description This was ported from Chakra UI because the tooltip arrow couldn't get modified otherwise.
 */ const MotionDiv = (0, system_namespaceObject.chakra)(external_framer_motion_namespaceObject.motion.div);
/**
 * Tooltips display informative text when users hover, focus on, or tap an element.
 *
 * @see Docs     https://chakra-ui.com/docs/overlay/tooltip
 * @see WAI-ARIA https://www.w3.org/WAI/ARIA/apg/patterns/tooltip/
 */ const ChakraTooltip = (0, system_namespaceObject.forwardRef)((props, ref)=>{
    const styles = (0, system_namespaceObject.useStyleConfig)('Tooltip', props);
    const ownProps = (0, system_namespaceObject.omitThemingProps)(props);
    const theme = (0, system_namespaceObject.useTheme)();
    const { children, label, shouldWrapChildren, 'aria-label': ariaLabel, hasArrow, bg, portalProps, background, backgroundColor, bgColor, motionProps, ...rest } = ownProps;
    const userDefinedBg = background ?? backgroundColor ?? bg ?? bgColor;
    if (userDefinedBg) {
        styles.bg = userDefinedBg;
        const bgVar = (0, system_namespaceObject.getCSSVar)(theme, 'colors', userDefinedBg);
        styles[popper_namespaceObject.popperCSSVars.arrowBg["var"]] = bgVar;
    }
    const tooltip = (0, react_namespaceObject.useTooltip)({
        ...rest,
        direction: theme.direction
    });
    const shouldWrap = 'string' == typeof children || shouldWrapChildren;
    let trigger;
    if (shouldWrap) trigger = /*#__PURE__*/ React.createElement(system_namespaceObject.chakra.span, {
        display: "inline-block",
        tabIndex: 0,
        ...tooltip.getTriggerProps()
    }, children);
    else {
        /**
     * Ensure tooltip has only one child node
     */ const child = external_react_namespaceObject.Children.only(children);
        trigger = /*#__PURE__*/ (0, external_react_namespaceObject.cloneElement)(child, tooltip.getTriggerProps(child.props, child.ref));
    }
    const hasAriaLabel = !!ariaLabel;
    const _tooltipProps = tooltip.getTooltipProps({}, ref);
    const tooltipProps = hasAriaLabel ? (0, object_utils_namespaceObject.omit)(_tooltipProps, [
        'role',
        'id'
    ]) : _tooltipProps;
    const srOnlyProps = (0, object_utils_namespaceObject.pick)(_tooltipProps, [
        'role',
        'id'
    ]);
    /**
   * If the `label` is empty, there's no point showing the tooltip.
   * Let's simply return the children
   */ if (!label) return /*#__PURE__*/ React.createElement(React.Fragment, null, children);
    // Cannot override directly in Chakra because it's a 1-part component
    const arrowStyles = {
        mt: 'top' === props.placement ? '2.4px' : void 0,
        borderRight: 'top' === props.placement ? '2px solid' : void 0,
        borderColor: 'top' === props.placement ? 'darkblue.600 !important' : void 0,
        borderBottom: 'top' === props.placement ? '2px solid' : void 0,
        boxShadow: 'top' === props.placement ? '3px 1px 0px 0px var(--chakra-colors-gray-200) !important' : void 0
    };
    return /*#__PURE__*/ React.createElement(React.Fragment, null, trigger, /*#__PURE__*/ React.createElement(external_framer_motion_namespaceObject.AnimatePresence, null, tooltip.isOpen && /*#__PURE__*/ React.createElement(portal_namespaceObject.Portal, portalProps, /*#__PURE__*/ React.createElement(system_namespaceObject.chakra.div, {
        ...tooltip.getTooltipPositionerProps(),
        __css: {
            zIndex: styles.zIndex,
            pointerEvents: 'none'
        }
    }, /*#__PURE__*/ React.createElement(MotionDiv, {
        variants: scale,
        initial: "exit",
        animate: "enter",
        exit: "exit",
        ...motionProps,
        ...tooltipProps,
        __css: styles
    }, label, hasAriaLabel && /*#__PURE__*/ React.createElement(system_namespaceObject.chakra.span, {
        srOnly: true,
        ...srOnlyProps
    }, ariaLabel), hasArrow && /*#__PURE__*/ React.createElement(system_namespaceObject.chakra.div, {
        "data-popper-arrow": true,
        className: "chakra-tooltip__arrow-wrapper"
    }, /*#__PURE__*/ React.createElement(system_namespaceObject.chakra.div, {
        "data-popper-arrow-inner": true,
        className: "chakra-tooltip__arrow",
        ...arrowStyles,
        __css: {
            bg: styles.bg
        }
    })))))));
});
ChakraTooltip.displayName = 'Tooltip';
var __webpack_export_target__ = exports;
for(var __webpack_i__ in __webpack_exports__)__webpack_export_target__[__webpack_i__] = __webpack_exports__[__webpack_i__];
if (__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, '__esModule', {
    value: true
});
