LittleDemon WebShell


Linux server27.hostingraja.org 2.6.32-954.3.5.lve1.4.93.el6.x86_64 #1 SMP Wed Oct 4 17:04:29 UTC 2023 x86_64
Path : /home/udaipurk/public_html/websites/rishhh/wp-content/themes/xstore/js/modules/
File Upload :
Command :
Current File : //home/udaipurk/public_html/websites/rishhh/wp-content/themes/xstore/js/modules/ethemeSearch.min.js

!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports&&"function"==typeof require?e(require("jquery")):e(jQuery)}(function(d){"use strict";var n={escapeRegExChars:function(e){return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(e){var t=document.createElement("div");return t.className=e,t.style.position="absolute",t.style.display="none",t}},s=27,i=9,o=13,a=38,r=39,l=40,e=d.noop;function c(e,t){var n=this;n.element=e,n.el=d(e),n.suggestions=[],n.badQueries=[],n.selectedIndex=-1,n.currentValue=n.element.value,n.timeoutId=null,n.cachedResponse={},n.onChangeTimeout=null,n.onChange=null,n.isLocal=!1,n.suggestionsContainer=null,n.noSuggestionsContainer=null,n.options=d.extend(!0,{},c.defaults,t),n.classes={selected:"autocomplete-selected",suggestion:"autocomplete-suggestion"},n.hint=null,n.hintValue="",n.selection=null,n.initialize(),n.setOptions(t)}c.utils=n,(d.Autocomplete=c).defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,onHint:null,width:"auto",minChars:1,maxHeight:300,deferRequestBy:0,params:{},formatResult:function(e,t){return t?(t="("+n.escapeRegExChars(t)+")",e.value.replace(new RegExp(t,"gi"),"<strong>$1</strong>").replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/&lt;(\/?strong)&gt;/g,"<$1>")):e.value},formatGroup:function(e,t){return'<div class="autocomplete-group">'+t+"</div>"},delimiter:null,zIndex:9999,type:"GET",noCache:!1,onSearchStart:e,onSearchComplete:e,onSearchError:e,preserveInput:!1,containerClass:"autocomplete-suggestions",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,closeOnOutside:!0,preventBadQueries:!0,lookupFilter:function(e,t,n){return-1!==e.value.toLowerCase().indexOf(n)},paramName:"query",transformResult:function(e){return"string"==typeof e?d.parseJSON(e):e},showNoSuggestionNotice:!1,noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1},c.prototype={initialize:function(){var e,t=this,n="."+t.classes.suggestion,s=t.classes.selected,i=t.options;t.element.setAttribute("autocomplete","off"),t.noSuggestionsContainer=d('<div class="autocomplete-no-suggestion"></div>').html(this.options.noSuggestionNotice).get(0),t.suggestionsContainer=c.utils.createNode(i.containerClass),(e=d(t.suggestionsContainer)).appendTo(i.appendTo||"body"),"auto"!==i.width&&e.css("width",i.width),e.on("mouseover.autocomplete",n,function(){t.activate(d(this).data("index"))}),e.on("mouseout.autocomplete",function(){t.selectedIndex=-1,e.children("."+s).removeClass(s)}),e.on("click.autocomplete",n,function(){t.select(d(this).data("index"))}),e.on("click.autocomplete",function(){clearTimeout(t.blurTimeoutId)}),t.fixPositionCapture=function(){t.visible&&t.fixPosition()},d(window).on("resize.autocomplete",t.fixPositionCapture),t.el.on("keydown.autocomplete",function(e){t.onKeyPress(e)}),t.el.on("keyup.autocomplete",function(e){t.onKeyUp(e)}),t.el.on("blur.autocomplete",function(){t.onBlur()}),t.el.on("focus.autocomplete",function(){t.onFocus()}),t.el.on("change.autocomplete",function(e){t.onKeyUp(e)}),t.el.on("input.autocomplete",function(e){t.onKeyUp(e)})},onFocus:function(){var e=this;e.disabled||(e.fixPosition(),e.el.val().length>=e.options.minChars&&e.onValueChange())},onBlur:function(){var e=this,t=e.options,n=e.el.val(),s=e.getQuery(n);e.blurTimeoutId=setTimeout(function(){t.closeOnOutside&&e.hide(),e.selection&&e.currentValue!==s&&(t.onInvalidateSelection||d.noop).call(e.element)},200)},abortAjax:function(){var e=this;e.currentRequest&&(e.currentRequest.abort(),e.currentRequest=null)},setOptions:function(e){var t=this,e=d.extend({},t.options,e);t.isLocal=Array.isArray(e.lookup),t.isLocal&&(e.lookup=t.verifySuggestionsFormat(e.lookup)),e.orientation=t.validateOrientation(e.orientation,"bottom"),d(t.suggestionsContainer).css({"max-height":e.maxHeight+"px",width:e.width+"px","z-index":e.zIndex}),this.options=e},clearCache:function(){this.cachedResponse={},this.badQueries=[]},clear:function(){this.clearCache(),this.currentValue="",this.suggestions=[]},disable:function(){var e=this;e.disabled=!0,clearTimeout(e.onChangeTimeout),e.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var e,t,n,s,i,o,a,r,l=this,c=d(l.suggestionsContainer),u=c.parent().get(0);u!==document.body&&!l.options.forceFixPosition||(o=l.options.orientation,e=c.outerHeight(),t=l.el.outerHeight(),n={top:(r=l.el.offset()).top,left:r.left},"auto"===o&&(a=d(window).height(),s=-(i=d(window).scrollTop())+r.top-e,i=i+a-(r.top+t+e),o=Math.max(s,i)===s?"top":"bottom"),n.top+="top"===o?-e:t,u!==document.body&&(a=c.css("opacity"),l.visible||c.css("opacity",0).show(),r=c.offsetParent().offset(),n.top-=r.top,n.top+=u.scrollTop,n.left-=r.left,l.visible||c.css("opacity",a).hide()),"auto"===l.options.width&&(n.width=l.el.outerWidth()+"px"),c.css(n))},isCursorAtEnd:function(){var e=this.el.val().length,t=this.element.selectionStart;return"number"==typeof t?t===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(e){var t=this;if(t.disabled||t.visible||e.which!==l||!t.currentValue){if(!t.disabled&&t.visible){switch(e.which){case s:t.el.val(t.currentValue),t.hide();break;case r:if(t.hint&&t.options.onHint&&t.isCursorAtEnd()){t.selectHint();break}return;case i:if(t.hint&&t.options.onHint)return void t.selectHint();if(-1===t.selectedIndex)return void t.hide();if(t.select(t.selectedIndex),!1===t.options.tabDisabled)return;break;case o:if(-1===t.selectedIndex)return void t.hide();t.select(t.selectedIndex);break;case a:t.moveUp();break;case l:t.moveDown();break;default:return}e.stopImmediatePropagation(),e.preventDefault()}}else t.suggest()},onKeyUp:function(e){var t=this;if(!t.disabled){switch(e.which){case a:case l:return}clearTimeout(t.onChangeTimeout),t.currentValue!==t.el.val()&&(t.findBestHint(),0<t.options.deferRequestBy?t.onChangeTimeout=setTimeout(function(){t.onValueChange()},t.options.deferRequestBy):t.onValueChange())}},onValueChange:function(){var e,t,n,s;this.ignoreValueChange?this.ignoreValueChange=!1:(t=(e=this).options,n=e.el.val(),s=e.getQuery(n),e.selection&&e.currentValue!==s&&(e.selection=null,(t.onInvalidateSelection||d.noop).call(e.element)),clearTimeout(e.onChangeTimeout),e.currentValue=n,e.selectedIndex=-1,t.triggerSelectOnValidInput&&e.isExactMatch(s)?e.select(0):s.length<t.minChars?e.hide():e.getSuggestions(s))},isExactMatch:function(e){var t=this.suggestions;return 1===t.length&&t[0].value.toLowerCase()===e.toLowerCase()},getQuery:function(e){var t=this.options.delimiter;return t?(t=e.split(t))[t.length-1].trim():e},getSuggestionsLocal:function(t){var e=this.options,n=t.toLowerCase(),s=e.lookupFilter,i=parseInt(e.lookupLimit,10),e={suggestions:d.grep(e.lookup,function(e){return s(e,t,n)})};return i&&e.suggestions.length>i&&(e.suggestions=e.suggestions.slice(0,i)),e},getSuggestions:function(s){var e,t,n,i=this,o=i.options,a=o.serviceUrl;o.params[o.paramName]=s,!1!==o.onSearchStart.call(i.element,o.params)&&(e=o.ignoreParams?null:o.params,d.isFunction(o.lookup)?o.lookup(s,function(e){i.suggestions=e.suggestions,i.suggest(),o.onSearchComplete.call(i.element,s,e.suggestions)}):(n=i.isLocal?i.getSuggestionsLocal(s):(d.isFunction(a)&&(a=a.call(i.element,s)),t=a+"?"+d.param(e||{}),i.cachedResponse[t]))&&Array.isArray(n.suggestions)?(i.suggestions=n.suggestions,i.suggest(),o.onSearchComplete.call(i.element,s,n.suggestions)):i.isBadQuery(s)?o.onSearchComplete.call(i.element,s,[]):(i.abortAjax(),n={url:a,data:e,type:o.type,dataType:o.dataType},d.extend(n,o.ajaxSettings),i.currentRequest=d.ajax(n).done(function(e){i.currentRequest=null,e=o.transformResult(e,s),i.processResponse(e,s,t),o.onSearchComplete.call(i.element,s,e.suggestions)}).fail(function(e,t,n){o.onSearchError.call(i.element,s,e,t,n)})))},isBadQuery:function(e){if(this.options.preventBadQueries)for(var t=this.badQueries,n=t.length;n--;)if(0===e.indexOf(t[n]))return!0;return!1},hide:function(){var e=this,t=d(e.suggestionsContainer);d.isFunction(e.options.onHide)&&e.visible&&e.options.onHide.call(e.element,t),e.visible=!1,e.selectedIndex=-1,clearTimeout(e.onChangeTimeout),d(e.suggestionsContainer).hide(),e.onHint(null)},suggest:function(){var e,i,o,a,r,l,t,n,s,c,u,h;this.suggestions.length?(i=(e=this).options,o=i.groupBy,a=i.formatResult,r=e.getQuery(e.currentValue),l=e.classes.suggestion,t=e.classes.selected,n=d(e.suggestionsContainer),s=d(e.noSuggestionsContainer),c=i.beforeRender,u="",i.triggerSelectOnValidInput&&e.isExactMatch(r)?e.select(0):(d.each(e.suggestions,function(e,t){var n,s;o&&(u+=(s=(n=t).data[o],h===s?"":(h=s,i.formatGroup(n,h)))),u+='<div class="'+l+'" data-index="'+e+'">'+a(t,r,e)+"</div>"}),this.adjustContainerWidth(),s.detach(),n.html(u),d.isFunction(c)&&c.call(e.element,n,e.suggestions),e.fixPosition(),n.show(),i.autoSelectFirst&&(e.selectedIndex=0,n.scrollTop(0),n.children("."+l).first().addClass(t)),e.visible=!0,e.findBestHint())):this.options.showNoSuggestionNotice?this.noSuggestions():this.hide()},noSuggestions:function(){var e=this,t=e.options.beforeRender,n=d(e.suggestionsContainer),s=d(e.noSuggestionsContainer);this.adjustContainerWidth(),s.detach(),n.empty(),n.append(s),d.isFunction(t)&&t.call(e.element,n,e.suggestions),e.fixPosition(),n.show(),e.visible=!0},adjustContainerWidth:function(){var e,t=this.options,n=d(this.suggestionsContainer);"auto"===t.width?(e=this.el.outerWidth(),n.css("width",0<e?e:300)):"flex"===t.width&&n.css("width","")},findBestHint:function(){var s=this.el.val().toLowerCase(),i=null;s&&(d.each(this.suggestions,function(e,t){var n=0===t.value.toLowerCase().indexOf(s);return n&&(i=t),!n}),this.onHint(i))},onHint:function(e){var t=this,n=t.options.onHint,s="";e&&(s=t.currentValue+e.value.substr(t.currentValue.length)),t.hintValue!==s&&(t.hintValue=s,t.hint=e,d.isFunction(n))&&n.call(t.element,s)},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?d.map(e,function(e){return{value:e,data:null}}):e},validateOrientation:function(e,t){return e=(e||"").trim().toLowerCase(),e=-1===d.inArray(e,["auto","bottom","top"])?t:e},processResponse:function(e,t,n){var s=this,i=s.options;e.suggestions=s.verifySuggestionsFormat(e.suggestions),i.noCache||(s.cachedResponse[n]=e,i.preventBadQueries&&!e.suggestions.length&&s.badQueries.push(t)),t===s.getQuery(s.currentValue)&&(s.suggestions=e.suggestions,s.suggest())},activate:function(e){var t=this,n=t.classes.selected,s=d(t.suggestionsContainer),i=s.find("."+t.classes.suggestion);return s.find("."+n).removeClass(n),t.selectedIndex=e,-1!==t.selectedIndex&&i.length>t.selectedIndex?(s=i.get(t.selectedIndex),d(s).addClass(n),s):null},selectHint:function(){var e=d.inArray(this.hint,this.suggestions);this.select(e)},select:function(e){this.hide(),this.onSelect(e)},moveUp:function(){var e=this;-1!==e.selectedIndex&&(0===e.selectedIndex?(d(e.suggestionsContainer).children("."+e.classes.suggestion).first().removeClass(e.classes.selected),e.selectedIndex=-1,e.ignoreValueChange=!1,e.el.val(e.currentValue),e.findBestHint()):e.adjustScroll(e.selectedIndex-1))},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&this.adjustScroll(this.selectedIndex+1)},adjustScroll:function(e){var t,n,s,i=this,o=i.activate(e);o&&(t=d(o).outerHeight(),o=o.offsetTop,s=(n=d(i.suggestionsContainer).scrollTop())+i.options.maxHeight-t,o<n?d(i.suggestionsContainer).scrollTop(o):s<o&&d(i.suggestionsContainer).scrollTop(o-i.options.maxHeight+t),i.options.preserveInput||(i.ignoreValueChange=!0,i.el.val(i.getValue(i.suggestions[e].value))),i.onHint(null))},onSelect:function(e){var t=this,n=t.options.onSelect,e=t.suggestions[e];t.currentValue=t.getValue(e.value),t.currentValue===t.el.val()||t.options.preserveInput||t.el.val(t.currentValue),t.onHint(null),t.selection=e,d.isFunction(n)&&n.call(t.element,e)},getValue:function(e){var t,n=this.options.delimiter;return!n||1===(n=(t=this.currentValue).split(n)).length?e:t.substr(0,t.length-n[n.length-1].length)+e},dispose:function(){this.el.off(".autocomplete").removeData("autocomplete"),d(window).off("resize.autocomplete",this.fixPositionCapture),d(this.suggestionsContainer).remove()}},d.fn.devbridgeAutocomplete=function(n,s){var i="autocomplete";return arguments.length?this.each(function(){var e=d(this),t=e.data(i);"string"==typeof n?t&&"function"==typeof t[n]&&t[n](s):(t&&t.dispose&&t.dispose(),t=new c(this,n),e.data(i,t))}):this.first().data(i)},d.fn.autocomplete||(d.fn.autocomplete=d.fn.devbridgeAutocomplete)}),function(g){"use strict";g(window).on("elementor/frontend/init",function(){var n=elementorModules.frontend.handlers.Base.extend({onInit:function(){elementorModules.frontend.handlers.Base.prototype.onInit.apply(this,arguments),this.popupType=!1,this.searchesShown=!1,this.content_elements={},this.run()},getDefaultSettings:function(){return{selectors:{form:".etheme-search-form",results:".etheme-search-ajax-results",input:"input.etheme-search-form-input",button:".etheme-search-form-submit",clear:".etheme-search-form-clear",select:".etheme-search-form-select",tag:".etheme-search-tags a",suggestionsContainer:".autocomplete-suggestions",suggestion:".autocomplete-suggestion",langInput:"input[name=lang]",trendingSearchesWrapper:".etheme-search-trending-searches-wrapper",trendingSearches:".etheme-search-trending-searches",trendingSearchesRefresh:".etheme-search-trending-searches-refresh",trendingSearchesHeading:".etheme-search-trending-searches-heading",searchItemWrapper:".etheme-search-trending-search-wrapper",animatedPlaceholder:".etheme-search-input-placeholder",animatedPlaceholderItem:".etheme-search-placeholder-text"},classes:{tabsWrapper:"etheme-search-form-tabs",tab:"etheme-search-form-tab",tabContent:"etheme-search-form-tab-content",itemsTitle:"etheme-search-form-title",itemsViewMore:"etheme-search-form-more",itemWrapper:"etheme-search-form-item",itemLink:"etheme-search-form-item-link",itemInfo:"etheme-search-form-item-info",itemInfoInner:"etheme-search-form-item-info-inner",itemTitle:"etheme-search-form-item-title",itemDate:"etheme-search-form-item-date",itemSku:"sku_wrapper",itemPrice:"price etheme-search-form-item-price",itemImg:"attachment-post-thumbnail size-post-thumbnail wp-post-image",suggestionsContainer:"autocomplete-suggestions",suggestion:"autocomplete-suggestion",itemInfoSeparator:"etheme-search-form-item-info-separator",itemRedirect:"etheme-search-redirect",searchItemWrapper:"etheme-search-trending-search-wrapper",searchItem:"etheme-search-trending-search-item",searchItemIcon:"etheme-search-trending-search-icon",animatedPlaceholderItemActive:"etheme-search-placeholder-text-active"}}},getDefaultElements:function(){var e=this.getSettings("selectors");return{$form:this.$element.find(e.form),$results:this.$element.find(e.results),$input:this.$element.find(e.input),$button:this.$element.find(e.button),$clear:this.$element.find(e.clear),$select:this.$element.find(e.select),$tag:this.$element.find(e.tag),$suggestionsContainer:this.$element.find(e.suggestionsContainer),$suggestion:this.$element.find(e.suggestion),$langInput:this.$element.find(e.langInput),$trendingSearchesWrapper:this.$element.find(e.trendingSearchesWrapper),$trendingSearches:this.$element.find(e.trendingSearches),$trendingSearchesRefresh:this.$element.find(e.trendingSearchesRefresh),$trendingSearchesHeading:this.$element.find(e.trendingSearchesHeading),$searchItemWrapper:this.$element.find(e.searchItemWrapper),$animatedPlaceholder:this.$element.find(e.animatedPlaceholder),$animatedPlaceholderItem:this.$element.find(e.animatedPlaceholderItem)}},onElementChange:function(e){},tagAction:function(e,t){this.elements.$input.val(t.text()).focus(),e&&void 0!==this.elements.$input.devbridgeAutocomplete&&((t=this.elements.$input.devbridgeAutocomplete()).clearCache(),t.hide(),t.onValueChange())},trendingSearches:function(t,n,s){t.elements.$input.on("focus",function(e){e.originalEvent&&""==this.value&&t.initTrendingSearches(t,n,s)})},destroyTrendingSearchesWrapper:function(e){e.elements.$trendingSearchesWrapper.addClass("hidden"),e.elements.$form.removeClass("trending-searches-shown"),e.searchesShown=!1},initTrendingSearchesWrapper:function(e,t){e.elements.$trendingSearchesWrapper.removeClass("hidden"),e.elements.$form.addClass("trending-searches-shown"),e.searchesShown=!0},maybeInitTrendingSearches:function(e,t,n){t.trending_searches&&e.elements.$input.val().length<(t.min_chars?.size?t.min_chars.size:3)&&e.initTrendingSearches(e,t,n)},initTrendingSearches:function(e,t,n){t=e.generateTrendingSearches(t,n);e.elements.$form.addClass("trending-searches-shown"),e.elements.$trendingSearches.html(t),e.initTrendingSearchesWrapper(e,n)},generateTrendingSearches:function(e,t){let n=e.trending_searches_list.split(",").map(e=>'<div class="'+t.searchItemWrapper+'"><span class="'+t.searchItemIcon+'">'+`<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">
<path d="M31.712 30.4l-8.224-8.192c2.112-2.464 3.264-5.568 3.264-8.768 0-7.36-5.984-13.376-13.376-13.376-7.36 0-13.344 5.984-13.344 13.344s5.984 13.376 13.376 13.376c3.232 0 6.304-1.152 8.768-3.296l8.224 8.192c0.192 0.192 0.416 0.288 0.64 0.288s0.448-0.096 0.608-0.256c0.192-0.16 0.288-0.384 0.32-0.64 0-0.256-0.096-0.512-0.256-0.672zM24.928 13.44c0 6.336-5.184 11.52-11.552 11.52-6.336 0-11.52-5.184-11.52-11.552 0-6.336 5.184-11.52 11.552-11.52s11.52 5.184 11.52 11.552z"></path>
</svg>`+'</span><span class="'+t.searchItem+'">'+e.trim()+"</span></div>");return n=n.sort(()=>Math.random()-.5),(n=e.trending_searches_limit?.size?n.slice(0,e.trending_searches_limit.size):n).join("")},animatedPlacehoder:function(t,e,n){t.elements.$animatedPlaceholder.on("click",function(){g(this).addClass("hidden"),t.elements.$input.val("").focus(),t.maybeInitInputFocusState(t,e),t.maybeInitTrendingSearches(t,e,n)});let s=t.elements.$animatedPlaceholderItem,i=0,o="";function a(){o=setInterval(()=>{r()},2500)}function r(){i++,t.elements.$animatedPlaceholderItem.removeClass(n.animatedPlaceholderItemActive),t.elements.$animatedPlaceholderItem.eq([s.length-i]).addClass(n.animatedPlaceholderItemActive),s.length==i&&(i=0)}r(),a(),t.elements.$input.on("focus",function(e){t.elements.$animatedPlaceholder.addClass("hidden"),clearInterval(o)}),t.elements.$input.on("blur",function(){""==this.value&&(t.elements.$animatedPlaceholder.removeClass("hidden"),i=0,r(),a())})},initInputFocusState:function(e){e.elements.$input.addClass("focused")},destroyInputFocusState:function(e){e.elements.$input.removeClass("focused")},maybeInitInputFocusState:function(e,t){t.focus_overlay&&e.initInputFocusState(e)},run:function(){var a=this.getElementSettings(),r=this,e=this.getWidgetType(),t=-1<g.inArray(e,["etheme_ajax_search","theme-etheme_ajax_search","theme-etheme_ajax_search_popup"]);let n=t?a.ajax_search:!!this.elements.$form.data("ajax-search");var s,l,i,o=this.elements.$form.attr("type"),o=(this.popupType="popup"==o,!!a.focus_overlay||!!a.trending_searches);let c="mobile"==elementorFrontend.getCurrentDeviceMode(),u=!elementorFrontend.isEditMode()&&!this.popupType,h=(this.$element.parents(".elementor-popup-modal").length&&(u=!1),this.getSettings("classes")),d=this.getSettings("selectors");if(this.heading_type=a.ajax_search_results_heading_type,this.content_elements={image:!0,title:!0,product_stock:a.product_stock,product_sku:a.product_sku,category:a.product_category,product_price:a.product_price,date:a.global_post_type_date},"theme-etheme_mobile_menu"==e)this.content_elements.image=!1,this.content_elements.title=!0,this.content_elements.product_price=!0,this.content_elements.date=!1;else if(c){var p,m=a.post_type_content_mobile;for(p in this.content_elements)this.content_elements[p]=-1<g.inArray(p,m)}this.elements.$tag.on("click",function(e){e.preventDefault(),r.tagAction(n,g(this))}),a.focus_overlay&&this.elements.$input.on("focus",function(e){e.originalEvent&&r.initInputFocusState(r)}),a.trending_searches&&(this.trendingSearches(r,a,h),this.elements.$trendingSearchesRefresh.on("click",function(e){r.initTrendingSearches(r,a,h)}),n||(elementorFrontend.elements.$document.on("click",'[data-id="'+r.getID()+'"] .'+h.searchItemWrapper,function(e){e.preventDefault(),r.tagAction(!1,g(this).find("."+h.searchItem))}),r.elements.$input.on("keyup keydown",function(){""==this.value?r.initTrendingSearches(r,a,h):r.destroyTrendingSearchesWrapper(r)}))),o&&elementorFrontend.elements.$document.on("click",e=>{e=jQuery(e.target);e.closest(d.results).length||e.closest(d.input).length||e.closest(d.select).length||e.closest(d.animatedPlaceholder).length||e.closest(d.button).length||e.closest(d.clear).length||(a.trending_searches&&r.searchesShown&&r.destroyTrendingSearchesWrapper(r),a.focus_overlay&&r.destroyInputFocusState(r))}),a.animated_placeholder&&this.animatedPlacehoder(r,a,h),n&&(e=this.elements.$results,s=etConfig.ajaxurl+"?action=etheme_ajax_search",this.elements.$input.val(),o=t?a.post_types.join(","):this.elements.$form.data("post-types"),l=elementorFrontend.isEditMode(),this.popupType&&(s+="&full_screen=yes"),a.product_category&&(s+="&product_category=yes"),a.product_subcategory_path&&(s+="&product_subcategory_path=yes"),s=s+"&shortcode=yes&custom_post_types="+o,a.post_limit?.size&&(s+="&custom_post_limits="+a.post_limit.size),s+="&show_count=true",a.posts_per_page?.size&&(s+="&posts_per_page="+a.posts_per_page.size),this.elements.$select.length&&(a.categories_dynamic_width&&this.elements.$select.on("change",function(){var e=this.options[this.selectedIndex].text;g(this).find("option:selected").html(g(this).find("option:selected").html().replace(/&nbsp;/g,"")),g(this).css("max-width","calc("+(13+8*e.trim().length)+"px + 45px)")}),""!==this.elements.$select.val())&&(s+="&product_cat="+this.elements.$select.val()),this.elements.$langInput&&this.elements.$langInput.val()&&(s+="&lang="+this.elements.$langInput.val()),this.elements.$input.devbridgeAutocomplete({minChars:a.min_chars?.size?a.min_chars.size:3,appendTo:e,triggerSelectOnValidInput:!1,serviceUrl:s,width:"flex",deferRequestBy:200,maxHeight:a.results_max_height?.size?a.results_max_height.size:350,showNoSuggestionNotice:!0,noSuggestionNotice:etheme_search_config.noResults,closeOnOutside:u,onSearchStart:function(){r.elements.$form.addClass("searching loading"),r.destroyTrendingSearchesWrapper(r,h)},onHide:function(){r.elements.$form.removeClass("searching loading"),r.maybeInitTrendingSearches(r,a,h)},onSearchComplete:function(e,t){r.elements.$input.val();var i=0;let o=!0;if(r.elements.$form.removeClass("loading"),r.elements.$form.find(".ajax-results-title, .ajax-results-more").remove(),t.length&&g.each(a.post_types,function(){var e,t,n=this,s=r.$element.find(d.suggestion).find('[data-type="'+n+'"]').first();s.length&&(e=parseInt(s.attr("data-count-all")),i+=e,"headings"==r.heading_type)&&(t=(r.popupType?etheme_search_config[n+"_found"]:etheme_search_config[1<e?"items_found":"item_found"]).replace("{{count}}",e),t=r.popupType?t:(etheme_search_config[n]??n)+"<span>"+t+"</span>",s.parent().before('<h3 class="'+h.itemsTitle+'" data-title-type="'+n+'">'+t+"</h3>"),o=!r.popupType,r.popupType)&&(s=r.$element.find(d.suggestion).find('[data-type="'+n+'"]').length)<e&&r.$element.find(d.suggestion).find('[data-type="'+n+'"]').last().parent().after('<div class="'+h.itemsViewMore+'"><button type="submit" class="btn black"><span>'+etheme_search_config.show_more.replace("{{count}}",e-s)+"</span>"+r.getMoreButtonArrow()+"</button></div>")}),"tabs"==r.heading_type){let e=[];g.each(t,function(){e.push(r.validatePostType(this.type))}),1<(e=e.filter(function(e,t,n){return n.indexOf(e)===t})).length&&(r.$element.find(d.suggestionsContainer).prepend('<div class="'+h.tabsWrapper+'"></div>'),g.each(e,function(){var e=etheme_search_config[this]??this;r.elements.$form.find("."+h.tabsWrapper).append('<span class="'+h.tab+'" data-tab="'+this+'">'+e+"</span>")}),g.each(r.$element.find(d.suggestion),function(){g(this).addClass(h.tabContent).attr("data-tab-name",g(this).find("."+h.itemWrapper).attr("data-type"))}),r.initTabs(),r.$element.find("."+h.tab).first().trigger("click"))}r.$element.find("."+h.itemRedirect).length&&r.initRedirect(),o&&t.length<i&&r.$element.find(d.suggestionsContainer).append('<div class="'+h.itemsViewMore+'"><button type="submit" class="btn black"><span>'+etheme_search_config.show_all+"</span>"+r.getMoreButtonArrow()+"</button></div>")},beforeRender:function(e){},formatResult:function(e,t){l&&(c="mobile"==elementorFrontend.getCurrentDeviceMode());let n="",s="("+g.Autocomplete.utils.escapeRegExChars(t)+")",i=r.validatePostType(e.type);var o;return r.popupType&&!c&&-1<g.inArray(i,["product","post"])?n+=r.formatPopupResult(i,e,a,h,s):(n+='<a href="'+e.url+'" title="'+e.value+'" class="'+[h.itemLink,h.itemWrapper].join(" ")+'" data-type="'+i+'" data-count-all="'+e.all_count+'">',e.img&&r.content_elements.image&&(n+=r.formatImage(e.img,h.itemImg,e.value)),n+='<div class="'+h.itemInfo+'">',r.content_elements.title&&(n+='<p class="'+h.itemTitle+'"><span>'+e.value.replace(new RegExp(s,"gi"),"<strong>$1</strong>")+"</span></p>"),t=[],e.sku&&r.content_elements.product_sku&&t.push('<span class="'+h.itemSku+'">'+e.sku+"</span>"),e.stock&&r.content_elements.product_stock&&t.push(e.stock.replace("<p","<span").replace("</p>","</span>")),e.category&&r.content_elements.category&&(o=JSON.parse(e.category),t.push('<span class="'+h.itemRedirect+'" data-redirect="'+o.url+'">'+o.title+"</span>")),t.length&&(n+='<div class="'+h.itemInfoInner+'">'+t.join('<span class="'+h.itemInfoSeparator+'">|</span>')+"</div>"),n+="</div>",e.price&&r.content_elements.product_price&&(n+='<div class="'+h.itemPrice+'">'+e.price+"</div>"),e.date&&r.content_elements.date&&(n+='<div class="'+h.itemDate+'">'+e.date+"</div>"),e.arrow,n+="</a>"),n}}),i=r.elements.$input.devbridgeAutocomplete(),r.elements.$select.length&&r.elements.$select.on("change",function(e){var t=r.elements.$select.val();i.setOptions({serviceUrl:s+(t?"&product_cat="+t:"")}),i.clearCache(),i.hide(),i.onValueChange()}),this.elements.$clear.on("click",function(e){r.elements.$input.attr("value","").val("").focus(),i.hide(),i.onValueChange(),r.elements.$form.removeClass("searching loading")}),a.trending_searches)&&elementorFrontend.elements.$document.on("click",'[data-id="'+r.getID()+'"] .'+h.searchItemWrapper,function(e){e.preventDefault(),r.tagAction(!0,g(this).find("."+h.searchItem)),i.onValueChange()})},formatImage:function(e,t,n){return'<img width="270" height="160" src="'+e+'" class="'+t+'" alt="'+n+'">'},formatPopupResult:function(e,t,n,s,i){let o="";switch(e){case"product":var a;o=(o=o+('<div class="content-product view-color-dark product-view-mask '+s.itemWrapper+'" data-type="'+e+'" data-count-all="'+t.all_count+'">')+'<div class="product-image-wrapper hover-effect-swap">')+('<a class="product-content-image" href="'+t.url+'">'),n.product_stock&&!t.in_stock&&(o+=t.stock),t.img&&(o+=this.formatImage(t.img,s.itemImg,t.value)),o=(o=(o=o+"</a>"+'<footer class="footer-product">')+("<a "+t.add_to_cart_args+">"+t.add_to_cart_text+"</a>")+"</footer>")+"</div>"+'<div class="product-details">',n.product_category&&t.category&&(a=JSON.parse(t.category),o+='<span class="'+s.itemRedirect+'" data-redirect="'+a.url+'">'+a.title+"</span>"),o+='<p class="product-title '+s.itemTitle+'"><a href="'+t.url+'">'+t.value.replace(new RegExp(i,"gi"),"<strong>$1</strong>")+"</a></p>",n.product_stock&&t.in_stock&&(o+=t.stock),n.product_price&&t.price&&(o+='<div class="'+s.itemPrice+'">'+t.price+"</div>"),n.product_sku&&t.sku&&(o+='<span class="'+s.itemSku+'">'+t.sku+"</span>"),o=o+"</div>"+"</div>";break;case"post":o=(o=o+('<article class="'+[t.post_class,s.itemWrapper].join(" ")+'" data-type="'+e+'" data-count-all="'+t.all_count+'"><div>')+'<div class="wp-picture blog-hover-zoom">')+('<a href="'+t.url+'">'),t.img&&(o+=this.formatImage(t.img,s.itemImg,t.value)),o=(o=(o=(o=o+"</a>"+"</div>")+'<div class="grid-post-body">'+'<div class="post-heading">')+('<h2><a href="'+t.url+'">'+t.value.replace(new RegExp(i,"gi"),"<strong>$1</strong>")+"</a></h2>"))+t.meta+"</div>",o=(o=t.excerpt?(o+='<div class="content-article">')+t.excerpt+"</div>":o)+"</div>"+"</div></article>"}return o},initTabs:function(){var e=this.getSettings("classes");this.$element.find("."+e.tab).on("click",function(){g(this).parent().find("."+e.tab).removeClass("active").end().parent().find("[data-tab-name]").removeClass("active").end().find('[data-tab-name="'+g(this).attr("data-tab")+'"]').addClass("active"),g(this).addClass("active")})},initRedirect:function(){var t=this.getSettings("classes");this.$element.find("."+t.itemLink).on("click",function(e){g(e.target).hasClass(t.itemRedirect)&&e.preventDefault()}),this.$element.find("."+t.itemRedirect).on("click",function(e){e.preventDefault(),window.location.href=g(this).data("redirect")})},validatePostType:function(e){return e.toLowerCase().replace("pages","page").replace("portfolio","etheme_portfolio")},getMoreButtonArrow:function(){let e='<path d="M30.912 15.040h-27.744l8.832-9.28c0.16-0.16 0.256-0.416 0.256-0.672s-0.128-0.48-0.288-0.64c-0.16-0.16-0.416-0.256-0.64-0.256-0.256 0-0.48 0.096-0.672 0.288l-10.336 10.912c-0.032 0.032-0.064 0.096-0.096 0.128l-0.032 0.064c-0.096 0.224-0.128 0.48-0.032 0.704 0.032 0.032 0.032 0.096 0.064 0.128 0.032 0.064 0.064 0.096 0.096 0.128l0.064 0.064c0 0 0 0 0 0l10.304 10.816c0.192 0.192 0.416 0.288 0.672 0.288 0.352 0 0.544-0.16 0.64-0.288 0.32-0.352 0.352-0.896 0.032-1.28l-8.864-9.248h27.744c0.512 0 0.928-0.416 0.928-0.928s-0.416-0.928-0.928-0.928z"></path>',t='<path d="M31.904 15.776c-0.064-0.16-0.16-0.288-0.224-0.352l-10.368-10.88c-0.16-0.192-0.384-0.288-0.64-0.32-0.224 0-0.48 0.064-0.64 0.224-0.384 0.32-0.416 0.896-0.064 1.312l8.864 9.312h-27.872c-0.512 0-0.928 0.416-0.928 0.928s0.416 0.896 0.928 0.896h27.872l-8.832 9.344c-0.16 0.192-0.256 0.416-0.224 0.64 0 0.256 0.128 0.48 0.288 0.64 0.16 0.192 0.416 0.288 0.64 0.288 0.192 0 0.416-0.064 0.64-0.256l10.368-10.88c0 0 0.224-0.352 0.224-0.448 0.032-0.16 0.032-0.288-0.032-0.448z"></path>';return'<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 32 32">\n'+(elementorFrontendConfig.is_rtl?e:t)+"</svg>"}});g.each(["etheme_ajax_search","theme-etheme_mobile_menu","theme-etheme_ajax_search","theme-etheme_ajax_search_popup"],function(e,t){elementorFrontend.hooks.addAction("frontend/element_ready/"+t+".default",function(e){elementorFrontend.elementsHandler.addHandler(n,{$element:e})})})})}(jQuery);

LittleDemon - FACEBOOK
[ KELUAR ]