Ajax Search for WooCommerce - Version 1.15.0

Version Description

Download this release

Release Info

Developer damian-gora
Plugin Icon 128x128 Ajax Search for WooCommerce
Version 1.15.0
Comparing to
See all releases

Code changes from version 1.14.0 to 1.15.0

ajax-search-for-woocommerce.php CHANGED
@@ -4,13 +4,13 @@
4
  * Plugin Name: FiboSearch - AJAX Search for WooCommerce
5
  * Plugin URI: https://fibosearch.com?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
6
  * Description: The most popular WooCommerce product search. Gives your users a well-designed advanced AJAX search bar with live search suggestions.
7
- * Version: 1.14.0
8
  * Author: FiboSearch Team
9
  * Author URI: https://fibosearch.com?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
10
  * Text Domain: ajax-search-for-woocommerce
11
  * Domain Path: /languages
12
  * WC requires at least: 3.3
13
- * WC tested up to: 5.8
14
  *
15
  */
16
  // Exit if accessed directly
@@ -45,6 +45,9 @@ if ( !class_exists( 'DGWT_WC_Ajax_Search' ) && !function_exists( 'dgoraAsfwFs' )
45
  * @var \DgoraWcas\Integrations\Marketplace\Marketplace
46
  */
47
  public $marketplace ;
 
 
 
48
  public $nativeSearch ;
49
  public $tntsearch ;
50
  public $tntsearchValid = false ;
4
  * Plugin Name: FiboSearch - AJAX Search for WooCommerce
5
  * Plugin URI: https://fibosearch.com?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
6
  * Description: The most popular WooCommerce product search. Gives your users a well-designed advanced AJAX search bar with live search suggestions.
7
+ * Version: 1.15.0
8
  * Author: FiboSearch Team
9
  * Author URI: https://fibosearch.com?utm_source=wp-admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc
10
  * Text Domain: ajax-search-for-woocommerce
11
  * Domain Path: /languages
12
  * WC requires at least: 3.3
13
+ * WC tested up to: 6.0
14
  *
15
  */
16
  // Exit if accessed directly
45
  * @var \DgoraWcas\Integrations\Marketplace\Marketplace
46
  */
47
  public $marketplace ;
48
+ /**
49
+ * @var \DgoraWcas\Engines\WordPressNative\Search
50
+ */
51
  public $nativeSearch ;
52
  public $tntsearch ;
53
  public $tntsearchValid = false ;
assets/css/admin-style.css CHANGED
@@ -1548,7 +1548,7 @@ td.dgwt-wcas-indexing-details-row a {
1548
  }
1549
 
1550
  .dgwt-wcas-tab-mark {
1551
- display: inline-block;
1552
  vertical-align: top;
1553
  box-sizing: border-box;
1554
  margin: 1px 0 -1px 4px;
@@ -1563,6 +1563,10 @@ td.dgwt-wcas-indexing-details-row a {
1563
  text-align: center;
1564
  }
1565
 
 
 
 
 
1566
  .dgwt-wcas-troubleshooting-wrapper {
1567
  padding: 0 10px;
1568
  font-size: 14px;
@@ -1606,6 +1610,7 @@ h3.dgwt-wcas-troubleshooting-issue-title {
1606
  font-family: monospace;
1607
  }
1608
 
 
1609
  .dgwt-wcas-troubleshooting-wrapper .dgwt-wcas-ajax-loader {
1610
  -moz-transition: opacity 0.2s;
1611
  -webkit-transition: opacity 0.2s;
@@ -1624,6 +1629,16 @@ h3.dgwt-wcas-troubleshooting-issue-title {
1624
  opacity: 1;
1625
  }
1626
 
 
 
 
 
 
 
 
 
 
 
1627
  /* Settings - Filters rules */
1628
  #dgwt-wcas-settings-filters-rules .dgwt-wcas-select-group {
1629
  margin-right: 10px;
1548
  }
1549
 
1550
  .dgwt-wcas-tab-mark {
1551
+ display: none;
1552
  vertical-align: top;
1553
  box-sizing: border-box;
1554
  margin: 1px 0 -1px 4px;
1563
  text-align: center;
1564
  }
1565
 
1566
+ .dgwt-wcas-tab-mark.active {
1567
+ display: inline-block;
1568
+ }
1569
+
1570
  .dgwt-wcas-troubleshooting-wrapper {
1571
  padding: 0 10px;
1572
  font-size: 14px;
1610
  font-family: monospace;
1611
  }
1612
 
1613
+ .dgwt-wcas-tab-progress,
1614
  .dgwt-wcas-troubleshooting-wrapper .dgwt-wcas-ajax-loader {
1615
  -moz-transition: opacity 0.2s;
1616
  -webkit-transition: opacity 0.2s;
1629
  opacity: 1;
1630
  }
1631
 
1632
+ .dgwt-wcas-tab-progress {
1633
+ margin-top: -5px;
1634
+ display: none;
1635
+ opacity: 1;
1636
+ }
1637
+
1638
+ .dgwt-wcas-tab-progress.active {
1639
+ display: inline-block;
1640
+ }
1641
+
1642
  /* Settings - Filters rules */
1643
  #dgwt-wcas-settings-filters-rules .dgwt-wcas-select-group {
1644
  margin-right: 10px;
assets/css/style-amp.css ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form {
2
+ min-width: 200px;
3
+ left: -50px;
4
+ }
assets/css/style-amp.min.css ADDED
@@ -0,0 +1 @@
 
1
+ html:not(.dgwt-wcas-overlay-mobile-on) .dgwt-wcas-search-wrapp.dgwt-wcas-layout-icon .dgwt-wcas-search-form{min-width:200px;left:-50px}
assets/img/admin-troubleshooting-ithemes.png DELETED
Binary file
assets/js/admin.js CHANGED
@@ -260,6 +260,8 @@
260
  actionTriggerClass: 'js-ajax-build-index',
261
  actionStopTriggerClass: 'js-ajax-stop-build-index',
262
  indexingWrappoerClass: 'js-dgwt-wcas-indexing-wrapper',
 
 
263
  getWrapper: function () {
264
  var _this = this;
265
 
@@ -276,6 +278,8 @@
276
  $btn.attr('disabled', 'disabled');
277
 
278
  $('.dgwt-wcas-settings-info').addClass('wcas-ajax-build-index-wait');
 
 
279
 
280
  var emergency = $btn.hasClass('js-ajax-build-index-emergency') ? true : false;
281
 
@@ -353,7 +357,14 @@
353
 
354
  if (response.data.loop) {
355
  _this.heartbeat();
356
- } else if (response.data.refresh_once.length > 0) {
 
 
 
 
 
 
 
357
  // If refresh cookie non exist and Troubleshooting tab is hidden then reload
358
  if (
359
  !document.cookie.split(';').some(function (item) {
@@ -1450,6 +1461,7 @@
1450
  progressBarInner: '.dgwt-wcas-troubleshooting-wrapper .progress-bar-inner',
1451
  resetButtonName: 'dgwt-wcas-reset-async-tests',
1452
  fixOutofstockButtonName: 'dgwt-wcas-fix-out-of-stock-relationships',
 
1453
  dismissElementorTemplateButtonName: 'dgwt-wcas-dismiss-elementor-template',
1454
  init: function () {
1455
  var _this = this;
@@ -1511,6 +1523,24 @@
1511
  return false;
1512
  });
1513
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1514
  $(document).on('click', 'input[name="' + _this.dismissElementorTemplateButtonName + '"]', function (e) {
1515
  $('input[name="' + _this.dismissElementorTemplateButtonName + '"]').attr('disabled', 'disabled');
1516
  var data = {
260
  actionTriggerClass: 'js-ajax-build-index',
261
  actionStopTriggerClass: 'js-ajax-stop-build-index',
262
  indexingWrappoerClass: 'js-dgwt-wcas-indexing-wrapper',
263
+ indexerTabProgressClass: 'js-dgwt-wcas-indexer-tab-progress',
264
+ indexerTabErrorClass: 'js-dgwt-wcas-indexer-tab-error',
265
  getWrapper: function () {
266
  var _this = this;
267
 
278
  $btn.attr('disabled', 'disabled');
279
 
280
  $('.dgwt-wcas-settings-info').addClass('wcas-ajax-build-index-wait');
281
+ $('.' + _this.indexerTabErrorClass).removeClass('active');
282
+ $('.' + _this.indexerTabProgressClass).addClass('active');
283
 
284
  var emergency = $btn.hasClass('js-ajax-build-index-emergency') ? true : false;
285
 
357
 
358
  if (response.data.loop) {
359
  _this.heartbeat();
360
+ } else {
361
+ $('.' + _this.indexerTabProgressClass).removeClass('active');
362
+ if (response.data.status === 'error') {
363
+ $('.' + _this.indexerTabErrorClass).addClass('active');
364
+ }
365
+ }
366
+
367
+ if (!response.data.loop && response.data.refresh_once.length > 0) {
368
  // If refresh cookie non exist and Troubleshooting tab is hidden then reload
369
  if (
370
  !document.cookie.split(';').some(function (item) {
1461
  progressBarInner: '.dgwt-wcas-troubleshooting-wrapper .progress-bar-inner',
1462
  resetButtonName: 'dgwt-wcas-reset-async-tests',
1463
  fixOutofstockButtonName: 'dgwt-wcas-fix-out-of-stock-relationships',
1464
+ switchAlternativeEndpoint: 'dgwt-wcas-switch-alternative-endpoint',
1465
  dismissElementorTemplateButtonName: 'dgwt-wcas-dismiss-elementor-template',
1466
  init: function () {
1467
  var _this = this;
1523
  return false;
1524
  });
1525
 
1526
+ $(document).on('click', 'input[name="' + _this.switchAlternativeEndpoint + '"]', function (e) {
1527
+ var action = parseInt($(this).data('switch')) === 1 ? 'enable' : 'disable';
1528
+ $('input[name="' + _this.switchAlternativeEndpoint + '"]').attr('disabled', 'disabled').next().addClass('loading');
1529
+ var data = {
1530
+ 'action': 'dgwt_wcas_troubleshooting_switch_alternative_endpoint',
1531
+ '_wpnonce': dgwt_wcas.troubleshooting.nonce.troubleshooting_switch_alternative_endpoint,
1532
+ 'switch': action,
1533
+ };
1534
+ $.post(
1535
+ ajaxurl,
1536
+ data,
1537
+ function () {
1538
+ location.reload();
1539
+ }
1540
+ );
1541
+ return false;
1542
+ });
1543
+
1544
  $(document).on('click', 'input[name="' + _this.dismissElementorTemplateButtonName + '"]', function (e) {
1545
  $('input[name="' + _this.dismissElementorTemplateButtonName + '"]').attr('disabled', 'disabled');
1546
  var data = {
assets/js/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(s){var t={inputSel:"dgwt-wcas-options-toggle input[type=radio]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(t){var e=s('[name="'+t+'"]').closest("."+this.groupSel),a=s('[name="'+t+'"]:checked').val(),i="";this.hideAll(e),(a=a.replace("_","-")).length>0&&(i="wcas-opt-"+a),s("."+i).length>0&&s("."+i).fadeIn()},hideAll:function(s){s.find('tr[class*="wcas-opt-"]').hide()},registerListeners:function(){var t=this;s("."+t.inputSel).on("change",function(){t.reloadChoices(s(this).attr("name"))})},init:function(){var t=this,e=s("."+t.inputSel+":checked");e.length>0&&(t.registerListeners(),e.each(function(){t.reloadChoices(s(this).attr("name"))}))}},e={inputSel:"dgwt-wcas-options-cb-toggle input[type=checkbox]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(t){var e=t.is(":checked"),a=this.getGroupSelector(t);s("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide(),e&&s("."+a).each(function(){s(this).hasClass("js-dgwt-wcas-adv-settings")&&s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")||s(this).fadeIn()})},getGroupSelector(t){var e=t.closest(".dgwt-wcas-options-cb-toggle"),a="",i=e.attr("class").split(/\s+/);return s.each(i,function(s,t){-1!==t.indexOf("js-dgwt-wcas-cbtgroup-")&&(a=t)}),a},registerListeners:function(){var t=this;s(document).on("change","."+t.inputSel,function(){t.reloadChoices(s(this))})},refresh:function(){var t=this,e=s("."+t.inputSel);e.length>0&&e.each(function(){var e=s(this).is(":checked"),a=t.getGroupSelector(s(this));e?s("."+a).fadeIn():s("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide()})},init:function(){var t=this,e=s("."+t.inputSel);e.length>0&&(t.registerListeners(),e.each(function(){t.reloadChoices(s(this))}))}},a={inputSel:"js-dgwt-wcas-options-toggle-sibling input[type=checkbox]",toogleSibling:function(s){s.is(":checked")?s.closest("label").next().fadeIn():s.closest("label").next().hide()},registerListeners:function(){var t=this;s(document).on("change","."+t.inputSel,function(){t.toogleSibling(s(this))})},init:function(){var t=this,e=s("."+t.inputSel);e.length>0&&(t.registerListeners(),e.each(function(){t.toogleSibling(s(this))}))}},i={layoutSelect:"select[id*='search_layout']",overlayMobile:"input[id*='enable_mobile_overlay']",mobileBreakpoint:"input[id*='mobile_breakpoint']",searchIconColor:"input[id*='search_icon_color']",$select:null,$overlayMobileEl:null,$mobileBreakpointEl:null,$searchIconColorEl:null,setConditions:function(){var t=this.$select.find("option:selected").val(),e=s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled");switch(this.hideOption(this.$overlayMobileEl),this.hideOption(this.$mobileBreakpointEl),this.hideOption(this.$searchIconColorEl),s("input[id*='bg_search_icon_color']").closest("tr").show(),t){case"icon":e&&this.showOption(this.$searchIconColorEl);break;case"icon-flexible":e&&(this.showOption(this.$mobileBreakpointEl),this.showOption(this.$searchIconColorEl));break;default:e&&(this.showOption(this.$overlayMobileEl),s("input[id*='bg_search_icon_color']").closest("tr").hide(),this.$overlayMobileEl.is(":checked")&&this.showOption(this.$mobileBreakpointEl))}},hideOption:function(s){s.closest("tr").hide()},showOption:function(s){s.closest("tr").show()},registerListeners:function(){var s=this;s.$select.on("change",function(){s.setConditions()}),s.$overlayMobileEl.on("change",function(){s.setConditions()})},init:function(){var t=this,e=s(t.layoutSelect);e.length>0&&(t.$select=e,t.$overlayMobileEl=s(t.overlayMobile),t.$mobileBreakpointEl=s(t.mobileBreakpoint),t.$searchIconColorEl=s(t.searchIconColor),t.registerListeners(),setTimeout(function(){t.setConditions()},400))}},o={actionTriggerClass:"js-ajax-build-index",actionStopTriggerClass:"js-ajax-stop-build-index",indexingWrappoerClass:"js-dgwt-wcas-indexing-wrapper",getWrapper:function(){return s("."+this.indexingWrappoerClass).closest(".dgwt-wcas-settings-info")},registerListeners:function(){var t=this;s(document).on("click","."+t.actionTriggerClass,function(e){e.preventDefault();var a=s(this);a.attr("disabled","disabled"),s(".dgwt-wcas-settings-info").addClass("wcas-ajax-build-index-wait");var i=!!a.hasClass("js-ajax-build-index-emergency");i&&(s(".dgwt-wcas-indexing-header__title").text("[Emergency mode] Wait... Indexing in progress"),s(".dgwt-wcas-indexing-header__troubleshooting, .dgwt-wcas-indexing-header__actions, .js-dgwt-wcas-indexer-details").hide()),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index",emergency:i,_wpnonce:dgwt_wcas.nonces.build_index},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),t.heartbeat())},complete:function(){a.removeAttr("disabled"),s(".dgwt-wcas-settings-info").removeClass("wcas-ajax-build-index-wait"),i&&window.location.reload()}})}),s(document).on("click","."+t.actionStopTriggerClass,function(e){e.preventDefault();var a=s(this);a.attr("disabled","disabled"),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_stop_build_index",_wpnonce:dgwt_wcas.nonces.stop_build_index},success:function(s){void 0!==s&&s.success&&(t.getWrapper().html(s.data.html),t.heartbeat())},complete:function(){a.removeAttr("disabled")}})})},heartbeat:function(){var t=this;setTimeout(function(){s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index_heartbeat",_wpnonce:dgwt_wcas.nonces.build_index_heartbeat},success:function(e){void 0!==e&&e.success&&(t.getWrapper().html(e.data.html),e.data.loop?t.heartbeat():e.data.refresh_once.length>0&&(document.cookie.split(";").some(function(s){return 0===s.trim().indexOf("dgwt_wcas_refresh_once="+e.data.refresh_once)})||"none"!==s("#dgwt_wcas_troubleshooting-tab").css("display")||(document.cookie="dgwt_wcas_refresh_once="+e.data.refresh_once,location.reload())))}})},1e3)},detailsToggle:function(){var t;s(document).on("click",".js-dgwt-wcas-indexing-details-trigger",function(e){e.preventDefault();var a=s(".js-dgwt-wcas-indexer-details");a.hasClass("show")?(a.removeClass("show"),a.addClass("hide"),s(".js-dgwt-wcas-indexing__showd").addClass("show").removeClass("hide"),s(".js-dgwt-wcas-indexing__hided").addClass("hide").removeClass("show"),t=!1):(a.addClass("show"),a.removeClass("hide"),s(".js-dgwt-wcas-indexing__showd").addClass("hide").removeClass("show"),s(".js-dgwt-wcas-indexing__hided").addClass("show").removeClass("hide"),t=!0),s.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_index_details_toggle",display:t}})})},init:function(){this.registerListeners(),s("."+this.indexingWrappoerClass).length>0&&this.heartbeat(),this.detailsToggle()}},n={init:function(){var t=this;s(".dgwt-wcas-selectize").length>0&&s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:s(".dgwt-wcas-selectize").data("security")},success:function(s){void 0!==s&&void 0!==s.data&&t.initSelectize(s.data)}})},initSelectize:function(t){var e=s(".dgwt-wcas-selectize");e.length>0&&e.each(function(){var e=s(this),a=e.data("options"),i=t;if(a.length>0){a=JSON.parse('["'+decodeURI(a.replace(/&/g,'","').replace(/=/g,'","'))+'"]');var o="";a.forEach(function(s,t){if((t+1)%2==0){var e={value:s,label:o};i.push(e),o=""}o=s})}s(this).selectize({persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["value","label"],options:i,create:function(s){return{value:s.key,label:s.label}},load:function(t,a){if(!t.length)return a();s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:e.data("security")},error:function(){a()},success:function(s){a(s.data)}})}})})}},c={init:function(){var t=s(".js-dgwt-wcas-tooltip");t.length>0&&t.each(function(){var t=s(this)[0],e=s(this).data("tooltip-html-el"),a=s(this).data("tooltip-placement");if(e){new DgwtWcasTooltip(t,{title:s("."+e+" > .dgwt-wcas-tooltip-wrapper")[0],placement:a,trigger:"hover",html:!0})}})}},r={advClass:"js-dgwt-wcas-adv-settings",highlightClass:"dgwt-wcas-opt-highlight",transClass:"dgwt-wcas-opt-transition",init:function(){this.clickListener(),this.setStartingState()},clickListener:function(){var t=this;s(document).on("click",".js-dgwt-wcas-settings__advanced",function(){var e;e=s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")?"show":"hide",t.saveChoice(e)})},setStartingState:function(){var t=s("."+this.advClass);t.length>0&&(s(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled")?(t.show(),e.refresh()):t.hide())},saveChoice:function(t){s(".js-dgwt-wcas-settings__advanced").append('<span class="dgwt-wcas-adv-settings-saving">saving...</span>'),s.ajax({url:ajaxurl,data:{action:"dgwt_wcas_adv_settings",adv_settings_value:t}}).done(function(t){s(".dgwt-wcas-adv-settings-saving").remove()});var e=s(".js-dgwt-wcas-adv-settings-toggle");"show"===t&&(e.removeClass("woocommerce-input-toggle--disabled"),e.addClass("woocommerce-input-toggle--enabled")),"hide"===t&&(e.removeClass("woocommerce-input-toggle--enabled"),e.addClass("woocommerce-input-toggle--disabled")),this.toggleAdvancedOpt(t)},toggleAdvancedOpt:function(t){var a=this,o=s("."+a.advClass);o.length>0&&(o.addClass(a.highlightClass),o.addClass(a.transClass),"show"===t&&o.fadeIn(500,function(){setTimeout(function(){o.removeClass(a.highlightClass),setTimeout(function(){o.removeClass(a.transClass),e.refresh(),i.setConditions()},500)},500)}),"hide"===t&&setTimeout(function(){o.removeClass(a.transClass),o.fadeOut(500,function(){o.removeClass(a.highlightClass)})},500))}};window.DGWT_WCAS_SEARCH_PREVIEW={previewWrapper:{},searchWrapp:{},suggestionWrapp:{},searchInput:{},init:function(){this.previewWrapper=s(".js-dgwt-wcas-preview"),this.searchWrapp=s(".js-dgwt-wcas-search-wrapp"),this.suggestionWrapp=s(".js-dgwt-wcas-suggestions-wrapp"),this.detailsWrapp=s(".js-dgwt-wcas-details-wrapp"),this.searchInput=s(".js-dgwt-wcas-search-input"),this.onChangeHandler(),this.onColorHandler(),this.onTypeHandler(),this.disableSubmit(),this.noResultsHandler(),this.fixSizesInit()},isChecked:function(s){return!!(s.length>0&&s.is(":checked"))},isColor:function(s){return"string"==typeof s&&7===s.length&&"#"===s.charAt(0)},camelCase:function(s){for(var t=s.split("_"),e="",a=0;a<t.length;a++)e+=t[a].charAt(0).toUpperCase()+t[a].slice(1);return e},disableSubmit:function(){var t,e;s(".js-dgwt-wcas-preview-source").on("click",function(a){a.preventDefault();var i=a.pageX-100,o=a.pageY+10;void 0!==t&&(clearTimeout(t),e&&e.remove()),s("body").append('<div class="dgwt-wcas-click-alert">No interaction! This is only a preview.</div>'),(e=s(".dgwt-wcas-click-alert")).css({left:i,top:o}),s(".dgwt-wcas-preview-source").addClass("dgwt-wcas-preview-source-no-click"),t=setTimeout(function(){e.fadeOut(500,function(){s(this).remove(),s(".dgwt-wcas-preview-source").removeClass("dgwt-wcas-preview-source-no-click")})},2e3)})},noResultsHandler:function(){var t=this,e=".js-dgwt-wcas-preview .dgwt-wcas-suggestion:not(.js-dgwt-wcas-suggestion-nores)",a="input[id*='search_no_results_text']";s(document).on("focus",a,function(){s(e).addClass("dgwt-wcas-hide"),s(".js-dgwt-wcas-suggestion-nores").removeClass("dgwt-wcas-hide"),t.detailsWrapp.addClass("dgwt-wcas-hide"),t.suggestionWrapp.addClass("dgwt-wcas-preview-nores")}),s(document).on("blur",a,function(){s(e).removeClass("dgwt-wcas-hide"),s(".js-dgwt-wcas-suggestion-nores").addClass("dgwt-wcas-hide"),t.detailsWrapp.removeClass("dgwt-wcas-hide"),t.suggestionWrapp.removeClass("dgwt-wcas-preview-nores")})},onChangeHandler:function(){for(var t=this,e=["show_submit_button","max_form_width","show_product_image","show_product_sku","show_product_desc","show_product_price","show_matching_categories","show_categories_images","show_matching_tags","show_matching_brands","show_brands_images","show_matching_posts","show_matching_pages","show_grouped_results","suggestions_limit","show_details_box"],a=0;a<e.length;a++){var i="input[id='dgwt_wcas_settings\\["+e[a]+"\\]']",o="input[id^='dgwt_wcas_settings'][data-option-trigger='"+e[a]+"']",n=s(i),c=s(o);methodToCall="onChange"+t.camelCase(e[a]),"function"==typeof t[methodToCall]&&n.length>0?(t[methodToCall](n,n.val()),s(document).on("change",i,function(){methodToCall=s(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),methodToCall="onChange"+t.camelCase(methodToCall),"function"==typeof t[methodToCall]&&t[methodToCall](s(this),this.value)})):"function"==typeof t[methodToCall]&&c.length>0?(t[methodToCall](c,c.val()),s(document).on("change",o,function(){methodToCall=s(this).data("option-trigger"),methodToCall="onChange"+t.camelCase(methodToCall),"function"==typeof t[methodToCall]&&t[methodToCall](s(this),this.value)})):t[methodToCall]("","")}},onColorHandler:function(){for(var t=this,e=["search_icon_color","bg_input_color","text_input_color","border_input_color","bg_submit_color","text_submit_color","sug_bg_color","sug_hover_color","sug_text_color","sug_highlight_color","sug_border_color"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onColor"+t.camelCase(e[a]);t[n](o,o.val()),s(document).on("change",i,function(e){n=s(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onColor"+t.camelCase(n),t[n](s(this),this.value)})}},onColorChangeHandler:function(s,t){var e=s.attr("id").replace("]","").replace("dgwt_wcas_settings[","");this[e="onColor"+this.camelCase(e)](s,t)},onTypeHandler:function(){for(var t=this,e=["search_submit_text","search_placeholder","search_no_results_text","search_see_all_results_text"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=s(i),n="onType"+t.camelCase(e[a]);t[n](o,o.val()),s(document).on("input",i,function(e){n=s(e.target).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onType"+t.camelCase(n),t[n](s(e.target),this.value)})}},onChangeMaxFormWidth:function(t,e){e.length>0&&"0"!=e?(this.searchWrapp.css("max-width",e+"px"),this.suggestionWrapp.css("max-width",e+"px")):(this.searchWrapp.css("max-width","100%"),this.suggestionWrapp.css("max-width","100%")),this.onChangeShowDetailsBox(s("input[id*='show_details_box']"))},onChangeShowSubmitButton:function(t,e){var a=s(".js-dgwt-wcas-search-submit");if(this.isChecked(t)){this.searchWrapp.addClass("dgwt-wcas-has-submit"),this.searchWrapp.removeClass("dgwt-wcas-no-submit"),a.show(),s(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").hide();var i=s("input[id*='bg_submit_color']"),o=s("input[id*='text_submit_color']");this.onColorBgSubmitColor(i,i.val()),this.onColorTextSubmitColor(o,o.val())}else this.searchWrapp.addClass("dgwt-wcas-no-submit"),this.searchWrapp.removeClass("dgwt-wcas-has-submit"),a.hide(),s(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").show()},onChangeShowProductImage:function(t,e){var a=s(".js-dgwt-wcas-si"),i=s(".js-dgwt-wcas-content-wrapp");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-img"),s(".dgwt-wcas-suggestion-product > .dgwt-wcas-st").remove(),s(".dgwt-wcas-suggestion-product > .dgwt-wcas-sp").remove(),i.show(),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-img"),i.each(function(){s(this).closest(".dgwt-wcas-suggestion-product").append(s(this).html())}),i.hide(),a.hide())},onChangeShowProductSku:function(t,e){var a=s(".js-dgwt-wcas-sku");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-sku"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-sku"),a.hide())},onChangeShowProductDesc:function(t,e){var a=s(".js-dgwt-wcas-sd");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-desc"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-desc"),a.hide())},onChangeShowProductPrice:function(t,e){var a=s(".js-dgwt-wcas-sp");this.isChecked(t)?(this.suggestionWrapp.addClass("dgwt-wcas-has-price"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-price"),a.hide())},onChangeShowMatchingCategories:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-cat"),i=s(".dgwt-wcas-suggestion-cat");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowCategoriesImages:function(t,e){var a=s(".js-dgwt-wcas-suggestion-cat");this.isChecked(t)?a.addClass("dgwt-wcas-has-img"):a.removeClass("dgwt-wcas-has-img")},onChangeShowMatchingTags:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-tag"),i=s(".dgwt-wcas-suggestion-tag");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingBrands:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-brand"),i=s(".dgwt-wcas-suggestion-brand");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowBrandsImages:function(t,e){var a=s(".js-dgwt-wcas-suggestion-brand");this.isChecked(t)?a.addClass("dgwt-wcas-has-img"):a.removeClass("dgwt-wcas-has-img")},onChangeShowMatchingPosts:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-post"),i=s(".dgwt-wcas-suggestion-post");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingPages:function(t,e){var a=s(".dgwt-wcas-suggestion-headline-page"),i=s(".dgwt-wcas-suggestion-page");this.isChecked(t)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(s("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=s("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowGroupedResults:function(t,e){var a=s(".dgwt-wcas-st--direct-headline"),i=s(".dgwt-wcas-suggestion-headline");this.isChecked(t)?(a.addClass("dgwt-wcas-hidden"),this.suggestionWrapp.addClass("dgwt-wcas-has-headings"),s(".dgwt-wcas-suggestion-headline").show(),this.isChecked(s("input[data-option-trigger='show_matching_categories']"))||s(".dgwt-wcas-suggestion-headline-cat").hide(),this.isChecked(s("input[data-option-trigger='show_matching_tags']"))||s(".dgwt-wcas-suggestion-headline-tag").hide(),this.isChecked(s("input[data-option-trigger='show_matching_brands']"))||s(".dgwt-wcas-suggestion-headline-brand").hide(),this.isChecked(s("input[id*='show_matching_posts']"))||s(".dgwt-wcas-suggestion-headline-post").hide(),this.isChecked(s("input[id*='show_matching_pages']"))||s(".dgwt-wcas-suggestion-headline-page").hide()):(a.removeClass("dgwt-wcas-hidden"),i.hide(),this.suggestionWrapp.removeClass("dgwt-wcas-has-headings"))},onChangeSuggestionsLimit:function(t,e){setTimeout(function(){var a=0,i=7,o=s(".dgwt-wcas-suggestion-duplicated"),n=["brand","cat","tag","post","page","product"];e.length>0&&"0"!=e&&(i=Math.abs(e)),o.length>0&&o.remove();var c=[];for(a=0;a<n.length;a++){var r=s(".dgwt-wcas-suggestion-"+n[a]+":not(.js-dgwt-wcas-suggestion-hidden)");r.length>0&&c.push(r)}var d=c.length;if(c.length>0)for(var l=i-c.length,g=c.length-1;l>0;){var h=c[g].clone();h.addClass("dgwt-wcas-suggestion-duplicated"),h.removeClass("dgwt-wcas-suggestion-selected"),c[g].after(h),d++,--g<0&&(g=c.length-1),l--}d>i&&t.val(d)},10)},onChangeShowDetailsBox:function(t,e){var a=this;a.isChecked(t)?(a.detailsWrapp.show(),a.searchWrapp.addClass("dgwt-wcas-is-detail-box"),a.previewWrapper.addClass("dgwt-wcas-is-details"),a.previewWrapper.addClass("dgwt-wcas-details-right"),setTimeout(function(){if(s(".dgwt-wcas-suggestion-product:not(.dgwt-wcas-suggestion-duplicated)").addClass("dgwt-wcas-suggestion-selected"),a.searchWrapp.width()>=550){a.previewWrapper.addClass("dgwt-wcas-full-width");var t=getComputedStyle(a.searchWrapp[0]).width;(t=Math.round(parseFloat(t.replace("px",""))))%2==0?(a.suggestionWrapp.css("width",Math.round(t/2)),a.detailsWrapp.css("width",Math.round(t/2))):(a.suggestionWrapp.css("width",Math.floor(t/2)),a.detailsWrapp.css("width",Math.ceil(t/2)))}else a.suggestionWrapp.width(a.searchWrapp.width())},10)):(a.detailsWrapp.hide(),a.searchWrapp.removeClass("dgwt-wcas-is-detail-box"),a.previewWrapper.removeClass("dgwt-wcas-is-details"),a.previewWrapper.removeClass("dgwt-wcas-details-right"),a.previewWrapper.removeClass("dgwt-wcas-full-width"),s(".dgwt-wcas-suggestion-product").removeClass("dgwt-wcas-suggestion-selected"),a.suggestionWrapp.css("width",""),a.detailsWrapp.css("width",""))},onColorSearchIconColor:function(s,t){},onColorBgInputColor:function(s,t){this.isColor(t)?this.searchInput.css("background-color",t):this.searchInput.css("background-color","")},onColorTextInputColor:function(t,e){var a="dgwt-wcas-preview-placeholder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-search-input::placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-webkit-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-ms-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-ico-magnifier path {fill:"+e+"}",i+="</style>",s("head").append(i),this.searchInput.css("color",e)}else{this.searchInput.css("color","");var o=s("."+a);o.length>0&&o.remove()}},onColorBorderInputColor:function(s,t){this.isColor(t)?this.searchInput.css("border-color",t):this.searchInput.css("border-color","")},onColorBgSubmitColor:function(t,e){if(this.isChecked(s("input[id*='show_submit_button']"))&&this.isColor(e)){var a='<style class="dgwt-wcas-preview-submit-style">';a+=".dgwt-wcas-search-submit::before{border-color: transparent "+e+"!important;}",a+=".dgwt-wcas-search-submit:hover::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit:focus::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit{background-color: "+e+"!important;}",a+=".dgwt-wcas-om-bar .dgwt-wcas-om-return{background-color: "+e+"!important;}",a+="</style>",s("head").append(a)}else{var i=s(".dgwt-wcas-preview-submit-style");i.length>0&&i.remove()}},onColorTextSubmitColor:function(t,e){this.isChecked(s("input[id*='show_submit_button']"))&&this.isColor(e)?(s(".js-dgwt-wcas-search-submit").css("color",e),s(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",e)):(this.searchInput.css("background-color",""),s(".js-dgwt-wcas-search-submit").css("color",""),s(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",""))},onColorSugBgColor:function(t,e){var a="dgwt-wcas-preview-sugbgcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp",i+="{background-color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugHoverColor:function(t,e){this.isColor(e)?setTimeout(function(){s(".dgwt-wcas-suggestion-selected").css("background-color",e)},50):s(".dgwt-wcas-suggestion-selected").css("background-color","")},onColorSugTextColor:function(t,e){var a="dgwt-wcas-preview-sugtextcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp *,",i+=".dgwt-wcas-details-wrapp *,",i+=".dgwt-wcas-sd,",i+=".dgwt-wcas-suggestion *",i+="{color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugHighlightColor:function(t,e){var a="dgwt-wcas-preview-sughighlight-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-st strong,",i+=".dgwt-wcas-sd strong",i+="{color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onColorSugBorderColor:function(t,e){var a="dgwt-wcas-preview-sugborder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp,",i+=".dgwt-wcas-suggestion,",i+=".dgwt-wcas-datails-title,",i+=".dgwt-wcas-details-more-products",i+="{border-color: "+e+"!important;}",i+="</style>",s("head").append(i)}else{var o=s("."+a);o.length>0&&o.remove()}},onTypeSearchSubmitText:function(t,e){var a=s(".js-dgwt-wcas-search-submit-l"),i=s(".js-dgwt-wcas-search-submit-m");e.length>0?(a.text(e),a.show(),i.hide()):(a.text(""),a.hide(),i.show())},onTypeSearchPlaceholder:function(s,t){0==t.length&&(t=dgwt_wcas.labels.search_placeholder),this.searchInput.attr("placeholder",t)},onTypeSearchNoResultsText:function(t,e){0==e.length&&(e=dgwt_wcas.labels.no_results),s(".js-dgwt-wcas-suggestion-nores span").text(e)},onTypeSearchSeeAllResultsText:function(t,e){0==e.length&&(e=dgwt_wcas.labels.show_more),s(".js-dgwt-wcas-st-more-label").text(e)},fixSizesInit:function(){var t=this;s(document).on("click","#dgwt_wcas_autocomplete-tab",function(){t.onChangeShowDetailsBox(s("input[id*='show_details_box']"))})}};var d={settingsTab:"#dgwt_wcas_troubleshooting-tab",noIssuesClass:".js-dgwt-wcas-troubleshooting-no-issues",counterClass:".js-dgwt-wcas-troubleshooting-count",issuesListClass:".js-dgwt-wcas-troubleshooting-issues",progressBar:".dgwt-wcas-troubleshooting-wrapper .progress_bar",progressBarInner:".dgwt-wcas-troubleshooting-wrapper .progress-bar-inner",resetButtonName:"dgwt-wcas-reset-async-tests",fixOutofstockButtonName:"dgwt-wcas-fix-out-of-stock-relationships",dismissElementorTemplateButtonName:"dgwt-wcas-dismiss-elementor-template",init:function(){var t=this;if(void 0===dgwt_wcas.troubleshooting)return;const e=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended;e>0&&(s(t.counterClass).text(e),s(t.settingsTab).addClass("enabled")),dgwt_wcas.troubleshooting.tests.results_async.length>0&&s.each(dgwt_wcas.troubleshooting.tests.results_async,function(){t.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.direct.length>0&&s.each(dgwt_wcas.troubleshooting.tests.direct,function(){t.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.async.length>0&&t.maybeRunNextAsyncTest(),s(document).on("click",'input[name="'+t.resetButtonName+'"]',function(e){s('input[name="'+t.resetButtonName+'"]').attr("disabled","disabled");var a={action:"dgwt_wcas_troubleshooting_reset_async_tests",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_reset_async_tests};return s.post(ajaxurl,a,function(){location.reload()}),!1}),s(document).on("click",'input[name="'+t.fixOutofstockButtonName+'"]',function(e){s('input[name="'+t.fixOutofstockButtonName+'"]').attr("disabled","disabled").next().addClass("loading");var a={action:"dgwt_wcas_troubleshooting_fix_outofstock",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_fix_outofstock};return s.post(ajaxurl,a,function(){location.reload()}),!1}),s(document).on("click",'input[name="'+t.dismissElementorTemplateButtonName+'"]',function(e){s('input[name="'+t.dismissElementorTemplateButtonName+'"]').attr("disabled","disabled");var a={action:"dgwt_wcas_troubleshooting_dismiss_elementor_template",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_dismiss_elementor_template};return s.post(ajaxurl,a,function(){location.reload()}),!1})},appendIssue:function(t,e){var a,i=wp.template("dgwt-wcas-troubleshooting-issue"),o=s(this.issuesListClass+"-"+t.status);"good"!==t.status&&(s(this.noIssuesClass).hide(),e&&dgwt_wcas.troubleshooting.tests.issues[t.status]++,(a=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended)>0&&(s(this.counterClass).text(a),s(this.settingsTab).addClass("enabled")),s(o).append(i(t)))},maybeRunNextAsyncTest:function(){var t=this;dgwt_wcas.troubleshooting.tests.async.length>0&&s.each(dgwt_wcas.troubleshooting.tests.async,function(){var e={action:"dgwt_wcas_troubleshooting_test",test:this.test,_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_async_test};return!!this.completed||(this.completed=!0,s(t.progressBar).show(),s.post(ajaxurl,e,function(s){s.success&&t.appendIssue(s.data,!0),t.maybeRunNextAsyncTest()}),!1)}),t.recalculateProgression()},recalculateProgression:function(){var t=this,e=dgwt_wcas.troubleshooting.tests.async.length,a=0;s.each(dgwt_wcas.troubleshooting.tests.async,function(){this.completed&&a++});var i=Math.ceil(a/e*100);s(t.progressBarInner).css("width",i+"%"),100===i&&setTimeout(function(){s(t.progressBar).slideUp()},2e3)}},l={moveOptionClass:".js-dgwt-wcas-move-option",init:function(){var t=s(this.moveOptionClass);t.length>0&&s.each(t,function(t,e){var a=s("#"+s(e).data("move-dest").replace(/(:|\.|\[|\])/g,"\\$1"));a.length>0&&(s(e).closest("tr").hasClass("dgwt-wcas-premium-only")&&s(e).addClass("dgwt-wcas-premium-only"),s(e).clone().appendTo(a.closest("td fieldset"))),s(e).closest("tr").remove()})}},g=function(){if("undefined"!=typeof Vue){Vue.component("dgwt-wcas-rule",{template:"#dgwt-wcas-settings-filters-rules-rule",components:{Selectize:Selectize},props:["nonce","rule","rules","index"],data:()=>({isSelectActive:!0}),computed:{ruleValue(s){return this.rule.group}},watch:{rule:{handler:function(){this.$emit("update:rule",this.index)},deep:!0},ruleValue(){var s=this;this.$emit("change:group",this.index),this.isSelectActive=!1,setTimeout(function(){s.isSelectActive=!0},0)}},methods:{deleteRule(){this.$emit("delete:rule",this.index)},getSelectizeSettings(t){var e=void 0===dgwt_wcas_filters_rules_selected_options[t]?[]:dgwt_wcas_filters_rules_selected_options[t];return function({nonce:t,options:e,type:a}){return{persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["label"],options:e,preload:!0,create:function(s){return{value:s.key,label:s.label}},load:function(e,i){s.ajax({url:ajaxurl,method:"POST",data:{action:"dgwt_wcas_settings_search_terms",query:e,type:a,_wpnonce:t},error:function(){i()},success:function(s){i(s.data)}})}}}({nonce:this.nonce,type:t,options:e})}}});new Vue({el:"#dgwt-wcas-settings-filters-rules",components:{Selectize:Selectize},data:()=>({rules:[]}),mounted(){try{const t=JSON.parse(this.$refs["dgwt-wcas-settings-filters-rules-ref"].value);s.each(t,function(s,e){t[s].key=Math.random()}),this.rules=t}catch(s){}this.updateInput()},methods:{addRule(){this.rules.push({group:"",values:[],key:Math.random()}),this.updateInput()},changeGroup(s){this.rules[s].values=[],this.updateInput()},deleteRule(s){this.rules=this.rules.filter(function(t,e){return e!==s}),this.updateInput()},updateInput(){const s=JSON.parse(JSON.stringify(this.rules));this.$refs["dgwt-wcas-settings-filters-rules-ref"].value=JSON.stringify(s.map(function(s){return s.key,delete s.key,s}))}}})}};s(document).ready(function(){var h,u;(h=s(".js-dgwt-wcas-settings-margin-nob")).length>0&&h.each(function(){var t=s(this).find("td .dgwt-wcas-fieldset");if(t.length>0){var e=s(this).prev(".js-dgwt-wcas-settings-margin");if(e.length>0){var a=s(this).attr("class").split(/\s+/),i="";s.each(a,function(s,t){-1!==t.indexOf("js-dgwt-wcas-cbtgroup-")&&(i=t)});var o=t.clone(!0,!0);o.addClass("dgwt-wcas-settings-margin-nob"),i&&o.addClass(i),o.appendTo(e.find("td")),s(this).remove()}}}),t.init(),e.init(),i.init(),(u=s(".js-dgwt-wcas-sgs-autocolspan")).length>0&&u.find("td").attr("colspan",2),o.init(),n.init(),c.init(),r.init(),d.init(),l.init(),a.init(),g(),window.DGWT_WCAS_SEARCH_PREVIEW.init()})}(jQuery);
1
+ !function(t){var s={inputSel:"dgwt-wcas-options-toggle input[type=radio]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(s){var e=t('[name="'+s+'"]').closest("."+this.groupSel),a=t('[name="'+s+'"]:checked').val(),i="";this.hideAll(e),(a=a.replace("_","-")).length>0&&(i="wcas-opt-"+a),t("."+i).length>0&&t("."+i).fadeIn()},hideAll:function(t){t.find('tr[class*="wcas-opt-"]').hide()},registerListeners:function(){var s=this;t("."+s.inputSel).on("change",function(){s.reloadChoices(t(this).attr("name"))})},init:function(){var s=this,e=t("."+s.inputSel+":checked");e.length>0&&(s.registerListeners(),e.each(function(){s.reloadChoices(t(this).attr("name"))}))}},e={inputSel:"dgwt-wcas-options-cb-toggle input[type=checkbox]",groupSel:"dgwt_wcas_settings-group",reloadChoices:function(s){var e=s.is(":checked"),a=this.getGroupSelector(s);t("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide(),e&&t("."+a).each(function(){t(this).hasClass("js-dgwt-wcas-adv-settings")&&t(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")||t(this).fadeIn()})},getGroupSelector(s){var e=s.closest(".dgwt-wcas-options-cb-toggle"),a="",i=e.attr("class").split(/\s+/);return t.each(i,function(t,s){-1!==s.indexOf("js-dgwt-wcas-cbtgroup-")&&(a=s)}),a},registerListeners:function(){var s=this;t(document).on("change","."+s.inputSel,function(){s.reloadChoices(t(this))})},refresh:function(){var s=this,e=t("."+s.inputSel);e.length>0&&e.each(function(){var e=t(this).is(":checked"),a=s.getGroupSelector(t(this));e?t("."+a).fadeIn():t("."+a+":not(.dgwt-wcas-options-cb-toggle)").hide()})},init:function(){var s=this,e=t("."+s.inputSel);e.length>0&&(s.registerListeners(),e.each(function(){s.reloadChoices(t(this))}))}},a={inputSel:"js-dgwt-wcas-options-toggle-sibling input[type=checkbox]",toogleSibling:function(t){t.is(":checked")?t.closest("label").next().fadeIn():t.closest("label").next().hide()},registerListeners:function(){var s=this;t(document).on("change","."+s.inputSel,function(){s.toogleSibling(t(this))})},init:function(){var s=this,e=t("."+s.inputSel);e.length>0&&(s.registerListeners(),e.each(function(){s.toogleSibling(t(this))}))}},i={layoutSelect:"select[id*='search_layout']",overlayMobile:"input[id*='enable_mobile_overlay']",mobileBreakpoint:"input[id*='mobile_breakpoint']",searchIconColor:"input[id*='search_icon_color']",$select:null,$overlayMobileEl:null,$mobileBreakpointEl:null,$searchIconColorEl:null,setConditions:function(){var s=this.$select.find("option:selected").val(),e=t(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled");switch(this.hideOption(this.$overlayMobileEl),this.hideOption(this.$mobileBreakpointEl),this.hideOption(this.$searchIconColorEl),t("input[id*='bg_search_icon_color']").closest("tr").show(),s){case"icon":e&&this.showOption(this.$searchIconColorEl);break;case"icon-flexible":e&&(this.showOption(this.$mobileBreakpointEl),this.showOption(this.$searchIconColorEl));break;default:e&&(this.showOption(this.$overlayMobileEl),t("input[id*='bg_search_icon_color']").closest("tr").hide(),this.$overlayMobileEl.is(":checked")&&this.showOption(this.$mobileBreakpointEl))}},hideOption:function(t){t.closest("tr").hide()},showOption:function(t){t.closest("tr").show()},registerListeners:function(){var t=this;t.$select.on("change",function(){t.setConditions()}),t.$overlayMobileEl.on("change",function(){t.setConditions()})},init:function(){var s=this,e=t(s.layoutSelect);e.length>0&&(s.$select=e,s.$overlayMobileEl=t(s.overlayMobile),s.$mobileBreakpointEl=t(s.mobileBreakpoint),s.$searchIconColorEl=t(s.searchIconColor),s.registerListeners(),setTimeout(function(){s.setConditions()},400))}},o={actionTriggerClass:"js-ajax-build-index",actionStopTriggerClass:"js-ajax-stop-build-index",indexingWrappoerClass:"js-dgwt-wcas-indexing-wrapper",indexerTabProgressClass:"js-dgwt-wcas-indexer-tab-progress",indexerTabErrorClass:"js-dgwt-wcas-indexer-tab-error",getWrapper:function(){return t("."+this.indexingWrappoerClass).closest(".dgwt-wcas-settings-info")},registerListeners:function(){var s=this;t(document).on("click","."+s.actionTriggerClass,function(e){e.preventDefault();var a=t(this);a.attr("disabled","disabled"),t(".dgwt-wcas-settings-info").addClass("wcas-ajax-build-index-wait"),t("."+s.indexerTabErrorClass).removeClass("active"),t("."+s.indexerTabProgressClass).addClass("active");var i=!!a.hasClass("js-ajax-build-index-emergency");i&&(t(".dgwt-wcas-indexing-header__title").text("[Emergency mode] Wait... Indexing in progress"),t(".dgwt-wcas-indexing-header__troubleshooting, .dgwt-wcas-indexing-header__actions, .js-dgwt-wcas-indexer-details").hide()),t.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index",emergency:i,_wpnonce:dgwt_wcas.nonces.build_index},success:function(t){void 0!==t&&t.success&&(s.getWrapper().html(t.data.html),s.heartbeat())},complete:function(){a.removeAttr("disabled"),t(".dgwt-wcas-settings-info").removeClass("wcas-ajax-build-index-wait"),i&&window.location.reload()}})}),t(document).on("click","."+s.actionStopTriggerClass,function(e){e.preventDefault();var a=t(this);a.attr("disabled","disabled"),t.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_stop_build_index",_wpnonce:dgwt_wcas.nonces.stop_build_index},success:function(t){void 0!==t&&t.success&&(s.getWrapper().html(t.data.html),s.heartbeat())},complete:function(){a.removeAttr("disabled")}})})},heartbeat:function(){var s=this;setTimeout(function(){t.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_build_index_heartbeat",_wpnonce:dgwt_wcas.nonces.build_index_heartbeat},success:function(e){void 0!==e&&e.success&&(s.getWrapper().html(e.data.html),e.data.loop?s.heartbeat():(t("."+s.indexerTabProgressClass).removeClass("active"),"error"===e.data.status&&t("."+s.indexerTabErrorClass).addClass("active")),!e.data.loop&&e.data.refresh_once.length>0&&(document.cookie.split(";").some(function(t){return 0===t.trim().indexOf("dgwt_wcas_refresh_once="+e.data.refresh_once)})||"none"!==t("#dgwt_wcas_troubleshooting-tab").css("display")||(document.cookie="dgwt_wcas_refresh_once="+e.data.refresh_once,location.reload())))}})},1e3)},detailsToggle:function(){var s;t(document).on("click",".js-dgwt-wcas-indexing-details-trigger",function(e){e.preventDefault();var a=t(".js-dgwt-wcas-indexer-details");a.hasClass("show")?(a.removeClass("show"),a.addClass("hide"),t(".js-dgwt-wcas-indexing__showd").addClass("show").removeClass("hide"),t(".js-dgwt-wcas-indexing__hided").addClass("hide").removeClass("show"),s=!1):(a.addClass("show"),a.removeClass("hide"),t(".js-dgwt-wcas-indexing__showd").addClass("hide").removeClass("show"),t(".js-dgwt-wcas-indexing__hided").addClass("show").removeClass("hide"),s=!0),t.ajax({url:ajaxurl,type:"post",data:{action:"dgwt_wcas_index_details_toggle",display:s}})})},init:function(){this.registerListeners(),t("."+this.indexingWrappoerClass).length>0&&this.heartbeat(),this.detailsToggle()}},n={init:function(){var s=this;t(".dgwt-wcas-selectize").length>0&&t.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:t(".dgwt-wcas-selectize").data("security")},success:function(t){void 0!==t&&void 0!==t.data&&s.initSelectize(t.data)}})},initSelectize:function(s){var e=t(".dgwt-wcas-selectize");e.length>0&&e.each(function(){var e=t(this),a=e.data("options"),i=s;if(a.length>0){a=JSON.parse('["'+decodeURI(a.replace(/&/g,'","').replace(/=/g,'","'))+'"]');var o="";a.forEach(function(t,s){if((s+1)%2==0){var e={value:t,label:o};i.push(e),o=""}o=t})}t(this).selectize({persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["value","label"],options:i,create:function(t){return{value:t.key,label:t.label}},load:function(s,a){if(!s.length)return a();t.ajax({url:ajaxurl,data:{action:"dgwt_wcas_settings_list_custom_fields",_wpnonce:e.data("security")},error:function(){a()},success:function(t){a(t.data)}})}})})}},r={init:function(){var s=t(".js-dgwt-wcas-tooltip");s.length>0&&s.each(function(){var s=t(this)[0],e=t(this).data("tooltip-html-el"),a=t(this).data("tooltip-placement");if(e){new DgwtWcasTooltip(s,{title:t("."+e+" > .dgwt-wcas-tooltip-wrapper")[0],placement:a,trigger:"hover",html:!0})}})}},c={advClass:"js-dgwt-wcas-adv-settings",highlightClass:"dgwt-wcas-opt-highlight",transClass:"dgwt-wcas-opt-transition",init:function(){this.clickListener(),this.setStartingState()},clickListener:function(){var s=this;t(document).on("click",".js-dgwt-wcas-settings__advanced",function(){var e;e=t(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--disabled")?"show":"hide",s.saveChoice(e)})},setStartingState:function(){var s=t("."+this.advClass);s.length>0&&(t(".js-dgwt-wcas-adv-settings-toggle").hasClass("woocommerce-input-toggle--enabled")?(s.show(),e.refresh()):s.hide())},saveChoice:function(s){t(".js-dgwt-wcas-settings__advanced").append('<span class="dgwt-wcas-adv-settings-saving">saving...</span>'),t.ajax({url:ajaxurl,data:{action:"dgwt_wcas_adv_settings",adv_settings_value:s}}).done(function(s){t(".dgwt-wcas-adv-settings-saving").remove()});var e=t(".js-dgwt-wcas-adv-settings-toggle");"show"===s&&(e.removeClass("woocommerce-input-toggle--disabled"),e.addClass("woocommerce-input-toggle--enabled")),"hide"===s&&(e.removeClass("woocommerce-input-toggle--enabled"),e.addClass("woocommerce-input-toggle--disabled")),this.toggleAdvancedOpt(s)},toggleAdvancedOpt:function(s){var a=this,o=t("."+a.advClass);o.length>0&&(o.addClass(a.highlightClass),o.addClass(a.transClass),"show"===s&&o.fadeIn(500,function(){setTimeout(function(){o.removeClass(a.highlightClass),setTimeout(function(){o.removeClass(a.transClass),e.refresh(),i.setConditions()},500)},500)}),"hide"===s&&setTimeout(function(){o.removeClass(a.transClass),o.fadeOut(500,function(){o.removeClass(a.highlightClass)})},500))}};window.DGWT_WCAS_SEARCH_PREVIEW={previewWrapper:{},searchWrapp:{},suggestionWrapp:{},searchInput:{},init:function(){this.previewWrapper=t(".js-dgwt-wcas-preview"),this.searchWrapp=t(".js-dgwt-wcas-search-wrapp"),this.suggestionWrapp=t(".js-dgwt-wcas-suggestions-wrapp"),this.detailsWrapp=t(".js-dgwt-wcas-details-wrapp"),this.searchInput=t(".js-dgwt-wcas-search-input"),this.onChangeHandler(),this.onColorHandler(),this.onTypeHandler(),this.disableSubmit(),this.noResultsHandler(),this.fixSizesInit()},isChecked:function(t){return!!(t.length>0&&t.is(":checked"))},isColor:function(t){return"string"==typeof t&&7===t.length&&"#"===t.charAt(0)},camelCase:function(t){for(var s=t.split("_"),e="",a=0;a<s.length;a++)e+=s[a].charAt(0).toUpperCase()+s[a].slice(1);return e},disableSubmit:function(){var s,e;t(".js-dgwt-wcas-preview-source").on("click",function(a){a.preventDefault();var i=a.pageX-100,o=a.pageY+10;void 0!==s&&(clearTimeout(s),e&&e.remove()),t("body").append('<div class="dgwt-wcas-click-alert">No interaction! This is only a preview.</div>'),(e=t(".dgwt-wcas-click-alert")).css({left:i,top:o}),t(".dgwt-wcas-preview-source").addClass("dgwt-wcas-preview-source-no-click"),s=setTimeout(function(){e.fadeOut(500,function(){t(this).remove(),t(".dgwt-wcas-preview-source").removeClass("dgwt-wcas-preview-source-no-click")})},2e3)})},noResultsHandler:function(){var s=this,e=".js-dgwt-wcas-preview .dgwt-wcas-suggestion:not(.js-dgwt-wcas-suggestion-nores)",a="input[id*='search_no_results_text']";t(document).on("focus",a,function(){t(e).addClass("dgwt-wcas-hide"),t(".js-dgwt-wcas-suggestion-nores").removeClass("dgwt-wcas-hide"),s.detailsWrapp.addClass("dgwt-wcas-hide"),s.suggestionWrapp.addClass("dgwt-wcas-preview-nores")}),t(document).on("blur",a,function(){t(e).removeClass("dgwt-wcas-hide"),t(".js-dgwt-wcas-suggestion-nores").addClass("dgwt-wcas-hide"),s.detailsWrapp.removeClass("dgwt-wcas-hide"),s.suggestionWrapp.removeClass("dgwt-wcas-preview-nores")})},onChangeHandler:function(){for(var s=this,e=["show_submit_button","max_form_width","show_product_image","show_product_sku","show_product_desc","show_product_price","show_matching_categories","show_categories_images","show_matching_tags","show_matching_brands","show_brands_images","show_matching_posts","show_matching_pages","show_grouped_results","suggestions_limit","show_details_box"],a=0;a<e.length;a++){var i="input[id='dgwt_wcas_settings\\["+e[a]+"\\]']",o="input[id^='dgwt_wcas_settings'][data-option-trigger='"+e[a]+"']",n=t(i),r=t(o);methodToCall="onChange"+s.camelCase(e[a]),"function"==typeof s[methodToCall]&&n.length>0?(s[methodToCall](n,n.val()),t(document).on("change",i,function(){methodToCall=t(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),methodToCall="onChange"+s.camelCase(methodToCall),"function"==typeof s[methodToCall]&&s[methodToCall](t(this),this.value)})):"function"==typeof s[methodToCall]&&r.length>0?(s[methodToCall](r,r.val()),t(document).on("change",o,function(){methodToCall=t(this).data("option-trigger"),methodToCall="onChange"+s.camelCase(methodToCall),"function"==typeof s[methodToCall]&&s[methodToCall](t(this),this.value)})):s[methodToCall]("","")}},onColorHandler:function(){for(var s=this,e=["search_icon_color","bg_input_color","text_input_color","border_input_color","bg_submit_color","text_submit_color","sug_bg_color","sug_hover_color","sug_text_color","sug_highlight_color","sug_border_color"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=t(i),n="onColor"+s.camelCase(e[a]);s[n](o,o.val()),t(document).on("change",i,function(e){n=t(this).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onColor"+s.camelCase(n),s[n](t(this),this.value)})}},onColorChangeHandler:function(t,s){var e=t.attr("id").replace("]","").replace("dgwt_wcas_settings[","");this[e="onColor"+this.camelCase(e)](t,s)},onTypeHandler:function(){for(var s=this,e=["search_submit_text","search_placeholder","search_no_results_text","search_see_all_results_text"],a=0;a<e.length;a++){var i="input[id*='"+e[a]+"']",o=t(i),n="onType"+s.camelCase(e[a]);s[n](o,o.val()),t(document).on("input",i,function(e){n=t(e.target).attr("id").replace("]","").replace("dgwt_wcas_settings[",""),n="onType"+s.camelCase(n),s[n](t(e.target),this.value)})}},onChangeMaxFormWidth:function(s,e){e.length>0&&"0"!=e?(this.searchWrapp.css("max-width",e+"px"),this.suggestionWrapp.css("max-width",e+"px")):(this.searchWrapp.css("max-width","100%"),this.suggestionWrapp.css("max-width","100%")),this.onChangeShowDetailsBox(t("input[id*='show_details_box']"))},onChangeShowSubmitButton:function(s,e){var a=t(".js-dgwt-wcas-search-submit");if(this.isChecked(s)){this.searchWrapp.addClass("dgwt-wcas-has-submit"),this.searchWrapp.removeClass("dgwt-wcas-no-submit"),a.show(),t(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").hide();var i=t("input[id*='bg_submit_color']"),o=t("input[id*='text_submit_color']");this.onColorBgSubmitColor(i,i.val()),this.onColorTextSubmitColor(o,o.val())}else this.searchWrapp.addClass("dgwt-wcas-no-submit"),this.searchWrapp.removeClass("dgwt-wcas-has-submit"),a.hide(),t(".dgwt-wcas-sf-wrapp > .dgwt-wcas-ico-magnifier").show()},onChangeShowProductImage:function(s,e){var a=t(".js-dgwt-wcas-si"),i=t(".js-dgwt-wcas-content-wrapp");this.isChecked(s)?(this.suggestionWrapp.addClass("dgwt-wcas-has-img"),t(".dgwt-wcas-suggestion-product > .dgwt-wcas-st").remove(),t(".dgwt-wcas-suggestion-product > .dgwt-wcas-sp").remove(),i.show(),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-img"),i.each(function(){t(this).closest(".dgwt-wcas-suggestion-product").append(t(this).html())}),i.hide(),a.hide())},onChangeShowProductSku:function(s,e){var a=t(".js-dgwt-wcas-sku");this.isChecked(s)?(this.suggestionWrapp.addClass("dgwt-wcas-has-sku"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-sku"),a.hide())},onChangeShowProductDesc:function(s,e){var a=t(".js-dgwt-wcas-sd");this.isChecked(s)?(this.suggestionWrapp.addClass("dgwt-wcas-has-desc"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-desc"),a.hide())},onChangeShowProductPrice:function(s,e){var a=t(".js-dgwt-wcas-sp");this.isChecked(s)?(this.suggestionWrapp.addClass("dgwt-wcas-has-price"),a.show()):(this.suggestionWrapp.removeClass("dgwt-wcas-has-price"),a.hide())},onChangeShowMatchingCategories:function(s,e){var a=t(".dgwt-wcas-suggestion-headline-cat"),i=t(".dgwt-wcas-suggestion-cat");this.isChecked(s)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(t("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=t("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowCategoriesImages:function(s,e){var a=t(".js-dgwt-wcas-suggestion-cat");this.isChecked(s)?a.addClass("dgwt-wcas-has-img"):a.removeClass("dgwt-wcas-has-img")},onChangeShowMatchingTags:function(s,e){var a=t(".dgwt-wcas-suggestion-headline-tag"),i=t(".dgwt-wcas-suggestion-tag");this.isChecked(s)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(t("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=t("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingBrands:function(s,e){var a=t(".dgwt-wcas-suggestion-headline-brand"),i=t(".dgwt-wcas-suggestion-brand");this.isChecked(s)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(t("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=t("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowBrandsImages:function(s,e){var a=t(".js-dgwt-wcas-suggestion-brand");this.isChecked(s)?a.addClass("dgwt-wcas-has-img"):a.removeClass("dgwt-wcas-has-img")},onChangeShowMatchingPosts:function(s,e){var a=t(".dgwt-wcas-suggestion-headline-post"),i=t(".dgwt-wcas-suggestion-post");this.isChecked(s)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(t("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=t("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowMatchingPages:function(s,e){var a=t(".dgwt-wcas-suggestion-headline-page"),i=t(".dgwt-wcas-suggestion-page");this.isChecked(s)?(a.show(),i.show(),i.removeClass("js-dgwt-wcas-suggestion-hidden"),this.onChangeShowGroupedResults(t("input[id*='show_grouped_results']"))):(a.hide(),i.hide(),i.addClass("js-dgwt-wcas-suggestion-hidden"));var o=t("input[id*='suggestions_limit']");this.onChangeSuggestionsLimit(o,o.val())},onChangeShowGroupedResults:function(s,e){var a=t(".dgwt-wcas-st--direct-headline"),i=t(".dgwt-wcas-suggestion-headline");this.isChecked(s)?(a.addClass("dgwt-wcas-hidden"),this.suggestionWrapp.addClass("dgwt-wcas-has-headings"),t(".dgwt-wcas-suggestion-headline").show(),this.isChecked(t("input[data-option-trigger='show_matching_categories']"))||t(".dgwt-wcas-suggestion-headline-cat").hide(),this.isChecked(t("input[data-option-trigger='show_matching_tags']"))||t(".dgwt-wcas-suggestion-headline-tag").hide(),this.isChecked(t("input[data-option-trigger='show_matching_brands']"))||t(".dgwt-wcas-suggestion-headline-brand").hide(),this.isChecked(t("input[id*='show_matching_posts']"))||t(".dgwt-wcas-suggestion-headline-post").hide(),this.isChecked(t("input[id*='show_matching_pages']"))||t(".dgwt-wcas-suggestion-headline-page").hide()):(a.removeClass("dgwt-wcas-hidden"),i.hide(),this.suggestionWrapp.removeClass("dgwt-wcas-has-headings"))},onChangeSuggestionsLimit:function(s,e){setTimeout(function(){var a=0,i=7,o=t(".dgwt-wcas-suggestion-duplicated"),n=["brand","cat","tag","post","page","product"];e.length>0&&"0"!=e&&(i=Math.abs(e)),o.length>0&&o.remove();var r=[];for(a=0;a<n.length;a++){var c=t(".dgwt-wcas-suggestion-"+n[a]+":not(.js-dgwt-wcas-suggestion-hidden)");c.length>0&&r.push(c)}var d=r.length;if(r.length>0)for(var l=i-r.length,g=r.length-1;l>0;){var h=r[g].clone();h.addClass("dgwt-wcas-suggestion-duplicated"),h.removeClass("dgwt-wcas-suggestion-selected"),r[g].after(h),d++,--g<0&&(g=r.length-1),l--}d>i&&s.val(d)},10)},onChangeShowDetailsBox:function(s,e){var a=this;a.isChecked(s)?(a.detailsWrapp.show(),a.searchWrapp.addClass("dgwt-wcas-is-detail-box"),a.previewWrapper.addClass("dgwt-wcas-is-details"),a.previewWrapper.addClass("dgwt-wcas-details-right"),setTimeout(function(){if(t(".dgwt-wcas-suggestion-product:not(.dgwt-wcas-suggestion-duplicated)").addClass("dgwt-wcas-suggestion-selected"),a.searchWrapp.width()>=550){a.previewWrapper.addClass("dgwt-wcas-full-width");var s=getComputedStyle(a.searchWrapp[0]).width;(s=Math.round(parseFloat(s.replace("px",""))))%2==0?(a.suggestionWrapp.css("width",Math.round(s/2)),a.detailsWrapp.css("width",Math.round(s/2))):(a.suggestionWrapp.css("width",Math.floor(s/2)),a.detailsWrapp.css("width",Math.ceil(s/2)))}else a.suggestionWrapp.width(a.searchWrapp.width())},10)):(a.detailsWrapp.hide(),a.searchWrapp.removeClass("dgwt-wcas-is-detail-box"),a.previewWrapper.removeClass("dgwt-wcas-is-details"),a.previewWrapper.removeClass("dgwt-wcas-details-right"),a.previewWrapper.removeClass("dgwt-wcas-full-width"),t(".dgwt-wcas-suggestion-product").removeClass("dgwt-wcas-suggestion-selected"),a.suggestionWrapp.css("width",""),a.detailsWrapp.css("width",""))},onColorSearchIconColor:function(t,s){},onColorBgInputColor:function(t,s){this.isColor(s)?this.searchInput.css("background-color",s):this.searchInput.css("background-color","")},onColorTextInputColor:function(s,e){var a="dgwt-wcas-preview-placeholder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-search-input::placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-webkit-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input::-moz-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-search-input:-ms-input-placeholder{opacity: 0.3; color:"+e+"!important;}",i+=".dgwt-wcas-ico-magnifier path {fill:"+e+"}",i+="</style>",t("head").append(i),this.searchInput.css("color",e)}else{this.searchInput.css("color","");var o=t("."+a);o.length>0&&o.remove()}},onColorBorderInputColor:function(t,s){this.isColor(s)?this.searchInput.css("border-color",s):this.searchInput.css("border-color","")},onColorBgSubmitColor:function(s,e){if(this.isChecked(t("input[id*='show_submit_button']"))&&this.isColor(e)){var a='<style class="dgwt-wcas-preview-submit-style">';a+=".dgwt-wcas-search-submit::before{border-color: transparent "+e+"!important;}",a+=".dgwt-wcas-search-submit:hover::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit:focus::before{border-right-color: "+e+"!important;}",a+=".dgwt-wcas-search-submit{background-color: "+e+"!important;}",a+=".dgwt-wcas-om-bar .dgwt-wcas-om-return{background-color: "+e+"!important;}",a+="</style>",t("head").append(a)}else{var i=t(".dgwt-wcas-preview-submit-style");i.length>0&&i.remove()}},onColorTextSubmitColor:function(s,e){this.isChecked(t("input[id*='show_submit_button']"))&&this.isColor(e)?(t(".js-dgwt-wcas-search-submit").css("color",e),t(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",e)):(this.searchInput.css("background-color",""),t(".js-dgwt-wcas-search-submit").css("color",""),t(".dgwt-wcas-search-submit .dgwt-wcas-ico-magnifier path").css("fill",""))},onColorSugBgColor:function(s,e){var a="dgwt-wcas-preview-sugbgcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp",i+="{background-color: "+e+"!important;}",i+="</style>",t("head").append(i)}else{var o=t("."+a);o.length>0&&o.remove()}},onColorSugHoverColor:function(s,e){this.isColor(e)?setTimeout(function(){t(".dgwt-wcas-suggestion-selected").css("background-color",e)},50):t(".dgwt-wcas-suggestion-selected").css("background-color","")},onColorSugTextColor:function(s,e){var a="dgwt-wcas-preview-sugtextcol-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp *,",i+=".dgwt-wcas-details-wrapp *,",i+=".dgwt-wcas-sd,",i+=".dgwt-wcas-suggestion *",i+="{color: "+e+"!important;}",i+="</style>",t("head").append(i)}else{var o=t("."+a);o.length>0&&o.remove()}},onColorSugHighlightColor:function(s,e){var a="dgwt-wcas-preview-sughighlight-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-st strong,",i+=".dgwt-wcas-sd strong",i+="{color: "+e+"!important;}",i+="</style>",t("head").append(i)}else{var o=t("."+a);o.length>0&&o.remove()}},onColorSugBorderColor:function(s,e){var a="dgwt-wcas-preview-sugborder-style";if(this.isColor(e)){var i='<style class="'+a+'">';i+=".dgwt-wcas-suggestions-wrapp,",i+=".dgwt-wcas-details-wrapp,",i+=".dgwt-wcas-suggestion,",i+=".dgwt-wcas-datails-title,",i+=".dgwt-wcas-details-more-products",i+="{border-color: "+e+"!important;}",i+="</style>",t("head").append(i)}else{var o=t("."+a);o.length>0&&o.remove()}},onTypeSearchSubmitText:function(s,e){var a=t(".js-dgwt-wcas-search-submit-l"),i=t(".js-dgwt-wcas-search-submit-m");e.length>0?(a.text(e),a.show(),i.hide()):(a.text(""),a.hide(),i.show())},onTypeSearchPlaceholder:function(t,s){0==s.length&&(s=dgwt_wcas.labels.search_placeholder),this.searchInput.attr("placeholder",s)},onTypeSearchNoResultsText:function(s,e){0==e.length&&(e=dgwt_wcas.labels.no_results),t(".js-dgwt-wcas-suggestion-nores span").text(e)},onTypeSearchSeeAllResultsText:function(s,e){0==e.length&&(e=dgwt_wcas.labels.show_more),t(".js-dgwt-wcas-st-more-label").text(e)},fixSizesInit:function(){var s=this;t(document).on("click","#dgwt_wcas_autocomplete-tab",function(){s.onChangeShowDetailsBox(t("input[id*='show_details_box']"))})}};var d={settingsTab:"#dgwt_wcas_troubleshooting-tab",noIssuesClass:".js-dgwt-wcas-troubleshooting-no-issues",counterClass:".js-dgwt-wcas-troubleshooting-count",issuesListClass:".js-dgwt-wcas-troubleshooting-issues",progressBar:".dgwt-wcas-troubleshooting-wrapper .progress_bar",progressBarInner:".dgwt-wcas-troubleshooting-wrapper .progress-bar-inner",resetButtonName:"dgwt-wcas-reset-async-tests",fixOutofstockButtonName:"dgwt-wcas-fix-out-of-stock-relationships",switchAlternativeEndpoint:"dgwt-wcas-switch-alternative-endpoint",dismissElementorTemplateButtonName:"dgwt-wcas-dismiss-elementor-template",init:function(){var s=this;if(void 0===dgwt_wcas.troubleshooting)return;const e=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended;e>0&&(t(s.counterClass).text(e),t(s.settingsTab).addClass("enabled")),dgwt_wcas.troubleshooting.tests.results_async.length>0&&t.each(dgwt_wcas.troubleshooting.tests.results_async,function(){s.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.direct.length>0&&t.each(dgwt_wcas.troubleshooting.tests.direct,function(){s.appendIssue(this,!1)}),dgwt_wcas.troubleshooting.tests.async.length>0&&s.maybeRunNextAsyncTest(),t(document).on("click",'input[name="'+s.resetButtonName+'"]',function(e){t('input[name="'+s.resetButtonName+'"]').attr("disabled","disabled");var a={action:"dgwt_wcas_troubleshooting_reset_async_tests",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_reset_async_tests};return t.post(ajaxurl,a,function(){location.reload()}),!1}),t(document).on("click",'input[name="'+s.fixOutofstockButtonName+'"]',function(e){t('input[name="'+s.fixOutofstockButtonName+'"]').attr("disabled","disabled").next().addClass("loading");var a={action:"dgwt_wcas_troubleshooting_fix_outofstock",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_fix_outofstock};return t.post(ajaxurl,a,function(){location.reload()}),!1}),t(document).on("click",'input[name="'+s.switchAlternativeEndpoint+'"]',function(e){var a=1===parseInt(t(this).data("switch"))?"enable":"disable";t('input[name="'+s.switchAlternativeEndpoint+'"]').attr("disabled","disabled").next().addClass("loading");var i={action:"dgwt_wcas_troubleshooting_switch_alternative_endpoint",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_switch_alternative_endpoint,switch:a};return t.post(ajaxurl,i,function(){location.reload()}),!1}),t(document).on("click",'input[name="'+s.dismissElementorTemplateButtonName+'"]',function(e){t('input[name="'+s.dismissElementorTemplateButtonName+'"]').attr("disabled","disabled");var a={action:"dgwt_wcas_troubleshooting_dismiss_elementor_template",_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_dismiss_elementor_template};return t.post(ajaxurl,a,function(){location.reload()}),!1})},appendIssue:function(s,e){var a,i=wp.template("dgwt-wcas-troubleshooting-issue"),o=t(this.issuesListClass+"-"+s.status);"good"!==s.status&&(t(this.noIssuesClass).hide(),e&&dgwt_wcas.troubleshooting.tests.issues[s.status]++,(a=dgwt_wcas.troubleshooting.tests.issues.critical+dgwt_wcas.troubleshooting.tests.issues.recommended)>0&&(t(this.counterClass).text(a),t(this.settingsTab).addClass("enabled")),t(o).append(i(s)))},maybeRunNextAsyncTest:function(){var s=this;dgwt_wcas.troubleshooting.tests.async.length>0&&t.each(dgwt_wcas.troubleshooting.tests.async,function(){var e={action:"dgwt_wcas_troubleshooting_test",test:this.test,_wpnonce:dgwt_wcas.troubleshooting.nonce.troubleshooting_async_test};return!!this.completed||(this.completed=!0,t(s.progressBar).show(),t.post(ajaxurl,e,function(t){t.success&&s.appendIssue(t.data,!0),s.maybeRunNextAsyncTest()}),!1)}),s.recalculateProgression()},recalculateProgression:function(){var s=this,e=dgwt_wcas.troubleshooting.tests.async.length,a=0;t.each(dgwt_wcas.troubleshooting.tests.async,function(){this.completed&&a++});var i=Math.ceil(a/e*100);t(s.progressBarInner).css("width",i+"%"),100===i&&setTimeout(function(){t(s.progressBar).slideUp()},2e3)}},l={moveOptionClass:".js-dgwt-wcas-move-option",init:function(){var s=t(this.moveOptionClass);s.length>0&&t.each(s,function(s,e){var a=t("#"+t(e).data("move-dest").replace(/(:|\.|\[|\])/g,"\\$1"));a.length>0&&(t(e).closest("tr").hasClass("dgwt-wcas-premium-only")&&t(e).addClass("dgwt-wcas-premium-only"),t(e).clone().appendTo(a.closest("td fieldset"))),t(e).closest("tr").remove()})}},g=function(){if("undefined"!=typeof Vue){Vue.component("dgwt-wcas-rule",{template:"#dgwt-wcas-settings-filters-rules-rule",components:{Selectize:Selectize},props:["nonce","rule","rules","index"],data:()=>({isSelectActive:!0}),computed:{ruleValue(t){return this.rule.group}},watch:{rule:{handler:function(){this.$emit("update:rule",this.index)},deep:!0},ruleValue(){var t=this;this.$emit("change:group",this.index),this.isSelectActive=!1,setTimeout(function(){t.isSelectActive=!0},0)}},methods:{deleteRule(){this.$emit("delete:rule",this.index)},getSelectizeSettings(s){var e=void 0===dgwt_wcas_filters_rules_selected_options[s]?[]:dgwt_wcas_filters_rules_selected_options[s];return function({nonce:s,options:e,type:a}){return{persist:!1,maxItems:null,valueField:"key",labelField:"label",searchField:["label"],options:e,preload:!0,create:function(t){return{value:t.key,label:t.label}},load:function(e,i){t.ajax({url:ajaxurl,method:"POST",data:{action:"dgwt_wcas_settings_search_terms",query:e,type:a,_wpnonce:s},error:function(){i()},success:function(t){i(t.data)}})}}}({nonce:this.nonce,type:s,options:e})}}});new Vue({el:"#dgwt-wcas-settings-filters-rules",components:{Selectize:Selectize},data:()=>({rules:[]}),mounted(){try{const s=JSON.parse(this.$refs["dgwt-wcas-settings-filters-rules-ref"].value);t.each(s,function(t,e){s[t].key=Math.random()}),this.rules=s}catch(t){}this.updateInput()},methods:{addRule(){this.rules.push({group:"",values:[],key:Math.random()}),this.updateInput()},changeGroup(t){this.rules[t].values=[],this.updateInput()},deleteRule(t){this.rules=this.rules.filter(function(s,e){return e!==t}),this.updateInput()},updateInput(){const t=JSON.parse(JSON.stringify(this.rules));this.$refs["dgwt-wcas-settings-filters-rules-ref"].value=JSON.stringify(t.map(function(t){return t.key,delete t.key,t}))}}})}};t(document).ready(function(){var h,u;(h=t(".js-dgwt-wcas-settings-margin-nob")).length>0&&h.each(function(){var s=t(this).find("td .dgwt-wcas-fieldset");if(s.length>0){var e=t(this).prev(".js-dgwt-wcas-settings-margin");if(e.length>0){var a=t(this).attr("class").split(/\s+/),i="";t.each(a,function(t,s){-1!==s.indexOf("js-dgwt-wcas-cbtgroup-")&&(i=s)});var o=s.clone(!0,!0);o.addClass("dgwt-wcas-settings-margin-nob"),i&&o.addClass(i),o.appendTo(e.find("td")),t(this).remove()}}}),s.init(),e.init(),i.init(),(u=t(".js-dgwt-wcas-sgs-autocolspan")).length>0&&u.find("td").attr("colspan",2),o.init(),n.init(),r.init(),c.init(),d.init(),l.init(),a.init(),g(),window.DGWT_WCAS_SEARCH_PREVIEW.init()})}(jQuery);
assets/js/search.js CHANGED
@@ -956,8 +956,8 @@
956
  $suggestionsWrapp.css('height', 'auto');
957
  $detailsWrapp.css('height', 'auto');
958
 
959
- var sH = $suggestionsWrapp.outerHeight(),
960
- dH = $detailsWrapp.outerHeight(),
961
  minHeight = 340;
962
 
963
  $suggestionsWrapp.find('.dgwt-wcas-suggestion:last-child').removeClass('dgwt-wcas-suggestion-no-border-bottom');
@@ -1032,8 +1032,8 @@
1032
 
1033
  // Choose orientation
1034
  var orientation = that.options.orientation,
1035
- containerHeight = $form.outerHeight(),
1036
- height = that.el.outerHeight(),
1037
  offset = that.el.offset(),
1038
  styles = {'top': offset.top, 'left': offset.left};
1039
 
@@ -1054,7 +1054,7 @@
1054
  if (ft < $suggestionsContainer.height()) {
1055
  $suggestionsContainer.height(ft - 10);
1056
  }
1057
- styles.top += -$suggestionsContainer.outerHeight();
1058
  } else {
1059
  styles.top += height;
1060
  }
@@ -2476,7 +2476,7 @@
2476
  upperBound,
2477
  lowerBound,
2478
  $suggestionContainer = that.getSuggestionsContainer(),
2479
- heightDelta = $(activeItem).outerHeight();
2480
 
2481
  offsetTop = activeItem.offsetTop;
2482
  upperBound = $suggestionContainer.scrollTop();
@@ -2738,6 +2738,8 @@
2738
  } catch (error) {
2739
  }
2740
  }
 
 
2741
  }
2742
  };
2743
 
956
  $suggestionsWrapp.css('height', 'auto');
957
  $detailsWrapp.css('height', 'auto');
958
 
959
+ var sH = $suggestionsWrapp.outerHeight(false),
960
+ dH = $detailsWrapp.outerHeight(false),
961
  minHeight = 340;
962
 
963
  $suggestionsWrapp.find('.dgwt-wcas-suggestion:last-child').removeClass('dgwt-wcas-suggestion-no-border-bottom');
1032
 
1033
  // Choose orientation
1034
  var orientation = that.options.orientation,
1035
+ containerHeight = $form.outerHeight(false),
1036
+ height = that.el.outerHeight(false),
1037
  offset = that.el.offset(),
1038
  styles = {'top': offset.top, 'left': offset.left};
1039
 
1054
  if (ft < $suggestionsContainer.height()) {
1055
  $suggestionsContainer.height(ft - 10);
1056
  }
1057
+ styles.top += -$suggestionsContainer.outerHeight(false);
1058
  } else {
1059
  styles.top += height;
1060
  }
2476
  upperBound,
2477
  lowerBound,
2478
  $suggestionContainer = that.getSuggestionsContainer(),
2479
+ heightDelta = $(activeItem).outerHeight(false);
2480
 
2481
  offsetTop = activeItem.offsetTop;
2482
  upperBound = $suggestionContainer.scrollTop();
2738
  } catch (error) {
2739
  }
2740
  }
2741
+
2742
+ $(document).trigger('dgwtWcasGAEvent', {'term': label, 'category': category});
2743
  }
2744
  };
2745
 
assets/js/search.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e.setAttribute("unselectable","on"),e},highlight:function(t,s){if(dgwt_wcas.is_premium){var i,o=s.split(/ /),a=!1,n="";if(o)for(n=o[o.length-1],o=o.sort(function(t,e){return e.length-t.length}),i=0;i<o.length;i++)if(o[i]&&o[i].length>=1){var r=o[i].replace(/[\^\@]/g,"");if(r.length>0){if(1===r.trim().length&&o[i]!==n)var l="((\\s|^)"+e.escapeRegExChars(r.trim())+"\\s)";else l=1===r.trim().length&&o[i]===n?"((\\s|^)"+e.escapeRegExChars(r.trim())+")":"("+e.escapeRegExChars(r.trim())+")";t=t.replace(new RegExp(l,"gi"),"^^$1@@"),a=!0}}a&&(t=(t=t.replace(/\^\^/g,"<strong>")).replace(/@@/g,"</strong>"))}else l="("+e.escapeRegExChars(s)+")",t=t.replace(new RegExp(l,"gi"),"<strong>$1</strong>");return t},debounce:function(t,e){var i,o=(new Date).getUTCMilliseconds();if(0===s.id.length)return s.id=o,void t();s.id=o,i=setTimeout(function(){o===s.id?(t(),s.id=""):clearTimeout(i)},e)},mouseHoverDebounce:function(e,s,i){var o;o=setTimeout(function(){t(s+":hover").length>0?e():clearTimeout(o)},i)},getActiveInstance:function(){var e,s=t(".dgwt-wcas-search-wrapp.dgwt-wcas-active");return s.length>0&&s.each(function(){var s=t(this).find(".dgwt-wcas-search-input");if("object"==typeof s.data("autocomplete"))return e=s.data("autocomplete"),!1}),e},hashCode:function(t){for(var e=0,s=t.length;s>0;)e=(e<<5)-e+t.charCodeAt(--s)|0;return e<0?-1*e:e}},s={id:"",callback:null,ajaxSettings:null,object:null},i=27,o=9,a=13,n=38,r=39,l=40,c=t.noop;function d(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},this.detailsRequestsSent=[],this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.detailsContainer=null,this.autoAligmentprocess=null,this.noSuggestionsContainer=null,this.latestActivateSource="",this.actionTriggerSource="",this.options=t.extend(!0,{},d.defaults,s),this.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top"},this.hint=null,this.hintValue="",this.selection=null,this.overlayMobileState="off",this.isMouseDownOnSearchElements=!1,this.initialize(),this.setOptions(s)}d.utils=e,t.DgwtWcasAutocompleteSearch=d,d.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",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,deferRequestBy:0,params:{},formatResult:function(t,s,i,o){if(!s)return t;i&&(t=e.highlight(t,s));if(!o.convertHtml)return t;return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/&lt;sup/g,"<sup").replace(/&lt;\/sup/g,"</sup").replace(/sup&gt;/g,"sup>").replace(/&lt;(\/?(strong|b|br|span))&gt;/g,"<$1>").replace(/&lt;(strong|span)\s+class\s*=\s*&quot;([^&]+)&quot;&gt;/g,'<$1 class="$2">')},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:c,onSearchComplete:c,onSearchError:c,preserveInput:!1,searchFormClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",searchInputClass:"dgwt-wcas-search-input",preloaderClass:"dgwt-wcas-preloader",closeTrigger:"dgwt-wcas-close",formClass:"dgwt-wcas-search-form",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,isPremium:!1,overlayMobile:!1,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(t){return"string"==typeof t?JSON.parse(t):t},noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1,positionFixed:!1,debounceWaitMs:400,sendGAEvents:!0,enableGASiteSearchModule:!1,showProductVendor:!1,disableHits:!1,disableSubmit:!1},d.prototype={initialize:function(){var s=this;s.element.setAttribute("autocomplete","off"),s.createContainers(),s.registerEventsSearchBar(),s.registerEventsSuggestions(),s.registerEventsDetailsPanel(),s.registerIconHandler(),s.registerEventsFixedMenu(),s.fixPositionCapture=function(){s.adjustContainerWidth(),s.visible&&s.fixPosition()},t(window).on("resize.autocomplete",function(){var t=e.getActiveInstance();void 0!==t&&t.fixPositionCapture()}),s.initMobileMode(),s.hideAfterClickOutsideListener(),s.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),s.detailsContainer&&s.detailsContainer.length>0&&s.detailsContainer.addClass("js-dgwt-wcas-initialized")},createContainers:function(e){var s=this.options;0==t("."+s.containerClass).length?(this.suggestionsContainer=t(d.utils.createNode(s.containerClass)),this.suggestionsContainer.appendTo(s.appendTo||"body"),this.suggestionsContainer.addClass("woocommerce"),!0===s.showImage&&this.suggestionsContainer.addClass("dgwt-wcas-has-img"),!0===s.showPrice&&this.suggestionsContainer.addClass("dgwt-wcas-has-price"),!0===s.showDescription&&this.suggestionsContainer.addClass("dgwt-wcas-has-desc"),!0===s.showSKU&&this.suggestionsContainer.addClass("dgwt-wcas-has-sku"),!0===s.showHeadings&&this.suggestionsContainer.addClass("dgwt-wcas-has-headings"),"auto"!==s.width&&this.suggestionsContainer.width(s.width)):this.suggestionsContainer=t("."+this.options.containerClass),this.canShowDetailsBox()&&(0==t("."+s.containerDetailsClass).length?(this.detailsContainer=t(d.utils.createNode(s.containerDetailsClass)),this.detailsContainer.appendTo(s.appendTo||"body"),this.detailsContainer.addClass("woocommerce")):this.detailsContainer=t("."+s.containerDetailsClass))},registerEventsSearchBar:function(){var s=this;t(document).on("click.autocomplete","."+s.options.closeTrigger,function(){e.getActiveInstance().close()}),s.el.closest("."+s.options.formClass).on("submit.autocomplete",function(e){if(s.options.disableSubmit)return e.preventDefault(),!1;var i=t(this).find("."+s.options.searchInputClass);if(i.length&&0===i.val().length)return e.preventDefault(),!1;s.suggestions.length>0&&t.each(s.suggestions,function(t,i){if(void 0!==i.type&&"product_variation"==i.type)return s.select(t),e.preventDefault(),!1}),s.disableOverlayMobile()}),"complete"===document.readyState?s.positionPreloader():t(window).on("load",function(){s.positionPreloader()}),s.el.on("keydown.autocomplete",function(t){s.onKeyPress(t)}),s.el.on("keyup.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("input.autocomplete",function(t){s.onKeyUp(t)})},registerEventsSuggestions:function(){var s="."+this.classes.suggestion;if(!this.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")){t(document).on("mouseenter.autocomplete",s,function(){var s=e.getActiveInstance();if(void 0!==s){var i=t(this).data("index"),o='.dgwt-wcas-suggestion[data-index="'+i+'"]',a=s.canShowDetailsBox()?100:1;s.selectedIndex!=i&&e.mouseHoverDebounce(function(){s.selectedIndex!==i&&(s.latestActivateSource="mouse",s.getDetails(s.suggestions[i]),s.activate(i))},o,a)}});var i=!1;t(document).on("click.autocomplete",s,function(s){if(i)s.preventDefault();else{var o=e.getActiveInstance();o.actionTriggerSource="click",i=!0,setTimeout(function(){i=!1},500),void 0!==s.ctrlKey&&!1!==s.ctrlKey||(o.select(t(this).data("index")),s.preventDefault())}}),t(document).on("mousedown.autocomplete",s,function(s){var o=this;0===s.button&&setTimeout(function(){i||e.getActiveInstance().select(t(o).data("index"))},250)}),t("."+this.options.containerClass).on("mousedown.autocomplete",function(t){e.getActiveInstance().isMouseDownOnSearchElements=!0})}},registerEventsDetailsPanel:function(){var s=this.getDetailsContainer();this.canShowDetailsBox()&&!s.hasClass("js-dgwt-wcas-initialized")&&(t(document).on("change.autocomplete",'[name="js-dgwt-wcas-quantity"]',function(e){t(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",t(this).val())}),t("."+this.options.containerDetailsClass).on("mousedown.autocomplete",function(t){e.getActiveInstance().isMouseDownOnSearchElements=!0}))},registerIconHandler:function(){var s=this,i=s.getFormWrapper(),o=i.find("."+s.options.formClass);i.on("click.autocomplete",".js-dgwt-wcas-search-icon-handler",function(t){var e=i.find("."+s.options.searchInputClass);if(i.hasClass("dgwt-wcas-layout-icon-open"))s.hide(),o.hide(!0),i.removeClass("dgwt-wcas-layout-icon-open");else{var a=i.find(".dgwt-wcas-search-icon-arrow");o.hide(),a.hide(),i.addClass("dgwt-wcas-layout-icon-open"),s.positionIconSearchMode(i),o.fadeIn(200,function(){a.show(),s.positionPreloader(i),e.focus()})}}),0==t(".js-dgwt-wcas-initialized").length&&t(".js-dgwt-wcas-search-icon-handler").length>0&&t(document).on("click.autocomplete",function(i){if(t(".dgwt-wcas-layout-icon-open").length){var o=t(i.target);if(!(o.closest("."+s.options.searchFormClass).length>0||o.closest("."+s.options.containerClass).length>0||o.closest("."+s.options.containerDetailsClass).length>0)){var a=e.getActiveInstance();if(void 0!==a){var n=a.getFormWrapper().find("."+s.options.formClass);n.hide(),a.hide(!0),n.css({left:"0"})}s.hideIconModeSearch()}}}),t(window).on("resize.autocomplete",function(){s.applyFlexibleMode()}),"complete"==document.readyState?s.applyFlexibleMode():t(window).on("load.autocomplete",function(){s.applyFlexibleMode()})},registerEventsFixedMenu:function(){var e=this;t(window).on("scroll.autocomplete",function(){if(e.suggestions.length>0&&e.elementOrParentIsFixed(e.getFormWrapper()))if(0===t(window).scrollTop()){[1,10,20,30,40,50,60,70,80,90,120,140,170,200,250,400,700,1e3,2e3].forEach(function(t){setTimeout(function(){e.fixHeight(),e.fixPositionCapture()},t)})}else e.fixHeight(),e.fixPositionCapture()})},initMobileMode:function(){var t=this,e=t.getFormWrapper();e.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&t.isMobileMode()&&(e.prepend('<div class="js-dgwt-wcas-enable-mobile-form dgwt-wcas-enable-mobile-form"></div>'),e.find(".js-dgwt-wcas-enable-mobile-form").on("click.autocomplete",function(e){t.options.mobileOverlayDelay>0?setTimeout(function(){t.enableOverlayMobile()},t.options.mobileOverlayDelay):t.enableOverlayMobile()}))},applyFlexibleMode:function(){var e=t(".js-dgwt-wcas-layout-icon-flexible");e.length&&(this.isMobileMode()?(e.addClass("js-dgwt-wcas-layout-icon"),e.addClass("dgwt-wcas-layout-icon")):(e.removeClass("js-dgwt-wcas-layout-icon"),e.removeClass("dgwt-wcas-layout-icon")),e.addClass("dgwt-wcas-layout-icon-flexible-loaded"))},onFocus:function(){t("."+this.options.searchFormClass).removeClass("dgwt-wcas-active"),this.getFormWrapper().addClass("dgwt-wcas-active"),this.fixPositionCapture(),this.el.val().length>=this.options.minChars&&this.onValueChange()},onBlur:function(){var e=this.options,s=this.el.val(),i=this.getQuery(s);this.isMobileMode()||this.isMouseDownOnSearchElements||(this.hide(),this.selection&&this.currentValue!==i&&(e.onInvalidateSelection||t.noop).call(this.element))},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=this,i=s.getSuggestionsContainer(),o=t.extend({},s.options,e);(s.isLocal=Array.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),o.orientation=s.validateOrientation(o.orientation,"bottom"),i.css({"max-height":s.canShowDetailsBox()?"none":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex}),!0===o.showDetailsPanel)&&s.getDetailsContainer().css({"z-index":o.zIndex-1});o.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.showCloseButton()},this.options=o},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},this.badQueries=[]},clear:function(t){t&&this.clearCache(),this.currentValue="",this.suggestions=[]},close:function(){this.hide(),this.clear(!1),this.hideCloseButton(),this.el.closest("."+this.options.searchFormClass).find("."+this.options.searchInputClass).val("").focus()},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this.getFormOffset();this.getSuggestionsContainer().css(t),this.canShowDetailsBox()&&this.fixPositionDetailsBox()},fixPositionDetailsBox:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.getDetailsContainer(),o=this.getFormOffset(),a=o.left;if(0==i.length)return!1;var n=!0===this.options.isRtl?1:2,r=Math.round(o.left);if(o.left=r+Math.round(s.width()+n),i.css(o),e.width()>=550)return t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),void(!0===this.options.isRtl&&(s.css("left",r+Math.round(i.width()+n)+"px"),i.css("left",a+"px")));var l=t(window).width(),c=i.width(),d=i.offset();t("body").addClass("dgwt-wcas-details-outside"),!0===this.options.isRtl&&(o.left=o.left+1);var g=!1,u=!1;l<d.left+c&&(g=!0,t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-left"),i.css("left",Math.round(parseFloat(s.css("left").replace("px","")))-i.outerWidth()+"px")),(d=i.offset()).left<1&&(u=!0,t("body").removeClass("dgwt-wcas-details-left"),t("body").addClass("dgwt-wcas-details-right")),u&&g?(t("body").removeClass("dgwt-wcas-details-left"),t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-notfit")):t("body").removeClass("dgwt-wcas-details-notfit")},fixHeight:function(){if(1!=this.options.showDetailsPanel)return!1;var t=this.getSuggestionsContainer(),e=this.getDetailsContainer();t.css("height","auto"),e.css("height","auto");var s=t.outerHeight(),i=e.outerHeight();return t.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),!(s<=340&&i<=340)&&(t.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),i<s&&e.css("height",s+"px"),s<i&&t.css("height",i+"px"),!1)},automaticAlignment:function(){var t=this,e=t.getFormWrapper().find(".dgwt-wcas-search-input"),s=t.getSuggestionsContainer(),i=t.getDetailsContainer();if(null==t.autoAligmentprocess){var o=[e.width(),s.height()];t.options.showDetailsPanel&&(o[2]=i.height()),t.autoAligmentprocess=setInterval(function(){var a=[e.width(),s.height()];t.options.showDetailsPanel&&(a[2]=i.height());for(var n=0;n<o.length;n++)if(o[n]!=a[n]){t.fixHeight(),t.fixPositionCapture(),o=a;break}t.options.showDetailsPanel&&(i.find(".dgwt-wcas-details-inner").height()-i.height()>2&&t.fixHeight())},10)}},getFormOffset:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.options.orientation,o=e.outerHeight(),a=this.el.outerHeight(),n=this.el.offset(),r={top:n.top,left:n.left};if("auto"===i){var l=t(window).height(),c=t(window).scrollTop(),d=-c+n.top-o,g=c+l-(n.top+a+o);i=Math.max(d,g)===d?"top":"bottom"}if("top"===i){s[0].getBoundingClientRect().top;var u=e[0].getBoundingClientRect().top;s.css("height","auto"),u<s.height()&&s.height(u-10),r.top+=-s.outerHeight()}else r.top+=a;return r},getFormWrapper:function(){return this.el.closest("."+this.options.searchFormClass)},getSuggestionsContainer:function(){return t("."+this.options.containerClass)},getDetailsContainer:function(){return t("."+this.options.containerDetailsClass)},scrollDownSuggestions:function(){var t=this.getSuggestionsContainer();t[0].scrollTop=t[0].scrollHeight},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==l||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case i:this.el.val(this.currentValue),this.hide();break;case r:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case o:if(this.hint&&this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case a:if(-1===this.selectedIndex)return!this.options.disableSubmit&&void this.hide();this.actionTriggerSource="enter",this.select(this.selectedIndex);break;case n:this.moveUp();break;case l:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case n:case l:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&&(e.findBestHint(),e.options.deferRequestBy>0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&&this.currentValue!==i&&(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&&this.isExactMatch(i)?this.select(0):i.length<e.minChars?(this.hideCloseButton(),this.hide()):this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&&e[0].value.toLowerCase()===t.toLowerCase()},canShowDetailsBox:function(){return 1==this.options.showDetailsPanel&&!this.isMobileMode()},isMobileMode:function(){return t(window).width()<this.options.mobileBreakpoint},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e.trim()},getSuggestionsLocal:function(e){var s,i=this.options,o=e.toLowerCase(),a=i.lookupFilter,n=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return a(t,e,o)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(i){var o,a,n,r,l=this,c=l.options,d=c.serviceUrl,g=l.getFormWrapper();c.params[c.paramName]=i,void 0!==dgwt_wcas.current_lang&&(c.params.l=dgwt_wcas.current_lang),c.params=l.applyCustomParams(c.params),l.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==c.onSearchStart.call(l.element,c.params)&&(a=c.ignoreParams?null:c.params,t.isFunction(c.lookup)?c.lookup(i,function(t){l.suggestions=t.suggestions,l.suggest(),l.selectFirstSuggestion(t.suggestions),c.onSearchComplete.call(l.element,i,t.suggestions)}):(l.isLocal?o=l.getSuggestionsLocal(i):(t.isFunction(d)&&(d=d.call(l.element,i)),n=d+"?"+t.param(a||{}),o=l.cachedResponse[n]),o&&Array.isArray(o.suggestions)?(l.suggestions=o.suggestions,l.suggest(),l.selectFirstSuggestion(o.suggestions),c.onSearchComplete.call(l.element,i,o.suggestions)):l.isBadQuery(i)?c.onSearchComplete.call(l.element,i,[]):(l.abortAjax(),r={url:d,data:a,type:c.type,dataType:c.dataType},t.extend(r,c.ajaxSettings),s.object=l,s.ajaxSettings=r,e.debounce(function(){var e=s.object,o=s.ajaxSettings;e.currentRequest=t.ajax(o).done(function(t){var s;e.currentRequest=null,void 0!==(s=e.options.transformResult(t,i)).suggestions&&(e.processResponse(s,i,n),e.selectFirstSuggestion(s.suggestions),1===s.suggestions.length&&void 0!==s.suggestions[0].type&&"no-results"===s.suggestions[0].type?e.gaEvent(i,"Autocomplete Search without results"):e.gaEvent(i,"Autocomplete Search with results")),e.fixPositionCapture(),e.options.onSearchComplete.call(e.element,i,s.suggestions),e.updatePrices()}).fail(function(t,s,o){e.options.onSearchError.call(e.element,i,t,s,o)})},c.debounceWaitMs))))},getDetails:function(e){var s=this;if(!s.canShowDetailsBox())return!1;if(null!=e&&void 0!==e.type&&("string"!=typeof e.type||"more_products"!==e.type)){s.fixHeight();s.getDetailsContainer();var i=s.prepareSuggestionObjectID(e);if(null!=s.cachedDetails[i])s.detailsPanelSetScene(i),s.fixHeight(),s.fixPositionCapture();else{var o={action:dgwt_wcas.action_result_details,items:[]};if(t.each(s.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type){var i={objectID:s.prepareSuggestionObjectID(e),value:null!=e.value?e.value:""};o.items.push(i)}}),s.detailsPanelClearScene(),s.preloader("show","details",""),-1!=t.inArray(i,s.detailsRequestsSent))return;s.detailsRequestsSent.push(i),t.ajax({data:o,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(t){var e="string"==typeof t?JSON.parse(t):t;if(void 0!==e.items)for(var i=0;i<e.items.length;i++){var o=e.items[i].objectID;s.cachedDetails[o]={html:e.items[i].html},s.detailsPanelAddToScene(o),void 0!==e.items[i].price&&e.items[i].price.length>0&&(s.cachedPrices[o]=e.items[i].price)}s.preloader("hide","details","");var a=s.prepareSuggestionObjectID(s.suggestions[s.selectedIndex]);null!=s.cachedDetails[a]?s.detailsPanelSetScene(a):s.detailsPanelClearScene(),s.fixPositionCapture(),s.fixHeight(),s.updatePrices(!0)},error:function(t,e){s.preloader("hide","details",""),s.detailsPanelClearScene(),s.fixPositionCapture(),s.fixHeight()}})}t(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},updatePrices:function(e){var s,i,o=this,a=[];if(o.options.showPrice&&o.options.dynamicPrices&&0!=o.suggestions.length){for(s=0;s<o.suggestions.length;s++)if(void 0!==o.suggestions[s].type&&("product"==o.suggestions[s].type||"product_variation"==o.suggestions[s].type)){var n="product__"+o.suggestions[s].post_id;void 0!==o.cachedPrices[n]?o.updatePrice(s,o.cachedPrices[n]):(o.applyPreloaderForPrice(s),a.push(o.suggestions[s].post_id))}if(!e&&a.length>0){var r={action:void 0===dgwt_wcas.action_get_prices?"dgwt_wcas_get_prices":dgwt_wcas.action_get_prices,items:a};t.ajax({data:r,type:"post",url:dgwt_wcas.ajax_prices_endpoint,success:function(t){if(void 0!==t.success&&t.success&&t.data.length>0)for(s=0;s<t.data.length;s++){var e=t.data[s].id,a=t.data[s].price;if(o.suggestions.length>0)for(i=0;i<o.suggestions.length;i++)if(void 0!==o.suggestions[i].type&&("product"==o.suggestions[i].type||"product_variation"==o.suggestions[i].type)&&o.suggestions[i].post_id==e){var n="product__"+e;o.cachedPrices[n]=a,o.updatePrice(i,a)}}},error:function(t,e){}})}}},updatePrice:function(e,s){if(void 0!==this.suggestions[e]){this.suggestions[e].price=s;var i=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');i.length&&i.html(s)}},applyCustomParams:function(t){if("object"==typeof dgwt_wcas.custom_params){var e=dgwt_wcas.custom_params;for(var s in e)t[s]=e[s]}var i=this.el.data("custom-params");if("object"==typeof i)for(var s in i)t[s]=i[s];return t},applyPreloaderForPrice:function(e){if(void 0!==this.suggestions[e]){var s=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');s.length&&s.html('<div class="dgwt-wcas-preloader-price"><div class="dgwt-wcas-preloader-price-inner"> <div></div><div></div><div></div></div></div>')}},prepareSuggestionObjectID:function(t){var e="";return void 0!==t&&void 0!==t.type&&(null!=t.post_id&&(e=t.type+"__"+t.post_id,"product_variation"===t.type&&(e+="__"+t.variation_id),void 0!==t.post_type&&(e=t.type+"__"+t.post_id+"__"+t.post_type)),null!=t.term_id&&null!=t.taxonomy&&(e=t.type+"__"+t.term_id+"__"+t.taxonomy)),e},detailsPanelSetScene:function(t){var s=this.getDetailsContainer(),i=e.hashCode(t),o=s.find('.dgwt-wcas-details-inner[data-object="'+i+'"]');o.length&&(this.preloader("hide","details",""),this.detailsPanelClearScene(),o.addClass("dgwt-wcas-details-inner-active"))},detailsPanelAddToScene:function(t){var s=this.getDetailsContainer(),i=this.cachedDetails[t],o=e.hashCode(t),a="";void 0!==i&&"string"==typeof i.html&&(a=i.html.replace("<div ",'<div data-object="'+o+'" ')),0==s.find('.dgwt-wcas-details-inner[data-object="'+o+'"]').length&&s.append(a)},detailsPanelClearScene:function(){var t=this.getDetailsContainer().find(".dgwt-wcas-details-inner");t.length&&t.removeClass("dgwt-wcas-details-inner-active")},selectFirstSuggestion:function(e){var s=0,i=!1;this.canShowDetailsBox()&&("undefined"!=e&&e.length>0&&t.each(this.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type&&"no-results"!=e.type)return s=t,!1;void 0!==e.type&&"no-results"!==e.type||(i=!0)}),i||(this.latestActivateSource="system",this.getDetails(e[s]),this.activate(s)))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(e){this.getFormWrapper();var s=this.getSuggestionsContainer(),i=this.getDetailsContainer();t.isFunction(this.options.onHide)&&this.visible&&this.options.onHide.call(this.element,container),this.visible=!1,this.selectedIndex=-1,clearTimeout(this.onChangeTimeout),s.hide(),s.removeClass(this.classes.suggestionsContainerOrientTop),i.hide(),t("body").removeClass("dgwt-wcas-open"),t("body").removeClass("dgwt-wcas-block-scroll"),t("body").removeClass("dgwt-wcas-is-details"),t("body").removeClass("dgwt-wcas-full-width"),t("body").removeClass("dgwt-wcas-nores"),t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),null!=this.autoAligmentprocess&&(clearInterval(this.autoAligmentprocess),this.autoAligmentprocess=null),"boolean"==typeof e&&e&&(this.hideCloseButton(),this.currentValue="",this.suggestions=[]),this.signalHint(null)},positionIconSearchMode:function(e){var s=-20,i=e.find("."+this.options.formClass),o=i.width(),a=t(window).width(),n=e[0].getBoundingClientRect().left;i[0].getBoundingClientRect().left;var r=(n+10)/a;s=Math.floor(o*r*-1),s=Math.max(s,-1*n),i.css({left:s+"px"})},hideIconModeSearch:function(){var e=t(".dgwt-wcas-layout-icon-open");e.length>0&&e.removeClass("dgwt-wcas-layout-icon-open")},hideAfterClickOutsideListener:function(){var e=this;e.isMobileMode()||t(document).mouseup(function(s){if(e.visible){e.getSuggestionsContainer(),e.getDetailsContainer();var i=!(t(s.target).closest("."+e.options.searchFormClass).length>0||t(s.target).hasClass(e.options.searchFormClass)),o=!(t(s.target).closest("."+e.options.containerClass).length>0||t(s.target).hasClass(e.options.containerClass));if(e.canShowDetailsBox()){var a=!(t(s.target).closest("."+e.options.containerDetailsClass).length>0||t(s.target).hasClass(e.options.containerDetailsClass));i&&o&&a&&e.hide()}else i&&o&&e.hide()}})},suggest:function(){if(this.suggestions.length){var e,s=this,i=s.options,o=i.groupBy,a=i.formatResult,n=s.getQuery(s.currentValue),r=s.classes.suggestion,l=s.classes.selected,c=s.getSuggestionsContainer(),d=s.getDetailsContainer(),g=t(s.noSuggestionsContainer),u=i.beforeRender,h="";i.triggerSelectOnValidInput&&s.isExactMatch(n)?s.select(0):(t("body").removeClass("dgwt-wcas-nores"),t.each(s.suggestions,function(l,c){var d="",g=!1,u="string"==typeof c.url&&c.url.length?c.url:"#";if(o&&(h+=function(t,s){var i=t.data[o];return e===i?"":'<div class="autocomplete-group"><strong>'+(e=i)+"</strong></div>"}(c,0)),void 0===c.type||"product"!=c.type&&"product_variation"!=c.type){var p,w=r,f="dgwt-wcas-st",m="",v="",b="",y=!0;"product_cat"===c.taxonomy?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>"),void 0!==c.breadcrumbs&&c.breadcrumbs&&(b=c.breadcrumbs+" &gt; "+c.value,v+='<span class="dgwt-wcas-st-breadcrumbs">'+dgwt_wcas.labels.in+" "+c.breadcrumbs+"</span>")):"product_tag"===c.taxonomy?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):i.isPremium&&c.taxonomy===i.taxonomyBrands?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):i.isPremium&&"taxonomy"===c.type?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tax-"+c.taxonomy,i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):i.isPremium&&"vendor"===c.type?(w+=" dgwt-wcas-suggestion-vendor dgwt-wcas-suggestion-vendor",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.vendor+"</span>")):i.isPremium&&"post"===c.type?(w+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.post+"</span>")):i.isPremium&&"page"===c.type?(w+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-page",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.page+"</span>")):"more_products"===c.type?(w+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",f="dgwt-wcas-st-more",c.value=dgwt_wcas.labels.show_more+" ("+c.total+")",y=!1):i.showHeadings&&"headline"===c.type?(w+=" 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"]),y=!1):(w+=" dgwt-wcas-suggestion-nores",c.value=dgwt_wcas.labels.no_results,y=!1,!0===i.showDetailsPanel&&s.detailsPanelClearScene(),t("body").addClass("dgwt-wcas-nores")),void 0!==c.image_src&&c.image_src&&(p=!0),b=b.length>0?' title="'+b+'"':"",h+='<a href="'+u+'" class="'+w+'" data-index="'+l+'">',p&&(h+='<span class="dgwt-wcas-si"><img src="'+c.image_src+'" /></span>',h+='<div class="dgwt-wcas-content-wrapp">'),h+="<span"+b+' class="'+f+'">',"vendor"===c.type?(h+='<span class="dgwt-wcas-st-title">'+m+a(c.value,n,y,i)+v+"</span>",c.shop_city&&(h+='<span class="dgwt-wcas-vendor-city"><span> - </span>'+a(c.shop_city,n,!0,i)+"</span>"),void 0!==c.desc&&c.desc&&(h+='<span class="dgwt-wcas-sd">'+a(c.desc,n,!0,i)+"</span>")):h+=m+a(c.value,n,y,i)+v,h+="</span>",h+=p?"</div>":"",h+="</a>"}else{!0===i.showImage&&void 0!==c.thumb_html&&(g=!0);var C="product_variation"===c.type?" dgwt-wcas-suggestion-product-var":"";if(d+=void 0!==c.post_id?'data-post-id="'+c.post_id+'" ':"",d+=void 0!==c.taxonomy?'data-taxonomy="'+c.taxonomy+'" ':"",d+=void 0!==c.term_id?'data-term-id="'+c.term_id+'" ':"",h+='<a href="'+u+'" class="'+r+" dgwt-wcas-suggestion-product"+C+'" data-index="'+l+'" '+d+">",g&&(h+='<span class="dgwt-wcas-si">'+c.thumb_html+"</span>"),h+=g?'<div class="dgwt-wcas-content-wrapp">':"",h+='<div class="dgwt-wcas-st">',void 0!==c.title_before&&c.title_before&&(h+=c.title_before),h+='<span class="dgwt-wcas-st-title">'+a(c.value,n,!0,i)+"</span>",void 0!==c.title_after&&c.title_after&&(h+=c.title_after),!0===i.showSKU&&void 0!==c.sku&&c.sku.length>0&&(h+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+a(c.sku,n,!0,i)+")</span>"),!0===i.showDescription&&void 0!==c.desc&&c.desc&&(h+='<span class="dgwt-wcas-sd">'+a(c.desc,n,!0,i)+"</span>"),!0===i.showProductVendor&&void 0!==c.vendor&&c.vendor){var _='<span class="dgwt-wcas-product-vendor"><span class="dgwt-wcas-product-vendor-label">'+dgwt_wcas.labels.vendor_sold_by+" </span>"+c.vendor+"</span>";void 0!==c.vendor_url&&c.vendor_url?h+='<span class="dgwt-wcas-product-vendor-link" data-url="'+c.vendor_url+'">'+_+"</span>":h+=_}void 0!==c.content_after&&c.content_after&&(h+=c.content_after),h+="</div>";var x=!0===i.showPrice&&void 0!==c.price,S=void 0!==c.meta_before,P=void 0!==c.meta_after,D=x||S||P;h+=D?'<div class="dgwt-wcas-meta">':"",S&&(h+=c.meta_before),x&&(h+='<span class="dgwt-wcas-sp">'+c.price+"</span>"),P&&(h+=c.meta_after),h+=D?"</div>":"",h+=g?"</div>":"",h+="</a>"}}),this.adjustContainerWidth(),g.detach(),c.html(h),t.isFunction(u)&&u.call(s.element,c,s.suggestions),c.show(),t("body").addClass("dgwt-wcas-open"),s.isMouseDownOnSearchElements=!1,s.automaticAlignment(),!0===i.showDetailsPanel&&(t("body").addClass("dgwt-wcas-is-details"),d.show(),s.fixHeight()),i.autoSelectFirst&&(s.selectedIndex=0,c.scrollTop(0),c.children("."+r).first().addClass(l)),s.visible=!0,s.fixPositionCapture(),"top"===s.options.orientation&&(s.getSuggestionsContainer().addClass(s.classes.suggestionsContainerOrientTop),t("body").addClass("dgwt-wcas-block-scroll"),setTimeout(function(){s.scrollDownSuggestions()},300)),s.findBestHint())}else this.hide()},adjustContainerWidth:function(){var e,s=this.options,i=t("body"),o=this.getFormWrapper(),a=this.getSuggestionsContainer(),n=this.getDetailsContainer(),r=this.getFormOffset();if(o.length){var l=getComputedStyle(o[0]).width;if(l=Math.round(parseFloat(l.replace("px",""))),"auto"===s.width&&(e=this.el.outerWidth(),a.css("width",e+"px")),this.canShowDetailsBox()){if(o.width()>=550)return i.addClass("dgwt-wcas-full-width"),l%2==0?(a.css("width",Math.round(l/2)),n.css("width",Math.round(l/2))):(a.css("width",Math.floor(l/2)),n.css("width",Math.ceil(l/2))),i.removeClass("dgwt-wcas-details-left"),i.removeClass("dgwt-wcas-details-right"),void(!0===s.isRtl?n.css("left","0"):a.css("left",l/2+r.left+"px"));i.addClass("dgwt-wcas-details-right")}}},positionPreloader:function(e){var s="object"==typeof e?e.find(".dgwt-wcas-search-submit"):t(".dgwt-wcas-search-submit");s.length>0&&s.each(function(){var e=t(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader");1==dgwt_wcas.is_rtl?e.css("left",6+t(this).outerWidth()+"px"):e.css("right",t(this).outerWidth()+"px")})},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var o=0===i.value.toLowerCase().indexOf(e);return o&&(s=i),!o}),this.signalHint(s))},signalHint:function(e){var s="";e&&(s=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==s&&(this.hintValue=s,this.hint=e,(this.options.onHint||t.noop)(s))},preloader:function(t,e,s){var i,o,a="dgwt-wcas-preloader-wrapp",n=null==s?a:a+" "+s;if("form"===e){if(1!=dgwt_wcas.show_preloader)return;o=this.getFormWrapper().find(".dgwt-wcas-preloader")}else"details"===e&&(o=this.getDetailsContainer());if(0!=o.length)if("form"!==e){var r=o.find("."+a);if("hide"!==t){if("show"===t){var l=this.options.isRtl?"-rtl":"";i='<div class="'+n+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+l+'.png" /></div>',this.detailsPanelClearScene(),r.length&&r.remove(),o.prepend(i)}}else r.length&&r.remove()}else"hide"===t?(o.removeClass(s),o.html("")):(o.addClass(s),"string"==typeof dgwt_wcas.preloader_icon&&o.html(dgwt_wcas.preloader_icon))},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&&(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&&!t.suggestions.length&&this.badQueries.push(e)),e===this.getQuery(this.currentValue)&&("top"===this.options.orientation&&t.suggestions.reverse(),this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,o=this.getSuggestionsContainer(),a=o.find("."+this.classes.suggestion);return o.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&a.length>this.selectedIndex?(s=a.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.options.disableHits||(this.disableOverlayMobile(),this.hide(),this.onSelect(t))},moveUp:function(){if(-1!==this.selectedIndex){if(this.latestActivateSource="key",0===this.selectedIndex)return this.getSuggestionsContainer().children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint();this.adjustScroll(this.selectedIndex-1,"up")}},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&(this.latestActivateSource="key",this.adjustScroll(this.selectedIndex+1,"down"))},adjustScroll:function(e,s){if("headline"===this.suggestions[e].type&&(e="down"===s?e+1:e-1),void 0!==this.suggestions[e]){var i=this.activate(e);if(this.getDetails(this.suggestions[e]),"more_products"!==this.suggestions[e].type&&i&&!this.canShowDetailsBox()){var o,a,n,r=this.getSuggestionsContainer(),l=t(i).outerHeight();o=i.offsetTop,n=(a=r.scrollTop())+this.options.maxHeight-l,o<a?r.scrollTop(o):o>n&&r.scrollTop(o-this.options.maxHeight+l),this.options.preserveInput||(this.ignoreValueChange=!0),this.signalHint(null)}}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];void 0===i.type||"more_products"!==i.type&&("enter"!==this.actionTriggerSource||"key"==this.latestActivateSource||"product_variation"==i.type)?(this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue.replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," ")),i.url.length>0&&(window.location.href=i.url),this.signalHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&&s.call(this.element,i)):this.el.closest("form").trigger("submit")},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){var e=this.el,s=this.getFormWrapper(),i=this.getSuggestionsContainer(),o=(this.getDetailsContainer(),e.closest("."+this.options.formClass),s.find(".js-dgwt-wcas-enable-mobile-form"));s.length&&s.find("*").each(function(){t(this).off(".autocomplete")});e.removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),s.removeClass("dgwt-wcas-active"),this.close(),o.length&&o.remove(),i.length&&i.html("")},enableOverlayMobile:function(){var e=this;if("on"!==e.overlayMobileState){e.overlayMobileState="on";var s,i=e.getFormWrapper(),o=e.getSuggestionsContainer(),a="";t("html").addClass("dgwt-wcas-overlay-mobile-on"),a+='<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">',a+='<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">',a+='<button class="dgwt-wcas-om-return js-dgwt-wcas-om-return">',"string"==typeof dgwt_wcas.back_icon&&(a+=dgwt_wcas.back_icon),a+="</button>",a+="</div>",a+="</div>",t(e.options.mobileOverlayWrapper).append(a),(s=t(".js-dgwt-wcas-overlay-mobile")).css("zIndex",99999999999),i.after('<span class="js-dgwt-wcas-om-hook"></span>'),i.appendTo(".js-dgwt-wcas-om-bar"),o.appendTo(".js-dgwt-wcas-om-bar"),i.addClass("dgwt-wcas-search-wrapp-mobile"),i.hasClass("dgwt-wcas-has-submit")&&(i.addClass("dgwt-wcas-has-submit-off"),i.removeClass("dgwt-wcas-has-submit")),i.find("."+e.options.searchInputClass).focus(),t(document).on("click.autocomplete",".js-dgwt-wcas-om-return",function(t){e.disableOverlayMobile(s)})}},disableOverlayMobile:function(e){var s=this;if(t("html").hasClass("dgwt-wcas-overlay-mobile-on")){var i=s.getSuggestionsContainer(),o=t(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);o.hasClass("dgwt-wcas-has-submit-off")&&(o.removeClass("dgwt-wcas-has-submit-off"),o.addClass("dgwt-wcas-has-submit")),o.removeClass("dgwt-wcas-search-wrapp-mobile"),t("html").removeClass("dgwt-wcas-overlay-mobile-on"),i.appendTo("body"),i.removeAttr("body-scroll-lock-ignore"),t(".js-dgwt-wcas-om-hook").after(o),t(".js-dgwt-wcas-overlay-mobile").remove(),t(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){o.find("."+s.options.searchInputClass).val("");var t=o.find(".dgwt-wcas-close");o.length>0&&(t.removeClass("dgwt-wcas-close"),t.html("")),s.hide()},150),s.overlayMobileState="off"}},showCloseButton:function(){var t=void 0!==dgwt_wcas.close_icon?dgwt_wcas.close_icon:"",e=this.getFormWrapper().find("."+this.options.preloaderClass);e.addClass(this.options.closeTrigger),e.html(t)},hideCloseButton:function(){var t=this.getFormWrapper().find("."+this.options.closeTrigger);t.length&&(t.removeClass(this.options.closeTrigger),t.html(""))},elementOrParentIsFixed:function(e){var s=e.add(e.parents()),i=!1;return s.each(function(){if("fixed"===t(this).css("position"))return i=!0,!1}),i},gaEvent:function(t,e){var s=!(!window.hasOwnProperty("GoogleAnalyticsObject")||!window.hasOwnProperty(window.GoogleAnalyticsObject))&&window[window.GoogleAnalyticsObject];if(this.options.sendGAEvents)try{if("undefined"!=typeof gtag)gtag("event","autocomplete_search",{event_label:t,event_category:e});else if(!1!==s){var i=s.getAll()[0];i&&i.send({hitType:"event",eventCategory:e,eventAction:"autocomplete_search",eventLabel:t})}}catch(t){}if(this.options.enableGASiteSearchModule)try{if("undefined"!=typeof gtag)gtag("event","page_view",{page_path:"/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"});else if(!1!==s){var o=s.getAll()[0];o&&(o.set("page","/?s="+encodeURI(t)+"&post_type=product&dgwt_wcas=1"),o.send("pageview"))}}catch(t){}}},t.fn.dgwtWcasAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),o=i.data("autocomplete");"string"==typeof e?o&&"function"==typeof o[e]&&o[e](s):(o&&o.dispose&&o.dispose(),o=new d(this,e),i.data("autocomplete",o))}):this.first().data("autocomplete")},t.fn.autocomplete||(t.fn.autocomplete=t.fn.dgwtWcasAutocomplete),function(){function e(){var e=t(".dgwt-wcas-search-input"),s=[];e.length>1&&e.each(function(){var e=t(this).attr("id");if(-1==t.inArray(e,s))s.push(e);else{var i=Math.random().toString(36).substring(2,6);i="dgwt-wcas-search-input-"+i,t(this).attr("id",i),t(this).closest("form").find("label").attr("for",i)}})}function s(){var e=t(".dgwt-wcas-search-input");e.length>0&&e.each(function(){"object"!=typeof t(this).data("autocomplete")&&t(this).dgwtWcasAutocomplete(window.dgwt_wcas.config)})}navigator.userAgent.match(/Trident\/7\./)&&function(t,e){function s(t,e){var s=arguments.length>2?arguments[2]:[];if(!1===a(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(e,s)}function i(t,e,s){var i={value:s,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(t,e,i)}function o(t,e){return t[e]}function a(t){return"function"==typeof t}function n(t){if(null===t||t===e)throw TypeError();return Object(t)}function r(t,s){var i=function(t,e){return n(t)[e]}(t,s);if(null===i||i===e)return e;if(!1===a(i))throw new TypeError("Method not callable: "+s);return i}function l(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in t&&(e instanceof t.Symbol||e.constructor===t.Symbol)?"symbol":"object"}}function c(s){if("object"!==l(s))return!1;var i="Symbol"in t&&"match"in t.Symbol?o(s,t.Symbol.match):e;if(i!==e)return Boolean(i);try{var a=s.lastIndex;return s.lastIndex=0,RegExp.prototype.exec.call(s),!0}catch(t){}finally{s.lastIndex=a}return!1}function d(t,e){return l(t)===l(e)&&("number"===l(t)?!(!isNaN(t)||!isNaN(e))||1/t==1/0&&1/e==-1/0||1/t==-1/0&&1/e==1/0||t===e:function(t,e){return t===e}(t,e))}function g(t){if("symbol"===l(t))throw new TypeError("Cannot convert a Symbol value to a number");var e=Number(t);return isNaN(e)?0:1/e==1/0||1/e==-1/0||e===1/0||e===-1/0?e:(e<0?-1:1)*Math.floor(Math.abs(e))}function u(i){var n=arguments.length>1?arguments[1]:e;if("object"===l(i)){if(arguments.length<2)var c="default";else n===String?c="string":n===Number&&(c="number");var d="function"==typeof t.Symbol&&"symbol"==typeof t.Symbol.toPrimitive?r(i,t.Symbol.toPrimitive):e;if(d!==e){var g=s(d,i,[c]);if("object"!==l(g))return g;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===c&&(c="number"),function(t,e){if("string"===e)var i=["toString","valueOf"];else i=["valueOf","toString"];for(var n=0;n<i.length;++n){var r=o(t,i[n]);if(a(r)){var c=s(r,t);if("object"!==l(c))return c}}throw new TypeError("Cannot convert to primitive.")}(i,c)}return i}function h(t){switch(l(t)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return h(u(t,String));default:return String(t)}}i(Array.prototype,"includes",function(t){var e=n(this),s=function(t){var e=g(t);return e<=0?0:Math.min(e,Math.pow(2,53)-1)}(o(e,"length"));if(0===s)return!1;var i=g(arguments[1]);if(i>=0)var a=i;else(a=s+i)<0&&(a=0);for(;a<s;){if(d(t,o(e,h(a))))return!0;a+=1}return!1}),i(String.prototype,"includes",function(t){var s=arguments.length>1?arguments[1]:e,i=h(function(t){if(null===t||t===e)throw TypeError(Object.prototype.toString.call(t)+" is not coercible to Object.");return t}(this));if(c(t))throw new TypeError("First argument to String.prototype.includes must not be a regular expression");var o=h(t),a=g(s),n=i.length,r=Math.min(Math.max(a,0),n);return-1!==String.prototype.indexOf.call(i,o,r)})}("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),t(document).ready(function(){(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)&&t("html").addClass("dgwt-wcas-is-ios");var e=1==dgwt_wcas.show_details_box,s=dgwt_wcas.mobile_breakpoint;(jQuery(window).width()<s||"ontouchend"in document)&&(e=!1),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:e,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,mobileBreakpoint:s,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)},t(".dgwt-wcas-search-input").dgwtWcasAutocomplete(window.dgwt_wcas.config)}),t(window).on("load",function(){var e=0,s=setInterval(function(){var i=document.activeElement;if("object"==typeof i&&t(i).length&&t(i).hasClass("dgwt-wcas-search-input")){var o=t(i).closest(".dgwt-wcas-search-wrapp");o.length&&!o.hasClass("dgwt-wcas-active")&&(o.addClass("dgwt-wcas-active"),clearInterval(s))}e>10&&clearInterval(s),e++},500)}),t(document).ready(function(){setTimeout(function(){e(),s()},500)}),t(window).on("load",function(){setTimeout(function(){e(),s()},500),void 0!==window.elementorFrontend&&void 0!==window.elementorFrontend.documentsManager&&void 0!==window.elementorFrontend.documentsManager.documents&&t.each(elementorFrontend.documentsManager.documents,function(t,e){void 0!==e.getModal&&e.getModal&&e.getModal().on("show",function(){setTimeout(function(){s()},300)})})})}()});
1
+ !function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports&&"function"==typeof require?t(require("jquery")):t(jQuery)}(function(t){"use strict";var e={escapeRegExChars:function(t){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")},createNode:function(t){var e=document.createElement("div");return e.className=t,e.style.position="absolute",e.style.display="none",e.setAttribute("unselectable","on"),e},highlight:function(t,s){if(dgwt_wcas.is_premium){var i,o=s.split(/ /),a=!1,n="";if(o)for(n=o[o.length-1],o=o.sort(function(t,e){return e.length-t.length}),i=0;i<o.length;i++)if(o[i]&&o[i].length>=1){var r=o[i].replace(/[\^\@]/g,"");if(r.length>0){if(1===r.trim().length&&o[i]!==n)var l="((\\s|^)"+e.escapeRegExChars(r.trim())+"\\s)";else l=1===r.trim().length&&o[i]===n?"((\\s|^)"+e.escapeRegExChars(r.trim())+")":"("+e.escapeRegExChars(r.trim())+")";t=t.replace(new RegExp(l,"gi"),"^^$1@@"),a=!0}}a&&(t=(t=t.replace(/\^\^/g,"<strong>")).replace(/@@/g,"</strong>"))}else l="("+e.escapeRegExChars(s)+")",t=t.replace(new RegExp(l,"gi"),"<strong>$1</strong>");return t},debounce:function(t,e){var i,o=(new Date).getUTCMilliseconds();if(0===s.id.length)return s.id=o,void t();s.id=o,i=setTimeout(function(){o===s.id?(t(),s.id=""):clearTimeout(i)},e)},mouseHoverDebounce:function(e,s,i){var o;o=setTimeout(function(){t(s+":hover").length>0?e():clearTimeout(o)},i)},getActiveInstance:function(){var e,s=t(".dgwt-wcas-search-wrapp.dgwt-wcas-active");return s.length>0&&s.each(function(){var s=t(this).find(".dgwt-wcas-search-input");if("object"==typeof s.data("autocomplete"))return e=s.data("autocomplete"),!1}),e},hashCode:function(t){for(var e=0,s=t.length;s>0;)e=(e<<5)-e+t.charCodeAt(--s)|0;return e<0?-1*e:e}},s={id:"",callback:null,ajaxSettings:null,object:null},i=27,o=9,a=13,n=38,r=39,l=40,c=t.noop;function d(e,s){this.element=e,this.el=t(e),this.suggestions=[],this.badQueries=[],this.selectedIndex=-1,this.currentValue=this.element.value,this.timeoutId=null,this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},this.detailsRequestsSent=[],this.onChangeTimeout=null,this.onChange=null,this.isLocal=!1,this.suggestionsContainer=null,this.detailsContainer=null,this.autoAligmentprocess=null,this.noSuggestionsContainer=null,this.latestActivateSource="",this.actionTriggerSource="",this.options=t.extend(!0,{},d.defaults,s),this.classes={selected:"dgwt-wcas-suggestion-selected",suggestion:"dgwt-wcas-suggestion",suggestionsContainerOrientTop:"dgwt-wcas-suggestions-wrapp--top"},this.hint=null,this.hintValue="",this.selection=null,this.overlayMobileState="off",this.isMouseDownOnSearchElements=!1,this.initialize(),this.setOptions(s)}d.utils=e,t.DgwtWcasAutocompleteSearch=d,d.defaults={ajaxSettings:{},autoSelectFirst:!1,appendTo:"body",serviceUrl:null,lookup:null,onSelect:null,width:"auto",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,deferRequestBy:0,params:{},formatResult:function(t,s,i,o){if(!s)return t;i&&(t=e.highlight(t,s));if(!o.convertHtml)return t;return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&apos;").replace(/&lt;sup/g,"<sup").replace(/&lt;\/sup/g,"</sup").replace(/sup&gt;/g,"sup>").replace(/&lt;(\/?(strong|b|br|span))&gt;/g,"<$1>").replace(/&lt;(strong|span)\s+class\s*=\s*&quot;([^&]+)&quot;&gt;/g,'<$1 class="$2">')},delimiter:null,zIndex:999999999,type:"GET",noCache:!1,isRtl:!1,onSearchStart:c,onSearchComplete:c,onSearchError:c,preserveInput:!1,searchFormClass:"dgwt-wcas-search-wrapp",containerClass:"dgwt-wcas-suggestions-wrapp",containerDetailsClass:"dgwt-wcas-details-wrapp",searchInputClass:"dgwt-wcas-search-input",preloaderClass:"dgwt-wcas-preloader",closeTrigger:"dgwt-wcas-close",formClass:"dgwt-wcas-search-form",tabDisabled:!1,dataType:"text",currentRequest:null,triggerSelectOnValidInput:!0,isPremium:!1,overlayMobile:!1,preventBadQueries:!0,lookupFilter:function(t,e,s){return-1!==t.value.toLowerCase().indexOf(s)},paramName:"query",transformResult:function(t){return"string"==typeof t?JSON.parse(t):t},noSuggestionNotice:"No results",orientation:"bottom",forceFixPosition:!1,positionFixed:!1,debounceWaitMs:400,sendGAEvents:!0,enableGASiteSearchModule:!1,showProductVendor:!1,disableHits:!1,disableSubmit:!1},d.prototype={initialize:function(){var s=this;s.element.setAttribute("autocomplete","off"),s.createContainers(),s.registerEventsSearchBar(),s.registerEventsSuggestions(),s.registerEventsDetailsPanel(),s.registerIconHandler(),s.registerEventsFixedMenu(),s.fixPositionCapture=function(){s.adjustContainerWidth(),s.visible&&s.fixPosition()},t(window).on("resize.autocomplete",function(){var t=e.getActiveInstance();void 0!==t&&t.fixPositionCapture()}),s.initMobileMode(),s.hideAfterClickOutsideListener(),s.suggestionsContainer.addClass("js-dgwt-wcas-initialized"),s.detailsContainer&&s.detailsContainer.length>0&&s.detailsContainer.addClass("js-dgwt-wcas-initialized")},createContainers:function(e){var s=this.options;0==t("."+s.containerClass).length?(this.suggestionsContainer=t(d.utils.createNode(s.containerClass)),this.suggestionsContainer.appendTo(s.appendTo||"body"),this.suggestionsContainer.addClass("woocommerce"),!0===s.showImage&&this.suggestionsContainer.addClass("dgwt-wcas-has-img"),!0===s.showPrice&&this.suggestionsContainer.addClass("dgwt-wcas-has-price"),!0===s.showDescription&&this.suggestionsContainer.addClass("dgwt-wcas-has-desc"),!0===s.showSKU&&this.suggestionsContainer.addClass("dgwt-wcas-has-sku"),!0===s.showHeadings&&this.suggestionsContainer.addClass("dgwt-wcas-has-headings"),"auto"!==s.width&&this.suggestionsContainer.width(s.width)):this.suggestionsContainer=t("."+this.options.containerClass),this.canShowDetailsBox()&&(0==t("."+s.containerDetailsClass).length?(this.detailsContainer=t(d.utils.createNode(s.containerDetailsClass)),this.detailsContainer.appendTo(s.appendTo||"body"),this.detailsContainer.addClass("woocommerce")):this.detailsContainer=t("."+s.containerDetailsClass))},registerEventsSearchBar:function(){var s=this;t(document).on("click.autocomplete","."+s.options.closeTrigger,function(){e.getActiveInstance().close()}),s.el.closest("."+s.options.formClass).on("submit.autocomplete",function(e){if(s.options.disableSubmit)return e.preventDefault(),!1;var i=t(this).find("."+s.options.searchInputClass);if(i.length&&0===i.val().length)return e.preventDefault(),!1;s.suggestions.length>0&&t.each(s.suggestions,function(t,i){if(void 0!==i.type&&"product_variation"==i.type)return s.select(t),e.preventDefault(),!1}),s.disableOverlayMobile()}),"complete"===document.readyState?s.positionPreloader():t(window).on("load",function(){s.positionPreloader()}),s.el.on("keydown.autocomplete",function(t){s.onKeyPress(t)}),s.el.on("keyup.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("blur.autocomplete",function(){s.onBlur()}),s.el.on("focus.autocomplete",function(){s.onFocus()}),s.el.on("change.autocomplete",function(t){s.onKeyUp(t)}),s.el.on("input.autocomplete",function(t){s.onKeyUp(t)})},registerEventsSuggestions:function(){var s="."+this.classes.suggestion;if(!this.getSuggestionsContainer().hasClass("js-dgwt-wcas-initialized")){t(document).on("mouseenter.autocomplete",s,function(){var s=e.getActiveInstance();if(void 0!==s){var i=t(this).data("index"),o='.dgwt-wcas-suggestion[data-index="'+i+'"]',a=s.canShowDetailsBox()?100:1;s.selectedIndex!=i&&e.mouseHoverDebounce(function(){s.selectedIndex!==i&&(s.latestActivateSource="mouse",s.getDetails(s.suggestions[i]),s.activate(i))},o,a)}});var i=!1;t(document).on("click.autocomplete",s,function(s){if(i)s.preventDefault();else{var o=e.getActiveInstance();o.actionTriggerSource="click",i=!0,setTimeout(function(){i=!1},500),void 0!==s.ctrlKey&&!1!==s.ctrlKey||(o.select(t(this).data("index")),s.preventDefault())}}),t(document).on("mousedown.autocomplete",s,function(s){var o=this;0===s.button&&setTimeout(function(){i||e.getActiveInstance().select(t(o).data("index"))},250)}),t("."+this.options.containerClass).on("mousedown.autocomplete",function(t){e.getActiveInstance().isMouseDownOnSearchElements=!0})}},registerEventsDetailsPanel:function(){var s=this.getDetailsContainer();this.canShowDetailsBox()&&!s.hasClass("js-dgwt-wcas-initialized")&&(t(document).on("change.autocomplete",'[name="js-dgwt-wcas-quantity"]',function(e){t(this).closest(".js-dgwt-wcas-pd-addtc").find("[data-quantity]").attr("data-quantity",t(this).val())}),t("."+this.options.containerDetailsClass).on("mousedown.autocomplete",function(t){e.getActiveInstance().isMouseDownOnSearchElements=!0}))},registerIconHandler:function(){var s=this,i=s.getFormWrapper(),o=i.find("."+s.options.formClass);i.on("click.autocomplete",".js-dgwt-wcas-search-icon-handler",function(t){var e=i.find("."+s.options.searchInputClass);if(i.hasClass("dgwt-wcas-layout-icon-open"))s.hide(),o.hide(!0),i.removeClass("dgwt-wcas-layout-icon-open");else{var a=i.find(".dgwt-wcas-search-icon-arrow");o.hide(),a.hide(),i.addClass("dgwt-wcas-layout-icon-open"),s.positionIconSearchMode(i),o.fadeIn(200,function(){a.show(),s.positionPreloader(i),e.focus()})}}),0==t(".js-dgwt-wcas-initialized").length&&t(".js-dgwt-wcas-search-icon-handler").length>0&&t(document).on("click.autocomplete",function(i){if(t(".dgwt-wcas-layout-icon-open").length){var o=t(i.target);if(!(o.closest("."+s.options.searchFormClass).length>0||o.closest("."+s.options.containerClass).length>0||o.closest("."+s.options.containerDetailsClass).length>0)){var a=e.getActiveInstance();if(void 0!==a){var n=a.getFormWrapper().find("."+s.options.formClass);n.hide(),a.hide(!0),n.css({left:"0"})}s.hideIconModeSearch()}}}),t(window).on("resize.autocomplete",function(){s.applyFlexibleMode()}),"complete"==document.readyState?s.applyFlexibleMode():t(window).on("load.autocomplete",function(){s.applyFlexibleMode()})},registerEventsFixedMenu:function(){var e=this;t(window).on("scroll.autocomplete",function(){if(e.suggestions.length>0&&e.elementOrParentIsFixed(e.getFormWrapper()))if(0===t(window).scrollTop()){[1,10,20,30,40,50,60,70,80,90,120,140,170,200,250,400,700,1e3,2e3].forEach(function(t){setTimeout(function(){e.fixHeight(),e.fixPositionCapture()},t)})}else e.fixHeight(),e.fixPositionCapture()})},initMobileMode:function(){var t=this,e=t.getFormWrapper();e.hasClass("js-dgwt-wcas-mobile-overlay-enabled")&&t.isMobileMode()&&(e.prepend('<div class="js-dgwt-wcas-enable-mobile-form dgwt-wcas-enable-mobile-form"></div>'),e.find(".js-dgwt-wcas-enable-mobile-form").on("click.autocomplete",function(e){t.options.mobileOverlayDelay>0?setTimeout(function(){t.enableOverlayMobile()},t.options.mobileOverlayDelay):t.enableOverlayMobile()}))},applyFlexibleMode:function(){var e=t(".js-dgwt-wcas-layout-icon-flexible");e.length&&(this.isMobileMode()?(e.addClass("js-dgwt-wcas-layout-icon"),e.addClass("dgwt-wcas-layout-icon")):(e.removeClass("js-dgwt-wcas-layout-icon"),e.removeClass("dgwt-wcas-layout-icon")),e.addClass("dgwt-wcas-layout-icon-flexible-loaded"))},onFocus:function(){t("."+this.options.searchFormClass).removeClass("dgwt-wcas-active"),this.getFormWrapper().addClass("dgwt-wcas-active"),this.fixPositionCapture(),this.el.val().length>=this.options.minChars&&this.onValueChange()},onBlur:function(){var e=this.options,s=this.el.val(),i=this.getQuery(s);this.isMobileMode()||this.isMouseDownOnSearchElements||(this.hide(),this.selection&&this.currentValue!==i&&(e.onInvalidateSelection||t.noop).call(this.element))},abortAjax:function(){this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null)},setOptions:function(e){var s=this,i=s.getSuggestionsContainer(),o=t.extend({},s.options,e);(s.isLocal=Array.isArray(o.lookup),s.isLocal&&(o.lookup=s.verifySuggestionsFormat(o.lookup)),o.orientation=s.validateOrientation(o.orientation,"bottom"),i.css({"max-height":s.canShowDetailsBox()?"none":o.maxHeight+"px",width:o.width+"px","z-index":o.zIndex}),!0===o.showDetailsPanel)&&s.getDetailsContainer().css({"z-index":o.zIndex-1});o.onSearchComplete=function(){s.getFormWrapper().removeClass("dgwt-wcas-processing"),s.preloader("hide","form","dgwt-wcas-inner-preloader"),s.showCloseButton()},this.options=o},clearCache:function(){this.cachedResponse={},this.cachedDetails={},this.cachedPrices={},this.badQueries=[]},clear:function(t){t&&this.clearCache(),this.currentValue="",this.suggestions=[]},close:function(){this.hide(),this.clear(!1),this.hideCloseButton(),this.el.closest("."+this.options.searchFormClass).find("."+this.options.searchInputClass).val("").focus()},disable:function(){this.disabled=!0,clearTimeout(this.onChangeTimeout),this.abortAjax()},enable:function(){this.disabled=!1},fixPosition:function(){var t=this.getFormOffset();this.getSuggestionsContainer().css(t),this.canShowDetailsBox()&&this.fixPositionDetailsBox()},fixPositionDetailsBox:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.getDetailsContainer(),o=this.getFormOffset(),a=o.left;if(0==i.length)return!1;var n=!0===this.options.isRtl?1:2,r=Math.round(o.left);if(o.left=r+Math.round(s.width()+n),i.css(o),e.width()>=550)return t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),void(!0===this.options.isRtl&&(s.css("left",r+Math.round(i.width()+n)+"px"),i.css("left",a+"px")));var l=t(window).width(),c=i.width(),d=i.offset();t("body").addClass("dgwt-wcas-details-outside"),!0===this.options.isRtl&&(o.left=o.left+1);var g=!1,u=!1;l<d.left+c&&(g=!0,t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-left"),i.css("left",Math.round(parseFloat(s.css("left").replace("px","")))-i.outerWidth()+"px")),(d=i.offset()).left<1&&(u=!0,t("body").removeClass("dgwt-wcas-details-left"),t("body").addClass("dgwt-wcas-details-right")),u&&g?(t("body").removeClass("dgwt-wcas-details-left"),t("body").removeClass("dgwt-wcas-details-right"),t("body").addClass("dgwt-wcas-details-notfit")):t("body").removeClass("dgwt-wcas-details-notfit")},fixHeight:function(){if(1!=this.options.showDetailsPanel)return!1;var t=this.getSuggestionsContainer(),e=this.getDetailsContainer();t.css("height","auto"),e.css("height","auto");var s=t.outerHeight(!1),i=e.outerHeight(!1);return t.find(".dgwt-wcas-suggestion:last-child").removeClass("dgwt-wcas-suggestion-no-border-bottom"),!(s<=340&&i<=340)&&(t.find(".dgwt-wcas-suggestion:last-child").addClass("dgwt-wcas-suggestion-no-border-bottom"),i<s&&e.css("height",s+"px"),s<i&&t.css("height",i+"px"),!1)},automaticAlignment:function(){var t=this,e=t.getFormWrapper().find(".dgwt-wcas-search-input"),s=t.getSuggestionsContainer(),i=t.getDetailsContainer();if(null==t.autoAligmentprocess){var o=[e.width(),s.height()];t.options.showDetailsPanel&&(o[2]=i.height()),t.autoAligmentprocess=setInterval(function(){var a=[e.width(),s.height()];t.options.showDetailsPanel&&(a[2]=i.height());for(var n=0;n<o.length;n++)if(o[n]!=a[n]){t.fixHeight(),t.fixPositionCapture(),o=a;break}t.options.showDetailsPanel&&(i.find(".dgwt-wcas-details-inner").height()-i.height()>2&&t.fixHeight())},10)}},getFormOffset:function(){var e=this.getFormWrapper(),s=this.getSuggestionsContainer(),i=this.options.orientation,o=e.outerHeight(!1),a=this.el.outerHeight(!1),n=this.el.offset(),r={top:n.top,left:n.left};if("auto"===i){var l=t(window).height(),c=t(window).scrollTop(),d=-c+n.top-o,g=c+l-(n.top+a+o);i=Math.max(d,g)===d?"top":"bottom"}if("top"===i){s[0].getBoundingClientRect().top;var u=e[0].getBoundingClientRect().top;s.css("height","auto"),u<s.height()&&s.height(u-10),r.top+=-s.outerHeight(!1)}else r.top+=a;return r},getFormWrapper:function(){return this.el.closest("."+this.options.searchFormClass)},getSuggestionsContainer:function(){return t("."+this.options.containerClass)},getDetailsContainer:function(){return t("."+this.options.containerDetailsClass)},scrollDownSuggestions:function(){var t=this.getSuggestionsContainer();t[0].scrollTop=t[0].scrollHeight},isCursorAtEnd:function(){var t,e=this.el.val().length,s=this.element.selectionStart;return"number"==typeof s?s===e:!document.selection||((t=document.selection.createRange()).moveStart("character",-e),e===t.text.length)},onKeyPress:function(t){if(this.disabled||this.visible||t.which!==l||!this.currentValue){if(!this.disabled&&this.visible){switch(t.which){case i:this.el.val(this.currentValue),this.hide();break;case r:if(this.hint&&this.options.onHint&&this.isCursorAtEnd()){this.selectHint();break}return;case o:if(this.hint&&this.options.onHint)return void this.selectHint();if(-1===this.selectedIndex)return void this.hide();if(this.select(this.selectedIndex),!1===this.options.tabDisabled)return;break;case a:if(-1===this.selectedIndex)return!this.options.disableSubmit&&void this.hide();this.actionTriggerSource="enter",this.select(this.selectedIndex);break;case n:this.moveUp();break;case l:this.moveDown();break;default:return}t.stopImmediatePropagation(),t.preventDefault()}}else this.suggest()},onKeyUp:function(t){var e=this;if(!e.disabled){switch(t.which){case n:case l:return}clearTimeout(e.onChangeTimeout),e.currentValue!==e.el.val()&&(e.findBestHint(),e.options.deferRequestBy>0?e.onChangeTimeout=setTimeout(function(){e.onValueChange()},e.options.deferRequestBy):e.onValueChange())}},onValueChange:function(){if(this.ignoreValueChange)this.ignoreValueChange=!1;else{var e=this.options,s=this.el.val(),i=this.getQuery(s);this.selection&&this.currentValue!==i&&(this.selection=null,(e.onInvalidateSelection||t.noop).call(this.element)),clearTimeout(this.onChangeTimeout),this.currentValue=s,this.selectedIndex=-1,e.triggerSelectOnValidInput&&this.isExactMatch(i)?this.select(0):i.length<e.minChars?(this.hideCloseButton(),this.hide()):this.getSuggestions(i)}},isExactMatch:function(t){var e=this.suggestions;return 1===e.length&&e[0].value.toLowerCase()===t.toLowerCase()},canShowDetailsBox:function(){return 1==this.options.showDetailsPanel&&!this.isMobileMode()},isMobileMode:function(){return t(window).width()<this.options.mobileBreakpoint},getQuery:function(e){var s,i=this.options.delimiter;return i?(s=e.split(i),t.trim(s[s.length-1])):e.trim()},getSuggestionsLocal:function(e){var s,i=this.options,o=e.toLowerCase(),a=i.lookupFilter,n=parseInt(i.lookupLimit,10);return s={suggestions:t.grep(i.lookup,function(t){return a(t,e,o)})},n&&s.suggestions.length>n&&(s.suggestions=s.suggestions.slice(0,n)),s},getSuggestions:function(i){var o,a,n,r,l=this,c=l.options,d=c.serviceUrl,g=l.getFormWrapper();c.params[c.paramName]=i,void 0!==dgwt_wcas.current_lang&&(c.params.l=dgwt_wcas.current_lang),c.params=l.applyCustomParams(c.params),l.preloader("show","form","dgwt-wcas-inner-preloader"),g.addClass("dgwt-wcas-processing"),!1!==c.onSearchStart.call(l.element,c.params)&&(a=c.ignoreParams?null:c.params,t.isFunction(c.lookup)?c.lookup(i,function(t){l.suggestions=t.suggestions,l.suggest(),l.selectFirstSuggestion(t.suggestions),c.onSearchComplete.call(l.element,i,t.suggestions)}):(l.isLocal?o=l.getSuggestionsLocal(i):(t.isFunction(d)&&(d=d.call(l.element,i)),n=d+"?"+t.param(a||{}),o=l.cachedResponse[n]),o&&Array.isArray(o.suggestions)?(l.suggestions=o.suggestions,l.suggest(),l.selectFirstSuggestion(o.suggestions),c.onSearchComplete.call(l.element,i,o.suggestions)):l.isBadQuery(i)?c.onSearchComplete.call(l.element,i,[]):(l.abortAjax(),r={url:d,data:a,type:c.type,dataType:c.dataType},t.extend(r,c.ajaxSettings),s.object=l,s.ajaxSettings=r,e.debounce(function(){var e=s.object,o=s.ajaxSettings;e.currentRequest=t.ajax(o).done(function(t){var s;e.currentRequest=null,void 0!==(s=e.options.transformResult(t,i)).suggestions&&(e.processResponse(s,i,n),e.selectFirstSuggestion(s.suggestions),1===s.suggestions.length&&void 0!==s.suggestions[0].type&&"no-results"===s.suggestions[0].type?e.gaEvent(i,"Autocomplete Search without results"):e.gaEvent(i,"Autocomplete Search with results")),e.fixPositionCapture(),e.options.onSearchComplete.call(e.element,i,s.suggestions),e.updatePrices()}).fail(function(t,s,o){e.options.onSearchError.call(e.element,i,t,s,o)})},c.debounceWaitMs))))},getDetails:function(e){var s=this;if(!s.canShowDetailsBox())return!1;if(null!=e&&void 0!==e.type&&("string"!=typeof e.type||"more_products"!==e.type)){s.fixHeight();s.getDetailsContainer();var i=s.prepareSuggestionObjectID(e);if(null!=s.cachedDetails[i])s.detailsPanelSetScene(i),s.fixHeight(),s.fixPositionCapture();else{var o={action:dgwt_wcas.action_result_details,items:[]};if(t.each(s.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type){var i={objectID:s.prepareSuggestionObjectID(e),value:null!=e.value?e.value:""};o.items.push(i)}}),s.detailsPanelClearScene(),s.preloader("show","details",""),-1!=t.inArray(i,s.detailsRequestsSent))return;s.detailsRequestsSent.push(i),t.ajax({data:o,type:"post",url:dgwt_wcas.ajax_details_endpoint,success:function(t){var e="string"==typeof t?JSON.parse(t):t;if(void 0!==e.items)for(var i=0;i<e.items.length;i++){var o=e.items[i].objectID;s.cachedDetails[o]={html:e.items[i].html},s.detailsPanelAddToScene(o),void 0!==e.items[i].price&&e.items[i].price.length>0&&(s.cachedPrices[o]=e.items[i].price)}s.preloader("hide","details","");var a=s.prepareSuggestionObjectID(s.suggestions[s.selectedIndex]);null!=s.cachedDetails[a]?s.detailsPanelSetScene(a):s.detailsPanelClearScene(),s.fixPositionCapture(),s.fixHeight(),s.updatePrices(!0)},error:function(t,e){s.preloader("hide","details",""),s.detailsPanelClearScene(),s.fixPositionCapture(),s.fixHeight()}})}t(document).trigger("dgwtWcasDetailsPanelLoaded",s)}},updatePrices:function(e){var s,i,o=this,a=[];if(o.options.showPrice&&o.options.dynamicPrices&&0!=o.suggestions.length){for(s=0;s<o.suggestions.length;s++)if(void 0!==o.suggestions[s].type&&("product"==o.suggestions[s].type||"product_variation"==o.suggestions[s].type)){var n="product__"+o.suggestions[s].post_id;void 0!==o.cachedPrices[n]?o.updatePrice(s,o.cachedPrices[n]):(o.applyPreloaderForPrice(s),a.push(o.suggestions[s].post_id))}if(!e&&a.length>0){var r={action:void 0===dgwt_wcas.action_get_prices?"dgwt_wcas_get_prices":dgwt_wcas.action_get_prices,items:a};t.ajax({data:r,type:"post",url:dgwt_wcas.ajax_prices_endpoint,success:function(t){if(void 0!==t.success&&t.success&&t.data.length>0)for(s=0;s<t.data.length;s++){var e=t.data[s].id,a=t.data[s].price;if(o.suggestions.length>0)for(i=0;i<o.suggestions.length;i++)if(void 0!==o.suggestions[i].type&&("product"==o.suggestions[i].type||"product_variation"==o.suggestions[i].type)&&o.suggestions[i].post_id==e){var n="product__"+e;o.cachedPrices[n]=a,o.updatePrice(i,a)}}},error:function(t,e){}})}}},updatePrice:function(e,s){if(void 0!==this.suggestions[e]){this.suggestions[e].price=s;var i=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');i.length&&i.html(s)}},applyCustomParams:function(t){if("object"==typeof dgwt_wcas.custom_params){var e=dgwt_wcas.custom_params;for(var s in e)t[s]=e[s]}var i=this.el.data("custom-params");if("object"==typeof i)for(var s in i)t[s]=i[s];return t},applyPreloaderForPrice:function(e){if(void 0!==this.suggestions[e]){var s=t(".dgwt-wcas-suggestions-wrapp").find('[data-index="'+e+'"] .dgwt-wcas-sp');s.length&&s.html('<div class="dgwt-wcas-preloader-price"><div class="dgwt-wcas-preloader-price-inner"> <div></div><div></div><div></div></div></div>')}},prepareSuggestionObjectID:function(t){var e="";return void 0!==t&&void 0!==t.type&&(null!=t.post_id&&(e=t.type+"__"+t.post_id,"product_variation"===t.type&&(e+="__"+t.variation_id),void 0!==t.post_type&&(e=t.type+"__"+t.post_id+"__"+t.post_type)),null!=t.term_id&&null!=t.taxonomy&&(e=t.type+"__"+t.term_id+"__"+t.taxonomy)),e},detailsPanelSetScene:function(t){var s=this.getDetailsContainer(),i=e.hashCode(t),o=s.find('.dgwt-wcas-details-inner[data-object="'+i+'"]');o.length&&(this.preloader("hide","details",""),this.detailsPanelClearScene(),o.addClass("dgwt-wcas-details-inner-active"))},detailsPanelAddToScene:function(t){var s=this.getDetailsContainer(),i=this.cachedDetails[t],o=e.hashCode(t),a="";void 0!==i&&"string"==typeof i.html&&(a=i.html.replace("<div ",'<div data-object="'+o+'" ')),0==s.find('.dgwt-wcas-details-inner[data-object="'+o+'"]').length&&s.append(a)},detailsPanelClearScene:function(){var t=this.getDetailsContainer().find(".dgwt-wcas-details-inner");t.length&&t.removeClass("dgwt-wcas-details-inner-active")},selectFirstSuggestion:function(e){var s=0,i=!1;this.canShowDetailsBox()&&("undefined"!=e&&e.length>0&&t.each(this.suggestions,function(t,e){if(void 0!==e.type&&"more_products"!=e.type&&"headline"!=e.type&&"no-results"!=e.type)return s=t,!1;void 0!==e.type&&"no-results"!==e.type||(i=!0)}),i||(this.latestActivateSource="system",this.getDetails(e[s]),this.activate(s)))},isBadQuery:function(t){if(!this.options.preventBadQueries)return!1;for(var e=this.badQueries,s=e.length;s--;)if(0===t.indexOf(e[s]))return!0;return!1},hide:function(e){this.getFormWrapper();var s=this.getSuggestionsContainer(),i=this.getDetailsContainer();t.isFunction(this.options.onHide)&&this.visible&&this.options.onHide.call(this.element,container),this.visible=!1,this.selectedIndex=-1,clearTimeout(this.onChangeTimeout),s.hide(),s.removeClass(this.classes.suggestionsContainerOrientTop),i.hide(),t("body").removeClass("dgwt-wcas-open"),t("body").removeClass("dgwt-wcas-block-scroll"),t("body").removeClass("dgwt-wcas-is-details"),t("body").removeClass("dgwt-wcas-full-width"),t("body").removeClass("dgwt-wcas-nores"),t("body").removeClass("dgwt-wcas-details-outside"),t("body").removeClass("dgwt-wcas-details-right"),t("body").removeClass("dgwt-wcas-details-left"),null!=this.autoAligmentprocess&&(clearInterval(this.autoAligmentprocess),this.autoAligmentprocess=null),"boolean"==typeof e&&e&&(this.hideCloseButton(),this.currentValue="",this.suggestions=[]),this.signalHint(null)},positionIconSearchMode:function(e){var s=-20,i=e.find("."+this.options.formClass),o=i.width(),a=t(window).width(),n=e[0].getBoundingClientRect().left;i[0].getBoundingClientRect().left;var r=(n+10)/a;s=Math.floor(o*r*-1),s=Math.max(s,-1*n),i.css({left:s+"px"})},hideIconModeSearch:function(){var e=t(".dgwt-wcas-layout-icon-open");e.length>0&&e.removeClass("dgwt-wcas-layout-icon-open")},hideAfterClickOutsideListener:function(){var e=this;e.isMobileMode()||t(document).mouseup(function(s){if(e.visible){e.getSuggestionsContainer(),e.getDetailsContainer();var i=!(t(s.target).closest("."+e.options.searchFormClass).length>0||t(s.target).hasClass(e.options.searchFormClass)),o=!(t(s.target).closest("."+e.options.containerClass).length>0||t(s.target).hasClass(e.options.containerClass));if(e.canShowDetailsBox()){var a=!(t(s.target).closest("."+e.options.containerDetailsClass).length>0||t(s.target).hasClass(e.options.containerDetailsClass));i&&o&&a&&e.hide()}else i&&o&&e.hide()}})},suggest:function(){if(this.suggestions.length){var e,s=this,i=s.options,o=i.groupBy,a=i.formatResult,n=s.getQuery(s.currentValue),r=s.classes.suggestion,l=s.classes.selected,c=s.getSuggestionsContainer(),d=s.getDetailsContainer(),g=t(s.noSuggestionsContainer),u=i.beforeRender,h="";i.triggerSelectOnValidInput&&s.isExactMatch(n)?s.select(0):(t("body").removeClass("dgwt-wcas-nores"),t.each(s.suggestions,function(l,c){var d="",g=!1,u="string"==typeof c.url&&c.url.length?c.url:"#";if(o&&(h+=function(t,s){var i=t.data[o];return e===i?"":'<div class="autocomplete-group"><strong>'+(e=i)+"</strong></div>"}(c,0)),void 0===c.type||"product"!=c.type&&"product_variation"!=c.type){var p,w=r,f="dgwt-wcas-st",m="",v="",b="",y=!0;"product_cat"===c.taxonomy?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-cat",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>"),void 0!==c.breadcrumbs&&c.breadcrumbs&&(b=c.breadcrumbs+" &gt; "+c.value,v+='<span class="dgwt-wcas-st-breadcrumbs">'+dgwt_wcas.labels.in+" "+c.breadcrumbs+"</span>")):"product_tag"===c.taxonomy?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tag",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):i.isPremium&&c.taxonomy===i.taxonomyBrands?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-brand",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):i.isPremium&&"taxonomy"===c.type?(w+=" dgwt-wcas-suggestion-tax dgwt-wcas-suggestion-tax-"+c.taxonomy,i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels["tax_"+c.taxonomy]+"</span>")):i.isPremium&&"vendor"===c.type?(w+=" dgwt-wcas-suggestion-vendor dgwt-wcas-suggestion-vendor",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.vendor+"</span>")):i.isPremium&&"post"===c.type?(w+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-tp-post",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.post+"</span>")):i.isPremium&&"page"===c.type?(w+=" dgwt-wcas-suggestion-pt dgwt-wcas-suggestion-pt-page",i.showHeadings||(m+='<span class="dgwt-wcas-st--direct-headline">'+dgwt_wcas.labels.page+"</span>")):"more_products"===c.type?(w+=" js-dgwt-wcas-suggestion-more dgwt-wcas-suggestion-more",f="dgwt-wcas-st-more",c.value=dgwt_wcas.labels.show_more+" ("+c.total+")",y=!1):i.showHeadings&&"headline"===c.type?(w+=" 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"]),y=!1):(w+=" dgwt-wcas-suggestion-nores",c.value=dgwt_wcas.labels.no_results,y=!1,!0===i.showDetailsPanel&&s.detailsPanelClearScene(),t("body").addClass("dgwt-wcas-nores")),void 0!==c.image_src&&c.image_src&&(p=!0),b=b.length>0?' title="'+b+'"':"",h+='<a href="'+u+'" class="'+w+'" data-index="'+l+'">',p&&(h+='<span class="dgwt-wcas-si"><img src="'+c.image_src+'" /></span>',h+='<div class="dgwt-wcas-content-wrapp">'),h+="<span"+b+' class="'+f+'">',"vendor"===c.type?(h+='<span class="dgwt-wcas-st-title">'+m+a(c.value,n,y,i)+v+"</span>",c.shop_city&&(h+='<span class="dgwt-wcas-vendor-city"><span> - </span>'+a(c.shop_city,n,!0,i)+"</span>"),void 0!==c.desc&&c.desc&&(h+='<span class="dgwt-wcas-sd">'+a(c.desc,n,!0,i)+"</span>")):h+=m+a(c.value,n,y,i)+v,h+="</span>",h+=p?"</div>":"",h+="</a>"}else{!0===i.showImage&&void 0!==c.thumb_html&&(g=!0);var C="product_variation"===c.type?" dgwt-wcas-suggestion-product-var":"";if(d+=void 0!==c.post_id?'data-post-id="'+c.post_id+'" ':"",d+=void 0!==c.taxonomy?'data-taxonomy="'+c.taxonomy+'" ':"",d+=void 0!==c.term_id?'data-term-id="'+c.term_id+'" ':"",h+='<a href="'+u+'" class="'+r+" dgwt-wcas-suggestion-product"+C+'" data-index="'+l+'" '+d+">",g&&(h+='<span class="dgwt-wcas-si">'+c.thumb_html+"</span>"),h+=g?'<div class="dgwt-wcas-content-wrapp">':"",h+='<div class="dgwt-wcas-st">',void 0!==c.title_before&&c.title_before&&(h+=c.title_before),h+='<span class="dgwt-wcas-st-title">'+a(c.value,n,!0,i)+"</span>",void 0!==c.title_after&&c.title_after&&(h+=c.title_after),!0===i.showSKU&&void 0!==c.sku&&c.sku.length>0&&(h+='<span class="dgwt-wcas-sku">('+dgwt_wcas.labels.sku_label+" "+a(c.sku,n,!0,i)+")</span>"),!0===i.showDescription&&void 0!==c.desc&&c.desc&&(h+='<span class="dgwt-wcas-sd">'+a(c.desc,n,!0,i)+"</span>"),!0===i.showProductVendor&&void 0!==c.vendor&&c.vendor){var _='<span class="dgwt-wcas-product-vendor"><span class="dgwt-wcas-product-vendor-label">'+dgwt_wcas.labels.vendor_sold_by+" </span>"+c.vendor+"</span>";void 0!==c.vendor_url&&c.vendor_url?h+='<span class="dgwt-wcas-product-vendor-link" data-url="'+c.vendor_url+'">'+_+"</span>":h+=_}void 0!==c.content_after&&c.content_after&&(h+=c.content_after),h+="</div>";var x=!0===i.showPrice&&void 0!==c.price,S=void 0!==c.meta_before,P=void 0!==c.meta_after,D=x||S||P;h+=D?'<div class="dgwt-wcas-meta">':"",S&&(h+=c.meta_before),x&&(h+='<span class="dgwt-wcas-sp">'+c.price+"</span>"),P&&(h+=c.meta_after),h+=D?"</div>":"",h+=g?"</div>":"",h+="</a>"}}),this.adjustContainerWidth(),g.detach(),c.html(h),t.isFunction(u)&&u.call(s.element,c,s.suggestions),c.show(),t("body").addClass("dgwt-wcas-open"),s.isMouseDownOnSearchElements=!1,s.automaticAlignment(),!0===i.showDetailsPanel&&(t("body").addClass("dgwt-wcas-is-details"),d.show(),s.fixHeight()),i.autoSelectFirst&&(s.selectedIndex=0,c.scrollTop(0),c.children("."+r).first().addClass(l)),s.visible=!0,s.fixPositionCapture(),"top"===s.options.orientation&&(s.getSuggestionsContainer().addClass(s.classes.suggestionsContainerOrientTop),t("body").addClass("dgwt-wcas-block-scroll"),setTimeout(function(){s.scrollDownSuggestions()},300)),s.findBestHint())}else this.hide()},adjustContainerWidth:function(){var e,s=this.options,i=t("body"),o=this.getFormWrapper(),a=this.getSuggestionsContainer(),n=this.getDetailsContainer(),r=this.getFormOffset();if(o.length){var l=getComputedStyle(o[0]).width;if(l=Math.round(parseFloat(l.replace("px",""))),"auto"===s.width&&(e=this.el.outerWidth(),a.css("width",e+"px")),this.canShowDetailsBox()){if(o.width()>=550)return i.addClass("dgwt-wcas-full-width"),l%2==0?(a.css("width",Math.round(l/2)),n.css("width",Math.round(l/2))):(a.css("width",Math.floor(l/2)),n.css("width",Math.ceil(l/2))),i.removeClass("dgwt-wcas-details-left"),i.removeClass("dgwt-wcas-details-right"),void(!0===s.isRtl?n.css("left","0"):a.css("left",l/2+r.left+"px"));i.addClass("dgwt-wcas-details-right")}}},positionPreloader:function(e){var s="object"==typeof e?e.find(".dgwt-wcas-search-submit"):t(".dgwt-wcas-search-submit");s.length>0&&s.each(function(){var e=t(this).closest(".dgwt-wcas-search-wrapp").find(".dgwt-wcas-preloader");1==dgwt_wcas.is_rtl?e.css("left",6+t(this).outerWidth()+"px"):e.css("right",t(this).outerWidth()+"px")})},findBestHint:function(){var e=this.el.val().toLowerCase(),s=null;e&&(t.each(this.suggestions,function(t,i){var o=0===i.value.toLowerCase().indexOf(e);return o&&(s=i),!o}),this.signalHint(s))},signalHint:function(e){var s="";e&&(s=this.currentValue+e.value.substr(this.currentValue.length)),this.hintValue!==s&&(this.hintValue=s,this.hint=e,(this.options.onHint||t.noop)(s))},preloader:function(t,e,s){var i,o,a="dgwt-wcas-preloader-wrapp",n=null==s?a:a+" "+s;if("form"===e){if(1!=dgwt_wcas.show_preloader)return;o=this.getFormWrapper().find(".dgwt-wcas-preloader")}else"details"===e&&(o=this.getDetailsContainer());if(0!=o.length)if("form"!==e){var r=o.find("."+a);if("hide"!==t){if("show"===t){var l=this.options.isRtl?"-rtl":"";i='<div class="'+n+'"><img class="dgwt-wcas-placeholder-preloader" src="'+dgwt_wcas.img_url+"placeholder"+l+'.png" /></div>',this.detailsPanelClearScene(),r.length&&r.remove(),o.prepend(i)}}else r.length&&r.remove()}else"hide"===t?(o.removeClass(s),o.html("")):(o.addClass(s),"string"==typeof dgwt_wcas.preloader_icon&&o.html(dgwt_wcas.preloader_icon))},verifySuggestionsFormat:function(e){return e.length&&"string"==typeof e[0]?t.map(e,function(t){return{value:t,data:null}}):e},validateOrientation:function(e,s){return e=t.trim(e||"").toLowerCase(),-1===t.inArray(e,["auto","bottom","top"])&&(e=s),e},processResponse:function(t,e,s){var i=this.options;t.suggestions=this.verifySuggestionsFormat(t.suggestions),i.noCache||(this.cachedResponse[s]=t,i.preventBadQueries&&!t.suggestions.length&&this.badQueries.push(e)),e===this.getQuery(this.currentValue)&&("top"===this.options.orientation&&t.suggestions.reverse(),this.suggestions=t.suggestions,this.suggest())},activate:function(e){var s,i=this.classes.selected,o=this.getSuggestionsContainer(),a=o.find("."+this.classes.suggestion);return o.find("."+i).removeClass(i),this.selectedIndex=e,-1!==this.selectedIndex&&a.length>this.selectedIndex?(s=a.get(this.selectedIndex),t(s).addClass(i),s):null},selectHint:function(){var e=t.inArray(this.hint,this.suggestions);this.select(e)},select:function(t){this.options.disableHits||(this.disableOverlayMobile(),this.hide(),this.onSelect(t))},moveUp:function(){if(-1!==this.selectedIndex){if(this.latestActivateSource="key",0===this.selectedIndex)return this.getSuggestionsContainer().children("."+this.classes.suggestion).first().removeClass(this.classes.selected),this.selectedIndex=-1,this.ignoreValueChange=!1,this.el.val(this.currentValue),void this.findBestHint();this.adjustScroll(this.selectedIndex-1,"up")}},moveDown:function(){this.selectedIndex!==this.suggestions.length-1&&(this.latestActivateSource="key",this.adjustScroll(this.selectedIndex+1,"down"))},adjustScroll:function(e,s){if("headline"===this.suggestions[e].type&&(e="down"===s?e+1:e-1),void 0!==this.suggestions[e]){var i=this.activate(e);if(this.getDetails(this.suggestions[e]),"more_products"!==this.suggestions[e].type&&i&&!this.canShowDetailsBox()){var o,a,n,r=this.getSuggestionsContainer(),l=t(i).outerHeight(!1);o=i.offsetTop,n=(a=r.scrollTop())+this.options.maxHeight-l,o<a?r.scrollTop(o):o>n&&r.scrollTop(o-this.options.maxHeight+l),this.options.preserveInput||(this.ignoreValueChange=!0),this.signalHint(null)}}},onSelect:function(e){var s=this.options.onSelect,i=this.suggestions[e];void 0===i.type||"more_products"!==i.type&&("enter"!==this.actionTriggerSource||"key"==this.latestActivateSource||"product_variation"==i.type)?(this.currentValue=this.getValue(i.value),this.currentValue===this.el.val()||this.options.preserveInput||this.el.val(this.currentValue.replace(/(<([^>]+)>)/gi," ").replace(/\s\s+/g," ")),i.url.length>0&&(window.location.href=i.url),this.signalHint(null),this.suggestions=[],this.selection=i,t.isFunction(s)&&s.call(this.element,i)):this.el.closest("form").trigger("submit")},getValue:function(t){var e,s,i=this.options.delimiter;return i?1===(s=(e=this.currentValue).split(i)).length?t:e.substr(0,e.length-s[s.length-1].length)+t:t},dispose:function(){var e=this.el,s=this.getFormWrapper(),i=this.getSuggestionsContainer(),o=(this.getDetailsContainer(),e.closest("."+this.options.formClass),s.find(".js-dgwt-wcas-enable-mobile-form"));s.length&&s.find("*").each(function(){t(this).off(".autocomplete")});e.removeData("autocomplete"),t(window).off("resize.autocomplete",this.fixPositionCapture),s.removeClass("dgwt-wcas-active"),this.close(),o.length&&o.remove(),i.length&&i.html("")},enableOverlayMobile:function(){var e=this;if("on"!==e.overlayMobileState){e.overlayMobileState="on";var s,i=e.getFormWrapper(),o=e.getSuggestionsContainer(),a="";t("html").addClass("dgwt-wcas-overlay-mobile-on"),a+='<div class="js-dgwt-wcas-overlay-mobile dgwt-wcas-overlay-mobile">',a+='<div class="dgwt-wcas-om-bar js-dgwt-wcas-om-bar">',a+='<button class="dgwt-wcas-om-return js-dgwt-wcas-om-return">',"string"==typeof dgwt_wcas.back_icon&&(a+=dgwt_wcas.back_icon),a+="</button>",a+="</div>",a+="</div>",t(e.options.mobileOverlayWrapper).append(a),(s=t(".js-dgwt-wcas-overlay-mobile")).css("zIndex",99999999999),i.after('<span class="js-dgwt-wcas-om-hook"></span>'),i.appendTo(".js-dgwt-wcas-om-bar"),o.appendTo(".js-dgwt-wcas-om-bar"),i.addClass("dgwt-wcas-search-wrapp-mobile"),i.hasClass("dgwt-wcas-has-submit")&&(i.addClass("dgwt-wcas-has-submit-off"),i.removeClass("dgwt-wcas-has-submit")),i.find("."+e.options.searchInputClass).focus(),t(document).on("click.autocomplete",".js-dgwt-wcas-om-return",function(t){e.disableOverlayMobile(s)})}},disableOverlayMobile:function(e){var s=this;if(t("html").hasClass("dgwt-wcas-overlay-mobile-on")){var i=s.getSuggestionsContainer(),o=t(".js-dgwt-wcas-om-bar").find("."+s.options.searchFormClass);o.hasClass("dgwt-wcas-has-submit-off")&&(o.removeClass("dgwt-wcas-has-submit-off"),o.addClass("dgwt-wcas-has-submit")),o.removeClass("dgwt-wcas-search-wrapp-mobile"),t("html").removeClass("dgwt-wcas-overlay-mobile-on"),i.appendTo("body"),i.removeAttr("body-scroll-lock-ignore"),t(".js-dgwt-wcas-om-hook").after(o),t(".js-dgwt-wcas-overlay-mobile").remove(),t(".js-dgwt-wcas-om-hook").remove(),setTimeout(function(){o.find("."+s.options.searchInputClass).val("");var t=o.find(".dgwt-wcas-close");o.length>0&&(t.removeClass("dgwt-wcas-close"),t.html("")),s.hide()},150),s.overlayMobileState="off"}},showCloseButton:function(){var t=void 0!==dgwt_wcas.close_icon?dgwt_wcas.close_icon:"",e=this.getFormWrapper().find("."+this.options.preloaderClass);e.addClass(this.options.closeTrigger),e.html(t)},hideCloseButton:function(){var t=this.getFormWrapper().find("."+this.options.closeTrigger);t.length&&(t.removeClass(this.options.closeTrigger),t.html(""))},elementOrParentIsFixed:function(e){var s=e.add(e.parents()),i=!1;return s.each(function(){if("fixed"===t(this).css("position"))return i=!0,!1}),i},gaEvent:function(e,s){var i=!(!window.hasOwnProperty("GoogleAnalyticsObject")||!window.hasOwnProperty(window.GoogleAnalyticsObject))&&window[window.GoogleAnalyticsObject];if(this.options.sendGAEvents)try{if("undefined"!=typeof gtag)gtag("event","autocomplete_search",{event_label:e,event_category:s});else if(!1!==i){var o=i.getAll()[0];o&&o.send({hitType:"event",eventCategory:s,eventAction:"autocomplete_search",eventLabel:e})}}catch(t){}if(this.options.enableGASiteSearchModule)try{if("undefined"!=typeof gtag)gtag("event","page_view",{page_path:"/?s="+encodeURI(e)+"&post_type=product&dgwt_wcas=1"});else if(!1!==i){var a=i.getAll()[0];a&&(a.set("page","/?s="+encodeURI(e)+"&post_type=product&dgwt_wcas=1"),a.send("pageview"))}}catch(t){}t(document).trigger("dgwtWcasGAEvent",{term:e,category:s})}},t.fn.dgwtWcasAutocomplete=function(e,s){return arguments.length?this.each(function(){var i=t(this),o=i.data("autocomplete");"string"==typeof e?o&&"function"==typeof o[e]&&o[e](s):(o&&o.dispose&&o.dispose(),o=new d(this,e),i.data("autocomplete",o))}):this.first().data("autocomplete")},t.fn.autocomplete||(t.fn.autocomplete=t.fn.dgwtWcasAutocomplete),function(){function e(){var e=t(".dgwt-wcas-search-input"),s=[];e.length>1&&e.each(function(){var e=t(this).attr("id");if(-1==t.inArray(e,s))s.push(e);else{var i=Math.random().toString(36).substring(2,6);i="dgwt-wcas-search-input-"+i,t(this).attr("id",i),t(this).closest("form").find("label").attr("for",i)}})}function s(){var e=t(".dgwt-wcas-search-input");e.length>0&&e.each(function(){"object"!=typeof t(this).data("autocomplete")&&t(this).dgwtWcasAutocomplete(window.dgwt_wcas.config)})}navigator.userAgent.match(/Trident\/7\./)&&function(t,e){function s(t,e){var s=arguments.length>2?arguments[2]:[];if(!1===a(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(e,s)}function i(t,e,s){var i={value:s,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(t,e,i)}function o(t,e){return t[e]}function a(t){return"function"==typeof t}function n(t){if(null===t||t===e)throw TypeError();return Object(t)}function r(t,s){var i=function(t,e){return n(t)[e]}(t,s);if(null===i||i===e)return e;if(!1===a(i))throw new TypeError("Method not callable: "+s);return i}function l(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in t&&(e instanceof t.Symbol||e.constructor===t.Symbol)?"symbol":"object"}}function c(s){if("object"!==l(s))return!1;var i="Symbol"in t&&"match"in t.Symbol?o(s,t.Symbol.match):e;if(i!==e)return Boolean(i);try{var a=s.lastIndex;return s.lastIndex=0,RegExp.prototype.exec.call(s),!0}catch(t){}finally{s.lastIndex=a}return!1}function d(t,e){return l(t)===l(e)&&("number"===l(t)?!(!isNaN(t)||!isNaN(e))||1/t==1/0&&1/e==-1/0||1/t==-1/0&&1/e==1/0||t===e:function(t,e){return t===e}(t,e))}function g(t){if("symbol"===l(t))throw new TypeError("Cannot convert a Symbol value to a number");var e=Number(t);return isNaN(e)?0:1/e==1/0||1/e==-1/0||e===1/0||e===-1/0?e:(e<0?-1:1)*Math.floor(Math.abs(e))}function u(i){var n=arguments.length>1?arguments[1]:e;if("object"===l(i)){if(arguments.length<2)var c="default";else n===String?c="string":n===Number&&(c="number");var d="function"==typeof t.Symbol&&"symbol"==typeof t.Symbol.toPrimitive?r(i,t.Symbol.toPrimitive):e;if(d!==e){var g=s(d,i,[c]);if("object"!==l(g))return g;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===c&&(c="number"),function(t,e){if("string"===e)var i=["toString","valueOf"];else i=["valueOf","toString"];for(var n=0;n<i.length;++n){var r=o(t,i[n]);if(a(r)){var c=s(r,t);if("object"!==l(c))return c}}throw new TypeError("Cannot convert to primitive.")}(i,c)}return i}function h(t){switch(l(t)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return h(u(t,String));default:return String(t)}}i(Array.prototype,"includes",function(t){var e=n(this),s=function(t){var e=g(t);return e<=0?0:Math.min(e,Math.pow(2,53)-1)}(o(e,"length"));if(0===s)return!1;var i=g(arguments[1]);if(i>=0)var a=i;else(a=s+i)<0&&(a=0);for(;a<s;){if(d(t,o(e,h(a))))return!0;a+=1}return!1}),i(String.prototype,"includes",function(t){var s=arguments.length>1?arguments[1]:e,i=h(function(t){if(null===t||t===e)throw TypeError(Object.prototype.toString.call(t)+" is not coercible to Object.");return t}(this));if(c(t))throw new TypeError("First argument to String.prototype.includes must not be a regular expression");var o=h(t),a=g(s),n=i.length,r=Math.min(Math.max(a,0),n);return-1!==String.prototype.indexOf.call(i,o,r)})}("object"==typeof window&&window||"object"==typeof self&&self||"object"==typeof global&&global||{}),t(document).ready(function(){(["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document)&&t("html").addClass("dgwt-wcas-is-ios");var e=1==dgwt_wcas.show_details_box,s=dgwt_wcas.mobile_breakpoint;(jQuery(window).width()<s||"ontouchend"in document)&&(e=!1),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:e,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,mobileBreakpoint:s,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)},t(".dgwt-wcas-search-input").dgwtWcasAutocomplete(window.dgwt_wcas.config)}),t(window).on("load",function(){var e=0,s=setInterval(function(){var i=document.activeElement;if("object"==typeof i&&t(i).length&&t(i).hasClass("dgwt-wcas-search-input")){var o=t(i).closest(".dgwt-wcas-search-wrapp");o.length&&!o.hasClass("dgwt-wcas-active")&&(o.addClass("dgwt-wcas-active"),clearInterval(s))}e>10&&clearInterval(s),e++},500)}),t(document).ready(function(){setTimeout(function(){e(),s()},500)}),t(window).on("load",function(){setTimeout(function(){e(),s()},500),void 0!==window.elementorFrontend&&void 0!==window.elementorFrontend.documentsManager&&void 0!==window.elementorFrontend.documentsManager.documents&&t.each(elementorFrontend.documentsManager.documents,function(t,e){void 0!==e.getModal&&e.getModal&&e.getModal().on("show",function(){setTimeout(function(){s()},300)})})})}()});
includes/Admin/Troubleshooting.php CHANGED
@@ -20,6 +20,7 @@ class Troubleshooting
20
  const RESET_ASYNC_TESTS_NONCE = 'troubleshooting-reset-async-tests' ;
21
  const FIX_OUTOFSTOCK_NONCE = 'troubleshooting-fix-outofstock' ;
22
  const DISMIS_ELEMENTOR_TEMPLATE_NONCE = 'troubleshooting-dismiss-elementor-template' ;
 
23
  public function __construct()
24
  {
25
  if ( !$this->checkRequirements() ) {
@@ -31,7 +32,6 @@ class Troubleshooting
31
  add_action( DGWT_WCAS_SETTINGS_KEY . '-form_bottom_' . self::SECTION_ID, array( $this, 'tabContent' ) );
32
  add_action( 'wp_ajax_dgwt_wcas_troubleshooting_test', array( $this, 'asyncTest' ) );
33
  add_action( 'wp_ajax_dgwt_wcas_troubleshooting_reset_async_tests', array( $this, 'resetAsyncTests' ) );
34
- add_action( 'wp_ajax_dgwt_wcas_troubleshooting_fix_outofstock', array( $this, 'fixOutOfStock' ) );
35
  add_action( 'wp_ajax_dgwt_wcas_troubleshooting_dismiss_elementor_template', array( $this, 'dismissElementorTemplate' ) );
36
  }
37
 
@@ -131,10 +131,11 @@ class Troubleshooting
131
  {
132
  $localize['troubleshooting'] = array(
133
  'nonce' => array(
134
- 'troubleshooting_async_test' => wp_create_nonce( self::ASYNC_TEST_NONCE ),
135
- 'troubleshooting_reset_async_tests' => wp_create_nonce( self::RESET_ASYNC_TESTS_NONCE ),
136
- 'troubleshooting_fix_outofstock' => wp_create_nonce( self::FIX_OUTOFSTOCK_NONCE ),
137
- 'troubleshooting_dismiss_elementor_template' => wp_create_nonce( self::DISMIS_ELEMENTOR_TEMPLATE_NONCE ),
 
138
  ),
139
  'tests' => array(
140
  'direct' => array(),
@@ -682,10 +683,11 @@ class Troubleshooting
682
  if ( isset( $info['wp-server']['fields'] ) ) {
683
  ob_start();
684
  ?>
 
685
  <p><b><?php
686
  _e( 'Server environment', 'ajax-search-for-woocommerce' );
687
  ?></b></p>
688
- <table class="widefat striped" role="presentation">
689
  <tbody>
690
  <?php
691
  foreach ( $info['wp-server']['fields'] as $field_name => $field ) {
20
  const RESET_ASYNC_TESTS_NONCE = 'troubleshooting-reset-async-tests' ;
21
  const FIX_OUTOFSTOCK_NONCE = 'troubleshooting-fix-outofstock' ;
22
  const DISMIS_ELEMENTOR_TEMPLATE_NONCE = 'troubleshooting-dismiss-elementor-template' ;
23
+ const SWITCH_ALTERNATIVE_ENDPOINT = 'troubleshooting-switch-alternative-endpoint' ;
24
  public function __construct()
25
  {
26
  if ( !$this->checkRequirements() ) {
32
  add_action( DGWT_WCAS_SETTINGS_KEY . '-form_bottom_' . self::SECTION_ID, array( $this, 'tabContent' ) );
33
  add_action( 'wp_ajax_dgwt_wcas_troubleshooting_test', array( $this, 'asyncTest' ) );
34
  add_action( 'wp_ajax_dgwt_wcas_troubleshooting_reset_async_tests', array( $this, 'resetAsyncTests' ) );
 
35
  add_action( 'wp_ajax_dgwt_wcas_troubleshooting_dismiss_elementor_template', array( $this, 'dismissElementorTemplate' ) );
36
  }
37
 
131
  {
132
  $localize['troubleshooting'] = array(
133
  'nonce' => array(
134
+ 'troubleshooting_async_test' => wp_create_nonce( self::ASYNC_TEST_NONCE ),
135
+ 'troubleshooting_reset_async_tests' => wp_create_nonce( self::RESET_ASYNC_TESTS_NONCE ),
136
+ 'troubleshooting_fix_outofstock' => wp_create_nonce( self::FIX_OUTOFSTOCK_NONCE ),
137
+ 'troubleshooting_dismiss_elementor_template' => wp_create_nonce( self::DISMIS_ELEMENTOR_TEMPLATE_NONCE ),
138
+ 'troubleshooting_switch_alternative_endpoint' => wp_create_nonce( self::SWITCH_ALTERNATIVE_ENDPOINT ),
139
  ),
140
  'tests' => array(
141
  'direct' => array(),
683
  if ( isset( $info['wp-server']['fields'] ) ) {
684
  ob_start();
685
  ?>
686
+ <br /><hr /><br />
687
  <p><b><?php
688
  _e( 'Server environment', 'ajax-search-for-woocommerce' );
689
  ?></b></p>
690
+ <table style="max-width: 600px" class="widefat striped" role="presentation">
691
  <tbody>
692
  <?php
693
  foreach ( $info['wp-server']['fields'] as $field_name => $field ) {
includes/Engines/WordPressNative/Search.php CHANGED
@@ -114,15 +114,29 @@ class Search
114
  add_filter( 'dgwt/wcas/labels', array( $this, 'setTaxonomiesLabels' ), 5 );
115
  add_filter( 'dgwt/wcas/labels', array( $this, 'fixTaxonomiesLabels' ), PHP_INT_MAX - 5 );
116
  }
117
-
 
 
 
 
 
 
 
 
 
118
  }
119
 
120
  /**
121
  * Get search results via ajax
 
 
 
 
 
 
122
  */
123
- public function getSearchResults()
124
  {
125
- global $woocommerce ;
126
  $start = microtime( true );
127
  if ( !defined( 'DGWT_WCAS_AJAX' ) ) {
128
  define( 'DGWT_WCAS_AJAX', true );
@@ -140,17 +154,23 @@ class Search
140
  $results = array();
141
  $keyword = '';
142
  $remote = false;
143
- // Compatibile with v1.1.7
144
- if ( !empty($_REQUEST['dgwt_wcas_keyword']) ) {
145
- $keyword = sanitize_text_field( $_REQUEST['dgwt_wcas_keyword'] );
146
- }
147
- if ( !empty($_REQUEST['s']) ) {
148
- $keyword = sanitize_text_field( $_REQUEST['s'] );
149
- }
150
 
151
- if ( !empty($_REQUEST['remote']) ) {
152
- $remote = true;
153
- $showHeadings = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
154
  }
155
 
156
  $keyword = apply_filters( 'dgwt/wcas/phrase', $keyword );
@@ -227,8 +247,15 @@ class Search
227
  '.',
228
  ''
229
  ) . ' sec';
230
- echo json_encode( apply_filters( 'dgwt/wcas/page_search_results/output', $output ) ) ;
231
- die;
 
 
 
 
 
 
 
232
  }
233
 
234
  $relevantProducts = array();
@@ -334,8 +361,15 @@ class Search
334
  ) . ' sec';
335
  $output['engine'] = 'free';
336
  $output['v'] = DGWT_WCAS_VERSION;
337
- echo json_encode( apply_filters( 'dgwt/wcas/search_results/output', $output ) ) ;
338
- die;
 
 
 
 
 
 
 
339
  }
340
 
341
  /**
@@ -959,5 +993,27 @@ class Search
959
 
960
  return $labels;
961
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
962
 
963
  }
114
  add_filter( 'dgwt/wcas/labels', array( $this, 'setTaxonomiesLabels' ), 5 );
115
  add_filter( 'dgwt/wcas/labels', array( $this, 'fixTaxonomiesLabels' ), PHP_INT_MAX - 5 );
116
  }
117
+
118
+ // Fixes if "Polylang" is active but without "Polylang for WooCommerce" or "Hyyan WooCommerce Polylang Integration"
119
+ if ( Multilingual::isPolylang() && !class_exists( 'Polylang_Woocommerce' ) && !defined( 'Hyyan_WPI_DIR' ) ) {
120
+ add_filter(
121
+ 'woocommerce_ajax_get_endpoint',
122
+ array( $this, 'fixPolylangWooEndpoint' ),
123
+ 10,
124
+ 2
125
+ );
126
+ }
127
  }
128
 
129
  /**
130
  * Get search results via ajax
131
+ *
132
+ * @param string $phrase Search phrase.
133
+ * @param bool $return Whether to return the results.
134
+ * @param string $context Search context: 'autocomplete' or 'all-results'.
135
+ *
136
+ * @return mixed|void
137
  */
138
+ public function getSearchResults( $phrase = '', $return = false, $context = 'autocomplete' )
139
  {
 
140
  $start = microtime( true );
141
  if ( !defined( 'DGWT_WCAS_AJAX' ) ) {
142
  define( 'DGWT_WCAS_AJAX', true );
154
  $results = array();
155
  $keyword = '';
156
  $remote = false;
 
 
 
 
 
 
 
157
 
158
+ if ( $return ) {
159
+ $keyword = sanitize_text_field( $phrase );
160
+ if ( $context === 'all-results' ) {
161
+ $remote = true;
162
+ }
163
+ } else {
164
+ // Compatible with v1.1.7
165
+ if ( !empty($_REQUEST['dgwt_wcas_keyword']) ) {
166
+ $keyword = sanitize_text_field( $_REQUEST['dgwt_wcas_keyword'] );
167
+ }
168
+ if ( !empty($_REQUEST['s']) ) {
169
+ $keyword = sanitize_text_field( $_REQUEST['s'] );
170
+ }
171
+ if ( !empty($_REQUEST['remote']) ) {
172
+ $remote = true;
173
+ }
174
  }
175
 
176
  $keyword = apply_filters( 'dgwt/wcas/phrase', $keyword );
247
  '.',
248
  ''
249
  ) . ' sec';
250
+ $result = apply_filters( 'dgwt/wcas/page_search_results/output', $output );
251
+
252
+ if ( $return ) {
253
+ return $result;
254
+ } else {
255
+ echo json_encode( $result ) ;
256
+ die;
257
+ }
258
+
259
  }
260
 
261
  $relevantProducts = array();
361
  ) . ' sec';
362
  $output['engine'] = 'free';
363
  $output['v'] = DGWT_WCAS_VERSION;
364
+ $result = apply_filters( 'dgwt/wcas/search_results/output', $output );
365
+
366
+ if ( $return ) {
367
+ return $result;
368
+ } else {
369
+ echo json_encode( $result ) ;
370
+ die;
371
+ }
372
+
373
  }
374
 
375
  /**
993
 
994
  return $labels;
995
  }
996
+
997
+ /**
998
+ * Add language to WC endpoint if Polylang is active
999
+ *
1000
+ * @param $url
1001
+ * @param $request
1002
+ *
1003
+ * @return string
1004
+ * @see polylang-wc/frontend/frontend.php:306
1005
+ */
1006
+ public function fixPolylangWooEndpoint( $url, $request )
1007
+ {
1008
+
1009
+ if ( PLL() instanceof \PLL_Frontend ) {
1010
+ // Remove wc-ajax to avoid the value %%endpoint%% to be encoded by add_query_arg (used in plain permalinks).
1011
+ $url = remove_query_arg( 'wc-ajax', $url );
1012
+ $url = PLL()->links_model->switch_language_in_link( $url, PLL()->curlang );
1013
+ return add_query_arg( 'wc-ajax', $request, $url );
1014
+ }
1015
+
1016
+ return $url;
1017
+ }
1018
 
1019
  }
includes/Helpers.php CHANGED
@@ -2,8 +2,8 @@
2
 
3
  namespace DgoraWcas;
4
 
5
- use DgoraWcas\Engines\TNTSearchMySQL\Indexer\Utils ;
6
  use DgoraWcas\Engines\TNTSearchMySQL\SearchQuery\SearchResultsPageQuery ;
 
7
  // Exit if accessed directly
8
  if ( !defined( 'ABSPATH' ) ) {
9
  exit;
@@ -1099,6 +1099,139 @@ class Helpers
1099
  return (object) $layout;
1100
  }
1101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1102
  /**
1103
  * Checking the current code is run by the object of the given class
1104
  *
@@ -1243,5 +1376,15 @@ class Helpers
1243
  '_wpnonce'
1244
  ), home_url( '/', $scheme ) ) ), DGWT_WCAS_SEARCH_ACTION ) );
1245
  }
 
 
 
 
 
 
 
 
 
 
1246
 
1247
  }
2
 
3
  namespace DgoraWcas;
4
 
 
5
  use DgoraWcas\Engines\TNTSearchMySQL\SearchQuery\SearchResultsPageQuery ;
6
+ use DgoraWcas\Integrations\Solver ;
7
  // Exit if accessed directly
8
  if ( !defined( 'ABSPATH' ) ) {
9
  exit;
1099
  return (object) $layout;
1100
  }
1101
 
1102
+ /**
1103
+ * Get frontend scripts settings
1104
+ *
1105
+ * @return array
1106
+ */
1107
+ public static function getScriptsSettings()
1108
+ {
1109
+ $layout = self::getLayoutSettings();
1110
+ // Localize
1111
+ $localize = array(
1112
+ 'labels' => self::getLabels(),
1113
+ 'ajax_search_endpoint' => self::getEndpointUrl( 'search' ),
1114
+ 'ajax_details_endpoint' => self::getEndpointUrl( 'details' ),
1115
+ 'ajax_prices_endpoint' => self::getEndpointUrl( 'prizes' ),
1116
+ 'action_search' => DGWT_WCAS_SEARCH_ACTION,
1117
+ 'action_result_details' => DGWT_WCAS_RESULT_DETAILS_ACTION,
1118
+ 'action_get_prices' => DGWT_WCAS_GET_PRICES_ACTION,
1119
+ 'min_chars' => 3,
1120
+ 'width' => 'auto',
1121
+ 'show_details_box' => false,
1122
+ 'show_images' => false,
1123
+ 'show_price' => false,
1124
+ 'show_desc' => false,
1125
+ 'show_sale_badge' => false,
1126
+ 'show_featured_badge' => false,
1127
+ 'dynamic_prices' => false,
1128
+ 'is_rtl' => ( is_rtl() == true ? true : false ),
1129
+ 'show_preloader' => false,
1130
+ 'show_headings' => false,
1131
+ 'preloader_url' => '',
1132
+ 'taxonomy_brands' => '',
1133
+ 'img_url' => DGWT_WCAS_URL . 'assets/img/',
1134
+ 'is_premium' => dgoraAsfwFs()->is_premium(),
1135
+ 'mobile_breakpoint' => $layout->breakpoint,
1136
+ 'mobile_overlay_wrapper' => $layout->mobile_overlay_wrapper,
1137
+ 'mobile_overlay_delay' => apply_filters( 'dgwt/wcas/scripts/overlay_delay_ms', 0 ),
1138
+ 'debounce_wait_ms' => apply_filters( 'dgwt/wcas/scripts/debounce_wait_ms', 400 ),
1139
+ 'send_ga_events' => apply_filters( 'dgwt/wcas/scripts/send_ga_events', true ),
1140
+ 'enable_ga_site_search_module' => apply_filters( 'dgwt/wcas/scripts/enable_ga_site_search_module', false ),
1141
+ 'magnifier_icon' => self::getMagnifierIco( '' ),
1142
+ 'close_icon' => self::getIcon( 'close' ),
1143
+ 'back_icon' => self::getIcon( 'arrow-left' ),
1144
+ 'preloader_icon' => self::getIcon( 'preloader' ),
1145
+ 'custom_params' => (object) apply_filters( 'dgwt/wcas/scripts/custom_params', array() ),
1146
+ 'convert_html' => true,
1147
+ 'suggestions_wrapper' => apply_filters( 'dgwt/wcas/scripts/suggestions_wrapper', 'body' ),
1148
+ 'show_product_vendor' => dgoraAsfwFs()->is_premium() && class_exists( 'DgoraWcas\\Integrations\\Marketplace\\Marketplace' ) && DGWT_WCAS()->marketplace->showProductVendor(),
1149
+ 'disable_hits' => apply_filters( 'dgwt/wcas/scripts/disable_hits', false ),
1150
+ 'disable_submit' => apply_filters( 'dgwt/wcas/scripts/disable_submit', false ),
1151
+ );
1152
+ if ( Multilingual::isMultilingual() ) {
1153
+ $localize['current_lang'] = Multilingual::getCurrentLanguage();
1154
+ }
1155
+ // Min characters
1156
+ $min_chars = DGWT_WCAS()->settings->getOption( 'min_chars' );
1157
+ if ( !empty($min_chars) && is_numeric( $min_chars ) ) {
1158
+ $localize['min_chars'] = absint( $min_chars );
1159
+ }
1160
+ $sug_width = DGWT_WCAS()->settings->getOption( 'sug_width' );
1161
+ if ( !empty($sug_width) && is_numeric( $sug_width ) && $sug_width > 100 ) {
1162
+ $localize['sug_width'] = absint( $sug_width );
1163
+ }
1164
+ // Show/hide Details panel
1165
+ if ( DGWT_WCAS()->settings->getOption( 'show_details_box' ) === 'on' ) {
1166
+ $localize['show_details_box'] = true;
1167
+ }
1168
+ // Show/hide images
1169
+ if ( DGWT_WCAS()->settings->getOption( 'show_product_image' ) === 'on' ) {
1170
+ $localize['show_images'] = true;
1171
+ }
1172
+ // Show/hide price
1173
+ if ( DGWT_WCAS()->settings->getOption( 'show_product_price' ) === 'on' ) {
1174
+ $localize['show_price'] = true;
1175
+ }
1176
+ // Show/hide description
1177
+ if ( DGWT_WCAS()->settings->getOption( 'show_product_desc' ) === 'on' ) {
1178
+ $localize['show_desc'] = true;
1179
+ }
1180
+ // Show/hide description
1181
+ if ( DGWT_WCAS()->settings->getOption( 'show_product_sku' ) === 'on' ) {
1182
+ $localize['show_sku'] = true;
1183
+ }
1184
+ // Show/hide sale badge
1185
+ if ( DGWT_WCAS()->settings->getOption( 'show_sale_badge' ) === 'on' ) {
1186
+ $localize['show_sale_badge'] = true;
1187
+ }
1188
+ // Show/hide featured badge
1189
+ if ( DGWT_WCAS()->settings->getOption( 'show_featured_badge' ) === 'on' ) {
1190
+ $localize['show_featured_badge'] = true;
1191
+ }
1192
+ // Set preloader
1193
+
1194
+ if ( DGWT_WCAS()->settings->getOption( 'show_preloader' ) === 'on' ) {
1195
+ $localize['show_preloader'] = true;
1196
+ $localize['preloader_url'] = esc_url( trim( DGWT_WCAS()->settings->getOption( 'preloader_url' ) ) );
1197
+ }
1198
+
1199
+ // Show/hide autocomplete headings
1200
+ if ( DGWT_WCAS()->settings->getOption( 'show_grouped_results' ) === 'on' ) {
1201
+ $localize['show_headings'] = true;
1202
+ }
1203
+ return apply_filters( 'dgwt/wcas/scripts/localize', $localize );
1204
+ }
1205
+
1206
+ /**
1207
+ * Get endpoint URL
1208
+ *
1209
+ * @param string $type
1210
+ *
1211
+ * @return string
1212
+ */
1213
+ public static function getEndpointUrl( $type = '' )
1214
+ {
1215
+ $url = '';
1216
+ if ( !in_array( $type, array( 'search', 'details', 'prices' ) ) ) {
1217
+ return $url;
1218
+ }
1219
+ switch ( $type ) {
1220
+ case 'search':
1221
+ $url = \WC_AJAX::get_endpoint( DGWT_WCAS_SEARCH_ACTION );
1222
+ break;
1223
+ case 'details':
1224
+ $url = \WC_AJAX::get_endpoint( DGWT_WCAS_RESULT_DETAILS_ACTION );
1225
+ break;
1226
+ case 'prices':
1227
+ $url = \WC_AJAX::get_endpoint( DGWT_WCAS_GET_PRICES_ACTION );
1228
+ break;
1229
+ default:
1230
+ break;
1231
+ }
1232
+ return apply_filters( "dgwt/wcas/endpoint/{$type}", $url );
1233
+ }
1234
+
1235
  /**
1236
  * Checking the current code is run by the object of the given class
1237
  *
1376
  '_wpnonce'
1377
  ), home_url( '/', $scheme ) ) ), DGWT_WCAS_SEARCH_ACTION ) );
1378
  }
1379
+
1380
+ /**
1381
+ * Check that the AMP version of the page is displayed
1382
+ *
1383
+ * @return bool
1384
+ */
1385
+ public static function isAMPEndpoint()
1386
+ {
1387
+ return function_exists( 'is_amp_endpoint' ) && is_amp_endpoint();
1388
+ }
1389
 
1390
  }
includes/Integrations/Themes/OpenShopPro/OpenShopPro.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DgoraWcas\Integrations\Themes\OpenShopPro;
4
+
5
+ use DgoraWcas\Abstracts\ThemeIntegration;
6
+
7
+ // Exit if accessed directly
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ class OpenShopPro extends ThemeIntegration {
13
+
14
+ public function __construct() {
15
+ $this->themeSlug = 'open-shop-pro';
16
+ $this->themeName = 'Open Shop Pro';
17
+
18
+ parent::__construct();
19
+ }
20
+
21
+ /**
22
+ * Overwrite search
23
+ *
24
+ * @return void
25
+ */
26
+ protected function maybeOverwriteSearch() {
27
+ // We load partial from free version of theme
28
+ $partialPath = DGWT_WCAS_DIR . 'partials/themes/open-shop.php';
29
+ if ( $this->canReplaceSearch() && file_exists( $partialPath ) ) {
30
+ require_once( $partialPath );
31
+ }
32
+ }
33
+ }
includes/Integrations/Themes/ThemesCompatibility.php CHANGED
@@ -199,6 +199,15 @@ class ThemesCompatibility {
199
  'slug' => 'generatepress',
200
  'name' => 'GeneratePress',
201
  ),
 
 
 
 
 
 
 
 
 
202
  );
203
  }
204
 
199
  'slug' => 'generatepress',
200
  'name' => 'GeneratePress',
201
  ),
202
+ 'open-shop-pro' => array(
203
+ 'slug' => 'open-shop-pro',
204
+ 'className' => 'OpenShopPro',
205
+ 'name' => 'Open Shop Pro',
206
+ ),
207
+ 'uncode' => array(
208
+ 'slug' => 'uncode',
209
+ 'name' => 'Uncode',
210
+ ),
211
  );
212
  }
213
 
includes/Integrations/Themes/Uncode/Uncode.php ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace DgoraWcas\Integrations\Themes\Uncode;
4
+
5
+ use DgoraWcas\Abstracts\ThemeIntegration;
6
+
7
+ // Exit if accessed directly
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ class Uncode extends ThemeIntegration {
13
+
14
+ public function __construct() {
15
+ $this->themeSlug = 'uncode';
16
+ $this->themeName = 'Uncode';
17
+
18
+ parent::__construct();
19
+ }
20
+ }
includes/Multilingual.php CHANGED
@@ -43,7 +43,7 @@ class Multilingual {
43
  * @return bool
44
  */
45
  public static function isPolylang() {
46
- return did_action( 'pll_init' ) && ( class_exists( 'Polylang_Woocommerce' ) || defined( 'Hyyan_WPI_DIR' ) );
47
  }
48
 
49
  /**
43
  * @return bool
44
  */
45
  public static function isPolylang() {
46
+ return did_action( 'pll_init' );
47
  }
48
 
49
  /**
includes/Scripts.php CHANGED
@@ -2,139 +2,51 @@
2
 
3
  namespace DgoraWcas;
4
 
5
- use DgoraWcas\Integrations\Solver ;
 
6
  // Exit if accessed directly
7
- if ( !defined( 'ABSPATH' ) ) {
8
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  }
10
- class Scripts
11
- {
12
- public function __construct()
13
- {
14
- add_action( 'wp_enqueue_scripts', array( $this, 'loadScripts' ) );
15
- }
16
-
17
- /**
18
- * Loads scripts and styles
19
- * Uses a WP hook wp_enqueue_scripts
20
- *
21
- * @return void
22
- */
23
- public function loadScripts()
24
- {
25
- $min = ( SCRIPT_DEBUG ? '' : '.min' );
26
- //Register
27
- wp_register_style(
28
- 'dgwt-wcas-style',
29
- apply_filters( 'dgwt/wcas/scripts/css_style_url', DGWT_WCAS_URL . 'assets/css/style' . $min . '.css' ),
30
- array(),
31
- DGWT_WCAS_VERSION
32
- );
33
- wp_register_script(
34
- 'jquery-dgwt-wcas',
35
- apply_filters( 'dgwt/wcas/scripts/js_url', DGWT_WCAS_URL . 'assets/js/search' . $min . '.js' ),
36
- array( 'jquery' ),
37
- DGWT_WCAS_VERSION,
38
- true
39
- );
40
- // Enqueue
41
- wp_enqueue_style( 'dgwt-wcas-style' );
42
- $layout = Helpers::getLayoutSettings();
43
- // Localize
44
- $localize = array(
45
- 'labels' => Helpers::getLabels(),
46
- 'ajax_search_endpoint' => \WC_AJAX::get_endpoint( DGWT_WCAS_SEARCH_ACTION ),
47
- 'ajax_details_endpoint' => \WC_AJAX::get_endpoint( DGWT_WCAS_RESULT_DETAILS_ACTION ),
48
- 'ajax_prices_endpoint' => \WC_AJAX::get_endpoint( DGWT_WCAS_GET_PRICES_ACTION ),
49
- 'action_search' => DGWT_WCAS_SEARCH_ACTION,
50
- 'action_result_details' => DGWT_WCAS_RESULT_DETAILS_ACTION,
51
- 'action_get_prices' => DGWT_WCAS_GET_PRICES_ACTION,
52
- 'min_chars' => 3,
53
- 'width' => 'auto',
54
- 'show_details_box' => false,
55
- 'show_images' => false,
56
- 'show_price' => false,
57
- 'show_desc' => false,
58
- 'show_sale_badge' => false,
59
- 'show_featured_badge' => false,
60
- 'dynamic_prices' => false,
61
- 'is_rtl' => ( is_rtl() == true ? true : false ),
62
- 'show_preloader' => false,
63
- 'show_headings' => false,
64
- 'preloader_url' => '',
65
- 'taxonomy_brands' => '',
66
- 'img_url' => DGWT_WCAS_URL . 'assets/img/',
67
- 'is_premium' => ( dgoraAsfwFs()->is_premium() ? true : false ),
68
- 'mobile_breakpoint' => $layout->breakpoint,
69
- 'mobile_overlay_wrapper' => $layout->mobile_overlay_wrapper,
70
- 'mobile_overlay_delay' => apply_filters( 'dgwt/wcas/scripts/overlay_delay_ms', 0 ),
71
- 'debounce_wait_ms' => apply_filters( 'dgwt/wcas/scripts/debounce_wait_ms', 400 ),
72
- 'send_ga_events' => apply_filters( 'dgwt/wcas/scripts/send_ga_events', true ),
73
- 'enable_ga_site_search_module' => apply_filters( 'dgwt/wcas/scripts/enable_ga_site_search_module', false ),
74
- 'magnifier_icon' => Helpers::getMagnifierIco( '' ),
75
- 'close_icon' => Helpers::getIcon( 'close' ),
76
- 'back_icon' => Helpers::getIcon( 'arrow-left' ),
77
- 'preloader_icon' => Helpers::getIcon( 'preloader' ),
78
- 'custom_params' => (object) apply_filters( 'dgwt/wcas/scripts/custom_params', array() ),
79
- 'convert_html' => true,
80
- 'suggestions_wrapper' => apply_filters( 'dgwt/wcas/scripts/suggestions_wrapper', 'body' ),
81
- 'show_product_vendor' => dgoraAsfwFs()->is_premium() && class_exists( 'DgoraWcas\\Integrations\\Marketplace\\Marketplace' ) && DGWT_WCAS()->marketplace->showProductVendor(),
82
- 'disable_hits' => apply_filters( 'dgwt/wcas/scripts/disable_hits', false ),
83
- 'disable_submit' => apply_filters( 'dgwt/wcas/scripts/disable_submit', false ),
84
- );
85
- if ( Multilingual::isMultilingual() ) {
86
- $localize['current_lang'] = Multilingual::getCurrentLanguage();
87
- }
88
- // Min characters
89
- $min_chars = DGWT_WCAS()->settings->getOption( 'min_chars' );
90
- if ( !empty($min_chars) && is_numeric( $min_chars ) ) {
91
- $localize['min_chars'] = absint( $min_chars );
92
- }
93
- $sug_width = DGWT_WCAS()->settings->getOption( 'sug_width' );
94
- if ( !empty($sug_width) && is_numeric( $sug_width ) && $sug_width > 100 ) {
95
- $localize['sug_width'] = absint( $sug_width );
96
- }
97
- // Show/hide Details panel
98
- if ( DGWT_WCAS()->settings->getOption( 'show_details_box' ) === 'on' ) {
99
- $localize['show_details_box'] = true;
100
- }
101
- // Show/hide images
102
- if ( DGWT_WCAS()->settings->getOption( 'show_product_image' ) === 'on' ) {
103
- $localize['show_images'] = true;
104
- }
105
- // Show/hide price
106
- if ( DGWT_WCAS()->settings->getOption( 'show_product_price' ) === 'on' ) {
107
- $localize['show_price'] = true;
108
- }
109
- // Show/hide description
110
- if ( DGWT_WCAS()->settings->getOption( 'show_product_desc' ) === 'on' ) {
111
- $localize['show_desc'] = true;
112
- }
113
- // Show/hide description
114
- if ( DGWT_WCAS()->settings->getOption( 'show_product_sku' ) === 'on' ) {
115
- $localize['show_sku'] = true;
116
- }
117
- // Show/hide sale badge
118
- if ( DGWT_WCAS()->settings->getOption( 'show_sale_badge' ) === 'on' ) {
119
- $localize['show_sale_badge'] = true;
120
- }
121
- // Show/hide featured badge
122
- if ( DGWT_WCAS()->settings->getOption( 'show_featured_badge' ) === 'on' ) {
123
- $localize['show_featured_badge'] = true;
124
- }
125
- // Set preloader
126
-
127
- if ( DGWT_WCAS()->settings->getOption( 'show_preloader' ) === 'on' ) {
128
- $localize['show_preloader'] = true;
129
- $localize['preloader_url'] = esc_url( trim( DGWT_WCAS()->settings->getOption( 'preloader_url' ) ) );
130
- }
131
-
132
- // Show/hide autocomplete headings
133
- if ( DGWT_WCAS()->settings->getOption( 'show_grouped_results' ) === 'on' ) {
134
- $localize['show_headings'] = true;
135
- }
136
- $localize = apply_filters( 'dgwt/wcas/scripts/localize', $localize );
137
- wp_localize_script( 'jquery-dgwt-wcas', 'dgwt_wcas', $localize );
138
- }
139
-
140
- }
2
 
3
  namespace DgoraWcas;
4
 
5
+ use DgoraWcas\Integrations\Solver;
6
+
7
  // Exit if accessed directly
8
+ if ( ! defined( 'ABSPATH' ) ) {
9
+ exit;
10
+ }
11
+
12
+ class Scripts {
13
+
14
+ public function __construct() {
15
+
16
+ add_action( 'wp_enqueue_scripts', array( $this, 'loadScripts' ) );
17
+
18
+ }
19
+
20
+ /**
21
+ * Loads scripts and styles
22
+ * Uses a WP hook wp_enqueue_scripts
23
+ *
24
+ * @return void
25
+ */
26
+
27
+ public function loadScripts() {
28
+
29
+ $min = SCRIPT_DEBUG ? '' : '.min';
30
+
31
+ //Register
32
+ wp_register_style( 'dgwt-wcas-style', apply_filters( 'dgwt/wcas/scripts/css_style_url', DGWT_WCAS_URL . 'assets/css/style' . $min . '.css' ), array(), DGWT_WCAS_VERSION );
33
+ wp_register_script( 'jquery-dgwt-wcas', apply_filters( 'dgwt/wcas/scripts/js_url', DGWT_WCAS_URL . 'assets/js/search' . $min . '.js' ), array( 'jquery' ), DGWT_WCAS_VERSION, true );
34
+
35
+ // Enqueue
36
+ wp_enqueue_style( 'dgwt-wcas-style' );
37
+
38
+ // Don't localize script if AMP is active
39
+ if ( Helpers::isAMPEndpoint() ) {
40
+ wp_register_style( 'dgwt-wcas-style-amp', apply_filters( 'dgwt/wcas/scripts/css_style_amp_url', DGWT_WCAS_URL . 'assets/css/style-amp' . $min . '.css' ), array(), DGWT_WCAS_VERSION );
41
+ wp_enqueue_style( 'dgwt-wcas-style-amp' );
42
+
43
+ return;
44
+ }
45
+
46
+ $localize = Helpers::getScriptsSettings();
47
+
48
+ wp_localize_script( 'jquery-dgwt-wcas', 'dgwt_wcas', $localize );
49
+
50
+ }
51
+
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/Settings.php CHANGED
@@ -111,9 +111,20 @@ class Settings
111
 
112
  if ( dgoraAsfwFs()->is_premium() ) {
113
  $suffix = '';
 
114
  if ( Builder::getInfo( 'status' ) === 'error' || Builder::isIndexerWorkingTooLong() ) {
115
- $suffix = '<span class="dgwt-wcas-tab-mark">!</span>';
 
 
116
  }
 
 
 
 
 
 
 
 
117
  $sections[30] = array(
118
  'id' => 'dgwt_wcas_performance',
119
  'title' => __( 'Indexer', 'ajax-search-for-woocommerce' ) . $suffix,
@@ -664,30 +675,6 @@ class Settings
664
  );
665
  }
666
 
667
- // Show info about rebranding
668
- // Show info for all users with install date < Fri Mar 12 2021 22:59:00 GMT+0000
669
- // @TODO Remove it in March 2022
670
- $installDate = get_option( FeedbackNotice::ACTIVATION_DATE_OPT );
671
-
672
- if ( !empty($installDate) && is_numeric( $installDate ) && $installDate < 1615589940 ) {
673
- $settingsFields['dgwt_wcas_basic'][5] = array(
674
- 'name' => 'rebranding_head',
675
- 'label' => __( 'News', 'ajax-search-for-woocommerce' ),
676
- 'type' => 'head',
677
- 'class' => 'dgwt-wcas-sgs-header',
678
- );
679
- $desc = __( 'AJAX Search for WooCommerce rebrands to FiboSearch', 'ajax-search-for-woocommerce' ) . '. ';
680
- $desc .= '<a href="https://fibosearch.com/ajax-search-for-woocommerce-rebrands-to-fibosearch/" target="_blank">';
681
- $desc .= __( 'Read more', 'ajax-search-for-woocommerce' ) . '.';
682
- $desc .= '</a>';
683
- $settingsFields['dgwt_wcas_basic'][6] = array(
684
- 'name' => 'rebranding_desc',
685
- 'label' => __( 'New plugin name', 'ajax-search-for-woocommerce' ),
686
- 'type' => 'desc',
687
- 'desc' => $desc,
688
- );
689
- }
690
-
691
  foreach ( $settingsFields as $key => $sections ) {
692
  foreach ( $sections as $option ) {
693
  if ( !empty($option['name']) ) {
111
 
112
  if ( dgoraAsfwFs()->is_premium() ) {
113
  $suffix = '';
114
+
115
  if ( Builder::getInfo( 'status' ) === 'error' || Builder::isIndexerWorkingTooLong() ) {
116
+ $suffix .= '<span class="js-dgwt-wcas-indexer-tab-error dgwt-wcas-tab-mark active">!</span>';
117
+ } else {
118
+ $suffix .= '<span class="js-dgwt-wcas-indexer-tab-error dgwt-wcas-tab-mark">!</span>';
119
  }
120
+
121
+
122
+ if ( in_array( Builder::getInfo( 'status' ), array( 'preparing', 'building', 'cancellation' ) ) ) {
123
+ $suffix .= '<span class="js-dgwt-wcas-indexer-tab-progress dgwt-wcas-tab-progress active"></span>';
124
+ } else {
125
+ $suffix .= '<span class="js-dgwt-wcas-indexer-tab-progress dgwt-wcas-tab-progress"></span>';
126
+ }
127
+
128
  $sections[30] = array(
129
  'id' => 'dgwt_wcas_performance',
130
  'title' => __( 'Indexer', 'ajax-search-for-woocommerce' ) . $suffix,
675
  );
676
  }
677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
678
  foreach ( $settingsFields as $key => $sections ) {
679
  foreach ( $sections as $option ) {
680
  if ( !empty($option['name']) ) {
includes/Shortcode.php CHANGED
@@ -48,10 +48,12 @@ class Shortcode {
48
 
49
  public static function getForm( $args ) {
50
 
51
- // Enqueue required scripts
52
- wp_enqueue_script( 'jquery-dgwt-wcas' );
53
- if ( DGWT_WCAS()->settings->getOption( 'show_details_box' ) === 'on' ) {
54
- wp_enqueue_script( 'woocommerce-general' );
 
 
55
  }
56
 
57
  ob_start();
48
 
49
  public static function getForm( $args ) {
50
 
51
+ // Enqueue required scripts (only if AMP is not active)
52
+ if ( ! Helpers::isAMPEndpoint() ) {
53
+ wp_enqueue_script( 'jquery-dgwt-wcas' );
54
+ if ( DGWT_WCAS()->settings->getOption( 'show_details_box' ) === 'on' ) {
55
+ wp_enqueue_script( 'woocommerce-general' );
56
+ }
57
  }
58
 
59
  ob_start();
languages/ajax-search-for-woocommerce.pot CHANGED
@@ -3,7 +3,7 @@ msgid ""
3
  msgstr ""
4
  "Project-Id-Version: PACKAGE VERSION\n"
5
  "Report-Msgid-Bugs-To: \n"
6
- "POT-Creation-Date: 2021-10-13 09:44+0000\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
  "Last-Translator: Damian Góra <support@fibosearch.com>\n"
9
  "Language-Team: \n"
@@ -14,7 +14,7 @@ msgstr ""
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "X-Generator: Loco https://localise.biz/"
16
 
17
- #: includes/Admin/Troubleshooting.php:1772
18
  msgid "\"Out of stock\" relationships"
19
  msgstr ""
20
 
@@ -23,7 +23,7 @@ msgstr ""
23
  msgid "%1$s was called with an invalid level \"%2$s\"."
24
  msgstr ""
25
 
26
- #: ajax-search-for-woocommerce.php:240
27
  #, php-format
28
  msgid "%s is enabled but not effective. It requires %s in order to work."
29
  msgstr ""
@@ -54,7 +54,7 @@ msgid ""
54
  "/><br />You can do it by clicking %s or use an external plugin such as %s."
55
  msgstr ""
56
 
57
- #: ajax-search-for-woocommerce.php:218
58
  #, php-format
59
  msgid ""
60
  "%s: You need PHP version at least 7.0 to run this plugin. You are currently "
@@ -65,7 +65,20 @@ msgstr ""
65
  msgid "-- Disabled"
66
  msgstr ""
67
 
68
- #: partials/admin/indexer-header.php:83
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  #, php-format
70
  msgid ""
71
  "<b>Maybe your server can’t send an HTTP requests to itself</b>. Visit the "
@@ -79,17 +92,24 @@ msgid ""
79
  "products "
80
  msgstr ""
81
 
82
- #: includes/Admin/Troubleshooting.php:802
 
 
 
 
 
 
 
83
  msgid ""
84
  "A real solution is to find the reason why the WP-Cron doesn’t work and fix "
85
  "it."
86
  msgstr ""
87
 
88
- #: includes/Admin/Troubleshooting.php:1484
89
  msgid "A search engine's AJAX call did not return valid results"
90
  msgstr ""
91
 
92
- #: includes/Admin/Troubleshooting.php:652
93
  #, php-format
94
  msgid ""
95
  "Add <strong>Archive Products</strong> widget to the template <strong>"
@@ -98,12 +118,12 @@ msgid ""
98
  "documentation</a>."
99
  msgstr ""
100
 
101
- #: includes/Admin/Troubleshooting.php:1004
102
  #, php-format
103
  msgid "Add a constant <code>%s</code> to your <code>wp-config.php</code> file."
104
  msgstr ""
105
 
106
- #: partials/admin/indexer-header.php:54
107
  msgid ""
108
  "Add below code to your child theme’s <em>functions.php</em> file or via a "
109
  "plugin that allows custom functions to be added, such as the <a href=\"https:"
@@ -111,7 +131,7 @@ msgid ""
111
  "plugin."
112
  msgstr ""
113
 
114
- #: partials/admin/indexer-header.php:68
115
  msgid ""
116
  "Add below code to your child theme’s <em>functions.php</em> file or via a "
117
  "plugin that allows custom functions to be added, such as the <a href=\"https:"
@@ -128,11 +148,17 @@ msgstr ""
128
  msgid "Add new rule"
129
  msgstr ""
130
 
131
- #: includes/Admin/Troubleshooting.php:1647
 
 
 
 
 
 
132
  msgid "Add the following URL to the white list:"
133
  msgstr ""
134
 
135
- #: includes/Admin/Troubleshooting.php:1597
136
  msgid ""
137
  "Adding extra rules to <code>/usr/local/nginx/conf/wpsecure_${vhostname}."
138
  "conf</code>"
@@ -147,14 +173,19 @@ msgstr ""
147
  msgid "AJAX (live) search form for WooCommerce"
148
  msgstr ""
149
 
150
- #: includes/Settings.php:828
151
- msgid "AJAX Search for WooCommerce rebrands to FiboSearch"
152
- msgstr ""
153
-
154
  #: partials/admin/indexer-header.php:21
155
  msgid "All product changes will be <strong>re-indexed automatically</strong>"
156
  msgstr ""
157
 
 
 
 
 
 
 
 
 
 
158
  #: includes/Abstracts/ThemeIntegration.php:70
159
  #: includes/Integrations/Themes/TheGem/TheGem.php:100
160
  #: includes/Integrations/Themes/TheGem/TheGem.php:108
@@ -177,7 +208,7 @@ msgstr ""
177
  msgid "Alternative ways to embed a search bar"
178
  msgstr ""
179
 
180
- #: includes/Admin/Troubleshooting.php:882
181
  #, php-format
182
  msgid ""
183
  "An error occurred while trying to connect to the database using a PDO_MYSQL "
@@ -229,7 +260,7 @@ msgstr ""
229
  msgid "Basic"
230
  msgstr ""
231
 
232
- #: includes/Admin/Troubleshooting.php:1762
233
  msgid "Blocked search endpoint test"
234
  msgstr ""
235
 
@@ -250,11 +281,11 @@ msgid "Build ID"
250
  msgstr ""
251
 
252
  #: partials/admin/indexer-header-demo.php:15
253
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:681
254
  msgid "Build index"
255
  msgstr ""
256
 
257
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:630
258
  msgid "Canceling..."
259
  msgstr ""
260
 
@@ -262,12 +293,22 @@ msgstr ""
262
  msgid "Cancellation..."
263
  msgstr ""
264
 
265
- #: includes/Admin/Troubleshooting.php:1089
266
  msgid ""
267
  "Change the above-mentioned language codes to the correct format: <code>"
268
  "xx</code>, <code>xxx</code>, <code>xx-xx</code> or <code>xx-xxxx</code>."
269
  msgstr ""
270
 
 
 
 
 
 
 
 
 
 
 
271
  #: partials/admin/troubleshooting.php:22
272
  msgid "Check status again"
273
  msgstr ""
@@ -281,7 +322,7 @@ msgstr ""
281
  msgid "Colors"
282
  msgstr ""
283
 
284
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:640
285
  msgid "Completed. Works."
286
  msgstr ""
287
 
@@ -289,14 +330,21 @@ msgstr ""
289
  msgid "Contact"
290
  msgstr ""
291
 
292
- #: partials/admin/indexer-header.php:61
 
 
 
 
 
 
 
293
  msgid ""
294
  "Contact your hosting provider and ask for increasing the value of the <code>"
295
  "max_connections</code> variable in your MySQL server. It will definitely "
296
  "solve the problem."
297
  msgstr ""
298
 
299
- #: partials/admin/indexer-header.php:52
300
  msgid ""
301
  "Contact your hosting provider and ask for increasing the value of the <code>"
302
  "wait_timeout</code> variable in your MySQL server. It should solve the "
@@ -308,7 +356,7 @@ msgstr ""
308
  msgid "continue reading"
309
  msgstr ""
310
 
311
- #: includes/Admin/Troubleshooting.php:762
312
  #, php-format
313
  msgid ""
314
  "Could not load <code>wp-load.php</code> from the locations it normally is. "
@@ -316,7 +364,12 @@ msgid ""
316
  "support</a>."
317
  msgstr ""
318
 
319
- #: includes/Admin/Troubleshooting.php:761
 
 
 
 
 
320
  msgid "Custom location of wp-load.php file"
321
  msgstr ""
322
 
@@ -336,7 +389,12 @@ msgstr ""
336
  msgid "Default"
337
  msgstr ""
338
 
339
- #: includes/Admin/Troubleshooting.php:1519
 
 
 
 
 
340
  msgid "Defender plugin by WPMU DEV blocks AJAX calls of the live search"
341
  msgstr ""
342
 
@@ -344,11 +402,11 @@ msgstr ""
344
  msgid "Details panel"
345
  msgstr ""
346
 
347
- #: includes/Admin/Troubleshooting.php:645
348
  msgid "Dismiss"
349
  msgstr ""
350
 
351
- #: includes/Admin/Troubleshooting.php:351
352
  #, php-format
353
  msgid ""
354
  "Due to the way the TranslatePress - Multilingual plugin works, we can only "
@@ -356,16 +414,20 @@ msgid ""
356
  "version</a>."
357
  msgstr ""
358
 
359
- #: includes/Admin/Troubleshooting.php:890
360
  msgid ""
361
  "Edit <code>wp-config.php</code> file, find the <code>DB_HOST</code> constant,"
362
  " and change its value from <code>localhost</code> to <code>127.0.0.1</code>."
363
  msgstr ""
364
 
365
- #: includes/Admin/Troubleshooting.php:1684
366
  msgid "Elementor search results template"
367
  msgstr ""
368
 
 
 
 
 
369
  #: includes/Settings.php:682
370
  msgid "Enable Scheduler"
371
  msgstr ""
@@ -375,21 +437,21 @@ msgstr ""
375
  msgid "End"
376
  msgstr ""
377
 
378
- #: partials/admin/indexer-header.php:44
379
  #, php-format
380
  msgid "Error code %s"
381
  msgstr ""
382
 
383
- #: includes/Admin/Troubleshooting.php:881
384
  msgid "Error establishing a database connection"
385
  msgstr ""
386
 
387
- #: includes/Admin/Troubleshooting.php:1259
388
  #, php-format
389
  msgid "Error type: <strong>%s</strong>"
390
  msgstr ""
391
 
392
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:645
393
  msgid "Errors"
394
  msgstr ""
395
 
@@ -411,7 +473,7 @@ msgstr ""
411
  msgid "Exclude/include products"
412
  msgstr ""
413
 
414
- #: includes/Admin/Troubleshooting.php:585
415
  msgid "Extensions should looks like the picture below:"
416
  msgstr ""
417
 
@@ -440,7 +502,7 @@ msgstr ""
440
  msgid "FiboSearch Team"
441
  msgstr ""
442
 
443
- #: includes/Admin/Troubleshooting.php:883
444
  msgid ""
445
  "FiboSearch uses a PDO_MYSQL driver in the search engine. A proper database "
446
  "connection is required."
@@ -465,11 +527,11 @@ msgstr ""
465
  msgid "Finalization... Wait a moment. (%s products)"
466
  msgstr ""
467
 
468
- #: includes/Admin/Troubleshooting.php:1646
469
  msgid "Find section <code>Access Control -> whitelist URL</code>"
470
  msgstr ""
471
 
472
- #: includes/Admin/Troubleshooting.php:1209
473
  msgid "Fix “Out of stock“ relationships"
474
  msgstr ""
475
 
@@ -489,7 +551,7 @@ msgstr ""
489
  msgid "Fuzzy search"
490
  msgstr ""
491
 
492
- #: includes/Admin/Troubleshooting.php:431
493
  #, php-format
494
  msgid ""
495
  "Go to <a href=\"%s\" target=\"_blank\">Tools -> Site Health</a> in your "
@@ -505,7 +567,7 @@ msgid ""
505
  "Header -> Search</code> and enable <code>Predictive Search</code>"
506
  msgstr ""
507
 
508
- #: includes/Admin/Troubleshooting.php:1521
509
  #, php-format
510
  msgid ""
511
  "Go to <code>Defender -> Security Tweaks -> <a href=\"%s\" target=\"_blank\">"
@@ -513,14 +575,14 @@ msgid ""
513
  "exceptions: <code>%s</code>"
514
  msgstr ""
515
 
516
- #: includes/Admin/Troubleshooting.php:697
517
  #, php-format
518
  msgid ""
519
- "Go to <code>Security -> Settings -> <a href=\"%s\" target=\"_blank\">System "
520
- "Tweaks</a></code> and uncheck <code>Disable PHP in Plugins</code> option."
521
  msgstr ""
522
 
523
- #: includes/Admin/Troubleshooting.php:534
524
  #, php-format
525
  msgid ""
526
  "Go to <code>WooCommerce -> Settings -> <a href=\"%s\" target=\"_blank\">"
@@ -528,7 +590,7 @@ msgid ""
528
  "option <code>%s</code>."
529
  msgstr ""
530
 
531
- #: includes/Admin/Troubleshooting.php:584
532
  #, php-format
533
  msgid ""
534
  "Go to <code>WooCommerce -> Settings -> <a href=\"%s\" target=\"_blank\">"
@@ -536,32 +598,32 @@ msgid ""
536
  "Searching by Text</code> extension and save changes."
537
  msgstr ""
538
 
539
- #: includes/Admin/Troubleshooting.php:923
540
  #, php-format
541
  msgid ""
542
  "Go to the <code>Jetpack settings page -> <a href=\"%s\" target=\"_blank\">"
543
  "Performance tab</a> -> disable the Search module</code>"
544
  msgstr ""
545
 
546
- #: includes/Admin/Troubleshooting.php:848
547
- #: includes/Admin/Troubleshooting.php:1005
548
- #: includes/Admin/Troubleshooting.php:1090
549
- #: includes/Admin/Troubleshooting.php:1123
550
  #, php-format
551
  msgid "Go to the Indexer tab and click the button <i>%s</i>."
552
  msgstr ""
553
 
554
- #: includes/Admin/Troubleshooting.php:1088
555
  msgid ""
556
  "Go to the multilingual plugin settings page and find the section where you "
557
  "can edit the available languages."
558
  msgstr ""
559
 
560
- #: includes/Admin/Troubleshooting.php:1645
561
  msgid "Go to the settings"
562
  msgstr ""
563
 
564
- #: includes/Admin/Troubleshooting.php:495
565
  msgid "Great! Our plugin works great with this version of WordPress."
566
  msgstr ""
567
 
@@ -579,7 +641,7 @@ msgstr ""
579
  msgid "Hard"
580
  msgstr ""
581
 
582
- #: includes/Admin/Troubleshooting.php:1596
583
  msgid "Here are few samples NGINX config which helps other users:"
584
  msgstr ""
585
 
@@ -597,7 +659,7 @@ msgid ""
597
  "time now, and I hope you like it!"
598
  msgstr ""
599
 
600
- #: partials/admin/indexer-header.php:100
601
  msgid "Hide details"
602
  msgstr ""
603
 
@@ -620,11 +682,15 @@ msgid ""
620
  "admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc"
621
  msgstr ""
622
 
 
 
 
 
623
  #: widget.php:41 includes/Settings.php:239 includes/EmbeddingViaMenu.php:189
624
  msgid "Icon on mobile, search bar on desktop"
625
  msgstr ""
626
 
627
- #: includes/Admin/Troubleshooting.php:1036
628
  #, php-format
629
  msgid ""
630
  "If the following errors are related to your theme or plugins, try to fix "
@@ -632,7 +698,7 @@ msgid ""
632
  "target=\"_blank\">create a support ticket</a>."
633
  msgstr ""
634
 
635
- #: partials/admin/indexer-header.php:86
636
  msgid ""
637
  "If the indexer still doesn't work, add a constant <code>"
638
  "define('DGWT_WCAS_INDEXER_MODE', 'sync');</code> to your <code>wp-config."
@@ -645,20 +711,27 @@ msgid ""
645
  "Help your customers to find the right products even <span>10× faster</span>."
646
  msgstr ""
647
 
648
- #: includes/Admin/Troubleshooting.php:1260
 
 
 
 
 
 
 
649
  msgid ""
650
  "If you have an object caching plugin, turn it off or check its settings. "
651
  "Ideally, the transients should not be cached in any way and stored directly "
652
  "in the database."
653
  msgstr ""
654
 
655
- #: partials/admin/indexer-header.php:63
656
  msgid ""
657
  "If you see the <b>Troubleshooting tab</b> above, click it and try to solve "
658
  "the issues mentioned there"
659
  msgstr ""
660
 
661
- #: includes/Admin/Troubleshooting.php:654
662
  #, php-format
663
  msgid ""
664
  "If you think the search results page is displaying your products correctly, "
@@ -686,32 +759,32 @@ msgstr ""
686
  msgid "Include"
687
  msgstr ""
688
 
689
- #: includes/Admin/Troubleshooting.php:582
690
  msgid ""
691
  "Incompatible \"Searching by Text\" extension from WOOF - WooCommerce "
692
  "Products Filter plugin is active"
693
  msgstr ""
694
 
695
- #: includes/Admin/Troubleshooting.php:1680
696
  msgid ""
697
  "Incompatible \"Searching by Text\" extension in WOOF - WooCommerce Products "
698
  "Filter"
699
  msgstr ""
700
 
701
- #: includes/Admin/Troubleshooting.php:1084
702
  msgid "Incompatible multilingual plugin setting"
703
  msgstr ""
704
 
705
- #: includes/Admin/Troubleshooting.php:1672
706
  msgid "Incompatible plugins"
707
  msgstr ""
708
 
709
- #: includes/Admin/Troubleshooting.php:1001
710
  msgid "Incompatible WPML Multilingual CMS plugin setting"
711
  msgstr ""
712
 
713
- #: includes/Admin/Troubleshooting.php:532
714
- #: includes/Admin/Troubleshooting.php:1676
715
  msgid "Incorrect \"Add to cart\" behaviour in WooCommerce settings"
716
  msgstr ""
717
 
@@ -731,7 +804,7 @@ msgstr ""
731
  msgid "Index build start"
732
  msgstr ""
733
 
734
- #: includes/Admin/Troubleshooting.php:1717
735
  msgid "Index completeness test"
736
  msgstr ""
737
 
@@ -762,11 +835,11 @@ msgstr ""
762
  msgid "Individual tips and support by FiboSearch team"
763
  msgstr ""
764
 
765
- #: includes/Admin/Troubleshooting.php:1757
766
  msgid "InnoDB support"
767
  msgstr ""
768
 
769
- #: includes/Admin/Troubleshooting.php:799
770
  msgid ""
771
  "Install the <a target=\"_blank\" href=\"https://wordpress."
772
  "org/plugins/advanced-cron-manager/\">Advanced Cron Manager</a> plugin to "
@@ -774,7 +847,7 @@ msgid ""
774
  "related to the Indexer:"
775
  msgstr ""
776
 
777
- #: includes/Admin/Troubleshooting.php:498
778
  msgid ""
779
  "Install the latest version of WordPress for our plugin to work as best it "
780
  "can!"
@@ -784,14 +857,14 @@ msgstr ""
784
  msgid "Interval"
785
  msgstr ""
786
 
787
- #: includes/Admin/Troubleshooting.php:1086
788
  #, php-format
789
  msgid "Invalid language code: <code>%s</code>"
790
  msgid_plural "Invalid language codes: <code>%s</code>"
791
  msgstr[0] ""
792
  msgstr[1] ""
793
 
794
- #: partials/admin/indexer-header.php:89
795
  #, php-format
796
  msgid ""
797
  "Is it still not working? Visit the <a target=\"_blank\" href=\"%s\">"
@@ -799,14 +872,14 @@ msgid ""
799
  "request</a>"
800
  msgstr ""
801
 
802
- #: includes/Admin/Troubleshooting.php:440
803
  #, php-format
804
  msgid ""
805
  "Is it still not working? Write a <a target=\"_blank\" href=\"%s\">support "
806
  "request</a>"
807
  msgstr ""
808
 
809
- #: includes/Admin/Troubleshooting.php:434
810
  msgid ""
811
  "Is your website publicly available only for whitelisted IPs? <b>Add your "
812
  "server IP to the whitelist</b>. That’s all. This is a common mistake when "
@@ -815,16 +888,17 @@ msgid ""
815
  "requests to itself."
816
  msgstr ""
817
 
818
- #: includes/Admin/Troubleshooting.php:776
819
- #: includes/Admin/Troubleshooting.php:1712
820
  msgid "Issue with WP-Cron"
821
  msgstr ""
822
 
823
- #: includes/Admin/Troubleshooting.php:695
824
- msgid "iThemes Security plugin blocks AJAX requests"
 
825
  msgstr ""
826
 
827
- #: includes/Admin/Troubleshooting.php:1727
828
  msgid "Jetpack search module"
829
  msgstr ""
830
 
@@ -846,7 +920,7 @@ msgstr ""
846
  msgid "Logs"
847
  msgstr ""
848
 
849
- #: includes/Admin/Troubleshooting.php:1690
850
  msgid "Loopback request"
851
  msgstr ""
852
 
@@ -873,9 +947,9 @@ msgstr ""
873
  msgid "maximum number of suggestions"
874
  msgstr ""
875
 
876
- #: includes/Admin/Troubleshooting.php:1414
877
  msgid ""
878
- "Maybe your server blocks it by Apache module <code>mod_security</code>. "
879
  "Contact your hosting provider and ask what can block the URL you see above."
880
  msgstr ""
881
 
@@ -891,7 +965,7 @@ msgstr ""
891
  msgid "Minimum characters"
892
  msgstr ""
893
 
894
- #: includes/Admin/Troubleshooting.php:957
895
  msgid "Missing plugin: WooCommerce Multilingual"
896
  msgstr ""
897
 
@@ -909,7 +983,7 @@ msgstr ""
909
  msgid "More results label"
910
  msgstr ""
911
 
912
- #: includes/Admin/Troubleshooting.php:1747
913
  msgid "Multilingual slugs"
914
  msgstr ""
915
 
@@ -917,15 +991,7 @@ msgstr ""
917
  msgid "My Account"
918
  msgstr ""
919
 
920
- #: includes/Settings.php:836
921
- msgid "New plugin name"
922
- msgstr ""
923
-
924
- #: includes/Settings.php:823
925
- msgid "News"
926
- msgstr ""
927
-
928
- #: includes/Admin/Troubleshooting.php:1593
929
  msgid "NGINX configuration may blocks search requests"
930
  msgstr ""
931
 
@@ -941,7 +1007,7 @@ msgstr ""
941
  msgid "No thanks"
942
  msgstr ""
943
 
944
- #: includes/Admin/Troubleshooting.php:1742
945
  msgid "Non Critical Indexer Errors"
946
  msgstr ""
947
 
@@ -953,7 +1019,7 @@ msgstr ""
953
  msgid "Normal"
954
  msgstr ""
955
 
956
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:651
957
  msgid "Not exist"
958
  msgstr ""
959
 
@@ -961,11 +1027,11 @@ msgstr ""
961
  msgid "Note: We currently only support the header type: \"Header 10\""
962
  msgstr ""
963
 
964
- #: includes/Admin/Troubleshooting.php:1752
965
  msgid "Old index"
966
  msgstr ""
967
 
968
- #: includes/Admin/Troubleshooting.php:456
969
  msgid "One or more required PHP extensions are missing on your server"
970
  msgstr ""
971
 
@@ -973,11 +1039,11 @@ msgstr ""
973
  msgid "Overlay on mobile"
974
  msgstr ""
975
 
976
- #: includes/Admin/Troubleshooting.php:1722
977
  msgid "PDO connection test"
978
  msgstr ""
979
 
980
- #: includes/Admin/Troubleshooting.php:1668
981
  msgid "PHP extensions"
982
  msgstr ""
983
 
@@ -1001,7 +1067,7 @@ msgstr ""
1001
  msgid "Pro features"
1002
  msgstr ""
1003
 
1004
- #: includes/Admin/Troubleshooting.php:1252
1005
  msgid "Problem with WordPress Transients API"
1006
  msgstr ""
1007
 
@@ -1021,7 +1087,7 @@ msgstr ""
1021
  msgid "Products"
1022
  msgstr ""
1023
 
1024
- #: partials/search-form.php:30 partials/admin/search-preview.php:34
1025
  msgid "Products search"
1026
  msgstr ""
1027
 
@@ -1039,11 +1105,7 @@ msgstr ""
1039
  msgid "px"
1040
  msgstr ""
1041
 
1042
- #: includes/Settings.php:830
1043
- msgid "Read more"
1044
- msgstr ""
1045
-
1046
- #: includes/Admin/Troubleshooting.php:439
1047
  #, php-format
1048
  msgid ""
1049
  "Read more about indexer issues on <a target=\"_blank\" href=\"%s\">our "
@@ -1051,15 +1113,22 @@ msgid ""
1051
  "request to itself”."
1052
  msgstr ""
1053
 
 
 
 
 
 
 
 
1054
  #: partials/admin/indexer-body.php:90
1055
  msgid "Readable"
1056
  msgstr ""
1057
 
1058
- #: includes/Admin/Troubleshooting.php:842
1059
- #: includes/Admin/Troubleshooting.php:998
1060
- #: includes/Admin/Troubleshooting.php:1081
1061
- #: includes/Admin/Troubleshooting.php:1119
1062
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:675
1063
  msgid "Rebuild index"
1064
  msgstr ""
1065
 
@@ -1141,13 +1210,13 @@ msgstr ""
1141
  msgid "Replace the TheGem default search"
1142
  msgstr ""
1143
 
1144
- #: includes/Admin/Troubleshooting.php:466
1145
- #: includes/Admin/Troubleshooting.php:469
1146
  #, php-format
1147
  msgid "Required PHP extension: %s"
1148
  msgstr ""
1149
 
1150
- #: includes/Admin/Troubleshooting.php:1486
1151
  msgid "Response body"
1152
  msgstr ""
1153
 
@@ -1199,7 +1268,7 @@ msgstr ""
1199
  msgid "Scheduling indexing"
1200
  msgstr ""
1201
 
1202
- #: includes/Settings.php:218 partials/search-form.php:46
1203
  msgid "Search"
1204
  msgstr ""
1205
 
@@ -1342,12 +1411,12 @@ msgstr ""
1342
  msgid "select the custom fields you want to add to the search scope"
1343
  msgstr ""
1344
 
1345
- #: includes/Admin/Troubleshooting.php:1905
1346
  msgid "Server environment"
1347
  msgstr ""
1348
 
1349
- #: includes/Admin/Troubleshooting.php:1407
1350
- #: includes/Admin/Troubleshooting.php:1485
1351
  #, php-format
1352
  msgid ""
1353
  "Server response with message <code>%s</code> and status code <code>%s</code>."
@@ -1358,7 +1427,7 @@ msgstr ""
1358
  msgid "Settings"
1359
  msgstr ""
1360
 
1361
- #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:230
1362
  #, php-format
1363
  msgid "Show %s"
1364
  msgstr ""
@@ -1376,7 +1445,7 @@ msgid "Show categories"
1376
  msgstr ""
1377
 
1378
  #: partials/admin/indexer-header-demo.php:16
1379
- #: partials/admin/indexer-header.php:99
1380
  msgid "Show details"
1381
  msgstr ""
1382
 
@@ -1386,8 +1455,10 @@ msgstr ""
1386
 
1387
  #: includes/Settings.php:424 includes/Settings.php:428
1388
  #: includes/Integrations/Brands.php:229 includes/Integrations/Brands.php:233
1389
- #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:241
1390
- #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:245
 
 
1391
  msgid "show images"
1392
  msgstr ""
1393
 
@@ -1443,29 +1514,28 @@ msgstr ""
1443
  msgid "Sold by:"
1444
  msgstr ""
1445
 
1446
- #: includes/Admin/Troubleshooting.php:533
1447
- #: includes/Admin/Troubleshooting.php:583
1448
- #: includes/Admin/Troubleshooting.php:651
1449
- #: includes/Admin/Troubleshooting.php:696
1450
- #: includes/Admin/Troubleshooting.php:798
1451
- #: includes/Admin/Troubleshooting.php:889
1452
- #: includes/Admin/Troubleshooting.php:1003
1453
- #: includes/Admin/Troubleshooting.php:1087
1454
- #: includes/Admin/Troubleshooting.php:1520
1455
- #: includes/Admin/Troubleshooting.php:1567
1456
- #: includes/Admin/Troubleshooting.php:1643
1457
  msgid "Solution"
1458
  msgstr ""
1459
 
1460
- #: includes/Admin/Troubleshooting.php:1412
1461
  msgid "Solutions"
1462
  msgstr ""
1463
 
1464
- #: includes/Admin/Troubleshooting.php:427
1465
  msgid "Solutions:"
1466
  msgstr ""
1467
 
1468
- #: includes/Admin/Troubleshooting.php:1594
1469
  #, php-format
1470
  msgid ""
1471
  "Some NGINX configuration may block executing PHP files included directly in "
@@ -1495,7 +1565,13 @@ msgstr ""
1495
  msgid "Status"
1496
  msgstr ""
1497
 
1498
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:672
 
 
 
 
 
 
1499
  msgid "Stop process"
1500
  msgstr ""
1501
 
@@ -1507,7 +1583,7 @@ msgstr ""
1507
  msgid "Submit label"
1508
  msgstr ""
1509
 
1510
- #: includes/Admin/Troubleshooting.php:1642
1511
  msgid "Sucuri Security firewall may block AJAX calls of the live search"
1512
  msgstr ""
1513
 
@@ -1544,10 +1620,17 @@ msgstr ""
1544
  msgid "Text color"
1545
  msgstr ""
1546
 
1547
- #: includes/Admin/Troubleshooting.php:1566
1548
  msgid "The .htaccess file(s) may blocking AJAX calls of the live search"
1549
  msgstr ""
1550
 
 
 
 
 
 
 
 
1551
  #: includes/Settings.php:463
1552
  msgid ""
1553
  "The Details panel is an additional container for extended information. The "
@@ -1562,29 +1645,29 @@ msgid ""
1562
  "mean a lot to me if you %ssupport it with a quick review on WordPress.org.%s"
1563
  msgstr ""
1564
 
1565
- #: partials/admin/indexer-header.php:42
1566
  msgid "The following error caused the index to be canceled:"
1567
  msgstr ""
1568
 
1569
- #: includes/Admin/Troubleshooting.php:1122
1570
  msgid "The index was built by the previous plugin version"
1571
  msgstr ""
1572
 
1573
- #: includes/Admin/Troubleshooting.php:422
1574
  msgid ""
1575
  "The Indexer uses the WordPress function <code>wp_remote_post()</code> to "
1576
  "build the index in background. Sometimes the server can block this kind of "
1577
  "request and responses with HTTP 401 Unauthorized or 403 Forbidden errors."
1578
  msgstr ""
1579
 
1580
- #: includes/Admin/Troubleshooting.php:1152
1581
  msgid ""
1582
  "The InnoDB engine within the MySQL server must be enabled for our plugin to "
1583
  "work properly. Contact your hosting provider and ask for enabling InnoDB "
1584
  "engine in your MySQL server."
1585
  msgstr ""
1586
 
1587
- #: includes/Admin/Troubleshooting.php:922
1588
  #, php-format
1589
  msgid "The Jetpack Search module is incompatible with the %s plugin."
1590
  msgstr ""
@@ -1595,7 +1678,7 @@ msgid ""
1595
  "designed advanced AJAX search bar with live search suggestions."
1596
  msgstr ""
1597
 
1598
- #: includes/Admin/Troubleshooting.php:1151
1599
  msgid "The MySQL server has the InnoDB engine turned off"
1600
  msgstr ""
1601
 
@@ -1604,37 +1687,37 @@ msgstr ""
1604
  msgid "the next index rebuild: %s"
1605
  msgstr ""
1606
 
1607
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:644
1608
  msgid "The search index could not be built."
1609
  msgstr ""
1610
 
1611
  #: partials/admin/indexer-header-demo.php:11
1612
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:650
1613
  msgid "The search index does not exist yet. Build it now."
1614
  msgstr ""
1615
 
1616
- #: includes/Admin/Troubleshooting.php:846
1617
- msgid "The search index structure isn't completely"
1618
  msgstr ""
1619
 
1620
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:638
1621
  msgid ""
1622
  "The search index was built successfully, but some non-critical errors "
1623
  "occurred."
1624
  msgstr ""
1625
 
1626
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:636
1627
  msgid "The search index was built successfully."
1628
  msgstr ""
1629
 
1630
- #: includes/Admin/Troubleshooting.php:1035
1631
  msgid ""
1632
  "The search index was built, but some significant errors occurred during this "
1633
  "process. There is a risk that some products may not be available during the "
1634
  "search."
1635
  msgstr ""
1636
 
1637
- #: includes/Admin/Troubleshooting.php:1409
1638
  msgid ""
1639
  "The search uses a dedicated URL to makes queries. In your case, this URL is "
1640
  "blocked for some reason. Let visit it directly in your browser:"
@@ -1644,7 +1727,7 @@ msgstr ""
1644
  msgid "The search will open in overlay on mobile"
1645
  msgstr ""
1646
 
1647
- #: includes/Admin/Troubleshooting.php:1406
1648
  msgid ""
1649
  "The server returns an incorrect response for the search engine's AJAX calls"
1650
  msgstr ""
@@ -1656,11 +1739,11 @@ msgid ""
1656
  "adding synonyms."
1657
  msgstr ""
1658
 
1659
- #: includes/Admin/Troubleshooting.php:1257
1660
  msgid "the transient value was cached and existed too long"
1661
  msgstr ""
1662
 
1663
- #: includes/Admin/Troubleshooting.php:1255
1664
  msgid "the transient value was not returned"
1665
  msgstr ""
1666
 
@@ -1672,38 +1755,38 @@ msgstr ""
1672
  msgid "There are four easy ways to display the search bar in your theme"
1673
  msgstr ""
1674
 
1675
- #: includes/Admin/Troubleshooting.php:1211
1676
  msgid ""
1677
  "There is a problem with the visibility of products with “Out of stock“ status"
1678
  msgstr ""
1679
 
1680
- #: includes/Admin/Troubleshooting.php:649
1681
  msgid ""
1682
  "There is no correct template in Elementor Theme Builder for the WooCommerce "
1683
  "search results page."
1684
  msgstr ""
1685
 
1686
- #: includes/Admin/Troubleshooting.php:1413
1687
  msgid ""
1688
  "Think about what can block the execution of PHP scripts inside <code>wp-"
1689
  "content</code> or <code>wp-content/plugins</code> directory. Maybe you use "
1690
  "some security plugins or you have custom code that may block it."
1691
  msgstr ""
1692
 
1693
- #: includes/Admin/Troubleshooting.php:421
1694
  msgid ""
1695
  "This issue may affect the building of the search index. Indexer may stuck at "
1696
  "0%."
1697
  msgstr ""
1698
 
1699
- #: includes/Admin/Troubleshooting.php:417
1700
  msgid ""
1701
  "This issue may affect the search results page and e.g. display all products "
1702
  "every time"
1703
  msgstr ""
1704
 
1705
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:618
1706
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:624
1707
  msgid "This process will continue in the background. You can leave this page!"
1708
  msgstr ""
1709
 
@@ -1730,37 +1813,43 @@ msgstr ""
1730
  msgid "To set 100% width leave blank"
1731
  msgstr ""
1732
 
1733
- #: includes/Admin/Troubleshooting.php:1213
1734
  #, php-format
1735
  msgid ""
1736
  "Total “out of stock“ products calculated by <code>wc_get_products()</code> "
1737
  "function: <b>%d</b>"
1738
  msgstr ""
1739
 
1740
- #: includes/Admin/Troubleshooting.php:1214
1741
  #, php-format
1742
  msgid ""
1743
  "Total “out of stock“ products calculated by SQL query on <code>%s</code>: <b>"
1744
  "%d</b>"
1745
  msgstr ""
1746
 
1747
- #: includes/Admin/Troubleshooting.php:1777
1748
  msgid "Transients test"
1749
  msgstr ""
1750
 
1751
- #: includes/Admin/Troubleshooting.php:1699
1752
  msgid "TranslatePress"
1753
  msgstr ""
1754
 
1755
- #: includes/Admin/Troubleshooting.php:62 includes/Admin/Troubleshooting.php:81
1756
- #: partials/admin/indexer-header.php:39
1757
  msgid "Troubleshooting"
1758
  msgstr ""
1759
 
1760
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:678
1761
  msgid "Try to build the index again."
1762
  msgstr ""
1763
 
 
 
 
 
 
 
1764
  #: partials/admin/features.php:16
1765
  msgid ""
1766
  "Update now and boosts your sales. You will receive <b>30-day satisfaction "
@@ -1795,7 +1884,7 @@ msgstr ""
1795
  msgid "Using PHP - %s"
1796
  msgstr ""
1797
 
1798
- #: includes/Admin/Troubleshooting.php:1767
1799
  msgid "Valid search results test"
1800
  msgstr ""
1801
 
@@ -1807,15 +1896,15 @@ msgstr ""
1807
  msgid "Vendors"
1808
  msgstr ""
1809
 
1810
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:623
1811
  msgid "Wait... Indexing in progress"
1812
  msgstr ""
1813
 
1814
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:617
1815
  msgid "Wait... Preparing indexing in progress"
1816
  msgstr ""
1817
 
1818
- #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:629
1819
  msgid "Wait... The index build process is canceling"
1820
  msgstr ""
1821
 
@@ -1823,7 +1912,7 @@ msgstr ""
1823
  msgid "Warning!"
1824
  msgstr ""
1825
 
1826
- #: includes/Admin/Troubleshooting.php:1568
1827
  #, php-format
1828
  msgid ""
1829
  "We recommend contact your hosting provider and ask to check <code>%s</code> "
@@ -1839,7 +1928,7 @@ msgid ""
1839
  "We support this theme and you can easily replace all default search bars."
1840
  msgstr ""
1841
 
1842
- #: includes/Admin/Troubleshooting.php:1212
1843
  msgid ""
1844
  "We've detected that some products with a status “Out of Stock“ may have "
1845
  "something wrong with relationships in the database. It affects visibility of "
@@ -1851,7 +1940,7 @@ msgstr ""
1851
  msgid "weekly"
1852
  msgstr ""
1853
 
1854
- #: includes/Admin/Troubleshooting.php:1408
1855
  msgid "What's wrong?"
1856
  msgstr ""
1857
 
@@ -1863,28 +1952,28 @@ msgstr ""
1863
  msgid "with simple tricks"
1864
  msgstr ""
1865
 
1866
- #: includes/Admin/Troubleshooting.php:1732
1867
  msgid "WooCommerce Multilingual"
1868
  msgstr ""
1869
 
1870
- #: includes/Admin/Troubleshooting.php:962
1871
  msgid "WooCommerce Multilingual plugin is enabled but not effective"
1872
  msgstr ""
1873
 
1874
- #: includes/Admin/Troubleshooting.php:1707
1875
  msgid "WordPress loading problem"
1876
  msgstr ""
1877
 
1878
- #: includes/Admin/Troubleshooting.php:486
1879
- #: includes/Admin/Troubleshooting.php:1664
1880
  msgid "WordPress version"
1881
  msgstr ""
1882
 
1883
- #: includes/Admin/Troubleshooting.php:1737
1884
  msgid "WPML with disabled translations for products"
1885
  msgstr ""
1886
 
1887
- #: includes/Admin/Troubleshooting.php:650
1888
  #, php-format
1889
  msgid ""
1890
  "You are using Elementor and we noticed that the template used in the search "
@@ -1892,47 +1981,51 @@ msgid ""
1892
  "Products</strong> widget."
1893
  msgstr ""
1894
 
1895
- #: includes/Admin/Troubleshooting.php:299
1896
  msgid "You are using one or more incompatible plugins"
1897
  msgstr ""
1898
 
1899
- #: includes/Admin/Troubleshooting.php:1085
1900
  msgid ""
1901
  "You are using the multilingual plugin, but one or more of the language codes "
1902
  "has wrong format. This needs to be corrected or the index will not be able "
1903
  "to build properly."
1904
  msgstr ""
1905
 
1906
- #: includes/Admin/Troubleshooting.php:340
1907
  msgid "You are using TranslatePress with Free version of our plugin"
1908
  msgstr ""
1909
 
1910
- #: includes/Admin/Troubleshooting.php:1002
1911
  msgid ""
1912
  "You are using WPML Multilingual CMS, but you have product translations "
1913
  "disabled, so for the search engine to function properly, you must disable "
1914
  "its multi-language support feature."
1915
  msgstr ""
1916
 
1917
- #: includes/Admin/Troubleshooting.php:1215
1918
  #, php-format
1919
  msgid "You can fix it by clicking on this button: %s"
1920
  msgstr ""
1921
 
1922
- #: includes/Admin/Troubleshooting.php:801
1923
  msgid ""
1924
  "You can run these actions manually via Advanced Cron Manager. Then the "
1925
  "Indexer should run. If the index stuck again, run these actions manually one "
1926
  "more time until the finished index."
1927
  msgstr ""
1928
 
1929
- #: includes/Admin/Troubleshooting.php:1644
 
 
 
 
1930
  msgid ""
1931
  "You need to log in to your <a href=\"https://login.sucuri.net\" "
1932
  "target=\"_blank\">Sucuri panel</a>."
1933
  msgstr ""
1934
 
1935
- #: includes/Admin/Troubleshooting.php:1411
1936
  msgid ""
1937
  "You should see <code>pong</code> word as a response. Probably you see "
1938
  "something else."
@@ -1943,16 +2036,16 @@ msgstr ""
1943
  msgid "You use %s plugin version %s"
1944
  msgstr ""
1945
 
1946
- #: includes/Admin/Troubleshooting.php:319
1947
- #: includes/Admin/Troubleshooting.php:321
1948
  #, php-format
1949
  msgid ""
1950
  "You use the %s plugin, which may cause errors in the search results returned "
1951
  "by our plugin."
1952
  msgstr ""
1953
 
1954
- #: includes/Admin/Troubleshooting.php:310
1955
- #: includes/Admin/Troubleshooting.php:314
1956
  #, php-format
1957
  msgid "You use the %s plugin. The %s does not support this plugin."
1958
  msgstr ""
@@ -1962,7 +2055,7 @@ msgstr ""
1962
  msgid "You use the <b>%s</b> theme%s. Fantastic!"
1963
  msgstr ""
1964
 
1965
- #: includes/Admin/Troubleshooting.php:963
1966
  #, php-format
1967
  msgid ""
1968
  "You use the WPML Multilingual CMS and WooCommerce Multilingual plugins, but "
@@ -1970,7 +2063,7 @@ msgid ""
1970
  "target=\"_blank\">WooCommerce Multilingual status</a>."
1971
  msgstr ""
1972
 
1973
- #: includes/Admin/Troubleshooting.php:958
1974
  #, php-format
1975
  msgid ""
1976
  "You use the WPML Multilingual CMS plugin and to correctly search for "
@@ -1978,18 +2071,18 @@ msgid ""
1978
  "target=\"_blank\">WooCommerce Multilingual</a> plugin."
1979
  msgstr ""
1980
 
1981
- #: includes/Admin/Troubleshooting.php:429
1982
  msgid "Your server can't send an HTTP request to itself"
1983
  msgstr ""
1984
 
1985
- #: includes/Admin/Troubleshooting.php:535
1986
  msgid "Your settings should looks like the picture below:"
1987
  msgstr ""
1988
 
1989
- #: includes/Admin/Troubleshooting.php:364
1990
  msgid "Your site can perform loopback requests"
1991
  msgstr ""
1992
 
1993
- #: includes/Admin/Troubleshooting.php:413
1994
  msgid "Your site could not complete a loopback request"
1995
  msgstr ""
3
  msgstr ""
4
  "Project-Id-Version: PACKAGE VERSION\n"
5
  "Report-Msgid-Bugs-To: \n"
6
+ "POT-Creation-Date: 2021-11-23 10:48+0000\n"
7
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
8
  "Last-Translator: Damian Góra <support@fibosearch.com>\n"
9
  "Language-Team: \n"
14
  "Content-Transfer-Encoding: 8bit\n"
15
  "X-Generator: Loco https://localise.biz/"
16
 
17
+ #: includes/Admin/Troubleshooting.php:1883
18
  msgid "\"Out of stock\" relationships"
19
  msgstr ""
20
 
23
  msgid "%1$s was called with an invalid level \"%2$s\"."
24
  msgstr ""
25
 
26
+ #: ajax-search-for-woocommerce.php:262
27
  #, php-format
28
  msgid "%s is enabled but not effective. It requires %s in order to work."
29
  msgstr ""
54
  "/><br />You can do it by clicking %s or use an external plugin such as %s."
55
  msgstr ""
56
 
57
+ #: ajax-search-for-woocommerce.php:240
58
  #, php-format
59
  msgid ""
60
  "%s: You need PHP version at least 7.0 to run this plugin. You are currently "
65
  msgid "-- Disabled"
66
  msgstr ""
67
 
68
+ #: includes/Admin/Troubleshooting.php:1227
69
+ #, php-format
70
+ msgid ""
71
+ "1. Unblock the default endpoint or get around the restrictions. Learn how to "
72
+ "solve the issue on our <a target=\"_blank\" href=\"%s\">documentation</a> "
73
+ "and fix it as soon as possible."
74
+ msgstr ""
75
+
76
+ #: includes/Admin/Troubleshooting.php:1228
77
+ msgid ""
78
+ "2. Once you do that, turn off the safe mode by clicking the following button:"
79
+ msgstr ""
80
+
81
+ #: partials/admin/indexer-header.php:86
82
  #, php-format
83
  msgid ""
84
  "<b>Maybe your server can’t send an HTTP requests to itself</b>. Visit the "
92
  "products "
93
  msgstr ""
94
 
95
+ #: includes/Admin/Troubleshooting.php:1234
96
+ msgid ""
97
+ "<strong>Warning:</strong> We have detected that the search endpoint is being "
98
+ "overwritten by the filter and alternative search endpoint will not work "
99
+ "properly. Remove filters that override the search engine endpoint."
100
+ msgstr ""
101
+
102
+ #: includes/Admin/Troubleshooting.php:842
103
  msgid ""
104
  "A real solution is to find the reason why the WP-Cron doesn’t work and fix "
105
  "it."
106
  msgstr ""
107
 
108
+ #: includes/Admin/Troubleshooting.php:1586
109
  msgid "A search engine's AJAX call did not return valid results"
110
  msgstr ""
111
 
112
+ #: includes/Admin/Troubleshooting.php:678
113
  #, php-format
114
  msgid ""
115
  "Add <strong>Archive Products</strong> widget to the template <strong>"
118
  "documentation</a>."
119
  msgstr ""
120
 
121
+ #: includes/Admin/Troubleshooting.php:1044
122
  #, php-format
123
  msgid "Add a constant <code>%s</code> to your <code>wp-config.php</code> file."
124
  msgstr ""
125
 
126
+ #: partials/admin/indexer-header.php:57
127
  msgid ""
128
  "Add below code to your child theme’s <em>functions.php</em> file or via a "
129
  "plugin that allows custom functions to be added, such as the <a href=\"https:"
131
  "plugin."
132
  msgstr ""
133
 
134
+ #: partials/admin/indexer-header.php:71
135
  msgid ""
136
  "Add below code to your child theme’s <em>functions.php</em> file or via a "
137
  "plugin that allows custom functions to be added, such as the <a href=\"https:"
148
  msgid "Add new rule"
149
  msgstr ""
150
 
151
+ #: includes/Admin/Troubleshooting.php:731
152
+ msgid ""
153
+ "Add the following PHP code to your functions.php file in the child theme or "
154
+ "use e.g. CodeSnippets plugin."
155
+ msgstr ""
156
+
157
+ #: includes/Admin/Troubleshooting.php:1753
158
  msgid "Add the following URL to the white list:"
159
  msgstr ""
160
 
161
+ #: includes/Admin/Troubleshooting.php:1701
162
  msgid ""
163
  "Adding extra rules to <code>/usr/local/nginx/conf/wpsecure_${vhostname}."
164
  "conf</code>"
173
  msgid "AJAX (live) search form for WooCommerce"
174
  msgstr ""
175
 
 
 
 
 
176
  #: partials/admin/indexer-header.php:21
177
  msgid "All product changes will be <strong>re-indexed automatically</strong>"
178
  msgstr ""
179
 
180
+ #: includes/Admin/Troubleshooting.php:1232
181
+ #, php-format
182
+ msgid "Alternative endpoint: <code>%s</code>"
183
+ msgstr ""
184
+
185
+ #: includes/Admin/Troubleshooting.php:1868
186
+ msgid "Alternative search endpoint"
187
+ msgstr ""
188
+
189
  #: includes/Abstracts/ThemeIntegration.php:70
190
  #: includes/Integrations/Themes/TheGem/TheGem.php:100
191
  #: includes/Integrations/Themes/TheGem/TheGem.php:108
208
  msgid "Alternative ways to embed a search bar"
209
  msgstr ""
210
 
211
+ #: includes/Admin/Troubleshooting.php:922
212
  #, php-format
213
  msgid ""
214
  "An error occurred while trying to connect to the database using a PDO_MYSQL "
260
  msgid "Basic"
261
  msgstr ""
262
 
263
+ #: includes/Admin/Troubleshooting.php:1873
264
  msgid "Blocked search endpoint test"
265
  msgstr ""
266
 
281
  msgstr ""
282
 
283
  #: partials/admin/indexer-header-demo.php:15
284
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:700
285
  msgid "Build index"
286
  msgstr ""
287
 
288
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:649
289
  msgid "Canceling..."
290
  msgstr ""
291
 
293
  msgid "Cancellation..."
294
  msgstr ""
295
 
296
+ #: includes/Admin/Troubleshooting.php:1129
297
  msgid ""
298
  "Change the above-mentioned language codes to the correct format: <code>"
299
  "xx</code>, <code>xxx</code>, <code>xx-xx</code> or <code>xx-xxxx</code>."
300
  msgstr ""
301
 
302
+ #: includes/Admin/Troubleshooting.php:1509
303
+ #, php-format
304
+ msgid ""
305
+ "Check how to solve this issue in <a target=\"_blank\" href=\"%s\">our "
306
+ "documentation.</a> Before you fix the problem, switch on the alternative "
307
+ "search endpoint here: %s. This will allow the search engine to work again, "
308
+ "but search speed may not be optimal. Activate the alternative endpoint only "
309
+ "temporarily, and solve the source of the problem as soon as possible."
310
+ msgstr ""
311
+
312
  #: partials/admin/troubleshooting.php:22
313
  msgid "Check status again"
314
  msgstr ""
322
  msgid "Colors"
323
  msgstr ""
324
 
325
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:659
326
  msgid "Completed. Works."
327
  msgstr ""
328
 
330
  msgid "Contact"
331
  msgstr ""
332
 
333
+ #: partials/admin/indexer-header.php:53
334
+ msgid ""
335
+ "Contact your hosting provider and ask for increasing the value of the <code>"
336
+ "max_allowed_packet</code> variable in your MySQL server. It will definitely "
337
+ "solve the problem."
338
+ msgstr ""
339
+
340
+ #: partials/admin/indexer-header.php:64
341
  msgid ""
342
  "Contact your hosting provider and ask for increasing the value of the <code>"
343
  "max_connections</code> variable in your MySQL server. It will definitely "
344
  "solve the problem."
345
  msgstr ""
346
 
347
+ #: partials/admin/indexer-header.php:55
348
  msgid ""
349
  "Contact your hosting provider and ask for increasing the value of the <code>"
350
  "wait_timeout</code> variable in your MySQL server. It should solve the "
356
  msgid "continue reading"
357
  msgstr ""
358
 
359
+ #: includes/Admin/Troubleshooting.php:802
360
  #, php-format
361
  msgid ""
362
  "Could not load <code>wp-load.php</code> from the locations it normally is. "
364
  "support</a>."
365
  msgstr ""
366
 
367
+ #: includes/Admin/Troubleshooting.php:1235
368
+ #, php-format
369
+ msgid "Current endpoint: <code>%s</code>"
370
+ msgstr ""
371
+
372
+ #: includes/Admin/Troubleshooting.php:801
373
  msgid "Custom location of wp-load.php file"
374
  msgstr ""
375
 
389
  msgid "Default"
390
  msgstr ""
391
 
392
+ #: includes/Admin/Troubleshooting.php:1231
393
+ #, php-format
394
+ msgid "Default endpoint: <code>%s</code>"
395
+ msgstr ""
396
+
397
+ #: includes/Admin/Troubleshooting.php:1621
398
  msgid "Defender plugin by WPMU DEV blocks AJAX calls of the live search"
399
  msgstr ""
400
 
402
  msgid "Details panel"
403
  msgstr ""
404
 
405
+ #: includes/Admin/Troubleshooting.php:671
406
  msgid "Dismiss"
407
  msgstr ""
408
 
409
+ #: includes/Admin/Troubleshooting.php:377
410
  #, php-format
411
  msgid ""
412
  "Due to the way the TranslatePress - Multilingual plugin works, we can only "
414
  "version</a>."
415
  msgstr ""
416
 
417
+ #: includes/Admin/Troubleshooting.php:930
418
  msgid ""
419
  "Edit <code>wp-config.php</code> file, find the <code>DB_HOST</code> constant,"
420
  " and change its value from <code>localhost</code> to <code>127.0.0.1</code>."
421
  msgstr ""
422
 
423
+ #: includes/Admin/Troubleshooting.php:1790
424
  msgid "Elementor search results template"
425
  msgstr ""
426
 
427
+ #: includes/Admin/Troubleshooting.php:1498
428
+ msgid "Enable alternative search endpoint"
429
+ msgstr ""
430
+
431
  #: includes/Settings.php:682
432
  msgid "Enable Scheduler"
433
  msgstr ""
437
  msgid "End"
438
  msgstr ""
439
 
440
+ #: partials/admin/indexer-header.php:45
441
  #, php-format
442
  msgid "Error code %s"
443
  msgstr ""
444
 
445
+ #: includes/Admin/Troubleshooting.php:921
446
  msgid "Error establishing a database connection"
447
  msgstr ""
448
 
449
+ #: includes/Admin/Troubleshooting.php:1343
450
  #, php-format
451
  msgid "Error type: <strong>%s</strong>"
452
  msgstr ""
453
 
454
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:664
455
  msgid "Errors"
456
  msgstr ""
457
 
473
  msgid "Exclude/include products"
474
  msgstr ""
475
 
476
+ #: includes/Admin/Troubleshooting.php:611
477
  msgid "Extensions should looks like the picture below:"
478
  msgstr ""
479
 
502
  msgid "FiboSearch Team"
503
  msgstr ""
504
 
505
+ #: includes/Admin/Troubleshooting.php:923
506
  msgid ""
507
  "FiboSearch uses a PDO_MYSQL driver in the search engine. A proper database "
508
  "connection is required."
527
  msgid "Finalization... Wait a moment. (%s products)"
528
  msgstr ""
529
 
530
+ #: includes/Admin/Troubleshooting.php:1752
531
  msgid "Find section <code>Access Control -> whitelist URL</code>"
532
  msgstr ""
533
 
534
+ #: includes/Admin/Troubleshooting.php:1293
535
  msgid "Fix “Out of stock“ relationships"
536
  msgstr ""
537
 
551
  msgid "Fuzzy search"
552
  msgstr ""
553
 
554
+ #: includes/Admin/Troubleshooting.php:457
555
  #, php-format
556
  msgid ""
557
  "Go to <a href=\"%s\" target=\"_blank\">Tools -> Site Health</a> in your "
567
  "Header -> Search</code> and enable <code>Predictive Search</code>"
568
  msgstr ""
569
 
570
+ #: includes/Admin/Troubleshooting.php:1623
571
  #, php-format
572
  msgid ""
573
  "Go to <code>Defender -> Security Tweaks -> <a href=\"%s\" target=\"_blank\">"
575
  "exceptions: <code>%s</code>"
576
  msgstr ""
577
 
578
+ #: includes/Admin/Troubleshooting.php:735
579
  #, php-format
580
  msgid ""
581
+ "Go to <code>Security -> Settings -> Advanced -> <a href=\"%s\" "
582
+ "target=\"_blank\">System Tweaks</a></code>."
583
  msgstr ""
584
 
585
+ #: includes/Admin/Troubleshooting.php:560
586
  #, php-format
587
  msgid ""
588
  "Go to <code>WooCommerce -> Settings -> <a href=\"%s\" target=\"_blank\">"
590
  "option <code>%s</code>."
591
  msgstr ""
592
 
593
+ #: includes/Admin/Troubleshooting.php:610
594
  #, php-format
595
  msgid ""
596
  "Go to <code>WooCommerce -> Settings -> <a href=\"%s\" target=\"_blank\">"
598
  "Searching by Text</code> extension and save changes."
599
  msgstr ""
600
 
601
+ #: includes/Admin/Troubleshooting.php:963
602
  #, php-format
603
  msgid ""
604
  "Go to the <code>Jetpack settings page -> <a href=\"%s\" target=\"_blank\">"
605
  "Performance tab</a> -> disable the Search module</code>"
606
  msgstr ""
607
 
608
+ #: includes/Admin/Troubleshooting.php:888
609
+ #: includes/Admin/Troubleshooting.php:1045
610
+ #: includes/Admin/Troubleshooting.php:1130
611
+ #: includes/Admin/Troubleshooting.php:1163
612
  #, php-format
613
  msgid "Go to the Indexer tab and click the button <i>%s</i>."
614
  msgstr ""
615
 
616
+ #: includes/Admin/Troubleshooting.php:1128
617
  msgid ""
618
  "Go to the multilingual plugin settings page and find the section where you "
619
  "can edit the available languages."
620
  msgstr ""
621
 
622
+ #: includes/Admin/Troubleshooting.php:1751
623
  msgid "Go to the settings"
624
  msgstr ""
625
 
626
+ #: includes/Admin/Troubleshooting.php:521
627
  msgid "Great! Our plugin works great with this version of WordPress."
628
  msgstr ""
629
 
641
  msgid "Hard"
642
  msgstr ""
643
 
644
+ #: includes/Admin/Troubleshooting.php:1700
645
  msgid "Here are few samples NGINX config which helps other users:"
646
  msgstr ""
647
 
659
  "time now, and I hope you like it!"
660
  msgstr ""
661
 
662
+ #: partials/admin/indexer-header.php:103
663
  msgid "Hide details"
664
  msgstr ""
665
 
682
  "admin&utm_medium=referral&utm_campaign=author_uri&utm_gen=utmdc"
683
  msgstr ""
684
 
685
+ #: includes/Admin/Troubleshooting.php:1217
686
+ msgid "I've fixed it! Restore the default endpoint"
687
+ msgstr ""
688
+
689
  #: widget.php:41 includes/Settings.php:239 includes/EmbeddingViaMenu.php:189
690
  msgid "Icon on mobile, search bar on desktop"
691
  msgstr ""
692
 
693
+ #: includes/Admin/Troubleshooting.php:1076
694
  #, php-format
695
  msgid ""
696
  "If the following errors are related to your theme or plugins, try to fix "
698
  "target=\"_blank\">create a support ticket</a>."
699
  msgstr ""
700
 
701
+ #: partials/admin/indexer-header.php:89
702
  msgid ""
703
  "If the indexer still doesn't work, add a constant <code>"
704
  "define('DGWT_WCAS_INDEXER_MODE', 'sync');</code> to your <code>wp-config."
711
  "Help your customers to find the right products even <span>10× faster</span>."
712
  msgstr ""
713
 
714
+ #: includes/Admin/Troubleshooting.php:1710
715
+ #, php-format
716
+ msgid ""
717
+ "If you can't solve it on the NGINX level, try alternative 100%% reliable "
718
+ "solution described <a target=\"_blank\" href=\"%s\">in this article</a>."
719
+ msgstr ""
720
+
721
+ #: includes/Admin/Troubleshooting.php:1344
722
  msgid ""
723
  "If you have an object caching plugin, turn it off or check its settings. "
724
  "Ideally, the transients should not be cached in any way and stored directly "
725
  "in the database."
726
  msgstr ""
727
 
728
+ #: partials/admin/indexer-header.php:66
729
  msgid ""
730
  "If you see the <b>Troubleshooting tab</b> above, click it and try to solve "
731
  "the issues mentioned there"
732
  msgstr ""
733
 
734
+ #: includes/Admin/Troubleshooting.php:680
735
  #, php-format
736
  msgid ""
737
  "If you think the search results page is displaying your products correctly, "
759
  msgid "Include"
760
  msgstr ""
761
 
762
+ #: includes/Admin/Troubleshooting.php:608
763
  msgid ""
764
  "Incompatible \"Searching by Text\" extension from WOOF - WooCommerce "
765
  "Products Filter plugin is active"
766
  msgstr ""
767
 
768
+ #: includes/Admin/Troubleshooting.php:1786
769
  msgid ""
770
  "Incompatible \"Searching by Text\" extension in WOOF - WooCommerce Products "
771
  "Filter"
772
  msgstr ""
773
 
774
+ #: includes/Admin/Troubleshooting.php:1124
775
  msgid "Incompatible multilingual plugin setting"
776
  msgstr ""
777
 
778
+ #: includes/Admin/Troubleshooting.php:1778
779
  msgid "Incompatible plugins"
780
  msgstr ""
781
 
782
+ #: includes/Admin/Troubleshooting.php:1041
783
  msgid "Incompatible WPML Multilingual CMS plugin setting"
784
  msgstr ""
785
 
786
+ #: includes/Admin/Troubleshooting.php:558
787
+ #: includes/Admin/Troubleshooting.php:1782
788
  msgid "Incorrect \"Add to cart\" behaviour in WooCommerce settings"
789
  msgstr ""
790
 
804
  msgid "Index build start"
805
  msgstr ""
806
 
807
+ #: includes/Admin/Troubleshooting.php:1823
808
  msgid "Index completeness test"
809
  msgstr ""
810
 
835
  msgid "Individual tips and support by FiboSearch team"
836
  msgstr ""
837
 
838
+ #: includes/Admin/Troubleshooting.php:1863
839
  msgid "InnoDB support"
840
  msgstr ""
841
 
842
+ #: includes/Admin/Troubleshooting.php:839
843
  msgid ""
844
  "Install the <a target=\"_blank\" href=\"https://wordpress."
845
  "org/plugins/advanced-cron-manager/\">Advanced Cron Manager</a> plugin to "
847
  "related to the Indexer:"
848
  msgstr ""
849
 
850
+ #: includes/Admin/Troubleshooting.php:524
851
  msgid ""
852
  "Install the latest version of WordPress for our plugin to work as best it "
853
  "can!"
857
  msgid "Interval"
858
  msgstr ""
859
 
860
+ #: includes/Admin/Troubleshooting.php:1126
861
  #, php-format
862
  msgid "Invalid language code: <code>%s</code>"
863
  msgid_plural "Invalid language codes: <code>%s</code>"
864
  msgstr[0] ""
865
  msgstr[1] ""
866
 
867
+ #: partials/admin/indexer-header.php:92
868
  #, php-format
869
  msgid ""
870
  "Is it still not working? Visit the <a target=\"_blank\" href=\"%s\">"
872
  "request</a>"
873
  msgstr ""
874
 
875
+ #: includes/Admin/Troubleshooting.php:466
876
  #, php-format
877
  msgid ""
878
  "Is it still not working? Write a <a target=\"_blank\" href=\"%s\">support "
879
  "request</a>"
880
  msgstr ""
881
 
882
+ #: includes/Admin/Troubleshooting.php:460
883
  msgid ""
884
  "Is your website publicly available only for whitelisted IPs? <b>Add your "
885
  "server IP to the whitelist</b>. That’s all. This is a common mistake when "
888
  "requests to itself."
889
  msgstr ""
890
 
891
+ #: includes/Admin/Troubleshooting.php:816
892
+ #: includes/Admin/Troubleshooting.php:1818
893
  msgid "Issue with WP-Cron"
894
  msgstr ""
895
 
896
+ #: includes/Admin/Troubleshooting.php:729
897
+ msgid ""
898
+ "iThemes Security plugin blocks AJAX requests. Take a look at the solution."
899
  msgstr ""
900
 
901
+ #: includes/Admin/Troubleshooting.php:1833
902
  msgid "Jetpack search module"
903
  msgstr ""
904
 
920
  msgid "Logs"
921
  msgstr ""
922
 
923
+ #: includes/Admin/Troubleshooting.php:1796
924
  msgid "Loopback request"
925
  msgstr ""
926
 
947
  msgid "maximum number of suggestions"
948
  msgstr ""
949
 
950
+ #: includes/Admin/Troubleshooting.php:1508
951
  msgid ""
952
+ "Maybe your server blocks it by the Apache module <code>mod_security</code>. "
953
  "Contact your hosting provider and ask what can block the URL you see above."
954
  msgstr ""
955
 
965
  msgid "Minimum characters"
966
  msgstr ""
967
 
968
+ #: includes/Admin/Troubleshooting.php:997
969
  msgid "Missing plugin: WooCommerce Multilingual"
970
  msgstr ""
971
 
983
  msgid "More results label"
984
  msgstr ""
985
 
986
+ #: includes/Admin/Troubleshooting.php:1853
987
  msgid "Multilingual slugs"
988
  msgstr ""
989
 
991
  msgid "My Account"
992
  msgstr ""
993
 
994
+ #: includes/Admin/Troubleshooting.php:1697
 
 
 
 
 
 
 
 
995
  msgid "NGINX configuration may blocks search requests"
996
  msgstr ""
997
 
1007
  msgid "No thanks"
1008
  msgstr ""
1009
 
1010
+ #: includes/Admin/Troubleshooting.php:1848
1011
  msgid "Non Critical Indexer Errors"
1012
  msgstr ""
1013
 
1019
  msgid "Normal"
1020
  msgstr ""
1021
 
1022
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:670
1023
  msgid "Not exist"
1024
  msgstr ""
1025
 
1027
  msgid "Note: We currently only support the header type: \"Header 10\""
1028
  msgstr ""
1029
 
1030
+ #: includes/Admin/Troubleshooting.php:1858
1031
  msgid "Old index"
1032
  msgstr ""
1033
 
1034
+ #: includes/Admin/Troubleshooting.php:482
1035
  msgid "One or more required PHP extensions are missing on your server"
1036
  msgstr ""
1037
 
1039
  msgid "Overlay on mobile"
1040
  msgstr ""
1041
 
1042
+ #: includes/Admin/Troubleshooting.php:1828
1043
  msgid "PDO connection test"
1044
  msgstr ""
1045
 
1046
+ #: includes/Admin/Troubleshooting.php:1774
1047
  msgid "PHP extensions"
1048
  msgstr ""
1049
 
1067
  msgid "Pro features"
1068
  msgstr ""
1069
 
1070
+ #: includes/Admin/Troubleshooting.php:1336
1071
  msgid "Problem with WordPress Transients API"
1072
  msgstr ""
1073
 
1087
  msgid "Products"
1088
  msgstr ""
1089
 
1090
+ #: partials/search-form.php:31 partials/admin/search-preview.php:34
1091
  msgid "Products search"
1092
  msgstr ""
1093
 
1105
  msgid "px"
1106
  msgstr ""
1107
 
1108
+ #: includes/Admin/Troubleshooting.php:465
 
 
 
 
1109
  #, php-format
1110
  msgid ""
1111
  "Read more about indexer issues on <a target=\"_blank\" href=\"%s\">our "
1113
  "request to itself”."
1114
  msgstr ""
1115
 
1116
+ #: includes/Admin/Troubleshooting.php:738
1117
+ #, php-format
1118
+ msgid ""
1119
+ "Read more about this issue in <a href=\"%s\" target=\"_blank\">our "
1120
+ "documentation</a>."
1121
+ msgstr ""
1122
+
1123
  #: partials/admin/indexer-body.php:90
1124
  msgid "Readable"
1125
  msgstr ""
1126
 
1127
+ #: includes/Admin/Troubleshooting.php:882
1128
+ #: includes/Admin/Troubleshooting.php:1038
1129
+ #: includes/Admin/Troubleshooting.php:1121
1130
+ #: includes/Admin/Troubleshooting.php:1159
1131
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:694
1132
  msgid "Rebuild index"
1133
  msgstr ""
1134
 
1210
  msgid "Replace the TheGem default search"
1211
  msgstr ""
1212
 
1213
+ #: includes/Admin/Troubleshooting.php:492
1214
+ #: includes/Admin/Troubleshooting.php:495
1215
  #, php-format
1216
  msgid "Required PHP extension: %s"
1217
  msgstr ""
1218
 
1219
+ #: includes/Admin/Troubleshooting.php:1588
1220
  msgid "Response body"
1221
  msgstr ""
1222
 
1268
  msgid "Scheduling indexing"
1269
  msgstr ""
1270
 
1271
+ #: includes/Settings.php:218 partials/search-form.php:47
1272
  msgid "Search"
1273
  msgstr ""
1274
 
1411
  msgid "select the custom fields you want to add to the search scope"
1412
  msgstr ""
1413
 
1414
+ #: includes/Admin/Troubleshooting.php:2017
1415
  msgid "Server environment"
1416
  msgstr ""
1417
 
1418
+ #: includes/Admin/Troubleshooting.php:1501
1419
+ #: includes/Admin/Troubleshooting.php:1587
1420
  #, php-format
1421
  msgid ""
1422
  "Server response with message <code>%s</code> and status code <code>%s</code>."
1427
  msgid "Settings"
1428
  msgstr ""
1429
 
1430
+ #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:242
1431
  #, php-format
1432
  msgid "Show %s"
1433
  msgstr ""
1445
  msgstr ""
1446
 
1447
  #: partials/admin/indexer-header-demo.php:16
1448
+ #: partials/admin/indexer-header.php:102
1449
  msgid "Show details"
1450
  msgstr ""
1451
 
1455
 
1456
  #: includes/Settings.php:424 includes/Settings.php:428
1457
  #: includes/Integrations/Brands.php:229 includes/Integrations/Brands.php:233
1458
+ #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:208
1459
+ #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:212
1460
+ #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:253
1461
+ #: includes/Engines/TNTSearchMySQL/Indexer/Taxonomies.php:257
1462
  msgid "show images"
1463
  msgstr ""
1464
 
1514
  msgid "Sold by:"
1515
  msgstr ""
1516
 
1517
+ #: includes/Admin/Troubleshooting.php:559
1518
+ #: includes/Admin/Troubleshooting.php:609
1519
+ #: includes/Admin/Troubleshooting.php:677
1520
+ #: includes/Admin/Troubleshooting.php:838
1521
+ #: includes/Admin/Troubleshooting.php:929
1522
+ #: includes/Admin/Troubleshooting.php:1043
1523
+ #: includes/Admin/Troubleshooting.php:1127
1524
+ #: includes/Admin/Troubleshooting.php:1622
1525
+ #: includes/Admin/Troubleshooting.php:1669
1526
+ #: includes/Admin/Troubleshooting.php:1749
 
1527
  msgid "Solution"
1528
  msgstr ""
1529
 
1530
+ #: includes/Admin/Troubleshooting.php:1506
1531
  msgid "Solutions"
1532
  msgstr ""
1533
 
1534
+ #: includes/Admin/Troubleshooting.php:453
1535
  msgid "Solutions:"
1536
  msgstr ""
1537
 
1538
+ #: includes/Admin/Troubleshooting.php:1698
1539
  #, php-format
1540
  msgid ""
1541
  "Some NGINX configuration may block executing PHP files included directly in "
1565
  msgid "Status"
1566
  msgstr ""
1567
 
1568
+ #: includes/Admin/Troubleshooting.php:730
1569
+ #: includes/Admin/Troubleshooting.php:733
1570
+ #, php-format
1571
+ msgid "Step %d"
1572
+ msgstr ""
1573
+
1574
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:691
1575
  msgid "Stop process"
1576
  msgstr ""
1577
 
1583
  msgid "Submit label"
1584
  msgstr ""
1585
 
1586
+ #: includes/Admin/Troubleshooting.php:1748
1587
  msgid "Sucuri Security firewall may block AJAX calls of the live search"
1588
  msgstr ""
1589
 
1620
  msgid "Text color"
1621
  msgstr ""
1622
 
1623
+ #: includes/Admin/Troubleshooting.php:1668
1624
  msgid "The .htaccess file(s) may blocking AJAX calls of the live search"
1625
  msgstr ""
1626
 
1627
+ #: includes/Admin/Troubleshooting.php:1226
1628
+ msgid ""
1629
+ "The default search endpoint has been blocked and you decided to switch on "
1630
+ "the alternative endpoint to make the search working in emergency mode. What "
1631
+ "should you do next?"
1632
+ msgstr ""
1633
+
1634
  #: includes/Settings.php:463
1635
  msgid ""
1636
  "The Details panel is an additional container for extended information. The "
1645
  "mean a lot to me if you %ssupport it with a quick review on WordPress.org.%s"
1646
  msgstr ""
1647
 
1648
+ #: partials/admin/indexer-header.php:43
1649
  msgid "The following error caused the index to be canceled:"
1650
  msgstr ""
1651
 
1652
+ #: includes/Admin/Troubleshooting.php:1162
1653
  msgid "The index was built by the previous plugin version"
1654
  msgstr ""
1655
 
1656
+ #: includes/Admin/Troubleshooting.php:448
1657
  msgid ""
1658
  "The Indexer uses the WordPress function <code>wp_remote_post()</code> to "
1659
  "build the index in background. Sometimes the server can block this kind of "
1660
  "request and responses with HTTP 401 Unauthorized or 403 Forbidden errors."
1661
  msgstr ""
1662
 
1663
+ #: includes/Admin/Troubleshooting.php:1192
1664
  msgid ""
1665
  "The InnoDB engine within the MySQL server must be enabled for our plugin to "
1666
  "work properly. Contact your hosting provider and ask for enabling InnoDB "
1667
  "engine in your MySQL server."
1668
  msgstr ""
1669
 
1670
+ #: includes/Admin/Troubleshooting.php:962
1671
  #, php-format
1672
  msgid "The Jetpack Search module is incompatible with the %s plugin."
1673
  msgstr ""
1678
  "designed advanced AJAX search bar with live search suggestions."
1679
  msgstr ""
1680
 
1681
+ #: includes/Admin/Troubleshooting.php:1191
1682
  msgid "The MySQL server has the InnoDB engine turned off"
1683
  msgstr ""
1684
 
1687
  msgid "the next index rebuild: %s"
1688
  msgstr ""
1689
 
1690
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:663
1691
  msgid "The search index could not be built."
1692
  msgstr ""
1693
 
1694
  #: partials/admin/indexer-header-demo.php:11
1695
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:669
1696
  msgid "The search index does not exist yet. Build it now."
1697
  msgstr ""
1698
 
1699
+ #: includes/Admin/Troubleshooting.php:886
1700
+ msgid "The search index structure isn't complete"
1701
  msgstr ""
1702
 
1703
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:657
1704
  msgid ""
1705
  "The search index was built successfully, but some non-critical errors "
1706
  "occurred."
1707
  msgstr ""
1708
 
1709
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:655
1710
  msgid "The search index was built successfully."
1711
  msgstr ""
1712
 
1713
+ #: includes/Admin/Troubleshooting.php:1075
1714
  msgid ""
1715
  "The search index was built, but some significant errors occurred during this "
1716
  "process. There is a risk that some products may not be available during the "
1717
  "search."
1718
  msgstr ""
1719
 
1720
+ #: includes/Admin/Troubleshooting.php:1503
1721
  msgid ""
1722
  "The search uses a dedicated URL to makes queries. In your case, this URL is "
1723
  "blocked for some reason. Let visit it directly in your browser:"
1727
  msgid "The search will open in overlay on mobile"
1728
  msgstr ""
1729
 
1730
+ #: includes/Admin/Troubleshooting.php:1500
1731
  msgid ""
1732
  "The server returns an incorrect response for the search engine's AJAX calls"
1733
  msgstr ""
1739
  "adding synonyms."
1740
  msgstr ""
1741
 
1742
+ #: includes/Admin/Troubleshooting.php:1341
1743
  msgid "the transient value was cached and existed too long"
1744
  msgstr ""
1745
 
1746
+ #: includes/Admin/Troubleshooting.php:1339
1747
  msgid "the transient value was not returned"
1748
  msgstr ""
1749
 
1755
  msgid "There are four easy ways to display the search bar in your theme"
1756
  msgstr ""
1757
 
1758
+ #: includes/Admin/Troubleshooting.php:1295
1759
  msgid ""
1760
  "There is a problem with the visibility of products with “Out of stock“ status"
1761
  msgstr ""
1762
 
1763
+ #: includes/Admin/Troubleshooting.php:675
1764
  msgid ""
1765
  "There is no correct template in Elementor Theme Builder for the WooCommerce "
1766
  "search results page."
1767
  msgstr ""
1768
 
1769
+ #: includes/Admin/Troubleshooting.php:1507
1770
  msgid ""
1771
  "Think about what can block the execution of PHP scripts inside <code>wp-"
1772
  "content</code> or <code>wp-content/plugins</code> directory. Maybe you use "
1773
  "some security plugins or you have custom code that may block it."
1774
  msgstr ""
1775
 
1776
+ #: includes/Admin/Troubleshooting.php:447
1777
  msgid ""
1778
  "This issue may affect the building of the search index. Indexer may stuck at "
1779
  "0%."
1780
  msgstr ""
1781
 
1782
+ #: includes/Admin/Troubleshooting.php:443
1783
  msgid ""
1784
  "This issue may affect the search results page and e.g. display all products "
1785
  "every time"
1786
  msgstr ""
1787
 
1788
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:637
1789
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:643
1790
  msgid "This process will continue in the background. You can leave this page!"
1791
  msgstr ""
1792
 
1813
  msgid "To set 100% width leave blank"
1814
  msgstr ""
1815
 
1816
+ #: includes/Admin/Troubleshooting.php:1297
1817
  #, php-format
1818
  msgid ""
1819
  "Total “out of stock“ products calculated by <code>wc_get_products()</code> "
1820
  "function: <b>%d</b>"
1821
  msgstr ""
1822
 
1823
+ #: includes/Admin/Troubleshooting.php:1298
1824
  #, php-format
1825
  msgid ""
1826
  "Total “out of stock“ products calculated by SQL query on <code>%s</code>: <b>"
1827
  "%d</b>"
1828
  msgstr ""
1829
 
1830
+ #: includes/Admin/Troubleshooting.php:1888
1831
  msgid "Transients test"
1832
  msgstr ""
1833
 
1834
+ #: includes/Admin/Troubleshooting.php:1805
1835
  msgid "TranslatePress"
1836
  msgstr ""
1837
 
1838
+ #: includes/Admin/Troubleshooting.php:66 includes/Admin/Troubleshooting.php:85
1839
+ #: partials/admin/indexer-header.php:40
1840
  msgid "Troubleshooting"
1841
  msgstr ""
1842
 
1843
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:697
1844
  msgid "Try to build the index again."
1845
  msgstr ""
1846
 
1847
+ #: includes/Admin/Troubleshooting.php:736
1848
+ msgid ""
1849
+ "Uncheck the option <code>Disable PHP in Plugins</code>. Save settings. Right "
1850
+ "after that <b>check this option again</b> and save settings one more time."
1851
+ msgstr ""
1852
+
1853
  #: partials/admin/features.php:16
1854
  msgid ""
1855
  "Update now and boosts your sales. You will receive <b>30-day satisfaction "
1884
  msgid "Using PHP - %s"
1885
  msgstr ""
1886
 
1887
+ #: includes/Admin/Troubleshooting.php:1878
1888
  msgid "Valid search results test"
1889
  msgstr ""
1890
 
1896
  msgid "Vendors"
1897
  msgstr ""
1898
 
1899
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:642
1900
  msgid "Wait... Indexing in progress"
1901
  msgstr ""
1902
 
1903
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:636
1904
  msgid "Wait... Preparing indexing in progress"
1905
  msgstr ""
1906
 
1907
+ #: includes/Engines/TNTSearchMySQL/Indexer/Builder.php:648
1908
  msgid "Wait... The index build process is canceling"
1909
  msgstr ""
1910
 
1912
  msgid "Warning!"
1913
  msgstr ""
1914
 
1915
+ #: includes/Admin/Troubleshooting.php:1670
1916
  #, php-format
1917
  msgid ""
1918
  "We recommend contact your hosting provider and ask to check <code>%s</code> "
1928
  "We support this theme and you can easily replace all default search bars."
1929
  msgstr ""
1930
 
1931
+ #: includes/Admin/Troubleshooting.php:1296
1932
  msgid ""
1933
  "We've detected that some products with a status “Out of Stock“ may have "
1934
  "something wrong with relationships in the database. It affects visibility of "
1940
  msgid "weekly"
1941
  msgstr ""
1942
 
1943
+ #: includes/Admin/Troubleshooting.php:1502
1944
  msgid "What's wrong?"
1945
  msgstr ""
1946
 
1952
  msgid "with simple tricks"
1953
  msgstr ""
1954
 
1955
+ #: includes/Admin/Troubleshooting.php:1838
1956
  msgid "WooCommerce Multilingual"
1957
  msgstr ""
1958
 
1959
+ #: includes/Admin/Troubleshooting.php:1002
1960
  msgid "WooCommerce Multilingual plugin is enabled but not effective"
1961
  msgstr ""
1962
 
1963
+ #: includes/Admin/Troubleshooting.php:1813
1964
  msgid "WordPress loading problem"
1965
  msgstr ""
1966
 
1967
+ #: includes/Admin/Troubleshooting.php:512
1968
+ #: includes/Admin/Troubleshooting.php:1770
1969
  msgid "WordPress version"
1970
  msgstr ""
1971
 
1972
+ #: includes/Admin/Troubleshooting.php:1843
1973
  msgid "WPML with disabled translations for products"
1974
  msgstr ""
1975
 
1976
+ #: includes/Admin/Troubleshooting.php:676
1977
  #, php-format
1978
  msgid ""
1979
  "You are using Elementor and we noticed that the template used in the search "
1981
  "Products</strong> widget."
1982
  msgstr ""
1983
 
1984
+ #: includes/Admin/Troubleshooting.php:325
1985
  msgid "You are using one or more incompatible plugins"
1986
  msgstr ""
1987
 
1988
+ #: includes/Admin/Troubleshooting.php:1125
1989
  msgid ""
1990
  "You are using the multilingual plugin, but one or more of the language codes "
1991
  "has wrong format. This needs to be corrected or the index will not be able "
1992
  "to build properly."
1993
  msgstr ""
1994
 
1995
+ #: includes/Admin/Troubleshooting.php:366
1996
  msgid "You are using TranslatePress with Free version of our plugin"
1997
  msgstr ""
1998
 
1999
+ #: includes/Admin/Troubleshooting.php:1042
2000
  msgid ""
2001
  "You are using WPML Multilingual CMS, but you have product translations "
2002
  "disabled, so for the search engine to function properly, you must disable "
2003
  "its multi-language support feature."
2004
  msgstr ""
2005
 
2006
+ #: includes/Admin/Troubleshooting.php:1299
2007
  #, php-format
2008
  msgid "You can fix it by clicking on this button: %s"
2009
  msgstr ""
2010
 
2011
+ #: includes/Admin/Troubleshooting.php:841
2012
  msgid ""
2013
  "You can run these actions manually via Advanced Cron Manager. Then the "
2014
  "Indexer should run. If the index stuck again, run these actions manually one "
2015
  "more time until the finished index."
2016
  msgstr ""
2017
 
2018
+ #: includes/Admin/Troubleshooting.php:1225
2019
+ msgid "You have activated the alternative search endpoint"
2020
+ msgstr ""
2021
+
2022
+ #: includes/Admin/Troubleshooting.php:1750
2023
  msgid ""
2024
  "You need to log in to your <a href=\"https://login.sucuri.net\" "
2025
  "target=\"_blank\">Sucuri panel</a>."
2026
  msgstr ""
2027
 
2028
+ #: includes/Admin/Troubleshooting.php:1505
2029
  msgid ""
2030
  "You should see <code>pong</code> word as a response. Probably you see "
2031
  "something else."
2036
  msgid "You use %s plugin version %s"
2037
  msgstr ""
2038
 
2039
+ #: includes/Admin/Troubleshooting.php:345
2040
+ #: includes/Admin/Troubleshooting.php:347
2041
  #, php-format
2042
  msgid ""
2043
  "You use the %s plugin, which may cause errors in the search results returned "
2044
  "by our plugin."
2045
  msgstr ""
2046
 
2047
+ #: includes/Admin/Troubleshooting.php:336
2048
+ #: includes/Admin/Troubleshooting.php:340
2049
  #, php-format
2050
  msgid "You use the %s plugin. The %s does not support this plugin."
2051
  msgstr ""
2055
  msgid "You use the <b>%s</b> theme%s. Fantastic!"
2056
  msgstr ""
2057
 
2058
+ #: includes/Admin/Troubleshooting.php:1003
2059
  #, php-format
2060
  msgid ""
2061
  "You use the WPML Multilingual CMS and WooCommerce Multilingual plugins, but "
2063
  "target=\"_blank\">WooCommerce Multilingual status</a>."
2064
  msgstr ""
2065
 
2066
+ #: includes/Admin/Troubleshooting.php:998
2067
  #, php-format
2068
  msgid ""
2069
  "You use the WPML Multilingual CMS plugin and to correctly search for "
2071
  "target=\"_blank\">WooCommerce Multilingual</a> plugin."
2072
  msgstr ""
2073
 
2074
+ #: includes/Admin/Troubleshooting.php:455
2075
  msgid "Your server can't send an HTTP request to itself"
2076
  msgstr ""
2077
 
2078
+ #: includes/Admin/Troubleshooting.php:561
2079
  msgid "Your settings should looks like the picture below:"
2080
  msgstr ""
2081
 
2082
+ #: includes/Admin/Troubleshooting.php:390
2083
  msgid "Your site can perform loopback requests"
2084
  msgstr ""
2085
 
2086
+ #: includes/Admin/Troubleshooting.php:439
2087
  msgid "Your site could not complete a loopback request"
2088
  msgstr ""
partials/search-form.php CHANGED
@@ -13,14 +13,15 @@ $layout = Helpers::getLayoutSettings();
13
  $submitText = Helpers::getLabel( 'submit' );
14
  $hasSubmit = DGWT_WCAS()->settings->getOption( 'show_submit_button' );
15
  $uniqueID = ++ DGWT_WCAS()->searchInstances;
16
- $layoutType = !empty($args['layout']) ? $args['layout'] : $layout->layout;
 
17
 
18
  $customParams = apply_filters( 'dgwt/wcas/search_bar/custom_params', array(), DGWT_WCAS()->searchInstances );
19
 
20
  ?>
21
- <div class="dgwt-wcas-search-wrapp <?php echo Helpers::searchWrappClasses( $args ); ?>">
22
  <?php if(in_array($layoutType, array('icon', 'icon-flexible'))): ?>
23
- <div class="dgwt-wcas-search-icon js-dgwt-wcas-search-icon-handler"><?php echo Helpers::getMagnifierIco('dgwt-wcas-ico-magnifier-handler'); ?></div>
24
  <div class="dgwt-wcas-search-icon-arrow"></div>
25
  <?php endif; ?>
26
  <form class="dgwt-wcas-search-form" role="search" action="<?php echo Helpers::searchFormAction(); ?>" method="get">
13
  $submitText = Helpers::getLabel( 'submit' );
14
  $hasSubmit = DGWT_WCAS()->settings->getOption( 'show_submit_button' );
15
  $uniqueID = ++ DGWT_WCAS()->searchInstances;
16
+ $layoutType = ! empty( $args['layout'] ) ? $args['layout'] : $layout->layout;
17
+ $isAMP = Helpers::isAMPEndpoint();
18
 
19
  $customParams = apply_filters( 'dgwt/wcas/search_bar/custom_params', array(), DGWT_WCAS()->searchInstances );
20
 
21
  ?>
22
+ <div <?php echo $isAMP ? "id='dgwt-wcas-search-wrapp{$uniqueID}'" : ''; ?> class="dgwt-wcas-search-wrapp <?php echo Helpers::searchWrappClasses( $args ); ?>">
23
  <?php if(in_array($layoutType, array('icon', 'icon-flexible'))): ?>
24
+ <div <?php echo $isAMP ? "on='tap:dgwt-wcas-search-wrapp{$uniqueID}.toggleClass(class=\"dgwt-wcas-layout-icon-open\")'" : ""; ?> class="dgwt-wcas-search-icon js-dgwt-wcas-search-icon-handler"><?php echo Helpers::getMagnifierIco('dgwt-wcas-ico-magnifier-handler'); ?></div>
25
  <div class="dgwt-wcas-search-icon-arrow"></div>
26
  <?php endif; ?>
27
  <form class="dgwt-wcas-search-form" role="search" action="<?php echo Helpers::searchFormAction(); ?>" method="get">
partials/themes/divi.php CHANGED
@@ -50,7 +50,7 @@ add_action( 'wp_footer', function () {
50
  // Header style: Default, Centered Inline Logo
51
  var mainHeader = $('.et_header_style_left #main-header, .et_header_style_split #main-header');
52
  if (mainHeader.eq(0)) {
53
- var mainHeaderHeight = mainHeader.outerHeight();
54
  if (mainHeaderHeight > 0) {
55
  $('.et_search_form_container .dgwt-wcas-search-wrapp').css('top', (mainHeaderHeight - 40) / 2);
56
  }
@@ -85,7 +85,7 @@ add_action( 'wp_footer', function () {
85
  });
86
 
87
  // Open overlay automatically
88
- $('#et_top_search #et_search_icon').on('click', function () {
89
  if ($(window).width() <= 980) {
90
  var $handler = $('.et_search_outer .js-dgwt-wcas-enable-mobile-form');
91
  if ($handler.length) {
@@ -95,7 +95,7 @@ add_action( 'wp_footer', function () {
95
  setTimeout(function () {
96
  var $closeBtn = $('.et_close_search_field');
97
  if ($closeBtn.length) {
98
- $closeBtn[0].click();
99
  }
100
  }, 1100)
101
  }
@@ -112,7 +112,7 @@ add_action( 'wp_footer', function () {
112
  setTimeout(function () {
113
  var $closeBtn = $('.et_pb_menu__close-search-button');
114
  if ($closeBtn.length) {
115
- $closeBtn[0].click();
116
  }
117
  }, 1100)
118
  } else {
50
  // Header style: Default, Centered Inline Logo
51
  var mainHeader = $('.et_header_style_left #main-header, .et_header_style_split #main-header');
52
  if (mainHeader.eq(0)) {
53
+ var mainHeaderHeight = mainHeader.outerHeight(false);
54
  if (mainHeaderHeight > 0) {
55
  $('.et_search_form_container .dgwt-wcas-search-wrapp').css('top', (mainHeaderHeight - 40) / 2);
56
  }
85
  });
86
 
87
  // Open overlay automatically
88
+ $('#et_top_search #et_search_icon, #et_top_search_mob #et_search_icon').on('click', function () {
89
  if ($(window).width() <= 980) {
90
  var $handler = $('.et_search_outer .js-dgwt-wcas-enable-mobile-form');
91
  if ($handler.length) {
95
  setTimeout(function () {
96
  var $closeBtn = $('.et_close_search_field');
97
  if ($closeBtn.length) {
98
+ $closeBtn.click();
99
  }
100
  }, 1100)
101
  }
112
  setTimeout(function () {
113
  var $closeBtn = $('.et_pb_menu__close-search-button');
114
  if ($closeBtn.length) {
115
+ $closeBtn.click();
116
  }
117
  }, 1100)
118
  } else {
partials/themes/goya.php CHANGED
@@ -47,4 +47,4 @@ add_action( 'wp_footer', function () {
47
  }
48
  </style>
49
  <?php
50
- } );
47
  }
48
  </style>
49
  <?php
50
+ }, 12);
partials/themes/open-shop.php CHANGED
@@ -53,6 +53,9 @@ add_action( 'wp_footer', function () {
53
  .dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp {
54
  padding-left: 0;
55
  }
 
 
 
56
  </style>
57
  <?php
58
  if ( get_theme_mod( 'open_shop_sticky_header', false ) === true ) {
53
  .dgwt-wcas-overlay-mobile .dgwt-wcas-search-wrapp {
54
  padding-left: 0;
55
  }
56
+ .below-header-bar .dgwt-wcas-search-wrapp {
57
+ padding-left: 18px;
58
+ }
59
  </style>
60
  <?php
61
  if ( get_theme_mod( 'open_shop_sticky_header', false ) === true ) {
partials/themes/storefront.php CHANGED
@@ -1,5 +1,7 @@
1
  <?php
2
 
 
 
3
  // Exit if accessed directly
4
  if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
5
  exit;
@@ -19,6 +21,17 @@ if ( ! function_exists( 'storefront_product_search' ) ) {
19
  add_action( 'wp_footer', 'dgwt_wcas_storefront_inverse_orientation', 100 );
20
 
21
  function dgwt_wcas_storefront_inverse_orientation() {
 
 
 
 
 
 
 
 
 
 
 
22
  ?>
23
  <script>
24
  (function ($) {
@@ -37,3 +50,17 @@ function dgwt_wcas_storefront_inverse_orientation() {
37
  </script>
38
  <?php
39
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
2
 
3
+ use DgoraWcas\Helpers;
4
+
5
  // Exit if accessed directly
6
  if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
7
  exit;
21
  add_action( 'wp_footer', 'dgwt_wcas_storefront_inverse_orientation', 100 );
22
 
23
  function dgwt_wcas_storefront_inverse_orientation() {
24
+ if ( Helpers::isAMPEndpoint() ) {
25
+ ?>
26
+ <style>
27
+ #page.search-mobile-active .storefront-handheld-footer-bar ul li.search .site-search {
28
+ bottom: 100%;
29
+ }
30
+ </style>
31
+ <?php
32
+
33
+ return;
34
+ }
35
  ?>
36
  <script>
37
  (function ($) {
50
  </script>
51
  <?php
52
  }
53
+
54
+ /**
55
+ * Toole mobile search when AMP is active
56
+ */
57
+ if ( ! function_exists( 'storefront_handheld_footer_bar_search' ) ) {
58
+ function storefront_handheld_footer_bar_search() {
59
+ if ( Helpers::isAMPEndpoint() ) {
60
+ echo '<a on="tap:page.toggleClass(class=\'search-mobile-active\')" href="javascript:void(0);">' . esc_attr__( 'Search', 'storefront' ) . '</a>';
61
+ } else {
62
+ echo '<a href="">' . esc_attr__( 'Search', 'storefront' ) . '</a>';
63
+ }
64
+ storefront_product_search();
65
+ }
66
+ }
partials/themes/uncode.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Exit if accessed directly
3
+ if ( ! defined( 'DGWT_WCAS_FILE' ) ) {
4
+ exit;
5
+ }
6
+
7
+ add_filter( 'dgwt/wcas/scripts/mobile_breakpoint', function () {
8
+ return 960;
9
+ } );
10
+
11
+ add_action( 'wp_footer', function () {
12
+ echo '<div id="wcas-desktop-search" style="display: none;">' . do_shortcode( '[wcas-search-form layout="icon"]' ) . '</div>';
13
+ echo '<div id="wcas-mobile-search" style="display: none;">' . do_shortcode( '[wcas-search-form layout="icon"]' ) . '</div>';
14
+ ?>
15
+ <script>
16
+ var desktopSearch = document.querySelector('.menu-wrapper a.search-icon');
17
+ if (desktopSearch !== null) {
18
+ desktopSearch.replaceWith(document.querySelector('#wcas-desktop-search > div'));
19
+ }
20
+ document.querySelector('#wcas-desktop-search').remove()
21
+
22
+ var mobileSearch = document.querySelector('.menu-wrapper a.mobile-search-icon');
23
+ if (mobileSearch !== null) {
24
+ mobileSearch.replaceWith(document.querySelector('#wcas-mobile-search > div'));
25
+ }
26
+ document.querySelector('#wcas-mobile-search').remove();
27
+ </script>
28
+
29
+ <style>
30
+ .menu-icons .dgwt-wcas-search-wrapp {
31
+ margin-right: 9px;
32
+ }
33
+
34
+ .dgwt-wcas-ico-magnifier-handler {
35
+ max-width: 18px;
36
+ }
37
+
38
+ .dgwt-wcas-sf-wrapp input[type=search].dgwt-wcas-search-input {
39
+ border-color: #ddd !important;
40
+ }
41
+
42
+ .menu-dark .dgwt-wcas-search-icon path {
43
+ fill: #ffffff;
44
+ }
45
+
46
+ .menu-dark .dgwt-wcas-search-icon:hover path {
47
+ fill: rgba(255, 255, 255, 0.5);
48
+ }
49
+
50
+ @media (max-width: 959px) {
51
+ .menu-icons .dgwt-wcas-search-wrapp {
52
+ padding: 9px 36px 9px 36px;
53
+ max-width: none;
54
+ }
55
+ }
56
+ </style>
57
+ <?php
58
+ } );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: woocommerce search, ajax search, search by sku, product search, woocommerc
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
  Requires PHP: 7.0
7
- Stable tag: 1.14.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -14,7 +14,7 @@ The most popular WooCommerce product search plugin. Gives your users a well-desi
14
 
15
  The most popular **WooCommerce product search plugin**. It gives your users a well-designed advanced AJAX search bar with live search suggestions.
16
 
17
- By default, WooCommerce provides a very simple search solution, without live product search or even SKU search. FiboSearch (Ajax Search for WooCommerce) provides advanced search with live suggestions.
18
 
19
  Who doesn’t love instant, as-you-type suggestions? In 2021, customers expect smart product search. Baymard Institute’s latest UX research reveals that search autocomplete, auto-suggest, or an instant search feature **is now offered on 96% of major e-commerce sites**. It's a must-have feature for every online business that can’t afford to lose customers. Why? FiboSearch helps users save time and makes shopping easier. As a result, Fibo really boosts sales.
20
 
@@ -105,7 +105,7 @@ We have prepared a one-click replacement of the search bar for the following the
105
  * Astra
106
  * Avada
107
  * Sailent
108
- * and 30 more... See a complete list of integrated themes on [our documentation](https://fibosearch.com/documentation/themes-integrations/?utm_source=readme&utm_medium=referral&utm_campaign=asfw&utm_content=theme-integrations).
109
 
110
 
111
  If you want to replace your search bar in another theme, please [contact our support team](https://fibosearch.com/contact/?utm_source=readme&utm_medium=referral&utm_campaign=asfw&utm_content=contact&utm_gen=utmdc).
@@ -142,6 +142,25 @@ You can read more and compare Pro and Free features here: [Full comparison - Pro
142
 
143
  == Changelog ==
144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  = 1.14.0, October 19, 2021 =
146
  * ADD: Integration with “GeneratePress” theme
147
  * ADD: Possibility to set a delay for initialization of mobile overlay
4
  Requires at least: 5.0
5
  Tested up to: 5.8
6
  Requires PHP: 7.0
7
+ Stable tag: 1.15.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
14
 
15
  The most popular **WooCommerce product search plugin**. It gives your users a well-designed advanced AJAX search bar with live search suggestions.
16
 
17
+ By default, WooCommerce provides a very simple search solution, without live product search or even SKU search. FiboSearch (formerly Ajax Search for WooCommerce) provides advanced search with live suggestions.
18
 
19
  Who doesn’t love instant, as-you-type suggestions? In 2021, customers expect smart product search. Baymard Institute’s latest UX research reveals that search autocomplete, auto-suggest, or an instant search feature **is now offered on 96% of major e-commerce sites**. It's a must-have feature for every online business that can’t afford to lose customers. Why? FiboSearch helps users save time and makes shopping easier. As a result, Fibo really boosts sales.
20
 
105
  * Astra
106
  * Avada
107
  * Sailent
108
+ * and 31 more... See a complete list of integrated themes on [our documentation](https://fibosearch.com/documentation/themes-integrations/?utm_source=readme&utm_medium=referral&utm_campaign=asfw&utm_content=theme-integrations).
109
 
110
 
111
  If you want to replace your search bar in another theme, please [contact our support team](https://fibosearch.com/contact/?utm_source=readme&utm_medium=referral&utm_campaign=asfw&utm_content=contact&utm_gen=utmdc).
142
 
143
  == Changelog ==
144
 
145
+ = 1.15.0, December 16, 2021 =
146
+ * ADD: Integration with a Uncode theme
147
+ * ADD: Integration with Uncode theme - support for dark menu skin
148
+ * ADD: Possibility to submit the search event to Google Analytics in your own way
149
+ * ADD: Basic support for AMP
150
+ * ADD: Allow getting search results programmatically
151
+
152
+ * FIX: Integration with the Goya theme has stopped working
153
+ * FIX: Divi theme integration - overlay on mobile was fixed. Support for new Divi ID #et_top_search_mob
154
+ * FIX: Divi theme integration - search form did not disappear after exiting mobile overlay
155
+ * FIX: Search suggestions were invisible because of a bug in the old version of jQuery UI. The method outerHeight() returned an object instead of a number
156
+ * FIX: Simplifying integration with Polylang
157
+
158
+ * CHANGE: Remove info about rebranding
159
+
160
+
161
+
162
+
163
+
164
  = 1.14.0, October 19, 2021 =
165
  * ADD: Integration with “GeneratePress” theme
166
  * ADD: Possibility to set a delay for initialization of mobile overlay