import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{startOfToday}from"date-fns";import{range}from"../../utils/array";import{getForm}from"../FieldGroup/FieldGroup";export var datePickerPropSeparatorDefault=".";export var datePickerPropFormatTypeDate="dd".concat(".","MM").concat(".","yyyy");export var datePickerPropPlaceholderTypeDate="\u0414\u0414".concat(".","\u041C\u041C").concat(".","\u0413\u0413\u0413\u0413");export var datePickerPropFormatTypeTime="HH:mm:ss";export var datePickerPropPlaceholderTypeTime="\u0427\u0427:\u041C\u041C:\u0421\u0421";export var datePickerPropFormatTypeDateTime="".concat(datePickerPropFormatTypeDate," ").concat("HH:mm:ss");export var datePickerPropPlaceholderTypeDateTime="".concat(datePickerPropPlaceholderTypeDate," ").concat("\u0427\u0427:\u041C\u041C:\u0421\u0421");export var datePickerPropFormatTypeYear="yyyy";export var datePickerPropPlaceholderTypeYear="\u0413\u0413\u0413\u0413";export var datePickerPropFormatTypeMonth="MM".concat(".","yyyy");export var datePickerPropPlaceholderTypeMonth="MM".concat(".","\u0413\u0413\u0413\u0413");export var normalizeRangeValue=function(a){var b,c;return a[0]&&a[1]&&(null===(b=a[0])||void 0===b?void 0:b.getTime())>(null===(c=a[1])||void 0===c?void 0:c.getTime())?[a[1],a[0]]:a};export var getMultiplicityTime=function(a,b,c,d){var e,f=null===(e=a.split(" ")[1])||void 0===e?void 0:e.split(":"),g={HH:b,mm:c,ss:d};return["HH","mm","ss"].map(function(a){return 0>(null===f||void 0===f?void 0:f.indexOf(a))?0:g[a]})};export var getTimeEnum=function(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:1,c=2<arguments.length?arguments[2]:void 0,d=3<arguments.length?arguments[3]:void 0,e=4<arguments.length?arguments[4]:void 0,f=range(b?Math.floor(a/b):0);if(0===f.length)return[];var g=c(startOfToday());return f.map(function(a){return e(d(g,a*b))})};export var getFormForStart=function(a){return getForm(a,0,2)};export var getFormForEnd=function(a){return getForm(a,1,2)};export var getPartDate=function(a,b,c){var d=a.indexOf(c);return 0<=d&&b[d]&&b[d].length===c.length?b[d]:void 0};export var getParts=function(a,b,c){if(c){var d=a.split(" "),e=_slicedToArray(d,2),f=e[0],g=e[1];return[].concat(_toConsumableArray(f?f.split(b):[]),_toConsumableArray(g?g.split(":"):[]))}return a.split(b)};export var getPartsDate=function(a,b,c,d,e){var f=getParts(b,c,d),g=getParts(a,c,d);return e.map(function(a){return getPartDate(f,g,a)})};export var isTypeWithTime=function(a){return-1!==a.indexOf("time")};var fieldPrefixs=["start","end"];export var getFieldName=function(a,b){return a?Array.isArray(a)?a[b]:"".concat(a,"_").concat(fieldPrefixs[b]):void 0};export var getDropdownZIndex=function(a){return"number"==typeof(null===a||void 0===a?void 0:a.zIndex)?a.zIndex+1:void 0};
//# sourceMappingURL=helpers.js.map