UNPKG

@oxog/kairos

Version:

Revolutionary zero-dependency JavaScript date/time library with modular architecture and dynamic holiday system

9 lines 91.4 kB
/*!
 * Kairos v1.0.0
 * (c) 2025 Ersin Koc
 * Released under the MIT License
 * https://github.com/ersinkoc/kairos
 */
class e{constructor(e=1e3){this.cache=new Map,this.maxSize=e}get(e){const t=this.cache.get(e);return void 0!==t&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){const e=this.cache.keys().next().value;void 0!==e&&this.cache.delete(e)}this.cache.set(e,t)}has(e){return this.cache.has(e)}clear(){this.cache.clear()}size(){return this.cache.size}}function t(t,a){const n=new e;return(...e)=>{const s=a?a(...e):JSON.stringify(e);if(n.has(s))return n.get(s);const r=t(...e);return n.set(s,r),r}}function a(){return new e(1e4)}function n(){return new e(5e3)}function s(e){return e instanceof Date&&!isNaN(e.getTime())}function r(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function i(e){return"string"==typeof e&&e.length>0}function o(e){return r(e)&&e>=1e3&&e<=9999}function d(e){return r(e)&&e>=1&&e<=12}function l(e){return r(e)&&e>=1&&e<=31}function u(e){return r(e)&&e>=0&&e<=6}function c(e){return r(e)&&(e>=1&&e<=5||-1===e)}function y(e){const t=[];if(!e||"object"!=typeof e)return t.push("Rule must be an object"),t;i(e.name)||t.push("Rule name must be a non-empty string");const a=["fixed","nth-weekday","relative","lunar","easter-based","custom"];if(a.includes(e.type)||t.push(`Rule type must be one of: ${a.join(", ")}`),!e.rule||"object"!=typeof e.rule)return t.push("Rule must have a rule property"),t;switch(e.type){case"fixed":d(e.rule.month)||t.push("Fixed rule month must be 1-12"),l(e.rule.day)||t.push("Fixed rule day must be 1-31");break;case"nth-weekday":d(e.rule.month)||t.push("Nth-weekday rule month must be 1-12"),u(e.rule.weekday)||t.push("Nth-weekday rule weekday must be 0-6"),c(e.rule.nth)||t.push("Nth-weekday rule nth must be 1-5 or -1");break;case"relative":i(e.rule.relativeTo)||t.push("Relative rule relativeTo must be a non-empty string"),r(e.rule.offset)||t.push("Relative rule offset must be a number");break;case"lunar":{const a=["islamic","chinese","hebrew","persian"];a.includes(e.rule.calendar)||t.push(`Lunar rule calendar must be one of: ${a.join(", ")}`),d(e.rule.month)||t.push("Lunar rule month must be 1-12"),l(e.rule.day)||t.push("Lunar rule day must be 1-31");break}case"easter-based":r(e.rule.offset)||t.push("Easter-based rule offset must be a number");break;case"custom":"function"!=typeof e.rule.calculate&&t.push("Custom rule must have a calculate function")}return t}function h(e,t){const a=new Error(e);throw t&&(a.code=t),a}const m=e=>null!==e&&"object"==typeof e&&("year"in e&&"month"in e&&"day"in e||"date"in e),f=new e(1e3);class g{constructor(e){this._date=this.parseInput(e)}parseInput(e){if(void 0===e)return new Date;if(e instanceof Date)return new Date(e.getTime());if("number"==typeof e)return isNaN(e)?new Date(NaN):new Date(e);if("string"==typeof e){if("invalid"===e.toLowerCase()||""===e)return new Date(NaN);if(/^\d{4}-\d{2}-\d{2}$/.test(e)){const[t,a,n]=e.split("-").map(Number);if(a<1||a>12)return new Date(NaN);const s=new Date(t,a-1,n,0,0,0,0);return s.getFullYear()!==t||s.getMonth()!==a-1||s.getDate()!==n?new Date(NaN):s}const t=/^(\d{1,2})\.(\d{1,2})\.(\d{4})$/;if(t.test(e)){const a=e.match(t);if(a){const e=parseInt(a[1],10),t=parseInt(a[2],10),n=parseInt(a[3],10);if(t<1||t>12||e<1||e>31)return new Date(NaN);const s=new Date(n,t-1,e,0,0,0,0);return s.getFullYear()!==n||s.getMonth()!==t-1||s.getDate()!==e?new Date(NaN):s}}const a=new Date(e);return isNaN(a.getTime())?(g.config.strict&&h(`Invalid date string: ${e}`,"INVALID_DATE"),new Date(NaN)):a}if(e&&"object"==typeof e){if(null!==(t=e)&&"object"==typeof t&&"_date"in t&&t._date instanceof Date)return new Date(e._date.getTime());if((e=>null!==e&&"object"==typeof e&&"toDate"in e&&"function"==typeof e.toDate)(e))return e.toDate();if(m(e)&&void 0!==e.year&&void 0!==e.month&&void 0!==e.day){const t=e.year,a=e.month-1,n=e.day,s=e.hour||0,r=e.minute||0,i=e.second||0,o=e.millisecond||0,d=new Date(t,a,n,s,r,i,o);return d.getFullYear()!==t||d.getMonth()!==a||d.getDate()!==n?new Date(NaN):d}if(m(e)&&e.date instanceof Date)return new Date(e.date.getTime())}var t;return new Date(NaN)}valueOf(){return this._date.getTime()}toString(){return this._date.toString()}toISOString(){return this._date.toISOString()}offset(){return this._isUTC?0:-this._date.getTimezoneOffset()}toDate(){return new Date(this._date.getTime())}clone(){return new g(this._date)}year(e){if(void 0===e)return this._date.getFullYear();const t=this.clone();return t._date.setFullYear(e),t}month(e){if(void 0===e)return this._date.getMonth()+1;const t=this.clone();return t._date.setMonth(e-1),t}date(e){if(void 0===e)return this._date.getDate();const t=this.clone();return t._date.setDate(e),t}day(){return this._date.getDay()}hour(e){if(void 0===e)return this._date.getHours();const t=this.clone();return t._date.setHours(e),t}minute(e){if(void 0===e)return this._date.getMinutes();const t=this.clone();return t._date.setMinutes(e),t}second(e){if(void 0===e)return this._date.getSeconds();const t=this.clone();return t._date.setSeconds(e),t}millisecond(e){if(void 0===e)return this._date.getMilliseconds();const t=this.clone();return t._date.setMilliseconds(e),t}add(e,t){if(!this.isValid())return this.clone();const a=this.clone();switch(this.normalizeUnit(t)){case"year":a._date.setFullYear(a._date.getFullYear()+e);break;case"month":{const t=a._date.getDate();let n=a._date.getMonth()+e,s=a._date.getFullYear();for(;n<0;)n+=12,s--;for(;n>=12;)n-=12,s++;const r=new Date(s,n+1,0).getDate();a._date.setDate(1),a._date.setFullYear(s),a._date.setMonth(n),a._date.setDate(Math.min(t,r));break}case"week":a._date.setDate(a._date.getDate()+7*e);break;case"day":if(e%1!=0){const t=Math.floor(e),n=24*(e-t);a._date.setDate(a._date.getDate()+t),a._date.setHours(a._date.getHours()+n)}else a._date.setDate(a._date.getDate()+e);break;case"hour":a._date.setHours(a._date.getHours()+e);break;case"minute":a._date.setMinutes(a._date.getMinutes()+e);break;case"second":a._date.setSeconds(a._date.getSeconds()+e);break;case"millisecond":a._date.setMilliseconds(a._date.getMilliseconds()+e);break;default:h(`Unknown unit: ${t}`,"INVALID_UNIT")}return a}subtract(e,t){return this.add(-e,t)}startOf(e){const t=this.clone();switch(this.normalizeUnit(e)){case"year":t._date.setMonth(0,1),t._date.setHours(0,0,0,0);break;case"month":t._date.setDate(1),t._date.setHours(0,0,0,0);break;case"week":{const e=t._date.getDay();t._date.setDate(t._date.getDate()-e),t._date.setHours(0,0,0,0);break}case"day":t._date.setHours(0,0,0,0);break;case"hour":t._date.setMinutes(0,0,0);break;case"minute":t._date.setSeconds(0,0);break;case"second":t._date.setMilliseconds(0)}return t}endOf(e){const t=this.clone();switch(this.normalizeUnit(e)){case"year":t._date.setMonth(11,31),t._date.setHours(23,59,59,999);break;case"month":t._date.setMonth(t._date.getMonth()+1,0),t._date.setHours(23,59,59,999);break;case"week":{const e=t._date.getDay();t._date.setDate(t._date.getDate()+(6-e)),t._date.setHours(23,59,59,999);break}case"day":t._date.setHours(23,59,59,999);break;case"hour":t._date.setMinutes(59,59,999);break;case"minute":t._date.setSeconds(59,999);break;case"second":t._date.setMilliseconds(999)}return t}isValid(){return!isNaN(this._date.getTime())}isBefore(e){return this.valueOf()<e.valueOf()}isAfter(e){return this.valueOf()>e.valueOf()}isSame(e){return this.valueOf()===e.valueOf()}format(e="YYYY-MM-DD"){if(!this.isValid())return"Invalid Date";const t=this._isUTC,a=t?this._date.getUTCFullYear():this._date.getFullYear(),n=t?this._date.getUTCMonth()+1:this._date.getMonth()+1,s=t?this._date.getUTCDate():this._date.getDate(),r=t?this._date.getUTCHours():this._date.getHours(),i=t?this._date.getUTCMinutes():this._date.getMinutes(),o=t?this._date.getUTCSeconds():this._date.getSeconds();return isNaN(a)||isNaN(n)||isNaN(s)?"Invalid Date":e.replace(/YYYY/g,a.toString()).replace(/MM/g,n.toString().padStart(2,"0")).replace(/DD/g,s.toString().padStart(2,"0")).replace(/HH/g,r.toString().padStart(2,"0")).replace(/mm/g,i.toString().padStart(2,"0")).replace(/ss/g,o.toString().padStart(2,"0"))}normalizeUnit(e){return{y:"year",year:"year",years:"year",M:"month",month:"month",months:"month",w:"week",week:"week",weeks:"week",d:"day",day:"day",days:"day",h:"hour",hour:"hour",hours:"hour",m:"minute",minute:"minute",minutes:"minute",s:"second",second:"second",seconds:"second",ms:"millisecond",millisecond:"millisecond",milliseconds:"millisecond"}[e]||e}}g.config={locale:"en",strict:!1,suppressDeprecationWarnings:!1};class p{static use(e){const t=Array.isArray(e)?e:[e];for(const e of t)this.installPlugin(e);return D}static installPlugin(e){if(this.installedPlugins.has(e.name))return;if(e.dependencies)for(const t of e.dependencies)this.installedPlugins.has(t)||h(`Plugin ${e.name} depends on ${t} which is not installed`,"MISSING_DEPENDENCY");this.plugins.set(e.name,e),this.installedPlugins.add(e.name);const a={cache:f,memoize:t,validateInput:(e,t)=>{switch(t){case"date":return e instanceof Date&&!isNaN(e.getTime());case"number":return"number"==typeof e&&!isNaN(e);case"string":return"string"==typeof e;default:return!1}},throwError:h};e.install(D,a)}static extend(e){Object.assign(this.extensionMethods,e);for(const[t,a]of Object.entries(e))g.prototype[t]=a}static addStatic(e){Object.assign(this.staticMethods,e);for(const[t,a]of Object.entries(e))D[t]=a}static getPlugin(e){return this.plugins.get(e)}static isInstalled(e){return this.installedPlugins.has(e)}static getInstalledPlugins(){return Array.from(this.installedPlugins)}}p.plugins=new Map,p.installedPlugins=new Set,p.extensionMethods={},p.staticMethods={};const D=e=>new g(e);D.use=p.use.bind(p),D.extend=p.extend.bind(p),D.addStatic=p.addStatic.bind(p),D.plugins=p.plugins,D.utc=e=>{let t;if("string"!=typeof e||e.endsWith("Z")||e.includes("+")||/[+-]\d{2}:?\d{2}$/.test(e))t=new Date(e);else{const a=/^(\d{4})-(\d{2})-(\d{2})(?:\s+|T)(\d{2}):(\d{2})(?::(\d{2}))?$/,n=/^(\d{4})-(\d{2})-(\d{2})$/,s=e.match(a)||e.match(n);if(s){const e=parseInt(s[1],10),a=parseInt(s[2],10)-1,n=parseInt(s[3],10),r=s[4]?parseInt(s[4],10):0,i=s[5]?parseInt(s[5],10):0,o=s[6]?parseInt(s[6],10):0;t=new Date(Date.UTC(e,a,n,r,i,o))}else e=e.replace(" ","T")+"Z",t=new Date(e)}const a=new g(t);return a._isUTC=!0,a},D.unix=e=>new g(new Date(1e3*e));class w{constructor(){this.locales=new Map,this.currentLocale="en-US",this.defaultLocale="en-US"}static getInstance(){return w.instance||(w.instance=new w),w.instance}register(e,t){this.locales.set(e,t),1===this.locales.size&&(this.defaultLocale=e,this.currentLocale=e)}setLocale(e){return!!this.locales.has(e)&&(this.currentLocale=e,!0)}getLocale(e){const t=e||this.currentLocale;return this.locales.get(t)}getCurrentLocale(){return this.currentLocale}getDefaultLocale(){return this.defaultLocale}setDefaultLocale(e){return!!this.locales.has(e)&&(this.defaultLocale=e,!0)}getHolidays(e,t){const a=this.getLocale(e);if(!a)return[];if(t)switch(t){case"federal":return a.federalHolidays||[];case"state":return a.stateHolidays?Object.values(a.stateHolidays).flat():[];case"public":return a.publicHolidays||[];case"observances":return a.observances||[];default:if(a[t]&&Array.isArray(a[t]))return a[t]}return a.holidays||[]}getStateHolidays(e,t){const a=this.getLocale(t);if(!a||!a.stateHolidays)return[];const n=e.toLowerCase();return a.stateHolidays[n]||[]}getAllHolidays(e){const t=this.getLocale(e);if(!t)return[];const a=[];if(t.holidays&&a.push(...t.holidays),t.federalHolidays&&a.push(...t.federalHolidays),t.stateHolidays)for(const e of Object.values(t.stateHolidays))a.push(...e);t.publicHolidays&&a.push(...t.publicHolidays),t.observances&&a.push(...t.observances);const n=new Map;for(const e of a)n.has(e.name)||n.set(e.name,e);return Array.from(n.values())}getAvailableLocales(){return Array.from(this.locales.keys())}hasLocale(e){return this.locales.has(e)}clear(){this.locales.clear(),this.currentLocale="en-US",this.defaultLocale="en-US"}}const M=w.getInstance();const b=new class{constructor(){this.calculators=new Map,this.cache=n(),this.ruleCache=new Map,this.registerCalculators()}registerCalculators(){}registerCalculator(e,t){this.calculators.set(e,t)}calculate(e,t){const a=y(e);if(a.length>0)throw new Error(`Invalid holiday rule: ${a.join(", ")}`);this.ruleCache.has(e.name||"unnamed")||this.ruleCache.set(e.name||"unnamed",new Map);const n=this.ruleCache.get(e.name||"unnamed");if(n.has(t))return n.get(t);const s=this.calculators.get(e.type);if(!s)throw new Error(`Unknown holiday type: ${e.type}`);let r=s.calculate(e,t);return e.observedRule&&(r=this.applyObservedRules(r,e.observedRule)),e.duration&&e.duration>1&&(r=this.expandDuration(r,e.duration)),n.set(t,r),r}applyObservedRules(e,t){const a=[];for(const n of e){const e=n.getDay();if(t.weekends?.includes(e)||0===e||6===e)switch(t.type){case"substitute":a.push(this.findSubstituteDate(n,t));break;case"nearest-weekday":a.push(this.findNearestWeekday(n));break;case"bridge":a.push(n),a.push(this.findBridgeDate(n));break;default:a.push(n)}else a.push(n)}return a}findSubstituteDate(e,t){const a=t.direction||"forward",n=t.weekends||[0,6],s=new Date(e),r="forward"===a?1:-1;for(;n.includes(s.getDay());)s.setDate(s.getDate()+r);return s}findNearestWeekday(e){const t=e.getDay();return 0===t?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1):6===t?new Date(e.getFullYear(),e.getMonth(),e.getDate()-1):e}findBridgeDate(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+1)}expandDuration(e,t){const a=[];for(const n of e)for(let e=0;e<t;e++){const t=new Date(n);t.setDate(t.getDate()+e),a.push(t)}return a}isHoliday(e,t){const a=e.getFullYear();for(const n of t){if(!n.active&&void 0!==n.active)continue;const s=this.calculateWithContext(n,a,t);for(const t of s)if(this.isSameDay(e,t))return{id:n.id||n.name,name:n.name,type:n.type,date:t,regions:n.regions||[]}}return null}getHolidaysForYear(e,t){const a=[];for(const n of t){if(!n.active&&void 0!==n.active)continue;const s=this.calculateWithContext(n,e,t);for(const e of s)a.push({id:n.id||n.name,name:n.name,type:n.type,date:e,regions:n.regions||[]})}return a.sort((e,t)=>e.date.getTime()-t.date.getTime())}calculateWithContext(e,t,a){const n=y(e);if(n.length>0)throw new Error(`Invalid holiday rule: ${n.join(", ")}`);this.ruleCache.has(e.name||"unnamed")||this.ruleCache.set(e.name||"unnamed",new Map);const s=this.ruleCache.get(e.name||"unnamed");if(s.has(t))return s.get(t);const r=this.calculators.get(e.type);if(!r)throw new Error(`Unknown holiday type: ${e.type}`);let i;return i="relative"===e.type?r.calculate(e,t,{holidays:a}):r.calculate(e,t),e.observedRule&&(i=this.applyObservedRules(i,e.observedRule)),e.duration&&e.duration>1&&(i=this.expandDuration(i,e.duration)),s.set(t,i),i}getHolidaysInRange(e,t,a){const n=[],s=e.getFullYear(),r=t.getFullYear();for(let i=s;i<=r;i++){const s=this.getHolidaysForYear(i,a);for(const a of s)a.date>=e&&a.date<=t&&n.push(a)}return n}getNextHoliday(e,t){const a=e.getFullYear(),n=this.getHolidaysForYear(a,t);for(const t of n)if(t.date>e)return t;return this.getHolidaysForYear(a+1,t)[0]||null}getPreviousHoliday(e,t){const a=e.getFullYear(),n=this.getHolidaysForYear(a,t);for(let t=n.length-1;t>=0;t--){const a=n[t];if(a.date<e)return a}const s=this.getHolidaysForYear(a-1,t);return s[s.length-1]||null}isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}clearCache(){this.cache.clear(),this.ruleCache.clear()}};var x={name:"holiday-engine",version:"1.0.0",size:2048,install(e,t){e.extend({isHoliday(e){const t=e||M.getHolidays();return null!==b.isHoliday(this.toDate(),t)},getHolidayInfo(e){const t=e||M.getHolidays();return b.isHoliday(this.toDate(),t)},nextHoliday(t){const a=t||M.getHolidays(),n=b.getNextHoliday(this.toDate(),a);return n?e(n.date):null},previousHoliday(t){const a=t||M.getHolidays(),n=b.getPreviousHoliday(this.toDate(),a);return n?e(n.date):null},getHolidays:e=>M.getHolidays(void 0,e)}),e.addStatic?.({getYearHolidays:(e,t)=>b.getHolidaysForYear(e,t),getHolidaysInRange(t,a,n){const s=e(t).toDate(),r=e(a).toDate();return b.getHolidaysInRange(s,r,n)},holidayEngine:b})}};class Y{calculate(e,t){const{month:a,day:n}=e.rule,s=new Date(t,a-1,n);return s.getFullYear()!==t||s.getMonth()!==a-1||s.getDate()!==n?[]:[s]}}var k={name:"holiday-fixed-calculator",version:"1.0.0",size:256,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("fixed",new Y)}};class v{calculate(e,t){const{month:a,weekday:n,nth:s}=e.rule;return s>0?[this.getNthWeekdayOfMonth(t,a-1,n,s)]:[this.getLastNthWeekdayOfMonth(t,a-1,n,Math.abs(s))]}getNthWeekdayOfMonth(e,t,a,n){let s=a-new Date(e,t,1).getDay();s<0&&(s+=7);const r=new Date(e,t,1+s+7*(n-1));if(r.getMonth()!==t)throw new Error(`${n}${this.getOrdinalSuffix(n)} ${this.getWeekdayName(a)} of ${this.getMonthName(t)} ${e} does not exist`);return r}getLastNthWeekdayOfMonth(e,t,a,n){const s=new Date(e,t+1,0);let r=s.getDay()-a;r<0&&(r+=7);const i=s.getDate()-r-7*(n-1);if(i<1)throw new Error(`${n}${this.getOrdinalSuffix(n)} to last ${this.getWeekdayName(a)} of ${this.getMonthName(t)} ${e} does not exist`);return new Date(e,t,i)}getOrdinalSuffix(e){if(e>=11&&e<=13)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}}getWeekdayName(e){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e]||"Unknown"}getMonthName(e){return["January","February","March","April","May","June","July","August","September","October","November","December"][e]||"Unknown"}}var H={name:"holiday-nth-weekday-calculator",version:"1.0.0",size:512,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("nth-weekday",new v)}};class S{calculate(e,t){const{offset:a}=e.rule,n=this.calculateEaster(t),s=new Date(n);return s.setDate(s.getDate()+a),[s]}calculateEaster(e){if(e<1583)return this.calculateJulianEaster(e);const t=e%19,a=Math.floor(e/100),n=e%100,s=Math.floor(a/4),r=a%4,i=Math.floor((a+8)/25),o=(19*t+a-s-Math.floor((a-i+1)/3)+15)%30,d=(32+2*r+2*Math.floor(n/4)-o-n%4)%7,l=Math.floor((t+11*o+22*d)/451),u=Math.floor((o+d-7*l+114)/31)-1;return new Date(e,u,(o+d-7*l+114)%31+1)}calculateJulianEaster(e){const t=(19*(e%19)+15)%30,a=(2*(e%4)+4*(e%7)-t+34)%7,n=Math.floor((t+a+114)/31)-1,s=new Date(e,n,(t+a+114)%31+1),r=this.dateToJulianDay(s);return this.julianDayToDate(r)}dateToJulianDay(e){const t=e.getFullYear(),a=e.getMonth()+1,n=e.getDate(),s=Math.floor((14-a)/12),r=t+4800-s,i=a+12*s-3;return n+Math.floor((153*i+2)/5)+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)-32045}julianDayToDate(e){const t=e+32044,a=(4*t+3)/146097,n=t-Math.floor(146097*a/4),s=(4*n+3)/1461,r=n-Math.floor(1461*s/4),i=(5*r+2)/153,o=r-Math.floor((153*i+2)/5)+1,d=i+3-12*Math.floor(i/10),l=100*a+s-4800+Math.floor(i/10);return new Date(l,d-1,o)}calculateOrthodoxEaster(e){const t=(19*(e%19)+15)%30,a=(2*(e%4)+4*(e%7)-t+34)%7,n=Math.floor((t+a+114)/31),s=new Date(e,n-1,(t+a+114)%31+1),r=this.getJulianGregorianDifference(e),i=new Date(s);return i.setDate(i.getDate()+r),i}getJulianGregorianDifference(e){if(e<1583)return 0;const t=Math.floor(e/100);return t-Math.floor(t/4)-2}}var L={name:"holiday-easter-calculator",version:"1.0.0",size:1024,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("easter-based",new S),e.addStatic?.({getEaster(t){const a=(new S).calculateEaster(t);return e(a)},getOrthodoxEaster(t){const a=(new S).calculateOrthodoxEaster(t);return e(a)}})}};class F{constructor(){this.converters={islamic:new C,chinese:new T,hebrew:new I,persian:new j}}calculate(e,t){const{calendar:a,month:n,day:s}=e.rule,r=this.converters[a];if(!r)throw new Error(`Unknown lunar calendar: ${a}`);const i=this.getLunarYear(t,a);return[r.toGregorian(i,n,s)]}getLunarYear(e,t){switch(t){case"islamic":return Math.round(1.030684*(e-622));case"chinese":return e-2637;case"hebrew":return e+3761;case"persian":return e-622;default:return e}}}class C{toGregorian(e,t,a){const n=1948084+(354.36667*(e-1)+this.getIslamicMonthDays(t,e)+a-1);return this.julianDayToGregorian(n)}fromGregorian(e){const t=this.gregorianToJulianDay(e)-1948084,a=354.36667,n=Math.floor(t/a)+1;let s=1,r=t-(n-1)*a;for(;r>this.getIslamicMonthLength(s,n);)r-=this.getIslamicMonthLength(s,n),s++;return{year:n,month:s,day:Math.floor(r)}}getIslamicMonthDays(e,t){let a=0;for(let n=1;n<e;n++)a+=this.getIslamicMonthLength(n,t);return a}getIslamicMonthLength(e,t){return 12===e&&this.isIslamicLeapYear(t)?30:[30,29,30,29,30,29,30,29,30,29,30,29][e-1]||29}isIslamicLeapYear(e){return(11*e+14)%30<11}julianDayToGregorian(e){const t=e+32044,a=(4*t+3)/146097,n=t-Math.floor(146097*a/4),s=(4*n+3)/1461,r=n-Math.floor(1461*s/4),i=(5*r+2)/153,o=r-Math.floor((153*i+2)/5)+1,d=i+3-12*Math.floor(i/10),l=100*a+s-4800+Math.floor(i/10);return new Date(l,d-1,o)}gregorianToJulianDay(e){const t=e.getFullYear(),a=e.getMonth()+1,n=e.getDate(),s=Math.floor((14-a)/12),r=t+4800-s,i=a+12*s-3;return n+Math.floor((153*i+2)/5)+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)-32045}}class T{toGregorian(e,t,a){const n=e+2637,s=Math.floor(30*Math.random())+21,r=new Date(n,0,s),i=29.5*(t-1)+a-1,o=new Date(r);return o.setDate(o.getDate()+i),o}fromGregorian(e){return{year:e.getFullYear()-2637,month:e.getMonth()+1,day:e.getDate()}}}class I{toGregorian(e,t,a){const n=new Date(e-3761,8,15),s=29.5*(t-1)+a-1,r=new Date(n);return r.setDate(r.getDate()+s),r}fromGregorian(e){return{year:e.getFullYear()+3761,month:e.getMonth()+1,day:e.getDate()}}}class j{toGregorian(e,t,a){const n=new Date(e+622,2,21),s=30*(t-1)+a-1,r=new Date(n);return r.setDate(r.getDate()+s),r}fromGregorian(e){return{year:e.getFullYear()-622,month:e.getMonth()+1,day:e.getDate()}}}var E={name:"holiday-lunar-calculator",version:"1.0.0",size:2048,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("lunar",new F)}};class N{constructor(){this.holidayCache=new Map,this.allHolidays=[]}calculate(e,t,a){const{relativeTo:n,offset:s}=e.rule;a?.holidays&&(this.allHolidays=a.holidays);const r=this.findBaseHoliday(n);if(!r)throw new Error(`Base holiday '${n}' not found for relative rule '${e.name}'`);const i=this.calculateBaseHolidayDates(r,t),o=[];for(const e of i){const t=new Date(e);t.setDate(t.getDate()+s),o.push(t)}return o}findBaseHoliday(e){let t=this.allHolidays.find(t=>t.name===e);return t||(t=this.allHolidays.find(t=>t.id===e)),t||(t=this.allHolidays.find(t=>t.name.toLowerCase()===e.toLowerCase())),t||null}calculateBaseHolidayDates(e,t){if("relative"===e.type)throw new Error(`Circular dependency detected: ${e.name} cannot be relative to another relative holiday`);const a=`${e.name}-${t}`;if(this.holidayCache.has(a))return this.holidayCache.get(a);const n=this.calculateDirectHoliday(e,t);return this.holidayCache.set(a,n),n}calculateDirectHoliday(e,t){switch(e.type){case"fixed":return this.calculateFixed(e,t);case"nth-weekday":return this.calculateNthWeekday(e,t);case"easter-based":return this.calculateEasterBased(e,t);default:throw new Error(`Cannot calculate base holiday of type: ${e.type}`)}}calculateFixed(e,t){const{month:a,day:n}=e.rule,s=new Date(t,a-1,n);return s.getFullYear()!==t||s.getMonth()!==a-1||s.getDate()!==n?[]:[s]}calculateNthWeekday(e,t){const{month:a,weekday:n,nth:s}=e.rule;return s>0?[this.getNthWeekdayOfMonth(t,a-1,n,s)]:[this.getLastNthWeekdayOfMonth(t,a-1,n,Math.abs(s))]}calculateEasterBased(e,t){const{offset:a}=e.rule,n=this.calculateEaster(t),s=new Date(n);return s.setDate(s.getDate()+a),[s]}getNthWeekdayOfMonth(e,t,a,n){let s=a-new Date(e,t,1).getDay();s<0&&(s+=7);return new Date(e,t,1+s+7*(n-1))}getLastNthWeekdayOfMonth(e,t,a,n){const s=new Date(e,t+1,0);let r=s.getDay()-a;r<0&&(r+=7);const i=s.getDate()-r-7*(n-1);return new Date(e,t,i)}calculateEaster(e){const t=e%19,a=Math.floor(e/100),n=e%100,s=Math.floor(a/4),r=a%4,i=Math.floor((a+8)/25),o=(19*t+a-s-Math.floor((a-i+1)/3)+15)%30,d=(32+2*r+2*Math.floor(n/4)-o-n%4)%7,l=Math.floor((t+11*o+22*d)/451),u=Math.floor((o+d-7*l+114)/31)-1;return new Date(e,u,(o+d-7*l+114)%31+1)}clearCache(){this.holidayCache.clear()}}var O={name:"holiday-relative-calculator",version:"1.0.0",size:1024,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("relative",new N)}};class B{calculate(e,t,a){const{calculate:n}=e.rule;if("function"!=typeof n)throw new Error(`Custom rule '${e.name}' must have a calculate function`);try{const s=n(t,a);if(s instanceof Date)return[s];if(Array.isArray(s))return s.filter(e=>e instanceof Date);throw new Error(`Custom rule '${e.name}' must return Date or Date[]`)}catch(t){throw new Error(`Error calculating custom rule '${e.name}': ${t instanceof Error?t.message:String(t)}`)}}}const R={calculateVernalEquinox(e){const t=new Date(e,2,20),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},calculateAutumnalEquinox(e){const t=new Date(e,8,23),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},calculateSummerSolstice(e){const t=new Date(e,5,21),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},calculateWinterSolstice(e){const t=new Date(e,11,21),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t},findWeekdayInMonth(e,t,a,n){if("first"===n){let n=a-new Date(e,t,1).getDay();return n<0&&(n+=7),new Date(e,t,1+n)}{const n=new Date(e,t+1,0);let s=n.getDay()-a;return s<0&&(s+=7),new Date(e,t,n.getDate()-s)}},calculateNewMoon(e,t){const a=new Date(e,t,0).getDate(),n=Math.floor(.5*a);return new Date(e,t-1,n)},calculateFullMoon(e,t){const a=this.calculateNewMoon(e,t),n=new Date(a);return n.setDate(n.getDate()+14),n},getNextBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()+1);0===t.getDay()||6===t.getDay();)t.setDate(t.getDate()+1);return t},getPreviousBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()-1);0===t.getDay()||6===t.getDay();)t.setDate(t.getDate()-1);return t},getDateInTimezone:(e,t)=>new Date(e.toLocaleString("en-US",{timeZone:t})),getDSTTransition(e,t){return"spring"===t?this.findWeekdayInMonth(e,2,0,"first"):this.findWeekdayInMonth(e,10,0,"first")},calculateGoldenWeekSubstitutes(e){const t=[new Date(e,3,29),new Date(e,4,3),new Date(e,4,4),new Date(e,4,5)],a=[];for(const e of t){if(0===e.getDay()){const t=new Date(e);t.setDate(t.getDate()+1),a.push(t)}}return a},calculateQingming(e){const t=new Date(e,3,5),a=Math.floor(.24*(e-2e3));return t.setDate(t.getDate()+a),t}};var _={name:"holiday-custom-calculator",version:"1.0.0",size:1536,dependencies:["holiday-engine"],install(e,t){const a=e.holidayEngine;a&&a.registerCalculator("custom",new B),e.addStatic?.({customCalculatorUtils:R})}};class W{constructor(e={}){this.cache=new Map,this.config={weekends:[0,6],holidays:[],customRules:[],...e}}updateConfig(e){this.config={...this.config,...e},this.cache.clear()}isBusinessDay(e){const t=e.toISOString().split("T")[0];if(this.cache.has(t))return this.cache.get(t);const a=this.calculateIsBusinessDay(e);return this.cache.set(t,a),a}calculateIsBusinessDay(e){const t=e.getDay();if(this.config.weekends?.includes(t))return!1;if(this.config.holidays&&this.config.holidays.length>0){const t=globalThis.kairos?.holidayEngine;if(t){if(t.isHoliday(e,this.config.holidays))return!1}}if(this.config.customRules)for(const t of this.config.customRules)if(!t(e))return!1;return!0}nextBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()+1);!this.isBusinessDay(t);)t.setDate(t.getDate()+1);return t}previousBusinessDay(e){const t=new Date(e);for(t.setDate(t.getDate()-1);!this.isBusinessDay(t);)t.setDate(t.getDate()-1);return t}addBusinessDays(e,t){if(0===t)return new Date(e);const a=new Date(e);let n=0;const s=t>0?1:-1,r=Math.abs(t);for(;n<r;)a.setDate(a.getDate()+s),this.isBusinessDay(a)&&n++;return a}businessDaysBetween(e,t){const a=new Date(e),n=new Date(t);if(a.getTime()===n.getTime())return 0;const s=a<n?1:-1;let r=0;const i=new Date(a);for(;i.getTime()!==n.getTime();)i.setDate(i.getDate()+s),this.isBusinessDay(i)&&r++;return r*s}businessDaysInMonth(e,t){const a=new Date(e,t,1),n=new Date(e,t+1,0);return this.businessDaysBetween(a,n)+(this.isBusinessDay(a)?1:0)}businessDaysInYear(e){const t=new Date(e,0,1),a=new Date(e,11,31);return this.businessDaysBetween(t,a)+(this.isBusinessDay(t)?1:0)}settlementDate(e,t){return this.addBusinessDays(e,t)}getBusinessDaysInMonth(e,t){const a=[],n=new Date(e,t,1),s=new Date(e,t+1,0),r=new Date(n);for(;r<=s;)this.isBusinessDay(r)&&a.push(new Date(r)),r.setDate(r.getDate()+1);return a}getBusinessDaysInRange(e,t){const a=[],n=new Date(e);for(;n<=t;)this.isBusinessDay(n)&&a.push(new Date(n)),n.setDate(n.getDate()+1);return a}getNthBusinessDay(e,t,a){const n=new Date(e,t,1),s=new Date(e,t+1,0),r=new Date(n);let i=0;for(;r<=s;){if(this.isBusinessDay(r)&&(i++,i===a))return new Date(r);r.setDate(r.getDate()+1)}return null}getLastBusinessDay(e,t){const a=new Date(e,t+1,0),n=new Date(a);for(;n.getMonth()===t;){if(this.isBusinessDay(n))return new Date(n);n.setDate(n.getDate()-1)}return null}clearCache(){this.cache.clear()}}const $=new W;var A={name:"business-workday",version:"1.0.0",size:2048,dependencies:["holiday-engine"],install(e,t){e.extend({isBusinessDay(e){const t=e?new W(e):$;if(!e?.holidays&&this.getHolidays){const e=this.getHolidays();t.updateConfig({holidays:e})}return t.isBusinessDay(this.toDate())},isWeekend(){const e=this.day();return 0===e||6===e},nextBusinessDay(t){const a=t?new W(t):$;if(!t?.holidays&&this.getHolidays){const e=this.getHolidays();a.updateConfig({holidays:e})}const n=a.nextBusinessDay(this.toDate());return e(n)},previousBusinessDay(t){const a=t?new W(t):$;if(!t?.holidays&&this.getHolidays){const e=this.getHolidays();a.updateConfig({holidays:e})}const n=a.previousBusinessDay(this.toDate());return e(n)},addBusinessDays(t,a){const n=a?new W(a):$;if(!a?.holidays&&this.getHolidays){const e=this.getHolidays();n.updateConfig({holidays:e})}const s=n.addBusinessDays(this.toDate(),t);return e(s)},businessDaysBetween(e,t){const a=t?new W(t):$;if(!t?.holidays&&this.getHolidays){const e=this.getHolidays();a.updateConfig({holidays:e})}return a.businessDaysBetween(this.toDate(),e.toDate())},businessDaysInMonth(e){const t=e?new W(e):$;if(!e?.holidays&&this.getHolidays){const e=this.getHolidays();t.updateConfig({holidays:e})}return t.businessDaysInMonth(this.year(),this.month()-1)},settlementDate(t,a){const n=a?new W(a):$;if(!a?.holidays&&this.getHolidays){const e=this.getHolidays();n.updateConfig({holidays:e})}const s=n.settlementDate(this.toDate(),t);return e(s)},isWorkingHour(e=9,t=17){const a=this.hour();return this.isBusinessDay()&&a>=e&&a<t}}),e.addStatic?.({businessDayCalculator:$,createBusinessDayCalculator:e=>new W(e),getBusinessDaysInMonth:(t,a,n)=>(n?new W(n):$).getBusinessDaysInMonth(t,a-1).map(t=>e(t)),getBusinessDaysInRange(t,a,n){const s=n?new W(n):$,r=e(t).toDate(),i=e(a).toDate();return s.getBusinessDaysInRange(r,i).map(t=>e(t))},getNthBusinessDay(t,a,n,s){const r=(s?new W(s):$).getNthBusinessDay(t,a-1,n);return r?e(r):null},getLastBusinessDay(t,a,n){const s=(n?new W(n):$).getLastBusinessDay(t,a-1);return s?e(s):null},businessDaysInYear:(e,t)=>(t?new W(t):$).businessDaysInYear(e)})}};class q{constructor(e){this.config=e}getStartMonth(){if("number"==typeof this.config.start)return this.config.start;const e=["january","february","march","april","may","june","july","august","september","october","november","december"].indexOf(this.config.start.toLowerCase());return-1===e?1:e+1}getFiscalYear(e){const t=this.getStartMonth(),a=e.getFullYear();return e.getMonth()+1>=t?a:a-1}getFiscalYearStart(e){const t=this.getStartMonth();return new Date(e,t-1,1)}getFiscalYearEnd(e){const t=this.getStartMonth(),a=1===t?12:t-1,n=1===t?e:e+1,s=new Date(n,a,0).getDate();return new Date(n,a-1,s)}getFiscalQuarter(e){const t=this.getStartMonth();let a=e.getMonth()+1-t;return a<0&&(a+=12),Math.floor(a/3)+1}getFiscalQuarterStart(e,t){const a=this.getStartMonth();return new Date(1===t?e:a+3*(t-1)>12?e+1:e,(a-1+3*(t-1))%12,1)}getFiscalQuarterEnd(e,t){const a=this.getStartMonth(),n=(a-1+3*t-1)%12,s=1===t?e:a+3*t-1>12?e+1:e,r=new Date(s,n+1,0).getDate();return new Date(s,n,r)}getDaysInFiscalYear(e){const t=this.getFiscalYearStart(e),a=this.getFiscalYearEnd(e);return Math.floor((a.getTime()-t.getTime())/864e5)+1}getDaysInFiscalQuarter(e,t){const a=this.getFiscalQuarterStart(e,t),n=this.getFiscalQuarterEnd(e,t);return Math.floor((n.getTime()-a.getTime())/864e5)+1}getFiscalWeek(e){const t=this.getFiscalYear(e),a=this.getFiscalYearStart(t),n=e.getTime()-a.getTime(),s=Math.floor(n/864e5);return Math.floor(s/7)+1}static getCommonConfigs(){return{US:{start:10},UK:{start:4},Canada:{start:4},Australia:{start:7},India:{start:4},Japan:{start:4},Germany:{start:1},France:{start:1},China:{start:1},Brazil:{start:1},Russia:{start:1},"South Korea":{start:1},Singapore:{start:4},"Hong Kong":{start:4},"New Zealand":{start:4},Mexico:{start:1},"South Africa":{start:3},Turkey:{start:1},Israel:{start:1},"Saudi Arabia":{start:1},UAE:{start:1},Egypt:{start:7},Nigeria:{start:1},Kenya:{start:7},"Corporate-Q1":{start:1},"Corporate-Q2":{start:4},"Corporate-Q3":{start:7},"Corporate-Q4":{start:10},"Academic-US":{start:8},"Academic-UK":{start:9},"Retail-US":{start:2},"Retail-4-5-4":{start:2}}}}var z={name:"business-fiscal",version:"1.0.0",size:1536,dependencies:["business-workday"],install(e,t){e.extend({fiscalYear(e){return new q(e||{start:1}).getFiscalYear(this.toDate())},fiscalYearStart(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalYearStart(n);return e(s)},fiscalYearEnd(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalYearEnd(n);return e(s)},fiscalQuarter(e){return new q(e||{start:1}).getFiscalQuarter(this.toDate())},fiscalQuarterStart(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalQuarter(this.toDate()),r=a.getFiscalQuarterStart(n,s);return e(r)},fiscalQuarterEnd(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalQuarter(this.toDate()),r=a.getFiscalQuarterEnd(n,s);return e(r)},fiscalWeek(e){return new q(e||{start:1}).getFiscalWeek(this.toDate())},isFiscalYearStart(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalYearStart(n);return this.isSame(e(s))},isFiscalYearEnd(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalYearEnd(n);return this.isSame(e(s))},isFiscalQuarterStart(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalQuarter(this.toDate()),r=a.getFiscalQuarterStart(n,s);return this.isSame(e(r))},isFiscalQuarterEnd(t){const a=new q(t||{start:1}),n=a.getFiscalYear(this.toDate()),s=a.getFiscalQuarter(this.toDate()),r=a.getFiscalQuarterEnd(n,s);return this.isSame(e(r))}}),e.addStatic?.({fiscalYearCalculator:q,getFiscalYearConfig:e=>q.getCommonConfigs()[e]||null,getAvailableFiscalConfigs:()=>Object.keys(q.getCommonConfigs()),createFiscalCalculator:e=>new q(e),getFiscalYearInfo(t,a){const n=new q(a||{start:1});return{fiscalYear:t,start:e(n.getFiscalYearStart(t)),end:e(n.getFiscalYearEnd(t)),days:n.getDaysInFiscalYear(t),quarters:[1,2,3,4].map(a=>({quarter:a,start:e(n.getFiscalQuarterStart(t,a)),end:e(n.getFiscalQuarterEnd(t,a)),days:n.getDaysInFiscalQuarter(t,a)}))}},getBusinessDaysInFiscalYear(t,a){const n=new q(a||{start:1}),s=n.getFiscalYearStart(t),r=n.getFiscalYearEnd(t),i=e.businessDayCalculator;return i.businessDaysBetween(s,r)+(i.isBusinessDay(s)?1:0)}})}};const P={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},U={en:P,"en-US":P,"en-GB":P,de:{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"eine Minute",mm:"%d Minuten",h:"eine Stunde",hh:"%d Stunden",d:"ein Tag",dd:"%d Tage",M:"ein Monat",MM:"%d Monate",y:"ein Jahr",yy:"%d Jahre"},"de-DE":{future:"in %s",past:"vor %s",s:"ein paar Sekunden",m:"eine Minute",mm:"%d Minuten",h:"eine Stunde",hh:"%d Stunden",d:"ein Tag",dd:"%d Tage",M:"ein Monat",MM:"%d Monate",y:"ein Jahr",yy:"%d Jahre"},tr:{future:"%s içinde",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},"tr-TR":{future:"%s içinde",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ja:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"},"ja-JP":{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};class J{constructor(e="en"){this.locale=U[e]||U[e.split("-")[0]]||P}format(e,t=!1){const a=Math.abs(e),n=Math.round(a/1e3),s=Math.round(n/60),r=Math.round(s/60),i=Math.round(r/24),o=Math.round(i/30.436875),d=Math.round(i/365.25);let l;if(l=n<45?this.locale.s:n<90?this.locale.m:s<45?this.locale.mm.replace("%d",s.toString()):s<90?this.locale.h:r<22?this.locale.hh.replace("%d",r.toString()):r<36?this.locale.d:i<26?this.locale.dd.replace("%d",i.toString()):i<46?this.locale.M:i<320?this.locale.MM.replace("%d",o.toString()):i<548?this.locale.y:this.locale.yy.replace("%d",d.toString()),t)return l;return(e>0?this.locale.future:this.locale.past).replace("%s",l)}formatNative(e,t="en",a={}){if("undefined"!=typeof Intl&&Intl.RelativeTimeFormat){const n=new Intl.RelativeTimeFormat(t,{numeric:a.numeric||"auto",style:a.style||"long"}),s=Math.abs(e)/1e3,r=s/60,i=r/60,o=i/24,d=o/7,l=o/30.436875,u=o/365.25,c=e>0?1:-1;return u>=1?n.format(c*Math.round(u),"year"):l>=1?n.format(c*Math.round(l),"month"):d>=1?n.format(c*Math.round(d),"week"):o>=1?n.format(c*Math.round(o),"day"):i>=1?n.format(c*Math.round(i),"hour"):r>=1?n.format(c*Math.round(r),"minute"):n.format(c*Math.round(s),"second")}return this.format(e)}}const G={name:"relativeTime",install(e){e.extend({fromNow(e=!1){const t=Date.now(),a=this.valueOf()-t;return(new J).format(a,e)},from(e,t=!1){const a=this.valueOf()-e.valueOf();return(new J).format(a,t)},toNow(e=!1){const t=Date.now()-this.valueOf();return(new J).format(t,e)},to(e,t=!1){const a=this.valueOf(),n=e.valueOf()-a;return(new J).format(n,t)},humanize(e=!1){const t=new J,a=this.valueOf();return t.format(a,!e)},fromNowNative(e="en",t){const a=Date.now(),n=this.valueOf()-a;return(new J).formatNative(n,e,t)},toNowNative(e="en",t){const a=Date.now()-this.valueOf();return(new J).formatNative(a,e,t)}}),e.addStatic({relativeTime:{registerLocale(e,t){U[e]=t},getLocale:e=>U[e],calculator:e=>new J(e)}})}};class Q{static getISOWeek(e){const t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+4-(t.getDay()||7));const a=new Date(t.getFullYear(),0,1);return Math.ceil(((t.getTime()-a.getTime())/864e5+1)/7)}static getISOWeekYear(e){const t=new Date(e.getTime());return t.setDate(t.getDate()+4-(t.getDay()||7)),t.getFullYear()}static getWeek(e,t=0){const a=new Date(e.getTime());a.setHours(0,0,0,0);const n=new Date(a.getFullYear(),0,1);n.setHours(0,0,0,0);const s=(t-n.getDay()+7)%7,r=new Date(n);s>0&&r.setDate(n.getDate()+s-7);const i=Math.floor((a.getTime()-r.getTime())/864e5),o=Math.floor(i/7)+1;if(o<1){const e=new Date(a.getFullYear()-1,11,31);return this.getWeek(e,t)}return o}static getQuarter(e){return Math.floor(e.getMonth()/3)+1}static getDayOfYear(e){const t=new Date(e.getFullYear(),0,0),a=e.getTime()-t.getTime();return Math.floor(a/864e5)}static getDaysInMonth(e){return new Date(e.getFullYear(),e.getMonth()+1,0).getDate()}static getDaysInYear(e){return this.isLeapYear(e)?366:365}static isLeapYear(e){return e%4==0&&e%100!=0||e%400==0}static getWeekOfMonth(e,t=0){const a=(new Date(e.getFullYear(),e.getMonth(),1).getDay()-t+7)%7,n=e.getDate();return Math.ceil((n+a)/7)}static getCalendarInfo(e){const t=e.getFullYear();return{year:t,quarter:this.getQuarter(e),month:e.getMonth()+1,week:this.getWeek(e),weekYear:t,isoWeek:this.getISOWeek(e),isoWeekYear:this.getISOWeekYear(e),dayOfYear:this.getDayOfYear(e),dayOfWeek:e.getDay(),daysInMonth:this.getDaysInMonth(e),daysInYear:this.getDaysInYear(t),isLeapYear:this.isLeapYear(t),weekOfMonth:this.getWeekOfMonth(e)}}}const K={name:"calendar",install(e){e.extend({quarter(e){const t=Q.getQuarter(this.toDate());if(void 0===e)return t;if(e<1||e>4)throw new Error("Quarter must be between 1 and 4");const a=3*(e-1)+1;return this.clone().month(a)},week(e){const t=Q.getWeek(this.toDate());if(void 0===e)return t;const a=e-t;return this.clone().add(7*a,"days")},isoWeek(e){const t=Q.getISOWeek(this.toDate());if(void 0===e)return t;const a=e-t;return this.clone().add(7*a,"days")},isoWeekYear(){return Q.getISOWeekYear(this.toDate())},weekYear(){return this.year()},dayOfYear(t){const a=Q.getDayOfYear(this.toDate());if(void 0===t)return a;const n=this.clone(),s=new Date(n.year(),0,1);return s.setDate(t),e(s)},daysInMonth(){return Q.getDaysInMonth(this.toDate())},daysInYear(){return Q.getDaysInYear(this.year())},isLeapYear(){return Q.isLeapYear(this.year())},weekOfMonth(){return Q.getWeekOfMonth(this.toDate())},calendarInfo(){return Q.getCalendarInfo(this.toDate())},startOfQuarter(){const t=3*(this.quarter()-1);return e(new Date(this.year(),t,1)).startOf("day")},endOfQuarter(){const t=3*this.quarter();return e(new Date(this.year(),t,0)).endOf("day")},startOfWeek(e=0){const t=this.clone(),a=t.day(),n=(a<e?-7:0)+e-a;return t.add(n,"days").startOf("day")},endOfWeek(e=0){const t=this.clone(),a=t.day(),n=(a<e?-7:0)+e-a+6;return t.add(n,"days").endOf("day")},startOfISOWeek(){return this.startOfWeek(1)},endOfISOWeek(){return this.endOfWeek(1)},isWeekend(){const e=this.day();return 0===e||6===e},isWeekday(){return!this.isWeekend()},isSameQuarter(e){return this.quarter()===e.quarter()&&this.year()===e.year()},isSameWeek(e,t=0){const a=this.startOfWeek(t),n=e.startOfWeek(t);return a.format("YYYY-MM-DD")===n.format("YYYY-MM-DD")},isSameISOWeek(e){return this.isoWeek()===e.isoWeek()&&this.isoWeekYear()===e.isoWeekYear()},weeksInYear(){const t=e(new Date(this.year(),11,31));return Q.getWeek(t.toDate())},isoWeeksInYear(){const e=this.year(),t=Q.getISOWeek(new Date(e,11,31));return 1===t?Q.getISOWeek(new Date(e,11,24)):t}}),e.addStatic({calendar:Q})}},V=[{id:"new-years-day",name:"New Year's Day",type:"fixed",rule:{month:1,day:1},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"independence-day",name:"Independence Day",type:"fixed",rule:{month:7,day:4},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"veterans-day",name:"Veterans Day",type:"fixed",rule:{month:11,day:11},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"juneteenth",name:"Juneteenth",type:"fixed",rule:{month:6,day:19},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"christmas-day",name:"Christmas Day",type:"fixed",rule:{month:12,day:25},observedRule:{type:"substitute",weekends:[0,6],direction:"forward"}},{id:"martin-luther-king-day",name:"Martin Luther King Jr. Day",type:"nth-weekday",rule:{month:1,weekday:1,nth:3}},{id:"presidents-day",name:"Presidents' Day",type:"nth-weekday",rule:{month:2,weekday:1,nth:3}},{id:"mothers-day",name:"Mother's Day",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{id:"memorial-day",name:"Memorial Day",type:"nth-weekday",rule:{month:5,weekday:1,nth:-1}},{id:"fathers-day",name:"Father's Day",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{id:"labor-day",name:"Labor Day",type:"nth-weekday",rule:{month:9,weekday:1,nth:1}},{id:"columbus-day",name:"Columbus Day",type:"nth-weekday",rule:{month:10,weekday:1,nth:2}},{id:"thanksgiving",name:"Thanksgiving",type:"nth-weekday",rule:{month:11,weekday:4,nth:4}},{id:"black-friday",name:"Black Friday",type:"relative",rule:{relativeTo:"thanksgiving",offset:1}},{id:"good-friday",name:"Good Friday",type:"easter-based",rule:{offset:-2}},{id:"easter-sunday",name:"Easter Sunday",type:"easter-based",rule:{offset:0}},{id:"easter-monday",name:"Easter Monday",type:"easter-based",rule:{offset:1}}],Z={texas:[{id:"texas-independence-day",name:"Texas Independence Day",type:"fixed",rule:{month:3,day:2},regions:["TX"]},{id:"juneteenth",name:"Juneteenth",type:"fixed",rule:{month:6,day:19},regions:["TX"]},{id:"lyndon-b-johnson-day",name:"Lyndon B. Johnson Day",type:"fixed",rule:{month:8,day:27},regions:["TX"]}],california:[{id:"cesar-chavez-day",name:"Cesar Chavez Day",type:"fixed",rule:{month:3,day:31},regions:["CA"]}],hawaii:[{id:"prince-kuhio-day",name:"Prince Kuhio Day",type:"fixed",rule:{month:3,day:26},regions:["HI"]},{id:"kamehameha-day",name:"Kamehameha Day",type:"fixed",rule:{month:6,day:11},regions:["HI"]},{id:"statehood-day",name:"Statehood Day",type:"nth-weekday",rule:{month:8,weekday:5,nth:3},regions:["HI"]}],massachusetts:[{id:"patriots-day",name:"Patriots' Day",type:"nth-weekday",rule:{month:4,weekday:1,nth:3},regions:["MA"]}],maine:[{id:"patriots-day",name:"Patriots' Day",type:"nth-weekday",rule:{month:4,weekday:1,nth:3},regions:["ME"]}]},X=V.filter(e=>["new-years-day","martin-luther-king-day","presidents-day","memorial-day","juneteenth","independence-day","labor-day","columbus-day","veterans-day","thanksgiving","christmas-day"].includes(e.id)),ee=[...V,...Object.values(Z).flat()],te={name:"English (United States)",code:"en-US",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],weekdaysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},ordinal:e=>{if(e>=11&&e<=13)return`${e}th`;switch(e%10){case 1:return`${e}st`;case 2:return`${e}nd`;case 3:return`${e}rd`;default:return`${e}th`}},meridiem:(e,t,a)=>{const n=e<12?"AM":"PM";return a?n.toLowerCase():n}};var ae={name:"locale-en-US",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:te,install(e,t){M.register("en-US",{...te,holidays:V,federalHolidays:X,stateHolidays:Z}),e.locales=e.locales||{},e.locales["en-US"]=te,e.extend({getUSHolidays(e){if(e){const t=e.toLowerCase(),a=Z[t];if(a)return[...X,...a]}return V},getFederalHolidays:()=>X,getStateHolidays:e=>Z[e.toLowerCase()]||[],getAllUSHolidays:()=>ee}),e.addStatic?.({locale(t){if(void 0===t)return M.getCurrentLocale();if(M.setLocale(t))return e.currentLocale=t,e;throw new Error(`Locale '${t}' not found`)},getAvailableLocales:()=>Object.keys(e.locales||{})}),e.currentLocale="en-US"}};const ne=[{id:"new-years-day",name:"Yılbaşı",type:"fixed",rule:{month:1,day:1}},{id:"national-sovereignty-day",name:"Ulusal Egemenlik ve Çocuk Bayramı",type:"fixed",rule:{month:4,day:23}},{id:"labor-day",name:"Emek ve Dayanışma Günü",type:"fixed",rule:{month:5,day:1}},{id:"ataturk-commemoration-day",name:"Atatürk'ü Anma, Gençlik ve Spor Bayramı",type:"fixed",rule:{month:5,day:19}},{id:"democracy-day",name:"Demokrasi ve Milli Birlik Günü",type:"fixed",rule:{month:7,day:15}},{id:"victory-day",name:"Zafer Bayramı",type:"fixed",rule:{month:8,day:30}},{id:"republic-day",name:"Cumhuriyet Bayramı",type:"fixed",rule:{month:10,day:29}},{id:"ramadan-feast",name:"Ramazan Bayramı",type:"custom",rule:{calculate:e=>{const t={2024:{month:4,day:10},2025:{month:3,day:30},2023:{month:4,day:21}}[e]||{month:4,day:15};return[new Date(e,t.month-1,t.day),new Date(e,t.month-1,t.day+1),new Date(e,t.month-1,t.day+2)]}},duration:3},{id:"sacrifice-feast",name:"Kurban Bayramı",type:"custom",rule:{calculate:e=>{const t={2024:{month:6,day:16},2025:{month:6,day:6},2023:{month:6,day:28}}[e]||{month:6,day:20};return[new Date(e,t.month-1,t.day),new Date(e,t.month-1,t.day+1),new Date(e,t.month-1,t.day+2),new Date(e,t.month-1,t.day+3)]}},duration:4},{id:"mawlid",name:"Mevlid Kandili",type:"lunar",rule:{calendar:"islamic",month:3,day:12}},{id:"regaib-night",name:"Regaib Kandili",type:"custom",rule:{calculate:e=>{const t=new Date(e,1,15),a=new Date(t);for(;4!==a.getDay();)a.setDate(a.getDate()+1);return a}}},{id:"miraj-night",name:"Mirac Kandili",type:"lunar",rule:{calendar:"islamic",month:7,day:27}},{id:"laylat-al-baraat",name:"Berat Kandili",type:"lunar",rule:{calendar:"islamic",month:8,day:15}},{id:"laylat-al-qadr",name:"Kadir Gecesi",type:"lunar",rule:{calendar:"islamic",month:9,day:27}},{id:"arafat-day",name:"Arefe Günü",type:"lunar",rule:{calendar:"islamic",month:12,day:9}}],se=[{id:"ashura",name:"Aşure Günü",type:"lunar",rule:{calendar:"islamic",month:1,day:10}},{id:"isra-and-miraj",name:"İsra ve Mirac",type:"lunar",rule:{calendar:"islamic",month:7,day:27}},{id:"shab-e-barat",name:"Berat Kandili",type:"lunar",rule:{calendar:"islamic",month:8,day:15}}],re=[{id:"conquest-of-istanbul",name:"İstanbul'un Fethi",type:"fixed",rule:{month:5,day:29},active:!1},{id:"gallipoli-victory",name:"Çanakkale Zaferi",type:"fixed",rule:{month:3,day:18},active:!1}],ie=[...ne,...se,...re],oe=ne.filter(e=>["new-years-day","national-sovereignty-day","labor-day","ataturk-commemoration-day","democracy-day","victory-day","republic-day","ramadan-feast","sacrifice-feast"].includes(e.id)),de={name:"Türkçe (Türkiye)",code:"tr-TR",months:["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık"],monthsShort:["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"],weekdays:["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],weekdaysShort:["Paz","Pzt","Sal","Çar","Per","Cum","Cmt"],weekdaysMin:["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:e=>{if(1===e)return`${e}'inci`;if(2===e)return`${e}'nci`;if(3===e)return`${e}'üncü`;if(4===e)return`${e}'üncü`;if(5===e)return`${e}'inci`;if(6===e)return`${e}'ncı`;if(7===e)return`${e}'nci`;if(8===e)return`${e}'inci`;if(9===e)return`${e}'uncu`;if(10===e)return`${e}'uncu`;const t=e%100;if(t>=11&&t<=13)return`${e}'üncü`;switch(e%10){case 1:case 5:case 8:return`${e}'inci`;case 2:case 7:return`${e}'nci`;case 3:case 4:default:return`${e}'üncü`;case 6:return`${e}'ncı`;case 9:case 0:return`${e}'uncu`}},meridiem:(e,t,a)=>""};var le={name:"locale-tr-TR",version:"1.0.0",size:1536,dependencies:["holiday-engine"],locale:de,install(e,t){M.register("tr-TR",{...de,holidays:ne,publicHolidays:oe,observances:se,historicalHolidays:re}),e.locales=e.locales||{},e.locales["tr-TR"]=de,e.extend({getTurkishHolidays(e){switch(e){case"public":return oe;case"religious":return ne.filter(e=>"lunar"===e.type||"custom"===e.type);case"historical":return re;case"all":return ie;default:return ne}},getPublicHolidays:()=>oe,getReligiousHolidays:()=>ne.filter(e=>"lunar"===e.type||"custom"===e.type),getObservances:()=>se,isReligiousHoliday(){const e=this.getHolidayInfo();return!!e&&("lunar"===e.type||"custom"===e.type)},isPublicHoliday(){return null!==this.getHolidayInfo(oe)},formatTurkish(e){const t=e||"D MMMM YYYY, dddd";return this.format(t)}}),e.addStatic?.({getRamazanBayrami(t){const a=ne.find(e=>"ramadan-feast"===e.id);if(a){return e.holidayEngine.calculate(a,t).map(t=>e(t))}return[]},getKurbanBayrami(t){const a=ne.find(e=>"sacrifice-feast"===e.id);if(a){return e.holidayEngine.calculate(a,t).map(t=>e(t))}return[]},getKandilGecesi(t){const a=ne.filter(e=>e.name.includes("Kandil")||e.name.includes("Kadir")),n=[];for(const s of a){const a=e.holidayEngine.calculate(s,t);n.push(...a.map(t=>({date:e(t),name:s.name})))}return n.sort((e,t)=>e.date.valueOf()-t.date.valueOf())}})}};const ue=[{id:"new-years-day",name:"Neujahr",type:"fixed",rule:{month:1,day:1}},{id:"labor-day",name:"Tag der Arbeit",type:"fixed",rule:{month:5,day:1}},{id:"german-unity-day",name:"Tag der Deutschen Einheit",type:"fixed",rule:{month:10,day:3}},{id:"christmas-day",name:"1. Weihnachtstag",type:"fixed",rule:{month:12,day:25}},{id:"boxing-day",name:"2. Weihnachtstag",type:"fixed",rule:{month:12,day:26}},{id:"good-friday",name:"Karfreitag",type:"easter-based",rule:{offset:-2}},{id:"easter-sunday",name:"Ostersonntag",type:"easter-based",rule:{offset:0}},{id:"easter-monday",name:"Ostermontag",type:"easter-based",rule:{offset:1}},{id:"ascension-day",name:"Christi Himmelfahrt",type:"easter-based",rule:{offset:39}},{id:"whit-sunday",name:"Pfingstsonntag",type:"easter-based",rule:{offset:49}},{id:"whit-monday",name:"Pfingstmontag",type:"easter-based",rule:{offset:50}}],ce={"baden-württemberg":[{id:"epiphany",name:"Heilige Drei Könige",type:"fixed",rule:{month:1,day:6},regions:["BW"]},{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["BW"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["BW"]}],bavaria:[{id:"epiphany",name:"Heilige Drei Könige",type:"fixed",rule:{month:1,day:6},regions:["BY"]},{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["BY"]},{id:"assumption-day",name:"Mariä Himmelfahrt",type:"fixed",rule:{month:8,day:15},regions:["BY"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["BY"]}],berlin:[{id:"womens-day",name:"Internationaler Frauentag",type:"fixed",rule:{month:3,day:8},regions:["BE"]}],brandenburg:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["BB"]}],bremen:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["HB"]}],hamburg:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["HH"]}],hesse:[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["HE"]}],"lower-saxony":[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["NI"]}],"mecklenburg-vorpommern":[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["MV"]}],"north-rhine-westphalia":[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["NW"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["NW"]}],"rhineland-palatinate":[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["RP"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["RP"]}],saarland:[{id:"corpus-christi",name:"Fronleichnam",type:"easter-based",rule:{offset:60},regions:["SL"]},{id:"assumption-day",name:"Mariä Himmelfahrt",type:"fixed",rule:{month:8,day:15},regions:["SL"]},{id:"all-saints-day",name:"Allerheiligen",type:"fixed",rule:{month:11,day:1},regions:["SL"]}],saxony:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["SN"]},{id:"repentance-day",name:"Buß- und Bettag",type:"custom",rule:{calculate:e=>{const t=(new Date(e,10,23).getDay()+4)%7;return new Date(e,10,23-t)}},regions:["SN"]}],"saxony-anhalt":[{id:"epiphany",name:"Heilige Drei Könige",type:"fixed",rule:{month:1,day:6},regions:["ST"]},{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["ST"]}],"schleswig-holstein":[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["SH"]}],thuringia:[{id:"reformation-day",name:"Reformationstag",type:"fixed",rule:{month:10,day:31},regions:["TH"]}]},ye=ue,he=[...ue,...Object.values(ce).flat()],me=[{id:"day-of-german-unity-old",name:"Tag der deutschen Einheit (alt)",type:"fixed",rule:{month:6,day:17},active:!1},{id:"reformation-day-2017",name:"Reformationstag 2017",type:"fixed",rule:{month:10,day:31},active:!1}],fe={name:"Deutsch (Deutschland)",code:"de-DE",months:["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],monthsShort:["Jan","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],weekdaysShort:["So","Mo","Di","Mi","Do","Fr","Sa"],weekdaysMin:["So","Mo","Di","Mi","Do","Fr","Sa"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},ordinal:e=>`${e}.`,meridiem:(e,t,a)=>""};var ge={name:"locale-de-DE",version:"1.0.0",size:2048,dependencies:["holiday-engine"],locale:fe,install(e,t){M.register("de-DE",{...fe,holidays:ue,federalHolidays:ye,stateHolidays:ce,historicalHolidays:me}),e.locales=e.locales||{},e.locales["de-DE"]=fe,e.extend({getGermanHolidays(e){if(e){const t=e.toLowerCase(),a=ce[t];if(a)return[...ye,...a]}return ue},getFederalHolidays:()=>ye,getStateHolidays:e=>ce[e.toLowerCase()]||[],getAllHolidays:()=>he,getHistoricalHolidays:()=>me,isEasterHoliday(){const e=this.getHolidayInfo();return!!e&&"easter-based"===e.type},isCatholicHoliday(){const e=this.getHolidayInfo();return!!e&&["epiphany","corpus-christi","assumption-day","all-saints-day"].includes(e.id)},isProtestantHoliday(){const e=this.getHolidayInfo();return!!e&&["reformation-day","repentance-day"].includes(e.id)},formatGerman(e){const t=e||"dddd, D. MMMM YYYY";return this.format(t)}}),e.addStatic?.({getEasterHolidays(t){const a=ue.filter(e=>"easter-based"===e.type),n=[];for(const s of a){const a=e.holidayEngine.calculate(s,t);n.push(...a.map(t=>({date:e(t),name:s.name,id:s.id})))}return n.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getBusBettag(t){const a=ce.saxony.find(e=>"repentance-day"===e.id);if(a){const n=e.holidayEngine.calculate(a,t);return n.length>0?e(n[0]):null}return null},getStateHolidaysForYear(t,a){const n=ce[t.toLowerCase()];if(!n)return[];const s=[];for(const t of n){const n=e.holidayEngine.calculate(t,a);s.push(...n.map(a=>({date:e(a),name:t.name,id:t.id})))}return s.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getAvailableStates:()=>Object.keys(ce)})}};const pe=[{id:"new-years-day",name:"元日",type:"fixed",rule:{month:1,day:1}},{id:"coming-of-age-day",name:"成人の日",type:"nth-weekday",rule:{month:1,weekday:1,nth:2}},{id:"national-foundation-day",name:"建国記念の日",type:"fixed",rule:{month:2,day:11}},{id:"emperors-birthday",name:"天皇誕生日",type:"fixed",rule:{month:2,day:23}},{id:"vernal-equinox-day",name:"春分の日",type:"custom",rule:{calculate:e=>R.calculateVernalEquinox(e)}},{id:"showa-day",name:"昭和の日",type:"fixed",rule:{month:4,day:29}},{id:"constitution-day",name:"憲法記念日",type:"fixed",rule:{month:5,day:3}},{id:"greenery-day",name:"みどりの日",type:"fixed",rule:{month:5,day:4}},{id:"childrens-day",name:"こどもの日",type:"fixed",rule:{month:5,day:5}},{id:"marine-day",name:"海の日",type:"nth-weekday",rule:{month:7,weekday:1,nth:3}},{id:"mountain-day",name:"山の日",type:"fixed",rule:{month:8,day:11}},{id:"respect-for-aged-day",name:"敬老の日",type:"nth-weekday",rule:{month:9,weekday:1,nth:3}},{id:"autumnal-equinox-day",name:"秋分の日",type:"custom",rule:{calculate:e=>R.calculateAutumnalEquinox(e)}},{id:"sports-day",name:"スポーツの日",type:"nth-weekday",rule:{month:10,weekday:1,nth:2}},{id:"culture-day",name:"文化の日",type:"fixed",rule:{month:11,day:3}},{id:"labor-thanksgiving-day",name:"勤労感謝の日",type:"fixed",rule:{month:11,day:23}},{id:"golden-week-substitute",name:"ゴールデンウィーク振替休日",type:"custom",rule:{calculate:e=>R.calculateGoldenWeekSubstitutes(e)}}],De=[{id:"emperors-birthday-showa",name:"天皇誕生日(昭和)",type:"fixed",rule:{month:4,day:29},active:!1},{id:"emperors-birthday-heisei",name:"天皇誕生日(平成)",type:"fixed",rule:{month:12,day:23},active:!1},{id:"health-sports-day",name:"体育の日",type:"nth-weekday",rule:{month:10,weekday:1,nth:2},active:!1},{id:"national-holiday",name:"国民の休日",type:"fixed",rule:{month:5,day:4},active:!1}],we=[{id:"setsubun",name:"節分",type:"fixed",rule:{month:2,day:3}},{id:"hinamatsuri",name:"ひなまつり",type:"fixed",rule:{month:3,day:3}},{id:"cherry-blossom-day",name:"桜の日",type:"fixed",rule:{month:3,day:27}},{id:"mothers-day",name:"母の日",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{id:"fathers-day",name:"父の日",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{id:"tanabata",name:"七夕",type:"fixed",rule:{month:7,day:7}},{id:"obon",name:"お盆",type:"fixed",rule:{month:8,day:15},duration:3},{id:"respect-for-elderly-day",name:"敬老の日",type:"nth-weekday",rule:{month:9,weekday:1,nth:3}},{id:"shichi-go-san",name:"七五三",type:"fixed",rule:{month:11,day:15}},{id:"christmas",name:"クリスマス",type:"fixed",rule:{month:12,day:25}},{id:"new-years-eve",name:"大晦日",type:"fixed",rule:{month:12,day:31}}],Me=pe.filter(e=>["showa-day","constitution-day","greenery-day","childrens-day","golden-week-substitute"].includes(e.id)),be=pe.filter(e=>"golden-week-substitute"!==e.id),xe=[...pe,...we,...De],Ye=pe.filter(e=>"emperors-birthday-showa"!==e.id&&"emperors-birthday-heisei"!==e.id),ke=[...pe.filter(e=>"emperors-birthday"!==e.id),...De.filter(e=>"emperors-birthday-heisei"===e.id)],ve=[{id:"marine-day-2020",name:"海の日(2020年特別)",type:"fixed",rule:{month:7,day:23},active:!1},{id:"sports-day-2020",name:"スポーツの日(2020年特別)",type:"fixed",rule:{month:7,day:24},active:!1},{id:"mountain-day-2020",name:"山の日(2020年特別)",type:"fixed",rule:{month:8,day:10},active:!1}],He={name:"日本語 (日本)",code:"ja-JP",months:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdays:["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],weekdaysShort:["日","月","火","水","木","金","土"],weekdaysMin:["日","月","火","水","木","金","土"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm"},ordinal:e=>`${e}日`,meridiem:(e,t,a)=>e<12?"午前":"午後"};var Se={name:"locale-ja-JP",version:"1.0.0",size:2048,dependencies:["holiday-engine","holiday-custom-calculator"],locale:He,install(e,t){M.register("ja-JP",{...He,holidays:pe,publicHolidays:be,observances:we,historicalHolidays:De,goldenWeekHolidays:Me,reiwaHolidays:Ye,heiseiHolidays:ke}),e.locales=e.locales||{},e.locales["ja-JP"]=He,e.extend({getJapaneseHolidays(e){switch(e){case"public":return be;case"observances":return we;case"historical":return De;case"golden-week":return Me;case"reiwa":return Ye;case"heisei":return ke;case"olympics2020":return ve;case"all":return xe;default:return pe}},getPublicHolidays:()=>be,getObservances:()=>we,getGoldenWeekHolidays:()=>Me,isGoldenWeekHoliday(){return null!==this.getHolidayInfo(Me)},isPublicHoliday(){return null!==this.getHolidayInfo(be)},isObservance(){return null!==this.getHolidayInfo(we)},isEquinoxHoliday(){const e=this.getHolidayInfo();return!!e&&["vernal-equinox-day","autumnal-equinox-day"].includes(e.id)},formatJapanese(e){const t=e||"YYYY年M月D日(ddd)";return this.format(t)},getJapaneseEra(){const e=this.year();return e>=2019?"令和":e>=1989?"平成":e>=1926?"昭和":e>=1912?"大正":e>=1868?"明治":"不明"},getJapaneseEraYear(){const e=this.year();return e>=2019?e-2018:e>=1989?e-1988:e>=1926?e-1925:e>=1912?e-1911:e>=1868?e-1867:e},formatWithEra(){return`${this.getJapaneseEra()}${this.getJapaneseEraYear()}年${this.month()}月${this.date()}日`}}),e.addStatic?.({getGoldenWeek(t){const a=[];for(const n of Me){const s=e.holidayEngine.calculate(n,t);a.push(...s.map(t=>({date:e(t),name:n.name,id:n.id})))}return a.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getEquinoxDays(t){const a=pe.filter(e=>["vernal-equinox-day","autumnal-equinox-day"].includes(e.id)),n=[];for(const s of a){const a=e.holidayEngine.calculate(s,t);n.push(...a.map(t=>({date:e(t),name:s.name,id:s.id})))}return n.sort((e,t)=>e.date.valueOf()-t.date.valueOf())},getObon(t){const a=we.find(e=>"obon"===e.id);if(a){return e.holidayEngine.calculate(a,t).map(t=>e(t))}return[]},isReiwaEra:e=>e>=2019,isHeiseiEra:e=>e>=1989&&e<=2019,isShowaEra:e=>e>=1926&&e<=1989,toJapaneseEra:e=>e>=2019?{era:"令和",year:e-2018}:e>=1989?{era:"平成",year:e-1988}:e>=1926?{era:"昭和",year:e-1925}:e>=1912?{era:"大正",year:e-1911}:e>=1868?{era:"明治",year:e-1867}:{era:"不明",year:e},getHolidaysForEra(e){switch(e){case"reiwa":return Ye;case"heisei":return ke;default:return pe}}})}};const Le=[{name:"Jour de l'An",type:"fixed",rule:{month:1,day:1}},{name:"Fête du Travail",type:"fixed",rule:{month:5,day:1}},{name:"Victoire 1945",type:"fixed",rule:{month:5,day:8}},{name:"Fête Nationale",type:"fixed",rule:{month:7,day:14}},{name:"Assomption",type:"fixed",rule:{month:8,day:15}},{name:"Toussaint",type:"fixed",rule:{month:11,day:1}},{name:"Armistice 1918",type:"fixed",rule:{month:11,day:11}},{name:"Noël",type:"fixed",rule:{month:12,day:25}},{name:"Lundi de Pâques",type:"easter-based",rule:{offset:1}},{name:"Ascension",type:"easter-based",rule:{offset:39}},{name:"Lundi de Pentecôte",type:"easter-based",rule:{offset:50}},{name:"Vendredi Saint",type:"easter-based",rule:{offset:-2},regions:["Alsace","Moselle"]},{name:"Saint-Étienne",type:"fixed",rule:{month:12,day:26},regions:["Alsace","Moselle"]}],Fe=[{name:"Saint-Valentin",type:"fixed",rule:{month:2,day:14}},{name:"Fête des Mères",type:"nth-weekday",rule:{month:5,weekday:0,nth:-1}},{name:"Fête des Pères",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{name:"Fête de la Musique",type:"fixed",rule:{month:6,day:21}},{name:"Halloween",type:"fixed",rule:{month:10,day:31}}],Ce={alsace:[{name:"Vendredi Saint",type:"easter-based",rule:{offset:-2}},{name:"Saint-Étienne",type:"fixed",rule:{month:12,day:26}}],martinique:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:5,day:22}}],guadeloupe:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:5,day:27}}],guyane:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:6,day:10}}],reunion:[{name:"Abolition de l'esclavage",type:"fixed",rule:{month:12,day:20}}]},Te=[...Le,...Fe],Ie={name:"Français (France)",code:"fr-FR",months:["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],monthsShort:["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],weekdays:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],weekdaysShort:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],weekdaysMin:["di","lu","ma","me","je","ve","sa"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},ordinal:e=>1===e?`${e}er`:`${e}e`,meridiem:(e,t,a)=>"",relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",ss:"%d secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};var je={name:"locale-fr-FR",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:Ie,install(e,t){M.register("fr-FR",{...Ie,holidays:Le,observances:Fe,regionalHolidays:Ce}),e.locales=e.locales||{},e.locales["fr-FR"]=Ie,e.extend({getFrenchHolidays(e){if(e){const t=e.toLowerCase(),a=Ce[t];if(a)return[...Le,...a]}return Le},getFrenchObservances:()=>Fe,getRegionalHolidays:e=>Ce[e.toLowerCase()]||[],getAllFrenchHolidays:()=>Te})}};const Ee=[{name:"Año Nuevo",type:"fixed",rule:{month:1,day:1}},{name:"Epifanía del Señor",type:"fixed",rule:{month:1,day:6}},{name:"Viernes Santo",type:"easter-based",rule:{offset:-2}},{name:"Fiesta del Trabajo",type:"fixed",rule:{month:5,day:1}},{name:"Asunción de la Virgen",type:"fixed",rule:{month:8,day:15}},{name:"Fiesta Nacional de España",type:"fixed",rule:{month:10,day:12}},{name:"Todos los Santos",type:"fixed",rule:{month:11,day:1}},{name:"Día de la Constitución",type:"fixed",rule:{month:12,day:6}},{name:"Inmaculada Concepción",type:"fixed",rule:{month:12,day:8}},{name:"Navidad",type:"fixed",rule:{month:12,day:25}},{name:"Jueves Santo",type:"easter-based",rule:{offset:-3},regions:["Andalucía","Aragón","Asturias","Baleares","Canarias","Cantabria","Castilla-La Mancha","Castilla y León","Extremadura","Galicia","Madrid","Murcia","Navarra","País Vasco","La Rioja"]},{name:"Lunes de Pascua",type:"easter-based",rule:{offset:1},regions:["Baleares","Cataluña","Comunidad Valenciana","Navarra","País Vasco"]}],Ne={andalucia:[{name:"Día de Andalucía",type:"fixed",rule:{month:2,day:28}}],aragon:[{name:"San Jorge",type:"fixed",rule:{month:4,day:23}}],asturias:[{name:"Día de Asturias",type:"fixed",rule:{month:9,day:8}}],baleares:[{name:"Día de las Islas Baleares",type:"fixed",rule:{month:3,day:1}}],canarias:[{name:"Día de Canarias",type:"fixed",rule:{month:5,day:30}}],cantabria:[{name:"Día de las Instituciones de Cantabria",type:"fixed",rule:{month:7,day:28}}],castillaLaMancha:[{name:"Día de Castilla-La Mancha",type:"fixed",rule:{month:5,day:31}}],castillaYLeon:[{name:"Día de Castilla y León",type:"fixed",rule:{month:4,day:23}}],cataluna:[{name:"Sant Jordi",type:"fixed",rule:{month:4,day:23}},{name:"Sant Joan",type:"fixed",rule:{month:6,day:24}},{name:"Diada Nacional de Catalunya",type:"fixed",rule:{month:9,day:11}},{name:"Sant Esteve",type:"fixed",rule:{month:12,day:26}}],extremadura:[{name:"Día de Extremadura",type:"fixed",rule:{month:9,day:8}}],galicia:[{name:"Día Nacional de Galicia",type:"fixed",rule:{month:7,day:25}}],madrid:[{name:"Día de la Comunidad de Madrid",type:"fixed",rule:{month:5,day:2}}],murcia:[{name:"Día de la Región de Murcia",type:"fixed",rule:{month:6,day:9}}],navarra:[{name:"San Fermín",type:"fixed",rule:{month:7,day:7}}],paisVasco:[{name:"Lunes de Pascua",type:"easter-based",rule:{offset:1}}],laRioja:[{name:"Día de La Rioja",type:"fixed",rule:{month:6,day:9}}],valencia:[{name:"San Vicente Mártir",type:"fixed",rule:{month:1,day:22}},{name:"Fallas",type:"fixed",rule:{month:3,day:19}},{name:"San Juan",type:"fixed",rule:{month:6,day:24}},{name:"Día de la Comunidad Valenciana",type:"fixed",rule:{month:10,day:9}}]},Oe=[{name:"San Valentín",type:"fixed",rule:{month:2,day:14}},{name:"Día del Padre",type:"fixed",rule:{month:3,day:19}},{name:"Día de la Madre",type:"nth-weekday",rule:{month:5,weekday:0,nth:1}},{name:"Nochevieja",type:"fixed",rule:{month:12,day:31}}],Be=[...Ee,...Oe],Re={name:"Español (España)",code:"es-ES",months:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],monthsShort:["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic."],weekdays:["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],weekdaysShort:["dom.","lun.","mar.","mié.","jue.","vie.","sáb."],weekdaysMin:["do","lu","ma","mi","ju","vi","sá"],formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},ordinal:e=>`${e}º`,meridiem:(e,t,a)=>{const n=e<12?"de la mañana":e<20?"de la tarde":"de la noche";return a?n:n.toUpperCase()},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",ss:"%d segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"}};var _e={name:"locale-es-ES",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:Re,install(e,t){M.register("es-ES",{...Re,holidays:Ee,observances:Oe,regionalHolidays:Ne}),e.locales=e.locales||{},e.locales["es-ES"]=Re,e.extend({getSpanishHolidays(e){if(e){const t=e.toLowerCase().replace(/\s/g,""),a=Ne[t];if(a)return[...Ee,...a]}return Ee},getSpanishObservances:()=>Oe,getRegionalSpanishHolidays:e=>Ne[e.toLowerCase().replace(/\s/g,"")]||[],getAllSpanishHolidays:()=>Be})}};const We=[{name:"Capodanno",type:"fixed",rule:{month:1,day:1}},{name:"Epifania",type:"fixed",rule:{month:1,day:6}},{name:"Festa della Liberazione",type:"fixed",rule:{month:4,day:25}},{name:"Festa del Lavoro",type:"fixed",rule:{month:5,day:1}},{name:"Festa della Repubblica",type:"fixed",rule:{month:6,day:2}},{name:"Assunzione di Maria",type:"fixed",rule:{month:8,day:15}},{name:"Ognissanti",type:"fixed",rule:{month:11,day:1}},{name:"Immacolata Concezione",type:"fixed",rule:{month:12,day:8}},{name:"Natale",type:"fixed",rule:{month:12,day:25}},{name:"Santo Stefano",type:"fixed",rule:{month:12,day:26}},{name:"Pasquetta",type:"easter-based",rule:{offset:1}}],$e={sicilia:[{name:"Santa Lucia",type:"fixed",rule:{month:12,day:13}}],sardegna:[{name:"Sagra di Sant'Efisio",type:"fixed",rule:{month:5,day:1}}],veneto:[{name:"San Marco",type:"fixed",rule:{month:4,day:25}}],toscana:[{name:"San Giovanni Battista",type:"fixed",rule:{month:6,day:24}}],lazio:[{name:"Santi Pietro e Paolo",type:"fixed",rule:{month:6,day:29}}],lombardia:[{name:"Sant'Ambrogio",type:"fixed",rule:{month:12,day:7}}]},Ae=[{name:"San Valentino",type:"fixed",rule:{month:2,day:14}},{name:"Festa della Donna",type:"fixed",rule:{month:3,day:8}},{name:"Festa della Mamma",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{name:"Festa del Papà",type:"fixed",rule:{month:3,day:19}},{name:"Vigilia di Natale",type:"fixed",rule:{month:12,day:24}},{name:"Capodanno",type:"fixed",rule:{month:12,day:31}}],qe=[...We,...Ae],ze={name:"Italiano (Italia)",code:"it-IT",months:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],monthsShort:["gen.","feb.","mar.","apr.","mag.","giu.","lug.","ago.","set.","ott.","nov.","dic."],weekdays:["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],weekdaysShort:["dom.","lun.","mar.","mer.","gio.","ven.","sab."],weekdaysMin:["do","lu","ma","me","gi","ve","sa"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},ordinal:e=>`${e}º`,meridiem:(e,t,a)=>{const n=e<12?"del mattino":e<18?"del pomeriggio":"della sera";return a?n:n.toUpperCase()},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",ss:"%d secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};var Pe={name:"locale-it-IT",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:ze,install(e,t){M.register("it-IT",{...ze,holidays:We,observances:Ae,regionalHolidays:$e}),e.locales=e.locales||{},e.locales["it-IT"]=ze,e.extend({getItalianHolidays(e){if(e){const t=e.toLowerCase(),a=$e[t];if(a)return[...We,...a]}return We},getItalianObservances:()=>Ae,getRegionalItalianHolidays:e=>$e[e.toLowerCase()]||[],getAllItalianHolidays:()=>qe})}};const Ue=[{name:"Confraternização Universal",type:"fixed",rule:{month:1,day:1}},{name:"Tiradentes",type:"fixed",rule:{month:4,day:21}},{name:"Dia do Trabalhador",type:"fixed",rule:{month:5,day:1}},{name:"Independência do Brasil",type:"fixed",rule:{month:9,day:7}},{name:"Nossa Senhora Aparecida",type:"fixed",rule:{month:10,day:12}},{name:"Finados",type:"fixed",rule:{month:11,day:2}},{name:"Proclamação da República",type:"fixed",rule:{month:11,day:15}},{name:"Natal",type:"fixed",rule:{month:12,day:25}},{name:"Carnaval",type:"easter-based",rule:{offset:-47}},{name:"Sexta-feira Santa",type:"easter-based",rule:{offset:-2}},{name:"Corpus Christi",type:"easter-based",rule:{offset:60}}],Je={acre:[{name:"Dia da Amazônia",type:"fixed",rule:{month:9,day:5}},{name:"Tratado de Petrópolis",type:"fixed",rule:{month:11,day:17}}],alagoas:[{name:"São João",type:"fixed",rule:{month:6,day:24}},{name:"São Pedro",type:"fixed",rule:{month:6,day:29}}],bahia:[{name:"Independência da Bahia",type:"fixed",rule:{month:7,day:2}}],ceara:[{name:"Abolição da Escravidão no Ceará",type:"fixed",rule:{month:3,day:25}}],df:[{name:"Fundação de Brasília",type:"fixed",rule:{month:4,day:21}},{name:"Dia da Consciência Negra",type:"fixed",rule:{month:11,day:20}}],rj:[{name:"Morte de Zumbi dos Palmares",type:"fixed",rule:{month:4,day:23}},{name:"São Jorge",type:"fixed",rule:{month:4,day:23}}],sp:[{name:"Revolução Constitucionalista",type:"fixed",rule:{month:7,day:9}},{name:"Dia da Consciência Negra",type:"fixed",rule:{month:11,day:20}}]},Ge=[{name:"Dia dos Namorados",type:"fixed",rule:{month:6,day:12}},{name:"Dia das Mães",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{name:"Dia dos Pais",type:"nth-weekday",rule:{month:8,weekday:0,nth:2}},{name:"Dia das Crianças",type:"fixed",rule:{month:10,day:12}},{name:"Dia do Professor",type:"fixed",rule:{month:10,day:15}},{name:"Véspera de Natal",type:"fixed",rule:{month:12,day:24}},{name:"Véspera de Ano Novo",type:"fixed",rule:{month:12,day:31}}],Qe=[...Ue,...Ge],Ke={name:"Português (Brasil)",code:"pt-BR",months:["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],monthsShort:["jan.","fev.","mar.","abr.","mai.","jun.","jul.","ago.","set.","out.","nov.","dez."],weekdays:["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],weekdaysShort:["dom.","seg.","ter.","qua.","qui.","sex.","sáb."],weekdaysMin:["do","sg","te","qa","qi","sx","sá"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},ordinal:e=>`${e}º`,meridiem:(e,t,a)=>{const n=e<12?"da manhã":e<18?"da tarde":"da noite";return a?n:n.toUpperCase()},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",ss:"%d segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};var Ve={name:"locale-pt-BR",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:Ke,install(e,t){M.register("pt-BR",{...Ke,holidays:Ue,observances:Ge,regionalHolidays:Je}),e.locales=e.locales||{},e.locales["pt-BR"]=Ke,e.extend({getBrazilianHolidays(e){if(e){const t=e.toLowerCase(),a=Je[t];if(a)return[...Ue,...a]}return Ue},getBrazilianObservances:()=>Ge,getRegionalBrazilianHolidays:e=>Je[e.toLowerCase()]||[],getAllBrazilianHolidays:()=>Qe})}};const Ze=[{name:"Новый год",type:"fixed",rule:{month:1,day:1}},{name:"Рождество Христово",type:"fixed",rule:{month:1,day:7}},{name:"День защитника Отечества",type:"fixed",rule:{month:2,day:23}},{name:"Международный женский день",type:"fixed",rule:{month:3,day:8}},{name:"Праздник Весны и Труда",type:"fixed",rule:{month:5,day:1}},{name:"День Победы",type:"fixed",rule:{month:5,day:9}},{name:"День России",type:"fixed",rule:{month:6,day:12}},{name:"День народного единства",type:"fixed",rule:{month:11,day:4}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:2}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:3}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:4}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:5}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:6}},{name:"Новогодние каникулы",type:"fixed",rule:{month:1,day:8}},{name:"Православная Пасха",type:"easter-based",rule:{offset:0}}],Xe={tatarstan:[{name:"День Республики Татарстан",type:"fixed",rule:{month:8,day:30}}],bashkortostan:[{name:"День Республики Башкортостан",type:"fixed",rule:{month:10,day:11}}],sakha:[{name:"День Республики Саха (Якутия)",type:"fixed",rule:{month:4,day:27}}],chechnya:[{name:"День мира в Чеченской Республике",type:"fixed",rule:{month:4,day:16}}],dagestan:[{name:"День единения народов Дагестана",type:"fixed",rule:{month:9,day:15}}]},et=[{name:"День святого Валентина",type:"fixed",rule:{month:2,day:14}},{name:"Масленица",type:"easter-based",rule:{offset:-49}},{name:"День космонавтики",type:"fixed",rule:{month:4,day:12}},{name:"Радоница",type:"easter-based",rule:{offset:9}},{name:"День Победы (вечером)",type:"fixed",rule:{month:5,day:9}},{name:"День знаний",type:"fixed",rule:{month:9,day:1}},{name:"День учителя",type:"fixed",rule:{month:10,day:5}},{name:"День матери",type:"nth-weekday",rule:{month:11,weekday:0,nth:-1}},{name:"День Конституции Российской Федерации",type:"fixed",rule:{month:12,day:12}}],tt=[...Ze,...et],at={name:"Русский (Россия)",code:"ru-RU",months:["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],monthsShort:["янв.","фев.","мар.","апр.","май","июн.","июл.","авг.","сен.","окт.","ноя.","дек."],weekdays:["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],weekdaysShort:["вс.","пн.","вт.","ср.","чт.","пт.","сб."],weekdaysMin:["вс","пн","вт","ср","чт","пт","сб"],formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY [г.]",LLL:"D MMMM YYYY [г.], H:mm",LLLL:"dddd, D MMMM YYYY [г.], H:mm"},ordinal:e=>`${e}-й`,meridiem:(e,t,a)=>e<4?"ночи":e<12?"утра":e<17?"дня":"вечера",relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",ss:e=>e%10==1&&e%100!=11?`${e} секунду`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} секунды`:`${e} секунд`,m:"минуту",mm:e=>e%10==1&&e%100!=11?`${e} минуту`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} минуты`:`${e} минут`,h:"час",hh:e=>e%10==1&&e%100!=11?`${e} час`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} часа`:`${e} часов`,d:"день",dd:e=>e%10==1&&e%100!=11?`${e} день`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} дня`:`${e} дней`,M:"месяц",MM:e=>e%10==1&&e%100!=11?`${e} месяц`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} месяца`:`${e} месяцев`,y:"год",yy:e=>e%10==1&&e%100!=11?`${e} год`:[2,3,4].includes(e%10)&&![12,13,14].includes(e%100)?`${e} года`:`${e} лет`}};var nt={name:"locale-ru-RU",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:at,install(e,t){M.register("ru-RU",{...at,holidays:Ze,observances:et,regionalHolidays:Xe}),e.locales=e.locales||{},e.locales["ru-RU"]=at,e.extend({getRussianHolidays(e){if(e){const t=e.toLowerCase(),a=Xe[t];if(a)return[...Ze,...a]}return Ze},getRussianObservances:()=>et,getRegionalRussianHolidays:e=>Xe[e.toLowerCase()]||[],getAllRussianHolidays:()=>tt})}};const st=[{name:"元旦",type:"fixed",rule:{month:1,day:1}},{name:"劳动节",type:"fixed",rule:{month:5,day:1}},{name:"国庆节",type:"fixed",rule:{month:10,day:1}},{name:"国庆黄金周",type:"fixed",rule:{month:10,day:2}},{name:"国庆黄金周",type:"fixed",rule:{month:10,day:3}},{name:"春节",type:"lunar",rule:{calendar:"chinese",month:1,day:1}},{name:"春节假期",type:"lunar",rule:{calendar:"chinese",month:1,day:2}},{name:"春节假期",type:"lunar",rule:{calendar:"chinese",month:1,day:3}},{name:"清明节",type:"fixed",rule:{month:4,day:5}},{name:"端午节",type:"lunar",rule:{calendar:"chinese",month:5,day:5}},{name:"中秋节",type:"lunar",rule:{calendar:"chinese",month:8,day:15}}],rt={xinjiang:[{name:"古尔邦节",type:"custom",rule:{calculate:e=>[new Date(e,8,10)]}}],tibet:[{name:"藏历新年",type:"custom",rule:{calculate:e=>[new Date(e,1,10)]}}],guangxi:[{name:"三月三",type:"lunar",rule:{month:3,day:3}}],hongkong:[{name:"佛诞节",type:"lunar",rule:{month:4,day:8}}],macau:[{name:"澳门特别行政区成立纪念日",type:"fixed",rule:{month:12,day:20}}]},it=[{name:"情人节",type:"fixed",rule:{month:2,day:14}},{name:"妇女节",type:"fixed",rule:{month:3,day:8}},{name:"植树节",type:"fixed",rule:{month:3,day:12}},{name:"愚人节",type:"fixed",rule:{month:4,day:1}},{name:"青年节",type:"fixed",rule:{month:5,day:4}},{name:"母亲节",type:"nth-weekday",rule:{month:5,weekday:0,nth:2}},{name:"儿童节",type:"fixed",rule:{month:6,day:1}},{name:"父亲节",type:"nth-weekday",rule:{month:6,weekday:0,nth:3}},{name:"建党节",type:"fixed",rule:{month:7,day:1}},{name:"建军节",type:"fixed",rule:{month:8,day:1}},{name:"教师节",type:"fixed",rule:{month:9,day:10}},{name:"重阳节",type:"lunar",rule:{calendar:"chinese",month:9,day:9}},{name:"万圣节",type:"fixed",rule:{month:10,day:31}},{name:"光棍节",type:"fixed",rule:{month:11,day:11}},{name:"圣诞节",type:"fixed",rule:{month:12,day:25}}],ot=[...st,...it],dt={name:"中文 (简体,中国)",code:"zh-CN",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],weekdays:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],weekdaysShort:["周日","周一","周二","周三","周四","周五","周六"],weekdaysMin:["日","一","二","三","四","五","六"],formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"dddd YYYY年M月D日 HH:mm"},ordinal:e=>`第${e}`,meridiem:(e,t,a)=>e<6?"凌晨":e<9?"早上":e<12?"上午":e<13?"中午":e<18?"下午":"晚上",relativeTime:{future:"%s后",past:"%s前",s:"几秒",ss:"%d秒",m:"1分钟",mm:"%d分钟",h:"1小时",hh:"%d小时",d:"1天",dd:"%d天",M:"1个月",MM:"%d个月",y:"1年",yy:"%d年"}};var lt={name:"locale-zh-CN",version:"1.0.0",size:1024,dependencies:["holiday-engine"],locale:dt,install(e,t){M.register("zh-CN",{...dt,holidays:st,observances:it,regionalHolidays:rt}),e.locales=e.locales||{},e.locales["zh-CN"]=dt,e.extend({getChineseHolidays(e){if(e){const t=e.toLowerCase(),a=rt[t];if(a)return[...st,...a]}return st},getChineseObservances:()=>it,getRegionalChineseHolidays:e=>rt[e.toLowerCase()]||[],getAllChineseHolidays:()=>ot})}};const ut="1.1.0",ct="Ersin Koc",yt="https://github.com/ersinkoc/kairos",ht="https://github.com/ersinkoc/kairos#readme",mt="Revolutionary zero-dependency JavaScript date/time library with modular architecture and dynamic holiday system";function ft(){const e=require("./core/plugin-system.js").default,t=require("./plugins/parse/flexible.js").default,a=require("./plugins/parse/iso.js").default,n=require("./plugins/format/tokens.js").default;return e.use([t,a,n]),e}function gt(){const e=require("./core/plugin-system.js").default,t=require("./plugins/business/workday.js").default,a=require("./plugins/business/fiscal.js").default,n=require("./plugins/holiday/engine.js").default;return e.use([t,a,n]),e}function pt(){const e=require("./core/plugin-system.js").default,t=require("./plugins/locale/en-US/index.js").default,a=require("./plugins/locale/de-DE/index.js").default,n=require("./plugins/locale/tr-TR/index.js").default,s=require("./plugins/locale/ja-JP/index.js").default,r=require("./plugins/locale/fr-FR/index.js").default,i=require("./plugins/locale/es-ES/index.js").default,o=require("./plugins/locale/it-IT/index.js").default,d=require("./plugins/locale/pt-BR/index.js").default,l=require("./plugins/locale/ru-RU/index.js").default,u=require("./plugins/locale/zh-CN/index.js").default;return e.use([t,a,n,s,r,i,o,d,l,u]),e.locale("en-US"),e}function Dt(){const e=require("./core/plugin-system.js").default,t=require("./plugins/holiday/engine.js").default,a=require("./plugins/business/workday.js").default,n=require("./plugins/business/fiscal.js").default,s=require("./plugins/relative/relative-time.js").default,r=require("./plugins/calendar/calendar.js").default,i=require("./plugins/duration/duration.js").default,o=require("./plugins/range/range.js").default,d=require("./plugins/timezone/timezone.js").default,l=require("./plugins/parse/flexible.js").default,u=require("./plugins/parse/iso.js").default,c=require("./plugins/parse/rfc2822.js").default,y=require("./plugins/parse/unix.js").default,h=require("./plugins/format/tokens.js").default,m=require("./plugins/locale/en-US/index.js").default,f=require("./plugins/locale/de-DE/index.js").default,g=require("./plugins/locale/tr-TR/index.js").default,p=require("./plugins/locale/ja-JP/index.js").default,D=require("./plugins/locale/fr-FR/index.js").default,w=require("./plugins/locale/es-ES/index.js").default,M=require("./plugins/locale/it-IT/index.js").default,b=require("./plugins/locale/pt-BR/index.js").default,x=require("./plugins/locale/ru-RU/index.js").default,Y=require("./plugins/locale/zh-CN/index.js").default,k=require("./plugins/holiday/calculators/fixed.js").default,v=require("./plugins/holiday/calculators/nth-weekday.js").default,H=require("./plugins/holiday/calculators/easter.js").default,S=require("./plugins/holiday/calculators/lunar.js").default,L=require("./plugins/holiday/calculators/relative.js").default,F=require("./plugins/holiday/calculators/custom.js").default;return e.use([t,k,v,H,S,L,F,a,n,s,r,i,o,d,l,u,c,y,h,m,f,g,p,D,w,M,b,x,Y]),e.locale("en-US"),e}export{ct as AUTHOR,W as BusinessDayCalculator,Q as CalendarCalculator,B as CustomCalculator,R as CustomCalculatorUtils,mt as DESCRIPTION,S as EasterCalculator,q as FiscalYearCalculator,Y as FixedCalculator,ht as HOMEPAGE,e as LRUCache,F as LunarCalculator,v as NthWeekdayCalculator,yt as REPOSITORY,N as RelativeCalculator,J as RelativeTimeCalculator,ut as VERSION,he as allGermanHolidays,xe as allJapaneseHolidays,ie as allTurkishHolidays,ee as allUSHolidays,z as businessFiscal,A as businessWorkday,K as calendarPlugin,a as createDateCache,n as createHolidayCache,_ as customCalculator,D as default,L as easterCalculator,k as fixedCalculator,ye as germanFederalHolidays,me as germanHistoricalHolidays,ue as germanHolidays,ce as germanStateHolidays,x as holidayEngine,s as isValidDate,l as isValidDay,d as isValidMonth,c as isValidNth,r as isValidNumber,i as isValidString,u as isValidWeekday,o as isValidYear,Me as japaneseGoldenWeekHolidays,ke as japaneseHeiseiHolidays,De as japaneseHistoricalHolidays,pe as japaneseHolidays,we as japaneseObservances,be as japanesePublicHolidays,Ye as japaneseReiwaHolidays,lt as localeCN,ge as localeDE,_e as localeES,je as localeFR,Pe as localeIT,Se as localeJP,Ve as localePT,nt as localeRU,le as localeTR,ae as localeUS,E as lunarCalculator,t as memoize,H as nthWeekdayCalculator,O as relativeCalculator,G as relativeTimePlugin,ft as setupBasic,Dt as setupFull,gt as setupWithBusiness,pt as setupWithLocales,h as throwError,re as turkishHistoricalHolidays,ne as turkishHolidays,se as turkishObservances,oe as turkishPublicHolidays,X as usFederalHolidays,V as usHolidays,Z as usStateHolidays,y as validateHolidayRule};
//# sourceMappingURL=kairos.esm.min.js.map