export { A as Accordion } from './Accordion-Ch9S_qd3.js';
export { A as Alert } from './Alert-CayTuRLW.js';
export { A as Avatar } from './Avatar-D5YGlXVF.js';
export { B as Badge } from './Badge-Bj3ajrWB.js';
export { B as Button } from './Button-DSvnInaL.js';
export { C as Callout } from './Callout-CTr3dhBe.js';
export { C as Checkbox } from './Checkbox-zCxgcZiC.js';
export { C as ColorPicker } from './ColorPicker-DtOvy0Gy.js';
export { D as DatePicker } from './DatePicker-B7SYjsog.js';
export { T as TimePicker } from './TimePicker-2vhf5yYK.js';
import './TimePickerPanel-CiF0RExY.js';
import pureDayjs from 'dayjs';
import localeData from 'dayjs/plugin/localeData';
import utc from 'dayjs/plugin/utc';
import weekday from 'dayjs/plugin/weekday';
import weekOfYear from 'dayjs/plugin/weekOfYear';
export { T as TranslationProvider, r as translations } from './TranslationProvider-Ba9rn47H.js';
export { D as DirectionProvider } from './DirectionProvider-DGYDg_He.js';
export { D as Dialog } from './Dialog-BURSzxaP.js';
export { DropdownMenu } from './components/DropdownMenu.js';
export { E as Empty } from './Empty-zyL2ZsHX.js';
export { I as Input } from './Input-C1gcv9o2.js';
export { K as Kbd } from './Kbd-EqbC0bua.js';
export { L as Label } from './Label-DAFESZOG.js';
export { P as Pagination } from './Pagination-DSc9yXPy.js';
export { R as RadioGroup } from './RadioGroup-BNeYQAoT.js';
export { S as Select } from './Select-BgSz0fve.js';
export { M as MultiEmailInput } from './MultiEmailInput-SCTYovtX.js';
export { S as Sheet } from './Sheet-B99vGwLH.js';
export { P as Popover } from './Popover-Dmq-xK_a.js';
export { P as Progress } from './Progress-B9NlUm6e.js';
export { S as Slider } from './Slider-BCQXhs0Q.js';
export { S as Spinner } from './Spinner-C8HSac-2.js';
export { S as Stepper } from './Stepper-BoGkmkY0.js';
export { T as Toastr } from './Toastr-DYqpSaMd.js';
export { S as Switch } from './Switch-B83TGxJ_.js';
export { T as Tabs } from './Tabs-DWfKnl3S.js';
export { T as Textarea } from './Textarea-C0z50h0N.js';
export { T as Tooltip } from './Tooltip-3ZzQyaDV.js';
export { T as Typography, t as typographyVariants } from './Typography-ClPJbLjP.js';
export { D as DataTable, u as useColumnOrdering, a as useColumnPinning, b as useColumnVisibility, c as useTablePagination, d as useTableSelection, e as useTableSort } from './DataTable-ZLvVywpD.js';
export { T as Tree } from './Tree-C7r10UY5.js';
export { T as TreeSelect } from './TreeSelect-BxsQrdjf.js';
export { u as useIsMobile } from './use-mobile-IRjN_mlT.js';
export { c as cn } from './utils-DdHUxIdC.js';
import 'react/jsx-runtime';
import 'react';
import './primitives/Accordion.js';
import './chevron-down-BNi0ntys.js';
import './createLucideIcon-C8ycilSN.js';
import './chevron-up-Bf2G3AAU.js';
import './index-CiyxEyB0.js';
import './index-Dd1i1d2M.js';
import './index-BtkPdosV.js';
import './index-DNzunGHb.js';
import './index-Cor698lu.js';
import './index-DOzu5J1s.js';
import './index-DhnfW8wQ.js';
import 'react-dom';
import './index-0o2E3Cnw.js';
import './index-yFgkK_AM.js';
import './index-zW4GjM5L.js';
import './index-d0BBQf5t.js';
import 'react-i18next';
import './primitives/Dialog.js';
import './button-D6uWDFCs.js';
import './index-D7Zy7P05.js';
import './index-CfriMyrd.js';
import './dialog-DK71SlsS.js';
import './x-_o2T3n6D.js';
import './index-9HvIbmnI.js';
import './index-BNPynZWM.js';
import './index-CSUSJzOJ.js';
import './index-B4_fVWDx.js';
import './index-fV_U4ZJM.js';
import './primitives/Avatar.js';
import './index-DZXbzIgC.js';
import './index-CSMSzzKM.js';
import './primitives/Tooltip.js';
import './tooltip-XkHLgxlU.js';
import './index-C3hByjk3.js';
import './floating-ui.react-dom-D8_f_WWh.js';
import './index-BYZaLNq1.js';
import './index-CSggBaQF.js';
import './renderIcon-tlvMyboj.js';
import './primitives/Badge.js';
import 'react-router-dom';
import './primitives/Button.js';
import './primitives/Spinner.js';
import './loader-circle-DycHUAWN.js';
import './primitives/Alert.js';
import './triangle-alert-PXnNWQy_.js';
import './primitives/Checkbox.js';
import './check-Cpkv29p1.js';
import './index-30QpKM0j.js';
import './primitives/Field.js';
import './label-B4qDF3W1.js';
import './separator-BbhgePmX.js';
import 'react-colorful';
import './primitives/Popover.js';
import './Calendar-gPWbQa_c.js';
import './chevron-left-BDoT8E2-.js';
import './chevron-right-DQnrO-ek.js';
import './primitives/ScrollArea.js';
import './index-BfAAoDv6.js';
import 'i18next';
import './primitives/DropdownMenu.js';
import './index-OI_tWuLx.js';
import './index-DT56XkyA.js';
import './primitives/ButtonGroup.js';
import './primitives/Empty.js';
import './primitives/InputGroup.js';
import './input-group-C_qKMibX.js';
import './input-GLCCE2kT.js';
import './textarea-BSZwxzjQ.js';
import './primitives/Kbd.js';
import './primitives/Label.js';
import './primitives/Pagination.js';
import './ellipsis-lb8Ws6br.js';
import './primitives/RadioGroup.js';
import './SelectFieldWrapper-BJzq9aCY.js';
import './primitives/Combobox.js';
import './with-selector-Dv0G_V_o.js';
import './primitives/Sheet.js';
import './sheet-DVTG6X82.js';
import './primitives/HoverCard.js';
import './primitives/Progress.js';
import './primitives/Slider.js';
import './index-D_roZz8G.js';
import './primitives/Switch.js';
import './primitives/Tabs.js';
import './primitives/Textarea.js';
import './primitives/Table.js';
import './redux-BKH6DnBB.js';

