import { D as DEBOUNCED_TIME, j as StyledSliderWrapper, k as StyledSlider } from './index-3d035e54.js';
export { l as Accordion, b as Anchor, c as AspectRatio, A as Avatar, B as Breadcrumbs, a as Carousel, f as CentralCarousel, d as Checkbox, g as ChipButton, e as ErrorLabel, I as Input, O as OTP, P as Phone, n as PhoneInput, o as Popover, R as Radio, S as Select, m as emotionCache } from './index-3d035e54.js';
export { D as DatePicker } from './index-ea305c8c.js';
export { T as Text } from './index-cb974729.js';
import { B as Button } from './index-4ecade52.js';
export { B as Button } from './index-4ecade52.js';
export { I as Indicator } from './index-b7f0fc0d.js';
export { T as TextArea } from './index-8af8e2b6.js';
export { M as Modal } from './index-064f7258.js';
import { _ as __rest } from './tslib.es6-708e7260.js';
import React__default, { useState, useEffect } from 'react';
import { Badge as Badge$1, LoadingOverlay as LoadingOverlay$1, clsx, Title, Text, Button as Button$1 } from '@mantine/core';
import { theme } from './miscTheme.js';
export { S as Spoiler } from './index-c791aecb.js';
import { useDebouncedValue } from '@mantine/hooks';
export { S as Switch } from './index-9ed5aa0b.js';
export { M as MantineProvider } from './index-d3355115.js';
export { C as CustomStylesType, F as FontWeight, T as TemplateProvider } from './index-5282fcb5.js';
export { M as MAPPED_LOCALE, a as getHeadingStyles, g as getMantineThemeOverride, s as showNotification, t as themeColors, u as useMantineLocale } from './index-fdb7afd2.js';
export { T as Tabs } from './index-d5862078.js';
import '@hhgtech/icons/other';
import './index-c21070e4.js';
import './constantsDomainLocales.js';
import './Locale-3534825c.js';
import './constantsIsProduction.js';
import './index-8daef9a0.js';
import './utils-3346ba5f.js';
import '@emotion/styled';
import '@mantine/carousel';
import './shared-d9474794.js';
import 'classnames';
import 'uuid';
import './useUniqueId-2333b152.js';
import './constantsSite.js';
import './index-b3165fed.js';
import '@emotion/react';
import '@hhgtech/icons/core';
import '@mantine/dates';
import './index-7a01bd3b.js';
import 'date-fns/locale';
import './constantsRiskScreener.js';
import './index.styles-0c85f1b9.js';
import './index-8cd8aef7.js';
import './translationsContext-cc698d60.js';
import 'dayjs';
import '@mantine/notifications';

const Badge = (_a) => {
    var { color = theme.colors.primaryBase, styles } = _a, rest = __rest(_a, ["color", "styles"]);
    return (React__default.createElement(Badge$1, Object.assign({ variant: "filled", color: color, styles: Object.assign({ root: {
                borderRadius: '2px',
                background: color,
                textTransform: 'unset',
            } }, styles) }, rest)));
};

function useLockBodyScroll(visible = false) {
    React__default.useEffect(() => {
        if (visible) {
            const originalStyle = window.getComputedStyle(document.body).overflow;
            document.body.style.overflow = 'hidden';
            return () => {
                document.body.style.overflow = originalStyle;
            };
        }
    }, [visible]);
}

const LoadingOverlay = (props) => {
    useLockBodyScroll(props.visible);
    return (React__default.createElement(LoadingOverlay$1, Object.assign({ loaderProps: {
            color: theme.colors.primaryBase,
        } }, props)));
};

const Slider = (_a) => {
    var { color, withControl, onChange, value, min, max, isStatic, containerClassName, containerStyle } = _a, props = __rest(_a, ["color", "withControl", "onChange", "value", "min", "max", "isStatic", "containerClassName", "containerStyle"]);
    const [currentValue, setCurrentValue] = useState(value || min || 0);
    const [debounced] = useDebouncedValue(currentValue, DEBOUNCED_TIME);
    const increase = () => {
        setCurrentValue((p) => (max && p === max ? p : p + 1));
    };
    const decrease = () => {
        setCurrentValue((p) => (min && p === min ? p : p - 1));
    };
    useEffect(() => {
        onChange === null || onChange === void 0 ? void 0 : onChange(debounced);
    }, [debounced]);
    useEffect(() => {
        setCurrentValue(value);
    }, [value]);
    return (React__default.createElement(StyledSliderWrapper, { className: containerClassName, style: containerStyle },
        withControl && (React__default.createElement(Button, { type: "button", size: "sm", variant: "ghost", onClick: decrease },
            React__default.createElement("svg", { width: "10", height: "10", fill: "none", viewBox: "0 0 12 3" },
                React__default.createElement("path", { d: "M1 1.004h8", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" })))),
        React__default.createElement(StyledSlider, Object.assign({ thumbSize: 21, labelAlwaysOn: true, radius: "xl", color: color, value: currentValue, onChange: !isStatic ? setCurrentValue : () => null, min: min, max: max }, props, { className: 'hhg-mantine-slider ' + (props.className || '') })),
        withControl && (React__default.createElement(Button, { type: "button", size: "sm", variant: "ghost", onClick: increase },
            React__default.createElement("svg", { width: "16", height: "20", fill: "none", viewBox: "0 0 16 16" },
                React__default.createElement("path", { d: "M8 4v8M4 8h8", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }))))));
};

var styles = {"container":"MON6sfi","iconContainer":"pS-tJD7","icon":"s3tJ9-5","title":"fNsZr1b","description":"uuxV74v","button":"YohjTDU"};

function Result(props) {
    const { icon, title, description, button, buttonProps, style, className } = props;
    const _a = buttonProps || {}, { size = 'lg', variant = 'outline' } = _a, restButtonProps = __rest(_a, ["size", "variant"]);
    const Icon = icon;
    return (React__default.createElement("div", { className: clsx('result', styles.container, className), style: style },
        Icon && (React__default.createElement("div", { className: clsx('resultIconContainer', styles.iconContainer) },
            React__default.createElement(Icon, { className: clsx('resultIcon', styles.icon) }))),
        React__default.createElement(Title, { order: 3, size: "h3", className: clsx('resultTitle', styles.title) }, title),
        React__default.createElement(Text, { className: clsx('resultDescription', styles.description) }, description),
        button && (React__default.createElement(Button$1, Object.assign({}, restButtonProps, { size: size, variant: variant, className: clsx('resultButton', styles.button, restButtonProps.className) }), button))));
}

export { Badge, LoadingOverlay, Result, Slider };
