/*
 * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
 * This devtool is neither made for production nor for readable output files.
 * It uses "eval()" calls to create a separate source file in the browser devtools.
 * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
 * or disable the default devtool with "devtool: false".
 * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
 */
/******/ (() => { // webpackBootstrap
/******/ 	var __webpack_modules__ = ({

/***/ "./assets/src/js/store-open-close-time.js":
/*!************************************************!*\
  !*** ./assets/src/js/store-open-close-time.js ***!
  \************************************************/
/***/ (() => {

eval(";\n\n(function ($) {\n  var multipleTimeStepping = dokanMultipleTime.step,\n      multipleTimeFormat = dokanMultipleTime.format,\n      maximumTimeForOpening = dokanMultipleTime.openingMaxTime,\n      minimumTimeForOpening = dokanMultipleTime.openingMinTime,\n      maximumTimeForClosing = dokanMultipleTime.closingMaxTime,\n      minimumTimeForClosing = dokanMultipleTime.closingMinTime,\n      multipleOpenCloseTime = {\n    init: function init() {\n      $('.dokan-store-times').on('click', '.open-close-actions a', this.stopDefaultBehaviour);\n      $('.dokan-store-times').on('focus', '.dokan-form-control', this.changeClockTimeOnFocus);\n      $('.dokan-store-times').each(this.onLoadContainer);\n      $('.dokan-store-times').on('click', '.added-store-opening-time', this.addedStoreMultipleTime);\n      $('.dokan-store-times').on('click', '.remove-store-closing-time', this.removeStoreMultipleTime);\n      $('input[name=\"dokan_update_store_settings\"]').on('click', this.updateStoreSettings);\n      $('.dokan-store-times').on('change', '.dokan-form-group', this.changeDokanOpenCloseTime);\n      $('.dokan-store-times').on('change', '.opening-time', this.changeSlotAfterOpeningUpdate);\n    },\n    stopDefaultBehaviour: function stopDefaultBehaviour(e) {\n      e.stopPropagation();\n      e.preventDefault();\n    },\n    // Change our timepicker index when focused in our clock.\n    changeClockTimeOnFocus: function changeClockTimeOnFocus(e) {\n      e.stopPropagation();\n      var self = $(this);\n      self.closest('.dokan-form-group').find('.time .clock-picker .dokan-form-control:eq(0)').timepicker({\n        scrollDefault: 'now',\n        minTime: minimumTimeForOpening,\n        maxTime: maximumTimeForOpening,\n        timeFormat: multipleTimeFormat,\n        step: multipleTimeStepping\n      });\n      self.closest('.dokan-form-group').find('.time .clock-picker .dokan-form-control:eq(1)').timepicker({\n        scrollDefault: 'now',\n        minTime: minimumTimeForClosing,\n        maxTime: maximumTimeForClosing,\n        timeFormat: multipleTimeFormat,\n        step: multipleTimeStepping\n      });\n    },\n    // Set our default behaviour for multiple store time settings.\n    onLoadContainer: function onLoadContainer(e) {\n      $(this).find('.dokan-form-group').each(function (e) {\n        var self = $(this),\n            closeValue = self.find('.time .clock-picker .dokan-form-control:eq(1)').val(),\n            selfFoundSpan = self.closest('.dokan-form-group').find('span.and-time'),\n            formattedCloseValue = moment(maximumTimeForClosing, dokan_get_i18n_time_format()).format('HH:mm'),\n            formattedMaxCloseValue = moment(closeValue, dokan_get_i18n_time_format()).format('HH:mm');\n\n        if (formattedMaxCloseValue === formattedCloseValue) {\n          self.find('.added-store-opening-time').css({\n            'visibility': 'hidden'\n          });\n        } // If have next row then execute our validation\n\n\n        if ('undefined' === typeof selfFoundSpan[0]) {\n          self.find('.remove-store-closing-time').css({\n            'color': '#bbb'\n          });\n          self.find('.remove-store-closing-time').removeAttr('class');\n        }\n      });\n    },\n    // Added a new row for set multiple time in store time settings.\n    addedStoreMultipleTime: function addedStoreMultipleTime(e) {\n      var self = $(this),\n          openingId = self.closest('.dokan-store-times').find('.dokan-form-group .dokan-form-control').get(0).id,\n          closingId = self.closest('.dokan-store-times').find('.dokan-form-group .dokan-form-control').get(1).id,\n          openingName = self.closest('.dokan-store-times').find('.dokan-form-group .dokan-form-control').get(0).name,\n          closingName = self.closest('.dokan-store-times').find('.dokan-form-group .dokan-form-control').get(1).name,\n          addNewRow = \"<div class='dokan-form-group'>\\n                                    <span class='and-time'></span>\\n                                    <label for='opening-time' class='time'>\\n                                        <div class='clock-picker'>\\n                                            <span class='fa fa-clock-o' aria-hidden='true'></span>\\n                                            <input type='text'\\n                                                class='dokan-form-control opening-time'\\n                                                name='\".concat(openingName, \"'\\n                                                id='\").concat(openingId, \"'\\n                                                placeholder='\").concat(dokanMultipleTime.placeholder, \"'\\n                                                autocomplete='off'\\n                                                value=''>\\n                                            <span class='fa fa-exclamation-triangle'></span>\\n                                        </div>\\n                                    </label>\\n                                    <span class='time-to'> &#45; </span>\\n                                    <label for='closing-time' class='time'>\\n                                        <div class='clock-picker'>\\n                                            <span class='fa fa-clock-o' aria-hidden='true'></span>\\n                                            <input type='text'\\n                                                class='dokan-form-control closing-time'\\n                                                name='\").concat(closingName, \"'\\n                                                id='\").concat(closingId, \"'\\n                                                placeholder='\").concat(dokanMultipleTime.placeholder, \"'\\n                                                autocomplete='off'\\n                                                value=''>\\n                                            <span class='fa fa-exclamation-triangle'></span>\\n                                        </div>\\n                                    </label>\\n                                    <label for='open-close-actions' class='time open-close-actions' style='display: flex; align-items: center;'>\\n                                        <a href='' class='remove-store-closing-time'>\\n                                            <span class='fa fa-times' aria-hidden='true'></span>\\n                                        </a>\\n                                        <a href='' class='added-store-opening-time'>\\n                                            <span class='fa fa-plus' aria-hidden='true' ></span>\\n                                        </a>\\n                                    </label>\\n                                </div>\");\n      self.closest('.dokan-form-group').after(addNewRow);\n      self.closest('.dokan-form-group').next('.dokan-form-group').hide(0, function () {\n        $(this).slideDown(300);\n      });\n    },\n    // Remove current row for delete settings.\n    removeStoreMultipleTime: function removeStoreMultipleTime(e) {\n      var self = $(this),\n          prevSpan = self.closest('.dokan-form-group').prev('.dokan-form-group').find('span.and-time'),\n          nextElement = self.closest('.dokan-form-group').next('.dokan-form-group');\n\n      if ('undefined' === typeof prevSpan[0] && 'undefined' === typeof nextElement[0]) {\n        self.closest('.dokan-form-group').prev('.dokan-form-group').find('.remove-store-closing-time span').css({\n          'color': '#bbb'\n        });\n        self.closest('.dokan-form-group').prev('.dokan-form-group').find('.open-close-actions a:eq(0)').removeAttr('class');\n      }\n\n      if ('undefined' !== typeof nextElement[0]) {\n        var nextOpenTimeValue = nextElement.find('.time .dokan-form-control:eq(0)').val(),\n            prevCloseTimeValue = self.closest('.dokan-form-group').prev('.dokan-form-group').find('.time .dokan-form-control:eq(1)').val(),\n            formattedOpenValue = moment(nextOpenTimeValue, dokan_get_i18n_time_format()).format('HH:mm'),\n            formattedCloseValue = moment(prevCloseTimeValue, dokan_get_i18n_time_format()).format('HH:mm');\n\n        if (formattedCloseValue < formattedOpenValue) {\n          self.closest('.dokan-form-group').next('.dokan-form-group').find('.time .clock-picker:eq(0)').css({\n            'border-color': '#bbb'\n          });\n          self.closest('.dokan-form-group').next('.dokan-form-group').find('.time .clock-picker:eq(0) .fa-clock-o').css({\n            'color': '#666'\n          });\n          self.closest('.dokan-form-group').next('.dokan-form-group').find('.time .dokan-form-control:eq(0)').css({\n            'color': '#4e4e4e'\n          });\n        }\n      }\n\n      self.closest('.dokan-form-group').slideUp(300, function () {\n        $(this).remove();\n      });\n    },\n    // Update timepicker index when change our clock.\n    changeDokanOpenCloseTime: function changeDokanOpenCloseTime(e) {\n      e.stopPropagation();\n      var root = $(this),\n          closeValue = root.find('.time .clock-picker .dokan-form-control:eq(1)').val(),\n          formattedCloseValue = moment(closeValue, dokan_get_i18n_time_format()).format('HH:mm'),\n          formattedMaxCloseValue = moment(maximumTimeForClosing, dokan_get_i18n_time_format()).format('HH:mm');\n      $('.ui-timepicker-wrapper').hide();\n      root.find('.added-store-opening-time').css({\n        'visibility': 'visible'\n      });\n\n      if (formattedMaxCloseValue === formattedCloseValue) {\n        root.find('.added-store-opening-time').css({\n          'visibility': 'hidden'\n        });\n      }\n\n      $('.dokan-store-times').each(function () {\n        var form_length = $(this).find('.dokan-form-group').length,\n            i = 0;\n\n        for (i; i < form_length; i++) {\n          var self = $(this),\n              openValue = self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker .dokan-form-control:eq(0)').val(),\n              _closeValue = self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker .dokan-form-control:eq(1)').val(),\n              formattedOpenValue = moment(openValue, dokan_get_i18n_time_format()).format('HH:mm'),\n              _formattedCloseValue = moment(_closeValue, dokan_get_i18n_time_format()).format('HH:mm');\n\n          if (openValue) {\n            if (_closeValue && formattedOpenValue > _formattedCloseValue) {\n              self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker .dokan-form-control').focus();\n              self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker').css({\n                'border-color': '#F87171'\n              });\n              self.find('.dokan-form-group:eq(' + i + ') .time .fa-clock-o').css({\n                'color': '#F87171'\n              });\n              self.find('.dokan-form-group:eq(' + i + ') .time .dokan-form-control').css({\n                'color': '#F87171'\n              });\n            } else {\n              self.find('.dokan-form-group:eq(' + i + ') .time .dokan-form-control').css({\n                'color': '#4e4e4e'\n              });\n              self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker').css({\n                'border-color': '#bbb'\n              });\n              self.find('.dokan-form-group:eq(' + i + ') .time .fa-clock-o').css({\n                'color': '#666'\n              });\n            }\n          }\n\n          if (!openValue || !_closeValue) {\n            self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker').css({\n              'border-color': '#F5C33B'\n            });\n            self.find('.dokan-form-group:eq(' + i + ') .time .fa-exclamation-triangle').css({\n              'display': 'block'\n            });\n          } else {\n            self.find('.dokan-form-group:eq(' + i + ') .time .fa-exclamation-triangle').css({\n              'display': 'none'\n            });\n          }\n        }\n      });\n    },\n    updateStoreSettings: function updateStoreSettings(event) {\n      $('.dokan-store-times').each(function () {\n        var i = 0,\n            form_length = $(this).find('.dokan-form-group').length,\n            checkedDays = [];\n        $('.store-day-selectbox option:selected').each(function () {\n          var el = $(this).attr('data-tag');\n          checkedDays.push(el);\n        });\n\n        for (i; i < form_length; i++) {\n          var self = $(this),\n              selfId = self.attr('id'),\n              prevElement = self.find('.dokan-form-group:eq(' + i + ')').prev('.dokan-form-group'),\n              openValue = self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker .dokan-form-control:eq(0)').val(),\n              closeValue = self.find('.dokan-form-group:eq(' + i + ') .time .clock-picker .dokan-form-control:eq(1)').val(),\n              prevCloseValue = self.find('.dokan-form-group:eq(' + (i - 1) + ') .dokan-form-control:eq(1)').val(),\n              formattedOpenValue = moment(openValue, dokan_get_i18n_time_format()).format('HH:mm'),\n              formattedCloseValue = moment(closeValue, dokan_get_i18n_time_format()).format('HH:mm'),\n              formattedPrevCloseValue = moment(prevCloseValue, dokan_get_i18n_time_format()).format('HH:mm');\n\n          if ($.inArray(selfId, checkedDays) === -1) {\n            continue;\n          }\n\n          if (!openValue) {\n            multipleOpenCloseTime.updateSettingsView(self, i, selfId, 150, 0);\n            event.preventDefault();\n            return false;\n          }\n\n          if (!closeValue) {\n            multipleOpenCloseTime.updateSettingsView(self, i, selfId, 150, 1);\n            event.preventDefault();\n            return false;\n          }\n\n          if (formattedOpenValue > formattedCloseValue) {\n            multipleOpenCloseTime.updateSettingsView(self, i, selfId, 300);\n            event.preventDefault();\n            return false;\n          }\n\n          if ('undefined' === typeof prevElement[0]) {\n            continue;\n          }\n\n          if (prevCloseValue && formattedOpenValue < formattedPrevCloseValue) {\n            multipleOpenCloseTime.updateSettingsView(self, i, selfId, 300, 0);\n            event.preventDefault();\n            return false;\n          }\n        }\n\n        return true;\n      });\n    },\n    updateSettingsView: function updateSettingsView(element, domIndex, selfId, animateSpeed) {\n      var eq = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;\n      return function (eq) {\n        var eq = false !== eq ? \":eq(\".concat(eq, \")\") : '';\n        element.find('.dokan-form-group:eq(' + domIndex + ') .time .clock-picker .dokan-form-control' + eq).focus();\n        element.find('.dokan-form-group:eq(' + domIndex + ') .time .clock-picker' + eq).css({\n          'border-color': '#F87171'\n        });\n        element.find('.dokan-form-group:eq(' + domIndex + ') .time .clock-picker' + eq + ' .fa-clock-o').css({\n          'color': '#F87171'\n        });\n        element.find('.dokan-form-group:eq(' + domIndex + ') .time .dokan-form-control' + eq).css({\n          'color': '#F87171'\n        });\n        $('.tabs li').removeClass('active');\n        $('.dokan-store-times.panel').removeClass('active').attr('style', 'display: none;');\n        $('.tabs li[rel=' + selfId + ']').addClass('active');\n        $('#' + selfId).addClass('active').attr('style', 'display: block;');\n        $('html, body').animate({\n          scrollTop: $('.time-slot-tabs').offset().top - 120\n        }, animateSpeed);\n      }(eq);\n    },\n    // Change our store slots after update our store opening time.\n    changeSlotAfterOpeningUpdate: function changeSlotAfterOpeningUpdate() {\n      var self = $(this),\n          getId = self.closest('.dokan-store-times').attr('id'),\n          currentElementOT = self.val(),\n          currentElementCT = self.closest('.dokan-form-group').find('.closing-time').val(),\n          formLength = $('#' + getId).find('.dokan-form-group').length,\n          length = formLength - 1,\n          openValue = self.val(),\n          openValues = $('#' + getId + ' .opening-time').serializeArray(),\n          findNextElement = self.closest('.dokan-form-group').next('.dokan-form-group'),\n          findPrevElement = self.closest('.dokan-form-group').prev('.dokan-form-group'),\n          checkValuesTop = [],\n          checkValuesBottom = [];\n      openValues.forEach(function (data, index) {\n        var formattedOpenValue = moment(openValue, dokan_get_i18n_time_format()).format('HH:mm'),\n            formattedDataValue = moment(data.value, dokan_get_i18n_time_format()).format('HH:mm');\n\n        if (formattedOpenValue <= formattedDataValue) {\n          checkValuesTop.push(index);\n        }\n\n        if (formattedOpenValue > formattedDataValue) {\n          checkValuesBottom.push(index);\n        }\n      });\n\n      if (0 === checkValuesTop[0] && 'undefined' !== typeof findPrevElement[0]) {\n        var firstElement = $('#' + getId + ' .dokan-form-group:eq(0)'),\n            firstElementOT = $('#' + getId + ' .dokan-form-group:eq(0) .opening-time').val(),\n            firstElementCT = $('#' + getId + ' .dokan-form-group:eq(0) .closing-time').val();\n        firstElement.slideUp(150, function () {\n          firstElement.find('.opening-time').val(currentElementOT);\n          firstElement.find('.closing-time').val(currentElementCT);\n\n          if (!currentElementOT || !currentElementCT) {\n            firstElement.find('.clock-picker').css({\n              'border-color': '#F5C33B'\n            });\n            firstElement.find('.fa-exclamation-triangle').css({\n              'display': 'block'\n            });\n          }\n\n          firstElement.find('.time .clock-picker .fa-clock-o').css({\n            'color': '#666'\n          });\n          firstElement.find('.time .dokan-form-control').css({\n            'color': '#4e4e4e'\n          });\n          firstElement.slideDown(300);\n        });\n        self.closest('.dokan-form-group').slideUp(150, function () {\n          self.closest('.dokan-form-group').find('.opening-time').val(firstElementOT);\n          self.closest('.dokan-form-group').find('.closing-time').val(firstElementCT);\n          self.closest('.dokan-form-group').find('.clock-picker').css({\n            'border-color': '#bbb'\n          });\n          self.closest('.dokan-form-group').find('.fa-exclamation-triangle').css({\n            'display': 'none'\n          });\n          $('#' + getId + ' .dokan-form-group:eq(1)').before(self.closest('.dokan-form-group').slideDown());\n        });\n      }\n\n      if (checkValuesTop[0] && checkValuesTop[0] !== length) {\n        self.closest('.dokan-form-group').slideUp(150, function () {\n          if (!currentElementOT || !currentElementCT) {\n            self.closest('.dokan-form-group').find('.clock-picker').css({\n              'border-color': '#F5C33B'\n            });\n            self.closest('.dokan-form-group').find('.fa-exclamation-triangle').css({\n              'display': 'block'\n            });\n          }\n\n          $('#' + getId + ' .dokan-form-group:eq(' + checkValuesTop[0] + ')').before(self.closest('.dokan-form-group').slideDown(300));\n        });\n      }\n\n      if (checkValuesBottom[checkValuesBottom.length - 1] && 'undefined' !== typeof findNextElement[0]) {\n        if ('undefined' === typeof findPrevElement[0]) {\n          var startLabel = self.closest('.dokan-form-group').find('.start-label'),\n              endLabel = self.closest('.dokan-form-group').find('.end-label');\n          $('#' + getId + ' .dokan-form-group:eq(1) .clock-picker:eq(0)').before(startLabel);\n          $('#' + getId + ' .dokan-form-group:eq(1) .clock-picker:eq(1)').before(endLabel);\n          $('#' + getId + ' .dokan-form-group:eq(1) .remove-store-closing-time').removeAttr('class');\n          $('#' + getId + ' .dokan-form-group:eq(1) .open-close-actions a:eq(0)').css({\n            'color': '#bbb'\n          });\n          $('#' + getId + ' .dokan-form-group:eq(0) .clock-picker:eq(0) .start-label').remove();\n          $('#' + getId + ' .dokan-form-group:eq(0) .clock-picker:eq(1) .end-label').remove();\n          $('#' + getId + ' .dokan-form-group:eq(0) .open-close-actions a:eq(0)').addClass('remove-store-closing-time');\n          $('#' + getId + ' .dokan-form-group:eq(0) .remove-store-closing-time').css({\n            'color': '#F87171'\n          });\n        }\n\n        self.closest('.dokan-form-group').slideUp(150, function () {\n          if (!currentElementOT || !currentElementCT) {\n            self.closest('.dokan-form-group').find('.clock-picker').css({\n              'border-color': '#F5C33B'\n            });\n            self.closest('.dokan-form-group').find('.fa-exclamation-triangle').css({\n              'display': 'block'\n            });\n          }\n\n          $('#' + getId + ' .dokan-form-group:eq(' + checkValuesBottom[checkValuesBottom.length - 1] + ')').after(self.closest('.dokan-form-group').slideDown(300));\n        });\n      }\n    }\n  };\n  var checkedDays = [];\n  $('.store-day-selectbox option').each(function () {\n    var thisOptionValue = $(this)[0].hasAttribute('selected');\n\n    if (thisOptionValue) {\n      checkedDays.push($(this).val());\n    }\n  }); // Show our panels active when selected days.\n\n  $('.store-day-selectbox').on('change', function () {\n    var thisValue = $(this).val(),\n        selectedOptionValues = thisValue;\n    getStoreDays(selectedOptionValues);\n\n    if (0 === checkedDays.length) {\n      $('.dokan-store-times .overlay').slideDown(300);\n    } else {\n      $('.dokan-store-times .overlay').slideUp(300);\n    }\n  }); // Panels active function execution form here.\n\n  function getStoreDays(selectedDays) {\n    checkedDays = [];\n    $('.store-day-selectbox option').each(function () {\n      var self = $(this),\n          thisOptionValue = self.val();\n\n      if ($.isArray(selectedDays)) {\n        var filteredValue = selectedDays.filter(selectedDay),\n            element = $('.store-day-selectbox option[value=\"' + filteredValue[0] + '\"]'),\n            elementTag = element.attr('data-tag'); // Get selected days from here.\n\n        function selectedDay(day) {\n          return day === thisOptionValue;\n        }\n\n        if (elementTag) {\n          element.attr('selected', 'selected');\n          $('.tab-panels .tabs li[rel=\"' + elementTag + '\"]').removeClass('deactivated');\n          checkedDays.push(elementTag);\n        } else {\n          var _elementTag = $(this).attr('data-tag');\n\n          self.removeAttr('selected');\n          $('.tab-panels .tabs li[rel=\"' + _elementTag + '\"]').addClass('deactivated');\n        }\n      }\n    });\n  } // Initialize our select2 plugin here for multiple selected days.\n\n\n  $(\".store-day-selectbox\").select2({\n    multiple: true,\n    placeholder: dokanMultipleTime.selectDefault,\n    allowClear: true,\n    templateResult: function templateResult(value) {\n      if (value && !value.selected) {\n        return $('<span>' + value.text + '</span>');\n      }\n    }\n  }); // Selected our store day options here.\n\n  $(\".store-day-selectbox\").val(checkedDays).trigger('change');\n  $('.tab-panels .tabs li').each(function () {\n    // Figure out which panel to show.\n    var self = $(this),\n        panelToShow = self.attr('rel'),\n        filterActive = self.filter(\"[class='active']\");\n\n    if (!checkedDays.includes(panelToShow)) {\n      self.addClass('deactivated');\n    }\n  });\n  $('.tab-panels .tabs li').on('click', function () {\n    // Figure out which panel to show.\n    var self = $(this),\n        panelToShow = self.attr('rel'),\n        hasActive = self.hasClass('active');\n\n    if (hasActive) {\n      return;\n    }\n\n    if (!checkedDays.includes(panelToShow)) {\n      return;\n    }\n\n    var $panel = self.closest('.tab-panels');\n    $panel.find('.tabs li.active').removeClass('active');\n    self.addClass('active');\n    self.removeClass('deactivated'); // Hide current panel & show a new panel.\n\n    $panel.find(' .panel.active').slideUp(300, function () {\n      $(this).removeClass('active'); // Show new panel.\n\n      $('#' + panelToShow).slideDown(300, function () {\n        $(this).addClass('active');\n      });\n    });\n    $('#' + panelToShow + ' .time').css({\n      'visibility': 'visible'\n    });\n  }); // Initialize our object here.\n\n  $(document).ready(function () {\n    multipleOpenCloseTime.init();\n  });\n})(jQuery);\n\n//# sourceURL=webpack://dokan-pro/./assets/src/js/store-open-close-time.js?");

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	
/******/ 	// startup
/******/ 	// Load entry module and return exports
/******/ 	// This entry module can't be inlined because the eval devtool is used.
/******/ 	var __webpack_exports__ = {};
/******/ 	__webpack_modules__["./assets/src/js/store-open-close-time.js"]();
/******/ 	
/******/ })()
;