'use strict';
import { startEndDateProps } from './start-end-date.js';

var __defProp=Object['defineProperty'],__name=(_0x4af6ae,_0xbede98)=>__defProp(_0x4af6ae,'name',{'value':_0xbede98,'configurable':!![]});function tryGetDurationSeconds(_0x376f65){if(_0x376f65['endDate'])return Math['floor']((_0x376f65['endDate']['getTime']()-_0x376f65['startDate']['getTime']())/(0x851+0x2*-0xbf5+-0x1381*-0x1));return void(-0xce9*-0x1+-0x1736*-0x1+-0x241f);}__name(tryGetDurationSeconds,'tryGetDurationSeconds');function getDurationSeconds(_0x319b84){const _0xf73117=_0x319b84['endDate']['getTime']();return Math['floor']((_0xf73117-_0x319b84['startDate']['getTime']())/(0x216d+-0x2*0x10de+-0x437*-0x1));}__name(getDurationSeconds,'getDurationSeconds');function getDurationSecondsFromStartEndDates(_0x3e6369,_0x1e5e86,_0x581d00){let _0x265591=0x1159+-0x1f*0xe0+0x9c7;for(const _0x2df7e1 of _0x3e6369){(!_0x581d00||_0x581d00(_0x2df7e1))&&startEndDateProps['endDate']in _0x2df7e1&&(_0x265591+=sumDurationSeconds(_0x2df7e1,_0x1e5e86));}return _0x265591;}__name(getDurationSecondsFromStartEndDates,'getDurationSecondsFromStartEndDates');function sumDurationSeconds(_0x5c9b0f,_0x2a808a){let _0x5d9c16=0x1ac*0x1+0xa*-0x4c+-0xa6*-0x2;if(!_0x2a808a||_0x5c9b0f['startDate']>=_0x2a808a)_0x5d9c16+=getDurationSeconds(_0x5c9b0f);else _0x5c9b0f['startDate']<_0x2a808a&&_0x5c9b0f['endDate']>=_0x2a808a&&(_0x5d9c16+=Math['floor']((_0x5c9b0f['endDate']['getTime']()-_0x2a808a['getTime']())/(0x115d+0x2*0xd76+-0x2861)));return _0x5d9c16;}__name(sumDurationSeconds,'sumDurationSeconds');function getDurationSecondsExcludeOverlaps(_0x15e5a2,_0x6091a3){const _0x3d8420=getFilteredAndSortedRanges(_0x15e5a2,_0x6091a3);let _0x5b311d=-0x13c8+0x74d+-0xd5*-0xf;for(let _0x3e452f=-0x1506+0x12*-0xa4+0x1047*0x2;_0x3e452f<_0x3d8420['length'];_0x3e452f++){const _0x16c011=_0x3d8420[_0x3e452f];if(_0x3e452f===-0x1d2+0x4a9*-0x1+0x67b)_0x5b311d+=sumDurationSeconds(_0x16c011,_0x6091a3);else {const _0x36003d=_0x3d8420[_0x3e452f-(-0x1ba4+0x2c*-0x42+0x26fd)];if(!shouldSkipRange(_0x6091a3,_0x16c011,_0x36003d)){const _0x2a512a=countDifferenceBetweenRangesEndDates(_0x16c011,_0x36003d,_0x5b311d);if(_0x2a512a>_0x5b311d)_0x5b311d=_0x2a512a;else _0x16c011['endDate']>_0x36003d['endDate']&&(_0x5b311d+=sumDurationSeconds(_0x16c011,_0x6091a3));}}}return _0x5b311d;}__name(getDurationSecondsExcludeOverlaps,'getDurationSecondsExcludeOverlaps');function getFilteredAndSortedRanges(_0x286e06,_0xa9f77f){return _0x286e06['filter'](_0x334a38=>!_0xa9f77f||_0x334a38['endDate']>_0xa9f77f)['sort']((_0x5278e2,_0x22862e)=>_0x5278e2['startDate']['getTime']()-_0x22862e['startDate']['getTime']());}__name(getFilteredAndSortedRanges,'getFilteredAndSortedRanges');function shouldSkipRange(_0x5583c7,_0x108ef3,_0x5a9f6e){const _0x525f75=!_0x5583c7||_0x5583c7>_0x108ef3['startDate'];return _0x525f75&&_0x5583c7<_0x5a9f6e['endDate']&&_0x108ef3['endDate']<_0x5a9f6e['endDate']||!_0x525f75&&_0x108ef3['startDate']<_0x5a9f6e['endDate']&&_0x108ef3['endDate']<_0x5a9f6e['endDate'];}__name(shouldSkipRange,'shouldSkipRange');function countDifferenceBetweenRangesEndDates(_0x4ac367,_0x56383f,_0x3f62ca){const _0x3c327a=_0x4ac367['startDate']<_0x56383f['endDate']&&_0x4ac367['endDate']>_0x56383f['endDate'];if(_0x3c327a)return _0x3f62ca+Math['floor']((_0x4ac367['endDate']['getTime']()-_0x56383f['startDate']['getTime']())/(0x7eb*0x2+-0xb*0x10+-0x1*0xb3e));return 0xb0b+0x1bd8+-0x26e3;}__name(countDifferenceBetweenRangesEndDates,'countDifferenceBetweenRangesEndDates');

export { getDurationSeconds, getDurationSecondsExcludeOverlaps, getDurationSecondsFromStartEndDates, sumDurationSeconds, tryGetDurationSeconds };
