!function(a){"use strict";"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports&&"function"==typeof require?require("jquery"):jQuery)}(function($){"use strict";var c={escapeRegExChars:function(a){return a.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(b){var a=document.createElement("div");return a.className=b,a.style.position="absolute",a.style.display="none",a.setAttribute("unselectable","on"),a},highlight:function(b,h){if(dgwt_wcas.is_premium){var d,a=h.split(/ /),i=!1,g="";if(a){for(d=0,g=a[a.length-1],a=a.sort(function(a,b){return b.length-a.length});d=1){var e=a[d].replace(/[\^\@]/g,"");if(e.length>0){if(1===e.trim().length&&a[d]!==g)var f="((\\s|^)"+c.escapeRegExChars(e.trim())+"\\s)";else if(1===e.trim().length&&a[d]===g)var f="((\\s|^)"+c.escapeRegExChars(e.trim())+")";else var f="("+c.escapeRegExChars(e.trim())+")";b=b.replace(new RegExp(f,"gi"),"^^$1@@"),i=!0}}}i&&(b=(b=b.replace(/\^\^/g,"")).replace(/@@/g,""))}else{var f="("+c.escapeRegExChars(h)+")";b=b.replace(new RegExp(f,"gi"),"$1")}return b},debounce:function(b,c){var e,a=new Date().getUTCMilliseconds();if(0===d.id.length){d.id=a,b();return}d.id=a,e=setTimeout(function(){if(a!==d.id){clearTimeout(e);return}b(),d.id=""},c)},mouseHoverDebounce:function(c,d,a){var b;b=setTimeout(function(){if($(d+":hover").length>0)c();else{clearTimeout(b);return}},a)},isTextSelected:function(){var a=!1,b=document.getSelection();return"object"==typeof b&&b.toString().length>0&&(a=!0),a},getActiveInstance:function(){var b,a=$(".dgwt-wcas-search-wrapp.dgwt-wcas-active");return a.length>0&&a.each(function(){var a=$(this).find(".dgwt-wcas-search-input");if("object"==typeof a.data("autocomplete"))return b=a.data("autocomplete"),!1}),b},hashCode:function(b){for(var a=0,c=b.length;c>0;)a=(a<<5)-a+b.charCodeAt(--c)|0;return a<0?-1*a:a}},d={id:"",callback:null,ajaxSettings:null,object:null},e={ESC:27,TAB:9,RETURN:13,LEFT:37,UP:38,RIGHT:39,DOWN:40},b=$.noop;function a(c,d){var b=this;b.element=c,b.el=$(c),b.suggestions=[],b.badQueries=[],b.selectedIndex=-1,b.currentValue=b.element.value,b.timeoutId=null,b.cachedResponse={},b.cachedDetails={},b.cachedPrices={},b.detailsRequestsSent=[],b.onChangeTimeout=null,b.onChange=null,b.isLocal=!1,b.suggestionsContainer=null,b.detailsContainer=null,b.autoAligmentprocess=null,b.noSuggestionsContainer=null,b.latestActivateSource="",b.actionTriggerSource="",b.options=$.extend(!0,{},a.defaults,d),b.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top",inputFilled:"dgwt-wcas-search-filled",darkenOverlayMounted:"js-dgwt-wcas-search-darkoverl-mounted",fixed:"dgwt-wcas-suggestions-wrapp-fixed"},b.hint=null,b.hintValue="",b.selection=null,b.overlayMobileState="off",b.overlayDarkenedState="off",b.isMouseDownOnSearchElements=!1,b.voiceSearchRecognition=null,b.voiceSearchStarted=null,b.initialize(),b.setOptions(d)}a.utils=c,$.DgwtWcasAutocompleteSearch=a,a.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,containerDetailsWidth:"auto",showDetailsPanel:!1,showImage:!1,showPrice:!1,showSKU:!1,showDescription:!1,showSaleBadge:!1,showFeaturedBadge:!1,dynamicPrices:!1,saleBadgeText:"sale",featuredBadgeText:"featured",minChars:3,maxHeight:600,dpusbBreakpoint:550,deferRequestBy:0,params:{},formatResult:function(a,b,d,e){return b&&(d&&(a=c.highlight(a,b)),e.convertHtml)?a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/<sup/g,"").replace(/<sub/g,"").replace(/<(\/?(strong|b|br|span))>/g,"<$1>").replace(/<(strong|span)\s+class\s*=\s*"([^&]+)">/g,'<$1 class="$2">'):a},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:b,onSearchComplete:b,onSearchError:b,preserveInput:!1,searchFormClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",darkenedOverlayClass:"dgwt-wcas-darkened-overlay",searchInputClass:"dgwt-wcas-search-input",preloaderClass:"dgwt-wcas-preloader",closeTrigger:"dgwt-wcas-close",formClass:"dgwt-wcas-search-form",voiceSearchClass:"dgwt-wcas-voice-search",voiceSearchSupportedClass:"dgwt-wcas-voice-search-supported",voiceSearchActiveClass:"dgwt-wcas-voice-search-active",voiceSearchDisabledClass:"dgwt-wcas-voice-search-disabled",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,isPremium:!1,overlayMobile:!1,preventBadQueries:!0,lookupFilter:function(a,c,b){return -1!==a.value.toLowerCase().indexOf(b)},paramName:"query",transformResult:function(a){return"string"==typeof a?JSON.parse(a):a},noSuggestionNotice:"No results",forceFixPosition:!1,positionFixed:!1,debounceWaitMs:400,sendGAEvents:!0,enableGASiteSearchModule:!1,showProductVendor:!1,disableHits:!1,disableSubmit:!1,voiceSearchEnabled:!1,voiceSearchLang:""},a.prototype={initialize:function(){var a=this;a.element.setAttribute("autocomplete","off"),a.options.params=a.applyCustomParams(a.options.params),a.createContainers(),a.registerEventsSearchBar(),a.registerEventsSuggestions(),a.registerEventsDetailsPanel(),a.registerIconHandler(),a.registerFlexibleLayout(),a.initVoiceSearch(),a.fixPosition=function(){a.adjustContainerWidth(),a.visible&&(a.fixPositionSuggestions(),a.canShowDetailsPanel()&&a.fixPositionDetailsPanel()),a.positionOverlayDarkened()},$(window).on("resize.autocomplete",function(){var a=c.getActiveInstance();clearTimeout(window.dgwt_wcas.resizeOnlyOnce),void 0!==a&&(window.dgwt_wcas.resizeOnlyOnce=setTimeout(function(){a.fixPosition()},100))}),$(window).on("scroll.autocomplete",function(){var a=c.getActiveInstance();clearTimeout(window.dgwt_wcas.scrollOnlyOnce),void 0!==a&&(window.dgwt_wcas.scrollOnlyOnce=setTimeout(function(){a.fixPosition()},100))});var b=$(window).width();$(window).on("resize.autocomplete",function(){var c=$(window).width();c!=b&&(a.toggleMobileOverlayMode(),b=c)}),a.isBreakpointReached("mobile-overlay")&&a.activateMobileOverlayMode(),a.hideAfterClickOutsideListener(),a.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),a.detailsContainer&&a.detailsContainer.length>0&&a.detailsContainer.addClass("js-dgwt-wcas-initialized")},createContainers:function(d){var b=this,c=b.options;0==$("."+c.containerClass).length?(b.suggestionsContainer=$(a.utils.createNode(c.containerClass)),b.suggestionsContainer.appendTo(c.appendTo||"body"),b.suggestionsContainer.addClass("woocommerce"),!0===c.showImage&&b.suggestionsContainer.addClass("dgwt-wcas-has-img"),!0===c.showPrice&&b.suggestionsContainer.addClass("dgwt-wcas-has-price"),!0===c.showDescription&&b.suggestionsContainer.addClass("dgwt-wcas-has-desc"),!0===c.showSKU&&b.suggestionsContainer.addClass("dgwt-wcas-has-sku"),!0===c.showHeadings&&b.suggestionsContainer.addClass("dgwt-wcas-has-headings")):b.suggestionsContainer=$("."+b.options.containerClass),b.canShowDetailsPanel()&&(0==$("."+c.containerDetailsClass).length?(b.detailsContainer=$(a.utils.createNode(c.containerDetailsClass)),b.detailsContainer.appendTo(c.appendTo||"body"),b.detailsContainer.addClass("woocommerce")):b.detailsContainer=$("."+c.containerDetailsClass))},registerEventsSearchBar:function(){var a=this;a.getForm().on("submit.autocomplete",function(b){if(a.options.disableSubmit)return b.preventDefault(),!1;var c=$(this).find("."+a.options.searchInputClass);if(c.length&&0===c.val().length)return b.preventDefault(),!1;a.suggestions.length>0&&$.each(a.suggestions,function(d,c){if(void 0!==c.type&&"product_variation"==c.type)return a.select(d),b.preventDefault(),!1}),a.closeOverlayMobile()}),"complete"===document.readyState?a.positionPreloaderAndMic():$(window).on("load",function(){a.positionPreloaderAndMic()}),a.el.on("keydown.autocomplete",function(b){a.onKeyPress(b)}),a.el.on("keyup.autocomplete",function(b){a.onKeyUp(b)}),a.el.on("blur.autocomplete",function(){a.onBlur()}),a.el.on("focus.autocomplete",function(b){a.onFocus(b)}),a.el.on("change.autocomplete",function(b){a.onKeyUp(b)}),a.el.on("input.autocomplete",function(b){a.onKeyUp(b)})},registerEventsSuggestions:function(){var a="."+this.classes.suggestion;if(!this.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")){$(document).on("mouseenter.autocomplete",a,function(){var a=c.getActiveInstance();if(void 0!==a){var b=$(this).data("index"),d=a.canShowDetailsPanel()?100:1;a.selectedIndex!=b&&c.mouseHoverDebounce(function(){a.selectedIndex!==b&&(a.latestActivateSource="mouse",a.getDetails(a.suggestions[b]),a.activate(b))},'.dgwt-wcas-suggestion[data-index="'+b+'"]',d)}});var b=!1;$(document).on("click.autocomplete",a,function(a){if(b)a.preventDefault();else{var d=c.getActiveInstance();d.actionTriggerSource="click",b=!0,setTimeout(function(){b=!1},500),(void 0===a.ctrlKey|| !1===a.ctrlKey)&&(d.select($(this).data("index")),a.preventDefault())}}),$(document).on("mousedown.autocomplete",a,function(a){var d=this;0===a.button&&setTimeout(function(){b||c.getActiveInstance().select($(d).data("index"))},250)}),$("."+this.options.containerClass).on("mousedown.autocomplete",function(a){c.getActiveInstance().isMouseDownOnSearchElements=!0})}},registerEventsDetailsPanel:function(){var a=this.getDetailsContainer();!this.canShowDetailsPanel()||a.hasClass("js-dgwt-wcas-initialized")||($(document).on("change.autocomplete",'[name="js-dgwt-wcas-quantity"]',function(a){$(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",$(this).val())}),$("."+this.options.containerDetailsClass).on("mousedown.autocomplete",function(a){c.getActiveInstance().isMouseDownOnSearchElements=!0}))},registerIconHandler:function(){var a=this,b=a.getFormWrapper(),c=a.getForm();b.on("click.autocomplete",".js-dgwt-wcas-search-icon-handler",function(e){var f=b.find("."+a.options.searchInputClass);if(b.hasClass("dgwt-wcas-layout-icon-open"))a.hide(),c.hide(!0),b.removeClass("dgwt-wcas-layout-icon-open");else{var d=b.find(".dgwt-wcas-search-icon-arrow");c.hide(),d.hide(),b.addClass("dgwt-wcas-layout-icon-open"),a.positionIconSearchMode(b),c.fadeIn(50,function(){d.show(),a.positionPreloaderAndMic(b);var c=a.currentValue.length;c>0&&f[0].setSelectionRange(c,c),f.focus()}),setTimeout(function(){a.fixPosition()},110)}}),0==$(".js-dgwt-wcas-initialized").length&&$(".js-dgwt-wcas-search-icon-handler").length>0&&$(document).on("click.autocomplete",function(c){if($(".dgwt-wcas-layout-icon-open").length){var b=$(c.target);b.closest("."+a.options.searchFormClass).length>0||b.closest("."+a.options.containerClass).length>0||b.closest("."+a.options.containerDetailsClass).length>0||a.hideIconModeSearch()}})},registerFlexibleLayout:function(){var a=this,b=$(window).width();$(window).on("resize.autocomplete",function(){var c=$(window).width();c!=b&&(a.reloadFlexibleLayout(),b=c)}),"complete"==document.readyState?a.reloadFlexibleLayout():$(window).on("load.autocomplete",function(){a.reloadFlexibleLayout()})},activateMobileOverlayMode:function(){var b=this,a=b.getFormWrapper();a.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&!a.find(".js-dgwt-wcas-enable-mobile-form").length&&(a.prepend('
'),a.addClass("dgwt-wcas-mobile-overlay-trigger-active"),a.find(".js-dgwt-wcas-enable-mobile-form").on("click.autocomplete",function(a){b.options.mobileOverlayDelay>0?setTimeout(function(){b.showMobileOverlay()},b.options.mobileOverlayDelay):b.showMobileOverlay()}))},deactivateMobileOverlayMode:function(){var a=this.getFormWrapper();this.getSuggestionsContainer();var b=a.find(".js-dgwt-wcas-enable-mobile-form");a.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&b.length&&(this.closeOverlayMobile(),b.remove(),a.removeClass("dgwt-wcas-mobile-overlay-trigger-active"))},toggleMobileOverlayMode:function(){var b=this.getFormWrapper(),a=!1;if(b.hasClass("js-dgwt-wcas-mobile-overlay-enabled")){if(b.find(".js-dgwt-wcas-enable-mobile-form").length&&(a=!0),!a&&this.isBreakpointReached("mobile-overlay")||a&&!this.isBreakpointReached("mobile-overlay")){var c=this.getSuggestionsContainer();this.close(!1),c.length&&c.html(""),this.hideIconModeSearch()}!a&&this.isBreakpointReached("mobile-overlay")&&this.activateMobileOverlayMode(),a&&!this.isBreakpointReached("mobile-overlay")&&this.deactivateMobileOverlayMode()}},showMobileOverlay:function(){var b=this;if("on"!==b.overlayMobileState){b.overlayMobileState="on";var d,c=b.getFormWrapper(),e=b.getSuggestionsContainer(),a="";$("html").addClass("dgwt-wcas-overlay-mobile-on"),$("html").addClass("dgwt-wcas-open-"+b.getSearchStyle()),a+='
',a+='
',a+='",a+="
",a+="
",$(b.options.mobileOverlayWrapper).append(a),(d=$(".js-dgwt-wcas-overlay-mobile")).css("zIndex",99999999999),c.after(''),c.appendTo(".js-dgwt-wcas-om-bar"),e.appendTo(".js-dgwt-wcas-om-bar"),c.addClass("dgwt-wcas-search-wrapp-mobile"),c.hasClass("dgwt-wcas-has-submit")&&(c.addClass("dgwt-wcas-has-submit-off"),c.removeClass("dgwt-wcas-has-submit")),c.find("."+b.options.searchInputClass).focus(),$(document).on("click.autocomplete",".js-dgwt-wcas-om-return",function(a){b.closeOverlayMobile(d)})}},closeOverlayMobile:function(d){var a=this;if(!$("html").hasClass("dgwt-wcas-overlay-mobile-on")){a.overlayMobileState="off";return}var c=a.getSuggestionsContainer(),b=$(".js-dgwt-wcas-om-bar").find("."+a.options.searchFormClass);b.hasClass("dgwt-wcas-has-submit-off")&&(b.removeClass("dgwt-wcas-has-submit-off"),b.addClass("dgwt-wcas-has-submit")),b.removeClass("dgwt-wcas-search-wrapp-mobile"),$("html").removeClass("dgwt-wcas-overlay-mobile-on"),$("html").removeClass("dgwt-wcas-open-"+a.getSearchStyle()),c.appendTo("body"),c.removeAttr("body-scroll-lock-ignore"),$(".js-dgwt-wcas-om-hook").after(b),$(".js-dgwt-wcas-overlay-mobile").remove(),$(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){b.find("."+a.options.searchInputClass).val("");var c=b.find(".dgwt-wcas-close");b.length>0&&(c.removeClass("dgwt-wcas-close"),c.html("")),a.hide()},150),a.overlayMobileState="off"},reloadFlexibleLayout:function(){var a=this.getFormWrapper(),b=0;a.hasClass("js-dgwt-wcas-layout-icon-flexible")&&(b=1),a.hasClass("js-dgwt-wcas-layout-icon-flexible-inv")&&(b=2),b>0&&(1===b&&this.isBreakpointReached("search-layout")||2===b&&!this.isBreakpointReached("search-layout")?(a.addClass("js-dgwt-wcas-layout-icon"),a.addClass("dgwt-wcas-layout-icon")):(a.removeClass("js-dgwt-wcas-layout-icon"),a.removeClass("dgwt-wcas-layout-icon")),a.addClass("dgwt-wcas-layout-icon-flexible-loaded"))},onFocus:function(b){var a=this.getFormWrapper();$("."+this.options.searchFormClass).removeClass("dgwt-wcas-active"),a.addClass("dgwt-wcas-active"),$("body").addClass("dgwt-wcas-focused"),a.addClass("dgwt-wcas-search-focused"),0==$(b.target).closest(".dgwt-wcas-search-wrapp-mobile").length&&this.enableOverlayDarkened(),this.fixPosition(),this.el.val().length>=this.options.minChars&&this.onValueChange()},onBlur:function(){var a=this.options,b=this.el.val(),c=this.getQuery(b);$("body").removeClass("dgwt-wcas-focused"),$("."+a.searchFormClass).removeClass("dgwt-wcas-search-focused"),!this.isMouseDownOnSearchElements&&(this.hide(),this.selection&&this.currentValue!==c&&(a.onInvalidateSelection||$.noop).call(this.element))},abortAjax:function(){var a=this;a.currentRequest&&(a.currentRequest.abort(),a.currentRequest=null)},setOptions:function(c){var a=this,d=a.getSuggestionsContainer(),b=$.extend({},a.options,c);a.isLocal=Array.isArray(b.lookup),a.isLocal&&(b.lookup=a.verifySuggestionsFormat(b.lookup)),d.css({"max-height":a.canShowDetailsPanel()?"none":b.maxHeight+"px","z-index":b.zIndex}),a.canShowDetailsPanel()&&a.getDetailsContainer().css({"z-index":b.zIndex-1}),b.onSearchComplete=function(){a.getFormWrapper().removeClass("dgwt-wcas-processing"),a.preloader("hide","form","dgwt-wcas-inner-preloader"),a.showCloseButton()},this.options=b},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},this.badQueries=[]},clear:function(a){a&&this.clearCache(),this.currentValue="",this.suggestions=[]},close:function(b){var a=this.el.closest("."+this.options.searchFormClass).find("."+this.options.searchInputClass),c=this.getFormWrapper();this.hide(),this.clear(!1),this.hideCloseButton(),a.val(""),c.removeClass(this.classes.inputFilled),b&&a.focus()},fixPositionSuggestions:function(){var b=this.getSuggestionsContainer(),c=this.getForm(),e=this.el,f=this.getElementInfo(c),a=this.getElementInfo(e),d={top:a.top+a.height,left:f.left};this.ancestorHasPositionFixed(c)?(d.top=a.topViewPort+a.height,b.addClass(this.classes.fixed)):b.removeClass(this.classes.fixed),this.getSuggestionsContainer().css(d)},fixPositionDetailsPanel:function(){var g=this.getFormWrapper(),d=this.getSuggestionsContainer(),a=this.getDetailsContainer(),h=this.getForm(),i=this.el,e=this.getElementInfo(h),c=this.getElementInfo(i),b={top:c.top+c.height,left:e.left+d.outerWidth(!1)};if(this.ancestorHasPositionFixed(g)?(b.top=c.topViewPort+c.height,a.addClass(this.classes.fixed)):a.removeClass(this.classes.fixed),a.css(b),$("body").removeClass("dgwt-wcas-full-width dgwt-wcas-details-outside dgwt-wcas-details-right dgwt-wcas-details-left dgwt-wcas-details-notfit"),g.outerWidth()>=this.options.dpusbBreakpoint){$("body").addClass("dgwt-wcas-full-width"),!0===this.options.isRtl&&(b.left=e.left+a.outerWidth(!1),d.css("left",b.left),a.css("left",e.left));return}var j=$(window).width(),k=a.outerWidth(),f=a.offset();$("body").addClass("dgwt-wcas-details-outside dgwt-wcas-details-right"),j2&&a.fixHeight()},10)}},getElementInfo:function(b){var c,d,a={};return c=b[0].getBoundingClientRect(),d=b.offset(),a.left=d.left,a.top=d.top,a.width=b.outerWidth(!1),a.height=b.outerHeight(!1),a.right=a.left+a.width,a.bottom=a.top+a.height,a.topViewPort=c.top,a.bottomViewPort=c.top+a.height,a},getFormWrapper:function(){return this.el.closest("."+this.options.searchFormClass)},getForm:function(){return this.el.closest("."+this.options.formClass)},getSuggestionsContainer:function(){return $("."+this.options.containerClass)},getDetailsContainer:function(){return $("."+this.options.containerDetailsClass)},scrollDownSuggestions:function(){var a=this.getSuggestionsContainer();a[0].scrollTop=a[0].scrollHeight},isCursorAtEnd:function(){var b,a=this.el.val().length,c=this.element.selectionStart;return"number"==typeof c?c===a:!document.selection||((b=document.selection.createRange()).moveStart("character",-a),a===b.text.length)},onKeyPress:function(b){var a=this,c=a.getFormWrapper();if(a.addActiveClassIfMissing(),!a.visible&&b.keyCode===e.DOWN&&a.currentValue){a.suggest();return}if(!a.visible){b.keyCode===e.ESC&&c.hasClass("dgwt-wcas-layout-icon-open")&&a.hideIconModeSearch(),b.keyCode===e.ESC&&a.isMountedOverlayDarkened()&&(a.disableOverlayDarkened(),a.el.blur());return}if((b.ctrlKey||b.metaKey)&&b.keyCode===e.RETURN){a.selectedIndex> -1&&a.openInNewTab(a.selectedIndex);return}switch(b.keyCode){case e.ESC:a.close();break;case e.RIGHT:if(a.hint&&a.options.onHint&&a.isCursorAtEnd()){a.selectHint();break}return;case e.TAB:break;case e.RETURN:if(-1===a.selectedIndex){if(a.options.disableSubmit)return!1;a.hide();return}a.actionTriggerSource="enter",a.select(a.selectedIndex);break;case e.UP:a.moveUp();break;case e.DOWN:a.moveDown();break;default:return}b.stopImmediatePropagation(),b.preventDefault()},onKeyUp:function(b){var a=this;switch(b.keyCode){case e.UP:case e.DOWN:return}clearTimeout(a.onChangeTimeout),a.currentValue!==a.el.val()&&(a.findBestHint(),a.options.deferRequestBy>0?a.onChangeTimeout=setTimeout(function(){a.onValueChange()},a.options.deferRequestBy):a.onValueChange())},onValueChange:function(){if(this.ignoreValueChange){this.ignoreValueChange=!1;return}var a=this,c=a.options,e=a.el.val(),b=a.getQuery(e),d=a.getFormWrapper();if(a.selection&&a.currentValue!==b&&(a.selection=null,(c.onInvalidateSelection||$.noop).call(a.element)),clearTimeout(a.onChangeTimeout),a.currentValue=e,a.selectedIndex=-1,c.triggerSelectOnValidInput&&a.isExactMatch(b)){a.select(0);return}b.length>0?d.hasClass(a.classes.inputFilled)||d.addClass(a.classes.inputFilled):d.removeClass(a.classes.inputFilled),b.length$(window).width()||"ontouchend"in document)&&(a=!1),a},isBreakpointReached:function(b){var a=0;switch(b){case"search-layout":a=this.options.layoutBreakpoint,this.isSetParam("layout_breakpoint")&&(a=Number.parseInt(this.getParam("layout_breakpoint")));break;case"mobile-overlay":a=this.options.mobileOverlayBreakpoint,this.isSetParam("mobile_overlay_breakpoint")&&(a=Number.parseInt(this.getParam("mobile_overlay_breakpoint")))}return $(window).width()<=a},getQuery:function(b){var a,c=this.options.delimiter;return c?(a=b.split(c),$.trim(a[a.length-1])):b.trim()},getSuggestionsLocal:function(d){var a,b=this.options,e=d.toLowerCase(),f=b.lookupFilter,c=parseInt(b.lookupLimit,10);return a={suggestions:$.grep(b.lookup,function(a){return f(a,d,e)})},c&&a.suggestions.length>c&&(a.suggestions=a.suggestions.slice(0,c)),a},getSuggestions:function(e){var f,h,j,i,a=this,b=a.options,g=b.serviceUrl,k=a.getFormWrapper(),l=a.isActiveIconModeSearch();if(b.params[b.paramName]=e,void 0!==dgwt_wcas.current_lang&&(b.params.l=dgwt_wcas.current_lang),a.preloader("show","form","dgwt-wcas-inner-preloader"),k.addClass("dgwt-wcas-processing"),!1!==b.onSearchStart.call(a.element,b.params)){if(h=b.ignoreParams?null:b.params,$.isFunction(b.lookup)){b.lookup(e,function(c){a.suggestions=c.suggestions,a.suggest(),a.selectFirstSuggestion(c.suggestions),b.onSearchComplete.call(a.element,e,c.suggestions)});return}a.isLocal?f=a.getSuggestionsLocal(e):($.isFunction(g)&&(g=g.call(a.element,e)),j=g+"?"+$.param(h||{}),f=a.cachedResponse[j]),f&&Array.isArray(f.suggestions)?(a.suggestions=f.suggestions,a.suggest(),a.selectFirstSuggestion(f.suggestions),b.onSearchComplete.call(a.element,e,f.suggestions)):a.isBadQuery(e)?b.onSearchComplete.call(a.element,e,[]):(a.abortAjax(),i={url:g,data:h,type:b.type,dataType:b.dataType},$.extend(i,b.ajaxSettings),d.object=a,d.ajaxSettings=i,c.debounce(function(){var a=d.object,b=d.ajaxSettings;a.currentRequest=$.ajax(b).done(function(c){var b;(!l||a.isActiveIconModeSearch())&&(a.currentRequest=null,void 0!==(b=a.options.transformResult(c,e)).suggestions&&(a.processResponse(b,e,j),a.selectFirstSuggestion(b.suggestions),1===b.suggestions.length&& void 0!==b.suggestions[0].type&&"no-results"===b.suggestions[0].type?a.gaEvent(e,"Autocomplete Search without results"):a.gaEvent(e,"Autocomplete Search with results")),a.fixPosition(),a.options.onSearchComplete.call(a.element,e,b.suggestions),a.updatePrices())}).fail(function(b,c,d){a.options.onSearchError.call(a.element,e,b,c,d)})},b.debounceWaitMs))}},getDetails:function(b){var a=this;if(!a.canShowDetailsPanel())return!1;if(null!=b&& void 0!==b.type&&("string"!=typeof b.type||"more_products"!==b.type)){a.fixHeight(),a.getDetailsContainer();var c=a.prepareSuggestionObjectID(b);if(null!=a.cachedDetails[c])a.detailsPanelSetScene(c),a.fixHeight(),a.fixPosition();else{var d={action:dgwt_wcas.action_result_details,items:[]};if($.each(a.suggestions,function(e,b){if(void 0!==b.type&&"more_products"!=b.type&&"headline"!=b.type){var c={objectID:a.prepareSuggestionObjectID(b),value:null!=b.value?b.value:""};d.items.push(c)}}),a.detailsPanelClearScene(),a.preloader("show","details",""),-1!=$.inArray(c,a.detailsRequestsSent))return;a.detailsRequestsSent.push(c),$.ajax({data:d,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(d){var b="string"==typeof d?JSON.parse(d):d;if(void 0!==b.items)for(var c=0;c0&&(a.cachedPrices[e]=b.items[c].price)}a.preloader("hide","details","");var f=a.prepareSuggestionObjectID(a.suggestions[a.selectedIndex]);null!=a.cachedDetails[f]?a.detailsPanelSetScene(f):a.detailsPanelClearScene(),a.fixPosition(),a.fixHeight(),a.updatePrices(!0)},error:function(b,c){a.preloader("hide","details",""),a.detailsPanelClearScene(),a.fixPosition(),a.fixHeight()}})}$(document).trigger("dgwtWcasDetailsPanelLoaded",a)}},updatePrices:function(e){var b,g,a=this,c=[];if(a.options.showPrice&&a.options.dynamicPrices&&0!=a.suggestions.length){for(b=0;b0){var f={action:void 0===dgwt_wcas.action_get_prices?"dgwt_wcas_get_prices":dgwt_wcas.action_get_prices,items:c};$.ajax({data:f,type:"post",url:dgwt_wcas.ajax_prices_endpoint,success:function(c){if(void 0!==c.success&&c.success&&c.data.length>0)for(b=0;b0){for(g=0;g
')}},prepareSuggestionObjectID:function(a){var b="";return void 0!==a&& void 0!==a.type&&(null!=a.post_id&&(b=a.type+"__"+a.post_id,"product_variation"===a.type&&(b+="__"+a.variation_id),void 0!==a.post_type&&(b=a.type+"__"+a.post_id+"__"+a.post_type)),null!=a.term_id&&null!=a.taxonomy&&(b=a.type+"__"+a.term_id+"__"+a.taxonomy)),b},detailsPanelSetScene:function(b){var d=this.getDetailsContainer(),e=c.hashCode(b),a=d.find('.dgwt-wcas-details-inner[data-object="'+e+'"]');a.length&&(this.preloader("hide","details",""),this.detailsPanelClearScene(),a.addClass("dgwt-wcas-details-inner-active"))},detailsPanelAddToScene:function(b){var d=this.getDetailsContainer(),a=this.cachedDetails[b],e=c.hashCode(b),f="";void 0!==a&&"string"==typeof a.html&&(f=a.html.replace("
0&&$.each(a.suggestions,function(b,a){if(void 0!==a.type&&"more_products"!=a.type&&"headline"!=a.type&&"no-results"!=a.type)return c=b,!1;(void 0===a.type||"no-results"===a.type)&&(d=!0)}),d||(a.latestActivateSource="system",a.getDetails(b[c]),a.activate(c)))},isBadQuery:function(c){if(!this.options.preventBadQueries)return!1;for(var a=this.badQueries,b=a.length;b--;)if(0===c.indexOf(a[b]))return!0;return!1},hide:function(c){var a=this,b=a.getSuggestionsContainer(),d=a.getDetailsContainer();$.isFunction(a.options.onHide)&&a.visible&&a.options.onHide.call(a.element,container),a.visible=!1,a.selectedIndex=-1,clearTimeout(a.onChangeTimeout),b.hide(),b.removeClass(a.classes.suggestionsContainerOrientTop),b.removeClass(a.classes.fixed),a.canShowDetailsPanel()&&(d.hide(),d.removeClass(a.classes.fixed)),$("body").removeClass("dgwt-wcas-open"),$("html").hasClass("dgwt-wcas-overlay-mobile-on")||$("html").removeClass("dgwt-wcas-open-"+a.getSearchStyle()),$("body").removeClass("dgwt-wcas-block-scroll"),$("body").removeClass("dgwt-wcas-is-details"),$("body").removeClass("dgwt-wcas-full-width"),$("body").removeClass("dgwt-wcas-nores"),$("body").removeClass("dgwt-wcas-details-outside"),$("body").removeClass("dgwt-wcas-details-right"),$("body").removeClass("dgwt-wcas-details-left"),null!=a.autoAligmentprocess&&(clearInterval(a.autoAligmentprocess),a.autoAligmentprocess=null),a.isMouseDownOnSearchElements=!1,"boolean"==typeof c&&c&&(a.hideCloseButton(),a.currentValue="",a.suggestions=[]),a.signalHint(null)},positionIconSearchMode:function(d){var a=-20,b=this.getForm(),e=b.width(),f=$(window).width(),c=d[0].getBoundingClientRect().left;a=Math.floor(-1*(e*((c+10)/f))),a=Math.max(a,-1*c),b.css({left:a+"px"})},isActiveIconModeSearch:function(){var a=!1;return $(".dgwt-wcas-layout-icon-open").length>0&&(a=!0),a},hideIconModeSearch:function(){this.isActiveIconModeSearch()&&!c.isTextSelected()&&$(".dgwt-wcas-layout-icon-open").removeClass("dgwt-wcas-layout-icon-open")},hideAfterClickOutsideListener:function(){var a=this;"ontouchend"in document||$(document).mouseup(function(b){if(a.visible){var c=!($(b.target).closest("."+a.options.searchFormClass).length>0||$(b.target).hasClass(a.options.searchFormClass)),d=!($(b.target).closest("."+a.options.containerClass).length>0||$(b.target).hasClass(a.options.containerClass));if(a.canShowDetailsPanel()){var e=!($(b.target).closest("."+a.options.containerDetailsClass).length>0||$(b.target).hasClass(a.options.containerDetailsClass));c&&d&&e&&a.hide()}else c&&d&&a.hide()}})},suggest:function(){if(!this.suggestions.length){this.hide();return}var k,a=this,b=a.options,l=b.groupBy,m=b.formatResult,e=a.getQuery(a.currentValue),f=a.classes.suggestion,g=a.classes.selected,c=a.getSuggestionsContainer(),h=a.getDetailsContainer(),i=$(a.noSuggestionsContainer),d=b.beforeRender,j="",n=function(b,c){var a=b.data[l];return k===a?"":'
'+(k=a)+"
"};if(b.triggerSelectOnValidInput&&a.isExactMatch(e)){a.select(0);return}$("body").removeClass("dgwt-wcas-nores"),$.each(a.suggestions,function(p,c){var k="",o=!1,s="string"==typeof c.url&&c.url.length?c.url:"#";if(l&&(j+=n(c,e,p)),void 0===c.type||"product"!=c.type&&"product_variation"!=c.type){var q,d=f,t="dgwt-wcas-st",g="",r="",h="",i=!0;"product_cat"===c.taxonomy?(d+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",b.showHeadings||(g+=''+dgwt_wcas.labels["tax_"+c.taxonomy]+""),void 0!==c.breadcrumbs&&c.breadcrumbs&&(h=c.breadcrumbs+" > "+c.value,r+=''+dgwt_wcas.labels.in+" "+c.breadcrumbs+"")):"product_tag"===c.taxonomy?(d+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",b.showHeadings||(g+=''+dgwt_wcas.labels["tax_"+c.taxonomy]+"")):b.isPremium&&c.taxonomy===b.taxonomyBrands?(d+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",b.showHeadings||(g+=''+dgwt_wcas.labels["tax_"+c.taxonomy]+"")):b.isPremium&&"taxonomy"===c.type?(d+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tax-"+c.taxonomy,b.showHeadings||(g+=''+dgwt_wcas.labels["tax_"+c.taxonomy]+"")):b.isPremium&&"vendor"===c.type?(d+=" dgwt-wcas-suggestion-vendor dgwt-wcas-suggestion-vendor",b.showHeadings||(g+=''+dgwt_wcas.labels.vendor+"")):b.isPremium&&"post"===c.type&& void 0!==c.post_type&&"post"===c.post_type?(d+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-post",b.showHeadings||(g+=''+dgwt_wcas.labels.post+"")):b.isPremium&&"post"===c.type&& void 0!==c.post_type&&"page"===c.post_type?(d+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-page",b.showHeadings||(g+=''+dgwt_wcas.labels.page+"")):"more_products"===c.type?(d+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",t="dgwt-wcas-st-more",c.value=dgwt_wcas.labels.show_more+' ('+c.total+")",i=!1):b.showHeadings&&"headline"===c.type?(d+=" js-dgwt-wcas-suggestion-headline dgwt-wcas-suggestion-headline",void 0!==dgwt_wcas.labels[c.value+"_plu"]&&(c.value=dgwt_wcas.labels[c.value+"_plu"]),i=!1):(d+=" dgwt-wcas-suggestion-nores",c.value=dgwt_wcas.labels.no_results,i=!1,a.canShowDetailsPanel()&&a.detailsPanelClearScene(),$("body").addClass("dgwt-wcas-nores")),void 0!==c.image_src&&c.image_src&&(q=!0),h=h.length>0?' title="'+h+'"':"",j+='',q&&(j+='',j+='
'),j+="',"vendor"===c.type?(j+=''+g+m(c.value,e,i,b)+r+"",c.shop_city&&(j+=' - '+m(c.shop_city,e,!0,b)+""),void 0!==c.desc&&c.desc&&(j+=''+m(c.desc,e,!0,b)+"")):j+=g+m(c.value,e,i,b)+r,j+="",j+=q?"
":"",j+="
"}else{!0===b.showImage&& void 0!==c.thumb_html&&(o=!0);var z="product_variation"===c.type?" dgwt-wcas-suggestion-product-var":"";if(k+=void 0!==c.post_id?'data-post-id="'+c.post_id+'" ':"",k+=void 0!==c.taxonomy?'data-taxonomy="'+c.taxonomy+'" ':"",k+=void 0!==c.term_id?'data-term-id="'+c.term_id+'" ':"",j+='",o&&(j+=''+c.thumb_html+""),j+=o?'
':"",j+='
',void 0!==c.title_before&&c.title_before&&(j+=c.title_before),j+=''+m(c.value,e,!0,b)+"",void 0!==c.title_after&&c.title_after&&(j+=c.title_after),!0===b.showSKU&& void 0!==c.sku&&c.sku.length>0&&(j+='('+dgwt_wcas.labels.sku_label+" "+m(c.sku,e,!0,b)+")"),!0===b.showDescription&& void 0!==c.desc&&c.desc&&(j+=''+m(c.desc,e,!0,b)+""),!0===b.showProductVendor&& void 0!==c.vendor&&c.vendor){var u=''+dgwt_wcas.labels.vendor_sold_by+" "+c.vendor+"";void 0!==c.vendor_url&&c.vendor_url?j+=''+u+"":j+=u}void 0!==c.content_after&&c.content_after&&(j+=c.content_after),j+="
";var v=!0===b.showPrice&& void 0!==c.price,w=void 0!==c.meta_before,x=void 0!==c.meta_after,y=v||w||x;j+=y?'
':"",w&&(j+=c.meta_before),v&&(j+=''+c.price+""),x&&(j+=c.meta_after),j+=y?"
":"",j+=o?"
":"",j+="
"}}),this.adjustContainerWidth(),i.detach(),c.html(j),$.isFunction(d)&&d.call(a.element,c,a.suggestions),c.show(),$("body").addClass("dgwt-wcas-open"),$("html").addClass("dgwt-wcas-open-"+a.getSearchStyle()),a.isMouseDownOnSearchElements=!1,a.automaticAlignment(),a.canShowDetailsPanel()&&($("body").addClass("dgwt-wcas-is-details"),h.show(),a.fixHeight()),b.autoSelectFirst&&(a.selectedIndex=0,c.scrollTop(0),c.children("."+f).first().addClass(g)),a.visible=!0,a.fixPosition(),a.findBestHint()},getSearchStyle(){var a=this.getFormWrapper(),b="solaris";return $(a.attr("class").split(/\s+/)).each(function(a){/dgwt-wcas-style-/i.test(this)&&(b=this.replace(/dgwt-wcas-style-/i,""))}),b},adjustContainerWidth:function(){var e=this.getFormWrapper(),c=this.getSuggestionsContainer(),b=this.getDetailsContainer(),a=this.getForm().outerWidth();if(e.length&&(c.css("width",a+"px"),this.canShowDetailsPanel()&&a>=this.options.dpusbBreakpoint)){var d=0;c.css("width",a/2),b.css("width",a/2),0!=(d=a-(c.outerWidth()+b.outerWidth()))&&b.css("width",b.outerWidth()+d)}},positionPreloaderAndMic:function(a){var c=this,b="object"==typeof a?a.find(".dgwt-wcas-search-submit"):$(".dgwt-wcas-search-submit");b.length>0&&b.each(function(){var a=$(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader"),d=$(this).closest(".dgwt-wcas-search-wrapp").hasClass(c.options.voiceSearchSupportedClass),b=$(this).closest(".dgwt-wcas-search-wrapp").find("."+c.options.voiceSearchClass);d?1==dgwt_wcas.is_rtl?(b.css("left",6+$(this).outerWidth()+"px"),a.css("left",46+$(this).outerWidth()+"px")):(b.css("right",$(this).outerWidth()+"px"),a.css("right",40+$(this).outerWidth()+"px")):1==dgwt_wcas.is_rtl?a.css("left",6+$(this).outerWidth()+"px"):a.css("right",$(this).outerWidth()+"px")})},findBestHint:function(){var a=this.el.val().toLowerCase(),b=null;a&&($.each(this.suggestions,function(e,c){var d=0===c.value.toLowerCase().indexOf(a);return d&&(b=c),!d}),this.signalHint(b))},signalHint:function(c){var b="",a=this;c&&(b=a.currentValue+c.value.substr(a.currentValue.length)),a.hintValue!==b&&(a.hintValue=b,a.hint=c,(this.options.onHint||$.noop)(b))},preloader:function(d,e,b){var g,a,f="dgwt-wcas-preloader-wrapp";if("form"===e){if(1!=dgwt_wcas.show_preloader)return;a=this.getFormWrapper().find(".dgwt-wcas-preloader")}else"details"===e&&(a=this.getDetailsContainer());if(0!=a.length){if("form"===e){"hide"===d?(a.removeClass(b),a.html("")):(a.addClass(b),"string"==typeof dgwt_wcas.preloader_icon&&a.html(dgwt_wcas.preloader_icon));return}var c=a.find("."+f);if("hide"===d){c.length&&c.remove();return}if("show"===d){var h=this.options.isRtl?"-rtl":"";g='
',this.detailsPanelClearScene(),c.length&&c.remove(),a.prepend(g)}}},verifySuggestionsFormat:function(a){return a.length&&"string"==typeof a[0]?$.map(a,function(a){return{value:a,data:null}}):a},processResponse:function(b,c,e){var a=this,d=a.options;b.suggestions=a.verifySuggestionsFormat(b.suggestions),d.noCache||(a.cachedResponse[e]=b,d.preventBadQueries&&!b.suggestions.length&&a.badQueries.push(c)),c===a.getQuery(a.currentValue)&&(a.suggestions=b.suggestions,a.suggest())},activate:function(f){var c,a=this,b=a.classes.selected,d=a.getSuggestionsContainer(),e=d.find("."+a.classes.suggestion);return(d.find("."+b).removeClass(b),a.selectedIndex=f,-1!==a.selectedIndex&&e.length>a.selectedIndex)?($(c=e.get(a.selectedIndex)).addClass(b),c):null},selectHint:function(){var a=$.inArray(this.hint,this.suggestions);this.select(a)},select:function(a){this.options.disableHits||(this.closeOverlayMobile(),this.hide(),this.onSelect(a))},moveUp:function(){var a=this;if(-1!==a.selectedIndex){if(a.latestActivateSource="key",0===a.selectedIndex){a.getSuggestionsContainer().children("."+a.classes.suggestion).first().removeClass(a.classes.selected),a.selectedIndex=-1,a.ignoreValueChange=!1,a.el.val(a.currentValue),a.findBestHint();return}a.adjustScroll(a.selectedIndex-1,"up")}},moveDown:function(){var a=this;a.selectedIndex!==a.suggestions.length-1&&(a.latestActivateSource="key",a.adjustScroll(a.selectedIndex+1,"down"))},adjustScroll:function(b,i){var a=this;if("headline"===a.suggestions[b].type&&(b="down"===i?b+1:b-1),void 0!==a.suggestions[b]){var d=a.activate(b);if(a.getDetails(a.suggestions[b]),!("more_products"===a.suggestions[b].type|| !d||a.canShowDetailsPanel())){var c,f,g,e=a.getSuggestionsContainer(),h=$(d).outerHeight(!1);c=d.offsetTop,g=(f=e.scrollTop())+a.options.maxHeight-h,cg&&e.scrollTop(c-a.options.maxHeight+h),a.options.preserveInput||(a.ignoreValueChange=!0),a.signalHint(null)}}},onSelect:function(d){var a=this,c=a.options.onSelect,b=a.suggestions[d];if(void 0!==b.type&&("more_products"===b.type||"enter"===a.actionTriggerSource&&"key"!=a.latestActivateSource&&"product_variation"!=b.type)){a.el.closest("form").trigger("submit");return}a.currentValue=a.getValue(b.value),a.currentValue===a.el.val()||a.options.preserveInput||a.el.val(a.currentValue.replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," ")),b.url.length>0&&(window.location.href=b.url),a.signalHint(null),a.suggestions=[],a.selection=b,$.isFunction(c)&&c.call(a.element,b)},openInNewTab:function(b){var a=this.suggestions[b];a.url.length>0&&window.open(a.url,"_blank").focus()},getValue:function(c){var a,b,d=this.options.delimiter;return d&&1!==(b=(a=this.currentValue).split(d)).length?a.substr(0,a.length-b[b.length-1].length)+c:c},dispose:function(){var d=this.el,a=this.getFormWrapper(),b=this.getSuggestionsContainer(),c=a.find(".js-dgwt-wcas-enable-mobile-form");a.length&&a.find("*").each(function(){$(this).off(".autocomplete")}),a.off("click.autocomplete",".js-dgwt-wcas-search-icon-handler"),d.removeData("autocomplete"),$(window).off("resize.autocomplete",this.fixPosition),a.removeClass("dgwt-wcas-active"),this.close(!1),c.length&&c.remove(),b.length&&b.html("")},isMountedOverlayDarkened:function(){var b=this.getFormWrapper(),a=!1;return b.hasClass(this.classes.darkenOverlayMounted)&&(a=!0),a},enableOverlayDarkened:function(){var a=this,b=a.options;if(a.isMountedOverlayDarkened()){if(a.getFormWrapper().addClass("dgwt-wcas-search-darkoverl-on"),$("body").addClass("dgwt-wcas-darkoverl-on"),0==$("."+b.darkenedOverlayClass).length){var c='
';$("body").append(c);var d=$("."+a.options.darkenedOverlayClass);a.positionOverlayDarkened(),d.on("click.autocomplete",function(b){a.disableOverlayDarkened()})}a.overlayDarkenedState="on"}},disableOverlayDarkened:function(){var b,a=this,d=a.options;if(a.isMountedOverlayDarkened()){(b=$(".dgwt-wcas-search-darkoverl-on")).length&&b.removeClass("dgwt-wcas-search-darkoverl-on"),$("body").removeClass("dgwt-wcas-darkoverl-on");var c=$("."+d.darkenedOverlayClass);c.length>0&&(c.remove(),a.overlayDarkenedState="off")}},positionOverlayDarkened:function(){var b=this,c=!1,a=$("."+b.options.darkenedOverlayClass);a.length>0&&(b.ancestorHasPositionFixed(b.getFormWrapper())?(c=!0,a.addClass("dgwt-wcas-suggestions-wrapp-fixed")):a.removeClass("dgwt-wcas-suggestions-wrapp-fixed"),a.children("div").each(function(a){b.positionOverlayDarkenedDiv($(this),a+1,c)}))},positionOverlayDarkenedDiv:function(f,g,e){var a,b,c=this.getFormWrapper();switch(c.hasClass("js-dgwt-wcas-layout-icon")&&(c=this.getForm()),a=this.getElementInfo(c),g){case 1:b={left:"-200px",top:"-200px",width:a.left+200+"px",height:$(document).outerHeight(!1)+200-1+"px"};break;case 2:var d=e?a.topViewPort:a.top;b={left:"-200px",top:"-200px",width:$(window).outerWidth(!1)+200+"px",height:d+200+"px"};break;case 3:b={left:a.left+a.width+"px",top:"-200px",width:$(window).outerWidth(!1)-a.right+"px",height:$(document).outerHeight(!1)+200-1+"px"};break;case 4:var d=e?a.topViewPort:a.top;b={left:"-200px",top:d+a.height+"px",width:$(window).outerWidth(!1)+200+"px",height:$(document).outerHeight(!1)-a.bottom-1+"px"}}b&&f.css(b)},showCloseButton:function(){var a=this,c=void 0!==dgwt_wcas.close_icon?dgwt_wcas.close_icon:"",b=a.getFormWrapper().find("."+a.options.preloaderClass);a.el.val().length2?arguments[2]:[];if(!1===f(a))throw new TypeError(Object.prototype.toString.call(a)+"is not a function.");return a.apply(b,c)}function a(a,b,c){Object.defineProperty(a,b,{value:c,writable:!0,enumerable:!1,configurable:!0})}function e(a,b){return a[b]}function f(a){return"function"==typeof a}function g(a){if(null===a||a===c)throw TypeError();return Object(a)}function h(a){switch(typeof a){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===a?"null":"Symbol"in b&&(a instanceof b.Symbol||a.constructor===b.Symbol)?"symbol":"object"}}function i(a,b){var c,d;return h(a)===h(b)&&("number"===h(a)?!(!isNaN(a)||!isNaN(b))||1/a==1/0&&1/b== -1/0||1/a== -1/0&&1/b==1/0||a===b:(c=a)===b)}function j(b){if("symbol"===h(b))throw new TypeError("Cannot convert a Symbol value to a number");var a=Number(b);return isNaN(a)?0:1/a==1/0||1/a== -1/0||a===1/0||a=== -1/0?a:(a<0?-1:1)*Math.floor(Math.abs(a))}function k(a){switch(h(a)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return k(function(i){var j=arguments.length>1?arguments[1]:c;if("object"===h(i)){if(arguments.length<2)var a="default";else j===String?a="string":j===Number&&(a="number");var k="function"==typeof b.Symbol&&"symbol"==typeof b.Symbol.toPrimitive?function(h,b){var d,e,a=(d=h,e=b,g(d)[e]);if(null!==a&&a!==c){if(!1===f(a))throw new TypeError("Method not callable: "+b);return a}}(i,b.Symbol.toPrimitive):c;if(k!==c){var l=d(k,i,[a]);if("object"!==h(l))return l;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===a&&(a="number"),function(c,j){if("string"===j)var a=["toString","valueOf"];else a=["valueOf","toString"];for(var b=0;b=0)var a=c;else(a=b+c)<0&&(a=0);for(;a1?arguments[1]:c,d=k(function(a){if(null===a||a===c)throw TypeError(Object.prototype.toString.call(a)+" is not coercible to Object.");return a}(this));if(function(a){if("object"!==h(a))return!1;var g,d="Symbol"in b&&"match"in b.Symbol?e(a,b.Symbol.match):c;if(d!==c)return Boolean(d);try{var f=a.lastIndex;return a.lastIndex=0,RegExp.prototype.exec.call(a),!0}catch(i){}finally{a.lastIndex=f}return!1}(a))throw new TypeError("First argument to String.prototype.includes must not be a regular expression");var g=k(a),i=Math.min(Math.max(j(f),0),d.length);return -1!==String.prototype.indexOf.call(d,g,i)})}("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),$(document).ready(function(){(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)&&$("html").addClass("dgwt-wcas-is-ios"),window.dgwt_wcas.resizeOnlyOnce=null,window.dgwt_wcas.scrollOnlyOnce=null,window.dgwt_wcas.config={minChars:dgwt_wcas.min_chars,width:dgwt_wcas.sug_width,autoSelectFirst:!1,triggerSelectOnValidInput:!1,serviceUrl:dgwt_wcas.ajax_search_endpoint,paramName:"s",showDetailsPanel:1==dgwt_wcas.show_details_panel,showImage:1==dgwt_wcas.show_images,showPrice:1==dgwt_wcas.show_price,showDescription:1==dgwt_wcas.show_desc,showSKU:1==dgwt_wcas.show_sku,showSaleBadge:1==dgwt_wcas.show_sale_badge,showFeaturedBadge:1==dgwt_wcas.show_featured_badge,dynamicPrices:void 0!==dgwt_wcas.dynamic_prices&&!!dgwt_wcas.dynamic_prices,saleBadgeText:dgwt_wcas.labels.sale_badge,featuredBadgeText:dgwt_wcas.labels.featured_badge,isRtl:1==dgwt_wcas.is_rtl,showHeadings:1==dgwt_wcas.show_headings,isPremium:1==dgwt_wcas.is_premium,taxonomyBrands:dgwt_wcas.taxonomy_brands,layoutBreakpoint:dgwt_wcas.layout_breakpoint,mobileOverlayBreakpoint:dgwt_wcas.mobile_overlay_breakpoint,mobileOverlayWrapper:dgwt_wcas.mobile_overlay_wrapper,mobileOverlayDelay:dgwt_wcas.mobile_overlay_delay,debounceWaitMs:dgwt_wcas.debounce_wait_ms,sendGAEvents:dgwt_wcas.send_ga_events,convertHtml:dgwt_wcas.convert_html,enableGASiteSearchModule:dgwt_wcas.enable_ga_site_search_module,appendTo:void 0!==dgwt_wcas.suggestions_wrapper?dgwt_wcas.suggestions_wrapper:"body",showProductVendor:void 0!==dgwt_wcas.show_product_vendor&&!!dgwt_wcas.show_product_vendor,disableHits:void 0!==dgwt_wcas.disable_hits&&!!dgwt_wcas.disable_hits,disableSubmit:void 0!==dgwt_wcas.disable_submit&&!!dgwt_wcas.disable_submit,voiceSearchEnabled:void 0!==dgwt_wcas.voice_search_enabled&&!!dgwt_wcas.voice_search_enabled,voiceSearchLang:void 0!==dgwt_wcas.voice_search_lang?dgwt_wcas.voice_search_lang:""},$(".dgwt-wcas-search-input").dgwtWcasAutocomplete(window.dgwt_wcas.config)}),({brokenSearchUi:void 0!==dgwt_wcas.fixer.broken_search_ui&&!!dgwt_wcas.fixer.broken_search_ui,brokenSearchUiAjax:void 0!==dgwt_wcas.fixer.broken_search_ui_ajax&&!!dgwt_wcas.fixer.broken_search_ui_ajax,brokenSearchUiHard:void 0!==dgwt_wcas.fixer.broken_search_ui_hard&&!!dgwt_wcas.fixer.broken_search_ui_hard,brokenSearchElementorPopups:void 0!==dgwt_wcas.fixer.broken_search_elementor_popups&&!!dgwt_wcas.fixer.broken_search_elementor_popups,brokenSearchBrowserBackArrow:void 0!==dgwt_wcas.fixer.broken_search_browsers_back_arrow&&!!dgwt_wcas.fixer.broken_search_browsers_back_arrow,forceRefreshCheckout:void 0!==dgwt_wcas.fixer.force_refresh_checkout&&!!dgwt_wcas.fixer.force_refresh_checkout,searchBars:[],init:function(){var a=this;a.brokenSearchUi&&$(document).ready(function(){a.fixBrokenSearchUi()}),a.brokenSearchUiAjax&&a.fixBrokenSearchUiAjax(),a.brokenSearchUiHard&&a.fixBrokenSearchUiHard(),a.brokenSearchElementorPopups&&$(document).ready(function(){a.fixBrokenSearchOnElementorPopupsV1(),a.fixBrokenSearchOnElementorPopupsV2()}),a.brokenSearchBrowserBackArrow&&a.fixbrokenSearchBrowserBackArrow(),a.forceRefreshCheckout&&a.fixforceRefreshCheckout()},fixBrokenSearchUi:function(){var a=this;$(document).ready(function(){setTimeout(function(){a.pullAndReconditionSearchBars()},50)}),$(window).on("load",function(){setTimeout(function(){a.pullAndReconditionSearchBars()},500)})},fixBrokenSearchUiAjax:function(){var a=this;$(document).ajaxSuccess(function(d,b,c){!("string"==typeof c.url&&new RegExp("search.php|wc-ajax").test(c.url))&&"string"==typeof b.responseText&&b.responseText.includes("dgwt-wcas-search-input")&&setTimeout(function(){a.pullAndReconditionSearchBars()},500)})},fixBrokenSearchUiHard:function(){var a=this;$(document).ready(function(){0===a.searchBars.length&&a.pullAndReconditionSearchBars(),setInterval(function(){a.pullAndReconditionSearchBars()},1e3)})},fixBrokenSearchOnElementorPopupsV1:function(){var a=this;$(document).on("elementor/popup/show",()=>{setTimeout(function(){a.pullAndReconditionSearchBars()},500)})},fixBrokenSearchOnElementorPopupsV2:function(){var a=this;$(document).ready(function(){void 0!==window.elementorFrontend&& void 0!==window.elementorFrontend.documentsManager&& void 0!==window.elementorFrontend.documentsManager.documents&&$.each(elementorFrontend.documentsManager.documents,function(c,b){void 0!==b.getModal&&b.getModal&&b.getModal().on("show",function(){setTimeout(function(){a.pullAndReconditionSearchBars()},500)})})})},fixforceRefreshCheckout:function(){$(document.body).on("added_to_cart",function(){$(document.body).hasClass("woocommerce-checkout")&&$(".dgwt-wcas-search-input").length>0&&$(document.body).trigger("update_checkout")})},fixbrokenSearchBrowserBackArrow:function(){$(window).on("load",function(){var a=0,b=setInterval(function(){var c=document.activeElement;if("object"==typeof c&&$(c).length&&$(c).hasClass("dgwt-wcas-search-input")){var d=$(c).closest(".dgwt-wcas-search-wrapp");d.length&&!d.hasClass("dgwt-wcas-active")&&(d.addClass("dgwt-wcas-active"),clearInterval(b))}a>10&&clearInterval(b),a++},500)})},pullAndReconditionSearchBars:function(){var b=this,a=$(".dgwt-wcas-search-input"),c=0==b.searchBars.length;a.length>0&&a.each(function(){var d,a=$(this),e=!0;if(b.searchBars.length>0){for(d=0;d0)for(var a=0;a