const typeToPos = {
    year: 0,
    month: 1,
    day: 2,
    hour: 3,
    minute: 4,
    second: 5,
};
const dateTimeFormatDefaults = {
    year: "numeric",
    month: "2-digit",
    day: "2-digit",
    hour: "2-digit",
    minute: "2-digit",
    second: "2-digit",
};
const dtfCache = new Map();
const getDateTimeFormat = (timezone, options = {}) => {
    const timeZoneName = options.timeZoneName || "short";
    const key = `${timezone}|${timeZoneName}`;
    let dtf = dtfCache.get(key);
    if (!dtf) {
        dtf = new Intl.DateTimeFormat("en-US", {
            ...dateTimeFormatDefaults,
            hour12: false,
            timeZone: timezone,
            timeZoneName,
        });
        dtfCache.set(key, dtf);
    }
    return dtf;
};
const localeStringifierCache = new Map();
const getLocaleStringifier = (timezone) => {
    let localeStringifier = localeStringifierCache.get(timezone);
    if (!localeStringifier) {
        localeStringifier = new Intl.DateTimeFormat("en-US", {
            ...dateTimeFormatDefaults,
            timeZone: timezone,
        });
        localeStringifierCache.set(timezone, localeStringifier);
    }
    return localeStringifier;
};
const timezonePlugin = (_o, c, d) => {
    let defaultTimezone;
    const dayjsFactory = d;
    const dayjsClass = c;
    const makeFormatParts = (timestamp, timezone, options = {}) => {
        const date = new Date(timestamp);
        const dtf = getDateTimeFormat(timezone, options);
        return dtf.formatToParts(date);
    };
    const tzOffset = (timestamp, timezone) => {
        const formatResult = makeFormatParts(timestamp, timezone);
        const filled = [];
        for (let i = 0; i < formatResult.length; i += 1) {
            const { type, value } = formatResult[i];
            const pos = typeToPos[type];
            if (pos >= 0) {
                filled[pos] = parseInt(value, 10);
            }
        }
        const hour = filled[3];
        const fixedHour = hour === 24 ? 0 : hour;
        const utcString = `${filled[0]}-${filled[1]}-${filled[2]} ${fixedHour}:${filled[4]}:${filled[5]}:000`;
        const utcTs = dayjsFactory.utc(utcString).valueOf();
        let asTS = Number(timestamp);
        const over = asTS % 1000;
        asTS -= over;
        return (utcTs - asTS) / (60 * 1000);
    };
    const fixOffset = (localTS, o0, tz) => {
        let utcGuess = localTS - o0 * 60 * 1000;
        const o2 = tzOffset(utcGuess, tz);
        if (o0 === o2) {
            return [utcGuess, o0];
        }
        utcGuess -= (o2 - o0) * 60 * 1000;
        const o3 = tzOffset(utcGuess, tz);
        if (o2 === o3) {
            return [utcGuess, o2];
        }
        return [localTS - Math.min(o2, o3) * 60 * 1000, Math.max(o2, o3)];
    };
    const proto = dayjsClass.prototype;
    proto.tz = function (timezone = defaultTimezone, keepLocalTime) {
        const oldOffset = this.utcOffset();
        const date = this.toDate();
        const target = getLocaleStringifier(timezone).format(date);
        const diff = Math.round((date.getTime() - new Date(target).getTime()) / 1000 / 60);
        let ins = dayjsFactory(target)
            .$set("millisecond", this.$ms)
            .utcOffset(-Math.round(date.getTimezoneOffset() / 15) * 15 - diff, true);
        if (keepLocalTime) {
            const newOffset = ins.utcOffset();
            ins = ins.add(oldOffset - newOffset, "minute");
        }
        ins.$x.$timezone = timezone;
        return ins;
    };
    proto.offsetName = function (type) {
        const zone = this.$x.$timezone || dayjsFactory.tz.guess();
        const result = makeFormatParts(this.valueOf(), zone, {
            timeZoneName: type,
        }).find((m) => m.type.toLowerCase() === "timezonename");
        return result && result.value;
    };
    const oldStartOf = proto.startOf;
    proto.startOf = function (units, startOf) {
        if (!this.$x || !this.$x.$timezone) {
            return oldStartOf.call(this, units, startOf);
        }
        const withoutTz = dayjsFactory(this.format("YYYY-MM-DD HH:mm:ss:SSS"));
        const startOfWithoutTz = oldStartOf.call(withoutTz, units, startOf);
        return startOfWithoutTz.tz(this.$x.$timezone, true);
    };
    const tzFunction = function (input, arg1, arg2) {
        const parseFormat = arg2 && arg1;
        const timezone = arg2 || arg1 || defaultTimezone;
        const previousOffset = tzOffset(Number(dayjsFactory()), timezone);
        if (typeof input !== "string") {
            return dayjsFactory(input).tz(timezone);
        }
        const localTs = dayjsFactory.utc(input, parseFormat).valueOf();
        const [targetTs, targetOffset] = fixOffset(localTs, previousOffset, timezone);
        const ins = dayjsFactory(targetTs).utcOffset(targetOffset);
        ins.$x.$timezone = timezone;
        return ins;
    };
    tzFunction.guess = function () {
        return Intl.DateTimeFormat().resolvedOptions().timeZone;
    };
    tzFunction.setDefault = function (timezone) {
        defaultTimezone = timezone;
    };
    dayjsFactory.tz = tzFunction;
};

