Version Description
- Bug Fix: Security fixes
Download this release
Release Info
Developer | caseproof |
Plugin | ThirstyAffiliates Affiliate Link Manager |
Version | 3.10.5 |
Comparing to | |
See all releases |
Code changes from version 3.10.4 to 3.10.5
- Helpers/Helper_Functions.php +19 -2
- Helpers/Plugin_Constants.php +1 -3
- Models/Affiliate_Link_Attachment.php +15 -3
- Models/Affiliate_Links_CPT.php +9 -1
- Models/Guided_Tour.php +10 -8
- Models/Link_Picker.php +33 -19
- Models/Marketing.php +52 -141
- Models/Migration.php +11 -9
- Models/Script_Loader.php +13 -11
- Models/Settings.php +18 -43
- Models/Stats_Reporting.php +27 -9
- js/app/advance_link_picker/dist/advance-link-picker.js +1 -1
- js/app/advance_link_picker/src/insert-affiliate-link-normal.js +33 -32
- js/app/affiliate_link_page/dist/affiliate-link-page.js +2 -2
- js/app/affiliate_link_page/package-lock.json +1195 -1152
- js/app/affiliate_link_page/src/affiliate-link-attachment.js +24 -9
- js/app/affiliate_link_page/src/link-category-show-in-slug.js +3 -1
- js/app/affiliate_link_page/src/link-insert-scanner.js +2 -1
- js/app/import_export/dist/import-export.js +11 -11
- js/app/import_export/src/import.js +7 -3
- js/app/migration/dist/migration.js +11 -11
- js/app/migration/src/index.js +8 -5
- js/app/ta-reports.js +6 -1
- js/app/ta-review-request.js +0 -38
- js/app/ta.js +12 -12
- readme.txt +4 -1
- thirstyaffiliates.php +1 -1
- views/cpt/view-attach-images-metabox.php +2 -2
- views/linkpicker/advance-link-picker.php +3 -3
- views/linkpicker/edit-shortcode.php +1 -1
- views/linkpicker/quick-add-affiliate-link.php +4 -4
Helpers/Helper_Functions.php
CHANGED
@@ -120,7 +120,7 @@ class Helper_Functions {
|
|
120 |
* @since 3.0.0
|
121 |
* @access public
|
122 |
*
|
123 |
-
* @param WP_User $user WP_User object.
|
124 |
* @return boolean True if authorized, False otherwise.
|
125 |
*/
|
126 |
public function current_user_authorized( $user = null ) {
|
@@ -213,7 +213,7 @@ class Helper_Functions {
|
|
213 |
* @since 3.0.0
|
214 |
* @access public
|
215 |
*
|
216 |
-
* @global WP_Roles $wp_roles Core class used to implement a user roles API.
|
217 |
*
|
218 |
* @return array Array of all site registered user roles. User role key as the key and value is user role text.
|
219 |
*/
|
@@ -683,4 +683,21 @@ class Helper_Functions {
|
|
683 |
return substr($string, $ini, $len);
|
684 |
}
|
685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
686 |
}
|
120 |
* @since 3.0.0
|
121 |
* @access public
|
122 |
*
|
123 |
+
* @param \WP_User $user WP_User object.
|
124 |
* @return boolean True if authorized, False otherwise.
|
125 |
*/
|
126 |
public function current_user_authorized( $user = null ) {
|
213 |
* @since 3.0.0
|
214 |
* @access public
|
215 |
*
|
216 |
+
* @global \WP_Roles $wp_roles Core class used to implement a user roles API.
|
217 |
*
|
218 |
* @return array Array of all site registered user roles. User role key as the key and value is user role text.
|
219 |
*/
|
683 |
return substr($string, $ini, $len);
|
684 |
}
|
685 |
|
686 |
+
/**
|
687 |
+
* Get the capability required to access an admin interface.
|
688 |
+
*
|
689 |
+
* @param string $interface The key of the interface.
|
690 |
+
* @param string $default The default capability to return if the interface capability is not set.
|
691 |
+
* @return string
|
692 |
+
*/
|
693 |
+
public function get_capability_for_interface( $interface, $default ) {
|
694 |
+
$option = $this->get_option( 'tap_plugin_visibility_admin_interfaces', array() );
|
695 |
+
|
696 |
+
if ( is_array( $option ) && ! empty( $option[ $interface ] ) ) {
|
697 |
+
return $option[ $interface ];
|
698 |
+
}
|
699 |
+
|
700 |
+
return $default;
|
701 |
+
}
|
702 |
+
|
703 |
}
|
Helpers/Plugin_Constants.php
CHANGED
@@ -27,7 +27,7 @@ class Plugin_Constants {
|
|
27 |
// Plugin configuration constants
|
28 |
const TOKEN = 'ta';
|
29 |
const INSTALLED_VERSION = 'ta_installed_version';
|
30 |
-
const VERSION = '3.10.
|
31 |
const TEXT_DOMAIN = 'thirstyaffiliates';
|
32 |
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
|
33 |
const META_DATA_PREFIX = '_ta_';
|
@@ -40,14 +40,12 @@ class Plugin_Constants {
|
|
40 |
// CRON
|
41 |
const CRON_REQUEST_REVIEW = 'ta_cron_request_review';
|
42 |
const CRON_MIGRATE_OLD_PLUGIN_DATA = 'ta_cron_migrate_old_plugin_data';
|
43 |
-
const CRON_TAPRO_NOTICE = 'ta_cron_tapro_notice';
|
44 |
const CRON_STATS_TRIMMER = 'ta_cron_stats_trimmer';
|
45 |
|
46 |
// Options
|
47 |
const SHOW_REQUEST_REVIEW = 'ta_show_request_review';
|
48 |
const REVIEW_REQUEST_RESPONSE = 'ta_request_review_response';
|
49 |
const MIGRATION_COMPLETE_FLAG = 'ta_migration_complete_flag';
|
50 |
-
const SHOW_TAPRO_NOTICE = 'ta_show_tapro_notice';
|
51 |
|
52 |
// Settings Constants
|
53 |
const DEFAULT_BLOCKED_BOTS = 'googlebot,bingbot,Slurp,DuckDuckBot,Baiduspider,YandexBot,Sogou,Exabot,facebo,ia_archiver';
|
27 |
// Plugin configuration constants
|
28 |
const TOKEN = 'ta';
|
29 |
const INSTALLED_VERSION = 'ta_installed_version';
|
30 |
+
const VERSION = '3.10.5';
|
31 |
const TEXT_DOMAIN = 'thirstyaffiliates';
|
32 |
const THEME_TEMPLATE_PATH = 'thirstyaffiliates';
|
33 |
const META_DATA_PREFIX = '_ta_';
|
40 |
// CRON
|
41 |
const CRON_REQUEST_REVIEW = 'ta_cron_request_review';
|
42 |
const CRON_MIGRATE_OLD_PLUGIN_DATA = 'ta_cron_migrate_old_plugin_data';
|
|
|
43 |
const CRON_STATS_TRIMMER = 'ta_cron_stats_trimmer';
|
44 |
|
45 |
// Options
|
46 |
const SHOW_REQUEST_REVIEW = 'ta_show_request_review';
|
47 |
const REVIEW_REQUEST_RESPONSE = 'ta_request_review_response';
|
48 |
const MIGRATION_COMPLETE_FLAG = 'ta_migration_complete_flag';
|
|
|
49 |
|
50 |
// Settings Constants
|
51 |
const DEFAULT_BLOCKED_BOTS = 'googlebot,bingbot,Slurp,DuckDuckBot,Baiduspider,YandexBot,Sogou,Exabot,facebo,ia_archiver';
|
Models/Affiliate_Link_Attachment.php
CHANGED
@@ -128,6 +128,10 @@ class Affiliate_Link_Attachment implements Model_Interface , Initiable_Interface
|
|
128 |
|
129 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
130 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
131 |
elseif ( ! isset( $_POST[ 'attachment_ids' ] ) || ! isset( $_POST[ 'affiliate_link_id' ] ) )
|
132 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
133 |
else {
|
@@ -169,7 +173,7 @@ class Affiliate_Link_Attachment implements Model_Interface , Initiable_Interface
|
|
169 |
*
|
170 |
* @param array $attachment_ids Array of attachment ids.
|
171 |
* @param int $affiliate_link_id Id of the current affiliate link.
|
172 |
-
* @return \WP_Error
|
173 |
*/
|
174 |
public function add_attachments_to_affiliate_link( $attachment_ids , $affiliate_link_id ) {
|
175 |
|
@@ -198,6 +202,10 @@ class Affiliate_Link_Attachment implements Model_Interface , Initiable_Interface
|
|
198 |
|
199 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
200 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
201 |
elseif ( ! isset( $_POST[ 'attachment_id' ] ) || ! isset( $_POST[ 'affiliate_link_id' ] ) )
|
202 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
203 |
else {
|
@@ -298,6 +306,10 @@ class Affiliate_Link_Attachment implements Model_Interface , Initiable_Interface
|
|
298 |
|
299 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
300 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
301 |
elseif ( ! isset( $_POST[ 'url' ] ) || ! isset( $_POST[ 'link_id' ] ) )
|
302 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
303 |
elseif ( ! filter_var( $_POST[ 'url' ] , FILTER_VALIDATE_URL ) || ! in_array( strtolower( pathinfo( $_POST[ 'url' ] , PATHINFO_EXTENSION ) ) , $allowed_extensions ) )
|
@@ -344,7 +356,7 @@ class Affiliate_Link_Attachment implements Model_Interface , Initiable_Interface
|
|
344 |
*
|
345 |
* @since 3.0.0
|
346 |
* @access public
|
347 |
-
* @implements ThirstyAffiliates\Interfaces\Initiable_Interface
|
348 |
*/
|
349 |
public function initialize() {
|
350 |
|
@@ -359,7 +371,7 @@ class Affiliate_Link_Attachment implements Model_Interface , Initiable_Interface
|
|
359 |
*
|
360 |
* @since 3.0.0
|
361 |
* @access public
|
362 |
-
* @implements ThirstyAffiliates\Interfaces\Model_Interface
|
363 |
*/
|
364 |
public function run() {
|
365 |
|
128 |
|
129 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
130 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
131 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface('thirstylink_edit', 'publish_posts') ) )
|
132 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
133 |
+
elseif ( ! check_ajax_referer( 'ta_add_attachments_to_affiliate_link', false, false ) )
|
134 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
135 |
elseif ( ! isset( $_POST[ 'attachment_ids' ] ) || ! isset( $_POST[ 'affiliate_link_id' ] ) )
|
136 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
137 |
else {
|
173 |
*
|
174 |
* @param array $attachment_ids Array of attachment ids.
|
175 |
* @param int $affiliate_link_id Id of the current affiliate link.
|
176 |
+
* @return \WP_Error|array WP_Error instance on failure, array of attachment IDs otherwise.
|
177 |
*/
|
178 |
public function add_attachments_to_affiliate_link( $attachment_ids , $affiliate_link_id ) {
|
179 |
|
202 |
|
203 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
204 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
205 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface('thirstylink_edit', 'publish_posts') ) )
|
206 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
207 |
+
elseif ( ! check_ajax_referer( 'ta_remove_attachments_from_affiliate_link', false, false ) )
|
208 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
209 |
elseif ( ! isset( $_POST[ 'attachment_id' ] ) || ! isset( $_POST[ 'affiliate_link_id' ] ) )
|
210 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
211 |
else {
|
306 |
|
307 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
308 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
309 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface('thirstylink_edit', 'publish_posts') ) )
|
310 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
311 |
+
elseif ( ! check_ajax_referer( 'ta_insert_external_image', false, false ) )
|
312 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
313 |
elseif ( ! isset( $_POST[ 'url' ] ) || ! isset( $_POST[ 'link_id' ] ) )
|
314 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
315 |
elseif ( ! filter_var( $_POST[ 'url' ] , FILTER_VALIDATE_URL ) || ! in_array( strtolower( pathinfo( $_POST[ 'url' ] , PATHINFO_EXTENSION ) ) , $allowed_extensions ) )
|
356 |
*
|
357 |
* @since 3.0.0
|
358 |
* @access public
|
359 |
+
* @implements \ThirstyAffiliates\Interfaces\Initiable_Interface
|
360 |
*/
|
361 |
public function initialize() {
|
362 |
|
371 |
*
|
372 |
* @since 3.0.0
|
373 |
* @access public
|
374 |
+
* @implements \ThirstyAffiliates\Interfaces\Model_Interface
|
375 |
*/
|
376 |
public function run() {
|
377 |
|
Models/Affiliate_Links_CPT.php
CHANGED
@@ -336,7 +336,7 @@ class Affiliate_Links_CPT implements Model_Interface , Initiable_Interface {
|
|
336 |
|
337 |
return $html;
|
338 |
}
|
339 |
-
|
340 |
/**
|
341 |
* Add custom HTML ta tag
|
342 |
*
|
@@ -932,6 +932,10 @@ class Affiliate_Links_CPT implements Model_Interface , Initiable_Interface {
|
|
932 |
|
933 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
934 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
935 |
elseif ( ! isset( $_POST[ 'term_id' ] ) )
|
936 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
937 |
else {
|
@@ -957,6 +961,10 @@ class Affiliate_Links_CPT implements Model_Interface , Initiable_Interface {
|
|
957 |
|
958 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
959 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
960 |
elseif ( ! isset( $_POST[ 'link_id' ] ) )
|
961 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
962 |
else {
|
336 |
|
337 |
return $html;
|
338 |
}
|
339 |
+
|
340 |
/**
|
341 |
* Add custom HTML ta tag
|
342 |
*
|
932 |
|
933 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
934 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
935 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface('thirstylink_edit', 'publish_posts') ) )
|
936 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
937 |
+
elseif ( ! check_ajax_referer( 'ta_get_category_slug', false, false ) )
|
938 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
939 |
elseif ( ! isset( $_POST[ 'term_id' ] ) )
|
940 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
941 |
else {
|
961 |
|
962 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
963 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
964 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface('thirstylink_edit', 'publish_posts') ) )
|
965 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
966 |
+
elseif ( ! check_ajax_referer( 'ta_link_inserted_scanner', false, false ) )
|
967 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
968 |
elseif ( ! isset( $_POST[ 'link_id' ] ) )
|
969 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
970 |
else {
|
Models/Guided_Tour.php
CHANGED
@@ -29,7 +29,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
29 |
*
|
30 |
* @since 3.0.0
|
31 |
* @access private
|
32 |
-
* @var
|
33 |
*/
|
34 |
private static $_instance;
|
35 |
|
@@ -38,7 +38,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
38 |
*
|
39 |
* @since 3.0.0
|
40 |
* @access private
|
41 |
-
* @var
|
42 |
*/
|
43 |
private $_main_plugin;
|
44 |
|
@@ -114,7 +114,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
114 |
* @param Abstract_Main_Plugin_Class $main_plugin Main plugin object.
|
115 |
* @param Plugin_Constants $constants Plugin constants object.
|
116 |
* @param Helper_Functions $helper_functions Helper functions object.
|
117 |
-
* @return
|
118 |
*/
|
119 |
public static function get_instance( Abstract_Main_Plugin_Class $main_plugin , Plugin_Constants $constants , Helper_Functions $helper_functions ) {
|
120 |
|
@@ -238,7 +238,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
238 |
),
|
239 |
'thirstylink' => array(
|
240 |
'elem' => '#menu-posts-thirstylink',
|
241 |
-
'html' => __( '<h3>
|
242 |
<p>We also have a Pro add-on for ThirstyAffiliates which contains lots of interesting features for affiliates like:</p>
|
243 |
<ul><li>Automatically link up your affiliate links to keywords in your blog</li>
|
244 |
<li>Get more detailed and advanced reports</li>
|
@@ -265,7 +265,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
265 |
* @since 3.0.0
|
266 |
* @access public
|
267 |
*
|
268 |
-
* @return array Current guide tour screen.
|
269 |
*/
|
270 |
public function get_current_screen() {
|
271 |
|
@@ -311,6 +311,8 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
311 |
|
312 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
313 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
314 |
elseif ( ! check_ajax_referer( 'ta-close-guided-tour' , 'nonce' , false ) )
|
315 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
316 |
else {
|
@@ -332,7 +334,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
332 |
*/
|
333 |
private function set_guided_tour_status_open() {
|
334 |
|
335 |
-
if ( get_option( 'ta_guided_tour_status' ) )
|
336 |
return;
|
337 |
|
338 |
update_option( 'ta_guided_tour_status' , 'open' );
|
@@ -352,7 +354,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
352 |
*
|
353 |
* @since 3.0.0
|
354 |
* @access public
|
355 |
-
* @implements ThirstyAffiliates\Interfaces\Activatable_Interface
|
356 |
*/
|
357 |
public function activate() {
|
358 |
|
@@ -374,7 +376,7 @@ class Guided_Tour implements Model_Interface , Activatable_Interface , Initiable
|
|
374 |
/**
|
375 |
* Execute model.
|
376 |
*
|
377 |
-
* @implements ThirstyAffiliates\Interfaces\Model_Interface
|
378 |
*
|
379 |
* @since 3.0.0
|
380 |
* @access public
|
29 |
*
|
30 |
* @since 3.0.0
|
31 |
* @access private
|
32 |
+
* @var Guided_Tour
|
33 |
*/
|
34 |
private static $_instance;
|
35 |
|
38 |
*
|
39 |
* @since 3.0.0
|
40 |
* @access private
|
41 |
+
* @var Abstract_Main_Plugin_Class
|
42 |
*/
|
43 |
private $_main_plugin;
|
44 |
|
114 |
* @param Abstract_Main_Plugin_Class $main_plugin Main plugin object.
|
115 |
* @param Plugin_Constants $constants Plugin constants object.
|
116 |
* @param Helper_Functions $helper_functions Helper functions object.
|
117 |
+
* @return Guided_Tour
|
118 |
*/
|
119 |
public static function get_instance( Abstract_Main_Plugin_Class $main_plugin , Plugin_Constants $constants , Helper_Functions $helper_functions ) {
|
120 |
|
238 |
),
|
239 |
'thirstylink' => array(
|
240 |
'elem' => '#menu-posts-thirstylink',
|
241 |
+
'html' => __( '<h3>
|
242 |
<p>We also have a Pro add-on for ThirstyAffiliates which contains lots of interesting features for affiliates like:</p>
|
243 |
<ul><li>Automatically link up your affiliate links to keywords in your blog</li>
|
244 |
<li>Get more detailed and advanced reports</li>
|
265 |
* @since 3.0.0
|
266 |
* @access public
|
267 |
*
|
268 |
+
* @return array|void Current guide tour screen.
|
269 |
*/
|
270 |
public function get_current_screen() {
|
271 |
|
311 |
|
312 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
313 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
314 |
+
elseif ( ! current_user_can( 'activate_plugins' ) )
|
315 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
316 |
elseif ( ! check_ajax_referer( 'ta-close-guided-tour' , 'nonce' , false ) )
|
317 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
318 |
else {
|
334 |
*/
|
335 |
private function set_guided_tour_status_open() {
|
336 |
|
337 |
+
if ( ! current_user_can('activate_plugins') || get_option( 'ta_guided_tour_status' ) )
|
338 |
return;
|
339 |
|
340 |
update_option( 'ta_guided_tour_status' , 'open' );
|
354 |
*
|
355 |
* @since 3.0.0
|
356 |
* @access public
|
357 |
+
* @implements \ThirstyAffiliates\Interfaces\Activatable_Interface
|
358 |
*/
|
359 |
public function activate() {
|
360 |
|
376 |
/**
|
377 |
* Execute model.
|
378 |
*
|
379 |
+
* @implements \ThirstyAffiliates\Interfaces\Model_Interface
|
380 |
*
|
381 |
* @since 3.0.0
|
382 |
* @access public
|
Models/Link_Picker.php
CHANGED
@@ -149,7 +149,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
149 |
|
150 |
if ( ! $this->_helper_functions->is_page_builder_active() || ! current_user_can( 'edit_posts' ) )
|
151 |
return;
|
152 |
-
|
153 |
add_filter( 'mce_external_plugins' , array( $this , 'load_thirsty_mce_plugin' ) , 99999 );
|
154 |
add_filter( 'mce_buttons' , array( $this , 'register_mce_buttons' ) , 99 );
|
155 |
}
|
@@ -197,7 +197,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
197 |
|
198 |
/**
|
199 |
* Register WP Editor style.
|
200 |
-
*
|
201 |
* @since 3.4.0
|
202 |
* @access public
|
203 |
*/
|
@@ -208,7 +208,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
208 |
|
209 |
/**
|
210 |
* Register WP Editor style via mce_css filter (for frontend editors).
|
211 |
-
*
|
212 |
* @since 3.4.0
|
213 |
* @access public
|
214 |
*/
|
@@ -240,7 +240,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
240 |
* @param bool $advanced Boolean check if its advanced or not.
|
241 |
* @param int $post_id ID of the post currently being edited.
|
242 |
* @param string $result_markup Search Affiliate Links result markup.
|
243 |
-
* @return Search Affiliate Links result markup
|
244 |
*/
|
245 |
public function search_affiliate_links_result_markup( $affiliate_links , $advance = false , $post_id = 0 , $result_markup = '' ) {
|
246 |
|
@@ -277,7 +277,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
277 |
$images_markup .= '<span class="image"><img src="'. $image .'" width="75" height="75" data-imgid="' . $image . '" data-type="image"></span>';
|
278 |
else
|
279 |
$images_markup .= '<span class="image">' . wp_get_attachment_image( $image , array( 75 , 75 ) , false , array( 'data-imgid' => $image , 'data-type' => 'image' ) ) . '</span>';
|
280 |
-
|
281 |
}
|
282 |
|
283 |
$images_markup .= '</span>';
|
@@ -296,12 +296,12 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
296 |
data-rel="' . trim( esc_attr( $rel ) ) . '"
|
297 |
data-target="' . esc_attr( $target ) . '"
|
298 |
data-other-atts="' . $other_atts . '">
|
299 |
-
<span class="name">' . mb_strimwidth( $thirstylink->get_prop( 'name' ) , 0 , 44 , "..." ) . '</span>
|
300 |
-
<span class="slug">[' . mb_strimwidth( $thirstylink->get_prop( 'slug' ) , 0 , 35 , "..." ) . ']</span>
|
301 |
<span class="actions">
|
302 |
-
<button type="button" data-type="normal" class="button insert-link-button dashicons dashicons-admin-links" data-tip="' .
|
303 |
-
<button type="button" data-type="shortcode" class="button insert-shortcode-button dashicons dashicons-editor-code" data-tip="' .
|
304 |
-
<button type="button" data-type="image" class="button insert-image-button dashicons dashicons-format-image" data-tip="' .
|
305 |
</span>
|
306 |
' . $images_markup . '
|
307 |
</li>';
|
@@ -315,7 +315,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
315 |
data-link-id="' . esc_attr( $thirstylink->get_id() ) . '"
|
316 |
data-link-insertion-type="' . esc_attr( $this->_helper_functions->get_option( 'ta_link_insertion_type' , 'link' ) ) . '"
|
317 |
data-other-atts="' . $other_atts . '">';
|
318 |
-
$result_markup .= '<strong>' . $link_id . '</strong> : <span>' . $thirstylink->get_prop( 'name' ) . '</span></li>';
|
319 |
|
320 |
}
|
321 |
|
@@ -338,6 +338,8 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
338 |
|
339 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
340 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
341 |
elseif ( ! isset( $_POST[ 'keyword' ] ) )
|
342 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
343 |
else {
|
@@ -357,7 +359,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
357 |
$result_markup = $this->search_affiliate_links_result_markup( $affiliate_links , $advance , $post_id );
|
358 |
$response = array( 'status' => 'success' , 'search_query_markup' => $result_markup , 'count' => count( $affiliate_links ) );
|
359 |
}
|
360 |
-
|
361 |
}
|
362 |
|
363 |
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
@@ -388,10 +390,14 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
388 |
wp_dequeue_script('admin-scripts');
|
389 |
wp_enqueue_style( 'jquery_tiptip' , $this->_constants->CSS_ROOT_URL() . 'lib/jquery-tiptip/jquery-tiptip.css' , array() , $this->_constants->VERSION() , 'all' );
|
390 |
wp_enqueue_style( 'ta_advance_link_picker_css' , $this->_constants->JS_ROOT_URL() . 'app/advance_link_picker/dist/advance-link-picker.css' , array( 'dashicons' ) , $this->_constants->VERSION() , 'all' );
|
391 |
-
wp_enqueue_style( 'selectize' , $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.default.css' , array() , Plugin_Constants::VERSION , 'all' );
|
392 |
wp_enqueue_script( 'jquery_tiptip' , $this->_constants->JS_ROOT_URL() . 'lib/jquery-tiptip/jquery.tipTip.min.js' , array() , $this->_constants->VERSION() );
|
393 |
wp_enqueue_script( 'ta_advance_link_picker_js' , $this->_constants->JS_ROOT_URL() . 'app/advance_link_picker/dist/advance-link-picker.js' , array( 'jquery_tiptip' ) , $this->_constants->VERSION() );
|
394 |
-
wp_enqueue_script( 'selectize' , $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.min.js' , array() , Plugin_Constants::VERSION );
|
|
|
|
|
|
|
|
|
395 |
|
396 |
include( $this->_constants->VIEWS_ROOT_PATH() . 'linkpicker/advance-link-picker.php' );
|
397 |
|
@@ -409,6 +415,10 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
409 |
|
410 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
411 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
412 |
elseif ( ! isset( $_REQUEST[ 'imgid' ] ) )
|
413 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
414 |
else {
|
@@ -498,7 +508,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
498 |
$thirstylink->set_prop( 'new_window' , sanitize_text_field( $_POST[ 'ta_new_window' ] ) );
|
499 |
$thirstylink->set_prop( 'redirect_type' , sanitize_text_field( $_POST[ 'ta_redirect_type' ] ) );
|
500 |
|
501 |
-
|
502 |
|
503 |
// save affiliate link
|
504 |
$thirstylink->save();
|
@@ -538,6 +548,10 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
538 |
|
539 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
540 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
541 |
elseif ( ! isset( $_REQUEST[ 'ta_link_name' ] ) || ! isset( $_REQUEST[ 'ta_destination_url' ] ) || ! isset( $_REQUEST[ 'ta_redirect_type' ] ) )
|
542 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
543 |
else {
|
@@ -585,7 +599,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
585 |
|
586 |
/**
|
587 |
* AJAX display shortcode editor form.
|
588 |
-
*
|
589 |
* @since 3.4.0
|
590 |
* @access public
|
591 |
*/
|
@@ -613,11 +627,11 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
613 |
|
614 |
/**
|
615 |
* Transform Gutenberg affiliate link <ta> tags to <a> tags.
|
616 |
-
*
|
617 |
* @since 3.6
|
618 |
* @access public
|
619 |
*
|
620 |
-
* @global WP_Post $post WP_Post object of currently loaded post.
|
621 |
*
|
622 |
* @param string $content WP_Post content.
|
623 |
* @return string Filtered WP_Post content.
|
@@ -629,7 +643,7 @@ class Link_Picker implements Model_Interface , Initiable_Interface {
|
|
629 |
if ( isset( $matches[0] ) && ! empty( $matches[0] ) ) {
|
630 |
|
631 |
$diff = 0;
|
632 |
-
|
633 |
foreach ( $matches[0] as $match ) {
|
634 |
|
635 |
$link_id = $this->_helper_functions->get_string_between( $match[0] , 'linkid="' , '"' );
|
149 |
|
150 |
if ( ! $this->_helper_functions->is_page_builder_active() || ! current_user_can( 'edit_posts' ) )
|
151 |
return;
|
152 |
+
|
153 |
add_filter( 'mce_external_plugins' , array( $this , 'load_thirsty_mce_plugin' ) , 99999 );
|
154 |
add_filter( 'mce_buttons' , array( $this , 'register_mce_buttons' ) , 99 );
|
155 |
}
|
197 |
|
198 |
/**
|
199 |
* Register WP Editor style.
|
200 |
+
*
|
201 |
* @since 3.4.0
|
202 |
* @access public
|
203 |
*/
|
208 |
|
209 |
/**
|
210 |
* Register WP Editor style via mce_css filter (for frontend editors).
|
211 |
+
*
|
212 |
* @since 3.4.0
|
213 |
* @access public
|
214 |
*/
|
240 |
* @param bool $advanced Boolean check if its advanced or not.
|
241 |
* @param int $post_id ID of the post currently being edited.
|
242 |
* @param string $result_markup Search Affiliate Links result markup.
|
243 |
+
* @return string Search Affiliate Links result markup
|
244 |
*/
|
245 |
public function search_affiliate_links_result_markup( $affiliate_links , $advance = false , $post_id = 0 , $result_markup = '' ) {
|
246 |
|
277 |
$images_markup .= '<span class="image"><img src="'. $image .'" width="75" height="75" data-imgid="' . $image . '" data-type="image"></span>';
|
278 |
else
|
279 |
$images_markup .= '<span class="image">' . wp_get_attachment_image( $image , array( 75 , 75 ) , false , array( 'data-imgid' => $image , 'data-type' => 'image' ) ) . '</span>';
|
280 |
+
|
281 |
}
|
282 |
|
283 |
$images_markup .= '</span>';
|
296 |
data-rel="' . trim( esc_attr( $rel ) ) . '"
|
297 |
data-target="' . esc_attr( $target ) . '"
|
298 |
data-other-atts="' . $other_atts . '">
|
299 |
+
<span class="name">' . esc_html( mb_strimwidth( $thirstylink->get_prop( 'name' ) , 0 , 44 , "..." ) ) . '</span>
|
300 |
+
<span class="slug">[' . esc_html ( mb_strimwidth( $thirstylink->get_prop( 'slug' ) , 0 , 35 , "..." ) ) . ']</span>
|
301 |
<span class="actions">
|
302 |
+
<button type="button" data-type="normal" class="button insert-link-button dashicons dashicons-admin-links" data-tip="' . esc_attr__( 'Insert link' , 'thirstyaffiliates' ) . '"></button>
|
303 |
+
<button type="button" data-type="shortcode" class="button insert-shortcode-button dashicons dashicons-editor-code" data-tip="' . esc_attr__( 'Insert shortcode' , 'thirstyaffiliates' ) . '"></button>
|
304 |
+
<button type="button" data-type="image" class="button insert-image-button dashicons dashicons-format-image" data-tip="' . esc_attr__( 'Insert image' , 'thirstyaffiliates' ) . '"></button>
|
305 |
</span>
|
306 |
' . $images_markup . '
|
307 |
</li>';
|
315 |
data-link-id="' . esc_attr( $thirstylink->get_id() ) . '"
|
316 |
data-link-insertion-type="' . esc_attr( $this->_helper_functions->get_option( 'ta_link_insertion_type' , 'link' ) ) . '"
|
317 |
data-other-atts="' . $other_atts . '">';
|
318 |
+
$result_markup .= '<strong>' . $link_id . '</strong> : <span>' . esc_html( $thirstylink->get_prop( 'name' ) ) . '</span></li>';
|
319 |
|
320 |
}
|
321 |
|
338 |
|
339 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
340 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
341 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface('thirstylink_list', 'edit_posts') ) )
|
342 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
343 |
elseif ( ! isset( $_POST[ 'keyword' ] ) )
|
344 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
345 |
else {
|
359 |
$result_markup = $this->search_affiliate_links_result_markup( $affiliate_links , $advance , $post_id );
|
360 |
$response = array( 'status' => 'success' , 'search_query_markup' => $result_markup , 'count' => count( $affiliate_links ) );
|
361 |
}
|
362 |
+
|
363 |
}
|
364 |
|
365 |
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
390 |
wp_dequeue_script('admin-scripts');
|
391 |
wp_enqueue_style( 'jquery_tiptip' , $this->_constants->CSS_ROOT_URL() . 'lib/jquery-tiptip/jquery-tiptip.css' , array() , $this->_constants->VERSION() , 'all' );
|
392 |
wp_enqueue_style( 'ta_advance_link_picker_css' , $this->_constants->JS_ROOT_URL() . 'app/advance_link_picker/dist/advance-link-picker.css' , array( 'dashicons' ) , $this->_constants->VERSION() , 'all' );
|
393 |
+
wp_enqueue_style( 'selectize' , $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.default.css' , array() , Plugin_Constants::VERSION , 'all' );
|
394 |
wp_enqueue_script( 'jquery_tiptip' , $this->_constants->JS_ROOT_URL() . 'lib/jquery-tiptip/jquery.tipTip.min.js' , array() , $this->_constants->VERSION() );
|
395 |
wp_enqueue_script( 'ta_advance_link_picker_js' , $this->_constants->JS_ROOT_URL() . 'app/advance_link_picker/dist/advance-link-picker.js' , array( 'jquery_tiptip' ) , $this->_constants->VERSION() );
|
396 |
+
wp_enqueue_script( 'selectize' , $this->_constants->JS_ROOT_URL() . 'lib/selectize/selectize.min.js' , array() , Plugin_Constants::VERSION );
|
397 |
+
|
398 |
+
wp_localize_script( 'ta_advance_link_picker_js', 'ta_advance_link_picker_js_params', array(
|
399 |
+
'get_image_markup_nonce' => wp_create_nonce( 'ta_get_image_markup' ),
|
400 |
+
));
|
401 |
|
402 |
include( $this->_constants->VIEWS_ROOT_PATH() . 'linkpicker/advance-link-picker.php' );
|
403 |
|
415 |
|
416 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
417 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
418 |
+
elseif ( ! current_user_can( apply_filters( 'ta_enable_advance_link_picker' , 'edit_posts' ) ) )
|
419 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
420 |
+
elseif ( ! check_ajax_referer( 'ta_get_image_markup', false, false ) )
|
421 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
422 |
elseif ( ! isset( $_REQUEST[ 'imgid' ] ) )
|
423 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
424 |
else {
|
508 |
$thirstylink->set_prop( 'new_window' , sanitize_text_field( $_POST[ 'ta_new_window' ] ) );
|
509 |
$thirstylink->set_prop( 'redirect_type' , sanitize_text_field( $_POST[ 'ta_redirect_type' ] ) );
|
510 |
|
511 |
+
do_action( 'ta_save_quick_add_affiliate_link' , $thirstylink );
|
512 |
|
513 |
// save affiliate link
|
514 |
$thirstylink->save();
|
548 |
|
549 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
550 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
551 |
+
elseif ( ! current_user_can( apply_filters( 'ta_enable_quick_add_affiliate_link' , 'publish_posts' ) ) )
|
552 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
553 |
+
elseif ( ! check_ajax_referer( 'ta_process_quick_add_affiliate_link', false, false ) )
|
554 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
555 |
elseif ( ! isset( $_REQUEST[ 'ta_link_name' ] ) || ! isset( $_REQUEST[ 'ta_destination_url' ] ) || ! isset( $_REQUEST[ 'ta_redirect_type' ] ) )
|
556 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
557 |
else {
|
599 |
|
600 |
/**
|
601 |
* AJAX display shortcode editor form.
|
602 |
+
*
|
603 |
* @since 3.4.0
|
604 |
* @access public
|
605 |
*/
|
627 |
|
628 |
/**
|
629 |
* Transform Gutenberg affiliate link <ta> tags to <a> tags.
|
630 |
+
*
|
631 |
* @since 3.6
|
632 |
* @access public
|
633 |
*
|
634 |
+
* @global \WP_Post $post WP_Post object of currently loaded post.
|
635 |
*
|
636 |
* @param string $content WP_Post content.
|
637 |
* @return string Filtered WP_Post content.
|
643 |
if ( isset( $matches[0] ) && ! empty( $matches[0] ) ) {
|
644 |
|
645 |
$diff = 0;
|
646 |
+
|
647 |
foreach ( $matches[0] as $match ) {
|
648 |
|
649 |
$link_id = $this->_helper_functions->get_string_between( $match[0] , 'linkid="' , '"' );
|
Models/Marketing.php
CHANGED
@@ -29,7 +29,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
29 |
*
|
30 |
* @since 3.0.0
|
31 |
* @access private
|
32 |
-
* @var
|
33 |
*/
|
34 |
private static $_instance;
|
35 |
|
@@ -38,7 +38,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
38 |
*
|
39 |
* @since 3.0.0
|
40 |
* @access private
|
41 |
-
* @var
|
42 |
*/
|
43 |
private $_main_plugin;
|
44 |
|
@@ -124,7 +124,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
124 |
* @param Abstract_Main_Plugin_Class $main_plugin Main plugin object.
|
125 |
* @param Plugin_Constants $constants Plugin constants object.
|
126 |
* @param Helper_Functions $helper_functions Helper functions object.
|
127 |
-
* @return
|
128 |
*/
|
129 |
public static function get_instance( Abstract_Main_Plugin_Class $main_plugin , Plugin_Constants $constants , Helper_Functions $helper_functions ) {
|
130 |
|
@@ -147,55 +147,6 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
147 |
|
148 |
}
|
149 |
|
150 |
-
/**
|
151 |
-
* Flag to show TA Pro notice.
|
152 |
-
*
|
153 |
-
* @since 3.0.0
|
154 |
-
* @access public
|
155 |
-
*/
|
156 |
-
public function flag_show_tapro_notice() {
|
157 |
-
|
158 |
-
// prevent the notice showing up again when the plugin is deactivated/activated.
|
159 |
-
if ( get_option( Plugin_Constants::SHOW_TAPRO_NOTICE ) )
|
160 |
-
return;
|
161 |
-
|
162 |
-
update_option( Plugin_Constants::SHOW_TAPRO_NOTICE , 'yes' );
|
163 |
-
|
164 |
-
}
|
165 |
-
|
166 |
-
/**
|
167 |
-
* Record the user's review request response.
|
168 |
-
*
|
169 |
-
* @since 3.0.0
|
170 |
-
* @access public
|
171 |
-
*/
|
172 |
-
public function ajax_request_review_response() {
|
173 |
-
|
174 |
-
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
175 |
-
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
176 |
-
elseif ( !isset( $_POST[ 'review_request_response' ] ) )
|
177 |
-
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Required parameter not passed' , 'thirstyaffiliates' ) );
|
178 |
-
else {
|
179 |
-
|
180 |
-
update_option( Plugin_Constants::REVIEW_REQUEST_RESPONSE , $_POST[ 'review_request_response' ] );
|
181 |
-
|
182 |
-
if ( $_POST[ 'review_request_response' ] === 'review-later' ) {
|
183 |
-
wp_clear_scheduled_hook( Plugin_Constants::CRON_REQUEST_REVIEW );
|
184 |
-
wp_schedule_single_event( time() + 1209600, Plugin_Constants::CRON_REQUEST_REVIEW );
|
185 |
-
}
|
186 |
-
|
187 |
-
delete_option( Plugin_Constants::SHOW_REQUEST_REVIEW );
|
188 |
-
|
189 |
-
$response = array( 'status' => 'success' , 'success_msg' => __( 'Review request response saved' , 'thirstyaffiliates' ) );
|
190 |
-
|
191 |
-
}
|
192 |
-
|
193 |
-
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
194 |
-
echo wp_json_encode( $response );
|
195 |
-
wp_die();
|
196 |
-
|
197 |
-
}
|
198 |
-
|
199 |
/**
|
200 |
* Display the review request admin notice.
|
201 |
*
|
@@ -230,12 +181,6 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
230 |
return;
|
231 |
}
|
232 |
|
233 |
-
$screen = get_current_screen();
|
234 |
-
|
235 |
-
$post_type = get_post_type();
|
236 |
-
if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
|
237 |
-
$post_type = $_GET[ 'post_type' ];
|
238 |
-
|
239 |
$review_request_response = get_option( Plugin_Constants::REVIEW_REQUEST_RESPONSE );
|
240 |
|
241 |
if ( ! is_admin() || get_option( Plugin_Constants::SHOW_REQUEST_REVIEW ) !== 'yes' || ( $review_request_response !== 'review-later' && ! empty( $review_request_response ) ) )
|
@@ -280,7 +225,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
280 |
type: 'POST',
|
281 |
data: {
|
282 |
action: 'ta_dismiss_review_prompt',
|
283 |
-
|
284 |
type: type
|
285 |
},
|
286 |
})
|
@@ -305,48 +250,6 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
305 |
<?php
|
306 |
}
|
307 |
|
308 |
-
/**
|
309 |
-
* Display the TA Pro promotional admin notice.
|
310 |
-
*
|
311 |
-
* @since 3.0.0
|
312 |
-
* @access public
|
313 |
-
*/
|
314 |
-
public function show_tapro_admin_notice() {
|
315 |
-
|
316 |
-
$post_type = get_post_type();
|
317 |
-
if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
|
318 |
-
$post_type = $_GET[ 'post_type' ];
|
319 |
-
|
320 |
-
if ( ! is_admin() || ! current_user_can( 'manage_options' ) || $post_type !== Plugin_Constants::AFFILIATE_LINKS_CPT || get_option( Plugin_Constants::SHOW_TAPRO_NOTICE ) !== 'yes' || $this->_helper_functions->is_plugin_active( 'thirstyaffiliates-pro/thirstyaffiliates-pro.php' ) )
|
321 |
-
return;
|
322 |
-
|
323 |
-
$tapro_url = esc_url( 'https://thirstyaffiliates.com/pricing/?utm_source=Free%20Plugin&utm_medium=Pro&utm_campaign=Admin%20Notice' ); ?>
|
324 |
-
<div class="notice notice-error is-dismissible ta_tapro_admin_notice">
|
325 |
-
<?php
|
326 |
-
echo sprintf( __( '<h4>Hi there, we hope you\'re enjoying ThirstyAffiliates!</h4>
|
327 |
-
<p>Did you know we also have a Pro addon that can help you:</p>
|
328 |
-
<ul><li>Automatically link up affiliate links to keywords throughout your site (monetize your site faster!)</li>
|
329 |
-
<li>Give you more amazing advanced reports (see what is working and what is not!)</li>
|
330 |
-
<li>Let you link to different places depending on the visitor\'s country (geolocation links)</li>
|
331 |
-
<li>Let you import Amazon products as links (+ CSV import/export and more premium importing options)</li>
|
332 |
-
<li>... plus a whole lot more!</li></ul>
|
333 |
-
<p><a href="%s" target="_blank">Check out the ThristyAffiliates Pro features here →</a></p>' , 'thirstyaffiliates' ) , $tapro_url );
|
334 |
-
?>
|
335 |
-
</div>
|
336 |
-
|
337 |
-
<script>
|
338 |
-
( function( $ ) {
|
339 |
-
$( '.ta_tapro_admin_notice' ).on( 'click' , '.notice-dismiss' , function() {
|
340 |
-
$.ajax( ajaxurl , {
|
341 |
-
type: 'POST',
|
342 |
-
data: { action: 'ta_dismiss_marketing_notice' , notice : 'tapro_notice' }
|
343 |
-
} );
|
344 |
-
} );
|
345 |
-
} )( jQuery );
|
346 |
-
</script>
|
347 |
-
<?php
|
348 |
-
}
|
349 |
-
|
350 |
/**
|
351 |
* AJAX dismiss marketing notice.
|
352 |
*
|
@@ -357,6 +260,10 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
357 |
|
358 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
359 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
|
|
|
|
360 |
elseif ( ! isset( $_POST[ 'notice' ] ) )
|
361 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
362 |
else {
|
@@ -364,10 +271,6 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
364 |
$notice = sanitize_text_field( $_POST[ 'notice' ] );
|
365 |
|
366 |
switch( $notice ) {
|
367 |
-
|
368 |
-
case 'tapro_notice' :
|
369 |
-
$option = Plugin_Constants::SHOW_TAPRO_NOTICE;
|
370 |
-
break;
|
371 |
case 'enable_js_redirect_notice' :
|
372 |
$option = 'ta_show_enable_js_redirect_notice';
|
373 |
break;
|
@@ -432,19 +335,17 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
432 |
|
433 |
if ( get_option( 'ta_enable_stats_reporting_module' , 'yes' ) !== 'yes' ) return;
|
434 |
|
435 |
-
$screen = get_current_screen();
|
436 |
-
|
437 |
$post_type = get_post_type();
|
438 |
if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
|
439 |
$post_type = $_GET[ 'post_type' ];
|
440 |
|
441 |
-
if ( ! is_admin() || ! current_user_can( 'manage_options' ) || $post_type !== Plugin_Constants::AFFILIATE_LINKS_CPT || get_option( 'ta_show_enable_js_redirect_notice' , 'yes' ) !== 'yes' )
|
442 |
return;
|
443 |
|
444 |
?>
|
445 |
<div class="notice notice-error is-dismissible ta_enable_javascript_redirect_notice">
|
446 |
<?php
|
447 |
-
|
448 |
<p>ThirstyAffiliates version 3.2.5 introduces a new method of redirecting via javascript which will only run on your website's frontend.
|
449 |
We've added this so the plugin can provide more accurate tracking data of your affiliate link clicks.
|
450 |
This feature is turned on automatically for <strong>new installs</strong>, but for this install we would like to give you the choice of enabling the feature or not.</p>" , 'thirstyaffiliates' );
|
@@ -462,7 +363,11 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
462 |
$( '.ta_enable_javascript_redirect_notice' ).on( 'click' , '.notice-dismiss' , function() {
|
463 |
$.ajax( ajaxurl , {
|
464 |
type: 'POST',
|
465 |
-
data: {
|
|
|
|
|
|
|
|
|
466 |
} );
|
467 |
} );
|
468 |
|
@@ -471,7 +376,10 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
471 |
$( '.ta_enable_javascript_redirect_notice .notice-dismiss' ).trigger( 'click' );
|
472 |
$.ajax( ajaxurl , {
|
473 |
type: 'POST',
|
474 |
-
data: {
|
|
|
|
|
|
|
475 |
} );
|
476 |
} );
|
477 |
|
@@ -506,7 +414,9 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
506 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
507 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
508 |
elseif ( ! current_user_can( 'manage_options' ) )
|
509 |
-
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You
|
|
|
|
|
510 |
else {
|
511 |
|
512 |
update_option( 'ta_enable_javascript_frontend_redirect' , 'yes' );
|
@@ -549,7 +459,7 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
549 |
* @since 3.3.0
|
550 |
* @access public
|
551 |
*
|
552 |
-
* @param WP_Post $post Affiliate link WP_Post object.
|
553 |
*/
|
554 |
public function advanced_features_marketing_metabox_cb( $post ) {
|
555 |
|
@@ -560,24 +470,30 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
560 |
|
561 |
public function dismiss_review_prompt() {
|
562 |
|
563 |
-
if (
|
564 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
565 |
}
|
566 |
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
}
|
582 |
}
|
583 |
|
@@ -595,14 +511,12 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
595 |
*
|
596 |
* @since 3.0.0
|
597 |
* @access public
|
598 |
-
* @implements ThirstyAffiliates\Interfaces\Activatable_Interface
|
599 |
*/
|
600 |
public function activate() {
|
601 |
|
602 |
wp_clear_scheduled_hook( Plugin_Constants::CRON_REQUEST_REVIEW );
|
603 |
-
wp_clear_scheduled_hook( Plugin_Constants::CRON_TAPRO_NOTICE );
|
604 |
wp_schedule_single_event( time() + 1209600 , Plugin_Constants::CRON_REQUEST_REVIEW );
|
605 |
-
wp_schedule_single_event( time() + 172800 , Plugin_Constants::CRON_TAPRO_NOTICE );
|
606 |
|
607 |
}
|
608 |
|
@@ -611,15 +525,14 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
611 |
*
|
612 |
* @since 3.0.0
|
613 |
* @access public
|
614 |
-
* @implements ThirstyAffiliates\Interfaces\Initiable_Interface
|
615 |
*/
|
616 |
public function initialize() {
|
617 |
|
618 |
-
add_action( '
|
619 |
-
add_action( '
|
620 |
-
add_action( '
|
621 |
-
|
622 |
-
add_action( 'wp_ajax_ta_dismiss_review_prompt' , array( $this, 'dismiss_review_prompt' ) );
|
623 |
}
|
624 |
|
625 |
/**
|
@@ -627,14 +540,12 @@ class Marketing implements Model_Interface , Activatable_Interface , Initiable_I
|
|
627 |
*
|
628 |
* @since 3.0.0
|
629 |
* @access public
|
630 |
-
* @implements ThirstyAffiliates\Interfaces\Model_Interface
|
631 |
*/
|
632 |
public function run() {
|
633 |
|
634 |
add_action( Plugin_Constants::CRON_REQUEST_REVIEW , array( $this , 'flag_show_review_request' ) );
|
635 |
-
add_action( Plugin_Constants::CRON_TAPRO_NOTICE , array( $this , 'flag_show_tapro_notice' ) );
|
636 |
add_action( 'admin_notices' , array( $this , 'show_review_request_notice' ) );
|
637 |
-
// add_action( 'admin_notices' , array( $this , 'show_tapro_admin_notice' ) );
|
638 |
add_action( 'admin_notices' , array( $this , 'display_enable_js_redirect_notice' ) );
|
639 |
add_action( 'admin_menu' , array( $this , 'add_pro_features_menu_link' ) , 20 );
|
640 |
add_action( 'admin_head', array( $this , 'add_pro_features_menu_link_target' ) );
|
29 |
*
|
30 |
* @since 3.0.0
|
31 |
* @access private
|
32 |
+
* @var Marketing
|
33 |
*/
|
34 |
private static $_instance;
|
35 |
|
38 |
*
|
39 |
* @since 3.0.0
|
40 |
* @access private
|
41 |
+
* @var Abstract_Main_Plugin_Class
|
42 |
*/
|
43 |
private $_main_plugin;
|
44 |
|
124 |
* @param Abstract_Main_Plugin_Class $main_plugin Main plugin object.
|
125 |
* @param Plugin_Constants $constants Plugin constants object.
|
126 |
* @param Helper_Functions $helper_functions Helper functions object.
|
127 |
+
* @return Marketing
|
128 |
*/
|
129 |
public static function get_instance( Abstract_Main_Plugin_Class $main_plugin , Plugin_Constants $constants , Helper_Functions $helper_functions ) {
|
130 |
|
147 |
|
148 |
}
|
149 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
/**
|
151 |
* Display the review request admin notice.
|
152 |
*
|
181 |
return;
|
182 |
}
|
183 |
|
|
|
|
|
|
|
|
|
|
|
|
|
184 |
$review_request_response = get_option( Plugin_Constants::REVIEW_REQUEST_RESPONSE );
|
185 |
|
186 |
if ( ! is_admin() || get_option( Plugin_Constants::SHOW_REQUEST_REVIEW ) !== 'yes' || ( $review_request_response !== 'review-later' && ! empty( $review_request_response ) ) )
|
225 |
type: 'POST',
|
226 |
data: {
|
227 |
action: 'ta_dismiss_review_prompt',
|
228 |
+
_ajax_nonce: "<?php echo wp_create_nonce( 'ta_dismiss_review_prompt' ) ?>",
|
229 |
type: type
|
230 |
},
|
231 |
})
|
250 |
<?php
|
251 |
}
|
252 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
/**
|
254 |
* AJAX dismiss marketing notice.
|
255 |
*
|
260 |
|
261 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
262 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
263 |
+
elseif ( ! current_user_can( 'manage_options' ) )
|
264 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
265 |
+
elseif ( ! check_ajax_referer( 'ta_dismiss_marketing_notice', false, false ) )
|
266 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
267 |
elseif ( ! isset( $_POST[ 'notice' ] ) )
|
268 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
269 |
else {
|
271 |
$notice = sanitize_text_field( $_POST[ 'notice' ] );
|
272 |
|
273 |
switch( $notice ) {
|
|
|
|
|
|
|
|
|
274 |
case 'enable_js_redirect_notice' :
|
275 |
$option = 'ta_show_enable_js_redirect_notice';
|
276 |
break;
|
335 |
|
336 |
if ( get_option( 'ta_enable_stats_reporting_module' , 'yes' ) !== 'yes' ) return;
|
337 |
|
|
|
|
|
338 |
$post_type = get_post_type();
|
339 |
if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
|
340 |
$post_type = $_GET[ 'post_type' ];
|
341 |
|
342 |
+
if ( ! is_admin() || ! current_user_can( 'manage_options' ) || $post_type !== Plugin_Constants::AFFILIATE_LINKS_CPT || get_option( 'ta_show_enable_js_redirect_notice' , 'yes' ) !== 'yes' || get_option( 'ta_enable_javascript_frontend_redirect' ) === 'yes' )
|
343 |
return;
|
344 |
|
345 |
?>
|
346 |
<div class="notice notice-error is-dismissible ta_enable_javascript_redirect_notice">
|
347 |
<?php
|
348 |
+
_e( "<h4>Enable Enhanced Javascript Redirect</h4>
|
349 |
<p>ThirstyAffiliates version 3.2.5 introduces a new method of redirecting via javascript which will only run on your website's frontend.
|
350 |
We've added this so the plugin can provide more accurate tracking data of your affiliate link clicks.
|
351 |
This feature is turned on automatically for <strong>new installs</strong>, but for this install we would like to give you the choice of enabling the feature or not.</p>" , 'thirstyaffiliates' );
|
363 |
$( '.ta_enable_javascript_redirect_notice' ).on( 'click' , '.notice-dismiss' , function() {
|
364 |
$.ajax( ajaxurl , {
|
365 |
type: 'POST',
|
366 |
+
data: {
|
367 |
+
action: 'ta_dismiss_marketing_notice',
|
368 |
+
_ajax_nonce: '<?php echo esc_js( wp_create_nonce( 'ta_dismiss_marketing_notice' ) ); ?>',
|
369 |
+
notice: 'enable_js_redirect_notice'
|
370 |
+
}
|
371 |
} );
|
372 |
} );
|
373 |
|
376 |
$( '.ta_enable_javascript_redirect_notice .notice-dismiss' ).trigger( 'click' );
|
377 |
$.ajax( ajaxurl , {
|
378 |
type: 'POST',
|
379 |
+
data: {
|
380 |
+
action: 'ta_enable_js_redirect',
|
381 |
+
_ajax_nonce: '<?php echo esc_js( wp_create_nonce( 'ta_enable_js_redirect' ) ); ?>',
|
382 |
+
}
|
383 |
} );
|
384 |
} );
|
385 |
|
414 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
415 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
416 |
elseif ( ! current_user_can( 'manage_options' ) )
|
417 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
418 |
+
elseif ( ! check_ajax_referer( 'ta_enable_js_redirect', false, false ) )
|
419 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
420 |
else {
|
421 |
|
422 |
update_option( 'ta_enable_javascript_frontend_redirect' , 'yes' );
|
459 |
* @since 3.3.0
|
460 |
* @access public
|
461 |
*
|
462 |
+
* @param \WP_Post $post Affiliate link WP_Post object.
|
463 |
*/
|
464 |
public function advanced_features_marketing_metabox_cb( $post ) {
|
465 |
|
470 |
|
471 |
public function dismiss_review_prompt() {
|
472 |
|
473 |
+
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) {
|
474 |
+
wp_send_json_error( __( 'Invalid AJAX call', 'thirstyaffiliates' ) );
|
475 |
+
} elseif ( ! current_user_can( 'manage_options' ) ) {
|
476 |
+
wp_send_json_error( __( 'You do not have permission to do this', 'thirstyaffiliates' ) );
|
477 |
+
} elseif ( ! check_ajax_referer( 'ta_dismiss_review_prompt', false, false ) ) {
|
478 |
+
wp_send_json_error( __( 'Security Check Failed', 'thirstyaffiliates' ) );
|
479 |
+
} elseif ( ! isset( $_POST['type'] ) ) {
|
480 |
+
wp_send_json_error( __( 'Missing required post data', 'thirstyaffiliates' ) );
|
481 |
}
|
482 |
|
483 |
+
$type = sanitize_key( wp_unslash( $_POST['type'] ) );
|
484 |
+
|
485 |
+
if ( 'remove' === $type ) {
|
486 |
+
update_option( 'ta_review_prompt_removed', true );
|
487 |
+
wp_send_json_success( array(
|
488 |
+
'status' => 'removed'
|
489 |
+
) );
|
490 |
+
} else if ( 'delay' === $type ) {
|
491 |
+
update_option( 'ta_review_prompt_delay', array(
|
492 |
+
'delayed_until' => time() + WEEK_IN_SECONDS
|
493 |
+
) );
|
494 |
+
wp_send_json_success( array(
|
495 |
+
'status' => 'delayed'
|
496 |
+
) );
|
497 |
}
|
498 |
}
|
499 |
|
511 |
*
|
512 |
* @since 3.0.0
|
513 |
* @access public
|
514 |
+
* @implements \ThirstyAffiliates\Interfaces\Activatable_Interface
|
515 |
*/
|
516 |
public function activate() {
|
517 |
|
518 |
wp_clear_scheduled_hook( Plugin_Constants::CRON_REQUEST_REVIEW );
|
|
|
519 |
wp_schedule_single_event( time() + 1209600 , Plugin_Constants::CRON_REQUEST_REVIEW );
|
|
|
520 |
|
521 |
}
|
522 |
|
525 |
*
|
526 |
* @since 3.0.0
|
527 |
* @access public
|
528 |
+
* @implements \ThirstyAffiliates\Interfaces\Initiable_Interface
|
529 |
*/
|
530 |
public function initialize() {
|
531 |
|
532 |
+
add_action( 'wp_ajax_ta_dismiss_marketing_notice' , array( $this , 'ajax_dismiss_marketing_notice' ) );
|
533 |
+
add_action( 'wp_ajax_ta_enable_js_redirect' , array( $this , 'ajax_enable_js_redirect' ) );
|
534 |
+
add_action( 'wp_ajax_ta_dismiss_review_prompt' , array( $this, 'dismiss_review_prompt' ) );
|
535 |
+
|
|
|
536 |
}
|
537 |
|
538 |
/**
|
540 |
*
|
541 |
* @since 3.0.0
|
542 |
* @access public
|
543 |
+
* @implements \ThirstyAffiliates\Interfaces\Model_Interface
|
544 |
*/
|
545 |
public function run() {
|
546 |
|
547 |
add_action( Plugin_Constants::CRON_REQUEST_REVIEW , array( $this , 'flag_show_review_request' ) );
|
|
|
548 |
add_action( 'admin_notices' , array( $this , 'show_review_request_notice' ) );
|
|
|
549 |
add_action( 'admin_notices' , array( $this , 'display_enable_js_redirect_notice' ) );
|
550 |
add_action( 'admin_menu' , array( $this , 'add_pro_features_menu_link' ) , 20 );
|
551 |
add_action( 'admin_head', array( $this , 'add_pro_features_menu_link_target' ) );
|
Models/Migration.php
CHANGED
@@ -29,7 +29,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
29 |
*
|
30 |
* @since 3.0.0
|
31 |
* @access private
|
32 |
-
* @var
|
33 |
*/
|
34 |
private static $_instance;
|
35 |
|
@@ -38,7 +38,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
38 |
*
|
39 |
* @since 3.0.0
|
40 |
* @access private
|
41 |
-
* @var
|
42 |
*/
|
43 |
private $_main_plugin;
|
44 |
|
@@ -125,7 +125,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
125 |
* @param Abstract_Main_Plugin_Class $main_plugin Main plugin object.
|
126 |
* @param Plugin_Constants $constants Plugin constants object.
|
127 |
* @param Helper_Functions $helper_functions Helper functions object.
|
128 |
-
* @return
|
129 |
*/
|
130 |
public static function get_instance( Abstract_Main_Plugin_Class $main_plugin , Plugin_Constants $constants , Helper_Functions $helper_functions ) {
|
131 |
|
@@ -284,6 +284,8 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
284 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX Call.' , 'thirstyaffiliates' ) );
|
285 |
elseif ( !$this->_helper_functions->current_user_authorized() )
|
286 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Unauthorized operation. Only authorized accounts can do data migration.' , 'thirstyaffiliates' ) );
|
|
|
|
|
287 |
else {
|
288 |
|
289 |
$this->migrate_old_plugin_data();
|
@@ -435,7 +437,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
435 |
* @since 3.0.0
|
436 |
* @access public
|
437 |
*
|
438 |
-
* @global
|
439 |
* @param int $link_id Affiliate link id.
|
440 |
* @param array $old_link_meta Old thirsty affiliate link meta.
|
441 |
* @param array $old_link_meta_cache Old thirsty affiliate link meta. Passed by reference. Used to track down the new old meta data.
|
@@ -519,7 +521,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
519 |
* @since 3.0.0
|
520 |
* @access public
|
521 |
*
|
522 |
-
* @global
|
523 |
*/
|
524 |
private function _generate_link_meta_delete_sql() {
|
525 |
|
@@ -538,7 +540,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
538 |
* @since 3.0.0
|
539 |
* @access public
|
540 |
*
|
541 |
-
* @global
|
542 |
*/
|
543 |
public function migrate_link_meta() {
|
544 |
|
@@ -838,7 +840,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
838 |
*
|
839 |
* @since 3.0.0
|
840 |
* @access public
|
841 |
-
* @implements ThirstyAffiliates\Interfaces\Activatable_Interface
|
842 |
*/
|
843 |
public function activate() {
|
844 |
|
@@ -853,7 +855,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
853 |
*
|
854 |
* @since 3.0.0
|
855 |
* @access public
|
856 |
-
* @implements ThirstyAffiliates\Interfaces\Initiable_Interface
|
857 |
*/
|
858 |
public function initialize() {
|
859 |
|
@@ -866,7 +868,7 @@ class Migration implements Model_Interface , Activatable_Interface , Initiable_I
|
|
866 |
*
|
867 |
* @since 3.0.0
|
868 |
* @access public
|
869 |
-
* @implements ThirstyAffiliates\Interfaces\Model_Interface
|
870 |
*/
|
871 |
public function run() {
|
872 |
|
29 |
*
|
30 |
* @since 3.0.0
|
31 |
* @access private
|
32 |
+
* @var Migration
|
33 |
*/
|
34 |
private static $_instance;
|
35 |
|
38 |
*
|
39 |
* @since 3.0.0
|
40 |
* @access private
|
41 |
+
* @var Abstract_Main_Plugin_Class
|
42 |
*/
|
43 |
private $_main_plugin;
|
44 |
|
125 |
* @param Abstract_Main_Plugin_Class $main_plugin Main plugin object.
|
126 |
* @param Plugin_Constants $constants Plugin constants object.
|
127 |
* @param Helper_Functions $helper_functions Helper functions object.
|
128 |
+
* @return Migration
|
129 |
*/
|
130 |
public static function get_instance( Abstract_Main_Plugin_Class $main_plugin , Plugin_Constants $constants , Helper_Functions $helper_functions ) {
|
131 |
|
284 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX Call.' , 'thirstyaffiliates' ) );
|
285 |
elseif ( !$this->_helper_functions->current_user_authorized() )
|
286 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Unauthorized operation. Only authorized accounts can do data migration.' , 'thirstyaffiliates' ) );
|
287 |
+
elseif ( ! check_ajax_referer( 'ta_migrate_old_plugin_data', false, false ) )
|
288 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
289 |
else {
|
290 |
|
291 |
$this->migrate_old_plugin_data();
|
437 |
* @since 3.0.0
|
438 |
* @access public
|
439 |
*
|
440 |
+
* @global \wpdb $wpdb Global $wpdb object.
|
441 |
* @param int $link_id Affiliate link id.
|
442 |
* @param array $old_link_meta Old thirsty affiliate link meta.
|
443 |
* @param array $old_link_meta_cache Old thirsty affiliate link meta. Passed by reference. Used to track down the new old meta data.
|
521 |
* @since 3.0.0
|
522 |
* @access public
|
523 |
*
|
524 |
+
* @global \wpdb $wpdb Global $wpdb object.
|
525 |
*/
|
526 |
private function _generate_link_meta_delete_sql() {
|
527 |
|
540 |
* @since 3.0.0
|
541 |
* @access public
|
542 |
*
|
543 |
+
* @global \wpdb $wpdb Global $wpdb object.
|
544 |
*/
|
545 |
public function migrate_link_meta() {
|
546 |
|
840 |
*
|
841 |
* @since 3.0.0
|
842 |
* @access public
|
843 |
+
* @implements \ThirstyAffiliates\Interfaces\Activatable_Interface
|
844 |
*/
|
845 |
public function activate() {
|
846 |
|
855 |
*
|
856 |
* @since 3.0.0
|
857 |
* @access public
|
858 |
+
* @implements \ThirstyAffiliates\Interfaces\Initiable_Interface
|
859 |
*/
|
860 |
public function initialize() {
|
861 |
|
868 |
*
|
869 |
* @since 3.0.0
|
870 |
* @access public
|
871 |
+
* @implements \ThirstyAffiliates\Interfaces\Model_Interface
|
872 |
*/
|
873 |
public function run() {
|
874 |
|
Models/Script_Loader.php
CHANGED
@@ -110,7 +110,7 @@ class Script_Loader implements Model_Interface {
|
|
110 |
* @since 3.4.0 Moved the code to load scripts for the wp editor to its own function.
|
111 |
* @access public
|
112 |
*
|
113 |
-
* @global WP_Post $post WP_Post object of the current screen.
|
114 |
*
|
115 |
* @param string $handle Unique identifier of the current backend page.
|
116 |
*/
|
@@ -124,14 +124,6 @@ class Script_Loader implements Model_Interface {
|
|
124 |
if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
|
125 |
$post_type = $_GET[ 'post_type' ];
|
126 |
|
127 |
-
$review_request_response = get_option( Plugin_Constants::REVIEW_REQUEST_RESPONSE );
|
128 |
-
|
129 |
-
// Show review request popup
|
130 |
-
if ( is_admin() && current_user_can( 'manage_options' ) && $post_type === Plugin_Constants::AFFILIATE_LINKS_CPT && get_option( Plugin_Constants::SHOW_REQUEST_REVIEW ) === 'yes' && ( $review_request_response === 'review-later' || empty( $review_request_response ) ) ) {
|
131 |
-
|
132 |
-
wp_enqueue_script( 'review-request' , $this->_constants->JS_ROOT_URL() . 'app/ta-review-request.js' , array( 'jquery' ) , Plugin_Constants::VERSION , true );
|
133 |
-
}
|
134 |
-
|
135 |
// Link picker styles and scripts.
|
136 |
if ( is_admin() && current_user_can( 'edit_posts' ) && ! in_array( $screen->base , array( 'customize' ) ) ) {
|
137 |
|
@@ -165,7 +157,8 @@ class Script_Loader implements Model_Interface {
|
|
165 |
wp_localize_script( 'ta_import_export_js' , 'import_export_var' , array(
|
166 |
'please_input_settings_string' => __( 'Please input settings string' , 'thirstyaffiliates' ),
|
167 |
'settings_string_copied' => __( 'Settings string copied' , 'thirstyaffiliates' ),
|
168 |
-
'failed_copy_settings_string' => __( 'Failed to copy settings string' , 'thirstyaffiliates' )
|
|
|
169 |
) );
|
170 |
|
171 |
} elseif ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] === 'ta_help_settings' ) {
|
@@ -177,7 +170,8 @@ class Script_Loader implements Model_Interface {
|
|
177 |
wp_enqueue_script( 'ta_migration_js' , $this->_constants->JS_ROOT_URL() . 'app/migration/dist/migration.js' , array() , true );
|
178 |
wp_localize_script( 'ta_migration_js' , 'migration_var' , array(
|
179 |
'i18n_migration_failed' => __( 'Failed to do data migration' , 'thirstyaffiliates' ),
|
180 |
-
'i18n_confirm_migration' => __( 'Are you sure you want to migrate your ThirstyAffiliates data to version 3 format?' , 'thirstyaffiliates' )
|
|
|
181 |
) );
|
182 |
|
183 |
}
|
@@ -196,6 +190,14 @@ class Script_Loader implements Model_Interface {
|
|
196 |
wp_enqueue_script( 'jquery_tiptip' , $this->_constants->JS_ROOT_URL() . 'lib/jquery-tiptip/jquery.tipTip.min.js' , array() , Plugin_Constants::VERSION , true );
|
197 |
wp_enqueue_script( 'ta_affiliate-link-page_js' , $this->_constants->JS_ROOT_URL() . 'app/affiliate_link_page/dist/affiliate-link-page.js' , array() , Plugin_Constants::VERSION , true );
|
198 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
199 |
} elseif ( $screen->id == 'thirstylink_page_thirsty-reports' ) {
|
200 |
|
201 |
wp_enqueue_style( 'jquery-ui-styles' , '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.min.css' , array() , '1.11.4', 'all' );
|
110 |
* @since 3.4.0 Moved the code to load scripts for the wp editor to its own function.
|
111 |
* @access public
|
112 |
*
|
113 |
+
* @global \WP_Post $post WP_Post object of the current screen.
|
114 |
*
|
115 |
* @param string $handle Unique identifier of the current backend page.
|
116 |
*/
|
124 |
if ( !$post_type && isset( $_GET[ 'post_type' ] ) )
|
125 |
$post_type = $_GET[ 'post_type' ];
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
// Link picker styles and scripts.
|
128 |
if ( is_admin() && current_user_can( 'edit_posts' ) && ! in_array( $screen->base , array( 'customize' ) ) ) {
|
129 |
|
157 |
wp_localize_script( 'ta_import_export_js' , 'import_export_var' , array(
|
158 |
'please_input_settings_string' => __( 'Please input settings string' , 'thirstyaffiliates' ),
|
159 |
'settings_string_copied' => __( 'Settings string copied' , 'thirstyaffiliates' ),
|
160 |
+
'failed_copy_settings_string' => __( 'Failed to copy settings string' , 'thirstyaffiliates' ),
|
161 |
+
'import_settings_nonce' => wp_create_nonce( 'ta_import_settings' ),
|
162 |
) );
|
163 |
|
164 |
} elseif ( isset( $_GET[ 'tab' ] ) && $_GET[ 'tab' ] === 'ta_help_settings' ) {
|
170 |
wp_enqueue_script( 'ta_migration_js' , $this->_constants->JS_ROOT_URL() . 'app/migration/dist/migration.js' , array() , true );
|
171 |
wp_localize_script( 'ta_migration_js' , 'migration_var' , array(
|
172 |
'i18n_migration_failed' => __( 'Failed to do data migration' , 'thirstyaffiliates' ),
|
173 |
+
'i18n_confirm_migration' => __( 'Are you sure you want to migrate your ThirstyAffiliates data to version 3 format?' , 'thirstyaffiliates' ),
|
174 |
+
'migration_nonce' => wp_create_nonce( 'ta_migrate_old_plugin_data' )
|
175 |
) );
|
176 |
|
177 |
}
|
190 |
wp_enqueue_script( 'jquery_tiptip' , $this->_constants->JS_ROOT_URL() . 'lib/jquery-tiptip/jquery.tipTip.min.js' , array() , Plugin_Constants::VERSION , true );
|
191 |
wp_enqueue_script( 'ta_affiliate-link-page_js' , $this->_constants->JS_ROOT_URL() . 'app/affiliate_link_page/dist/affiliate-link-page.js' , array() , Plugin_Constants::VERSION , true );
|
192 |
|
193 |
+
wp_localize_script( 'ta_affiliate-link-page_js', 'ta_affiliate_link_page_params', array(
|
194 |
+
'insert_external_image_nonce' => wp_create_nonce( 'ta_insert_external_image' ),
|
195 |
+
'add_attachments_nonce' => wp_create_nonce( 'ta_add_attachments_to_affiliate_link' ),
|
196 |
+
'remove_attachments_nonce' => wp_create_nonce( 'ta_remove_attachments_from_affiliate_link' ),
|
197 |
+
'get_category_slug_nonce' => wp_create_nonce( 'ta_get_category_slug' ),
|
198 |
+
'link_inserted_scanner_nonce' => wp_create_nonce( 'ta_link_inserted_scanner' ),
|
199 |
+
) );
|
200 |
+
|
201 |
} elseif ( $screen->id == 'thirstylink_page_thirsty-reports' ) {
|
202 |
|
203 |
wp_enqueue_style( 'jquery-ui-styles' , '//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.min.css' , array() , '1.11.4', 'all' );
|
Models/Settings.php
CHANGED
@@ -1913,40 +1913,13 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
1913 |
|--------------------------------------------------------------------------
|
1914 |
*/
|
1915 |
|
1916 |
-
/**
|
1917 |
-
* Get global settings string via ajax.
|
1918 |
-
*
|
1919 |
-
* @since 3.0.0
|
1920 |
-
* @access public
|
1921 |
-
*/
|
1922 |
-
public function ajax_get_global_settings_string() {
|
1923 |
-
|
1924 |
-
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
1925 |
-
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
1926 |
-
else {
|
1927 |
-
|
1928 |
-
$global_settings_string = $this->get_global_settings_string();
|
1929 |
-
|
1930 |
-
if ( is_wp_error( $global_settings_string ) )
|
1931 |
-
$response = array( 'status' => 'fail' , 'error_msg' => $global_settings_string->get_error_message() );
|
1932 |
-
else
|
1933 |
-
$response = array( 'status' => 'success' , 'global_settings_string' => $global_settings_string );
|
1934 |
-
|
1935 |
-
}
|
1936 |
-
|
1937 |
-
@header( 'Content-Type: application/json; charset=' . get_option( 'blog_charset' ) );
|
1938 |
-
echo wp_json_encode( $response );
|
1939 |
-
wp_die();
|
1940 |
-
|
1941 |
-
}
|
1942 |
-
|
1943 |
/**
|
1944 |
* Get global settings string.
|
1945 |
*
|
1946 |
* @since 3.0.0
|
1947 |
* @access public
|
1948 |
*
|
1949 |
-
* @return WP_Error|string WP_Error on error, Base 64 encoded serialized global plugin settings otherwise.
|
1950 |
*/
|
1951 |
public function get_global_settings_string() {
|
1952 |
|
@@ -1971,7 +1944,11 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
1971 |
|
1972 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
1973 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
1974 |
-
elseif ( !
|
|
|
|
|
|
|
|
|
1975 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Required parameter not passed' , 'thirstyaffiliates' ) );
|
1976 |
else {
|
1977 |
|
@@ -1997,13 +1974,10 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
1997 |
* @access public
|
1998 |
*
|
1999 |
* @param string $global_settings_string Settings string.
|
2000 |
-
* @return WP_Error | boolean WP_Error instance on failure, boolean true otherwise.
|
2001 |
*/
|
2002 |
public function import_settings( $global_settings_string ) {
|
2003 |
|
2004 |
-
if ( !$this->_helper_functions->current_user_authorized() )
|
2005 |
-
return new \WP_Error( 'ta_unauthorized_operation_import_settings' , __( 'Unauthorized operation. Only authorized accounts can import settings' , 'thirstyaffiliates' ) );
|
2006 |
-
|
2007 |
$settings_arr = @unserialize( base64_decode( $global_settings_string ) );
|
2008 |
|
2009 |
if ( !is_array( $settings_arr ) )
|
@@ -2112,7 +2086,7 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
2112 |
*
|
2113 |
* @since 3.0.0
|
2114 |
* @access public
|
2115 |
-
* @implements ThirstyAffiliates\Interfaces\Activatable_Interface
|
2116 |
*/
|
2117 |
public function activate() {
|
2118 |
|
@@ -2133,11 +2107,10 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
2133 |
*
|
2134 |
* @since 3.0.0
|
2135 |
* @access public
|
2136 |
-
* @implements ThirstyAffiliates\Interfaces\Initiable_Interface
|
2137 |
*/
|
2138 |
public function initialize() {
|
2139 |
|
2140 |
-
add_action( 'wp_ajax_ta_get_global_settings_string' , array( $this , 'ajax_get_global_settings_string' ) );
|
2141 |
add_action( 'wp_ajax_ta_import_settings' , array( $this , 'ajax_import_settings' ) );
|
2142 |
add_action( 'wp_ajax_ta_dismiss_upgrade_header', array( $this, 'dismiss_upgrade_header' ) );
|
2143 |
}
|
@@ -2149,12 +2122,14 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
2149 |
*/
|
2150 |
public function dismiss_upgrade_header() {
|
2151 |
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
|
|
|
|
2156 |
|
2157 |
-
|
2158 |
}
|
2159 |
|
2160 |
public function ta_admin_header() {
|
@@ -2188,7 +2163,7 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
2188 |
type: 'POST',
|
2189 |
data: {
|
2190 |
action: 'ta_dismiss_upgrade_header',
|
2191 |
-
|
2192 |
},
|
2193 |
})
|
2194 |
.done(function() {
|
@@ -2361,7 +2336,7 @@ class Settings implements Model_Interface , Activatable_Interface , Initiable_In
|
|
2361 |
/**
|
2362 |
* Execute model.
|
2363 |
*
|
2364 |
-
* @implements
|
2365 |
*
|
2366 |
* @since 3.0.0
|
2367 |
* @access public
|
1913 |
|--------------------------------------------------------------------------
|
1914 |
*/
|
1915 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1916 |
/**
|
1917 |
* Get global settings string.
|
1918 |
*
|
1919 |
* @since 3.0.0
|
1920 |
* @access public
|
1921 |
*
|
1922 |
+
* @return \WP_Error|string WP_Error on error, Base 64 encoded serialized global plugin settings otherwise.
|
1923 |
*/
|
1924 |
public function get_global_settings_string() {
|
1925 |
|
1944 |
|
1945 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
1946 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
1947 |
+
elseif ( ! $this->_helper_functions->current_user_authorized() )
|
1948 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
1949 |
+
elseif ( ! check_ajax_referer( 'ta_import_settings', false, false ) )
|
1950 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Security Check Failed' , 'thirstyaffiliates' ) );
|
1951 |
+
elseif ( ! isset( $_POST[ 'ta_settings_string' ] ) || ! is_string( $_POST[ 'ta_settings_string' ] ) )
|
1952 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Required parameter not passed' , 'thirstyaffiliates' ) );
|
1953 |
else {
|
1954 |
|
1974 |
* @access public
|
1975 |
*
|
1976 |
* @param string $global_settings_string Settings string.
|
1977 |
+
* @return \WP_Error | boolean WP_Error instance on failure, boolean true otherwise.
|
1978 |
*/
|
1979 |
public function import_settings( $global_settings_string ) {
|
1980 |
|
|
|
|
|
|
|
1981 |
$settings_arr = @unserialize( base64_decode( $global_settings_string ) );
|
1982 |
|
1983 |
if ( !is_array( $settings_arr ) )
|
2086 |
*
|
2087 |
* @since 3.0.0
|
2088 |
* @access public
|
2089 |
+
* @implements \ThirstyAffiliates\Interfaces\Activatable_Interface
|
2090 |
*/
|
2091 |
public function activate() {
|
2092 |
|
2107 |
*
|
2108 |
* @since 3.0.0
|
2109 |
* @access public
|
2110 |
+
* @implements \ThirstyAffiliates\Interfaces\Initiable_Interface
|
2111 |
*/
|
2112 |
public function initialize() {
|
2113 |
|
|
|
2114 |
add_action( 'wp_ajax_ta_import_settings' , array( $this , 'ajax_import_settings' ) );
|
2115 |
add_action( 'wp_ajax_ta_dismiss_upgrade_header', array( $this, 'dismiss_upgrade_header' ) );
|
2116 |
}
|
2122 |
*/
|
2123 |
public function dismiss_upgrade_header() {
|
2124 |
|
2125 |
+
// Security check
|
2126 |
+
if ( ! wp_doing_ajax() ) {
|
2127 |
+
wp_send_json_error( __( 'Invalid AJAX call', 'thirstyaffiliates' ) );
|
2128 |
+
} elseif ( ! check_ajax_referer( 'ta_dismiss_upgrade_header', false, false ) ) {
|
2129 |
+
wp_send_json_error( __( 'Security Check Failed', 'thirstyaffiliates' ) );
|
2130 |
+
}
|
2131 |
|
2132 |
+
update_option( 'ta_dismiss_upgrade_header', true );
|
2133 |
}
|
2134 |
|
2135 |
public function ta_admin_header() {
|
2163 |
type: 'POST',
|
2164 |
data: {
|
2165 |
action: 'ta_dismiss_upgrade_header',
|
2166 |
+
_ajax_nonce: "<?php echo wp_create_nonce( 'ta_dismiss_upgrade_header' ); ?>"
|
2167 |
},
|
2168 |
})
|
2169 |
.done(function() {
|
2336 |
/**
|
2337 |
* Execute model.
|
2338 |
*
|
2339 |
+
* @implements \ThirstyAffiliates\Interfaces\Model_Interface
|
2340 |
*
|
2341 |
* @since 3.0.0
|
2342 |
* @access public
|
Models/Stats_Reporting.php
CHANGED
@@ -402,6 +402,8 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
402 |
|
403 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
404 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
405 |
elseif ( ! isset( $_POST[ 'link_id' ] ) )
|
406 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
407 |
else {
|
@@ -448,6 +450,8 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
448 |
|
449 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
450 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
|
|
|
|
451 |
elseif ( ! isset( $_POST[ 'timezone' ] ) )
|
452 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
453 |
else {
|
@@ -720,9 +724,23 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
720 |
break;
|
721 |
|
722 |
case 'custom' :
|
723 |
-
$data[ 'type' ]
|
724 |
-
|
725 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
726 |
break;
|
727 |
|
728 |
case '7day' :
|
@@ -1043,7 +1061,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
1043 |
*
|
1044 |
* @since 3.0.0
|
1045 |
* @access public
|
1046 |
-
* @
|
1047 |
*/
|
1048 |
public function initialize() {
|
1049 |
|
@@ -1051,10 +1069,10 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
1051 |
if ( get_option( 'ta_enable_stats_reporting_module' , 'yes' ) !== 'yes' )
|
1052 |
return;
|
1053 |
|
1054 |
-
add_action( 'wp_ajax_ta_click_data_redirect' , array( $this , 'ajax_save_click_data_on_redirect' )
|
1055 |
-
add_action( '
|
1056 |
-
add_action( '
|
1057 |
-
add_action( '
|
1058 |
}
|
1059 |
|
1060 |
/**
|
@@ -1062,7 +1080,7 @@ class Stats_Reporting implements Model_Interface , Initiable_Interface , Activat
|
|
1062 |
*
|
1063 |
* @since 3.0.0
|
1064 |
* @access public
|
1065 |
-
* @
|
1066 |
*/
|
1067 |
public function run() {
|
1068 |
|
402 |
|
403 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
404 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
405 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface( 'reports', 'manage_options' ) ) )
|
406 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
407 |
elseif ( ! isset( $_POST[ 'link_id' ] ) )
|
408 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
409 |
else {
|
450 |
|
451 |
if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX )
|
452 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Invalid AJAX call' , 'thirstyaffiliates' ) );
|
453 |
+
elseif ( ! current_user_can( $this->_helper_functions->get_capability_for_interface( 'reports', 'manage_options' ) ) )
|
454 |
+
$response = array( 'status' => 'fail' , 'error_msg' => __( 'You do not have permission to do this' , 'thirstyaffiliates' ) );
|
455 |
elseif ( ! isset( $_POST[ 'timezone' ] ) )
|
456 |
$response = array( 'status' => 'fail' , 'error_msg' => __( 'Missing required post data' , 'thirstyaffiliates' ) );
|
457 |
else {
|
724 |
break;
|
725 |
|
726 |
case 'custom' :
|
727 |
+
$data[ 'type' ] = 'custom';
|
728 |
+
|
729 |
+
try {
|
730 |
+
$data[ 'start_date' ] = new \DateTime( $start_date , $timezone );
|
731 |
+
$data[ 'end_date' ] = new \DateTime( $end_date . ' 23:59:59' , $timezone );
|
732 |
+
} catch ( \Exception $e ) {
|
733 |
+
$start_date = new \DateTime( 'now -6 days' , $timezone );
|
734 |
+
|
735 |
+
// set hours, minutes and seconds to zero
|
736 |
+
$start_date->setTime( 0 , 0 , 0 );
|
737 |
+
$now->setTime( 23 , 59 , 59 );
|
738 |
+
|
739 |
+
$data[ 'type' ] = '7day';
|
740 |
+
$data[ 'start_date' ] = $start_date;
|
741 |
+
$data[ 'end_date' ] = $now;
|
742 |
+
}
|
743 |
+
|
744 |
break;
|
745 |
|
746 |
case '7day' :
|
1061 |
*
|
1062 |
* @since 3.0.0
|
1063 |
* @access public
|
1064 |
+
* @implements \ThirstyAffiliates\Interfaces\Initiable_Interface
|
1065 |
*/
|
1066 |
public function initialize() {
|
1067 |
|
1069 |
if ( get_option( 'ta_enable_stats_reporting_module' , 'yes' ) !== 'yes' )
|
1070 |
return;
|
1071 |
|
1072 |
+
add_action( 'wp_ajax_ta_click_data_redirect' , array( $this , 'ajax_save_click_data_on_redirect' ) );
|
1073 |
+
add_action( 'wp_ajax_nopriv_ta_click_data_redirect' , array( $this , 'ajax_save_click_data_on_redirect' ) );
|
1074 |
+
add_action( 'wp_ajax_ta_fetch_report_by_linkid' , array( $this , 'ajax_fetch_report_by_linkid' ) );
|
1075 |
+
add_action( 'wp_ajax_ta_init_first_report' , array( $this , 'ajax_init_first_report' ) );
|
1076 |
}
|
1077 |
|
1078 |
/**
|
1080 |
*
|
1081 |
* @since 3.0.0
|
1082 |
* @access public
|
1083 |
+
* @implements \ThirstyAffiliates\Interfaces\Model_Interface
|
1084 |
*/
|
1085 |
public function run() {
|
1086 |
|
js/app/advance_link_picker/dist/advance-link-picker.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
!function(t){function e(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){"use strict";function i(){m=l("#advanced_add_affiliate_link"),h=m.find(".search-panel"),p=m.find(".results-panel"),
|
1 |
+
!function(t){function e(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return t[i].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var n={};e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=3)}([function(t,e,n){"use strict";function i(){m=l("#advanced_add_affiliate_link"),h=m.find(".search-panel"),p=m.find(".results-panel"),_=p.find("ul.results-list"),u&&o(),h.on("keyup thirstysearch","#thirstylink-search",a),p.on("click",".load-more-results",r),_.on("ta_center_images",".images-block",s)}function a(){var t=l(this),e=h.find("#thirstylink-category"),n=p.find(".load-more-results"),i=e.val();if(i="all"==i?"":i,(!(k&&t.val().length<3)||i)&&!(i&&t.val()&&t.val().length<3)){if(v&&x!==t.val()&&C!==i&&(v.abort(),v=null),y||(y=_.html()),_.html('\n <li class="spinner">\n <i style="background-image: url('+Options.spinner_image+');"></i>\n <span>'+Options.searching_text+"</span>\n </li>\n "),(""==t.val()||t.val().length<3)&&!k&&!i)return g=2,_.html(y).show(),void n.show();if(x===t.val()&&C===i)return g=2,_.html(b).show(),void n.show();g=1,n.hide(),v=l.post(parent.ajaxurl,{action:"search_affiliate_links_query",keyword:t.val(),paged:g,advance:!0,category:i,post_id:Options.post_id},function(e){x=t.val(),C=i,k=!1,"success"==e.status&&(b=e.search_query_markup,_.html(e.search_query_markup).show(),g++,e.count<1?n.hide():n.show())},"json")}}function r(){var t=l(this),e=h.find("#thirstylink-search"),n=h.find("#thirstylink-category"),i=n.val();i="all"==i?"":i,t.hasClass("fetching")||((!g||g<2)&&(g=2),t.addClass("fetching").css("padding-top","4px").find(".spinner").show(),t.find(".button-text").hide(),v=l.post(parent.ajaxurl,{action:"search_affiliate_links_query",keyword:e.val(),paged:g,category:i,advance:!0},function(e){if(t.removeClass("fetching").find(".spinner").hide(),t.find(".button-text").show(),"success"==e.status){if(g++,e.count<1)return void t.hide();_.append(e.search_query_markup)}},"json"))}function s(){var t=l(this).find(".images img"),e=void 0,n=void 0,i=void 0;for(n=0;n<=t.length;n++)e=l(t[n]),e.width()&&(i=(e.width()-75)/2,e.css("margin-left",-i))}function o(){f&&d.selection.moveToBookmark(f),d.$("a.temp-ta-node").length<1&&(d.execCommand("mceInsertLink",!1,{class:"temp-ta-node",href:"_temp_ta_node"}),l(".wp-link-preview a[href='_temp_ta_node']").closest(".mce-inline-toolbar-grp").hide());var t=d.$("a.temp-ta-node");t.replaceWith('<span class="temp-ta-node">'+t.html()+"</span>");var e=d.$("span.temp-ta-node");d.selection.setCursorLocation(e[0]),parent.ThirstyLinkPicker.linkNode=e[0],l("#advanced_add_affiliate_link").data("linkNode",e[0])}Object.defineProperty(e,"__esModule",{value:!0}),e.default=i;var l=jQuery,c=parent.ThirstyLinkPicker,d=c.editor,u=c.isGutenberg,f=c.bookmark,m=void 0,h=void 0,p=void 0,_=void 0,v=void 0,k=!0,g=2,y=void 0,b=void 0,x=void 0,C=void 0},function(t,e,n){"use strict";function i(){b=u("#advanced_add_affiliate_link"),x=b.find(".results-panel ul.results-list"),x.on("click",".actions .insert-link-button",a),x.on("click",".actions .insert-shortcode-button",a),x.on("click",".images-block .images img",a),x.on("click",".actions .insert-image-button",c)}function a(){var t=u(this),e=t.closest("li.thirstylink"),n=t.data("type"),i=x.data("htmleditor"),a=l(e,i);if(C=p?b.data("linkNode"):null,h||C||i){if(!/^(?:[a-z]+:|#|\?|\.|\/)/.test(a.href))return;switch(n){case"shortcode":r(a);break;case"image":s(t,a);break;case"normal":default:o(a)}}}function r(t){var e=t.html_editor,n=t.linkText,i=t.linkID,a=t.content;p&&(a=C.textContent.trim()?C.textContent:a);var r='[thirstylink ids="'+i+'"]'+(n.trim()?n:a)+"[/thirstylink]";if(e)k(r);else if(m.execCommand("Unlink",!1,!1),p){var s=m.$("span.temp-ta-node");s.replaceWith(y(r)),m.selection.collapse()}else m.selection.setContent(r),_.reset();g()}function s(t,e){var n=e.html_editor,i=e.className,a=e.classHtml,r=e.titleHtml,s=e.href,o=e.rel,l=e.target,c=e.other_atts_string;""!=i&&(a=a.replace("thirstylink","thirstylinkimg"));var d=t.data("imgid");u.post(parent.ajaxurl,{action:"ta_get_image_markup_by_id",_ajax_nonce:ta_advance_link_picker_js_params.get_image_markup_nonce,imgid:d},function(t){if("success"==t.status){var e="<a "+(a+r)+' href="'+s+'" rel="'+o+'" target="'+l+'" '+c+">"+t.image_markup+"</a>";if(n)k(e);else if(g(),p){var i=m.$("span.temp-ta-node");i.replaceWith(i.html()+e),m.selection.collapse()}else m.execCommand("mceInsertContent",!1,""),m.execCommand("mceInsertContent",!1,e),_.reset()}g()},"json"),n||m.selection.collapse()}function o(t){var e=t.html_editor,n=t.linkText,i=t.content,a=t.className,r=t.classHtml,s=t.title,o=t.titleHtml,l=t.href,c=t.rel,u=t.target,f=t.other_atts,h=t.other_atts_string;i=p?C.textContent.trim()?C.textContent:i:n.trim()?n:i;var v="<a "+(r+o)+' href="'+l+'" rel="'+c+'" target="'+u+'" '+h+">"+i+"</a>";if(e)k(v);else{var y={class:a,title:s,href:l,rel:c,target:u,"data-wplink-edit":null,"data-thirstylink-edit":null};if("object"==(void 0===f?"undefined":d(f))&&Object.keys(f).length>0)for(var b in f)y[b]=f[b];if(m.execCommand("Unlink",!1,!1),p){m.$("span.temp-ta-node").replaceWith(v);var x=m.$("a.temp-ta-link");m.selection.select(x[0]),x.removeClass("temp-ta-link"),m.selection.collapse()}else m.execCommand("mceInsertLink",!1,y),n.trim()||m.selection.setContent(i);_.reset()}g()}function l(t,e){var n=t.data("other-atts"),i=t.data("title"),a=t.data("class"),r="";if(p&&(a+=" temp-ta-link"),"object"==(void 0===n?"undefined":d(n))&&Object.keys(n).length>0)for(var s in n)r+=s+'="'+n[s]+'" ';return{html_editor:e,linkText:e?v().text:m.selection.getContent(),linkID:parseInt(t.data("linkid")),className:a,classHtml:a?' class="'+a+'"':"",href:t.data("href"),title:i,titleHtml:i?' title="'+i+'"':"",content:t.find("span.name").text(),rel:t.data("rel"),target:t.data("target"),other_atts:n,other_atts_string:r}}function c(){var t=u(this).closest(".thirstylink"),e=t.find(".images-block"),n=t.hasClass("show");u(".results-panel").find(".images-block").removeClass("show").hide(),n||e.slideDown("fast").addClass("show").trigger("ta_center_images")}Object.defineProperty(e,"__esModule",{value:!0});var d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=i;var u=jQuery,f=parent.ThirstyLinkPicker,m=f.editor,h=f.linkNode,p=f.isGutenberg,_=f.inputInstance,v=f.get_html_editor_selection,k=f.replace_html_editor_selected_text,g=f.close_thickbox,y=f.replace_shortcodes,b=void 0,x=void 0,C=void 0},function(t,e){},function(t,e,n){"use strict";function i(t){return t&&t.__esModule?t:{default:t}}var a=n(0),r=i(a),s=n(1),o=i(s);n(2),jQuery(document).ready(function(){(0,r.default)(),(0,o.default)()})}]);
|
js/app/advance_link_picker/src/insert-affiliate-link-normal.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/* global jQuery parent */
|
2 |
|
3 |
const $ = jQuery;
|
4 |
const { editor,
|
@@ -33,7 +33,7 @@ export default function insert_affiliate_link_normal() {
|
|
33 |
|
34 |
/**
|
35 |
* Insert affiliate link callback.
|
36 |
-
*
|
37 |
* @since 3.5
|
38 |
*/
|
39 |
function insertAffiliateLink() {
|
@@ -67,16 +67,16 @@ function insertAffiliateLink() {
|
|
67 |
break;
|
68 |
|
69 |
}
|
70 |
-
|
71 |
}
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
* Insert affiliate link as shortcode.
|
76 |
-
*
|
77 |
* @since 3.5
|
78 |
-
*
|
79 |
-
* @param {object} linkData Desctructured object.
|
80 |
*/
|
81 |
function insert_as_shortcode({ html_editor , linkText , linkID , content }) {
|
82 |
|
@@ -91,10 +91,10 @@ function insert_as_shortcode({ html_editor , linkText , linkID , content }) {
|
|
91 |
editor.execCommand( "Unlink" , false , false );
|
92 |
|
93 |
if ( isGutenberg ) {
|
94 |
-
|
95 |
let $tempNode = editor.$( "span.temp-ta-node" );
|
96 |
$tempNode.replaceWith( replace_shortcodes( shortcode ) );
|
97 |
-
|
98 |
editor.selection.collapse();
|
99 |
|
100 |
} else {
|
@@ -102,7 +102,7 @@ function insert_as_shortcode({ html_editor , linkText , linkID , content }) {
|
|
102 |
editor.selection.setContent( shortcode );
|
103 |
inputInstance.reset();
|
104 |
}
|
105 |
-
|
106 |
}
|
107 |
|
108 |
close_thickbox();
|
@@ -110,21 +110,22 @@ function insert_as_shortcode({ html_editor , linkText , linkID , content }) {
|
|
110 |
|
111 |
/**
|
112 |
* Insert affiliate link as image.
|
113 |
-
*
|
114 |
* @since 3.5
|
115 |
-
*
|
116 |
-
* @param {*} $el
|
117 |
-
* @param {*} param1
|
118 |
*/
|
119 |
function insert_as_image( $el , { html_editor , className , classHtml , titleHtml , href , rel , target, other_atts_string } ) {
|
120 |
|
121 |
if ( className != "" )
|
122 |
classHtml = classHtml.replace( "thirstylink" , "thirstylinkimg" );
|
123 |
-
|
124 |
const imgID = $el.data( "imgid" );
|
125 |
|
126 |
$.post( parent.ajaxurl, {
|
127 |
action : "ta_get_image_markup_by_id",
|
|
|
128 |
imgid : imgID,
|
129 |
}, ( response ) => {
|
130 |
|
@@ -139,35 +140,35 @@ function insert_as_image( $el , { html_editor , className , classHtml , titleHtm
|
|
139 |
close_thickbox();
|
140 |
|
141 |
if ( isGutenberg ) {
|
142 |
-
|
143 |
let $tempNode = editor.$( "span.temp-ta-node" );
|
144 |
$tempNode.replaceWith( $tempNode.html() + linkHtml );
|
145 |
-
|
146 |
editor.selection.collapse();
|
147 |
-
|
148 |
} else {
|
149 |
|
150 |
editor.execCommand( "mceInsertContent" , false , "" );
|
151 |
editor.execCommand( "mceInsertContent" , false , linkHtml );
|
152 |
inputInstance.reset();
|
153 |
}
|
154 |
-
|
155 |
}
|
156 |
}
|
157 |
|
158 |
close_thickbox();
|
159 |
|
160 |
} , "json" );
|
161 |
-
|
162 |
if ( ! html_editor ) editor.selection.collapse();
|
163 |
}
|
164 |
|
165 |
/**
|
166 |
* Insert affiliate link as link.
|
167 |
-
*
|
168 |
* @since 3.5
|
169 |
-
*
|
170 |
-
* @param {*} param0
|
171 |
*/
|
172 |
function insert_as_link({ html_editor , linkText , content , className , classHtml , title , titleHtml , href , rel , target , other_atts , other_atts_string }) {
|
173 |
|
@@ -177,8 +178,8 @@ function insert_as_link({ html_editor , linkText , content , className , classHt
|
|
177 |
content = linkText.trim() ? linkText : content;
|
178 |
|
179 |
const linkHtml = `<a ${ classHtml + titleHtml } href="${ href }" rel="${ rel }" target="${ target }" ${ other_atts_string }>${ content }</a>`;
|
180 |
-
|
181 |
-
|
182 |
if ( html_editor )
|
183 |
replace_html_editor_selected_text( linkHtml );
|
184 |
else {
|
@@ -202,18 +203,18 @@ function insert_as_link({ html_editor , linkText , content , className , classHt
|
|
202 |
editor.execCommand( "Unlink" , false , false );
|
203 |
|
204 |
if ( isGutenberg ) {
|
205 |
-
|
206 |
let $tempNode = editor.$( "span.temp-ta-node" );
|
207 |
$tempNode.replaceWith( linkHtml );
|
208 |
-
|
209 |
let $tempLink = editor.$( "a.temp-ta-link" );
|
210 |
editor.selection.select( $tempLink[0] );
|
211 |
$tempLink.removeClass( "temp-ta-link" );
|
212 |
-
|
213 |
editor.selection.collapse();
|
214 |
|
215 |
} else {
|
216 |
-
|
217 |
editor.execCommand( "mceInsertLink" , false , link_attributes );
|
218 |
if ( ! linkText.trim() )
|
219 |
editor.selection.setContent( content );
|
@@ -228,10 +229,10 @@ function insert_as_link({ html_editor , linkText , content , className , classHt
|
|
228 |
|
229 |
/**
|
230 |
* Get link data.
|
231 |
-
*
|
232 |
* @since 3.5
|
233 |
-
*
|
234 |
-
* @param {jQuery object} $resultRow
|
235 |
*/
|
236 |
function getLinkData( $resultRow , html_editor ) {
|
237 |
|
@@ -267,7 +268,7 @@ function getLinkData( $resultRow , html_editor ) {
|
|
267 |
|
268 |
/**
|
269 |
* Toggle images block.
|
270 |
-
*
|
271 |
* @since 3.5
|
272 |
*/
|
273 |
function toggle_images_block() {
|
1 |
+
/* global jQuery parent ta_advance_link_picker_js_params */
|
2 |
|
3 |
const $ = jQuery;
|
4 |
const { editor,
|
33 |
|
34 |
/**
|
35 |
* Insert affiliate link callback.
|
36 |
+
*
|
37 |
* @since 3.5
|
38 |
*/
|
39 |
function insertAffiliateLink() {
|
67 |
break;
|
68 |
|
69 |
}
|
70 |
+
|
71 |
}
|
72 |
}
|
73 |
|
74 |
/**
|
75 |
* Insert affiliate link as shortcode.
|
76 |
+
*
|
77 |
* @since 3.5
|
78 |
+
*
|
79 |
+
* @param {object} linkData Desctructured object.
|
80 |
*/
|
81 |
function insert_as_shortcode({ html_editor , linkText , linkID , content }) {
|
82 |
|
91 |
editor.execCommand( "Unlink" , false , false );
|
92 |
|
93 |
if ( isGutenberg ) {
|
94 |
+
|
95 |
let $tempNode = editor.$( "span.temp-ta-node" );
|
96 |
$tempNode.replaceWith( replace_shortcodes( shortcode ) );
|
97 |
+
|
98 |
editor.selection.collapse();
|
99 |
|
100 |
} else {
|
102 |
editor.selection.setContent( shortcode );
|
103 |
inputInstance.reset();
|
104 |
}
|
105 |
+
|
106 |
}
|
107 |
|
108 |
close_thickbox();
|
110 |
|
111 |
/**
|
112 |
* Insert affiliate link as image.
|
113 |
+
*
|
114 |
* @since 3.5
|
115 |
+
*
|
116 |
+
* @param {*} $el
|
117 |
+
* @param {*} param1
|
118 |
*/
|
119 |
function insert_as_image( $el , { html_editor , className , classHtml , titleHtml , href , rel , target, other_atts_string } ) {
|
120 |
|
121 |
if ( className != "" )
|
122 |
classHtml = classHtml.replace( "thirstylink" , "thirstylinkimg" );
|
123 |
+
|
124 |
const imgID = $el.data( "imgid" );
|
125 |
|
126 |
$.post( parent.ajaxurl, {
|
127 |
action : "ta_get_image_markup_by_id",
|
128 |
+
_ajax_nonce : ta_advance_link_picker_js_params.get_image_markup_nonce,
|
129 |
imgid : imgID,
|
130 |
}, ( response ) => {
|
131 |
|
140 |
close_thickbox();
|
141 |
|
142 |
if ( isGutenberg ) {
|
143 |
+
|
144 |
let $tempNode = editor.$( "span.temp-ta-node" );
|
145 |
$tempNode.replaceWith( $tempNode.html() + linkHtml );
|
146 |
+
|
147 |
editor.selection.collapse();
|
148 |
+
|
149 |
} else {
|
150 |
|
151 |
editor.execCommand( "mceInsertContent" , false , "" );
|
152 |
editor.execCommand( "mceInsertContent" , false , linkHtml );
|
153 |
inputInstance.reset();
|
154 |
}
|
155 |
+
|
156 |
}
|
157 |
}
|
158 |
|
159 |
close_thickbox();
|
160 |
|
161 |
} , "json" );
|
162 |
+
|
163 |
if ( ! html_editor ) editor.selection.collapse();
|
164 |
}
|
165 |
|
166 |
/**
|
167 |
* Insert affiliate link as link.
|
168 |
+
*
|
169 |
* @since 3.5
|
170 |
+
*
|
171 |
+
* @param {*} param0
|
172 |
*/
|
173 |
function insert_as_link({ html_editor , linkText , content , className , classHtml , title , titleHtml , href , rel , target , other_atts , other_atts_string }) {
|
174 |
|
178 |
content = linkText.trim() ? linkText : content;
|
179 |
|
180 |
const linkHtml = `<a ${ classHtml + titleHtml } href="${ href }" rel="${ rel }" target="${ target }" ${ other_atts_string }>${ content }</a>`;
|
181 |
+
|
182 |
+
|
183 |
if ( html_editor )
|
184 |
replace_html_editor_selected_text( linkHtml );
|
185 |
else {
|
203 |
editor.execCommand( "Unlink" , false , false );
|
204 |
|
205 |
if ( isGutenberg ) {
|
206 |
+
|
207 |
let $tempNode = editor.$( "span.temp-ta-node" );
|
208 |
$tempNode.replaceWith( linkHtml );
|
209 |
+
|
210 |
let $tempLink = editor.$( "a.temp-ta-link" );
|
211 |
editor.selection.select( $tempLink[0] );
|
212 |
$tempLink.removeClass( "temp-ta-link" );
|
213 |
+
|
214 |
editor.selection.collapse();
|
215 |
|
216 |
} else {
|
217 |
+
|
218 |
editor.execCommand( "mceInsertLink" , false , link_attributes );
|
219 |
if ( ! linkText.trim() )
|
220 |
editor.selection.setContent( content );
|
229 |
|
230 |
/**
|
231 |
* Get link data.
|
232 |
+
*
|
233 |
* @since 3.5
|
234 |
+
*
|
235 |
+
* @param {jQuery object} $resultRow
|
236 |
*/
|
237 |
function getLinkData( $resultRow , html_editor ) {
|
238 |
|
268 |
|
269 |
/**
|
270 |
* Toggle images block.
|
271 |
+
*
|
272 |
* @since 3.5
|
273 |
*/
|
274 |
function toggle_images_block() {
|
js/app/affiliate_link_page/dist/affiliate-link-page.js
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
*
|
12 |
* Date: 2017-03-20T18:59Z
|
13 |
*/
|
14 |
-
!function(t,n){"object"===i(e)&&"object"===i(e.exports)?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:void 0,function(o,a){function s(e,t){t=t||se;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function u(e){var t=!!e&&"length"in e&&e.length,n=xe.type(e);return"function"!==n&&!xe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function l(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function c(e,t,n){return xe.isFunction(t)?xe.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?xe.grep(e,function(e){return e===t!==n}):"string"!=typeof t?xe.grep(e,function(e){return de.call(t,e)>-1!==n}):_e.test(t)?xe.filter(t,e,n):(t=xe.filter(t,e),xe.grep(e,function(e){return de.call(t,e)>-1!==n&&1===e.nodeType}))}function f(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function d(e){var t={};return xe.each(e.match(Oe)||[],function(e,n){t[n]=!0}),t}function p(e){return e}function h(e){throw e}function g(e,t,n,r){var i;try{e&&xe.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&xe.isFunction(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function m(){se.removeEventListener("DOMContentLoaded",m),o.removeEventListener("load",m),xe.ready()}function v(){this.expando=xe.expando+v.uid++}function y(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:We.test(e)?JSON.parse(e):e)}function x(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace($e,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=y(n)}catch(e){}Re.set(e,t,n)}else n=void 0;return n}function b(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return xe.css(e,t,"")},u=s(),l=n&&n[3]||(xe.cssNumber[t]?"":"px"),c=(xe.cssNumber[t]||"px"!==l&&+u)&&ze.exec(xe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do{o=o||".5",c/=o,xe.style(e,t,c+l)}while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function w(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ge[r];return i||(t=n.body.appendChild(n.createElement(r)),i=xe.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ge[r]=i,i)}function T(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)r=e[o],r.style&&(n=r.style.display,t?("none"===n&&(i[o]=Ie.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&Ue(r)&&(i[o]=w(r))):"none"!==n&&(i[o]="none",Ie.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}function C(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&l(e,t)?xe.merge([e],n):n}function k(e,t){for(var n=0,r=e.length;n<r;n++)Ie.set(e[n],"globalEval",!t||Ie.get(t[n],"globalEval"))}function j(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p<h;p++)if((o=e[p])||0===o)if("object"===xe.type(o))xe.merge(d,o.nodeType?[o]:o);else if(Ze.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(Qe.exec(o)||["",""])[1].toLowerCase(),u=Ke[s]||Ke._default,a.innerHTML=u[1]+xe.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;xe.merge(d,a.childNodes),a=f.firstChild,a.textContent=""}else d.push(t.createTextNode(o));for(f.textContent="",p=0;o=d[p++];)if(r&&xe.inArray(o,r)>-1)i&&i.push(o);else if(l=xe.contains(o.ownerDocument,o),a=C(f.appendChild(o),"script"),l&&k(a),n)for(c=0;o=a[c++];)Je.test(o.type||"")&&n.push(o);return f}function S(){return!0}function E(){return!1}function N(){try{return se.activeElement}catch(e){}}function _(e,t,n,r,o,a){var s,u;if("object"===(void 0===t?"undefined":i(t))){"string"!=typeof n&&(r=r||n,n=void 0);for(u in t)_(e,u,n,r,t[u],a);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=E;else if(!o)return e;return 1===a&&(s=o,o=function(e){return xe().off(e),s.apply(this,arguments)},o.guid=s.guid||(s.guid=xe.guid++)),e.each(function(){xe.event.add(this,t,o,r,n)})}function D(e,t){return l(e,"table")&&l(11!==t.nodeType?t:t.firstChild,"tr")?xe(">tbody",e)[0]||e:e}function A(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function q(e){var t=st.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function L(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Ie.hasData(e)&&(o=Ie.access(e),a=Ie.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)xe.event.add(t,i,l[i][n])}Re.hasData(e)&&(s=Re.access(e),u=xe.extend({},s),Re.set(t,u))}}function O(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ye.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function H(e,t,n,r){t=ce.apply([],t);var i,o,a,u,l,c,f=0,d=e.length,p=d-1,h=t[0],g=xe.isFunction(h);if(g||d>1&&"string"==typeof h&&!ye.checkClone&&at.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),H(o,t,n,r)});if(d&&(i=j(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=xe.map(C(i,"script"),A),u=a.length;f<d;f++)l=i,f!==p&&(l=xe.clone(l,!0,!0),u&&xe.merge(a,C(l,"script"))),n.call(e[f],l,f);if(u)for(c=a[a.length-1].ownerDocument,xe.map(a,q),f=0;f<u;f++)l=a[f],Je.test(l.type||"")&&!Ie.access(l,"globalEval")&&xe.contains(c,l)&&(l.src?xe._evalUrl&&xe._evalUrl(l.src):s(l.textContent.replace(ut,""),c))}return e}function F(e,t,n){for(var r,i=t?xe.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||xe.cleanData(C(r)),r.parentNode&&(n&&xe.contains(r.ownerDocument,r)&&k(C(r,"script")),r.parentNode.removeChild(r));return e}function P(e,t,n){var r,i,o,a,s=e.style;return n=n||ft(e),n&&(a=n.getPropertyValue(t)||n[t],""!==a||xe.contains(e.ownerDocument,e)||(a=xe.style(e,t)),!ye.pixelMarginRight()&&ct.test(a)&<.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function M(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function I(e){if(e in vt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=mt.length;n--;)if((e=mt[n]+t)in vt)return e}function R(e){var t=xe.cssProps[e];return t||(t=xe.cssProps[e]=I(e)||e),t}function W(e,t,n){var r=ze.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function $(e,t,n,r,i){var o,a=0;for(o=n===(r?"border":"content")?4:"width"===t?1:0;o<4;o+=2)"margin"===n&&(a+=xe.css(e,n+Xe[o],!0,i)),r?("content"===n&&(a-=xe.css(e,"padding"+Xe[o],!0,i)),"margin"!==n&&(a-=xe.css(e,"border"+Xe[o]+"Width",!0,i))):(a+=xe.css(e,"padding"+Xe[o],!0,i),"padding"!==n&&(a+=xe.css(e,"border"+Xe[o]+"Width",!0,i)));return a}function B(e,t,n){var r,i=ft(e),o=P(e,t,i),a="border-box"===xe.css(e,"boxSizing",!1,i);return ct.test(o)?o:(r=a&&(ye.boxSizingReliable()||o===e.style[t]),"auto"===o&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)]),(o=parseFloat(o)||0)+$(e,t,n||(a?"border":"content"),r,i)+"px")}function z(e,t,n,r,i){return new z.prototype.init(e,t,n,r,i)}function X(){xt&&(!1===se.hidden&&o.requestAnimationFrame?o.requestAnimationFrame(X):o.setTimeout(X,xe.fx.interval),xe.fx.tick())}function U(){return o.setTimeout(function(){yt=void 0}),yt=xe.now()}function V(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=Xe[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function G(e,t,n){for(var r,i=(J.tweeners[t]||[]).concat(J.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function Y(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,d=this,p={},h=e.style,g=e.nodeType&&Ue(e),m=Ie.get(e,"fxshow");n.queue||(a=xe._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,xe.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],bt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||xe.style(e,r)}if((u=!xe.isEmptyObject(t))||!xe.isEmptyObject(p)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],l=m&&m.display,null==l&&(l=Ie.get(e,"display")),c=xe.css(e,"display"),"none"===c&&(l?c=l:(T([e],!0),l=e.style.display||l,c=xe.css(e,"display"),T([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===xe.css(e,"float")&&(u||(d.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in p)u||(m?"hidden"in m&&(g=m.hidden):m=Ie.access(e,"fxshow",{display:l}),o&&(m.hidden=!g),g&&T([e],!0),d.done(function(){g||T([e]),Ie.remove(e,"fxshow");for(r in p)xe.style(e,r,p[r])})),u=G(g?m[r]:0,r,d),r in m||(m[r]=u.start,g&&(u.end=u.start,u.start=0))}}function Q(e,t){var n,r,i,o,a;for(n in e)if(r=xe.camelCase(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=xe.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function J(e,t,n){var r,i,o=0,a=J.prefilters.length,s=xe.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=yt||U(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;a<u;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),o<1&&u?n:(u||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:xe.extend({},t),opts:xe.extend(!0,{specialEasing:{},easing:xe.easing._default},n),originalProperties:t,originalOptions:n,startTime:yt||U(),duration:n.duration,tweens:[],createTween:function(t,n){var r=xe.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(Q(c,l.opts.specialEasing);o<a;o++)if(r=J.prefilters[o].call(l,e,c,l.opts))return xe.isFunction(r.stop)&&(xe._queueHooks(l.elem,l.opts.queue).stop=xe.proxy(r.stop,r)),r;return xe.map(c,G,l),xe.isFunction(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),xe.fx.timer(xe.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}function K(e){return(e.match(Oe)||[]).join(" ")}function Z(e){return e.getAttribute&&e.getAttribute("class")||""}function ee(e,t,n,r){var o;if(Array.isArray(t))xe.each(t,function(t,o){n||At.test(e)?r(e,o):ee(e+"["+("object"===(void 0===o?"undefined":i(o))&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==xe.type(t))r(e,t);else for(o in t)ee(e+"["+o+"]",t[o],n,r)}function te(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(Oe)||[];if(xe.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ne(e,t,n,r){function i(s){var u;return o[s]=!0,xe.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||a||o[l]?a?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var o={},a=e===Bt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function re(e,t){var n,r,i=xe.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&xe.extend(!0,e,r),e}function ie(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function oe(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if(s=i.split(" "),s[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}var ae=[],se=o.document,ue=Object.getPrototypeOf,le=ae.slice,ce=ae.concat,fe=ae.push,de=ae.indexOf,pe={},he=pe.toString,ge=pe.hasOwnProperty,me=ge.toString,ve=me.call(Object),ye={},xe=function e(t,n){return new e.fn.init(t,n)},be=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,we=/^-ms-/,Te=/-([a-z])/g,Ce=function(e,t){return t.toUpperCase()};xe.fn=xe.prototype={jquery:"3.2.1",constructor:xe,length:0,toArray:function(){return le.call(this)},get:function(e){return null==e?le.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=xe.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return xe.each(this,e)},map:function(e){return this.pushStack(xe.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(le.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:fe,sort:ae.sort,splice:ae.splice},xe.extend=xe.fn.extend=function(){var e,t,n,r,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[u]||{},u++),"object"===(void 0===s?"undefined":i(s))||xe.isFunction(s)||(s={}),u===l&&(s=this,u--);u<l;u++)if(null!=(e=arguments[u]))for(t in e)n=s[t],r=e[t],s!==r&&(c&&r&&(xe.isPlainObject(r)||(o=Array.isArray(r)))?(o?(o=!1,a=n&&Array.isArray(n)?n:[]):a=n&&xe.isPlainObject(n)?n:{},s[t]=xe.extend(c,a,r)):void 0!==r&&(s[t]=r));return s},xe.extend({expando:"jQuery"+("3.2.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===xe.type(e)},isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=xe.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==he.call(e))&&(!(t=ue(e))||"function"==typeof(n=ge.call(t,"constructor")&&t.constructor)&&me.call(n)===ve)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"===(void 0===e?"undefined":i(e))||"function"==typeof e?pe[he.call(e)]||"object":void 0===e?"undefined":i(e)},globalEval:function(e){s(e)},camelCase:function(e){return e.replace(we,"ms-").replace(Te,Ce)},each:function(e,t){var n,r=0;if(u(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(be,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(u(Object(e))?xe.merge(n,"string"==typeof e?[e]:e):fe.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:de.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(u(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return ce.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),xe.isFunction(e))return r=le.call(arguments,2),i=function(){return e.apply(t||this,r.concat(le.call(arguments)))},i.guid=e.guid=e.guid||xe.guid++,i},now:Date.now,support:ye}),"function"==typeof Symbol&&(xe.fn[Symbol.iterator]=ae[Symbol.iterator]),xe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){pe["[object "+t+"]"]=t.toLowerCase()});var ke=/*!
|
15 |
* Sizzle CSS Selector Engine v2.3.3
|
16 |
* https://sizzlejs.com/
|
17 |
*
|
@@ -21,4 +21,4 @@
|
|
21 |
*
|
22 |
* Date: 2016-08-08
|
23 |
*/
|
24 |
-
function(e){function t(e,t,n,r){var i,o,a,s,u,c,d,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&((t?t.ownerDocument||t:I)!==A&&D(t),t=t||A,L)){if(11!==h&&(u=ge.exec(e)))if(i=u[1]){if(9===h){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(p&&(a=p.getElementById(i))&&P(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&b.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(i)),n}if(b.qsa&&!z[e+" "]&&(!O||!O.test(e))){if(1!==h)p=t,d=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(xe,be):t.setAttribute("id",s=M),c=k(e),o=c.length;o--;)c[o]="#"+s+" "+f(c[o]);d=c.join(","),p=me.test(e)&&l(t.parentNode)||t}if(d)try{return Q.apply(n,p.querySelectorAll(d)),n}catch(e){}finally{s===M&&t.removeAttribute("id")}}}return S(e.replace(oe,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[M]=!0,e}function i(e){var t=A.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Te(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function u(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function l(e){return e&&void 0!==e.getElementsByTagName&&e}function c(){}function f(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=W++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,d=[R,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(f=t[M]||(t[M]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===R&&l[1]===s)return d[2]=l[2];if(c[o]=d,d[2]=e(t,n,u))return!0}return!1}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function m(e,t,n,i,o,a){return i&&!i[M]&&(i=m(i)),o&&!o[M]&&(o=m(o,a)),r(function(r,a,s,u){var l,c,f,d=[],p=[],m=a.length,v=r||h(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,d,e,s,u),x=n?o||(r?e:m||i)?[]:a:y;if(n&&n(y,x,s,u),i)for(l=g(x,p),i(l,[],s,u),c=l.length;c--;)(f=l[c])&&(x[p[c]]=!(y[p[c]]=f));if(r){if(o||e){if(o){for(l=[],c=x.length;c--;)(f=x[c])&&l.push(y[c]=f);o(null,x=[],l,u)}for(c=x.length;c--;)(f=x[c])&&(l=o?K(r,f):d[c])>-1&&(r[l]=!(a[l]=f))}}else x=g(x===a?x.splice(m,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return K(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==E)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s<i;s++)if(n=w.relative[e[s].type])c=[d(p(c),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[M]){for(r=++s;r<i&&!w.relative[e[r].type];r++);return m(s>1&&p(c),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(oe,"$1"),n,s<r&&v(e.slice(s,r)),r<i&&v(e=e.slice(r)),r<i&&f(e))}c.push(n)}return p(c)}function y(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",m=r&&[],v=[],y=E,x=r||o&&w.find.TAG("*",l),b=R+=null==y?1:Math.random()||.1,T=x.length;for(l&&(E=a===A||a||l);h!==T&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===A||(D(c),s=!L);d=e[f++];)if(d(c,a||A,s)){u.push(c);break}l&&(R=b)}i&&((c=!d&&c)&&p--,r&&m.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(m,v,a,s);if(r){if(p>0)for(;h--;)m[h]||v[h]||(v[h]=G.call(u));v=g(v)}Q.apply(u,v),l&&!r&&v.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(R=b,E=y),m};return i?r(a):a}var x,b,w,T,C,k,j,S,E,N,_,D,A,q,L,O,H,F,P,M="sizzle"+1*new Date,I=e.document,R=0,W=0,$=n(),B=n(),z=n(),X=function(e,t){return e===t&&(_=!0),0},U={}.hasOwnProperty,V=[],G=V.pop,Y=V.push,Q=V.push,J=V.slice,K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},Z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ee="[\\x20\\t\\r\\n\\f]",te="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ne="\\["+ee+"*("+te+")(?:"+ee+"*([*^$|!~]?=)"+ee+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+te+"))|)"+ee+"*\\]",re=":("+te+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ne+")*)|.*)\\)|)",ie=new RegExp(ee+"+","g"),oe=new RegExp("^"+ee+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ee+"+$","g"),ae=new RegExp("^"+ee+"*,"+ee+"*"),se=new RegExp("^"+ee+"*([>+~]|"+ee+")"+ee+"*"),ue=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),le=new RegExp(re),ce=new RegExp("^"+te+"$"),fe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ne),PSEUDO:new RegExp("^"+re),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},de=/^(?:input|select|textarea|button)$/i,pe=/^h\d$/i,he=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,ve=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),ye=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},xe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,be=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},we=function(){D()},Te=d(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{Q.apply(V=J.call(I.childNodes),I.childNodes),V[I.childNodes.length].nodeType}catch(e){Q={apply:V.length?function(e,t){Y.apply(e,J.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}b=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:I;return r!==A&&9===r.nodeType&&r.documentElement?(A=r,q=A.documentElement,L=!C(A),I!==A&&(n=A.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",we,!1):n.attachEvent&&n.attachEvent("onunload",we)),b.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByTagName=i(function(e){return e.appendChild(A.createComment("")),!e.getElementsByTagName("*").length}),b.getElementsByClassName=he.test(A.getElementsByClassName),b.getById=i(function(e){return q.appendChild(e).id=M,!A.getElementsByName||!A.getElementsByName(M).length}),b.getById?(w.filter.ID=function(e){var t=e.replace(ve,ye);return function(e){return e.getAttribute("id")===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&L){var n=t.getElementById(e);return n?[n]:[]}}):(w.filter.ID=function(e){var t=e.replace(ve,ye);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&L){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),w.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=b.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&L)return t.getElementsByClassName(e)},H=[],O=[],(b.qsa=he.test(A.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="<a id='"+M+"'></a><select id='"+M+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&O.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||O.push("\\["+ee+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+M+"-]").length||O.push("~="),e.querySelectorAll(":checked").length||O.push(":checked"),e.querySelectorAll("a#"+M+"+*").length||O.push(".#.+[+~]")}),i(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=A.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&O.push("name"+ee+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&O.push(":enabled",":disabled"),q.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&O.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),O.push(",.*:")})),(b.matchesSelector=he.test(F=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){b.disconnectedMatch=F.call(e,"*"),F.call(e,"[s!='']:x"),H.push("!=",re)}),O=O.length&&new RegExp(O.join("|")),H=H.length&&new RegExp(H.join("|")),t=he.test(q.compareDocumentPosition),P=t||he.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return _=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!b.sortDetached&&t.compareDocumentPosition(e)===n?e===A||e.ownerDocument===I&&P(I,e)?-1:t===A||t.ownerDocument===I&&P(I,t)?1:N?K(N,e)-K(N,t):0:4&n?-1:1)}:function(e,t){if(e===t)return _=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===A?-1:t===A?1:i?-1:o?1:N?K(N,e)-K(N,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===I?-1:u[r]===I?1:0},A):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&D(e),n=n.replace(ue,"='$1']"),b.matchesSelector&&L&&!z[n+" "]&&(!H||!H.test(n))&&(!O||!O.test(n)))try{var r=F.call(e,n);if(r||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&D(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&D(e);var n=w.attrHandle[t.toLowerCase()],r=n&&U.call(w.attrHandle,t.toLowerCase())?n(e,t,!L):void 0;return void 0!==r?r:b.attributes||!L?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(xe,be)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(_=!b.detectDuplicates,N=!b.sortStable&&e.slice(0),e.sort(X),_){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return N=null,e},T=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=T(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=T(t);return n},w=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,ye),e[3]=(e[3]||e[4]||e[5]||"").replace(ve,ye),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&le.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,ye).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ie," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&y){for(d=m,f=d[M]||(d[M]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===R&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[R,p,x];break}}else if(y&&(d=t,f=d[M]||(d[M]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===R&&l[1],x=p),!1===x)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(y&&(f=d[M]||(d[M]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[R,x]),d!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=w.pseudos[e]||w.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[M]?o(n):o.length>1?(i=[e,e,"",n],w.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=K(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=j(e.replace(oe,"$1"));return i[M]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ve,ye),function(t){return(t.textContent||t.innerText||T(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ve,ye).toLowerCase(),function(t){var n;do{if(n=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:s(!1),disabled:s(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return pe.test(e.nodeName)},input:function(e){return de.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[n<0?n+t:n]}),even:u(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[x]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(x);for(x in{submit:!0,reset:!0})w.pseudos[x]=function(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}(x);return c.prototype=w.filters=w.pseudos,w.setFilters=new c,k=t.tokenize=function(e,n){var r,i,o,a,s,u,l,c=B[e+" "];if(c)return n?0:c.slice(0);for(s=e,u=[],l=w.preFilter;s;){r&&!(i=ae.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),r=!1,(i=se.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(oe," ")}),s=s.slice(r.length));for(a in w.filter)!(i=fe[a].exec(s))||l[a]&&!(i=l[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):B(e,u).slice(0)},j=t.compile=function(e,t){var n,r=[],i=[],o=z[e+" "];if(!o){for(t||(t=k(e)),n=t.length;n--;)o=v(t[n]),o[M]?r.push(o):i.push(o);o=z(e,y(i,r)),o.selector=e}return o},S=t.select=function(e,t,n,r){var i,o,a,s,u,c="function"==typeof e&&e,d=!r&&k(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&L&&w.relative[o[1].type]){if(!(t=(w.find.ID(a.matches[0].replace(ve,ye),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((u=w.find[s])&&(r=u(a.matches[0].replace(ve,ye),me.test(o[0].type)&&l(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&f(o)))return Q.apply(n,r),n;break}}return(c||j(e,d))(r,t,!L,n,!t||me.test(e)&&l(t.parentNode)||t),n},b.sortStable=M.split("").sort(X).join("")===M,b.detectDuplicates=!!_,D(),b.sortDetached=i(function(e){return 1&e.compareDocumentPosition(A.createElement("fieldset"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),b.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(Z,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(o);xe.find=ke,xe.expr=ke.selectors,xe.expr[":"]=xe.expr.pseudos,xe.uniqueSort=xe.unique=ke.uniqueSort,xe.text=ke.getText,xe.isXMLDoc=ke.isXML,xe.contains=ke.contains,xe.escapeSelector=ke.escape;var je=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&xe(e).is(n))break;r.push(e)}return r},Se=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Ee=xe.expr.match.needsContext,Ne=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,_e=/^.[^:#\[\.,]*$/;xe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?xe.find.matchesSelector(r,e)?[r]:[]:xe.find.matches(e,xe.grep(t,function(e){return 1===e.nodeType}))},xe.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(xe(e).filter(function(){for(t=0;t<r;t++)if(xe.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)xe.find(e,i[t],n);return r>1?xe.uniqueSort(n):n},filter:function(e){return this.pushStack(c(this,e||[],!1))},not:function(e){return this.pushStack(c(this,e||[],!0))},is:function(e){return!!c(this,"string"==typeof e&&Ee.test(e)?xe(e):e||[],!1).length}});var De,Ae=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(xe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||De,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ae.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof xe?t[0]:t,xe.merge(this,xe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:se,!0)),Ne.test(r[1])&&xe.isPlainObject(t))for(r in t)xe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=se.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):xe.isFunction(e)?void 0!==n.ready?n.ready(e):e(xe):xe.makeArray(e,this)}).prototype=xe.fn,De=xe(se);var qe=/^(?:parents|prev(?:Until|All))/,Le={children:!0,contents:!0,next:!0,prev:!0};xe.fn.extend({has:function(e){var t=xe(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(xe.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&xe(e);if(!Ee.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&xe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?xe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?de.call(xe(e),this[0]):de.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(xe.uniqueSort(xe.merge(this.get(),xe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),xe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return je(e,"parentNode")},parentsUntil:function(e,t,n){return je(e,"parentNode",n)},next:function(e){return f(e,"nextSibling")},prev:function(e){return f(e,"previousSibling")},nextAll:function(e){return je(e,"nextSibling")},prevAll:function(e){return je(e,"previousSibling")},nextUntil:function(e,t,n){return je(e,"nextSibling",n)},prevUntil:function(e,t,n){return je(e,"previousSibling",n)},siblings:function(e){return Se((e.parentNode||{}).firstChild,e)},children:function(e){return Se(e.firstChild)},contents:function(e){return l(e,"iframe")?e.contentDocument:(l(e,"template")&&(e=e.content||e),xe.merge([],e.childNodes))}},function(e,t){xe.fn[e]=function(n,r){var i=xe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=xe.filter(r,i)),this.length>1&&(Le[e]||xe.uniqueSort(i),qe.test(e)&&i.reverse()),this.pushStack(i)}});var Oe=/[^\x20\t\r\n\f]+/g;xe.Callbacks=function(e){e="string"==typeof e?d(e):xe.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){xe.each(n,function(n,r){xe.isFunction(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==xe.type(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return xe.each(arguments,function(e,t){for(var n;(n=xe.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?xe.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},xe.extend({Deferred:function(e){var t=[["notify","progress",xe.Callbacks("memory"),xe.Callbacks("memory"),2],["resolve","done",xe.Callbacks("once memory"),xe.Callbacks("once memory"),0,"resolved"],["reject","fail",xe.Callbacks("once memory"),xe.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return xe.Deferred(function(n){xe.each(t,function(t,r){var i=xe.isFunction(e[r[4]])&&e[r[4]];a[r[1]](function(){var e=i&&i.apply(this,arguments);e&&xe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,n,r){function a(e,t,n,r){return function(){var u=this,l=arguments,c=function(){var o,c;if(!(e<s)){if((o=n.apply(u,l))===t.promise())throw new TypeError("Thenable self-resolution");c=o&&("object"===(void 0===o?"undefined":i(o))||"function"==typeof o)&&o.then,xe.isFunction(c)?r?c.call(o,a(s,t,p,r),a(s,t,h,r)):(s++,c.call(o,a(s,t,p,r),a(s,t,h,r),a(s,t,p,t.notifyWith))):(n!==p&&(u=void 0,l=[o]),(r||t.resolveWith)(u,l))}},f=r?c:function(){try{c()}catch(r){xe.Deferred.exceptionHook&&xe.Deferred.exceptionHook(r,f.stackTrace),e+1>=s&&(n!==h&&(u=void 0,l=[r]),t.rejectWith(u,l))}};e?f():(xe.Deferred.getStackHook&&(f.stackTrace=xe.Deferred.getStackHook()),o.setTimeout(f))}}var s=0;return xe.Deferred(function(i){t[0][3].add(a(0,i,xe.isFunction(r)?r:p,i.notifyWith)),t[1][3].add(a(0,i,xe.isFunction(e)?e:p)),t[2][3].add(a(0,i,xe.isFunction(n)?n:h))}).promise()},promise:function(e){return null!=e?xe.extend(e,r):r}},a={};return xe.each(t,function(e,i){var o=i[2],s=i[5];r[i[1]]=o.add,s&&o.add(function(){n=s},t[3-e][2].disable,t[0][2].lock),o.add(i[3].fire),a[i[0]]=function(){return a[i[0]+"With"](this===a?void 0:this,arguments),this},a[i[0]+"With"]=o.fireWith}),r.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=le.call(arguments),o=xe.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?le.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(g(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||xe.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)g(i[n],a(n),o.reject);return o.promise()}});var He=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;xe.Deferred.exceptionHook=function(e,t){o.console&&o.console.warn&&e&&He.test(e.name)&&o.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},xe.readyException=function(e){o.setTimeout(function(){throw e})};var Fe=xe.Deferred();xe.fn.ready=function(e){return Fe.then(e).catch(function(e){xe.readyException(e)}),this},xe.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--xe.readyWait:xe.isReady)||(xe.isReady=!0,!0!==e&&--xe.readyWait>0||Fe.resolveWith(se,[xe]))}}),xe.ready.then=Fe.then,"complete"===se.readyState||"loading"!==se.readyState&&!se.documentElement.doScroll?o.setTimeout(xe.ready):(se.addEventListener("DOMContentLoaded",m),o.addEventListener("load",m));var Pe=function e(t,n,r,i,o,a,s){var u=0,l=t.length,c=null==r;if("object"===xe.type(r)){o=!0;for(u in r)e(t,n,u,r[u],!0,a,s)}else if(void 0!==i&&(o=!0,xe.isFunction(i)||(s=!0),c&&(s?(n.call(t,i),n=null):(c=n,n=function(e,t,n){return c.call(xe(e),n)})),n))for(;u<l;u++)n(t[u],r,s?i:i.call(t[u],u,n(t[u],r)));return o?t:c?n.call(t):l?n(t[0],r):a},Me=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};v.uid=1,v.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Me(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[xe.camelCase(t)]=n;else for(r in t)i[xe.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][xe.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){Array.isArray(t)?t=t.map(xe.camelCase):(t=xe.camelCase(t),t=t in r?[t]:t.match(Oe)||[]),n=t.length;for(;n--;)delete r[t[n]]}(void 0===t||xe.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!xe.isEmptyObject(t)}};var Ie=new v,Re=new v,We=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,$e=/[A-Z]/g;xe.extend({hasData:function(e){return Re.hasData(e)||Ie.hasData(e)},data:function(e,t,n){return Re.access(e,t,n)},removeData:function(e,t){Re.remove(e,t)},_data:function(e,t,n){return Ie.access(e,t,n)},_removeData:function(e,t){Ie.remove(e,t)}}),xe.fn.extend({data:function(e,t){var n,r,o,a=this[0],s=a&&a.attributes;if(void 0===e){if(this.length&&(o=Re.get(a),1===a.nodeType&&!Ie.get(a,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&(r=s[n].name,0===r.indexOf("data-")&&(r=xe.camelCase(r.slice(5)),x(a,r,o[r])));Ie.set(a,"hasDataAttrs",!0)}return o}return"object"===(void 0===e?"undefined":i(e))?this.each(function(){Re.set(this,e)}):Pe(this,function(t){var n;if(a&&void 0===t){if(void 0!==(n=Re.get(a,e)))return n;if(void 0!==(n=x(a,e)))return n}else this.each(function(){Re.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Re.remove(this,e)})}}),xe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Ie.get(e,t),n&&(!r||Array.isArray(n)?r=Ie.access(e,t,xe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=xe.queue(e,t),r=n.length,i=n.shift(),o=xe._queueHooks(e,t),a=function(){xe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ie.get(e,n)||Ie.access(e,n,{empty:xe.Callbacks("once memory").add(function(){Ie.remove(e,[t+"queue",n])})})}}),xe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?xe.queue(this[0],e):void 0===t?this:this.each(function(){var n=xe.queue(this,e,t);xe._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&xe.dequeue(this,e)})},dequeue:function(e){return this.each(function(){xe.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=xe.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Ie.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Be=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ze=new RegExp("^(?:([+-])=|)("+Be+")([a-z%]*)$","i"),Xe=["Top","Right","Bottom","Left"],Ue=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&xe.contains(e.ownerDocument,e)&&"none"===xe.css(e,"display")},Ve=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i},Ge={};xe.fn.extend({show:function(){return T(this,!0)},hide:function(){return T(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ue(this)?xe(this).show():xe(this).hide()})}});var Ye=/^(?:checkbox|radio)$/i,Qe=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,Je=/^$|\/(?:java|ecma)script/i,Ke={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ke.optgroup=Ke.option,Ke.tbody=Ke.tfoot=Ke.colgroup=Ke.caption=Ke.thead,Ke.th=Ke.td;var Ze=/<|&#?\w+;/;!function(){var e=se.createDocumentFragment(),t=e.appendChild(se.createElement("div")),n=se.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ye.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ye.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var et=se.documentElement,tt=/^key/,nt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rt=/^([^.]*)(?:\.(.+)|)/;xe.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,d,p,h,g,m=Ie.get(e);if(m)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&xe.find.matchesSelector(et,i),n.guid||(n.guid=xe.guid++),(u=m.events)||(u=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==xe&&xe.event.triggered!==t.type?xe.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Oe)||[""],l=t.length;l--;)s=rt.exec(t[l])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p&&(f=xe.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=xe.event.special[p]||{},c=xe.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&xe.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||(d=u[p]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),xe.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,d,p,h,g,m=Ie.hasData(e)&&Ie.get(e);if(m&&(u=m.events)){for(t=(t||"").match(Oe)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p){for(f=xe.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=u[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||xe.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)xe.event.remove(e,p+t[l],n,r,!0);xe.isEmptyObject(u)&&Ie.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=xe.event.fix(e),u=new Array(arguments.length),l=(Ie.get(this,"events")||{})[s.type]||[],c=xe.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=xe.event.handlers.call(this,s,l),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((xe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)r=t[n],i=r.selector+" ",void 0===a[i]&&(a[i]=r.needsContext?xe(i,this).index(l)>-1:xe.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(xe.Event.prototype,e,{enumerable:!0,configurable:!0,get:xe.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[xe.expando]?e:new xe.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==N()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===N()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&l(this,"input"))return this.click(),!1},_default:function(e){return l(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},xe.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},xe.Event=function(e,t){if(!(this instanceof xe.Event))return new xe.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?S:E,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&xe.extend(this,t),this.timeStamp=e&&e.timeStamp||xe.now(),this[xe.expando]=!0},xe.Event.prototype={constructor:xe.Event,isDefaultPrevented:E,isPropagationStopped:E,isImmediatePropagationStopped:E,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=S,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=S,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=S,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},xe.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&tt.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&nt.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},xe.event.addProp),xe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){xe.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||xe.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),xe.fn.extend({on:function(e,t,n,r){return _(this,e,t,n,r)},one:function(e,t,n,r){return _(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,xe(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"===(void 0===e?"undefined":i(e))){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=E),this.each(function(){xe.event.remove(this,e,n,t)})}});var it=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ot=/<script|<style|<link/i,at=/checked\s*(?:[^=]|=\s*.checked.)/i,st=/^true\/(.*)/,ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;xe.extend({htmlPrefilter:function(e){return e.replace(it,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=xe.contains(e.ownerDocument,e);if(!(ye.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||xe.isXMLDoc(e)))for(a=C(s),o=C(e),r=0,i=o.length;r<i;r++)O(o[r],a[r]);if(t)if(n)for(o=o||C(e),a=a||C(s),r=0,i=o.length;r<i;r++)L(o[r],a[r]);else L(e,s);return a=C(s,"script"),a.length>0&&k(a,!u&&C(e,"script")),s},cleanData:function(e){for(var t,n,r,i=xe.event.special,o=0;void 0!==(n=e[o]);o++)if(Me(n)){if(t=n[Ie.expando]){if(t.events)for(r in t.events)i[r]?xe.event.remove(n,r):xe.removeEvent(n,r,t.handle);n[Ie.expando]=void 0}n[Re.expando]&&(n[Re.expando]=void 0)}}}),xe.fn.extend({detach:function(e){return F(this,e,!0)},remove:function(e){return F(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?xe.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return H(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){D(this,e).appendChild(e)}})},prepend:function(){return H(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=D(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return H(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return H(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(xe.cleanData(C(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return xe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ot.test(e)&&!Ke[(Qe.exec(e)||["",""])[1].toLowerCase()]){e=xe.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(xe.cleanData(C(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return H(this,arguments,function(t){var n=this.parentNode;xe.inArray(this,e)<0&&(xe.cleanData(C(this)),n&&n.replaceChild(t,this))},e)}}),xe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){xe.fn[e]=function(e){for(var n,r=[],i=xe(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),xe(i[a])[t](n),fe.apply(r,n.get());return this.pushStack(r)}});var lt=/^margin/,ct=new RegExp("^("+Be+")(?!px)[a-z%]+$","i"),ft=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=o),t.getComputedStyle(e)};!function(){function e(){if(s){s.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",et.appendChild(a);var e=o.getComputedStyle(s);t="1%"!==e.top,i="2px"===e.marginLeft,n="4px"===e.width,s.style.marginRight="50%",r="4px"===e.marginRight,et.removeChild(a),s=null}}var t,n,r,i,a=se.createElement("div"),s=se.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",ye.clearCloneStyle="content-box"===s.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(s),xe.extend(ye,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return e(),n},pixelMarginRight:function(){return e(),r},reliableMarginLeft:function(){return e(),i}}))}();var dt=/^(none|table(?!-c[ea]).+)/,pt=/^--/,ht={position:"absolute",visibility:"hidden",display:"block"},gt={letterSpacing:"0",fontWeight:"400"},mt=["Webkit","Moz","ms"],vt=se.createElement("div").style;xe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=P(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,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:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=xe.camelCase(t),l=pt.test(t),c=e.style;if(l||(t=R(u)),s=xe.cssHooks[t]||xe.cssHooks[u],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(e,!1,r))?o:c[t];a=void 0===n?"undefined":i(n),"string"===a&&(o=ze.exec(n))&&o[1]&&(n=b(e,t,o),a="number"),null!=n&&n===n&&("number"===a&&(n+=o&&o[3]||(xe.cssNumber[u]?"":"px")),ye.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=xe.camelCase(t);return pt.test(t)||(t=R(s)),a=xe.cssHooks[t]||xe.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=P(e,t,r)),"normal"===i&&t in gt&&(i=gt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),xe.each(["height","width"],function(e,t){xe.cssHooks[t]={get:function(e,n,r){if(n)return!dt.test(xe.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?B(e,t,r):Ve(e,ht,function(){return B(e,t,r)})},set:function(e,n,r){var i,o=r&&ft(e),a=r&&$(e,t,r,"border-box"===xe.css(e,"boxSizing",!1,o),o);return a&&(i=ze.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=xe.css(e,t)),W(e,n,a)}}}),xe.cssHooks.marginLeft=M(ye.reliableMarginLeft,function(e,t){if(t)return(parseFloat(P(e,"marginLeft"))||e.getBoundingClientRect().left-Ve(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),xe.each({margin:"",padding:"",border:"Width"},function(e,t){xe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Xe[r]+t]=o[r]||o[r-2]||o[0];return i}},lt.test(e)||(xe.cssHooks[e+t].set=W)}),xe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=ft(e),i=t.length;a<i;a++)o[t[a]]=xe.css(e,t[a],!1,r);return o}return void 0!==n?xe.style(e,t,n):xe.css(e,t)},e,t,arguments.length>1)}}),xe.Tween=z,z.prototype={constructor:z,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||xe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(xe.cssNumber[n]?"":"px")},cur:function(){var e=z.propHooks[this.prop];return e&&e.get?e.get(this):z.propHooks._default.get(this)},run:function(e){var t,n=z.propHooks[this.prop];return this.options.duration?this.pos=t=xe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):z.propHooks._default.set(this),this}},z.prototype.init.prototype=z.prototype,z.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=xe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){xe.fx.step[e.prop]?xe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[xe.cssProps[e.prop]]&&!xe.cssHooks[e.prop]?e.elem[e.prop]=e.now:xe.style(e.elem,e.prop,e.now+e.unit)}}},z.propHooks.scrollTop=z.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},xe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},xe.fx=z.prototype.init,xe.fx.step={};var yt,xt,bt=/^(?:toggle|show|hide)$/,wt=/queueHooks$/;xe.Animation=xe.extend(J,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return b(n.elem,e,ze.exec(t),n),n}]},tweener:function(e,t){xe.isFunction(e)?(t=e,e=["*"]):e=e.match(Oe);for(var n,r=0,i=e.length;r<i;r++)n=e[r],J.tweeners[n]=J.tweeners[n]||[],J.tweeners[n].unshift(t)},prefilters:[Y],prefilter:function(e,t){t?J.prefilters.unshift(e):J.prefilters.push(e)}}),xe.speed=function(e,t,n){var r=e&&"object"===(void 0===e?"undefined":i(e))?xe.extend({},e):{complete:n||!n&&t||xe.isFunction(e)&&e,duration:e,easing:n&&t||t&&!xe.isFunction(t)&&t};return xe.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in xe.fx.speeds?r.duration=xe.fx.speeds[r.duration]:r.duration=xe.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){xe.isFunction(r.old)&&r.old.call(this),r.queue&&xe.dequeue(this,r.queue)},r},xe.fn.extend({fadeTo:function(e,t,n,r){return this.filter(Ue).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=xe.isEmptyObject(e),o=xe.speed(t,n,r),a=function(){var t=J(this,xe.extend({},e),o);(i||Ie.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=xe.timers,a=Ie.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&wt.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||xe.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=Ie.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=xe.timers,a=r?r.length:0;for(n.finish=!0,xe.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),xe.each(["toggle","show","hide"],function(e,t){var n=xe.fn[t];xe.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(V(t,!0),e,r,i)}}),xe.each({slideDown:V("show"),slideUp:V("hide"),slideToggle:V("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){xe.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),xe.timers=[],xe.fx.tick=function(){var e,t=0,n=xe.timers;for(yt=xe.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||xe.fx.stop(),yt=void 0},xe.fx.timer=function(e){xe.timers.push(e),xe.fx.start()},xe.fx.interval=13,xe.fx.start=function(){xt||(xt=!0,X())},xe.fx.stop=function(){xt=null},xe.fx.speeds={slow:600,fast:200,_default:400},xe.fn.delay=function(e,t){return e=xe.fx?xe.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=o.setTimeout(t,e);n.stop=function(){o.clearTimeout(r)}})},function(){var e=se.createElement("input"),t=se.createElement("select"),n=t.appendChild(se.createElement("option"));e.type="checkbox",ye.checkOn=""!==e.value,ye.optSelected=n.selected,e=se.createElement("input"),e.value="t",e.type="radio",ye.radioValue="t"===e.value}();var Tt,Ct=xe.expr.attrHandle;xe.fn.extend({attr:function(e,t){return Pe(this,xe.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){xe.removeAttr(this,e)})}}),xe.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?xe.prop(e,t,n):(1===o&&xe.isXMLDoc(e)||(i=xe.attrHooks[t.toLowerCase()]||(xe.expr.match.bool.test(t)?Tt:void 0)),void 0!==n?null===n?void xe.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=xe.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!ye.radioValue&&"radio"===t&&l(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Oe);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),Tt={set:function(e,t,n){return!1===t?xe.removeAttr(e,n):e.setAttribute(n,n),n}},xe.each(xe.expr.match.bool.source.match(/\w+/g),function(e,t){var n=Ct[t]||xe.find.attr;Ct[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=Ct[a],Ct[a]=i,i=null!=n(e,t,r)?a:null,Ct[a]=o),i}});var kt=/^(?:input|select|textarea|button)$/i,jt=/^(?:a|area)$/i;xe.fn.extend({prop:function(e,t){return Pe(this,xe.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[xe.propFix[e]||e]})}}),xe.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&xe.isXMLDoc(e)||(t=xe.propFix[t]||t,i=xe.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=xe.find.attr(e,"tabindex");return t?parseInt(t,10):kt.test(e.nodeName)||jt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),ye.optSelected||(xe.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),xe.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){xe.propFix[this.toLowerCase()]=this}),xe.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(xe.isFunction(e))return this.each(function(t){xe(this).addClass(e.call(this,t,Z(this)))});if("string"==typeof e&&e)for(t=e.match(Oe)||[];n=this[u++];)if(i=Z(n),r=1===n.nodeType&&" "+K(i)+" "){for(a=0;o=t[a++];)r.indexOf(" "+o+" ")<0&&(r+=o+" ");s=K(r),i!==s&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(xe.isFunction(e))return this.each(function(t){xe(this).removeClass(e.call(this,t,Z(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof e&&e)for(t=e.match(Oe)||[];n=this[u++];)if(i=Z(n),r=1===n.nodeType&&" "+K(i)+" "){for(a=0;o=t[a++];)for(;r.indexOf(" "+o+" ")>-1;)r=r.replace(" "+o+" "," ");s=K(r),i!==s&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=void 0===e?"undefined":i(e);return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):xe.isFunction(e)?this.each(function(n){xe(this).toggleClass(e.call(this,n,Z(this),t),t)}):this.each(function(){var t,r,i,o;if("string"===n)for(r=0,i=xe(this),o=e.match(Oe)||[];t=o[r++];)i.hasClass(t)?i.removeClass(t):i.addClass(t);else void 0!==e&&"boolean"!==n||(t=Z(this),t&&Ie.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":Ie.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+K(Z(n))+" ").indexOf(t)>-1)return!0;return!1}});var St=/\r/g;xe.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=xe.isFunction(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,xe(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=xe.map(i,function(e){return null==e?"":e+""})),(t=xe.valHooks[this.type]||xe.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=xe.valHooks[i.type]||xe.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(St,""):null==n?"":n)}}}),xe.extend({valHooks:{option:{get:function(e){var t=xe.find.attr(e,"value");return null!=t?t:K(xe.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(n=i[r],(n.selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!l(n.parentNode,"optgroup"))){if(t=xe(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,i=e.options,o=xe.makeArray(t),a=i.length;a--;)r=i[a],(r.selected=xe.inArray(xe.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),xe.each(["radio","checkbox"],function(){xe.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=xe.inArray(xe(e).val(),t)>-1}},ye.checkOn||(xe.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Et=/^(?:focusinfocus|focusoutblur)$/;xe.extend(xe.event,{trigger:function(e,t,n,r){var a,s,u,l,c,f,d,p=[n||se],h=ge.call(e,"type")?e.type:e,g=ge.call(e,"namespace")?e.namespace.split("."):[];if(s=u=n=n||se,3!==n.nodeType&&8!==n.nodeType&&!Et.test(h+xe.event.triggered)&&(h.indexOf(".")>-1&&(g=h.split("."),h=g.shift(),g.sort()),c=h.indexOf(":")<0&&"on"+h,e=e[xe.expando]?e:new xe.Event(h,"object"===(void 0===e?"undefined":i(e))&&e),e.isTrigger=r?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:xe.makeArray(t,[e]),d=xe.event.special[h]||{},r||!d.trigger||!1!==d.trigger.apply(n,t))){if(!r&&!d.noBubble&&!xe.isWindow(n)){for(l=d.delegateType||h,Et.test(l+h)||(s=s.parentNode);s;s=s.parentNode)p.push(s),u=s;u===(n.ownerDocument||se)&&p.push(u.defaultView||u.parentWindow||o)}for(a=0;(s=p[a++])&&!e.isPropagationStopped();)e.type=a>1?l:d.bindType||h,f=(Ie.get(s,"events")||{})[e.type]&&Ie.get(s,"handle"),f&&f.apply(s,t),(f=c&&s[c])&&f.apply&&Me(s)&&(e.result=f.apply(s,t),!1===e.result&&e.preventDefault());return e.type=h,r||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),t)||!Me(n)||c&&xe.isFunction(n[h])&&!xe.isWindow(n)&&(u=n[c],u&&(n[c]=null),xe.event.triggered=h,n[h](),xe.event.triggered=void 0,u&&(n[c]=u)),e.result}},simulate:function(e,t,n){var r=xe.extend(new xe.Event,n,{type:e,isSimulated:!0});xe.event.trigger(r,null,t)}}),xe.fn.extend({trigger:function(e,t){return this.each(function(){xe.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return xe.event.trigger(e,t,n,!0)}}),xe.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){xe.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),xe.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),ye.focusin="onfocusin"in o,ye.focusin||xe.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){xe.event.simulate(t,e.target,xe.event.fix(e))};xe.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=Ie.access(r,t);i||r.addEventListener(e,n,!0),Ie.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=Ie.access(r,t)-1;i?Ie.access(r,t,i):(r.removeEventListener(e,n,!0),Ie.remove(r,t))}}});var Nt=o.location,_t=xe.now(),Dt=/\?/;xe.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new o.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||xe.error("Invalid XML: "+e),t};var At=/\[\]$/,qt=/\r?\n/g,Lt=/^(?:submit|button|image|reset|file)$/i,Ot=/^(?:input|select|textarea|keygen)/i;xe.param=function(e,t){var n,r=[],i=function(e,t){var n=xe.isFunction(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!xe.isPlainObject(e))xe.each(e,function(){i(this.name,this.value)});else for(n in e)ee(n,e[n],t,i);return r.join("&")},xe.fn.extend({serialize:function(){return xe.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=xe.prop(this,"elements");return e?xe.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!xe(this).is(":disabled")&&Ot.test(this.nodeName)&&!Lt.test(e)&&(this.checked||!Ye.test(e))}).map(function(e,t){var n=xe(this).val();return null==n?null:Array.isArray(n)?xe.map(n,function(e){return{name:t.name,value:e.replace(qt,"\r\n")}}):{name:t.name,value:n.replace(qt,"\r\n")}}).get()}});var Ht=/%20/g,Ft=/#.*$/,Pt=/([?&])_=[^&]*/,Mt=/^(.*?):[ \t]*([^\r\n]*)$/gm,It=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Rt=/^(?:GET|HEAD)$/,Wt=/^\/\//,$t={},Bt={},zt="*/".concat("*"),Xt=se.createElement("a");Xt.href=Nt.href,xe.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Nt.href,type:"GET",isLocal:It.test(Nt.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":xe.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?re(re(e,xe.ajaxSettings),t):re(xe.ajaxSettings,e)},ajaxPrefilter:te($t),ajaxTransport:te(Bt),ajax:function(e,t){function n(e,t,n,i){var u,c,p,h,w,T=t;f||(f=!0,l&&o.clearTimeout(l),r=void 0,s=i||"",k.readyState=e>0?4:0,u=e>=200&&e<300||304===e,n&&(h=ie(g,k,n)),h=oe(g,h,k,u),u?(g.ifModified&&(w=k.getResponseHeader("Last-Modified"),w&&(xe.lastModified[a]=w),(w=k.getResponseHeader("etag"))&&(xe.etag[a]=w)),204===e||"HEAD"===g.type?T="nocontent":304===e?T="notmodified":(T=h.state,c=h.data,p=h.error,u=!p)):(p=T,!e&&T||(T="error",e<0&&(e=0))),k.status=e,k.statusText=(t||T)+"",u?y.resolveWith(m,[c,T,k]):y.rejectWith(m,[k,T,p]),k.statusCode(b),b=void 0,d&&v.trigger(u?"ajaxSuccess":"ajaxError",[k,g,u?c:p]),x.fireWith(m,[k,T]),d&&(v.trigger("ajaxComplete",[k,g]),--xe.active||xe.event.trigger("ajaxStop")))}"object"===(void 0===e?"undefined":i(e))&&(t=e,e=void 0),t=t||{};var r,a,s,u,l,c,f,d,p,h,g=xe.ajaxSetup({},t),m=g.context||g,v=g.context&&(m.nodeType||m.jquery)?xe(m):xe.event,y=xe.Deferred(),x=xe.Callbacks("once memory"),b=g.statusCode||{},w={},T={},C="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(f){if(!u)for(u={};t=Mt.exec(s);)u[t[1].toLowerCase()]=t[2];t=u[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return f?s:null},setRequestHeader:function(e,t){return null==f&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,w[e]=t),this},overrideMimeType:function(e){return null==f&&(g.mimeType=e),this},statusCode:function(e){var t;if(e)if(f)k.always(e[k.status]);else for(t in e)b[t]=[b[t],e[t]];return this},abort:function(e){var t=e||C;return r&&r.abort(t),n(0,t),this}};if(y.promise(k),g.url=((e||g.url||Nt.href)+"").replace(Wt,Nt.protocol+"//"),g.type=t.method||t.type||g.method||g.type,g.dataTypes=(g.dataType||"*").toLowerCase().match(Oe)||[""],null==g.crossDomain){c=se.createElement("a");try{c.href=g.url,c.href=c.href,g.crossDomain=Xt.protocol+"//"+Xt.host!=c.protocol+"//"+c.host}catch(e){g.crossDomain=!0}}if(g.data&&g.processData&&"string"!=typeof g.data&&(g.data=xe.param(g.data,g.traditional)),ne($t,g,t,k),f)return k;d=xe.event&&g.global,d&&0==xe.active++&&xe.event.trigger("ajaxStart"),g.type=g.type.toUpperCase(),g.hasContent=!Rt.test(g.type),a=g.url.replace(Ft,""),g.hasContent?g.data&&g.processData&&0===(g.contentType||"").indexOf("application/x-www-form-urlencoded")&&(g.data=g.data.replace(Ht,"+")):(h=g.url.slice(a.length),g.data&&(a+=(Dt.test(a)?"&":"?")+g.data,delete g.data),!1===g.cache&&(a=a.replace(Pt,"$1"),h=(Dt.test(a)?"&":"?")+"_="+_t+++h),g.url=a+h),g.ifModified&&(xe.lastModified[a]&&k.setRequestHeader("If-Modified-Since",xe.lastModified[a]),xe.etag[a]&&k.setRequestHeader("If-None-Match",xe.etag[a])),(g.data&&g.hasContent&&!1!==g.contentType||t.contentType)&&k.setRequestHeader("Content-Type",g.contentType),k.setRequestHeader("Accept",g.dataTypes[0]&&g.accepts[g.dataTypes[0]]?g.accepts[g.dataTypes[0]]+("*"!==g.dataTypes[0]?", "+zt+"; q=0.01":""):g.accepts["*"]);for(p in g.headers)k.setRequestHeader(p,g.headers[p]);if(g.beforeSend&&(!1===g.beforeSend.call(m,k,g)||f))return k.abort();if(C="abort",x.add(g.complete),k.done(g.success),k.fail(g.error),r=ne(Bt,g,t,k)){if(k.readyState=1,d&&v.trigger("ajaxSend",[k,g]),f)return k;g.async&&g.timeout>0&&(l=o.setTimeout(function(){k.abort("timeout")},g.timeout));try{f=!1,r.send(w,n)}catch(e){if(f)throw e;n(-1,e)}}else n(-1,"No Transport");return k},getJSON:function(e,t,n){return xe.get(e,t,n,"json")},getScript:function(e,t){return xe.get(e,void 0,t,"script")}}),xe.each(["get","post"],function(e,t){xe[t]=function(e,n,r,i){return xe.isFunction(n)&&(i=i||r,r=n,n=void 0),xe.ajax(xe.extend({url:e,type:t,dataType:i,data:n,success:r},xe.isPlainObject(e)&&e))}}),xe._evalUrl=function(e){return xe.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,throws:!0})},xe.fn.extend({wrapAll:function(e){var t;return this[0]&&(xe.isFunction(e)&&(e=e.call(this[0])),t=xe(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return xe.isFunction(e)?this.each(function(t){xe(this).wrapInner(e.call(this,t))}):this.each(function(){var t=xe(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=xe.isFunction(e);return this.each(function(n){xe(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){xe(this).replaceWith(this.childNodes)}),this}}),xe.expr.pseudos.hidden=function(e){return!xe.expr.pseudos.visible(e)},xe.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},xe.ajaxSettings.xhr=function(){try{return new o.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Vt=xe.ajaxSettings.xhr();ye.cors=!!Vt&&"withCredentials"in Vt,ye.ajax=Vt=!!Vt,xe.ajaxTransport(function(e){var t,n;if(ye.cors||Vt&&!e.crossDomain)return{send:function(r,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(a in r)s.setRequestHeader(a,r[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(Ut[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&o.setTimeout(function(){t&&n()})},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}}),xe.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),xe.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return xe.globalEval(e),e}}}),xe.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),xe.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(r,i){t=xe("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&i("error"===e.type?404:200,e.type)}),se.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;xe.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||xe.expando+"_"+_t++;return this[e]=!0,e}}),xe.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,a,s=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=xe.isFunction(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(Dt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return a||xe.error(r+" was not called"),a[0]},e.dataTypes[0]="json",i=o[r],o[r]=function(){a=arguments},n.always(function(){void 0===i?xe(o).removeProp(r):o[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),a&&xe.isFunction(i)&&i(a[0]),a=i=void 0}),"script"}),ye.createHTMLDocument=function(){var e=se.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),xe.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var r,i,o;return t||(ye.createHTMLDocument?(t=se.implementation.createHTMLDocument(""),r=t.createElement("base"),r.href=se.location.href,t.head.appendChild(r)):t=se),i=Ne.exec(e),o=!n&&[],i?[t.createElement(i[1])]:(i=j([e],t,o),o&&o.length&&xe(o).remove(),xe.merge([],i.childNodes))},xe.fn.load=function(e,t,n){var r,o,a,s=this,u=e.indexOf(" ");return u>-1&&(r=K(e.slice(u)),e=e.slice(0,u)),xe.isFunction(t)?(n=t,t=void 0):t&&"object"===(void 0===t?"undefined":i(t))&&(o="POST"),s.length>0&&xe.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done(function(e){a=arguments,s.html(r?xe("<div>").append(xe.parseHTML(e)).find(r):e)}).always(n&&function(e,t){s.each(function(){n.apply(this,a||[e.responseText,t,e])})}),this},xe.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){xe.fn[t]=function(e){return this.on(t,e)}}),xe.expr.pseudos.animated=function(e){return xe.grep(xe.timers,function(t){return e===t.elem}).length},xe.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=xe.css(e,"position"),f=xe(e),d={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=xe.css(e,"top"),u=xe.css(e,"left"),l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1,l?(r=f.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),xe.isFunction(t)&&(t=t.call(e,n,xe.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+i),"using"in t?t.using.call(e,d):f.css(d)}},xe.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){xe.offset.setOffset(this,e,t)});var t,n,r,i,o=this[0];if(o)return o.getClientRects().length?(r=o.getBoundingClientRect(),t=o.ownerDocument,n=t.documentElement,i=t.defaultView,{top:r.top+i.pageYOffset-n.clientTop,left:r.left+i.pageXOffset-n.clientLeft}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n=this[0],r={top:0,left:0};return"fixed"===xe.css(n,"position")?t=n.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),l(e[0],"html")||(r=e.offset()),r={top:r.top+xe.css(e[0],"borderTopWidth",!0),left:r.left+xe.css(e[0],"borderLeftWidth",!0)}),{top:t.top-r.top-xe.css(n,"marginTop",!0),left:t.left-r.left-xe.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===xe.css(e,"position");)e=e.offsetParent;return e||et})}}),xe.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;xe.fn[e]=function(r){return Pe(this,function(e,r,i){var o;if(xe.isWindow(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),xe.each(["top","left"],function(e,t){xe.cssHooks[t]=M(ye.pixelPosition,function(e,n){if(n)return n=P(e,t),ct.test(n)?xe(e).position()[t]+"px":n})}),xe.each({Height:"height",Width:"width"},function(e,t){xe.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){xe.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return Pe(this,function(t,n,i){var o;return xe.isWindow(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?xe.css(t,n,s):xe.style(t,n,i,s)},t,a?i:void 0,a)}})}),xe.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),xe.holdReady=function(e){e?xe.readyWait++:xe.ready(!0)},xe.isArray=Array.isArray,xe.parseJSON=JSON.parse,xe.nodeName=l,n=[],void 0!==(r=function(){return xe}.apply(t,n))&&(e.exports=r);var Qt=o.jQuery,Jt=o.$;return xe.noConflict=function(e){return o.$===xe&&(o.$=Jt),e&&o.jQuery===xe&&(o.jQuery=Qt),xe},a||(o.jQuery=o.$=xe),xe})}).call(t,n(6)(e))},function(e,t,n){"use strict";function r(){var e=(0,a.default)("#ta-attach-images-metabox"),t=e.find("#thirsty_image_holder");e.on("click","#ta_upload_media_manager",function(n){if(n.preventDefault(),r)return void r.open();var r=wp.media({title:(0,a.default)(this).data("uploader-title"),library:{type:"image"},button:{text:(0,a.default)(this).data("uploader-button-text"),close:!0},multiple:!0});r.on("select",function(){var n=r.state().get("selection"),o=(0,a.default)("input[name=post_ID]").val(),s=[],u=(0,a.default)("#thirsty_image_holder");e.find("#thirsty_image_holder").length<=0&&e.find(".inside").append("<div id='thirsty_image_holder'></div>"),n.map(function(e){e=e.toJSON(),s.push(e.id)}),s.length>0&&a.default.ajax({url:ajaxurl,type:"POST",data:{action:"ta_add_attachments_to_affiliate_link",attachment_ids:s,affiliate_link_id:o},dataType:"json"}).done(function(n){if("success"===n.status){var r=t.data("attachments"),o=void 0;"object"==(void 0===r?"undefined":i(r))&&(o=t.data("attachments").map(function(e){return parseInt(e,10)}),o=a.default.unique(o.concat(s)),t.data("attachments",o)),e.find("#thirsty_image_holder").append(n.added_attachments_markup),t.trigger("ta_center_images")}else alert(n.error_msg),console.log(n)}).fail(function(e){alert(e),console.log("Failed to add attachments to affiliate link")}).always(function(){u.find(".thirsty-attached-image").length>0&&u.show(),tb_remove()})}),r.open()}),e.on("click",".thirsty-remove-img",function(){var e=(0,a.default)(this);if(e.hasClass("removing"))return!1;e.addClass("removing");var n=parseInt(e.attr("id")),r=(0,a.default)("input[name=post_ID]").val(),o=e.closest(".thirsty-attached-image"),s=(0,a.default)("#thirsty_image_holder"),u=void 0;e.hasClass("remove-external")&&(u=e.closest(".external-image").find("img"),n=u[0].getAttribute("src")),a.default.ajax({url:ajaxurl,type:"POST",data:{action:"ta_remove_attachment_to_affiliate_link",attachment_id:n,affiliate_link_id:r},dataType:"json"}).done(function(e){if("success"===e.status){var r=t.data("attachments"),a=void 0;"object"==(void 0===r?"undefined":i(r))&&(a=t.data("attachments").map(function(e){return parseInt(e,10)}),a=new Set(a),a.delete(n),t.data("attachments",Array.from(a))),o.fadeOut(300).delay(300).remove(),s.find(".thirsty-attached-image").length<=0&&s.hide()}else alert(e.error_msg),console.log(e)}).fail(function(e){alert("Failed to remove attachment from affiliate link"),console.log(e)})});var n=function(){var e=(0,a.default)(".media-modal-content ul.attachments li.attachment"),n=t.data("attachments"),r=void 0;"object"==(void 0===n?"undefined":i(n))&&(r=n.map(function(e){return parseInt(e,10)}),e.each(function(){var e=(0,a.default)(this),t=(0,a.default)(this).data("id");e.show(),a.default.inArray(t,r)>-1&&e.hide()}))};e.on("click","#ta_upload_media_manager",n),(0,a.default)("body").on("click",".media-modal-content .media-menu-item",n),(0,a.default)(document).on("DOMNodeInserted",function(e){var n=(0,a.default)(e.target),r=t.data("attachments"),o=void 0;n.hasClass("attachment")&&"object"==(void 0===r?"undefined":i(r))&&(o=n.data("id"),r=r.map(function(e){return parseInt(e,10)}),a.default.inArray(o,r)>-1&&n.remove())}),e.on("click","#add-external-image",function(){(0,a.default)(this).hide(),e.find(".external-image-form").show(),e.find(".external-image-form input").focus()}),e.on("click",".external-image-form button.add-external",function(){var n=e.find(".external-image-form input"),r={action:"ta_insert_external_image",url:n.val(),link_id:(0,a.default)("input[name=post_ID]").val()};a.default.post(ajaxurl,r,function(n){"success"==n.status?(e.find("#thirsty_image_holder").length<=0&&e.find(".inside").append("<div id='thirsty_image_holder'></div>"),e.find("#thirsty_image_holder").append(n.markup).show(),t.trigger("ta_center_images")):(alert(n.error_msg),console.log(n)),e.find(".external-image-form input").val(""),e.find("#add-external-image").show(),e.find(".external-image-form").hide()},"json")}),e.on("click",".external-image-form button.cancel",function(){e.find(".external-image-form input").val(""),e.find("#add-external-image").show(),e.find(".external-image-form").hide()}),e.on("ta_center_images","#thirsty_image_holder",function(){var e=(0,a.default)(this).find(".thirsty-img img"),t=void 0,n=void 0,r=void 0;setTimeout(function(){for(n=0;n<=e.length;n++)t=(0,a.default)(e[n]),t.width()&&(r=(t.width()-100)/2,t.css("margin-left",-r))},500)}),t.trigger("ta_center_images")}Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.default=r;var o=n(0),a=function(e){return e&&e.__esModule?e:{default:e}}(o)},function(e,t,n){"use strict";function r(){var e=(0,o.default)("#ta-urls-metabox");(0,o.default)("#slugdiv").remove(),e.on("click","button.edit-ta-slug",function(){e.find(".cloaked-fields").hide(),e.find(".slug-fields").fadeIn(200)}),e.on("click","button.save-ta-slug",function(){var t=e.find("input#ta_slug").val(),n=e.find("input#ta_cloaked_url").val(),r=n.replace(/[^\/]+\/?$/g,"");/^([a-z0-9-_% ]+)$/.test(t)?(t=""==t?n.match(/[^\/]+$/):t,e.find("input#ta_cloaked_url").val(r+t+"/"),e.find(".slug-fields").hide(),e.find(".cloaked-fields").fadeIn(200)):(0,o.default)("input#publish").click()})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,n){"use strict";function r(){function e(e,t){o.default.post(ajaxurl,{action:"ta_get_category_slug",term_id:e},function(n){"success"==n.status?r.append("<option value='"+e+"' data-slug='"+n.category_slug+"'>"+t+"</option>").trigger("change"):(alert(n.error_msg),console.log(n))},"json")}function t(){var e=n.find("input[type='checkbox']:checked"),t=[],i=[],a=void 0,s=void 0,u=void 0,l=void 0;if(!(e.length<1)){for(l=0;l<e.length;l++)u=(0,o.default)(e[l]).parent().text().trim(),t.push(u),i[u]=l;t=t.sort(function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e>t?1:e<t?-1:0}),s=i[t[0]],a=(0,o.default)(e[s]),o.default.post(ajaxurl,{action:"ta_get_category_slug",term_id:a.val()},function(e){"success"==e.status?(r.find("option:first-child").data("slug",e.category_slug).attr("data-slug",e.category_slug),r.trigger("change")):(alert(e.error_msg),console.log(e))},"json")}}var n=(0,o.default)("#thirstylink-categorychecklist"),r=(0,o.default)("select[name='ta_category_slug']");n.on("change","input[type='checkbox']",function(){var n=(0,o.default)(this).val(),i=(0,o.default)(this).parent().text(),a=(0,o.default)(this).prop("checked");t(),a?e(n,i):(r.find("option[value='"+n+"']").remove(),r.trigger("change"))}),(0,o.default)(document).on("DOMNodeInserted","#thirstylink-categorychecklist",function(){var n=(0,o.default)("#thirstylink-categorychecklist li").first(),i=n.find("input[type='checkbox']").val(),a=n.find("label").text(),s=n.find("input[type='checkbox']").prop("checked");t(),s?e(i,a):r.find("option[value='"+i+"']").remove()}),(0,o.default)(document).on("change","select[name='ta_category_slug']",function(){var e=(0,o.default)(this),t=e.find("option:selected").data("slug"),n=e.data("home-link-prefix"),r=(0,o.default)("#ta_slug").val(),i=(0,o.default)("#ta_cloaked_url");(0,o.default)(this).find("option").length<=1?i.val(n+r+"/"):i.val(n+t+"/"+r+"/")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t,n){"use strict";function r(){var e=(0,o.default)("#ta-inserted-link-scanner-metabox");e.on("click","#inserted-link-scan-trigger",function(){var t=(0,o.default)(this),n=e.find(".inside"),r=n.find(".inserted-into-table table tbody"),i=n.find(".overlay"),a=n.find(".scanned-inserted-status .last-scanned"),s=(0,o.default)("input#post_ID").val();t.prop("disabled",!0),i.css("height",n.height()).show(),o.default.post(ajaxurl,{action:"ta_link_inserted_scanner",link_id:s},function(e){"success"==e.status?(r.html(e.results_markup),a.html(e.last_scanned)):(alert(e.error_msg),console.log(e)),t.prop("disabled",!1),i.hide()},"json")})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=n(0),o=function(e){return e&&e.__esModule?e:{default:e}}(i)},function(e,t){},function(e,t,n){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var i=n(0),o=r(i),a=n(1),s=r(a),u=n(2),l=r(u),c=n(3),f=r(c),d=n(4),p=r(d);n(5),(0,o.default)(document).ready(function(){(0,s.default)(),(0,l.default)(),(0,f.default)(),(0,p.default)()})}]);
|
11 |
*
|
12 |
* Date: 2017-03-20T18:59Z
|
13 |
*/
|
14 |
+
!function(t,n){"object"===i(e)&&"object"===i(e.exports)?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:void 0,function(o,a){function s(e,t){t=t||se;var n=t.createElement("script");n.text=e,t.head.appendChild(n).parentNode.removeChild(n)}function u(e){var t=!!e&&"length"in e&&e.length,n=xe.type(e);return"function"!==n&&!xe.isWindow(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function l(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}function c(e,t,n){return xe.isFunction(t)?xe.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?xe.grep(e,function(e){return e===t!==n}):"string"!=typeof t?xe.grep(e,function(e){return de.call(t,e)>-1!==n}):Ne.test(t)?xe.filter(t,e,n):(t=xe.filter(t,e),xe.grep(e,function(e){return de.call(t,e)>-1!==n&&1===e.nodeType}))}function f(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}function d(e){var t={};return xe.each(e.match(Oe)||[],function(e,n){t[n]=!0}),t}function p(e){return e}function h(e){throw e}function g(e,t,n,r){var i;try{e&&xe.isFunction(i=e.promise)?i.call(e).done(t).fail(n):e&&xe.isFunction(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}function m(){se.removeEventListener("DOMContentLoaded",m),o.removeEventListener("load",m),xe.ready()}function v(){this.expando=xe.expando+v.uid++}function y(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:We.test(e)?JSON.parse(e):e)}function x(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace($e,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=y(n)}catch(e){}Re.set(e,t,n)}else n=void 0;return n}function b(e,t,n,r){var i,o=1,a=20,s=r?function(){return r.cur()}:function(){return xe.css(e,t,"")},u=s(),l=n&&n[3]||(xe.cssNumber[t]?"":"px"),c=(xe.cssNumber[t]||"px"!==l&&+u)&&ze.exec(xe.css(e,t));if(c&&c[3]!==l){l=l||c[3],n=n||[],c=+u||1;do{o=o||".5",c/=o,xe.style(e,t,c+l)}while(o!==(o=s()/u)&&1!==o&&--a)}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}function w(e){var t,n=e.ownerDocument,r=e.nodeName,i=Ge[r];return i||(t=n.body.appendChild(n.createElement(r)),i=xe.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),Ge[r]=i,i)}function T(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)r=e[o],r.style&&(n=r.style.display,t?("none"===n&&(i[o]=Ie.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&Ue(r)&&(i[o]=w(r))):"none"!==n&&(i[o]="none",Ie.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}function C(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&l(e,t)?xe.merge([e],n):n}function k(e,t){for(var n=0,r=e.length;n<r;n++)Ie.set(e[n],"globalEval",!t||Ie.get(t[n],"globalEval"))}function _(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p<h;p++)if((o=e[p])||0===o)if("object"===xe.type(o))xe.merge(d,o.nodeType?[o]:o);else if(Ze.test(o)){for(a=a||f.appendChild(t.createElement("div")),s=(Qe.exec(o)||["",""])[1].toLowerCase(),u=Ke[s]||Ke._default,a.innerHTML=u[1]+xe.htmlPrefilter(o)+u[2],c=u[0];c--;)a=a.lastChild;xe.merge(d,a.childNodes),a=f.firstChild,a.textContent=""}else d.push(t.createTextNode(o));for(f.textContent="",p=0;o=d[p++];)if(r&&xe.inArray(o,r)>-1)i&&i.push(o);else if(l=xe.contains(o.ownerDocument,o),a=C(f.appendChild(o),"script"),l&&k(a),n)for(c=0;o=a[c++];)Je.test(o.type||"")&&n.push(o);return f}function j(){return!0}function S(){return!1}function E(){try{return se.activeElement}catch(e){}}function N(e,t,n,r,o,a){var s,u;if("object"===(void 0===t?"undefined":i(t))){"string"!=typeof n&&(r=r||n,n=void 0);for(u in t)N(e,u,n,r,t[u],a);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=S;else if(!o)return e;return 1===a&&(s=o,o=function(e){return xe().off(e),s.apply(this,arguments)},o.guid=s.guid||(s.guid=xe.guid++)),e.each(function(){xe.event.add(this,t,o,r,n)})}function D(e,t){return l(e,"table")&&l(11!==t.nodeType?t:t.firstChild,"tr")?xe(">tbody",e)[0]||e:e}function A(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function q(e){var t=st.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function L(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Ie.hasData(e)&&(o=Ie.access(e),a=Ie.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)xe.event.add(t,i,l[i][n])}Re.hasData(e)&&(s=Re.access(e),u=xe.extend({},s),Re.set(t,u))}}function O(e,t){var n=t.nodeName.toLowerCase();"input"===n&&Ye.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function H(e,t,n,r){t=ce.apply([],t);var i,o,a,u,l,c,f=0,d=e.length,p=d-1,h=t[0],g=xe.isFunction(h);if(g||d>1&&"string"==typeof h&&!ye.checkClone&&at.test(h))return e.each(function(i){var o=e.eq(i);g&&(t[0]=h.call(this,i,o.html())),H(o,t,n,r)});if(d&&(i=_(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(a=xe.map(C(i,"script"),A),u=a.length;f<d;f++)l=i,f!==p&&(l=xe.clone(l,!0,!0),u&&xe.merge(a,C(l,"script"))),n.call(e[f],l,f);if(u)for(c=a[a.length-1].ownerDocument,xe.map(a,q),f=0;f<u;f++)l=a[f],Je.test(l.type||"")&&!Ie.access(l,"globalEval")&&xe.contains(c,l)&&(l.src?xe._evalUrl&&xe._evalUrl(l.src):s(l.textContent.replace(ut,""),c))}return e}function F(e,t,n){for(var r,i=t?xe.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||xe.cleanData(C(r)),r.parentNode&&(n&&xe.contains(r.ownerDocument,r)&&k(C(r,"script")),r.parentNode.removeChild(r));return e}function P(e,t,n){var r,i,o,a,s=e.style;return n=n||ft(e),n&&(a=n.getPropertyValue(t)||n[t],""!==a||xe.contains(e.ownerDocument,e)||(a=xe.style(e,t)),!ye.pixelMarginRight()&&ct.test(a)&<.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function M(e,t){return{get:function(){return e()?void delete this.get:(this.get=t).apply(this,arguments)}}}function I(e){if(e in vt)return e;for(var t=e[0].toUpperCase()+e.slice(1),n=mt.length;n--;)if((e=mt[n]+t)in vt)return e}function R(e){var t=xe.cssProps[e];return t||(t=xe.cssProps[e]=I(e)||e),t}function W(e,t,n){var r=ze.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function $(e,t,n,r,i){var o,a=0;for(o=n===(r?"border":"content")?4:"width"===t?1:0;o<4;o+=2)"margin"===n&&(a+=xe.css(e,n+Xe[o],!0,i)),r?("content"===n&&(a-=xe.css(e,"padding"+Xe[o],!0,i)),"margin"!==n&&(a-=xe.css(e,"border"+Xe[o]+"Width",!0,i))):(a+=xe.css(e,"padding"+Xe[o],!0,i),"padding"!==n&&(a+=xe.css(e,"border"+Xe[o]+"Width",!0,i)));return a}function B(e,t,n){var r,i=ft(e),o=P(e,t,i),a="border-box"===xe.css(e,"boxSizing",!1,i);return ct.test(o)?o:(r=a&&(ye.boxSizingReliable()||o===e.style[t]),"auto"===o&&(o=e["offset"+t[0].toUpperCase()+t.slice(1)]),(o=parseFloat(o)||0)+$(e,t,n||(a?"border":"content"),r,i)+"px")}function z(e,t,n,r,i){return new z.prototype.init(e,t,n,r,i)}function X(){xt&&(!1===se.hidden&&o.requestAnimationFrame?o.requestAnimationFrame(X):o.setTimeout(X,xe.fx.interval),xe.fx.tick())}function U(){return o.setTimeout(function(){yt=void 0}),yt=xe.now()}function V(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)n=Xe[r],i["margin"+n]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function G(e,t,n){for(var r,i=(J.tweeners[t]||[]).concat(J.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function Y(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,d=this,p={},h=e.style,g=e.nodeType&&Ue(e),m=Ie.get(e,"fxshow");n.queue||(a=xe._queueHooks(e,"fx"),null==a.unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,d.always(function(){d.always(function(){a.unqueued--,xe.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],bt.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!m||void 0===m[r])continue;g=!0}p[r]=m&&m[r]||xe.style(e,r)}if((u=!xe.isEmptyObject(t))||!xe.isEmptyObject(p)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],l=m&&m.display,null==l&&(l=Ie.get(e,"display")),c=xe.css(e,"display"),"none"===c&&(l?c=l:(T([e],!0),l=e.style.display||l,c=xe.css(e,"display"),T([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===xe.css(e,"float")&&(u||(d.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",d.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in p)u||(m?"hidden"in m&&(g=m.hidden):m=Ie.access(e,"fxshow",{display:l}),o&&(m.hidden=!g),g&&T([e],!0),d.done(function(){g||T([e]),Ie.remove(e,"fxshow");for(r in p)xe.style(e,r,p[r])})),u=G(g?m[r]:0,r,d),r in m||(m[r]=u.start,g&&(u.end=u.start,u.start=0))}}function Q(e,t){var n,r,i,o,a;for(n in e)if(r=xe.camelCase(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=xe.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function J(e,t,n){var r,i,o=0,a=J.prefilters.length,s=xe.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=yt||U(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;a<u;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),o<1&&u?n:(u||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:xe.extend({},t),opts:xe.extend(!0,{specialEasing:{},easing:xe.easing._default},n),originalProperties:t,originalOptions:n,startTime:yt||U(),duration:n.duration,tweens:[],createTween:function(t,n){var r=xe.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(Q(c,l.opts.specialEasing);o<a;o++)if(r=J.prefilters[o].call(l,e,c,l.opts))return xe.isFunction(r.stop)&&(xe._queueHooks(l.elem,l.opts.queue).stop=xe.proxy(r.stop,r)),r;return xe.map(c,G,l),xe.isFunction(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),xe.fx.timer(xe.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}function K(e){return(e.match(Oe)||[]).join(" ")}function Z(e){return e.getAttribute&&e.getAttribute("class")||""}function ee(e,t,n,r){var o;if(Array.isArray(t))xe.each(t,function(t,o){n||At.test(e)?r(e,o):ee(e+"["+("object"===(void 0===o?"undefined":i(o))&&null!=o?t:"")+"]",o,n,r)});else if(n||"object"!==xe.type(t))r(e,t);else for(o in t)ee(e+"["+o+"]",t[o],n,r)}function te(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(Oe)||[];if(xe.isFunction(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function ne(e,t,n,r){function i(s){var u;return o[s]=!0,xe.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||a||o[l]?a?!(u=l):void 0:(t.dataTypes.unshift(l),i(l),!1)}),u}var o={},a=e===Bt;return i(t.dataTypes[0])||!o["*"]&&i("*")}function re(e,t){var n,r,i=xe.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&xe.extend(!0,e,r),e}function ie(e,t,n){for(var r,i,o,a,s=e.contents,u=e.dataTypes;"*"===u[0];)u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function oe(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];for(o=c.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if(s=i.split(" "),s[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}var ae=[],se=o.document,ue=Object.getPrototypeOf,le=ae.slice,ce=ae.concat,fe=ae.push,de=ae.indexOf,pe={},he=pe.toString,ge=pe.hasOwnProperty,me=ge.toString,ve=me.call(Object),ye={},xe=function e(t,n){return new e.fn.init(t,n)},be=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,we=/^-ms-/,Te=/-([a-z])/g,Ce=function(e,t){return t.toUpperCase()};xe.fn=xe.prototype={jquery:"3.2.1",constructor:xe,length:0,toArray:function(){return le.call(this)},get:function(e){return null==e?le.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=xe.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return xe.each(this,e)},map:function(e){return this.pushStack(xe.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(le.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:fe,sort:ae.sort,splice:ae.splice},xe.extend=xe.fn.extend=function(){var e,t,n,r,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[u]||{},u++),"object"===(void 0===s?"undefined":i(s))||xe.isFunction(s)||(s={}),u===l&&(s=this,u--);u<l;u++)if(null!=(e=arguments[u]))for(t in e)n=s[t],r=e[t],s!==r&&(c&&r&&(xe.isPlainObject(r)||(o=Array.isArray(r)))?(o?(o=!1,a=n&&Array.isArray(n)?n:[]):a=n&&xe.isPlainObject(n)?n:{},s[t]=xe.extend(c,a,r)):void 0!==r&&(s[t]=r));return s},xe.extend({expando:"jQuery"+("3.2.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isFunction:function(e){return"function"===xe.type(e)},isWindow:function(e){return null!=e&&e===e.window},isNumeric:function(e){var t=xe.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==he.call(e))&&(!(t=ue(e))||"function"==typeof(n=ge.call(t,"constructor")&&t.constructor)&&me.call(n)===ve)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},type:function(e){return null==e?e+"":"object"===(void 0===e?"undefined":i(e))||"function"==typeof e?pe[he.call(e)]||"object":void 0===e?"undefined":i(e)},globalEval:function(e){s(e)},camelCase:function(e){return e.replace(we,"ms-").replace(Te,Ce)},each:function(e,t){var n,r=0;if(u(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(be,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(u(Object(e))?xe.merge(n,"string"==typeof e?[e]:e):fe.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:de.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(u(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return ce.apply([],a)},guid:1,proxy:function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),xe.isFunction(e))return r=le.call(arguments,2),i=function(){return e.apply(t||this,r.concat(le.call(arguments)))},i.guid=e.guid=e.guid||xe.guid++,i},now:Date.now,support:ye}),"function"==typeof Symbol&&(xe.fn[Symbol.iterator]=ae[Symbol.iterator]),xe.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){pe["[object "+t+"]"]=t.toLowerCase()});var ke=/*!
|
15 |
* Sizzle CSS Selector Engine v2.3.3
|
16 |
* https://sizzlejs.com/
|
17 |
*
|
21 |
*
|
22 |
* Date: 2016-08-08
|
23 |
*/
|
24 |
+
function(e){function t(e,t,n,r){var i,o,a,s,u,c,d,p=t&&t.ownerDocument,h=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==h&&9!==h&&11!==h)return n;if(!r&&((t?t.ownerDocument||t:I)!==A&&D(t),t=t||A,L)){if(11!==h&&(u=ge.exec(e)))if(i=u[1]){if(9===h){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(p&&(a=p.getElementById(i))&&P(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&b.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(i)),n}if(b.qsa&&!z[e+" "]&&(!O||!O.test(e))){if(1!==h)p=t,d=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(xe,be):t.setAttribute("id",s=M),c=k(e),o=c.length;o--;)c[o]="#"+s+" "+f(c[o]);d=c.join(","),p=me.test(e)&&l(t.parentNode)||t}if(d)try{return Q.apply(n,p.querySelectorAll(d)),n}catch(e){}finally{s===M&&t.removeAttribute("id")}}}return j(e.replace(oe,"$1"),t,n,r)}function n(){function e(n,r){return t.push(n+" ")>w.cacheLength&&delete e[t.shift()],e[n+" "]=r}var t=[];return e}function r(e){return e[M]=!0,e}function i(e){var t=A.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function o(e,t){for(var n=e.split("|"),r=n.length;r--;)w.attrHandle[n[r]]=t}function a(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&Te(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function u(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function l(e){return e&&void 0!==e.getElementsByTagName&&e}function c(){}function f(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=W++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,d=[R,s];if(u){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,u))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(f=t[M]||(t[M]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===R&&l[1]===s)return d[2]=l[2];if(c[o]=d,d[2]=e(t,n,u))return!0}return!1}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function h(e,n,r){for(var i=0,o=n.length;i<o;i++)t(e,n[i],r);return r}function g(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function m(e,t,n,i,o,a){return i&&!i[M]&&(i=m(i)),o&&!o[M]&&(o=m(o,a)),r(function(r,a,s,u){var l,c,f,d=[],p=[],m=a.length,v=r||h(t||"*",s.nodeType?[s]:s,[]),y=!e||!r&&t?v:g(v,d,e,s,u),x=n?o||(r?e:m||i)?[]:a:y;if(n&&n(y,x,s,u),i)for(l=g(x,p),i(l,[],s,u),c=l.length;c--;)(f=l[c])&&(x[p[c]]=!(y[p[c]]=f));if(r){if(o||e){if(o){for(l=[],c=x.length;c--;)(f=x[c])&&l.push(y[c]=f);o(null,x=[],l,u)}for(c=x.length;c--;)(f=x[c])&&(l=o?K(r,f):d[c])>-1&&(r[l]=!(a[l]=f))}}else x=g(x===a?x.splice(m,x.length):x),o?o(null,a,x,u):Q.apply(a,x)})}function v(e){for(var t,n,r,i=e.length,o=w.relative[e[0].type],a=o||w.relative[" "],s=o?1:0,u=d(function(e){return e===t},a,!0),l=d(function(e){return K(t,e)>-1},a,!0),c=[function(e,n,r){var i=!o&&(r||n!==S)||((t=n).nodeType?u(e,n,r):l(e,n,r));return t=null,i}];s<i;s++)if(n=w.relative[e[s].type])c=[d(p(c),n)];else{if(n=w.filter[e[s].type].apply(null,e[s].matches),n[M]){for(r=++s;r<i&&!w.relative[e[r].type];r++);return m(s>1&&p(c),s>1&&f(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(oe,"$1"),n,s<r&&v(e.slice(s,r)),r<i&&v(e=e.slice(r)),r<i&&f(e))}c.push(n)}return p(c)}function y(e,n){var i=n.length>0,o=e.length>0,a=function(r,a,s,u,l){var c,f,d,p=0,h="0",m=r&&[],v=[],y=S,x=r||o&&w.find.TAG("*",l),b=R+=null==y?1:Math.random()||.1,T=x.length;for(l&&(S=a===A||a||l);h!==T&&null!=(c=x[h]);h++){if(o&&c){for(f=0,a||c.ownerDocument===A||(D(c),s=!L);d=e[f++];)if(d(c,a||A,s)){u.push(c);break}l&&(R=b)}i&&((c=!d&&c)&&p--,r&&m.push(c))}if(p+=h,i&&h!==p){for(f=0;d=n[f++];)d(m,v,a,s);if(r){if(p>0)for(;h--;)m[h]||v[h]||(v[h]=G.call(u));v=g(v)}Q.apply(u,v),l&&!r&&v.length>0&&p+n.length>1&&t.uniqueSort(u)}return l&&(R=b,S=y),m};return i?r(a):a}var x,b,w,T,C,k,_,j,S,E,N,D,A,q,L,O,H,F,P,M="sizzle"+1*new Date,I=e.document,R=0,W=0,$=n(),B=n(),z=n(),X=function(e,t){return e===t&&(N=!0),0},U={}.hasOwnProperty,V=[],G=V.pop,Y=V.push,Q=V.push,J=V.slice,K=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},Z="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",ee="[\\x20\\t\\r\\n\\f]",te="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",ne="\\["+ee+"*("+te+")(?:"+ee+"*([*^$|!~]?=)"+ee+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+te+"))|)"+ee+"*\\]",re=":("+te+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+ne+")*)|.*)\\)|)",ie=new RegExp(ee+"+","g"),oe=new RegExp("^"+ee+"+|((?:^|[^\\\\])(?:\\\\.)*)"+ee+"+$","g"),ae=new RegExp("^"+ee+"*,"+ee+"*"),se=new RegExp("^"+ee+"*([>+~]|"+ee+")"+ee+"*"),ue=new RegExp("="+ee+"*([^\\]'\"]*?)"+ee+"*\\]","g"),le=new RegExp(re),ce=new RegExp("^"+te+"$"),fe={ID:new RegExp("^#("+te+")"),CLASS:new RegExp("^\\.("+te+")"),TAG:new RegExp("^("+te+"|[*])"),ATTR:new RegExp("^"+ne),PSEUDO:new RegExp("^"+re),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ee+"*(even|odd|(([+-]|)(\\d*)n|)"+ee+"*(?:([+-]|)"+ee+"*(\\d+)|))"+ee+"*\\)|)","i"),bool:new RegExp("^(?:"+Z+")$","i"),needsContext:new RegExp("^"+ee+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ee+"*((?:-\\d)?\\d*)"+ee+"*\\)|)(?=[^-]|$)","i")},de=/^(?:input|select|textarea|button)$/i,pe=/^h\d$/i,he=/^[^{]+\{\s*\[native \w/,ge=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,me=/[+~]/,ve=new RegExp("\\\\([\\da-f]{1,6}"+ee+"?|("+ee+")|.)","ig"),ye=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},xe=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,be=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},we=function(){D()},Te=d(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{Q.apply(V=J.call(I.childNodes),I.childNodes),V[I.childNodes.length].nodeType}catch(e){Q={apply:V.length?function(e,t){Y.apply(e,J.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}b=t.support={},C=t.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},D=t.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:I;return r!==A&&9===r.nodeType&&r.documentElement?(A=r,q=A.documentElement,L=!C(A),I!==A&&(n=A.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",we,!1):n.attachEvent&&n.attachEvent("onunload",we)),b.attributes=i(function(e){return e.className="i",!e.getAttribute("className")}),b.getElementsByTagName=i(function(e){return e.appendChild(A.createComment("")),!e.getElementsByTagName("*").length}),b.getElementsByClassName=he.test(A.getElementsByClassName),b.getById=i(function(e){return q.appendChild(e).id=M,!A.getElementsByName||!A.getElementsByName(M).length}),b.getById?(w.filter.ID=function(e){var t=e.replace(ve,ye);return function(e){return e.getAttribute("id")===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&L){var n=t.getElementById(e);return n?[n]:[]}}):(w.filter.ID=function(e){var t=e.replace(ve,ye);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},w.find.ID=function(e,t){if(void 0!==t.getElementById&&L){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),w.find.TAG=b.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):b.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},w.find.CLASS=b.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&L)return t.getElementsByClassName(e)},H=[],O=[],(b.qsa=he.test(A.querySelectorAll))&&(i(function(e){q.appendChild(e).innerHTML="<a id='"+M+"'></a><select id='"+M+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&O.push("[*^$]="+ee+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||O.push("\\["+ee+"*(?:value|"+Z+")"),e.querySelectorAll("[id~="+M+"-]").length||O.push("~="),e.querySelectorAll(":checked").length||O.push(":checked"),e.querySelectorAll("a#"+M+"+*").length||O.push(".#.+[+~]")}),i(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=A.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&O.push("name"+ee+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&O.push(":enabled",":disabled"),q.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&O.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),O.push(",.*:")})),(b.matchesSelector=he.test(F=q.matches||q.webkitMatchesSelector||q.mozMatchesSelector||q.oMatchesSelector||q.msMatchesSelector))&&i(function(e){b.disconnectedMatch=F.call(e,"*"),F.call(e,"[s!='']:x"),H.push("!=",re)}),O=O.length&&new RegExp(O.join("|")),H=H.length&&new RegExp(H.join("|")),t=he.test(q.compareDocumentPosition),P=t||he.test(q.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},X=t?function(e,t){if(e===t)return N=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1,1&n||!b.sortDetached&&t.compareDocumentPosition(e)===n?e===A||e.ownerDocument===I&&P(I,e)?-1:t===A||t.ownerDocument===I&&P(I,t)?1:E?K(E,e)-K(E,t):0:4&n?-1:1)}:function(e,t){if(e===t)return N=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,s=[e],u=[t];if(!i||!o)return e===A?-1:t===A?1:i?-1:o?1:E?K(E,e)-K(E,t):0;if(i===o)return a(e,t);for(n=e;n=n.parentNode;)s.unshift(n);for(n=t;n=n.parentNode;)u.unshift(n);for(;s[r]===u[r];)r++;return r?a(s[r],u[r]):s[r]===I?-1:u[r]===I?1:0},A):A},t.matches=function(e,n){return t(e,null,null,n)},t.matchesSelector=function(e,n){if((e.ownerDocument||e)!==A&&D(e),n=n.replace(ue,"='$1']"),b.matchesSelector&&L&&!z[n+" "]&&(!H||!H.test(n))&&(!O||!O.test(n)))try{var r=F.call(e,n);if(r||b.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return t(n,A,null,[e]).length>0},t.contains=function(e,t){return(e.ownerDocument||e)!==A&&D(e),P(e,t)},t.attr=function(e,t){(e.ownerDocument||e)!==A&&D(e);var n=w.attrHandle[t.toLowerCase()],r=n&&U.call(w.attrHandle,t.toLowerCase())?n(e,t,!L):void 0;return void 0!==r?r:b.attributes||!L?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},t.escape=function(e){return(e+"").replace(xe,be)},t.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},t.uniqueSort=function(e){var t,n=[],r=0,i=0;if(N=!b.detectDuplicates,E=!b.sortStable&&e.slice(0),e.sort(X),N){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return E=null,e},T=t.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=T(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r++];)n+=T(t);return n},w=t.selectors={cacheLength:50,createPseudo:r,match:fe,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(ve,ye),e[3]=(e[3]||e[4]||e[5]||"").replace(ve,ye),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||t.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&t.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return fe.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&le.test(n)&&(t=k(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(ve,ye).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=$[e+" "];return t||(t=new RegExp("(^|"+ee+")"+e+"("+ee+"|$)"))&&$(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,n,r){return function(i){var o=t.attr(i,e);return null==o?"!="===n:!n||(o+="","="===n?o===r:"!="===n?o!==r:"^="===n?r&&0===o.indexOf(r):"*="===n?r&&o.indexOf(r)>-1:"$="===n?r&&o.slice(-r.length)===r:"~="===n?(" "+o.replace(ie," ")+" ").indexOf(r)>-1:"|="===n&&(o===r||o.slice(0,r.length+1)===r+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,d,p,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!u&&!s,x=!1;if(m){if(o){for(;g;){for(d=t;d=d[g];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&y){for(d=m,f=d[M]||(d[M]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===R&&l[1],x=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(x=p=0)||h.pop();)if(1===d.nodeType&&++x&&d===t){c[e]=[R,p,x];break}}else if(y&&(d=t,f=d[M]||(d[M]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),l=c[e]||[],p=l[0]===R&&l[1],x=p),!1===x)for(;(d=++p&&d&&d[g]||(x=p=0)||h.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++x||(y&&(f=d[M]||(d[M]={}),c=f[d.uniqueID]||(f[d.uniqueID]={}),c[e]=[R,x]),d!==t)););return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var i,o=w.pseudos[e]||w.setFilters[e.toLowerCase()]||t.error("unsupported pseudo: "+e);return o[M]?o(n):o.length>1?(i=[e,e,"",n],w.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,t){for(var r,i=o(e,n),a=i.length;a--;)r=K(e,i[a]),e[r]=!(t[r]=i[a])}):function(e){return o(e,0,i)}):o}},pseudos:{not:r(function(e){var t=[],n=[],i=_(e.replace(oe,"$1"));return i[M]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),t[0]=null,!n.pop()}}),has:r(function(e){return function(n){return t(e,n).length>0}}),contains:r(function(e){return e=e.replace(ve,ye),function(t){return(t.textContent||t.innerText||T(t)).indexOf(e)>-1}}),lang:r(function(e){return ce.test(e||"")||t.error("unsupported lang: "+e),e=e.replace(ve,ye).toLowerCase(),function(t){var n;do{if(n=L?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===q},focus:function(e){return e===A.activeElement&&(!A.hasFocus||A.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:s(!1),disabled:s(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!w.pseudos.empty(e)},header:function(e){return pe.test(e.nodeName)},input:function(e){return de.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:u(function(){return[0]}),last:u(function(e,t){return[t-1]}),eq:u(function(e,t,n){return[n<0?n+t:n]}),even:u(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:u(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:u(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:u(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}},w.pseudos.nth=w.pseudos.eq;for(x in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[x]=function(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}(x);for(x in{submit:!0,reset:!0})w.pseudos[x]=function(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}(x);return c.prototype=w.filters=w.pseudos,w.setFilters=new c,k=t.tokenize=function(e,n){var r,i,o,a,s,u,l,c=B[e+" "];if(c)return n?0:c.slice(0);for(s=e,u=[],l=w.preFilter;s;){r&&!(i=ae.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),r=!1,(i=se.exec(s))&&(r=i.shift(),o.push({value:r,type:i[0].replace(oe," ")}),s=s.slice(r.length));for(a in w.filter)!(i=fe[a].exec(s))||l[a]&&!(i=l[a](i))||(r=i.shift(),o.push({value:r,type:a,matches:i}),s=s.slice(r.length));if(!r)break}return n?s.length:s?t.error(e):B(e,u).slice(0)},_=t.compile=function(e,t){var n,r=[],i=[],o=z[e+" "];if(!o){for(t||(t=k(e)),n=t.length;n--;)o=v(t[n]),o[M]?r.push(o):i.push(o);o=z(e,y(i,r)),o.selector=e}return o},j=t.select=function(e,t,n,r){var i,o,a,s,u,c="function"==typeof e&&e,d=!r&&k(e=c.selector||e);if(n=n||[],1===d.length){if(o=d[0]=d[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&L&&w.relative[o[1].type]){if(!(t=(w.find.ID(a.matches[0].replace(ve,ye),t)||[])[0]))return n;c&&(t=t.parentNode),e=e.slice(o.shift().value.length)}for(i=fe.needsContext.test(e)?0:o.length;i--&&(a=o[i],!w.relative[s=a.type]);)if((u=w.find[s])&&(r=u(a.matches[0].replace(ve,ye),me.test(o[0].type)&&l(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&f(o)))return Q.apply(n,r),n;break}}return(c||_(e,d))(r,t,!L,n,!t||me.test(e)&&l(t.parentNode)||t),n},b.sortStable=M.split("").sort(X).join("")===M,b.detectDuplicates=!!N,D(),b.sortDetached=i(function(e){return 1&e.compareDocumentPosition(A.createElement("fieldset"))}),i(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||o("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),b.attributes&&i(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||o("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),i(function(e){return null==e.getAttribute("disabled")})||o(Z,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),t}(o);xe.find=ke,xe.expr=ke.selectors,xe.expr[":"]=xe.expr.pseudos,xe.uniqueSort=xe.unique=ke.uniqueSort,xe.text=ke.getText,xe.isXMLDoc=ke.isXML,xe.contains=ke.contains,xe.escapeSelector=ke.escape;var _e=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&xe(e).is(n))break;r.push(e)}return r},je=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},Se=xe.expr.match.needsContext,Ee=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,Ne=/^.[^:#\[\.,]*$/;xe.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?xe.find.matchesSelector(r,e)?[r]:[]:xe.find.matches(e,xe.grep(t,function(e){return 1===e.nodeType}))},xe.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(xe(e).filter(function(){for(t=0;t<r;t++)if(xe.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)xe.find(e,i[t],n);return r>1?xe.uniqueSort(n):n},filter:function(e){return this.pushStack(c(this,e||[],!1))},not:function(e){return this.pushStack(c(this,e||[],!0))},is:function(e){return!!c(this,"string"==typeof e&&Se.test(e)?xe(e):e||[],!1).length}});var De,Ae=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(xe.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||De,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Ae.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof xe?t[0]:t,xe.merge(this,xe.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:se,!0)),Ee.test(r[1])&&xe.isPlainObject(t))for(r in t)xe.isFunction(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return i=se.getElementById(r[2]),i&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):xe.isFunction(e)?void 0!==n.ready?n.ready(e):e(xe):xe.makeArray(e,this)}).prototype=xe.fn,De=xe(se);var qe=/^(?:parents|prev(?:Until|All))/,Le={children:!0,contents:!0,next:!0,prev:!0};xe.fn.extend({has:function(e){var t=xe(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(xe.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&xe(e);if(!Se.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&xe.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?xe.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?de.call(xe(e),this[0]):de.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(xe.uniqueSort(xe.merge(this.get(),xe(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),xe.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return _e(e,"parentNode")},parentsUntil:function(e,t,n){return _e(e,"parentNode",n)},next:function(e){return f(e,"nextSibling")},prev:function(e){return f(e,"previousSibling")},nextAll:function(e){return _e(e,"nextSibling")},prevAll:function(e){return _e(e,"previousSibling")},nextUntil:function(e,t,n){return _e(e,"nextSibling",n)},prevUntil:function(e,t,n){return _e(e,"previousSibling",n)},siblings:function(e){return je((e.parentNode||{}).firstChild,e)},children:function(e){return je(e.firstChild)},contents:function(e){return l(e,"iframe")?e.contentDocument:(l(e,"template")&&(e=e.content||e),xe.merge([],e.childNodes))}},function(e,t){xe.fn[e]=function(n,r){var i=xe.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=xe.filter(r,i)),this.length>1&&(Le[e]||xe.uniqueSort(i),qe.test(e)&&i.reverse()),this.pushStack(i)}});var Oe=/[^\x20\t\r\n\f]+/g;xe.Callbacks=function(e){e="string"==typeof e?d(e):xe.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<o.length;)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1);e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){xe.each(n,function(n,r){xe.isFunction(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==xe.type(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return xe.each(arguments,function(e,t){for(var n;(n=xe.inArray(t,o,n))>-1;)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?xe.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=n||[],n=[e,n.slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l},xe.extend({Deferred:function(e){var t=[["notify","progress",xe.Callbacks("memory"),xe.Callbacks("memory"),2],["resolve","done",xe.Callbacks("once memory"),xe.Callbacks("once memory"),0,"resolved"],["reject","fail",xe.Callbacks("once memory"),xe.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return a.done(arguments).fail(arguments),this},catch:function(e){return r.then(null,e)},pipe:function(){var e=arguments;return xe.Deferred(function(n){xe.each(t,function(t,r){var i=xe.isFunction(e[r[4]])&&e[r[4]];a[r[1]](function(){var e=i&&i.apply(this,arguments);e&&xe.isFunction(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(e,n,r){function a(e,t,n,r){return function(){var u=this,l=arguments,c=function(){var o,c;if(!(e<s)){if((o=n.apply(u,l))===t.promise())throw new TypeError("Thenable self-resolution");c=o&&("object"===(void 0===o?"undefined":i(o))||"function"==typeof o)&&o.then,xe.isFunction(c)?r?c.call(o,a(s,t,p,r),a(s,t,h,r)):(s++,c.call(o,a(s,t,p,r),a(s,t,h,r),a(s,t,p,t.notifyWith))):(n!==p&&(u=void 0,l=[o]),(r||t.resolveWith)(u,l))}},f=r?c:function(){try{c()}catch(r){xe.Deferred.exceptionHook&&xe.Deferred.exceptionHook(r,f.stackTrace),e+1>=s&&(n!==h&&(u=void 0,l=[r]),t.rejectWith(u,l))}};e?f():(xe.Deferred.getStackHook&&(f.stackTrace=xe.Deferred.getStackHook()),o.setTimeout(f))}}var s=0;return xe.Deferred(function(i){t[0][3].add(a(0,i,xe.isFunction(r)?r:p,i.notifyWith)),t[1][3].add(a(0,i,xe.isFunction(e)?e:p)),t[2][3].add(a(0,i,xe.isFunction(n)?n:h))}).promise()},promise:function(e){return null!=e?xe.extend(e,r):r}},a={};return xe.each(t,function(e,i){var o=i[2],s=i[5];r[i[1]]=o.add,s&&o.add(function(){n=s},t[3-e][2].disable,t[0][2].lock),o.add(i[3].fire),a[i[0]]=function(){return a[i[0]+"With"](this===a?void 0:this,arguments),this},a[i[0]+"With"]=o.fireWith}),r.promise(a),e&&e.call(a,a),a},when:function(e){var t=arguments.length,n=t,r=Array(n),i=le.call(arguments),o=xe.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?le.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(g(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||xe.isFunction(i[n]&&i[n].then)))return o.then();for(;n--;)g(i[n],a(n),o.reject);return o.promise()}});var He=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;xe.Deferred.exceptionHook=function(e,t){o.console&&o.console.warn&&e&&He.test(e.name)&&o.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},xe.readyException=function(e){o.setTimeout(function(){throw e})};var Fe=xe.Deferred();xe.fn.ready=function(e){return Fe.then(e).catch(function(e){xe.readyException(e)}),this},xe.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--xe.readyWait:xe.isReady)||(xe.isReady=!0,!0!==e&&--xe.readyWait>0||Fe.resolveWith(se,[xe]))}}),xe.ready.then=Fe.then,"complete"===se.readyState||"loading"!==se.readyState&&!se.documentElement.doScroll?o.setTimeout(xe.ready):(se.addEventListener("DOMContentLoaded",m),o.addEventListener("load",m));var Pe=function e(t,n,r,i,o,a,s){var u=0,l=t.length,c=null==r;if("object"===xe.type(r)){o=!0;for(u in r)e(t,n,u,r[u],!0,a,s)}else if(void 0!==i&&(o=!0,xe.isFunction(i)||(s=!0),c&&(s?(n.call(t,i),n=null):(c=n,n=function(e,t,n){return c.call(xe(e),n)})),n))for(;u<l;u++)n(t[u],r,s?i:i.call(t[u],u,n(t[u],r)));return o?t:c?n.call(t):l?n(t[0],r):a},Me=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};v.uid=1,v.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Me(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[xe.camelCase(t)]=n;else for(r in t)i[xe.camelCase(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][xe.camelCase(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){Array.isArray(t)?t=t.map(xe.camelCase):(t=xe.camelCase(t),t=t in r?[t]:t.match(Oe)||[]),n=t.length;for(;n--;)delete r[t[n]]}(void 0===t||xe.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!xe.isEmptyObject(t)}};var Ie=new v,Re=new v,We=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,$e=/[A-Z]/g;xe.extend({hasData:function(e){return Re.hasData(e)||Ie.hasData(e)},data:function(e,t,n){return Re.access(e,t,n)},removeData:function(e,t){Re.remove(e,t)},_data:function(e,t,n){return Ie.access(e,t,n)},_removeData:function(e,t){Ie.remove(e,t)}}),xe.fn.extend({data:function(e,t){var n,r,o,a=this[0],s=a&&a.attributes;if(void 0===e){if(this.length&&(o=Re.get(a),1===a.nodeType&&!Ie.get(a,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&(r=s[n].name,0===r.indexOf("data-")&&(r=xe.camelCase(r.slice(5)),x(a,r,o[r])));Ie.set(a,"hasDataAttrs",!0)}return o}return"object"===(void 0===e?"undefined":i(e))?this.each(function(){Re.set(this,e)}):Pe(this,function(t){var n;if(a&&void 0===t){if(void 0!==(n=Re.get(a,e)))return n;if(void 0!==(n=x(a,e)))return n}else this.each(function(){Re.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){Re.remove(this,e)})}}),xe.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Ie.get(e,t),n&&(!r||Array.isArray(n)?r=Ie.access(e,t,xe.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=xe.queue(e,t),r=n.length,i=n.shift(),o=xe._queueHooks(e,t),a=function(){xe.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Ie.get(e,n)||Ie.access(e,n,{empty:xe.Callbacks("once memory").add(function(){Ie.remove(e,[t+"queue",n])})})}}),xe.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?xe.queue(this[0],e):void 0===t?this:this.each(function(){var n=xe.queue(this,e,t);xe._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&xe.dequeue(this,e)})},dequeue:function(e){return this.each(function(){xe.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=xe.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=Ie.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var Be=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ze=new RegExp("^(?:([+-])=|)("+Be+")([a-z%]*)$","i"),Xe=["Top","Right","Bottom","Left"],Ue=function(e,t){return e=t||e,"none"===e.style.display||""===e.style.display&&xe.contains(e.ownerDocument,e)&&"none"===xe.css(e,"display")},Ve=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i},Ge={};xe.fn.extend({show:function(){return T(this,!0)},hide:function(){return T(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){Ue(this)?xe(this).show():xe(this).hide()})}});var Ye=/^(?:checkbox|radio)$/i,Qe=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,Je=/^$|\/(?:java|ecma)script/i,Ke={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};Ke.optgroup=Ke.option,Ke.tbody=Ke.tfoot=Ke.colgroup=Ke.caption=Ke.thead,Ke.th=Ke.td;var Ze=/<|&#?\w+;/;!function(){var e=se.createDocumentFragment(),t=e.appendChild(se.createElement("div")),n=se.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ye.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="<textarea>x</textarea>",ye.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue}();var et=se.documentElement,tt=/^key/,nt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,rt=/^([^.]*)(?:\.(.+)|)/;xe.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,d,p,h,g,m=Ie.get(e);if(m)for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&xe.find.matchesSelector(et,i),n.guid||(n.guid=xe.guid++),(u=m.events)||(u=m.events={}),(a=m.handle)||(a=m.handle=function(t){return void 0!==xe&&xe.event.triggered!==t.type?xe.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Oe)||[""],l=t.length;l--;)s=rt.exec(t[l])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p&&(f=xe.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=xe.event.special[p]||{},c=xe.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&xe.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=u[p])||(d=u[p]=[],d.delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,c):d.push(c),xe.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,d,p,h,g,m=Ie.hasData(e)&&Ie.get(e);if(m&&(u=m.events)){for(t=(t||"").match(Oe)||[""],l=t.length;l--;)if(s=rt.exec(t[l])||[],p=g=s[1],h=(s[2]||"").split(".").sort(),p){for(f=xe.event.special[p]||{},p=(r?f.delegateType:f.bindType)||p,d=u[p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)c=d[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(d.splice(o,1),c.selector&&d.delegateCount--,f.remove&&f.remove.call(e,c));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,m.handle)||xe.removeEvent(e,p,m.handle),delete u[p])}else for(p in u)xe.event.remove(e,p+t[l],n,r,!0);xe.isEmptyObject(u)&&Ie.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=xe.event.fix(e),u=new Array(arguments.length),l=(Ie.get(this,"events")||{})[s.type]||[],c=xe.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){for(a=xe.event.handlers.call(this,s,l),t=0;(i=a[t++])&&!s.isPropagationStopped();)for(s.currentTarget=i.elem,n=0;(o=i.handlers[n++])&&!s.isImmediatePropagationStopped();)s.rnamespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((xe.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)r=t[n],i=r.selector+" ",void 0===a[i]&&(a[i]=r.needsContext?xe(i,this).index(l)>-1:xe.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(xe.Event.prototype,e,{enumerable:!0,configurable:!0,get:xe.isFunction(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[xe.expando]?e:new xe.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==E()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===E()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&l(this,"input"))return this.click(),!1},_default:function(e){return l(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},xe.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},xe.Event=function(e,t){if(!(this instanceof xe.Event))return new xe.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?j:S,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&xe.extend(this,t),this.timeStamp=e&&e.timeStamp||xe.now(),this[xe.expando]=!0},xe.Event.prototype={constructor:xe.Event,isDefaultPrevented:S,isPropagationStopped:S,isImmediatePropagationStopped:S,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=j,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=j,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=j,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},xe.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&tt.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&nt.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},xe.event.addProp),xe.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){xe.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||xe.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),xe.fn.extend({on:function(e,t,n,r){return N(this,e,t,n,r)},one:function(e,t,n,r){return N(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,xe(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"===(void 0===e?"undefined":i(e))){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=S),this.each(function(){xe.event.remove(this,e,n,t)})}});var it=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,ot=/<script|<style|<link/i,at=/checked\s*(?:[^=]|=\s*.checked.)/i,st=/^true\/(.*)/,ut=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;xe.extend({htmlPrefilter:function(e){return e.replace(it,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=xe.contains(e.ownerDocument,e);if(!(ye.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||xe.isXMLDoc(e)))for(a=C(s),o=C(e),r=0,i=o.length;r<i;r++)O(o[r],a[r]);if(t)if(n)for(o=o||C(e),a=a||C(s),r=0,i=o.length;r<i;r++)L(o[r],a[r]);else L(e,s);return a=C(s,"script"),a.length>0&&k(a,!u&&C(e,"script")),s},cleanData:function(e){for(var t,n,r,i=xe.event.special,o=0;void 0!==(n=e[o]);o++)if(Me(n)){if(t=n[Ie.expando]){if(t.events)for(r in t.events)i[r]?xe.event.remove(n,r):xe.removeEvent(n,r,t.handle);n[Ie.expando]=void 0}n[Re.expando]&&(n[Re.expando]=void 0)}}}),xe.fn.extend({detach:function(e){return F(this,e,!0)},remove:function(e){return F(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?xe.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return H(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){D(this,e).appendChild(e)}})},prepend:function(){return H(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=D(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return H(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return H(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(xe.cleanData(C(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return xe.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!ot.test(e)&&!Ke[(Qe.exec(e)||["",""])[1].toLowerCase()]){e=xe.htmlPrefilter(e);try{for(;n<r;n++)t=this[n]||{},1===t.nodeType&&(xe.cleanData(C(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return H(this,arguments,function(t){var n=this.parentNode;xe.inArray(this,e)<0&&(xe.cleanData(C(this)),n&&n.replaceChild(t,this))},e)}}),xe.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){xe.fn[e]=function(e){for(var n,r=[],i=xe(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),xe(i[a])[t](n),fe.apply(r,n.get());return this.pushStack(r)}});var lt=/^margin/,ct=new RegExp("^("+Be+")(?!px)[a-z%]+$","i"),ft=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=o),t.getComputedStyle(e)};!function(){function e(){if(s){s.style.cssText="box-sizing:border-box;position:relative;display:block;margin:auto;border:1px;padding:1px;top:1%;width:50%",s.innerHTML="",et.appendChild(a);var e=o.getComputedStyle(s);t="1%"!==e.top,i="2px"===e.marginLeft,n="4px"===e.width,s.style.marginRight="50%",r="4px"===e.marginRight,et.removeChild(a),s=null}}var t,n,r,i,a=se.createElement("div"),s=se.createElement("div");s.style&&(s.style.backgroundClip="content-box",s.cloneNode(!0).style.backgroundClip="",ye.clearCloneStyle="content-box"===s.style.backgroundClip,a.style.cssText="border:0;width:8px;height:0;top:0;left:-9999px;padding:0;margin-top:1px;position:absolute",a.appendChild(s),xe.extend(ye,{pixelPosition:function(){return e(),t},boxSizingReliable:function(){return e(),n},pixelMarginRight:function(){return e(),r},reliableMarginLeft:function(){return e(),i}}))}();var dt=/^(none|table(?!-c[ea]).+)/,pt=/^--/,ht={position:"absolute",visibility:"hidden",display:"block"},gt={letterSpacing:"0",fontWeight:"400"},mt=["Webkit","Moz","ms"],vt=se.createElement("div").style;xe.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=P(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,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:"cssFloat"},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=xe.camelCase(t),l=pt.test(t),c=e.style;if(l||(t=R(u)),s=xe.cssHooks[t]||xe.cssHooks[u],void 0===n)return s&&"get"in s&&void 0!==(o=s.get(e,!1,r))?o:c[t];a=void 0===n?"undefined":i(n),"string"===a&&(o=ze.exec(n))&&o[1]&&(n=b(e,t,o),a="number"),null!=n&&n===n&&("number"===a&&(n+=o&&o[3]||(xe.cssNumber[u]?"":"px")),ye.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),s&&"set"in s&&void 0===(n=s.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=xe.camelCase(t);return pt.test(t)||(t=R(s)),a=xe.cssHooks[t]||xe.cssHooks[s],a&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=P(e,t,r)),"normal"===i&&t in gt&&(i=gt[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),xe.each(["height","width"],function(e,t){xe.cssHooks[t]={get:function(e,n,r){if(n)return!dt.test(xe.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?B(e,t,r):Ve(e,ht,function(){return B(e,t,r)})},set:function(e,n,r){var i,o=r&&ft(e),a=r&&$(e,t,r,"border-box"===xe.css(e,"boxSizing",!1,o),o);return a&&(i=ze.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=xe.css(e,t)),W(e,n,a)}}}),xe.cssHooks.marginLeft=M(ye.reliableMarginLeft,function(e,t){if(t)return(parseFloat(P(e,"marginLeft"))||e.getBoundingClientRect().left-Ve(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),xe.each({margin:"",padding:"",border:"Width"},function(e,t){xe.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+Xe[r]+t]=o[r]||o[r-2]||o[0];return i}},lt.test(e)||(xe.cssHooks[e+t].set=W)}),xe.fn.extend({css:function(e,t){return Pe(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=ft(e),i=t.length;a<i;a++)o[t[a]]=xe.css(e,t[a],!1,r);return o}return void 0!==n?xe.style(e,t,n):xe.css(e,t)},e,t,arguments.length>1)}}),xe.Tween=z,z.prototype={constructor:z,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||xe.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(xe.cssNumber[n]?"":"px")},cur:function(){var e=z.propHooks[this.prop];return e&&e.get?e.get(this):z.propHooks._default.get(this)},run:function(e){var t,n=z.propHooks[this.prop];return this.options.duration?this.pos=t=xe.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):z.propHooks._default.set(this),this}},z.prototype.init.prototype=z.prototype,z.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=xe.css(e.elem,e.prop,""),t&&"auto"!==t?t:0)},set:function(e){xe.fx.step[e.prop]?xe.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[xe.cssProps[e.prop]]&&!xe.cssHooks[e.prop]?e.elem[e.prop]=e.now:xe.style(e.elem,e.prop,e.now+e.unit)}}},z.propHooks.scrollTop=z.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},xe.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},xe.fx=z.prototype.init,xe.fx.step={};var yt,xt,bt=/^(?:toggle|show|hide)$/,wt=/queueHooks$/;xe.Animation=xe.extend(J,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return b(n.elem,e,ze.exec(t),n),n}]},tweener:function(e,t){xe.isFunction(e)?(t=e,e=["*"]):e=e.match(Oe);for(var n,r=0,i=e.length;r<i;r++)n=e[r],J.tweeners[n]=J.tweeners[n]||[],J.tweeners[n].unshift(t)},prefilters:[Y],prefilter:function(e,t){t?J.prefilters.unshift(e):J.prefilters.push(e)}}),xe.speed=function(e,t,n){var r=e&&"object"===(void 0===e?"undefined":i(e))?xe.extend({},e):{complete:n||!n&&t||xe.isFunction(e)&&e,duration:e,easing:n&&t||t&&!xe.isFunction(t)&&t};return xe.fx.off?r.duration=0:"number"!=typeof |