import { D as DEBOUNCED_TIME, j as StyledSliderWrapper, k as StyledSlider } from './index-c3177e04.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-c3177e04.js';
export { D as DatePicker } from './index-122829d2.js';
export { T as Text } from './index-d0a1200e.js';
import { B as Button } from './index-f71a880f.js';
export { B as Button } from './index-f71a880f.js';
export { I as Indicator } from './index-6fbb16f8.js';
export { T as TextArea } from './index-bee6ed79.js';
export { M as Modal } from './index-7601f2a1.js';
import { _ as __rest } from './tslib.es6-ab63fd84.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-24be25e0.js';
import { useDebouncedValue } from '@mantine/hooks';
export { S as Switch } from './index-fd80d78b.js';
export { M as MantineProvider } from './index-eaa64027.js';
export { C as CustomStylesType, F as FontWeight, T as TemplateProvider } from './index-38e03570.js';
export { M as MAPPED_LOCALE, a as getHeadingStyles, g as getMantineThemeOverride, s as showNotification, t as themeColors, u as useMantineLocale } from './index-4e6b8a2b.js';
export { T as Tabs } from './index-f21110d2.js';
import '@hhgtech/icons/other';
import './index-43584299.js';
import './constantsDomainLocales.js';
import './Locale-87b46912.js';
import './constantsIsProduction.js';
import './index-74fcf0aa.js';
import './utils-32d7d5af.js';
import '@emotion/styled';
import '@mantine/carousel';
import './shared-3674950a.js';
import 'classnames';
import 'uuid';
import './useUniqueId-6d89c40a.js';
import './constantsSite.js';
import './index-91c6a49c.js';
import '@emotion/react';
import '@hhgtech/icons/core';
import '@mantine/dates';
import './index-a8162282.js';
import 'date-fns/locale';
import './constantsRiskScreener.js';
import './index.styles-3ba274d2.js';
import './index-960c3169.js';
import './translationsContext-4de1415e.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 };