pureDayjs.extend(weekOfYear);
pureDayjs.extend(weekday);
pureDayjs.extend(localeData);
pureDayjs.extend(utc);
pureDayjs.extend(timezonePlugin);
class LRUCache {
    limit;
    cache;
    constructor(limit) {
        this.limit = limit;
        this.cache = new Map();
    }
    get(key) {
        const value = this.cache.get(key);
        this.cache.delete(key);
        if (value !== undefined) {
            this.cache.set(key, value);
        }
        return value;
    }
    set(key, value) {
        if (this.cache.size >= this.limit) {
            const oldestKey = this.cache.keys().next().value;
            if (oldestKey !== undefined) {
                this.cache.delete(oldestKey);
            }
        }
        this.cache.set(key, value);
    }
    has(key) {
        return this.cache.has(key);
    }
}
const hasTimezone = (dateString) => {
    const timezoneRegex = /Z|[+-]\d{2}:\d{2}$|[+-]\d{4}$|GMT([+-]\d{4})?$/;
    return timezoneRegex.test(dateString);
};
const cache = new LRUCache(1000);
const pureDayjsWithTz = pureDayjs;
const dayjs = (...args) => {
    const cacheKey = JSON.stringify(args);
    if (cache.has(cacheKey) && args[0] !== undefined)
        return cache.get(cacheKey);
    const userTimezone = pureDayjsWithTz.tz()?.$x?.$timezone;
    const browserTimezone = pureDayjsWithTz.tz.guess();
    const timezone = userTimezone || browserTimezone;
    if (userTimezone === browserTimezone || userTimezone === undefined) {
        const result = pureDayjsWithTz(...args);
        if (args[0] !== undefined)
            cache.set(cacheKey, result);
        return result;
    }
    const mutableArgs = [...args];
    if (mutableArgs.length > 0 &&
        (typeof mutableArgs[0] === "string" || mutableArgs[0] === null)) {
        const pureDayjsArgs = [mutableArgs[0], mutableArgs[1]];
        if (typeof mutableArgs[0] === "string" && hasTimezone(mutableArgs[0])) {
            mutableArgs[0] = pureDayjsWithTz(...pureDayjsArgs);
        }
        else {
            mutableArgs[0] = pureDayjsWithTz(...pureDayjsArgs).format("YYYY-MM-DD HH:mm:ss");
            mutableArgs[1] = "YYYY-MM-DD HH:mm:ss";
        }
    }
    if (mutableArgs[0]?.toString() === "Invalid Date") {
        const result = pureDayjsWithTz(...mutableArgs);
        if (mutableArgs[0] !== undefined)
            cache.set(cacheKey, result);
        return result;
    }
    const result = mutableArgs.length === 2
        ? pureDayjsWithTz.tz(mutableArgs[0], mutableArgs[1], timezone)
        : pureDayjsWithTz.tz(mutableArgs[0], timezone);
    if (mutableArgs[0] !== undefined)
        cache.set(cacheKey, result);
    return result;
};
Object.assign(dayjs, { ...pureDayjs });
const getTimezoneAppliedDateTime = (inputDateTime) => {
    const timezoneAppliedDateTime = (date) => date && typeof date.format === "function"
        ? dayjs(date.format("YYYY-MM-DD HH:mm:ss"))
        : null;
    return Array.isArray(inputDateTime)
        ? inputDateTime.map(timezoneAppliedDateTime)
        : timezoneAppliedDateTime(inputDateTime);
};

export { dayjs, getTimezoneAppliedDateTime };
//# sourceMappingURL=index.js.map
