'use strict';
import { dateFormates, dayjsUnitType, parseToUtc, getNowUtc, parseUtcStringToDate } from '../../../fd-toolbox/dates/date-time.js';
import { isEmptyNullOrUndefined } from '../../../fd-toolbox/functions/value-checking-functions.js';
import { shortenWithEllipsis } from '../../../fd-toolbox/strings/strings.js';

var __defProp=Object['defineProperty'],__name=(_0x32c1c7,_0x408fdd)=>__defProp(_0x32c1c7,'name',{'value':_0x408fdd,'configurable':!![]});function localizedFormat(_0x3afe33,_0x3bebdf){return _0x3bebdf?_0x3bebdf['toLocaleDateString'](void(0x76*-0x29+-0x1344+-0x262a*-0x1),{'day':dateFormates['digit'],'month':dateFormates['digit'],'year':dateFormates['numeric']}):_0x3afe33;}__name(localizedFormat,'localizedFormat');function getDateWithTime(_0x488991,_0x3200d2){return _0x488991['setHours'](_0x3200d2['hours']),_0x488991['setMinutes'](_0x3200d2['minutes']),_0x488991;}__name(getDateWithTime,'getDateWithTime');function updateDateTimeWithNewHours(_0x232cfc,_0x4f907b,_0xbfaeb8,_0x1f765c=0x1*0xce3+-0xe6b+-0xc4*-0x2,_0x3d7040){_0x4f907b(dayjsUnitType['hours'],_0x1f765c);const _0x20a8f6=parseToUtc(_0x3d7040??getNowUtc());_0x20a8f6['setHours'](_0x1f765c),_0x20a8f6['setMinutes'](_0x232cfc['minutes']),_0xbfaeb8(_0x20a8f6);}__name(updateDateTimeWithNewHours,'updateDateTimeWithNewHours');function updateDateTimeWithNewMinutes(_0x502b16,_0x229cd2,_0x187e94,_0x15e15b=-0x1677+-0x205*-0x13+-0xfe8,_0x526a33){_0x229cd2(dayjsUnitType['minutes'],_0x15e15b);const _0x273a46=parseToUtc(_0x526a33??getNowUtc());_0x273a46['setHours'](_0x502b16['hours']),_0x273a46['setMinutes'](_0x15e15b),_0x187e94(_0x273a46);}__name(updateDateTimeWithNewMinutes,'updateDateTimeWithNewMinutes');function updateHours(_0x1817bf,_0x9bee2a,_0x387a59,_0x3a134d,_0x1432e9){if(isEmptyNullOrUndefined(_0x1432e9)){let _0x27af16=getNowUtc();_0x3a134d(_0x27af16);}_0x1817bf>-0x2166+0xf8a+0x11f3?updateDateTimeWithNewHours(_0x9bee2a,_0x387a59,_0x3a134d,0x19e3*0x1+-0x36*-0x88+-0x2*0x1b3e,_0x1432e9):updateDateTimeWithNewHours(_0x9bee2a,_0x387a59,_0x3a134d,_0x1817bf,_0x1432e9);}__name(updateHours,'updateHours');function updateMinutes(_0x1445b1,_0x507d2c,_0x19be6b,_0x57c8a4,_0x37b862){if(isEmptyNullOrUndefined(_0x37b862)){let _0x18b81a=getNowUtc();_0x57c8a4(_0x18b81a);}_0x1445b1>0xaa+-0x4*-0x60c+-0x189f?updateDateTimeWithNewMinutes(_0x507d2c,_0x19be6b,_0x57c8a4,-0x25c+0x14c7*-0x1+0x1*0x175e,_0x37b862):updateDateTimeWithNewMinutes(_0x507d2c,_0x19be6b,_0x57c8a4,_0x1445b1,_0x37b862);}__name(updateMinutes,'updateMinutes');function updateDate(_0x4835c3,_0x4397a0,_0x3c9933,_0x4ceb9a){_0x4ceb9a&&(!_0x3c9933?_0x4397a0(_0x4ceb9a):_0x4397a0(getDateWithTime(_0x4ceb9a,_0x4835c3)));}__name(updateDate,'updateDate');function resetDate(_0x22b912,_0x47a020){_0x22b912?.(),_0x47a020({'hours':0x0,'minutes':0x0});}__name(resetDate,'resetDate');function onDateChangeHandler(_0x56b9ce,_0x51f853,_0x7ed56d,_0xe6a9c7,_0x30c7b5){updateDate(_0x56b9ce,_0x51f853,_0x7ed56d,_0xe6a9c7),_0x30c7b5?.(_0xe6a9c7);}__name(onDateChangeHandler,'onDateChangeHandler');function onDateResetHandler(_0x4f80ca,_0x40c014,_0x4b9e18,_0x24654e){_0x4f80ca['stopPropagation'](),resetDate(_0x40c014,_0x4b9e18),_0x24654e?.();}__name(onDateResetHandler,'onDateResetHandler');function onDatePickerOpenChange(_0x4d4803,_0x24e730,_0x288d65){_0x24e730(_0x4d4803),_0x288d65?.(_0x4d4803);}__name(onDatePickerOpenChange,'onDatePickerOpenChange');function updateDateValue(_0x136eac,_0x2bcb44,_0x447965){_0x136eac(_0x447965),_0x2bcb44?.(_0x447965);}__name(updateDateValue,'updateDateValue');function onTimeValueChange(_0x4c2adc,_0x1c9325,_0x38e749,_0x20f4c5,_0x198446,_0x10931b,_0x498f04){let _0x1ce5ea={..._0x38e749};if(_0x4c2adc===dayjsUnitType['hours'])_0x1ce5ea['hours']=_0x1c9325;else _0x4c2adc===dayjsUnitType['minutes']&&(_0x1ce5ea['minutes']=_0x1c9325);_0x20f4c5(_0x1ce5ea),_0x198446?.(_0x498f04),_0x10931b?.(_0x1ce5ea);}__name(onTimeValueChange,'onTimeValueChange');function syncDateState(_0x1c81a8,_0x1809b8,_0x4756e2){if(_0x4756e2&&_0x4756e2!==''){const _0x5880cc=parseUtcStringToDate(_0x4756e2);_0x1c81a8(_0x5880cc),_0x1809b8({'hours':_0x5880cc['getHours'](),'minutes':_0x5880cc['getMinutes']()});}else _0x1c81a8(void(0x463*-0x2+0x1336+0x14e*-0x8)),_0x1809b8({'hours':0x0,'minutes':0x0});}__name(syncDateState,'syncDateState');function processLabelState(_0x1b9241,_0x47c83f,_0x3e18c6){_0x1b9241['length']>-0x13c9+0x1569+-0x18c&&(_0x47c83f(shortenWithEllipsis(_0x1b9241,0x1e57+-0x22f1+0x4ae)),_0x3e18c6(![]));}__name(processLabelState,'processLabelState');

export { getDateWithTime, localizedFormat, onDateChangeHandler, onDatePickerOpenChange, onDateResetHandler, onTimeValueChange, processLabelState, resetDate, syncDateState, updateDate, updateDateTimeWithNewHours, updateDateTimeWithNewMinutes, updateDateValue, updateHours, updateMinutes };
