Ajax Search Lite - Version 4.9

Version Description

  • Added: Keyword highlighting and scrolling on the single results page
  • Added: JS hooks
  • Added: Options to change theme colors, result background, results box background, title fonts, description and other fonts
  • Added: Ordering - by menu order and by custom field added
  • Added: advanced title and content fields
  • Added: description context option
  • Added: exact match location option
  • Added: image options -> background cover
  • Added: Advanced Options -> Keyword exceptions tab
  • Added: image options -> image filename exclusions
  • Changed: Updated the engine and the API from the Pro version
  • Changed: jquery.gestures.js removed - not needed anymore
  • Compatibility checked against WP 5.7
  • Fixed: Posts per page option - changed to "auto" by default, parses the wordpress value if not set
  • Fixed: Results keyword highlighter now supports accented/non-accented keywords
  • Fixed: Context finder function - fixed an issue when the minimum word length is below the first phrase word lenght, the function returned the incorrect (long) string
  • Fixed: Context finder function - now accented and non-accented variations will also work
  • Fixed: Russian quotation marks for exact matches are now recognized:
  • Fixed: wp_localize_script - some uses of that function replaced with an internal solution, to prevent cache plugin incompatibilities
  • Fixed: Known possible jQuery.migrate deprecation warnings
Download this release

Release Info

Developer wpdreams
Plugin Icon 128x128 Ajax Search Lite
Version 4.9
Comparing to
See all releases

Code changes from version 4.8.6 to 4.9

Files changed (64) hide show
  1. ajax-search-lite.php +7 -6
  2. backend/compatibility.php +51 -175
  3. backend/go_pro.php +30 -0
  4. backend/maintenance.php +1 -1
  5. backend/performance_options.php +26 -21
  6. backend/settings.php +15 -4
  7. backend/settings/assets/compatibility_settings.js +26 -0
  8. backend/settings/assets/go_pro.css +63 -0
  9. backend/settings/assets/search_instance.js +106 -4
  10. backend/settings/assets/style.css +66 -5
  11. backend/settings/assets/tabs.js +38 -41
  12. backend/settings/assets/textarea-autosize/jquery.textarea-autosize.js +55 -0
  13. backend/settings/assets/types.js +5 -0
  14. backend/settings/class/customposttypeseditable.class.php +17 -3
  15. backend/settings/class/textarea-expandable.class.php +21 -0
  16. backend/settings/class/wd_cf_search_callback.class.php +1 -1
  17. backend/settings/default_options.php +48 -29
  18. backend/settings/types.inc.php +6 -0
  19. backend/tabs/compatibility/cssjs_options.php +98 -0
  20. backend/tabs/compatibility/query_options.php +54 -0
  21. backend/tabs/instance/advanced/content.php +100 -0
  22. backend/tabs/instance/advanced/exclude_results.php +54 -0
  23. backend/tabs/instance/advanced/kw_exceptions.php +15 -0
  24. backend/tabs/instance/advanced_options.php +36 -105
  25. backend/tabs/instance/frontend_options.php +0 -14
  26. backend/tabs/instance/general/autocomplete.php +0 -6
  27. backend/tabs/instance/general/behavior.php +189 -154
  28. backend/tabs/instance/general/ordering.php +65 -30
  29. backend/tabs/instance/general_options.php +22 -7
  30. backend/tabs/instance/image_options.php +51 -48
  31. backend/tabs/instance/layout/box_layout.php +171 -98
  32. backend/tabs/instance/layout/keyword_highlight.php +79 -21
  33. backend/tabs/instance/layout/results_layout.php +12 -13
  34. backend/tabs/instance/layout_options.php +17 -11
  35. css/fonts/icons2.svg +1 -1
  36. css/style.basic.css +1 -1
  37. img/close/close1.svg +1 -1
  38. includes/classes/actions/class-asl-stylesheets.php +59 -0
  39. includes/classes/ajax/class-asl-search.php +60 -49
  40. includes/classes/core/class-asl-filters.php +7 -1
  41. includes/classes/core/class-asl-init.php +62 -5
  42. includes/classes/core/class-asl-menu.php +6 -1
  43. includes/classes/etc/class-asl_helpers.php +559 -138
  44. includes/classes/filters/class-asl-etc_fixes.php +19 -0
  45. includes/classes/filters/class-asl-searchoverride.php +83 -32
  46. includes/classes/search/class-asl-query.php +601 -0
  47. includes/classes/search/class-asl-search-cpt.php +1988 -0
  48. includes/classes/search/class-asl-search.php +437 -0
  49. includes/classes/search/search.class.php +0 -241
  50. includes/classes/search/search.controller.class.php +0 -167
  51. includes/classes/search/search.inc.php +3 -3
  52. includes/classes/search/search_content.class.php +0 -1362
  53. includes/functions/functions.php +75 -0
  54. includes/views/asl.shortcode.php +58 -82
  55. includes/views/result.php +1 -1
  56. js/min-scoped/jquery.ajaxsearchlite.min.js +2 -2
  57. js/min/jquery.ajaxsearchlite.min.js +2 -2
  58. js/nomin-scoped/asl_wrapper.js +26 -0
  59. js/nomin-scoped/jquery.ajaxsearchlite.js +67 -33
  60. js/nomin-scoped/jquery.gestures.js +0 -3
  61. js/nomin-scoped/jquery.highlight.js +9 -6
  62. js/nomin/asl_wrapper.js +26 -0
  63. js/nomin/jquery.ajaxsearchlite.js +67 -33
  64. js/nomin/jquery.gestures.js +0 -1
ajax-search-lite.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Ajax Search Lite
4
  Plugin URI: http://wp-dreams.com
5
  Description: The lite version of the most powerful ajax powered search engine for WordPress.
6
- Version: 4.8.6
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
@@ -19,14 +19,15 @@ define('ASL_INCLUDES_PATH', plugin_dir_path(__FILE__)."/includes/");
19
  define('ASL_CLASSES_PATH', plugin_dir_path(__FILE__)."/includes/classes/");
20
  define('ASL_FUNCTIONS_PATH', plugin_dir_path(__FILE__)."/includes/functions/");
21
  define('ASL_DIR', 'ajax-search-lite');
 
22
  define(
23
- 'ASL_URL',
24
- strpos(home_url('/'), 'https://') !== false || strpos(plugin_dir_url(__FILE__), 'https://') !== false ?
25
- str_replace('http://', 'https://', plugin_dir_url(__FILE__)) : plugin_dir_url(__FILE__)
26
  );
27
  define('ASL_URL_NP', str_replace(array("http://", "https://"), "//", plugin_dir_url(__FILE__)));
28
- define('ASL_CURRENT_VERSION', 4743);
29
- define('ASL_CURR_VER_STRING', "4.8.6");
30
  define('ASL_DEBUG', 0);
31
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
32
 
3
  Plugin Name: Ajax Search Lite
4
  Plugin URI: http://wp-dreams.com
5
  Description: The lite version of the most powerful ajax powered search engine for WordPress.
6
+ Version: 4.9
7
  Author: Ernest Marcinko
8
  Author URI: http://wp-dreams.com
9
  Text Domain: ajax-search-lite
19
  define('ASL_CLASSES_PATH', plugin_dir_path(__FILE__)."/includes/classes/");
20
  define('ASL_FUNCTIONS_PATH', plugin_dir_path(__FILE__)."/includes/functions/");
21
  define('ASL_DIR', 'ajax-search-lite');
22
+ define('ASL_SITE_IS_PROBABLY_SSL', strpos(home_url('/'), 'https://') !== false || strpos(plugin_dir_url(__FILE__), 'https://') !== false);
23
  define(
24
+ 'ASL_URL',
25
+ ASL_SITE_IS_PROBABLY_SSL ?
26
+ str_replace('http://', 'https://', plugin_dir_url(__FILE__)) : plugin_dir_url(__FILE__)
27
  );
28
  define('ASL_URL_NP', str_replace(array("http://", "https://"), "//", plugin_dir_url(__FILE__)));
29
+ define('ASL_CURRENT_VERSION', 4745);
30
+ define('ASL_CURR_VER_STRING', "4.9");
31
  define('ASL_DEBUG', 0);
32
  define('ASL_DEMO', get_option('wd_asl_demo', 0) );
33
 
backend/compatibility.php CHANGED
@@ -5,200 +5,72 @@ defined('ABSPATH') or die("You can't access this file directly.");
5
  $com_options = wd_asl()->o['asl_compatibility'];
6
 
7
  if (ASL_DEMO) $_POST = null;
8
- ?>
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  <div id="wpdreams" class='wpdreams wrap<?php echo isset($_COOKIE['asl-accessibility']) ? ' wd-accessible' : ''; ?>'>
11
  <div class="wpdreams-box" style="float:left;">
12
 
13
- <?php ob_start(); ?>
14
-
15
-
16
- <fieldset>
17
- <legend>CSS and JS compatibility</legend>
18
-
19
- <div class="item">
20
- <?php
21
- $o = new wpdreamsCustomSelect("js_source", "Javascript source", array(
22
- 'selects' => array(
23
- array('option' => 'Non minified', 'value' => 'nomin'),
24
- array('option' => 'Minified', 'value' => 'min'),
25
- array('option' => 'Non-minified scoped', 'value' => 'nomin-scoped'),
26
- array('option' => 'Minified scoped', 'value' => 'min-scoped'),
27
- ),
28
- 'value' => $com_options['js_source']
29
- )
30
- );
31
- $params[$o->getName()] = $o->getData();
32
- ?>
33
- <p class="descMsg">
34
- <ul style="float:right;text-align:left;width:50%;">
35
- <li><b>Non minified</b> - Low Compatibility, Medium space</li>
36
- <li><b>Minified</b> - Low Compatibility, Low space</li>
37
- <li><b>Non minified Scoped</b> - High Compatibility, High space</li>
38
- <li><b>Minified Scoped</b> - High Compatibility, Medium space</li>
39
- </ul>
40
- <div class="clear"></div>
41
- </p>
42
- </div>
43
- <div class="item">
44
- <?php
45
- $o = new wpdreamsCustomSelect("js_init", "Javascript init method", array(
46
- 'selects'=>array(
47
- array('option'=>'Dynamic (default)', 'value'=>'dynamic'),
48
- array('option'=>'Blocking', 'value'=>'blocking')
49
- ),
50
- 'value'=>$com_options['js_init']
51
- )
52
- );
53
- $params[$o->getName()] = $o->getData();
54
- ?>
55
- <p class="descMsg">
56
- Try to choose <strong>Blocking</strong> if the search bar is not responding to anything.
57
- </p>
58
- </div>
59
- <div class="item">
60
- <?php $o = new wpdreamsYesNo("detect_ajax", "Try to re-initialize if the page was loaded via ajax?",
61
- $com_options['detect_ajax']
62
- ); ?>
63
- <p class='descMsg'>Will try to re-initialize the plugin in case an AJAX page loader is used, like Polylang language switcher etc..</p>
64
- </div>
65
- <div class="item">
66
- <?php $o = new wpdreamsYesNo("js_retain_popstate", "Remember search phrase and options when using the Browser Back button?",
67
- $com_options['js_retain_popstate']
68
- ); ?>
69
- <p class='descMsg'>Whenever the user clicks on a live search result, and decides to navigate back, the search will re-trigger and reset the previous options.</p>
70
- </div>
71
- <div class="item">
72
- <?php $o = new wpdreamsYesNo("js_fix_duplicates", __('Try fixing DOM duplicates of the search bar if they exist?', 'ajax-search-lite'),
73
- $com_options['js_fix_duplicates']
74
- ); ?>
75
- <p class='descMsg'>
76
- <?php echo __('Some menu or widgets scripts tend to <strong>clone</strong> the search bar completely for Mobile viewports, causing a malfunctioning search bar with no event handlers. When this is active, the plugin script will try to fix that, if possible.', 'ajax-search-lite'); ?>
77
- </p>
78
- </div>
79
- <div class="item">
80
- <?php $o = new wpdreamsYesNo("load_google_fonts", "Load the <strong>google fonts</strong> used in the search options?",
81
- $com_options['load_google_fonts']
82
- ); ?>
83
- <p class='descMsg'>When <strong>turned off</strong>, the google fonts <strong>will not be loaded</strong> via this plugin at all.<br>Useful if you already have them loaded, to avoid mutliple loading times.</p>
84
- </div>
85
- <div class="item">
86
- <?php
87
- $o = new wpdreamsCustomSelect("load_scroll_js", "Load the scrollbar script?", array(
88
- 'selects'=>array(
89
- array('option'=>'Yes', 'value'=>'yes'),
90
- array('option'=>'No', 'value'=>'no')
91
- ),
92
- 'value'=>$com_options['load_scroll_js']
93
- )
94
- );
95
- $params[$o->getName()] = $o->getData();
96
- ?>
97
- <p class='descMsg'>
98
- <ul>
99
- <li>When set to <strong>No</strong>, the custom scrollbar will <strong>not be used at all</strong>.</li>
100
- </ul>
101
- </p>
102
- </div>
103
- <div class="item">
104
- <?php $o = new wpdreamsYesNo("old_browser_compatibility", "Display the default search box on old browsers? (IE<=8)",
105
- $com_options['old_browser_compatibility']
106
- ); ?>
107
- </div>
108
- </fieldset>
109
- <fieldset>
110
- <legend>Query Compatibility</legend>
111
-
112
- <div class="item">
113
- <?php $o = new wpdreamsYesNo("use_acf_getfield", "<strong>Advacned Custom Fields</strong>: use the ACF get_field() function to get the metadata?",
114
- $com_options['use_acf_getfield']
115
- ); ?>
116
- <p class='descMsg'>Will use the get_field() Advanced Custom Fields function instead of the core get_post_meta()</p>
117
- </div>
118
-
119
- <p class='infoMsg'>
120
- If you are experiencing issues with accent(diacritic) or case sensitiveness, you can force the search to try these tweaks.<br>
121
- <i>The search works according to your database collation settings</i>, so please be aware that <b>this is not an effective way</b> of fixing database collation issues.<br>
122
- If you have case/diacritic issues then please read the <a href="http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html" target="_blank">MySql manual on collations</a> or consult a <b>database expert</b> - those issues should be treated on database level!
123
- </p>
124
- <div class="item">
125
- <?php
126
- $o = new wpdreamsCustomSelect("db_force_case", "Force case", array(
127
- 'selects'=> array(
128
- array('option' => 'None', 'value' => 'none'),
129
- array('option' => 'Sensitivity', 'value' => 'sensitivity'),
130
- array('option' => 'InSensitivity', 'value' => 'insensitivity')
131
- ),
132
- 'value'=>$com_options['db_force_case']
133
- )
134
- );
135
- $params[$o->getName()] = $o->getData();
136
- ?>
137
- </div>
138
- <div class="item">
139
- <?php $o = new wpdreamsYesNo("db_force_unicode", "Force unicode search",
140
- $com_options['db_force_unicode']
141
- ); ?>
142
- <p class='descMsg'>Will try to force unicode character conversion on the search phrase.</p>
143
- </div>
144
- <div class="item">
145
- <?php $o = new wpdreamsYesNo("db_force_utf8_like", "Force utf8 on LIKE operations",
146
- $com_options['db_force_utf8_like']
147
- ); ?>
148
- <p class='descMsg'>Will try to force utf8 conversion on all LIKE operations in the WHERE and HAVING clauses.</p>
149
- </div>
150
-
151
- </fieldset>
152
-
153
- <?php $_r = ob_get_clean(); ?>
154
-
155
-
156
- <?php
157
-
158
- // Compatibility stuff
159
- $updated = false;
160
- if ( isset($_POST) && isset($_POST['asl_compatibility']) ) {
161
- $values = array(
162
- // CSS and JS
163
- "js_source" => $_POST['js_source'],
164
- "js_init" => $_POST['js_init'],
165
- "load_scroll_js" => $_POST['load_scroll_js'],
166
- "detect_ajax" => $_POST['detect_ajax'],
167
- "js_retain_popstate" => $_POST['js_retain_popstate'],
168
- 'js_fix_duplicates' => $_POST['js_fix_duplicates'],
169
- 'load_google_fonts' => $_POST['load_google_fonts'],
170
- 'old_browser_compatibility' => $_POST['old_browser_compatibility'],
171
- // Query options
172
- 'use_acf_getfield' => $_POST['use_acf_getfield'],
173
- "db_force_case" => $_POST['db_force_case'],
174
- "db_force_unicode" => $_POST['db_force_unicode'],
175
- "db_force_utf8_like" => $_POST['db_force_utf8_like']
176
- );
177
- update_option('asl_compatibility', $values);
178
- $updated = true;
179
- }
180
-
181
- ?>
182
-
183
  <div class='wpdreams-slider'>
184
 
185
- <?php if ($updated): ?>
186
- <div class='successMsg'>Search compatibility settings successfuly updated!</div><?php endif; ?>
187
 
188
  <?php if (ASL_DEMO): ?>
189
  <p class="infoMsg">DEMO MODE ENABLED - Please note, that these options are read-only</p>
190
  <?php endif; ?>
191
 
 
 
 
 
 
192
  <div id="content" class='tabscontent'>
193
 
194
  <!-- Compatibility form -->
195
  <form name='compatibility' method='post'>
 
 
 
 
196
 
197
- <?php print $_r; ?>
 
 
 
198
 
199
  <div class="item">
200
  <input type='submit' class='submit' value='Save options'/>
201
  </div>
 
202
  <input type='hidden' name='asl_compatibility' value='1'/>
203
  </form>
204
 
@@ -209,4 +81,8 @@ if (ASL_DEMO) $_POST = null;
209
  <a class="wd-accessible-switch" href="#"><?php echo isset($_COOKIE['asl-accessibility']) ? 'DISABLE ACCESSIBILITY' : 'ENABLE ACCESSIBILITY'; ?></a>
210
  </div>
211
  <div class="clear"></div>
212
- </div>
 
 
 
 
5
  $com_options = wd_asl()->o['asl_compatibility'];
6
 
7
  if (ASL_DEMO) $_POST = null;
 
8
 
9
+ // Compatibility stuff
10
+ $action_msg = '';
11
+ if (
12
+ isset($_POST, $_POST['asl_compatibility'], $_POST['asl_compatibility_nonce'])
13
+ ) {
14
+ if ( wp_verify_nonce( $_POST['asl_compatibility_nonce'], 'asl_compatibility_nonce' ) ) {
15
+ $values = array(
16
+ // CSS and JS
17
+ "js_source" => $_POST['js_source'],
18
+ "js_init" => $_POST['js_init'],
19
+ "load_scroll_js" => $_POST['load_scroll_js'],
20
+ "detect_ajax" => $_POST['detect_ajax'],
21
+ "js_retain_popstate" => $_POST['js_retain_popstate'],
22
+ 'js_fix_duplicates' => $_POST['js_fix_duplicates'],
23
+ 'load_google_fonts' => $_POST['load_google_fonts'],
24
+ 'old_browser_compatibility' => $_POST['old_browser_compatibility'],
25
+ // Query options
26
+ 'query_soft_check' => $_POST['query_soft_check'],
27
+ 'use_acf_getfield' => $_POST['use_acf_getfield'],
28
+ "db_force_case" => $_POST['db_force_case'],
29
+ "db_force_unicode" => $_POST['db_force_unicode'],
30
+ "db_force_utf8_like" => $_POST['db_force_utf8_like']
31
+ );
32
+ update_option('asl_compatibility', $values);
33
+ $action_msg = "<div class='successMsg'>" . __('Search compatibility settings successfuly updated!', 'ajax-search-lite') . "</div>";
34
+ } else {
35
+ $action_msg = "<div class='errorMsg'>" . __('Something went wrong, pelase try again!', 'ajax-search-lite') . "</div>";
36
+ $_POST = array();
37
+ }
38
+ }
39
+ ?>
40
  <div id="wpdreams" class='wpdreams wrap<?php echo isset($_COOKIE['asl-accessibility']) ? ' wd-accessible' : ''; ?>'>
41
  <div class="wpdreams-box" style="float:left;">
42
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  <div class='wpdreams-slider'>
44
 
45
+ <?php echo $action_msg; ?>
 
46
 
47
  <?php if (ASL_DEMO): ?>
48
  <p class="infoMsg">DEMO MODE ENABLED - Please note, that these options are read-only</p>
49
  <?php endif; ?>
50
 
51
+ <ul id="tabs" class='tabs'>
52
+ <li><a tabid="1" class='current multisite'><?php echo __('CSS & JS compatibility', 'ajax-search-lite'); ?></a></li>
53
+ <li><a tabid="2" class='general'><?php echo __('Query compatibility', 'ajax-search-lite'); ?></a></li>
54
+ </ul>
55
+
56
  <div id="content" class='tabscontent'>
57
 
58
  <!-- Compatibility form -->
59
  <form name='compatibility' method='post'>
60
+ <fieldset tabid="1">
61
+ <legend><?php echo __('CSS and JS compatibility', 'ajax-search-lite'); ?></legend>
62
+ <?php include(ASL_PATH . "backend/tabs/compatibility/cssjs_options.php"); ?>
63
+ </fieldset>
64
 
65
+ <fieldset tabid="2">
66
+ <legend><?php echo __('Query compatibility options', 'ajax-search-lite'); ?></legend>
67
+ <?php include(ASL_PATH . "backend/tabs/compatibility/query_options.php"); ?>
68
+ </fieldset>
69
 
70
  <div class="item">
71
  <input type='submit' class='submit' value='Save options'/>
72
  </div>
73
+ <input type="hidden" name="asl_compatibility_nonce" id="asl_analytics_nonce" value="<?php echo wp_create_nonce( "asl_compatibility_nonce" ); ?>">
74
  <input type='hidden' name='asl_compatibility' value='1'/>
75
  </form>
76
 
81
  <a class="wd-accessible-switch" href="#"><?php echo isset($_COOKIE['asl-accessibility']) ? 'DISABLE ACCESSIBILITY' : 'ENABLE ACCESSIBILITY'; ?></a>
82
  </div>
83
  <div class="clear"></div>
84
+ </div>
85
+ <?php
86
+ wp_enqueue_script('wpd-backend-compatibility', plugin_dir_url(__FILE__) . 'settings/assets/compatibility_settings.js', array(
87
+ 'jquery'
88
+ ), ASL_CURR_VER_STRING, true);
backend/go_pro.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="asl-gopro-overlay"></div>
2
+ <div id="asl-gopro">
3
+ <div class="asl-gopro-left">
4
+ <h4>Lite version</h4>
5
+ <ul>
6
+ <li>Single search instance</li>
7
+ <li>Post type search only (posts, pages, products, portfolio, events and any other custom post type..)</li>
8
+ <li>Vertical layout only</li>
9
+ <li>Generic and Category filters only</li>
10
+ <li>4 themes, some features customizable</li><li>Category and ID based result exclusions</li>
11
+ </ul>
12
+ </div>
13
+ <div class="asl-gopro-right">
14
+ <h4>Pro Version</h4>
15
+ <ul>
16
+ <li>Multiple (unlimited) different search instances</li>
17
+ <li>Post types, Taxonomy terms, Attachments, Users, BuddyPress Groups and PeepSo content as results</li>
18
+ <li>Vertical, Horizontal, Isotopic and Polaroid layouts</li><li>Post type, Generic, Content type, Taxonomy, Custom field and Date filters</li><li>100+ Themes, fully customizable</li>
19
+ <li>Taxonomy, Tag, User, Date, ID and other result exclusion and inclusion methods</li>
20
+ <li>..and many other features, check the <a href="https://ajaxsearchpro.com/features/" target="_blank">full features list</a>.</li>
21
+ </ul>
22
+ </div>
23
+ <div class="asl-gopro-bottom">
24
+ <p>The Lite and the Pro version are two separate plugins, thus you can switch from Pro to Lite and vice-versa at any time, without loosing your settings.</p>
25
+ <a class="gopro" href="https://wp-dreams.com/go/?to=asp_demo_gopro" target="_blank">See the Pro version live demo!</a>
26
+ </div>
27
+ </div>
28
+ <?php
29
+ wp_register_style('asl-gopro-style', ASL_URL_NP . 'backend/settings/assets/go_pro.css', array(), ASL_CURR_VER_STRING);
30
+ wp_enqueue_style('asl-gopro-style');
backend/maintenance.php CHANGED
@@ -83,7 +83,7 @@ if (!ASL_DEMO) {
83
  wp_enqueue_script('asl-backend-maintenance', plugin_dir_url(__FILE__) . 'settings/assets/maintenance.js', array(
84
  'jquery'
85
  ), ASL_CURR_VER_STRING, true);
86
- wp_localize_script('asl-backend-maintenance', 'ASL_MNT', array(
87
  "admin_url" => admin_url()
88
  ));
89
  }
83
  wp_enqueue_script('asl-backend-maintenance', plugin_dir_url(__FILE__) . 'settings/assets/maintenance.js', array(
84
  'jquery'
85
  ), ASL_CURR_VER_STRING, true);
86
+ ASL_Helpers::addInlineScript('asl-backend-maintenance', 'ASL_MNT', array(
87
  "admin_url" => admin_url()
88
  ));
89
  }
backend/performance_options.php CHANGED
@@ -3,6 +3,24 @@
3
  defined( 'ABSPATH' ) or die( "You can't access this file directly." );
4
 
5
  $cache_options = wd_asl()->o['asl_performance'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
  ?>
7
  <div id="wpdreams" class='wpdreams wrap<?php echo isset($_COOKIE['asl-accessibility']) ? ' wd-accessible' : ''; ?>'>
8
  <?php if (wd_asl()->o['asl_performance']['use_custom_ajax_handler'] == 1): ?>
@@ -27,34 +45,21 @@ $cache_options = wd_asl()->o['asl_performance'];
27
  wpdreams_setval_or_getoption( $cache_options, 'load_in_footer', 'asl_performance_def' ) ); ?>
28
  <p class="descMsg">Will load the JavaScript files in the site footer for better performance.</p>
29
  </div>
30
- <div class="item">
31
- <input type='submit' class='submit' value='Save options'/>
32
- </div>
33
- <?php $_r = ob_get_clean(); ?>
34
-
35
 
36
- <?php
37
- $updated = false;
38
- if ( isset( $_POST ) && isset( $_POST['asl_performance'] ) ) {
39
- $values = array(
40
- "use_custom_ajax_handler" => $_POST['use_custom_ajax_handler'],
41
- "image_cropping" => $_POST['image_cropping'],
42
- "load_in_footer" => $_POST['load_in_footer']
43
- );
44
- update_option( 'asl_performance', $values );
45
- $updated = true;
46
- }
47
- ?>
48
 
49
  <div class='wpdreams-slider'>
50
  <form name='asl_performance_form' method='post'>
51
- <?php if ( $updated ): ?>
52
- <div class='successMsg'>Performance settings successfuly updated!</div><?php endif; ?>
53
  <fieldset>
54
- <legend>Performance Options</legend>
55
  <?php print $_r; ?>
56
  <input type='hidden' name='asl_performance' value='1'/>
57
- </fieldset>
 
 
 
 
58
  </form>
59
  </div>
60
 
3
  defined( 'ABSPATH' ) or die( "You can't access this file directly." );
4
 
5
  $cache_options = wd_asl()->o['asl_performance'];
6
+ $action_msg = '';
7
+
8
+ if ( isset($_POST, $_POST['asl_performance'], $_POST['submit'], $_POST['asl_performance_nonce']) ) {
9
+ if ( wp_verify_nonce( $_POST['asl_performance_nonce'], 'asl_performance_nonce' ) ) {
10
+ $values = array(
11
+ "use_custom_ajax_handler" => $_POST['use_custom_ajax_handler'],
12
+ "image_cropping" => $_POST['image_cropping'],
13
+ "load_in_footer" => $_POST['load_in_footer']
14
+ );
15
+ update_option( 'asl_performance', $values );
16
+ asl_parse_options();
17
+ $action_msg = "<div class='infoMsg'><strong>" . __('Performance settings successfuly saved!', 'ajax-search-lite') . '</strong> (' . date("Y-m-d H:i:s") . ")</div>";
18
+ } else {
19
+ $action_msg = "<div class='errorMsg'><strong>". __('<strong>ERROR Saving:</strong> Invalid NONCE, please try again!', 'ajax-search-lite') . '</strong> (' . date("Y-m-d H:i:s") . ")</div>";
20
+ $_POST = array();
21
+ }
22
+ }
23
+
24
  ?>
25
  <div id="wpdreams" class='wpdreams wrap<?php echo isset($_COOKIE['asl-accessibility']) ? ' wd-accessible' : ''; ?>'>
26
  <?php if (wd_asl()->o['asl_performance']['use_custom_ajax_handler'] == 1): ?>
45
  wpdreams_setval_or_getoption( $cache_options, 'load_in_footer', 'asl_performance_def' ) ); ?>
46
  <p class="descMsg">Will load the JavaScript files in the site footer for better performance.</p>
47
  </div>
 
 
 
 
 
48
 
49
+ <?php $_r = ob_get_clean(); ?>
 
 
 
 
 
 
 
 
 
 
 
50
 
51
  <div class='wpdreams-slider'>
52
  <form name='asl_performance_form' method='post'>
53
+ <?php echo $action_msg; ?>
 
54
  <fieldset>
55
+ <legend><?php echo __('Performance Options', 'ajax-search-lite'); ?></legend>
56
  <?php print $_r; ?>
57
  <input type='hidden' name='asl_performance' value='1'/>
58
+ <input type="hidden" name="asl_performance_nonce" id="asl_performance_nonce" value="<?php echo wp_create_nonce( "asl_performance_nonce" ); ?>">
59
+ <div class="item">
60
+ <input type='submit' class='submit' name="submit" value='Save options'/>
61
+ </div>
62
+ </fieldset>
63
  </form>
64
  </div>
65
 
backend/settings.php CHANGED
@@ -4,9 +4,8 @@ $messages = "";
4
 
5
  $inst = wd_asl()->instances->get(0);
6
  $sd = &$inst['data'];
7
- $_def = get_option('asl_defaults');
8
- $_dk = 'asl_defaults';
9
  ?>
 
10
  <div id="fb-root"></div>
11
  <script>(function(d, s, id) {
12
  var js, fjs = d.getElementsByTagName(s)[0];
@@ -76,7 +75,13 @@ $_dk = 'asl_defaults';
76
  </div>
77
  <div tabid="2">
78
  <fieldset>
79
- <legend><?php _e("Image Options", "ajax-search-lite"); ?></legend>
 
 
 
 
 
 
80
 
81
  <?php include(ASL_PATH . "backend/tabs/instance/image_options.php"); ?>
82
 
@@ -84,7 +89,13 @@ $_dk = 'asl_defaults';
84
  </div>
85
  <div tabid="3">
86
  <fieldset>
87
- <legend><?php _e("Frontend Search Settings", "ajax-search-lite"); ?></legend>
 
 
 
 
 
 
88
 
89
  <?php include(ASL_PATH . "backend/tabs/instance/frontend_options.php"); ?>
90
 
4
 
5
  $inst = wd_asl()->instances->get(0);
6
  $sd = &$inst['data'];
 
 
7
  ?>
8
+ <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css'>
9
  <div id="fb-root"></div>
10
  <script>(function(d, s, id) {
11
  var js, fjs = d.getElementsByTagName(s)[0];
75
  </div>
76
  <div tabid="2">
77
  <fieldset>
78
+ <legend><?php _e("Image Options", "ajax-search-lite"); ?>
79
+ <span class="asl_legend_docs">
80
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/image-settings"><span class="fa fa-book"></span>
81
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
82
+ </a>
83
+ </span>
84
+ </legend>
85
 
86
  <?php include(ASL_PATH . "backend/tabs/instance/image_options.php"); ?>
87
 
89
  </div>
90
  <div tabid="3">
91
  <fieldset>
92
+ <legend><?php _e("Frontend Search Settings", "ajax-search-lite"); ?>
93
+ <span class="asl_legend_docs">
94
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/frontend-search-filters"><span class="fa fa-book"></span>
95
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
96
+ </a>
97
+ </span>
98
+ </legend>
99
 
100
  <?php include(ASL_PATH . "backend/tabs/instance/frontend_options.php"); ?>
101
 
backend/settings/assets/compatibility_settings.js ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Simulate a click on the first element to initialize the tabs
2
+ jQuery(function ($) {
3
+ // Remove the # from the hash, as different browsers may or may not include it
4
+ var hash = location.hash.replace('#','');
5
+
6
+ if(hash != ''){
7
+ hash = parseInt(hash);
8
+ $('.tabs a[tabid=' + Math.floor( hash / 100 ) + ']').click();
9
+ $('.tabs a[tabid=' + hash + ']').click();
10
+ } else {
11
+ $('.tabs a[tabid=1]').click();
12
+ }
13
+
14
+ $('.tabs a').on('click', function(){
15
+ location.hash = $(this).attr('tabid');
16
+ });
17
+
18
+ $('input[name=selective_enabled]').on('change', function(){
19
+ if ( $(this).val() == 0 ) {
20
+ $(this).closest('fieldset').find('.item_selective_load').addClass('disabled');
21
+ } else {
22
+ $(this).closest('fieldset').find('.item_selective_load').removeClass('disabled');
23
+ }
24
+ });
25
+ $('input[name=selective_enabled]').trigger('change');
26
+ });
backend/settings/assets/go_pro.css ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #wpbody {
2
+ position: relative;
3
+ }
4
+
5
+ #asl-gopro-overlay {
6
+ position: absolute;
7
+ top: 0;
8
+ left: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ background: #f0f0f1;
12
+ z-index: 1;
13
+ }
14
+
15
+ #asl-gopro {
16
+ display: flex;
17
+ flex-wrap: wrap;
18
+ flex-direction: row;
19
+ flex-grow: 1;
20
+ flex-shrink: 1;
21
+ max-width: 960px;
22
+ background: white;
23
+ padding: 24px;
24
+ position:absolute;
25
+ z-index: 2;
26
+ top: 20px;
27
+ left: 0;
28
+ }
29
+ #asl-gopro ul {
30
+ list-style-type: disc;
31
+ margin-left: 22px;
32
+ }
33
+
34
+ #asl-gopro a.gopro {
35
+ display: inline-block;
36
+ margin-top: 12px;
37
+ padding: 12px 18px;
38
+ background: #006bff;
39
+ border-radius: 3px;
40
+ color: white;
41
+ text-decoration: none;
42
+ }
43
+
44
+ .asl-gopro-bottom {
45
+ min-width: 100%;
46
+ flex-wrap: wrap;
47
+ flex-basis: auto;flex-grow: 1;
48
+ box-sizing: border-box;
49
+ text-align: center;
50
+ padding: 16px;
51
+
52
+ }
53
+ .asl-gopro-bottom p {
54
+ text-align: left;
55
+ }
56
+ .asl-gopro-left, .asl-gopro-right {
57
+ flex-shrink: 1;
58
+ flex-basis: 50%;
59
+ box-sizing: border-box;
60
+ }
61
+ .asl-gopro-left {
62
+ padding: 0 16px 0 0;
63
+ }
backend/settings/assets/search_instance.js CHANGED
@@ -1,10 +1,14 @@
1
  jQuery(function ($) {
2
- $('.tabs a[tabid=1]').click(function () {
3
- $('.tabs a[tabid=101]').click();
4
  });
5
 
6
- $('.tabs a[tabid=4]').click(function () {
7
- $('.tabs a[tabid=401]').click();
 
 
 
 
8
  });
9
 
10
  $('.tabs a').on('click', function () {
@@ -88,6 +92,35 @@ jQuery(function ($) {
88
  });
89
  $('select[name=keyword_logic]').trigger('change');
90
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
  // Primary and Secondary fields for custom fields
92
  $.each(['titlefield', 'descriptionfield'],
93
  function(i, v){
@@ -101,6 +134,26 @@ jQuery(function ($) {
101
  $("select[name='"+v+"']").change();
102
  });
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  // Theme options
105
  $('select[name=theme]').on('change', function(){
106
  $('.asl_theme').removeClass().addClass('asl_theme asl_theme-' + $(this).val());
@@ -136,6 +189,55 @@ jQuery(function ($) {
136
  });
137
  $('input[name=override_border]').trigger('change');
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
 
140
  // -------------------------------- MODAL MESSAGES ----------------------------------
141
  var modalItems = [
1
  jQuery(function ($) {
2
+ $('.tabs a[tabid=1]').on('click', function () {
3
+ $('.tabs a[tabid=101]').trigger('click');
4
  });
5
 
6
+ $('.tabs a[tabid=4]').on('click', function () {
7
+ $('.tabs a[tabid=401]').trigger('click');
8
+ });
9
+
10
+ $('.tabs a[tabid=7]').on('click', function () {
11
+ $('.tabs a[tabid=701]').trigger('click');
12
  });
13
 
14
  $('.tabs a').on('click', function () {
92
  });
93
  $('select[name=keyword_logic]').trigger('change');
94
 
95
+ // Search keyword highlighter
96
+ $('input[name=kw_highlight]').on('change', function(){
97
+ if ( $(this).val() == 1 ) {
98
+ $("input[name='kw_highlight_whole_words']").closest('.item').removeClass("disabled");
99
+ $("input[name='highlight_color']").closest('.item').removeClass("disabled");
100
+ $("input[name='highlight_bg_color']").closest('.item').removeClass("disabled");
101
+ } else {
102
+ $("input[name='kw_highlight_whole_words']").closest('.item').addClass("disabled");
103
+ $("input[name='highlight_color']").closest('.item').addClass("disabled");
104
+ $("input[name='highlight_bg_color']").closest('.item').addClass("disabled");
105
+ }
106
+ }).trigger('change');
107
+
108
+ $('input[name=single_highlight]').on('change', function(){
109
+ if ( $(this).val() == 1 ) {
110
+ $("input[name='single_highlightwholewords']").closest('.item').removeClass("disabled");
111
+ $("input[name='single_highlightcolor']").closest('.item').removeClass("disabled");
112
+ $("input[name='single_highlightbgcolor']").closest('.item').removeClass("disabled");
113
+ $("input[name='single_highlight_selector']").closest('.item').removeClass("disabled");
114
+ $("input[name='single_highlight_scroll']").closest('.item').removeClass("disabled");
115
+ } else {
116
+ $("input[name='single_highlightwholewords']").closest('.item').addClass("disabled");
117
+ $("input[name='single_highlightcolor']").closest('.item').addClass("disabled");
118
+ $("input[name='single_highlightbgcolor']").closest('.item').addClass("disabled");
119
+ $("input[name='single_highlight_selector']").closest('.item').addClass("disabled");
120
+ $("input[name='single_highlight_scroll']").closest('.item').addClass("disabled");
121
+ }
122
+ }).trigger('change');
123
+
124
  // Primary and Secondary fields for custom fields
125
  $.each(['titlefield', 'descriptionfield'],
126
  function(i, v){
134
  $("select[name='"+v+"']").change();
135
  });
136
 
137
+ // Ordering
138
+ $('select[name="orderby_primary"]').on('change', function(){
139
+ if ($(this).val().indexOf('customf') == -1) {
140
+ $('input[name="orderby_primary_cf"]').parent().addClass('hiddend');
141
+ $('select[name="orderby_primary_cf_type"]').parent().addClass('hiddend');
142
+ } else {
143
+ $('input[name="orderby_primary_cf"]').parent().removeClass('hiddend');
144
+ $('select[name="orderby_primary_cf_type"]').parent().removeClass('hiddend');
145
+ }
146
+ }).trigger('change');
147
+ $('select[name="orderby_secondary"]').on('change', function(){
148
+ if ($(this).val().indexOf('customf') == -1) {
149
+ $('input[name="orderby_secondary_cf"]').parent().addClass('hiddend');
150
+ $('select[name="orderby_secondary_cf_type"]').parent().addClass('hiddend');
151
+ } else {
152
+ $('input[name="orderby_secondary_cf"]').parent().removeClass('hiddend');
153
+ $('select[name="orderby_secondary_cf_type"]').parent().removeClass('hiddend');
154
+ }
155
+ }).trigger('change');
156
+
157
  // Theme options
158
  $('select[name=theme]').on('change', function(){
159
  $('.asl_theme').removeClass().addClass('asl_theme asl_theme-' + $(this).val());
189
  });
190
  $('input[name=override_border]').trigger('change');
191
 
192
+ $('input[name=results_bg_override]').on('change', function(){
193
+ if ( $(this).val() == 0 ) {
194
+ $('input[name=results_bg_override_color]').parent().addClass('disabled');
195
+ } else {
196
+ $('input[name=results_bg_override_color]').parent().removeClass('disabled');
197
+ }
198
+ }).trigger('change');
199
+ $('input[name=results_item_bg_override]').on('change', function(){
200
+ if ( $(this).val() == 0 ) {
201
+ $('input[name=results_item_bg_override_color]').parent().addClass('disabled');
202
+ } else {
203
+ $('input[name=results_item_bg_override_color]').parent().removeClass('disabled');
204
+ }
205
+ }).trigger('change');
206
+ $('input[name=results_override_border]').on('change', function(){
207
+ if ( $(this).val() == 0 ) {
208
+ $('input[name=results_override_border_style]').closest('.wpdreamsBorder').addClass('disabled');
209
+ } else {
210
+ $('input[name=results_override_border_style]').closest('.wpdreamsBorder').removeClass('disabled');
211
+ }
212
+ }).trigger('change');
213
+
214
+ $('input[name=settings_bg_override]').on('change', function(){
215
+ if ( $(this).val() == 0 ) {
216
+ $('input[name=settings_bg_override_color]').parent().addClass('disabled');
217
+ } else {
218
+ $('input[name=settings_bg_override_color]').parent().removeClass('disabled');
219
+ }
220
+ }).trigger('change');
221
+ $('input[name=settings_override_border]').on('change', function(){
222
+ if ( $(this).val() == 0 ) {
223
+ $('input[name=settings_override_border_style]').closest('.wpdreamsBorder').addClass('disabled');
224
+ } else {
225
+ $('input[name=settings_override_border_style]').closest('.wpdreamsBorder').removeClass('disabled');
226
+ }
227
+ }).trigger('change');
228
+
229
+ // Primary and Secondary fields for custom fields
230
+ $.each(['primary_titlefield', 'secondary_titlefield', 'primary_descriptionfield', 'secondary_descriptionfield'],
231
+ function(i, v){
232
+ $("select[name='"+v+"']").on('change', function(){
233
+ if ( $(this).val() != 'c__f' ) {
234
+ $("input[name='"+v+"_cf']").parent().css("display", "none");
235
+ } else {
236
+ $("input[name='"+v+"_cf']").parent().css("display", "");
237
+ }
238
+ });
239
+ $("select[name='"+v+"']").trigger('change');
240
+ });
241
 
242
  // -------------------------------- MODAL MESSAGES ----------------------------------
243
  var modalItems = [
backend/settings/assets/style.css CHANGED
@@ -225,10 +225,11 @@ Generic classes
225
  display:none;
226
  }
227
  #wpdreams legend {
228
- font-size:1.22em;
229
- color:#444;
230
- font-weight: 700;
231
- margin: 0;
 
232
  }
233
  #wpdreams hr {
234
  color:#eee;
@@ -289,6 +290,12 @@ Generic classes
289
  #wpdreams input.threedigit {
290
  width: 45px;
291
  }
 
 
 
 
 
 
292
  #wpdreams select {
293
  padding:2px;
294
  }
@@ -532,6 +539,24 @@ Generic classes
532
  height:150px;
533
  line-height:100%;
534
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
  #wpdreams input:hover,#wpdreams textarea:hover,#wpdreams input:focus,#wpdreams textarea:focus {
536
  border-color:#C9C9C9;
537
  -webkit-box-shadow:rgba(0,0,0,0.15) 0px 0px 8px;
@@ -843,13 +868,49 @@ input[type=button].wd_button:active,
843
  }
844
 
845
  #wpdreams fieldset fieldset legend {
846
- color: #333;
847
  }
848
 
849
  #wpdreams fieldset fieldset fieldset legend {
850
  color: #666;
851
  }
852
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
853
  #wpdreams .wpdreamsanimationselect + span {
854
  padding: 4px 11px;
855
  display: inline-block;
225
  display:none;
226
  }
227
  #wpdreams legend {
228
+ font-size:1.22em;
229
+ color:#444;
230
+ font-weight: 700;
231
+ margin: 0 0 0 11px;
232
+ position: relative;
233
  }
234
  #wpdreams hr {
235
  color:#eee;
290
  #wpdreams input.threedigit {
291
  width: 45px;
292
  }
293
+
294
+ #wpdreams .wd-primary-order input,
295
+ #wpdreams .wd-secondary-order input {
296
+ width: 120px !important;
297
+ }
298
+
299
  #wpdreams select {
300
  padding:2px;
301
  }
539
  height:150px;
540
  line-height:100%;
541
  }
542
+
543
+ #wpdreams textarea.wd_textarea_expandable {
544
+ height: auto;
545
+ overflow-: hidden;
546
+ padding: 6px 10px;
547
+ box-sizing: border-box;
548
+ font-size: 14px;
549
+ line-height: 16px;
550
+ max-height: 120px; /* optional, but recommended */
551
+ min-height: 31px;
552
+ }
553
+
554
+ #wpdreams label.wd_textarea_expandable {
555
+ vertical-align: top;
556
+ padding: 6px 0;
557
+ display: inline-block;
558
+ }
559
+
560
  #wpdreams input:hover,#wpdreams textarea:hover,#wpdreams input:focus,#wpdreams textarea:focus {
561
  border-color:#C9C9C9;
562
  -webkit-box-shadow:rgba(0,0,0,0.15) 0px 0px 8px;
868
  }
869
 
870
  #wpdreams fieldset fieldset legend {
871
+ color: #333;
872
  }
873
 
874
  #wpdreams fieldset fieldset fieldset legend {
875
  color: #666;
876
  }
877
 
878
+ #wpdreams .asl_legend_docs {
879
+ display: flex;
880
+ position: absolute;
881
+ top: 2px;
882
+ left: 2px;
883
+ opacity: 0;
884
+ transition: opacity .2s;
885
+ background: white;
886
+ }
887
+
888
+ #wpdreams fieldset legend .asl_legend_docs {
889
+ top: 2px;
890
+ left: 100%;
891
+ }
892
+
893
+ #wpdreams .asl_legend_docs a {
894
+ margin: 0 0 0 8px;
895
+ white-space: nowrap;
896
+ }
897
+
898
+ #wpdreams div[tabid] {
899
+ position: relative;
900
+ }
901
+
902
+ #wpdreams div[tabid]:hover .asl_legend_docs,
903
+ #wpdreams fieldset fieldset:hover legend .asl_legend_docs {
904
+ opacity: 1;
905
+ }
906
+
907
+ #wpdreams .asl_legend_docs span.fa {
908
+ color: #8143b9;
909
+ outline: none;
910
+ margin: 0 6px 0 0;
911
+ font-size: 14px;
912
+ }
913
+
914
  #wpdreams .wpdreamsanimationselect + span {
915
  padding: 4px 11px;
916
  display: inline-block;
backend/settings/assets/tabs.js CHANGED
@@ -1,48 +1,45 @@
1
- (function ($) {
2
- $(document).ready(function () {
3
- $('.tabs a').click(function (e) {
4
- e.preventDefault();
5
- var tid = $(this).attr('tabid');
6
- var tabsContent = $(this).parent().parent().next();
7
-
8
- tabsContent.children().each(function () {
9
-
10
- // Form nested tabs
11
- if ($(this).is('form')) {
12
-
13
- // Hackidy-hack. Yea, hide this form, later if this is the active one we show it..
14
- // .. so the non-hidden content of the form is not present on other tabs
15
- // .. whatever man, STOP QUESTIONING MY METHODS
16
- $(this).hide();
17
- $form = $(this);
18
-
19
- // This is should be done with a recursive call, but meh...
20
- $(this).children().each(function () {
21
- // Only apply to nodes with the tabid attribute
22
- if ($(this).is('[tabid]')) {
23
- $(this).hide();
24
- if ($(this).attr('tabid') == tid) {
25
- $form.fadeIn();
26
- $(this).fadeIn();
27
- }
28
  }
29
- });
30
- return;
31
- }
32
-
33
- // Only apply to nodes with the tabid attribute
34
- if ($(this).is('[tabid]')) {
35
- $(this).hide();
36
- if ($(this).attr('tabid') == tid) {
37
- $(this).fadeIn();
38
  }
 
 
 
 
 
 
 
 
 
39
  }
 
40
 
41
- });
42
-
43
- $('a', $(this).parent().parent()).removeClass('current');
44
- $(this).addClass('current');
45
  });
46
 
 
 
47
  });
48
- })(jQuery)
1
+ jQuery(function($){
2
+ $('.tabs a').on('click', function (e) {
3
+ e.preventDefault();
4
+ var tid = $(this).attr('tabid');
5
+ var tabsContent = $(this).parent().parent().next();
6
+
7
+ tabsContent.children().each(function () {
8
+
9
+ // Form nested tabs
10
+ if ($(this).is('form')) {
11
+
12
+ // Hackidy-hack. Yea, hide this form, later if this is the active one we show it..
13
+ // .. so the non-hidden content of the form is not present on other tabs
14
+ // .. whatever man, STOP QUESTIONING MY METHODS
15
+ $(this).hide();
16
+ $form = $(this);
17
+
18
+ // This is should be done with a recursive call, but meh...
19
+ $(this).children().each(function () {
20
+ // Only apply to nodes with the tabid attribute
21
+ if ($(this).is('[tabid]')) {
22
+ $(this).hide();
23
+ if ($(this).attr('tabid') == tid) {
24
+ $form.fadeIn(100);
25
+ $(this).fadeIn(100);
 
 
26
  }
 
 
 
 
 
 
 
 
 
27
  }
28
+ });
29
+ return;
30
+ }
31
+
32
+ // Only apply to nodes with the tabid attribute
33
+ if ($(this).is('[tabid]')) {
34
+ $(this).hide();
35
+ if ($(this).attr('tabid') == tid) {
36
+ $(this).fadeIn(100);
37
  }
38
+ }
39
 
 
 
 
 
40
  });
41
 
42
+ $('a', $(this).parent().parent()).removeClass('current');
43
+ $(this).addClass('current');
44
  });
45
+ });
backend/settings/assets/textarea-autosize/jquery.textarea-autosize.js ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery Textarea AutoSize plugin
3
+ * Author: Javier Julio
4
+ * Licensed under the MIT license
5
+ * Url: https://github.com/javierjulio/textarea-autosize
6
+ */
7
+ ;(function ($, window, document, undefined) {
8
+
9
+ var pluginName = "textareaAutoSize";
10
+ var pluginDataName = "plugin_" + pluginName;
11
+
12
+ var containsText = function (value) {
13
+ return (value.replace(/\s/g, '').length > 0);
14
+ };
15
+
16
+ function Plugin(element, options) {
17
+ this.element = element;
18
+ this.$element = $(element);
19
+ this.init();
20
+ }
21
+
22
+ Plugin.prototype = {
23
+ init: function() {
24
+ var height = this.$element.outerHeight();
25
+ var diff = parseInt(this.$element.css('paddingBottom')) +
26
+ parseInt(this.$element.css('paddingTop')) || 0;
27
+
28
+ if (containsText(this.element.value)) {
29
+ this.$element.height(this.element.scrollHeight - diff);
30
+ }
31
+
32
+ // keyup is required for IE to properly reset height when deleting text
33
+ this.$element.on('input keyup', function(event) {
34
+ var $window = $(window);
35
+ var currentScrollPosition = $window.scrollTop();
36
+
37
+ $(this)
38
+ .height(0)
39
+ .height(this.scrollHeight - diff);
40
+
41
+ $window.scrollTop(currentScrollPosition);
42
+ });
43
+ }
44
+ };
45
+
46
+ $.fn[pluginName] = function (options) {
47
+ this.each(function() {
48
+ if (!$.data(this, pluginDataName)) {
49
+ $.data(this, pluginDataName, new Plugin(this, options));
50
+ }
51
+ });
52
+ return this;
53
+ };
54
+
55
+ })(jQuery, window, document);
backend/settings/assets/types.js CHANGED
@@ -1819,6 +1819,11 @@ jQuery(function($){
1819
  }
1820
  });
1821
 
 
 
 
 
 
1822
 
1823
  // ----------------------- ETC.. ---------------------
1824
  $('.successMsg').each(function () {
1819
  }
1820
  });
1821
 
1822
+ // -------------- Textarea Expandable ---------------
1823
+ // This needs to be triggered once the window is loaded, otherwise it may have no effect on init
1824
+ $('textarea.wd_textarea_expandable').textareaAutoSize();
1825
+ $('textarea.wd_textarea_expandable').trigger('input');
1826
+
1827
 
1828
  // ----------------------- ETC.. ---------------------
1829
  $('.successMsg').each(function () {
backend/settings/class/customposttypeseditable.class.php CHANGED
@@ -15,9 +15,23 @@ if (!class_exists("wpdreamsCustomPostTypesEditable")) {
15
  function getType() {
16
  parent::getType();
17
  $this->processData();
18
- $this->types = get_post_types(array(
19
- '_builtin' => false
20
- ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  echo "
22
  <div class='wpdreamsCustomPostTypesEditable' id='wpdreamsCustomPostTypesEditable-" . self::$_instancenumber . "'>
23
  <fieldset>
15
  function getType() {
16
  parent::getType();
17
  $this->processData();
18
+ $this->types = get_post_types(array(
19
+ "public" => true,
20
+ "_builtin" => false
21
+ ), "objects", "OR");
22
+ $exclude = array("revision", "nav_menu_item", "attachment", 'peepso-post', 'peepso-comment', "acf",
23
+ "oembed_cache", "user_request", "wp_block", "shop_coupon", "avada_page_options",
24
+ "_pods_template", "_pods_pod", "_pods_field", "bp-email",
25
+ "lbmn_archive", "lbmn_footer", "mc4wp-form",
26
+ "elementor-front", "elementor-icon",
27
+ "fusion_template", "fusion_element", "wc_product_tab", "customize_changeset",
28
+ "wpcf7_contact_form", "dslc_templates", "acf-field", "acf-group", "acf-groups", "acf-field-group", "custom_css");
29
+ foreach ($this->types as $k => $v) {
30
+ if (in_array($k, $exclude)) {
31
+ unset($this->types[$k]);
32
+ continue;
33
+ }
34
+ }
35
  echo "
36
  <div class='wpdreamsCustomPostTypesEditable' id='wpdreamsCustomPostTypesEditable-" . self::$_instancenumber . "'>
37
  <fieldset>
backend/settings/class/textarea-expandable.class.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!class_exists("wd_TextareaExpandable")) {
3
+ /**
4
+ * Class wpdreamsTextarea
5
+ *
6
+ * A simple textarea field.
7
+ *
8
+ * @package WPDreams/OptionsFramework/Classes
9
+ * @category Class
10
+ * @author Ernest Marcinko <ernest.marcinko@wp-dreams.com>
11
+ * @link http://codecanyon.net/user/wpdreams/portfolio
12
+ * @copyright Copyright (c) 2019, Ernest Marcinko
13
+ */
14
+ class wd_TextareaExpandable extends wpdreamsType {
15
+ public function getType() {
16
+ parent::getType();
17
+ echo "<label class='wd_textarea_expandable' for='wd_textareae_" . self::$_instancenumber . "'>" . $this->label . "</label>";
18
+ echo "<textarea rows='1' data-min-rows='1' class='wd_textarea_expandable' id='wd_textareae_" . self::$_instancenumber . "' name='" . $this->name . "'>" . stripslashes(esc_html($this->data)) . "</textarea>";
19
+ }
20
+ }
21
+ }
backend/settings/class/wd_cf_search_callback.class.php CHANGED
@@ -45,7 +45,7 @@ if (!class_exists("wd_CFSearchCallBack")) {
45
  <span class="loading-small hiddend"></span>
46
  <div class="wd_ts_close hiddend">
47
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
48
- <polygon id="x-mark-icon" points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622 73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "></polygon>
49
  </svg>
50
  </div>
51
  <?php
45
  <span class="loading-small hiddend"></span>
46
  <div class="wd_ts_close hiddend">
47
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="24px" height="24px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
48
+ <polygon points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622 73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "></polygon>
49
  </svg>
50
  </div>
51
  <?php
backend/settings/default_options.php CHANGED
@@ -78,6 +78,7 @@ function asl_do_init_options() {
78
  'load_google_fonts' => 1,
79
  'old_browser_compatibility' => 1,
80
  // DB
 
81
  'use_acf_getfield' => 0,
82
  'db_force_case' => 'none',
83
  'db_force_unicode' => 0,
@@ -93,13 +94,14 @@ function asl_do_init_options() {
93
  'override_search_form' => 0,
94
  'override_woo_search_form' => 0,
95
  'keyword_logic' => "and",
 
96
  'trigger_on_facet_change' => 1,
97
  'redirect_click_to' => 'results_page',
98
  'redirect_enter_to' => 'results_page',
99
  'click_action_location' => 'same',
100
  'return_action_location' => 'same',
101
  'custom_redirect_url' => '?s={phrase}',
102
- 'results_per_page' => 10,
103
  'triggerontype' => 1,
104
  'customtypes' => array('post', 'page'),
105
  'searchintitle' => 1,
@@ -125,28 +127,19 @@ function asl_do_init_options() {
125
 
126
  'orderby_primary' => 'relevance DESC',
127
  'orderby_secondary' => 'date DESC',
 
 
 
 
128
 
129
  // General/Image
130
  'show_images' => 1,
131
- 'image_transparency' => 1,
132
- 'image_bg_color' => "#FFFFFF",
133
  'image_width' => 70,
134
  'image_height' => 70,
135
  'image_parser_image_number' => 1,
136
-
137
- 'image_crop_location' => 'c',
138
- 'image_crop_location_selects' => array(
139
- array('option' => 'In the center', 'value' => 'c'),
140
- array('option' => 'Align top', 'value' => 't'),
141
- array('option' => 'Align top right', 'value' => 'tr'),
142
- array('option' => 'Align top left', 'value' => 'tl'),
143
- array('option' => 'Align bottom', 'value' => 'b'),
144
- array('option' => 'Align bottom right', 'value' => 'br'),
145
- array('option' => 'Align bottom left', 'value' => 'bl'),
146
- array('option' => 'Align left', 'value' => 'l'),
147
- array('option' => 'Align right', 'value' => 'r')
148
- ),
149
-
150
  'image_sources' => array(
151
  array('option' => 'Featured image', 'value' => 'featured'),
152
  array('option' => 'Post Content', 'value' => 'content'),
@@ -162,7 +155,6 @@ function asl_do_init_options() {
162
  'image_source3' => 'excerpt',
163
  'image_source4' => 'custom',
164
  'image_source5' => 'default',
165
-
166
  'image_default' => ASL_URL . "img/default.jpg",
167
  'image_source_featured' => 'original',
168
  'image_custom_field' => '',
@@ -172,8 +164,6 @@ function asl_do_init_options() {
172
  /* Frontend search settings Options */
173
  'show_frontend_search_settings' => 0,
174
  'showexactmatches' => 1,
175
- 'showsearchinposts' => 1,
176
- 'showsearchinpages' => 1,
177
  'showsearchintitle' => 1,
178
  'showsearchincontent' => 1,
179
  'showcustomtypes' => '',
@@ -184,8 +174,6 @@ function asl_do_init_options() {
184
  'showsearchinbpforums' => 0,
185
 
186
  'exactmatchestext' => "Exact matches only",
187
- 'searchinpoststext' => "Search in posts",
188
- 'searchinpagestext' => "Search in pages",
189
  'searchintitletext' => "Search in title",
190
  'searchincontenttext' => "Search in content",
191
  'searchincommentstext' => "Search in comments",
@@ -218,6 +206,19 @@ function asl_do_init_options() {
218
  'override_icon_color' => '#000000',
219
  'override_border' => 0,
220
  'override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',
 
 
 
 
 
 
 
 
 
 
 
 
 
221
  // Results Layout
222
  'resultstype_def' => array(
223
  array('option' => 'Vertical Results', 'value' => 'vertical'),
@@ -252,13 +253,23 @@ function asl_do_init_options() {
252
  'showdate' => 0,
253
  'showdescription' => 1,
254
  'descriptionlength' => 100,
255
- 'description_context' => 0,
 
256
  'noresultstext' => "No results!",
257
  'didyoumeantext' => "Did you mean:",
258
  'kw_highlight' => 0,
259
  'kw_highlight_whole_words' => 1,
260
  'highlight_color' => "#d9312b",
261
  'highlight_bg_color' => "#eee",
 
 
 
 
 
 
 
 
 
262
  'custom_css' => "",
263
 
264
  // General/Autocomplete/KW suggestions
@@ -268,7 +279,6 @@ function asl_do_init_options() {
268
  'kw_length' => 60,
269
  'kw_count' => 10,
270
  'kw_google_lang' => "en",
271
- 'kw_exceptions' => "",
272
 
273
  /* Advanced Options */
274
  'shortcode_op' => 'remove',
@@ -278,10 +288,16 @@ function asl_do_init_options() {
278
  'pageswithcategories' => 0,
279
 
280
 
281
- 'titlefield' => 0,
282
- 'titlefield_cf' => '',
283
- 'descriptionfield' => 0,
284
- 'descriptionfield_cf' => '',
 
 
 
 
 
 
285
 
286
  'woo_exclude_outofstock' => 0,
287
  'exclude_woo_hidden' => 1,
@@ -291,7 +307,10 @@ function asl_do_init_options() {
291
  //'exclude_term_ids' => '',
292
 
293
  'wpml_compatibility' => 1,
294
- 'polylang_compatibility' => 1
 
 
 
295
  );
296
  }
297
 
78
  'load_google_fonts' => 1,
79
  'old_browser_compatibility' => 1,
80
  // DB
81
+ 'query_soft_check' => 0,
82
  'use_acf_getfield' => 0,
83
  'db_force_case' => 'none',
84
  'db_force_unicode' => 0,
94
  'override_search_form' => 0,
95
  'override_woo_search_form' => 0,
96
  'keyword_logic' => "and",
97
+ 'mob_auto_focus_menu_selector' => '#menu-toggle',
98
  'trigger_on_facet_change' => 1,
99
  'redirect_click_to' => 'results_page',
100
  'redirect_enter_to' => 'results_page',
101
  'click_action_location' => 'same',
102
  'return_action_location' => 'same',
103
  'custom_redirect_url' => '?s={phrase}',
104
+ 'results_per_page' => 'auto',
105
  'triggerontype' => 1,
106
  'customtypes' => array('post', 'page'),
107
  'searchintitle' => 1,
127
 
128
  'orderby_primary' => 'relevance DESC',
129
  'orderby_secondary' => 'date DESC',
130
+ 'orderby_primary_cf' => '',
131
+ 'orderby_secondary_cf' => '',
132
+ 'orderby_primary_cf_type' => 'numeric',
133
+ 'orderby_secondary_cf_type' => 'numeric',
134
 
135
  // General/Image
136
  'show_images' => 1,
 
 
137
  'image_width' => 70,
138
  'image_height' => 70,
139
  'image_parser_image_number' => 1,
140
+ 'image_parser_exclude_filenames' => '',
141
+ 'image_display_mode' => 'cover',
142
+ 'image_apply_content_filter' => 0,
 
 
 
 
 
 
 
 
 
 
 
143
  'image_sources' => array(
144
  array('option' => 'Featured image', 'value' => 'featured'),
145
  array('option' => 'Post Content', 'value' => 'content'),
155
  'image_source3' => 'excerpt',
156
  'image_source4' => 'custom',
157
  'image_source5' => 'default',
 
158
  'image_default' => ASL_URL . "img/default.jpg",
159
  'image_source_featured' => 'original',
160
  'image_custom_field' => '',
164
  /* Frontend search settings Options */
165
  'show_frontend_search_settings' => 0,
166
  'showexactmatches' => 1,
 
 
167
  'showsearchintitle' => 1,
168
  'showsearchincontent' => 1,
169
  'showcustomtypes' => '',
174
  'showsearchinbpforums' => 0,
175
 
176
  'exactmatchestext' => "Exact matches only",
 
 
177
  'searchintitletext' => "Search in title",
178
  'searchincontenttext' => "Search in content",
179
  'searchincommentstext' => "Search in comments",
206
  'override_icon_color' => '#000000',
207
  'override_border' => 0,
208
  'override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',
209
+
210
+ 'results_bg_override' => 0,
211
+ 'results_bg_override_color' => '#FFFFFF',
212
+ 'results_item_bg_override' => 0,
213
+ 'results_item_bg_override_color' => '#FFFFFF',
214
+ 'results_override_border' => 0,
215
+ 'results_override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',
216
+
217
+ 'settings_bg_override' => 0,
218
+ 'settings_bg_override_color' => '#FFFFFF',
219
+ 'settings_override_border' => 0,
220
+ 'settings_override_border_style' => 'border:1px none rgb(0, 0, 0);border-radius:0px 0px 0px 0px;',
221
+
222
  // Results Layout
223
  'resultstype_def' => array(
224
  array('option' => 'Vertical Results', 'value' => 'vertical'),
253
  'showdate' => 0,
254
  'showdescription' => 1,
255
  'descriptionlength' => 100,
256
+ 'description_context' => 0,
257
+ 'description_context_depth' => 10000,
258
  'noresultstext' => "No results!",
259
  'didyoumeantext' => "Did you mean:",
260
  'kw_highlight' => 0,
261
  'kw_highlight_whole_words' => 1,
262
  'highlight_color' => "#d9312b",
263
  'highlight_bg_color' => "#eee",
264
+
265
+ 'single_highlight' => 0,
266
+ 'single_highlightwholewords' => 1,
267
+ 'single_highlightcolor' => "#d9312b",
268
+ 'single_highlightbgcolor' => "#eee",
269
+ 'single_highlight_scroll' => 0,
270
+ 'single_highlight_offset' => 0,
271
+ 'single_highlight_selector' => "#content",
272
+
273
  'custom_css' => "",
274
 
275
  // General/Autocomplete/KW suggestions
279
  'kw_length' => 60,
280
  'kw_count' => 10,
281
  'kw_google_lang' => "en",
 
282
 
283
  /* Advanced Options */
284
  'shortcode_op' => 'remove',
288
  'pageswithcategories' => 0,
289
 
290
 
291
+ 'primary_titlefield' => 0,
292
+ 'primary_titlefield_cf' => '',
293
+ 'primary_descriptionfield' => 0,
294
+ 'primary_descriptionfield_cf' => '',
295
+ 'secondary_titlefield' => 0,
296
+ 'secondary_titlefield_cf' => '',
297
+ 'secondary_descriptionfield' => 0,
298
+ 'secondary_descriptionfield_cf' => '',
299
+ 'advtitlefield' => '{titlefield}',
300
+ 'advdescriptionfield' => '{descriptionfield}',
301
 
302
  'woo_exclude_outofstock' => 0,
303
  'exclude_woo_hidden' => 1,
307
  //'exclude_term_ids' => '',
308
 
309
  'wpml_compatibility' => 1,
310
+ 'polylang_compatibility' => 1,
311
+
312
+ 'kw_exceptions' => '',
313
+ 'kw_exceptions_e' => ''
314
  );
315
  }
316
 
backend/settings/types.inc.php CHANGED
@@ -32,6 +32,7 @@ include('class/text.class.php');
32
  include('class/textsmall.class.php');
33
  include('class/textarea.class.php');
34
  include('class/textarea-isparam.class.php');
 
35
  include('class/upload.class.php');
36
  include('class/yesno.class.php');
37
  include('class/wd_cf_search_callback.class.php');
@@ -70,6 +71,11 @@ if (!function_exists("admin_scriptsV04")) {
70
  ), ASL_CURR_VER_STRING, true);
71
  wp_enqueue_script('wpdreams-upload');
72
 
 
 
 
 
 
73
  wp_register_script('wpdreams-misc', ASL_URL_NP . 'backend/settings/assets/misc.js', array(
74
  'jquery'
75
  ), ASL_CURR_VER_STRING, true);
32
  include('class/textsmall.class.php');
33
  include('class/textarea.class.php');
34
  include('class/textarea-isparam.class.php');
35
+ include('class/textarea-expandable.class.php');
36
  include('class/upload.class.php');
37
  include('class/yesno.class.php');
38
  include('class/wd_cf_search_callback.class.php');
71
  ), ASL_CURR_VER_STRING, true);
72
  wp_enqueue_script('wpdreams-upload');
73
 
74
+ wp_register_script('wpd-textarea-autosize', ASL_URL_NP . 'backend/settings/assets/textarea-autosize/jquery.textarea-autosize.js', array(
75
+ 'jquery'
76
+ ), ASL_CURR_VER_STRING, true);
77
+ wp_enqueue_script('wpd-textarea-autosize');
78
+
79
  wp_register_script('wpdreams-misc', ASL_URL_NP . 'backend/settings/assets/misc.js', array(
80
  'jquery'
81
  ), ASL_CURR_VER_STRING, true);
backend/tabs/compatibility/cssjs_options.php ADDED
@@ -0,0 +1,98 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="item">
2
+ <?php
3
+ $o = new wpdreamsCustomSelect("js_source", __('Javascript source', 'ajax-search-lite'), array(
4
+ 'selects' => array(
5
+ array('option' => __('Non minified', 'ajax-search-lite'), 'value' => 'nomin'),
6
+ array('option' => __('Minified', 'ajax-search-lite'), 'value' => 'min'),
7
+ array('option' => __('Non-minified scoped', 'ajax-search-lite'), 'value' => 'nomin-scoped'),
8
+ array('option' => __('Minified scoped', 'ajax-search-lite'), 'value' => 'min-scoped'),
9
+ ),
10
+ 'value' => $com_options['js_source']
11
+ )
12
+ );
13
+ $params[$o->getName()] = $o->getData();
14
+ ?>
15
+ <p class="descMsg">
16
+ <ul style="float:right;text-align:left;width:50%;">
17
+ <li><?php echo __('<b>Non minified</b> - Optimal Compatibility, Medium space', 'ajax-search-lite'); ?></li>
18
+ <li><?php echo __('<b>Minified</b> - Optimal Compatibility, Low space (recommended)', 'ajax-search-lite'); ?></li>
19
+ <li><?php echo __('<b>Non minified Scoped</b> - High Compatibility, High space', 'ajax-search-lite'); ?></li>
20
+ <li><?php echo __('<b>Minified Scoped</b> - High Compatibility, Medium space', 'ajax-search-lite'); ?></li>
21
+ </ul>
22
+ <div class="clear"></div>
23
+ </p>
24
+ </div>
25
+ <div class="item">
26
+ <?php
27
+ $o = new wpdreamsCustomSelect("js_init", __('Javascript init method', 'ajax-search-lite'), array(
28
+ 'selects'=>array(
29
+ array('option'=>__('Dynamic (default)', 'ajax-search-lite'), 'value'=>'dynamic'),
30
+ array('option'=>__('Blocking', 'ajax-search-lite'), 'value'=>'blocking')
31
+ ),
32
+ 'value'=>$com_options['js_init']
33
+ )
34
+ );
35
+ $params[$o->getName()] = $o->getData();
36
+ ?>
37
+ <p class="descMsg">
38
+ <?php echo __('Try to choose <strong>Blocking</strong> if the search bar is not responding to anything.', 'ajax-search-lite'); ?>
39
+ </p>
40
+ </div>
41
+ <div class="item">
42
+ <?php $o = new wpdreamsYesNo("detect_ajax", __('Try to re-initialize if the page was loaded via ajax?', 'ajax-search-lite'),
43
+ $com_options['detect_ajax']
44
+ ); ?>
45
+ <p class='descMsg'>
46
+ <?php echo __('Will try to re-initialize the plugin in case an AJAX page loader is used, like Polylang language switcher etc..', 'ajax-search-lite'); ?>
47
+ </p>
48
+ </div>
49
+ <div class="item">
50
+ <p class='infoMsg'>
51
+ <?php echo __('You can turn some of these off, if you are not using them.', 'ajax-search-lite'); ?>
52
+ </p>
53
+ <?php $o = new wpdreamsYesNo("js_retain_popstate", __('Remember search phrase and options when using the Browser Back button?', 'ajax-search-lite'),
54
+ $com_options['js_retain_popstate']
55
+ ); ?>
56
+ <p class='descMsg'>
57
+ <?php echo __('Whenever the user clicks on a live search result, and decides to navigate back, the search will re-trigger and reset the previous options.', 'ajax-search-lite'); ?>
58
+ </p>
59
+ </div>
60
+ <div class="item">
61
+ <?php $o = new wpdreamsYesNo("js_fix_duplicates", __('Try fixing DOM duplicates of the search bar if they exist?', 'ajax-search-lite'),
62
+ $com_options['js_fix_duplicates']
63
+ ); ?>
64
+ <p class='descMsg'>
65
+ <?php echo __('Some menu or widgets scripts tend to <strong>clone</strong> the search bar completely for Mobile viewports, causing a malfunctioning search bar with no event handlers. When this is active, the plugin script will try to fix that, if possible.', 'ajax-search-lite'); ?>
66
+ </p>
67
+ </div>
68
+ <div class="item">
69
+ <?php $o = new wpdreamsYesNo("load_google_fonts", __('Load the <strong>google fonts</strong> used in the search options?', 'ajax-search-lite'),
70
+ $com_options['load_google_fonts']
71
+ ); ?>
72
+ <p class='descMsg'>
73
+ <?php echo __('When <strong>turned off</strong>, the google fonts <strong>will not be loaded</strong> via this plugin at all.<br>Useful if you already have them loaded, to avoid mutliple loading times.', 'ajax-search-lite'); ?>
74
+ </p>
75
+ </div>
76
+ <div class="item">
77
+ <?php
78
+ $o = new wpdreamsCustomSelect("load_scroll_js", "Load the scrollbar script?", array(
79
+ 'selects'=>array(
80
+ array('option'=>'Yes', 'value'=>'yes'),
81
+ array('option'=>'No', 'value'=>'no')
82
+ ),
83
+ 'value'=>$com_options['load_scroll_js']
84
+ )
85
+ );
86
+ $params[$o->getName()] = $o->getData();
87
+ ?>
88
+ <p class='descMsg'>
89
+ <ul>
90
+ <li>When set to <strong>No</strong>, the custom scrollbar will <strong>not be used at all</strong>.</li>
91
+ </ul>
92
+ </p>
93
+ </div>
94
+ <div class="item">
95
+ <?php $o = new wpdreamsYesNo("old_browser_compatibility", __('Display the default search box on old browsers? (IE<=8)', 'ajax-search-lite'),
96
+ $com_options['old_browser_compatibility']
97
+ ); ?>
98
+ </div>
backend/tabs/compatibility/query_options.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="item">
2
+ <?php $o = new wpdreamsYesNo("query_soft_check",
3
+ __('Do a soft-check only on search override, when trying to check if the current query is the search?', 'ajax-search-lite'),
4
+ $com_options['query_soft_check']
5
+ ); ?>
6
+ <p class='descMsg'>
7
+ <?php echo __('Use this option, when the search override does not work on the search results page.', 'ajax-search-lite'); ?>
8
+ </p>
9
+ </div>
10
+ <div class="item">
11
+ <?php $o = new wpdreamsYesNo("use_acf_getfield",
12
+ __('<strong>Advanced Custom Fields</strong>: use the ACF get_field() function to get the metadata?', 'ajax-search-lite'),
13
+ $com_options['use_acf_getfield']
14
+ ); ?>
15
+ <p class='descMsg'>Will use the get_field() Advanced Custom Fields function instead of the core get_post_meta()</p>
16
+ </div>
17
+
18
+ <p class='infoMsg'>
19
+ <?php echo __('If you are experiencing issues with accent(diacritic) or case sensitiveness, you can force the search to try these tweaks.', 'ajax-search-lite'); ?><br>
20
+ <?php echo __('<i>The search works according to your database collation settings</i>, so please be aware that <b>this is not an effective way</b> of fixing database collation issues.', 'ajax-search-lite'); ?><br>
21
+ <?php echo sprintf( __('If you have case/diacritic issues then please read the <a href="%s" target="_blank">MySql manual on collations</a> or consult a <b>database expert</b> - those issues should be treated on database level!', 'ajax-search-lite'),
22
+ 'http://dev.mysql.com/doc/refman/5.0/en/charset-syntax.html'
23
+ ); ?>
24
+ </p>
25
+ <div class="item">
26
+ <?php
27
+ $o = new wpdreamsCustomSelect("db_force_case", __('Force case', 'ajax-search-lite'), array(
28
+ 'selects'=> array(
29
+ array('option' => __('None', 'ajax-search-lite'), 'value' => 'none'),
30
+ array('option' => __('Sensitivity', 'ajax-search-lite'), 'value' => 'sensitivity'),
31
+ array('option' => __('InSensitivity', 'ajax-search-lite'), 'value' => 'insensitivity')
32
+ ),
33
+ 'value'=>$com_options['db_force_case']
34
+ )
35
+ );
36
+ $params[$o->getName()] = $o->getData();
37
+ ?>
38
+ </div>
39
+ <div class="item">
40
+ <?php $o = new wpdreamsYesNo("db_force_unicode", __('Force unicode search', 'ajax-search-lite'),
41
+ $com_options['db_force_unicode']
42
+ ); ?>
43
+ <p class='descMsg'>
44
+ <?php echo __('Will try to force unicode character conversion on the search phrase.', 'ajax-search-lite'); ?>
45
+ </p>
46
+ </div>
47
+ <div class="item">
48
+ <?php $o = new wpdreamsYesNo("db_force_utf8_like", __('Force utf8 on LIKE operations', 'ajax-search-lite'),
49
+ $com_options['db_force_utf8_like']
50
+ ); ?>
51
+ <p class='descMsg'>
52
+ <?php echo __('Will try to force utf8 conversion on all LIKE operations in the WHERE and HAVING clauses.', 'ajax-search-lite'); ?>
53
+ </p>
54
+ </div>
backend/tabs/instance/advanced/content.php ADDED
@@ -0,0 +1,100 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="item">
2
+ <?php
3
+ $o = new wpdreamsCustomSelect("shortcode_op", __("What to do with shortcodes in results content?", "ajax-search-lite"), array(
4
+ 'selects'=>array(
5
+ array("option"=>"Remove them, keep the content", "value" => "remove"),
6
+ array("option"=>"Execute them (can by really slow)", "value" => "execute")
7
+ ),
8
+ 'value'=>$sd['shortcode_op']
9
+ ));
10
+ $params[$o->getName()] = $o->getData();
11
+ ?>
12
+ <p class="descMsg">
13
+ <?php echo __("Removing shortcode is usually much faster, especially if you have many of them within posts.", "ajax-search-lite"); ?>
14
+ </p>
15
+ </div>
16
+ <fieldset>
17
+ <legend><?php _e("Title and Content fields", "ajax-search-lite"); ?>
18
+ <span class="asl_legend_docs">
19
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/advanced-options/title-and-content-fields"><span class="fa fa-book"></span>
20
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
21
+ </a>
22
+ </span>
23
+ </legend>
24
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
25
+ <?php
26
+ $o = new wpdreamsCustomSelect("primary_titlefield", __("Title Field", "ajax-search-lite"), array(
27
+ 'selects'=>array(
28
+ array('option' => 'Post Title', 'value' => 0),
29
+ array('option' => 'Post Excerpt', 'value' => 1),
30
+ array('option' => 'Custom Field', 'value' => 'c__f')
31
+ ),
32
+ 'value'=>$sd['primary_titlefield']
33
+ ));
34
+ $params[$o->getName()] = $o->getData();
35
+ $o = new wd_CFSearchCallBack('primary_titlefield_cf', '', array(
36
+ 'value'=>$sd['primary_titlefield_cf'],
37
+ 'args'=> array(
38
+ 'controls_position' => 'left',
39
+ 'class'=>'wpd-text-right'
40
+ )
41
+ ));
42
+ $params[$o->getName()] = $o->getData();
43
+ ?>
44
+ </div>
45
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
46
+ <?php
47
+ $o = new wpdreamsCustomSelect("secondary_descriptionfield", __("Description Field", "ajax-search-lite"), array(
48
+ 'selects'=>array(
49
+ array('option' => 'Post Content', 'value' => 0),
50
+ array('option' => 'Post Excerpt', 'value' => 1),
51
+ array('option' => 'Post Title', 'value' => 2),
52
+ array('option' => 'Custom Field', 'value' => 'c__f')
53
+ ),
54
+ 'value'=>$sd['secondary_descriptionfield']
55
+ ));
56
+ $params[$o->getName()] = $o->getData();
57
+ $o = new wd_CFSearchCallBack('secondary_descriptionfield_cf', '', array(
58
+ 'value'=>$sd['secondary_descriptionfield_cf'],
59
+ 'args'=> array(
60
+ 'controls_position' => 'left',
61
+ 'class'=>'wpd-text-right'
62
+ )
63
+ ));
64
+ $params[$o->getName()] = $o->getData();
65
+ ?>
66
+ </div>
67
+ </fieldset>
68
+ <fieldset>
69
+ <legend><?php _e("Advanced Title and Content fields", "ajax-search-lite"); ?>
70
+ <span class="asl_legend_docs">
71
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/advanced-options/advanced-title-and-content-fields"><span class="fa fa-book"></span>
72
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
73
+ </a>
74
+ </span>
75
+ </legend>
76
+ <div class="item">
77
+ <?php
78
+ $o = new wd_TextareaExpandable("advtitlefield", __('Advanced Title Field (default: {titlefield})', 'ajax-search-lite'), $sd['advtitlefield']);
79
+ $params[$o->getName()] = $o->getData();
80
+ ?>
81
+ <p class="descMsg">
82
+ <?php echo __('HTML is supported! Use {custom_field_name} format to have custom field values.', 'ajax-search-lite'); ?>&nbsp;
83
+ <a href="https://documentation.ajaxsearchlite.com/advanced-options/advanced-title-and-content-fields" target="_blank">
84
+ <?php echo __('More possibilities explained here!', 'ajax-search-lite'); ?>
85
+ </a>
86
+ </p>
87
+ </div>
88
+ <div class="item">
89
+ <?php
90
+ $o = new wd_TextareaExpandable("advdescriptionfield", __('Advanced Description Field (default: {descriptionfield})', 'ajax-search-lite'), $sd['advdescriptionfield']);
91
+ $params[$o->getName()] = $o->getData();
92
+ ?>
93
+ <p class="descMsg">
94
+ <?php echo __('HTML is supported! Use {custom_field_name} format to have custom field values.', 'ajax-search-lite'); ?>&nbsp;
95
+ <a href="https://documentation.ajaxsearchlite.com/advanced-options/advanced-title-and-content-fields" target="_blank">
96
+ <?php echo __('More possibilities explained here!', 'ajax-search-lite'); ?>
97
+ </a>
98
+ </p>
99
+ </div>
100
+ </fieldset>
backend/tabs/instance/advanced/exclude_results.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <fieldset>
2
+ <legend><?php _e('Mutli-language support', 'ajax-search-lite'); ?></legend>
3
+ <div class="item<?php echo class_exists('SitePress') ? "" : " hiddend"; ?>">
4
+ <?php
5
+ $o = new wpdreamsYesNo("wpml_compatibility", __("WPML compatibility", "ajax-search-lite"), $sd['wpml_compatibility']);
6
+ $params[$o->getName()] = $o->getData();
7
+ ?>
8
+ </div>
9
+ <div class="item<?php echo function_exists("pll_current_language") ? "" : " hiddend"; ?>">
10
+ <?php
11
+ $o = new wpdreamsYesNo("polylang_compatibility", __("Polylang compatibility", "ajax-search-lite"), $sd['polylang_compatibility']);
12
+ $params[$o->getName()] = $o->getData();
13
+ ?>
14
+ </div>
15
+ </fieldset>
16
+ <fieldset class="<?php echo class_exists('WooCommerce') ? "" : "hiddend"; ?>">
17
+ <legend><?php _e('WooCommerce related', 'ajax-search-lite'); ?><</legend>
18
+ <div class="item">
19
+ <?php
20
+ $o = new wpdreamsYesNo("exclude_woo_hidden", __("Exclude hidden search WooCommerce products from search?", "ajax-search-lite"), $sd['exclude_woo_hidden']);
21
+ $params[$o->getName()] = $o->getData();
22
+ ?>
23
+ <p class="descMsg"><?php _e('"Hidden" in this case means "Shop only" or "Hidden"', 'ajax-search-lite'); ?></p>
24
+ </div>
25
+ <div class="item">
26
+ <?php
27
+ $o = new wpdreamsYesNo("exclude_woo_catalog", __("Exclude hidden catalog WooCommerce products from search?", "ajax-search-lite"), $sd['exclude_woo_catalog']);
28
+ $params[$o->getName()] = $o->getData();
29
+ ?>
30
+ <p class="descMsg"><?php _e('This case means "Search results only"', 'ajax-search-lite'); ?></p>
31
+ </div>
32
+ <div class="item">
33
+ <?php
34
+ $o = new wpdreamsYesNo("woo_exclude_outofstock", __("Exclude WooCommerce out of stock products?", "ajax-search-lite"), $sd['woo_exclude_outofstock']);
35
+ $params[$o->getName()] = $o->getData();
36
+ ?>
37
+ </div>
38
+ </fieldset>
39
+ <fieldset>
40
+ <legend><?php _e('Mutli-language support', 'ajax-search-lite'); ?></legend>
41
+ <div class="item">
42
+ <?php
43
+ $o = new wpdreamsCategories("excludecategories", __("Exclude categories", "ajax-search-lite"), $sd['excludecategories']);
44
+ $params[$o->getName()] = $o->getData();
45
+ $params['selected-'.$o->getName()] = $o->getSelected();
46
+ ?>
47
+ </div>
48
+ <div class="item">
49
+ <?php
50
+ $o = new wpdreamsTextarea("excludeposts", __("Exclude Posts by ID's (comma separated post ID-s)", "ajax-search-lite"), $sd['excludeposts']);
51
+ $params[$o->getName()] = $o->getData();
52
+ ?>
53
+ </div>
54
+ </fieldset>
backend/tabs/instance/advanced/kw_exceptions.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <p class="infoMsg"><?php echo __('Keyword exceptions will be replaced with an empty string "" in the search phrase.', 'ajax-search-lite'); ?></p>
2
+ <div class="item">
3
+ <?php
4
+ $o = new wd_TextareaExpandable("kw_exceptions", __('Keyword exceptions - replace anywhere', 'ajax-search-lite'), $sd['kw_exceptions']);
5
+ $params[$o->getName()] = $o->getData();
6
+ ?>
7
+ <p class="descMsg"><?php echo __('<strong>Comma separated list</strong> of keywords you want to remove or ban. Matching anything, even partial words.', 'ajax-search-lite'); ?></p>
8
+ </div>
9
+ <div class="item">
10
+ <?php
11
+ $o = new wd_TextareaExpandable("kw_exceptions_e", __('Keyword exceptions - replace whole words only', 'ajax-search-lite'), $sd['kw_exceptions_e']);
12
+ $params[$o->getName()] = $o->getData();
13
+ ?>
14
+ <p class="descMsg"><?php echo __('<strong>Comma separated list</strong> of keywords you want to remove or ban. Only matching whole words between word boundaries.', 'ajax-search-lite'); ?></p>
15
+ </div>
backend/tabs/instance/advanced_options.php CHANGED
@@ -1,109 +1,40 @@
1
- <fieldset class="<?php echo class_exists('WooCommerce') ? "" : "hiddend"; ?>">
2
- <legend>WooCommerce related</legend>
3
- <div class="item">
4
- <?php
5
- $o = new wpdreamsYesNo("exclude_woo_hidden", __("Exclude hidden search WooCommerce products from search?", "ajax-search-lite"), $sd['exclude_woo_hidden']);
6
- $params[$o->getName()] = $o->getData();
7
- ?>
8
- <p class="descMsg">'Hidden' in this case means "Shop only" or "Hidden"</p>
9
- </div>
10
- <div class="item">
11
- <?php
12
- $o = new wpdreamsYesNo("exclude_woo_catalog", __("Exclude hidden catalog WooCommerce products from search?", "ajax-search-lite"), $sd['exclude_woo_catalog']);
13
- $params[$o->getName()] = $o->getData();
14
- ?>
15
- <p class="descMsg">This case means "Search results only"</p>
16
- </div>
17
- <div class="item">
18
- <?php
19
- $o = new wpdreamsYesNo("woo_exclude_outofstock", __("Exclude WooCommerce out of stock products?", "ajax-search-lite"), $sd['woo_exclude_outofstock']);
20
- $params[$o->getName()] = $o->getData();
21
- ?>
22
- </div>
23
- </fieldset>
24
- <div class="item">
25
- <?php
26
- $o = new wpdreamsCustomSelect("shortcode_op", __("What to do with shortcodes in results content?", "ajax-search-lite"), array(
27
- 'selects'=>array(
28
- array("option"=>"Remove them, keep the content", "value" => "remove"),
29
- array("option"=>"Execute them (can by really slow)", "value" => "execute")
30
- ),
31
- 'value'=>$sd['shortcode_op']
32
- ));
33
- $params[$o->getName()] = $o->getData();
34
- ?>
35
- <p class="descMsg">
36
- <?php echo __("Removing shortcode is usually much faster, especially if you have many of them within posts.", "ajax-search-lite"); ?>
37
- </p>
38
- </div>
39
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
40
- <?php
41
- $o = new wpdreamsCustomSelect("titlefield", __("Title Field", "ajax-search-lite"), array(
42
- 'selects'=>array(
43
- array('option' => 'Post Title', 'value' => 0),
44
- array('option' => 'Post Excerpt', 'value' => 1),
45
- array('option' => 'Custom Field', 'value' => 'c__f')
46
- ),
47
- 'value'=>$sd['titlefield']
48
- ));
49
- $params[$o->getName()] = $o->getData();
50
- $o = new wd_CFSearchCallBack('titlefield_cf', '', array(
51
- 'value'=>$sd['titlefield_cf'],
52
- 'args'=> array(
53
- 'controls_position' => 'left',
54
- 'class'=>'wpd-text-right'
55
- )
56
- ));
57
- $params[$o->getName()] = $o->getData();
58
- ?>
59
- </div>
60
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
61
- <?php
62
- $o = new wpdreamsCustomSelect("descriptionfield", __("Description Field", "ajax-search-lite"), array(
63
- 'selects'=>array(
64
- array('option' => 'Post Content', 'value' => 0),
65
- array('option' => 'Post Excerpt', 'value' => 1),
66
- array('option' => 'Post Title', 'value' => 2),
67
- array('option' => 'Custom Field', 'value' => 'c__f')
68
- ),
69
- 'value'=>$sd['descriptionfield']
70
- ));
71
- $params[$o->getName()] = $o->getData();
72
- $o = new wd_CFSearchCallBack('descriptionfield_cf', '', array(
73
- 'value'=>$sd['descriptionfield_cf'],
74
- 'args'=> array(
75
- 'controls_position' => 'left',
76
- 'class'=>'wpd-text-right'
77
- )
78
- ));
79
- $params[$o->getName()] = $o->getData();
80
- ?>
81
- </div>
82
- <div class="item">
83
- <?php
84
- $o = new wpdreamsCategories("excludecategories", __("Exclude categories", "ajax-search-lite"), $sd['excludecategories']);
85
- $params[$o->getName()] = $o->getData();
86
- $params['selected-'.$o->getName()] = $o->getSelected();
87
- ?>
88
- </div>
89
- <div class="item">
90
- <?php
91
- $o = new wpdreamsTextarea("excludeposts", __("Exclude Posts by ID's (comma separated post ID-s)", "ajax-search-lite"), $sd['excludeposts']);
92
- $params[$o->getName()] = $o->getData();
93
- ?>
94
- </div>
95
- <div class="item<?php echo class_exists('SitePress') ? "" : " hiddend"; ?>">
96
- <?php
97
- $o = new wpdreamsYesNo("wpml_compatibility", __("WPML compatibility", "ajax-search-lite"), $sd['wpml_compatibility']);
98
- $params[$o->getName()] = $o->getData();
99
- ?>
100
- </div>
101
- <div class="item<?php echo function_exists("pll_current_language") ? "" : " hiddend"; ?>">
102
- <?php
103
- $o = new wpdreamsYesNo("polylang_compatibility", __("Polylang compatibility", "ajax-search-lite"), $sd['polylang_compatibility']);
104
- $params[$o->getName()] = $o->getData();
105
- ?>
106
  </div>
 
 
107
  <div class="item">
108
  <input type="hidden" name='asl_submit' value=1 />
109
  <input name="submit_asl" type="submit" value="Save options!" />
1
+ <ul id="subtabs" class='tabs'>
2
+ <li><a tabid="701" class='subtheme current'><?php echo __('Content & Fields', 'ajax-search-lite'); ?></a></li>
3
+ <li><a tabid="702" class='subtheme'><?php echo __('Exclude/Include Results', 'ajax-search-lite'); ?></a></li>
4
+ <li><a tabid="703" class='subtheme'><?php echo __('Keyword exceptions', 'ajax-search-lite'); ?></a></li>
5
+ </ul>
6
+ <div class='tabscontent'>
7
+ <div tabid="701">
8
+ <?php include(ASL_PATH."backend/tabs/instance/advanced/content.php"); ?>
9
+ </div>
10
+ <div tabid="702">
11
+ <fieldset>
12
+ <legend>
13
+ <?php echo __('Exclude/Include results', 'ajax-search-lite'); ?>
14
+ <span class="asl_legend_docs">
15
+ <a target="_blank" href="https://documentation.ajaxsearchpro.com/advanced-options/excluding-and-including-results"><span class="fa fa-book"></span>
16
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
17
+ </a>
18
+ </span>
19
+ </legend>
20
+ <?php include(ASL_PATH."backend/tabs/instance/advanced/exclude_results.php"); ?>
21
+ </fieldset>
22
+ </div>
23
+ <div tabid="703">
24
+ <fieldset>
25
+ <legend><?php echo __('Keyword exceptions', 'ajax-search-lite'); ?>
26
+ <span class="asl_legend_docs">
27
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/advanced-options/keyword-exceptions"><span class="fa fa-book"></span>
28
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
29
+ </a>
30
+ </span>
31
+ </legend>
32
+ <?php include(ASL_PATH."backend/tabs/instance/advanced/kw_exceptions.php"); ?>
33
+ </fieldset>
34
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  </div>
36
+
37
+
38
  <div class="item">
39
  <input type="hidden" name='asl_submit' value=1 />
40
  <input name="submit_asl" type="submit" value="Save options!" />
backend/tabs/instance/frontend_options.php CHANGED
@@ -15,20 +15,6 @@
15
  $params[$o->getName()] = $o->getData();
16
  ?>
17
  </div>
18
- <div class="item">
19
- <?php
20
- $o = new wpdreamsYesNo("showsearchinposts", __("Show search in posts selector?", "ajax-search-lite"), $sd['showsearchinposts']);
21
- $params[$o->getName()] = $o->getData();
22
- $o = new wpdreamsText("searchinpoststext", "Text", $sd['searchinpoststext']);
23
- $params[$o->getName()] = $o->getData();
24
- ?></div>
25
- <div class="item">
26
- <?php
27
- $o = new wpdreamsYesNo("showsearchinpages", __("Show search in pages selector?", "ajax-search-lite"), $sd['showsearchinpages']);
28
- $params[$o->getName()] = $o->getData();
29
- $o = new wpdreamsText("searchinpagestext", "Text", $sd['searchinpagestext']);
30
- $params[$o->getName()] = $o->getData();
31
- ?></div>
32
  <div class="item">
33
  <?php
34
  $o = new wpdreamsYesNo("showsearchintitle", __("Show search in title selector?", "ajax-search-lite"), $sd['showsearchintitle']);
15
  $params[$o->getName()] = $o->getData();
16
  ?>
17
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  <div class="item">
19
  <?php
20
  $o = new wpdreamsYesNo("showsearchintitle", __("Show search in title selector?", "ajax-search-lite"), $sd['showsearchintitle']);
backend/tabs/instance/general/autocomplete.php CHANGED
@@ -28,10 +28,4 @@
28
  $sd['kw_google_lang']);
29
  $params[$o->getName()] = $o->getData();
30
  ?>
31
- </div>
32
- <div class="item">
33
- <?php
34
- $o = new wpdreamsTextarea("kw_exceptions", "Keyword exceptions (comma separated)", $sd['kw_exceptions']);
35
- $params[$o->getName()] = $o->getData();
36
- ?>
37
  </div>
28
  $sd['kw_google_lang']);
29
  $params[$o->getName()] = $o->getData();
30
  ?>
 
 
 
 
 
 
31
  </div>
backend/tabs/instance/general/behavior.php CHANGED
@@ -1,159 +1,194 @@
1
- <div class="item item-flex-nogrow item-conditional" style="flex-wrap: wrap;">
2
- <?php
3
- $o = new wpdreamsYesNo("exactonly", __("Show exact matches only?", "ajax-search-lite"),
4
- $sd['exactonly']);
5
- $params[$o->getName()] = $o->getData();
 
 
 
 
 
 
 
 
 
6
 
7
- $o = new wpdreamsCustomSelect('exact_match_location', "..and match fields against the search phrase",
8
- array(
9
- 'selects' => array(
10
- array('option' => __('Anywhere', 'ajax-search-lite'), 'value' => 'anywhere'),
11
- array('option' => __('Starting with phrase', 'ajax-search-lite'), 'value' => 'start'),
12
- array('option' => __('Ending with phrase', 'ajax-search-lite'), 'value' => 'end'),
13
- array('option' => __('Complete match', 'ajax-search-lite'), 'value' => 'full')
14
- ),
15
- 'value' => $sd['exact_match_location']
16
- ));
17
- $params[$o->getName()] = $o->getData();
18
- ?>
19
- </div>
20
- <div class="item">
21
- <?php
22
- $o = new wpdreamsCustomSelect("keyword_logic", __("Keyword (phrase) logic?", "ajax-search-lite"), array(
23
- 'selects'=>array(
24
- array('option' => __('OR', 'aajax-search-lite'), 'value' => 'or'),
25
- array('option' => __('OR with exact word matches', 'ajax-search-lite'), 'value' => 'orex'),
26
- array('option' => __('AND', 'ajax-search-lite'), 'value' => 'and'),
27
- array('option' => __('AND with exact word matches', 'ajax-search-lite'), 'value' => 'andex')
28
- ),
29
- 'value'=>strtolower( $sd['keyword_logic'] )
30
- ));
31
- $params[$o->getName()] = $o->getData();
32
- ?>
33
- <div class="descMsg">
34
- <?php echo __('This determines if the result should match either of the entered phrases (OR logic) or all of the entered phrases (AND logic).', 'ajax-search-lite'); ?>
35
- </div>
36
- <div class="kwLogicInfo infoMsg hiddend">
37
- <?php echo __('Please note: For <strong>performance rasons</strong> exact word matching in the Lite version is only able to check space-separated words. Commas, dots, question marks etc.. are not considered as word separators.', 'ajax-search-lite'); ?>
38
- </div>
39
- </div>
40
- <div class="item">
41
- <?php
42
- $o = new wpdreamsYesNo("trigger_on_facet_change", __("Trigger search on facet change?", "ajax-search-lite"),
43
- $sd['trigger_on_facet_change']);
44
- $params[$o->getName()] = $o->getData();
45
- ?>
46
- <p class="descMsg"><?php echo __("Will trigger a search when the user clicks on a checkbox on the front-end.", "ajax-search-lite"); ?></p>
47
- </div>
48
- <div class="item">
49
- <?php
50
- $o = new wpdreamsYesNo("triggerontype", __("Trigger search when typing?", "ajax-search-lite"),
51
- $sd['triggerontype']);
52
- $params[$o->getName()] = $o->getData();
53
- ?>
54
- </div>
55
- <div class="item">
56
- <?php
57
- $o = new wpdreamsTextSmall("charcount", __("Minimal character count to trigger search", "ajax-search-lite"),
58
- $sd['charcount'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
59
- $params[$o->getName()] = $o->getData();
60
- ?>
61
- </div>
62
- <div class="item">
63
- <?php
64
- $o = new wpdreamsTextSmall("maxresults", __("Max. results", "ajax-search-lite"), $sd['maxresults'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
65
- $params[$o->getName()] = $o->getData();
66
- ?>
67
- </div>
68
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
69
- <?php
70
- $o = new wpdreamsCustomSelect("redirect_click_to", __("Action when clicking <strong>the magnifier</strong> icon", "ajax-search-lite"),
71
- array(
72
- 'selects' => array(
73
- array("option" => __("Trigger live search", "ajax-search-lite"), "value" => "ajax_search"),
74
- array("option" => __("Redirec to: Results page", "ajax-search-lite"), "value" => "results_page"),
75
- array("option" => __("Redirec to: Woocommerce results page", "ajax-search-lite"), "value" => "woo_results_page"),
76
- array("option" => __("Redirec to: First matching result", "ajax-search-lite"), "value" => "first_result"),
77
- array("option" => __("Redirec to: Custom URL", "ajax-search-lite"), "value" => "custom_url"),
78
- array("option" => __("Do nothing", "ajax-search-lite"), "value" => "nothing")
79
- ),
80
- 'value' => $sd['redirect_click_to']
81
- ));
82
- $params[$o->getName()] = $o->getData();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
 
84
- $o = new wpdreamsCustomSelect("click_action_location", " location: ",
85
- array(
86
- 'selects' => array(
87
- array('option' => 'Use same tab', 'value' => 'same'),
88
- array('option' => 'Open new tab', 'value' => 'new')
89
- ),
90
- 'value' => $sd['click_action_location']
91
- ));
92
- $params[$o->getName()] = $o->getData();
93
- ?>
94
- </div>
95
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
96
- <?php
97
- $o = new wpdreamsCustomSelect("redirect_enter_to", __("Action when pressing <strong>the return</strong> key", "ajax-search-lite"),
98
- array(
99
- 'selects' => array(
100
- array("option" => __("Trigger live search", "ajax-search-lite"), "value" => "ajax_search"),
101
- array("option" => __("Redirec to: Results page", "ajax-search-lite"), "value" => "results_page"),
102
- array("option" => __("Redirec to: Woocommerce results page", "ajax-search-lite"), "value" => "woo_results_page"),
103
- array("option" => __("Redirec to: First matching result", "ajax-search-lite"), "value" => "first_result"),
104
- array("option" => __("Redirec to: Custom URL", "ajax-search-lite"), "value" => "custom_url"),
105
- array("option" => __("Do nothing", "ajax-search-lite"), "value" => "nothing")
106
- ),
107
- 'value' => $sd['redirect_enter_to']
108
- ));
109
- $params[$o->getName()] = $o->getData();
110
 
111
- $o = new wpdreamsCustomSelect("return_action_location", " location: ",
112
- array(
113
- 'selects' => array(
114
- array('option' => 'Use same tab', 'value' => 'same'),
115
- array('option' => 'Open new tab', 'value' => 'new')
116
- ),
117
- 'value' => $sd['return_action_location']
118
- ));
119
- $params[$o->getName()] = $o->getData();
120
- ?>
121
- </div>
122
- <div class="item">
123
- <?php
124
- $o = new wpdreamsText("custom_redirect_url", __("Custom redirect URL", "ajax-search-lite"), $sd['custom_redirect_url']);
125
- $params[$o->getName()] = $o->getData();
126
- ?>
127
- <p class="descMsg">You can use the <string>asl_redirect_url</string> filter to add more variables.</p>
128
- </div>
129
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
130
- <?php
131
- $o = new wpdreamsYesNo("override_default_results", __("Override the default WordPress search results?", "ajax-search-lite"),
132
- $sd['override_default_results']);
133
- $params[$o->getName()] = $o->getData();
134
- ?>
135
- <?php
136
- $o = new wpdreamsCustomSelect("override_method", " method ", array(
137
- "selects" =>array(
138
- array("option" => "Post", "value" => "post"),
139
- array("option" => "Get", "value" => "get")
140
- ),
141
- "value" => $sd['override_method']
142
- ));
143
- $params[$o->getName()] = $o->getData();
144
- ?>
145
- <div class="descMsg" style="min-width: 100%;flex-wrap: wrap;flex-basis: auto;flex-grow: 1;box-sizing: border-box;"><?php echo __("Might not work with some Themes.", "ajax-search-lite"); ?></p>
146
- </div>
147
- <div class="item">
148
- <?php
149
- $o = new wpdreamsTextSmall("results_per_page", __('Results count per page?', 'ajax-search-lite'),
150
- $sd['results_per_page']);
151
- $params[$o->getName()] = $o->getData();
152
- ?>
153
- <p class="descMsg"><?php echo __('The number of results per page, on the results page.', 'ajax-search-lite'); ?></p>
154
- <p class="errorMsg">
155
- <?php echo __('<strong>WARNING:</strong> This should be set to the same as the number of results originally displayed on the results page!<br>
156
  Most themes use the system option found on the <strong>General Options -> Reading</strong> submenu, which is 10 by default. <br>
157
  If you set it differently, or your theme has a different option for that, then <strong>set this option to the same value</strong> as well.', 'ajax-search-lite'); ?>
158
- </p>
159
- </div>
 
1
+ <fieldset>
2
+ <legend>
3
+ <?php echo __('Logic and matching', 'ajax-search-lite'); ?>
4
+ <span class="asl_legend_docs">
5
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/general-options/search-logic"><span class="fa fa-book"></span>
6
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
7
+ </a>
8
+ </span>
9
+ </legend>
10
+ <div class="item item-flex-nogrow item-conditional" style="flex-wrap: wrap;">
11
+ <?php
12
+ $o = new wpdreamsYesNo("exactonly", __("Show exact matches only?", "ajax-search-lite"),
13
+ $sd['exactonly']);
14
+ $params[$o->getName()] = $o->getData();
15
 
16
+ $o = new wpdreamsCustomSelect('exact_match_location', "..and match fields against the search phrase",
17
+ array(
18
+ 'selects' => array(
19
+ array('option' => __('Anywhere', 'ajax-search-lite'), 'value' => 'anywhere'),
20
+ array('option' => __('Starting with phrase', 'ajax-search-lite'), 'value' => 'start'),
21
+ array('option' => __('Ending with phrase', 'ajax-search-lite'), 'value' => 'end'),
22
+ array('option' => __('Complete match', 'ajax-search-lite'), 'value' => 'full')
23
+ ),
24
+ 'value' => $sd['exact_match_location']
25
+ ));
26
+ $params[$o->getName()] = $o->getData();
27
+ ?>
28
+ </div>
29
+ <div class="item">
30
+ <?php
31
+ $o = new wpdreamsCustomSelect("keyword_logic", __("Keyword (phrase) logic?", "ajax-search-lite"), array(
32
+ 'selects'=>array(
33
+ array('option' => __('OR', 'aajax-search-lite'), 'value' => 'or'),
34
+ array('option' => __('OR with exact word matches', 'ajax-search-lite'), 'value' => 'orex'),
35
+ array('option' => __('AND', 'ajax-search-lite'), 'value' => 'and'),
36
+ array('option' => __('AND with exact word matches', 'ajax-search-lite'), 'value' => 'andex')
37
+ ),
38
+ 'value'=>strtolower( $sd['keyword_logic'] )
39
+ ));
40
+ $params[$o->getName()] = $o->getData();
41
+ ?>
42
+ <div class="descMsg">
43
+ <?php echo __('This determines if the result should match either of the entered phrases (OR logic) or all of the entered phrases (AND logic).', 'ajax-search-lite'); ?>
44
+ </div>
45
+ <div class="kwLogicInfo infoMsg hiddend">
46
+ <?php echo __('Please note: For <strong>performance rasons</strong> exact word matching in the Lite version is only able to check space-separated words. Commas, dots, question marks etc.. are not considered as word separators.', 'ajax-search-lite'); ?>
47
+ </div>
48
+ </div>
49
+ </fieldset>
50
+ <fieldset>
51
+ <legend>
52
+ <?php echo __('Mobile specific', 'ajax-search-lite'); ?>
53
+ </legend>
54
+ <div class="item">
55
+ <?php
56
+ $o = new wpdreamsText("mob_auto_focus_menu_selector", __('Auto focus when opening the navigation menu (jQuery selector)', 'ajax-search-lite'),
57
+ $sd['mob_auto_focus_menu_selector']);
58
+ $params[$o->getName()] = $o->getData();
59
+ ?>
60
+ <p class="descMsg">
61
+ <?php echo __('When the search is placed within a mobile navigation menu, you can define a jQuery selector of the opening menu item here - which when clicking auto focuses the search', 'ajax-search-lite'); ?>
62
+ </p>
63
+ </div>
64
+ </fieldset>
65
+ <fieldset>
66
+ <legend>
67
+ <?php echo __('Trigger and redirection behavior', 'ajax-search-lite'); ?>
68
+ <span class="asl_legend_docs">
69
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/general-options/triggers-and-redirection-to-results-page"><span class="fa fa-book"></span>
70
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
71
+ </a>
72
+ </span>
73
+ </legend>
74
+ <div class="item">
75
+ <?php
76
+ $o = new wpdreamsYesNo("trigger_on_facet_change", __("Trigger search on facet change?", "ajax-search-lite"),
77
+ $sd['trigger_on_facet_change']);
78
+ $params[$o->getName()] = $o->getData();
79
+ ?>
80
+ <p class="descMsg"><?php echo __("Will trigger a search when the user clicks on a checkbox on the front-end.", "ajax-search-lite"); ?></p>
81
+ </div>
82
+ <div class="item">
83
+ <?php
84
+ $o = new wpdreamsYesNo("triggerontype", __("Trigger search when typing?", "ajax-search-lite"),
85
+ $sd['triggerontype']);
86
+ $params[$o->getName()] = $o->getData();
87
+ ?>
88
+ </div>
89
+ <div class="item">
90
+ <?php
91
+ $o = new wpdreamsTextSmall("charcount", __("Minimal character count to trigger search", "ajax-search-lite"),
92
+ $sd['charcount'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
93
+ $params[$o->getName()] = $o->getData();
94
+ ?>
95
+ </div>
96
+ <div class="item">
97
+ <?php
98
+ $o = new wpdreamsTextSmall("maxresults", __("Max. results", "ajax-search-lite"), $sd['maxresults'], array(array("func" => "ctype_digit", "op" => "eq", "val" => true)));
99
+ $params[$o->getName()] = $o->getData();
100
+ ?>
101
+ </div>
102
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
103
+ <?php
104
+ $o = new wpdreamsCustomSelect("redirect_click_to", __("Action when clicking <strong>the magnifier</strong> icon", "ajax-search-lite"),
105
+ array(
106
+ 'selects' => array(
107
+ array("option" => __("Trigger live search", "ajax-search-lite"), "value" => "ajax_search"),
108
+ array("option" => __("Redirec to: Results page", "ajax-search-lite"), "value" => "results_page"),
109
+ array("option" => __("Redirec to: Woocommerce results page", "ajax-search-lite"), "value" => "woo_results_page"),
110
+ array("option" => __("Redirec to: First matching result", "ajax-search-lite"), "value" => "first_result"),
111
+ array("option" => __("Redirec to: Custom URL", "ajax-search-lite"), "value" => "custom_url"),
112
+ array("option" => __("Do nothing", "ajax-search-lite"), "value" => "nothing")
113
+ ),
114
+ 'value' => $sd['redirect_click_to']
115
+ ));
116
+ $params[$o->getName()] = $o->getData();
117
 
118
+ $o = new wpdreamsCustomSelect("click_action_location", " location: ",
119
+ array(
120
+ 'selects' => array(
121
+ array('option' => 'Use same tab', 'value' => 'same'),
122
+ array('option' => 'Open new tab', 'value' => 'new')
123
+ ),
124
+ 'value' => $sd['click_action_location']
125
+ ));
126
+ $params[$o->getName()] = $o->getData();
127
+ ?>
128
+ </div>
129
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
130
+ <?php
131
+ $o = new wpdreamsCustomSelect("redirect_enter_to", __("Action when pressing <strong>the return</strong> key", "ajax-search-lite"),
132
+ array(
133
+ 'selects' => array(
134
+ array("option" => __("Trigger live search", "ajax-search-lite"), "value" => "ajax_search"),
135
+ array("option" => __("Redirec to: Results page", "ajax-search-lite"), "value" => "results_page"),
136
+ array("option" => __("Redirec to: Woocommerce results page", "ajax-search-lite"), "value" => "woo_results_page"),
137
+ array("option" => __("Redirec to: First matching result", "ajax-search-lite"), "value" => "first_result"),
138
+ array("option" => __("Redirec to: Custom URL", "ajax-search-lite"), "value" => "custom_url"),
139
+ array("option" => __("Do nothing", "ajax-search-lite"), "value" => "nothing")
140
+ ),
141
+ 'value' => $sd['redirect_enter_to']
142
+ ));
143
+ $params[$o->getName()] = $o->getData();
144
 
145
+ $o = new wpdreamsCustomSelect("return_action_location", " location: ",
146
+ array(
147
+ 'selects' => array(
148
+ array('option' => 'Use same tab', 'value' => 'same'),
149
+ array('option' => 'Open new tab', 'value' => 'new')
150
+ ),
151
+ 'value' => $sd['return_action_location']
152
+ ));
153
+ $params[$o->getName()] = $o->getData();
154
+ ?>
155
+ </div>
156
+ <div class="item">
157
+ <?php
158
+ $o = new wpdreamsText("custom_redirect_url", __("Custom redirect URL", "ajax-search-lite"), $sd['custom_redirect_url']);
159
+ $params[$o->getName()] = $o->getData();
160
+ ?>
161
+ <p class="descMsg">You can use the <string>asl_redirect_url</string> filter to add more variables.</p>
162
+ </div>
163
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
164
+ <?php
165
+ $o = new wpdreamsYesNo("override_default_results", __("Override the default WordPress search results?", "ajax-search-lite"),
166
+ $sd['override_default_results']);
167
+ $params[$o->getName()] = $o->getData();
168
+ ?>
169
+ <?php
170
+ $o = new wpdreamsCustomSelect("override_method", " method ", array(
171
+ "selects" =>array(
172
+ array("option" => "Post", "value" => "post"),
173
+ array("option" => "Get", "value" => "get")
174
+ ),
175
+ "value" => $sd['override_method']
176
+ ));
177
+ $params[$o->getName()] = $o->getData();
178
+ ?>
179
+ <div class="descMsg" style="min-width: 100%;flex-wrap: wrap;flex-basis: auto;flex-grow: 1;box-sizing: border-box;"><?php echo __("Might not work with some Themes.", "ajax-search-lite"); ?></p>
180
+ </div>
181
+ <div class="item">
182
+ <?php
183
+ $o = new wpdreamsTextSmall("results_per_page", __('Results count per page?', 'ajax-search-lite'),
184
+ $sd['results_per_page']);
185
+ $params[$o->getName()] = $o->getData();
186
+ ?>
187
+ <p class="descMsg"><?php echo __('The number of results per page, on the results page.', 'ajax-search-lite'); ?></p>
188
+ <p class="errorMsg">
189
+ <?php echo __('<strong>WARNING:</strong> This should be set to the same as the number of results originally displayed on the results page!<br>
190
  Most themes use the system option found on the <strong>General Options -> Reading</strong> submenu, which is 10 by default. <br>
191
  If you set it differently, or your theme has a different option for that, then <strong>set this option to the same value</strong> as well.', 'ajax-search-lite'); ?>
192
+ </p>
193
+ </div>
194
+ </fieldset>
backend/tabs/instance/general/ordering.php CHANGED
@@ -1,32 +1,67 @@
1
- <div class="item"><?php
2
- $o = new wpdreamsCustomSelect("orderby_primary", __("Primary result ordering", "ajax-search-lite"),
3
- array(
4
- 'selects' => array(
5
- array('option' => 'Relevance', 'value' => 'relevance DESC'),
6
- array('option' => 'Title descending', 'value' => 'title DESC'),
7
- array('option' => 'Title ascending', 'value' => 'title ASC'),
8
- array('option' => 'Date descending', 'value' => 'date DESC'),
9
- array('option' => 'Date ascending', 'value' => 'date ASC')
10
- ),
11
- 'value' => $sd['orderby_primary']
12
- ));
13
- $params[$o->getName()] = $o->getData();
14
- ?>
15
- <p class="descMsg"><?php __("This is the primary ordering. If two elements match the primary ordering criteria, the Secondary ordering is used below.", "ajax-search-lite"); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  </div>
17
- <div class="item"><?php
18
- $o = new wpdreamsCustomSelect("orderby_secondary", __("Secondary result ordering", "ajax-search-lite"),
19
- array(
20
- 'selects' => array(
21
- array('option' => 'Relevance', 'value' => 'relevance DESC'),
22
- array('option' => 'Title descending', 'value' => 'title DESC'),
23
- array('option' => 'Title ascending', 'value' => 'title ASC'),
24
- array('option' => 'Date descending', 'value' => 'date DESC'),
25
- array('option' => 'Date ascending', 'value' => 'date ASC')
26
- ),
27
- 'value' => $sd['orderby_secondary']
28
- ));
29
- $params[$o->getName()] = $o->getData();
30
- ?>
31
- <p class="descMsg"><?php __("For matching elements by primary ordering, this ordering is used.", "ajax-search-lite"); ?></p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  </div>
1
+ <div class="item wd-primary-order item-flex-nogrow item-flex-wrap"><?php
2
+ $o = new wpdreamsCustomSelect("orderby_primary", __('Primary ordering', 'ajax-search-lite'),
3
+ array(
4
+ 'selects' => array(
5
+ array('option' => __('Relevance', 'ajax-search-lite'), 'value' => 'relevance DESC'),
6
+ array('option' => __('Title descending', 'ajax-search-lite'), 'value' => 'post_title DESC'),
7
+ array('option' => __('Title ascending', 'ajax-search-lite'), 'value' => 'post_title ASC'),
8
+ array('option' => __('Date descending', 'ajax-search-lite'), 'value' => 'post_date DESC'),
9
+ array('option' => __('Date ascending', 'ajax-search-lite'), 'value' => 'post_date ASC'),
10
+ array('option' => __('Menu order descending', 'ajax-search-lite'), 'value' => 'menu_order DESC'),
11
+ array('option' => __('Menu order ascending', 'ajax-search-lite'), 'value' => 'menu_order ASC'),
12
+ array('option' => __('Random', 'ajax-search-lite'), 'value' => 'RAND()'),
13
+ array('option' => __('Custom Field descending', 'ajax-search-lite'), 'value' => 'customfp DESC'),
14
+ array('option' => __('Custom Field ascending', 'ajax-search-lite'), 'value' => 'customfp ASC')
15
+ ),
16
+ 'value' => $sd['orderby_primary']
17
+ ));
18
+ $params[$o->getName()] = $o->getData();
19
+
20
+ $o = new wpdreamsText("orderby_primary_cf", __('custom field', 'ajax-search-lite'), $sd['orderby_primary_cf']);
21
+ $params[$o->getName()] = $o->getData();
22
+
23
+ $o = new wpdreamsCustomSelect("orderby_primary_cf_type", __('type', 'ajax-search-lite'),
24
+ array(
25
+ 'selects' => array(
26
+ array('option' => __('numeric', 'ajax-search-lite'), 'value' => 'numeric'),
27
+ array('option' => __('string or date', 'ajax-search-lite'), 'value' => 'string')
28
+ ),
29
+ 'value' => $sd['orderby_primary_cf_type']
30
+ ));
31
+ $params[$o->getName()] = $o->getData();
32
+ ?>
33
  </div>
34
+ <div class="item wd-secondary-order item-flex-nogrow item-flex-wrap"><?php
35
+ $o = new wpdreamsCustomSelect("orderby_secondary", __('Secondary ordering', 'ajax-search-lite'),
36
+ array(
37
+ 'selects' => array(
38
+ array('option' => __('Relevance', 'ajax-search-lite'), 'value' => 'relevance DESC'),
39
+ array('option' => __('Title descending', 'ajax-search-lite'), 'value' => 'post_title DESC'),
40
+ array('option' => __('Title ascending', 'ajax-search-lite'), 'value' => 'post_title ASC'),
41
+ array('option' => __('Date descending', 'ajax-search-lite'), 'value' => 'post_date DESC'),
42
+ array('option' => __('Date ascending', 'ajax-search-lite'), 'value' => 'post_date ASC'),
43
+ array('option' => __('Random', 'ajax-search-lite'), 'value' => 'RAND()'),
44
+ array('option' => __('Custom Field descending', 'ajax-search-lite'), 'value' => 'customfs DESC'),
45
+ array('option' => __('Custom Field ascending', 'ajax-search-lite'), 'value' => 'customfs ASC')
46
+ ),
47
+ 'value' => $sd['orderby_secondary']
48
+ ));
49
+ $params[$o->getName()] = $o->getData();
50
+
51
+ $o = new wpdreamsText("orderby_secondary_cf", __('custom field', 'ajax-search-lite'), $sd['orderby_secondary_cf']);
52
+ $params[$o->getName()] = $o->getData();
53
+
54
+ $o = new wpdreamsCustomSelect("orderby_secondary_cf_type", __('type', 'ajax-search-lite'),
55
+ array(
56
+ 'selects' => array(
57
+ array('option' => __('numeric', 'ajax-search-lite'), 'value' => 'numeric'),
58
+ array('option' => __('string or date', 'ajax-search-lite'), 'value' => 'string')
59
+ ),
60
+ 'value' => $sd['orderby_secondary_cf_type']
61
+ ));
62
+ $params[$o->getName()] = $o->getData();
63
+ ?>
64
+ <div class="descMsg item-flex-grow item-flex-100">
65
+ <?php echo __('If two elements match the primary ordering criteria, the <b>Secondary ordering</b> is used.', 'ajax-search-lite'); ?>
66
+ </div>
67
  </div>
backend/tabs/instance/general_options.php CHANGED
@@ -7,25 +7,40 @@
7
  <div class='tabscontent'>
8
  <div tabid="101">
9
  <fieldset>
10
- <legend>Sources & Basics</legend>
 
 
 
 
 
 
11
  <?php include(ASL_PATH."backend/tabs/instance/general/sources.php"); ?>
12
  </fieldset>
13
  </div>
14
  <div tabid="102">
15
- <fieldset>
16
- <legend>Behavior</legend>
17
- <?php include(ASL_PATH."backend/tabs/instance/general/behavior.php"); ?>
18
- </fieldset>
19
  </div>
20
  <div tabid="104">
21
  <fieldset>
22
- <legend>Ordering</legend>
 
 
 
 
 
 
23
  <?php include(ASL_PATH."backend/tabs/instance/general/ordering.php"); ?>
24
  </fieldset>
25
  </div>
26
  <div tabid="103">
27
  <fieldset>
28
- <legend>Autocomplete & Suggestions</legend>
 
 
 
 
 
 
29
  <?php include(ASL_PATH."backend/tabs/instance/general/autocomplete.php"); ?>
30
  </fieldset>
31
  </div>
7
  <div class='tabscontent'>
8
  <div tabid="101">
9
  <fieldset>
10
+ <legend><?php _e("Sources & Basics", "ajax-search-lite"); ?>
11
+ <span class="asl_legend_docs">
12
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/general-options/sources-and-basics"><span class="fa fa-book"></span>
13
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
14
+ </a>
15
+ </span>
16
+ </legend>
17
  <?php include(ASL_PATH."backend/tabs/instance/general/sources.php"); ?>
18
  </fieldset>
19
  </div>
20
  <div tabid="102">
21
+ <?php include(ASL_PATH."backend/tabs/instance/general/behavior.php"); ?>
 
 
 
22
  </div>
23
  <div tabid="104">
24
  <fieldset>
25
+ <legend><?php _e("Ordering", "ajax-search-lite"); ?>
26
+ <span class="asl_legend_docs">
27
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/general-options/ordering"><span class="fa fa-book"></span>
28
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
29
+ </a>
30
+ </span>
31
+ </legend>
32
  <?php include(ASL_PATH."backend/tabs/instance/general/ordering.php"); ?>
33
  </fieldset>
34
  </div>
35
  <div tabid="103">
36
  <fieldset>
37
+ <legend><?php _e("Autocomplete & Suggestions", "ajax-search-lite"); ?>
38
+ <span class="asl_legend_docs">
39
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/general-options/autocomplete-and-keyword-suggestions"><span class="fa fa-book"></span>
40
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
41
+ </a>
42
+ </span>
43
+ </legend>
44
  <?php include(ASL_PATH."backend/tabs/instance/general/autocomplete.php"); ?>
45
  </fieldset>
46
  </div>
backend/tabs/instance/image_options.php CHANGED
@@ -1,100 +1,97 @@
1
  <div class="item">
2
  <?php
3
- $option_name = "show_images";
4
- $option_desc = __("Show images in results?", "ajax-search-lite");
5
- $o = new wpdreamsYesNo($option_name, $option_desc,
6
- $sd[$option_name]);
7
  $params[$o->getName()] = $o->getData();
8
  ?>
9
  </div>
10
- <div class="item">
11
  <?php
12
- $option_name = "image_width";
13
- $option_desc = __("Image width", "ajax-search-lite");
14
- $o = new wpdreamsTextSmall($option_name, $option_desc,
15
- $sd[$option_name]);
 
 
16
  $params[$o->getName()] = $o->getData();
 
 
 
 
 
 
 
 
 
17
  ?>
18
  </div>
19
  <div class="item">
20
- <?php
21
- $option_name = "image_height";
22
- $option_desc = __("Image height", "ajax-search-lite");
23
- $o = new wpdreamsTextSmall($option_name, $option_desc,
24
- $sd[$option_name]);
25
- $params[$o->getName()] = $o->getData();
26
- ?>
 
 
27
  </div>
28
  <fieldset>
29
  <legend>Image source settings</legend>
30
  <div class="item">
31
  <?php
32
- $option_name = "image_source1";
33
- $option_desc = __("Primary image source", "ajax-search-lite");
34
- $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
35
  'selects'=>$sd['image_sources'],
36
- 'value'=>$sd[$option_name]
37
  ));
38
  $params[$o->getName()] = $o->getData();
39
  ?>
40
  </div>
41
  <div class="item">
42
  <?php
43
- $option_name = "image_source2";
44
- $option_desc = __("Alternative image source 1", "ajax-search-lite");
45
- $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
46
  'selects'=>$sd['image_sources'],
47
- 'value'=>$sd[$option_name]
48
  ));
49
  $params[$o->getName()] = $o->getData();
50
  ?>
51
  </div>
52
  <div class="item">
53
  <?php
54
- $option_name = "image_source3";
55
- $option_desc = __("Alternative image source 2", "ajax-search-lite");
56
- $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
57
  'selects'=>$sd['image_sources'],
58
- 'value'=>$sd[$option_name]
59
  ));
60
  $params[$o->getName()] = $o->getData();
61
  ?>
62
  </div>
63
  <div class="item">
64
  <?php
65
- $option_name = "image_source4";
66
- $option_desc = __("Alternative image source 3", "ajax-search-lite");
67
- $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
68
  'selects'=>$sd['image_sources'],
69
- 'value'=>$sd[$option_name]
70
  ));
71
  $params[$o->getName()] = $o->getData();
72
  ?>
73
  </div>
74
  <div class="item">
75
  <?php
76
- $option_name = "image_source5";
77
- $option_desc = __("Alternative image source 4", "ajax-search-lite");
78
- $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
79
  'selects'=>$sd['image_sources'],
80
- 'value'=>$sd[$option_name]
81
  ));
82
  $params[$o->getName()] = $o->getData();
83
  ?>
84
  </div>
85
  <div class="item">
86
  <?php
87
- $option_name = "image_default";
88
- $option_desc = __("Default image url", "ajax-search-lite");
89
- $o = new wpdreamsUpload($option_name, $option_desc,
90
- $sd[$option_name]);
91
  $params[$o->getName()] = $o->getData();
92
  ?>
93
  </div>
94
  <div class="item">
95
  <?php
96
- $option_name = "image_source_featured";
97
- $option_desc = "Featured image size source";
98
  $_feat_image_sizes = get_intermediate_image_sizes();
99
  $feat_image_sizes = array(
100
  array(
@@ -107,19 +104,17 @@
107
  "option" => $v,
108
  "value" => $v
109
  );
110
- $o = new wpdreamsCustomSelect($option_name, $option_desc, array(
111
  'selects'=>$feat_image_sizes,
112
- 'value'=>$sd[$option_name]
113
  ));
114
  $params[$o->getName()] = $o->getData();
115
  ?>
116
  </div>
117
  <div class="item">
118
  <?php
119
- $option_name = "image_custom_field";
120
- $option_desc = __("Custom field containing the image", "ajax-search-lite");
121
- $o = new wpdreamsText($option_name, $option_desc,
122
- $sd[$option_name]);
123
  $params[$o->getName()] = $o->getData();
124
  ?>
125
  </div>
@@ -130,6 +125,14 @@
130
  $params[$o->getName()] = $o->getData();
131
  ?>
132
  </div>
 
 
 
 
 
 
 
 
133
  </fieldset>
134
  <div class="item">
135
  <input type="hidden" name='asl_submit' value=1 />
1
  <div class="item">
2
  <?php
3
+ $o = new wpdreamsYesNo('show_images', __("Show images in results?", "ajax-search-lite"),
4
+ $sd['show_images']);
 
 
5
  $params[$o->getName()] = $o->getData();
6
  ?>
7
  </div>
8
+ <div class="item item-flex-nogrow item-flex-wrap">
9
  <?php
10
+ $o = new wpdreamsTextSmall('image_width', __("Image width (px)", "ajax-search-lite"),
11
+ $sd['image_width']);
12
+ $params[$o->getName()] = $o->getData();
13
+
14
+ $o = new wpdreamsTextSmall('image_height', __("height (px)", "ajax-search-lite"),
15
+ $sd['image_height']);
16
  $params[$o->getName()] = $o->getData();
17
+
18
+ $o = new wpdreamsCustomSelect('image_display_mode', __('display mode', 'ajax-search-lite'), array(
19
+ 'selects'=>array(
20
+ array("option" => "Cover the space", "value" => "cover"),
21
+ array("option" => "Contain the image", "value" => "contain")
22
+ ),
23
+ 'value'=>$sd['image_display_mode']
24
+ ));
25
+ $params[$o->getName()] = $o->getData();
26
  ?>
27
  </div>
28
  <div class="item">
29
+ <?php
30
+ $o = new wpdreamsYesNo('image_apply_content_filter', __('Execute shortcodes when looking for images in content?', 'ajax-search-lite'),
31
+ $sd['image_apply_content_filter']);
32
+ $params[$o->getName()] = $o->getData();
33
+ ?>
34
+ <p class="descMsg">
35
+ <?php echo __('Will execute shortcodes and apply the content filter before looking for images in the post content.', 'ajax-search-lite'); ?><br>
36
+ <?php echo __('If you have <strong>missing images in results</strong>, try turning ON this option. <strong>Can cause lower performance!</strong>', 'ajax-search-lite'); ?>
37
+ </p>
38
  </div>
39
  <fieldset>
40
  <legend>Image source settings</legend>
41
  <div class="item">
42
  <?php
43
+ $o = new wpdreamsCustomSelect('image_source1', __("Primary image source", "ajax-search-lite"), array(
 
 
44
  'selects'=>$sd['image_sources'],
45
+ 'value'=>$sd['image_source1']
46
  ));
47
  $params[$o->getName()] = $o->getData();
48
  ?>
49
  </div>
50
  <div class="item">
51
  <?php
52
+ $o = new wpdreamsCustomSelect('image_source2', __("Alternative image source 1", "ajax-search-lite"), array(
 
 
53
  'selects'=>$sd['image_sources'],
54
+ 'value'=>$sd['image_source2']
55
  ));
56
  $params[$o->getName()] = $o->getData();
57
  ?>
58
  </div>
59
  <div class="item">
60
  <?php
61
+ $o = new wpdreamsCustomSelect('image_source3', __("Alternative image source 2", "ajax-search-lite"), array(
 
 
62
  'selects'=>$sd['image_sources'],
63
+ 'value'=>$sd['image_source3']
64
  ));
65
  $params[$o->getName()] = $o->getData();
66
  ?>
67
  </div>
68
  <div class="item">
69
  <?php
70
+ $o = new wpdreamsCustomSelect('image_source4', __("Alternative image source 3", "ajax-search-lite"), array(
 
 
71
  'selects'=>$sd['image_sources'],
72
+ 'value'=>$sd['image_source4']
73
  ));
74
  $params[$o->getName()] = $o->getData();
75
  ?>
76
  </div>
77
  <div class="item">
78
  <?php
79
+ $o = new wpdreamsCustomSelect('image_source5', __("Alternative image source 4", "ajax-search-lite"), array(
 
 
80
  'selects'=>$sd['image_sources'],
81
+ 'value'=>$sd['image_source5']
82
  ));
83
  $params[$o->getName()] = $o->getData();
84
  ?>
85
  </div>
86
  <div class="item">
87
  <?php
88
+ $o = new wpdreamsUpload('image_default', __("Default image url", "ajax-search-lite"),
89
+ $sd['image_default']);
 
 
90
  $params[$o->getName()] = $o->getData();
91
  ?>
92
  </div>
93
  <div class="item">
94
  <?php
 
 
95
  $_feat_image_sizes = get_intermediate_image_sizes();
96
  $feat_image_sizes = array(
97
  array(
104
  "option" => $v,
105
  "value" => $v
106
  );
107
+ $o = new wpdreamsCustomSelect('image_source_featured', __("Featured image size source", "ajax-search-lite"), array(
108
  'selects'=>$feat_image_sizes,
109
+ 'value'=>$sd['image_source_featured']
110
  ));
111
  $params[$o->getName()] = $o->getData();
112
  ?>
113
  </div>
114
  <div class="item">
115
  <?php
116
+ $o = new wpdreamsText('image_custom_field', __("Custom field containing the image", "ajax-search-lite"),
117
+ $sd['image_custom_field']);
 
 
118
  $params[$o->getName()] = $o->getData();
119
  ?>
120
  </div>
125
  $params[$o->getName()] = $o->getData();
126
  ?>
127
  </div>
128
+ <div class="item">
129
+ <?php
130
+ $o = new wd_TextareaExpandable('image_parser_exclude_filenames', 'Exclude images by file names (comma separated)',
131
+ $sd['image_parser_exclude_filenames']);
132
+ $params[$o->getName()] = $o->getData();
133
+ ?>
134
+ <div class="descMsg"><?php echo __('If any part of the image filename or path contains any of the above strings, it is excluded.', 'ajax-search-lite') ?></div>
135
+ </div>
136
  </fieldset>
137
  <div class="item">
138
  <input type="hidden" name='asl_submit' value=1 />
backend/tabs/instance/layout/box_layout.php CHANGED
@@ -10,104 +10,177 @@ $themes = array(
10
  array('option'=>'Underline White', 'value'=>'underline')
11
  );
12
  ?>
13
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
14
- <div class="asl_theme"></div>
15
- <?php
16
- $o = new wpdreamsCustomSelect("theme", __("Theme", "ajax-search-lite"), array(
17
- 'selects'=>$themes,
18
- 'value'=>$sd['theme']
19
- ));
20
- $params[$o->getName()] = $o->getData();
21
- ?>
22
- </div>
23
- <div class="item">
24
- <?php
25
- $o = new wpdreamsText("defaultsearchtext", __("Placeholder text", "ajax-search-lite"), $sd['defaultsearchtext']);
26
- $params[$o->getName()] = $o->getData();
27
- ?>
28
- </div>
29
- <div class="item item-flex-nogrow item-flex-wrap wpd-isotopic-width">
30
- <?php
31
- $o = new wpdreamsTextSmall("box_width", __('Search box width', 'ajax-search-pro'), array(
32
- 'icon' => 'desktop',
33
- 'value' => $sd['box_width']
34
- ));
35
- $params[$o->getName()] = $o->getData();
36
- $o = new wpdreamsTextSmall("box_width_tablet", '', array(
37
- 'icon' => 'tablet',
38
- 'value' => $sd['box_width_tablet']
39
- ));
40
- $params[$o->getName()] = $o->getData();
41
- $o = new wpdreamsTextSmall("box_width_phone", '', array(
42
- 'icon' => 'phone',
43
- 'value' => $sd['box_width_phone']
44
- ));
45
- $params[$o->getName()] = $o->getData();
46
- ?>
47
- <div class="descMsg item-flex-grow item-flex-100">
48
- <?php echo sprintf(
49
- __('Use with <a href="%s" target="_blank">CSS units</a> (like %s or %s or %s ..) Default: <strong>%s</strong>', 'ajax-search-lite'),
50
- 'https://www.w3schools.com/cssref/css_units.asp', '10px', '50%', 'auto', '100%'
51
- ); ?>
52
- </div>
53
- </div>
54
- <div class="item">
55
- <?php
56
- $option_name = "box_margin";
57
- $option_desc = __("Search box margin", "ajax-search-lite");
58
- $option_expl = __("Include the unit as well, example: 10px or 1em or 90%", "ajax-search-lite");
59
- $o = new wpdreamsFour($option_name, $option_desc,
60
- array(
61
- "desc" => $option_expl,
62
- "value" => $sd[$option_name]
63
- )
64
- );
65
- $params[$o->getName()] = $o->getData();
66
- ?>
67
- </div>
68
- <div class="item">
69
- <?php
70
- $o = new wpdreamsText("box_font", __("Search plugin Font Family", "ajax-search-lite"), $sd['box_font']);
71
- $params[$o->getName()] = $o->getData();
72
- ?>
73
- <p class="descMsg"><?php echo __("The Font Family used within the plugin. Default: Open Sans", "ajax-search-lite"); ?><br>
74
- <?php echo __("Entering multiple font family names like <strong>Helvetica, Sans-serif</strong> or <strong>inherit</strong> are also supported.", "ajax-search-lite"); ?></p>
75
- </div>
76
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
77
- <?php
78
- $o = new wpdreamsYesNo("override_bg", __("Override background color?", "ajax-search-lite"),
79
- $sd['override_bg']);
80
- $params[$o->getName()] = $o->getData();
 
 
 
 
 
 
 
 
 
81
 
82
- $o = new wpdreamsColorPicker("override_bg_color", __("color:", "ajax-search-lite"),
83
- $sd['override_bg_color']);
84
- $params[$o->getName()] = $o->getData();
85
- ?>
86
- </div>
87
- <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
88
- <?php
89
- $o = new wpdreamsYesNo("override_icon", __("Override magnifier & icon colors?", "ajax-search-lite"),
90
- $sd['override_icon']);
91
- $params[$o->getName()] = $o->getData();
92
 
93
- $o = new wpdreamsColorPicker("override_icon_bg_color", __("icon background colors", "ajax-search-lite"),
94
- $sd['override_icon_bg_color']);
95
- $params[$o->getName()] = $o->getData();
96
 
97
- $o = new wpdreamsColorPicker("override_icon_color", __("icon colors", "ajax-search-lite"),
98
- $sd['override_icon_color']);
99
- $params[$o->getName()] = $o->getData();
100
- ?>
101
- </div>
102
- <div class="item">
103
- <div style="margin: 8px 17px 16px 0;">
104
- <?php
105
- $o = new wpdreamsYesNo("override_border", __("Override search box border?", "ajax-search-lite"),
106
- $sd['override_border']);
107
- $params[$o->getName()] = $o->getData();
108
- ?></div><?php
109
- $o = new wpdreamsBorder("override_border_style", __("Border style", "ajax-search-lite"),
110
- $sd['override_border_style']);
111
- $params[$o->getName()] = $o->getData();
112
- ?>
113
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  array('option'=>'Underline White', 'value'=>'underline')
11
  );
12
  ?>
13
+ <fieldset>
14
+ <legend>
15
+ <?php _e("Theme & Input & Colors", "ajax-search-lite"); ?>
16
+ <span class="asl_legend_docs">
17
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/layout-options/theme-and-customization"><span class="fa fa-book"></span>
18
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
19
+ </a>
20
+ </span>
21
+ </legend>
22
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
23
+ <div class="asl_theme"></div>
24
+ <?php
25
+ $o = new wpdreamsCustomSelect("theme", __("Theme", "ajax-search-lite"), array(
26
+ 'selects'=>$themes,
27
+ 'value'=>$sd['theme']
28
+ ));
29
+ $params[$o->getName()] = $o->getData();
30
+ ?>
31
+ </div>
32
+ <div class="item">
33
+ <?php
34
+ $o = new wpdreamsText("defaultsearchtext", __("Placeholder text", "ajax-search-lite"), $sd['defaultsearchtext']);
35
+ $params[$o->getName()] = $o->getData();
36
+ ?>
37
+ </div>
38
+ <div class="item item-flex-nogrow item-flex-wrap wpd-isotopic-width">
39
+ <?php
40
+ $o = new wpdreamsTextSmall("box_width", __('Search box width', 'ajax-search-lite'), array(
41
+ 'icon' => 'desktop',
42
+ 'value' => $sd['box_width']
43
+ ));
44
+ $params[$o->getName()] = $o->getData();
45
+ $o = new wpdreamsTextSmall("box_width_tablet", '', array(
46
+ 'icon' => 'tablet',
47
+ 'value' => $sd['box_width_tablet']
48
+ ));
49
+ $params[$o->getName()] = $o->getData();
50
+ $o = new wpdreamsTextSmall("box_width_phone", '', array(
51
+ 'icon' => 'phone',
52
+ 'value' => $sd['box_width_phone']
53
+ ));
54
+ $params[$o->getName()] = $o->getData();
55
+ ?>
56
+ <div class="descMsg item-flex-grow item-flex-100">
57
+ <?php echo sprintf(
58
+ __('Use with <a href="%s" target="_blank">CSS units</a> (like %s or %s or %s ..) Default: <strong>%s</strong>', 'ajax-search-lite'),
59
+ 'https://www.w3schools.com/cssref/css_units.asp', '10px', '50%', 'auto', '100%'
60
+ ); ?>
61
+ </div>
62
+ </div>
63
+ <div class="item">
64
+ <?php
65
+ $option_name = "box_margin";
66
+ $option_desc = __("Search box margin", "ajax-search-lite");
67
+ $option_expl = __("Include the unit as well, example: 10px or 1em or 90%", "ajax-search-lite");
68
+ $o = new wpdreamsFour($option_name, $option_desc,
69
+ array(
70
+ "desc" => $option_expl,
71
+ "value" => $sd[$option_name]
72
+ )
73
+ );
74
+ $params[$o->getName()] = $o->getData();
75
+ ?>
76
+ </div>
77
+ <div class="item">
78
+ <?php
79
+ $o = new wpdreamsText("box_font", __("Search plugin Font Family", "ajax-search-lite"), $sd['box_font']);
80
+ $params[$o->getName()] = $o->getData();
81
+ ?>
82
+ <p class="descMsg"><?php echo __("The Font Family used within the plugin. Default: Open Sans", "ajax-search-lite"); ?><br>
83
+ <?php echo __("Entering multiple font family names like <strong>Helvetica, Sans-serif</strong> or <strong>inherit</strong> are also supported.", "ajax-search-lite"); ?></p>
84
+ </div>
85
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
86
+ <?php
87
+ $o = new wpdreamsYesNo("override_bg", __("Override background color?", "ajax-search-lite"),
88
+ $sd['override_bg']);
89
+ $params[$o->getName()] = $o->getData();
90
 
91
+ $o = new wpdreamsColorPicker("override_bg_color", __("color:", "ajax-search-lite"),
92
+ $sd['override_bg_color']);
93
+ $params[$o->getName()] = $o->getData();
94
+ ?>
95
+ </div>
96
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
97
+ <?php
98
+ $o = new wpdreamsYesNo("override_icon", __("Override magnifier & icon colors?", "ajax-search-lite"),
99
+ $sd['override_icon']);
100
+ $params[$o->getName()] = $o->getData();
101
 
102
+ $o = new wpdreamsColorPicker("override_icon_bg_color", __("icon background colors", "ajax-search-lite"),
103
+ $sd['override_icon_bg_color']);
104
+ $params[$o->getName()] = $o->getData();
105
 
106
+ $o = new wpdreamsColorPicker("override_icon_color", __("icon colors", "ajax-search-lite"),
107
+ $sd['override_icon_color']);
108
+ $params[$o->getName()] = $o->getData();
109
+ ?>
110
+ </div>
111
+ <div class="item">
112
+ <div style="margin: 8px 17px 16px 0;">
113
+ <?php
114
+ $o = new wpdreamsYesNo("override_border", __("Override search box border?", "ajax-search-lite"),
115
+ $sd['override_border']);
116
+ $params[$o->getName()] = $o->getData();
117
+ ?></div><?php
118
+ $o = new wpdreamsBorder("override_border_style", __("Border style", "ajax-search-lite"),
119
+ $sd['override_border_style']);
120
+ $params[$o->getName()] = $o->getData();
121
+ ?>
122
+ </div>
123
+ </fieldset>
124
+ <fieldset>
125
+ <legend><?php _e("Results theme", "ajax-search-lite"); ?></legend>
126
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
127
+ <?php
128
+ $o = new wpdreamsYesNo("results_bg_override", __("Override results container background color?", "ajax-search-lite"),
129
+ $sd['results_bg_override']);
130
+ $params[$o->getName()] = $o->getData();
131
+
132
+ $o = new wpdreamsColorPicker("results_bg_override_color", __("color:", "ajax-search-lite"),
133
+ $sd['results_bg_override_color']);
134
+ $params[$o->getName()] = $o->getData();
135
+ ?>
136
+ </div>
137
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
138
+ <?php
139
+ $o = new wpdreamsYesNo("results_item_bg_override", __("Override results background color?", "ajax-search-lite"),
140
+ $sd['results_item_bg_override']);
141
+ $params[$o->getName()] = $o->getData();
142
+
143
+ $o = new wpdreamsColorPicker("results_item_bg_override_color", __("color:", "ajax-search-lite"),
144
+ $sd['results_item_bg_override_color']);
145
+ $params[$o->getName()] = $o->getData();
146
+ ?>
147
+ </div>
148
+ <div class="item">
149
+ <div style="margin: 8px 17px 16px 0;">
150
+ <?php
151
+ $o = new wpdreamsYesNo("results_override_border", __("Override results box border?", "ajax-search-lite"),
152
+ $sd['results_override_border']);
153
+ $params[$o->getName()] = $o->getData();
154
+ ?></div><?php
155
+ $o = new wpdreamsBorder("results_override_border_style", __("Border style", "ajax-search-lite"),
156
+ $sd['results_override_border_style']);
157
+ $params[$o->getName()] = $o->getData();
158
+ ?>
159
+ </div>
160
+ </fieldset>
161
+ <fieldset>
162
+ <legend><?php _e("Settings theme", "ajax-search-lite"); ?></legend>
163
+ <div class="item item-flex-nogrow" style="flex-wrap: wrap;">
164
+ <?php
165
+ $o = new wpdreamsYesNo("settings_bg_override", __("Override settings container background color?", "ajax-search-lite"),
166
+ $sd['settings_bg_override']);
167
+ $params[$o->getName()] = $o->getData();
168
+
169
+ $o = new wpdreamsColorPicker("settings_bg_override_color", __("color:", "ajax-search-lite"),
170
+ $sd['settings_bg_override_color']);
171
+ $params[$o->getName()] = $o->getData();
172
+ ?>
173
+ </div>
174
+ <div class="item">
175
+ <div style="margin: 8px 17px 16px 0;">
176
+ <?php
177
+ $o = new wpdreamsYesNo("settings_override_border", __("Override settings box border?", "ajax-search-lite"),
178
+ $sd['settings_override_border']);
179
+ $params[$o->getName()] = $o->getData();
180
+ ?></div><?php
181
+ $o = new wpdreamsBorder("settings_override_border_style", __("Border style", "ajax-search-lite"),
182
+ $sd['settings_override_border_style']);
183
+ $params[$o->getName()] = $o->getData();
184
+ ?>
185
+ </div>
186
+ </fieldset>
backend/tabs/instance/layout/keyword_highlight.php CHANGED
@@ -1,21 +1,79 @@
1
- <div class="item">
2
- <?php
3
- $o = new wpdreamsYesNo("kw_highlight", __("Keyword highlighting", "ajax-search-lite"), $sd['kw_highlight']);
4
- $params[$o->getName()] = $o->getData();
5
- ?>
6
- </div>
7
- <div class="item">
8
- <?php
9
- $o = new wpdreamsYesNo("kw_highlight_whole_words", __("Highlight whole words only?", "ajax-search-lite"), $sd['kw_highlight_whole_words']);
10
- $params[$o->getName()] = $o->getData();
11
- ?>
12
- </div>
13
- <div class="item"><?php
14
- $o = new wpdreamsColorPicker("highlight_color", "Highlight text color", $sd['highlight_color']);
15
- $params[$o->getName()] = $o->getData();
16
- ?></div>
17
- <div class="item"><?php
18
- $o = new wpdreamsColorPicker("highlight_bg_color", "Highlight-text background color", $sd['highlight_bg_color']);
19
- $params[$o->getName()] = $o->getData();
20
- ?>
21
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <fieldset>
2
+ <legend>
3
+ <?php echo __('Results text keyword highlighter - Live results list', 'ajax-search-lite'); ?>
4
+ <span class="asl_legend_docs">
5
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/layout-options/keyword-highlighter"><span class="fa fa-book"></span>
6
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
7
+ </a>
8
+ </span>
9
+ </legend>
10
+ <div class="item">
11
+ <?php
12
+ $o = new wpdreamsYesNo("kw_highlight", __("Keyword highlighting", "ajax-search-lite"), $sd['kw_highlight']);
13
+ $params[$o->getName()] = $o->getData();
14
+ ?>
15
+ </div>
16
+ <div class="item">
17
+ <?php
18
+ $o = new wpdreamsYesNo("kw_highlight_whole_words", __("Highlight whole words only?", "ajax-search-lite"), $sd['kw_highlight_whole_words']);
19
+ $params[$o->getName()] = $o->getData();
20
+ ?>
21
+ </div>
22
+ <div class="item"><?php
23
+ $o = new wpdreamsColorPicker("highlight_color", "Highlight text color", $sd['highlight_color']);
24
+ $params[$o->getName()] = $o->getData();
25
+ ?></div>
26
+ <div class="item"><?php
27
+ $o = new wpdreamsColorPicker("highlight_bg_color", "Highlight-text background color", $sd['highlight_bg_color']);
28
+ $params[$o->getName()] = $o->getData();
29
+ ?>
30
+ </div>
31
+ </fieldset>
32
+ <fieldset>
33
+ <legend>
34
+ <?php echo __('Results text keyword highlighter - Single result page', 'ajax-search-lite'); ?>
35
+ <span class="asl_legend_docs">
36
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/layout-options/keyword-highlighter"><span class="fa fa-book"></span>
37
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
38
+ </a>
39
+ </span>
40
+ </legend>
41
+ <div class="errorMsg">
42
+ <?php echo __('<strong>Disclaimer: </strong> This feature is highly experimental, and may not work correctly in all cases.', 'ajax-search-lite'); ?>
43
+ </div>
44
+ <div class="item"><?php
45
+ $o = new wpdreamsYesNo("single_highlight", __('Highlight search text on single result pages?', 'ajax-search-lite'), $sd['single_highlight']);
46
+ $params[$o->getName()] = $o->getData();
47
+ ?></div>
48
+ <div class="item"><?php
49
+ $o = new wpdreamsYesNo("single_highlightwholewords", __('Highlight only whole words?', 'ajax-search-lite'), $sd['single_highlightwholewords']);
50
+ $params[$o->getName()] = $o->getData();
51
+ ?></div>
52
+ <div class="item"><?php
53
+ $o = new wpdreamsColorPicker("single_highlightcolor", __('Highlight text color', 'ajax-search-lite'), $sd['single_highlightcolor']);
54
+ $params[$o->getName()] = $o->getData();
55
+ ?></div>
56
+ <div class="item"><?php
57
+ $o = new wpdreamsColorPicker("single_highlightbgcolor", __('Highlight-text background color', 'ajax-search-lite'), $sd['single_highlightbgcolor']);
58
+ $params[$o->getName()] = $o->getData();
59
+ ?>
60
+ </div>
61
+ <div class="item item-flex-nogrow item-flex-wrap">
62
+ <?php
63
+ $o = new wpdreamsYesNo("single_highlight_scroll", __('Scroll to the first keyword match if possible?', 'ajax-search-lite'), $sd['single_highlight_scroll']);
64
+
65
+ $o = new wpdreamsTextSmall("single_highlight_offset", __('scroll offset (px)', 'ajax-search-lite'), $sd['single_highlight_offset']);
66
+ ?>
67
+ <div class="descMsg item-flex-grow item-flex-100">
68
+ <?php echo __('A negative offset will move the window upwards, a positive downwards. Default: 0', 'ajax-search-lite'); ?>
69
+ </div>
70
+ </div>
71
+ <div class="item"><?php
72
+ $o = new wpdreamsText("single_highlight_selector", __('Result page content jQuery element selector', 'ajax-search-lite'), $sd['single_highlight_selector']);
73
+ $params[$o->getName()] = $o->getData();
74
+ ?>
75
+ <div class="descMsg item-flex-grow item-flex-100">
76
+ <?php echo __('Optional, but very useful - it tells which element contains exactly the result content, so words are highlighted only on the given section of the page.', 'ajax-search-lite'); ?>
77
+ </div>
78
+ </div>
79
+ </fieldset>
backend/tabs/instance/layout/results_layout.php CHANGED
@@ -38,14 +38,6 @@
38
  ); ?>
39
  </div>
40
  </div>
41
- <div class="item">
42
- <?php
43
- $o = new wpdreamsYesNo("description_context", __("Display the description context?", "ajax-search-lite"),
44
- $sd['description_context']);
45
- $params[$o->getName()] = $o->getData();
46
- ?>
47
- <p class="descMsg"><?php __("Will display the description from around the search phrase, not from the beginning.", "ajax-search-lite"); ?></p>
48
- </div>
49
  <div class="item"><?php
50
  $o = new wpdreamsTextSmall("v_res_max_height", __("Result box maximum height", "ajax-search-lite"), $sd['v_res_max_height']);
51
  $params[$o->getName()] = $o->getData();
@@ -88,14 +80,21 @@
88
  $params[$o->getName()] = $o->getData();
89
  ?>
90
  </div>
91
- <div class="item">
92
  <?php
93
  $o = new wpdreamsYesNo("description_context", __("Display the description context?", "ajax-search-lite"), $sd['description_context']);
94
  $params[$o->getName()] = $o->getData();
95
- ?>
96
- <p class="descMsg">
97
- <?php echo __("Will display the description from around the search phrase, not from the beginning.", "ajax-search-lite"); ?>
98
- </p>
 
 
 
 
 
 
 
99
  </div>
100
  <div class="item">
101
  <?php
38
  ); ?>
39
  </div>
40
  </div>
 
 
 
 
 
 
 
 
41
  <div class="item"><?php
42
  $o = new wpdreamsTextSmall("v_res_max_height", __("Result box maximum height", "ajax-search-lite"), $sd['v_res_max_height']);
43
  $params[$o->getName()] = $o->getData();
80
  $params[$o->getName()] = $o->getData();
81
  ?>
82
  </div>
83
+ <div class="item item-flex-nogrow item-flex-wrap">
84
  <?php
85
  $o = new wpdreamsYesNo("description_context", __("Display the description context?", "ajax-search-lite"), $sd['description_context']);
86
  $params[$o->getName()] = $o->getData();
87
+
88
+ $o = new wpdreamsTextSmall("description_context_depth", __(' ..depth', 'ajax-search-lite'), $sd['description_context_depth']);
89
+ $params[$o->getName()] = $o->getData();
90
+ ?><div>characters.</div>
91
+ <div class='descMsg' style="min-width: 100%;
92
+ flex-wrap: wrap;
93
+ flex-basis: auto;
94
+ flex-grow: 1;
95
+ box-sizing: border-box;">
96
+ <?php echo __('Will display the description from around the search phrase, not from the beginning.', 'ajax-search-lite'); ?>
97
+ </div>
98
  </div>
99
  <div class="item">
100
  <?php
backend/tabs/instance/layout_options.php CHANGED
@@ -1,5 +1,5 @@
1
  <ul id="subtabs" class='tabs'>
2
- <li><a tabid="401" class='subtheme current'><?php _e("Search Box layout", "ajax-search-lite"); ?></a></li>
3
  <li><a tabid="402" class='subtheme'><?php _e("Results layout", "ajax-search-lite"); ?></a></li>
4
  <li><a tabid="403" class='subtheme'><?php _e("Results Behaviour", "ajax-search-lite"); ?></a></li>
5
  <li><a tabid="404" class='subtheme'><?php _e("Keyword Highlighting", "ajax-search-lite"); ?></a></li>
@@ -7,28 +7,34 @@
7
  </ul>
8
  <div class='tabscontent'>
9
  <div tabid="401">
10
- <fieldset>
11
- <legend><?php _e("Search Box layout", "ajax-search-lite"); ?></legend>
12
- <?php include(ASL_PATH."backend/tabs/instance/layout/box_layout.php"); ?>
13
- </fieldset>
14
  </div>
15
  <div tabid="402">
16
  <fieldset>
17
- <legend><?php _e("Results layout", "ajax-search-lite"); ?></legend>
 
 
 
 
 
 
18
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_layout.php"); ?>
19
  </fieldset>
20
  </div>
21
  <div tabid="403">
22
  <fieldset>
23
- <legend><?php _e("Results Behaviour", "ajax-search-lite"); ?></legend>
 
 
 
 
 
 
24
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_behaviour.php"); ?>
25
  </fieldset>
26
  </div>
27
  <div tabid="404">
28
- <fieldset>
29
- <legend><?php _e("Keyword Highlighting", "ajax-search-lite"); ?></legend>
30
- <?php include(ASL_PATH."backend/tabs/instance/layout/keyword_highlight.php"); ?>
31
- </fieldset>
32
  </div>
33
  <div tabid="405">
34
  <fieldset>
1
  <ul id="subtabs" class='tabs'>
2
+ <li><a tabid="401" class='subtheme current'><?php _e("Search Box layout & Theme", "ajax-search-lite"); ?></a></li>
3
  <li><a tabid="402" class='subtheme'><?php _e("Results layout", "ajax-search-lite"); ?></a></li>
4
  <li><a tabid="403" class='subtheme'><?php _e("Results Behaviour", "ajax-search-lite"); ?></a></li>
5
  <li><a tabid="404" class='subtheme'><?php _e("Keyword Highlighting", "ajax-search-lite"); ?></a></li>
7
  </ul>
8
  <div class='tabscontent'>
9
  <div tabid="401">
10
+ <?php include(ASL_PATH."backend/tabs/instance/layout/box_layout.php"); ?>
 
 
 
11
  </div>
12
  <div tabid="402">
13
  <fieldset>
14
+ <legend><?php _e("Results layout", "ajax-search-lite"); ?>
15
+ <span class="asl_legend_docs">
16
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/layout-options/results-layout-and-fields-shown"><span class="fa fa-book"></span>
17
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
18
+ </a>
19
+ </span>
20
+ </legend>
21
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_layout.php"); ?>
22
  </fieldset>
23
  </div>
24
  <div tabid="403">
25
  <fieldset>
26
+ <legend><?php _e("Results Behaviour", "ajax-search-lite"); ?>
27
+ <span class="asl_legend_docs">
28
+ <a target="_blank" href="https://documentation.ajaxsearchlite.com/layout-options/results-box-behavior"><span class="fa fa-book"></span>
29
+ <?php echo __('Documentation', 'ajax-search-lite'); ?>
30
+ </a>
31
+ </span>
32
+ </legend>
33
  <?php include(ASL_PATH."backend/tabs/instance/layout/results_behaviour.php"); ?>
34
  </fieldset>
35
  </div>
36
  <div tabid="404">
37
+ <?php include(ASL_PATH."backend/tabs/instance/layout/keyword_highlight.php"); ?>
 
 
 
38
  </div>
39
  <div tabid="405">
40
  <fieldset>
css/fonts/icons2.svg CHANGED
@@ -3,7 +3,7 @@
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
  <metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
5
  <defs>
6
- <font id="icons" horiz-adv-x="1000" >
7
  <font-face font-family="icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
  <missing-glyph horiz-adv-x="1000" />
9
  <glyph glyph-name="ok" unicode="&#xe800;" d="M352-10l-334 333 158 160 176-174 400 401 159-160z" horiz-adv-x="928" />
3
  <svg xmlns="http://www.w3.org/2000/svg">
4
  <metadata>Copyright (C) 2016 by original authors @ fontello.com</metadata>
5
  <defs>
6
+ <font horiz-adv-x="1000" >
7
  <font-face font-family="icons" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
  <missing-glyph horiz-adv-x="1000" />
9
  <glyph glyph-name="ok" unicode="&#xe800;" d="M352-10l-334 333 158 160 176-174 400 401 159-160z" horiz-adv-x="928" />
css/style.basic.css CHANGED
@@ -1 +1 @@
1
- @keyframes aslAnFadeInDrop{0%{opacity:0;transform:translate(0,-50px);}100%{opacity:1;transform:translate(0,0);}}@-webkit-keyframes aslAnFadeInDrop{0%{opacity:0;transform:translate(0,-50px);-webkit-transform:translate(0,-50px);}100%{opacity:1;transform:translate(0,0);-webkit-transform:translate(0,0);}}@keyframes aslAnFadeOutDrop{0%{opacity:1;transform:translate(0,0);-webkit-transform:translate(0,0);}100%{opacity:0;transform:translate(0,-50px);-webkit-transform:translate(0,-50px);}}@-webkit-keyframes aslAnFadeOutDrop{0%{opacity:1;transform:translate(0,0);-webkit-transform:translate(0,0);}100%{opacity:0;transform:translate(0,-50px);-webkit-transform:translate(0,-50px);}}.hiddend{display:none !important;}div.asl_w.asl_an_fadeInDrop,div.asl_w.asl_an_fadeOutDrop{-webkit-animation-duration:100ms;animation-duration:100ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;}div.asl_w.asl_an_fadeInDrop{animation-name:aslAnFadeInDrop;-webkit-animation-name:aslAnFadeInDrop;}div.asl_w.asl_an_fadeOutDrop{animation-name:aslAnFadeOutDrop;-webkit-animation-name:aslAnFadeOutDrop;}div.asl_w.asl_main_container{transition:width 130ms linear;-webkit-transition:width 130ms linear;}div.asl_w,div.asl_w *,div.asl_r,div.asl_r *,div.asl_s,div.asl_s *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;-ms-box-sizing:content-box;-o-box-sizing:content-box;box-sizing:content-box;padding:0;margin:0;border:0;border-radius:0;text-transform:none;text-shadow:none;box-shadow:none;text-decoration:none;text-align:left;letter-spacing:normal;}div.asl_r,div.asl_r *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}div.asl_m .proinput input::-ms-clear{display:none !important;width:0 !important;height:0 !important;}div.asl_m .proinput input::-ms-reveal{display:none !important;width:0 !important;height:0 !important;}div.asl_m input[type="search"]{-webkit-appearance:textfield !important;}div.asl_m input[type="search"]::-webkit-search-decoration,div.asl_m input[type="search"]::-webkit-search-cancel-button,div.asl_m input[type="search"]::-webkit-search-results-button,div.asl_m input[type="search"]::-webkit-search-results-decoration{display:none;}.clear{clear:both;}.hiddend{display:none;}div.asl_m textarea:focus,div.asl_m input:focus{outline:none;}div.asl_m{width:100%;height:auto;border-radius:0;background:rgba(255,255,255,0);overflow:hidden;position:relative;z-index:200;}div.asl_m .probox{width:auto;border-radius:5px;background:#fff;overflow:hidden;border:1px solid #fff;box-shadow:1px 0 3px #ccc inset;display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;}div.asl_m .probox .proinput{width:auto;height:100%;margin:0 0 0 10px;padding:0 5px;float:left;box-shadow:none;position:relative;flex:1 1 auto;-webkit-flex:1 1 auto;order:5;-webkit-order:5;}div.asl_m .probox .proinput input:before,div.asl_m .probox .proinput input:after,div.asl_m .probox .proinput form:before,div.asl_m .probox .proinput form:after{display:none;}div.asl_m .probox .proinput input{height:28px;border:0;background:transparent;width:100%;box-shadow:none;margin:-1px;padding:0;left:0;line-height:normal !important;display:block;}div.asl_m .probox .proinput input::-webkit-input-placeholder{opacity:.85;}div.asl_m .probox .proinput input::-moz-placeholder{opacity:.85;}div.asl_m .probox .proinput input:-ms-input-placeholder{opacity:.85;}div.asl_m .probox .proinput input:-moz-placeholder{opacity:.85;}div.asl_m .proinput input.orig{padding:0 !important;margin:0 !important;background:transparent !important;border:none !important;background-color:transparent !important;box-shadow:none !important;z-index:10;position:relative;}div.asl_m .proinput input.autocomplete{padding:0 !important;margin:0;background:transparent !important;border:none !important;background-color:transparent !important;box-shadow:none !important;opacity:.2;}div.asl_m .probox .proinput input.autocomplete{border:0;background:transparent;width:100%;box-shadow:none;margin:0;margin-top:-28px !important;padding:0;left:0;position:relative;z-index:9;}div.asl_m .probox .proinput.iepaddingfix{padding-top:0;}div.asl_m .probox .proinput .loading{width:32px;background:#000;height:100%;box-shadow:none;}div.asl_m .probox .proloading,div.asl_m .probox .proclose,div.asl_m .probox .promagnifier,div.asl_m .probox .prosettings{width:20px;height:20px;background:none;background-size:20px 20px;float:right;box-shadow:none;margin:0;padding:0;text-align:center;flex:0 0 auto;-webkit-flex:0 0 auto;z-index:100;}div.asl_m .probox .promagnifier{order:10;-webkit-order:10;}div.asl_m .probox .prosettings{order:1;-webkit-order:1;}div.asl_m .probox .proloading,div.asl_m .probox .proclose{background-position:center center;display:none;background-size:auto;background-repeat:no-repeat;background-color:transparent;order:6;-webkit-order:6;}div.asl_m .probox .proclose{position:relative;cursor:pointer;}div.asl_m .probox .promagnifier .innericon,div.asl_m .probox .prosettings .innericon,div.asl_m .probox .proclose .innericon{background-size:20px 20px;background-position:center center;background-repeat:no-repeat;background-color:transparent;width:100%;height:100%;text-align:center;overflow:hidden;}div.asl_m .probox .promagnifier .innericon svg,div.asl_m .probox .prosettings .innericon svg,div.asl_m .probox .proloading svg{height:100%;width:22px;vertical-align:baseline;display:inline-block;}div.asl_m .probox .proloading{padding:2px;box-sizing:border-box;}div.asl_m .probox div.asl_loader,div.asl_m .probox div.asl_loader *{box-sizing:border-box !important;margin:0;padding:0;box-shadow:none;}div.asl_m .probox div.asl_loader{box-sizing:border-box;display:flex;flex:0 1 auto;flex-direction:column;flex-grow:0;flex-shrink:0;flex-basis:28px;max-width:100%;max-height:100%;width:100%;height:100%;align-items:center;justify-content:center;}div.asl_m .probox div.asl_loader-inner{width:100%;margin:0 auto;text-align:center;height:100%;}@-webkit-keyframes rotate-simple{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes rotate-simple{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}}div.asl_m .probox div.asl_simple-circle{margin:0;height:100%;width:100%;animation:rotate-simple .8s infinite linear;-webkit-animation:rotate-simple .8s infinite linear;border:4px solid #fff;border-right-color:transparent !important;border-radius:50%;box-sizing:border-box;}div.asl_m .probox .proclose svg{background:#333;border-radius:50%;position:absolute;top:50%;width:20px;height:20px;margin-top:-10px;left:50%;margin-left:-10px;fill:#fefefe;padding:4px;box-sizing:border-box;box-shadow:0 0 0 2px rgba(255,255,255,.9);}div.asl_r *{text-decoration:none;text-shadow:none;}div.asl_r .results .asl_nores{overflow:hidden;width:auto;height:100%;line-height:initial;text-align:center;margin:0;background:#fff;padding:10px 3px;color:#222;}div.asl_r.horizontal{padding:2px 0 10px;}div.asl_r.horizontal .results .nores{background:transparent;}div.asl_r .results{overflow:hidden;width:auto;height:0;margin:0;padding:0;}div.asl_r.horizontal .results{height:auto;width:auto;}div.asl_r .results .item{overflow:hidden;width:auto;margin:0;padding:3px;position:relative;background:#f4f4f4;border-left:1px solid rgba(255,255,255,.6);border-right:1px solid rgba(255,255,255,.4);animation-delay:0s;animation-duration:1s;animation-fill-mode:both;animation-timing-function:ease;backface-visibility:hidden;-webkit-animation-delay:0s;-webkit-animation-duration:1s;-webkit-animation-fill-mode:both;-webkit-animation-timing-function:ease;-webkit-backface-visibility:hidden;}div.asl_r.vertical .results .item:first-child{border-radius:3px 3px 0 0;}div.asl_r.vertical .results .item:last-child{border-radius:0 0 3px 3px;margin-bottom:0;}div.asl_r.vertical .results .item:last-child:after{height:0;margin:0;width:0;}div.asl_r .results .item .asl_image{overflow:hidden;background:transparent;margin:2px 8px 0 0;padding:0;float:left;background-position:center;background-size:cover;}div.asl_r .results .item .asl_image img{width:100%;height:100%;}div.asl_r .results .item .asl_content{overflow:hidden;height:auto;background:transparent;margin:0;padding:3px 3px 5px 3px;}div.asl_r .results .item .asl_content h3{margin:0;padding:0;display:inline;line-height:inherit;}div.asl_r .results .item .asl_content .asl_desc{margin-top:4px;font-size:12px;line-height:18px;}div.asl_r .results .item div.etc{margin-top:4px;}div.asl_r .results a span.overlap{position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;}div.asl_r p.showmore{text-align:center;padding:0;margin:0;font-weight:normal;font-family:Open Sans;color:#055e94;font-size:12px;line-height:30px;text-shadow:0 0 0 rgba(255,255,255,0);background-color:#fff;margin-top:3px;cursor:pointer;}div.asl_r p.showmore a{font-weight:normal;font-family:Open Sans;color:#055e94;font-size:12px;line-height:30px;text-shadow:0 0 0 rgba(255,255,255,0);display:block;text-align:center;cursor:pointer;}.results .asl_nores .asl_keyword{padding:0 6px;cursor:pointer;font-weight:bold;font-family:Open Sans;}div.asl_r .resdrg{height:auto;}div.asl_w .group:first-of-type{margin:0 0 -3px;}div.asl_s.searchsettings{width:200px;height:auto;position:absolute;display:none;z-index:1101;border-radius:0 0 3px 3px;visibility:hidden;padding:0;}div.asl_s.searchsettings form{display:flex;flex-wrap:wrap;margin:0 0 12px 0 !important;padding:0 !important;}div.asl_s.searchsettings .asl_option_inner{margin:2px 10px 0 10px;*padding-bottom:10px;}div.asl_s.searchsettings.ie78 .asl_option_inner{margin-bottom:0 !important;padding-bottom:0 !important;}div.asl_s.searchsettings .asl_option_label{font-size:14px;line-height:20px !important;margin:0;width:150px;text-shadow:none;padding:0;min-height:20px;border:none;background:transparent;float:none;}div.asl_s.searchsettings .asl_option_inner input[type=checkbox]{display:none !important;}div.asl_s.searchsettings.ie78 .asl_option_inner input[type=checkbox]{display:block;}div.asl_s.searchsettings.ie78 .asl_option_label{float:right !important;}div.asl_s.searchsettings .asl_option{display:flex;flex-direction:row;-webkit-flex-direction:row;align-items:flex-start;margin:0 0 10px 0;cursor:pointer;}div.asl_s.searchsettings .asl_option.asl-o-last,div.asl_s.searchsettings .asl_option:last-child{margin-bottom:0;}div.asl_s.searchsettings .asl_option_inner{width:17px;height:17px;position:relative;flex-grow:0;-webkit-flex-grow:0;flex-shrink:0;-webkit-flex-shrink:0;}div.asl_s.searchsettings .asl_option_inner label{cursor:pointer;position:absolute;width:17px;height:17px;top:0;padding:0;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,.2);overflow:hidden;font-size:0 !important;color:rgba(0,0,0,0);}div.asl_s.searchsettings.ie78 .asl_option_inner label{display:none;}div.asl_s.searchsettings .asl_option_inner label:after{opacity:0;font-family:'aslsicons2';content:"";font-weight:normal !important;background:transparent;border:none !important;box-sizing:content-box;color:#fff;height:100%;width:100%;padding:0 !important;margin:1px 0 0 0 !important;line-height:17px;text-align:center;text-decoration:none;text-shadow:none;display:block;font-size:11px !important;position:absolute;top:0;left:0;z-index:1;}div.asl_s.searchsettings.ie78 .asl_option_inner label:after{display:none;}div.asl_s.searchsettings .asl_option_inner label:hover::after{opacity:.3;}div.asl_s.searchsettings .asl_option_inner input[type=checkbox]:checked+label:after{opacity:1;}div.asl_s.searchsettings fieldset{position:relative;float:left;}div.asl_s.searchsettings fieldset{background:transparent;font-size:.9em;margin:12px 0 0 !important;padding:0;width:192px;}div.asl_s.searchsettings fieldset .asl_option_label{width:130px;display:block;}div.asl_s.searchsettings form fieldset legend{padding:5px 0 8px 10px;}/*[simplebar]*/[data-asl_simplebar]{position:relative;flex-direction:column;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start;}.asl_simplebar-wrapper{overflow:hidden;width:inherit;height:inherit;max-width:inherit;max-height:inherit;}.asl_simplebar-mask{direction:inherit;position:absolute;overflow:hidden;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto !important;height:auto !important;z-index:0;}.asl_simplebar-offset{direction:inherit !important;box-sizing:inherit !important;resize:none !important;position:absolute;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch;}.asl_simplebar-content-wrapper{direction:inherit;box-sizing:border-box !important;position:relative;display:block;height:100%;width:auto;visibility:visible;max-width:100%;max-height:100%;scrollbar-width:none;}.asl_simplebar-content-wrapper::-webkit-scrollbar,.asl_simplebar-hide-scrollbar::-webkit-scrollbar{display:none;}.asl_simplebar-content:before,.asl_simplebar-content:after{content:' ';display:table;}.asl_simplebar-placeholder{max-height:100%;max-width:100%;width:100%;pointer-events:none;}.asl_simplebar-height-auto-observer-wrapper{box-sizing:inherit !important;height:100%;width:100%;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;flex-grow:inherit;flex-shrink:0;flex-basis:0;}.asl_simplebar-height-auto-observer{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:1000%;width:1000%;min-height:1px;min-width:1px;overflow:hidden;pointer-events:none;z-index:-1;}.asl_simplebar-track{z-index:1;position:absolute;right:0;bottom:0;pointer-events:none;overflow:hidden;}[data-asl_simplebar].asl_simplebar-dragging .asl_simplebar-content{pointer-events:none;user-select:none;-webkit-user-select:none;}[data-asl_simplebar].asl_simplebar-dragging .asl_simplebar-track{pointer-events:all;}.asl_simplebar-scrollbar{position:absolute;right:2px;width:7px;min-height:10px;}.asl_simplebar-scrollbar:before{position:absolute;content:'';background:rgba(0,0,0,.5);border-radius:7px;left:0;right:0;opacity:0;transition:opacity .2s linear;}.asl_simplebar-scrollbar.asl_simplebar-visible:before{opacity:1;transition:opacity 0s linear;}.asl_simplebar-track.asl_simplebar-vertical{top:0;width:11px;margin-top:4px !important;margin-bottom:4px !important;}.asl_simplebar-track.asl_simplebar-vertical .asl_simplebar-scrollbar:before{top:2px;bottom:2px;}.asl_simplebar-track.asl_simplebar-horizontal{left:0;height:11px;margin-left:12px !important;margin-right:12px !important;}.asl_simplebar-track.asl_simplebar-horizontal .asl_simplebar-scrollbar:before{height:100%;left:2px;right:2px;}.asl_simplebar-track.asl_simplebar-horizontal .asl_simplebar-scrollbar{right:auto;left:0;top:2px;height:7px;min-height:0;min-width:10px;width:auto;}[data-asl_simplebar-direction='rtl'] .asl_simplebar-track.asl_simplebar-vertical{right:auto;left:0;}.hs-dummy-scrollbar-size{direction:rtl;position:fixed;opacity:0;visibility:hidden;height:500px;width:500px;overflow-y:hidden;overflow-x:scroll;}.asl_simplebar-hide-scrollbar{position:fixed;left:0;visibility:hidden;overflow-y:scroll;scrollbar-width:none;}/*[simplebar]*/#asl_hidden_data{display:none !important;}.rtl .asl_content,.rtl .asl_nores,.rtl .asl_content *,.rtl .asl_nores *,.rtl .searchsettings form{text-align:right !important;direction:rtl !important;}.rtl .asl_nores>*{display:inline-block;}.rtl div.asl_r .results .item .asl_image{float:right;margin:2px 0 0 8px;}div.asl_s.searchsettings form fieldset legend{padding:5px 10px 8px 0;}.rtl .searchsettings .asl_option{flex-direction:row-reverse !important;-webkit-flex-direction:row-reverse !important;}.rtl .asl_option{direction:ltr;}.rtl .asl_label,.rtl .asl_option div.asl_option_label{text-align:right !important;}.rtl .asl_label{max-width:1000px !important;width:100%;direction:rtl !important;}.rtl .asl_label input[type=radio]{margin:0 0 0 6px !important;}.rtl .asl_option_cat_level-0 div.asl_option_label{font-weight:bold !important;}.rtl fieldset .asl_option_cat_level-1{margin-right:12px !important;margin-left:0;}.rtl fieldset .asl_option_cat_level-2{margin-right:24px !important;margin-left:0;}.rtl fieldset .asl_option_cat_level-3{margin-right:36px !important;margin-left:0;}.rtl .searchsettings legend{text-align:right !important;display:block;width:100%;}.rtl .searchsettings input[type=text],.rtl .searchsettings select{direction:rtl !important;text-align:right !important;}.rtl div.asl_w.asl_s.searchsettings form,.rtl div.asl_w.asl_sb.searchsettings form{flex-direction:row-reverse !important;}.rtl div.horizontal.asl_r div.item{float:right !important;}.rtl p.asl-try{direction:rtl;text-align:right;margin-right:10px;width:auto !important;}
1
+ @keyframes aslAnFadeInDrop{0%{opacity:0;transform:translate(0,-50px);}100%{opacity:1;transform:translate(0,0);}}@-webkit-keyframes aslAnFadeInDrop{0%{opacity:0;transform:translate(0,-50px);-webkit-transform:translate(0,-50px);}100%{opacity:1;transform:translate(0,0);-webkit-transform:translate(0,0);}}@keyframes aslAnFadeOutDrop{0%{opacity:1;transform:translate(0,0);-webkit-transform:translate(0,0);}100%{opacity:0;transform:translate(0,-50px);-webkit-transform:translate(0,-50px);}}@-webkit-keyframes aslAnFadeOutDrop{0%{opacity:1;transform:translate(0,0);-webkit-transform:translate(0,0);}100%{opacity:0;transform:translate(0,-50px);-webkit-transform:translate(0,-50px);}}.hiddend{display:none !important;}div.asl_w.asl_an_fadeInDrop,div.asl_w.asl_an_fadeOutDrop{-webkit-animation-duration:100ms;animation-duration:100ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;}div.asl_w.asl_an_fadeInDrop{animation-name:aslAnFadeInDrop;-webkit-animation-name:aslAnFadeInDrop;}div.asl_w.asl_an_fadeOutDrop{animation-name:aslAnFadeOutDrop;-webkit-animation-name:aslAnFadeOutDrop;}div.asl_w.asl_main_container{transition:width 130ms linear;-webkit-transition:width 130ms linear;}div.asl_w,div.asl_w *,div.asl_r,div.asl_r *,div.asl_s,div.asl_s *{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;-ms-box-sizing:content-box;-o-box-sizing:content-box;box-sizing:content-box;padding:0;margin:0;border:0;border-radius:0;text-transform:none;text-shadow:none;box-shadow:none;text-decoration:none;text-align:left;letter-spacing:normal;}div.asl_r,div.asl_r *{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}div.asl_m .proinput input::-ms-clear{display:none !important;width:0 !important;height:0 !important;}div.asl_m .proinput input::-ms-reveal{display:none !important;width:0 !important;height:0 !important;}div.asl_m input[type="search"]{-webkit-appearance:textfield !important;}div.asl_m input[type="search"]::-webkit-search-decoration,div.asl_m input[type="search"]::-webkit-search-cancel-button,div.asl_m input[type="search"]::-webkit-search-results-button,div.asl_m input[type="search"]::-webkit-search-results-decoration{display:none;}.clear{clear:both;}.hiddend{display:none;}div.asl_m textarea:focus,div.asl_m input:focus{outline:none;}div.asl_m{width:100%;height:auto;border-radius:0;background:rgba(255,255,255,0);overflow:hidden;position:relative;z-index:200;}div.asl_m .probox{width:auto;border-radius:5px;background:#fff;overflow:hidden;border:1px solid #fff;box-shadow:1px 0 3px #ccc inset;display:-webkit-flex;display:flex;-webkit-flex-direction:row;flex-direction:row;}div.asl_m .probox .proinput{width:auto;height:100%;margin:0 0 0 10px;padding:0 5px;float:left;box-shadow:none;position:relative;flex:1 1 auto;-webkit-flex:1 1 auto;order:5;-webkit-order:5;}div.asl_m .probox .proinput input:before,div.asl_m .probox .proinput input:after,div.asl_m .probox .proinput form:before,div.asl_m .probox .proinput form:after{display:none;}div.asl_m .probox .proinput input{height:28px;border:0;background:transparent;width:100%;box-shadow:none;margin:-1px;padding:0;left:0;line-height:normal !important;display:block;}div.asl_m .probox .proinput input::-webkit-input-placeholder{opacity:.85;}div.asl_m .probox .proinput input::-moz-placeholder{opacity:.85;}div.asl_m .probox .proinput input:-ms-input-placeholder{opacity:.85;}div.asl_m .probox .proinput input:-moz-placeholder{opacity:.85;}div.asl_m .proinput input.orig{padding:0 !important;margin:0 !important;background:transparent !important;border:none !important;background-color:transparent !important;box-shadow:none !important;z-index:10;position:relative;}div.asl_m .proinput input.autocomplete{padding:0 !important;margin:0;background:transparent !important;border:none !important;background-color:transparent !important;box-shadow:none !important;opacity:.2;}div.asl_m .probox .proinput input.autocomplete{border:0;background:transparent;width:100%;box-shadow:none;margin:0;margin-top:-28px !important;padding:0;left:0;position:relative;z-index:9;}div.asl_m .probox .proinput.iepaddingfix{padding-top:0;}div.asl_m .probox .proinput .loading{width:32px;background:#000;height:100%;box-shadow:none;}div.asl_m .probox .proloading,div.asl_m .probox .proclose,div.asl_m .probox .promagnifier,div.asl_m .probox .prosettings{width:20px;height:20px;background:none;background-size:20px 20px;float:right;box-shadow:none;margin:0;padding:0;text-align:center;flex:0 0 auto;-webkit-flex:0 0 auto;z-index:100;}div.asl_m .probox .promagnifier{order:10;-webkit-order:10;}div.asl_m .probox .prosettings{order:1;-webkit-order:1;}div.asl_m .probox .proloading,div.asl_m .probox .proclose{background-position:center center;display:none;background-size:auto;background-repeat:no-repeat;background-color:transparent;order:6;-webkit-order:6;}div.asl_m .probox .proclose{position:relative;cursor:pointer;}div.asl_m .probox .promagnifier .innericon,div.asl_m .probox .prosettings .innericon,div.asl_m .probox .proclose .innericon{background-size:20px 20px;background-position:center center;background-repeat:no-repeat;background-color:transparent;width:100%;height:100%;text-align:center;overflow:hidden;}div.asl_m .probox .promagnifier .innericon svg,div.asl_m .probox .prosettings .innericon svg,div.asl_m .probox .proloading svg{height:100%;width:22px;vertical-align:baseline;display:inline-block;}div.asl_m .probox .proloading{padding:2px;box-sizing:border-box;}div.asl_m .probox div.asl_loader,div.asl_m .probox div.asl_loader *{box-sizing:border-box !important;margin:0;padding:0;box-shadow:none;}div.asl_m .probox div.asl_loader{box-sizing:border-box;display:flex;flex:0 1 auto;flex-direction:column;flex-grow:0;flex-shrink:0;flex-basis:28px;max-width:100%;max-height:100%;width:100%;height:100%;align-items:center;justify-content:center;}div.asl_m .probox div.asl_loader-inner{width:100%;margin:0 auto;text-align:center;height:100%;}@-webkit-keyframes rotate-simple{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes rotate-simple{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}50%{-webkit-transform:rotate(180deg);transform:rotate(180deg);}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}}div.asl_m .probox div.asl_simple-circle{margin:0;height:100%;width:100%;animation:rotate-simple .8s infinite linear;-webkit-animation:rotate-simple .8s infinite linear;border:4px solid #fff;border-right-color:transparent !important;border-radius:50%;box-sizing:border-box;}div.asl_m .probox .proclose svg{background:#333;border-radius:50%;position:absolute;top:50%;width:20px;height:20px;margin-top:-10px;left:50%;margin-left:-10px;fill:#fefefe;padding:4px;box-sizing:border-box;box-shadow:0 0 0 2px rgba(255,255,255,.9);}div.asl_r *{text-decoration:none;text-shadow:none;}div.asl_r .results .asl_nores{overflow:hidden;width:auto;height:100%;line-height:initial;text-align:center;margin:0;background:#fff;padding:10px 3px;color:#222;}div.asl_r.horizontal{padding:2px 0 10px;}div.asl_r.horizontal .results .nores{background:transparent;}div.asl_r .results{overflow:hidden;width:auto;height:0;margin:0;padding:0;}div.asl_r.horizontal .results{height:auto;width:auto;}div.asl_r .results .item{overflow:hidden;width:auto;margin:0;padding:3px;position:relative;background:#f4f4f4;border-left:1px solid rgba(255,255,255,.6);border-right:1px solid rgba(255,255,255,.4);animation-delay:0s;animation-duration:1s;animation-fill-mode:both;animation-timing-function:ease;backface-visibility:hidden;-webkit-animation-delay:0s;-webkit-animation-duration:1s;-webkit-animation-fill-mode:both;-webkit-animation-timing-function:ease;-webkit-backface-visibility:hidden;}div.asl_r.vertical .results .item:first-child{border-radius:3px 3px 0 0;}div.asl_r.vertical .results .item:last-child{border-radius:0 0 3px 3px;margin-bottom:0;}div.asl_r.vertical .results .item:last-child:after{height:0;margin:0;width:0;}div.asl_r .results .item .asl_image{overflow:hidden;background:transparent;margin:2px 8px 0 0;padding:0;float:left;background-position:center;background-size:cover;}div.asl_r .results .item .asl_image img{width:100%;height:100%;}div.asl_r .results .item .asl_content{overflow:hidden;height:auto;background:transparent;margin:0;padding:3px 3px 5px 3px;}div.asl_r .results .item .asl_content h3{margin:0;padding:0;display:inline;line-height:inherit;}div.asl_r .results .item .asl_content .asl_desc{margin-top:4px;font-size:12px;line-height:18px;}div.asl_r .results .item div.etc{margin-top:4px;}div.asl_r .results a span.overlap{position:absolute;width:100%;height:100%;top:0;left:0;z-index:1;}div.asl_r p.showmore{text-align:center;padding:0;margin:0;font-weight:normal;font-family:Open Sans;color:#055e94;font-size:12px;line-height:30px;text-shadow:0 0 0 rgba(255,255,255,0);background-color:#fff;margin-top:3px;cursor:pointer;}div.asl_r p.showmore a{font-weight:normal;font-family:Open Sans;color:#055e94;font-size:12px;line-height:30px;text-shadow:0 0 0 rgba(255,255,255,0);display:block;text-align:center;cursor:pointer;}.results .asl_nores .asl_keyword{padding:0 6px;cursor:pointer;font-weight:bold;font-family:Open Sans;}div.asl_r .resdrg{height:auto;}div.asl_w .group:first-of-type{margin:0 0 -3px;}div.asl_s.searchsettings{width:200px;height:auto;position:absolute;display:none;z-index:1101;border-radius:0 0 3px 3px;visibility:hidden;padding:0;}div.asl_s.searchsettings form{display:flex;flex-wrap:wrap;margin:0 0 12px 0 !important;padding:0 !important;}div.asl_s.searchsettings .asl_option_inner{margin:2px 10px 0 10px;*padding-bottom:10px;}div.asl_s.searchsettings.ie78 .asl_option_inner{margin-bottom:0 !important;padding-bottom:0 !important;}div.asl_s.searchsettings .asl_option_label{font-size:14px;line-height:20px !important;margin:0;width:150px;text-shadow:none;padding:0;min-height:20px;border:none;background:transparent;float:none;}div.asl_s.searchsettings .asl_option_inner input[type=checkbox]{display:none !important;}div.asl_s.searchsettings.ie78 .asl_option_inner input[type=checkbox]{display:block;}div.asl_s.searchsettings.ie78 .asl_option_label{float:right !important;}div.asl_s.searchsettings .asl_option{display:flex;flex-direction:row;-webkit-flex-direction:row;align-items:flex-start;margin:0 0 10px 0;cursor:pointer;}div.asl_s.searchsettings .asl_option.asl-o-last,div.asl_s.searchsettings .asl_option:last-child{margin-bottom:0;}div.asl_s.searchsettings .asl_option_inner{width:17px;height:17px;position:relative;flex-grow:0;-webkit-flex-grow:0;flex-shrink:0;-webkit-flex-shrink:0;}div.asl_s.searchsettings .asl_option_inner label{cursor:pointer;position:absolute;width:17px;height:17px;top:0;padding:0;border-radius:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,.2);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,.2);box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,.2);overflow:hidden;font-size:0 !important;color:rgba(0,0,0,0);}div.asl_s.searchsettings.ie78 .asl_option_inner label{display:none;}div.asl_s.searchsettings .asl_option_inner label:after{opacity:0;font-family:'aslsicons2';content:"";font-weight:normal !important;background:transparent;border:none !important;box-sizing:content-box;color:#fff;height:100%;width:100%;padding:0 !important;margin:1px 0 0 0 !important;line-height:17px;text-align:center;text-decoration:none;text-shadow:none;display:block;font-size:11px !important;position:absolute;top:0;left:0;z-index:1;}div.asl_s.searchsettings.ie78 .asl_option_inner label:after{display:none;}div.asl_s.searchsettings .asl_option_inner label:hover::after{opacity:.3;}div.asl_s.searchsettings .asl_option_inner input[type=checkbox]:checked+label:after{opacity:1;}div.asl_s.searchsettings fieldset{position:relative;float:left;}div.asl_s.searchsettings fieldset{background:transparent;font-size:.9em;margin:12px 0 0 !important;padding:0;width:192px;}div.asl_s.searchsettings fieldset .asl_option_label{width:130px;display:block;}div.asl_s.searchsettings form fieldset legend{padding:5px 0 8px 10px;}/*[simplebar]*/[data-asl_simplebar]{position:relative;flex-direction:column;flex-wrap:wrap;justify-content:flex-start;align-content:flex-start;align-items:flex-start;}.asl_simplebar-wrapper{overflow:hidden;width:inherit;height:inherit;max-width:inherit;max-height:inherit;}.asl_simplebar-mask{direction:inherit;position:absolute;overflow:hidden;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto !important;height:auto !important;z-index:0;}.asl_simplebar-offset{direction:inherit !important;box-sizing:inherit !important;resize:none !important;position:absolute;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch;}.asl_simplebar-content-wrapper{direction:inherit;box-sizing:border-box !important;position:relative;display:block;height:100%;width:auto;visibility:visible;max-width:100%;max-height:100%;scrollbar-width:none;}.asl_simplebar-content-wrapper::-webkit-scrollbar,.asl_simplebar-hide-scrollbar::-webkit-scrollbar{display:none;}.asl_simplebar-content:before,.asl_simplebar-content:after{content:' ';display:table;}.asl_simplebar-placeholder{max-height:100%;max-width:100%;width:100%;pointer-events:none;}.asl_simplebar-height-auto-observer-wrapper{box-sizing:inherit !important;height:100%;width:100%;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;flex-grow:inherit;flex-shrink:0;flex-basis:0;}.asl_simplebar-height-auto-observer{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:1000%;width:1000%;min-height:1px;min-width:1px;overflow:hidden;pointer-events:none;z-index:-1;}.asl_simplebar-track{z-index:1;position:absolute;right:0;bottom:0;pointer-events:none;overflow:hidden;}[data-asl_simplebar].asl_simplebar-dragging .asl_simplebar-content{pointer-events:none;user-select:none;-webkit-user-select:none;}[data-asl_simplebar].asl_simplebar-dragging .asl_simplebar-track{pointer-events:all;}.asl_simplebar-scrollbar{position:absolute;right:2px;width:7px;min-height:10px;}.asl_simplebar-scrollbar:before{position:absolute;content:'';background:rgba(0,0,0,.5);border-radius:7px;left:0;right:0;opacity:0;transition:opacity .2s linear;}.asl_simplebar-scrollbar.asl_simplebar-visible:before{opacity:1;transition:opacity 0s linear;}.asl_simplebar-track.asl_simplebar-vertical{top:0;width:11px;margin-top:4px !important;margin-bottom:4px !important;}.asl_simplebar-track.asl_simplebar-vertical .asl_simplebar-scrollbar:before{top:2px;bottom:2px;}.asl_simplebar-track.asl_simplebar-horizontal{left:0;height:11px;margin-left:12px !important;margin-right:12px !important;}.asl_simplebar-track.asl_simplebar-horizontal .asl_simplebar-scrollbar:before{height:100%;left:2px;right:2px;}.asl_simplebar-track.asl_simplebar-horizontal .asl_simplebar-scrollbar{right:auto;left:0;top:2px;height:7px;min-height:0;min-width:10px;width:auto;}[data-asl_simplebar-direction='rtl'] .asl_simplebar-track.asl_simplebar-vertical{right:auto;left:0;}.hs-dummy-scrollbar-size{direction:rtl;position:fixed;opacity:0;visibility:hidden;height:500px;width:500px;overflow-y:hidden;overflow-x:scroll;}.asl_simplebar-hide-scrollbar{position:fixed;left:0;visibility:hidden;overflow-y:scroll;scrollbar-width:none;}/*[simplebar]*/#asl_hidden_data{display:none !important;}.rtl .asl_content,.rtl .asl_nores,.rtl .asl_content *,.rtl .asl_nores *,.rtl .searchsettings form{text-align:right !important;direction:rtl !important;}.rtl .asl_nores>*{display:inline-block;}.rtl div.asl_r .results .item .asl_image{float:right;margin:2px 0 0 8px;}.rtl .searchsettings .asl_option{flex-direction:row-reverse !important;-webkit-flex-direction:row-reverse !important;}.rtl .asl_option{direction:ltr;}.rtl .asl_label,.rtl .asl_option div.asl_option_label{text-align:right !important;}.rtl .asl_label{max-width:1000px !important;width:100%;direction:rtl !important;}.rtl .asl_label input[type=radio]{margin:0 0 0 6px !important;}.rtl .asl_option_cat_level-0 div.asl_option_label{font-weight:bold !important;}.rtl fieldset .asl_option_cat_level-1{margin-right:12px !important;margin-left:0;}.rtl fieldset .asl_option_cat_level-2{margin-right:24px !important;margin-left:0;}.rtl fieldset .asl_option_cat_level-3{margin-right:36px !important;margin-left:0;}.rtl .searchsettings legend{text-align:right !important;display:block;width:100%;}.rtl .searchsettings input[type=text],.rtl .searchsettings select{direction:rtl !important;text-align:right !important;}.rtl div.asl_w.asl_s.searchsettings form,.rtl div.asl_w.asl_sb.searchsettings form{flex-direction:row-reverse !important;}.rtl div.horizontal.asl_r div.item{float:right !important;}.rtl p.asl-try{direction:rtl;text-align:right;margin-right:10px;width:auto !important;}
img/close/close1.svg CHANGED
@@ -11,7 +11,7 @@ You may NOT sub-license, resell, rent, redistribute or otherwise transfer the ic
11
 
12
  width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
13
 
14
- <polygon id="x-mark-icon" points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622
15
 
16
  73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "/>
17
 
11
 
12
  width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
13
 
14
+ <polygon points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622
15
 
16
  73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "/>
17
 
includes/classes/actions/class-asl-stylesheets.php CHANGED
@@ -84,6 +84,8 @@ if (!class_exists("WD_ASL_StyleSheets_Action")) {
84
  div[id*='ajaxsearchliteres'].wpdreams_asl_results .results div.asl_image {
85
  width: ". $asl_options['image_width'] . "px;
86
  height: " . $asl_options['image_height'] . "px;
 
 
87
  }
88
  div.asl_r .results {
89
  max-height: ". $asl_options['v_res_max_height'] .";
@@ -131,6 +133,55 @@ if (!class_exists("WD_ASL_StyleSheets_Action")) {
131
  div.asl_m.asl_w .probox {border: none !important;}
132
  ";
133
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  if ( intval($asl_options['v_res_column_count']) > 1 ) {
135
  // Columns specific
136
  self::$inline_css .= "
@@ -194,6 +245,14 @@ if (!class_exists("WD_ASL_StyleSheets_Action")) {
194
  ";
195
  }
196
 
 
 
 
 
 
 
 
 
197
  if ( $asl_options['custom_css'] != '' && base64_decode($asl_options['custom_css'], true) == true ) {
198
  self::$inline_css .= ' ' . stripcslashes( base64_decode($asl_options['custom_css']) );
199
  }
84
  div[id*='ajaxsearchliteres'].wpdreams_asl_results .results div.asl_image {
85
  width: ". $asl_options['image_width'] . "px;
86
  height: " . $asl_options['image_height'] . "px;
87
+ background-size: ".$asl_options['image_display_mode'].";
88
+ background-repeat: no-repeat;
89
  }
90
  div.asl_r .results {
91
  max-height: ". $asl_options['v_res_max_height'] .";
133
  div.asl_m.asl_w .probox {border: none !important;}
134
  ";
135
  }
136
+
137
+ if ( $asl_options['results_bg_override'] == 1 ) {
138
+ self::$inline_css .= "
139
+ .asl_r.asl_w {
140
+ background-color: ".$asl_options['results_bg_override_color']." !important;
141
+ background-image: none !important;
142
+ -webkit-background-image: none !important;
143
+ -ms-background-image: none !important;
144
+ }
145
+ ";
146
+ }
147
+ if ( $asl_options['results_item_bg_override'] == 1 ) {
148
+ self::$inline_css .= "
149
+ .asl_r.asl_w .item {
150
+ background-color: ".$asl_options['results_item_bg_override_color']." !important;
151
+ background-image: none !important;
152
+ -webkit-background-image: none !important;
153
+ -ms-background-image: none !important;
154
+ }
155
+ ";
156
+ }
157
+ if ( $asl_options['results_override_border'] == 1 ) {
158
+ self::$inline_css .= "
159
+ div.asl_r.asl_w {
160
+ ".str_replace(';', ' !important;', $asl_options['results_override_border_style'])."
161
+ box-shadow: none !important;
162
+ }
163
+ ";
164
+ }
165
+
166
+ if ( $asl_options['settings_bg_override'] == 1 ) {
167
+ self::$inline_css .= "
168
+ .asl_s.asl_w {
169
+ background-color: ".$asl_options['settings_bg_override_color']." !important;
170
+ background-image: none !important;
171
+ -webkit-background-image: none !important;
172
+ -ms-background-image: none !important;
173
+ }
174
+ ";
175
+ }
176
+ if ( $asl_options['settings_override_border'] == 1 ) {
177
+ self::$inline_css .= "
178
+ div.asl_s.asl_w {
179
+ ".str_replace(';', ' !important;', $asl_options['settings_override_border_style'])."
180
+ box-shadow: none !important;
181
+ }
182
+ ";
183
+ }
184
+
185
  if ( intval($asl_options['v_res_column_count']) > 1 ) {
186
  // Columns specific
187
  self::$inline_css .= "
245
  ";
246
  }
247
 
248
+ if ( $asl_options['single_highlight'] == 1 ) {
249
+ self::$inline_css .= "body span.asl_single_highlighted {
250
+ display: inline !important;
251
+ color: ".$asl_options['single_highlightcolor']." !important;
252
+ background-color: ".$asl_options['single_highlightbgcolor']." !important;
253
+ }";
254
+ }
255
+
256
  if ( $asl_options['custom_css'] != '' && base64_decode($asl_options['custom_css'], true) == true ) {
257
  self::$inline_css .= ' ' . stripcslashes( base64_decode($asl_options['custom_css']) );
258
  }
includes/classes/ajax/class-asl-search.php CHANGED
@@ -15,55 +15,66 @@ if (!class_exists("WD_ASL_Search_Handler")) {
15
  */
16
  class WD_ASL_Search_Handler extends WD_ASL_Handler_Abstract {
17
 
18
-
19
- /**
20
- * Oversees and handles the search request
21
- *
22
- * @param bool $dontGroup
23
- * @return array|mixed|void
24
- */
25
- public function handle($dontGroup = false) {
26
-
27
- $s = $_POST['aslp'];
28
- $s = apply_filters('asl_search_phrase_before_cleaning', $s);
29
-
30
- $s = stripcslashes($s);
31
- $s = trim($s);
32
- $s = preg_replace('/\s+/', ' ', $s);
33
-
34
- $s = apply_filters('asl_search_phrase_after_cleaning', $s);
35
-
36
- $id = 0;
37
- $instance = wd_asl()->instances->get($id);
38
- $sd = &$instance['data'];
39
-
40
- $searchController = new asl_searchController(array(
41
- "phrase" => $s,
42
- "id" => $id,
43
- "instance" => $instance
44
- ));
45
-
46
- $results = $searchController->search();
47
-
48
- if (count($results) <= 0 && $sd['kw_suggestions'])
49
- $results = $searchController->kwSuggestions();
50
-
51
- do_action('asl_after_search', $s, $results, $id);
52
-
53
- // Override from hooks
54
- if (isset($_POST['asl_get_as_array'])) {
55
- return $results;
56
- }
57
-
58
- // Generate the results here
59
- $html_results = asl_generate_html_results( $results, $sd );
60
-
61
- /* Clear output buffer, possible warnings */
62
- print "!!ASLSTART!!";
63
- print_r($html_results);
64
- print "!!ASLEND!!";
65
- die();
66
- }
 
 
 
 
 
 
 
 
 
 
 
67
 
68
  // ------------------------------------------------------------
69
  // ---------------- SINGLETON SPECIFIC --------------------
15
  */
16
  class WD_ASL_Search_Handler extends WD_ASL_Handler_Abstract {
17
 
18
+ /**
19
+ * Oversees and handles the search request
20
+ *
21
+ * @param bool $dontGroup
22
+ * @return array|mixed|void
23
+ */
24
+ public function handle($dontGroup = false) {
25
+
26
+ $s = $_POST['aslp'];
27
+
28
+ if (is_array($_POST['options']))
29
+ $options = $_POST['options'];
30
+ else
31
+ parse_str($_POST['options'], $options);
32
+
33
+ $id = 0;
34
+ $instance = wd_asl()->instances->get($id);
35
+ $sd = &$instance['data'];
36
+
37
+ $asl_query = new ASL_Query(array(
38
+ "s" => $s,
39
+ "_id" => $id,
40
+ "_ajax_search" => true,
41
+ "_call_num" => isset($_POST['asl_call_num']) ? $_POST['asl_call_num'] : 0
42
+ ), $id, $options);
43
+ $results = $asl_query->posts;
44
+
45
+ if (count($results) <= 0 && isset($sd['keywordsuggestions']) && $sd['keywordsuggestions']) {
46
+ $results = $asl_query->kwSuggestions();
47
+ } else if (count($results) > 0) {
48
+ $results = apply_filters('asl_only_non_keyword_results', $results, $id, $s, $asl_query->getArgs());
49
+ }
50
+
51
+ $results = apply_filters('asl_ajax_results', $results, $id, $s, $sd);
52
+
53
+ do_action('asl_after_search', $s, $results, $id);
54
+
55
+ $html_results = asl_generate_html_results( $results, $sd );
56
+
57
+ // Override from hooks
58
+ if (isset($_POST['asl_get_as_array'])) {
59
+ return $results;
60
+ }
61
+
62
+ $html_results = apply_filters('asl_before_ajax_output', $html_results, $id, $results, $asl_query->getArgs());
63
+
64
+ $final_output = "";
65
+ /* Clear output buffer, possible warnings */
66
+ $final_output .= "!!ASLSTART!!" . $html_results . "!!ASLEND!!";
67
+ $final_output .= "!!ASLSTART_DATA!!";
68
+ $final_output .= json_encode(array(
69
+ 'results_count' => isset($results["keywords"]) ? 0 : count($results),
70
+ 'full_results_count' => $asl_query->found_posts
71
+ ));
72
+ $final_output .= "!!ASLEND_DATA!!";
73
+
74
+ ASL_Helpers::prepareAjaxHeaders();
75
+ print_r($final_output);
76
+ die();
77
+ }
78
 
79
  // ------------------------------------------------------------
80
  // ---------------- SINGLETON SPECIFIC --------------------
includes/classes/core/class-asl-filters.php CHANGED
@@ -77,7 +77,13 @@ if ( !class_exists("WD_ASL_Filters") ) {
77
  "handler" => array("EtcFixes", "fixOxygenEditorJS"),
78
  "priority" => 999,
79
  "args" => 1
80
- )
 
 
 
 
 
 
81
  );
82
 
83
  /**
77
  "handler" => array("EtcFixes", "fixOxygenEditorJS"),
78
  "priority" => 999,
79
  "args" => 1
80
+ ),
81
+ array(
82
+ "filter" => "rocket_exclude_defer_js",
83
+ "handler" => array("EtcFixes", "wp_rocket_exclude_defer_js"),
84
+ "priority" => 999,
85
+ "args" => 1
86
+ )
87
  );
88
 
89
  /**
includes/classes/core/class-asl-init.php CHANGED
@@ -91,7 +91,7 @@ class WD_ASL_Init {
91
  );
92
  foreach($adv_fields as $field) {
93
  // Force string conversion for proper comparision
94
- if ( !in_array($sd[$field].'', $values) ) {
95
  // Custom field value is selected
96
  $sd[$field.'_cf'] = $sd[$field];
97
  $sd[$field] = 'c__f';
@@ -148,6 +148,39 @@ class WD_ASL_Init {
148
  $sd['box_width_phone'] = $sd['box_width'];
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  // At the end, update
152
  wd_asl()->instances->update(0, $sd);
153
  }
@@ -183,6 +216,25 @@ class WD_ASL_Init {
183
  if ( $exit1 || $exit2 )
184
  return false;
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  // ------------ Dequeue some scripts causing issues on the back-end --------------
187
  wp_dequeue_script( 'otw-admin-colorpicker' );
188
  wp_dequeue_script( 'otw-admin-select2' );
@@ -200,14 +252,15 @@ class WD_ASL_Init {
200
  $load_in_footer = w_isset_def($performance_options['load_in_footer'], 1) == 1 ? true : false;
201
  $load_mcustom = w_isset_def($com_opt['load_scroll_js'], "yes") == "yes";
202
 
 
 
 
203
  if ($js_source == 'nomin' || $js_source == 'nomin-scoped') {
204
  if ($js_source == "nomin-scoped") {
205
  $prereq = "wpdreams-asljquery";
206
  wp_register_script('wpdreams-asljquery', ASL_URL . 'js/' . $js_source . '/asljquery.js', array(), ASL_CURR_VER_STRING, $load_in_footer);
207
  wp_enqueue_script('wpdreams-asljquery');
208
  }
209
- wp_register_script('wpdreams-gestures', ASL_URL . 'js/' . $js_source . '/jquery.gestures.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
210
- wp_enqueue_script('wpdreams-gestures');
211
  wp_register_script('wpdreams-highlight', ASL_URL . 'js/' . $js_source . '/jquery.highlight.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
212
  wp_enqueue_script('wpdreams-highlight');
213
  if ( $load_mcustom ) {
@@ -235,13 +288,13 @@ class WD_ASL_Init {
235
  }
236
 
237
  // @deprecated
238
- wp_localize_script( 'wpdreams-ajaxsearchlite', 'ajaxsearchlite', array(
239
  'ajaxurl' => $ajax_url,
240
  'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
241
  'js_scope' => $scope
242
  ));
243
 
244
- wp_localize_script( 'wpdreams-ajaxsearchlite', 'ASL', array(
245
  'ajaxurl' => $ajax_url,
246
  'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
247
  'js_scope' => $scope,
@@ -249,6 +302,10 @@ class WD_ASL_Init {
249
  'scrollbar' => $load_mcustom,
250
  'js_retain_popstate' => $com_opt['js_retain_popstate'],
251
  'version' => ASL_CURRENT_VERSION,
 
 
 
 
252
  'fix_duplicates' => $com_opt['js_fix_duplicates'],
253
  'analytics' => array(
254
  'method' => $analytics['analytics'],
91
  );
92
  foreach($adv_fields as $field) {
93
  // Force string conversion for proper comparision
94
+ if ( isset($sd[$field]) && !in_array($sd[$field].'', $values) ) {
95
  // Custom field value is selected
96
  $sd[$field.'_cf'] = $sd[$field];
97
  $sd[$field] = 'c__f';
148
  $sd['box_width_phone'] = $sd['box_width'];
149
  }
150
 
151
+ // ------------------------- 4.8.7 -----------------------------
152
+ // No longer exists
153
+ if ( isset($sd['showsearchinpages']) ) {
154
+ if ( $sd['showsearchinpages'] == 1 ) {
155
+ if ($sd['showcustomtypes'] == '') {
156
+ $sd['showcustomtypes'] = 'page;' . $sd['searchinpagestext'];
157
+ } else {
158
+ $sd['showcustomtypes'] = 'page;' . $sd['searchinpagestext'] . '|' . $sd['showcustomtypes'];
159
+ }
160
+ }
161
+ unset($sd['showsearchinpages']);
162
+ unset($sd['searchinpagestext']);
163
+ }
164
+ // No longer exists
165
+ if ( isset($sd['showsearchinposts']) ) {
166
+ if ( $sd['showsearchinposts'] == 1 ) {
167
+ if ($sd['showcustomtypes'] == '') {
168
+ $sd['showcustomtypes'] = 'post;' . $sd['searchinpoststext'];
169
+ } else {
170
+ $sd['showcustomtypes'] = 'post;' . $sd['searchinpoststext'] . '|' . $sd['showcustomtypes'];
171
+ }
172
+ }
173
+ unset($sd['showsearchinposts']);
174
+ unset($sd['searchinpoststext']);
175
+ }
176
+
177
+ if ( isset($sd['titlefield']) ) {
178
+ $sd['primary_titlefield'] = $sd['titlefield'];
179
+ $sd['primary_titlefield_cf'] = $sd['titlefield_cf'];
180
+ unset($sd['titlefield']);
181
+ unset($sd['titlefield_cf']);
182
+ }
183
+
184
  // At the end, update
185
  wd_asl()->instances->update(0, $sd);
186
  }
216
  if ( $exit1 || $exit2 )
217
  return false;
218
 
219
+ $single_highlight = false;
220
+ $single_highlight_arr = array();
221
+ $search = wd_asl()->instances->get();
222
+ if (is_array($search) && count($search)>0) {
223
+ foreach ($search as $s) {
224
+ // $style and $id needed in the include
225
+ if ( $s['data']['single_highlight'] == 1 ) {
226
+ $single_highlight = true;
227
+ $single_highlight_arr[] = array(
228
+ 'id' => $s['id'],
229
+ 'selector' => $s['data']['single_highlight_selector'],
230
+ 'scroll' => $s['data']['single_highlight_scroll'] == 1,
231
+ 'scroll_offset' => intval($s['data']['single_highlight_offset']),
232
+ 'whole' => $s['data']['single_highlightwholewords'] == 1,
233
+ );
234
+ }
235
+ }
236
+ }
237
+
238
  // ------------ Dequeue some scripts causing issues on the back-end --------------
239
  wp_dequeue_script( 'otw-admin-colorpicker' );
240
  wp_dequeue_script( 'otw-admin-select2' );
252
  $load_in_footer = w_isset_def($performance_options['load_in_footer'], 1) == 1 ? true : false;
253
  $load_mcustom = w_isset_def($com_opt['load_scroll_js'], "yes") == "yes";
254
 
255
+ // Load the wp hooks interface
256
+ wp_enqueue_script( 'wp-hooks' );
257
+
258
  if ($js_source == 'nomin' || $js_source == 'nomin-scoped') {
259
  if ($js_source == "nomin-scoped") {
260
  $prereq = "wpdreams-asljquery";
261
  wp_register_script('wpdreams-asljquery', ASL_URL . 'js/' . $js_source . '/asljquery.js', array(), ASL_CURR_VER_STRING, $load_in_footer);
262
  wp_enqueue_script('wpdreams-asljquery');
263
  }
 
 
264
  wp_register_script('wpdreams-highlight', ASL_URL . 'js/' . $js_source . '/jquery.highlight.js', array($prereq), ASL_CURR_VER_STRING, $load_in_footer);
265
  wp_enqueue_script('wpdreams-highlight');
266
  if ( $load_mcustom ) {
288
  }
289
 
290
  // @deprecated
291
+ ASL_Helpers::addInlineScript( 'wpdreams-ajaxsearchlite', 'ajaxsearchlite', array(
292
  'ajaxurl' => $ajax_url,
293
  'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
294
  'js_scope' => $scope
295
  ));
296
 
297
+ ASL_Helpers::addInlineScript( 'wpdreams-ajaxsearchlite', 'ASL', array(
298
  'ajaxurl' => $ajax_url,
299
  'backend_ajaxurl' => admin_url( 'admin-ajax.php'),
300
  'js_scope' => $scope,
302
  'scrollbar' => $load_mcustom,
303
  'js_retain_popstate' => $com_opt['js_retain_popstate'],
304
  'version' => ASL_CURRENT_VERSION,
305
+ 'highlight' => array(
306
+ 'enabled' => $single_highlight,
307
+ 'data' => $single_highlight_arr
308
+ ),
309
  'fix_duplicates' => $com_opt['js_fix_duplicates'],
310
  'analytics' => array(
311
  'method' => $analytics['analytics'],
includes/classes/core/class-asl-menu.php CHANGED
@@ -57,9 +57,14 @@ if (!class_exists("WD_ASL_Menu")) {
57
  "slug" => "asl_maintenance"
58
  ),
59
  array(
60
- "title" => "Help & Support",
61
  "file" => "/backend/help_and_support.php",
62
  "slug" => "asl_help_and_support"
 
 
 
 
 
63
  )
64
  );
65
 
57
  "slug" => "asl_maintenance"
58
  ),
59
  array(
60
+ "title" => "<span class='asl_menu_help'>Help & Support</span>",
61
  "file" => "/backend/help_and_support.php",
62
  "slug" => "asl_help_and_support"
63
+ ),
64
+ array(
65
+ "title" => "<span class='asl_menu_pro'>Go PRO</span>",
66
+ "file" => "/backend/go_pro.php",
67
+ "slug" => "asl_go_pro"
68
  )
69
  );
70
 
includes/classes/etc/class-asl_helpers.php CHANGED
@@ -15,6 +15,30 @@ if (!class_exists("ASL_Helpers")) {
15
  */
16
  class ASL_Helpers {
17
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  /**
19
  * Performs a safe sanitation and escape for strings and numeric values in LIKE type queries.
20
  * This is not to be used on whole queries, only values.
@@ -214,6 +238,13 @@ if (!class_exists("ASL_Helpers")) {
214
  return implode($replace, explode($find, $subject, 2));
215
  }
216
 
 
 
 
 
 
 
 
217
  public static function resolveBracketSyntax( $content, $fields = array(), $empty_on_missing = false ) {
218
 
219
  if ( empty($fields) )
@@ -281,144 +312,210 @@ if (!class_exists("ASL_Helpers")) {
281
  return $ret;
282
  }
283
 
284
- /**
285
- * Gets the custom field value, supporting ACF get_field() and WooCommerce multi currency
286
- *
287
- * @see ASL_Helpers::woo_formattedPriceWithCurrency() To get the currency formatted field.
288
- * @see get_field() ACF post meta parsing.
289
- * @since 4.11
290
- *
291
- * @param string $field Custom field label
292
- * @param object $r Result object
293
- * @param bool $use_acf If true, will use the get_field() function from ACF
294
- * @param array $args Search arguments
295
- * @return string
296
- */
297
- public static function getCFValue($field, $r, $use_acf = false, $args = array()) {
298
- $ret = '';
299
- $price_fields = array('_price', '_tax_price', '_sale_price', '_regular_price');
300
- $datetime_fields = array('_EventStartDate', '_EventStartDateUTC', '_EventEndDate', '_EventEndDateUTC',
301
- '_event_start_date', '_event_end_date', '_event_start', '_event_end', '_event_start_local', '_event_end_local');
302
-
303
- if( in_array($field, $datetime_fields) &&
304
- isset($r->post_type) &&
305
- in_array($r->post_type, array('event', 'tribe_event')) ) {
306
-
307
- $mykey_values = get_post_custom_values($field, $r->id);
308
- if (isset($mykey_values[0])) {
309
- $ret = date_i18n( get_option( 'date_format' ), strtotime( $mykey_values[0] ) );
310
- }
311
-
312
- } else if ( in_array($field, $price_fields) &&
313
- isset($r->post_type) &&
314
- in_array($r->post_type, array('product', 'product_variation')) &&
315
- function_exists('wc_get_product')
316
- ) { // Is this a WooCommerce price related field?
317
- $ret = ASL_Helpers::woo_formattedPriceWithCurrency($r->id, $field, $args);
318
- } else { // ..or just a regular field?
319
- if ( $use_acf && function_exists('get_field') ) {
320
- $mykey_values = get_field($field, $r->id, true);
321
- if (!is_null($mykey_values) && $mykey_values != '' && $mykey_values !== false ) {
322
- if (is_array($mykey_values)) {
323
- if (!is_object($mykey_values[0])) {
324
- $ret = implode(', ', $mykey_values);
325
- }
326
- } else {
327
- $ret = $mykey_values;
328
- }
329
- }
330
- } else {
331
- $mykey_values = get_post_custom_values($field, $r->id);
332
- if (isset($mykey_values[0])) {
333
- $ret = $mykey_values[0];
334
- }
335
- }
336
- }
337
-
338
- return $ret;
339
- }
340
-
341
- /**
342
- * Gets the WooCommerce formatted currency, supporting multiple currencies WPML, WCML
343
- *
344
- * @since 4.11
345
- * @see wc_get_product() Getting the WooCommerce product.
346
- * @see $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency() For multi currency parsing.
347
- * @see wc_price() Price formatting.
348
- *
349
- * @param int $id Product or variation ID
350
- * @param string $field Field label
351
- * @param array $args Search arguments
352
- * @return string
353
- */
354
- public static function woo_formattedPriceWithCurrency($id, $field, $args) {
355
- global $woocommerce_wpml;
356
- global $sitepress;
357
-
358
- $currency = isset($args['woo_currency']) ?
359
- $args['woo_currency'] :
360
- (function_exists('get_woocommerce_currency') ?
361
- get_woocommerce_currency() : '');
362
-
363
- $price = '';
364
- $p = wc_get_product( $id );
365
-
366
- // WCML Section, copied and modified from
367
- // ..\wp-content\plugins\wpml-woocommerce\inc\currencies\class-wcml-multi-currency-prices.php
368
- // line 139, function product_price_filter(..)
369
- if ( isset($sitepress, $woocommerce_wpml, $woocommerce_wpml->multi_currency) ) {
370
- $original_object_id = apply_filters( 'translate_object_id', $id, get_post_type($id), false, $sitepress->get_default_language() );
371
- $ccr = get_post_meta($original_object_id, '_custom_conversion_rate', true);
372
-
373
- if( in_array($field, array('_price', '_regular_price', '_sale_price')) && !empty($ccr) && isset($ccr[$field][$currency]) ){
374
- $price_original = get_post_meta($original_object_id, $field, true);
375
- $price = $price_original * $ccr[$field][$currency];
376
- } else {
377
- $manual_prices = $woocommerce_wpml->multi_currency->custom_prices->get_product_custom_prices($id, $currency);
378
- if($manual_prices && !empty($manual_prices[$field])){
379
- $price = $manual_prices[$field];
380
- } else {
381
- // 2. automatic conversion
382
- $price = get_post_meta($id, $field, true);
383
- $price = apply_filters('wcml_raw_price_amount', $price, $currency );
384
- }
385
- }
386
-
387
- if ( $price != '') {
388
- $price = wc_price($price, array('currency' => $currency));
389
- }
390
- } else {
391
- // For variable products _regular_price, _sale_price are not defined
392
- // ..however are most likely used together. So in case of _regular_price display the range,
393
- // ..but do not deal with _sale_price at all
394
- if ( $p->is_type('variable') && !in_array($field, array('_sale_price')) ) {
395
- $price = $p->get_price_html();
396
- } else {
397
- switch ($field) {
398
- case '_regular_price':
399
- $price = $p->get_regular_price();
400
- break;
401
- case '_sale_price':
402
- $price = $p->get_sale_price();
403
- break;
404
- case '_tax_price':
405
- $price = $p->get_price_including_tax();
406
- break;
407
- default:
408
- $price = $p->get_price();
409
- break;
410
- }
411
- if ( $price != '' ) {
412
- if ($currency != '')
413
- $price = wc_price($price, array('currency' => $currency));
414
- else
415
- $price = wc_price($price);
416
- }
417
- }
418
- }
419
-
420
- return $price;
421
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
 
423
  /**
424
  * Helper method to be used before printing the font styles. Converts font families to apostrophed versions.
@@ -442,5 +539,329 @@ if (!class_exists("ASL_Helpers")) {
442
  return $font;
443
  }
444
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
445
  }
446
  }
15
  */
16
  class ASL_Helpers {
17
 
18
+ public static function addInlineScript($handle, $object_name, $data, $position = 'before') {
19
+ // Taken from WP_Srcripts -> localize
20
+ foreach ( (array) $data as $key => $value ) {
21
+ if ( ! is_scalar( $value ) ) {
22
+ continue;
23
+ }
24
+ $data[ $key ] = html_entity_decode( (string) $value, ENT_QUOTES, 'UTF-8' );
25
+ }
26
+ $script = "var $object_name = " . wp_json_encode( $data ) . ';';
27
+
28
+ wp_add_inline_script($handle, $script, $position);
29
+ }
30
+
31
+ /**
32
+ * Prepares the headers for the ajax request
33
+ *
34
+ * @param string $content_type
35
+ */
36
+ public static function prepareAjaxHeaders($content_type = 'text/plain') {
37
+ if ( !headers_sent() ) {
38
+ header('Content-Type: ' . $content_type);
39
+ }
40
+ }
41
+
42
  /**
43
  * Performs a safe sanitation and escape for strings and numeric values in LIKE type queries.
44
  * This is not to be used on whole queries, only values.
238
  return implode($replace, explode($find, $subject, 2));
239
  }
240
 
241
+ public static function fixSSLURLs($string) {
242
+ if ( ASL_SITE_IS_PROBABLY_SSL ) {
243
+ return str_replace('http://', 'https://', $string);
244
+ }
245
+ return $string;
246
+ }
247
+
248
  public static function resolveBracketSyntax( $content, $fields = array(), $empty_on_missing = false ) {
249
 
250
  if ( empty($fields) )
312
  return $ret;
313
  }
314
 
315
+ /**
316
+ * Gets the custom field value, supporting ACF get_field() and WooCommerce multi currency
317
+ *
318
+ * @see ASL_Helpers::woo_formattedPriceWithCurrency() To get the currency formatted field.
319
+ * @see get_field() ACF post meta parsing.
320
+ * @since 4.11
321
+ *
322
+ * @param string $field Custom field label
323
+ * @param object $r Result object
324
+ * @param bool $use_acf If true, will use the get_field() function from ACF
325
+ * @param array $args Search arguments
326
+ * @param array $field_args Additional field arguments
327
+ * @return string
328
+ */
329
+ public static function getCFValue($field, $r, $use_acf = false, $args = array(), $field_args = array()) {
330
+ $ret = '';
331
+ $price_fields = array('_price', '_price_html', '_tax_price', '_sale_price', '_regular_price');
332
+ $datetime_fields = array('_EventStartDate', '_EventStartDateUTC', '_EventEndDate', '_EventEndDateUTC',
333
+ '_event_start_date', '_event_end_date', '_event_start', '_event_end', '_event_start_local', '_event_end_local');
334
+
335
+ if( ( in_array($field, $datetime_fields) || isset($field_args['date_format']) ) && isset($r->post_type) ) {
336
+ $mykey_values = get_post_custom_values($field, $r->id);
337
+ if (isset($mykey_values[0])) {
338
+ if ( isset($field_args['date_format']) ) {
339
+ $ret = date_i18n( $field_args['date_format'], strtotime( $mykey_values[0] ) );
340
+ } else {
341
+ $ret = date_i18n( get_option( 'date_format' ), strtotime( $mykey_values[0] ) );
342
+ }
343
+ }
344
+ } else if ( in_array($field, $price_fields) &&
345
+ isset($r->post_type) &&
346
+ in_array($r->post_type, array('product', 'product_variation')) &&
347
+ function_exists('wc_get_product')
348
+ ) { // Is this a WooCommerce price related field?
349
+ $ret = ASL_Helpers::woo_formattedPriceWithCurrency($r->id, $field, $args);
350
+ } else { // ..or just a regular field?
351
+ if ( $use_acf && function_exists('get_field') ) {
352
+ $mykey_values = get_field($field, $r->id, true);
353
+ if ( !is_null($mykey_values) && $mykey_values != '' && $mykey_values !== false ) {
354
+ if ( is_array($mykey_values) ) {
355
+ if ( count($mykey_values) > 0 && isset($mykey_values[0]) ) {
356
+ // Field display mode as Array (both label and value)
357
+ if ( isset($mykey_values[0]['label']) ) {
358
+ $labels = array();
359
+ foreach ( $mykey_values as $choice ) {
360
+ if ( isset($choice['label']) )
361
+ $labels[] = $choice['label'];
362
+ }
363
+ if ( count($labels) > 0 )
364
+ $ret = implode(', ', $labels);
365
+ // Make sure this is not some sort of a repeater or reference
366
+ } else if ( !is_object($mykey_values[0]) ) {
367
+ $ret = implode(', ', $mykey_values);
368
+ }
369
+ }
370
+ } else {
371
+ $ret = $mykey_values;
372
+ }
373
+ }
374
+ } else {
375
+ $mykey_values = get_post_custom_values($field, $r->id);
376
+ if ( isset($mykey_values[0]) ) {
377
+ $ret = wd_array_to_string( maybe_unserialize( $mykey_values[0] ) );
378
+ }
379
+ }
380
+ }
381
+
382
+ return $ret;
383
+ }
384
+
385
+ /**
386
+ * Gets the WooCommerce formatted currency, supporting multiple currencies WPML, WCML
387
+ *
388
+ * @since 4.11
389
+ * @see wc_get_product() Getting the WooCommerce product.
390
+ * @see $woocommerce_wpml->multi_currency->prices->get_product_price_in_currency() For multi currency parsing.
391
+ * @see wc_price() Price formatting.
392
+ *
393
+ * @param int $id Product or variation ID
394
+ * @param string $field Field label
395
+ * @param array $args Search arguments
396
+ * @return string
397
+ */
398
+ public static function woo_formattedPriceWithCurrency($id, $field, $args) {
399
+ global $woocommerce_wpml;
400
+ global $sitepress;
401
+
402
+ $currency = isset($args['woo_currency']) ?
403
+ $args['woo_currency'] :
404
+ (function_exists('get_woocommerce_currency') ?
405
+ get_woocommerce_currency() : '');
406
+
407
+ $price = '';
408
+ $p = wc_get_product( $id );
409
+
410
+ // WCML Section, copied and modified from
411
+ // ..\wp-content\plugins\wpml-woocommerce\inc\currencies\class-wcml-multi-currency-prices.php
412
+ // line 139, function product_price_filter(..)
413
+ if ( isset($sitepress, $woocommerce_wpml, $woocommerce_wpml->multi_currency) ) {
414
+ $original_object_id = apply_filters( 'translate_object_id', $id, get_post_type($id), false, $sitepress->get_default_language() );
415
+ $ccr = get_post_meta($original_object_id, '_custom_conversion_rate', true);
416
+ if( in_array($field, array('_price', '_regular_price', '_sale_price', '_price_html')) && !empty($ccr) && isset($ccr[$field][$currency]) ){
417
+ if ( $field == '_price_html' ) {
418
+ $field = '_price';
419
+ }
420
+ $price_original = get_post_meta($original_object_id, $field, true);
421
+ $price = $price_original * $ccr[$field][$currency];
422
+ } else {
423
+ $manual_prices = $woocommerce_wpml->multi_currency->custom_prices->get_product_custom_prices($id, $currency);
424
+ if ( $field == '_price_html' ) {
425
+ $field = '_price';
426
+ }
427
+ if( $manual_prices && !empty($manual_prices[$field]) ){
428
+ $price = $manual_prices[$field];
429
+ } else {
430
+ // 2. automatic conversion
431
+ $price = get_post_meta($id, $field, true);
432
+ $price = apply_filters('wcml_raw_price_amount', $price, $currency );
433
+ }
434
+ }
435
+
436
+ if ( $price != '') {
437
+ $price = wc_price($price, array('currency' => $currency));
438
+ }
439
+ } else {
440
+ // For variable products _regular_price, _sale_price are not defined
441
+ // ..however are most likely used together. So in case of _regular_price display the range,
442
+ // ..but do not deal with _sale_price at all
443
+ if ( $p->is_type('variable') && !in_array($field, array('_sale_price')) ) {
444
+ $price = $p->get_price_html();
445
+ } else {
446
+ switch ($field) {
447
+ case '_regular_price':
448
+ $price = $p->get_regular_price();
449
+ break;
450
+ case '_sale_price':
451
+ $price = $p->get_sale_price();
452
+ break;
453
+ case '_tax_price':
454
+ $price = $p->get_price_including_tax();
455
+ break;
456
+ case '_price_html':
457
+ $price = $p->get_price_html();
458
+ break;
459
+ default:
460
+ $price = $p->get_price();
461
+ break;
462
+ }
463
+ if ( $field != '_price_html' && $price != '' ) {
464
+ if ($currency != '')
465
+ $price = wc_price($price, array('currency' => $currency));
466
+ else
467
+ $price = wc_price($price);
468
+ }
469
+ }
470
+ }
471
+
472
+ return $price;
473
+ }
474
+
475
+ /**
476
+ * Gets the PODs field value
477
+ *
478
+ * @param string $field field name
479
+ * @param object $r object
480
+ * @return string
481
+ */
482
+ public static function getPODsValue($field, $r) {
483
+ $values = '';
484
+ if ( strpos($field, '_pods_') !== false && isset($r->id, $r->post_type) ) {
485
+ $field = str_replace('_pods_', '', $field);
486
+ if ( function_exists('pods') ) {
487
+ $p = pods($r->post_type, $r->id);
488
+ if ( is_object($p) ) {
489
+ $values = $p->field($field, false);
490
+ }
491
+ }
492
+ }
493
+ return wd_array_to_string( $values );
494
+ }
495
+
496
+ /**
497
+ * Gets a list of taxonomy terms, separated by a comma (or as defined)
498
+ *
499
+ * @param $taxonomy
500
+ * @param int $count
501
+ * @param string $separator
502
+ * @param array $args arguments passed to get_terms() or wp_get_post_terms() functions
503
+ * @return string
504
+ */
505
+ public static function getTermsList($taxonomy, $count = 5, $separator = ', ', $args = array()){
506
+ // Additional keys
507
+ $args = array_merge($args, array(
508
+ 'taxonomy' => $taxonomy,
509
+ 'fields' => 'names',
510
+ 'number' => $count
511
+ ));
512
+ $terms = wpd_get_terms($args);
513
+ if ( !is_wp_error($terms) && !empty($terms) ) {
514
+ return implode($separator, $terms);
515
+ } else {
516
+ return '';
517
+ }
518
+ }
519
 
520
  /**
521
  * Helper method to be used before printing the font styles. Converts font families to apostrophed versions.
539
  return $font;
540
  }
541
  }
542
+
543
+ /**
544
+ * Translates search data and $_POST options to query arguments to use with ASL_Query
545
+ *
546
+ * @param $search_id
547
+ * @param $o
548
+ * @return mixed
549
+ */
550
+ public static function toQueryArgs($search_id, $o, $args = array()) {
551
+ global $wpdb;
552
+ // When $o is (bool)false, then this is called individually, not as ajax request
553
+
554
+ // Always return an emtpy array if something goes wrong
555
+ if ( !wd_asl()->instances->exists($search_id) )
556
+ return array();
557
+
558
+ $search = wd_asl()->instances->get(0);
559
+ $sd = $search['data'];
560
+
561
+ $args = empty($args) ? ASL_Query::$defaults : array_merge(ASL_Query::$defaults, $args);
562
+ $comp_options = wd_asl()->o['asl_compatibility'];
563
+
564
+ $exclude_post_ids = array_unique(explode(',', str_replace(' ', '', $sd['excludeposts'])));
565
+ foreach ( $exclude_post_ids as $k=>$v) {
566
+ if ($v == '') {
567
+ unset($exclude_post_ids[$k]);
568
+ } else {
569
+ $exclude_post_ids[$k] = intval($v);
570
+ }
571
+ }
572
+
573
+ // ----------------------------------------------------------------
574
+ // 1. CPT
575
+ // ----------------------------------------------------------------
576
+ $args = array_merge($args, array(
577
+ "_sd" => $sd, // Search Data
578
+ '_sid' => 0,
579
+ "keyword_logic" => $sd['keyword_logic'],
580
+ 'secondary_logic' => 'none',
581
+ "post_not_in" => $exclude_post_ids,
582
+ "post_in" => array(),
583
+ "post_primary_order" => $sd['orderby_primary'],
584
+ "post_secondary_order" => $sd['orderby_secondary'],
585
+ '_db_force_case' => $comp_options['db_force_case'],
586
+ '_db_force_utf8_like' => $comp_options['db_force_utf8_like'],
587
+ '_db_force_unicode' => $comp_options['db_force_unicode'],
588
+ // LIMITS
589
+ 'posts_limit' => $sd['maxresults']
590
+ ));
591
+ $args["_qtranslate_lang"] = isset($o['qtranslate_lang'])?$o['qtranslate_lang']:"";
592
+ if ( !$args["_ajax_search"] && function_exists("pll_current_language") ) {
593
+ $args["_polylang_lang"] = pll_current_language();
594
+ } else {
595
+ $args["_polylang_lang"] = $sd['polylang_compatibility'] == 1 && isset($o['polylang_lang']) ? $o['polylang_lang'] : "";
596
+ }
597
+ $args["_exact_matches"] = isset($o['asl_gen']) && is_array($o['asl_gen']) && in_array('exact', $o['asl_gen']) ? 1 : 0;
598
+ $args["_exact_match_location"] = $sd['exact_match_location'];
599
+
600
+ /*----------------------- Meta key order ------------------------*/
601
+ if ( strpos($sd['orderby_primary'], 'customfp') !== false ) {
602
+ if ( !empty($sd['orderby_primary_cf']) ) {
603
+ $args['_post_primary_order_metakey'] = $sd['orderby_primary_cf'];
604
+ $args['post_primary_order_metatype'] = $sd['orderby_primary_cf_type'];
605
+ }
606
+ }
607
+ if ( strpos($sd['orderby_secondary'], 'customfs') !== false ) {
608
+ if ( !empty($sd['orderby_secondary_cf']) ) {
609
+ $args['_post_secondary_order_metakey'] = $sd['orderby_secondary_cf'];
610
+ $args['post_secondary_order_metatype'] = $sd['orderby_secondary_cf_type'];
611
+ }
612
+ }
613
+
614
+ /*----------------------- Auto populate -------------------------*/
615
+ if ( isset($o['force_count']) ) {
616
+ // Set the advanced limit parameter to be distributed later
617
+ $args['limit'] = $o['force_count'] + 0;
618
+ $args['force_count'] = $o['force_count'] + 0;
619
+ }
620
+ if ( isset($o['force_order']) ) {
621
+ if ( $o['force_order'] == 1 ) {
622
+ $args["post_primary_order"] = "post_date DESC";
623
+ $args['force_order'] = 1;
624
+ } else if ( $o['force_order'] == 2 ) {
625
+ $args["post_primary_order"] = "RAND()";
626
+ $args['force_order'] = 2;
627
+ }
628
+ }
629
+
630
+ /*------------------------- Statuses ----------------------------*/
631
+ $args['post_status'] = explode(',', str_replace(' ', '', $sd['post_status']));
632
+
633
+ /*--------------------- Password protected ----------------------*/
634
+ $args['has_password'] = $sd['post_password_protected'] == 1;
635
+
636
+ /*----------------------- Gather Types --------------------------*/
637
+ $args['post_type'] = array();
638
+ if ($o === false) {
639
+ // exclude_cpt in PRO
640
+ /*if ( in_array('page', $sd['customtypes']) ) {
641
+ if ( count($sd['exclude_cpt']['parent_ids']) > 0 )
642
+ $args['_exclude_page_parent_child'] = implode(',', $sd['exclude_cpt']['parent_ids']);
643
+ }*/
644
+ if ( isset( $sd['customtypes'] ) && is_array($sd['customtypes']) && count( $sd['customtypes'] ) > 0 )
645
+ $args['post_type'] = array_merge( $args['post_type'], $sd['customtypes'] );
646
+ } else {
647
+ if ( isset( $o['customset'] ) && is_array($o['customset']) && count( $o['customset'] ) > 0 ) {
648
+ $o['customset'] = self::escape( $o['customset'], true, ' ;:.,(){}@[]!?&|#^=' );
649
+ $args['post_type'] = array_merge($args['post_type'], $o['customset']);
650
+ }
651
+ // exclude_cpt in PRO
652
+ /*foreach ( $args['post_type'] as $kk => $vv) {
653
+ if ( $vv == "page" && count($sd['exclude_cpt']['parent_ids']) > 0 ) {
654
+ $args['_exclude_page_parent_child'] = implode(',', $sd['exclude_cpt']['parent_ids']);
655
+ //unset($args['post_type'][$kk]);
656
+ break;
657
+ }
658
+ }*/
659
+ }
660
+
661
+ /*--------------------- OTHER FILTER RELATED --------------------*/
662
+ $args['filters_changed'] = isset($o['filters_changed']) ? $o['filters_changed'] == 1 : $args['filters_changed'];
663
+ $args['filters_initial'] = isset($o['filters_initial']) ? $o['filters_initial'] == 1 : $args['filters_initial'];
664
+
665
+ /*--------------------- GENERAL FIELDS --------------------------*/
666
+ $args['search_type'] = array();
667
+ $args['post_fields'] = array();
668
+ if ($sd['searchinterms'] == 1)
669
+ $args['post_fields'][] = "terms";
670
+ if ($o === false) {
671
+ if ( $sd['searchintitle'] == 1 ) $args['post_fields'][] = 'title';
672
+ if ( $sd['searchincontent'] == 1 ) $args['post_fields'][] = 'content';
673
+ if ( $sd['searchinexcerpt'] == 1 ) $args['post_fields'][] = 'excerpt';
674
+ } else {
675
+ if ( isset($o['asl_gen']) && is_array($o['asl_gen']) ) {
676
+ if (in_array('title', $o['asl_gen'])) $args['post_fields'][] = 'title';
677
+ if (in_array('content', $o['asl_gen'])) $args['post_fields'][] = 'content';
678
+ if (in_array('excerpt', $o['asl_gen'])) $args['post_fields'][] = 'excerpt';
679
+ }
680
+ }
681
+ if ( $sd['search_in_ids'] ) $args['post_fields'][] = "ids";
682
+ if ( $sd['search_in_permalinks'] ) $args['post_fields'][] = "permalink";
683
+
684
+ /*--------------------- CUSTOM FIELDS ---------------------------*/
685
+ $args['post_custom_fields_all'] = $sd['search_all_cf'];
686
+ $args['post_custom_fields'] = isset($sd['selected-customfields']) ? $sd['selected-customfields'] : array();
687
+
688
+ if ( count($args['post_fields']) > 0 ||
689
+ $args['post_custom_fields_all'] == 1 ||
690
+ count($args['post_custom_fields']) > 0 ||
691
+ count($args['post_type']) > 0
692
+ )
693
+ $args['search_type'][] = "cpt";
694
+
695
+ /*-------------------------- WPML -------------------------------*/
696
+ if ( $sd['wpml_compatibility'] == 1 ) {
697
+ if ( isset( $o['wpml_lang'] ) && $args['_ajax_search'] )
698
+ $args['_wpml_lang'] = $o['wpml_lang'];
699
+ elseif (
700
+ defined('ICL_LANGUAGE_CODE')
701
+ && ICL_LANGUAGE_CODE != ''
702
+ && defined('ICL_SITEPRESS_VERSION')
703
+ )
704
+ $args['_wpml_lang'] = ICL_LANGUAGE_CODE;
705
+
706
+ /**
707
+ * Switching the language will resolve issues with get_terms(..) and other functions
708
+ * Otherwise wrong taxonomy terms would be returned etc..
709
+ */
710
+ global $sitepress;
711
+ if ( is_object($sitepress) && method_exists($sitepress, 'switch_lang') ) {
712
+ $sitepress->switch_lang($args['_wpml_lang']);
713
+ }
714
+ }
715
+
716
+ /*-------------------- Content, Excerpt -------------------------*/
717
+ $args['_post_get_content'] = $sd['showdescription'] == 1;
718
+ $args['_post_get_excerpt'] = (
719
+ $sd['primary_titlefield'] == 1 ||
720
+ $sd['secondary_titlefield'] == 1 ||
721
+ $sd['primary_descriptionfield'] == 1 ||
722
+ $sd['secondary_descriptionfield'] == 1
723
+ );
724
+
725
+ // WooCommerce - Exclude out of stock
726
+ if ( $sd['woo_exclude_outofstock'] == 1 ) {
727
+ $args['post_meta_filter'][] = array(
728
+ 'key' => '_stock_status',
729
+ 'value' => 'instock',
730
+ 'operator' => 'ELIKE',
731
+ 'allow_missing' => true
732
+ );
733
+ }
734
+
735
+ /*---------------------- Taxonomy Terms -------------------------*/
736
+ $args['post_tax_filter'] = self::toQueryArgs_Taxonomies($sd, $o);
737
+
738
+ // Woocommerce - Excluded catalogue or search products, when variations are selected
739
+ if (
740
+ in_array('product_variation', $args['post_type']) &&
741
+ wd_in_array_r('product_visibility', $args['post_tax_filter'])
742
+ ) {
743
+ foreach ( $args['post_tax_filter'] as $filter => $items ) {
744
+ if ( $items['taxonomy'] == 'product_visibility' && count($items['exclude']) > 0 ) {
745
+ $product_ids = get_posts(array(
746
+ 'post_type' => 'product',
747
+ 'numberposts' => 250,
748
+ 'tax_query' => array(
749
+ array(
750
+ 'taxonomy' => 'product_visibility',
751
+ 'field' => 'id',
752
+ 'terms' => $items['exclude'],
753
+ 'operator' => 'IN'
754
+ ),
755
+ ),
756
+ 'fields' => 'ids' // Only get post IDs
757
+ ));
758
+ if ( !is_wp_error($product_ids) && !empty($product_ids) ) {
759
+ $args['post_parent_exclude'] = array_unique( array_merge($args['post_parent_exclude'], $product_ids) );
760
+ }
761
+ break;
762
+ }
763
+ }
764
+ }
765
+
766
+ // ----------------------------------------------------------------
767
+ // X. MISC FIXES
768
+ // ----------------------------------------------------------------
769
+ $args["woo_currency"] = isset($o['woo_currency']) ? $o['woo_currency'] : ( function_exists('get_woocommerce_currency') ? get_woocommerce_currency() : '' );
770
+ $args['_page_id'] = isset($o['current_page_id']) ? $o['current_page_id'] : $args['_page_id'];
771
+ // Reset search type and post types for WooCommerce search results page
772
+ if ( isset($_GET['post_type']) && $_GET['post_type'] == "product") {
773
+ $old_ptype = $args['post_type'];
774
+ $args['post_type'] = array();
775
+ if ( in_array("product", $old_ptype) ) {
776
+ $args['post_type'][] = "product";
777
+ }
778
+ if ( in_array("product_variation", $old_ptype) ) {
779
+ $args['post_type'][] = "product_variation";
780
+ }
781
+ }
782
+ // ----------------------------------------------------------------
783
+ return $args;
784
+ }
785
+
786
+ /**
787
+ * Converts search data and options to Taxonomy Term query argument arrays to use with ASL_Query
788
+ *
789
+ * @param $sd
790
+ * @param $o
791
+ * @return array
792
+ */
793
+ private static function toQueryArgs_Taxonomies($sd, $o) {
794
+ $ret = array();
795
+
796
+ $term_logic = 'and';
797
+
798
+ $exclude_categories = array();
799
+ $sd['selected-exsearchincategories'] = w_isset_def( $sd['selected-exsearchincategories'], array() );
800
+ $sd['selected-excludecategories'] = w_isset_def( $sd['selected-excludecategories'], array() );
801
+
802
+ if ( count( $sd['selected-exsearchincategories'] ) > 0 ||
803
+ count( $sd['selected-excludecategories'] ) > 0 ||
804
+ (isset($o['categoryset']) && count( $o['categoryset'] )) > 0 ||
805
+ $sd['showsearchincategories'] == 1
806
+ ) {
807
+
808
+ // If the category settings are invisible, ignore the excluded frontend categories, reset to empty array
809
+ if ( $sd['showsearchincategories'] == 0 ) {
810
+ $sd['selected-exsearchincategories'] = array();
811
+ }
812
+
813
+ $_all_cat = get_terms( array( 'taxonomy' => 'category', 'fields' => 'ids' ) );
814
+ $_needed_cat = array_diff( $_all_cat, $sd['selected-exsearchincategories'] );
815
+ $_needed_cat = ! is_array( $_needed_cat ) ? array() : $_needed_cat;
816
+
817
+ if ( $sd['showsearchincategories'] == 1 && isset($o['categoryset']) ) // If the settings is visible, count for the options
818
+ {
819
+ $exclude_categories = array_diff( array_merge( $_needed_cat, $sd['selected-excludecategories'] ), $o['categoryset'] );
820
+ } else // ..if the settings is not visible, then only the excluded categories count
821
+ {
822
+ $exclude_categories = $sd['selected-excludecategories'];
823
+ }
824
+ }
825
+ $exclude_terms = array();
826
+ $exclude_terms = array_unique( array_merge( $exclude_categories, $exclude_terms ) );
827
+ if ( count($exclude_terms) > 0 ) {
828
+ $ret[] = array(
829
+ 'taxonomy' => 'category',
830
+ 'include' => array(),
831
+ 'exclude' => $exclude_terms,
832
+ 'logic' => $term_logic,
833
+ '_termset' => isset($o['categoryset']) ? $o['categoryset'] : array(),
834
+ '_is_checkbox' => true
835
+ );
836
+ }
837
+
838
+ // Woocommerce - Exclude hidden and catalog
839
+ if ( class_exists('WooCommerce') && ( $sd['exclude_woo_hidden'] == 1 || $sd['exclude_woo_catalog'] == 1 ) ) {
840
+ // Check if this is version > 3.0
841
+ if ( asl_woo_version_check('3.0') ) {
842
+ $exclude = array();
843
+ if ( $sd['exclude_woo_hidden'] == 1 )
844
+ $exclude[] = 'exclude-from-search';
845
+ if ( $sd['exclude_woo_catalog'] == 1 )
846
+ $exclude[] = 'exclude-from-catalog';
847
+ $_t = get_terms(array(
848
+ 'slug' => $exclude,
849
+ 'hide_empty' => 0,
850
+ 'fields' => 'ids'
851
+ ));
852
+
853
+ if ( !is_wp_error($_t) && count($_t) > 0) {
854
+ $ret[] = array(
855
+ 'taxonomy' => 'product_visibility',
856
+ 'exclude' => $_t,
857
+ 'allow_empty' => true
858
+ );
859
+ }
860
+ }
861
+ }
862
+
863
+ return $ret;
864
+ }
865
+
866
  }
867
  }
includes/classes/filters/class-asl-etc_fixes.php CHANGED
@@ -44,6 +44,25 @@ if (!class_exists("WD_ASL_EtcFixes_Filter")) {
44
  return false;
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  // ------------------------------------------------------------
48
  // ---------------- SINGLETON SPECIFIC --------------------
49
  // ------------------------------------------------------------
44
  return false;
45
  }
46
 
47
+
48
+ /**
49
+ * Exclude all plugin frontend scripts from WP Rocket defer cache to prevent scope issues
50
+ *
51
+ * @param $exclude_defer_js
52
+ * @return array
53
+ */
54
+ function wp_rocket_exclude_defer_js($exclude_defer_js ) {
55
+ if ( is_array($exclude_defer_js) ) {
56
+ $exclude = array(
57
+ '/ajax-search-lite/js/',
58
+ '/ajax-search-lite/js/*'
59
+ );
60
+ return array_merge($exclude_defer_js, $exclude);
61
+ } else {
62
+ return $exclude_defer_js;
63
+ }
64
+ }
65
+
66
  // ------------------------------------------------------------
67
  // ---------------- SINGLETON SPECIFIC --------------------
68
  // ------------------------------------------------------------
includes/classes/filters/class-asl-searchoverride.php CHANGED
@@ -41,17 +41,22 @@ if (!class_exists("WD_ASL_SearchOverride_Filter")) {
41
  $s_data = $checkOverride[1];
42
  }
43
 
 
 
44
 
45
- $_POST['options'] = $s_data;
46
  $_POST['options']['non_ajax_search'] = true;
47
  $_POST['aslp'] = $_GET['s'];
48
- $_POST['asl_get_as_array'] = 1;
49
 
50
  // Additional arguments and filters
51
- add_filter('asl_query_add_args', array($this, 'addAdditionalArgs'), 10, 1);
52
 
53
- $o = WD_ASL_Search_Handler::getInstance();
54
- $res = $o->handle( true );
 
 
 
55
 
56
  if ( isset($_GET['paged']) ) {
57
  $paged = $_GET['paged'];
@@ -60,28 +65,33 @@ if (!class_exists("WD_ASL_SearchOverride_Filter")) {
60
  } else {
61
  $paged = 1;
62
  }
63
-
64
  $paged = $paged <= 0 ? 1 : $paged;
65
 
66
- $inst = wd_asl()->instances->get(0);
67
- $sd = $inst['data'];
68
-
69
- $posts_per_page = $sd['results_per_page'];
70
- $posts_per_page = $posts_per_page == 0 ? 1 : $posts_per_page;
 
 
71
 
72
- // Get and convert the results needed
73
- $n_posts = asl_results_to_wp_obj( $res, ( $paged - 1 ) * $posts_per_page, $posts_per_page );
 
 
 
74
 
75
  $wp_query->found_posts = count($res);
 
76
  if (($wp_query->found_posts / $posts_per_page) > 1)
77
  $wp_query->max_num_pages = ceil($wp_query->found_posts / $posts_per_page);
78
  else
79
  $wp_query->max_num_pages = 0;
80
 
81
- return $n_posts;
82
  }
83
 
84
- public function addAdditionalArgs( $args ) {
85
  global $wpdb;
86
 
87
  // Separate case for WooCommerce
@@ -192,29 +202,22 @@ if (!class_exists("WD_ASL_SearchOverride_Filter")) {
192
  * @param WP_Query() $wp_query The instance of WP_Query() for this query
193
  * @return array|bool
194
  */
195
- public function checkSearchOverride($check_only = true, $wp_query) {
196
- // Is this a search query? Has the override been executed?
197
- // Is this the admin area?
198
- // !isset() instead of empty(), because it can be an empty string
199
- if (
200
- isset($wp_query) && (
201
- !$wp_query->is_main_query() ||
202
- !isset($wp_query->query_vars['s']) ||
203
- !isset($_GET['s'])
204
- )
205
- ) {
206
- return false;
207
- }
208
- // Is this the admin area?
209
- if ( is_admin() )
210
- return false;
211
 
212
  // If get method is used, then the cookies are not present
213
  if (isset($_GET['p_asl_data']) || isset($_GET['np_asl_data'])) {
214
  if ( $check_only )
215
  return true;
216
  $_p_data = isset($_GET['p_asl_data']) ? $_GET['p_asl_data'] : $_GET['np_asl_data'];
217
- parse_str(base64_decode($_p_data), $s_data);
 
 
 
 
218
 
219
  /**
220
  * At this point the asl_data cookie should hold the search data, if not, well then this
@@ -229,6 +232,12 @@ if (!class_exists("WD_ASL_SearchOverride_Filter")) {
229
  parse_str($_COOKIE['asl_data'], $s_data);
230
  $_POST['np_asl_data'] = $_COOKIE['asl_data'];
231
  } else {
 
 
 
 
 
 
232
  // Something is not right
233
  return false;
234
  }
@@ -236,6 +245,48 @@ if (!class_exists("WD_ASL_SearchOverride_Filter")) {
236
  return array(1, $s_data);
237
  }
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  public function fixUrls( $url, $post ) {
240
  if (isset($post->asl_guid))
241
  return $post->asl_guid;
41
  $s_data = $checkOverride[1];
42
  }
43
 
44
+ $inst = wd_asl()->instances->get(0);
45
+ $sd = $inst['data'];
46
 
47
+ /*$_POST['options'] = $s_data;
48
  $_POST['options']['non_ajax_search'] = true;
49
  $_POST['aslp'] = $_GET['s'];
50
+ $_POST['asl_get_as_array'] = 1;*/
51
 
52
  // Additional arguments and filters
53
+ //add_filter('asl_query_add_args', array($this, 'getAdditionalArgs'), 10, 1);
54
 
55
+ $posts_per_page = $sd['results_per_page'];
56
+ if ( $posts_per_page == 'auto' ) {
57
+ $posts_per_page = get_option( 'posts_per_page' );
58
+ }
59
+ $posts_per_page = $posts_per_page == 0 ? 1 : $posts_per_page;
60
 
61
  if ( isset($_GET['paged']) ) {
62
  $paged = $_GET['paged'];
65
  } else {
66
  $paged = 1;
67
  }
 
68
  $paged = $paged <= 0 ? 1 : $paged;
69
 
70
+ $args = array(
71
+ "s" => $_GET['s'],
72
+ "_ajax_search" => false,
73
+ "posts_per_page" => $posts_per_page,
74
+ "page" => $paged
75
+ );
76
+ $args = self::getAdditionalArgs($args);
77
 
78
+ if ( count($s_data) == 0 )
79
+ $asl_query = new ASL_Query($args, 0);
80
+ else
81
+ $asl_query = new ASL_Query($args, 0, $s_data);
82
+ $res = $asl_query->posts;
83
 
84
  $wp_query->found_posts = count($res);
85
+
86
  if (($wp_query->found_posts / $posts_per_page) > 1)
87
  $wp_query->max_num_pages = ceil($wp_query->found_posts / $posts_per_page);
88
  else
89
  $wp_query->max_num_pages = 0;
90
 
91
+ return $res;
92
  }
93
 
94
+ public function getAdditionalArgs( $args ) {
95
  global $wpdb;
96
 
97
  // Separate case for WooCommerce
202
  * @param WP_Query() $wp_query The instance of WP_Query() for this query
203
  * @return array|bool
204
  */
205
+ public function checkSearchOverride($check_only, $wp_query) {
206
+ // Check the search query
207
+ if ( !$this->isSearch($wp_query) ) {
208
+ return false;
209
+ }
 
 
 
 
 
 
 
 
 
 
 
210
 
211
  // If get method is used, then the cookies are not present
212
  if (isset($_GET['p_asl_data']) || isset($_GET['np_asl_data'])) {
213
  if ( $check_only )
214
  return true;
215
  $_p_data = isset($_GET['p_asl_data']) ? $_GET['p_asl_data'] : $_GET['np_asl_data'];
216
+ if ( $_p_data == 1 ) {
217
+ $s_data = $_GET;
218
+ } else {
219
+ parse_str(base64_decode($_p_data), $s_data);
220
+ }
221
 
222
  /**
223
  * At this point the asl_data cookie should hold the search data, if not, well then this
232
  parse_str($_COOKIE['asl_data'], $s_data);
233
  $_POST['np_asl_data'] = $_COOKIE['asl_data'];
234
  } else {
235
+ $sd = wd_asl()->instances->get(0)['data'];
236
+ // Probably the search results page visited via URL, not triggered via search bar
237
+ if ( $sd['override_default_results'] ) {
238
+ return array(1, array());
239
+ }
240
+
241
  // Something is not right
242
  return false;
243
  }
245
  return array(1, $s_data);
246
  }
247
 
248
+ public function isSearch($wp_query) {
249
+ $is_search = true;
250
+ $soft_check = defined('ELEMENTOR_VERSION') || wd_asl()->o['asl_compatibility']['query_soft_check'];
251
+
252
+ // This can't be a search query if none of this is set
253
+ if ( !isset($wp_query, $wp_query->query_vars, $_GET['s']) ) {
254
+ $is_search = false;
255
+ } else {
256
+ // Possible candidates for search below
257
+ if ( $soft_check ) {
258
+ // In soft check mode, it does not have to be the main query
259
+ if ( !$wp_query->is_search() ) {
260
+ $is_search = false;
261
+ }
262
+ } else {
263
+ if ( !$wp_query->is_search() || !$wp_query->is_main_query() ) {
264
+ $is_search = false;
265
+ }
266
+ }
267
+ if ( !$is_search && isset($wp_query->query_vars['aps_title']) ) {
268
+ $is_search = true;
269
+ }
270
+ }
271
+
272
+ // GEO directory search, do not override
273
+ if ( $is_search && isset($_GET['geodir_search']) ) {
274
+ $is_search = false;
275
+ }
276
+
277
+ // Elementor or other forced override
278
+ if ( isset($wp_query->query_vars) && $wp_query->query_vars['post_type'] === 'asl_override' ) {
279
+ $is_search = true;
280
+ }
281
+
282
+ // Is this the admin area?
283
+ if ( $is_search && is_admin() )
284
+ $is_search = false;
285
+
286
+ // Possibility to add exceptions
287
+ return apply_filters('asl_query_is_search', $is_search, $wp_query);
288
+ }
289
+
290
  public function fixUrls( $url, $post ) {
291
  if (isset($post->asl_guid))
292
  return $post->asl_guid;
includes/classes/search/class-asl-query.php ADDED
@@ -0,0 +1,601 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Prevent direct access */
3
+ defined('ABSPATH') or die("You can't access this file directly.");
4
+
5
+ if (!class_exists('ASL_Query')) {
6
+ /**
7
+ * Class ASL_Query
8
+ *
9
+ * A similar class to WP_Query
10
+ *
11
+ * @uses ASL_Helpers
12
+ */
13
+ class ASL_Query {
14
+ /*
15
+ * Results array
16
+ */
17
+ public $posts;
18
+
19
+ /**
20
+ * The real results count
21
+ *
22
+ * @var int
23
+ */
24
+ public $found_posts = 0;
25
+
26
+ /**
27
+ * The options passed from the search form, when requested from the front-end
28
+ *
29
+ * @var array
30
+ */
31
+ public $options = array();
32
+
33
+ /**
34
+ * Default query parameter values
35
+ *
36
+ * @var array
37
+ */
38
+ public static $defaults = array(
39
+ // ----------------------------------------------------------------
40
+ // 1. GENERIC arguments
41
+ // ----------------------------------------------------------------
42
+ 's' => '', // search query
43
+ /**
44
+ * @param string|array search_type
45
+ * cpt -> posts, pages, custom post types
46
+ * taxonomies -> tags, categories and taxonomy terms based on taxonomy slug
47
+ * users -> users
48
+ * blogs -> multisite blog titles
49
+ * buddypress -> buddypress groups or activities
50
+ * comments -> comment results
51
+ * attachments -> file attachments
52
+ */
53
+ 'search_type' => 'cpt',
54
+ 'engine' => 'regular', // regular|index -> index only used on cpt
55
+ 'posts_per_page' => 0, // posts per page, for non ajax requests only. If 0, then get_option(posts_per_page) is used
56
+ 'page' => 1, // which page of results, starts from 1
57
+ 'keyword_logic' => 'OR', // OR|AND|OREX|ANDEX
58
+ 'secondary_logic' => '', // OR|AND|OREX|none or empty string
59
+ 'min_word_length' => 0, // Minimum word length of each word to be considered as a standalone word in the phrase (removed if shorter)
60
+ // ----------------------------------------------------------------
61
+
62
+ // ----------------------------------------------------------------
63
+ // 2. POST and CUSTOM POST TYPE related arguments
64
+ // ----------------------------------------------------------------
65
+ 'post_type' => array('post', 'page'), // post types to look for
66
+ 'post_status' => array('publish'), // post statuses
67
+ 'has_password' => false, // password protected
68
+ 'post_fields' => array( // post fields to search within
69
+ // (title, content, excerpt, terms, permalink)
70
+ 'title', 'ids', 'excerpt', 'terms'
71
+ ),
72
+ 'post_custom_fields_all' => 0, // search all custom fields
73
+ 'post_custom_fields' => array(), // ..or search within custom fields
74
+ 'post_in' => array(), // string|array -> limit potential results pool to array of IDs
75
+ 'post_not_in' => array(), // string|array -> explicity exclude IDs from search results
76
+ 'post_not_in2' => array(), // array -> secondary exclusion for manual override
77
+ 'post_parent' => array(), // array -> post parent IDs
78
+ 'post_parent_exclude' => array(), // array -> post parent IDs
79
+ 'post_tax_filter' => array( // taxonomy filter support
80
+ /*
81
+ array(
82
+ 'taxonomy' => 'category', // taxonomy name
83
+ 'include' => array(1, 2, 3, 4), // array of taxonomy term IDs to include
84
+ 'exclude' => array(5, 6, 7, 8), // array of taxonomy term IDs to exclude
85
+ 'allow_empty' => false // allow (empty) items with no connection to any of the taxonomy terms filter
86
+ )
87
+ */
88
+ ),
89
+ 'post_meta_filter' => array( // meta_query support
90
+ /*
91
+ array(
92
+ 'key' => 'age', // meta key
93
+ 'value' => array( 3, 4 ), // int|float|string|array|timestamp|datetime
94
+ // @param string|array compare
95
+ // Numeric Operators
96
+ // '<' -> less than
97
+ // '>' -> more than
98
+ // '<>' -> not equals
99
+ // '=' -> equals
100
+ // 'BETWEEN' -> between two values
101
+ // String Operators
102
+ // 'LIKE'
103
+ // 'NOT LIKE'
104
+ // 'IN'
105
+ 'operator' => 'BETWEEN',
106
+ 'allow_missing' => false // allow match if this custom field is unset
107
+ )
108
+ */
109
+ ),
110
+ 'post_date_filter' => array( // date_query support
111
+ /*
112
+ array(
113
+ 'year' => 2015, // year, month, day ...
114
+ 'month' => 6,
115
+ 'day' => 1,
116
+ 'date' => "2015-06-01", // .. or date parameter in y-m-d format
117
+ 'operator' => 'include', // include|exclude
118
+ 'interval' => 'before' // before|after
119
+ )
120
+ */
121
+ ),
122
+ 'post_user_filter' => array(
123
+ /*
124
+ 'include' => (1, 2, 3, 4), // include by IDs
125
+ 'exclude' => (5, 6, 7, 8) // exclude by IDs
126
+ */
127
+ ),
128
+ 'post_primary_order' => "relevance DESC", // CAN be a custom field name
129
+ 'post_secondary_order' => "post_date DESC",
130
+ 'post_primary_order_metatype' => false, // false (if not meta), 'numeric', 'string'
131
+ 'post_secondary_order_metatype' => false, // false (if not meta), 'numeric', 'string'
132
+ '_post_primary_order_metakey' => false, // gets parsed later, do not touch
133
+ '_post_secondary_order_metakey' => false, // gets parsed later do not touch
134
+ // ADVANCED
135
+ '_post_get_content' => false,
136
+ '_post_get_excerpt' => false,
137
+ '_post_allow_empty_tax_term' => false,
138
+ '_post_use_relevance' => true,
139
+ // Special post tag filtering
140
+ '_post_tags_active' => false,
141
+ '_post_tags_include' => array(),
142
+ '_post_tags_exclude' => array(),
143
+ '_post_tags_logic' => "OR",
144
+ '_post_tags_empty' => 0,
145
+ '_post_meta_logic' => "AND",
146
+ '_post_meta_allow_null' => 0,
147
+ // ----------------------------------------------------------------
148
+
149
+
150
+
151
+ // ----------------------------------------------------------------
152
+ // QUERY FIELDS
153
+ // ----------------------------------------------------------------
154
+ 'cpt_query' => array(
155
+ 'fields' => '',
156
+ 'join' => '',
157
+ 'where' => '',
158
+ 'orderby' => '',
159
+ 'groupby' => ''
160
+ ),
161
+ // ----------------------------------------------------------------
162
+
163
+ /**
164
+ * OTHER ADVANCED ATTRIBUTES
165
+ *
166
+ * Don't use/override these, unless you know what you are doing.
167
+ */
168
+ '_id' => -1,
169
+ '_o' => false,
170
+ // LIMITS
171
+ 'limit' => 0, // overall results limit, if >=0, then evenly distributed between sources
172
+ '_limit' => 0, // calculated limit based on the previous limit parameter
173
+ /**
174
+ * _call_num ->
175
+ * Number of the consecutive ajax requests with the same configuration triggered by
176
+ * clicking on the 'More results..' link
177
+ * This is required to calculate the correct start of the result slicing
178
+ */
179
+ '_call_num' => 0,
180
+ 'posts_limit' => 10,
181
+ 'posts_limit_override' => 50,
182
+ 'posts_limit_distribute' => 0,
183
+
184
+ '_charcount' => 0,
185
+ '_keyword_count_limit' => 6, // Number of words in the search phrase allowed
186
+ '_exact_matches' => false,
187
+ '_exact_match_location' => 'anywhere', // anywhere, start, end
188
+ '_qtranslate_lang' => "en", // qtranslatex language data
189
+ '_wpml_lang' => "", // WPML language
190
+ '_polylang_lang' => "", // Polylang language
191
+ '_exclude_page_parent_child' => "", // parent page exclusion data (comma separated list)
192
+ '_taxonomy_group_logic' => 'AND',
193
+ '_db_force_case' => 'none',
194
+ '_db_force_utf8_like' => 0,
195
+ '_db_force_unicode' => 0,
196
+ '_ajax_search' => false, // Needs to be set explicitly to TRUE in search Ajax Handler class
197
+ '_no_post_process' => false, // Forcefully turns off post-processing to return RAW results
198
+
199
+ /**
200
+ * Other stuff
201
+ */
202
+ '_page_id' => 0, // Current Page ID
203
+ /**
204
+ * Remaining Limit Modifier
205
+ * This is used mostly for more results overall limit.
206
+ * Overall Limit = LIMIT * _remaining_limit_mod
207
+ */
208
+ '_remaining_limit_mod' => 10,
209
+ '_show_more_results' => false, // Show more results feature enabled (only used via ajax search instance)
210
+ 'filters_changed' => false, // Only via AJAX - if the filters have been touched by the user
211
+ 'filters_initial' => true // Only via AJAX - if the filters are on the initial state
212
+ );
213
+
214
+ /*
215
+ * Array of phrases of all synonym variations
216
+ */
217
+ private $finalPhrases = array();
218
+
219
+ /*
220
+ * Constructor args
221
+ */
222
+ private $args = array();
223
+
224
+ /**
225
+ * ASL_Query constructor.
226
+ *
227
+ * @param $args array of arguments
228
+ * @param int $search_id search ID
229
+ * @param array $options options from $_POST
230
+ */
231
+ public function __construct($args, $search_id = -1, $options = false ) {
232
+ // Expressions not allowed in static context
233
+ self::$defaults['_selected_blogs'] = array(get_current_blog_id());
234
+
235
+ if ( $search_id > -1 ) {
236
+ // Translate search data and options to args
237
+ // args priority $args > $search_args > $defaults
238
+ $search_args = ASL_Helpers::toQueryArgs($search_id, $options, $args);
239
+ $search_args = wp_parse_args( $search_args, self::$defaults );
240
+ $args = wp_parse_args( $args, $search_args );
241
+ } else {
242
+ // No search instance, use default args
243
+ $args = wp_parse_args( $args, self::$defaults );
244
+ }
245
+
246
+ // Store the options for later use
247
+ $this->options = $options;
248
+
249
+ $args = $this->preProcessOptions($args);
250
+
251
+ $args = apply_filters("asl_query_args", $args, $search_id, $options);
252
+ $this->args = $args;
253
+
254
+ do_action('asl_before_search', $args['s']);
255
+
256
+ $this->args['s'] = apply_filters('asl_search_phrase_before_cleaning', $this->args['s']);
257
+ $this->args['s'] = ASL_Helpers::clear_phrase($this->args['s']);
258
+ $this->args['s'] = apply_filters('asl_search_phrase_after_cleaning', $this->args['s']);
259
+
260
+ $this->processOptions();
261
+ $this->posts = $this->get_posts();
262
+ }
263
+
264
+ private function preProcessOptions($args) {
265
+ if ( !$args['_ajax_search'] && $args['_page_id'] == 0) {
266
+ $args['_page_id'] = get_the_ID();
267
+ }
268
+
269
+ return $args;
270
+ }
271
+
272
+ private function processOptions() {
273
+ $args = &$this->args;
274
+ // ---------------- Part 1. Query variables --------------------
275
+
276
+ // These parameters can be arrays and strings/numeric as well -> convert them to array
277
+ $array_param_keys = array(
278
+ 'post_type',
279
+ 'post_parent',
280
+ 'post_status',
281
+ 'post_fields',
282
+ 'post_custom_fields',
283
+ //'post_not_in',
284
+ '_post_tags_include',
285
+ '_post_tags_exclude',
286
+ 'attachment_mime_types',
287
+ 'taxonomy_include'
288
+ //'taxonomy_terms_exclude'
289
+ );
290
+ foreach ($array_param_keys as $k) {
291
+ if ( isset($args[$k]) ) {
292
+ $args[$k] = !is_array($args[$k]) ? array($args[$k]) : $args[$k];
293
+ }
294
+ }
295
+
296
+ // Do not allow private posts for non-editors
297
+ if ( !current_user_can('read_private_posts') )
298
+ $args['post_status'] = array_diff($args['post_status'], array('private'));
299
+
300
+ if ( !is_array($args['search_type']) )
301
+ $args['search_type'] = array($args['search_type']);
302
+ if ( $args['limit'] > 0 && count($args['search_type']) > 0 )
303
+ $args['_limit'] = floor($args['limit']/count($args['search_type']));
304
+ if ( $args['posts_per_page'] == 0 )
305
+ $args['posts_per_page'] = get_option('posts_per_page');
306
+
307
+ $args['keyword_logic'] = strtolower($args['keyword_logic']);
308
+
309
+
310
+ // Parse custom query strings
311
+ $args['cpt_query'] = wp_parse_args($args['cpt_query'], self::$defaults['cpt_query']);
312
+
313
+ // ------------------ Part 2. Search data ----------------------
314
+
315
+ // Break after this point, if no search data is provided
316
+ if ( !isset($this->args['_sd']) )
317
+ return false;
318
+
319
+ $sd = &$this->args['_sd'];
320
+ $args['_charcount'] = $sd['charcount'];
321
+ $sd['image_options'] = array(
322
+ 'image_cropping' => wd_asl()->o['asl_performance']['image_cropping'],
323
+ 'apply_content_filter' => $sd['image_apply_content_filter'],
324
+ 'show_images' => $sd['show_images'],
325
+ 'image_width' => $sd['image_width'],
326
+ 'image_height' => $sd['image_height'],
327
+ 'image_source1' => $sd['image_source1'],
328
+ 'image_source2' => $sd['image_source2'],
329
+ 'image_source3' => $sd['image_source3'],
330
+ 'image_source4' => $sd['image_source4'],
331
+ 'image_source5' => $sd['image_source5'],
332
+ 'image_default' => $sd['image_default'],
333
+ 'image_source_featured' => $sd['image_source_featured'],
334
+ 'image_custom_field' => $sd['image_custom_field']
335
+ );
336
+
337
+ if (isset($_POST['asl_get_as_array']))
338
+ $sd['image_options']['show_images'] = 0;
339
+
340
+ // Disable image cropping in non-ajax mode
341
+ if ( !$args['_ajax_search'] ) {
342
+ $sd['image_options']['image_cropping'] = 0;
343
+ }
344
+ }
345
+
346
+ public function getArgs() {
347
+ return $this->args;
348
+ }
349
+
350
+ public function get_posts() {
351
+ $args = $this->args;
352
+ $_args = $args; // copy to store changes
353
+
354
+ $ra = array(
355
+ 'allpageposts' => array(),
356
+ );
357
+
358
+ $s = $this->applyExceptions( $args['s'] );
359
+
360
+ // Allow empty search phrases only if the char count is 0
361
+ if ( $s != "" ||
362
+ ($s == "" && ( isset($args['force_order']) || isset($args['force_count']) )) ||
363
+ ($s == "" && $args['_charcount'] == 0)
364
+ )
365
+ $this->finalPhrases[] = $s;
366
+
367
+ $this->finalPhrases = apply_filters("asl_final_phrases", $this->finalPhrases);
368
+
369
+ $logics = array( $args['keyword_logic'] );
370
+ if ( !empty($args['secondary_logic']) && $args['secondary_logic'] !== 'none' && $args['_call_num'] == 0 )
371
+ $logics[] = strtolower($args['secondary_logic']);
372
+
373
+ // ---- Search Porcess Starts Here ----
374
+ foreach ($this->finalPhrases as $s) {
375
+ foreach ($args['_selected_blogs'] as $blog) {
376
+ if ( is_multisite() ) switch_to_blog($blog);
377
+
378
+ if ( in_array('cpt', $args['search_type']) && count($args['post_type']) > 0 ) {
379
+ if ( $args['posts_limit_distribute'] == 1 ) {
380
+ if ( isset($args['_sd']) && $args['_sd']['use_post_type_order'] == 1 ) {
381
+ $_temp_ptypes = array();
382
+ foreach ($args['_sd']['post_type_order'] as $pk => $p_order) {
383
+ if ( in_array($p_order, $args['post_type']) )
384
+ $_temp_ptypes[] = $p_order;
385
+ }
386
+ $_temp_ptypes = array_unique(array_merge($_temp_ptypes, $args['post_type']));
387
+ } else {
388
+ $_temp_ptypes = $args['post_type'];
389
+ }
390
+
391
+ $_temp_ptype_limits = array();
392
+
393
+ foreach ($_temp_ptypes as $_tptype) {
394
+ $_temp_ptype_limits[$_tptype] = array(
395
+ (int)($args['posts_limit'] / count($_temp_ptypes)),
396
+ (int)($args['posts_limit_override'] / count($_temp_ptypes))
397
+ );
398
+ }
399
+
400
+ foreach ($_temp_ptypes as $_tptype) {
401
+ foreach ($logics as $lk => $logic) {
402
+ if ( $lk == 0 && $args['_exact_matches'] == 1 ) {
403
+ // If exact matches is on, disregard the firs logic
404
+ $args['keyword_logic'] = 'or';
405
+ } else {
406
+ if ( $lk > 0 )
407
+ $args['_exact_matches'] = 0;
408
+ $args['keyword_logic'] = $logic;
409
+ }
410
+ $args['post_type'] = array($_tptype);
411
+ // Change the limits temporarly for the search
412
+ $args['posts_limit'] = $_temp_ptype_limits[$_tptype][0];
413
+ $args['posts_limit_override'] = $_temp_ptype_limits[$_tptype][1];
414
+ // For exact matches the regular engine is used
415
+ $_posts = new ASL_Search_CPT($args);
416
+
417
+ $_posts_res = $_posts->search($s);
418
+ $ra['allpageposts'] = array_merge($ra['allpageposts'], $_posts_res);
419
+ if ( $lk > 0 )
420
+ $this->found_posts += $_posts->return_count;
421
+ else
422
+ $this->found_posts += $_posts->results_count;
423
+ $_temp_ptype_limits[$_tptype][0] -= $_posts->return_count;
424
+ $_temp_ptype_limits[$_tptype][1] -= $_posts->return_count;
425
+ $args['post_not_in2'] = array_merge($args['post_not_in2'], $this->getResIdsArr($_posts_res));
426
+ $args['_exact_matches'] = $_args['_exact_matches'];
427
+ }
428
+ }
429
+ $args['post_type'] = $_temp_ptypes;
430
+ } else {
431
+ foreach ($logics as $lk => $logic) {
432
+ if ( $lk == 0 && $args['_exact_matches'] == 1 ) {
433
+ // If exact matches is on, disregard the first logic
434
+ $args['keyword_logic'] = 'or';
435
+ } else {
436
+ if ( $lk > 0 )
437
+ $args['_exact_matches'] = 0;
438
+ $args['keyword_logic'] = $logic;
439
+ }
440
+
441
+ $_posts = new ASL_Search_CPT($args);
442
+ $_posts_res = $_posts->search($s);
443
+ $ra['allpageposts'] = array_merge($ra['allpageposts'], $_posts_res);
444
+ if ( $lk > 0 )
445
+ $this->found_posts += $_posts->return_count;
446
+ else
447
+ $this->found_posts += $_posts->results_count;
448
+ $args['posts_limit'] -= $_posts->return_count;
449
+ $args['posts_limit_override'] -= $_posts->return_count;
450
+ $args['post_not_in2'] = array_merge($args['post_not_in2'], $this->getResIdsArr($_posts_res));
451
+ $args['_exact_matches'] = $_args['_exact_matches'];
452
+ }
453
+ }
454
+ do_action('asl_after_pagepost_results', $s, $ra['allpageposts']);
455
+ }
456
+ }
457
+ }
458
+
459
+ // ---- Search Porcess Stops Here ----
460
+ $results_count_adjust = 0; // Count the changes in results count when using filters
461
+
462
+ $rca = count($ra['allpageposts']);
463
+ $ra['allpageposts'] = apply_filters('asl_pagepost_results', $ra['allpageposts'], $args["_id"], $args);
464
+ $ra['allpageposts'] = apply_filters('asl_cpt_results', $ra['allpageposts'], $args["_id"], $this);
465
+ $rca -= count($ra['allpageposts']);
466
+ $results_count_adjust += $rca;
467
+
468
+ // Results as array, unordered
469
+ $results_arr = array(
470
+ 'post_page_cpt' => $ra['allpageposts']
471
+ );
472
+
473
+ foreach ( $results_arr as $k => $v ) {
474
+ $final = array();
475
+ foreach ( $results_arr[$k] as $kk => $current ) {
476
+ $found = false;
477
+ foreach ($final as $item) {
478
+ if ($item->id == $current->id && $item->blogid == $current->blogid) {
479
+ $found = true;
480
+ break;
481
+ }
482
+ }
483
+ if ( !$found )
484
+ $final[] = $current;
485
+ }
486
+ $results_arr[$k] = $final;
487
+ }
488
+
489
+ // Order if search data is set
490
+ if ( isset($args['_sd']) ) {
491
+ $results = $results_arr['post_page_cpt'];
492
+ $rca = count($results);
493
+ $results = apply_filters('asl_results', $results, $args['_id'], $args['_ajax_search'], $args);
494
+ $rca -= count($results);
495
+ $results_count_adjust += $rca;
496
+ } else {
497
+ $results = array();
498
+ foreach ($results_arr as $rk => $rv) {
499
+ $results = array_merge($results, $rv);
500
+ }
501
+ $rca = count($results);
502
+ $results = apply_filters('asl_results', $results, -1, false, $args);
503
+ $rca -= count($results);
504
+ $results_count_adjust += $rca;
505
+ }
506
+
507
+ // $results_count_adjust > 0 -> posts have been removed, otherwise added
508
+ $this->found_posts -= $results_count_adjust;
509
+ $this->found_posts = $this->found_posts < 0 ? 0 : $this->found_posts; // Make sure this is not 0
510
+
511
+ // For non-ajax searches, we need the WP_Post objects
512
+ if ( !$args['_ajax_search'] ) {
513
+ $results = asl_results_to_wp_obj($results, $args['posts_per_page'] * ($args['page'] - 1), $args['posts_per_page']);
514
+ $results = apply_filters('asl_noajax_results', $results, $args['_id'], false, $args);
515
+ }
516
+
517
+ return $results;
518
+ }
519
+
520
+ public function kwSuggestions() {
521
+ if ( !isset($this->args['_sd'], $this->args['_sid']) )
522
+ return array();
523
+
524
+ $sd = &$this->args['_sd'];
525
+ $args = $this->args;
526
+ $results = array();
527
+
528
+ if ( function_exists( 'qtranxf_use' ) && $args['_qtranslate_lang'] != "" ) {
529
+ $lang = $args['_qtranslate_lang'];
530
+ } else if ( $args['_wpml_lang'] != "" ) {
531
+ $lang = $args['_wpml_lang'];
532
+ } else if ( $args['_polylang_lang'] != "" ) {
533
+ $lang = $args['_polylang_lang'];
534
+ } else {
535
+ $lang = w_isset_def( $sd['kw_google_lang'], "en" );
536
+ }
537
+
538
+ $types = array();
539
+ if ( isset($sd['customtypes']) )
540
+ $types = array_merge($types, $sd['customtypes']);
541
+
542
+ $t = new wpd_keywordSuggest("google", array(
543
+ 'maxCount' => w_isset_def( $sd['kw_count'], 10 ),
544
+ 'maxCharsPerWord' => w_isset_def($sd['kw_length'], 60),
545
+ 'postTypes' => $types,
546
+ 'lang' => $lang,
547
+ 'overrideUrl' => ''
548
+ ));
549
+
550
+ $keywords = $t->getKeywords( trim($this->args['phrase']) );
551
+
552
+ if ($keywords != false) {
553
+ $results['keywords'] = $keywords;
554
+ $results['nores'] = 1;
555
+ $results = apply_filters('asl_only_keyword_results', $results);
556
+ }
557
+
558
+ return $results;
559
+ }
560
+
561
+ private function applyExceptions( $s ) {
562
+ if ( !isset($this->args['_sd']) )
563
+ return $s;
564
+
565
+ $sd = &$this->args['_sd'];
566
+
567
+ if ($sd["kw_exceptions"] == "" && $sd["kw_exceptions_e"] == "") return $s;
568
+
569
+ if ($sd["kw_exceptions"] != "") {
570
+ $exceptions = stripslashes( str_replace(array(" ,", ", ", " , "), ",", $sd["kw_exceptions"]) );
571
+ if ( $exceptions != '' ) {
572
+ $s = trim(str_replace(explode(",", $exceptions), "", $s));
573
+ $s = preg_replace('/\s+/', ' ', $s);
574
+ }
575
+ }
576
+
577
+ if ($sd["kw_exceptions_e"] != "") {
578
+ $exceptions = stripslashes( str_replace(array(" ,", ", ", " , "), ",", $sd["kw_exceptions_e"]) );
579
+ $exceptions = explode(',', $exceptions);
580
+ foreach ($exceptions as $k => &$v)
581
+ $v = '/\b' . $v . '\b/u';
582
+ unset($v);
583
+ if ( count($exceptions) > 0 ) {
584
+ $s = trim(preg_replace($exceptions, '', $s));
585
+ $s = preg_replace('/\s+/', ' ', $s);
586
+ }
587
+ }
588
+
589
+ return $s;
590
+ }
591
+
592
+ private function getResIdsArr( $r ) {
593
+ $ret = array();
594
+ if ( is_array($r) )
595
+ foreach ($r as $k => $v)
596
+ if ( isset($v->id) )
597
+ $ret[] = $v->id;
598
+ return $ret;
599
+ }
600
+ }
601
+ }
includes/classes/search/class-asl-search-cpt.php ADDED
@@ -0,0 +1,1988 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Prevent direct access */
3
+ defined( 'ABSPATH' ) or die( "You can't access this file directly." );
4
+
5
+ if ( ! class_exists( 'ASL_Search_CPT' ) ) {
6
+ /**
7
+ * Content (post,page,CPT) search class
8
+ *
9
+ * @class ASL_Search_CPT
10
+ * @version 2.0
11
+ * @package AjaxSearchPro/Classes/Search
12
+ * @category Class
13
+ * @author Ernest Marcinko
14
+ */
15
+ class ASL_Search_CPT extends ASL_Search {
16
+
17
+ /**
18
+ * @var array of query parts
19
+ */
20
+ protected $parts = array();
21
+ /**
22
+ * @var array of custom field query parts
23
+ */
24
+ protected $cf_parts = array();
25
+
26
+ protected $ordering = array(
27
+ "primary" => "relevance DESC",
28
+ "secondary" => "post_date DESC",
29
+ "primary_field" => "relevance"
30
+ );
31
+
32
+ /**
33
+ * Content search function
34
+ *
35
+ * @return array|string
36
+ */
37
+ protected function do_search() {
38
+ global $wpdb;
39
+ global $q_config;
40
+
41
+ $args = &$this->args;
42
+
43
+ $asldb = wd_asl()->tables;
44
+ if ( isset($args["_sd"]) )
45
+ $sd = &$args["_sd"];
46
+ else
47
+ $sd = array();
48
+
49
+ // General variables
50
+ $postmeta_join = "";
51
+
52
+ // Prefixes and suffixes
53
+ $pre_field = $this->pre_field;
54
+ $suf_field = $this->suf_field;
55
+ $pre_like = $this->pre_like;
56
+ $suf_like = $this->suf_like;
57
+
58
+ $wcl = '%'; // Wildcard Left
59
+ $wcr = '%'; // Wildcard right
60
+ if ( $args["_exact_matches"] == 1 ) {
61
+ if ( $args['_exact_match_location'] == 'start' ) {
62
+ $wcl = '';
63
+ } else if ( $args['_exact_match_location'] == 'end' ) {
64
+ $wcr = '';
65
+ } else if ( $args['_exact_match_location'] == 'full' ) {
66
+ $wcr = '';
67
+ $wcl = '';
68
+ }
69
+ }
70
+
71
+ $kw_logic = $args['keyword_logic'];
72
+ $q_config['language'] = $args['_qtranslate_lang'];
73
+
74
+ $s = $this->s; // full keyword
75
+ $_s = $this->_s; // array of keywords
76
+
77
+ if ( $args['_limit'] > 0 ) {
78
+ $this->remaining_limit = $args['_limit'];
79
+ } else {
80
+ if ( $args['_ajax_search'] )
81
+ $this->remaining_limit = $args['posts_limit'];
82
+ else
83
+ $this->remaining_limit = $args['posts_limit_override'];
84
+ }
85
+ $query_limit = $this->remaining_limit * $this->remaining_limit_mod;
86
+
87
+ if ($this->remaining_limit <= 0)
88
+ return array();
89
+
90
+ /*------------------------- Statuses ----------------------------*/
91
+ $post_statuses = "";
92
+ $allowed_statuses = "'publish'"; // used later!
93
+ if ( count($args['post_status']) > 0) {
94
+ $allowed_statuses = "'".implode( "','", $args['post_status'] )."'";
95
+ $post_statuses = "AND (" . $pre_field . $wpdb->posts . ".post_status" . $suf_field . " IN ($allowed_statuses) )";
96
+ }
97
+ /*---------------------------------------------------------------*/
98
+
99
+ /*------------------------- Paswword ----------------------------*/
100
+ $post_password_query = '';
101
+ if ( !$args['has_password'] ) {
102
+ $post_password_query = " AND ( $wpdb->posts.post_password = '' )";
103
+ }
104
+ /*---------------------------------------------------------------*/
105
+
106
+ /*----------------------- Gather Types --------------------------*/
107
+ $page_q = "";
108
+ if ( $args['_exclude_page_parent_child'] != '' )
109
+ $page_q = " AND (
110
+ $wpdb->posts.post_parent NOT IN (" . str_replace( '|', ',', $args['_exclude_page_parent_child'] ) . ") AND
111
+ $wpdb->posts.ID NOT IN (" . str_replace( '|', ',', $args['_exclude_page_parent_child'] ) . ")
112
+ )";
113
+
114
+ // If no post types selected, well then return
115
+ if ( count( $args['post_type'] ) < 1 && $page_q == "" ) {
116
+ return '';
117
+ } else {
118
+ $words = implode( "','", $args['post_type'] );
119
+ if ( in_array('product_variation', $args['post_type']) ) {
120
+ $_post_types = $args['post_type'];
121
+ $_post_types = array_diff($_post_types, array('product_variation'));
122
+ if (count($_post_types) > 0)
123
+ $or_ptypes = "OR $wpdb->posts.post_type IN ('".implode("', '", $_post_types)."')";
124
+ else
125
+ $or_ptypes = '';
126
+ $post_types = "
127
+ ((
128
+ (
129
+ $wpdb->posts.post_type = 'product_variation' AND
130
+ EXISTS(SELECT 1 FROM $wpdb->posts par WHERE par.ID = $wpdb->posts.post_parent AND par.post_status IN($allowed_statuses) )
131
+ ) $or_ptypes
132
+ ) $page_q)";
133
+ } else {
134
+ $post_types = "($wpdb->posts.post_type IN ('$words') $page_q)";
135
+ }
136
+ }
137
+ /*---------------------------------------------------------------*/
138
+
139
+ // ------------------------ Categories/tags/taxonomies ----------------------
140
+ $term_query = $this->build_term_query( $wpdb->posts.".ID", $wpdb->posts.'.post_type' );
141
+ // ---------------------------------------------------------------------
142
+
143
+ /*------------- Custom Fields with Custom selectors -------------*/
144
+ $cf_select = $this->build_cff_query( $wpdb->posts.".ID" );
145
+ /*---------------------------------------------------------------*/
146
+
147
+ /*----------------------- Exclude USER id -----------------------*/
148
+ $user_query = "";
149
+ if ( isset($args['post_user_filter']['include']) ) {
150
+ if ( !in_array(-1, $args['post_user_filter']['include']) ) {
151
+ $user_query = "AND $wpdb->posts.post_author IN (" . implode(", ", $args['post_user_filter']['include']) . ")
152
+ ";
153
+ }
154
+ }
155
+ if ( isset($args['post_user_filter']['exclude']) ) {
156
+ if ( !in_array(-1, $args['post_user_filter']['exclude']) )
157
+ $user_query = "AND $wpdb->posts.post_author NOT IN (".implode(", ", $args['post_user_filter']['exclude']).") ";
158
+ else
159
+ return array();
160
+ }
161
+ /*---------------------------------------------------------------*/
162
+
163
+ /*------------------------ Exclude ids --------------------------*/
164
+ if ( !empty($args['post_not_in']) )
165
+ $exclude_posts = "AND ($wpdb->posts.ID NOT IN (".(is_array($args['post_not_in']) ? implode(",", $args['post_not_in']) : $args['post_not_in'])."))";
166
+ else
167
+ $exclude_posts = "";
168
+ if ( !empty($args['post_not_in2']) )
169
+ $exclude_posts .= "AND ($wpdb->posts.ID NOT IN (".implode(",", $args['post_not_in2'])."))";
170
+ /*---------------------------------------------------------------*/
171
+
172
+ /*------------------------ Include ids --------------------------*/
173
+ if ( !empty($args['post_in']) )
174
+ $include_posts = "AND ($wpdb->posts.ID IN (".(is_array($args['post_in']) ? implode(",", $args['post_in']) : $args['post_in'])."))";
175
+ else
176
+ $include_posts = "";
177
+ /*---------------------------------------------------------------*/
178
+
179
+ /*------------------------ Term JOIN -------------------------*/
180
+ // If the search in terms is not active, we don't need this unnecessary big join
181
+ $term_join = "";
182
+ if ( in_array('terms', $args['post_fields']) ) {
183
+ $term_join = "
184
+ LEFT JOIN $wpdb->term_relationships ON $wpdb->posts.ID = $wpdb->term_relationships.object_id
185
+ LEFT JOIN $wpdb->term_taxonomy ON $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id
186
+ LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id";
187
+ }
188
+ /*---------------------------------------------------------------*/
189
+
190
+
191
+ /*------------------------- WPML filter -------------------------*/
192
+ $wpml_query = "(1)";
193
+ if ( $args['_wpml_lang'] != "" ) {
194
+ global $sitepress;
195
+ $site_lang_selected = false;
196
+ $wpml_post_types_arr = array();
197
+
198
+ foreach ($args['post_type'] as $tt) {
199
+ $wpml_post_types_arr[] = "post_" . $tt;
200
+ }
201
+ $wpml_post_types = implode( "','", $wpml_post_types_arr );
202
+
203
+ // Let us get the default site language if possible
204
+ if ( is_object($sitepress) && method_exists($sitepress, 'get_default_language') ) {
205
+ $site_lang_selected = $sitepress->get_default_language() == $args['_wpml_lang'] ? true : false;
206
+ }
207
+
208
+ $_wpml_query_id_field = "$wpdb->posts.ID";
209
+ // Product variations are not translated, so we need to use the parent ID (product) field to compare
210
+ if ( in_array('product_variation', $args['post_type']) ) {
211
+ $_wpml_query_id_field = "(IF($wpdb->posts.post_type='product_variation', $wpdb->posts.post_parent, $wpdb->posts.ID))";
212
+ }
213
+
214
+ $wpml_query = "
215
+ EXISTS (
216
+ SELECT DISTINCT(wpml.element_id)
217
+ FROM " . $wpdb->prefix . "icl_translations as wpml
218
+ WHERE
219
+ $_wpml_query_id_field = wpml.element_id AND
220
+ wpml.language_code = '" . ASL_Helpers::escape( $args['_wpml_lang'] ) . "' AND
221
+ wpml.element_type IN ('$wpml_post_types')
222
+ )";
223
+
224
+ /**
225
+ * For missing translations..
226
+ * If the site language is used, the translation can be non-existent
227
+ */
228
+ if ($site_lang_selected) {
229
+ $wpml_query = "
230
+ NOT EXISTS (
231
+ SELECT DISTINCT(wpml.element_id)
232
+ FROM " . $wpdb->prefix . "icl_translations as wpml
233
+ WHERE
234
+ $_wpml_query_id_field = wpml.element_id AND
235
+ wpml.element_type IN ('$wpml_post_types')
236
+ ) OR
237
+ " . $wpml_query;
238
+ }
239
+ }
240
+ /*---------------------------------------------------------------*/
241
+
242
+ /*----------------------- POLYLANG filter -----------------------*/
243
+ $polylang_query = "";
244
+ if ( $args['_polylang_lang'] != "" ) {
245
+ $languages = get_terms('language', array(
246
+ 'hide_empty' => false,
247
+ 'fields' => 'ids',
248
+ 'orderby' => 'term_group',
249
+ 'slug' => $args['_polylang_lang'])
250
+ );
251
+ if ( !empty($languages) && !is_wp_error($languages) && isset($languages[0]) ) {
252
+ if ( in_array('product_variation', $args['post_type']) && class_exists('WooCommerce') ) {
253
+ $poly_field = "IF($wpdb->posts.post_type = 'product_variation', $wpdb->posts.post_parent, $wpdb->posts.ID)";
254
+ } else {
255
+ $poly_field = "$wpdb->posts.ID";
256
+ }
257
+ $polylang_query = " AND (
258
+ $poly_field IN ( SELECT DISTINCT(tr.object_id)
259
+ FROM $wpdb->term_relationships AS tr
260
+ LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'language')
261
+ WHERE tt.term_id = $languages[0]
262
+ ) )";
263
+ }
264
+ }
265
+ /*---------------------------------------------------------------*/
266
+
267
+ /*--------------------- Post parent IDs -------------------------*/
268
+ $post_parents = '';
269
+ if ( count($args['post_parent']) > 0 ) {
270
+ $post_parents = "AND $wpdb->posts.post_parent IN (".implode(',', $args['post_parent']).") ";
271
+ }
272
+ /*---------------------------------------------------------------*/
273
+
274
+ /*---------------- Post parent IDs exclude ----------------------*/
275
+ $post_parents_exclude = '';
276
+ if ( count($args['post_parent_exclude']) > 0 ) {
277
+ $post_parents_exclude = "AND $wpdb->posts.post_parent NOT IN (".implode(',', $args['post_parent_exclude']).") ";
278
+ }
279
+ /*---------------------------------------------------------------*/
280
+
281
+ /*--------------------- Other Query stuff -----------------------*/
282
+ // Do not select the content field, if it is not used at all
283
+ $select_content = $args['_post_get_content'] ? $wpdb->posts. ".post_content" : "''";
284
+
285
+ // Do not select excerpt if its not used at all
286
+ $select_excerpt = $args['_post_get_excerpt'] ? $wpdb->posts. ".post_excerpt" : "''";
287
+ /*---------------------------------------------------------------*/
288
+
289
+ /*----------------------- Date filtering ------------------------*/
290
+ $date_query = "";
291
+ $date_query_parts = $this->get_date_query_parts();
292
+ if ( count($date_query_parts) > 0 )
293
+ $date_query = " AND (" . implode(" AND ", $date_query_parts) . ") ";
294
+ /*---------------------------------------------------------------*/
295
+
296
+ /*-------------- Additional Query parts by Filters --------------*/
297
+ /**
298
+ * Use these filters to add additional parts to the select, join or where
299
+ * parts of the search query.
300
+ * Params:
301
+ * array() $args - search arguments
302
+ * string $s - the full search keyword
303
+ * array() $_s - the array of unique search keywords separated
304
+ */
305
+ $add_select = apply_filters('asl_cpt_query_add_select', '', $args, $s, $_s);
306
+ $add_join = apply_filters('asl_cpt_query_add_join', '', $args, $s, $_s);
307
+ $add_where = apply_filters('asl_cpt_query_add_where', '', $args, $s, $_s);
308
+ /*---------------------------------------------------------------*/
309
+
310
+ /*---------------- Primary custom field ordering ----------------*/
311
+ $custom_field_selectp = "1 ";
312
+ if (
313
+ strpos($args['post_primary_order'], 'customfp') !== false &&
314
+ $args['_post_primary_order_metakey'] !== false
315
+ ) {
316
+ $custom_field_selectp = "(SELECT IF(meta_value IS NULL, 0, meta_value)
317
+ FROM $wpdb->postmeta
318
+ WHERE
319
+ $wpdb->postmeta.meta_key='".esc_sql($args['_post_primary_order_metakey'])."' AND
320
+ $wpdb->postmeta.post_id=$wpdb->posts.ID
321
+ LIMIT 1
322
+ ) ";
323
+ }
324
+ /*---------------------------------------------------------------*/
325
+
326
+ /*--------------- Secondary custom field ordering ---------------*/
327
+ $custom_field_selects = "1 ";
328
+ if (
329
+ strpos($args['post_secondary_order'], 'customfs') !== false &&
330
+ $args['_post_secondary_order_metakey'] !== false
331
+ ) {
332
+ $custom_field_selects = "(SELECT IF(meta_value IS NULL, 0, meta_value)
333
+ FROM $wpdb->postmeta
334
+ WHERE
335
+ $wpdb->postmeta.meta_key='".esc_sql($args['_post_secondary_order_metakey'])."' AND
336
+ $wpdb->postmeta.post_id=$wpdb->posts.ID
337
+ LIMIT 1
338
+ ) ";
339
+ }
340
+ /*---------------------------------------------------------------*/
341
+
342
+
343
+ /**
344
+ * This is the main query.
345
+ *
346
+ * The ttid field is a bit tricky as the term_taxonomy_id doesn't always equal term_id,
347
+ * so we need the LEFT JOINS :(
348
+ */
349
+ $this->ordering['primary'] = $args['post_primary_order'];
350
+ $this->ordering['secondary'] = $args['post_secondary_order'];
351
+
352
+ $_primary_field = explode(" ", $this->ordering['primary']);
353
+ $this->ordering['primary_field'] = $_primary_field[0];
354
+
355
+ $orderby_primary = str_replace( "post_", $wpdb->posts . ".post_", $args['post_primary_order'] );
356
+ $orderby_secondary = str_replace( "post_", $wpdb->posts . ".post_", $args['post_secondary_order'] );
357
+
358
+ if (
359
+ $args['post_primary_order_metatype'] !== false &&
360
+ $args['post_primary_order_metatype'] == 'numeric'
361
+ )
362
+ $orderby_primary = str_replace('customfp', 'CAST(customfp as SIGNED)', $orderby_primary);
363
+
364
+ if (
365
+ $args['post_secondary_order_metatype'] !== false &&
366
+ $args['post_secondary_order_metatype'] == 'numeric'
367
+ )
368
+ $orderby_secondary = str_replace('customfs', 'CAST(customfs as SIGNED)', $orderby_secondary);
369
+
370
+ $this->query = "
371
+ SELECT
372
+ $add_select
373
+ {args_fields}
374
+ $wpdb->posts.post_title as title,
375
+ $wpdb->posts.post_title as post_title,
376
+ $wpdb->posts.ID as id,
377
+ $this->c_blogid as blogid,
378
+ $wpdb->posts.post_date as date,
379
+ $wpdb->posts.post_date as post_date,
380
+ $select_content as content,
381
+ $select_excerpt as excerpt,
382
+ $wpdb->posts.post_type as post_type,
383
+ 'pagepost' as content_type,
384
+ 'post_page_cpt' as g_content_type,
385
+ (SELECT
386
+ $wpdb->users." . w_isset_def( $sd['author_field'], 'display_name' ) . " as author
387
+ FROM $wpdb->users
388
+ WHERE $wpdb->users.ID = $wpdb->posts.post_author
389
+ ) as author,
390
+ $wpdb->posts.post_author as post_author,
391
+ $wpdb->posts.post_type as post_type,
392
+ {relevance_query} as relevance,
393
+ $custom_field_selectp as customfp,
394
+ $custom_field_selects as customfs
395
+ FROM $wpdb->posts
396
+ {postmeta_join}
397
+ $term_join
398
+ $add_join
399
+ {args_join}
400
+ WHERE
401
+ $post_types
402
+ $term_query
403
+ $user_query
404
+ AND $cf_select
405
+ $post_statuses
406
+ $post_password_query
407
+ AND {like_query}
408
+ $exclude_posts
409
+ $include_posts
410
+ $post_parents
411
+ $post_parents_exclude
412
+ AND ( $wpml_query )
413
+ $polylang_query
414
+ $date_query
415
+ $add_where
416
+ {args_where}
417
+ GROUP BY
418
+ {args_groupby}
419
+ ORDER BY {args_orderby} $orderby_primary, $orderby_secondary, id DESC
420
+ LIMIT $query_limit";
421
+
422
+ // Place the argument query fields
423
+ if ( isset($args['cpt_query']) && is_array($args['cpt_query']) ) {
424
+ $this->query = str_replace(
425
+ array('{args_fields}', '{args_join}', '{args_where}', '{args_orderby}'),
426
+ array($args['cpt_query']['fields'], $args['cpt_query']['join'], $args['cpt_query']['where'], $args['cpt_query']['orderby']),
427
+ $this->query
428
+ );
429
+ } else {
430
+ $this->query = str_replace(
431
+ array('{args_fields}', '{args_join}', '{args_where}', '{args_orderby}'),
432
+ '',
433
+ $this->query
434
+ );
435
+ }
436
+ if ( isset($args['cpt_query'], $args['cpt_query']['groupby']) && $args['cpt_query']['groupby'] != '' ) {
437
+ $this->query = str_replace('{args_groupby}', $args['cpt_query']['groupby'], $this->query);
438
+ } else {
439
+ $this->query = str_replace('{args_groupby}', "$wpdb->posts.ID", $this->query);
440
+ }
441
+
442
+ $words = $args["_exact_matches"] == 1 && $s != '' ? array($s) : $_s;
443
+ /**
444
+ * Ex.: When the minimum word count is 2, and the user enters 'a' then $_s is empty.
445
+ * But $s is not actually empty, thus the wrong query will be executed.
446
+ */
447
+ if ( count($words) == 0 && $s != '' ) {
448
+ $words = array($s);
449
+ // Allow only beginnings
450
+ if ( $args["_exact_matches"] == 0 )
451
+ $wcl = '';
452
+ }
453
+ if ( $s != '' )
454
+ $words = !in_array($s, $words) ? array_merge(array($s), $words) : $words;
455
+
456
+ $relevance_added = false;
457
+ foreach ( $words as $k => $word ) {
458
+ $parts = array();
459
+ $relevance_parts = array();
460
+ $is_exact = $args["_exact_matches"] == 1 || ( count($words) > 1 && $k == 0 && ($kw_logic == 'or' || $kw_logic == 'and') );
461
+
462
+ /*----------------------- Title query ---------------------------*/
463
+ if ( in_array('title', $args['post_fields']) ) {
464
+ if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
465
+ $parts[] = "( " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
466
+ } else {
467
+ $parts[] = "
468
+ ( " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
469
+ OR " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
470
+ OR " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
471
+ OR " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " = '" . $word . "')";
472
+ }
473
+ if ( !$relevance_added ) {
474
+ $relevance_parts[] = "(case when
475
+ (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '$s')
476
+ then " . (w_isset_def($sd['etitleweight'], 10) * 4) . " else 0 end)";
477
+
478
+ $relevance_parts[] = "(case when
479
+ (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '$s%')
480
+ then " . (w_isset_def($sd['etitleweight'], 10) * 2) . " else 0 end)";
481
+
482
+ $relevance_parts[] = "(case when
483
+ (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '%$s%')
484
+ then " . w_isset_def($sd['titleweight'], 10) . " else 0 end)";
485
+
486
+ // The first word relevance is higher
487
+ if ( isset($_s[0]) ) {
488
+ $relevance_parts[] = "(case when
489
+ (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '%" . $_s[0] . "%')
490
+ then " . w_isset_def($sd['etitleweight'], 10) . " else 0 end)";
491
+ }
492
+ }
493
+ }
494
+ /*---------------------------------------------------------------*/
495
+
496
+ /*---------------------- Content query --------------------------*/
497
+ if ( in_array('content', $args['post_fields']) ) {
498
+ if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
499
+ $parts[] = "( " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
500
+ /**
501
+ * Exact matching multi line + word boundary with REGEXP
502
+ *
503
+ * $parts[] = "( " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " REGEXP '([[:blank:][:punct:]]|^|\r\n)" . $word . "([[:blank:][:punct:]]|$|\r\n)' )";
504
+ */
505
+ } else {
506
+ $parts[] = "
507
+ (" . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
508
+ OR " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
509
+ OR " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
510
+ OR " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " = '" . $word . "')";
511
+ }
512
+ if ( !$relevance_added ) {
513
+ if ( isset($_s[0]) ) {
514
+ $relevance_parts[] = "(case when
515
+ (" . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE '%" . $_s[0] . "%')
516
+ then ".w_isset_def($sd['contentweight'], 10)." else 0 end)";
517
+ }
518
+
519
+ $relevance_parts[] = "(case when
520
+ (" . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE '%$s%')
521
+ then " . w_isset_def($sd['econtentweight'], 10) . " else 0 end)";
522
+ }
523
+ }
524
+ /*---------------------------------------------------------------*/
525
+
526
+ /*----------------- Permalink/Post name query -------------------*/
527
+ if ( in_array('permalink', $args['post_fields']) ) {
528
+ $parts[] = "( " . $pre_field . $wpdb->posts . ".post_name" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
529
+ }
530
+ /*---------------------------------------------------------------*/
531
+
532
+ /*---------------------- Excerpt query --------------------------*/
533
+ if ( in_array('excerpt', $args['post_fields']) ) {
534
+ if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
535
+ $parts[] = "( " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
536
+ } else {
537
+ $parts[] = "
538
+ (" . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
539
+ OR " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
540
+ OR " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
541
+ OR " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " = '" . $word . "')";
542
+ }
543
+ if ( !$relevance_added ) {
544
+ if ( isset($_s[0]) ) {
545
+ $relevance_parts[] = "(case when
546
+ (" . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE '%" . $_s[0] . "%')
547
+ then ".w_isset_def($sd['excerptweight'], 10)." else 0 end)";
548
+ }
549
+
550
+ $relevance_parts[] = "(case when
551
+ (" . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE '%$s%')
552
+ then " . w_isset_def($sd['eexcerptweight'], 10) . " else 0 end)";
553
+ }
554
+ }
555
+ /*---------------------------------------------------------------*/
556
+
557
+ /*------------------------ Term query ---------------------------*/
558
+ if ( in_array('terms', $args['post_fields']) ) {
559
+ if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
560
+ $parts[] = "( " . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
561
+ } else {
562
+ $parts[] = "
563
+ (" . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
564
+ OR " . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
565
+ OR " . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
566
+ OR " . $pre_field . $wpdb->terms . ".name" . $suf_field . " = '" . $word . "')";
567
+ }
568
+
569
+ if ( !$relevance_added ) {
570
+ $relevance_parts[] = "(case when
571
+ (" . $pre_field . $wpdb->terms . ".name" . $suf_field . " = '$s')
572
+ then " . w_isset_def($sd['etermsweight'], 10) . " else 0 end)";
573
+ }
574
+ }
575
+ /*---------------------------------------------------------------*/
576
+
577
+ /*---------------------- Custom Fields --------------------------*/
578
+ if ( $args['post_custom_fields_all'] == 1 )
579
+ $args['post_custom_fields'] = array("all");
580
+
581
+ if ( count($args['post_custom_fields']) > 0 ) {
582
+ $postmeta_join = "LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID";
583
+ foreach ( $args['post_custom_fields'] as $cfield ) {
584
+ $key_part = $args['post_custom_fields_all'] == 1 ? "" : "$wpdb->postmeta.meta_key='$cfield' AND ";
585
+
586
+ if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
587
+ $parts[] = "( $key_part " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
588
+ } else {
589
+ $parts[] = "( $key_part
590
+ (" . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
591
+ OR " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
592
+ OR " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
593
+ OR " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " = '" . $word . "') )";
594
+ }
595
+ if ( !$relevance_added ) {
596
+ if ($cfield == 'author_field_name')
597
+ $relevance_parts[] = "(case when
598
+ (EXISTS (SELECT 1 FROM $wpdb->postmeta as cfre WHERE cfre.post_id = $wpdb->posts.ID AND cfre.meta_key = '$cfield' AND
599
+ (cfre.meta_value" . $suf_field . " LIKE '%" . $s . "%')))
600
+ then 100 else 0 end)";
601
+ if ($cfield == 'fulltext_field_name')
602
+ $relevance_parts[] = "(case when
603
+ (EXISTS (SELECT 1 FROM $wpdb->postmeta as cfre WHERE cfre.post_id = $wpdb->posts.ID AND cfre.meta_key = '$cfield' AND
604
+ (cfre.meta_value" . $suf_field . " LIKE '%" . $s . "%')))
605
+ then 10 else 0 end)";
606
+ }
607
+ }
608
+ }
609
+ /*---------------------------------------------------------------*/
610
+
611
+ /*---------------------- Post CPT IDs ---------------------------*/
612
+ if ( in_array("ids", $args['post_fields']) )
613
+ $parts[] = "($wpdb->posts.ID LIKE '$word')";
614
+ /*---------------------------------------------------------------*/
615
+
616
+ $this->parts[] = array( $parts, $relevance_parts );
617
+ $relevance_added = true;
618
+ }
619
+
620
+ // Add the meta join if needed..
621
+ $this->query = str_replace( '{postmeta_join}', $postmeta_join, $this->query );
622
+
623
+ $querystr = $this->build_query( $this->parts );
624
+ $querystr = apply_filters('asl_query_cpt', $querystr, $args, $args['_id'], $args['_ajax_search']);
625
+
626
+ $all_pageposts = $wpdb->get_results( $querystr, OBJECT );
627
+
628
+ // Get the real count, up to 500
629
+ $this->results_count = count($all_pageposts);
630
+ // For non-ajax search, results count needs to be limited to the maximum limit,
631
+ // ..as nothing is parsed beyond that
632
+ if ($args['_ajax_search'] == false && $this->results_count > $this->remaining_limit) {
633
+ $this->results_count = $this->remaining_limit;
634
+ }
635
+ /**
636
+ * Order them again:
637
+ * - The custom field ordering always uses alphanumerical comparision, which is not ok
638
+ */
639
+ if (
640
+ count($all_pageposts) > 0 &&
641
+ (
642
+ strpos($args['post_primary_order'], 'customfp') !== false ||
643
+ strpos($args['post_secondary_order'], 'customfs') !== false
644
+ )
645
+ ) {
646
+ usort( $all_pageposts, array( $this, 'compare_by_primary' ) );
647
+ /**
648
+ * Let us save some time. There is going to be a user selecting the same sorting
649
+ * for both primary and secondary. Only do secondary if it is different from the primary.
650
+ */
651
+ if ( $this->ordering['primary'] != $this->ordering['secondary'] ) {
652
+ $i = 0;
653
+ foreach ($all_pageposts as $pk => $pp) {
654
+ $all_pageposts[$pk]->primary_order = $i;
655
+ $i++;
656
+ }
657
+
658
+ usort( $all_pageposts, array( $this, 'compare_by_secondary' ) );
659
+ }
660
+ }
661
+ // Slice the needed ones only
662
+ $all_pageposts = array_slice($all_pageposts, $args['_call_num'] * $this->remaining_limit, $this->remaining_limit);
663
+
664
+ $this->results = $all_pageposts;
665
+ $this->return_count = count($this->results);
666
+
667
+ return $all_pageposts;
668
+ }
669
+
670
+ protected function build_pgp_query($post_id_field) {
671
+ global $wpdb;
672
+ $query = '1';
673
+ $s = $this->s;
674
+ $args = $this->args;
675
+
676
+ $group_query_arr = array();
677
+ foreach(wd_asl()->priority_groups->getSorted() as $group) {
678
+ // Rule affects this instance?
679
+ if ($group['instance'] != 0 && $group['instance'] != $args['_sid'])
680
+ continue;
681
+ // Rule affects this phrase?
682
+ if ( ASL_mb::strlen($group['phrase']) > 0 ) {
683
+ switch ($group['phrase_logic']) {
684
+ case 'any':
685
+ if (ASL_mb::strpos($s, $group['phrase']) === false)
686
+ continue 2;
687
+ break;
688
+ case 'exact':
689
+ if ($s !== $group['phrase'])
690
+ continue 2;
691
+ break;
692
+ case 'start':
693
+ if (ASL_mb::strpos($s, $group['phrase']) !== 0)
694
+ continue 2;
695
+ break;
696
+ case 'end':
697
+ if (!(ASL_mb::substr($s, -ASL_mb::strlen($group['phrase'])) === $group['phrase']))
698
+ continue 2;
699
+ break;
700
+ }
701
+ }
702
+ $rule_query_arr = array();
703
+ foreach($group['rules'] as $rule) {
704
+ switch($rule['field']) {
705
+ case 'tax':
706
+ $tax_term_query_arr = array();
707
+ foreach ( $rule['values'] as $taxonomy => $terms ) {
708
+ if (count($terms) < 1)
709
+ continue;
710
+ $term_ids = implode(',', $terms);
711
+ if ( $rule['operator'] == 'in' ) {
712
+ $operator = 'EXISTS';
713
+ } else {
714
+ $operator = 'NOT EXISTS';
715
+ }
716
+ $tax_term_query_arr[] = "(
717
+ $operator ( SELECT 1
718
+ FROM $wpdb->term_relationships AS gptr
719
+ LEFT JOIN $wpdb->term_taxonomy as gptt ON (gptr.term_taxonomy_id = gptt.term_taxonomy_id AND gptt.taxonomy = '$taxonomy')
720
+ WHERE gptt.term_id IN ($term_ids) AND gptr.object_id = $post_id_field
721
+ ) )";
722
+ }
723
+ if ( count($tax_term_query_arr) ) {
724
+ $tax_term_query = '( '.implode(' AND ', $tax_term_query_arr) . ' )';
725
+ $rule_query_arr[] = $tax_term_query;
726
+ }
727
+ break;
728
+ case 'cf':
729
+ // Get the field and the values
730
+ foreach ( $rule['values'] as $field => $values )
731
+ break;
732
+ $field = ASL_Helpers::escape($field);
733
+
734
+ $numeric_operators = array('=', '<>', '>', '>=', '<', '<=');
735
+ if ( false !== $nkey = array_search($rule['operator'], $numeric_operators) ) {
736
+ $operator = $numeric_operators[$nkey];
737
+ $values = ASL_Helpers::force_numeric($values);
738
+ $qry = " gp_pm.meta_value".$operator.$values[0];
739
+ } else if(
740
+ $rule['operator'] == 'between' &&
741
+ isset($values[0], $values[1])
742
+ ) {
743
+ $qry = " gp_pm.meta_value BETWEEN ".$values[0]. " AND ".$values[1];
744
+ } else if ( $rule['operator'] == 'like' ) {
745
+ $qry = " gp_pm.meta_value LIKE '%".$values[0]."%'";
746
+ } else if ( $rule['operator'] == 'not like' ) {
747
+ $qry = " gp_pm.meta_value NOT LIKE '%".$values[0]."%'";
748
+ } else if ( $rule['operator'] == 'elike' ) {
749
+ $qry = " gp_pm.meta_value LIKE '".$values[0]."'";
750
+ } else {
751
+ // None of the operators above?
752
+ continue 2;
753
+ }
754
+
755
+ $cf_query = "
756
+ (EXISTS(
757
+ SELECT 1
758
+ FROM $wpdb->postmeta as gp_pm
759
+ WHERE gp_pm.post_id = $post_id_field AND gp_pm.meta_key='$field' AND $qry
760
+ GROUP BY gp_pm.meta_id
761
+ ORDER BY gp_pm.meta_id
762
+ LIMIT 1
763
+ ))";
764
+ $rule_query_arr[] = $cf_query;
765
+ break;
766
+ }
767
+ }
768
+
769
+ // Construct the WHEN-THEN for this case
770
+ if ( count($rule_query_arr) > 0 ) {
771
+ $priority = $group['priority'] + 0;
772
+ if ( $group['logic'] == 'and' )
773
+ $rule_logic = ' AND ';
774
+ else
775
+ $rule_logic = ' OR ';
776
+ $condition = implode($rule_logic, $rule_query_arr);
777
+ $group_query_arr[] = "WHEN $condition THEN $priority";
778
+ }
779
+
780
+ }
781
+
782
+ if ( count($group_query_arr) > 0 ) {
783
+ $query = implode(' ', $group_query_arr);
784
+ $query = "(CASE
785
+ $query
786
+ ELSE 1
787
+ END)";
788
+ }
789
+
790
+ return $query;
791
+ }
792
+
793
+ protected function build_term_query($post_id_field, $post_type_field) {
794
+ global $wpdb;
795
+ $args = $this->args;
796
+
797
+ if ( isset($_GET['ignore_op']) ) return "";
798
+
799
+ $term_query = "";
800
+ $term_query_parts = array();
801
+
802
+ foreach ($args['post_tax_filter'] as $k => $item) {
803
+ $tax_term_query = '';
804
+ $taxonomy = $item['taxonomy'];
805
+
806
+ // Is there an argument set to allow empty items for this taxonomy filter?
807
+ if ( isset($item['allow_empty']) ) {
808
+ $allow_empty_tax_term = $item['allow_empty'];
809
+ } else {
810
+ $allow_empty_tax_term = $taxonomy == 'post_tag' ? $args["_post_tags_empty"] : $args['_post_allow_empty_tax_term'];
811
+ }
812
+
813
+ if ( $allow_empty_tax_term == 1 ) {
814
+ $empty_terms_query = "
815
+ NOT EXISTS (
816
+ SELECT *
817
+ FROM $wpdb->term_relationships as xt
818
+ INNER JOIN $wpdb->term_taxonomy as tt ON ( xt.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = '$taxonomy')
819
+ WHERE
820
+ xt.object_id = $post_id_field
821
+ ) OR ";
822
+ } else {
823
+ $empty_terms_query = "";
824
+ }
825
+
826
+ // Quick explanation for the AND
827
+ // .. MAIN SELECT: selects all object_ids that are not in the array
828
+ // .. SUBSELECT: excludes all the object_ids that are part of the array
829
+ // This is used because of multiple object_ids (posts in more than 1 tag)
830
+ if ( !empty($item['exclude']) ) {
831
+ $words = implode( ',', $item['exclude'] );
832
+ $tax_term_query = " (
833
+ $empty_terms_query
834
+
835
+ $post_id_field IN (
836
+ SELECT DISTINCT(tr.object_id)
837
+ FROM $wpdb->term_relationships AS tr
838
+ LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = '$taxonomy')
839
+ WHERE
840
+ tt.term_id NOT IN ($words)
841
+ AND tr.object_id NOT IN (
842
+ SELECT DISTINCT(trs.object_id)
843
+ FROM $wpdb->term_relationships AS trs
844
+ LEFT JOIN $wpdb->term_taxonomy as tts ON (trs.term_taxonomy_id = tts.term_taxonomy_id AND tts.taxonomy = '$taxonomy')
845
+ WHERE tts.term_id IN ($words)
846
+ )
847
+ )
848
+ )";
849
+ }
850
+ if ( !empty($item['include']) ) {
851
+ $words = implode( ',', $item['include'] );
852
+ if ( !empty($tax_term_query) )
853
+ $tax_term_query .= " AND ";
854
+ if ( isset($item['logic']) && $item['logic'] == 'andex' ) {
855
+ $tax_term_query .= "(
856
+ $empty_terms_query
857
+
858
+ ".count($item['include'])." = ( SELECT COUNT(tr.object_id)
859
+ FROM $wpdb->term_relationships AS tr
860
+ LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = '$taxonomy')
861
+ WHERE tt.term_id IN ($words) AND tr.object_id = $post_id_field
862
+ ) )";
863
+ } else {
864
+ $tax_term_query .= "(
865
+ $empty_terms_query
866
+
867
+ $post_id_field IN ( SELECT DISTINCT(tr.object_id)
868
+ FROM $wpdb->term_relationships AS tr
869
+ LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = '$taxonomy')
870
+ WHERE tt.term_id IN ($words)
871
+ ) )";
872
+ }
873
+ }
874
+
875
+
876
+ /**
877
+ * POST TAG SPECIFIC ONLY
878
+ *
879
+ * At this point we need to check if the user wants to hide the empty tags but the $tag_query
880
+ * turned out to be empty. (if not all tags are used and all of them are selected).
881
+ * If so, then return true on every post type other than 'post' OR check if any tags
882
+ * are associated with the post.
883
+ */
884
+ if (
885
+ $taxonomy == 'post_tag' &&
886
+ $args['_post_tags_active'] == 1 &&
887
+ $tax_term_query == "" &&
888
+ $args["_post_tags_empty"] == 0
889
+ ) {
890
+ $tax_term_query = "
891
+ (
892
+ ($post_type_field != 'post') OR
893
+
894
+ EXISTS (
895
+ SELECT *
896
+ FROM $wpdb->term_relationships as xt
897
+ INNER JOIN $wpdb->term_taxonomy as tt ON ( xt.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'post_tag')
898
+ WHERE
899
+ xt.object_id = $post_id_field
900
+ )
901
+ )";
902
+ }
903
+ // ----------------------------------------------------
904
+
905
+ if ( !empty($tax_term_query) )
906
+ $term_query_parts[] = "(" . $tax_term_query . ")";
907
+ }
908
+
909
+ if ( !empty($term_query_parts) )
910
+ $term_query = "AND (" . implode(" ".strtoupper($args['_taxonomy_group_logic'])." ", $term_query_parts) . ") ";
911
+
912
+ return $term_query;
913
+ }
914
+
915
+ protected function build_cff_query( $post_id_field ) {
916
+ global $wpdb;
917
+ $args = $this->args;
918
+ $parts = array();
919
+
920
+ $allow_cf_null = $args['_post_meta_allow_null'];
921
+
922
+ foreach ( $args['post_meta_filter'] as $data ) {
923
+
924
+ $operator = $data['operator'];
925
+ $posted = $data['value'];
926
+ $field = $data['key'];
927
+ $logic_and_separate_custom_fields = isset($data['logic_and_separate_custom_fields']) && true;
928
+ $values_count = 1;
929
+
930
+ // Is this a special case of date operator?
931
+ if (strpos($operator, "datetime") === 0) {
932
+ $date_add = $allow_cf_null ? '' : "$wpdb->postmeta.meta_value<>'' AND ";
933
+ switch ($operator) {
934
+ case 'datetime =':
935
+ $current_part = "($date_add $wpdb->postmeta.meta_value BETWEEN '$posted 00:00:00' AND '$posted 23:59:59')";
936
+ break;
937
+ case 'datetime <>':
938
+ $current_part = "($date_add $wpdb->postmeta.meta_value NOT BETWEEN '$posted 00:00:00' AND '$posted 23:59:59')";
939
+ break;
940
+ case 'datetime <':
941
+ $current_part = "($date_add $wpdb->postmeta.meta_value < '$posted 00:00:00')";
942
+ break;
943
+ case 'datetime <=':
944
+ $current_part = "($date_add $wpdb->postmeta.meta_value <= '$posted 23:59:59')";
945
+ break;
946
+ case 'datetime >':
947
+ $current_part = "($date_add $wpdb->postmeta.meta_value > '$posted 23:59:59')";
948
+ break;
949
+ case 'datetime >=':
950
+ $current_part = "($date_add $wpdb->postmeta.meta_value >= '$posted 00:00:00')";
951
+ break;
952
+ default:
953
+ $current_part = "($date_add $wpdb->postmeta.meta_value < '$posted 00:00:00')";
954
+ break;
955
+ }
956
+ // Is this a special case of timestamp?
957
+ } else if (strpos($operator, "timestamp") === 0) {
958
+ $date_add = $allow_cf_null ? '' : "$wpdb->postmeta.meta_value<>'' AND ";
959
+ switch ($operator) {
960
+ case 'timestamp =':
961
+ $current_part = "($date_add $wpdb->postmeta.meta_value BETWEEN $posted AND ".($posted + 86399).")";
962
+ break;
963
+ case 'timestamp <>':
964
+ $current_part = "($date_add $wpdb->postmeta.meta_value NOT BETWEEN $posted AND ".($posted + 86399).")";
965
+ break;
966
+ case 'timestamp <':
967
+ $current_part = "($date_add $wpdb->postmeta.meta_value < $posted)";
968
+ break;
969
+ case 'timestamp <=':
970
+ $current_part = "($date_add $wpdb->postmeta.meta_value <= ".($posted + 86399).")";
971
+ break;
972
+ case 'timestamp >':
973
+ $current_part = "($date_add $wpdb->postmeta.meta_value > ".($posted + 86399).")";
974
+ break;
975
+ case 'timestamp >=':
976
+ $current_part = "($date_add $wpdb->postmeta.meta_value >= $posted)";
977
+ break;
978
+ default:
979
+ $current_part = "($date_add $wpdb->postmeta.meta_value < $posted)";
980
+ break;
981
+ }
982
+ // Check BETWEEN first -> range slider
983
+ } else if ( $operator === "BETWEEN" ) {
984
+ $current_part = "($wpdb->postmeta.meta_value BETWEEN " . $posted[0] . " AND " . $posted[1] . " )";
985
+ // If not BETWEEN but value is array, then drop-down or checkboxes
986
+ } else if ( is_array($posted) ) {
987
+ // Is there a logic sent?
988
+ $logic = isset($data['logic']) ? $data['logic'] : "OR";
989
+ $values_count = count($posted);
990
+ if ( $logic_and_separate_custom_fields && $logic == 'AND' )
991
+ $logic = 'OR';
992
+ $values = '';
993
+ if ($operator === "IN" ) {
994
+ $val = implode("','", $posted);
995
+ if ( !empty($val) ) {
996
+ if ($values != '') {
997
+ $values .= " $logic $wpdb->postmeta.meta_value $operator ('" . $val . "')";
998
+ } else {
999
+ $values .= "$wpdb->postmeta.meta_value $operator ('" . $val . "')";
1000
+ }
1001
+ }
1002
+ } else {
1003
+ foreach ($posted as $v) {
1004
+ if ($operator === "ELIKE" || $operator === "NOT ELIKE") {
1005
+ $_op = $operator === 'ELIKE' ? 'LIKE' : 'NOT LIKE';
1006
+ if ($values != '') {
1007
+ $values .= " $logic $wpdb->postmeta.meta_value $_op '" . $v . "'";
1008
+ } else {
1009
+ $values .= "$wpdb->postmeta.meta_value $_op '" . $v . "'";
1010
+ }
1011
+ } else if ($operator === "NOT LIKE" || $operator === "LIKE") {
1012
+ if ($values != '') {
1013
+ $values .= " $logic $wpdb->postmeta.meta_value $operator '%" . $v . "%'";
1014
+ } else {
1015
+ $values .= "$wpdb->postmeta.meta_value $operator '%" . $v . "%'";
1016
+ }
1017
+ } else {
1018
+ if ($values != '') {
1019
+ $values .= " $logic $wpdb->postmeta.meta_value $operator " . $v;
1020
+ } else {
1021
+ $values .= "$wpdb->postmeta.meta_value $operator " . $v;
1022
+ }
1023
+ }
1024
+ }
1025
+ }
1026
+
1027
+ $values = $values == '' ? '0' : $values;
1028
+ $current_part = "($values)";
1029
+ // String operations
1030
+ } else if ($operator === "NOT LIKE" || $operator === "LIKE") {
1031
+ $current_part = "($wpdb->postmeta.meta_value $operator '%" . $posted . "%')";
1032
+ } else if ($operator === "ELIKE" || $operator === "NOT ELIKE") {
1033
+ $_op = $operator === 'ELIKE' ? 'LIKE' : 'NOT LIKE';
1034
+ $current_part = "($wpdb->postmeta.meta_value $_op '$posted')";
1035
+ } else {
1036
+ // Numeric operations or problematic stuff left
1037
+ $current_part = "($wpdb->postmeta.meta_value $operator $posted )";
1038
+ }
1039
+
1040
+ // Finally add the current part to the parts array
1041
+ if ( $current_part != "") {
1042
+ if ( isset($data['allow_missing']) )
1043
+ $allowance = $data['allow_missing'];
1044
+ else
1045
+ $allowance = $allow_cf_null;
1046
+
1047
+ $parts[] = array($field, $current_part, $allowance, $logic_and_separate_custom_fields, $values_count);
1048
+ }
1049
+ }
1050
+
1051
+ // The correct count is the unique fields count
1052
+ //$meta_count = count( $unique_fields );
1053
+
1054
+ $cf_select = "(1)";
1055
+ $cf_select_arr = array();
1056
+
1057
+ /**
1058
+ * NOTE 1:
1059
+ * With the previous NOT EXISTS(...) subquery solution the search would hang in some cases
1060
+ * when checking if empty values are allowed. No idea why though...
1061
+ * Eventually using separate sub-queries for each field is the best.
1062
+ *
1063
+ * NOTE 2:
1064
+ * COUNT(post_id) is a MUST in the nested IF() statement !! Otherwise the query will return empty rows, no idea why either..
1065
+ */
1066
+
1067
+ foreach ( $parts as $k => $part ) {
1068
+ $field = $part[0]; // Field name
1069
+ $def = $part[2] ? "(
1070
+ SELECT IF((meta_key IS NULL OR meta_value = ''), -1, COUNT(meta_id))
1071
+ FROM $wpdb->postmeta
1072
+ WHERE $wpdb->postmeta.post_id = $post_id_field AND $wpdb->postmeta.meta_key='$field'
1073
+ LIMIT 1
1074
+ ) = -1
1075
+ OR" : ''; // Allowance
1076
+ $qry = $part[1]; // Query condition
1077
+ if ( $part[3] ) { // AND logic in for separated fields?
1078
+ $compare_to = intval($part[4]);
1079
+ } else {
1080
+ $compare_to = 1;
1081
+ }
1082
+ $cf_select_arr[] = "
1083
+ (
1084
+ $def
1085
+ (
1086
+ SELECT COUNT(meta_id) as mtc
1087
+ FROM $wpdb->postmeta
1088
+ WHERE $wpdb->postmeta.post_id = $post_id_field AND $wpdb->postmeta.meta_key='$field' AND $qry
1089
+ ORDER BY mtc
1090
+ LIMIT 1
1091
+ ) >= $compare_to
1092
+ )";
1093
+ }
1094
+ if ( count($cf_select_arr) ) {
1095
+ // Connect them based on the meta logic
1096
+ $cf_select = "( ". implode( $args['_post_meta_logic'], $cf_select_arr ) . " )";
1097
+ }
1098
+
1099
+ return $cf_select;
1100
+ }
1101
+
1102
+ protected function get_date_query_parts( $table_alias = "", $date_field = "post_date" ) {
1103
+ global $wpdb;
1104
+ $args = $this->args;
1105
+
1106
+ if ( empty($table_alias) )
1107
+ $table_alias = $wpdb->posts;
1108
+
1109
+ $date_query_parts = array();
1110
+
1111
+ foreach( $args['post_date_filter'] as $date_filter ) {
1112
+ if (isset($date_filter['date'])) // Given by date argument
1113
+ $date = $date_filter['date'];
1114
+ else // Given by year, month, day arguments
1115
+ $date = $date_filter['year'] . "-" . sprintf("%02d", $date_filter['month']) . "-" . sprintf("%02d", $date_filter['day']);
1116
+
1117
+ if ($date_filter['interval'] == "before") {
1118
+ $op = $date_filter['operator'] == "exclude" ? ">" : "<=";
1119
+ $date_query_parts[] = "$table_alias.$date_field $op '" . $date . " 23:59:59'";
1120
+ } else {
1121
+ $op = $date_filter['operator'] == "exclude" ? "<" : ">=";
1122
+ $date_query_parts[] = "$table_alias.$date_field $op '" . $date . " 00:00:00'";
1123
+ }
1124
+ }
1125
+ return $date_query_parts;
1126
+ }
1127
+
1128
+
1129
+ /**
1130
+ * usort() custom function, sort by primary
1131
+ *
1132
+ * @param $a
1133
+ * @param $b
1134
+ *
1135
+ * @return int
1136
+ */
1137
+ protected function compare_by_primary( $a, $b ) {
1138
+
1139
+ switch ($this->ordering['primary']) {
1140
+ case "average_rating DESC":
1141
+ // ceil() is very important here!! as this expects 1, 0, -1 but no values inbetween
1142
+ return ceil((float)$b->average_rating - (float)$a->average_rating);
1143
+ case "relevance DESC":
1144
+ return $b->relevance - $a->relevance;
1145
+ case "post_date DESC":
1146
+ $date_diff = strtotime($b->date) - strtotime($a->date);
1147
+ if ($date_diff == 0)
1148
+ return $b->id - $a->id;
1149
+
1150
+ return $date_diff;
1151
+ case "post_date ASC":
1152
+ $date_diff = strtotime($a->date) - strtotime($b->date);
1153
+ if ($date_diff == 0)
1154
+ return $a->id - $b->id;
1155
+
1156
+ return $date_diff;
1157
+ case "post_title DESC":
1158
+ return strcasecmp($b->title, $a->title);
1159
+ case "post_title ASC":
1160
+ return strcasecmp($a->title, $b->title);
1161
+ case "menu_order DESC":
1162
+ return $b->menu_order - $a->menu_order;
1163
+ case "menu_order ASC":
1164
+ return $a->menu_order - $b->menu_order;
1165
+ case "customfp DESC":
1166
+ if ($this->args['post_primary_order_metatype'] == 'numeric')
1167
+ return floatval($b->customfp) - floatval($a->customfp);
1168
+ else
1169
+ return strcasecmp($b->customfp, $a->customfp);
1170
+ case "customfp ASC":
1171
+ if ($this->args['post_primary_order_metatype'] == 'numeric')
1172
+ return floatval($a->customfp) - floatval($b->customfp);
1173
+ else
1174
+ return strcasecmp($a->customfp, $b->customfp);
1175
+ case "RAND()":
1176
+ return rand(-1,1);
1177
+ default:
1178
+ return $b->relevance - $a->relevance;
1179
+ }
1180
+ }
1181
+
1182
+ /**
1183
+ * usort() custom function, sort by secondary
1184
+ *
1185
+ * @param $a
1186
+ * @param $b
1187
+ *
1188
+ * @return int
1189
+ */
1190
+ protected function compare_by_secondary( $a, $b ) {
1191
+
1192
+ $field = $this->ordering['primary_field'];
1193
+
1194
+ if ($a->$field == $b->$field) {
1195
+
1196
+ switch ($this->ordering['secondary']) {
1197
+ case "relevance DESC":
1198
+ return $b->relevance - $a->relevance;
1199
+ case "post_date DESC":
1200
+ $date_diff = strtotime($b->date) - strtotime($a->date);
1201
+ if ($date_diff == 0)
1202
+ return $b->id - $a->id;
1203
+ return $date_diff;
1204
+ case "post_date ASC":
1205
+ $date_diff = strtotime($a->date) - strtotime($b->date);
1206
+ if ($date_diff == 0)
1207
+ return $a->id - $b->id;
1208
+ return $date_diff;
1209
+ case "post_title DESC":
1210
+ return strcasecmp($b->title, $a->title);
1211
+ case "post_title ASC":
1212
+ return strcasecmp($a->title, $b->title);
1213
+ case "menu_order DESC":
1214
+ return $b->menu_order - $a->menu_order;
1215
+ case "menu_order ASC":
1216
+ return $a->menu_order - $b->menu_order;
1217
+ case "customfs DESC":
1218
+ if ($this->args['post_secondary_order_metatype'] == 'numeric')
1219
+ return $b->customfs - $a->customfs;
1220
+ else
1221
+ return strcasecmp($b->customfs, $a->customfs);
1222
+ case "customfs ASC":
1223
+ if ($this->args['post_secondary_order_metatype'] == 'numeric')
1224
+ return $a->customfs - $b->customfs;
1225
+ else
1226
+ return strcasecmp($a->customfs, $b->customfs);
1227
+ case "RAND()":
1228
+ return rand(-1,1);
1229
+ default:
1230
+ return $b->relevance - $a->relevance;
1231
+ }
1232
+
1233
+ }
1234
+
1235
+ /**
1236
+ * If the primary fields are not equal, then leave it as it is.
1237
+ * The primary sorting already sorted the items out so return 0 - as equals
1238
+ */
1239
+ return $a->primary_order - $b->primary_order;
1240
+ }
1241
+
1242
+ /**
1243
+ * usort() custom function, sort by ID
1244
+ *
1245
+ * @param $obj_a
1246
+ * @param $obj_b
1247
+ *
1248
+ * @return mixed
1249
+ */
1250
+ protected function compare_posts( $obj_a, $obj_b ) {
1251
+ return $obj_a->id - $obj_b->id;
1252
+ }
1253
+
1254
+ /**
1255
+ * usort() custom function, sort by priority > relevance > date > title
1256
+ *
1257
+ * @param $a
1258
+ * @param $b
1259
+ *
1260
+ * @return int
1261
+ */
1262
+ protected function compare_by_rp( $a, $b ) {
1263
+ if ( $a->priority === $b->priority ) {
1264
+ if ( $a->relevance === $b->relevance ) {
1265
+ if ( $a->date != null && $a->date != "" ) {
1266
+ return strtotime( $b->date ) - strtotime( $a->date );
1267
+ } else {
1268
+ return strcasecmp( $a->title, $b->title );
1269
+ }
1270
+ } else {
1271
+ return $b->relevance - $a->relevance;
1272
+ }
1273
+ }
1274
+
1275
+ return $b->priority - $a->priority;
1276
+ }
1277
+
1278
+ /**
1279
+ * usort() custom function, sort by priority > date ascending
1280
+ *
1281
+ * @param $a
1282
+ * @param $b
1283
+ *
1284
+ * @return int
1285
+ */
1286
+ protected function compare_by_rd_asc( $a, $b ) {
1287
+ if ( $a->priority === $b->priority ) {
1288
+ return strtotime( $a->date ) - strtotime( $b->date );
1289
+ }
1290
+
1291
+ return $b->priority - $a->priority;
1292
+ }
1293
+
1294
+ /**
1295
+ * usort() custom function, sort by priority > date descending
1296
+ *
1297
+ * @param $a
1298
+ * @param $b
1299
+ *
1300
+ * @return int
1301
+ */
1302
+ protected function compare_by_rd_desc( $a, $b ) {
1303
+ if ( $a->priority === $b->priority ) {
1304
+ return strtotime( $b->date ) - strtotime( $a->date );
1305
+ }
1306
+
1307
+ return $b->priority - $a->priority;
1308
+ }
1309
+
1310
+ /**
1311
+ * usort() custom function, sort by title descending
1312
+ *
1313
+ * @param $a
1314
+ * @param $b
1315
+ *
1316
+ * @return int
1317
+ */
1318
+ protected function compare_by_title_desc( $a, $b ) {
1319
+ return strcasecmp( $b->title, $a->title );
1320
+ }
1321
+
1322
+ /**
1323
+ * usort() custom function, sort by title ascending
1324
+ *
1325
+ * @param $a
1326
+ * @param $b
1327
+ *
1328
+ * @return int
1329
+ */
1330
+ protected function compare_by_title_asc( $a, $b ) {
1331
+ return strcasecmp( $a->title, $b->title );
1332
+ }
1333
+
1334
+
1335
+ /**
1336
+ * Builds the query from the parts
1337
+ *
1338
+ * @param $parts
1339
+ *
1340
+ * @return string query
1341
+ */
1342
+ protected function build_query( $parts ) {
1343
+ $args = &$this->args;
1344
+ $kw_logic = str_replace('EX', '', strtoupper( $args['keyword_logic'] ) );
1345
+ $kw_logic = $kw_logic != 'AND' && $kw_logic != 'OR' ? 'AND' : $kw_logic;
1346
+
1347
+ $r_parts = array(); // relevance parts
1348
+
1349
+ /*------------------------- Build like --------------------------*/
1350
+ $exact_query = '';
1351
+ $like_query_arr = array();
1352
+ foreach ( $parts as $k=>$part ) {
1353
+ if ( isset($part[0]) && count($part[0]) > 0 ) {
1354
+ if ( $k == 0 )
1355
+ $exact_query = '(' . implode(' OR ', $part[0]) . ')';
1356
+ else
1357
+ $like_query_arr[] = '(' . implode(' OR ', $part[0]) . ')';
1358
+ }
1359
+ }
1360
+ $like_query = implode(' ' . $kw_logic . ' ', $like_query_arr);
1361
+
1362
+ // When $exact query is empty, then surely $like_query must be empty too, see above
1363
+ if ( $exact_query == '' ) {
1364
+ $like_query = "(1)";
1365
+ } else {
1366
+ // Both $like_query and $exact_query set
1367
+ if ( $like_query != '' ) {
1368
+ $like_query = "( $exact_query OR $like_query )";
1369
+ } else {
1370
+ $like_query = "( $exact_query )";
1371
+ }
1372
+ }
1373
+ /*---------------------------------------------------------------*/
1374
+
1375
+ /*---------------------- Build relevance ------------------------*/
1376
+ foreach ( $parts as $part ) {
1377
+ if ( isset($part[1]) && count($part[1]) > 0 )
1378
+ $r_parts = array_merge( $r_parts, $part[1] );
1379
+ }
1380
+ $relevance = implode( ' + ', $r_parts );
1381
+ if ( $args['_post_use_relevance'] != 1 || $relevance == "" ) {
1382
+ $relevance = "(1)";
1383
+ } else {
1384
+ $relevance = "($relevance)";
1385
+ }
1386
+ /*---------------------------------------------------------------*/
1387
+
1388
+ if ( isset($this->remaining_limit) ) {
1389
+ if ($this->limit_start != 0)
1390
+ $limit = $this->limit_start . ", " . $this->remaining_limit;
1391
+ else
1392
+ $limit = $this->remaining_limit;
1393
+ } else {
1394
+ $limit = 10;
1395
+ }
1396
+
1397
+ return str_replace(
1398
+ array( "{relevance_query}", "{like_query}", "{remaining_limit}" ),
1399
+ array( $relevance, $like_query, $limit ),
1400
+ $this->query
1401
+ );
1402
+
1403
+ }
1404
+
1405
+ /**
1406
+ * Post-processes the results
1407
+ *
1408
+ * @return array of results
1409
+ */
1410
+ protected function post_process() {
1411
+
1412
+ $pageposts = is_array( $this->results ) ? $this->results : array();
1413
+ $s = $this->s;
1414
+ $_s = $this->_s;
1415
+ $args = $this->args;
1416
+
1417
+ do_action("asl_start_post_processing");
1418
+
1419
+ // No post processing if the search data param is missing or explicitly set
1420
+ if ( !isset($args['_sd']) || $args['_no_post_process'] ) {
1421
+ $this->results = $pageposts;
1422
+ return $pageposts;
1423
+ }
1424
+
1425
+ $sd = $args['_sd'];
1426
+ $searchId = $args['_sid'];
1427
+ $com_options = wd_asl()->o['asl_compatibility'];
1428
+
1429
+ /*--------------------- For Image Parser -----------------------*/
1430
+ // Do not select the content field, if it is not used at all
1431
+ $get_content = $sd['showdescription'] == 1;
1432
+
1433
+ // Do not select excerpt if its not used at all
1434
+ $get_excerpt = !(
1435
+ $sd['primary_titlefield'] == 1 ||
1436
+ $sd['secondary_titlefield'] == 1 ||
1437
+ $sd['primary_descriptionfield'] == 1 ||
1438
+ $sd['secondary_descriptionfield'] == 1
1439
+ );
1440
+
1441
+ $image_settings = $sd['image_options'];
1442
+ foreach ( $pageposts as $k => &$r ) {
1443
+ // Attachment post-process uses this section, but it has a separate image parser, so skip that
1444
+ if ( $r->post_type == 'attachment' )
1445
+ continue;
1446
+
1447
+ if ( isset( $args['_switch_on_preprocess'] ) && is_multisite() ) {
1448
+ switch_to_blog( $r->blogid );
1449
+ }
1450
+
1451
+ if ( $image_settings['show_images'] != 0 &&
1452
+ '' !== ($im = $this->getBFIimage( $r, $get_content, $get_excerpt ))
1453
+ ) {
1454
+ if ( $image_settings['image_cropping'] == 0 ) {
1455
+ $r->image = $im;
1456
+ } else {
1457
+ if ( strpos( $im, "mshots/v1" ) === false && strpos( $im, ".gif" ) === false ) {
1458
+ $bfi_params = array( 'width' => $image_settings['image_width'],
1459
+ 'height' => $image_settings['image_height'],
1460
+ 'crop' => true
1461
+ );
1462
+ $r->image = bfi_thumb( $im, $bfi_params );
1463
+ } else {
1464
+ $r->image = $im;
1465
+ }
1466
+ }
1467
+ }
1468
+ }
1469
+ if ( isset( $args['_switch_on_preprocess'] ) && is_multisite() ) {
1470
+ restore_current_blog();
1471
+ }
1472
+ /*---------------------------------------------------------------*/
1473
+
1474
+ // For non-ajax searches, this is the cut off, no other post-processing required
1475
+ if ( !$args['_ajax_search'] ) {
1476
+ $this->results = $pageposts;
1477
+ return $pageposts;
1478
+ }
1479
+
1480
+ // VC 4.6+ fix: Shortcodes are not loaded in ajax responses
1481
+ // class_exists() is mandatory, some PHP versions fail
1482
+ if ( class_exists("WPBMap") && method_exists("WPBMap", "addAllMappedShortcodes") )
1483
+ WPBMap::addAllMappedShortcodes();
1484
+
1485
+
1486
+ $this->deregisterShortcodes();
1487
+
1488
+ global $sitepress;
1489
+
1490
+ /* Images, title, desc */
1491
+ foreach ( $pageposts as $k => &$r ) {
1492
+
1493
+ if ( isset( $args['_switch_on_preprocess'] ) && is_multisite() ) {
1494
+ switch_to_blog( $r->blogid );
1495
+ }
1496
+
1497
+ // ---- URL FIX for WooCommerce product variations
1498
+ $wc_prod_var_o = null; // Reset for each loop
1499
+ if ( $r->post_type == 'product_variation' && class_exists( 'WC_Product_Variation' ) ) {
1500
+ $wc_prod_var_o = wc_get_product( $r->id );
1501
+ $r->link = $wc_prod_var_o->get_permalink();
1502
+ } else {
1503
+ $r->link = get_permalink( $r->id );
1504
+ }
1505
+ // Filter it though WPML
1506
+ if ( $args['_wpml_lang'] != '') {
1507
+ if ( ICL_LANGUAGE_CODE != $args['_wpml_lang'] ) {
1508
+ $r->link = apply_filters('wpml_permalink', $r->link, $args['_wpml_lang'], true);
1509
+ }
1510
+ } else if ( is_object($sitepress) && method_exists($sitepress, 'get_default_language') ) {
1511
+ $l = apply_filters( 'wpml_post_language_details', null, $r->id );
1512
+ if ( is_array($l) && isset($l['language_code']) ) {
1513
+ $_lang = ICL_LANGUAGE_CODE;
1514
+ do_action( 'wpml_switch_language', $l['language_code'] );;
1515
+ $r->link = get_permalink($r->id);
1516
+ $r->link = apply_filters('wpml_permalink', $r->link, $l['language_code'], true);
1517
+ do_action( 'wpml_switch_language', $_lang );
1518
+ }
1519
+ }
1520
+
1521
+ $_t_keys = array('primary_titlefield', 'secondary_titlefield');
1522
+ foreach ($_t_keys as $tk) {
1523
+ $sd[$tk] = $sd[$tk] . ''; // Convert for the switch statement
1524
+ if ( $sd[$tk] == '-1' ) continue;
1525
+
1526
+ switch($sd[$tk]) {
1527
+ case '0':
1528
+ $r->title = get_the_title($r->id);
1529
+ break;
1530
+ case '1':
1531
+ if ( ASL_mb::strlen( $r->excerpt ) >= 200 ) {
1532
+ $r->title = wd_substr_at_word( $r->excerpt, 200 );
1533
+ } else {
1534
+ $r->title = $r->excerpt;
1535
+ }
1536
+ break;
1537
+ case 'c__f':
1538
+ if ( $sd[$tk.'_cf'] == '' ) {
1539
+ $r->title = get_the_title( $r->id );
1540
+ } else {
1541
+ $field_val = ASL_Helpers::getCFValue($sd[$tk.'_cf'], $r, $com_options['use_acf_getfield'], $args);
1542
+ if ( $field_val != '' ) {
1543
+ $r->title = wd_strip_tags_ws( $field_val, $sd['striptagsexclude'] );
1544
+ } else {
1545
+ $r->title = get_the_title($r->id);
1546
+ }
1547
+ }
1548
+ break;
1549
+ default:
1550
+ $r->title = get_the_title($r->id);
1551
+ }
1552
+
1553
+ if ($r->title != "") break;
1554
+ }
1555
+
1556
+ if ( !empty($sd['advtitlefield']) )
1557
+ $r->title = $this->adv_field(
1558
+ array(
1559
+ 'main_field_slug' => 'titlefield',
1560
+ 'main_field_value'=> $r->title,
1561
+ 'r' => $r,
1562
+ 'field_pattern' => stripslashes( $sd['advtitlefield'] )
1563
+ ),
1564
+ $com_options['use_acf_getfield']
1565
+ );
1566
+
1567
+ if ( ! isset( $sd['striptagsexclude'] ) ) {
1568
+ $sd['striptagsexclude'] = "<a><span>";
1569
+ }
1570
+
1571
+ $_t_keys = array('primary_descriptionfield', 'secondary_descriptionfield');
1572
+ $_content = '';
1573
+ foreach ($_t_keys as $tk) {
1574
+ $sd[$tk] = $sd[$tk] . ''; // Convert for the switch statement
1575
+ if ( $sd[$tk] == '-1' ) continue;
1576
+
1577
+ switch ($sd[$tk]) {
1578
+ case '1':
1579
+ if ( function_exists( 'qtranxf_use' ) && $args['_qtranslate_lang'] != "" ) {
1580
+ $r->excerpt = qtranxf_use($args['_qtranslate_lang'], $r->excerpt, false);
1581
+ }
1582
+ $_content = $r->excerpt;
1583
+ break;
1584
+ case '2':
1585
+ $_content = strip_tags( get_the_title( $r->id ), $sd['striptagsexclude'] );
1586
+ break;
1587
+ case 'c__f':
1588
+ if ( $sd[$tk.'_cf'] == '' ) {
1589
+ $_content = '';
1590
+ } else {
1591
+ $field_val = ASL_Helpers::getCFValue($sd[$tk.'_cf'], $r, $com_options['use_acf_getfield'], $args);
1592
+ if ( $field_val != '' ) {
1593
+ $_content = $field_val;
1594
+ } else {
1595
+ $_content = '';
1596
+ }
1597
+ }
1598
+ break;
1599
+ default: //including option '0', alias content
1600
+ if ( function_exists( 'qtranxf_use' ) && $args['_qtranslate_lang'] != "" ) {
1601
+ $r->content = qtranxf_use($args['_qtranslate_lang'], $r->content, false);
1602
+ }
1603
+ // For product variations, do something special
1604
+ if ( isset($wc_prod_var_o) ) {
1605
+ $r->content = $wc_prod_var_o->get_description();
1606
+ if ( $r->content == '') {
1607
+ $_pprod = wc_get_product($wc_prod_var_o->get_parent_id());
1608
+ $r->content = $_pprod->get_description();
1609
+ }
1610
+ }
1611
+ $_content = $r->content;
1612
+ break;
1613
+ }
1614
+
1615
+ // Remove unneccessary gutemberg blocks
1616
+ $_content = ASL_Helpers::removeGutenbergBlocks($_content, array('core-embed/*'));
1617
+
1618
+ // Deal with the shortcodes here, for more accuracy
1619
+ if ( $sd['shortcode_op'] == "remove" ) {
1620
+ if ( $_content != "" ) {
1621
+ // Remove shortcodes, keep the content, really fast and effective method
1622
+ $_content = preg_replace("~(?:\[/?)[^\]]+/?\]~su", '', $_content);
1623
+ }
1624
+ } else {
1625
+ if ( $_content != "" ) {
1626
+ $_content = apply_filters( 'the_content', $_content, $searchId );
1627
+ }
1628
+ }
1629
+
1630
+ if ( $_content != '') break;
1631
+ }
1632
+
1633
+ // Remove inline styles and scripts
1634
+ $_content = preg_replace( array(
1635
+ '#<script(.*?)>(.*?)</script>#is',
1636
+ '#<style(.*?)>(.*?)</style>#is'
1637
+ ), '', $_content );
1638
+
1639
+ $_content = wd_strip_tags_ws( $_content, $sd['striptagsexclude'] );
1640
+
1641
+ // Get the words from around the search phrase, or just the description
1642
+ if ( $sd['description_context'] == 1 && count( $_s ) > 0 && $s != '') {
1643
+ // Try for an exact match
1644
+ $_ex_content = $this->context_find(
1645
+ $_content, $s,
1646
+ floor($sd['descriptionlength'] / 6),
1647
+ $sd['descriptionlength'],
1648
+ $sd['description_context_depth'],
1649
+ true
1650
+ );
1651
+ if ( $_ex_content === false ) {
1652
+ // No exact match, go with the first keyword
1653
+ $_content = $this->context_find(
1654
+ $_content, $_s[0],
1655
+ floor($sd['descriptionlength'] / 6),
1656
+ $sd['descriptionlength'],
1657
+ $sd['description_context_depth']
1658
+ );
1659
+ } else {
1660
+ $_content = $_ex_content;
1661
+ }
1662
+ } else if ( $_content != '' && ( ASL_mb::strlen( $_content ) > $sd['descriptionlength'] ) ) {
1663
+ $_content = wd_substr_at_word($_content, $sd['descriptionlength']) . "...";
1664
+ }
1665
+
1666
+ $_content = wd_closetags( $_content );
1667
+
1668
+ if ( !empty($sd['advdescriptionfield']) )
1669
+ $r->content = $this->adv_field(
1670
+ array(
1671
+ 'main_field_slug' => 'descriptionfield',
1672
+ 'main_field_value'=> $_content,
1673
+ 'r' => $r,
1674
+ 'field_pattern' => stripslashes( $sd['advdescriptionfield'] )
1675
+ ),
1676
+ $com_options['use_acf_getfield']
1677
+ );
1678
+
1679
+ // --------------------------------- DATE -----------------------------------
1680
+ if ($sd["showdate"] == 1) {
1681
+ $post_time = strtotime($r->date);
1682
+
1683
+ if ( $sd['custom_date'] == 1) {
1684
+ $date_format = w_isset_def($sd['custom_date_format'], "Y-m-d H:i:s");
1685
+ } else {
1686
+ $date_format = get_option('date_format', "Y-m-d") . " " . get_option('time_format', "H:i:s");
1687
+ }
1688
+
1689
+ $r->date = @date_i18n($date_format, $post_time);
1690
+ }
1691
+ // --------------------------------------------------------------------------
1692
+ }
1693
+
1694
+ if ( isset( $args['_switch_on_preprocess'] ) && is_multisite() ) {
1695
+ restore_current_blog();
1696
+ }
1697
+
1698
+ $this->results = $pageposts;
1699
+
1700
+ return $pageposts;
1701
+
1702
+ }
1703
+
1704
+ /**
1705
+ * Fetches an image for BFI class
1706
+ *
1707
+ * @param $post StdClass post object
1708
+ * @param $get_content bool to request the post content
1709
+ * @param $get_excerpt bool to request the post excerpt
1710
+ * @return string image URL
1711
+ */
1712
+ protected function getBFIimage( $post, $get_content = false, $get_excerpt = false ) {
1713
+ if ( ! isset( $post->image ) || $post->image == null ) {
1714
+ $args = $this->args;
1715
+ if ( !isset($args['_sd']['image_options']) )
1716
+ return "";
1717
+ $sd = $args['_sd'];
1718
+ $image_settings = $args['_sd']['image_options'];
1719
+
1720
+ if ( ! isset( $post->id ) ) {
1721
+ return "";
1722
+ }
1723
+ $im = "";
1724
+ for ( $i = 1; $i < 6; $i ++ ) {
1725
+ switch ( $image_settings[ 'image_source' . $i ] ) {
1726
+ case "featured":
1727
+ $size = $image_settings['image_source_featured'] == "original" ? 'full' : $image_settings['image_source_featured'];
1728
+ if ( $post->post_type == 'attachment' ) {
1729
+ $imx = wp_get_attachment_image_src($post->id, $size, false);
1730
+ } else {
1731
+ $imx = wp_get_attachment_image_src(
1732
+ get_post_thumbnail_id($post->id), $size, false
1733
+ );
1734
+ }
1735
+ if ( !is_wp_error($imx) && $imx !== false && isset($imx[0]) )
1736
+ $im = $imx[0];
1737
+ break;
1738
+ case "content":
1739
+ $content = $get_content ? get_post_field('post_content', $post->id) : $post->content;
1740
+
1741
+ if ( $image_settings['apply_content_filter'] == 1 )
1742
+ $content = apply_filters('the_content', $content);
1743
+
1744
+ $im = asl_get_image_from_content( $content, $sd['image_parser_image_number'], $sd['image_parser_exclude_filenames'] );
1745
+ break;
1746
+ case "excerpt":
1747
+ $excerpt = $get_excerpt ? get_post_field('post_excerpt', $post->id) : $post->excerpt;
1748
+
1749
+ $im = asl_get_image_from_content( $excerpt, $sd['image_parser_image_number'], $sd['image_parser_exclude_filenames'] );
1750
+ break;
1751
+ case "screenshot":
1752
+ $im = 'https://s.wordpress.com/mshots/v1/' . urlencode( get_permalink( $post->id ) ) .
1753
+ '?w=' . $image_settings['image_width'] . '&h=' . $image_settings['image_height'];
1754
+ break;
1755
+ case "post_format":
1756
+ $format = get_post_format( $post->id );
1757
+
1758
+ switch ($format) {
1759
+ case "audio":
1760
+ $im = ASL_URL_NP . "img/post_format/audio.png";
1761
+ break;
1762
+ case "video":
1763
+ $im = ASL_URL_NP . "img/post_format/video.png";
1764
+ break;
1765
+ case "quote":
1766
+ $im = ASL_URL_NP . "img/post_format/quote.png";
1767
+ break;
1768
+ case "image":
1769
+ $im = ASL_URL_NP . "img/post_format/image.png";
1770
+ break;
1771
+ case "gallery":
1772
+ $im = ASL_URL_NP . "img/post_format/gallery.png";
1773
+ break;
1774
+ case "link":
1775
+ $im = ASL_URL_NP . "img/post_format/link.png";
1776
+ break;
1777
+ default:
1778
+ $im = ASL_URL_NP . "img/post_format/default.png";
1779
+ break;
1780
+ }
1781
+ break;
1782
+ case "custom":
1783
+ if ( $image_settings['image_custom_field'] != "" ) {
1784
+ $val = get_post_meta( $post->id, $image_settings['image_custom_field'], true );
1785
+ if ( $val != null && $val != "" ) {
1786
+ if ( is_numeric($val) ) {
1787
+ $im = wp_get_attachment_url( $val );
1788
+ } else {
1789
+ $im = $val;
1790
+ }
1791
+ }
1792
+ }
1793
+ break;
1794
+ case "default":
1795
+ if ( $image_settings['image_default'] != "" ) {
1796
+ $im = $image_settings['image_default'];
1797
+ }
1798
+ break;
1799
+ default:
1800
+ $im = "";
1801
+ break;
1802
+ }
1803
+ if ( $im != null && $im != '' ) {
1804
+ break;
1805
+ }
1806
+ }
1807
+ if ( !is_wp_error($im) )
1808
+ return ASL_Helpers::fixSSLURLs($im);
1809
+ return '';
1810
+ } else {
1811
+ return ASL_Helpers::fixSSLURLs($post->image);
1812
+ }
1813
+ }
1814
+
1815
+
1816
+ /**
1817
+ * Generates the final field, based on the advanced field pattern
1818
+ *
1819
+ * @uses ASL_Helpers::getCFValue()
1820
+ * @uses ASL_Helpers::fixSSLURLs()
1821
+ * @uses shortcode_parse_atts()
1822
+ *
1823
+ * @param array $f_args Field related arguments
1824
+ * @param boolean $use_acf If true, uses ACF get_field() function to get the meta
1825
+ * @param boolean $empty_on_missing If true, returns an empty string if any of the fields is empty.
1826
+ *
1827
+ * @return string Final post title
1828
+ */
1829
+ protected function adv_field( $f_args, $use_acf = false, $empty_on_missing = false ) {
1830
+ $args = &$this->args;
1831
+
1832
+ $specials = array('__id', '__title', '__content', '__link', '__url', '__image', '__date', '__author');
1833
+
1834
+ $f_args = wp_parse_args($f_args, array(
1835
+ 'main_field_slug' => 'titlefield', // The 'slug', aka the original field name
1836
+ 'main_field_value'=> '', // The default field value
1837
+ 'r' => null, // Result object
1838
+ 'field_pattern' => '{titlefield}' // The field pattern
1839
+ ));
1840
+ $_f_args = $f_args;
1841
+
1842
+ if ( $f_args['field_pattern'] == '' ) {
1843
+ return $f_args['field_value'];
1844
+ }
1845
+ $field_pattern = $f_args['field_pattern']; // Lets not make changes to arguments, shall we.
1846
+
1847
+ // Find conditional patterns, like [prefix {field} suffix}
1848
+ preg_match_all( "/(\[.*?\])/", $field_pattern, $matches );
1849
+ if ( isset( $matches[0] ) && isset( $matches[1] ) && is_array( $matches[1] ) ) {
1850
+ foreach ( $matches[1] as $fieldset ) {
1851
+ // Pass on each section to this function again, the code will never get here
1852
+ $_f_args['field_pattern'] = str_replace(array('[', ']'), '', $fieldset);
1853
+ $processed_fieldset = $this->adv_field(
1854
+ $_f_args,
1855
+ $use_acf,
1856
+ true
1857
+ );
1858
+ // Replace the original with the processed version, first occurrence, in case of duplicates
1859
+ $field_pattern = ASL_Helpers::replaceFirst($fieldset, $processed_fieldset, $field_pattern);
1860
+ }
1861
+ }
1862
+
1863
+ preg_match_all( "/{(.*?)}/", $field_pattern, $matches );
1864
+ if ( isset( $matches[0] ) && isset( $matches[1] ) && is_array( $matches[1] ) ) {
1865
+ foreach ( $matches[1] as $complete_field ) {
1866
+ $field_args = shortcode_parse_atts($complete_field);
1867
+ if ( is_array($field_args) && isset($field_args[0]) ) {
1868
+ $field = array_shift($field_args);
1869
+ } else {
1870
+ continue;
1871
+ }
1872
+ if ( $field == $f_args['main_field_slug'] ) {
1873
+ $val = $f_args['main_field_value'];
1874
+ if ( isset($field_args['maxlength']) ) {
1875
+ $val = wd_substr_at_word($val, $field_args['maxlength']);
1876
+ }
1877
+ // value, field name, post object, field arguments
1878
+ $val = apply_filters('asl_cpt_advanced_field_value', $val, $field, $f_args['r'], $f_args);
1879
+ $field_pattern = str_replace( '{'.$complete_field.'}', $val, $field_pattern );
1880
+ } else {
1881
+ if ( in_array($field, $specials) ) {
1882
+ $r = $f_args['r'];
1883
+ $val = '';
1884
+ switch ($field) {
1885
+ case '__id':
1886
+ $val = isset($r->id) ? $r->id : '';
1887
+ break;
1888
+ case '__title':
1889
+ $val = isset($r->title) ? $r->title : '';
1890
+ break;
1891
+ case '__content':
1892
+ $val = isset($r->content) ? $r->content : '';
1893
+ break;
1894
+ case '__link':
1895
+ case '__url':
1896
+ $val = isset($r->link) ? $r->link : '';
1897
+ break;
1898
+ case '__image':
1899
+ $val = isset($r->image) ? $r->image : '';
1900
+ break;
1901
+ case '__date':
1902
+ if ( isset($r->date) ) {
1903
+ if ( isset($field_args['date_format']) ) {
1904
+ $val = date_i18n($field_args['date_format'], strtotime($r->date));
1905
+ } else {
1906
+ $val = $r->date;
1907
+ }
1908
+ }
1909
+ break;
1910
+ case '__author':
1911
+ $val = isset($r->author) && $r->author != '' ? $r->author : get_the_author_meta( 'display_name' , get_post_field ('post_author', $r->id));
1912
+ break;
1913
+ }
1914
+ } else if(strpos($field, '_taxonomy_') === 0 || strpos($field, '__tax_') === 0) {
1915
+ $taxonomy = str_replace(array('_taxonomy_', '__tax_'), '', $field);
1916
+ if ($taxonomy == '')
1917
+ continue;
1918
+ $count = isset($field_args['count']) ? $field_args['count'] + 0 : 5;
1919
+ $count = $count == 0 ? 5 : $count;
1920
+ $separator = isset($field_args['separator']) ? $field_args['separator']: ', ';
1921
+ $orderby = isset($field_args['orderby']) ? $field_args['orderby']: 'name';
1922
+ $order = isset($field_args['order']) ? $field_args['order']: 'ASC';
1923
+ $exclude = isset($field_args['exclude']) ? '1, '.$field_args['exclude']: '1';
1924
+ $hide_empty = isset($field_args['hide_empty']) ? $field_args['hide_empty'] == 1 : true;
1925
+ $hierarchical = isset($field_args['hierarchical']) ? $field_args['hierarchical'] == 1 : true;
1926
+ $childless = isset($field_args['childless']) ? $field_args['childless'] == 1 : false;
1927
+ $val = ASL_Helpers::getTermsList($taxonomy, $count, $separator, array(
1928
+ 'orderby' => $orderby,
1929
+ 'order' => $order,
1930
+ 'object_ids'=> $f_args['r']->id,
1931
+ 'exclude' => $exclude,
1932
+ 'hide_empty'=> $hide_empty,
1933
+ 'hierarchical' => $hierarchical,
1934
+ 'childless' => $childless
1935
+ ));
1936
+ } else if ( strpos($field, '_pods_') === 0 || strpos($field, '_pod_') === 0 ) {
1937
+ // PODs field
1938
+ $val = ASL_Helpers::getPODsValue($field, $f_args['r']);
1939
+ } else if ( strpos($field, '__um_') === 0 ) {
1940
+ // User Meta Field
1941
+ $um_field = str_replace('__um_', '', $field);
1942
+ $author = get_post_field( 'post_author', $f_args['r']->id );
1943
+ $val = ASL_Helpers::getUserCFValue($um_field, $author, $use_acf);
1944
+ }else {
1945
+ // Probably a custom field?
1946
+ $val = ASL_Helpers::getCFValue($field, $f_args['r'], $use_acf, $args, $field_args);
1947
+ }
1948
+ // For the recursive call to break, if any of the fields is empty
1949
+ if ( $empty_on_missing && trim($val) == '')
1950
+ return '';
1951
+ $val = ASL_Helpers::fixSSLURLs($val);
1952
+
1953
+ if ( isset($field_args['maxlength']) ) {
1954
+ $val = wd_substr_at_word($val, $field_args['maxlength']);
1955
+ }
1956
+
1957
+ // value, field name, post object, field arguments
1958
+ $val = apply_filters('asl_cpt_advanced_field_value', $val, $field, $f_args['r'], $f_args);
1959
+ $field_pattern = str_replace( '{' . $complete_field . '}', $val, $field_pattern );
1960
+ }
1961
+ }
1962
+ }
1963
+
1964
+ return $field_pattern;
1965
+ }
1966
+
1967
+ public function deregisterShortcodes() {
1968
+ // Remove shortcodes with contents
1969
+ $ignore_shortcodes = array(
1970
+ "wpdreams_ajaxsearchpro", "wd_asp", "wd_asl", "wpdreams_ajaxsearchlite",
1971
+ "embed"
1972
+ );
1973
+ foreach ( $ignore_shortcodes as $shortcode ) {
1974
+ remove_shortcode( $shortcode );
1975
+ add_shortcode( $shortcode, array( $this, 'return_empty_string' ) );
1976
+ }
1977
+ }
1978
+
1979
+ /**
1980
+ * An empty function to override individual shortcodes, this must be public
1981
+ *
1982
+ * @return string
1983
+ */
1984
+ public function return_empty_string() {
1985
+ return "";
1986
+ }
1987
+ }
1988
+ }
includes/classes/search/class-asl-search.php ADDED
@@ -0,0 +1,437 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* Prevent direct access */
3
+ defined('ABSPATH') or die("You can't access this file directly.");
4
+
5
+ if (!class_exists('ASL_Search')) {
6
+ /**
7
+ * Search class Abstract
8
+ *
9
+ * All search classes should be descendants to this abstract.
10
+ *
11
+ * @class ASL_Search
12
+ * @version 2.0
13
+ * @package AjaxSearchPro/Abstracts
14
+ * @category Class
15
+ * @author Ernest Marcinko
16
+ */
17
+ abstract class ASL_Search {
18
+
19
+ // Total results count (unlimited)
20
+ public $results_count = 0;
21
+
22
+ // Actual results count, results which are returned
23
+ public $return_count = 0;
24
+
25
+ /**
26
+ * @var array of parameters
27
+ */
28
+ protected $args;
29
+
30
+ protected $pre_field = '';
31
+ protected $suf_field = '';
32
+ protected $pre_like = '';
33
+ protected $suf_like = '';
34
+
35
+ /**
36
+ * @var int the remaining limit (number of items to look for)
37
+ */
38
+ protected $remaining_limit;
39
+ /**
40
+ * @var int the start of the limit
41
+ */
42
+ protected $limit_start = 0;
43
+ /**
44
+ * @var int remaining limit modifier
45
+ */
46
+ protected $remaining_limit_mod = 10;
47
+
48
+ /**
49
+ * @var array of submitted options from the front end
50
+ */
51
+ protected $options;
52
+ /**
53
+ * @var int the ID of the current search instance
54
+ */
55
+ protected $searchId;
56
+ /**
57
+ * @var array of the current search options
58
+ */
59
+ protected $searchData;
60
+ /**
61
+ * @var array of results
62
+ */
63
+ protected $results;
64
+ /**
65
+ * @var string the search phrase
66
+ */
67
+ protected $s;
68
+ /**
69
+ * @var array of each search phrase
70
+ */
71
+ protected $_s;
72
+ /**
73
+ * @var string the reversed search phrase
74
+ */
75
+ protected $sr;
76
+ /**
77
+ * @var array of each reversed search phrase
78
+ */
79
+ protected $_sr;
80
+
81
+ /**
82
+ * @var int the current blog ID
83
+ */
84
+ protected $c_blogid;
85
+ /**
86
+ * @var string the final search query
87
+ */
88
+ protected $query;
89
+
90
+ /**
91
+ * Create the class
92
+ *
93
+ * @param $params
94
+ */
95
+ public function __construct($args) {
96
+ $this->args = $args;
97
+
98
+ if ( isset($args['_remaining_limit_mod']) )
99
+ $this->remaining_limit_mod = $args['_remaining_limit_mod'];
100
+
101
+ $this->c_blogid = get_current_blog_id();
102
+ }
103
+
104
+ /**
105
+ * Initiates the search operation
106
+ *
107
+ * @return array
108
+ */
109
+ public function search( $s = false ) {
110
+
111
+ if ( ASL_mb::strlen($s) > 120 )
112
+ $s = ASL_mb::substr($s, 0, 120);
113
+
114
+ $this->prepare_keywords($s);
115
+ $this->do_search();
116
+ $this->post_process();
117
+
118
+ return is_array($this->results) ? $this->results : array();
119
+ }
120
+
121
+ public function prepare_keywords($s) {
122
+
123
+ if ( $s !== false )
124
+ $keyword = $s;
125
+ else
126
+ $keyword = $this->args['s'];
127
+
128
+ $keyword = $this->compatibility($keyword);
129
+ $keyword_rev = ASL_Helpers::reverseString($keyword);
130
+
131
+ $this->s = ASL_Helpers::escape( $keyword );
132
+ $this->sr = ASL_Helpers::escape( $keyword_rev );
133
+
134
+ /**
135
+ * Avoid double escape, explode the $keyword instead of $this->s
136
+ * Regex to match individual words and phrases between double quotes
137
+ **/
138
+ if (
139
+ preg_match_all( '/«.*?»/', $keyword, $m ) > 0 && // Only if there is at lease one complete «text» match
140
+ preg_match_all( '/«.*?(»|$)|((?<=[\t «,+])|^)[^\t »,+]+/', $keyword, $matches )
141
+ ) {
142
+ $this->_s = $this->parse_search_terms( $matches[0] );
143
+ } else if (
144
+ preg_match_all( '/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keyword, $matches )
145
+ ) {
146
+ $this->_s = $this->parse_search_terms( $matches[0] );
147
+ } else {
148
+ $this->_s = $this->parse_search_terms( explode(" ", $keyword) );
149
+ }
150
+ if (
151
+ preg_match_all( '/«.*?»/', $keyword_rev, $m ) > 0 && // Only if there is at lease one complete «text» match
152
+ preg_match_all( '/«.*?(»|$)|((?<=[\t «,+])|^)[^\t »,+]+/', $keyword_rev, $matches )
153
+ ) {
154
+ $this->_sr = $this->parse_search_terms( array_reverse($matches[0]) );
155
+ } else if ( preg_match_all( '/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keyword_rev, $matches ) ) {
156
+ $this->_sr = $this->parse_search_terms( array_reverse($matches[0]) );
157
+ } else {
158
+ $this->_sr = $this->parse_search_terms( array_reverse( explode(" ", $keyword_rev ) ) );
159
+ }
160
+
161
+ foreach ($this->_s as $k=>$w) {
162
+ if ( ASL_mb::strlen($w) < $this->args['min_word_length'] ) {
163
+ unset($this->_s[$k]);
164
+ }
165
+ }
166
+
167
+ foreach ($this->_sr as $k=>$w) {
168
+ if ( ASL_mb::strlen($w) < $this->args['min_word_length'] ) {
169
+ unset($this->_sr[$k]);
170
+ }
171
+ }
172
+ }
173
+
174
+ /**
175
+ * Check if the terms are suitable for searching.
176
+ *
177
+ * @param array $terms Terms to check.
178
+ * @return array Terms
179
+ */
180
+ protected function parse_search_terms( $terms ) {
181
+ $checked = array();
182
+
183
+ foreach ( $terms as $term ) {
184
+ // keep before/after spaces when term is for exact match
185
+ if ( preg_match( '/^".+"$/', $term ) ) {
186
+ $term = trim($term, "\"'");
187
+ } else if ( preg_match( '/^«.+»$/', $term ) ) { // same for russian quotes
188
+ $term = trim($term, "«»'");
189
+ } else {
190
+ $term = trim($term, "\"' ");
191
+ }
192
+
193
+ if ( $term != '' )
194
+ $checked[] = $term;
195
+ }
196
+
197
+ if ( count($checked) > 0 )
198
+ $checked = ASL_Helpers::escape(
199
+ array_slice(array_unique($checked), 0, $this->args['_keyword_count_limit'])
200
+ );
201
+
202
+ return $checked;
203
+ }
204
+
205
+ /**
206
+ * The search function
207
+ */
208
+ protected function do_search() {}
209
+
210
+ /**
211
+ * Post processing abstract
212
+ */
213
+ protected function post_process() {
214
+
215
+ if (is_array($this->results) && count($this->results) > 0) {
216
+ foreach ($this->results as $k => &$r) {
217
+ if ( !is_object($r) ) continue;
218
+ if ( !isset($r->id) ) $r->id = 0;
219
+ $r->image = isset($r->image) ? $r->image : "";
220
+ }
221
+ }
222
+
223
+ }
224
+
225
+ /**
226
+ * Converts the keyword to the correct case and sets up the pre-suff fields.
227
+ *
228
+ * @param $s
229
+ * @return string
230
+ */
231
+ protected function compatibility($s) {
232
+ /**
233
+ * On forced case sensitivity: Let's add BINARY keyword before the LIKE
234
+ * On forced case in-sensitivity: Append the lower() function around each field
235
+ */
236
+ if ( $this->args['_db_force_case'] === 'sensitivity' ) {
237
+ $this->pre_like = 'BINARY ';
238
+ } else if ( $this->args['_db_force_case'] === 'insensitivity' ) {
239
+ if ( function_exists( 'mb_convert_case' ) )
240
+ $s = mb_convert_case( $s, MB_CASE_LOWER, "UTF-8" );
241
+ else
242
+ $s = strtoupper( $s );
243
+ // if no mb_ functions :(
244
+
245
+ $this->pre_field .= 'lower(';
246
+ $this->suf_field .= ')';
247
+ }
248
+
249
+ /**
250
+ * Check if utf8 is forced on LIKE
251
+ */
252
+ if ( w_isset_def( $this->args['_db_force_utf8_like'], 0 ) == 1 )
253
+ $this->pre_like .= '_utf8';
254
+
255
+ /**
256
+ * Check if unicode is forced on LIKE, but only apply if utf8 is not
257
+ */
258
+ if ( w_isset_def( $this->args['_db_force_unicode'], 0 ) == 1
259
+ && w_isset_def( $this->args['_db_force_utf8_like'], 0 ) == 0
260
+ )
261
+ $this->pre_like .= 'N';
262
+
263
+ return $s;
264
+ }
265
+
266
+ /**
267
+ * Builds the query from the parts
268
+ *
269
+ * @param $parts
270
+ *
271
+ * @return string query
272
+ */
273
+ protected function build_query( $parts ) {
274
+
275
+ $args = &$this->args;
276
+ $kw_logic = str_replace('EX', '', strtoupper( $args['keyword_logic'] ) );
277
+ $kw_logic = $kw_logic != 'AND' && $kw_logic != 'OR' ? 'AND' : $kw_logic;
278
+
279
+ $r_parts = array(); // relevance parts
280
+
281
+ /*------------------------- Build like --------------------------*/
282
+ $exact_query = '';
283
+ $like_query_arr = array();
284
+ foreach ( $parts as $k=>$part ) {
285
+ if ( $k == 0 )
286
+ $exact_query = '(' . implode(' OR ', $part[0]) . ')';
287
+ else
288
+ $like_query_arr[] = '(' . implode(' OR ', $part[0]) . ')';
289
+ }
290
+ $like_query = implode(' ' . $kw_logic . ' ', $like_query_arr);
291
+
292
+ // When $exact query is empty, then surely $like_query must be empty too, see above
293
+ if ( $exact_query == '' ) {
294
+ $like_query = "(1)";
295
+ } else {
296
+ // Both $like_query and $exact_query set
297
+ if ( $like_query != '' ) {
298
+ $like_query = "( $exact_query OR $like_query )";
299
+ } else {
300
+ $like_query = "( $exact_query )";
301
+ }
302
+ }
303
+ /*---------------------------------------------------------------*/
304
+
305
+ /*---------------------- Build relevance ------------------------*/
306
+ foreach ( $parts as $part ) {
307
+ if ( isset($part[1]) && count($part[1]) > 0 )
308
+ $r_parts = array_merge( $r_parts, $part[1] );
309
+ }
310
+ $relevance = implode( ' + ', $r_parts );
311
+ if ( $args['_post_use_relevance'] != 1 || $relevance == "" ) {
312
+ $relevance = "(1)";
313
+ } else {
314
+ $relevance = "($relevance)";
315
+ }
316
+ /*---------------------------------------------------------------*/
317
+
318
+ if ( isset($this->remaining_limit) ) {
319
+ if ($this->limit_start != 0)
320
+ $limit = $this->limit_start . ", " . $this->remaining_limit;
321
+ else
322
+ $limit = $this->remaining_limit;
323
+ } else {
324
+ $limit = 10;
325
+ }
326
+
327
+ return str_replace(
328
+ array( "{relevance_query}", "{like_query}", "{remaining_limit}" ),
329
+ array( $relevance, $like_query, $limit ),
330
+ $this->query
331
+ );
332
+
333
+ }
334
+
335
+ /**
336
+ * Returns the context of a phrase within a text.
337
+ * Uses preg_split method to iterate through strings.
338
+ *
339
+ * @uses ASL_mb
340
+ * @uses wd_substr_at_word()
341
+ * @param $str string context
342
+ * @param $needle string context
343
+ * @param $context int length of the context
344
+ * @param $maxlength int maximum length of the string in characters
345
+ * @param $str_length_limit source string maximum length
346
+ * @return string
347
+ */
348
+ public function context_find($str, $needle, $context, $maxlength, $str_length_limit = 10000, $false_on_no_match = false) {
349
+ $haystack = remove_accents(' '.trim($str).' ');
350
+
351
+ // To prevent memory overflow, we need to limit the hay to relatively low count
352
+ $haystack = wd_substr_at_word(ASL_mb::strtolower($haystack), $str_length_limit);
353
+ $needle = remove_accents(ASL_mb::strtolower($needle));
354
+
355
+ if ( $needle == "" ) {
356
+ if ( ASL_mb::strlen($str) > $maxlength) {
357
+ return wd_substr_at_word($str, $maxlength) . "...";
358
+ } else {
359
+ return $str;
360
+ }
361
+ }
362
+
363
+ /**
364
+ * This is an interesting issue. Turns out mb_substr($hay, $start, 1) is very ineffective.
365
+ * the preg_split(..) method is far more efficient in terms of speed, however it needs much more
366
+ * memory. In our case speed is the top priority. However to prevent memory overflow, the haystack
367
+ * is reduced to 10000 characters (roughly 1500 words) first.
368
+ *
369
+ * Reference ticket: https://wp-dreams.com/forums/topic/search-speed/
370
+ * Speed tests: http://stackoverflow.com/questions/3666306/how-to-iterate-utf-8-string-in-php
371
+ */
372
+ $chrArray = preg_split('//u', $haystack, -1, PREG_SPLIT_NO_EMPTY);
373
+ $hay_length = count($chrArray) - 1;
374
+
375
+ if ( $i = ASL_mb::strpos($haystack, $needle) ) {
376
+ $start=$i;
377
+ $end=$i;
378
+ $spaces=0;
379
+
380
+ while ($spaces < ((int) $context/2) && $start > 0) {
381
+ $start--;
382
+ if ($chrArray[$start] == ' ') {
383
+ $spaces++;
384
+ }
385
+ }
386
+
387
+ while ($spaces < ($context +1) && $end < $hay_length) {
388
+ $end++;
389
+ if ($chrArray[$end] == ' ') {
390
+ $spaces++;
391
+ }
392
+ }
393
+
394
+ while ($spaces < ($context +1) && $start > 0) {
395
+ $start--;
396
+ if ($chrArray[$start] == ' ') {
397
+ $spaces++;
398
+ }
399
+ }
400
+
401
+ $str_start = ($start - 1) < 0 ? 0 : ($start -1);
402
+ $str_end = ($end - 1) < 0 ? 0 : ($end -1);
403
+
404
+ $result = trim( ASL_mb::substr($str, $str_start, ($str_end - $str_start)) );
405
+
406
+ // Somewhere inbetween..
407
+ if ( $start != 0 && $end < $hay_length )
408
+ return "..." . $result . "...";
409
+
410
+ // Beginning
411
+ if ( $start == 0 && $end < $hay_length )
412
+ return $result . "...";
413
+
414
+ // End
415
+ if ( $start != 0 && $end == $hay_length )
416
+ return "..." . $result;
417
+
418
+ // If it is too long, strip it
419
+ if ( ASL_mb::strlen($result) > $maxlength)
420
+ return wd_substr_at_word( $result, $maxlength ) . "...";
421
+
422
+ // Else, it is the whole
423
+ return $result;
424
+
425
+ } else {
426
+ if ( $false_on_no_match )
427
+ return false;
428
+
429
+ // If it is too long, strip it
430
+ if ( ASL_mb::strlen($str) > $maxlength)
431
+ return wd_substr_at_word( $str, $maxlength ) . "...";
432
+
433
+ return $str;
434
+ }
435
+ }
436
+ }
437
+ }
includes/classes/search/search.class.php DELETED
@@ -1,241 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- if (!class_exists('wpdreams_search')) {
6
- /**
7
- * Search class Abstract
8
- *
9
- * All search classes should be descendants to this abstract.
10
- *
11
- * @class wpdreams_search
12
- * @version 1.1
13
- * @package AjaxSearchPro/Abstracts
14
- * @category Class
15
- * @author Ernest Marcinko
16
- */
17
- abstract class wpdreams_search {
18
-
19
- /**
20
- * @var array of parameters
21
- */
22
- protected $params;
23
- /**
24
- * @var array of submitted options from the front end
25
- */
26
- protected $options;
27
- /**
28
- * @var int the ID of the current search instance
29
- */
30
- protected $searchId;
31
- /**
32
- * @var array of the current search options
33
- */
34
- protected $searchData;
35
- /**
36
- * @var array of results
37
- */
38
- protected $results;
39
- /**
40
- * @var string the search phrase
41
- */
42
- protected $s;
43
- /**
44
- * @var string the reverse search phrase
45
- */
46
- protected $sr;
47
- /**
48
- * @var array of each search phrase
49
- */
50
- protected $_s;
51
- /**
52
- * @var array of each search phrase in reverse
53
- */
54
- protected $_sr;
55
-
56
- protected $pre_field = '';
57
- protected $suf_field = '';
58
- protected $pre_like = '';
59
- protected $suf_like = '';
60
- protected $imageSettings;
61
-
62
- /**
63
- * Create the class
64
- *
65
- * @param $params
66
- */
67
- function __construct($params) {
68
-
69
- $this->params = $params;
70
-
71
- // Pass the general options
72
- $options = w_isset_def($params['options'], array());
73
-
74
- // Set a few values for faster usage
75
- $options['set_exactonly'] = (isset($params['options']['set_exactonly'])?true:false);
76
- $options['set_intitle'] = (isset($params['options']['set_intitle'])?true:false);
77
- $options['set_incontent'] = (isset($params['options']['set_incontent'])?true:false);
78
- $options['set_incomments'] = (isset($params['options']['set_incomments'])?true:false);
79
- $options['set_inexcerpt'] = (isset($params['options']['set_inexcerpt'])?true:false);
80
- $options['set_inposts'] = (isset($params['options']['set_inposts'])?true:false);
81
- $options['set_inpages'] = (isset($params['options']['set_inpages'])?true:false);
82
- $options['searchinterms'] = (($params['data']['searchinterms']==1)?true:false);
83
- $options['set_inbpusers'] = (isset($params['options']['set_inbpusers'])?true:false);
84
- $options['set_inbpgroups'] = (isset($params['options']['set_inbpgroups'])?true:false);
85
- $options['set_inbpforums'] = (isset($params['options']['set_inbpforums'])?true:false);
86
-
87
- $options['maxresults'] = $params['data']['maxresults'];
88
- $options['do_group'] = ($params['data']['resultstype'] == 'vertical') ? true : false;
89
-
90
- $this->options = $options;
91
- $this->searchId = 1;
92
- $this->searchData = $params['data'];
93
- if ( isset($this->searchData['image_options']) )
94
- $this->imageSettings = $this->searchData['image_options'];
95
-
96
- }
97
-
98
- /**
99
- * Initiates the search operation
100
- *
101
- * @param $keyword
102
- * @return array
103
- */
104
- public function search($keyword) {
105
-
106
- $this->prepare_keywords($keyword);
107
- $this->do_search();
108
- $this->post_process();
109
- $this->group();
110
-
111
- return is_array($this->results) ? $this->results : array();
112
- }
113
-
114
- public function prepare_keywords($s) {
115
-
116
- $keyword = $s;
117
- $keyword = $this->compatibility($keyword);
118
- $keyword_rev = ASL_Helpers::reverseString($keyword);
119
-
120
- $this->s = ASL_Helpers::escape( $keyword );
121
- $this->sr = ASL_Helpers::escape( $keyword_rev );
122
-
123
- /**
124
- * Avoid double escape, explode the $keyword instead of $this->s
125
- * Regex to match individual words and phrases between double quotes
126
- **/
127
- if ( preg_match_all( '/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keyword, $matches ) ) {
128
- $this->_s = $this->parse_search_terms( $matches[0] );
129
- } else {
130
- $this->_s = $this->parse_search_terms( explode(" ", $keyword) );
131
- }
132
- if ( preg_match_all( '/".*?("|$)|((?<=[\t ",+])|^)[^\t ",+]+/', $keyword_rev, $matches ) ) {
133
- $this->_sr = $this->parse_search_terms( array_reverse($matches[0]) );
134
- } else {
135
- $this->_sr = $this->parse_search_terms( array_reverse( explode(" ", $keyword_rev ) ) );
136
- }
137
-
138
- // Reserved for future use
139
- $min_word_length = 0;
140
-
141
- foreach ($this->_s as $k=>$w) {
142
- if ( ASL_mb::strlen($w) < $min_word_length ) {
143
- unset($this->_s[$k]);
144
- }
145
- }
146
-
147
- foreach ($this->_sr as $k=>$w) {
148
- if ( ASL_mb::strlen($w) < $min_word_length ) {
149
- unset($this->_sr[$k]);
150
- }
151
- }
152
- }
153
-
154
- /**
155
- * Check if the terms are suitable for searching.
156
- *
157
- * @param array $terms Terms to check.
158
- * @return array Terms
159
- */
160
- protected function parse_search_terms( $terms ) {
161
- $checked = array();
162
-
163
- foreach ( $terms as $term ) {
164
- // keep before/after spaces when term is for exact match
165
- if ( preg_match( '/^".+"$/', $term ) )
166
- $term = trim( $term, "\"'" );
167
- else
168
- $term = trim( $term, "\"' " );
169
-
170
- if ( $term != '' )
171
- $checked[] = $term;
172
- }
173
-
174
- if ( count($checked) > 0 )
175
- $checked = ASL_Helpers::escape(
176
- array_slice(array_unique($checked), 0, 10)
177
- );
178
-
179
- return $checked;
180
- }
181
-
182
- /**
183
- * Converts the keyword to the correct case and sets up the pre-suff fields.
184
- *
185
- * @param $s
186
- * @return string
187
- */
188
- protected function compatibility($s) {
189
- $comp_options = get_option( 'asl_compatibility' );
190
-
191
- /**
192
- * On forced case sensitivity: Let's add BINARY keyword before the LIKE
193
- * On forced case in-sensitivity: Append the lower() function around each field
194
- */
195
- if ( $comp_options['db_force_case'] === 'sensitivity' ) {
196
- $this->pre_like = 'BINARY ';
197
- } else if ( $comp_options['db_force_case'] === 'insensitivity' ) {
198
- if ( function_exists( 'mb_convert_case' ) )
199
- $s = mb_convert_case( $s, MB_CASE_LOWER, "UTF-8" );
200
- else
201
- $s = strtoupper( $s );
202
- // if no mb_ functions :(
203
-
204
- $this->pre_field .= 'lower(';
205
- $this->suf_field .= ')';
206
- }
207
-
208
- /**
209
- * Check if utf8 is forced on LIKE
210
- */
211
- if ( w_isset_def( $comp_options['db_force_utf8_like'], 0 ) == 1 )
212
- $this->pre_like .= '_utf8';
213
-
214
- /**
215
- * Check if unicode is forced on LIKE, but only apply if utf8 is not
216
- */
217
- if ( w_isset_def( $comp_options['db_force_unicode'], 0 ) == 1
218
- && w_isset_def( $comp_options['db_force_utf8_like'], 0 ) == 0
219
- )
220
- $this->pre_like .= 'N';
221
-
222
- return $s;
223
- }
224
-
225
- /**
226
- * The search function
227
- */
228
- protected function do_search() {}
229
-
230
- /**
231
- * Post processing abstract
232
- */
233
- protected function post_process() {}
234
-
235
- /**
236
- * Grouping abstract
237
- */
238
- protected function group() {}
239
-
240
- }
241
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/classes/search/search.controller.class.php DELETED
@@ -1,167 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined('ABSPATH') or die("You can't access this file directly.");
4
-
5
- if (!class_exists('asl_searchController')) {
6
- /**
7
- * Class asl_searchController
8
- *
9
- * A controller slash wrapper class for the whole search process.
10
- *
11
- */
12
- class asl_searchController {
13
- /*
14
- * Results
15
- */
16
- private $results;
17
-
18
- /*
19
- * Array of phrases of all synonym variations
20
- */
21
- private $finalPhrases = array();
22
-
23
- /*
24
- * Constructor args
25
- */
26
- private $args;
27
-
28
- /*
29
- * Search Options
30
- */
31
- private $so;
32
-
33
- /*
34
- * Caching Options
35
- */
36
- private $co;
37
-
38
- public function __construct( $args ) {
39
-
40
- $defaults = array(
41
- 'phrase' => "",
42
- 'id' => 0,
43
- 'instance' => null
44
- );
45
- $args = wp_parse_args( $args, $defaults );
46
-
47
- $this->args = $args;
48
- }
49
-
50
- public function search() {
51
- $this->parseOptions();
52
-
53
- $sd = &$this->args['instance']['data'];
54
- $s = $this->args['phrase'];
55
- $id = $this->args['id'];
56
-
57
- $allpageposts = array();
58
- $pageposts = array();
59
-
60
- do_action('asl_before_search', $s);
61
-
62
- $params = array('data' => $sd, 'options' => $this->so);
63
-
64
- // VC 4.6+ fix: Shortcodes are not loaded in ajax responses
65
- // class_exists() is mandatory, some PHP versions fail
66
- if ( class_exists("WPBMap") && method_exists("WPBMap", "addAllMappedShortcodes") )
67
- WPBMap::addAllMappedShortcodes();
68
-
69
- $_posts = new wpdreams_searchContent($params);
70
- $pageposts = $_posts->search($s);
71
- $allpageposts = array_merge($allpageposts, $pageposts);
72
-
73
- do_action('asl_after_pagepost_results', $s, $pageposts);
74
-
75
- $allpageposts = apply_filters('asl_pagepost_results', $allpageposts);
76
-
77
-
78
- $results = array_merge(
79
- $allpageposts
80
- );
81
-
82
- $results = apply_filters('asl_results', $results);
83
-
84
- do_action('asl_after_search', $s, $results);
85
-
86
- return $results;
87
- }
88
-
89
- public function kwSuggestions() {
90
- $sd = &$this->args['instance']['data'];
91
- $results = array();
92
-
93
- $types = array();
94
- if ( isset($sd['customtypes']) )
95
- $types = array_merge($types, $sd['customtypes']);
96
-
97
- $t = new wpd_keywordSuggest("google", array(
98
- 'maxCount' => w_isset_def( $sd['kw_count'], 10 ),
99
- 'maxCharsPerWord' => w_isset_def($sd['kw_length'], 60),
100
- 'postTypes' => $types,
101
- 'lang' => w_isset_def( $sd['kw_google_lang'], "en" ),
102
- 'overrideUrl' => ''
103
- ));
104
-
105
- $keywords = $t->getKeywords( trim($this->args['phrase']) );
106
-
107
- if ($keywords != false) {
108
- $results['keywords'] = $keywords;
109
- $results['nores'] = 1;
110
- $results = apply_filters('asl_only_keyword_results', $results);
111
- }
112
-
113
- return $results;
114
- }
115
-
116
- private function parseOptions() {
117
- $sd = &$this->args['instance']['data'];
118
-
119
- $sd['image_options'] = array(
120
- 'show_images' => $sd['show_images'],
121
- 'image_bg_color' => '#FFFFFF',
122
- 'image_transparency' => 1,
123
- 'image_crop_location' => w_isset_def($sd['image_crop_location'], "c"),
124
- 'image_width' => $sd['image_width'],
125
- 'image_height' => $sd['image_height'],
126
- 'image_source1' => $sd['image_source1'],
127
- 'image_source2' => $sd['image_source2'],
128
- 'image_source3' => $sd['image_source3'],
129
- 'image_source4' => $sd['image_source4'],
130
- 'image_source5' => $sd['image_source5'],
131
- 'image_default' => $sd['image_default'],
132
- 'image_source_featured' => $sd['image_source_featured'],
133
- 'image_custom_field' => $sd['image_custom_field']
134
- );
135
-
136
- // ----------------- Recalculate image width/height ---------------
137
- switch ($sd['resultstype']) {
138
- case "horizontal":
139
- /* Same width as height */
140
- $sd['image_options']['image_width'] = wpdreams_width_from_px($sd['image_options']['hreswidth']);
141
- $sd['image_options']['image_height'] = wpdreams_width_from_px($sd['image_options']['hreswidth']);
142
- break;
143
- case "polaroid":
144
- $sd['image_options']['image_width'] = intval($sd['preswidth']);
145
- $sd['image_options']['image_height'] = intval($sd['preswidth']);
146
- break;
147
- case "isotopic":
148
- $sd['image_options']['image_width'] = intval($sd['i_item_width'] * 1.5);
149
- $sd['image_options']['image_height'] = intval($sd['i_item_height'] * 1.5);
150
- break;
151
- }
152
-
153
- if (isset($sd['selected-imagesettings'])) {
154
- $sd['settings-imagesettings'] = $sd['selected-imagesettings'];
155
- }
156
- /*if (isset($search) && $sd['exactonly']!=1) {
157
- $_s = explode(" ", $s);
158
- }*/
159
- if (isset($_POST['options'])) {
160
- if (is_array($_POST['options']))
161
- $this->so = $_POST['options'];
162
- else
163
- parse_str($_POST['options'], $this->so);
164
- }
165
- }
166
- }
167
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/classes/search/search.inc.php CHANGED
@@ -2,6 +2,6 @@
2
  if (!defined('ABSPATH')) die('-1');
3
 
4
  /* Search related classes */
5
- require_once(ASL_CLASSES_PATH . "search/search.controller.class.php");
6
- require_once(ASL_CLASSES_PATH . "search/search.class.php");
7
- require_once(ASL_CLASSES_PATH . "search/search_content.class.php");
2
  if (!defined('ABSPATH')) die('-1');
3
 
4
  /* Search related classes */
5
+ require_once(ASL_CLASSES_PATH . "search/class-asl-query.php");
6
+ require_once(ASL_CLASSES_PATH . "search/class-asl-search.php");
7
+ require_once(ASL_CLASSES_PATH . "search/class-asl-search-cpt.php");
includes/classes/search/search_content.class.php DELETED
@@ -1,1362 +0,0 @@
1
- <?php
2
- /* Prevent direct access */
3
- defined( 'ABSPATH' ) or die( "You can't access this file directly." );
4
-
5
- if ( ! class_exists( 'wpdreams_searchContent' ) ) {
6
- class wpdreams_searchContent extends wpdreams_search {
7
- private $remaining_limit;
8
- /**
9
- * @var array of query parts
10
- */
11
- private $parts = array();
12
-
13
- protected function do_search() {
14
- global $wpdb;
15
- global $q_config;
16
-
17
- $options = $this->options;
18
- $sd = $this->searchData;
19
-
20
- $types = array();
21
- //$post_types = "";
22
- $term_query = "(1)";
23
- //$post_statuses = "";
24
- //$term_join = "";
25
- $postmeta_join = "";
26
-
27
- $kw_logic = strtolower( $sd['keyword_logic'] );
28
-
29
- // Prefixes and suffixes
30
- $pre_field = $this->pre_field;
31
- $suf_field = $this->suf_field;
32
- $pre_like = $this->pre_like;
33
- $suf_like = $this->suf_like;
34
-
35
- $s = $this->s; // full keyword
36
- $_s = $this->_s; // array of keywords
37
-
38
- $wcl = '%'; // Wildcard Left
39
- $wcr = '%'; // Wildcard right
40
- if ( $options['set_exactonly'] == 1 ) {
41
- if ( $sd['exact_match_location'] == 'start' ) {
42
- $wcl = '';
43
- } else if ( $sd['exact_match_location'] == 'end' ) {
44
- $wcr = '';
45
- } else if ( $sd['exact_match_location'] == 'full' ) {
46
- $wcr = '';
47
- $wcl = '';
48
- }
49
- }
50
-
51
- if ( isset($options['non_ajax_search']) )
52
- $this->remaining_limit = 99999; // since it's not adjustable, make it irreally high
53
- else
54
- $this->remaining_limit = $sd['maxresults'];
55
-
56
- $q_config['language'] = $options['qtranslate_lang'];
57
-
58
- /*------------------------- Statuses ----------------------------*/
59
- $post_statuses_arr = explode(',', str_replace(' ', '', w_isset_def($sd['post_status'], 'publish')) );
60
- // Do not allow private posts for non-editors
61
- if ( !current_user_can('read_private_posts') )
62
- $post_statuses_arr = array_diff($post_statuses_arr, array('private'));
63
- $post_statuses = "'".implode( "','", $post_statuses_arr )."'";
64
- $post_statuses = "( $wpdb->posts.post_status IN ($post_statuses) )";
65
- /*---------------------------------------------------------------*/
66
-
67
- /*------------------------- Paswword ----------------------------*/
68
- $post_password_query = '';
69
- if ( $sd['post_password_protected'] == 0 ) {
70
- $post_password_query = " AND ( $wpdb->posts.post_password = '' )";
71
- }
72
- /*---------------------------------------------------------------*/
73
-
74
- /*----------------------- Gather Types --------------------------*/
75
- if ($options['set_inposts'] == 1)
76
- $types[] = "post";
77
- if ($options['set_inpages'])
78
- $types[] = "page";
79
- if (isset($options['customset']) && count($options['customset']) > 0) {
80
- $types = array_merge( $types, ASL_Helpers::escape($options['customset'], true, ' ;:.,(){}@[]!?&|#^=') );
81
- }
82
- if (count($types) < 1) {
83
- return '';
84
- } else {
85
- $words = implode("','", $types);
86
- if ( in_array('product_variation', $types) && class_exists('WooCommerce') ) {
87
- $_post_types = $types;
88
- $_post_types = array_diff($_post_types, array('product_variation'));
89
- if (count($_post_types) > 0)
90
- $or_ptypes = "OR $wpdb->posts.post_type IN ('".implode("', '", $_post_types)."')";
91
- else
92
- $or_ptypes = '';
93
- $post_types = "
94
- ((
95
- (
96
- $wpdb->posts.post_type = 'product_variation' AND
97
- EXISTS(SELECT 1 FROM $wpdb->posts par WHERE par.ID = $wpdb->posts.post_parent AND par.post_status IN('publish') )
98
- ) $or_ptypes
99
- ))";
100
- } else {
101
- $post_types = "( $wpdb->posts.post_type IN ('$words') )";
102
- }
103
- }
104
- /*---------------------------------------------------------------*/
105
-
106
- /*------------- Custom Fields with Custom selectors -------------*/
107
- $cf_select = '';
108
- if ( $sd['woo_exclude_outofstock'] == 1 ) {
109
- $cf_select = $this->build_cff_query($wpdb->posts . ".ID", array(
110
- 'post_meta_filter' => array(
111
- array(
112
- 'key' => '_stock_status',
113
- 'value' => 'instock',
114
- 'operator' => 'ELIKE'
115
- )
116
- )
117
- ));
118
- $cf_select = $cf_select != '' ? ' AND ' . $cf_select : '';
119
- }
120
- /*---------------------------------------------------------------*/
121
-
122
-
123
- $words = $options['set_exactonly'] == 1 && $s != '' ? array($s) : $_s;
124
- /**
125
- * Ex.: When the minimum word count is 2, and the user enters 'a' then $_s is empty.
126
- * But $s is not actually empty, thus the wrong query will be executed.
127
- */
128
- if ( count($words) == 0 && $s != '' ) {
129
- $words = array($s);
130
- // Allow only beginnings
131
- if ( $options['set_exactonly'] == 0 )
132
- $wcl = '';
133
- }
134
- if ( $s != '' )
135
- $words = !in_array($s, $words) ? array_merge(array($s), $words) : $words;
136
-
137
- $relevance_added = false;
138
- foreach ( $words as $k => $word ) {
139
- $parts = array();
140
- $relevance_parts = array();
141
- $is_exact = $options['set_exactonly'] == 1 || ( count($words) > 1 && $k == 0 && ($kw_logic == 'or' || $kw_logic == 'and') );
142
-
143
- /*----------------------- Title query ---------------------------*/
144
- if ( $options['set_intitle'] ) {
145
- if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
146
- $parts[] = "( " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
147
- } else {
148
- $parts[] = "
149
- ( " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
150
- OR " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
151
- OR " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
152
- OR " . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " = '" . $word . "')";
153
- }
154
- if ( !$relevance_added ) {
155
- $relevance_parts[] = "(case when
156
- (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '$s%')
157
- then " . (w_isset_def($sd['etitleweight'], 10) * 2) . " else 0 end)";
158
-
159
- $relevance_parts[] = "(case when
160
- (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '%$s%')
161
- then " . w_isset_def($sd['etitleweight'], 10) . " else 0 end)";
162
-
163
- // The first word relevance is higher
164
- if ( isset($_s[0]) ) {
165
- $relevance_parts[] = "(case when
166
- (" . $pre_field . $wpdb->posts . ".post_title" . $suf_field . " LIKE '%" . $_s[0] . "%')
167
- then " . w_isset_def($sd['etitleweight'], 10) . " else 0 end)";
168
- }
169
- }
170
- }
171
- /*---------------------------------------------------------------*/
172
-
173
- /*---------------------- Content query --------------------------*/
174
- if ( $options['set_incontent'] ) {
175
- if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
176
- $parts[] = "( " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
177
- /**
178
- * Exact matching multi line + word boundary with REGEXP
179
- *
180
- * $parts[] = "( " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " REGEXP '([[:blank:][:punct:]]|^|\r\n)" . $word . "([[:blank:][:punct:]]|$|\r\n)' )";
181
- */
182
- } else {
183
- $parts[] = "
184
- (" . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
185
- OR " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
186
- OR " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
187
- OR " . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " = '" . $word . "')";
188
- }
189
- if ( !$relevance_added ) {
190
- if ( isset($_s[0]) ) {
191
- $relevance_parts[] = "(case when
192
- (" . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE '%" . $_s[0] . "%')
193
- then ".w_isset_def($sd['contentweight'], 10)." else 0 end)";
194
- }
195
-
196
- $relevance_parts[] = "(case when
197
- (" . $pre_field . $wpdb->posts . ".post_content" . $suf_field . " LIKE '%$s%')
198
- then " . w_isset_def($sd['econtentweight'], 10) . " else 0 end)";
199
- }
200
- }
201
- /*---------------------------------------------------------------*/
202
-
203
- /*----------------- Permalink, post_name query ------------------*/
204
- if ( $sd['search_in_permalinks'] ) {
205
- $parts[] = "( " . $pre_field . $wpdb->posts . ".post_name" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
206
- }
207
- /*---------------------------------------------------------------*/
208
-
209
- /*---------------------- Excerpt query --------------------------*/
210
- if ($options['set_inexcerpt']) {
211
- if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
212
- $parts[] = "( " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
213
- } else {
214
- $parts[] = "
215
- (" . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
216
- OR " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
217
- OR " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
218
- OR " . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " = '" . $word . "')";
219
- }
220
- if ( !$relevance_added ) {
221
- if ( isset($_s[0]) ) {
222
- $relevance_parts[] = "(case when
223
- (" . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE '%" . $_s[0] . "%')
224
- then ".w_isset_def($sd['excerptweight'], 10)." else 0 end)";
225
- }
226
-
227
- $relevance_parts[] = "(case when
228
- (" . $pre_field . $wpdb->posts . ".post_excerpt" . $suf_field . " LIKE '%$s%')
229
- then " . w_isset_def($sd['eexcerptweight'], 10) . " else 0 end)";
230
- }
231
- }
232
- /*---------------------------------------------------------------*/
233
-
234
- /*------------------------ Term query ---------------------------*/
235
- if ($options['searchinterms']) {
236
- if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
237
- $parts[] = "( " . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
238
- } else {
239
- $parts[] = "
240
- (" . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
241
- OR " . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
242
- OR " . $pre_field . $wpdb->terms . ".name" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
243
- OR " . $pre_field . $wpdb->terms . ".name" . $suf_field . " = '" . $word . "')";
244
- }
245
-
246
- if ( !$relevance_added ) {
247
- $relevance_parts[] = "(case when
248
- (" . $pre_field . $wpdb->terms . ".name" . $suf_field . " = '$s')
249
- then " . w_isset_def($sd['etermsweight'], 10) . " else 0 end)";
250
- }
251
- }
252
- /*---------------------------------------------------------------*/
253
-
254
- /*---------------------- Custom Fields --------------------------*/
255
- $selected_customfields = isset( $sd['selected-customfields'] ) ? $sd['selected-customfields'] : array();
256
- if ( $sd['search_all_cf'] == 1 )
257
- $selected_customfields = array("all");
258
-
259
- if ( is_array($selected_customfields) && count($selected_customfields) > 0 ) {
260
- $postmeta_join = "LEFT JOIN $wpdb->postmeta ON $wpdb->postmeta.post_id = $wpdb->posts.ID";
261
- foreach ( $selected_customfields as $cfield ) {
262
- $key_part = $sd['search_all_cf'] == 1 ? "" : "$wpdb->postmeta.meta_key='$cfield' AND ";
263
-
264
- if ( $kw_logic == 'or' || $kw_logic == 'and' || $is_exact ) {
265
- $parts[] = "( $key_part " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'$wcl" . $word . "$wcr'$suf_like )";
266
- } else {
267
- $parts[] = "( $key_part
268
- (" . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'% " . $word . " %'$suf_like
269
- OR " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'" . $word . " %'$suf_like
270
- OR " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " LIKE $pre_like'% " . $word . "'$suf_like
271
- OR " . $pre_field . $wpdb->postmeta . ".meta_value" . $suf_field . " = '" . $word . "') )";
272
- }
273
- if ( !$relevance_added ) {
274
- if ($cfield == 'author_field_name')
275
- $relevance_parts[] = "(case when
276
- (EXISTS (SELECT 1 FROM $wpdb->postmeta as cfre WHERE cfre.post_id = $wpdb->posts.ID AND cfre.meta_key = '$cfield' AND
277
- (cfre.meta_value" . $suf_field . " LIKE '%" . $s . "%')))
278
- then 100 else 0 end)";
279
- if ($cfield == 'fulltext_field_name')
280
- $relevance_parts[] = "(case when
281
- (EXISTS (SELECT 1 FROM $wpdb->postmeta as cfre WHERE cfre.post_id = $wpdb->posts.ID AND cfre.meta_key = '$cfield' AND
282
- (cfre.meta_value" . $suf_field . " LIKE '%" . $s . "%')))
283
- then 10 else 0 end)";
284
- }
285
- }
286
- }
287
- /*---------------------------------------------------------------*/
288
-
289
- /*---------------------- Post CPT IDs ---------------------------*/
290
- if ( $sd['search_in_ids'] )
291
- $parts[] = "($wpdb->posts.ID LIKE '$word')";
292
- /*---------------------------------------------------------------*/
293
-
294
- $this->parts[] = array( $parts, $relevance_parts );
295
- $relevance_added = true;
296
- }
297
-
298
-
299
- // ------------------------ Categories/taxonomies ----------------------
300
- if ( ! isset( $options['categoryset'] ) || $options['categoryset'] == "" ) {
301
- $options['categoryset'] = array();
302
- }
303
- if ( ! isset( $options['termset'] ) || $options['termset'] == "" ) {
304
- $options['termset'] = array();
305
- }
306
-
307
- $term_logic = 'and';
308
-
309
- $exclude_categories = array();
310
- $sd['selected-exsearchincategories'] = w_isset_def( $sd['selected-exsearchincategories'], array() );
311
- $sd['selected-excludecategories'] = w_isset_def( $sd['selected-excludecategories'], array() );
312
-
313
- // New solution
314
- if ( count( $sd['selected-exsearchincategories'] ) > 0 ||
315
- count( $sd['selected-excludecategories'] ) > 0 ||
316
- count( $options['categoryset'] ) > 0 ||
317
- $sd['showsearchincategories'] == 1
318
- ) {
319
-
320
- // If the category settings are invisible, ignore the excluded frontend categories, reset to empty array
321
- if ( $sd['showsearchincategories'] == 0 ) {
322
- $sd['selected-exsearchincategories'] = array();
323
- }
324
-
325
- $_all_cat = get_terms( 'category', array( 'fields' => 'ids' ) );
326
- $_needed_cat = array_diff( $_all_cat, $sd['selected-exsearchincategories'] );
327
- $_needed_cat = ! is_array( $_needed_cat ) ? array() : $_needed_cat;
328
-
329
- // I am pretty sure this is where the devil is born
330
- /*
331
- AND -> Posts NOT in an array of term ids
332
- OR -> Posts in an array of term ids
333
- */
334
-
335
- if ( $sd['showsearchincategories'] == 1 ) // If the settings is visible, count for the options
336
- {
337
- $exclude_categories = array_diff( array_merge( $_needed_cat, $sd['selected-excludecategories'] ), $options['categoryset'] );
338
- } else // ..if the settings is not visible, then only the excluded categories count
339
- {
340
- $exclude_categories = $sd['selected-excludecategories'];
341
- }
342
-
343
-
344
- }
345
-
346
- $exclude_terms = array();
347
-
348
- /*if (w_isset_def($sd['exclude_term_ids'], "") != "") {
349
- $exclude_terms = explode( ",", str_replace( array("\r", "\n"), '', $sd['exclude_term_ids'] ) );
350
- }*/
351
-
352
- $all_terms = array_unique( array_merge( $exclude_categories, $exclude_terms ) );
353
-
354
- /**
355
- * New method
356
- *
357
- * This is way more efficient, despite it looks more complicated.
358
- * Multiple sub-select is not an issue, since the query can use PRIMARY keys as indexes
359
- */
360
- if ( count( $all_terms ) > 0 ) {
361
- $words = implode( ',', $all_terms );
362
-
363
- // Quick explanation for the AND
364
- // .. MAIN SELECT: selects all object_ids that are not in the array
365
- // .. SUBSELECT: excludes all the object_ids that are part of the array
366
- // This is used because of multiple object_ids (posts in more than 1 category)
367
- if ( $term_logic == 'and' ) {
368
- $empty_term_query = "
369
- NOT EXISTS (
370
- SELECT *
371
- FROM $wpdb->term_relationships as xt
372
- INNER JOIN $wpdb->term_taxonomy as tt ON ( xt.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'category')
373
- WHERE
374
- xt.object_id = $wpdb->posts.ID
375
- ) OR ";
376
-
377
- $term_query = " (
378
- $empty_term_query
379
-
380
- $wpdb->posts.ID IN (
381
- SELECT DISTINCT(tr.object_id)
382
- FROM $wpdb->term_relationships AS tr
383
- LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'category')
384
- WHERE
385
- tt.term_id NOT IN ($words)
386
- AND tr.object_id NOT IN (
387
- SELECT DISTINCT(trs.object_id)
388
- FROM $wpdb->term_relationships AS trs
389
- LEFT JOIN $wpdb->term_taxonomy as tts ON (trs.term_taxonomy_id = tts.term_taxonomy_id AND tts.taxonomy = 'category')
390
- WHERE tts.term_id IN ($words)
391
- )
392
- )
393
- )";
394
- } else {
395
- $term_query = "( $wpdb->posts.ID IN ( SELECT DISTINCT(tr.object_id) FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN ($words) ) )";
396
- }
397
- }
398
-
399
- /*------------------- WooCommerce Visibility --------------------*/
400
- $woo_visibility_query = '';
401
- if ( class_exists('WooCommerce') && ( $sd['exclude_woo_hidden'] == 1 || $sd['exclude_woo_catalog'] == 1 ) ) {
402
- // Check if this is version > 3.0
403
- if ( asl_woo_version_check('3.0') ) {
404
- $exclude = array();
405
- if ( $sd['exclude_woo_hidden'] == 1 )
406
- $exclude[] = 'exclude-from-search';
407
- if ( $sd['exclude_woo_catalog'] == 1 )
408
- $exclude[] = 'exclude-from-catalog';
409
- $_t = get_terms(array(
410
- 'slug' => $exclude,
411
- 'hide_empty' => 0,
412
- 'fields' => 'ids'
413
- ));
414
-
415
- if ( !is_wp_error($_t) && count($_t) > 0) {
416
- $woo_visibility_query = "
417
- NOT EXISTS (
418
- SELECT *
419
- FROM $wpdb->term_relationships as xt
420
- INNER JOIN $wpdb->term_taxonomy as tt ON ( xt.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'product_visibility')
421
- WHERE
422
- xt.object_id = $wpdb->posts.ID
423
- ) OR ";
424
-
425
- $woo_visibility_query = " AND (
426
- $woo_visibility_query
427
-
428
- $wpdb->posts.ID IN (
429
- SELECT DISTINCT(tr.object_id)
430
- FROM $wpdb->term_relationships AS tr
431
- LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'product_visibility')
432
- WHERE
433
- tt.term_id NOT IN (".implode(', ', $_t).")
434
- AND tr.object_id NOT IN (
435
- SELECT DISTINCT(trs.object_id)
436
- FROM $wpdb->term_relationships AS trs
437
- LEFT JOIN $wpdb->term_taxonomy as tts ON (trs.term_taxonomy_id = tts.term_taxonomy_id AND tts.taxonomy = 'product_visibility')
438
- WHERE tts.term_id IN (".implode(', ', $_t).")
439
- )
440
- )
441
- )";
442
- }
443
- } else {
444
- // Fallback to < 3.0
445
- $qry = "( $wpdb->postmeta.meta_value IN ('visible', 'search') )";
446
- $woo_visibility_query .= "
447
- AND ((
448
- SELECT IF(meta_key IS NULL, 1, IF($qry, COUNT(post_id), 0))
449
- FROM $wpdb->postmeta
450
- WHERE $wpdb->postmeta.post_id = $wpdb->posts.ID AND $wpdb->postmeta.meta_key='_visibility'
451
- ) >= 1)
452
- ";
453
- }
454
-
455
- }
456
- /*---------------------------------------------------------------*/
457
-
458
- /*------------------------ Exclude id's -------------------------*/
459
- if ( isset( $sd['excludeposts'] ) && $sd['excludeposts'] != "" ) {
460
- $exclude_post_ids = array_unique(
461
- explode(',', str_replace(' ', '', $sd['excludeposts']))
462
- );
463
- foreach ( $exclude_post_ids as $k=>$v ) {
464
- if ( $v == '' ) {
465
- unset($exclude_post_ids[$k]);
466
- }
467
- }
468
- if ( count($exclude_post_ids) > 0 )
469
- $exclude_posts = " AND ($wpdb->posts.ID NOT IN (" . implode(',', $exclude_post_ids) . "))";
470
- } else {
471
- $exclude_posts = "";
472
- }
473
- /*---------------------------------------------------------------*/
474
-
475
- /*------------------------ Term JOIN -------------------------*/
476
- // If the search in terms is not active, we don't need this unnecessary big join
477
- $term_join = "";
478
- if ( $options['searchinterms'] ) {
479
- $term_join = "
480
- LEFT JOIN $wpdb->term_relationships ON $wpdb->posts.ID = $wpdb->term_relationships.object_id
481
- LEFT JOIN $wpdb->term_taxonomy ON $wpdb->term_taxonomy.term_taxonomy_id = $wpdb->term_relationships.term_taxonomy_id
482
- LEFT JOIN $wpdb->terms ON $wpdb->term_taxonomy.term_id = $wpdb->terms.term_id";
483
- }
484
- /*---------------------------------------------------------------*/
485
-
486
- /*------------------------- Build like --------------------------*/
487
- /*$like_query = implode( ' OR ', $parts );
488
- if ( $like_query == "" ) {
489
- $like_query = "(1)";
490
- } else {
491
- $like_query = "($like_query)";
492
- }*/
493
- /*---------------------------------------------------------------*/
494
-
495
- /*---------------------- Build relevance ------------------------*/
496
- /*$relevance = implode( ' + ', $relevance_parts );
497
- if ( $relevance == "" ) {
498
- $relevance = "(1)";
499
- } else {
500
- $relevance = "($relevance)";
501
- }*/
502
- /*---------------------------------------------------------------*/
503
-
504
-
505
- /*------------------------- WPML filter -------------------------*/
506
- $wpml_query = "(1)";
507
- if ( isset( $options['wpml_lang'] )
508
- && w_isset_def( $sd['wpml_compatibility'], 1 ) == 1
509
- ) {
510
- global $sitepress;
511
- $site_lang_selected = false;
512
- $wpml_post_types_arr = array();
513
-
514
- foreach ($types as $tt) {
515
- $wpml_post_types_arr[] = "post_" . $tt;
516
- }
517
- $wpml_post_types = implode( "','", $wpml_post_types_arr );
518
-
519
- // Let us get the default site language if possible
520
- if ( is_object($sitepress) && method_exists($sitepress, 'get_default_language') ) {
521
- $site_lang_selected = $sitepress->get_default_language() == $options['wpml_lang'] ? true : false;
522
- }
523
-
524
- $_wpml_query_id_field = "$wpdb->posts.ID";
525
- // Product variations are not translated, so we need to use the parent ID (product) field to compare
526
- if ( in_array('product_variation', $types) ) {
527
- $_wpml_query_id_field = "(IF($wpdb->posts.post_type='product_variation', $wpdb->posts.post_parent, $wpdb->posts.ID))";
528
- }
529
-
530
- $wpml_query = "
531
- EXISTS (
532
- SELECT DISTINCT(wpml.element_id)
533
- FROM " . $wpdb->base_prefix . "icl_translations as wpml
534
- WHERE
535
- $_wpml_query_id_field = wpml.element_id AND
536
- wpml.language_code = '" . ASL_Helpers::escape( $options['wpml_lang'] ) . "' AND
537
- wpml.element_type IN ('$wpml_post_types')
538
- )";
539
-
540
- /**
541
- * For missing translations..
542
- * If the site language is used, the translation can be non-existent
543
- */
544
- if ($site_lang_selected) {
545
- $wpml_query = "
546
- NOT EXISTS (
547
- SELECT DISTINCT(wpml.element_id)
548
- FROM " . $wpdb->base_prefix . "icl_translations as wpml
549
- WHERE
550
- $_wpml_query_id_field = wpml.element_id AND
551
- wpml.element_type IN ('$wpml_post_types')
552
- ) OR
553
- " . $wpml_query;
554
- }
555
- }
556
- /*---------------------------------------------------------------*/
557
-
558
- /*----------------------- POLYLANG filter -----------------------*/
559
- $polylang_query = "";
560
- if (isset( $options['polylang_lang'] ) &&
561
- $options['polylang_lang'] != "" &&
562
- $sd['polylang_compatibility'] == 1
563
- ) {
564
- $languages = get_terms('language', array(
565
- 'hide_empty' => false,
566
- 'fields' => 'ids',
567
- 'orderby' => 'term_group',
568
- 'slug' => $options['polylang_lang'])
569
- );
570
- if ( !empty($languages) && !is_wp_error($languages) && isset($languages[0]) ) {
571
- if ( in_array('product_variation', $types) && class_exists('WooCommerce') ) {
572
- $poly_field = "IF($wpdb->posts.post_type = 'product_variation', $wpdb->posts.post_parent, $wpdb->posts.ID)";
573
- } else {
574
- $poly_field = "$wpdb->posts.ID";
575
- }
576
- $polylang_query = " AND (
577
- $poly_field IN ( SELECT DISTINCT(tr.object_id)
578
- FROM $wpdb->term_relationships AS tr
579
- LEFT JOIN $wpdb->term_taxonomy as tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id AND tt.taxonomy = 'language')
580
- WHERE tt.term_id = $languages[0]
581
- ) )";
582
- }
583
- }
584
- /*---------------------------------------------------------------*/
585
-
586
- /*--------------------- Other Query stuff -----------------------*/
587
- // If the content is hidden, why select it..
588
- if ($sd['showdescription'] == 0)
589
- $select_content = "''";
590
- else
591
- $select_content = $wpdb->posts. ".post_content";
592
-
593
- // Dont select excerpt if its not used at all
594
- $select_excerpt = (
595
- w_isset_def($sd['titlefield'], 0) == 1 ||
596
- w_isset_def($sd['descriptionfield'], 0) == 1 ||
597
- wd_in_array_r('excerpt', $this->imageSettings)
598
- ) ? $wpdb->posts. ".post_excerpt" : "''";
599
- /*---------------------------------------------------------------*/
600
-
601
- $querystr = "
602
- SELECT
603
- {args_fields}
604
- $wpdb->posts.post_title as title,
605
- $wpdb->posts.ID as id,
606
- $wpdb->posts.post_date as date,
607
- $select_content as content,
608
- $select_excerpt as excerpt,
609
- 'pagepost' as content_type,
610
- (SELECT
611
- $wpdb->users.display_name as author
612
- FROM $wpdb->users
613
- WHERE $wpdb->users.ID = $wpdb->posts.post_author
614
- ) as author,
615
- '' as ttid,
616
- $wpdb->posts.post_type as post_type,
617
- {relevance_query} as relevance
618
- FROM $wpdb->posts
619
- $postmeta_join
620
- $term_join
621
- {args_join}
622
- WHERE
623
- $post_types
624
- $woo_visibility_query
625
- $cf_select
626
- AND $post_statuses
627
- $post_password_query
628
- AND $term_query
629
- AND {like_query}
630
- $exclude_posts
631
- AND ( $wpml_query )
632
- $polylang_query
633
- {args_where}
634
- GROUP BY
635
- {args_groupby} $wpdb->posts.ID
636
- ORDER BY
637
- {args_orderby} ".$sd['orderby_primary'].", ".$sd['orderby_secondary'].", id DESC
638
- LIMIT " . $this->remaining_limit;
639
-
640
- $_qargs = array(
641
- 'fields' => '',
642
- 'join' => '',
643
- 'where' => '',
644
- 'orderby' => '',
645
- 'groupby' => ''
646
- );
647
- $_qargs = apply_filters('asl_query_add_args', $_qargs, $sd, $options);
648
- // Place the argument query fields
649
- if ( is_array($_qargs) ) {
650
- $querystr = str_replace(
651
- array('{args_fields}', '{args_join}', '{args_where}', '{args_orderby}', '{args_groupby}'),
652
- array($_qargs['fields'], $_qargs['join'], $_qargs['where'], $_qargs['orderby'], $_qargs['groupby']),
653
- $querystr
654
- );
655
- } else {
656
- $querystr = str_replace(
657
- array('{args_fields}', '{args_join}', '{args_where}', '{args_orderby}', '{args_groupby}'),
658
- '',
659
- $querystr
660
- );
661
- }
662
-
663
- $querystr = $this->build_query( $this->parts, $querystr, array(
664
- 'keyword_logic' => $kw_logic,
665
- '_post_use_relevance' => 1
666
- ));
667
- $pageposts = $wpdb->get_results( $querystr, OBJECT );
668
-
669
- wd_asl()->debug->pushData(
670
- array(
671
- "phrase" => $s,
672
- "options" => $options,
673
- "query" => $querystr,
674
- "results" => count($pageposts)
675
- ),
676
- "queries", false, true, false, 5
677
- );
678
-
679
- $this->results = $pageposts;
680
- return $pageposts;
681
- }
682
-
683
- /**
684
- * Builds the query from the parts
685
- *
686
- * @param $parts array LIKE and Relevance parts
687
- * @param $query string the search query
688
- * @param $argp array arguments passed
689
- *
690
- * @return string query
691
- */
692
- protected function build_query( $parts, $query, $argp = array() ) {
693
-
694
- $args = array_merge(array(
695
- 'keyword_logic' => 'OR',
696
- '_post_use_relevance' => 1
697
- ), $argp);
698
- $kw_logic = str_replace('EX', '', strtoupper( $args['keyword_logic'] ) );
699
- $kw_logic = $kw_logic != 'AND' && $kw_logic != 'OR' ? 'AND' : $kw_logic;
700
-
701
- $r_parts = array(); // relevance parts
702
-
703
- /*------------------------- Build like --------------------------*/
704
- $exact_query = '';
705
- $like_query_arr = array();
706
- foreach ( $parts as $k=>$part ) {
707
- if ( $k == 0 )
708
- $exact_query = '(' . implode(' OR ', $part[0]) . ')';
709
- else
710
- $like_query_arr[] = '(' . implode(' OR ', $part[0]) . ')';
711
- }
712
- $like_query = implode(' ' . $kw_logic . ' ', $like_query_arr);
713
-
714
- // When $exact query is empty, then surely $like_query must be empty too, see above
715
- if ( $exact_query == '' ) {
716
- $like_query = "(1)";
717
- } else {
718
- // Both $like_query and $exact_query set
719
- if ( $like_query != '' ) {
720
- $like_query = "( $exact_query OR $like_query )";
721
- } else {
722
- $like_query = "( $exact_query )";
723
- }
724
- }
725
- /*---------------------------------------------------------------*/
726
-
727
- /*---------------------- Build relevance ------------------------*/
728
- foreach ( $parts as $part ) {
729
- if ( isset($part[1]) && count($part[1]) > 0 )
730
- $r_parts = array_merge( $r_parts, $part[1] );
731
- }
732
- $relevance = implode( ' + ', $r_parts );
733
- if ( $args['_post_use_relevance'] != 1 || $relevance == "" ) {
734
- $relevance = "(1)";
735
- } else {
736
- $relevance = "($relevance)";
737
- }
738
- /*---------------------------------------------------------------*/
739
-
740
- if ( isset($this->remaining_limit, $this->limit_start) ) {
741
- if ($this->limit_start != 0)
742
- $limit = $this->limit_start . ", " . $this->remaining_limit;
743
- else
744
- $limit = $this->remaining_limit;
745
- } else {
746
- $limit = 10;
747
- }
748
-
749
- return str_replace(
750
- array( "{relevance_query}", "{like_query}", "{remaining_limit}" ),
751
- array( $relevance, $like_query, $limit ),
752
- $query
753
- );
754
-
755
- }
756
-
757
- protected function build_cff_query( $post_id_field, $args ) {
758
- global $wpdb;
759
- $defaults = array(
760
- '_post_meta_allow_null' => 1,
761
- '_post_meta_logic' => 'AND',
762
- 'post_meta_filter' => array()
763
- );
764
- $args = wp_parse_args( $args, $defaults );
765
- $parts = array();
766
-
767
- $allow_cf_null = $args['_post_meta_allow_null'];
768
-
769
- foreach ( $args['post_meta_filter'] as $data ) {
770
-
771
- $operator = $data['operator'];
772
- $posted = $data['value'];
773
- $field = $data['key'];
774
-
775
- // Is this a special case of date operator?
776
- if (strpos($operator, "datetime") === 0) {
777
- switch ($operator) {
778
- case 'datetime =':
779
- $current_part = "($wpdb->postmeta.meta_value BETWEEN '$posted 00:00:00' AND '$posted 23:59:59')";
780
- break;
781
- case 'datetime <>':
782
- $current_part = "($wpdb->postmeta.meta_value NOT BETWEEN '$posted 00:00:00' AND '$posted 23:59:59')";
783
- break;
784
- case 'datetime <':
785
- $current_part = "($wpdb->postmeta.meta_value < '$posted 00:00:00')";
786
- break;
787
- case 'datetime >':
788
- $current_part = "($wpdb->postmeta.meta_value > '$posted 23:59:59')";
789
- break;
790
- default:
791
- $current_part = "($wpdb->postmeta.meta_value < '$posted 00:00:00')";
792
- break;
793
- }
794
- // Is this a special case of timestamp?
795
- } else if (strpos($operator, "timestamp") === 0) {
796
- switch ($operator) {
797
- case 'timestamp =':
798
- $current_part = "($wpdb->postmeta.meta_value BETWEEN $posted AND ".($posted + 86399).")";
799
- break;
800
- case 'timestamp <>':
801
- $current_part = "($wpdb->postmeta.meta_value NOT BETWEEN $posted AND ".($posted + 86399).")";
802
- break;
803
- case 'timestamp <':
804
- $current_part = "($wpdb->postmeta.meta_value < $posted)";
805
- break;
806
- case 'timestamp >':
807
- $current_part = "($wpdb->postmeta.meta_value > ".($posted + 86399).")";
808
- break;
809
- default:
810
- $current_part = "($wpdb->postmeta.meta_value < $posted)";
811
- break;
812
- }
813
- // Check BETWEEN first -> range slider
814
- } else if ( $operator === "BETWEEN" ) {
815
- $current_part = "($wpdb->postmeta.meta_value BETWEEN " . $posted[0] . " AND " . $posted[1] . " )";
816
- // If not BETWEEN but value is array, then drop-down or checkboxes
817
- } else if ( is_array($posted) ) {
818
- // Is there a logic sent?
819
- $logic = isset($data['logic']) ? $data['logic'] : "OR";
820
- $values = '';
821
- if ($operator === "IN" ) {
822
- $val = implode("','", $posted);
823
- if ( !empty($val) ) {
824
- if ($values != '') {
825
- $values .= " $logic $wpdb->postmeta.meta_value $operator ('" . $val . "')";
826
- } else {
827
- $values .= "$wpdb->postmeta.meta_value $operator ('" . $val . "')";
828
- }
829
- }
830
- } else {
831
- foreach ($posted as $v) {
832
- if ($operator === "ELIKE") {
833
- if ($values != '') {
834
- $values .= " $logic $wpdb->postmeta.meta_value $operator '" . $v . "'";
835
- } else {
836
- $values .= "$wpdb->postmeta.meta_value $operator '" . $v . "'";
837
- }
838
- } else if ($operator === "NOT LIKE" || $operator === "LIKE") {
839
- if ($values != '') {
840
- $values .= " $logic $wpdb->postmeta.meta_value $operator '%" . $v . "%'";
841
- } else {
842
- $values .= "$wpdb->postmeta.meta_value $operator '%" . $v . "%'";
843
- }
844
- } else {
845
- if ($values != '') {
846
- $values .= " $logic $wpdb->postmeta.meta_value $operator " . $v;
847
- } else {
848
- $values .= "$wpdb->postmeta.meta_value $operator " . $v;
849
- }
850
- }
851
- }
852
- }
853
-
854
- $values = $values == '' ? '0' : $values;
855
- $current_part = "($values)";
856
- // String operations
857
- } else if ($operator === "NOT LIKE" || $operator === "LIKE") {
858
- $current_part = "($wpdb->postmeta.meta_value $operator '%" . $posted . "%')";
859
- } else if ($operator === "ELIKE") {
860
- $current_part = "($wpdb->postmeta.meta_value LIKE '$posted')";
861
- // Numeric operations or problematic stuff left
862
- } else {
863
- $current_part = "($wpdb->postmeta.meta_value $operator $posted )";
864
- }
865
-
866
- // Finally add the current part to the parts array
867
- if ( $current_part != "") {
868
- if ( isset($data['allow_missing']) )
869
- $allowance = $data['allow_missing'];
870
- else
871
- $allowance = $allow_cf_null;
872
-
873
- $parts[] = array($field, $current_part, $allowance);
874
- }
875
- }
876
-
877
- // The correct count is the unique fields count
878
- //$meta_count = count( $unique_fields );
879
-
880
- $cf_select = "";
881
- $cf_select_arr = array();
882
-
883
- /**
884
- * NOTE 1:
885
- * With the previous NOT EXISTS(...) subquery solution the search would hang in some cases
886
- * when checking if empty values are allowed. No idea why though...
887
- * Eventually using separate sub-queries for each field is the best.
888
- *
889
- * NOTE 2:
890
- * COUNT(post_id) is a MUST in the nested IF() statement !! Otherwise the query will return empty rows, no idea why either..
891
- */
892
-
893
- foreach ( $parts as $k => $part ) {
894
- $def = $part[2] ? "(
895
- SELECT IF((meta_key IS NULL OR meta_value = ''), -1, COUNT(meta_id))
896
- FROM $wpdb->postmeta
897
- WHERE $wpdb->postmeta.post_id = $post_id_field AND $wpdb->postmeta.meta_key='$field'
898
- LIMIT 1
899
- ) = -1
900
- OR" : ''; // Allowance
901
- $field = $part[0]; // Field name
902
- $qry = $part[1]; // Query condition
903
- $cf_select_arr[] = "
904
- (
905
- $def
906
- (
907
- SELECT COUNT(meta_id) as mtc
908
- FROM $wpdb->postmeta
909
- WHERE $wpdb->postmeta.post_id = $post_id_field AND $wpdb->postmeta.meta_key='$field' AND $qry
910
- GROUP BY meta_id
911
- ORDER BY mtc
912
- LIMIT 1
913
- ) >= 1
914
- )";
915
- }
916
- if ( count($cf_select_arr) ) {
917
- // Connect them based on the meta logic
918
- $cf_select = "( ". implode( $args['_post_meta_logic'], $cf_select_arr ) . " )";
919
- }
920
-
921
- return $cf_select;
922
- }
923
-
924
- protected function post_process() {
925
-
926
- $pageposts = is_array( $this->results ) ? $this->results : array();
927
- $options = $this->options;
928
- $sd = $this->searchData;
929
- $s = $this->s;
930
- $_s = $this->_s;
931
-
932
- // No post processing is needed on non-ajax search
933
- if ( isset($options['non_ajax_search']) ) {
934
- $this->results = $pageposts;
935
- return $pageposts;
936
- }
937
-
938
- $performance_options = get_option('asl_performance');
939
- $comp_options = wd_asl()->o['asl_compatibility'];
940
-
941
- $this->deregisterShortcodes();
942
-
943
- /* Images, title, desc */
944
- foreach ( $pageposts as $k => $v ) {
945
-
946
- // Let's simplify things
947
- $r = &$pageposts[ $k ];
948
-
949
- // -------------------------- Woocommerce Fixes -----------------------------
950
- // ---- URL FIX for WooCommerce product variations
951
- $wc_prod_var_o = null; // Reset for each loop
952
- if ( $r->post_type == 'product_variation' && function_exists('wc_get_product') ) {
953
- $wc_prod_var_o = wc_get_product( $r->id );
954
- $r->link = $wc_prod_var_o->get_permalink();
955
- } else {
956
- $r->link = get_permalink( $v->id );
957
- }
958
- // --------------------------------------------------------------------------
959
- // Filter it though WPML
960
- if ( isset( $options['wpml_lang'] )
961
- && w_isset_def( $sd['wpml_compatibility'], 1 ) == 1
962
- )
963
- $r->link = apply_filters( 'wpml_permalink', $r->link, ASL_Helpers::escape( $options['wpml_lang'] ) );
964
-
965
- $image_settings = $sd['image_options'];
966
- if ( $image_settings['show_images'] != 0 ) {
967
-
968
- $im = $this->getBFIimage( $r );
969
-
970
- if ( $im != '' && strpos( $im, "mshots/v1" ) === false && w_isset_def($performance_options['image_cropping'], 0) == 1 ) {
971
- if ( w_isset_def( $image_settings['image_transparency'], 1 ) == 1 ) {
972
- $bfi_params = array( 'width' => $image_settings['image_width'],
973
- 'height' => $image_settings['image_height'],
974
- 'crop' => true
975
- );
976
- } else {
977
- $bfi_params = array( 'width' => $image_settings['image_width'],
978
- 'height' => $image_settings['image_height'],
979
- 'crop' => true,
980
- 'color' => wpdreams_rgb2hex( $image_settings['image_bg_color'] )
981
- );
982
- }
983
-
984
- $r->image = bfi_thumb( $im, $bfi_params );
985
- } else {
986
- $r->image = $im;
987
- }
988
- }
989
-
990
- switch($sd['titlefield']) {
991
- case '0':
992
- if ( isset($wc_prod_var_o) ) {
993
- $r->title = $wc_prod_var_o->get_title();
994
- } else {
995
- $r->title = get_the_title($r->id);
996
- }
997
- break;
998
- case '1':
999
- if ( ASL_mb::strlen( $r->excerpt ) >= 200 ) {
1000
- $r->title = wd_substr_at_word( $r->excerpt, 200 );
1001
- } else {
1002
- $r->title = $r->excerpt;
1003
- }
1004
- break;
1005
- case 'c__f':
1006
- if ( $sd['titlefield_cf'] != '' ) {
1007
- if ( $comp_options['use_acf_getfield'] == 1 && function_exists('get_field') ) {
1008
- $mykey_values = get_field($sd['titlefield_cf'], $r->id, true);
1009
- if (!is_null($mykey_values) && $mykey_values != '' && $mykey_values !== false ) {
1010
- if (is_array($mykey_values)) {
1011
- if (!is_object($mykey_values[0])) {
1012
- $r->title = implode(', ', $mykey_values);
1013
- break;
1014
- }
1015
- } else {
1016
- $r->title = $mykey_values;
1017
- break;
1018
- }
1019
- }
1020
- } else {
1021
- $mykey_values = get_post_custom_values($sd['titlefield_cf'], $r->id);
1022
- if (isset($mykey_values[0])) {
1023
- $r->title = $mykey_values[0];
1024
- break;
1025
- }
1026
- }
1027
- }
1028
- break;
1029
- default:
1030
- if ( isset($wc_prod_var_o) ) {
1031
- $r->title = $wc_prod_var_o->get_title();
1032
- } else {
1033
- $r->title = get_the_title($r->id);
1034
- }
1035
- break;
1036
- }
1037
-
1038
- if ( ! isset( $sd['striptagsexclude'] ) ) {
1039
- $sd['striptagsexclude'] = "<a><span>";
1040
- }
1041
-
1042
- $_content = '';
1043
- switch ($sd['descriptionfield']) {
1044
- case '1':
1045
- if (function_exists('qtranxf_use')) {
1046
- global $q_config;
1047
- $r->excerpt = qtranxf_use($q_config['default_language'], $r->excerpt, false);
1048
- }
1049
- $_content = $r->excerpt;
1050
- break;
1051
- case '2':
1052
- $_content = strip_tags(get_the_title($r->id), $sd['striptagsexclude']);
1053
- break;
1054
- case 'c__f':
1055
- if ($sd['descriptionfield_cf'] != '') {
1056
- if ($comp_options['use_acf_getfield'] == 1 && function_exists('get_field')) {
1057
- $mykey_values = get_field($sd['descriptionfield_cf'], $r->id, true);
1058
- if (!is_null($mykey_values) && $mykey_values != '' && $mykey_values !== false ) {
1059
- if ( is_array($mykey_values) ) {
1060
- if ( !is_object($mykey_values[0]) ) {
1061
- $_content = implode(', ', $mykey_values);
1062
- break;
1063
- }
1064
- } else {
1065
- $_content = $mykey_values;
1066
- break;
1067
- }
1068
- }
1069
- } else {
1070
- $mykey_values = get_post_custom_values($sd['descriptionfield_cf'], $r->id);
1071
- if (isset($mykey_values[0])) {
1072
- $_content = $mykey_values[0];
1073
- break;
1074
- }
1075
- }
1076
- }
1077
- break;
1078
- default: //including option '0', alias content
1079
- if ( function_exists( 'qtranxf_use' ) ) {
1080
- global $q_config;
1081
- $r->content = qtranxf_use($q_config['default_language'], $r->content, false);
1082
- }
1083
- // For product variations, do something special
1084
- if ( isset($wc_prod_var_o) ) {
1085
- $r->content = $wc_prod_var_o->get_description();
1086
- if ( $r->content == '') {
1087
- $_pprod = wc_get_product($wc_prod_var_o->get_parent_id());
1088
- $r->content = $_pprod->get_description();
1089
- }
1090
- }
1091
- $_content = $r->content;
1092
- break;
1093
- }
1094
-
1095
- if ( $_content == "" && $r->content != '') {
1096
- $_content = $r->content;
1097
- }
1098
-
1099
- // Remove unneccessary gutemberg blocks
1100
- $_content = ASL_Helpers::removeGutenbergBlocks($_content, array('core-embed/*'));
1101
-
1102
- // Deal with the shortcodes here, for more accuracy
1103
- if ( $sd['shortcode_op'] == "remove" ) {
1104
- if ( $_content != "" ) {
1105
- // Remove shortcodes, keep the content, really fast and effective method
1106
- $_content = preg_replace("~(?:\[/?)[^\]]+/?\]~su", '', $_content);
1107
- }
1108
- } else {
1109
- if ( $_content != "" ) {
1110
- $_content = apply_filters( 'the_content', $_content );
1111
- }
1112
- }
1113
-
1114
- // Remove styles and scripts
1115
- $_content = preg_replace( array(
1116
- '#<script(.*?)>(.*?)</script>#is',
1117
- '#<style(.*?)>(.*?)</style>#is'
1118
- ), '', $_content );
1119
-
1120
- $_content = strip_tags( $_content );
1121
-
1122
- // Get the words from around the search phrase, or just the description
1123
- if ( w_isset_def($sd['description_context'], 1) == 1 && count( $_s ) > 0 && $s != '' ) {
1124
- // Try for an exact match
1125
- $_ex_content = $this->context_find(
1126
- $_content, $s,
1127
- floor($sd['descriptionlength'] / 6),
1128
- $sd['descriptionlength'],
1129
- 50000,
1130
- true
1131
- );
1132
- if ( $_ex_content === false ) {
1133
- // No exact match, go with the first keyword
1134
- $_content = $this->context_find(
1135
- $_content, $_s[0],
1136
- floor($sd['descriptionlength'] / 6),
1137
- $sd['descriptionlength'],
1138
- 50000
1139
- );
1140
- } else {
1141
- $_content = $_ex_content;
1142
- }
1143
- } else if ( $_content != '' && ( strlen( $_content ) > $sd['descriptionlength'] ) ) {
1144
- $_content = wd_substr_at_word($_content, $sd['descriptionlength']) . "...";
1145
- }
1146
-
1147
- $post_time = strtotime($r->date);
1148
- $date_format = get_option('date_format', "Y-m-d") . " " . get_option('time_format', "H:i:s");
1149
- $r->date = @date_i18n($date_format, $post_time);
1150
-
1151
- $_content = wd_closetags( $_content );
1152
- $r->content = $_content;
1153
-
1154
- }
1155
- /* !Images, title, desc */
1156
- $this->results = $pageposts;
1157
-
1158
- return $pageposts;
1159
-
1160
- }
1161
-
1162
- protected function group() {
1163
- return $this->results;
1164
- }
1165
-
1166
- /**
1167
- * Fetches an image for BFI class
1168
- * @param $post WP_POst Post object
1169
- * @return string image URL
1170
- */
1171
- protected function getBFIimage( $post ) {
1172
- $image_num = $this->searchData['image_parser_image_number'];
1173
-
1174
- if ( ! isset( $post->image ) || $post->image == null ) {
1175
-
1176
- if ( ! isset( $post->id ) ) {
1177
- return "";
1178
- }
1179
- $im = "";
1180
- for ( $i = 1; $i < 6; $i ++ ) {
1181
- switch ( $this->imageSettings[ 'image_source' . $i ] ) {
1182
- case "featured":
1183
- if ( $this->imageSettings['image_source_featured'] == "original" ) {
1184
- $im = wp_get_attachment_url(get_post_thumbnail_id($post->id));
1185
- } else {
1186
- $imx = wp_get_attachment_image_src(
1187
- get_post_thumbnail_id($post->id), $this->imageSettings['image_source_featured'], false
1188
- );
1189
- if ( $imx !== false && isset($imx[0]) )
1190
- $im = $imx[0];
1191
- }
1192
- break;
1193
- case "content":
1194
- $content = apply_filters('the_content', get_post_field('post_content', $post->id));
1195
-
1196
- $im = asl_get_image_from_content( $content, $image_num );
1197
- if ( is_multisite() ) {
1198
- $im = str_replace( home_url(), network_home_url(), $im );
1199
- }
1200
- break;
1201
- case "excerpt":
1202
- $excerpt = get_post_field('post_excerpt', $post->id);
1203
-
1204
- $im = asl_get_image_from_content( $excerpt, $image_num );
1205
- if ( is_multisite() ) {
1206
- $im = str_replace( home_url(), network_home_url(), $im );
1207
- }
1208
- break;
1209
- case "screenshot":
1210
- $im = 'http://s.wordpress.com/mshots/v1/' . urlencode( get_permalink( $post->id ) ) .
1211
- '?w=' . $this->imageSettings['image_width'] . '&h=' . $this->imageSettings['image_height'];
1212
- break;
1213
- case "custom":
1214
- if ( $this->imageSettings['image_custom_field'] != "" ) {
1215
- $val = get_post_meta( $post->id, $this->imageSettings['image_custom_field'], true );
1216
- if ( $val != null && $val != "" ) {
1217
- if ( is_numeric($val) ) {
1218
- $im = wp_get_attachment_url( $val );
1219
- } else {
1220
- $im = $val;
1221
- }
1222
- }
1223
- }
1224
- break;
1225
- case "default":
1226
- if ( $this->imageSettings['image_default'] != "" ) {
1227
- $im = $this->imageSettings['image_default'];
1228
- }
1229
- break;
1230
- default:
1231
- $im = "";
1232
- break;
1233
- }
1234
- if ( $im != null && $im != '' ) {
1235
- break;
1236
- }
1237
- }
1238
-
1239
- return $im;
1240
- } else {
1241
- return $post->image;
1242
- }
1243
- }
1244
-
1245
- /**
1246
- * Returns the context of a phrase within a text.
1247
- * Uses preg_split method to iterate through strings.
1248
- *
1249
- * @param $str string context
1250
- * @param $needle string context
1251
- * @param $context int length of the context
1252
- * @param $maxlength int maximum length of the string in characters
1253
- * @param $str_length_limit int source string maximum length
1254
- * @param $false_on_no_match bool to return boolean false if no matches were found
1255
- * @return string
1256
- */
1257
- public function context_find($str, $needle, $context, $maxlength, $str_length_limit = 25000, $false_on_no_match = false) {
1258
- $haystack = ' '.trim($str).' ';
1259
-
1260
- // To prevent memory overflow, we need to limit the hay to relatively low count
1261
- $haystack = wd_substr_at_word(ASL_mb::strtolower($haystack), $str_length_limit);
1262
- $needle = ASL_mb::strtolower($needle);
1263
-
1264
- if ( $needle == "" ) return $str;
1265
-
1266
- /**
1267
- * This is an interesting issue. Turns out mb_substr($hay, $start, 1) is very ineffective.
1268
- * the preg_split(..) method is far more efficient in terms of speed, however it needs much more
1269
- * memory. In our case speed is the top priority. However to prevent memory overflow, the haystack
1270
- * is reduced to 10000 characters (roughly 1500 words) first.
1271
- *
1272
- * Reference ticket: https://wp-dreams.com/forums/topic/search-speed/
1273
- * Speed tests: http://stackoverflow.com/questions/3666306/how-to-iterate-utf-8-string-in-php
1274
- */
1275
- $chrArray = preg_split('//u', $haystack, -1, PREG_SPLIT_NO_EMPTY);
1276
- $hay_length = count($chrArray) - 1;
1277
-
1278
- if ( $i = ASL_mb::strpos($haystack, $needle) ) {
1279
- $start=$i;
1280
- $end=$i;
1281
- $spaces=0;
1282
-
1283
- while ($spaces < ((int) $context/2) && $start > 0) {
1284
- $start--;
1285
- if ($chrArray[$start] == ' ') {
1286
- $spaces++;
1287
- }
1288
- }
1289
-
1290
- while ($spaces < ($context +1) && $end < $hay_length) {
1291
- $end++;
1292
- if ($chrArray[$end] == ' ') {
1293
- $spaces++;
1294
- }
1295
- }
1296
-
1297
- while ($spaces < ($context +1) && $start > 0) {
1298
- $start--;
1299
- if ($chrArray[$start] == ' ') {
1300
- $spaces++;
1301
- }
1302
- }
1303
-
1304
- $str_start = ($start - 1) < 0 ? 0 : ($start -1);
1305
- $str_end = ($end - 1) < 0 ? 0 : ($end -1);
1306
-
1307
- $result = trim( ASL_mb::substr($str, $str_start, ($str_end - $str_start)) );
1308
-
1309
- // Somewhere inbetween..
1310
- if ( $start != 0 && $end < $hay_length )
1311
- return "..." . $result . "...";
1312
-
1313
- // Beginning
1314
- if ( $start == 0 && $end < $hay_length )
1315
- return $result . "...";
1316
-
1317
- // End
1318
- if ( $start != 0 && $end == $hay_length )
1319
- return "..." . $result;
1320
-
1321
- // If it is too long, strip it
1322
- if ( ASL_mb::strlen($result) > $maxlength)
1323
- return wd_substr_at_word( $result, $maxlength ) . "...";
1324
-
1325
- // Else, it is the whole
1326
- return $result;
1327
-
1328
- } else {
1329
- if ( $false_on_no_match )
1330
- return false;
1331
-
1332
- // If it is too long, strip it
1333
- if ( ASL_mb::strlen($str) > $maxlength)
1334
- return wd_substr_at_word( $str, $maxlength ) . "...";
1335
-
1336
- return $str;
1337
- }
1338
- }
1339
-
1340
- public function deregisterShortcodes() {
1341
- // Remove shortcodes with contents
1342
- $ignore_shortcodes = array(
1343
- "wpdreams_ajaxsearchlite", "wpdreams_ajaxsearchpro", "wd_asl",
1344
- "embed"
1345
- );
1346
- foreach ( $ignore_shortcodes as $shortcode ) {
1347
- remove_shortcode( $shortcode );
1348
- add_shortcode( $shortcode, array( $this, 'return_empty_string' ) );
1349
- }
1350
- }
1351
-
1352
- /**
1353
- * An empty function to override individual shortcodes, this must be public
1354
- *
1355
- * @return string
1356
- */
1357
- public function return_empty_string() {
1358
- return "";
1359
- }
1360
-
1361
- }
1362
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/functions/functions.php CHANGED
@@ -8,6 +8,36 @@ if (!function_exists("w_isset_def")) {
8
  }
9
  }
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  if (!function_exists("wpdreams_setval_or_getoption")) {
12
  function wpdreams_setval_or_getoption($options, $key, $def_key)
13
  {
@@ -429,6 +459,25 @@ if (!function_exists('asl_icl_t')) {
429
  }
430
  }
431
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
432
  if (!function_exists("wd_closetags")) {
433
  /**
434
  * Close unclosed HTML tags
@@ -528,6 +577,32 @@ if (!function_exists("wd_in_array_r")) {
528
  }
529
  }
530
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
531
  if (!function_exists("wd_substr_at_word")) {
532
  function wd_substr_at_word($text, $length) {
533
  if (strlen($text) <= $length) return $text;
8
  }
9
  }
10
 
11
+ if (!function_exists('wpd_is_wp_version')) {
12
+ function wpd_is_wp_version($operator = '>', $version = '4.5') {
13
+ global $wp_version;
14
+
15
+ return version_compare($wp_version, $version, $operator);
16
+ }
17
+ }
18
+
19
+ if (!function_exists('wpd_is_wp_older')) {
20
+ function wpd_is_wp_older($version = '4.5') {
21
+ return wpd_is_wp_version('<', $version);
22
+ }
23
+ }
24
+
25
+ if (!function_exists('wpd_is_wp_newer')) {
26
+ function wpd_is_wp_newer($version = '4.5') {
27
+ return wpd_is_wp_version('>', $version);
28
+ }
29
+ }
30
+
31
+ if ( !function_exists('wpd_get_terms') ) {
32
+ function wpd_get_terms($args = array()) {
33
+ if ( wpd_is_wp_older('4.5') ) {
34
+ return get_terms($args['taxonomy'], $args);
35
+ } else {
36
+ return get_terms($args);
37
+ }
38
+ }
39
+ }
40
+
41
  if (!function_exists("wpdreams_setval_or_getoption")) {
42
  function wpdreams_setval_or_getoption($options, $key, $def_key)
43
  {
459
  }
460
  }
461
 
462
+ if ( !function_exists('wd_strip_tags_ws') ) {
463
+ /**
464
+ * Strips tags, but replaces them with whitespace
465
+ *
466
+ * @param string $string
467
+ * @param string $allowable_tags
468
+ * @return string
469
+ * @link https://stackoverflow.com/a/38200395
470
+ */
471
+ function wd_strip_tags_ws($string, $allowable_tags = '') {
472
+ $string = str_replace('<', ' <', $string);
473
+ $string = strip_tags($string, $allowable_tags);
474
+ $string = str_replace(' ', ' ', $string);
475
+ $string = trim($string);
476
+
477
+ return $string;
478
+ }
479
+ }
480
+
481
  if (!function_exists("wd_closetags")) {
482
  /**
483
  * Close unclosed HTML tags
577
  }
578
  }
579
 
580
+ if (!function_exists("wd_array_to_string")) {
581
+ /**
582
+ * Converts a multi-depth array elements into one string, elements separated by space.
583
+ *
584
+ * @param $arr
585
+ * @param int $level
586
+ *
587
+ * @return string
588
+ */
589
+ function wd_array_to_string($arr, $level = 0) {
590
+ $str = "";
591
+ if (is_array($arr)) {
592
+ foreach ($arr as $sub_arr) {
593
+ $str .= wd_array_to_string($sub_arr, $level + 1);
594
+ }
595
+ } else {
596
+ $str = " " . $arr;
597
+ }
598
+ if ($level == 0) {
599
+ $str = trim($str);
600
+ }
601
+
602
+ return $str;
603
+ }
604
+ }
605
+
606
  if (!function_exists("wd_substr_at_word")) {
607
  function wd_substr_at_word($text, $length) {
608
  if (strlen($text) <= $length) return $text;
includes/views/asl.shortcode.php CHANGED
@@ -14,7 +14,7 @@
14
  <?php do_action('asl_layout_in_magnifier', $id); ?>
15
  <div class='innericon'>
16
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
17
- <path id="magnifier-2-icon" d="M460.355,421.59L353.844,315.078c20.041-27.553,31.885-61.437,31.885-98.037
18
  C385.729,124.934,310.793,50,218.686,50C126.58,50,51.645,124.934,51.645,217.041c0,92.106,74.936,167.041,167.041,167.041
19
  c34.912,0,67.352-10.773,94.184-29.158L419.945,462L460.355,421.59z M100.631,217.041c0-65.096,52.959-118.056,118.055-118.056
20
  c65.098,0,118.057,52.959,118.057,118.056c0,65.096-52.959,118.056-118.057,118.056C153.59,335.097,100.631,282.137,100.631,217.041
@@ -31,7 +31,7 @@
31
  <?php do_action('asl_layout_in_settings', $id); ?>
32
  <div class='innericon'>
33
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
34
- <polygon id="arrow-25-icon" transform = "rotate(90 256 256)" points="142.332,104.886 197.48,50 402.5,256 197.48,462 142.332,407.113 292.727,256 "/>
35
  </svg>
36
  </div>
37
  </div>
@@ -44,7 +44,6 @@
44
  <form autocomplete="off" aria-label='Ajax search form'>
45
  <input aria-label='Search input' type='search' class='orig' name='phrase' placeholder='<?php echo asl_icl_t( "Search bar placeholder text", w_isset_def($style['defaultsearchtext'], '') ); ?>' value='<?php echo apply_filters('asl_print_search_query', get_search_query()); ?>' autocomplete="off"/>
46
  <input aria-label='Autocomplete input, do not use this' type='text' class='autocomplete' name='phrase' value='' autocomplete="off"/>
47
- <span class='loading'></span>
48
  <input type='submit' value="Start search" style='width:0; height: 0; visibility: hidden;'>
49
  </form>
50
  </div>
@@ -66,8 +65,7 @@
66
  y="0px"
67
  width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512"
68
  xml:space="preserve">
69
- <polygon id="x-mark-icon"
70
- points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622 73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "/>
71
  </svg>
72
  </div>
73
  <?php endif; ?>
@@ -114,35 +112,36 @@ if ( function_exists('qtranxf_getLanguage') ) {
114
  <?php do_action('asl_layout_in_form', $id); ?>
115
 
116
  <?php do_action('asl_layout_settings_before_first_item', $id); ?>
117
- <fieldset class="asl_sett_scroll">
118
- <legend style="display: none;">Generic selectors</legend>
119
- <div class="asl_option_inner hiddend">
120
- <input type='hidden' name='qtranslate_lang' id='qtranslate_lang<?php echo $id; ?>'
121
- value='<?php echo $qtr_lg; ?>'/>
122
- </div>
123
 
124
- <?php if (defined('ICL_LANGUAGE_CODE')
125
- && ICL_LANGUAGE_CODE != ''
126
- && defined('ICL_SITEPRESS_VERSION')
127
- ): ?>
128
- <div class="asl_option_inner hiddend">
129
- <input type='hidden' name='wpml_lang'
130
- value='<?php echo ICL_LANGUAGE_CODE; ?>'/>
131
- </div>
132
- <?php endif; ?>
133
-
134
- <?php if ( function_exists("pll_current_language") ): ?>
135
- <div class="asl_option_inner hiddend">
136
- <input type='hidden' name='polylang_lang'
137
- value='<?php echo pll_current_language(); ?>'/>
138
- </div>
139
- <?php endif; ?>
 
 
 
 
 
140
 
 
 
141
  <div class="asl_option<?php echo(($style['showexactmatches'] != 1) ? " hiddend" : ""); ?>">
142
  <div class="asl_option_inner">
143
- <input type="checkbox" value="checked" id="set_exactonly<?php echo $id; ?>"
144
  title="<?php echo asl_icl_t('Exact matches filter', $style['exactmatchestext'], true); ?>"
145
- name="set_exactonly" <?php echo $_checked["set_exactonly"]; ?>/>
146
  <label for="set_exactonly<?php echo $id; ?>"><?php echo asl_icl_t('Exact matches filter', $style['exactmatchestext'], true); ?></label>
147
  </div>
148
  <div class="asl_option_label">
@@ -151,9 +150,9 @@ if ( function_exists('qtranxf_getLanguage') ) {
151
  </div>
152
  <div class="asl_option<?php echo(($style['showsearchintitle'] != 1) ? " hiddend" : ""); ?>">
153
  <div class="asl_option_inner">
154
- <input type="checkbox" value="None" id="set_intitle<?php echo $id; ?>"
155
  title="<?php echo asl_icl_t('Search in title filter', $style['searchintitletext'], true); ?>"
156
- name="set_intitle" <?php echo $_checked["set_intitle"]; ?>/>
157
  <label for="set_intitle<?php echo $id; ?>"><?php echo asl_icl_t('Search in title filter', $style['searchintitletext'], true); ?></label>
158
  </div>
159
  <div class="asl_option_label">
@@ -162,9 +161,9 @@ if ( function_exists('qtranxf_getLanguage') ) {
162
  </div>
163
  <div class="asl_option<?php echo(($style['showsearchincontent'] != 1) ? " hiddend" : ""); ?>">
164
  <div class="asl_option_inner">
165
- <input type="checkbox" value="None" id="set_incontent<?php echo $id; ?>"
166
  title="<?php echo asl_icl_t('Search in content filter', $style['searchincontenttext'], true); ?>"
167
- name="set_incontent" <?php echo $_checked["set_incontent"]; ?>/>
168
  <label for="set_incontent<?php echo $id; ?>"><?php echo asl_icl_t('Search in content filter', $style['searchincontenttext'], true); ?></label>
169
  </div>
170
  <div class="asl_option_label">
@@ -172,50 +171,26 @@ if ( function_exists('qtranxf_getLanguage') ) {
172
  </div>
173
  </div>
174
  <div class="asl_option_inner hiddend">
175
- <input type="checkbox" value="None" id="set_inexcerpt<?php echo $id; ?>"
176
  title="Search in excerpt"
177
- name="set_inexcerpt" <?php echo $_checked["set_inexcerpt"]; ?>/>
178
  <label for="set_inexcerpt<?php echo $id; ?>">Search in excerpt</label>
179
  </div>
180
-
181
- <div class="asl_option<?php echo(($style['showsearchinposts'] != 1) ? " hiddend" : ""); ?>">
182
- <div class="asl_option_inner">
183
- <input type="checkbox" value="None" id="set_inposts<?php echo $id; ?>"
184
- title="<?php echo asl_icl_t('Search in posts filter', $style['searchinpoststext'], true); ?>"
185
- name="set_inposts" <?php echo $_checked["set_inposts"]; ?>/>
186
- <label for="set_inposts<?php echo $id; ?>"><?php echo asl_icl_t('Search in posts filter', $style['searchinpoststext'], true); ?></label>
187
- </div>
188
- <div class="asl_option_label">
189
- <?php echo asl_icl_t('Search in posts filter', $style['searchinpoststext']); ?>
190
- </div>
191
- </div>
192
- <div class="asl_option<?php echo(($style['showsearchinpages'] != 1) ? " hiddend" : ""); ?>">
193
- <div class="asl_option_inner">
194
- <input type="checkbox" value="None" id="set_inpages<?php echo $id; ?>"
195
- title="<?php echo asl_icl_t('Search in pages filter', $style['searchinpagestext'], true); ?>"
196
- name="set_inpages" <?php echo $_checked["set_inpages"]; ?>/>
197
- <label for="set_inpages<?php echo $id; ?>"><?php echo asl_icl_t('Search in pages filter', $style['searchinpagestext'], true); ?></label>
198
- </div>
199
- <div class="asl_option_label">
200
- <?php echo asl_icl_t('Search in pages filter', $style['searchinpagestext']); ?>
201
- </div>
202
- </div>
203
  <?php
204
 
205
- $types = get_post_types(array(
206
- '_builtin' => false
207
- ));
208
  $i = 1;
209
  if ( !isset($style['customtypes']) || !is_array($style['customtypes']) )
210
  $style['customtypes'] = array();
211
  if (!isset($style['selected-showcustomtypes']) || !is_array($style['selected-showcustomtypes']))
212
  $style['selected-showcustomtypes'] = array();
213
- $flat_show_customtypes = array('post', 'page');
214
 
215
  foreach ($style['selected-showcustomtypes'] as $k => $v) {
216
  $selected = in_array($v[0], $style['customtypes']);
217
  $hidden = "";
218
- $flat_show_customtypes[] = $v[0];
219
  ?>
220
  <div class="asl_option">
221
  <div class="asl_option_inner">
@@ -232,27 +207,24 @@ if ( function_exists('qtranxf_getLanguage') ) {
232
  <?php
233
  $i++;
234
  }
235
- ?>
236
- </fieldset>
237
- <?php
238
- $hidden_types = array();
239
- $hidden_types = array_diff($style['customtypes'], $flat_show_customtypes);
240
 
241
- foreach ($hidden_types as $k => $v) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
242
  ?>
243
- <div class="asl_option_inner hiddend">
244
- <input type="checkbox" value="<?php echo $v; ?>"
245
- id="<?php echo $id; ?>customset_<?php echo $id . $i; ?>"
246
- title="Hidden option, ignore please"
247
- name="customset[]" checked="checked"/>
248
- <label for="<?php echo $id; ?>customset_<?php echo $id . $i; ?>">Hidden</label>
249
- </div>
250
- <div class="asl_option_label hiddend"></div>
251
-
252
- <?php
253
- $i++;
254
- }
255
- ?>
256
  <?php
257
  /* Category and term filters */
258
  if ($style['showsearchincategories']) {
@@ -373,12 +345,16 @@ if ( function_exists('qtranxf_getLanguage') ) {
373
  "defaultImage": "<?php echo w_isset_def($style['image_default'], "")==""?ASL_URL."img/default.jpg":$style['image_default']; ?>",
374
  "highlight": <?php echo $style['kw_highlight']; ?>,
375
  "highlightwholewords": <?php echo $style['kw_highlight_whole_words']; ?>,
 
376
  "scrollToResults": <?php echo w_isset_def($style['scroll_to_results'], 1); ?>,
377
  "resultareaclickable": <?php echo ((isset($style['resultareaclickable']) && $style['resultareaclickable']!="")?$style['resultareaclickable']:0); ?>,
378
  "autocomplete": {
379
  "enabled" : <?php echo w_isset_def($style['autocomplete'], 1); ?>,
380
  "lang" : "<?php echo w_isset_def($style['kw_google_lang'], 'en'); ?>"
381
  },
 
 
 
382
  "triggerontype": <?php echo ((isset($style['triggerontype']) && $style['triggerontype']!="")?$style['triggerontype']:1); ?>,
383
  "trigger_on_click": <?php echo $style['redirect_click_to'] == 'ajax_search' || $style['redirect_click_to'] == 'first_result' ? 1 : 0; ?>,
384
  "trigger_on_facet_change": <?php echo w_isset_def($style['trigger_on_facet_change'], 0); ?>,
14
  <?php do_action('asl_layout_in_magnifier', $id); ?>
15
  <div class='innericon'>
16
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
17
+ <path d="M460.355,421.59L353.844,315.078c20.041-27.553,31.885-61.437,31.885-98.037
18
  C385.729,124.934,310.793,50,218.686,50C126.58,50,51.645,124.934,51.645,217.041c0,92.106,74.936,167.041,167.041,167.041
19
  c34.912,0,67.352-10.773,94.184-29.158L419.945,462L460.355,421.59z M100.631,217.041c0-65.096,52.959-118.056,118.055-118.056
20
  c65.098,0,118.057,52.959,118.057,118.056c0,65.096-52.959,118.056-118.057,118.056C153.59,335.097,100.631,282.137,100.631,217.041
31
  <?php do_action('asl_layout_in_settings', $id); ?>
32
  <div class='innericon'>
33
  <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512" xml:space="preserve">
34
+ <polygon transform = "rotate(90 256 256)" points="142.332,104.886 197.48,50 402.5,256 197.48,462 142.332,407.113 292.727,256 "/>
35
  </svg>
36
  </div>
37
  </div>
44
  <form autocomplete="off" aria-label='Ajax search form'>
45
  <input aria-label='Search input' type='search' class='orig' name='phrase' placeholder='<?php echo asl_icl_t( "Search bar placeholder text", w_isset_def($style['defaultsearchtext'], '') ); ?>' value='<?php echo apply_filters('asl_print_search_query', get_search_query()); ?>' autocomplete="off"/>
46
  <input aria-label='Autocomplete input, do not use this' type='text' class='autocomplete' name='phrase' value='' autocomplete="off"/>
 
47
  <input type='submit' value="Start search" style='width:0; height: 0; visibility: hidden;'>
48
  </form>
49
  </div>
65
  y="0px"
66
  width="512px" height="512px" viewBox="0 0 512 512" enable-background="new 0 0 512 512"
67
  xml:space="preserve">
68
+ <polygon points="438.393,374.595 319.757,255.977 438.378,137.348 374.595,73.607 255.995,192.225 137.375,73.622 73.607,137.352 192.246,255.983 73.622,374.625 137.352,438.393 256.002,319.734 374.652,438.378 "/>
 
69
  </svg>
70
  </div>
71
  <?php endif; ?>
112
  <?php do_action('asl_layout_in_form', $id); ?>
113
 
114
  <?php do_action('asl_layout_settings_before_first_item', $id); ?>
 
 
 
 
 
 
115
 
116
+ <div class="asl_option_inner hiddend">
117
+ <input type='hidden' name='qtranslate_lang' id='qtranslate_lang<?php echo $id; ?>'
118
+ value='<?php echo $qtr_lg; ?>'/>
119
+ </div>
120
+
121
+ <?php if (defined('ICL_LANGUAGE_CODE')
122
+ && ICL_LANGUAGE_CODE != ''
123
+ && defined('ICL_SITEPRESS_VERSION')
124
+ ): ?>
125
+ <div class="asl_option_inner hiddend">
126
+ <input type='hidden' name='wpml_lang'
127
+ value='<?php echo ICL_LANGUAGE_CODE; ?>'/>
128
+ </div>
129
+ <?php endif; ?>
130
+
131
+ <?php if ( function_exists("pll_current_language") ): ?>
132
+ <div class="asl_option_inner hiddend">
133
+ <input type='hidden' name='polylang_lang'
134
+ value='<?php echo pll_current_language(); ?>'/>
135
+ </div>
136
+ <?php endif; ?>
137
 
138
+ <fieldset class="asl_sett_scroll">
139
+ <legend style="display: none;">Generic selectors</legend>
140
  <div class="asl_option<?php echo(($style['showexactmatches'] != 1) ? " hiddend" : ""); ?>">
141
  <div class="asl_option_inner">
142
+ <input type="checkbox" value="exact" id="set_exactonly<?php echo $id; ?>"
143
  title="<?php echo asl_icl_t('Exact matches filter', $style['exactmatchestext'], true); ?>"
144
+ name="asl_gen[]" <?php echo $_checked["set_exactonly"]; ?>/>
145
  <label for="set_exactonly<?php echo $id; ?>"><?php echo asl_icl_t('Exact matches filter', $style['exactmatchestext'], true); ?></label>
146
  </div>
147
  <div class="asl_option_label">
150
  </div>
151
  <div class="asl_option<?php echo(($style['showsearchintitle'] != 1) ? " hiddend" : ""); ?>">
152
  <div class="asl_option_inner">
153
+ <input type="checkbox" value="title" id="set_intitle<?php echo $id; ?>"
154
  title="<?php echo asl_icl_t('Search in title filter', $style['searchintitletext'], true); ?>"
155
+ name="asl_gen[]" <?php echo $_checked["set_intitle"]; ?>/>
156
  <label for="set_intitle<?php echo $id; ?>"><?php echo asl_icl_t('Search in title filter', $style['searchintitletext'], true); ?></label>
157
  </div>
158
  <div class="asl_option_label">
161
  </div>
162
  <div class="asl_option<?php echo(($style['showsearchincontent'] != 1) ? " hiddend" : ""); ?>">
163
  <div class="asl_option_inner">
164
+ <input type="checkbox" value="content" id="set_incontent<?php echo $id; ?>"
165
  title="<?php echo asl_icl_t('Search in content filter', $style['searchincontenttext'], true); ?>"
166
+ name="asl_gen[]" <?php echo $_checked["set_incontent"]; ?>/>
167
  <label for="set_incontent<?php echo $id; ?>"><?php echo asl_icl_t('Search in content filter', $style['searchincontenttext'], true); ?></label>
168
  </div>
169
  <div class="asl_option_label">
171
  </div>
172
  </div>
173
  <div class="asl_option_inner hiddend">
174
+ <input type="checkbox" value="excerpt" id="set_inexcerpt<?php echo $id; ?>"
175
  title="Search in excerpt"
176
+ name="asl_gen[]" <?php echo $_checked["set_inexcerpt"]; ?>/>
177
  <label for="set_inexcerpt<?php echo $id; ?>">Search in excerpt</label>
178
  </div>
179
+ </fieldset>
180
+ <fieldset class="asl_sett_scroll">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
181
  <?php
182
 
 
 
 
183
  $i = 1;
184
  if ( !isset($style['customtypes']) || !is_array($style['customtypes']) )
185
  $style['customtypes'] = array();
186
  if (!isset($style['selected-showcustomtypes']) || !is_array($style['selected-showcustomtypes']))
187
  $style['selected-showcustomtypes'] = array();
188
+ $shown_types = array();
189
 
190
  foreach ($style['selected-showcustomtypes'] as $k => $v) {
191
  $selected = in_array($v[0], $style['customtypes']);
192
  $hidden = "";
193
+ $shown_types[] = $v[0];
194
  ?>
195
  <div class="asl_option">
196
  <div class="asl_option_inner">
207
  <?php
208
  $i++;
209
  }
 
 
 
 
 
210
 
211
+ $remaining_types = array_unique( array_diff($style['customtypes'], $shown_types) );
212
+ foreach ($remaining_types as $k => $v) {
213
+ ?>
214
+ <div class="asl_option_inner hiddend">
215
+ <input type="checkbox" value="<?php echo $v; ?>"
216
+ id="<?php echo $id; ?>customset_<?php echo $id . $i; ?>"
217
+ title="Hidden option, ignore please"
218
+ name="customset[]" checked="checked"/>
219
+ <label for="<?php echo $id; ?>customset_<?php echo $id . $i; ?>">Hidden</label>
220
+ </div>
221
+ <div class="asl_option_label hiddend"></div>
222
+
223
+ <?php
224
+ $i++;
225
+ }
226
  ?>
227
+ </fieldset>
 
 
 
 
 
 
 
 
 
 
 
 
228
  <?php
229
  /* Category and term filters */
230
  if ($style['showsearchincategories']) {
345
  "defaultImage": "<?php echo w_isset_def($style['image_default'], "")==""?ASL_URL."img/default.jpg":$style['image_default']; ?>",
346
  "highlight": <?php echo $style['kw_highlight']; ?>,
347
  "highlightwholewords": <?php echo $style['kw_highlight_whole_words']; ?>,
348
+ "singleHighlight": <?php echo $style['single_highlight']; ?>,
349
  "scrollToResults": <?php echo w_isset_def($style['scroll_to_results'], 1); ?>,
350
  "resultareaclickable": <?php echo ((isset($style['resultareaclickable']) && $style['resultareaclickable']!="")?$style['resultareaclickable']:0); ?>,
351
  "autocomplete": {
352
  "enabled" : <?php echo w_isset_def($style['autocomplete'], 1); ?>,
353
  "lang" : "<?php echo w_isset_def($style['kw_google_lang'], 'en'); ?>"
354
  },
355
+ "mobile": {
356
+ "menu_selector": "<?php echo $style['mob_auto_focus_menu_selector']; ?>"
357
+ },
358
  "triggerontype": <?php echo ((isset($style['triggerontype']) && $style['triggerontype']!="")?$style['triggerontype']:1); ?>,
359
  "trigger_on_click": <?php echo $style['redirect_click_to'] == 'ajax_search' || $style['redirect_click_to'] == 'first_result' ? 1 : 0; ?>,
360
  "trigger_on_facet_change": <?php echo w_isset_def($style['trigger_on_facet_change'], 0); ?>,
includes/views/result.php CHANGED
@@ -25,7 +25,7 @@ defined('ABSPATH') or die("You can't access this file directly.");
25
  * @since: 4.0
26
  */
27
  ?>
28
- <div class='item<?php echo apply_filters('asl_result_css_class', $asl_res_css_class); ?>'>
29
 
30
  <?php do_action('asl_res_vertical_begin_item'); ?>
31
 
25
  * @since: 4.0
26
  */
27
  ?>
28
+ <div class='item<?php echo apply_filters('asl_result_css_class', $asl_res_css_class, $r->id, $r); ?>'>
29
 
30
  <?php do_action('asl_res_vertical_begin_item'); ?>
31
 
js/min-scoped/jquery.ajaxsearchlite.min.js CHANGED
@@ -1,4 +1,4 @@
1
  /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2
- !function(n,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)}("undefined"!=typeof window?window:this,function(n,t){var c=[],l=c.slice,ki=c.concat,ni=c.push,di=c.indexOf,ct={},hf=ct.toString,nt=ct.hasOwnProperty,r={},gi="1.11.1",i=function(n,t){return new i.fn.init(n,t)},cf=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,lf=/^-ms-/,af=/-([\da-z])/gi,vf=function(n,t){return t.toUpperCase()};i.fn=i.prototype={jquery:gi,constructor:i,selector:"",length:0,toArray:function(){return l.call(this)},get:function(n){return null!=n?0>n?this[n+this.length]:this[n]:l.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(0>n?i:0);return this.pushStack(t>=0&&i>t?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ni,sort:c.sort,splice:c.splice};i.extend=i.fn.extend=function(){var r,e,t,f,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);c>u;u++)if(null!=(o=arguments[u]))for(f in o)r=n[f],t=o[f],n!==t&&(h&&t&&(i.isPlainObject(t)||(e=i.isArray(t)))?(e?(e=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):void 0!==t&&(n[f]=t));return n};i.extend({expando:"jQuery"+(gi+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return"function"===i.type(n)},isArray:Array.isArray||function(n){return"array"===i.type(n)},isWindow:function(n){return null!=n&&n==n.window},isNumeric:function(n){return!i.isArray(n)&&n-parseFloat(n)>=0},isEmptyObject:function(n){for(var t in n)return!1;return!0},isPlainObject:function(n){var t;if(!n||"object"!==i.type(n)||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!nt.call(n,"constructor")&&!nt.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}if(r.ownLast)for(t in n)return nt.call(n,t);for(t in n);return void 0===t||nt.call(n,t)},type:function(n){return null==n?n+"":"object"==typeof n||"function"==typeof n?ct[hf.call(n)]||"object":typeof n},globalEval:function(t){t&&i.trim(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(lf,"ms-").replace(af,vf)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ti(n);if(i){if(e){for(;f>r;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;f>r;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:function(n){return null==n?"":(n+"").replace(cf,"")},makeArray:function(n,t){var r=t||[];return null!=n&&(ti(Object(n))?i.merge(r,"string"==typeof n?[n]:n):ni.call(r,n)),r},inArray:function(n,t,i){var r;if(t){if(di)return di.call(t,n,i);for(r=t.length,i=i?0>i?Math.max(0,r+i):i:0;r>i;i++)if(i in t&&t[i]===n)return i}return-1},merge:function(n,t){for(var r=+t.length,i=0,u=n.length;r>i;)n[u++]=t[i++];if(r!==r)while(void 0!==t[i])n[u++]=t[i++];return n.length=u,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;e>r;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ti(n),f=[];if(o)for(;e>r;r++)u=t(n[r],r,i),null!=u&&f.push(u);else for(r in n)u=t(n[r],r,i),null!=u&&f.push(u);return ki.apply([],f)},guid:1,proxy:function(n,t){var u,r,f;return"string"==typeof t&&(f=n[t],t=n,n=f),i.isFunction(n)?(u=l.call(arguments,2),r=function(){return n.apply(t||this,u.concat(l.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r):void 0},now:function(){return+new Date},support:r});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ct["[object "+t+"]"]=t.toLowerCase()});function ti(n){var t=n.length,r=i.type(n);return"function"===r||i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in n}var tt=function(n){var it,u,t,ht,oi,et,wt,si,ct,y,rt,p,e,l,a,o,g,lt,ot,f="sizzle"+-new Date,s=n.document,v=0,ki=0,hi=ni(),ci=ni(),li=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut="undefined",ai=1<<31,di={}.hasOwnProperty,w=[],gi=w.pop,nr=w.push,b=w.push,vi=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yi=ft.replace("w","w#"),pi="\\["+i+"*("+ft+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+yi+"))|)"+i+"*\\]",dt=":("+ft+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+pi+")*)|.*)\\)|)",at=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),tr=new RegExp("^"+i+"*,"+i+"*"),ir=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),rr=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),ur=new RegExp(dt),fr=new RegExp("^"+yi+"$"),vt={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+pi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},er=/^(?:input|select|textarea|button)$/i,or=/^h\d$/i,st=/^[^{]+\{\s*\[native \w/,sr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,hr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{b.apply(w=vi.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){nr.apply(n,vi.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}function r(n,t,i,r){var w,h,c,v,k,y,d,l,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||"string"!=typeof n)return i;if(1!==(v=t.nodeType)&&9!==v)return[];if(a&&!r){if(w=sr.exec(n))if(c=w[1]){if(9===v){if(h=t.getElementById(c),!h||!h.parentNode)return i;if(h.id===c)return i.push(h),i}else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&ot(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&u.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(u.qsa&&(!o||!o.test(n))){if(l=d=f,nt=t,g=9===v&&n,1===v&&"object"!==t.nodeName.toLowerCase()){for(y=et(n),(d=t.getAttribute("id"))?l=d.replace(hr,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",k=y.length;k--;)y[k]=l+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,i,r)}function ni(){var i=[];function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function wi(n,t){var i=t&&n,r=i&&1===n.nodeType&&1===t.nodeType&&(~t.sourceIndex||ai)-(~n.sourceIndex||ai);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===n}}function lr(n){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}u=r.support={};oi=r.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?"HTML"!==t.nodeName:!1};p=r.setDocument=function(n){var v,r=n?n.ownerDocument||n:s,h=r.defaultView;return r!==e&&9===r.nodeType&&r.documentElement?(e=r,l=r.documentElement,a=!oi(r),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),u.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),u.getElementsByTagName=c(function(n){return n.appendChild(r.createComment("")),!n.getElementsByTagName("*").length}),u.getElementsByClassName=st.test(r.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",2===n.getElementsByClassName("i").length}),u.getById=c(function(n){return l.appendChild(n).id=f,!r.getElementsByName||!r.getElementsByName(f).length}),u.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&a){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=u.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if("*"===n){while(i=u[f++])1===i.nodeType&&r.push(i);return r}return u},t.find.CLASS=u.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&a)return t.getElementsByClassName(n)},g=[],o=[],(u.qsa=st.test(r.querySelectorAll))&&(c(function(n){n.innerHTML="<select msallowclip=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowclip^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=r.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(u.matchesSelector=st.test(lt=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&c(function(n){u.disconnectedMatch=lt.call(n,"div");lt.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),v=st.test(l.compareDocumentPosition),ot=v||st.test(l.contains)?function(n,t){var r=9===n.nodeType?n.documentElement:n,i=t&&t.parentNode;return n===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):n.compareDocumentPosition&&16&n.compareDocumentPosition(i)))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=v?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,1&i||!u.sortDetached&&t.compareDocumentPosition(n)===i?n===r||n.ownerDocument===s&&ot(s,n)?-1:t===r||t.ownerDocument===s&&ot(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:4&i?-1:1)}:function(n,t){if(n===t)return rt=!0,0;var i,u=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(!o||!h)return n===r?-1:t===r?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;if(o===h)return wi(n,t);for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===s?-1:e[u]===s?1:0},r):e};r.matches=function(n,t){return r(n,null,null,t)};r.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(rr,"='$1']"),!(!u.matchesSelector||!a||g&&g.test(t)||o&&o.test(t)))try{var i=lt.call(n,t);if(i||u.disconnectedMatch||n.document&&11!==n.document.nodeType)return i}catch(f){}return r(t,e,null,[n]).length>0};r.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),ot(n,t)};r.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],r=f&&di.call(t.attrHandle,i.toLowerCase())?f(n,i,!a):void 0;return void 0!==r?r:u.attributes||!a?n.getAttribute(i):(r=n.getAttributeNode(i))&&r.specified?r.value:null};r.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};r.uniqueSort=function(n){var r,f=[],t=0,i=0;if(rt=!u.detectDuplicates,y=!u.sortStable&&n.slice(0),n.sort(bt),rt){while(r=n[i++])r===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};ht=r.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(1===t||9===t||11===t){if("string"==typeof n.textContent)return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=ht(n)}else if(3===t||4===t)return n.nodeValue}else while(r=n[u++])i+=ht(r);return i};t=r.selectors={cacheLength:50,createPseudo:h,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[3]||n[4]||n[5]||"").replace(k,d),"~="===n[2]&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),"nth"===n[1].slice(0,3)?(n[3]||r.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*("even"===n[3]||"odd"===n[3])),n[5]=+(n[7]+n[8]||"odd"===n[3])):n[3]&&r.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&ur.test(t)&&(i=et(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return"*"===n?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&hi(n,function(n){return t.test("string"==typeof n.className&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(u){var f=r.attr(u,n);return null==f?"!="===t:t?(f+="","="===t?f===i:"!="===t?f!==i:"^="===t?i&&0===f.indexOf(i):"*="===t?i&&f.indexOf(i)>-1:"$="===t?i&&f.slice(-i.length)===i:"~="===t?(" "+f+" ").indexOf(i)>-1:"|="===t?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s="nth"!==n.slice(0,3),o="last"!==n.slice(-4),e="of-type"===t;return 1===r&&0===u?function(n){return!!n.parentNode}:function(t,i,h){var a,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;w=b="only"===n&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),a=k[n]||[],y=a[0]===v&&a[1],l=a[0]===v&&a[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(1===c.nodeType&&++l&&c===t){k[n]=[v,y,l];break}}else if(d&&(a=(t[f]||(t[f]={}))[n])&&a[0]===v)l=a[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:1===c.nodeType)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,u=t.pseudos[n]||t.setFilters[n.toLowerCase()]||r.error("unsupported pseudo: "+n);return u[f]?u(i):u.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var r,f=u(n,i),e=f.length;e--;)r=nt.call(n,f[e]),n[r]=!(t[r]=f[e])}):function(n){return u(n,0,e)}):u}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(at,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return r(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||ht(t)).indexOf(n)>-1}}),lang:h(function(n){return fr.test(n||"")||r.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=a?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||0===i.indexOf(n+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===l},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&!!n.checked||"option"===t&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return or.test(n.nodeName)},input:function(n){return er.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&"button"===n.type||"button"===t},text:function(n){var t;return"input"===n.nodeName.toLowerCase()&&"text"===n.type&&(null==(t=n.getAttribute("type"))||"text"===t.toLowerCase())},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[0>i?i+t:i]}),even:tt(function(n,t){for(var i=0;t>i;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;t>i;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=0>i?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=0>i?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=cr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=lr(it);function bi(){}bi.prototype=t.filters=t.pseudos;t.setFilters=new bi;et=r.tokenize=function(n,i){var e,f,s,o,u,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(u=n,h=[],c=t.preFilter;u;){(!e||(f=tr.exec(u)))&&(f&&(u=u.slice(f[0].length)||u),h.push(s=[]));e=!1;(f=ir.exec(u))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),u=u.slice(e.length));for(o in t.filter)(f=vt[o].exec(u))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),u=u.slice(e.length));if(!e)break}return i?u.length:u?r.error(n):ci(n,h).slice(0)};function yt(n){for(var t=0,r=n.length,i="";r>t;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&"parentNode"===r,e=ki++;return t.first?function(t,i,f){while(t=t[r])if(1===t.nodeType||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[v,e];if(o){while(t=t[r])if((1===t.nodeType||u)&&n(t,i,o))return!0}else while(t=t[r])if(1===t.nodeType||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===v&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function ar(n,t,i){for(var u=0,f=t.length;f>u;u++)r(n,t[u],i);return i}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=null!=t;s>f;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=!n||!f&&t?k:pt(k,p,n,o,s),h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ct)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];o>i;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;o>r;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:" "===n[i-2].type?"*":""})).replace(at,"$1"),u,r>i&&ei(n.slice(i,r)),o>r&&ei(n=n.slice(r)),o>r&&yt(n))}e.push(u)}return ui(e)}function vr(n,i){var u=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,a="0",g=o&&[],p=[],nt=ct,tt=o||f&&t.find.TAG("*",l),it=v+=null==nt?1:Math.random()||.1,rt=tt.length;for(l&&(ct=s!==e&&s);a!==rt&&null!=(y=tt[a]);a++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(v=it)}u&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=a,u&&a!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(a--)g[a]||p[a]||(p[a]=gi.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&r.uniqueSort(c)}return l&&(v=it,ct=nt),g};return u?h(o):o}return wt=r.compile=function(n,t){var r,u=[],e=[],i=li[n+" "];if(!i){for(t||(t=et(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=li(n,vr(e,u));i.selector=n}return i},si=r.select=function(n,i,r,f){var s,e,o,l,v,c="function"==typeof n&&n,h=!f&&et(n=c.selector||n);if(r=r||[],1===h.length){if(e=h[0]=h[0].slice(0),e.length>2&&"ID"===(o=e[0]).type&&u.getById&&9===i.nodeType&&a&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],!i)return r;c&&(i=i.parentNode);n=n.slice(e.shift().value.length)}for(s=vt.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[l=o.type])break;if((v=t.find[l])&&(f=v(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(r,f),r;break}}}return(c||wt(n,h))(f,i,!a,r,gt.test(n)&&ii(i.parentNode)||i),r},u.sortStable=f.split("").sort(bt).join("")===f,u.detectDuplicates=!!rt,p(),u.sortDetached=c(function(n){return 1&n.compareDocumentPosition(e.createElement("div"))}),c(function(n){return n.innerHTML="<a href='#'><\/a>","#"===n.firstChild.getAttribute("href")})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,"type"===t.toLowerCase()?1:2)}),u.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),""===n.firstChild.getAttribute("value")})||ti("value",function(n,t,i){if(!i&&"input"===n.nodeName.toLowerCase())return n.defaultValue}),c(function(n){return null==n.getAttribute("disabled")})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),r}(n);i.find=tt;i.expr=tt.selectors;i.expr[":"]=i.expr.pseudos;i.unique=tt.uniqueSort;i.text=tt.getText;i.isXMLDoc=tt.isXML;i.contains=tt.contains;var nr=i.expr.match.needsContext,tr=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,yf=/^.[^:#\[\.,]*$/;function ii(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if("string"==typeof t){if(yf.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return i.inArray(n,t)>=0!==r})}i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),1===t.length&&1===u.nodeType?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return 1===n.nodeType}))};i.fn.extend({find:function(n){var t,r=[],u=this,f=u.length;if("string"!=typeof n)return this.pushStack(i(n).filter(function(){for(t=0;f>t;t++)if(i.contains(u[t],this))return!0}));for(t=0;f>t;t++)i.find(n,u[t],r);return r=this.pushStack(f>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(ii(this,n||[],!1))},not:function(n){return this.pushStack(ii(this,n||[],!0))},is:function(n){return!!ii(this,"string"==typeof n&&nr.test(n)?i(n):n||[],!1).length}});var ft,u=n.document,pf=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,wf=i.fn.init=function(n,t){var r,f;if(!n)return this;if("string"==typeof n){if(r="<"===n.charAt(0)&&">"===n.charAt(n.length-1)&&n.length>=3?[null,n,null]:pf.exec(n),!r||!r[1]&&t)return!t||t.jquery?(t||ft).find(n):this.constructor(t).find(n);if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),tr.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(f=u.getElementById(r[2]),f&&f.parentNode){if(f.id!==r[2])return ft.find(n);this.length=1;this[0]=f}return this.context=u,this.selector=n,this}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?"undefined"!=typeof ft.ready?ft.ready(n):n(i):(void 0!==n.selector&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};wf.prototype=i.fn;ft=i(u);var bf=/^(?:parents|prev(?:Until|All))/,kf={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var f=[],u=n[t];u&&9!==u.nodeType&&(void 0===r||1!==u.nodeType||!i(u).is(r));)1===u.nodeType&&f.push(u),u=u[t];return f},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)1===n.nodeType&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t,r=i(n,this),u=r.length;return this.filter(function(){for(t=0;u>t;t++)if(i.contains(this,r[t]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=nr.test(n)||"string"!=typeof n?i(n,t||this.context):0;o>f;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:1===r.nodeType&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?"string"==typeof n?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}});function ir(n,t){do n=n[t];while(n&&1!==n.nodeType);return n}i.each({parent:function(n){var t=n.parentNode;return t&&11!==t.nodeType?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return ir(n,"nextSibling")},prev:function(n){return ir(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return"Until"!==n.slice(-5)&&(u=r),u&&"string"==typeof u&&(f=i.filter(u,f)),this.length>1&&(kf[n]||(f=i.unique(f)),bf.test(n)&&(f=f.reverse())),this.pushStack(f)}});var h=/\S+/g,rr={};function df(n){var t=rr[n]={};return i.each(n.match(h)||[],function(n,i){t[i]=!0}),t}i.Callbacks=function(n){n="string"==typeof n?rr[n]||df(n):i.extend({},n);var o,u,h,f,e,c,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&f>e;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;!function e(r){i.each(r,function(r,u){var f=i.type(u);"function"===f?n.unique&&s.has(u)||t.push(u):u&&u.length&&"string"!==f&&e(u)})}(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(f>=u&&f--,e>=u&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!(!t||!t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=void 0,this},disabled:function(){return!t},lock:function(){return r=void 0,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return!t||h&&!r||(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return null!=n?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[1^n][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=l.call(arguments),r=u.length,e=1!==r||n&&i.isFunction(n.promise)?r:0,f=1===e?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?l.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);r>t;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});var lt;i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){if(n===!0?!--i.readyWait:!i.isReady){if(!u.body)return setTimeout(i.ready);i.isReady=!0;n!==!0&&--i.readyWait>0||(lt.resolveWith(u,[i]),i.fn.triggerHandler&&(i(u).triggerHandler("ready"),i(u).off("ready")))}}});function ur(){u.addEventListener?(u.removeEventListener("DOMContentLoaded",a,!1),n.removeEventListener("load",a,!1)):(u.detachEvent("onreadystatechange",a),n.detachEvent("onload",a))}function a(){(u.addEventListener||"load"===event.type||"complete"===u.readyState)&&(ur(),i.ready())}i.ready.promise=function(t){if(!lt)if(lt=i.Deferred(),"complete"===u.readyState)setTimeout(i.ready);else if(u.addEventListener)u.addEventListener("DOMContentLoaded",a,!1),n.addEventListener("load",a,!1);else{u.attachEvent("onreadystatechange",a);n.attachEvent("onload",a);var r=!1;try{r=null==n.frameElement&&u.documentElement}catch(e){}r&&r.doScroll&&!function f(){if(!i.isReady){try{r.doScroll("left")}catch(n){return setTimeout(f,50)}ur();i.ready()}}()}return lt.promise(t)};var s="undefined";for(var gf in i(r))break;r.ownLast="0"!==gf;r.inlineBlockNeedsLayout=!1;i(function(){var f,t,n,i;n=u.getElementsByTagName("body")[0];n&&n.style&&(t=u.createElement("div"),i=u.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==s&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",r.inlineBlockNeedsLayout=f=3===t.offsetWidth,f&&(n.style.zoom=1)),n.removeChild(i))}),function(){var n=u.createElement("div");if(null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(t){r.deleteExpando=!1}}n=null}();i.acceptData=function(n){var t=i.noData[(n.nodeName+" ").toLowerCase()],r=+n.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&n.getAttribute("classid")===t};var ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,te=/([A-Z])/g;function fr(n,t,r){if(void 0===r&&1===n.nodeType){var u="data-"+t.replace(te,"-$1").toLowerCase();if(r=n.getAttribute(u),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ne.test(r)?i.parseJSON(r):r}catch(f){}i.data(n,t,r)}else r=void 0}return r}function ri(n){for(var t in n)if(("data"!==t||!i.isEmptyObject(n[t]))&&"toJSON"!==t)return!1;return!0}function er(n,t,r,u){if(i.acceptData(n)){var s,e,h=i.expando,l=n.nodeType,o=l?i.cache:n,f=l?n[h]:n[h]&&h;if(f&&o[f]&&(u||o[f].data)||void 0!==r||"string"!=typeof t)return f||(f=l?n[h]=c.pop()||i.guid++:h),o[f]||(o[f]=l?{}:{toJSON:i.noop}),("object"==typeof t||"function"==typeof t)&&(u?o[f]=i.extend(o[f],t):o[f].data=i.extend(o[f].data,t)),e=o[f],u||(e.data||(e.data={}),e=e.data),void 0!==r&&(e[i.camelCase(t)]=r),"string"==typeof t?(s=e[t],null==s&&(s=e[i.camelCase(t)])):s=e,s}}function or(n,t,u){if(i.acceptData(n)){var o,s,h=n.nodeType,f=h?i.cache:n,e=h?n[i.expando]:i.expando;if(f[e]){if(t&&(o=u?f[e]:f[e].data)){for(i.isArray(t)?t=t.concat(i.map(t,i.camelCase)):(t in o)?t=[t]:(t=i.camelCase(t),t=(t in o)?[t]:t.split(" ")),s=t.length;s--;)delete o[t[s]];if(u?!ri(o):!i.isEmptyObject(o))return}(u||(delete f[e].data,ri(f[e])))&&(h?i.cleanData([n],!0):r.deleteExpando||f!=f.window?delete f[e]:f[e]=null)}}}i.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!ri(n)},data:function(n,t,i){return er(n,t,i)},removeData:function(n,t){return or(n,t)},_data:function(n,t,i){return er(n,t,i,!0)},_removeData:function(n,t){return or(n,t,!0)}});i.fn.extend({data:function(n,t){var f,u,e,r=this[0],o=r&&r.attributes;if(void 0===n){if(this.length&&(e=i.data(r),1===r.nodeType&&!i._data(r,"parsedAttrs"))){for(f=o.length;f--;)o[f]&&(u=o[f].name,0===u.indexOf("data-")&&(u=i.camelCase(u.slice(5)),fr(r,u,e[u])));i._data(r,"parsedAttrs",!0)}return e}return"object"==typeof n?this.each(function(){i.data(this,n)}):arguments.length>1?this.each(function(){i.data(this,n,t)}):r?fr(r,n,i.data(r,n)):void 0},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){var u;if(n)return(t=(t||"fx")+"queue",u=i._data(n,t),r&&(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r)),u||[])},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};"inprogress"===u&&(u=r.shift(),e--);u&&("fx"===t&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var r=t+"queueHooks";return i._data(n,r)||i._data(n,r,{empty:i.Callbacks("once memory").add(function(){i._removeData(n,t+"queue");i._removeData(n,r)})})}});i.fn.extend({queue:function(n,t){var r=2;return"string"!=typeof n&&(t=n,n="fx",r--),arguments.length<r?i.queue(this[0],n):void 0===t?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);"fx"===n&&"inprogress"!==r[0]&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var r,f=1,e=i.Deferred(),u=this,o=this.length,s=function(){--f||e.resolveWith(u,[u])};for("string"!=typeof n&&(t=n,n=void 0),n=n||"fx";o--;)r=i._data(u[o],n+"queueHooks"),r&&r.empty&&(f++,r.empty.add(s));return s(),e.promise(t)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,p=["Top","Right","Bottom","Left"],et=function(n,t){return n=t||n,"none"===i.css(n,"display")||!i.contains(n.ownerDocument,n)},w=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=null==r;if("object"===i.type(r)){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(void 0!==u&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;c>s;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e},ui=/^(?:checkbox|radio)$/i;!function(){var t=u.createElement("input"),n=u.createElement("div"),i=u.createDocumentFragment();if(n.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",r.leadingWhitespace=3===n.firstChild.nodeType,r.tbody=!n.getElementsByTagName("tbody").length,r.htmlSerialize=!!n.getElementsByTagName("link").length,r.html5Clone="<:nav><\/:nav>"!==u.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,i.appendChild(t),r.appendChecked=t.checked,n.innerHTML="<textarea>x<\/textarea>",r.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue,i.appendChild(n),n.innerHTML="<input type='radio' checked='checked' name='t'/>",r.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,r.noCloneEvent=!0,n.attachEvent&&(n.attachEvent("onclick",function(){r.noCloneEvent=!1}),n.cloneNode(!0).click()),null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(f){r.deleteExpando=!1}}}(),function(){var t,i,f=u.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})i="on"+t,(r[t+"Bubbles"]=i in n)||(f.setAttribute(i,"t"),r[t+"Bubbles"]=f.attributes[i].expando===!1);f=null}();var fi=/^(?:input|select|textarea)$/i,ie=/^key/,re=/^(?:mouse|pointer|contextmenu)|click/,sr=/^(?:focusinfocus|focusoutblur)$/,hr=/^([^.]*)(?:\.(.+)|)$/;function vt(){return!0}function it(){return!1}function cr(){try{return u.activeElement}catch(n){}}i.event={global:{},add:function(n,t,r,u,f){var w,y,b,p,o,c,l,a,e,k,d,v=i._data(n);if(v){for(r.handler&&(p=r,r=p.handler,f=p.selector),r.guid||(r.guid=i.guid++),(y=v.events)||(y=v.events={}),(c=v.handle)||(c=v.handle=function(n){if(typeof i!==s&&(!n||i.event.triggered!==n.type))return i.event.dispatch.apply(c.elem,arguments)},c.elem=n),t=(t||"").match(h)||[""],b=t.length;b--;)w=hr.exec(t[b])||[],e=d=w[1],k=(w[2]||"").split(".").sort(),e&&(o=i.event.special[e]||{},e=(f?o.delegateType:o.bindType)||e,o=i.event.special[e]||{},l=i.extend({type:e,origType:d,data:u,handler:r,guid:r.guid,selector:f,needsContext:f&&i.expr.match.needsContext.test(f),namespace:k.join(".")},p),(a=y[e])||(a=y[e]=[],a.delegateCount=0,o.setup&&o.setup.call(n,u,k,c)!==!1||(n.addEventListener?n.addEventListener(e,c,!1):n.attachEvent&&n.attachEvent("on"+e,c))),o.add&&(o.add.call(n,l),l.handler.guid||(l.handler.guid=r.guid)),f?a.splice(a.delegateCount++,0,l):a.push(l),i.event.global[e]=!0);n=null}},remove:function(n,t,r,u,f){var y,o,s,b,p,a,c,l,e,w,k,v=i.hasData(n)&&i._data(n);if(v&&(a=v.events)){for(t=(t||"").match(h)||[""],p=t.length;p--;)if(s=hr.exec(t[p])||[],e=k=s[1],w=(s[2]||"").split(".").sort(),e){for(c=i.event.special[e]||{},e=(u?c.delegateType:c.bindType)||e,l=a[e]||[],s=s[2]&&new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"),b=y=l.length;y--;)o=l[y],!f&&k!==o.origType||r&&r.guid!==o.guid||s&&!s.test(o.namespace)||u&&u!==o.selector&&("**"!==u||!o.selector)||(l.splice(y,1),o.selector&&l.delegateCount--,c.remove&&c.remove.call(n,o));b&&!l.length&&(c.teardown&&c.teardown.call(n,w,v.handle)!==!1||i.removeEvent(n,e,v.handle),delete a[e])}else for(e in a)i.event.remove(n,e+t[p],r,u,!0);i.isEmptyObject(a)&&(delete v.handle,i._removeData(n,"events"))}},trigger:function(t,r,f,e){var l,a,o,p,c,h,w,y=[f||u],s=nt.call(t,"type")?t.type:t,v=nt.call(t,"namespace")?t.namespace.split("."):[];if(o=h=f=f||u,3!==f.nodeType&&8!==f.nodeType&&!sr.test(s+i.event.triggered)&&(s.indexOf(".")>=0&&(v=s.split("."),s=v.shift(),v.sort()),a=s.indexOf(":")<0&&"on"+s,t=t[i.expando]?t:new i.Event(s,"object"==typeof t&&t),t.isTrigger=e?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=f),r=null==r?[t]:i.makeArray(r,[t]),c=i.event.special[s]||{},e||!c.trigger||c.trigger.apply(f,r)!==!1)){if(!e&&!c.noBubble&&!i.isWindow(f)){for(p=c.delegateType||s,sr.test(p+s)||(o=o.parentNode);o;o=o.parentNode)y.push(o),h=o;h===(f.ownerDocument||u)&&y.push(h.defaultView||h.parentWindow||n)}for(w=0;(o=y[w++])&&!t.isPropagationStopped();)t.type=w>1?p:c.bindType||s,l=(i._data(o,"events")||{})[t.type]&&i._data(o,"handle"),l&&l.apply(o,r),l=a&&o[a],l&&l.apply&&i.acceptData(o)&&(t.result=l.apply(o,r),t.result===!1&&t.preventDefault());if(t.type=s,!e&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(y.pop(),r)===!1)&&i.acceptData(f)&&a&&f[s]&&!i.isWindow(f)){h=f[a];h&&(f[a]=null);i.event.triggered=s;try{f[s]()}catch(b){}i.event.triggered=void 0;h&&(f[a]=h)}return t.result}},dispatch:function(n){n=i.event.fix(n);var e,f,t,r,o,s=[],h=l.call(arguments),c=(i._data(this,"events")||{})[n.type]||[],u=i.event.special[n.type]||{};if(h[0]=n,n.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,n)!==!1){for(s=i.event.handlers.call(this,n,c),e=0;(r=s[e++])&&!n.isPropagationStopped();)for(n.currentTarget=r.elem,o=0;(t=r.handlers[o++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,f=((i.event.special[t.origType]||{}).handle||t.handler).apply(r.elem,h),void 0!==f&&(n.result=f)===!1&&(n.preventDefault(),n.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,n),n.result}},handlers:function(n,t){var f,e,u,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||"click"!==n.type))for(;r!=this;r=r.parentNode||this)if(1===r.nodeType&&(r.disabled!==!0||"click"!==n.type)){for(u=[],o=0;s>o;o++)e=t[o],f=e.selector+" ",void 0===u[f]&&(u[f]=e.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(e);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},fix:function(n){if(n[i.expando])return n;var e,o,s,r=n.type,f=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=re.test(r)?this.mouseHooks:ie.test(r)?this.keyHooks:{}),s=t.props?this.props.concat(t.props):this.props,n=new i.Event(f),e=s.length;e--;)o=s[e],n[o]=f[o];return n.target||(n.target=f.srcElement||u),3===n.target.nodeType&&(n.target=n.target.parentNode),n.metaKey=!!n.metaKey,t.filter?t.filter(n,f):n},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return null==n.which&&(n.which=null!=t.charCode?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var i,e,r,f=t.button,o=t.fromElement;return null==n.pageX&&null!=t.clientX&&(e=n.target.ownerDocument||u,r=e.documentElement,i=e.body,n.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),n.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),!n.relatedTarget&&o&&(n.relatedTarget=o===n.target?t.toElement:o),n.which||void 0===f||(n.which=1&f?1:2&f?3:4&f?2:0),n}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cr()&&this.focus)try{return this.focus(),!1}catch(n){}},delegateType:"focusin"},blur:{trigger:function(){if(this===cr()&&this.blur)return(this.blur(),!1)},delegateType:"focusout"},click:{trigger:function(){if(i.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return(this.click(),!1)},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){void 0!==n.result&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=u.removeEventListener?function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}:function(n,t,i){var r="on"+t;n.detachEvent&&(typeof n[r]===s&&(n[r]=null),n.detachEvent(r,i))};i.Event=function(n,t){return this instanceof i.Event?(n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||void 0===n.defaultPrevented&&n.returnValue===!1?vt:it):this.type=n,t&&i.extend(this,t),this.timeStamp=n&&n.timeStamp||i.now(),void(this[i.expando]=!0)):new i.Event(n,t)};i.Event.prototype={isDefaultPrevented:it,isPropagationStopped:it,isImmediatePropagationStopped:it,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=vt;n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=vt;n&&(n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0)},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=vt;n&&n.stopImmediatePropagation&&n.stopImmediatePropagation();this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return(!r||r!==f&&!i.contains(f,r))&&(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});r.submitBubbles||(i.event.special.submit={setup:function(){return i.nodeName(this,"form")?!1:void i.event.add(this,"click._submit keypress._submit",function(n){var r=n.target,t=i.nodeName(r,"input")||i.nodeName(r,"button")?r.form:void 0;t&&!i._data(t,"submitBubbles")&&(i.event.add(t,"submit._submit",function(n){n._submit_bubble=!0}),i._data(t,"submitBubbles",!0))})},postDispatch:function(n){n._submit_bubble&&(delete n._submit_bubble,this.parentNode&&!n.isTrigger&&i.event.simulate("submit",this.parentNode,n,!0))},teardown:function(){return i.nodeName(this,"form")?!1:void i.event.remove(this,"._submit")}});r.changeBubbles||(i.event.special.change={setup:function(){return fi.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(i.event.add(this,"propertychange._change",function(n){"checked"===n.originalEvent.propertyName&&(this._just_changed=!0)}),i.event.add(this,"click._change",function(n){this._just_changed&&!n.isTrigger&&(this._just_changed=!1);i.event.simulate("change",this,n,!0)})),!1):void i.event.add(this,"beforeactivate._change",function(n){var t=n.target;fi.test(t.nodeName)&&!i._data(t,"changeBubbles")&&(i.event.add(t,"change._change",function(n){!this.parentNode||n.isSimulated||n.isTrigger||i.event.simulate("change",this.parentNode,n,!0)}),i._data(t,"changeBubbles",!0))})},handle:function(n){var t=n.target;if(this!==t||n.isSimulated||n.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return n.handleObj.handler.apply(this,arguments)},teardown:function(){return i.event.remove(this,"._change"),!fi.test(this.nodeName)}});r.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var r=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var u=this.ownerDocument||this,f=i._data(u,t);f||u.addEventListener(n,r,!0);i._data(u,t,(f||0)+1)},teardown:function(){var u=this.ownerDocument||this,f=i._data(u,t)-1;f?i._data(u,t,f):(u.removeEventListener(n,r,!0),i._removeData(u,t))}}});i.fn.extend({on:function(n,t,r,u,f){var o,e;if("object"==typeof n){"string"!=typeof t&&(r=r||t,t=void 0);for(o in n)this.on(o,t,r,n[o],f);return this}if(null==r&&null==u?(u=t,r=t=void 0):null==u&&("string"==typeof t?(u=r,r=void 0):(u=r,r=t,t=void 0)),u===!1)u=it;else if(!u)return this;return 1===f&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if("object"==typeof n){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=it),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});function lr(n){var i=ar.split("|"),t=n.createDocumentFragment();if(t.createElement)while(i.length)t.createElement(i.pop());return t}var ar="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ue=/ jQuery\d+="(?:null|\d+)"/g,vr=new RegExp("<(?:"+ar+")[\\s/>]","i"),ei=/^\s+/,yr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,pr=/<([\w:]+)/,wr=/<tbody/i,fe=/<|&#?\w+;/,ee=/<(?:script|style|link)/i,oe=/checked\s*(?:[^=]|=\s*.checked.)/i,br=/^$|\/(?:java|ecma)script/i,se=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,o={option:[1,"<select multiple='multiple'>","<\/select>"],legend:[1,"<fieldset>","<\/fieldset>"],area:[1,"<map>","<\/map>"],param:[1,"<object>","<\/object>"],thead:[1,"<table>","<\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],col:[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:r.htmlSerialize?[0,"",""]:[1,"X<div>","<\/div>"]},ce=lr(u),oi=ce.appendChild(u.createElement("div"));o.optgroup=o.option;o.tbody=o.tfoot=o.colgroup=o.caption=o.thead;o.th=o.td;function f(n,t){var e,u,o=0,r=typeof n.getElementsByTagName!==s?n.getElementsByTagName(t||"*"):typeof n.querySelectorAll!==s?n.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],e=n.childNodes||n;null!=(u=e[o]);o++)!t||i.nodeName(u,t)?r.push(u):i.merge(r,f(u,t));return void 0===t||t&&i.nodeName(n,t)?i.merge([n],r):r}function le(n){ui.test(n.type)&&(n.defaultChecked=n.checked)}function kr(n,t){return i.nodeName(n,"table")&&i.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function dr(n){return n.type=(null!==i.find.attr(n,"type"))+"/"+n.type,n}function gr(n){var t=se.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function si(n,t){for(var u,r=0;null!=(u=n[r]);r++)i._data(u,"globalEval",!t||i._data(t[r],"globalEval"))}function nu(n,t){if(1===t.nodeType&&i.hasData(n)){var u,f,o,s=i._data(n),r=i._data(t,s),e=s.events;if(e){delete r.handle;r.events={};for(u in e)for(f=0,o=e[u].length;o>f;f++)i.event.add(t,u,e[u][f])}r.data&&(r.data=i.extend({},r.data))}}function ae(n,t){var u,e,f;if(1===t.nodeType){if(u=t.nodeName.toLowerCase(),!r.noCloneEvent&&t[i.expando]){f=i._data(t);for(e in f.events)i.removeEvent(t,e,f.handle);t.removeAttribute(i.expando)}"script"===u&&t.text!==n.text?(dr(t).text=n.text,gr(t)):"object"===u?(t.parentNode&&(t.outerHTML=n.outerHTML),r.html5Clone&&n.innerHTML&&!i.trim(t.innerHTML)&&(t.innerHTML=n.innerHTML)):"input"===u&&ui.test(n.type)?(t.defaultChecked=t.checked=n.checked,t.value!==n.value&&(t.value=n.value)):"option"===u?t.defaultSelected=t.selected=n.defaultSelected:("input"===u||"textarea"===u)&&(t.defaultValue=n.defaultValue)}}i.extend({clone:function(n,t,u){var e,c,s,o,h,l=i.contains(n.ownerDocument,n);if(r.html5Clone||i.isXMLDoc(n)||!vr.test("<"+n.nodeName+">")?s=n.cloneNode(!0):(oi.innerHTML=n.outerHTML,oi.removeChild(s=oi.firstChild)),!(r.noCloneEvent&&r.noCloneChecked||1!==n.nodeType&&11!==n.nodeType||i.isXMLDoc(n)))for(e=f(s),h=f(n),o=0;null!=(c=h[o]);++o)e[o]&&ae(c,e[o]);if(t)if(u)for(h=h||f(n),e=e||f(s),o=0;null!=(c=h[o]);o++)nu(c,e[o]);else nu(n,s);return e=f(s,"script"),e.length>0&&si(e,!l&&f(n,"script")),e=h=c=null,s},buildFragment:function(n,t,u,e){for(var c,s,b,h,p,w,a,k=n.length,v=lr(t),l=[],y=0;k>y;y++)if(s=n[y],s||0===s)if("object"===i.type(s))i.merge(l,s.nodeType?[s]:s);else if(fe.test(s)){for(h=h||v.appendChild(t.createElement("div")),p=(pr.exec(s)||["",""])[1].toLowerCase(),a=o[p]||o._default,h.innerHTML=a[1]+s.replace(yr,"<$1><\/$2>")+a[2],c=a[0];c--;)h=h.lastChild;if(!r.leadingWhitespace&&ei.test(s)&&l.push(t.createTextNode(ei.exec(s)[0])),!r.tbody)for(s="table"!==p||wr.test(s)?"<table>"!==a[1]||wr.test(s)?0:h:h.firstChild,c=s&&s.childNodes.length;c--;)i.nodeName(w=s.childNodes[c],"tbody")&&!w.childNodes.length&&s.removeChild(w);for(i.merge(l,h.childNodes),h.textContent="";h.firstChild;)h.removeChild(h.firstChild);h=v.lastChild}else l.push(t.createTextNode(s));for(h&&v.removeChild(h),r.appendChecked||i.grep(f(l,"input"),le),y=0;s=l[y++];)if((!e||-1===i.inArray(s,e))&&(b=i.contains(s.ownerDocument,s),h=f(v.appendChild(s),"script"),b&&si(h),u))for(c=0;s=h[c++];)br.test(s.type||"")&&u.push(s);return h=null,v},cleanData:function(n,t){for(var u,e,f,o,a=0,h=i.expando,l=i.cache,v=r.deleteExpando,y=i.event.special;null!=(u=n[a]);a++)if((t||i.acceptData(u))&&(f=u[h],o=f&&l[f])){if(o.events)for(e in o.events)y[e]?i.event.remove(u,e):i.removeEvent(u,e,o.handle);l[f]&&(delete l[f],v?delete u[h]:typeof u.removeAttribute!==s?u.removeAttribute(h):u[h]=null,c.push(f))}}});i.fn.extend({text:function(n){return w(this,function(n){return void 0===n?i.text(this):this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(n))},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=kr(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=kr(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,e=n?i.filter(n,this):this,u=0;null!=(r=e[u]);u++)t||1!==r.nodeType||i.cleanData(f(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&si(f(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;null!=(n=this[t]);t++){for(1===n.nodeType&&i.cleanData(f(n,!1));n.firstChild;)n.removeChild(n.firstChild);n.options&&i.nodeName(n,"select")&&(n.options.length=0)}return this},clone:function(n,t){return n=null==n?!1:n,t=null==t?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return w(this,function(n){var t=this[0]||{},u=0,e=this.length;if(void 0===n)return 1===t.nodeType?t.innerHTML.replace(ue,""):void 0;if(!("string"!=typeof n||ee.test(n)||!r.htmlSerialize&&vr.test(n)||!r.leadingWhitespace&&ei.test(n)||o[(pr.exec(n)||["",""])[1].toLowerCase()])){n=n.replace(yr,"<$1><\/$2>");try{for(;e>u;u++)t=this[u]||{},1===t.nodeType&&(i.cleanData(f(t,!1)),t.innerHTML=n);t=0}catch(s){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(f(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=ki.apply([],n);var h,u,c,o,v,s,e=0,l=this.length,p=this,w=l-1,a=n[0],y=i.isFunction(a);if(y||l>1&&"string"==typeof a&&!r.checkClone&&oe.test(a))return this.each(function(i){var r=p.eq(i);y&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(s=i.buildFragment(n,this[0].ownerDocument,!1,this),h=s.firstChild,1===s.childNodes.length&&(s=h),h)){for(o=i.map(f(s,"script"),dr),c=o.length;l>e;e++)u=s,e!==w&&(u=i.clone(u,!0,!0),c&&i.merge(o,f(u,"script"))),t.call(this[e],u,e);if(c)for(v=o[o.length-1].ownerDocument,i.map(o,gr),e=0;c>e;e++)u=o[e],br.test(u.type||"")&&!i._data(u,"globalEval")&&i.contains(v,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval((u.text||u.textContent||u.innerHTML||"").replace(he,"")));s=h=null}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,r=0,f=[],e=i(n),o=e.length-1;o>=r;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ni.apply(f,u.get());return this.pushStack(f)}});var ot,tu={};function iu(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function yt(n){var r=u,t=tu[n];return t||(t=iu(n,r),"none"!==t&&t||(ot=(ot||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=(ot[0].contentWindow||ot[0].contentDocument).document,r.write(),r.close(),t=iu(n,r),ot.detach()),tu[n]=t),t}!function(){var n;r.shrinkWrapBlocks=function(){if(null!=n)return n;n=!1;var t,i,r;return i=u.getElementsByTagName("body")[0],i&&i.style?(t=u.createElement("div"),r=u.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(r).appendChild(t),typeof t.style.zoom!==s&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(u.createElement("div")).style.width="5px",n=3!==t.offsetWidth),i.removeChild(r),n):void 0}}();var ru=/^margin/,pt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),b,k,ve=/^(top|right|bottom|left)$/;n.getComputedStyle?(b=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)},k=function(n,t,r){var e,o,s,u,f=n.style;return r=r||b(n),u=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==u||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),pt.test(u)&&ru.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),void 0===u?u:u+""}):u.documentElement.currentStyle&&(b=function(n){return n.currentStyle},k=function(n,t,i){var o,f,e,r,u=n.style;return i=i||b(n),r=i?i[t]:void 0,null==r&&u&&u[t]&&(r=u[t]),pt.test(r)&&!ve.test(t)&&(o=u.left,f=n.runtimeStyle,e=f&&f.left,e&&(f.left=n.currentStyle.left),u.left="fontSize"===t?"1em":r,r=u.pixelLeft+"px",u.left=o,e&&(f.left=e)),void 0===r?r:r+""||"auto"});function uu(n,t){return{get:function(){var i=n();if(null!=i)return i?void delete this.get:(this.get=t).apply(this,arguments)}}}!function(){var f,t,l,o,s,e,h;if(f=u.createElement("div"),f.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",l=f.getElementsByTagName("a")[0],t=l&&l.style){t.cssText="float:left;opacity:.5";r.opacity="0.5"===t.opacity;r.cssFloat=!!t.cssFloat;f.style.backgroundClip="content-box";f.cloneNode(!0).style.backgroundClip="";r.clearCloneStyle="content-box"===f.style.backgroundClip;r.boxSizing=""===t.boxSizing||""===t.MozBoxSizing||""===t.WebkitBoxSizing;i.extend(r,{reliableHiddenOffsets:function(){return null==e&&c(),e},boxSizingReliable:function(){return null==s&&c(),s},pixelPosition:function(){return null==o&&c(),o},reliableMarginRight:function(){return null==h&&c(),h}});function c(){var i,r,f,t;r=u.getElementsByTagName("body")[0];r&&r.style&&(i=u.createElement("div"),f=u.createElement("div"),f.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(f).appendChild(i),i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,h=!0,n.getComputedStyle&&(o="1%"!==(n.getComputedStyle(i,null)||{}).top,s="4px"===(n.getComputedStyle(i,null)||{width:"4px"}).width,t=i.appendChild(u.createElement("div")),t.style.cssText=i.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",i.style.width="1px",h=!parseFloat((n.getComputedStyle(t,null)||{}).marginRight)),i.innerHTML="<table><tr><td><\/td><td>t<\/td><\/tr><\/table>",t=i.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",e=0===t[0].offsetHeight,e&&(t[0].style.display="",t[1].style.display="none",e=0===t[0].offsetHeight),r.removeChild(f))}}}();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var hi=/alpha\([^)]*\)/i,ye=/opacity\s*=\s*([^)]*)/,pe=/^(none|table(?!-c[ea]).+)/,we=new RegExp("^("+at+")(.*)$","i"),be=new RegExp("^([+-])=("+at+")","i"),ke={position:"absolute",visibility:"hidden",display:"block"},fu={letterSpacing:"0",fontWeight:"400"},eu=["Webkit","O","Moz","ms"];function ou(n,t){if(t in n)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),u=t,i=eu.length;i--;)if(t=eu[i]+r,t in n)return t;return u}function su(n,t){for(var f,r,o,e=[],u=0,s=n.length;s>u;u++)r=n[u],r.style&&(e[u]=i._data(r,"olddisplay"),f=r.style.display,t?(e[u]||"none"!==f||(r.style.display=""),""===r.style.display&&et(r)&&(e[u]=i._data(r,"olddisplay",yt(r.nodeName)))):(o=et(r),(f&&"none"!==f||!o)&&i._data(r,"olddisplay",o?f:i.css(r,"display"))));for(u=0;s>u;u++)r=n[u],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?e[u]||"":"none"));return n}function hu(n,t,i){var r=we.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function cu(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:"width"===t?1:0,o=0;4>e;e+=2)"margin"===r&&(o+=i.css(n,r+p[e],!0,f)),u?("content"===r&&(o-=i.css(n,"padding"+p[e],!0,f)),"margin"!==r&&(o-=i.css(n,"border"+p[e]+"Width",!0,f))):(o+=i.css(n,"padding"+p[e],!0,f),"padding"!==r&&(o+=i.css(n,"border"+p[e]+"Width",!0,f)));return o}function lu(n,t,u){var o=!0,f="width"===t?n.offsetWidth:n.offsetHeight,e=b(n),s=r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e);if(0>=f||null==f){if(f=k(n,t,e),(0>f||null==f)&&(f=n.style[t]),pt.test(f))return f;o=s&&(r.boxSizingReliable()||f===n.style[t]);f=parseFloat(f)||0}return f+cu(n,t,u||(s?"border":"content"),o,e)+"px"}i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=k(n,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:r.cssFloat?"cssFloat":"styleFloat"},style:function(n,t,u,f){if(n&&3!==n.nodeType&&8!==n.nodeType&&n.style){var o,h,e,s=i.camelCase(t),c=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=ou(c,s)),e=i.cssHooks[t]||i.cssHooks[s],void 0===u)return e&&"get"in e&&void 0!==(o=e.get(n,!1,f))?o:c[t];if(h=typeof u,"string"===h&&(o=be.exec(u))&&(u=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),h="number"),null!=u&&u===u&&("number"!==h||i.cssNumber[s]||(u+="px"),r.clearCloneStyle||""!==u||0!==t.indexOf("background")||(c[t]="inherit"),!(e&&"set"in e&&void 0===(u=e.set(n,u,f)))))try{c[t]=u}catch(l){}}},css:function(n,t,r,u){var s,f,e,o=i.camelCase(t);return t=i.cssProps[o]||(i.cssProps[o]=ou(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),void 0===f&&(f=k(n,t,u)),"normal"===f&&t in fu&&(f=fu[t]),""===r||r?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return pe.test(i.css(n,"display"))&&0===n.offsetWidth?i.swap(n,ke,function(){return lu(n,t,u)}):lu(n,t,u)},set:function(n,u,f){var e=f&&b(n);return hu(n,u,f?cu(n,t,f,r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e),e):0)}}});r.opacity||(i.cssHooks.opacity={get:function(n,t){return ye.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+100*t+")":"",f=u&&u.filter||r.filter||"";r.zoom=1;(t>=1||""===t)&&""===i.trim(f.replace(hi,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||u&&!u.filter)||(r.filter=hi.test(f)?f.replace(hi,e):f+" "+e)}});i.cssHooks.marginRight=uu(r.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},k,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u="string"==typeof i?i.split(" "):[i];4>r;r++)f[n+p[r]+t]=u[r]||u[r-2]||u[0];return f}};ru.test(n)||(i.cssHooks[n+t].set=hu)});i.fn.extend({css:function(n,t){return w(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=b(n),e=t.length;e>u;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return void 0!==r?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return su(this,!0)},hide:function(){return su(this)},toggle:function(n){return"boolean"==typeof n?n?this.show():this.hide():this.each(function(){et(this)?i(this).show():i(this).hide()})}});function e(n,t,i,r,u){return new e.prototype.init(n,t,i,r,u)}i.Tween=e;e.prototype={constructor:e,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=e.propHooks[this.prop];return n&&n.get?n.get(this):e.propHooks._default.get(this)},run:function(n){var r,t=e.propHooks[this.prop];return this.pos=r=this.options.duration?i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):n,this.now=(this.end-this.start)*r+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):e.propHooks._default.set(this),this}};e.prototype.init.prototype=e.prototype;e.propHooks={_default:{get:function(n){var t;return null==n.elem[n.prop]||n.elem.style&&null!=n.elem.style[n.prop]?(t=i.css(n.elem,n.prop,""),t&&"auto"!==t?t:0):n.elem[n.prop]},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(null!=n.elem.style[i.cssProps[n.prop]]||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};e.propHooks.scrollTop=e.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=e.prototype.init;i.fx.step={};var rt,wt,de=/^(?:toggle|show|hide)$/,au=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),ge=/queueHooks$/,bt=[no],st={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),r=au.exec(t),e=r&&r[3]||(i.cssNumber[n]?"":"px"),u=(i.cssNumber[n]||"px"!==e&&+s)&&au.exec(i.css(f.elem,n)),o=1,h=20;if(u&&u[3]!==e){e=e||u[3];r=r||[];u=+s||1;do o=o||".5",u/=o,i.style(f.elem,n,u+e);while(o!==(o=f.cur()/s)&&1!==o&&--h)}return r&&(u=f.start=+u||+s||0,f.unit=e,f.end=r[1]?u+(r[1]+1)*r[2]:+r[2]),f}]};function vu(){return setTimeout(function(){rt=void 0}),rt=i.now()}function kt(n,t){var r,i={height:n},u=0;for(t=t?1:0;4>u;u+=2-t)r=p[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function yu(n,t,i){for(var u,f=(st[t]||[]).concat(st["*"]),r=0,e=f.length;e>r;r++)if(u=f[r].call(i,t,n))return u}function no(n,t,u){var f,a,p,v,s,w,h,b,l=this,y={},o=n.style,c=n.nodeType&&et(n),e=i._data(n,"fxshow");u.queue||(s=i._queueHooks(n,"fx"),null==s.unqueued&&(s.unqueued=0,w=s.empty.fire,s.empty.fire=function(){s.unqueued||w()}),s.unqueued++,l.always(function(){l.always(function(){s.unqueued--;i.queue(n,"fx").length||s.empty.fire()})}));1===n.nodeType&&("height"in t||"width"in t)&&(u.overflow=[o.overflow,o.overflowX,o.overflowY],h=i.css(n,"display"),b="none"===h?i._data(n,"olddisplay")||yt(n.nodeName):h,"inline"===b&&"none"===i.css(n,"float")&&(r.inlineBlockNeedsLayout&&"inline"!==yt(n.nodeName)?o.zoom=1:o.display="inline-block"));u.overflow&&(o.overflow="hidden",r.shrinkWrapBlocks()||l.always(function(){o.overflow=u.overflow[0];o.overflowX=u.overflow[1];o.overflowY=u.overflow[2]}));for(f in t)if(a=t[f],de.exec(a)){if(delete t[f],p=p||"toggle"===a,a===(c?"hide":"show")){if("show"!==a||!e||void 0===e[f])continue;c=!0}y[f]=e&&e[f]||i.style(n,f)}else h=void 0;if(i.isEmptyObject(y))"inline"===("none"===h?yt(n.nodeName):h)&&(o.display=h);else{e?"hidden"in e&&(c=e.hidden):e=i._data(n,"fxshow",{});p&&(e.hidden=!c);c?i(n).show():l.done(function(){i(n).hide()});l.done(function(){var t;i._removeData(n,"fxshow");for(t in y)i.style(n,t,y[t])});for(f in y)v=yu(c?e[f]:0,f,l),f in e||(e[f]=v.start,c&&(v.end=v.start,v.start="width"===f||"height"===f?1:0))}}function to(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function pu(n,t,r){var h,e,o=0,l=bt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(e)return!1;for(var s=rt||vu(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,o=u.tweens.length;o>r;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),1>i&&o?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:rt||vu(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(e)return this;for(e=!0;r>i;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),s=u.props;for(to(s,u.opts.specialEasing);l>o;o++)if(h=bt[o].call(u,n,s,u.opts))return h;return i.map(s,yu,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}i.Animation=i.extend(pu,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;f>u;u++)r=n[u],st[r]=st[r]||[],st[r].unshift(t)},prefilter:function(n,t){t?bt.unshift(n):bt.push(n)}});i.speed=function(n,t,r){var u=n&&"object"==typeof n?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:"number"==typeof u.duration?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(null==u.queue||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(et).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,r,u){var o=i.isEmptyObject(n),e=i.speed(t,r,u),f=function(){var t=pu(this,i.extend({},n),e);(o||i._data(this,"finish"))&&t.stop(!0)};return f.finish=f,o||e.queue===!1?this.each(f):this.queue(e.queue,f)},stop:function(n,t,r){var u=function(n){var t=n.stop;delete n.stop;t(r)};return"string"!=typeof n&&(r=t,t=n,n=void 0),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var o=!0,t=null!=n&&n+"queueHooks",e=i.timers,f=i._data(this);if(t)f[t]&&f[t].stop&&u(f[t]);else for(t in f)f[t]&&f[t].stop&&ge.test(t)&&u(f[t]);for(t=e.length;t--;)e[t].elem!==this||null!=n&&e[t].queue!==n||(e[t].anim.stop(r),o=!1,e.splice(t,1));(o||!r)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,f=i._data(this),r=f[n+"queue"],e=f[n+"queueHooks"],u=i.timers,o=r?r.length:0;for(f.finish=!0,i.queue(this,n,[]),e&&e.stop&&e.stop.call(this,!0),t=u.length;t--;)u[t].elem===this&&u[t].queue===n&&(u[t].anim.stop(!0),u.splice(t,1));for(t=0;o>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete f.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(kt(t,!0),n,i,u)}});i.each({slideDown:kt("show"),slideUp:kt("hide"),slideToggle:kt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=i.timers,t=0;for(rt=i.now();t<n.length;t++)r=n[t],r()||n[t]!==r||n.splice(t--,1);n.length||i.fx.stop();rt=void 0};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){wt||(wt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(wt);wt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var n,t,f,i,e;t=u.createElement("div");t.setAttribute("className","t");t.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";i=t.getElementsByTagName("a")[0];f=u.createElement("select");e=f.appendChild(u.createElement("option"));n=t.getElementsByTagName("input")[0];i.style.cssText="top:1px";r.getSetAttribute="t"!==t.className;r.style=/top/.test(i.getAttribute("style"));r.hrefNormalized="/a"===i.getAttribute("href");r.checkOn=!!n.value;r.optSelected=e.selected;r.enctype=!!u.createElement("form").enctype;f.disabled=!0;r.optDisabled=!e.disabled;n=u.createElement("input");n.setAttribute("value","");r.input=""===n.getAttribute("value");n.value="t";n.setAttribute("type","radio");r.radioValue="t"===n.value}();var io=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;1===this.nodeType&&(u=f?n.call(this,r,i(this).val()):n,null==u?u="":"number"==typeof u?u+="":i.isArray(u)&&(u=i.map(u,function(n){return null==n?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,u,"value")||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(u,"value"))?r:(r=u.value,"string"==typeof r?r.replace(io,""):null==r?"":r)):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return null!=t?t:i.trim(i.text(n))}},select:{get:function(n){for(var o,t,s=n.options,u=n.selectedIndex,f="select-one"===n.type||0>u,h=f?null:[],c=f?u+1:s.length,e=0>u?c:f?u:0;c>e;e++)if(t=s[e],!(!t.selected&&e!==u||(r.optDisabled?t.disabled:null!==t.getAttribute("disabled"))||t.parentNode.disabled&&i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),f)return o;h.push(o)}return h},set:function(n,t){for(var f,r,u=n.options,o=i.makeArray(t),e=u.length;e--;)if(r=u[e],i.inArray(i.valHooks.option.get(r),o)>=0)try{r.selected=f=!0}catch(s){r.scrollHeight}else r.selected=!1;return f||(n.selectedIndex=-1),u}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};r.checkOn||(i.valHooks[this].get=function(n){return null===n.getAttribute("value")?"on":n.value})});var ut,wu,v=i.expr.attrHandle,ci=/^(?:checked|selected)$/i,d=r.getSetAttribute,dt=r.input;i.fn.extend({attr:function(n,t){return w(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return typeof n.getAttribute===s?i.prop(n,t,r):(1===e&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?wu:ut)),void 0===r?u&&"get"in u&&null!==(f=u.get(n,t))?f:(f=i.find.attr(n,t),null==f?void 0:f):null!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:(n.setAttribute(t,r+""),r):void i.removeAttr(n,t))},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(h);if(f&&1===n.nodeType)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)?dt&&d||!ci.test(r)?n[u]=!1:n[i.camelCase("default-"+r)]=n[u]=!1:i.attr(n,r,""),n.removeAttribute(d?r:u)},attrHooks:{type:{set:function(n,t){if(!r.radioValue&&"radio"===t&&i.nodeName(n,"input")){var u=n.value;return n.setAttribute("type",t),u&&(n.value=u),t}}}}});wu={set:function(n,t,r){return t===!1?i.removeAttr(n,r):dt&&d||!ci.test(r)?n.setAttribute(!d&&i.propFix[r]||r,r):n[i.camelCase("default-"+r)]=n[r]=!0,r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=v[t]||i.find.attr;v[t]=dt&&d||!ci.test(t)?function(n,t,i){var u,f;return i||(f=v[t],v[t]=u,u=null!=r(n,t,i)?t.toLowerCase():null,v[t]=f),u}:function(n,t,r){if(!r)return n[i.camelCase("default-"+t)]?t.toLowerCase():null}});dt&&d||(i.attrHooks.value={set:function(n,t,r){return i.nodeName(n,"input")?void(n.defaultValue=t):ut&&ut.set(n,t,r)}});d||(ut={set:function(n,t,i){var r=n.getAttributeNode(i);return r||n.setAttributeNode(r=n.ownerDocument.createAttribute(i)),r.value=t+="","value"===i||t===n.getAttribute(i)?t:void 0}},v.id=v.name=v.coords=function(n,t,i){var r;if(!i)return(r=n.getAttributeNode(t))&&""!==r.value?r.value:null},i.valHooks.button={get:function(n,t){var i=n.getAttributeNode(t);if(i&&i.specified)return i.value},set:ut.set},i.attrHooks.contenteditable={set:function(n,t,i){ut.set(n,""===t?!1:t,i)}},i.each(["width","height"],function(n,t){i.attrHooks[t]={set:function(n,i){if(""===i)return(n.setAttribute(t,"auto"),i)}}}));r.style||(i.attrHooks.style={get:function(n){return n.style.cssText||void 0},set:function(n,t){return n.style.cssText=t+""}});var ro=/^(?:input|select|textarea|button|object)$/i,uo=/^(?:a|area)$/i;i.fn.extend({prop:function(n,t){return w(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return n=i.propFix[n]||n,this.each(function(){try{this[n]=void 0;delete this[n]}catch(t){}})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return o=1!==e||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),void 0!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:n[t]=r:u&&"get"in u&&null!==(f=u.get(n,t))?f:n[t]},propHooks:{tabIndex:{get:function(n){var t=i.find.attr(n,"tabindex");return t?parseInt(t,10):ro.test(n.nodeName)||uo.test(n.nodeName)&&n.href?0:-1}}}});r.hrefNormalized||i.each(["href","src"],function(n,t){i.propHooks[t]={get:function(n){return n.getAttribute(t,4)}}});r.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});r.enctype||(i.propFix.enctype="encoding");var li=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l="string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(li," "):" ")){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l=0===arguments.length||"string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(li," "):"")){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var r=typeof n;return"boolean"==typeof t&&"string"===r?t?this.addClass(n):this.removeClass(n):this.each(i.isFunction(n)?function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,f=0,u=i(this),e=n.match(h)||[];t=e[f++];)u.hasClass(t)?u.removeClass(t):u.addClass(t);else(r===s||"boolean"===r)&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;r>t;t++)if(1===this[t].nodeType&&(" "+this[t].className+" ").replace(li," ").indexOf(i)>=0)return!0;return!1}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return 1===arguments.length?this.off(n,"**"):this.off(t,n||"**",i)}});var ai=i.now(),vi=/\?/,fo=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;i.parseJSON=function(t){if(n.JSON&&n.JSON.parse)return n.JSON.parse(t+"");var f,r=null,u=i.trim(t+"");return u&&!i.trim(u.replace(fo,function(n,t,i,u){return f&&t&&(r=0),0===r?n:(f=i||t,r+=!u-!i,"")}))?Function("return "+u)():i.error("Invalid JSON: "+t)};i.parseXML=function(t){var r,u;if(!t||"string"!=typeof t)return null;try{n.DOMParser?(u=new DOMParser,r=u.parseFromString(t,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(t))}catch(f){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||i.error("Invalid XML: "+t),r};var g,y,eo=/#.*$/,bu=/([?&])_=[^&]*/,oo=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,so=/^(?:GET|HEAD)$/,ho=/^\/\//,ku=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,du={},yi={},gu="*/".concat("*");try{y=location.href}catch(ns){y=u.createElement("a");y.href="";y=y.href}g=ku.exec(y.toLowerCase())||[];function nf(n){return function(t,r){"string"!=typeof t&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(h)||[];if(i.isFunction(r))while(u=e[f++])"+"===u.charAt(0)?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function tf(n,t,r,u){var f={},o=n===yi;function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);return"string"!=typeof s||o||f[s]?o?!(h=s):void 0:(t.dataTypes.unshift(s),e(s),!1)}),h}return e(t.dataTypes[0])||!f["*"]&&e("*")}function pi(n,t){var u,r,f=i.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function co(n,t,i){for(var o,e,u,f,s=n.contents,r=n.dataTypes;"*"===r[0];)r.shift(),void 0===e&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(f in s)if(s[f]&&s[f].test(e)){r.unshift(f);break}if(r[0]in i)u=r[0];else{for(f in i){if(!r[0]||n.converters[f+" "+r[0]]){u=f;break}o||(o=f)}u=u||o}if(u)return(u!==r[0]&&r.unshift(u),i[u])}function lo(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift())if("*"===u)u=e;else if("*"!==e&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]])){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:y,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(g[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":gu,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?pi(pi(n,i.ajaxSettings),t):pi(i.ajaxSettings,n)},ajaxPrefilter:nf(du),ajaxTransport:nf(yi),ajax:function(n,t){"object"==typeof n&&(t=n,n=void 0);t=t||{};var s,c,f,b,k,l,a,v,r=i.ajaxSetup({},t),o=r.context||r,d=r.context&&(o.nodeType||o.jquery)?i(o):i.event,nt=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(2===e){if(!v)for(v={};t=oo.exec(b);)v[t[1].toLowerCase()]=t[2];t=v[n.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===e?b:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(2>e)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return a&&a.abort(t),w(0,t),this}};if(nt.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||y)+"").replace(eo,"").replace(ho,g[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(h)||[""],null==r.crossDomain&&(s=ku.exec(r.url.toLowerCase()),r.crossDomain=!(!s||s[1]===g[1]&&s[2]===g[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(g[3]||("http:"===g[1]?"80":"443")))),r.data&&r.processData&&"string"!=typeof r.data&&(r.data=i.param(r.data,r.traditional)),tf(du,r,t,u),2===e)return u;l=r.global;l&&0==i.active++&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!so.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(vi.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=bu.test(f)?f.replace(bu,"$1_="+ai++):f+(vi.test(f)?"&":"?")+"_="+ai++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+("*"!==r.dataTypes[0]?", "+gu+"; q=0.01":""):r.accepts["*"]);for(c in r.headers)u.setRequestHeader(c,r.headers[c]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||2===e))return u.abort();ut="abort";for(c in{success:1,error:1,complete:1})u[c](r[c]);if(a=tf(yi,r,t,u)){u.readyState=1;l&&d.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(k=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;a.send(it,w)}catch(ft){if(!(2>e))throw ft;w(-1,ft)}}else w(-1,"No Transport");function w(n,t,s,h){var v,it,g,y,w,c=t;2!==e&&(e=2,k&&clearTimeout(k),a=void 0,b=h||"",u.readyState=n>0?4:0,v=n>=200&&300>n||304===n,s&&(y=co(r,u,s)),y=lo(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),204===n||"HEAD"===r.type?c="nocontent":304===n?c="notmodified":(c=y.state,it=y.data,g=y.error,v=!g)):(g=c,(n||!c)&&(c="error",0>n&&(n=0))),u.status=n,u.statusText=(t||c)+"",v?nt.resolveWith(o,[it,c,u]):nt.rejectWith(o,[u,c,g]),u.statusCode(p),p=void 0,l&&d.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:g]),tt.fireWith(o,[u,c]),l&&(d.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,void 0,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=void 0),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&1===n.firstChild.nodeType;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return this.each(i.isFunction(n)?function(t){i(this).wrapInner(n.call(this,t))}:function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0||!r.reliableHiddenOffsets()&&"none"===(n.style&&n.style.display||i.css(n,"display"))};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var ao=/%20/g,vo=/\[\]$/,rf=/\r?\n/g,yo=/^(?:submit|button|image|reset|file)$/i,po=/^(?:input|select|textarea|keygen)/i;function wi(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||vo.test(n)?u(n,i):wi(n+"["+("object"==typeof i?t:"")+"]",i,r,u)});else if(r||"object"!==i.type(t))u(n,t);else for(f in t)wi(n+"["+f+"]",t[f],r,u)}i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():null==t?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(void 0===t&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)wi(r,n[r],t,f);return u.join("&").replace(ao,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&po.test(this.nodeName)&&!yo.test(n)&&(this.checked||!ui.test(n))}).map(function(n,t){var r=i(this).val();return null==r?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(rf,"\r\n")}}):{name:t.name,value:r.replace(rf,"\r\n")}}).get()}});i.ajaxSettings.xhr=void 0!==n.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&uf()||bo()}:uf;var wo=0,gt={},ht=i.ajaxSettings.xhr();n.ActiveXObject&&i(n).on("unload",function(){for(var n in gt)gt[n](void 0,!0)});r.cors=!!ht&&"withCredentials"in ht;ht=r.ajax=!!ht;ht&&i.ajaxTransport(function(n){if(!n.crossDomain||r.cors){var t;return{send:function(r,u){var e,f=n.xhr(),o=++wo;if(f.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(e in n.xhrFields)f[e]=n.xhrFields[e];n.mimeType&&f.overrideMimeType&&f.overrideMimeType(n.mimeType);n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(e in r)void 0!==r[e]&&f.setRequestHeader(e,r[e]+"");f.send(n.hasContent&&n.data||null);t=function(r,e){var s,c,h;if(t&&(e||4===f.readyState))if(delete gt[o],t=void 0,f.onreadystatechange=i.noop,e)4!==f.readyState&&f.abort();else{h={};s=f.status;"string"==typeof f.responseText&&(h.text=f.responseText);try{c=f.statusText}catch(l){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=h.text?200:404}h&&u(s,c,h,f.getAllResponseHeaders())};n.async?4===f.readyState?setTimeout(t):f.onreadystatechange=gt[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}});function uf(){try{return new n.XMLHttpRequest}catch(t){}}function bo(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}});i.ajaxPrefilter("script",function(n){void 0===n.cache&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)});i.ajaxTransport("script",function(n){if(n.crossDomain){var t,r=u.head||i("head")[0]||u.documentElement;return{send:function(i,f){t=u.createElement("script");t.async=!0;n.scriptCharset&&(t.charset=n.scriptCharset);t.src=n.url;t.onload=t.onreadystatechange=function(n,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||f(200,"success"))};r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var ff=[],bi=/(=)\?(?=&|$)|\?\?/;i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=ff.pop()||i.expando+"_"+ai++;return this[n]=!0,n}});i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(bi.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&bi.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return(f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(bi,"$1"+f):t.jsonp!==!1&&(t.url+=(vi.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,ff.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=void 0}),"script")});i.parseHTML=function(n,t,r){if(!n||"string"!=typeof n)return null;"boolean"==typeof t&&(r=t,t=!1);t=t||u;var f=tr.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))};var ef=i.fn.load;i.fn.load=function(n,t,r){if("string"!=typeof n&&ef)return ef.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=i.trim(n.slice(e,n.length)),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(s="POST"),f.length>0&&i.ajax({url:n,type:s,dataType:"html",data:t}).done(function(n){o=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,o||[n.responseText,t,n])}),this};i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length};var of=n.document.documentElement;function sf(n){return i.isWindow(n)?n:9===n.nodeType?n.defaultView||n.parentWindow:!1}i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};"static"===l&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=("absolute"===l||"fixed"===l)&&i.inArray("auto",[s,c])>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));null!=t.top&&(f.top=t.top-u.top+h);null!=t.left&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}};i.fn.extend({offset:function(n){if(arguments.length)return void 0===n?this:this.each(function(t){i.offset.setOffset(this,n,t)});var t,f,u={top:0,left:0},r=this[0],e=r&&r.ownerDocument;if(e)return t=e.documentElement,i.contains(t,r)?(typeof r.getBoundingClientRect!==s&&(u=r.getBoundingClientRect()),f=sf(e),{top:u.top+(f.pageYOffset||t.scrollTop)-(t.clientTop||0),left:u.left+(f.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):u},position:function(){if(this[0]){var n,r,t={top:0,left:0},u=this[0];return"fixed"===i.css(u,"position")?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||of;n&&!i.nodeName(n,"html")&&"static"===i.css(n,"position");)n=n.offsetParent;return n||of})}});i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var r=/Y/.test(t);i.fn[n]=function(u){return w(this,function(n,u,f){var e=sf(n);return void 0===f?e?t in e?e[t]:e.document.documentElement[u]:n[u]:void(e?e.scrollTo(r?i(e).scrollLeft():f,r?f:i(e).scrollTop()):n[u]=f)},n,u,arguments.length,null)}});i.each(["top","left"],function(n,t){i.cssHooks[t]=uu(r.pixelPosition,function(n,r){if(r)return(r=k(n,t),pt.test(r)?i(n).position()[t]+"px":r)})});i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||"boolean"!=typeof u),o=r||(u===!0||f===!0?"margin":"border");return w(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:9===t.nodeType?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):void 0===u?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:void 0,e,null)}})});i.fn.size=function(){return this.length};i.fn.andSelf=i.fn.addBack;"function"==typeof define&&define.amd&&define("asljQuery",[],function(){return i});var ko=n.jQuery,go=n.$;return i.noConflict=function(t){return n.$===i&&(n.$=go),t&&n.jQuery===i&&(n.asljQuery=ko),i},typeof t===s&&(n.asljQuery=n.$=i),i}),function(n,t,i){(function(t){typeof define=="function"&&!1&&define.amd&&define.amd.jQuery?define(["jquery"],t):typeof module!="undefined"&&!1&&module.exports?t(require("jquery")):t(n)})(function(n){var u="left",f="right",e="up",o="down",y="in",p="out",w="none",tt="auto",b="swipe",k="pinch",d="tap",it="doubletap",rt="longtap",g="horizontal",nt="vertical",a="all",ft=10,ut="start",s="move",t="end",r="cancel",l="ontouchstart"in i,v=i.navigator.msPointerEnabled&&!i.navigator.pointerEnabled&&!l,h=(i.navigator.pointerEnabled||i.navigator.msPointerEnabled)&&!l,c="TouchSwipe";n.fn.swipe=function(t){var r=n(this),i=r.data(c);if(i&&typeof t=="string"){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(i&&typeof t=="object")i.option.apply(this,arguments);else if(!i&&(typeof t=="object"||!t))return et.apply(this,arguments);return r};n.fn.swipe.version="1.6.15";n.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe.phases={PHASE_START:ut,PHASE_MOVE:s,PHASE_END:t,PHASE_CANCEL:r};n.fn.swipe.directions={LEFT:u,RIGHT:f,UP:e,DOWN:o,IN:y,OUT:p};n.fn.swipe.pageScroll={NONE:w,HORIZONTAL:g,VERTICAL:nt,AUTO:tt};n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:a};function et(t){return t&&t.allowPageScroll===undefined&&(t.swipe!==undefined||t.swipeStatus!==undefined)&&(t.allowPageScroll=w),t.click!==undefined&&t.tap===undefined&&(t.tap=t.click),t||(t={}),t=n.extend({},n.fn.swipe.defaults,t),this.each(function(){var r=n(this),i=r.data(c);i||(i=new ot(this,t),r.data(c,i))})}function ot(i,et){var et=n.extend({},et),si=l||h||!et.fallbackToMouseEvents,hi=si?h?v?"MSPointerDown":"pointerdown":"touchstart":"mousedown",ki=si?h?v?"MSPointerMove":"pointermove":"touchmove":"mousemove",di=si?h?v?"MSPointerUp":"pointerup":"touchend":"mouseup",ri=si?h?"mouseleave":null:"mouseleave",ci=h?v?"MSPointerCancel":"pointercancel":"touchcancel",at=0,vt=null,yt=null,lt=0,gt=0,ni=0,pt=1,bt=0,kt=0,li=null,ot=n(i),st="start",ct=0,ht={},gi=0,ai=0,vi=0,nr=0,ti=0,fi=null,ei=null;try{ot.bind(hi,tr);ot.bind(ci,ui)}catch(ff){n.error("events not supported "+hi+","+ci+" on jQuery.swipe")}this.enable=function(){return ot.bind(hi,tr),ot.bind(ci,ui),ot};this.disable=function(){return lr(),ot};this.destroy=function(){lr();ot.data(c,null);ot=null};this.option=function(t,i){if(typeof t=="object")et=n.extend(et,t);else if(et[t]!==undefined){if(i===undefined)return et[t];et[t]=i}else if(t)n.error("Option "+t+" does not exist on jQuery.swipe.options");else return et;return null};function tr(t){if(!pu()&&!(n(t.target).closest(et.excludedElements,ot).length>0)){var i=t.originalEvent?t.originalEvent:t,f,u=i.touches,e=u?u[0]:i;return(st=ut,u?ct=u.length:et.preventDefaultEvents!==!1&&t.preventDefault(),at=0,vt=null,yt=null,kt=null,lt=0,gt=0,ni=0,pt=1,bt=0,li=ku(),dr(),wi(0,e),!u||ct===et.fingers||et.fingers===a||oi()?(gi=ii(),ct==2&&(wi(1,u[1]),gt=ni=cr(ht[0].start,ht[1].start)),(et.swipeStatus||et.pinchStatus)&&(f=wt(i,st))):f=!1,f===!1)?(st=r,wt(i,st),f):(et.hold&&(ei=setTimeout(n.proxy(function(){ot.trigger("hold",[i.target]);et.hold&&(f=et.hold.call(ot,i,i.target))},this),et.longTapThreshold)),pi(!0),null)}}function ir(n){var f=n.originalEvent?n.originalEvent:n;if(st!==t&&st!==r&&!yi()){var o,i=f.touches,h=i?i[0]:f,u=gr(h);if(ai=ii(),i&&(ct=i.length),et.hold&&clearTimeout(ei),st=s,ct==2&&(gt==0?(wi(1,i[1]),gt=ni=cr(ht[0].start,ht[1].start)):(gr(i[1]),ni=cr(ht[0].end,ht[1].end),kt=gu(ht[0].end,ht[1].end)),pt=du(gt,ni),bt=Math.abs(gt-ni)),ct===et.fingers||et.fingers===a||!i||oi()){if(vt=iu(u.start,u.end),yt=iu(u.last,u.end),uu(n,yt),at=nf(u.start,u.end),lt=tu(),bu(vt,at),o=wt(f,st),!et.triggerOnTouchEnd||et.triggerOnTouchLeave){var e=!0;if(et.triggerOnTouchLeave){var c=rf(this);e=uf(u.end,c)}!et.triggerOnTouchEnd&&e?st=fr(s):et.triggerOnTouchLeave&&!e&&(st=fr(t));(st==r||st==t)&&wt(f,st)}}else st=r,wt(f,st);o===!1&&(st=r,wt(f,st))}}function rr(n){var i=n.originalEvent?n.originalEvent:n,u=i.touches;if(u){if(u.length&&!yi())return yu(i),!0;if(u.length&&yi())return!0}return yi()&&(ct=nr),ai=ii(),lt=tu(),or()||!er()?(st=r,wt(i,st)):et.triggerOnTouchEnd||et.triggerOnTouchEnd==!1&&st===s?(et.preventDefaultEvents!==!1&&n.preventDefault(),st=t,wt(i,st)):!et.triggerOnTouchEnd&&br()?(st=t,dt(i,st,d)):st===s&&(st=r,wt(i,st)),pi(!1),null}function ui(){ct=0;ai=0;gi=0;gt=0;ni=0;pt=1;dr();pi(!1)}function ur(n){var i=n.originalEvent?n.originalEvent:n;et.triggerOnTouchLeave&&(st=fr(t),wt(i,st))}function lr(){ot.unbind(hi,tr);ot.unbind(ci,ui);ot.unbind(ki,ir);ot.unbind(di,rr);ri&&ot.unbind(ri,ur);pi(!1)}function fr(n){var i=n,f=ar(),u=er(),e=or();return!f||e?i=r:u&&n==s&&(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)?i=t:!u&&n==t&&et.triggerOnTouchLeave&&(i=r),i}function wt(n,i){var u,f=n.touches;return(eu()||sr())&&(u=dt(n,i,b)),(fu()||oi())&&u!==!1&&(u=dt(n,i,k)),au()&&u!==!1?u=dt(n,i,it):vu()&&u!==!1?u=dt(n,i,rt):lu()&&u!==!1&&(u=dt(n,i,d)),i===r&&(sr()&&(u=dt(n,i,b)),oi()&&(u=dt(n,i,k)),ui(n)),i===t&&(f?f.length||ui(n):ui(n)),u}function dt(i,s,h){var c;if(h==b){if(ot.trigger("swipeStatus",[s,vt||null,at||0,lt||0,ct,ht,yt]),et.swipeStatus&&(c=et.swipeStatus.call(ot,i,s,vt||null,at||0,lt||0,ct,ht,yt),c===!1))return!1;if(s==t&&yr()){if(clearTimeout(fi),clearTimeout(ei),ot.trigger("swipe",[vt,at,lt,ct,ht,yt]),et.swipe&&(c=et.swipe.call(ot,i,vt,at,lt,ct,ht,yt),c===!1))return!1;switch(vt){case u:ot.trigger("swipeLeft",[vt,at,lt,ct,ht,yt]);et.swipeLeft&&(c=et.swipeLeft.call(ot,i,vt,at,lt,ct,ht,yt));break;case f:ot.trigger("swipeRight",[vt,at,lt,ct,ht,yt]);et.swipeRight&&(c=et.swipeRight.call(ot,i,vt,at,lt,ct,ht,yt));break;case e:ot.trigger("swipeUp",[vt,at,lt,ct,ht,yt]);et.swipeUp&&(c=et.swipeUp.call(ot,i,vt,at,lt,ct,ht,yt));break;case o:ot.trigger("swipeDown",[vt,at,lt,ct,ht,yt]);et.swipeDown&&(c=et.swipeDown.call(ot,i,vt,at,lt,ct,ht,yt))}}}if(h==k){if(ot.trigger("pinchStatus",[s,kt||null,bt||0,lt||0,ct,pt,ht]),et.pinchStatus&&(c=et.pinchStatus.call(ot,i,s,kt||null,bt||0,lt||0,ct,pt,ht),c===!1))return!1;if(s==t&&vr())switch(kt){case y:ot.trigger("pinchIn",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchIn&&(c=et.pinchIn.call(ot,i,kt||null,bt||0,lt||0,ct,pt,ht));break;case p:ot.trigger("pinchOut",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchOut&&(c=et.pinchOut.call(ot,i,kt||null,bt||0,lt||0,ct,pt,ht))}}return h==d?(s===r||s===t)&&(clearTimeout(fi),clearTimeout(ei),hr()&&!su()?(ti=ii(),fi=setTimeout(n.proxy(function(){ti=null;ot.trigger("tap",[i.target]);et.tap&&(c=et.tap.call(ot,i,i.target))},this),et.doubleTapThreshold)):(ti=null,ot.trigger("tap",[i.target]),et.tap&&(c=et.tap.call(ot,i,i.target)))):h==it?(s===r||s===t)&&(clearTimeout(fi),clearTimeout(ei),ti=null,ot.trigger("doubletap",[i.target]),et.doubleTap&&(c=et.doubleTap.call(ot,i,i.target))):h==rt&&(s===r||s===t)&&(clearTimeout(fi),ti=null,ot.trigger("longtap",[i.target]),et.longTap&&(c=et.longTap.call(ot,i,i.target))),c}function er(){var n=!0;return et.threshold!==null&&(n=at>=et.threshold),n}function or(){var n=!1;return et.cancelThreshold!==null&&vt!==null&&(n=nu(vt)-at>=et.cancelThreshold),n}function ru(){return et.pinchThreshold!==null?bt>=et.pinchThreshold:!0}function ar(){return et.maxTimeThreshold?lt>=et.maxTimeThreshold?!1:!0:!0}function uu(n,t){if(et.preventDefaultEvents!==!1)if(et.allowPageScroll===w)n.preventDefault();else{var i=et.allowPageScroll===tt;switch(t){case u:(et.swipeLeft&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case f:(et.swipeRight&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case e:(et.swipeUp&&i||!i&&et.allowPageScroll!=nt)&&n.preventDefault();break;case o:(et.swipeDown&&i||!i&&et.allowPageScroll!=nt)&&n.preventDefault()}}}function vr(){var n=pr(),t=wr(),i=ru();return n&&t&&i}function oi(){return!!(et.pinchStatus||et.pinchIn||et.pinchOut)}function fu(){return!!(vr()&&oi())}function yr(){var n=ar(),t=er(),i=pr(),r=wr(),u=or();return!u&&r&&i&&t&&n}function sr(){return!!(et.swipe||et.swipeStatus||et.swipeLeft||et.swipeRight||et.swipeUp||et.swipeDown)}function eu(){return!!(yr()&&sr())}function pr(){return ct===et.fingers||et.fingers===a||!l}function wr(){return ht[0].end.x!==0}function br(){return!!et.tap}function hr(){return!!et.doubleTap}function ou(){return!!et.longTap}function kr(){if(ti==null)return!1;var n=ii();return hr()&&n-ti<=et.doubleTapThreshold}function su(){return kr()}function hu(){return(ct===1||!l)&&(isNaN(at)||at<et.threshold)}function cu(){return lt>et.longTapThreshold&&at<ft}function lu(){return!!(hu()&&br())}function au(){return!!(kr()&&hr())}function vu(){return!!(cu()&&ou())}function yu(n){vi=ii();nr=n.touches.length+1}function dr(){vi=0;nr=0}function yi(){var n=!1;if(vi){var t=ii()-vi;t<=et.fingerReleaseThreshold&&(n=!0)}return n}function pu(){return!!(ot.data(c+"_intouch")===!0)}function pi(n){ot&&(n===!0?(ot.bind(ki,ir),ot.bind(di,rr),ri&&ot.bind(ri,ur)):(ot.unbind(ki,ir,!1),ot.unbind(di,rr,!1),ri&&ot.unbind(ri,ur,!1)),ot.data(c+"_intouch",n===!0))}function wi(n,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,ht[n]=i,i}function gr(n){var i=n.identifier!==undefined?n.identifier:0,t=wu(i);return t===null&&(t=wi(i,n)),t.last.x=t.end.x,t.last.y=t.end.y,t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function wu(n){return ht[n]||null}function bu(n,t){t=Math.max(t,nu(n));li[n].distance=t}function nu(n){return li[n]?li[n].distance:undefined}function ku(){var n={};return n[u]=bi(u),n[f]=bi(f),n[e]=bi(e),n[o]=bi(o),n}function bi(n){return{direction:n,distance:0}}function tu(){return ai-gi}function cr(n,t){var i=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y);return Math.round(Math.sqrt(i*i+r*r))}function du(n,t){var i=t/n*1;return i.toFixed(2)}function gu(){return pt<1?p:y}function nf(n,t){return Math.round(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)))}function tf(n,t){var r=n.x-t.x,u=t.y-n.y,f=Math.atan2(u,r),i=Math.round(f*180/Math.PI);return i<0&&(i=360-Math.abs(i)),i}function iu(n,t){var i=tf(n,t);return i<=45&&i>=0?u:i<=360&&i>=315?u:i>=135&&i<=225?f:i>45&&i<135?o:e}function ii(){var n=new Date;return n.getTime()}function rf(t){t=n(t);var i=t.offset();return{left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()}}function uf(n,t){return n.x>t.left&&n.x<t.right&&n.y>t.top&&n.y<t.bottom}}})}(asljQuery,asljQuery,window),function(n){n.extend({highlight:function(t,i,r,u){if(t.nodeType===3){var f=t.data.match(i);if(f){var s=document.createElement(r||"span");if(s.className=u||"highlight",/\.|,|\s/.test(f[0].charAt(0)))var h=f.index+1;else var h=f.index;var e=t.splitText(h);e.splitText(f[1].length);var c=e.cloneNode(!0);return s.appendChild(c),e.parentNode.replaceChild(s,e),1}}else if(t.nodeType===1&&t.childNodes&&!/(script|style)/i.test(t.tagName)&&!(t.tagName===r.toUpperCase()&&t.className===u))for(var o=0;o<t.childNodes.length;o++)o+=n.highlight(t.childNodes[o],i,r,u);return 0}});n.fn.unhighlight=function(t){var i={className:"highlight",element:"span"};return n.extend(i,t),this.find(i.element+"."+i.className).each(function(){var n=this.parentNode;n.replaceChild(this.firstChild,this);n.normalize()}).end()};n.fn.highlight=function(t,i){var r={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(n.extend(r,i),t.constructor===String&&(t=[t]),t=n.grep(t,function(n){return n!=""}),t=n.map(t,function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}),t.length==0)return this;var f=r.caseSensitive?"":"i",u="("+t.join("|")+")";r.wordsOnly&&(u="(?:,|^|\\s)"+u+"(?:,|$|\\s)");var e=new RegExp(u,f);return this.each(function(){n.highlight(this,e,r.element,r.className)})}}(asljQuery,asljQuery,window),function(n,t,i){(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.asl_SimpleBar=t())})(this,function(){"use strict";var e=typeof globalThis!="undefined"?globalThis:typeof i!="undefined"?i:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function et(n,t){return t={exports:{}},n(t,t.exports),t.exports}var pt="object",wt=function(n){return n&&n.Math==Math&&n},t=wt(typeof globalThis==pt&&globalThis)||wt(typeof i==pt&&i)||wt(typeof self==pt&&self)||wt(typeof e==pt&&e)||Function("return this")(),f=function(n){try{return!!n()}catch(t){return!0}},v=!f(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),ff={}.propertyIsEnumerable,ef=Object.getOwnPropertyDescriptor,gs=ef&&!ff.call({1:2},1),nh=gs?function(n){var t=ef(this,n);return!!t&&t.enumerable}:ff,of={f:nh},or=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}},th={}.toString,k=function(n){return th.call(n).slice(8,-1)},ih="".split,bt=f(function(){return!Object("z").propertyIsEnumerable(0)})?function(n){return k(n)=="String"?ih.call(n,""):Object(n)}:Object,kt=function(n){if(n==undefined)throw TypeError("Can't call method on "+n);return n},dt=function(n){return bt(kt(n))},n=function(n){return typeof n=="object"?n!==null:typeof n=="function"},sf=function(t,i){if(!n(t))return t;var r,u;if(i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t))||typeof(r=t.valueOf)=="function"&&!n(u=r.call(t))||!i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t)))return u;throw TypeError("Can't convert object to primitive value");},rh={}.hasOwnProperty,u=function(n,t){return rh.call(n,t)},sr=t.document,uh=n(sr)&&n(sr.createElement),hf=function(n){return uh?sr.createElement(n):{}},cf=!v&&!f(function(){return Object.defineProperty(hf("div"),"a",{get:function(){return 7}}).a!=7}),lf=Object.getOwnPropertyDescriptor,fh=v?lf:function(n,t){if(n=dt(n),t=sf(t,!0),cf)try{return lf(n,t)}catch(i){}if(u(n,t))return or(!of.f.call(n,t),n[t])},af={f:fh},h=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t},vf=Object.defineProperty,eh=v?vf:function(n,t,i){if(h(n),t=sf(t,!0),h(i),cf)try{return vf(n,t,i)}catch(r){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(n[t]=i.value),n},d={f:eh},s=v?function(n,t,i){return d.f(n,t,or(1,i))}:function(n,t,i){return n[t]=i,n},hr=function(n,i){try{s(t,n,i)}catch(r){t[n]=i}return i},gt=et(function(n){var i="__core-js_shared__",r=t[i]||hr(i,{});(n.exports=function(n,t){return r[n]||(r[n]=t!==undefined?t:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),ni=gt("native-function-to-string",Function.toString),yf=t.WeakMap,pf=typeof yf=="function"&&/native code/.test(ni.call(yf)),oh=0,sh=Math.random(),cr=function(n){return"Symbol("+String(n===undefined?"":n)+")_"+(++oh+sh).toString(36)},wf=gt("keys"),lr=function(n){return wf[n]||(wf[n]=cr(n))},ti={},hh=t.WeakMap,ii,ot,ri,ch=function(n){return ri(n)?ot(n):ii(n,{})},lh=function(t){return function(i){var r;if(!n(i)||(r=ot(i)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(pf){var g=new hh,ah=g.get,vh=g.has,yh=g.set;ii=function(n,t){return yh.call(g,n,t),t};ot=function(n){return ah.call(g,n)||{}};ri=function(n){return vh.call(g,n)}}else{var st=lr("state");ti[st]=!0;ii=function(n,t){return s(n,st,t),t};ot=function(n){return u(n,st)?n[st]:{}};ri=function(n){return u(n,st)}}var c={set:ii,get:ot,has:ri,enforce:ch,getterFor:lh},ht=et(function(n){var i=c.get,r=c.enforce,f=String(ni).split("toString");gt("inspectSource",function(n){return ni.call(n)});(n.exports=function(n,i,e,o){var c=o?!!o.unsafe:!1,h=o?!!o.enumerable:!1,l=o?!!o.noTargetGet:!1;if(typeof e=="function"&&(typeof i!="string"||u(e,"name")||s(e,"name",i),r(e).source=f.join(typeof i=="string"?i:"")),n===t){h?n[i]=e:hr(i,e);return}c?!l&&n[i]&&(h=!0):delete n[i];h?n[i]=e:s(n,i,e)})(Function.prototype,"toString",function(){return typeof this=="function"&&i(this).source||ni.call(this)})}),ar=t,bf=function(n){return typeof n=="function"?n:undefined},kf=function(n,i){return arguments.length<2?bf(ar[n])||bf(t[n]):ar[n]&&ar[n][i]||t[n]&&t[n][i]},ph=Math.ceil,wh=Math.floor,vr=function(n){return isNaN(n=+n)?0:(n>0?wh:ph)(n)},bh=Math.min,ui=function(n){return n>0?bh(vr(n),9007199254740991):0},kh=Math.max,dh=Math.min,gh=function(n,t){var i=vr(n);return i<0?kh(i+t,0):dh(i,t)},df=function(n){return function(t,i,r){var f=dt(t),e=ui(f.length),u=gh(r,e),o;if(n&&i!=i){while(e>u)if(o=f[u++],o!=o)return!0}else for(;e>u;u++)if((n||u in f)&&f[u]===i)return n||u||0;return!n&&-1}},nc={includes:df(!0),indexOf:df(!1)},tc=nc.indexOf,gf=function(n,t){var f=dt(n),e=0,r=[];for(var i in f)!u(ti,i)&&u(f,i)&&r.push(i);while(t.length>e)u(f,i=t[e++])&&(~tc(r,i)||r.push(i));return r},fi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ic=fi.concat("length","prototype"),rc=Object.getOwnPropertyNames||function(n){return gf(n,ic)},uc={f:rc},fc=Object.getOwnPropertySymbols,ne={f:fc},ec=kf("Reflect","ownKeys")||function(n){var t=uc.f(h(n)),i=ne.f;return i?t.concat(i(n)):t},oc=function(n,t){for(var f=ec(t),e=d.f,o=af.f,i=0;i<f.length;i++){var r=f[i];u(n,r)||e(n,r,o(t,r))}},sc=/#|\.prototype\./,ct=function(n,t){var i=cc[hc(n)];return i==ac?!0:i==lc?!1:typeof t=="function"?f(t):!!t},hc=ct.normalize=function(n){return String(n).replace(sc,".").toLowerCase()},cc=ct.data={},lc=ct.NATIVE="N",ac=ct.POLYFILL="P",yr=ct,vc=af.f,a=function(n,i){var o=n.target,c=n.global,l=n.stat,a,f,r,u,e,h;if(f=c?t:l?t[o]||hr(o,{}):(t[o]||{}).prototype,f)for(r in i){if(e=i[r],n.noTargetGet?(h=vc(f,r),u=h&&h.value):u=f[r],a=yr(c?r:o+(l?".":"#")+r,n.forced),!a&&u!==undefined){if(typeof e==typeof u)continue;oc(e,u)}(n.sham||u&&u.sham)&&s(e,"sham",!0);ht(f,r,e,n)}},te=function(n){if(typeof n!="function")throw TypeError(String(n)+" is not a function");return n},ie=function(n,t,i){if(te(n),t===undefined)return n;switch(i){case 0:return function(){return n.call(t)};case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)}}return function(){return n.apply(t,arguments)}},ei=function(n){return Object(kt(n))},re=Array.isArray||function(n){return k(n)=="Array"},ue=!!Object.getOwnPropertySymbols&&!f(function(){return!String(Symbol())}),fe=t.Symbol,ee=gt("wks"),o=function(n){return ee[n]||(ee[n]=ue&&fe[n]||(ue?fe:cr)("Symbol."+n))},yc=o("species"),pc=function(t,i){var r;return re(t)&&(r=t.constructor,typeof r=="function"&&(r===Array||re(r.prototype))?r=undefined:n(r)&&(r=r[yc],r===null&&(r=undefined))),new(r===undefined?Array:r)(i===0?0:i)},wc=[].push,y=function(n){var i=n==1,u=n==2,f=n==3,t=n==4,r=n==6,e=n==5||r;return function(o,s,h,c){for(var w=ei(o),v=bt(w),d=ie(s,h,3),b=ui(v.length),l=0,k=c||pc,y=i?k(o,b):u?k(o,0):undefined,a,p;b>l;l++)if((e||l in v)&&(a=v[l],p=d(a,l,w),n))if(i)y[l]=p;else if(p)switch(n){case 3:return!0;case 5:return a;case 6:return l;case 2:wc.call(y,a)}else if(t)return!1;return r?-1:f||t?t:y}},oi={forEach:y(0),map:y(1),filter:y(2),some:y(3),every:y(4),find:y(5),findIndex:y(6)},oe=function(n,t){var i=[][n];return!i||!f(function(){i.call(null,t||function(){throw 1;},1)})},bc=oi.forEach,lt=oe("forEach")?function(n){return bc(this,n,arguments.length>1?arguments[1]:undefined)}:[].forEach;a({target:"Array",proto:!0,forced:[].forEach!=lt},{forEach:lt});var pr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var kc in pr){var se=t[kc],si=se&&se.prototype;if(si&&si.forEach!==lt)try{s(si,"forEach",lt)}catch(kb){si.forEach=lt}}var dc=!!(typeof i!="undefined"&&i.document&&i.document.createElement),wr=dc,gc=o("species"),nl=function(n){return!f(function(){var t=[],i=t.constructor={};return i[gc]=function(){return{foo:1}},t[n](Boolean).foo!==1})},tl=oi.filter;a({target:"Array",proto:!0,forced:!nl("filter")},{filter:function(n){return tl(this,n,arguments.length>1?arguments[1]:undefined)}});var hi=Object.keys||function(n){return gf(n,fi)},il=v?Object.defineProperties:function(n,t){h(n);for(var i=hi(t),f=i.length,r=0,u;f>r;)d.f(n,u=i[r++],t[u]);return n},rl=kf("document","documentElement"),he=lr("IE_PROTO"),br="prototype",kr=function(){},ci=function(){var t=hf("iframe"),r=fi.length,u="<",i="script",f=">",e="java"+i+":",n;for(t.style.display="none",rl.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(u+i+f+"document.F=Object"+u+"/"+i+f),n.close(),ci=n.F;r--;)delete ci[br][fi[r]];return ci()},ce=Object.create||function(n,t){var i;return n!==null?(kr[br]=h(n),i=new kr,kr[br]=null,i[he]=n):i=ci(),t===undefined?i:il(i,t)};ti[he]=!0;var dr=o("unscopables"),gr=Array.prototype;gr[dr]==undefined&&s(gr,dr,ce(null));var nu=function(n){gr[dr][n]=!0},nt={},ul=!f(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype}),le=lr("IE_PROTO"),fl=Object.prototype,li=ul?Object.getPrototypeOf:function(n){return(n=ei(n),u(n,le))?n[le]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?fl:null},ae=o("iterator"),ve=!1,el=function(){return this},tt,tu,iu;[].keys&&(iu=[].keys(),"next"in iu?(tu=li(li(iu)),tu!==Object.prototype&&(tt=tu)):ve=!0);tt==undefined&&(tt={});u(tt,ae)||s(tt,ae,el);var ru={IteratorPrototype:tt,BUGGY_SAFARI_ITERATORS:ve},ol=d.f,ye=o("toStringTag"),uu=function(n,t,i){n&&!u(n=i?n:n.prototype,ye)&&ol(n,ye,{configurable:!0,value:t})},sl=ru.IteratorPrototype,hl=function(){return this},cl=function(n,t,i){var r=t+" Iterator";return n.prototype=ce(sl,{next:or(1,i)}),uu(n,r,!1),nt[r]=hl,n},ll=function(t){if(!n(t)&&t!==null)throw TypeError("Can't set "+String(t)+" as a prototype");return t},ai=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,i={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set;n.call(i,[]);t=i instanceof Array}catch(r){}return function(i,r){return h(i),ll(r),t?n.call(i,r):i.__proto__=r,i}}():undefined),fu=ru.IteratorPrototype,vi=ru.BUGGY_SAFARI_ITERATORS,at=o("iterator"),pe="keys",yi="values",we="entries",al=function(){return this},be=function(n,t,i,r,u,f,e){cl(i,t,r);var y=function(n){if(n===u&&h)return h;if(!vi&&n in o)return o[n];switch(n){case pe:return function(){return new i(this,n)};case yi:return function(){return new i(this,n)};case we:return function(){return new i(this,n)}}return function(){return new i(this)}},k=t+" Iterator",w=!1,o=n.prototype,l=o[at]||o["@@iterator"]||u&&o[u],h=!vi&&l||y(u),b=t=="Array"?o.entries||l:l,c,v,p;if(b&&(c=li(b.call(new n)),fu!==Object.prototype&&c.next&&(li(c)!==fu&&(ai?ai(c,fu):typeof c[at]!="function"&&s(c,at,al)),uu(c,k,!0))),u==yi&&l&&l.name!==yi&&(w=!0,h=function(){return l.call(this)}),o[at]!==h&&s(o,at,h),nt[t]=h,u)if(v={values:y(yi),keys:f?h:y(pe),entries:y(we)},e)for(p in v)!vi&&!w&&p in o||ht(o,p,v[p]);else a({target:t,proto:!0,forced:vi||w},v);return v},ke="Array Iterator",vl=c.set,yl=c.getterFor(ke),vt=be(Array,"Array",function(n,t){vl(this,{type:ke,target:dt(n),index:0,kind:t})},function(){var t=yl(this),i=t.target,r=t.kind,n=t.index++;return!i||n>=i.length?(t.target=undefined,{value:undefined,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:i[n],done:!1}:{value:[n,i[n]],done:!1}},"values");nt.Arguments=nt.Array;nu("keys");nu("values");nu("entries");var pi=Object.assign,de=!pi||f(function(){var n={},t={},i=Symbol(),r="abcdefghijklmnopqrst";return n[i]=7,r.split("").forEach(function(n){t[n]=n}),pi({},n)[i]!=7||hi(pi({},t)).join("")!=r})?function(n){for(var r=ei(n),s=arguments.length,u=1,f=ne.f,h=of.f;s>u;)for(var t=bt(arguments[u++]),e=f?hi(t).concat(f(t)):hi(t),c=e.length,o=0,i;c>o;)i=e[o++],(!v||h.call(t,i))&&(r[i]=t[i]);return r}:pi;a({target:"Object",stat:!0,forced:Object.assign!==de},{assign:de});var pl=o("toStringTag"),wl=k(function(){return arguments}())=="Arguments",bl=function(n,t){try{return n[t]}catch(i){}},ge=function(n){var t,i,r;return n===undefined?"Undefined":n===null?"Null":typeof(i=bl(t=Object(n),pl))=="string"?i:wl?k(t):(r=k(t))=="Object"&&typeof t.callee=="function"?"Arguments":r},kl=o("toStringTag"),eu={};eu[kl]="z";var no=String(eu)!=="[object z]"?function(){return"[object "+ge(this)+"]"}:eu.toString,to=Object.prototype;no!==to.toString&&ht(to,"toString",no,{unsafe:!0});var ou="\t\n\x0b\f\r                 \u2028\u2029",wi="["+ou+"]",dl=RegExp("^"+wi+wi+"*"),gl=RegExp(wi+wi+"*$"),su=function(n){return function(t){var i=String(kt(t));return n&1&&(i=i.replace(dl,"")),n&2&&(i=i.replace(gl,"")),i}},na={start:su(1),end:su(2),trim:su(3)},ta=na.trim,bi=t.parseInt,ia=/^[+-]?0[Xx]/,ra=bi(ou+"08")!==8||bi(ou+"0x16")!==22,io=ra?function(n,t){var i=ta(String(n));return bi(i,t>>>0||(ia.test(i)?16:10))}:bi;a({global:!0,forced:parseInt!=io},{parseInt:io});var ro=function(n){return function(t,i){var u=String(kt(t)),r=vr(i),o=u.length,f,e;return r<0||r>=o?n?"":undefined:(f=u.charCodeAt(r),f<55296||f>56319||r+1===o||(e=u.charCodeAt(r+1))<56320||e>57343?n?u.charAt(r):f:n?u.slice(r,r+2):(f-55296<<10)+(e-56320)+65536)}},uo={codeAt:ro(!1),charAt:ro(!0)},ua=uo.charAt,fo="String Iterator",fa=c.set,ea=c.getterFor(fo);be(String,"String",function(n){fa(this,{type:fo,string:String(n),index:0})},function(){var n=ea(this),i=n.string,r=n.index,t;return r>=i.length?{value:undefined,done:!0}:(t=ua(i,r),n.index+=t.length,{value:t,done:!1})});var hu=function(n,t,i){for(var r in t)ht(n,r,t[r],i);return n},oa=!f(function(){return Object.isExtensible(Object.preventExtensions({}))}),p=et(function(t){var e=d.f,i=cr("meta"),o=0,r=Object.isExtensible||function(){return!0},f=function(n){e(n,i,{value:{objectID:"O"+ ++o,weakData:{}}})},s=function(t,e){if(!n(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!u(t,i)){if(!r(t))return"F";if(!e)return"E";f(t)}return t[i].objectID},h=function(n,t){if(!u(n,i)){if(!r(n))return!0;if(!t)return!1;f(n)}return n[i].weakData},c=function(n){return oa&&l.REQUIRED&&r(n)&&!u(n,i)&&f(n),n},l=t.exports={REQUIRED:!1,fastKey:s,getWeakData:h,onFreeze:c};ti[i]=!0}),rk=p.REQUIRED,uk=p.fastKey,fk=p.getWeakData,ek=p.onFreeze,sa=o("iterator"),ha=Array.prototype,ca=function(n){return n!==undefined&&(nt.Array===n||ha[sa]===n)},la=o("iterator"),aa=function(n){if(n!=undefined)return n[la]||n["@@iterator"]||nt[ge(n)]},va=function(n,t,i,r){try{return r?t(h(i)[0],i[1]):t(i)}catch(f){var u=n["return"];u!==undefined&&h(u.call(n));throw f;}},eo=et(function(n){var t=function(n,t){this.stopped=n;this.result=t},i=n.exports=function(n,i,r,u,f){var a=ie(i,r,u?2:1),s,c,o,v,e,l;if(f)s=n;else{if(c=aa(n),typeof c!="function")throw TypeError("Target is not iterable");if(ca(c)){for(o=0,v=ui(n.length);v>o;o++)if(e=u?a(h(l=n[o])[0],l[1]):a(n[o]),e&&e instanceof t)return e;return new t(!1)}s=c.call(n)}while(!(l=s.next()).done)if(e=va(s,a,l.value,u),e&&e instanceof t)return e;return new t(!1)};i.stop=function(n){return new t(!0,n)}}),oo=function(n,t,i){if(!(n instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return n},so=o("iterator"),ho=!1;try{var ya=0,co={next:function(){return{done:!!ya++}},"return":function(){ho=!0}};co[so]=function(){return this};Array.from(co,function(){throw 2;})}catch(kb){}var pa=function(n,t){if(!t&&!ho)return!1;var i=!1;try{var r={};r[so]=function(){return{next:function(){return{done:i=!0}}}};n(r)}catch(u){}return i},wa=function(t,i,r){var u,f;return ai&&typeof(u=i.constructor)=="function"&&u!==r&&n(f=u.prototype)&&f!==r.prototype&&ai(t,f),t},ba=function(i,r,u,e,o){var h=t[i],c=h&&h.prototype,s=h,l=e?"set":"add",w={},v=function(t){var i=c[t];ht(c,t,t=="add"?function(n){return i.call(this,n===0?0:n),this}:t=="delete"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:t=="get"?function(t){return o&&!n(t)?undefined:i.call(this,t===0?0:t)}:t=="has"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:function(n,t){return i.call(this,n===0?0:n,t),this})};if(yr(i,typeof h!="function"||!(o||c.forEach&&!f(function(){(new h).entries().next()}))))s=u.getConstructor(r,i,e,l),p.REQUIRED=!0;else if(yr(i,!0)){var y=new s,k=y[l](o?{}:-0,1)!=y,d=f(function(){y.has(1)}),g=pa(function(n){new h(n)}),b=!o&&f(function(){for(var t=new h,n=5;n--;)t[l](n,n);return!t.has(-0)});g||(s=r(function(n,t){oo(n,s,i);var r=wa(new h,n,s);return t!=undefined&&eo(t,r[l],r,e),r}),s.prototype=c,c.constructor=s);(d||b)&&(v("delete"),v("has"),e&&v("get"));(b||k)&&v(l);o&&c.clear&&delete c.clear}return w[i]=s,a({global:!0,forced:s!=h},w),uu(s,i),o||u.setStrong(s,i,e),s},ki=p.getWeakData,ka=c.set,da=c.getterFor,ga=oi.find,nv=oi.findIndex,tv=0,di=function(n){return n.frozen||(n.frozen=new lo)},lo=function(){this.entries=[]},cu=function(n,t){return ga(n.entries,function(n){return n[0]===t})};lo.prototype={get:function(n){var t=cu(this,n);if(t)return t[1]},has:function(n){return!!cu(this,n)},set:function(n,t){var i=cu(this,n);i?i[1]=t:this.entries.push([n,t])},"delete":function(n){var t=nv(this.entries,function(t){return t[0]===n});return~t&&this.entries.splice(t,1),!!~t}};var ao={getConstructor:function(t,i,r,f){var e=t(function(n,t){oo(n,e,i);ka(n,{type:i,id:tv++,frozen:undefined});t!=undefined&&eo(t,n[f],n,r)}),o=da(i),s=function(n,t,i){var r=o(n),u=ki(h(t),!0);return u===!0?di(r).set(t,i):u[r.id]=i,n};return hu(e.prototype,{"delete":function(t){var r=o(this);if(!n(t))return!1;var i=ki(t);return i===!0?di(r)["delete"](t):i&&u(i,r.id)&&delete i[r.id]},has:function(t){var r=o(this);if(!n(t))return!1;var i=ki(t);return i===!0?di(r).has(t):i&&u(i,r.id)}}),hu(e.prototype,r?{get:function(t){var r=o(this);if(n(t)){var i=ki(t);return i===!0?di(r).get(t):i?i[r.id]:undefined}},set:function(n,t){return s(this,n,t)}}:{add:function(n){return s(this,n,!0)}}),e}},ok=et(function(i){var f=c.enforce,v=!t.ActiveXObject&&"ActiveXObject"in t,e=Object.isExtensible,r,s=function(n){return function(){return n(this,arguments.length?arguments[0]:undefined)}},y=i.exports=ba("WeakMap",s,ao,!0,!0);if(pf&&v){r=ao.getConstructor(s,"WeakMap",!0);p.REQUIRED=!0;var u=y.prototype,h=u["delete"],o=u.has,l=u.get,a=u.set;hu(u,{"delete":function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),h.call(this,t)||i.frozen["delete"](t)}return h.call(this,t)},has:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)||i.frozen.has(t)}return o.call(this,t)},get:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)?l.call(this,t):i.frozen.get(t)}return l.call(this,t)},set:function(t,i){if(n(t)&&!e(t)){var u=f(this);u.frozen||(u.frozen=new r);o.call(this,t)?a.call(this,t,i):u.frozen.set(t,i)}else a.call(this,t,i);return this}})}}),lu=o("iterator"),vo=o("toStringTag"),au=vt.values;for(var vu in pr){var yo=t[vu],l=yo&&yo.prototype;if(l){if(l[lu]!==au)try{s(l,lu,au)}catch(kb){l[lu]=au}if(l[vo]||s(l,vo,vu),pr[vu])for(var it in vt)if(l[it]!==vt[it])try{s(l,it,vt[it])}catch(kb){l[it]=vt[it]}}}var po="Expected a function",wo=0/0,iv="[object Symbol]",rv=/^\s+|\s+$/g,uv=/^[-+]0x[0-9a-f]+$/i,fv=/^0b[01]+$/i,ev=/^0o[0-7]+$/i,ov=parseInt,sv=typeof e=="object"&&e&&e.Object===Object&&e,hv=typeof self=="object"&&self&&self.Object===Object&&self,cv=sv||hv||Function("return this")(),lv=Object.prototype,av=lv.toString,vv=Math.max,yv=Math.min,yu=function(){return cv.Date.now()};function pv(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(po);t=bo(t)||0;gi(i)&&(p=!!i.leading,h="maxWait"in i,c=h?vv(bo(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?yv(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=yu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(yu())}function y(){var n=yu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function wv(n,t,i){var r=!0,u=!0;if(typeof n!="function")throw new TypeError(po);return gi(i)&&(r="leading"in i?!!i.leading:r,u="trailing"in i?!!i.trailing:u),pv(n,t,{leading:r,maxWait:t,trailing:u})}function gi(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function bv(n){return!!n&&typeof n=="object"}function kv(n){return typeof n=="symbol"||bv(n)&&av.call(n)==iv}function bo(n){if(typeof n=="number")return n;if(kv(n))return wo;if(gi(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=gi(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(rv,"");var i=fv.test(n);return i||ev.test(n)?ov(n.slice(2),i?2:8):uv.test(n)?wo:+n}var ko=wv,dv="Expected a function",go=0/0,gv="[object Symbol]",ny=/^\s+|\s+$/g,ty=/^[-+]0x[0-9a-f]+$/i,iy=/^0b[01]+$/i,ry=/^0o[0-7]+$/i,uy=parseInt,fy=typeof e=="object"&&e&&e.Object===Object&&e,ey=typeof self=="object"&&self&&self.Object===Object&&self,oy=fy||ey||Function("return this")(),sy=Object.prototype,hy=sy.toString,cy=Math.max,ly=Math.min,pu=function(){return oy.Date.now()};function ay(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(dv);t=ns(t)||0;wu(i)&&(p=!!i.leading,h="maxWait"in i,c=h?cy(ns(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?ly(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=pu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(pu())}function y(){var n=pu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function wu(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function vy(n){return!!n&&typeof n=="object"}function yy(n){return typeof n=="symbol"||vy(n)&&hy.call(n)==gv}function ns(n){if(typeof n=="number")return n;if(yy(n))return go;if(wu(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=wu(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(ny,"");var i=iy.test(n);return i||ry.test(n)?uy(n.slice(2),i?2:8):ty.test(n)?go:+n}var ts=ay,py="Expected a function",is="__lodash_hash_undefined__",wy="[object Function]",by="[object GeneratorFunction]",ky=/^\[object .+?Constructor\]$/,dy=typeof e=="object"&&e&&e.Object===Object&&e,gy=typeof self=="object"&&self&&self.Object===Object&&self,rs=dy||gy||Function("return this")();function np(n,t){return n==null?undefined:n[t]}function tp(n){var t=!1;if(n!=null&&typeof n.toString!="function")try{t=!!(n+"")}catch(i){}return t}var ip=Array.prototype,rp=Function.prototype,us=Object.prototype,bu=rs["__core-js_shared__"],fs=function(){var n=/[^.]+$/.exec(bu&&bu.keys&&bu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),es=rp.toString,ku=us.hasOwnProperty,up=us.toString,fp=RegExp("^"+es.call(ku).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ep=ip.splice,op=os(rs,"Map"),yt=os(Object,"create");function w(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function sp(){this.__data__=yt?yt(null):{}}function hp(n){return this.has(n)&&delete this.__data__[n]}function cp(n){var t=this.__data__;if(yt){var i=t[n];return i===is?undefined:i}return ku.call(t,n)?t[n]:undefined}function lp(n){var t=this.__data__;return yt?t[n]!==undefined:ku.call(t,n)}function ap(n,t){var i=this.__data__;return i[n]=yt&&t===undefined?is:t,this}w.prototype.clear=sp;w.prototype["delete"]=hp;w.prototype.get=cp;w.prototype.has=lp;w.prototype.set=ap;function rt(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function vp(){this.__data__=[]}function yp(n){var t=this.__data__,i=nr(t,n);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():ep.call(t,i,1),!0}function pp(n){var t=this.__data__,i=nr(t,n);return i<0?undefined:t[i][1]}function wp(n){return nr(this.__data__,n)>-1}function bp(n,t){var i=this.__data__,r=nr(i,n);return r<0?i.push([n,t]):i[r][1]=t,this}rt.prototype.clear=vp;rt.prototype["delete"]=yp;rt.prototype.get=pp;rt.prototype.has=wp;rt.prototype.set=bp;function b(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function kp(){this.__data__={hash:new w,map:new(op||rt),string:new w}}function dp(n){return tr(this,n)["delete"](n)}function gp(n){return tr(this,n).get(n)}function nw(n){return tr(this,n).has(n)}function tw(n,t){return tr(this,n).set(n,t),this}b.prototype.clear=kp;b.prototype["delete"]=dp;b.prototype.get=gp;b.prototype.has=nw;b.prototype.set=tw;function nr(n,t){for(var i=n.length;i--;)if(ew(n[i][0],t))return i;return-1}function iw(n){if(!ss(n)||uw(n))return!1;var t=ow(n)||tp(n)?fp:ky;return t.test(fw(n))}function tr(n,t){var i=n.__data__;return rw(t)?i[typeof t=="string"?"string":"hash"]:i.map}function os(n,t){var i=np(n,t);return iw(i)?i:undefined}function rw(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function uw(n){return!!fs&&fs in n}function fw(n){if(n!=null){try{return es.call(n)}catch(t){}try{return n+""}catch(t){}}return""}function du(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new TypeError(py);var i=function(){var r=arguments,u=t?t.apply(this,r):r[0],f=i.cache;if(f.has(u))return f.get(u);var e=n.apply(this,r);return i.cache=f.set(u,e),e};return i.cache=new(du.Cache||b),i}du.Cache=b;function ew(n,t){return n===t||n!==n&&t!==t}function ow(n){var t=ss(n)?up.call(n):"";return t==wy||t==by}function ss(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}var sw=du,hs=function(){function n(n,t){var i=-1;return n.some(function(n,r){return n[0]===t?(i=r,!0):!1}),i}return typeof Map!="undefined"?Map:function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},t.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},t.prototype.has=function(t){return!!~n(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,t){t===void 0&&(t=null);for(var i=0,r=this.__entries__;i<r.length;i++){var u=r[i];n.call(t,u[1],u[0])}},t}()}(),gu=typeof i!="undefined"&&typeof document!="undefined"&&i.document===document,ir=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof i!="undefined"&&i.Math===Math?i:Function("return this")()}(),hw=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ir):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),cw=2;function lw(n,t){var i=!1,r=!1,u=0;function e(){i&&(i=!1,n());r&&f()}function o(){hw(e)}function f(){var n=Date.now();if(i){if(n-u<cw)return;r=!0}else i=!0,r=!1,setTimeout(o,t);u=n}return f}var aw=20,vw=["top","right","bottom","left","width","height","size","weight"],yw=typeof MutationObserver!="undefined",pw=function(){function n(){this.connected_=!1;this.mutationEventsAdded_=!1;this.mutationsObserver_=null;this.observers_=[];this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=lw(this.refresh.bind(this),aw)}return n.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n);this.connected_||this.connect_()},n.prototype.removeObserver=function(n){var t=this.observers_,i=t.indexOf(n);~i&&t.splice(i,1);!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},n.prototype.updateObservers_=function(){var n=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return n.forEach(function(n){return n.broadcastActive()}),n.length>0},n.prototype.connect_=function(){gu&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),i.addEventListener("resize",this.refresh),yw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){gu&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),i.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(n){var t=n.propertyName,i=t===void 0?"":t,r=vw.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),cs=function(n,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var u=r[i];Object.defineProperty(n,u,{value:t[u],enumerable:!1,writable:!1,configurable:!0})}return n},ut=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||ir},ls=ur(0,0,0,0);function rr(n){return parseFloat(n)||0}function as(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return i.reduce(function(t,i){var r=n["border-"+i+"-width"];return t+rr(r)},0)}function ww(n){for(var i={},t=0,r=["top","right","bottom","left"];t<r.length;t++){var u=r[t],f=n["padding-"+u];i[u]=rr(f)}return i}function bw(n){var t=n.getBBox();return ur(0,0,t.width,t.height)}function kw(n){var f=n.clientWidth,e=n.clientHeight;if(!f&&!e)return ls;var t=ut(n).getComputedStyle(n),i=ww(t),o=i.left+i.right,s=i.top+i.bottom,r=rr(t.width),u=rr(t.height);if(t.boxSizing==="border-box"&&(Math.round(r+o)!==f&&(r-=as(t,"left","right")+o),Math.round(u+s)!==e&&(u-=as(t,"top","bottom")+s)),!gw(n)){var h=Math.round(r+o)-f,c=Math.round(u+s)-e;Math.abs(h)!==1&&(r-=h);Math.abs(c)!==1&&(u-=c)}return ur(i.left,i.top,r,u)}var dw=function(){return typeof SVGGraphicsElement!="undefined"?function(n){return n instanceof ut(n).SVGGraphicsElement}:function(n){return n instanceof ut(n).SVGElement&&typeof n.getBBox=="function"}}();function gw(n){return n===ut(n).document.documentElement}function nb(n){return gu?dw(n)?bw(n):kw(n):ls}function tb(n){var t=n.x,i=n.y,r=n.width,u=n.height,e=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,f=Object.create(e.prototype);return cs(f,{x:t,y:i,width:r,height:u,top:i,right:t+r,bottom:u+i,left:t}),f}function ur(n,t,i,r){return{x:n,y:t,width:i,height:r}}var ib=function(){function n(n){this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=ur(0,0,0,0);this.target=n}return n.prototype.isActive=function(){var n=nb(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},n}(),rb=function(){function n(n,t){var i=tb(t);cs(this,{target:n,contentRect:i})}return n}(),ub=function(){function n(n,t,i){if(this.activeObservations_=[],this.observations_=new hs,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n;this.controller_=t;this.callbackCtx_=i}return n.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof ut(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)||(t.set(n,new ib(n)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof ut(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)&&(t.delete(n),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var n=this;this.clearActive();this.observations_.forEach(function(t){t.isActive()&&n.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new rb(n.target,n.broadcastRect())});this.callback_.call(n,t,n);this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),vs=typeof WeakMap!="undefined"?new WeakMap:new hs,ys=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=pw.getInstance(),r=new ub(t,i,this);vs.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){ys.prototype[n]=function(){var t;return(t=vs.get(this))[n].apply(t,arguments)}});var fb=function(){return typeof ir.ResizeObserver!="undefined"?ir.ResizeObserver:ys}(),ft=null,ps=null;wr&&i.addEventListener("resize",function(){ps!==i.devicePixelRatio&&(ps=i.devicePixelRatio,ft=null)});function ws(){if(ft===null){if(typeof document=="undefined")return ft=0;var t=document.body,n=document.createElement("div");n.classList.add("asl_simplebar-hide-scrollbar");t.appendChild(n);var i=n.getBoundingClientRect().right;t.removeChild(n);ft=i}return ft}var r=function(){function t(n,r){var u=this;(this.onScroll=function(){u.scrollXTicking||(i.requestAnimationFrame(u.scrollX),u.scrollXTicking=!0);u.scrollYTicking||(i.requestAnimationFrame(u.scrollY),u.scrollYTicking=!0)},this.scrollX=function(){u.axis.x.isOverflowing&&(u.showScrollbar("x"),u.positionScrollbar("x"));u.scrollXTicking=!1},this.scrollY=function(){u.axis.y.isOverflowing&&(u.showScrollbar("y"),u.positionScrollbar("y"));u.scrollYTicking=!1},this.onMouseEnter=function(){u.showScrollbar("x");u.showScrollbar("y")},this.onMouseMove=function(n){if(u.mouseX=n.clientX,u.mouseY=n.clientY,u.axis.x.isOverflowing||u.axis.x.forceVisible)u.onMouseMoveForAxis("x");if(u.axis.y.isOverflowing||u.axis.y.forceVisible)u.onMouseMoveForAxis("y")},this.onMouseLeave=function(){if(u.onMouseMove.cancel(),u.axis.x.isOverflowing||u.axis.x.forceVisible)u.onMouseLeaveForAxis("x");if(u.axis.y.isOverflowing||u.axis.y.forceVisible)u.onMouseLeaveForAxis("y");u.mouseX=-1;u.mouseY=-1},this.onWindowResize=function(){u.scrollbarWidth=u.getScrollbarWidth();u.hideNativeScrollbar()},this.hideScrollbars=function(){u.axis.x.track.rect=u.axis.x.track.el.getBoundingClientRect();u.axis.y.track.rect=u.axis.y.track.el.getBoundingClientRect();u.isWithinBounds(u.axis.y.track.rect)||(u.axis.y.scrollbar.el.classList.remove(u.classNames.visible),u.axis.y.isVisible=!1);u.isWithinBounds(u.axis.x.track.rect)||(u.axis.x.scrollbar.el.classList.remove(u.classNames.visible),u.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var t,i;if(u.axis.x.track.rect=u.axis.x.track.el.getBoundingClientRect(),u.axis.y.track.rect=u.axis.y.track.el.getBoundingClientRect(),(u.axis.x.isOverflowing||u.axis.x.forceVisible)&&(t=u.isWithinBounds(u.axis.x.track.rect)),(u.axis.y.isOverflowing||u.axis.y.forceVisible)&&(i=u.isWithinBounds(u.axis.y.track.rect)),(t||i)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown")){if(t)if(u.axis.x.scrollbar.rect=u.axis.x.scrollbar.el.getBoundingClientRect(),u.isWithinBounds(u.axis.x.scrollbar.rect))u.onDragStart(n,"x");else u.onTrackClick(n,"x");if(i)if(u.axis.y.scrollbar.rect=u.axis.y.scrollbar.el.getBoundingClientRect(),u.isWithinBounds(u.axis.y.scrollbar.rect))u.onDragStart(n,"y");else u.onTrackClick(n,"y")}},this.drag=function(n){var r,f=u.axis[u.draggedAxis].track,e=f.rect[u.axis[u.draggedAxis].sizeAttr],o=u.axis[u.draggedAxis].scrollbar,s=u.contentWrapperEl[u.axis[u.draggedAxis].scrollSizeAttr],h=parseInt(u.elStyles[u.axis[u.draggedAxis].sizeAttr],10);n.preventDefault();n.stopPropagation();r=u.draggedAxis==="y"?n.pageY:n.pageX;var c=r-f.rect[u.axis[u.draggedAxis].offsetAttr]-u.axis[u.draggedAxis].dragOffset,l=c/(e-o.size),i=l*(s-h);u.draggedAxis==="x"&&(i=u.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i-(e+o.size):i,i=u.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-i:i);u.contentWrapperEl[u.axis[u.draggedAxis].scrollOffsetAttr]=i},this.onEndDrag=function(n){n.preventDefault();n.stopPropagation();u.el.classList.remove(u.classNames.dragging);document.removeEventListener("mousemove",u.drag,!0);document.removeEventListener("mouseup",u.onEndDrag,!0);u.removePreventClickId=i.setTimeout(function(){document.removeEventListener("click",u.preventClick,!0);document.removeEventListener("dblclick",u.preventClick,!0);u.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault();n.stopPropagation()},this.el=n,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,{},r),this.classNames=Object.assign({},t.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el))||(this.recalculate=ko(this.recalculate.bind(this),64),this.onMouseMove=ko(this.onMouseMove.bind(this),64),this.hideScrollbars=ts(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ts(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=sw(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var r=document.createElement("div");r.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"><\/div><\/div>';var n=r.firstElementChild;document.body.appendChild(n);var u=n.firstElementChild;n.scrollLeft=0;var f=t.getOffset(n),i=t.getOffset(u);n.scrollLeft=999;var e=t.getOffset(u);return{isRtlScrollingInverted:f.left!==i.left&&i.left-e.left!=0,isRtlScrollbarInverted:f.left!==i.left}};t.getOffset=function(n){var t=n.getBoundingClientRect();return{top:t.top+(i.pageYOffset||document.documentElement.scrollTop),left:t.left+(i.pageXOffset||document.documentElement.scrollLeft)}};var n=t.prototype;return n.init=function(){t.instances.set(this.el,this);wr&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},n.initDOM=function(){var i=this;if(Array.prototype.filter.call(this.el.children,function(n){return n.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl);this.offsetEl.appendChild(this.contentWrapperEl);this.maskEl.appendChild(this.offsetEl);this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);this.wrapperEl.appendChild(this.maskEl);this.wrapperEl.appendChild(this.placeholderEl);this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var n=document.createElement("div"),t=document.createElement("div");n.classList.add(this.classNames.track);t.classList.add(this.classNames.scrollbar);n.appendChild(t);this.axis.x.track.el=n.cloneNode(!0);this.axis.x.track.el.classList.add(this.classNames.horizontal);this.axis.y.track.el=n.cloneNode(!0);this.axis.y.track.el.classList.add(this.classNames.vertical);this.el.appendChild(this.axis.x.track.el);this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar);this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar);this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible));this.el.setAttribute("data-asl_simplebar","init")},n.initListeners=function(){var n=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.addEventListener("mousemove",this.onMouseMove);this.el.addEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.addEventListener("scroll",this.onScroll);i.addEventListener("resize",this.onWindowResize);var t=!1;this.resizeObserver=new fb(function(){t&&n.recalculate()});this.resizeObserver.observe(this.el);this.resizeObserver.observe(this.contentEl);i.requestAnimationFrame(function(){t=!0});this.mutationObserver=new MutationObserver(this.recalculate);this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},n.recalculate=function(){this.elStyles=i.getComputedStyle(this.el);this.isRtl=this.elStyles.direction==="rtl";var f=this.heightAutoObserverEl.offsetHeight<=1,e=this.heightAutoObserverEl.offsetWidth<=1,t=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,s=this.elStyles.overflowX,h=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft;this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var n=this.contentEl.scrollHeight,r=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=f?"auto":"100%";this.placeholderEl.style.width=e?t+"px":"auto";this.placeholderEl.style.height=n+"px";var u=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=r>t;this.axis.y.isOverflowing=n>u;this.axis.x.isOverflowing=s==="hidden"?!1:this.axis.x.isOverflowing;this.axis.y.isOverflowing=h==="hidden"?!1:this.axis.y.isOverflowing;this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0;this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0;this.hideNativeScrollbar();var c=this.axis.x.isOverflowing?this.scrollbarWidth:0,l=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&r>o-l;this.axis.y.isOverflowing=this.axis.y.isOverflowing&&n>u-c;this.axis.x.scrollbar.size=this.getScrollbarSize("x");this.axis.y.scrollbar.size=this.getScrollbarSize("y");this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px";this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px";this.positionScrollbar("x");this.positionScrollbar("y");this.toggleTrackVisibility("x");this.toggleTrackVisibility("y")},n.getScrollbarSize=function(n){if(n===void 0&&(n="y"),!this.axis[n].isOverflowing)return 0;var r=this.contentEl[this.axis[n].scrollSizeAttr],i=this.axis[n].track.el[this.axis[n].offsetSizeAttr],t,u=i/r;return t=Math.max(~~(u*i),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},n.positionScrollbar=function(n){if(n===void 0&&(n="y"),this.axis[n].isOverflowing){var e=this.contentWrapperEl[this.axis[n].scrollSizeAttr],f=this.axis[n].track.el[this.axis[n].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[n].sizeAttr],10),u=this.axis[n].scrollbar,r=this.contentWrapperEl[this.axis[n].scrollOffsetAttr];r=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-r:r;var s=r/(e-o),i=~~((f-u.size)*s);i=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i+(f-u.size):i;u.el.style.transform=n==="x"?"translate3d("+i+"px, 0, 0)":"translate3d(0, "+i+"px, 0)"}},n.toggleTrackVisibility=function(n){n===void 0&&(n="y");var t=this.axis[n].track.el,i=this.axis[n].scrollbar.el;this.axis[n].isOverflowing||this.axis[n].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[n].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[n].overflowAttr]="hidden");i.style.display=this.axis[n].isOverflowing?"block":"none"},n.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0;this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},n.onMouseMoveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.rect=this.axis[n].track.el.getBoundingClientRect();this.axis[n].scrollbar.rect=this.axis[n].scrollbar.el.getBoundingClientRect();var t=this.isWithinBounds(this.axis[n].scrollbar.rect);t?this.axis[n].scrollbar.el.classList.add(this.classNames.hover):this.axis[n].scrollbar.el.classList.remove(this.classNames.hover);this.isWithinBounds(this.axis[n].track.rect)?(this.showScrollbar(n),this.axis[n].track.el.classList.add(this.classNames.hover)):this.axis[n].track.el.classList.remove(this.classNames.hover)},n.onMouseLeaveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.el.classList.remove(this.classNames.hover);this.axis[n].scrollbar.el.classList.remove(this.classNames.hover)},n.showScrollbar=function(n){n===void 0&&(n="y");var t=this.axis[n].scrollbar.el;this.axis[n].isVisible||(t.classList.add(this.classNames.visible),this.axis[n].isVisible=!0);this.options.autoHide&&this.hideScrollbars()},n.onDragStart=function(n,t){t===void 0&&(t="y");var r=this.axis[t].scrollbar,u=t==="y"?n.pageY:n.pageX;this.axis[t].dragOffset=u-r.rect[this.axis[t].offsetAttr];this.draggedAxis=t;this.el.classList.add(this.classNames.dragging);document.addEventListener("mousemove",this.drag,!0);document.addEventListener("mouseup",this.onEndDrag,!0);this.removePreventClickId===null?(document.addEventListener("click",this.preventClick,!0),document.addEventListener("dblclick",this.preventClick,!0)):(i.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},n.onTrackClick=function(n,t){var u=this;t===void 0&&(t="y");this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var l=this.axis[t].scrollbar,e=l.rect[this.axis[t].offsetAttr],o=parseInt(this.elStyles[this.axis[t].sizeAttr],10),r=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],a=t==="y"?this.mouseY-e:this.mouseX-e,s=a<0?-1:1,h=s===-1?r-o:r+o,c=40,f=function f(){if(s===-1){if(r>h){var n;r-=c;u.contentWrapperEl.scrollTo((n={},n[u.axis[t].offsetAttr]=r,n));i.requestAnimationFrame(f)}}else if(r<h){var e;r+=c;u.contentWrapperEl.scrollTo((e={},e[u.axis[t].offsetAttr]=r,e));i.requestAnimationFrame(f)}};f()},n.getContentElement=function(){return this.contentEl},n.getScrollElement=function(){return this.contentWrapperEl},n.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style?0:ws()}catch(n){return ws()}},n.removeListeners=function(){var n=this;this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.removeEventListener("mousemove",this.onMouseMove);this.el.removeEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.removeEventListener("scroll",this.onScroll);i.removeEventListener("resize",this.onWindowResize);this.mutationObserver.disconnect();this.resizeObserver.disconnect();this.recalculate.cancel();this.onMouseMove.cancel();this.hideScrollbars.cancel();this.onWindowResize.cancel()},n.unMount=function(){this.removeListeners();t.instances.delete(this.el)},n.isWithinBounds=function(n){return this.mouseX>=n.left&&this.mouseX<=n.left+n.width&&this.mouseY>=n.top&&this.mouseY<=n.top+n.height},n.findChild=function(n,t){var i=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return Array.prototype.filter.call(n.children,function(n){return i.call(n,t)})[0]},t}();r.defaultOptions={autoHide:!0,forceVisible:!1,classNames:{contentEl:"asl_simplebar-content",contentWrapper:"asl_simplebar-content-wrapper",offset:"asl_simplebar-offset",mask:"asl_simplebar-mask",wrapper:"asl_simplebar-wrapper",placeholder:"asl_simplebar-placeholder",scrollbar:"asl_simplebar-scrollbar",track:"asl_simplebar-track",heightAutoObserverWrapperEl:"asl_simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"asl_simplebar-height-auto-observer",visible:"asl_simplebar-visible",horizontal:"asl_simplebar-horizontal",vertical:"asl_simplebar-vertical",hover:"asl_simplebar-hover",dragging:"asl_simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};r.instances=new WeakMap;var bs=function(n){return function(t,i,r,u){te(i);var o=ei(t),e=bt(o),s=ui(o.length),f=n?s-1:0,h=n?-1:1;if(r<2)while(!0){if(f in e){u=e[f];f+=h;break}if(f+=h,n?f<0:s<=f)throw TypeError("Reduce of empty array with no initial value");}for(;n?f>=0:s>f;f+=h)f in e&&(u=i(u,e[f],f,o));return u}},eb={left:bs(!1),right:bs(!0)},ob=eb.left;a({target:"Array",proto:!0,forced:oe("reduce")},{reduce:function(n){return ob(this,n,arguments.length,arguments.length>1?arguments[1]:undefined)}});var sb=d.f,nf=Function.prototype,hb=nf.toString,cb=/^\s*function ([^ (]*)/,ks="name";!v||ks in nf||sb(nf,ks,{configurable:!0,get:function(){try{return hb.call(this).match(cb)[1]}catch(n){return""}}});var lb=function(){var t=h(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n},fr=RegExp.prototype.exec,ab=String.prototype.replace,ds=fr,tf=function(){var n=/a/,t=/b*/g;return fr.call(n,"a"),fr.call(t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),rf=/()??/.exec("")[1]!==undefined,vb=tf||rf;vb&&(ds=function(n){var i=this,u,f,t,r;return rf&&(f=new RegExp("^"+i.source+"$(?!\\s)",lb.call(i))),tf&&(u=i.lastIndex),t=fr.call(i,n),tf&&t&&(i.lastIndex=i.global?t.index+t[0].length:u),rf&&t&&t.length>1&&ab.call(t[0],f,function(){for(r=1;r<arguments.length-2;r++)arguments[r]===undefined&&(t[r]=undefined)}),t});var uf=ds;a({target:"RegExp",proto:!0,forced:/./.exec!==uf},{exec:uf});var ck=o("species"),lk=!f(function(){var n=/./;return n.exec=function(){var n=[];return n.groups={a:"7"},n},"".replace(n,"$<a>")!=="7"}),ak=!f(function(){var n=/(?:)/,i=n.exec;n.exec=function(){return i.apply(this,arguments)};var t="ab".split(n);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),yb=uo.charAt,vk=function(n,t,i){return t+(i?yb(n,t).length:1)},yk=function(n,t){var i=n.exec;if(typeof i=="function"){var r=i.call(n,t);if(typeof r!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return r}if(k(n)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return uf.call(n,t)},pk=Math.max,wk=Math.min,bk=Math.floor,kk=function(n){return n===undefined?n:String(n)},er=function(n){return Array.prototype.reduce.call(n,function(n,t){var r=t.name.match(/data-asl_simplebar-(.+)/);if(r){var i=r[1].replace(/\W+(.)/g,function(n,t){return t.toUpperCase()});switch(t.value){case"true":n[i]=!0;break;case"false":n[i]=!1;break;case undefined:n[i]=!0;break;default:n[i]=t.value}}return n},{})};return r.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements);i.removeEventListener("load",this.initDOMLoadedElements);Array.prototype.forEach.call(document.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){r.instances.has(n)||new r(n,er(n.attributes))})},r.removeObserver=function(){this.globalObserver.disconnect()},r.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this);typeof MutationObserver!="undefined"&&(this.globalObserver=new MutationObserver(r.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0}));document.readyState!=="complete"&&(document.readyState==="loading"||document.documentElement.doScroll)?(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),i.addEventListener("load",this.initDOMLoadedElements)):i.setTimeout(this.initDOMLoadedElements)},r.handleMutations=function(n){n.forEach(function(n){Array.prototype.forEach.call(n.addedNodes,function(n){n.nodeType===1&&(n.hasAttribute("data-asl_simplebar")?r.instances.has(n)||new r(n,er(n.attributes)):Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){r.instances.has(n)||new r(n,er(n.attributes))}))});Array.prototype.forEach.call(n.removedNodes,function(n){n.nodeType===1&&(n.hasAttribute('[data-asl_simplebar="init"]')?r.instances.has(n)&&r.instances.get(n).unMount():Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar="init"]'),function(n){r.instances.has(n)&&r.instances.get(n).unMount()}))})})},r.getOptions=er,wr&&r.initHtmlApi(),r})}(asljQuery,asljQuery,window),function(n,t,i){
3
  /*! Ajax Search Lite 4.6 js */
4
- (function(t){var r,a=!0,c={init:function(n,i){var r=this;this.elem=i;this.$elem=t(i);r.searching=!1;r.o=t.extend({blocking:!1},n);r.n={};r.n.container=t(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=t(".probox",r.n.container);r.n.proinput=t(".proinput",r.n.container);r.n.text=t(".proinput input.orig",r.n.container);r.n.textAutocomplete=t(".proinput input.autocomplete",r.n.container);r.n.loading=t(".proinput .loading",r.n.container);r.n.proloading=t(".proloading",r.n.container);r.n.proclose=t(".proclose",r.n.container);r.n.promagnifier=t(".promagnifier",r.n.container);r.n.prosettings=t(".prosettings",r.n.container);r.n.searchsettings=t("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=t("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=t("#asl_hidden_data");r.n.aslItemOverlay=t(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=t(".showmore",r.n.resultsDiv);r.n.items=t(".item",r.n.resultsDiv);r.n.results=t(".results",r.n.resultsDiv);r.n.resdrg=t(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.firstClick=!0;r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.savedScrollTop=0;r.savedContainerTop=0;r.is_scroll=typeof asl_SimpleBar!="undefined";typeof ASL.scrollbar!="undefined"&&ASL.scrollbar==0&&(r.is_scroll=!1);r.settScroll=null;r.n.resultsAppend=t("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.lastSuccesfulSearch="";r.lastSearchData={};r.triggerPrevState=!1;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var n=t(this).parent();!n.hasClass("isotopic");)n=n.parent();var i=t(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),typeof ASL.resHTML=="undefined"&&(ASL.resHTML=r.n.resultsDiv.html()),typeof ASL.setHTML=="undefined"&&(ASL.setHTML=r.n.searchsettings.html()),t("fieldset",r.n.searchsettings).each(function(){t(".asl_option:not(.hiddend)",this).last().addClass("asl-o-last")}),ASL.js_retain_popstate==1&&r.initPrevState(),y()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),r.initAutop(),r.initEtc(),this},initPrevState:function(){var n=this;a&&r==null&&(r=localStorage.getItem("asl-"+u.encode(location.href)),r!=null&&(r=JSON.parse(r),r.settings=u.decode(r.settings)));r!=null&&typeof r.id!="undefined"&&r.id==n.o.id&&(r.phrase!=""&&(n.triggerPrevState=!0,n.n.text.val(r.phrase)),h(t("form",n.n.searchsettings))!=r.settings&&(n.triggerPrevState=!0,h(t("form",n.n.searchsettings),r.settings)));localStorage.removeItem("asl-"+u.encode(location.href));n.n.resultsDiv.on("click",".results .item",function(){var i=n.n.text.val();if(i!=""||n.settingsChanged){var r={id:n.o.id,phrase:i,settings:u.encode(h(t("form",n.n.searchsettings)))};localStorage.setItem("asl-"+u.encode(location.href),JSON.stringify(r))}})},duplicateCheck:function(){var i=this,n={};t("div[id*=ajaxsearchlite]").each(function(){n.hasOwnProperty(this.id)?t(this).remove():n[this.id]="true"})},gaPageview:function(n){var u=this,t=u.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="pageview")return!1;if(ASL.analytics.string!=""){var r=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1,f=typeof gtag=="function"?gtag:!1;i.location.origin||(i.location.origin=i.location.protocol+"//"+i.location.hostname+(i.location.port?":"+i.location.port:""));var e=u.o.homeurl.replace(i.location.origin,"");f!==!1?t!==!1&&f("config",t,{page_path:e+ASL.analytics.string.replace("{asl_term}",n)}):r!==!1&&(t!==!1&&r("create",t,"auto"),r("send","pageview",{page:e+ASL.analytics.string.replace("{asl_term}",n),title:"Ajax Search"}))}},gaEvent:function(n,i){var u=this,f=u.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="event")return!1;var e=typeof gtag=="function"?gtag:!1,o=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1;if(e===!1&&o===!1)return!1;if(typeof ASL.analytics.event[n]!="undefined"&&ASL.analytics.event[n].active==1&&typeof"gtag"!="undefined"){var s={search_id:u.o.id,search_name:u.o.name,phrase:u.n.text.val(),option_name:"",option_value:"",result_title:"",result_url:"",results_count:""},r={event_category:ASL.analytics.event[n].category,event_label:ASL.analytics.event[n].label,value:ASL.analytics.event[n].value};i=t.extend(s,i);t.each(i,function(n,i){i=String(i).replace(/[\s\n\r]+/g," ").trim();t.each(r,function(t,u){var f=new RegExp("{"+n+"}","gmi");r[t]=u.replace(f,i)})});e===!1?(f!==!1&&o("create",f,"auto"),o("send","event",r.event_category,ASL.analytics.event[n].action,r.event_label,r.value)):(f!==!1&&(r.send_to=f),e("event",ASL.analytics.event[n].action,r))}},gaGetTrackingID:function(){var r=this,n=!1;if(typeof ASL.analytics=="undefined")return n;if(typeof ASL.analytics.tracking_id!="undefined"&&ASL.analytics.tracking_id!="")return ASL.analytics.tracking_id;var i=typeof gtag=="function"?gtag:!1;if(i!==!1&&typeof ga!="undefined"&&typeof ga.getAll!="undefined"){var t=!1;return ga.getAll().forEach(function(n){t=n.get("trackingId")}),t}return n},createVerticalScroll:function(){var n=this;n.is_scroll&&typeof n.scroll.recalculate=="undefined"&&(n.scroll=new asl_SimpleBar(n.n.results.get(0),{direction:t("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0}))},initEvents:function(){var r=this;if(f()&&s())r.n.text.on("touchstart",function(){r.savedScrollTop=t(i).scrollTop();r.savedContainerTop=r.n.container.offset().top});r.n.text.click(function(){t(this).focus();r.gaEvent("focus")});r.n.text.on("focus input",function(){r.searching||(t(this).val()!=""?r.n.proclose.css("display","block"):r.n.proclose.css({display:"none"}))});t(r.n.text.parent()).submit(function(t){if(t.preventDefault(),f())if(r.o.redirect_on_enter){var i=n.Event("keyup");i.keyCode=i.which=13;r.n.text.trigger(i)}else r.o.redirectEnterTo=="ajax_search"&&(r.search(),document.activeElement.blur());else r.o.redirectEnterTo=="ajax_search"&&r.search()});r.n.text.click(function(){r.firstClick&&(t(this).val(""),r.firstClick=!1)});r.n.resultsDiv.css({opacity:0});t(document).bind("click touchend",function(){(r.hideSettings(),r.opened!=!1&&r.o.closeOnDocClick==1)&&r.hideResults()});r.n.proclose.on("click touchend",function(){r.n.text.val("");r.n.textAutocomplete.val("");r.hideResults();r.n.text.focus()});t(r.elem).bind("click touchend",function(n){n.stopImmediatePropagation()});r.n.resultsDiv.bind("click touchend",function(n){n.stopImmediatePropagation()});r.n.searchsettings.bind("click touchend",function(n){n.stopImmediatePropagation()});r.n.prosettings.on("click",function(){r.n.prosettings.data("opened")==0?r.showSettings():r.hideSettings()});var o=r.n.container.parents().filter(function(){return t(this).css("position")=="fixed"});if((o.length>0||r.n.container.css("position")=="fixed")&&(r.n.resultsDiv.css("position")=="absolute"&&r.n.resultsDiv.css("position","fixed"),r.n.resultsDiv.css("z-index",99999999999),r.o.blocking||r.n.searchsettings.css("position","fixed")),f())t(i).on("orientationchange",function(){r.orientationChange();setTimeout(function(){r.orientationChange()},800)});else{var u;t(i).on("resize",function(){clearTimeout(u);u=setTimeout(function(){r.resize()},100)})}var e;t(i).on("scroll",function(){clearTimeout(e);e=setTimeout(function(){r.scrolling(!1)},400)});s()&&f()&&v()&&parseInt(r.n.text.css("font-size"))<16&&(r.n.text.data("fontSize",r.n.text.css("font-size")).css("font-size","16px"),r.n.textAutocomplete.css("font-size","16px"),t("<style>#ajaxsearchlite"+r.o.rid+" input.orig::-webkit-input-placeholder{font-size: 16px !important;}<\/style>").appendTo("head"));r.initNavigationEvent();r.initMagnifierEvent();r.initAutocompleteEvent();r.initFacetEvents()},initAutop:function(){var n=this;if(r!=null&&n.triggerPrevState)return n.search(),r=null,!1},initEtc:function(){var n=this,i=null;t("div.asl_option",n.n.searchsettings).on("mouseup touchend",function(r){if(r.preventDefault(),r.stopImmediatePropagation(),n.dragging)return!1;t('input[type="checkbox"]',this).prop("checked",!t('input[type="checkbox"]',this).prop("checked"));clearTimeout(i);var u=this;i=setTimeout(function(){t('input[type="checkbox"]',u).trigger("asl_chbx_change")},50)});t("div.asl_option label",n.n.searchsettings).click(function(n){n.preventDefault()});n.n.resultsDiv.on("click",".results .item",function(){n.gaEvent("result_click",{result_title:t(this).find("a.asl_res_url").text(),result_url:t(this).find("a.asl_res_url").attr("href")})})},initNavigationEvent:function(){var n=this;t(n.n.resultsDiv).on("mouseenter",".item",function(){t(".item",n.n.resultsDiv).removeClass("hovered");t(this).addClass("hovered")});t(n.n.resultsDiv).on("mouseleave",".item",function(){t(".item",n.n.resultsDiv).removeClass("hovered")});t(document).keydown(function(r){if(i.event)var u=i.event.keyCode,o=i.event.type;else if(r)var u=r.which,o=r.type;if(t(".item",n.n.resultsDiv).length>0&&n.n.resultsDiv.css("display")!="none"){if(u==40||u==38){u==40&&(n.n.text.blur(),t(".item.hovered",n.n.resultsDiv).length==0?t(".item",n.n.resultsDiv).first().addClass("hovered"):t(".item.hovered",n.n.resultsDiv).removeClass("hovered").next(".item").addClass("hovered"));u==38&&(n.n.text.blur(),t(".item.hovered",n.n.resultsDiv).length==0?t(".item",n.n.resultsDiv).last().addClass("hovered"):t(".item.hovered",n.n.resultsDiv).removeClass("hovered").prev(".item").addClass("hovered"));r.stopPropagation();r.preventDefault();var f=n.is_scroll?t(n.scroll.getScrollElement()):n.n.results,e=n.n.resultsDiv.find(".resdrg .item.hovered");e.length==0&&(e=n.n.resultsDiv.children().first());f.animate({scrollTop:e.offset().top-f.offset().top+f.scrollTop()},{duration:120})}u==13&&t(".item.hovered",n.n.resultsDiv).length>0&&(r.stopPropagation(),r.preventDefault(),t(".item.hovered a.asl_res_url",n.n.resultsDiv).get(0).click())}})},initMagnifierEvent:function(){var n=this,r,f,u=!1;n.n.text.on("keyup",function(e){if(i.event?(n.keycode=i.event.keyCode,n.ktype=i.event.type):e&&(n.keycode=e.which,n.ktype=e.type),n.keycode==13){if(clearTimeout(f),f=setTimeout(function(){u=!1},300),u)return!1;u=!0}var o=t(this).hasClass("orig");if(n.n.text.val().length>=n.o.charcount&&o&&n.ktype=="keyup"&&n.keycode==13){if(n.gaEvent("return"),n.o.redirect_on_enter==1)n.o.redirectEnterTo!="first_result"?n.doRedirectToResults(n.ktype):n.search();else{if(n.o.redirectEnterTo=="nothing")return!1;t("form",n.n.searchsettings).serialize()+n.n.text.val().trim()==n.lastSuccesfulSearch&&n.resultsOpened||n.search()}clearTimeout(r)}});n.n.promagnifier.add(n.n.text).bind("click input",function(u){i.event?(n.keycode=i.event.keyCode,n.ktype=i.event.type):u&&(n.keycode=u.which,n.ktype=u.type);var f=t(this).hasClass("orig");if(n.n.text.val().length<n.o.charcount){n.n.proloading.css("display","none");n.hideResults();n.post!=null&&n.post.abort();clearTimeout(r);return}if(n.n.text.val().length>=n.o.charcount&&!f&&n.o.redirectonclick==1&&n.ktype=="click"&&n.o.redirectClickTo!="first_result"){n.doRedirectToResults(n.ktype);clearTimeout(r);return}if((!(n.keycode>=37)||!(n.keycode<=40))&&(!(n.keycode>=112)||!(n.keycode<=123))){if(f&&n.ktype=="click"||n.keycode==32){t("form",n.n.searchsettings).serialize()+n.n.text.val().trim()==n.lastSuccesfulSearch&&(n.n.proclose.css("display","block"),n.resultsOpened||n.showResults());return}t(this).hasClass("orig")&&n.ktype=="click"||(f||n.ktype!="click"||n.gaEvent("magnifier"),n.o.trigger_on_click!=0||n.ktype!="click")&&(n.o.triggerontype!=0||n.ktype!="input")&&(!f||n.ktype!="input"||n.o.redirectEnterTo!="nothing")&&(f||n.ktype!="click"||n.o.redirectClickTo!="nothing")&&(n.post!=null&&n.post.abort(),clearTimeout(r),n.hideLoader(),r=setTimeout(function(){if(t("form",n.n.searchsettings).serialize()+n.n.text.val().trim()!=n.lastSuccesfulSearch)n.search();else{if(n.n.proclose.css("display","block"),n.isRedirectToFirstResult())return n.doRedirectToFirstResult(),!1;n.resultsOpened||n.showResults()}},250))}})},initFacetEvents:function(){var n=this,i=null;if(n.o.trigger_on_facet_change==1){t("input[type!=checkbox], select",n.n.searchsettings).on("change slidechange",function(){n.n.text.val().length<n.o.charcount||(n.post!=null&&n.post.abort(),clearTimeout(i),i=setTimeout(function(){n.search()},50))});t("input[type=checkbox]",n.n.searchsettings).on("asl_chbx_change",function(){n.n.text.val().length<n.o.charcount||(n.post!=null&&n.post.abort(),n.gaEvent("facet_change",{option_label:t(this).closest("fieldset").find("legend").text(),option_value:t(this).closest(".asl_option").find(".asl_option_label").text()+(t(this).prop("checked")?"(checked)":"(unchecked)")}),clearTimeout(i),i=setTimeout(function(){n.search()},50))})}},isRedirectToFirstResult:function(){var n=this;return t(".asl_res_url",n.n.resultsDiv).length>0&&(n.o.redirectonclick==1&&n.ktype=="click"&&n.o.redirectClickTo=="first_result"||n.o.redirect_on_enter==1&&(n.ktype=="input"||n.ktype=="keyup")&&n.keycode==13&&n.o.redirectEnterTo=="first_result")?!0:!1},doRedirectToFirstResult:function(){var n=this,i;return i=n.ktype=="click"?n.o.redirectClickLoc:n.o.redirectEnterLoc,i=="same"?location.href=t(t(".asl_res_url",n.n.resultsDiv).get(0)).attr("href"):l(t(t(".asl_res_url",n.n.resultsDiv).get(0)).attr("href")),n.hideLoader(),n.hideResults(),!1},doRedirectToResults:function(n){var i=this,s=i.ktype=="click"?i.o.redirectClickTo:i.o.redirectEnterTo,r=n=="click"?i.o.redirectClickLoc:i.o.redirectEnterLoc;if(s=="results_page")var f="?s="+e(i.n.text.val());else if(s=="woo_results_page")var f="?post_type=product&s="+e(i.n.text.val());else var f=i.o.redirect_url.replace("{phrase}",e(i.n.text.val()));if(i.o.overridewpdefault)if(i.o.override_method=="post")o(i.o.homeurl+f,"post",{asl_active:1,p_asl_data:t("form",i.n.searchsettings).serialize()},r);else{var h=i.o.homeurl+f+"&asl_active=1&p_asid="+i.o.id+"&p_asl_data="+u.encode(t("form",i.n.searchsettings).serialize());r=="same"?location.href=h:l(h)}else o(i.o.homeurl+f,"post",{np_asl_data:t("form",i.n.searchsettings).serialize()},r);i.n.proloading.css("display","none");i.hideLoader();i.hideResults();i.post!=null&&i.post.abort()},destroy:function(){return this.each(function(){var n=t.extend({},this,c);t(i).unbind(n)})},searchfor:function(n){t(".proinput input",this).val(n).trigger("keyup")},initAutocompleteEvent:function(){var n=this;n.o.autocomplete.enabled!=1||f()||n.n.text.keyup(function(r){i.event?(n.keycode=i.event.keyCode,n.ktype=i.event.type):r&&(n.keycode=r.which,n.ktype=r.type);var u=39;t("body").hasClass("rtl")&&(u=37);n.keycode==u&&n.n.textAutocomplete.val()!=""?(r.preventDefault(),n.n.text.val(n.n.textAutocomplete.val()),n.post!=null&&n.post.abort(),n.search()):(n.postAuto!=null&&n.postAuto.abort(),n.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var n=this,i=n.n.text.val();if(n.n.text.val()==""){n.n.textAutocomplete.val("");return}var r=n.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(n.n.textAutocomplete.val(""),t.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:n.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=t("<textarea />").html(response).text(),response=response.substr(i.length),n.n.textAutocomplete.val(i+response))}}))},search:function(){var n=this;if((!n.searching||!0)&&!(n.n.text.val().length<n.o.charcount)){n.searching=!0;n.n.proloading.css({display:"block"});n.n.proclose.css({display:"none"});var i={action:"ajaxsearchlite_search",aslp:n.n.text.val(),asid:n.o.id,options:t("form",n.n.searchsettings).serialize()};if(JSON.stringify(i)===JSON.stringify(n.lastSearchData))return(n.resultsOpened||n.showResults(),n.hideLoader(),n.isRedirectToFirstResult())?(n.doRedirectToFirstResult(),!1):!1;n.gaEvent("search_start");n.post=t.post(ASL.ajaxurl,i,function(r){if(r=r.replace(/^\s*[\r\n]/gm,""),r=r.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1],n.n.resdrg.html(""),n.n.resdrg.html(r),t(".asl_keyword",n.n.resdrg).bind("click",function(){n.n.text.val(t(this).html());t("input.orig",n.n.container).val(t(this).html()).keydown();t("form",n.n.container).trigger("submit","ajax");n.search()}),n.n.items=t(".item",n.n.resultsDiv),n.gaEvent("search_end",{results_count:n.n.items.length}),n.gaPageview(n.n.text.val()),n.isRedirectToFirstResult())return n.doRedirectToFirstResult(),!1;if(n.hideLoader(),n.showResults(),n.scrollToResults(),n.lastSuccesfulSearch=t("form",n.n.searchsettings).serialize()+n.n.text.val().trim(),n.lastSearchData=i,n.n.items.length==0)n.n.showmore!=null&&n.n.showmore.css("display","none");else if(n.n.showmore!=null){n.n.showmore.css("display","block");t("a",n.n.showmore).off();t("a",n.n.showmore).on("click",function(){var r=n.o.redirectClickTo,i="?s="+e(n.n.text.val());i=r=="results_page"?"?s="+e(n.n.text.val()):r=="woo_results_page"?"?post_type=product&s="+e(n.n.text.val()):n.o.redirect_url.replace("{phrase}",e(n.n.text.val()));n.o.overridewpdefault?n.o.override_method=="post"?o(n.o.homeurl+i,"post",{asl_active:1,p_asl_data:t("form",n.n.searchsettings).serialize()}):location.href=n.o.homeurl+i+"&asl_active=1&p_asid="+n.o.id+"&p_asl_data="+u.encode(t("form",n.n.searchsettings).serialize()):o(n.o.homeurl+i,"post",{np_asl_data:t("form",n.n.searchsettings).serialize()})})}},"text").fail(function(i,r){i.aborted||r=="abort"||(n.n.resdrg.html(""),n.n.resdrg.html('<div class="asl_nores">The request failed. Please check your connection! Status: '+i.status+"<\/div>"),n.n.items=t(".item",n.n.resultsDiv),n.hideLoader(),n.showResults(),n.scrollToResults())})}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.fixResultsPosition(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;n.createVerticalScroll();switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));n.is_scroll&&typeof n.scroll.recalculate!="undefined"&&setTimeout(function(){n.scroll.recalculate()},500);n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});f()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var n=$this.n.probox.offset().top-20;else var n=$this.n.resultsDiv.offset().top-20;t("#wpadminbar").length>0&&(n-=t("#wpadminbar").height());n=n<0?0:n;t("body, html").animate({scrollTop:n},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var n=this;if(n.showResultsBox(),n.n.items.length>0){var e=n.n.items.length<n.o.itemscount?n.n.items.length:n.o.itemscount,h=t(".group",n.n.resultsDiv);if(n.n.items.length<=n.o.itemscount)n.n.results.css({height:"auto"});else{n.n.results.css({height:30});n.resize();var i=0,r=0,u=0,f=0;n.n.items.each(function(){r+=t(this).outerHeight(!0);t(this).outerHeight(!0)>f&&(f=t(this).outerHeight(!0));i++});u=f*e;u>r&&(u=r);i=i<1?1:i;r=r/i*e;n.n.results.css({height:u})}if(n.resize(),n.n.items.last().addClass("asl_last_item"),n.o.highlight==1){var o=n.o.highlightwholewords==1?!0:!1;t("div.item",n.n.resultsDiv).highlight(n.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:o})}}n.resize();n.n.items.length==0&&n.n.results.css({height:"auto"});n.n.results.css({overflowY:"auto"});var s=n.is_scroll?t(n.scroll.getScrollElement()):n.n.results;s.scrollTop(0);n.addAnimation();n.fixResultsPosition(!0);n.searching=!1},addAnimation:function(){var i=this,n=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){t(u).addClass(i.animation)},n);n=n+60;r++})},removeAnimation:function(){var n=this;n.n.items.each(function(){var i=this;t(i).removeClass(n.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var n=this;n.n.searchsettings.css(n.settAnim.showCSS);n.n.searchsettings.removeClass(n.settAnim.hideClass).addClass(n.settAnim.showClass);n.settScroll==null&&n.is_scroll&&(n.settScroll=[],t(".asl_sett_scroll",n.n.searchsettings).each(function(i){var r=this;setTimeout(function(){n.settScroll[i]=new asl_SimpleBar(t(r).get(0),{direction:t("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0})},20)}));n.n.prosettings.data("opened",1);n.fixSettingsPosition(!0)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var n=this;t(".searchsettings",n.n.container).length>0&&(t("body>#ajaxsearchlitesettings"+n.o.rid).remove(),t("body>#ajaxsearchliteres"+n.o.rid).remove())},orientationChange:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},resize:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},scrolling:function(n){var t=this;t.fixSettingsPosition(n);t.fixResultsPosition(n)},fixTryThisPosition:function(){},fixResultsPosition:function(n){n=typeof n=="undefined"?!1:n;var i=this,u=i.n.resultsDiv.css("position");if(u=="fixed"||u=="absolute"){var e=0;if(t("body").css("position")!="static"&&(e=t("body").offset().top),n==!0||i.n.resultsDiv.css("visibility")=="visible"){var o=0,h=0,r=i.n.container.offset();if(u=="fixed"&&(e=0,o=t(document).scrollTop(),h=t(document).scrollLeft(),f()&&s()&&i.n.text.is(":focus")&&(o=i.savedScrollTop,r.top=i.savedContainerTop)),typeof r!="undefined"){var c=i.n.container.outerWidth()<240?240:i.n.container.outerWidth();i.n.resultsDiv.outerWidth(c);i.n.resultsDiv.css({top:r.top+i.n.container.outerHeight(!0)+10-e-o,left:r.left-h})}}}},fixSettingsPosition:function(n){n=typeof n=="undefined"?!1:n;var r=this,h=0;if(t("body").css("position")!="static"&&(h=t("body").offset().top),(n==!0||r.n.prosettings.data("opened")!=0)&&r.o.blocking!=!0){if(r.fixSettingsWidth(),r.n.prosettings.css("display")!="none")var e=r.n.prosettings;else var e=r.n.promagnifier;var u=e.offset(),o=0,c=0;r.n.searchsettings.css("position")=="fixed"&&(o=t(i).scrollTop(),c=t(i).scrollLeft(),f()&&s()&&r.n.text.is(":focus")&&(u.top=r.savedContainerTop,o=r.savedScrollTop));r.o.settingsimagepos=="left"?r.n.searchsettings.css({display:"block",top:u.top+e.height()-2-h-o,left:u.left-c}):r.n.searchsettings.css({display:"block",top:u.top+e.height()-2-h-o,left:u.left+e.width()-r.n.searchsettings.width()-c})}},fixSettingsWidth:function(){}};function v(){return!("ontouchstart"in i)?0:1}function f(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function h(n,i){var r=n.find(":input").get();return arguments.length===1?(i={},t.each(r,function(){!this.name||this.disabled||!(this.checked||/select|textarea/i.test(this.nodeName)||/text/i.test(this.type))||t(this).hasClass("asp_datepicker_field")||t(this).hasClass("asp_datepicker")||(i[this.name]==undefined&&(i[this.name]=[]),i[this.name].push(t(this).val()))}),JSON.stringify(i)):(typeof i!="object"&&(i=JSON.parse(i)),t.each(r,function(){if(this.name&&i[this.name]){var n=i[this.name],r=t(this);if(Object.prototype.toString.call(n)!=="[object Array]"&&(n=[n]),this.type=="checkbox"||this.type=="radio"){for(var e=r.val(),f=!1,u=0;u<n.length;u++)if(n[u]==e){f=!0;break}r.attr("checked",f)}else r.val(n[0])}}),n)}function e(n){return encodeURIComponent(n).replace(/\%20/g,"+")}function o(n,i,r,u){"use strict";var f;f=t("<form />",{action:n,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&t.each(r,function(n,i){t("<input />",{type:"hidden",name:n,value:i}).appendTo(f)});typeof u!="undefined"&&u=="new"&&f.attr("target","_blank");f.appendTo("body").submit()}function l(n){t('<a href="'+n+'" target="_blank">').get(0).click()}function s(){return typeof i.navigator!="undefined"&&typeof i.navigator.userAgent!="undefined"?i.navigator.userAgent.match(/(iPod|iPhone|iPad)/)!=null:!1}function y(){var n=i.navigator.userAgent,t=n.indexOf("MSIE ");return t>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});t.plugin=function(n,i){t.fn[n]=function(r){return this.each(function(){t.data(this,n)||t.data(this,n,Object.create(i).init(r,this))})}};t.plugin("ajaxsearchlite",c);var u={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(n){var e="",o,t,i,h,c,s,r,f=0;for(n=u._utf8_encode(n);f<n.length;)o=n.charCodeAt(f++),t=n.charCodeAt(f++),i=n.charCodeAt(f++),h=o>>2,c=(o&3)<<4|t>>4,s=(t&15)<<2|i>>6,r=i&63,isNaN(t)?s=r=64:isNaN(i)&&(r=64),e=e+this._keyStr.charAt(h)+this._keyStr.charAt(c)+this._keyStr.charAt(s)+this._keyStr.charAt(r);return e},decode:function(n){var t="",o,s,h,c,f,r,e,i=0;for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)c=this._keyStr.indexOf(n.charAt(i++)),f=this._keyStr.indexOf(n.charAt(i++)),r=this._keyStr.indexOf(n.charAt(i++)),e=this._keyStr.indexOf(n.charAt(i++)),o=c<<2|f>>4,s=(f&15)<<4|r>>2,h=(r&3)<<6|e,t=t+String.fromCharCode(o),r!=64&&(t=t+String.fromCharCode(s)),e!=64&&(t=t+String.fromCharCode(h));return u._utf8_decode(t)},_utf8_encode:function(n){n=n.replace(/\r\n/g,"\n");for(var i="",r=0;r<n.length;r++){var t=n.charCodeAt(r);t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128))}return i},_utf8_decode:function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}}})(n)}(asljQuery,asljQuery,window),function(n,t,i){i.ASL=i.ASL||{};i.ASL.getScope=function(){if(typeof n!="undefined")if(typeof n.fn.ajaxsearchlite=="undefined")for(var t=n,r=n,u=0;u<10;u++)if(typeof t.fn.ajaxsearchlite=="undefined")t=n.noConflict(!0);else return t.fn.jquery!=r.fn.jquery&&(i.jQuery=i.$=r),t;else return n;return typeof i[ASL.js_scope]!="undefined"?i[ASL.js_scope]:eval(ASL.js_scope)};i.ASL.initialized=!1;i.ASL.initialize=function(n){var i=this;if(typeof i.getScope=="undefined")return!1;var t=i.getScope(),r=".asl_init_data";if(typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0)t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))});else{typeof n!="undefined"&&(r="div[id*=asl_init_id_"+n+"]");function u(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}function f(n){var t="",s,h,c,l,e,r,o,i=0,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)l=f.indexOf(n.charAt(i++)),e=f.indexOf(n.charAt(i++)),r=f.indexOf(n.charAt(i++)),o=f.indexOf(n.charAt(i++)),s=l<<2|e>>4,h=(e&15)<<4|r>>2,c=(r&3)<<6|o,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(h)),o!=64&&(t=t+String.fromCharCode(c));return u(t)}t(r).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).data("asldata");if(typeof n=="undefined"||(n=f(n),typeof n=="undefined"||n==""))return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).addClass("hasASL"),t("#ajaxsearchlite"+i).ajaxsearchlite(r)})}i.initialized=!0};i.ASL.fixClones=function(){var t=this;if((t.fix_duplicates=t.fix_duplicates||0,t.fix_duplicates==0)||typeof t.getScope=="undefined")return!1;var n=t.getScope(),i={};n(".asl_init_data").each(function(){var t=n(this).attr("id").match(/^asl_init_id_(.*)/)[1];typeof i[t]=="undefined"?i[t]={rid:t,id:t,count:1}:i[t].count++});n.each(i,function(i,r){r.count>1&&n(".asl_m_"+r.rid).each(function(i){if(i==0)return!0;for(var f=n(this).parent(),u=r.id;n("#ajaxsearchlite"+u).length!=0;)u++;n(this).attr("id","ajaxsearchlite"+u);n(this).removeClass("asl_m_"+r.rid).addClass("asl_m_"+u);n(this).removeClass("hasASL");n(".asl_r_"+r.rid,this).length==0&&n(".asl_r_"+r.rid).clone().appendTo(n(this));n(".asl_r_"+r.rid,this).attr("id","ajaxsearchliteres"+u);n(".asl_r_"+r.rid,this).attr("data-id",u);n(".asl_r_"+r.rid,this).removeClass("asl_r_"+r.rid).addClass("asl_r_"+u);typeof ASL.resHTML!="undefined"&&n("#ajaxsearchliteres"+u).html(ASL.resHTML);n(".asl_s_"+r.rid,this).length==0&&n(".asl_s_"+r.rid).length!=0&&n(".asl_s_"+r.rid).clone().appendTo(n(this));n(".asl_sb_"+r.rid,this).length==0&&n(".asl_sb_"+r.rid).length!=0&&n(".asl_sb_"+r.rid).clone().appendTo(n(this));n(".asl_s_"+r.rid,this).attr("id","ajaxsearchlitesettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitesettings"+u).html(ASL.setHTML);n(".asl_sb_"+r.rid,f).attr("id","ajaxsearchlitebsettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitebsettings"+u).html(ASL.setHTML);n(".asl_hidden_data",f).length>0&&n(".asl_hidden_data",f).attr("id","asl_hidden_data_"+u);n(".asl_init_data",f).length>0&&n(".asl_init_data",f).attr("id","asl_init_id_"+u);t.initialize(u)})})};i.ASL.ready=function(){var t=this,r=t.getScope(),u=null;r(document).ready(function(){t.initialize();setTimeout(function(){t.fixClones()},2500)});r(i).on("load",function(){t.initialized||(t.initialize(),setTimeout(function(){t.fixClones()},2500),console.log("ASL initialized via window.load"))});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&r("body").bind("DOMSubtreeModified",function(){clearTimeout(u);u=setTimeout(function(){t.initialize()},500)});var f;r(i).on("resize",function(){clearTimeout(f);f=setTimeout(function(){t.fixClones()},2e3)});var e,n="#menu-item-search, .fa-search, .fa, .fas";n=n+", .fusion-flyout-menu-toggle, .fusion-main-menu-search-open";n=n+", #search_button";n=n+", .mini-search.popup-search";n=n+", .icon-search";n=n+", .menu-item-search-dropdown";n=n+", .mobile-menu-button";n=n+", .td-icon-search, .tdb-search-icon";n=n+", .side_menu_button, .search_button";n=n+", .raven-search-form-toggle";n=n+", [data-elementor-open-lightbox], .elementor-button-link, .elementor-button";r(function(){r("body").on("click touchend",n,function(){clearTimeout(e);e=setTimeout(function(){t.initialize()},500)})})};i._ASL=ASL;i._ASL.ready()}(asljQuery,asljQuery,window);
1
  /*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
2
+ !function(n,t){"object"==typeof module&&"object"==typeof module.exports?module.exports=n.document?t(n,!0):function(n){if(!n.document)throw new Error("jQuery requires a window with a document");return t(n)}:t(n)}("undefined"!=typeof window?window:this,function(n,t){var c=[],l=c.slice,ki=c.concat,ni=c.push,di=c.indexOf,ct={},hf=ct.toString,nt=ct.hasOwnProperty,r={},gi="1.11.1",i=function(n,t){return new i.fn.init(n,t)},cf=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,lf=/^-ms-/,af=/-([\da-z])/gi,vf=function(n,t){return t.toUpperCase()};i.fn=i.prototype={jquery:gi,constructor:i,selector:"",length:0,toArray:function(){return l.call(this)},get:function(n){return null!=n?0>n?this[n+this.length]:this[n]:l.call(this)},pushStack:function(n){var t=i.merge(this.constructor(),n);return t.prevObject=this,t.context=this.context,t},each:function(n,t){return i.each(this,n,t)},map:function(n){return this.pushStack(i.map(this,function(t,i){return n.call(t,i,t)}))},slice:function(){return this.pushStack(l.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(n){var i=this.length,t=+n+(0>n?i:0);return this.pushStack(t>=0&&i>t?[this[t]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:ni,sort:c.sort,splice:c.splice};i.extend=i.fn.extend=function(){var r,e,t,f,o,s,n=arguments[0]||{},u=1,c=arguments.length,h=!1;for("boolean"==typeof n&&(h=n,n=arguments[u]||{},u++),"object"==typeof n||i.isFunction(n)||(n={}),u===c&&(n=this,u--);c>u;u++)if(null!=(o=arguments[u]))for(f in o)r=n[f],t=o[f],n!==t&&(h&&t&&(i.isPlainObject(t)||(e=i.isArray(t)))?(e?(e=!1,s=r&&i.isArray(r)?r:[]):s=r&&i.isPlainObject(r)?r:{},n[f]=i.extend(h,s,t)):void 0!==t&&(n[f]=t));return n};i.extend({expando:"jQuery"+(gi+Math.random()).replace(/\D/g,""),isReady:!0,error:function(n){throw new Error(n);},noop:function(){},isFunction:function(n){return"function"===i.type(n)},isArray:Array.isArray||function(n){return"array"===i.type(n)},isWindow:function(n){return null!=n&&n==n.window},isNumeric:function(n){return!i.isArray(n)&&n-parseFloat(n)>=0},isEmptyObject:function(n){for(var t in n)return!1;return!0},isPlainObject:function(n){var t;if(!n||"object"!==i.type(n)||n.nodeType||i.isWindow(n))return!1;try{if(n.constructor&&!nt.call(n,"constructor")&&!nt.call(n.constructor.prototype,"isPrototypeOf"))return!1}catch(u){return!1}if(r.ownLast)for(t in n)return nt.call(n,t);for(t in n);return void 0===t||nt.call(n,t)},type:function(n){return null==n?n+"":"object"==typeof n||"function"==typeof n?ct[hf.call(n)]||"object":typeof n},globalEval:function(t){t&&i.trim(t)&&(n.execScript||function(t){n.eval.call(n,t)})(t)},camelCase:function(n){return n.replace(lf,"ms-").replace(af,vf)},nodeName:function(n,t){return n.nodeName&&n.nodeName.toLowerCase()===t.toLowerCase()},each:function(n,t,i){var u,r=0,f=n.length,e=ti(n);if(i){if(e){for(;f>r;r++)if(u=t.apply(n[r],i),u===!1)break}else for(r in n)if(u=t.apply(n[r],i),u===!1)break}else if(e){for(;f>r;r++)if(u=t.call(n[r],r,n[r]),u===!1)break}else for(r in n)if(u=t.call(n[r],r,n[r]),u===!1)break;return n},trim:function(n){return null==n?"":(n+"").replace(cf,"")},makeArray:function(n,t){var r=t||[];return null!=n&&(ti(Object(n))?i.merge(r,"string"==typeof n?[n]:n):ni.call(r,n)),r},inArray:function(n,t,i){var r;if(t){if(di)return di.call(t,n,i);for(r=t.length,i=i?0>i?Math.max(0,r+i):i:0;r>i;i++)if(i in t&&t[i]===n)return i}return-1},merge:function(n,t){for(var r=+t.length,i=0,u=n.length;r>i;)n[u++]=t[i++];if(r!==r)while(void 0!==t[i])n[u++]=t[i++];return n.length=u,n},grep:function(n,t,i){for(var u,f=[],r=0,e=n.length,o=!i;e>r;r++)u=!t(n[r],r),u!==o&&f.push(n[r]);return f},map:function(n,t,i){var u,r=0,e=n.length,o=ti(n),f=[];if(o)for(;e>r;r++)u=t(n[r],r,i),null!=u&&f.push(u);else for(r in n)u=t(n[r],r,i),null!=u&&f.push(u);return ki.apply([],f)},guid:1,proxy:function(n,t){var u,r,f;return"string"==typeof t&&(f=n[t],t=n,n=f),i.isFunction(n)?(u=l.call(arguments,2),r=function(){return n.apply(t||this,u.concat(l.call(arguments)))},r.guid=n.guid=n.guid||i.guid++,r):void 0},now:function(){return+new Date},support:r});i.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(n,t){ct["[object "+t+"]"]=t.toLowerCase()});function ti(n){var t=n.length,r=i.type(n);return"function"===r||i.isWindow(n)?!1:1===n.nodeType&&t?!0:"array"===r||0===t||"number"==typeof t&&t>0&&t-1 in n}var tt=function(n){var it,u,t,ht,oi,et,wt,si,ct,y,rt,p,e,l,a,o,g,lt,ot,f="sizzle"+-new Date,s=n.document,v=0,ki=0,hi=ni(),ci=ni(),li=ni(),bt=function(n,t){return n===t&&(rt=!0),0},ut="undefined",ai=1<<31,di={}.hasOwnProperty,w=[],gi=w.pop,nr=w.push,b=w.push,vi=w.slice,nt=w.indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(this[t]===n)return t;return-1},kt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",i="[\\x20\\t\\r\\n\\f]",ft="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",yi=ft.replace("w","w#"),pi="\\["+i+"*("+ft+")(?:"+i+"*([*^$|!~]?=)"+i+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+yi+"))|)"+i+"*\\]",dt=":("+ft+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+pi+")*)|.*)\\)|)",at=new RegExp("^"+i+"+|((?:^|[^\\\\])(?:\\\\.)*)"+i+"+$","g"),tr=new RegExp("^"+i+"*,"+i+"*"),ir=new RegExp("^"+i+"*([>+~]|"+i+")"+i+"*"),rr=new RegExp("="+i+"*([^\\]'\"]*?)"+i+"*\\]","g"),ur=new RegExp(dt),fr=new RegExp("^"+yi+"$"),vt={ID:new RegExp("^#("+ft+")"),CLASS:new RegExp("^\\.("+ft+")"),TAG:new RegExp("^("+ft.replace("w","w*")+")"),ATTR:new RegExp("^"+pi),PSEUDO:new RegExp("^"+dt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+i+"*(even|odd|(([+-]|)(\\d*)n|)"+i+"*(?:([+-]|)"+i+"*(\\d+)|))"+i+"*\\)|)","i"),bool:new RegExp("^(?:"+kt+")$","i"),needsContext:new RegExp("^"+i+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+i+"*((?:-\\d)?\\d*)"+i+"*\\)|)(?=[^-]|$)","i")},er=/^(?:input|select|textarea|button)$/i,or=/^h\d$/i,st=/^[^{]+\{\s*\[native \w/,sr=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,gt=/[+~]/,hr=/'|\\/g,k=new RegExp("\\\\([\\da-f]{1,6}"+i+"?|("+i+")|.)","ig"),d=function(n,t,i){var r="0x"+t-65536;return r!==r||i?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)};try{b.apply(w=vi.call(s.childNodes),s.childNodes);w[s.childNodes.length].nodeType}catch(yr){b={apply:w.length?function(n,t){nr.apply(n,vi.call(t))}:function(n,t){for(var i=n.length,r=0;n[i++]=t[r++];);n.length=i-1}}}function r(n,t,i,r){var w,h,c,v,k,y,d,l,nt,g;if((t?t.ownerDocument||t:s)!==e&&p(t),t=t||e,i=i||[],!n||"string"!=typeof n)return i;if(1!==(v=t.nodeType)&&9!==v)return[];if(a&&!r){if(w=sr.exec(n))if(c=w[1]){if(9===v){if(h=t.getElementById(c),!h||!h.parentNode)return i;if(h.id===c)return i.push(h),i}else if(t.ownerDocument&&(h=t.ownerDocument.getElementById(c))&&ot(t,h)&&h.id===c)return i.push(h),i}else{if(w[2])return b.apply(i,t.getElementsByTagName(n)),i;if((c=w[3])&&u.getElementsByClassName&&t.getElementsByClassName)return b.apply(i,t.getElementsByClassName(c)),i}if(u.qsa&&(!o||!o.test(n))){if(l=d=f,nt=t,g=9===v&&n,1===v&&"object"!==t.nodeName.toLowerCase()){for(y=et(n),(d=t.getAttribute("id"))?l=d.replace(hr,"\\$&"):t.setAttribute("id",l),l="[id='"+l+"'] ",k=y.length;k--;)y[k]=l+yt(y[k]);nt=gt.test(n)&&ii(t.parentNode)||t;g=y.join(",")}if(g)try{return b.apply(i,nt.querySelectorAll(g)),i}catch(tt){}finally{d||t.removeAttribute("id")}}}return si(n.replace(at,"$1"),t,i,r)}function ni(){var i=[];function n(r,u){return i.push(r+" ")>t.cacheLength&&delete n[i.shift()],n[r+" "]=u}return n}function h(n){return n[f]=!0,n}function c(n){var t=e.createElement("div");try{return!!n(t)}catch(i){return!1}finally{t.parentNode&&t.parentNode.removeChild(t);t=null}}function ti(n,i){for(var u=n.split("|"),r=n.length;r--;)t.attrHandle[u[r]]=i}function wi(n,t){var i=t&&n,r=i&&1===n.nodeType&&1===t.nodeType&&(~t.sourceIndex||ai)-(~n.sourceIndex||ai);if(r)return r;if(i)while(i=i.nextSibling)if(i===t)return-1;return n?1:-1}function cr(n){return function(t){var i=t.nodeName.toLowerCase();return"input"===i&&t.type===n}}function lr(n){return function(t){var i=t.nodeName.toLowerCase();return("input"===i||"button"===i)&&t.type===n}}function tt(n){return h(function(t){return t=+t,h(function(i,r){for(var u,f=n([],i.length,t),e=f.length;e--;)i[u=f[e]]&&(i[u]=!(r[u]=i[u]))})})}function ii(n){return n&&typeof n.getElementsByTagName!==ut&&n}u=r.support={};oi=r.isXML=function(n){var t=n&&(n.ownerDocument||n).documentElement;return t?"HTML"!==t.nodeName:!1};p=r.setDocument=function(n){var v,r=n?n.ownerDocument||n:s,h=r.defaultView;return r!==e&&9===r.nodeType&&r.documentElement?(e=r,l=r.documentElement,a=!oi(r),h&&h!==h.top&&(h.addEventListener?h.addEventListener("unload",function(){p()},!1):h.attachEvent&&h.attachEvent("onunload",function(){p()})),u.attributes=c(function(n){return n.className="i",!n.getAttribute("className")}),u.getElementsByTagName=c(function(n){return n.appendChild(r.createComment("")),!n.getElementsByTagName("*").length}),u.getElementsByClassName=st.test(r.getElementsByClassName)&&c(function(n){return n.innerHTML="<div class='a'><\/div><div class='a i'><\/div>",n.firstChild.className="i",2===n.getElementsByClassName("i").length}),u.getById=c(function(n){return l.appendChild(n).id=f,!r.getElementsByName||!r.getElementsByName(f).length}),u.getById?(t.find.ID=function(n,t){if(typeof t.getElementById!==ut&&a){var i=t.getElementById(n);return i&&i.parentNode?[i]:[]}},t.filter.ID=function(n){var t=n.replace(k,d);return function(n){return n.getAttribute("id")===t}}):(delete t.find.ID,t.filter.ID=function(n){var t=n.replace(k,d);return function(n){var i=typeof n.getAttributeNode!==ut&&n.getAttributeNode("id");return i&&i.value===t}}),t.find.TAG=u.getElementsByTagName?function(n,t){if(typeof t.getElementsByTagName!==ut)return t.getElementsByTagName(n)}:function(n,t){var i,r=[],f=0,u=t.getElementsByTagName(n);if("*"===n){while(i=u[f++])1===i.nodeType&&r.push(i);return r}return u},t.find.CLASS=u.getElementsByClassName&&function(n,t){if(typeof t.getElementsByClassName!==ut&&a)return t.getElementsByClassName(n)},g=[],o=[],(u.qsa=st.test(r.querySelectorAll))&&(c(function(n){n.innerHTML="<select msallowclip=''><option selected=''><\/option><\/select>";n.querySelectorAll("[msallowclip^='']").length&&o.push("[*^$]="+i+"*(?:''|\"\")");n.querySelectorAll("[selected]").length||o.push("\\["+i+"*(?:value|"+kt+")");n.querySelectorAll(":checked").length||o.push(":checked")}),c(function(n){var t=r.createElement("input");t.setAttribute("type","hidden");n.appendChild(t).setAttribute("name","D");n.querySelectorAll("[name=d]").length&&o.push("name"+i+"*[*^$|!~]?=");n.querySelectorAll(":enabled").length||o.push(":enabled",":disabled");n.querySelectorAll("*,:x");o.push(",.*:")})),(u.matchesSelector=st.test(lt=l.matches||l.webkitMatchesSelector||l.mozMatchesSelector||l.oMatchesSelector||l.msMatchesSelector))&&c(function(n){u.disconnectedMatch=lt.call(n,"div");lt.call(n,"[s!='']:x");g.push("!=",dt)}),o=o.length&&new RegExp(o.join("|")),g=g.length&&new RegExp(g.join("|")),v=st.test(l.compareDocumentPosition),ot=v||st.test(l.contains)?function(n,t){var r=9===n.nodeType?n.documentElement:n,i=t&&t.parentNode;return n===i||!(!i||1!==i.nodeType||!(r.contains?r.contains(i):n.compareDocumentPosition&&16&n.compareDocumentPosition(i)))}:function(n,t){if(t)while(t=t.parentNode)if(t===n)return!0;return!1},bt=v?function(n,t){if(n===t)return rt=!0,0;var i=!n.compareDocumentPosition-!t.compareDocumentPosition;return i?i:(i=(n.ownerDocument||n)===(t.ownerDocument||t)?n.compareDocumentPosition(t):1,1&i||!u.sortDetached&&t.compareDocumentPosition(n)===i?n===r||n.ownerDocument===s&&ot(s,n)?-1:t===r||t.ownerDocument===s&&ot(s,t)?1:y?nt.call(y,n)-nt.call(y,t):0:4&i?-1:1)}:function(n,t){if(n===t)return rt=!0,0;var i,u=0,o=n.parentNode,h=t.parentNode,f=[n],e=[t];if(!o||!h)return n===r?-1:t===r?1:o?-1:h?1:y?nt.call(y,n)-nt.call(y,t):0;if(o===h)return wi(n,t);for(i=n;i=i.parentNode;)f.unshift(i);for(i=t;i=i.parentNode;)e.unshift(i);while(f[u]===e[u])u++;return u?wi(f[u],e[u]):f[u]===s?-1:e[u]===s?1:0},r):e};r.matches=function(n,t){return r(n,null,null,t)};r.matchesSelector=function(n,t){if((n.ownerDocument||n)!==e&&p(n),t=t.replace(rr,"='$1']"),!(!u.matchesSelector||!a||g&&g.test(t)||o&&o.test(t)))try{var i=lt.call(n,t);if(i||u.disconnectedMatch||n.document&&11!==n.document.nodeType)return i}catch(f){}return r(t,e,null,[n]).length>0};r.contains=function(n,t){return(n.ownerDocument||n)!==e&&p(n),ot(n,t)};r.attr=function(n,i){(n.ownerDocument||n)!==e&&p(n);var f=t.attrHandle[i.toLowerCase()],r=f&&di.call(t.attrHandle,i.toLowerCase())?f(n,i,!a):void 0;return void 0!==r?r:u.attributes||!a?n.getAttribute(i):(r=n.getAttributeNode(i))&&r.specified?r.value:null};r.error=function(n){throw new Error("Syntax error, unrecognized expression: "+n);};r.uniqueSort=function(n){var r,f=[],t=0,i=0;if(rt=!u.detectDuplicates,y=!u.sortStable&&n.slice(0),n.sort(bt),rt){while(r=n[i++])r===n[i]&&(t=f.push(i));while(t--)n.splice(f[t],1)}return y=null,n};ht=r.getText=function(n){var r,i="",u=0,t=n.nodeType;if(t){if(1===t||9===t||11===t){if("string"==typeof n.textContent)return n.textContent;for(n=n.firstChild;n;n=n.nextSibling)i+=ht(n)}else if(3===t||4===t)return n.nodeValue}else while(r=n[u++])i+=ht(r);return i};t=r.selectors={cacheLength:50,createPseudo:h,match:vt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(n){return n[1]=n[1].replace(k,d),n[3]=(n[3]||n[4]||n[5]||"").replace(k,d),"~="===n[2]&&(n[3]=" "+n[3]+" "),n.slice(0,4)},CHILD:function(n){return n[1]=n[1].toLowerCase(),"nth"===n[1].slice(0,3)?(n[3]||r.error(n[0]),n[4]=+(n[4]?n[5]+(n[6]||1):2*("even"===n[3]||"odd"===n[3])),n[5]=+(n[7]+n[8]||"odd"===n[3])):n[3]&&r.error(n[0]),n},PSEUDO:function(n){var i,t=!n[6]&&n[2];return vt.CHILD.test(n[0])?null:(n[3]?n[2]=n[4]||n[5]||"":t&&ur.test(t)&&(i=et(t,!0))&&(i=t.indexOf(")",t.length-i)-t.length)&&(n[0]=n[0].slice(0,i),n[2]=t.slice(0,i)),n.slice(0,3))}},filter:{TAG:function(n){var t=n.replace(k,d).toLowerCase();return"*"===n?function(){return!0}:function(n){return n.nodeName&&n.nodeName.toLowerCase()===t}},CLASS:function(n){var t=hi[n+" "];return t||(t=new RegExp("(^|"+i+")"+n+"("+i+"|$)"))&&hi(n,function(n){return t.test("string"==typeof n.className&&n.className||typeof n.getAttribute!==ut&&n.getAttribute("class")||"")})},ATTR:function(n,t,i){return function(u){var f=r.attr(u,n);return null==f?"!="===t:t?(f+="","="===t?f===i:"!="===t?f!==i:"^="===t?i&&0===f.indexOf(i):"*="===t?i&&f.indexOf(i)>-1:"$="===t?i&&f.slice(-i.length)===i:"~="===t?(" "+f+" ").indexOf(i)>-1:"|="===t?f===i||f.slice(0,i.length+1)===i+"-":!1):!0}},CHILD:function(n,t,i,r,u){var s="nth"!==n.slice(0,3),o="last"!==n.slice(-4),e="of-type"===t;return 1===r&&0===u?function(n){return!!n.parentNode}:function(t,i,h){var a,k,c,l,y,w,b=s!==o?"nextSibling":"previousSibling",p=t.parentNode,g=e&&t.nodeName.toLowerCase(),d=!h&&!e;if(p){if(s){while(b){for(c=t;c=c[b];)if(e?c.nodeName.toLowerCase()===g:1===c.nodeType)return!1;w=b="only"===n&&!w&&"nextSibling"}return!0}if(w=[o?p.firstChild:p.lastChild],o&&d){for(k=p[f]||(p[f]={}),a=k[n]||[],y=a[0]===v&&a[1],l=a[0]===v&&a[2],c=y&&p.childNodes[y];c=++y&&c&&c[b]||(l=y=0)||w.pop();)if(1===c.nodeType&&++l&&c===t){k[n]=[v,y,l];break}}else if(d&&(a=(t[f]||(t[f]={}))[n])&&a[0]===v)l=a[1];else while(c=++y&&c&&c[b]||(l=y=0)||w.pop())if((e?c.nodeName.toLowerCase()===g:1===c.nodeType)&&++l&&(d&&((c[f]||(c[f]={}))[n]=[v,l]),c===t))break;return l-=u,l===r||l%r==0&&l/r>=0}}},PSEUDO:function(n,i){var e,u=t.pseudos[n]||t.setFilters[n.toLowerCase()]||r.error("unsupported pseudo: "+n);return u[f]?u(i):u.length>1?(e=[n,n,"",i],t.setFilters.hasOwnProperty(n.toLowerCase())?h(function(n,t){for(var r,f=u(n,i),e=f.length;e--;)r=nt.call(n,f[e]),n[r]=!(t[r]=f[e])}):function(n){return u(n,0,e)}):u}},pseudos:{not:h(function(n){var i=[],r=[],t=wt(n.replace(at,"$1"));return t[f]?h(function(n,i,r,u){for(var e,o=t(n,null,u,[]),f=n.length;f--;)(e=o[f])&&(n[f]=!(i[f]=e))}):function(n,u,f){return i[0]=n,t(i,null,f,r),!r.pop()}}),has:h(function(n){return function(t){return r(n,t).length>0}}),contains:h(function(n){return function(t){return(t.textContent||t.innerText||ht(t)).indexOf(n)>-1}}),lang:h(function(n){return fr.test(n||"")||r.error("unsupported lang: "+n),n=n.replace(k,d).toLowerCase(),function(t){var i;do if(i=a?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return i=i.toLowerCase(),i===n||0===i.indexOf(n+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var i=n.location&&n.location.hash;return i&&i.slice(1)===t.id},root:function(n){return n===l},focus:function(n){return n===e.activeElement&&(!e.hasFocus||e.hasFocus())&&!!(n.type||n.href||~n.tabIndex)},enabled:function(n){return n.disabled===!1},disabled:function(n){return n.disabled===!0},checked:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&!!n.checked||"option"===t&&!!n.selected},selected:function(n){return n.parentNode&&n.parentNode.selectedIndex,n.selected===!0},empty:function(n){for(n=n.firstChild;n;n=n.nextSibling)if(n.nodeType<6)return!1;return!0},parent:function(n){return!t.pseudos.empty(n)},header:function(n){return or.test(n.nodeName)},input:function(n){return er.test(n.nodeName)},button:function(n){var t=n.nodeName.toLowerCase();return"input"===t&&"button"===n.type||"button"===t},text:function(n){var t;return"input"===n.nodeName.toLowerCase()&&"text"===n.type&&(null==(t=n.getAttribute("type"))||"text"===t.toLowerCase())},first:tt(function(){return[0]}),last:tt(function(n,t){return[t-1]}),eq:tt(function(n,t,i){return[0>i?i+t:i]}),even:tt(function(n,t){for(var i=0;t>i;i+=2)n.push(i);return n}),odd:tt(function(n,t){for(var i=1;t>i;i+=2)n.push(i);return n}),lt:tt(function(n,t,i){for(var r=0>i?i+t:i;--r>=0;)n.push(r);return n}),gt:tt(function(n,t,i){for(var r=0>i?i+t:i;++r<t;)n.push(r);return n})}};t.pseudos.nth=t.pseudos.eq;for(it in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[it]=cr(it);for(it in{submit:!0,reset:!0})t.pseudos[it]=lr(it);function bi(){}bi.prototype=t.filters=t.pseudos;t.setFilters=new bi;et=r.tokenize=function(n,i){var e,f,s,o,u,h,c,l=ci[n+" "];if(l)return i?0:l.slice(0);for(u=n,h=[],c=t.preFilter;u;){(!e||(f=tr.exec(u)))&&(f&&(u=u.slice(f[0].length)||u),h.push(s=[]));e=!1;(f=ir.exec(u))&&(e=f.shift(),s.push({value:e,type:f[0].replace(at," ")}),u=u.slice(e.length));for(o in t.filter)(f=vt[o].exec(u))&&(!c[o]||(f=c[o](f)))&&(e=f.shift(),s.push({value:e,type:o,matches:f}),u=u.slice(e.length));if(!e)break}return i?u.length:u?r.error(n):ci(n,h).slice(0)};function yt(n){for(var t=0,r=n.length,i="";r>t;t++)i+=n[t].value;return i}function ri(n,t,i){var r=t.dir,u=i&&"parentNode"===r,e=ki++;return t.first?function(t,i,f){while(t=t[r])if(1===t.nodeType||u)return n(t,i,f)}:function(t,i,o){var s,h,c=[v,e];if(o){while(t=t[r])if((1===t.nodeType||u)&&n(t,i,o))return!0}else while(t=t[r])if(1===t.nodeType||u){if(h=t[f]||(t[f]={}),(s=h[r])&&s[0]===v&&s[1]===e)return c[2]=s[2];if(h[r]=c,c[2]=n(t,i,o))return!0}}}function ui(n){return n.length>1?function(t,i,r){for(var u=n.length;u--;)if(!n[u](t,i,r))return!1;return!0}:n[0]}function ar(n,t,i){for(var u=0,f=t.length;f>u;u++)r(n,t[u],i);return i}function pt(n,t,i,r,u){for(var e,o=[],f=0,s=n.length,h=null!=t;s>f;f++)(e=n[f])&&(!i||i(e,r,u))&&(o.push(e),h&&t.push(f));return o}function fi(n,t,i,r,u,e){return r&&!r[f]&&(r=fi(r)),u&&!u[f]&&(u=fi(u,e)),h(function(f,e,o,s){var l,c,a,p=[],y=[],w=e.length,k=f||ar(t||"*",o.nodeType?[o]:o,[]),v=!n||!f&&t?k:pt(k,p,n,o,s),h=i?u||(f?n:w||r)?[]:e:v;if(i&&i(v,h,o,s),r)for(l=pt(h,y),r(l,[],o,s),c=l.length;c--;)(a=l[c])&&(h[y[c]]=!(v[y[c]]=a));if(f){if(u||n){if(u){for(l=[],c=h.length;c--;)(a=h[c])&&l.push(v[c]=a);u(null,h=[],l,s)}for(c=h.length;c--;)(a=h[c])&&(l=u?nt.call(f,a):p[c])>-1&&(f[l]=!(e[l]=a))}}else h=pt(h===e?h.splice(w,h.length):h),u?u(null,e,h,s):b.apply(e,h)})}function ei(n){for(var s,u,r,o=n.length,h=t.relative[n[0].type],c=h||t.relative[" "],i=h?1:0,l=ri(function(n){return n===s},c,!0),a=ri(function(n){return nt.call(s,n)>-1},c,!0),e=[function(n,t,i){return!h&&(i||t!==ct)||((s=t).nodeType?l(n,t,i):a(n,t,i))}];o>i;i++)if(u=t.relative[n[i].type])e=[ri(ui(e),u)];else{if(u=t.filter[n[i].type].apply(null,n[i].matches),u[f]){for(r=++i;o>r;r++)if(t.relative[n[r].type])break;return fi(i>1&&ui(e),i>1&&yt(n.slice(0,i-1).concat({value:" "===n[i-2].type?"*":""})).replace(at,"$1"),u,r>i&&ei(n.slice(i,r)),o>r&&ei(n=n.slice(r)),o>r&&yt(n))}e.push(u)}return ui(e)}function vr(n,i){var u=i.length>0,f=n.length>0,o=function(o,s,h,c,l){var y,d,w,k=0,a="0",g=o&&[],p=[],nt=ct,tt=o||f&&t.find.TAG("*",l),it=v+=null==nt?1:Math.random()||.1,rt=tt.length;for(l&&(ct=s!==e&&s);a!==rt&&null!=(y=tt[a]);a++){if(f&&y){for(d=0;w=n[d++];)if(w(y,s,h)){c.push(y);break}l&&(v=it)}u&&((y=!w&&y)&&k--,o&&g.push(y))}if(k+=a,u&&a!==k){for(d=0;w=i[d++];)w(g,p,s,h);if(o){if(k>0)while(a--)g[a]||p[a]||(p[a]=gi.call(c));p=pt(p)}b.apply(c,p);l&&!o&&p.length>0&&k+i.length>1&&r.uniqueSort(c)}return l&&(v=it,ct=nt),g};return u?h(o):o}return wt=r.compile=function(n,t){var r,u=[],e=[],i=li[n+" "];if(!i){for(t||(t=et(n)),r=t.length;r--;)i=ei(t[r]),i[f]?u.push(i):e.push(i);i=li(n,vr(e,u));i.selector=n}return i},si=r.select=function(n,i,r,f){var s,e,o,l,v,c="function"==typeof n&&n,h=!f&&et(n=c.selector||n);if(r=r||[],1===h.length){if(e=h[0]=h[0].slice(0),e.length>2&&"ID"===(o=e[0]).type&&u.getById&&9===i.nodeType&&a&&t.relative[e[1].type]){if(i=(t.find.ID(o.matches[0].replace(k,d),i)||[])[0],!i)return r;c&&(i=i.parentNode);n=n.slice(e.shift().value.length)}for(s=vt.needsContext.test(n)?0:e.length;s--;){if(o=e[s],t.relative[l=o.type])break;if((v=t.find[l])&&(f=v(o.matches[0].replace(k,d),gt.test(e[0].type)&&ii(i.parentNode)||i))){if(e.splice(s,1),n=f.length&&yt(e),!n)return b.apply(r,f),r;break}}}return(c||wt(n,h))(f,i,!a,r,gt.test(n)&&ii(i.parentNode)||i),r},u.sortStable=f.split("").sort(bt).join("")===f,u.detectDuplicates=!!rt,p(),u.sortDetached=c(function(n){return 1&n.compareDocumentPosition(e.createElement("div"))}),c(function(n){return n.innerHTML="<a href='#'><\/a>","#"===n.firstChild.getAttribute("href")})||ti("type|href|height|width",function(n,t,i){if(!i)return n.getAttribute(t,"type"===t.toLowerCase()?1:2)}),u.attributes&&c(function(n){return n.innerHTML="<input/>",n.firstChild.setAttribute("value",""),""===n.firstChild.getAttribute("value")})||ti("value",function(n,t,i){if(!i&&"input"===n.nodeName.toLowerCase())return n.defaultValue}),c(function(n){return null==n.getAttribute("disabled")})||ti(kt,function(n,t,i){var r;if(!i)return n[t]===!0?t.toLowerCase():(r=n.getAttributeNode(t))&&r.specified?r.value:null}),r}(n);i.find=tt;i.expr=tt.selectors;i.expr[":"]=i.expr.pseudos;i.unique=tt.uniqueSort;i.text=tt.getText;i.isXMLDoc=tt.isXML;i.contains=tt.contains;var nr=i.expr.match.needsContext,tr=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,yf=/^.[^:#\[\.,]*$/;function ii(n,t,r){if(i.isFunction(t))return i.grep(n,function(n,i){return!!t.call(n,i,n)!==r});if(t.nodeType)return i.grep(n,function(n){return n===t!==r});if("string"==typeof t){if(yf.test(t))return i.filter(t,n,r);t=i.filter(t,n)}return i.grep(n,function(n){return i.inArray(n,t)>=0!==r})}i.filter=function(n,t,r){var u=t[0];return r&&(n=":not("+n+")"),1===t.length&&1===u.nodeType?i.find.matchesSelector(u,n)?[u]:[]:i.find.matches(n,i.grep(t,function(n){return 1===n.nodeType}))};i.fn.extend({find:function(n){var t,r=[],u=this,f=u.length;if("string"!=typeof n)return this.pushStack(i(n).filter(function(){for(t=0;f>t;t++)if(i.contains(u[t],this))return!0}));for(t=0;f>t;t++)i.find(n,u[t],r);return r=this.pushStack(f>1?i.unique(r):r),r.selector=this.selector?this.selector+" "+n:n,r},filter:function(n){return this.pushStack(ii(this,n||[],!1))},not:function(n){return this.pushStack(ii(this,n||[],!0))},is:function(n){return!!ii(this,"string"==typeof n&&nr.test(n)?i(n):n||[],!1).length}});var ft,u=n.document,pf=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,wf=i.fn.init=function(n,t){var r,f;if(!n)return this;if("string"==typeof n){if(r="<"===n.charAt(0)&&">"===n.charAt(n.length-1)&&n.length>=3?[null,n,null]:pf.exec(n),!r||!r[1]&&t)return!t||t.jquery?(t||ft).find(n):this.constructor(t).find(n);if(r[1]){if(t=t instanceof i?t[0]:t,i.merge(this,i.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:u,!0)),tr.test(r[1])&&i.isPlainObject(t))for(r in t)i.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}if(f=u.getElementById(r[2]),f&&f.parentNode){if(f.id!==r[2])return ft.find(n);this.length=1;this[0]=f}return this.context=u,this.selector=n,this}return n.nodeType?(this.context=this[0]=n,this.length=1,this):i.isFunction(n)?"undefined"!=typeof ft.ready?ft.ready(n):n(i):(void 0!==n.selector&&(this.selector=n.selector,this.context=n.context),i.makeArray(n,this))};wf.prototype=i.fn;ft=i(u);var bf=/^(?:parents|prev(?:Until|All))/,kf={children:!0,contents:!0,next:!0,prev:!0};i.extend({dir:function(n,t,r){for(var f=[],u=n[t];u&&9!==u.nodeType&&(void 0===r||1!==u.nodeType||!i(u).is(r));)1===u.nodeType&&f.push(u),u=u[t];return f},sibling:function(n,t){for(var i=[];n;n=n.nextSibling)1===n.nodeType&&n!==t&&i.push(n);return i}});i.fn.extend({has:function(n){var t,r=i(n,this),u=r.length;return this.filter(function(){for(t=0;u>t;t++)if(i.contains(this,r[t]))return!0})},closest:function(n,t){for(var r,f=0,o=this.length,u=[],e=nr.test(n)||"string"!=typeof n?i(n,t||this.context):0;o>f;f++)for(r=this[f];r&&r!==t;r=r.parentNode)if(r.nodeType<11&&(e?e.index(r)>-1:1===r.nodeType&&i.find.matchesSelector(r,n))){u.push(r);break}return this.pushStack(u.length>1?i.unique(u):u)},index:function(n){return n?"string"==typeof n?i.inArray(this[0],i(n)):i.inArray(n.jquery?n[0]:n,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(n,t){return this.pushStack(i.unique(i.merge(this.get(),i(n,t))))},addBack:function(n){return this.add(null==n?this.prevObject:this.prevObject.filter(n))}});function ir(n,t){do n=n[t];while(n&&1!==n.nodeType);return n}i.each({parent:function(n){var t=n.parentNode;return t&&11!==t.nodeType?t:null},parents:function(n){return i.dir(n,"parentNode")},parentsUntil:function(n,t,r){return i.dir(n,"parentNode",r)},next:function(n){return ir(n,"nextSibling")},prev:function(n){return ir(n,"previousSibling")},nextAll:function(n){return i.dir(n,"nextSibling")},prevAll:function(n){return i.dir(n,"previousSibling")},nextUntil:function(n,t,r){return i.dir(n,"nextSibling",r)},prevUntil:function(n,t,r){return i.dir(n,"previousSibling",r)},siblings:function(n){return i.sibling((n.parentNode||{}).firstChild,n)},children:function(n){return i.sibling(n.firstChild)},contents:function(n){return i.nodeName(n,"iframe")?n.contentDocument||n.contentWindow.document:i.merge([],n.childNodes)}},function(n,t){i.fn[n]=function(r,u){var f=i.map(this,t,r);return"Until"!==n.slice(-5)&&(u=r),u&&"string"==typeof u&&(f=i.filter(u,f)),this.length>1&&(kf[n]||(f=i.unique(f)),bf.test(n)&&(f=f.reverse())),this.pushStack(f)}});var h=/\S+/g,rr={};function df(n){var t=rr[n]={};return i.each(n.match(h)||[],function(n,i){t[i]=!0}),t}i.Callbacks=function(n){n="string"==typeof n?rr[n]||df(n):i.extend({},n);var o,u,h,f,e,c,t=[],r=!n.once&&[],l=function(i){for(u=n.memory&&i,h=!0,e=c||0,c=0,f=t.length,o=!0;t&&f>e;e++)if(t[e].apply(i[0],i[1])===!1&&n.stopOnFalse){u=!1;break}o=!1;t&&(r?r.length&&l(r.shift()):u?t=[]:s.disable())},s={add:function(){if(t){var r=t.length;!function e(r){i.each(r,function(r,u){var f=i.type(u);"function"===f?n.unique&&s.has(u)||t.push(u):u&&u.length&&"string"!==f&&e(u)})}(arguments);o?f=t.length:u&&(c=r,l(u))}return this},remove:function(){return t&&i.each(arguments,function(n,r){for(var u;(u=i.inArray(r,t,u))>-1;)t.splice(u,1),o&&(f>=u&&f--,e>=u&&e--)}),this},has:function(n){return n?i.inArray(n,t)>-1:!(!t||!t.length)},empty:function(){return t=[],f=0,this},disable:function(){return t=r=u=void 0,this},disabled:function(){return!t},lock:function(){return r=void 0,u||s.disable(),this},locked:function(){return!r},fireWith:function(n,i){return!t||h&&!r||(i=i||[],i=[n,i.slice?i.slice():i],o?r.push(i):l(i)),this},fire:function(){return s.fireWith(this,arguments),this},fired:function(){return!!h}};return s};i.extend({Deferred:function(n){var u=[["resolve","done",i.Callbacks("once memory"),"resolved"],["reject","fail",i.Callbacks("once memory"),"rejected"],["notify","progress",i.Callbacks("memory")]],f="pending",r={state:function(){return f},always:function(){return t.done(arguments).fail(arguments),this},then:function(){var n=arguments;return i.Deferred(function(f){i.each(u,function(u,e){var o=i.isFunction(n[u])&&n[u];t[e[1]](function(){var n=o&&o.apply(this,arguments);n&&i.isFunction(n.promise)?n.promise().done(f.resolve).fail(f.reject).progress(f.notify):f[e[0]+"With"](this===r?f.promise():this,o?[n]:arguments)})});n=null}).promise()},promise:function(n){return null!=n?i.extend(n,r):r}},t={};return r.pipe=r.then,i.each(u,function(n,i){var e=i[2],o=i[3];r[i[1]]=e.add;o&&e.add(function(){f=o},u[1^n][2].disable,u[2][2].lock);t[i[0]]=function(){return t[i[0]+"With"](this===t?r:this,arguments),this};t[i[0]+"With"]=e.fireWith}),r.promise(t),n&&n.call(t,t),t},when:function(n){var t=0,u=l.call(arguments),r=u.length,e=1!==r||n&&i.isFunction(n.promise)?r:0,f=1===e?n:i.Deferred(),h=function(n,t,i){return function(r){t[n]=this;i[n]=arguments.length>1?l.call(arguments):r;i===o?f.notifyWith(t,i):--e||f.resolveWith(t,i)}},o,c,s;if(r>1)for(o=new Array(r),c=new Array(r),s=new Array(r);r>t;t++)u[t]&&i.isFunction(u[t].promise)?u[t].promise().done(h(t,s,u)).fail(f.reject).progress(h(t,c,o)):--e;return e||f.resolveWith(s,u),f.promise()}});var lt;i.fn.ready=function(n){return i.ready.promise().done(n),this};i.extend({isReady:!1,readyWait:1,holdReady:function(n){n?i.readyWait++:i.ready(!0)},ready:function(n){if(n===!0?!--i.readyWait:!i.isReady){if(!u.body)return setTimeout(i.ready);i.isReady=!0;n!==!0&&--i.readyWait>0||(lt.resolveWith(u,[i]),i.fn.triggerHandler&&(i(u).triggerHandler("ready"),i(u).off("ready")))}}});function ur(){u.addEventListener?(u.removeEventListener("DOMContentLoaded",a,!1),n.removeEventListener("load",a,!1)):(u.detachEvent("onreadystatechange",a),n.detachEvent("onload",a))}function a(){(u.addEventListener||"load"===event.type||"complete"===u.readyState)&&(ur(),i.ready())}i.ready.promise=function(t){if(!lt)if(lt=i.Deferred(),"complete"===u.readyState)setTimeout(i.ready);else if(u.addEventListener)u.addEventListener("DOMContentLoaded",a,!1),n.addEventListener("load",a,!1);else{u.attachEvent("onreadystatechange",a);n.attachEvent("onload",a);var r=!1;try{r=null==n.frameElement&&u.documentElement}catch(e){}r&&r.doScroll&&!function f(){if(!i.isReady){try{r.doScroll("left")}catch(n){return setTimeout(f,50)}ur();i.ready()}}()}return lt.promise(t)};var s="undefined";for(var gf in i(r))break;r.ownLast="0"!==gf;r.inlineBlockNeedsLayout=!1;i(function(){var f,t,n,i;n=u.getElementsByTagName("body")[0];n&&n.style&&(t=u.createElement("div"),i=u.createElement("div"),i.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",n.appendChild(i).appendChild(t),typeof t.style.zoom!==s&&(t.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",r.inlineBlockNeedsLayout=f=3===t.offsetWidth,f&&(n.style.zoom=1)),n.removeChild(i))}),function(){var n=u.createElement("div");if(null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(t){r.deleteExpando=!1}}n=null}();i.acceptData=function(n){var t=i.noData[(n.nodeName+" ").toLowerCase()],r=+n.nodeType||1;return 1!==r&&9!==r?!1:!t||t!==!0&&n.getAttribute("classid")===t};var ne=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,te=/([A-Z])/g;function fr(n,t,r){if(void 0===r&&1===n.nodeType){var u="data-"+t.replace(te,"-$1").toLowerCase();if(r=n.getAttribute(u),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:ne.test(r)?i.parseJSON(r):r}catch(f){}i.data(n,t,r)}else r=void 0}return r}function ri(n){for(var t in n)if(("data"!==t||!i.isEmptyObject(n[t]))&&"toJSON"!==t)return!1;return!0}function er(n,t,r,u){if(i.acceptData(n)){var s,e,h=i.expando,l=n.nodeType,o=l?i.cache:n,f=l?n[h]:n[h]&&h;if(f&&o[f]&&(u||o[f].data)||void 0!==r||"string"!=typeof t)return f||(f=l?n[h]=c.pop()||i.guid++:h),o[f]||(o[f]=l?{}:{toJSON:i.noop}),("object"==typeof t||"function"==typeof t)&&(u?o[f]=i.extend(o[f],t):o[f].data=i.extend(o[f].data,t)),e=o[f],u||(e.data||(e.data={}),e=e.data),void 0!==r&&(e[i.camelCase(t)]=r),"string"==typeof t?(s=e[t],null==s&&(s=e[i.camelCase(t)])):s=e,s}}function or(n,t,u){if(i.acceptData(n)){var o,s,h=n.nodeType,f=h?i.cache:n,e=h?n[i.expando]:i.expando;if(f[e]){if(t&&(o=u?f[e]:f[e].data)){for(i.isArray(t)?t=t.concat(i.map(t,i.camelCase)):(t in o)?t=[t]:(t=i.camelCase(t),t=(t in o)?[t]:t.split(" ")),s=t.length;s--;)delete o[t[s]];if(u?!ri(o):!i.isEmptyObject(o))return}(u||(delete f[e].data,ri(f[e])))&&(h?i.cleanData([n],!0):r.deleteExpando||f!=f.window?delete f[e]:f[e]=null)}}}i.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(n){return n=n.nodeType?i.cache[n[i.expando]]:n[i.expando],!!n&&!ri(n)},data:function(n,t,i){return er(n,t,i)},removeData:function(n,t){return or(n,t)},_data:function(n,t,i){return er(n,t,i,!0)},_removeData:function(n,t){return or(n,t,!0)}});i.fn.extend({data:function(n,t){var f,u,e,r=this[0],o=r&&r.attributes;if(void 0===n){if(this.length&&(e=i.data(r),1===r.nodeType&&!i._data(r,"parsedAttrs"))){for(f=o.length;f--;)o[f]&&(u=o[f].name,0===u.indexOf("data-")&&(u=i.camelCase(u.slice(5)),fr(r,u,e[u])));i._data(r,"parsedAttrs",!0)}return e}return"object"==typeof n?this.each(function(){i.data(this,n)}):arguments.length>1?this.each(function(){i.data(this,n,t)}):r?fr(r,n,i.data(r,n)):void 0},removeData:function(n){return this.each(function(){i.removeData(this,n)})}});i.extend({queue:function(n,t,r){var u;if(n)return(t=(t||"fx")+"queue",u=i._data(n,t),r&&(!u||i.isArray(r)?u=i._data(n,t,i.makeArray(r)):u.push(r)),u||[])},dequeue:function(n,t){t=t||"fx";var r=i.queue(n,t),e=r.length,u=r.shift(),f=i._queueHooks(n,t),o=function(){i.dequeue(n,t)};"inprogress"===u&&(u=r.shift(),e--);u&&("fx"===t&&r.unshift("inprogress"),delete f.stop,u.call(n,o,f));!e&&f&&f.empty.fire()},_queueHooks:function(n,t){var r=t+"queueHooks";return i._data(n,r)||i._data(n,r,{empty:i.Callbacks("once memory").add(function(){i._removeData(n,t+"queue");i._removeData(n,r)})})}});i.fn.extend({queue:function(n,t){var r=2;return"string"!=typeof n&&(t=n,n="fx",r--),arguments.length<r?i.queue(this[0],n):void 0===t?this:this.each(function(){var r=i.queue(this,n,t);i._queueHooks(this,n);"fx"===n&&"inprogress"!==r[0]&&i.dequeue(this,n)})},dequeue:function(n){return this.each(function(){i.dequeue(this,n)})},clearQueue:function(n){return this.queue(n||"fx",[])},promise:function(n,t){var r,f=1,e=i.Deferred(),u=this,o=this.length,s=function(){--f||e.resolveWith(u,[u])};for("string"!=typeof n&&(t=n,n=void 0),n=n||"fx";o--;)r=i._data(u[o],n+"queueHooks"),r&&r.empty&&(f++,r.empty.add(s));return s(),e.promise(t)}});var at=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,p=["Top","Right","Bottom","Left"],et=function(n,t){return n=t||n,"none"===i.css(n,"display")||!i.contains(n.ownerDocument,n)},w=i.access=function(n,t,r,u,f,e,o){var s=0,c=n.length,h=null==r;if("object"===i.type(r)){f=!0;for(s in r)i.access(n,t,s,r[s],!0,e,o)}else if(void 0!==u&&(f=!0,i.isFunction(u)||(o=!0),h&&(o?(t.call(n,u),t=null):(h=t,t=function(n,t,r){return h.call(i(n),r)})),t))for(;c>s;s++)t(n[s],r,o?u:u.call(n[s],s,t(n[s],r)));return f?n:h?t.call(n):c?t(n[0],r):e},ui=/^(?:checkbox|radio)$/i;!function(){var t=u.createElement("input"),n=u.createElement("div"),i=u.createDocumentFragment();if(n.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",r.leadingWhitespace=3===n.firstChild.nodeType,r.tbody=!n.getElementsByTagName("tbody").length,r.htmlSerialize=!!n.getElementsByTagName("link").length,r.html5Clone="<:nav><\/:nav>"!==u.createElement("nav").cloneNode(!0).outerHTML,t.type="checkbox",t.checked=!0,i.appendChild(t),r.appendChecked=t.checked,n.innerHTML="<textarea>x<\/textarea>",r.noCloneChecked=!!n.cloneNode(!0).lastChild.defaultValue,i.appendChild(n),n.innerHTML="<input type='radio' checked='checked' name='t'/>",r.checkClone=n.cloneNode(!0).cloneNode(!0).lastChild.checked,r.noCloneEvent=!0,n.attachEvent&&(n.attachEvent("onclick",function(){r.noCloneEvent=!1}),n.cloneNode(!0).click()),null==r.deleteExpando){r.deleteExpando=!0;try{delete n.test}catch(f){r.deleteExpando=!1}}}(),function(){var t,i,f=u.createElement("div");for(t in{submit:!0,change:!0,focusin:!0})i="on"+t,(r[t+"Bubbles"]=i in n)||(f.setAttribute(i,"t"),r[t+"Bubbles"]=f.attributes[i].expando===!1);f=null}();var fi=/^(?:input|select|textarea)$/i,ie=/^key/,re=/^(?:mouse|pointer|contextmenu)|click/,sr=/^(?:focusinfocus|focusoutblur)$/,hr=/^([^.]*)(?:\.(.+)|)$/;function vt(){return!0}function it(){return!1}function cr(){try{return u.activeElement}catch(n){}}i.event={global:{},add:function(n,t,r,u,f){var w,y,b,p,o,c,l,a,e,k,d,v=i._data(n);if(v){for(r.handler&&(p=r,r=p.handler,f=p.selector),r.guid||(r.guid=i.guid++),(y=v.events)||(y=v.events={}),(c=v.handle)||(c=v.handle=function(n){if(typeof i!==s&&(!n||i.event.triggered!==n.type))return i.event.dispatch.apply(c.elem,arguments)},c.elem=n),t=(t||"").match(h)||[""],b=t.length;b--;)w=hr.exec(t[b])||[],e=d=w[1],k=(w[2]||"").split(".").sort(),e&&(o=i.event.special[e]||{},e=(f?o.delegateType:o.bindType)||e,o=i.event.special[e]||{},l=i.extend({type:e,origType:d,data:u,handler:r,guid:r.guid,selector:f,needsContext:f&&i.expr.match.needsContext.test(f),namespace:k.join(".")},p),(a=y[e])||(a=y[e]=[],a.delegateCount=0,o.setup&&o.setup.call(n,u,k,c)!==!1||(n.addEventListener?n.addEventListener(e,c,!1):n.attachEvent&&n.attachEvent("on"+e,c))),o.add&&(o.add.call(n,l),l.handler.guid||(l.handler.guid=r.guid)),f?a.splice(a.delegateCount++,0,l):a.push(l),i.event.global[e]=!0);n=null}},remove:function(n,t,r,u,f){var y,o,s,b,p,a,c,l,e,w,k,v=i.hasData(n)&&i._data(n);if(v&&(a=v.events)){for(t=(t||"").match(h)||[""],p=t.length;p--;)if(s=hr.exec(t[p])||[],e=k=s[1],w=(s[2]||"").split(".").sort(),e){for(c=i.event.special[e]||{},e=(u?c.delegateType:c.bindType)||e,l=a[e]||[],s=s[2]&&new RegExp("(^|\\.)"+w.join("\\.(?:.*\\.|)")+"(\\.|$)"),b=y=l.length;y--;)o=l[y],!f&&k!==o.origType||r&&r.guid!==o.guid||s&&!s.test(o.namespace)||u&&u!==o.selector&&("**"!==u||!o.selector)||(l.splice(y,1),o.selector&&l.delegateCount--,c.remove&&c.remove.call(n,o));b&&!l.length&&(c.teardown&&c.teardown.call(n,w,v.handle)!==!1||i.removeEvent(n,e,v.handle),delete a[e])}else for(e in a)i.event.remove(n,e+t[p],r,u,!0);i.isEmptyObject(a)&&(delete v.handle,i._removeData(n,"events"))}},trigger:function(t,r,f,e){var l,a,o,p,c,h,w,y=[f||u],s=nt.call(t,"type")?t.type:t,v=nt.call(t,"namespace")?t.namespace.split("."):[];if(o=h=f=f||u,3!==f.nodeType&&8!==f.nodeType&&!sr.test(s+i.event.triggered)&&(s.indexOf(".")>=0&&(v=s.split("."),s=v.shift(),v.sort()),a=s.indexOf(":")<0&&"on"+s,t=t[i.expando]?t:new i.Event(s,"object"==typeof t&&t),t.isTrigger=e?2:3,t.namespace=v.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=f),r=null==r?[t]:i.makeArray(r,[t]),c=i.event.special[s]||{},e||!c.trigger||c.trigger.apply(f,r)!==!1)){if(!e&&!c.noBubble&&!i.isWindow(f)){for(p=c.delegateType||s,sr.test(p+s)||(o=o.parentNode);o;o=o.parentNode)y.push(o),h=o;h===(f.ownerDocument||u)&&y.push(h.defaultView||h.parentWindow||n)}for(w=0;(o=y[w++])&&!t.isPropagationStopped();)t.type=w>1?p:c.bindType||s,l=(i._data(o,"events")||{})[t.type]&&i._data(o,"handle"),l&&l.apply(o,r),l=a&&o[a],l&&l.apply&&i.acceptData(o)&&(t.result=l.apply(o,r),t.result===!1&&t.preventDefault());if(t.type=s,!e&&!t.isDefaultPrevented()&&(!c._default||c._default.apply(y.pop(),r)===!1)&&i.acceptData(f)&&a&&f[s]&&!i.isWindow(f)){h=f[a];h&&(f[a]=null);i.event.triggered=s;try{f[s]()}catch(b){}i.event.triggered=void 0;h&&(f[a]=h)}return t.result}},dispatch:function(n){n=i.event.fix(n);var e,f,t,r,o,s=[],h=l.call(arguments),c=(i._data(this,"events")||{})[n.type]||[],u=i.event.special[n.type]||{};if(h[0]=n,n.delegateTarget=this,!u.preDispatch||u.preDispatch.call(this,n)!==!1){for(s=i.event.handlers.call(this,n,c),e=0;(r=s[e++])&&!n.isPropagationStopped();)for(n.currentTarget=r.elem,o=0;(t=r.handlers[o++])&&!n.isImmediatePropagationStopped();)(!n.namespace_re||n.namespace_re.test(t.namespace))&&(n.handleObj=t,n.data=t.data,f=((i.event.special[t.origType]||{}).handle||t.handler).apply(r.elem,h),void 0!==f&&(n.result=f)===!1&&(n.preventDefault(),n.stopPropagation()));return u.postDispatch&&u.postDispatch.call(this,n),n.result}},handlers:function(n,t){var f,e,u,o,h=[],s=t.delegateCount,r=n.target;if(s&&r.nodeType&&(!n.button||"click"!==n.type))for(;r!=this;r=r.parentNode||this)if(1===r.nodeType&&(r.disabled!==!0||"click"!==n.type)){for(u=[],o=0;s>o;o++)e=t[o],f=e.selector+" ",void 0===u[f]&&(u[f]=e.needsContext?i(f,this).index(r)>=0:i.find(f,this,null,[r]).length),u[f]&&u.push(e);u.length&&h.push({elem:r,handlers:u})}return s<t.length&&h.push({elem:this,handlers:t.slice(s)}),h},fix:function(n){if(n[i.expando])return n;var e,o,s,r=n.type,f=n,t=this.fixHooks[r];for(t||(this.fixHooks[r]=t=re.test(r)?this.mouseHooks:ie.test(r)?this.keyHooks:{}),s=t.props?this.props.concat(t.props):this.props,n=new i.Event(f),e=s.length;e--;)o=s[e],n[o]=f[o];return n.target||(n.target=f.srcElement||u),3===n.target.nodeType&&(n.target=n.target.parentNode),n.metaKey=!!n.metaKey,t.filter?t.filter(n,f):n},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(n,t){return null==n.which&&(n.which=null!=t.charCode?t.charCode:t.keyCode),n}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(n,t){var i,e,r,f=t.button,o=t.fromElement;return null==n.pageX&&null!=t.clientX&&(e=n.target.ownerDocument||u,r=e.documentElement,i=e.body,n.pageX=t.clientX+(r&&r.scrollLeft||i&&i.scrollLeft||0)-(r&&r.clientLeft||i&&i.clientLeft||0),n.pageY=t.clientY+(r&&r.scrollTop||i&&i.scrollTop||0)-(r&&r.clientTop||i&&i.clientTop||0)),!n.relatedTarget&&o&&(n.relatedTarget=o===n.target?t.toElement:o),n.which||void 0===f||(n.which=1&f?1:2&f?3:4&f?2:0),n}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cr()&&this.focus)try{return this.focus(),!1}catch(n){}},delegateType:"focusin"},blur:{trigger:function(){if(this===cr()&&this.blur)return(this.blur(),!1)},delegateType:"focusout"},click:{trigger:function(){if(i.nodeName(this,"input")&&"checkbox"===this.type&&this.click)return(this.click(),!1)},_default:function(n){return i.nodeName(n.target,"a")}},beforeunload:{postDispatch:function(n){void 0!==n.result&&n.originalEvent&&(n.originalEvent.returnValue=n.result)}}},simulate:function(n,t,r,u){var f=i.extend(new i.Event,r,{type:n,isSimulated:!0,originalEvent:{}});u?i.event.trigger(f,null,t):i.event.dispatch.call(t,f);f.isDefaultPrevented()&&r.preventDefault()}};i.removeEvent=u.removeEventListener?function(n,t,i){n.removeEventListener&&n.removeEventListener(t,i,!1)}:function(n,t,i){var r="on"+t;n.detachEvent&&(typeof n[r]===s&&(n[r]=null),n.detachEvent(r,i))};i.Event=function(n,t){return this instanceof i.Event?(n&&n.type?(this.originalEvent=n,this.type=n.type,this.isDefaultPrevented=n.defaultPrevented||void 0===n.defaultPrevented&&n.returnValue===!1?vt:it):this.type=n,t&&i.extend(this,t),this.timeStamp=n&&n.timeStamp||i.now(),void(this[i.expando]=!0)):new i.Event(n,t)};i.Event.prototype={isDefaultPrevented:it,isPropagationStopped:it,isImmediatePropagationStopped:it,preventDefault:function(){var n=this.originalEvent;this.isDefaultPrevented=vt;n&&(n.preventDefault?n.preventDefault():n.returnValue=!1)},stopPropagation:function(){var n=this.originalEvent;this.isPropagationStopped=vt;n&&(n.stopPropagation&&n.stopPropagation(),n.cancelBubble=!0)},stopImmediatePropagation:function(){var n=this.originalEvent;this.isImmediatePropagationStopped=vt;n&&n.stopImmediatePropagation&&n.stopImmediatePropagation();this.stopPropagation()}};i.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(n,t){i.event.special[n]={delegateType:t,bindType:t,handle:function(n){var u,f=this,r=n.relatedTarget,e=n.handleObj;return(!r||r!==f&&!i.contains(f,r))&&(n.type=e.origType,u=e.handler.apply(this,arguments),n.type=t),u}}});r.submitBubbles||(i.event.special.submit={setup:function(){return i.nodeName(this,"form")?!1:void i.event.add(this,"click._submit keypress._submit",function(n){var r=n.target,t=i.nodeName(r,"input")||i.nodeName(r,"button")?r.form:void 0;t&&!i._data(t,"submitBubbles")&&(i.event.add(t,"submit._submit",function(n){n._submit_bubble=!0}),i._data(t,"submitBubbles",!0))})},postDispatch:function(n){n._submit_bubble&&(delete n._submit_bubble,this.parentNode&&!n.isTrigger&&i.event.simulate("submit",this.parentNode,n,!0))},teardown:function(){return i.nodeName(this,"form")?!1:void i.event.remove(this,"._submit")}});r.changeBubbles||(i.event.special.change={setup:function(){return fi.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(i.event.add(this,"propertychange._change",function(n){"checked"===n.originalEvent.propertyName&&(this._just_changed=!0)}),i.event.add(this,"click._change",function(n){this._just_changed&&!n.isTrigger&&(this._just_changed=!1);i.event.simulate("change",this,n,!0)})),!1):void i.event.add(this,"beforeactivate._change",function(n){var t=n.target;fi.test(t.nodeName)&&!i._data(t,"changeBubbles")&&(i.event.add(t,"change._change",function(n){!this.parentNode||n.isSimulated||n.isTrigger||i.event.simulate("change",this.parentNode,n,!0)}),i._data(t,"changeBubbles",!0))})},handle:function(n){var t=n.target;if(this!==t||n.isSimulated||n.isTrigger||"radio"!==t.type&&"checkbox"!==t.type)return n.handleObj.handler.apply(this,arguments)},teardown:function(){return i.event.remove(this,"._change"),!fi.test(this.nodeName)}});r.focusinBubbles||i.each({focus:"focusin",blur:"focusout"},function(n,t){var r=function(n){i.event.simulate(t,n.target,i.event.fix(n),!0)};i.event.special[t]={setup:function(){var u=this.ownerDocument||this,f=i._data(u,t);f||u.addEventListener(n,r,!0);i._data(u,t,(f||0)+1)},teardown:function(){var u=this.ownerDocument||this,f=i._data(u,t)-1;f?i._data(u,t,f):(u.removeEventListener(n,r,!0),i._removeData(u,t))}}});i.fn.extend({on:function(n,t,r,u,f){var o,e;if("object"==typeof n){"string"!=typeof t&&(r=r||t,t=void 0);for(o in n)this.on(o,t,r,n[o],f);return this}if(null==r&&null==u?(u=t,r=t=void 0):null==u&&("string"==typeof t?(u=r,r=void 0):(u=r,r=t,t=void 0)),u===!1)u=it;else if(!u)return this;return 1===f&&(e=u,u=function(n){return i().off(n),e.apply(this,arguments)},u.guid=e.guid||(e.guid=i.guid++)),this.each(function(){i.event.add(this,n,u,r,t)})},one:function(n,t,i,r){return this.on(n,t,i,r,1)},off:function(n,t,r){var u,f;if(n&&n.preventDefault&&n.handleObj)return u=n.handleObj,i(n.delegateTarget).off(u.namespace?u.origType+"."+u.namespace:u.origType,u.selector,u.handler),this;if("object"==typeof n){for(f in n)this.off(f,t,n[f]);return this}return(t===!1||"function"==typeof t)&&(r=t,t=void 0),r===!1&&(r=it),this.each(function(){i.event.remove(this,n,r,t)})},trigger:function(n,t){return this.each(function(){i.event.trigger(n,t,this)})},triggerHandler:function(n,t){var r=this[0];if(r)return i.event.trigger(n,t,r,!0)}});function lr(n){var i=ar.split("|"),t=n.createDocumentFragment();if(t.createElement)while(i.length)t.createElement(i.pop());return t}var ar="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ue=/ jQuery\d+="(?:null|\d+)"/g,vr=new RegExp("<(?:"+ar+")[\\s/>]","i"),ei=/^\s+/,yr=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,pr=/<([\w:]+)/,wr=/<tbody/i,fe=/<|&#?\w+;/,ee=/<(?:script|style|link)/i,oe=/checked\s*(?:[^=]|=\s*.checked.)/i,br=/^$|\/(?:java|ecma)script/i,se=/^true\/(.*)/,he=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,o={option:[1,"<select multiple='multiple'>","<\/select>"],legend:[1,"<fieldset>","<\/fieldset>"],area:[1,"<map>","<\/map>"],param:[1,"<object>","<\/object>"],thead:[1,"<table>","<\/table>"],tr:[2,"<table><tbody>","<\/tbody><\/table>"],col:[2,"<table><tbody><\/tbody><colgroup>","<\/colgroup><\/table>"],td:[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"],_default:r.htmlSerialize?[0,"",""]:[1,"X<div>","<\/div>"]},ce=lr(u),oi=ce.appendChild(u.createElement("div"));o.optgroup=o.option;o.tbody=o.tfoot=o.colgroup=o.caption=o.thead;o.th=o.td;function f(n,t){var e,u,o=0,r=typeof n.getElementsByTagName!==s?n.getElementsByTagName(t||"*"):typeof n.querySelectorAll!==s?n.querySelectorAll(t||"*"):void 0;if(!r)for(r=[],e=n.childNodes||n;null!=(u=e[o]);o++)!t||i.nodeName(u,t)?r.push(u):i.merge(r,f(u,t));return void 0===t||t&&i.nodeName(n,t)?i.merge([n],r):r}function le(n){ui.test(n.type)&&(n.defaultChecked=n.checked)}function kr(n,t){return i.nodeName(n,"table")&&i.nodeName(11!==t.nodeType?t:t.firstChild,"tr")?n.getElementsByTagName("tbody")[0]||n.appendChild(n.ownerDocument.createElement("tbody")):n}function dr(n){return n.type=(null!==i.find.attr(n,"type"))+"/"+n.type,n}function gr(n){var t=se.exec(n.type);return t?n.type=t[1]:n.removeAttribute("type"),n}function si(n,t){for(var u,r=0;null!=(u=n[r]);r++)i._data(u,"globalEval",!t||i._data(t[r],"globalEval"))}function nu(n,t){if(1===t.nodeType&&i.hasData(n)){var u,f,o,s=i._data(n),r=i._data(t,s),e=s.events;if(e){delete r.handle;r.events={};for(u in e)for(f=0,o=e[u].length;o>f;f++)i.event.add(t,u,e[u][f])}r.data&&(r.data=i.extend({},r.data))}}function ae(n,t){var u,e,f;if(1===t.nodeType){if(u=t.nodeName.toLowerCase(),!r.noCloneEvent&&t[i.expando]){f=i._data(t);for(e in f.events)i.removeEvent(t,e,f.handle);t.removeAttribute(i.expando)}"script"===u&&t.text!==n.text?(dr(t).text=n.text,gr(t)):"object"===u?(t.parentNode&&(t.outerHTML=n.outerHTML),r.html5Clone&&n.innerHTML&&!i.trim(t.innerHTML)&&(t.innerHTML=n.innerHTML)):"input"===u&&ui.test(n.type)?(t.defaultChecked=t.checked=n.checked,t.value!==n.value&&(t.value=n.value)):"option"===u?t.defaultSelected=t.selected=n.defaultSelected:("input"===u||"textarea"===u)&&(t.defaultValue=n.defaultValue)}}i.extend({clone:function(n,t,u){var e,c,s,o,h,l=i.contains(n.ownerDocument,n);if(r.html5Clone||i.isXMLDoc(n)||!vr.test("<"+n.nodeName+">")?s=n.cloneNode(!0):(oi.innerHTML=n.outerHTML,oi.removeChild(s=oi.firstChild)),!(r.noCloneEvent&&r.noCloneChecked||1!==n.nodeType&&11!==n.nodeType||i.isXMLDoc(n)))for(e=f(s),h=f(n),o=0;null!=(c=h[o]);++o)e[o]&&ae(c,e[o]);if(t)if(u)for(h=h||f(n),e=e||f(s),o=0;null!=(c=h[o]);o++)nu(c,e[o]);else nu(n,s);return e=f(s,"script"),e.length>0&&si(e,!l&&f(n,"script")),e=h=c=null,s},buildFragment:function(n,t,u,e){for(var c,s,b,h,p,w,a,k=n.length,v=lr(t),l=[],y=0;k>y;y++)if(s=n[y],s||0===s)if("object"===i.type(s))i.merge(l,s.nodeType?[s]:s);else if(fe.test(s)){for(h=h||v.appendChild(t.createElement("div")),p=(pr.exec(s)||["",""])[1].toLowerCase(),a=o[p]||o._default,h.innerHTML=a[1]+s.replace(yr,"<$1><\/$2>")+a[2],c=a[0];c--;)h=h.lastChild;if(!r.leadingWhitespace&&ei.test(s)&&l.push(t.createTextNode(ei.exec(s)[0])),!r.tbody)for(s="table"!==p||wr.test(s)?"<table>"!==a[1]||wr.test(s)?0:h:h.firstChild,c=s&&s.childNodes.length;c--;)i.nodeName(w=s.childNodes[c],"tbody")&&!w.childNodes.length&&s.removeChild(w);for(i.merge(l,h.childNodes),h.textContent="";h.firstChild;)h.removeChild(h.firstChild);h=v.lastChild}else l.push(t.createTextNode(s));for(h&&v.removeChild(h),r.appendChecked||i.grep(f(l,"input"),le),y=0;s=l[y++];)if((!e||-1===i.inArray(s,e))&&(b=i.contains(s.ownerDocument,s),h=f(v.appendChild(s),"script"),b&&si(h),u))for(c=0;s=h[c++];)br.test(s.type||"")&&u.push(s);return h=null,v},cleanData:function(n,t){for(var u,e,f,o,a=0,h=i.expando,l=i.cache,v=r.deleteExpando,y=i.event.special;null!=(u=n[a]);a++)if((t||i.acceptData(u))&&(f=u[h],o=f&&l[f])){if(o.events)for(e in o.events)y[e]?i.event.remove(u,e):i.removeEvent(u,e,o.handle);l[f]&&(delete l[f],v?delete u[h]:typeof u.removeAttribute!==s?u.removeAttribute(h):u[h]=null,c.push(f))}}});i.fn.extend({text:function(n){return w(this,function(n){return void 0===n?i.text(this):this.empty().append((this[0]&&this[0].ownerDocument||u).createTextNode(n))},null,n,arguments.length)},append:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=kr(this,n);t.appendChild(n)}})},prepend:function(){return this.domManip(arguments,function(n){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=kr(this,n);t.insertBefore(n,t.firstChild)}})},before:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this)})},after:function(){return this.domManip(arguments,function(n){this.parentNode&&this.parentNode.insertBefore(n,this.nextSibling)})},remove:function(n,t){for(var r,e=n?i.filter(n,this):this,u=0;null!=(r=e[u]);u++)t||1!==r.nodeType||i.cleanData(f(r)),r.parentNode&&(t&&i.contains(r.ownerDocument,r)&&si(f(r,"script")),r.parentNode.removeChild(r));return this},empty:function(){for(var n,t=0;null!=(n=this[t]);t++){for(1===n.nodeType&&i.cleanData(f(n,!1));n.firstChild;)n.removeChild(n.firstChild);n.options&&i.nodeName(n,"select")&&(n.options.length=0)}return this},clone:function(n,t){return n=null==n?!1:n,t=null==t?n:t,this.map(function(){return i.clone(this,n,t)})},html:function(n){return w(this,function(n){var t=this[0]||{},u=0,e=this.length;if(void 0===n)return 1===t.nodeType?t.innerHTML.replace(ue,""):void 0;if(!("string"!=typeof n||ee.test(n)||!r.htmlSerialize&&vr.test(n)||!r.leadingWhitespace&&ei.test(n)||o[(pr.exec(n)||["",""])[1].toLowerCase()])){n=n.replace(yr,"<$1><\/$2>");try{for(;e>u;u++)t=this[u]||{},1===t.nodeType&&(i.cleanData(f(t,!1)),t.innerHTML=n);t=0}catch(s){}}t&&this.empty().append(n)},null,n,arguments.length)},replaceWith:function(){var n=arguments[0];return this.domManip(arguments,function(t){n=this.parentNode;i.cleanData(f(this));n&&n.replaceChild(t,this)}),n&&(n.length||n.nodeType)?this:this.remove()},detach:function(n){return this.remove(n,!0)},domManip:function(n,t){n=ki.apply([],n);var h,u,c,o,v,s,e=0,l=this.length,p=this,w=l-1,a=n[0],y=i.isFunction(a);if(y||l>1&&"string"==typeof a&&!r.checkClone&&oe.test(a))return this.each(function(i){var r=p.eq(i);y&&(n[0]=a.call(this,i,r.html()));r.domManip(n,t)});if(l&&(s=i.buildFragment(n,this[0].ownerDocument,!1,this),h=s.firstChild,1===s.childNodes.length&&(s=h),h)){for(o=i.map(f(s,"script"),dr),c=o.length;l>e;e++)u=s,e!==w&&(u=i.clone(u,!0,!0),c&&i.merge(o,f(u,"script"))),t.call(this[e],u,e);if(c)for(v=o[o.length-1].ownerDocument,i.map(o,gr),e=0;c>e;e++)u=o[e],br.test(u.type||"")&&!i._data(u,"globalEval")&&i.contains(v,u)&&(u.src?i._evalUrl&&i._evalUrl(u.src):i.globalEval((u.text||u.textContent||u.innerHTML||"").replace(he,"")));s=h=null}return this}});i.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(n,t){i.fn[n]=function(n){for(var u,r=0,f=[],e=i(n),o=e.length-1;o>=r;r++)u=r===o?this:this.clone(!0),i(e[r])[t](u),ni.apply(f,u.get());return this.pushStack(f)}});var ot,tu={};function iu(t,r){var f,u=i(r.createElement(t)).appendTo(r.body),e=n.getDefaultComputedStyle&&(f=n.getDefaultComputedStyle(u[0]))?f.display:i.css(u[0],"display");return u.detach(),e}function yt(n){var r=u,t=tu[n];return t||(t=iu(n,r),"none"!==t&&t||(ot=(ot||i("<iframe frameborder='0' width='0' height='0'/>")).appendTo(r.documentElement),r=(ot[0].contentWindow||ot[0].contentDocument).document,r.write(),r.close(),t=iu(n,r),ot.detach()),tu[n]=t),t}!function(){var n;r.shrinkWrapBlocks=function(){if(null!=n)return n;n=!1;var t,i,r;return i=u.getElementsByTagName("body")[0],i&&i.style?(t=u.createElement("div"),r=u.createElement("div"),r.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",i.appendChild(r).appendChild(t),typeof t.style.zoom!==s&&(t.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",t.appendChild(u.createElement("div")).style.width="5px",n=3!==t.offsetWidth),i.removeChild(r),n):void 0}}();var ru=/^margin/,pt=new RegExp("^("+at+")(?!px)[a-z%]+$","i"),b,k,ve=/^(top|right|bottom|left)$/;n.getComputedStyle?(b=function(n){return n.ownerDocument.defaultView.getComputedStyle(n,null)},k=function(n,t,r){var e,o,s,u,f=n.style;return r=r||b(n),u=r?r.getPropertyValue(t)||r[t]:void 0,r&&(""!==u||i.contains(n.ownerDocument,n)||(u=i.style(n,t)),pt.test(u)&&ru.test(t)&&(e=f.width,o=f.minWidth,s=f.maxWidth,f.minWidth=f.maxWidth=f.width=u,u=r.width,f.width=e,f.minWidth=o,f.maxWidth=s)),void 0===u?u:u+""}):u.documentElement.currentStyle&&(b=function(n){return n.currentStyle},k=function(n,t,i){var o,f,e,r,u=n.style;return i=i||b(n),r=i?i[t]:void 0,null==r&&u&&u[t]&&(r=u[t]),pt.test(r)&&!ve.test(t)&&(o=u.left,f=n.runtimeStyle,e=f&&f.left,e&&(f.left=n.currentStyle.left),u.left="fontSize"===t?"1em":r,r=u.pixelLeft+"px",u.left=o,e&&(f.left=e)),void 0===r?r:r+""||"auto"});function uu(n,t){return{get:function(){var i=n();if(null!=i)return i?void delete this.get:(this.get=t).apply(this,arguments)}}}!function(){var f,t,l,o,s,e,h;if(f=u.createElement("div"),f.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>",l=f.getElementsByTagName("a")[0],t=l&&l.style){t.cssText="float:left;opacity:.5";r.opacity="0.5"===t.opacity;r.cssFloat=!!t.cssFloat;f.style.backgroundClip="content-box";f.cloneNode(!0).style.backgroundClip="";r.clearCloneStyle="content-box"===f.style.backgroundClip;r.boxSizing=""===t.boxSizing||""===t.MozBoxSizing||""===t.WebkitBoxSizing;i.extend(r,{reliableHiddenOffsets:function(){return null==e&&c(),e},boxSizingReliable:function(){return null==s&&c(),s},pixelPosition:function(){return null==o&&c(),o},reliableMarginRight:function(){return null==h&&c(),h}});function c(){var i,r,f,t;r=u.getElementsByTagName("body")[0];r&&r.style&&(i=u.createElement("div"),f=u.createElement("div"),f.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",r.appendChild(f).appendChild(i),i.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",o=s=!1,h=!0,n.getComputedStyle&&(o="1%"!==(n.getComputedStyle(i,null)||{}).top,s="4px"===(n.getComputedStyle(i,null)||{width:"4px"}).width,t=i.appendChild(u.createElement("div")),t.style.cssText=i.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",t.style.marginRight=t.style.width="0",i.style.width="1px",h=!parseFloat((n.getComputedStyle(t,null)||{}).marginRight)),i.innerHTML="<table><tr><td><\/td><td>t<\/td><\/tr><\/table>",t=i.getElementsByTagName("td"),t[0].style.cssText="margin:0;border:0;padding:0;display:none",e=0===t[0].offsetHeight,e&&(t[0].style.display="",t[1].style.display="none",e=0===t[0].offsetHeight),r.removeChild(f))}}}();i.swap=function(n,t,i,r){var f,u,e={};for(u in t)e[u]=n.style[u],n.style[u]=t[u];f=i.apply(n,r||[]);for(u in t)n.style[u]=e[u];return f};var hi=/alpha\([^)]*\)/i,ye=/opacity\s*=\s*([^)]*)/,pe=/^(none|table(?!-c[ea]).+)/,we=new RegExp("^("+at+")(.*)$","i"),be=new RegExp("^([+-])=("+at+")","i"),ke={position:"absolute",visibility:"hidden",display:"block"},fu={letterSpacing:"0",fontWeight:"400"},eu=["Webkit","O","Moz","ms"];function ou(n,t){if(t in n)return t;for(var r=t.charAt(0).toUpperCase()+t.slice(1),u=t,i=eu.length;i--;)if(t=eu[i]+r,t in n)return t;return u}function su(n,t){for(var f,r,o,e=[],u=0,s=n.length;s>u;u++)r=n[u],r.style&&(e[u]=i._data(r,"olddisplay"),f=r.style.display,t?(e[u]||"none"!==f||(r.style.display=""),""===r.style.display&&et(r)&&(e[u]=i._data(r,"olddisplay",yt(r.nodeName)))):(o=et(r),(f&&"none"!==f||!o)&&i._data(r,"olddisplay",o?f:i.css(r,"display"))));for(u=0;s>u;u++)r=n[u],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?e[u]||"":"none"));return n}function hu(n,t,i){var r=we.exec(t);return r?Math.max(0,r[1]-(i||0))+(r[2]||"px"):t}function cu(n,t,r,u,f){for(var e=r===(u?"border":"content")?4:"width"===t?1:0,o=0;4>e;e+=2)"margin"===r&&(o+=i.css(n,r+p[e],!0,f)),u?("content"===r&&(o-=i.css(n,"padding"+p[e],!0,f)),"margin"!==r&&(o-=i.css(n,"border"+p[e]+"Width",!0,f))):(o+=i.css(n,"padding"+p[e],!0,f),"padding"!==r&&(o+=i.css(n,"border"+p[e]+"Width",!0,f)));return o}function lu(n,t,u){var o=!0,f="width"===t?n.offsetWidth:n.offsetHeight,e=b(n),s=r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e);if(0>=f||null==f){if(f=k(n,t,e),(0>f||null==f)&&(f=n.style[t]),pt.test(f))return f;o=s&&(r.boxSizingReliable()||f===n.style[t]);f=parseFloat(f)||0}return f+cu(n,t,u||(s?"border":"content"),o,e)+"px"}i.extend({cssHooks:{opacity:{get:function(n,t){if(t){var i=k(n,"opacity");return""===i?"1":i}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{float:r.cssFloat?"cssFloat":"styleFloat"},style:function(n,t,u,f){if(n&&3!==n.nodeType&&8!==n.nodeType&&n.style){var o,h,e,s=i.camelCase(t),c=n.style;if(t=i.cssProps[s]||(i.cssProps[s]=ou(c,s)),e=i.cssHooks[t]||i.cssHooks[s],void 0===u)return e&&"get"in e&&void 0!==(o=e.get(n,!1,f))?o:c[t];if(h=typeof u,"string"===h&&(o=be.exec(u))&&(u=(o[1]+1)*o[2]+parseFloat(i.css(n,t)),h="number"),null!=u&&u===u&&("number"!==h||i.cssNumber[s]||(u+="px"),r.clearCloneStyle||""!==u||0!==t.indexOf("background")||(c[t]="inherit"),!(e&&"set"in e&&void 0===(u=e.set(n,u,f)))))try{c[t]=u}catch(l){}}},css:function(n,t,r,u){var s,f,e,o=i.camelCase(t);return t=i.cssProps[o]||(i.cssProps[o]=ou(n.style,o)),e=i.cssHooks[t]||i.cssHooks[o],e&&"get"in e&&(f=e.get(n,!0,r)),void 0===f&&(f=k(n,t,u)),"normal"===f&&t in fu&&(f=fu[t]),""===r||r?(s=parseFloat(f),r===!0||i.isNumeric(s)?s||0:f):f}});i.each(["height","width"],function(n,t){i.cssHooks[t]={get:function(n,r,u){if(r)return pe.test(i.css(n,"display"))&&0===n.offsetWidth?i.swap(n,ke,function(){return lu(n,t,u)}):lu(n,t,u)},set:function(n,u,f){var e=f&&b(n);return hu(n,u,f?cu(n,t,f,r.boxSizing&&"border-box"===i.css(n,"boxSizing",!1,e),e):0)}}});r.opacity||(i.cssHooks.opacity={get:function(n,t){return ye.test((t&&n.currentStyle?n.currentStyle.filter:n.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(n,t){var r=n.style,u=n.currentStyle,e=i.isNumeric(t)?"alpha(opacity="+100*t+")":"",f=u&&u.filter||r.filter||"";r.zoom=1;(t>=1||""===t)&&""===i.trim(f.replace(hi,""))&&r.removeAttribute&&(r.removeAttribute("filter"),""===t||u&&!u.filter)||(r.filter=hi.test(f)?f.replace(hi,e):f+" "+e)}});i.cssHooks.marginRight=uu(r.reliableMarginRight,function(n,t){if(t)return i.swap(n,{display:"inline-block"},k,[n,"marginRight"])});i.each({margin:"",padding:"",border:"Width"},function(n,t){i.cssHooks[n+t]={expand:function(i){for(var r=0,f={},u="string"==typeof i?i.split(" "):[i];4>r;r++)f[n+p[r]+t]=u[r]||u[r-2]||u[0];return f}};ru.test(n)||(i.cssHooks[n+t].set=hu)});i.fn.extend({css:function(n,t){return w(this,function(n,t,r){var f,e,o={},u=0;if(i.isArray(t)){for(f=b(n),e=t.length;e>u;u++)o[t[u]]=i.css(n,t[u],!1,f);return o}return void 0!==r?i.style(n,t,r):i.css(n,t)},n,t,arguments.length>1)},show:function(){return su(this,!0)},hide:function(){return su(this)},toggle:function(n){return"boolean"==typeof n?n?this.show():this.hide():this.each(function(){et(this)?i(this).show():i(this).hide()})}});function e(n,t,i,r,u){return new e.prototype.init(n,t,i,r,u)}i.Tween=e;e.prototype={constructor:e,init:function(n,t,r,u,f,e){this.elem=n;this.prop=r;this.easing=f||"swing";this.options=t;this.start=this.now=this.cur();this.end=u;this.unit=e||(i.cssNumber[r]?"":"px")},cur:function(){var n=e.propHooks[this.prop];return n&&n.get?n.get(this):e.propHooks._default.get(this)},run:function(n){var r,t=e.propHooks[this.prop];return this.pos=r=this.options.duration?i.easing[this.easing](n,this.options.duration*n,0,1,this.options.duration):n,this.now=(this.end-this.start)*r+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),t&&t.set?t.set(this):e.propHooks._default.set(this),this}};e.prototype.init.prototype=e.prototype;e.propHooks={_default:{get:function(n){var t;return null==n.elem[n.prop]||n.elem.style&&null!=n.elem.style[n.prop]?(t=i.css(n.elem,n.prop,""),t&&"auto"!==t?t:0):n.elem[n.prop]},set:function(n){i.fx.step[n.prop]?i.fx.step[n.prop](n):n.elem.style&&(null!=n.elem.style[i.cssProps[n.prop]]||i.cssHooks[n.prop])?i.style(n.elem,n.prop,n.now+n.unit):n.elem[n.prop]=n.now}}};e.propHooks.scrollTop=e.propHooks.scrollLeft={set:function(n){n.elem.nodeType&&n.elem.parentNode&&(n.elem[n.prop]=n.now)}};i.easing={linear:function(n){return n},swing:function(n){return.5-Math.cos(n*Math.PI)/2}};i.fx=e.prototype.init;i.fx.step={};var rt,wt,de=/^(?:toggle|show|hide)$/,au=new RegExp("^(?:([+-])=|)("+at+")([a-z%]*)$","i"),ge=/queueHooks$/,bt=[no],st={"*":[function(n,t){var f=this.createTween(n,t),s=f.cur(),r=au.exec(t),e=r&&r[3]||(i.cssNumber[n]?"":"px"),u=(i.cssNumber[n]||"px"!==e&&+s)&&au.exec(i.css(f.elem,n)),o=1,h=20;if(u&&u[3]!==e){e=e||u[3];r=r||[];u=+s||1;do o=o||".5",u/=o,i.style(f.elem,n,u+e);while(o!==(o=f.cur()/s)&&1!==o&&--h)}return r&&(u=f.start=+u||+s||0,f.unit=e,f.end=r[1]?u+(r[1]+1)*r[2]:+r[2]),f}]};function vu(){return setTimeout(function(){rt=void 0}),rt=i.now()}function kt(n,t){var r,i={height:n},u=0;for(t=t?1:0;4>u;u+=2-t)r=p[u],i["margin"+r]=i["padding"+r]=n;return t&&(i.opacity=i.width=n),i}function yu(n,t,i){for(var u,f=(st[t]||[]).concat(st["*"]),r=0,e=f.length;e>r;r++)if(u=f[r].call(i,t,n))return u}function no(n,t,u){var f,a,p,v,s,w,h,b,l=this,y={},o=n.style,c=n.nodeType&&et(n),e=i._data(n,"fxshow");u.queue||(s=i._queueHooks(n,"fx"),null==s.unqueued&&(s.unqueued=0,w=s.empty.fire,s.empty.fire=function(){s.unqueued||w()}),s.unqueued++,l.always(function(){l.always(function(){s.unqueued--;i.queue(n,"fx").length||s.empty.fire()})}));1===n.nodeType&&("height"in t||"width"in t)&&(u.overflow=[o.overflow,o.overflowX,o.overflowY],h=i.css(n,"display"),b="none"===h?i._data(n,"olddisplay")||yt(n.nodeName):h,"inline"===b&&"none"===i.css(n,"float")&&(r.inlineBlockNeedsLayout&&"inline"!==yt(n.nodeName)?o.zoom=1:o.display="inline-block"));u.overflow&&(o.overflow="hidden",r.shrinkWrapBlocks()||l.always(function(){o.overflow=u.overflow[0];o.overflowX=u.overflow[1];o.overflowY=u.overflow[2]}));for(f in t)if(a=t[f],de.exec(a)){if(delete t[f],p=p||"toggle"===a,a===(c?"hide":"show")){if("show"!==a||!e||void 0===e[f])continue;c=!0}y[f]=e&&e[f]||i.style(n,f)}else h=void 0;if(i.isEmptyObject(y))"inline"===("none"===h?yt(n.nodeName):h)&&(o.display=h);else{e?"hidden"in e&&(c=e.hidden):e=i._data(n,"fxshow",{});p&&(e.hidden=!c);c?i(n).show():l.done(function(){i(n).hide()});l.done(function(){var t;i._removeData(n,"fxshow");for(t in y)i.style(n,t,y[t])});for(f in y)v=yu(c?e[f]:0,f,l),f in e||(e[f]=v.start,c&&(v.end=v.start,v.start="width"===f||"height"===f?1:0))}}function to(n,t){var r,f,e,u,o;for(r in n)if(f=i.camelCase(r),e=t[f],u=n[r],i.isArray(u)&&(e=u[1],u=n[r]=u[0]),r!==f&&(n[f]=u,delete n[r]),o=i.cssHooks[f],o&&"expand"in o){u=o.expand(u);delete n[f];for(r in u)r in n||(n[r]=u[r],t[r]=e)}else t[f]=e}function pu(n,t,r){var h,e,o=0,l=bt.length,f=i.Deferred().always(function(){delete c.elem}),c=function(){if(e)return!1;for(var s=rt||vu(),t=Math.max(0,u.startTime+u.duration-s),h=t/u.duration||0,i=1-h,r=0,o=u.tweens.length;o>r;r++)u.tweens[r].run(i);return f.notifyWith(n,[u,i,t]),1>i&&o?t:(f.resolveWith(n,[u]),!1)},u=f.promise({elem:n,props:i.extend({},t),opts:i.extend(!0,{specialEasing:{}},r),originalProperties:t,originalOptions:r,startTime:rt||vu(),duration:r.duration,tweens:[],createTween:function(t,r){var f=i.Tween(n,u.opts,t,r,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(f),f},stop:function(t){var i=0,r=t?u.tweens.length:0;if(e)return this;for(e=!0;r>i;i++)u.tweens[i].run(1);return t?f.resolveWith(n,[u,t]):f.rejectWith(n,[u,t]),this}}),s=u.props;for(to(s,u.opts.specialEasing);l>o;o++)if(h=bt[o].call(u,n,s,u.opts))return h;return i.map(s,yu,u),i.isFunction(u.opts.start)&&u.opts.start.call(n,u),i.fx.timer(i.extend(c,{elem:n,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}i.Animation=i.extend(pu,{tweener:function(n,t){i.isFunction(n)?(t=n,n=["*"]):n=n.split(" ");for(var r,u=0,f=n.length;f>u;u++)r=n[u],st[r]=st[r]||[],st[r].unshift(t)},prefilter:function(n,t){t?bt.unshift(n):bt.push(n)}});i.speed=function(n,t,r){var u=n&&"object"==typeof n?i.extend({},n):{complete:r||!r&&t||i.isFunction(n)&&n,duration:n,easing:r&&t||t&&!i.isFunction(t)&&t};return u.duration=i.fx.off?0:"number"==typeof u.duration?u.duration:u.duration in i.fx.speeds?i.fx.speeds[u.duration]:i.fx.speeds._default,(null==u.queue||u.queue===!0)&&(u.queue="fx"),u.old=u.complete,u.complete=function(){i.isFunction(u.old)&&u.old.call(this);u.queue&&i.dequeue(this,u.queue)},u};i.fn.extend({fadeTo:function(n,t,i,r){return this.filter(et).css("opacity",0).show().end().animate({opacity:t},n,i,r)},animate:function(n,t,r,u){var o=i.isEmptyObject(n),e=i.speed(t,r,u),f=function(){var t=pu(this,i.extend({},n),e);(o||i._data(this,"finish"))&&t.stop(!0)};return f.finish=f,o||e.queue===!1?this.each(f):this.queue(e.queue,f)},stop:function(n,t,r){var u=function(n){var t=n.stop;delete n.stop;t(r)};return"string"!=typeof n&&(r=t,t=n,n=void 0),t&&n!==!1&&this.queue(n||"fx",[]),this.each(function(){var o=!0,t=null!=n&&n+"queueHooks",e=i.timers,f=i._data(this);if(t)f[t]&&f[t].stop&&u(f[t]);else for(t in f)f[t]&&f[t].stop&&ge.test(t)&&u(f[t]);for(t=e.length;t--;)e[t].elem!==this||null!=n&&e[t].queue!==n||(e[t].anim.stop(r),o=!1,e.splice(t,1));(o||!r)&&i.dequeue(this,n)})},finish:function(n){return n!==!1&&(n=n||"fx"),this.each(function(){var t,f=i._data(this),r=f[n+"queue"],e=f[n+"queueHooks"],u=i.timers,o=r?r.length:0;for(f.finish=!0,i.queue(this,n,[]),e&&e.stop&&e.stop.call(this,!0),t=u.length;t--;)u[t].elem===this&&u[t].queue===n&&(u[t].anim.stop(!0),u.splice(t,1));for(t=0;o>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete f.finish})}});i.each(["toggle","show","hide"],function(n,t){var r=i.fn[t];i.fn[t]=function(n,i,u){return null==n||"boolean"==typeof n?r.apply(this,arguments):this.animate(kt(t,!0),n,i,u)}});i.each({slideDown:kt("show"),slideUp:kt("hide"),slideToggle:kt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(n,t){i.fn[n]=function(n,i,r){return this.animate(t,n,i,r)}});i.timers=[];i.fx.tick=function(){var r,n=i.timers,t=0;for(rt=i.now();t<n.length;t++)r=n[t],r()||n[t]!==r||n.splice(t--,1);n.length||i.fx.stop();rt=void 0};i.fx.timer=function(n){i.timers.push(n);n()?i.fx.start():i.timers.pop()};i.fx.interval=13;i.fx.start=function(){wt||(wt=setInterval(i.fx.tick,i.fx.interval))};i.fx.stop=function(){clearInterval(wt);wt=null};i.fx.speeds={slow:600,fast:200,_default:400};i.fn.delay=function(n,t){return n=i.fx?i.fx.speeds[n]||n:n,t=t||"fx",this.queue(t,function(t,i){var r=setTimeout(t,n);i.stop=function(){clearTimeout(r)}})},function(){var n,t,f,i,e;t=u.createElement("div");t.setAttribute("className","t");t.innerHTML=" <link/><table><\/table><a href='/a'>a<\/a><input type='checkbox'/>";i=t.getElementsByTagName("a")[0];f=u.createElement("select");e=f.appendChild(u.createElement("option"));n=t.getElementsByTagName("input")[0];i.style.cssText="top:1px";r.getSetAttribute="t"!==t.className;r.style=/top/.test(i.getAttribute("style"));r.hrefNormalized="/a"===i.getAttribute("href");r.checkOn=!!n.value;r.optSelected=e.selected;r.enctype=!!u.createElement("form").enctype;f.disabled=!0;r.optDisabled=!e.disabled;n=u.createElement("input");n.setAttribute("value","");r.input=""===n.getAttribute("value");n.value="t";n.setAttribute("type","radio");r.radioValue="t"===n.value}();var io=/\r/g;i.fn.extend({val:function(n){var t,r,f,u=this[0];return arguments.length?(f=i.isFunction(n),this.each(function(r){var u;1===this.nodeType&&(u=f?n.call(this,r,i(this).val()):n,null==u?u="":"number"==typeof u?u+="":i.isArray(u)&&(u=i.map(u,function(n){return null==n?"":n+""})),t=i.valHooks[this.type]||i.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,u,"value")||(this.value=u))})):u?(t=i.valHooks[u.type]||i.valHooks[u.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(r=t.get(u,"value"))?r:(r=u.value,"string"==typeof r?r.replace(io,""):null==r?"":r)):void 0}});i.extend({valHooks:{option:{get:function(n){var t=i.find.attr(n,"value");return null!=t?t:i.trim(i.text(n))}},select:{get:function(n){for(var o,t,s=n.options,u=n.selectedIndex,f="select-one"===n.type||0>u,h=f?null:[],c=f?u+1:s.length,e=0>u?c:f?u:0;c>e;e++)if(t=s[e],!(!t.selected&&e!==u||(r.optDisabled?t.disabled:null!==t.getAttribute("disabled"))||t.parentNode.disabled&&i.nodeName(t.parentNode,"optgroup"))){if(o=i(t).val(),f)return o;h.push(o)}return h},set:function(n,t){for(var f,r,u=n.options,o=i.makeArray(t),e=u.length;e--;)if(r=u[e],i.inArray(i.valHooks.option.get(r),o)>=0)try{r.selected=f=!0}catch(s){r.scrollHeight}else r.selected=!1;return f||(n.selectedIndex=-1),u}}}});i.each(["radio","checkbox"],function(){i.valHooks[this]={set:function(n,t){if(i.isArray(t))return n.checked=i.inArray(i(n).val(),t)>=0}};r.checkOn||(i.valHooks[this].get=function(n){return null===n.getAttribute("value")?"on":n.value})});var ut,wu,v=i.expr.attrHandle,ci=/^(?:checked|selected)$/i,d=r.getSetAttribute,dt=r.input;i.fn.extend({attr:function(n,t){return w(this,i.attr,n,t,arguments.length>1)},removeAttr:function(n){return this.each(function(){i.removeAttr(this,n)})}});i.extend({attr:function(n,t,r){var u,f,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return typeof n.getAttribute===s?i.prop(n,t,r):(1===e&&i.isXMLDoc(n)||(t=t.toLowerCase(),u=i.attrHooks[t]||(i.expr.match.bool.test(t)?wu:ut)),void 0===r?u&&"get"in u&&null!==(f=u.get(n,t))?f:(f=i.find.attr(n,t),null==f?void 0:f):null!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:(n.setAttribute(t,r+""),r):void i.removeAttr(n,t))},removeAttr:function(n,t){var r,u,e=0,f=t&&t.match(h);if(f&&1===n.nodeType)while(r=f[e++])u=i.propFix[r]||r,i.expr.match.bool.test(r)?dt&&d||!ci.test(r)?n[u]=!1:n[i.camelCase("default-"+r)]=n[u]=!1:i.attr(n,r,""),n.removeAttribute(d?r:u)},attrHooks:{type:{set:function(n,t){if(!r.radioValue&&"radio"===t&&i.nodeName(n,"input")){var u=n.value;return n.setAttribute("type",t),u&&(n.value=u),t}}}}});wu={set:function(n,t,r){return t===!1?i.removeAttr(n,r):dt&&d||!ci.test(r)?n.setAttribute(!d&&i.propFix[r]||r,r):n[i.camelCase("default-"+r)]=n[r]=!0,r}};i.each(i.expr.match.bool.source.match(/\w+/g),function(n,t){var r=v[t]||i.find.attr;v[t]=dt&&d||!ci.test(t)?function(n,t,i){var u,f;return i||(f=v[t],v[t]=u,u=null!=r(n,t,i)?t.toLowerCase():null,v[t]=f),u}:function(n,t,r){if(!r)return n[i.camelCase("default-"+t)]?t.toLowerCase():null}});dt&&d||(i.attrHooks.value={set:function(n,t,r){return i.nodeName(n,"input")?void(n.defaultValue=t):ut&&ut.set(n,t,r)}});d||(ut={set:function(n,t,i){var r=n.getAttributeNode(i);return r||n.setAttributeNode(r=n.ownerDocument.createAttribute(i)),r.value=t+="","value"===i||t===n.getAttribute(i)?t:void 0}},v.id=v.name=v.coords=function(n,t,i){var r;if(!i)return(r=n.getAttributeNode(t))&&""!==r.value?r.value:null},i.valHooks.button={get:function(n,t){var i=n.getAttributeNode(t);if(i&&i.specified)return i.value},set:ut.set},i.attrHooks.contenteditable={set:function(n,t,i){ut.set(n,""===t?!1:t,i)}},i.each(["width","height"],function(n,t){i.attrHooks[t]={set:function(n,i){if(""===i)return(n.setAttribute(t,"auto"),i)}}}));r.style||(i.attrHooks.style={get:function(n){return n.style.cssText||void 0},set:function(n,t){return n.style.cssText=t+""}});var ro=/^(?:input|select|textarea|button|object)$/i,uo=/^(?:a|area)$/i;i.fn.extend({prop:function(n,t){return w(this,i.prop,n,t,arguments.length>1)},removeProp:function(n){return n=i.propFix[n]||n,this.each(function(){try{this[n]=void 0;delete this[n]}catch(t){}})}});i.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(n,t,r){var f,u,o,e=n.nodeType;if(n&&3!==e&&8!==e&&2!==e)return o=1!==e||!i.isXMLDoc(n),o&&(t=i.propFix[t]||t,u=i.propHooks[t]),void 0!==r?u&&"set"in u&&void 0!==(f=u.set(n,r,t))?f:n[t]=r:u&&"get"in u&&null!==(f=u.get(n,t))?f:n[t]},propHooks:{tabIndex:{get:function(n){var t=i.find.attr(n,"tabindex");return t?parseInt(t,10):ro.test(n.nodeName)||uo.test(n.nodeName)&&n.href?0:-1}}}});r.hrefNormalized||i.each(["href","src"],function(n,t){i.propHooks[t]={get:function(n){return n.getAttribute(t,4)}}});r.optSelected||(i.propHooks.selected={get:function(n){var t=n.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}});i.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){i.propFix[this.toLowerCase()]=this});r.enctype||(i.propFix.enctype="encoding");var li=/[\t\r\n\f]/g;i.fn.extend({addClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l="string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).addClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(li," "):" ")){for(s=0;u=o[s++];)r.indexOf(" "+u+" ")<0&&(r+=u+" ");f=i.trim(r);t.className!==f&&(t.className=f)}return this},removeClass:function(n){var o,t,r,u,s,f,e=0,c=this.length,l=0===arguments.length||"string"==typeof n&&n;if(i.isFunction(n))return this.each(function(t){i(this).removeClass(n.call(this,t,this.className))});if(l)for(o=(n||"").match(h)||[];c>e;e++)if(t=this[e],r=1===t.nodeType&&(t.className?(" "+t.className+" ").replace(li," "):"")){for(s=0;u=o[s++];)while(r.indexOf(" "+u+" ")>=0)r=r.replace(" "+u+" "," ");f=n?i.trim(r):"";t.className!==f&&(t.className=f)}return this},toggleClass:function(n,t){var r=typeof n;return"boolean"==typeof t&&"string"===r?t?this.addClass(n):this.removeClass(n):this.each(i.isFunction(n)?function(r){i(this).toggleClass(n.call(this,r,this.className,t),t)}:function(){if("string"===r)for(var t,f=0,u=i(this),e=n.match(h)||[];t=e[f++];)u.hasClass(t)?u.removeClass(t):u.addClass(t);else(r===s||"boolean"===r)&&(this.className&&i._data(this,"__className__",this.className),this.className=this.className||n===!1?"":i._data(this,"__className__")||"")})},hasClass:function(n){for(var i=" "+n+" ",t=0,r=this.length;r>t;t++)if(1===this[t].nodeType&&(" "+this[t].className+" ").replace(li," ").indexOf(i)>=0)return!0;return!1}});i.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(n,t){i.fn[t]=function(n,i){return arguments.length>0?this.on(t,null,n,i):this.trigger(t)}});i.fn.extend({hover:function(n,t){return this.mouseenter(n).mouseleave(t||n)},bind:function(n,t,i){return this.on(n,null,t,i)},unbind:function(n,t){return this.off(n,null,t)},delegate:function(n,t,i,r){return this.on(t,n,i,r)},undelegate:function(n,t,i){return 1===arguments.length?this.off(n,"**"):this.off(t,n||"**",i)}});var ai=i.now(),vi=/\?/,fo=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;i.parseJSON=function(t){if(n.JSON&&n.JSON.parse)return n.JSON.parse(t+"");var f,r=null,u=i.trim(t+"");return u&&!i.trim(u.replace(fo,function(n,t,i,u){return f&&t&&(r=0),0===r?n:(f=i||t,r+=!u-!i,"")}))?Function("return "+u)():i.error("Invalid JSON: "+t)};i.parseXML=function(t){var r,u;if(!t||"string"!=typeof t)return null;try{n.DOMParser?(u=new DOMParser,r=u.parseFromString(t,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(t))}catch(f){r=void 0}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||i.error("Invalid XML: "+t),r};var g,y,eo=/#.*$/,bu=/([?&])_=[^&]*/,oo=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,so=/^(?:GET|HEAD)$/,ho=/^\/\//,ku=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,du={},yi={},gu="*/".concat("*");try{y=location.href}catch(ns){y=u.createElement("a");y.href="";y=y.href}g=ku.exec(y.toLowerCase())||[];function nf(n){return function(t,r){"string"!=typeof t&&(r=t,t="*");var u,f=0,e=t.toLowerCase().match(h)||[];if(i.isFunction(r))while(u=e[f++])"+"===u.charAt(0)?(u=u.slice(1)||"*",(n[u]=n[u]||[]).unshift(r)):(n[u]=n[u]||[]).push(r)}}function tf(n,t,r,u){var f={},o=n===yi;function e(s){var h;return f[s]=!0,i.each(n[s]||[],function(n,i){var s=i(t,r,u);return"string"!=typeof s||o||f[s]?o?!(h=s):void 0:(t.dataTypes.unshift(s),e(s),!1)}),h}return e(t.dataTypes[0])||!f["*"]&&e("*")}function pi(n,t){var u,r,f=i.ajaxSettings.flatOptions||{};for(r in t)void 0!==t[r]&&((f[r]?n:u||(u={}))[r]=t[r]);return u&&i.extend(!0,n,u),n}function co(n,t,i){for(var o,e,u,f,s=n.contents,r=n.dataTypes;"*"===r[0];)r.shift(),void 0===e&&(e=n.mimeType||t.getResponseHeader("Content-Type"));if(e)for(f in s)if(s[f]&&s[f].test(e)){r.unshift(f);break}if(r[0]in i)u=r[0];else{for(f in i){if(!r[0]||n.converters[f+" "+r[0]]){u=f;break}o||(o=f)}u=u||o}if(u)return(u!==r[0]&&r.unshift(u),i[u])}function lo(n,t,i,r){var h,u,f,s,e,o={},c=n.dataTypes.slice();if(c[1])for(f in n.converters)o[f.toLowerCase()]=n.converters[f];for(u=c.shift();u;)if(n.responseFields[u]&&(i[n.responseFields[u]]=t),!e&&r&&n.dataFilter&&(t=n.dataFilter(t,n.dataType)),e=u,u=c.shift())if("*"===u)u=e;else if("*"!==e&&e!==u){if(f=o[e+" "+u]||o["* "+u],!f)for(h in o)if(s=h.split(" "),s[1]===u&&(f=o[e+" "+s[0]]||o["* "+s[0]])){f===!0?f=o[h]:o[h]!==!0&&(u=s[0],c.unshift(s[1]));break}if(f!==!0)if(f&&n.throws)t=f(t);else try{t=f(t)}catch(l){return{state:"parsererror",error:f?l:"No conversion from "+e+" to "+u}}}return{state:"success",data:t}}i.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:y,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(g[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":gu,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":i.parseJSON,"text xml":i.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(n,t){return t?pi(pi(n,i.ajaxSettings),t):pi(i.ajaxSettings,n)},ajaxPrefilter:nf(du),ajaxTransport:nf(yi),ajax:function(n,t){"object"==typeof n&&(t=n,n=void 0);t=t||{};var s,c,f,b,k,l,a,v,r=i.ajaxSetup({},t),o=r.context||r,d=r.context&&(o.nodeType||o.jquery)?i(o):i.event,nt=i.Deferred(),tt=i.Callbacks("once memory"),p=r.statusCode||{},it={},rt={},e=0,ut="canceled",u={readyState:0,getResponseHeader:function(n){var t;if(2===e){if(!v)for(v={};t=oo.exec(b);)v[t[1].toLowerCase()]=t[2];t=v[n.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===e?b:null},setRequestHeader:function(n,t){var i=n.toLowerCase();return e||(n=rt[i]=rt[i]||n,it[n]=t),this},overrideMimeType:function(n){return e||(r.mimeType=n),this},statusCode:function(n){var t;if(n)if(2>e)for(t in n)p[t]=[p[t],n[t]];else u.always(n[u.status]);return this},abort:function(n){var t=n||ut;return a&&a.abort(t),w(0,t),this}};if(nt.promise(u).complete=tt.add,u.success=u.done,u.error=u.fail,r.url=((n||r.url||y)+"").replace(eo,"").replace(ho,g[1]+"//"),r.type=t.method||t.type||r.method||r.type,r.dataTypes=i.trim(r.dataType||"*").toLowerCase().match(h)||[""],null==r.crossDomain&&(s=ku.exec(r.url.toLowerCase()),r.crossDomain=!(!s||s[1]===g[1]&&s[2]===g[2]&&(s[3]||("http:"===s[1]?"80":"443"))===(g[3]||("http:"===g[1]?"80":"443")))),r.data&&r.processData&&"string"!=typeof r.data&&(r.data=i.param(r.data,r.traditional)),tf(du,r,t,u),2===e)return u;l=r.global;l&&0==i.active++&&i.event.trigger("ajaxStart");r.type=r.type.toUpperCase();r.hasContent=!so.test(r.type);f=r.url;r.hasContent||(r.data&&(f=r.url+=(vi.test(f)?"&":"?")+r.data,delete r.data),r.cache===!1&&(r.url=bu.test(f)?f.replace(bu,"$1_="+ai++):f+(vi.test(f)?"&":"?")+"_="+ai++));r.ifModified&&(i.lastModified[f]&&u.setRequestHeader("If-Modified-Since",i.lastModified[f]),i.etag[f]&&u.setRequestHeader("If-None-Match",i.etag[f]));(r.data&&r.hasContent&&r.contentType!==!1||t.contentType)&&u.setRequestHeader("Content-Type",r.contentType);u.setRequestHeader("Accept",r.dataTypes[0]&&r.accepts[r.dataTypes[0]]?r.accepts[r.dataTypes[0]]+("*"!==r.dataTypes[0]?", "+gu+"; q=0.01":""):r.accepts["*"]);for(c in r.headers)u.setRequestHeader(c,r.headers[c]);if(r.beforeSend&&(r.beforeSend.call(o,u,r)===!1||2===e))return u.abort();ut="abort";for(c in{success:1,error:1,complete:1})u[c](r[c]);if(a=tf(yi,r,t,u)){u.readyState=1;l&&d.trigger("ajaxSend",[u,r]);r.async&&r.timeout>0&&(k=setTimeout(function(){u.abort("timeout")},r.timeout));try{e=1;a.send(it,w)}catch(ft){if(!(2>e))throw ft;w(-1,ft)}}else w(-1,"No Transport");function w(n,t,s,h){var v,it,g,y,w,c=t;2!==e&&(e=2,k&&clearTimeout(k),a=void 0,b=h||"",u.readyState=n>0?4:0,v=n>=200&&300>n||304===n,s&&(y=co(r,u,s)),y=lo(r,y,u,v),v?(r.ifModified&&(w=u.getResponseHeader("Last-Modified"),w&&(i.lastModified[f]=w),w=u.getResponseHeader("etag"),w&&(i.etag[f]=w)),204===n||"HEAD"===r.type?c="nocontent":304===n?c="notmodified":(c=y.state,it=y.data,g=y.error,v=!g)):(g=c,(n||!c)&&(c="error",0>n&&(n=0))),u.status=n,u.statusText=(t||c)+"",v?nt.resolveWith(o,[it,c,u]):nt.rejectWith(o,[u,c,g]),u.statusCode(p),p=void 0,l&&d.trigger(v?"ajaxSuccess":"ajaxError",[u,r,v?it:g]),tt.fireWith(o,[u,c]),l&&(d.trigger("ajaxComplete",[u,r]),--i.active||i.event.trigger("ajaxStop")))}return u},getJSON:function(n,t,r){return i.get(n,t,r,"json")},getScript:function(n,t){return i.get(n,void 0,t,"script")}});i.each(["get","post"],function(n,t){i[t]=function(n,r,u,f){return i.isFunction(r)&&(f=f||u,u=r,r=void 0),i.ajax({url:n,type:t,dataType:f,data:r,success:u})}});i.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(n,t){i.fn[t]=function(n){return this.on(t,n)}});i._evalUrl=function(n){return i.ajax({url:n,type:"GET",dataType:"script",async:!1,global:!1,throws:!0})};i.fn.extend({wrapAll:function(n){if(i.isFunction(n))return this.each(function(t){i(this).wrapAll(n.call(this,t))});if(this[0]){var t=i(n,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]);t.map(function(){for(var n=this;n.firstChild&&1===n.firstChild.nodeType;)n=n.firstChild;return n}).append(this)}return this},wrapInner:function(n){return this.each(i.isFunction(n)?function(t){i(this).wrapInner(n.call(this,t))}:function(){var t=i(this),r=t.contents();r.length?r.wrapAll(n):t.append(n)})},wrap:function(n){var t=i.isFunction(n);return this.each(function(r){i(this).wrapAll(t?n.call(this,r):n)})},unwrap:function(){return this.parent().each(function(){i.nodeName(this,"body")||i(this).replaceWith(this.childNodes)}).end()}});i.expr.filters.hidden=function(n){return n.offsetWidth<=0&&n.offsetHeight<=0||!r.reliableHiddenOffsets()&&"none"===(n.style&&n.style.display||i.css(n,"display"))};i.expr.filters.visible=function(n){return!i.expr.filters.hidden(n)};var ao=/%20/g,vo=/\[\]$/,rf=/\r?\n/g,yo=/^(?:submit|button|image|reset|file)$/i,po=/^(?:input|select|textarea|keygen)/i;function wi(n,t,r,u){var f;if(i.isArray(t))i.each(t,function(t,i){r||vo.test(n)?u(n,i):wi(n+"["+("object"==typeof i?t:"")+"]",i,r,u)});else if(r||"object"!==i.type(t))u(n,t);else for(f in t)wi(n+"["+f+"]",t[f],r,u)}i.param=function(n,t){var r,u=[],f=function(n,t){t=i.isFunction(t)?t():null==t?"":t;u[u.length]=encodeURIComponent(n)+"="+encodeURIComponent(t)};if(void 0===t&&(t=i.ajaxSettings&&i.ajaxSettings.traditional),i.isArray(n)||n.jquery&&!i.isPlainObject(n))i.each(n,function(){f(this.name,this.value)});else for(r in n)wi(r,n[r],t,f);return u.join("&").replace(ao,"+")};i.fn.extend({serialize:function(){return i.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var n=i.prop(this,"elements");return n?i.makeArray(n):this}).filter(function(){var n=this.type;return this.name&&!i(this).is(":disabled")&&po.test(this.nodeName)&&!yo.test(n)&&(this.checked||!ui.test(n))}).map(function(n,t){var r=i(this).val();return null==r?null:i.isArray(r)?i.map(r,function(n){return{name:t.name,value:n.replace(rf,"\r\n")}}):{name:t.name,value:r.replace(rf,"\r\n")}}).get()}});i.ajaxSettings.xhr=void 0!==n.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&uf()||bo()}:uf;var wo=0,gt={},ht=i.ajaxSettings.xhr();n.ActiveXObject&&i(n).on("unload",function(){for(var n in gt)gt[n](void 0,!0)});r.cors=!!ht&&"withCredentials"in ht;ht=r.ajax=!!ht;ht&&i.ajaxTransport(function(n){if(!n.crossDomain||r.cors){var t;return{send:function(r,u){var e,f=n.xhr(),o=++wo;if(f.open(n.type,n.url,n.async,n.username,n.password),n.xhrFields)for(e in n.xhrFields)f[e]=n.xhrFields[e];n.mimeType&&f.overrideMimeType&&f.overrideMimeType(n.mimeType);n.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(e in r)void 0!==r[e]&&f.setRequestHeader(e,r[e]+"");f.send(n.hasContent&&n.data||null);t=function(r,e){var s,c,h;if(t&&(e||4===f.readyState))if(delete gt[o],t=void 0,f.onreadystatechange=i.noop,e)4!==f.readyState&&f.abort();else{h={};s=f.status;"string"==typeof f.responseText&&(h.text=f.responseText);try{c=f.statusText}catch(l){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=h.text?200:404}h&&u(s,c,h,f.getAllResponseHeaders())};n.async?4===f.readyState?setTimeout(t):f.onreadystatechange=gt[o]=t:t()},abort:function(){t&&t(void 0,!0)}}}});function uf(){try{return new n.XMLHttpRequest}catch(t){}}function bo(){try{return new n.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}i.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(n){return i.globalEval(n),n}}});i.ajaxPrefilter("script",function(n){void 0===n.cache&&(n.cache=!1);n.crossDomain&&(n.type="GET",n.global=!1)});i.ajaxTransport("script",function(n){if(n.crossDomain){var t,r=u.head||i("head")[0]||u.documentElement;return{send:function(i,f){t=u.createElement("script");t.async=!0;n.scriptCharset&&(t.charset=n.scriptCharset);t.src=n.url;t.onload=t.onreadystatechange=function(n,i){(i||!t.readyState||/loaded|complete/.test(t.readyState))&&(t.onload=t.onreadystatechange=null,t.parentNode&&t.parentNode.removeChild(t),t=null,i||f(200,"success"))};r.insertBefore(t,r.firstChild)},abort:function(){t&&t.onload(void 0,!0)}}}});var ff=[],bi=/(=)\?(?=&|$)|\?\?/;i.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var n=ff.pop()||i.expando+"_"+ai++;return this[n]=!0,n}});i.ajaxPrefilter("json jsonp",function(t,r,u){var f,o,e,s=t.jsonp!==!1&&(bi.test(t.url)?"url":"string"==typeof t.data&&!(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&bi.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return(f=t.jsonpCallback=i.isFunction(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(bi,"$1"+f):t.jsonp!==!1&&(t.url+=(vi.test(t.url)?"&":"?")+t.jsonp+"="+f),t.converters["script json"]=function(){return e||i.error(f+" was not called"),e[0]},t.dataTypes[0]="json",o=n[f],n[f]=function(){e=arguments},u.always(function(){n[f]=o;t[f]&&(t.jsonpCallback=r.jsonpCallback,ff.push(f));e&&i.isFunction(o)&&o(e[0]);e=o=void 0}),"script")});i.parseHTML=function(n,t,r){if(!n||"string"!=typeof n)return null;"boolean"==typeof t&&(r=t,t=!1);t=t||u;var f=tr.exec(n),e=!r&&[];return f?[t.createElement(f[1])]:(f=i.buildFragment([n],t,e),e&&e.length&&i(e).remove(),i.merge([],f.childNodes))};var ef=i.fn.load;i.fn.load=function(n,t,r){if("string"!=typeof n&&ef)return ef.apply(this,arguments);var u,o,s,f=this,e=n.indexOf(" ");return e>=0&&(u=i.trim(n.slice(e,n.length)),n=n.slice(0,e)),i.isFunction(t)?(r=t,t=void 0):t&&"object"==typeof t&&(s="POST"),f.length>0&&i.ajax({url:n,type:s,dataType:"html",data:t}).done(function(n){o=arguments;f.html(u?i("<div>").append(i.parseHTML(n)).find(u):n)}).complete(r&&function(n,t){f.each(r,o||[n.responseText,t,n])}),this};i.expr.filters.animated=function(n){return i.grep(i.timers,function(t){return n===t.elem}).length};var of=n.document.documentElement;function sf(n){return i.isWindow(n)?n:9===n.nodeType?n.defaultView||n.parentWindow:!1}i.offset={setOffset:function(n,t,r){var e,o,s,h,u,c,v,l=i.css(n,"position"),a=i(n),f={};"static"===l&&(n.style.position="relative");u=a.offset();s=i.css(n,"top");c=i.css(n,"left");v=("absolute"===l||"fixed"===l)&&i.inArray("auto",[s,c])>-1;v?(e=a.position(),h=e.top,o=e.left):(h=parseFloat(s)||0,o=parseFloat(c)||0);i.isFunction(t)&&(t=t.call(n,r,u));null!=t.top&&(f.top=t.top-u.top+h);null!=t.left&&(f.left=t.left-u.left+o);"using"in t?t.using.call(n,f):a.css(f)}};i.fn.extend({offset:function(n){if(arguments.length)return void 0===n?this:this.each(function(t){i.offset.setOffset(this,n,t)});var t,f,u={top:0,left:0},r=this[0],e=r&&r.ownerDocument;if(e)return t=e.documentElement,i.contains(t,r)?(typeof r.getBoundingClientRect!==s&&(u=r.getBoundingClientRect()),f=sf(e),{top:u.top+(f.pageYOffset||t.scrollTop)-(t.clientTop||0),left:u.left+(f.pageXOffset||t.scrollLeft)-(t.clientLeft||0)}):u},position:function(){if(this[0]){var n,r,t={top:0,left:0},u=this[0];return"fixed"===i.css(u,"position")?r=u.getBoundingClientRect():(n=this.offsetParent(),r=this.offset(),i.nodeName(n[0],"html")||(t=n.offset()),t.top+=i.css(n[0],"borderTopWidth",!0),t.left+=i.css(n[0],"borderLeftWidth",!0)),{top:r.top-t.top-i.css(u,"marginTop",!0),left:r.left-t.left-i.css(u,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var n=this.offsetParent||of;n&&!i.nodeName(n,"html")&&"static"===i.css(n,"position");)n=n.offsetParent;return n||of})}});i.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(n,t){var r=/Y/.test(t);i.fn[n]=function(u){return w(this,function(n,u,f){var e=sf(n);return void 0===f?e?t in e?e[t]:e.document.documentElement[u]:n[u]:void(e?e.scrollTo(r?i(e).scrollLeft():f,r?f:i(e).scrollTop()):n[u]=f)},n,u,arguments.length,null)}});i.each(["top","left"],function(n,t){i.cssHooks[t]=uu(r.pixelPosition,function(n,r){if(r)return(r=k(n,t),pt.test(r)?i(n).position()[t]+"px":r)})});i.each({Height:"height",Width:"width"},function(n,t){i.each({padding:"inner"+n,content:t,"":"outer"+n},function(r,u){i.fn[u]=function(u,f){var e=arguments.length&&(r||"boolean"!=typeof u),o=r||(u===!0||f===!0?"margin":"border");return w(this,function(t,r,u){var f;return i.isWindow(t)?t.document.documentElement["client"+n]:9===t.nodeType?(f=t.documentElement,Math.max(t.body["scroll"+n],f["scroll"+n],t.body["offset"+n],f["offset"+n],f["client"+n])):void 0===u?i.css(t,r,o):i.style(t,r,u,o)},t,e?u:void 0,e,null)}})});i.fn.size=function(){return this.length};i.fn.andSelf=i.fn.addBack;"function"==typeof define&&define.amd&&define("asljQuery",[],function(){return i});var ko=n.jQuery,go=n.$;return i.noConflict=function(t){return n.$===i&&(n.$=go),t&&n.jQuery===i&&(n.asljQuery=ko),i},typeof t===s&&(n.asljQuery=n.$=i),i}),function(n){n.extend({highlight:function(t,i,r,u,f){if(f=f==""?".exhghttt":f,t.nodeType===3){var c=t.data.normalize("NFD").replace(/[\u0300-\u036f]/g,""),e=c.match(i);if(e){var h=document.createElement(r||"span");if(h.className=u||"highlight",/\.|,|\s/.test(e[0].charAt(0)))var l=e.index+1;else var l=e.index;var o=t.splitText(l);o.splitText(e[1].length);var a=o.cloneNode(!0);return h.appendChild(a),o.parentNode.replaceChild(h,o),1}}else if(t.nodeType===1&&t.childNodes&&!/(script|style)/i.test(t.tagName)&&!n(t).closest(f).length>0&&!(t.tagName===r.toUpperCase()&&t.className===u))for(var s=0;s<t.childNodes.length;s++)s+=n.highlight(t.childNodes[s],i,r,u,f);return 0}});n.fn.unhighlight=function(t){var i={className:"highlight",element:"span"};return n.extend(i,t),this.find(i.element+"."+i.className).each(function(){var n=this.parentNode;n.replaceChild(this.firstChild,this);n.normalize()}).end()};n.fn.highlight=function(t,i){var r={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1,excludeParents:""};if(n.extend(r,i),t.constructor===String&&(t=[t]),t=n.grep(t,function(n){return n!=""}),t=n.map(t,function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g,"")}),t.length==0)return this;var f=r.caseSensitive?"":"i",u="("+t.join("|")+")";r.wordsOnly&&(u="(?:,|^|\\s)"+u+"(?:,|$|\\s)");var e=new RegExp(u,f);return this.each(function(){n.highlight(this,e,r.element,r.className,r.excludeParents)})}}(asljQuery,asljQuery,window),function(n,t,i){(function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.asl_SimpleBar=t())})(this,function(){"use strict";var e=typeof globalThis!="undefined"?globalThis:typeof i!="undefined"?i:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function et(n,t){return t={exports:{}},n(t,t.exports),t.exports}var pt="object",wt=function(n){return n&&n.Math==Math&&n},t=wt(typeof globalThis==pt&&globalThis)||wt(typeof i==pt&&i)||wt(typeof self==pt&&self)||wt(typeof e==pt&&e)||Function("return this")(),f=function(n){try{return!!n()}catch(t){return!0}},v=!f(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),ff={}.propertyIsEnumerable,ef=Object.getOwnPropertyDescriptor,gs=ef&&!ff.call({1:2},1),nh=gs?function(n){var t=ef(this,n);return!!t&&t.enumerable}:ff,of={f:nh},or=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}},th={}.toString,k=function(n){return th.call(n).slice(8,-1)},ih="".split,bt=f(function(){return!Object("z").propertyIsEnumerable(0)})?function(n){return k(n)=="String"?ih.call(n,""):Object(n)}:Object,kt=function(n){if(n==undefined)throw TypeError("Can't call method on "+n);return n},dt=function(n){return bt(kt(n))},n=function(n){return typeof n=="object"?n!==null:typeof n=="function"},sf=function(t,i){if(!n(t))return t;var r,u;if(i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t))||typeof(r=t.valueOf)=="function"&&!n(u=r.call(t))||!i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t)))return u;throw TypeError("Can't convert object to primitive value");},rh={}.hasOwnProperty,u=function(n,t){return rh.call(n,t)},sr=t.document,uh=n(sr)&&n(sr.createElement),hf=function(n){return uh?sr.createElement(n):{}},cf=!v&&!f(function(){return Object.defineProperty(hf("div"),"a",{get:function(){return 7}}).a!=7}),lf=Object.getOwnPropertyDescriptor,fh=v?lf:function(n,t){if(n=dt(n),t=sf(t,!0),cf)try{return lf(n,t)}catch(i){}if(u(n,t))return or(!of.f.call(n,t),n[t])},af={f:fh},h=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t},vf=Object.defineProperty,eh=v?vf:function(n,t,i){if(h(n),t=sf(t,!0),h(i),cf)try{return vf(n,t,i)}catch(r){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(n[t]=i.value),n},d={f:eh},s=v?function(n,t,i){return d.f(n,t,or(1,i))}:function(n,t,i){return n[t]=i,n},hr=function(n,i){try{s(t,n,i)}catch(r){t[n]=i}return i},gt=et(function(n){var i="__core-js_shared__",r=t[i]||hr(i,{});(n.exports=function(n,t){return r[n]||(r[n]=t!==undefined?t:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),ni=gt("native-function-to-string",Function.toString),yf=t.WeakMap,pf=typeof yf=="function"&&/native code/.test(ni.call(yf)),oh=0,sh=Math.random(),cr=function(n){return"Symbol("+String(n===undefined?"":n)+")_"+(++oh+sh).toString(36)},wf=gt("keys"),lr=function(n){return wf[n]||(wf[n]=cr(n))},ti={},hh=t.WeakMap,ii,ot,ri,ch=function(n){return ri(n)?ot(n):ii(n,{})},lh=function(t){return function(i){var r;if(!n(i)||(r=ot(i)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(pf){var g=new hh,ah=g.get,vh=g.has,yh=g.set;ii=function(n,t){return yh.call(g,n,t),t};ot=function(n){return ah.call(g,n)||{}};ri=function(n){return vh.call(g,n)}}else{var st=lr("state");ti[st]=!0;ii=function(n,t){return s(n,st,t),t};ot=function(n){return u(n,st)?n[st]:{}};ri=function(n){return u(n,st)}}var c={set:ii,get:ot,has:ri,enforce:ch,getterFor:lh},ht=et(function(n){var i=c.get,r=c.enforce,f=String(ni).split("toString");gt("inspectSource",function(n){return ni.call(n)});(n.exports=function(n,i,e,o){var c=o?!!o.unsafe:!1,h=o?!!o.enumerable:!1,l=o?!!o.noTargetGet:!1;if(typeof e=="function"&&(typeof i!="string"||u(e,"name")||s(e,"name",i),r(e).source=f.join(typeof i=="string"?i:"")),n===t){h?n[i]=e:hr(i,e);return}c?!l&&n[i]&&(h=!0):delete n[i];h?n[i]=e:s(n,i,e)})(Function.prototype,"toString",function(){return typeof this=="function"&&i(this).source||ni.call(this)})}),ar=t,bf=function(n){return typeof n=="function"?n:undefined},kf=function(n,i){return arguments.length<2?bf(ar[n])||bf(t[n]):ar[n]&&ar[n][i]||t[n]&&t[n][i]},ph=Math.ceil,wh=Math.floor,vr=function(n){return isNaN(n=+n)?0:(n>0?wh:ph)(n)},bh=Math.min,ui=function(n){return n>0?bh(vr(n),9007199254740991):0},kh=Math.max,dh=Math.min,gh=function(n,t){var i=vr(n);return i<0?kh(i+t,0):dh(i,t)},df=function(n){return function(t,i,r){var f=dt(t),e=ui(f.length),u=gh(r,e),o;if(n&&i!=i){while(e>u)if(o=f[u++],o!=o)return!0}else for(;e>u;u++)if((n||u in f)&&f[u]===i)return n||u||0;return!n&&-1}},nc={includes:df(!0),indexOf:df(!1)},tc=nc.indexOf,gf=function(n,t){var f=dt(n),e=0,r=[];for(var i in f)!u(ti,i)&&u(f,i)&&r.push(i);while(t.length>e)u(f,i=t[e++])&&(~tc(r,i)||r.push(i));return r},fi=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ic=fi.concat("length","prototype"),rc=Object.getOwnPropertyNames||function(n){return gf(n,ic)},uc={f:rc},fc=Object.getOwnPropertySymbols,ne={f:fc},ec=kf("Reflect","ownKeys")||function(n){var t=uc.f(h(n)),i=ne.f;return i?t.concat(i(n)):t},oc=function(n,t){for(var f=ec(t),e=d.f,o=af.f,i=0;i<f.length;i++){var r=f[i];u(n,r)||e(n,r,o(t,r))}},sc=/#|\.prototype\./,ct=function(n,t){var i=cc[hc(n)];return i==ac?!0:i==lc?!1:typeof t=="function"?f(t):!!t},hc=ct.normalize=function(n){return String(n).replace(sc,".").toLowerCase()},cc=ct.data={},lc=ct.NATIVE="N",ac=ct.POLYFILL="P",yr=ct,vc=af.f,a=function(n,i){var o=n.target,c=n.global,l=n.stat,a,f,r,u,e,h;if(f=c?t:l?t[o]||hr(o,{}):(t[o]||{}).prototype,f)for(r in i){if(e=i[r],n.noTargetGet?(h=vc(f,r),u=h&&h.value):u=f[r],a=yr(c?r:o+(l?".":"#")+r,n.forced),!a&&u!==undefined){if(typeof e==typeof u)continue;oc(e,u)}(n.sham||u&&u.sham)&&s(e,"sham",!0);ht(f,r,e,n)}},te=function(n){if(typeof n!="function")throw TypeError(String(n)+" is not a function");return n},ie=function(n,t,i){if(te(n),t===undefined)return n;switch(i){case 0:return function(){return n.call(t)};case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)}}return function(){return n.apply(t,arguments)}},ei=function(n){return Object(kt(n))},re=Array.isArray||function(n){return k(n)=="Array"},ue=!!Object.getOwnPropertySymbols&&!f(function(){return!String(Symbol())}),fe=t.Symbol,ee=gt("wks"),o=function(n){return ee[n]||(ee[n]=ue&&fe[n]||(ue?fe:cr)("Symbol."+n))},yc=o("species"),pc=function(t,i){var r;return re(t)&&(r=t.constructor,typeof r=="function"&&(r===Array||re(r.prototype))?r=undefined:n(r)&&(r=r[yc],r===null&&(r=undefined))),new(r===undefined?Array:r)(i===0?0:i)},wc=[].push,y=function(n){var i=n==1,u=n==2,f=n==3,t=n==4,r=n==6,e=n==5||r;return function(o,s,h,c){for(var w=ei(o),v=bt(w),d=ie(s,h,3),b=ui(v.length),l=0,k=c||pc,y=i?k(o,b):u?k(o,0):undefined,a,p;b>l;l++)if((e||l in v)&&(a=v[l],p=d(a,l,w),n))if(i)y[l]=p;else if(p)switch(n){case 3:return!0;case 5:return a;case 6:return l;case 2:wc.call(y,a)}else if(t)return!1;return r?-1:f||t?t:y}},oi={forEach:y(0),map:y(1),filter:y(2),some:y(3),every:y(4),find:y(5),findIndex:y(6)},oe=function(n,t){var i=[][n];return!i||!f(function(){i.call(null,t||function(){throw 1;},1)})},bc=oi.forEach,lt=oe("forEach")?function(n){return bc(this,n,arguments.length>1?arguments[1]:undefined)}:[].forEach;a({target:"Array",proto:!0,forced:[].forEach!=lt},{forEach:lt});var pr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var kc in pr){var se=t[kc],si=se&&se.prototype;if(si&&si.forEach!==lt)try{s(si,"forEach",lt)}catch(kb){si.forEach=lt}}var dc=!!(typeof i!="undefined"&&i.document&&i.document.createElement),wr=dc,gc=o("species"),nl=function(n){return!f(function(){var t=[],i=t.constructor={};return i[gc]=function(){return{foo:1}},t[n](Boolean).foo!==1})},tl=oi.filter;a({target:"Array",proto:!0,forced:!nl("filter")},{filter:function(n){return tl(this,n,arguments.length>1?arguments[1]:undefined)}});var hi=Object.keys||function(n){return gf(n,fi)},il=v?Object.defineProperties:function(n,t){h(n);for(var i=hi(t),f=i.length,r=0,u;f>r;)d.f(n,u=i[r++],t[u]);return n},rl=kf("document","documentElement"),he=lr("IE_PROTO"),br="prototype",kr=function(){},ci=function(){var t=hf("iframe"),r=fi.length,u="<",i="script",f=">",e="java"+i+":",n;for(t.style.display="none",rl.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(u+i+f+"document.F=Object"+u+"/"+i+f),n.close(),ci=n.F;r--;)delete ci[br][fi[r]];return ci()},ce=Object.create||function(n,t){var i;return n!==null?(kr[br]=h(n),i=new kr,kr[br]=null,i[he]=n):i=ci(),t===undefined?i:il(i,t)};ti[he]=!0;var dr=o("unscopables"),gr=Array.prototype;gr[dr]==undefined&&s(gr,dr,ce(null));var nu=function(n){gr[dr][n]=!0},nt={},ul=!f(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype}),le=lr("IE_PROTO"),fl=Object.prototype,li=ul?Object.getPrototypeOf:function(n){return(n=ei(n),u(n,le))?n[le]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?fl:null},ae=o("iterator"),ve=!1,el=function(){return this},tt,tu,iu;[].keys&&(iu=[].keys(),"next"in iu?(tu=li(li(iu)),tu!==Object.prototype&&(tt=tu)):ve=!0);tt==undefined&&(tt={});u(tt,ae)||s(tt,ae,el);var ru={IteratorPrototype:tt,BUGGY_SAFARI_ITERATORS:ve},ol=d.f,ye=o("toStringTag"),uu=function(n,t,i){n&&!u(n=i?n:n.prototype,ye)&&ol(n,ye,{configurable:!0,value:t})},sl=ru.IteratorPrototype,hl=function(){return this},cl=function(n,t,i){var r=t+" Iterator";return n.prototype=ce(sl,{next:or(1,i)}),uu(n,r,!1),nt[r]=hl,n},ll=function(t){if(!n(t)&&t!==null)throw TypeError("Can't set "+String(t)+" as a prototype");return t},ai=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,i={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set;n.call(i,[]);t=i instanceof Array}catch(r){}return function(i,r){return h(i),ll(r),t?n.call(i,r):i.__proto__=r,i}}():undefined),fu=ru.IteratorPrototype,vi=ru.BUGGY_SAFARI_ITERATORS,at=o("iterator"),pe="keys",yi="values",we="entries",al=function(){return this},be=function(n,t,i,r,u,f,e){cl(i,t,r);var y=function(n){if(n===u&&h)return h;if(!vi&&n in o)return o[n];switch(n){case pe:return function(){return new i(this,n)};case yi:return function(){return new i(this,n)};case we:return function(){return new i(this,n)}}return function(){return new i(this)}},k=t+" Iterator",w=!1,o=n.prototype,l=o[at]||o["@@iterator"]||u&&o[u],h=!vi&&l||y(u),b=t=="Array"?o.entries||l:l,c,v,p;if(b&&(c=li(b.call(new n)),fu!==Object.prototype&&c.next&&(li(c)!==fu&&(ai?ai(c,fu):typeof c[at]!="function"&&s(c,at,al)),uu(c,k,!0))),u==yi&&l&&l.name!==yi&&(w=!0,h=function(){return l.call(this)}),o[at]!==h&&s(o,at,h),nt[t]=h,u)if(v={values:y(yi),keys:f?h:y(pe),entries:y(we)},e)for(p in v)!vi&&!w&&p in o||ht(o,p,v[p]);else a({target:t,proto:!0,forced:vi||w},v);return v},ke="Array Iterator",vl=c.set,yl=c.getterFor(ke),vt=be(Array,"Array",function(n,t){vl(this,{type:ke,target:dt(n),index:0,kind:t})},function(){var t=yl(this),i=t.target,r=t.kind,n=t.index++;return!i||n>=i.length?(t.target=undefined,{value:undefined,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:i[n],done:!1}:{value:[n,i[n]],done:!1}},"values");nt.Arguments=nt.Array;nu("keys");nu("values");nu("entries");var pi=Object.assign,de=!pi||f(function(){var n={},t={},i=Symbol(),r="abcdefghijklmnopqrst";return n[i]=7,r.split("").forEach(function(n){t[n]=n}),pi({},n)[i]!=7||hi(pi({},t)).join("")!=r})?function(n){for(var r=ei(n),s=arguments.length,u=1,f=ne.f,h=of.f;s>u;)for(var t=bt(arguments[u++]),e=f?hi(t).concat(f(t)):hi(t),c=e.length,o=0,i;c>o;)i=e[o++],(!v||h.call(t,i))&&(r[i]=t[i]);return r}:pi;a({target:"Object",stat:!0,forced:Object.assign!==de},{assign:de});var pl=o("toStringTag"),wl=k(function(){return arguments}())=="Arguments",bl=function(n,t){try{return n[t]}catch(i){}},ge=function(n){var t,i,r;return n===undefined?"Undefined":n===null?"Null":typeof(i=bl(t=Object(n),pl))=="string"?i:wl?k(t):(r=k(t))=="Object"&&typeof t.callee=="function"?"Arguments":r},kl=o("toStringTag"),eu={};eu[kl]="z";var no=String(eu)!=="[object z]"?function(){return"[object "+ge(this)+"]"}:eu.toString,to=Object.prototype;no!==to.toString&&ht(to,"toString",no,{unsafe:!0});var ou="\t\n\x0b\f\r                 \u2028\u2029",wi="["+ou+"]",dl=RegExp("^"+wi+wi+"*"),gl=RegExp(wi+wi+"*$"),su=function(n){return function(t){var i=String(kt(t));return n&1&&(i=i.replace(dl,"")),n&2&&(i=i.replace(gl,"")),i}},na={start:su(1),end:su(2),trim:su(3)},ta=na.trim,bi=t.parseInt,ia=/^[+-]?0[Xx]/,ra=bi(ou+"08")!==8||bi(ou+"0x16")!==22,io=ra?function(n,t){var i=ta(String(n));return bi(i,t>>>0||(ia.test(i)?16:10))}:bi;a({global:!0,forced:parseInt!=io},{parseInt:io});var ro=function(n){return function(t,i){var u=String(kt(t)),r=vr(i),o=u.length,f,e;return r<0||r>=o?n?"":undefined:(f=u.charCodeAt(r),f<55296||f>56319||r+1===o||(e=u.charCodeAt(r+1))<56320||e>57343?n?u.charAt(r):f:n?u.slice(r,r+2):(f-55296<<10)+(e-56320)+65536)}},uo={codeAt:ro(!1),charAt:ro(!0)},ua=uo.charAt,fo="String Iterator",fa=c.set,ea=c.getterFor(fo);be(String,"String",function(n){fa(this,{type:fo,string:String(n),index:0})},function(){var n=ea(this),i=n.string,r=n.index,t;return r>=i.length?{value:undefined,done:!0}:(t=ua(i,r),n.index+=t.length,{value:t,done:!1})});var hu=function(n,t,i){for(var r in t)ht(n,r,t[r],i);return n},oa=!f(function(){return Object.isExtensible(Object.preventExtensions({}))}),p=et(function(t){var e=d.f,i=cr("meta"),o=0,r=Object.isExtensible||function(){return!0},f=function(n){e(n,i,{value:{objectID:"O"+ ++o,weakData:{}}})},s=function(t,e){if(!n(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!u(t,i)){if(!r(t))return"F";if(!e)return"E";f(t)}return t[i].objectID},h=function(n,t){if(!u(n,i)){if(!r(n))return!0;if(!t)return!1;f(n)}return n[i].weakData},c=function(n){return oa&&l.REQUIRED&&r(n)&&!u(n,i)&&f(n),n},l=t.exports={REQUIRED:!1,fastKey:s,getWeakData:h,onFreeze:c};ti[i]=!0}),rk=p.REQUIRED,uk=p.fastKey,fk=p.getWeakData,ek=p.onFreeze,sa=o("iterator"),ha=Array.prototype,ca=function(n){return n!==undefined&&(nt.Array===n||ha[sa]===n)},la=o("iterator"),aa=function(n){if(n!=undefined)return n[la]||n["@@iterator"]||nt[ge(n)]},va=function(n,t,i,r){try{return r?t(h(i)[0],i[1]):t(i)}catch(f){var u=n["return"];u!==undefined&&h(u.call(n));throw f;}},eo=et(function(n){var t=function(n,t){this.stopped=n;this.result=t},i=n.exports=function(n,i,r,u,f){var a=ie(i,r,u?2:1),s,c,o,v,e,l;if(f)s=n;else{if(c=aa(n),typeof c!="function")throw TypeError("Target is not iterable");if(ca(c)){for(o=0,v=ui(n.length);v>o;o++)if(e=u?a(h(l=n[o])[0],l[1]):a(n[o]),e&&e instanceof t)return e;return new t(!1)}s=c.call(n)}while(!(l=s.next()).done)if(e=va(s,a,l.value,u),e&&e instanceof t)return e;return new t(!1)};i.stop=function(n){return new t(!0,n)}}),oo=function(n,t,i){if(!(n instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return n},so=o("iterator"),ho=!1;try{var ya=0,co={next:function(){return{done:!!ya++}},"return":function(){ho=!0}};co[so]=function(){return this};Array.from(co,function(){throw 2;})}catch(kb){}var pa=function(n,t){if(!t&&!ho)return!1;var i=!1;try{var r={};r[so]=function(){return{next:function(){return{done:i=!0}}}};n(r)}catch(u){}return i},wa=function(t,i,r){var u,f;return ai&&typeof(u=i.constructor)=="function"&&u!==r&&n(f=u.prototype)&&f!==r.prototype&&ai(t,f),t},ba=function(i,r,u,e,o){var h=t[i],c=h&&h.prototype,s=h,l=e?"set":"add",w={},v=function(t){var i=c[t];ht(c,t,t=="add"?function(n){return i.call(this,n===0?0:n),this}:t=="delete"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:t=="get"?function(t){return o&&!n(t)?undefined:i.call(this,t===0?0:t)}:t=="has"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:function(n,t){return i.call(this,n===0?0:n,t),this})};if(yr(i,typeof h!="function"||!(o||c.forEach&&!f(function(){(new h).entries().next()}))))s=u.getConstructor(r,i,e,l),p.REQUIRED=!0;else if(yr(i,!0)){var y=new s,k=y[l](o?{}:-0,1)!=y,d=f(function(){y.has(1)}),g=pa(function(n){new h(n)}),b=!o&&f(function(){for(var t=new h,n=5;n--;)t[l](n,n);return!t.has(-0)});g||(s=r(function(n,t){oo(n,s,i);var r=wa(new h,n,s);return t!=undefined&&eo(t,r[l],r,e),r}),s.prototype=c,c.constructor=s);(d||b)&&(v("delete"),v("has"),e&&v("get"));(b||k)&&v(l);o&&c.clear&&delete c.clear}return w[i]=s,a({global:!0,forced:s!=h},w),uu(s,i),o||u.setStrong(s,i,e),s},ki=p.getWeakData,ka=c.set,da=c.getterFor,ga=oi.find,nv=oi.findIndex,tv=0,di=function(n){return n.frozen||(n.frozen=new lo)},lo=function(){this.entries=[]},cu=function(n,t){return ga(n.entries,function(n){return n[0]===t})};lo.prototype={get:function(n){var t=cu(this,n);if(t)return t[1]},has:function(n){return!!cu(this,n)},set:function(n,t){var i=cu(this,n);i?i[1]=t:this.entries.push([n,t])},"delete":function(n){var t=nv(this.entries,function(t){return t[0]===n});return~t&&this.entries.splice(t,1),!!~t}};var ao={getConstructor:function(t,i,r,f){var e=t(function(n,t){oo(n,e,i);ka(n,{type:i,id:tv++,frozen:undefined});t!=undefined&&eo(t,n[f],n,r)}),o=da(i),s=function(n,t,i){var r=o(n),u=ki(h(t),!0);return u===!0?di(r).set(t,i):u[r.id]=i,n};return hu(e.prototype,{"delete":function(t){var r=o(this);if(!n(t))return!1;var i=ki(t);return i===!0?di(r)["delete"](t):i&&u(i,r.id)&&delete i[r.id]},has:function(t){var r=o(this);if(!n(t))return!1;var i=ki(t);return i===!0?di(r).has(t):i&&u(i,r.id)}}),hu(e.prototype,r?{get:function(t){var r=o(this);if(n(t)){var i=ki(t);return i===!0?di(r).get(t):i?i[r.id]:undefined}},set:function(n,t){return s(this,n,t)}}:{add:function(n){return s(this,n,!0)}}),e}},ok=et(function(i){var f=c.enforce,v=!t.ActiveXObject&&"ActiveXObject"in t,e=Object.isExtensible,r,s=function(n){return function(){return n(this,arguments.length?arguments[0]:undefined)}},y=i.exports=ba("WeakMap",s,ao,!0,!0);if(pf&&v){r=ao.getConstructor(s,"WeakMap",!0);p.REQUIRED=!0;var u=y.prototype,h=u["delete"],o=u.has,l=u.get,a=u.set;hu(u,{"delete":function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),h.call(this,t)||i.frozen["delete"](t)}return h.call(this,t)},has:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)||i.frozen.has(t)}return o.call(this,t)},get:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)?l.call(this,t):i.frozen.get(t)}return l.call(this,t)},set:function(t,i){if(n(t)&&!e(t)){var u=f(this);u.frozen||(u.frozen=new r);o.call(this,t)?a.call(this,t,i):u.frozen.set(t,i)}else a.call(this,t,i);return this}})}}),lu=o("iterator"),vo=o("toStringTag"),au=vt.values;for(var vu in pr){var yo=t[vu],l=yo&&yo.prototype;if(l){if(l[lu]!==au)try{s(l,lu,au)}catch(kb){l[lu]=au}if(l[vo]||s(l,vo,vu),pr[vu])for(var it in vt)if(l[it]!==vt[it])try{s(l,it,vt[it])}catch(kb){l[it]=vt[it]}}}var po="Expected a function",wo=0/0,iv="[object Symbol]",rv=/^\s+|\s+$/g,uv=/^[-+]0x[0-9a-f]+$/i,fv=/^0b[01]+$/i,ev=/^0o[0-7]+$/i,ov=parseInt,sv=typeof e=="object"&&e&&e.Object===Object&&e,hv=typeof self=="object"&&self&&self.Object===Object&&self,cv=sv||hv||Function("return this")(),lv=Object.prototype,av=lv.toString,vv=Math.max,yv=Math.min,yu=function(){return cv.Date.now()};function pv(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(po);t=bo(t)||0;gi(i)&&(p=!!i.leading,h="maxWait"in i,c=h?vv(bo(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?yv(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=yu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(yu())}function y(){var n=yu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function wv(n,t,i){var r=!0,u=!0;if(typeof n!="function")throw new TypeError(po);return gi(i)&&(r="leading"in i?!!i.leading:r,u="trailing"in i?!!i.trailing:u),pv(n,t,{leading:r,maxWait:t,trailing:u})}function gi(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function bv(n){return!!n&&typeof n=="object"}function kv(n){return typeof n=="symbol"||bv(n)&&av.call(n)==iv}function bo(n){if(typeof n=="number")return n;if(kv(n))return wo;if(gi(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=gi(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(rv,"");var i=fv.test(n);return i||ev.test(n)?ov(n.slice(2),i?2:8):uv.test(n)?wo:+n}var ko=wv,dv="Expected a function",go=0/0,gv="[object Symbol]",ny=/^\s+|\s+$/g,ty=/^[-+]0x[0-9a-f]+$/i,iy=/^0b[01]+$/i,ry=/^0o[0-7]+$/i,uy=parseInt,fy=typeof e=="object"&&e&&e.Object===Object&&e,ey=typeof self=="object"&&self&&self.Object===Object&&self,oy=fy||ey||Function("return this")(),sy=Object.prototype,hy=sy.toString,cy=Math.max,ly=Math.min,pu=function(){return oy.Date.now()};function ay(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(dv);t=ns(t)||0;wu(i)&&(p=!!i.leading,h="maxWait"in i,c=h?cy(ns(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?ly(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=pu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(pu())}function y(){var n=pu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function wu(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function vy(n){return!!n&&typeof n=="object"}function yy(n){return typeof n=="symbol"||vy(n)&&hy.call(n)==gv}function ns(n){if(typeof n=="number")return n;if(yy(n))return go;if(wu(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=wu(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(ny,"");var i=iy.test(n);return i||ry.test(n)?uy(n.slice(2),i?2:8):ty.test(n)?go:+n}var ts=ay,py="Expected a function",is="__lodash_hash_undefined__",wy="[object Function]",by="[object GeneratorFunction]",ky=/^\[object .+?Constructor\]$/,dy=typeof e=="object"&&e&&e.Object===Object&&e,gy=typeof self=="object"&&self&&self.Object===Object&&self,rs=dy||gy||Function("return this")();function np(n,t){return n==null?undefined:n[t]}function tp(n){var t=!1;if(n!=null&&typeof n.toString!="function")try{t=!!(n+"")}catch(i){}return t}var ip=Array.prototype,rp=Function.prototype,us=Object.prototype,bu=rs["__core-js_shared__"],fs=function(){var n=/[^.]+$/.exec(bu&&bu.keys&&bu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),es=rp.toString,ku=us.hasOwnProperty,up=us.toString,fp=RegExp("^"+es.call(ku).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ep=ip.splice,op=os(rs,"Map"),yt=os(Object,"create");function w(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function sp(){this.__data__=yt?yt(null):{}}function hp(n){return this.has(n)&&delete this.__data__[n]}function cp(n){var t=this.__data__;if(yt){var i=t[n];return i===is?undefined:i}return ku.call(t,n)?t[n]:undefined}function lp(n){var t=this.__data__;return yt?t[n]!==undefined:ku.call(t,n)}function ap(n,t){var i=this.__data__;return i[n]=yt&&t===undefined?is:t,this}w.prototype.clear=sp;w.prototype["delete"]=hp;w.prototype.get=cp;w.prototype.has=lp;w.prototype.set=ap;function rt(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function vp(){this.__data__=[]}function yp(n){var t=this.__data__,i=nr(t,n);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():ep.call(t,i,1),!0}function pp(n){var t=this.__data__,i=nr(t,n);return i<0?undefined:t[i][1]}function wp(n){return nr(this.__data__,n)>-1}function bp(n,t){var i=this.__data__,r=nr(i,n);return r<0?i.push([n,t]):i[r][1]=t,this}rt.prototype.clear=vp;rt.prototype["delete"]=yp;rt.prototype.get=pp;rt.prototype.has=wp;rt.prototype.set=bp;function b(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function kp(){this.__data__={hash:new w,map:new(op||rt),string:new w}}function dp(n){return tr(this,n)["delete"](n)}function gp(n){return tr(this,n).get(n)}function nw(n){return tr(this,n).has(n)}function tw(n,t){return tr(this,n).set(n,t),this}b.prototype.clear=kp;b.prototype["delete"]=dp;b.prototype.get=gp;b.prototype.has=nw;b.prototype.set=tw;function nr(n,t){for(var i=n.length;i--;)if(ew(n[i][0],t))return i;return-1}function iw(n){if(!ss(n)||uw(n))return!1;var t=ow(n)||tp(n)?fp:ky;return t.test(fw(n))}function tr(n,t){var i=n.__data__;return rw(t)?i[typeof t=="string"?"string":"hash"]:i.map}function os(n,t){var i=np(n,t);return iw(i)?i:undefined}function rw(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function uw(n){return!!fs&&fs in n}function fw(n){if(n!=null){try{return es.call(n)}catch(t){}try{return n+""}catch(t){}}return""}function du(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new TypeError(py);var i=function(){var r=arguments,u=t?t.apply(this,r):r[0],f=i.cache;if(f.has(u))return f.get(u);var e=n.apply(this,r);return i.cache=f.set(u,e),e};return i.cache=new(du.Cache||b),i}du.Cache=b;function ew(n,t){return n===t||n!==n&&t!==t}function ow(n){var t=ss(n)?up.call(n):"";return t==wy||t==by}function ss(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}var sw=du,hs=function(){function n(n,t){var i=-1;return n.some(function(n,r){return n[0]===t?(i=r,!0):!1}),i}return typeof Map!="undefined"?Map:function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},t.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},t.prototype.has=function(t){return!!~n(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,t){t===void 0&&(t=null);for(var i=0,r=this.__entries__;i<r.length;i++){var u=r[i];n.call(t,u[1],u[0])}},t}()}(),gu=typeof i!="undefined"&&typeof document!="undefined"&&i.document===document,ir=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof i!="undefined"&&i.Math===Math?i:Function("return this")()}(),hw=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ir):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),cw=2;function lw(n,t){var i=!1,r=!1,u=0;function e(){i&&(i=!1,n());r&&f()}function o(){hw(e)}function f(){var n=Date.now();if(i){if(n-u<cw)return;r=!0}else i=!0,r=!1,setTimeout(o,t);u=n}return f}var aw=20,vw=["top","right","bottom","left","width","height","size","weight"],yw=typeof MutationObserver!="undefined",pw=function(){function n(){this.connected_=!1;this.mutationEventsAdded_=!1;this.mutationsObserver_=null;this.observers_=[];this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=lw(this.refresh.bind(this),aw)}return n.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n);this.connected_||this.connect_()},n.prototype.removeObserver=function(n){var t=this.observers_,i=t.indexOf(n);~i&&t.splice(i,1);!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},n.prototype.updateObservers_=function(){var n=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return n.forEach(function(n){return n.broadcastActive()}),n.length>0},n.prototype.connect_=function(){gu&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),i.addEventListener("resize",this.refresh),yw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){gu&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),i.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(n){var t=n.propertyName,i=t===void 0?"":t,r=vw.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),cs=function(n,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var u=r[i];Object.defineProperty(n,u,{value:t[u],enumerable:!1,writable:!1,configurable:!0})}return n},ut=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||ir},ls=ur(0,0,0,0);function rr(n){return parseFloat(n)||0}function as(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return i.reduce(function(t,i){var r=n["border-"+i+"-width"];return t+rr(r)},0)}function ww(n){for(var i={},t=0,r=["top","right","bottom","left"];t<r.length;t++){var u=r[t],f=n["padding-"+u];i[u]=rr(f)}return i}function bw(n){var t=n.getBBox();return ur(0,0,t.width,t.height)}function kw(n){var f=n.clientWidth,e=n.clientHeight;if(!f&&!e)return ls;var t=ut(n).getComputedStyle(n),i=ww(t),o=i.left+i.right,s=i.top+i.bottom,r=rr(t.width),u=rr(t.height);if(t.boxSizing==="border-box"&&(Math.round(r+o)!==f&&(r-=as(t,"left","right")+o),Math.round(u+s)!==e&&(u-=as(t,"top","bottom")+s)),!gw(n)){var h=Math.round(r+o)-f,c=Math.round(u+s)-e;Math.abs(h)!==1&&(r-=h);Math.abs(c)!==1&&(u-=c)}return ur(i.left,i.top,r,u)}var dw=function(){return typeof SVGGraphicsElement!="undefined"?function(n){return n instanceof ut(n).SVGGraphicsElement}:function(n){return n instanceof ut(n).SVGElement&&typeof n.getBBox=="function"}}();function gw(n){return n===ut(n).document.documentElement}function nb(n){return gu?dw(n)?bw(n):kw(n):ls}function tb(n){var t=n.x,i=n.y,r=n.width,u=n.height,e=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,f=Object.create(e.prototype);return cs(f,{x:t,y:i,width:r,height:u,top:i,right:t+r,bottom:u+i,left:t}),f}function ur(n,t,i,r){return{x:n,y:t,width:i,height:r}}var ib=function(){function n(n){this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=ur(0,0,0,0);this.target=n}return n.prototype.isActive=function(){var n=nb(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},n}(),rb=function(){function n(n,t){var i=tb(t);cs(this,{target:n,contentRect:i})}return n}(),ub=function(){function n(n,t,i){if(this.activeObservations_=[],this.observations_=new hs,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n;this.controller_=t;this.callbackCtx_=i}return n.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof ut(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)||(t.set(n,new ib(n)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof ut(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)&&(t.delete(n),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var n=this;this.clearActive();this.observations_.forEach(function(t){t.isActive()&&n.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new rb(n.target,n.broadcastRect())});this.callback_.call(n,t,n);this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),vs=typeof WeakMap!="undefined"?new WeakMap:new hs,ys=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=pw.getInstance(),r=new ub(t,i,this);vs.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){ys.prototype[n]=function(){var t;return(t=vs.get(this))[n].apply(t,arguments)}});var fb=function(){return typeof ir.ResizeObserver!="undefined"?ir.ResizeObserver:ys}(),ft=null,ps=null;wr&&i.addEventListener("resize",function(){ps!==i.devicePixelRatio&&(ps=i.devicePixelRatio,ft=null)});function ws(){if(ft===null){if(typeof document=="undefined")return ft=0;var t=document.body,n=document.createElement("div");n.classList.add("asl_simplebar-hide-scrollbar");t.appendChild(n);var i=n.getBoundingClientRect().right;t.removeChild(n);ft=i}return ft}var r=function(){function t(n,r){var u=this;(this.onScroll=function(){u.scrollXTicking||(i.requestAnimationFrame(u.scrollX),u.scrollXTicking=!0);u.scrollYTicking||(i.requestAnimationFrame(u.scrollY),u.scrollYTicking=!0)},this.scrollX=function(){u.axis.x.isOverflowing&&(u.showScrollbar("x"),u.positionScrollbar("x"));u.scrollXTicking=!1},this.scrollY=function(){u.axis.y.isOverflowing&&(u.showScrollbar("y"),u.positionScrollbar("y"));u.scrollYTicking=!1},this.onMouseEnter=function(){u.showScrollbar("x");u.showScrollbar("y")},this.onMouseMove=function(n){if(u.mouseX=n.clientX,u.mouseY=n.clientY,u.axis.x.isOverflowing||u.axis.x.forceVisible)u.onMouseMoveForAxis("x");if(u.axis.y.isOverflowing||u.axis.y.forceVisible)u.onMouseMoveForAxis("y")},this.onMouseLeave=function(){if(u.onMouseMove.cancel(),u.axis.x.isOverflowing||u.axis.x.forceVisible)u.onMouseLeaveForAxis("x");if(u.axis.y.isOverflowing||u.axis.y.forceVisible)u.onMouseLeaveForAxis("y");u.mouseX=-1;u.mouseY=-1},this.onWindowResize=function(){u.scrollbarWidth=u.getScrollbarWidth();u.hideNativeScrollbar()},this.hideScrollbars=function(){u.axis.x.track.rect=u.axis.x.track.el.getBoundingClientRect();u.axis.y.track.rect=u.axis.y.track.el.getBoundingClientRect();u.isWithinBounds(u.axis.y.track.rect)||(u.axis.y.scrollbar.el.classList.remove(u.classNames.visible),u.axis.y.isVisible=!1);u.isWithinBounds(u.axis.x.track.rect)||(u.axis.x.scrollbar.el.classList.remove(u.classNames.visible),u.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var t,i;if(u.axis.x.track.rect=u.axis.x.track.el.getBoundingClientRect(),u.axis.y.track.rect=u.axis.y.track.el.getBoundingClientRect(),(u.axis.x.isOverflowing||u.axis.x.forceVisible)&&(t=u.isWithinBounds(u.axis.x.track.rect)),(u.axis.y.isOverflowing||u.axis.y.forceVisible)&&(i=u.isWithinBounds(u.axis.y.track.rect)),(t||i)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown")){if(t)if(u.axis.x.scrollbar.rect=u.axis.x.scrollbar.el.getBoundingClientRect(),u.isWithinBounds(u.axis.x.scrollbar.rect))u.onDragStart(n,"x");else u.onTrackClick(n,"x");if(i)if(u.axis.y.scrollbar.rect=u.axis.y.scrollbar.el.getBoundingClientRect(),u.isWithinBounds(u.axis.y.scrollbar.rect))u.onDragStart(n,"y");else u.onTrackClick(n,"y")}},this.drag=function(n){var r,f=u.axis[u.draggedAxis].track,e=f.rect[u.axis[u.draggedAxis].sizeAttr],o=u.axis[u.draggedAxis].scrollbar,s=u.contentWrapperEl[u.axis[u.draggedAxis].scrollSizeAttr],h=parseInt(u.elStyles[u.axis[u.draggedAxis].sizeAttr],10);n.preventDefault();n.stopPropagation();r=u.draggedAxis==="y"?n.pageY:n.pageX;var c=r-f.rect[u.axis[u.draggedAxis].offsetAttr]-u.axis[u.draggedAxis].dragOffset,l=c/(e-o.size),i=l*(s-h);u.draggedAxis==="x"&&(i=u.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i-(e+o.size):i,i=u.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-i:i);u.contentWrapperEl[u.axis[u.draggedAxis].scrollOffsetAttr]=i},this.onEndDrag=function(n){n.preventDefault();n.stopPropagation();u.el.classList.remove(u.classNames.dragging);document.removeEventListener("mousemove",u.drag,!0);document.removeEventListener("mouseup",u.onEndDrag,!0);u.removePreventClickId=i.setTimeout(function(){document.removeEventListener("click",u.preventClick,!0);document.removeEventListener("dblclick",u.preventClick,!0);u.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault();n.stopPropagation()},this.el=n,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,{},r),this.classNames=Object.assign({},t.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el))||(this.recalculate=ko(this.recalculate.bind(this),64),this.onMouseMove=ko(this.onMouseMove.bind(this),64),this.hideScrollbars=ts(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ts(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=sw(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var r=document.createElement("div");r.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"><\/div><\/div>';var n=r.firstElementChild;document.body.appendChild(n);var u=n.firstElementChild;n.scrollLeft=0;var f=t.getOffset(n),i=t.getOffset(u);n.scrollLeft=999;var e=t.getOffset(u);return{isRtlScrollingInverted:f.left!==i.left&&i.left-e.left!=0,isRtlScrollbarInverted:f.left!==i.left}};t.getOffset=function(n){var t=n.getBoundingClientRect();return{top:t.top+(i.pageYOffset||document.documentElement.scrollTop),left:t.left+(i.pageXOffset||document.documentElement.scrollLeft)}};var n=t.prototype;return n.init=function(){t.instances.set(this.el,this);wr&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},n.initDOM=function(){var i=this;if(Array.prototype.filter.call(this.el.children,function(n){return n.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl);this.offsetEl.appendChild(this.contentWrapperEl);this.maskEl.appendChild(this.offsetEl);this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);this.wrapperEl.appendChild(this.maskEl);this.wrapperEl.appendChild(this.placeholderEl);this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var n=document.createElement("div"),t=document.createElement("div");n.classList.add(this.classNames.track);t.classList.add(this.classNames.scrollbar);n.appendChild(t);this.axis.x.track.el=n.cloneNode(!0);this.axis.x.track.el.classList.add(this.classNames.horizontal);this.axis.y.track.el=n.cloneNode(!0);this.axis.y.track.el.classList.add(this.classNames.vertical);this.el.appendChild(this.axis.x.track.el);this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar);this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar);this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible));this.el.setAttribute("data-asl_simplebar","init")},n.initListeners=function(){var n=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.addEventListener("mousemove",this.onMouseMove);this.el.addEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.addEventListener("scroll",this.onScroll);i.addEventListener("resize",this.onWindowResize);var t=!1;this.resizeObserver=new fb(function(){t&&n.recalculate()});this.resizeObserver.observe(this.el);this.resizeObserver.observe(this.contentEl);i.requestAnimationFrame(function(){t=!0});this.mutationObserver=new MutationObserver(this.recalculate);this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},n.recalculate=function(){this.elStyles=i.getComputedStyle(this.el);this.isRtl=this.elStyles.direction==="rtl";var f=this.heightAutoObserverEl.offsetHeight<=1,e=this.heightAutoObserverEl.offsetWidth<=1,t=this.contentEl.offsetWidth,o=this.contentWrapperEl.offsetWidth,s=this.elStyles.overflowX,h=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft;this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var n=this.contentEl.scrollHeight,r=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=f?"auto":"100%";this.placeholderEl.style.width=e?t+"px":"auto";this.placeholderEl.style.height=n+"px";var u=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=r>t;this.axis.y.isOverflowing=n>u;this.axis.x.isOverflowing=s==="hidden"?!1:this.axis.x.isOverflowing;this.axis.y.isOverflowing=h==="hidden"?!1:this.axis.y.isOverflowing;this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0;this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0;this.hideNativeScrollbar();var c=this.axis.x.isOverflowing?this.scrollbarWidth:0,l=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&r>o-l;this.axis.y.isOverflowing=this.axis.y.isOverflowing&&n>u-c;this.axis.x.scrollbar.size=this.getScrollbarSize("x");this.axis.y.scrollbar.size=this.getScrollbarSize("y");this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px";this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px";this.positionScrollbar("x");this.positionScrollbar("y");this.toggleTrackVisibility("x");this.toggleTrackVisibility("y")},n.getScrollbarSize=function(n){if(n===void 0&&(n="y"),!this.axis[n].isOverflowing)return 0;var r=this.contentEl[this.axis[n].scrollSizeAttr],i=this.axis[n].track.el[this.axis[n].offsetSizeAttr],t,u=i/r;return t=Math.max(~~(u*i),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},n.positionScrollbar=function(n){if(n===void 0&&(n="y"),this.axis[n].isOverflowing){var e=this.contentWrapperEl[this.axis[n].scrollSizeAttr],f=this.axis[n].track.el[this.axis[n].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[n].sizeAttr],10),u=this.axis[n].scrollbar,r=this.contentWrapperEl[this.axis[n].scrollOffsetAttr];r=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-r:r;var s=r/(e-o),i=~~((f-u.size)*s);i=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i+(f-u.size):i;u.el.style.transform=n==="x"?"translate3d("+i+"px, 0, 0)":"translate3d(0, "+i+"px, 0)"}},n.toggleTrackVisibility=function(n){n===void 0&&(n="y");var t=this.axis[n].track.el,i=this.axis[n].scrollbar.el;this.axis[n].isOverflowing||this.axis[n].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[n].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[n].overflowAttr]="hidden");i.style.display=this.axis[n].isOverflowing?"block":"none"},n.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0;this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},n.onMouseMoveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.rect=this.axis[n].track.el.getBoundingClientRect();this.axis[n].scrollbar.rect=this.axis[n].scrollbar.el.getBoundingClientRect();var t=this.isWithinBounds(this.axis[n].scrollbar.rect);t?this.axis[n].scrollbar.el.classList.add(this.classNames.hover):this.axis[n].scrollbar.el.classList.remove(this.classNames.hover);this.isWithinBounds(this.axis[n].track.rect)?(this.showScrollbar(n),this.axis[n].track.el.classList.add(this.classNames.hover)):this.axis[n].track.el.classList.remove(this.classNames.hover)},n.onMouseLeaveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.el.classList.remove(this.classNames.hover);this.axis[n].scrollbar.el.classList.remove(this.classNames.hover)},n.showScrollbar=function(n){n===void 0&&(n="y");var t=this.axis[n].scrollbar.el;this.axis[n].isVisible||(t.classList.add(this.classNames.visible),this.axis[n].isVisible=!0);this.options.autoHide&&this.hideScrollbars()},n.onDragStart=function(n,t){t===void 0&&(t="y");var r=this.axis[t].scrollbar,u=t==="y"?n.pageY:n.pageX;this.axis[t].dragOffset=u-r.rect[this.axis[t].offsetAttr];this.draggedAxis=t;this.el.classList.add(this.classNames.dragging);document.addEventListener("mousemove",this.drag,!0);document.addEventListener("mouseup",this.onEndDrag,!0);this.removePreventClickId===null?(document.addEventListener("click",this.preventClick,!0),document.addEventListener("dblclick",this.preventClick,!0)):(i.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},n.onTrackClick=function(n,t){var u=this;t===void 0&&(t="y");this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var l=this.axis[t].scrollbar,e=l.rect[this.axis[t].offsetAttr],o=parseInt(this.elStyles[this.axis[t].sizeAttr],10),r=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],a=t==="y"?this.mouseY-e:this.mouseX-e,s=a<0?-1:1,h=s===-1?r-o:r+o,c=40,f=function f(){if(s===-1){if(r>h){var n;r-=c;u.contentWrapperEl.scrollTo((n={},n[u.axis[t].offsetAttr]=r,n));i.requestAnimationFrame(f)}}else if(r<h){var e;r+=c;u.contentWrapperEl.scrollTo((e={},e[u.axis[t].offsetAttr]=r,e));i.requestAnimationFrame(f)}};f()},n.getContentElement=function(){return this.contentEl},n.getScrollElement=function(){return this.contentWrapperEl},n.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style?0:ws()}catch(n){return ws()}},n.removeListeners=function(){var n=this;this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.removeEventListener("mousemove",this.onMouseMove);this.el.removeEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.removeEventListener("scroll",this.onScroll);i.removeEventListener("resize",this.onWindowResize);this.mutationObserver.disconnect();this.resizeObserver.disconnect();this.recalculate.cancel();this.onMouseMove.cancel();this.hideScrollbars.cancel();this.onWindowResize.cancel()},n.unMount=function(){this.removeListeners();t.instances.delete(this.el)},n.isWithinBounds=function(n){return this.mouseX>=n.left&&this.mouseX<=n.left+n.width&&this.mouseY>=n.top&&this.mouseY<=n.top+n.height},n.findChild=function(n,t){var i=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return Array.prototype.filter.call(n.children,function(n){return i.call(n,t)})[0]},t}();r.defaultOptions={autoHide:!0,forceVisible:!1,classNames:{contentEl:"asl_simplebar-content",contentWrapper:"asl_simplebar-content-wrapper",offset:"asl_simplebar-offset",mask:"asl_simplebar-mask",wrapper:"asl_simplebar-wrapper",placeholder:"asl_simplebar-placeholder",scrollbar:"asl_simplebar-scrollbar",track:"asl_simplebar-track",heightAutoObserverWrapperEl:"asl_simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"asl_simplebar-height-auto-observer",visible:"asl_simplebar-visible",horizontal:"asl_simplebar-horizontal",vertical:"asl_simplebar-vertical",hover:"asl_simplebar-hover",dragging:"asl_simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};r.instances=new WeakMap;var bs=function(n){return function(t,i,r,u){te(i);var o=ei(t),e=bt(o),s=ui(o.length),f=n?s-1:0,h=n?-1:1;if(r<2)while(!0){if(f in e){u=e[f];f+=h;break}if(f+=h,n?f<0:s<=f)throw TypeError("Reduce of empty array with no initial value");}for(;n?f>=0:s>f;f+=h)f in e&&(u=i(u,e[f],f,o));return u}},eb={left:bs(!1),right:bs(!0)},ob=eb.left;a({target:"Array",proto:!0,forced:oe("reduce")},{reduce:function(n){return ob(this,n,arguments.length,arguments.length>1?arguments[1]:undefined)}});var sb=d.f,nf=Function.prototype,hb=nf.toString,cb=/^\s*function ([^ (]*)/,ks="name";!v||ks in nf||sb(nf,ks,{configurable:!0,get:function(){try{return hb.call(this).match(cb)[1]}catch(n){return""}}});var lb=function(){var t=h(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n},fr=RegExp.prototype.exec,ab=String.prototype.replace,ds=fr,tf=function(){var n=/a/,t=/b*/g;return fr.call(n,"a"),fr.call(t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),rf=/()??/.exec("")[1]!==undefined,vb=tf||rf;vb&&(ds=function(n){var i=this,u,f,t,r;return rf&&(f=new RegExp("^"+i.source+"$(?!\\s)",lb.call(i))),tf&&(u=i.lastIndex),t=fr.call(i,n),tf&&t&&(i.lastIndex=i.global?t.index+t[0].length:u),rf&&t&&t.length>1&&ab.call(t[0],f,function(){for(r=1;r<arguments.length-2;r++)arguments[r]===undefined&&(t[r]=undefined)}),t});var uf=ds;a({target:"RegExp",proto:!0,forced:/./.exec!==uf},{exec:uf});var ck=o("species"),lk=!f(function(){var n=/./;return n.exec=function(){var n=[];return n.groups={a:"7"},n},"".replace(n,"$<a>")!=="7"}),ak=!f(function(){var n=/(?:)/,i=n.exec;n.exec=function(){return i.apply(this,arguments)};var t="ab".split(n);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),yb=uo.charAt,vk=function(n,t,i){return t+(i?yb(n,t).length:1)},yk=function(n,t){var i=n.exec;if(typeof i=="function"){var r=i.call(n,t);if(typeof r!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return r}if(k(n)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return uf.call(n,t)},pk=Math.max,wk=Math.min,bk=Math.floor,kk=function(n){return n===undefined?n:String(n)},er=function(n){return Array.prototype.reduce.call(n,function(n,t){var r=t.name.match(/data-asl_simplebar-(.+)/);if(r){var i=r[1].replace(/\W+(.)/g,function(n,t){return t.toUpperCase()});switch(t.value){case"true":n[i]=!0;break;case"false":n[i]=!1;break;case undefined:n[i]=!0;break;default:n[i]=t.value}}return n},{})};return r.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements);i.removeEventListener("load",this.initDOMLoadedElements);Array.prototype.forEach.call(document.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){r.instances.has(n)||new r(n,er(n.attributes))})},r.removeObserver=function(){this.globalObserver.disconnect()},r.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this);typeof MutationObserver!="undefined"&&(this.globalObserver=new MutationObserver(r.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0}));document.readyState!=="complete"&&(document.readyState==="loading"||document.documentElement.doScroll)?(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),i.addEventListener("load",this.initDOMLoadedElements)):i.setTimeout(this.initDOMLoadedElements)},r.handleMutations=function(n){n.forEach(function(n){Array.prototype.forEach.call(n.addedNodes,function(n){n.nodeType===1&&(n.hasAttribute("data-asl_simplebar")?r.instances.has(n)||new r(n,er(n.attributes)):Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){r.instances.has(n)||new r(n,er(n.attributes))}))});Array.prototype.forEach.call(n.removedNodes,function(n){n.nodeType===1&&(n.hasAttribute('[data-asl_simplebar="init"]')?r.instances.has(n)&&r.instances.get(n).unMount():Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar="init"]'),function(n){r.instances.has(n)&&r.instances.get(n).unMount()}))})})},r.getOptions=er,wr&&r.initHtmlApi(),r})}(asljQuery,asljQuery,window),function(n,t,i){
3
  /*! Ajax Search Lite 4.6 js */
4
+ (function(t){var r,y=!0,c={init:function(n,i){var r=this;this.elem=i;this.$elem=t(i);r.searching=!1;r.o=t.extend({blocking:!1},n);r.n={};r.n.container=t(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=t(".probox",r.n.container);r.n.proinput=t(".proinput",r.n.container);r.n.text=t(".proinput input.orig",r.n.container);r.n.textAutocomplete=t(".proinput input.autocomplete",r.n.container);r.n.loading=t(".proinput .loading",r.n.container);r.n.proloading=t(".proloading",r.n.container);r.n.proclose=t(".proclose",r.n.container);r.n.promagnifier=t(".promagnifier",r.n.container);r.n.prosettings=t(".prosettings",r.n.container);r.n.searchsettings=t("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=t("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=t("#asl_hidden_data");r.n.aslItemOverlay=t(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=t(".showmore",r.n.resultsDiv);r.n.items=t(".item",r.n.resultsDiv);r.n.results=t(".results",r.n.resultsDiv);r.n.resdrg=t(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.savedScrollTop=0;r.savedContainerTop=0;r.is_scroll=typeof asl_SimpleBar!="undefined";typeof ASL.scrollbar!="undefined"&&ASL.scrollbar==0&&(r.is_scroll=!1);r.settScroll=null;r.n.resultsAppend=t("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.lastSuccesfulSearch="";r.lastSearchData={};r.triggerPrevState=!1;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var n=t(this).parent();!n.hasClass("isotopic");)n=n.parent();var i=t(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),typeof ASL.resHTML=="undefined"&&(ASL.resHTML=r.n.resultsDiv.html()),typeof ASL.setHTML=="undefined"&&(ASL.setHTML=r.n.searchsettings.html()),t("fieldset",r.n.searchsettings).each(function(){t(".asl_option:not(.hiddend)",this).last().addClass("asl-o-last")}),ASL.js_retain_popstate==1&&r.initPrevState(),p()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),r.initAutop(),r.initEtc(),this},initPrevState:function(){var n=this;y&&r==null&&(r=localStorage.getItem("asl-"+e.encode(location.href)),r!=null&&(r=JSON.parse(r),r.settings=e.decode(r.settings)));r!=null&&typeof r.id!="undefined"&&r.id==n.o.id&&(r.phrase!=""&&(n.triggerPrevState=!0,n.n.text.val(r.phrase)),h(t("form",n.n.searchsettings))!=r.settings&&(n.triggerPrevState=!0,h(t("form",n.n.searchsettings),r.settings)));localStorage.removeItem("asl-"+e.encode(location.href));n.n.resultsDiv.on("click",".results .item",function(){var i=n.n.text.val();if(i!=""||n.settingsChanged){var r={id:n.o.id,phrase:i,settings:e.encode(h(t("form",n.n.searchsettings)))};localStorage.setItem("asl-"+e.encode(location.href),JSON.stringify(r))}})},duplicateCheck:function(){var i=this,n={};t("div[id*=ajaxsearchlite]").each(function(){n.hasOwnProperty(this.id)?t(this).remove():n[this.id]="true"})},gaPageview:function(n){var u=this,t=u.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="pageview")return!1;if(ASL.analytics.string!=""){var r=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1,f=typeof gtag=="function"?gtag:!1;i.location.origin||(i.location.origin=i.location.protocol+"//"+i.location.hostname+(i.location.port?":"+i.location.port:""));var e=u.o.homeurl.replace(i.location.origin,"");f!==!1?t!==!1&&f("config",t,{page_path:e+ASL.analytics.string.replace("{asl_term}",n)}):r!==!1&&(t!==!1&&r("create",t,"auto"),r("send","pageview",{page:e+ASL.analytics.string.replace("{asl_term}",n),title:"Ajax Search"}))}},gaEvent:function(n,i){var u=this,f=u.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="event")return!1;var e=typeof gtag=="function"?gtag:!1,o=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1;if(e===!1&&o===!1)return!1;if(typeof ASL.analytics.event[n]!="undefined"&&ASL.analytics.event[n].active==1&&typeof"gtag"!="undefined"){var s={search_id:u.o.id,search_name:u.o.name,phrase:u.n.text.val(),option_name:"",option_value:"",result_title:"",result_url:"",results_count:""},r={event_category:ASL.analytics.event[n].category,event_label:ASL.analytics.event[n].label,value:ASL.analytics.event[n].value};i=t.extend(s,i);t.each(i,function(n,i){i=String(i).replace(/[\s\n\r]+/g," ").trim();t.each(r,function(t,u){var f=new RegExp("{"+n+"}","gmi");r[t]=u.replace(f,i)})});e===!1?(f!==!1&&o("create",f,"auto"),o("send","event",r.event_category,ASL.analytics.event[n].action,r.event_label,r.value)):(f!==!1&&(r.send_to=f),e("event",ASL.analytics.event[n].action,r))}},gaGetTrackingID:function(){var r=this,n=!1;if(typeof ASL.analytics=="undefined")return n;if(typeof ASL.analytics.tracking_id!="undefined"&&ASL.analytics.tracking_id!="")return ASL.analytics.tracking_id;var i=typeof gtag=="function"?gtag:!1;if(i!==!1&&typeof ga!="undefined"&&typeof ga.getAll!="undefined"){var t=!1;return ga.getAll().forEach(function(n){t=n.get("trackingId")}),t}return n},createVerticalScroll:function(){var n=this;n.is_scroll&&typeof n.scroll.recalculate=="undefined"&&(n.scroll=new asl_SimpleBar(n.n.results.get(0),{direction:t("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0}))},initEvents:function(){var r=this;if(u()&&s())r.n.text.on("touchstart",function(){r.savedScrollTop=t(i).scrollTop();r.savedContainerTop=r.n.container.offset().top});r.n.text.on("click",function(){t(this).trigger("focus");r.gaEvent("focus")});r.n.text.on("focus input",function(){r.searching||(t(this).val()!=""?r.n.proclose.css("display","block"):r.n.proclose.css({display:"none"}))});t(r.n.text.parent()).on("submit",function(t){if(t.preventDefault(),u())if(r.o.redirect_on_enter){var i=n.Event("keyup");i.keyCode=i.which=13;r.n.text.trigger(i)}else r.o.redirectEnterTo=="ajax_search"&&(r.search(),document.activeElement.blur());else r.o.redirectEnterTo=="ajax_search"&&r.search()});r.n.resultsDiv.css({opacity:0});t(document).on("click touchend",function(){(r.hideSettings(),r.opened!=!1&&r.o.closeOnDocClick==1)&&r.hideResults()});r.n.proclose.on("click touchend",function(){r.n.text.val("");r.n.textAutocomplete.val("");r.hideResults();r.n.text.trigger("focus")});t(r.elem).on("click touchend",function(n){n.stopImmediatePropagation()});r.n.resultsDiv.on("click touchend",function(n){n.stopImmediatePropagation()});r.n.searchsettings.on("click touchend",function(n){n.stopImmediatePropagation()});r.n.prosettings.on("click",function(){r.n.prosettings.data("opened")==0?r.showSettings():r.hideSettings()});var o=r.n.container.parents().filter(function(){return t(this).css("position")=="fixed"});if((o.length>0||r.n.container.css("position")=="fixed")&&(r.n.resultsDiv.css("position")=="absolute"&&r.n.resultsDiv.css("position","fixed"),r.n.resultsDiv.css("z-index",99999999999),r.o.blocking||r.n.searchsettings.css("position","fixed")),u())t(i).on("orientationchange",function(){r.orientationChange();setTimeout(function(){r.orientationChange()},800)});else{var f;t(i).on("resize",function(){clearTimeout(f);f=setTimeout(function(){r.resize()},100)})}var e;t(i).on("scroll",function(){clearTimeout(e);e=setTimeout(function(){r.scrolling(!1)},400)});s()&&u()&&parseInt(r.n.text.css("font-size"))<16&&(r.n.text.data("fontSize",r.n.text.css("font-size")).css("font-size","16px"),r.n.textAutocomplete.css("font-size","16px"),t("<style>#ajaxsearchlite"+r.o.rid+" input.orig::-webkit-input-placeholder{font-size: 16px !important;}<\/style>").appendTo("head"));r.initNavigationEvent();r.initMagnifierEvent();r.initAutocompleteEvent();r.initFacetEvents()},initAutop:function(){var n=this;if(r!=null&&n.triggerPrevState)return n.search(),r=null,!1},initEtc:function(){var n=this,i=null;t("div.asl_option",n.n.searchsettings).on("mouseup touchend",function(r){if(r.preventDefault(),r.stopImmediatePropagation(),n.dragging)return!1;t('input[type="checkbox"]',this).prop("checked",!t('input[type="checkbox"]',this).prop("checked"));clearTimeout(i);var u=this;i=setTimeout(function(){t('input[type="checkbox"]',u).trigger("asl_chbx_change")},50)});t("div.asl_option label",n.n.searchsettings).on("click",function(n){n.preventDefault()});n.n.resultsDiv.on("click",".results .item",function(){n.gaEvent("result_click",{result_title:t(this).find("a.asl_res_url").text(),result_url:t(this).find("a.asl_res_url").attr("href")});n.o.singleHighlight==1&&(localStorage.removeItem("asl_phrase_highlight"),a(n.n.text.val())!=""&&localStorage.setItem("asl_phrase_highlight",JSON.stringify({phrase:a(n.n.text.val()),id:n.o.id})))});if(u()&&n.o.mobile.menu_selector!="")t(n.o.mobile.menu_selector).on("touchend",function(){var i=this;setTimeout(function(){var r=t(i).find("input.orig");r=r.length==0?t(i).next().find("input.orig"):r;r=r.length==0?t(i).parent().find("input.orig"):r;r=r.length==0?n.n.text:r;n.n.container.is(":visible")&&r.get(0).focus()},300)})},initNavigationEvent:function(){var n=this;t(n.n.resultsDiv).on("mouseenter",".item",function(){t(".item",n.n.resultsDiv).removeClass("hovered");t(this).addClass("hovered")});t(n.n.resultsDiv).on("mouseleave",".item",function(){t(".item",n.n.resultsDiv).removeClass("hovered")});t(document).on("keydown",function(r){if(i.event)var u=i.event.keyCode,o=i.event.type;else if(r)var u=r.which,o=r.type;if(t(".item",n.n.resultsDiv).length>0&&n.n.resultsDiv.css("display")!="none"){if(u==40||u==38){u==40&&(n.n.text.blur(),t(".item.hovered",n.n.resultsDiv).length==0?t(".item",n.n.resultsDiv).first().addClass("hovered"):t(".item.hovered",n.n.resultsDiv).removeClass("hovered").next(".item").addClass("hovered"));u==38&&(n.n.text.blur(),t(".item.hovered",n.n.resultsDiv).length==0?t(".item",n.n.resultsDiv).last().addClass("hovered"):t(".item.hovered",n.n.resultsDiv).removeClass("hovered").prev(".item").addClass("hovered"));r.stopPropagation();r.preventDefault();var f=n.is_scroll?t(n.scroll.getScrollElement()):n.n.results,e=n.n.resultsDiv.find(".resdrg .item.hovered");e.length==0&&(e=n.n.resultsDiv.children().first());f.animate({scrollTop:e.offset().top-f.offset().top+f.scrollTop()},{duration:120})}u==13&&t(".item.hovered",n.n.resultsDiv).length>0&&(r.stopPropagation(),r.preventDefault(),t(".item.hovered a.asl_res_url",n.n.resultsDiv).get(0).click())}})},initMagnifierEvent:function(){var n=this,r,f,u=!1;n.n.text.on("keyup",function(e){if(i.event?(n.keycode=i.event.keyCode,n.ktype=i.event.type):e&&(n.keycode=e.which,n.ktype=e.type),n.keycode==13){if(clearTimeout(f),f=setTimeout(function(){u=!1},300),u)return!1;u=!0}var o=t(this).hasClass("orig");if(n.n.text.val().length>=n.o.charcount&&o&&n.ktype=="keyup"&&n.keycode==13){if(n.gaEvent("return"),n.o.redirect_on_enter==1)n.o.redirectEnterTo!="first_result"?n.doRedirectToResults(n.ktype):n.search();else{if(n.o.redirectEnterTo=="nothing")return!1;t("form",n.n.searchsettings).serialize()+n.n.text.val().trim()==n.lastSuccesfulSearch&&n.resultsOpened||n.search()}clearTimeout(r)}});n.n.promagnifier.add(n.n.text).on("click input",function(u){i.event?(n.keycode=i.event.keyCode,n.ktype=i.event.type):u&&(n.keycode=u.which,n.ktype=u.type);var f=t(this).hasClass("orig");if(n.n.text.val().length<n.o.charcount){n.n.proloading.css("display","none");n.hideResults();n.post!=null&&n.post.abort();clearTimeout(r);return}if(n.n.text.val().length>=n.o.charcount&&!f&&n.o.redirectonclick==1&&n.ktype=="click"&&n.o.redirectClickTo!="first_result"){n.doRedirectToResults(n.ktype);clearTimeout(r);return}if((!(n.keycode>=37)||!(n.keycode<=40))&&(!(n.keycode>=112)||!(n.keycode<=123))){if(f&&n.ktype=="click"||n.keycode==32){t("form",n.n.searchsettings).serialize()+n.n.text.val().trim()==n.lastSuccesfulSearch&&(n.n.proclose.css("display","block"),n.resultsOpened||n.showResults());return}t(this).hasClass("orig")&&n.ktype=="click"||(f||n.ktype!="click"||n.gaEvent("magnifier"),n.o.trigger_on_click!=0||n.ktype!="click")&&(n.o.triggerontype!=0||n.ktype!="input")&&(!f||n.ktype!="input"||n.o.redirectEnterTo!="nothing")&&(f||n.ktype!="click"||n.o.redirectClickTo!="nothing")&&(n.post!=null&&n.post.abort(),clearTimeout(r),n.hideLoader(),r=setTimeout(function(){if(t("form",n.n.searchsettings).serialize()+n.n.text.val().trim()!=n.lastSuccesfulSearch)n.search();else{if(n.n.proclose.css("display","block"),n.isRedirectToFirstResult())return n.doRedirectToFirstResult(),!1;n.resultsOpened||n.showResults()}},250))}})},initFacetEvents:function(){var n=this,i=null;if(n.o.trigger_on_facet_change==1){t("input[type!=checkbox], select",n.n.searchsettings).on("change slidechange",function(){n.n.text.val().length<n.o.charcount||(n.post!=null&&n.post.abort(),clearTimeout(i),i=setTimeout(function(){n.search()},50))});t("input[type=checkbox]",n.n.searchsettings).on("asl_chbx_change",function(){n.n.text.val().length<n.o.charcount||(n.post!=null&&n.post.abort(),n.gaEvent("facet_change",{option_label:t(this).closest("fieldset").find("legend").text(),option_value:t(this).closest(".asl_option").find(".asl_option_label").text()+(t(this).prop("checked")?"(checked)":"(unchecked)")}),clearTimeout(i),i=setTimeout(function(){n.search()},50))})}},isRedirectToFirstResult:function(){var n=this;return t(".asl_res_url",n.n.resultsDiv).length>0&&(n.o.redirectonclick==1&&n.ktype=="click"&&n.o.redirectClickTo=="first_result"||n.o.redirect_on_enter==1&&(n.ktype=="input"||n.ktype=="keyup")&&n.keycode==13&&n.o.redirectEnterTo=="first_result")?!0:!1},doRedirectToFirstResult:function(){var n=this,i;return i=n.ktype=="click"?n.o.redirectClickLoc:n.o.redirectEnterLoc,i=="same"?location.href=t(t(".asl_res_url",n.n.resultsDiv).get(0)).attr("href"):v(t(t(".asl_res_url",n.n.resultsDiv).get(0)).attr("href")),n.hideLoader(),n.hideResults(),!1},doRedirectToResults:function(n){var i=this,e=i.ktype=="click"?i.o.redirectClickTo:i.o.redirectEnterTo,u=n=="click"?i.o.redirectClickLoc:i.o.redirectEnterLoc;if(e=="results_page")var r="?s="+f(i.n.text.val());else if(e=="woo_results_page")var r="?post_type=product&s="+f(i.n.text.val());else var r=i.o.redirect_url.replace("{phrase}",f(i.n.text.val()));if(i.o.homeurl.indexOf("?")>1&&r.indexOf("?")===0&&(r=r.replace("?","&")),i.o.overridewpdefault)if(i.o.override_method=="post")o(i.o.homeurl+r,"post",{asl_active:1,p_asl_data:t("form",i.n.searchsettings).serialize()},u);else{var s=i.o.homeurl+r+"&asl_active=1&p_asid="+i.o.id+"&p_asl_data=1&"+t("form",i.n.searchsettings).serialize();u=="same"?location.href=s:v(s)}else o(i.o.homeurl+r,"post",{np_asl_data:t("form",i.n.searchsettings).serialize()},u);i.n.proloading.css("display","none");i.hideLoader();i.hideResults();i.post!=null&&i.post.abort()},destroy:function(){return this.each(function(){var n=t.extend({},this,c);t(i).unbind(n)})},searchfor:function(n){t(".proinput input",this).val(n).trigger("keyup")},initAutocompleteEvent:function(){var n=this;if(n.o.autocomplete.enabled==1&&!u())n.n.text.on("keyup",function(r){i.event?(n.keycode=i.event.keyCode,n.ktype=i.event.type):r&&(n.keycode=r.which,n.ktype=r.type);var u=39;t("body").hasClass("rtl")&&(u=37);n.keycode==u&&n.n.textAutocomplete.val()!=""?(r.preventDefault(),n.n.text.val(n.n.textAutocomplete.val()),n.post!=null&&n.post.abort(),n.search()):(n.postAuto!=null&&n.postAuto.abort(),n.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var n=this,i=n.n.text.val();if(n.n.text.val()==""){n.n.textAutocomplete.val("");return}var r=n.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(n.n.textAutocomplete.val(""),t.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:n.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=t("<textarea />").html(response).text(),response=response.substr(i.length),n.n.textAutocomplete.val(i+response))}}))},search:function(){var n=this;if((!n.searching||!0)&&!(n.n.text.val().length<n.o.charcount)){n.searching=!0;n.n.proloading.css({display:"block"});n.n.proclose.css({display:"none"});var i={action:"ajaxsearchlite_search",aslp:n.n.text.val(),asid:n.o.id,options:t("form",n.n.searchsettings).serialize()};if(i=l("asl_search_data",i),JSON.stringify(i)===JSON.stringify(n.lastSearchData))return(n.resultsOpened||n.showResults(),n.hideLoader(),n.isRedirectToFirstResult())?(n.doRedirectToFirstResult(),!1):!1;n.gaEvent("search_start");n.post=t.post(ASL.ajaxurl,i,function(r){r=r.replace(/^\s*[\r\n]/gm,"");r=r.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];r=l("asl_search_html",r);n.n.resdrg.html("");n.n.resdrg.html(r);t(".asl_keyword",n.n.resdrg).on("click",function(){n.n.text.val(t(this).html());t("input.orig",n.n.container).val(t(this).html()).trigger("keydown");t("form",n.n.container).trigger("submit","ajax");n.search()});if(n.n.items=t(".item",n.n.resultsDiv),n.gaEvent("search_end",{results_count:n.n.items.length}),n.gaPageview(n.n.text.val()),n.isRedirectToFirstResult())return n.doRedirectToFirstResult(),!1;if(n.hideLoader(),n.showResults(),n.scrollToResults(),n.lastSuccesfulSearch=t("form",n.n.searchsettings).serialize()+n.n.text.val().trim(),n.lastSearchData=i,n.n.items.length==0)n.n.showmore!=null&&n.n.showmore.css("display","none");else if(n.n.showmore!=null){n.n.showmore.css("display","block");t("a",n.n.showmore).off();t("a",n.n.showmore).on("click",function(){var r=n.o.redirectClickTo,i="?s="+f(n.n.text.val());i=r=="results_page"?"?s="+f(n.n.text.val()):r=="woo_results_page"?"?post_type=product&s="+f(n.n.text.val()):n.o.redirect_url.replace("{phrase}",f(n.n.text.val()));n.o.overridewpdefault?n.o.override_method=="post"?o(n.o.homeurl+i,"post",{asl_active:1,p_asl_data:t("form",n.n.searchsettings).serialize()}):location.href=n.o.homeurl+i+"&asl_active=1&p_asid="+n.o.id+"&p_asl_data=1&"+t("form",n.n.searchsettings).serialize():o(n.o.homeurl+i,"post",{np_asl_data:t("form",n.n.searchsettings).serialize()})})}},"text").fail(function(i,r){i.aborted||r=="abort"||(n.n.resdrg.html(""),n.n.resdrg.html('<div class="asl_nores">The request failed. Please check your connection! Status: '+i.status+"<\/div>"),n.n.items=t(".item",n.n.resultsDiv),n.hideLoader(),n.showResults(),n.scrollToResults())})}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.fixResultsPosition(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;n.createVerticalScroll();switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));n.is_scroll&&typeof n.scroll.recalculate!="undefined"&&setTimeout(function(){n.scroll.recalculate()},500);n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});u()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var n=$this.n.probox.offset().top-20;else var n=$this.n.resultsDiv.offset().top-20;t("#wpadminbar").length>0&&(n-=t("#wpadminbar").height());n=n<0?0:n;t("body, html").animate({scrollTop:n},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var n=this;if(n.showResultsBox(),n.n.items.length>0){var e=n.n.items.length<n.o.itemscount?n.n.items.length:n.o.itemscount,h=t(".group",n.n.resultsDiv);if(n.n.items.length<=n.o.itemscount)n.n.results.css({height:"auto"});else{n.n.results.css({height:30});n.resize();var i=0,r=0,u=0,f=0;n.n.items.each(function(){r+=t(this).outerHeight(!0);t(this).outerHeight(!0)>f&&(f=t(this).outerHeight(!0));i++});u=f*e;u>r&&(u=r);i=i<1?1:i;r=r/i*e;n.n.results.css({height:u})}if(n.resize(),n.n.items.last().addClass("asl_last_item"),n.o.highlight==1){var o=n.o.highlightwholewords==1?!0:!1;t("div.item",n.n.resultsDiv).highlight(n.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:o})}}n.resize();n.n.items.length==0&&n.n.results.css({height:"auto"});n.n.results.css({overflowY:"auto"});var s=n.is_scroll?t(n.scroll.getScrollElement()):n.n.results;s.scrollTop(0);n.addAnimation();n.fixResultsPosition(!0);n.searching=!1},addAnimation:function(){var i=this,n=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){t(u).addClass(i.animation)},n);n=n+60;r++})},removeAnimation:function(){var n=this;n.n.items.each(function(){var i=this;t(i).removeClass(n.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t+"ms"},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n+"ms"},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var n=this;n.n.searchsettings.css(n.settAnim.showCSS);n.n.searchsettings.removeClass(n.settAnim.hideClass).addClass(n.settAnim.showClass);n.settScroll==null&&n.is_scroll&&(n.settScroll=[],t(".asl_sett_scroll",n.n.searchsettings).each(function(i){var r=this;setTimeout(function(){n.settScroll[i]=new asl_SimpleBar(t(r).get(0),{direction:t("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0})},20)}));n.n.prosettings.data("opened",1);n.fixSettingsPosition(!0)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var n=this;t(".searchsettings",n.n.container).length>0&&(t("body>#ajaxsearchlitesettings"+n.o.rid).remove(),t("body>#ajaxsearchliteres"+n.o.rid).remove())},orientationChange:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},resize:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},scrolling:function(n){var t=this;t.fixSettingsPosition(n);t.fixResultsPosition(n)},fixTryThisPosition:function(){},fixResultsPosition:function(n){n=typeof n=="undefined"?!1:n;var i=this,f=i.n.resultsDiv.css("position");if(f=="fixed"||f=="absolute"){var e=0;if(t("body").css("position")!="static"&&(e=t("body").offset().top),n==!0||i.n.resultsDiv.css("visibility")=="visible"){var o=0,h=0,r=i.n.container.offset();if(f=="fixed"&&(e=0,o=t(document).scrollTop(),h=t(document).scrollLeft(),u()&&s()&&i.n.text.is(":focus")&&(o=i.savedScrollTop,r.top=i.savedContainerTop)),typeof r!="undefined"){var c=i.n.container.outerWidth()<240?240:i.n.container.outerWidth();i.n.resultsDiv.outerWidth(c);i.n.resultsDiv.css({top:r.top+i.n.container.outerHeight(!0)+10-e-o,left:r.left-h})}}}},fixSettingsPosition:function(n){n=typeof n=="undefined"?!1:n;var r=this,h=0;if(t("body").css("position")!="static"&&(h=t("body").offset().top),(n==!0||r.n.prosettings.data("opened")!=0)&&r.o.blocking!=!0){if(r.fixSettingsWidth(),r.n.prosettings.css("display")!="none")var e=r.n.prosettings;else var e=r.n.promagnifier;var f=e.offset(),o=0,c=0;r.n.searchsettings.css("position")=="fixed"&&(o=t(i).scrollTop(),c=t(i).scrollLeft(),u()&&s()&&r.n.text.is(":focus")&&(f.top=r.savedContainerTop,o=r.savedScrollTop));r.o.settingsimagepos=="left"?r.n.searchsettings.css({display:"block",top:f.top+e.height()-2-h-o,left:f.left-c}):r.n.searchsettings.css({display:"block",top:f.top+e.height()-2-h-o,left:f.left+e.width()-r.n.searchsettings.width()-c})}},fixSettingsWidth:function(){}};function l(){return typeof wp!="undefined"&&typeof wp.hooks!="undefined"&&typeof wp.hooks.applyFilters!="undefined"?wp.hooks.applyFilters.apply(null,arguments):typeof arguments[1]!="undefined"?arguments[1]:!1}function u(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function h(n,i){var r=n.find(":input").get();return arguments.length===1?(i={},t.each(r,function(){!this.name||this.disabled||!(this.checked||/select|textarea/i.test(this.nodeName)||/text/i.test(this.type))||t(this).hasClass("asl_datepicker_field")||t(this).hasClass("asl_datepicker")||(i[this.name]==undefined&&(i[this.name]=[]),i[this.name].push(t(this).val()))}),JSON.stringify(i)):(typeof i!="object"&&(i=JSON.parse(i)),t.each(r,function(){if(this.name&&i[this.name]){var n=i[this.name],r=t(this);if(Object.prototype.toString.call(n)!=="[object Array]"&&(n=[n]),this.type=="checkbox"||this.type=="radio"){for(var e=r.val(),f=!1,u=0;u<n.length;u++)if(n[u]==e){f=!0;break}r.attr("checked",f)}else r.val(n[0])}}),n)}function f(n){return encodeURIComponent(n).replace(/\%20/g,"+")}function a(n){return n.replace(/"|'/g,"")}function o(n,i,r,u){"use strict";var f;f=t("<form />",{action:n,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&t.each(r,function(n,i){t("<input />",{type:"hidden",name:n,value:i}).appendTo(f)});typeof u!="undefined"&&u=="new"&&f.attr("target","_blank");f.appendTo("body").trigger("submit")}function v(n){t('<a href="'+n+'" target="_blank">').get(0).click()}function s(){return typeof i.navigator!="undefined"&&typeof i.navigator.userAgent!="undefined"?i.navigator.userAgent.match(/(iPod|iPhone|iPad)/)!=null:!1}function p(){var n=i.navigator.userAgent,t=n.indexOf("MSIE ");return t>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});t.plugin=function(n,i){t.fn[n]=function(r){return this.each(function(){t.data(this,n)||t.data(this,n,Object.create(i).init(r,this))})}};t.plugin("ajaxsearchlite",c);var e={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(n){var f="",o,t,i,h,c,s,r,u=0;for(n=e._utf8_encode(n);u<n.length;)o=n.charCodeAt(u++),t=n.charCodeAt(u++),i=n.charCodeAt(u++),h=o>>2,c=(o&3)<<4|t>>4,s=(t&15)<<2|i>>6,r=i&63,isNaN(t)?s=r=64:isNaN(i)&&(r=64),f=f+this._keyStr.charAt(h)+this._keyStr.charAt(c)+this._keyStr.charAt(s)+this._keyStr.charAt(r);return f},decode:function(n){var t="",o,s,h,c,u,r,f,i=0;for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)c=this._keyStr.indexOf(n.charAt(i++)),u=this._keyStr.indexOf(n.charAt(i++)),r=this._keyStr.indexOf(n.charAt(i++)),f=this._keyStr.indexOf(n.charAt(i++)),o=c<<2|u>>4,s=(u&15)<<4|r>>2,h=(r&3)<<6|f,t=t+String.fromCharCode(o),r!=64&&(t=t+String.fromCharCode(s)),f!=64&&(t=t+String.fromCharCode(h));return e._utf8_decode(t)},_utf8_encode:function(n){n=n.replace(/\r\n/g,"\n");for(var i="",r=0;r<n.length;r++){var t=n.charCodeAt(r);t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128))}return i},_utf8_decode:function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}}})(n)}(asljQuery,asljQuery,window),function(n,t,i){i.ASL=i.ASL||{};i.ASL.getScope=function(){if(typeof n!="undefined")if(typeof n.fn.ajaxsearchlite=="undefined")for(var t=n,r=n,u=0;u<10;u++)if(typeof t.fn.ajaxsearchlite=="undefined")t=n.noConflict(!0);else return t.fn.jquery!=r.fn.jquery&&(i.jQuery=i.$=r),t;else return n;return typeof i[ASL.js_scope]!="undefined"?i[ASL.js_scope]:eval(ASL.js_scope)};i.ASL.initialized=!1;i.ASL.initialize=function(n){var i=this;if(typeof i.getScope=="undefined")return!1;var t=i.getScope(),u=".asl_init_data";if(typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0)t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))});else{typeof n!="undefined"&&(u="div[id*=asl_init_id_"+n+"]");function f(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}function e(n){var t="",s,h,c,l,e,r,o,i=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)l=u.indexOf(n.charAt(i++)),e=u.indexOf(n.charAt(i++)),r=u.indexOf(n.charAt(i++)),o=u.indexOf(n.charAt(i++)),s=l<<2|e>>4,h=(e&15)<<4|r>>2,c=(r&3)<<6|o,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(h)),o!=64&&(t=t+String.fromCharCode(c));return f(t)}t(u).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).data("asldata");if(typeof n=="undefined"||(n=e(n),typeof n=="undefined"||n==""))return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).addClass("hasASL"),t("#ajaxsearchlite"+i).ajaxsearchlite(r)})}if(i.highlight.enabled){var r=localStorage.getItem("asl_phrase_highlight");localStorage.removeItem("asl_phrase_highlight");r!=null&&(r=JSON.parse(r),t.each(i.highlight.data,function(n,i){var f=i.selector!=""&&t(i.selector).length>0?i.selector:"article";if(f=t(f).length>0?f:"body",t(f).highlight(r.phrase,{element:"span",className:"asl_single_highlighted",wordsOnly:i.whole,excludeParents:".asl_w, .asl-try"}),i.scroll&&t(".asl_single_highlighted").length>0){var u=t(".asl_single_highlighted").offset().top-120;t("#wpadminbar").length>0&&(u-=t("#wpadminbar").height());u=u+i.scroll_offset;u=u<0?0:u;t("html").animate({scrollTop:u},{duration:500})}return!1}))}i.initialized=!0};i.ASL.fixClones=function(){var t=this;if((t.fix_duplicates=t.fix_duplicates||0,t.fix_duplicates==0)||typeof t.getScope=="undefined")return!1;var n=t.getScope(),i={};n(".asl_init_data").each(function(){var t=n(this).attr("id").match(/^asl_init_id_(.*)/)[1];typeof i[t]=="undefined"?i[t]={rid:t,id:t,count:1}:i[t].count++});n.each(i,function(i,r){r.count>1&&n(".asl_m_"+r.rid).each(function(i){if(i==0)return!0;for(var f=n(this).parent(),u=r.id;n("#ajaxsearchlite"+u).length!=0;)u++;n(this).attr("id","ajaxsearchlite"+u);n(this).removeClass("asl_m_"+r.rid).addClass("asl_m_"+u);n(this).removeClass("hasASL");n(".asl_r_"+r.rid,this).length==0&&n(".asl_r_"+r.rid).clone().appendTo(n(this));n(".asl_r_"+r.rid,this).attr("id","ajaxsearchliteres"+u);n(".asl_r_"+r.rid,this).attr("data-id",u);n(".asl_r_"+r.rid,this).removeClass("asl_r_"+r.rid).addClass("asl_r_"+u);typeof ASL.resHTML!="undefined"&&n("#ajaxsearchliteres"+u).html(ASL.resHTML);n(".asl_s_"+r.rid,this).length==0&&n(".asl_s_"+r.rid).length!=0&&n(".asl_s_"+r.rid).clone().appendTo(n(this));n(".asl_sb_"+r.rid,this).length==0&&n(".asl_sb_"+r.rid).length!=0&&n(".asl_sb_"+r.rid).clone().appendTo(n(this));n(".asl_s_"+r.rid,this).attr("id","ajaxsearchlitesettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitesettings"+u).html(ASL.setHTML);n(".asl_sb_"+r.rid,f).attr("id","ajaxsearchlitebsettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitebsettings"+u).html(ASL.setHTML);n(".asl_hidden_data",f).length>0&&n(".asl_hidden_data",f).attr("id","asl_hidden_data_"+u);n(".asl_init_data",f).length>0&&n(".asl_init_data",f).attr("id","asl_init_id_"+u);t.initialize(u)})})};i.ASL.ready=function(){var t=this,r=t.getScope(),u=null;r(document).ready(function(){t.initialize();setTimeout(function(){t.fixClones()},2500)});r(i).on("load",function(){t.initialized||(t.initialize(),setTimeout(function(){t.fixClones()},2500),console.log("ASL initialized via window.load"))});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&r("body").bind("DOMSubtreeModified",function(){clearTimeout(u);u=setTimeout(function(){t.initialize()},500)});var f;r(i).on("resize",function(){clearTimeout(f);f=setTimeout(function(){t.fixClones()},2e3)});var e,n="#menu-item-search, .fa-search, .fa, .fas";n=n+", .fusion-flyout-menu-toggle, .fusion-main-menu-search-open";n=n+", #search_button";n=n+", .mini-search.popup-search";n=n+", .icon-search";n=n+", .menu-item-search-dropdown";n=n+", .mobile-menu-button";n=n+", .td-icon-search, .tdb-search-icon";n=n+", .side_menu_button, .search_button";n=n+", .raven-search-form-toggle";n=n+", [data-elementor-open-lightbox], .elementor-button-link, .elementor-button";r(function(){r("body").on("click touchend",n,function(){clearTimeout(e);e=setTimeout(function(){t.initialize()},500)})})};i._ASL=ASL;i._ASL.ready()}(asljQuery,asljQuery,window);
js/min/jquery.ajaxsearchlite.min.js CHANGED
@@ -1,3 +1,3 @@
1
- (function(n){typeof define=="function"&&!1&&define.amd&&define.amd.jQuery?define(["jquery"],n):typeof module!="undefined"&&!1&&module.exports?n(require("jquery")):n(jQuery)})(function(n){var r="left",u="right",f="up",e="down",v="in",y="out",p="none",nt="auto",w="swipe",b="pinch",k="tap",tt="doubletap",it="longtap",d="horizontal",g="vertical",l="all",ut=10,rt="start",o="move",t="end",i="cancel",c="ontouchstart"in window,a=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!c,s=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!c,h="TouchSwipe";n.fn.swipe=function(t){var r=n(this),i=r.data(h);if(i&&typeof t=="string"){if(i[t])return i[t].apply(this,Array.prototype.slice.call(arguments,1));n.error("Method "+t+" does not exist on jQuery.swipe")}else if(i&&typeof t=="object")i.option.apply(this,arguments);else if(!i&&(typeof t=="object"||!t))return ft.apply(this,arguments);return r};n.fn.swipe.version="1.6.15";n.fn.swipe.defaults={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:!0,triggerOnTouchLeave:!1,allowPageScroll:"auto",fallbackToMouseEvents:!0,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:!0};n.fn.swipe.phases={PHASE_START:rt,PHASE_MOVE:o,PHASE_END:t,PHASE_CANCEL:i};n.fn.swipe.directions={LEFT:r,RIGHT:u,UP:f,DOWN:e,IN:v,OUT:y};n.fn.swipe.pageScroll={NONE:p,HORIZONTAL:d,VERTICAL:g,AUTO:nt};n.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:l};function ft(t){return t&&t.allowPageScroll===undefined&&(t.swipe!==undefined||t.swipeStatus!==undefined)&&(t.allowPageScroll=p),t.click!==undefined&&t.tap===undefined&&(t.tap=t.click),t||(t={}),t=n.extend({},n.fn.swipe.defaults,t),this.each(function(){var r=n(this),i=r.data(h);i||(i=new et(this,t),r.data(h,i))})}function et(ft,et){var et=n.extend({},et),si=c||s||!et.fallbackToMouseEvents,hi=si?s?a?"MSPointerDown":"pointerdown":"touchstart":"mousedown",ki=si?s?a?"MSPointerMove":"pointermove":"touchmove":"mousemove",di=si?s?a?"MSPointerUp":"pointerup":"touchend":"mouseup",ri=si?s?"mouseleave":null:"mouseleave",ci=s?a?"MSPointerCancel":"pointercancel":"touchcancel",at=0,vt=null,yt=null,lt=0,gt=0,ni=0,pt=1,bt=0,kt=0,li=null,ot=n(ft),st="start",ct=0,ht={},gi=0,ai=0,vi=0,nr=0,ti=0,fi=null,ei=null;try{ot.bind(hi,tr);ot.bind(ci,ui)}catch(ff){n.error("events not supported "+hi+","+ci+" on jQuery.swipe")}this.enable=function(){return ot.bind(hi,tr),ot.bind(ci,ui),ot};this.disable=function(){return lr(),ot};this.destroy=function(){lr();ot.data(h,null);ot=null};this.option=function(t,i){if(typeof t=="object")et=n.extend(et,t);else if(et[t]!==undefined){if(i===undefined)return et[t];et[t]=i}else if(t)n.error("Option "+t+" does not exist on jQuery.swipe.options");else return et;return null};function tr(t){if(!pu()&&!(n(t.target).closest(et.excludedElements,ot).length>0)){var r=t.originalEvent?t.originalEvent:t,f,u=r.touches,e=u?u[0]:r;return(st=rt,u?ct=u.length:et.preventDefaultEvents!==!1&&t.preventDefault(),at=0,vt=null,yt=null,kt=null,lt=0,gt=0,ni=0,pt=1,bt=0,li=ku(),dr(),wi(0,e),!u||ct===et.fingers||et.fingers===l||oi()?(gi=ii(),ct==2&&(wi(1,u[1]),gt=ni=cr(ht[0].start,ht[1].start)),(et.swipeStatus||et.pinchStatus)&&(f=wt(r,st))):f=!1,f===!1)?(st=i,wt(r,st),f):(et.hold&&(ei=setTimeout(n.proxy(function(){ot.trigger("hold",[r.target]);et.hold&&(f=et.hold.call(ot,r,r.target))},this),et.longTapThreshold)),pi(!0),null)}}function ir(n){var f=n.originalEvent?n.originalEvent:n;if(st!==t&&st!==i&&!yi()){var s,r=f.touches,h=r?r[0]:f,u=gr(h);if(ai=ii(),r&&(ct=r.length),et.hold&&clearTimeout(ei),st=o,ct==2&&(gt==0?(wi(1,r[1]),gt=ni=cr(ht[0].start,ht[1].start)):(gr(r[1]),ni=cr(ht[0].end,ht[1].end),kt=gu(ht[0].end,ht[1].end)),pt=du(gt,ni),bt=Math.abs(gt-ni)),ct===et.fingers||et.fingers===l||!r||oi()){if(vt=iu(u.start,u.end),yt=iu(u.last,u.end),uu(n,yt),at=nf(u.start,u.end),lt=tu(),bu(vt,at),s=wt(f,st),!et.triggerOnTouchEnd||et.triggerOnTouchLeave){var e=!0;if(et.triggerOnTouchLeave){var c=rf(this);e=uf(u.end,c)}!et.triggerOnTouchEnd&&e?st=fr(o):et.triggerOnTouchLeave&&!e&&(st=fr(t));(st==i||st==t)&&wt(f,st)}}else st=i,wt(f,st);s===!1&&(st=i,wt(f,st))}}function rr(n){var r=n.originalEvent?n.originalEvent:n,u=r.touches;if(u){if(u.length&&!yi())return yu(r),!0;if(u.length&&yi())return!0}return yi()&&(ct=nr),ai=ii(),lt=tu(),or()||!er()?(st=i,wt(r,st)):et.triggerOnTouchEnd||et.triggerOnTouchEnd==!1&&st===o?(et.preventDefaultEvents!==!1&&n.preventDefault(),st=t,wt(r,st)):!et.triggerOnTouchEnd&&br()?(st=t,dt(r,st,k)):st===o&&(st=i,wt(r,st)),pi(!1),null}function ui(){ct=0;ai=0;gi=0;gt=0;ni=0;pt=1;dr();pi(!1)}function ur(n){var i=n.originalEvent?n.originalEvent:n;et.triggerOnTouchLeave&&(st=fr(t),wt(i,st))}function lr(){ot.unbind(hi,tr);ot.unbind(ci,ui);ot.unbind(ki,ir);ot.unbind(di,rr);ri&&ot.unbind(ri,ur);pi(!1)}function fr(n){var r=n,f=ar(),u=er(),e=or();return!f||e?r=i:u&&n==o&&(!et.triggerOnTouchEnd||et.triggerOnTouchLeave)?r=t:!u&&n==t&&et.triggerOnTouchLeave&&(r=i),r}function wt(n,r){var u,f=n.touches;return(eu()||sr())&&(u=dt(n,r,w)),(fu()||oi())&&u!==!1&&(u=dt(n,r,b)),au()&&u!==!1?u=dt(n,r,tt):vu()&&u!==!1?u=dt(n,r,it):lu()&&u!==!1&&(u=dt(n,r,k)),r===i&&(sr()&&(u=dt(n,r,w)),oi()&&(u=dt(n,r,b)),ui(n)),r===t&&(f?f.length||ui(n):ui(n)),u}function dt(o,s,h){var c;if(h==w){if(ot.trigger("swipeStatus",[s,vt||null,at||0,lt||0,ct,ht,yt]),et.swipeStatus&&(c=et.swipeStatus.call(ot,o,s,vt||null,at||0,lt||0,ct,ht,yt),c===!1))return!1;if(s==t&&yr()){if(clearTimeout(fi),clearTimeout(ei),ot.trigger("swipe",[vt,at,lt,ct,ht,yt]),et.swipe&&(c=et.swipe.call(ot,o,vt,at,lt,ct,ht,yt),c===!1))return!1;switch(vt){case r:ot.trigger("swipeLeft",[vt,at,lt,ct,ht,yt]);et.swipeLeft&&(c=et.swipeLeft.call(ot,o,vt,at,lt,ct,ht,yt));break;case u:ot.trigger("swipeRight",[vt,at,lt,ct,ht,yt]);et.swipeRight&&(c=et.swipeRight.call(ot,o,vt,at,lt,ct,ht,yt));break;case f:ot.trigger("swipeUp",[vt,at,lt,ct,ht,yt]);et.swipeUp&&(c=et.swipeUp.call(ot,o,vt,at,lt,ct,ht,yt));break;case e:ot.trigger("swipeDown",[vt,at,lt,ct,ht,yt]);et.swipeDown&&(c=et.swipeDown.call(ot,o,vt,at,lt,ct,ht,yt))}}}if(h==b){if(ot.trigger("pinchStatus",[s,kt||null,bt||0,lt||0,ct,pt,ht]),et.pinchStatus&&(c=et.pinchStatus.call(ot,o,s,kt||null,bt||0,lt||0,ct,pt,ht),c===!1))return!1;if(s==t&&vr())switch(kt){case v:ot.trigger("pinchIn",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchIn&&(c=et.pinchIn.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht));break;case y:ot.trigger("pinchOut",[kt||null,bt||0,lt||0,ct,pt,ht]);et.pinchOut&&(c=et.pinchOut.call(ot,o,kt||null,bt||0,lt||0,ct,pt,ht))}}return h==k?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),hr()&&!su()?(ti=ii(),fi=setTimeout(n.proxy(function(){ti=null;ot.trigger("tap",[o.target]);et.tap&&(c=et.tap.call(ot,o,o.target))},this),et.doubleTapThreshold)):(ti=null,ot.trigger("tap",[o.target]),et.tap&&(c=et.tap.call(ot,o,o.target)))):h==tt?(s===i||s===t)&&(clearTimeout(fi),clearTimeout(ei),ti=null,ot.trigger("doubletap",[o.target]),et.doubleTap&&(c=et.doubleTap.call(ot,o,o.target))):h==it&&(s===i||s===t)&&(clearTimeout(fi),ti=null,ot.trigger("longtap",[o.target]),et.longTap&&(c=et.longTap.call(ot,o,o.target))),c}function er(){var n=!0;return et.threshold!==null&&(n=at>=et.threshold),n}function or(){var n=!1;return et.cancelThreshold!==null&&vt!==null&&(n=nu(vt)-at>=et.cancelThreshold),n}function ru(){return et.pinchThreshold!==null?bt>=et.pinchThreshold:!0}function ar(){return et.maxTimeThreshold?lt>=et.maxTimeThreshold?!1:!0:!0}function uu(n,t){if(et.preventDefaultEvents!==!1)if(et.allowPageScroll===p)n.preventDefault();else{var i=et.allowPageScroll===nt;switch(t){case r:(et.swipeLeft&&i||!i&&et.allowPageScroll!=d)&&n.preventDefault();break;case u:(et.swipeRight&&i||!i&&et.allowPageScroll!=d)&&n.preventDefault();break;case f:(et.swipeUp&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault();break;case e:(et.swipeDown&&i||!i&&et.allowPageScroll!=g)&&n.preventDefault()}}}function vr(){var n=pr(),t=wr(),i=ru();return n&&t&&i}function oi(){return!!(et.pinchStatus||et.pinchIn||et.pinchOut)}function fu(){return!!(vr()&&oi())}function yr(){var n=ar(),t=er(),i=pr(),r=wr(),u=or();return!u&&r&&i&&t&&n}function sr(){return!!(et.swipe||et.swipeStatus||et.swipeLeft||et.swipeRight||et.swipeUp||et.swipeDown)}function eu(){return!!(yr()&&sr())}function pr(){return ct===et.fingers||et.fingers===l||!c}function wr(){return ht[0].end.x!==0}function br(){return!!et.tap}function hr(){return!!et.doubleTap}function ou(){return!!et.longTap}function kr(){if(ti==null)return!1;var n=ii();return hr()&&n-ti<=et.doubleTapThreshold}function su(){return kr()}function hu(){return(ct===1||!c)&&(isNaN(at)||at<et.threshold)}function cu(){return lt>et.longTapThreshold&&at<ut}function lu(){return!!(hu()&&br())}function au(){return!!(kr()&&hr())}function vu(){return!!(cu()&&ou())}function yu(n){vi=ii();nr=n.touches.length+1}function dr(){vi=0;nr=0}function yi(){var n=!1;if(vi){var t=ii()-vi;t<=et.fingerReleaseThreshold&&(n=!0)}return n}function pu(){return!!(ot.data(h+"_intouch")===!0)}function pi(n){ot&&(n===!0?(ot.bind(ki,ir),ot.bind(di,rr),ri&&ot.bind(ri,ur)):(ot.unbind(ki,ir,!1),ot.unbind(di,rr,!1),ri&&ot.unbind(ri,ur,!1)),ot.data(h+"_intouch",n===!0))}function wi(n,t){var i={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};return i.start.x=i.last.x=i.end.x=t.pageX||t.clientX,i.start.y=i.last.y=i.end.y=t.pageY||t.clientY,ht[n]=i,i}function gr(n){var i=n.identifier!==undefined?n.identifier:0,t=wu(i);return t===null&&(t=wi(i,n)),t.last.x=t.end.x,t.last.y=t.end.y,t.end.x=n.pageX||n.clientX,t.end.y=n.pageY||n.clientY,t}function wu(n){return ht[n]||null}function bu(n,t){t=Math.max(t,nu(n));li[n].distance=t}function nu(n){return li[n]?li[n].distance:undefined}function ku(){var n={};return n[r]=bi(r),n[u]=bi(u),n[f]=bi(f),n[e]=bi(e),n}function bi(n){return{direction:n,distance:0}}function tu(){return ai-gi}function cr(n,t){var i=Math.abs(n.x-t.x),r=Math.abs(n.y-t.y);return Math.round(Math.sqrt(i*i+r*r))}function du(n,t){var i=t/n*1;return i.toFixed(2)}function gu(){return pt<1?y:v}function nf(n,t){return Math.round(Math.sqrt(Math.pow(t.x-n.x,2)+Math.pow(t.y-n.y,2)))}function tf(n,t){var r=n.x-t.x,u=t.y-n.y,f=Math.atan2(u,r),i=Math.round(f*180/Math.PI);return i<0&&(i=360-Math.abs(i)),i}function iu(n,t){var i=tf(n,t);return i<=45&&i>=0?r:i<=360&&i>=315?r:i>=135&&i<=225?u:i>45&&i<135?e:f}function ii(){var n=new Date;return n.getTime()}function rf(t){t=n(t);var i=t.offset();return{left:i.left,right:i.left+t.outerWidth(),top:i.top,bottom:i.top+t.outerHeight()}}function uf(n,t){return n.x>t.left&&n.x<t.right&&n.y>t.top&&n.y<t.bottom}}});jQuery.extend({highlight:function(n,t,i,r){if(n.nodeType===3){var u=n.data.match(t);if(u){var o=document.createElement(i||"span");if(o.className=r||"highlight",/\.|,|\s/.test(u[0].charAt(0)))var s=u.index+1;else var s=u.index;var f=n.splitText(s);f.splitText(u[1].length);var h=f.cloneNode(!0);return o.appendChild(h),f.parentNode.replaceChild(o,f),1}}else if(n.nodeType===1&&n.childNodes&&!/(script|style)/i.test(n.tagName)&&!(n.tagName===i.toUpperCase()&&n.className===r))for(var e=0;e<n.childNodes.length;e++)e+=jQuery.highlight(n.childNodes[e],t,i,r);return 0}});jQuery.fn.unhighlight=function(n){var t={className:"highlight",element:"span"};return jQuery.extend(t,n),this.find(t.element+"."+t.className).each(function(){var n=this.parentNode;n.replaceChild(this.firstChild,this);n.normalize()}).end()};jQuery.fn.highlight=function(n,t){var i={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1};if(jQuery.extend(i,t),n.constructor===String&&(n=[n]),n=jQuery.grep(n,function(n){return n!=""}),n=jQuery.map(n,function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")}),n.length==0)return this;var u=i.caseSensitive?"":"i",r="("+n.join("|")+")";i.wordsOnly&&(r="(?:,|^|\\s)"+r+"(?:,|$|\\s)");var f=new RegExp(r,u);return this.each(function(){jQuery.highlight(this,f,i.element,i.className)})},function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.asl_SimpleBar=t())}(this,function(){"use strict";var f=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ft(n,t){return t={exports:{}},n(t,t.exports),t.exports}var yt="object",pt=function(n){return n&&n.Math==Math&&n},t=pt(typeof globalThis==yt&&globalThis)||pt(typeof window==yt&&window)||pt(typeof self==yt&&self)||pt(typeof f==yt&&f)||Function("return this")(),u=function(n){try{return!!n()}catch(t){return!0}},a=!u(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),uf={}.propertyIsEnumerable,ff=Object.getOwnPropertyDescriptor,ds=ff&&!uf.call({1:2},1),gs=ds?function(n){var t=ff(this,n);return!!t&&t.enumerable}:uf,ef={f:gs},er=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}},nh={}.toString,b=function(n){return nh.call(n).slice(8,-1)},th="".split,wt=u(function(){return!Object("z").propertyIsEnumerable(0)})?function(n){return b(n)=="String"?th.call(n,""):Object(n)}:Object,bt=function(n){if(n==undefined)throw TypeError("Can't call method on "+n);return n},kt=function(n){return wt(bt(n))},n=function(n){return typeof n=="object"?n!==null:typeof n=="function"},of=function(t,i){if(!n(t))return t;var r,u;if(i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t))||typeof(r=t.valueOf)=="function"&&!n(u=r.call(t))||!i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t)))return u;throw TypeError("Can't convert object to primitive value");},ih={}.hasOwnProperty,r=function(n,t){return ih.call(n,t)},or=t.document,rh=n(or)&&n(or.createElement),sf=function(n){return rh?or.createElement(n):{}},hf=!a&&!u(function(){return Object.defineProperty(sf("div"),"a",{get:function(){return 7}}).a!=7}),cf=Object.getOwnPropertyDescriptor,uh=a?cf:function(n,t){if(n=kt(n),t=of(t,!0),hf)try{return cf(n,t)}catch(i){}if(r(n,t))return er(!ef.f.call(n,t),n[t])},lf={f:uh},s=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t},af=Object.defineProperty,fh=a?af:function(n,t,i){if(s(n),t=of(t,!0),s(i),hf)try{return af(n,t,i)}catch(r){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(n[t]=i.value),n},k={f:fh},o=a?function(n,t,i){return k.f(n,t,er(1,i))}:function(n,t,i){return n[t]=i,n},sr=function(n,i){try{o(t,n,i)}catch(r){t[n]=i}return i},dt=ft(function(n){var i="__core-js_shared__",r=t[i]||sr(i,{});(n.exports=function(n,t){return r[n]||(r[n]=t!==undefined?t:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),gt=dt("native-function-to-string",Function.toString),vf=t.WeakMap,yf=typeof vf=="function"&&/native code/.test(gt.call(vf)),eh=0,oh=Math.random(),hr=function(n){return"Symbol("+String(n===undefined?"":n)+")_"+(++eh+oh).toString(36)},pf=dt("keys"),cr=function(n){return pf[n]||(pf[n]=hr(n))},ni={},sh=t.WeakMap,ti,et,ii,hh=function(n){return ii(n)?et(n):ti(n,{})},ch=function(t){return function(i){var r;if(!n(i)||(r=et(i)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(yf){var d=new sh,lh=d.get,ah=d.has,vh=d.set;ti=function(n,t){return vh.call(d,n,t),t};et=function(n){return lh.call(d,n)||{}};ii=function(n){return ah.call(d,n)}}else{var ot=cr("state");ni[ot]=!0;ti=function(n,t){return o(n,ot,t),t};et=function(n){return r(n,ot)?n[ot]:{}};ii=function(n){return r(n,ot)}}var h={set:ti,get:et,has:ii,enforce:hh,getterFor:ch},st=ft(function(n){var i=h.get,u=h.enforce,f=String(gt).split("toString");dt("inspectSource",function(n){return gt.call(n)});(n.exports=function(n,i,e,s){var c=s?!!s.unsafe:!1,h=s?!!s.enumerable:!1,l=s?!!s.noTargetGet:!1;if(typeof e=="function"&&(typeof i!="string"||r(e,"name")||o(e,"name",i),u(e).source=f.join(typeof i=="string"?i:"")),n===t){h?n[i]=e:sr(i,e);return}c?!l&&n[i]&&(h=!0):delete n[i];h?n[i]=e:o(n,i,e)})(Function.prototype,"toString",function(){return typeof this=="function"&&i(this).source||gt.call(this)})}),lr=t,wf=function(n){return typeof n=="function"?n:undefined},bf=function(n,i){return arguments.length<2?wf(lr[n])||wf(t[n]):lr[n]&&lr[n][i]||t[n]&&t[n][i]},yh=Math.ceil,ph=Math.floor,ar=function(n){return isNaN(n=+n)?0:(n>0?ph:yh)(n)},wh=Math.min,ri=function(n){return n>0?wh(ar(n),9007199254740991):0},bh=Math.max,kh=Math.min,dh=function(n,t){var i=ar(n);return i<0?bh(i+t,0):kh(i,t)},kf=function(n){return function(t,i,r){var f=kt(t),e=ri(f.length),u=dh(r,e),o;if(n&&i!=i){while(e>u)if(o=f[u++],o!=o)return!0}else for(;e>u;u++)if((n||u in f)&&f[u]===i)return n||u||0;return!n&&-1}},gh={includes:kf(!0),indexOf:kf(!1)},nc=gh.indexOf,df=function(n,t){var f=kt(n),e=0,u=[];for(var i in f)!r(ni,i)&&r(f,i)&&u.push(i);while(t.length>e)r(f,i=t[e++])&&(~nc(u,i)||u.push(i));return u},ui=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tc=ui.concat("length","prototype"),ic=Object.getOwnPropertyNames||function(n){return df(n,tc)},rc={f:ic},uc=Object.getOwnPropertySymbols,gf={f:uc},fc=bf("Reflect","ownKeys")||function(n){var t=rc.f(s(n)),i=gf.f;return i?t.concat(i(n)):t},ec=function(n,t){for(var f=fc(t),e=k.f,o=lf.f,i=0;i<f.length;i++){var u=f[i];r(n,u)||e(n,u,o(t,u))}},oc=/#|\.prototype\./,ht=function(n,t){var i=hc[sc(n)];return i==lc?!0:i==cc?!1:typeof t=="function"?u(t):!!t},sc=ht.normalize=function(n){return String(n).replace(oc,".").toLowerCase()},hc=ht.data={},cc=ht.NATIVE="N",lc=ht.POLYFILL="P",vr=ht,ac=lf.f,l=function(n,i){var s=n.target,c=n.global,l=n.stat,a,f,r,u,e,h;if(f=c?t:l?t[s]||sr(s,{}):(t[s]||{}).prototype,f)for(r in i){if(e=i[r],n.noTargetGet?(h=ac(f,r),u=h&&h.value):u=f[r],a=vr(c?r:s+(l?".":"#")+r,n.forced),!a&&u!==undefined){if(typeof e==typeof u)continue;ec(e,u)}(n.sham||u&&u.sham)&&o(e,"sham",!0);st(f,r,e,n)}},ne=function(n){if(typeof n!="function")throw TypeError(String(n)+" is not a function");return n},te=function(n,t,i){if(ne(n),t===undefined)return n;switch(i){case 0:return function(){return n.call(t)};case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)}}return function(){return n.apply(t,arguments)}},fi=function(n){return Object(bt(n))},ie=Array.isArray||function(n){return b(n)=="Array"},re=!!Object.getOwnPropertySymbols&&!u(function(){return!String(Symbol())}),ue=t.Symbol,fe=dt("wks"),e=function(n){return fe[n]||(fe[n]=re&&ue[n]||(re?ue:hr)("Symbol."+n))},vc=e("species"),yc=function(t,i){var r;return ie(t)&&(r=t.constructor,typeof r=="function"&&(r===Array||ie(r.prototype))?r=undefined:n(r)&&(r=r[vc],r===null&&(r=undefined))),new(r===undefined?Array:r)(i===0?0:i)},pc=[].push,v=function(n){var i=n==1,u=n==2,f=n==3,t=n==4,r=n==6,e=n==5||r;return function(o,s,h,c){for(var w=fi(o),v=wt(w),d=te(s,h,3),b=ri(v.length),l=0,k=c||yc,y=i?k(o,b):u?k(o,0):undefined,a,p;b>l;l++)if((e||l in v)&&(a=v[l],p=d(a,l,w),n))if(i)y[l]=p;else if(p)switch(n){case 3:return!0;case 5:return a;case 6:return l;case 2:pc.call(y,a)}else if(t)return!1;return r?-1:f||t?t:y}},ei={forEach:v(0),map:v(1),filter:v(2),some:v(3),every:v(4),find:v(5),findIndex:v(6)},ee=function(n,t){var i=[][n];return!i||!u(function(){i.call(null,t||function(){throw 1;},1)})},wc=ei.forEach,ct=ee("forEach")?function(n){return wc(this,n,arguments.length>1?arguments[1]:undefined)}:[].forEach;l({target:"Array",proto:!0,forced:[].forEach!=ct},{forEach:ct});var yr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var bc in yr){var oe=t[bc],oi=oe&&oe.prototype;if(oi&&oi.forEach!==ct)try{o(oi,"forEach",ct)}catch(bb){oi.forEach=ct}}var kc=!!(typeof window!="undefined"&&window.document&&window.document.createElement),pr=kc,dc=e("species"),gc=function(n){return!u(function(){var t=[],i=t.constructor={};return i[dc]=function(){return{foo:1}},t[n](Boolean).foo!==1})},nl=ei.filter;l({target:"Array",proto:!0,forced:!gc("filter")},{filter:function(n){return nl(this,n,arguments.length>1?arguments[1]:undefined)}});var si=Object.keys||function(n){return df(n,ui)},tl=a?Object.defineProperties:function(n,t){s(n);for(var i=si(t),f=i.length,r=0,u;f>r;)k.f(n,u=i[r++],t[u]);return n},il=bf("document","documentElement"),se=cr("IE_PROTO"),wr="prototype",br=function(){},hi=function(){var t=sf("iframe"),r=ui.length,u="<",i="script",f=">",e="java"+i+":",n;for(t.style.display="none",il.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(u+i+f+"document.F=Object"+u+"/"+i+f),n.close(),hi=n.F;r--;)delete hi[wr][ui[r]];return hi()},he=Object.create||function(n,t){var i;return n!==null?(br[wr]=s(n),i=new br,br[wr]=null,i[se]=n):i=hi(),t===undefined?i:tl(i,t)};ni[se]=!0;var kr=e("unscopables"),dr=Array.prototype;dr[kr]==undefined&&o(dr,kr,he(null));var gr=function(n){dr[kr][n]=!0},g={},rl=!u(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype}),ce=cr("IE_PROTO"),ul=Object.prototype,ci=rl?Object.getPrototypeOf:function(n){return(n=fi(n),r(n,ce))?n[ce]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?ul:null},le=e("iterator"),ae=!1,fl=function(){return this},nt,nu,tu;[].keys&&(tu=[].keys(),"next"in tu?(nu=ci(ci(tu)),nu!==Object.prototype&&(nt=nu)):ae=!0);nt==undefined&&(nt={});r(nt,le)||o(nt,le,fl);var iu={IteratorPrototype:nt,BUGGY_SAFARI_ITERATORS:ae},el=k.f,ve=e("toStringTag"),ru=function(n,t,i){n&&!r(n=i?n:n.prototype,ve)&&el(n,ve,{configurable:!0,value:t})},ol=iu.IteratorPrototype,sl=function(){return this},hl=function(n,t,i){var r=t+" Iterator";return n.prototype=he(ol,{next:er(1,i)}),ru(n,r,!1),g[r]=sl,n},cl=function(t){if(!n(t)&&t!==null)throw TypeError("Can't set "+String(t)+" as a prototype");return t},li=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,i={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set;n.call(i,[]);t=i instanceof Array}catch(r){}return function(i,r){return s(i),cl(r),t?n.call(i,r):i.__proto__=r,i}}():undefined),uu=iu.IteratorPrototype,ai=iu.BUGGY_SAFARI_ITERATORS,lt=e("iterator"),ye="keys",vi="values",pe="entries",ll=function(){return this},we=function(n,t,i,r,u,f,e){hl(i,t,r);var y=function(n){if(n===u&&h)return h;if(!ai&&n in s)return s[n];switch(n){case ye:return function(){return new i(this,n)};case vi:return function(){return new i(this,n)};case pe:return function(){return new i(this,n)}}return function(){return new i(this)}},k=t+" Iterator",w=!1,s=n.prototype,a=s[lt]||s["@@iterator"]||u&&s[u],h=!ai&&a||y(u),b=t=="Array"?s.entries||a:a,c,v,p;if(b&&(c=ci(b.call(new n)),uu!==Object.prototype&&c.next&&(ci(c)!==uu&&(li?li(c,uu):typeof c[lt]!="function"&&o(c,lt,ll)),ru(c,k,!0))),u==vi&&a&&a.name!==vi&&(w=!0,h=function(){return a.call(this)}),s[lt]!==h&&o(s,lt,h),g[t]=h,u)if(v={values:y(vi),keys:f?h:y(ye),entries:y(pe)},e)for(p in v)!ai&&!w&&p in s||st(s,p,v[p]);else l({target:t,proto:!0,forced:ai||w},v);return v},be="Array Iterator",al=h.set,vl=h.getterFor(be),at=we(Array,"Array",function(n,t){al(this,{type:be,target:kt(n),index:0,kind:t})},function(){var t=vl(this),i=t.target,r=t.kind,n=t.index++;return!i||n>=i.length?(t.target=undefined,{value:undefined,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:i[n],done:!1}:{value:[n,i[n]],done:!1}},"values");g.Arguments=g.Array;gr("keys");gr("values");gr("entries");var yi=Object.assign,ke=!yi||u(function(){var n={},t={},i=Symbol(),r="abcdefghijklmnopqrst";return n[i]=7,r.split("").forEach(function(n){t[n]=n}),yi({},n)[i]!=7||si(yi({},t)).join("")!=r})?function(n){for(var r=fi(n),s=arguments.length,u=1,f=gf.f,h=ef.f;s>u;)for(var t=wt(arguments[u++]),e=f?si(t).concat(f(t)):si(t),c=e.length,o=0,i;c>o;)i=e[o++],(!a||h.call(t,i))&&(r[i]=t[i]);return r}:yi;l({target:"Object",stat:!0,forced:Object.assign!==ke},{assign:ke});var yl=e("toStringTag"),pl=b(function(){return arguments}())=="Arguments",wl=function(n,t){try{return n[t]}catch(i){}},de=function(n){var t,i,r;return n===undefined?"Undefined":n===null?"Null":typeof(i=wl(t=Object(n),yl))=="string"?i:pl?b(t):(r=b(t))=="Object"&&typeof t.callee=="function"?"Arguments":r},bl=e("toStringTag"),fu={};fu[bl]="z";var ge=String(fu)!=="[object z]"?function(){return"[object "+de(this)+"]"}:fu.toString,no=Object.prototype;ge!==no.toString&&st(no,"toString",ge,{unsafe:!0});var eu="\t\n\x0b\f\r                 \u2028\u2029",pi="["+eu+"]",kl=RegExp("^"+pi+pi+"*"),dl=RegExp(pi+pi+"*$"),ou=function(n){return function(t){var i=String(bt(t));return n&1&&(i=i.replace(kl,"")),n&2&&(i=i.replace(dl,"")),i}},gl={start:ou(1),end:ou(2),trim:ou(3)},na=gl.trim,wi=t.parseInt,ta=/^[+-]?0[Xx]/,ia=wi(eu+"08")!==8||wi(eu+"0x16")!==22,to=ia?function(n,t){var i=na(String(n));return wi(i,t>>>0||(ta.test(i)?16:10))}:wi;l({global:!0,forced:parseInt!=to},{parseInt:to});var io=function(n){return function(t,i){var u=String(bt(t)),r=ar(i),o=u.length,f,e;return r<0||r>=o?n?"":undefined:(f=u.charCodeAt(r),f<55296||f>56319||r+1===o||(e=u.charCodeAt(r+1))<56320||e>57343?n?u.charAt(r):f:n?u.slice(r,r+2):(f-55296<<10)+(e-56320)+65536)}},ro={codeAt:io(!1),charAt:io(!0)},ra=ro.charAt,uo="String Iterator",ua=h.set,fa=h.getterFor(uo);we(String,"String",function(n){ua(this,{type:uo,string:String(n),index:0})},function(){var n=fa(this),i=n.string,r=n.index,t;return r>=i.length?{value:undefined,done:!0}:(t=ra(i,r),n.index+=t.length,{value:t,done:!1})});var su=function(n,t,i){for(var r in t)st(n,r,t[r],i);return n},ea=!u(function(){return Object.isExtensible(Object.preventExtensions({}))}),y=ft(function(t){var e=k.f,i=hr("meta"),o=0,u=Object.isExtensible||function(){return!0},f=function(n){e(n,i,{value:{objectID:"O"+ ++o,weakData:{}}})},s=function(t,e){if(!n(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!r(t,i)){if(!u(t))return"F";if(!e)return"E";f(t)}return t[i].objectID},h=function(n,t){if(!r(n,i)){if(!u(n))return!0;if(!t)return!1;f(n)}return n[i].weakData},c=function(n){return ea&&l.REQUIRED&&u(n)&&!r(n,i)&&f(n),n},l=t.exports={REQUIRED:!1,fastKey:s,getWeakData:h,onFreeze:c};ni[i]=!0}),ik=y.REQUIRED,rk=y.fastKey,uk=y.getWeakData,fk=y.onFreeze,oa=e("iterator"),sa=Array.prototype,ha=function(n){return n!==undefined&&(g.Array===n||sa[oa]===n)},ca=e("iterator"),la=function(n){if(n!=undefined)return n[ca]||n["@@iterator"]||g[de(n)]},aa=function(n,t,i,r){try{return r?t(s(i)[0],i[1]):t(i)}catch(f){var u=n["return"];u!==undefined&&s(u.call(n));throw f;}},fo=ft(function(n){var t=function(n,t){this.stopped=n;this.result=t},i=n.exports=function(n,i,r,u,f){var a=te(i,r,u?2:1),h,c,o,v,e,l;if(f)h=n;else{if(c=la(n),typeof c!="function")throw TypeError("Target is not iterable");if(ha(c)){for(o=0,v=ri(n.length);v>o;o++)if(e=u?a(s(l=n[o])[0],l[1]):a(n[o]),e&&e instanceof t)return e;return new t(!1)}h=c.call(n)}while(!(l=h.next()).done)if(e=aa(h,a,l.value,u),e&&e instanceof t)return e;return new t(!1)};i.stop=function(n){return new t(!0,n)}}),eo=function(n,t,i){if(!(n instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return n},oo=e("iterator"),so=!1;try{var va=0,ho={next:function(){return{done:!!va++}},"return":function(){so=!0}};ho[oo]=function(){return this};Array.from(ho,function(){throw 2;})}catch(bb){}var ya=function(n,t){if(!t&&!so)return!1;var i=!1;try{var r={};r[oo]=function(){return{next:function(){return{done:i=!0}}}};n(r)}catch(u){}return i},pa=function(t,i,r){var u,f;return li&&typeof(u=i.constructor)=="function"&&u!==r&&n(f=u.prototype)&&f!==r.prototype&&li(t,f),t},wa=function(i,r,f,e,o){var h=t[i],c=h&&h.prototype,s=h,a=e?"set":"add",w={},v=function(t){var i=c[t];st(c,t,t=="add"?function(n){return i.call(this,n===0?0:n),this}:t=="delete"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:t=="get"?function(t){return o&&!n(t)?undefined:i.call(this,t===0?0:t)}:t=="has"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:function(n,t){return i.call(this,n===0?0:n,t),this})};if(vr(i,typeof h!="function"||!(o||c.forEach&&!u(function(){(new h).entries().next()}))))s=f.getConstructor(r,i,e,a),y.REQUIRED=!0;else if(vr(i,!0)){var p=new s,k=p[a](o?{}:-0,1)!=p,d=u(function(){p.has(1)}),g=ya(function(n){new h(n)}),b=!o&&u(function(){for(var t=new h,n=5;n--;)t[a](n,n);return!t.has(-0)});g||(s=r(function(n,t){eo(n,s,i);var r=pa(new h,n,s);return t!=undefined&&fo(t,r[a],r,e),r}),s.prototype=c,c.constructor=s);(d||b)&&(v("delete"),v("has"),e&&v("get"));(b||k)&&v(a);o&&c.clear&&delete c.clear}return w[i]=s,l({global:!0,forced:s!=h},w),ru(s,i),o||f.setStrong(s,i,e),s},bi=y.getWeakData,ba=h.set,ka=h.getterFor,da=ei.find,ga=ei.findIndex,nv=0,ki=function(n){return n.frozen||(n.frozen=new co)},co=function(){this.entries=[]},hu=function(n,t){return da(n.entries,function(n){return n[0]===t})};co.prototype={get:function(n){var t=hu(this,n);if(t)return t[1]},has:function(n){return!!hu(this,n)},set:function(n,t){var i=hu(this,n);i?i[1]=t:this.entries.push([n,t])},"delete":function(n){var t=ga(this.entries,function(t){return t[0]===n});return~t&&this.entries.splice(t,1),!!~t}};var lo={getConstructor:function(t,i,u,f){var e=t(function(n,t){eo(n,e,i);ba(n,{type:i,id:nv++,frozen:undefined});t!=undefined&&fo(t,n[f],n,u)}),o=ka(i),h=function(n,t,i){var r=o(n),u=bi(s(t),!0);return u===!0?ki(r).set(t,i):u[r.id]=i,n};return su(e.prototype,{"delete":function(t){var u=o(this);if(!n(t))return!1;var i=bi(t);return i===!0?ki(u)["delete"](t):i&&r(i,u.id)&&delete i[u.id]},has:function(t){var u=o(this);if(!n(t))return!1;var i=bi(t);return i===!0?ki(u).has(t):i&&r(i,u.id)}}),su(e.prototype,u?{get:function(t){var r=o(this);if(n(t)){var i=bi(t);return i===!0?ki(r).get(t):i?i[r.id]:undefined}},set:function(n,t){return h(this,n,t)}}:{add:function(n){return h(this,n,!0)}}),e}},ek=ft(function(i){var f=h.enforce,v=!t.ActiveXObject&&"ActiveXObject"in t,e=Object.isExtensible,r,s=function(n){return function(){return n(this,arguments.length?arguments[0]:undefined)}},p=i.exports=wa("WeakMap",s,lo,!0,!0);if(yf&&v){r=lo.getConstructor(s,"WeakMap",!0);y.REQUIRED=!0;var u=p.prototype,c=u["delete"],o=u.has,l=u.get,a=u.set;su(u,{"delete":function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),c.call(this,t)||i.frozen["delete"](t)}return c.call(this,t)},has:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)||i.frozen.has(t)}return o.call(this,t)},get:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)?l.call(this,t):i.frozen.get(t)}return l.call(this,t)},set:function(t,i){if(n(t)&&!e(t)){var u=f(this);u.frozen||(u.frozen=new r);o.call(this,t)?a.call(this,t,i):u.frozen.set(t,i)}else a.call(this,t,i);return this}})}}),cu=e("iterator"),ao=e("toStringTag"),lu=at.values;for(var au in yr){var vo=t[au],c=vo&&vo.prototype;if(c){if(c[cu]!==lu)try{o(c,cu,lu)}catch(bb){c[cu]=lu}if(c[ao]||o(c,ao,au),yr[au])for(var tt in at)if(c[tt]!==at[tt])try{o(c,tt,at[tt])}catch(bb){c[tt]=at[tt]}}}var yo="Expected a function",po=0/0,tv="[object Symbol]",iv=/^\s+|\s+$/g,rv=/^[-+]0x[0-9a-f]+$/i,uv=/^0b[01]+$/i,fv=/^0o[0-7]+$/i,ev=parseInt,ov=typeof f=="object"&&f&&f.Object===Object&&f,sv=typeof self=="object"&&self&&self.Object===Object&&self,hv=ov||sv||Function("return this")(),cv=Object.prototype,lv=cv.toString,av=Math.max,vv=Math.min,vu=function(){return hv.Date.now()};function yv(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(yo);t=wo(t)||0;di(i)&&(p=!!i.leading,h="maxWait"in i,c=h?av(wo(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?vv(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=vu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(vu())}function y(){var n=vu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function pv(n,t,i){var r=!0,u=!0;if(typeof n!="function")throw new TypeError(yo);return di(i)&&(r="leading"in i?!!i.leading:r,u="trailing"in i?!!i.trailing:u),yv(n,t,{leading:r,maxWait:t,trailing:u})}function di(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function wv(n){return!!n&&typeof n=="object"}function bv(n){return typeof n=="symbol"||wv(n)&&lv.call(n)==tv}function wo(n){if(typeof n=="number")return n;if(bv(n))return po;if(di(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=di(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(iv,"");var i=uv.test(n);return i||fv.test(n)?ev(n.slice(2),i?2:8):rv.test(n)?po:+n}var bo=pv,kv="Expected a function",ko=0/0,dv="[object Symbol]",gv=/^\s+|\s+$/g,ny=/^[-+]0x[0-9a-f]+$/i,ty=/^0b[01]+$/i,iy=/^0o[0-7]+$/i,ry=parseInt,uy=typeof f=="object"&&f&&f.Object===Object&&f,fy=typeof self=="object"&&self&&self.Object===Object&&self,ey=uy||fy||Function("return this")(),oy=Object.prototype,sy=oy.toString,hy=Math.max,cy=Math.min,yu=function(){return ey.Date.now()};function ly(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(kv);t=go(t)||0;pu(i)&&(p=!!i.leading,h="maxWait"in i,c=h?hy(go(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?cy(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=yu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(yu())}function y(){var n=yu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function pu(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function ay(n){return!!n&&typeof n=="object"}function vy(n){return typeof n=="symbol"||ay(n)&&sy.call(n)==dv}function go(n){if(typeof n=="number")return n;if(vy(n))return ko;if(pu(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=pu(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(gv,"");var i=ty.test(n);return i||iy.test(n)?ry(n.slice(2),i?2:8):ny.test(n)?ko:+n}var ns=ly,yy="Expected a function",ts="__lodash_hash_undefined__",py="[object Function]",wy="[object GeneratorFunction]",by=/^\[object .+?Constructor\]$/,ky=typeof f=="object"&&f&&f.Object===Object&&f,dy=typeof self=="object"&&self&&self.Object===Object&&self,is=ky||dy||Function("return this")();function gy(n,t){return n==null?undefined:n[t]}function np(n){var t=!1;if(n!=null&&typeof n.toString!="function")try{t=!!(n+"")}catch(i){}return t}var tp=Array.prototype,ip=Function.prototype,rs=Object.prototype,wu=is["__core-js_shared__"],us=function(){var n=/[^.]+$/.exec(wu&&wu.keys&&wu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),fs=ip.toString,bu=rs.hasOwnProperty,rp=rs.toString,up=RegExp("^"+fs.call(bu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fp=tp.splice,ep=es(is,"Map"),vt=es(Object,"create");function p(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function op(){this.__data__=vt?vt(null):{}}function sp(n){return this.has(n)&&delete this.__data__[n]}function hp(n){var t=this.__data__;if(vt){var i=t[n];return i===ts?undefined:i}return bu.call(t,n)?t[n]:undefined}function cp(n){var t=this.__data__;return vt?t[n]!==undefined:bu.call(t,n)}function lp(n,t){var i=this.__data__;return i[n]=vt&&t===undefined?ts:t,this}p.prototype.clear=op;p.prototype["delete"]=sp;p.prototype.get=hp;p.prototype.has=cp;p.prototype.set=lp;function it(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function ap(){this.__data__=[]}function vp(n){var t=this.__data__,i=gi(t,n);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():fp.call(t,i,1),!0}function yp(n){var t=this.__data__,i=gi(t,n);return i<0?undefined:t[i][1]}function pp(n){return gi(this.__data__,n)>-1}function wp(n,t){var i=this.__data__,r=gi(i,n);return r<0?i.push([n,t]):i[r][1]=t,this}it.prototype.clear=ap;it.prototype["delete"]=vp;it.prototype.get=yp;it.prototype.has=pp;it.prototype.set=wp;function w(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function bp(){this.__data__={hash:new p,map:new(ep||it),string:new p}}function kp(n){return nr(this,n)["delete"](n)}function dp(n){return nr(this,n).get(n)}function gp(n){return nr(this,n).has(n)}function nw(n,t){return nr(this,n).set(n,t),this}w.prototype.clear=bp;w.prototype["delete"]=kp;w.prototype.get=dp;w.prototype.has=gp;w.prototype.set=nw;function gi(n,t){for(var i=n.length;i--;)if(fw(n[i][0],t))return i;return-1}function tw(n){if(!os(n)||rw(n))return!1;var t=ew(n)||np(n)?up:by;return t.test(uw(n))}function nr(n,t){var i=n.__data__;return iw(t)?i[typeof t=="string"?"string":"hash"]:i.map}function es(n,t){var i=gy(n,t);return tw(i)?i:undefined}function iw(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function rw(n){return!!us&&us in n}function uw(n){if(n!=null){try{return fs.call(n)}catch(t){}try{return n+""}catch(t){}}return""}function ku(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new TypeError(yy);var i=function(){var r=arguments,u=t?t.apply(this,r):r[0],f=i.cache;if(f.has(u))return f.get(u);var e=n.apply(this,r);return i.cache=f.set(u,e),e};return i.cache=new(ku.Cache||w),i}ku.Cache=w;function fw(n,t){return n===t||n!==n&&t!==t}function ew(n){var t=os(n)?rp.call(n):"";return t==py||t==wy}function os(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}var ow=ku,ss=function(){function n(n,t){var i=-1;return n.some(function(n,r){return n[0]===t?(i=r,!0):!1}),i}return typeof Map!="undefined"?Map:function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},t.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},t.prototype.has=function(t){return!!~n(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,t){t===void 0&&(t=null);for(var i=0,r=this.__entries__;i<r.length;i++){var u=r[i];n.call(t,u[1],u[0])}},t}()}(),du=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,tr=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),sw=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(tr):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),hw=2;function cw(n,t){var i=!1,r=!1,u=0;function e(){i&&(i=!1,n());r&&f()}function o(){sw(e)}function f(){var n=Date.now();if(i){if(n-u<hw)return;r=!0}else i=!0,r=!1,setTimeout(o,t);u=n}return f}var lw=20,aw=["top","right","bottom","left","width","height","size","weight"],vw=typeof MutationObserver!="undefined",yw=function(){function n(){this.connected_=!1;this.mutationEventsAdded_=!1;this.mutationsObserver_=null;this.observers_=[];this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=cw(this.refresh.bind(this),lw)}return n.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n);this.connected_||this.connect_()},n.prototype.removeObserver=function(n){var t=this.observers_,i=t.indexOf(n);~i&&t.splice(i,1);!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},n.prototype.updateObservers_=function(){var n=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return n.forEach(function(n){return n.broadcastActive()}),n.length>0},n.prototype.connect_=function(){du&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),vw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){du&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(n){var t=n.propertyName,i=t===void 0?"":t,r=aw.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),hs=function(n,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var u=r[i];Object.defineProperty(n,u,{value:t[u],enumerable:!1,writable:!1,configurable:!0})}return n},rt=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||tr},cs=rr(0,0,0,0);function ir(n){return parseFloat(n)||0}function ls(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return i.reduce(function(t,i){var r=n["border-"+i+"-width"];return t+ir(r)},0)}function pw(n){for(var i={},t=0,r=["top","right","bottom","left"];t<r.length;t++){var u=r[t],f=n["padding-"+u];i[u]=ir(f)}return i}function ww(n){var t=n.getBBox();return rr(0,0,t.width,t.height)}function bw(n){var f=n.clientWidth,e=n.clientHeight;if(!f&&!e)return cs;var t=rt(n).getComputedStyle(n),i=pw(t),o=i.left+i.right,s=i.top+i.bottom,r=ir(t.width),u=ir(t.height);if(t.boxSizing==="border-box"&&(Math.round(r+o)!==f&&(r-=ls(t,"left","right")+o),Math.round(u+s)!==e&&(u-=ls(t,"top","bottom")+s)),!dw(n)){var h=Math.round(r+o)-f,c=Math.round(u+s)-e;Math.abs(h)!==1&&(r-=h);Math.abs(c)!==1&&(u-=c)}return rr(i.left,i.top,r,u)}var kw=function(){return typeof SVGGraphicsElement!="undefined"?function(n){return n instanceof rt(n).SVGGraphicsElement}:function(n){return n instanceof rt(n).SVGElement&&typeof n.getBBox=="function"}}();function dw(n){return n===rt(n).document.documentElement}function gw(n){return du?kw(n)?ww(n):bw(n):cs}function nb(n){var t=n.x,i=n.y,r=n.width,u=n.height,e=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,f=Object.create(e.prototype);return hs(f,{x:t,y:i,width:r,height:u,top:i,right:t+r,bottom:u+i,left:t}),f}function rr(n,t,i,r){return{x:n,y:t,width:i,height:r}}var tb=function(){function n(n){this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=rr(0,0,0,0);this.target=n}return n.prototype.isActive=function(){var n=gw(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},n}(),ib=function(){function n(n,t){var i=nb(t);hs(this,{target:n,contentRect:i})}return n}(),rb=function(){function n(n,t,i){if(this.activeObservations_=[],this.observations_=new ss,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n;this.controller_=t;this.callbackCtx_=i}return n.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof rt(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)||(t.set(n,new tb(n)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof rt(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)&&(t.delete(n),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var n=this;this.clearActive();this.observations_.forEach(function(t){t.isActive()&&n.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new ib(n.target,n.broadcastRect())});this.callback_.call(n,t,n);this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),as=typeof WeakMap!="undefined"?new WeakMap:new ss,vs=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=yw.getInstance(),r=new rb(t,i,this);as.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){vs.prototype[n]=function(){var t;return(t=as.get(this))[n].apply(t,arguments)}});var ub=function(){return typeof tr.ResizeObserver!="undefined"?tr.ResizeObserver:vs}(),ut=null,ys=null;pr&&window.addEventListener("resize",function(){ys!==window.devicePixelRatio&&(ys=window.devicePixelRatio,ut=null)});function ps(){if(ut===null){if(typeof document=="undefined")return ut=0;var t=document.body,n=document.createElement("div");n.classList.add("asl_simplebar-hide-scrollbar");t.appendChild(n);var i=n.getBoundingClientRect().right;t.removeChild(n);ut=i}return ut}var i=function(){function t(n,i){var r=this;(this.onScroll=function(){r.scrollXTicking||(window.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0);r.scrollYTicking||(window.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x"));r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y"));r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x");r.showScrollbar("y")},this.onMouseMove=function(n){if(r.mouseX=n.clientX,r.mouseY=n.clientY,r.axis.x.isOverflowing||r.axis.x.forceVisible)r.onMouseMoveForAxis("x");if(r.axis.y.isOverflowing||r.axis.y.forceVisible)r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){if(r.onMouseMove.cancel(),r.axis.x.isOverflowing||r.axis.x.forceVisible)r.onMouseLeaveForAxis("x");if(r.axis.y.isOverflowing||r.axis.y.forceVisible)r.onMouseLeaveForAxis("y");r.mouseX=-1;r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth();r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect();r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect();r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1);r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var t,i;if(r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(t=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(i=r.isWithinBounds(r.axis.y.track.rect)),(t||i)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown")){if(t)if(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect))r.onDragStart(n,"x");else r.onTrackClick(n,"x");if(i)if(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect))r.onDragStart(n,"y");else r.onTrackClick(n,"y")}},this.drag=function(n){var u,f=r.axis[r.draggedAxis].track,e=f.rect[r.axis[r.draggedAxis].sizeAttr],o=r.axis[r.draggedAxis].scrollbar,s=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],h=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);n.preventDefault();n.stopPropagation();u=r.draggedAxis==="y"?n.pageY:n.pageX;var c=u-f.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset,l=c/(e-o.size),i=l*(s-h);r.draggedAxis==="x"&&(i=r.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i-(e+o.size):i,i=r.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-i:i);r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=i},this.onEndDrag=function(n){n.preventDefault();n.stopPropagation();r.el.classList.remove(r.classNames.dragging);document.removeEventListener("mousemove",r.drag,!0);document.removeEventListener("mouseup",r.onEndDrag,!0);r.removePreventClickId=window.setTimeout(function(){document.removeEventListener("click",r.preventClick,!0);document.removeEventListener("dblclick",r.preventClick,!0);r.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault();n.stopPropagation()},this.el=n,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,{},i),this.classNames=Object.assign({},t.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el))||(this.recalculate=bo(this.recalculate.bind(this),64),this.onMouseMove=bo(this.onMouseMove.bind(this),64),this.hideScrollbars=ns(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ns(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=ow(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var r=document.createElement("div");r.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"><\/div><\/div>';var n=r.firstElementChild;document.body.appendChild(n);var u=n.firstElementChild;n.scrollLeft=0;var f=t.getOffset(n),i=t.getOffset(u);n.scrollLeft=999;var e=t.getOffset(u);return{isRtlScrollingInverted:f.left!==i.left&&i.left-e.left!=0,isRtlScrollbarInverted:f.left!==i.left}};t.getOffset=function(n){var t=n.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft)}};var n=t.prototype;return n.init=function(){t.instances.set(this.el,this);pr&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},n.initDOM=function(){var i=this;if(Array.prototype.filter.call(this.el.children,function(n){return n.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl);this.offsetEl.appendChild(this.contentWrapperEl);this.maskEl.appendChild(this.offsetEl);this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);this.wrapperEl.appendChild(this.maskEl);this.wrapperEl.appendChild(this.placeholderEl);this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var n=document.createElement("div"),t=document.createElement("div");n.classList.add(this.classNames.track);t.classList.add(this.classNames.scrollbar);n.appendChild(t);this.axis.x.track.el=n.cloneNode(!0);this.axis.x.track.el.classList.add(this.classNames.horizontal);this.axis.y.track.el=n.cloneNode(!0);this.axis.y.track.el.classList.add(this.classNames.vertical);this.el.appendChild(this.axis.x.track.el);this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar);this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar);this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible));this.el.setAttribute("data-asl_simplebar","init")},n.initListeners=function(){var n=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.addEventListener("mousemove",this.onMouseMove);this.el.addEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.addEventListener("scroll",this.onScroll);window.addEventListener("resize",this.onWindowResize);var t=!1;this.resizeObserver=new ub(function(){t&&n.recalculate()});this.resizeObserver.observe(this.el);this.resizeObserver.observe(this.contentEl);window.requestAnimationFrame(function(){t=!0});this.mutationObserver=new MutationObserver(this.recalculate);this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},n.recalculate=function(){this.elStyles=window.getComputedStyle(this.el);this.isRtl=this.elStyles.direction==="rtl";var u=this.heightAutoObserverEl.offsetHeight<=1,f=this.heightAutoObserverEl.offsetWidth<=1,t=this.contentEl.offsetWidth,e=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft;this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var n=this.contentEl.scrollHeight,i=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=u?"auto":"100%";this.placeholderEl.style.width=f?t+"px":"auto";this.placeholderEl.style.height=n+"px";var r=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=i>t;this.axis.y.isOverflowing=n>r;this.axis.x.isOverflowing=o==="hidden"?!1:this.axis.x.isOverflowing;this.axis.y.isOverflowing=s==="hidden"?!1:this.axis.y.isOverflowing;this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0;this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0;this.hideNativeScrollbar();var h=this.axis.x.isOverflowing?this.scrollbarWidth:0,c=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&i>e-c;this.axis.y.isOverflowing=this.axis.y.isOverflowing&&n>r-h;this.axis.x.scrollbar.size=this.getScrollbarSize("x");this.axis.y.scrollbar.size=this.getScrollbarSize("y");this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px";this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px";this.positionScrollbar("x");this.positionScrollbar("y");this.toggleTrackVisibility("x");this.toggleTrackVisibility("y")},n.getScrollbarSize=function(n){if(n===void 0&&(n="y"),!this.axis[n].isOverflowing)return 0;var r=this.contentEl[this.axis[n].scrollSizeAttr],i=this.axis[n].track.el[this.axis[n].offsetSizeAttr],t,u=i/r;return t=Math.max(~~(u*i),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},n.positionScrollbar=function(n){if(n===void 0&&(n="y"),this.axis[n].isOverflowing){var e=this.contentWrapperEl[this.axis[n].scrollSizeAttr],f=this.axis[n].track.el[this.axis[n].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[n].sizeAttr],10),u=this.axis[n].scrollbar,r=this.contentWrapperEl[this.axis[n].scrollOffsetAttr];r=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-r:r;var s=r/(e-o),i=~~((f-u.size)*s);i=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i+(f-u.size):i;u.el.style.transform=n==="x"?"translate3d("+i+"px, 0, 0)":"translate3d(0, "+i+"px, 0)"}},n.toggleTrackVisibility=function(n){n===void 0&&(n="y");var t=this.axis[n].track.el,i=this.axis[n].scrollbar.el;this.axis[n].isOverflowing||this.axis[n].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[n].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[n].overflowAttr]="hidden");i.style.display=this.axis[n].isOverflowing?"block":"none"},n.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0;this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},n.onMouseMoveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.rect=this.axis[n].track.el.getBoundingClientRect();this.axis[n].scrollbar.rect=this.axis[n].scrollbar.el.getBoundingClientRect();var t=this.isWithinBounds(this.axis[n].scrollbar.rect);t?this.axis[n].scrollbar.el.classList.add(this.classNames.hover):this.axis[n].scrollbar.el.classList.remove(this.classNames.hover);this.isWithinBounds(this.axis[n].track.rect)?(this.showScrollbar(n),this.axis[n].track.el.classList.add(this.classNames.hover)):this.axis[n].track.el.classList.remove(this.classNames.hover)},n.onMouseLeaveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.el.classList.remove(this.classNames.hover);this.axis[n].scrollbar.el.classList.remove(this.classNames.hover)},n.showScrollbar=function(n){n===void 0&&(n="y");var t=this.axis[n].scrollbar.el;this.axis[n].isVisible||(t.classList.add(this.classNames.visible),this.axis[n].isVisible=!0);this.options.autoHide&&this.hideScrollbars()},n.onDragStart=function(n,t){t===void 0&&(t="y");var i=this.axis[t].scrollbar,r=t==="y"?n.pageY:n.pageX;this.axis[t].dragOffset=r-i.rect[this.axis[t].offsetAttr];this.draggedAxis=t;this.el.classList.add(this.classNames.dragging);document.addEventListener("mousemove",this.drag,!0);document.addEventListener("mouseup",this.onEndDrag,!0);this.removePreventClickId===null?(document.addEventListener("click",this.preventClick,!0),document.addEventListener("dblclick",this.preventClick,!0)):(window.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},n.onTrackClick=function(n,t){var r=this;t===void 0&&(t="y");this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var c=this.axis[t].scrollbar,f=c.rect[this.axis[t].offsetAttr],e=parseInt(this.elStyles[this.axis[t].sizeAttr],10),i=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],l=t==="y"?this.mouseY-f:this.mouseX-f,o=l<0?-1:1,s=o===-1?i-e:i+e,h=40,u=function u(){if(o===-1){if(i>s){var n;i-=h;r.contentWrapperEl.scrollTo((n={},n[r.axis[t].offsetAttr]=i,n));window.requestAnimationFrame(u)}}else if(i<s){var f;i+=h;r.contentWrapperEl.scrollTo((f={},f[r.axis[t].offsetAttr]=i,f));window.requestAnimationFrame(u)}};u()},n.getContentElement=function(){return this.contentEl},n.getScrollElement=function(){return this.contentWrapperEl},n.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style?0:ps()}catch(n){return ps()}},n.removeListeners=function(){var n=this;this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.removeEventListener("mousemove",this.onMouseMove);this.el.removeEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.removeEventListener("scroll",this.onScroll);window.removeEventListener("resize",this.onWindowResize);this.mutationObserver.disconnect();this.resizeObserver.disconnect();this.recalculate.cancel();this.onMouseMove.cancel();this.hideScrollbars.cancel();this.onWindowResize.cancel()},n.unMount=function(){this.removeListeners();t.instances.delete(this.el)},n.isWithinBounds=function(n){return this.mouseX>=n.left&&this.mouseX<=n.left+n.width&&this.mouseY>=n.top&&this.mouseY<=n.top+n.height},n.findChild=function(n,t){var i=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return Array.prototype.filter.call(n.children,function(n){return i.call(n,t)})[0]},t}();i.defaultOptions={autoHide:!0,forceVisible:!1,classNames:{contentEl:"asl_simplebar-content",contentWrapper:"asl_simplebar-content-wrapper",offset:"asl_simplebar-offset",mask:"asl_simplebar-mask",wrapper:"asl_simplebar-wrapper",placeholder:"asl_simplebar-placeholder",scrollbar:"asl_simplebar-scrollbar",track:"asl_simplebar-track",heightAutoObserverWrapperEl:"asl_simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"asl_simplebar-height-auto-observer",visible:"asl_simplebar-visible",horizontal:"asl_simplebar-horizontal",vertical:"asl_simplebar-vertical",hover:"asl_simplebar-hover",dragging:"asl_simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};i.instances=new WeakMap;var ws=function(n){return function(t,i,r,u){ne(i);var o=fi(t),e=wt(o),s=ri(o.length),f=n?s-1:0,h=n?-1:1;if(r<2)while(!0){if(f in e){u=e[f];f+=h;break}if(f+=h,n?f<0:s<=f)throw TypeError("Reduce of empty array with no initial value");}for(;n?f>=0:s>f;f+=h)f in e&&(u=i(u,e[f],f,o));return u}},fb={left:ws(!1),right:ws(!0)},eb=fb.left;l({target:"Array",proto:!0,forced:ee("reduce")},{reduce:function(n){return eb(this,n,arguments.length,arguments.length>1?arguments[1]:undefined)}});var ob=k.f,gu=Function.prototype,sb=gu.toString,hb=/^\s*function ([^ (]*)/,bs="name";!a||bs in gu||ob(gu,bs,{configurable:!0,get:function(){try{return sb.call(this).match(hb)[1]}catch(n){return""}}});var cb=function(){var t=s(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n},ur=RegExp.prototype.exec,lb=String.prototype.replace,ks=ur,nf=function(){var n=/a/,t=/b*/g;return ur.call(n,"a"),ur.call(t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),tf=/()??/.exec("")[1]!==undefined,ab=nf||tf;ab&&(ks=function(n){var i=this,u,f,t,r;return tf&&(f=new RegExp("^"+i.source+"$(?!\\s)",cb.call(i))),nf&&(u=i.lastIndex),t=ur.call(i,n),nf&&t&&(i.lastIndex=i.global?t.index+t[0].length:u),tf&&t&&t.length>1&&lb.call(t[0],f,function(){for(r=1;r<arguments.length-2;r++)arguments[r]===undefined&&(t[r]=undefined)}),t});var rf=ks;l({target:"RegExp",proto:!0,forced:/./.exec!==rf},{exec:rf});var hk=e("species"),ck=!u(function(){var n=/./;return n.exec=function(){var n=[];return n.groups={a:"7"},n},"".replace(n,"$<a>")!=="7"}),lk=!u(function(){var n=/(?:)/,i=n.exec;n.exec=function(){return i.apply(this,arguments)};var t="ab".split(n);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),vb=ro.charAt,ak=function(n,t,i){return t+(i?vb(n,t).length:1)},vk=function(n,t){var i=n.exec;if(typeof i=="function"){var r=i.call(n,t);if(typeof r!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return r}if(b(n)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return rf.call(n,t)},yk=Math.max,pk=Math.min,wk=Math.floor,bk=function(n){return n===undefined?n:String(n)},fr=function(n){return Array.prototype.reduce.call(n,function(n,t){var r=t.name.match(/data-asl_simplebar-(.+)/);if(r){var i=r[1].replace(/\W+(.)/g,function(n,t){return t.toUpperCase()});switch(t.value){case"true":n[i]=!0;break;case"false":n[i]=!1;break;case undefined:n[i]=!0;break;default:n[i]=t.value}}return n},{})};return i.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements);window.removeEventListener("load",this.initDOMLoadedElements);Array.prototype.forEach.call(document.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){i.instances.has(n)||new i(n,fr(n.attributes))})},i.removeObserver=function(){this.globalObserver.disconnect()},i.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this);typeof MutationObserver!="undefined"&&(this.globalObserver=new MutationObserver(i.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0}));document.readyState!=="complete"&&(document.readyState==="loading"||document.documentElement.doScroll)?(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements)):window.setTimeout(this.initDOMLoadedElements)},i.handleMutations=function(n){n.forEach(function(n){Array.prototype.forEach.call(n.addedNodes,function(n){n.nodeType===1&&(n.hasAttribute("data-asl_simplebar")?i.instances.has(n)||new i(n,fr(n.attributes)):Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){i.instances.has(n)||new i(n,fr(n.attributes))}))});Array.prototype.forEach.call(n.removedNodes,function(n){n.nodeType===1&&(n.hasAttribute('[data-asl_simplebar="init"]')?i.instances.has(n)&&i.instances.get(n).unMount():Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar="init"]'),function(n){i.instances.has(n)&&i.instances.get(n).unMount()}))})})},i.getOptions=fr,pr&&i.initHtmlApi(),i});
2
  /*! Ajax Search Lite 4.6 js */
3
- (function(n){var t,c=!0,s={init:function(t,i){var r=this;this.elem=i;this.$elem=n(i);r.searching=!1;r.o=n.extend({blocking:!1},t);r.n={};r.n.container=n(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=n(".probox",r.n.container);r.n.proinput=n(".proinput",r.n.container);r.n.text=n(".proinput input.orig",r.n.container);r.n.textAutocomplete=n(".proinput input.autocomplete",r.n.container);r.n.loading=n(".proinput .loading",r.n.container);r.n.proloading=n(".proloading",r.n.container);r.n.proclose=n(".proclose",r.n.container);r.n.promagnifier=n(".promagnifier",r.n.container);r.n.prosettings=n(".prosettings",r.n.container);r.n.searchsettings=n("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=n("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=n("#asl_hidden_data");r.n.aslItemOverlay=n(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=n(".showmore",r.n.resultsDiv);r.n.items=n(".item",r.n.resultsDiv);r.n.results=n(".results",r.n.resultsDiv);r.n.resdrg=n(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.firstClick=!0;r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.savedScrollTop=0;r.savedContainerTop=0;r.is_scroll=typeof asl_SimpleBar!="undefined";typeof ASL.scrollbar!="undefined"&&ASL.scrollbar==0&&(r.is_scroll=!1);r.settScroll=null;r.n.resultsAppend=n("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.lastSuccesfulSearch="";r.lastSearchData={};r.triggerPrevState=!1;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var t=n(this).parent();!t.hasClass("isotopic");)t=t.parent();var i=n(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),typeof ASL.resHTML=="undefined"&&(ASL.resHTML=r.n.resultsDiv.html()),typeof ASL.setHTML=="undefined"&&(ASL.setHTML=r.n.searchsettings.html()),n("fieldset",r.n.searchsettings).each(function(){n(".asl_option:not(.hiddend)",this).last().addClass("asl-o-last")}),ASL.js_retain_popstate==1&&r.initPrevState(),a()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),r.initAutop(),r.initEtc(),this},initPrevState:function(){var r=this;c&&t==null&&(t=localStorage.getItem("asl-"+i.encode(location.href)),t!=null&&(t=JSON.parse(t),t.settings=i.decode(t.settings)));t!=null&&typeof t.id!="undefined"&&t.id==r.o.id&&(t.phrase!=""&&(r.triggerPrevState=!0,r.n.text.val(t.phrase)),o(n("form",r.n.searchsettings))!=t.settings&&(r.triggerPrevState=!0,o(n("form",r.n.searchsettings),t.settings)));localStorage.removeItem("asl-"+i.encode(location.href));r.n.resultsDiv.on("click",".results .item",function(){var t=r.n.text.val();if(t!=""||r.settingsChanged){var u={id:r.o.id,phrase:t,settings:i.encode(o(n("form",r.n.searchsettings)))};localStorage.setItem("asl-"+i.encode(location.href),JSON.stringify(u))}})},duplicateCheck:function(){var i=this,t={};n("div[id*=ajaxsearchlite]").each(function(){t.hasOwnProperty(this.id)?n(this).remove():t[this.id]="true"})},gaPageview:function(n){var r=this,t=r.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="pageview")return!1;if(ASL.analytics.string!=""){var i=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1,u=typeof gtag=="function"?gtag:!1;window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var f=r.o.homeurl.replace(window.location.origin,"");u!==!1?t!==!1&&u("config",t,{page_path:f+ASL.analytics.string.replace("{asl_term}",n)}):i!==!1&&(t!==!1&&i("create",t,"auto"),i("send","pageview",{page:f+ASL.analytics.string.replace("{asl_term}",n),title:"Ajax Search"}))}},gaEvent:function(t,i){var u=this,f=u.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="event")return!1;var e=typeof gtag=="function"?gtag:!1,o=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1;if(e===!1&&o===!1)return!1;if(typeof ASL.analytics.event[t]!="undefined"&&ASL.analytics.event[t].active==1&&typeof"gtag"!="undefined"){var s={search_id:u.o.id,search_name:u.o.name,phrase:u.n.text.val(),option_name:"",option_value:"",result_title:"",result_url:"",results_count:""},r={event_category:ASL.analytics.event[t].category,event_label:ASL.analytics.event[t].label,value:ASL.analytics.event[t].value};i=n.extend(s,i);n.each(i,function(t,i){i=String(i).replace(/[\s\n\r]+/g," ").trim();n.each(r,function(n,u){var f=new RegExp("{"+t+"}","gmi");r[n]=u.replace(f,i)})});e===!1?(f!==!1&&o("create",f,"auto"),o("send","event",r.event_category,ASL.analytics.event[t].action,r.event_label,r.value)):(f!==!1&&(r.send_to=f),e("event",ASL.analytics.event[t].action,r))}},gaGetTrackingID:function(){var r=this,n=!1;if(typeof ASL.analytics=="undefined")return n;if(typeof ASL.analytics.tracking_id!="undefined"&&ASL.analytics.tracking_id!="")return ASL.analytics.tracking_id;var i=typeof gtag=="function"?gtag:!1;if(i!==!1&&typeof ga!="undefined"&&typeof ga.getAll!="undefined"){var t=!1;return ga.getAll().forEach(function(n){t=n.get("trackingId")}),t}return n},createVerticalScroll:function(){var t=this;t.is_scroll&&typeof t.scroll.recalculate=="undefined"&&(t.scroll=new asl_SimpleBar(t.n.results.get(0),{direction:n("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0}))},initEvents:function(){var t=this;if(r()&&e())t.n.text.on("touchstart",function(){t.savedScrollTop=n(window).scrollTop();t.savedContainerTop=t.n.container.offset().top});t.n.text.click(function(){n(this).focus();t.gaEvent("focus")});t.n.text.on("focus input",function(){t.searching||(n(this).val()!=""?t.n.proclose.css("display","block"):t.n.proclose.css({display:"none"}))});n(t.n.text.parent()).submit(function(n){if(n.preventDefault(),r())if(t.o.redirect_on_enter){var i=jQuery.Event("keyup");i.keyCode=i.which=13;t.n.text.trigger(i)}else t.o.redirectEnterTo=="ajax_search"&&(t.search(),document.activeElement.blur());else t.o.redirectEnterTo=="ajax_search"&&t.search()});t.n.text.click(function(){t.firstClick&&(n(this).val(""),t.firstClick=!1)});t.n.resultsDiv.css({opacity:0});n(document).bind("click touchend",function(){(t.hideSettings(),t.opened!=!1&&t.o.closeOnDocClick==1)&&t.hideResults()});t.n.proclose.on("click touchend",function(){t.n.text.val("");t.n.textAutocomplete.val("");t.hideResults();t.n.text.focus()});n(t.elem).bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.resultsDiv.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.searchsettings.bind("click touchend",function(n){n.stopImmediatePropagation()});t.n.prosettings.on("click",function(){t.n.prosettings.data("opened")==0?t.showSettings():t.hideSettings()});var f=t.n.container.parents().filter(function(){return n(this).css("position")=="fixed"});if((f.length>0||t.n.container.css("position")=="fixed")&&(t.n.resultsDiv.css("position")=="absolute"&&t.n.resultsDiv.css("position","fixed"),t.n.resultsDiv.css("z-index",99999999999),t.o.blocking||t.n.searchsettings.css("position","fixed")),r())n(window).on("orientationchange",function(){t.orientationChange();setTimeout(function(){t.orientationChange()},800)});else{var i;n(window).on("resize",function(){clearTimeout(i);i=setTimeout(function(){t.resize()},100)})}var u;n(window).on("scroll",function(){clearTimeout(u);u=setTimeout(function(){t.scrolling(!1)},400)});e()&&r()&&l()&&parseInt(t.n.text.css("font-size"))<16&&(t.n.text.data("fontSize",t.n.text.css("font-size")).css("font-size","16px"),t.n.textAutocomplete.css("font-size","16px"),n("<style>#ajaxsearchlite"+t.o.rid+" input.orig::-webkit-input-placeholder{font-size: 16px !important;}<\/style>").appendTo("head"));t.initNavigationEvent();t.initMagnifierEvent();t.initAutocompleteEvent();t.initFacetEvents()},initAutop:function(){var n=this;if(t!=null&&n.triggerPrevState)return n.search(),t=null,!1},initEtc:function(){var t=this,i=null;n("div.asl_option",t.n.searchsettings).on("mouseup touchend",function(r){if(r.preventDefault(),r.stopImmediatePropagation(),t.dragging)return!1;n('input[type="checkbox"]',this).prop("checked",!n('input[type="checkbox"]',this).prop("checked"));clearTimeout(i);var u=this;i=setTimeout(function(){n('input[type="checkbox"]',u).trigger("asl_chbx_change")},50)});n("div.asl_option label",t.n.searchsettings).click(function(n){n.preventDefault()});t.n.resultsDiv.on("click",".results .item",function(){t.gaEvent("result_click",{result_title:n(this).find("a.asl_res_url").text(),result_url:n(this).find("a.asl_res_url").attr("href")})})},initNavigationEvent:function(){var t=this;n(t.n.resultsDiv).on("mouseenter",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered");n(this).addClass("hovered")});n(t.n.resultsDiv).on("mouseleave",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered")});n(document).keydown(function(i){if(window.event)var r=window.event.keyCode,e=window.event.type;else if(i)var r=i.which,e=i.type;if(n(".item",t.n.resultsDiv).length>0&&t.n.resultsDiv.css("display")!="none"){if(r==40||r==38){r==40&&(t.n.text.blur(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).first().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").next(".item").addClass("hovered"));r==38&&(t.n.text.blur(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).last().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").prev(".item").addClass("hovered"));i.stopPropagation();i.preventDefault();var u=t.is_scroll?n(t.scroll.getScrollElement()):t.n.results,f=t.n.resultsDiv.find(".resdrg .item.hovered");f.length==0&&(f=t.n.resultsDiv.children().first());u.animate({scrollTop:f.offset().top-u.offset().top+u.scrollTop()},{duration:120})}r==13&&n(".item.hovered",t.n.resultsDiv).length>0&&(i.stopPropagation(),i.preventDefault(),n(".item.hovered a.asl_res_url",t.n.resultsDiv).get(0).click())}})},initMagnifierEvent:function(){var t=this,i,u,r=!1;t.n.text.on("keyup",function(f){if(window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):f&&(t.keycode=f.which,t.ktype=f.type),t.keycode==13){if(clearTimeout(u),u=setTimeout(function(){r=!1},300),r)return!1;r=!0}var e=n(this).hasClass("orig");if(t.n.text.val().length>=t.o.charcount&&e&&t.ktype=="keyup"&&t.keycode==13){if(t.gaEvent("return"),t.o.redirect_on_enter==1)t.o.redirectEnterTo!="first_result"?t.doRedirectToResults(t.ktype):t.search();else{if(t.o.redirectEnterTo=="nothing")return!1;n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()==t.lastSuccesfulSearch&&t.resultsOpened||t.search()}clearTimeout(i)}});t.n.promagnifier.add(t.n.text).bind("click input",function(r){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):r&&(t.keycode=r.which,t.ktype=r.type);var u=n(this).hasClass("orig");if(t.n.text.val().length<t.o.charcount){t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(i);return}if(t.n.text.val().length>=t.o.charcount&&!u&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo!="first_result"){t.doRedirectToResults(t.ktype);clearTimeout(i);return}if((!(t.keycode>=37)||!(t.keycode<=40))&&(!(t.keycode>=112)||!(t.keycode<=123))){if(u&&t.ktype=="click"||t.keycode==32){n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()==t.lastSuccesfulSearch&&(t.n.proclose.css("display","block"),t.resultsOpened||t.showResults());return}n(this).hasClass("orig")&&t.ktype=="click"||(u||t.ktype!="click"||t.gaEvent("magnifier"),t.o.trigger_on_click!=0||t.ktype!="click")&&(t.o.triggerontype!=0||t.ktype!="input")&&(!u||t.ktype!="input"||t.o.redirectEnterTo!="nothing")&&(u||t.ktype!="click"||t.o.redirectClickTo!="nothing")&&(t.post!=null&&t.post.abort(),clearTimeout(i),t.hideLoader(),i=setTimeout(function(){if(n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()!=t.lastSuccesfulSearch)t.search();else{if(t.n.proclose.css("display","block"),t.isRedirectToFirstResult())return t.doRedirectToFirstResult(),!1;t.resultsOpened||t.showResults()}},250))}})},initFacetEvents:function(){var t=this,i=null;if(t.o.trigger_on_facet_change==1){n("input[type!=checkbox], select",t.n.searchsettings).on("change slidechange",function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),clearTimeout(i),i=setTimeout(function(){t.search()},50))});n("input[type=checkbox]",t.n.searchsettings).on("asl_chbx_change",function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),t.gaEvent("facet_change",{option_label:n(this).closest("fieldset").find("legend").text(),option_value:n(this).closest(".asl_option").find(".asl_option_label").text()+(n(this).prop("checked")?"(checked)":"(unchecked)")}),clearTimeout(i),i=setTimeout(function(){t.search()},50))})}},isRedirectToFirstResult:function(){var t=this;return n(".asl_res_url",t.n.resultsDiv).length>0&&(t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo=="first_result"||t.o.redirect_on_enter==1&&(t.ktype=="input"||t.ktype=="keyup")&&t.keycode==13&&t.o.redirectEnterTo=="first_result")?!0:!1},doRedirectToFirstResult:function(){var t=this,i;return i=t.ktype=="click"?t.o.redirectClickLoc:t.o.redirectEnterLoc,i=="same"?location.href=n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href"):h(n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href")),t.hideLoader(),t.hideResults(),!1},doRedirectToResults:function(t){var r=this,s=r.ktype=="click"?r.o.redirectClickTo:r.o.redirectEnterTo,e=t=="click"?r.o.redirectClickLoc:r.o.redirectEnterLoc;if(s=="results_page")var o="?s="+u(r.n.text.val());else if(s=="woo_results_page")var o="?post_type=product&s="+u(r.n.text.val());else var o=r.o.redirect_url.replace("{phrase}",u(r.n.text.val()));if(r.o.overridewpdefault)if(r.o.override_method=="post")f(r.o.homeurl+o,"post",{asl_active:1,p_asl_data:n("form",r.n.searchsettings).serialize()},e);else{var c=r.o.homeurl+o+"&asl_active=1&p_asid="+r.o.id+"&p_asl_data="+i.encode(n("form",r.n.searchsettings).serialize());e=="same"?location.href=c:h(c)}else f(r.o.homeurl+o,"post",{np_asl_data:n("form",r.n.searchsettings).serialize()},e);r.n.proloading.css("display","none");r.hideLoader();r.hideResults();r.post!=null&&r.post.abort()},destroy:function(){return this.each(function(){var t=n.extend({},this,s);n(window).unbind(t)})},searchfor:function(t){n(".proinput input",this).val(t).trigger("keyup")},initAutocompleteEvent:function(){var t=this;t.o.autocomplete.enabled!=1||r()||t.n.text.keyup(function(i){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):i&&(t.keycode=i.which,t.ktype=i.type);var r=39;n("body").hasClass("rtl")&&(r=37);t.keycode==r&&t.n.textAutocomplete.val()!=""?(i.preventDefault(),t.n.text.val(t.n.textAutocomplete.val()),t.post!=null&&t.post.abort(),t.search()):(t.postAuto!=null&&t.postAuto.abort(),t.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var t=this,i=t.n.text.val();if(t.n.text.val()==""){t.n.textAutocomplete.val("");return}var r=t.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(t.n.textAutocomplete.val(""),n.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:t.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=n("<textarea />").html(response).text(),response=response.substr(i.length),t.n.textAutocomplete.val(i+response))}}))},search:function(){var t=this;if((!t.searching||!0)&&!(t.n.text.val().length<t.o.charcount)){t.searching=!0;t.n.proloading.css({display:"block"});t.n.proclose.css({display:"none"});var r={action:"ajaxsearchlite_search",aslp:t.n.text.val(),asid:t.o.id,options:n("form",t.n.searchsettings).serialize()};if(JSON.stringify(r)===JSON.stringify(t.lastSearchData))return(t.resultsOpened||t.showResults(),t.hideLoader(),t.isRedirectToFirstResult())?(t.doRedirectToFirstResult(),!1):!1;t.gaEvent("search_start");t.post=n.post(ASL.ajaxurl,r,function(e){if(e=e.replace(/^\s*[\r\n]/gm,""),e=e.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1],t.n.resdrg.html(""),t.n.resdrg.html(e),n(".asl_keyword",t.n.resdrg).bind("click",function(){t.n.text.val(n(this).html());n("input.orig",t.n.container).val(n(this).html()).keydown();n("form",t.n.container).trigger("submit","ajax");t.search()}),t.n.items=n(".item",t.n.resultsDiv),t.gaEvent("search_end",{results_count:t.n.items.length}),t.gaPageview(t.n.text.val()),t.isRedirectToFirstResult())return t.doRedirectToFirstResult(),!1;if(t.hideLoader(),t.showResults(),t.scrollToResults(),t.lastSuccesfulSearch=n("form",t.n.searchsettings).serialize()+t.n.text.val().trim(),t.lastSearchData=r,t.n.items.length==0)t.n.showmore!=null&&t.n.showmore.css("display","none");else if(t.n.showmore!=null){t.n.showmore.css("display","block");n("a",t.n.showmore).off();n("a",t.n.showmore).on("click",function(){var e=t.o.redirectClickTo,r="?s="+u(t.n.text.val());r=e=="results_page"?"?s="+u(t.n.text.val()):e=="woo_results_page"?"?post_type=product&s="+u(t.n.text.val()):t.o.redirect_url.replace("{phrase}",u(t.n.text.val()));t.o.overridewpdefault?t.o.override_method=="post"?f(t.o.homeurl+r,"post",{asl_active:1,p_asl_data:n("form",t.n.searchsettings).serialize()}):location.href=t.o.homeurl+r+"&asl_active=1&p_asid="+t.o.id+"&p_asl_data="+i.encode(n("form",t.n.searchsettings).serialize()):f(t.o.homeurl+r,"post",{np_asl_data:n("form",t.n.searchsettings).serialize()})})}},"text").fail(function(i,r){i.aborted||r=="abort"||(t.n.resdrg.html(""),t.n.resdrg.html('<div class="asl_nores">The request failed. Please check your connection! Status: '+i.status+"<\/div>"),t.n.items=n(".item",t.n.resultsDiv),t.hideLoader(),t.showResults(),t.scrollToResults())})}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.fixResultsPosition(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;n.createVerticalScroll();switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));n.is_scroll&&typeof n.scroll.recalculate!="undefined"&&setTimeout(function(){n.scroll.recalculate()},500);n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});r()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var t=$this.n.probox.offset().top-20;else var t=$this.n.resultsDiv.offset().top-20;n("#wpadminbar").length>0&&(t-=n("#wpadminbar").height());t=t<0?0:t;n("body, html").animate({scrollTop:t},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var t=this;if(t.showResultsBox(),t.n.items.length>0){var e=t.n.items.length<t.o.itemscount?t.n.items.length:t.o.itemscount,h=n(".group",t.n.resultsDiv);if(t.n.items.length<=t.o.itemscount)t.n.results.css({height:"auto"});else{t.n.results.css({height:30});t.resize();var i=0,r=0,u=0,f=0;t.n.items.each(function(){r+=n(this).outerHeight(!0);n(this).outerHeight(!0)>f&&(f=n(this).outerHeight(!0));i++});u=f*e;u>r&&(u=r);i=i<1?1:i;r=r/i*e;t.n.results.css({height:u})}if(t.resize(),t.n.items.last().addClass("asl_last_item"),t.o.highlight==1){var o=t.o.highlightwholewords==1?!0:!1;n("div.item",t.n.resultsDiv).highlight(t.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:o})}}t.resize();t.n.items.length==0&&t.n.results.css({height:"auto"});t.n.results.css({overflowY:"auto"});var s=t.is_scroll?n(t.scroll.getScrollElement()):t.n.results;s.scrollTop(0);t.addAnimation();t.fixResultsPosition(!0);t.searching=!1},addAnimation:function(){var i=this,t=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){n(u).addClass(i.animation)},t);t=t+60;r++})},removeAnimation:function(){var t=this;t.n.items.each(function(){var i=this;n(i).removeClass(t.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var t=this;t.n.searchsettings.css(t.settAnim.showCSS);t.n.searchsettings.removeClass(t.settAnim.hideClass).addClass(t.settAnim.showClass);t.settScroll==null&&t.is_scroll&&(t.settScroll=[],n(".asl_sett_scroll",t.n.searchsettings).each(function(i){var r=this;setTimeout(function(){t.settScroll[i]=new asl_SimpleBar(n(r).get(0),{direction:n("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0})},20)}));t.n.prosettings.data("opened",1);t.fixSettingsPosition(!0)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var t=this;n(".searchsettings",t.n.container).length>0&&(n("body>#ajaxsearchlitesettings"+t.o.rid).remove(),n("body>#ajaxsearchliteres"+t.o.rid).remove())},orientationChange:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},resize:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},scrolling:function(n){var t=this;t.fixSettingsPosition(n);t.fixResultsPosition(n)},fixTryThisPosition:function(){},fixResultsPosition:function(t){t=typeof t=="undefined"?!1:t;var i=this,f=i.n.resultsDiv.css("position");if(f=="fixed"||f=="absolute"){var o=0;if(n("body").css("position")!="static"&&(o=n("body").offset().top),t==!0||i.n.resultsDiv.css("visibility")=="visible"){var s=0,h=0,u=i.n.container.offset();if(f=="fixed"&&(o=0,s=n(document).scrollTop(),h=n(document).scrollLeft(),r()&&e()&&i.n.text.is(":focus")&&(s=i.savedScrollTop,u.top=i.savedContainerTop)),typeof u!="undefined"){var c=i.n.container.outerWidth()<240?240:i.n.container.outerWidth();i.n.resultsDiv.outerWidth(c);i.n.resultsDiv.css({top:u.top+i.n.container.outerHeight(!0)+10-o-s,left:u.left-h})}}}},fixSettingsPosition:function(t){t=typeof t=="undefined"?!1:t;var i=this,s=0;if(n("body").css("position")!="static"&&(s=n("body").offset().top),(t==!0||i.n.prosettings.data("opened")!=0)&&i.o.blocking!=!0){if(i.fixSettingsWidth(),i.n.prosettings.css("display")!="none")var f=i.n.prosettings;else var f=i.n.promagnifier;var u=f.offset(),o=0,h=0;i.n.searchsettings.css("position")=="fixed"&&(o=n(window).scrollTop(),h=n(window).scrollLeft(),r()&&e()&&i.n.text.is(":focus")&&(u.top=i.savedContainerTop,o=i.savedScrollTop));i.o.settingsimagepos=="left"?i.n.searchsettings.css({display:"block",top:u.top+f.height()-2-s-o,left:u.left-h}):i.n.searchsettings.css({display:"block",top:u.top+f.height()-2-s-o,left:u.left+f.width()-i.n.searchsettings.width()-h})}},fixSettingsWidth:function(){}};function l(){return!("ontouchstart"in window)?0:1}function r(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function o(t,i){var r=t.find(":input").get();return arguments.length===1?(i={},n.each(r,function(){!this.name||this.disabled||!(this.checked||/select|textarea/i.test(this.nodeName)||/text/i.test(this.type))||n(this).hasClass("asp_datepicker_field")||n(this).hasClass("asp_datepicker")||(i[this.name]==undefined&&(i[this.name]=[]),i[this.name].push(n(this).val()))}),JSON.stringify(i)):(typeof i!="object"&&(i=JSON.parse(i)),n.each(r,function(){if(this.name&&i[this.name]){var t=i[this.name],r=n(this);if(Object.prototype.toString.call(t)!=="[object Array]"&&(t=[t]),this.type=="checkbox"||this.type=="radio"){for(var e=r.val(),f=!1,u=0;u<t.length;u++)if(t[u]==e){f=!0;break}r.attr("checked",f)}else r.val(t[0])}}),t)}function u(n){return encodeURIComponent(n).replace(/\%20/g,"+")}function f(t,i,r,u){"use strict";var f;f=n("<form />",{action:t,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&n.each(r,function(t,i){n("<input />",{type:"hidden",name:t,value:i}).appendTo(f)});typeof u!="undefined"&&u=="new"&&f.attr("target","_blank");f.appendTo("body").submit()}function h(t){n('<a href="'+t+'" target="_blank">').get(0).click()}function e(){return typeof navigator!="undefined"&&typeof window.navigator.userAgent!="undefined"?window.navigator.userAgent.match(/(iPod|iPhone|iPad)/)!=null:!1}function a(){var n=window.navigator.userAgent,t=n.indexOf("MSIE ");return t>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});n.plugin=function(t,i){n.fn[t]=function(r){return this.each(function(){n.data(this,t)||n.data(this,t,Object.create(i).init(r,this))})}};n.plugin("ajaxsearchlite",s);var i={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(n){var e="",o,t,r,h,c,s,u,f=0;for(n=i._utf8_encode(n);f<n.length;)o=n.charCodeAt(f++),t=n.charCodeAt(f++),r=n.charCodeAt(f++),h=o>>2,c=(o&3)<<4|t>>4,s=(t&15)<<2|r>>6,u=r&63,isNaN(t)?s=u=64:isNaN(r)&&(u=64),e=e+this._keyStr.charAt(h)+this._keyStr.charAt(c)+this._keyStr.charAt(s)+this._keyStr.charAt(u);return e},decode:function(n){var t="",o,s,h,c,f,u,e,r=0;for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");r<n.length;)c=this._keyStr.indexOf(n.charAt(r++)),f=this._keyStr.indexOf(n.charAt(r++)),u=this._keyStr.indexOf(n.charAt(r++)),e=this._keyStr.indexOf(n.charAt(r++)),o=c<<2|f>>4,s=(f&15)<<4|u>>2,h=(u&3)<<6|e,t=t+String.fromCharCode(o),u!=64&&(t=t+String.fromCharCode(s)),e!=64&&(t=t+String.fromCharCode(h));return i._utf8_decode(t)},_utf8_encode:function(n){n=n.replace(/\r\n/g,"\n");for(var i="",r=0;r<n.length;r++){var t=n.charCodeAt(r);t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128))}return i},_utf8_decode:function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}}})(jQuery);window.ASL=window.ASL||{};window.ASL.getScope=function(){if(typeof jQuery!="undefined")if(typeof jQuery.fn.ajaxsearchlite=="undefined")for(var n=jQuery,t=jQuery,i=0;i<10;i++)if(typeof n.fn.ajaxsearchlite=="undefined")n=jQuery.noConflict(!0);else return n.fn.jquery!=t.fn.jquery&&(window.jQuery=window.$=t),n;else return jQuery;return typeof window[ASL.js_scope]!="undefined"?window[ASL.js_scope]:eval(ASL.js_scope)};window.ASL.initialized=!1;window.ASL.initialize=function(n){var i=this;if(typeof i.getScope=="undefined")return!1;var t=i.getScope(),r=".asl_init_data";if(typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0)t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))});else{typeof n!="undefined"&&(r="div[id*=asl_init_id_"+n+"]");function u(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}function f(n){var t="",s,h,c,l,e,r,o,i=0,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)l=f.indexOf(n.charAt(i++)),e=f.indexOf(n.charAt(i++)),r=f.indexOf(n.charAt(i++)),o=f.indexOf(n.charAt(i++)),s=l<<2|e>>4,h=(e&15)<<4|r>>2,c=(r&3)<<6|o,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(h)),o!=64&&(t=t+String.fromCharCode(c));return u(t)}t(r).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).data("asldata");if(typeof n=="undefined"||(n=f(n),typeof n=="undefined"||n==""))return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).addClass("hasASL"),t("#ajaxsearchlite"+i).ajaxsearchlite(r)})}i.initialized=!0};window.ASL.fixClones=function(){var t=this;if((t.fix_duplicates=t.fix_duplicates||0,t.fix_duplicates==0)||typeof t.getScope=="undefined")return!1;var n=t.getScope(),i={};n(".asl_init_data").each(function(){var t=n(this).attr("id").match(/^asl_init_id_(.*)/)[1];typeof i[t]=="undefined"?i[t]={rid:t,id:t,count:1}:i[t].count++});n.each(i,function(i,r){r.count>1&&n(".asl_m_"+r.rid).each(function(i){if(i==0)return!0;for(var f=n(this).parent(),u=r.id;n("#ajaxsearchlite"+u).length!=0;)u++;n(this).attr("id","ajaxsearchlite"+u);n(this).removeClass("asl_m_"+r.rid).addClass("asl_m_"+u);n(this).removeClass("hasASL");n(".asl_r_"+r.rid,this).length==0&&n(".asl_r_"+r.rid).clone().appendTo(n(this));n(".asl_r_"+r.rid,this).attr("id","ajaxsearchliteres"+u);n(".asl_r_"+r.rid,this).attr("data-id",u);n(".asl_r_"+r.rid,this).removeClass("asl_r_"+r.rid).addClass("asl_r_"+u);typeof ASL.resHTML!="undefined"&&n("#ajaxsearchliteres"+u).html(ASL.resHTML);n(".asl_s_"+r.rid,this).length==0&&n(".asl_s_"+r.rid).length!=0&&n(".asl_s_"+r.rid).clone().appendTo(n(this));n(".asl_sb_"+r.rid,this).length==0&&n(".asl_sb_"+r.rid).length!=0&&n(".asl_sb_"+r.rid).clone().appendTo(n(this));n(".asl_s_"+r.rid,this).attr("id","ajaxsearchlitesettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitesettings"+u).html(ASL.setHTML);n(".asl_sb_"+r.rid,f).attr("id","ajaxsearchlitebsettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitebsettings"+u).html(ASL.setHTML);n(".asl_hidden_data",f).length>0&&n(".asl_hidden_data",f).attr("id","asl_hidden_data_"+u);n(".asl_init_data",f).length>0&&n(".asl_init_data",f).attr("id","asl_init_id_"+u);t.initialize(u)})})};window.ASL.ready=function(){var t=this,i=t.getScope(),r=null;i(document).ready(function(){t.initialize();setTimeout(function(){t.fixClones()},2500)});i(window).on("load",function(){t.initialized||(t.initialize(),setTimeout(function(){t.fixClones()},2500),console.log("ASL initialized via window.load"))});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&i("body").bind("DOMSubtreeModified",function(){clearTimeout(r);r=setTimeout(function(){t.initialize()},500)});var u;i(window).on("resize",function(){clearTimeout(u);u=setTimeout(function(){t.fixClones()},2e3)});var f,n="#menu-item-search, .fa-search, .fa, .fas";n=n+", .fusion-flyout-menu-toggle, .fusion-main-menu-search-open";n=n+", #search_button";n=n+", .mini-search.popup-search";n=n+", .icon-search";n=n+", .menu-item-search-dropdown";n=n+", .mobile-menu-button";n=n+", .td-icon-search, .tdb-search-icon";n=n+", .side_menu_button, .search_button";n=n+", .raven-search-form-toggle";n=n+", [data-elementor-open-lightbox], .elementor-button-link, .elementor-button";i(function(){i("body").on("click touchend",n,function(){clearTimeout(f);f=setTimeout(function(){t.initialize()},500)})})};window._ASL=ASL;window._ASL.ready();
1
+ jQuery.extend({highlight:function(n,t,i,r,u){if(u=u==""?".exhghttt":u,n.nodeType===3){var h=n.data.normalize("NFD").replace(/[\u0300-\u036f]/g,""),f=h.match(t);if(f){var s=document.createElement(i||"span");if(s.className=r||"highlight",/\.|,|\s/.test(f[0].charAt(0)))var c=f.index+1;else var c=f.index;var e=n.splitText(c);e.splitText(f[1].length);var l=e.cloneNode(!0);return s.appendChild(l),e.parentNode.replaceChild(s,e),1}}else if(n.nodeType===1&&n.childNodes&&!/(script|style)/i.test(n.tagName)&&!jQuery(n).closest(u).length>0&&!(n.tagName===i.toUpperCase()&&n.className===r))for(var o=0;o<n.childNodes.length;o++)o+=jQuery.highlight(n.childNodes[o],t,i,r,u);return 0}});jQuery.fn.unhighlight=function(n){var t={className:"highlight",element:"span"};return jQuery.extend(t,n),this.find(t.element+"."+t.className).each(function(){var n=this.parentNode;n.replaceChild(this.firstChild,this);n.normalize()}).end()};jQuery.fn.highlight=function(n,t){var i={className:"highlight",element:"span",caseSensitive:!1,wordsOnly:!1,excludeParents:""};if(jQuery.extend(i,t),n.constructor===String&&(n=[n]),n=jQuery.grep(n,function(n){return n!=""}),n=jQuery.map(n,function(n){return n.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g,"")}),n.length==0)return this;var u=i.caseSensitive?"":"i",r="("+n.join("|")+")";i.wordsOnly&&(r="(?:,|^|\\s)"+r+"(?:,|$|\\s)");var f=new RegExp(r,u);return this.each(function(){jQuery.highlight(this,f,i.element,i.className,i.excludeParents)})},function(n,t){typeof exports=="object"&&typeof module!="undefined"?module.exports=t():typeof define=="function"&&define.amd?define(t):(n=n||self,n.asl_SimpleBar=t())}(this,function(){"use strict";var f=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function ft(n,t){return t={exports:{}},n(t,t.exports),t.exports}var yt="object",pt=function(n){return n&&n.Math==Math&&n},t=pt(typeof globalThis==yt&&globalThis)||pt(typeof window==yt&&window)||pt(typeof self==yt&&self)||pt(typeof f==yt&&f)||Function("return this")(),u=function(n){try{return!!n()}catch(t){return!0}},a=!u(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),uf={}.propertyIsEnumerable,ff=Object.getOwnPropertyDescriptor,ds=ff&&!uf.call({1:2},1),gs=ds?function(n){var t=ff(this,n);return!!t&&t.enumerable}:uf,ef={f:gs},er=function(n,t){return{enumerable:!(n&1),configurable:!(n&2),writable:!(n&4),value:t}},nh={}.toString,b=function(n){return nh.call(n).slice(8,-1)},th="".split,wt=u(function(){return!Object("z").propertyIsEnumerable(0)})?function(n){return b(n)=="String"?th.call(n,""):Object(n)}:Object,bt=function(n){if(n==undefined)throw TypeError("Can't call method on "+n);return n},kt=function(n){return wt(bt(n))},n=function(n){return typeof n=="object"?n!==null:typeof n=="function"},of=function(t,i){if(!n(t))return t;var r,u;if(i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t))||typeof(r=t.valueOf)=="function"&&!n(u=r.call(t))||!i&&typeof(r=t.toString)=="function"&&!n(u=r.call(t)))return u;throw TypeError("Can't convert object to primitive value");},ih={}.hasOwnProperty,r=function(n,t){return ih.call(n,t)},or=t.document,rh=n(or)&&n(or.createElement),sf=function(n){return rh?or.createElement(n):{}},hf=!a&&!u(function(){return Object.defineProperty(sf("div"),"a",{get:function(){return 7}}).a!=7}),cf=Object.getOwnPropertyDescriptor,uh=a?cf:function(n,t){if(n=kt(n),t=of(t,!0),hf)try{return cf(n,t)}catch(i){}if(r(n,t))return er(!ef.f.call(n,t),n[t])},lf={f:uh},s=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t},af=Object.defineProperty,fh=a?af:function(n,t,i){if(s(n),t=of(t,!0),s(i),hf)try{return af(n,t,i)}catch(r){}if("get"in i||"set"in i)throw TypeError("Accessors not supported");return"value"in i&&(n[t]=i.value),n},k={f:fh},o=a?function(n,t,i){return k.f(n,t,er(1,i))}:function(n,t,i){return n[t]=i,n},sr=function(n,i){try{o(t,n,i)}catch(r){t[n]=i}return i},dt=ft(function(n){var i="__core-js_shared__",r=t[i]||sr(i,{});(n.exports=function(n,t){return r[n]||(r[n]=t!==undefined?t:{})})("versions",[]).push({version:"3.2.1",mode:"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),gt=dt("native-function-to-string",Function.toString),vf=t.WeakMap,yf=typeof vf=="function"&&/native code/.test(gt.call(vf)),eh=0,oh=Math.random(),hr=function(n){return"Symbol("+String(n===undefined?"":n)+")_"+(++eh+oh).toString(36)},pf=dt("keys"),cr=function(n){return pf[n]||(pf[n]=hr(n))},ni={},sh=t.WeakMap,ti,et,ii,hh=function(n){return ii(n)?et(n):ti(n,{})},ch=function(t){return function(i){var r;if(!n(i)||(r=et(i)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}};if(yf){var d=new sh,lh=d.get,ah=d.has,vh=d.set;ti=function(n,t){return vh.call(d,n,t),t};et=function(n){return lh.call(d,n)||{}};ii=function(n){return ah.call(d,n)}}else{var ot=cr("state");ni[ot]=!0;ti=function(n,t){return o(n,ot,t),t};et=function(n){return r(n,ot)?n[ot]:{}};ii=function(n){return r(n,ot)}}var h={set:ti,get:et,has:ii,enforce:hh,getterFor:ch},st=ft(function(n){var i=h.get,u=h.enforce,f=String(gt).split("toString");dt("inspectSource",function(n){return gt.call(n)});(n.exports=function(n,i,e,s){var c=s?!!s.unsafe:!1,h=s?!!s.enumerable:!1,l=s?!!s.noTargetGet:!1;if(typeof e=="function"&&(typeof i!="string"||r(e,"name")||o(e,"name",i),u(e).source=f.join(typeof i=="string"?i:"")),n===t){h?n[i]=e:sr(i,e);return}c?!l&&n[i]&&(h=!0):delete n[i];h?n[i]=e:o(n,i,e)})(Function.prototype,"toString",function(){return typeof this=="function"&&i(this).source||gt.call(this)})}),lr=t,wf=function(n){return typeof n=="function"?n:undefined},bf=function(n,i){return arguments.length<2?wf(lr[n])||wf(t[n]):lr[n]&&lr[n][i]||t[n]&&t[n][i]},yh=Math.ceil,ph=Math.floor,ar=function(n){return isNaN(n=+n)?0:(n>0?ph:yh)(n)},wh=Math.min,ri=function(n){return n>0?wh(ar(n),9007199254740991):0},bh=Math.max,kh=Math.min,dh=function(n,t){var i=ar(n);return i<0?bh(i+t,0):kh(i,t)},kf=function(n){return function(t,i,r){var f=kt(t),e=ri(f.length),u=dh(r,e),o;if(n&&i!=i){while(e>u)if(o=f[u++],o!=o)return!0}else for(;e>u;u++)if((n||u in f)&&f[u]===i)return n||u||0;return!n&&-1}},gh={includes:kf(!0),indexOf:kf(!1)},nc=gh.indexOf,df=function(n,t){var f=kt(n),e=0,u=[];for(var i in f)!r(ni,i)&&r(f,i)&&u.push(i);while(t.length>e)r(f,i=t[e++])&&(~nc(u,i)||u.push(i));return u},ui=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],tc=ui.concat("length","prototype"),ic=Object.getOwnPropertyNames||function(n){return df(n,tc)},rc={f:ic},uc=Object.getOwnPropertySymbols,gf={f:uc},fc=bf("Reflect","ownKeys")||function(n){var t=rc.f(s(n)),i=gf.f;return i?t.concat(i(n)):t},ec=function(n,t){for(var f=fc(t),e=k.f,o=lf.f,i=0;i<f.length;i++){var u=f[i];r(n,u)||e(n,u,o(t,u))}},oc=/#|\.prototype\./,ht=function(n,t){var i=hc[sc(n)];return i==lc?!0:i==cc?!1:typeof t=="function"?u(t):!!t},sc=ht.normalize=function(n){return String(n).replace(oc,".").toLowerCase()},hc=ht.data={},cc=ht.NATIVE="N",lc=ht.POLYFILL="P",vr=ht,ac=lf.f,l=function(n,i){var s=n.target,c=n.global,l=n.stat,a,f,r,u,e,h;if(f=c?t:l?t[s]||sr(s,{}):(t[s]||{}).prototype,f)for(r in i){if(e=i[r],n.noTargetGet?(h=ac(f,r),u=h&&h.value):u=f[r],a=vr(c?r:s+(l?".":"#")+r,n.forced),!a&&u!==undefined){if(typeof e==typeof u)continue;ec(e,u)}(n.sham||u&&u.sham)&&o(e,"sham",!0);st(f,r,e,n)}},ne=function(n){if(typeof n!="function")throw TypeError(String(n)+" is not a function");return n},te=function(n,t,i){if(ne(n),t===undefined)return n;switch(i){case 0:return function(){return n.call(t)};case 1:return function(i){return n.call(t,i)};case 2:return function(i,r){return n.call(t,i,r)};case 3:return function(i,r,u){return n.call(t,i,r,u)}}return function(){return n.apply(t,arguments)}},fi=function(n){return Object(bt(n))},ie=Array.isArray||function(n){return b(n)=="Array"},re=!!Object.getOwnPropertySymbols&&!u(function(){return!String(Symbol())}),ue=t.Symbol,fe=dt("wks"),e=function(n){return fe[n]||(fe[n]=re&&ue[n]||(re?ue:hr)("Symbol."+n))},vc=e("species"),yc=function(t,i){var r;return ie(t)&&(r=t.constructor,typeof r=="function"&&(r===Array||ie(r.prototype))?r=undefined:n(r)&&(r=r[vc],r===null&&(r=undefined))),new(r===undefined?Array:r)(i===0?0:i)},pc=[].push,v=function(n){var i=n==1,u=n==2,f=n==3,t=n==4,r=n==6,e=n==5||r;return function(o,s,h,c){for(var w=fi(o),v=wt(w),d=te(s,h,3),b=ri(v.length),l=0,k=c||yc,y=i?k(o,b):u?k(o,0):undefined,a,p;b>l;l++)if((e||l in v)&&(a=v[l],p=d(a,l,w),n))if(i)y[l]=p;else if(p)switch(n){case 3:return!0;case 5:return a;case 6:return l;case 2:pc.call(y,a)}else if(t)return!1;return r?-1:f||t?t:y}},ei={forEach:v(0),map:v(1),filter:v(2),some:v(3),every:v(4),find:v(5),findIndex:v(6)},ee=function(n,t){var i=[][n];return!i||!u(function(){i.call(null,t||function(){throw 1;},1)})},wc=ei.forEach,ct=ee("forEach")?function(n){return wc(this,n,arguments.length>1?arguments[1]:undefined)}:[].forEach;l({target:"Array",proto:!0,forced:[].forEach!=ct},{forEach:ct});var yr={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0};for(var bc in yr){var oe=t[bc],oi=oe&&oe.prototype;if(oi&&oi.forEach!==ct)try{o(oi,"forEach",ct)}catch(bb){oi.forEach=ct}}var kc=!!(typeof window!="undefined"&&window.document&&window.document.createElement),pr=kc,dc=e("species"),gc=function(n){return!u(function(){var t=[],i=t.constructor={};return i[dc]=function(){return{foo:1}},t[n](Boolean).foo!==1})},nl=ei.filter;l({target:"Array",proto:!0,forced:!gc("filter")},{filter:function(n){return nl(this,n,arguments.length>1?arguments[1]:undefined)}});var si=Object.keys||function(n){return df(n,ui)},tl=a?Object.defineProperties:function(n,t){s(n);for(var i=si(t),f=i.length,r=0,u;f>r;)k.f(n,u=i[r++],t[u]);return n},il=bf("document","documentElement"),se=cr("IE_PROTO"),wr="prototype",br=function(){},hi=function(){var t=sf("iframe"),r=ui.length,u="<",i="script",f=">",e="java"+i+":",n;for(t.style.display="none",il.appendChild(t),t.src=String(e),n=t.contentWindow.document,n.open(),n.write(u+i+f+"document.F=Object"+u+"/"+i+f),n.close(),hi=n.F;r--;)delete hi[wr][ui[r]];return hi()},he=Object.create||function(n,t){var i;return n!==null?(br[wr]=s(n),i=new br,br[wr]=null,i[se]=n):i=hi(),t===undefined?i:tl(i,t)};ni[se]=!0;var kr=e("unscopables"),dr=Array.prototype;dr[kr]==undefined&&o(dr,kr,he(null));var gr=function(n){dr[kr][n]=!0},g={},rl=!u(function(){function n(){}return n.prototype.constructor=null,Object.getPrototypeOf(new n)!==n.prototype}),ce=cr("IE_PROTO"),ul=Object.prototype,ci=rl?Object.getPrototypeOf:function(n){return(n=fi(n),r(n,ce))?n[ce]:typeof n.constructor=="function"&&n instanceof n.constructor?n.constructor.prototype:n instanceof Object?ul:null},le=e("iterator"),ae=!1,fl=function(){return this},nt,nu,tu;[].keys&&(tu=[].keys(),"next"in tu?(nu=ci(ci(tu)),nu!==Object.prototype&&(nt=nu)):ae=!0);nt==undefined&&(nt={});r(nt,le)||o(nt,le,fl);var iu={IteratorPrototype:nt,BUGGY_SAFARI_ITERATORS:ae},el=k.f,ve=e("toStringTag"),ru=function(n,t,i){n&&!r(n=i?n:n.prototype,ve)&&el(n,ve,{configurable:!0,value:t})},ol=iu.IteratorPrototype,sl=function(){return this},hl=function(n,t,i){var r=t+" Iterator";return n.prototype=he(ol,{next:er(1,i)}),ru(n,r,!1),g[r]=sl,n},cl=function(t){if(!n(t)&&t!==null)throw TypeError("Can't set "+String(t)+" as a prototype");return t},li=Object.setPrototypeOf||("__proto__"in{}?function(){var t=!1,i={},n;try{n=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set;n.call(i,[]);t=i instanceof Array}catch(r){}return function(i,r){return s(i),cl(r),t?n.call(i,r):i.__proto__=r,i}}():undefined),uu=iu.IteratorPrototype,ai=iu.BUGGY_SAFARI_ITERATORS,lt=e("iterator"),ye="keys",vi="values",pe="entries",ll=function(){return this},we=function(n,t,i,r,u,f,e){hl(i,t,r);var y=function(n){if(n===u&&h)return h;if(!ai&&n in s)return s[n];switch(n){case ye:return function(){return new i(this,n)};case vi:return function(){return new i(this,n)};case pe:return function(){return new i(this,n)}}return function(){return new i(this)}},k=t+" Iterator",w=!1,s=n.prototype,a=s[lt]||s["@@iterator"]||u&&s[u],h=!ai&&a||y(u),b=t=="Array"?s.entries||a:a,c,v,p;if(b&&(c=ci(b.call(new n)),uu!==Object.prototype&&c.next&&(ci(c)!==uu&&(li?li(c,uu):typeof c[lt]!="function"&&o(c,lt,ll)),ru(c,k,!0))),u==vi&&a&&a.name!==vi&&(w=!0,h=function(){return a.call(this)}),s[lt]!==h&&o(s,lt,h),g[t]=h,u)if(v={values:y(vi),keys:f?h:y(ye),entries:y(pe)},e)for(p in v)!ai&&!w&&p in s||st(s,p,v[p]);else l({target:t,proto:!0,forced:ai||w},v);return v},be="Array Iterator",al=h.set,vl=h.getterFor(be),at=we(Array,"Array",function(n,t){al(this,{type:be,target:kt(n),index:0,kind:t})},function(){var t=vl(this),i=t.target,r=t.kind,n=t.index++;return!i||n>=i.length?(t.target=undefined,{value:undefined,done:!0}):r=="keys"?{value:n,done:!1}:r=="values"?{value:i[n],done:!1}:{value:[n,i[n]],done:!1}},"values");g.Arguments=g.Array;gr("keys");gr("values");gr("entries");var yi=Object.assign,ke=!yi||u(function(){var n={},t={},i=Symbol(),r="abcdefghijklmnopqrst";return n[i]=7,r.split("").forEach(function(n){t[n]=n}),yi({},n)[i]!=7||si(yi({},t)).join("")!=r})?function(n){for(var r=fi(n),s=arguments.length,u=1,f=gf.f,h=ef.f;s>u;)for(var t=wt(arguments[u++]),e=f?si(t).concat(f(t)):si(t),c=e.length,o=0,i;c>o;)i=e[o++],(!a||h.call(t,i))&&(r[i]=t[i]);return r}:yi;l({target:"Object",stat:!0,forced:Object.assign!==ke},{assign:ke});var yl=e("toStringTag"),pl=b(function(){return arguments}())=="Arguments",wl=function(n,t){try{return n[t]}catch(i){}},de=function(n){var t,i,r;return n===undefined?"Undefined":n===null?"Null":typeof(i=wl(t=Object(n),yl))=="string"?i:pl?b(t):(r=b(t))=="Object"&&typeof t.callee=="function"?"Arguments":r},bl=e("toStringTag"),fu={};fu[bl]="z";var ge=String(fu)!=="[object z]"?function(){return"[object "+de(this)+"]"}:fu.toString,no=Object.prototype;ge!==no.toString&&st(no,"toString",ge,{unsafe:!0});var eu="\t\n\x0b\f\r                 \u2028\u2029",pi="["+eu+"]",kl=RegExp("^"+pi+pi+"*"),dl=RegExp(pi+pi+"*$"),ou=function(n){return function(t){var i=String(bt(t));return n&1&&(i=i.replace(kl,"")),n&2&&(i=i.replace(dl,"")),i}},gl={start:ou(1),end:ou(2),trim:ou(3)},na=gl.trim,wi=t.parseInt,ta=/^[+-]?0[Xx]/,ia=wi(eu+"08")!==8||wi(eu+"0x16")!==22,to=ia?function(n,t){var i=na(String(n));return wi(i,t>>>0||(ta.test(i)?16:10))}:wi;l({global:!0,forced:parseInt!=to},{parseInt:to});var io=function(n){return function(t,i){var u=String(bt(t)),r=ar(i),o=u.length,f,e;return r<0||r>=o?n?"":undefined:(f=u.charCodeAt(r),f<55296||f>56319||r+1===o||(e=u.charCodeAt(r+1))<56320||e>57343?n?u.charAt(r):f:n?u.slice(r,r+2):(f-55296<<10)+(e-56320)+65536)}},ro={codeAt:io(!1),charAt:io(!0)},ra=ro.charAt,uo="String Iterator",ua=h.set,fa=h.getterFor(uo);we(String,"String",function(n){ua(this,{type:uo,string:String(n),index:0})},function(){var n=fa(this),i=n.string,r=n.index,t;return r>=i.length?{value:undefined,done:!0}:(t=ra(i,r),n.index+=t.length,{value:t,done:!1})});var su=function(n,t,i){for(var r in t)st(n,r,t[r],i);return n},ea=!u(function(){return Object.isExtensible(Object.preventExtensions({}))}),y=ft(function(t){var e=k.f,i=hr("meta"),o=0,u=Object.isExtensible||function(){return!0},f=function(n){e(n,i,{value:{objectID:"O"+ ++o,weakData:{}}})},s=function(t,e){if(!n(t))return typeof t=="symbol"?t:(typeof t=="string"?"S":"P")+t;if(!r(t,i)){if(!u(t))return"F";if(!e)return"E";f(t)}return t[i].objectID},h=function(n,t){if(!r(n,i)){if(!u(n))return!0;if(!t)return!1;f(n)}return n[i].weakData},c=function(n){return ea&&l.REQUIRED&&u(n)&&!r(n,i)&&f(n),n},l=t.exports={REQUIRED:!1,fastKey:s,getWeakData:h,onFreeze:c};ni[i]=!0}),ik=y.REQUIRED,rk=y.fastKey,uk=y.getWeakData,fk=y.onFreeze,oa=e("iterator"),sa=Array.prototype,ha=function(n){return n!==undefined&&(g.Array===n||sa[oa]===n)},ca=e("iterator"),la=function(n){if(n!=undefined)return n[ca]||n["@@iterator"]||g[de(n)]},aa=function(n,t,i,r){try{return r?t(s(i)[0],i[1]):t(i)}catch(f){var u=n["return"];u!==undefined&&s(u.call(n));throw f;}},fo=ft(function(n){var t=function(n,t){this.stopped=n;this.result=t},i=n.exports=function(n,i,r,u,f){var a=te(i,r,u?2:1),h,c,o,v,e,l;if(f)h=n;else{if(c=la(n),typeof c!="function")throw TypeError("Target is not iterable");if(ha(c)){for(o=0,v=ri(n.length);v>o;o++)if(e=u?a(s(l=n[o])[0],l[1]):a(n[o]),e&&e instanceof t)return e;return new t(!1)}h=c.call(n)}while(!(l=h.next()).done)if(e=aa(h,a,l.value,u),e&&e instanceof t)return e;return new t(!1)};i.stop=function(n){return new t(!0,n)}}),eo=function(n,t,i){if(!(n instanceof t))throw TypeError("Incorrect "+(i?i+" ":"")+"invocation");return n},oo=e("iterator"),so=!1;try{var va=0,ho={next:function(){return{done:!!va++}},"return":function(){so=!0}};ho[oo]=function(){return this};Array.from(ho,function(){throw 2;})}catch(bb){}var ya=function(n,t){if(!t&&!so)return!1;var i=!1;try{var r={};r[oo]=function(){return{next:function(){return{done:i=!0}}}};n(r)}catch(u){}return i},pa=function(t,i,r){var u,f;return li&&typeof(u=i.constructor)=="function"&&u!==r&&n(f=u.prototype)&&f!==r.prototype&&li(t,f),t},wa=function(i,r,f,e,o){var h=t[i],c=h&&h.prototype,s=h,a=e?"set":"add",w={},v=function(t){var i=c[t];st(c,t,t=="add"?function(n){return i.call(this,n===0?0:n),this}:t=="delete"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:t=="get"?function(t){return o&&!n(t)?undefined:i.call(this,t===0?0:t)}:t=="has"?function(t){return o&&!n(t)?!1:i.call(this,t===0?0:t)}:function(n,t){return i.call(this,n===0?0:n,t),this})};if(vr(i,typeof h!="function"||!(o||c.forEach&&!u(function(){(new h).entries().next()}))))s=f.getConstructor(r,i,e,a),y.REQUIRED=!0;else if(vr(i,!0)){var p=new s,k=p[a](o?{}:-0,1)!=p,d=u(function(){p.has(1)}),g=ya(function(n){new h(n)}),b=!o&&u(function(){for(var t=new h,n=5;n--;)t[a](n,n);return!t.has(-0)});g||(s=r(function(n,t){eo(n,s,i);var r=pa(new h,n,s);return t!=undefined&&fo(t,r[a],r,e),r}),s.prototype=c,c.constructor=s);(d||b)&&(v("delete"),v("has"),e&&v("get"));(b||k)&&v(a);o&&c.clear&&delete c.clear}return w[i]=s,l({global:!0,forced:s!=h},w),ru(s,i),o||f.setStrong(s,i,e),s},bi=y.getWeakData,ba=h.set,ka=h.getterFor,da=ei.find,ga=ei.findIndex,nv=0,ki=function(n){return n.frozen||(n.frozen=new co)},co=function(){this.entries=[]},hu=function(n,t){return da(n.entries,function(n){return n[0]===t})};co.prototype={get:function(n){var t=hu(this,n);if(t)return t[1]},has:function(n){return!!hu(this,n)},set:function(n,t){var i=hu(this,n);i?i[1]=t:this.entries.push([n,t])},"delete":function(n){var t=ga(this.entries,function(t){return t[0]===n});return~t&&this.entries.splice(t,1),!!~t}};var lo={getConstructor:function(t,i,u,f){var e=t(function(n,t){eo(n,e,i);ba(n,{type:i,id:nv++,frozen:undefined});t!=undefined&&fo(t,n[f],n,u)}),o=ka(i),h=function(n,t,i){var r=o(n),u=bi(s(t),!0);return u===!0?ki(r).set(t,i):u[r.id]=i,n};return su(e.prototype,{"delete":function(t){var u=o(this);if(!n(t))return!1;var i=bi(t);return i===!0?ki(u)["delete"](t):i&&r(i,u.id)&&delete i[u.id]},has:function(t){var u=o(this);if(!n(t))return!1;var i=bi(t);return i===!0?ki(u).has(t):i&&r(i,u.id)}}),su(e.prototype,u?{get:function(t){var r=o(this);if(n(t)){var i=bi(t);return i===!0?ki(r).get(t):i?i[r.id]:undefined}},set:function(n,t){return h(this,n,t)}}:{add:function(n){return h(this,n,!0)}}),e}},ek=ft(function(i){var f=h.enforce,v=!t.ActiveXObject&&"ActiveXObject"in t,e=Object.isExtensible,r,s=function(n){return function(){return n(this,arguments.length?arguments[0]:undefined)}},p=i.exports=wa("WeakMap",s,lo,!0,!0);if(yf&&v){r=lo.getConstructor(s,"WeakMap",!0);y.REQUIRED=!0;var u=p.prototype,c=u["delete"],o=u.has,l=u.get,a=u.set;su(u,{"delete":function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),c.call(this,t)||i.frozen["delete"](t)}return c.call(this,t)},has:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)||i.frozen.has(t)}return o.call(this,t)},get:function(t){if(n(t)&&!e(t)){var i=f(this);return i.frozen||(i.frozen=new r),o.call(this,t)?l.call(this,t):i.frozen.get(t)}return l.call(this,t)},set:function(t,i){if(n(t)&&!e(t)){var u=f(this);u.frozen||(u.frozen=new r);o.call(this,t)?a.call(this,t,i):u.frozen.set(t,i)}else a.call(this,t,i);return this}})}}),cu=e("iterator"),ao=e("toStringTag"),lu=at.values;for(var au in yr){var vo=t[au],c=vo&&vo.prototype;if(c){if(c[cu]!==lu)try{o(c,cu,lu)}catch(bb){c[cu]=lu}if(c[ao]||o(c,ao,au),yr[au])for(var tt in at)if(c[tt]!==at[tt])try{o(c,tt,at[tt])}catch(bb){c[tt]=at[tt]}}}var yo="Expected a function",po=0/0,tv="[object Symbol]",iv=/^\s+|\s+$/g,rv=/^[-+]0x[0-9a-f]+$/i,uv=/^0b[01]+$/i,fv=/^0o[0-7]+$/i,ev=parseInt,ov=typeof f=="object"&&f&&f.Object===Object&&f,sv=typeof self=="object"&&self&&self.Object===Object&&self,hv=ov||sv||Function("return this")(),cv=Object.prototype,lv=cv.toString,av=Math.max,vv=Math.min,vu=function(){return hv.Date.now()};function yv(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(yo);t=wo(t)||0;di(i)&&(p=!!i.leading,h="maxWait"in i,c=h?av(wo(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?vv(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=vu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(vu())}function y(){var n=vu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function pv(n,t,i){var r=!0,u=!0;if(typeof n!="function")throw new TypeError(yo);return di(i)&&(r="leading"in i?!!i.leading:r,u="trailing"in i?!!i.trailing:u),yv(n,t,{leading:r,maxWait:t,trailing:u})}function di(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function wv(n){return!!n&&typeof n=="object"}function bv(n){return typeof n=="symbol"||wv(n)&&lv.call(n)==tv}function wo(n){if(typeof n=="number")return n;if(bv(n))return po;if(di(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=di(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(iv,"");var i=uv.test(n);return i||fv.test(n)?ev(n.slice(2),i?2:8):rv.test(n)?po:+n}var bo=pv,kv="Expected a function",ko=0/0,dv="[object Symbol]",gv=/^\s+|\s+$/g,ny=/^[-+]0x[0-9a-f]+$/i,ty=/^0b[01]+$/i,iy=/^0o[0-7]+$/i,ry=parseInt,uy=typeof f=="object"&&f&&f.Object===Object&&f,fy=typeof self=="object"&&self&&self.Object===Object&&self,ey=uy||fy||Function("return this")(),oy=Object.prototype,sy=oy.toString,hy=Math.max,cy=Math.min,yu=function(){return ey.Date.now()};function ly(n,t,i){var f,o,c,e,r,u,s=0,p=!1,h=!1,a=!0;if(typeof n!="function")throw new TypeError(kv);t=go(t)||0;pu(i)&&(p=!!i.leading,h="maxWait"in i,c=h?hy(go(i.maxWait)||0,t):c,a="trailing"in i?!!i.trailing:a);function v(t){var i=f,r=o;return f=o=undefined,s=t,e=n.apply(r,i)}function k(n){return s=n,r=setTimeout(l,t),p?v(n):e}function d(n){var r=n-u,f=n-s,i=t-r;return h?cy(i,c-f):i}function w(n){var i=n-u,r=n-s;return u===undefined||i>=t||i<0||h&&r>=c}function l(){var n=yu();if(w(n))return b(n);r=setTimeout(l,d(n))}function b(n){return(r=undefined,a&&f)?v(n):(f=o=undefined,e)}function g(){r!==undefined&&clearTimeout(r);s=0;f=u=o=r=undefined}function nt(){return r===undefined?e:b(yu())}function y(){var n=yu(),i=w(n);if(f=arguments,o=this,u=n,i){if(r===undefined)return k(u);if(h)return r=setTimeout(l,t),v(u)}return r===undefined&&(r=setTimeout(l,t)),e}return y.cancel=g,y.flush=nt,y}function pu(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}function ay(n){return!!n&&typeof n=="object"}function vy(n){return typeof n=="symbol"||ay(n)&&sy.call(n)==dv}function go(n){if(typeof n=="number")return n;if(vy(n))return ko;if(pu(n)){var t=typeof n.valueOf=="function"?n.valueOf():n;n=pu(t)?t+"":t}if(typeof n!="string")return n===0?n:+n;n=n.replace(gv,"");var i=ty.test(n);return i||iy.test(n)?ry(n.slice(2),i?2:8):ny.test(n)?ko:+n}var ns=ly,yy="Expected a function",ts="__lodash_hash_undefined__",py="[object Function]",wy="[object GeneratorFunction]",by=/^\[object .+?Constructor\]$/,ky=typeof f=="object"&&f&&f.Object===Object&&f,dy=typeof self=="object"&&self&&self.Object===Object&&self,is=ky||dy||Function("return this")();function gy(n,t){return n==null?undefined:n[t]}function np(n){var t=!1;if(n!=null&&typeof n.toString!="function")try{t=!!(n+"")}catch(i){}return t}var tp=Array.prototype,ip=Function.prototype,rs=Object.prototype,wu=is["__core-js_shared__"],us=function(){var n=/[^.]+$/.exec(wu&&wu.keys&&wu.keys.IE_PROTO||"");return n?"Symbol(src)_1."+n:""}(),fs=ip.toString,bu=rs.hasOwnProperty,rp=rs.toString,up=RegExp("^"+fs.call(bu).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fp=tp.splice,ep=es(is,"Map"),vt=es(Object,"create");function p(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function op(){this.__data__=vt?vt(null):{}}function sp(n){return this.has(n)&&delete this.__data__[n]}function hp(n){var t=this.__data__;if(vt){var i=t[n];return i===ts?undefined:i}return bu.call(t,n)?t[n]:undefined}function cp(n){var t=this.__data__;return vt?t[n]!==undefined:bu.call(t,n)}function lp(n,t){var i=this.__data__;return i[n]=vt&&t===undefined?ts:t,this}p.prototype.clear=op;p.prototype["delete"]=sp;p.prototype.get=hp;p.prototype.has=cp;p.prototype.set=lp;function it(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function ap(){this.__data__=[]}function vp(n){var t=this.__data__,i=gi(t,n);if(i<0)return!1;var r=t.length-1;return i==r?t.pop():fp.call(t,i,1),!0}function yp(n){var t=this.__data__,i=gi(t,n);return i<0?undefined:t[i][1]}function pp(n){return gi(this.__data__,n)>-1}function wp(n,t){var i=this.__data__,r=gi(i,n);return r<0?i.push([n,t]):i[r][1]=t,this}it.prototype.clear=ap;it.prototype["delete"]=vp;it.prototype.get=yp;it.prototype.has=pp;it.prototype.set=wp;function w(n){var t=-1,r=n?n.length:0;for(this.clear();++t<r;){var i=n[t];this.set(i[0],i[1])}}function bp(){this.__data__={hash:new p,map:new(ep||it),string:new p}}function kp(n){return nr(this,n)["delete"](n)}function dp(n){return nr(this,n).get(n)}function gp(n){return nr(this,n).has(n)}function nw(n,t){return nr(this,n).set(n,t),this}w.prototype.clear=bp;w.prototype["delete"]=kp;w.prototype.get=dp;w.prototype.has=gp;w.prototype.set=nw;function gi(n,t){for(var i=n.length;i--;)if(fw(n[i][0],t))return i;return-1}function tw(n){if(!os(n)||rw(n))return!1;var t=ew(n)||np(n)?up:by;return t.test(uw(n))}function nr(n,t){var i=n.__data__;return iw(t)?i[typeof t=="string"?"string":"hash"]:i.map}function es(n,t){var i=gy(n,t);return tw(i)?i:undefined}function iw(n){var t=typeof n;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?n!=="__proto__":n===null}function rw(n){return!!us&&us in n}function uw(n){if(n!=null){try{return fs.call(n)}catch(t){}try{return n+""}catch(t){}}return""}function ku(n,t){if(typeof n!="function"||t&&typeof t!="function")throw new TypeError(yy);var i=function(){var r=arguments,u=t?t.apply(this,r):r[0],f=i.cache;if(f.has(u))return f.get(u);var e=n.apply(this,r);return i.cache=f.set(u,e),e};return i.cache=new(ku.Cache||w),i}ku.Cache=w;function fw(n,t){return n===t||n!==n&&t!==t}function ew(n){var t=os(n)?rp.call(n):"";return t==py||t==wy}function os(n){var t=typeof n;return!!n&&(t=="object"||t=="function")}var ow=ku,ss=function(){function n(n,t){var i=-1;return n.some(function(n,r){return n[0]===t?(i=r,!0):!1}),i}return typeof Map!="undefined"?Map:function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var r=n(this.__entries__,t),i=this.__entries__[r];return i&&i[1]},t.prototype.set=function(t,i){var r=n(this.__entries__,t);~r?this.__entries__[r][1]=i:this.__entries__.push([t,i])},t.prototype.delete=function(t){var i=this.__entries__,r=n(i,t);~r&&i.splice(r,1)},t.prototype.has=function(t){return!!~n(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,t){t===void 0&&(t=null);for(var i=0,r=this.__entries__;i<r.length;i++){var u=r[i];n.call(t,u[1],u[0])}},t}()}(),du=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,tr=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),sw=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(tr):function(n){return setTimeout(function(){return n(Date.now())},1e3/60)}}(),hw=2;function cw(n,t){var i=!1,r=!1,u=0;function e(){i&&(i=!1,n());r&&f()}function o(){sw(e)}function f(){var n=Date.now();if(i){if(n-u<hw)return;r=!0}else i=!0,r=!1,setTimeout(o,t);u=n}return f}var lw=20,aw=["top","right","bottom","left","width","height","size","weight"],vw=typeof MutationObserver!="undefined",yw=function(){function n(){this.connected_=!1;this.mutationEventsAdded_=!1;this.mutationsObserver_=null;this.observers_=[];this.onTransitionEnd_=this.onTransitionEnd_.bind(this);this.refresh=cw(this.refresh.bind(this),lw)}return n.prototype.addObserver=function(n){~this.observers_.indexOf(n)||this.observers_.push(n);this.connected_||this.connect_()},n.prototype.removeObserver=function(n){var t=this.observers_,i=t.indexOf(n);~i&&t.splice(i,1);!t.length&&this.connected_&&this.disconnect_()},n.prototype.refresh=function(){var n=this.updateObservers_();n&&this.refresh()},n.prototype.updateObservers_=function(){var n=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return n.forEach(function(n){return n.broadcastActive()}),n.length>0},n.prototype.connect_=function(){du&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),vw?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},n.prototype.disconnect_=function(){du&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},n.prototype.onTransitionEnd_=function(n){var t=n.propertyName,i=t===void 0?"":t,r=aw.some(function(n){return!!~i.indexOf(n)});r&&this.refresh()},n.getInstance=function(){return this.instance_||(this.instance_=new n),this.instance_},n.instance_=null,n}(),hs=function(n,t){for(var i=0,r=Object.keys(t);i<r.length;i++){var u=r[i];Object.defineProperty(n,u,{value:t[u],enumerable:!1,writable:!1,configurable:!0})}return n},rt=function(n){var t=n&&n.ownerDocument&&n.ownerDocument.defaultView;return t||tr},cs=rr(0,0,0,0);function ir(n){return parseFloat(n)||0}function ls(n){for(var i=[],t=1;t<arguments.length;t++)i[t-1]=arguments[t];return i.reduce(function(t,i){var r=n["border-"+i+"-width"];return t+ir(r)},0)}function pw(n){for(var i={},t=0,r=["top","right","bottom","left"];t<r.length;t++){var u=r[t],f=n["padding-"+u];i[u]=ir(f)}return i}function ww(n){var t=n.getBBox();return rr(0,0,t.width,t.height)}function bw(n){var f=n.clientWidth,e=n.clientHeight;if(!f&&!e)return cs;var t=rt(n).getComputedStyle(n),i=pw(t),o=i.left+i.right,s=i.top+i.bottom,r=ir(t.width),u=ir(t.height);if(t.boxSizing==="border-box"&&(Math.round(r+o)!==f&&(r-=ls(t,"left","right")+o),Math.round(u+s)!==e&&(u-=ls(t,"top","bottom")+s)),!dw(n)){var h=Math.round(r+o)-f,c=Math.round(u+s)-e;Math.abs(h)!==1&&(r-=h);Math.abs(c)!==1&&(u-=c)}return rr(i.left,i.top,r,u)}var kw=function(){return typeof SVGGraphicsElement!="undefined"?function(n){return n instanceof rt(n).SVGGraphicsElement}:function(n){return n instanceof rt(n).SVGElement&&typeof n.getBBox=="function"}}();function dw(n){return n===rt(n).document.documentElement}function gw(n){return du?kw(n)?ww(n):bw(n):cs}function nb(n){var t=n.x,i=n.y,r=n.width,u=n.height,e=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,f=Object.create(e.prototype);return hs(f,{x:t,y:i,width:r,height:u,top:i,right:t+r,bottom:u+i,left:t}),f}function rr(n,t,i,r){return{x:n,y:t,width:i,height:r}}var tb=function(){function n(n){this.broadcastWidth=0;this.broadcastHeight=0;this.contentRect_=rr(0,0,0,0);this.target=n}return n.prototype.isActive=function(){var n=gw(this.target);return this.contentRect_=n,n.width!==this.broadcastWidth||n.height!==this.broadcastHeight},n.prototype.broadcastRect=function(){var n=this.contentRect_;return this.broadcastWidth=n.width,this.broadcastHeight=n.height,n},n}(),ib=function(){function n(n,t){var i=nb(t);hs(this,{target:n,contentRect:i})}return n}(),rb=function(){function n(n,t,i){if(this.activeObservations_=[],this.observations_=new ss,typeof n!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=n;this.controller_=t;this.callbackCtx_=i}return n.prototype.observe=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof rt(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)||(t.set(n,new tb(n)),this.controller_.addObserver(this),this.controller_.refresh())}},n.prototype.unobserve=function(n){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(typeof Element!="undefined"&&Element instanceof Object){if(!(n instanceof rt(n).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(n)&&(t.delete(n),t.size||this.controller_.removeObserver(this))}},n.prototype.disconnect=function(){this.clearActive();this.observations_.clear();this.controller_.removeObserver(this)},n.prototype.gatherActive=function(){var n=this;this.clearActive();this.observations_.forEach(function(t){t.isActive()&&n.activeObservations_.push(t)})},n.prototype.broadcastActive=function(){if(this.hasActive()){var n=this.callbackCtx_,t=this.activeObservations_.map(function(n){return new ib(n.target,n.broadcastRect())});this.callback_.call(n,t,n);this.clearActive()}},n.prototype.clearActive=function(){this.activeObservations_.splice(0)},n.prototype.hasActive=function(){return this.activeObservations_.length>0},n}(),as=typeof WeakMap!="undefined"?new WeakMap:new ss,vs=function(){function n(t){if(!(this instanceof n))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var i=yw.getInstance(),r=new rb(t,i,this);as.set(this,r)}return n}();["observe","unobserve","disconnect"].forEach(function(n){vs.prototype[n]=function(){var t;return(t=as.get(this))[n].apply(t,arguments)}});var ub=function(){return typeof tr.ResizeObserver!="undefined"?tr.ResizeObserver:vs}(),ut=null,ys=null;pr&&window.addEventListener("resize",function(){ys!==window.devicePixelRatio&&(ys=window.devicePixelRatio,ut=null)});function ps(){if(ut===null){if(typeof document=="undefined")return ut=0;var t=document.body,n=document.createElement("div");n.classList.add("asl_simplebar-hide-scrollbar");t.appendChild(n);var i=n.getBoundingClientRect().right;t.removeChild(n);ut=i}return ut}var i=function(){function t(n,i){var r=this;(this.onScroll=function(){r.scrollXTicking||(window.requestAnimationFrame(r.scrollX),r.scrollXTicking=!0);r.scrollYTicking||(window.requestAnimationFrame(r.scrollY),r.scrollYTicking=!0)},this.scrollX=function(){r.axis.x.isOverflowing&&(r.showScrollbar("x"),r.positionScrollbar("x"));r.scrollXTicking=!1},this.scrollY=function(){r.axis.y.isOverflowing&&(r.showScrollbar("y"),r.positionScrollbar("y"));r.scrollYTicking=!1},this.onMouseEnter=function(){r.showScrollbar("x");r.showScrollbar("y")},this.onMouseMove=function(n){if(r.mouseX=n.clientX,r.mouseY=n.clientY,r.axis.x.isOverflowing||r.axis.x.forceVisible)r.onMouseMoveForAxis("x");if(r.axis.y.isOverflowing||r.axis.y.forceVisible)r.onMouseMoveForAxis("y")},this.onMouseLeave=function(){if(r.onMouseMove.cancel(),r.axis.x.isOverflowing||r.axis.x.forceVisible)r.onMouseLeaveForAxis("x");if(r.axis.y.isOverflowing||r.axis.y.forceVisible)r.onMouseLeaveForAxis("y");r.mouseX=-1;r.mouseY=-1},this.onWindowResize=function(){r.scrollbarWidth=r.getScrollbarWidth();r.hideNativeScrollbar()},this.hideScrollbars=function(){r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect();r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect();r.isWithinBounds(r.axis.y.track.rect)||(r.axis.y.scrollbar.el.classList.remove(r.classNames.visible),r.axis.y.isVisible=!1);r.isWithinBounds(r.axis.x.track.rect)||(r.axis.x.scrollbar.el.classList.remove(r.classNames.visible),r.axis.x.isVisible=!1)},this.onPointerEvent=function(n){var t,i;if(r.axis.x.track.rect=r.axis.x.track.el.getBoundingClientRect(),r.axis.y.track.rect=r.axis.y.track.el.getBoundingClientRect(),(r.axis.x.isOverflowing||r.axis.x.forceVisible)&&(t=r.isWithinBounds(r.axis.x.track.rect)),(r.axis.y.isOverflowing||r.axis.y.forceVisible)&&(i=r.isWithinBounds(r.axis.y.track.rect)),(t||i)&&(n.preventDefault(),n.stopPropagation(),n.type==="mousedown")){if(t)if(r.axis.x.scrollbar.rect=r.axis.x.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.x.scrollbar.rect))r.onDragStart(n,"x");else r.onTrackClick(n,"x");if(i)if(r.axis.y.scrollbar.rect=r.axis.y.scrollbar.el.getBoundingClientRect(),r.isWithinBounds(r.axis.y.scrollbar.rect))r.onDragStart(n,"y");else r.onTrackClick(n,"y")}},this.drag=function(n){var u,f=r.axis[r.draggedAxis].track,e=f.rect[r.axis[r.draggedAxis].sizeAttr],o=r.axis[r.draggedAxis].scrollbar,s=r.contentWrapperEl[r.axis[r.draggedAxis].scrollSizeAttr],h=parseInt(r.elStyles[r.axis[r.draggedAxis].sizeAttr],10);n.preventDefault();n.stopPropagation();u=r.draggedAxis==="y"?n.pageY:n.pageX;var c=u-f.rect[r.axis[r.draggedAxis].offsetAttr]-r.axis[r.draggedAxis].dragOffset,l=c/(e-o.size),i=l*(s-h);r.draggedAxis==="x"&&(i=r.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i-(e+o.size):i,i=r.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-i:i);r.contentWrapperEl[r.axis[r.draggedAxis].scrollOffsetAttr]=i},this.onEndDrag=function(n){n.preventDefault();n.stopPropagation();r.el.classList.remove(r.classNames.dragging);document.removeEventListener("mousemove",r.drag,!0);document.removeEventListener("mouseup",r.onEndDrag,!0);r.removePreventClickId=window.setTimeout(function(){document.removeEventListener("click",r.preventClick,!0);document.removeEventListener("dblclick",r.preventClick,!0);r.removePreventClickId=null})},this.preventClick=function(n){n.preventDefault();n.stopPropagation()},this.el=n,this.minScrollbarWidth=20,this.options=Object.assign({},t.defaultOptions,{},i),this.classNames=Object.assign({},t.defaultOptions.classNames,{},this.options.classNames),this.axis={x:{scrollOffsetAttr:"scrollLeft",sizeAttr:"width",scrollSizeAttr:"scrollWidth",offsetSizeAttr:"offsetWidth",offsetAttr:"left",overflowAttr:"overflowX",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}},y:{scrollOffsetAttr:"scrollTop",sizeAttr:"height",scrollSizeAttr:"scrollHeight",offsetSizeAttr:"offsetHeight",offsetAttr:"top",overflowAttr:"overflowY",dragOffset:0,isOverflowing:!0,isVisible:!1,forceVisible:!1,track:{},scrollbar:{}}},this.removePreventClickId=null,t.instances.has(this.el))||(this.recalculate=bo(this.recalculate.bind(this),64),this.onMouseMove=bo(this.onMouseMove.bind(this),64),this.hideScrollbars=ns(this.hideScrollbars.bind(this),this.options.timeout),this.onWindowResize=ns(this.onWindowResize.bind(this),64,{leading:!0}),t.getRtlHelpers=ow(t.getRtlHelpers),this.init())}t.getRtlHelpers=function(){var r=document.createElement("div");r.innerHTML='<div class="hs-dummy-scrollbar-size"><div style="height: 200%; width: 200%; margin: 10px 0;"><\/div><\/div>';var n=r.firstElementChild;document.body.appendChild(n);var u=n.firstElementChild;n.scrollLeft=0;var f=t.getOffset(n),i=t.getOffset(u);n.scrollLeft=999;var e=t.getOffset(u);return{isRtlScrollingInverted:f.left!==i.left&&i.left-e.left!=0,isRtlScrollbarInverted:f.left!==i.left}};t.getOffset=function(n){var t=n.getBoundingClientRect();return{top:t.top+(window.pageYOffset||document.documentElement.scrollTop),left:t.left+(window.pageXOffset||document.documentElement.scrollLeft)}};var n=t.prototype;return n.init=function(){t.instances.set(this.el,this);pr&&(this.initDOM(),this.scrollbarWidth=this.getScrollbarWidth(),this.recalculate(),this.initListeners())},n.initDOM=function(){var i=this;if(Array.prototype.filter.call(this.el.children,function(n){return n.classList.contains(i.classNames.wrapper)}).length)this.wrapperEl=this.el.querySelector("."+this.classNames.wrapper),this.contentWrapperEl=this.options.scrollableNode||this.el.querySelector("."+this.classNames.contentWrapper),this.contentEl=this.options.contentNode||this.el.querySelector("."+this.classNames.contentEl),this.offsetEl=this.el.querySelector("."+this.classNames.offset),this.maskEl=this.el.querySelector("."+this.classNames.mask),this.placeholderEl=this.findChild(this.wrapperEl,"."+this.classNames.placeholder),this.heightAutoObserverWrapperEl=this.el.querySelector("."+this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl=this.el.querySelector("."+this.classNames.heightAutoObserverEl),this.axis.x.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.horizontal),this.axis.y.track.el=this.findChild(this.el,"."+this.classNames.track+"."+this.classNames.vertical);else{for(this.wrapperEl=document.createElement("div"),this.contentWrapperEl=document.createElement("div"),this.offsetEl=document.createElement("div"),this.maskEl=document.createElement("div"),this.contentEl=document.createElement("div"),this.placeholderEl=document.createElement("div"),this.heightAutoObserverWrapperEl=document.createElement("div"),this.heightAutoObserverEl=document.createElement("div"),this.wrapperEl.classList.add(this.classNames.wrapper),this.contentWrapperEl.classList.add(this.classNames.contentWrapper),this.offsetEl.classList.add(this.classNames.offset),this.maskEl.classList.add(this.classNames.mask),this.contentEl.classList.add(this.classNames.contentEl),this.placeholderEl.classList.add(this.classNames.placeholder),this.heightAutoObserverWrapperEl.classList.add(this.classNames.heightAutoObserverWrapperEl),this.heightAutoObserverEl.classList.add(this.classNames.heightAutoObserverEl);this.el.firstChild;)this.contentEl.appendChild(this.el.firstChild);this.contentWrapperEl.appendChild(this.contentEl);this.offsetEl.appendChild(this.contentWrapperEl);this.maskEl.appendChild(this.offsetEl);this.heightAutoObserverWrapperEl.appendChild(this.heightAutoObserverEl);this.wrapperEl.appendChild(this.heightAutoObserverWrapperEl);this.wrapperEl.appendChild(this.maskEl);this.wrapperEl.appendChild(this.placeholderEl);this.el.appendChild(this.wrapperEl)}if(!this.axis.x.track.el||!this.axis.y.track.el){var n=document.createElement("div"),t=document.createElement("div");n.classList.add(this.classNames.track);t.classList.add(this.classNames.scrollbar);n.appendChild(t);this.axis.x.track.el=n.cloneNode(!0);this.axis.x.track.el.classList.add(this.classNames.horizontal);this.axis.y.track.el=n.cloneNode(!0);this.axis.y.track.el.classList.add(this.classNames.vertical);this.el.appendChild(this.axis.x.track.el);this.el.appendChild(this.axis.y.track.el)}this.axis.x.scrollbar.el=this.axis.x.track.el.querySelector("."+this.classNames.scrollbar);this.axis.y.scrollbar.el=this.axis.y.track.el.querySelector("."+this.classNames.scrollbar);this.options.autoHide||(this.axis.x.scrollbar.el.classList.add(this.classNames.visible),this.axis.y.scrollbar.el.classList.add(this.classNames.visible));this.el.setAttribute("data-asl_simplebar","init")},n.initListeners=function(){var n=this;this.options.autoHide&&this.el.addEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.addEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.addEventListener("mousemove",this.onMouseMove);this.el.addEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.addEventListener("scroll",this.onScroll);window.addEventListener("resize",this.onWindowResize);var t=!1;this.resizeObserver=new ub(function(){t&&n.recalculate()});this.resizeObserver.observe(this.el);this.resizeObserver.observe(this.contentEl);window.requestAnimationFrame(function(){t=!0});this.mutationObserver=new MutationObserver(this.recalculate);this.mutationObserver.observe(this.contentEl,{childList:!0,subtree:!0,characterData:!0})},n.recalculate=function(){this.elStyles=window.getComputedStyle(this.el);this.isRtl=this.elStyles.direction==="rtl";var u=this.heightAutoObserverEl.offsetHeight<=1,f=this.heightAutoObserverEl.offsetWidth<=1,t=this.contentEl.offsetWidth,e=this.contentWrapperEl.offsetWidth,o=this.elStyles.overflowX,s=this.elStyles.overflowY;this.contentEl.style.padding=this.elStyles.paddingTop+" "+this.elStyles.paddingRight+" "+this.elStyles.paddingBottom+" "+this.elStyles.paddingLeft;this.wrapperEl.style.margin="-"+this.elStyles.paddingTop+" -"+this.elStyles.paddingRight+" -"+this.elStyles.paddingBottom+" -"+this.elStyles.paddingLeft;var n=this.contentEl.scrollHeight,i=this.contentEl.scrollWidth;this.contentWrapperEl.style.height=u?"auto":"100%";this.placeholderEl.style.width=f?t+"px":"auto";this.placeholderEl.style.height=n+"px";var r=this.contentWrapperEl.offsetHeight;this.axis.x.isOverflowing=i>t;this.axis.y.isOverflowing=n>r;this.axis.x.isOverflowing=o==="hidden"?!1:this.axis.x.isOverflowing;this.axis.y.isOverflowing=s==="hidden"?!1:this.axis.y.isOverflowing;this.axis.x.forceVisible=this.options.forceVisible==="x"||this.options.forceVisible===!0;this.axis.y.forceVisible=this.options.forceVisible==="y"||this.options.forceVisible===!0;this.hideNativeScrollbar();var h=this.axis.x.isOverflowing?this.scrollbarWidth:0,c=this.axis.y.isOverflowing?this.scrollbarWidth:0;this.axis.x.isOverflowing=this.axis.x.isOverflowing&&i>e-c;this.axis.y.isOverflowing=this.axis.y.isOverflowing&&n>r-h;this.axis.x.scrollbar.size=this.getScrollbarSize("x");this.axis.y.scrollbar.size=this.getScrollbarSize("y");this.axis.x.scrollbar.el.style.width=this.axis.x.scrollbar.size+"px";this.axis.y.scrollbar.el.style.height=this.axis.y.scrollbar.size+"px";this.positionScrollbar("x");this.positionScrollbar("y");this.toggleTrackVisibility("x");this.toggleTrackVisibility("y")},n.getScrollbarSize=function(n){if(n===void 0&&(n="y"),!this.axis[n].isOverflowing)return 0;var r=this.contentEl[this.axis[n].scrollSizeAttr],i=this.axis[n].track.el[this.axis[n].offsetSizeAttr],t,u=i/r;return t=Math.max(~~(u*i),this.options.scrollbarMinSize),this.options.scrollbarMaxSize&&(t=Math.min(t,this.options.scrollbarMaxSize)),t},n.positionScrollbar=function(n){if(n===void 0&&(n="y"),this.axis[n].isOverflowing){var e=this.contentWrapperEl[this.axis[n].scrollSizeAttr],f=this.axis[n].track.el[this.axis[n].offsetSizeAttr],o=parseInt(this.elStyles[this.axis[n].sizeAttr],10),u=this.axis[n].scrollbar,r=this.contentWrapperEl[this.axis[n].scrollOffsetAttr];r=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollingInverted?-r:r;var s=r/(e-o),i=~~((f-u.size)*s);i=n==="x"&&this.isRtl&&t.getRtlHelpers().isRtlScrollbarInverted?i+(f-u.size):i;u.el.style.transform=n==="x"?"translate3d("+i+"px, 0, 0)":"translate3d(0, "+i+"px, 0)"}},n.toggleTrackVisibility=function(n){n===void 0&&(n="y");var t=this.axis[n].track.el,i=this.axis[n].scrollbar.el;this.axis[n].isOverflowing||this.axis[n].forceVisible?(t.style.visibility="visible",this.contentWrapperEl.style[this.axis[n].overflowAttr]="scroll"):(t.style.visibility="hidden",this.contentWrapperEl.style[this.axis[n].overflowAttr]="hidden");i.style.display=this.axis[n].isOverflowing?"block":"none"},n.hideNativeScrollbar=function(){this.offsetEl.style[this.isRtl?"left":"right"]=this.axis.y.isOverflowing||this.axis.y.forceVisible?"-"+this.scrollbarWidth+"px":0;this.offsetEl.style.bottom=this.axis.x.isOverflowing||this.axis.x.forceVisible?"-"+this.scrollbarWidth+"px":0},n.onMouseMoveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.rect=this.axis[n].track.el.getBoundingClientRect();this.axis[n].scrollbar.rect=this.axis[n].scrollbar.el.getBoundingClientRect();var t=this.isWithinBounds(this.axis[n].scrollbar.rect);t?this.axis[n].scrollbar.el.classList.add(this.classNames.hover):this.axis[n].scrollbar.el.classList.remove(this.classNames.hover);this.isWithinBounds(this.axis[n].track.rect)?(this.showScrollbar(n),this.axis[n].track.el.classList.add(this.classNames.hover)):this.axis[n].track.el.classList.remove(this.classNames.hover)},n.onMouseLeaveForAxis=function(n){n===void 0&&(n="y");this.axis[n].track.el.classList.remove(this.classNames.hover);this.axis[n].scrollbar.el.classList.remove(this.classNames.hover)},n.showScrollbar=function(n){n===void 0&&(n="y");var t=this.axis[n].scrollbar.el;this.axis[n].isVisible||(t.classList.add(this.classNames.visible),this.axis[n].isVisible=!0);this.options.autoHide&&this.hideScrollbars()},n.onDragStart=function(n,t){t===void 0&&(t="y");var i=this.axis[t].scrollbar,r=t==="y"?n.pageY:n.pageX;this.axis[t].dragOffset=r-i.rect[this.axis[t].offsetAttr];this.draggedAxis=t;this.el.classList.add(this.classNames.dragging);document.addEventListener("mousemove",this.drag,!0);document.addEventListener("mouseup",this.onEndDrag,!0);this.removePreventClickId===null?(document.addEventListener("click",this.preventClick,!0),document.addEventListener("dblclick",this.preventClick,!0)):(window.clearTimeout(this.removePreventClickId),this.removePreventClickId=null)},n.onTrackClick=function(n,t){var r=this;t===void 0&&(t="y");this.axis[t].scrollbar.rect=this.axis[t].scrollbar.el.getBoundingClientRect();var c=this.axis[t].scrollbar,f=c.rect[this.axis[t].offsetAttr],e=parseInt(this.elStyles[this.axis[t].sizeAttr],10),i=this.contentWrapperEl[this.axis[t].scrollOffsetAttr],l=t==="y"?this.mouseY-f:this.mouseX-f,o=l<0?-1:1,s=o===-1?i-e:i+e,h=40,u=function u(){if(o===-1){if(i>s){var n;i-=h;r.contentWrapperEl.scrollTo((n={},n[r.axis[t].offsetAttr]=i,n));window.requestAnimationFrame(u)}}else if(i<s){var f;i+=h;r.contentWrapperEl.scrollTo((f={},f[r.axis[t].offsetAttr]=i,f));window.requestAnimationFrame(u)}};u()},n.getContentElement=function(){return this.contentEl},n.getScrollElement=function(){return this.contentWrapperEl},n.getScrollbarWidth=function(){try{return getComputedStyle(this.contentWrapperEl,"::-webkit-scrollbar").display==="none"||"scrollbarWidth"in document.documentElement.style?0:ps()}catch(n){return ps()}},n.removeListeners=function(){var n=this;this.options.autoHide&&this.el.removeEventListener("mouseenter",this.onMouseEnter);["mousedown","click","dblclick"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,!0)});["touchstart","touchend","touchmove"].forEach(function(t){n.el.removeEventListener(t,n.onPointerEvent,{capture:!0,passive:!0})});this.el.removeEventListener("mousemove",this.onMouseMove);this.el.removeEventListener("mouseleave",this.onMouseLeave);this.contentWrapperEl.removeEventListener("scroll",this.onScroll);window.removeEventListener("resize",this.onWindowResize);this.mutationObserver.disconnect();this.resizeObserver.disconnect();this.recalculate.cancel();this.onMouseMove.cancel();this.hideScrollbars.cancel();this.onWindowResize.cancel()},n.unMount=function(){this.removeListeners();t.instances.delete(this.el)},n.isWithinBounds=function(n){return this.mouseX>=n.left&&this.mouseX<=n.left+n.width&&this.mouseY>=n.top&&this.mouseY<=n.top+n.height},n.findChild=function(n,t){var i=n.matches||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;return Array.prototype.filter.call(n.children,function(n){return i.call(n,t)})[0]},t}();i.defaultOptions={autoHide:!0,forceVisible:!1,classNames:{contentEl:"asl_simplebar-content",contentWrapper:"asl_simplebar-content-wrapper",offset:"asl_simplebar-offset",mask:"asl_simplebar-mask",wrapper:"asl_simplebar-wrapper",placeholder:"asl_simplebar-placeholder",scrollbar:"asl_simplebar-scrollbar",track:"asl_simplebar-track",heightAutoObserverWrapperEl:"asl_simplebar-height-auto-observer-wrapper",heightAutoObserverEl:"asl_simplebar-height-auto-observer",visible:"asl_simplebar-visible",horizontal:"asl_simplebar-horizontal",vertical:"asl_simplebar-vertical",hover:"asl_simplebar-hover",dragging:"asl_simplebar-dragging"},scrollbarMinSize:25,scrollbarMaxSize:0,timeout:1e3};i.instances=new WeakMap;var ws=function(n){return function(t,i,r,u){ne(i);var o=fi(t),e=wt(o),s=ri(o.length),f=n?s-1:0,h=n?-1:1;if(r<2)while(!0){if(f in e){u=e[f];f+=h;break}if(f+=h,n?f<0:s<=f)throw TypeError("Reduce of empty array with no initial value");}for(;n?f>=0:s>f;f+=h)f in e&&(u=i(u,e[f],f,o));return u}},fb={left:ws(!1),right:ws(!0)},eb=fb.left;l({target:"Array",proto:!0,forced:ee("reduce")},{reduce:function(n){return eb(this,n,arguments.length,arguments.length>1?arguments[1]:undefined)}});var ob=k.f,gu=Function.prototype,sb=gu.toString,hb=/^\s*function ([^ (]*)/,bs="name";!a||bs in gu||ob(gu,bs,{configurable:!0,get:function(){try{return sb.call(this).match(hb)[1]}catch(n){return""}}});var cb=function(){var t=s(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n},ur=RegExp.prototype.exec,lb=String.prototype.replace,ks=ur,nf=function(){var n=/a/,t=/b*/g;return ur.call(n,"a"),ur.call(t,"a"),n.lastIndex!==0||t.lastIndex!==0}(),tf=/()??/.exec("")[1]!==undefined,ab=nf||tf;ab&&(ks=function(n){var i=this,u,f,t,r;return tf&&(f=new RegExp("^"+i.source+"$(?!\\s)",cb.call(i))),nf&&(u=i.lastIndex),t=ur.call(i,n),nf&&t&&(i.lastIndex=i.global?t.index+t[0].length:u),tf&&t&&t.length>1&&lb.call(t[0],f,function(){for(r=1;r<arguments.length-2;r++)arguments[r]===undefined&&(t[r]=undefined)}),t});var rf=ks;l({target:"RegExp",proto:!0,forced:/./.exec!==rf},{exec:rf});var hk=e("species"),ck=!u(function(){var n=/./;return n.exec=function(){var n=[];return n.groups={a:"7"},n},"".replace(n,"$<a>")!=="7"}),lk=!u(function(){var n=/(?:)/,i=n.exec;n.exec=function(){return i.apply(this,arguments)};var t="ab".split(n);return t.length!==2||t[0]!=="a"||t[1]!=="b"}),vb=ro.charAt,ak=function(n,t,i){return t+(i?vb(n,t).length:1)},vk=function(n,t){var i=n.exec;if(typeof i=="function"){var r=i.call(n,t);if(typeof r!="object")throw TypeError("RegExp exec method returned something other than an Object or null");return r}if(b(n)!=="RegExp")throw TypeError("RegExp#exec called on incompatible receiver");return rf.call(n,t)},yk=Math.max,pk=Math.min,wk=Math.floor,bk=function(n){return n===undefined?n:String(n)},fr=function(n){return Array.prototype.reduce.call(n,function(n,t){var r=t.name.match(/data-asl_simplebar-(.+)/);if(r){var i=r[1].replace(/\W+(.)/g,function(n,t){return t.toUpperCase()});switch(t.value){case"true":n[i]=!0;break;case"false":n[i]=!1;break;case undefined:n[i]=!0;break;default:n[i]=t.value}}return n},{})};return i.initDOMLoadedElements=function(){document.removeEventListener("DOMContentLoaded",this.initDOMLoadedElements);window.removeEventListener("load",this.initDOMLoadedElements);Array.prototype.forEach.call(document.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){i.instances.has(n)||new i(n,fr(n.attributes))})},i.removeObserver=function(){this.globalObserver.disconnect()},i.initHtmlApi=function(){this.initDOMLoadedElements=this.initDOMLoadedElements.bind(this);typeof MutationObserver!="undefined"&&(this.globalObserver=new MutationObserver(i.handleMutations),this.globalObserver.observe(document,{childList:!0,subtree:!0}));document.readyState!=="complete"&&(document.readyState==="loading"||document.documentElement.doScroll)?(document.addEventListener("DOMContentLoaded",this.initDOMLoadedElements),window.addEventListener("load",this.initDOMLoadedElements)):window.setTimeout(this.initDOMLoadedElements)},i.handleMutations=function(n){n.forEach(function(n){Array.prototype.forEach.call(n.addedNodes,function(n){n.nodeType===1&&(n.hasAttribute("data-asl_simplebar")?i.instances.has(n)||new i(n,fr(n.attributes)):Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar]:not([data-asl_simplebar="init"])'),function(n){i.instances.has(n)||new i(n,fr(n.attributes))}))});Array.prototype.forEach.call(n.removedNodes,function(n){n.nodeType===1&&(n.hasAttribute('[data-asl_simplebar="init"]')?i.instances.has(n)&&i.instances.get(n).unMount():Array.prototype.forEach.call(n.querySelectorAll('[data-asl_simplebar="init"]'),function(n){i.instances.has(n)&&i.instances.get(n).unMount()}))})})},i.getOptions=fr,pr&&i.initHtmlApi(),i});
2
  /*! Ajax Search Lite 4.6 js */
3
+ (function(n){var t,a=!0,s={init:function(t,i){var r=this;this.elem=i;this.$elem=n(i);r.searching=!1;r.o=n.extend({blocking:!1},t);r.n={};r.n.container=n(this.elem);r.o.rid=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.o.id=r.n.container.attr("id").match(/^ajaxsearchlite(.*)/)[1];r.n.probox=n(".probox",r.n.container);r.n.proinput=n(".proinput",r.n.container);r.n.text=n(".proinput input.orig",r.n.container);r.n.textAutocomplete=n(".proinput input.autocomplete",r.n.container);r.n.loading=n(".proinput .loading",r.n.container);r.n.proloading=n(".proloading",r.n.container);r.n.proclose=n(".proclose",r.n.container);r.n.promagnifier=n(".promagnifier",r.n.container);r.n.prosettings=n(".prosettings",r.n.container);r.n.searchsettings=n("#ajaxsearchlitesettings"+r.o.rid);r.n.resultsDiv=n("#ajaxsearchliteres"+r.o.rid);r.n.hiddenContainer=n("#asl_hidden_data");r.n.aslItemOverlay=n(".asl_item_overlay",r.n.hiddenContainer);r.resizeTimeout=null;r.n.showmore=n(".showmore",r.n.resultsDiv);r.n.items=n(".item",r.n.resultsDiv);r.n.results=n(".results",r.n.resultsDiv);r.n.resdrg=n(".resdrg",r.n.resultsDiv);r.il={columns:3,itemsPerPage:6};r.post=null;r.postAuto=null;r.cleanUp();r.n.textAutocomplete.val("");r.o.resultitemheight=parseInt(r.o.resultitemheight);r.scroll={};r.savedScrollTop=0;r.savedContainerTop=0;r.is_scroll=typeof asl_SimpleBar!="undefined";typeof ASL.scrollbar!="undefined"&&ASL.scrollbar==0&&(r.is_scroll=!1);r.settScroll=null;r.n.resultsAppend=n("#wpdreams_asl_results_"+r.o.id);r.currentPage=1;r.isotopic=null;r.lastSuccesfulSearch="";r.lastSearchData={};r.triggerPrevState=!1;r.animation="bounceIn";switch(r.o.resultstype){case"vertical":r.animation=r.o.vresultanimation;break;default:r.animation=r.o.hresultanimation}return r.filterFns={number:function(){for(var t=n(this).parent();!t.hasClass("isotopic");)t=t.parent();var i=n(this).attr("data-itemnum"),u=r.currentPage,f=r.il.itemsPerPage;return parseInt(i,10)<f*u&&parseInt(i,10)>=f*(u-1)}},r.disableMobileScroll=!1,r.n.searchsettings.detach().appendTo("body"),r.o.resultsposition=="hover"?r.n.resultsDiv.detach().appendTo("body"):r.n.resultsAppend.length>0&&r.n.resultsDiv.detach().appendTo(r.n.resultsAppend),typeof ASL.resHTML=="undefined"&&(ASL.resHTML=r.n.resultsDiv.html()),typeof ASL.setHTML=="undefined"&&(ASL.setHTML=r.n.searchsettings.html()),n("fieldset",r.n.searchsettings).each(function(){n(".asl_option:not(.hiddend)",this).last().addClass("asl-o-last")}),ASL.js_retain_popstate==1&&r.initPrevState(),v()&&r.n.container.addClass("asl_msie"),r.initSettingsAnimations(),r.initResultsAnimations(),r.initEvents(),r.initAutop(),r.initEtc(),this},initPrevState:function(){var i=this;a&&t==null&&(t=localStorage.getItem("asl-"+u.encode(location.href)),t!=null&&(t=JSON.parse(t),t.settings=u.decode(t.settings)));t!=null&&typeof t.id!="undefined"&&t.id==i.o.id&&(t.phrase!=""&&(i.triggerPrevState=!0,i.n.text.val(t.phrase)),o(n("form",i.n.searchsettings))!=t.settings&&(i.triggerPrevState=!0,o(n("form",i.n.searchsettings),t.settings)));localStorage.removeItem("asl-"+u.encode(location.href));i.n.resultsDiv.on("click",".results .item",function(){var t=i.n.text.val();if(t!=""||i.settingsChanged){var r={id:i.o.id,phrase:t,settings:u.encode(o(n("form",i.n.searchsettings)))};localStorage.setItem("asl-"+u.encode(location.href),JSON.stringify(r))}})},duplicateCheck:function(){var i=this,t={};n("div[id*=ajaxsearchlite]").each(function(){t.hasOwnProperty(this.id)?n(this).remove():t[this.id]="true"})},gaPageview:function(n){var r=this,t=r.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="pageview")return!1;if(ASL.analytics.string!=""){var i=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1,u=typeof gtag=="function"?gtag:!1;window.location.origin||(window.location.origin=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""));var f=r.o.homeurl.replace(window.location.origin,"");u!==!1?t!==!1&&u("config",t,{page_path:f+ASL.analytics.string.replace("{asl_term}",n)}):i!==!1&&(t!==!1&&i("create",t,"auto"),i("send","pageview",{page:f+ASL.analytics.string.replace("{asl_term}",n),title:"Ajax Search"}))}},gaEvent:function(t,i){var u=this,f=u.gaGetTrackingID();if(typeof ASL.analytics=="undefined"||ASL.analytics.method!="event")return!1;var e=typeof gtag=="function"?gtag:!1,o=typeof __gaTracker=="function"?__gaTracker:typeof ga=="function"?ga:!1;if(e===!1&&o===!1)return!1;if(typeof ASL.analytics.event[t]!="undefined"&&ASL.analytics.event[t].active==1&&typeof"gtag"!="undefined"){var s={search_id:u.o.id,search_name:u.o.name,phrase:u.n.text.val(),option_name:"",option_value:"",result_title:"",result_url:"",results_count:""},r={event_category:ASL.analytics.event[t].category,event_label:ASL.analytics.event[t].label,value:ASL.analytics.event[t].value};i=n.extend(s,i);n.each(i,function(t,i){i=String(i).replace(/[\s\n\r]+/g," ").trim();n.each(r,function(n,u){var f=new RegExp("{"+t+"}","gmi");r[n]=u.replace(f,i)})});e===!1?(f!==!1&&o("create",f,"auto"),o("send","event",r.event_category,ASL.analytics.event[t].action,r.event_label,r.value)):(f!==!1&&(r.send_to=f),e("event",ASL.analytics.event[t].action,r))}},gaGetTrackingID:function(){var r=this,n=!1;if(typeof ASL.analytics=="undefined")return n;if(typeof ASL.analytics.tracking_id!="undefined"&&ASL.analytics.tracking_id!="")return ASL.analytics.tracking_id;var i=typeof gtag=="function"?gtag:!1;if(i!==!1&&typeof ga!="undefined"&&typeof ga.getAll!="undefined"){var t=!1;return ga.getAll().forEach(function(n){t=n.get("trackingId")}),t}return n},createVerticalScroll:function(){var t=this;t.is_scroll&&typeof t.scroll.recalculate=="undefined"&&(t.scroll=new asl_SimpleBar(t.n.results.get(0),{direction:n("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0}))},initEvents:function(){var t=this;if(i()&&e())t.n.text.on("touchstart",function(){t.savedScrollTop=n(window).scrollTop();t.savedContainerTop=t.n.container.offset().top});t.n.text.on("click",function(){n(this).trigger("focus");t.gaEvent("focus")});t.n.text.on("focus input",function(){t.searching||(n(this).val()!=""?t.n.proclose.css("display","block"):t.n.proclose.css({display:"none"}))});n(t.n.text.parent()).on("submit",function(n){if(n.preventDefault(),i())if(t.o.redirect_on_enter){var r=jQuery.Event("keyup");r.keyCode=r.which=13;t.n.text.trigger(r)}else t.o.redirectEnterTo=="ajax_search"&&(t.search(),document.activeElement.blur());else t.o.redirectEnterTo=="ajax_search"&&t.search()});t.n.resultsDiv.css({opacity:0});n(document).on("click touchend",function(){(t.hideSettings(),t.opened!=!1&&t.o.closeOnDocClick==1)&&t.hideResults()});t.n.proclose.on("click touchend",function(){t.n.text.val("");t.n.textAutocomplete.val("");t.hideResults();t.n.text.trigger("focus")});n(t.elem).on("click touchend",function(n){n.stopImmediatePropagation()});t.n.resultsDiv.on("click touchend",function(n){n.stopImmediatePropagation()});t.n.searchsettings.on("click touchend",function(n){n.stopImmediatePropagation()});t.n.prosettings.on("click",function(){t.n.prosettings.data("opened")==0?t.showSettings():t.hideSettings()});var f=t.n.container.parents().filter(function(){return n(this).css("position")=="fixed"});if((f.length>0||t.n.container.css("position")=="fixed")&&(t.n.resultsDiv.css("position")=="absolute"&&t.n.resultsDiv.css("position","fixed"),t.n.resultsDiv.css("z-index",99999999999),t.o.blocking||t.n.searchsettings.css("position","fixed")),i())n(window).on("orientationchange",function(){t.orientationChange();setTimeout(function(){t.orientationChange()},800)});else{var r;n(window).on("resize",function(){clearTimeout(r);r=setTimeout(function(){t.resize()},100)})}var u;n(window).on("scroll",function(){clearTimeout(u);u=setTimeout(function(){t.scrolling(!1)},400)});e()&&i()&&parseInt(t.n.text.css("font-size"))<16&&(t.n.text.data("fontSize",t.n.text.css("font-size")).css("font-size","16px"),t.n.textAutocomplete.css("font-size","16px"),n("<style>#ajaxsearchlite"+t.o.rid+" input.orig::-webkit-input-placeholder{font-size: 16px !important;}<\/style>").appendTo("head"));t.initNavigationEvent();t.initMagnifierEvent();t.initAutocompleteEvent();t.initFacetEvents()},initAutop:function(){var n=this;if(t!=null&&n.triggerPrevState)return n.search(),t=null,!1},initEtc:function(){var t=this,r=null;n("div.asl_option",t.n.searchsettings).on("mouseup touchend",function(i){if(i.preventDefault(),i.stopImmediatePropagation(),t.dragging)return!1;n('input[type="checkbox"]',this).prop("checked",!n('input[type="checkbox"]',this).prop("checked"));clearTimeout(r);var u=this;r=setTimeout(function(){n('input[type="checkbox"]',u).trigger("asl_chbx_change")},50)});n("div.asl_option label",t.n.searchsettings).on("click",function(n){n.preventDefault()});t.n.resultsDiv.on("click",".results .item",function(){t.gaEvent("result_click",{result_title:n(this).find("a.asl_res_url").text(),result_url:n(this).find("a.asl_res_url").attr("href")});t.o.singleHighlight==1&&(localStorage.removeItem("asl_phrase_highlight"),c(t.n.text.val())!=""&&localStorage.setItem("asl_phrase_highlight",JSON.stringify({phrase:c(t.n.text.val()),id:t.o.id})))});if(i()&&t.o.mobile.menu_selector!="")n(t.o.mobile.menu_selector).on("touchend",function(){var i=this;setTimeout(function(){var r=n(i).find("input.orig");r=r.length==0?n(i).next().find("input.orig"):r;r=r.length==0?n(i).parent().find("input.orig"):r;r=r.length==0?t.n.text:r;t.n.container.is(":visible")&&r.get(0).focus()},300)})},initNavigationEvent:function(){var t=this;n(t.n.resultsDiv).on("mouseenter",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered");n(this).addClass("hovered")});n(t.n.resultsDiv).on("mouseleave",".item",function(){n(".item",t.n.resultsDiv).removeClass("hovered")});n(document).on("keydown",function(i){if(window.event)var r=window.event.keyCode,e=window.event.type;else if(i)var r=i.which,e=i.type;if(n(".item",t.n.resultsDiv).length>0&&t.n.resultsDiv.css("display")!="none"){if(r==40||r==38){r==40&&(t.n.text.blur(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).first().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").next(".item").addClass("hovered"));r==38&&(t.n.text.blur(),n(".item.hovered",t.n.resultsDiv).length==0?n(".item",t.n.resultsDiv).last().addClass("hovered"):n(".item.hovered",t.n.resultsDiv).removeClass("hovered").prev(".item").addClass("hovered"));i.stopPropagation();i.preventDefault();var u=t.is_scroll?n(t.scroll.getScrollElement()):t.n.results,f=t.n.resultsDiv.find(".resdrg .item.hovered");f.length==0&&(f=t.n.resultsDiv.children().first());u.animate({scrollTop:f.offset().top-u.offset().top+u.scrollTop()},{duration:120})}r==13&&n(".item.hovered",t.n.resultsDiv).length>0&&(i.stopPropagation(),i.preventDefault(),n(".item.hovered a.asl_res_url",t.n.resultsDiv).get(0).click())}})},initMagnifierEvent:function(){var t=this,i,u,r=!1;t.n.text.on("keyup",function(f){if(window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):f&&(t.keycode=f.which,t.ktype=f.type),t.keycode==13){if(clearTimeout(u),u=setTimeout(function(){r=!1},300),r)return!1;r=!0}var e=n(this).hasClass("orig");if(t.n.text.val().length>=t.o.charcount&&e&&t.ktype=="keyup"&&t.keycode==13){if(t.gaEvent("return"),t.o.redirect_on_enter==1)t.o.redirectEnterTo!="first_result"?t.doRedirectToResults(t.ktype):t.search();else{if(t.o.redirectEnterTo=="nothing")return!1;n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()==t.lastSuccesfulSearch&&t.resultsOpened||t.search()}clearTimeout(i)}});t.n.promagnifier.add(t.n.text).on("click input",function(r){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):r&&(t.keycode=r.which,t.ktype=r.type);var u=n(this).hasClass("orig");if(t.n.text.val().length<t.o.charcount){t.n.proloading.css("display","none");t.hideResults();t.post!=null&&t.post.abort();clearTimeout(i);return}if(t.n.text.val().length>=t.o.charcount&&!u&&t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo!="first_result"){t.doRedirectToResults(t.ktype);clearTimeout(i);return}if((!(t.keycode>=37)||!(t.keycode<=40))&&(!(t.keycode>=112)||!(t.keycode<=123))){if(u&&t.ktype=="click"||t.keycode==32){n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()==t.lastSuccesfulSearch&&(t.n.proclose.css("display","block"),t.resultsOpened||t.showResults());return}n(this).hasClass("orig")&&t.ktype=="click"||(u||t.ktype!="click"||t.gaEvent("magnifier"),t.o.trigger_on_click!=0||t.ktype!="click")&&(t.o.triggerontype!=0||t.ktype!="input")&&(!u||t.ktype!="input"||t.o.redirectEnterTo!="nothing")&&(u||t.ktype!="click"||t.o.redirectClickTo!="nothing")&&(t.post!=null&&t.post.abort(),clearTimeout(i),t.hideLoader(),i=setTimeout(function(){if(n("form",t.n.searchsettings).serialize()+t.n.text.val().trim()!=t.lastSuccesfulSearch)t.search();else{if(t.n.proclose.css("display","block"),t.isRedirectToFirstResult())return t.doRedirectToFirstResult(),!1;t.resultsOpened||t.showResults()}},250))}})},initFacetEvents:function(){var t=this,i=null;if(t.o.trigger_on_facet_change==1){n("input[type!=checkbox], select",t.n.searchsettings).on("change slidechange",function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),clearTimeout(i),i=setTimeout(function(){t.search()},50))});n("input[type=checkbox]",t.n.searchsettings).on("asl_chbx_change",function(){t.n.text.val().length<t.o.charcount||(t.post!=null&&t.post.abort(),t.gaEvent("facet_change",{option_label:n(this).closest("fieldset").find("legend").text(),option_value:n(this).closest(".asl_option").find(".asl_option_label").text()+(n(this).prop("checked")?"(checked)":"(unchecked)")}),clearTimeout(i),i=setTimeout(function(){t.search()},50))})}},isRedirectToFirstResult:function(){var t=this;return n(".asl_res_url",t.n.resultsDiv).length>0&&(t.o.redirectonclick==1&&t.ktype=="click"&&t.o.redirectClickTo=="first_result"||t.o.redirect_on_enter==1&&(t.ktype=="input"||t.ktype=="keyup")&&t.keycode==13&&t.o.redirectEnterTo=="first_result")?!0:!1},doRedirectToFirstResult:function(){var t=this,i;return i=t.ktype=="click"?t.o.redirectClickLoc:t.o.redirectEnterLoc,i=="same"?location.href=n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href"):l(n(n(".asl_res_url",t.n.resultsDiv).get(0)).attr("href")),t.hideLoader(),t.hideResults(),!1},doRedirectToResults:function(t){var i=this,o=i.ktype=="click"?i.o.redirectClickTo:i.o.redirectEnterTo,e=t=="click"?i.o.redirectClickLoc:i.o.redirectEnterLoc;if(o=="results_page")var u="?s="+r(i.n.text.val());else if(o=="woo_results_page")var u="?post_type=product&s="+r(i.n.text.val());else var u=i.o.redirect_url.replace("{phrase}",r(i.n.text.val()));if(i.o.homeurl.indexOf("?")>1&&u.indexOf("?")===0&&(u=u.replace("?","&")),i.o.overridewpdefault)if(i.o.override_method=="post")f(i.o.homeurl+u,"post",{asl_active:1,p_asl_data:n("form",i.n.searchsettings).serialize()},e);else{var s=i.o.homeurl+u+"&asl_active=1&p_asid="+i.o.id+"&p_asl_data=1&"+n("form",i.n.searchsettings).serialize();e=="same"?location.href=s:l(s)}else f(i.o.homeurl+u,"post",{np_asl_data:n("form",i.n.searchsettings).serialize()},e);i.n.proloading.css("display","none");i.hideLoader();i.hideResults();i.post!=null&&i.post.abort()},destroy:function(){return this.each(function(){var t=n.extend({},this,s);n(window).unbind(t)})},searchfor:function(t){n(".proinput input",this).val(t).trigger("keyup")},initAutocompleteEvent:function(){var t=this;if(t.o.autocomplete.enabled==1&&!i())t.n.text.on("keyup",function(i){window.event?(t.keycode=window.event.keyCode,t.ktype=window.event.type):i&&(t.keycode=i.which,t.ktype=i.type);var r=39;n("body").hasClass("rtl")&&(r=37);t.keycode==r&&t.n.textAutocomplete.val()!=""?(i.preventDefault(),t.n.text.val(t.n.textAutocomplete.val()),t.post!=null&&t.post.abort(),t.search()):(t.postAuto!=null&&t.postAuto.abort(),t.autocompleteGoogleOnly())})},autocompleteGoogleOnly:function(){var t=this,i=t.n.text.val();if(t.n.text.val()==""){t.n.textAutocomplete.val("");return}var r=t.n.textAutocomplete.val();(r==""||r.indexOf(i)!=0)&&(t.n.textAutocomplete.val(""),n.ajax({url:"https://clients1.google.com/complete/search",dataType:"jsonp",data:{q:i,hl:t.o.autocomplete.lang,nolabels:"t",client:"hp",ds:""},success:function(r){r[1].length>0&&(response=r[1][0][0].replace(/(<([^>]+)>)/ig,""),response=n("<textarea />").html(response).text(),response=response.substr(i.length),t.n.textAutocomplete.val(i+response))}}))},search:function(){var t=this;if((!t.searching||!0)&&!(t.n.text.val().length<t.o.charcount)){t.searching=!0;t.n.proloading.css({display:"block"});t.n.proclose.css({display:"none"});var i={action:"ajaxsearchlite_search",aslp:t.n.text.val(),asid:t.o.id,options:n("form",t.n.searchsettings).serialize()};if(i=h("asl_search_data",i),JSON.stringify(i)===JSON.stringify(t.lastSearchData))return(t.resultsOpened||t.showResults(),t.hideLoader(),t.isRedirectToFirstResult())?(t.doRedirectToFirstResult(),!1):!1;t.gaEvent("search_start");t.post=n.post(ASL.ajaxurl,i,function(u){u=u.replace(/^\s*[\r\n]/gm,"");u=u.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];u=h("asl_search_html",u);t.n.resdrg.html("");t.n.resdrg.html(u);n(".asl_keyword",t.n.resdrg).on("click",function(){t.n.text.val(n(this).html());n("input.orig",t.n.container).val(n(this).html()).trigger("keydown");n("form",t.n.container).trigger("submit","ajax");t.search()});if(t.n.items=n(".item",t.n.resultsDiv),t.gaEvent("search_end",{results_count:t.n.items.length}),t.gaPageview(t.n.text.val()),t.isRedirectToFirstResult())return t.doRedirectToFirstResult(),!1;if(t.hideLoader(),t.showResults(),t.scrollToResults(),t.lastSuccesfulSearch=n("form",t.n.searchsettings).serialize()+t.n.text.val().trim(),t.lastSearchData=i,t.n.items.length==0)t.n.showmore!=null&&t.n.showmore.css("display","none");else if(t.n.showmore!=null){t.n.showmore.css("display","block");n("a",t.n.showmore).off();n("a",t.n.showmore).on("click",function(){var u=t.o.redirectClickTo,i="?s="+r(t.n.text.val());i=u=="results_page"?"?s="+r(t.n.text.val()):u=="woo_results_page"?"?post_type=product&s="+r(t.n.text.val()):t.o.redirect_url.replace("{phrase}",r(t.n.text.val()));t.o.overridewpdefault?t.o.override_method=="post"?f(t.o.homeurl+i,"post",{asl_active:1,p_asl_data:n("form",t.n.searchsettings).serialize()}):location.href=t.o.homeurl+i+"&asl_active=1&p_asid="+t.o.id+"&p_asl_data=1&"+n("form",t.n.searchsettings).serialize():f(t.o.homeurl+i,"post",{np_asl_data:n("form",t.n.searchsettings).serialize()})})}},"text").fail(function(i,r){i.aborted||r=="abort"||(t.n.resdrg.html(""),t.n.resdrg.html('<div class="asl_nores">The request failed. Please check your connection! Status: '+i.status+"<\/div>"),t.n.items=n(".item",t.n.resultsDiv),t.hideLoader(),t.showResults(),t.scrollToResults())})}},showLoader:function(){var n=this;n.n.proloading.css({display:"block"})},hideLoader:function(){var n=this;n.n.proloading.css({display:"none"});n.n.results.css("display","")},showResultsBox:function(){var n=this;n.n.resultsDiv.css({display:"block",height:"auto"});n.n.items.addClass(n.animationOpacity);n.fixResultsPosition(!0);n.n.resultsDiv.css(n.resAnim.showCSS);n.n.resultsDiv.removeClass(n.resAnim.hideClass).addClass(n.resAnim.showClass)},showResults:function(){var n=this;n.createVerticalScroll();switch(n.o.resultstype){case"vertical":n.showVerticalResults();break;default:n.showHorizontalResults()}n.hideLoader();n.n.proclose.css({display:"block"});n.n.showmore!=null&&(n.n.items.length>0?n.n.showmore.css({display:"block"}):n.n.showmore.css({display:"none"}));n.is_scroll&&typeof n.scroll.recalculate!="undefined"&&setTimeout(function(){n.scroll.recalculate()},500);n.resultsOpened=!0},hideResults:function(){var n=this;if(!n.resultsOpened)return!1;n.n.resultsDiv.removeClass(n.resAnim.showClass).addClass(n.resAnim.hideClass);setTimeout(function(){n.n.resultsDiv.css(n.resAnim.hideCSS)},n.resAnim.duration);n.n.proclose.css({display:"none"});n.n.showmore!=null&&n.n.showmore.css({display:"none"});i()&&document.activeElement.blur();n.resultsOpened=!1},scrollToResults:function(){if(($this=this,this.o.scrollToResults==1)&&!this.$elem.parent().hasClass("asl_preview_data")){if($this.o.resultsposition=="hover")var t=$this.n.probox.offset().top-20;else var t=$this.n.resultsDiv.offset().top-20;n("#wpadminbar").length>0&&(t-=n("#wpadminbar").height());t=t<0?0:t;n("body, html").animate({scrollTop:t},{duration:500})}},createGroup:function(n){return"<div class='group'>"+n+"<\/div>"},showVerticalResults:function(){var t=this;if(t.showResultsBox(),t.n.items.length>0){var e=t.n.items.length<t.o.itemscount?t.n.items.length:t.o.itemscount,h=n(".group",t.n.resultsDiv);if(t.n.items.length<=t.o.itemscount)t.n.results.css({height:"auto"});else{t.n.results.css({height:30});t.resize();var i=0,r=0,u=0,f=0;t.n.items.each(function(){r+=n(this).outerHeight(!0);n(this).outerHeight(!0)>f&&(f=n(this).outerHeight(!0));i++});u=f*e;u>r&&(u=r);i=i<1?1:i;r=r/i*e;t.n.results.css({height:u})}if(t.resize(),t.n.items.last().addClass("asl_last_item"),t.o.highlight==1){var o=t.o.highlightwholewords==1?!0:!1;n("div.item",t.n.resultsDiv).highlight(t.n.text.val().split(" "),{element:"span",className:"highlighted",wordsOnly:o})}}t.resize();t.n.items.length==0&&t.n.results.css({height:"auto"});t.n.results.css({overflowY:"auto"});var s=t.is_scroll?n(t.scroll.getScrollElement()):t.n.results;s.scrollTop(0);t.addAnimation();t.fixResultsPosition(!0);t.searching=!1},addAnimation:function(){var i=this,t=0,r=1;i.n.items.each(function(){var u=this;setTimeout(function(){n(u).addClass(i.animation)},t);t=t+60;r++})},removeAnimation:function(){var t=this;t.n.items.each(function(){var i=this;n(i).removeClass(t.animation)})},initSettingsAnimations:function(){var n=this,t=300;n.settAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":t+"ms"},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:t};n.n.searchsettings.css({"-webkit-animation-duration":n.settAnim.duration+"ms","animation-duration":n.settAnim.duration+"ms"})},initResultsAnimations:function(){var t=this,n=300;t.resAnim={showClass:"asl_an_fadeInDrop",showCSS:{visibility:"visible",display:"block",opacity:1,"animation-duration":n+"ms"},hideClass:"asl_an_fadeOutDrop",hideCSS:{visibility:"hidden",opacity:0,display:"none"},duration:n};t.n.resultsDiv.css({"-webkit-animation-duration":n+"ms","animation-duration":n+"ms"})},showSettings:function(){var t=this;t.n.searchsettings.css(t.settAnim.showCSS);t.n.searchsettings.removeClass(t.settAnim.hideClass).addClass(t.settAnim.showClass);t.settScroll==null&&t.is_scroll&&(t.settScroll=[],n(".asl_sett_scroll",t.n.searchsettings).each(function(i){var r=this;setTimeout(function(){t.settScroll[i]=new asl_SimpleBar(n(r).get(0),{direction:n("body").hasClass("rtl")?"rtl":"ltr",autoHide:!0})},20)}));t.n.prosettings.data("opened",1);t.fixSettingsPosition(!0)},hideSettings:function(){var n=this;n.n.searchsettings.removeClass(n.settAnim.showClass).addClass(n.settAnim.hideClass);setTimeout(function(){n.n.searchsettings.css(n.settAnim.hideCSS)},n.settAnim.duration);n.n.prosettings.data("opened",0)},cleanUp:function(){var t=this;n(".searchsettings",t.n.container).length>0&&(n("body>#ajaxsearchlitesettings"+t.o.rid).remove(),n("body>#ajaxsearchliteres"+t.o.rid).remove())},orientationChange:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},resize:function(){var n=this;n.fixSettingsPosition();n.fixResultsPosition();n.fixTryThisPosition()},scrolling:function(n){var t=this;t.fixSettingsPosition(n);t.fixResultsPosition(n)},fixTryThisPosition:function(){},fixResultsPosition:function(t){t=typeof t=="undefined"?!1:t;var r=this,f=r.n.resultsDiv.css("position");if(f=="fixed"||f=="absolute"){var o=0;if(n("body").css("position")!="static"&&(o=n("body").offset().top),t==!0||r.n.resultsDiv.css("visibility")=="visible"){var s=0,h=0,u=r.n.container.offset();if(f=="fixed"&&(o=0,s=n(document).scrollTop(),h=n(document).scrollLeft(),i()&&e()&&r.n.text.is(":focus")&&(s=r.savedScrollTop,u.top=r.savedContainerTop)),typeof u!="undefined"){var c=r.n.container.outerWidth()<240?240:r.n.container.outerWidth();r.n.resultsDiv.outerWidth(c);r.n.resultsDiv.css({top:u.top+r.n.container.outerHeight(!0)+10-o-s,left:u.left-h})}}}},fixSettingsPosition:function(t){t=typeof t=="undefined"?!1:t;var r=this,s=0;if(n("body").css("position")!="static"&&(s=n("body").offset().top),(t==!0||r.n.prosettings.data("opened")!=0)&&r.o.blocking!=!0){if(r.fixSettingsWidth(),r.n.prosettings.css("display")!="none")var f=r.n.prosettings;else var f=r.n.promagnifier;var u=f.offset(),o=0,h=0;r.n.searchsettings.css("position")=="fixed"&&(o=n(window).scrollTop(),h=n(window).scrollLeft(),i()&&e()&&r.n.text.is(":focus")&&(u.top=r.savedContainerTop,o=r.savedScrollTop));r.o.settingsimagepos=="left"?r.n.searchsettings.css({display:"block",top:u.top+f.height()-2-s-o,left:u.left-h}):r.n.searchsettings.css({display:"block",top:u.top+f.height()-2-s-o,left:u.left+f.width()-r.n.searchsettings.width()-h})}},fixSettingsWidth:function(){}};function h(){return typeof wp!="undefined"&&typeof wp.hooks!="undefined"&&typeof wp.hooks.applyFilters!="undefined"?wp.hooks.applyFilters.apply(null,arguments):typeof arguments[1]!="undefined"?arguments[1]:!1}function i(){try{return document.createEvent("TouchEvent"),!0}catch(n){return!1}}function o(t,i){var r=t.find(":input").get();return arguments.length===1?(i={},n.each(r,function(){!this.name||this.disabled||!(this.checked||/select|textarea/i.test(this.nodeName)||/text/i.test(this.type))||n(this).hasClass("asl_datepicker_field")||n(this).hasClass("asl_datepicker")||(i[this.name]==undefined&&(i[this.name]=[]),i[this.name].push(n(this).val()))}),JSON.stringify(i)):(typeof i!="object"&&(i=JSON.parse(i)),n.each(r,function(){if(this.name&&i[this.name]){var t=i[this.name],r=n(this);if(Object.prototype.toString.call(t)!=="[object Array]"&&(t=[t]),this.type=="checkbox"||this.type=="radio"){for(var e=r.val(),f=!1,u=0;u<t.length;u++)if(t[u]==e){f=!0;break}r.attr("checked",f)}else r.val(t[0])}}),t)}function r(n){return encodeURIComponent(n).replace(/\%20/g,"+")}function c(n){return n.replace(/"|'/g,"")}function f(t,i,r,u){"use strict";var f;f=n("<form />",{action:t,method:i,style:"display: none;"});typeof r!="undefined"&&r!==null&&n.each(r,function(t,i){n("<input />",{type:"hidden",name:t,value:i}).appendTo(f)});typeof u!="undefined"&&u=="new"&&f.attr("target","_blank");f.appendTo("body").trigger("submit")}function l(t){n('<a href="'+t+'" target="_blank">').get(0).click()}function e(){return typeof navigator!="undefined"&&typeof window.navigator.userAgent!="undefined"?window.navigator.userAgent.match(/(iPod|iPhone|iPad)/)!=null:!1}function v(){var n=window.navigator.userAgent,t=n.indexOf("MSIE ");return t>0?!0:!1}typeof Object.create!="function"&&(Object.create=function(n){function t(){}return t.prototype=n,new t});n.plugin=function(t,i){n.fn[t]=function(r){return this.each(function(){n.data(this,t)||n.data(this,t,Object.create(i).init(r,this))})}};n.plugin("ajaxsearchlite",s);var u={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode:function(n){var e="",o,t,i,h,c,s,r,f=0;for(n=u._utf8_encode(n);f<n.length;)o=n.charCodeAt(f++),t=n.charCodeAt(f++),i=n.charCodeAt(f++),h=o>>2,c=(o&3)<<4|t>>4,s=(t&15)<<2|i>>6,r=i&63,isNaN(t)?s=r=64:isNaN(i)&&(r=64),e=e+this._keyStr.charAt(h)+this._keyStr.charAt(c)+this._keyStr.charAt(s)+this._keyStr.charAt(r);return e},decode:function(n){var t="",o,s,h,c,f,r,e,i=0;for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)c=this._keyStr.indexOf(n.charAt(i++)),f=this._keyStr.indexOf(n.charAt(i++)),r=this._keyStr.indexOf(n.charAt(i++)),e=this._keyStr.indexOf(n.charAt(i++)),o=c<<2|f>>4,s=(f&15)<<4|r>>2,h=(r&3)<<6|e,t=t+String.fromCharCode(o),r!=64&&(t=t+String.fromCharCode(s)),e!=64&&(t=t+String.fromCharCode(h));return u._utf8_decode(t)},_utf8_encode:function(n){n=n.replace(/\r\n/g,"\n");for(var i="",r=0;r<n.length;r++){var t=n.charCodeAt(r);t<128?i+=String.fromCharCode(t):t>127&&t<2048?(i+=String.fromCharCode(t>>6|192),i+=String.fromCharCode(t&63|128)):(i+=String.fromCharCode(t>>12|224),i+=String.fromCharCode(t>>6&63|128),i+=String.fromCharCode(t&63|128))}return i},_utf8_decode:function(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}}})(jQuery);window.ASL=window.ASL||{};window.ASL.getScope=function(){if(typeof jQuery!="undefined")if(typeof jQuery.fn.ajaxsearchlite=="undefined")for(var n=jQuery,t=jQuery,i=0;i<10;i++)if(typeof n.fn.ajaxsearchlite=="undefined")n=jQuery.noConflict(!0);else return n.fn.jquery!=t.fn.jquery&&(window.jQuery=window.$=t),n;else return jQuery;return typeof window[ASL.js_scope]!="undefined"?window[ASL.js_scope]:eval(ASL.js_scope)};window.ASL.initialized=!1;window.ASL.initialize=function(n){var i=this;if(typeof i.getScope=="undefined")return!1;var t=i.getScope(),u=".asl_init_data";if(typeof ASL_INSTANCES!="undefined"&&Object.keys(ASL_INSTANCES).length>0)t.each(ASL_INSTANCES,function(n,i){return typeof i=="undefined"?!1:t("#ajaxsearchlite"+n).hasClass("hasASL")?!1:(t("#ajaxsearchlite"+n).addClass("hasASL"),t("#ajaxsearchlite"+n).ajaxsearchlite(i))});else{typeof n!="undefined"&&(u="div[id*=asl_init_id_"+n+"]");function f(n){for(var r="",t=0,i=c1=c2=0;t<n.length;)i=n.charCodeAt(t),i<128?(r+=String.fromCharCode(i),t++):i>191&&i<224?(c2=n.charCodeAt(t+1),r+=String.fromCharCode((i&31)<<6|c2&63),t+=2):(c2=n.charCodeAt(t+1),c3=n.charCodeAt(t+2),r+=String.fromCharCode((i&15)<<12|(c2&63)<<6|c3&63),t+=3);return r}function e(n){var t="",s,h,c,l,e,r,o,i=0,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";for(n=n.replace(/[^A-Za-z0-9\+\/\=]/g,"");i<n.length;)l=u.indexOf(n.charAt(i++)),e=u.indexOf(n.charAt(i++)),r=u.indexOf(n.charAt(i++)),o=u.indexOf(n.charAt(i++)),s=l<<2|e>>4,h=(e&15)<<4|r>>2,c=(r&3)<<6|o,t=t+String.fromCharCode(s),r!=64&&(t=t+String.fromCharCode(h)),o!=64&&(t=t+String.fromCharCode(c));return f(t)}t(u).each(function(){var i=t(this).attr("id").match(/^asl_init_id_(.*)/)[1],n=t(this).data("asldata");if(typeof n=="undefined"||(n=e(n),typeof n=="undefined"||n==""))return!1;var r=JSON.parse(n);return t("#ajaxsearchlite"+i).addClass("hasASL"),t("#ajaxsearchlite"+i).ajaxsearchlite(r)})}if(i.highlight.enabled){var r=localStorage.getItem("asl_phrase_highlight");localStorage.removeItem("asl_phrase_highlight");r!=null&&(r=JSON.parse(r),t.each(i.highlight.data,function(n,i){var f=i.selector!=""&&t(i.selector).length>0?i.selector:"article";if(f=t(f).length>0?f:"body",t(f).highlight(r.phrase,{element:"span",className:"asl_single_highlighted",wordsOnly:i.whole,excludeParents:".asl_w, .asl-try"}),i.scroll&&t(".asl_single_highlighted").length>0){var u=t(".asl_single_highlighted").offset().top-120;t("#wpadminbar").length>0&&(u-=t("#wpadminbar").height());u=u+i.scroll_offset;u=u<0?0:u;t("html").animate({scrollTop:u},{duration:500})}return!1}))}i.initialized=!0};window.ASL.fixClones=function(){var t=this;if((t.fix_duplicates=t.fix_duplicates||0,t.fix_duplicates==0)||typeof t.getScope=="undefined")return!1;var n=t.getScope(),i={};n(".asl_init_data").each(function(){var t=n(this).attr("id").match(/^asl_init_id_(.*)/)[1];typeof i[t]=="undefined"?i[t]={rid:t,id:t,count:1}:i[t].count++});n.each(i,function(i,r){r.count>1&&n(".asl_m_"+r.rid).each(function(i){if(i==0)return!0;for(var f=n(this).parent(),u=r.id;n("#ajaxsearchlite"+u).length!=0;)u++;n(this).attr("id","ajaxsearchlite"+u);n(this).removeClass("asl_m_"+r.rid).addClass("asl_m_"+u);n(this).removeClass("hasASL");n(".asl_r_"+r.rid,this).length==0&&n(".asl_r_"+r.rid).clone().appendTo(n(this));n(".asl_r_"+r.rid,this).attr("id","ajaxsearchliteres"+u);n(".asl_r_"+r.rid,this).attr("data-id",u);n(".asl_r_"+r.rid,this).removeClass("asl_r_"+r.rid).addClass("asl_r_"+u);typeof ASL.resHTML!="undefined"&&n("#ajaxsearchliteres"+u).html(ASL.resHTML);n(".asl_s_"+r.rid,this).length==0&&n(".asl_s_"+r.rid).length!=0&&n(".asl_s_"+r.rid).clone().appendTo(n(this));n(".asl_sb_"+r.rid,this).length==0&&n(".asl_sb_"+r.rid).length!=0&&n(".asl_sb_"+r.rid).clone().appendTo(n(this));n(".asl_s_"+r.rid,this).attr("id","ajaxsearchlitesettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitesettings"+u).html(ASL.setHTML);n(".asl_sb_"+r.rid,f).attr("id","ajaxsearchlitebsettings"+u);typeof ASL.setHTML!="undefined"&&n("#ajaxsearchlitebsettings"+u).html(ASL.setHTML);n(".asl_hidden_data",f).length>0&&n(".asl_hidden_data",f).attr("id","asl_hidden_data_"+u);n(".asl_init_data",f).length>0&&n(".asl_init_data",f).attr("id","asl_init_id_"+u);t.initialize(u)})})};window.ASL.ready=function(){var t=this,i=t.getScope(),r=null;i(document).ready(function(){t.initialize();setTimeout(function(){t.fixClones()},2500)});i(window).on("load",function(){t.initialized||(t.initialize(),setTimeout(function(){t.fixClones()},2500),console.log("ASL initialized via window.load"))});typeof ASL.detect_ajax!="undefined"&&ASL.detect_ajax==1&&i("body").bind("DOMSubtreeModified",function(){clearTimeout(r);r=setTimeout(function(){t.initialize()},500)});var u;i(window).on("resize",function(){clearTimeout(u);u=setTimeout(function(){t.fixClones()},2e3)});var f,n="#menu-item-search, .fa-search, .fa, .fas";n=n+", .fusion-flyout-menu-toggle, .fusion-main-menu-search-open";n=n+", #search_button";n=n+", .mini-search.popup-search";n=n+", .icon-search";n=n+", .menu-item-search-dropdown";n=n+", .mobile-menu-button";n=n+", .td-icon-search, .tdb-search-icon";n=n+", .side_menu_button, .search_button";n=n+", .raven-search-form-toggle";n=n+", [data-elementor-open-lightbox], .elementor-button-link, .elementor-button";i(function(){i("body").on("click touchend",n,function(){clearTimeout(f);f=setTimeout(function(){t.initialize()},500)})})};window._ASL=ASL;window._ASL.ready();
js/nomin-scoped/asl_wrapper.js CHANGED
@@ -157,6 +157,32 @@ window.ASL.initialize = function(id) {
157
  });
158
  }
159
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
160
  _this.initialized = true;
161
  };
162
 
157
  });
158
  }
159
 
160
+ if ( _this.highlight.enabled ) {
161
+ var data = localStorage.getItem('asl_phrase_highlight');
162
+ localStorage.removeItem('asl_phrase_highlight');
163
+ if ( data != null ) {
164
+ data = JSON.parse(data);
165
+ scope.each(_this.highlight.data, function(i, o){
166
+ var selector = o.selector != '' && scope(o.selector).length > 0 ? o.selector : 'article';
167
+ selector = scope(selector).length > 0 ? selector : 'body';
168
+ scope(selector).highlight(data.phrase, { element: 'span', className: 'asl_single_highlighted', wordsOnly: o.whole, excludeParents : '.asl_w, .asl-try' });
169
+ if ( o.scroll && scope('.asl_single_highlighted').length > 0 ) {
170
+ var stop = scope('.asl_single_highlighted').offset().top - 120;
171
+ if (scope("#wpadminbar").length > 0)
172
+ stop -= scope("#wpadminbar").height();
173
+ stop = stop + o.scroll_offset;
174
+ stop = stop < 0 ? 0 : stop;
175
+ scope('html').animate({
176
+ "scrollTop": stop
177
+ }, {
178
+ duration: 500
179
+ });
180
+ }
181
+ return false;
182
+ });
183
+ }
184
+ }
185
+
186
  _this.initialized = true;
187
  };
188
 
js/nomin-scoped/jquery.ajaxsearchlite.js CHANGED
@@ -46,7 +46,6 @@
46
  itemsPerPage: 6
47
  };
48
 
49
- $this.firstClick = true;
50
  $this.post = null;
51
  $this.postAuto = null;
52
  $this.cleanUp();
@@ -337,8 +336,8 @@
337
  }
338
 
339
  // Some kind of crazy rev-slider fix
340
- $this.n.text.click(function(e){
341
- $(this).focus();
342
  $this.gaEvent('focus');
343
  });
344
 
@@ -353,7 +352,7 @@
353
  }
354
  });
355
 
356
- $($this.n.text.parent()).submit(function (e) {
357
  e.preventDefault();
358
  if ( isMobile() ) {
359
  if ( $this.o.redirect_on_enter ) {
@@ -370,16 +369,10 @@
370
  }
371
  });
372
 
373
- $this.n.text.click(function () {
374
- if ($this.firstClick) {
375
- $(this).val('');
376
- $this.firstClick = false;
377
- }
378
- });
379
  $this.n.resultsDiv.css({
380
  opacity: 0
381
  });
382
- $(document).bind("click touchend", function () {
383
  $this.hideSettings();
384
  if ($this.opened == false || $this.o.closeOnDocClick != 1) return;
385
  $this.hideResults();
@@ -388,15 +381,15 @@
388
  $this.n.text.val("");
389
  $this.n.textAutocomplete.val("");
390
  $this.hideResults();
391
- $this.n.text.focus();
392
  });
393
- $($this.elem).bind("click touchend", function (e) {
394
  e.stopImmediatePropagation();
395
  });
396
- $this.n.resultsDiv.bind("click touchend", function (e) {
397
  e.stopImmediatePropagation();
398
  });
399
- $this.n.searchsettings.bind("click touchend", function (e) {
400
  e.stopImmediatePropagation();
401
  });
402
 
@@ -448,7 +441,7 @@
448
  });
449
 
450
  // Prevent zoom on IOS
451
- if ( detectIOS() && isMobile() && is_touch_device() ) {
452
  if ( parseInt($this.n.text.css('font-size')) < 16 ) {
453
  $this.n.text.data('fontSize', $this.n.text.css('font-size')).css('font-size', '16px');
454
  $this.n.textAutocomplete.css('font-size', '16px');
@@ -494,7 +487,7 @@
494
  $('input[type="checkbox"]', _this).trigger('asl_chbx_change');
495
  }, 50);
496
  });
497
- $('div.asl_option label', $this.n.searchsettings).click(function(e){
498
  e.preventDefault(); // Let the previous handler handle the events, disable this
499
  });
500
 
@@ -504,7 +497,33 @@
504
  'result_title': $(this).find('a.asl_res_url').text(),
505
  'result_url': $(this).find('a.asl_res_url').attr('href')
506
  });
 
 
 
 
 
 
 
 
 
 
507
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
508
  },
509
 
510
  initNavigationEvent: function () {
@@ -522,7 +541,7 @@
522
  }
523
  );
524
 
525
- $(document).keydown(function (e) {
526
 
527
  if (window.event) {
528
  var keycode = window.event.keyCode;
@@ -626,7 +645,7 @@
626
  }
627
  });
628
 
629
- $this.n.promagnifier.add($this.n.text).bind('click input', function (e) {
630
  if (window.event) {
631
  $this.keycode = window.event.keyCode;
632
  $this.ktype = window.event.type;
@@ -782,6 +801,11 @@
782
  var url = $this.o.redirect_url.replace('{phrase}', asl_nice_phrase($this.n.text.val()));
783
  }
784
 
 
 
 
 
 
785
  if ( $this.o.overridewpdefault ) {
786
  if ( $this.o.override_method == "post") {
787
  asl_submit_to_url($this.o.homeurl + url, 'post', {
@@ -789,7 +813,7 @@
789
  p_asl_data: $('form', $this.n.searchsettings).serialize()
790
  }, _loc);
791
  } else {
792
- var _url = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=" + Base64.encode($('form', $this.n.searchsettings).serialize());
793
  if ( _loc == 'same' )
794
  location.href = _url;
795
  else
@@ -821,8 +845,8 @@
821
  var $this = this;
822
  var tt;
823
 
824
- if ($this.o.autocomplete.enabled == 1 && !isMobile()) {
825
- $this.n.text.keyup(function (e) {
826
  if (window.event) {
827
  $this.keycode = window.event.keyCode;
828
  $this.ktype = window.event.type;
@@ -906,6 +930,8 @@
906
  options: $('form', $this.n.searchsettings).serialize()
907
  };
908
 
 
 
909
  if ( JSON.stringify(data) === JSON.stringify($this.lastSearchData) ) {
910
  if ( !$this.resultsOpened )
911
  $this.showResults();
@@ -924,14 +950,14 @@
924
  response = response.replace(/^\s*[\r\n]/gm, "");
925
  response = response.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];
926
 
927
- // bye bye JSON
928
 
929
  $this.n.resdrg.html("");
930
  $this.n.resdrg.html(response);
931
 
932
- $(".asl_keyword", $this.n.resdrg).bind('click', function () {
933
  $this.n.text.val($(this).html());
934
- $('input.orig', $this.n.container).val($(this).html()).keydown();
935
  $('form', $this.n.container).trigger('submit', 'ajax');
936
  $this.search();
937
  });
@@ -981,7 +1007,7 @@
981
  p_asl_data: $('form', $this.n.searchsettings).serialize()
982
  });
983
  } else {
984
- location.href = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=" + Base64.encode($('form', $this.n.searchsettings).serialize());
985
  }
986
  } else {
987
  asl_submit_to_url($this.o.homeurl + url, 'post', {
@@ -1238,7 +1264,7 @@
1238
  "visibility": "visible",
1239
  "display": "block",
1240
  "opacity": 1,
1241
- "animation-duration": animDur
1242
  },
1243
  "hideClass": "asl_an_fadeOutDrop",
1244
  "hideCSS": {
@@ -1265,7 +1291,7 @@
1265
  "visibility": "visible",
1266
  "display": "block",
1267
  "opacity": 1,
1268
- "animation-duration": animDur
1269
  },
1270
  "hideClass": "asl_an_fadeOutDrop",
1271
  "hideCSS": {
@@ -1436,8 +1462,12 @@
1436
  }
1437
  };
1438
 
1439
- function is_touch_device() {
1440
- return !!("ontouchstart" in window) ? 1 : 0;
 
 
 
 
1441
  }
1442
 
1443
  /* Mobile detection - Touch desktop device safe! */
@@ -1457,8 +1487,8 @@
1457
  if (this.name && !this.disabled && (this.checked
1458
  || /select|textarea/i.test(this.nodeName)
1459
  || /text/i.test(this.type)) &&
1460
- !$(this).hasClass('asp_datepicker_field') &&
1461
- !$(this).hasClass('asp_datepicker')
1462
  ) {
1463
  if(data[this.name] == undefined){
1464
  data[this.name] = [];
@@ -1502,6 +1532,10 @@
1502
  return encodeURIComponent(s).replace(/\%20/g, '+');
1503
  }
1504
 
 
 
 
 
1505
  function asl_submit_to_url(action, method, input, target) {
1506
  'use strict';
1507
  var form;
@@ -1521,7 +1555,7 @@
1521
  }
1522
  if ( typeof (target) != 'undefined' && target == 'new')
1523
  form.attr('target', '_blank');
1524
- form.appendTo('body').submit();
1525
  }
1526
 
1527
  function open_in_new_tab(url) {
46
  itemsPerPage: 6
47
  };
48
 
 
49
  $this.post = null;
50
  $this.postAuto = null;
51
  $this.cleanUp();
336
  }
337
 
338
  // Some kind of crazy rev-slider fix
339
+ $this.n.text.on('click', function(e){
340
+ $(this).trigger('focus');
341
  $this.gaEvent('focus');
342
  });
343
 
352
  }
353
  });
354
 
355
+ $($this.n.text.parent()).on('submit', function (e) {
356
  e.preventDefault();
357
  if ( isMobile() ) {
358
  if ( $this.o.redirect_on_enter ) {
369
  }
370
  });
371
 
 
 
 
 
 
 
372
  $this.n.resultsDiv.css({
373
  opacity: 0
374
  });
375
+ $(document).on("click touchend", function () {
376
  $this.hideSettings();
377
  if ($this.opened == false || $this.o.closeOnDocClick != 1) return;
378
  $this.hideResults();
381
  $this.n.text.val("");
382
  $this.n.textAutocomplete.val("");
383
  $this.hideResults();
384
+ $this.n.text.trigger('focus');
385
  });
386
+ $($this.elem).on("click touchend", function (e) {
387
  e.stopImmediatePropagation();
388
  });
389
+ $this.n.resultsDiv.on("click touchend", function (e) {
390
  e.stopImmediatePropagation();
391
  });
392
+ $this.n.searchsettings.on("click touchend", function (e) {
393
  e.stopImmediatePropagation();
394
  });
395
 
441
  });
442
 
443
  // Prevent zoom on IOS
444
+ if ( detectIOS() && isMobile() ) {
445
  if ( parseInt($this.n.text.css('font-size')) < 16 ) {
446
  $this.n.text.data('fontSize', $this.n.text.css('font-size')).css('font-size', '16px');
447
  $this.n.textAutocomplete.css('font-size', '16px');
487
  $('input[type="checkbox"]', _this).trigger('asl_chbx_change');
488
  }, 50);
489
  });
490
+ $('div.asl_option label', $this.n.searchsettings).on('click', function(e){
491
  e.preventDefault(); // Let the previous handler handle the events, disable this
492
  });
493
 
497
  'result_title': $(this).find('a.asl_res_url').text(),
498
  'result_url': $(this).find('a.asl_res_url').attr('href')
499
  });
500
+
501
+ // Results highlight on results page
502
+ if ( $this.o.singleHighlight == 1 ) {
503
+ localStorage.removeItem('asl_phrase_highlight');
504
+ if ( asl_unquote_phrase( $this.n.text.val() ) != '' )
505
+ localStorage.setItem('asl_phrase_highlight', JSON.stringify({
506
+ 'phrase': asl_unquote_phrase( $this.n.text.val() ),
507
+ 'id': $this.o.id
508
+ }));
509
+ }
510
  });
511
+
512
+ // Mobile navigation focus
513
+ if ( isMobile() && $this.o.mobile.menu_selector != '' ) {
514
+ $($this.o.mobile.menu_selector).on('touchend', function(){
515
+ var _this = this;
516
+ setTimeout(function () {
517
+ var $input = $(_this).find('input.orig');
518
+ $input = $input.length == 0 ? $(_this).next().find('input.orig') : $input;
519
+ $input = $input.length == 0 ? $(_this).parent().find('input.orig') : $input;
520
+ $input = $input.length == 0 ? $this.n.text : $input;
521
+ if ( $this.n.container.is(':visible') ) {
522
+ $input.get(0).focus();
523
+ }
524
+ }, 300);
525
+ });
526
+ }
527
  },
528
 
529
  initNavigationEvent: function () {
541
  }
542
  );
543
 
544
+ $(document).on('keydown', function (e) {
545
 
546
  if (window.event) {
547
  var keycode = window.event.keyCode;
645
  }
646
  });
647
 
648
+ $this.n.promagnifier.add($this.n.text).on('click input', function (e) {
649
  if (window.event) {
650
  $this.keycode = window.event.keyCode;
651
  $this.ktype = window.event.type;
801
  var url = $this.o.redirect_url.replace('{phrase}', asl_nice_phrase($this.n.text.val()));
802
  }
803
 
804
+ // Is this an URL like xy.com/?x=y
805
+ if ( $this.o.homeurl.indexOf('?') > 1 && url.indexOf('?') === 0 ) {
806
+ url = url.replace('?', '&');
807
+ }
808
+
809
  if ( $this.o.overridewpdefault ) {
810
  if ( $this.o.override_method == "post") {
811
  asl_submit_to_url($this.o.homeurl + url, 'post', {
813
  p_asl_data: $('form', $this.n.searchsettings).serialize()
814
  }, _loc);
815
  } else {
816
+ var _url = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=1&" + $('form', $this.n.searchsettings).serialize();
817
  if ( _loc == 'same' )
818
  location.href = _url;
819
  else
845
  var $this = this;
846
  var tt;
847
 
848
+ if ( $this.o.autocomplete.enabled == 1 && !isMobile() ) {
849
+ $this.n.text.on('keyup', function (e) {
850
  if (window.event) {
851
  $this.keycode = window.event.keyCode;
852
  $this.ktype = window.event.type;
930
  options: $('form', $this.n.searchsettings).serialize()
931
  };
932
 
933
+ data = apply_filters('asl_search_data', data);
934
+
935
  if ( JSON.stringify(data) === JSON.stringify($this.lastSearchData) ) {
936
  if ( !$this.resultsOpened )
937
  $this.showResults();
950
  response = response.replace(/^\s*[\r\n]/gm, "");
951
  response = response.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];
952
 
953
+ response = apply_filters('asl_search_html', response);
954
 
955
  $this.n.resdrg.html("");
956
  $this.n.resdrg.html(response);
957
 
958
+ $(".asl_keyword", $this.n.resdrg).on('click', function () {
959
  $this.n.text.val($(this).html());
960
+ $('input.orig', $this.n.container).val($(this).html()).trigger('keydown');
961
  $('form', $this.n.container).trigger('submit', 'ajax');
962
  $this.search();
963
  });
1007
  p_asl_data: $('form', $this.n.searchsettings).serialize()
1008
  });
1009
  } else {
1010
+ location.href = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=1&" + $('form', $this.n.searchsettings).serialize()
1011
  }
1012
  } else {
1013
  asl_submit_to_url($this.o.homeurl + url, 'post', {
1264
  "visibility": "visible",
1265
  "display": "block",
1266
  "opacity": 1,
1267
+ "animation-duration": animDur + 'ms'
1268
  },
1269
  "hideClass": "asl_an_fadeOutDrop",
1270
  "hideCSS": {
1291
  "visibility": "visible",
1292
  "display": "block",
1293
  "opacity": 1,
1294
+ "animation-duration": animDur + 'ms'
1295
  },
1296
  "hideClass": "asl_an_fadeOutDrop",
1297
  "hideCSS": {
1462
  }
1463
  };
1464
 
1465
+ function apply_filters() {
1466
+ if ( typeof wp != 'undefined' && typeof wp.hooks != 'undefined' && typeof wp.hooks.applyFilters != 'undefined' ) {
1467
+ return wp.hooks.applyFilters.apply(null, arguments);
1468
+ } else {
1469
+ return typeof arguments[1] != 'undefined' ? arguments[1] : false;
1470
+ }
1471
  }
1472
 
1473
  /* Mobile detection - Touch desktop device safe! */
1487
  if (this.name && !this.disabled && (this.checked
1488
  || /select|textarea/i.test(this.nodeName)
1489
  || /text/i.test(this.type)) &&
1490
+ !$(this).hasClass('asl_datepicker_field') &&
1491
+ !$(this).hasClass('asl_datepicker')
1492
  ) {
1493
  if(data[this.name] == undefined){
1494
  data[this.name] = [];
1532
  return encodeURIComponent(s).replace(/\%20/g, '+');
1533
  }
1534
 
1535
+ function asl_unquote_phrase(s) {
1536
+ return s.replace(/"|'/g, '');
1537
+ }
1538
+
1539
  function asl_submit_to_url(action, method, input, target) {
1540
  'use strict';
1541
  var form;
1555
  }
1556
  if ( typeof (target) != 'undefined' && target == 'new')
1557
  form.attr('target', '_blank');
1558
+ form.appendTo('body').trigger('submit');
1559
  }
1560
 
1561
  function open_in_new_tab(url) {
js/nomin-scoped/jquery.gestures.js DELETED
@@ -1,3 +0,0 @@
1
- (function(jQuery, $, window){
2
- (function(a){if(typeof define==="function"&&false&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{if(typeof module!=="undefined"&&false&&module.exports){a(require("jquery"))}else{a(jQuery)}}}(function(f){var y="1.6.15",p="left",o="right",e="up",x="down",c="in",A="out",m="none",s="auto",l="swipe",t="pinch",B="tap",j="doubletap",b="longtap",z="hold",E="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!a,d=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!a,C="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:true};f.fn.swipe=function(H){var G=f(this),F=G.data(C);if(F&&typeof H==="string"){if(F[H]){return F[H].apply(this,Array.prototype.slice.call(arguments,1))}else{f.error("Method "+H+" does not exist on jQuery.swipe")}}else{if(F&&typeof H==="object"){F.option.apply(this,arguments)}else{if(!F&&(typeof H==="object"||!H)){return w.apply(this,arguments)}}}return G};f.fn.swipe.version=y;f.fn.swipe.defaults=n;f.fn.swipe.phases={PHASE_START:g,PHASE_MOVE:k,PHASE_END:h,PHASE_CANCEL:q};f.fn.swipe.directions={LEFT:p,RIGHT:o,UP:e,DOWN:x,IN:c,OUT:A};f.fn.swipe.pageScroll={NONE:m,HORIZONTAL:E,VERTICAL:u,AUTO:s};f.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:i};function w(F){if(F&&(F.allowPageScroll===undefined&&(F.swipe!==undefined||F.swipeStatus!==undefined))){F.allowPageScroll=m}if(F.click!==undefined&&F.tap===undefined){F.tap=F.click}if(!F){F={}}F=f.extend({},f.fn.swipe.defaults,F);return this.each(function(){var H=f(this);var G=H.data(C);if(!G){G=new D(this,F);H.data(C,G)}})}function D(a5,au){var au=f.extend({},au);var az=(a||d||!au.fallbackToMouseEvents),K=az?(d?(v?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",ax=az?(d?(v?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",V=az?(d?(v?"MSPointerUp":"pointerup"):"touchend"):"mouseup",T=az?(d?"mouseleave":null):"mouseleave",aD=(d?(v?"MSPointerCancel":"pointercancel"):"touchcancel");var ag=0,aP=null,a2=null,ac=0,a1=0,aZ=0,H=1,ap=0,aJ=0,N=null;var aR=f(a5);var aa="start";var X=0;var aQ={};var U=0,a3=0,a6=0,ay=0,O=0;var aW=null,af=null;try{aR.bind(K,aN);aR.bind(aD,ba)}catch(aj){f.error("events not supported "+K+","+aD+" on jQuery.swipe")}this.enable=function(){aR.bind(K,aN);aR.bind(aD,ba);return aR};this.disable=function(){aK();return aR};this.destroy=function(){aK();aR.data(C,null);aR=null};this.option=function(bd,bc){if(typeof bd==="object"){au=f.extend(au,bd)}else{if(au[bd]!==undefined){if(bc===undefined){return au[bd]}else{au[bd]=bc}}else{if(!bd){return au}else{f.error("Option "+bd+" does not exist on jQuery.swipe.options")}}}return null};function aN(be){if(aB()){return}if(f(be.target).closest(au.excludedElements,aR).length>0){return}var bf=be.originalEvent?be.originalEvent:be;var bd,bg=bf.touches,bc=bg?bg[0]:bf;aa=g;if(bg){X=bg.length}else{if(au.preventDefaultEvents!==false){be.preventDefault()}}ag=0;aP=null;a2=null;aJ=null;ac=0;a1=0;aZ=0;H=1;ap=0;N=ab();S();ai(0,bc);if(!bg||(X===au.fingers||au.fingers===i)||aX()){U=ar();if(X==2){ai(1,bg[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}if(au.swipeStatus||au.pinchStatus){bd=P(bf,aa)}}else{bd=false}if(bd===false){aa=q;P(bf,aa);return bd}else{if(au.hold){af=setTimeout(f.proxy(function(){aR.trigger("hold",[bf.target]);if(au.hold){bd=au.hold.call(aR,bf,bf.target)}},this),au.longTapThreshold)}an(true)}return null}function a4(bf){var bi=bf.originalEvent?bf.originalEvent:bf;if(aa===h||aa===q||al()){return}var be,bj=bi.touches,bd=bj?bj[0]:bi;var bg=aH(bd);a3=ar();if(bj){X=bj.length}if(au.hold){clearTimeout(af)}aa=k;if(X==2){if(a1==0){ai(1,bj[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}else{aH(bj[1]);aZ=at(aQ[0].end,aQ[1].end);aJ=aq(aQ[0].end,aQ[1].end)}H=a8(a1,aZ);ap=Math.abs(a1-aZ)}if((X===au.fingers||au.fingers===i)||!bj||aX()){aP=aL(bg.start,bg.end);a2=aL(bg.last,bg.end);ak(bf,a2);ag=aS(bg.start,bg.end);ac=aM();aI(aP,ag);be=P(bi,aa);if(!au.triggerOnTouchEnd||au.triggerOnTouchLeave){var bc=true;if(au.triggerOnTouchLeave){var bh=aY(this);bc=F(bg.end,bh)}if(!au.triggerOnTouchEnd&&bc){aa=aC(k)}else{if(au.triggerOnTouchLeave&&!bc){aa=aC(h)}}if(aa==q||aa==h){P(bi,aa)}}}else{aa=q;P(bi,aa)}if(be===false){aa=q;P(bi,aa)}}function M(bc){var bd=bc.originalEvent?bc.originalEvent:bc,be=bd.touches;if(be){if(be.length&&!al()){G(bd);return true}else{if(be.length&&al()){return true}}}if(al()){X=ay}a3=ar();ac=aM();if(bb()||!am()){aa=q;P(bd,aa)}else{if(au.triggerOnTouchEnd||(au.triggerOnTouchEnd==false&&aa===k)){if(au.preventDefaultEvents!==false){bc.preventDefault()}aa=h;P(bd,aa)}else{if(!au.triggerOnTouchEnd&&a7()){aa=h;aF(bd,aa,B)}else{if(aa===k){aa=q;P(bd,aa)}}}}an(false);return null}function ba(){X=0;a3=0;U=0;a1=0;aZ=0;H=1;S();an(false)}function L(bc){var bd=bc.originalEvent?bc.originalEvent:bc;if(au.triggerOnTouchLeave){aa=aC(h);P(bd,aa)}}function aK(){aR.unbind(K,aN);aR.unbind(aD,ba);aR.unbind(ax,a4);aR.unbind(V,M);if(T){aR.unbind(T,L)}an(false)}function aC(bg){var bf=bg;var be=aA();var bd=am();var bc=bb();if(!be||bc){bf=q}else{if(bd&&bg==k&&(!au.triggerOnTouchEnd||au.triggerOnTouchLeave)){bf=h}else{if(!bd&&bg==h&&au.triggerOnTouchLeave){bf=q}}}return bf}function P(be,bc){var bd,bf=be.touches;if(J()||W()){bd=aF(be,bc,l)}if((Q()||aX())&&bd!==false){bd=aF(be,bc,t)}if(aG()&&bd!==false){bd=aF(be,bc,j)}else{if(ao()&&bd!==false){bd=aF(be,bc,b)}else{if(ah()&&bd!==false){bd=aF(be,bc,B)}}}if(bc===q){if(W()){bd=aF(be,bc,l)}if(aX()){bd=aF(be,bc,t)}ba(be)}if(bc===h){if(bf){if(!bf.length){ba(be)}}else{ba(be)}}return bd}function aF(bf,bc,be){var bd;if(be==l){aR.trigger("swipeStatus",[bc,aP||null,ag||0,ac||0,X,aQ,a2]);if(au.swipeStatus){bd=au.swipeStatus.call(aR,bf,bc,aP||null,ag||0,ac||0,X,aQ,a2);if(bd===false){return false}}if(bc==h&&aV()){clearTimeout(aW);clearTimeout(af);aR.trigger("swipe",[aP,ag,ac,X,aQ,a2]);if(au.swipe){bd=au.swipe.call(aR,bf,aP,ag,ac,X,aQ,a2);if(bd===false){return false}}switch(aP){case p:aR.trigger("swipeLeft",[aP,ag,ac,X,aQ,a2]);if(au.swipeLeft){bd=au.swipeLeft.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case o:aR.trigger("swipeRight",[aP,ag,ac,X,aQ,a2]);if(au.swipeRight){bd=au.swipeRight.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case e:aR.trigger("swipeUp",[aP,ag,ac,X,aQ,a2]);if(au.swipeUp){bd=au.swipeUp.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case x:aR.trigger("swipeDown",[aP,ag,ac,X,aQ,a2]);if(au.swipeDown){bd=au.swipeDown.call(aR,bf,aP,ag,ac,X,aQ,a2)}break}}}if(be==t){aR.trigger("pinchStatus",[bc,aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchStatus){bd=au.pinchStatus.call(aR,bf,bc,aJ||null,ap||0,ac||0,X,H,aQ);if(bd===false){return false}}if(bc==h&&a9()){switch(aJ){case c:aR.trigger("pinchIn",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchIn){bd=au.pinchIn.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break;case A:aR.trigger("pinchOut",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchOut){bd=au.pinchOut.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break}}}if(be==B){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);if(Z()&&!I()){O=ar();aW=setTimeout(f.proxy(function(){O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}},this),au.doubleTapThreshold)}else{O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}}}}else{if(be==j){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);O=null;aR.trigger("doubletap",[bf.target]);if(au.doubleTap){bd=au.doubleTap.call(aR,bf,bf.target)}}}else{if(be==b){if(bc===q||bc===h){clearTimeout(aW);O=null;aR.trigger("longtap",[bf.target]);if(au.longTap){bd=au.longTap.call(aR,bf,bf.target)}}}}}return bd}function am(){var bc=true;if(au.threshold!==null){bc=ag>=au.threshold}return bc}function bb(){var bc=false;if(au.cancelThreshold!==null&&aP!==null){bc=(aT(aP)-ag)>=au.cancelThreshold}return bc}function ae(){if(au.pinchThreshold!==null){return ap>=au.pinchThreshold}return true}function aA(){var bc;if(au.maxTimeThreshold){if(ac>=au.maxTimeThreshold){bc=false}else{bc=true}}else{bc=true}return bc}function ak(bc,bd){if(au.preventDefaultEvents===false){return}if(au.allowPageScroll===m){bc.preventDefault()}else{var be=au.allowPageScroll===s;switch(bd){case p:if((au.swipeLeft&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case o:if((au.swipeRight&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case e:if((au.swipeUp&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break;case x:if((au.swipeDown&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break}}}function a9(){var bd=aO();var bc=Y();var be=ae();return bd&&bc&&be}function aX(){return !!(au.pinchStatus||au.pinchIn||au.pinchOut)}function Q(){return !!(a9()&&aX())}function aV(){var bf=aA();var bh=am();var be=aO();var bc=Y();var bd=bb();var bg=!bd&&bc&&be&&bh&&bf;return bg}function W(){return !!(au.swipe||au.swipeStatus||au.swipeLeft||au.swipeRight||au.swipeUp||au.swipeDown)}function J(){return !!(aV()&&W())}function aO(){return((X===au.fingers||au.fingers===i)||!a)}function Y(){return aQ[0].end.x!==0}function a7(){return !!(au.tap)}function Z(){return !!(au.doubleTap)}function aU(){return !!(au.longTap)}function R(){if(O==null){return false}var bc=ar();return(Z()&&((bc-O)<=au.doubleTapThreshold))}function I(){return R()}function aw(){return((X===1||!a)&&(isNaN(ag)||ag<au.threshold))}function a0(){return((ac>au.longTapThreshold)&&(ag<r))}function ah(){return !!(aw()&&a7())}function aG(){return !!(R()&&Z())}function ao(){return !!(a0()&&aU())}function G(bc){a6=ar();ay=bc.touches.length+1}function S(){a6=0;ay=0}function al(){var bc=false;if(a6){var bd=ar()-a6;if(bd<=au.fingerReleaseThreshold){bc=true}}return bc}function aB(){return !!(aR.data(C+"_intouch")===true)}function an(bc){if(!aR){return}if(bc===true){aR.bind(ax,a4);aR.bind(V,M);if(T){aR.bind(T,L)}}else{aR.unbind(ax,a4,false);aR.unbind(V,M,false);if(T){aR.unbind(T,L,false)}}aR.data(C+"_intouch",bc===true)}function ai(be,bc){var bd={start:{x:0,y:0},last:{x:0,y:0},end:{x:0,y:0}};bd.start.x=bd.last.x=bd.end.x=bc.pageX||bc.clientX;bd.start.y=bd.last.y=bd.end.y=bc.pageY||bc.clientY;aQ[be]=bd;return bd}function aH(bc){var be=bc.identifier!==undefined?bc.identifier:0;var bd=ad(be);if(bd===null){bd=ai(be,bc)}bd.last.x=bd.end.x;bd.last.y=bd.end.y;bd.end.x=bc.pageX||bc.clientX;bd.end.y=bc.pageY||bc.clientY;return bd}function ad(bc){return aQ[bc]||null}function aI(bc,bd){bd=Math.max(bd,aT(bc));N[bc].distance=bd}function aT(bc){if(N[bc]){return N[bc].distance}return undefined}function ab(){var bc={};bc[p]=av(p);bc[o]=av(o);bc[e]=av(e);bc[x]=av(x);return bc}function av(bc){return{direction:bc,distance:0}}function aM(){return a3-U}function at(bf,be){var bd=Math.abs(bf.x-be.x);var bc=Math.abs(bf.y-be.y);return Math.round(Math.sqrt(bd*bd+bc*bc))}function a8(bc,bd){var be=(bd/bc)*1;return be.toFixed(2)}function aq(){if(H<1){return A}else{return c}}function aS(bd,bc){return Math.round(Math.sqrt(Math.pow(bc.x-bd.x,2)+Math.pow(bc.y-bd.y,2)))}function aE(bf,bd){var bc=bf.x-bd.x;var bh=bd.y-bf.y;var be=Math.atan2(bh,bc);var bg=Math.round(be*180/Math.PI);if(bg<0){bg=360-Math.abs(bg)}return bg}function aL(bd,bc){var be=aE(bd,bc);if((be<=45)&&(be>=0)){return p}else{if((be<=360)&&(be>=315)){return p}else{if((be>=135)&&(be<=225)){return o}else{if((be>45)&&(be<135)){return x}else{return e}}}}}function ar(){var bc=new Date();return bc.getTime()}function aY(bc){bc=f(bc);var be=bc.offset();var bd={left:be.left,right:be.left+bc.outerWidth(),top:be.top,bottom:be.top+bc.outerHeight()};return bd}function F(bc,bd){return(bc.x>bd.left&&bc.x<bd.right&&bc.y>bd.top&&bc.y<bd.bottom)}}}));
3
- })(asljQuery, asljQuery, window);
 
 
 
js/nomin-scoped/jquery.highlight.js CHANGED
@@ -10,9 +10,11 @@
10
  *
11
  */
12
  jQuery.extend({
13
- highlight: function (node, re, nodeName, className) {
 
14
  if (node.nodeType === 3) {
15
- var match = node.data.match(re);
 
16
  if (match) {
17
  var highlight = document.createElement(nodeName || 'span');
18
  highlight.className = className || 'highlight';
@@ -29,9 +31,10 @@ jQuery.extend({
29
  }
30
  } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children
31
  !/(script|style)/i.test(node.tagName) && // ignore script and style nodes
 
32
  !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted
33
  for (var i = 0; i < node.childNodes.length; i++) {
34
- i += jQuery.highlight(node.childNodes[i], re, nodeName, className);
35
  }
36
  }
37
  return 0;
@@ -50,7 +53,7 @@ jQuery.fn.unhighlight = function (options) {
50
  };
51
 
52
  jQuery.fn.highlight = function (words, options) {
53
- var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false };
54
  jQuery.extend(settings, options);
55
 
56
  if (words.constructor === String) {
@@ -60,7 +63,7 @@ jQuery.fn.highlight = function (words, options) {
60
  return word != '';
61
  });
62
  words = jQuery.map(words, function(word, i) {
63
- return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
64
  });
65
  if (words.length == 0) { return this; };
66
 
@@ -72,7 +75,7 @@ jQuery.fn.highlight = function (words, options) {
72
  var re = new RegExp(pattern, flag);
73
 
74
  return this.each(function () {
75
- jQuery.highlight(this, re, settings.element, settings.className);
76
  });
77
  };
78
  })(asljQuery, asljQuery, window);
10
  *
11
  */
12
  jQuery.extend({
13
+ highlight: function (node, re, nodeName, className, excludeParents) {
14
+ excludeParents = excludeParents == '' ? '.exhghttt' : excludeParents;
15
  if (node.nodeType === 3) {
16
+ var normalized = node.data.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
17
+ var match = normalized.match(re);
18
  if (match) {
19
  var highlight = document.createElement(nodeName || 'span');
20
  highlight.className = className || 'highlight';
31
  }
32
  } else if ((node.nodeType === 1 && node.childNodes) && // only element nodes that have children
33
  !/(script|style)/i.test(node.tagName) && // ignore script and style nodes
34
+ !jQuery(node).closest(excludeParents).length > 0 &&
35
  !(node.tagName === nodeName.toUpperCase() && node.className === className)) { // skip if already highlighted
36
  for (var i = 0; i < node.childNodes.length; i++) {
37
+ i += jQuery.highlight(node.childNodes[i], re, nodeName, className, excludeParents);
38
  }
39
  }
40
  return 0;
53
  };
54
 
55
  jQuery.fn.highlight = function (words, options) {
56
+ var settings = { className: 'highlight', element: 'span', caseSensitive: false, wordsOnly: false, excludeParents: '' };
57
  jQuery.extend(settings, options);
58
 
59
  if (words.constructor === String) {
63
  return word != '';
64
  });
65
  words = jQuery.map(words, function(word, i) {
66
+ return word.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, "");
67
  });
68
  if (words.length == 0) { return this; };
69
 
75
  var re = new RegExp(pattern, flag);
76
 
77
  return this.each(function () {
78
+ jQuery.highlight(this, re, settings.element, settings.className, settings.excludeParents);
79
  });
80
  };
81
  })(asljQuery, asljQuery, window);
js/nomin/asl_wrapper.js CHANGED
@@ -156,6 +156,32 @@ window.ASL.initialize = function(id) {
156
  });
157
  }
158
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
159
  _this.initialized = true;
160
  };
161
 
156
  });
157
  }
158
 
159
+ if ( _this.highlight.enabled ) {
160
+ var data = localStorage.getItem('asl_phrase_highlight');
161
+ localStorage.removeItem('asl_phrase_highlight');
162
+ if ( data != null ) {
163
+ data = JSON.parse(data);
164
+ scope.each(_this.highlight.data, function(i, o){
165
+ var selector = o.selector != '' && scope(o.selector).length > 0 ? o.selector : 'article';
166
+ selector = scope(selector).length > 0 ? selector : 'body';
167
+ scope(selector).highlight(data.phrase, { element: 'span', className: 'asl_single_highlighted', wordsOnly: o.whole, excludeParents : '.asl_w, .asl-try' });
168
+ if ( o.scroll && scope('.asl_single_highlighted').length > 0 ) {
169
+ var stop = scope('.asl_single_highlighted').offset().top - 120;
170
+ if (scope("#wpadminbar").length > 0)
171
+ stop -= scope("#wpadminbar").height();
172
+ stop = stop + o.scroll_offset;
173
+ stop = stop < 0 ? 0 : stop;
174
+ scope('html').animate({
175
+ "scrollTop": stop
176
+ }, {
177
+ duration: 500
178
+ });
179
+ }
180
+ return false;
181
+ });
182
+ }
183
+ }
184
+
185
  _this.initialized = true;
186
  };
187
 
js/nomin/jquery.ajaxsearchlite.js CHANGED
@@ -45,7 +45,6 @@
45
  itemsPerPage: 6
46
  };
47
 
48
- $this.firstClick = true;
49
  $this.post = null;
50
  $this.postAuto = null;
51
  $this.cleanUp();
@@ -336,8 +335,8 @@
336
  }
337
 
338
  // Some kind of crazy rev-slider fix
339
- $this.n.text.click(function(e){
340
- $(this).focus();
341
  $this.gaEvent('focus');
342
  });
343
 
@@ -352,7 +351,7 @@
352
  }
353
  });
354
 
355
- $($this.n.text.parent()).submit(function (e) {
356
  e.preventDefault();
357
  if ( isMobile() ) {
358
  if ( $this.o.redirect_on_enter ) {
@@ -369,16 +368,10 @@
369
  }
370
  });
371
 
372
- $this.n.text.click(function () {
373
- if ($this.firstClick) {
374
- $(this).val('');
375
- $this.firstClick = false;
376
- }
377
- });
378
  $this.n.resultsDiv.css({
379
  opacity: 0
380
  });
381
- $(document).bind("click touchend", function () {
382
  $this.hideSettings();
383
  if ($this.opened == false || $this.o.closeOnDocClick != 1) return;
384
  $this.hideResults();
@@ -387,15 +380,15 @@
387
  $this.n.text.val("");
388
  $this.n.textAutocomplete.val("");
389
  $this.hideResults();
390
- $this.n.text.focus();
391
  });
392
- $($this.elem).bind("click touchend", function (e) {
393
  e.stopImmediatePropagation();
394
  });
395
- $this.n.resultsDiv.bind("click touchend", function (e) {
396
  e.stopImmediatePropagation();
397
  });
398
- $this.n.searchsettings.bind("click touchend", function (e) {
399
  e.stopImmediatePropagation();
400
  });
401
 
@@ -447,7 +440,7 @@
447
  });
448
 
449
  // Prevent zoom on IOS
450
- if ( detectIOS() && isMobile() && is_touch_device() ) {
451
  if ( parseInt($this.n.text.css('font-size')) < 16 ) {
452
  $this.n.text.data('fontSize', $this.n.text.css('font-size')).css('font-size', '16px');
453
  $this.n.textAutocomplete.css('font-size', '16px');
@@ -493,7 +486,7 @@
493
  $('input[type="checkbox"]', _this).trigger('asl_chbx_change');
494
  }, 50);
495
  });
496
- $('div.asl_option label', $this.n.searchsettings).click(function(e){
497
  e.preventDefault(); // Let the previous handler handle the events, disable this
498
  });
499
 
@@ -503,7 +496,33 @@
503
  'result_title': $(this).find('a.asl_res_url').text(),
504
  'result_url': $(this).find('a.asl_res_url').attr('href')
505
  });
 
 
 
 
 
 
 
 
 
 
506
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507
  },
508
 
509
  initNavigationEvent: function () {
@@ -521,7 +540,7 @@
521
  }
522
  );
523
 
524
- $(document).keydown(function (e) {
525
 
526
  if (window.event) {
527
  var keycode = window.event.keyCode;
@@ -625,7 +644,7 @@
625
  }
626
  });
627
 
628
- $this.n.promagnifier.add($this.n.text).bind('click input', function (e) {
629
  if (window.event) {
630
  $this.keycode = window.event.keyCode;
631
  $this.ktype = window.event.type;
@@ -781,6 +800,11 @@
781
  var url = $this.o.redirect_url.replace('{phrase}', asl_nice_phrase($this.n.text.val()));
782
  }
783
 
 
 
 
 
 
784
  if ( $this.o.overridewpdefault ) {
785
  if ( $this.o.override_method == "post") {
786
  asl_submit_to_url($this.o.homeurl + url, 'post', {
@@ -788,7 +812,7 @@
788
  p_asl_data: $('form', $this.n.searchsettings).serialize()
789
  }, _loc);
790
  } else {
791
- var _url = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=" + Base64.encode($('form', $this.n.searchsettings).serialize());
792
  if ( _loc == 'same' )
793
  location.href = _url;
794
  else
@@ -820,8 +844,8 @@
820
  var $this = this;
821
  var tt;
822
 
823
- if ($this.o.autocomplete.enabled == 1 && !isMobile()) {
824
- $this.n.text.keyup(function (e) {
825
  if (window.event) {
826
  $this.keycode = window.event.keyCode;
827
  $this.ktype = window.event.type;
@@ -905,6 +929,8 @@
905
  options: $('form', $this.n.searchsettings).serialize()
906
  };
907
 
 
 
908
  if ( JSON.stringify(data) === JSON.stringify($this.lastSearchData) ) {
909
  if ( !$this.resultsOpened )
910
  $this.showResults();
@@ -923,14 +949,14 @@
923
  response = response.replace(/^\s*[\r\n]/gm, "");
924
  response = response.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];
925
 
926
- // bye bye JSON
927
 
928
  $this.n.resdrg.html("");
929
  $this.n.resdrg.html(response);
930
 
931
- $(".asl_keyword", $this.n.resdrg).bind('click', function () {
932
  $this.n.text.val($(this).html());
933
- $('input.orig', $this.n.container).val($(this).html()).keydown();
934
  $('form', $this.n.container).trigger('submit', 'ajax');
935
  $this.search();
936
  });
@@ -980,7 +1006,7 @@
980
  p_asl_data: $('form', $this.n.searchsettings).serialize()
981
  });
982
  } else {
983
- location.href = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=" + Base64.encode($('form', $this.n.searchsettings).serialize());
984
  }
985
  } else {
986
  asl_submit_to_url($this.o.homeurl + url, 'post', {
@@ -1237,7 +1263,7 @@
1237
  "visibility": "visible",
1238
  "display": "block",
1239
  "opacity": 1,
1240
- "animation-duration": animDur
1241
  },
1242
  "hideClass": "asl_an_fadeOutDrop",
1243
  "hideCSS": {
@@ -1264,7 +1290,7 @@
1264
  "visibility": "visible",
1265
  "display": "block",
1266
  "opacity": 1,
1267
- "animation-duration": animDur
1268
  },
1269
  "hideClass": "asl_an_fadeOutDrop",
1270
  "hideCSS": {
@@ -1435,8 +1461,12 @@
1435
  }
1436
  };
1437
 
1438
- function is_touch_device() {
1439
- return !!("ontouchstart" in window) ? 1 : 0;
 
 
 
 
1440
  }
1441
 
1442
  /* Mobile detection - Touch desktop device safe! */
@@ -1456,8 +1486,8 @@
1456
  if (this.name && !this.disabled && (this.checked
1457
  || /select|textarea/i.test(this.nodeName)
1458
  || /text/i.test(this.type)) &&
1459
- !$(this).hasClass('asp_datepicker_field') &&
1460
- !$(this).hasClass('asp_datepicker')
1461
  ) {
1462
  if(data[this.name] == undefined){
1463
  data[this.name] = [];
@@ -1501,6 +1531,10 @@
1501
  return encodeURIComponent(s).replace(/\%20/g, '+');
1502
  }
1503
 
 
 
 
 
1504
  function asl_submit_to_url(action, method, input, target) {
1505
  'use strict';
1506
  var form;
@@ -1520,7 +1554,7 @@
1520
  }
1521
  if ( typeof (target) != 'undefined' && target == 'new')
1522
  form.attr('target', '_blank');
1523
- form.appendTo('body').submit();
1524
  }
1525
 
1526
  function open_in_new_tab(url) {
45
  itemsPerPage: 6
46
  };
47
 
 
48
  $this.post = null;
49
  $this.postAuto = null;
50
  $this.cleanUp();
335
  }
336
 
337
  // Some kind of crazy rev-slider fix
338
+ $this.n.text.on('click', function(e){
339
+ $(this).trigger('focus');
340
  $this.gaEvent('focus');
341
  });
342
 
351
  }
352
  });
353
 
354
+ $($this.n.text.parent()).on('submit', function (e) {
355
  e.preventDefault();
356
  if ( isMobile() ) {
357
  if ( $this.o.redirect_on_enter ) {
368
  }
369
  });
370
 
 
 
 
 
 
 
371
  $this.n.resultsDiv.css({
372
  opacity: 0
373
  });
374
+ $(document).on("click touchend", function () {
375
  $this.hideSettings();
376
  if ($this.opened == false || $this.o.closeOnDocClick != 1) return;
377
  $this.hideResults();
380
  $this.n.text.val("");
381
  $this.n.textAutocomplete.val("");
382
  $this.hideResults();
383
+ $this.n.text.trigger('focus');
384
  });
385
+ $($this.elem).on("click touchend", function (e) {
386
  e.stopImmediatePropagation();
387
  });
388
+ $this.n.resultsDiv.on("click touchend", function (e) {
389
  e.stopImmediatePropagation();
390
  });
391
+ $this.n.searchsettings.on("click touchend", function (e) {
392
  e.stopImmediatePropagation();
393
  });
394
 
440
  });
441
 
442
  // Prevent zoom on IOS
443
+ if ( detectIOS() && isMobile() ) {
444
  if ( parseInt($this.n.text.css('font-size')) < 16 ) {
445
  $this.n.text.data('fontSize', $this.n.text.css('font-size')).css('font-size', '16px');
446
  $this.n.textAutocomplete.css('font-size', '16px');
486
  $('input[type="checkbox"]', _this).trigger('asl_chbx_change');
487
  }, 50);
488
  });
489
+ $('div.asl_option label', $this.n.searchsettings).on('click', function(e){
490
  e.preventDefault(); // Let the previous handler handle the events, disable this
491
  });
492
 
496
  'result_title': $(this).find('a.asl_res_url').text(),
497
  'result_url': $(this).find('a.asl_res_url').attr('href')
498
  });
499
+
500
+ // Results highlight on results page
501
+ if ( $this.o.singleHighlight == 1 ) {
502
+ localStorage.removeItem('asl_phrase_highlight');
503
+ if ( asl_unquote_phrase( $this.n.text.val() ) != '' )
504
+ localStorage.setItem('asl_phrase_highlight', JSON.stringify({
505
+ 'phrase': asl_unquote_phrase( $this.n.text.val() ),
506
+ 'id': $this.o.id
507
+ }));
508
+ }
509
  });
510
+
511
+ // Mobile navigation focus
512
+ if ( isMobile() && $this.o.mobile.menu_selector != '' ) {
513
+ $($this.o.mobile.menu_selector).on('touchend', function(){
514
+ var _this = this;
515
+ setTimeout(function () {
516
+ var $input = $(_this).find('input.orig');
517
+ $input = $input.length == 0 ? $(_this).next().find('input.orig') : $input;
518
+ $input = $input.length == 0 ? $(_this).parent().find('input.orig') : $input;
519
+ $input = $input.length == 0 ? $this.n.text : $input;
520
+ if ( $this.n.container.is(':visible') ) {
521
+ $input.get(0).focus();
522
+ }
523
+ }, 300);
524
+ });
525
+ }
526
  },
527
 
528
  initNavigationEvent: function () {
540
  }
541
  );
542
 
543
+ $(document).on('keydown', function (e) {
544
 
545
  if (window.event) {
546
  var keycode = window.event.keyCode;
644
  }
645
  });
646
 
647
+ $this.n.promagnifier.add($this.n.text).on('click input', function (e) {
648
  if (window.event) {
649
  $this.keycode = window.event.keyCode;
650
  $this.ktype = window.event.type;
800
  var url = $this.o.redirect_url.replace('{phrase}', asl_nice_phrase($this.n.text.val()));
801
  }
802
 
803
+ // Is this an URL like xy.com/?x=y
804
+ if ( $this.o.homeurl.indexOf('?') > 1 && url.indexOf('?') === 0 ) {
805
+ url = url.replace('?', '&');
806
+ }
807
+
808
  if ( $this.o.overridewpdefault ) {
809
  if ( $this.o.override_method == "post") {
810
  asl_submit_to_url($this.o.homeurl + url, 'post', {
812
  p_asl_data: $('form', $this.n.searchsettings).serialize()
813
  }, _loc);
814
  } else {
815
+ var _url = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=1&" + $('form', $this.n.searchsettings).serialize();
816
  if ( _loc == 'same' )
817
  location.href = _url;
818
  else
844
  var $this = this;
845
  var tt;
846
 
847
+ if ( $this.o.autocomplete.enabled == 1 && !isMobile() ) {
848
+ $this.n.text.on('keyup', function (e) {
849
  if (window.event) {
850
  $this.keycode = window.event.keyCode;
851
  $this.ktype = window.event.type;
929
  options: $('form', $this.n.searchsettings).serialize()
930
  };
931
 
932
+ data = apply_filters('asl_search_data', data);
933
+
934
  if ( JSON.stringify(data) === JSON.stringify($this.lastSearchData) ) {
935
  if ( !$this.resultsOpened )
936
  $this.showResults();
949
  response = response.replace(/^\s*[\r\n]/gm, "");
950
  response = response.match(/!!ASLSTART!!(.*[\s\S]*)!!ASLEND!!/)[1];
951
 
952
+ response = apply_filters('asl_search_html', response);
953
 
954
  $this.n.resdrg.html("");
955
  $this.n.resdrg.html(response);
956
 
957
+ $(".asl_keyword", $this.n.resdrg).on('click', function () {
958
  $this.n.text.val($(this).html());
959
+ $('input.orig', $this.n.container).val($(this).html()).trigger('keydown');
960
  $('form', $this.n.container).trigger('submit', 'ajax');
961
  $this.search();
962
  });
1006
  p_asl_data: $('form', $this.n.searchsettings).serialize()
1007
  });
1008
  } else {
1009
+ location.href = $this.o.homeurl + url + "&asl_active=1&p_asid=" + $this.o.id + "&p_asl_data=1&" + $('form', $this.n.searchsettings).serialize()
1010
  }
1011
  } else {
1012
  asl_submit_to_url($this.o.homeurl + url, 'post', {
1263
  "visibility": "visible",
1264
  "display": "block",
1265
  "opacity": 1,
1266
+ "animation-duration": animDur + 'ms'
1267
  },
1268
  "hideClass": "asl_an_fadeOutDrop",
1269
  "hideCSS": {
1290
  "visibility": "visible",
1291
  "display": "block",
1292
  "opacity": 1,
1293
+ "animation-duration": animDur + 'ms'
1294
  },
1295
  "hideClass": "asl_an_fadeOutDrop",
1296
  "hideCSS": {
1461
  }
1462
  };
1463
 
1464
+ function apply_filters() {
1465
+ if ( typeof wp != 'undefined' && typeof wp.hooks != 'undefined' && typeof wp.hooks.applyFilters != 'undefined' ) {
1466
+ return wp.hooks.applyFilters.apply(null, arguments);
1467
+ } else {
1468
+ return typeof arguments[1] != 'undefined' ? arguments[1] : false;
1469
+ }
1470
  }
1471
 
1472
  /* Mobile detection - Touch desktop device safe! */
1486
  if (this.name && !this.disabled && (this.checked
1487
  || /select|textarea/i.test(this.nodeName)
1488
  || /text/i.test(this.type)) &&
1489
+ !$(this).hasClass('asl_datepicker_field') &&
1490
+ !$(this).hasClass('asl_datepicker')
1491
  ) {
1492
  if(data[this.name] == undefined){
1493
  data[this.name] = [];
1531
  return encodeURIComponent(s).replace(/\%20/g, '+');
1532
  }
1533
 
1534
+ function asl_unquote_phrase(s) {
1535
+ return s.replace(/"|'/g, '');
1536
+ }
1537
+
1538
  function asl_submit_to_url(action, method, input, target) {
1539
  'use strict';
1540
  var form;
1554
  }
1555
  if ( typeof (target) != 'undefined' && target == 'new')
1556
  form.attr('target', '_blank');
1557
+ form.appendTo('body').trigger('submit');
1558
  }
1559
 
1560
  function open_in_new_tab(url) {
js/nomin/jquery.gestures.js DELETED
@@ -1 +0,0 @@
1
- (function(a){if(typeof define==="function"&&false&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{if(typeof module!=="undefined"&&false&&module.exports){a(require("jquery"))}else{a(jQuery)}}}(function(f){var y="1.6.15",p="left",o="right",e="up",x="down",c="in",A="out",m="none",s="auto",l="swipe",t="pinch",B="tap",j="doubletap",b="longtap",z="hold",E="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled&&!a,d=(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&!a,C="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:true};f.fn.swipe=function(H){var G=f(this),F=G.data(C);if(F&&typeof H==="string"){if(F[H]){return F[H].apply(this,Array.prototype.slice.call(arguments,1))}else{f.error("Method "+H+" does not exist on jQuery.swipe")}}else{if(F&&typeof H==="object"){F.option.apply(this,arguments)}else{if(!F&&(typeof H==="object"||!H)){return w.apply(this,arguments)}}}return G};f.fn.swipe.version=y;f.fn.swipe.defaults=n;f.fn.swipe.phases={PHASE_START:g,PHASE_MOVE:k,PHASE_END:h,PHASE_CANCEL:q};f.fn.swipe.directions={LEFT:p,RIGHT:o,UP:e,DOWN:x,IN:c,OUT:A};f.fn.swipe.pageScroll={NONE:m,HORIZONTAL:E,VERTICAL:u,AUTO:s};f.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,FOUR:4,FIVE:5,ALL:i};function w(F){if(F&&(F.allowPageScroll===undefined&&(F.swipe!==undefined||F.swipeStatus!==undefined))){F.allowPageScroll=m}if(F.click!==undefined&&F.tap===undefined){F.tap=F.click}if(!F){F={}}F=f.extend({},f.fn.swipe.defaults,F);return this.each(function(){var H=f(this);var G=H.data(C);if(!G){G=new D(this,F);H.data(C,G)}})}function D(a5,au){var au=f.extend({},au);var az=(a||d||!au.fallbackToMouseEvents),K=az?(d?(v?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",ax=az?(d?(v?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",V=az?(d?(v?"MSPointerUp":"pointerup"):"touchend"):"mouseup",T=az?(d?"mouseleave":null):"mouseleave",aD=(d?(v?"MSPointerCancel":"pointercancel"):"touchcancel");var ag=0,aP=null,a2=null,ac=0,a1=0,aZ=0,H=1,ap=0,aJ=0,N=null;var aR=f(a5);var aa="start";var X=0;var aQ={};var U=0,a3=0,a6=0,ay=0,O=0;var aW=null,af=null;try{aR.bind(K,aN);aR.bind(aD,ba)}catch(aj){f.error("events not supported "+K+","+aD+" on jQuery.swipe")}this.enable=function(){aR.bind(K,aN);aR.bind(aD,ba);return aR};this.disable=function(){aK();return aR};this.destroy=function(){aK();aR.data(C,null);aR=null};this.option=function(bd,bc){if(typeof bd==="object"){au=f.extend(au,bd)}else{if(au[bd]!==undefined){if(bc===undefined){return au[bd]}else{au[bd]=bc}}else{if(!bd){return au}else{f.error("Option "+bd+" does not exist on jQuery.swipe.options")}}}return null};function aN(be){if(aB()){return}if(f(be.target).closest(au.excludedElements,aR).length>0){return}var bf=be.originalEvent?be.originalEvent:be;var bd,bg=bf.touches,bc=bg?bg[0]:bf;aa=g;if(bg){X=bg.length}else{if(au.preventDefaultEvents!==false){be.preventDefault()}}ag=0;aP=null;a2=null;aJ=null;ac=0;a1=0;aZ=0;H=1;ap=0;N=ab();S();ai(0,bc);if(!bg||(X===au.fingers||au.fingers===i)||aX()){U=ar();if(X==2){ai(1,bg[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}if(au.swipeStatus||au.pinchStatus){bd=P(bf,aa)}}else{bd=false}if(bd===false){aa=q;P(bf,aa);return bd}else{if(au.hold){af=setTimeout(f.proxy(function(){aR.trigger("hold",[bf.target]);if(au.hold){bd=au.hold.call(aR,bf,bf.target)}},this),au.longTapThreshold)}an(true)}return null}function a4(bf){var bi=bf.originalEvent?bf.originalEvent:bf;if(aa===h||aa===q||al()){return}var be,bj=bi.touches,bd=bj?bj[0]:bi;var bg=aH(bd);a3=ar();if(bj){X=bj.length}if(au.hold){clearTimeout(af)}aa=k;if(X==2){if(a1==0){ai(1,bj[1]);a1=aZ=at(aQ[0].start,aQ[1].start)}else{aH(bj[1]);aZ=at(aQ[0].end,aQ[1].end);aJ=aq(aQ[0].end,aQ[1].end)}H=a8(a1,aZ);ap=Math.abs(a1-aZ)}if((X===au.fingers||au.fingers===i)||!bj||aX()){aP=aL(bg.start,bg.end);a2=aL(bg.last,bg.end);ak(bf,a2);ag=aS(bg.start,bg.end);ac=aM();aI(aP,ag);be=P(bi,aa);if(!au.triggerOnTouchEnd||au.triggerOnTouchLeave){var bc=true;if(au.triggerOnTouchLeave){var bh=aY(this);bc=F(bg.end,bh)}if(!au.triggerOnTouchEnd&&bc){aa=aC(k)}else{if(au.triggerOnTouchLeave&&!bc){aa=aC(h)}}if(aa==q||aa==h){P(bi,aa)}}}else{aa=q;P(bi,aa)}if(be===false){aa=q;P(bi,aa)}}function M(bc){var bd=bc.originalEvent?bc.originalEvent:bc,be=bd.touches;if(be){if(be.length&&!al()){G(bd);return true}else{if(be.length&&al()){return true}}}if(al()){X=ay}a3=ar();ac=aM();if(bb()||!am()){aa=q;P(bd,aa)}else{if(au.triggerOnTouchEnd||(au.triggerOnTouchEnd==false&&aa===k)){if(au.preventDefaultEvents!==false){bc.preventDefault()}aa=h;P(bd,aa)}else{if(!au.triggerOnTouchEnd&&a7()){aa=h;aF(bd,aa,B)}else{if(aa===k){aa=q;P(bd,aa)}}}}an(false);return null}function ba(){X=0;a3=0;U=0;a1=0;aZ=0;H=1;S();an(false)}function L(bc){var bd=bc.originalEvent?bc.originalEvent:bc;if(au.triggerOnTouchLeave){aa=aC(h);P(bd,aa)}}function aK(){aR.unbind(K,aN);aR.unbind(aD,ba);aR.unbind(ax,a4);aR.unbind(V,M);if(T){aR.unbind(T,L)}an(false)}function aC(bg){var bf=bg;var be=aA();var bd=am();var bc=bb();if(!be||bc){bf=q}else{if(bd&&bg==k&&(!au.triggerOnTouchEnd||au.triggerOnTouchLeave)){bf=h}else{if(!bd&&bg==h&&au.triggerOnTouchLeave){bf=q}}}return bf}function P(be,bc){var bd,bf=be.touches;if(J()||W()){bd=aF(be,bc,l)}if((Q()||aX())&&bd!==false){bd=aF(be,bc,t)}if(aG()&&bd!==false){bd=aF(be,bc,j)}else{if(ao()&&bd!==false){bd=aF(be,bc,b)}else{if(ah()&&bd!==false){bd=aF(be,bc,B)}}}if(bc===q){if(W()){bd=aF(be,bc,l)}if(aX()){bd=aF(be,bc,t)}ba(be)}if(bc===h){if(bf){if(!bf.length){ba(be)}}else{ba(be)}}return bd}function aF(bf,bc,be){var bd;if(be==l){aR.trigger("swipeStatus",[bc,aP||null,ag||0,ac||0,X,aQ,a2]);if(au.swipeStatus){bd=au.swipeStatus.call(aR,bf,bc,aP||null,ag||0,ac||0,X,aQ,a2);if(bd===false){return false}}if(bc==h&&aV()){clearTimeout(aW);clearTimeout(af);aR.trigger("swipe",[aP,ag,ac,X,aQ,a2]);if(au.swipe){bd=au.swipe.call(aR,bf,aP,ag,ac,X,aQ,a2);if(bd===false){return false}}switch(aP){case p:aR.trigger("swipeLeft",[aP,ag,ac,X,aQ,a2]);if(au.swipeLeft){bd=au.swipeLeft.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case o:aR.trigger("swipeRight",[aP,ag,ac,X,aQ,a2]);if(au.swipeRight){bd=au.swipeRight.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case e:aR.trigger("swipeUp",[aP,ag,ac,X,aQ,a2]);if(au.swipeUp){bd=au.swipeUp.call(aR,bf,aP,ag,ac,X,aQ,a2)}break;case x:aR.trigger("swipeDown",[aP,ag,ac,X,aQ,a2]);if(au.swipeDown){bd=au.swipeDown.call(aR,bf,aP,ag,ac,X,aQ,a2)}break}}}if(be==t){aR.trigger("pinchStatus",[bc,aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchStatus){bd=au.pinchStatus.call(aR,bf,bc,aJ||null,ap||0,ac||0,X,H,aQ);if(bd===false){return false}}if(bc==h&&a9()){switch(aJ){case c:aR.trigger("pinchIn",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchIn){bd=au.pinchIn.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break;case A:aR.trigger("pinchOut",[aJ||null,ap||0,ac||0,X,H,aQ]);if(au.pinchOut){bd=au.pinchOut.call(aR,bf,aJ||null,ap||0,ac||0,X,H,aQ)}break}}}if(be==B){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);if(Z()&&!I()){O=ar();aW=setTimeout(f.proxy(function(){O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}},this),au.doubleTapThreshold)}else{O=null;aR.trigger("tap",[bf.target]);if(au.tap){bd=au.tap.call(aR,bf,bf.target)}}}}else{if(be==j){if(bc===q||bc===h){clearTimeout(aW);clearTimeout(af);O=null;aR.trigger("doubletap",[bf.target]);if(au.doubleTap){bd=au.doubleTap.call(aR,bf,bf.target)}}}else{if(be==b){if(bc===q||bc===h){clearTimeout(aW);O=null;aR.trigger("longtap",[bf.target]);if(au.longTap){bd=au.longTap.call(aR,bf,bf.target)}}}}}return bd}function am(){var bc=true;if(au.threshold!==null){bc=ag>=au.threshold}return bc}function bb(){var bc=false;if(au.cancelThreshold!==null&&aP!==null){bc=(aT(aP)-ag)>=au.cancelThreshold}return bc}function ae(){if(au.pinchThreshold!==null){return ap>=au.pinchThreshold}return true}function aA(){var bc;if(au.maxTimeThreshold){if(ac>=au.maxTimeThreshold){bc=false}else{bc=true}}else{bc=true}return bc}function ak(bc,bd){if(au.preventDefaultEvents===false){return}if(au.allowPageScroll===m){bc.preventDefault()}else{var be=au.allowPageScroll===s;switch(bd){case p:if((au.swipeLeft&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case o:if((au.swipeRight&&be)||(!be&&au.allowPageScroll!=E)){bc.preventDefault()}break;case e:if((au.swipeUp&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break;case x:if((au.swipeDown&&be)||(!be&&au.allowPageScroll!=u)){bc.preventDefault()}break}}}function a9(){var bd=aO();var bc=Y();var be=ae();return bd&&bc&&be}function aX(){return !!(au.pinchStatus||au.pinchIn||au.pinchOut)}function Q(){return !!(a9()&&aX())}function aV(){var bf=aA();var bh=am();var be=aO();var bc=Y();var bd=bb();var bg=!bd&&bc&&be&&bh&&bf;return bg}function W(){return !!(au.swipe||au.swipeStatus||au.swipeLeft||au.swipeRight||au.swipeUp||au.swipeDown)}function J(){return !!(aV()&&W())}function aO(){return((X===au.fingers||au.fingers===i)||!a)}function Y(){return aQ[0].end.x!==0}function a7(){return !!(au.tap)}function Z(){return !!(au.doubleTap)}function aU(){return !!(au.longTap)}function R(){if(O==null){return false}var bc=ar();return(Z()&&((bc-O)<=au.doubleTapThreshold))}function I(){return R()}function aw(){return((X===1||!a)&&(isNaN(ag)||ag<au.threshold))}function a0(){return((ac>au.longTapThreshold)&&(ag<r)