{"version":3,"file":"index.mjs","sources":["../../../../node_modules/.bun/cron-schedule@5.0.4/node_modules/cron-schedule/dist/utils.js","../../../../node_modules/.bun/cron-schedule@5.0.4/node_modules/cron-schedule/dist/cron.js","../../../../node_modules/.bun/cron-schedule@5.0.4/node_modules/cron-schedule/dist/cron-parser.js","../../../../node_modules/.bun/cron-schedule@5.0.4/node_modules/cron-schedule/dist/schedulers/timer-based.js","../../../@hive/snapshots/dist/index.mjs"],"sourcesContent":["export const TIMEOUT_MAX = 2147483647; // 2^31-1\n/**\n * Creates a new timeout, which can exceed the max timeout limit of 2^31-1.\n * Since multiple timeouts are used internally, the timeoutId used to clear the timeout\n * is returned as a handle (object) and changes whenever the max timeout limit is exceeded.\n * The handle parameter can be ignored, it is used internally for updating the timeoutId\n * in the handle after creating the next timeout.\n */\nexport function longTimeout(fn, timeout, previousHandle) {\n    let nextTimeout = timeout;\n    let remainingTimeout = 0;\n    if (nextTimeout > TIMEOUT_MAX) {\n        remainingTimeout = nextTimeout - TIMEOUT_MAX;\n        nextTimeout = TIMEOUT_MAX;\n    }\n    const handle = previousHandle !== null && previousHandle !== void 0 ? previousHandle : {\n        timeoutId: undefined,\n    };\n    handle.timeoutId = setTimeout(() => {\n        if (remainingTimeout > 0) {\n            longTimeout(fn, remainingTimeout, previousHandle);\n        }\n        else {\n            fn();\n        }\n    }, nextTimeout);\n    return handle;\n}\n/* Extracts second, minute, hour, date, month and the weekday from a date. */\nexport function extractDateElements(date) {\n    return {\n        second: date.getSeconds(),\n        minute: date.getMinutes(),\n        hour: date.getHours(),\n        day: date.getDate(),\n        month: date.getMonth(),\n        weekday: date.getDay(),\n        year: date.getFullYear(),\n    };\n}\n/* Gets the amount of days in the given month (indexed by 0) of the given year. */\nexport function getDaysInMonth(year, month) {\n    return new Date(year, month + 1, 0).getDate();\n}\n/* Gets the amount of days from weekday1 to weekday2. */\nexport function getDaysBetweenWeekdays(weekday1, weekday2) {\n    if (weekday1 <= weekday2) {\n        return weekday2 - weekday1;\n    }\n    return 6 - weekday1 + weekday2 + 1;\n}\nexport function wrapFunction(fn, errorHandler) {\n    return () => {\n        try {\n            const res = fn();\n            if (res instanceof Promise) {\n                res.catch((err) => {\n                    if (errorHandler) {\n                        errorHandler(err);\n                    }\n                });\n            }\n        }\n        catch (err) {\n            if (errorHandler) {\n                errorHandler(err);\n            }\n        }\n    };\n}\n//# sourceMappingURL=utils.js.map","import { extractDateElements, getDaysBetweenWeekdays, getDaysInMonth, } from './utils.js';\nexport class Cron {\n    constructor({ seconds, minutes, hours, days, months, weekdays, }) {\n        // Validate that there are values provided.\n        if (!seconds || seconds.size === 0)\n            throw new Error('There must be at least one allowed second.');\n        if (!minutes || minutes.size === 0)\n            throw new Error('There must be at least one allowed minute.');\n        if (!hours || hours.size === 0)\n            throw new Error('There must be at least one allowed hour.');\n        if (!months || months.size === 0)\n            throw new Error('There must be at least one allowed month.');\n        if ((!weekdays || weekdays.size === 0) && (!days || days.size === 0))\n            throw new Error('There must be at least one allowed day or weekday.');\n        // Convert set to array and sort in ascending order.\n        this.seconds = Array.from(seconds).sort((a, b) => a - b);\n        this.minutes = Array.from(minutes).sort((a, b) => a - b);\n        this.hours = Array.from(hours).sort((a, b) => a - b);\n        this.days = Array.from(days).sort((a, b) => a - b);\n        this.months = Array.from(months).sort((a, b) => a - b);\n        this.weekdays = Array.from(weekdays).sort((a, b) => a - b);\n        // Validate that all values are integers within the constraint.\n        const validateData = (name, data, constraint) => {\n            if (data.some((x) => typeof x !== 'number' ||\n                x % 1 !== 0 ||\n                x < constraint.min ||\n                x > constraint.max)) {\n                throw new Error(`${name} must only consist of integers which are within the range of ${constraint.min} and ${constraint.max}`);\n            }\n        };\n        validateData('seconds', this.seconds, { min: 0, max: 59 });\n        validateData('minutes', this.minutes, { min: 0, max: 59 });\n        validateData('hours', this.hours, { min: 0, max: 23 });\n        validateData('days', this.days, { min: 1, max: 31 });\n        validateData('months', this.months, { min: 0, max: 11 });\n        validateData('weekdays', this.weekdays, { min: 0, max: 6 });\n        // For each element, store a reversed copy in the reversed attribute for finding prev dates.\n        this.reversed = {\n            seconds: this.seconds.map((x) => x).reverse(),\n            minutes: this.minutes.map((x) => x).reverse(),\n            hours: this.hours.map((x) => x).reverse(),\n            days: this.days.map((x) => x).reverse(),\n            months: this.months.map((x) => x).reverse(),\n            weekdays: this.weekdays.map((x) => x).reverse(),\n        };\n    }\n    /**\n     * Find the next or previous hour, starting from the given start hour that matches the hour constraint.\n     * startHour itself might also be allowed.\n     */\n    findAllowedHour(dir, startHour) {\n        return dir === 'next'\n            ? this.hours.find((x) => x >= startHour)\n            : this.reversed.hours.find((x) => x <= startHour);\n    }\n    /**\n     * Find the next or previous minute, starting from the given start minute that matches the minute constraint.\n     * startMinute itself might also be allowed.\n     */\n    findAllowedMinute(dir, startMinute) {\n        return dir === 'next'\n            ? this.minutes.find((x) => x >= startMinute)\n            : this.reversed.minutes.find((x) => x <= startMinute);\n    }\n    /**\n     * Find the next or previous second, starting from the given start second that matches the second constraint.\n     * startSecond itself IS NOT allowed.\n     */\n    findAllowedSecond(dir, startSecond) {\n        return dir === 'next'\n            ? this.seconds.find((x) => x > startSecond)\n            : this.reversed.seconds.find((x) => x < startSecond);\n    }\n    /**\n     * Find the next or previous time, starting from the given start time that matches the hour, minute\n     * and second constraints. startTime itself might also be allowed.\n     */\n    findAllowedTime(dir, startTime) {\n        // Try to find an allowed hour.\n        let hour = this.findAllowedHour(dir, startTime.hour);\n        if (hour !== undefined) {\n            if (hour === startTime.hour) {\n                // We found an hour that is the start hour. Try to find an allowed minute.\n                let minute = this.findAllowedMinute(dir, startTime.minute);\n                if (minute !== undefined) {\n                    if (minute === startTime.minute) {\n                        // We found a minute that is the start minute. Try to find an allowed second.\n                        const second = this.findAllowedSecond(dir, startTime.second);\n                        if (second !== undefined) {\n                            // We found a second within the start hour and minute.\n                            return { hour, minute, second };\n                        }\n                        // We did not find a valid second within the start minute. Try to find another minute.\n                        minute = this.findAllowedMinute(dir, dir === 'next' ? startTime.minute + 1 : startTime.minute - 1);\n                        if (minute !== undefined) {\n                            // We found a minute which is not the start minute. Return that minute together with the hour and the first / last allowed second.\n                            return {\n                                hour,\n                                minute,\n                                second: dir === 'next' ? this.seconds[0] : this.reversed.seconds[0],\n                            };\n                        }\n                    }\n                    else {\n                        // We found a minute which is not the start minute. Return that minute together with the hour and the first / last allowed second.\n                        return {\n                            hour,\n                            minute,\n                            second: dir === 'next' ? this.seconds[0] : this.reversed.seconds[0],\n                        };\n                    }\n                }\n                // We did not find an allowed minute / second combination inside the start hour. Try to find the next / previous allowed hour.\n                hour = this.findAllowedHour(dir, dir === 'next' ? startTime.hour + 1 : startTime.hour - 1);\n                if (hour !== undefined) {\n                    // We found an allowed hour which is not the start hour. Return that hour together with the first / last allowed minutes / seconds.\n                    return {\n                        hour,\n                        minute: dir === 'next' ? this.minutes[0] : this.reversed.minutes[0],\n                        second: dir === 'next' ? this.seconds[0] : this.reversed.seconds[0],\n                    };\n                }\n            }\n            else {\n                // We found an allowed hour which is not the start hour. Return that hour together with the first / last allowed minutes / seconds.\n                return {\n                    hour,\n                    minute: dir === 'next' ? this.minutes[0] : this.reversed.minutes[0],\n                    second: dir === 'next' ? this.seconds[0] : this.reversed.seconds[0],\n                };\n            }\n        }\n        // No allowed time found.\n        return undefined;\n    }\n    /**\n     * Find the next or previous day in the given month, starting from the given startDay\n     * that matches either the day or the weekday constraint. startDay itself might also be allowed.\n     */\n    findAllowedDayInMonth(dir, year, month, startDay) {\n        var _a, _b;\n        if (startDay < 1)\n            throw new Error('startDay must not be smaller than 1.');\n        // If only days are restricted: allow day based on day constraint only.\n        // If only weekdays are restricted: allow day based on weekday constraint only.\n        // If both are restricted: allow day based on both day and weekday constraint. pick day that is closer to startDay.\n        // If none are restricted: return the day closest to startDay (respecting dir) that is allowed (or startDay itself).\n        const daysInMonth = getDaysInMonth(year, month);\n        const daysRestricted = this.days.length !== 31;\n        const weekdaysRestricted = this.weekdays.length !== 7;\n        if (!daysRestricted && !weekdaysRestricted) {\n            if (startDay > daysInMonth) {\n                return dir === 'next' ? undefined : daysInMonth;\n            }\n            return startDay;\n        }\n        // Try to find a day based on the days constraint.\n        let allowedDayByDays;\n        if (daysRestricted) {\n            allowedDayByDays =\n                dir === 'next'\n                    ? this.days.find((x) => x >= startDay)\n                    : this.reversed.days.find((x) => x <= startDay);\n            // Make sure the day does not exceed the amount of days in month.\n            if (allowedDayByDays !== undefined && allowedDayByDays > daysInMonth) {\n                allowedDayByDays = undefined;\n            }\n        }\n        // Try to find a day based on the weekday constraint.\n        let allowedDayByWeekdays;\n        if (weekdaysRestricted) {\n            const startWeekday = new Date(year, month, startDay).getDay();\n            const nearestAllowedWeekday = dir === 'next'\n                ? (_a = this.weekdays.find((x) => x >= startWeekday)) !== null && _a !== void 0 ? _a : this.weekdays[0]\n                : (_b = this.reversed.weekdays.find((x) => x <= startWeekday)) !== null && _b !== void 0 ? _b : this.reversed.weekdays[0];\n            if (nearestAllowedWeekday !== undefined) {\n                const daysBetweenWeekdays = dir === 'next'\n                    ? getDaysBetweenWeekdays(startWeekday, nearestAllowedWeekday)\n                    : getDaysBetweenWeekdays(nearestAllowedWeekday, startWeekday);\n                allowedDayByWeekdays =\n                    dir === 'next'\n                        ? startDay + daysBetweenWeekdays\n                        : startDay - daysBetweenWeekdays;\n                // Make sure the day does not exceed the month boundaries.\n                if (allowedDayByWeekdays > daysInMonth || allowedDayByWeekdays < 1) {\n                    allowedDayByWeekdays = undefined;\n                }\n            }\n        }\n        if (allowedDayByDays !== undefined && allowedDayByWeekdays !== undefined) {\n            // If a day is found both via the days and the weekdays constraint, pick the day\n            // that is closer to start date.\n            return dir === 'next'\n                ? Math.min(allowedDayByDays, allowedDayByWeekdays)\n                : Math.max(allowedDayByDays, allowedDayByWeekdays);\n        }\n        if (allowedDayByDays !== undefined) {\n            return allowedDayByDays;\n        }\n        if (allowedDayByWeekdays !== undefined) {\n            return allowedDayByWeekdays;\n        }\n        return undefined;\n    }\n    /** Gets the next date starting from the given start date or now. */\n    getNextDate(startDate = new Date()) {\n        const startDateElements = extractDateElements(startDate);\n        let minYear = startDateElements.year;\n        let startIndexMonth = this.months.findIndex((x) => x >= startDateElements.month);\n        if (startIndexMonth === -1) {\n            startIndexMonth = 0;\n            minYear++;\n        }\n        // We try every month within the next 5 years to make sure that we tried to\n        // find a matching date insidde a whole leap year.\n        const maxIterations = this.months.length * 5;\n        for (let i = 0; i < maxIterations; i++) {\n            // Get the next year and month.\n            const year = minYear + Math.floor((startIndexMonth + i) / this.months.length);\n            const month = this.months[(startIndexMonth + i) % this.months.length];\n            const isStartMonth = year === startDateElements.year && month === startDateElements.month;\n            // Find the next day.\n            let day = this.findAllowedDayInMonth('next', year, month, isStartMonth ? startDateElements.day : 1);\n            let isStartDay = isStartMonth && day === startDateElements.day;\n            // If we found a day and it is the start day, try to find a valid time beginning from the start date time.\n            if (day !== undefined && isStartDay) {\n                const nextTime = this.findAllowedTime('next', startDateElements);\n                if (nextTime !== undefined) {\n                    return new Date(year, month, day, nextTime.hour, nextTime.minute, nextTime.second);\n                }\n                // If no valid time has been found for the start date, try the next day.\n                day = this.findAllowedDayInMonth('next', year, month, day + 1);\n                isStartDay = false;\n            }\n            // If we found a next day and it is not the start day, just use the next day with the first allowed values\n            // for hours, minutes and seconds.\n            if (day !== undefined && !isStartDay) {\n                return new Date(year, month, day, this.hours[0], this.minutes[0], this.seconds[0]);\n            }\n            // No allowed day has been found for this month. Continue to search in next month.\n        }\n        throw new Error('No valid next date was found.');\n    }\n    /** Gets the specified amount of future dates starting from the given start date or now. */\n    getNextDates(amount, startDate) {\n        const dates = [];\n        let nextDate;\n        for (let i = 0; i < amount; i++) {\n            nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);\n            dates.push(nextDate);\n        }\n        return dates;\n    }\n    /**\n     * Get an ES6 compatible iterator which iterates over the next dates starting from startDate or now.\n     * The iterator runs until the optional endDate is reached or forever.\n     */\n    *getNextDatesIterator(startDate, endDate) {\n        let nextDate;\n        while (true) {\n            nextDate = this.getNextDate(nextDate !== null && nextDate !== void 0 ? nextDate : startDate);\n            if (endDate && endDate.getTime() < nextDate.getTime()) {\n                return;\n            }\n            yield nextDate;\n        }\n    }\n    /** Gets the previous date starting from the given start date or now. */\n    getPrevDate(startDate = new Date()) {\n        const startDateElements = extractDateElements(startDate);\n        let maxYear = startDateElements.year;\n        let startIndexMonth = this.reversed.months.findIndex((x) => x <= startDateElements.month);\n        if (startIndexMonth === -1) {\n            startIndexMonth = 0;\n            maxYear--;\n        }\n        // We try every month within the past 5 years to make sure that we tried to\n        // find a matching date inside a whole leap year.\n        const maxIterations = this.reversed.months.length * 5;\n        for (let i = 0; i < maxIterations; i++) {\n            // Get the next year and month.\n            const year = maxYear -\n                Math.floor((startIndexMonth + i) / this.reversed.months.length);\n            const month = this.reversed.months[(startIndexMonth + i) % this.reversed.months.length];\n            const isStartMonth = year === startDateElements.year && month === startDateElements.month;\n            // Find the previous day.\n            let day = this.findAllowedDayInMonth('prev', year, month, isStartMonth\n                ? startDateElements.day\n                : // Start searching from the last day of the month.\n                    getDaysInMonth(year, month));\n            let isStartDay = isStartMonth && day === startDateElements.day;\n            // If we found a day and it is the start day, try to find a valid time beginning from the start date time.\n            if (day !== undefined && isStartDay) {\n                const prevTime = this.findAllowedTime('prev', startDateElements);\n                if (prevTime !== undefined) {\n                    return new Date(year, month, day, prevTime.hour, prevTime.minute, prevTime.second);\n                }\n                // If no valid time has been found for the start date, try the previous day.\n                if (day > 1) {\n                    day = this.findAllowedDayInMonth('prev', year, month, day - 1);\n                    isStartDay = false;\n                }\n            }\n            // If we found a previous day and it is not the start day, just use the previous day with the first allowed values\n            // for hours, minutes and seconds (which will be the latest time due to using the reversed array).\n            if (day !== undefined && !isStartDay) {\n                return new Date(year, month, day, this.reversed.hours[0], this.reversed.minutes[0], this.reversed.seconds[0]);\n            }\n            // No allowed day has been found for this month. Continue to search in previous month.\n        }\n        throw new Error('No valid previous date was found.');\n    }\n    /** Gets the specified amount of previous dates starting from the given start date or now. */\n    getPrevDates(amount, startDate) {\n        const dates = [];\n        let prevDate;\n        for (let i = 0; i < amount; i++) {\n            prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);\n            dates.push(prevDate);\n        }\n        return dates;\n    }\n    /**\n     * Get an ES6 compatible iterator which iterates over the previous dates starting from startDate or now.\n     * The iterator runs until the optional endDate is reached or forever.\n     */\n    *getPrevDatesIterator(startDate, endDate) {\n        let prevDate;\n        while (true) {\n            prevDate = this.getPrevDate(prevDate !== null && prevDate !== void 0 ? prevDate : startDate);\n            if (endDate && endDate.getTime() > prevDate.getTime()) {\n                return;\n            }\n            yield prevDate;\n        }\n    }\n    /** Returns true when there is a cron date at the given date. */\n    matchDate(date) {\n        const { second, minute, hour, day, month, weekday } = extractDateElements(date);\n        if (this.seconds.indexOf(second) === -1 ||\n            this.minutes.indexOf(minute) === -1 ||\n            this.hours.indexOf(hour) === -1 ||\n            this.months.indexOf(month) === -1) {\n            return false;\n        }\n        if (this.days.length !== 31 && this.weekdays.length !== 7) {\n            return (this.days.indexOf(day) !== -1 || this.weekdays.indexOf(weekday) !== -1);\n        }\n        return (this.days.indexOf(day) !== -1 && this.weekdays.indexOf(weekday) !== -1);\n    }\n}\n//# sourceMappingURL=cron.js.map","import { Cron } from './cron.js';\nconst secondConstraint = {\n    min: 0,\n    max: 59,\n};\nconst minuteConstraint = {\n    min: 0,\n    max: 59,\n};\nconst hourConstraint = {\n    min: 0,\n    max: 23,\n};\nconst dayConstraint = {\n    min: 1,\n    max: 31,\n};\nconst monthConstraint = {\n    min: 1,\n    max: 12,\n    aliases: {\n        jan: '1',\n        feb: '2',\n        mar: '3',\n        apr: '4',\n        may: '5',\n        jun: '6',\n        jul: '7',\n        aug: '8',\n        sep: '9',\n        oct: '10',\n        nov: '11',\n        dec: '12',\n    },\n};\nconst weekdayConstraint = {\n    min: 0,\n    max: 7,\n    aliases: {\n        mon: '1',\n        tue: '2',\n        wed: '3',\n        thu: '4',\n        fri: '5',\n        sat: '6',\n        sun: '7',\n    },\n};\nconst timeNicknames = {\n    '@yearly': '0 0 1 1 *',\n    '@annually': '0 0 1 1 *',\n    '@monthly': '0 0 1 * *',\n    '@weekly': '0 0 * * 0',\n    '@daily': '0 0 * * *',\n    '@hourly': '0 * * * *',\n    '@minutely': '* * * * *',\n};\nfunction parseElement(element, constraint) {\n    const result = new Set();\n    // If returned set of numbers is empty, the scheduler class interpretes the emtpy set of numbers as all valid values of the constraint\n    if (element === '*') {\n        for (let i = constraint.min; i <= constraint.max; i = i + 1) {\n            result.add(i);\n        }\n        return result;\n    }\n    // If the element is a list, parse each element in the list.\n    const listElements = element.split(',');\n    if (listElements.length > 1) {\n        for (const listElement of listElements) {\n            const parsedListElement = parseElement(listElement, constraint);\n            for (const x of parsedListElement) {\n                result.add(x);\n            }\n        }\n        return result;\n    }\n    // Helper function to parse a single element, which includes checking for alias, valid number and constraint min and max.\n    const parseSingleElement = (singleElement) => {\n        var _a, _b;\n        // biome-ignore lint/style/noParameterAssign: adding another variable with a new name is more confusing\n        singleElement =\n            (_b = (_a = constraint.aliases) === null || _a === void 0 ? void 0 : _a[singleElement.toLowerCase()]) !== null && _b !== void 0 ? _b : singleElement;\n        const parsedElement = Number.parseInt(singleElement, 10);\n        if (Number.isNaN(parsedElement)) {\n            throw new Error(`Failed to parse ${element}: ${singleElement} is NaN.`);\n        }\n        if (parsedElement < constraint.min || parsedElement > constraint.max) {\n            throw new Error(`Failed to parse ${element}: ${singleElement} is outside of constraint range of ${constraint.min} - ${constraint.max}.`);\n        }\n        return parsedElement;\n    };\n    // Detect if the element is a range.\n    // Possible range formats: 'start-end', 'start-end/step', '*', '*/step'.\n    // Where start and end can be numbers or aliases.\n    // Capture groups: 1: start-end, 2: start, 3: end, 4: /step, 5: step.\n    const rangeSegments = /^(([0-9a-zA-Z]+)-([0-9a-zA-Z]+)|\\*)(\\/([0-9]+))?$/.exec(element);\n    // If not, it must be a single element.\n    if (rangeSegments === null) {\n        result.add(parseSingleElement(element));\n        return result;\n    }\n    // If it is a range, get start and end of the range.\n    let parsedStart = rangeSegments[1] === '*'\n        ? constraint.min\n        : parseSingleElement(rangeSegments[2]);\n    const parsedEnd = rangeSegments[1] === '*'\n        ? constraint.max\n        : parseSingleElement(rangeSegments[3]);\n    // need to catch Sunday, which gets parsed here as 7, but is also legitimate at the start of a range as 0, to avoid the out of order error\n    if (constraint === weekdayConstraint &&\n        parsedStart === 7 &&\n        // this check ensures that sun-sun is not incorrectly parsed as [0,1,2,3,4,5,6]\n        parsedEnd !== 7) {\n        parsedStart = 0;\n    }\n    if (parsedStart > parsedEnd) {\n        throw new Error(`Failed to parse ${element}: Invalid range (start: ${parsedStart}, end: ${parsedEnd}).`);\n    }\n    // Check whether there is a custom step defined for the range, defaulting to 1.\n    const step = rangeSegments[5];\n    let parsedStep = 1;\n    if (step !== undefined) {\n        parsedStep = Number.parseInt(step, 10);\n        if (Number.isNaN(parsedStep)) {\n            throw new Error(`Failed to parse step: ${step} is NaN.`);\n        }\n        if (parsedStep < 1) {\n            throw new Error(`Failed to parse step: Expected ${step} to be greater than 0.`);\n        }\n    }\n    // Go from start to end of the range by the given steps.\n    for (let i = parsedStart; i <= parsedEnd; i = i + parsedStep) {\n        result.add(i);\n    }\n    return result;\n}\n/** Parses a cron expression into a Cron instance. */\nexport function parseCronExpression(cronExpression) {\n    var _a;\n    if (typeof cronExpression !== 'string') {\n        throw new TypeError('Invalid cron expression: must be of type string.');\n    }\n    // Convert time nicknames.\n    // biome-ignore lint/style/noParameterAssign: adding another variable with a new name is more confusing\n    cronExpression = (_a = timeNicknames[cronExpression.toLowerCase()]) !== null && _a !== void 0 ? _a : cronExpression;\n    // Split the cron expression into its elements, removing empty elements (extra whitespaces).\n    const elements = cronExpression.split(' ').filter((elem) => elem.length > 0);\n    if (elements.length < 5 || elements.length > 6) {\n        throw new Error('Invalid cron expression: expected 5 or 6 elements.');\n    }\n    const rawSeconds = elements.length === 6 ? elements[0] : '0';\n    const rawMinutes = elements.length === 6 ? elements[1] : elements[0];\n    const rawHours = elements.length === 6 ? elements[2] : elements[1];\n    const rawDays = elements.length === 6 ? elements[3] : elements[2];\n    const rawMonths = elements.length === 6 ? elements[4] : elements[3];\n    const rawWeekdays = elements.length === 6 ? elements[5] : elements[4];\n    return new Cron({\n        seconds: parseElement(rawSeconds, secondConstraint),\n        minutes: parseElement(rawMinutes, minuteConstraint),\n        hours: parseElement(rawHours, hourConstraint),\n        days: parseElement(rawDays, dayConstraint),\n        // months in cron are indexed by 1, but Cron expects indexes by 0, so we need to reduce all set values by one.\n        months: new Set(Array.from(parseElement(rawMonths, monthConstraint)).map((x) => x - 1)),\n        weekdays: new Set(Array.from(parseElement(rawWeekdays, weekdayConstraint)).map((x) => x % 7)),\n    });\n}\n//# sourceMappingURL=cron-parser.js.map","import { longTimeout, wrapFunction } from '../utils.js';\n/**\n * A cron scheduler that is based on timers.\n * It will create one timer for every scheduled cron.\n * When the node timeout limit of ~24 days would be exceeded,\n * it uses multiple consecutive timeouts.\n */\n// biome-ignore lint/complexity/noStaticOnlyClass: a static class makes sense here to encapsulate the functionality\nexport class TimerBasedCronScheduler {\n    /**\n     * Creates a timeout, which will fire the given task on the next cron date.\n     * Returns a handle which can be used to clear the timeout using clearTimeoutOrInterval.\n     */\n    static setTimeout(cron, task, opts) {\n        const nextSchedule = cron.getNextDate();\n        const timeout = nextSchedule.getTime() - Date.now();\n        return longTimeout(wrapFunction(task, opts === null || opts === void 0 ? void 0 : opts.errorHandler), timeout);\n    }\n    /**\n     * Creates an interval, which will fire the given task on every future cron date.\n     * Returns a handle which can be used to clear the interval using clearTimeoutOrInterval.\n     */\n    static setInterval(cron, task, opts) {\n        var _a;\n        const handle = (_a = opts === null || opts === void 0 ? void 0 : opts.handle) !== null && _a !== void 0 ? _a : { timeoutId: undefined };\n        const { timeoutId } = TimerBasedCronScheduler.setTimeout(cron, () => {\n            wrapFunction(task, opts === null || opts === void 0 ? void 0 : opts.errorHandler)();\n            // biome-ignore lint/complexity/noThisInStatic: <explanation>\n            this.setInterval(cron, task, Object.assign(Object.assign({}, opts), { handle }));\n        });\n        handle.timeoutId = timeoutId;\n        return handle;\n    }\n    /** Clears a timeout or interval, making sure that the function will no longer execute. */\n    static clearTimeoutOrInterval(handle) {\n        if (handle.timeoutId) {\n            clearTimeout(handle.timeoutId);\n        }\n    }\n}\n//# sourceMappingURL=timer-based.js.map","import { InvalidSelectorError, serializeError } from \"@hive/sdk/errors\";\nimport { ResourceTransactionEvent, StorageDeleteEvent, UnexpectedErrorEvent } from \"@hive/sdk/events\";\nimport { formatDuration } from \"@hive/sdk/format\";\nimport { Operation } from \"@hive/sdk/operation\";\nimport { Selector } from \"@hive/sdk/selector\";\nimport { isWrite } from \"@hive/sdk/transaction\";\nimport { parseCronExpression } from \"cron-schedule\";\nimport { TimerBasedCronScheduler } from \"cron-schedule/schedulers/timer-based.js\";\n\n//#region src/index.ts\nvar SnapshotManager = class SnapshotManager {\n\tstatic name = \"snapshot-manager\";\n\t/**\n\t* `Storage` instance to use for reading and persisting Snapshot state.\n\t*/\n\tstorage;\n\t/**\n\t* `EventEmitter` instance to use for listening to and emitting events.\n\t*/\n\tevents;\n\t/**\n\t* `Logger` instance to use for logging.\n\t*/\n\tlogger;\n\t/**\n\t* Schedule at which, if provided, Snapshots will be taken of\n\t* modified Databases.\n\t*/\n\tcron = null;\n\t/**\n\t* Timer that, if running, triggers the creation of Snapshots at the\n\t* configured schedule.\n\t*/\n\ttimer = null;\n\t/**\n\t* Map containing modifications counts for each managed Database.\n\t*/\n\tmodifications;\n\t/**\n\t* Map containing references to pending Snapshot creation promises.\n\t*/\n\tpending;\n\t/**\n\t* Error handler to invoke with any errors which might occur during\n\t* background tasks.\n\t*/\n\tonError = null;\n\tconstructor(config) {\n\t\tthis.storage = config.storage;\n\t\tthis.events = config.events;\n\t\tthis.logger = config.logger ?? null;\n\t\tthis.onError = config.onError ?? null;\n\t\tthis.modifications = new Map();\n\t\tthis.pending = new Map();\n\t\tthis.cron = config.schedule ? parseCronExpression(config.schedule) : null;\n\t}\n\t/**\n\t* Internal method to create a Snapshot of a Resource.\n\t*\n\t* @param selector Details about the Resource to snapshot.\n\t* @param opts Options for the operation.\n\t*\n\t* @returns Promise resolving when the Snapshot has been created.\n\t*/\n\tsnapshot = (selector, opts) => {\n\t\tif (selector.type !== \"database\") throw new InvalidSelectorError(selector);\n\t\tif (this.pending.has(selector.key)) return this.pending.get(selector.key);\n\t\tconst pending = new Promise(async (resolve, reject) => {\n\t\t\ttry {\n\t\t\t\tconst trace = opts?.trace ?? crypto.randomUUID();\n\t\t\t\tconst operation = new Operation({ trace });\n\t\t\t\tconst reason = opts?.reason ?? \"manual creation\";\n\t\t\t\tconst snapshot = new Selector({\n\t\t\t\t\ttype: \"snapshot\",\n\t\t\t\t\tid: `snapshot-${Date.now()}`,\n\t\t\t\t\tparent: selector\n\t\t\t\t});\n\t\t\t\tawait this.storage.create(snapshot, {\n\t\t\t\t\tcontents: selector,\n\t\t\t\t\ttrace\n\t\t\t\t});\n\t\t\t\tthis.logger?.info(\"created snapshot\", {\n\t\t\t\t\tmodule: SnapshotManager.name,\n\t\t\t\t\tresource: selector.key,\n\t\t\t\t\tsnapshot: snapshot.key,\n\t\t\t\t\ttrace,\n\t\t\t\t\tdur: formatDuration(operation.duration),\n\t\t\t\t\treason\n\t\t\t\t});\n\t\t\t\tthis.modifications.delete(selector.key);\n\t\t\t\tresolve();\n\t\t\t} catch (error) {\n\t\t\t\treject(error);\n\t\t\t} finally {\n\t\t\t\tthis.pending.delete(selector.key);\n\t\t\t}\n\t\t});\n\t\tthis.pending.set(selector.key, pending);\n\t\treturn pending;\n\t};\n\t/**\n\t* Internal method to handle a Resource query event.\n\t*\n\t* @param event Details about the Resource query event.\n\t*/\n\thandleTransaction = (event) => {\n\t\tif (event.resource.type !== \"database\") return;\n\t\tif (event.resource.key === new Selector({\n\t\t\ttype: \"database\",\n\t\t\tid: \".index\"\n\t\t}).key) return;\n\t\tif (event.transaction.statements.some(isWrite)) this.modifications.set(event.resource.key, (this.modifications.get(event.resource.key) ?? 0) + 1);\n\t};\n\t/**\n\t* Internal method to handle a Storage delete event.\n\t*\n\t* @param event Details about the Storage delete event.\n\t*/\n\thandleDelete = (event) => {\n\t\tif (event.resource.type !== \"database\") return;\n\t\tthis.modifications.delete(event.resource.key);\n\t};\n\t/**\n\t* Start the `SnapshotManager` instance.\n\t*\n\t* @param opts Options for starting the `SnapshotManager` instance.\n\t*\n\t* @returns Promise resolving the `SnapshotManager` instance.\n\t*/\n\tstart = async (_opts) => {\n\t\tif (this.cron) {\n\t\t\tthis.events.on(ResourceTransactionEvent.type, this.handleTransaction);\n\t\t\tthis.events.on(StorageDeleteEvent.type, this.handleDelete);\n\t\t\tthis.timer = TimerBasedCronScheduler.setInterval(this.cron, () => this.schedule({ reason: \"SCHEDULED\" }).catch((err) => {\n\t\t\t\tconst error = err instanceof Error ? err : new Error(String(err));\n\t\t\t\tthis.onError?.(new UnexpectedErrorEvent({ error }));\n\t\t\t}));\n\t\t}\n\t\treturn Promise.resolve(this);\n\t};\n\t/**\n\t* Stop the `SnapshotManager` instance.\n\t*\n\t* @param opts Options for stopping the `SnapshotManager` instance.\n\t*\n\t* @returns Promise resolving the `SnapshotManager` instance.\n\t*/\n\tstop = async (_opts) => {\n\t\tif (this.cron) {\n\t\t\tthis.events.off(\"resource:transaction\", this.handleTransaction);\n\t\t\tthis.events.off(\"storage:delete\", this.handleDelete);\n\t\t}\n\t\tawait Promise.all(this.pending.values());\n\t\tthis.modifications.clear();\n\t\tif (this.timer) TimerBasedCronScheduler.clearTimeoutOrInterval(this.timer);\n\t\treturn Promise.resolve(this);\n\t};\n\t/**\n\t* Schedule the creation of Snapshots of all Resources that were modified\n\t* since their last Snapshot was created.\n\t*\n\t* If the creation of a Snapshot fails, errors are handled individually\n\t* and other Snapshot creations will continue to be attempted, though the\n\t* Promise will reject.\n\t*\n\t* If a Snapshot is already being created of a Resource, the ongoing\n\t* operation will be awaited instead.\n\t*\n\t* @example ```\n\t* // Schedule the creation of Snapshots of all modified Resources.\n\t* await snapshotManager.schedule();\n\t* ```\n\t*\n\t* @param opts Options for creating Snapshots.\n\t*\n\t* @returns Promise resolving when all scheduled Snapshots have been created.\n\t*\n\t* @throws `Error` if the creation of one or more Snapshots fails.\n\t*/\n\tschedule = async (opts) => {\n\t\tconst trace = opts?.trace ?? crypto.randomUUID();\n\t\tconst operation = new Operation({ trace });\n\t\tconst reason = opts?.reason ?? \"MANUAL\";\n\t\tthis.logger?.info(\"snapshot creation scheduled\", {\n\t\t\tmodule: SnapshotManager.name,\n\t\t\ttrace,\n\t\t\tdur: formatDuration(operation.duration),\n\t\t\treason\n\t\t});\n\t\tconst created = new Set();\n\t\tconst failed = new Set();\n\t\tawait Promise.all(Array.from(this.modifications.keys()).map((key) => new Selector(key)).map((selector) => this.snapshot(selector, {\n\t\t\treason,\n\t\t\ttrace\n\t\t}).then(() => {\n\t\t\tcreated.add(selector);\n\t\t}).catch((err) => {\n\t\t\tconst error = err instanceof Error ? err : new Error(String(err));\n\t\t\tthis.logger?.error(`error creating snapshot (${error.message})`, {\n\t\t\t\tmodule: SnapshotManager.name,\n\t\t\t\tresource: selector.key,\n\t\t\t\ttrace,\n\t\t\t\tdur: formatDuration(operation.duration),\n\t\t\t\terr: JSON.stringify(serializeError(error))\n\t\t\t});\n\t\t\tthis.onError?.(new UnexpectedErrorEvent({\n\t\t\t\terror,\n\t\t\t\ttrace\n\t\t\t}));\n\t\t\tfailed.add(selector);\n\t\t})));\n\t\tif (created.size === 0 && failed.size === 0) this.logger?.info(\"no resources to snapshot\", {\n\t\t\tmodule: SnapshotManager.name,\n\t\t\ttrace,\n\t\t\tdur: formatDuration(operation.duration)\n\t\t});\n\t\tif (created.size > 0) this.logger?.info(\"created snapshots\", {\n\t\t\tmodule: SnapshotManager.name,\n\t\t\ttrace,\n\t\t\tdur: formatDuration(operation.duration),\n\t\t\tcount: created.size.toString()\n\t\t});\n\t\tif (failed.size > 0) {\n\t\t\tthis.logger?.warn(\"error creating some snapshots\", {\n\t\t\t\tmodule: SnapshotManager.name,\n\t\t\t\ttrace,\n\t\t\t\tdur: formatDuration(operation.duration),\n\t\t\t\tcount: failed.size.toString()\n\t\t\t});\n\t\t\tthrow new Error(`Failed to create snapshots of ${failed.size} resources.`);\n\t\t}\n\t};\n\t/**\n\t* Create a new Snapshot of a Resource.\n\t*\n\t* @param source Details about the Resource to create a Snapshot of.\n\t* @param target Details about the Snapshot to create.\n\t* @param opts Options for creating the Snapshot.\n\t*\n\t* @returns Promise resolving when the Snapshot has been created.\n\t*/\n\tcreate = async (source, target, opts) => {\n\t\tconst trace = opts?.trace ?? crypto.randomUUID();\n\t\tconst operation = new Operation({ trace });\n\t\tconst snapshot = new Selector(target ?? {\n\t\t\ttype: \"snapshot\",\n\t\t\tid: `snapshot-${Date.now()}`,\n\t\t\tparent: source\n\t\t});\n\t\tconst res = await this.storage.create(snapshot, {\n\t\t\tcontents: source,\n\t\t\ttrace\n\t\t});\n\t\tthis.logger?.info(\"created snapshot\", {\n\t\t\tmodule: SnapshotManager.name,\n\t\t\tresource: source.key,\n\t\t\tsnapshot: snapshot.key,\n\t\t\ttrace,\n\t\t\tdur: formatDuration(operation.duration)\n\t\t});\n\t\treturn res;\n\t};\n\t/**\n\t* Restore a Snapshot of a Resource.\n\t*\n\t* @param source Details about the Snapshot to restore.\n\t* @param target Details about the Resource to restore the Snapshot to.\n\t* @param opts Options for restoring the Snapshot.\n\t*\n\t* @returns Promise resolving when the Snapshot has been restored.\n\t*/\n\trestore = async (source, target, opts) => {\n\t\tconst trace = opts?.trace ?? crypto.randomUUID();\n\t\tconst operation = new Operation({ trace });\n\t\tawait this.storage.setContents(target, source, { trace });\n\t\tthis.logger?.info(\"restored snapshot\", {\n\t\t\tmodule: SnapshotManager.name,\n\t\t\tresource: target.key,\n\t\t\tsnapshot: source.key,\n\t\t\ttrace,\n\t\t\tdur: formatDu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