{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nexport function findValidateTime(date, getHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits, generateConfig) {\n var nextDate = date;\n function alignValidate(getUnitValue, setUnitValue, units) {\n var nextValue = generateConfig[getUnitValue](nextDate);\n var nextUnit = units.find(function (unit) {\n return unit.value === nextValue;\n });\n if (!nextUnit || nextUnit.disabled) {\n // Find most closest unit\n var validateUnits = units.filter(function (unit) {\n return !unit.disabled;\n });\n var reverseEnabledUnits = _toConsumableArray(validateUnits).reverse();\n var validateUnit = reverseEnabledUnits.find(function (unit) {\n return unit.value <= nextValue;\n }) || validateUnits[0];\n if (validateUnit) {\n nextValue = validateUnit.value;\n nextDate = generateConfig[setUnitValue](nextDate, nextValue);\n }\n }\n return nextValue;\n }\n\n // Find validate hour\n var nextHour = alignValidate('getHour', 'setHour', getHourUnits());\n\n // Find validate minute\n var nextMinute = alignValidate('getMinute', 'setMinute', getMinuteUnits(nextHour));\n\n // Find validate second\n var nextSecond = alignValidate('getSecond', 'setSecond', getSecondUnits(nextHour, nextMinute));\n\n // Find validate millisecond\n alignValidate('getMillisecond', 'setMillisecond', getMillisecondUnits(nextHour, nextMinute, nextSecond));\n return nextDate;\n}","map":{"version":3,"names":["_toConsumableArray","findValidateTime","date","getHourUnits","getMinuteUnits","getSecondUnits","getMillisecondUnits","generateConfig","nextDate","alignValidate","getUnitValue","setUnitValue","units","nextValue","nextUnit","find","unit","value","disabled","validateUnits","filter","reverseEnabledUnits","reverse","validateUnit","nextHour","nextMinute","nextSecond"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-picker/es/PickerPanel/TimePanel/TimePanelBody/util.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nexport function findValidateTime(date, getHourUnits, getMinuteUnits, getSecondUnits, getMillisecondUnits, generateConfig) {\n var nextDate = date;\n function alignValidate(getUnitValue, setUnitValue, units) {\n var nextValue = generateConfig[getUnitValue](nextDate);\n var nextUnit = units.find(function (unit) {\n return unit.value === nextValue;\n });\n if (!nextUnit || nextUnit.disabled) {\n // Find most closest unit\n var validateUnits = units.filter(function (unit) {\n return !unit.disabled;\n });\n var reverseEnabledUnits = _toConsumableArray(validateUnits).reverse();\n var validateUnit = reverseEnabledUnits.find(function (unit) {\n return unit.value <= nextValue;\n }) || validateUnits[0];\n if (validateUnit) {\n nextValue = validateUnit.value;\n nextDate = generateConfig[setUnitValue](nextDate, nextValue);\n }\n }\n return nextValue;\n }\n\n // Find validate hour\n var nextHour = alignValidate('getHour', 'setHour', getHourUnits());\n\n // Find validate minute\n var nextMinute = alignValidate('getMinute', 'setMinute', getMinuteUnits(nextHour));\n\n // Find validate second\n var nextSecond = alignValidate('getSecond', 'setSecond', getSecondUnits(nextHour, nextMinute));\n\n // Find validate millisecond\n alignValidate('getMillisecond', 'setMillisecond', getMillisecondUnits(nextHour, nextMinute, nextSecond));\n return nextDate;\n}"],"mappings":"AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,OAAO,SAASC,gBAAgBA,CAACC,IAAI,EAAEC,YAAY,EAAEC,cAAc,EAAEC,cAAc,EAAEC,mBAAmB,EAAEC,cAAc,EAAE;EACxH,IAAIC,QAAQ,GAAGN,IAAI;EACnB,SAASO,aAAaA,CAACC,YAAY,EAAEC,YAAY,EAAEC,KAAK,EAAE;IACxD,IAAIC,SAAS,GAAGN,cAAc,CAACG,YAAY,CAAC,CAACF,QAAQ,CAAC;IACtD,IAAIM,QAAQ,GAAGF,KAAK,CAACG,IAAI,CAAC,UAAUC,IAAI,EAAE;MACxC,OAAOA,IAAI,CAACC,KAAK,KAAKJ,SAAS;IACjC,CAAC,CAAC;IACF,IAAI,CAACC,QAAQ,IAAIA,QAAQ,CAACI,QAAQ,EAAE;MAClC;MACA,IAAIC,aAAa,GAAGP,KAAK,CAACQ,MAAM,CAAC,UAAUJ,IAAI,EAAE;QAC/C,OAAO,CAACA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