'use strict';
import { usaDateFormats, dateFormats } from './date-formats.js';
import _0x2c26bf from 'dayjs';
import _0x32938d from 'dayjs/plugin/utc.js';
import _0x5080f8 from 'dayjs/plugin/isSameOrBefore.js';
import _0x247c8b from 'dayjs/plugin/isSameOrAfter.js';
import _0x59a25c from 'dayjs/plugin/minMax.js';
import _0x297ae4 from 'dayjs/plugin/relativeTime.js';
import _0x3ffc68 from 'dayjs/plugin/customParseFormat.js';
import { dateFormat } from '../enums/enums.js';
import { wordPluralSuffixes } from '../../base-repo/constants/strings-constants.js';
import { commonLetters } from '../../base-repo/constants/internal-common-strings.js';

var __defProp=Object['defineProperty'],__name=(_0x5ca4f5,_0x55c752)=>__defProp(_0x5ca4f5,'name',{'value':_0x55c752,'configurable':!![]});const dayjsUnitType={'year':'year','month':'month','day':'day','week':'week','hour':'hour','hours':'hours','minutes':'minutes','seconds':'seconds','milliseconds':'milliseconds'};const dateFormates={'numeric':'numeric','digit':'2-digit'};const timeTokens={'seconds':wordPluralSuffixes['s'],'minutes':commonLetters['m'],'months':commonLetters['M'],'years':wordPluralSuffixes['y']},thresholds=[{'l':timeTokens['seconds'],'r':0x1},{'l':timeTokens['minutes'],'r':0x1},{'l':'mm','r':0x3b,'d':'minute'},{'l':'h','r':0x1},{'l':'hh','r':0x17,'d':dayjsUnitType['hour']},{'l':'d','r':0x1},{'l':'dd','r':0x1d,'d':dayjsUnitType['day']},{'l':timeTokens['months'],'r':0x1},{'l':'MM','r':0xb,'d':dayjsUnitType['month']},{'l':timeTokens['years'],'r':0x1},{'l':'yy','d':dayjsUnitType['year']}];_0x2c26bf['extend'](_0x32938d),_0x2c26bf['extend'](_0x5080f8),_0x2c26bf['extend'](_0x247c8b),_0x2c26bf['extend'](_0x59a25c),_0x2c26bf['extend'](_0x3ffc68),_0x2c26bf['extend'](_0x297ae4,{'thresholds':thresholds});function getNowFormatted(){return _0x2c26bf()['utc']()['format'](usaDateFormats['dateTimeFormatForDisplay']);}__name(getNowFormatted,'getNowFormatted');function getDefaultDateIsoString(){return _0x2c26bf['utc']('0001-01-01')['set'](dayjsUnitType['year'],-0x61*0x7+0x25a7+-0x1f*0x121)['toISOString']();}__name(getDefaultDateIsoString,'getDefaultDateIsoString');function getCurrentYear(){return _0x2c26bf['utc']()['format']('YYYY');}__name(getCurrentYear,'getCurrentYear');function getNowAsString(){return _0x2c26bf()['toISOString']();}__name(getNowAsString,'getNowAsString');function getDateOnlyAsUtcString(_0x149bd5){return _0x2c26bf(_0x149bd5)['utc']()['startOf'](dayjsUnitType['day'])['toISOString']();}__name(getDateOnlyAsUtcString,'getDateOnlyAsUtcString');function getDurationMinutesSecondsDisplay(_0x4c4549,_0x1690f9){if(!_0x1690f9)return '';const _0x5e80f5=_0x2c26bf(_0x1690f9)['diff'](_0x2c26bf(_0x4c4549));return _0x2c26bf['utc'](_0x5e80f5)['format'](dateFormats['minutesSecondsFormatForDisplay']);}__name(getDurationMinutesSecondsDisplay,'getDurationMinutesSecondsDisplay');function formatUtcToLocalDateForDisplay(_0x46ce74){return _0x2c26bf['utc'](_0x46ce74)['local']()['format'](dateFormats['dateTimeFormatForDisplay']);}__name(formatUtcToLocalDateForDisplay,'formatUtcToLocalDateForDisplay');function parseStringEndDate(_0x17a123,_0x495cc6){return _0x2c26bf(_0x17a123)['add'](_0x495cc6,dayjsUnitType['seconds'])['toISOString']();}__name(parseStringEndDate,'parseStringEndDate');function getMinDateAsUtcString(_0x322ee5){const _0x11e27e=_0x322ee5['map'](_0x2c26bf),_0x3fae88=_0x2c26bf['min'](_0x11e27e);return _0x3fae88?.['utc']()['toISOString']();}__name(getMinDateAsUtcString,'getMinDateAsUtcString');function getMaxDateAsUtcString(_0x108895){const _0x1c4096=_0x108895['map'](_0x2c26bf),_0x4e04bc=_0x2c26bf['max'](_0x1c4096);return _0x4e04bc?.['utc']()['toISOString']();}__name(getMaxDateAsUtcString,'getMaxDateAsUtcString');function setTimeAndGetDateAsUtcString(_0x57fdbc,_0x2ce50e){return _0x2c26bf(_0x57fdbc)['hour'](_0x2ce50e['hours'])['minute'](_0x2ce50e['minutes'])['second'](-0xc2e+0x1*0xc42+-0x5*0x4)['millisecond'](-0x13e*-0x2+-0x1b4d+-0x1*-0x18d1)['utc']()['toISOString']();}__name(setTimeAndGetDateAsUtcString,'setTimeAndGetDateAsUtcString');function formatUsDate(_0x5ed296){return _0x2c26bf['utc'](_0x5ed296)['local']()['format'](usaDateFormats['dateTimeFormatForDisplay']);}__name(formatUsDate,'formatUsDate');function formatUtcDateOnlyForDisplay(_0x4dd4b6){return _0x2c26bf['utc'](_0x4dd4b6['toDateString']())['format'](dateFormats['dateFormatForDisplay']);}__name(formatUtcDateOnlyForDisplay,'formatUtcDateOnlyForDisplay');function getMinCacheDate(_0x5ce828){return _0x2c26bf(_0x5ce828)['format']();}__name(getMinCacheDate,'getMinCacheDate');function getFormatValue(){return _0x2c26bf()['format']();}__name(getFormatValue,'getFormatValue');function isBefore(_0x5ac403,_0x370aab){return _0x2c26bf(_0x5ac403)['isBefore'](_0x370aab);}__name(isBefore,'isBefore');function isCurrentYear(_0x461c7f){return _0x2c26bf(_0x461c7f)['year']()===_0x2c26bf()['year']();}__name(isCurrentYear,'isCurrentYear');function getDuration(_0xbd550d){return _0x2c26bf()['diff'](_0x2c26bf(_0xbd550d),dayjsUnitType['seconds']);}__name(getDuration,'getDuration');function ensureDateStringInIso(_0x386afb){return _0x2c26bf(_0x386afb)['toISOString']();}__name(ensureDateStringInIso,'ensureDateStringInIso');function getNowUtc(){return _0x2c26bf['utc']()['toDate']();}__name(getNowUtc,'getNowUtc');function parseUtcStringToDate(_0x591dd7){return _0x2c26bf['utc'](_0x591dd7)['toDate']();}__name(parseUtcStringToDate,'parseUtcStringToDate');function parseToUtc(_0x51a5fc){return _0x2c26bf['utc'](_0x51a5fc)['toDate']();}__name(parseToUtc,'parseToUtc');function isSameOrBeforeAndIsSameOrAfter(_0x2a4ef3,_0x4fd41a,_0x3219a6){return _0x2c26bf(_0x2a4ef3)['isSameOrBefore'](_0x3219a6)&&_0x2c26bf(_0x4fd41a)['isSameOrAfter'](_0x3219a6);}__name(isSameOrBeforeAndIsSameOrAfter,'isSameOrBeforeAndIsSameOrAfter');function parseToLocalDate(_0x36f209){return _0x2c26bf['utc'](_0x36f209)['local']()['toDate']();}__name(parseToLocalDate,'parseToLocalDate');function dateToISOString(_0x5c13c6){try{const _0x5b9d3b=_0x2c26bf(_0x5c13c6);if(!_0x5b9d3b['isValid']())return void(0x838+0x138a+-0x1bc2);return _0x5b9d3b['format'](dateFormat['isoDefault']);}catch{return void(0x14c5+0x1*-0x12c5+-0x2*0x100);}}__name(dateToISOString,'dateToISOString');function dateWithTimeToISOString(_0x1d2377,_0x5a99cd){return _0x5a99cd?parseToUtc(_0x5a99cd['setHours'](_0x1d2377['hours'],_0x1d2377['minutes'],-0x556+0x3*-0x1c+0x5aa,0x1c65+0x1b36+-0x379b))['toISOString']():void(-0x202a+0x1*-0x24ee+0x4518);}__name(dateWithTimeToISOString,'dateWithTimeToISOString');function formatUserFrendlyRelativeTime(_0x3ca07e){return _0x2c26bf(_0x3ca07e)['fromNow']();}__name(formatUserFrendlyRelativeTime,'formatUserFrendlyRelativeTime');function isExpired(_0x4dfdcf){return _0x2c26bf['utc'](_0x4dfdcf)['isBefore'](_0x2c26bf['utc']());}__name(isExpired,'isExpired');function formatDateTime(_0x1d4e84){return formatDate(_0x1d4e84,{'year':dateFormates['digit'],'month':dateFormates['numeric'],'day':dateFormates['numeric'],'hour':dateFormates['numeric'],'minute':dateFormates['numeric']});}__name(formatDateTime,'formatDateTime');function formatDateOnly(_0x5a67cf){return formatDate(_0x5a67cf,{'year':dateFormates['digit'],'month':dateFormates['numeric'],'day':dateFormates['numeric']});}__name(formatDateOnly,'formatDateOnly');function formatDate(_0x412d52,_0x449794){if(!_0x412d52)return '';const _0xa94271=navigator['language'],_0x569e21=_0x412d52 instanceof Date?_0x412d52:parseUtcStringToDate(_0x412d52);return new Intl['DateTimeFormat'](_0xa94271,_0x449794)['format'](_0x569e21);}__name(formatDate,'formatDate');

export { dateFormates, dateToISOString, dateWithTimeToISOString, dayjsUnitType, ensureDateStringInIso, formatDate, formatDateOnly, formatDateTime, formatUsDate, formatUserFrendlyRelativeTime, formatUtcDateOnlyForDisplay, formatUtcToLocalDateForDisplay, getCurrentYear, getDateOnlyAsUtcString, getDefaultDateIsoString, getDuration, getDurationMinutesSecondsDisplay, getFormatValue, getMaxDateAsUtcString, getMinCacheDate, getMinDateAsUtcString, getNowAsString, getNowFormatted, getNowUtc, isBefore, isCurrentYear, isExpired, isSameOrBeforeAndIsSameOrAfter, parseStringEndDate, parseToLocalDate, parseToUtc, parseUtcStringToDate, setTimeAndGetDateAsUtcString };
